@gradientedge/commercetools-utils 5.1.0 → 5.2.0

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.
@@ -1,2 +1,2 @@
1
- var t={9818:function(t,e,o){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)},n=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsApi=void 0;var i=o(2915),a=o(3028),c=o(7111),u=o(7034),p=function(){function t(e){t.validateConfig(e),this.config=e,this.auth=new i.CommercetoolsAuth(e),this.endpoints=c.REGION_URLS[this.config.region],this.requestExecutor=(0,u.getRequestExecutor)({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}return t.prototype.getStoreById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/".concat(t.id),method:"GET"}))},t.prototype.getStoreByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/key=".concat(t.key),method:"GET"}))},t.prototype.queryStores=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores",method:"GET"}))},t.prototype.createStore=function(t){return this.request({path:"/stores",method:"POST",data:t.data})},t.prototype.updateStoreById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/".concat(t.id),method:"POST",data:t.data}))},t.prototype.updateStoreByKey=function(t){return this.request({path:"/stores/key=".concat(t.key),method:"POST",data:t.data})},t.prototype.deleteStoreById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.deleteStoreByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.getCategoryById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/".concat(t.id),method:"GET"}))},t.prototype.getCategoryByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/key=".concat(t.key),method:"GET"}))},t.prototype.queryChannels=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/channels",method:"GET"}))},t.prototype.importOrder=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/orders/import",method:"POST",data:t.data}))]}))}))},t.prototype.getChannelById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/channels/".concat(t.id),method:"GET"}))},t.prototype.getChannelByKey=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/channels",method:"GET",params:{where:'key="'.concat(t.key,'"'),limit:1}}))];case 1:if(!(null==(e=o.sent())?void 0:e.count))throw new a.CommercetoolsError("No channel found with key [".concat(t.key,"]"),null,404);return[2,e.results[0]]}}))}))},t.prototype.getCategory=function(t){if(!t.id&&!t.key)throw new a.CommercetoolsError("Either an id, key or slug must be provided");return t.id?this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/".concat(t.id),method:"GET"})):this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/key=".concat(t.key),method:"GET"}))},t.prototype.getCategoryBySlug=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:if(!t.languageCode&&!t.languageCodes)throw new a.CommercetoolsError("Either the `languageCode` or `languageCodes` property must be provided");return e=[],t.languageCodes?e.push.apply(e,t.languageCodes):t.languageCode&&e.push(t.languageCode),[4,this.request(r(r({},this.extractCommonRequestOptions(r(r({},t),{params:r(r({},null==t?void 0:t.params),{where:"slug(".concat(e.map((function(e){return"".concat(e,'="').concat(t.slug,'"')})).join(" or "),")")})}))),{path:"/categories",method:"GET"}))];case 1:if(!(o=n.sent()).count)throw new a.CommercetoolsError("No category found with slug [".concat(t.slug,"] and language code [").concat(t.languageCode,"]"),{options:t},404);return[2,o.results[0]]}}))}))},t.prototype.queryCategories=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories",method:"GET"}))},t.prototype.getCategoryParents=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:return[4,this.getCategory(r(r({},t),{params:r(r({},t.params),{expand:"ancestors[*]"})}))];case 1:return e=n.sent(),(o=e.ancestors.map((function(t){return t.obj}))).push(r(r({},e),{ancestors:e.ancestors.map((function(t){return{id:t.id,typeId:t.typeId}}))})),[2,o]}}))}))},t.prototype.getProductById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/".concat(t.id),method:"GET"}))},t.prototype.getProductByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/key=".concat(t.key),method:"GET"}))},t.prototype.getProductProjectionById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/product-projections/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.getProductProjectionByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/product-projections/key=".concat(t.key),t.storeKey),method:"GET"}))},t.prototype.getProductProjectionBySlug=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:if(!t.languageCode&&!t.languageCodes)throw new a.CommercetoolsError("Either the `languageCode` or `languageCodes` property must be provided");return e=[],t.languageCodes?e.push.apply(e,t.languageCodes):t.languageCode&&e.push(t.languageCode),[4,this.request(r(r({},this.extractCommonRequestOptions(r(r({},t),{params:r(r({},null==t?void 0:t.params),{where:"slug(".concat(e.map((function(e){return"".concat(e,'="').concat(t.slug,'"')})).join(" or "),")")})}))),{path:"/product-projections",method:"GET"}))];case 1:if(!(o=n.sent()).count)throw new a.CommercetoolsError("No product projection found with slug [".concat(t.slug,"] and language code [").concat(t.languageCode,"]"),{options:t},404);return[2,o.results[0]]}}))}))},t.prototype.queryProductProjections=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-projections",method:"GET"}))},t.prototype.searchProductProjections=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-projections/search",method:"GET"}))},t.prototype.getProductSelectionById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/product-selections/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.getProductSelectionByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/product-selections/key=".concat(t.key),t.storeKey),method:"GET"}))},t.prototype.queryProductSelections=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-selections",method:"GET"}))},t.prototype.createProductSelection=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-selections",method:"POST",data:t.data}))},t.prototype.updateProductSelectionByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-selections/key=".concat(t.key),method:"POST",data:{version:t.version,actions:t.actions}}))},t.prototype.deleteProductSelectionByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-selections/key=".concat(t.key,"&version=").concat(t.version),method:"DELETE"}))},t.prototype.queryProductsInStore=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/in-store/key=".concat(t.storeKey,"/product-selection-assignments"),method:"GET"}))},t.prototype.getCartById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.queryCarts=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts",null==t?void 0:t.storeKey),method:"GET"}))]}))}))},t.prototype.queryMyCarts=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts",t.storeKey),method:"GET",accessToken:t.accessToken}))]}))}))},t.prototype.createCart=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts",t.storeKey),method:"POST",data:t.data}))]}))}))},t.prototype.updateCartById=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts/".concat(t.id),t.storeKey),method:"POST",data:{version:t.version,actions:t.actions}}))]}))}))},t.prototype.getMyActiveCart=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/active-cart",t.storeKey),method:"GET",accessToken:t.accessToken}))]}))}))},t.prototype.getMyCartById=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(t.cartId),t.storeKey),method:"GET",accessToken:t.accessToken}))]}))}))},t.prototype.createMyCart=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken}))]}))}))},t.prototype.updateMyCart=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(t.cartId),t.storeKey),method:"POST",data:{version:t.cartVersion,actions:t.actions},accessToken:t.accessToken}))]}))}))},t.prototype.deleteMyActiveCart=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyActiveCart(t)];case 1:return e=o.sent(),[4,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(e.id),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:e.version}),accessToken:t.accessToken}))];case 2:return[2,o.sent()]}}))}))},t.prototype.deleteMyCartById=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyCartById(t)];case 1:return e=o.sent(),[4,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(t.cartId),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:e.version}),accessToken:t.accessToken}))];case 2:return[2,o.sent()]}}))}))},t.prototype.updateMyActiveCart=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyActiveCart(t)];case 1:return e=o.sent(),[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(e.id),t.storeKey),method:"POST",data:{version:e.version,actions:t.actions},accessToken:t.accessToken}))]}}))}))},t.prototype.createMyOrderFromActiveCart=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyActiveCart(t)];case 1:return e=o.sent(),[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/orders",t.storeKey),method:"POST",data:{version:e.version,id:e.id},accessToken:t.accessToken}))]}}))}))},t.prototype.createOrderFromCart=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getCartById(t)];case 1:return e=o.sent(),[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders",t.storeKey),method:"POST",data:{version:e.version,id:e.id}}))]}}))}))},t.prototype.deleteCartById=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts/".concat(t.id),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version})}))];case 1:return[2,e.sent()]}}))}))},t.prototype.createPayment=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments",method:"POST",data:t.data}))},t.prototype.deletePaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.updatePaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments/".concat(t.id),method:"POST",data:t.data}))},t.prototype.getPaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments/".concat(t.id),method:"GET"}))},t.prototype.queryPayments=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments",method:"GET"}))},t.prototype.createMyPayment=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments",method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.updateMyPaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments/".concat(t.id),method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.getMyPaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments/".concat(t.id),method:"GET",accessToken:t.accessToken}))},t.prototype.queryMyPayments=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments",method:"GET",accessToken:t.accessToken}))},t.prototype.deleteMyPaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments/".concat(t.id),method:"DELETE",params:{version:t.version},accessToken:t.accessToken}))},t.prototype.getMyOrderById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/orders/".concat(t.id),t.storeKey),method:"GET",accessToken:t.accessToken}))},t.prototype.queryMyOrders=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/orders",t.storeKey),method:"GET",accessToken:t.accessToken}))},t.prototype.updateOrderById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/".concat(t.id),t.storeKey),method:"POST",data:t.data}))},t.prototype.updateOrderByOrderNumber=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/order-number=".concat(t.orderNumber),t.storeKey),method:"POST",data:t.data}))},t.prototype.getOrderById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.getOrderByOrderNumber=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/order-number=".concat(t.orderNumber),t.storeKey),method:"GET"}))},t.prototype.deleteOrderById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/".concat(t.id),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version,dataErasure:t.dataErasure})}))},t.prototype.deleteOrderByOrderNumber=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/order-number=".concat(t.orderNo),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version,dataErasure:t.dataErasure})}))},t.prototype.queryOrders=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders",t.storeKey),method:"GET"}))},t.prototype.createProduct=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products",method:"POST",data:t.data}))},t.prototype.updateProductByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/key=".concat(t.key),method:"POST",data:t.data}))},t.prototype.updateProductById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/".concat(t.id),method:"POST",data:t.data}))},t.prototype.deleteProductById=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:return e=t.version,t.unpublish?[4,this.unpublishProductById({id:t.id,version:t.version})]:[3,2];case 1:o=n.sent(),e=o.version,n.label=2;case 2:return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:e})}))]}}))}))},t.prototype.deleteProductByKey=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:return e=t.version,t.unpublish?[4,this.unpublishProductByKey({key:t.key,version:t.version})]:[3,2];case 1:o=n.sent(),e=o.version,n.label=2;case 2:return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:e})}))]}}))}))},t.prototype.unpublishProductByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/key=".concat(t.key),method:"POST",params:t.params,data:{version:t.version,actions:[{action:"unpublish"}]}}))},t.prototype.unpublishProductById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/".concat(t.id),method:"POST",params:t.params,data:{version:t.version,actions:[{action:"unpublish"}]}}))},t.prototype.createCategory=function(t){return this.request({path:"/categories",method:"POST",data:t.data})},t.prototype.updateCategoryByKey=function(t){return this.request({path:"/categories/key=".concat(t.key),method:"POST",data:t.data})},t.prototype.updateCategoryById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/".concat(t.id),method:"POST",data:t.data}))},t.prototype.deleteCategoryById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.deleteCategoryByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.createAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers",t.storeKey),method:"POST",data:t.data}))},t.prototype.deleteCustomerById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/".concat(t.id),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version,dataErasure:t.dataErasure})}))},t.prototype.deleteCustomerByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/key=".concat(t.key),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version,dataErasure:t.dataErasure})}))},t.prototype.createMyAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/signup",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.loginMyAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/login",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.login=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/login",t.storeKey),method:"POST",data:t.data}))},t.prototype.getMyAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me",t.storeKey),method:"GET",accessToken:t.accessToken}))},t.prototype.updateMyAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data}))},t.prototype.changeMyPassword=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/password",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data}))},t.prototype.resetMyPassword=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/password/reset",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data}))},t.prototype.getPasswordResetToken=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/password-token",t.storeKey),method:"POST",data:t.data}))},t.prototype.getCustomerById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.getCustomerByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/key=".concat(t.key),t.storeKey),method:"GET"}))},t.prototype.getCustomerByPasswordToken=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/password-token=".concat(t.token),t.storeKey),method:"GET"}))},t.prototype.queryCustomers=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers",t.storeKey),method:"GET"}))},t.prototype.updateCustomerById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customers/".concat(t.id),method:"POST",data:t.data}))},t.prototype.updateCustomerByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customers/key=".concat(t.key),method:"POST",data:t.data}))},t.prototype.getProductTypeById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-types/".concat(t.id),method:"GET"}))},t.prototype.getProductTypeByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-types/key=".concat(t.key),method:"GET"}))},t.prototype.queryProductTypes=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-types",method:"GET"}))},t.prototype.getTypeById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/types/".concat(t.id),method:"GET"}))},t.prototype.getTypeByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/types/key=".concat(t.key),method:"GET"}))},t.prototype.queryTypes=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/types",method:"GET"}))},t.prototype.getDiscountCodeById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/discount-codes/".concat(t.id),method:"GET"}))},t.prototype.getCartDiscountById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/cart-discounts/".concat(t.id),method:"GET"}))},t.prototype.getCartDiscountByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/cart-discounts/key=".concat(t.key),method:"GET"}))},t.prototype.queryCartDiscounts=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/cart-discounts",method:"GET"}))},t.prototype.getCustomObject=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/custom-objects/".concat(t.container,"/").concat(t.key),method:"GET"}))},t.prototype.getCustomObjectById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/custom-objects/".concat(t.id),method:"GET"}))},t.prototype.saveCustomObject=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/custom-objects",method:"POST",data:t.data}))},t.prototype.deleteCustomObject=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/custom-objects/".concat(t.container,"/").concat(t.key),method:"DELETE"}))},t.prototype.getShippingMethodById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/shipping-methods/".concat(t.id),method:"GET"}))},t.prototype.getShippingMethodByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/shipping-methods/key=".concat(t.key),method:"GET"}))},t.prototype.getShippingMethodsForLocation=function(t){return this.request(r(r({},this.extractCommonRequestOptions(r(r({},t),{params:r(r({},null==t?void 0:t.params),{country:t.country,state:t.state,currency:t.currency})}))),{path:"/shipping-methods/matching-location",method:"GET",accessToken:t.accessToken}))},t.prototype.getShippingMethodsForCart=function(t){return this.request(r(r({},this.extractCommonRequestOptions(r(r({},t),{params:r(r({},null==t?void 0:t.params),{cartId:t.cartId})}))),{path:"/shipping-methods/matching-cart",method:"GET",accessToken:t.accessToken}))},t.prototype.queryShippingMethods=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/shipping-methods",method:"GET"}))},t.prototype.getCustomerGroupById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/".concat(t.id),method:"GET"}))},t.prototype.getCustomerGroupByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/key=".concat(t.key),method:"GET"}))},t.prototype.queryCustomerGroups=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups",method:"GET"}))},t.prototype.createCustomerGroup=function(t){return this.request({path:"/customer-groups",method:"POST",data:t.data})},t.prototype.updateCustomerGroupByKey=function(t){return this.request({path:"/customer-groups/key=".concat(t.key),method:"POST",data:t.data})},t.prototype.updateCustomerGroupById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/".concat(t.id),method:"POST",data:t.data}))},t.prototype.deleteCustomerGroupById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.deleteCustomerGroupByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.getStateById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/states/".concat(t.id),method:"GET"}))},t.prototype.getStateByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/states/key=".concat(t.key),method:"GET"}))},t.prototype.queryStates=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/states",method:"GET"}))},t.prototype.getStandalonePriceById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/".concat(t.id),method:"GET"}))},t.prototype.getStandalonePriceByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/key=".concat(t.key),method:"GET"}))},t.prototype.queryStandalonePrices=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices",method:"GET"}))},t.prototype.createStandalonePrice=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices",method:"POST",data:t.data}))},t.prototype.updateStandalonePriceById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/".concat(t.id),method:"POST",data:t.data}))},t.prototype.updateStandalonePriceByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/key=".concat(t.key),method:"POST",data:t.data}))},t.prototype.deleteStandalonePriceById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.deleteStandalonePriceByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.graphql=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/graphql",method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.request=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getRequestOptions(t)];case 1:return e=o.sent(),[4,this.requestExecutor(e)];case 2:return[2,o.sent()]}}))}))},t.prototype.getRequestOptions=function(t){return n(this,void 0,void 0,(function(){var e,o,n,i,a;return s(this,(function(s){switch(s.label){case 0:return o=t.accessToken,n="".concat(this.endpoints.api,"/").concat(this.config.projectKey).concat(t.path),o?[3,2]:[4,this.auth.getClientGrant()];case 1:i=s.sent(),o=i.accessToken,s.label=2;case 2:return a=r(r({},t.headers),{Authorization:"Bearer ".concat(o)}),"string"==typeof t.correlationId&&""!==t.correlationId&&(a["X-Correlation-ID"]=t.correlationId,delete t.correlationId),t.params&&Object.keys(t.params).length&&(e=t.params),[2,{method:t.method,data:t.data,url:n,headers:a,params:e}]}}))}))},t.prototype.extractCommonRequestOptions=function(t){return t?{correlationId:t.correlationId,params:t.params,retry:t.retry}:{}},t.prototype.applyStore=function(t,e){return"string"==typeof e&&""!==e?"/in-store/key=".concat(e).concat(t):this.config.storeKey?"/in-store/key=".concat(this.config.storeKey).concat(t):t},t.validateConfig=function(t){var e=[];if(t?(t.projectKey?"string"!=typeof t.projectKey&&e.push("The `projectKey` property must be a string"):e.push("The `projectKey` property is empty"),t.clientId?"string"!=typeof t.clientId&&e.push("The `clientId` property must be a string"):e.push("The `clientId` property is empty"),t.clientSecret?"string"!=typeof t.clientSecret&&e.push("The `clientSecret` property must be a string"):e.push("The `clientSecret` property is empty"),Array.isArray(t.clientScopes)?0===t.clientScopes.length&&e.push("The `clientScopes` property must have at least 1 scope defined"):e.push("The `clientScopes` property must be an array")):e.push("The config object missing or empty"),e.length)throw new a.CommercetoolsError("The configuration object passed in to the `CommercetoolsApi` constructor is not valid: \n"+e.map((function(t){return"• ".concat(t)})).join("\n"))},t}();e.CommercetoolsApi=p},3713:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(9818),e),n(o(7013),e)},7013:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2442:function(t,e,o){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)},n=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsAuth=void 0;var i=o(2915),a=o(8003),c=o(3032),u={refreshIfWithinSecs:1800,timeoutMs:5e3},p=function(){function t(t){if(this.grantPromise=null,this.config=r(r({},u),t),!this.config.clientScopes.length)throw new i.CommercetoolsError("`config.clientScopes` must contain at least one scope");this.api=new c.CommercetoolsAuthApi(t)}return t.prototype.getClientGrant=function(){return n(this,void 0,void 0,(function(){var t=this;return s(this,(function(e){return this.grantPromise?[2,this.grantPromise]:this.grant&&!this.grant.expiresWithin(this.config.refreshIfWithinSecs)?[2,this.grant]:(this.grantPromise=this.api.getClientGrant(this.config.clientScopes).then((function(e){return t.grant=new a.CommercetoolsGrant(e),t.grant})).finally((function(){t.grantPromise=null})),[2,this.grantPromise])}))}))},t.prototype.refreshCustomerGrant=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.api.refreshGrant(t)];case 1:return e=o.sent(),[2,new a.CommercetoolsGrant(r(r({},e),{refresh_token:t}))]}}))}))},t.prototype.login=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:if(!(e=t.scopes||this.config.customerScopes))throw new i.CommercetoolsError("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");return[4,this.getClientGrant()];case 1:return n.sent(),[4,this.api.login(r(r({},t),{scopes:e}))];case 2:return o=n.sent(),[2,new a.CommercetoolsGrant(o)]}}))}))},t.prototype.getAnonymousGrant=function(t){return n(this,void 0,void 0,(function(){var e,o,r;return s(this,(function(n){switch(n.label){case 0:if(e=(null==t?void 0:t.scopes)||this.config.customerScopes,o=null==t?void 0:t.anonymousId,!e)throw new i.CommercetoolsError("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");return[4,this.getClientGrant()];case 1:return n.sent(),[4,this.api.getAnonymousGrant({scopes:e,anonymousId:o})];case 2:return r=n.sent(),[2,new a.CommercetoolsGrant(r)]}}))}))},t.prototype.logout=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.api.logout(t)];case 1:return e.sent(),[2]}}))}))},t.prototype.revokeToken=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.api.revokeToken(t)];case 1:return e.sent(),[2]}}))}))},t}();e.CommercetoolsAuth=p},3032:function(t,e,o){var r=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsAuthApi=void 0;var s=o(2849),i=o(2915),a=o(7530),c=o(7111),u=o(9017),p=o(7034),l=function(){function t(t){this.config=t,this.endpoints=c.REGION_URLS[this.config.region],this.requestExecutor=(0,p.getRequestExecutor)({timeoutMs:t.timeoutMs,httpsAgent:t.httpsAgent,systemIdentifier:t.systemIdentifier,onBeforeRequest:t.onBeforeRequest,onAfterResponse:t.onAfterResponse,retry:t.retry})}return t.prototype.getClientGrant=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.post("/token",{grant_type:s.GrantType.CLIENT_CREDENTIALS,scope:(0,a.scopeArrayToRequestString)(t,this.config.projectKey)})]}))}))},t.prototype.refreshGrant=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.post("/token",{grant_type:s.GrantType.REFRESH_TOKEN,refresh_token:t})];case 1:return[2,e.sent()]}}))}))},t.prototype.login=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.post("/".concat(this.config.projectKey).concat(this.applyStore("/customers/token",t.storeKey)),{username:t.username,password:t.password,grant_type:s.GrantType.PASSWORD,scope:(0,a.scopeArrayToRequestString)(t.scopes,this.config.projectKey)})]}))}))},t.prototype.revokeToken=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.post("/token/revoke",{token:t.tokenValue,token_type_hint:t.tokenType})];case 1:return e.sent(),[2]}}))}))},t.prototype.logout=function(t){return r(this,void 0,void 0,(function(){var e,o;return n(this,(function(r){switch(r.label){case 0:return[4,Promise.allSettled([this.revokeToken({tokenType:"access_token",tokenValue:t.accessToken}),this.revokeToken({tokenType:"refresh_token",tokenValue:t.refreshToken})])];case 1:if(e=r.sent(),(o=e.reduce((function(t,e){return"rejected"===e.status&&t.push(e.reason),t}),[])).length)throw new i.CommercetoolsError("Logout failed in one or more calls to the token revocation endpoint",o);return[2]}}))}))},t.prototype.getAnonymousGrant=function(t){var e;return r(this,void 0,void 0,(function(){var o;return n(this,(function(r){return o={grant_type:s.GrantType.CLIENT_CREDENTIALS},(null===(e=null==t?void 0:t.scopes)||void 0===e?void 0:e.length)&&(o.scope=(0,a.scopeArrayToRequestString)(t.scopes,this.config.projectKey)),(null==t?void 0:t.anonymousId)&&(o.anonymous_id=t.anonymousId),[2,this.post("/".concat(this.config.projectKey,"/anonymous/token"),o)]}))}))},t.prototype.post=function(t,e){return r(this,void 0,void 0,(function(){return n(this,(function(o){switch(o.label){case 0:return[4,this.requestExecutor(this.getRequestOptions({path:t,body:e}))];case 1:return[2,o.sent()]}}))}))},t.prototype.getRequestOptions=function(t){var e,o="".concat(this.endpoints.auth,"/oauth").concat(t.path),r={Authorization:"Basic ".concat((0,u.base64EncodeForBasicAuth)(this.config.clientId,this.config.clientSecret)),"Content-Type":"application/x-www-form-urlencoded"};return t.correlationId&&""!==t.correlationId&&(r["X-Correlation-ID"]=t.correlationId,delete t.correlationId),t.body&&(e=new URLSearchParams(t.body).toString()),{method:"POST",data:e,url:o,headers:r}},t.prototype.applyStore=function(t,e){return"string"==typeof e&&""!==e?"/in-store/key=".concat(e).concat(t):this.config.storeKey?"/in-store/key=".concat(this.config.storeKey).concat(t):t},t}();e.CommercetoolsAuthApi=l},8003:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsGrant=void 0;var r=o(7530),n=function(){function t(t){this.accessToken="",this.expiresIn=0,this.expiresAt=new Date,this.scopes=[],this.accessToken=t.access_token,this.expiresIn=t.expires_in,this.scopes=(0,r.scopeRequestStringToArray)(t.scope),this.anonymousId=this.extractKeyFromScope("anonymous_id",t.scope),this.customerId=this.extractKeyFromScope("customer_id",t.scope),this.expiresAt=new Date((new Date).getTime()+1e3*t.expires_in),"refresh_token"in t&&t.refresh_token&&(this.refreshToken=t.refresh_token)}return t.prototype.expiresWithin=function(t){var e=(new Date).getTime()+1e3*t;return this.expiresAt.getTime()<e},t.prototype.extractKeyFromScope=function(t,e){if(e&&t){var o=null==e?void 0:e.split(" ");if(Array.isArray(o)&&0!==o.length){var r=o.find((function(e){return e.slice(0,t.length+1)==="".concat(t,":")}));return r?r.slice(t.length+1):void 0}}},t}();e.CommercetoolsGrant=n},7111:(t,e,o)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.INVALID_SCOPES=e.REGION_URLS=void 0;var n=o(9291);e.REGION_URLS=((r={})[n.Region.EUROPE_GCP]={auth:"https://auth.europe-west1.gcp.commercetools.com",api:"https://api.europe-west1.gcp.commercetools.com"},r[n.Region.EUROPE_AWS]={auth:"https://auth.eu-central-1.aws.commercetools.com",api:"https://api.eu-central-1.aws.commercetools.com"},r[n.Region.NORTH_AMERICA_GCP]={auth:"https://auth.us-central1.gcp.commercetools.com",api:"https://api.us-central1.gcp.commercetools.com"},r[n.Region.NORTH_AMERICA_AWS]={auth:"https://auth.us-east-2.aws.commercetools.com",api:"https://api.us-east-2.aws.commercetools.com"},r[n.Region.AUSTRALIA_GCP]={auth:"https://auth.australia-southeast1.gcp.commercetools.com",api:"https://api.australia-southeast1.gcp.commercetools.com"},r),e.INVALID_SCOPES=["anonymous_id","customer_id"]},7443:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(2442),e),n(o(8003),e)},7530:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.scopeRequestStringToArray=e.scopeArrayToRequestString=void 0;var r=o(7111);e.scopeArrayToRequestString=function(t,e){return t?t.map((function(t){return"".concat(t,":").concat(e)})).join(" "):""},e.scopeRequestStringToArray=function(t){return t?t.split(" ").map((function(t){return t.split(":")[0]})).filter((function(t){return!r.INVALID_SCOPES.includes(t)})):[]}},2849:(t,e)=>{var o;Object.defineProperty(e,"__esModule",{value:!0}),e.GrantType=void 0,(o=e.GrantType||(e.GrantType={})).CLIENT_CREDENTIALS="client_credentials",o.REFRESH_TOKEN="refresh_token",o.PASSWORD="password"},9017:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.base64EncodeForBasicAuth=void 0,e.base64EncodeForBasicAuth=function(t,e){var o="".concat(t,":").concat(e);return btoa(o)}},4060:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_HTTPS_AGENT_CONFIG=e.RETRYABLE_STATUS_CODES=e.DEFAULT_RETRY_CONFIG=e.MAX_ITEMS_PER_QUERY=e.DEFAULT_REQUEST_TIMEOUT_MS=e.USER_AGENT_PREFIX=void 0;var r=o(8842);e.USER_AGENT_PREFIX="@gradientedge/commercetools-utils",e.DEFAULT_REQUEST_TIMEOUT_MS=5e3,e.MAX_ITEMS_PER_QUERY=500,e.DEFAULT_RETRY_CONFIG={maxRetries:0,delayMs:0},e.RETRYABLE_STATUS_CODES=[r.Status.InternalServerError,r.Status.NotImplemented,r.Status.BadGateway,r.Status.ServiceUnavailable,r.Status.GatewayTimeout],e.DEFAULT_HTTPS_AGENT_CONFIG={keepAlive:!0,maxSockets:32,maxFreeSockets:10,timeout:6e4}},6781:function(t,e,o){var r,n=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsError=void 0;var i=s(o(4530)),a=o(893),c=function(t){function e(o,r,n){var s=t.call(this,o)||this;return s.isCommercetoolsError=!0,s.data=r,s.status=n,Object.setPrototypeOf(s,e.prototype),s}return n(e,t),e.fromAxiosError=function(t){var o,r,n,s,i,c,u,p;return new e(t.message,{code:t.code,request:{url:null===(o=t.config)||void 0===o?void 0:o.url,method:null===(r=t.config)||void 0===r?void 0:r.method,headers:(0,a.maskSensitiveHeaders)((0,a.extractAxiosHeaders)(null===(n=t.config)||void 0===n?void 0:n.headers)),params:(0,a.maskSensitiveInput)(null===(s=t.config)||void 0===s?void 0:s.params),data:(0,a.maskSensitiveInput)(this.parseRequestData(t.config))},response:{status:null===(i=t.response)||void 0===i?void 0:i.status,data:(0,a.maskSensitiveInput)(null===(c=t.response)||void 0===c?void 0:c.data),headers:(0,a.extractAxiosHeaders)(null===(u=t.response)||void 0===u?void 0:u.headers)}},null===(p=t.response)||void 0===p?void 0:p.status)},e.parseRequestData=function(t){var e,o;if(!t)return null;var r=null==t?void 0:t.data;if("string"==typeof r&&r){var n="";if("string"==typeof(null===(e=null==t?void 0:t.headers)||void 0===e?void 0:e["Content-Type"])&&(n=null===(o=null==t?void 0:t.headers)||void 0===o?void 0:o["Content-Type"]),"application/json"===n.substring(0,16))try{r=JSON.parse(t.data)}catch(t){}else if("application/x-www-form-urlencoded"===n.substring(0,33))try{var s=new URLSearchParams(t.data),i={};s.forEach((function(t,e,o){var r=o.getAll(e);0===r.length?i[e]="":1===r.length?i[e]=r[0]:i[e]=r})),r=i}catch(t){}}return r},e.prototype.toJSON=function(){return{status:this.status,message:this.message,data:this.data,isCommercetoolsError:!0}},e.prototype.toString=function(){return(0,i.default)(this.toJSON())},e}(Error);e.CommercetoolsError=c},3028:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(6781),e)},2915:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_ITEMS_PER_QUERY=e.Region=void 0,n(o(3028),e),n(o(7443),e),n(o(3713),e);var s=o(9291);Object.defineProperty(e,"Region",{enumerable:!0,get:function(){return s.Region}}),n(o(893),e),n(o(6249),e);var i=o(4060);Object.defineProperty(e,"MAX_ITEMS_PER_QUERY",{enumerable:!0,get:function(){return i.MAX_ITEMS_PER_QUERY}})},625:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9605:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5554:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4294:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5991:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5714:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7942:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9906:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4241:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},146:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5167:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4236:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6249:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(9605),e),n(o(625),e),n(o(5554),e),n(o(4294),e),n(o(5991),e),n(o(5714),e),n(o(9906),e),n(o(7942),e),n(o(4241),e),n(o(146),e),n(o(5167),e),n(o(4236),e),n(o(2949),e),n(o(492),e),n(o(6871),e),n(o(6487),e),n(o(8386),e),n(o(4946),e),n(o(6313),e),n(o(5285),e),n(o(5283),e),n(o(3708),e),n(o(6883),e),n(o(2246),e),n(o(4089),e),n(o(6614),e),n(o(7607),e),n(o(310),e),n(o(7183),e),n(o(2569),e),n(o(1027),e),n(o(6080),e),n(o(1613),e),n(o(721),e)},2949:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},492:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6871:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},8386:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6487:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4946:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5285:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5283:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},3708:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6313:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6883:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2246:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4089:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6614:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7607:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},310:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7183:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2569:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1027:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6080:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1613:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},721:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4474:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(7261),e),n(o(884),e)},884:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isRetryableError=void 0;var r=o(4060);e.isRetryableError=function(t){return!t.isAxiosError||!t.request||!t.response||r.RETRYABLE_STATUS_CODES.includes(t.response.status)}},7034:function(t,e,o){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getRequestExecutor=void 0;var n=o(4474),s=o(893),i=o(4060);e.getRequestExecutor=function(t){var e=(0,s.createAxiosInstance)({httpsAgent:t.httpsAgent}),o={"User-Agent":(0,s.buildUserAgent)(t.systemIdentifier)};return function(s){var a=r(r({},o),s.headers);return(0,n.request)({axiosInstance:e,onBeforeRequest:t.onBeforeRequest,onAfterResponse:t.onAfterResponse,request:r(r({},s),{headers:a}),retry:r(r({},i.DEFAULT_RETRY_CONFIG),t.retry),timeoutMs:t.timeoutMs})}}},7261:function(t,e,o){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)},n=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.request=void 0;var i=o(893),a=o(884),c=o(1100),u=o(4060),p=o(2003);e.request=function(t){var e,o,l;return n(this,void 0,void 0,(function(){var n,d,h,f,m,y,v,g,O,b,E,S,_,T;return s(this,(function(R){switch(R.label){case 0:n=t.retry,d=t.onBeforeRequest,h=t.onAfterResponse,f=t.axiosInstance,m=null!==(e=t.timeoutMs)&&void 0!==e?e:u.DEFAULT_REQUEST_TIMEOUT_MS,y={},v=(0,p.plainClone)(t.request),g=0,Object.keys(null!==(o=v.headers)&&void 0!==o?o:{}).map((function(t){return t.toLowerCase()})).includes("user-agent")||(null!==(l=v.headers)&&void 0!==l||(v.headers={}),v.headers["User-Agent"]=(0,i.buildUserAgent)()),b=0,_=function(){var t,e,o,u,p;return s(this,(function(s){switch(s.label){case 0:return E=null,S=null,g>0?(y["X-Retry-Count"]="".concat(g),t=(0,i.calculateDelay)(g,n),[4,new Promise((function(e){return setTimeout(e,t)}))]):[3,2];case 1:s.sent(),s.label=2;case 2:return s.trys.push([2,6,,7]),d?[4,d(v)]:[3,4];case 3:(e=s.sent())&&(v=e),s.label=4;case 4:return E=Date.now(),[4,f(r(r({},v),{headers:r(r({},v.headers),y),timeout:m}))];case 5:return o=s.sent(),S=Date.now(),b+=S-E,h&&h((0,i.convertAxiosResponse)(o,{accumulativeDurationMs:b,durationMs:S-E,retries:g})),[2,{value:o.data}];case 6:if(u=s.sent(),S=Date.now(),b+=E?S-E:0,h&&(p=(0,i.convertAxiosError)(u,{accumulativeDurationMs:b,durationMs:E?S-E:0,retries:g}))&&h(p),!(0,a.isRetryableError)(u))throw(0,c.transformError)(u);return O=u,[3,7];case 7:return g++,[2]}}))},R.label=1;case 1:return[5,_()];case 2:if("object"==typeof(T=R.sent()))return[2,T.value];R.label=3;case 3:if(g<=n.maxRetries)return[3,1];R.label=4;case 4:throw(0,c.transformError)(O)}}))}))}},1100:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.transformError=void 0;var r=o(3028);e.transformError=function(t){return t.isAxiosError?r.CommercetoolsError.fromAxiosError(t):t}},9291:(t,e)=>{var o;Object.defineProperty(e,"__esModule",{value:!0}),e.Region=void 0,(o=e.Region||(e.Region={})).NORTH_AMERICA_GCP="north_america_gcp",o.NORTH_AMERICA_AWS="north_america_aws",o.EUROPE_GCP="europe_gcp",o.EUROPE_AWS="europe_aws",o.AUSTRALIA_GCP="australia_gcp"},2519:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertAxiosError=void 0;var r=o(7271);e.convertAxiosError=function(t,e){var o,n,s,i,a,c,u,p,l,d;return"isAxiosError"in t?{request:{url:null!==(n=null===(o=t.config)||void 0===o?void 0:o.url)&&void 0!==n?n:"",method:null===(s=t.config)||void 0===s?void 0:s.method,params:null===(i=t.config)||void 0===i?void 0:i.params,headers:(0,r.extractAxiosHeaders)(null===(a=t.config)||void 0===a?void 0:a.headers),data:null===(c=t.config)||void 0===c?void 0:c.data},response:{code:t.code,message:(null===(u=t.response)||void 0===u?void 0:u.status)?void 0:t.message,status:null===(p=t.response)||void 0===p?void 0:p.status,headers:(0,r.extractAxiosHeaders)(null===(l=t.response)||void 0===l?void 0:l.headers),data:null===(d=t.response)||void 0===d?void 0:d.data},stats:e}:null}},4059:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertAxiosResponse=void 0;var r=o(7271);e.convertAxiosResponse=function(t,e){var o,n,s,i,a,c;return{request:{url:null!==(n=null===(o=t.config)||void 0===o?void 0:o.url)&&void 0!==n?n:"",method:null===(s=t.config)||void 0===s?void 0:s.method,params:null===(i=t.config)||void 0===i?void 0:i.params,headers:(0,r.extractAxiosHeaders)(null===(a=t.config)||void 0===a?void 0:a.headers),data:null===(c=t.config)||void 0===c?void 0:c.data},response:{status:t.status,headers:(0,r.extractAxiosHeaders)(t.headers),data:t.data},stats:e}}},4070:function(t,e,o){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createAxiosInstance=void 0,o(4060);var n=r(o(7218));e.createAxiosInstance=function(t){return n.default.create({httpsAgent:void 0})}},7271:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extractAxiosHeaders=void 0;var r=o(7218);e.extractAxiosHeaders=function(t){var e={};if(t instanceof r.AxiosHeaders){var o=t.toJSON();e={},Object.entries(o).forEach((function(t){var o=t[0],r=t[1],n=o.toLowerCase();"boolean"==typeof r||"number"==typeof r||"string"==typeof r?e[n]=r.toString():Array.isArray(r)&&(e[n]=r.join(", "))}))}return Object.keys(e).length?e:void 0}},4747:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(2519),e),n(o(4059),e),n(o(4070),e),n(o(7271),e)},3720:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.calculateDelay=void 0,e.calculateDelay=function(t,e){if(!e||0===t)return 0;var o=e.delayMs*Math.pow(2,t-1);if(e.jitter){var r=o*(1+1/(t+1));return Math.floor(Math.random()*r)}return o}},3930:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAsKey=void 0;var r=o(3028);e.formatAsKey=function(t){var e="";if("string"!=typeof t)throw new r.CommercetoolsError("The [input] parameter must be a string");if((e=(e=(e=(e=(e=(e=t.trim().toLowerCase()).replace(/ {2,}/g,"")).replace(/&/g,"and")).replace(/[ _]/g,"-")).replace(/[^0-9a-z-]+/g,"")).replace(/-{2,}/g,"-")).length&&"-"===e[0]&&(e=e.slice(1)),e.length&&"-"===e[e.length-1]&&(e=e.slice(0,-1)),e.length<2)throw new r.CommercetoolsError("Formatted key did not meet minimum length of 2 characters: ".concat(e));if(e.length>256)throw new r.CommercetoolsError("Formatted key exceeds the maximum length of 256 characters: ".concat(e));return e}},6640:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getAttributeValue=void 0,e.getAttributeValue=function(t){var e,o;if(null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.length){var r=null===(o=t.attributes)||void 0===o?void 0:o.find((function(e){return e.name===t.name}));if(r)return r.value}return null}},893:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(4747),e),n(o(3720),e),n(o(3930),e),n(o(6640),e),n(o(9998),e),n(o(9989),e),n(o(3190),e)},9998:function(t,e,o){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.maskSensitiveData=e.maskSensitiveHeaders=e.maskSensitiveInput=e.DEFAULT_MASKING_STRING=e.SENSITIVE_HEADER_NAMES=e.SENSITIVE_PROPERTY_NAMES=void 0;var n=r(o(3692)),s=o(7218),i=o(2003);function a(t,o,r){if(void 0===r&&(r=e.DEFAULT_MASKING_STRING),"object"==typeof t&&null!=t){var a;return a=t instanceof s.AxiosHeaders?(0,i.plainClone)(t.toJSON()):(0,i.plainClone)(t),(0,n.default)(a).forEach((function(){var t,e;o.includes(null!==(e=null===(t=this.key)||void 0===t?void 0:t.toLowerCase())&&void 0!==e?e:"")&&this.update(r)})),a}return t}e.SENSITIVE_PROPERTY_NAMES=["password","refresh_token"],e.SENSITIVE_HEADER_NAMES=["authorization"],e.DEFAULT_MASKING_STRING="********",e.maskSensitiveInput=function(t){return a(t,e.SENSITIVE_PROPERTY_NAMES)},e.maskSensitiveHeaders=function(t){return a(t,e.SENSITIVE_HEADER_NAMES)},e.maskSensitiveData=a},2003:(t,e)=>{function o(t,e){if(e&&t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&("object"==typeof t[r]?(Array.isArray(t[r])?e[r]=[]:e[r]={},e[r]=o(t[r],e[r])):e[r]=t[r]);return e}Object.defineProperty(e,"__esModule",{value:!0}),e.plainClone=void 0,e.plainClone=function(t){return o(t,{})}},9989:function(t,e,o){var r=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.retryOnConflict=void 0;var s=o(3720),i=o(8842);e.retryOnConflict=function(t){return r(this,void 0,void 0,(function(){var e,o,r,a,c,u;return n(this,(function(p){switch(p.label){case 0:e=(null==t?void 0:t.maxRetries)||3,o=(null==t?void 0:t.delayMs)||100,r=!!(null==t?void 0:t.jitter),a=function(a){var c,u,p;return n(this,(function(n){switch(n.label){case 0:return a>1?(c=(0,s.calculateDelay)(a-1,{delayMs:o,maxRetries:e,jitter:r}),[4,new Promise((function(t){return setTimeout(t,c)}))]):[3,2];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,4,,5]),u={},[4,t.executeFn(a)];case 3:return[2,(u.value=n.sent(),u)];case 4:if(!(p=n.sent()).isCommercetoolsError||p.status!==i.Status.Conflict||a===e)throw p;return[3,5];case 5:return[2]}}))},c=1,p.label=1;case 1:return c<=e?[5,a(c)]:[3,4];case 2:if("object"==typeof(u=p.sent()))return[2,u.value];p.label=3;case 3:return c++,[3,1];case 4:return[2,void 0]}}))}))}},3190:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.buildUserAgent=void 0;var r=o(4060);e.buildUserAgent=function(t){var e=r.USER_AGENT_PREFIX;return t&&(e="".concat(e," (").concat(t,")")),e}},8842:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reason=e.ErrorStatus=e.RedirectionStatus=e.SuccessStatus=e.InformationStatus=e.Status=void 0;var r=o(7536);Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return r.Status}}),Object.defineProperty(e,"InformationStatus",{enumerable:!0,get:function(){return r.InformationStatus}}),Object.defineProperty(e,"SuccessStatus",{enumerable:!0,get:function(){return r.SuccessStatus}}),Object.defineProperty(e,"RedirectionStatus",{enumerable:!0,get:function(){return r.RedirectionStatus}}),Object.defineProperty(e,"ErrorStatus",{enumerable:!0,get:function(){return r.ErrorStatus}});var n=o(7890);Object.defineProperty(e,"reason",{enumerable:!0,get:function(){return n.reason}})},7890:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reason=void 0;const r=o(7536);e.reason=function(t){switch(t){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(r.Status).find((e=>r.Status[e]===t))||"").replace(/(?!^)([A-Z])/gm," $1")}}},7536:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Status=e.ErrorStatus=e.RedirectionStatus=e.SuccessStatus=e.InformationStatus=void 0,e.InformationStatus={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103},e.SuccessStatus={Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226},e.RedirectionStatus={MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},e.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},e.Status=Object.assign(Object.assign(Object.assign(Object.assign({},e.InformationStatus),e.SuccessStatus),e.RedirectionStatus),e.ErrorStatus)},4530:(t,e)=>{function o(t,e){var o=[],r=[];return null==e&&(e=function(t,e){return o[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,o.indexOf(e)).join(".")+"]"}),function(n,s){if(o.length>0){var i=o.indexOf(this);~i?o.splice(i+1):o.push(this),~i?r.splice(i,1/0,n):r.push(n),~o.indexOf(s)&&(s=e.call(this,n,s))}else o.push(s);return null==t?s:t.call(this,n,s)}}(t.exports=function(t,e,r,n){return JSON.stringify(t,o(e,n),r)}).getSerialize=o},3692:t=>{function e(t){return Object.prototype.toString.call(t)}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function r(t,e){if(t.forEach)return t.forEach(e);for(var o=0;o<t.length;o++)e(t[o],o,t)}var n=Object.keys||function(t){var e=[];for(var o in t)e.push(o);return e},s=Object.prototype.hasOwnProperty||function(t,e){return e in t};function i(t){if("object"==typeof t&&null!==t){var s;if(o(t))s=[];else if("[object Date]"===e(t))s=new Date(t.getTime?t.getTime():t);else if("[object RegExp]"===e(t))s=new RegExp(t);else if(function(t){return"[object Error]"===e(t)}(t))s={message:t.message};else if(function(t){return"[object Boolean]"===e(t)}(t)||function(t){return"[object Number]"===e(t)}(t)||function(t){return"[object String]"===e(t)}(t))s=Object(t);else if(Object.create&&Object.getPrototypeOf)s=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)s={};else{var i=t.constructor&&t.constructor.prototype||t.__proto__||{},a=function(){};a.prototype=i,s=new a}return r(n(t),(function(e){s[e]=t[e]})),s}return t}function a(t,e,a){var c=[],u=[],p=!0;return function t(l){var d=a?i(l):l,h={},f=!0,m={node:d,node_:l,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(t,e){m.isRoot||(m.parent.node[m.key]=t),m.node=t,e&&(f=!1)},delete:function(t){delete m.parent.node[m.key],t&&(f=!1)},remove:function(t){o(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],t&&(f=!1)},keys:null,before:function(t){h.before=t},after:function(t){h.after=t},pre:function(t){h.pre=t},post:function(t){h.post=t},stop:function(){p=!1},block:function(){f=!1}};if(!p)return m;function y(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=n(m.node)),m.isLeaf=0===m.keys.length;for(var t=0;t<u.length;t++)if(u[t].node_===l){m.circular=u[t];break}}else m.isLeaf=!0,m.keys=null;m.notLeaf=!m.isLeaf,m.notRoot=!m.isRoot}y();var v=e.call(m,m.node);return void 0!==v&&m.update&&m.update(v),h.before&&h.before.call(m,m.node),f?("object"!=typeof m.node||null===m.node||m.circular||(u.push(m),y(),r(m.keys,(function(e,o){c.push(e),h.pre&&h.pre.call(m,m.node[e],e);var r=t(m.node[e]);a&&s.call(m.node,e)&&(m.node[e]=r.node),r.isLast=o===m.keys.length-1,r.isFirst=0===o,h.post&&h.post.call(m,r),c.pop()})),u.pop()),h.after&&h.after.call(m,m.node),m):m}(t).node}function c(t){this.value=t}function u(t){return new c(t)}c.prototype.get=function(t){for(var e=this.value,o=0;o<t.length;o++){var r=t[o];if(!e||!s.call(e,r))return;e=e[r]}return e},c.prototype.has=function(t){for(var e=this.value,o=0;o<t.length;o++){var r=t[o];if(!e||!s.call(e,r))return!1;e=e[r]}return!0},c.prototype.set=function(t,e){for(var o=this.value,r=0;r<t.length-1;r++){var n=t[r];s.call(o,n)||(o[n]={}),o=o[n]}return o[t[r]]=e,e},c.prototype.map=function(t){return a(this.value,t,!0)},c.prototype.forEach=function(t){return this.value=a(this.value,t,!1),this.value},c.prototype.reduce=function(t,e){var o=1===arguments.length,r=o?this.value:e;return this.forEach((function(e){this.isRoot&&o||(r=t.call(this,r,e))})),r},c.prototype.paths=function(){var t=[];return this.forEach((function(){t.push(this.path)})),t},c.prototype.nodes=function(){var t=[];return this.forEach((function(){t.push(this.node)})),t},c.prototype.clone=function(){var t=[],e=[];return function o(s){for(var a=0;a<t.length;a++)if(t[a]===s)return e[a];if("object"==typeof s&&null!==s){var c=i(s);return t.push(s),e.push(c),r(n(s),(function(t){c[t]=o(s[t])})),t.pop(),e.pop(),c}return s}(this.value)},r(n(c.prototype),(function(t){u[t]=function(e){var o=[].slice.call(arguments,1),r=new c(e);return r[t].apply(r,o)}})),t.exports=u},7218:(t,e,o)=>{function r(t,e){return function(){return t.apply(e,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:s}=Object,i=(a=Object.create(null),t=>{const e=n.call(t);return a[e]||(a[e]=e.slice(8,-1).toLowerCase())});var a;const c=t=>(t=t.toLowerCase(),e=>i(e)===t),u=t=>e=>typeof e===t,{isArray:p}=Array,l=u("undefined"),d=c("ArrayBuffer"),h=u("string"),f=u("function"),m=u("number"),y=t=>null!==t&&"object"==typeof t,v=t=>{if("object"!==i(t))return!1;const e=s(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},g=c("Date"),O=c("File"),b=c("Blob"),E=c("FileList"),S=c("URLSearchParams");function _(t,e,{allOwnKeys:o=!1}={}){if(null==t)return;let r,n;if("object"!=typeof t&&(t=[t]),p(t))for(r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else{const n=o?Object.getOwnPropertyNames(t):Object.keys(t),s=n.length;let i;for(r=0;r<s;r++)i=n[r],e.call(null,t[i],i,t)}}function T(t,e){e=e.toLowerCase();const o=Object.keys(t);let r,n=o.length;for(;n-- >0;)if(r=o[n],e===r.toLowerCase())return r;return null}const R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:o.g,C=t=>!l(t)&&t!==R,w=(q="undefined"!=typeof Uint8Array&&s(Uint8Array),t=>q&&t instanceof q);var q;const P=c("HTMLFormElement"),x=(({hasOwnProperty:t})=>(e,o)=>t.call(e,o))(Object.prototype),A=c("RegExp"),j=(t,e)=>{const o=Object.getOwnPropertyDescriptors(t),r={};_(o,((o,n)=>{!1!==e(o,n,t)&&(r[n]=o)})),Object.defineProperties(t,r)},k="abcdefghijklmnopqrstuvwxyz",I="0123456789",M={DIGIT:I,ALPHA:k,ALPHA_DIGIT:k+k.toUpperCase()+I};var B={isArray:p,isArrayBuffer:d,isBuffer:function(t){return null!==t&&!l(t)&&null!==t.constructor&&!l(t.constructor)&&f(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{const e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||n.call(t)===e||f(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&d(t.buffer),e},isString:h,isNumber:m,isBoolean:t=>!0===t||!1===t,isObject:y,isPlainObject:v,isUndefined:l,isDate:g,isFile:O,isBlob:b,isRegExp:A,isFunction:f,isStream:t=>y(t)&&f(t.pipe),isURLSearchParams:S,isTypedArray:w,isFileList:E,forEach:_,merge:function t(){const{caseless:e}=C(this)&&this||{},o={},r=(r,n)=>{const s=e&&T(o,n)||n;v(o[s])&&v(r)?o[s]=t(o[s],r):v(r)?o[s]=t({},r):p(r)?o[s]=r.slice():o[s]=r};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&_(arguments[t],r);return o},extend:(t,e,o,{allOwnKeys:n}={})=>(_(e,((e,n)=>{o&&f(e)?t[n]=r(e,o):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,o,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),o&&Object.assign(t.prototype,o)},toFlatObject:(t,e,o,r)=>{let n,i,a;const c={};if(e=e||{},null==t)return e;do{for(n=Object.getOwnPropertyNames(t),i=n.length;i-- >0;)a=n[i],r&&!r(a,t,e)||c[a]||(e[a]=t[a],c[a]=!0);t=!1!==o&&s(t)}while(t&&(!o||o(t,e))&&t!==Object.prototype);return e},kindOf:i,kindOfTest:c,endsWith:(t,e,o)=>{t=String(t),(void 0===o||o>t.length)&&(o=t.length),o-=e.length;const r=t.indexOf(e,o);return-1!==r&&r===o},toArray:t=>{if(!t)return null;if(p(t))return t;let e=t.length;if(!m(e))return null;const o=new Array(e);for(;e-- >0;)o[e]=t[e];return o},forEachEntry:(t,e)=>{const o=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=o.next())&&!r.done;){const o=r.value;e.call(t,o[0],o[1])}},matchAll:(t,e)=>{let o;const r=[];for(;null!==(o=t.exec(e));)r.push(o);return r},isHTMLForm:P,hasOwnProperty:x,hasOwnProp:x,reduceDescriptors:j,freezeMethods:t=>{j(t,((e,o)=>{if(f(t)&&-1!==["arguments","caller","callee"].indexOf(o))return!1;const r=t[o];f(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")}))}))},toObjectSet:(t,e)=>{const o={},r=t=>{t.forEach((t=>{o[t]=!0}))};return p(t)?r(t):r(String(t).split(e)),o},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,o){return e.toUpperCase()+o})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:T,global:R,isContextDefined:C,ALPHABET:M,generateString:(t=16,e=M.ALPHA_DIGIT)=>{let o="";const{length:r}=e;for(;t--;)o+=e[Math.random()*r|0];return o},isSpecCompliantForm:function(t){return!!(t&&f(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),o=(t,r)=>{if(y(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const n=p(t)?[]:{};return _(t,((t,e)=>{const s=o(t,r+1);!l(s)&&(n[e]=s)})),e[r]=void 0,n}}return t};return o(t,0)}};function N(t,e,o,r,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),o&&(this.config=o),r&&(this.request=r),n&&(this.response=n)}B.inherits(N,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:B.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const G=N.prototype,D={};function L(t){return B.isPlainObject(t)||B.isArray(t)}function U(t){return B.endsWith(t,"[]")?t.slice(0,-2):t}function K(t,e,o){return t?t.concat(e).map((function(t,e){return t=U(t),!o&&e?"["+t+"]":t})).join(o?".":""):e}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{D[t]={value:t}})),Object.defineProperties(N,D),Object.defineProperty(G,"isAxiosError",{value:!0}),N.from=(t,e,o,r,n,s)=>{const i=Object.create(G);return B.toFlatObject(t,i,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),N.call(i,t.message,e,o,r,n),i.cause=t,i.name=t.name,s&&Object.assign(i,s),i};const F=B.toFlatObject(B,{},null,(function(t){return/^is[A-Z]/.test(t)}));function H(t,e,o){if(!B.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(o=B.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!B.isUndefined(e[t])}))).metaTokens,n=o.visitor||u,s=o.dots,i=o.indexes,a=(o.Blob||"undefined"!=typeof Blob&&Blob)&&B.isSpecCompliantForm(e);if(!B.isFunction(n))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(B.isDate(t))return t.toISOString();if(!a&&B.isBlob(t))throw new N("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(t)||B.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,o,n){let a=t;if(t&&!n&&"object"==typeof t)if(B.endsWith(o,"{}"))o=r?o:o.slice(0,-2),t=JSON.stringify(t);else if(B.isArray(t)&&function(t){return B.isArray(t)&&!t.some(L)}(t)||(B.isFileList(t)||B.endsWith(o,"[]"))&&(a=B.toArray(t)))return o=U(o),a.forEach((function(t,r){!B.isUndefined(t)&&null!==t&&e.append(!0===i?K([o],r,s):null===i?o:o+"[]",c(t))})),!1;return!!L(t)||(e.append(K(n,o,s),c(t)),!1)}const p=[],l=Object.assign(F,{defaultVisitor:u,convertValue:c,isVisitable:L});if(!B.isObject(t))throw new TypeError("data must be an object");return function t(o,r){if(!B.isUndefined(o)){if(-1!==p.indexOf(o))throw Error("Circular reference detected in "+r.join("."));p.push(o),B.forEach(o,(function(o,s){!0===(!(B.isUndefined(o)||null===o)&&n.call(e,o,B.isString(s)?s.trim():s,r,l))&&t(o,r?r.concat(s):[s])})),p.pop()}}(t),e}function V(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function z(t,e){this._pairs=[],t&&H(t,this,e)}const J=z.prototype;function W(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function X(t,e,o){if(!e)return t;const r=o&&o.encode||W,n=o&&o.serialize;let s;if(s=n?n(e,o):B.isURLSearchParams(e)?e.toString():new z(e,o).toString(r),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}J.append=function(t,e){this._pairs.push([t,e])},J.toString=function(t){const e=t?function(e){return t.call(this,e,V)}:V;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var Y=class{constructor(){this.handlers=[]}use(t,e,o){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){B.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Q={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:z,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function Z(t){function e(t,o,r,n){let s=t[n++];const i=Number.isFinite(+s),a=n>=t.length;return s=!s&&B.isArray(r)?r.length:s,a?(B.hasOwnProp(r,s)?r[s]=[r[s],o]:r[s]=o,!i):(r[s]&&B.isObject(r[s])||(r[s]=[]),e(t,o,r[s],n)&&B.isArray(r[s])&&(r[s]=function(t){const e={},o=Object.keys(t);let r;const n=o.length;let s;for(r=0;r<n;r++)s=o[r],e[s]=t[s];return e}(r[s])),!i)}if(B.isFormData(t)&&B.isFunction(t.entries)){const o={};return B.forEachEntry(t,((t,r)=>{e(function(t){return B.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,o,0)})),o}return null}const tt={"Content-Type":void 0},et={transitional:Q,adapter:["xhr","http"],transformRequest:[function(t,e){const o=e.getContentType()||"",r=o.indexOf("application/json")>-1,n=B.isObject(t);if(n&&B.isHTMLForm(t)&&(t=new FormData(t)),B.isFormData(t))return r&&r?JSON.stringify(Z(t)):t;if(B.isArrayBuffer(t)||B.isBuffer(t)||B.isStream(t)||B.isFile(t)||B.isBlob(t))return t;if(B.isArrayBufferView(t))return t.buffer;if(B.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(n){if(o.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return H(t,new $.classes.URLSearchParams,Object.assign({visitor:function(t,e,o,r){return $.isNode&&B.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((s=B.isFileList(t))||o.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return H(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return n||r?(e.setContentType("application/json",!1),function(t,e,o){if(B.isString(t))try{return(0,JSON.parse)(t),B.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||et.transitional,o=e&&e.forcedJSONParsing,r="json"===this.responseType;if(t&&B.isString(t)&&(o&&!this.responseType||r)){const o=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(o){if("SyntaxError"===t.name)throw N.from(t,N.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$.classes.FormData,Blob:$.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};B.forEach(["delete","get","head"],(function(t){et.headers[t]={}})),B.forEach(["post","put","patch"],(function(t){et.headers[t]=B.merge(tt)}));var ot=et;const rt=B.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"]),nt=Symbol("internals");function st(t){return t&&String(t).trim().toLowerCase()}function it(t){return!1===t||null==t?t:B.isArray(t)?t.map(it):String(t)}function at(t,e,o,r,n){return B.isFunction(r)?r.call(this,e,o):(n&&(e=o),B.isString(e)?B.isString(r)?-1!==e.indexOf(r):B.isRegExp(r)?r.test(e):void 0:void 0)}class ct{constructor(t){t&&this.set(t)}set(t,e,o){const r=this;function n(t,e,o){const n=st(e);if(!n)throw new Error("header name must be a non-empty string");const s=B.findKey(r,n);(!s||void 0===r[s]||!0===o||void 0===o&&!1!==r[s])&&(r[s||e]=it(t))}const s=(t,e)=>B.forEach(t,((t,o)=>n(t,o,e)));return B.isPlainObject(t)||t instanceof this.constructor?s(t,e):B.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z]+$/.test(t.trim())?s((t=>{const e={};let o,r,n;return t&&t.split("\n").forEach((function(t){n=t.indexOf(":"),o=t.substring(0,n).trim().toLowerCase(),r=t.substring(n+1).trim(),!o||e[o]&&rt[o]||("set-cookie"===o?e[o]?e[o].push(r):e[o]=[r]:e[o]=e[o]?e[o]+", "+r:r)})),e})(t),e):null!=t&&n(e,t,o),this}get(t,e){if(t=st(t)){const o=B.findKey(this,t);if(o){const t=this[o];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=o.exec(t);)e[r[1]]=r[2];return e}(t);if(B.isFunction(e))return e.call(this,t,o);if(B.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=st(t)){const o=B.findKey(this,t);return!(!o||void 0===this[o]||e&&!at(0,this[o],o,e))}return!1}delete(t,e){const o=this;let r=!1;function n(t){if(t=st(t)){const n=B.findKey(o,t);!n||e&&!at(0,o[n],n,e)||(delete o[n],r=!0)}}return B.isArray(t)?t.forEach(n):n(t),r}clear(t){const e=Object.keys(this);let o=e.length,r=!1;for(;o--;){const n=e[o];t&&!at(0,this[n],n,t,!0)||(delete this[n],r=!0)}return r}normalize(t){const e=this,o={};return B.forEach(this,((r,n)=>{const s=B.findKey(o,n);if(s)return e[s]=it(r),void delete e[n];const i=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,o)=>e.toUpperCase()+o))}(n):String(n).trim();i!==n&&delete e[n],e[i]=it(r),o[i]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return B.forEach(this,((o,r)=>{null!=o&&!1!==o&&(e[r]=t&&B.isArray(o)?o.join(", "):o)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const o=new this(t);return e.forEach((t=>o.set(t))),o}static accessor(t){const e=(this[nt]=this[nt]={accessors:{}}).accessors,o=this.prototype;function r(t){const r=st(t);e[r]||(function(t,e){const o=B.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+o,{value:function(t,o,n){return this[r].call(this,e,t,o,n)},configurable:!0})}))}(o,t),e[r]=!0)}return B.isArray(t)?t.forEach(r):r(t),this}}ct.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),B.freezeMethods(ct.prototype),B.freezeMethods(ct);var ut=ct;function pt(t,e){const o=this||ot,r=e||o,n=ut.from(r.headers);let s=r.data;return B.forEach(t,(function(t){s=t.call(o,s,n.normalize(),e?e.status:void 0)})),n.normalize(),s}function lt(t){return!(!t||!t.__CANCEL__)}function dt(t,e,o){N.call(this,null==t?"canceled":t,N.ERR_CANCELED,e,o),this.name="CanceledError"}B.inherits(dt,N,{__CANCEL__:!0});var ht=$.isStandardBrowserEnv?{write:function(t,e,o,r,n,s){const i=[];i.push(t+"="+encodeURIComponent(e)),B.isNumber(o)&&i.push("expires="+new Date(o).toGMTString()),B.isString(r)&&i.push("path="+r),B.isString(n)&&i.push("domain="+n),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function ft(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}var mt=$.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let o;function r(o){let r=o;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return o=r(window.location.href),function(t){const e=B.isString(t)?r(t):t;return e.protocol===o.protocol&&e.host===o.host}}():function(){return!0};function yt(t,e){let o=0;const r=function(t,e){t=t||10;const o=new Array(t),r=new Array(t);let n,s=0,i=0;return e=void 0!==e?e:1e3,function(a){const c=Date.now(),u=r[i];n||(n=c),o[s]=a,r[s]=c;let p=i,l=0;for(;p!==s;)l+=o[p++],p%=t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),c-n<e)return;const d=u&&c-u;return d?Math.round(1e3*l/d):void 0}}(50,250);return n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-o,c=r(a);o=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n};u[e?"download":"upload"]=!0,t(u)}}const vt={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,o){let r=t.data;const n=ut.from(t.headers).normalize(),s=t.responseType;let i;function a(){t.cancelToken&&t.cancelToken.unsubscribe(i),t.signal&&t.signal.removeEventListener("abort",i)}B.isFormData(r)&&($.isStandardBrowserEnv||$.isStandardBrowserWebWorkerEnv)&&n.setContentType(!1);let c=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",o=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";n.set("Authorization","Basic "+btoa(e+":"+o))}const u=ft(t.baseURL,t.url);function p(){if(!c)return;const r=ut.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(t,e,o){const r=o.config.validateStatus;o.status&&r&&!r(o.status)?e(new N("Request failed with status code "+o.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o)):t(o)}((function(t){e(t),a()}),(function(t){o(t),a()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:t,request:c}),c=null}if(c.open(t.method.toUpperCase(),X(u,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=p:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(p)},c.onabort=function(){c&&(o(new N("Request aborted",N.ECONNABORTED,t,c)),c=null)},c.onerror=function(){o(new N("Network Error",N.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const r=t.transitional||Q;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),o(new N(e,r.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,t,c)),c=null},$.isStandardBrowserEnv){const e=(t.withCredentials||mt(u))&&t.xsrfCookieName&&ht.read(t.xsrfCookieName);e&&n.set(t.xsrfHeaderName,e)}void 0===r&&n.setContentType(null),"setRequestHeader"in c&&B.forEach(n.toJSON(),(function(t,e){c.setRequestHeader(e,t)})),B.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&"json"!==s&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",yt(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",yt(t.onUploadProgress)),(t.cancelToken||t.signal)&&(i=e=>{c&&(o(!e||e.type?new dt(null,t,c):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(i),t.signal&&(t.signal.aborted?i():t.signal.addEventListener("abort",i)));const l=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(u);l&&-1===$.protocols.indexOf(l)?o(new N("Unsupported protocol "+l+":",N.ERR_BAD_REQUEST,t)):c.send(r||null)}))}};B.forEach(vt,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));function gt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new dt(null,t)}function Ot(t){return gt(t),t.headers=ut.from(t.headers),t.data=pt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),(t=>{t=B.isArray(t)?t:[t];const{length:e}=t;let o,r;for(let n=0;n<e&&(o=t[n],!(r=B.isString(o)?vt[o.toLowerCase()]:o));n++);if(!r){if(!1===r)throw new N(`Adapter ${o} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(B.hasOwnProp(vt,o)?`Adapter '${o}' is not available in the build`:`Unknown adapter '${o}'`)}if(!B.isFunction(r))throw new TypeError("adapter is not a function");return r})(t.adapter||ot.adapter)(t).then((function(e){return gt(t),e.data=pt.call(t,t.transformResponse,e),e.headers=ut.from(e.headers),e}),(function(e){return lt(e)||(gt(t),e&&e.response&&(e.response.data=pt.call(t,t.transformResponse,e.response),e.response.headers=ut.from(e.response.headers))),Promise.reject(e)}))}const bt=t=>t instanceof ut?t.toJSON():t;function Et(t,e){e=e||{};const o={};function r(t,e,o){return B.isPlainObject(t)&&B.isPlainObject(e)?B.merge.call({caseless:o},t,e):B.isPlainObject(e)?B.merge({},e):B.isArray(e)?e.slice():e}function n(t,e,o){return B.isUndefined(e)?B.isUndefined(t)?void 0:r(void 0,t,o):r(t,e,o)}function s(t,e){if(!B.isUndefined(e))return r(void 0,e)}function i(t,e){return B.isUndefined(e)?B.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(o,n,s){return s in e?r(o,n):s in t?r(void 0,o):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(t,e)=>n(bt(t),bt(e),!0)};return B.forEach(Object.keys(t).concat(Object.keys(e)),(function(r){const s=c[r]||n,i=s(t[r],e[r],r);B.isUndefined(i)&&s!==a||(o[r]=i)})),o}const St={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{St[t]=function(o){return typeof o===t||"a"+(e<1?"n ":" ")+t}}));const _t={};St.transitional=function(t,e,o){function r(t,e){return"[Axios v1.3.4] Transitional option '"+t+"'"+e+(o?". "+o:"")}return(o,n,s)=>{if(!1===t)throw new N(r(n," has been removed"+(e?" in "+e:"")),N.ERR_DEPRECATED);return e&&!_t[n]&&(_t[n]=!0,console.warn(r(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(o,n,s)}};var Tt={assertOptions:function(t,e,o){if("object"!=typeof t)throw new N("options must be an object",N.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let n=r.length;for(;n-- >0;){const s=r[n],i=e[s];if(i){const e=t[s],o=void 0===e||i(e,s,t);if(!0!==o)throw new N("option "+s+" must be "+o,N.ERR_BAD_OPTION_VALUE)}else if(!0!==o)throw new N("Unknown option "+s,N.ERR_BAD_OPTION)}},validators:St};const Rt=Tt.validators;class Ct{constructor(t){this.defaults=t,this.interceptors={request:new Y,response:new Y}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Et(this.defaults,e);const{transitional:o,paramsSerializer:r,headers:n}=e;let s;void 0!==o&&Tt.assertOptions(o,{silentJSONParsing:Rt.transitional(Rt.boolean),forcedJSONParsing:Rt.transitional(Rt.boolean),clarifyTimeoutError:Rt.transitional(Rt.boolean)},!1),void 0!==r&&Tt.assertOptions(r,{encode:Rt.function,serialize:Rt.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase(),s=n&&B.merge(n.common,n[e.method]),s&&B.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete n[t]})),e.headers=ut.concat(s,n);const i=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,i.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let p,l=0;if(!a){const t=[Ot.bind(this),void 0];for(t.unshift.apply(t,i),t.push.apply(t,c),p=t.length,u=Promise.resolve(e);l<p;)u=u.then(t[l++],t[l++]);return u}p=i.length;let d=e;for(l=0;l<p;){const t=i[l++],e=i[l++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=Ot.call(this,d)}catch(t){return Promise.reject(t)}for(l=0,p=c.length;l<p;)u=u.then(c[l++],c[l++]);return u}getUri(t){return X(ft((t=Et(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}B.forEach(["delete","get","head","options"],(function(t){Ct.prototype[t]=function(e,o){return this.request(Et(o||{},{method:t,url:e,data:(o||{}).data}))}})),B.forEach(["post","put","patch"],(function(t){function e(e){return function(o,r,n){return this.request(Et(n||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}Ct.prototype[t]=e(),Ct.prototype[t+"Form"]=e(!0)}));var wt=Ct;class qt{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const o=this;this.promise.then((t=>{if(!o._listeners)return;let e=o._listeners.length;for(;e-- >0;)o._listeners[e](t);o._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{o.subscribe(t),e=t})).then(t);return r.cancel=function(){o.unsubscribe(e)},r},t((function(t,r,n){o.reason||(o.reason=new dt(t,r,n),e(o.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new qt((function(e){t=e})),cancel:t}}}var Pt=qt;const xt={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(xt).forEach((([t,e])=>{xt[e]=t}));var At=xt;const jt=function t(e){const o=new wt(e),n=r(wt.prototype.request,o);return B.extend(n,wt.prototype,o,{allOwnKeys:!0}),B.extend(n,o,null,{allOwnKeys:!0}),n.create=function(o){return t(Et(e,o))},n}(ot);jt.Axios=wt,jt.CanceledError=dt,jt.CancelToken=Pt,jt.isCancel=lt,jt.VERSION="1.3.4",jt.toFormData=H,jt.AxiosError=N,jt.Cancel=jt.CanceledError,jt.all=function(t){return Promise.all(t)},jt.spread=function(t){return function(e){return t.apply(null,e)}},jt.isAxiosError=function(t){return B.isObject(t)&&!0===t.isAxiosError},jt.mergeConfig=Et,jt.AxiosHeaders=ut,jt.formToJSON=t=>Z(B.isHTMLForm(t)?new FormData(t):t),jt.HttpStatusCode=At,jt.default=jt,t.exports=jt}},e={};function o(r){var n=e[r];if(void 0!==n)return n.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,o),s.exports}o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var r=o(2915),n=exports;for(var s in r)n[s]=r[s];r.__esModule&&Object.defineProperty(n,"__esModule",{value:!0});
1
+ var t={9818:function(t,e,o){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)},n=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsApi=void 0;var i=o(2915),a=o(3028),c=o(7111),u=o(7034),p=function(){function t(e){t.validateConfig(e),this.config=e,this.auth=new i.CommercetoolsAuth(e),this.endpoints=c.REGION_URLS[this.config.region],this.requestExecutor=(0,u.getRequestExecutor)({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}return t.prototype.getStoreById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/".concat(t.id),method:"GET"}))},t.prototype.getStoreByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/key=".concat(t.key),method:"GET"}))},t.prototype.queryStores=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores",method:"GET"}))},t.prototype.createStore=function(t){return this.request({path:"/stores",method:"POST",data:t.data})},t.prototype.updateStoreById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/".concat(t.id),method:"POST",data:t.data}))},t.prototype.updateStoreByKey=function(t){return this.request({path:"/stores/key=".concat(t.key),method:"POST",data:t.data})},t.prototype.deleteStoreById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.deleteStoreByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.getCategoryById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/".concat(t.id),method:"GET"}))},t.prototype.getCategoryByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/key=".concat(t.key),method:"GET"}))},t.prototype.queryChannels=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/channels",method:"GET"}))},t.prototype.importOrder=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/orders/import",method:"POST",data:t.data}))]}))}))},t.prototype.getChannelById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/channels/".concat(t.id),method:"GET"}))},t.prototype.getChannelByKey=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/channels",method:"GET",params:{where:'key="'.concat(t.key,'"'),limit:1}}))];case 1:if(!(null==(e=o.sent())?void 0:e.count))throw new a.CommercetoolsError("No channel found with key [".concat(t.key,"]"),null,404);return[2,e.results[0]]}}))}))},t.prototype.getCategory=function(t){if(!t.id&&!t.key)throw new a.CommercetoolsError("Either an id, key or slug must be provided");return t.id?this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/".concat(t.id),method:"GET"})):this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/key=".concat(t.key),method:"GET"}))},t.prototype.getCategoryBySlug=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:if(!t.languageCode&&!t.languageCodes)throw new a.CommercetoolsError("Either the `languageCode` or `languageCodes` property must be provided");return e=[],t.languageCodes?e.push.apply(e,t.languageCodes):t.languageCode&&e.push(t.languageCode),[4,this.request(r(r({},this.extractCommonRequestOptions(r(r({},t),{params:r(r({},null==t?void 0:t.params),{where:"slug(".concat(e.map((function(e){return"".concat(e,'="').concat(t.slug,'"')})).join(" or "),")")})}))),{path:"/categories",method:"GET"}))];case 1:if(!(o=n.sent()).count)throw new a.CommercetoolsError("No category found with slug [".concat(t.slug,"] and language code [").concat(t.languageCode,"]"),{options:t},404);return[2,o.results[0]]}}))}))},t.prototype.queryCategories=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories",method:"GET"}))},t.prototype.getCategoryParents=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:return[4,this.getCategory(r(r({},t),{params:r(r({},t.params),{expand:"ancestors[*]"})}))];case 1:return e=n.sent(),(o=e.ancestors.map((function(t){return t.obj}))).push(r(r({},e),{ancestors:e.ancestors.map((function(t){return{id:t.id,typeId:t.typeId}}))})),[2,o]}}))}))},t.prototype.getProductById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/".concat(t.id),method:"GET"}))},t.prototype.getProductByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/key=".concat(t.key),method:"GET"}))},t.prototype.getProductProjectionById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/product-projections/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.getProductProjectionByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/product-projections/key=".concat(t.key),t.storeKey),method:"GET"}))},t.prototype.getProductProjectionBySlug=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:if(!t.languageCode&&!t.languageCodes)throw new a.CommercetoolsError("Either the `languageCode` or `languageCodes` property must be provided");return e=[],t.languageCodes?e.push.apply(e,t.languageCodes):t.languageCode&&e.push(t.languageCode),[4,this.request(r(r({},this.extractCommonRequestOptions(r(r({},t),{params:r(r({},null==t?void 0:t.params),{where:"slug(".concat(e.map((function(e){return"".concat(e,'="').concat(t.slug,'"')})).join(" or "),")")})}))),{path:"/product-projections",method:"GET"}))];case 1:if(!(o=n.sent()).count)throw new a.CommercetoolsError("No product projection found with slug [".concat(t.slug,"] and language code [").concat(t.languageCode,"]"),{options:t},404);return[2,o.results[0]]}}))}))},t.prototype.queryProductProjections=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-projections",method:"GET"}))},t.prototype.searchProductProjections=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-projections/search",method:"GET"}))},t.prototype.getProductSelectionById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/product-selections/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.getProductSelectionByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/product-selections/key=".concat(t.key),t.storeKey),method:"GET"}))},t.prototype.queryProductSelections=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-selections",method:"GET"}))},t.prototype.createProductSelection=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-selections",method:"POST",data:t.data}))},t.prototype.updateProductSelectionByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-selections/key=".concat(t.key),method:"POST",data:{version:t.version,actions:t.actions}}))},t.prototype.deleteProductSelectionByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-selections/key=".concat(t.key,"&version=").concat(t.version),method:"DELETE"}))},t.prototype.queryProductsInStore=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/in-store/key=".concat(t.storeKey,"/product-selection-assignments"),method:"GET"}))},t.prototype.getCartById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.queryCarts=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts",null==t?void 0:t.storeKey),method:"GET"}))]}))}))},t.prototype.queryMyCarts=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts",t.storeKey),method:"GET",accessToken:t.accessToken}))]}))}))},t.prototype.createCart=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts",t.storeKey),method:"POST",data:t.data}))]}))}))},t.prototype.updateCartById=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts/".concat(t.id),t.storeKey),method:"POST",data:{version:t.version,actions:t.actions}}))]}))}))},t.prototype.getMyActiveCart=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/active-cart",t.storeKey),method:"GET",accessToken:t.accessToken}))]}))}))},t.prototype.getMyCartById=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(t.cartId),t.storeKey),method:"GET",accessToken:t.accessToken}))]}))}))},t.prototype.createMyCart=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken}))]}))}))},t.prototype.updateMyCart=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(t.cartId),t.storeKey),method:"POST",data:{version:t.cartVersion,actions:t.actions},accessToken:t.accessToken}))]}))}))},t.prototype.deleteMyActiveCart=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyActiveCart(t)];case 1:return e=o.sent(),[4,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(e.id),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:e.version}),accessToken:t.accessToken}))];case 2:return[2,o.sent()]}}))}))},t.prototype.deleteMyCartById=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyCartById(t)];case 1:return e=o.sent(),[4,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(t.cartId),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:e.version}),accessToken:t.accessToken}))];case 2:return[2,o.sent()]}}))}))},t.prototype.updateMyActiveCart=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyActiveCart(t)];case 1:return e=o.sent(),[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(e.id),t.storeKey),method:"POST",data:{version:e.version,actions:t.actions},accessToken:t.accessToken}))]}}))}))},t.prototype.createMyOrderFromActiveCart=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyActiveCart(t)];case 1:return e=o.sent(),[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/orders",t.storeKey),method:"POST",data:{version:e.version,id:e.id},accessToken:t.accessToken}))]}}))}))},t.prototype.createOrderFromCart=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getCartById(t)];case 1:return e=o.sent(),[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders",t.storeKey),method:"POST",data:{version:e.version,id:e.id}}))]}}))}))},t.prototype.deleteCartById=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts/".concat(t.id),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version})}))];case 1:return[2,e.sent()]}}))}))},t.prototype.createPayment=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments",method:"POST",data:t.data}))},t.prototype.deletePaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.updatePaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments/".concat(t.id),method:"POST",data:t.data}))},t.prototype.getPaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments/".concat(t.id),method:"GET"}))},t.prototype.queryPayments=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments",method:"GET"}))},t.prototype.createMyPayment=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments",method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.updateMyPaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments/".concat(t.id),method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.getMyPaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments/".concat(t.id),method:"GET",accessToken:t.accessToken}))},t.prototype.queryMyPayments=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments",method:"GET",accessToken:t.accessToken}))},t.prototype.deleteMyPaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments/".concat(t.id),method:"DELETE",params:{version:t.version},accessToken:t.accessToken}))},t.prototype.getMyOrderById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/orders/".concat(t.id),t.storeKey),method:"GET",accessToken:t.accessToken}))},t.prototype.queryMyOrders=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/orders",t.storeKey),method:"GET",accessToken:t.accessToken}))},t.prototype.updateOrderById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/".concat(t.id),t.storeKey),method:"POST",data:t.data}))},t.prototype.updateOrderByOrderNumber=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/order-number=".concat(t.orderNumber),t.storeKey),method:"POST",data:t.data}))},t.prototype.getOrderById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.getOrderByOrderNumber=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/order-number=".concat(t.orderNumber),t.storeKey),method:"GET"}))},t.prototype.deleteOrderById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/".concat(t.id),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version,dataErasure:t.dataErasure})}))},t.prototype.deleteOrderByOrderNumber=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/order-number=".concat(t.orderNo),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version,dataErasure:t.dataErasure})}))},t.prototype.queryOrders=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders",t.storeKey),method:"GET"}))},t.prototype.createProduct=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products",method:"POST",data:t.data}))},t.prototype.updateProductByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/key=".concat(t.key),method:"POST",data:t.data}))},t.prototype.updateProductById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/".concat(t.id),method:"POST",data:t.data}))},t.prototype.deleteProductById=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:return e=t.version,t.unpublish?[4,this.unpublishProductById({id:t.id,version:t.version})]:[3,2];case 1:o=n.sent(),e=o.version,n.label=2;case 2:return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:e})}))]}}))}))},t.prototype.deleteProductByKey=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:return e=t.version,t.unpublish?[4,this.unpublishProductByKey({key:t.key,version:t.version})]:[3,2];case 1:o=n.sent(),e=o.version,n.label=2;case 2:return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:e})}))]}}))}))},t.prototype.unpublishProductByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/key=".concat(t.key),method:"POST",params:t.params,data:{version:t.version,actions:[{action:"unpublish"}]}}))},t.prototype.unpublishProductById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/".concat(t.id),method:"POST",params:t.params,data:{version:t.version,actions:[{action:"unpublish"}]}}))},t.prototype.createCategory=function(t){return this.request({path:"/categories",method:"POST",data:t.data})},t.prototype.updateCategoryByKey=function(t){return this.request({path:"/categories/key=".concat(t.key),method:"POST",data:t.data})},t.prototype.updateCategoryById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/".concat(t.id),method:"POST",data:t.data}))},t.prototype.deleteCategoryById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.deleteCategoryByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.createAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers",t.storeKey),method:"POST",data:t.data}))},t.prototype.deleteCustomerById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/".concat(t.id),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version,dataErasure:t.dataErasure})}))},t.prototype.deleteCustomerByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/key=".concat(t.key),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version,dataErasure:t.dataErasure})}))},t.prototype.createMyAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/signup",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.loginMyAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/login",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.login=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/login",t.storeKey),method:"POST",data:t.data}))},t.prototype.getMyAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me",t.storeKey),method:"GET",accessToken:t.accessToken}))},t.prototype.updateMyAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data}))},t.prototype.changeMyPassword=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/password",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data}))},t.prototype.resetMyPassword=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/password/reset",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data}))},t.prototype.getPasswordResetToken=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/password-token",t.storeKey),method:"POST",data:t.data}))},t.prototype.getCustomerById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.getCustomerByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/key=".concat(t.key),t.storeKey),method:"GET"}))},t.prototype.getCustomerByPasswordToken=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/password-token=".concat(t.token),t.storeKey),method:"GET"}))},t.prototype.queryCustomers=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers",t.storeKey),method:"GET"}))},t.prototype.updateCustomerById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customers/".concat(t.id),method:"POST",data:t.data}))},t.prototype.updateCustomerByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customers/key=".concat(t.key),method:"POST",data:t.data}))},t.prototype.getProductTypeById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-types/".concat(t.id),method:"GET"}))},t.prototype.getProductTypeByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-types/key=".concat(t.key),method:"GET"}))},t.prototype.queryProductTypes=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-types",method:"GET"}))},t.prototype.getTypeById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/types/".concat(t.id),method:"GET"}))},t.prototype.getTypeByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/types/key=".concat(t.key),method:"GET"}))},t.prototype.queryTypes=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/types",method:"GET"}))},t.prototype.getDiscountCodeById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/discount-codes/".concat(t.id),method:"GET"}))},t.prototype.getCartDiscountById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/cart-discounts/".concat(t.id),method:"GET"}))},t.prototype.getCartDiscountByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/cart-discounts/key=".concat(t.key),method:"GET"}))},t.prototype.queryCartDiscounts=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/cart-discounts",method:"GET"}))},t.prototype.getCustomObject=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/custom-objects/".concat(t.container,"/").concat(t.key),method:"GET"}))},t.prototype.getCustomObjectById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/custom-objects/".concat(t.id),method:"GET"}))},t.prototype.saveCustomObject=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/custom-objects",method:"POST",data:t.data}))},t.prototype.deleteCustomObject=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/custom-objects/".concat(t.container,"/").concat(t.key),method:"DELETE"}))},t.prototype.getShippingMethodById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/shipping-methods/".concat(t.id),method:"GET"}))},t.prototype.getShippingMethodByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/shipping-methods/key=".concat(t.key),method:"GET"}))},t.prototype.getShippingMethodsForLocation=function(t){return this.request(r(r({},this.extractCommonRequestOptions(r(r({},t),{params:r(r({},null==t?void 0:t.params),{country:t.country,state:t.state,currency:t.currency})}))),{path:"/shipping-methods/matching-location",method:"GET",accessToken:t.accessToken}))},t.prototype.getShippingMethodsForCart=function(t){return this.request(r(r({},this.extractCommonRequestOptions(r(r({},t),{params:r(r({},null==t?void 0:t.params),{cartId:t.cartId})}))),{path:"/shipping-methods/matching-cart",method:"GET",accessToken:t.accessToken}))},t.prototype.queryShippingMethods=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/shipping-methods",method:"GET"}))},t.prototype.getCustomerGroupById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/".concat(t.id),method:"GET"}))},t.prototype.getCustomerGroupByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/key=".concat(t.key),method:"GET"}))},t.prototype.queryCustomerGroups=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups",method:"GET"}))},t.prototype.createCustomerGroup=function(t){return this.request({path:"/customer-groups",method:"POST",data:t.data})},t.prototype.updateCustomerGroupByKey=function(t){return this.request({path:"/customer-groups/key=".concat(t.key),method:"POST",data:t.data})},t.prototype.updateCustomerGroupById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/".concat(t.id),method:"POST",data:t.data}))},t.prototype.deleteCustomerGroupById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.deleteCustomerGroupByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.getStateById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/states/".concat(t.id),method:"GET"}))},t.prototype.getStateByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/states/key=".concat(t.key),method:"GET"}))},t.prototype.queryStates=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/states",method:"GET"}))},t.prototype.getStandalonePriceById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/".concat(t.id),method:"GET"}))},t.prototype.getStandalonePriceByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/key=".concat(t.key),method:"GET"}))},t.prototype.queryStandalonePrices=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices",method:"GET"}))},t.prototype.createStandalonePrice=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices",method:"POST",data:t.data}))},t.prototype.updateStandalonePriceById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/".concat(t.id),method:"POST",data:t.data}))},t.prototype.updateStandalonePriceByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/key=".concat(t.key),method:"POST",data:t.data}))},t.prototype.deleteStandalonePriceById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.deleteStandalonePriceByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.graphql=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/graphql",method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.request=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getRequestOptions(t)];case 1:return e=o.sent(),[4,this.requestExecutor(e)];case 2:return[2,o.sent()]}}))}))},t.prototype.getRequestOptions=function(t){return n(this,void 0,void 0,(function(){var e,o,n,i,a;return s(this,(function(s){switch(s.label){case 0:return o=t.accessToken,n="".concat(this.endpoints.api,"/").concat(this.config.projectKey).concat(t.path),o?[3,2]:[4,this.auth.getClientGrant()];case 1:i=s.sent(),o=i.accessToken,s.label=2;case 2:return a=r(r({},t.headers),{Authorization:"Bearer ".concat(o)}),"string"==typeof t.correlationId&&""!==t.correlationId&&(a["X-Correlation-ID"]=t.correlationId,delete t.correlationId),t.params&&Object.keys(t.params).length&&(e=t.params),[2,{method:t.method,data:t.data,url:n,headers:a,params:e}]}}))}))},t.prototype.extractCommonRequestOptions=function(t){return t?{correlationId:t.correlationId,params:t.params,retry:t.retry}:{}},t.prototype.applyStore=function(t,e){return"string"==typeof e&&""!==e?"/in-store/key=".concat(e).concat(t):this.config.storeKey?"/in-store/key=".concat(this.config.storeKey).concat(t):t},t.validateConfig=function(t){var e=[];if(t?(t.projectKey?"string"!=typeof t.projectKey&&e.push("The `projectKey` property must be a string"):e.push("The `projectKey` property is empty"),t.clientId?"string"!=typeof t.clientId&&e.push("The `clientId` property must be a string"):e.push("The `clientId` property is empty"),t.clientSecret?"string"!=typeof t.clientSecret&&e.push("The `clientSecret` property must be a string"):e.push("The `clientSecret` property is empty"),Array.isArray(t.clientScopes)?0===t.clientScopes.length&&e.push("The `clientScopes` property must have at least 1 scope defined"):e.push("The `clientScopes` property must be an array")):e.push("The config object missing or empty"),e.length)throw new a.CommercetoolsError("The configuration object passed in to the `CommercetoolsApi` constructor is not valid: \n"+e.map((function(t){return"• ".concat(t)})).join("\n"))},t}();e.CommercetoolsApi=p},3713:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(9818),e),n(o(7013),e)},7013:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2442:function(t,e,o){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)},n=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsAuth=void 0;var i=o(2915),a=o(8003),c=o(3032),u={refreshIfWithinSecs:1800,timeoutMs:5e3},p=function(){function t(t){if(this.grantPromise=null,this.config=r(r({},u),t),!this.config.clientScopes.length)throw new i.CommercetoolsError("`config.clientScopes` must contain at least one scope");this.api=new c.CommercetoolsAuthApi(t)}return t.prototype.getClientGrant=function(){return n(this,void 0,void 0,(function(){var t=this;return s(this,(function(e){return this.grantPromise?[2,this.grantPromise]:this.grant&&!this.grant.expiresWithin(this.config.refreshIfWithinSecs)?[2,this.grant]:(this.grantPromise=this.api.getClientGrant(this.config.clientScopes).then((function(e){return t.grant=new a.CommercetoolsGrant(e),t.grant})).finally((function(){t.grantPromise=null})),[2,this.grantPromise])}))}))},t.prototype.refreshCustomerGrant=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.api.refreshGrant(t)];case 1:return e=o.sent(),[2,new a.CommercetoolsGrant(r(r({},e),{refresh_token:t}))]}}))}))},t.prototype.login=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:if(!(e=t.scopes||this.config.customerScopes))throw new i.CommercetoolsError("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");return[4,this.getClientGrant()];case 1:return n.sent(),[4,this.api.login(r(r({},t),{scopes:e}))];case 2:return o=n.sent(),[2,new a.CommercetoolsGrant(o)]}}))}))},t.prototype.getAnonymousGrant=function(t){return n(this,void 0,void 0,(function(){var e,o,r;return s(this,(function(n){switch(n.label){case 0:if(e=(null==t?void 0:t.scopes)||this.config.customerScopes,o=null==t?void 0:t.anonymousId,!e)throw new i.CommercetoolsError("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");return[4,this.getClientGrant()];case 1:return n.sent(),[4,this.api.getAnonymousGrant({scopes:e,anonymousId:o})];case 2:return r=n.sent(),[2,new a.CommercetoolsGrant(r)]}}))}))},t.prototype.logout=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.api.logout(t)];case 1:return e.sent(),[2]}}))}))},t.prototype.revokeToken=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.api.revokeToken(t)];case 1:return e.sent(),[2]}}))}))},t}();e.CommercetoolsAuth=p},3032:function(t,e,o){var r=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsAuthApi=void 0;var s=o(2849),i=o(2915),a=o(7530),c=o(7111),u=o(9017),p=o(7034),l=function(){function t(t){this.config=t,this.endpoints=c.REGION_URLS[this.config.region],this.requestExecutor=(0,p.getRequestExecutor)({timeoutMs:t.timeoutMs,httpsAgent:t.httpsAgent,systemIdentifier:t.systemIdentifier,onBeforeRequest:t.onBeforeRequest,onAfterResponse:t.onAfterResponse,retry:t.retry})}return t.prototype.getClientGrant=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.post("/token",{grant_type:s.GrantType.CLIENT_CREDENTIALS,scope:(0,a.scopeArrayToRequestString)(t,this.config.projectKey)})]}))}))},t.prototype.refreshGrant=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.post("/token",{grant_type:s.GrantType.REFRESH_TOKEN,refresh_token:t})];case 1:return[2,e.sent()]}}))}))},t.prototype.login=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.post("/".concat(this.config.projectKey).concat(this.applyStore("/customers/token",t.storeKey)),{username:t.username,password:t.password,grant_type:s.GrantType.PASSWORD,scope:(0,a.scopeArrayToRequestString)(t.scopes,this.config.projectKey)})]}))}))},t.prototype.revokeToken=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.post("/token/revoke",{token:t.tokenValue,token_type_hint:t.tokenType})];case 1:return e.sent(),[2]}}))}))},t.prototype.logout=function(t){return r(this,void 0,void 0,(function(){var e,o;return n(this,(function(r){switch(r.label){case 0:return[4,Promise.allSettled([this.revokeToken({tokenType:"access_token",tokenValue:t.accessToken}),this.revokeToken({tokenType:"refresh_token",tokenValue:t.refreshToken})])];case 1:if(e=r.sent(),(o=e.reduce((function(t,e){return"rejected"===e.status&&t.push(e.reason),t}),[])).length)throw new i.CommercetoolsError("Logout failed in one or more calls to the token revocation endpoint",o);return[2]}}))}))},t.prototype.getAnonymousGrant=function(t){var e;return r(this,void 0,void 0,(function(){var o;return n(this,(function(r){return o={grant_type:s.GrantType.CLIENT_CREDENTIALS},(null===(e=null==t?void 0:t.scopes)||void 0===e?void 0:e.length)&&(o.scope=(0,a.scopeArrayToRequestString)(t.scopes,this.config.projectKey)),(null==t?void 0:t.anonymousId)&&(o.anonymous_id=t.anonymousId),[2,this.post("/".concat(this.config.projectKey,"/anonymous/token"),o)]}))}))},t.prototype.post=function(t,e){return r(this,void 0,void 0,(function(){return n(this,(function(o){switch(o.label){case 0:return[4,this.requestExecutor(this.getRequestOptions({path:t,body:e}))];case 1:return[2,o.sent()]}}))}))},t.prototype.getRequestOptions=function(t){var e,o="".concat(this.endpoints.auth,"/oauth").concat(t.path),r={Authorization:"Basic ".concat((0,u.base64EncodeForBasicAuth)(this.config.clientId,this.config.clientSecret)),"Content-Type":"application/x-www-form-urlencoded"};return t.correlationId&&""!==t.correlationId&&(r["X-Correlation-ID"]=t.correlationId,delete t.correlationId),t.body&&(e=new URLSearchParams(t.body).toString()),{method:"POST",data:e,url:o,headers:r}},t.prototype.applyStore=function(t,e){return"string"==typeof e&&""!==e?"/in-store/key=".concat(e).concat(t):this.config.storeKey?"/in-store/key=".concat(this.config.storeKey).concat(t):t},t}();e.CommercetoolsAuthApi=l},8003:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsGrant=void 0;var r=o(7530),n=function(){function t(t){this.accessToken="",this.expiresIn=0,this.expiresAt=new Date,this.scopes=[],this.accessToken=t.access_token,this.expiresIn=t.expires_in,this.scopes=(0,r.scopeRequestStringToArray)(t.scope),this.anonymousId=this.extractKeyFromScope("anonymous_id",t.scope),this.customerId=this.extractKeyFromScope("customer_id",t.scope),this.expiresAt=new Date((new Date).getTime()+1e3*t.expires_in),"refresh_token"in t&&t.refresh_token&&(this.refreshToken=t.refresh_token)}return t.prototype.expiresWithin=function(t){var e=(new Date).getTime()+1e3*t;return this.expiresAt.getTime()<e},t.prototype.extractKeyFromScope=function(t,e){if(e&&t){var o=null==e?void 0:e.split(" ");if(Array.isArray(o)&&0!==o.length){var r=o.find((function(e){return e.slice(0,t.length+1)==="".concat(t,":")}));return r?r.slice(t.length+1):void 0}}},t}();e.CommercetoolsGrant=n},7111:(t,e,o)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.INVALID_SCOPES=e.REGION_URLS=void 0;var n=o(9291);e.REGION_URLS=((r={})[n.Region.EUROPE_GCP]={auth:"https://auth.europe-west1.gcp.commercetools.com",api:"https://api.europe-west1.gcp.commercetools.com"},r[n.Region.EUROPE_AWS]={auth:"https://auth.eu-central-1.aws.commercetools.com",api:"https://api.eu-central-1.aws.commercetools.com"},r[n.Region.NORTH_AMERICA_GCP]={auth:"https://auth.us-central1.gcp.commercetools.com",api:"https://api.us-central1.gcp.commercetools.com"},r[n.Region.NORTH_AMERICA_AWS]={auth:"https://auth.us-east-2.aws.commercetools.com",api:"https://api.us-east-2.aws.commercetools.com"},r[n.Region.AUSTRALIA_GCP]={auth:"https://auth.australia-southeast1.gcp.commercetools.com",api:"https://api.australia-southeast1.gcp.commercetools.com"},r),e.INVALID_SCOPES=["anonymous_id","customer_id"]},7443:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(2442),e),n(o(8003),e)},7530:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.scopeRequestStringToArray=e.scopeArrayToRequestString=void 0;var r=o(7111);e.scopeArrayToRequestString=function(t,e){return t?t.map((function(t){return"".concat(t,":").concat(e)})).join(" "):""},e.scopeRequestStringToArray=function(t){return t?t.split(" ").map((function(t){return t.split(":")[0]})).filter((function(t){return!r.INVALID_SCOPES.includes(t)})):[]}},2849:(t,e)=>{var o;Object.defineProperty(e,"__esModule",{value:!0}),e.GrantType=void 0,(o=e.GrantType||(e.GrantType={})).CLIENT_CREDENTIALS="client_credentials",o.REFRESH_TOKEN="refresh_token",o.PASSWORD="password"},9017:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.base64EncodeForBasicAuth=void 0,e.base64EncodeForBasicAuth=function(t,e){var o="".concat(t,":").concat(e);return btoa(o)}},4060:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_HTTPS_AGENT_CONFIG=e.RETRYABLE_STATUS_CODES=e.DEFAULT_RETRY_CONFIG=e.MAX_ITEMS_PER_QUERY=e.DEFAULT_REQUEST_TIMEOUT_MS=e.USER_AGENT_PREFIX=void 0;var r=o(8842);e.USER_AGENT_PREFIX="@gradientedge/commercetools-utils",e.DEFAULT_REQUEST_TIMEOUT_MS=5e3,e.MAX_ITEMS_PER_QUERY=500,e.DEFAULT_RETRY_CONFIG={maxRetries:3,delayMs:50,jitter:!0},e.RETRYABLE_STATUS_CODES=[r.Status.InternalServerError,r.Status.NotImplemented,r.Status.BadGateway,r.Status.ServiceUnavailable,r.Status.GatewayTimeout],e.DEFAULT_HTTPS_AGENT_CONFIG={keepAlive:!0,maxSockets:32,maxFreeSockets:10,timeout:e.DEFAULT_REQUEST_TIMEOUT_MS}},6781:function(t,e,o){var r,n=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsError=void 0;var i=s(o(4530)),a=o(893),c=function(t){function e(o,r,n){var s=t.call(this,o)||this;return s.isCommercetoolsError=!0,s.data=r,s.status=n,Object.setPrototypeOf(s,e.prototype),s}return n(e,t),e.fromAxiosError=function(t){var o,r,n,s,i,c,u,p;return new e(t.message,{code:t.code,request:{url:null===(o=t.config)||void 0===o?void 0:o.url,method:null===(r=t.config)||void 0===r?void 0:r.method,headers:(0,a.maskSensitiveHeaders)((0,a.extractAxiosHeaders)(null===(n=t.config)||void 0===n?void 0:n.headers)),params:(0,a.maskSensitiveInput)(null===(s=t.config)||void 0===s?void 0:s.params),data:(0,a.maskSensitiveInput)(this.parseRequestData(t.config))},response:{status:null===(i=t.response)||void 0===i?void 0:i.status,data:(0,a.maskSensitiveInput)(null===(c=t.response)||void 0===c?void 0:c.data),headers:(0,a.extractAxiosHeaders)(null===(u=t.response)||void 0===u?void 0:u.headers)}},null===(p=t.response)||void 0===p?void 0:p.status)},e.parseRequestData=function(t){var e,o;if(!t)return null;var r=null==t?void 0:t.data;if("string"==typeof r&&r){var n="";if("string"==typeof(null===(e=null==t?void 0:t.headers)||void 0===e?void 0:e["Content-Type"])&&(n=null===(o=null==t?void 0:t.headers)||void 0===o?void 0:o["Content-Type"]),"application/json"===n.substring(0,16))try{r=JSON.parse(t.data)}catch(t){}else if("application/x-www-form-urlencoded"===n.substring(0,33))try{var s=new URLSearchParams(t.data),i={};s.forEach((function(t,e,o){var r=o.getAll(e);0===r.length?i[e]="":1===r.length?i[e]=r[0]:i[e]=r})),r=i}catch(t){}}return r},e.prototype.toJSON=function(){return{status:this.status,message:this.message,data:this.data,isCommercetoolsError:!0}},e.prototype.toString=function(){return(0,i.default)(this.toJSON())},e}(Error);e.CommercetoolsError=c},3028:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(6781),e)},2915:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_ITEMS_PER_QUERY=e.Region=void 0,n(o(3028),e),n(o(7443),e),n(o(3713),e);var s=o(9291);Object.defineProperty(e,"Region",{enumerable:!0,get:function(){return s.Region}}),n(o(893),e),n(o(6249),e);var i=o(4060);Object.defineProperty(e,"MAX_ITEMS_PER_QUERY",{enumerable:!0,get:function(){return i.MAX_ITEMS_PER_QUERY}})},625:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9605:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5554:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4294:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5991:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5714:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7942:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9906:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4241:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},146:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5167:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4236:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6249:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(9605),e),n(o(625),e),n(o(5554),e),n(o(4294),e),n(o(5991),e),n(o(5714),e),n(o(9906),e),n(o(7942),e),n(o(4241),e),n(o(146),e),n(o(5167),e),n(o(4236),e),n(o(2949),e),n(o(492),e),n(o(6871),e),n(o(6487),e),n(o(8386),e),n(o(4946),e),n(o(6313),e),n(o(5285),e),n(o(5283),e),n(o(3708),e),n(o(6883),e),n(o(2246),e),n(o(4089),e),n(o(6614),e),n(o(7607),e),n(o(310),e),n(o(7183),e),n(o(2569),e),n(o(1027),e),n(o(6080),e),n(o(1613),e),n(o(721),e)},2949:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},492:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6871:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},8386:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6487:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4946:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5285:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5283:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},3708:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6313:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6883:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2246:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4089:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6614:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7607:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},310:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7183:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2569:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1027:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6080:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1613:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},721:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4474:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(7261),e),n(o(884),e)},884:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isRetryableError=void 0;var r=o(4060);e.isRetryableError=function(t){return!t.isAxiosError||!t.request||!t.response||r.RETRYABLE_STATUS_CODES.includes(t.response.status)}},7034:function(t,e,o){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getRequestExecutor=void 0;var n=o(4474),s=o(893),i=o(4060);e.getRequestExecutor=function(t){var e=(0,s.createAxiosInstance)({httpsAgent:t.httpsAgent}),o={"User-Agent":(0,s.buildUserAgent)(t.systemIdentifier)};return function(s){var a=r(r({},o),s.headers);return(0,n.request)({axiosInstance:e,onBeforeRequest:t.onBeforeRequest,onAfterResponse:t.onAfterResponse,request:r(r({},s),{headers:a}),retry:r(r({},i.DEFAULT_RETRY_CONFIG),t.retry),timeoutMs:t.timeoutMs})}}},7261:function(t,e,o){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)},n=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.request=void 0;var i=o(893),a=o(884),c=o(1100),u=o(4060),p=o(2003);e.request=function(t){var e,o,l;return n(this,void 0,void 0,(function(){var n,d,h,f,m,y,v,g,O,b,E,S,_,T;return s(this,(function(R){switch(R.label){case 0:n=t.retry,d=t.onBeforeRequest,h=t.onAfterResponse,f=t.axiosInstance,m=null!==(e=t.timeoutMs)&&void 0!==e?e:u.DEFAULT_REQUEST_TIMEOUT_MS,y={},v=(0,p.plainClone)(t.request),g=0,Object.keys(null!==(o=v.headers)&&void 0!==o?o:{}).map((function(t){return t.toLowerCase()})).includes("user-agent")||(null!==(l=v.headers)&&void 0!==l||(v.headers={}),v.headers["User-Agent"]=(0,i.buildUserAgent)()),b=0,_=function(){var t,e,o,u,p;return s(this,(function(s){switch(s.label){case 0:return E=null,S=null,g>0?(y["X-Retry-Count"]="".concat(g),t=(0,i.calculateDelay)(g,n),[4,new Promise((function(e){return setTimeout(e,t)}))]):[3,2];case 1:s.sent(),s.label=2;case 2:return s.trys.push([2,6,,7]),d?[4,d(v)]:[3,4];case 3:(e=s.sent())&&(v=e),s.label=4;case 4:return E=Date.now(),[4,f(r(r({},v),{headers:r(r({},v.headers),y),timeout:m}))];case 5:return o=s.sent(),S=Date.now(),b+=S-E,h&&h((0,i.convertAxiosResponse)(o,{accumulativeDurationMs:b,durationMs:S-E,retries:g})),[2,{value:o.data}];case 6:if(u=s.sent(),S=Date.now(),b+=E?S-E:0,h&&(p=(0,i.convertAxiosError)(u,{accumulativeDurationMs:b,durationMs:E?S-E:0,retries:g}))&&h(p),!(0,a.isRetryableError)(u))throw(0,c.transformError)(u);return O=u,[3,7];case 7:return g++,[2]}}))},R.label=1;case 1:return[5,_()];case 2:if("object"==typeof(T=R.sent()))return[2,T.value];R.label=3;case 3:if(g<=n.maxRetries)return[3,1];R.label=4;case 4:throw(0,c.transformError)(O)}}))}))}},1100:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.transformError=void 0;var r=o(3028);e.transformError=function(t){return t.isAxiosError?r.CommercetoolsError.fromAxiosError(t):t}},9291:(t,e)=>{var o;Object.defineProperty(e,"__esModule",{value:!0}),e.Region=void 0,(o=e.Region||(e.Region={})).NORTH_AMERICA_GCP="north_america_gcp",o.NORTH_AMERICA_AWS="north_america_aws",o.EUROPE_GCP="europe_gcp",o.EUROPE_AWS="europe_aws",o.AUSTRALIA_GCP="australia_gcp"},2519:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertAxiosError=void 0;var r=o(7271);e.convertAxiosError=function(t,e){var o,n,s,i,a,c,u,p,l,d;return"isAxiosError"in t?{request:{url:null!==(n=null===(o=t.config)||void 0===o?void 0:o.url)&&void 0!==n?n:"",method:null===(s=t.config)||void 0===s?void 0:s.method,params:null===(i=t.config)||void 0===i?void 0:i.params,headers:(0,r.extractAxiosHeaders)(null===(a=t.config)||void 0===a?void 0:a.headers),data:null===(c=t.config)||void 0===c?void 0:c.data},response:{code:t.code,message:(null===(u=t.response)||void 0===u?void 0:u.status)?void 0:t.message,status:null===(p=t.response)||void 0===p?void 0:p.status,headers:(0,r.extractAxiosHeaders)(null===(l=t.response)||void 0===l?void 0:l.headers),data:null===(d=t.response)||void 0===d?void 0:d.data},stats:e}:null}},4059:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertAxiosResponse=void 0;var r=o(7271);e.convertAxiosResponse=function(t,e){var o,n,s,i,a,c;return{request:{url:null!==(n=null===(o=t.config)||void 0===o?void 0:o.url)&&void 0!==n?n:"",method:null===(s=t.config)||void 0===s?void 0:s.method,params:null===(i=t.config)||void 0===i?void 0:i.params,headers:(0,r.extractAxiosHeaders)(null===(a=t.config)||void 0===a?void 0:a.headers),data:null===(c=t.config)||void 0===c?void 0:c.data},response:{status:t.status,headers:(0,r.extractAxiosHeaders)(t.headers),data:t.data},stats:e}}},4070:function(t,e,o){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createAxiosInstance=void 0,o(4060);var n=r(o(7218));e.createAxiosInstance=function(t){return n.default.create({httpsAgent:void 0})}},7271:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extractAxiosHeaders=void 0;var r=o(7218);e.extractAxiosHeaders=function(t){var e={};if(t instanceof r.AxiosHeaders){var o=t.toJSON();e={},Object.entries(o).forEach((function(t){var o=t[0],r=t[1],n=o.toLowerCase();"boolean"==typeof r||"number"==typeof r||"string"==typeof r?e[n]=r.toString():Array.isArray(r)&&(e[n]=r.join(", "))}))}return Object.keys(e).length?e:void 0}},4747:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(2519),e),n(o(4059),e),n(o(4070),e),n(o(7271),e)},3720:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.calculateDelay=void 0,e.calculateDelay=function(t,e){if(!e||0===t)return 0;var o=e.delayMs*Math.pow(2,t-1);if(e.jitter){var r=o*(1+1/(t+1));return Math.floor(Math.random()*r)}return o}},3930:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAsKey=void 0;var r=o(3028);e.formatAsKey=function(t){var e="";if("string"!=typeof t)throw new r.CommercetoolsError("The [input] parameter must be a string");if((e=(e=(e=(e=(e=(e=t.trim().toLowerCase()).replace(/ {2,}/g,"")).replace(/&/g,"and")).replace(/[ _]/g,"-")).replace(/[^0-9a-z-]+/g,"")).replace(/-{2,}/g,"-")).length&&"-"===e[0]&&(e=e.slice(1)),e.length&&"-"===e[e.length-1]&&(e=e.slice(0,-1)),e.length<2)throw new r.CommercetoolsError("Formatted key did not meet minimum length of 2 characters: ".concat(e));if(e.length>256)throw new r.CommercetoolsError("Formatted key exceeds the maximum length of 256 characters: ".concat(e));return e}},6640:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getAttributeValue=void 0,e.getAttributeValue=function(t){var e,o;if(null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.length){var r=null===(o=t.attributes)||void 0===o?void 0:o.find((function(e){return e.name===t.name}));if(r)return r.value}return null}},893:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(4747),e),n(o(3720),e),n(o(3930),e),n(o(6640),e),n(o(9998),e),n(o(9989),e),n(o(3190),e)},9998:function(t,e,o){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.maskSensitiveData=e.maskSensitiveHeaders=e.maskSensitiveInput=e.DEFAULT_MASKING_STRING=e.SENSITIVE_HEADER_NAMES=e.SENSITIVE_PROPERTY_NAMES=void 0;var n=r(o(3692)),s=o(7218),i=o(2003);function a(t,o,r){if(void 0===r&&(r=e.DEFAULT_MASKING_STRING),"object"==typeof t&&null!=t){var a;return a=t instanceof s.AxiosHeaders?(0,i.plainClone)(t.toJSON()):(0,i.plainClone)(t),(0,n.default)(a).forEach((function(){var t,e;o.includes(null!==(e=null===(t=this.key)||void 0===t?void 0:t.toLowerCase())&&void 0!==e?e:"")&&this.update(r)})),a}return t}e.SENSITIVE_PROPERTY_NAMES=["password","refresh_token"],e.SENSITIVE_HEADER_NAMES=["authorization"],e.DEFAULT_MASKING_STRING="********",e.maskSensitiveInput=function(t){return a(t,e.SENSITIVE_PROPERTY_NAMES)},e.maskSensitiveHeaders=function(t){return a(t,e.SENSITIVE_HEADER_NAMES)},e.maskSensitiveData=a},2003:(t,e)=>{function o(t,e){if(e&&t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&("object"==typeof t[r]?(Array.isArray(t[r])?e[r]=[]:e[r]={},e[r]=o(t[r],e[r])):e[r]=t[r]);return e}Object.defineProperty(e,"__esModule",{value:!0}),e.plainClone=void 0,e.plainClone=function(t){return o(t,{})}},9989:function(t,e,o){var r=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.retryOnConflict=void 0;var s=o(3720),i=o(8842);e.retryOnConflict=function(t){return r(this,void 0,void 0,(function(){var e,o,r,a,c,u;return n(this,(function(p){switch(p.label){case 0:e=(null==t?void 0:t.maxRetries)||3,o=(null==t?void 0:t.delayMs)||100,r=!!(null==t?void 0:t.jitter),a=function(a){var c,u,p;return n(this,(function(n){switch(n.label){case 0:return a>1?(c=(0,s.calculateDelay)(a-1,{delayMs:o,maxRetries:e,jitter:r}),[4,new Promise((function(t){return setTimeout(t,c)}))]):[3,2];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,4,,5]),u={},[4,t.executeFn(a)];case 3:return[2,(u.value=n.sent(),u)];case 4:if(!(p=n.sent()).isCommercetoolsError||p.status!==i.Status.Conflict||a===e)throw p;return[3,5];case 5:return[2]}}))},c=1,p.label=1;case 1:return c<=e?[5,a(c)]:[3,4];case 2:if("object"==typeof(u=p.sent()))return[2,u.value];p.label=3;case 3:return c++,[3,1];case 4:return[2,void 0]}}))}))}},3190:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.buildUserAgent=void 0;var r=o(4060);e.buildUserAgent=function(t){var e=r.USER_AGENT_PREFIX;return t&&(e="".concat(e," (").concat(t,")")),e}},8842:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reason=e.ErrorStatus=e.RedirectionStatus=e.SuccessStatus=e.InformationStatus=e.Status=void 0;var r=o(7536);Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return r.Status}}),Object.defineProperty(e,"InformationStatus",{enumerable:!0,get:function(){return r.InformationStatus}}),Object.defineProperty(e,"SuccessStatus",{enumerable:!0,get:function(){return r.SuccessStatus}}),Object.defineProperty(e,"RedirectionStatus",{enumerable:!0,get:function(){return r.RedirectionStatus}}),Object.defineProperty(e,"ErrorStatus",{enumerable:!0,get:function(){return r.ErrorStatus}});var n=o(7890);Object.defineProperty(e,"reason",{enumerable:!0,get:function(){return n.reason}})},7890:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reason=void 0;const r=o(7536);e.reason=function(t){switch(t){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(r.Status).find((e=>r.Status[e]===t))||"").replace(/(?!^)([A-Z])/gm," $1")}}},7536:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Status=e.ErrorStatus=e.RedirectionStatus=e.SuccessStatus=e.InformationStatus=void 0,e.InformationStatus={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103},e.SuccessStatus={Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226},e.RedirectionStatus={MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},e.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},e.Status=Object.assign(Object.assign(Object.assign(Object.assign({},e.InformationStatus),e.SuccessStatus),e.RedirectionStatus),e.ErrorStatus)},4530:(t,e)=>{function o(t,e){var o=[],r=[];return null==e&&(e=function(t,e){return o[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,o.indexOf(e)).join(".")+"]"}),function(n,s){if(o.length>0){var i=o.indexOf(this);~i?o.splice(i+1):o.push(this),~i?r.splice(i,1/0,n):r.push(n),~o.indexOf(s)&&(s=e.call(this,n,s))}else o.push(s);return null==t?s:t.call(this,n,s)}}(t.exports=function(t,e,r,n){return JSON.stringify(t,o(e,n),r)}).getSerialize=o},3692:t=>{function e(t){return Object.prototype.toString.call(t)}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function r(t,e){if(t.forEach)return t.forEach(e);for(var o=0;o<t.length;o++)e(t[o],o,t)}var n=Object.keys||function(t){var e=[];for(var o in t)e.push(o);return e},s=Object.prototype.hasOwnProperty||function(t,e){return e in t};function i(t){if("object"==typeof t&&null!==t){var s;if(o(t))s=[];else if("[object Date]"===e(t))s=new Date(t.getTime?t.getTime():t);else if("[object RegExp]"===e(t))s=new RegExp(t);else if(function(t){return"[object Error]"===e(t)}(t))s={message:t.message};else if(function(t){return"[object Boolean]"===e(t)}(t)||function(t){return"[object Number]"===e(t)}(t)||function(t){return"[object String]"===e(t)}(t))s=Object(t);else if(Object.create&&Object.getPrototypeOf)s=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)s={};else{var i=t.constructor&&t.constructor.prototype||t.__proto__||{},a=function(){};a.prototype=i,s=new a}return r(n(t),(function(e){s[e]=t[e]})),s}return t}function a(t,e,a){var c=[],u=[],p=!0;return function t(l){var d=a?i(l):l,h={},f=!0,m={node:d,node_:l,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(t,e){m.isRoot||(m.parent.node[m.key]=t),m.node=t,e&&(f=!1)},delete:function(t){delete m.parent.node[m.key],t&&(f=!1)},remove:function(t){o(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],t&&(f=!1)},keys:null,before:function(t){h.before=t},after:function(t){h.after=t},pre:function(t){h.pre=t},post:function(t){h.post=t},stop:function(){p=!1},block:function(){f=!1}};if(!p)return m;function y(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=n(m.node)),m.isLeaf=0===m.keys.length;for(var t=0;t<u.length;t++)if(u[t].node_===l){m.circular=u[t];break}}else m.isLeaf=!0,m.keys=null;m.notLeaf=!m.isLeaf,m.notRoot=!m.isRoot}y();var v=e.call(m,m.node);return void 0!==v&&m.update&&m.update(v),h.before&&h.before.call(m,m.node),f?("object"!=typeof m.node||null===m.node||m.circular||(u.push(m),y(),r(m.keys,(function(e,o){c.push(e),h.pre&&h.pre.call(m,m.node[e],e);var r=t(m.node[e]);a&&s.call(m.node,e)&&(m.node[e]=r.node),r.isLast=o===m.keys.length-1,r.isFirst=0===o,h.post&&h.post.call(m,r),c.pop()})),u.pop()),h.after&&h.after.call(m,m.node),m):m}(t).node}function c(t){this.value=t}function u(t){return new c(t)}c.prototype.get=function(t){for(var e=this.value,o=0;o<t.length;o++){var r=t[o];if(!e||!s.call(e,r))return;e=e[r]}return e},c.prototype.has=function(t){for(var e=this.value,o=0;o<t.length;o++){var r=t[o];if(!e||!s.call(e,r))return!1;e=e[r]}return!0},c.prototype.set=function(t,e){for(var o=this.value,r=0;r<t.length-1;r++){var n=t[r];s.call(o,n)||(o[n]={}),o=o[n]}return o[t[r]]=e,e},c.prototype.map=function(t){return a(this.value,t,!0)},c.prototype.forEach=function(t){return this.value=a(this.value,t,!1),this.value},c.prototype.reduce=function(t,e){var o=1===arguments.length,r=o?this.value:e;return this.forEach((function(e){this.isRoot&&o||(r=t.call(this,r,e))})),r},c.prototype.paths=function(){var t=[];return this.forEach((function(){t.push(this.path)})),t},c.prototype.nodes=function(){var t=[];return this.forEach((function(){t.push(this.node)})),t},c.prototype.clone=function(){var t=[],e=[];return function o(s){for(var a=0;a<t.length;a++)if(t[a]===s)return e[a];if("object"==typeof s&&null!==s){var c=i(s);return t.push(s),e.push(c),r(n(s),(function(t){c[t]=o(s[t])})),t.pop(),e.pop(),c}return s}(this.value)},r(n(c.prototype),(function(t){u[t]=function(e){var o=[].slice.call(arguments,1),r=new c(e);return r[t].apply(r,o)}})),t.exports=u},7218:(t,e,o)=>{function r(t,e){return function(){return t.apply(e,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:s}=Object,i=(a=Object.create(null),t=>{const e=n.call(t);return a[e]||(a[e]=e.slice(8,-1).toLowerCase())});var a;const c=t=>(t=t.toLowerCase(),e=>i(e)===t),u=t=>e=>typeof e===t,{isArray:p}=Array,l=u("undefined"),d=c("ArrayBuffer"),h=u("string"),f=u("function"),m=u("number"),y=t=>null!==t&&"object"==typeof t,v=t=>{if("object"!==i(t))return!1;const e=s(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},g=c("Date"),O=c("File"),b=c("Blob"),E=c("FileList"),S=c("URLSearchParams");function _(t,e,{allOwnKeys:o=!1}={}){if(null==t)return;let r,n;if("object"!=typeof t&&(t=[t]),p(t))for(r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else{const n=o?Object.getOwnPropertyNames(t):Object.keys(t),s=n.length;let i;for(r=0;r<s;r++)i=n[r],e.call(null,t[i],i,t)}}function T(t,e){e=e.toLowerCase();const o=Object.keys(t);let r,n=o.length;for(;n-- >0;)if(r=o[n],e===r.toLowerCase())return r;return null}const R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:o.g,C=t=>!l(t)&&t!==R,w=(q="undefined"!=typeof Uint8Array&&s(Uint8Array),t=>q&&t instanceof q);var q;const P=c("HTMLFormElement"),x=(({hasOwnProperty:t})=>(e,o)=>t.call(e,o))(Object.prototype),A=c("RegExp"),j=(t,e)=>{const o=Object.getOwnPropertyDescriptors(t),r={};_(o,((o,n)=>{!1!==e(o,n,t)&&(r[n]=o)})),Object.defineProperties(t,r)},k="abcdefghijklmnopqrstuvwxyz",M="0123456789",I={DIGIT:M,ALPHA:k,ALPHA_DIGIT:k+k.toUpperCase()+M};var B={isArray:p,isArrayBuffer:d,isBuffer:function(t){return null!==t&&!l(t)&&null!==t.constructor&&!l(t.constructor)&&f(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{const e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||n.call(t)===e||f(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&d(t.buffer),e},isString:h,isNumber:m,isBoolean:t=>!0===t||!1===t,isObject:y,isPlainObject:v,isUndefined:l,isDate:g,isFile:O,isBlob:b,isRegExp:A,isFunction:f,isStream:t=>y(t)&&f(t.pipe),isURLSearchParams:S,isTypedArray:w,isFileList:E,forEach:_,merge:function t(){const{caseless:e}=C(this)&&this||{},o={},r=(r,n)=>{const s=e&&T(o,n)||n;v(o[s])&&v(r)?o[s]=t(o[s],r):v(r)?o[s]=t({},r):p(r)?o[s]=r.slice():o[s]=r};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&_(arguments[t],r);return o},extend:(t,e,o,{allOwnKeys:n}={})=>(_(e,((e,n)=>{o&&f(e)?t[n]=r(e,o):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,o,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),o&&Object.assign(t.prototype,o)},toFlatObject:(t,e,o,r)=>{let n,i,a;const c={};if(e=e||{},null==t)return e;do{for(n=Object.getOwnPropertyNames(t),i=n.length;i-- >0;)a=n[i],r&&!r(a,t,e)||c[a]||(e[a]=t[a],c[a]=!0);t=!1!==o&&s(t)}while(t&&(!o||o(t,e))&&t!==Object.prototype);return e},kindOf:i,kindOfTest:c,endsWith:(t,e,o)=>{t=String(t),(void 0===o||o>t.length)&&(o=t.length),o-=e.length;const r=t.indexOf(e,o);return-1!==r&&r===o},toArray:t=>{if(!t)return null;if(p(t))return t;let e=t.length;if(!m(e))return null;const o=new Array(e);for(;e-- >0;)o[e]=t[e];return o},forEachEntry:(t,e)=>{const o=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=o.next())&&!r.done;){const o=r.value;e.call(t,o[0],o[1])}},matchAll:(t,e)=>{let o;const r=[];for(;null!==(o=t.exec(e));)r.push(o);return r},isHTMLForm:P,hasOwnProperty:x,hasOwnProp:x,reduceDescriptors:j,freezeMethods:t=>{j(t,((e,o)=>{if(f(t)&&-1!==["arguments","caller","callee"].indexOf(o))return!1;const r=t[o];f(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")}))}))},toObjectSet:(t,e)=>{const o={},r=t=>{t.forEach((t=>{o[t]=!0}))};return p(t)?r(t):r(String(t).split(e)),o},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,o){return e.toUpperCase()+o})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:T,global:R,isContextDefined:C,ALPHABET:I,generateString:(t=16,e=I.ALPHA_DIGIT)=>{let o="";const{length:r}=e;for(;t--;)o+=e[Math.random()*r|0];return o},isSpecCompliantForm:function(t){return!!(t&&f(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),o=(t,r)=>{if(y(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const n=p(t)?[]:{};return _(t,((t,e)=>{const s=o(t,r+1);!l(s)&&(n[e]=s)})),e[r]=void 0,n}}return t};return o(t,0)}};function N(t,e,o,r,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),o&&(this.config=o),r&&(this.request=r),n&&(this.response=n)}B.inherits(N,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:B.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const G=N.prototype,D={};function L(t){return B.isPlainObject(t)||B.isArray(t)}function U(t){return B.endsWith(t,"[]")?t.slice(0,-2):t}function K(t,e,o){return t?t.concat(e).map((function(t,e){return t=U(t),!o&&e?"["+t+"]":t})).join(o?".":""):e}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{D[t]={value:t}})),Object.defineProperties(N,D),Object.defineProperty(G,"isAxiosError",{value:!0}),N.from=(t,e,o,r,n,s)=>{const i=Object.create(G);return B.toFlatObject(t,i,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),N.call(i,t.message,e,o,r,n),i.cause=t,i.name=t.name,s&&Object.assign(i,s),i};const F=B.toFlatObject(B,{},null,(function(t){return/^is[A-Z]/.test(t)}));function H(t,e,o){if(!B.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(o=B.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!B.isUndefined(e[t])}))).metaTokens,n=o.visitor||u,s=o.dots,i=o.indexes,a=(o.Blob||"undefined"!=typeof Blob&&Blob)&&B.isSpecCompliantForm(e);if(!B.isFunction(n))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(B.isDate(t))return t.toISOString();if(!a&&B.isBlob(t))throw new N("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(t)||B.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,o,n){let a=t;if(t&&!n&&"object"==typeof t)if(B.endsWith(o,"{}"))o=r?o:o.slice(0,-2),t=JSON.stringify(t);else if(B.isArray(t)&&function(t){return B.isArray(t)&&!t.some(L)}(t)||(B.isFileList(t)||B.endsWith(o,"[]"))&&(a=B.toArray(t)))return o=U(o),a.forEach((function(t,r){!B.isUndefined(t)&&null!==t&&e.append(!0===i?K([o],r,s):null===i?o:o+"[]",c(t))})),!1;return!!L(t)||(e.append(K(n,o,s),c(t)),!1)}const p=[],l=Object.assign(F,{defaultVisitor:u,convertValue:c,isVisitable:L});if(!B.isObject(t))throw new TypeError("data must be an object");return function t(o,r){if(!B.isUndefined(o)){if(-1!==p.indexOf(o))throw Error("Circular reference detected in "+r.join("."));p.push(o),B.forEach(o,(function(o,s){!0===(!(B.isUndefined(o)||null===o)&&n.call(e,o,B.isString(s)?s.trim():s,r,l))&&t(o,r?r.concat(s):[s])})),p.pop()}}(t),e}function V(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function z(t,e){this._pairs=[],t&&H(t,this,e)}const J=z.prototype;function W(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function X(t,e,o){if(!e)return t;const r=o&&o.encode||W,n=o&&o.serialize;let s;if(s=n?n(e,o):B.isURLSearchParams(e)?e.toString():new z(e,o).toString(r),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}J.append=function(t,e){this._pairs.push([t,e])},J.toString=function(t){const e=t?function(e){return t.call(this,e,V)}:V;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var Y=class{constructor(){this.handlers=[]}use(t,e,o){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){B.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Q={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:z,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function Z(t){function e(t,o,r,n){let s=t[n++];const i=Number.isFinite(+s),a=n>=t.length;return s=!s&&B.isArray(r)?r.length:s,a?(B.hasOwnProp(r,s)?r[s]=[r[s],o]:r[s]=o,!i):(r[s]&&B.isObject(r[s])||(r[s]=[]),e(t,o,r[s],n)&&B.isArray(r[s])&&(r[s]=function(t){const e={},o=Object.keys(t);let r;const n=o.length;let s;for(r=0;r<n;r++)s=o[r],e[s]=t[s];return e}(r[s])),!i)}if(B.isFormData(t)&&B.isFunction(t.entries)){const o={};return B.forEachEntry(t,((t,r)=>{e(function(t){return B.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,o,0)})),o}return null}const tt={"Content-Type":void 0},et={transitional:Q,adapter:["xhr","http"],transformRequest:[function(t,e){const o=e.getContentType()||"",r=o.indexOf("application/json")>-1,n=B.isObject(t);if(n&&B.isHTMLForm(t)&&(t=new FormData(t)),B.isFormData(t))return r&&r?JSON.stringify(Z(t)):t;if(B.isArrayBuffer(t)||B.isBuffer(t)||B.isStream(t)||B.isFile(t)||B.isBlob(t))return t;if(B.isArrayBufferView(t))return t.buffer;if(B.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(n){if(o.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return H(t,new $.classes.URLSearchParams,Object.assign({visitor:function(t,e,o,r){return $.isNode&&B.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((s=B.isFileList(t))||o.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return H(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return n||r?(e.setContentType("application/json",!1),function(t,e,o){if(B.isString(t))try{return(0,JSON.parse)(t),B.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||et.transitional,o=e&&e.forcedJSONParsing,r="json"===this.responseType;if(t&&B.isString(t)&&(o&&!this.responseType||r)){const o=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(o){if("SyntaxError"===t.name)throw N.from(t,N.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$.classes.FormData,Blob:$.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};B.forEach(["delete","get","head"],(function(t){et.headers[t]={}})),B.forEach(["post","put","patch"],(function(t){et.headers[t]=B.merge(tt)}));var ot=et;const rt=B.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"]),nt=Symbol("internals");function st(t){return t&&String(t).trim().toLowerCase()}function it(t){return!1===t||null==t?t:B.isArray(t)?t.map(it):String(t)}function at(t,e,o,r,n){return B.isFunction(r)?r.call(this,e,o):(n&&(e=o),B.isString(e)?B.isString(r)?-1!==e.indexOf(r):B.isRegExp(r)?r.test(e):void 0:void 0)}class ct{constructor(t){t&&this.set(t)}set(t,e,o){const r=this;function n(t,e,o){const n=st(e);if(!n)throw new Error("header name must be a non-empty string");const s=B.findKey(r,n);(!s||void 0===r[s]||!0===o||void 0===o&&!1!==r[s])&&(r[s||e]=it(t))}const s=(t,e)=>B.forEach(t,((t,o)=>n(t,o,e)));return B.isPlainObject(t)||t instanceof this.constructor?s(t,e):B.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z]+$/.test(t.trim())?s((t=>{const e={};let o,r,n;return t&&t.split("\n").forEach((function(t){n=t.indexOf(":"),o=t.substring(0,n).trim().toLowerCase(),r=t.substring(n+1).trim(),!o||e[o]&&rt[o]||("set-cookie"===o?e[o]?e[o].push(r):e[o]=[r]:e[o]=e[o]?e[o]+", "+r:r)})),e})(t),e):null!=t&&n(e,t,o),this}get(t,e){if(t=st(t)){const o=B.findKey(this,t);if(o){const t=this[o];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=o.exec(t);)e[r[1]]=r[2];return e}(t);if(B.isFunction(e))return e.call(this,t,o);if(B.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=st(t)){const o=B.findKey(this,t);return!(!o||void 0===this[o]||e&&!at(0,this[o],o,e))}return!1}delete(t,e){const o=this;let r=!1;function n(t){if(t=st(t)){const n=B.findKey(o,t);!n||e&&!at(0,o[n],n,e)||(delete o[n],r=!0)}}return B.isArray(t)?t.forEach(n):n(t),r}clear(t){const e=Object.keys(this);let o=e.length,r=!1;for(;o--;){const n=e[o];t&&!at(0,this[n],n,t,!0)||(delete this[n],r=!0)}return r}normalize(t){const e=this,o={};return B.forEach(this,((r,n)=>{const s=B.findKey(o,n);if(s)return e[s]=it(r),void delete e[n];const i=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,o)=>e.toUpperCase()+o))}(n):String(n).trim();i!==n&&delete e[n],e[i]=it(r),o[i]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return B.forEach(this,((o,r)=>{null!=o&&!1!==o&&(e[r]=t&&B.isArray(o)?o.join(", "):o)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const o=new this(t);return e.forEach((t=>o.set(t))),o}static accessor(t){const e=(this[nt]=this[nt]={accessors:{}}).accessors,o=this.prototype;function r(t){const r=st(t);e[r]||(function(t,e){const o=B.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+o,{value:function(t,o,n){return this[r].call(this,e,t,o,n)},configurable:!0})}))}(o,t),e[r]=!0)}return B.isArray(t)?t.forEach(r):r(t),this}}ct.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),B.freezeMethods(ct.prototype),B.freezeMethods(ct);var ut=ct;function pt(t,e){const o=this||ot,r=e||o,n=ut.from(r.headers);let s=r.data;return B.forEach(t,(function(t){s=t.call(o,s,n.normalize(),e?e.status:void 0)})),n.normalize(),s}function lt(t){return!(!t||!t.__CANCEL__)}function dt(t,e,o){N.call(this,null==t?"canceled":t,N.ERR_CANCELED,e,o),this.name="CanceledError"}B.inherits(dt,N,{__CANCEL__:!0});var ht=$.isStandardBrowserEnv?{write:function(t,e,o,r,n,s){const i=[];i.push(t+"="+encodeURIComponent(e)),B.isNumber(o)&&i.push("expires="+new Date(o).toGMTString()),B.isString(r)&&i.push("path="+r),B.isString(n)&&i.push("domain="+n),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function ft(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}var mt=$.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let o;function r(o){let r=o;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return o=r(window.location.href),function(t){const e=B.isString(t)?r(t):t;return e.protocol===o.protocol&&e.host===o.host}}():function(){return!0};function yt(t,e){let o=0;const r=function(t,e){t=t||10;const o=new Array(t),r=new Array(t);let n,s=0,i=0;return e=void 0!==e?e:1e3,function(a){const c=Date.now(),u=r[i];n||(n=c),o[s]=a,r[s]=c;let p=i,l=0;for(;p!==s;)l+=o[p++],p%=t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),c-n<e)return;const d=u&&c-u;return d?Math.round(1e3*l/d):void 0}}(50,250);return n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-o,c=r(a);o=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n};u[e?"download":"upload"]=!0,t(u)}}const vt={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,o){let r=t.data;const n=ut.from(t.headers).normalize(),s=t.responseType;let i;function a(){t.cancelToken&&t.cancelToken.unsubscribe(i),t.signal&&t.signal.removeEventListener("abort",i)}B.isFormData(r)&&($.isStandardBrowserEnv||$.isStandardBrowserWebWorkerEnv)&&n.setContentType(!1);let c=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",o=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";n.set("Authorization","Basic "+btoa(e+":"+o))}const u=ft(t.baseURL,t.url);function p(){if(!c)return;const r=ut.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(t,e,o){const r=o.config.validateStatus;o.status&&r&&!r(o.status)?e(new N("Request failed with status code "+o.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o)):t(o)}((function(t){e(t),a()}),(function(t){o(t),a()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:t,request:c}),c=null}if(c.open(t.method.toUpperCase(),X(u,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=p:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(p)},c.onabort=function(){c&&(o(new N("Request aborted",N.ECONNABORTED,t,c)),c=null)},c.onerror=function(){o(new N("Network Error",N.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const r=t.transitional||Q;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),o(new N(e,r.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,t,c)),c=null},$.isStandardBrowserEnv){const e=(t.withCredentials||mt(u))&&t.xsrfCookieName&&ht.read(t.xsrfCookieName);e&&n.set(t.xsrfHeaderName,e)}void 0===r&&n.setContentType(null),"setRequestHeader"in c&&B.forEach(n.toJSON(),(function(t,e){c.setRequestHeader(e,t)})),B.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&"json"!==s&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",yt(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",yt(t.onUploadProgress)),(t.cancelToken||t.signal)&&(i=e=>{c&&(o(!e||e.type?new dt(null,t,c):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(i),t.signal&&(t.signal.aborted?i():t.signal.addEventListener("abort",i)));const l=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(u);l&&-1===$.protocols.indexOf(l)?o(new N("Unsupported protocol "+l+":",N.ERR_BAD_REQUEST,t)):c.send(r||null)}))}};B.forEach(vt,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));function gt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new dt(null,t)}function Ot(t){return gt(t),t.headers=ut.from(t.headers),t.data=pt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),(t=>{t=B.isArray(t)?t:[t];const{length:e}=t;let o,r;for(let n=0;n<e&&(o=t[n],!(r=B.isString(o)?vt[o.toLowerCase()]:o));n++);if(!r){if(!1===r)throw new N(`Adapter ${o} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(B.hasOwnProp(vt,o)?`Adapter '${o}' is not available in the build`:`Unknown adapter '${o}'`)}if(!B.isFunction(r))throw new TypeError("adapter is not a function");return r})(t.adapter||ot.adapter)(t).then((function(e){return gt(t),e.data=pt.call(t,t.transformResponse,e),e.headers=ut.from(e.headers),e}),(function(e){return lt(e)||(gt(t),e&&e.response&&(e.response.data=pt.call(t,t.transformResponse,e.response),e.response.headers=ut.from(e.response.headers))),Promise.reject(e)}))}const bt=t=>t instanceof ut?t.toJSON():t;function Et(t,e){e=e||{};const o={};function r(t,e,o){return B.isPlainObject(t)&&B.isPlainObject(e)?B.merge.call({caseless:o},t,e):B.isPlainObject(e)?B.merge({},e):B.isArray(e)?e.slice():e}function n(t,e,o){return B.isUndefined(e)?B.isUndefined(t)?void 0:r(void 0,t,o):r(t,e,o)}function s(t,e){if(!B.isUndefined(e))return r(void 0,e)}function i(t,e){return B.isUndefined(e)?B.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(o,n,s){return s in e?r(o,n):s in t?r(void 0,o):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(t,e)=>n(bt(t),bt(e),!0)};return B.forEach(Object.keys(t).concat(Object.keys(e)),(function(r){const s=c[r]||n,i=s(t[r],e[r],r);B.isUndefined(i)&&s!==a||(o[r]=i)})),o}const St={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{St[t]=function(o){return typeof o===t||"a"+(e<1?"n ":" ")+t}}));const _t={};St.transitional=function(t,e,o){function r(t,e){return"[Axios v1.3.4] Transitional option '"+t+"'"+e+(o?". "+o:"")}return(o,n,s)=>{if(!1===t)throw new N(r(n," has been removed"+(e?" in "+e:"")),N.ERR_DEPRECATED);return e&&!_t[n]&&(_t[n]=!0,console.warn(r(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(o,n,s)}};var Tt={assertOptions:function(t,e,o){if("object"!=typeof t)throw new N("options must be an object",N.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let n=r.length;for(;n-- >0;){const s=r[n],i=e[s];if(i){const e=t[s],o=void 0===e||i(e,s,t);if(!0!==o)throw new N("option "+s+" must be "+o,N.ERR_BAD_OPTION_VALUE)}else if(!0!==o)throw new N("Unknown option "+s,N.ERR_BAD_OPTION)}},validators:St};const Rt=Tt.validators;class Ct{constructor(t){this.defaults=t,this.interceptors={request:new Y,response:new Y}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Et(this.defaults,e);const{transitional:o,paramsSerializer:r,headers:n}=e;let s;void 0!==o&&Tt.assertOptions(o,{silentJSONParsing:Rt.transitional(Rt.boolean),forcedJSONParsing:Rt.transitional(Rt.boolean),clarifyTimeoutError:Rt.transitional(Rt.boolean)},!1),void 0!==r&&Tt.assertOptions(r,{encode:Rt.function,serialize:Rt.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase(),s=n&&B.merge(n.common,n[e.method]),s&&B.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete n[t]})),e.headers=ut.concat(s,n);const i=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,i.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let p,l=0;if(!a){const t=[Ot.bind(this),void 0];for(t.unshift.apply(t,i),t.push.apply(t,c),p=t.length,u=Promise.resolve(e);l<p;)u=u.then(t[l++],t[l++]);return u}p=i.length;let d=e;for(l=0;l<p;){const t=i[l++],e=i[l++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=Ot.call(this,d)}catch(t){return Promise.reject(t)}for(l=0,p=c.length;l<p;)u=u.then(c[l++],c[l++]);return u}getUri(t){return X(ft((t=Et(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}B.forEach(["delete","get","head","options"],(function(t){Ct.prototype[t]=function(e,o){return this.request(Et(o||{},{method:t,url:e,data:(o||{}).data}))}})),B.forEach(["post","put","patch"],(function(t){function e(e){return function(o,r,n){return this.request(Et(n||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}Ct.prototype[t]=e(),Ct.prototype[t+"Form"]=e(!0)}));var wt=Ct;class qt{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const o=this;this.promise.then((t=>{if(!o._listeners)return;let e=o._listeners.length;for(;e-- >0;)o._listeners[e](t);o._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{o.subscribe(t),e=t})).then(t);return r.cancel=function(){o.unsubscribe(e)},r},t((function(t,r,n){o.reason||(o.reason=new dt(t,r,n),e(o.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new qt((function(e){t=e})),cancel:t}}}var Pt=qt;const xt={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(xt).forEach((([t,e])=>{xt[e]=t}));var At=xt;const jt=function t(e){const o=new wt(e),n=r(wt.prototype.request,o);return B.extend(n,wt.prototype,o,{allOwnKeys:!0}),B.extend(n,o,null,{allOwnKeys:!0}),n.create=function(o){return t(Et(e,o))},n}(ot);jt.Axios=wt,jt.CanceledError=dt,jt.CancelToken=Pt,jt.isCancel=lt,jt.VERSION="1.3.4",jt.toFormData=H,jt.AxiosError=N,jt.Cancel=jt.CanceledError,jt.all=function(t){return Promise.all(t)},jt.spread=function(t){return function(e){return t.apply(null,e)}},jt.isAxiosError=function(t){return B.isObject(t)&&!0===t.isAxiosError},jt.mergeConfig=Et,jt.AxiosHeaders=ut,jt.formToJSON=t=>Z(B.isHTMLForm(t)?new FormData(t):t),jt.HttpStatusCode=At,jt.default=jt,t.exports=jt}},e={};function o(r){var n=e[r];if(void 0!==n)return n.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,o),s.exports}o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var r=o(2915),n=exports;for(var s in r)n[s]=r[s];r.__esModule&&Object.defineProperty(n,"__esModule",{value:!0});
2
2
  //# sourceMappingURL=ge-commercetools-utils-browser.cjs.js.map