@huddle01/auth
Version:
Huddle01 Web Token Gating Library
1 lines • 114 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).HuddleWebClient={})}(this,(function(e){"use strict";function t(){t=function(){return e};var e={},r=Object.prototype,n=r.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),o=new T(n||[]);return s(a,"_invoke",{value:x(e,r,o)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f={};function p(){}function h(){}function m(){}var y={};c(y,a,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==r&&n.call(v,a)&&(y=v);var _=m.prototype=p.prototype=Object.create(y);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function r(s,i,a,o){var u=d(e[s],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,o)}),(function(e){r("throw",e,a,o)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,o)}))}o(u.arg)}var i;s(this,"_invoke",{value:function(e,n){function s(){return new t((function(t,s){r(e,n,t,s)}))}return i=i?i.then(s,s):s()}})}function x(e,t,r){var n="suspendedStart";return function(s,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===s)throw i;return j()}for(r.method=s,r.arg=i;;){var a=r.delegate;if(a){var o=k(a,r);if(o){if(o===f)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=d(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function k(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var s=d(n,e.iterator,t.arg);if("throw"===s.type)return t.method="throw",t.arg=s.arg,t.delegate=null,f;var i=s.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function S(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,s=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return s.next=s}}return{next:j}}function j(){return{value:void 0,done:!0}}return h.prototype=m,s(_,"constructor",{value:m,configurable:!0}),s(m,"constructor",{value:h,configurable:!0}),h.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,u,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},b(w.prototype),c(w.prototype,o,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,s,i){void 0===i&&(i=Promise);var a=new w(l(t,r,n,s),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(_),c(_,u,"Generator"),c(_,a,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=S,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var s=this.tryEntries.length-1;s>=0;--s){var i=this.tryEntries[s],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var o=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(o&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&n.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var i=s;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var s=n.arg;E(r)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function r(e,t,r,n,s,i,a){try{var o=e[i](a),u=o.value}catch(e){return void r(e)}o.done?t(u):Promise.resolve(u).then(n,s)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(s,i){var a=e.apply(t,n);function o(e){r(a,s,i,o,u,"next",e)}function u(e){r(a,s,i,o,u,"throw",e)}o(void 0)}))}}function s(e){return e}function i(e){const t={subscribe(t){let r=null,n=!1,s=!1,i=!1;function a(){null!==r?s||(s=!0,"function"==typeof r?r():r&&r.unsubscribe()):i=!0}return r=e({next(e){n||t.next?.(e)},error(e){n||(n=!0,t.error?.(e),a())},complete(){n||(n=!0,t.complete?.(),a())}}),i&&a(),{unsubscribe:a}},pipe(...e){return(0===(r=e).length?s:1===r.length?r[0]:function(e){return r.reduce(((e,t)=>t(e)),e)})(t);var r}};return t}function a(e){return e=>{let t=0,r=null;const n=[];return{subscribe:s=>(t++,n.push(s),r||(r=e.subscribe({next(e){for(const t of n)t.next?.(e)},error(e){for(const t of n)t.error?.(e)},complete(){for(const e of n)e.complete?.()}})),{unsubscribe(){t--,function(){if(0===t&&r){const e=r;r=null,e.unsubscribe()}}();const e=n.findIndex((e=>e===s));e>-1&&n.splice(e,1)}})}}}class o extends Error{constructor(e){super(e),this.name="ObservableAbortError",Object.setPrototypeOf(this,o.prototype)}}class u extends Error{static from(e,t={}){return e instanceof Error?"TRPCClientError"===e.name?e:new u(e.message,{...t,cause:e,result:null}):new u(e.error.message??"",{...t,cause:void 0,result:e})}constructor(e,t){const r=t?.cause;super(e,{cause:r}),this.meta=t?.meta,this.cause=r,this.shape=t?.result?.error,this.data=t?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,u.prototype)}}function c(e){return!!e&&!Array.isArray(e)&&"object"==typeof e}const l=()=>{};function d(e,t){return new Proxy(l,{get(r,n){if("string"==typeof n&&"then"!==n)return d(e,[...t,n])},apply:(r,n,s)=>e({args:s,path:t})})}const f=e=>d(e,[]),p=e=>new Proxy(l,{get(t,r){if("string"==typeof r&&"then"!==r)return e(r)}});function h(){return window}function m(e){if(e)return e;const t=h(),r=t.fetch;if(r)return"function"==typeof r.bind?r.bind(t):r;throw new Error("No fetch implementation found")}const y={query:"GET",mutation:"POST"};function g(e){return"input"in e?e.runtime.transformer.serialize(e.input):function(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[r]=n}return t}(e.inputs.map((t=>e.runtime.transformer.serialize(t))))}function v(e){let t=e.url+"/"+e.path;const r=[];if("inputs"in e&&r.push("batch=1"),"query"===e.type){const t=g(e);void 0!==t&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(t+="?"+r.join("&")),t}function _(e){const{type:t}=e,r=e.AbortController?new e.AbortController:null;return{promise:new Promise(((n,s)=>{const i=v(e),a=function(e){if("query"===e.type)return;const t=g(e);return void 0!==t?JSON.stringify(t):void 0}(e),o={};Promise.resolve(e.headers()).then((n=>{if("subscription"===t)throw new Error("Subscriptions should use wsLink");return e.fetch(i,{method:y[t],signal:r?.signal,body:a,headers:{"content-type":"application/json",...n}})})).then((e=>(o.response=e,e.json()))).then((e=>{n({json:e,meta:o})})).catch(s)})),cancel:()=>{r?.abort()}}}const b=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function w(e){let t=null,r=null;const n=()=>{clearTimeout(r),r=null,t=null};function s(){const r=function(t){const r=[[]];let n=0;for(;;){const s=t[n];if(!s)break;const i=r[r.length-1];s.aborted?(s.reject(new Error("Aborted")),n++):e.validate(i.concat(s).map((e=>e.key)))?(i.push(s),n++):0!==i.length?r.push([]):(s.reject(new Error("Input is too big for a single dispatch")),n++)}return r}(t);n();for(const t of r){if(!t.length)continue;const r={items:t,cancel:b};for(const e of t)e.batch=r;const{promise:n,cancel:s}=e.fetch(r.items.map((e=>e.key)));r.cancel=s,n.then((e=>{for(let t=0;t<e.length;t++){const n=e[t],s=r.items[t];s.resolve(n),s.batch=null}})).catch((e=>{for(const t of r.items)t.reject(e),t.batch=null}))}}return{load:function(e){const n={aborted:!1,key:e,batch:null,resolve:b,reject:b},i=new Promise(((e,r)=>{n.reject=r,n.resolve=e,t||(t=[]),t.push(n)}));return r||(r=setTimeout(s)),{promise:i,cancel:()=>{n.aborted=!0,n.batch?.items.every((e=>e.aborted))&&(n.batch.cancel(),n.batch=null)}}}}}class x{$request({type:e,input:t,path:r,context:n={}}){var s;return(s={links:this.links,op:{id:++this.requestId,type:e,path:r,input:t,context:n}},i((e=>function e(t=0,r=s.op){const n=s.links[t];if(!n)throw new Error("No more links to execute - did you forget to add an ending link?");return n({op:r,next:r=>e(t+1,r)})}().subscribe(e)))).pipe(a())}requestAsPromise(e){const t=this.$request(e),{promise:r,abort:n}=function(e){let t;return{promise:new Promise(((r,n)=>{let s=!1;function i(){s||(s=!0,n(new o("This operation was aborted.")),a.unsubscribe())}const a=e.subscribe({next(e){s=!0,r(e),i()},error(e){s=!0,n(e),i()},complete(){s=!0,i()}});t=i})),abort:t}}(t);return new Promise(((t,s)=>{e.signal?.addEventListener("abort",n),r.then((e=>{t(e.result.data)})).catch((e=>{s(u.from(e))}))}))}query(e,t,r){return this.requestAsPromise({type:"query",path:e,input:t,context:r?.context,signal:r?.signal})}mutation(e,t,r){return this.requestAsPromise({type:"mutation",path:e,input:t,context:r?.context,signal:r?.signal})}subscription(e,t,r){return this.$request({type:"subscription",path:e,input:t,context:r?.context}).subscribe({next(e){"started"===e.result.type?r.onStarted?.():"stopped"===e.result.type?r.onStopped?.():r.onData?.(e.result.data)},error(e){r.onError?.(e)},complete(){r.onComplete?.()}})}constructor(e){this.requestId=0,this.runtime={transformer:function(){const t=e.transformer;return t?"input"in t?{serialize:t.input.serialize,deserialize:t.output.deserialize}:t:{serialize:e=>e,deserialize:e=>e}}()},this.links=e.links.map((e=>e(this.runtime)))}}const k={query:"query",mutate:"mutation",subscribe:"subscription"};function O(e,t){return function(){return e.apply(t,arguments)}}const{toString:E}=Object.prototype,{getPrototypeOf:T}=Object,S=(j=Object.create(null),e=>{const t=E.call(e);return j[t]||(j[t]=t.slice(8,-1).toLowerCase())});var j;const N=e=>(e=e.toLowerCase(),t=>S(t)===e),A=e=>t=>typeof t===e,{isArray:R}=Array,P=A("undefined");const C=N("ArrayBuffer");const Z=A("string"),I=A("function"),L=A("number"),U=e=>null!==e&&"object"==typeof e,D=e=>{if("object"!==S(e))return!1;const t=T(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},B=N("Date"),M=N("File"),z=N("Blob"),F=N("FileList"),q=N("URLSearchParams");function V(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,s;if("object"!=typeof e&&(e=[e]),R(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{const s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(n=0;n<i;n++)a=s[n],t.call(null,e[a],a,e)}}function $(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,s=r.length;for(;s-- >0;)if(n=r[s],t===n.toLowerCase())return n;return null}const K="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:window,W=e=>!P(e)&&e!==K;const J=(H="undefined"!=typeof Uint8Array&&T(Uint8Array),e=>H&&e instanceof H);var H;const G=N("HTMLFormElement"),X=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Y=N("RegExp"),Q=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};V(r,((r,s)=>{!1!==t(r,s,e)&&(n[s]=r)})),Object.defineProperties(e,n)},ee="abcdefghijklmnopqrstuvwxyz",te="0123456789",re={DIGIT:te,ALPHA:ee,ALPHA_DIGIT:ee+ee.toUpperCase()+te};var ne={isArray:R,isArrayBuffer:C,isBuffer:function(e){return null!==e&&!P(e)&&null!==e.constructor&&!P(e.constructor)&&I(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||E.call(e)===t||I(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&C(e.buffer),t},isString:Z,isNumber:L,isBoolean:e=>!0===e||!1===e,isObject:U,isPlainObject:D,isUndefined:P,isDate:B,isFile:M,isBlob:z,isRegExp:Y,isFunction:I,isStream:e=>U(e)&&I(e.pipe),isURLSearchParams:q,isTypedArray:J,isFileList:F,forEach:V,merge:function e(){const{caseless:t}=W(this)&&this||{},r={},n=(n,s)=>{const i=t&&$(r,s)||s;D(r[i])&&D(n)?r[i]=e(r[i],n):D(n)?r[i]=e({},n):R(n)?r[i]=n.slice():r[i]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&V(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(V(t,((t,n)=>{r&&I(t)?e[n]=O(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,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)},toFlatObject:(e,t,r,n)=>{let s,i,a;const o={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],n&&!n(a,e,t)||o[a]||(t[a]=e[a],o[a]=!0);e=!1!==r&&T(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:S,kindOfTest:N,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(R(e))return e;let t=e.length;if(!L(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:G,hasOwnProperty:X,hasOwnProp:X,reduceDescriptors:Q,freezeMethods:e=>{Q(e,((t,r)=>{if(I(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];I(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return R(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:$,global:K,isContextDefined:W,ALPHABET:re,generateString:(e=16,t=re.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&I(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(U(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const s=R(e)?[]:{};return V(e,((e,t)=>{const i=r(e,n+1);!P(i)&&(s[t]=i)})),t[n]=void 0,s}}return e};return r(e,0)}};function se(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)}ne.inherits(se,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:ne.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ie=se.prototype,ae={};["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=>{ae[e]={value:e}})),Object.defineProperties(se,ae),Object.defineProperty(ie,"isAxiosError",{value:!0}),se.from=(e,t,r,n,s,i)=>{const a=Object.create(ie);return ne.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),se.call(a,e.message,t,r,n,s),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};function oe(e){return ne.isPlainObject(e)||ne.isArray(e)}function ue(e){return ne.endsWith(e,"[]")?e.slice(0,-2):e}function ce(e,t,r){return e?e.concat(t).map((function(e,t){return e=ue(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const le=ne.toFlatObject(ne,{},null,(function(e){return/^is[A-Z]/.test(e)}));function de(e,t,r){if(!ne.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=ne.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!ne.isUndefined(t[e])}))).metaTokens,s=r.visitor||c,i=r.dots,a=r.indexes,o=(r.Blob||"undefined"!=typeof Blob&&Blob)&&ne.isSpecCompliantForm(t);if(!ne.isFunction(s))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(ne.isDate(e))return e.toISOString();if(!o&&ne.isBlob(e))throw new se("Blob is not supported. Use a Buffer instead.");return ne.isArrayBuffer(e)||ne.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,s){let o=e;if(e&&!s&&"object"==typeof e)if(ne.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(ne.isArray(e)&&function(e){return ne.isArray(e)&&!e.some(oe)}(e)||(ne.isFileList(e)||ne.endsWith(r,"[]"))&&(o=ne.toArray(e)))return r=ue(r),o.forEach((function(e,n){!ne.isUndefined(e)&&null!==e&&t.append(!0===a?ce([r],n,i):null===a?r:r+"[]",u(e))})),!1;return!!oe(e)||(t.append(ce(s,r,i),u(e)),!1)}const l=[],d=Object.assign(le,{defaultVisitor:c,convertValue:u,isVisitable:oe});if(!ne.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!ne.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),ne.forEach(r,(function(r,i){!0===(!(ne.isUndefined(r)||null===r)&&s.call(t,r,ne.isString(i)?i.trim():i,n,d))&&e(r,n?n.concat(i):[i])})),l.pop()}}(e),t}function fe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function pe(e,t){this._pairs=[],e&&de(e,this,t)}const he=pe.prototype;function me(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ye(e,t,r){if(!t)return e;const n=r&&r.encode||me,s=r&&r.serialize;let i;if(i=s?s(t,r):ne.isURLSearchParams(t)?t.toString():new pe(t,r).toString(n),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}he.append=function(e,t){this._pairs.push([e,t])},he.toString=function(e){const t=e?function(t){return e.call(this,t,fe)}:fe;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ge=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ne.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var _e={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:pe,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return"undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function be(e){function t(e,r,n,s){let i=e[s++];const a=Number.isFinite(+i),o=s>=e.length;if(i=!i&&ne.isArray(n)?n.length:i,o)return ne.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a;n[i]&&ne.isObject(n[i])||(n[i]=[]);return t(e,r,n[i],s)&&ne.isArray(n[i])&&(n[i]=function(e){const t={},r=Object.keys(e);let n;const s=r.length;let i;for(n=0;n<s;n++)i=r[n],t[i]=e[i];return t}(n[i])),!a}if(ne.isFormData(e)&&ne.isFunction(e.entries)){const r={};return ne.forEachEntry(e,((e,n)=>{t(function(e){return ne.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const we={"Content-Type":void 0};const xe={transitional:ve,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,s=ne.isObject(e);s&&ne.isHTMLForm(e)&&(e=new FormData(e));if(ne.isFormData(e))return n&&n?JSON.stringify(be(e)):e;if(ne.isArrayBuffer(e)||ne.isBuffer(e)||ne.isStream(e)||ne.isFile(e)||ne.isBlob(e))return e;if(ne.isArrayBufferView(e))return e.buffer;if(ne.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return de(e,new _e.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return _e.isNode&&ne.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=ne.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return de(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||n?(t.setContentType("application/json",!1),function(e,t,r){if(ne.isString(e))try{return(t||JSON.parse)(e),ne.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||xe.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&ne.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw se.from(e,se.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_e.classes.FormData,Blob:_e.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};ne.forEach(["delete","get","head"],(function(e){xe.headers[e]={}})),ne.forEach(["post","put","patch"],(function(e){xe.headers[e]=ne.merge(we)}));var ke=xe;const Oe=ne.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"]);const Ee=Symbol("internals");function Te(e){return e&&String(e).trim().toLowerCase()}function Se(e){return!1===e||null==e?e:ne.isArray(e)?e.map(Se):String(e)}function je(e,t,r,n,s){return ne.isFunction(n)?n.call(this,t,r):(s&&(t=r),ne.isString(t)?ne.isString(n)?-1!==t.indexOf(n):ne.isRegExp(n)?n.test(t):void 0:void 0)}class Ne{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function s(e,t,r){const s=Te(t);if(!s)throw new Error("header name must be a non-empty string");const i=ne.findKey(n,s);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=Se(e))}const i=(e,t)=>ne.forEach(e,((e,r)=>s(e,r,t)));return ne.isPlainObject(e)||e instanceof this.constructor?i(e,t):ne.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?i((e=>{const t={};let r,n,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),r=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!r||t[r]&&Oe[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&s(t,e,r),this}get(e,t){if(e=Te(e)){const r=ne.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(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}(e);if(ne.isFunction(t))return t.call(this,e,r);if(ne.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Te(e)){const r=ne.findKey(this,e);return!(!r||void 0===this[r]||t&&!je(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function s(e){if(e=Te(e)){const s=ne.findKey(r,e);!s||t&&!je(0,r[s],s,t)||(delete r[s],n=!0)}}return ne.isArray(e)?e.forEach(s):s(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const s=t[r];e&&!je(0,this[s],s,e,!0)||(delete this[s],n=!0)}return n}normalize(e){const t=this,r={};return ne.forEach(this,((n,s)=>{const i=ne.findKey(r,s);if(i)return t[i]=Se(n),void delete t[s];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(s):String(s).trim();a!==s&&delete t[s],t[a]=Se(n),r[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ne.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&ne.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[Ee]=this[Ee]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Te(e);t[n]||(!function(e,t){const r=ne.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,s){return this[n].call(this,t,e,r,s)},configurable:!0})}))}(r,e),t[n]=!0)}return ne.isArray(e)?e.forEach(n):n(e),this}}Ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ne.freezeMethods(Ne.prototype),ne.freezeMethods(Ne);var Ae=Ne;function Re(e,t){const r=this||ke,n=t||r,s=Ae.from(n.headers);let i=n.data;return ne.forEach(e,(function(e){i=e.call(r,i,s.normalize(),t?t.status:void 0)})),s.normalize(),i}function Pe(e){return!(!e||!e.__CANCEL__)}function Ce(e,t,r){se.call(this,null==e?"canceled":e,se.ERR_CANCELED,t,r),this.name="CanceledError"}ne.inherits(Ce,se,{__CANCEL__:!0});var Ze=_e.isStandardBrowserEnv?{write:function(e,t,r,n,s,i){const a=[];a.push(e+"="+encodeURIComponent(t)),ne.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),ne.isString(n)&&a.push("path="+n),ne.isString(s)&&a.push("domain="+s),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Ie(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var Le=_e.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=ne.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Ue(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s,i=0,a=0;return t=void 0!==t?t:1e3,function(o){const u=Date.now(),c=n[a];s||(s=u),r[i]=o,n[i]=u;let l=a,d=0;for(;l!==i;)d+=r[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-s<t)return;const f=c&&u-c;return f?Math.round(1e3*d/f):void 0}}(50,250);return s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,o=i-r,u=n(o);r=i;const c={loaded:i,total:a,progress:a?i/a:void 0,bytes:o,rate:u||void 0,estimated:u&&a&&i<=a?(a-i)/u:void 0,event:s};c[t?"download":"upload"]=!0,e(c)}}const De={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const s=Ae.from(e.headers).normalize(),i=e.responseType;let a;function o(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}ne.isFormData(n)&&(_e.isStandardBrowserEnv||_e.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(t+":"+r))}const c=Ie(e.baseURL,e.url);function l(){if(!u)return;const n=Ae.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new se("Request failed with status code "+r.status,[se.ERR_BAD_REQUEST,se.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),o()}),(function(e){r(e),o()}),{data:i&&"text"!==i&&"json"!==i?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),ye(c,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=l:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(l)},u.onabort=function(){u&&(r(new se("Request aborted",se.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new se("Network Error",se.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||ve;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new se(t,n.clarifyTimeoutError?se.ETIMEDOUT:se.ECONNABORTED,e,u)),u=null},_e.isStandardBrowserEnv){const t=(e.withCredentials||Le(c))&&e.xsrfCookieName&&Ze.read(e.xsrfCookieName);t&&s.set(e.xsrfHeaderName,t)}void 0===n&&s.setContentType(null),"setRequestHeader"in u&&ne.forEach(s.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),ne.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),i&&"json"!==i&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",Ue(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",Ue(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{u&&(r(!t||t.type?new Ce(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(c);d&&-1===_e.protocols.indexOf(d)?r(new se("Unsupported protocol "+d+":",se.ERR_BAD_REQUEST,e)):u.send(n||null)}))}};ne.forEach(De,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var Be=e=>{e=ne.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let s=0;s<t&&(r=e[s],!(n=ne.isString(r)?De[r.toLowerCase()]:r));s++);if(!n){if(!1===n)throw new se(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(ne.hasOwnProp(De,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!ne.isFunction(n))throw new TypeError("adapter is not a function");return n};function Me(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ce(null,e)}function ze(e){Me(e),e.headers=Ae.from(e.headers),e.data=Re.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Be(e.adapter||ke.adapter)(e).then((function(t){return Me(e),t.data=Re.call(e,e.transformResponse,t),t.headers=Ae.from(t.headers),t}),(function(t){return Pe(t)||(Me(e),t&&t.response&&(t.response.data=Re.call(e,e.transformResponse,t.response),t.response.headers=Ae.from(t.response.headers))),Promise.reject(t)}))}const Fe=e=>e instanceof Ae?e.toJSON():e;function qe(e,t){t=t||{};const r={};function n(e,t,r){return ne.isPlainObject(e)&&ne.isPlainObject(t)?ne.merge.call({caseless:r},e,t):ne.isPlainObject(t)?ne.merge({},t):ne.isArray(t)?t.slice():t}function s(e,t,r){return ne.isUndefined(t)?ne.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function i(e,t){if(!ne.isUndefined(t))return n(void 0,t)}function a(e,t){return ne.isUndefined(t)?ne.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function o(r,s,i){return i in t?n(r,s):i in e?n(void 0,r):void 0}const u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials: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:o,headers:(e,t)=>s(Fe(e),Fe(t),!0)};return ne.forEach(Object.keys(e).concat(Object.keys(t)),(function(n){const i=u[n]||s,a=i(e[n],t[n],n);ne.isUndefined(a)&&i!==o||(r[n]=a)})),r}const Ve="1.3.4",$e={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{$e[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Ke={};$e.transitional=function(e,t,r){function n(e,t){return"[Axios v1.3.4] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,s,i)=>{if(!1===e)throw new se(n(s," has been removed"+(t?" in "+t:"")),se.ERR_DEPRECATED);return t&&!Ke[s]&&(Ke[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,s,i)}};var We={assertOptions:function(e,t,r){if("object"!=typeof e)throw new se("options must be an object",se.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const i=n[s],a=t[i];if(a){const t=e[i],r=void 0===t||a(t,i,e);if(!0!==r)throw new se("option "+i+" must be "+r,se.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new se("Unknown option "+i,se.ERR_BAD_OPTION)}},validators:$e};const Je=We.validators;class He{constructor(e){this.defaults=e,this.interceptors={request:new ge,response:new ge}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=qe(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:s}=t;let i;void 0!==r&&We.assertOptions(r,{silentJSONParsing:Je.transitional(Je.boolean),forcedJSONParsing:Je.transitional(Je.boolean),clarifyTimeoutError:Je.transitional(Je.boolean)},!1),void 0!==n&&We.assertOptions(n,{encode:Je.function,serialize:Je.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),i=s&&ne.merge(s.common,s[t.method]),i&&ne.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=Ae.concat(i,s);const a=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,d=0;if(!o){const e=[ze.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,u),l=e.length,c=Promise.resolve(t);d<l;)c=c.then(e[d++],e[d++]);return c}l=a.length;let f=t;for(d=0;d<l;){const e=a[d++],t=a[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=ze.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=u.length;d<l;)c=c.then(u[d++],u[d++]);return c}getUri(e){return ye(Ie((e=qe(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}ne.forEach(["delete","get","head","options"],(function(e){He.prototype[e]=function(t,r){return this.request(qe(r||{},{method:e,url:t,data:(r||{}).data}))}})),ne.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,s){return this.request(qe(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}He.prototype[e]=t(),He.prototype[e+"Form"]=t(!0)}));var Ge=He;class Xe{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,s){r.reason||(r.reason=new Ce(e,n,s),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Xe((function(t){e=t})),cancel:e}}}var Ye=Xe;const Qe={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(Qe).forEach((([e,t])=>{Qe[t]=e}));var et=Qe;const tt=function e(t){const r=new Ge(t),n=O(Ge.prototype.request,r);return ne.extend(n,Ge.prototype,r,{allOwnKeys:!0}),ne.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(qe(t,r))},n}(ke);tt.Axios=Ge,tt.CanceledError=Ce,tt.CancelToken=Ye,tt.isCancel=Pe,tt.VERSION=Ve,tt.toFormData=de,tt.AxiosError=se,tt.Cancel=tt.CanceledError,tt.all=function(e){return Promise.all(e)},tt.spread=function(e){return function(t){return e.apply(null,t)}},tt.isAxiosError=function(e){return ne.isObject(e)&&!0===e.isAxiosError},tt.mergeConfig=qe,tt.AxiosHeaders=Ae,tt.formToJSON=e=>be(ne.isHTMLForm(e)?new FormData(e):e),tt.HttpStatusCode=et,tt.default=tt;var rt,nt=tt,st=function(){function e(){this.keyToValue=new Map,this.valueToKey=new Map}return e.prototype.set=function(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)},e.prototype.getByKey=function(e){return this.keyToValue.get(e)},e.prototype.getByValue=function(e){return this.valueToKey.get(e)},e.prototype.clear=function(){this.keyToValue.clear(),this.valueToKey.clear()},e}(),it=function(){function e(e){this.generateIdentifier=e,this.kv=new st}return e.prototype.register=function(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))},e.prototype.clear=function(){this.kv.clear()},e.prototype.getIdentifier=function(e){return this.kv.getByValue(e)},e.prototype.getValue=function(e){return this.kv.getByKey(e)},e}(),at=(rt=function(e,t){return rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},rt(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}rt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ot=function(e){function t(){var t=e.call(this,(function(e){return e.name}))||this;return t.classToAllowedProps=new Map,t}return at(t,e),t.prototype.register=function(t,r){"object"==typeof r?(r.allowProps&&this.classToAllowedProps.set(t,r.allowProps),e.prototype.register.call(this,t,r.identifier)):e.prototype.register.call(this,t,r)},t.prototype.getAllowedProps=function(e){return this.classToAllowedProps.get(e)},t}(it),ut=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return a};function ct(e,t){var r=function(e){if("values"in Object)return Object.values(e);var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}(e);if("find"in r)return r.find(t);for(var n=r,s=0;s<n.length;s++){var i=n[s];if(t(i))return i}}function lt(e,t){Object.entries(e).forEach((function(e){var r=ut(e,2),n=r[0],s=r[1];return t(s,n)}))}function dt(e,t){return-1!==e.indexOf(t)}function ft(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t(n))return n}}var pt=function(){function e(){this.transfomers={}}return e.prototype.register=function(e){this.transfomers[e.name]=e},e.prototype.findApplicable=function(e){return ct(this.transfomers,(function(t){return t.isApplicable(e)}))},e.prototype.findByName=function(e){return this.transfomers[e]},e}(),ht=function(e){return void 0===e},mt=function(e){return"object"==typeof e&&null!==e&&(e!==Object.prototype&&(null===Object.getPrototypeOf(e)||Object.getPrototypeOf(e)===Object.prototype))},yt=function(e){return mt(e)&&0===Object.keys(e).length},gt=function(e){return Array.isArray(e)},vt=function(e){return e instanceof Map},_t=function(e){return e instanceof Set},bt=function(e){return"Symbol"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)},wt=function(e){return"number"==typeof e&&isNaN(e)},xt=function(e){return function(e){return"boolean"==typeof e}(e)||function(e){return null===e}(e)||ht(e)||function(e){return"number"==typeof e&&!isNaN(e)}(e)||function(e){return"string"==typeof e}(e)||bt(e)},kt=function(e){return e.replace(/\./g,"\\.")},Ot=function(e){return e.map(String).map(kt).join(".")},Et=function(e){for(var t=[],r="",n=0;n<e.length;n++){var s=e.charAt(n);if("\\"===s&&"."===e.charAt(n+1))r+=".",n++;else"."===s?(t.push(r),r=""):r+=s}var i=r;return t.push(i),t},Tt=function(){return Tt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},Tt.apply(this,arguments)},St=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return a},jt=function(e,t){for(var r=0,n=t.length,s=e.length;r<n;r++,s++)e[s]=t[r];return e};function Nt(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}var At=[Nt(ht,"undefined",(function(){return null}),(function(){})),Nt((function(e){return"bigint"==typeof e}),"bigint",(function(e){return e.toString()}),(function(e){return"undefined"!=typeof BigInt?BigInt(e):(console.error("Please add a BigInt polyfill."),e)})),Nt((function(e){return e instanceof Date&&!isNaN(e.valueOf())}),"Date",(function(e){return e.toISOString()}),(function(e){return new Date(e)})),Nt((function(e){return e instanceof Error}),"Error",(function(e,t){var r={name:e.name,message:e.message};return t.allowedErrorProps.forEach((function(t){r[t]=e[t]})),r}),(function(e,t){var r=new Error(e.message);return r.name=e.name,r.stack=e.stack,t.allowedErrorProps.forEach((function(t){r[t]=e[t]})),r})),Nt((function(e){return e instanceof RegExp}),"regexp",(function(e){return""+e}),(function(e){var t=e.slice(1,e.lastIndexOf("/")),r=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,r)})),Nt(_t,"set",(function(e){return jt([],St(e.values()))}),(function(e){return new Set(e)})),Nt(vt,"map",(function(e){return jt([],St(e.entries()))}),(function(e){return new Map(e)})),Nt((function(e){return wt(e)||((t=e)===1/0||t===-1/0);var t}),"number",(function(e){return wt(e)?"NaN":e>0?"Infinity":"-Infinity"}),Number),Nt((function(e){return 0===e&&1/e==-1/0}),"number",(function(){return"-0"}),Number),Nt((function(e){return e instanceof URL}),"URL",(function(e){return e.toString()}),(function(e){return new URL(e)}))];function Rt(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}var Pt=Rt((function(e,t){return!!bt(e)&&!!t.symbolRegistry.getIdentifier(e)}),(function(e,t){return["symbol",t.symbolRegistry.getIdentifier(e)]}),(function(e){return e.description}),(function(e,t,r){var n=r.symbolRegistry.getValue(t[1]);if(!n)throw new Error("Trying to deserialize unknown symbol");return n})),Ct=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((function(e,t){return e[t.name]=t,e}),{}),Zt=Rt((function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}),(function(e){return["typed-array",e.constructor.name]}),(function(e){return jt([],St(e))}),(function(e,t){var r=Ct[t[1]];if(!r)throw new Error("Trying to deserialize unknown typed array");return new r(e)}));function It(e,t){return!!(null==e?void 0:e.constructor)&&!!t.classRegistry.getIdentifier(e.constructor)}var Lt=Rt(It,(function(e,t){return["class",t.classRegistry.getIdentifier(e.constructor)]}),(function(e,t){var r=t.classRegistry.getAllowedProps(e.constructor);if(!r)return Tt({},e);var n={};return r.forEach((function(t){n[t]=e[t]})),n}),(function(e,t,r){var n=r.classRegistry.getValue(t[1]);if(!n)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(n.prototype),e)})),Ut=Rt((function(e,t){return!!t.customTransformerRegistry.findApplicable(e)}),(function(e,t){return["custom",t.customTransformerRegistry.findApplicable(e).name]}),(function(e,t){return t.customTransformerRegistry.findApplicable(e).serialize(e)}),(function(e,t,r){var n=r.customTransformerRegistry.findByName(t[1]);if(!n)throw new Error("Trying to deserialize unknown custom value");return n.deserialize(e)})),Dt=[Lt,Pt,Ut,Zt],Bt=function(e,t){var r=ft(Dt,(function(r){return r.isApplicable(e,t)}));if(r)return{value:r.transform(e,t),type:r.annotation(e,t)};var n=ft(At,(function(r){return r.isApplicable(e,t)}));return n?{value:n.transform(e,t),type:n.annotation}:void 0},Mt={};At.forEach((function(e){Mt[e.annotation]=e}));var zt=function(e,t){for(var r=e.keys();t>0;)r.next(),t--;return r.next().value};function Ft(e){if(dt(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(dt(e,"prototype"))throw new Error("prototype is not allowed as a property");if(dt(e,"constructor"))throw new Error("constructor is not allowed as a property")}var qt=function(e,t,r){if(Ft(t),0===t.length)return r(e);for(var n=e,s=0;s<t.length-1;s++){var i=t[s];if(gt(n))n=n[+i];else if(mt(n))n=n[i];else if(_t(n)){n=zt(n,a=+i)}else if(vt(n)){if(s===t.length-2)break;var a=+i,o=0==+t[++s]?"key":"value",u=zt(n,a);switch(o){case"key":n=u;break;case"value":n=n.get(u)}}}var c=t[t.length-1];if(gt(n)?n[+c]=r(n[+c]):mt(n)&&(n[c]=r(n[c])),_t(n)){var l=zt(n,+c),d=r(l);l!==d&&(n.delete(l),n.add(d))}if(vt(n)){a=+t[t.length-2];var f=zt(n,