vite-plugin-i18n-extract
Version:
9 lines • 53.6 kB
JavaScript
"use strict";const Rt=require("path"),Tt=require("fs"),Ot=require("crypto"),xt=require("fast-glob"),_t=require("@vue/compiler-sfc"),At=require("@babel/parser"),Ct=require("@babel/traverse");function le(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const D=le(Rt),k=le(Tt),Xe=le(Ot),Lt=le(At);function B(e){return/[\u4e00-\u9fa5]/.test(e)}function W(e,t,r="md5"){const n=`${t}:${e}`;return Xe.createHash(r).update(n).digest("hex").substring(0,8)}function jt(e,t=["**/node_modules/**","**/dist/**","**/public/**","**/.git/**"]){return xt.sync(e,{ignore:t,onlyFiles:!0,absolute:!0})}function Ye(e){const t=D.dirname(e);k.existsSync(t)||(Ye(t),k.mkdirSync(t))}function te(e,t){Ye(e),k.writeFileSync(e,JSON.stringify(t,null,2),"utf8")}function vt(e,t){try{if(k.existsSync(e)){const r=k.readFileSync(e,"utf8");return JSON.parse(r)}}catch(r){console.error(`Error reading JSON file ${e}:`,r)}return t}function Ft(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function Pt(e){return new Promise(t=>setTimeout(t,e))}function kt(e){const t={};return e.forEach(r=>{t[r.hash]=r.text}),t}async function Se(e,t,r){const n=[];if(t.includes(r)){const o=t.split(`
`).map((a,i)=>a.includes(r)?i:-1).filter(a=>a!==-1);if(o.length>0)return Dt(e,t,o)}try{const s=Lt.parse(t,{sourceType:"module",plugins:["jsx","typescript","decorators-legacy"]});Ct(s,{StringLiteral(o){const{value:a,loc:i}=o.node;if(B(a)){const c=W(a,e);n.push({text:a,hash:c,filePath:e,lineNumber:(i==null?void 0:i.start.line)||0,columnNumber:(i==null?void 0:i.start.column)||0})}},TemplateLiteral(o){var c,l;const{quasis:a,loc:i}=o.node;for(const f of a){const h=f.value.raw;if(B(h)){const d=W(h,e);n.push({text:h,hash:d,filePath:e,lineNumber:((c=f.loc)==null?void 0:c.start.line)||(i==null?void 0:i.start.line)||0,columnNumber:((l=f.loc)==null?void 0:l.start.column)||(i==null?void 0:i.start.column)||0})}}},JSXText(o){const{value:a,loc:i}=o.node;if(B(a)){const c=a.trim();if(c){const l=W(c,e);n.push({text:c,hash:l,filePath:e,lineNumber:(i==null?void 0:i.start.line)||0,columnNumber:(i==null?void 0:i.start.column)||0})}}}})}catch(s){console.error(`Error parsing ${e}:`,s)}return n}async function Dt(e,t,r){const n=t.split(`
`),s=[];for(let o=0;o<n.length;o++){if(r.includes(o))continue;const a=n[o],i=/[\u4e00-\u9fa5,。?!:;""''【】「」『』()、—…·]+/g;let c;for(;(c=i.exec(a))!==null;){const l=c[0],f=W(l,e);s.push({text:l,hash:f,filePath:e,lineNumber:o+1,columnNumber:c.index})}}return s}async function Nt(e,t,r){const n=[],{descriptor:s,errors:o}=_t.parse(t);if(o&&o.length>0)return console.error(`Vue SFC parsing error in ${e}:`,o),n;if(s.template&&s.template.content){const a=s.template.content;if(B(a)){const i=await Bt(e,a,r);n.push(...i)}}if(s.script&&s.script.content){const a=s.script.content;if(B(a)){const i=await Se(e,a,r);n.push(...i)}}if(s.scriptSetup&&s.scriptSetup.content){const a=s.scriptSetup.content;if(B(a)){const i=await Se(e,a,r);n.push(...i)}}return n}async function Bt(e,t,r){const n=[];let s=!1;const o=t.split(`
`);for(let a=0;a<o.length;a++){const i=o[a],c=a+1;if(i.includes(r))continue;if(i.includes("<!--")&&(s=!0),s&&i.includes("-->")){s=!1;continue}if(s)continue;const l=Ut(i);for(const f of l){const h=f.text,d=f.index,g=W(h,e);n.push({text:h,hash:g,filePath:e,lineNumber:c,columnNumber:d})}}return n}function Ut(e){const t=[],r=/[\u4e00-\u9fa5,。?!:;""''【】「」『』()、—…·]+/g;let n;for(;(n=r.exec(e))!==null;)t.push({text:n[0],index:n.index});return t}class qt{constructor(t){this.results=[],this.options=t,this.ignoreMark=t.ignoreMark||"// i18n-ignore"}async extract(){this.results=[];const t=this.options.extensions||[".js",".jsx",".vue"],r=this.options.include||["src/**/*{.js,.jsx,.vue}"],n=this.options.exclude||["**/node_modules/**","**/dist/**","**/public/**","**/.git/**"],s=jt(r,n);for(const a of s){const i=D.extname(a);if(t.includes(i))try{const c=k.readFileSync(a,"utf-8");if(!B(c))continue;if(i===".vue"){const l=await Nt(a,c,this.ignoreMark);this.results.push(...l)}else if([".js",".jsx"].includes(i)){const l=await Se(a,c,this.ignoreMark);this.results.push(...l)}}catch(c){console.error(`Error processing file ${a}:`,c)}}return this.deduplicateResults()}deduplicateResults(){const t=new Map;for(const r of this.results){const n=r.hash;t.has(n)||t.set(n,r)}return Array.from(t.values())}}function $t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Mt(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var ne={exports:{}},re={exports:{}},ye={exports:{}},Pe;function It(){return Pe||(Pe=1,function(e){var t=function(){function r(d,g){return g!=null&&d instanceof g}var n;try{n=Map}catch{n=function(){}}var s;try{s=Set}catch{s=function(){}}var o;try{o=Promise}catch{o=function(){}}function a(d,g,p,b,m){typeof g=="object"&&(p=g.depth,b=g.prototype,m=g.includeNonEnumerable,g=g.circular);var E=[],T=[],O=typeof Buffer<"u";typeof g>"u"&&(g=!0),typeof p>"u"&&(p=1/0);function S(y,_){if(y===null)return null;if(_===0)return y;var R,F;if(typeof y!="object")return y;if(r(y,n))R=new n;else if(r(y,s))R=new s;else if(r(y,o))R=new o(function(H,K){y.then(function(J){H(S(J,_-1))},function(J){K(S(J,_-1))})});else if(a.__isArray(y))R=[];else if(a.__isRegExp(y))R=new RegExp(y.source,h(y)),y.lastIndex&&(R.lastIndex=y.lastIndex);else if(a.__isDate(y))R=new Date(y.getTime());else{if(O&&Buffer.isBuffer(y))return Buffer.allocUnsafe?R=Buffer.allocUnsafe(y.length):R=new Buffer(y.length),y.copy(R),R;r(y,Error)?R=Object.create(y):typeof b>"u"?(F=Object.getPrototypeOf(y),R=Object.create(F)):(R=Object.create(b),F=b)}if(g){var z=E.indexOf(y);if(z!=-1)return T[z];E.push(y),T.push(R)}r(y,n)&&y.forEach(function(H,K){var J=S(K,_-1),St=S(H,_-1);R.set(J,St)}),r(y,s)&&y.forEach(function(H){var K=S(H,_-1);R.add(K)});for(var j in y){var ge;F&&(ge=Object.getOwnPropertyDescriptor(F,j)),!(ge&&ge.set==null)&&(R[j]=S(y[j],_-1))}if(Object.getOwnPropertySymbols)for(var ve=Object.getOwnPropertySymbols(y),j=0;j<ve.length;j++){var Q=ve[j],$=Object.getOwnPropertyDescriptor(y,Q);$&&!$.enumerable&&!m||(R[Q]=S(y[Q],_-1),$.enumerable||Object.defineProperty(R,Q,{enumerable:!1}))}if(m)for(var Fe=Object.getOwnPropertyNames(y),j=0;j<Fe.length;j++){var Z=Fe[j],$=Object.getOwnPropertyDescriptor(y,Z);$&&$.enumerable||(R[Z]=S(y[Z],_-1),Object.defineProperty(R,Z,{enumerable:!1}))}return R}return S(d,p)}a.clonePrototype=function(g){if(g===null)return null;var p=function(){};return p.prototype=g,new p};function i(d){return Object.prototype.toString.call(d)}a.__objToStr=i;function c(d){return typeof d=="object"&&i(d)==="[object Date]"}a.__isDate=c;function l(d){return typeof d=="object"&&i(d)==="[object Array]"}a.__isArray=l;function f(d){return typeof d=="object"&&i(d)==="[object RegExp]"}a.__isRegExp=f;function h(d){var g="";return d.global&&(g+="g"),d.ignoreCase&&(g+="i"),d.multiline&&(g+="m"),g}return a.__getRegExpFlags=h,a}();e.exports&&(e.exports=t)}(ye)),ye.exports}const zt={},Ht=Object.freeze(Object.defineProperty({__proto__:null,default:zt},Symbol.toStringTag,{value:"Module"})),Kt=Mt(Ht);var Jt=re.exports,ke;function Vt(){return ke||(ke=1,(function(){var e,t,r=[].splice,n=function(o,a){if(!(o instanceof a))throw new Error("Bound instance method accessed before binding")},s=[].indexOf;t=It(),e=Kt.EventEmitter,re.exports=(function(){class o extends e{constructor(i={}){super(),this.get=this.get.bind(this),this.mget=this.mget.bind(this),this.set=this.set.bind(this),this.mset=this.mset.bind(this),this.del=this.del.bind(this),this.take=this.take.bind(this),this.ttl=this.ttl.bind(this),this.getTtl=this.getTtl.bind(this),this.keys=this.keys.bind(this),this.has=this.has.bind(this),this.getStats=this.getStats.bind(this),this.flushAll=this.flushAll.bind(this),this.flushStats=this.flushStats.bind(this),this.close=this.close.bind(this),this._checkData=this._checkData.bind(this),this._check=this._check.bind(this),this._isInvalidKey=this._isInvalidKey.bind(this),this._wrap=this._wrap.bind(this),this._getValLength=this._getValLength.bind(this),this._error=this._error.bind(this),this._initErrors=this._initErrors.bind(this),this.options=i,this._initErrors(),this.data={},this.options=Object.assign({forceString:!1,objectValueSize:80,promiseValueSize:80,arrayValueSize:40,stdTTL:0,checkperiod:600,useClones:!0,deleteOnExpire:!0,enableLegacyCallbacks:!1,maxKeys:-1},this.options),this.options.enableLegacyCallbacks&&(console.warn("WARNING! node-cache legacy callback support will drop in v6.x"),["get","mget","set","del","ttl","getTtl","keys","has"].forEach(c=>{var l;l=this[c],this[c]=function(...f){var h,d,g,p;if(g=f,[...f]=g,[h]=r.call(f,-1),typeof h=="function")try{p=l(...f),h(null,p)}catch(b){d=b,h(d)}else return l(...f,h)}})),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.validKeyTypes=["string","number"],this._checkData()}get(i){var c,l;if(n(this,o),(l=this._isInvalidKey(i))!=null)throw l;if(this.data[i]!=null&&this._check(i,this.data[i]))return this.stats.hits++,c=this._unwrap(this.data[i]),c;this.stats.misses++}mget(i){var c,l,f,h,d,g;if(n(this,o),!Array.isArray(i))throw c=this._error("EKEYSTYPE"),c;for(g={},f=0,d=i.length;f<d;f++){if(h=i[f],(l=this._isInvalidKey(h))!=null)throw l;this.data[h]!=null&&this._check(h,this.data[h])?(this.stats.hits++,g[h]=this._unwrap(this.data[h])):this.stats.misses++}return g}set(i,c,l){var f,h,d;if(n(this,o),this.options.maxKeys>-1&&this.stats.keys>=this.options.maxKeys)throw f=this._error("ECACHEFULL"),f;if(this.options.forceString,l==null&&(l=this.options.stdTTL),(h=this._isInvalidKey(i))!=null)throw h;return d=!1,this.data[i]&&(d=!0,this.stats.vsize-=this._getValLength(this._unwrap(this.data[i],!1))),this.data[i]=this._wrap(c,l),this.stats.vsize+=this._getValLength(c),d||(this.stats.ksize+=this._getKeyLength(i),this.stats.keys++),this.emit("set",i,c),!0}mset(i){var c,l,f,h,d,g,p,b,m,E;if(n(this,o),this.options.maxKeys>-1&&this.stats.keys+i.length>=this.options.maxKeys)throw c=this._error("ECACHEFULL"),c;for(f=0,p=i.length;f<p;f++){if(g=i[f],{key:d,val:E,ttl:m}=g,m&&typeof m!="number")throw c=this._error("ETTLTYPE"),c;if((l=this._isInvalidKey(d))!=null)throw l}for(h=0,b=i.length;h<b;h++)g=i[h],{key:d,val:E,ttl:m}=g,this.set(d,E,m);return!0}del(i){var c,l,f,h,d,g;for(n(this,o),Array.isArray(i)||(i=[i]),c=0,f=0,d=i.length;f<d;f++){if(h=i[f],(l=this._isInvalidKey(h))!=null)throw l;this.data[h]!=null&&(this.stats.vsize-=this._getValLength(this._unwrap(this.data[h],!1)),this.stats.ksize-=this._getKeyLength(h),this.stats.keys--,c++,g=this.data[h],delete this.data[h],this.emit("del",h,g.v))}return c}take(i){var c;return n(this,o),c=this.get(i),c!=null&&this.del(i),c}ttl(i,c){var l;if(n(this,o),c||(c=this.options.stdTTL),!i)return!1;if((l=this._isInvalidKey(i))!=null)throw l;return this.data[i]!=null&&this._check(i,this.data[i])?(c>=0?this.data[i]=this._wrap(this.data[i].v,c,!1):this.del(i),!0):!1}getTtl(i){var c,l;if(n(this,o),!!i){if((l=this._isInvalidKey(i))!=null)throw l;if(this.data[i]!=null&&this._check(i,this.data[i]))return c=this.data[i].t,c}}keys(){var i;return n(this,o),i=Object.keys(this.data),i}has(i){var c;return n(this,o),c=this.data[i]!=null&&this._check(i,this.data[i]),c}getStats(){return n(this,o),this.stats}flushAll(i=!0){n(this,o),this.data={},this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this._killCheckPeriod(),this._checkData(i),this.emit("flush")}flushStats(){n(this,o),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.emit("flush_stats")}close(){n(this,o),this._killCheckPeriod()}_checkData(i=!0){var c,l,f;n(this,o),l=this.data;for(c in l)f=l[c],this._check(c,f);i&&this.options.checkperiod>0&&(this.checkTimeout=setTimeout(this._checkData,this.options.checkperiod*1e3,i),this.checkTimeout!=null&&this.checkTimeout.unref!=null&&this.checkTimeout.unref())}_killCheckPeriod(){if(this.checkTimeout!=null)return clearTimeout(this.checkTimeout)}_check(i,c){var l;return n(this,o),l=!0,c.t!==0&&c.t<Date.now()&&(this.options.deleteOnExpire&&(l=!1,this.del(i)),this.emit("expired",i,this._unwrap(c))),l}_isInvalidKey(i){var c;if(n(this,o),c=typeof i,s.call(this.validKeyTypes,c)<0)return this._error("EKEYTYPE",{type:typeof i})}_wrap(i,c,l=!0){var f,h,d;return n(this,o),this.options.useClones||(l=!1),h=Date.now(),f=0,d=1e3,c===0?f=0:c?f=h+c*d:this.options.stdTTL===0?f=this.options.stdTTL:f=h+this.options.stdTTL*d,{t:f,v:l?t(i):i}}_unwrap(i,c=!0){return this.options.useClones||(c=!1),i.v!=null?c?t(i.v):i.v:null}_getKeyLength(i){return i.toString().length}_getValLength(i){return n(this,o),typeof i=="string"?i.length:this.options.forceString?JSON.stringify(i).length:Array.isArray(i)?this.options.arrayValueSize*i.length:typeof i=="number"?8:typeof(i!=null?i.then:void 0)=="function"?this.options.promiseValueSize:typeof Buffer<"u"&&Buffer!==null&&Buffer.isBuffer(i)?i.length:i!=null&&typeof i=="object"?this.options.objectValueSize*Object.keys(i).length:typeof i=="boolean"?8:0}_error(i,c={}){var l;return n(this,o),l=new Error,l.name=i,l.errorcode=i,l.message=this.ERRORS[i]!=null?this.ERRORS[i](c):"-",l.data=c,l}_initErrors(){var i,c,l;n(this,o),this.ERRORS={},l=this._ERRORS;for(c in l)i=l[c],this.ERRORS[c]=this.createErrorMessage(i)}createErrorMessage(i){return function(c){return i.replace("__key",c.type)}}}return o.prototype._ERRORS={ENOTFOUND:"Key `__key` not found",ECACHEFULL:"Cache max keys amount exceeded",EKEYTYPE:"The key argument has to be of type `string` or `number`. Found: `__key`",EKEYSTYPE:"The keys argument has to be an array.",ETTLTYPE:"The ttl argument has to be a number."},o}).call(this)}).call(Jt)),re.exports}var Wt=ne.exports,De;function Xt(){return De||(De=1,(function(){var e;e=ne.exports=Vt(),e.version="5.1.2"}).call(Wt)),ne.exports}var Yt=Xt();const Gt=$t(Yt);class Qt{constructor(t,r=!0){this.cache=new Gt({stdTTL:0,checkperiod:0}),this.cacheFile=D.join(t,".i18n-cache"),this.enabled=r,this.init()}init(){if(!this.enabled)return;const t={},r=vt(this.cacheFile,t);Object.entries(r).forEach(([n,s])=>{Object.entries(s).forEach(([o,a])=>{const i=`${n}:${o}`;this.cache.set(i,a)})})}get(t,r){if(!this.enabled)return;const n=`${t}:${r}`;return this.cache.get(n)}getMany(t,r){if(!this.enabled)return{};const n={};return r.forEach(s=>{const o=this.get(t,s);o&&(n[s]=o)}),n}set(t,r,n){if(!this.enabled)return;const s=`${t}:${r}`;this.cache.set(s,n)}setMany(t,r){this.enabled&&Object.entries(r).forEach(([n,s])=>{this.set(t,n,s)})}persist(){if(!this.enabled)return;const t={};this.cache.keys().forEach(n=>{const[s,o]=n.split(":"),a=this.cache.get(n);a&&(t[s]||(t[s]={}),t[s][o]=a)}),te(this.cacheFile,t)}clear(){this.cache.flushAll(),this.enabled&&k.existsSync(this.cacheFile)&&k.unlinkSync(this.cacheFile)}}function Ge(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zt}=Object.prototype,{getPrototypeOf:Ce}=Object,ue=(e=>t=>{const r=Zt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),v=e=>(e=e.toLowerCase(),t=>ue(t)===e),fe=e=>t=>typeof t===e,{isArray:M}=Array,X=fe("undefined");function en(e){return e!==null&&!X(e)&&e.constructor!==null&&!X(e.constructor)&&L(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Qe=v("ArrayBuffer");function tn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Qe(e.buffer),t}const nn=fe("string"),L=fe("function"),Ze=fe("number"),he=e=>e!==null&&typeof e=="object",rn=e=>e===!0||e===!1,se=e=>{if(ue(e)!=="object")return!1;const t=Ce(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},sn=v("Date"),on=v("File"),an=v("Blob"),cn=v("FileList"),ln=e=>he(e)&&L(e.pipe),un=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||L(e.append)&&((t=ue(e))==="formdata"||t==="object"&&L(e.toString)&&e.toString()==="[object FormData]"))},fn=v("URLSearchParams"),[hn,dn,pn,mn]=["ReadableStream","Request","Response","Headers"].map(v),gn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Y(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),M(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let i;for(n=0;n<a;n++)i=o[n],t.call(null,e[i],i,e)}}function et(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const N=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,tt=e=>!X(e)&&e!==N;function Re(){const{caseless:e}=tt(this)&&this||{},t={},r=(n,s)=>{const o=e&&et(t,s)||s;se(t[o])&&se(n)?t[o]=Re(t[o],n):se(n)?t[o]=Re({},n):M(n)?t[o]=n.slice():t[o]=n};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&Y(arguments[n],r);return t}const yn=(e,t,r,{allOwnKeys:n}={})=>(Y(t,(s,o)=>{r&&L(s)?e[o]=Ge(s,r):e[o]=s},{allOwnKeys:n}),e),bn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),wn=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},En=(e,t,r,n)=>{let s,o,a;const i={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],(!n||n(a,e,t))&&!i[a]&&(t[a]=e[a],i[a]=!0);e=r!==!1&&Ce(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Sn=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Rn=e=>{if(!e)return null;if(M(e))return e;let t=e.length;if(!Ze(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Tn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ce(Uint8Array)),On=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},xn=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},_n=v("HTMLFormElement"),An=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),Ne=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Cn=v("RegExp"),nt=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Y(r,(s,o)=>{let a;(a=t(s,o,e))!==!1&&(n[o]=a||s)}),Object.defineProperties(e,n)},Ln=e=>{nt(e,(t,r)=>{if(L(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(L(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},jn=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return M(e)?n(e):n(String(e).split(t)),r},vn=()=>{},Fn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Pn(e){return!!(e&&L(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const kn=e=>{const t=new Array(10),r=(n,s)=>{if(he(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[s]=n;const o=M(n)?[]:{};return Y(n,(a,i)=>{const c=r(a,s+1);!X(c)&&(o[i]=c)}),t[s]=void 0,o}}return n};return r(e,0)},Dn=v("AsyncFunction"),Nn=e=>e&&(he(e)||L(e))&&L(e.then)&&L(e.catch),rt=((e,t)=>e?setImmediate:t?((r,n)=>(N.addEventListener("message",({source:s,data:o})=>{s===N&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),N.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",L(N.postMessage)),Bn=typeof queueMicrotask<"u"?queueMicrotask.bind(N):typeof process<"u"&&process.nextTick||rt,u={isArray:M,isArrayBuffer:Qe,isBuffer:en,isFormData:un,isArrayBufferView:tn,isString:nn,isNumber:Ze,isBoolean:rn,isObject:he,isPlainObject:se,isReadableStream:hn,isRequest:dn,isResponse:pn,isHeaders:mn,isUndefined:X,isDate:sn,isFile:on,isBlob:an,isRegExp:Cn,isFunction:L,isStream:ln,isURLSearchParams:fn,isTypedArray:Tn,isFileList:cn,forEach:Y,merge:Re,extend:yn,trim:gn,stripBOM:bn,inherits:wn,toFlatObject:En,kindOf:ue,kindOfTest:v,endsWith:Sn,toArray:Rn,forEachEntry:On,matchAll:xn,isHTMLForm:_n,hasOwnProperty:Ne,hasOwnProp:Ne,reduceDescriptors:nt,freezeMethods:Ln,toObjectSet:jn,toCamelCase:An,noop:vn,toFiniteNumber:Fn,findKey:et,global:N,isContextDefined:tt,isSpecCompliantForm:Pn,toJSONObject:kn,isAsyncFn:Dn,isThenable:Nn,setImmediate:rt,asap:Bn};function w(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}u.inherits(w,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:u.toJSONObject(this.config),code:this.code,status:this.status}}});const st=w.prototype,it={};["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=>{it[e]={value:e}});Object.defineProperties(w,it);Object.defineProperty(st,"isAxiosError",{value:!0});w.from=(e,t,r,n,s,o)=>{const a=Object.create(st);return u.toFlatObject(e,a,function(c){return c!==Error.prototype},i=>i!=="isAxiosError"),w.call(a,e.message,t,r,n,s),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const Un=null;function Te(e){return u.isPlainObject(e)||u.isArray(e)}function ot(e){return u.endsWith(e,"[]")?e.slice(0,-2):e}function Be(e,t,r){return e?e.concat(t).map(function(s,o){return s=ot(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function qn(e){return u.isArray(e)&&!e.some(Te)}const $n=u.toFlatObject(u,{},null,function(t){return/^is[A-Z]/.test(t)});function de(e,t,r){if(!u.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=u.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,m){return!u.isUndefined(m[b])});const n=r.metaTokens,s=r.visitor||f,o=r.dots,a=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&u.isSpecCompliantForm(t);if(!u.isFunction(s))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(u.isDate(p))return p.toISOString();if(!c&&u.isBlob(p))throw new w("Blob is not supported. Use a Buffer instead.");return u.isArrayBuffer(p)||u.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,b,m){let E=p;if(p&&!m&&typeof p=="object"){if(u.endsWith(b,"{}"))b=n?b:b.slice(0,-2),p=JSON.stringify(p);else if(u.isArray(p)&&qn(p)||(u.isFileList(p)||u.endsWith(b,"[]"))&&(E=u.toArray(p)))return b=ot(b),E.forEach(function(O,S){!(u.isUndefined(O)||O===null)&&t.append(a===!0?Be([b],S,o):a===null?b:b+"[]",l(O))}),!1}return Te(p)?!0:(t.append(Be(m,b,o),l(p)),!1)}const h=[],d=Object.assign($n,{defaultVisitor:f,convertValue:l,isVisitable:Te});function g(p,b){if(!u.isUndefined(p)){if(h.indexOf(p)!==-1)throw Error("Circular reference detected in "+b.join("."));h.push(p),u.forEach(p,function(E,T){(!(u.isUndefined(E)||E===null)&&s.call(t,E,u.isString(T)?T.trim():T,b,d))===!0&&g(E,b?b.concat(T):[T])}),h.pop()}}if(!u.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ue(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Le(e,t){this._pairs=[],e&&de(e,this,t)}const at=Le.prototype;at.append=function(t,r){this._pairs.push([t,r])};at.toString=function(t){const r=t?function(n){return t.call(this,n,Ue)}:Ue;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Mn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ct(e,t,r){if(!t)return e;const n=r&&r.encode||Mn;u.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let o;if(s?o=s(t,r):o=u.isURLSearchParams(t)?t.toString():new Le(t,r).toString(n),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class qe{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){u.forEach(this.handlers,function(n){n!==null&&t(n)})}}const lt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},In=typeof URLSearchParams<"u"?URLSearchParams:Le,zn=typeof FormData<"u"?FormData:null,Hn=typeof Blob<"u"?Blob:null,Kn={isBrowser:!0,classes:{URLSearchParams:In,FormData:zn,Blob:Hn},protocols:["http","https","file","blob","url","data"]},je=typeof window<"u"&&typeof document<"u",Oe=typeof navigator=="object"&&navigator||void 0,Jn=je&&(!Oe||["ReactNative","NativeScript","NS"].indexOf(Oe.product)<0),Vn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wn=je&&window.location.href||"http://localhost",Xn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:je,hasStandardBrowserEnv:Jn,hasStandardBrowserWebWorkerEnv:Vn,navigator:Oe,origin:Wn},Symbol.toStringTag,{value:"Module"})),A={...Xn,...Kn};function Yn(e,t){return de(e,new A.classes.URLSearchParams,Object.assign({visitor:function(r,n,s,o){return A.isNode&&u.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Gn(e){return u.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Qn(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function ut(e){function t(r,n,s,o){let a=r[o++];if(a==="__proto__")return!0;const i=Number.isFinite(+a),c=o>=r.length;return a=!a&&u.isArray(s)?s.length:a,c?(u.hasOwnProp(s,a)?s[a]=[s[a],n]:s[a]=n,!i):((!s[a]||!u.isObject(s[a]))&&(s[a]=[]),t(r,n,s[a],o)&&u.isArray(s[a])&&(s[a]=Qn(s[a])),!i)}if(u.isFormData(e)&&u.isFunction(e.entries)){const r={};return u.forEachEntry(e,(n,s)=>{t(Gn(n),s,r,0)}),r}return null}function Zn(e,t,r){if(u.isString(e))try{return(t||JSON.parse)(e),u.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const G={transitional:lt,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=u.isObject(t);if(o&&u.isHTMLForm(t)&&(t=new FormData(t)),u.isFormData(t))return s?JSON.stringify(ut(t)):t;if(u.isArrayBuffer(t)||u.isBuffer(t)||u.isStream(t)||u.isFile(t)||u.isBlob(t)||u.isReadableStream(t))return t;if(u.isArrayBufferView(t))return t.buffer;if(u.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Yn(t,this.formSerializer).toString();if((i=u.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return de(i?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||s?(r.setContentType("application/json",!1),Zn(t)):t}],transformResponse:[function(t){const r=this.transitional||G.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(u.isResponse(t)||u.isReadableStream(t))return t;if(t&&u.isString(t)&&(n&&!this.responseType||s)){const a=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(i){if(a)throw i.name==="SyntaxError"?w.from(i,w.ERR_BAD_RESPONSE,this,null,this.response):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:A.classes.FormData,Blob:A.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};u.forEach(["delete","get","head","post","put","patch"],e=>{G.headers[e]={}});const er=u.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"]),tr=e=>{const t={};let r,n,s;return e&&e.split(`
`).forEach(function(a){s=a.indexOf(":"),r=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!r||t[r]&&er[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},$e=Symbol("internals");function V(e){return e&&String(e).trim().toLowerCase()}function ie(e){return e===!1||e==null?e:u.isArray(e)?e.map(ie):String(e)}function nr(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const rr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function be(e,t,r,n,s){if(u.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!u.isString(t)){if(u.isString(n))return t.indexOf(n)!==-1;if(u.isRegExp(n))return n.test(t)}}function sr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function ir(e,t){const r=u.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(s,o,a){return this[n].call(this,t,s,o,a)},configurable:!0})})}let C=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(i,c,l){const f=V(c);if(!f)throw new Error("header name must be a non-empty string");const h=u.findKey(s,f);(!h||s[h]===void 0||l===!0||l===void 0&&s[h]!==!1)&&(s[h||c]=ie(i))}const a=(i,c)=>u.forEach(i,(l,f)=>o(l,f,c));if(u.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(u.isString(t)&&(t=t.trim())&&!rr(t))a(tr(t),r);else if(u.isHeaders(t))for(const[i,c]of t.entries())o(c,i,n);else t!=null&&o(r,t,n);return this}get(t,r){if(t=V(t),t){const n=u.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return nr(s);if(u.isFunction(r))return r.call(this,s,n);if(u.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=V(t),t){const n=u.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||be(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(a){if(a=V(a),a){const i=u.findKey(n,a);i&&(!r||be(n,n[i],i,r))&&(delete n[i],s=!0)}}return u.isArray(t)?t.forEach(o):o(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const o=r[n];(!t||be(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const r=this,n={};return u.forEach(this,(s,o)=>{const a=u.findKey(n,o);if(a){r[a]=ie(s),delete r[o];return}const i=t?sr(o):String(o).trim();i!==o&&delete r[o],r[i]=ie(s),n[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return u.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&u.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[$e]=this[$e]={accessors:{}}).accessors,s=this.prototype;function o(a){const i=V(a);n[i]||(ir(s,a),n[i]=!0)}return u.isArray(t)?t.forEach(o):o(t),this}};C.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);u.reduceDescriptors(C.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});u.freezeMethods(C);function we(e,t){const r=this||G,n=t||r,s=C.from(n.headers);let o=n.data;return u.forEach(e,function(i){o=i.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function ft(e){return!!(e&&e.__CANCEL__)}function I(e,t,r){w.call(this,e??"canceled",w.ERR_CANCELED,t,r),this.name="CanceledError"}u.inherits(I,w,{__CANCEL__:!0});function ht(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new w("Request failed with status code "+r.status,[w.ERR_BAD_REQUEST,w.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function or(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function ar(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),f=n[o];a||(a=l),r[s]=c,n[s]=l;let h=o,d=0;for(;h!==s;)d+=r[h++],h=h%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-a<t)return;const g=f&&l-f;return g?Math.round(d*1e3/g):void 0}}function cr(e,t){let r=0,n=1e3/t,s,o;const a=(l,f=Date.now())=>{r=f,s=null,o&&(clearTimeout(o),o=null),e.apply(null,l)};return[(...l)=>{const f=Date.now(),h=f-r;h>=n?a(l,f):(s=l,o||(o=setTimeout(()=>{o=null,a(s)},n-h)))},()=>s&&a(s)]}const ae=(e,t,r=3)=>{let n=0;const s=ar(50,250);return cr(o=>{const a=o.loaded,i=o.lengthComputable?o.total:void 0,c=a-n,l=s(c),f=a<=i;n=a;const h={loaded:a,total:i,progress:i?a/i:void 0,bytes:c,rate:l||void 0,estimated:l&&i&&f?(i-a)/l:void 0,event:o,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(h)},r)},Me=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ie=e=>(...t)=>u.asap(()=>e(...t)),lr=A.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,A.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(A.origin),A.navigator&&/(msie|trident)/i.test(A.navigator.userAgent)):()=>!0,ur=A.hasStandardBrowserEnv?{write(e,t,r,n,s,o){const a=[e+"="+encodeURIComponent(t)];u.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),u.isString(n)&&a.push("path="+n),u.isString(s)&&a.push("domain="+s),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function fr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function hr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function dt(e,t,r){let n=!fr(t);return e&&(n||r==!1)?hr(e,t):t}const ze=e=>e instanceof C?{...e}:e;function q(e,t){t=t||{};const r={};function n(l,f,h,d){return u.isPlainObject(l)&&u.isPlainObject(f)?u.merge.call({caseless:d},l,f):u.isPlainObject(f)?u.merge({},f):u.isArray(f)?f.slice():f}function s(l,f,h,d){if(u.isUndefined(f)){if(!u.isUndefined(l))return n(void 0,l,h,d)}else return n(l,f,h,d)}function o(l,f){if(!u.isUndefined(f))return n(void 0,f)}function a(l,f){if(u.isUndefined(f)){if(!u.isUndefined(l))return n(void 0,l)}else return n(void 0,f)}function i(l,f,h){if(h in t)return n(l,f);if(h in e)return n(void 0,l)}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:i,headers:(l,f,h)=>s(ze(l),ze(f),h,!0)};return u.forEach(Object.keys(Object.assign({},e,t)),function(f){const h=c[f]||s,d=h(e[f],t[f],f);u.isUndefined(d)&&h!==i||(r[f]=d)}),r}const pt=e=>{const t=q({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:i}=t;t.headers=a=C.from(a),t.url=ct(dt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&a.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):"")));let c;if(u.isFormData(r)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[l,...f]=c?c.split(";").map(h=>h.trim()).filter(Boolean):[];a.setContentType([l||"multipart/form-data",...f].join("; "))}}if(A.hasStandardBrowserEnv&&(n&&u.isFunction(n)&&(n=n(t)),n||n!==!1&&lr(t.url))){const l=s&&o&&ur.read(o);l&&a.set(s,l)}return t},dr=typeof XMLHttpRequest<"u",pr=dr&&function(e){return new Promise(function(r,n){const s=pt(e);let o=s.data;const a=C.from(s.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:l}=s,f,h,d,g,p;function b(){g&&g(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function E(){if(!m)return;const O=C.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),y={data:!i||i==="text"||i==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:O,config:e,request:m};ht(function(R){r(R),b()},function(R){n(R),b()},y),m=null}"onloadend"in m?m.onloadend=E:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(E)},m.onabort=function(){m&&(n(new w("Request aborted",w.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new w("Network Error",w.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let S=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const y=s.transitional||lt;s.timeoutErrorMessage&&(S=s.timeoutErrorMessage),n(new w(S,y.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,e,m)),m=null},o===void 0&&a.setContentType(null),"setRequestHeader"in m&&u.forEach(a.toJSON(),function(S,y){m.setRequestHeader(y,S)}),u.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),i&&i!=="json"&&(m.responseType=s.responseType),l&&([d,p]=ae(l,!0),m.addEventListener("progress",d)),c&&m.upload&&([h,g]=ae(c),m.upload.addEventListener("progress",h),m.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(f=O=>{m&&(n(!O||O.type?new I(null,e,m):O),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const T=or(s.url);if(T&&A.protocols.indexOf(T)===-1){n(new w("Unsupported protocol "+T+":",w.ERR_BAD_REQUEST,e));return}m.send(o||null)})},mr=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,s;const o=function(l){if(!s){s=!0,i();const f=l instanceof Error?l:this.reason;n.abort(f instanceof w?f:new I(f instanceof Error?f.message:f))}};let a=t&&setTimeout(()=>{a=null,o(new w(`timeout ${t} of ms exceeded`,w.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:c}=n;return c.unsubscribe=()=>u.asap(i),c}},gr=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},yr=async function*(e,t){for await(const r of br(e))yield*gr(r,t)},br=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},He=(e,t,r,n)=>{const s=yr(e,t);let o=0,a,i=c=>{a||(a=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:l,value:f}=await s.next();if(l){i(),c.close();return}let h=f.byteLength;if(r){let d=o+=h;r(d)}c.enqueue(new Uint8Array(f))}catch(l){throw i(l),l}},cancel(c){return i(c),s.return()}},{highWaterMark:2})},pe=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",mt=pe&&typeof ReadableStream=="function",wr=pe&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),gt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Er=mt&>(()=>{let e=!1;const t=new Request(A.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Ke=64*1024,xe=mt&>(()=>u.isReadableStream(new Response("").body)),ce={stream:xe&&(e=>e.body)};pe&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ce[t]&&(ce[t]=u.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new w(`Response type '${t}' is not supported`,w.ERR_NOT_SUPPORT,n)})})})(new Response);const Sr=async e=>{if(e==null)return 0;if(u.isBlob(e))return e.size;if(u.isSpecCompliantForm(e))return(await new Request(A.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(u.isArrayBufferView(e)||u.isArrayBuffer(e))return e.byteLength;if(u.isURLSearchParams(e)&&(e=e+""),u.isString(e))return(await wr(e)).byteLength},Rr=async(e,t)=>{const r=u.toFiniteNumber(e.getContentLength());return r??Sr(t)},Tr=pe&&(async e=>{let{url:t,method:r,data:n,signal:s,cancelToken:o,timeout:a,onDownloadProgress:i,onUploadProgress:c,responseType:l,headers:f,withCredentials:h="same-origin",fetchOptions:d}=pt(e);l=l?(l+"").toLowerCase():"text";let g=mr([s,o&&o.toAbortSignal()],a),p;const b=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let m;try{if(c&&Er&&r!=="get"&&r!=="head"&&(m=await Rr(f,n))!==0){let y=new Request(t,{method:"POST",body:n,duplex:"half"}),_;if(u.isFormData(n)&&(_=y.headers.get("content-type"))&&f.setContentType(_),y.body){const[R,F]=Me(m,ae(Ie(c)));n=He(y.body,Ke,R,F)}}u.isString(h)||(h=h?"include":"omit");const E="credentials"in Request.prototype;p=new Request(t,{...d,signal:g,method:r.toUpperCase(),headers:f.normalize().toJSON(),body:n,duplex:"half",credentials:E?h:void 0});let T=await fetch(p);const O=xe&&(l==="stream"||l==="response");if(xe&&(i||O&&b)){const y={};["status","statusText","headers"].forEach(z=>{y[z]=T[z]});const _=u.toFiniteNumber(T.headers.get("content-length")),[R,F]=i&&Me(_,ae(Ie(i),!0))||[];T=new Response(He(T.body,Ke,R,()=>{F&&F(),b&&b()}),y)}l=l||"text";let S=await ce[u.findKey(ce,l)||"text"](T,e);return!O&&b&&b(),await new Promise((y,_)=>{ht(y,_,{data:S,headers:C.from(T.headers),status:T.status,statusText:T.statusText,config:e,request:p})})}catch(E){throw b&&b(),E&&E.name==="TypeError"&&/fetch/i.test(E.message)?Object.assign(new w("Network Error",w.ERR_NETWORK,e,p),{cause:E.cause||E}):w.from(E,E&&E.code,e,p)}}),_e={http:Un,xhr:pr,fetch:Tr};u.forEach(_e,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Je=e=>`- ${e}`,Or=e=>u.isFunction(e)||e===null||e===!1,yt={getAdapter:e=>{e=u.isArray(e)?e:[e];const{length:t}=e;let r,n;const s={};for(let o=0;o<t;o++){r=e[o];let a;if(n=r,!Or(r)&&(n=_e[(a=String(r)).toLowerCase()],n===void 0))throw new w(`Unknown adapter '${a}'`);if(n)break;s[a||"#"+o]=n}if(!n){const o=Object.entries(s).map(([i,c])=>`adapter ${i} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since :
`+o.map(Je).join(`
`):" "+Je(o[0]):"as no adapter specified";throw new w("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:_e};function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new I(null,e)}function Ve(e){return Ee(e),e.headers=C.from(e.headers),e.data=we.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),yt.getAdapter(e.adapter||G.adapter)(e).then(function(n){return Ee(e),n.data=we.call(e,e.transformResponse,n),n.headers=C.from(n.headers),n},function(n){return ft(n)||(Ee(e),n&&n.response&&(n.response.data=we.call(e,e.transformResponse,n.response),n.response.headers=C.from(n.response.headers))),Promise.reject(n)})}const bt="1.8.4",me={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{me[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const We={};me.transitional=function(t,r,n){function s(o,a){return"[Axios v"+bt+"] Transitional option '"+o+"'"+a+(n?". "+n:"")}return(o,a,i)=>{if(t===!1)throw new w(s(a," has been removed"+(r?" in "+r:"")),w.ERR_DEPRECATED);return r&&!We[a]&&(We[a]=!0,console.warn(s(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,a,i):!0}};me.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function xr(e,t,r){if(typeof e!="object")throw new w("options must be an object",w.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],a=t[o];if(a){const i=e[o],c=i===void 0||a(i,o,e);if(c!==!0)throw new w("option "+o+" must be "+c,w.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new w("Unknown option "+o,w.ERR_BAD_OPTION)}}const oe={assertOptions:xr,validators:me},P=oe.validators;let U=class{constructor(t){this.defaults=t,this.interceptors={request:new qe,response:new qe}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
`+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=q(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&oe.assertOptions(n,{silentJSONParsing:P.transitional(P.boolean),forcedJSONParsing:P.transitional(P.boolean),clarifyTimeoutError:P.transitional(P.boolean)},!1),s!=null&&(u.isFunction(s)?r.paramsSerializer={serialize:s}:oe.assertOptions(s,{encode:P.function,serialize:P.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),oe.assertOptions(r,{baseUrl:P.spelling("baseURL"),withXsrfToken:P.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=o&&u.merge(o.common,o[r.method]);o&&u.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),r.headers=C.concat(a,o);const i=[];let c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(c=c&&b.synchronous,i.unshift(b.fulfilled,b.rejected))});const l=[];this.interceptors.response.forEach(function(b){l.push(b.fulfilled,b.rejected)});let f,h=0,d;if(!c){const p=[Ve.bind(this),void 0];for(p.unshift.apply(p,i),p.push.apply(p,l),d=p.length,f=Promise.resolve(r);h<d;)f=f.then(p[h++],p[h++]);return f}d=i.length;let g=r;for(h=0;h<d;){const p=i[h++],b=i[h++];try{g=p(g)}catch(m){b.call(this,m);break}}try{f=Ve.call(this,g)}catch(p){return Promise.reject(p)}for(h=0,d=l.length;h<d;)f=f.then(l[h++],l[h++]);return f}getUri(t){t=q(this.defaults,t);const r=dt(t.baseURL,t.url,t.allowAbsoluteUrls);return ct(r,t.params,t.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(t){U.prototype[t]=function(r,n){return this.request(q(n||{},{method:t,url:r,data:(n||{}).data}))}});u.forEach(["post","put","patch"],function(t){function r(n){return function(o,a,i){return this.request(q(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}U.prototype[t]=r(),U.prototype[t+"Form"]=r(!0)});let _r=class wt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(i=>{n.subscribe(i),o=i}).then(s);return a.cancel=function(){n.unsubscribe(o)},a},t(function(o,a,i){n.reason||(n.reason=new I(o,a,i),r(n.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new wt(function(s){t=s}),cancel:t}}};function Ar(e){return function(r){return e.apply(null,r)}}function Cr(e){return u.isObject(e)&&e.isAxiosError===!0}const Ae={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ae).forEach(([e,t])=>{Ae[t]=e});function Et(e){const t=new U(e),r=Ge(U.prototype.request,t);return u.extend(r,U.prototype,t,{allOwnKeys:!0}),u.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return Et(q(e,s))},r}const x=Et(G);x.Axios=U;x.CanceledError=I;x.CancelToken=_r;x.isCancel=ft;x.VERSION=bt;x.toFormData=de;x.AxiosError=w;x.Cancel=x.CanceledError;x.all=function(t){return Promise.all(t)};x.spread=Ar;x.isAxiosError=Cr;x.mergeConfig=q;x.AxiosHeaders=C;x.formToJSON=e=>ut(u.isHTMLForm(e)?new FormData(e):