pinia-plugin-subscription 0.1.6-beta.0 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- (function(p,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("pinia")):typeof define=="function"&&define.amd?define(["exports","pinia"],F):(p=typeof globalThis<"u"?globalThis:p||self,F(p["pinia-plugin-subscription"]={},p.Pinia))})(this,(function(p,F){"use strict";class Nt{_console;_createInstance;_name;_pluginOptions;_storeInstance;_resetStoreCallback;_storeOnActionSubscription;_storeMutationSubscription;_subscriptions;pluginCreated;execution;hydrationScheduler;get console(){return this._console??console}get name(){return this._name}get pluginOptions(){return this._pluginOptions??{}}set pluginOptions(t){this._pluginOptions=t}get resetStoreCallback(){return this._resetStoreCallback}get storeOnActionSubscription(){return this._storeOnActionSubscription}get storeMutationSubscription(){return this._storeMutationSubscription}get subscriptions(){return this._subscriptions}set subscriptions(t){this._subscriptions=t}constructor(t,n,s){this._name=t,this._createInstance=n,s&&(this._console=s)}invoke({store:t,options:n},s){return this._storeInstance=this._createInstance(t,{...n,...this.pluginOptions},s,this.console),this._storeInstance?(this._subscriptions=this._storeInstance.getSubscriptions(),this._storeMutationSubscription=this._storeInstance.storeSubscribe,this._storeOnActionSubscription=this._storeInstance.onAction,this.pluginCreated&&this.pluginCreated(t),!0):!1}}class Fe{_console;_debug=!1;get console(){return this._console??console}set console(t){this._console=t}get debug(){return this._debug}set debug(t){this._debug=t}constructor(t,n){this._debug=t,n&&(this._console=n)}debugLog(...t){this._debug&&(Array.isArray(t)&&(t[0]=`${this._className} - ${t[0]}`),this.console.log(...t))}logError(...t){this.console.error(...t)}}const pe="pinia-plugin-subscription",Ct=(e,t="white")=>`background-color: ${e}; color: ${t}; padding: 1px; margin-right: 5px; font-size: 12px`;function Rt(e,t){if(!e)throw new Error("Style instructions are required");console.log("%c%s",e,t.shift(),...t)}class ke{_bgColor="#ffec73";_color="green";_icon="🍍⚡";_errorBgColor="#d24545";_errorColor="white";_errorIcon="🍍⚠️";_styles={error:{bgColor:this._errorBgColor,color:this._errorColor,icon:this._errorIcon},info:{bgColor:this._bgColor,color:this._color,icon:this._icon}};formatMessage(t,n){return` [${n} ${pe}] - ${t} `}generateStyle(t){return Ct(t.bgColor,t.color)}getStyleDefinition(t){return this._styles[t??"info"]}log(...t){this.useLog(this.getStyleDefinition(),t)}error(...t){this.useLog(this.getStyleDefinition("error"),t)}rebuildArgs(t,n){if(typeof t=="string")return[this.formatMessage(t,n)];if(Array.isArray(t))return[this.formatMessage(t.shift(),n),...t??[]]}useLog(t,n){Rt(this.generateStyle(t),this.rebuildArgs(n,t.icon))}}class xt extends ke{_pluginName=pe}const At=new xt;function X(e){return e?Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:typeof e=="string"?e.trim()==="":!1:!(typeof e=="boolean"||typeof e=="number")}const Ke="PluginSubscription",Dt={environment:"both",hydration:"immediate"};function It(e){if(typeof window<"u"&&typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(()=>globalThis.setTimeout(e,0));return}globalThis.setTimeout(e,0)}function $t(e){return e!==void 0&&!Array.isArray(e)}class _e extends Fe{_className=Ke;_hydrationScheduler;_options;_pluginDebug;_resetStoreCallback=[];_subscribers=[];_subscribersDelivered=new Set;_subscribersScheduled=new Set;_subscriptions=[];_subscriptionsDelivered=new Set;_subscriptionsScheduled=new Set;set subscribers(t){this._subscribers=t}get subscriptions(){if(!X(this._subscriptions))return this._subscriptions}constructor(t,n,s){const r=Array.isArray(n)?n:void 0,i=$t(n)?n:s;super(Array.isArray(r)&&!!r?.includes(Ke),At),this._hydrationScheduler=i?.hydrationScheduler??It,this._options=i,this._pluginDebug=Array.isArray(r)?r:void 0,this._subscribers=t}addResetStoreCallback(t){this._resetStoreCallback.push(t)}defineCurrentEnvironment(){return this._options?.runtimeEnvironment??(typeof window>"u"?"server":"client")}definePluginDebug(t){return!!this._pluginDebug?.includes(t.name)}definePluginExecution(t){return{...Dt,...this._options?.execution??{},...t.execution??{},...this._options?.subscriberExecution?.[t.name]??{}}}defineHydrationScheduler(t){return t.hydrationScheduler??this._hydrationScheduler}defineSubscriberKey(t,n){return`${t.name}-${n.$id}`}defineSubscriptionKey(t,n){return`${t}-${n.$id}`}executeResetStoreCallbacks(t){this._resetStoreCallback.forEach(n=>n(t))}executeSubscriber(t,n){const s=this.defineSubscriberKey(n,t.store);this._subscribersDelivered.has(s)||n.invoke(t,this.definePluginDebug(n))&&(this._subscribersDelivered.add(s),n.subscriptions&&this.subscriptionDelivery(t,n.subscriptions),n.storeMutationSubscription&&this.storeMutationSubscription(n.storeMutationSubscription),n.storeOnActionSubscription&&this.storeOnActionSubscription(n.storeOnActionSubscription),n.resetStoreCallback&&this.addResetStoreCallback(n.resetStoreCallback))}executeSubscriberSafely(t,n){try{this.executeSubscriber(t,n)}catch(s){this.logError(s,t.store,t.options)}}queueSubscriberExecution(t,n,s){const r=this.defineHydrationScheduler(n);this._subscribersScheduled.add(s),r(()=>{this._subscribersScheduled.delete(s),this.executeSubscriberSafely(t,n)})}shouldInvokePlugin(t){const n=this.defineCurrentEnvironment();return t.environment==="both"||t.environment===n}shouldScheduleAfterHydration(t){return this.defineCurrentEnvironment()==="client"&&t.hydration==="defer"}plugin({store:t,options:n}){if(this._subscribers.length){this.debugLog(`plugin() - ${t.$id}`,["subscriber:",this._subscribers,"store:",t,"options:",n]);try{this._subscribers.forEach(s=>{const r=this.defineSubscriberKey(s,t),i=this.definePluginExecution(s);if(!(this._subscribersDelivered.has(r)||this._subscribersScheduled.has(r))&&this.shouldInvokePlugin(i)){if(this.shouldScheduleAfterHydration(i)){this.queueSubscriberExecution({store:t,options:n},s,r);return}this.executeSubscriber({store:t,options:n},s)}}),this.rewriteResetStore({store:t},JSON.stringify(t.$state),Object.assign({},t))}catch(s){this.logError(s,t,n)}}}rewriteResetStore({store:t},n,s){t.$reset=()=>{this.debugLog("rewriteResetStore()",{initState:n,store:t,customStore:s}),this.executeResetStoreCallbacks(t),t.$patch(JSON.parse(n))}}storeOnActionSubscription(t){const{store:n,callback:s}=t();n.$onAction(({after:r,args:i,name:o})=>{this.debugLog(`storeOnActionSubscription ${n.$id}`,{after:r,args:i,name:o,store:n}),s({after:r,args:i,name:o})})}storeMutationSubscription(t){const{store:n,callback:s}=t();n.$subscribe(r=>{this.debugLog(`$subscribe ${n.$id}`,{mutation:r,store:n}),s(r)})}subscriptionDelivery(t,n){Object.entries(n).forEach(([s,r])=>{const i=this.defineSubscriptionKey(s,t.store),o=this.definePluginExecution(r.subscription);if(!(this._subscriptionsDelivered.has(i)||this._subscriptionsScheduled.has(i))&&this.shouldInvokePlugin(o)){if(this.shouldScheduleAfterHydration(o)){const c=this.defineHydrationScheduler(r.subscription);this._subscriptionsScheduled.add(i),c(()=>{this._subscriptionsScheduled.delete(i),this.subscriptionDeliverySafely(t,s,r)});return}this.subscriptionDeliverySafely(t,s,r)}})}subscriptionDeliverySafely({store:t,options:n},s,r){try{if(this._subscriptionsDelivered.has(this.defineSubscriptionKey(s,t)))return;const{subscription:i,subscriptionOptions:o,stores:c}=r;this.debugLog(`subscriptionDelivery() - store: ${t.$id}`,["pluginName:",s,"subscription:",i,"options:",r,"stores:",c]);const l={storeOptions:{...n?.storeOptions??{},...o}};i.invoke({store:t,options:{...n,...l}},this.debug),this._subscriptionsDelivered.add(this.defineSubscriptionKey(s,t)),X(c)||c?.forEach(a=>i.invoke({store:a,options:{...n,...l,...a?.storeOptions??{}}},this.debug))}catch(i){this.logError("subscriptionDelivery()",i,t,n)}}}function Vt(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ge=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const je=()=>{},Tt=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Pt=e=>e.startsWith("onUpdate:"),$=Object.assign,Mt=Object.prototype.hasOwnProperty,be=(e,t)=>Mt.call(e,t),_=Array.isArray,z=e=>He(e)==="[object Map]",A=e=>typeof e=="function",N=e=>typeof e=="string",V=e=>typeof e=="symbol",b=e=>e!==null&&typeof e=="object",Ft=Object.prototype.toString,He=e=>Ft.call(e),Le=e=>He(e).slice(8,-1),Z=e=>N(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,kt=(e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),T=(e,t)=>!Object.is(e,t);let We;const ee=()=>We||(We=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Se(e){if(_(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=N(s)?Lt(s):Se(s);if(r)for(const i in r)t[i]=r[i]}return t}else if(N(e)||b(e))return e}const Kt=/;(?![^(]*\))/g,jt=/:([^]+)/,Ht=/\/\*[^]*?\*\//g;function Lt(e){const t={};return e.replace(Ht,"").split(Kt).forEach(n=>{if(n){const s=n.split(jt);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function me(e){let t="";if(N(e))t=e;else if(_(e))for(let n=0;n<e.length;n++){const s=me(e[n]);s&&(t+=s+" ")}else if(b(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function k(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let Wt,ze=0,ye;function Ee(){ze++}function we(){if(--ze>0)return;let e;for(;ye;){let t=ye;for(ye=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}let te=!0;const qe=[];function ne(){qe.push(te),te=!1}function re(){const e=qe.pop();te=e===void 0?!0:e}class Ue{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){}trigger(t){this.version++,this.notify(t)}notify(t){Ee();try{if(process.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger($({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{we()}}}const se=new WeakMap,P=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Oe=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),q=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function g(e,t,n){if(te&&Wt){let s=se.get(e);s||se.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Ue),r.map=s,r.key=n),process.env.NODE_ENV!=="production"?r.track({target:e,type:t,key:n}):r.track()}}function D(e,t,n,s,r,i){const o=se.get(e);if(!o)return;const c=l=>{l&&(process.env.NODE_ENV!=="production"?l.trigger({target:e,type:t,key:n,newValue:s,oldValue:r,oldTarget:i}):l.trigger())};if(Ee(),t==="clear")o.forEach(c);else{const l=_(e),a=l&&Z(n);if(l&&n==="length"){const h=Number(s);o.forEach((u,f)=>{(f==="length"||f===q||!V(f)&&f>=h)&&c(u)})}else switch((n!==void 0||o.has(void 0))&&c(o.get(n)),a&&c(o.get(q)),t){case"add":l?a&&c(o.get("length")):(c(o.get(P)),z(e)&&c(o.get(Oe)));break;case"delete":l||(c(o.get(P)),z(e)&&c(o.get(Oe)));break;case"set":z(e)&&c(o.get(P));break}}we()}function zt(e,t){const n=se.get(e);return n&&n.get(t)}function K(e){const t=d(e);return t===e?t:(g(t,"iterate",q),m(e)?t:t.map(R))}function ve(e){return g(e=d(e),"iterate",q),e}function w(e,t){return O(e)?J(Ae(e)?R(t):t):R(t)}const qt={__proto__:null,[Symbol.iterator](){return Ne(this,Symbol.iterator,e=>w(this,e))},concat(...e){return K(this).concat(...e.map(t=>_(t)?K(t):t))},entries(){return Ne(this,"entries",e=>(e[1]=w(this,e[1]),e))},every(e,t){return C(this,"every",e,t,void 0,arguments)},filter(e,t){return C(this,"filter",e,t,n=>n.map(s=>w(this,s)),arguments)},find(e,t){return C(this,"find",e,t,n=>w(this,n),arguments)},findIndex(e,t){return C(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return C(this,"findLast",e,t,n=>w(this,n),arguments)},findLastIndex(e,t){return C(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return C(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ce(this,"includes",e)},indexOf(...e){return Ce(this,"indexOf",e)},join(e){return K(this).join(e)},lastIndexOf(...e){return Ce(this,"lastIndexOf",e)},map(e,t){return C(this,"map",e,t,void 0,arguments)},pop(){return U(this,"pop")},push(...e){return U(this,"push",e)},reduce(e,...t){return Be(this,"reduce",e,t)},reduceRight(e,...t){return Be(this,"reduceRight",e,t)},shift(){return U(this,"shift")},some(e,t){return C(this,"some",e,t,void 0,arguments)},splice(...e){return U(this,"splice",e)},toReversed(){return K(this).toReversed()},toSorted(e){return K(this).toSorted(e)},toSpliced(...e){return K(this).toSpliced(...e)},unshift(...e){return U(this,"unshift",e)},values(){return Ne(this,"values",e=>w(this,e))}};function Ne(e,t,n){const s=ve(e),r=s[t]();return s!==e&&!m(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const Ut=Array.prototype;function C(e,t,n,s,r,i){const o=ve(e),c=o!==e&&!m(e),l=o[t];if(l!==Ut[t]){const u=l.apply(e,i);return c?R(u):u}let a=n;o!==e&&(c?a=function(u,f){return n.call(this,w(e,u),f,e)}:n.length>2&&(a=function(u,f){return n.call(this,u,f,e)}));const h=l.call(o,a,s);return c&&r?r(h):h}function Be(e,t,n,s){const r=ve(e),i=r!==e&&!m(e);let o=n,c=!1;r!==e&&(i?(c=s.length===0,o=function(a,h,u){return c&&(c=!1,a=w(e,a)),n.call(this,a,w(e,h),u,e)}):n.length>3&&(o=function(a,h,u){return n.call(this,a,h,u,e)}));const l=r[t](o,...s);return c?w(e,l):l}function Ce(e,t,n){const s=d(e);g(s,"iterate",q);const r=s[t](...n);return(r===-1||r===!1)&&B(n[0])?(n[0]=d(n[0]),s[t](...n)):r}function U(e,t,n=[]){ne(),Ee();const s=d(e)[t].apply(e,n);return we(),re(),s}const Bt=Vt("__proto__,__v_isRef,__isVue"),Je=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(V));function Jt(e){V(e)||(e=String(e));const t=d(this);return g(t,"has",e),t.hasOwnProperty(e)}class Ye{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?sn:Ze:i?rn:Xe).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=_(t);if(!r){let l;if(o&&(l=qt[n]))return l;if(n==="hasOwnProperty")return Jt}const c=Reflect.get(t,n,S(t)?t:s);if((V(n)?Je.has(n):Bt(n))||(r||g(t,"get",n),i))return c;if(S(c)){const l=o&&Z(n)?c:c.value;return r&&b(l)?xe(l):l}return b(c)?r?xe(c):et(c):c}}class Yt extends Ye{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];const o=_(t)&&Z(n);if(!this._isShallow){const a=O(i);if(!m(s)&&!O(s)&&(i=d(i),s=d(s)),!o&&S(i)&&!S(s))return a?(process.env.NODE_ENV!=="production"&&k(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(i.value=s,!0)}const c=o?Number(n)<t.length:be(t,n),l=Reflect.set(t,n,s,S(t)?t:r);return t===d(r)&&l&&(c?T(s,i)&&D(t,"set",n,s,i):D(t,"add",n,s)),l}deleteProperty(t,n){const s=be(t,n),r=t[n],i=Reflect.deleteProperty(t,n);return i&&s&&D(t,"delete",n,void 0,r),i}has(t,n){const s=Reflect.has(t,n);return(!V(n)||!Je.has(n))&&g(t,"has",n),s}ownKeys(t){return g(t,"iterate",_(t)?"length":P),Reflect.ownKeys(t)}}class Gt extends Ye{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&k(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&k(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const Qt=new Yt,Xt=new Gt,Re=e=>e,ie=e=>Reflect.getPrototypeOf(e);function Zt(e,t,n){return function(...s){const r=this.__v_raw,i=d(r),o=z(i),c=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,a=r[e](...s),h=n?Re:t?J:R;return!t&&g(i,"iterate",l?Oe:P),$(Object.create(a),{next(){const{value:u,done:f}=a.next();return f?{value:u,done:f}:{value:c?[h(u[0]),h(u[1])]:h(u),done:f}}})}}function oe(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";k(`${kt(e)} operation ${n}failed: target is readonly.`,d(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function en(e,t){const n={get(r){const i=this.__v_raw,o=d(i),c=d(r);e||(T(r,c)&&g(o,"get",r),g(o,"get",c));const{has:l}=ie(o),a=t?Re:e?J:R;if(l.call(o,r))return a(i.get(r));if(l.call(o,c))return a(i.get(c));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&g(d(r),"iterate",P),r.size},has(r){const i=this.__v_raw,o=d(i),c=d(r);return e||(T(r,c)&&g(o,"has",r),g(o,"has",c)),r===c?i.has(r):i.has(r)||i.has(c)},forEach(r,i){const o=this,c=o.__v_raw,l=d(c),a=t?Re:e?J:R;return!e&&g(l,"iterate",P),c.forEach((h,u)=>r.call(i,a(h),a(u),o))}};return $(n,e?{add:oe("add"),set:oe("set"),delete:oe("delete"),clear:oe("clear")}:{add(r){const i=d(this),o=ie(i),c=d(r),l=!t&&!m(r)&&!O(r)?c:r;return o.has.call(i,l)||T(r,l)&&o.has.call(i,r)||T(c,l)&&o.has.call(i,c)||(i.add(l),D(i,"add",l,l)),this},set(r,i){!t&&!m(i)&&!O(i)&&(i=d(i));const o=d(this),{has:c,get:l}=ie(o);let a=c.call(o,r);a?process.env.NODE_ENV!=="production"&&Qe(o,c,r):(r=d(r),a=c.call(o,r));const h=l.call(o,r);return o.set(r,i),a?T(i,h)&&D(o,"set",r,i,h):D(o,"add",r,i),this},delete(r){const i=d(this),{has:o,get:c}=ie(i);let l=o.call(i,r);l?process.env.NODE_ENV!=="production"&&Qe(i,o,r):(r=d(r),l=o.call(i,r));const a=c?c.call(i,r):void 0,h=i.delete(r);return l&&D(i,"delete",r,void 0,a),h},clear(){const r=d(this),i=r.size!==0,o=process.env.NODE_ENV!=="production"?z(r)?new Map(r):new Set(r):void 0,c=r.clear();return i&&D(r,"clear",void 0,void 0,o),c}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Zt(r,e,t)}),n}function Ge(e,t){const n=en(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(be(n,r)&&r in s?n:s,r,i)}const tn={get:Ge(!1,!1)},nn={get:Ge(!0,!1)};function Qe(e,t,n){const s=d(n);if(s!==n&&t.call(e,s)){const r=Le(e);k(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Xe=new WeakMap,rn=new WeakMap,Ze=new WeakMap,sn=new WeakMap;function on(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function et(e){return O(e)?e:tt(e,!1,Qt,tn,Xe)}function xe(e){return tt(e,!0,Xt,nn,Ze)}function tt(e,t,n,s,r){if(!b(e))return process.env.NODE_ENV!=="production"&&k(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=r.get(e);if(i)return i;const o=on(Le(e));if(o===0)return e;const c=new Proxy(e,o===2?s:n);return r.set(e,c),c}function Ae(e){return O(e)?Ae(e.__v_raw):!!(e&&e.__v_isReactive)}function O(e){return!!(e&&e.__v_isReadonly)}function m(e){return!!(e&&e.__v_isShallow)}function B(e){return e?!!e.__v_raw:!1}function d(e){const t=e&&e.__v_raw;return t?d(t):e}const R=e=>b(e)?et(e):e,J=e=>b(e)?xe(e):e;function S(e){return e?e.__v_isRef===!0:!1}function nt(e){return cn(e,!1)}function cn(e,t){return S(e)?e:new un(e,t)}class un{constructor(t,n){this.dep=new Ue,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:d(t),this._value=n?t:R(t),this.__v_isShallow=n}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||m(t)||O(t);t=s?t:d(t),T(t,n)&&(this._rawValue=t,this._value=s?t:R(t),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function ln(e){return S(e)?e.value:e}class an{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=V(n)?n:String(n),this._raw=d(t);let r=!0,i=t;if(!_(t)||V(this._key)||!Z(this._key))do r=!B(i)||m(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=ln(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&S(this._raw[this._key])){const n=this._object[this._key];if(S(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return zt(this._raw,this._key)}}class fn{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function dn(e,t,n){return S(e)?e:A(e)?new fn(e):b(e)&&arguments.length>1?hn(e,t,n):nt(e)}function hn(e,t,n){return new an(e,t,n)}const M=[];function pn(e){M.push(e)}function _n(){M.pop()}let De=!1;function j(e,...t){if(De)return;De=!0,ne();const n=M.length?M[M.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=gn();if(s)Ie(s,n,11,[e+t.map(i=>{var o,c;return(c=(o=i.toString)==null?void 0:o.call(i))!=null?c:JSON.stringify(i)}).join(""),n&&n.proxy,r.map(({vnode:i})=>`at <${St(n,i.type)}>`).join(`
1
+ (function(p,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("pinia")):typeof define=="function"&&define.amd?define(["exports","pinia"],k):(p=typeof globalThis<"u"?globalThis:p||self,k(p["pinia-plugin-subscription"]={},p.Pinia))})(this,(function(p,k){"use strict";class Rt{_console;_createInstance;_name;_pluginOptions;_storeInstance;_resetStoreCallback;_storeOnActionSubscription;_storeMutationSubscription;_subscriptions;pluginCreated;execution;hydrationScheduler;get console(){return this._console??console}get name(){return this._name}get storeInstance(){return this._storeInstance}get pluginOptions(){return this._pluginOptions??{}}set pluginOptions(t){this._pluginOptions=t}get resetStoreCallback(){return this._resetStoreCallback}get storeOnActionSubscription(){return this._storeOnActionSubscription}get storeMutationSubscription(){return this._storeMutationSubscription}get subscriptions(){return this._subscriptions}set subscriptions(t){this._subscriptions=t}constructor(t,n,s){this._name=t,this._createInstance=n,s&&(this._console=s)}hydrate(t,n){}afterHydration(t,n){}invoke({store:t,options:n},s){return this._storeInstance=this._createInstance(t,{...n,...this.pluginOptions},s,this.console),this._storeInstance?(this._subscriptions=this._storeInstance.getSubscriptions(),this._storeMutationSubscription=this._storeInstance.storeSubscribe,this._storeOnActionSubscription=this._storeInstance.onAction,this.pluginCreated&&this.pluginCreated(t),!0):!1}}class ke{_console;_debug=!1;get console(){return this._console??console}set console(t){this._console=t}get debug(){return this._debug}set debug(t){this._debug=t}constructor(t,n){this._debug=t,n&&(this._console=n)}debugLog(...t){this._debug&&(Array.isArray(t)&&(t[0]=`${this._className} - ${t[0]}`),this.console.log(...t))}logError(...t){this.console.error(...t)}}const pe="pinia-plugin-subscription",At=(e,t="white")=>`background-color: ${e}; color: ${t}; padding: 1px; margin-right: 5px; font-size: 12px`;function xt(e,t){if(!e)throw new Error("Style instructions are required");console.log("%c%s",e,t.shift(),...t)}class Ke{_bgColor="#ffec73";_color="green";_icon="🍍⚡";_errorBgColor="#d24545";_errorColor="white";_errorIcon="🍍⚠️";_styles={error:{bgColor:this._errorBgColor,color:this._errorColor,icon:this._errorIcon},info:{bgColor:this._bgColor,color:this._color,icon:this._icon}};formatMessage(t,n){return` [${n} ${pe}] - ${t} `}generateStyle(t){return At(t.bgColor,t.color)}getStyleDefinition(t){return this._styles[t??"info"]}log(...t){this.useLog(this.getStyleDefinition(),t)}error(...t){this.useLog(this.getStyleDefinition("error"),t)}rebuildArgs(t,n){if(typeof t=="string")return[this.formatMessage(t,n)];if(Array.isArray(t))return[this.formatMessage(t.shift(),n),...t??[]]}useLog(t,n){xt(this.generateStyle(t),this.rebuildArgs(n,t.icon))}}class Dt extends Ke{_pluginName=pe}const It=new Dt;function X(e){return e?Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:typeof e=="string"?e.trim()==="":!1:!(typeof e=="boolean"||typeof e=="number")}const He="PluginSubscription",$t={environment:"both",hydration:"immediate"};function Tt(e){if(typeof window<"u"&&typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(()=>globalThis.setTimeout(e,0));return}globalThis.setTimeout(e,0)}function Vt(e){return e!==void 0&&!Array.isArray(e)}class _e extends ke{_className=He;_hydrationScheduler;_options;_pluginDebug;_resetStoreCallback=[];_subscribers=[];_subscribersDelivered=new Set;_subscribersScheduled=new Set;_subscriptions=[];_subscriptionsDelivered=new Set;_subscriptionsScheduled=new Set;set subscribers(t){this._subscribers=t}get subscriptions(){if(!X(this._subscriptions))return this._subscriptions}constructor(t,n,s){const r=Array.isArray(n)?n:void 0,i=Vt(n)?n:s;super(Array.isArray(r)&&!!r?.includes(He),It),this._hydrationScheduler=i?.hydrationScheduler??Tt,this._options=i,this._pluginDebug=Array.isArray(r)?r:void 0,this._subscribers=t}addResetStoreCallback(t){this._resetStoreCallback.push(t)}defineCurrentEnvironment(){return this._options?.runtimeEnvironment??(typeof window>"u"?"server":"client")}definePluginDebug(t){return!!this._pluginDebug?.includes(t.name)}definePluginExecution(t){return{...$t,...this._options?.execution??{},...t.execution??{},...this._options?.subscriberExecution?.[t.name]??{}}}defineHydrationScheduler(t){return t.hydrationScheduler??this._hydrationScheduler}defineSubscriberKey(t,n){return`${t.name}-${n.$id}`}defineSubscriptionKey(t,n){return`${t}-${n.$id}`}executeResetStoreCallbacks(t){this._resetStoreCallback.forEach(n=>n(t))}executeSubscriber(t,n){const s=this.defineSubscriberKey(n,t.store),r=this.definePluginDebug(n);if(this._subscribersDelivered.has(s)||!n.invoke(t,r))return;this._subscribersDelivered.add(s);const i=n.hydrate?.(t,r);i&&typeof i.then=="function"&&i.catch(c=>this.logError(c,t.store,t.options));const o=n.afterHydration?.(t,r);o&&typeof o.then=="function"&&o.catch(c=>this.logError(c,t.store,t.options)),n.subscriptions&&this.subscriptionDelivery(t,n.subscriptions),n.storeMutationSubscription&&this.storeMutationSubscription(n.storeMutationSubscription),n.storeOnActionSubscription&&this.storeOnActionSubscription(n.storeOnActionSubscription),n.resetStoreCallback&&this.addResetStoreCallback(n.resetStoreCallback)}executeSubscriberSafely(t,n){try{this.executeSubscriber(t,n)}catch(s){this.logError(s,t.store,t.options)}}queueSubscriberExecution(t,n,s){const r=this.defineHydrationScheduler(n);this._subscribersScheduled.add(s),r(()=>{this._subscribersScheduled.delete(s),this.executeSubscriberSafely(t,n)})}shouldInvokePlugin(t){const n=this.defineCurrentEnvironment();return t.environment==="both"||t.environment===n}shouldScheduleAfterHydration(t){return this.defineCurrentEnvironment()==="client"&&t.hydration==="defer"}plugin({store:t,options:n}){if(this._subscribers.length){this.debugLog(`plugin() - ${t.$id}`,["subscriber:",this._subscribers,"store:",t,"options:",n]);try{this._subscribers.forEach(s=>{const r=this.defineSubscriberKey(s,t),i=this.definePluginExecution(s);if(!(this._subscribersDelivered.has(r)||this._subscribersScheduled.has(r))&&this.shouldInvokePlugin(i)){if(this.shouldScheduleAfterHydration(i)){this.queueSubscriberExecution({store:t,options:n},s,r);return}this.executeSubscriber({store:t,options:n},s)}}),this.rewriteResetStore({store:t},JSON.stringify(t.$state),Object.assign({},t))}catch(s){this.logError(s,t,n)}}}rewriteResetStore({store:t},n,s){t.$reset=()=>{this.debugLog("rewriteResetStore()",{initState:n,store:t,customStore:s}),this.executeResetStoreCallbacks(t),t.$patch(JSON.parse(n))}}storeOnActionSubscription(t){const{store:n,callback:s}=t();n.$onAction(({after:r,args:i,name:o})=>{this.debugLog(`storeOnActionSubscription ${n.$id}`,{after:r,args:i,name:o,store:n}),s({after:r,args:i,name:o})})}storeMutationSubscription(t){const{store:n,callback:s}=t();n.$subscribe(r=>{this.debugLog(`$subscribe ${n.$id}`,{mutation:r,store:n}),s(r)})}subscriptionDelivery(t,n){Object.entries(n).forEach(([s,r])=>{const i=this.defineSubscriptionKey(s,t.store),o=this.definePluginExecution(r.subscription);if(!(this._subscriptionsDelivered.has(i)||this._subscriptionsScheduled.has(i))&&this.shouldInvokePlugin(o)){if(this.shouldScheduleAfterHydration(o)){const c=this.defineHydrationScheduler(r.subscription);this._subscriptionsScheduled.add(i),c(()=>{this._subscriptionsScheduled.delete(i),this.subscriptionDeliverySafely(t,s,r)});return}this.subscriptionDeliverySafely(t,s,r)}})}subscriptionDeliverySafely({store:t,options:n},s,r){try{if(this._subscriptionsDelivered.has(this.defineSubscriptionKey(s,t)))return;const{subscription:i,subscriptionOptions:o,stores:c}=r;this.debugLog(`subscriptionDelivery() - store: ${t.$id}`,["pluginName:",s,"subscription:",i,"options:",r,"stores:",c]);const l={storeOptions:{...n?.storeOptions??{},...o}};i.invoke({store:t,options:{...n,...l}},this.debug),this._subscriptionsDelivered.add(this.defineSubscriptionKey(s,t)),X(c)||c?.forEach(a=>i.invoke({store:a,options:{...n,...l,...a?.storeOptions??{}}},this.debug))}catch(i){this.logError("subscriptionDelivery()",i,t,n)}}}function Pt(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ge=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const je=()=>{},Mt=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ft=e=>e.startsWith("onUpdate:"),T=Object.assign,kt=Object.prototype.hasOwnProperty,be=(e,t)=>kt.call(e,t),_=Array.isArray,z=e=>Le(e)==="[object Map]",C=e=>typeof e=="function",w=e=>typeof e=="string",V=e=>typeof e=="symbol",b=e=>e!==null&&typeof e=="object",Kt=Object.prototype.toString,Le=e=>Kt.call(e),We=e=>Le(e).slice(8,-1),Z=e=>w(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ht=(e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),P=(e,t)=>!Object.is(e,t);let ze;const ee=()=>ze||(ze=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Se(e){if(_(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=w(s)?zt(s):Se(s);if(r)for(const i in r)t[i]=r[i]}return t}else if(w(e)||b(e))return e}const jt=/;(?![^(]*\))/g,Lt=/:([^]+)/,Wt=/\/\*[^]*?\*\//g;function zt(e){const t={};return e.replace(Wt,"").split(jt).forEach(n=>{if(n){const s=n.split(Lt);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function me(e){let t="";if(w(e))t=e;else if(_(e))for(let n=0;n<e.length;n++){const s=me(e[n]);s&&(t+=s+" ")}else if(b(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function K(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let qt,qe=0,ye;function Ee(){qe++}function we(){if(--qe>0)return;let e;for(;ye;){let t=ye;for(ye=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}let te=!0;const Ue=[];function ne(){Ue.push(te),te=!1}function re(){const e=Ue.pop();te=e===void 0?!0:e}class Be{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){}trigger(t){this.version++,this.notify(t)}notify(t){Ee();try{if(process.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(T({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{we()}}}const se=new WeakMap,M=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Oe=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),q=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function g(e,t,n){if(te&&qt){let s=se.get(e);s||se.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Be),r.map=s,r.key=n),process.env.NODE_ENV!=="production"?r.track({target:e,type:t,key:n}):r.track()}}function D(e,t,n,s,r,i){const o=se.get(e);if(!o)return;const c=l=>{l&&(process.env.NODE_ENV!=="production"?l.trigger({target:e,type:t,key:n,newValue:s,oldValue:r,oldTarget:i}):l.trigger())};if(Ee(),t==="clear")o.forEach(c);else{const l=_(e),a=l&&Z(n);if(l&&n==="length"){const d=Number(s);o.forEach((u,f)=>{(f==="length"||f===q||!V(f)&&f>=d)&&c(u)})}else switch((n!==void 0||o.has(void 0))&&c(o.get(n)),a&&c(o.get(q)),t){case"add":l?a&&c(o.get("length")):(c(o.get(M)),z(e)&&c(o.get(Oe)));break;case"delete":l||(c(o.get(M)),z(e)&&c(o.get(Oe)));break;case"set":z(e)&&c(o.get(M));break}}we()}function Ut(e,t){const n=se.get(e);return n&&n.get(t)}function H(e){const t=h(e);return t===e?t:(g(t,"iterate",q),m(e)?t:t.map(A))}function ve(e){return g(e=h(e),"iterate",q),e}function O(e,t){return v(e)?J(xe(e)?A(t):t):A(t)}const Bt={__proto__:null,[Symbol.iterator](){return Ne(this,Symbol.iterator,e=>O(this,e))},concat(...e){return H(this).concat(...e.map(t=>_(t)?H(t):t))},entries(){return Ne(this,"entries",e=>(e[1]=O(this,e[1]),e))},every(e,t){return R(this,"every",e,t,void 0,arguments)},filter(e,t){return R(this,"filter",e,t,n=>n.map(s=>O(this,s)),arguments)},find(e,t){return R(this,"find",e,t,n=>O(this,n),arguments)},findIndex(e,t){return R(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return R(this,"findLast",e,t,n=>O(this,n),arguments)},findLastIndex(e,t){return R(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return R(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ce(this,"includes",e)},indexOf(...e){return Ce(this,"indexOf",e)},join(e){return H(this).join(e)},lastIndexOf(...e){return Ce(this,"lastIndexOf",e)},map(e,t){return R(this,"map",e,t,void 0,arguments)},pop(){return U(this,"pop")},push(...e){return U(this,"push",e)},reduce(e,...t){return Je(this,"reduce",e,t)},reduceRight(e,...t){return Je(this,"reduceRight",e,t)},shift(){return U(this,"shift")},some(e,t){return R(this,"some",e,t,void 0,arguments)},splice(...e){return U(this,"splice",e)},toReversed(){return H(this).toReversed()},toSorted(e){return H(this).toSorted(e)},toSpliced(...e){return H(this).toSpliced(...e)},unshift(...e){return U(this,"unshift",e)},values(){return Ne(this,"values",e=>O(this,e))}};function Ne(e,t,n){const s=ve(e),r=s[t]();return s!==e&&!m(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const Jt=Array.prototype;function R(e,t,n,s,r,i){const o=ve(e),c=o!==e&&!m(e),l=o[t];if(l!==Jt[t]){const u=l.apply(e,i);return c?A(u):u}let a=n;o!==e&&(c?a=function(u,f){return n.call(this,O(e,u),f,e)}:n.length>2&&(a=function(u,f){return n.call(this,u,f,e)}));const d=l.call(o,a,s);return c&&r?r(d):d}function Je(e,t,n,s){const r=ve(e),i=r!==e&&!m(e);let o=n,c=!1;r!==e&&(i?(c=s.length===0,o=function(a,d,u){return c&&(c=!1,a=O(e,a)),n.call(this,a,O(e,d),u,e)}):n.length>3&&(o=function(a,d,u){return n.call(this,a,d,u,e)}));const l=r[t](o,...s);return c?O(e,l):l}function Ce(e,t,n){const s=h(e);g(s,"iterate",q);const r=s[t](...n);return(r===-1||r===!1)&&B(n[0])?(n[0]=h(n[0]),s[t](...n)):r}function U(e,t,n=[]){ne(),Ee();const s=h(e)[t].apply(e,n);return we(),re(),s}const Yt=Pt("__proto__,__v_isRef,__isVue"),Ye=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(V));function Gt(e){V(e)||(e=String(e));const t=h(this);return g(t,"has",e),t.hasOwnProperty(e)}class Ge{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?cn:et:i?on:Ze).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=_(t);if(!r){let l;if(o&&(l=Bt[n]))return l;if(n==="hasOwnProperty")return Gt}const c=Reflect.get(t,n,S(t)?t:s);if((V(n)?Ye.has(n):Yt(n))||(r||g(t,"get",n),i))return c;if(S(c)){const l=o&&Z(n)?c:c.value;return r&&b(l)?Ae(l):l}return b(c)?r?Ae(c):tt(c):c}}class Qt extends Ge{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];const o=_(t)&&Z(n);if(!this._isShallow){const a=v(i);if(!m(s)&&!v(s)&&(i=h(i),s=h(s)),!o&&S(i)&&!S(s))return a?(process.env.NODE_ENV!=="production"&&K(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(i.value=s,!0)}const c=o?Number(n)<t.length:be(t,n),l=Reflect.set(t,n,s,S(t)?t:r);return t===h(r)&&l&&(c?P(s,i)&&D(t,"set",n,s,i):D(t,"add",n,s)),l}deleteProperty(t,n){const s=be(t,n),r=t[n],i=Reflect.deleteProperty(t,n);return i&&s&&D(t,"delete",n,void 0,r),i}has(t,n){const s=Reflect.has(t,n);return(!V(n)||!Ye.has(n))&&g(t,"has",n),s}ownKeys(t){return g(t,"iterate",_(t)?"length":M),Reflect.ownKeys(t)}}class Xt extends Ge{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&K(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&K(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const Zt=new Qt,en=new Xt,Re=e=>e,ie=e=>Reflect.getPrototypeOf(e);function tn(e,t,n){return function(...s){const r=this.__v_raw,i=h(r),o=z(i),c=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,a=r[e](...s),d=n?Re:t?J:A;return!t&&g(i,"iterate",l?Oe:M),T(Object.create(a),{next(){const{value:u,done:f}=a.next();return f?{value:u,done:f}:{value:c?[d(u[0]),d(u[1])]:d(u),done:f}}})}}function oe(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";K(`${Ht(e)} operation ${n}failed: target is readonly.`,h(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function nn(e,t){const n={get(r){const i=this.__v_raw,o=h(i),c=h(r);e||(P(r,c)&&g(o,"get",r),g(o,"get",c));const{has:l}=ie(o),a=t?Re:e?J:A;if(l.call(o,r))return a(i.get(r));if(l.call(o,c))return a(i.get(c));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&g(h(r),"iterate",M),r.size},has(r){const i=this.__v_raw,o=h(i),c=h(r);return e||(P(r,c)&&g(o,"has",r),g(o,"has",c)),r===c?i.has(r):i.has(r)||i.has(c)},forEach(r,i){const o=this,c=o.__v_raw,l=h(c),a=t?Re:e?J:A;return!e&&g(l,"iterate",M),c.forEach((d,u)=>r.call(i,a(d),a(u),o))}};return T(n,e?{add:oe("add"),set:oe("set"),delete:oe("delete"),clear:oe("clear")}:{add(r){const i=h(this),o=ie(i),c=h(r),l=!t&&!m(r)&&!v(r)?c:r;return o.has.call(i,l)||P(r,l)&&o.has.call(i,r)||P(c,l)&&o.has.call(i,c)||(i.add(l),D(i,"add",l,l)),this},set(r,i){!t&&!m(i)&&!v(i)&&(i=h(i));const o=h(this),{has:c,get:l}=ie(o);let a=c.call(o,r);a?process.env.NODE_ENV!=="production"&&Xe(o,c,r):(r=h(r),a=c.call(o,r));const d=l.call(o,r);return o.set(r,i),a?P(i,d)&&D(o,"set",r,i,d):D(o,"add",r,i),this},delete(r){const i=h(this),{has:o,get:c}=ie(i);let l=o.call(i,r);l?process.env.NODE_ENV!=="production"&&Xe(i,o,r):(r=h(r),l=o.call(i,r));const a=c?c.call(i,r):void 0,d=i.delete(r);return l&&D(i,"delete",r,void 0,a),d},clear(){const r=h(this),i=r.size!==0,o=process.env.NODE_ENV!=="production"?z(r)?new Map(r):new Set(r):void 0,c=r.clear();return i&&D(r,"clear",void 0,void 0,o),c}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=tn(r,e,t)}),n}function Qe(e,t){const n=nn(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(be(n,r)&&r in s?n:s,r,i)}const rn={get:Qe(!1,!1)},sn={get:Qe(!0,!1)};function Xe(e,t,n){const s=h(n);if(s!==n&&t.call(e,s)){const r=We(e);K(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Ze=new WeakMap,on=new WeakMap,et=new WeakMap,cn=new WeakMap;function un(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function tt(e){return v(e)?e:nt(e,!1,Zt,rn,Ze)}function Ae(e){return nt(e,!0,en,sn,et)}function nt(e,t,n,s,r){if(!b(e))return process.env.NODE_ENV!=="production"&&K(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=r.get(e);if(i)return i;const o=un(We(e));if(o===0)return e;const c=new Proxy(e,o===2?s:n);return r.set(e,c),c}function xe(e){return v(e)?xe(e.__v_raw):!!(e&&e.__v_isReactive)}function v(e){return!!(e&&e.__v_isReadonly)}function m(e){return!!(e&&e.__v_isShallow)}function B(e){return e?!!e.__v_raw:!1}function h(e){const t=e&&e.__v_raw;return t?h(t):e}const A=e=>b(e)?tt(e):e,J=e=>b(e)?Ae(e):e;function S(e){return e?e.__v_isRef===!0:!1}function rt(e){return ln(e,!1)}function ln(e,t){return S(e)?e:new an(e,t)}class an{constructor(t,n){this.dep=new Be,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:h(t),this._value=n?t:A(t),this.__v_isShallow=n}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||m(t)||v(t);t=s?t:h(t),P(t,n)&&(this._rawValue=t,this._value=s?t:A(t),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function fn(e){return S(e)?e.value:e}class hn{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=V(n)?n:String(n),this._raw=h(t);let r=!0,i=t;if(!_(t)||V(this._key)||!Z(this._key))do r=!B(i)||m(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=fn(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&S(this._raw[this._key])){const n=this._object[this._key];if(S(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Ut(this._raw,this._key)}}class dn{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function pn(e,t,n){return S(e)?e:C(e)?new dn(e):b(e)&&arguments.length>1?_n(e,t,n):rt(e)}function _n(e,t,n){return new hn(e,t,n)}const F=[];function gn(e){F.push(e)}function bn(){F.pop()}let De=!1;function I(e,...t){if(De)return;De=!0,ne();const n=F.length?F[F.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=Sn();if(s)Ie(s,n,11,[e+t.map(i=>{var o,c;return(c=(o=i.toString)==null?void 0:o.call(i))!=null?c:JSON.stringify(i)}).join(""),n&&n.proxy,r.map(({vnode:i})=>`at <${yt(n,i.type)}>`).join(`
2
2
  `),r]);else{const i=[`[Vue warn]: ${e}`,...t];r.length&&i.push(`
3
- `,...bn(r)),console.warn(...i)}re(),De=!1}function gn(){let e=M[M.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const s=e.component&&e.component.parent;e=s&&s.vnode}return t}function bn(e){const t=[];return e.forEach((n,s)=>{t.push(...s===0?[]:[`
4
- `],...Sn(n))}),t}function Sn({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,r=` at <${St(e.component,e.type,s)}`,i=">"+n;return e.props?[r,...mn(e.props),i]:[r+i]}function mn(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...rt(s,e[s]))}),n.length>3&&t.push(" ..."),t}function rt(e,t,n){return N(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:S(t)?(t=rt(e,d(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):A(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=d(t),n?t:[`${e}=`,t])}const st={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Ie(e,t,n,s){try{return s?e(...s):e()}catch(r){it(r,t,n)}}function it(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||ge;if(t){let c=t.parent;const l=t.proxy,a=process.env.NODE_ENV!=="production"?st[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const h=c.ec;if(h){for(let u=0;u<h.length;u++)if(h[u](e,l,a)===!1)return}c=c.parent}if(i){ne(),Ie(i,null,10,[e,l,a]),re();return}}yn(e,n,r,s,o)}function yn(e,t,n,s=!0,r=!1){if(process.env.NODE_ENV!=="production"){const i=st[t];if(n&&pn(n),j(`Unhandled error${i?` during execution of ${i}`:""}`),n&&_n(),s)throw e;console.error(e)}else{if(r)throw e;console.error(e)}}const y=[];let x=-1;const H=[];let I=null,L=0;const En=Promise.resolve();let $e=null;const wn=100;function On(e){let t=x+1,n=y.length;for(;t<n;){const s=t+n>>>1,r=y[s],i=Y(r);i<e||i===e&&r.flags&2?t=s+1:n=s}return t}function vn(e){if(!(e.flags&1)){const t=Y(e),n=y[y.length-1];!n||!(e.flags&2)&&t>=Y(n)?y.push(e):y.splice(On(t),0,e),e.flags|=1,ot()}}function ot(){$e||($e=En.then(ct))}function Nn(e){_(e)?H.push(...e):I&&e.id===-1?I.splice(L+1,0,e):e.flags&1||(H.push(e),e.flags|=1),ot()}function Cn(e){if(H.length){const t=[...new Set(H)].sort((n,s)=>Y(n)-Y(s));if(H.length=0,I){I.push(...t);return}for(I=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),L=0;L<I.length;L++){const n=I[L];process.env.NODE_ENV!=="production"&&ut(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}I=null,L=0}}const Y=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ct(e){process.env.NODE_ENV!=="production"&&(e=e||new Map);const t=process.env.NODE_ENV!=="production"?n=>ut(e,n):je;try{for(x=0;x<y.length;x++){const n=y[x];if(n&&!(n.flags&8)){if(process.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Ie(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;x<y.length;x++){const n=y[x];n&&(n.flags&=-2)}x=-1,y.length=0,Cn(e),$e=null,(y.length||H.length)&&ct(e)}}function ut(e,t){const n=e.get(t)||0;if(n>wn){const s=t.i,r=s&&bt(s.type);return it(`Maximum recursive updates exceeded${r?` in component <${r}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}const Ve=new Map;process.env.NODE_ENV!=="production"&&(ee().__VUE_HMR_RUNTIME__={createRecord:Te(Rn),rerender:Te(xn),reload:Te(An)});const ce=new Map;function Rn(e,t){return ce.has(e)?!1:(ce.set(e,{initialDef:ue(t),instances:new Set}),!0)}function ue(e){return mt(e)?e.__vccOpts:e}function xn(e,t){const n=ce.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(s=>{t&&(s.render=t,ue(s.type).render=t),s.renderCache=[],s.job.flags&8||s.update()}))}function An(e,t){const n=ce.get(e);if(!n)return;t=ue(t),lt(n.initialDef,t);const s=[...n.instances];for(let r=0;r<s.length;r++){const i=s[r],o=ue(i.type);let c=Ve.get(o);c||(o!==n.initialDef&&lt(o,t),Ve.set(o,c=new Set)),c.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(c.add(i),i.ceReload(t.styles),c.delete(i)):i.parent?vn(()=>{i.job.flags&8||(i.parent.update(),c.delete(i))}):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(o)}Nn(()=>{Ve.clear()})}function lt(e,t){$(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Te(e){return(t,n)=>{try{return e(t,n)}catch(s){console.error(s),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let W,le=[];function at(e,t){var n,s;W=e,W?(W.enabled=!0,le.forEach(({event:r,args:i})=>W.emit(r,...i)),le=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{at(i,t)}),setTimeout(()=>{W||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,le=[])},3e3)):le=[]}let ae=null,Dn=null;const In=e=>e.__isTeleport;function ft(e,t){e.shapeFlag&6&&e.component?(e.transition=t,ft(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}ee().requestIdleCallback,ee().cancelIdleCallback;const $n=Symbol.for("v-ndc"),Vn={};process.env.NODE_ENV!=="production"&&(Vn.ownKeys=e=>(j("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));const Tn={},dt=e=>Object.getPrototypeOf(e)===Tn,Pn=e=>e.__isSuspense,ht=Symbol.for("v-fgt"),Mn=Symbol.for("v-txt"),Fn=Symbol.for("v-cmt");function kn(e){return e?e.__v_isVNode===!0:!1}const Kn=(...e)=>_t(...e),pt=({key:e})=>e??null,fe=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?N(e)||S(e)||A(e)?{i:ae,r:e,k:t,f:!!n}:e:null);function jn(e,t=null,n=null,s=0,r=null,i=e===ht?0:1,o=!1,c=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&pt(t),ref:t&&fe(t),scopeId:Dn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ae};return c?(he(l,n),i&128&&e.normalize(l)):n&&(l.shapeFlag|=N(n)?8:16),process.env.NODE_ENV!=="production"&&l.key!==l.key&&j("VNode created with invalid key (NaN). VNode type:",l.type),l}const Hn=process.env.NODE_ENV!=="production"?Kn:_t;function _t(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===$n)&&(process.env.NODE_ENV!=="production"&&!e&&j(`Invalid vnode type when creating vnode: ${e}.`),e=Fn),kn(e)){const c=de(e,t,!0);return n&&he(c,n),c.patchFlag=-2,c}if(mt(e)&&(e=e.__vccOpts),t){t=Ln(t);let{class:c,style:l}=t;c&&!N(c)&&(t.class=me(c)),b(l)&&(B(l)&&!_(l)&&(l=$({},l)),t.style=Se(l))}const o=N(e)?1:Pn(e)?128:In(e)?64:b(e)?4:A(e)?2:0;return process.env.NODE_ENV!=="production"&&o&4&&B(e)&&(e=d(e),j("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
5
- Component that was made reactive: `,e)),jn(e,t,n,s,r,o,i,!0)}function Ln(e){return e?B(e)||dt(e)?$({},e):e:null}function de(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:c,transition:l}=e,a=t?zn(r||{},t):r,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:a,key:a&&pt(a),ref:t&&t.ref?n&&i?_(i)?i.concat(fe(t)):[i,fe(t)]:fe(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&o===-1&&_(c)?c.map(gt):c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ht?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&de(e.ssContent),ssFallback:e.ssFallback&&de(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&ft(h,l.clone(h)),h}function gt(e){const t=de(e);return _(e.children)&&(t.children=e.children.map(gt)),t}function Wn(e=" ",t=0){return Hn(Mn,null,e,t)}function he(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(_(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),he(e,r()),r._c&&(r._d=!0));return}else n=32,!t._&&!dt(t)&&(t._ctx=ae);else if(A(t)){if(s&65){he(e,{default:t});return}t={default:t,_ctx:ae},n=32}else t=String(t),s&64?(n=16,t=[Wn(t)]):n=8;e.children=t,e.shapeFlag|=n}function zn(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const r in s)if(r==="class")t.class!==s.class&&(t.class=me([t.class,s.class]));else if(r==="style")t.style=Se([t.style,s.style]);else if(Tt(r)){const i=t[r],o=s[r];o&&i!==o&&!(_(i)&&i.includes(o))?t[r]=i?[].concat(i,o):o:o==null&&i==null&&!Pt(r)&&(t[r]=o)}else r!==""&&(t[r]=s[r])}return t}{const e=ee(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};t("__VUE_INSTANCE_SETTERS__",n=>n),t("__VUE_SSR_SETTERS__",n=>n)}process.env.NODE_ENV;const qn=/(?:^|[-_])\w/g,Un=e=>e.replace(qn,t=>t.toUpperCase()).replace(/[-_]/g,"");function bt(e,t=!0){return A(e)?e.displayName||e.name:e.name||t&&e.__name}function St(e,t,n=!1){let s=bt(t);if(!s&&t.__file){const r=t.__file.match(/([^/\\]+)\.\w+$/);r&&(s=r[1])}if(!s&&e){const r=i=>{for(const o in i)if(i[o]===t)return o};s=r(e.components)||e.parent&&r(e.parent.type.components)||r(e.appContext.components)}return s?Un(s):n?"App":"Anonymous"}function mt(e){return A(e)&&"__vccOpts"in e}function Bn(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},s={style:"color:#eb2f96"},r={__vue_custom_formatter:!0,header(u){if(!b(u))return null;if(u.__isVue)return["div",e,"VueInstance"];if(S(u)){ne();const f=u.value;return re(),["div",{},["span",e,h(u)],"<",c(f),">"]}else{if(Ae(u))return["div",{},["span",e,m(u)?"ShallowReactive":"Reactive"],"<",c(u),`>${O(u)?" (readonly)":""}`];if(O(u))return["div",{},["span",e,m(u)?"ShallowReadonly":"Readonly"],"<",c(u),">"]}return null},hasBody(u){return u&&u.__isVue},body(u){if(u&&u.__isVue)return["div",{},...i(u.$)]}};function i(u){const f=[];u.type.props&&u.props&&f.push(o("props",d(u.props))),u.setupState!==ge&&f.push(o("setup",u.setupState)),u.data!==ge&&f.push(o("data",d(u.data)));const E=l(u,"computed");E&&f.push(o("computed",E));const v=l(u,"inject");return v&&f.push(o("injected",v)),f.push(["div",{},["span",{style:s.style+";opacity:0.66"},"$ (internal): "],["object",{object:u}]]),f}function o(u,f){return f=$({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},u],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(E=>["div",{},["span",s,E+": "],c(f[E],!1)])]]:["span",{}]}function c(u,f=!0){return typeof u=="number"?["span",t,u]:typeof u=="string"?["span",n,JSON.stringify(u)]:typeof u=="boolean"?["span",s,u]:b(u)?["object",{object:f?d(u):u}]:["span",n,String(u)]}function l(u,f){const E=u.type;if(A(E))return;const v={};for(const Q in u.ctx)a(E,Q,f)&&(v[Q]=u.ctx[Q]);return v}function a(u,f,E){const v=u[E];if(_(v)&&v.includes(f)||b(v)&&f in v||u.extends&&a(u.extends,f,E)||u.mixins&&u.mixins.some(Q=>a(Q,f,E)))return!0}function h(u){return m(u)?"ShallowRef":u.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(r):window.devtoolsFormatters=[r]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function Jn(){Bn()}process.env.NODE_ENV!=="production"&&Jn();const Pe=new WeakMap,G=new Map,yt=new WeakSet,Yn=50;function Gn(e){return e?.storeOptions?.debug===!0}function Me(e,t,n){if(!Gn(t))return;const s=G.size;console.debug(`[defineAStoreSetup] ${e} - ${n} (contextsById=${s})`),s>=Yn&&console.warn(`[defineAStoreSetup] contextsById reached ${s} entries`)}function Qn(e,t,n){if(yt.has(e)||typeof e.$dispose!="function")return;const s=e.$dispose;e.$dispose=(...r)=>(Pe.delete(e),G.delete(t),Me(t,n,"dispose cleanup"),s.apply(e,r)),yt.add(e)}function Xn(e,t,n){const s=n?{storeOptions:n}:{};return typeof t=="function"?Et(e,t,s):er(e,t,s)}function Zn(e,t,n){const s=n?{storeOptions:{...n,enhancedStore:!0}}:{storeOptions:{enhancedStore:!0}};return Et(e,t,s)}function Et(e,t,n){const s={id:e,extensions:{}},r=n?.storeOptions?.enhancedStore===!0,i=F.defineStore(e,()=>t(s),n);return Object.assign(((...o)=>{r&&(G.set(e,s),Me(e,n,"registered context by id"));const c=i(...o);return r&&(Pe.set(c,s),G.delete(e),Me(e,n,"moved context to weak map"),Qn(c,e,n)),c}),i)}function er(e,t,n){return n&&(t={...t,...n??{}}),F.defineStore(e,t)}const tr=new Set(["_","$"]);function nr(e){return tr.has(e[0])}function wt(e){return Pe.get(e)??(typeof e?.$id=="string"?G.get(e.$id):void 0)}function Ot(e){const t=e.extensions.enhancedStore??e.extensions.extending;if(!t)throw new Error(`${e.id}Store - getEnhancedStore - Error: enhanced store is required`);return t}function vt(e,t){e.extensions.enhancedStore=t,e.extensions.extending=t}function rr(e){return Ot(e)}class sr extends Fe{_className="Store";_onAction;_options;_store;_subscriptions={};_storeSubscribe;static _requiredKeys;get onAction(){if(this._onAction)return()=>({store:this.store,callback:this._onAction})}set onAction(t){this._onAction=t}get options(){return this._options}get state(){return this._store.$state}set state(t){this._store.$state=t}get store(){return this._store}get storeSubscribe(){if(this._storeSubscribe)return()=>({store:this.store,callback:this._storeSubscribe})}set storeSubscribe(t){this._storeSubscribe=t}constructor(t,n,s=!1,r){if(super(s,r),this._options=n.storeOptions,this._store=t,this._options?.enhancedStore){const i=wt(this.store);i&&vt(i,this.store)}}addToState(t,n){this.isOptionApi()||n?.value||(n=nt(n)),this.state[t]=n,this.store[t]=dn(this.state,t)}addSubscription(t,n,s){this._subscriptions[t]={subscription:n,...s??{}}}static customizeStore(t,n,s=!1,r){if(n.storeOptions&&this.hasRequiredKeys(n.storeOptions))return new this(t,n,s,r)}hasDeniedFirstChar(t){return nr(t[0])}static hasRequiredKeys(t){return this._requiredKeys!==void 0&&this._requiredKeys?.every(n=>!!t[n])}getOption(t){return this.options&&this.options[t]}getStatePropertyValue(t){return this.getValue(this.state[t])}getSubscriptions(){if(!X(this._subscriptions))return this._subscriptions}getValue(t){return t?.__v_isRef?t.value:t}isOptionApi(){return this.store._isOptionsAPI}stateHas(t){return this.state.hasOwnProperty(t)}storeHas(t){return this.store.hasOwnProperty(t)}}function ir(e,t){const n=new _e(e,t);return n.plugin.bind(n)}function or(e,t){const n=new _e(e,t?.debug,{execution:t?.execution,hydrationScheduler:t?.hydrationScheduler,runtimeEnvironment:t?.runtimeEnvironment,subscriberExecution:t?.subscriberExecution});return n.plugin.bind(n)}p.CustomConsole=ke,p.PLUGIN_NAME=pe,p.PluginSubscriber=Nt,p.PluginSubscription=_e,p.Store=sr,p.createHydrationPlugin=or,p.createPlugin=ir,p.defineAStore=Xn,p.defineAStoreCtx=Zn,p.getDefineAStoreSetupContext=wt,p.getEnhancedStore=Ot,p.getExtendingStore=rr,p.isEmpty=X,p.setEnhancedStore=vt,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
3
+ `,...mn(r)),console.warn(...i)}re(),De=!1}function Sn(){let e=F[F.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const s=e.component&&e.component.parent;e=s&&s.vnode}return t}function mn(e){const t=[];return e.forEach((n,s)=>{t.push(...s===0?[]:[`
4
+ `],...yn(n))}),t}function yn({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,r=` at <${yt(e.component,e.type,s)}`,i=">"+n;return e.props?[r,...En(e.props),i]:[r+i]}function En(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...st(s,e[s]))}),n.length>3&&t.push(" ..."),t}function st(e,t,n){return w(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:S(t)?(t=st(e,h(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):C(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=h(t),n?t:[`${e}=`,t])}const it={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Ie(e,t,n,s){try{return s?e(...s):e()}catch(r){ot(r,t,n)}}function ot(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||ge;if(t){let c=t.parent;const l=t.proxy,a=process.env.NODE_ENV!=="production"?it[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const d=c.ec;if(d){for(let u=0;u<d.length;u++)if(d[u](e,l,a)===!1)return}c=c.parent}if(i){ne(),Ie(i,null,10,[e,l,a]),re();return}}wn(e,n,r,s,o)}function wn(e,t,n,s=!0,r=!1){if(process.env.NODE_ENV!=="production"){const i=it[t];if(n&&gn(n),I(`Unhandled error${i?` during execution of ${i}`:""}`),n&&bn(),s)throw e;console.error(e)}else{if(r)throw e;console.error(e)}}const y=[];let x=-1;const j=[];let $=null,L=0;const On=Promise.resolve();let $e=null;const vn=100;function Nn(e){let t=x+1,n=y.length;for(;t<n;){const s=t+n>>>1,r=y[s],i=Y(r);i<e||i===e&&r.flags&2?t=s+1:n=s}return t}function Cn(e){if(!(e.flags&1)){const t=Y(e),n=y[y.length-1];!n||!(e.flags&2)&&t>=Y(n)?y.push(e):y.splice(Nn(t),0,e),e.flags|=1,ct()}}function ct(){$e||($e=On.then(ut))}function Rn(e){if(!_(e))$&&e.id===-1?$.splice(L+1,0,e):e.flags&1||(j.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)j.push(e[t]);ct()}function An(e){if(j.length){const t=[...new Set(j)].sort((n,s)=>Y(n)-Y(s));if(j.length=0,$){for(let n=0;n<t.length;n++)$.push(t[n]);return}for($=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),L=0;L<$.length;L++){const n=$[L];process.env.NODE_ENV!=="production"&&lt(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}$=null,L=0}}const Y=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ut(e){process.env.NODE_ENV!=="production"&&(e=e||new Map);const t=process.env.NODE_ENV!=="production"?n=>lt(e,n):je;try{for(x=0;x<y.length;x++){const n=y[x];if(n&&!(n.flags&8)){if(process.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Ie(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;x<y.length;x++){const n=y[x];n&&(n.flags&=-2)}x=-1,y.length=0,An(e),$e=null,(y.length||j.length)&&ut(e)}}function lt(e,t){const n=e.get(t)||0;if(n>vn){const s=t.i,r=s&&mt(s.type);return ot(`Maximum recursive updates exceeded${r?` in component <${r}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}const Te=new Map;process.env.NODE_ENV!=="production"&&(ee().__VUE_HMR_RUNTIME__={createRecord:Ve(xn),rerender:Ve(Dn),reload:Ve(In)});const ce=new Map;function xn(e,t){return ce.has(e)?!1:(ce.set(e,{initialDef:ue(t),instances:new Set}),!0)}function ue(e){return Et(e)?e.__vccOpts:e}function Dn(e,t){const n=ce.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(s=>{t&&(s.render=t,ue(s.type).render=t),s.renderCache=[],s.job.flags&8||s.update()}))}function In(e,t){const n=ce.get(e);if(!n)return;t=ue(t),at(n.initialDef,t);const s=[...n.instances];for(let r=0;r<s.length;r++){const i=s[r],o=ue(i.type);let c=Te.get(o);c||(o!==n.initialDef&&at(o,t),Te.set(o,c=new Set)),c.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(c.add(i),i.ceReload(t.styles),c.delete(i)):i.parent?Cn(()=>{i.job.flags&8||(i.parent.update(),c.delete(i))}):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(o)}Rn(()=>{Te.clear()})}function at(e,t){T(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Ve(e){return(t,n)=>{try{return e(t,n)}catch(s){console.error(s),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let W,le=[];function ft(e,t){var n,s;W=e,W?(W.enabled=!0,le.forEach(({event:r,args:i})=>W.emit(r,...i)),le=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{ft(i,t)}),setTimeout(()=>{W||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,le=[])},3e3)):le=[]}let ae=null,$n=null;const Pe=e=>e.__isTeleport;function Tn(e){let t=e[0];if(e.length>1){let n=!1;for(const s of e)if(s.type!==_t){if(process.env.NODE_ENV!=="production"&&n){I("<transition> can only be used on a single element or component. Use <transition-group> for lists.");break}if(t=s,n=!0,process.env.NODE_ENV==="production")break}}return t}function Vn(e){if(!Pn(e))return Pe(e.type)&&e.children?Tn(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&C(n.default))return n.default()}}function ht(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;ht(Pe(n.type)&&Vn(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}ee().requestIdleCallback,ee().cancelIdleCallback;const Pn=e=>e.type.__isKeepAlive,Mn=Symbol.for("v-ndc"),Fn={};process.env.NODE_ENV!=="production"&&(Fn.ownKeys=e=>(I("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));const kn={},dt=e=>Object.getPrototypeOf(e)===kn,Kn=e=>e.__isSuspense,pt=Symbol.for("v-fgt"),Hn=Symbol.for("v-txt"),_t=Symbol.for("v-cmt");function jn(e){return e?e.__v_isVNode===!0:!1}const Ln=(...e)=>bt(...e),gt=({key:e})=>e??null,fe=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?w(e)||S(e)||C(e)?{i:ae,r:e,k:t,f:!!n}:e:null);function Wn(e,t=null,n=null,s=0,r=null,i=e===pt?0:1,o=!1,c=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&gt(t),ref:t&&fe(t),scopeId:$n,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ae};if(c?(de(l,n),i&128&&e.normalize(l)):n&&(l.shapeFlag|=w(n)?8:16),process.env.NODE_ENV!=="production"&&l.key!==l.key&&I("VNode created with invalid key (NaN). VNode type:",l.type),process.env.NODE_ENV!=="production"&&t&&l.shapeFlag&1){const a=t.innerHTML!=null?"innerHTML":t.textContent!=null?"textContent":null;a&&zn(l.children)&&I(`The \`${a}\` prop on <${l.type}> will override its children. Remove either the \`${a}\` prop or the children.`)}return l}function zn(e){return w(e)?e!=="":_(e)?e.length>0:!1}const qn=process.env.NODE_ENV!=="production"?Ln:bt;function bt(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===Mn)&&(process.env.NODE_ENV!=="production"&&!e&&I(`Invalid vnode type when creating vnode: ${e}.`),e=_t),jn(e)){const c=he(e,t,!0);return n&&de(c,n),c.patchFlag=-2,c}if(Et(e)&&(e=e.__vccOpts),t){t=Un(t);let{class:c,style:l}=t;c&&!w(c)&&(t.class=me(c)),b(l)&&(B(l)&&!_(l)&&(l=T({},l)),t.style=Se(l))}const o=w(e)?1:Kn(e)?128:Pe(e)?64:b(e)?4:C(e)?2:0;return process.env.NODE_ENV!=="production"&&o&4&&B(e)&&(e=h(e),I("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
5
+ Component that was made reactive: `,e)),Wn(e,t,n,s,r,o,i,!0)}function Un(e){return e?B(e)||dt(e)?T({},e):e:null}function he(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:c,transition:l}=e,a=t?Jn(r||{},t):r,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:a,key:a&&gt(a),ref:t&&t.ref?n&&i?_(i)?i.concat(fe(t)):[i,fe(t)]:fe(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&o===-1&&_(c)?c.map(St):c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==pt?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&he(e.ssContent),ssFallback:e.ssFallback&&he(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&ht(d,l.clone(d)),d}function St(e){const t=he(e);return _(e.children)&&(t.children=e.children.map(St)),t}function Bn(e=" ",t=0){return qn(Hn,null,e,t)}function de(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(_(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),de(e,r()),r._c&&(r._d=!0));return}else n=32,!t._&&!dt(t)&&(t._ctx=ae);else if(C(t)){if(s&65){de(e,{default:t});return}t={default:t,_ctx:ae},n=32}else t=String(t),s&64?(n=16,t=[Bn(t)]):n=8;e.children=t,e.shapeFlag|=n}function Jn(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const r in s)if(r==="class")t.class!==s.class&&(t.class=me([t.class,s.class]));else if(r==="style")t.style=Se([t.style,s.style]);else if(Mt(r)){const i=t[r],o=s[r];o&&i!==o&&!(_(i)&&i.includes(o))?t[r]=i?[].concat(i,o):o:o==null&&i==null&&!Ft(r)&&(t[r]=o)}else r!==""&&(t[r]=s[r])}return t}{const e=ee(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};t("__VUE_INSTANCE_SETTERS__",n=>n),t("__VUE_SSR_SETTERS__",n=>n)}process.env.NODE_ENV;const Yn=/(?:^|[-_])\w/g,Gn=e=>e.replace(Yn,t=>t.toUpperCase()).replace(/[-_]/g,"");function mt(e,t=!0){return C(e)?e.displayName||e.name:e.name||t&&e.__name}function yt(e,t,n=!1){let s=mt(t);if(!s&&t.__file){const r=t.__file.match(/([^/\\]+)\.\w+$/);r&&(s=r[1])}if(!s&&e){const r=i=>{for(const o in i)if(i[o]===t)return o};s=r(e.components)||e.parent&&r(e.parent.type.components)||r(e.appContext.components)}return s?Gn(s):n?"App":"Anonymous"}function Et(e){return C(e)&&"__vccOpts"in e}function Qn(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},s={style:"color:#eb2f96"},r={__vue_custom_formatter:!0,header(u){if(!b(u))return null;if(u.__isVue)return["div",e,"VueInstance"];if(S(u)){ne();const f=u.value;return re(),["div",{},["span",e,d(u)],"<",c(f),">"]}else{if(xe(u))return["div",{},["span",e,m(u)?"ShallowReactive":"Reactive"],"<",c(u),`>${v(u)?" (readonly)":""}`];if(v(u))return["div",{},["span",e,m(u)?"ShallowReadonly":"Readonly"],"<",c(u),">"]}return null},hasBody(u){return u&&u.__isVue},body(u){if(u&&u.__isVue)return["div",{},...i(u.$)]}};function i(u){const f=[];u.type.props&&u.props&&f.push(o("props",h(u.props))),u.setupState!==ge&&f.push(o("setup",u.setupState)),u.data!==ge&&f.push(o("data",h(u.data)));const E=l(u,"computed");E&&f.push(o("computed",E));const N=l(u,"inject");return N&&f.push(o("injected",N)),f.push(["div",{},["span",{style:s.style+";opacity:0.66"},"$ (internal): "],["object",{object:u}]]),f}function o(u,f){return f=T({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},u],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(E=>["div",{},["span",s,E+": "],c(f[E],!1)])]]:["span",{}]}function c(u,f=!0){return typeof u=="number"?["span",t,u]:typeof u=="string"?["span",n,JSON.stringify(u)]:typeof u=="boolean"?["span",s,u]:b(u)?["object",{object:f?h(u):u}]:["span",n,String(u)]}function l(u,f){const E=u.type;if(C(E))return;const N={};for(const Q in u.ctx)a(E,Q,f)&&(N[Q]=u.ctx[Q]);return N}function a(u,f,E){const N=u[E];if(_(N)&&N.includes(f)||b(N)&&f in N||u.extends&&a(u.extends,f,E)||u.mixins&&u.mixins.some(Q=>a(Q,f,E)))return!0}function d(u){return m(u)?"ShallowRef":u.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(r):window.devtoolsFormatters=[r]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function Xn(){Qn()}process.env.NODE_ENV!=="production"&&Xn();const Me=new WeakMap,G=new Map,wt=new WeakSet,Zn=50;function er(e){return e?.storeOptions?.debug===!0}function Fe(e,t,n){if(!er(t))return;const s=G.size;console.debug(`[defineAStoreSetup] ${e} - ${n} (contextsById=${s})`),s>=Zn&&console.warn(`[defineAStoreSetup] contextsById reached ${s} entries`)}function tr(e,t,n){if(wt.has(e)||typeof e.$dispose!="function")return;const s=e.$dispose;e.$dispose=(...r)=>(Me.delete(e),G.delete(t),Fe(t,n,"dispose cleanup"),s.apply(e,r)),wt.add(e)}function nr(e,t,n){const s=n?{storeOptions:n}:{};return typeof t=="function"?Ot(e,t,s):sr(e,t,s)}function rr(e,t,n){const s=n?{storeOptions:{...n,enhancedStore:!0}}:{storeOptions:{enhancedStore:!0}};return Ot(e,t,s)}function Ot(e,t,n){const s={id:e,extensions:{}},r=n?.storeOptions?.enhancedStore===!0,i=k.defineStore(e,()=>t(s),n);return Object.assign(((...o)=>{r&&(G.set(e,s),Fe(e,n,"registered context by id"));const c=i(...o);return r&&(Me.set(c,s),G.delete(e),Fe(e,n,"moved context to weak map"),tr(c,e,n)),c}),i)}function sr(e,t,n){return n&&(t={...t,...n??{}}),k.defineStore(e,t)}const ir=new Set(["_","$"]);function or(e){return ir.has(e[0])}function vt(e){return Me.get(e)??(typeof e?.$id=="string"?G.get(e.$id):void 0)}function Nt(e){const t=e.extensions.enhancedStore??e.extensions.extending;if(!t)throw new Error(`${e.id}Store - getEnhancedStore - Error: enhanced store is required`);return t}function Ct(e,t){e.extensions.enhancedStore=t,e.extensions.extending=t}function cr(e){return Nt(e)}class ur extends ke{_className="Store";_onAction;_options;_store;_subscriptions={};_storeSubscribe;static _requiredKeys;get onAction(){if(this._onAction)return()=>({store:this.store,callback:this._onAction})}set onAction(t){this._onAction=t}get options(){return this._options}get state(){return this._store.$state}set state(t){this._store.$state=t}get store(){return this._store}hydrate(){}afterHydration(){}get storeSubscribe(){if(this._storeSubscribe)return()=>({store:this.store,callback:this._storeSubscribe})}set storeSubscribe(t){this._storeSubscribe=t}constructor(t,n,s=!1,r){if(super(s,r),this._options=n.storeOptions,this._store=t,this._options?.enhancedStore){const i=vt(this.store);i&&Ct(i,this.store)}}addToState(t,n){this.isOptionApi()||n?.value||(n=rt(n)),this.state[t]=n,this.store[t]=pn(this.state,t)}addSubscription(t,n,s){this._subscriptions[t]={subscription:n,...s??{}}}static customizeStore(t,n,s=!1,r){if(n.storeOptions&&this.hasRequiredKeys(n.storeOptions))return new this(t,n,s,r)}hasDeniedFirstChar(t){return or(t[0])}static hasRequiredKeys(t){return this._requiredKeys!==void 0&&this._requiredKeys?.every(n=>!!t[n])}getOption(t){return this.options&&this.options[t]}getStatePropertyValue(t){return this.getValue(this.state[t])}getSubscriptions(){if(!X(this._subscriptions))return this._subscriptions}getValue(t){return t?.__v_isRef?t.value:t}isOptionApi(){return this.store._isOptionsAPI}stateHas(t){return this.state.hasOwnProperty(t)}storeHas(t){return this.store.hasOwnProperty(t)}}function lr(e,t){const n=new _e(e,t);return n.plugin.bind(n)}function ar(e,t){const n=new _e(e,t?.debug,{execution:t?.execution,hydrationScheduler:t?.hydrationScheduler,runtimeEnvironment:t?.runtimeEnvironment,subscriberExecution:t?.subscriberExecution});return n.plugin.bind(n)}p.CustomConsole=Ke,p.PLUGIN_NAME=pe,p.PluginSubscriber=Rt,p.PluginSubscription=_e,p.Store=ur,p.createHydrationPlugin=ar,p.createPlugin=lr,p.defineAStore=nr,p.defineAStoreCtx=rr,p.getDefineAStoreSetupContext=vt,p.getEnhancedStore=Nt,p.getExtendingStore=cr,p.isEmpty=X,p.setEnhancedStore=Ct,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
@@ -65,6 +65,7 @@ export interface StoreOnActionCallbackParameters {
65
65
  export interface PluginSubscriberInterface {
66
66
  console?: Console;
67
67
  execution?: PluginExecutionOptions;
68
+ hydrate?: (context: PiniaPluginContext, debug: boolean) => void | Promise<void>;
68
69
  hydrationScheduler?: PluginHydrationScheduler;
69
70
  invoke: (context: PiniaPluginContext, debug: boolean) => boolean;
70
71
  name: string;
@@ -72,6 +73,7 @@ export interface PluginSubscriberInterface {
72
73
  storeOnActionSubscription?: StoreOnActionSubscription;
73
74
  storeMutationSubscription?: StoreMutationSubscription;
74
75
  subscriptions?: PluginSubscriptions;
76
+ afterHydration?: (context: PiniaPluginContext, debug: boolean) => void | Promise<void>;
75
77
  }
76
78
  export interface PluginSubscriptionDefinition {
77
79
  stores?: PiniaStore[];
@@ -121,6 +123,7 @@ export declare abstract class CustomConsole implements Console {
121
123
  export declare abstract class PluginSubscriber<Instance extends Store> implements PluginSubscriberInterface {
122
124
  console: Console;
123
125
  execution?: PluginExecutionOptions;
126
+ hydrate(context: PiniaPluginContext, debug: boolean): void | Promise<void>;
124
127
  hydrationScheduler?: PluginHydrationScheduler;
125
128
  name: string;
126
129
  pluginOptions: AnyObject;
@@ -128,10 +131,12 @@ export declare abstract class PluginSubscriber<Instance extends Store> implement
128
131
  storeOnActionSubscription?: StoreOnActionSubscription;
129
132
  storeMutationSubscription?: StoreMutationSubscription;
130
133
  subscriptions?: PluginSubscriptions;
134
+ afterHydration(context: PiniaPluginContext, debug: boolean): void | Promise<void>;
131
135
  protected pluginCreated?: (store: PiniaStore) => void;
132
136
  protected _resetStoreCallback?: (store?: PiniaStore) => void;
133
137
  constructor(pluginName: string, createInstanceFunction: (store: PiniaStore, options: AnyObject, debug: boolean, customConsole?: Console) => Instance | undefined, pluginConsole?: Console);
134
138
  invoke(context: PiniaPluginContext, debug: boolean): boolean;
139
+ get storeInstance(): Instance | undefined;
135
140
  }
136
141
  export declare class PluginSubscription extends Debug {
137
142
  protected _className: string;
@@ -146,6 +151,8 @@ export declare class Store extends Debug {
146
151
  state: StateTree;
147
152
  storeSubscribe: StoreMutationSubscriptionCallback | undefined;
148
153
  readonly store: AnyObject;
154
+ hydrate(): void | Promise<void>;
155
+ afterHydration(): void | Promise<void>;
149
156
  constructor(store: PiniaStore, options: AnyObject, debug?: boolean, customConsole?: Console);
150
157
  addSubscription(pluginName: string, subscription: PluginSubscriberInterface, options?: {
151
158
  subscriptionOptions?: StoreOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinia-plugin-subscription",
3
- "version": "0.1.6-beta.0",
3
+ "version": "0.1.6",
4
4
  "description": "Pinia plugin for Vue.js that helps building Pinia plugins by centralizing subscriber registration and providing a Store base class for store helpers.",
5
5
  "type": "module",
6
6
  "sideEffects": false,