mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-23 04:19:20 +08:00
2 lines
44 KiB
JavaScript
2 lines
44 KiB
JavaScript
|
var e=Object.defineProperty,t=(t,n,r)=>(((t,n,r)=>{n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r})(t,"symbol"!=typeof n?n+"":n,r),r);import{H as n,as as r,a0 as o,I as s,Q as i,aZ as a,aq as c,Y as u,W as l,aN as f,aO as d,J as p,ag as h,a3 as m,aP as g,j as y}from"./runtime-core.esm-bundler-1857aef3.js";import{c as b,a as E}from"./vue-router-5ddbd26f.js";import{bt as O,N as w}from"./index-98eefc51.js";const _="v3-admin-vite";class v{}t(v,"TOKEN",`${_}-token-key`),t(v,"SIDEBAR_STATUS",`${_}-sidebar-status-key`),t(v,"ACTIVE_THEME_NAME",`${_}-active-theme-name-key`);var R=!1;let S;const A=e=>S=e,T=Symbol();function j(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var P,x;(x=P||(P={})).direct="direct",x.patchObject="patch object",x.patchFunction="patch function";const C=()=>{};function N(e,t,n,r=C){e.push(t);const o=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),r())};return!n&&p()&&h(o),o}function D(e,...t){e.slice().forEach((e=>{e(...t)}))}function L(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(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],o=e[n];j(o)&&j(r)&&e.hasOwnProperty(n)&&!u(r)&&!l(r)?e[n]=L(o,r):e[n]=r}return e}const k=Symbol();const{assign:U}=Object;function F(e,t,s={},i,d,p){let h;const g=U({actions:{}},s),y={deep:!0};let b,E,O,w=o([]),_=o([]);const v=i.state.value[e];let R;function S(t){let n;b=E=!1,"function"==typeof t?(t(i.state.value[e]),n={type:P.patchFunction,storeId:e,events:O}):(L(i.state.value[e],t),n={type:P.patchObject,payload:t,storeId:e,events:O});const r=R=Symbol();m().then((()=>{R===r&&(b=!0)})),E=!0,D(w,n,i.state.value[e])}p||v||(i.state.value[e]={}),r({});const T=C;function x(t,n){return function(){A(i);const r=Array.from(arguments),o=[],s=[];let a;D(_,{args:r,name:t,store:I,after:function(e){o.push(e)},onError:function(e){s.push(e)}});try{a=n.apply(this&&this.$id===e?this:I,r)}catch(c){throw D(s,c),c}return a instanceof Promise?a.then((e=>(D(o,e),e))).catch((e=>(D(s,e),Promise.reject(e)))):(D(o,a),a)}}const F={_p:i,$id:e,$onAction:N.bind(null,_),$patch:S,$reset:T,$subscribe(t,n={}){const r=N(w,t,n.detached,(()=>o())),o=h.run((()=>a((()=>i.state.value[e]),(r=>{("sync"===n.flush?E:b)&&t({storeId:e,type:P.direct,events:O},r)}),U({},y,n))));return r},$dispose:function(){h.stop(),w=[],_=[],i._s.delete(e)}},I=c(F);i._s.set(e,I);const B=i._e.run((()=>(h=n(),h.run((()=>t())))));for(const n in B){const t=B[n];if(u(t)&&(!u(V=t)||!V.effect)||l(t))p||(!v||j(M=t)&&M.hasOwnProperty(k)||(u(t)?t.value=v[n]:L(t,v[n])),i.state.value[e][n]=t);else if("function"==typeof t){const e=x(n,t);B[n]=e,g.actions[n]=t}}var M,V;return U(I,B),U(f(I),B),Object.defineProperty(I,"$state",{get:()=>i.state.value[e],set:e=>{S((t=>{U(t,e)}))}}),i._p.forEach((e=>{U(I,h.run((()=>e({store:I,app:i._a,pinia:i,options:g}))))})),v&&p&&s.hydrate&&s.hydrate(I.$state,v),b=!0,E=!0,I}function I(e,t,n){let r,a;const c="function"==typeof t;function u(e,n){const u=s();(e=e||u&&i(T,null))&&A(e),(e=S)._s.has(r)||(c?F(r,t,a,e):function(e,t,n,r){const{state:s,actions:i,getters:a}=t,c=n.state.value[e];let u;u=F(e,(function(){c||(n.state.value[e]=s?s():{});const t=g(n.state.value[e]);return U(t,i,Object.keys(a||{}).reduce(((t,r)=>(t[r]=o(y((()=>{A(n);const t=n._s.get(e);return a[r].call(t,t)}))),t)),{}))}),t,n,0,!0),u.$reset=function(){const e=s?s():{};this.$patch((t=>{U(t,e)}))}}(r,a,e));return e._s.get(r)}return"string"==typeof e?(r=e,a=c?n:t):(a=e,r=e.id),u.$id=r,u}function B(e){{e=f(e);const t={};for(const n in e){const r=e[n];(u(r)||l(r))&&(t[n]=d(e,n))}return t}}const M=function(){const e=n(!0),t=e.run((()=>r({})));let s=[],i=[];const a=o({install(e){A(a),a._a=e,e.provide(T,a),e.config.globalProperties.$pinia=a,i.forEach((e=>s.push(e))),i=[]},use(e){return this._a||R?s.push(e):i.push(e),this},_p:s,_a:null,_e:e,_s:new Map,state:t});return a}(),V={},q=function(e,t,n){if(!t||0===t.length)return e();const r=document.getElementsByTagName("link");return Promi
|