UNPKG

@ew-did-registry/did-ssi-hub-store

Version:

S3-based implementation of IDidStore

2 lines 93.4 kB
/*! For license information please see index.esm.js.LICENSE.txt */ (()=>{var t={19:function(t,e,r){"use strict";var n=r(486).hp,o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CacheClient=void 0;const s=i(r(425)),a=i(r(710)),u=i(r(702)),c=r(321);e.CacheClient=class{constructor(t){this.accessToken=null,this.refreshToken=null,this.identityToken=null,this.privateKey=t.privateKey,this.signer=new c.Wallet(this.privateKey),this.did=t.did,this.loginEndpoint=t.loginEndpoint,this.refreshEndpoint=t.refreshEndpoint,this.api=s.default.create({baseURL:t.baseURL}),(0,a.default)(this.api,{retries:3,retryDelay:a.default.exponentialDelay,retryCondition:t=>a.default.isNetworkOrIdempotentRequestError(t)||Boolean(t.response&&t.response.status>=500&&t.response.status<600)}),this.api.interceptors.request.use(t=>o(this,void 0,void 0,function*(){var e;return this.accessToken||(yield this._login()),t.headers=null!==(e=t.headers)&&void 0!==e?e:{},t.headers.Authorization=`Bearer ${this.accessToken}`,t})),this.api.interceptors.response.use(t=>t,t=>this._handle401(t))}_login(){return o(this,void 0,void 0,function*(){yield this.createIdentityToken();const t=yield s.default.post(this.loginEndpoint,{identityToken:this.identityToken},{headers:{accept:"*/*","Content-Type":"application/json"}});this.accessToken=t.data.token,this.refreshToken=t.data.refreshToken})}_refresh(){return o(this,void 0,void 0,function*(){const t=yield s.default.post(this.refreshEndpoint,{refreshToken:this.refreshToken});this.accessToken=t.data.token||t.data.accessToken,this.refreshToken=t.data.refreshToken||this.refreshToken})}_handle401(t){return o(this,void 0,void 0,function*(){const e=t.config;if(t.response&&401===t.response.status&&!e._retry){e._retry=!0;try{yield this._refresh()}catch(t){yield this._login()}return e.headers&&(e.headers.Authorization="Bearer "+this.accessToken),this.api(e)}return Promise.reject(t)})}createIdentityToken(){return o(this,void 0,void 0,function*(){const t=(0,u.default)(JSON.stringify({alg:"ES256",typ:"JWT"})),e={iss:this.did,claimData:{blockNumber:999999999999},iat:Math.floor(Date.now()/1e3),exp:Math.floor(Date.now()/1e3)+5e3},r=(0,u.default)(JSON.stringify(e)),o=c.utils.arrayify(c.utils.keccak256(n.from(`${t}.${r}`))),i=yield this.signer.signMessage(o),s=(0,u.default)(i);this.identityToken=`${t}.${r}.${s}`})}get(...t){return this.api.get(...t)}post(...t){return this.api.post(...t)}put(...t){return this.api.put(...t)}delete(...t){return this.api.delete(...t)}}},97:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.DidStore=void 0;const o=r(19);e.DidStore=class{constructor(t){this.client=new o.CacheClient(t)}save(t){return n(this,void 0,void 0,function*(){return(yield this.client.post("/s3",{data:t})).data})}get(t){return n(this,void 0,void 0,function*(){return(yield this.client.get(`/s3/${t}`)).data})}delete(t){return n(this,void 0,void 0,function*(){try{return!1}catch(t){if("NoSuchKey"===t.name)return!1;throw t}})}}},121:t=>{"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},124:t=>{"use strict";const e=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);t.exports=t=>!e.has(t&&t.code)},166:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},208:(t,e,r)=>{var n=r(907),o=r(364),i=/%[sdj%]/g;e.format=function(t){if(!b(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(u(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(t).replace(i,function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),a=n[r];r<o;a=n[++r])g(a)||!v(a)?s+=" "+a:s+=" "+u(a);return s},e.deprecate=function(t,i){if(w(r.g.process))return function(){return e.deprecate(t,i).apply(this,arguments)};if(!0===n.noDeprecation)return t;var s=!1;return function(){if(!s){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?o.trace(i):o.error(i),s=!0}return t.apply(this,arguments)}};var s,a={};function u(t,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),l(n,t,n.depth)}function c(t,e){var r=u.styles[e];return r?"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m":t}function f(t,e){return t}function l(t,r,n){if(t.customInspect&&r&&T(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return b(o)||(o=l(t,o,n)),o}var i=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(b(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}(t,r);if(i)return i;var s=Object.keys(r),a=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),R(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(T(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(O(r))return t.stylize(Date.prototype.toString.call(r),"date");if(R(r))return p(r)}var c,f="",v=!1,S=["{","}"];return d(r)&&(v=!0,S=["[","]"]),T(r)&&(f=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(f=" "+RegExp.prototype.toString.call(r)),O(r)&&(f=" "+Date.prototype.toUTCString.call(r)),R(r)&&(f=" "+p(r)),0!==s.length||v&&0!=r.length?n<0?E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=v?function(t,e,r,n,o){for(var i=[],s=0,a=e.length;s<a;++s)B(e,String(s))?i.push(h(t,e,r,n,String(s),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(h(t,e,r,n,o,!0))}),i}(t,r,n,a,s):s.map(function(e){return h(t,r,n,a,e,v)}),t.seen.pop(),function(t,e,r){return t.reduce(function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,f,S)):S[0]+f+S[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,o,i){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),B(n,o)||(s="["+o+"]"),a||(t.seen.indexOf(u.value)<0?(a=g(r)?l(t,u.value,null):l(t,u.value,r-1)).indexOf("\n")>-1&&(a=i?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(i&&o.match(/^\d+$/))return a;(s=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function d(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function g(t){return null===t}function m(t){return"number"==typeof t}function b(t){return"string"==typeof t}function w(t){return void 0===t}function E(t){return v(t)&&"[object RegExp]"===S(t)}function v(t){return"object"==typeof t&&null!==t}function O(t){return v(t)&&"[object Date]"===S(t)}function R(t){return v(t)&&("[object Error]"===S(t)||t instanceof Error)}function T(t){return"function"==typeof t}function S(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(w(s)&&(s=n.env.NODE_DEBUG||""),t=t.toUpperCase(),!a[t])if(new RegExp("\\b"+t+"\\b","i").test(s)){var r=n.pid;a[t]=function(){var n=e.format.apply(e,arguments);o.error("%s %d: %s",t,r,n)}}else a[t]=function(){};return a[t]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=y,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=b,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=w,e.isRegExp=E,e.isObject=v,e.isDate=O,e.isError=R,e.isFunction=T,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(272);var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;o.log("%s - %s",(r=[A((t=new Date).getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":"),[t.getDate(),_[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(835),e._extend=function(t,e){if(!e||!v(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}},272:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},300:(t,e,r)=>{"use strict";var n=r(513);function o(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0}function i(t){return r.g.Buffer&&"function"==typeof r.g.Buffer.isBuffer?r.g.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var s=r(966),a=Object.prototype.hasOwnProperty,u=Array.prototype.slice,c="foo"===function(){}.name;function f(t){return Object.prototype.toString.call(t)}function l(t){return!i(t)&&"function"==typeof r.g.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer)))}var p=t.exports=b,h=/\s*function\s+([^\(\s]*)\s*/;function d(t){if(s.isFunction(t)){if(c)return t.name;var e=t.toString().match(h);return e&&e[1]}}function y(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function g(t){if(c||!s.isFunction(t))return s.inspect(t);var e=d(t);return"[Function"+(e?": "+e:"")+"]"}function m(t,e,r,n,o){throw new p.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:o})}function b(t,e){t||m(t,!0,e,"==",p.ok)}function w(t,e,r,n){if(t===e)return!0;if(i(t)&&i(e))return 0===o(t,e);if(s.isDate(t)&&s.isDate(e))return t.getTime()===e.getTime();if(s.isRegExp(t)&&s.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(l(t)&&l(e)&&f(t)===f(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===o(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;var a=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==a&&a===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(s.isPrimitive(t)||s.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var o=E(t),i=E(e);if(o&&!i||!o&&i)return!1;if(o)return w(t=u.call(t),e=u.call(e),r);var a,c,f=R(t),l=R(e);if(f.length!==l.length)return!1;for(f.sort(),l.sort(),c=f.length-1;c>=0;c--)if(f[c]!==l[c])return!1;for(c=f.length-1;c>=0;c--)if(!w(t[a=f[c]],e[a],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function E(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function v(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function O(t,e,r,n){var o;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),o=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!o&&m(o,r,"Missing expected exception"+n);var i="string"==typeof n,a=!t&&o&&!r;if((!t&&s.isError(o)&&i&&v(o,r)||a)&&m(o,r,"Got unwanted exception"+n),t&&o&&r&&!v(o,r)||!t&&o)throw o}p.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return y(g(t.actual),128)+" "+t.operator+" "+y(g(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,o=d(e),i=n.indexOf("\n"+o);if(i>=0){var s=n.indexOf("\n",i+1);n=n.substring(s+1)}this.stack=n}}},s.inherits(p.AssertionError,Error),p.fail=m,p.ok=b,p.equal=function(t,e,r){t!=e&&m(t,e,r,"==",p.equal)},p.notEqual=function(t,e,r){t==e&&m(t,e,r,"!=",p.notEqual)},p.deepEqual=function(t,e,r){w(t,e,!1)||m(t,e,r,"deepEqual",p.deepEqual)},p.deepStrictEqual=function(t,e,r){w(t,e,!0)||m(t,e,r,"deepStrictEqual",p.deepStrictEqual)},p.notDeepEqual=function(t,e,r){w(t,e,!1)&&m(t,e,r,"notDeepEqual",p.notDeepEqual)},p.notDeepStrictEqual=function t(e,r,n){w(e,r,!0)&&m(e,r,n,"notDeepStrictEqual",t)},p.strictEqual=function(t,e,r){t!==e&&m(t,e,r,"===",p.strictEqual)},p.notStrictEqual=function(t,e,r){t===e&&m(t,e,r,"!==",p.notStrictEqual)},p.throws=function(t,e,r){O(!0,t,e,r)},p.doesNotThrow=function(t,e,r){O(!1,t,e,r)},p.ifError=function(t){if(t)throw t},p.strict=n(function t(e,r){e||m(e,!0,r,"==",t)},p,{equal:p.strictEqual,deepEqual:p.deepStrictEqual,notEqual:p.notStrictEqual,notDeepEqual:p.notDeepStrictEqual}),p.strict.strict=p.strict;var R=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}},318:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?o-1:0,p=r?-1:1,h=t[e+l];for(l+=p,i=h&(1<<-f)-1,h>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=p,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=p,f-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=c}return(h?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?p/u:p*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[r+h]=255&a,h+=d,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[r+h]=255&s,h+=d,s/=256,c-=8);t[r+h-d]|=128*y}},321:t=>{"use strict";t.exports=require("ethers")},330:(t,e,r)=>{"use strict";var n=r(486).hp;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.length,r=e%4;if(!r)return t;var o=e,i=4-r,s=e+i,a=n.alloc(s);for(a.write(t);i--;)a.write("=",o++);return a.toString()}},364:(t,e,r)=>{var n=r(208),o=r(300);function i(){return(new Date).getTime()}var s,a=Array.prototype.slice,u={};s=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){s.log.apply(s,arguments)},"info"],[function(){s.log.apply(s,arguments)},"warn"],[function(){s.warn.apply(s,arguments)},"error"],[function(t){u[t]=i()},"time"],[function(t){var e=u[t];if(!e)throw new Error("No such label: "+t);delete u[t];var r=i()-e;s.log(t+": "+r+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=n.format.apply(null,arguments),s.error(t.stack)},"trace"],[function(t){s.log(n.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=a.call(arguments,1);o.ok(!1,n.format.apply(null,e))}},"assert"]],f=0;f<c.length;f++){var l=c[f],p=l[0],h=l[1];s[h]||(s[h]=p)}t.exports=s},425:(t,e,r)=>{"use strict";var n=r(907),o=r(486).hp,i=r(364);function s(t,e){return function(){return t.apply(e,arguments)}}const{toString:a}=Object.prototype,{getPrototypeOf:u}=Object,{iterator:c,toStringTag:f}=Symbol,l=(p=Object.create(null),t=>{const e=a.call(t);return p[e]||(p[e]=e.slice(8,-1).toLowerCase())});var p;const h=t=>(t=t.toLowerCase(),e=>l(e)===t),d=t=>e=>typeof e===t,{isArray:y}=Array,g=d("undefined"),m=h("ArrayBuffer"),b=d("string"),w=d("function"),E=d("number"),v=t=>null!==t&&"object"==typeof t,O=t=>{if("object"!==l(t))return!1;const e=u(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||f in t||c in t)},R=h("Date"),T=h("File"),S=h("Blob"),A=h("FileList"),_=h("URLSearchParams"),[B,x,U,j]=["ReadableStream","Request","Response","Headers"].map(h);function N(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),y(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let s;for(n=0;n<i;n++)s=o[n],e.call(null,t[s],s,t)}}function C(t,e){e=e.toLowerCase();const r=Object.keys(t);let n,o=r.length;for(;o-- >0;)if(n=r[o],e===n.toLowerCase())return n;return null}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,L=t=>!g(t)&&t!==I,D=(P="undefined"!=typeof Uint8Array&&u(Uint8Array),t=>P&&t instanceof P);var P;const k=h("HTMLFormElement"),F=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),q=h("RegExp"),M=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};N(r,(r,o)=>{let i;!1!==(i=e(r,o,t))&&(n[o]=i||r)}),Object.defineProperties(t,n)},z=h("AsyncFunction"),$=(H="function"==typeof setImmediate,J=w(I.postMessage),H?setImmediate:J?(G=`axios@${Math.random()}`,V=[],I.addEventListener("message",({source:t,data:e})=>{t===I&&e===G&&V.length&&V.shift()()},!1),t=>{V.push(t),I.postMessage(G,"*")}):t=>setTimeout(t));var H,J,G,V;const K="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):void 0!==n&&n.nextTick||$;var W={isArray:y,isArrayBuffer:m,isBuffer:function(t){return null!==t&&!g(t)&&null!==t.constructor&&!g(t.constructor)&&w(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||w(t.append)&&("formdata"===(e=l(t))||"object"===e&&w(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&m(t.buffer),e},isString:b,isNumber:E,isBoolean:t=>!0===t||!1===t,isObject:v,isPlainObject:O,isReadableStream:B,isRequest:x,isResponse:U,isHeaders:j,isUndefined:g,isDate:R,isFile:T,isBlob:S,isRegExp:q,isFunction:w,isStream:t=>v(t)&&w(t.pipe),isURLSearchParams:_,isTypedArray:D,isFileList:A,forEach:N,merge:function t(){const{caseless:e}=L(this)&&this||{},r={},n=(n,o)=>{const i=e&&C(r,o)||o;O(r[i])&&O(n)?r[i]=t(r[i],n):O(n)?r[i]=t({},n):y(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&N(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(N(e,(e,n)=>{r&&w(e)?t[n]=s(e,r):t[n]=e},{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,i,s;const a={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],n&&!n(s,t,e)||a[s]||(e[s]=t[s],a[s]=!0);t=!1!==r&&u(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:l,kindOfTest:h,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(y(t))return t;let e=t.length;if(!E(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[c]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:k,hasOwnProperty:F,hasOwnProp:F,reduceDescriptors:M,freezeMethods:t=>{M(t,(e,r)=>{if(w(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];w(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach(t=>{r[t]=!0})};return y(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,r){return e.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:C,global:I,isContextDefined:L,isSpecCompliantForm:function(t){return!!(t&&w(t.append)&&"FormData"===t[f]&&t[c])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(v(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=y(t)?[]:{};return N(t,(t,e)=>{const i=r(t,n+1);!g(i)&&(o[e]=i)}),e[n]=void 0,o}}return t};return r(t,0)},isAsyncFn:z,isThenable:t=>t&&(v(t)||w(t))&&w(t.then)&&w(t.catch),setImmediate:$,asap:K,isIterable:t=>null!=t&&w(t[c])};function Y(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}W.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:W.toJSONObject(this.config),code:this.code,status:this.status}}});const X=Y.prototype,Z={};function Q(t){return W.isPlainObject(t)||W.isArray(t)}function tt(t){return W.endsWith(t,"[]")?t.slice(0,-2):t}function et(t,e,r){return t?t.concat(e).map(function(t,e){return t=tt(t),!r&&e?"["+t+"]":t}).join(r?".":""):e}["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(t=>{Z[t]={value:t}}),Object.defineProperties(Y,Z),Object.defineProperty(X,"isAxiosError",{value:!0}),Y.from=(t,e,r,n,o,i)=>{const s=Object.create(X);return W.toFlatObject(t,s,function(t){return t!==Error.prototype},t=>"isAxiosError"!==t),Y.call(s,t.message,e,r,n,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const rt=W.toFlatObject(W,{},null,function(t){return/^is[A-Z]/.test(t)});function nt(t,e,r){if(!W.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=W.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!W.isUndefined(e[t])})).metaTokens,i=r.visitor||f,s=r.dots,a=r.indexes,u=(r.Blob||"undefined"!=typeof Blob&&Blob)&&W.isSpecCompliantForm(e);if(!W.isFunction(i))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(W.isDate(t))return t.toISOString();if(W.isBoolean(t))return t.toString();if(!u&&W.isBlob(t))throw new Y("Blob is not supported. Use a Buffer instead.");return W.isArrayBuffer(t)||W.isTypedArray(t)?u&&"function"==typeof Blob?new Blob([t]):o.from(t):t}function f(t,r,o){let i=t;if(t&&!o&&"object"==typeof t)if(W.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(W.isArray(t)&&function(t){return W.isArray(t)&&!t.some(Q)}(t)||(W.isFileList(t)||W.endsWith(r,"[]"))&&(i=W.toArray(t)))return r=tt(r),i.forEach(function(t,n){!W.isUndefined(t)&&null!==t&&e.append(!0===a?et([r],n,s):null===a?r:r+"[]",c(t))}),!1;return!!Q(t)||(e.append(et(o,r,s),c(t)),!1)}const l=[],p=Object.assign(rt,{defaultVisitor:f,convertValue:c,isVisitable:Q});if(!W.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!W.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),W.forEach(r,function(r,o){!0===(!(W.isUndefined(r)||null===r)&&i.call(e,r,W.isString(o)?o.trim():o,n,p))&&t(r,n?n.concat(o):[o])}),l.pop()}}(t),e}function ot(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function it(t,e){this._pairs=[],t&&nt(t,this,e)}const st=it.prototype;function at(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ut(t,e,r){if(!e)return t;const n=r&&r.encode||at;W.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(i=o?o(e,r):W.isURLSearchParams(e)?e.toString():new it(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}st.append=function(t,e){this._pairs.push([t,e])},st.toString=function(t){const e=t?function(e){return t.call(this,e,ot)}:ot;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};var ct=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,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){W.forEach(this.handlers,function(e){null!==e&&t(e)})}},ft={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},lt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:it,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const pt="undefined"!=typeof window&&"undefined"!=typeof document,ht="object"==typeof navigator&&navigator||void 0,dt=pt&&(!ht||["ReactNative","NativeScript","NS"].indexOf(ht.product)<0),yt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,gt=pt&&window.location.href||"http://localhost";var mt={...Object.freeze({__proto__:null,hasBrowserEnv:pt,hasStandardBrowserWebWorkerEnv:yt,hasStandardBrowserEnv:dt,navigator:ht,origin:gt}),...lt};function bt(t){function e(t,r,n,o){let i=t[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=t.length;return i=!i&&W.isArray(n)?n.length:i,a?(W.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!s):(n[i]&&W.isObject(n[i])||(n[i]=[]),e(t,r,n[i],o)&&W.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}(n[i])),!s)}if(W.isFormData(t)&&W.isFunction(t.entries)){const r={};return W.forEachEntry(t,(t,n)=>{e(function(t){return W.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0])}(t),n,r,0)}),r}return null}const wt={transitional:ft,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=W.isObject(t);if(o&&W.isHTMLForm(t)&&(t=new FormData(t)),W.isFormData(t))return n?JSON.stringify(bt(t)):t;if(W.isArrayBuffer(t)||W.isBuffer(t)||W.isStream(t)||W.isFile(t)||W.isBlob(t)||W.isReadableStream(t))return t;if(W.isArrayBufferView(t))return t.buffer;if(W.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return nt(t,new mt.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return mt.isNode&&W.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=W.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return nt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t){if(W.isString(t))try{return(0,JSON.parse)(t),W.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||wt.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(W.isResponse(t)||W.isReadableStream(t))return t;if(t&&W.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw Y.from(t,Y.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:mt.classes.FormData,Blob:mt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};W.forEach(["delete","get","head","post","put","patch"],t=>{wt.headers[t]={}});var Et=wt;const vt=W.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"]),Ot=Symbol("internals");function Rt(t){return t&&String(t).trim().toLowerCase()}function Tt(t){return!1===t||null==t?t:W.isArray(t)?t.map(Tt):String(t)}function St(t,e,r,n,o){return W.isFunction(n)?n.call(this,e,r):(o&&(e=r),W.isString(e)?W.isString(n)?-1!==e.indexOf(n):W.isRegExp(n)?n.test(e):void 0:void 0)}class At{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=Rt(e);if(!o)throw new Error("header name must be a non-empty string");const i=W.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=Tt(t))}const i=(t,e)=>W.forEach(t,(t,r)=>o(t,r,e));if(W.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(W.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach(function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&vt[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e})(t),e);else if(W.isObject(t)&&W.isIterable(t)){let r,n,o={};for(const e of t){if(!W.isArray(e))throw TypeError("Object iterator must return a key-value pair");o[n=e[0]]=(r=o[n])?W.isArray(r)?[...r,e[1]]:[r,e[1]]:e[1]}i(o,e)}else null!=t&&o(e,t,r);return this}get(t,e){if(t=Rt(t)){const r=W.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(W.isFunction(e))return e.call(this,t,r);if(W.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Rt(t)){const r=W.findKey(this,t);return!(!r||void 0===this[r]||e&&!St(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=Rt(t)){const o=W.findKey(r,t);!o||e&&!St(0,r[o],o,e)||(delete r[o],n=!0)}}return W.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const o=e[r];t&&!St(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return W.forEach(this,(n,o)=>{const i=W.findKey(r,o);if(i)return e[i]=Tt(n),void delete e[o];const s=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,r)=>e.toUpperCase()+r)}(o):String(o).trim();s!==o&&delete e[o],e[s]=Tt(n),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return W.forEach(this,(r,n)=>{null!=r&&!1!==r&&(e[n]=t&&W.isArray(r)?r.join(", "):r)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join("\n")}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,...e){const r=new this(t);return e.forEach(t=>r.set(t)),r}static accessor(t){const e=(this[Ot]=this[Ot]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=Rt(t);e[n]||(function(t,e){const r=W.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})})}(r,t),e[n]=!0)}return W.isArray(t)?t.forEach(n):n(t),this}}At.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),W.reduceDescriptors(At.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}}),W.freezeMethods(At);var _t=At;function Bt(t,e){const r=this||Et,n=e||r,o=_t.from(n.headers);let i=n.data;return W.forEach(t,function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function xt(t){return!(!t||!t.__CANCEL__)}function Ut(t,e,r){Y.call(this,null==t?"canceled":t,Y.ERR_CANCELED,e,r),this.name="CanceledError"}function jt(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new Y("Request failed with status code "+r.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}W.inherits(Ut,Y,{__CANCEL__:!0});const Nt=(t,e,r=3)=>{let n=0;const o=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,s=0;return e=void 0!==e?e:1e3,function(a){const u=Date.now(),c=n[s];o||(o=u),r[i]=a,n[i]=u;let f=s,l=0;for(;f!==i;)l+=r[f++],f%=t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),u-o<e)return;const p=c&&u-c;return p?Math.round(1e3*l/p):void 0}}(50,250);return function(t,e){let r,n,o=0,i=1e3/e;const s=(e,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),a=e-o;a>=i?s(t,e):(r=t,n||(n=setTimeout(()=>{n=null,s(r)},i-a)))},()=>r&&s(r)]}(r=>{const i=r.loaded,s=r.lengthComputable?r.total:void 0,a=i-n,u=o(a);n=i,t({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&i<=s?(s-i)/u:void 0,event:r,lengthComputable:null!=s,[e?"download":"upload"]:!0})},r)},Ct=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},It=t=>(...e)=>W.asap(()=>t(...e));var Lt=mt.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,mt.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(mt.origin),mt.navigator&&/(msie|trident)/i.test(mt.navigator.userAgent)):()=>!0,Dt=mt.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const s=[t+"="+encodeURIComponent(e)];W.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),W.isString(n)&&s.push("path="+n),W.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Pt(t,e,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(n||0==r)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const kt=t=>t instanceof _t?{...t}:t;function Ft(t,e){e=e||{};const r={};function n(t,e,r,n){return W.isPlainObject(t)&&W.isPlainObject(e)?W.merge.call({caseless:n},t,e):W.isPlainObject(e)?W.merge({},e):W.isArray(e)?e.slice():e}function o(t,e,r,o){return W.isUndefined(e)?W.isUndefined(t)?void 0:n(void 0,t,0,o):n(t,e,0,o)}function i(t,e){if(!W.isUndefined(e))return n(void 0,e)}function s(t,e){return W.isUndefined(e)?W.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function a(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(t,e,r)=>o(kt(t),kt(e),0,!0)};return W.forEach(Object.keys(Object.assign({},t,e)),function(n){const i=u[n]||o,s=i(t[n],e[n],n);W.isUndefined(s)&&i!==a||(r[n]=s)}),r}var qt=t=>{const e=Ft({},t);let r,{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:u}=e;if(e.headers=a=_t.from(a),e.url=ut(Pt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),u&&a.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),W.isFormData(n))if(mt.hasStandardBrowserEnv||mt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(r=a.getContentType())){const[t,...e]=r?r.split(";").map(t=>t.trim()).filter(Boolean):[];a.setContentType([t||"multipart/form-data",...e].join("; "))}if(mt.hasStandardBrowserEnv&&(o&&W.isFunction(o)&&(o=o(e)),o||!1!==o&&Lt(e.url))){const t=i&&s&&Dt.read(s);t&&a.set(i,t)}return e},Mt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise(function(e,r){const n=qt(t);let o=n.data;const i=_t.from(n.headers).normalize();let s,a,u,c,f,{responseType:l,onUploadProgress:p,onDownloadProgress:h}=n;function d(){c&&c(),f&&f(),n.cancelToken&&n.cancelToken.unsubscribe(s),n.signal&&n.signal.removeEventListener("abort",s)}let y=new XMLHttpRequest;function g(){if(!y)return;const n=_t.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());jt(function(t){e(t),d()},function(t){r(t),d()},{data:l&&"text"!==l&&"json"!==l?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:t,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(g)},y.onabort=function(){y&&(r(new Y("Request aborted",Y.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new Y("Network Error",Y.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||ft;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new Y(e,o.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,t,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&W.forEach(i.toJSON(),function(t,e){y.setRequestHeader(e,t)}),W.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),l&&"json"!==l&&(y.responseType=n.responseType),h&&([u,f]=Nt(h,!0),y.addEventListener("progress",u)),p&&y.upload&&([a,c]=Nt(p),y.upload.addEventListener("progress",a),y.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(s=e=>{y&&(r(!e||e.type?new Ut(null,t,y):e),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(s),n.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s)));const m=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);m&&-1===mt.protocols.indexOf(m)?r(new Y("Unsupported protocol "+m+":",Y.ERR_BAD_REQUEST,t)):y.send(o||null)})},zt=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const o=function(t){if(!r){r=!0,s();const e=t instanceof Error?t:this.reason;n.abort(e instanceof Y?e:new Ut(e instanceof Error?e.message:e))}};let i=e&&setTimeout(()=>{i=null,o(new Y(`timeout ${e} of ms exceeded`,Y.ETIMEDOUT))},e);const s=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}),t=null)};t.forEach(t=>t.addEventListener("abort",o));const{signal:a}=n;return a.unsubscribe=()=>W.asap(s),a}};const $t=function*(t,e){let r=t.byteLength;if(!e||r<e)return void(yield t);let n,o=0;for(;o<r;)n=o+e,yield t.slice(o,n),o=n},Ht=(t,e,r,n)=>{const o=async function*(t,e){for await(const r of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}}(t))yield*$t(r,e)}(t,e);let i,s=0,a=t=>{i||(i=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await o.next();if(e)return a(),void t.close();let i=n.byteLength;if(r){let t=s+=i;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw a(t),t}},cancel:t=>(a(t),o.return())},{highWaterMark:2})},Jt="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Gt=Jt&&"function"==typeof ReadableStream,Vt=Jt&&("function"==typeof TextEncoder?(Kt=new TextEncoder,t=>Kt.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var Kt;const Wt=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Yt=Gt&&Wt(()=>{let t=!1;const e=new Request(mt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Xt=Gt&&Wt(()=>W.isReadableStream(new Response("").body)),Zt={stream:Xt&&(t=>t.body)};var Qt;Jt&&(Qt=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Zt[t]&&(Zt[t]=W.isFunction(Qt[t])?e=>e[t]():(e,r)=>{throw new Y(`Response type '${t}' is not supported`,Y.ERR_NOT_SUPPORT,r)})}));const te={http:null,xhr:Mt,fetch:Jt&&(async t=>{let{url:e,method:r,data:n,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:u,responseType:c,headers:f,withCredentials:l="same-origin",fetchOptions:p}=qt(t);c=c?(c+"").toLowerCase():"text";let h,d=zt([o,i&&i.toAbortSignal()],s);const y=d&&d.unsubscribe&&(()=>{d.unsubscribe()});let g;try{if(u&&Yt&&"get"!==r&&"head"!==r&&0!==(g=await(async(t,e)=>{const r=W.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(W.isBlob(t))return t.size;if(W.isSpecCompliantForm(t)){const e=new Request(mt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return W.isArrayBufferView(t)||W.isArrayBuffer(t)?t.byteLength:(W.isURLSearchParams(t)&&(t+=""),W.isString(t)?(await Vt(t)).byteLength:void 0)})(e):r})(f,n))){let t,r=new Request(e,{method:"POST",body:n,duplex:"half"});if(W.isFormData(n)&&(t=r.headers.get("content-type"))&&f.setContentType(t),r.body){const[t,e]=Ct(g,Nt(It(u)));n=Ht(r.body,65536,t,e)}}W.isString(l)||(l=l?"include":"omit");const o="credentials"in Request.prototype;h=new Request(e,{...p,signal:d,method:r.toUpperCase(),headers:f.normalize().toJSON(),body:n,duplex:"half",credentials:o?l:void 0});let i=await fetch(h,p);const s=Xt&&("stream"===c||"response"===c);if(Xt&&(a||s&&y)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=i[e]});const e=W.toFiniteNumber(i.headers.get("content-length")),[r,n]=a&&Ct(e,Nt(It(a),!0))||[];i=new Response(Ht(i.body,65536,r,()=>{n&&n(),y&&y()}),t)}c=c||"text";let m=await Zt[W.findKey(Zt,c)||"text"](i,t);return!s&&y&&y(),await new Promise((e,r)=>{jt(e,r,{data:m,headers:_t.from(i.headers),status:i.status,statusText:i.statusText,config:t,request:h})})}catch(e){if(y&&y(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new Y("Network Error",Y.ERR_NETWORK,t,h),{cause:e.cause||e});throw Y.from(e,e&&e.code,t,h)}})};W.forEach(te,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}});const ee=t=>`- ${t}`,re=t=>W.isFunction(t)||null===t||!1===t;var ne=t=>{t=W.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let i=0;i<e;i++){let e;if(r=t[i],n=r,!re(r)&&(n=te[(e=String(r)).toLowerCase()],void 0===n))throw new Y(`Unknown adapter '${e}'`);if(n)break;o[e||"#"+i]=n}if(!n){const t=Object.entries(o).map(([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build"));throw new Y("There is no suitable adapter to dispatch the request "+(e?t.length>1?"since :\n"+t.map(ee).join("\n"):" "+ee(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function oe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ut(null,t)}function ie(t){return oe(t),t.headers=_t.from(t.headers),t.data=Bt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ne(t.adapter||Et.adapter)(t).then(function(e){return oe(t),e.data=Bt.call(t,t.transformResponse,e),e.headers=_t.from(e.headers),e},function(e){return xt(e)||(oe(t),e&&e.response&&(e.response.data=Bt.call(t,t.transformResponse,e.response),e.response.headers=_t.from(e.response.headers))),Promise.reject(e)})}const se="1.10.0",ae={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ae[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const ue={};ae.transitional=function(t,e,r){function n(t,e){return"[Axios v"+se+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,o,s)=>{if(!1===t)throw new Y(n(o," has been removed"+(e?" in "+e:"")),Y.ERR_DEPRECATED);return e&&!ue[o]&&(ue[o]=!0,i.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,s)}},ae.spelling=function(t){return(e,r)=>(i.warn(`${r} is likely a misspelling of ${t}`),!0)};var ce={assertOptions:function(t,e,r){if("object"!=typeof t)throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],s=e[i];if(s){const e=t[i],r=void 0===e||s(e,i,t);if(!0!==r)throw new Y("option "+i+" must be "+r,Y.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new Y("Unknown option "+i,Y.ERR_BAD_OPTION)}},validators:ae};const fe=ce.validators;class le{constructor(t){this.defaults=t||{},this.interceptors={request:new ct,response:new ct}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Ft(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;void 0!==r&&ce.assertOptions(r,{silentJSONParsing:fe.transitional(fe.boolean),forcedJSONParsing:fe.transitional(fe.boolean),clarifyTimeoutError:fe.transitional(fe.boolean)},!1),null!=n&&(W.isFunction(n)?e.paramsSerializer={serialize:n}:ce.assertOptions(n,{encode:fe.function,serialize:fe.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),ce.assertOptions(e,{baseUrl:fe.spelling("baseURL"),withXsrfToken:fe.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&W.merge(o.common,o[e.method]);o&&W.forEach(["delete","get","head","post","put","patch","common"],t=>{delete o[t]}),e.headers=_t.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,s.unshift(t.fulfilled,t.rejected))});const u=[];let c;this.interceptors.response.forEach(function(t){u.push(t.fulfilled,t.rejected)});let f,l=0;if(!a){const t=[ie.bind(this),void 0];for(t.unshift.apply(t,s),t.push.apply(t,u),f=t.length,c=Promise.resolve(e);l<f;)c=c.then(t[l++],t[l++]);return c}f=s.length;let p=e;for(l=0;l<f;){const t=s[l++],e=s[l++];try{p=t(p)}catch(t){e.call(this,t);break}}try{c=ie.call(this,p)}catch(t){return Promise.reject(t)}for(l=0,f=u.length;l<f;)c=c.then(u[l++],u[l++]);return c}getUri(t){return ut(Pt((t=Ft(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}W.forEach(["delete","get","head","options"],function(t){le.prototype[t]=function(e,r){return this.request(Ft(r||{},{method:t,url:e,data:(r||{}).data}))}}),W.forEach(["post","put","patch"],function(t){function e(e){return function(r,n,o){return this.request(Ft(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}le.prototype[t]=e(),le.prototype[t+"Form"]=e(!0)});var pe=le;class he{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(t){e=t});const r=this;this.promise.then(t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null}),this.promise.then=t=>{let e;const n=new Promise(t=>{r.subscribe(t),e=t}).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t(function(t,n,o){r.reason||(r.reason=new Ut(t,n,o),e(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe