@gradientedge/commercetools-utils 5.0.1 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ge-commercetools-utils-browser.cjs.js +1 -1
- package/dist/ge-commercetools-utils-browser.cjs.js.map +1 -1
- package/dist/ge-commercetools-utils-browser.esm.js +1 -1
- package/dist/ge-commercetools-utils-browser.esm.js.map +1 -1
- package/dist/ge-commercetools-utils-node.cjs.js +1 -1
- package/dist/ge-commercetools-utils-node.cjs.js.map +1 -1
- package/dist/ge-commercetools-utils-node.esm.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={8842:(e,t,r)=>{t.Status=void 0;var o=r(7536);Object.defineProperty(t,"Status",{enumerable:!0,get:function(){return o.Status}});r(7890)},7890:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reason=void 0;const o=r(7536);t.reason=function(e){switch(e){case 200:return"OK";case 203:return"Non-Authoritative Information";case 207:return"Multi-Status";case 226:return"IM Used";case 414:return"URI Too Long";case 418:return"I'm a teapot";case 505:return"HTTP Version Not Supported";default:return(Object.keys(o.Status).find((t=>o.Status[t]===e))||"").replace(/(?!^)([A-Z])/gm," $1")}}},7536:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Status=t.ErrorStatus=t.RedirectionStatus=t.SuccessStatus=t.InformationStatus=void 0,t.InformationStatus={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103},t.SuccessStatus={Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226},t.RedirectionStatus={MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},t.ErrorStatus={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,RequestedRangeNotSatisfiable: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},t.Status=Object.assign(Object.assign(Object.assign(Object.assign({},t.InformationStatus),t.SuccessStatus),t.RedirectionStatus),t.ErrorStatus)},4530:(e,t)=>{function r(e,t){var r=[],o=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]"}),function(s,n){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?o.splice(a,1/0,s):o.push(s),~r.indexOf(n)&&(n=t.call(this,s,n))}else r.push(n);return null==e?n:e.call(this,s,n)}}(e.exports=function(e,t,o,s){return JSON.stringify(e,r(t,s),o)}).getSerialize=r},3692:e=>{function t(e){return Object.prototype.toString.call(e)}var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)}var s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t},n=Object.prototype.hasOwnProperty||function(e,t){return t in e};function a(e){if("object"==typeof e&&null!==e){var n;if(r(e))n=[];else if("[object Date]"===t(e))n=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===t(e))n=new RegExp(e);else if(function(e){return"[object Error]"===t(e)}(e))n={message:e.message};else if(function(e){return"[object Boolean]"===t(e)}(e)||function(e){return"[object Number]"===t(e)}(e)||function(e){return"[object String]"===t(e)}(e))n=Object(e);else if(Object.create&&Object.getPrototypeOf)n=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)n={};else{var a=e.constructor&&e.constructor.prototype||e.__proto__||{},i=function(){};i.prototype=a,n=new i}return o(s(e),(function(t){n[t]=e[t]})),n}return e}function i(e,t,i){var c=[],u=[],h=!0;return function e(p){var d=i?a(p):p,l={},m=!0,f={node:d,node_:p,path:[].concat(c),parent:u[u.length-1],parents:u,key:c[c.length-1],isRoot:0===c.length,level:c.length,circular:null,update:function(e,t){f.isRoot||(f.parent.node[f.key]=e),f.node=e,t&&(m=!1)},delete:function(e){delete f.parent.node[f.key],e&&(m=!1)},remove:function(e){r(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key],e&&(m=!1)},keys:null,before:function(e){l.before=e},after:function(e){l.after=e},pre:function(e){l.pre=e},post:function(e){l.post=e},stop:function(){h=!1},block:function(){m=!1}};if(!h)return f;function y(){if("object"==typeof f.node&&null!==f.node){f.keys&&f.node_===f.node||(f.keys=s(f.node)),f.isLeaf=0===f.keys.length;for(var e=0;e<u.length;e++)if(u[e].node_===p){f.circular=u[e];break}}else f.isLeaf=!0,f.keys=null;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot}y();var g=t.call(f,f.node);return void 0!==g&&f.update&&f.update(g),l.before&&l.before.call(f,f.node),m?("object"!=typeof f.node||null===f.node||f.circular||(u.push(f),y(),o(f.keys,(function(t,r){c.push(t),l.pre&&l.pre.call(f,f.node[t],t);var o=e(f.node[t]);i&&n.call(f.node,t)&&(f.node[t]=o.node),o.isLast=r===f.keys.length-1,o.isFirst=0===r,l.post&&l.post.call(f,o),c.pop()})),u.pop()),l.after&&l.after.call(f,f.node),f):f}(e).node}function c(e){this.value=e}function u(e){return new c(e)}c.prototype.get=function(e){for(var t=this.value,r=0;r<e.length;r++){var o=e[r];if(!t||!n.call(t,o))return;t=t[o]}return t},c.prototype.has=function(e){for(var t=this.value,r=0;r<e.length;r++){var o=e[r];if(!t||!n.call(t,o))return!1;t=t[o]}return!0},c.prototype.set=function(e,t){for(var r=this.value,o=0;o<e.length-1;o++){var s=e[o];n.call(r,s)||(r[s]={}),r=r[s]}return r[e[o]]=t,t},c.prototype.map=function(e){return i(this.value,e,!0)},c.prototype.forEach=function(e){return this.value=i(this.value,e,!1),this.value},c.prototype.reduce=function(e,t){var r=1===arguments.length,o=r?this.value:t;return this.forEach((function(t){this.isRoot&&r||(o=e.call(this,o,t))})),o},c.prototype.paths=function(){var e=[];return this.forEach((function(){e.push(this.path)})),e},c.prototype.nodes=function(){var e=[];return this.forEach((function(){e.push(this.node)})),e},c.prototype.clone=function(){var e=[],t=[];return function r(n){for(var i=0;i<e.length;i++)if(e[i]===n)return t[i];if("object"==typeof n&&null!==n){var c=a(n);return e.push(n),t.push(c),o(s(n),(function(e){c[e]=r(n[e])})),e.pop(),t.pop(),c}return n}(this.value)},o(s(c.prototype),(function(e){u[e]=function(t){var r=[].slice.call(arguments,1),o=new c(t);return o[e].apply(o,r)}})),e.exports=u}},t={};function r(o){var s=t[o];if(void 0!==s)return s.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var o={};(()=>{r.d(o,{A9:()=>_t,M_:()=>It,Mq:()=>qt,h4:()=>xt,Eh:()=>yt,eJ:()=>ot,yp:()=>Ct,hw:()=>ft,Xp:()=>mt,dI:()=>Tt,gO:()=>it,qX:()=>et,jF:()=>tt,as:()=>at,cY:()=>Ze,Vl:()=>ct,kD:()=>ut,KD:()=>Et,Jy:()=>Ot,s9:()=>gt,iS:()=>St});var e=r(4530),t=r.n(e);function s(e,t){return function(){return e.apply(t,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:a}=Object,i=(c=Object.create(null),e=>{const t=n.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const u=e=>(e=e.toLowerCase(),t=>i(t)===e),h=e=>t=>typeof t===e,{isArray:p}=Array,d=h("undefined"),l=u("ArrayBuffer"),m=h("string"),f=h("function"),y=h("number"),g=e=>null!==e&&"object"==typeof e,O=e=>{if("object"!==i(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},E=u("Date"),S=u("File"),T=u("Blob"),q=u("FileList"),C=u("URLSearchParams");function R(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let o,s;if("object"!=typeof e&&(e=[e]),p(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{const s=r?Object.getOwnPropertyNames(e):Object.keys(e),n=s.length;let a;for(o=0;o<n;o++)a=s[o],t.call(null,e[a],a,e)}}function w(e,t){t=t.toLowerCase();const r=Object.keys(e);let o,s=r.length;for(;s-- >0;)if(o=r[s],t===o.toLowerCase())return o;return null}const b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,x=e=>!d(e)&&e!==b,v=(k="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>k&&e instanceof k);var k;const P=u("HTMLFormElement"),A=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),j=u("RegExp"),B=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),o={};R(r,((r,s)=>{!1!==t(r,s,e)&&(o[s]=r)})),Object.defineProperties(e,o)},I="abcdefghijklmnopqrstuvwxyz",_="0123456789",N={DIGIT:_,ALPHA:I,ALPHA_DIGIT:I+I.toUpperCase()+_},$={isArray:p,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&f(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||n.call(e)===t||f(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer),t},isString:m,isNumber:y,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:O,isUndefined:d,isDate:E,isFile:S,isBlob:T,isRegExp:j,isFunction:f,isStream:e=>g(e)&&f(e.pipe),isURLSearchParams:C,isTypedArray:v,isFileList:q,forEach:R,merge:function e(){const{caseless:t}=x(this)&&this||{},r={},o=(o,s)=>{const n=t&&w(r,s)||s;O(r[n])&&O(o)?r[n]=e(r[n],o):O(o)?r[n]=e({},o):p(o)?r[n]=o.slice():r[n]=o};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&R(arguments[e],o);return r},extend:(e,t,r,{allOwnKeys:o}={})=>(R(t,((t,o)=>{r&&f(t)?e[o]=s(t,r):e[o]=t}),{allOwnKeys:o}),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,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,o)=>{let s,n,i;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),n=s.length;n-- >0;)i=s[n],o&&!o(i,e,t)||c[i]||(t[i]=e[i],c[i]=!0);e=!1!==r&&a(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:u,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const o=e.indexOf(t,r);return-1!==o&&o===r},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!y(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 o;for(;(o=r.next())&&!o.done;){const r=o.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const o=[];for(;null!==(r=e.exec(t));)o.push(r);return o},isHTMLForm:P,hasOwnProperty:A,hasOwnProp:A,reduceDescriptors:B,freezeMethods:e=>{B(e,((t,r)=>{if(f(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const o=e[r];f(o)&&(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={},o=e=>{e.forEach((e=>{r[e]=!0}))};return p(e)?o(e):o(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:w,global:b,isContextDefined:x,ALPHABET:N,generateString:(e=16,t=N.ALPHA_DIGIT)=>{let r="";const{length:o}=t;for(;e--;)r+=t[Math.random()*o|0];return r},isSpecCompliantForm:function(e){return!!(e&&f(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,o)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[o]=e;const s=p(e)?[]:{};return R(e,((e,t)=>{const n=r(e,o+1);!d(n)&&(s[t]=n)})),t[o]=void 0,s}}return e};return r(e,0)}};function D(e,t,r,o,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),o&&(this.request=o),s&&(this.response=s)}$.inherits(D,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:$.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const K=D.prototype,L={};["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=>{L[e]={value:e}})),Object.defineProperties(D,L),Object.defineProperty(K,"isAxiosError",{value:!0}),D.from=(e,t,r,o,s,n)=>{const a=Object.create(K);return $.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),D.call(a,e.message,t,r,o,s),a.cause=e,a.name=e.name,n&&Object.assign(a,n),a};const G=D;function M(e){return $.isPlainObject(e)||$.isArray(e)}function U(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function F(e,t,r){return e?e.concat(t).map((function(e,t){return e=U(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const H=$.toFlatObject($,{},null,(function(e){return/^is[A-Z]/.test(e)})),z=function(e,t,r){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const o=(r=$.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$.isUndefined(t[e])}))).metaTokens,s=r.visitor||u,n=r.dots,a=r.indexes,i=(r.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if(!i&&$.isBlob(e))throw new G("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,r,s){let i=e;if(e&&!s&&"object"==typeof e)if($.endsWith(r,"{}"))r=o?r:r.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(M)}(e)||($.isFileList(e)||$.endsWith(r,"[]"))&&(i=$.toArray(e)))return r=U(r),i.forEach((function(e,o){!$.isUndefined(e)&&null!==e&&t.append(!0===a?F([r],o,n):null===a?r:r+"[]",c(e))})),!1;return!!M(e)||(t.append(F(s,r,n),c(e)),!1)}const h=[],p=Object.assign(H,{defaultVisitor:u,convertValue:c,isVisitable:M});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(r,o){if(!$.isUndefined(r)){if(-1!==h.indexOf(r))throw Error("Circular reference detected in "+o.join("."));h.push(r),$.forEach(r,(function(r,n){!0===(!($.isUndefined(r)||null===r)&&s.call(t,r,$.isString(n)?n.trim():n,o,p))&&e(r,o?o.concat(n):[n])})),h.pop()}}(e),t};function J(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function V(e,t){this._pairs=[],e&&z(e,this,t)}const W=V.prototype;W.append=function(e,t){this._pairs.push([e,t])},W.toString=function(e){const t=e?function(t){return e.call(this,t,J)}:J;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const X=V;function Y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Q(e,t,r){if(!t)return e;const o=r&&r.encode||Y,s=r&&r.serialize;let n;if(n=s?s(t,r):$.isURLSearchParams(t)?t.toString():new X(t,r).toString(o),n){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}const Z=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){$.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ee={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},te={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,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)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},re=function(e){function t(e,r,o,s){let n=e[s++];const a=Number.isFinite(+n),i=s>=e.length;return n=!n&&$.isArray(o)?o.length:n,i?($.hasOwnProp(o,n)?o[n]=[o[n],r]:o[n]=r,!a):(o[n]&&$.isObject(o[n])||(o[n]=[]),t(e,r,o[n],s)&&$.isArray(o[n])&&(o[n]=function(e){const t={},r=Object.keys(e);let o;const s=r.length;let n;for(o=0;o<s;o++)n=r[o],t[n]=e[n];return t}(o[n])),!a)}if($.isFormData(e)&&$.isFunction(e.entries)){const r={};return $.forEachEntry(e,((e,o)=>{t(function(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),o,r,0)})),r}return null},oe={"Content-Type":void 0},se={transitional:ee,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",o=r.indexOf("application/json")>-1,s=$.isObject(e);if(s&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return o&&o?JSON.stringify(re(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let n;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return z(e,new te.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,o){return te.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((n=$.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return z(n?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||o?(t.setContentType("application/json",!1),function(e,t,r){if($.isString(e))try{return(0,JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||se.transitional,r=t&&t.forcedJSONParsing,o="json"===this.responseType;if(e&&$.isString(e)&&(r&&!this.responseType||o)){const r=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw G.from(e,G.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:te.classes.FormData,Blob:te.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};$.forEach(["delete","get","head"],(function(e){se.headers[e]={}})),$.forEach(["post","put","patch"],(function(e){se.headers[e]=$.merge(oe)}));const ne=se,ae=$.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"]),ie=Symbol("internals");function ce(e){return e&&String(e).trim().toLowerCase()}function ue(e){return!1===e||null==e?e:$.isArray(e)?e.map(ue):String(e)}function he(e,t,r,o,s){return $.isFunction(o)?o.call(this,t,r):(s&&(t=r),$.isString(t)?$.isString(o)?-1!==t.indexOf(o):$.isRegExp(o)?o.test(t):void 0:void 0)}class pe{constructor(e){e&&this.set(e)}set(e,t,r){const o=this;function s(e,t,r){const s=ce(t);if(!s)throw new Error("header name must be a non-empty string");const n=$.findKey(o,s);(!n||void 0===o[n]||!0===r||void 0===r&&!1!==o[n])&&(o[n||t]=ue(e))}const n=(e,t)=>$.forEach(e,((e,r)=>s(e,r,t)));return $.isPlainObject(e)||e instanceof this.constructor?n(e,t):$.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?n((e=>{const t={};let r,o,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),r=e.substring(0,s).trim().toLowerCase(),o=e.substring(s+1).trim(),!r||t[r]&&ae[r]||("set-cookie"===r?t[r]?t[r].push(o):t[r]=[o]:t[r]=t[r]?t[r]+", "+o:o)})),t})(e),t):null!=e&&s(t,e,r),this}get(e,t){if(e=ce(e)){const r=$.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 o;for(;o=r.exec(e);)t[o[1]]=o[2];return t}(e);if($.isFunction(t))return t.call(this,e,r);if($.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ce(e)){const r=$.findKey(this,e);return!(!r||void 0===this[r]||t&&!he(0,this[r],r,t))}return!1}delete(e,t){const r=this;let o=!1;function s(e){if(e=ce(e)){const s=$.findKey(r,e);!s||t&&!he(0,r[s],s,t)||(delete r[s],o=!0)}}return $.isArray(e)?e.forEach(s):s(e),o}clear(e){const t=Object.keys(this);let r=t.length,o=!1;for(;r--;){const s=t[r];e&&!he(0,this[s],s,e,!0)||(delete this[s],o=!0)}return o}normalize(e){const t=this,r={};return $.forEach(this,((o,s)=>{const n=$.findKey(r,s);if(n)return t[n]=ue(o),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]=ue(o),r[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $.forEach(this,((r,o)=>{null!=r&&!1!==r&&(t[o]=e&&$.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[ie]=this[ie]={accessors:{}}).accessors,r=this.prototype;function o(e){const o=ce(e);t[o]||(function(e,t){const r=$.toCamelCase(" "+t);["get","set","has"].forEach((o=>{Object.defineProperty(e,o+r,{value:function(e,r,s){return this[o].call(this,t,e,r,s)},configurable:!0})}))}(r,e),t[o]=!0)}return $.isArray(e)?e.forEach(o):o(e),this}}pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.freezeMethods(pe.prototype),$.freezeMethods(pe);const de=pe;function le(e,t){const r=this||ne,o=t||r,s=de.from(o.headers);let n=o.data;return $.forEach(e,(function(e){n=e.call(r,n,s.normalize(),t?t.status:void 0)})),s.normalize(),n}function me(e){return!(!e||!e.__CANCEL__)}function fe(e,t,r){G.call(this,null==e?"canceled":e,G.ERR_CANCELED,t,r),this.name="CanceledError"}$.inherits(fe,G,{__CANCEL__:!0});const ye=fe,ge=te.isStandardBrowserEnv?{write:function(e,t,r,o,s,n){const a=[];a.push(e+"="+encodeURIComponent(t)),$.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),$.isString(o)&&a.push("path="+o),$.isString(s)&&a.push("domain="+s),!0===n&&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 Oe(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}const Ee=te.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function o(r){let o=r;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{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=o(window.location.href),function(e){const t=$.isString(e)?o(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Se(e,t){let r=0;const o=function(e,t){e=e||10;const r=new Array(e),o=new Array(e);let s,n=0,a=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),u=o[a];s||(s=c),r[n]=i,o[n]=c;let h=a,p=0;for(;h!==n;)p+=r[h++],h%=e;if(n=(n+1)%e,n===a&&(a=(a+1)%e),c-s<t)return;const d=u&&c-u;return d?Math.round(1e3*p/d):void 0}}(50,250);return s=>{const n=s.loaded,a=s.lengthComputable?s.total:void 0,i=n-r,c=o(i);r=n;const u={loaded:n,total:a,progress:a?n/a:void 0,bytes:i,rate:c||void 0,estimated:c&&a&&n<=a?(a-n)/c:void 0,event:s};u[t?"download":"upload"]=!0,e(u)}}const Te={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let o=e.data;const s=de.from(e.headers).normalize(),n=e.responseType;let a;function i(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}$.isFormData(o)&&(te.isStandardBrowserEnv||te.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let c=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 u=Oe(e.baseURL,e.url);function h(){if(!c)return;const o=de.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,r){const o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(new G("Request failed with status code "+r.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),i()}),(function(e){r(e),i()}),{data:n&&"text"!==n&&"json"!==n?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:o,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Q(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=h:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(h)},c.onabort=function(){c&&(r(new G("Request aborted",G.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new G("Network Error",G.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const o=e.transitional||ee;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new G(t,o.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,c)),c=null},te.isStandardBrowserEnv){const t=(e.withCredentials||Ee(u))&&e.xsrfCookieName&&ge.read(e.xsrfCookieName);t&&s.set(e.xsrfHeaderName,t)}void 0===o&&s.setContentType(null),"setRequestHeader"in c&&$.forEach(s.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),$.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),n&&"json"!==n&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Se(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Se(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(r(!t||t.type?new ye(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);p&&-1===te.protocols.indexOf(p)?r(new G("Unsupported protocol "+p+":",G.ERR_BAD_REQUEST,e)):c.send(o||null)}))}};$.forEach(Te,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function qe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ye(null,e)}function Ce(e){return qe(e),e.headers=de.from(e.headers),e.data=le.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=$.isArray(e)?e:[e];const{length:t}=e;let r,o;for(let s=0;s<t&&(r=e[s],!(o=$.isString(r)?Te[r.toLowerCase()]:r));s++);if(!o){if(!1===o)throw new G(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error($.hasOwnProp(Te,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!$.isFunction(o))throw new TypeError("adapter is not a function");return o})(e.adapter||ne.adapter)(e).then((function(t){return qe(e),t.data=le.call(e,e.transformResponse,t),t.headers=de.from(t.headers),t}),(function(t){return me(t)||(qe(e),t&&t.response&&(t.response.data=le.call(e,e.transformResponse,t.response),t.response.headers=de.from(t.response.headers))),Promise.reject(t)}))}const Re=e=>e instanceof de?e.toJSON():e;function we(e,t){t=t||{};const r={};function o(e,t,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function s(e,t,r){return $.isUndefined(t)?$.isUndefined(e)?void 0:o(void 0,e,r):o(e,t,r)}function n(e,t){if(!$.isUndefined(t))return o(void 0,t)}function a(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function i(r,s,n){return n in t?o(r,s):n in e?o(void 0,r):void 0}const c={url:n,method:n,data:n,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:i,headers:(e,t)=>s(Re(e),Re(t),!0)};return $.forEach(Object.keys(e).concat(Object.keys(t)),(function(o){const n=c[o]||s,a=n(e[o],t[o],o);$.isUndefined(a)&&n!==i||(r[o]=a)})),r}const be={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{be[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const xe={};be.transitional=function(e,t,r){function o(e,t){return"[Axios v1.3.4] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,s,n)=>{if(!1===e)throw new G(o(s," has been removed"+(t?" in "+t:"")),G.ERR_DEPRECATED);return t&&!xe[s]&&(xe[s]=!0,console.warn(o(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,s,n)}};const ve={assertOptions:function(e,t,r){if("object"!=typeof e)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let s=o.length;for(;s-- >0;){const n=o[s],a=t[n];if(a){const t=e[n],r=void 0===t||a(t,n,e);if(!0!==r)throw new G("option "+n+" must be "+r,G.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new G("Unknown option "+n,G.ERR_BAD_OPTION)}},validators:be},ke=ve.validators;class Pe{constructor(e){this.defaults=e,this.interceptors={request:new Z,response:new Z}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=we(this.defaults,t);const{transitional:r,paramsSerializer:o,headers:s}=t;let n;void 0!==r&&ve.assertOptions(r,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),void 0!==o&&ve.assertOptions(o,{encode:ke.function,serialize:ke.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),n=s&&$.merge(s.common,s[t.method]),n&&$.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=de.concat(n,s);const a=[];let i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let h,p=0;if(!i){const e=[Ce.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),h=e.length,u=Promise.resolve(t);p<h;)u=u.then(e[p++],e[p++]);return u}h=a.length;let d=t;for(p=0;p<h;){const e=a[p++],t=a[p++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=Ce.call(this,d)}catch(e){return Promise.reject(e)}for(p=0,h=c.length;p<h;)u=u.then(c[p++],c[p++]);return u}getUri(e){return Q(Oe((e=we(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}$.forEach(["delete","get","head","options"],(function(e){Pe.prototype[e]=function(t,r){return this.request(we(r||{},{method:e,url:t,data:(r||{}).data}))}})),$.forEach(["post","put","patch"],(function(e){function t(t){return function(r,o,s){return this.request(we(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Pe.prototype[e]=t(),Pe.prototype[e+"Form"]=t(!0)}));const Ae=Pe;class je{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 o=new Promise((e=>{r.subscribe(e),t=e})).then(e);return o.cancel=function(){r.unsubscribe(t)},o},e((function(e,o,s){r.reason||(r.reason=new ye(e,o,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 je((function(t){e=t})),cancel:e}}}const Be=je,Ie={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(Ie).forEach((([e,t])=>{Ie[t]=e}));const _e=Ie,Ne=function e(t){const r=new Ae(t),o=s(Ae.prototype.request,r);return $.extend(o,Ae.prototype,r,{allOwnKeys:!0}),$.extend(o,r,null,{allOwnKeys:!0}),o.create=function(r){return e(we(t,r))},o}(ne);Ne.Axios=Ae,Ne.CanceledError=ye,Ne.CancelToken=Be,Ne.isCancel=me,Ne.VERSION="1.3.4",Ne.toFormData=z,Ne.AxiosError=G,Ne.Cancel=Ne.CanceledError,Ne.all=function(e){return Promise.all(e)},Ne.spread=function(e){return function(t){return e.apply(null,t)}},Ne.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},Ne.mergeConfig=we,Ne.AxiosHeaders=de,Ne.formToJSON=e=>re($.isHTMLForm(e)?new FormData(e):e),Ne.HttpStatusCode=_e,Ne.default=Ne;const $e=Ne,{Axios:De,AxiosError:Ke,CanceledError:Le,isCancel:Ge,CancelToken:Me,VERSION:Ue,all:Fe,Cancel:He,isAxiosError:ze,spread:Je,toFormData:Ve,AxiosHeaders:We,HttpStatusCode:Xe,formToJSON:Ye,mergeConfig:Qe}=$e;function Ze(e){let t={};if(e instanceof We){const r=e.toJSON();t={},Object.entries(r).forEach((([e,r])=>{const o=e.toLowerCase();"boolean"==typeof r||"number"==typeof r||"string"==typeof r?t[o]=r.toString():Array.isArray(r)&&(t[o]=r.join(", "))}))}return Object.keys(t).length?t:void 0}function et(e,t){return"isAxiosError"in e?{request:{url:e.config?.url??"",method:e.config?.method,params:e.config?.params,headers:Ze(e.config?.headers),data:e.config?.data},response:{code:e.code,message:e.response?.status?void 0:e.message,status:e.response?.status,headers:Ze(e.response?.headers),data:e.response?.data},stats:t}:null}function tt(e,t){return{request:{url:e.config?.url??"",method:e.config?.method,params:e.config?.params,headers:e.request?.headers,data:e.config?.data},response:{status:e.status,headers:Ze(e.headers),data:e.data},stats:t}}var rt=r(8842);const ot=500,st={maxRetries:0,delayMs:0},nt=[rt.Status.InternalServerError,rt.Status.NotImplemented,rt.Status.BadGateway,rt.Status.ServiceUnavailable,rt.Status.GatewayTimeout];function at(e){return $e.create({httpsAgent:void 0})}function it(e,t){if(!t||0===e)return 0;const r=t.delayMs*2**(e-1);if(t.jitter){const t=r*(1+1/(e+1));return Math.floor(Math.random()*t)}return r}function ct(e){let t="";if("string"!=typeof e)throw new qt("The [input] parameter must be a string");if(t=e.trim().toLowerCase(),t=t.replace(/ {2,}/g,""),t=t.replace(/&/g,"and"),t=t.replace(/[ _]/g,"-"),t=t.replace(/[^0-9a-z-]+/g,""),t=t.replace(/-{2,}/g,"-"),t.length&&"-"===t[0]&&(t=t.slice(1)),t.length&&"-"===t[t.length-1]&&(t=t.slice(0,-1)),t.length<2)throw new qt(`Formatted key did not meet minimum length of 2 characters: ${t}`);if(t.length>256)throw new qt(`Formatted key exceeds the maximum length of 256 characters: ${t}`);return t}function ut(e){if(e?.attributes?.length){const t=e.attributes?.find((t=>t.name===e.name));if(t)return t.value}return null}var ht=r(3692),pt=r.n(ht);function dt(e){return lt(e,{})}function lt(e,t){if(t&&e)for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]&&"object"==typeof e[r]?t[r]=lt(t[r],e[r]):t[r]=e[r]);return t}const mt=["password","refresh_token"],ft=["authorization"],yt="********";function gt(e){return Et(e,mt)}function Ot(e){return Et(e,ft)}function Et(e,t,r=yt){if("object"==typeof e&&null!=e){let o={};return o=dt(e instanceof We?e.toJSON():e),pt()(o).forEach((function(){t.includes(this.key?.toLowerCase()??"")&&this.update(r)})),o}return e}async function St(e){const t=e?.maxRetries||3,r=e?.delayMs||100,o=!!e?.jitter;for(let s=1;s<=t;s++){if(s>1){const e=it(s-1,{delayMs:r,maxRetries:t,jitter:o});await new Promise((t=>setTimeout(t,e)))}try{return await e.executeFn(s)}catch(e){if(!e.isCommercetoolsError||e.status!==rt.Status.Conflict||s===t)throw e}}}function Tt(e){let t="@gradientedge/commercetools-utils";return e&&(t=`${t} (${e})`),t}class qt extends Error{constructor(e,t,r){super(e),this.isCommercetoolsError=!0,this.data=t,this.status=r,Object.setPrototypeOf(this,qt.prototype)}static fromAxiosError(e){return new qt(e.message,{code:e.code,request:{url:e.config?.url,method:e.config?.method,headers:Ot(Ze(e.config?.headers)),params:gt(e.config?.params),data:gt(this.parseRequestData(e.config))},response:{status:e.response?.status,data:gt(e.response?.data),headers:Ze(e.response?.headers)}},e.response?.status)}static parseRequestData(e){if(!e)return null;let t=e?.data;if("string"==typeof t&&t){let r="";if("string"==typeof e?.headers?.["Content-Type"]&&(r=e?.headers?.["Content-Type"]),"application/json"===r.substring(0,16))try{t=JSON.parse(e.data)}catch(e){}else if("application/x-www-form-urlencoded"===r.substring(0,33))try{const r=new URLSearchParams(e.data),o={};r.forEach(((e,t,r)=>{const s=r.getAll(t);0===s.length?o[t]="":1===s.length?o[t]=s[0]:o[t]=s})),t=o}catch(e){}}return t}toJSON(){return{status:this.status,message:this.message,data:this.data,isCommercetoolsError:!0}}toString(){return t()(this.toJSON())}}var Ct;!function(e){e.NORTH_AMERICA_GCP="north_america_gcp",e.NORTH_AMERICA_AWS="north_america_aws",e.EUROPE_GCP="europe_gcp",e.EUROPE_AWS="europe_aws",e.AUSTRALIA_GCP="australia_gcp"}(Ct||(Ct={}));const Rt={[Ct.EUROPE_GCP]:{auth:"https://auth.europe-west1.gcp.commercetools.com",api:"https://api.europe-west1.gcp.commercetools.com"},[Ct.EUROPE_AWS]:{auth:"https://auth.eu-central-1.aws.commercetools.com",api:"https://api.eu-central-1.aws.commercetools.com"},[Ct.NORTH_AMERICA_GCP]:{auth:"https://auth.us-central1.gcp.commercetools.com",api:"https://api.us-central1.gcp.commercetools.com"},[Ct.NORTH_AMERICA_AWS]:{auth:"https://auth.us-east-2.aws.commercetools.com",api:"https://api.us-east-2.aws.commercetools.com"},[Ct.AUSTRALIA_GCP]:{auth:"https://auth.australia-southeast1.gcp.commercetools.com",api:"https://api.australia-southeast1.gcp.commercetools.com"}},wt=["anonymous_id","customer_id"];function bt(e,t){return e?e.map((e=>`${e}:${t}`)).join(" "):""}class xt{constructor(e){var t;this.accessToken="",this.expiresIn=0,this.expiresAt=new Date,this.scopes=[],this.accessToken=e.access_token,this.expiresIn=e.expires_in,this.scopes=(t=e.scope)?t.split(" ").map((e=>e.split(":")[0])).filter((e=>!wt.includes(e))):[],this.anonymousId=this.extractKeyFromScope("anonymous_id",e.scope),this.customerId=this.extractKeyFromScope("customer_id",e.scope),this.expiresAt=new Date((new Date).getTime()+1e3*e.expires_in),"refresh_token"in e&&e.refresh_token&&(this.refreshToken=e.refresh_token)}expiresWithin(e){const t=(new Date).getTime()+1e3*e;return this.expiresAt.getTime()<t}extractKeyFromScope(e,t){if(!t||!e)return;const r=t?.split(" ");if(!Array.isArray(r)||0===r.length)return;const o=r.find((t=>t.slice(0,e.length+1)===`${e}:`));return o?o.slice(e.length+1):void 0}}var vt;function kt(e){return!e.isAxiosError||!e.request||!e.response||nt.includes(e.response.status)}function Pt(e){return e.isAxiosError?qt.fromAxiosError(e):e}function At(e){const t=at(e.httpsAgent),r={"User-Agent":Tt(e.systemIdentifier)};return o=>{const s={...r,...o.headers};return async function(e){const{retry:t,onBeforeRequest:r,onAfterResponse:o,axiosInstance:s}=e,n=e.timeoutMs??5e3,a={};let i,c=dt(e.request),u=0;Object.keys(c.headers??{}).map((e=>e.toLowerCase())).includes("user-agent")||(c.headers??(c.headers={}),c.headers["User-Agent"]=Tt());let h,p,d=0;do{if(h=null,p=null,u>0){a["X-Retry-Count"]=`${u}`;const e=it(u,t);await new Promise((t=>setTimeout(t,e)))}try{if(r){const e=await r(c);e&&(c=e)}h=Date.now();const e=await s({...c,headers:{...c.headers,...a},timeout:n});return p=Date.now(),d+=p-h,o&&o(tt(e,{accumulativeDurationMs:d,durationMs:p-h,retries:u})),e.data}catch(e){if(p=Date.now(),d+=h?p-h:0,o){const t=et(e,{accumulativeDurationMs:d,durationMs:h?p-h:0,retries:u});t&&o(t)}if(!kt(e))throw Pt(e);i=e}u++}while(u<=t.maxRetries);throw Pt(i)}({axiosInstance:t,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,request:{...o,headers:s},retry:{...st,...e.retry},timeoutMs:e.timeoutMs})}}!function(e){e.CLIENT_CREDENTIALS="client_credentials",e.REFRESH_TOKEN="refresh_token",e.PASSWORD="password"}(vt||(vt={}));class jt{constructor(e){this.config=e,this.endpoints=Rt[this.config.region],this.requestExecutor=At({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}async getClientGrant(e){return this.post("/token",{grant_type:vt.CLIENT_CREDENTIALS,scope:bt(e,this.config.projectKey)})}async refreshGrant(e){return await this.post("/token",{grant_type:vt.REFRESH_TOKEN,refresh_token:e})}async login(e){return this.post(`/${this.config.projectKey}${this.applyStore("/customers/token",e.storeKey)}`,{username:e.username,password:e.password,grant_type:vt.PASSWORD,scope:bt(e.scopes,this.config.projectKey)})}async revokeToken(e){await this.post("/token/revoke",{token:e.tokenValue,token_type_hint:e.tokenType})}async logout(e){const t=(await Promise.allSettled([this.revokeToken({tokenType:"access_token",tokenValue:e.accessToken}),this.revokeToken({tokenType:"refresh_token",tokenValue:e.refreshToken})])).reduce(((e,t)=>("rejected"===t.status&&e.push(t.reason),e)),[]);if(t.length)throw new qt("Logout failed in one or more calls to the token revocation endpoint",t)}async getAnonymousGrant(e){const t={grant_type:vt.CLIENT_CREDENTIALS};return e?.scopes?.length&&(t.scope=bt(e.scopes,this.config.projectKey)),e?.anonymousId&&(t.anonymous_id=e.anonymousId),this.post(`/${this.config.projectKey}/anonymous/token`,t)}async post(e,t){return await this.requestExecutor(this.getRequestOptions({path:e,body:t}))}getRequestOptions(e){const t=`${this.endpoints.auth}/oauth${e.path}`;let r;const o={Authorization:`Basic ${s=this.config.clientId,n=this.config.clientSecret,btoa(`${s}:${n}`)}`,"Content-Type":"application/x-www-form-urlencoded"};var s,n;return e.correlationId&&""!==e.correlationId&&(o["X-Correlation-ID"]=e.correlationId,delete e.correlationId),e.body&&(r=new URLSearchParams(e.body).toString()),{method:"POST",data:r,url:t,headers:o}}applyStore(e,t){return"string"==typeof t&&""!==t?`/in-store/key=${t}${e}`:this.config.storeKey?`/in-store/key=${this.config.storeKey}${e}`:e}}const Bt={refreshIfWithinSecs:1800,timeoutMs:5e3};class It{constructor(e){if(this.grantPromise=null,this.config={...Bt,...e},!this.config.clientScopes.length)throw new qt("`config.clientScopes` must contain at least one scope");this.api=new jt(e)}async getClientGrant(){return this.grantPromise?this.grantPromise:this.grant&&!this.grant.expiresWithin(this.config.refreshIfWithinSecs)?this.grant:(this.grantPromise=this.api.getClientGrant(this.config.clientScopes).then((e=>(this.grant=new xt(e),this.grant))).finally((()=>{this.grantPromise=null})),this.grantPromise)}async refreshCustomerGrant(e){const t=await this.api.refreshGrant(e);return new xt({...t,refresh_token:e})}async login(e){const t=e.scopes||this.config.customerScopes;if(!t)throw new qt("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");await this.getClientGrant();const r=await this.api.login({...e,scopes:t});return new xt(r)}async getAnonymousGrant(e){const t=e?.scopes||this.config.customerScopes,r=e?.anonymousId;if(!t)throw new qt("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");await this.getClientGrant();const o=await this.api.getAnonymousGrant({scopes:t,anonymousId:r});return new xt(o)}async logout(e){await this.api.logout(e)}async revokeToken(e){await this.api.revokeToken(e)}}class _t{constructor(e){_t.validateConfig(e),this.config=e,this.auth=new It(e),this.endpoints=Rt[this.config.region],this.requestExecutor=At({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}getStoreById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/${e.id}`,method:"GET"})}getStoreByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/key=${e.key}`,method:"GET"})}queryStores(e){return this.request({...this.extractCommonRequestOptions(e),path:"/stores",method:"GET"})}createStore(e){return this.request({path:"/stores",method:"POST",data:e.data})}updateStoreById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/${e.id}`,method:"POST",data:e.data})}updateStoreByKey(e){return this.request({path:`/stores/key=${e.key}`,method:"POST",data:e.data})}deleteStoreById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteStoreByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/key=${e.key}`,method:"DELETE",params:{...e.params,version:e.version}})}getCategoryById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/${e.id}`,method:"GET"})}getCategoryByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${e.key}`,method:"GET"})}queryChannels(e){return this.request({...this.extractCommonRequestOptions(e),path:"/channels",method:"GET"})}async importOrder(e){return this.request({...this.extractCommonRequestOptions(e),path:"/orders/import",method:"POST",data:e.data})}getChannelById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/channels/${e.id}`,method:"GET"})}async getChannelByKey(e){const t=await this.request({...this.extractCommonRequestOptions(e),path:"/channels",method:"GET",params:{where:`key="${e.key}"`,limit:1}});if(!t?.count)throw new qt(`No channel found with key [${e.key}]`,null,404);return t.results[0]}getCategory(e){if(!e.id&&!e.key)throw new qt("Either an id, key or slug must be provided");return e.id?this.request({...this.extractCommonRequestOptions(e),path:`/categories/${e.id}`,method:"GET"}):this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${e.key}`,method:"GET"})}async getCategoryBySlug(e){if(!e.languageCode&&!e.languageCodes)throw new qt("Either the `languageCode` or `languageCodes` property must be provided");const t=[];e.languageCodes?t.push(...e.languageCodes):e.languageCode&&t.push(e.languageCode);const r=await this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,where:`slug(${t.map((t=>`${t}="${e.slug}"`)).join(" or ")})`}}),path:"/categories",method:"GET"});if(!r.count)throw new qt(`No category found with slug [${e.slug}] and language code [${e.languageCode}]`,{options:e},404);return r.results[0]}queryCategories(e){return this.request({...this.extractCommonRequestOptions(e),path:"/categories",method:"GET"})}async getCategoryParents(e){const t=await this.getCategory({...e,params:{...e.params,expand:"ancestors[*]"}}),r=t.ancestors.map((e=>e.obj));return r.push({...t,ancestors:t.ancestors.map((e=>({id:e.id,typeId:e.typeId})))}),r}getProductById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/${e.id}`,method:"GET"})}getProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${e.key}`,method:"GET"})}getProductProjectionById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-projections/${e.id}`,e.storeKey),method:"GET"})}getProductProjectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-projections/key=${e.key}`,e.storeKey),method:"GET"})}async getProductProjectionBySlug(e){if(!e.languageCode&&!e.languageCodes)throw new qt("Either the `languageCode` or `languageCodes` property must be provided");const t=[];e.languageCodes?t.push(...e.languageCodes):e.languageCode&&t.push(e.languageCode);const r=await this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,where:`slug(${t.map((t=>`${t}="${e.slug}"`)).join(" or ")})`}}),path:"/product-projections",method:"GET"});if(!r.count)throw new qt(`No product projection found with slug [${e.slug}] and language code [${e.languageCode}]`,{options:e},404);return r.results[0]}queryProductProjections(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-projections",method:"GET"})}searchProductProjections(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-projections/search",method:"GET"})}getProductSelectionById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-selections/${e.id}`,e.storeKey),method:"GET"})}getProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-selections/key=${e.key}`,e.storeKey),method:"GET"})}queryProductSelections(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-selections",method:"GET"})}createProductSelection(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-selections",method:"POST",data:e.data})}updateProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-selections/key=${e.key}`,method:"POST",data:{version:e.version,actions:e.actions}})}deleteProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-selections/key=${e.key}&version=${e.version}`,method:"DELETE"})}queryProductsInStore(e){return this.request({...this.extractCommonRequestOptions(e),path:`/in-store/key=${e.storeKey}/product-selection-assignments`,method:"GET"})}getCartById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${e.id}`,e.storeKey),method:"GET"})}async queryCarts(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/carts",e?.storeKey),method:"GET"})}async queryMyCarts(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/carts",e.storeKey),method:"GET",accessToken:e.accessToken})}async createCart(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/carts",e.storeKey),method:"POST",data:e.data})}async updateCartById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${e.id}`,e.storeKey),method:"POST",data:{version:e.version,actions:e.actions}})}async getMyActiveCart(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/active-cart",e.storeKey),method:"GET",accessToken:e.accessToken})}async getMyCartById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${e.cartId}`,e.storeKey),method:"GET",accessToken:e.accessToken})}async createMyCart(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/carts",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken})}async deleteMyActiveCart(e){const t=await this.getMyActiveCart(e);return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${t.id}`,e.storeKey),method:"DELETE",params:{...e.params,version:t.version},accessToken:e.accessToken})}async deleteMyCartById(e){const t=await this.getMyCartById(e);return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${e.cartId}`,e.storeKey),method:"DELETE",params:{...e.params,version:t.version},accessToken:e.accessToken})}async updateMyActiveCart(e){const t=await this.getMyActiveCart(e);return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${t.id}`,e.storeKey),method:"POST",data:{version:t.version,actions:e.actions},accessToken:e.accessToken})}async createMyOrderFromActiveCart(e){const t=await this.getMyActiveCart(e);return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/orders",e.storeKey),method:"POST",data:{version:t.version,id:t.id},accessToken:e.accessToken})}async createOrderFromCart(e){const t=await this.getCartById(e);return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/orders",e.storeKey),method:"POST",data:{version:t.version,id:t.id}})}async deleteCartById(e){return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${e.id}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version}})}createPayment(e){return this.request({...this.extractCommonRequestOptions(e),path:"/payments",method:"POST",data:e.data})}deletePaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/payments/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}updatePaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/payments/${e.id}`,method:"POST",data:e.data})}getPaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/payments/${e.id}`,method:"GET"})}queryPayments(e){return this.request({...this.extractCommonRequestOptions(e),path:"/payments",method:"GET"})}createMyPayment(e){return this.request({...this.extractCommonRequestOptions(e),path:"/me/payments",method:"POST",data:e.data,accessToken:e.accessToken})}updateMyPaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${e.id}`,method:"POST",data:e.data,accessToken:e.accessToken})}getMyPaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${e.id}`,method:"GET",accessToken:e.accessToken})}queryMyPayments(e){return this.request({...this.extractCommonRequestOptions(e),path:"/me/payments",method:"GET",accessToken:e.accessToken})}deleteMyPaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${e.id}`,method:"DELETE",params:{version:e.version},accessToken:e.accessToken})}getMyOrderById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/orders/${e.id}`,e.storeKey),method:"GET",accessToken:e.accessToken})}queryMyOrders(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/orders",e.storeKey),method:"GET",accessToken:e.accessToken})}updateOrderById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${e.id}`,e.storeKey),method:"POST",data:e.data})}updateOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${e.orderNumber}`,e.storeKey),method:"POST",data:e.data})}getOrderById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${e.id}`,e.storeKey),method:"GET"})}getOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${e.orderNumber}`,e.storeKey),method:"GET"})}deleteOrderById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${e.id}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}deleteOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${e.orderNo}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}queryOrders(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/orders",e.storeKey),method:"GET"})}createProduct(e){return this.request({...this.extractCommonRequestOptions(e),path:"/products",method:"POST",data:e.data})}updateProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${e.key}`,method:"POST",data:e.data})}updateProductById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/${e.id}`,method:"POST",data:e.data})}async deleteProductById(e){let t=e.version;return e.unpublish&&(t=(await this.unpublishProductById({id:e.id,version:e.version})).version),this.request({...this.extractCommonRequestOptions(e),path:`/products/${e.id}`,method:"DELETE",params:{...e.params,version:t}})}async deleteProductByKey(e){let t=e.version;return e.unpublish&&(t=(await this.unpublishProductByKey({key:e.key,version:e.version})).version),this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${e.key}`,method:"DELETE",params:{...e.params,version:t}})}unpublishProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${e.key}`,method:"POST",params:e.params,data:{version:e.version,actions:[{action:"unpublish"}]}})}unpublishProductById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/${e.id}`,method:"POST",params:e.params,data:{version:e.version,actions:[{action:"unpublish"}]}})}createCategory(e){return this.request({path:"/categories",method:"POST",data:e.data})}updateCategoryByKey(e){return this.request({path:`/categories/key=${e.key}`,method:"POST",data:e.data})}updateCategoryById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/${e.id}`,method:"POST",data:e.data})}deleteCategoryById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteCategoryByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${e.key}`,method:"DELETE",params:{...e.params,version:e.version}})}createAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/customers",e.storeKey),method:"POST",data:e.data})}deleteCustomerById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/${e.id}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}deleteCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/key=${e.key}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}createMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/signup",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken})}loginMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/login",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken})}login(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/login",e.storeKey),method:"POST",data:e.data})}getMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me",e.storeKey),method:"GET",accessToken:e.accessToken})}updateMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data})}changeMyPassword(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/password",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data})}resetMyPassword(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/password/reset",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data})}getPasswordResetToken(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/customers/password-token",e.storeKey),method:"POST",data:e.data})}getCustomerById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/${e.id}`,e.storeKey),method:"GET"})}getCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/key=${e.key}`,e.storeKey),method:"GET"})}getCustomerByPasswordToken(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/password-token=${e.token}`,e.storeKey),method:"GET"})}queryCustomers(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/customers",e.storeKey),method:"GET"})}updateCustomerById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customers/${e.id}`,method:"POST",data:e.data})}updateCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customers/key=${e.key}`,method:"POST",data:e.data})}getProductTypeById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-types/${e.id}`,method:"GET"})}getProductTypeByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-types/key=${e.key}`,method:"GET"})}queryProductTypes(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-types",method:"GET"})}getTypeById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/types/${e.id}`,method:"GET"})}getTypeByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/types/key=${e.key}`,method:"GET"})}queryTypes(e){return this.request({...this.extractCommonRequestOptions(e),path:"/types",method:"GET"})}getDiscountCodeById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/discount-codes/${e.id}`,method:"GET"})}getCartDiscountById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/cart-discounts/${e.id}`,method:"GET"})}getCartDiscountByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/cart-discounts/key=${e.key}`,method:"GET"})}queryCartDiscounts(e){return this.request({...this.extractCommonRequestOptions(e),path:"/cart-discounts",method:"GET"})}getCustomObject(e){return this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${e.container}/${e.key}`,method:"GET"})}getCustomObjectById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${e.id}`,method:"GET"})}saveCustomObject(e){return this.request({...this.extractCommonRequestOptions(e),path:"/custom-objects",method:"POST",data:e.data})}deleteCustomObject(e){return this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${e.container}/${e.key}`,method:"DELETE"})}getShippingMethodById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/shipping-methods/${e.id}`,method:"GET"})}getShippingMethodByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/shipping-methods/key=${e.key}`,method:"GET"})}getShippingMethodsForLocation(e){return this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,country:e.country,state:e.state,currency:e.currency}}),path:"/shipping-methods/matching-location",method:"GET",accessToken:e.accessToken})}getShippingMethodsForCart(e){return this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,cartId:e.cartId}}),path:"/shipping-methods/matching-cart",method:"GET",accessToken:e.accessToken})}queryShippingMethods(e){return this.request({...this.extractCommonRequestOptions(e),path:"/shipping-methods",method:"GET"})}getCustomerGroupById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${e.id}`,method:"GET"})}getCustomerGroupByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/key=${e.key}`,method:"GET"})}queryCustomerGroups(e){return this.request({...this.extractCommonRequestOptions(e),path:"/customer-groups",method:"GET"})}createCustomerGroup(e){return this.request({path:"/customer-groups",method:"POST",data:e.data})}updateCustomerGroupByKey(e){return this.request({path:`/customer-groups/key=${e.key}`,method:"POST",data:e.data})}updateCustomerGroupById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${e.id}`,method:"POST",data:e.data})}deleteCustomerGroupById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteCustomerGroupByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/key=${e.key}`,method:"DELETE",params:{...e.params,version:e.version}})}getStateById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/states/${e.id}`,method:"GET"})}getStateByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/states/key=${e.key}`,method:"GET"})}queryStates(e){return this.request({...this.extractCommonRequestOptions(e),path:"/states",method:"GET"})}getStandalonePriceById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${e.id}`,method:"GET"})}getStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${e.key}`,method:"GET"})}queryStandalonePrices(e){return this.request({...this.extractCommonRequestOptions(e),path:"/standalone-prices",method:"GET"})}createStandalonePrice(e){return this.request({...this.extractCommonRequestOptions(e),path:"/standalone-prices",method:"POST",data:e.data})}updateStandalonePriceById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${e.id}`,method:"POST",data:e.data})}updateStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${e.key}`,method:"POST",data:e.data})}deleteStandalonePriceById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${e.key}`,method:"DELETE",params:{...e.params,version:e.version}})}graphql(e){return this.request({...this.extractCommonRequestOptions(e),path:"/graphql",method:"POST",data:e.data,accessToken:e.accessToken})}async request(e){const t=await this.getRequestOptions(e);return await this.requestExecutor(t)}async getRequestOptions(e){let t,r=e.accessToken;const o=`${this.endpoints.api}/${this.config.projectKey}${e.path}`;r||(r=(await this.auth.getClientGrant()).accessToken);const s={...e.headers,Authorization:`Bearer ${r}`};return"string"==typeof e.correlationId&&""!==e.correlationId&&(s["X-Correlation-ID"]=e.correlationId,delete e.correlationId),e.params&&Object.keys(e.params).length&&(t=e.params),{method:e.method,data:e.data,url:o,headers:s,params:t}}extractCommonRequestOptions(e){return e?{correlationId:e.correlationId,params:e.params,retry:e.retry}:{}}applyStore(e,t){return"string"==typeof t&&""!==t?`/in-store/key=${t}${e}`:this.config.storeKey?`/in-store/key=${this.config.storeKey}${e}`:e}static validateConfig(e){const t=[];if(e?(e.projectKey?"string"!=typeof e.projectKey&&t.push("The `projectKey` property must be a string"):t.push("The `projectKey` property is empty"),e.clientId?"string"!=typeof e.clientId&&t.push("The `clientId` property must be a string"):t.push("The `clientId` property is empty"),e.clientSecret?"string"!=typeof e.clientSecret&&t.push("The `clientSecret` property must be a string"):t.push("The `clientSecret` property is empty"),Array.isArray(e.clientScopes)?0===e.clientScopes.length&&t.push("The `clientScopes` property must have at least 1 scope defined"):t.push("The `clientScopes` property must be an array")):t.push("The config object missing or empty"),t.length)throw new qt("The configuration object passed in to the `CommercetoolsApi` constructor is not valid: \n"+t.map((e=>`• ${e}`)).join("\n"))}}})();var s=o.A9,n=o.M_,a=o.Mq,i=o.h4,c=o.Eh,u=o.eJ,h=o.yp,p=o.hw,d=o.Xp,l=o.dI,m=o.gO,f=o.qX,y=o.jF,g=o.as,O=o.cY,E=o.Vl,S=o.kD,T=o.KD,q=o.Jy,C=o.s9,R=o.iS;export{s as CommercetoolsApi,n as CommercetoolsAuth,a as CommercetoolsError,i as CommercetoolsGrant,c as DEFAULT_MASKING_STRING,u as MAX_ITEMS_PER_QUERY,h as Region,p as SENSITIVE_HEADER_NAMES,d as SENSITIVE_PROPERTY_NAMES,l as buildUserAgent,m as calculateDelay,f as convertAxiosError,y as convertAxiosResponse,g as createAxiosInstance,O as extractAxiosHeaders,E as formatAsKey,S as getAttributeValue,T as maskSensitiveData,q as maskSensitiveHeaders,C as maskSensitiveInput,R as retryOnConflict};
|
|
1
|
+
var e={8842:(e,t,r)=>{t.Status=void 0;var o=r(7536);Object.defineProperty(t,"Status",{enumerable:!0,get:function(){return o.Status}});r(7890)},7890:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reason=void 0;const o=r(7536);t.reason=function(e){switch(e){case 200:return"OK";case 203:return"Non-Authoritative Information";case 207:return"Multi-Status";case 226:return"IM Used";case 414:return"URI Too Long";case 418:return"I'm a teapot";case 505:return"HTTP Version Not Supported";default:return(Object.keys(o.Status).find((t=>o.Status[t]===e))||"").replace(/(?!^)([A-Z])/gm," $1")}}},7536:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Status=t.ErrorStatus=t.RedirectionStatus=t.SuccessStatus=t.InformationStatus=void 0,t.InformationStatus={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103},t.SuccessStatus={Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226},t.RedirectionStatus={MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},t.ErrorStatus={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,RequestedRangeNotSatisfiable: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},t.Status=Object.assign(Object.assign(Object.assign(Object.assign({},t.InformationStatus),t.SuccessStatus),t.RedirectionStatus),t.ErrorStatus)},4530:(e,t)=>{function r(e,t){var r=[],o=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]"}),function(s,n){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?o.splice(a,1/0,s):o.push(s),~r.indexOf(n)&&(n=t.call(this,s,n))}else r.push(n);return null==e?n:e.call(this,s,n)}}(e.exports=function(e,t,o,s){return JSON.stringify(e,r(t,s),o)}).getSerialize=r},3692:e=>{function t(e){return Object.prototype.toString.call(e)}var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)}var s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t},n=Object.prototype.hasOwnProperty||function(e,t){return t in e};function a(e){if("object"==typeof e&&null!==e){var n;if(r(e))n=[];else if("[object Date]"===t(e))n=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===t(e))n=new RegExp(e);else if(function(e){return"[object Error]"===t(e)}(e))n={message:e.message};else if(function(e){return"[object Boolean]"===t(e)}(e)||function(e){return"[object Number]"===t(e)}(e)||function(e){return"[object String]"===t(e)}(e))n=Object(e);else if(Object.create&&Object.getPrototypeOf)n=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)n={};else{var a=e.constructor&&e.constructor.prototype||e.__proto__||{},i=function(){};i.prototype=a,n=new i}return o(s(e),(function(t){n[t]=e[t]})),n}return e}function i(e,t,i){var c=[],u=[],h=!0;return function e(p){var d=i?a(p):p,l={},m=!0,f={node:d,node_:p,path:[].concat(c),parent:u[u.length-1],parents:u,key:c[c.length-1],isRoot:0===c.length,level:c.length,circular:null,update:function(e,t){f.isRoot||(f.parent.node[f.key]=e),f.node=e,t&&(m=!1)},delete:function(e){delete f.parent.node[f.key],e&&(m=!1)},remove:function(e){r(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key],e&&(m=!1)},keys:null,before:function(e){l.before=e},after:function(e){l.after=e},pre:function(e){l.pre=e},post:function(e){l.post=e},stop:function(){h=!1},block:function(){m=!1}};if(!h)return f;function y(){if("object"==typeof f.node&&null!==f.node){f.keys&&f.node_===f.node||(f.keys=s(f.node)),f.isLeaf=0===f.keys.length;for(var e=0;e<u.length;e++)if(u[e].node_===p){f.circular=u[e];break}}else f.isLeaf=!0,f.keys=null;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot}y();var g=t.call(f,f.node);return void 0!==g&&f.update&&f.update(g),l.before&&l.before.call(f,f.node),m?("object"!=typeof f.node||null===f.node||f.circular||(u.push(f),y(),o(f.keys,(function(t,r){c.push(t),l.pre&&l.pre.call(f,f.node[t],t);var o=e(f.node[t]);i&&n.call(f.node,t)&&(f.node[t]=o.node),o.isLast=r===f.keys.length-1,o.isFirst=0===r,l.post&&l.post.call(f,o),c.pop()})),u.pop()),l.after&&l.after.call(f,f.node),f):f}(e).node}function c(e){this.value=e}function u(e){return new c(e)}c.prototype.get=function(e){for(var t=this.value,r=0;r<e.length;r++){var o=e[r];if(!t||!n.call(t,o))return;t=t[o]}return t},c.prototype.has=function(e){for(var t=this.value,r=0;r<e.length;r++){var o=e[r];if(!t||!n.call(t,o))return!1;t=t[o]}return!0},c.prototype.set=function(e,t){for(var r=this.value,o=0;o<e.length-1;o++){var s=e[o];n.call(r,s)||(r[s]={}),r=r[s]}return r[e[o]]=t,t},c.prototype.map=function(e){return i(this.value,e,!0)},c.prototype.forEach=function(e){return this.value=i(this.value,e,!1),this.value},c.prototype.reduce=function(e,t){var r=1===arguments.length,o=r?this.value:t;return this.forEach((function(t){this.isRoot&&r||(o=e.call(this,o,t))})),o},c.prototype.paths=function(){var e=[];return this.forEach((function(){e.push(this.path)})),e},c.prototype.nodes=function(){var e=[];return this.forEach((function(){e.push(this.node)})),e},c.prototype.clone=function(){var e=[],t=[];return function r(n){for(var i=0;i<e.length;i++)if(e[i]===n)return t[i];if("object"==typeof n&&null!==n){var c=a(n);return e.push(n),t.push(c),o(s(n),(function(e){c[e]=r(n[e])})),e.pop(),t.pop(),c}return n}(this.value)},o(s(c.prototype),(function(e){u[e]=function(t){var r=[].slice.call(arguments,1),o=new c(t);return o[e].apply(o,r)}})),e.exports=u}},t={};function r(o){var s=t[o];if(void 0!==s)return s.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var o={};(()=>{r.d(o,{A9:()=>_t,M_:()=>It,Mq:()=>qt,h4:()=>xt,Eh:()=>yt,eJ:()=>ot,yp:()=>Ct,hw:()=>ft,Xp:()=>mt,dI:()=>Tt,gO:()=>it,qX:()=>et,jF:()=>tt,as:()=>at,cY:()=>Ze,Vl:()=>ct,kD:()=>ut,KD:()=>Et,Jy:()=>Ot,s9:()=>gt,iS:()=>St});var e=r(4530),t=r.n(e);function s(e,t){return function(){return e.apply(t,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:a}=Object,i=(c=Object.create(null),e=>{const t=n.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const u=e=>(e=e.toLowerCase(),t=>i(t)===e),h=e=>t=>typeof t===e,{isArray:p}=Array,d=h("undefined"),l=u("ArrayBuffer"),m=h("string"),f=h("function"),y=h("number"),g=e=>null!==e&&"object"==typeof e,O=e=>{if("object"!==i(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},E=u("Date"),S=u("File"),T=u("Blob"),q=u("FileList"),C=u("URLSearchParams");function R(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let o,s;if("object"!=typeof e&&(e=[e]),p(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{const s=r?Object.getOwnPropertyNames(e):Object.keys(e),n=s.length;let a;for(o=0;o<n;o++)a=s[o],t.call(null,e[a],a,e)}}function w(e,t){t=t.toLowerCase();const r=Object.keys(e);let o,s=r.length;for(;s-- >0;)if(o=r[s],t===o.toLowerCase())return o;return null}const b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,x=e=>!d(e)&&e!==b,v=(k="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>k&&e instanceof k);var k;const P=u("HTMLFormElement"),A=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),j=u("RegExp"),B=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),o={};R(r,((r,s)=>{!1!==t(r,s,e)&&(o[s]=r)})),Object.defineProperties(e,o)},I="abcdefghijklmnopqrstuvwxyz",_="0123456789",N={DIGIT:_,ALPHA:I,ALPHA_DIGIT:I+I.toUpperCase()+_},$={isArray:p,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&f(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||n.call(e)===t||f(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer),t},isString:m,isNumber:y,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:O,isUndefined:d,isDate:E,isFile:S,isBlob:T,isRegExp:j,isFunction:f,isStream:e=>g(e)&&f(e.pipe),isURLSearchParams:C,isTypedArray:v,isFileList:q,forEach:R,merge:function e(){const{caseless:t}=x(this)&&this||{},r={},o=(o,s)=>{const n=t&&w(r,s)||s;O(r[n])&&O(o)?r[n]=e(r[n],o):O(o)?r[n]=e({},o):p(o)?r[n]=o.slice():r[n]=o};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&R(arguments[e],o);return r},extend:(e,t,r,{allOwnKeys:o}={})=>(R(t,((t,o)=>{r&&f(t)?e[o]=s(t,r):e[o]=t}),{allOwnKeys:o}),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,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,o)=>{let s,n,i;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),n=s.length;n-- >0;)i=s[n],o&&!o(i,e,t)||c[i]||(t[i]=e[i],c[i]=!0);e=!1!==r&&a(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:u,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const o=e.indexOf(t,r);return-1!==o&&o===r},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!y(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 o;for(;(o=r.next())&&!o.done;){const r=o.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const o=[];for(;null!==(r=e.exec(t));)o.push(r);return o},isHTMLForm:P,hasOwnProperty:A,hasOwnProp:A,reduceDescriptors:B,freezeMethods:e=>{B(e,((t,r)=>{if(f(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const o=e[r];f(o)&&(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={},o=e=>{e.forEach((e=>{r[e]=!0}))};return p(e)?o(e):o(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:w,global:b,isContextDefined:x,ALPHABET:N,generateString:(e=16,t=N.ALPHA_DIGIT)=>{let r="";const{length:o}=t;for(;e--;)r+=t[Math.random()*o|0];return r},isSpecCompliantForm:function(e){return!!(e&&f(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,o)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[o]=e;const s=p(e)?[]:{};return R(e,((e,t)=>{const n=r(e,o+1);!d(n)&&(s[t]=n)})),t[o]=void 0,s}}return e};return r(e,0)}};function D(e,t,r,o,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),o&&(this.request=o),s&&(this.response=s)}$.inherits(D,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:$.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const K=D.prototype,L={};["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=>{L[e]={value:e}})),Object.defineProperties(D,L),Object.defineProperty(K,"isAxiosError",{value:!0}),D.from=(e,t,r,o,s,n)=>{const a=Object.create(K);return $.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),D.call(a,e.message,t,r,o,s),a.cause=e,a.name=e.name,n&&Object.assign(a,n),a};const G=D;function M(e){return $.isPlainObject(e)||$.isArray(e)}function U(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function F(e,t,r){return e?e.concat(t).map((function(e,t){return e=U(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const H=$.toFlatObject($,{},null,(function(e){return/^is[A-Z]/.test(e)})),z=function(e,t,r){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const o=(r=$.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$.isUndefined(t[e])}))).metaTokens,s=r.visitor||u,n=r.dots,a=r.indexes,i=(r.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if(!i&&$.isBlob(e))throw new G("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,r,s){let i=e;if(e&&!s&&"object"==typeof e)if($.endsWith(r,"{}"))r=o?r:r.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(M)}(e)||($.isFileList(e)||$.endsWith(r,"[]"))&&(i=$.toArray(e)))return r=U(r),i.forEach((function(e,o){!$.isUndefined(e)&&null!==e&&t.append(!0===a?F([r],o,n):null===a?r:r+"[]",c(e))})),!1;return!!M(e)||(t.append(F(s,r,n),c(e)),!1)}const h=[],p=Object.assign(H,{defaultVisitor:u,convertValue:c,isVisitable:M});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(r,o){if(!$.isUndefined(r)){if(-1!==h.indexOf(r))throw Error("Circular reference detected in "+o.join("."));h.push(r),$.forEach(r,(function(r,n){!0===(!($.isUndefined(r)||null===r)&&s.call(t,r,$.isString(n)?n.trim():n,o,p))&&e(r,o?o.concat(n):[n])})),h.pop()}}(e),t};function J(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function V(e,t){this._pairs=[],e&&z(e,this,t)}const W=V.prototype;W.append=function(e,t){this._pairs.push([e,t])},W.toString=function(e){const t=e?function(t){return e.call(this,t,J)}:J;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const X=V;function Y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Q(e,t,r){if(!t)return e;const o=r&&r.encode||Y,s=r&&r.serialize;let n;if(n=s?s(t,r):$.isURLSearchParams(t)?t.toString():new X(t,r).toString(o),n){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}const Z=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){$.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ee={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},te={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,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)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},re=function(e){function t(e,r,o,s){let n=e[s++];const a=Number.isFinite(+n),i=s>=e.length;return n=!n&&$.isArray(o)?o.length:n,i?($.hasOwnProp(o,n)?o[n]=[o[n],r]:o[n]=r,!a):(o[n]&&$.isObject(o[n])||(o[n]=[]),t(e,r,o[n],s)&&$.isArray(o[n])&&(o[n]=function(e){const t={},r=Object.keys(e);let o;const s=r.length;let n;for(o=0;o<s;o++)n=r[o],t[n]=e[n];return t}(o[n])),!a)}if($.isFormData(e)&&$.isFunction(e.entries)){const r={};return $.forEachEntry(e,((e,o)=>{t(function(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),o,r,0)})),r}return null},oe={"Content-Type":void 0},se={transitional:ee,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",o=r.indexOf("application/json")>-1,s=$.isObject(e);if(s&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return o&&o?JSON.stringify(re(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let n;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return z(e,new te.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,o){return te.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((n=$.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return z(n?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||o?(t.setContentType("application/json",!1),function(e,t,r){if($.isString(e))try{return(0,JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||se.transitional,r=t&&t.forcedJSONParsing,o="json"===this.responseType;if(e&&$.isString(e)&&(r&&!this.responseType||o)){const r=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw G.from(e,G.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:te.classes.FormData,Blob:te.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};$.forEach(["delete","get","head"],(function(e){se.headers[e]={}})),$.forEach(["post","put","patch"],(function(e){se.headers[e]=$.merge(oe)}));const ne=se,ae=$.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"]),ie=Symbol("internals");function ce(e){return e&&String(e).trim().toLowerCase()}function ue(e){return!1===e||null==e?e:$.isArray(e)?e.map(ue):String(e)}function he(e,t,r,o,s){return $.isFunction(o)?o.call(this,t,r):(s&&(t=r),$.isString(t)?$.isString(o)?-1!==t.indexOf(o):$.isRegExp(o)?o.test(t):void 0:void 0)}class pe{constructor(e){e&&this.set(e)}set(e,t,r){const o=this;function s(e,t,r){const s=ce(t);if(!s)throw new Error("header name must be a non-empty string");const n=$.findKey(o,s);(!n||void 0===o[n]||!0===r||void 0===r&&!1!==o[n])&&(o[n||t]=ue(e))}const n=(e,t)=>$.forEach(e,((e,r)=>s(e,r,t)));return $.isPlainObject(e)||e instanceof this.constructor?n(e,t):$.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?n((e=>{const t={};let r,o,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),r=e.substring(0,s).trim().toLowerCase(),o=e.substring(s+1).trim(),!r||t[r]&&ae[r]||("set-cookie"===r?t[r]?t[r].push(o):t[r]=[o]:t[r]=t[r]?t[r]+", "+o:o)})),t})(e),t):null!=e&&s(t,e,r),this}get(e,t){if(e=ce(e)){const r=$.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 o;for(;o=r.exec(e);)t[o[1]]=o[2];return t}(e);if($.isFunction(t))return t.call(this,e,r);if($.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ce(e)){const r=$.findKey(this,e);return!(!r||void 0===this[r]||t&&!he(0,this[r],r,t))}return!1}delete(e,t){const r=this;let o=!1;function s(e){if(e=ce(e)){const s=$.findKey(r,e);!s||t&&!he(0,r[s],s,t)||(delete r[s],o=!0)}}return $.isArray(e)?e.forEach(s):s(e),o}clear(e){const t=Object.keys(this);let r=t.length,o=!1;for(;r--;){const s=t[r];e&&!he(0,this[s],s,e,!0)||(delete this[s],o=!0)}return o}normalize(e){const t=this,r={};return $.forEach(this,((o,s)=>{const n=$.findKey(r,s);if(n)return t[n]=ue(o),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]=ue(o),r[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $.forEach(this,((r,o)=>{null!=r&&!1!==r&&(t[o]=e&&$.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[ie]=this[ie]={accessors:{}}).accessors,r=this.prototype;function o(e){const o=ce(e);t[o]||(function(e,t){const r=$.toCamelCase(" "+t);["get","set","has"].forEach((o=>{Object.defineProperty(e,o+r,{value:function(e,r,s){return this[o].call(this,t,e,r,s)},configurable:!0})}))}(r,e),t[o]=!0)}return $.isArray(e)?e.forEach(o):o(e),this}}pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.freezeMethods(pe.prototype),$.freezeMethods(pe);const de=pe;function le(e,t){const r=this||ne,o=t||r,s=de.from(o.headers);let n=o.data;return $.forEach(e,(function(e){n=e.call(r,n,s.normalize(),t?t.status:void 0)})),s.normalize(),n}function me(e){return!(!e||!e.__CANCEL__)}function fe(e,t,r){G.call(this,null==e?"canceled":e,G.ERR_CANCELED,t,r),this.name="CanceledError"}$.inherits(fe,G,{__CANCEL__:!0});const ye=fe,ge=te.isStandardBrowserEnv?{write:function(e,t,r,o,s,n){const a=[];a.push(e+"="+encodeURIComponent(t)),$.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),$.isString(o)&&a.push("path="+o),$.isString(s)&&a.push("domain="+s),!0===n&&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 Oe(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}const Ee=te.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function o(r){let o=r;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{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=o(window.location.href),function(e){const t=$.isString(e)?o(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Se(e,t){let r=0;const o=function(e,t){e=e||10;const r=new Array(e),o=new Array(e);let s,n=0,a=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),u=o[a];s||(s=c),r[n]=i,o[n]=c;let h=a,p=0;for(;h!==n;)p+=r[h++],h%=e;if(n=(n+1)%e,n===a&&(a=(a+1)%e),c-s<t)return;const d=u&&c-u;return d?Math.round(1e3*p/d):void 0}}(50,250);return s=>{const n=s.loaded,a=s.lengthComputable?s.total:void 0,i=n-r,c=o(i);r=n;const u={loaded:n,total:a,progress:a?n/a:void 0,bytes:i,rate:c||void 0,estimated:c&&a&&n<=a?(a-n)/c:void 0,event:s};u[t?"download":"upload"]=!0,e(u)}}const Te={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let o=e.data;const s=de.from(e.headers).normalize(),n=e.responseType;let a;function i(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}$.isFormData(o)&&(te.isStandardBrowserEnv||te.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let c=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 u=Oe(e.baseURL,e.url);function h(){if(!c)return;const o=de.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,r){const o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(new G("Request failed with status code "+r.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),i()}),(function(e){r(e),i()}),{data:n&&"text"!==n&&"json"!==n?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:o,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Q(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=h:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(h)},c.onabort=function(){c&&(r(new G("Request aborted",G.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new G("Network Error",G.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const o=e.transitional||ee;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new G(t,o.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,c)),c=null},te.isStandardBrowserEnv){const t=(e.withCredentials||Ee(u))&&e.xsrfCookieName&&ge.read(e.xsrfCookieName);t&&s.set(e.xsrfHeaderName,t)}void 0===o&&s.setContentType(null),"setRequestHeader"in c&&$.forEach(s.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),$.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),n&&"json"!==n&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Se(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Se(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(r(!t||t.type?new ye(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);p&&-1===te.protocols.indexOf(p)?r(new G("Unsupported protocol "+p+":",G.ERR_BAD_REQUEST,e)):c.send(o||null)}))}};$.forEach(Te,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function qe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ye(null,e)}function Ce(e){return qe(e),e.headers=de.from(e.headers),e.data=le.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=$.isArray(e)?e:[e];const{length:t}=e;let r,o;for(let s=0;s<t&&(r=e[s],!(o=$.isString(r)?Te[r.toLowerCase()]:r));s++);if(!o){if(!1===o)throw new G(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error($.hasOwnProp(Te,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!$.isFunction(o))throw new TypeError("adapter is not a function");return o})(e.adapter||ne.adapter)(e).then((function(t){return qe(e),t.data=le.call(e,e.transformResponse,t),t.headers=de.from(t.headers),t}),(function(t){return me(t)||(qe(e),t&&t.response&&(t.response.data=le.call(e,e.transformResponse,t.response),t.response.headers=de.from(t.response.headers))),Promise.reject(t)}))}const Re=e=>e instanceof de?e.toJSON():e;function we(e,t){t=t||{};const r={};function o(e,t,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function s(e,t,r){return $.isUndefined(t)?$.isUndefined(e)?void 0:o(void 0,e,r):o(e,t,r)}function n(e,t){if(!$.isUndefined(t))return o(void 0,t)}function a(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function i(r,s,n){return n in t?o(r,s):n in e?o(void 0,r):void 0}const c={url:n,method:n,data:n,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:i,headers:(e,t)=>s(Re(e),Re(t),!0)};return $.forEach(Object.keys(e).concat(Object.keys(t)),(function(o){const n=c[o]||s,a=n(e[o],t[o],o);$.isUndefined(a)&&n!==i||(r[o]=a)})),r}const be={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{be[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const xe={};be.transitional=function(e,t,r){function o(e,t){return"[Axios v1.3.4] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,s,n)=>{if(!1===e)throw new G(o(s," has been removed"+(t?" in "+t:"")),G.ERR_DEPRECATED);return t&&!xe[s]&&(xe[s]=!0,console.warn(o(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,s,n)}};const ve={assertOptions:function(e,t,r){if("object"!=typeof e)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let s=o.length;for(;s-- >0;){const n=o[s],a=t[n];if(a){const t=e[n],r=void 0===t||a(t,n,e);if(!0!==r)throw new G("option "+n+" must be "+r,G.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new G("Unknown option "+n,G.ERR_BAD_OPTION)}},validators:be},ke=ve.validators;class Pe{constructor(e){this.defaults=e,this.interceptors={request:new Z,response:new Z}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=we(this.defaults,t);const{transitional:r,paramsSerializer:o,headers:s}=t;let n;void 0!==r&&ve.assertOptions(r,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),void 0!==o&&ve.assertOptions(o,{encode:ke.function,serialize:ke.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),n=s&&$.merge(s.common,s[t.method]),n&&$.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=de.concat(n,s);const a=[];let i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let h,p=0;if(!i){const e=[Ce.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),h=e.length,u=Promise.resolve(t);p<h;)u=u.then(e[p++],e[p++]);return u}h=a.length;let d=t;for(p=0;p<h;){const e=a[p++],t=a[p++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=Ce.call(this,d)}catch(e){return Promise.reject(e)}for(p=0,h=c.length;p<h;)u=u.then(c[p++],c[p++]);return u}getUri(e){return Q(Oe((e=we(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}$.forEach(["delete","get","head","options"],(function(e){Pe.prototype[e]=function(t,r){return this.request(we(r||{},{method:e,url:t,data:(r||{}).data}))}})),$.forEach(["post","put","patch"],(function(e){function t(t){return function(r,o,s){return this.request(we(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Pe.prototype[e]=t(),Pe.prototype[e+"Form"]=t(!0)}));const Ae=Pe;class je{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 o=new Promise((e=>{r.subscribe(e),t=e})).then(e);return o.cancel=function(){r.unsubscribe(t)},o},e((function(e,o,s){r.reason||(r.reason=new ye(e,o,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 je((function(t){e=t})),cancel:e}}}const Be=je,Ie={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(Ie).forEach((([e,t])=>{Ie[t]=e}));const _e=Ie,Ne=function e(t){const r=new Ae(t),o=s(Ae.prototype.request,r);return $.extend(o,Ae.prototype,r,{allOwnKeys:!0}),$.extend(o,r,null,{allOwnKeys:!0}),o.create=function(r){return e(we(t,r))},o}(ne);Ne.Axios=Ae,Ne.CanceledError=ye,Ne.CancelToken=Be,Ne.isCancel=me,Ne.VERSION="1.3.4",Ne.toFormData=z,Ne.AxiosError=G,Ne.Cancel=Ne.CanceledError,Ne.all=function(e){return Promise.all(e)},Ne.spread=function(e){return function(t){return e.apply(null,t)}},Ne.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},Ne.mergeConfig=we,Ne.AxiosHeaders=de,Ne.formToJSON=e=>re($.isHTMLForm(e)?new FormData(e):e),Ne.HttpStatusCode=_e,Ne.default=Ne;const $e=Ne,{Axios:De,AxiosError:Ke,CanceledError:Le,isCancel:Ge,CancelToken:Me,VERSION:Ue,all:Fe,Cancel:He,isAxiosError:ze,spread:Je,toFormData:Ve,AxiosHeaders:We,HttpStatusCode:Xe,formToJSON:Ye,mergeConfig:Qe}=$e;function Ze(e){let t={};if(e instanceof We){const r=e.toJSON();t={},Object.entries(r).forEach((([e,r])=>{const o=e.toLowerCase();"boolean"==typeof r||"number"==typeof r||"string"==typeof r?t[o]=r.toString():Array.isArray(r)&&(t[o]=r.join(", "))}))}return Object.keys(t).length?t:void 0}function et(e,t){return"isAxiosError"in e?{request:{url:e.config?.url??"",method:e.config?.method,params:e.config?.params,headers:Ze(e.config?.headers),data:e.config?.data},response:{code:e.code,message:e.response?.status?void 0:e.message,status:e.response?.status,headers:Ze(e.response?.headers),data:e.response?.data},stats:t}:null}function tt(e,t){return{request:{url:e.config?.url??"",method:e.config?.method,params:e.config?.params,headers:Ze(e.config?.headers),data:e.config?.data},response:{status:e.status,headers:Ze(e.headers),data:e.data},stats:t}}var rt=r(8842);const ot=500,st={maxRetries:0,delayMs:0},nt=[rt.Status.InternalServerError,rt.Status.NotImplemented,rt.Status.BadGateway,rt.Status.ServiceUnavailable,rt.Status.GatewayTimeout];function at(e){return $e.create({httpsAgent:void 0})}function it(e,t){if(!t||0===e)return 0;const r=t.delayMs*2**(e-1);if(t.jitter){const t=r*(1+1/(e+1));return Math.floor(Math.random()*t)}return r}function ct(e){let t="";if("string"!=typeof e)throw new qt("The [input] parameter must be a string");if(t=e.trim().toLowerCase(),t=t.replace(/ {2,}/g,""),t=t.replace(/&/g,"and"),t=t.replace(/[ _]/g,"-"),t=t.replace(/[^0-9a-z-]+/g,""),t=t.replace(/-{2,}/g,"-"),t.length&&"-"===t[0]&&(t=t.slice(1)),t.length&&"-"===t[t.length-1]&&(t=t.slice(0,-1)),t.length<2)throw new qt(`Formatted key did not meet minimum length of 2 characters: ${t}`);if(t.length>256)throw new qt(`Formatted key exceeds the maximum length of 256 characters: ${t}`);return t}function ut(e){if(e?.attributes?.length){const t=e.attributes?.find((t=>t.name===e.name));if(t)return t.value}return null}var ht=r(3692),pt=r.n(ht);function dt(e){return lt(e,{})}function lt(e,t){if(t&&e)for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&("object"==typeof e[r]?(Array.isArray(e[r])?t[r]=[]:t[r]={},t[r]=lt(e[r],t[r])):t[r]=e[r]);return t}const mt=["password","refresh_token"],ft=["authorization"],yt="********";function gt(e){return Et(e,mt)}function Ot(e){return Et(e,ft)}function Et(e,t,r=yt){if("object"==typeof e&&null!=e){let o={};return o=dt(e instanceof We?e.toJSON():e),pt()(o).forEach((function(){t.includes(this.key?.toLowerCase()??"")&&this.update(r)})),o}return e}async function St(e){const t=e?.maxRetries||3,r=e?.delayMs||100,o=!!e?.jitter;for(let s=1;s<=t;s++){if(s>1){const e=it(s-1,{delayMs:r,maxRetries:t,jitter:o});await new Promise((t=>setTimeout(t,e)))}try{return await e.executeFn(s)}catch(e){if(!e.isCommercetoolsError||e.status!==rt.Status.Conflict||s===t)throw e}}}function Tt(e){let t="@gradientedge/commercetools-utils";return e&&(t=`${t} (${e})`),t}class qt extends Error{constructor(e,t,r){super(e),this.isCommercetoolsError=!0,this.data=t,this.status=r,Object.setPrototypeOf(this,qt.prototype)}static fromAxiosError(e){return new qt(e.message,{code:e.code,request:{url:e.config?.url,method:e.config?.method,headers:Ot(Ze(e.config?.headers)),params:gt(e.config?.params),data:gt(this.parseRequestData(e.config))},response:{status:e.response?.status,data:gt(e.response?.data),headers:Ze(e.response?.headers)}},e.response?.status)}static parseRequestData(e){if(!e)return null;let t=e?.data;if("string"==typeof t&&t){let r="";if("string"==typeof e?.headers?.["Content-Type"]&&(r=e?.headers?.["Content-Type"]),"application/json"===r.substring(0,16))try{t=JSON.parse(e.data)}catch(e){}else if("application/x-www-form-urlencoded"===r.substring(0,33))try{const r=new URLSearchParams(e.data),o={};r.forEach(((e,t,r)=>{const s=r.getAll(t);0===s.length?o[t]="":1===s.length?o[t]=s[0]:o[t]=s})),t=o}catch(e){}}return t}toJSON(){return{status:this.status,message:this.message,data:this.data,isCommercetoolsError:!0}}toString(){return t()(this.toJSON())}}var Ct;!function(e){e.NORTH_AMERICA_GCP="north_america_gcp",e.NORTH_AMERICA_AWS="north_america_aws",e.EUROPE_GCP="europe_gcp",e.EUROPE_AWS="europe_aws",e.AUSTRALIA_GCP="australia_gcp"}(Ct||(Ct={}));const Rt={[Ct.EUROPE_GCP]:{auth:"https://auth.europe-west1.gcp.commercetools.com",api:"https://api.europe-west1.gcp.commercetools.com"},[Ct.EUROPE_AWS]:{auth:"https://auth.eu-central-1.aws.commercetools.com",api:"https://api.eu-central-1.aws.commercetools.com"},[Ct.NORTH_AMERICA_GCP]:{auth:"https://auth.us-central1.gcp.commercetools.com",api:"https://api.us-central1.gcp.commercetools.com"},[Ct.NORTH_AMERICA_AWS]:{auth:"https://auth.us-east-2.aws.commercetools.com",api:"https://api.us-east-2.aws.commercetools.com"},[Ct.AUSTRALIA_GCP]:{auth:"https://auth.australia-southeast1.gcp.commercetools.com",api:"https://api.australia-southeast1.gcp.commercetools.com"}},wt=["anonymous_id","customer_id"];function bt(e,t){return e?e.map((e=>`${e}:${t}`)).join(" "):""}class xt{constructor(e){var t;this.accessToken="",this.expiresIn=0,this.expiresAt=new Date,this.scopes=[],this.accessToken=e.access_token,this.expiresIn=e.expires_in,this.scopes=(t=e.scope)?t.split(" ").map((e=>e.split(":")[0])).filter((e=>!wt.includes(e))):[],this.anonymousId=this.extractKeyFromScope("anonymous_id",e.scope),this.customerId=this.extractKeyFromScope("customer_id",e.scope),this.expiresAt=new Date((new Date).getTime()+1e3*e.expires_in),"refresh_token"in e&&e.refresh_token&&(this.refreshToken=e.refresh_token)}expiresWithin(e){const t=(new Date).getTime()+1e3*e;return this.expiresAt.getTime()<t}extractKeyFromScope(e,t){if(!t||!e)return;const r=t?.split(" ");if(!Array.isArray(r)||0===r.length)return;const o=r.find((t=>t.slice(0,e.length+1)===`${e}:`));return o?o.slice(e.length+1):void 0}}var vt;function kt(e){return!e.isAxiosError||!e.request||!e.response||nt.includes(e.response.status)}function Pt(e){return e.isAxiosError?qt.fromAxiosError(e):e}function At(e){const t=at(e.httpsAgent),r={"User-Agent":Tt(e.systemIdentifier)};return o=>{const s={...r,...o.headers};return async function(e){const{retry:t,onBeforeRequest:r,onAfterResponse:o,axiosInstance:s}=e,n=e.timeoutMs??5e3,a={};let i,c=dt(e.request),u=0;Object.keys(c.headers??{}).map((e=>e.toLowerCase())).includes("user-agent")||(c.headers??(c.headers={}),c.headers["User-Agent"]=Tt());let h,p,d=0;do{if(h=null,p=null,u>0){a["X-Retry-Count"]=`${u}`;const e=it(u,t);await new Promise((t=>setTimeout(t,e)))}try{if(r){const e=await r(c);e&&(c=e)}h=Date.now();const e=await s({...c,headers:{...c.headers,...a},timeout:n});return p=Date.now(),d+=p-h,o&&o(tt(e,{accumulativeDurationMs:d,durationMs:p-h,retries:u})),e.data}catch(e){if(p=Date.now(),d+=h?p-h:0,o){const t=et(e,{accumulativeDurationMs:d,durationMs:h?p-h:0,retries:u});t&&o(t)}if(!kt(e))throw Pt(e);i=e}u++}while(u<=t.maxRetries);throw Pt(i)}({axiosInstance:t,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,request:{...o,headers:s},retry:{...st,...e.retry},timeoutMs:e.timeoutMs})}}!function(e){e.CLIENT_CREDENTIALS="client_credentials",e.REFRESH_TOKEN="refresh_token",e.PASSWORD="password"}(vt||(vt={}));class jt{constructor(e){this.config=e,this.endpoints=Rt[this.config.region],this.requestExecutor=At({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}async getClientGrant(e){return this.post("/token",{grant_type:vt.CLIENT_CREDENTIALS,scope:bt(e,this.config.projectKey)})}async refreshGrant(e){return await this.post("/token",{grant_type:vt.REFRESH_TOKEN,refresh_token:e})}async login(e){return this.post(`/${this.config.projectKey}${this.applyStore("/customers/token",e.storeKey)}`,{username:e.username,password:e.password,grant_type:vt.PASSWORD,scope:bt(e.scopes,this.config.projectKey)})}async revokeToken(e){await this.post("/token/revoke",{token:e.tokenValue,token_type_hint:e.tokenType})}async logout(e){const t=(await Promise.allSettled([this.revokeToken({tokenType:"access_token",tokenValue:e.accessToken}),this.revokeToken({tokenType:"refresh_token",tokenValue:e.refreshToken})])).reduce(((e,t)=>("rejected"===t.status&&e.push(t.reason),e)),[]);if(t.length)throw new qt("Logout failed in one or more calls to the token revocation endpoint",t)}async getAnonymousGrant(e){const t={grant_type:vt.CLIENT_CREDENTIALS};return e?.scopes?.length&&(t.scope=bt(e.scopes,this.config.projectKey)),e?.anonymousId&&(t.anonymous_id=e.anonymousId),this.post(`/${this.config.projectKey}/anonymous/token`,t)}async post(e,t){return await this.requestExecutor(this.getRequestOptions({path:e,body:t}))}getRequestOptions(e){const t=`${this.endpoints.auth}/oauth${e.path}`;let r;const o={Authorization:`Basic ${s=this.config.clientId,n=this.config.clientSecret,btoa(`${s}:${n}`)}`,"Content-Type":"application/x-www-form-urlencoded"};var s,n;return e.correlationId&&""!==e.correlationId&&(o["X-Correlation-ID"]=e.correlationId,delete e.correlationId),e.body&&(r=new URLSearchParams(e.body).toString()),{method:"POST",data:r,url:t,headers:o}}applyStore(e,t){return"string"==typeof t&&""!==t?`/in-store/key=${t}${e}`:this.config.storeKey?`/in-store/key=${this.config.storeKey}${e}`:e}}const Bt={refreshIfWithinSecs:1800,timeoutMs:5e3};class It{constructor(e){if(this.grantPromise=null,this.config={...Bt,...e},!this.config.clientScopes.length)throw new qt("`config.clientScopes` must contain at least one scope");this.api=new jt(e)}async getClientGrant(){return this.grantPromise?this.grantPromise:this.grant&&!this.grant.expiresWithin(this.config.refreshIfWithinSecs)?this.grant:(this.grantPromise=this.api.getClientGrant(this.config.clientScopes).then((e=>(this.grant=new xt(e),this.grant))).finally((()=>{this.grantPromise=null})),this.grantPromise)}async refreshCustomerGrant(e){const t=await this.api.refreshGrant(e);return new xt({...t,refresh_token:e})}async login(e){const t=e.scopes||this.config.customerScopes;if(!t)throw new qt("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");await this.getClientGrant();const r=await this.api.login({...e,scopes:t});return new xt(r)}async getAnonymousGrant(e){const t=e?.scopes||this.config.customerScopes,r=e?.anonymousId;if(!t)throw new qt("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");await this.getClientGrant();const o=await this.api.getAnonymousGrant({scopes:t,anonymousId:r});return new xt(o)}async logout(e){await this.api.logout(e)}async revokeToken(e){await this.api.revokeToken(e)}}class _t{constructor(e){_t.validateConfig(e),this.config=e,this.auth=new It(e),this.endpoints=Rt[this.config.region],this.requestExecutor=At({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}getStoreById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/${e.id}`,method:"GET"})}getStoreByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/key=${e.key}`,method:"GET"})}queryStores(e){return this.request({...this.extractCommonRequestOptions(e),path:"/stores",method:"GET"})}createStore(e){return this.request({path:"/stores",method:"POST",data:e.data})}updateStoreById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/${e.id}`,method:"POST",data:e.data})}updateStoreByKey(e){return this.request({path:`/stores/key=${e.key}`,method:"POST",data:e.data})}deleteStoreById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteStoreByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/key=${e.key}`,method:"DELETE",params:{...e.params,version:e.version}})}getCategoryById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/${e.id}`,method:"GET"})}getCategoryByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${e.key}`,method:"GET"})}queryChannels(e){return this.request({...this.extractCommonRequestOptions(e),path:"/channels",method:"GET"})}async importOrder(e){return this.request({...this.extractCommonRequestOptions(e),path:"/orders/import",method:"POST",data:e.data})}getChannelById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/channels/${e.id}`,method:"GET"})}async getChannelByKey(e){const t=await this.request({...this.extractCommonRequestOptions(e),path:"/channels",method:"GET",params:{where:`key="${e.key}"`,limit:1}});if(!t?.count)throw new qt(`No channel found with key [${e.key}]`,null,404);return t.results[0]}getCategory(e){if(!e.id&&!e.key)throw new qt("Either an id, key or slug must be provided");return e.id?this.request({...this.extractCommonRequestOptions(e),path:`/categories/${e.id}`,method:"GET"}):this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${e.key}`,method:"GET"})}async getCategoryBySlug(e){if(!e.languageCode&&!e.languageCodes)throw new qt("Either the `languageCode` or `languageCodes` property must be provided");const t=[];e.languageCodes?t.push(...e.languageCodes):e.languageCode&&t.push(e.languageCode);const r=await this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,where:`slug(${t.map((t=>`${t}="${e.slug}"`)).join(" or ")})`}}),path:"/categories",method:"GET"});if(!r.count)throw new qt(`No category found with slug [${e.slug}] and language code [${e.languageCode}]`,{options:e},404);return r.results[0]}queryCategories(e){return this.request({...this.extractCommonRequestOptions(e),path:"/categories",method:"GET"})}async getCategoryParents(e){const t=await this.getCategory({...e,params:{...e.params,expand:"ancestors[*]"}}),r=t.ancestors.map((e=>e.obj));return r.push({...t,ancestors:t.ancestors.map((e=>({id:e.id,typeId:e.typeId})))}),r}getProductById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/${e.id}`,method:"GET"})}getProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${e.key}`,method:"GET"})}getProductProjectionById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-projections/${e.id}`,e.storeKey),method:"GET"})}getProductProjectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-projections/key=${e.key}`,e.storeKey),method:"GET"})}async getProductProjectionBySlug(e){if(!e.languageCode&&!e.languageCodes)throw new qt("Either the `languageCode` or `languageCodes` property must be provided");const t=[];e.languageCodes?t.push(...e.languageCodes):e.languageCode&&t.push(e.languageCode);const r=await this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,where:`slug(${t.map((t=>`${t}="${e.slug}"`)).join(" or ")})`}}),path:"/product-projections",method:"GET"});if(!r.count)throw new qt(`No product projection found with slug [${e.slug}] and language code [${e.languageCode}]`,{options:e},404);return r.results[0]}queryProductProjections(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-projections",method:"GET"})}searchProductProjections(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-projections/search",method:"GET"})}getProductSelectionById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-selections/${e.id}`,e.storeKey),method:"GET"})}getProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-selections/key=${e.key}`,e.storeKey),method:"GET"})}queryProductSelections(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-selections",method:"GET"})}createProductSelection(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-selections",method:"POST",data:e.data})}updateProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-selections/key=${e.key}`,method:"POST",data:{version:e.version,actions:e.actions}})}deleteProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-selections/key=${e.key}&version=${e.version}`,method:"DELETE"})}queryProductsInStore(e){return this.request({...this.extractCommonRequestOptions(e),path:`/in-store/key=${e.storeKey}/product-selection-assignments`,method:"GET"})}getCartById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${e.id}`,e.storeKey),method:"GET"})}async queryCarts(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/carts",e?.storeKey),method:"GET"})}async queryMyCarts(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/carts",e.storeKey),method:"GET",accessToken:e.accessToken})}async createCart(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/carts",e.storeKey),method:"POST",data:e.data})}async updateCartById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${e.id}`,e.storeKey),method:"POST",data:{version:e.version,actions:e.actions}})}async getMyActiveCart(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/active-cart",e.storeKey),method:"GET",accessToken:e.accessToken})}async getMyCartById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${e.cartId}`,e.storeKey),method:"GET",accessToken:e.accessToken})}async createMyCart(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/carts",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken})}async deleteMyActiveCart(e){const t=await this.getMyActiveCart(e);return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${t.id}`,e.storeKey),method:"DELETE",params:{...e.params,version:t.version},accessToken:e.accessToken})}async deleteMyCartById(e){const t=await this.getMyCartById(e);return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${e.cartId}`,e.storeKey),method:"DELETE",params:{...e.params,version:t.version},accessToken:e.accessToken})}async updateMyActiveCart(e){const t=await this.getMyActiveCart(e);return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${t.id}`,e.storeKey),method:"POST",data:{version:t.version,actions:e.actions},accessToken:e.accessToken})}async createMyOrderFromActiveCart(e){const t=await this.getMyActiveCart(e);return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/orders",e.storeKey),method:"POST",data:{version:t.version,id:t.id},accessToken:e.accessToken})}async createOrderFromCart(e){const t=await this.getCartById(e);return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/orders",e.storeKey),method:"POST",data:{version:t.version,id:t.id}})}async deleteCartById(e){return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${e.id}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version}})}createPayment(e){return this.request({...this.extractCommonRequestOptions(e),path:"/payments",method:"POST",data:e.data})}deletePaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/payments/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}updatePaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/payments/${e.id}`,method:"POST",data:e.data})}getPaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/payments/${e.id}`,method:"GET"})}queryPayments(e){return this.request({...this.extractCommonRequestOptions(e),path:"/payments",method:"GET"})}createMyPayment(e){return this.request({...this.extractCommonRequestOptions(e),path:"/me/payments",method:"POST",data:e.data,accessToken:e.accessToken})}updateMyPaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${e.id}`,method:"POST",data:e.data,accessToken:e.accessToken})}getMyPaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${e.id}`,method:"GET",accessToken:e.accessToken})}queryMyPayments(e){return this.request({...this.extractCommonRequestOptions(e),path:"/me/payments",method:"GET",accessToken:e.accessToken})}deleteMyPaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${e.id}`,method:"DELETE",params:{version:e.version},accessToken:e.accessToken})}getMyOrderById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/orders/${e.id}`,e.storeKey),method:"GET",accessToken:e.accessToken})}queryMyOrders(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/orders",e.storeKey),method:"GET",accessToken:e.accessToken})}updateOrderById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${e.id}`,e.storeKey),method:"POST",data:e.data})}updateOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${e.orderNumber}`,e.storeKey),method:"POST",data:e.data})}getOrderById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${e.id}`,e.storeKey),method:"GET"})}getOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${e.orderNumber}`,e.storeKey),method:"GET"})}deleteOrderById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${e.id}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}deleteOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${e.orderNo}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}queryOrders(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/orders",e.storeKey),method:"GET"})}createProduct(e){return this.request({...this.extractCommonRequestOptions(e),path:"/products",method:"POST",data:e.data})}updateProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${e.key}`,method:"POST",data:e.data})}updateProductById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/${e.id}`,method:"POST",data:e.data})}async deleteProductById(e){let t=e.version;return e.unpublish&&(t=(await this.unpublishProductById({id:e.id,version:e.version})).version),this.request({...this.extractCommonRequestOptions(e),path:`/products/${e.id}`,method:"DELETE",params:{...e.params,version:t}})}async deleteProductByKey(e){let t=e.version;return e.unpublish&&(t=(await this.unpublishProductByKey({key:e.key,version:e.version})).version),this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${e.key}`,method:"DELETE",params:{...e.params,version:t}})}unpublishProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${e.key}`,method:"POST",params:e.params,data:{version:e.version,actions:[{action:"unpublish"}]}})}unpublishProductById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/${e.id}`,method:"POST",params:e.params,data:{version:e.version,actions:[{action:"unpublish"}]}})}createCategory(e){return this.request({path:"/categories",method:"POST",data:e.data})}updateCategoryByKey(e){return this.request({path:`/categories/key=${e.key}`,method:"POST",data:e.data})}updateCategoryById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/${e.id}`,method:"POST",data:e.data})}deleteCategoryById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteCategoryByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${e.key}`,method:"DELETE",params:{...e.params,version:e.version}})}createAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/customers",e.storeKey),method:"POST",data:e.data})}deleteCustomerById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/${e.id}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}deleteCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/key=${e.key}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}createMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/signup",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken})}loginMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/login",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken})}login(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/login",e.storeKey),method:"POST",data:e.data})}getMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me",e.storeKey),method:"GET",accessToken:e.accessToken})}updateMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data})}changeMyPassword(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/password",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data})}resetMyPassword(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/password/reset",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data})}getPasswordResetToken(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/customers/password-token",e.storeKey),method:"POST",data:e.data})}getCustomerById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/${e.id}`,e.storeKey),method:"GET"})}getCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/key=${e.key}`,e.storeKey),method:"GET"})}getCustomerByPasswordToken(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/password-token=${e.token}`,e.storeKey),method:"GET"})}queryCustomers(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/customers",e.storeKey),method:"GET"})}updateCustomerById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customers/${e.id}`,method:"POST",data:e.data})}updateCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customers/key=${e.key}`,method:"POST",data:e.data})}getProductTypeById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-types/${e.id}`,method:"GET"})}getProductTypeByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-types/key=${e.key}`,method:"GET"})}queryProductTypes(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-types",method:"GET"})}getTypeById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/types/${e.id}`,method:"GET"})}getTypeByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/types/key=${e.key}`,method:"GET"})}queryTypes(e){return this.request({...this.extractCommonRequestOptions(e),path:"/types",method:"GET"})}getDiscountCodeById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/discount-codes/${e.id}`,method:"GET"})}getCartDiscountById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/cart-discounts/${e.id}`,method:"GET"})}getCartDiscountByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/cart-discounts/key=${e.key}`,method:"GET"})}queryCartDiscounts(e){return this.request({...this.extractCommonRequestOptions(e),path:"/cart-discounts",method:"GET"})}getCustomObject(e){return this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${e.container}/${e.key}`,method:"GET"})}getCustomObjectById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${e.id}`,method:"GET"})}saveCustomObject(e){return this.request({...this.extractCommonRequestOptions(e),path:"/custom-objects",method:"POST",data:e.data})}deleteCustomObject(e){return this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${e.container}/${e.key}`,method:"DELETE"})}getShippingMethodById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/shipping-methods/${e.id}`,method:"GET"})}getShippingMethodByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/shipping-methods/key=${e.key}`,method:"GET"})}getShippingMethodsForLocation(e){return this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,country:e.country,state:e.state,currency:e.currency}}),path:"/shipping-methods/matching-location",method:"GET",accessToken:e.accessToken})}getShippingMethodsForCart(e){return this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,cartId:e.cartId}}),path:"/shipping-methods/matching-cart",method:"GET",accessToken:e.accessToken})}queryShippingMethods(e){return this.request({...this.extractCommonRequestOptions(e),path:"/shipping-methods",method:"GET"})}getCustomerGroupById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${e.id}`,method:"GET"})}getCustomerGroupByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/key=${e.key}`,method:"GET"})}queryCustomerGroups(e){return this.request({...this.extractCommonRequestOptions(e),path:"/customer-groups",method:"GET"})}createCustomerGroup(e){return this.request({path:"/customer-groups",method:"POST",data:e.data})}updateCustomerGroupByKey(e){return this.request({path:`/customer-groups/key=${e.key}`,method:"POST",data:e.data})}updateCustomerGroupById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${e.id}`,method:"POST",data:e.data})}deleteCustomerGroupById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteCustomerGroupByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/key=${e.key}`,method:"DELETE",params:{...e.params,version:e.version}})}getStateById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/states/${e.id}`,method:"GET"})}getStateByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/states/key=${e.key}`,method:"GET"})}queryStates(e){return this.request({...this.extractCommonRequestOptions(e),path:"/states",method:"GET"})}getStandalonePriceById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${e.id}`,method:"GET"})}getStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${e.key}`,method:"GET"})}queryStandalonePrices(e){return this.request({...this.extractCommonRequestOptions(e),path:"/standalone-prices",method:"GET"})}createStandalonePrice(e){return this.request({...this.extractCommonRequestOptions(e),path:"/standalone-prices",method:"POST",data:e.data})}updateStandalonePriceById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${e.id}`,method:"POST",data:e.data})}updateStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${e.key}`,method:"POST",data:e.data})}deleteStandalonePriceById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${e.key}`,method:"DELETE",params:{...e.params,version:e.version}})}graphql(e){return this.request({...this.extractCommonRequestOptions(e),path:"/graphql",method:"POST",data:e.data,accessToken:e.accessToken})}async request(e){const t=await this.getRequestOptions(e);return await this.requestExecutor(t)}async getRequestOptions(e){let t,r=e.accessToken;const o=`${this.endpoints.api}/${this.config.projectKey}${e.path}`;r||(r=(await this.auth.getClientGrant()).accessToken);const s={...e.headers,Authorization:`Bearer ${r}`};return"string"==typeof e.correlationId&&""!==e.correlationId&&(s["X-Correlation-ID"]=e.correlationId,delete e.correlationId),e.params&&Object.keys(e.params).length&&(t=e.params),{method:e.method,data:e.data,url:o,headers:s,params:t}}extractCommonRequestOptions(e){return e?{correlationId:e.correlationId,params:e.params,retry:e.retry}:{}}applyStore(e,t){return"string"==typeof t&&""!==t?`/in-store/key=${t}${e}`:this.config.storeKey?`/in-store/key=${this.config.storeKey}${e}`:e}static validateConfig(e){const t=[];if(e?(e.projectKey?"string"!=typeof e.projectKey&&t.push("The `projectKey` property must be a string"):t.push("The `projectKey` property is empty"),e.clientId?"string"!=typeof e.clientId&&t.push("The `clientId` property must be a string"):t.push("The `clientId` property is empty"),e.clientSecret?"string"!=typeof e.clientSecret&&t.push("The `clientSecret` property must be a string"):t.push("The `clientSecret` property is empty"),Array.isArray(e.clientScopes)?0===e.clientScopes.length&&t.push("The `clientScopes` property must have at least 1 scope defined"):t.push("The `clientScopes` property must be an array")):t.push("The config object missing or empty"),t.length)throw new qt("The configuration object passed in to the `CommercetoolsApi` constructor is not valid: \n"+t.map((e=>`• ${e}`)).join("\n"))}}})();var s=o.A9,n=o.M_,a=o.Mq,i=o.h4,c=o.Eh,u=o.eJ,h=o.yp,p=o.hw,d=o.Xp,l=o.dI,m=o.gO,f=o.qX,y=o.jF,g=o.as,O=o.cY,E=o.Vl,S=o.kD,T=o.KD,q=o.Jy,C=o.s9,R=o.iS;export{s as CommercetoolsApi,n as CommercetoolsAuth,a as CommercetoolsError,i as CommercetoolsGrant,c as DEFAULT_MASKING_STRING,u as MAX_ITEMS_PER_QUERY,h as Region,p as SENSITIVE_HEADER_NAMES,d as SENSITIVE_PROPERTY_NAMES,l as buildUserAgent,m as calculateDelay,f as convertAxiosError,y as convertAxiosResponse,g as createAxiosInstance,O as extractAxiosHeaders,E as formatAsKey,S as getAttributeValue,T as maskSensitiveData,q as maskSensitiveHeaders,C as maskSensitiveInput,R as retryOnConflict};
|
|
2
2
|
//# sourceMappingURL=ge-commercetools-utils-browser.esm.js.map
|