(function(w,T){typeof exports=="object"&&typeof module!="undefined"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(w=typeof globalThis!="undefined"?globalThis:w||self,T(w["true-react-kit-api-client"]={}))})(this,function(w){"use strict";var xo=Object.defineProperty;var Uo=(w,T,F)=>T in w?xo(w,T,{enumerable:!0,configurable:!0,writable:!0,value:F}):w[T]=F;var g=(w,T,F)=>(Uo(w,typeof T!="symbol"?T+"":T,F),F);function T(e,t){return function(){return e.apply(t,arguments)}}const{toString:F}=Object.prototype,{getPrototypeOf:pe}=Object,me=(e=>t=>{const r=F.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>me(t)===e),Y=e=>t=>typeof t===e,{isArray:B}=Array,I=Y("undefined");function Qt(e){return e!==null&&!I(e)&&e.constructor!==null&&!I(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const qe=P("ArrayBuffer");function Xt(e){let t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&qe(e.buffer),t}const Yt=Y("string"),x=Y("function"),$e=Y("number"),ye=e=>e!==null&&typeof e=="object",Zt=e=>e===!0||e===!1,Z=e=>{if(me(e)!=="object")return!1;const t=pe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},er=P("Date"),tr=P("File"),rr=P("Blob"),nr=P("FileList"),sr=e=>ye(e)&&x(e.pipe),or=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||F.call(e)===t||x(e.toString)&&e.toString()===t)},ir=P("URLSearchParams"),ar=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function z(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e=="undefined")return;let n,s;if(typeof e!="object"&&(e=[e]),B(e))for(n=0,s=e.length;n0;)if(s=r[n],t===s.toLowerCase())return s;return null}const Me=(()=>typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global)(),Ie=e=>!I(e)&&e!==Me;function be(){const{caseless:e}=Ie(this)&&this||{},t={},r=(n,s)=>{const o=e&&He(t,s)||s;Z(t[o])&&Z(n)?t[o]=be(t[o],n):Z(n)?t[o]=be({},n):B(n)?t[o]=n.slice():t[o]=n};for(let n=0,s=arguments.length;n(z(t,(s,o)=>{r&&x(s)?e[o]=T(s,r):e[o]=s},{allOwnKeys:n}),e),ur=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),lr=(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)},fr=(e,t,r,n)=>{let s,o,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!n||n(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=r!==!1&&pe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},dr=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},hr=e=>{if(!e)return null;if(B(e))return e;let t=e.length;if(!$e(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},pr=(e=>t=>e&&t instanceof e)(typeof Uint8Array!="undefined"&&pe(Uint8Array)),mr=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},yr=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},br=P("HTMLFormElement"),wr=e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),ze=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Er=P("RegExp"),Je=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};z(r,(s,o)=>{t(s,o,e)!==!1&&(n[o]=s)}),Object.defineProperties(e,n)},c={isArray:B,isArrayBuffer:qe,isBuffer:Qt,isFormData:or,isArrayBufferView:Xt,isString:Yt,isNumber:$e,isBoolean:Zt,isObject:ye,isPlainObject:Z,isUndefined:I,isDate:er,isFile:tr,isBlob:rr,isRegExp:Er,isFunction:x,isStream:sr,isURLSearchParams:ir,isTypedArray:pr,isFileList:nr,forEach:z,merge:be,extend:cr,trim:ar,stripBOM:ur,inherits:lr,toFlatObject:fr,kindOf:me,kindOfTest:P,endsWith:dr,toArray:hr,forEachEntry:mr,matchAll:yr,isHTMLForm:br,hasOwnProperty:ze,hasOwnProp:ze,reduceDescriptors:Je,freezeMethods:e=>{Je(e,(t,r)=>{if(x(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(x(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},toObjectSet:(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return B(e)?n(e):n(String(e).split(t)),r},toCamelCase:wr,noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:He,global:Me,isContextDefined:Ie,toJSONObject:e=>{const t=new Array(10),r=(n,s)=>{if(ye(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[s]=n;const o=B(n)?[]:{};return z(n,(i,a)=>{const l=r(i,s+1);!I(l)&&(o[a]=l)}),t[s]=void 0,o}}return n};return r(e,0)}};function y(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)}c.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:c.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ve=y.prototype,We={};["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=>{We[e]={value:e}}),Object.defineProperties(y,We),Object.defineProperty(Ve,"isAxiosError",{value:!0}),y.from=(e,t,r,n,s,o)=>{const i=Object.create(Ve);return c.toFlatObject(e,i,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),y.call(i,e.message,t,r,n,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};var gr=typeof self=="object"?self.FormData:window.FormData;const Or=gr;function we(e){return c.isPlainObject(e)||c.isArray(e)}function Ke(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function Ge(e,t,r){return e?e.concat(t).map(function(s,o){return s=Ke(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function Sr(e){return c.isArray(e)&&!e.some(we)}const Rr=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function _r(e){return e&&c.isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator]}function ee(e,t,r){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new(Or||FormData),r=c.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,R){return!c.isUndefined(R[h])});const n=r.metaTokens,s=r.visitor||f,o=r.dots,i=r.indexes,l=(r.Blob||typeof Blob!="undefined"&&Blob)&&_r(t);if(!c.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(c.isDate(d))return d.toISOString();if(!l&&c.isBlob(d))throw new y("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(d)||c.isTypedArray(d)?l&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function f(d,h,R){let S=d;if(d&&!R&&typeof d=="object"){if(c.endsWith(h,"{}"))h=n?h:h.slice(0,-2),d=JSON.stringify(d);else if(c.isArray(d)&&Sr(d)||c.isFileList(d)||c.endsWith(h,"[]")&&(S=c.toArray(d)))return h=Ke(h),S.forEach(function(E,L){!(c.isUndefined(E)||E===null)&&t.append(i===!0?Ge([h],L,o):i===null?h:h+"[]",u(E))}),!1}return we(d)?!0:(t.append(Ge(R,h,o),u(d)),!1)}const p=[],b=Object.assign(Rr,{defaultVisitor:f,convertValue:u,isVisitable:we});function m(d,h){if(!c.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+h.join("."));p.push(d),c.forEach(d,function(S,A){(!(c.isUndefined(S)||S===null)&&s.call(t,S,c.isString(A)?A.trim():A,h,b))===!0&&m(S,h?h.concat(A):[A])}),p.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return m(e),t}function Qe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Ee(e,t){this._pairs=[],e&&ee(e,this,t)}const Xe=Ee.prototype;Xe.append=function(t,r){this._pairs.push([t,r])},Xe.toString=function(t){const r=t?function(n){return t.call(this,n,Qe)}:Qe;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Tr(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||Tr,s=r&&r.serialize;let o;if(s?o=s(t,r):o=c.isURLSearchParams(t)?t.toString():new Ee(t,r).toString(n),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class vr{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ze=vr,et={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ar=typeof URLSearchParams!="undefined"?URLSearchParams:Ee,jr=FormData,Pr=(()=>{let e;return typeof navigator!="undefined"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"})(),Nr=(()=>typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),j={isBrowser:!0,classes:{URLSearchParams:Ar,FormData:jr,Blob},isStandardBrowserEnv:Pr,isStandardBrowserWebWorkerEnv:Nr,protocols:["http","https","file","blob","url","data"]};function Cr(e,t){return ee(e,new j.classes.URLSearchParams,Object.assign({visitor:function(r,n,s,o){return j.isNode&&c.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Fr(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function kr(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n=r.length;return i=!i&&c.isArray(s)?s.length:i,l?(c.hasOwnProp(s,i)?s[i]=[s[i],n]:s[i]=n,!a):((!s[i]||!c.isObject(s[i]))&&(s[i]=[]),t(r,n,s[i],o)&&c.isArray(s[i])&&(s[i]=kr(s[i])),!a)}if(c.isFormData(e)&&c.isFunction(e.entries)){const r={};return c.forEachEntry(e,(n,s)=>{t(Fr(n),s,r,0)}),r}return null}const xr={"Content-Type":void 0};function Ur(e,t,r){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const te={transitional:et,adapter:["xhr","http"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=c.isObject(t);if(o&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return s&&s?JSON.stringify(tt(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Cr(t,this.formSerializer).toString();if((a=c.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ee(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||s?(r.setContentType("application/json",!1),Ur(t)):t}],transformResponse:[function(t){const r=this.transitional||te.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(t&&c.isString(t)&&(n&&!this.responseType||s)){const i=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?y.from(a,y.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:j.classes.FormData,Blob:j.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};c.forEach(["delete","get","head"],function(t){te.headers[t]={}}),c.forEach(["post","put","patch"],function(t){te.headers[t]=c.merge(xr)});const ge=te,Dr=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Lr=e=>{const t={};let r,n,s;return e&&e.split(` `).forEach(function(i){s=i.indexOf(":"),r=i.substring(0,s).trim().toLowerCase(),n=i.substring(s+1).trim(),!(!r||t[r]&&Dr[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},rt=Symbol("internals");function J(e){return e&&String(e).trim().toLowerCase()}function re(e){return e===!1||e==null?e:c.isArray(e)?e.map(re):String(e)}function Br(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}function qr(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function nt(e,t,r,n){if(c.isFunction(n))return n.call(this,t,r);if(c.isString(t)){if(c.isString(n))return t.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(t)}}function $r(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Hr(e,t){const r=c.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(s,o,i){return this[n].call(this,t,s,o,i)},configurable:!0})})}class ne{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(a,l,u){const f=J(l);if(!f)throw new Error("header name must be a non-empty string");const p=c.findKey(s,f);(!p||s[p]===void 0||u===!0||u===void 0&&s[p]!==!1)&&(s[p||l]=re(a))}const i=(a,l)=>c.forEach(a,(u,f)=>o(u,f,l));return c.isPlainObject(t)||t instanceof this.constructor?i(t,r):c.isString(t)&&(t=t.trim())&&!qr(t)?i(Lr(t),r):t!=null&&o(r,t,n),this}get(t,r){if(t=J(t),t){const n=c.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return Br(s);if(c.isFunction(r))return r.call(this,s,n);if(c.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=J(t),t){const n=c.findKey(this,t);return!!(n&&(!r||nt(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(i){if(i=J(i),i){const a=c.findKey(n,i);a&&(!r||nt(n,n[a],a,r))&&(delete n[a],s=!0)}}return c.isArray(t)?t.forEach(o):o(t),s}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(t){const r=this,n={};return c.forEach(this,(s,o)=>{const i=c.findKey(n,o);if(i){r[i]=re(s),delete r[o];return}const a=t?$r(o):String(o).trim();a!==o&&delete r[o],r[a]=re(s),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return c.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&c.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[rt]=this[rt]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=J(i);n[a]||(Hr(s,i),n[a]=!0)}return c.isArray(t)?t.forEach(o):o(t),this}}ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),c.freezeMethods(ne.prototype),c.freezeMethods(ne);const N=ne;function Oe(e,t){const r=this||ge,n=t||r,s=N.from(n.headers);let o=n.data;return c.forEach(e,function(a){o=a.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function st(e){return!!(e&&e.__CANCEL__)}function V(e,t,r){y.call(this,e==null?"canceled":e,y.ERR_CANCELED,t,r),this.name="CanceledError"}c.inherits(V,y,{__CANCEL__:!0});const Mr=null;function Ir(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(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))}const zr=j.isStandardBrowserEnv?function(){return{write:function(r,n,s,o,i,a){const l=[];l.push(r+"="+encodeURIComponent(n)),c.isNumber(s)&&l.push("expires="+new Date(s).toGMTString()),c.isString(o)&&l.push("path="+o),c.isString(i)&&l.push("domain="+i),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(r){const n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Jr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Vr(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function ot(e,t){return e&&!Jr(t)?Vr(e,t):t}const Wr=j.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function s(o){let i=o;return t&&(r.setAttribute("href",i),i=r.href),r.setAttribute("href",i),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=s(window.location.href),function(i){const a=c.isString(i)?s(i):i;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}();function Kr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Gr(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),f=n[o];i||(i=u),r[s]=l,n[s]=u;let p=o,b=0;for(;p!==s;)b+=r[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i{const o=s.loaded,i=s.lengthComputable?s.total:void 0,a=o-r,l=n(a),u=o<=i;r=o;const f={loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:l||void 0,estimated:l&&i&&u?(i-o)/l:void 0,event:s};f[t?"download":"upload"]=!0,e(f)}}const se={http:Mr,xhr:typeof XMLHttpRequest!="undefined"&&function(e){return new Promise(function(r,n){let s=e.data;const o=N.from(e.headers).normalize(),i=e.responseType;let a;function l(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}c.isFormData(s)&&(j.isStandardBrowserEnv||j.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let u=new XMLHttpRequest;if(e.auth){const m=e.auth.username||"",d=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(m+":"+d))}const f=ot(e.baseURL,e.url);u.open(e.method.toUpperCase(),Ye(f,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function p(){if(!u)return;const m=N.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),h={data:!i||i==="text"||i==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:m,config:e,request:u};Ir(function(S){r(S),l()},function(S){n(S),l()},h),u=null}if("onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(p)},u.onabort=function(){u&&(n(new y("Request aborted",y.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new y("Network Error",y.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let d=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const h=e.transitional||et;e.timeoutErrorMessage&&(d=e.timeoutErrorMessage),n(new y(d,h.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,u)),u=null},j.isStandardBrowserEnv){const m=(e.withCredentials||Wr(f))&&e.xsrfCookieName&&zr.read(e.xsrfCookieName);m&&o.set(e.xsrfHeaderName,m)}s===void 0&&o.setContentType(null),"setRequestHeader"in u&&c.forEach(o.toJSON(),function(d,h){u.setRequestHeader(h,d)}),c.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),i&&i!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",it(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",it(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=m=>{u&&(n(!m||m.type?new V(null,e,u):m),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const b=Kr(f);if(b&&j.protocols.indexOf(b)===-1){n(new y("Unsupported protocol "+b+":",y.ERR_BAD_REQUEST,e));return}u.send(s||null)})}};c.forEach(se,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Qr={getAdapter:e=>{e=c.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let s=0;se instanceof N?e.toJSON():e;function q(e,t){t=t||{};const r={};function n(u,f,p){return c.isPlainObject(u)&&c.isPlainObject(f)?c.merge.call({caseless:p},u,f):c.isPlainObject(f)?c.merge({},f):c.isArray(f)?f.slice():f}function s(u,f,p){if(c.isUndefined(f)){if(!c.isUndefined(u))return n(void 0,u,p)}else return n(u,f,p)}function o(u,f){if(!c.isUndefined(f))return n(void 0,f)}function i(u,f){if(c.isUndefined(f)){if(!c.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function a(u,f,p){if(p in t)return n(u,f);if(p in e)return n(void 0,u)}const l={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,f)=>s(ct(u),ct(f),!0)};return c.forEach(Object.keys(e).concat(Object.keys(t)),function(f){const p=l[f]||s,b=p(e[f],t[f],f);c.isUndefined(b)&&p!==a||(r[f]=b)}),r}const ut="1.2.3",Re={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Re[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const lt={};Re.transitional=function(t,r,n){function s(o,i){return"[Axios v"+ut+"] Transitional option '"+o+"'"+i+(n?". "+n:"")}return(o,i,a)=>{if(t===!1)throw new y(s(i," has been removed"+(r?" in "+r:"")),y.ERR_DEPRECATED);return r&&!lt[i]&&(lt[i]=!0,console.warn(s(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,i,a):!0}};function Xr(e,t,r){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],i=t[o];if(i){const a=e[o],l=a===void 0||i(a,o,e);if(l!==!0)throw new y("option "+o+" must be "+l,y.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const _e={assertOptions:Xr,validators:Re},k=_e.validators;class oe{constructor(t){this.defaults=t,this.interceptors={request:new Ze,response:new Ze}}request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=q(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&_e.assertOptions(n,{silentJSONParsing:k.transitional(k.boolean),forcedJSONParsing:k.transitional(k.boolean),clarifyTimeoutError:k.transitional(k.boolean)},!1),s!==void 0&&_e.assertOptions(s,{encode:k.function,serialize:k.function},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i;i=o&&c.merge(o.common,o[r.method]),i&&c.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),r.headers=N.concat(i,o);const a=[];let l=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(l=l&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let f,p=0,b;if(!l){const d=[at.bind(this),void 0];for(d.unshift.apply(d,a),d.push.apply(d,u),b=d.length,f=Promise.resolve(r);p{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{n.subscribe(a),o=a}).then(s);return i.cancel=function(){n.unsubscribe(o)},i},t(function(o,i,a){n.reason||(n.reason=new V(o,i,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new Te(function(s){t=s}),cancel:t}}}const Yr=Te;function Zr(e){return function(r){return e.apply(null,r)}}function en(e){return c.isObject(e)&&e.isAxiosError===!0}const ve={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(ve).forEach(([e,t])=>{ve[t]=e});const tn=ve;function ft(e){const t=new ie(e),r=T(ie.prototype.request,t);return c.extend(r,ie.prototype,t,{allOwnKeys:!0}),c.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return ft(q(e,s))},r}const _=ft(ge);_.Axios=ie,_.CanceledError=V,_.CancelToken=Yr,_.isCancel=st,_.VERSION=ut,_.toFormData=ee,_.AxiosError=y,_.Cancel=_.CanceledError,_.all=function(t){return Promise.all(t)},_.spread=Zr,_.isAxiosError=en,_.mergeConfig=q,_.AxiosHeaders=N,_.formToJSON=e=>tt(c.isHTMLForm(e)?new FormData(e):e),_.HttpStatusCode=tn,_.default=_;const Ae=_,rn=e=>(e!=null?e:"").trim()!=="",v=e=>e!=null,dt=e=>Object.prototype.toString.call(e)==="[object Object]",je=e=>Array.isArray(e)?e.map(je):dt(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,je(r)])):e!=null?e:void 0;function nn(){this.__data__=[],this.size=0}function ae(e,t){return e===t||e!=e&&t!=t}function ce(e,t){for(var r=e.length;r--;)if(ae(e[r][0],t))return r;return-1}var sn=Array.prototype,on=sn.splice;function an(e){var t=this.__data__,r=ce(t,e);return!(r<0)&&(r==t.length-1?t.pop():on.call(t,r,1),--this.size,!0)}function cn(e){var t=this.__data__,r=ce(t,e);return r<0?void 0:t[r][1]}function un(e){return ce(this.__data__,e)>-1}function ln(e,t){var r=this.__data__,n=ce(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function C(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=gs}function De(e){return e!=null&&At(e.length)&&!Pe(e)}function Os(e){return G(e)&&De(e)}function Ss(){return!1}var jt=typeof w=="object"&&w&&!w.nodeType&&w,Pt=jt&&typeof module=="object"&&module&&!module.nodeType&&module,Rs=Pt&&Pt.exports===jt,Nt=Rs?$.Buffer:void 0,_s=Nt?Nt.isBuffer:void 0,Ct=_s||Ss,Ts="[object Object]",vs=Function.prototype,As=Object.prototype,Ft=vs.toString,js=As.hasOwnProperty,Ps=Ft.call(Object);function Ns(e){if(!G(e)||le(e)!=Ts)return!1;var t=Rt(e);if(t===null)return!0;var r=js.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Ft.call(r)==Ps}var Cs="[object Arguments]",Fs="[object Array]",ks="[object Boolean]",xs="[object Date]",Us="[object Error]",Ds="[object Function]",Ls="[object Map]",Bs="[object Number]",qs="[object Object]",$s="[object RegExp]",Hs="[object Set]",Ms="[object String]",Is="[object WeakMap]",zs="[object ArrayBuffer]",Js="[object DataView]",Vs="[object Float32Array]",Ws="[object Float64Array]",Ks="[object Int8Array]",Gs="[object Int16Array]",Qs="[object Int32Array]",Xs="[object Uint8Array]",Ys="[object Uint8ClampedArray]",Zs="[object Uint16Array]",eo="[object Uint32Array]",O={};function to(e){return G(e)&&At(e.length)&&!!O[le(e)]}function ro(e){return function(t){return e(t)}}O[Vs]=O[Ws]=O[Ks]=O[Gs]=O[Qs]=O[Xs]=O[Ys]=O[Zs]=O[eo]=!0,O[Cs]=O[Fs]=O[zs]=O[ks]=O[Js]=O[xs]=O[Us]=O[Ds]=O[Ls]=O[Bs]=O[qs]=O[$s]=O[Hs]=O[Ms]=O[Is]=!1;var kt=typeof w=="object"&&w&&!w.nodeType&&w,Q=kt&&typeof module=="object"&&module&&!module.nodeType&&module,no=Q&&Q.exports===kt,Le=no&&ht.process,xt=function(){try{return Q&&Q.require&&Q.require("util").types||Le&&Le.binding&&Le.binding("util")}catch{}}(),Ut=xt&&xt.isTypedArray,Dt=Ut?ro(Ut):to;function Be(e,t){if((t!=="constructor"||typeof e[t]!="function")&&t!="__proto__")return e[t]}var so=Object.prototype,oo=so.hasOwnProperty;function io(e,t,r){var n=e[t];(!oo.call(e,t)||!ae(n,r)||r===void 0&&!(t in e))&&Fe(e,t,r)}function ao(e,t,r,n){var s=!r;r||(r={});for(var o=-1,i=t.length;++o-1&&e%1==0&&e0){if(++t>=Ro)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Ao=vo(So);function jo(e,t){return Ao(go(e,t,$t),e+"")}function Po(e,t,r){if(!U(r))return!1;var n=typeof t;return!!(n=="number"?De(r)&&Lt(t,r.length):n=="string"&&t in r)&&ae(r[t],e)}function No(e){return jo(function(t,r){var n=-1,s=r.length,o=s>1?r[s-1]:void 0,i=s>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(s--,o):void 0,i&&Po(r[0],r[1],i)&&(o=s<3?void 0:o,s=1),t=Object(t);++ne.reduce((t,r)=>({...t,...r!=null?r:{}}),{}),zt=e=>e==null?void 0:e.isCanceled,Co=(e,t,{arrayFormat:r="bracket-separator",arrayFormatSeparator:n=","}={})=>{const s=[];if(r==="duplicate-keys"||r==="bracket"){const o=r==="bracket"?"[]":"";t.forEach(i=>{s.push(`${encodeURIComponent(`${e}${o}`)}=${encodeURIComponent(String(i))}`)})}else{const o=r==="bracket-separator"?"[]":"";s.push(`${encodeURIComponent(`${e}${o}`)}=${encodeURIComponent(t.join(n))}`)}return s.join("&")},Jt=(e,t,r)=>{const n=[],{href:s}=window.location;if(t){const o=new URL(s);n.push(o.search)}return Object.keys(e).forEach(o=>{const i=e[o];if(i!==void 0)if(Array.isArray(i))n.push(Co(String(o),i,r));else{const a=dt(i);n.push(`${encodeURIComponent(`${String(o)}${a?"{}":""}`)}=${encodeURIComponent(a?JSON.stringify(i):String(i))}`)}}),n.length>0?`${t?"":"?"}${n.join("&")}`:""},Vt=(e,t,r)=>{let{path:n}=e;const s={...t!=null?t:{}};return v(e.keys)&&e.keys.forEach(o=>{const i=t==null?void 0:t[o];if(!v(i)||i==="")throw new Error("No necessary key provided");n=n.replace(`:${o}`,String(i)),delete s[o]}),v(e.unnecessaryKeys)&&e.unnecessaryKeys.forEach(o=>{const i=t==null?void 0:t[o];!v(i)||i===""?n=n.replace(`/:${o}?`,""):(n=n.replace(`:${o}?`,String(i)),delete s[o])}),Object.keys(s).length>0&&(n=`${n}${Jt(s,!1,r)}`),n},Wt=e=>{const t={path:e.charAt(0)==="/"?e:`/${e}`};if(e.indexOf(":")!==-1){const r=e.split("/").filter(o=>o.indexOf(":")!==-1).map(o=>o.replace(":","")),n=[],s=[];for(const o of r)o.indexOf("?")===-1?n.push(o):s.push(o.replace("?",""));n.length>0&&(t.keys=n),s.length>0&&(t.unnecessaryKeys=s)}return t},Fo=e=>{const t=e.trim().replace(/^[?#&]/,""),r={};if(!t)return r;for(const n of t.split("&")){const s=n.indexOf("=");if(s!==-1){const o=decodeURIComponent(n.slice(0,s)),i=n.slice(s+1),a=o.replace(/({})$/,"").replace(/[[\]']+/g,""),l=/(\{\})$/.test(o),u=/(\[\])$/.test(o),f=i.toLowerCase()==="true"||i.toLowerCase()==="false",p=decodeURIComponent(i).replace(/\+/g," ");l?r[a]=JSON.parse(p):u?r[a]=p.split(","):r[a]=f?i.toLowerCase()==="true":p}else r[n]=void 0}return r},ko=()=>document.cookie.split("; ").reduce((t,r)=>{const[n,s]=r.split("=");return t[n]=s,t},{});class X{constructor(t){g(this,"apiConfig");g(this,"environments");g(this,"headers");g(this,"featureFlagsHeaderName");g(this,"host");g(this,"port");g(this,"requests");g(this,"withCredentials");g(this,"NODE_ENV");g(this,"compilePathOptions");g(this,"shouldShowToasterOnError");g(this,"shouldShowToasterOnSuccess");g(this,"mocks");g(this,"mockedEnvironments");g(this,"featureFlags");g(this,"pendingRequests");g(this,"transformError");g(this,"showPreloader");g(this,"hidePreloader");g(this,"processResponseHeaders");g(this,"showErrorToaster");g(this,"showSuccessToaster");g(this,"setFeatureFlags");g(this,"mockedResponses");g(this,"loggedRequests");g(this,"axiosInstance");g(this,"canceledRequestHandler");var r,n,s,o,i,a;this.NODE_ENV=t.getNodeEnv(),this.axiosInstance=(r=t.axiosInstance)!=null?r:Ae,this.host=t.host||((s=(n=t.environmentConfig)==null?void 0:n.URL)==null?void 0:s[this.NODE_ENV||"development"]),this.port=t.port||((i=(o=t.environmentConfig)==null?void 0:o.PORT)==null?void 0:i[this.NODE_ENV||"development"]),this.environments=t.environments,this.apiConfig=t.apiConfig,this.headers=t.headers,this.featureFlagsHeaderName=t.featureFlagsHeaderName,this.mocks=t.mocks,this.mockedEnvironments=t.mockedEnvironments,this.transformError=t.transformError,this.showPreloader=t.showPreloader,this.processResponseHeaders=t.processResponseHeaders,this.hidePreloader=t.hidePreloader,this.showErrorToaster=t.showErrorToaster,this.showSuccessToaster=t.showSuccessToaster,this.setFeatureFlags=t.setFeatureFlags,this.compilePathOptions=t.compilePathOptions,this.withCredentials=t.withCredentials,this.shouldShowToasterOnError=t.shouldShowToasterOnError,this.shouldShowToasterOnSuccess=t.shouldShowToasterOnSuccess,this.canceledRequestHandler=t.canceledRequestHandler,this.requests=Object.fromEntries(Object.entries(t.apiConfig).map(([l,u])=>[l,{...u,...Wt(u.pathTemplate)}])),this.featureFlags={},this.pendingRequests={},this.mockedResponses={},this.loggedRequests=[],(a=t.onInit)==null||a.call(t,this)}static addNewQueryParam(t,r,n){let s=t;return t.indexOf("?")!==-1?s+=`&${r}`:s+=`?${r}`,n&&(s+=`=${n}`),s}static preventCache(t){const r=Math.random().toString().substr(2);return X.addNewQueryParam(t,r)}static getUrlTail(t,r,n){if(!v(t))return"";const s=Vt(t,r,n);return t.isCacheDisabled?X.preventCache(s):s}setHeaders(t){this.headers=It(this.headers,t)}compileUrl({name:t,params:r,host:n,port:s}){const o=this.requests[t];if(!o)throw new Error("No request with this name in config");const i=n||o.host||this.host,a=s||o.port||this.port;return`${i!=null?i:""}${v(a)?`:${a}`:""}${X.getUrlTail(o,r,this.compilePathOptions)}`}cancelRequest(t,r){var n;(n=this.pendingRequests[t])==null||n.cancel(r),this.clearToken(t)}combineRequestOptions(t){var n,s,o,i,a,l,u,f,p,b,m,d,h,R,S;const r=(n=this.requests[t.name])!=null?n:{};return{...t,headers:It(this.headers,r.headers,t.headers),responseType:(s=t.responseType)!=null?s:r.responseType,withCredentials:(i=(o=t.withCredentials)!=null?o:r.withCredentials)!=null?i:this.withCredentials,mockedEnvironments:(l=(a=t.mockedEnvironments)!=null?a:r.mockedEnvironments)!=null?l:this.mockedEnvironments,shouldShowToasterOnError:(f=(u=t.shouldShowToasterOnError)!=null?u:r.shouldShowToasterOnError)!=null?f:this.shouldShowToasterOnError,shouldShowToasterOnSuccess:(b=(p=t.shouldShowToasterOnSuccess)!=null?p:r.shouldShowToasterOnSuccess)!=null?b:this.shouldShowToasterOnSuccess,shouldShowGlobalPreloader:(m=t.shouldShowGlobalPreloader)!=null?m:r.shouldShowGlobalPreloader,showPreloader:(d=t.showPreloader)!=null?d:this.showPreloader,hidePreloader:(h=t.hidePreloader)!=null?h:this.hidePreloader,showErrorToaster:(R=t.showErrorToaster)!=null?R:this.showErrorToaster,showSuccessToaster:(S=t.showSuccessToaster)!=null?S:this.showSuccessToaster}}async createRequest(t){const r=this.combineRequestOptions(t),{name:n,body:s,params:o,responseType:i="json",shouldShowToasterOnError:a,shouldShowToasterOnSuccess:l,shouldShowGlobalPreloader:u,mapper:f,showPreloader:p,hidePreloader:b,showErrorToaster:m,showSuccessToaster:d}=r;return this.NODE_ENV===this.environments.TEST?this.processMockedRequest({name:n,params:o,body:s,mapper:f}):(u&&(p==null||p(n)),this.getRequestOrMock(r).finally(()=>{u&&(b==null||b())}).then(h=>i==="json"?je(h):h).then(h=>{const R=zt(h)&&v(this.canceledRequestHandler)?this.canceledRequestHandler(r,h):h,S=v(f)?f(R):R;return!zt(h)&&l&&(d==null||d(r,S)),S}).catch(async h=>{var R,S,A,E,L,Kt,Gt;if(((R=h.request)==null?void 0:R.responseType)==="blob"&&((S=h.response)==null?void 0:S.data)instanceof Blob&&h.response.data.type!==void 0&&h.response.data.type.toLowerCase().includes("json")){const he=await h.response.data.text();try{h.response.data=JSON.parse(he)}catch{h.response.data=he}}return a&&(m==null||m({error:(A=h.response)==null?void 0:A.data,payload:{params:o,body:s},requestName:n,errorCode:((E=h.response)==null?void 0:E.status)||((Kt=(L=h.message)==null?void 0:L.match(/[\w\s]/gm))==null?void 0:Kt.map(he=>he.toUpperCase()).join("").split(" ").join("_"))})),(Gt=this.transformError)==null||Gt.call(this,h,this),Promise.reject(h)}))}shouldMockRequest(t,r){var n;return!v((n=this.mocks)==null?void 0:n[t])||!r?!1:r===!0||r.includes(this.NODE_ENV)}async getRequestOrMock({name:t,host:r,port:n,headers:s,body:o,params:i,signal:a,responseType:l,withCredentials:u,mockedEnvironments:f,shouldGetHeadersFromResponse:p}){var S,A;const b=this.requests[t];if(!b)throw new Error("No request with this name in config");if(this.shouldMockRequest(t,f))return(A=(S=this.mocks)==null?void 0:S[t])==null?void 0:A.call(S,{params:i,body:o});const m=this.compileUrl({name:t,params:i,host:r,port:n}),{method:d,areParallelRequestsPossible:h}=b;h||this.cancelRequest(t,Mt);const R=Ae.CancelToken.source();return this.pendingRequests[t]=R,a==null||a.addEventListener("abort",()=>{const E=v(a.reason)?String(a.reason):void 0;this.pendingRequests[t]===R?this.cancelRequest(t,E):R.cancel(E)}),this.axiosInstance.request({url:m,data:o,headers:s,method:d,cancelToken:R.token,responseType:l,withCredentials:u}).then(E=>(this.clearToken.call(this,t),this.processFeatureFlags.call(this,E))).then(E=>E.data.status==="ERROR"?Promise.reject(E.data):E).catch(E=>Ae.isCancel(E)?{isCanceled:!0,message:E.message}:Promise.reject(E)).then(E=>("headers"in E&&v(this.processResponseHeaders)&&this.processResponseHeaders(E.headers,this),E)).then(E=>{const L="data"in E?E.data:E;return p&&"headers"in E?{headers:E.headers,data:L}:L})}clearToken(t){this.pendingRequests[t]=void 0}processFeatureFlags(t){const r=t.headers,n=this.featureFlagsHeaderName;if(rn(n)&&v(r[n])&&v(this.setFeatureFlags))try{const o=JSON.parse(r[n]);for(const i in o)if(!this.featureFlags[i]||this.featureFlags[i]!==o[i]){this.featureFlags=o,this.setFeatureFlags(o);break}}catch(o){console.log("api-client","processFeatureFlags",o)}return t}setMocks({requestName:t,fixture:r}){this.mockedResponses[t]=r}resetMocks(){this.mockedResponses={}}getLoggedRequests(){return this.loggedRequests}clearLogs(){this.loggedRequests=[]}reset(){this.resetMocks(),this.clearLogs()}processMockedRequest(t){const{mapper:r,...n}=t;this.loggedRequests.push(n);const s=this.mockedResponses[n.name];return v(s)?Promise.resolve(s).then(r):Promise.resolve()}}w.REPEATED_REQUEST_MESSAGE=Mt,w.compilePath=Vt,w.compileQuery=Jt,w.default=X,w.parseCookies=ko,w.parsePathTemplate=Wt,w.parseQueryString=Fo,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});