@vtj/utils 0.15.1 → 0.15.2
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.
- package/dist/index.cjs +4 -4
- package/dist/index.iife.js +3 -3
- package/dist/index.mjs +6 -10
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
- package/types/version.d.ts +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Copyright (c) 2026, VTJ.PRO All rights reserved.
|
|
3
3
|
* @name @vtj/utils
|
|
4
4
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
5
|
-
* @version 0.15.
|
|
5
|
+
* @version 0.15.2
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
|
-
*/const Mt="0.15.1";function st(t,e){return function(){return t.apply(e,arguments)}}const{toString:qt}=Object.prototype,{getPrototypeOf:xe}=Object,{iterator:ce,toStringTag:it}=Symbol,le=(t=>e=>{const n=qt.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),U=t=>(t=t.toLowerCase(),e=>le(e)===t),ue=t=>e=>typeof e===t,{isArray:$}=Array,H=ue("undefined");function K(t){return t!==null&&!H(t)&&t.constructor!==null&&!H(t.constructor)&&C(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const at=U("ArrayBuffer");function Ht(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&at(t.buffer),e}const Jt=ue("string"),C=ue("function"),ct=ue("number"),X=t=>t!==null&&typeof t=="object",$t=t=>t===!0||t===!1,oe=t=>{if(le(t)!=="object")return!1;const e=xe(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(it in t)&&!(ce in t)},Wt=t=>{if(!X(t)||K(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},zt=U("Date"),Vt=U("File"),Kt=U("Blob"),Xt=U("FileList"),Qt=t=>X(t)&&C(t.pipe),Gt=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||C(t.append)&&((e=le(t))==="formdata"||e==="object"&&C(t.toString)&&t.toString()==="[object FormData]"))},Yt=U("URLSearchParams"),[Zt,en,tn,nn]=["ReadableStream","Request","Response","Headers"].map(U),rn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Q(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),$(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{if(K(t))return;const s=n?Object.getOwnPropertyNames(t):Object.keys(t),i=s.length;let a;for(r=0;r<i;r++)a=s[r],e.call(null,t[a],a,t)}}function lt(t,e){if(K(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const v=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ut=t=>!H(t)&&t!==v;function Ee(){const{caseless:t,skipUndefined:e}=ut(this)&&this||{},n={},r=(o,s)=>{const i=t&<(n,s)||s;oe(n[i])&&oe(o)?n[i]=Ee(n[i],o):oe(o)?n[i]=Ee({},o):$(o)?n[i]=o.slice():(!e||!H(o))&&(n[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&Q(arguments[o],r);return n}const on=(t,e,n,{allOwnKeys:r}={})=>(Q(e,(o,s)=>{n&&C(o)?Object.defineProperty(t,s,{value:st(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),sn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),an=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},cn=(t,e,n,r)=>{let o,s,i;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)i=o[s],(!r||r(i,t,e))&&!a[i]&&(e[i]=t[i],a[i]=!0);t=n!==!1&&xe(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},ln=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},un=t=>{if(!t)return null;if($(t))return t;let e=t.length;if(!ct(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},fn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&xe(Uint8Array)),dn=(t,e)=>{const r=(t&&t[ce]).call(t);let o;for(;(o=r.next())&&!o.done;){const s=o.value;e.call(t,s[0],s[1])}},pn=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},hn=U("HTMLFormElement"),mn=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Me=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),gn=U("RegExp"),ft=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Q(n,(o,s)=>{let i;(i=e(o,s,t))!==!1&&(r[s]=i||o)}),Object.defineProperties(t,r)},yn=t=>{ft(t,(e,n)=>{if(C(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(C(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},wn=(t,e)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return $(t)?r(t):r(String(t).split(e)),n},bn=()=>{},En=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Rn(t){return!!(t&&C(t.append)&&t[it]==="FormData"&&t[ce])}const Sn=t=>{const e=new Array(10),n=(r,o)=>{if(X(r)){if(e.indexOf(r)>=0)return;if(K(r))return r;if(!("toJSON"in r)){e[o]=r;const s=$(r)?[]:{};return Q(r,(i,a)=>{const f=n(i,o+1);!H(f)&&(s[a]=f)}),e[o]=void 0,s}}return r};return n(t,0)},On=U("AsyncFunction"),Tn=t=>t&&(X(t)||C(t))&&C(t.then)&&C(t.catch),dt=((t,e)=>t?setImmediate:e?((n,r)=>(v.addEventListener("message",({source:o,data:s})=>{o===v&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),v.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",C(v.postMessage)),An=typeof queueMicrotask<"u"?queueMicrotask.bind(v):typeof process<"u"&&process.nextTick||dt,Cn=t=>t!=null&&C(t[ce]),c={isArray:$,isArrayBuffer:at,isBuffer:K,isFormData:Gt,isArrayBufferView:Ht,isString:Jt,isNumber:ct,isBoolean:$t,isObject:X,isPlainObject:oe,isEmptyObject:Wt,isReadableStream:Zt,isRequest:en,isResponse:tn,isHeaders:nn,isUndefined:H,isDate:zt,isFile:Vt,isBlob:Kt,isRegExp:gn,isFunction:C,isStream:Qt,isURLSearchParams:Yt,isTypedArray:fn,isFileList:Xt,forEach:Q,merge:Ee,extend:on,trim:rn,stripBOM:sn,inherits:an,toFlatObject:cn,kindOf:le,kindOfTest:U,endsWith:ln,toArray:un,forEachEntry:dn,matchAll:pn,isHTMLForm:hn,hasOwnProperty:Me,hasOwnProp:Me,reduceDescriptors:ft,freezeMethods:yn,toObjectSet:wn,toCamelCase:mn,noop:bn,toFiniteNumber:En,findKey:lt,global:v,isContextDefined:ut,isSpecCompliantForm:Rn,toJSONObject:Sn,isAsyncFn:On,isThenable:Tn,setImmediate:dt,asap:An,isIterable:Cn};let g=class pt extends Error{static from(e,n,r,o,s,i){const a=new pt(e.message,n||e.code,r,o,s);return a.cause=e,a.name=e.name,i&&Object.assign(a,i),a}constructor(e,n,r,o,s){super(e),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),o&&(this.request=o),s&&(this.response=s,this.status=s.status)}toJSON(){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:c.toJSONObject(this.config),code:this.code,status:this.status}}};g.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";g.ERR_BAD_OPTION="ERR_BAD_OPTION";g.ECONNABORTED="ECONNABORTED";g.ETIMEDOUT="ETIMEDOUT";g.ERR_NETWORK="ERR_NETWORK";g.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";g.ERR_DEPRECATED="ERR_DEPRECATED";g.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";g.ERR_BAD_REQUEST="ERR_BAD_REQUEST";g.ERR_CANCELED="ERR_CANCELED";g.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";g.ERR_INVALID_URL="ERR_INVALID_URL";const xn=null;function Re(t){return c.isPlainObject(t)||c.isArray(t)}function ht(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function qe(t,e,n){return t?t.concat(e).map(function(o,s){return o=ht(o),!n&&s?"["+o+"]":o}).join(n?".":""):e}function _n(t){return c.isArray(t)&&!t.some(Re)}const Pn=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function fe(t,e,n){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!c.isUndefined(h[m])});const r=n.metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(o))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(c.isDate(d))return d.toISOString();if(c.isBoolean(d))return d.toString();if(!f&&c.isBlob(d))throw new g("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(d)||c.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,m,h){let w=d;if(d&&!h&&typeof d=="object"){if(c.endsWith(m,"{}"))m=r?m:m.slice(0,-2),d=JSON.stringify(d);else if(c.isArray(d)&&_n(d)||(c.isFileList(d)||c.endsWith(m,"[]"))&&(w=c.toArray(d)))return m=ht(m),w.forEach(function(b,T){!(c.isUndefined(b)||b===null)&&e.append(i===!0?qe([m],T,s):i===null?m:m+"[]",u(b))}),!1}return Re(d)?!0:(e.append(qe(h,m,s),u(d)),!1)}const p=[],y=Object.assign(Pn,{defaultVisitor:l,convertValue:u,isVisitable:Re});function E(d,m){if(!c.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(d),c.forEach(d,function(w,S){(!(c.isUndefined(w)||w===null)&&o.call(e,w,c.isString(S)?S.trim():S,m,y))===!0&&E(w,m?m.concat(S):[S])}),p.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return E(t),e}function He(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function _e(t,e){this._pairs=[],t&&fe(t,this,e)}const mt=_e.prototype;mt.append=function(e,n){this._pairs.push([e,n])};mt.toString=function(e){const n=e?function(r){return e.call(this,r,He)}:He;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Ln(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function gt(t,e,n){if(!e)return t;const r=n&&n.encode||Ln,o=c.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let i;if(s?i=s(e,o):i=c.isURLSearchParams(e)?e.toString():new _e(e,o).toString(r),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Je{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(r){r!==null&&e(r)})}}const yt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Un=typeof URLSearchParams<"u"?URLSearchParams:_e,Fn=typeof FormData<"u"?FormData:null,Nn=typeof Blob<"u"?Blob:null,jn={isBrowser:!0,classes:{URLSearchParams:Un,FormData:Fn,Blob:Nn},protocols:["http","https","file","blob","url","data"]},Pe=typeof window<"u"&&typeof document<"u",Se=typeof navigator=="object"&&navigator||void 0,kn=Pe&&(!Se||["ReactNative","NativeScript","NS"].indexOf(Se.product)<0),Dn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Bn=Pe&&window.location.href||"http://localhost",vn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pe,hasStandardBrowserEnv:kn,hasStandardBrowserWebWorkerEnv:Dn,navigator:Se,origin:Bn},Symbol.toStringTag,{value:"Module"})),A={...vn,...jn};function In(t,e){return fe(t,new A.classes.URLSearchParams,{visitor:function(n,r,o,s){return A.isNode&&c.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...e})}function Mn(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function qn(t){const e={},n=Object.keys(t);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],e[s]=t[s];return e}function wt(t){function e(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),f=s>=n.length;return i=!i&&c.isArray(o)?o.length:i,f?(c.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!c.isObject(o[i]))&&(o[i]=[]),e(n,r,o[i],s)&&c.isArray(o[i])&&(o[i]=qn(o[i])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){const n={};return c.forEachEntry(t,(r,o)=>{e(Mn(r),o,n,0)}),n}return null}function Hn(t,e,n){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const G={transitional:yt,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=c.isObject(e);if(s&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return o?JSON.stringify(wt(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return In(e,this.formSerializer).toString();if((a=c.isFileList(e))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return fe(a?{"files[]":e}:e,f&&new f,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Hn(e)):e}],transformResponse:[function(e){const n=this.transitional||G.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?g.from(a,g.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:A.classes.FormData,Blob:A.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{G.headers[t]={}});const Jn=c.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"]),$n=t=>{const e={};let n,r,o;return t&&t.split(`
|
|
7
|
+
*/const Mt="0.15.2";function st(t,e){return function(){return t.apply(e,arguments)}}const{toString:qt}=Object.prototype,{getPrototypeOf:xe}=Object,{iterator:ce,toStringTag:it}=Symbol,le=(t=>e=>{const n=qt.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),U=t=>(t=t.toLowerCase(),e=>le(e)===t),ue=t=>e=>typeof e===t,{isArray:$}=Array,H=ue("undefined");function K(t){return t!==null&&!H(t)&&t.constructor!==null&&!H(t.constructor)&&C(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const at=U("ArrayBuffer");function Ht(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&at(t.buffer),e}const Jt=ue("string"),C=ue("function"),ct=ue("number"),X=t=>t!==null&&typeof t=="object",$t=t=>t===!0||t===!1,oe=t=>{if(le(t)!=="object")return!1;const e=xe(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(it in t)&&!(ce in t)},Wt=t=>{if(!X(t)||K(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},zt=U("Date"),Vt=U("File"),Kt=U("Blob"),Xt=U("FileList"),Qt=t=>X(t)&&C(t.pipe),Gt=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||C(t.append)&&((e=le(t))==="formdata"||e==="object"&&C(t.toString)&&t.toString()==="[object FormData]"))},Yt=U("URLSearchParams"),[Zt,en,tn,nn]=["ReadableStream","Request","Response","Headers"].map(U),rn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Q(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),$(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{if(K(t))return;const s=n?Object.getOwnPropertyNames(t):Object.keys(t),i=s.length;let a;for(r=0;r<i;r++)a=s[r],e.call(null,t[a],a,t)}}function lt(t,e){if(K(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const v=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ut=t=>!H(t)&&t!==v;function Ee(){const{caseless:t,skipUndefined:e}=ut(this)&&this||{},n={},r=(o,s)=>{const i=t&<(n,s)||s;oe(n[i])&&oe(o)?n[i]=Ee(n[i],o):oe(o)?n[i]=Ee({},o):$(o)?n[i]=o.slice():(!e||!H(o))&&(n[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&Q(arguments[o],r);return n}const on=(t,e,n,{allOwnKeys:r}={})=>(Q(e,(o,s)=>{n&&C(o)?Object.defineProperty(t,s,{value:st(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),sn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),an=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},cn=(t,e,n,r)=>{let o,s,i;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)i=o[s],(!r||r(i,t,e))&&!a[i]&&(e[i]=t[i],a[i]=!0);t=n!==!1&&xe(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},ln=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},un=t=>{if(!t)return null;if($(t))return t;let e=t.length;if(!ct(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},fn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&xe(Uint8Array)),dn=(t,e)=>{const r=(t&&t[ce]).call(t);let o;for(;(o=r.next())&&!o.done;){const s=o.value;e.call(t,s[0],s[1])}},pn=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},hn=U("HTMLFormElement"),mn=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Me=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),gn=U("RegExp"),ft=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Q(n,(o,s)=>{let i;(i=e(o,s,t))!==!1&&(r[s]=i||o)}),Object.defineProperties(t,r)},yn=t=>{ft(t,(e,n)=>{if(C(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(C(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},wn=(t,e)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return $(t)?r(t):r(String(t).split(e)),n},bn=()=>{},En=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Rn(t){return!!(t&&C(t.append)&&t[it]==="FormData"&&t[ce])}const Sn=t=>{const e=new Array(10),n=(r,o)=>{if(X(r)){if(e.indexOf(r)>=0)return;if(K(r))return r;if(!("toJSON"in r)){e[o]=r;const s=$(r)?[]:{};return Q(r,(i,a)=>{const f=n(i,o+1);!H(f)&&(s[a]=f)}),e[o]=void 0,s}}return r};return n(t,0)},On=U("AsyncFunction"),Tn=t=>t&&(X(t)||C(t))&&C(t.then)&&C(t.catch),dt=((t,e)=>t?setImmediate:e?((n,r)=>(v.addEventListener("message",({source:o,data:s})=>{o===v&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),v.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",C(v.postMessage)),An=typeof queueMicrotask<"u"?queueMicrotask.bind(v):typeof process<"u"&&process.nextTick||dt,Cn=t=>t!=null&&C(t[ce]),c={isArray:$,isArrayBuffer:at,isBuffer:K,isFormData:Gt,isArrayBufferView:Ht,isString:Jt,isNumber:ct,isBoolean:$t,isObject:X,isPlainObject:oe,isEmptyObject:Wt,isReadableStream:Zt,isRequest:en,isResponse:tn,isHeaders:nn,isUndefined:H,isDate:zt,isFile:Vt,isBlob:Kt,isRegExp:gn,isFunction:C,isStream:Qt,isURLSearchParams:Yt,isTypedArray:fn,isFileList:Xt,forEach:Q,merge:Ee,extend:on,trim:rn,stripBOM:sn,inherits:an,toFlatObject:cn,kindOf:le,kindOfTest:U,endsWith:ln,toArray:un,forEachEntry:dn,matchAll:pn,isHTMLForm:hn,hasOwnProperty:Me,hasOwnProp:Me,reduceDescriptors:ft,freezeMethods:yn,toObjectSet:wn,toCamelCase:mn,noop:bn,toFiniteNumber:En,findKey:lt,global:v,isContextDefined:ut,isSpecCompliantForm:Rn,toJSONObject:Sn,isAsyncFn:On,isThenable:Tn,setImmediate:dt,asap:An,isIterable:Cn};let g=class pt extends Error{static from(e,n,r,o,s,i){const a=new pt(e.message,n||e.code,r,o,s);return a.cause=e,a.name=e.name,i&&Object.assign(a,i),a}constructor(e,n,r,o,s){super(e),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),o&&(this.request=o),s&&(this.response=s,this.status=s.status)}toJSON(){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:c.toJSONObject(this.config),code:this.code,status:this.status}}};g.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";g.ERR_BAD_OPTION="ERR_BAD_OPTION";g.ECONNABORTED="ECONNABORTED";g.ETIMEDOUT="ETIMEDOUT";g.ERR_NETWORK="ERR_NETWORK";g.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";g.ERR_DEPRECATED="ERR_DEPRECATED";g.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";g.ERR_BAD_REQUEST="ERR_BAD_REQUEST";g.ERR_CANCELED="ERR_CANCELED";g.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";g.ERR_INVALID_URL="ERR_INVALID_URL";const xn=null;function Re(t){return c.isPlainObject(t)||c.isArray(t)}function ht(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function qe(t,e,n){return t?t.concat(e).map(function(o,s){return o=ht(o),!n&&s?"["+o+"]":o}).join(n?".":""):e}function _n(t){return c.isArray(t)&&!t.some(Re)}const Pn=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function fe(t,e,n){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!c.isUndefined(h[m])});const r=n.metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(o))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(c.isDate(d))return d.toISOString();if(c.isBoolean(d))return d.toString();if(!f&&c.isBlob(d))throw new g("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(d)||c.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,m,h){let w=d;if(d&&!h&&typeof d=="object"){if(c.endsWith(m,"{}"))m=r?m:m.slice(0,-2),d=JSON.stringify(d);else if(c.isArray(d)&&_n(d)||(c.isFileList(d)||c.endsWith(m,"[]"))&&(w=c.toArray(d)))return m=ht(m),w.forEach(function(b,T){!(c.isUndefined(b)||b===null)&&e.append(i===!0?qe([m],T,s):i===null?m:m+"[]",u(b))}),!1}return Re(d)?!0:(e.append(qe(h,m,s),u(d)),!1)}const p=[],y=Object.assign(Pn,{defaultVisitor:l,convertValue:u,isVisitable:Re});function E(d,m){if(!c.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(d),c.forEach(d,function(w,S){(!(c.isUndefined(w)||w===null)&&o.call(e,w,c.isString(S)?S.trim():S,m,y))===!0&&E(w,m?m.concat(S):[S])}),p.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return E(t),e}function He(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function _e(t,e){this._pairs=[],t&&fe(t,this,e)}const mt=_e.prototype;mt.append=function(e,n){this._pairs.push([e,n])};mt.toString=function(e){const n=e?function(r){return e.call(this,r,He)}:He;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Ln(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function gt(t,e,n){if(!e)return t;const r=n&&n.encode||Ln,o=c.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let i;if(s?i=s(e,o):i=c.isURLSearchParams(e)?e.toString():new _e(e,o).toString(r),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Je{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(r){r!==null&&e(r)})}}const yt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Un=typeof URLSearchParams<"u"?URLSearchParams:_e,Fn=typeof FormData<"u"?FormData:null,Nn=typeof Blob<"u"?Blob:null,jn={isBrowser:!0,classes:{URLSearchParams:Un,FormData:Fn,Blob:Nn},protocols:["http","https","file","blob","url","data"]},Pe=typeof window<"u"&&typeof document<"u",Se=typeof navigator=="object"&&navigator||void 0,kn=Pe&&(!Se||["ReactNative","NativeScript","NS"].indexOf(Se.product)<0),Dn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Bn=Pe&&window.location.href||"http://localhost",vn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pe,hasStandardBrowserEnv:kn,hasStandardBrowserWebWorkerEnv:Dn,navigator:Se,origin:Bn},Symbol.toStringTag,{value:"Module"})),A={...vn,...jn};function In(t,e){return fe(t,new A.classes.URLSearchParams,{visitor:function(n,r,o,s){return A.isNode&&c.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...e})}function Mn(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function qn(t){const e={},n=Object.keys(t);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],e[s]=t[s];return e}function wt(t){function e(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),f=s>=n.length;return i=!i&&c.isArray(o)?o.length:i,f?(c.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!a):((!o[i]||!c.isObject(o[i]))&&(o[i]=[]),e(n,r,o[i],s)&&c.isArray(o[i])&&(o[i]=qn(o[i])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){const n={};return c.forEachEntry(t,(r,o)=>{e(Mn(r),o,n,0)}),n}return null}function Hn(t,e,n){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const G={transitional:yt,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=c.isObject(e);if(s&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return o?JSON.stringify(wt(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return In(e,this.formSerializer).toString();if((a=c.isFileList(e))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return fe(a?{"files[]":e}:e,f&&new f,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),Hn(e)):e}],transformResponse:[function(e){const n=this.transitional||G.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?g.from(a,g.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:A.classes.FormData,Blob:A.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{G.headers[t]={}});const Jn=c.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"]),$n=t=>{const e={};let n,r,o;return t&&t.split(`
|
|
8
8
|
`).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||e[n]&&Jn[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},$e=Symbol("internals");function z(t){return t&&String(t).trim().toLowerCase()}function se(t){return t===!1||t==null?t:c.isArray(t)?t.map(se):String(t)}function Wn(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const zn=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ge(t,e,n,r,o){if(c.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!c.isString(e)){if(c.isString(r))return e.indexOf(r)!==-1;if(c.isRegExp(r))return r.test(e)}}function Vn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function Kn(t,e){const n=c.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,s,i){return this[r].call(this,e,o,s,i)},configurable:!0})})}let x=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function s(a,f,u){const l=z(f);if(!l)throw new Error("header name must be a non-empty string");const p=c.findKey(o,l);(!p||o[p]===void 0||u===!0||u===void 0&&o[p]!==!1)&&(o[p||f]=se(a))}const i=(a,f)=>c.forEach(a,(u,l)=>s(u,l,f));if(c.isPlainObject(e)||e instanceof this.constructor)i(e,n);else if(c.isString(e)&&(e=e.trim())&&!zn(e))i($n(e),n);else if(c.isObject(e)&&c.isIterable(e)){let a={},f,u;for(const l of e){if(!c.isArray(l))throw TypeError("Object iterator must return a key-value pair");a[u=l[0]]=(f=a[u])?c.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}i(a,n)}else e!=null&&s(n,e,r);return this}get(e,n){if(e=z(e),e){const r=c.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return Wn(o);if(c.isFunction(n))return n.call(this,o,r);if(c.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=z(e),e){const r=c.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||ge(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function s(i){if(i=z(i),i){const a=c.findKey(r,i);a&&(!n||ge(r,r[a],a,n))&&(delete r[a],o=!0)}}return c.isArray(e)?e.forEach(s):s(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!e||ge(this,this[s],s,e,!0))&&(delete this[s],o=!0)}return o}normalize(e){const n=this,r={};return c.forEach(this,(o,s)=>{const i=c.findKey(r,s);if(i){n[i]=se(o),delete n[s];return}const a=e?Vn(s):String(s).trim();a!==s&&delete n[s],n[a]=se(o),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return c.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&c.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
9
9
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[$e]=this[$e]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=z(i);r[a]||(Kn(o,i),r[a]=!0)}return c.isArray(e)?e.forEach(s):s(e),this}};x.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(x.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});c.freezeMethods(x);function ye(t,e){const n=this||G,r=e||n,o=x.from(r.headers);let s=r.data;return c.forEach(t,function(a){s=a.call(n,s,o.normalize(),e?e.status:void 0)}),o.normalize(),s}function bt(t){return!!(t&&t.__CANCEL__)}let Y=class extends g{constructor(e,n,r){super(e??"canceled",g.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function Et(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new g("Request failed with status code "+n.status,[g.ERR_BAD_REQUEST,g.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Xn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Qn(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,s=0,i;return e=e!==void 0?e:1e3,function(f){const u=Date.now(),l=r[s];i||(i=u),n[o]=f,r[o]=u;let p=s,y=0;for(;p!==o;)y+=n[p++],p=p%t;if(o=(o+1)%t,o===s&&(s=(s+1)%t),u-i<e)return;const E=l&&u-l;return E?Math.round(y*1e3/E):void 0}}function Gn(t,e){let n=0,r=1e3/e,o,s;const i=(u,l=Date.now())=>{n=l,o=null,s&&(clearTimeout(s),s=null),t(...u)};return[(...u)=>{const l=Date.now(),p=l-n;p>=r?i(u,l):(o=u,s||(s=setTimeout(()=>{s=null,i(o)},r-p)))},()=>o&&i(o)]}const ae=(t,e,n=3)=>{let r=0;const o=Qn(50,250);return Gn(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,f=i-r,u=o(f),l=i<=a;r=i;const p={loaded:i,total:a,progress:a?i/a:void 0,bytes:f,rate:u||void 0,estimated:u&&a&&l?(a-i)/u:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(p)},n)},We=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},ze=t=>(...e)=>c.asap(()=>t(...e)),Yn=A.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,A.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(A.origin),A.navigator&&/(msie|trident)/i.test(A.navigator.userAgent)):()=>!0,Zn=A.hasStandardBrowserEnv?{write(t,e,n,r,o,s,i){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];c.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),c.isString(r)&&a.push(`path=${r}`),c.isString(o)&&a.push(`domain=${o}`),s===!0&&a.push("secure"),c.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function er(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function tr(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Rt(t,e,n){let r=!er(e);return t&&(r||n==!1)?tr(t,e):e}const Ve=t=>t instanceof x?{...t}:t;function M(t,e){e=e||{};const n={};function r(u,l,p,y){return c.isPlainObject(u)&&c.isPlainObject(l)?c.merge.call({caseless:y},u,l):c.isPlainObject(l)?c.merge({},l):c.isArray(l)?l.slice():l}function o(u,l,p,y){if(c.isUndefined(l)){if(!c.isUndefined(u))return r(void 0,u,p,y)}else return r(u,l,p,y)}function s(u,l){if(!c.isUndefined(l))return r(void 0,l)}function i(u,l){if(c.isUndefined(l)){if(!c.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function a(u,l,p){if(p in e)return r(u,l);if(p in t)return r(void 0,u)}const f={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken: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:(u,l,p)=>o(Ve(u),Ve(l),p,!0)};return c.forEach(Object.keys({...t,...e}),function(l){const p=f[l]||o,y=p(t[l],e[l],l);c.isUndefined(y)&&p!==a||(n[l]=y)}),n}const St=t=>{const e=M({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=e;if(e.headers=i=x.from(i),e.url=gt(Rt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(n)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(c.isFunction(n.getHeaders)){const f=n.getHeaders(),u=["content-type","content-length"];Object.entries(f).forEach(([l,p])=>{u.includes(l.toLowerCase())&&i.set(l,p)})}}if(A.hasStandardBrowserEnv&&(r&&c.isFunction(r)&&(r=r(e)),r||r!==!1&&Yn(e.url))){const f=o&&s&&Zn.read(s);f&&i.set(o,f)}return e},nr=typeof XMLHttpRequest<"u",rr=nr&&function(t){return new Promise(function(n,r){const o=St(t);let s=o.data;const i=x.from(o.headers).normalize();let{responseType:a,onUploadProgress:f,onDownloadProgress:u}=o,l,p,y,E,d;function m(){E&&E(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(l),o.signal&&o.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function w(){if(!h)return;const b=x.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),P={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:b,config:t,request:h};Et(function(L){n(L),m()},function(L){r(L),m()},P),h=null}"onloadend"in h?h.onloadend=w:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(w)},h.onabort=function(){h&&(r(new g("Request aborted",g.ECONNABORTED,t,h)),h=null)},h.onerror=function(T){const P=T&&T.message?T.message:"Network Error",D=new g(P,g.ERR_NETWORK,t,h);D.event=T||null,r(D),h=null},h.ontimeout=function(){let T=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const P=o.transitional||yt;o.timeoutErrorMessage&&(T=o.timeoutErrorMessage),r(new g(T,P.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,t,h)),h=null},s===void 0&&i.setContentType(null),"setRequestHeader"in h&&c.forEach(i.toJSON(),function(T,P){h.setRequestHeader(P,T)}),c.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),a&&a!=="json"&&(h.responseType=o.responseType),u&&([y,d]=ae(u,!0),h.addEventListener("progress",y)),f&&h.upload&&([p,E]=ae(f),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",E)),(o.cancelToken||o.signal)&&(l=b=>{h&&(r(!b||b.type?new Y(null,t,h):b),h.abort(),h=null)},o.cancelToken&&o.cancelToken.subscribe(l),o.signal&&(o.signal.aborted?l():o.signal.addEventListener("abort",l)));const S=Xn(o.url);if(S&&A.protocols.indexOf(S)===-1){r(new g("Unsupported protocol "+S+":",g.ERR_BAD_REQUEST,t));return}h.send(s||null)})},or=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const s=function(u){if(!o){o=!0,a();const l=u instanceof Error?u:this.reason;r.abort(l instanceof g?l:new Y(l instanceof Error?l.message:l))}};let i=e&&setTimeout(()=>{i=null,s(new g(`timeout of ${e}ms exceeded`,g.ETIMEDOUT))},e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),t=null)};t.forEach(u=>u.addEventListener("abort",s));const{signal:f}=r;return f.unsubscribe=()=>c.asap(a),f}},sr=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},ir=async function*(t,e){for await(const n of ar(t))yield*sr(n,e)},ar=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Ke=(t,e,n,r)=>{const o=ir(t,e);let s=0,i,a=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await o.next();if(u){a(),f.close();return}let p=l.byteLength;if(n){let y=s+=p;n(y)}f.enqueue(new Uint8Array(l))}catch(u){throw a(u),u}},cancel(f){return a(f),o.return()}},{highWaterMark:2})},Xe=64*1024,{isFunction:ne}=c,cr=(({Request:t,Response:e})=>({Request:t,Response:e}))(c.global),{ReadableStream:Qe,TextEncoder:Ge}=c.global,Ye=(t,...e)=>{try{return!!t(...e)}catch{return!1}},lr=t=>{t=c.merge.call({skipUndefined:!0},cr,t);const{fetch:e,Request:n,Response:r}=t,o=e?ne(e):typeof fetch=="function",s=ne(n),i=ne(r);if(!o)return!1;const a=o&&ne(Qe),f=o&&(typeof Ge=="function"?(d=>m=>d.encode(m))(new Ge):async d=>new Uint8Array(await new n(d).arrayBuffer())),u=s&&a&&Ye(()=>{let d=!1;const m=new n(A.origin,{body:new Qe,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!m}),l=i&&a&&Ye(()=>c.isReadableStream(new r("").body)),p={stream:l&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!p[d]&&(p[d]=(m,h)=>{let w=m&&m[d];if(w)return w.call(m);throw new g(`Response type '${d}' is not supported`,g.ERR_NOT_SUPPORT,h)})});const y=async d=>{if(d==null)return 0;if(c.isBlob(d))return d.size;if(c.isSpecCompliantForm(d))return(await new n(A.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(c.isArrayBufferView(d)||c.isArrayBuffer(d))return d.byteLength;if(c.isURLSearchParams(d)&&(d=d+""),c.isString(d))return(await f(d)).byteLength},E=async(d,m)=>{const h=c.toFiniteNumber(d.getContentLength());return h??y(m)};return async d=>{let{url:m,method:h,data:w,signal:S,cancelToken:b,timeout:T,onDownloadProgress:P,onUploadProgress:D,responseType:L,headers:pe,withCredentials:Z="same-origin",fetchOptions:je}=St(d),ke=e||fetch;L=L?(L+"").toLowerCase():"text";let ee=or([S,b&&b.toAbortSignal()],T),W=null;const B=ee&&ee.unsubscribe&&(()=>{ee.unsubscribe()});let De;try{if(D&&u&&h!=="get"&&h!=="head"&&(De=await E(pe,w))!==0){let k=new n(m,{method:"POST",body:w,duplex:"half"}),q;if(c.isFormData(w)&&(q=k.headers.get("content-type"))&&pe.setContentType(q),k.body){const[he,te]=We(De,ae(ze(D)));w=Ke(k.body,Xe,he,te)}}c.isString(Z)||(Z=Z?"include":"omit");const F=s&&"credentials"in n.prototype,Be={...je,signal:ee,method:h.toUpperCase(),headers:pe.normalize().toJSON(),body:w,duplex:"half",credentials:F?Z:void 0};W=s&&new n(m,Be);let j=await(s?ke(W,je):ke(m,Be));const ve=l&&(L==="stream"||L==="response");if(l&&(P||ve&&B)){const k={};["status","statusText","headers"].forEach(Ie=>{k[Ie]=j[Ie]});const q=c.toFiniteNumber(j.headers.get("content-length")),[he,te]=P&&We(q,ae(ze(P),!0))||[];j=new r(Ke(j.body,Xe,he,()=>{te&&te(),B&&B()}),k)}L=L||"text";let Bt=await p[c.findKey(p,L)||"text"](j,d);return!ve&&B&&B(),await new Promise((k,q)=>{Et(k,q,{data:Bt,headers:x.from(j.headers),status:j.status,statusText:j.statusText,config:d,request:W})})}catch(F){throw B&&B(),F&&F.name==="TypeError"&&/Load failed|fetch/i.test(F.message)?Object.assign(new g("Network Error",g.ERR_NETWORK,d,W),{cause:F.cause||F}):g.from(F,F&&F.code,d,W)}}},ur=new Map,Ot=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:o}=e,s=[r,o,n];let i=s.length,a=i,f,u,l=ur;for(;a--;)f=s[a],u=l.get(f),u===void 0&&l.set(f,u=a?new Map:lr(e)),l=u;return u};Ot();const Le={http:xn,xhr:rr,fetch:{get:Ot}};c.forEach(Le,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ze=t=>`- ${t}`,fr=t=>c.isFunction(t)||t===null||t===!1;function dr(t,e){t=c.isArray(t)?t:[t];const{length:n}=t;let r,o;const s={};for(let i=0;i<n;i++){r=t[i];let a;if(o=r,!fr(r)&&(o=Le[(a=String(r)).toLowerCase()],o===void 0))throw new g(`Unknown adapter '${a}'`);if(o&&(c.isFunction(o)||(o=o.get(e))))break;s[a||"#"+i]=o}if(!o){const i=Object.entries(s).map(([f,u])=>`adapter ${f} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
|
|
10
10
|
`+i.map(Ze).join(`
|
|
11
|
-
`):" "+Ze(i[0]):"as no adapter specified";throw new g("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const Tt={getAdapter:dr,adapters:Le};function we(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Y(null,t)}function et(t){return we(t),t.headers=x.from(t.headers),t.data=ye.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Tt.getAdapter(t.adapter||G.adapter,t)(t).then(function(r){return we(t),r.data=ye.call(t,t.transformResponse,r),r.headers=x.from(r.headers),r},function(r){return bt(r)||(we(t),r&&r.response&&(r.response.data=ye.call(t,t.transformResponse,r.response),r.response.headers=x.from(r.response.headers))),Promise.reject(r)})}const At="1.13.
|
|
12
|
-
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=M(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&ie.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),o!=null&&(c.isFunction(o)?n.paramsSerializer={serialize:o}:ie.assertOptions(o,{encode:N.function,serialize:N.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ie.assertOptions(n,{baseUrl:N.spelling("baseURL"),withXsrfToken:N.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&c.merge(s.common,s[n.method]);s&&c.forEach(["delete","get","head","post","put","patch","common"],d=>{delete s[d]}),n.headers=x.concat(i,s);const a=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let l,p=0,y;if(!f){const d=[et.bind(this),void 0];d.unshift(...a),d.push(...u),y=d.length,l=Promise.resolve(n);let m=n;for(;p<y;)l=l.then(d[p++]).then(h=>{m=h!==void 0?h:m}).catch(d[p++]).then(()=>m);return l}y=a.length;let E=n;for(;p<y;){const d=a[p++],m=a[p++];try{E=d(E)}catch(h){m.call(this,h);break}}try{l=et.call(this,E)}catch(d){return Promise.reject(d)}for(p=0,y=u.length;p<y;)l=l.then(u[p++]).catch(u[p++]);return l}getUri(e){e=M(this.defaults,e);const n=Rt(e.baseURL,e.url,e.allowAbsoluteUrls);return gt(n,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){I.prototype[e]=function(n,r){return this.request(M(r||{},{method:e,url:n,data:(r||{}).data}))}});c.forEach(["post","put","patch"],function(e){function n(r){return function(s,i,a){return this.request(M(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}I.prototype[e]=n(),I.prototype[e+"Form"]=n(!0)});let hr=class Ct{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},e(function(s,i,a){r.reason||(r.reason=new Y(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Ct(function(o){e=o}),cancel:e}}};function mr(t){return function(n){return t.apply(null,n)}}function gr(t){return c.isObject(t)&&t.isAxiosError===!0}const Oe={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Oe).forEach(([t,e])=>{Oe[e]=t});function xt(t){const e=new I(t),n=st(I.prototype.request,e);return c.extend(n,I.prototype,e,{allOwnKeys:!0}),c.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return xt(M(t,o))},n}const R=xt(G);R.Axios=I;R.CanceledError=Y;R.CancelToken=hr;R.isCancel=bt;R.VERSION=At;R.toFormData=fe;R.AxiosError=g;R.Cancel=R.CanceledError;R.all=function(e){return Promise.all(e)};R.spread=mr;R.isAxiosError=gr;R.mergeConfig=M;R.AxiosHeaders=x;R.formToJSON=t=>wt(c.isHTMLForm(t)?new FormData(t):t);R.getAdapter=Tt.getAdapter;R.HttpStatusCode=Oe;R.default=R;const{Axios:io,AxiosError:ao,CanceledError:co,isCancel:lo,CancelToken:uo,VERSION:fo,all:po,Cancel:ho,isAxiosError:mo,spread:go,toFormData:yo,AxiosHeaders:wo,HttpStatusCode:bo,formToJSON:Eo,getAdapter:Ro,mergeConfig:So}=R,yr={form:"application/x-www-form-urlencoded",json:"application/json",data:"multipart/form-data"},wr=["put","post","patch"],Te="Local-Request-Id",br=100,Er=300;class _t{constructor(e={}){_(this,"axios");_(this,"settings");_(this,"records",{});_(this,"isLoading",!1);_(this,"stopSkipWarn");_(this,"showLoading");_(this,"showError");this.settings=Object.assign({type:"form"},e.settings||{});const n=O.omit(e,["settings","query"]);this.axios=R.create(O.merge({headers:{"Content-Type":"application/x-www-form-urlencoded"},timeout:120*1e3},n)),this.setupSkipWarn(this.settings),this.showLoading=O.debounce(this.openLoading.bind(this),br),this.showError=O.throttle(this._showError.bind(this),Er,{leading:!0,trailing:!1})}setConfig(e={}){this.settings=O.merge(this.settings,e.settings||{});const n=O.omit(e,["settings","query"]);this.axios.defaults=O.merge(this.axios.defaults,n),this.setupSkipWarn(this.settings)}cancel(e,n="请求已取消"){if(e){const r=this.records[e];if(!r)return;r.source.cancel(n)}else for(const r of Object.values(this.records))r.source.cancel(n)}createHeaders(e,n,r){const o=n.injectHeaders?typeof n.headers=="function"?n.headers(e,r,n):n.headers||{}:{},s={"Content-Type":yr[n.type||"form"],...r.headers,...o};return n.skipWarn&&(s[Te]=e),s}isJsonType(e){return Object.entries(e).some(([n,r])=>n.toLowerCase()==="content-type"&&String(r).includes("application/json"))}toFormData(e,n="data"){if(e instanceof FormData||e instanceof URLSearchParams)return e;const r=n==="data"?new FormData:new URLSearchParams;return Object.entries(e).forEach(([o,s])=>{r.append(o,s)}),r}createSendData(e,n,r,o,s={}){const{type:i,skipWarn:a}=e,{name:f="skipWarn"}=a||{};let{data:u,params:l={},method:p="get"}=n;const y=o?{[f]:!0}:{};return wr.includes(p.toLowerCase())?(u=Object.assign(u||{},y),u=i!=="json"||!this.isJsonType(r)?this.toFormData(u,i):u,l={...s}):i==="form"?l={...u||{},...s,...y}:(u&&(i!=="json"||!this.isJsonType(r))&&(u=this.toFormData(u,i)),l={...s,...y}),{data:u,params:l}}createUrl(e){let{url:n,params:r}=e;if(n){let o=O.isUrl(n)?new URL(n).origin:"";const s=o?n.replace(o,""):n;try{const i=O.pathToRegexpCompile(s,{encode:encodeURIComponent});return o+i(r||{})}catch{console.warn("createUrl","pathToRegexpCompile error",n)}}return n}openLoading(e){const{loading:n,showLoading:r}=e;n&&r&&Object.keys(this.records).length>0&&(this.isLoading=!0,r())}closeLoading(e){const{loading:n,hideLoading:r}=e;if(!n)return;this.isLoading=!1;const o=Object.keys(this.records);r&&o.length===0&&(this.isLoading=!1,r())}_showError(e,n){const{failMessage:r,showError:o}=e;if(r&&o){const s=n?.response?.data,i=s?.message||s?.msg||n?.message||n?.msg||"未知错误";o(i,n)}}validResponse(e,n){const{validSuccess:r,validate:o}=e;return r&&o?!!o(n):!0}isSkipWarnResponse(e){return!!e.promise}send(e={},n=!1){const r=O.merge({},this.settings,e.settings||{}),o=e.query||{},s=O.omit(e,["settings","query"]),i=O.uuid(!1),a=R.CancelToken.source();this.records[i]={settings:r,config:s,source:a};const f=this.createUrl(s),u=this.createHeaders(i,r,s),{data:l,params:p}=this.createSendData(r,s,u,n,o);return this.showLoading(r),new Promise((y,E)=>{this.axios({cancelToken:a.token,...s,url:f,headers:u,data:l,params:p}).then(d=>this.isSkipWarnResponse(d)?y(d.promise):this.validResponse(r,d)?y(r.originResponse?d:d.data?.data):(this.showError(r,d.data),E(d.data))).catch(d=>(this.showError(r,d),E(d))).finally(()=>{delete this.records[i],this.closeLoading(r)})})}useResponse(e,n){const{response:r}=this.axios.interceptors,o=r.use(e,n);return()=>r.eject(o)}useRequest(e,n){const{request:r}=this.axios.interceptors,o=r.use(e,n);return()=>r.eject(o)}setupSkipWarn(e){if(this.stopSkipWarn&&(this.stopSkipWarn(),this.stopSkipWarn=void 0),!e.skipWarn)return;const{code:n,executor:r,callback:o,complete:s}=e.skipWarn;this.stopSkipWarn=this.useResponse(i=>{const f=(i.config.headers||{})[Te],u=this.records[f];if(!u)return i;const{data:l}=i;if(!l||typeof l!="object")return i;if(l?.code===n){o&&o(i);const p=new Promise(r).then(()=>this.send({...u.config,settings:u.settings},!0));p.catch(y=>y).finally(()=>{s&&s()}),i.promise=p}return i})}}function Pt(t={}){const e=new _t(t),n=e.send.bind(e),r=e.cancel.bind(e),o=e.setConfig.bind(e),s=e.useRequest.bind(e),i=e.useResponse.bind(e);return Object.assign(n,{...e,instance:e,send:n,cancel:r,setConfig:o,useRequest:s,useResponse:i})}const Ue=Pt({settings:{injectHeaders:!0,loading:!0,originResponse:!0}});function Lt(t,e=Ue){const n=typeof t=="string"?{url:t}:t;return(r,o)=>e.send(O.merge({},n,o||{},{data:r}))}function Rr(t,e=Ue){const n={};for(const[r,o]of Object.entries(t))n[r]=Lt(o,e);return n}function Sr(t,e){const n=me.ref(null),r=me.ref(),o=me.ref(!0),s=()=>{o.value=!0,r.value=void 0,(typeof t=="function"?t():t).then(a=>{n.value=e?e(a):a}).catch(a=>{r.value=a}).finally(()=>{o.value=!1})};return s(),{data:n,error:r,loading:o,reload:s}}const J=typeof window<"u",Or=t=>new Promise((e,n)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>{e(r.result)},r.onerror=o=>{n(o)}});function Tr(t){const e={};return t?(t.forEach((n,r)=>{e[r]=typeof n=="string"?decodeURIComponent(n):n}),e):{}}function Ar(t){const e=t.split(","),n=e[0].match(/:(.*?);/)?.[1],r=atob(e[1]);let o=r.length;const s=new Uint8Array(o);for(;o--;)s[o]=r.charCodeAt(o);return new Blob([s],{type:n})}function Cr(t,e){const n=t;return n.lastModified=Date.now(),n.lastModifiedDate=new Date,n.name=e,n}const xr=t=>J?window.requestAnimationFrame(t):setTimeout(t,16),_r=t=>J?window.cancelAnimationFrame(t):clearTimeout(t);class Ut{constructor(e={}){_(this,"options",{type:"cache",expired:0,prefix:"__VTJ_"});_(this,"caches",{});_(this,"types");this.types={local:J?window.localStorage:this.caches,session:J?window.sessionStorage:this.caches,cache:this.caches},this.config(e)}config(e={}){this.options=Object.assign(this.options,e)}save(e,n,r={}){const{type:o,expired:s,prefix:i}={...this.options,...r},a=Date.now(),f=i+e,u=this.types[o]||this.caches,l={value:n,timestamp:a,expired:s};u===this.caches?u[f]=l:u.setItem(f,JSON.stringify(l))}get(e,n={}){const{type:r,prefix:o}={...this.options,...n},s=o+e,i=this.types[r]||this.caches;let a;if(i===this.caches)a=i[s];else{const y=i.getItem(s);if(y)try{a=JSON.parse(y)}catch(E){console.warn("[Storage] JSON.parse",E)}}if(!a)return null;const{value:f,timestamp:u,expired:l}=a;return l>0&&u+l<Date.now()?(this.remove(e,n),null):f}remove(e,n={}){const{type:r,prefix:o}={...this.options,...n},s=this.types[r]||this.caches,i=o+e;s===this.caches?delete s[i]:s.removeItem(i)}clear(e={}){const{type:n}={...this.options,...e},r=this.types[n]||this.caches;r===this.caches?this.caches={}:r.clear()}}const Pr=new Ut;function Ft(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var V={exports:{}},Lr=V.exports,nt;function Ur(){return nt||(nt=1,(function(t,e){(function(n,r){r(e,t)})(Lr,function(n,r){var o={timeout:5e3,jsonpCallback:"callback"};function s(){return"jsonp_"+Date.now()+"_"+Math.ceil(Math.random()*1e5)}function i(u){try{delete window[u]}catch{window[u]=void 0}}function a(u){var l=document.getElementById(u);l&&document.getElementsByTagName("head")[0].removeChild(l)}function f(u){var l=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],p=u,y=l.timeout||o.timeout,E=l.jsonpCallback||o.jsonpCallback,d=void 0;return new Promise(function(m,h){var w=l.jsonpCallbackFunction||s(),S=E+"_"+w;window[w]=function(T){m({ok:!0,json:function(){return Promise.resolve(T)}}),d&&clearTimeout(d),a(S),i(w)},p+=p.indexOf("?")===-1?"?":"&";var b=document.createElement("script");b.setAttribute("src",""+p+E+"="+w),l.charset&&b.setAttribute("charset",l.charset),l.nonce&&b.setAttribute("nonce",l.nonce),l.referrerPolicy&&b.setAttribute("referrerPolicy",l.referrerPolicy),l.crossorigin&&b.setAttribute("crossorigin","true"),b.id=S,document.getElementsByTagName("head")[0].appendChild(b),d=setTimeout(function(){h(new Error("JSONP request to "+u+" timed out")),i(w),a(S),window[w]=function(){i(w)}},y),b.onerror=function(){h(new Error("JSONP request to "+u+" failed")),i(w),a(S),d&&clearTimeout(d)}})}r.exports=f})})(V,V.exports)),V.exports}var Fr=Ur();const Nr=Ft(Fr);function jr(t){if(J){const{protocol:e,host:n,pathname:r}=location;return`${e}//${n}${t?r:""}`}else return null}function kr(t=""){const e=t.match(O.rURL);return e?e[0]:""}function Nt(t){const e=[];for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push([n,encodeURIComponent(t[n])].join("="));return e.join("&")}function Ae(t,e,n){const r={};t=(t||location.search).replace(/^[^]*\?/,""),e=e||"&",n=n||"=";let o;const s=new RegExp("(?:^|\\"+e+")([^\\"+n+"\\"+e+"]+)(?:\\"+n+"([^\\"+e+"]*))?","g");for(;(o=s.exec(t))!==null;)o[1]!==t&&(r[decodeURIComponent(o[1])]=decodeURIComponent(o[2]||""));return r}function jt(t,e){e=typeof e=="string"?Ae(e):e;const n=t.split("?")[0],r=Ae(t),o=Object.assign({},r,e),s=Nt(o);return s?[n,s].join("?"):t}const Dr=Object.freeze(Object.defineProperty({__proto__:null,append:jt,getCurrentHost:jr,getHost:kr,parse:Ae,stringify:Nt},Symbol.toStringTag,{value:"Module"}));async function Br(t,e={}){const{query:n={}}=e;t.includes("${")&&(t=O.template(t)(n||{}));const r=jt(t,n);return await(await Nr(r,e)).json()}var be,rt;function vr(){if(rt)return be;rt=1,be=function(o,s,i){var a=document.head||document.getElementsByTagName("head")[0],f=document.createElement("script");typeof s=="function"&&(i=s,s={}),s=s||{},i=i||function(){},f.type=s.type||"text/javascript",f.charset=s.charset||"utf8",f.async="async"in s?!!s.async:!0,f.src=o,s.attrs&&t(f,s.attrs),s.text&&(f.text=""+s.text);var u="onload"in f?e:n;u(f,i),f.onload||e(f,i),a.appendChild(f)};function t(r,o){for(var s in o)r.setAttribute(s,o[s])}function e(r,o){r.onload=function(){this.onerror=this.onload=null,o(null,r)},r.onerror=function(){this.onerror=this.onload=null,o(new Error("Failed to load "+this.src),r)}}function n(r,o){r.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,o(null,r))}}return be}var Ir=vr();const Mr=Ft(Ir);function qr(t,e={}){return new Promise((n,r)=>{const{library:o}=e;Mr(t,e,(s,i)=>{s?r(s):n(o?window[o]:void 0)})})}const ot={debug:-1,log:0,info:0,warn:1,error:2},Hr=function(t,e,n,r){return function(...o){if(e&&ot[e]<=ot[t]&&console[t].apply&&(r==="*"||n.startsWith(r)))return console[t].apply(console,Jr(o,n))}};function Jr(t,e){return e!=="*"&&(typeof t[0]=="string"?t[0]=`[${e}] ${t[0]}`:t=["["+e+"]"].concat(t)),t}function $r(t,e){if(!t)return{targetLevel:e.level,targetBizName:e.bizName};if(~t.indexOf(":")){const n=t.split(":");return{targetLevel:n[0],targetBizName:n[1]}}return{targetLevel:t,targetBizName:"*"}}const Wr={level:"warn",bizName:"*"};class kt{constructor(e){_(this,"config");_(this,"options");this.options={...Wr,...e};const n=typeof location<"u"?location:{},r=(/__(?:logConf|logLevel)__=([^#/&]*)/.exec(n.href)||[])[1];this.config=$r(r,e)}_log(e){const{targetLevel:n,targetBizName:r}=this.config,{bizName:o}=this.options;return Hr(e,n,o,r)}debug(...e){return this._log("debug")(...e)}log(...e){return this._log("log")(...e)}info(...e){return this._log("info")(...e)}warn(...e){return this._log("warn")(...e)}error(...e){return this._log("error")(...e)}}function Dt(t){return new kt(t)}const zr=Dt({level:"log",bizName:"VTJ"});/*! js-cookie v3.0.5 | MIT */function re(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}var Vr={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Ce(t,e){function n(o,s,i){if(!(typeof document>"u")){i=re({},e,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var f in i)i[f]&&(a+="; "+f,i[f]!==!0&&(a+="="+i[f].split(";")[0]));return document.cookie=o+"="+t.write(s,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var s=document.cookie?document.cookie.split("; "):[],i={},a=0;a<s.length;a++){var f=s[a].split("="),u=f.slice(1).join("=");try{var l=decodeURIComponent(f[0]);if(i[l]=t.read(u,l),o===l)break}catch{}}return o?i[o]:i}}return Object.create({set:n,get:r,remove:function(o,s){n(o,"",re({},s,{expires:-1}))},withAttributes:function(o){return Ce(this.converter,re({},this.attributes,o))},withConverter:function(o){return Ce(re({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Fe=Ce(Vr,{path:"/"});function Kr(t,e,n){Fe.set(t,e,n)}function Xr(t){return Fe.get(t)}function Qr(t,e){Fe.remove(t,e)}const Gr=Object.freeze(Object.defineProperty({__proto__:null,get:Xr,remove:Qr,set:Kr},Symbol.toStringTag,{value:"Module"}));function Yr(t,e=""){const n=document.createElement("a");n.download=e,n.href=t,n.target="_blank",n.click()}function Ne(t,e="",n){const r=new Blob([t],{type:n}),o=document.createElement("a");o.download=e,o.style.display="none",o.href=URL.createObjectURL(r),o.click(),URL.revokeObjectURL(o.href)}async function Zr(t,e="",n){return fetch(t,{credentials:"include"}).then(async r=>{const o=await r.blob();return Ne(o,e,n),o})}function eo(t,e=""){const n=JSON.stringify(t);Ne(n,e,"application/json")}function to(){const t=navigator.userAgent;let e="Unknown",n="Unknown",r="Unknown",o="Unknown",s=!1;if(/Windows NT/i.test(t)){e="Windows";const a={"12.0":"12","11.0":"11","10.0":"10","6.3":"8.1","6.2":"8","6.1":"7","6.0":"Vista","5.2":"XP 64-bit","5.1":"XP"},f=t.match(/Windows NT (\d+\.\d+)/);f&&(n=a[f[1]]||f[1])}else if(/Mac OS X/i.test(t)){e="Mac OS";const a=t.match(/Mac OS X (\d+[._]\d+[._]?\d*)/);a&&(n=a[1].replace(/_/g,"."))}else if(/(iPhone|iPad|iPod)/i.test(t)){e="iOS";const a=t.match(/OS (\d+[_\.]\d+[_\.]?\d*)/);a&&(n=a[1].replace(/_/g,"."))}else if(/Android/i.test(t)){e="Android";const a=t.match(/Android (\d+\.\d+)/);a&&(n=a[1])}else/Linux/i.test(t)&&(e="Linux");const i=t.match(/(Edge|Edg|Edga|EdgA)\/(\d+)/i);if(i)r="Microsoft Edge",o=i[2];else{const a=t.match(/Firefox\/(\d+)/i);if(a)r="Firefox",o=a[1];else{const f=t.match(/(Opera|OPR)\/(\d+)/i);if(f)r="Opera",o=f[2];else{const u=t.match(/Chrome\/(\d+)/i);if(u)r="Chrome",o=u[1];else{const l=t.match(/Version\/(\d+\.\d+)/i);if(l&&/Safari/i.test(t))r="Safari",o=l[1];else{const p=t.match(/(MSIE |Trident.*rv:)(\d+)/i);p&&(r="Internet Explorer",o=p[2])}}}}}return s=/(iPhone|iPod|iPad|Android|Windows Phone|Mobile)/i.test(t)||["iOS","Android"].includes(e),/(iPad|Tablet|Android(?!.*Mobile))/i.test(t)&&(s=!0),{os:e,osVersion:n,browser:r,browserVersion:o,isMobile:s}}exports.LOCAL_REQUEST_ID=Te;exports.Logger=kt;exports.Request=_t;exports.Storage=Ut;exports.VTJ_UTILS_VERSION=Mt;exports.axios=R;exports.blobToFile=Cr;exports.cAF=_r;exports.cookie=Gr;exports.createApi=Lt;exports.createApis=Rr;exports.createRequest=Pt;exports.dataURLtoBlob=Ar;exports.downloadBlob=Ne;exports.downloadJson=eo;exports.downloadRemoteFile=Zr;exports.downloadUrl=Yr;exports.fileToBase64=Or;exports.formDataToJson=Tr;exports.getClientInfo=to;exports.getLogger=Dt;exports.isClient=J;exports.jsonp=Br;exports.loadScript=qr;exports.logger=zr;exports.rAF=xr;exports.request=Ue;exports.storage=Pr;exports.url=Dr;exports.useApi=Sr;Object.keys(O).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>O[t]})});
|
|
11
|
+
`):" "+Ze(i[0]):"as no adapter specified";throw new g("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const Tt={getAdapter:dr,adapters:Le};function we(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Y(null,t)}function et(t){return we(t),t.headers=x.from(t.headers),t.data=ye.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Tt.getAdapter(t.adapter||G.adapter,t)(t).then(function(r){return we(t),r.data=ye.call(t,t.transformResponse,r),r.headers=x.from(r.headers),r},function(r){return bt(r)||(we(t),r&&r.response&&(r.response.data=ye.call(t,t.transformResponse,r.response),r.response.headers=x.from(r.response.headers))),Promise.reject(r)})}const At="1.13.4",de={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{de[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const tt={};de.transitional=function(e,n,r){function o(s,i){return"[Axios v"+At+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(e===!1)throw new g(o(i," has been removed"+(n?" in "+n:"")),g.ERR_DEPRECATED);return n&&!tt[i]&&(tt[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,i,a):!0}};de.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function pr(t,e,n){if(typeof t!="object")throw new g("options must be an object",g.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const s=r[o],i=e[s];if(i){const a=t[s],f=a===void 0||i(a,s,t);if(f!==!0)throw new g("option "+s+" must be "+f,g.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new g("Unknown option "+s,g.ERR_BAD_OPTION)}}const ie={assertOptions:pr,validators:de},N=ie.validators;let I=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Je,response:new Je}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
12
|
+
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=M(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&ie.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),o!=null&&(c.isFunction(o)?n.paramsSerializer={serialize:o}:ie.assertOptions(o,{encode:N.function,serialize:N.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ie.assertOptions(n,{baseUrl:N.spelling("baseURL"),withXsrfToken:N.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&c.merge(s.common,s[n.method]);s&&c.forEach(["delete","get","head","post","put","patch","common"],d=>{delete s[d]}),n.headers=x.concat(i,s);const a=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let l,p=0,y;if(!f){const d=[et.bind(this),void 0];for(d.unshift(...a),d.push(...u),y=d.length,l=Promise.resolve(n);p<y;)l=l.then(d[p++],d[p++]);return l}y=a.length;let E=n;for(;p<y;){const d=a[p++],m=a[p++];try{E=d(E)}catch(h){m.call(this,h);break}}try{l=et.call(this,E)}catch(d){return Promise.reject(d)}for(p=0,y=u.length;p<y;)l=l.then(u[p++],u[p++]);return l}getUri(e){e=M(this.defaults,e);const n=Rt(e.baseURL,e.url,e.allowAbsoluteUrls);return gt(n,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){I.prototype[e]=function(n,r){return this.request(M(r||{},{method:e,url:n,data:(r||{}).data}))}});c.forEach(["post","put","patch"],function(e){function n(r){return function(s,i,a){return this.request(M(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}I.prototype[e]=n(),I.prototype[e+"Form"]=n(!0)});let hr=class Ct{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},e(function(s,i,a){r.reason||(r.reason=new Y(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Ct(function(o){e=o}),cancel:e}}};function mr(t){return function(n){return t.apply(null,n)}}function gr(t){return c.isObject(t)&&t.isAxiosError===!0}const Oe={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Oe).forEach(([t,e])=>{Oe[e]=t});function xt(t){const e=new I(t),n=st(I.prototype.request,e);return c.extend(n,I.prototype,e,{allOwnKeys:!0}),c.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return xt(M(t,o))},n}const R=xt(G);R.Axios=I;R.CanceledError=Y;R.CancelToken=hr;R.isCancel=bt;R.VERSION=At;R.toFormData=fe;R.AxiosError=g;R.Cancel=R.CanceledError;R.all=function(e){return Promise.all(e)};R.spread=mr;R.isAxiosError=gr;R.mergeConfig=M;R.AxiosHeaders=x;R.formToJSON=t=>wt(c.isHTMLForm(t)?new FormData(t):t);R.getAdapter=Tt.getAdapter;R.HttpStatusCode=Oe;R.default=R;const{Axios:io,AxiosError:ao,CanceledError:co,isCancel:lo,CancelToken:uo,VERSION:fo,all:po,Cancel:ho,isAxiosError:mo,spread:go,toFormData:yo,AxiosHeaders:wo,HttpStatusCode:bo,formToJSON:Eo,getAdapter:Ro,mergeConfig:So}=R,yr={form:"application/x-www-form-urlencoded",json:"application/json",data:"multipart/form-data"},wr=["put","post","patch"],Te="Local-Request-Id",br=100,Er=300;class _t{constructor(e={}){_(this,"axios");_(this,"settings");_(this,"records",{});_(this,"isLoading",!1);_(this,"stopSkipWarn");_(this,"showLoading");_(this,"showError");this.settings=Object.assign({type:"form"},e.settings||{});const n=O.omit(e,["settings","query"]);this.axios=R.create(O.merge({headers:{"Content-Type":"application/x-www-form-urlencoded"},timeout:120*1e3},n)),this.setupSkipWarn(this.settings),this.showLoading=O.debounce(this.openLoading.bind(this),br),this.showError=O.throttle(this._showError.bind(this),Er,{leading:!0,trailing:!1})}setConfig(e={}){this.settings=O.merge(this.settings,e.settings||{});const n=O.omit(e,["settings","query"]);this.axios.defaults=O.merge(this.axios.defaults,n),this.setupSkipWarn(this.settings)}cancel(e,n="请求已取消"){if(e){const r=this.records[e];if(!r)return;r.source.cancel(n)}else for(const r of Object.values(this.records))r.source.cancel(n)}createHeaders(e,n,r){const o=n.injectHeaders?typeof n.headers=="function"?n.headers(e,r,n):n.headers||{}:{},s={"Content-Type":yr[n.type||"form"],...r.headers,...o};return n.skipWarn&&(s[Te]=e),s}isJsonType(e){return Object.entries(e).some(([n,r])=>n.toLowerCase()==="content-type"&&String(r).includes("application/json"))}toFormData(e,n="data"){if(e instanceof FormData||e instanceof URLSearchParams)return e;const r=n==="data"?new FormData:new URLSearchParams;return Object.entries(e).forEach(([o,s])=>{r.append(o,s)}),r}createSendData(e,n,r,o,s={}){const{type:i,skipWarn:a}=e,{name:f="skipWarn"}=a||{};let{data:u,params:l={},method:p="get"}=n;const y=o?{[f]:!0}:{};return wr.includes(p.toLowerCase())?(u=Object.assign(u||{},y),u=i!=="json"||!this.isJsonType(r)?this.toFormData(u,i):u,l={...s}):i==="form"?l={...u||{},...s,...y}:(u&&(i!=="json"||!this.isJsonType(r))&&(u=this.toFormData(u,i)),l={...s,...y}),{data:u,params:l}}createUrl(e){let{url:n,params:r}=e;if(n){let o=O.isUrl(n)?new URL(n).origin:"";const s=o?n.replace(o,""):n;try{const i=O.pathToRegexpCompile(s,{encode:encodeURIComponent});return o+i(r||{})}catch{console.warn("createUrl","pathToRegexpCompile error",n)}}return n}openLoading(e){const{loading:n,showLoading:r}=e;n&&r&&Object.keys(this.records).length>0&&(this.isLoading=!0,r())}closeLoading(e){const{loading:n,hideLoading:r}=e;if(!n)return;this.isLoading=!1;const o=Object.keys(this.records);r&&o.length===0&&(this.isLoading=!1,r())}_showError(e,n){const{failMessage:r,showError:o}=e;if(r&&o){const s=n?.response?.data,i=s?.message||s?.msg||n?.message||n?.msg||"未知错误";o(i,n)}}validResponse(e,n){const{validSuccess:r,validate:o}=e;return r&&o?!!o(n):!0}isSkipWarnResponse(e){return!!e.promise}send(e={},n=!1){const r=O.merge({},this.settings,e.settings||{}),o=e.query||{},s=O.omit(e,["settings","query"]),i=O.uuid(!1),a=R.CancelToken.source();this.records[i]={settings:r,config:s,source:a};const f=this.createUrl(s),u=this.createHeaders(i,r,s),{data:l,params:p}=this.createSendData(r,s,u,n,o);return this.showLoading(r),new Promise((y,E)=>{this.axios({cancelToken:a.token,...s,url:f,headers:u,data:l,params:p}).then(d=>this.isSkipWarnResponse(d)?y(d.promise):this.validResponse(r,d)?y(r.originResponse?d:d.data?.data):(this.showError(r,d.data),E(d.data))).catch(d=>(this.showError(r,d),E(d))).finally(()=>{delete this.records[i],this.closeLoading(r)})})}useResponse(e,n){const{response:r}=this.axios.interceptors,o=r.use(e,n);return()=>r.eject(o)}useRequest(e,n){const{request:r}=this.axios.interceptors,o=r.use(e,n);return()=>r.eject(o)}setupSkipWarn(e){if(this.stopSkipWarn&&(this.stopSkipWarn(),this.stopSkipWarn=void 0),!e.skipWarn)return;const{code:n,executor:r,callback:o,complete:s}=e.skipWarn;this.stopSkipWarn=this.useResponse(i=>{const f=(i.config.headers||{})[Te],u=this.records[f];if(!u)return i;const{data:l}=i;if(!l||typeof l!="object")return i;if(l?.code===n){o&&o(i);const p=new Promise(r).then(()=>this.send({...u.config,settings:u.settings},!0));p.catch(y=>y).finally(()=>{s&&s()}),i.promise=p}return i})}}function Pt(t={}){const e=new _t(t),n=e.send.bind(e),r=e.cancel.bind(e),o=e.setConfig.bind(e),s=e.useRequest.bind(e),i=e.useResponse.bind(e);return Object.assign(n,{...e,instance:e,send:n,cancel:r,setConfig:o,useRequest:s,useResponse:i})}const Ue=Pt({settings:{injectHeaders:!0,loading:!0,originResponse:!0}});function Lt(t,e=Ue){const n=typeof t=="string"?{url:t}:t;return(r,o)=>e.send(O.merge({},n,o||{},{data:r}))}function Rr(t,e=Ue){const n={};for(const[r,o]of Object.entries(t))n[r]=Lt(o,e);return n}function Sr(t,e){const n=me.ref(null),r=me.ref(),o=me.ref(!0),s=()=>{o.value=!0,r.value=void 0,(typeof t=="function"?t():t).then(a=>{n.value=e?e(a):a}).catch(a=>{r.value=a}).finally(()=>{o.value=!1})};return s(),{data:n,error:r,loading:o,reload:s}}const J=typeof window<"u",Or=t=>new Promise((e,n)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>{e(r.result)},r.onerror=o=>{n(o)}});function Tr(t){const e={};return t?(t.forEach((n,r)=>{e[r]=typeof n=="string"?decodeURIComponent(n):n}),e):{}}function Ar(t){const e=t.split(","),n=e[0].match(/:(.*?);/)?.[1],r=atob(e[1]);let o=r.length;const s=new Uint8Array(o);for(;o--;)s[o]=r.charCodeAt(o);return new Blob([s],{type:n})}function Cr(t,e){const n=t;return n.lastModified=Date.now(),n.lastModifiedDate=new Date,n.name=e,n}const xr=t=>J?window.requestAnimationFrame(t):setTimeout(t,16),_r=t=>J?window.cancelAnimationFrame(t):clearTimeout(t);class Ut{constructor(e={}){_(this,"options",{type:"cache",expired:0,prefix:"__VTJ_"});_(this,"caches",{});_(this,"types");this.types={local:J?window.localStorage:this.caches,session:J?window.sessionStorage:this.caches,cache:this.caches},this.config(e)}config(e={}){this.options=Object.assign(this.options,e)}save(e,n,r={}){const{type:o,expired:s,prefix:i}={...this.options,...r},a=Date.now(),f=i+e,u=this.types[o]||this.caches,l={value:n,timestamp:a,expired:s};u===this.caches?u[f]=l:u.setItem(f,JSON.stringify(l))}get(e,n={}){const{type:r,prefix:o}={...this.options,...n},s=o+e,i=this.types[r]||this.caches;let a;if(i===this.caches)a=i[s];else{const y=i.getItem(s);if(y)try{a=JSON.parse(y)}catch(E){console.warn("[Storage] JSON.parse",E)}}if(!a)return null;const{value:f,timestamp:u,expired:l}=a;return l>0&&u+l<Date.now()?(this.remove(e,n),null):f}remove(e,n={}){const{type:r,prefix:o}={...this.options,...n},s=this.types[r]||this.caches,i=o+e;s===this.caches?delete s[i]:s.removeItem(i)}clear(e={}){const{type:n}={...this.options,...e},r=this.types[n]||this.caches;r===this.caches?this.caches={}:r.clear()}}const Pr=new Ut;function Ft(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var V={exports:{}},Lr=V.exports,nt;function Ur(){return nt||(nt=1,(function(t,e){(function(n,r){r(e,t)})(Lr,function(n,r){var o={timeout:5e3,jsonpCallback:"callback"};function s(){return"jsonp_"+Date.now()+"_"+Math.ceil(Math.random()*1e5)}function i(u){try{delete window[u]}catch{window[u]=void 0}}function a(u){var l=document.getElementById(u);l&&document.getElementsByTagName("head")[0].removeChild(l)}function f(u){var l=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],p=u,y=l.timeout||o.timeout,E=l.jsonpCallback||o.jsonpCallback,d=void 0;return new Promise(function(m,h){var w=l.jsonpCallbackFunction||s(),S=E+"_"+w;window[w]=function(T){m({ok:!0,json:function(){return Promise.resolve(T)}}),d&&clearTimeout(d),a(S),i(w)},p+=p.indexOf("?")===-1?"?":"&";var b=document.createElement("script");b.setAttribute("src",""+p+E+"="+w),l.charset&&b.setAttribute("charset",l.charset),l.nonce&&b.setAttribute("nonce",l.nonce),l.referrerPolicy&&b.setAttribute("referrerPolicy",l.referrerPolicy),l.crossorigin&&b.setAttribute("crossorigin","true"),b.id=S,document.getElementsByTagName("head")[0].appendChild(b),d=setTimeout(function(){h(new Error("JSONP request to "+u+" timed out")),i(w),a(S),window[w]=function(){i(w)}},y),b.onerror=function(){h(new Error("JSONP request to "+u+" failed")),i(w),a(S),d&&clearTimeout(d)}})}r.exports=f})})(V,V.exports)),V.exports}var Fr=Ur();const Nr=Ft(Fr);function jr(t){if(J){const{protocol:e,host:n,pathname:r}=location;return`${e}//${n}${t?r:""}`}else return null}function kr(t=""){const e=t.match(O.rURL);return e?e[0]:""}function Nt(t){const e=[];for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push([n,encodeURIComponent(t[n])].join("="));return e.join("&")}function Ae(t,e,n){const r={};t=(t||location.search).replace(/^[^]*\?/,""),e=e||"&",n=n||"=";let o;const s=new RegExp("(?:^|\\"+e+")([^\\"+n+"\\"+e+"]+)(?:\\"+n+"([^\\"+e+"]*))?","g");for(;(o=s.exec(t))!==null;)o[1]!==t&&(r[decodeURIComponent(o[1])]=decodeURIComponent(o[2]||""));return r}function jt(t,e){e=typeof e=="string"?Ae(e):e;const n=t.split("?")[0],r=Ae(t),o=Object.assign({},r,e),s=Nt(o);return s?[n,s].join("?"):t}const Dr=Object.freeze(Object.defineProperty({__proto__:null,append:jt,getCurrentHost:jr,getHost:kr,parse:Ae,stringify:Nt},Symbol.toStringTag,{value:"Module"}));async function Br(t,e={}){const{query:n={}}=e;t.includes("${")&&(t=O.template(t)(n||{}));const r=jt(t,n);return await(await Nr(r,e)).json()}var be,rt;function vr(){if(rt)return be;rt=1,be=function(o,s,i){var a=document.head||document.getElementsByTagName("head")[0],f=document.createElement("script");typeof s=="function"&&(i=s,s={}),s=s||{},i=i||function(){},f.type=s.type||"text/javascript",f.charset=s.charset||"utf8",f.async="async"in s?!!s.async:!0,f.src=o,s.attrs&&t(f,s.attrs),s.text&&(f.text=""+s.text);var u="onload"in f?e:n;u(f,i),f.onload||e(f,i),a.appendChild(f)};function t(r,o){for(var s in o)r.setAttribute(s,o[s])}function e(r,o){r.onload=function(){this.onerror=this.onload=null,o(null,r)},r.onerror=function(){this.onerror=this.onload=null,o(new Error("Failed to load "+this.src),r)}}function n(r,o){r.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,o(null,r))}}return be}var Ir=vr();const Mr=Ft(Ir);function qr(t,e={}){return new Promise((n,r)=>{const{library:o}=e;Mr(t,e,(s,i)=>{s?r(s):n(o?window[o]:void 0)})})}const ot={debug:-1,log:0,info:0,warn:1,error:2},Hr=function(t,e,n,r){return function(...o){if(e&&ot[e]<=ot[t]&&console[t].apply&&(r==="*"||n.startsWith(r)))return console[t].apply(console,Jr(o,n))}};function Jr(t,e){return e!=="*"&&(typeof t[0]=="string"?t[0]=`[${e}] ${t[0]}`:t=["["+e+"]"].concat(t)),t}function $r(t,e){if(!t)return{targetLevel:e.level,targetBizName:e.bizName};if(~t.indexOf(":")){const n=t.split(":");return{targetLevel:n[0],targetBizName:n[1]}}return{targetLevel:t,targetBizName:"*"}}const Wr={level:"warn",bizName:"*"};class kt{constructor(e){_(this,"config");_(this,"options");this.options={...Wr,...e};const n=typeof location<"u"?location:{},r=(/__(?:logConf|logLevel)__=([^#/&]*)/.exec(n.href)||[])[1];this.config=$r(r,e)}_log(e){const{targetLevel:n,targetBizName:r}=this.config,{bizName:o}=this.options;return Hr(e,n,o,r)}debug(...e){return this._log("debug")(...e)}log(...e){return this._log("log")(...e)}info(...e){return this._log("info")(...e)}warn(...e){return this._log("warn")(...e)}error(...e){return this._log("error")(...e)}}function Dt(t){return new kt(t)}const zr=Dt({level:"log",bizName:"VTJ"});/*! js-cookie v3.0.5 | MIT */function re(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}var Vr={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Ce(t,e){function n(o,s,i){if(!(typeof document>"u")){i=re({},e,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var f in i)i[f]&&(a+="; "+f,i[f]!==!0&&(a+="="+i[f].split(";")[0]));return document.cookie=o+"="+t.write(s,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var s=document.cookie?document.cookie.split("; "):[],i={},a=0;a<s.length;a++){var f=s[a].split("="),u=f.slice(1).join("=");try{var l=decodeURIComponent(f[0]);if(i[l]=t.read(u,l),o===l)break}catch{}}return o?i[o]:i}}return Object.create({set:n,get:r,remove:function(o,s){n(o,"",re({},s,{expires:-1}))},withAttributes:function(o){return Ce(this.converter,re({},this.attributes,o))},withConverter:function(o){return Ce(re({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Fe=Ce(Vr,{path:"/"});function Kr(t,e,n){Fe.set(t,e,n)}function Xr(t){return Fe.get(t)}function Qr(t,e){Fe.remove(t,e)}const Gr=Object.freeze(Object.defineProperty({__proto__:null,get:Xr,remove:Qr,set:Kr},Symbol.toStringTag,{value:"Module"}));function Yr(t,e=""){const n=document.createElement("a");n.download=e,n.href=t,n.target="_blank",n.click()}function Ne(t,e="",n){const r=new Blob([t],{type:n}),o=document.createElement("a");o.download=e,o.style.display="none",o.href=URL.createObjectURL(r),o.click(),URL.revokeObjectURL(o.href)}async function Zr(t,e="",n){return fetch(t,{credentials:"include"}).then(async r=>{const o=await r.blob();return Ne(o,e,n),o})}function eo(t,e=""){const n=JSON.stringify(t);Ne(n,e,"application/json")}function to(){const t=navigator.userAgent;let e="Unknown",n="Unknown",r="Unknown",o="Unknown",s=!1;if(/Windows NT/i.test(t)){e="Windows";const a={"12.0":"12","11.0":"11","10.0":"10","6.3":"8.1","6.2":"8","6.1":"7","6.0":"Vista","5.2":"XP 64-bit","5.1":"XP"},f=t.match(/Windows NT (\d+\.\d+)/);f&&(n=a[f[1]]||f[1])}else if(/Mac OS X/i.test(t)){e="Mac OS";const a=t.match(/Mac OS X (\d+[._]\d+[._]?\d*)/);a&&(n=a[1].replace(/_/g,"."))}else if(/(iPhone|iPad|iPod)/i.test(t)){e="iOS";const a=t.match(/OS (\d+[_\.]\d+[_\.]?\d*)/);a&&(n=a[1].replace(/_/g,"."))}else if(/Android/i.test(t)){e="Android";const a=t.match(/Android (\d+\.\d+)/);a&&(n=a[1])}else/Linux/i.test(t)&&(e="Linux");const i=t.match(/(Edge|Edg|Edga|EdgA)\/(\d+)/i);if(i)r="Microsoft Edge",o=i[2];else{const a=t.match(/Firefox\/(\d+)/i);if(a)r="Firefox",o=a[1];else{const f=t.match(/(Opera|OPR)\/(\d+)/i);if(f)r="Opera",o=f[2];else{const u=t.match(/Chrome\/(\d+)/i);if(u)r="Chrome",o=u[1];else{const l=t.match(/Version\/(\d+\.\d+)/i);if(l&&/Safari/i.test(t))r="Safari",o=l[1];else{const p=t.match(/(MSIE |Trident.*rv:)(\d+)/i);p&&(r="Internet Explorer",o=p[2])}}}}}return s=/(iPhone|iPod|iPad|Android|Windows Phone|Mobile)/i.test(t)||["iOS","Android"].includes(e),/(iPad|Tablet|Android(?!.*Mobile))/i.test(t)&&(s=!0),{os:e,osVersion:n,browser:r,browserVersion:o,isMobile:s}}exports.LOCAL_REQUEST_ID=Te;exports.Logger=kt;exports.Request=_t;exports.Storage=Ut;exports.VTJ_UTILS_VERSION=Mt;exports.axios=R;exports.blobToFile=Cr;exports.cAF=_r;exports.cookie=Gr;exports.createApi=Lt;exports.createApis=Rr;exports.createRequest=Pt;exports.dataURLtoBlob=Ar;exports.downloadBlob=Ne;exports.downloadJson=eo;exports.downloadRemoteFile=Zr;exports.downloadUrl=Yr;exports.fileToBase64=Or;exports.formDataToJson=Tr;exports.getClientInfo=to;exports.getLogger=Dt;exports.isClient=J;exports.jsonp=Br;exports.loadScript=qr;exports.logger=zr;exports.rAF=xr;exports.request=Ue;exports.storage=Pr;exports.url=Dr;exports.useApi=Sr;Object.keys(O).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>O[t]})});
|