multiStoreAdmin/dist/storePage/assets/pinia.b5130627.js

6 lines
3.5 KiB
JavaScript

import{aj as F,r as V,ai as H,au as Y,C as Z,w as G,a0 as $,j as E,av as B,t as A,g as T,e as tt,n as et,aa as st,b as nt}from"./@vue.c3e77981.js";var ot=!1;/*!
* pinia v2.1.7
* (c) 2023 Eduardo San Martin Morote
* @license MIT
*/let D;const k=t=>D=t,J=Symbol();function R(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var x;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(x||(x={}));function ht(){const t=F(!0),o=t.run(()=>V({}));let s=[],e=[];const r=H({install(u){k(r),r._a=u,u.provide(J,r),u.config.globalProperties.$pinia=r,e.forEach(f=>s.push(f)),e=[]},use(u){return!this._a&&!ot?e.push(u):s.push(u),this},_p:s,_a:null,_e:t,_s:new Map,state:o});return r}const N=()=>{};function O(t,o,s,e=N){t.push(o);const r=()=>{const u=t.indexOf(o);u>-1&&(t.splice(u,1),e())};return!s&&T()&&tt(r),r}function P(t,...o){t.slice().forEach(s=>{s(...o)})}const ct=t=>t();function I(t,o){t instanceof Map&&o instanceof Map&&o.forEach((s,e)=>t.set(e,s)),t instanceof Set&&o instanceof Set&&o.forEach(t.add,t);for(const s in o){if(!o.hasOwnProperty(s))continue;const e=o[s],r=t[s];R(r)&&R(e)&&t.hasOwnProperty(s)&&!E(e)&&!B(e)?t[s]=I(r,e):t[s]=e}return t}const rt=Symbol();function ut(t){return!R(t)||!t.hasOwnProperty(rt)}const{assign:v}=Object;function at(t){return!!(E(t)&&t.effect)}function ft(t,o,s,e){const{state:r,actions:u,getters:f}=o,a=s.state.value[t];let g;function b(){a||(s.state.value[t]=r?r():{});const y=st(s.state.value[t]);return v(y,u,Object.keys(f||{}).reduce((d,_)=>(d[_]=H(nt(()=>{k(s);const j=s._s.get(t);return f[_].call(j,j)})),d),{}))}return g=q(t,b,o,s,e,!0),g}function q(t,o,s={},e,r,u){let f;const a=v({actions:{}},s),g={deep:!0};let b,y,d=[],_=[],j;const m=e.state.value[t];!u&&!m&&(e.state.value[t]={}),V({});let L;function W(c){let n;b=y=!1,typeof c=="function"?(c(e.state.value[t]),n={type:x.patchFunction,storeId:t,events:j}):(I(e.state.value[t],c),n={type:x.patchObject,payload:c,storeId:t,events:j});const h=L=Symbol();et().then(()=>{L===h&&(b=!0)}),y=!0,P(d,n,e.state.value[t])}const z=u?function(){const{state:n}=s,h=n?n():{};this.$patch(S=>{v(S,h)})}:N;function K(){f.stop(),d=[],_=[],e._s.delete(t)}function M(c,n){return function(){k(e);const h=Array.from(arguments),S=[],w=[];function U(i){S.push(i)}function X(i){w.push(i)}P(_,{args:h,name:c,store:l,after:U,onError:X});let C;try{C=n.apply(this&&this.$id===t?this:l,h)}catch(i){throw P(w,i),i}return C instanceof Promise?C.then(i=>(P(S,i),i)).catch(i=>(P(w,i),Promise.reject(i))):(P(S,C),C)}}const Q={_p:e,$id:t,$onAction:O.bind(null,_),$patch:W,$reset:z,$subscribe(c,n={}){const h=O(d,c,n.detached,()=>S()),S=f.run(()=>G(()=>e.state.value[t],w=>{(n.flush==="sync"?y:b)&&c({storeId:t,type:x.direct,events:j},w)},v({},g,n)));return h},$dispose:K},l=$(Q);e._s.set(t,l);const p=(e._a&&e._a.runWithContext||ct)(()=>e._e.run(()=>(f=F()).run(o)));for(const c in p){const n=p[c];if(E(n)&&!at(n)||B(n))u||(m&&ut(n)&&(E(n)?n.value=m[c]:I(n,m[c])),e.state.value[t][c]=n);else if(typeof n=="function"){const h=M(c,n);p[c]=h,a.actions[c]=n}}return v(l,p),v(A(l),p),Object.defineProperty(l,"$state",{get:()=>e.state.value[t],set:c=>{W(n=>{v(n,c)})}}),e._p.forEach(c=>{v(l,f.run(()=>c({store:l,app:e._a,pinia:e,options:a})))}),m&&u&&s.hydrate&&s.hydrate(l.$state,m),b=!0,y=!0,l}function bt(t,o,s){let e,r;const u=typeof o=="function";typeof t=="string"?(e=t,r=u?s:o):(r=t,e=t.id);function f(a,g){const b=Y();return a=a||(b?Z(J,null):null),a&&k(a),a=D,a._s.has(e)||(u?q(e,o,r,a):ft(e,r,a)),a._s.get(e)}return f.$id=e,f}export{ht as c,bt as d};