mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-22 20:09:19 +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{G as n,ar as r,$ as o,H as s,P as i,aY as a,ap as c,X as u,V as l,aM as f,aN as d,I as p,af as h,a2 as m,aO as g,i as y}from"./runtime-core.esm-bundler-42d2bde8.js";import{c as b,a as E}from"./vue-router-98b91c90.js";import{bs as O,N as w}from"./index-a49147f4.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`);let R;const S=e=>R=e,A=Symbol();function T(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var j,P;(P=j||(j={})).direct="direct",P.patchObject="patch object",P.patchFunction="patch function";const x=()=>{};function C(e,t,n,r=x){e.push(t);const o=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),r())};return!n&&p()&&h(o),o}function N(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];T(o)&&T(r)&&e.hasOwnProperty(n)&&!u(r)&&!l(r)?e[n]=L(o,r):e[n]=r}return e}const D=Symbol();const{assign:k}=Object;function U(e,t,s={},i,d,p){let h;const g=k({actions:{}},s),y={deep:!0};let b,E,O,w=o([]),_=o([]);const v=i.state.value[e];let R;function A(t){let n;b=E=!1,"function"==typeof t?(t(i.state.value[e]),n={type:j.patchFunction,storeId:e,events:O}):(L(i.state.value[e],t),n={type:j.patchObject,payload:t,storeId:e,events:O});const r=R=Symbol();m().then((()=>{R===r&&(b=!0)})),E=!0,N(w,n,i.state.value[e])}p||v||(i.state.value[e]={}),r({});const P=x;function U(t,n){return function(){S(i);const r=Array.from(arguments),o=[],s=[];function a(e){o.push(e)}function c(e){s.push(e)}let u;N(_,{args:r,name:t,store:F,after:a,onError:c});try{u=n.apply(this&&this.$id===e?this:F,r)}catch(l){throw N(s,l),l}return u instanceof Promise?u.then((e=>(N(o,e),e))).catch((e=>(N(s,e),Promise.reject(e)))):(N(o,u),u)}}const I={_p:i,$id:e,$onAction:C.bind(null,_),$patch:A,$reset:P,$subscribe(t,n={}){const r=C(w,t,n.detached,(()=>o())),o=h.run((()=>a((()=>i.state.value[e]),(r=>{("sync"===n.flush?E:b)&&t({storeId:e,type:j.direct,events:O},r)}),k({},y,n))));return r},$dispose:function(){h.stop(),w=[],_=[],i._s.delete(e)}},F=c(I);i._s.set(e,F);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||T(M=t)&&M.hasOwnProperty(D)||(u(t)?t.value=v[n]:L(t,v[n])),i.state.value[e][n]=t);else if("function"==typeof t){const e=U(n,t);B[n]=e,g.actions[n]=t}}var M,V;return k(F,B),k(f(F),B),Object.defineProperty(F,"$state",{get:()=>i.state.value[e],set:e=>{A((t=>{k(t,e)}))}}),i._p.forEach((e=>{k(F,h.run((()=>e({store:F,app:i._a,pinia:i,options:g}))))})),v&&p&&s.hydrate&&s.hydrate(F.$state,v),b=!0,E=!0,F}function I(e,t,n){let r,a;const c="function"==typeof t;function u(e,n){const u=s();(e=e||u&&i(A,null))&&S(e),(e=R)._s.has(r)||(c?U(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=U(e,(function(){c||(n.state.value[e]=s?s():{});const t=g(n.state.value[e]);return k(t,i,Object.keys(a||{}).reduce(((t,r)=>(t[r]=o(y((()=>{S(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=>{k(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 F(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 B=function(){const e=n(!0),t=e.run((()=>r({})));let s=[],i=[];const a=o({install(e){S(a),a._a=e,e.provide(A,a),e.config.globalProperties.$pinia=a,i.forEach((e=>s.push(e))),i=[]},use(e){return this._a?s.push(e):i.push(e),this},_p:s,_a:null,_e:e,_s:new Map,state:t});return a}(),M={},V=function(e,t,n){if(!t||0===t.length)return e();const r=document.getElementsByTagName("link");return Promise.all(t.map((e=>{if((e=function(e){return"/v3-admin-vite/"+e}(e))in M)return;M[e]=!0;const t=e.endsWith(".css"),o=t?'[rel="stylesheet"]':"";if(!!n)for(let n=r.length-1;n>=0;n--){const o=r[n];if(o.href===e&&(!t||"stylesheet"===o.rel))return}else if(document.querySelector(`link[href="${e}"]${o}`))return;const s=document.createElement("link");return s.rel=t?"stylesheet":"modulepreload",t||(s.as="script",s.crossOrigin=""),s.href=e,document.head.appendChild(s),t?new Promise(((t,n)=>{s.addEventListener("load",t),s.addEventListener("error",(()=>n(new Error(`Unable to preload CSS for ${e}`))))})):void 0}))).then((()=>e()))},q=()=>V((()=>import("./index-1983760c.js")),["static/index-1983760c.js","static/useTheme-50756902.js","static/runtime-core.esm-bundler-42d2bde8.js","static/index-a49147f4.js","static/vue-router-98b91c90.js","static/_plugin-vue_export-helper-1b428a4d.js","static/index.vue_vue_type_script_setup_true_lang-fad36417.js","static/dayjs.min-b8ca4226.js","static/error-c58402b8.js","static/index-48d9e173.css"]),z=[{path:"/redirect",component:q,meta:{hidden:!0},children:[{path:"/redirect/:path(.*)",component:()=>V((()=>import("./index-51b64fbd.js")),["static/index-51b64fbd.js","static/vue-router-98b91c90.js","static/runtime-core.esm-bundler-42d2bde8.js"])}]},{path:"/403",component:()=>V((()=>import("./403-4ea32865.js")),["static/403-4ea32865.js","static/ErrorPageLayout-469f83d4.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-42d2bde8.js","static/ErrorPageLayout-155a3ef2.css"]),meta:{hidden:!0}},{path:"/404",component:()=>V((()=>import("./404-a11b49c4.js")),["static/404-a11b49c4.js","static/ErrorPageLayout-469f83d4.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-42d2bde8.js","static/ErrorPageLayout-155a3ef2.css"]),meta:{hidden:!0},alias:"/:pathMatch(.*)*"},{path:"/login",component:()=>V((()=>import("./index-66145c68.js")),["static/index-66145c68.js","static/index-a49147f4.js","static/runtime-core.esm-bundler-42d2bde8.js","static/vue-router-98b91c90.js","static/index.vue_vue_type_script_setup_true_lang-fad36417.js","static/useTheme-50756902.js","static/_plugin-vue_export-helper-1b428a4d.js","static/index-cfe72ffd.css"]),meta:{hidden:!0}},{path:"/",component:q,redirect:"/dashboard",children:[{path:"dashboard",component:()=>V((()=>import("./index-1306cd97.js")),["static/index-1306cd97.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-42d2bde8.js","static/index-46ec7d2d.js","static/index-a49147f4.js","static/vue-router-98b91c90.js","static/index-fde86043.css"]),name:"Dashboard",meta:{title:"首页",svgIcon:"dashboard",affix:!0}}]},{path:"/unocss",component:q,redirect:"/unocss/index",children:[{path:"index",component:()=>V((()=>import("./index-e7d6e478.js")),["static/index-e7d6e478.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-42d2bde8.js"]),name:"UnoCSS",meta:{title:"unocss",svgIcon:"unocss"}}]},{path:"/link",component:q,children:[{path:"https://juejin.cn/post/7089377403717287972",component:()=>{},name:"Link",meta:{title:"外链",svgIcon:"link"}}]},{path:"/table",component:q,redirect:"/table/element-plus",name:"Table",meta:{title:"表格",elIcon:"Grid"},children:[{path:"element-plus",component:()=>V((()=>import("./index-393e4b8d.js")),["static/index-393e4b8d.js","static/table-855d7bab.js","static/index-a49147f4.js","static/runtime-core.esm-bundler-42d2bde8.js","static/index-8e25cdb5.js","static/error-c58402b8.js","static/_plugin-vue_export-helper-1b428a4d.js","static/vue-router-98b91c90.js","static/index-b23bdb83.css"]),name:"ElementPlus",meta:{title:"Element Plus"}},{path:"vxe-table",component:()=>V((()=>import("./index-fdb2527e.js")),["static/index-fdb2527e.js","static/table-855d7bab.js","static/runtime-core.esm-bundler-42d2bde8.js","static/index-8e25cdb5.js","static/index-a49147f4.js","static/error-c58402b8.js","static/vue-router-98b91c90.js"]),name:"VxeTable",meta:{title:"Vxe Table"}}]},{path:"/menu",component:q,redirect:"/menu/menu1",name:"Menu",meta:{title:"多级菜单",svgIcon:"menu"},children:[{path:"menu1",component:()=>V((()=>import("./index-1e9cc923.js")),["static/index-1e9cc923.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-42d2bde8.js"]),redirect:"/menu/menu1/menu1-1",name:"Menu1",meta:{title:"menu1"},children:[{path:"menu1-1",component:()=>V((()=>import("./index-a3d08d1a.js")),["static/index-a3d08d1a.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-42d2bde8.js"]),name:"Menu1-1",meta:{title:"menu1-1"}},{path:"menu1-2",component:()=>V((()=>import("./index-141bae61.js")),["static/index-141bae61.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-42d2bde8.js"]),redirect:"/menu/menu1/menu1-2/menu1-2-1",name:"Menu1-2",meta:{title:"menu1-2"},children:[{path:"menu1-2-1",component:()=>V((()=>import("./index-fa44926b.js")),["static/index-fa44926b.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-42d2bde8.js"]),name:"Menu1-2-1",meta:{title:"menu1-2-1"}},{path:"menu1-2-2",component:()=>V((()=>import("./index-cb2dfea3.js")),["static/index-cb2dfea3.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-42d2bde8.js"]),name:"Menu1-2-2",meta:{title:"menu1-2-2"}}]},{path:"menu1-3",component:()=>V((()=>import("./index-3bc4ce0d.js")),["static/index-3bc4ce0d.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-42d2bde8.js"]),name:"Menu1-3",meta:{title:"menu1-3"}}]},{path:"menu2",component:()=>V((()=>import("./index-d2f26801.js")),["static/index-d2f26801.js","static/_plugin-vue_export-helper-1b428a4d.js","static/runtime-core.esm-bundler-42d2bde8.js"]),name:"Menu2",meta:{title:"menu2"}}]},{path:"/hook-demo",component:q,redirect:"/hook-demo/use-fetch-select",name:"HookDemo",meta:{title:"hook 示例",elIcon:"Menu",alwaysShow:!0},children:[{path:"use-fetch-select",component:()=>V((()=>import("./use-fetch-select-c71bb80d.js")),["static/use-fetch-select-c71bb80d.js","static/runtime-core.esm-bundler-42d2bde8.js"]),name:"UseFetchSelect",meta:{title:"useFetchSelect"}},{path:"use-fullscreen-loading",component:()=>V((()=>import("./use-fullscreen-loading-09884e92.js")),["static/use-fullscreen-loading-09884e92.js","static/index-5ac14c26.js","static/runtime-core.esm-bundler-42d2bde8.js","static/index-a49147f4.js"]),name:"UseFullscreenLoading",meta:{title:"useFullscreenLoading"}}]}],$=[{path:"/permission",component:q,redirect:"/permission/page",name:"Permission",meta:{title:"权限管理",svgIcon:"lock",roles:["admin","editor"],alwaysShow:!0},children:[{path:"page",component:()=>V((()=>import("./page-0c44a99c.js")),["static/page-0c44a99c.js","static/vue-router-98b91c90.js","static/runtime-core.esm-bundler-42d2bde8.js","static/SwitchRoles-8a23fe04.js","static/_plugin-vue_export-helper-1b428a4d.js","static/SwitchRoles-0c18308f.css","static/index-a49147f4.js","static/page-3081310b.css"]),name:"PagePermission",meta:{title:"页面权限",roles:["admin"]}},{path:"directive",component:()=>V((()=>import("./directive-8794799f.js")),["static/directive-8794799f.js","static/SwitchRoles-8a23fe04.js","static/runtime-core.esm-bundler-42d2bde8.js","static/_plugin-vue_export-helper-1b428a4d.js","static/SwitchRoles-0c18308f.css","static/vue-router-98b91c90.js","static/index-a49147f4.js","static/directive-2d230132.css"]),name:"DirectivePermission",meta:{title:"指令权限"}}]},{path:"/:pathMatch(.*)*",redirect:"/404",name:"ErrorPage",meta:{hidden:!0}}],H=b({history:E("/v3-admin-vite/"),routes:z});function J(){try{H.getRoutes().forEach((e=>{var t;const{name:n,meta:r}=e;n&&(null==(t=r.roles)?void 0:t.length)&&H.hasRoute(n)&&H.removeRoute(n)}))}catch(e){window.location.reload()}}const K=(e,t)=>{const n=[];return e.forEach((e=>{const r={...e};((e,t)=>!t.meta||!t.meta.roles||e.some((e=>{var n;return void 0!==(null==(n=t.meta)?void 0:n.roles)&&t.meta.roles.includes(e)})))(t,r)&&(r.children&&(r.children=K(r.children,t)),n.push(r))})),n},W=I("permission",(()=>{const e=r([]),t=r([]);return{routes:e,dynamicRoutes:t,setRoutes:n=>{let r;r=n.includes("admin")?$:K($,n),e.value=z.concat(r),t.value=r}}}));function G(){return W(B)}function X(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Q=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=X({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var i in o)o[i]&&(s+="; "+i,!0!==o[i]&&(s+="="+o[i].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+s}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var s=n[o].split("="),i=s.slice(1).join("=");try{var a=decodeURIComponent(s[0]);if(r[a]=t.read(i,a),e===a)break}catch(c){}}return e?r[e]:r}},remove:function(e,t){r(e,"",X({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,X({},this.attributes,t))},withConverter:function(t){return e(X({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const Y=()=>Q.get(v.TOKEN),Z=e=>{Q.set(v.TOKEN,e)},ee=()=>{Q.remove(v.TOKEN)};function te(e,t){return function(){return e.apply(t,arguments)}}const{toString:ne}=Object.prototype,{getPrototypeOf:re}=Object,oe=(se=Object.create(null),e=>{const t=ne.call(e);return se[t]||(se[t]=t.slice(8,-1).toLowerCase())});var se;const ie=e=>(e=e.toLowerCase(),t=>oe(t)===e),ae=e=>t=>typeof t===e,{isArray:ce}=Array,ue=ae("undefined");const le=ie("ArrayBuffer");const fe=ae("string"),de=ae("function"),pe=ae("number"),he=e=>null!==e&&"object"==typeof e,me=e=>{if("object"!==oe(e))return!1;const t=re(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ge=ie("Date"),ye=ie("File"),be=ie("Blob"),Ee=ie("FileList"),Oe=ie("URLSearchParams");function we(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),ce(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function _e(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const ve="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Re=e=>!ue(e)&&e!==ve;const Se=(Ae="undefined"!=typeof Uint8Array&&re(Uint8Array),e=>Ae&&e instanceof Ae);var Ae;const Te=ie("HTMLFormElement"),je=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Pe=ie("RegExp"),xe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};we(n,((n,o)=>{!1!==t(n,o,e)&&(r[o]=n)})),Object.defineProperties(e,r)},Ce="abcdefghijklmnopqrstuvwxyz",Ne="0123456789",Le={DIGIT:Ne,ALPHA:Ce,ALPHA_DIGIT:Ce+Ce.toUpperCase()+Ne};const De={isArray:ce,isArrayBuffer:le,isBuffer:function(e){return null!==e&&!ue(e)&&null!==e.constructor&&!ue(e.constructor)&&de(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||ne.call(e)===t||de(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&le(e.buffer),t},isString:fe,isNumber:pe,isBoolean:e=>!0===e||!1===e,isObject:he,isPlainObject:me,isUndefined:ue,isDate:ge,isFile:ye,isBlob:be,isRegExp:Pe,isFunction:de,isStream:e=>he(e)&&de(e.pipe),isURLSearchParams:Oe,isTypedArray:Se,isFileList:Ee,forEach:we,merge:function e(){const{caseless:t}=Re(this)&&this||{},n={},r=(r,o)=>{const s=t&&_e(n,o)||o;me(n[s])&&me(r)?n[s]=e(n[s],r):me(r)?n[s]=e({},r):ce(r)?n[s]=r.slice():n[s]=r};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&we(arguments[o],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(we(t,((t,r)=>{n&&de(t)?e[r]=te(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&re(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:oe,kindOfTest:ie,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(ce(e))return e;let t=e.length;if(!pe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Te,hasOwnProperty:je,hasOwnProp:je,reduceDescriptors:xe,freezeMethods:e=>{xe(e,((t,n)=>{if(de(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];de(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return ce(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:_e,global:ve,isContextDefined:Re,ALPHABET:Le,generateString:(e=16,t=Le.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&de(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(he(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=ce(e)?[]:{};return we(e,((e,t)=>{const s=n(e,r+1);!ue(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)}};function ke(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}De.inherits(ke,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:De.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ue=ke.prototype,Ie={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Ie[e]={value:e}})),Object.defineProperties(ke,Ie),Object.defineProperty(Ue,"isAxiosError",{value:!0}),ke.from=(e,t,n,r,o,s)=>{const i=Object.create(Ue);return De.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),ke.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};function Fe(e){return De.isPlainObject(e)||De.isArray(e)}function Be(e){return De.endsWith(e,"[]")?e.slice(0,-2):e}function Me(e,t,n){return e?e.concat(t).map((function(e,t){return e=Be(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Ve=De.toFlatObject(De,{},null,(function(e){return/^is[A-Z]/.test(e)}));function qe(e,t,n){if(!De.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=De.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!De.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&De.isSpecCompliantForm(t);if(!De.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(De.isDate(e))return e.toISOString();if(!a&&De.isBlob(e))throw new ke("Blob is not supported. Use a Buffer instead.");return De.isArrayBuffer(e)||De.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(De.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(De.isArray(e)&&function(e){return De.isArray(e)&&!e.some(Fe)}(e)||De.isFileList(e)||De.endsWith(n,"[]")&&(a=De.toArray(e)))return n=Be(n),a.forEach((function(e,r){!De.isUndefined(e)&&null!==e&&t.append(!0===i?Me([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!Fe(e)||(t.append(Me(o,n,s),c(e)),!1)}const l=[],f=Object.assign(Ve,{defaultVisitor:u,convertValue:c,isVisitable:Fe});if(!De.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!De.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),De.forEach(n,(function(n,s){!0===(!(De.isUndefined(n)||null===n)&&o.call(t,n,De.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])})),l.pop()}}(e),t}function ze(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function $e(e,t){this._pairs=[],e&&qe(e,this,t)}const He=$e.prototype;function Je(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ke(e,t,n){if(!t)return e;const r=n&&n.encode||Je,o=n&&n.serialize;let s;if(s=o?o(t,n):De.isURLSearchParams(t)?t.toString():new $e(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}He.append=function(e,t){this._pairs.push([e,t])},He.toString=function(e){const t=e?function(t){return e.call(this,t,ze)}:ze;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const We=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){De.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ge={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xe="undefined"!=typeof URLSearchParams?URLSearchParams:$e,Qe=FormData,Ye=(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),Ze="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,et={isBrowser:!0,classes:{URLSearchParams:Xe,FormData:Qe,Blob:Blob},isStandardBrowserEnv:Ye,isStandardBrowserWebWorkerEnv:Ze,protocols:["http","https","file","blob","url","data"]};function tt(e){function t(e,n,r,o){let s=e[o++];const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&De.isArray(r)?r.length:s,a)return De.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&De.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&De.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(De.isFormData(e)&&De.isFunction(e.entries)){const n={};return De.forEachEntry(e,((e,r)=>{t(function(e){return De.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const nt={"Content-Type":void 0};const rt={transitional:Ge,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=De.isObject(e);o&&De.isHTMLForm(e)&&(e=new FormData(e));if(De.isFormData(e))return r&&r?JSON.stringify(tt(e)):e;if(De.isArrayBuffer(e)||De.isBuffer(e)||De.isStream(e)||De.isFile(e)||De.isBlob(e))return e;if(De.isArrayBufferView(e))return e.buffer;if(De.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return qe(e,new et.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return et.isNode&&De.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=De.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return qe(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(De.isString(e))try{return(t||JSON.parse)(e),De.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||rt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&De.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(o){if(n){if("SyntaxError"===o.name)throw ke.from(o,ke.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:et.classes.FormData,Blob:et.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};De.forEach(["delete","get","head"],(function(e){rt.headers[e]={}})),De.forEach(["post","put","patch"],(function(e){rt.headers[e]=De.merge(nt)}));const ot=rt,st=De.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),it=Symbol("internals");function at(e){return e&&String(e).trim().toLowerCase()}function ct(e){return!1===e||null==e?e:De.isArray(e)?e.map(ct):String(e)}function ut(e,t,n,r){return De.isFunction(r)?r.call(this,t,n):De.isString(t)?De.isString(r)?-1!==t.indexOf(r):De.isRegExp(r)?r.test(t):void 0:void 0}class lt{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=at(t);if(!o)throw new Error("header name must be a non-empty string");const s=De.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=ct(e))}const s=(e,t)=>De.forEach(e,((e,n)=>o(e,n,t)));return De.isPlainObject(e)||e instanceof this.constructor?s(e,t):De.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&st[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=at(e)){const n=De.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(De.isFunction(t))return t.call(this,e,n);if(De.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=at(e)){const n=De.findKey(this,e);return!(!n||t&&!ut(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=at(e)){const o=De.findKey(n,e);!o||t&&!ut(0,n[o],o,t)||(delete n[o],r=!0)}}return De.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ut(0,this[o],o,e)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return De.forEach(this,((r,o)=>{const s=De.findKey(n,o);if(s)return t[s]=ct(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=ct(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return De.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&De.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[it]=this[it]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=at(e);t[r]||(!function(e,t){const n=De.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return De.isArray(e)?e.forEach(r):r(e),this}}lt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),De.freezeMethods(lt.prototype),De.freezeMethods(lt);const ft=lt;function dt(e,t){const n=this||ot,r=t||n,o=ft.from(r.headers);let s=r.data;return De.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function pt(e){return!(!e||!e.__CANCEL__)}function ht(e,t,n){ke.call(this,null==e?"canceled":e,ke.ERR_CANCELED,t,n),this.name="CanceledError"}De.inherits(ht,ke,{__CANCEL__:!0});const mt=et.isStandardBrowserEnv?{write:function(e,t,n,r,o,s){const i=[];i.push(e+"="+encodeURIComponent(t)),De.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),De.isString(r)&&i.push("path="+r),De.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function gt(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const yt=et.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=De.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function bt(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,f=0;for(;l!==s;)f+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-n,c=r(a);n=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const Et={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=ft.from(e.headers).normalize(),s=e.responseType;let i;function a(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}De.isFormData(r)&&(et.isStandardBrowserEnv||et.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const u=gt(e.baseURL,e.url);function l(){if(!c)return;const r=ft.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ke("Request failed with status code "+n.status,[ke.ERR_BAD_REQUEST,ke.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),a()}),(function(e){n(e),a()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Ke(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(n(new ke("Request aborted",ke.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new ke("Network Error",ke.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Ge;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new ke(t,r.clarifyTimeoutError?ke.ETIMEDOUT:ke.ECONNABORTED,e,c)),c=null},et.isStandardBrowserEnv){const t=(e.withCredentials||yt(u))&&e.xsrfCookieName&&mt.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in c&&De.forEach(o.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),De.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&"json"!==s&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",bt(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",bt(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{c&&(n(!t||t.type?new ht(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);f&&-1===et.protocols.indexOf(f)?n(new ke("Unsupported protocol "+f+":",ke.ERR_BAD_REQUEST,e)):c.send(r||null)}))}};De.forEach(Et,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ot=e=>{e=De.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let o=0;o<t&&(n=e[o],!(r=De.isString(n)?Et[n.toLowerCase()]:n));o++);if(!r){if(!1===r)throw new ke(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(De.hasOwnProp(Et,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!De.isFunction(r))throw new TypeError("adapter is not a function");return r};function wt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ht(null,e)}function _t(e){wt(e),e.headers=ft.from(e.headers),e.data=dt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ot(e.adapter||ot.adapter)(e).then((function(t){return wt(e),t.data=dt.call(e,e.transformResponse,t),t.headers=ft.from(t.headers),t}),(function(t){return pt(t)||(wt(e),t&&t.response&&(t.response.data=dt.call(e,e.transformResponse,t.response),t.response.headers=ft.from(t.response.headers))),Promise.reject(t)}))}const vt=e=>e instanceof ft?e.toJSON():e;function Rt(e,t){t=t||{};const n={};function r(e,t,n){return De.isPlainObject(e)&&De.isPlainObject(t)?De.merge.call({caseless:n},e,t):De.isPlainObject(t)?De.merge({},t):De.isArray(t)?t.slice():t}function o(e,t,n){return De.isUndefined(t)?De.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!De.isUndefined(t))return r(void 0,t)}function i(e,t){return De.isUndefined(t)?De.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(vt(e),vt(t),!0)};return De.forEach(Object.keys(e).concat(Object.keys(t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);De.isUndefined(i)&&s!==a||(n[r]=i)})),n}const St="1.3.0",At={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{At[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Tt={};At.transitional=function(e,t,n){function r(e,t){return"[Axios v1.3.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new ke(r(o," has been removed"+(t?" in "+t:"")),ke.ERR_DEPRECATED);return t&&!Tt[o]&&(Tt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}};const jt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ke("options must be an object",ke.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new ke("option "+s+" must be "+n,ke.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new ke("Unknown option "+s,ke.ERR_BAD_OPTION)}},validators:At},Pt=jt.validators;class xt{constructor(e){this.defaults=e,this.interceptors={request:new We,response:new We}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Rt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;let s;void 0!==n&&jt.assertOptions(n,{silentJSONParsing:Pt.transitional(Pt.boolean),forcedJSONParsing:Pt.transitional(Pt.boolean),clarifyTimeoutError:Pt.transitional(Pt.boolean)},!1),void 0!==r&&jt.assertOptions(r,{encode:Pt.function,serialize:Pt.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),s=o&&De.merge(o.common,o[t.method]),s&&De.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=ft.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[_t.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=i.length;let d=t;for(f=0;f<l;){const e=i[f++],t=i[f++];try{d=e(d)}catch(p){t.call(this,p);break}}try{u=_t.call(this,d)}catch(p){return Promise.reject(p)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return Ke(gt((e=Rt(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}De.forEach(["delete","get","head","options"],(function(e){xt.prototype[e]=function(t,n){return this.request(Rt(n||{},{method:e,url:t,data:(n||{}).data}))}})),De.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Rt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}xt.prototype[e]=t(),xt.prototype[e+"Form"]=t(!0)}));const Ct=xt;class Nt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new ht(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Nt((function(t){e=t})),cancel:e}}}const Lt=Nt;const Dt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Dt).forEach((([e,t])=>{Dt[t]=e}));const kt=Dt;const Ut=function e(t){const n=new Ct(t),r=te(Ct.prototype.request,n);return De.extend(r,Ct.prototype,n,{allOwnKeys:!0}),De.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Rt(t,n))},r}(ot);Ut.Axios=Ct,Ut.CanceledError=ht,Ut.CancelToken=Lt,Ut.isCancel=pt,Ut.VERSION=St,Ut.toFormData=qe,Ut.AxiosError=ke,Ut.Cancel=Ut.CanceledError,Ut.all=function(e){return Promise.all(e)},Ut.spread=function(e){return function(t){return e.apply(null,t)}},Ut.isAxiosError=function(e){return De.isObject(e)&&!0===e.isAxiosError},Ut.mergeConfig=Rt,Ut.AxiosHeaders=ft,Ut.formToJSON=e=>tt(De.isHTMLForm(e)?new FormData(e):e),Ut.HttpStatusCode=kt,Ut.default=Ut;const It=Ut;const Ft=function(){const e=It.create();return e.interceptors.request.use((e=>e),(e=>Promise.reject(e))),e.interceptors.response.use((e=>{const t=e.data,n=t.code;return void 0===n?(O.error("非本系统的接口"),Promise.reject(new Error("非本系统的接口"))):0===n?t:(O.error(t.message||"Error"),Promise.reject(new Error("Error")))}),(e=>{switch(w(e,"response.status")){case 400:e.message="请求错误";break;case 401:zt().logout(),location.reload();break;case 403:e.message="拒绝访问";break;case 404:e.message="请求地址出错";break;case 408:e.message="请求超时";break;case 500:e.message="服务器内部错误";break;case 501:e.message="服务未实现";break;case 502:e.message="网关错误";break;case 503:e.message="服务不可用";break;case 504:e.message="网关超时";break;case 505:e.message="HTTP 版本不受支持"}return O.error(e.message),Promise.reject(e)})),e}(),Bt=(Mt=Ft,function(e){const t={headers:{Authorization:"Bearer "+Y(),"Content-Type":w(e,"headers.Content-Type","application/json")},timeout:5e3,baseURL:"https://mock.mengxuegu.com/mock/63218b5fb4c53348ed2bc212/api/v1",data:{}};return Mt(Object.assign(t,e))});var Mt;function Vt(){return Bt({url:"login/code",method:"get"})}const qt=I("user",(()=>{const e=r(Y()||""),t=r([]),n=r(""),o=()=>new Promise(((e,r)=>{Bt({url:"users/info",method:"get"}).then((r=>{t.value=r.data.roles,n.value=r.data.username,e(r)})).catch((e=>{r(e)}))}));return{token:e,roles:t,username:n,setRoles:e=>{t.value=e},login:t=>new Promise(((n,r)=>{var o;(o={username:t.username,password:t.password,code:t.code},Bt({url:"users/login",method:"post",data:o})).then((t=>{Z(t.data.token),e.value=t.data.token,n(!0)})).catch((e=>{r(e)}))})),getInfo:o,changeRoles:async n=>{const r="token-"+n;e.value=r,Z(r),await o();const s=W();s.setRoutes(t.value),J(),s.dynamicRoutes.forEach((e=>{H.addRoute(e)}))},logout:()=>{ee(),e.value="",t.value=[],J()},resetToken:()=>{ee(),e.value="",t.value=[]}}}));function zt(){return qt(B)}export{v as C,G as a,qt as b,W as c,I as d,F as e,Vt as f,Y as g,Bt as h,H as r,B as s,zt as u};
|