mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2025-12-07 21:13:11 +00:00
7 lines
45 KiB
JavaScript
7 lines
45 KiB
JavaScript
import{k as Ee,cB as pn}from"./index-C8fpJ_Uz.js";const Ce=(e,t)=>t.some(n=>e instanceof n);let Qe,Ye;function mn(){return Qe||(Qe=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function yn(){return Ye||(Ye=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Be=new WeakMap,Se=new WeakMap,de=new WeakMap;function bn(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{n(H(e.result)),s()},o=()=>{r(e.error),s()};e.addEventListener("success",i),e.addEventListener("error",o)});return de.set(t,e),t}function wn(e){if(Be.has(e))return;const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{n(),s()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});Be.set(e,t)}let Pe={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Be.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return H(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function At(e){Pe=e(Pe)}function gn(e){return yn().includes(e)?function(...t){return e.apply(De(this),t),H(this.request)}:function(...t){return H(e.apply(De(this),t))}}function En(e){return typeof e=="function"?gn(e):(e instanceof IDBTransaction&&wn(e),Ce(e,mn())?new Proxy(e,Pe):e)}function H(e){if(e instanceof IDBRequest)return bn(e);if(Se.has(e))return Se.get(e);const t=En(e);return t!==e&&(Se.set(e,t),de.set(t,e)),t}const De=e=>de.get(e);function Ss(e,t,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),c=H(o);return r&&o.addEventListener("upgradeneeded",f=>{r(H(o.result),f.oldVersion,f.newVersion,H(o.transaction),f)}),n&&o.addEventListener("blocked",f=>n(f.oldVersion,f.newVersion,f)),c.then(f=>{i&&f.addEventListener("close",()=>i()),s&&f.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),c}const Sn=["get","getKey","getAll","getAllKeys","count"],xn=["put","add","delete","clear"],xe=new Map;function et(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(xe.get(t))return xe.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=xn.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||Sn.includes(n)))return;const i=async function(o,...c){const f=this.transaction(o,s?"readwrite":"readonly");let u=f.store;return r&&(u=u.index(c.shift())),(await Promise.all([u[n](...c),s&&f.done]))[0]};return xe.set(t,i),i}At(e=>({...e,get:(t,n,r)=>et(t,n)||e.get(t,n,r),has:(t,n)=>!!et(t,n)||e.has(t,n)}));const Rn=["continue","continuePrimaryKey","advance"],tt={},Ne=new WeakMap,Ot=new WeakMap,An={get(e,t){if(!Rn.includes(t))return e[t];let n=tt[t];return n||(n=tt[t]=function(...r){Ne.set(this,Ot.get(this)[t](...r))}),n}};async function*On(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,An);for(Ot.set(n,t),de.set(n,De(t));t;)yield n,t=await(Ne.get(n)||t.continue()),Ne.delete(n)}function nt(e,t){return t===Symbol.asyncIterator&&Ce(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&Ce(e,[IDBIndex,IDBObjectStore])}At(e=>({...e,get(t,n,r){return nt(t,n)?On:e.get(t,n,r)},has(t,n){return nt(t,n)||e.has(t,n)}}));function Tt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Tn}=Object.prototype,{getPrototypeOf:Me}=Object,{iterator:he,toStringTag:Ct}=Symbol,pe=(e=>t=>{const n=Tn.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),N=e=>(e=e.toLowerCase(),t=>pe(t)===e),me=e=>t=>typeof t===e,{isArray:J}=Array,V=me("undefined");function Q(e){return e!==null&&!V(e)&&e.constructor!==null&&!V(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Bt=N("ArrayBuffer");function Cn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Bt(e.buffer),t}const Bn=me("string"),O=me("function"),Pt=me("number"),Y=e=>e!==null&&typeof e=="object",Pn=e=>e===!0||e===!1,ae=e=>{if(pe(e)!=="object")return!1;const t=Me(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ct in e)&&!(he in e)},Dn=e=>{if(!Y(e)||Q(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Nn=N("Date"),Fn=N("File"),_n=N("Blob"),Un=N("FileList"),Ln=e=>Y(e)&&O(e.pipe),kn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=pe(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},In=N("URLSearchParams"),[jn,Mn,Hn,qn]=["ReadableStream","Request","Response","Headers"].map(N),$n=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ee(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),J(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Q(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function Dt(e,t){if(Q(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const M=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Nt=e=>!V(e)&&e!==M;function Fe(){const{caseless:e,skipUndefined:t}=Nt(this)&&this||{},n={},r=(s,i)=>{const o=e&&Dt(n,i)||i;ae(n[o])&&ae(s)?n[o]=Fe(n[o],s):ae(s)?n[o]=Fe({},s):J(s)?n[o]=s.slice():(!t||!V(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&ee(arguments[s],r);return n}const vn=(e,t,n,{allOwnKeys:r}={})=>(ee(t,(s,i)=>{n&&O(s)?e[i]=Tt(s,n):e[i]=s},{allOwnKeys:r}),e),zn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Vn=(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)},Jn=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&Me(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Wn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Kn=e=>{if(!e)return null;if(J(e))return e;let t=e.length;if(!Pt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Xn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Me(Uint8Array)),Zn=(e,t)=>{const r=(e&&e[he]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Gn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Qn=N("HTMLFormElement"),Yn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),rt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),er=N("RegExp"),Ft=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ee(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},tr=e=>{Ft(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(O(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},nr=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return J(e)?r(e):r(String(e).split(t)),n},rr=()=>{},sr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function or(e){return!!(e&&O(e.append)&&e[Ct]==="FormData"&&e[he])}const ir=e=>{const t=new Array(10),n=(r,s)=>{if(Y(r)){if(t.indexOf(r)>=0)return;if(Q(r))return r;if(!("toJSON"in r)){t[s]=r;const i=J(r)?[]:{};return ee(r,(o,c)=>{const f=n(o,s+1);!V(f)&&(i[c]=f)}),t[s]=void 0,i}}return r};return n(e,0)},ar=N("AsyncFunction"),cr=e=>e&&(Y(e)||O(e))&&O(e.then)&&O(e.catch),_t=((e,t)=>e?setImmediate:t?((n,r)=>(M.addEventListener("message",({source:s,data:i})=>{s===M&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),M.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(M.postMessage)),ur=typeof queueMicrotask<"u"?queueMicrotask.bind(M):typeof process<"u"&&process.nextTick||_t,lr=e=>e!=null&&O(e[he]),a={isArray:J,isArrayBuffer:Bt,isBuffer:Q,isFormData:kn,isArrayBufferView:Cn,isString:Bn,isNumber:Pt,isBoolean:Pn,isObject:Y,isPlainObject:ae,isEmptyObject:Dn,isReadableStream:jn,isRequest:Mn,isResponse:Hn,isHeaders:qn,isUndefined:V,isDate:Nn,isFile:Fn,isBlob:_n,isRegExp:er,isFunction:O,isStream:Ln,isURLSearchParams:In,isTypedArray:Xn,isFileList:Un,forEach:ee,merge:Fe,extend:vn,trim:$n,stripBOM:zn,inherits:Vn,toFlatObject:Jn,kindOf:pe,kindOfTest:N,endsWith:Wn,toArray:Kn,forEachEntry:Zn,matchAll:Gn,isHTMLForm:Qn,hasOwnProperty:rt,hasOwnProp:rt,reduceDescriptors:Ft,freezeMethods:tr,toObjectSet:nr,toCamelCase:Yn,noop:rr,toFiniteNumber:sr,findKey:Dt,global:M,isContextDefined:Nt,isSpecCompliantForm:or,toJSONObject:ir,isAsyncFn:ar,isThenable:cr,setImmediate:_t,asap:ur,isIterable:lr};function y(e,t,n,r,s){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),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Ut=y.prototype,Lt={};["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=>{Lt[e]={value:e}});Object.defineProperties(y,Lt);Object.defineProperty(Ut,"isAxiosError",{value:!0});y.from=(e,t,n,r,s,i)=>{const o=Object.create(Ut);a.toFlatObject(e,o,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");const c=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return y.call(o,c,f,n,r,s),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const fr=null;function _e(e){return a.isPlainObject(e)||a.isArray(e)}function kt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function st(e,t,n){return e?e.concat(t).map(function(s,i){return s=kt(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function dr(e){return a.isArray(e)&&!e.some(_e)}const hr=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ye(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!a.isUndefined(h[m])});const r=n.metaTokens,s=n.visitor||l,i=n.dots,o=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!f&&a.isBlob(d))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,m,h){let g=d;if(d&&!h&&typeof d=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&dr(d)||(a.isFileList(d)||a.endsWith(m,"[]"))&&(g=a.toArray(d)))return m=kt(m),g.forEach(function(E,A){!(a.isUndefined(E)||E===null)&&t.append(o===!0?st([m],A,i):o===null?m:m+"[]",u(E))}),!1}return _e(d)?!0:(t.append(st(h,m,i),u(d)),!1)}const p=[],b=Object.assign(hr,{defaultVisitor:l,convertValue:u,isVisitable:_e});function x(d,m){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(d),a.forEach(d,function(g,C){(!(a.isUndefined(g)||g===null)&&s.call(t,g,a.isString(C)?C.trim():C,m,b))===!0&&x(g,m?m.concat(C):[C])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return x(e),t}function ot(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function He(e,t){this._pairs=[],e&&ye(e,this,t)}const It=He.prototype;It.append=function(t,n){this._pairs.push([t,n])};It.toString=function(t){const n=t?function(r){return t.call(this,r,ot)}:ot;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function pr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function jt(e,t,n){if(!t)return e;const r=n&&n.encode||pr;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new He(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class it{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Mt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mr=typeof URLSearchParams<"u"?URLSearchParams:He,yr=typeof FormData<"u"?FormData:null,br=typeof Blob<"u"?Blob:null,wr={isBrowser:!0,classes:{URLSearchParams:mr,FormData:yr,Blob:br},protocols:["http","https","file","blob","url","data"]},qe=typeof window<"u"&&typeof document<"u",Ue=typeof navigator=="object"&&navigator||void 0,gr=qe&&(!Ue||["ReactNative","NativeScript","NS"].indexOf(Ue.product)<0),Er=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Sr=qe&&window.location.href||"http://localhost",xr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:qe,hasStandardBrowserEnv:gr,hasStandardBrowserWebWorkerEnv:Er,navigator:Ue,origin:Sr},Symbol.toStringTag,{value:"Module"})),R={...xr,...wr};function Rr(e,t){return ye(e,new R.classes.URLSearchParams,{visitor:function(n,r,s,i){return R.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Ar(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Or(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function Ht(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),f=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,f?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=Or(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Ar(r),s,n,0)}),n}return null}function Tr(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const te={transitional:Mt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(Ht(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Rr(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ye(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Tr(t)):t}],transformResponse:[function(t){const n=this.transitional||te.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{te.headers[e]={}});const Cr=a.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"]),Br=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&Cr[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},at=Symbol("internals");function Z(e){return e&&String(e).trim().toLowerCase()}function ce(e){return e===!1||e==null?e:a.isArray(e)?e.map(ce):String(e)}function Pr(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}const Dr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Re(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Nr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Fr(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let T=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,f,u){const l=Z(f);if(!l)throw new Error("header name must be a non-empty string");const p=a.findKey(s,l);(!p||s[p]===void 0||u===!0||u===void 0&&s[p]!==!1)&&(s[p||f]=ce(c))}const o=(c,f)=>a.forEach(c,(u,l)=>i(u,l,f));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!Dr(t))o(Br(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(f=c[u])?a.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}o(c,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Z(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Pr(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Z(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Re(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=Z(o),o){const c=a.findKey(r,o);c&&(!n||Re(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||Re(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=ce(s),delete n[i];return}const c=t?Nr(i):String(i).trim();c!==i&&delete n[i],n[c]=ce(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[at]=this[at]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=Z(o);r[c]||(Fr(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};T.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(T.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(T);function Ae(e,t){const n=this||te,r=t||n,s=T.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function qt(e){return!!(e&&e.__CANCEL__)}function W(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(W,y,{__CANCEL__:!0});function $t(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function _r(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Ur(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[i];o||(o=u),n[s]=f,r[s]=u;let p=i,b=0;for(;p!==s;)b+=n[p++],p=p%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-o<t)return;const x=l&&u-l;return x?Math.round(b*1e3/x):void 0}}function Lr(e,t){let n=0,r=1e3/t,s,i;const o=(u,l=Date.now())=>{n=l,s=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const l=Date.now(),p=l-n;p>=r?o(u,l):(s=u,i||(i=setTimeout(()=>{i=null,o(s)},r-p)))},()=>s&&o(s)]}const fe=(e,t,n=3)=>{let r=0;const s=Ur(50,250);return Lr(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,f=o-r,u=s(f),l=o<=c;r=o;const p={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-o)/u:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},ct=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ut=e=>(...t)=>a.asap(()=>e(...t)),kr=R.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,R.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0,Ir=R.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function jr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Mr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function vt(e,t,n){let r=!jr(t);return e&&(r||n==!1)?Mr(e,t):t}const lt=e=>e instanceof T?{...e}:e;function $(e,t){t=t||{};const n={};function r(u,l,p,b){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:b},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,p,b){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,p,b)}else return r(u,l,p,b)}function i(u,l){if(!a.isUndefined(l))return r(void 0,l)}function o(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,p){if(p in t)return r(u,l);if(p in e)return r(void 0,u)}const f={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(u,l,p)=>s(lt(u),lt(l),p,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const p=f[l]||s,b=p(e[l],t[l],l);a.isUndefined(b)&&p!==c||(n[l]=b)}),n}const zt=e=>{const t=$({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;if(t.headers=o=T.from(o),t.url=jt(vt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const f=n.getHeaders(),u=["content-type","content-length"];Object.entries(f).forEach(([l,p])=>{u.includes(l.toLowerCase())&&o.set(l,p)})}}if(R.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&kr(t.url))){const f=s&&i&&Ir.read(i);f&&o.set(s,f)}return t},Hr=typeof XMLHttpRequest<"u",qr=Hr&&function(e){return new Promise(function(n,r){const s=zt(e);let i=s.data;const o=T.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,p,b,x,d;function m(){x&&x(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function g(){if(!h)return;const E=T.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),P={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:E,config:e,request:h};$t(function(B){n(B),m()},function(B){r(B),m()},P),h=null}"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(g)},h.onabort=function(){h&&(r(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(A){const P=A&&A.message?A.message:"Network Error",I=new y(P,y.ERR_NETWORK,e,h);I.event=A||null,r(I),h=null},h.ontimeout=function(){let A=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const P=s.transitional||Mt;s.timeoutErrorMessage&&(A=s.timeoutErrorMessage),r(new y(A,P.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},i===void 0&&o.setContentType(null),"setRequestHeader"in h&&a.forEach(o.toJSON(),function(A,P){h.setRequestHeader(P,A)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),u&&([b,d]=fe(u,!0),h.addEventListener("progress",b)),f&&h.upload&&([p,x]=fe(f),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",x)),(s.cancelToken||s.signal)&&(l=E=>{h&&(r(!E||E.type?new W(null,e,h):E),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const C=_r(s.url);if(C&&R.protocols.indexOf(C)===-1){r(new y("Unsupported protocol "+C+":",y.ERR_BAD_REQUEST,e));return}h.send(i||null)})},$r=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof y?l:new W(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,i(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},vr=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},zr=async function*(e,t){for await(const n of Vr(e))yield*vr(n,t)},Vr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},ft=(e,t,n,r)=>{const s=zr(e,t);let i=0,o,c=f=>{o||(o=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let p=l.byteLength;if(n){let b=i+=p;n(b)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},dt=64*1024,{isFunction:oe}=a,Jr=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:ht,TextEncoder:pt}=a.global,mt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Wr=e=>{e=a.merge.call({skipUndefined:!0},Jr,e);const{fetch:t,Request:n,Response:r}=e,s=t?oe(t):typeof fetch=="function",i=oe(n),o=oe(r);if(!s)return!1;const c=s&&oe(ht),f=s&&(typeof pt=="function"?(d=>m=>d.encode(m))(new pt):async d=>new Uint8Array(await new n(d).arrayBuffer())),u=i&&c&&mt(()=>{let d=!1;const m=new n(R.origin,{body:new ht,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!m}),l=o&&c&&mt(()=>a.isReadableStream(new r("").body)),p={stream:l&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!p[d]&&(p[d]=(m,h)=>{let g=m&&m[d];if(g)return g.call(m);throw new y(`Response type '${d}' is not supported`,y.ERR_NOT_SUPPORT,h)})});const b=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(R.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},x=async(d,m)=>{const h=a.toFiniteNumber(d.getContentLength());return h??b(m)};return async d=>{let{url:m,method:h,data:g,signal:C,cancelToken:E,timeout:A,onDownloadProgress:P,onUploadProgress:I,responseType:B,headers:we,withCredentials:ne="same-origin",fetchOptions:Je}=zt(d),We=t||fetch;B=B?(B+"").toLowerCase():"text";let re=$r([C,E&&E.toAbortSignal()],A),X=null;const j=re&&re.unsubscribe&&(()=>{re.unsubscribe()});let Ke;try{if(I&&u&&h!=="get"&&h!=="head"&&(Ke=await x(we,g))!==0){let k=new n(m,{method:"POST",body:g,duplex:"half"}),v;if(a.isFormData(g)&&(v=k.headers.get("content-type"))&&we.setContentType(v),k.body){const[ge,se]=ct(Ke,fe(ut(I)));g=ft(k.body,dt,ge,se)}}a.isString(ne)||(ne=ne?"include":"omit");const F=i&&"credentials"in n.prototype,Xe={...Je,signal:re,method:h.toUpperCase(),headers:we.normalize().toJSON(),body:g,duplex:"half",credentials:F?ne:void 0};X=i&&new n(m,Xe);let L=await(i?We(X,Je):We(m,Xe));const Ze=l&&(B==="stream"||B==="response");if(l&&(P||Ze&&j)){const k={};["status","statusText","headers"].forEach(Ge=>{k[Ge]=L[Ge]});const v=a.toFiniteNumber(L.headers.get("content-length")),[ge,se]=P&&ct(v,fe(ut(P),!0))||[];L=new r(ft(L.body,dt,ge,()=>{se&&se(),j&&j()}),k)}B=B||"text";let hn=await p[a.findKey(p,B)||"text"](L,d);return!Ze&&j&&j(),await new Promise((k,v)=>{$t(k,v,{data:hn,headers:T.from(L.headers),status:L.status,statusText:L.statusText,config:d,request:X})})}catch(F){throw j&&j(),F&&F.name==="TypeError"&&/Load failed|fetch/i.test(F.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,d,X),{cause:F.cause||F}):y.from(F,F&&F.code,d,X)}}},Kr=new Map,Vt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,c=o,f,u,l=Kr;for(;c--;)f=i[c],u=l.get(f),u===void 0&&l.set(f,u=c?new Map:Wr(t)),l=u;return u};Vt();const $e={http:fr,xhr:qr,fetch:{get:Vt}};a.forEach($e,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const yt=e=>`- ${e}`,Xr=e=>a.isFunction(e)||e===null||e===!1;function Zr(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let o=0;o<n;o++){r=e[o];let c;if(s=r,!Xr(r)&&(s=$e[(c=String(r)).toLowerCase()],s===void 0))throw new y(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([f,u])=>`adapter ${f} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=n?o.length>1?`since :
|
|
`+o.map(yt).join(`
|
|
`):" "+yt(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const Jt={getAdapter:Zr,adapters:$e};function Oe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new W(null,e)}function bt(e){return Oe(e),e.headers=T.from(e.headers),e.data=Ae.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Jt.getAdapter(e.adapter||te.adapter,e)(e).then(function(r){return Oe(e),r.data=Ae.call(e,e.transformResponse,r),r.headers=T.from(r.headers),r},function(r){return qt(r)||(Oe(e),r&&r.response&&(r.response.data=Ae.call(e,e.transformResponse,r.response),r.response.headers=T.from(r.response.headers))),Promise.reject(r)})}const Wt="1.13.2",be={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{be[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const wt={};be.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Wt+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new y(s(o," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!wt[o]&&(wt[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}};be.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Gr(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],f=c===void 0||o(c,i,e);if(f!==!0)throw new y("option "+i+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+i,y.ERR_BAD_OPTION)}}const ue={assertOptions:Gr,validators:be},_=ue.validators;let q=class{constructor(t){this.defaults=t||{},this.interceptors={request:new it,response:new it}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=$(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&ue.assertOptions(r,{silentJSONParsing:_.transitional(_.boolean),forcedJSONParsing:_.transitional(_.boolean),clarifyTimeoutError:_.transitional(_.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ue.assertOptions(s,{encode:_.function,serialize:_.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ue.assertOptions(n,{baseUrl:_.spelling("baseURL"),withXsrfToken:_.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=T.concat(o,i);const c=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let l,p=0,b;if(!f){const d=[bt.bind(this),void 0];for(d.unshift(...c),d.push(...u),b=d.length,l=Promise.resolve(n);p<b;)l=l.then(d[p++],d[p++]);return l}b=c.length;let x=n;for(;p<b;){const d=c[p++],m=c[p++];try{x=d(x)}catch(h){m.call(this,h);break}}try{l=bt.call(this,x)}catch(d){return Promise.reject(d)}for(p=0,b=u.length;p<b;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=$(this.defaults,t);const n=vt(t.baseURL,t.url,t.allowAbsoluteUrls);return jt(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){q.prototype[t]=function(n,r){return this.request($(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request($(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}q.prototype[t]=n(),q.prototype[t+"Form"]=n(!0)});let Qr=class Kt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new W(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Kt(function(s){t=s}),cancel:t}}};function Yr(e){return function(n){return e.apply(null,n)}}function es(e){return a.isObject(e)&&e.isAxiosError===!0}const Le={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(Le).forEach(([e,t])=>{Le[t]=e});function Xt(e){const t=new q(e),n=Tt(q.prototype.request,t);return a.extend(n,q.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Xt($(e,s))},n}const w=Xt(te);w.Axios=q;w.CanceledError=W;w.CancelToken=Qr;w.isCancel=qt;w.VERSION=Wt;w.toFormData=ye;w.AxiosError=y;w.Cancel=w.CanceledError;w.all=function(t){return Promise.all(t)};w.spread=Yr;w.isAxiosError=es;w.mergeConfig=$;w.AxiosHeaders=T;w.formToJSON=e=>Ht(a.isHTMLForm(e)?new FormData(e):e);w.getAdapter=Jt.getAdapter;w.HttpStatusCode=Le;w.default=w;const{Axios:As,AxiosError:Os,CanceledError:Ts,isCancel:Cs,CancelToken:Bs,VERSION:Ps,all:Ds,Cancel:Ns,isAxiosError:Fs,spread:_s,toFormData:Us,AxiosHeaders:Ls,HttpStatusCode:ks,formToJSON:Is,getAdapter:js,mergeConfig:Ms}=w;function ts(e,t){return"headers"in e&&typeof e.headers=="object"&&!Array.isArray(e.headers)?Te(e.headers):"getHeaders"in e&&typeof e.getHeaders=="function"?Te(e.getHeaders()):Te(e)}function Te(e,t){const n=U(e,"ratelimit");if(n)return os(n);let r;if(U(e,"ratelimit-remaining"))r="ratelimit-";else if(U(e,"x-ratelimit-remaining"))r="x-ratelimit-";else if(U(e,"x-rate-limit-remaining"))r="x-rate-limit-";else return;const s=D(U(e,`${r}limit`)),i=D(U(e,`${r}used`))||D(U(e,`${r}observed`)),o=D(U(e,`${r}remaining`));let c;const f=U(e,`${r}reset`);switch(void 0){case"date":{c=Zt(f??"");break}case"unix":{c=ke(f??"");break}case"seconds":{c=Gt(f??"");break}case"milliseconds":{c=is(f??"");break}default:if(f)c=cs(f);else{const l=U(e,"retry-after");l&&(c=ke(l))}}return{limit:Number.isNaN(s)?i+o:s,used:Number.isNaN(i)?s-o:i,remaining:o,reset:c}}var ns=/limit\s*=\s*(\d+)/i,rs=/remaining\s*=\s*(\d+)/i,ss=/reset\s*=\s*(\d+)/i;function os(e){var t,n,r;const s=D((t=ns.exec(e))==null?void 0:t[1]),i=D((n=rs.exec(e))==null?void 0:n[1]),o=D((r=ss.exec(e))==null?void 0:r[1]),c=ve(o);return{limit:s,used:s-i,remaining:i,reset:c}}function ve(e){const t=new Date;return t.setSeconds(t.getSeconds()+e),t}function D(e){return typeof e=="number"?e:Number.parseInt(e??"",10)}function U(e,t){var n;if("get"in e&&typeof e.get=="function")return(n=e.get(t))!=null?n:void 0;if(t in e&&typeof e[t]=="string")return e[t]}function Zt(e){return new Date(e)}function ke(e){const t=D(e);return new Date(t*1e3)}function Gt(e){const t=D(e);return ve(t)}function is(e){const t=D(e);return ve(t/1e3)}var as=/[a-z]/i;function cs(e){if(as.test(e))return Zt(e);const t=D(e);return t&&t>1e9?ke(t):Gt(t)}const Qt="3.7.8",us=Qt,K=typeof Buffer=="function",gt=typeof TextDecoder=="function"?new TextDecoder:void 0,Et=typeof TextEncoder=="function"?new TextEncoder:void 0,ls="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",G=Array.prototype.slice.call(ls),ie=(e=>{let t={};return e.forEach((n,r)=>t[n]=r),t})(G),fs=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,S=String.fromCharCode.bind(String),St=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Yt=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),en=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),tn=e=>{let t,n,r,s,i="";const o=e.length%3;for(let c=0;c<e.length;){if((n=e.charCodeAt(c++))>255||(r=e.charCodeAt(c++))>255||(s=e.charCodeAt(c++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|s,i+=G[t>>18&63]+G[t>>12&63]+G[t>>6&63]+G[t&63]}return o?i.slice(0,o-3)+"===".substring(o):i},ze=typeof btoa=="function"?e=>btoa(e):K?e=>Buffer.from(e,"binary").toString("base64"):tn,Ie=K?e=>Buffer.from(e).toString("base64"):e=>{let n=[];for(let r=0,s=e.length;r<s;r+=4096)n.push(S.apply(null,e.subarray(r,r+4096)));return ze(n.join(""))},le=(e,t=!1)=>t?Yt(Ie(e)):Ie(e),ds=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?S(192|t>>>6)+S(128|t&63):S(224|t>>>12&15)+S(128|t>>>6&63)+S(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return S(240|t>>>18&7)+S(128|t>>>12&63)+S(128|t>>>6&63)+S(128|t&63)}},hs=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,nn=e=>e.replace(hs,ds),xt=K?e=>Buffer.from(e,"utf8").toString("base64"):Et?e=>Ie(Et.encode(e)):e=>ze(nn(e)),z=(e,t=!1)=>t?Yt(xt(e)):xt(e),Rt=e=>z(e,!0),ps=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ms=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return S((n>>>10)+55296)+S((n&1023)+56320);case 3:return S((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return S((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},rn=e=>e.replace(ps,ms),sn=e=>{if(e=e.replace(/\s+/g,""),!fs.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,n,r,s=[];for(let i=0;i<e.length;)t=ie[e.charAt(i++)]<<18|ie[e.charAt(i++)]<<12|(n=ie[e.charAt(i++)])<<6|(r=ie[e.charAt(i++)]),n===64?s.push(S(t>>16&255)):r===64?s.push(S(t>>16&255,t>>8&255)):s.push(S(t>>16&255,t>>8&255,t&255));return s.join("")},Ve=typeof atob=="function"?e=>atob(en(e)):K?e=>Buffer.from(e,"base64").toString("binary"):sn,on=K?e=>St(Buffer.from(e,"base64")):e=>St(Ve(e).split("").map(t=>t.charCodeAt(0))),an=e=>on(cn(e)),ys=K?e=>Buffer.from(e,"base64").toString("utf8"):gt?e=>gt.decode(on(e)):e=>rn(Ve(e)),cn=e=>en(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),je=e=>ys(cn(e)),bs=e=>{if(typeof e!="string")return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},un=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),ln=function(){const e=(t,n)=>Object.defineProperty(String.prototype,t,un(n));e("fromBase64",function(){return je(this)}),e("toBase64",function(t){return z(this,t)}),e("toBase64URI",function(){return z(this,!0)}),e("toBase64URL",function(){return z(this,!0)}),e("toUint8Array",function(){return an(this)})},fn=function(){const e=(t,n)=>Object.defineProperty(Uint8Array.prototype,t,un(n));e("toBase64",function(t){return le(this,t)}),e("toBase64URI",function(){return le(this,!0)}),e("toBase64URL",function(){return le(this,!0)})},ws=()=>{ln(),fn()},gs={version:Qt,VERSION:us,atob:Ve,atobPolyfill:sn,btoa:ze,btoaPolyfill:tn,fromBase64:je,toBase64:z,encode:z,encodeURI:Rt,encodeURL:Rt,utob:nn,btou:rn,decode:je,isValid:bs,fromUint8Array:le,toUint8Array:an,extendString:ln,extendUint8Array:fn,extendBuiltins:ws},dn=w.create({timeout:1e4});dn.interceptors.request.use(e=>{const t=Ee("server.provider");if(t==="kv-server"||t==="classworkscloud"){const n=Ee("server.kvToken");if(n)e.headers["x-app-token"]=n;else{const r=Ee("server.siteKey");r&&(e.headers["x-site-key"]=gs.encode(r))}}return e},e=>(console.log(e),Promise.reject(e)));dn.interceptors.response.use(e=>e,e=>{if(e.response&&e.response.status===429)try{const t=ts(e.response);t&&pn.show(t.reset,e.config.url,e.config.method.toUpperCase())}catch(t){console.error("解析限速头信息失败:",t)}return Promise.reject(e)});export{dn as a,w as b,gs as g,Ss as o};
|