Socket
Socket
Sign inDemoInstall

@spree/storefront-api-v2-sdk

Package Overview
Dependencies
Maintainers
4
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spree/storefront-api-v2-sdk - npm Package Compare versions

Comparing version 5.1.2 to 5.1.3

2

dist/client/index.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SpreeSDK=t():e.SpreeSDK=t()}(self,(function(){return(()=>{"use strict";var e={390:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=o(919);t.default=class{constructor(e){const t={host:globalThis.process&&globalThis.process.env.SPREE_HOST||"http://localhost:3000/"},o=Object.assign(Object.assign({},t),e),n={host:o.host};this.fetcher=o.createFetcher(n),this.addEndpoints()}addEndpoints(){this.account=this.makeAccount(),this.authentication=this.makeAuthentication(),this.cart=this.makeCart(),this.checkout=this.makeCheckout(),this.countries=this.makeCountries(),this.digitalAssets=this.makeDigitalAssets(),this.menus=this.makeMenus(),this.order=this.makeOrder(),this.pages=this.makePages(),this.products=this.makeProducts(),this.taxons=this.makeTaxons(),this.vendors=this.makeVendors(),this.wishlists=this.makeWishlists()}makeAccount(){return new n.Account({fetcher:this.fetcher})}makeAuthentication(){return new n.Authentication({fetcher:this.fetcher})}makeCart(){return new n.Cart({fetcher:this.fetcher})}makeCheckout(){return new n.Checkout({fetcher:this.fetcher})}makeCountries(){return new n.Countries({fetcher:this.fetcher})}makeOrder(){return new n.Order({fetcher:this.fetcher})}makePages(){return new n.Pages({fetcher:this.fetcher})}makeProducts(){return new n.Products({fetcher:this.fetcher})}makeTaxons(){return new n.Taxons({fetcher:this.fetcher})}makeDigitalAssets(){return new n.DigitalAssets({fetcher:this.fetcher})}makeMenus(){return new n.Menus({fetcher:this.fetcher})}makeVendors(){return new n.Vendors({fetcher:this.fetcher})}makeWishlists(){return new n.Wishlists({fetcher:this.fetcher})}}},759:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(844),c=a(o(306)),d=s(o(614));t.default=class{constructor({fetcher:e}){this.fetcher=e}spreeResponse(e,t,o={},n={},r="automatic"){return i(this,void 0,void 0,(function*(){try{const s=this.spreeOrderHeaders(o),i={url:t,params:n,method:e,headers:s,responseParsing:r},a=yield this.fetcher.fetch(i);return d.makeSuccess(a.data)}catch(e){return d.makeFail(this.processError(e))}}))}classifySpreeError(e){const{error:t,errors:o}=e.data;return"string"==typeof t?"object"==typeof o?"full":"basic":"limited"}processError(e){return e instanceof c.default?e.response?this.processSpreeError(e):e.request?new u.NoResponseError:new u.MisconfigurationError(e.message):new u.SpreeSDKError(e.message)}processSpreeError(e){const{error:t,errors:o}=e.data,n=this.classifySpreeError(e);return"full"===n?new u.ExpandedSpreeError(e.response,t,o):"basic"===n?new u.BasicSpreeError(e.response,t):new u.SpreeError(e.response)}spreeOrderHeaders(e){const t={};return e.orderToken&&(t["X-Spree-Order-Token"]=e.orderToken),e.bearerToken&&(t.Authorization=`Bearer ${e.bearerToken}`),t}}},993:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{accountInfo(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.accountPath(),n,r)}))}creditCardsList(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.accountCreditCardsPath(),n,r)}))}defaultCreditCard(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.accountDefaultCreditCardPath(),n,r)}))}removeCreditCard(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{id:r,token:i,params:u}=(0,s.default)([{id:o},t,n],["id"]);return yield this.spreeResponse("delete",a.default.accountCreditCardRemovePath(r),i,u)}))}completedOrdersList(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.accountCompletedOrdersPath(),n,r)}))}completedOrder(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{order_number:r,token:i,params:u}=(0,s.default)([{order_number:o},t,n],["order_number"]);return yield this.spreeResponse("get",a.default.accountCompletedOrderPath(r),i,u)}))}create(...e){return n(this,void 0,void 0,(function*(){const[t={}]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("post",a.default.accountPath(),o,n)}))}confirm(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{confirmation_token:o,token:n,params:r}=(0,s.default)(["object"==typeof t?t:{confirmation_token:t}],["confirmation_token"]);return yield this.spreeResponse("get",a.default.accountConfirmPath(o),n,r)}))}forgotPassword(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("post",a.default.forgotPasswordPath(),o,n)}))}resetPassword(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{reset_password_token:n,token:r,params:i}=(0,s.default)(["object"==typeof t?t:{resetPasswordToken:t},o],["reset_password_token"]);return yield this.spreeResponse("patch",a.default.resetPasswordPath(n),r,i)}))}update(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("patch",a.default.accountPath(),n,r)}))}addressesList(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("get",a.default.accountAddressesPath(),o,n)}))}showAddress(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{id:r,token:i,params:u}=(0,s.default)([{id:o},t,n],["id"]);return yield this.spreeResponse("get",a.default.accountAddressPath(r),i,u)}))}createAddress(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("post",a.default.accountAddressesPath(),n,r)}))}removeAddress(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{id:r,token:i,params:u}=(0,s.default)([{id:o},t,n],["id"]);return yield this.spreeResponse("delete",a.default.accountAddressRemovePath(r),i,u)}))}updateAddress(...e){return n(this,void 0,void 0,(function*(){const[t,o,n]=e,{id:r,token:i,params:u}=(0,s.default)([{id:o},t,n],["id"]);return yield this.spreeResponse("patch",a.default.accountAddressPath(r),i,u)}))}}t.default=u},464:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(339),i=r(o(759)),a=r(o(319)),u=r(o(185));class c extends i.default{getToken(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,u.default)([t],[]);return yield this.spreeResponse("post",a.default.oauthTokenPath(),o,(0,s.authParams)(n))}))}refreshToken(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,u.default)([t],[]);return yield this.spreeResponse("post",a.default.oauthTokenPath(),o,(0,s.refreshParams)(n))}))}revokeToken(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,u.default)([t],[]);return yield this.spreeResponse("post",a.default.oauthRevokePath(),o,(0,s.revokeParams)(n))}))}}t.default=c},712:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(759)),i=r(o(319)),a=r(o(185));class u extends s.default{show(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("get",i.default.cartPath(),n,r)}))}create(...e){return n(this,void 0,void 0,(function*(){const[t={},o={}]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("post",i.default.cartPath(),n,r)}))}addItem(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("post",i.default.cartAddItemPath(),n,r)}))}removeItem(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{id:r,token:s,params:u}=(0,a.default)([{id:o},t,n],["id"]);return yield this.spreeResponse("delete",i.default.cartRemoveItemPath(r),s,u)}))}emptyCart(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("patch",i.default.cartEmptyPath(),n,r)}))}remove(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,a.default)([t],[]);return yield this.spreeResponse("delete",i.default.cartPath(),o,n)}))}setQuantity(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("patch",i.default.cartSetItemQuantity(),n,r)}))}applyCouponCode(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("patch",i.default.cartApplyCodePath(),n,r)}))}removeCouponCode(...e){return n(this,void 0,void 0,(function*(){const[t,o=null,n={}]=e,{code:r,token:s,params:u}=(0,a.default)([{code:o},t,n],["code"]);let c;return c=r?i.default.cartRemoveCodePath(r):i.default.cartRemoveAllCoupons(),yield this.spreeResponse("delete",c,s,u)}))}removeAllCoupons(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("delete",i.default.cartRemoveAllCoupons(),n,r)}))}estimateShippingMethods(e,t){return n(this,void 0,void 0,(function*(){return yield this.spreeResponse("get",i.default.cartEstimateShippingMethodsPath(),e,t)}))}estimateShippingRates(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("get",i.default.cartEstimateShippingRatesPath(),n,r)}))}associateGuestCart(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("patch",i.default.cartAssociatePath(),n,r)}))}changeCurrency(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("patch",i.default.cartChangeCurrencyPath(),n,r)}))}}t.default=u},846:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759));o(159);const a=r(o(319));class u extends i.default{orderNext(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("patch",a.default.checkoutNextPath(),n,r)}))}orderUpdate(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("patch",a.default.checkoutPath(),n,r)}))}advance(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("patch",a.default.checkoutAdvancePath(),n,r)}))}complete(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("patch",a.default.checkoutCompletePath(),n,r)}))}addStoreCredits(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("post",a.default.checkoutAddStoreCreditsPath(),n,r)}))}removeStoreCredits(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("post",a.default.checkoutRemoveStoreCreditsPath(),n,r)}))}paymentMethods(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("get",a.default.checkoutPaymentMethodsPath(),o,n)}))}shippingMethods(e,t={}){return n(this,void 0,void 0,(function*(){return yield this.spreeResponse("get",a.default.checkoutShippingMethodsPath(),e,t)}))}shippingRates(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.checkoutShippingRatesPath(),n,r)}))}selectShippingMethod(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("patch",a.default.checkoutSelectShippingMethodPath(),n,r)}))}addPayment(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("post",a.default.checkoutAddPaymentPath(),n,r)}))}createStripeSession(e){return n(this,void 0,void 0,(function*(){const{token:t,params:o}=(0,s.default)([e],[]);return yield this.spreeResponse("patch",a.default.checkoutCreateStripeSessionPath(),t,o)}))}}t.default=u},898:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(e){return n(this,void 0,void 0,(function*(){const{token:t,params:o}=(0,s.default)([e||{}],[]);return yield this.spreeResponse("get",a.default.countriesPath(),t,o)}))}show(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{iso:n,token:r,params:i}=(0,s.default)(["object"==typeof t?t:{iso:t},o],["iso"]);return yield this.spreeResponse("get",a.default.countryPath(n),r,i)}))}default(...e){return n(this,void 0,void 0,(function*(){const[t={}]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("get",a.default.defaultCountryPath(),o,n)}))}}t.default=u},847:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(759)),i=r(o(319)),a=r(o(185));class u extends s.default{download(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{asset_token:r,token:s,params:u}=(0,a.default)([t,{asset_token:o},n],["asset_token"]);return yield this.spreeResponse("get",i.default.digitalAssetsDownloadPath(r),s,u,"stream")}))}}t.default=u},999:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(...e){return n(this,void 0,void 0,(function*(){const[t={}]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("get",a.default.menusPath(),o,n)}))}show(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{id:n,token:r,params:i}=(0,s.default)(["object"==typeof t?t:{id:t},o],["id"]);return yield this.spreeResponse("get",a.default.menuPath(n),r,i)}))}}t.default=u},298:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{status(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{order_number:r,token:i,params:u}=(0,s.default)([t,{order_number:o},n],["order_number"]);return yield this.spreeResponse("get",a.default.orderStatusPath(r),i,u)}))}}t.default=u},995:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(...e){return n(this,void 0,void 0,(function*(){const[t={}]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("get",a.default.pagesPath(),o,n)}))}show(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{id:n,token:r,params:i}=(0,s.default)(["object"==typeof t?t:{id:t},o],["id"]);return yield this.spreeResponse("get",a.default.pagePath(n),r,i)}))}}t.default=u},799:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(...e){return n(this,void 0,void 0,(function*(){const[t={},o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.productsPath(),n,r)}))}show(...e){return n(this,void 0,void 0,(function*(){const[t,o={},n={}]=e,{id:r,token:i,params:u}=(0,s.default)([{id:t},o,n],["id"]);return yield this.spreeResponse("get",a.default.productPath(r),i,u)}))}}t.default=u},193:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(...e){return n(this,void 0,void 0,(function*(){const[t={}]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("get",a.default.taxonsPath(),o,n)}))}show(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{id:n,token:r,params:i}=(0,s.default)(["object"==typeof t?t:{id:t},o],["id"]);return yield this.spreeResponse("get",a.default.taxonPath(n),r,i)}))}}t.default=u},760:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(e={}){return n(this,void 0,void 0,(function*(){const{token:t,params:o}=(0,s.default)([e],[]);return yield this.spreeResponse("get",a.default.vendorsPath(),t,o)}))}show(e){return n(this,void 0,void 0,(function*(){const{id:t,token:o,params:n}=(0,s.default)([e],["id"]);return yield this.spreeResponse("get",a.default.vendorPath(t),o,n)}))}}t.default=u},343:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.wishlistsPath(),n,r)}))}show(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{wishlist_token:r,token:i,params:u}=(0,s.default)([t,{wishlist_token:o},n],["wishlist_token"]);return yield this.spreeResponse("get",a.default.wishlistPath(r),i,u)}))}default(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.defaultWishlistPath(),n,r)}))}create(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("post",a.default.wishlistsPath(),n,r)}))}update(...e){return n(this,void 0,void 0,(function*(){const[t,o,n]=e,{wishlist_token:r,token:i,params:u}=(0,s.default)([t,{wishlist_token:o},n],["wishlist_token"]);return yield this.spreeResponse("patch",a.default.wishlistPath(r),i,u)}))}remove(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{wishlist_token:n,token:r,params:i}=(0,s.default)([t,{wishlist_token:o}],["wishlist_token"]);return yield this.spreeResponse("delete",a.default.wishlistPath(n),r,i)}))}addWishedItem(...e){return n(this,void 0,void 0,(function*(){const[t,o,n]=e,{wishlist_token:r,token:i,params:u}=(0,s.default)([t,{wishlist_token:o},n],["wishlist_token"]);return yield this.spreeResponse("post",a.default.wishlistsAddWishedItemPath(r),i,u)}))}updateWishedItem(...e){return n(this,void 0,void 0,(function*(){const[t,o,n,r]=e,{wishlist_token:i,id:u,token:c,params:d}=(0,s.default)([t,{wishlist_token:o},{id:n},r],["wishlist_token","id"]);return yield this.spreeResponse("patch",a.default.wishlistsUpdateWishedItemQuantityPath(i,u),c,d)}))}removeWishedItem(...e){return n(this,void 0,void 0,(function*(){const[t,o,n]=e,{wishlist_token:r,id:i,token:u,params:c}=(0,s.default)([t,{wishlist_token:o},{id:n}],["wishlist_token","id"]);return yield this.spreeResponse("delete",a.default.wishlistsRemoveWishedItemPath(r,i),u,c)}))}}t.default=u},919:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Wishlists=t.Vendors=t.Taxons=t.Products=t.Pages=t.Order=t.Menus=t.DigitalAssets=t.Countries=t.Checkout=t.Cart=t.Authentication=t.Account=void 0;const r=n(o(993));t.Account=r.default;const s=n(o(464));t.Authentication=s.default;const i=n(o(712));t.Cart=i.default;const a=n(o(846));t.Checkout=a.default;const u=n(o(898));t.Countries=u.default;const c=n(o(847));t.DigitalAssets=c.default;const d=n(o(999));t.Menus=d.default;const h=n(o(298));t.Order=h.default;const f=n(o(995));t.Pages=f.default;const l=n(o(799));t.Products=l.default;const p=n(o(193));t.Taxons=p.default;const v=n(o(760));t.Vendors=v.default;const m=n(o(343));t.Wishlists=m.default},112:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(589));class s extends r.default{constructor(e,t){super(e),Object.setPrototypeOf(this,s.prototype),this.name="BasicSpreeError",this.summary=t}}t.default=s},583:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(e){super(e),Object.setPrototypeOf(this,s.prototype),this.name="CastError"}}t.default=s},811:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(e){super(e),Object.setPrototypeOf(this,s.prototype),this.name="DeserializeError"}}t.default=s},461:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(e){super(e),Object.setPrototypeOf(this,s.prototype),this.name="DocumentRelationshipError"}}t.default=s},957:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),o(368);const r=n(o(112));class s extends r.default{constructor(e,t,o){super(e,t),Object.setPrototypeOf(this,s.prototype),this.name="ExpandedSpreeError",this.errors=Object.keys(o).reduce(((e,t)=>{const n=t.split(".");let r=n.shift(),s=e;for(;r;)s[r]||(0===n.length?s[r]=o[t]:s[r]={}),s=s[r],r=n.shift();return e}),{})}getErrors(e){let t=0,o=this.errors,n=!0;for(;t<e.length&&n;){const r=e[t];r in Object(o)?(o=o[r],t+=1):n=!1}return n?o:null}}t.default=s},306:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(e,t,o,n){super(n),Object.setPrototypeOf(this,s.prototype),this.name="FetchError",this.response=e,this.request=t,this.data=o}}t.default=s},234:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(e){super(`Incorrect request setup: ${e}`),Object.setPrototypeOf(this,s.prototype),this.name="MisconfigurationError"}}t.default=s},815:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(){super("No response received from Spree"),Object.setPrototypeOf(this,s.prototype),this.name="NoResponseError"}}t.default=s},589:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(e){super(`Spree returned a HTTP ${e.status} error code`),Object.setPrototypeOf(this,s.prototype),this.name="SpreeError",this.serverResponse=e}}t.default=s},527:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});class o extends Error{constructor(e){super(e),Object.setPrototypeOf(this,o.prototype),this.name="SpreeSDKError"}}t.default=o},844:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentRelationshipError=t.FetchError=t.SpreeSDKError=t.SpreeError=t.NoResponseError=t.MisconfigurationError=t.ExpandedSpreeError=t.BasicSpreeError=void 0;const r=n(o(112));t.BasicSpreeError=r.default;const s=n(o(957));t.ExpandedSpreeError=s.default;const i=n(o(234));t.MisconfigurationError=i.default;const a=n(o(815));t.NoResponseError=a.default;const u=n(o(589));t.SpreeError=u.default;const c=n(o(527));t.SpreeSDKError=c.default;const d=n(o(306));t.FetchError=d.default;const h=n(o(461));t.DocumentRelationshipError=h.default},339:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.revokeParams=t.refreshParams=t.authParams=void 0,o(391),t.authParams=({username:e,password:t})=>({username:e,password:t,grant_type:"password"}),t.refreshParams=({refresh_token:e})=>({refresh_token:e,grant_type:"refresh_token"}),t.revokeParams=({token:e})=>({token:e})},644:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.findSingleRelationshipDocument=t.findRelationshipDocuments=t.findDocument=void 0;const n=o(844),r=(e,t)=>e.included&&e.included.find((e=>e.type===t.type&&e.id===t.id))||null;t.findDocument=r;const s=(e,t,o)=>{if(!e.included)return[];const s=(t.relationships[o]||{}).data;if(!s)throw new n.DocumentRelationshipError(`Incorrect relationship ${o}.`);let i;return i=Array.isArray(s)?s:[s],i.map((t=>r(e,t))).filter(Boolean)};t.findRelationshipDocuments=s,t.findSingleRelationshipDocument=(e,t,o)=>{const n=s(e,t,o);return 0===n.length?null:n[0]}},327:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.objectToQuerystring=void 0;const o=(()=>{const e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),n=(e,t)=>{if(0===e.length)return e;let n=e;if("symbol"==typeof e?n=Symbol.prototype.toString.call(e):"string"!=typeof e&&(n=String(e)),"iso-8859-1"===t)return escape(n).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));let r="";for(let e=0;e<n.length;++e){let t=n.charCodeAt(e);45===t||46===t||95===t||126===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?r+=n.charAt(e):t<128?r+=o[t]:t<2048?r+=o[192|t>>6]+o[128|63&t]:t<55296||t>=57344?r+=o[224|t>>12]+o[128|t>>6&63]+o[128|63&t]:(e+=1,t=65536+((1023&t)<<10|1023&n.charCodeAt(e)),r+=o[240|t>>18]+o[128|t>>12&63]+o[128|t>>6&63]+o[128|63&t])}return r},r=Array.isArray,s=Array.prototype.push,i=(e,t)=>{s.apply(e,r(t)?t:[t])},a=e=>String(e),u=(e,t)=>e+"[]",c="utf-8",d=(e,t)=>{var o,s;if(e instanceof Date&&(e=e.toISOString()),null===e&&(e=""),"string"==typeof(s=e)||"number"==typeof s||"boolean"==typeof s||"symbol"==typeof s||"bigint"==typeof s||(o=e)&&"object"==typeof o&&o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o)){const o=n(t,c);return[a(o)+"="+a(n(e,c))]}const h=[];if(void 0===e)return h;const f=Object.keys(e);for(let o=0;o<f.length;++o){const n=f[o],s=e[n],a=r(e)?u(t):t+"["+n+"]";i(h,d(s,a))}return h};t.objectToQuerystring=e=>{const t=[],o=Object.keys(e);for(let n=0;n<o.length;++n){const r=o[n];i(t,d(e[r],r))}return t.join("&")}},614:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.extractSuccess=t.fromJson=t.toJson=t.makeFail=t.makeSuccess=void 0;const a=s(o(844)),u=i(o(583)),c=i(o(811)),d=e=>({isSuccess:()=>!0,isFail:()=>!1,success:()=>e,fail:()=>{throw new Error("Cannot call fail() on success.")}});t.makeSuccess=d;const h=e=>({isSuccess:()=>!1,isFail:()=>!0,success:()=>{throw new Error("Cannot call success() on fail.")},fail:()=>e});t.makeFail=h,t.toJson=e=>e.isSuccess()?{type:"SpreeSDKResult",subtype:"success",value:e.success()}:{type:"SpreeSDKResult",subtype:"fail",value:Object.assign({},e.fail())},t.fromJson=e=>{if("SpreeSDKResult"===e.type){if("success"===e.subtype)return d(e.value);if("fail"===e.subtype)return h((e=>{if(!(e.name in a))throw new u.default("Error not recognized");return Object.assign(Object.create(a[e.name].prototype),e)})(e.value));throw new c.default("Expected success or fail subtype.")}throw new c.default("Unknown signature.")},t.extractSuccess=e=>e.then((e=>{if(e.isFail())throw e.fail();return e.success()}))},185:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.split=void 0,t.split=(e,t)=>{const o=[{},{}];for(const n in e)t.includes(n)?o[1][n]=e[n]:o[0][n]=e[n];return o},t.default=(e,o)=>{const n=Object.assign({},...e.filter(Boolean).reverse()),[r,s]=(0,t.split)(n,["order_token","bearer_token","orderToken","bearerToken"]),[i,a]=(0,t.split)(r,o);let u;return("order_token"in s&&"bearer_token"in s||"orderToken"in s&&"bearerToken"in s)&&console.warn("Avoid providing both token types (order token and bearer token) in a request to prevent unexpected results."),u="bearer_token"in s||"bearerToken"in s?{bearerToken:s.bearer_token||s.bearerToken}:"order_token"in s||"orderToken"in s?{orderToken:s.order_token||s.orderToken}:{},Object.assign(Object.assign({token:u},a),{params:i})}},341:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.request=t.jsonApi=t.storefrontPath=t.routes=t.endpoints=t.makeClient=t.errors=t.result=t.Http=t.Client=void 0;const a=i(o(390));t.Client=a.default;const u=s(o(844));t.errors=u;const c=s(o(614));t.result=c;const d=s(o(644));t.jsonApi=d;const h=s(o(327));t.request=h;const f=i(o(759));t.Http=f.default;const l=s(o(319));t.routes=l.default,Object.defineProperty(t,"storefrontPath",{enumerable:!0,get:function(){return l.storefrontPath}});const p=s(o(919));t.endpoints=p;const v=i(o(664));t.makeClient=v.default},391:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),o(921)},159:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},921:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},368:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},664:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(390));t.default=e=>new r.default(e)},319:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.storefrontPath=void 0,t.storefrontPath="api/v2/storefront";const o={productsPath:()=>`${t.storefrontPath}/products`,productPath:e=>`${t.storefrontPath}/products/${encodeURIComponent(e)}`,taxonsPath:()=>`${t.storefrontPath}/taxons`,taxonPath:e=>`${t.storefrontPath}/taxons/${encodeURIComponent(e)}`,countriesPath:()=>`${t.storefrontPath}/countries`,countryPath:e=>`${t.storefrontPath}/countries/${encodeURIComponent(e)}`,cartPath:()=>`${t.storefrontPath}/cart`,cartAddItemPath:()=>`${t.storefrontPath}/cart/add_item`,cartRemoveItemPath:e=>`${t.storefrontPath}/cart/remove_line_item/${encodeURIComponent(e)}`,cartEmptyPath:()=>`${t.storefrontPath}/cart/empty`,cartSetItemQuantity:()=>`${t.storefrontPath}/cart/set_quantity`,cartApplyCodePath:()=>`${t.storefrontPath}/cart/apply_coupon_code`,cartRemoveCodePath:e=>`${t.storefrontPath}/cart/remove_coupon_code/${encodeURIComponent(e)}`,cartRemoveAllCoupons:()=>`${t.storefrontPath}/cart/remove_coupon_code`,cartEstimateShippingMethodsPath:()=>`${t.storefrontPath}/cart/estimate_shipping_rates`,cartEstimateShippingRatesPath:()=>`${t.storefrontPath}/cart/estimate_shipping_rates`,cartAssociatePath:()=>`${t.storefrontPath}/cart/associate`,cartChangeCurrencyPath:()=>`${t.storefrontPath}/cart/change_currency`,checkoutPath:()=>`${t.storefrontPath}/checkout`,checkoutNextPath:()=>`${t.storefrontPath}/checkout/next`,checkoutAdvancePath:()=>`${t.storefrontPath}/checkout/advance`,checkoutCompletePath:()=>`${t.storefrontPath}/checkout/complete`,checkoutAddStoreCreditsPath:()=>`${t.storefrontPath}/checkout/add_store_credit`,checkoutRemoveStoreCreditsPath:()=>`${t.storefrontPath}/checkout/remove_store_credit`,checkoutPaymentMethodsPath:()=>`${t.storefrontPath}/checkout/payment_methods`,checkoutShippingMethodsPath:()=>`${t.storefrontPath}/checkout/shipping_rates`,checkoutShippingRatesPath:()=>`${t.storefrontPath}/checkout/shipping_rates`,checkoutSelectShippingMethodPath:()=>`${t.storefrontPath}/checkout/select_shipping_method`,checkoutAddPaymentPath:()=>`${t.storefrontPath}/checkout/create_payment`,checkoutCreateStripeSessionPath:()=>`${t.storefrontPath}/checkout/create_stripe_session`,oauthTokenPath:()=>"spree_oauth/token",oauthRevokePath:()=>"spree_oauth/revoke",accountPath:()=>`${t.storefrontPath}/account`,accountAddressPath:e=>`${t.storefrontPath}/account/addresses/${encodeURIComponent(e)}`,accountAddressesPath:()=>`${t.storefrontPath}/account/addresses`,accountAddressRemovePath:e=>`${t.storefrontPath}/account/addresses/${encodeURIComponent(e)}`,accountConfirmPath:e=>`${t.storefrontPath}/account_confirmations/${encodeURIComponent(e)}`,accountCreditCardsPath:()=>`${t.storefrontPath}/account/credit_cards`,accountDefaultCreditCardPath:()=>`${t.storefrontPath}/account/credit_cards/default`,accountCreditCardRemovePath:e=>`${t.storefrontPath}/account/credit_cards/${encodeURIComponent(e)}`,accountCompletedOrdersPath:()=>`${t.storefrontPath}/account/orders`,accountCompletedOrderPath:e=>`${t.storefrontPath}/account/orders/${encodeURIComponent(e)}`,forgotPasswordPath:()=>`${t.storefrontPath}/passwords`,resetPasswordPath:e=>`${t.storefrontPath}/passwords/${encodeURIComponent(e)}`,orderStatusPath:e=>`${t.storefrontPath}/order_status/${encodeURIComponent(e)}`,pagesPath:()=>`${t.storefrontPath}/cms_pages`,pagePath:e=>`${t.storefrontPath}/cms_pages/${encodeURIComponent(e)}`,defaultCountryPath:()=>`${t.storefrontPath}/countries/default`,digitalAssetsDownloadPath:e=>`${t.storefrontPath}/digitals/${encodeURIComponent(e)}`,menusPath:()=>`${t.storefrontPath}/menus`,menuPath:e=>`${t.storefrontPath}/menus/${encodeURIComponent(e)}`,wishlistsPath:()=>`${t.storefrontPath}/wishlists`,wishlistPath:e=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}`,defaultWishlistPath:()=>`${t.storefrontPath}/wishlists/default`,wishlistsAddWishedItemPath:e=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}/add_item`,wishlistsUpdateWishedItemQuantityPath:(e,o)=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}/set_item_quantity/${encodeURIComponent(o)}`,wishlistsRemoveWishedItemPath:(e,o)=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}/remove_item/${encodeURIComponent(o)}`,vendorsPath:()=>`${t.storefrontPath}/vendors`,vendorPath:e=>`${t.storefrontPath}/vendors/${encodeURIComponent(e)}`};t.default=o}},t={};return function o(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,o),s.exports}(341)})()}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SpreeSDK=t():e.SpreeSDK=t()}(self,(function(){return(()=>{"use strict";var e={390:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=o(919);t.default=class{constructor(e){const t={host:globalThis.process&&globalThis.process.env.SPREE_HOST||"http://localhost:3000/"},o=Object.assign(Object.assign({},t),e),n={host:o.host};this.fetcher=o.createFetcher(n),this.addEndpoints()}addEndpoints(){this.account=this.makeAccount(),this.authentication=this.makeAuthentication(),this.cart=this.makeCart(),this.checkout=this.makeCheckout(),this.countries=this.makeCountries(),this.digitalAssets=this.makeDigitalAssets(),this.menus=this.makeMenus(),this.order=this.makeOrder(),this.pages=this.makePages(),this.products=this.makeProducts(),this.taxons=this.makeTaxons(),this.vendors=this.makeVendors(),this.wishlists=this.makeWishlists()}makeAccount(){return new n.Account({fetcher:this.fetcher})}makeAuthentication(){return new n.Authentication({fetcher:this.fetcher})}makeCart(){return new n.Cart({fetcher:this.fetcher})}makeCheckout(){return new n.Checkout({fetcher:this.fetcher})}makeCountries(){return new n.Countries({fetcher:this.fetcher})}makeOrder(){return new n.Order({fetcher:this.fetcher})}makePages(){return new n.Pages({fetcher:this.fetcher})}makeProducts(){return new n.Products({fetcher:this.fetcher})}makeTaxons(){return new n.Taxons({fetcher:this.fetcher})}makeDigitalAssets(){return new n.DigitalAssets({fetcher:this.fetcher})}makeMenus(){return new n.Menus({fetcher:this.fetcher})}makeVendors(){return new n.Vendors({fetcher:this.fetcher})}makeWishlists(){return new n.Wishlists({fetcher:this.fetcher})}}},759:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=o(844),c=a(o(306)),d=s(o(614));t.default=class{constructor({fetcher:e}){this.fetcher=e}spreeResponse(e,t,o={},n={},r="automatic"){return i(this,void 0,void 0,(function*(){try{const s=this.spreeOrderHeaders(o),i={url:t,params:n,method:e,headers:s,responseParsing:r},a=yield this.fetcher.fetch(i);return d.makeSuccess(a.data)}catch(e){return d.makeFail(this.processError(e))}}))}classifySpreeError(e){const{error:t,errors:o}=e.data;return"string"==typeof t?"object"==typeof o?"full":"basic":"limited"}processError(e){return e instanceof c.default?e.response?this.processSpreeError(e):e.request?new u.NoResponseError:new u.MisconfigurationError(e.message):new u.SpreeSDKError(e.message)}processSpreeError(e){const{error:t,errors:o}=e.data,n=this.classifySpreeError(e);return"full"===n?new u.ExpandedSpreeError(e.response,t,o):"basic"===n?new u.BasicSpreeError(e.response,t):new u.SpreeError(e.response)}spreeOrderHeaders(e){const t={};return e.orderToken&&(t["X-Spree-Order-Token"]=e.orderToken),e.bearerToken&&(t.Authorization=`Bearer ${e.bearerToken}`),t}}},993:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{accountInfo(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.accountPath(),n,r)}))}creditCardsList(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.accountCreditCardsPath(),n,r)}))}defaultCreditCard(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.accountDefaultCreditCardPath(),n,r)}))}removeCreditCard(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{id:r,token:i,params:u}=(0,s.default)([{id:o},t,n],["id"]);return yield this.spreeResponse("delete",a.default.accountCreditCardRemovePath(r),i,u)}))}completedOrdersList(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.accountCompletedOrdersPath(),n,r)}))}completedOrder(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{order_number:r,token:i,params:u}=(0,s.default)([{order_number:o},t,n],["order_number"]);return yield this.spreeResponse("get",a.default.accountCompletedOrderPath(r),i,u)}))}create(...e){return n(this,void 0,void 0,(function*(){const[t={}]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("post",a.default.accountPath(),o,n)}))}confirm(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{confirmation_token:o,token:n,params:r}=(0,s.default)(["object"==typeof t?t:{confirmation_token:t}],["confirmation_token"]);return yield this.spreeResponse("get",a.default.accountConfirmPath(o),n,r)}))}forgotPassword(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("post",a.default.forgotPasswordPath(),o,n)}))}resetPassword(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{reset_password_token:n,token:r,params:i}=(0,s.default)(["object"==typeof t?t:{resetPasswordToken:t},o],["reset_password_token"]);return yield this.spreeResponse("patch",a.default.resetPasswordPath(n),r,i)}))}update(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("patch",a.default.accountPath(),n,r)}))}addressesList(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("get",a.default.accountAddressesPath(),o,n)}))}showAddress(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{id:r,token:i,params:u}=(0,s.default)([{id:o},t,n],["id"]);return yield this.spreeResponse("get",a.default.accountAddressPath(r),i,u)}))}createAddress(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("post",a.default.accountAddressesPath(),n,r)}))}removeAddress(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{id:r,token:i,params:u}=(0,s.default)([{id:o},t,n],["id"]);return yield this.spreeResponse("delete",a.default.accountAddressRemovePath(r),i,u)}))}updateAddress(...e){return n(this,void 0,void 0,(function*(){const[t,o,n]=e,{id:r,token:i,params:u}=(0,s.default)([{id:o},t,n],["id"]);return yield this.spreeResponse("patch",a.default.accountAddressPath(r),i,u)}))}}t.default=u},464:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(339),i=r(o(759)),a=r(o(319)),u=r(o(185));class c extends i.default{getToken(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,u.default)([t],[]);return yield this.spreeResponse("post",a.default.oauthTokenPath(),o,(0,s.authParams)(n))}))}refreshToken(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,u.default)([t],[]);return yield this.spreeResponse("post",a.default.oauthTokenPath(),o,(0,s.refreshParams)(n))}))}revokeToken(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,u.default)([t],[]);return yield this.spreeResponse("post",a.default.oauthRevokePath(),o,(0,s.revokeParams)(n))}))}}t.default=c},712:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(759)),i=r(o(319)),a=r(o(185));class u extends s.default{show(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("get",i.default.cartPath(),n,r)}))}create(...e){return n(this,void 0,void 0,(function*(){const[t={},o={}]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("post",i.default.cartPath(),n,r)}))}addItem(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("post",i.default.cartAddItemPath(),n,r)}))}removeItem(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{id:r,token:s,params:u}=(0,a.default)([{id:o},t,n],["id"]);return yield this.spreeResponse("delete",i.default.cartRemoveItemPath(r),s,u)}))}emptyCart(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("patch",i.default.cartEmptyPath(),n,r)}))}remove(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,a.default)([t],[]);return yield this.spreeResponse("delete",i.default.cartPath(),o,n)}))}setQuantity(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("patch",i.default.cartSetItemQuantity(),n,r)}))}applyCouponCode(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("patch",i.default.cartApplyCodePath(),n,r)}))}removeCouponCode(...e){return n(this,void 0,void 0,(function*(){const[t,o=null,n={}]=e,{code:r,token:s,params:u}=(0,a.default)([{code:o},t,n],["code"]);let c;return c=r?i.default.cartRemoveCodePath(r):i.default.cartRemoveAllCoupons(),yield this.spreeResponse("delete",c,s,u)}))}removeAllCoupons(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("delete",i.default.cartRemoveAllCoupons(),n,r)}))}estimateShippingMethods(e,t){return n(this,void 0,void 0,(function*(){return yield this.spreeResponse("get",i.default.cartEstimateShippingMethodsPath(),e,t)}))}estimateShippingRates(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("get",i.default.cartEstimateShippingRatesPath(),n,r)}))}associateGuestCart(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("patch",i.default.cartAssociatePath(),n,r)}))}changeCurrency(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,a.default)([t,o],[]);return yield this.spreeResponse("patch",i.default.cartChangeCurrencyPath(),n,r)}))}}t.default=u},846:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759));o(159);const a=r(o(319));class u extends i.default{orderNext(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("patch",a.default.checkoutNextPath(),n,r)}))}orderUpdate(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("patch",a.default.checkoutPath(),n,r)}))}advance(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("patch",a.default.checkoutAdvancePath(),n,r)}))}complete(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("patch",a.default.checkoutCompletePath(),n,r)}))}addStoreCredits(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("post",a.default.checkoutAddStoreCreditsPath(),n,r)}))}removeStoreCredits(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("post",a.default.checkoutRemoveStoreCreditsPath(),n,r)}))}paymentMethods(...e){return n(this,void 0,void 0,(function*(){const[t]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("get",a.default.checkoutPaymentMethodsPath(),o,n)}))}shippingMethods(e,t={}){return n(this,void 0,void 0,(function*(){return yield this.spreeResponse("get",a.default.checkoutShippingMethodsPath(),e,t)}))}shippingRates(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.checkoutShippingRatesPath(),n,r)}))}selectShippingMethod(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("patch",a.default.checkoutSelectShippingMethodPath(),n,r)}))}addPayment(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("post",a.default.checkoutAddPaymentPath(),n,r)}))}createStripeSession(e){return n(this,void 0,void 0,(function*(){const{token:t,params:o}=(0,s.default)([e],[]);return yield this.spreeResponse("patch",a.default.checkoutCreateStripeSessionPath(),t,o)}))}}t.default=u},898:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(e){return n(this,void 0,void 0,(function*(){const{token:t,params:o}=(0,s.default)([e||{}],[]);return yield this.spreeResponse("get",a.default.countriesPath(),t,o)}))}show(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{iso:n,token:r,params:i}=(0,s.default)(["object"==typeof t?t:{iso:t},o],["iso"]);return yield this.spreeResponse("get",a.default.countryPath(n),r,i)}))}default(...e){return n(this,void 0,void 0,(function*(){const[t={}]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("get",a.default.defaultCountryPath(),o,n)}))}}t.default=u},847:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(759)),i=r(o(319)),a=r(o(185));class u extends s.default{download(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{asset_token:r,token:s,params:u}=(0,a.default)([t,{asset_token:o},n],["asset_token"]);return yield this.spreeResponse("get",i.default.digitalAssetsDownloadPath(r),s,u,"stream")}))}}t.default=u},999:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(...e){return n(this,void 0,void 0,(function*(){const[t={}]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("get",a.default.menusPath(),o,n)}))}show(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{id:n,token:r,params:i}=(0,s.default)(["object"==typeof t?t:{id:t},o],["id"]);return yield this.spreeResponse("get",a.default.menuPath(n),r,i)}))}}t.default=u},298:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{status(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{order_number:r,token:i,params:u}=(0,s.default)([t,{order_number:o},n],["order_number"]);return yield this.spreeResponse("get",a.default.orderStatusPath(r),i,u)}))}}t.default=u},995:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(...e){return n(this,void 0,void 0,(function*(){const[t={}]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("get",a.default.pagesPath(),o,n)}))}show(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{id:n,token:r,params:i}=(0,s.default)(["object"==typeof t?t:{id:t},o],["id"]);return yield this.spreeResponse("get",a.default.pagePath(n),r,i)}))}}t.default=u},799:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(...e){return n(this,void 0,void 0,(function*(){const[t={},o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.productsPath(),n,r)}))}show(...e){return n(this,void 0,void 0,(function*(){const[t,o={},n={}]=e,{id:r,token:i,params:u}=(0,s.default)(["object"==typeof t?t:{id:t},o,n],["id"]);return yield this.spreeResponse("get",a.default.productPath(r),i,u)}))}}t.default=u},193:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(...e){return n(this,void 0,void 0,(function*(){const[t={}]=e,{token:o,params:n}=(0,s.default)([t],[]);return yield this.spreeResponse("get",a.default.taxonsPath(),o,n)}))}show(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{id:n,token:r,params:i}=(0,s.default)(["object"==typeof t?t:{id:t},o],["id"]);return yield this.spreeResponse("get",a.default.taxonPath(n),r,i)}))}}t.default=u},760:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(e={}){return n(this,void 0,void 0,(function*(){const{token:t,params:o}=(0,s.default)([e],[]);return yield this.spreeResponse("get",a.default.vendorsPath(),t,o)}))}show(e){return n(this,void 0,void 0,(function*(){const{id:t,token:o,params:n}=(0,s.default)([e],["id"]);return yield this.spreeResponse("get",a.default.vendorPath(t),o,n)}))}}t.default=u},343:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(o(185)),i=r(o(759)),a=r(o(319));class u extends i.default{list(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.wishlistsPath(),n,r)}))}show(...e){return n(this,void 0,void 0,(function*(){const[t,o,n={}]=e,{wishlist_token:r,token:i,params:u}=(0,s.default)([t,{wishlist_token:o},n],["wishlist_token"]);return yield this.spreeResponse("get",a.default.wishlistPath(r),i,u)}))}default(...e){return n(this,void 0,void 0,(function*(){const[t,o={}]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("get",a.default.defaultWishlistPath(),n,r)}))}create(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{token:n,params:r}=(0,s.default)([t,o],[]);return yield this.spreeResponse("post",a.default.wishlistsPath(),n,r)}))}update(...e){return n(this,void 0,void 0,(function*(){const[t,o,n]=e,{wishlist_token:r,token:i,params:u}=(0,s.default)([t,{wishlist_token:o},n],["wishlist_token"]);return yield this.spreeResponse("patch",a.default.wishlistPath(r),i,u)}))}remove(...e){return n(this,void 0,void 0,(function*(){const[t,o]=e,{wishlist_token:n,token:r,params:i}=(0,s.default)([t,{wishlist_token:o}],["wishlist_token"]);return yield this.spreeResponse("delete",a.default.wishlistPath(n),r,i)}))}addWishedItem(...e){return n(this,void 0,void 0,(function*(){const[t,o,n]=e,{wishlist_token:r,token:i,params:u}=(0,s.default)([t,{wishlist_token:o},n],["wishlist_token"]);return yield this.spreeResponse("post",a.default.wishlistsAddWishedItemPath(r),i,u)}))}updateWishedItem(...e){return n(this,void 0,void 0,(function*(){const[t,o,n,r]=e,{wishlist_token:i,id:u,token:c,params:d}=(0,s.default)([t,{wishlist_token:o},{id:n},r],["wishlist_token","id"]);return yield this.spreeResponse("patch",a.default.wishlistsUpdateWishedItemQuantityPath(i,u),c,d)}))}removeWishedItem(...e){return n(this,void 0,void 0,(function*(){const[t,o,n]=e,{wishlist_token:r,id:i,token:u,params:c}=(0,s.default)([t,{wishlist_token:o},{id:n}],["wishlist_token","id"]);return yield this.spreeResponse("delete",a.default.wishlistsRemoveWishedItemPath(r,i),u,c)}))}}t.default=u},919:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Wishlists=t.Vendors=t.Taxons=t.Products=t.Pages=t.Order=t.Menus=t.DigitalAssets=t.Countries=t.Checkout=t.Cart=t.Authentication=t.Account=void 0;const r=n(o(993));t.Account=r.default;const s=n(o(464));t.Authentication=s.default;const i=n(o(712));t.Cart=i.default;const a=n(o(846));t.Checkout=a.default;const u=n(o(898));t.Countries=u.default;const c=n(o(847));t.DigitalAssets=c.default;const d=n(o(999));t.Menus=d.default;const h=n(o(298));t.Order=h.default;const f=n(o(995));t.Pages=f.default;const l=n(o(799));t.Products=l.default;const p=n(o(193));t.Taxons=p.default;const v=n(o(760));t.Vendors=v.default;const m=n(o(343));t.Wishlists=m.default},112:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(589));class s extends r.default{constructor(e,t){super(e),Object.setPrototypeOf(this,s.prototype),this.name="BasicSpreeError",this.summary=t}}t.default=s},583:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(e){super(e),Object.setPrototypeOf(this,s.prototype),this.name="CastError"}}t.default=s},811:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(e){super(e),Object.setPrototypeOf(this,s.prototype),this.name="DeserializeError"}}t.default=s},461:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(e){super(e),Object.setPrototypeOf(this,s.prototype),this.name="DocumentRelationshipError"}}t.default=s},957:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),o(368);const r=n(o(112));class s extends r.default{constructor(e,t,o){super(e,t),Object.setPrototypeOf(this,s.prototype),this.name="ExpandedSpreeError",this.errors=Object.keys(o).reduce(((e,t)=>{const n=t.split(".");let r=n.shift(),s=e;for(;r;)s[r]||(0===n.length?s[r]=o[t]:s[r]={}),s=s[r],r=n.shift();return e}),{})}getErrors(e){let t=0,o=this.errors,n=!0;for(;t<e.length&&n;){const r=e[t];r in Object(o)?(o=o[r],t+=1):n=!1}return n?o:null}}t.default=s},306:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(e,t,o,n){super(n),Object.setPrototypeOf(this,s.prototype),this.name="FetchError",this.response=e,this.request=t,this.data=o}}t.default=s},234:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(e){super(`Incorrect request setup: ${e}`),Object.setPrototypeOf(this,s.prototype),this.name="MisconfigurationError"}}t.default=s},815:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(){super("No response received from Spree"),Object.setPrototypeOf(this,s.prototype),this.name="NoResponseError"}}t.default=s},589:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(527));class s extends r.default{constructor(e){super(`Spree returned a HTTP ${e.status} error code`),Object.setPrototypeOf(this,s.prototype),this.name="SpreeError",this.serverResponse=e}}t.default=s},527:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});class o extends Error{constructor(e){super(e),Object.setPrototypeOf(this,o.prototype),this.name="SpreeSDKError"}}t.default=o},844:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentRelationshipError=t.FetchError=t.SpreeSDKError=t.SpreeError=t.NoResponseError=t.MisconfigurationError=t.ExpandedSpreeError=t.BasicSpreeError=void 0;const r=n(o(112));t.BasicSpreeError=r.default;const s=n(o(957));t.ExpandedSpreeError=s.default;const i=n(o(234));t.MisconfigurationError=i.default;const a=n(o(815));t.NoResponseError=a.default;const u=n(o(589));t.SpreeError=u.default;const c=n(o(527));t.SpreeSDKError=c.default;const d=n(o(306));t.FetchError=d.default;const h=n(o(461));t.DocumentRelationshipError=h.default},339:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.revokeParams=t.refreshParams=t.authParams=void 0,o(391),t.authParams=({username:e,password:t})=>({username:e,password:t,grant_type:"password"}),t.refreshParams=({refresh_token:e})=>({refresh_token:e,grant_type:"refresh_token"}),t.revokeParams=({token:e})=>({token:e})},644:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.findSingleRelationshipDocument=t.findRelationshipDocuments=t.findDocument=void 0;const n=o(844),r=(e,t)=>e.included&&e.included.find((e=>e.type===t.type&&e.id===t.id))||null;t.findDocument=r;const s=(e,t,o)=>{if(!e.included)return[];const s=(t.relationships[o]||{}).data;if(!s)throw new n.DocumentRelationshipError(`Incorrect relationship ${o}.`);let i;return i=Array.isArray(s)?s:[s],i.map((t=>r(e,t))).filter(Boolean)};t.findRelationshipDocuments=s,t.findSingleRelationshipDocument=(e,t,o)=>{const n=s(e,t,o);return 0===n.length?null:n[0]}},327:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.objectToQuerystring=void 0;const o=(()=>{const e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),n=(e,t)=>{if(0===e.length)return e;let n=e;if("symbol"==typeof e?n=Symbol.prototype.toString.call(e):"string"!=typeof e&&(n=String(e)),"iso-8859-1"===t)return escape(n).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));let r="";for(let e=0;e<n.length;++e){let t=n.charCodeAt(e);45===t||46===t||95===t||126===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?r+=n.charAt(e):t<128?r+=o[t]:t<2048?r+=o[192|t>>6]+o[128|63&t]:t<55296||t>=57344?r+=o[224|t>>12]+o[128|t>>6&63]+o[128|63&t]:(e+=1,t=65536+((1023&t)<<10|1023&n.charCodeAt(e)),r+=o[240|t>>18]+o[128|t>>12&63]+o[128|t>>6&63]+o[128|63&t])}return r},r=Array.isArray,s=Array.prototype.push,i=(e,t)=>{s.apply(e,r(t)?t:[t])},a=e=>String(e),u=(e,t)=>e+"[]",c="utf-8",d=(e,t)=>{var o,s;if(e instanceof Date&&(e=e.toISOString()),null===e&&(e=""),"string"==typeof(s=e)||"number"==typeof s||"boolean"==typeof s||"symbol"==typeof s||"bigint"==typeof s||(o=e)&&"object"==typeof o&&o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o)){const o=n(t,c);return[a(o)+"="+a(n(e,c))]}const h=[];if(void 0===e)return h;const f=Object.keys(e);for(let o=0;o<f.length;++o){const n=f[o],s=e[n],a=r(e)?u(t):t+"["+n+"]";i(h,d(s,a))}return h};t.objectToQuerystring=e=>{const t=[],o=Object.keys(e);for(let n=0;n<o.length;++n){const r=o[n];i(t,d(e[r],r))}return t.join("&")}},614:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.extractSuccess=t.fromJson=t.toJson=t.makeFail=t.makeSuccess=void 0;const a=s(o(844)),u=i(o(583)),c=i(o(811)),d=e=>({isSuccess:()=>!0,isFail:()=>!1,success:()=>e,fail:()=>{throw new Error("Cannot call fail() on success.")}});t.makeSuccess=d;const h=e=>({isSuccess:()=>!1,isFail:()=>!0,success:()=>{throw new Error("Cannot call success() on fail.")},fail:()=>e});t.makeFail=h,t.toJson=e=>e.isSuccess()?{type:"SpreeSDKResult",subtype:"success",value:e.success()}:{type:"SpreeSDKResult",subtype:"fail",value:Object.assign({},e.fail())},t.fromJson=e=>{if("SpreeSDKResult"===e.type){if("success"===e.subtype)return d(e.value);if("fail"===e.subtype)return h((e=>{if(!(e.name in a))throw new u.default("Error not recognized");return Object.assign(Object.create(a[e.name].prototype),e)})(e.value));throw new c.default("Expected success or fail subtype.")}throw new c.default("Unknown signature.")},t.extractSuccess=e=>e.then((e=>{if(e.isFail())throw e.fail();return e.success()}))},185:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.split=void 0,t.split=(e,t)=>{const o=[{},{}];for(const n in e)t.includes(n)?o[1][n]=e[n]:o[0][n]=e[n];return o},t.default=(e,o)=>{const n=Object.assign({},...e.filter(Boolean).reverse()),[r,s]=(0,t.split)(n,["order_token","bearer_token","orderToken","bearerToken"]),[i,a]=(0,t.split)(r,o);let u;return("order_token"in s&&"bearer_token"in s||"orderToken"in s&&"bearerToken"in s)&&console.warn("Avoid providing both token types (order token and bearer token) in a request to prevent unexpected results."),u="bearer_token"in s||"bearerToken"in s?{bearerToken:s.bearer_token||s.bearerToken}:"order_token"in s||"orderToken"in s?{orderToken:s.order_token||s.orderToken}:{},Object.assign(Object.assign({token:u},a),{params:i})}},341:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[o]}})}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.request=t.jsonApi=t.storefrontPath=t.routes=t.endpoints=t.makeClient=t.errors=t.result=t.Http=t.Client=void 0;const a=i(o(390));t.Client=a.default;const u=s(o(844));t.errors=u;const c=s(o(614));t.result=c;const d=s(o(644));t.jsonApi=d;const h=s(o(327));t.request=h;const f=i(o(759));t.Http=f.default;const l=s(o(319));t.routes=l.default,Object.defineProperty(t,"storefrontPath",{enumerable:!0,get:function(){return l.storefrontPath}});const p=s(o(919));t.endpoints=p;const v=i(o(664));t.makeClient=v.default},391:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),o(921)},159:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},921:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},368:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},664:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(o(390));t.default=e=>new r.default(e)},319:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.storefrontPath=void 0,t.storefrontPath="api/v2/storefront";const o={productsPath:()=>`${t.storefrontPath}/products`,productPath:e=>`${t.storefrontPath}/products/${encodeURIComponent(e)}`,taxonsPath:()=>`${t.storefrontPath}/taxons`,taxonPath:e=>`${t.storefrontPath}/taxons/${encodeURIComponent(e)}`,countriesPath:()=>`${t.storefrontPath}/countries`,countryPath:e=>`${t.storefrontPath}/countries/${encodeURIComponent(e)}`,cartPath:()=>`${t.storefrontPath}/cart`,cartAddItemPath:()=>`${t.storefrontPath}/cart/add_item`,cartRemoveItemPath:e=>`${t.storefrontPath}/cart/remove_line_item/${encodeURIComponent(e)}`,cartEmptyPath:()=>`${t.storefrontPath}/cart/empty`,cartSetItemQuantity:()=>`${t.storefrontPath}/cart/set_quantity`,cartApplyCodePath:()=>`${t.storefrontPath}/cart/apply_coupon_code`,cartRemoveCodePath:e=>`${t.storefrontPath}/cart/remove_coupon_code/${encodeURIComponent(e)}`,cartRemoveAllCoupons:()=>`${t.storefrontPath}/cart/remove_coupon_code`,cartEstimateShippingMethodsPath:()=>`${t.storefrontPath}/cart/estimate_shipping_rates`,cartEstimateShippingRatesPath:()=>`${t.storefrontPath}/cart/estimate_shipping_rates`,cartAssociatePath:()=>`${t.storefrontPath}/cart/associate`,cartChangeCurrencyPath:()=>`${t.storefrontPath}/cart/change_currency`,checkoutPath:()=>`${t.storefrontPath}/checkout`,checkoutNextPath:()=>`${t.storefrontPath}/checkout/next`,checkoutAdvancePath:()=>`${t.storefrontPath}/checkout/advance`,checkoutCompletePath:()=>`${t.storefrontPath}/checkout/complete`,checkoutAddStoreCreditsPath:()=>`${t.storefrontPath}/checkout/add_store_credit`,checkoutRemoveStoreCreditsPath:()=>`${t.storefrontPath}/checkout/remove_store_credit`,checkoutPaymentMethodsPath:()=>`${t.storefrontPath}/checkout/payment_methods`,checkoutShippingMethodsPath:()=>`${t.storefrontPath}/checkout/shipping_rates`,checkoutShippingRatesPath:()=>`${t.storefrontPath}/checkout/shipping_rates`,checkoutSelectShippingMethodPath:()=>`${t.storefrontPath}/checkout/select_shipping_method`,checkoutAddPaymentPath:()=>`${t.storefrontPath}/checkout/create_payment`,checkoutCreateStripeSessionPath:()=>`${t.storefrontPath}/checkout/create_stripe_session`,oauthTokenPath:()=>"spree_oauth/token",oauthRevokePath:()=>"spree_oauth/revoke",accountPath:()=>`${t.storefrontPath}/account`,accountAddressPath:e=>`${t.storefrontPath}/account/addresses/${encodeURIComponent(e)}`,accountAddressesPath:()=>`${t.storefrontPath}/account/addresses`,accountAddressRemovePath:e=>`${t.storefrontPath}/account/addresses/${encodeURIComponent(e)}`,accountConfirmPath:e=>`${t.storefrontPath}/account_confirmations/${encodeURIComponent(e)}`,accountCreditCardsPath:()=>`${t.storefrontPath}/account/credit_cards`,accountDefaultCreditCardPath:()=>`${t.storefrontPath}/account/credit_cards/default`,accountCreditCardRemovePath:e=>`${t.storefrontPath}/account/credit_cards/${encodeURIComponent(e)}`,accountCompletedOrdersPath:()=>`${t.storefrontPath}/account/orders`,accountCompletedOrderPath:e=>`${t.storefrontPath}/account/orders/${encodeURIComponent(e)}`,forgotPasswordPath:()=>`${t.storefrontPath}/passwords`,resetPasswordPath:e=>`${t.storefrontPath}/passwords/${encodeURIComponent(e)}`,orderStatusPath:e=>`${t.storefrontPath}/order_status/${encodeURIComponent(e)}`,pagesPath:()=>`${t.storefrontPath}/cms_pages`,pagePath:e=>`${t.storefrontPath}/cms_pages/${encodeURIComponent(e)}`,defaultCountryPath:()=>`${t.storefrontPath}/countries/default`,digitalAssetsDownloadPath:e=>`${t.storefrontPath}/digitals/${encodeURIComponent(e)}`,menusPath:()=>`${t.storefrontPath}/menus`,menuPath:e=>`${t.storefrontPath}/menus/${encodeURIComponent(e)}`,wishlistsPath:()=>`${t.storefrontPath}/wishlists`,wishlistPath:e=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}`,defaultWishlistPath:()=>`${t.storefrontPath}/wishlists/default`,wishlistsAddWishedItemPath:e=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}/add_item`,wishlistsUpdateWishedItemQuantityPath:(e,o)=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}/set_item_quantity/${encodeURIComponent(o)}`,wishlistsRemoveWishedItemPath:(e,o)=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}/remove_item/${encodeURIComponent(o)}`,vendorsPath:()=>`${t.storefrontPath}/vendors`,vendorPath:e=>`${t.storefrontPath}/vendors/${encodeURIComponent(e)}`};t.default=o}},t={};return function o(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,o),s.exports}(341)})()}));
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SpreeSDK=t():e.SpreeSDK=t()}(global,(function(){return(()=>{"use strict";var e={390:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=s(919);t.default=class{constructor(e){const t={host:globalThis.process&&globalThis.process.env.SPREE_HOST||"http://localhost:3000/",...e},s={host:t.host};this.fetcher=t.createFetcher(s),this.addEndpoints()}addEndpoints(){this.account=this.makeAccount(),this.authentication=this.makeAuthentication(),this.cart=this.makeCart(),this.checkout=this.makeCheckout(),this.countries=this.makeCountries(),this.digitalAssets=this.makeDigitalAssets(),this.menus=this.makeMenus(),this.order=this.makeOrder(),this.pages=this.makePages(),this.products=this.makeProducts(),this.taxons=this.makeTaxons(),this.vendors=this.makeVendors(),this.wishlists=this.makeWishlists()}makeAccount(){return new r.Account({fetcher:this.fetcher})}makeAuthentication(){return new r.Authentication({fetcher:this.fetcher})}makeCart(){return new r.Cart({fetcher:this.fetcher})}makeCheckout(){return new r.Checkout({fetcher:this.fetcher})}makeCountries(){return new r.Countries({fetcher:this.fetcher})}makeOrder(){return new r.Order({fetcher:this.fetcher})}makePages(){return new r.Pages({fetcher:this.fetcher})}makeProducts(){return new r.Products({fetcher:this.fetcher})}makeTaxons(){return new r.Taxons({fetcher:this.fetcher})}makeDigitalAssets(){return new r.DigitalAssets({fetcher:this.fetcher})}makeMenus(){return new r.Menus({fetcher:this.fetcher})}makeVendors(){return new r.Vendors({fetcher:this.fetcher})}makeWishlists(){return new r.Wishlists({fetcher:this.fetcher})}}},759:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=s(844),i=n(s(306)),c=a(s(614));t.default=class{constructor({fetcher:e}){this.fetcher=e}async spreeResponse(e,t,s={},r={},o="automatic"){try{const a={url:t,params:r,method:e,headers:this.spreeOrderHeaders(s),responseParsing:o},n=await this.fetcher.fetch(a);return c.makeSuccess(n.data)}catch(e){return c.makeFail(this.processError(e))}}classifySpreeError(e){const{error:t,errors:s}=e.data;return"string"==typeof t?"object"==typeof s?"full":"basic":"limited"}processError(e){return e instanceof i.default?e.response?this.processSpreeError(e):e.request?new u.NoResponseError:new u.MisconfigurationError(e.message):new u.SpreeSDKError(e.message)}processSpreeError(e){const{error:t,errors:s}=e.data,r=this.classifySpreeError(e);return"full"===r?new u.ExpandedSpreeError(e.response,t,s):"basic"===r?new u.BasicSpreeError(e.response,t):new u.SpreeError(e.response)}spreeOrderHeaders(e){const t={};return e.orderToken&&(t["X-Spree-Order-Token"]=e.orderToken),e.bearerToken&&(t.Authorization=`Bearer ${e.bearerToken}`),t}}},993:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async accountInfo(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.accountPath(),r,a)}async creditCardsList(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.accountCreditCardsPath(),r,a)}async defaultCreditCard(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.accountDefaultCreditCardPath(),r,a)}async removeCreditCard(...e){const[t,s,r={}]=e,{id:a,token:u,params:i}=(0,o.default)([{id:s},t,r],["id"]);return await this.spreeResponse("delete",n.default.accountCreditCardRemovePath(a),u,i)}async completedOrdersList(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.accountCompletedOrdersPath(),r,a)}async completedOrder(...e){const[t,s,r={}]=e,{order_number:a,token:u,params:i}=(0,o.default)([{order_number:s},t,r],["order_number"]);return await this.spreeResponse("get",n.default.accountCompletedOrderPath(a),u,i)}async create(...e){const[t={}]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("post",n.default.accountPath(),s,r)}async confirm(...e){const[t]=e,{confirmation_token:s,token:r,params:a}=(0,o.default)(["object"==typeof t?t:{confirmation_token:t}],["confirmation_token"]);return await this.spreeResponse("get",n.default.accountConfirmPath(s),r,a)}async forgotPassword(...e){const[t]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("post",n.default.forgotPasswordPath(),s,r)}async resetPassword(...e){const[t,s]=e,{reset_password_token:r,token:a,params:u}=(0,o.default)(["object"==typeof t?t:{resetPasswordToken:t},s],["reset_password_token"]);return await this.spreeResponse("patch",n.default.resetPasswordPath(r),a,u)}async update(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("patch",n.default.accountPath(),r,a)}async addressesList(...e){const[t]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("get",n.default.accountAddressesPath(),s,r)}async showAddress(...e){const[t,s,r={}]=e,{id:a,token:u,params:i}=(0,o.default)([{id:s},t,r],["id"]);return await this.spreeResponse("get",n.default.accountAddressPath(a),u,i)}async createAddress(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("post",n.default.accountAddressesPath(),r,a)}async removeAddress(...e){const[t,s,r={}]=e,{id:a,token:u,params:i}=(0,o.default)([{id:s},t,r],["id"]);return await this.spreeResponse("delete",n.default.accountAddressRemovePath(a),u,i)}async updateAddress(...e){const[t,s,r]=e,{id:a,token:u,params:i}=(0,o.default)([{id:s},t,r],["id"]);return await this.spreeResponse("patch",n.default.accountAddressPath(a),u,i)}}t.default=u},464:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=s(339),a=r(s(759)),n=r(s(319)),u=r(s(185));class i extends a.default{async getToken(...e){const[t]=e,{token:s,params:r}=(0,u.default)([t],[]);return await this.spreeResponse("post",n.default.oauthTokenPath(),s,(0,o.authParams)(r))}async refreshToken(...e){const[t]=e,{token:s,params:r}=(0,u.default)([t],[]);return await this.spreeResponse("post",n.default.oauthTokenPath(),s,(0,o.refreshParams)(r))}async revokeToken(...e){const[t]=e,{token:s,params:r}=(0,u.default)([t],[]);return await this.spreeResponse("post",n.default.oauthRevokePath(),s,(0,o.revokeParams)(r))}}t.default=i},712:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(759)),a=r(s(319)),n=r(s(185));class u extends o.default{async show(...e){const[t,s={}]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("get",a.default.cartPath(),r,o)}async create(...e){const[t={},s={}]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("post",a.default.cartPath(),r,o)}async addItem(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("post",a.default.cartAddItemPath(),r,o)}async removeItem(...e){const[t,s,r={}]=e,{id:o,token:u,params:i}=(0,n.default)([{id:s},t,r],["id"]);return await this.spreeResponse("delete",a.default.cartRemoveItemPath(o),u,i)}async emptyCart(...e){const[t,s={}]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("patch",a.default.cartEmptyPath(),r,o)}async remove(...e){const[t]=e,{token:s,params:r}=(0,n.default)([t],[]);return await this.spreeResponse("delete",a.default.cartPath(),s,r)}async setQuantity(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("patch",a.default.cartSetItemQuantity(),r,o)}async applyCouponCode(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("patch",a.default.cartApplyCodePath(),r,o)}async removeCouponCode(...e){const[t,s=null,r={}]=e,{code:o,token:u,params:i}=(0,n.default)([{code:s},t,r],["code"]);let c;return c=o?a.default.cartRemoveCodePath(o):a.default.cartRemoveAllCoupons(),await this.spreeResponse("delete",c,u,i)}async removeAllCoupons(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("delete",a.default.cartRemoveAllCoupons(),r,o)}async estimateShippingMethods(e,t){return await this.spreeResponse("get",a.default.cartEstimateShippingMethodsPath(),e,t)}async estimateShippingRates(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("get",a.default.cartEstimateShippingRatesPath(),r,o)}async associateGuestCart(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("patch",a.default.cartAssociatePath(),r,o)}async changeCurrency(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("patch",a.default.cartChangeCurrencyPath(),r,o)}}t.default=u},846:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759));s(159);const n=r(s(319));class u extends a.default{async orderNext(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("patch",n.default.checkoutNextPath(),r,a)}async orderUpdate(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("patch",n.default.checkoutPath(),r,a)}async advance(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("patch",n.default.checkoutAdvancePath(),r,a)}async complete(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("patch",n.default.checkoutCompletePath(),r,a)}async addStoreCredits(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("post",n.default.checkoutAddStoreCreditsPath(),r,a)}async removeStoreCredits(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("post",n.default.checkoutRemoveStoreCreditsPath(),r,a)}async paymentMethods(...e){const[t]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("get",n.default.checkoutPaymentMethodsPath(),s,r)}async shippingMethods(e,t={}){return await this.spreeResponse("get",n.default.checkoutShippingMethodsPath(),e,t)}async shippingRates(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.checkoutShippingRatesPath(),r,a)}async selectShippingMethod(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("patch",n.default.checkoutSelectShippingMethodPath(),r,a)}async addPayment(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("post",n.default.checkoutAddPaymentPath(),r,a)}async createStripeSession(e){const{token:t,params:s}=(0,o.default)([e],[]);return await this.spreeResponse("patch",n.default.checkoutCreateStripeSessionPath(),t,s)}}t.default=u},898:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(e){const{token:t,params:s}=(0,o.default)([e||{}],[]);return await this.spreeResponse("get",n.default.countriesPath(),t,s)}async show(...e){const[t,s={}]=e,{iso:r,token:a,params:u}=(0,o.default)(["object"==typeof t?t:{iso:t},s],["iso"]);return await this.spreeResponse("get",n.default.countryPath(r),a,u)}async default(...e){const[t={}]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("get",n.default.defaultCountryPath(),s,r)}}t.default=u},847:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(759)),a=r(s(319)),n=r(s(185));class u extends o.default{async download(...e){const[t,s,r={}]=e,{asset_token:o,token:u,params:i}=(0,n.default)([t,{asset_token:s},r],["asset_token"]);return await this.spreeResponse("get",a.default.digitalAssetsDownloadPath(o),u,i,"stream")}}t.default=u},999:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(...e){const[t={}]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("get",n.default.menusPath(),s,r)}async show(...e){const[t,s={}]=e,{id:r,token:a,params:u}=(0,o.default)(["object"==typeof t?t:{id:t},s],["id"]);return await this.spreeResponse("get",n.default.menuPath(r),a,u)}}t.default=u},298:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async status(...e){const[t,s,r={}]=e,{order_number:a,token:u,params:i}=(0,o.default)([t,{order_number:s},r],["order_number"]);return await this.spreeResponse("get",n.default.orderStatusPath(a),u,i)}}t.default=u},995:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(...e){const[t={}]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("get",n.default.pagesPath(),s,r)}async show(...e){const[t,s={}]=e,{id:r,token:a,params:u}=(0,o.default)(["object"==typeof t?t:{id:t},s],["id"]);return await this.spreeResponse("get",n.default.pagePath(r),a,u)}}t.default=u},799:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(...e){const[t={},s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.productsPath(),r,a)}async show(...e){const[t,s={},r={}]=e,{id:a,token:u,params:i}=(0,o.default)([{id:t},s,r],["id"]);return await this.spreeResponse("get",n.default.productPath(a),u,i)}}t.default=u},193:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(...e){const[t={}]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("get",n.default.taxonsPath(),s,r)}async show(...e){const[t,s={}]=e,{id:r,token:a,params:u}=(0,o.default)(["object"==typeof t?t:{id:t},s],["id"]);return await this.spreeResponse("get",n.default.taxonPath(r),a,u)}}t.default=u},760:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(e={}){const{token:t,params:s}=(0,o.default)([e],[]);return await this.spreeResponse("get",n.default.vendorsPath(),t,s)}async show(e){const{id:t,token:s,params:r}=(0,o.default)([e],["id"]);return await this.spreeResponse("get",n.default.vendorPath(t),s,r)}}t.default=u},343:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.wishlistsPath(),r,a)}async show(...e){const[t,s,r={}]=e,{wishlist_token:a,token:u,params:i}=(0,o.default)([t,{wishlist_token:s},r],["wishlist_token"]);return await this.spreeResponse("get",n.default.wishlistPath(a),u,i)}async default(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.defaultWishlistPath(),r,a)}async create(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("post",n.default.wishlistsPath(),r,a)}async update(...e){const[t,s,r]=e,{wishlist_token:a,token:u,params:i}=(0,o.default)([t,{wishlist_token:s},r],["wishlist_token"]);return await this.spreeResponse("patch",n.default.wishlistPath(a),u,i)}async remove(...e){const[t,s]=e,{wishlist_token:r,token:a,params:u}=(0,o.default)([t,{wishlist_token:s}],["wishlist_token"]);return await this.spreeResponse("delete",n.default.wishlistPath(r),a,u)}async addWishedItem(...e){const[t,s,r]=e,{wishlist_token:a,token:u,params:i}=(0,o.default)([t,{wishlist_token:s},r],["wishlist_token"]);return await this.spreeResponse("post",n.default.wishlistsAddWishedItemPath(a),u,i)}async updateWishedItem(...e){const[t,s,r,a]=e,{wishlist_token:u,id:i,token:c,params:d}=(0,o.default)([t,{wishlist_token:s},{id:r},a],["wishlist_token","id"]);return await this.spreeResponse("patch",n.default.wishlistsUpdateWishedItemQuantityPath(u,i),c,d)}async removeWishedItem(...e){const[t,s,r]=e,{wishlist_token:a,id:u,token:i,params:c}=(0,o.default)([t,{wishlist_token:s},{id:r}],["wishlist_token","id"]);return await this.spreeResponse("delete",n.default.wishlistsRemoveWishedItemPath(a,u),i,c)}}t.default=u},919:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Wishlists=t.Vendors=t.Taxons=t.Products=t.Pages=t.Order=t.Menus=t.DigitalAssets=t.Countries=t.Checkout=t.Cart=t.Authentication=t.Account=void 0;const o=r(s(993));t.Account=o.default;const a=r(s(464));t.Authentication=a.default;const n=r(s(712));t.Cart=n.default;const u=r(s(846));t.Checkout=u.default;const i=r(s(898));t.Countries=i.default;const c=r(s(847));t.DigitalAssets=c.default;const d=r(s(999));t.Menus=d.default;const l=r(s(298));t.Order=l.default;const h=r(s(995));t.Pages=h.default;const f=r(s(799));t.Products=f.default;const p=r(s(193));t.Taxons=p.default;const m=r(s(760));t.Vendors=m.default;const _=r(s(343));t.Wishlists=_.default},112:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(589));class a extends o.default{constructor(e,t){super(e),Object.setPrototypeOf(this,a.prototype),this.name="BasicSpreeError",this.summary=t}}t.default=a},583:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(e){super(e),Object.setPrototypeOf(this,a.prototype),this.name="CastError"}}t.default=a},811:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(e){super(e),Object.setPrototypeOf(this,a.prototype),this.name="DeserializeError"}}t.default=a},461:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(e){super(e),Object.setPrototypeOf(this,a.prototype),this.name="DocumentRelationshipError"}}t.default=a},957:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),s(368);const o=r(s(112));class a extends o.default{constructor(e,t,s){super(e,t),Object.setPrototypeOf(this,a.prototype),this.name="ExpandedSpreeError",this.errors=Object.keys(s).reduce(((e,t)=>{const r=t.split(".");let o=r.shift(),a=e;for(;o;)a[o]||(0===r.length?a[o]=s[t]:a[o]={}),a=a[o],o=r.shift();return e}),{})}getErrors(e){let t=0,s=this.errors,r=!0;for(;t<e.length&&r;){const o=e[t];o in Object(s)?(s=s[o],t+=1):r=!1}return r?s:null}}t.default=a},306:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(e,t,s,r){super(r),Object.setPrototypeOf(this,a.prototype),this.name="FetchError",this.response=e,this.request=t,this.data=s}}t.default=a},234:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(e){super(`Incorrect request setup: ${e}`),Object.setPrototypeOf(this,a.prototype),this.name="MisconfigurationError"}}t.default=a},815:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(){super("No response received from Spree"),Object.setPrototypeOf(this,a.prototype),this.name="NoResponseError"}}t.default=a},589:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(e){super(`Spree returned a HTTP ${e.status} error code`),Object.setPrototypeOf(this,a.prototype),this.name="SpreeError",this.serverResponse=e}}t.default=a},527:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});class s extends Error{constructor(e){super(e),Object.setPrototypeOf(this,s.prototype),this.name="SpreeSDKError"}}t.default=s},844:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentRelationshipError=t.FetchError=t.SpreeSDKError=t.SpreeError=t.NoResponseError=t.MisconfigurationError=t.ExpandedSpreeError=t.BasicSpreeError=void 0;const o=r(s(112));t.BasicSpreeError=o.default;const a=r(s(957));t.ExpandedSpreeError=a.default;const n=r(s(234));t.MisconfigurationError=n.default;const u=r(s(815));t.NoResponseError=u.default;const i=r(s(589));t.SpreeError=i.default;const c=r(s(527));t.SpreeSDKError=c.default;const d=r(s(306));t.FetchError=d.default;const l=r(s(461));t.DocumentRelationshipError=l.default},339:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.revokeParams=t.refreshParams=t.authParams=void 0,s(391),t.authParams=({username:e,password:t})=>({username:e,password:t,grant_type:"password"}),t.refreshParams=({refresh_token:e})=>({refresh_token:e,grant_type:"refresh_token"}),t.revokeParams=({token:e})=>({token:e})},644:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.findSingleRelationshipDocument=t.findRelationshipDocuments=t.findDocument=void 0;const r=s(844),o=(e,t)=>e.included&&e.included.find((e=>e.type===t.type&&e.id===t.id))||null;t.findDocument=o;const a=(e,t,s)=>{if(!e.included)return[];const a=(t.relationships[s]||{}).data;if(!a)throw new r.DocumentRelationshipError(`Incorrect relationship ${s}.`);let n;return n=Array.isArray(a)?a:[a],n.map((t=>o(e,t))).filter(Boolean)};t.findRelationshipDocuments=a,t.findSingleRelationshipDocument=(e,t,s)=>{const r=a(e,t,s);return 0===r.length?null:r[0]}},327:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.objectToQuerystring=void 0;const s=(()=>{const e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),r=(e,t)=>{if(0===e.length)return e;let r=e;if("symbol"==typeof e?r=Symbol.prototype.toString.call(e):"string"!=typeof e&&(r=String(e)),"iso-8859-1"===t)return escape(r).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));let o="";for(let e=0;e<r.length;++e){let t=r.charCodeAt(e);45===t||46===t||95===t||126===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?o+=r.charAt(e):t<128?o+=s[t]:t<2048?o+=s[192|t>>6]+s[128|63&t]:t<55296||t>=57344?o+=s[224|t>>12]+s[128|t>>6&63]+s[128|63&t]:(e+=1,t=65536+((1023&t)<<10|1023&r.charCodeAt(e)),o+=s[240|t>>18]+s[128|t>>12&63]+s[128|t>>6&63]+s[128|63&t])}return o},o=Array.isArray,a=Array.prototype.push,n=(e,t)=>{a.apply(e,o(t)?t:[t])},u=e=>String(e),i=(e,t)=>e+"[]",c="utf-8",d=(e,t)=>{var s,a;if(e instanceof Date&&(e=e.toISOString()),null===e&&(e=""),"string"==typeof(a=e)||"number"==typeof a||"boolean"==typeof a||"symbol"==typeof a||"bigint"==typeof a||(s=e)&&"object"==typeof s&&s.constructor&&s.constructor.isBuffer&&s.constructor.isBuffer(s)){const s=r(t,c);return[u(s)+"="+u(r(e,c))]}const l=[];if(void 0===e)return l;const h=Object.keys(e);for(let s=0;s<h.length;++s){const r=h[s],a=e[r],u=o(e)?i(t):t+"["+r+"]";n(l,d(a,u))}return l};t.objectToQuerystring=e=>{const t=[],s=Object.keys(e);for(let r=0;r<s.length;++r){const o=s[r];n(t,d(e[o],o))}return t.join("&")}},614:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.extractSuccess=t.fromJson=t.toJson=t.makeFail=t.makeSuccess=void 0;const u=a(s(844)),i=n(s(583)),c=n(s(811)),d=e=>({isSuccess:()=>!0,isFail:()=>!1,success:()=>e,fail:()=>{throw new Error("Cannot call fail() on success.")}});t.makeSuccess=d;const l=e=>({isSuccess:()=>!1,isFail:()=>!0,success:()=>{throw new Error("Cannot call success() on fail.")},fail:()=>e});t.makeFail=l,t.toJson=e=>e.isSuccess()?{type:"SpreeSDKResult",subtype:"success",value:e.success()}:{type:"SpreeSDKResult",subtype:"fail",value:{...e.fail()}},t.fromJson=e=>{if("SpreeSDKResult"===e.type){if("success"===e.subtype)return d(e.value);if("fail"===e.subtype)return l((e=>{if(!(e.name in u))throw new i.default("Error not recognized");return Object.assign(Object.create(u[e.name].prototype),e)})(e.value));throw new c.default("Expected success or fail subtype.")}throw new c.default("Unknown signature.")},t.extractSuccess=e=>e.then((e=>{if(e.isFail())throw e.fail();return e.success()}))},185:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.split=void 0,t.split=(e,t)=>{const s=[{},{}];for(const r in e)t.includes(r)?s[1][r]=e[r]:s[0][r]=e[r];return s},t.default=(e,s)=>{const r=Object.assign({},...e.filter(Boolean).reverse()),[o,a]=(0,t.split)(r,["order_token","bearer_token","orderToken","bearerToken"]),[n,u]=(0,t.split)(o,s);let i;return("order_token"in a&&"bearer_token"in a||"orderToken"in a&&"bearerToken"in a)&&console.warn("Avoid providing both token types (order token and bearer token) in a request to prevent unexpected results."),i="bearer_token"in a||"bearerToken"in a?{bearerToken:a.bearer_token||a.bearerToken}:"order_token"in a||"orderToken"in a?{orderToken:a.order_token||a.orderToken}:{},{token:i,...u,params:n}}},341:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.request=t.jsonApi=t.storefrontPath=t.routes=t.endpoints=t.makeClient=t.errors=t.result=t.Http=t.Client=void 0;const u=n(s(390));t.Client=u.default;const i=a(s(844));t.errors=i;const c=a(s(614));t.result=c;const d=a(s(644));t.jsonApi=d;const l=a(s(327));t.request=l;const h=n(s(759));t.Http=h.default;const f=a(s(319));t.routes=f.default,Object.defineProperty(t,"storefrontPath",{enumerable:!0,get:function(){return f.storefrontPath}});const p=a(s(919));t.endpoints=p;const m=n(s(664));t.makeClient=m.default},391:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),s(921)},159:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},921:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},368:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},664:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(390));t.default=e=>new o.default(e)},319:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.storefrontPath=void 0,t.storefrontPath="api/v2/storefront";const s={productsPath:()=>`${t.storefrontPath}/products`,productPath:e=>`${t.storefrontPath}/products/${encodeURIComponent(e)}`,taxonsPath:()=>`${t.storefrontPath}/taxons`,taxonPath:e=>`${t.storefrontPath}/taxons/${encodeURIComponent(e)}`,countriesPath:()=>`${t.storefrontPath}/countries`,countryPath:e=>`${t.storefrontPath}/countries/${encodeURIComponent(e)}`,cartPath:()=>`${t.storefrontPath}/cart`,cartAddItemPath:()=>`${t.storefrontPath}/cart/add_item`,cartRemoveItemPath:e=>`${t.storefrontPath}/cart/remove_line_item/${encodeURIComponent(e)}`,cartEmptyPath:()=>`${t.storefrontPath}/cart/empty`,cartSetItemQuantity:()=>`${t.storefrontPath}/cart/set_quantity`,cartApplyCodePath:()=>`${t.storefrontPath}/cart/apply_coupon_code`,cartRemoveCodePath:e=>`${t.storefrontPath}/cart/remove_coupon_code/${encodeURIComponent(e)}`,cartRemoveAllCoupons:()=>`${t.storefrontPath}/cart/remove_coupon_code`,cartEstimateShippingMethodsPath:()=>`${t.storefrontPath}/cart/estimate_shipping_rates`,cartEstimateShippingRatesPath:()=>`${t.storefrontPath}/cart/estimate_shipping_rates`,cartAssociatePath:()=>`${t.storefrontPath}/cart/associate`,cartChangeCurrencyPath:()=>`${t.storefrontPath}/cart/change_currency`,checkoutPath:()=>`${t.storefrontPath}/checkout`,checkoutNextPath:()=>`${t.storefrontPath}/checkout/next`,checkoutAdvancePath:()=>`${t.storefrontPath}/checkout/advance`,checkoutCompletePath:()=>`${t.storefrontPath}/checkout/complete`,checkoutAddStoreCreditsPath:()=>`${t.storefrontPath}/checkout/add_store_credit`,checkoutRemoveStoreCreditsPath:()=>`${t.storefrontPath}/checkout/remove_store_credit`,checkoutPaymentMethodsPath:()=>`${t.storefrontPath}/checkout/payment_methods`,checkoutShippingMethodsPath:()=>`${t.storefrontPath}/checkout/shipping_rates`,checkoutShippingRatesPath:()=>`${t.storefrontPath}/checkout/shipping_rates`,checkoutSelectShippingMethodPath:()=>`${t.storefrontPath}/checkout/select_shipping_method`,checkoutAddPaymentPath:()=>`${t.storefrontPath}/checkout/create_payment`,checkoutCreateStripeSessionPath:()=>`${t.storefrontPath}/checkout/create_stripe_session`,oauthTokenPath:()=>"spree_oauth/token",oauthRevokePath:()=>"spree_oauth/revoke",accountPath:()=>`${t.storefrontPath}/account`,accountAddressPath:e=>`${t.storefrontPath}/account/addresses/${encodeURIComponent(e)}`,accountAddressesPath:()=>`${t.storefrontPath}/account/addresses`,accountAddressRemovePath:e=>`${t.storefrontPath}/account/addresses/${encodeURIComponent(e)}`,accountConfirmPath:e=>`${t.storefrontPath}/account_confirmations/${encodeURIComponent(e)}`,accountCreditCardsPath:()=>`${t.storefrontPath}/account/credit_cards`,accountDefaultCreditCardPath:()=>`${t.storefrontPath}/account/credit_cards/default`,accountCreditCardRemovePath:e=>`${t.storefrontPath}/account/credit_cards/${encodeURIComponent(e)}`,accountCompletedOrdersPath:()=>`${t.storefrontPath}/account/orders`,accountCompletedOrderPath:e=>`${t.storefrontPath}/account/orders/${encodeURIComponent(e)}`,forgotPasswordPath:()=>`${t.storefrontPath}/passwords`,resetPasswordPath:e=>`${t.storefrontPath}/passwords/${encodeURIComponent(e)}`,orderStatusPath:e=>`${t.storefrontPath}/order_status/${encodeURIComponent(e)}`,pagesPath:()=>`${t.storefrontPath}/cms_pages`,pagePath:e=>`${t.storefrontPath}/cms_pages/${encodeURIComponent(e)}`,defaultCountryPath:()=>`${t.storefrontPath}/countries/default`,digitalAssetsDownloadPath:e=>`${t.storefrontPath}/digitals/${encodeURIComponent(e)}`,menusPath:()=>`${t.storefrontPath}/menus`,menuPath:e=>`${t.storefrontPath}/menus/${encodeURIComponent(e)}`,wishlistsPath:()=>`${t.storefrontPath}/wishlists`,wishlistPath:e=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}`,defaultWishlistPath:()=>`${t.storefrontPath}/wishlists/default`,wishlistsAddWishedItemPath:e=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}/add_item`,wishlistsUpdateWishedItemQuantityPath:(e,s)=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}/set_item_quantity/${encodeURIComponent(s)}`,wishlistsRemoveWishedItemPath:(e,s)=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}/remove_item/${encodeURIComponent(s)}`,vendorsPath:()=>`${t.storefrontPath}/vendors`,vendorPath:e=>`${t.storefrontPath}/vendors/${encodeURIComponent(e)}`};t.default=s}},t={};return function s(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,s),a.exports}(341)})()}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SpreeSDK=t():e.SpreeSDK=t()}(global,(function(){return(()=>{"use strict";var e={390:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=s(919);t.default=class{constructor(e){const t={host:globalThis.process&&globalThis.process.env.SPREE_HOST||"http://localhost:3000/",...e},s={host:t.host};this.fetcher=t.createFetcher(s),this.addEndpoints()}addEndpoints(){this.account=this.makeAccount(),this.authentication=this.makeAuthentication(),this.cart=this.makeCart(),this.checkout=this.makeCheckout(),this.countries=this.makeCountries(),this.digitalAssets=this.makeDigitalAssets(),this.menus=this.makeMenus(),this.order=this.makeOrder(),this.pages=this.makePages(),this.products=this.makeProducts(),this.taxons=this.makeTaxons(),this.vendors=this.makeVendors(),this.wishlists=this.makeWishlists()}makeAccount(){return new r.Account({fetcher:this.fetcher})}makeAuthentication(){return new r.Authentication({fetcher:this.fetcher})}makeCart(){return new r.Cart({fetcher:this.fetcher})}makeCheckout(){return new r.Checkout({fetcher:this.fetcher})}makeCountries(){return new r.Countries({fetcher:this.fetcher})}makeOrder(){return new r.Order({fetcher:this.fetcher})}makePages(){return new r.Pages({fetcher:this.fetcher})}makeProducts(){return new r.Products({fetcher:this.fetcher})}makeTaxons(){return new r.Taxons({fetcher:this.fetcher})}makeDigitalAssets(){return new r.DigitalAssets({fetcher:this.fetcher})}makeMenus(){return new r.Menus({fetcher:this.fetcher})}makeVendors(){return new r.Vendors({fetcher:this.fetcher})}makeWishlists(){return new r.Wishlists({fetcher:this.fetcher})}}},759:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=s(844),i=n(s(306)),c=a(s(614));t.default=class{constructor({fetcher:e}){this.fetcher=e}async spreeResponse(e,t,s={},r={},o="automatic"){try{const a={url:t,params:r,method:e,headers:this.spreeOrderHeaders(s),responseParsing:o},n=await this.fetcher.fetch(a);return c.makeSuccess(n.data)}catch(e){return c.makeFail(this.processError(e))}}classifySpreeError(e){const{error:t,errors:s}=e.data;return"string"==typeof t?"object"==typeof s?"full":"basic":"limited"}processError(e){return e instanceof i.default?e.response?this.processSpreeError(e):e.request?new u.NoResponseError:new u.MisconfigurationError(e.message):new u.SpreeSDKError(e.message)}processSpreeError(e){const{error:t,errors:s}=e.data,r=this.classifySpreeError(e);return"full"===r?new u.ExpandedSpreeError(e.response,t,s):"basic"===r?new u.BasicSpreeError(e.response,t):new u.SpreeError(e.response)}spreeOrderHeaders(e){const t={};return e.orderToken&&(t["X-Spree-Order-Token"]=e.orderToken),e.bearerToken&&(t.Authorization=`Bearer ${e.bearerToken}`),t}}},993:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async accountInfo(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.accountPath(),r,a)}async creditCardsList(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.accountCreditCardsPath(),r,a)}async defaultCreditCard(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.accountDefaultCreditCardPath(),r,a)}async removeCreditCard(...e){const[t,s,r={}]=e,{id:a,token:u,params:i}=(0,o.default)([{id:s},t,r],["id"]);return await this.spreeResponse("delete",n.default.accountCreditCardRemovePath(a),u,i)}async completedOrdersList(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.accountCompletedOrdersPath(),r,a)}async completedOrder(...e){const[t,s,r={}]=e,{order_number:a,token:u,params:i}=(0,o.default)([{order_number:s},t,r],["order_number"]);return await this.spreeResponse("get",n.default.accountCompletedOrderPath(a),u,i)}async create(...e){const[t={}]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("post",n.default.accountPath(),s,r)}async confirm(...e){const[t]=e,{confirmation_token:s,token:r,params:a}=(0,o.default)(["object"==typeof t?t:{confirmation_token:t}],["confirmation_token"]);return await this.spreeResponse("get",n.default.accountConfirmPath(s),r,a)}async forgotPassword(...e){const[t]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("post",n.default.forgotPasswordPath(),s,r)}async resetPassword(...e){const[t,s]=e,{reset_password_token:r,token:a,params:u}=(0,o.default)(["object"==typeof t?t:{resetPasswordToken:t},s],["reset_password_token"]);return await this.spreeResponse("patch",n.default.resetPasswordPath(r),a,u)}async update(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("patch",n.default.accountPath(),r,a)}async addressesList(...e){const[t]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("get",n.default.accountAddressesPath(),s,r)}async showAddress(...e){const[t,s,r={}]=e,{id:a,token:u,params:i}=(0,o.default)([{id:s},t,r],["id"]);return await this.spreeResponse("get",n.default.accountAddressPath(a),u,i)}async createAddress(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("post",n.default.accountAddressesPath(),r,a)}async removeAddress(...e){const[t,s,r={}]=e,{id:a,token:u,params:i}=(0,o.default)([{id:s},t,r],["id"]);return await this.spreeResponse("delete",n.default.accountAddressRemovePath(a),u,i)}async updateAddress(...e){const[t,s,r]=e,{id:a,token:u,params:i}=(0,o.default)([{id:s},t,r],["id"]);return await this.spreeResponse("patch",n.default.accountAddressPath(a),u,i)}}t.default=u},464:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=s(339),a=r(s(759)),n=r(s(319)),u=r(s(185));class i extends a.default{async getToken(...e){const[t]=e,{token:s,params:r}=(0,u.default)([t],[]);return await this.spreeResponse("post",n.default.oauthTokenPath(),s,(0,o.authParams)(r))}async refreshToken(...e){const[t]=e,{token:s,params:r}=(0,u.default)([t],[]);return await this.spreeResponse("post",n.default.oauthTokenPath(),s,(0,o.refreshParams)(r))}async revokeToken(...e){const[t]=e,{token:s,params:r}=(0,u.default)([t],[]);return await this.spreeResponse("post",n.default.oauthRevokePath(),s,(0,o.revokeParams)(r))}}t.default=i},712:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(759)),a=r(s(319)),n=r(s(185));class u extends o.default{async show(...e){const[t,s={}]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("get",a.default.cartPath(),r,o)}async create(...e){const[t={},s={}]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("post",a.default.cartPath(),r,o)}async addItem(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("post",a.default.cartAddItemPath(),r,o)}async removeItem(...e){const[t,s,r={}]=e,{id:o,token:u,params:i}=(0,n.default)([{id:s},t,r],["id"]);return await this.spreeResponse("delete",a.default.cartRemoveItemPath(o),u,i)}async emptyCart(...e){const[t,s={}]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("patch",a.default.cartEmptyPath(),r,o)}async remove(...e){const[t]=e,{token:s,params:r}=(0,n.default)([t],[]);return await this.spreeResponse("delete",a.default.cartPath(),s,r)}async setQuantity(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("patch",a.default.cartSetItemQuantity(),r,o)}async applyCouponCode(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("patch",a.default.cartApplyCodePath(),r,o)}async removeCouponCode(...e){const[t,s=null,r={}]=e,{code:o,token:u,params:i}=(0,n.default)([{code:s},t,r],["code"]);let c;return c=o?a.default.cartRemoveCodePath(o):a.default.cartRemoveAllCoupons(),await this.spreeResponse("delete",c,u,i)}async removeAllCoupons(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("delete",a.default.cartRemoveAllCoupons(),r,o)}async estimateShippingMethods(e,t){return await this.spreeResponse("get",a.default.cartEstimateShippingMethodsPath(),e,t)}async estimateShippingRates(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("get",a.default.cartEstimateShippingRatesPath(),r,o)}async associateGuestCart(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("patch",a.default.cartAssociatePath(),r,o)}async changeCurrency(...e){const[t,s]=e,{token:r,params:o}=(0,n.default)([t,s],[]);return await this.spreeResponse("patch",a.default.cartChangeCurrencyPath(),r,o)}}t.default=u},846:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759));s(159);const n=r(s(319));class u extends a.default{async orderNext(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("patch",n.default.checkoutNextPath(),r,a)}async orderUpdate(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("patch",n.default.checkoutPath(),r,a)}async advance(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("patch",n.default.checkoutAdvancePath(),r,a)}async complete(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("patch",n.default.checkoutCompletePath(),r,a)}async addStoreCredits(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("post",n.default.checkoutAddStoreCreditsPath(),r,a)}async removeStoreCredits(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("post",n.default.checkoutRemoveStoreCreditsPath(),r,a)}async paymentMethods(...e){const[t]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("get",n.default.checkoutPaymentMethodsPath(),s,r)}async shippingMethods(e,t={}){return await this.spreeResponse("get",n.default.checkoutShippingMethodsPath(),e,t)}async shippingRates(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.checkoutShippingRatesPath(),r,a)}async selectShippingMethod(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("patch",n.default.checkoutSelectShippingMethodPath(),r,a)}async addPayment(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("post",n.default.checkoutAddPaymentPath(),r,a)}async createStripeSession(e){const{token:t,params:s}=(0,o.default)([e],[]);return await this.spreeResponse("patch",n.default.checkoutCreateStripeSessionPath(),t,s)}}t.default=u},898:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(e){const{token:t,params:s}=(0,o.default)([e||{}],[]);return await this.spreeResponse("get",n.default.countriesPath(),t,s)}async show(...e){const[t,s={}]=e,{iso:r,token:a,params:u}=(0,o.default)(["object"==typeof t?t:{iso:t},s],["iso"]);return await this.spreeResponse("get",n.default.countryPath(r),a,u)}async default(...e){const[t={}]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("get",n.default.defaultCountryPath(),s,r)}}t.default=u},847:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(759)),a=r(s(319)),n=r(s(185));class u extends o.default{async download(...e){const[t,s,r={}]=e,{asset_token:o,token:u,params:i}=(0,n.default)([t,{asset_token:s},r],["asset_token"]);return await this.spreeResponse("get",a.default.digitalAssetsDownloadPath(o),u,i,"stream")}}t.default=u},999:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(...e){const[t={}]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("get",n.default.menusPath(),s,r)}async show(...e){const[t,s={}]=e,{id:r,token:a,params:u}=(0,o.default)(["object"==typeof t?t:{id:t},s],["id"]);return await this.spreeResponse("get",n.default.menuPath(r),a,u)}}t.default=u},298:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async status(...e){const[t,s,r={}]=e,{order_number:a,token:u,params:i}=(0,o.default)([t,{order_number:s},r],["order_number"]);return await this.spreeResponse("get",n.default.orderStatusPath(a),u,i)}}t.default=u},995:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(...e){const[t={}]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("get",n.default.pagesPath(),s,r)}async show(...e){const[t,s={}]=e,{id:r,token:a,params:u}=(0,o.default)(["object"==typeof t?t:{id:t},s],["id"]);return await this.spreeResponse("get",n.default.pagePath(r),a,u)}}t.default=u},799:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(...e){const[t={},s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.productsPath(),r,a)}async show(...e){const[t,s={},r={}]=e,{id:a,token:u,params:i}=(0,o.default)(["object"==typeof t?t:{id:t},s,r],["id"]);return await this.spreeResponse("get",n.default.productPath(a),u,i)}}t.default=u},193:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(...e){const[t={}]=e,{token:s,params:r}=(0,o.default)([t],[]);return await this.spreeResponse("get",n.default.taxonsPath(),s,r)}async show(...e){const[t,s={}]=e,{id:r,token:a,params:u}=(0,o.default)(["object"==typeof t?t:{id:t},s],["id"]);return await this.spreeResponse("get",n.default.taxonPath(r),a,u)}}t.default=u},760:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(e={}){const{token:t,params:s}=(0,o.default)([e],[]);return await this.spreeResponse("get",n.default.vendorsPath(),t,s)}async show(e){const{id:t,token:s,params:r}=(0,o.default)([e],["id"]);return await this.spreeResponse("get",n.default.vendorPath(t),s,r)}}t.default=u},343:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(185)),a=r(s(759)),n=r(s(319));class u extends a.default{async list(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.wishlistsPath(),r,a)}async show(...e){const[t,s,r={}]=e,{wishlist_token:a,token:u,params:i}=(0,o.default)([t,{wishlist_token:s},r],["wishlist_token"]);return await this.spreeResponse("get",n.default.wishlistPath(a),u,i)}async default(...e){const[t,s={}]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("get",n.default.defaultWishlistPath(),r,a)}async create(...e){const[t,s]=e,{token:r,params:a}=(0,o.default)([t,s],[]);return await this.spreeResponse("post",n.default.wishlistsPath(),r,a)}async update(...e){const[t,s,r]=e,{wishlist_token:a,token:u,params:i}=(0,o.default)([t,{wishlist_token:s},r],["wishlist_token"]);return await this.spreeResponse("patch",n.default.wishlistPath(a),u,i)}async remove(...e){const[t,s]=e,{wishlist_token:r,token:a,params:u}=(0,o.default)([t,{wishlist_token:s}],["wishlist_token"]);return await this.spreeResponse("delete",n.default.wishlistPath(r),a,u)}async addWishedItem(...e){const[t,s,r]=e,{wishlist_token:a,token:u,params:i}=(0,o.default)([t,{wishlist_token:s},r],["wishlist_token"]);return await this.spreeResponse("post",n.default.wishlistsAddWishedItemPath(a),u,i)}async updateWishedItem(...e){const[t,s,r,a]=e,{wishlist_token:u,id:i,token:c,params:d}=(0,o.default)([t,{wishlist_token:s},{id:r},a],["wishlist_token","id"]);return await this.spreeResponse("patch",n.default.wishlistsUpdateWishedItemQuantityPath(u,i),c,d)}async removeWishedItem(...e){const[t,s,r]=e,{wishlist_token:a,id:u,token:i,params:c}=(0,o.default)([t,{wishlist_token:s},{id:r}],["wishlist_token","id"]);return await this.spreeResponse("delete",n.default.wishlistsRemoveWishedItemPath(a,u),i,c)}}t.default=u},919:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Wishlists=t.Vendors=t.Taxons=t.Products=t.Pages=t.Order=t.Menus=t.DigitalAssets=t.Countries=t.Checkout=t.Cart=t.Authentication=t.Account=void 0;const o=r(s(993));t.Account=o.default;const a=r(s(464));t.Authentication=a.default;const n=r(s(712));t.Cart=n.default;const u=r(s(846));t.Checkout=u.default;const i=r(s(898));t.Countries=i.default;const c=r(s(847));t.DigitalAssets=c.default;const d=r(s(999));t.Menus=d.default;const l=r(s(298));t.Order=l.default;const h=r(s(995));t.Pages=h.default;const f=r(s(799));t.Products=f.default;const p=r(s(193));t.Taxons=p.default;const m=r(s(760));t.Vendors=m.default;const _=r(s(343));t.Wishlists=_.default},112:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(589));class a extends o.default{constructor(e,t){super(e),Object.setPrototypeOf(this,a.prototype),this.name="BasicSpreeError",this.summary=t}}t.default=a},583:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(e){super(e),Object.setPrototypeOf(this,a.prototype),this.name="CastError"}}t.default=a},811:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(e){super(e),Object.setPrototypeOf(this,a.prototype),this.name="DeserializeError"}}t.default=a},461:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(e){super(e),Object.setPrototypeOf(this,a.prototype),this.name="DocumentRelationshipError"}}t.default=a},957:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),s(368);const o=r(s(112));class a extends o.default{constructor(e,t,s){super(e,t),Object.setPrototypeOf(this,a.prototype),this.name="ExpandedSpreeError",this.errors=Object.keys(s).reduce(((e,t)=>{const r=t.split(".");let o=r.shift(),a=e;for(;o;)a[o]||(0===r.length?a[o]=s[t]:a[o]={}),a=a[o],o=r.shift();return e}),{})}getErrors(e){let t=0,s=this.errors,r=!0;for(;t<e.length&&r;){const o=e[t];o in Object(s)?(s=s[o],t+=1):r=!1}return r?s:null}}t.default=a},306:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(e,t,s,r){super(r),Object.setPrototypeOf(this,a.prototype),this.name="FetchError",this.response=e,this.request=t,this.data=s}}t.default=a},234:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(e){super(`Incorrect request setup: ${e}`),Object.setPrototypeOf(this,a.prototype),this.name="MisconfigurationError"}}t.default=a},815:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(){super("No response received from Spree"),Object.setPrototypeOf(this,a.prototype),this.name="NoResponseError"}}t.default=a},589:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(527));class a extends o.default{constructor(e){super(`Spree returned a HTTP ${e.status} error code`),Object.setPrototypeOf(this,a.prototype),this.name="SpreeError",this.serverResponse=e}}t.default=a},527:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});class s extends Error{constructor(e){super(e),Object.setPrototypeOf(this,s.prototype),this.name="SpreeSDKError"}}t.default=s},844:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentRelationshipError=t.FetchError=t.SpreeSDKError=t.SpreeError=t.NoResponseError=t.MisconfigurationError=t.ExpandedSpreeError=t.BasicSpreeError=void 0;const o=r(s(112));t.BasicSpreeError=o.default;const a=r(s(957));t.ExpandedSpreeError=a.default;const n=r(s(234));t.MisconfigurationError=n.default;const u=r(s(815));t.NoResponseError=u.default;const i=r(s(589));t.SpreeError=i.default;const c=r(s(527));t.SpreeSDKError=c.default;const d=r(s(306));t.FetchError=d.default;const l=r(s(461));t.DocumentRelationshipError=l.default},339:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.revokeParams=t.refreshParams=t.authParams=void 0,s(391),t.authParams=({username:e,password:t})=>({username:e,password:t,grant_type:"password"}),t.refreshParams=({refresh_token:e})=>({refresh_token:e,grant_type:"refresh_token"}),t.revokeParams=({token:e})=>({token:e})},644:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.findSingleRelationshipDocument=t.findRelationshipDocuments=t.findDocument=void 0;const r=s(844),o=(e,t)=>e.included&&e.included.find((e=>e.type===t.type&&e.id===t.id))||null;t.findDocument=o;const a=(e,t,s)=>{if(!e.included)return[];const a=(t.relationships[s]||{}).data;if(!a)throw new r.DocumentRelationshipError(`Incorrect relationship ${s}.`);let n;return n=Array.isArray(a)?a:[a],n.map((t=>o(e,t))).filter(Boolean)};t.findRelationshipDocuments=a,t.findSingleRelationshipDocument=(e,t,s)=>{const r=a(e,t,s);return 0===r.length?null:r[0]}},327:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.objectToQuerystring=void 0;const s=(()=>{const e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),r=(e,t)=>{if(0===e.length)return e;let r=e;if("symbol"==typeof e?r=Symbol.prototype.toString.call(e):"string"!=typeof e&&(r=String(e)),"iso-8859-1"===t)return escape(r).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));let o="";for(let e=0;e<r.length;++e){let t=r.charCodeAt(e);45===t||46===t||95===t||126===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?o+=r.charAt(e):t<128?o+=s[t]:t<2048?o+=s[192|t>>6]+s[128|63&t]:t<55296||t>=57344?o+=s[224|t>>12]+s[128|t>>6&63]+s[128|63&t]:(e+=1,t=65536+((1023&t)<<10|1023&r.charCodeAt(e)),o+=s[240|t>>18]+s[128|t>>12&63]+s[128|t>>6&63]+s[128|63&t])}return o},o=Array.isArray,a=Array.prototype.push,n=(e,t)=>{a.apply(e,o(t)?t:[t])},u=e=>String(e),i=(e,t)=>e+"[]",c="utf-8",d=(e,t)=>{var s,a;if(e instanceof Date&&(e=e.toISOString()),null===e&&(e=""),"string"==typeof(a=e)||"number"==typeof a||"boolean"==typeof a||"symbol"==typeof a||"bigint"==typeof a||(s=e)&&"object"==typeof s&&s.constructor&&s.constructor.isBuffer&&s.constructor.isBuffer(s)){const s=r(t,c);return[u(s)+"="+u(r(e,c))]}const l=[];if(void 0===e)return l;const h=Object.keys(e);for(let s=0;s<h.length;++s){const r=h[s],a=e[r],u=o(e)?i(t):t+"["+r+"]";n(l,d(a,u))}return l};t.objectToQuerystring=e=>{const t=[],s=Object.keys(e);for(let r=0;r<s.length;++r){const o=s[r];n(t,d(e[o],o))}return t.join("&")}},614:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.extractSuccess=t.fromJson=t.toJson=t.makeFail=t.makeSuccess=void 0;const u=a(s(844)),i=n(s(583)),c=n(s(811)),d=e=>({isSuccess:()=>!0,isFail:()=>!1,success:()=>e,fail:()=>{throw new Error("Cannot call fail() on success.")}});t.makeSuccess=d;const l=e=>({isSuccess:()=>!1,isFail:()=>!0,success:()=>{throw new Error("Cannot call success() on fail.")},fail:()=>e});t.makeFail=l,t.toJson=e=>e.isSuccess()?{type:"SpreeSDKResult",subtype:"success",value:e.success()}:{type:"SpreeSDKResult",subtype:"fail",value:{...e.fail()}},t.fromJson=e=>{if("SpreeSDKResult"===e.type){if("success"===e.subtype)return d(e.value);if("fail"===e.subtype)return l((e=>{if(!(e.name in u))throw new i.default("Error not recognized");return Object.assign(Object.create(u[e.name].prototype),e)})(e.value));throw new c.default("Expected success or fail subtype.")}throw new c.default("Unknown signature.")},t.extractSuccess=e=>e.then((e=>{if(e.isFail())throw e.fail();return e.success()}))},185:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.split=void 0,t.split=(e,t)=>{const s=[{},{}];for(const r in e)t.includes(r)?s[1][r]=e[r]:s[0][r]=e[r];return s},t.default=(e,s)=>{const r=Object.assign({},...e.filter(Boolean).reverse()),[o,a]=(0,t.split)(r,["order_token","bearer_token","orderToken","bearerToken"]),[n,u]=(0,t.split)(o,s);let i;return("order_token"in a&&"bearer_token"in a||"orderToken"in a&&"bearerToken"in a)&&console.warn("Avoid providing both token types (order token and bearer token) in a request to prevent unexpected results."),i="bearer_token"in a||"bearerToken"in a?{bearerToken:a.bearer_token||a.bearerToken}:"order_token"in a||"orderToken"in a?{orderToken:a.order_token||a.orderToken}:{},{token:i,...u,params:n}}},341:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[s]}})}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.request=t.jsonApi=t.storefrontPath=t.routes=t.endpoints=t.makeClient=t.errors=t.result=t.Http=t.Client=void 0;const u=n(s(390));t.Client=u.default;const i=a(s(844));t.errors=i;const c=a(s(614));t.result=c;const d=a(s(644));t.jsonApi=d;const l=a(s(327));t.request=l;const h=n(s(759));t.Http=h.default;const f=a(s(319));t.routes=f.default,Object.defineProperty(t,"storefrontPath",{enumerable:!0,get:function(){return f.storefrontPath}});const p=a(s(919));t.endpoints=p;const m=n(s(664));t.makeClient=m.default},391:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),s(921)},159:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},921:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},368:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},664:function(e,t,s){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(s(390));t.default=e=>new o.default(e)},319:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.storefrontPath=void 0,t.storefrontPath="api/v2/storefront";const s={productsPath:()=>`${t.storefrontPath}/products`,productPath:e=>`${t.storefrontPath}/products/${encodeURIComponent(e)}`,taxonsPath:()=>`${t.storefrontPath}/taxons`,taxonPath:e=>`${t.storefrontPath}/taxons/${encodeURIComponent(e)}`,countriesPath:()=>`${t.storefrontPath}/countries`,countryPath:e=>`${t.storefrontPath}/countries/${encodeURIComponent(e)}`,cartPath:()=>`${t.storefrontPath}/cart`,cartAddItemPath:()=>`${t.storefrontPath}/cart/add_item`,cartRemoveItemPath:e=>`${t.storefrontPath}/cart/remove_line_item/${encodeURIComponent(e)}`,cartEmptyPath:()=>`${t.storefrontPath}/cart/empty`,cartSetItemQuantity:()=>`${t.storefrontPath}/cart/set_quantity`,cartApplyCodePath:()=>`${t.storefrontPath}/cart/apply_coupon_code`,cartRemoveCodePath:e=>`${t.storefrontPath}/cart/remove_coupon_code/${encodeURIComponent(e)}`,cartRemoveAllCoupons:()=>`${t.storefrontPath}/cart/remove_coupon_code`,cartEstimateShippingMethodsPath:()=>`${t.storefrontPath}/cart/estimate_shipping_rates`,cartEstimateShippingRatesPath:()=>`${t.storefrontPath}/cart/estimate_shipping_rates`,cartAssociatePath:()=>`${t.storefrontPath}/cart/associate`,cartChangeCurrencyPath:()=>`${t.storefrontPath}/cart/change_currency`,checkoutPath:()=>`${t.storefrontPath}/checkout`,checkoutNextPath:()=>`${t.storefrontPath}/checkout/next`,checkoutAdvancePath:()=>`${t.storefrontPath}/checkout/advance`,checkoutCompletePath:()=>`${t.storefrontPath}/checkout/complete`,checkoutAddStoreCreditsPath:()=>`${t.storefrontPath}/checkout/add_store_credit`,checkoutRemoveStoreCreditsPath:()=>`${t.storefrontPath}/checkout/remove_store_credit`,checkoutPaymentMethodsPath:()=>`${t.storefrontPath}/checkout/payment_methods`,checkoutShippingMethodsPath:()=>`${t.storefrontPath}/checkout/shipping_rates`,checkoutShippingRatesPath:()=>`${t.storefrontPath}/checkout/shipping_rates`,checkoutSelectShippingMethodPath:()=>`${t.storefrontPath}/checkout/select_shipping_method`,checkoutAddPaymentPath:()=>`${t.storefrontPath}/checkout/create_payment`,checkoutCreateStripeSessionPath:()=>`${t.storefrontPath}/checkout/create_stripe_session`,oauthTokenPath:()=>"spree_oauth/token",oauthRevokePath:()=>"spree_oauth/revoke",accountPath:()=>`${t.storefrontPath}/account`,accountAddressPath:e=>`${t.storefrontPath}/account/addresses/${encodeURIComponent(e)}`,accountAddressesPath:()=>`${t.storefrontPath}/account/addresses`,accountAddressRemovePath:e=>`${t.storefrontPath}/account/addresses/${encodeURIComponent(e)}`,accountConfirmPath:e=>`${t.storefrontPath}/account_confirmations/${encodeURIComponent(e)}`,accountCreditCardsPath:()=>`${t.storefrontPath}/account/credit_cards`,accountDefaultCreditCardPath:()=>`${t.storefrontPath}/account/credit_cards/default`,accountCreditCardRemovePath:e=>`${t.storefrontPath}/account/credit_cards/${encodeURIComponent(e)}`,accountCompletedOrdersPath:()=>`${t.storefrontPath}/account/orders`,accountCompletedOrderPath:e=>`${t.storefrontPath}/account/orders/${encodeURIComponent(e)}`,forgotPasswordPath:()=>`${t.storefrontPath}/passwords`,resetPasswordPath:e=>`${t.storefrontPath}/passwords/${encodeURIComponent(e)}`,orderStatusPath:e=>`${t.storefrontPath}/order_status/${encodeURIComponent(e)}`,pagesPath:()=>`${t.storefrontPath}/cms_pages`,pagePath:e=>`${t.storefrontPath}/cms_pages/${encodeURIComponent(e)}`,defaultCountryPath:()=>`${t.storefrontPath}/countries/default`,digitalAssetsDownloadPath:e=>`${t.storefrontPath}/digitals/${encodeURIComponent(e)}`,menusPath:()=>`${t.storefrontPath}/menus`,menuPath:e=>`${t.storefrontPath}/menus/${encodeURIComponent(e)}`,wishlistsPath:()=>`${t.storefrontPath}/wishlists`,wishlistPath:e=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}`,defaultWishlistPath:()=>`${t.storefrontPath}/wishlists/default`,wishlistsAddWishedItemPath:e=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}/add_item`,wishlistsUpdateWishedItemQuantityPath:(e,s)=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}/set_item_quantity/${encodeURIComponent(s)}`,wishlistsRemoveWishedItemPath:(e,s)=>`${t.storefrontPath}/wishlists/${encodeURIComponent(e)}/remove_item/${encodeURIComponent(s)}`,vendorsPath:()=>`${t.storefrontPath}/vendors`,vendorPath:e=>`${t.storefrontPath}/vendors/${encodeURIComponent(e)}`};t.default=s}},t={};return function s(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,s),a.exports}(341)})()}));
//# sourceMappingURL=index.js.map
{
"name": "@spree/storefront-api-v2-sdk",
"version": "5.1.2",
"version": "5.1.3",
"description": "Node module to easily integrate your JavaScript or TypeScript application with Spree API V2. You can create an entirely custom Storefront in JS/TS with this package including one page checkout, Single Page Apps, PWAs and so on",

@@ -5,0 +5,0 @@ "engines": {

@@ -34,5 +34,5 @@ import squashAndPreparePositionalArguments from '../helpers/squashAndPreparePositionalArguments'

public async show(...allArguments: any[]): Promise<IProductResult> {
const [positionalId, positionalToken = {}, positionalParams = {}] = allArguments
const [idOrOptions, positionalToken = {}, positionalParams = {}] = allArguments
const { id, token, params } = squashAndPreparePositionalArguments(
[{ id: positionalId }, positionalToken, positionalParams],
[typeof idOrOptions === 'object' ? idOrOptions : { id: idOrOptions }, positionalToken, positionalParams],
['id']

@@ -39,0 +39,0 @@ )

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc