@ikas/storefront 5.0.18 → 5.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/checkout/components/cart-summary/index.js +1 -1
- package/build/components/checkout/components/expandable-section/index.d.ts +1 -0
- package/build/components/checkout/components/expandable-section/index.js +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +2 -0
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/steps/step-payment/index.js +1 -1
- package/build/components/checkout/steps/step-payment/style.module.scss.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/components/page/index.js +1 -1
- package/build/components/popup/index.js +1 -1
- package/build/components/popup/renderer/index.js +1 -1
- package/build/components/popup/utils/index.js +1 -1
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/button-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/divider-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/date-item-view/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/gender-item-view/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-column-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/product-list-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/social-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/space-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/text-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js +1 -0
- package/build/models/data/checkout/index.d.ts +0 -3
- package/build/models/data/checkout/index.js +1 -1
- package/build/models/data/payment-gateway/index.d.ts +0 -6
- package/build/models/data/payment-gateway/index.js +1 -1
- package/build/models/data/storefront-popup/index.d.ts +1 -0
- package/build/models/data/storefront-popup/index.js +1 -1
- package/build/models/ui/validator/form/ikas-address.js +1 -1
- package/build/store/customer/api.d.ts +3 -1
- package/build/store/customer/api.js +1 -1
- package/build/store/customer/index.d.ts +3 -0
- package/build/store/customer/index.js +1 -1
- package/package.json +12 -12
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/button-element-renderer/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/divider-element-renderer/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/date-item-view/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/gender-item-view/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/image-column-element-renderer/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/image-element-renderer/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/product-list-renderer/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/social-element-renderer/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/space-element-renderer/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/text-element-renderer/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js +0 -1
- package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js +0 -1
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouType.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.complete.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.util.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeParser.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeState.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/ParseError.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/PhoneNumber.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/PhoneNumberMatcher.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/constants.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/LRUCache.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/Leniency.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/RegExpCache.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/isValidCandidate.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/isValidPreCandidate.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/parsePreCandidate.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/utf-8.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/util.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/format.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/RFC3966.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/checkNumberLength.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extension/extractExtension.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractNationalNumber.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractPhoneContext.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getIddPrefix.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getNumberType.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/isObject.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/matchesEntirely.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/mergeArrays.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/parseDigits.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/stripIddPrefix.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/isPossible.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/isValid.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/isValidPhoneNumber.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/legacy/findPhoneNumbersInitialImplementation.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/metadata.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/normalizeArguments.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parse.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parseIncompletePhoneNumber.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parsePhoneNumber.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parsePhoneNumberWithError_.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parsePhoneNumber_.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/tools/semver-compare.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/index.es6.exports/PhoneNumberSearch.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/metadata.min.json.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/AsYouType.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/Metadata.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/PhoneNumberMatcher.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/isValidPhoneNumber.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/withMetadataArgument.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/ext/tslib/tslib.es6.mjs.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/assets/left-arrow.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/assets/right-arrow.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/assets/x-close.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/helpers/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-birthday/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-email/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-name/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-phone/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-surname/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/form-settings/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/modal/window-settings/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js +0 -0
- /package/build/{packages/storefront/ext → ext}/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-time/index.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as i}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as e,observable as s,computed as n,action as r}from"mobx";import d from"lodash/cloneDeep";import{listCheckoutSettings as o,listCountry as a,listState as u,listCity as l,listDistrict as c}from"@ikas/storefront-api";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import{IkasBaseStore as h}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import"../../../data/blog/category/index.js";import"../../../data/blog/content/index.js";import"../../../data/blog/meta-data/index.js";import"../../../data/blog/tag/index.js";import"../../../data/blog/index.js";import"../../../data/brand/index.js";import"@ikas/storefront-models";import"../../../data/campaign-offer/index.js";import"../../../data/cart/campaign-offer/index.js";import"../../../data/cart/index.js";import"../../../data/category/path-item/index.js";import"../../../data/category/index.js";import"../../../data/checkout/index.js";import"../../../data/checkout-settings/index.js";import"../../../data/city/index.js";import"../../../data/country/index.js";import"../../../data/customer/address/region/index.js";import"../../../data/customer/address/index.js";import{IkasLocalizedCustomerAddress as m}from"../../../data/customer/address/ikas-localized-customer-address.js";import"../../../data/customer/attribute/index.js";import"../../../data/customer/review/summary/index.js";import"../../../data/customer/review/index.js";import"../../../data/customer/index.js";import"../../../data/customer-form-data-input/index.js";import"../../../data/district/index.js";import"../../../data/favorite-product/index.js";import"../../../data/filter-category/index.js";import"../../../data/html-meta-data/index.js";import"../../../data/image/index.js";import{IkasOrderAddressRegion as f}from"../../../data/order/address/region/index.js";import"../../../data/order/address/index.js";import"../../../data/order/line-item/option/value/index.js";import"../../../data/order/line-item/variant/value/index.js";import"../../../data/order/line-item/variant/index.js";import"../../../data/order/line-item/index.js";import"../../../data/order/package/index.js";import"../../../data/order/transaction/index.js";import"../../../data/order/index.js";import"../../../data/payment-gateway/index.js";import"../../../data/product/attribute-value/index.js";import"../../../data/product/filter/index.js";import"../../../data/product/campaign-offer/index.js";import"../../../data/product/option-set/option/index.js";import"../../../data/product/option-set/index.js";import"../../../data/product/stock-location/index.js";import"../../../data/product/variant/price/index.js";import"../../../data/product/variant/index.js";import"../../../data/variant-type/index.js";import"../../../data/product/index.js";import"../../../data/raffle/index.js";import"../../../data/shipping-zone/state/city/district/region/index.js";import"../../../data/state/index.js";import"../../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../data/storefront-popup/index.js";import"../../../data/theme-json/index.js";import"../../../data/theme-json/component/index.js";import"../../../data/theme-json/custom-data/index.js";import"../../../data/variant-type/variant-value/index.js";import{AddressFormItem as g,LocalizedAddressModel as v}from"@ikas/localized-address";import y from"lodash/mapValues";import b from"../../../../store/location/index.js";import{stringSorter as j}from"../../../../utils/helper.js";var x=function(t){return t.sort((function(t,i){return t.label.localeCompare(i.label)}))},C=function(t){return{label:t.name,value:t.id+""}},P=function(){function P(g){var y=this;this.countries=[],this.states=[],this.cities=[],this.districts=[],this.isLoaded=!1,this.isFormSubmit=!1,this._isCountriesPending=!0,this._isStatesPending=!1,this._isCitiesPending=!1,this._isDistrictsPending=!1,this.init=function(){return t(y,void 0,void 0,(function(){var t,e,s,n;return i(this,(function(i){switch(i.label){case 0:return[4,o({})];case 1:return t=i.sent(),[4,b.getAvailableShippingZones({salesChannelId:p.getSalesChannelId()})];case 2:return e=i.sent(),t.isSuccess&&(null===(s=t.data)||void 0===s?void 0:s.length)&&(this.address.checkoutSettings=t.data[0]),e.isSuccess&&(null===(n=e.data)||void 0===n?void 0:n.length)&&(this.address.shippingZones=e.data),this.address.countrySettings=new v({currentLocale:p.getCurrentLocale()}),[4,this.address.countrySettings.waitUntilInitialized()];case 3:return i.sent(),this.address.getValidatedCustomerAddress(),this.isLoaded=!0,[2]}}))}))},this.onTitleChange=function(t){y.address.title=t},this.onFirstNameChange=function(t){y.address.firstName=t},this.onLastNameChange=function(t){y.address.lastName=t},this.onIdentityNumberChange=function(t){y.address.identityNumber=t},this.onPhoneChange=function(t){y.address.phone=t},this.onAddressLine1Change=function(t){y.address.addressLine1=t},this.onAddressLine2Change=function(t){y.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){y.address.postalCode=t},this.onCountryChange=function(t){var i;if((null===(i=y.address.country)||void 0===i?void 0:i.id)!==t){var e=y.countries.find((function(i){return i.id===t}));y.address.country={id:(null==e?void 0:e.id)||null,name:(null==e?void 0:e.name)||"",code:(null==e?void 0:e.iso3)||null,iso2:(null==e?void 0:e.iso2)||null,iso3:(null==e?void 0:e.iso3)||null},y.address.state=null,y.address.city=null,y.address.district=null,y.states=[],y.cities=[],y.districts=[],y.listStates()}},this.onStateChange=function(t){var i;if((null===(i=y.address.state)||void 0===i?void 0:i.id)!==t){var e=y.states.find((function(i){return i.id===t}));y.address.state={id:e.id,name:null==e?void 0:e.name,code:null==e?void 0:e.stateCode},y.address.isFreeTextCity||(y.address.city=null,y.cities=[],y.listCities()),y.address.isFreeTextDistrict||(y.address.district=null,y.districts=[])}},this.onCityChange=function(t){var i;if((null===(i=y.address.city)||void 0===i?void 0:i.id)!==t){var e=y.cities.find((function(i){return i.id===t}));y.address.city={id:e.id,name:e.name,code:null},y.address.isFreeTextDistrict||(y.address.district=null,y.districts=[],y.listDistricts())}},this.onCityInputChange=function(t){y.districts=[],y.address.city={id:null,name:t,code:null}},this.onDistrictChange=function(t){var i;if((null===(i=y.address.district)||void 0===i?void 0:i.id)!==t){var e=y.districts.find((function(i){return i.id===t}));y.address.district={id:e.id,name:e.name,code:null},y.address.region=null}},this.onDistrictInputChange=function(t){y.address.district={id:null,name:t,code:null}},this.onRegionChange=function(t){var i,e,s;if((null===(i=y.address.region)||void 0===i?void 0:i.id)!==t){var n=null===(s=null===(e=y.shippingZoneDistrict)||void 0===e?void 0:e.regions)||void 0===s?void 0:s.find((function(i){return i.id===t}));y.address.region=new f({id:n.id,name:n.name})}},this.listCountries=function(){return t(y,void 0,void 0,(function(){var t,e,s,n,r,d,o;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,6,7]),this._isCountriesPending=!0,[4,a({})];case 1:return t=i.sent(),e=p.getCurrentRouting(),s=t.data||[],(null===(o=null==e?void 0:e.countryCodes)||void 0===o?void 0:o.length)&&(s=s.filter((function(t){var i;return t.iso2&&(null===(i=e.countryCodes)||void 0===i?void 0:i.includes(t.iso2))}))),this.countries=s,1!==this.countries.length||this.address.country?[3,2]:(this.onCountryChange(this.countries[0].id),[3,4]);case 2:return!this.countries.length||this.address.country?[3,4]:[4,b.getMyCountry()];case 3:n=i.sent(),r=n.data,(d=this.countries.find((function(t){return t.iso2===r})))?this.onCountryChange(d.id):this.onCountryChange(this.countries[0].id),i.label=4;case 4:return this.countries=s,[3,7];case 5:return i.sent(),[3,7];case 6:return this._isCountriesPending=!1,[7];case 7:return[2]}}))}))},this.listStates=function(){return t(y,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.country)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isStatesPending=!0,[4,u({countryId:{eq:this.address.country.id}})];case 2:return t=i.sent(),this.states=t.data||[],this.hasState||this.onStateChange(this.states[0].id),[3,5];case 3:return i.sent(),[3,5];case 4:return this._isStatesPending=!1,[7];case 5:return[2]}}))}))},this.listCities=function(){return t(y,void 0,void 0,(function(){var t,e,s,n;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.state)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isCitiesPending=!0,[4,l({stateId:{eq:this.address.state.id},countryId:(null===(s=this.address.country)||void 0===s?void 0:s.id)?{eq:null===(n=this.address.country)||void 0===n?void 0:n.id}:void 0})];case 2:return t=i.sent(),this.cities=t.data||[],[3,5];case 3:return i.sent(),[3,5];case 4:return this._isCitiesPending=!1,[7];case 5:return[2]}}))}))},this.listDistricts=function(){return t(y,void 0,void 0,(function(){var t,e,s,n;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.city)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isDistrictsPending=!0,[4,c({cityId:{eq:this.address.city.id},stateId:(null===(s=this.address.state)||void 0===s?void 0:s.id)?{eq:null===(n=this.address.state)||void 0===n?void 0:n.id}:void 0})];case 2:return t=i.sent(),this.districts=t.data||[],[3,5];case 3:return i.sent(),[3,5];case 4:return this._isDistrictsPending=!1,[7];case 5:return[2]}}))}))},this.submit=function(){return t(y,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(t={isFormError:!1,isSuccess:!1},this.isFormSubmit=!0,!this.address.isValidAddress)return t.isFormError=!0,[2,t];if(!(e=d(h.getInstance().customerStore.customer))||!this.address)return[2,t];(null==e?void 0:e.addresses)||(e.addresses=[]),this.isEdit?e.addresses[this.editingAddressIndex]=this.address:e.addresses.push(this.address),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,h.getInstance().customerStore.saveCustomer(e)];case 2:return i.sent()&&(t.isSuccess=!0),[2,t];case 3:return i.sent(),[2,t];case 4:return[2]}}))}))},e(this,{isLoaded:s,isEdit:n,editingAddressIndex:n,isFreeTextCity:n,isFreeTextDistrict:n,countries:s,states:s,cities:s,districts:s,_isCountriesPending:s,_isStatesPending:s,_isCitiesPending:s,_isDistrictsPending:s,isCountriesPending:n,isStatesPending:n,isCitiesPending:n,isDistrictsPending:n,onCountryChange:r,submit:r}),this.address=g.address||new m({addressLine1:"",addressLine2:null,attributes:null,company:null,firstName:"",identityNumber:null,isDefault:null,lastName:"",phone:null,postalCode:null,taxNumber:null,taxOffice:null,title:"",country:null,state:null,city:null,district:null,region:null,id:"",createdAt:0,updatedAt:0}),this.message=g.message,this.listCountries(),this.address.state&&this.listStates(),this.address.country&&this.listCities(),this.address.city&&this.listDistricts(),this.init()}return Object.defineProperty(P.prototype,"shippingZone",{get:function(){var t,i=this;return null===(t=this.address.shippingZones)||void 0===t?void 0:t.find((function(t){var e;return t.countryId===(null===(e=i.address.country)||void 0===e?void 0:e.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneState",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZone)||void 0===t?void 0:t.states)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.state)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneCity",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneState)||void 0===t?void 0:t.cities)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.city)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneDistrict",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneCity)||void 0===t?void 0:t.districts)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.district)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneRegion",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneDistrict)||void 0===t?void 0:t.regions)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.region)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isFreeTextCity",{get:function(){return this.address.isFreeTextCity},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isFreeTextDistrict",{get:function(){return this.address.isFreeTextDistrict},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isEdit",{get:function(){return-1!==this.editingAddressIndex},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"editingAddressIndex",{get:function(){var t,i,e,s=this;return null!==(e=null===(i=null===(t=h.getInstance().customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===i?void 0:i.findIndex((function(t){return t.id===s.address.id})))&&void 0!==e?e:-1},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"countryOptions",{get:function(){var t=this.countries.map(C);return x(t)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"stateOptions",{get:function(){var t,i,e=this,s=this.states.map(C);return this.shippingZone&&!this.shippingZone.showAllStates&&(null===(i=null===(t=this.shippingZone)||void 0===t?void 0:t.states)||void 0===i?void 0:i.length)&&(s=s.filter((function(t){var i,s;return null===(s=null===(i=e.shippingZone)||void 0===i?void 0:i.states)||void 0===s?void 0:s.some((function(i){return i.id===t.value}))}))),x(s)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"cityOptions",{get:function(){var t,i,e,s=this,n=this.cities.map(C);return this.shippingZone&&!(null===(t=this.shippingZoneState)||void 0===t?void 0:t.showAllCities)&&(null===(e=null===(i=this.shippingZoneState)||void 0===i?void 0:i.cities)||void 0===e?void 0:e.length)&&(n=n.filter((function(t){var i,e;return null===(e=null===(i=s.shippingZoneState)||void 0===i?void 0:i.cities)||void 0===e?void 0:e.some((function(i){return i.id===t.value}))}))),x(n)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"districtOptions",{get:function(){var t,i,e,s=this,n=this.districts.map(C);return this.shippingZone&&!(null===(t=this.shippingZoneCity)||void 0===t?void 0:t.showAllDistricts)&&(null===(e=null===(i=this.shippingZoneCity)||void 0===i?void 0:i.districts)||void 0===e?void 0:e.length)&&(n=n.filter((function(t){var i,e;return null===(e=null===(i=s.shippingZoneCity)||void 0===i?void 0:i.districts)||void 0===e?void 0:e.some((function(i){return i.id===t.value}))}))),x(n)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"regionOptions",{get:function(){var t,i;return null===(i=null===(t=this.shippingZoneDistrict)||void 0===t?void 0:t.regions)||void 0===i?void 0:i.map(C).sort((function(t,i){return j(t.label,i.label)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isCountriesPending",{get:function(){return this._isCountriesPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isStatesPending",{get:function(){return this.isCountriesPending||this._isStatesPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isCitiesPending",{get:function(){return this.isStatesPending||this._isCitiesPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isDistrictsPending",{get:function(){return this.isCitiesPending||this._isDistrictsPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"fieldSettings",{get:function(){return this.address.fieldSettings},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"fieldLabels",{get:function(){return this.address.fieldLabels},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"addressFormat",{get:function(){return this.countryOptions.length<=1?this.address.addressFormatIgnoreCountry:this.address.addressFormat},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"validationResult",{get:function(){var t=this;if(this.address.validationResults)return y(this.address.validationResults,(function(i,e){return{hasError:t.isFormSubmit&&i.hasError,message:t.isFormSubmit&&i.hasError?e===g.PHONE?t.message.phoneRule?"string"==typeof t.message.phoneRule?t.message.phoneRule:t.message.phoneRule(t.address):"":i.isInvalid?"string"==typeof t.message.invalidRule?t.message.invalidRule:t.message.invalidRule(t.address):"string"==typeof t.message.requiredRule?t.message.requiredRule:t.message.requiredRule(t.address):""}}))},enumerable:!1,configurable:!0}),P}();export{P as IkasAddressForm};
|
|
1
|
+
import{__awaiter as t,__generator as i}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as e,observable as s,computed as n,action as r}from"mobx";import d from"lodash/cloneDeep";import{listCheckoutSettings as o,listCountry as a,listState as u,listCity as l,listDistrict as c}from"@ikas/storefront-api";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import{IkasBaseStore as h}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import"../../../data/blog/category/index.js";import"../../../data/blog/content/index.js";import"../../../data/blog/meta-data/index.js";import"../../../data/blog/tag/index.js";import"../../../data/blog/index.js";import"../../../data/brand/index.js";import"@ikas/storefront-models";import"../../../data/campaign-offer/index.js";import"../../../data/cart/campaign-offer/index.js";import"../../../data/cart/index.js";import"../../../data/category/path-item/index.js";import"../../../data/category/index.js";import"../../../data/checkout/index.js";import"../../../data/checkout-settings/index.js";import"../../../data/city/index.js";import"../../../data/country/index.js";import"../../../data/customer/address/region/index.js";import"../../../data/customer/address/index.js";import{IkasLocalizedCustomerAddress as m}from"../../../data/customer/address/ikas-localized-customer-address.js";import"../../../data/customer/attribute/index.js";import"../../../data/customer/review/summary/index.js";import"../../../data/customer/review/index.js";import"../../../data/customer/index.js";import"../../../data/customer-form-data-input/index.js";import"../../../data/district/index.js";import"../../../data/favorite-product/index.js";import"../../../data/filter-category/index.js";import"../../../data/html-meta-data/index.js";import"../../../data/image/index.js";import{IkasOrderAddressRegion as f}from"../../../data/order/address/region/index.js";import"../../../data/order/address/index.js";import"../../../data/order/line-item/option/value/index.js";import"../../../data/order/line-item/variant/value/index.js";import"../../../data/order/line-item/variant/index.js";import"../../../data/order/line-item/index.js";import"../../../data/order/package/index.js";import"../../../data/order/transaction/index.js";import"../../../data/order/index.js";import"../../../data/payment-gateway/index.js";import"../../../data/product/attribute-value/index.js";import"../../../data/product/filter/index.js";import"../../../data/product/campaign-offer/index.js";import"../../../data/product/option-set/option/index.js";import"../../../data/product/option-set/index.js";import"../../../data/product/stock-location/index.js";import"../../../data/product/variant/price/index.js";import"../../../data/product/variant/index.js";import"../../../data/variant-type/index.js";import"../../../data/product/index.js";import"../../../data/raffle/index.js";import"../../../data/shipping-zone/state/city/district/region/index.js";import"../../../data/state/index.js";import"../../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../data/storefront-popup/index.js";import"../../../data/theme-json/index.js";import"../../../data/theme-json/component/index.js";import"../../../data/theme-json/custom-data/index.js";import"../../../data/variant-type/variant-value/index.js";import{AddressFormItem as g,LocalizedAddressModel as v}from"@ikas/localized-address";import y from"lodash/mapValues";import b from"../../../../store/location/index.js";import{stringSorter as j}from"../../../../utils/helper.js";var x=function(t){return t.sort((function(t,i){return t.label.localeCompare(i.label)}))},C=function(t){return{label:t.name,value:t.id+""}},P=function(){function P(g){var y=this;this.countries=[],this.states=[],this.cities=[],this.districts=[],this.isLoaded=!1,this.isFormSubmit=!1,this._isCountriesPending=!0,this._isStatesPending=!1,this._isCitiesPending=!1,this._isDistrictsPending=!1,this.init=function(){return t(y,void 0,void 0,(function(){var t,e,s,n;return i(this,(function(i){switch(i.label){case 0:return this.address.countrySettings=new v({currentLocale:p.getCurrentLocale()}),[4,this.address.countrySettings.waitUntilInitialized()];case 1:return i.sent(),this.listCountries(),this.address.state&&this.listStates(),this.address.country&&this.listCities(),this.address.city&&this.listDistricts(),[4,o({})];case 2:return t=i.sent(),[4,b.getAvailableShippingZones({salesChannelId:p.getSalesChannelId()})];case 3:return e=i.sent(),t.isSuccess&&(null===(s=t.data)||void 0===s?void 0:s.length)&&(this.address.checkoutSettings=t.data[0]),e.isSuccess&&(null===(n=e.data)||void 0===n?void 0:n.length)&&(this.address.shippingZones=e.data),this.address.getValidatedCustomerAddress(),this.isLoaded=!0,[2]}}))}))},this.onTitleChange=function(t){y.address.title=t},this.onFirstNameChange=function(t){y.address.firstName=t},this.onLastNameChange=function(t){y.address.lastName=t},this.onIdentityNumberChange=function(t){y.address.identityNumber=t},this.onPhoneChange=function(t){y.address.phone=t},this.onAddressLine1Change=function(t){y.address.addressLine1=t},this.onAddressLine2Change=function(t){y.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){y.address.postalCode=t},this.onCountryChange=function(t){var i;if((null===(i=y.address.country)||void 0===i?void 0:i.id)!==t){var e=y.countries.find((function(i){return i.id===t}));y.address.country={id:(null==e?void 0:e.id)||null,name:(null==e?void 0:e.name)||"",code:(null==e?void 0:e.iso3)||null,iso2:(null==e?void 0:e.iso2)||null,iso3:(null==e?void 0:e.iso3)||null},y.address.state=null,y.address.city=null,y.address.district=null,y.states=[],y.cities=[],y.districts=[],y.listStates()}},this.onStateChange=function(t){var i;if((null===(i=y.address.state)||void 0===i?void 0:i.id)!==t){var e=y.states.find((function(i){return i.id===t}));y.address.state={id:e.id,name:null==e?void 0:e.name,code:null==e?void 0:e.stateCode},y.address.isFreeTextCity||(y.address.city=null,y.cities=[],y.listCities()),y.address.isFreeTextDistrict||(y.address.district=null,y.districts=[])}},this.onCityChange=function(t){var i;if((null===(i=y.address.city)||void 0===i?void 0:i.id)!==t){var e=y.cities.find((function(i){return i.id===t}));y.address.city={id:e.id,name:e.name,code:null},y.address.isFreeTextDistrict||(y.address.district=null,y.districts=[],y.listDistricts())}},this.onCityInputChange=function(t){y.districts=[],y.address.city={id:null,name:t,code:null}},this.onDistrictChange=function(t){var i;if((null===(i=y.address.district)||void 0===i?void 0:i.id)!==t){var e=y.districts.find((function(i){return i.id===t}));y.address.district={id:e.id,name:e.name,code:null},y.address.region=null}},this.onDistrictInputChange=function(t){y.address.district={id:null,name:t,code:null}},this.onRegionChange=function(t){var i,e,s;if((null===(i=y.address.region)||void 0===i?void 0:i.id)!==t){var n=null===(s=null===(e=y.shippingZoneDistrict)||void 0===e?void 0:e.regions)||void 0===s?void 0:s.find((function(i){return i.id===t}));y.address.region=new f({id:n.id,name:n.name})}},this.listCountries=function(){return t(y,void 0,void 0,(function(){var t,e,s,n,r,d,o;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,6,7]),this._isCountriesPending=!0,[4,a({})];case 1:return t=i.sent(),e=p.getCurrentRouting(),s=t.data||[],(null===(o=null==e?void 0:e.countryCodes)||void 0===o?void 0:o.length)&&(s=s.filter((function(t){var i;return t.iso2&&(null===(i=e.countryCodes)||void 0===i?void 0:i.includes(t.iso2))}))),this.countries=s,1!==this.countries.length||this.address.country?[3,2]:(this.onCountryChange(this.countries[0].id),[3,4]);case 2:return!this.countries.length||this.address.country?[3,4]:[4,b.getMyCountry()];case 3:n=i.sent(),r=n.data,(d=this.countries.find((function(t){return t.iso2===r})))?this.onCountryChange(d.id):this.onCountryChange(this.countries[0].id),i.label=4;case 4:return this.countries=s,[3,7];case 5:return i.sent(),[3,7];case 6:return this._isCountriesPending=!1,[7];case 7:return[2]}}))}))},this.listStates=function(){return t(y,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.country)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isStatesPending=!0,[4,u({countryId:{eq:this.address.country.id}})];case 2:return t=i.sent(),this.states=t.data||[],this.hasState||this.onStateChange(this.states[0].id),[3,5];case 3:return i.sent(),[3,5];case 4:return this._isStatesPending=!1,[7];case 5:return[2]}}))}))},this.listCities=function(){return t(y,void 0,void 0,(function(){var t,e,s,n;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.state)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isCitiesPending=!0,[4,l({stateId:{eq:this.address.state.id},countryId:(null===(s=this.address.country)||void 0===s?void 0:s.id)?{eq:null===(n=this.address.country)||void 0===n?void 0:n.id}:void 0})];case 2:return t=i.sent(),this.cities=t.data||[],[3,5];case 3:return i.sent(),[3,5];case 4:return this._isCitiesPending=!1,[7];case 5:return[2]}}))}))},this.listDistricts=function(){return t(y,void 0,void 0,(function(){var t,e,s,n;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.city)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isDistrictsPending=!0,[4,c({cityId:{eq:this.address.city.id},stateId:(null===(s=this.address.state)||void 0===s?void 0:s.id)?{eq:null===(n=this.address.state)||void 0===n?void 0:n.id}:void 0})];case 2:return t=i.sent(),this.districts=t.data||[],[3,5];case 3:return i.sent(),[3,5];case 4:return this._isDistrictsPending=!1,[7];case 5:return[2]}}))}))},this.submit=function(){return t(y,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(t={isFormError:!1,isSuccess:!1},this.isFormSubmit=!0,!this.address.isValidAddress)return t.isFormError=!0,[2,t];if(!(e=d(h.getInstance().customerStore.customer))||!this.address)return[2,t];(null==e?void 0:e.addresses)||(e.addresses=[]),this.isEdit?e.addresses[this.editingAddressIndex]=this.address:e.addresses.push(this.address),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,h.getInstance().customerStore.saveCustomer(e)];case 2:return i.sent()&&(t.isSuccess=!0),[2,t];case 3:return i.sent(),[2,t];case 4:return[2]}}))}))},e(this,{isLoaded:s,isEdit:n,editingAddressIndex:n,isFreeTextCity:n,isFreeTextDistrict:n,countries:s,states:s,cities:s,districts:s,_isCountriesPending:s,_isStatesPending:s,_isCitiesPending:s,_isDistrictsPending:s,isCountriesPending:n,isStatesPending:n,isCitiesPending:n,isDistrictsPending:n,onCountryChange:r,submit:r}),this.address=g.address||new m({addressLine1:"",addressLine2:null,attributes:null,company:null,firstName:"",identityNumber:null,isDefault:null,lastName:"",phone:null,postalCode:null,taxNumber:null,taxOffice:null,title:"",country:null,state:null,city:null,district:null,region:null,id:"",createdAt:0,updatedAt:0}),this.message=g.message,this.init()}return Object.defineProperty(P.prototype,"shippingZone",{get:function(){var t,i=this;return null===(t=this.address.shippingZones)||void 0===t?void 0:t.find((function(t){var e;return t.countryId===(null===(e=i.address.country)||void 0===e?void 0:e.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneState",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZone)||void 0===t?void 0:t.states)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.state)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneCity",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneState)||void 0===t?void 0:t.cities)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.city)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneDistrict",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneCity)||void 0===t?void 0:t.districts)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.district)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"shippingZoneRegion",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneDistrict)||void 0===t?void 0:t.regions)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.region)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isFreeTextCity",{get:function(){return this.address.isFreeTextCity},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isFreeTextDistrict",{get:function(){return this.address.isFreeTextDistrict},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isEdit",{get:function(){return-1!==this.editingAddressIndex},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"editingAddressIndex",{get:function(){var t,i,e,s=this;return null!==(e=null===(i=null===(t=h.getInstance().customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===i?void 0:i.findIndex((function(t){return t.id===s.address.id})))&&void 0!==e?e:-1},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"countryOptions",{get:function(){var t=this.countries.map(C);return x(t)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"stateOptions",{get:function(){var t,i,e=this,s=this.states.map(C);return this.shippingZone&&!this.shippingZone.showAllStates&&(null===(i=null===(t=this.shippingZone)||void 0===t?void 0:t.states)||void 0===i?void 0:i.length)&&(s=s.filter((function(t){var i,s;return null===(s=null===(i=e.shippingZone)||void 0===i?void 0:i.states)||void 0===s?void 0:s.some((function(i){return i.id===t.value}))}))),x(s)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"cityOptions",{get:function(){var t,i,e,s=this,n=this.cities.map(C);return this.shippingZone&&!(null===(t=this.shippingZoneState)||void 0===t?void 0:t.showAllCities)&&(null===(e=null===(i=this.shippingZoneState)||void 0===i?void 0:i.cities)||void 0===e?void 0:e.length)&&(n=n.filter((function(t){var i,e;return null===(e=null===(i=s.shippingZoneState)||void 0===i?void 0:i.cities)||void 0===e?void 0:e.some((function(i){return i.id===t.value}))}))),x(n)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"districtOptions",{get:function(){var t,i,e,s=this,n=this.districts.map(C);return this.shippingZone&&!(null===(t=this.shippingZoneCity)||void 0===t?void 0:t.showAllDistricts)&&(null===(e=null===(i=this.shippingZoneCity)||void 0===i?void 0:i.districts)||void 0===e?void 0:e.length)&&(n=n.filter((function(t){var i,e;return null===(e=null===(i=s.shippingZoneCity)||void 0===i?void 0:i.districts)||void 0===e?void 0:e.some((function(i){return i.id===t.value}))}))),x(n)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"regionOptions",{get:function(){var t,i;return null===(i=null===(t=this.shippingZoneDistrict)||void 0===t?void 0:t.regions)||void 0===i?void 0:i.map(C).sort((function(t,i){return j(t.label,i.label)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isCountriesPending",{get:function(){return this._isCountriesPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isStatesPending",{get:function(){return this.isCountriesPending||this._isStatesPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isCitiesPending",{get:function(){return this.isStatesPending||this._isCitiesPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isDistrictsPending",{get:function(){return this.isCitiesPending||this._isDistrictsPending},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"fieldSettings",{get:function(){return this.address.fieldSettings},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"fieldLabels",{get:function(){return this.address.fieldLabels},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"addressFormat",{get:function(){return this.countryOptions.length<=1?this.address.addressFormatIgnoreCountry:this.address.addressFormat},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"validationResult",{get:function(){var t=this;if(this.address.validationResults)return y(this.address.validationResults,(function(i,e){return{hasError:t.isFormSubmit&&i.hasError,message:t.isFormSubmit&&i.hasError?e===g.PHONE?t.message.phoneRule?"string"==typeof t.message.phoneRule?t.message.phoneRule:t.message.phoneRule(t.address):"":i.isInvalid?"string"==typeof t.message.invalidRule?t.message.invalidRule:t.message.invalidRule(t.address):"string"==typeof t.message.requiredRule?t.message.requiredRule:t.message.requiredRule(t.address):""}}))},enumerable:!1,configurable:!0}),P}();export{P as IkasAddressForm};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIResponse } from "@ikas/fe-api-client";
|
|
2
|
-
import { CheckCustomerEmailQueryParams, SubscribeToMarketingNotificationsQueryParams, CreateCustomerReviewQueryParams, CreateOrderRefundRequestQueryParams, CustomerForgotPasswordQueryParams, CustomerLoginQueryParams, CustomerRecoverPasswordQueryParams, CustomerRefreshTokenQueryParams, CustomerSocialLoginQueryParams, GetCustomerOrdersQueryParams, GetLastViewedProductsQueryParams, GetOrderByEmailQueryParams, IsFavoriteProductQueryParams, ListCustomerReviewsQueryParams, ListCustomerReviewSummaryQueryParams, ListOrderRefundSettingsQueryParams, ListOrderTransactionsQueryParams, RegisterCustomerQueryParams, SaveFavoriteProductQueryParams, SaveLastViewedProductsQueryParams, SaveMyCustomerQueryParams, SendContactFormToMerchantQueryParams, ActivateCustomerQueryParams, ResendCustomerActivationMailQueryParams, ValidateCustomerPhoneVerificationCodeQueryParams, ResendCustomerPhoneVerificationCodeQueryParams, SaveCustomerFormDataQueryParams } from "@ikas/storefront-api";
|
|
2
|
+
import { CheckCustomerEmailQueryParams, SubscribeToMarketingNotificationsQueryParams, CreateCustomerReviewQueryParams, CreateOrderRefundRequestQueryParams, CustomerForgotPasswordQueryParams, CustomerLoginQueryParams, CustomerRecoverPasswordQueryParams, CustomerRefreshTokenQueryParams, CustomerSocialLoginQueryParams, GetCustomerOrdersQueryParams, GetLastViewedProductsQueryParams, GetOrderByEmailQueryParams, IsFavoriteProductQueryParams, ListCustomerReviewsQueryParams, ListCustomerReviewSummaryQueryParams, ListOrderRefundSettingsQueryParams, ListOrderTransactionsQueryParams, RegisterCustomerQueryParams, SaveFavoriteProductQueryParams, SaveLastViewedProductsQueryParams, SaveMyCustomerQueryParams, SendContactFormToMerchantQueryParams, ActivateCustomerQueryParams, ResendCustomerActivationMailQueryParams, ValidateCustomerPhoneVerificationCodeQueryParams, ResendCustomerPhoneVerificationCodeQueryParams, SaveCustomerFormDataQueryParams, CustomerDeactiveQueryParams } from "@ikas/storefront-api";
|
|
3
3
|
import { IkasCustomer, IkasCustomerAttribute, IkasCustomerReview, IkasCustomerReviewSummary, IkasFavoriteProduct, IkasLastViewedProduct, IkasOrder, IkasOrderRefundSettings, IkasOrderTransaction } from "../../models/data";
|
|
4
4
|
export default class CustomerStoreAPI {
|
|
5
5
|
static login(params: CustomerLoginQueryParams): Promise<APIResponse<{
|
|
@@ -56,4 +56,6 @@ export default class CustomerStoreAPI {
|
|
|
56
56
|
static resendCustomerPhoneVerificationCode(params: ResendCustomerPhoneVerificationCodeQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
|
|
57
57
|
static validateCustomerPhoneVerificationCode(params: ValidateCustomerPhoneVerificationCodeQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
|
|
58
58
|
static saveCustomerFormData(params: SaveCustomerFormDataQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
|
|
59
|
+
static exportCustomerPersonelData(): Promise<APIResponse<undefined> | APIResponse<string>>;
|
|
60
|
+
static deactivateCustomer(params: CustomerDeactiveQueryParams): Promise<APIResponse<undefined> | APIResponse<boolean>>;
|
|
59
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}from'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{login as i,socialLogin as o,register as s,refreshToken as a,forgotPassword as d,recoverPassword as u,checkEmail as c,getCustomer as l,saveCustomer as m,getOrders as p,getOrderByEmail as f,listOrderTransactions as v,createOrderRefundRequest as h,subscribeToMarketingNotifications as w,getLastViewedProducts as j,saveLastViewedProducts as x,listOrderRefundSettings as g,sendContactFormToMerchant as b,listFavoriteProducts as L,saveFavoriteProduct as E,isFavoriteProduct as y,createCustomerReview as k,listCustomerReviews as Q,listCustomerReviewSummary as C,listCustomerAttribute as P,activateCustomer as _,resendCustomerActivationMail as R,resendCustomerPhoneVerificationCode as T,validateCustomerPhoneVerificationCode as F,saveCustomerFormData as O}from"@ikas/storefront-api";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import{IkasCustomerAttribute as V}from"../../models/data/customer/attribute/index.js";import{IkasCustomerReviewSummary as z}from"../../models/data/customer/review/summary/index.js";import{IkasCustomerReview as A}from"../../models/data/customer/review/index.js";import{IkasCustomer as I}from"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import{IkasFavoriteProduct as M}from"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasLastViewedProduct as S}from"../../models/data/last-viewed-product/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import{IkasOrderRefundSettings as q}from"../../models/data/order/refund/settings/index.js";import{IkasOrderTransaction as B}from"../../models/data/order/transaction/index.js";import{IkasOrder as D}from"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";var G=function(){function G(){}return G.login=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new I(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},G.socialLogin=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,o(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new I(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},G.register=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,s(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new I(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},G.refreshToken=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,a(r)];case 1:return[2,t.sent()]}}))}))},G.forgotPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,d(r)];case 1:return[2,t.sent()]}}))}))},G.recoverPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u(r)];case 1:return[2,t.sent()]}}))}))},G.checkEmail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,c(r)];case 1:return[2,t.sent()]}}))}))},G.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,l()];case 1:return t=e.sent(),[2,new n(t.data?new I(t.data):null,t.graphQLErrors)]}}))}))},G.saveCustomer=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,m(r)];case 1:return t=e.sent(),[2,new n(t.data?new I(t.data):null,t.graphQLErrors)]}}))}))},G.getOrders=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new D(t)})),t.graphQLErrors)]}}))}))},G.getOrderByEmail=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f(r)];case 1:return t=e.sent(),[2,new n(t.data?new D(t.data):null,t.graphQLErrors)]}}))}))},G.listOrderTransactions=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new B(t)})),t.graphQLErrors)]}}))}))},G.createOrderRefundRequest=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,h(r)];case 1:return t=e.sent(),[2,new n(t.data?new D(t.data):null,t.graphQLErrors)]}}))}))},G.subscribeToMarketingNotifications=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,w(r)];case 1:return[2,t.sent()]}}))}))},G.getLastViewedProducts=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,j(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new S(t)})),t.graphQLErrors)]}}))}))},G.saveLastViewedProducts=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,x(r)];case 1:return[2,t.sent()]}}))}))},G.listOrderRefundSettings=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,g(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new q(t)})),t.graphQLErrors)]}}))}))},G.sendContactFormToMerchant=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,b(r)];case 1:return[2,t.sent()]}}))}))},G.listFavoriteProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,L()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new M(t)})),t.graphQLErrors)]}}))}))},G.saveFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,E(r)];case 1:return[2,t.sent()]}}))}))},G.isFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,y({productId:r.productId})];case 1:return[2,t.sent()]}}))}))},G.createCustomerReview=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,k(r)];case 1:return t=e.sent(),[2,new n(t.data?new A(t.data):null,t.graphQLErrors)]}}))}))},G.listCustomerReviews=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,Q(r({},i))];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{data:t.data.data.map((function(t){return new A(t)}))}):null,t.graphQLErrors)]}}))}))},G.listCustomerReviewSummary=function(i){var o;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,C(i)];case 1:return t=e.sent(),[2,new n(r(r({},t.data),{data:null===(o=t.data)||void 0===o?void 0:o.data.map((function(t){return new z(t)}))}),t.graphQLErrors)]}}))}))},G.listCustomerAttribute=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,P()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.sort((function(t,e){return t.order&&e.order?t.order-e.order:-1})).map((function(t){return new V(t)}),t.graphQLErrors))]}}))}))},G.activateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,_(r)];case 1:return[2,t.sent()]}}))}))},G.resendCustomerActivationMail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,R(r)];case 1:return[2,t.sent()]}}))}))},G.resendCustomerPhoneVerificationCode=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,T(r)];case 1:return[2,t.sent()]}}))}))},G.validateCustomerPhoneVerificationCode=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,F(r)];case 1:return[2,t.sent()]}}))}))},G.saveCustomerFormData=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,O(r)];case 1:return[2,t.sent()]}}))}))},G}();export{G as default};
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as n}from'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{login as i,socialLogin as o,register as s,refreshToken as a,forgotPassword as d,recoverPassword as u,checkEmail as c,getCustomer as l,saveCustomer as m,getOrders as p,getOrderByEmail as f,listOrderTransactions as v,createOrderRefundRequest as h,subscribeToMarketingNotifications as w,getLastViewedProducts as j,saveLastViewedProducts as x,listOrderRefundSettings as b,sendContactFormToMerchant as g,listFavoriteProducts as L,saveFavoriteProduct as E,isFavoriteProduct as y,createCustomerReview as k,listCustomerReviews as C,listCustomerReviewSummary as Q,listCustomerAttribute as P,activateCustomer as _,resendCustomerActivationMail as R,resendCustomerPhoneVerificationCode as T,validateCustomerPhoneVerificationCode as F,saveCustomerFormData as O,exportCustomerPersonelData as V,deactivateCustomer as z}from"@ikas/storefront-api";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import{IkasCustomerAttribute as A}from"../../models/data/customer/attribute/index.js";import{IkasCustomerReviewSummary as I}from"../../models/data/customer/review/summary/index.js";import{IkasCustomerReview as M}from"../../models/data/customer/review/index.js";import{IkasCustomer as S}from"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import{IkasFavoriteProduct as D}from"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasLastViewedProduct as q}from"../../models/data/last-viewed-product/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import{IkasOrderRefundSettings as B}from"../../models/data/order/refund/settings/index.js";import{IkasOrderTransaction as G}from"../../models/data/order/transaction/index.js";import{IkasOrder as N}from"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";var H=function(){function H(){}return H.login=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new S(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},H.socialLogin=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,o(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new S(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},H.register=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,s(i)];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{customer:t.data.customer?new S(t.data.customer):null}):null,t.graphQLErrors)]}}))}))},H.refreshToken=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,a(r)];case 1:return[2,t.sent()]}}))}))},H.forgotPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,d(r)];case 1:return[2,t.sent()]}}))}))},H.recoverPassword=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u(r)];case 1:return[2,t.sent()]}}))}))},H.checkEmail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,c(r)];case 1:return[2,t.sent()]}}))}))},H.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,l()];case 1:return t=e.sent(),[2,new n(t.data?new S(t.data):null,t.graphQLErrors)]}}))}))},H.saveCustomer=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,m(r)];case 1:return t=e.sent(),[2,new n(t.data?new S(t.data):null,t.graphQLErrors)]}}))}))},H.getOrders=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new N(t)})),t.graphQLErrors)]}}))}))},H.getOrderByEmail=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f(r)];case 1:return t=e.sent(),[2,new n(t.data?new N(t.data):null,t.graphQLErrors)]}}))}))},H.listOrderTransactions=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new G(t)})),t.graphQLErrors)]}}))}))},H.createOrderRefundRequest=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,h(r)];case 1:return t=e.sent(),[2,new n(t.data?new N(t.data):null,t.graphQLErrors)]}}))}))},H.subscribeToMarketingNotifications=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,w(r)];case 1:return[2,t.sent()]}}))}))},H.getLastViewedProducts=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,j(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new q(t)})),t.graphQLErrors)]}}))}))},H.saveLastViewedProducts=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,x(r)];case 1:return[2,t.sent()]}}))}))},H.listOrderRefundSettings=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,b(r)];case 1:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new B(t)})),t.graphQLErrors)]}}))}))},H.sendContactFormToMerchant=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,g(r)];case 1:return[2,t.sent()]}}))}))},H.listFavoriteProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,L()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new D(t)})),t.graphQLErrors)]}}))}))},H.saveFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,E(r)];case 1:return[2,t.sent()]}}))}))},H.isFavoriteProduct=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,y({productId:r.productId})];case 1:return[2,t.sent()]}}))}))},H.createCustomerReview=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,k(r)];case 1:return t=e.sent(),[2,new n(t.data?new M(t.data):null,t.graphQLErrors)]}}))}))},H.listCustomerReviews=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,C(r({},i))];case 1:return t=e.sent(),[2,new n(t.data?r(r({},t.data),{data:t.data.data.map((function(t){return new M(t)}))}):null,t.graphQLErrors)]}}))}))},H.listCustomerReviewSummary=function(i){var o;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,Q(i)];case 1:return t=e.sent(),[2,new n(r(r({},t.data),{data:null===(o=t.data)||void 0===o?void 0:o.data.map((function(t){return new I(t)}))}),t.graphQLErrors)]}}))}))},H.listCustomerAttribute=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,P()];case 1:return t=e.sent(),[2,new n(null===(r=t.data)||void 0===r?void 0:r.sort((function(t,e){return t.order&&e.order?t.order-e.order:-1})).map((function(t){return new A(t)}),t.graphQLErrors))]}}))}))},H.activateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,_(r)];case 1:return[2,t.sent()]}}))}))},H.resendCustomerActivationMail=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,R(r)];case 1:return[2,t.sent()]}}))}))},H.resendCustomerPhoneVerificationCode=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,T(r)];case 1:return[2,t.sent()]}}))}))},H.validateCustomerPhoneVerificationCode=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,F(r)];case 1:return[2,t.sent()]}}))}))},H.saveCustomerFormData=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,O(r)];case 1:return[2,t.sent()]}}))}))},H.exportCustomerPersonelData=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,V()];case 1:return[2,t.sent()]}}))}))},H.deactivateCustomer=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,z(r)];case 1:return[2,t.sent()]}}))}))},H}();export{H as default};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IkasContactForm, IkasCustomer, IkasCustomerAttributeValue, IkasFavoriteProduct, IkasOrderTransaction, IkasProduct, IkasOrder, IkasRaffleParticipant, IkasProductFile } from "../../models/data";
|
|
2
|
+
import { APIResponse } from "@ikas/fe-api-client";
|
|
2
3
|
import { IkasLoginError, IkasRegisterError } from "@ikas/storefront-api";
|
|
3
4
|
import { IkasBaseStore } from "../base";
|
|
4
5
|
import { SaveCustomerFormDataInput } from "@ikas/storefront-api/src/__api/types";
|
|
@@ -64,6 +65,8 @@ export declare class IkasCustomerStore {
|
|
|
64
65
|
createEmailSubscription: (email: string) => Promise<boolean>;
|
|
65
66
|
saveCustomerFormData: (input: SaveCustomerFormDataInput) => Promise<boolean>;
|
|
66
67
|
sendReview: (input: IkasCustomerReviewForm) => Promise<import("../../models/data").IkasCustomerReview | null | undefined>;
|
|
68
|
+
deactivateCustomer: (password: string) => Promise<APIResponse<undefined> | APIResponse<boolean> | undefined>;
|
|
69
|
+
exportCustomerPersonalData: () => Promise<APIResponse<undefined> | APIResponse<string> | undefined>;
|
|
67
70
|
onCustomerConsentGrant: () => void;
|
|
68
71
|
waitUntilInitialized: () => Promise<unknown>;
|
|
69
72
|
waitUntilCaptchaTokenInitialized: () => Promise<unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as i}from"mobx";import s from"lodash/xorBy";import o from"lodash/cloneDeep";import n from"./api.js";import{IkasCustomer as a}from"../../models/data/customer/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasCustomerEmailSubscriptionStatus as c}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import{IkasRaffleParticipant as u}from"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import d from"../raffle/index.js";import'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import l from"../product/index.js";import{Analytics as h}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasStorefrontConfig as m}from"@ikas/storefront-config";import{IkasLoginError as p,IkasRegisterError as f,SaveMyCustomerInput as v}from"@ikas/storefront-api";import{populateRaffleParticipantProducts as g}from"@ikas/storefront-providers";import w from"../checkout/index.js";var k="undefined"==typeof localStorage,b=function(){function b(s){var a=this;this.customer=null,this.token=null,this.tokenExpiry=null,this.baseStore=null,this._initialized=!1,this._visitorSubscribedEmail=!1,this._lastViewedProducts=[],this._customerConsentGranted=!1,this._refundSettings=null,this._captchaToken=null,this._savedLastViewedProducts=[],this._savedLastViewedProductsResponse=null,this.toAnalyticsCustomer=function(t){return r(r({},t),{consentGranted:a._customerConsentGranted})},this.login=function(r,i){return t(a,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.login({email:r,password:i,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&t.data?(s=t.data,this.setToken(s.token,s.tokenExpiry),s.customer&&this.setCustomer(s.customer),this.customer&&h.customerLogin(),this.saveLocalLastViewedProducts(),[2,!0]):[2,!1]}}))}))},this.customerLogin=function(r,i){return t(a,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.login({email:r,password:i,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&t.data?(s=t.data,this.setToken(s.token,s.tokenExpiry),s.customer&&this.setCustomer(s.customer),this.customer&&h.customerLogin(),this.saveLocalLastViewedProducts(),[2,{isSuccess:!0,errorCodes:[]}]):[2,{isSuccess:!1,errorCodes:t.errorCodes.map((function(t){return Object.values(p).includes(t)?t:p.UNKOWN}))}]}}))}))},this.logout=function(){var t;a.clearLocalData(),null===(t=a.baseStore)||void 0===t||t.cartStore.removeCart(),h.customerLogout()},this.register=function(r,i,s,o,c,u,d){return t(a,void 0,void 0,(function(){var t,a;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.register({email:s,password:o,firstName:r,lastName:i,isAcceptMarketing:c,attributes:u,captchaToken:this._captchaToken,phone:d})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&(null===(a=t.data)||void 0===a?void 0:a.customer)?(this.setToken(t.data.token,t.data.tokenExpiry),this.setCustomer(t.data.customer),this.saveLocalLastViewedProducts(),h.completeRegistration(this.toAnalyticsCustomer(this.customer)),[2,{isSuccess:!0,errorCodes:[]}]):[2,{isSuccess:!1,errorCodes:t.errorCodes.map((function(t){return Object.values(f).includes(t)?t:f.UNKOWN}))}]}}))}))},this.activateCustomer=function(){return t(a,void 0,void 0,(function(){var t,r,i;return e(this,(function(e){switch(e.label){case 0:return t=new URLSearchParams(window.location.search),(r=t.get("token"))?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.activateCustomer({token:r,captchaToken:this._captchaToken})];case 2:return i=e.sent(),this.clearCaptchaToken(),[2,i.isSuccess];case 3:return[2,!1]}}))}))},this.resendCustomerActivationMail=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.resendCustomerActivationMail({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess];case 3:return[2,!1]}}))}))},this.validateCustomerPhoneVerificationCode=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.validateCustomerPhoneVerificationCode({verificationCode:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!(!t.isSuccess||!t.data)&&t.data];case 3:return[2,!1]}}))}))},this.resendCustomerPhoneVerificationCode=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.resendCustomerPhoneVerificationCode({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!(!t.isSuccess||!t.data)&&t.data];case 3:return[2,!1]}}))}))},this.saveContactForm=function(i){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return h.contactForm(i),[4,this.getCaptcha()];case 1:return e.sent(),[4,n.sendContactFormToMerchant(r(r({},i),{captchaToken:this._captchaToken}))];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess]}}))}))},this.checkEmail=function(r){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.checkEmail({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!!t.isSuccess&&!!(null===(i=t.data)||void 0===i?void 0:i.exists)]}}))}))},this.forgotPassword=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.forgotPassword({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!!t.isSuccess&&t.data]}}))}))},this.recoverPassword=function(r,i,s){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.recoverPassword({password:r,passwordAgain:i,token:s,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess]}}))}))},this.saveCustomer=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n.saveCustomer({input:new v(r)})];case 1:return(t=e.sent()).isSuccess&&t.data?(this.setCustomer(t.data),[2,!0]):[2,!1]}}))}))},this.getOrders=function(){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.getOrders({})];case 1:return[2,t.sent().data||[]]}}))}))},this.getOrder=function(r){return t(a,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:return[4,n.getOrders({orderId:r})];case 1:return(t=e.sent()).isSuccess&&(null===(s=t.data)||void 0===s?void 0:s.length)?(i=t.data[0],[4,this.getOrderRefundSettings()]):[2,null];case 2:return e.sent(),i.refundSettings=this._refundSettings,[2,i]}}))}))},this.getOrderByEmail=function(r,i){return t(a,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return[4,n.getOrderByEmail({email:r,orderNumber:i})];case 1:return(t=e.sent()).isSuccess&&t.data?(s=t.data,[4,this.getOrderRefundSettings()]):[2,null];case 2:return e.sent(),s.refundSettings=this._refundSettings,[2,s]}}))}))},this.getOrderTransactions=function(r){return void 0===r&&(r={}),t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.listOrderTransactions({checkoutId:{eq:r.checkoutId},id:{eq:r.checkoutId},orderId:{eq:r.orderId}})];case 1:return[2,t.sent().data||[]]}}))}))},this.getFavoriteProductsIds=function(){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.customer?[4,n.listFavoriteProducts()]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))},this.getFavoriteProducts=function(){return t(a,void 0,void 0,(function(){var t,r,i,s,o,a;return e(this,(function(e){switch(e.label){case 0:return this.customer?[4,n.listFavoriteProducts()]:[2,[]];case 1:return(t=e.sent()).isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)?[4,l.searchProducts({input:{productIdList:t.data.map((function(t){return t.productId})),priceListId:m.getPriceListId(),salesChannelId:m.getSalesChannelId(),perPage:100}})]:[2,[]];case 2:return r=e.sent(),null===(o=null===(s=r.data)||void 0===s?void 0:s.data)||void 0===o||o.forEach((function(t){t.selectedVariantValues=t.variants[0].variantValues})),[2,(null===(a=null==r?void 0:r.data)||void 0===a?void 0:a.data)||[]]}}))}))},this.addProductToFavorites=function(r){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,n.saveFavoriteProduct({isFavorite:!0,productId:r})];case 1:return t=e.sent(),h.addToWishlist(r),[2,t.data||!1]}}))}))},this.removeProductFromFavorites=function(r){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,n.saveFavoriteProduct({isFavorite:!1,productId:r})];case 1:return t=e.sent(),h.addToWishlist(r,!0),[2,t.data||!1]}}))}))},this.isProductFavorite=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!(null===(t=this.customer)||void 0===t?void 0:t.id))throw Error("Unauthorized");return[4,n.isFavoriteProduct({productId:r})];case 1:return[2,e.sent().data||!1]}}))}))},this.createEmailSubscription=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.subscribeToMarketingNotifications({input:{email:r,captchaToken:this._captchaToken}})];case 2:return(t=e.sent()).isSuccess&&(window.localStorage.setItem("customerEmailSubscription","true"),this.customer?(this.customer.subscriptionStatus,c.SUBSCRIBED):this._visitorSubscribedEmail=!0,h.createEmailSubscripition(r)),[2,t.isSuccess]}}))}))},this.saveCustomerFormData=function(i){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.saveCustomerFormData({input:r(r({},i),{captchaToken:this._captchaToken})})];case 2:return(t=e.sent()).isSuccess&&(window.localStorage.setItem("customerEmailSubscription","true"),this.customer?(this.customer.subscriptionStatus,c.SUBSCRIBED):this._visitorSubscribedEmail=!0,h.createEmailSubscripition(i.email)),[2,t.isSuccess]}}))}))},this.sendReview=function(i){return t(a,void 0,void 0,(function(){var t,s,o,a,c;return e(this,(function(e){switch(e.label){case 0:if(t=m.getCustomerReviewSettings(),s=m.getSalesChannelId(),o=m.getCurrentLocale(),!t)return[2];if(!(a=null===(c=this.customer)||void 0===c?void 0:c.id)&&t.customerLoginRequired)throw Error("Unauthorized");return[4,n.createCustomerReview({input:r(r({},i),{customerId:t.customerLoginRequired?a:void 0,salesChannelId:s||"",locale:o})})];case 1:return[2,e.sent().data]}}))}))},this.onCustomerConsentGrant=function(){a.saveCustomerConsent()},this.waitUntilInitialized=function(){return new Promise((function(t){var e=setInterval((function(){a.initialized&&(clearInterval(e),t(null))}),100)}))},this.waitUntilCaptchaTokenInitialized=function(){return new Promise((function(t){var e=setInterval((function(){a._captchaToken&&(clearInterval(e),t(null))}),100)}))},this.getRaffles=function(){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return[4,d.listRaffleParticipants()];case 1:return(t=e.sent())&&t.data?[4,g(t.data)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2,null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new u(t)}))]}}))}))},this.getCustomerAttributes=function(){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return[4,n.listCustomerAttribute()];case 1:return t=e.sent(),this.customer&&(null===(r=this.customer.attributes)||void 0===r||r.forEach((function(e){var r,i,s;e.customerAttribute=(null===(r=t.data)||void 0===r?void 0:r.find((function(t){return t.id===e.customerAttributeId})))||null,e.customerAttributeOptionId&&(e.customerAttributeOption=(null===(s=null===(i=e.customerAttribute)||void 0===i?void 0:i.options)||void 0===s?void 0:s.find((function(t){return t.id===e.customerAttributeOptionId})))||null)}))),[2,t.data||[]]}}))}))},this.getOrderProductFiles=function(r){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return r.length?[4,w.listProductFile({id:{in:r}})]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))},this.getDigitalProductFileDownloadUrl=function(r,i){return t(a,void 0,void 0,(function(){var t,s,o,n,a;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),(t=r.orderLineItems.find((function(t){return t.variant.id===i.variantId})))?[4,w.getDigitalProductFileDownloadUrl({orderId:r.id,orderLineItemId:t.id})]:[3,2];case 1:s=e.sent(),(o=s.data)&&((n=document.createElement("a")).href=o,n.download=decodeURIComponent(i.name.split("/")[i.name.split("/").length-1])||"",n.click(),n.remove()),e.label=2;case 2:return[3,4];case 3:return a=e.sent(),console.error(a),[3,4];case 4:return[2]}}))}))},this.getOrderRefundSettings=function(){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return this._refundSettings?[3,2]:[4,n.listOrderRefundSettings({})];case 1:(t=e.sent()).isSuccess&&(null===(r=t.data)||void 0===r?void 0:r.length)&&(this._refundSettings=t.data[0]),e.label=2;case 2:return[2]}}))}))},this.setSavedLastViewedProductsResponse=function(t){a._savedLastViewedProducts=o(a._lastViewedProducts),a._savedLastViewedProductsResponse=t},this.setCaptchaToken=function(t){a._captchaToken=t},this.baseStore=s,i(this)}return Object.defineProperty(b.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"canCreateEmailSubscription",{get:function(){var t;return!((null===(t=this.customer)||void 0===t?void 0:t.isSubscribed)||k||this._visitorSubscribedEmail)&&!window.localStorage.getItem("customerEmailSubscription")},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"customerConsentGranted",{get:function(){return this._customerConsentGranted},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isCaptchaRequired",{get:function(){var t;return(null===(t=m.getCustomerSettings())||void 0===t?void 0:t.requireCaptchaValidation)||!1},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"useLastViewedProductResponse",{get:function(){var t;return(null===(t=this._savedLastViewedProducts)||void 0===t?void 0:t.length)&&this._savedLastViewedProductsResponse&&0===s(this._lastViewedProducts,this._savedLastViewedProducts,"productId").length},enumerable:!1,configurable:!0}),b.prototype.socialLogin=function(r){return t(this,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:return"undefined"==typeof window?[2]:(t=new URLSearchParams(window.location.search).get("redirect")||"",i="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/ms/").concat(r,"/login/authenticate?redirect=").concat(t),[4,fetch(i,{headers:{"x-api-key":m.getApiKey()||"","x-sfid":m.getStorefrontId()||"","x-sfrid":m.getStorefrontRoutingId()||""}})]);case 1:return[4,e.sent().json()];case 2:return s=e.sent(),window.location.href=s.redirectUrl,[2]}}))}))},b.prototype.socialLoginToken=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n.socialLogin({code:r})];case 1:return(null==(t=e.sent())?void 0:t.isSuccess)&&(null===(i=t.data)||void 0===i?void 0:i.customer)?(this.setToken(t.data.token,t.data.tokenExpiry),this.setCustomer(t.data.customer),this.customer&&h.customerLogin(),[2,!0]):[2,!1]}}))}))},b.prototype.refundOrder=function(r,i){return t(this,void 0,void 0,(function(){var t,s,o=this;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=[],r.orderLineItems.map((function(e){null!==e.refundQuantity&&(null==t||t.push({orderLineItemId:e.id,quantity:e.refundQuantity?e.refundQuantity:0}))})),[4,n.createOrderRefundRequest({input:{email:i,orderId:r.id,orderLineItems:t}})];case 1:return(s=e.sent()).isSuccess&&s.data?(Object.entries(s.data).forEach((function(t){var e=t[0],r=t[1];o[e]=r})),[2,!0]):[3,3];case 2:return e.sent(),[3,3];case 3:return[2,!1]}}))}))},b.prototype.init=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.loadToken(),this.loadLastViewedProducts(),this.loadCustomerConsent(),[4,this.refreshToken()];case 1:return t.sent(),[4,this.getCustomer()];case 2:return t.sent(),this._initialized=!0,this.customer&&h.customerVisit(),[2]}}))}))},b.prototype.routeChangeInit=function(){this.loadToken(),!this.token&&this.customer&&this.clearLocalData(),this.token&&!this.customer&&this.getCustomer()},b.prototype.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return k||!this.token?[2]:[4,n.getCustomer()];case 1:return(t=e.sent()).data&&this.setCustomer(t.data),[2]}}))}))},b.prototype.refreshToken=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.token?[4,n.refreshToken({token:this.token})]:[2];case 1:return(t=e.sent()).isSuccess&&t.data?this.setToken(t.data.token,t.data.tokenExpiry):(this.token=null,this.tokenExpiry=null,this.clearLocalData()),[2]}}))}))},b.prototype.setCustomer=function(t){this.customer=new a(t)},b.prototype.getLastViewedProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.customer?[4,n.getLastViewedProducts({customerId:this.customer.id})]:[3,2];case 1:return t=e.sent(),this._lastViewedProducts=(null===(r=o(t.data))||void 0===r?void 0:r.reverse())||[],[3,3];case 2:this.loadLastViewedProducts(),e.label=3;case 3:return[2,this._lastViewedProducts]}}))}))},b.prototype.saveLastViewedProducts=function(){k||window.localStorage.setItem("lastViewedProducts",JSON.stringify(this._lastViewedProducts))},b.prototype.loadLastViewedProducts=function(){k||(this._lastViewedProducts=this.getLocalLastViewedProducts(),this._lastViewedProducts=o(this._lastViewedProducts).reverse())},b.prototype.getLocalLastViewedProducts=function(){if(k)return[];try{var t=window.localStorage.getItem("lastViewedProducts");if(t)return JSON.parse(t)}catch(t){}return[]},b.prototype.removeLastViewedProducts=function(){k||window.localStorage.removeItem("lastViewedProducts")},b.prototype.onProductView=function(r,i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.customer?this._lastViewedProducts.find((function(t){return t.productId===r}))?[2]:[4,n.saveLastViewedProducts({input:{customerId:this.customer.id,products:[{productId:r,variantId:i}]}})]:[3,2];case 1:return t.sent()&&this._lastViewedProducts.push({productId:r,variantId:i}),[3,3];case 2:this._lastViewedProducts=this.getLocalLastViewedProducts(),this._lastViewedProducts=this._lastViewedProducts.filter((function(t){return t.productId!==r})),this._lastViewedProducts.push({productId:r,variantId:i}),this._lastViewedProducts=this._lastViewedProducts.slice(-20),this.saveLastViewedProducts(),t.label=3;case 3:return[2]}}))}))},b.prototype.saveLocalLastViewedProducts=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(k)return[2];e.label=1;case 1:return e.trys.push([1,4,,5]),(t=this.getLocalLastViewedProducts()).length?[4,n.saveLastViewedProducts({input:{customerId:this.customer.id,products:t}})]:[3,3];case 2:e.sent()&&this.removeLastViewedProducts(),e.label=3;case 3:return[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}}))}))},b.prototype.saveCustomerConsent=function(){k||(this._customerConsentGranted=!0,window.localStorage.setItem("customerConsent","true"))},b.prototype.loadCustomerConsent=function(){k||(this._customerConsentGranted=!!window.localStorage.getItem("customerConsent"))},b.prototype.removeCustomerConsent=function(){k||window.localStorage.removeItem("customerConsent")},b.prototype.setToken=function(t,e){k||(this.token=t,this.tokenExpiry=e,localStorage.setItem("customerToken",t),localStorage.setItem("customerTokenExpiry",e+""),m.init({customerToken:t}))},b.prototype.loadToken=function(){if(!k){var t=localStorage.getItem("customerToken"),e=localStorage.getItem("customerTokenExpiry");t&&e?this.setToken(t,parseInt(e)):this.clearLocalTokenData()}},b.prototype.clearLocalTokenData=function(){localStorage.removeItem("customerToken"),localStorage.removeItem("customerTokenExpiry"),this.token=void 0,this.tokenExpiry=void 0},b.prototype.clearLocalData=function(){this.clearLocalTokenData(),this.customer=void 0,m.init({customerToken:""}),this.clearCaptchaToken()},b.prototype.clearCaptchaToken=function(){this._captchaToken=null},b.prototype.getCaptcha=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.isCaptchaRequired?(window.grecaptcha.execute(),[4,this.waitUntilCaptchaTokenInitialized()]):[3,2];case 1:e.sent(),window.grecaptcha.reset(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.log("Get captcha error",t),[3,4];case 4:return[2]}}))}))},b}();export{b as IkasCustomerStore};
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as r}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as i}from"mobx";import s from"lodash/xorBy";import o from"lodash/cloneDeep";import n from"./api.js";import{IkasCustomer as a}from"../../models/data/customer/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasCustomerEmailSubscriptionStatus as c}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import{IkasRaffleParticipant as u}from"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import d from"../raffle/index.js";import'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import l from"../product/index.js";import{Analytics as h}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasStorefrontConfig as m}from"@ikas/storefront-config";import{IkasLoginError as p,IkasRegisterError as f,SaveMyCustomerInput as v}from"@ikas/storefront-api";import{populateRaffleParticipantProducts as g}from"@ikas/storefront-providers";import w from"../checkout/index.js";var k="undefined"==typeof localStorage,b=function(){function b(s){var a=this;this.customer=null,this.token=null,this.tokenExpiry=null,this.baseStore=null,this._initialized=!1,this._visitorSubscribedEmail=!1,this._lastViewedProducts=[],this._customerConsentGranted=!1,this._refundSettings=null,this._captchaToken=null,this._savedLastViewedProducts=[],this._savedLastViewedProductsResponse=null,this.toAnalyticsCustomer=function(t){return r(r({},t),{consentGranted:a._customerConsentGranted})},this.login=function(r,i){return t(a,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.login({email:r,password:i,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&t.data?(s=t.data,this.setToken(s.token,s.tokenExpiry),s.customer&&this.setCustomer(s.customer),this.customer&&h.customerLogin(),this.saveLocalLastViewedProducts(),[2,!0]):[2,!1]}}))}))},this.customerLogin=function(r,i){return t(a,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.login({email:r,password:i,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&t.data?(s=t.data,this.setToken(s.token,s.tokenExpiry),s.customer&&this.setCustomer(s.customer),this.customer&&h.customerLogin(),this.saveLocalLastViewedProducts(),[2,{isSuccess:!0,errorCodes:[]}]):[2,{isSuccess:!1,errorCodes:t.errorCodes.map((function(t){return Object.values(p).includes(t)?t:p.UNKOWN}))}]}}))}))},this.logout=function(){var t;a.clearLocalData(),null===(t=a.baseStore)||void 0===t||t.cartStore.removeCart(),h.customerLogout()},this.register=function(r,i,s,o,c,u,d){return t(a,void 0,void 0,(function(){var t,a;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.register({email:s,password:o,firstName:r,lastName:i,isAcceptMarketing:c,attributes:u,captchaToken:this._captchaToken,phone:d})];case 2:return t=e.sent(),this.clearCaptchaToken(),t&&t.isSuccess&&(null===(a=t.data)||void 0===a?void 0:a.customer)?(this.setToken(t.data.token,t.data.tokenExpiry),this.setCustomer(t.data.customer),this.saveLocalLastViewedProducts(),h.completeRegistration(this.toAnalyticsCustomer(this.customer)),[2,{isSuccess:!0,errorCodes:[]}]):[2,{isSuccess:!1,errorCodes:t.errorCodes.map((function(t){return Object.values(f).includes(t)?t:f.UNKOWN}))}]}}))}))},this.activateCustomer=function(){return t(a,void 0,void 0,(function(){var t,r,i;return e(this,(function(e){switch(e.label){case 0:return t=new URLSearchParams(window.location.search),(r=t.get("token"))?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.activateCustomer({token:r,captchaToken:this._captchaToken})];case 2:return i=e.sent(),this.clearCaptchaToken(),[2,i.isSuccess];case 3:return[2,!1]}}))}))},this.resendCustomerActivationMail=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.resendCustomerActivationMail({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess];case 3:return[2,!1]}}))}))},this.validateCustomerPhoneVerificationCode=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.validateCustomerPhoneVerificationCode({verificationCode:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!(!t.isSuccess||!t.data)&&t.data];case 3:return[2,!1]}}))}))},this.resendCustomerPhoneVerificationCode=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return r?[4,this.getCaptcha()]:[3,3];case 1:return e.sent(),[4,n.resendCustomerPhoneVerificationCode({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!(!t.isSuccess||!t.data)&&t.data];case 3:return[2,!1]}}))}))},this.saveContactForm=function(i){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return h.contactForm(i),[4,this.getCaptcha()];case 1:return e.sent(),[4,n.sendContactFormToMerchant(r(r({},i),{captchaToken:this._captchaToken}))];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess]}}))}))},this.checkEmail=function(r){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.checkEmail({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!!t.isSuccess&&!!(null===(i=t.data)||void 0===i?void 0:i.exists)]}}))}))},this.forgotPassword=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.forgotPassword({email:r,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,!!t.isSuccess&&t.data]}}))}))},this.recoverPassword=function(r,i,s){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.recoverPassword({password:r,passwordAgain:i,token:s,captchaToken:this._captchaToken})];case 2:return t=e.sent(),this.clearCaptchaToken(),[2,t.isSuccess]}}))}))},this.saveCustomer=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n.saveCustomer({input:new v(r)})];case 1:return(t=e.sent()).isSuccess&&t.data?(this.setCustomer(t.data),[2,!0]):[2,!1]}}))}))},this.getOrders=function(){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.getOrders({})];case 1:return[2,t.sent().data||[]]}}))}))},this.getOrder=function(r){return t(a,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:return[4,n.getOrders({orderId:r})];case 1:return(t=e.sent()).isSuccess&&(null===(s=t.data)||void 0===s?void 0:s.length)?(i=t.data[0],[4,this.getOrderRefundSettings()]):[2,null];case 2:return e.sent(),i.refundSettings=this._refundSettings,[2,i]}}))}))},this.getOrderByEmail=function(r,i){return t(a,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return[4,n.getOrderByEmail({email:r,orderNumber:i})];case 1:return(t=e.sent()).isSuccess&&t.data?(s=t.data,[4,this.getOrderRefundSettings()]):[2,null];case 2:return e.sent(),s.refundSettings=this._refundSettings,[2,s]}}))}))},this.getOrderTransactions=function(r){return void 0===r&&(r={}),t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.listOrderTransactions({checkoutId:{eq:r.checkoutId},id:{eq:r.checkoutId},orderId:{eq:r.orderId}})];case 1:return[2,t.sent().data||[]]}}))}))},this.getFavoriteProductsIds=function(){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.customer?[4,n.listFavoriteProducts()]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))},this.getFavoriteProducts=function(){return t(a,void 0,void 0,(function(){var t,r,i,s,o,a;return e(this,(function(e){switch(e.label){case 0:return this.customer?[4,n.listFavoriteProducts()]:[2,[]];case 1:return(t=e.sent()).isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)?[4,l.searchProducts({input:{productIdList:t.data.map((function(t){return t.productId})),priceListId:m.getPriceListId(),salesChannelId:m.getSalesChannelId(),perPage:100}})]:[2,[]];case 2:return r=e.sent(),null===(o=null===(s=r.data)||void 0===s?void 0:s.data)||void 0===o||o.forEach((function(t){t.selectedVariantValues=t.variants[0].variantValues})),[2,(null===(a=null==r?void 0:r.data)||void 0===a?void 0:a.data)||[]]}}))}))},this.addProductToFavorites=function(r){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,n.saveFavoriteProduct({isFavorite:!0,productId:r})];case 1:return t=e.sent(),h.addToWishlist(r),[2,t.data||!1]}}))}))},this.removeProductFromFavorites=function(r){return t(a,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.customer)||void 0===i?void 0:i.id))throw Error("Unauthorized");return[4,n.saveFavoriteProduct({isFavorite:!1,productId:r})];case 1:return t=e.sent(),h.addToWishlist(r,!0),[2,t.data||!1]}}))}))},this.isProductFavorite=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!(null===(t=this.customer)||void 0===t?void 0:t.id))throw Error("Unauthorized");return[4,n.isFavoriteProduct({productId:r})];case 1:return[2,e.sent().data||!1]}}))}))},this.createEmailSubscription=function(r){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.subscribeToMarketingNotifications({input:{email:r,captchaToken:this._captchaToken}})];case 2:return(t=e.sent()).isSuccess&&(window.localStorage.setItem("customerEmailSubscription","true"),this.customer?(this.customer.subscriptionStatus,c.SUBSCRIBED):this._visitorSubscribedEmail=!0,h.createEmailSubscripition(r)),[2,t.isSuccess]}}))}))},this.saveCustomerFormData=function(i){return t(a,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getCaptcha()];case 1:return e.sent(),[4,n.saveCustomerFormData({input:r(r({},i),{captchaToken:this._captchaToken})})];case 2:return(t=e.sent()).isSuccess&&(window.localStorage.setItem("customerEmailSubscription","true"),this.customer?(this.customer.subscriptionStatus,c.SUBSCRIBED):this._visitorSubscribedEmail=!0,h.createEmailSubscripition(i.email)),[2,t.isSuccess]}}))}))},this.sendReview=function(i){return t(a,void 0,void 0,(function(){var t,s,o,a,c;return e(this,(function(e){switch(e.label){case 0:if(t=m.getCustomerReviewSettings(),s=m.getSalesChannelId(),o=m.getCurrentLocale(),!t)return[2];if(!(a=null===(c=this.customer)||void 0===c?void 0:c.id)&&t.customerLoginRequired)throw Error("Unauthorized");return[4,n.createCustomerReview({input:r(r({},i),{customerId:t.customerLoginRequired?a:void 0,salesChannelId:s||"",locale:o})})];case 1:return[2,e.sent().data]}}))}))},this.deactivateCustomer=function(r){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.customer?[4,n.deactivateCustomer({password:r})]:[3,2];case 1:return[2,t.sent()];case 2:return[2]}}))}))},this.exportCustomerPersonalData=function(){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.customer?[4,n.exportCustomerPersonelData()]:[3,2];case 1:return[2,t.sent()];case 2:return[2]}}))}))},this.onCustomerConsentGrant=function(){a.saveCustomerConsent()},this.waitUntilInitialized=function(){return new Promise((function(t){var e=setInterval((function(){a.initialized&&(clearInterval(e),t(null))}),100)}))},this.waitUntilCaptchaTokenInitialized=function(){return new Promise((function(t){var e=setInterval((function(){a._captchaToken&&(clearInterval(e),t(null))}),100)}))},this.getRaffles=function(){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return[4,d.listRaffleParticipants()];case 1:return(t=e.sent())&&t.data?[4,g(t.data)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2,null===(r=t.data)||void 0===r?void 0:r.map((function(t){return new u(t)}))]}}))}))},this.getCustomerAttributes=function(){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return[4,n.listCustomerAttribute()];case 1:return t=e.sent(),this.customer&&(null===(r=this.customer.attributes)||void 0===r||r.forEach((function(e){var r,i,s;e.customerAttribute=(null===(r=t.data)||void 0===r?void 0:r.find((function(t){return t.id===e.customerAttributeId})))||null,e.customerAttributeOptionId&&(e.customerAttributeOption=(null===(s=null===(i=e.customerAttribute)||void 0===i?void 0:i.options)||void 0===s?void 0:s.find((function(t){return t.id===e.customerAttributeOptionId})))||null)}))),[2,t.data||[]]}}))}))},this.getOrderProductFiles=function(r){return t(a,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return r.length?[4,w.listProductFile({id:{in:r}})]:[2,[]];case 1:return[2,t.sent().data||[]]}}))}))},this.getDigitalProductFileDownloadUrl=function(r,i){return t(a,void 0,void 0,(function(){var t,s,o,n,a;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),(t=r.orderLineItems.find((function(t){return t.variant.id===i.variantId})))?[4,w.getDigitalProductFileDownloadUrl({orderId:r.id,orderLineItemId:t.id})]:[3,2];case 1:s=e.sent(),(o=s.data)&&((n=document.createElement("a")).href=o,n.download=decodeURIComponent(i.name.split("/")[i.name.split("/").length-1])||"",n.click(),n.remove()),e.label=2;case 2:return[3,4];case 3:return a=e.sent(),console.error(a),[3,4];case 4:return[2]}}))}))},this.getOrderRefundSettings=function(){return t(a,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return this._refundSettings?[3,2]:[4,n.listOrderRefundSettings({})];case 1:(t=e.sent()).isSuccess&&(null===(r=t.data)||void 0===r?void 0:r.length)&&(this._refundSettings=t.data[0]),e.label=2;case 2:return[2]}}))}))},this.setSavedLastViewedProductsResponse=function(t){a._savedLastViewedProducts=o(a._lastViewedProducts),a._savedLastViewedProductsResponse=t},this.setCaptchaToken=function(t){a._captchaToken=t},this.baseStore=s,i(this)}return Object.defineProperty(b.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"canCreateEmailSubscription",{get:function(){var t;return!((null===(t=this.customer)||void 0===t?void 0:t.isSubscribed)||k||this._visitorSubscribedEmail)&&!window.localStorage.getItem("customerEmailSubscription")},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"customerConsentGranted",{get:function(){return this._customerConsentGranted},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"isCaptchaRequired",{get:function(){var t;return(null===(t=m.getCustomerSettings())||void 0===t?void 0:t.requireCaptchaValidation)||!1},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"useLastViewedProductResponse",{get:function(){var t;return(null===(t=this._savedLastViewedProducts)||void 0===t?void 0:t.length)&&this._savedLastViewedProductsResponse&&0===s(this._lastViewedProducts,this._savedLastViewedProducts,"productId").length},enumerable:!1,configurable:!0}),b.prototype.socialLogin=function(r){return t(this,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:return"undefined"==typeof window?[2]:(t=new URLSearchParams(window.location.search).get("redirect")||"",i="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/ms/").concat(r,"/login/authenticate?redirect=").concat(t),[4,fetch(i,{headers:{"x-api-key":m.getApiKey()||"","x-sfid":m.getStorefrontId()||"","x-sfrid":m.getStorefrontRoutingId()||""}})]);case 1:return[4,e.sent().json()];case 2:return s=e.sent(),window.location.href=s.redirectUrl,[2]}}))}))},b.prototype.socialLoginToken=function(r){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n.socialLogin({code:r})];case 1:return(null==(t=e.sent())?void 0:t.isSuccess)&&(null===(i=t.data)||void 0===i?void 0:i.customer)?(this.setToken(t.data.token,t.data.tokenExpiry),this.setCustomer(t.data.customer),this.customer&&h.customerLogin(),[2,!0]):[2,!1]}}))}))},b.prototype.refundOrder=function(r,i){return t(this,void 0,void 0,(function(){var t,s,o=this;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=[],r.orderLineItems.map((function(e){null!==e.refundQuantity&&(null==t||t.push({orderLineItemId:e.id,quantity:e.refundQuantity?e.refundQuantity:0}))})),[4,n.createOrderRefundRequest({input:{email:i,orderId:r.id,orderLineItems:t}})];case 1:return(s=e.sent()).isSuccess&&s.data?(Object.entries(s.data).forEach((function(t){var e=t[0],r=t[1];o[e]=r})),[2,!0]):[3,3];case 2:return e.sent(),[3,3];case 3:return[2,!1]}}))}))},b.prototype.init=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.loadToken(),this.loadLastViewedProducts(),this.loadCustomerConsent(),[4,this.refreshToken()];case 1:return t.sent(),[4,this.getCustomer()];case 2:return t.sent(),this._initialized=!0,this.customer&&h.customerVisit(),[2]}}))}))},b.prototype.routeChangeInit=function(){this.loadToken(),!this.token&&this.customer&&this.clearLocalData(),this.token&&!this.customer&&this.getCustomer()},b.prototype.getCustomer=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return k||!this.token?[2]:[4,n.getCustomer()];case 1:return(t=e.sent()).data&&this.setCustomer(t.data),[2]}}))}))},b.prototype.refreshToken=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.token?[4,n.refreshToken({token:this.token})]:[2];case 1:return(t=e.sent()).isSuccess&&t.data?this.setToken(t.data.token,t.data.tokenExpiry):(this.token=null,this.tokenExpiry=null,this.clearLocalData()),[2]}}))}))},b.prototype.setCustomer=function(t){this.customer=new a(t)},b.prototype.getLastViewedProducts=function(){var r;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.customer?[4,n.getLastViewedProducts({customerId:this.customer.id})]:[3,2];case 1:return t=e.sent(),this._lastViewedProducts=(null===(r=o(t.data))||void 0===r?void 0:r.reverse())||[],[3,3];case 2:this.loadLastViewedProducts(),e.label=3;case 3:return[2,this._lastViewedProducts]}}))}))},b.prototype.saveLastViewedProducts=function(){k||window.localStorage.setItem("lastViewedProducts",JSON.stringify(this._lastViewedProducts))},b.prototype.loadLastViewedProducts=function(){k||(this._lastViewedProducts=this.getLocalLastViewedProducts(),this._lastViewedProducts=o(this._lastViewedProducts).reverse())},b.prototype.getLocalLastViewedProducts=function(){if(k)return[];try{var t=window.localStorage.getItem("lastViewedProducts");if(t)return JSON.parse(t)}catch(t){}return[]},b.prototype.removeLastViewedProducts=function(){k||window.localStorage.removeItem("lastViewedProducts")},b.prototype.onProductView=function(r,i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this.customer?this._lastViewedProducts.find((function(t){return t.productId===r}))?[2]:[4,n.saveLastViewedProducts({input:{customerId:this.customer.id,products:[{productId:r,variantId:i}]}})]:[3,2];case 1:return t.sent()&&this._lastViewedProducts.push({productId:r,variantId:i}),[3,3];case 2:this._lastViewedProducts=this.getLocalLastViewedProducts(),this._lastViewedProducts=this._lastViewedProducts.filter((function(t){return t.productId!==r})),this._lastViewedProducts.push({productId:r,variantId:i}),this._lastViewedProducts=this._lastViewedProducts.slice(-20),this.saveLastViewedProducts(),t.label=3;case 3:return[2]}}))}))},b.prototype.saveLocalLastViewedProducts=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(k)return[2];e.label=1;case 1:return e.trys.push([1,4,,5]),(t=this.getLocalLastViewedProducts()).length?[4,n.saveLastViewedProducts({input:{customerId:this.customer.id,products:t}})]:[3,3];case 2:e.sent()&&this.removeLastViewedProducts(),e.label=3;case 3:return[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}}))}))},b.prototype.saveCustomerConsent=function(){k||(this._customerConsentGranted=!0,window.localStorage.setItem("customerConsent","true"))},b.prototype.loadCustomerConsent=function(){k||(this._customerConsentGranted=!!window.localStorage.getItem("customerConsent"))},b.prototype.removeCustomerConsent=function(){k||window.localStorage.removeItem("customerConsent")},b.prototype.setToken=function(t,e){k||(this.token=t,this.tokenExpiry=e,localStorage.setItem("customerToken",t),localStorage.setItem("customerTokenExpiry",e+""),m.init({customerToken:t}))},b.prototype.loadToken=function(){if(!k){var t=localStorage.getItem("customerToken"),e=localStorage.getItem("customerTokenExpiry");t&&e?this.setToken(t,parseInt(e)):this.clearLocalTokenData()}},b.prototype.clearLocalTokenData=function(){localStorage.removeItem("customerToken"),localStorage.removeItem("customerTokenExpiry"),this.token=void 0,this.tokenExpiry=void 0},b.prototype.clearLocalData=function(){this.clearLocalTokenData(),this.customer=void 0,m.init({customerToken:""}),this.clearCaptchaToken()},b.prototype.clearCaptchaToken=function(){this._captchaToken=null},b.prototype.getCaptcha=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.isCaptchaRequired?(window.grecaptcha.execute(),[4,this.waitUntilCaptchaTokenInitialized()]):[3,2];case 1:e.sent(),window.grecaptcha.reset(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.log("Get captcha error",t),[3,4];case 4:return[2]}}))}))},b}();export{b as IkasCustomerStore};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.20",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ikas/popup-renderer": "1.0.
|
|
20
|
+
"@ikas/popup-renderer": "1.0.181",
|
|
21
21
|
"swiper": "11.0.6"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@ikas/storefront-api": "^5.0.
|
|
25
|
-
"@ikas/storefront-config": "^5.0.
|
|
26
|
-
"@ikas/storefront-model-functions": "^5.0.
|
|
27
|
-
"@ikas/storefront-models": "^5.0.
|
|
28
|
-
"@ikas/storefront-providers": "^5.0.
|
|
24
|
+
"@ikas/storefront-api": "^5.0.20",
|
|
25
|
+
"@ikas/storefront-config": "^5.0.20",
|
|
26
|
+
"@ikas/storefront-model-functions": "^5.0.20",
|
|
27
|
+
"@ikas/storefront-models": "^5.0.20",
|
|
28
|
+
"@ikas/storefront-providers": "^5.0.20",
|
|
29
29
|
"@ikas/localized-address": "1.0.0-beta.3",
|
|
30
30
|
"@adyen/adyen-web": "^5.57.0",
|
|
31
31
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@ikas/localized-address": "1.0.0-beta.3",
|
|
63
|
-
"@ikas/storefront-api": "^5.0.
|
|
64
|
-
"@ikas/storefront-config": "^5.0.
|
|
65
|
-
"@ikas/storefront-model-functions": "^5.0.
|
|
66
|
-
"@ikas/storefront-models": "^5.0.
|
|
67
|
-
"@ikas/storefront-providers": "^5.0.
|
|
63
|
+
"@ikas/storefront-api": "^5.0.20",
|
|
64
|
+
"@ikas/storefront-config": "^5.0.20",
|
|
65
|
+
"@ikas/storefront-model-functions": "^5.0.20",
|
|
66
|
+
"@ikas/storefront-models": "^5.0.20",
|
|
67
|
+
"@ikas/storefront-providers": "^5.0.20",
|
|
68
68
|
"mobx": "^6.1.3",
|
|
69
69
|
"mobx-react-lite": "^3.1.5",
|
|
70
70
|
"next": "12.2.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import o from"react";import{observer as e}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{getHorizontalAlignment as r,injectFontScript as n}from"../../helpers/index.js";var i=e((function(e){var i=e.element,a={display:"flex",alignItems:"center",justifyContent:r(i.horizontalAlignment),padding:"".concat(i.outerVerticalPadding,"px ").concat(i.outerHorizontalPadding,"px"),backgroundColor:i.bgColor},l={color:i.color,backgroundColor:i.buttonBgColor,fontSize:i.fontSize,fontWeight:i.fontWeight,fontFamily:n(i.fontFamily),textAlign:"center",border:"".concat(i.borderWidth,"px ").concat(i.borderStyle," ").concat(i.borderColor),borderRadius:i.borderRadius,padding:"".concat(i.verticalPadding,"px ").concat(i.horizontalPadding,"px")},d={width:"".concat(i.width,"%"),minWidth:"fit-content",cursor:"pointer"};return o.createElement("div",{style:a},o.createElement("a",{href:i.link||void 0,style:d,target:"_blank"},o.createElement("div",{dangerouslySetInnerHTML:{__html:i.text},style:t({},l)})))}));export{i as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"react";import{observer as o}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{getHorizontalAlignment as e}from"../../helpers/index.js";import{ButtonBorderStyle as r}from"../../models/modal/background-settings/index.js";var d=o((function(o){var d=o.element,n={display:"flex",alignItems:"center",justifyContent:e(d.horizontalAlignment),padding:"".concat(d.verticalPadding,"px ").concat(d.horizontalPadding,"px"),backgroundColor:d.bgColor,width:"100%"},a=d.borderStyle===r.SOLID?"solid":d.borderStyle===r.DASHED?"dashed":"dotted",i={width:"".concat(d.width,"%"),height:"".concat(d.borderWidth,"px"),borderRadius:"".concat(d.borderRadius,"px"),borderBottom:"".concat(d.borderWidth,"px ").concat(a," ").concat(d.borderColor)};return t.createElement("div",{style:n},t.createElement("div",{style:i}))}));export{d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";import{observer as t}from'./../../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';var r=t((function(t){var r=t.checkboxItem;e.useEffect((function(){r.showInCheckedStatus?r.isChecked=!0:r.isChecked=!1}),[r.showInCheckedStatus]);var o=r.requiredToBeChecked,i=e.useCallback((function(){var e=/<pre[^>]*>([\s\S]*?)<\/pre>/.exec(r.text);return e?e[1]:r.text}),[]);return e.createElement("div",{style:{width:"100%",display:"flex",gap:6,flexDirection:"column"}},e.createElement("div",{style:{width:"100%",display:"flex",gap:8,flexDirection:"row",alignItems:"baseline",wordBreak:"break-word"}},e.createElement("input",{style:{width:"16px",height:"16px",cursor:"pointer",position:"relative",top:3},type:"checkbox",checked:r.isChecked,onChange:function(){r.isChecked=!r.isChecked,o&&o.hasError&&r.isChecked&&(o.hasError=!1)}}),e.createElement("div",{dangerouslySetInnerHTML:{__html:i()}})),!!o&&o.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},o.validationErrorMessage))}));export{r as CheckboxItemView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";import{observer as r}from'./../../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import t from"react-date-picker";var a=r((function(r){var a=e.useState(!1),o=a[0],l=a[1],n=e.useRef(null);r.placeholder;var c=r.isRequired,i=r.inputLabel;r.updateCurrentInfo;var s=r.formInputSettings,d=r.value,u=r.onValueChange;return e.useEffect((function(){if(n.current){var e=n.current.getElementsByClassName("react-date-picker__wrapper");if(e.length>0){var r=e[0];r.style.backgroundColor=s.bgColor,r.style.border="".concat(s.borderWidth,"px solid ").concat(o?s.focusBorderColor:s.borderColor),r.style.borderRadius="".concat(s.borderRadius,"px"),r.style.fontSize="14px",r.style.padding="10px 12px",r.style.height="".concat(s.height,"px")}}}),[n.current]),e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"},ref:n},(i||c)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},i&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},i.text),c&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},"*")),c&&c.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},c.validationErrorMessage)),e.createElement(t,{onChange:function(e){return function(e){var r=e?e.valueOf().toString():"";u(r),c&&c.hasError&&r.length>0&&(c.hasError=!1)}(e)},value:d?new Date(Number(d)):null,className:"ikas-popup-datepicker",disableCalendar:!0,format:"dd / MM / yyyy",maxDate:new Date,clearIcon:null,onFocus:function(){return l(!0)},onBlur:function(){return function(){if(l(!1),n.current){var e=n.current.getElementsByClassName("react-date-picker__wrapper");e.length>0&&(e[0].style.border="".concat(s.borderWidth,"px solid ").concat(s.borderColor))}}()}}))}));export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";import{observer as r}from'./../../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';var t=r((function(r){var t,o=e.useState(!1),n=o[0],i=o[1],l=r.genderFormItem,a=r.formInputSettings;r.onValueChange;var d={width:"100%",backgroundColor:a.bgColor,border:"".concat(a.borderWidth,"px solid ").concat(n?a.focusBorderColor:a.borderColor),color:l.genders.find((function(e){return e.isSelected}))?"black":"#697586",borderRadius:"".concat(a.borderRadius,"px"),fontSize:"14px",padding:"10px 12px",height:"".concat(a.height,"px"),appearance:"none",backgroundImage:"url(\"data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' %3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E\")",backgroundRepeat:"no-repeat",backgroundPosition:"right 12px center",backgroundSize:"20px",cursor:"pointer"};return e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"}},(l.inputLabel||l.required)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},l.inputLabel&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},l.inputLabel.text),l.required&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},"*")),l.required&&l.required.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},l.required.validationErrorMessage)),e.createElement("select",{value:(null===(t=l.genders.find((function(e){return e.isSelected})))||void 0===t?void 0:t.type)||void 0,onChange:function(e){return r=e.target.value,l.genders.forEach((function(e){e.isSelected=e.type===r})),void(l.required&&l.required.hasError&&(l.required.hasError=!1));var r},style:d,onFocus:function(){return i(!0)},onBlur:function(){return i(!1)}},!!l.placeholder&&e.createElement("option",{value:"",disabled:!0,selected:!0,hidden:!0},l.placeholder.text),l.genders.filter((function(e){return!!e.label})).map((function(r){return e.createElement("option",{key:r.type,value:r.type},r.label)}))))}));export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as r}from"../../../ext/tslib/tslib.es6.mjs.js";import t from"react";import{observer as n}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{getHorizontalAlignment as a,injectFontScript as o,validateEmail as i,validatePhoneNumber as l}from"../../helpers/index.js";import{FormItemTypeEnum as s}from"../../models/modal/step/elements/form/index.js";import m from"../button-element-renderer/index.js";import u from"./input-item-view/index.js";import{CheckboxItemView as c}from"./checkbox-item-view/index.js";import d from"./date-item-view/index.js";import f from"./gender-item-view/index.js";var E=n((function(n){var E=n.element,p=n.popup,v=n.isPreviewMode,C=n.sfProps,I=t.useState(!1);I[0];var h=I[1],M=E,S=M.rows.slice().sort((function(e,r){return e.order-r.order})),g=M.formSettings,R=M.buttonSettings,O=M.bgColor,_={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:a(M.horizontalAlignment),gap:"".concat(g.gapBetweenItems,"px"),padding:"".concat(M.outerVerticalPadding,"px ").concat(M.outerHorizontalPadding,"px"),backgroundColor:O,width:"100%"},T={display:"flex",flexDirection:"row",width:"100%",gap:"".concat(g.gapBetweenItems,"px")},b={flex:1,display:"flex",alignItems:"flex-end",fontFamily:o(g.fontFamily),fontSize:g.fontSize},U=function(){return e(void 0,void 0,void 0,(function(){var e,t,n;return r(this,(function(r){switch(r.label){case 0:return e=p.modal.steps.findIndex((function(e){return e.id===p.modal.selectedStep.id})),t=e===p.modal.steps.length-2,!v&&C&&t?(h(!0),a=0,M.rows.forEach((function(e){e.columns.forEach((function(e){switch(e.type){case s.CUSTOMER_BIRTHDAY:var r=e.formItem;r.required&&!r.value&&(r.required.hasError=!0,a++);break;case s.CUSTOMER_EMAIL:case s.CUSTOMER_PHONE:case s.CUSTOMER_NAME:case s.CUSTOMER_SURNAME:var t=e.formItem;if(t.required&&!t.value){if(t.type===s.CUSTOMER_EMAIL&&(null==C?void 0:C.isCustomerLoggedIn))return;t.required.hasError=!0,a++}else if(e.type===s.CUSTOMER_EMAIL){var n=i(t.value||"");t.validEmailError.hasError=!n,n||a++}else if(e.type===s.CUSTOMER_PHONE){var o=l(t.value||"",null==C?void 0:C.currentCountryCode);t.validPhoneError.hasError=!o,o||a++}break;case s.CUSTOMER_GENDER:var m=e.formItem,u=m.genders.find((function(e){return e.isSelected}));m.required&&!u&&(m.required.hasError=!0,a++);break;case s.CHECKBOX_FORM_ITEM:var c=e.formItem;c.requiredToBeChecked&&!c.isChecked&&(c.requiredToBeChecked.hasError=!0,a++)}}))})),a>0?(h(!1),[2]):(n={},M.rows.forEach((function(e){e.columns.forEach((function(e){var r;switch(e.type){case s.CUSTOMER_BIRTHDAY:n.birthday=e.formItem.value;break;case s.CUSTOMER_EMAIL:n.email=e.formItem.value;break;case s.CUSTOMER_GENDER:n.gender=(null===(r=e.formItem.genders.find((function(e){return e.isSelected})))||void 0===r?void 0:r.type)||"";break;case s.CUSTOMER_PHONE:n.phone=e.formItem.value;break;case s.CUSTOMER_NAME:n.firstName=e.formItem.value||"";break;case s.CUSTOMER_SURNAME:n.lastName=e.formItem.value||"";break;case s.CHECKBOX_FORM_ITEM:n.hasPermission=e.formItem.isChecked}}))})),[4,C.onCustomerSave(n)])):[3,2];case 1:r.sent(),h(!1),r.label=2;case 2:return-1!==e&&e<p.modal.steps.length&&(p.modal.selectedStep=p.modal.steps[e+1]),[2]}var a}))}))},x={width:"".concat(R.width,"%"),minWidth:"fit-content"};return t.createElement("div",{style:_},S.map((function(e,r){return t.createElement("div",{style:T,key:r},e.columns.slice().sort((function(e,r){return e.order-r.order})).map((function(e,r){return t.createElement("div",{style:b,key:r},function(e){switch(e.type){case s.CUSTOMER_EMAIL:case s.CUSTOMER_PHONE:case s.CUSTOMER_NAME:case s.CUSTOMER_SURNAME:var r=e.formItem;if(r.type===s.CUSTOMER_EMAIL&&(null==C?void 0:C.isCustomerLoggedIn)&&!v)return null;var n=null;if(e.type===s.CUSTOMER_EMAIL){var a=r;a.validEmailError.hasError&&(n=a.validEmailError.validationErrorMessage)}else if(e.type===s.CUSTOMER_PHONE){var o=r;o.validPhoneError.hasError&&(n=o.validPhoneError.validationErrorMessage)}return t.createElement(u,{formInputSettings:g.formInputSettings,inputLabel:r.inputLabel,isRequired:r.required,onValueChange:function(e){return v?null:r.value=e},placeholder:r.placeholder,updateCurrentInfo:r.updateCurrentInfo,value:r.value||"",validationErrorMessage:n});case s.CUSTOMER_BIRTHDAY:var i=e.formItem;return t.createElement(d,{formInputSettings:g.formInputSettings,inputLabel:i.inputLabel,isRequired:i.required,onValueChange:function(e){return v?null:i.value=e},placeholder:i.placeholder,updateCurrentInfo:i.updateCurrentInfo,value:i.value||""});case s.CUSTOMER_GENDER:var l=e.formItem;return t.createElement(f,{genderFormItem:l,formInputSettings:g.formInputSettings,onValueChange:function(e){return v?null:l.genders.forEach((function(r){r.isSelected=r.label===e}))}});case s.CHECKBOX_FORM_ITEM:return t.createElement(c,{checkboxItem:e.formItem})}}(e))})))})),t.createElement("div",{style:x,onClick:function(e){U(),e.preventDefault(),e.stopPropagation()}},t.createElement(m,{element:R})," "))}));export{E as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";import{observer as t}from'./../../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';var r=t((function(t){var r=e.useState(!1),o=r[0],n=r[1];e.useRef(null);var l=t.placeholder,a=t.isRequired,i=t.inputLabel;t.updateCurrentInfo;var c=t.validationErrorMessage,d=t.formInputSettings,u=t.value,s=t.onValueChange,p={width:"100%",backgroundColor:d.bgColor?"".concat(d.bgColor):"transparent",border:"".concat(d.borderWidth,"px solid ").concat(o?d.focusBorderColor:d.borderColor),borderRadius:"".concat(d.borderRadius,"px"),fontSize:"14px",padding:"10px 12px",height:"".concat(d.height,"px"),outline:"none"},x=a?((null==l?void 0:l.text)||"")+" *":(null==l?void 0:l.text)||"";return e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"}},(i||a)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},i&&e.createElement("label",{style:{color:"black",fontSize:"14px"}},i.text)),a&&a.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},a.validationErrorMessage),!!c&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},c)),e.createElement("input",{type:"text",placeholder:x,value:u||"",onChange:function(e){return function(e){s(e),a&&a.hasError&&e.length>0&&(a.hasError=!1)}(e.target.value)},style:p,onFocus:function(){return n(!0)},onBlur:function(){return n(!1)}}))}));export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";import{observer as t}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{ImageFitEnum as r}from"../../models/modal/step/elements/image/index.js";var i=t((function(t){var i=t.element,o=t.popup,a=t.editModeChildren,d=t.isMobile,n=i;n.cdnURL||(n.cdnURL=o.cdnURL),n.merchantId||(n.merchantId=o.merchantId);var c=o.modal.windowSettings,m={width:c.takeFullWidth||d?"100%":c.maxWidth,backgroundColor:n.bgColor,padding:"".concat(n.verticalPadding,"px ").concat(n.horizontalPadding,"px"),borderRadius:n.borderRadius};if(!n.src&&o.isPreviewMode&&a)return e.createElement("div",{style:m},a);var l={objectFit:n.objectFit===r.CONTAIN?"contain":"cover",height:"100%"};return e.createElement("a",{href:n.link||void 0,style:m,target:"_blank"},n.src&&e.createElement("img",{src:n.src||void 0,width:"100% !important",style:l}))}));export{i as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";import{observer as t}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{ImagePositionEnum as i,ImageFitEnum as o}from"../../models/modal/step/elements/image/index.js";var a=t((function(t){var a=t.element,r=t.popup,n=t.editModeChildren,d=a;if(d.cdnURL||(d.cdnURL=r.cdnURL),d.merchantId||(d.merchantId=r.merchantId),!d.src&&r.isPreviewMode&&n)return n;var m={display:"flex",alignItems:"center",justifyContent:d.imagePosition===i.DISABLE_FLOAT?"center":d.imagePosition===i.FLOAT_LEFT?"flex-start":"flex-end",padding:"".concat(d.verticalPadding,"px ").concat(d.horizontalPadding,"px"),backgroundColor:d.bgColor,maxWidth:"100%"},c={borderRadius:"".concat(d.borderRadius,"px"),objectFit:d.objectFit===o.CONTAIN?"contain":"cover",width:"".concat(d.maxWidth,"%")};return e.createElement("a",{href:d.link||void 0,style:m,target:"_blank"},e.createElement("img",{src:d.src||void 0,width:100===d.maxWidth?"100% !important":void 0,style:c}))}));export{a as default};
|
package/build/packages/storefront/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";import{observer as t}from'./../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{PopupTypeEnum as o,PopupPositonEnum as n}from"../models/modal/index.js";import i from"../assets/x-close.js";import{CloseButtonPositionTypeEnum as r,CloseIconTypeEnum as l,CloseButtonDisplayTypeEnum as s}from"../models/modal/close-settings/index.js";import{PopupElementTypeEnum as a,ComponentVerticalAlignmentEnum as d}from"../models/modal/step/elements/base/index.js";import c from"./text-element-renderer/index.js";import m from"./button-element-renderer/index.js";import p from"./space-element-renderer/index.js";import u from"./divider-element-renderer/index.js";import f from"./social-element-renderer/index.js";import P from"./image-element-renderer/index.js";import E from"./image-column-element-renderer/index.js";import x from"./product-list-renderer/index.js";import g from"./form-element-renderer/index.js";import{ImageColumnPositionEnum as v,MobileImageColumnPositionEnum as T}from"../models/modal/step/elements/image-column/index.js";var y=t((function(t){var y,b,O,C,I=t.popup,_=t.dynamicData,h=t.dashboardComponents,M=t.previewMode,w=t.sfProps,A=t.isMobile,D=I.modal,R=D.teaser,S=!!D.selectedStep.isTeaser,k=D.selectedStep.elements.find((function(e){return e.type===a.IMAGE_COLUMN})),N=S?R.backgroundSettings:D.backgroundSettings,j=S?R.windowSettings:D.windowSettings,L=S?R.closeSettings:D.closeSettings,B=N.allowScrollingWhenPopupOpen,U=I.isPreviewMode||M,H=!!U||D.isVisible;document.body.style.overflow=H&&!B?"hidden":"auto";var W=N.overlay,F=N.border,V="center",G="center";switch(S?o.POPUP:D.type){case o.POPUP:var z=S?R.position:D.position;z===n.POPUP_TOP_LEFT?(V="flex-start",G="flex-start"):z===n.POPUP_TOP_CENTER?(V="center",G="flex-start"):z===n.POPUP_TOP_RIGHT?(V="flex-end",G="flex-start"):z===n.POPUP_MIDDLE_LEFT?(V="flex-start",G="center"):z===n.POPUP_MIDDLE_CENTER?(V="center",G="center"):z===n.POPUP_MIDDLE_RIGHT?(V="flex-end",G="center"):z===n.POPUP_BOTTOM_LEFT?(V="flex-start",G="flex-end"):z===n.POPUP_BOTTOM_CENTER?(V="center",G="flex-end"):z===n.POPUP_BOTTOM_RIGHT&&(V="flex-end",G="flex-end");break;case o.DRAWER:D.position===n.DRAWER_LEFT?(V="flex-start",G="center"):D.position===n.DRAWER_RIGHT&&(V="flex-end",G="center");break;case o.NOTIFICATION_BAR:D.position===n.NOTIFICATION_BAR_UP?(V="center",G="flex-start"):D.position===n.NOTIFICATION_BAR_DOWN&&(V="center",G="flex-end")}var K=e.useMemo((function(){return 2147483644}),[]),X=e.useMemo((function(){return K+1}),[]),Y=e.useMemo((function(){return X+1}),[]),q=e.useMemo((function(){return Y+1}),[]),J={position:"fixed",display:"flex",justifyContent:V,alignItems:G,top:0,left:0,right:0,bottom:0,zIndex:K,overflow:"hidden",padding:"".concat(j.outerVerticalPadding,"px ").concat(j.outerHorizontalPadding,"px"),opacity:H?1:0,visibility:H?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},Q={position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:X,backgroundColor:W?W.bgColor:"",opacity:W?(W.bgOpacity||100)/100:void 0},Z={position:"relative",zIndex:Y,backgroundColor:N.bgColor,border:F?"".concat(F.borderWidth,"px ").concat(F.borderStyle," ").concat(F.borderColor):"",borderRadius:"".concat(j.borderRadius,"px"),maxWidth:"100%",maxHeight:"100%",width:j.takeFullWidth?"100%":void 0,minHeight:j.minHeight,height:j.takeFullHeight?"100%":void 0,boxShadow:N.shadow?"0 0 10px ".concat(N.shadow.color):"",overflow:"auto",opacity:H?1:0,visibility:H?"visible":"hidden",transition:"opacity 0.3s ease, visibility 0.3s ease"},$="";switch(null==k?void 0:k.verticalAlignment){case d.BOTTOM:$="flex-end";break;case d.MIDDLE:$="center";break;case d.TOP:$="flex-start"}var ee=k?k.imagePosition===v.LEFT_ALIGN?"row-reverse":"row":"",te=k?k.mobilePosition===T.TOP?"column-reverse":"column":"",oe={display:"flex",flexDirection:k?A?te:ee:"column",overflow:"hidden"},ne={width:j.takeFullWidth?"100%":j.maxWidth,maxWidth:"100%",overflow:"auto",display:"flex",flexDirection:"column",justifyContent:$,padding:"".concat(j.innerVerticalPadding,"px ").concat(j.innerHorizontalPadding,"px")},ie={position:L.closeButtonPositionType===r.TAKE_SPACE?"relative":"absolute",float:L.closeButtonPositionType===r.TAKE_SPACE?"right":"none",top:8,right:8,zIndex:q},re={position:"sticky",padding:"6px",marginLeft:L.closeButtonPositionType===r.TAKE_SPACE?"14px":void 0,display:"flex",justifyContent:"center",alignItems:"center",border:(null===(y=L.iconSettings)||void 0===y?void 0:y.type)===l.WITH_BORDER?"1px solid ".concat(null===(b=L.iconSettings)||void 0===b?void 0:b.color):"",borderRadius:"50%",backgroundColor:null===(O=L.iconSettings)||void 0===O?void 0:O.backgroundColor},le={color:null===(C=L.iconSettings)||void 0===C?void 0:C.color,cursor:"pointer"},se=function(t){var o=t.type,n=h&&h[o]&&h[o].length?h[o][0]:null,i=n&&I.marketingPopupViewModel?e.createElement(n,{element:t,marketingPopupViewModel:I.marketingPopupViewModel}):void 0;switch(o){case a.TEXT:return e.createElement(c,{element:t});case a.IMAGE:return e.createElement(P,{element:t,popup:I,editModeChildren:i});case a.IMAGE_COLUMN:return A&&k.mobilePosition===T.HIDE?null:e.createElement(E,{element:t,popup:I,editModeChildren:i,isMobile:A});case a.BUTTON:return e.createElement(m,{element:t});case a.DIVIDER:return e.createElement(u,{element:t});case a.FORM:return e.createElement(g,{element:t,popup:I,isPreviewMode:!!U,sfProps:w});case a.PRODUCT_LIST:return e.createElement(x,{element:t,products:_.products[t.id],popup:I,editModeChildren:i,isPreviewMode:!!U,sfProps:w,onClose:ae});case a.SOCIAL_MEDIA:return e.createElement(f,{element:t,popup:I,editModeChildren:i});case a.SPACE:return e.createElement(p,{element:t})}},ae=function(e){U||D.isVisible&&(D.isVisible=!1,w&&w.onModalClose(e))};return e.createElement("div",{className:"ikas-popup-default-styles",id:"ikas-popup-container",style:J},e.createElement("div",{style:Z},L.closeButtonDisplayType!==s.ALWAYS_HIDDEN&&e.createElement("div",{style:ie,onClick:function(){return ae()}},e.createElement("div",{style:re,className:L.closeButtonDisplayType===s.VISIBLE_ON_HOVER?"visible-on-hover":""},e.createElement(i,{style:le}))),e.createElement("div",{style:oe,onClick:function(e){S&&(D.selectedStep=D.steps[0])}},e.createElement("div",{style:ne},D.selectedStep.elements.filter((function(e){return e.type!==a.IMAGE_COLUMN})).slice().sort((function(e,t){return e.order-t.order})).map((function(e){return se(e)}))),k&&se(k))),e.createElement("div",{style:Q,onClick:function(){return ae()}}))}));export{y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__spreadArray as t,__assign as e,__awaiter as o,__generator as n}from"../../../ext/tslib/tslib.es6.mjs.js";import i from"react";import{observer as l}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{getHorizontalAlignment as r,injectFontScript as d}from"../../helpers/index.js";import{ProductListTypeEnum as a,ProductListLayoutEnum as c}from"../../models/modal/step/elements/product/index.js";import s from"../button-element-renderer/index.js";import u from'./../../../../../../../../../ext/swiper/modules/navigation.mjs.js';import m from'./../../../../../../../../../ext/swiper/modules/scrollbar.mjs.js';import{Swiper as v,SwiperSlide as p}from'./../../../../../../../../../ext/swiper/swiper-react.mjs.js';import g from"../../assets/left-arrow.js";import f from"../../assets/right-arrow.js";import{ProductActionTypeEnum as b}from"../../models/modal/step/elements/product/detail-settings/index.js";var h=l((function(l){var h,x=l.element,y=l.products,E=l.popup,C=l.editModeChildren,w=l.isPreviewMode,P=l.sfProps,S=l.onClose,j=i.useState(null),R=j[0],z=j[1],_=i.useState(!1),W=_[0],A=_[1],I=i.useState(!1),D=I[0],F=I[1],k=x,T=[];if(y&&(T=k.listType===a.SPECIFIC?(null===(h=k.variantPairs)||void 0===h?void 0:h.length)?y.slice().sort((function(t,e){return k.variantPairs.findIndex((function(e){return e.variantId===t.variantId}))-k.variantPairs.findIndex((function(t){return t.variantId===e.variantId}))})):[]:t([],y,!0)),T.length>k.maxProductsToShow&&(T.length=k.maxProductsToShow),!(T&&T.length||!E.isPreviewMode)&&C)return C;if(!T||!T.length)return null;k.gapBetweenProductElements;var L=k.productDetailSettings.image,N=k.productDetailSettings.button,B=k.buttonSettings,M=k.productDetailSettings.discountRatio,O=k.productDetailSettings.finalPrice,U=k.productDetailSettings.originalPrice,H=k.productDetailSettings.name,V=r(k.horizontalAlignment),$=1;k.layout===c.ONE_COLUMN?$=1:k.layout===c.TWO_COLUMN?$=2:k.layout===c.THREE_COLUMN&&($=3);var q={padding:"".concat(k.outerVerticalPadding,"px ").concat(k.outerHorizontalPadding,"px"),backgroundColor:k.productBgColor,width:"100%",height:"max-content"},G={display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",height:"100%"},J={display:"flex",justifyContent:V,alignItems:"center",width:"100%",backgroundColor:null==L?void 0:L.bgColor,borderRadius:(null==L?void 0:L.borderRadius)?"".concat(L.borderRadius,"px"):void 0},K={width:"".concat(null==L?void 0:L.maxWidth,"%"),objectFit:"contain",borderRadius:(null==L?void 0:L.borderRadius)?"".concat(L.borderRadius,"px"):void 0},Q={display:"flex",flexDirection:"column",width:"100%"},X={display:"flex",flexDirection:"column"},Y={backgroundColor:null==H?void 0:H.bgColor,color:null==H?void 0:H.color,fontFamily:H?d(H.fontFamily):void 0,fontSize:null==H?void 0:H.fontSize,fontWeight:null==H?void 0:H.fontWeight,padding:"".concat(null==H?void 0:H.verticalPadding,"px ").concat(null==H?void 0:H.horizontalPadding,"px"),width:"100%",textAlign:null==H?void 0:H.horizontalAlignment,border:"".concat(null==H?void 0:H.borderWidth,"px ").concat(null==H?void 0:H.borderStyle," ").concat(null==H?void 0:H.borderColor),borderRadius:null==H?void 0:H.borderRadius},Z={backgroundColor:null==M?void 0:M.bgColor,color:null==M?void 0:M.color,fontFamily:M?d(M.fontFamily):void 0,fontSize:null==M?void 0:M.fontSize,fontWeight:null==M?void 0:M.fontWeight,padding:"".concat(null==M?void 0:M.verticalPadding,"px ").concat(null==M?void 0:M.horizontalPadding,"px"),width:"100%",textAlign:null==M?void 0:M.horizontalAlignment,border:"".concat(null==M?void 0:M.borderWidth,"px ").concat(null==M?void 0:M.borderStyle," ").concat(null==M?void 0:M.borderColor),borderRadius:null==M?void 0:M.borderRadius},tt={textDecoration:"line-through",backgroundColor:null==U?void 0:U.bgColor,color:null==U?void 0:U.color,fontFamily:U?d(U.fontFamily):void 0,fontSize:null==U?void 0:U.fontSize,fontWeight:null==U?void 0:U.fontWeight,padding:"".concat(null==U?void 0:U.verticalPadding,"px ").concat(null==U?void 0:U.horizontalPadding,"px"),width:"100%",textAlign:null==U?void 0:U.horizontalAlignment,border:"".concat(null==U?void 0:U.borderWidth,"px ").concat(null==U?void 0:U.borderStyle," ").concat(null==U?void 0:U.borderColor),borderRadius:null==U?void 0:U.borderRadius},et={backgroundColor:null==O?void 0:O.bgColor,color:null==O?void 0:O.color,fontFamily:O?d(O.fontFamily):void 0,fontSize:null==O?void 0:O.fontSize,fontWeight:null==O?void 0:O.fontWeight,padding:"".concat(null==O?void 0:O.verticalPadding,"px ").concat(null==O?void 0:O.horizontalPadding,"px"),width:"100%",textAlign:null==O?void 0:O.horizontalAlignment,border:"".concat(null==O?void 0:O.borderWidth,"px ").concat(null==O?void 0:O.borderStyle," ").concat(null==O?void 0:O.borderColor),borderRadius:null==O?void 0:O.borderRadius},ot={width:"".concat(B.width,"%"),minWidth:"fit-content"},nt=e({display:"flex",justifyContent:"center",width:"100%",gap:"10px"},1===$?{position:"absolute",top:"calc(50% - 25px)",alignItems:"center",justifyContent:"space-between",zIndex:10}:void 0),it={padding:10,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",border:"1px solid #EEF2F6",cursor:"pointer"};return i.createElement("div",{style:q},i.createElement(v,{onSwiper:z,modules:[u,m],spaceBetween:k.gapBetweenProducts,slidesPerView:$,navigation:{nextEl:".custom-next-button",prevEl:".custom-prev-button"},scrollbar:void 0},T.map((function(t,e){return i.createElement(p,{style:{height:"auto"},key:t.variantId},i.createElement("div",{style:G,onClick:function(){return function(t){return o(void 0,void 0,void 0,(function(){var e,o;return n(this,(function(n){switch(n.label){case 0:return w||!t.url?[3,4]:(null===(o=k.productDetailSettings.button)||void 0===o?void 0:o.action)===b.ADD_TO_CART&&P?[4,P.addProductToCart(t)]:[3,2];case 1:return n.sent()&&((e=document.createElement("a")).href="".concat(E.storeUrl,"/cart"),e.target="_self",e.click()),[3,3];case 2:(e=document.createElement("a")).href=t.url,e.target="_self",e.click(),n.label=3;case 3:S(!0),n.label=4;case 4:return[2]}}))}))}(t)}},i.createElement("div",{style:Q},!!L&&t.imageURL&&i.createElement("div",{style:J},i.createElement("img",{src:t.imageURL||void 0,alt:t.name||void 0,style:K})),(!!H||!!M)&&i.createElement("div",{style:X},!!H&&i.createElement("div",{style:Y},t.name),!!M&&!!t.discountPrice&&i.createElement("div",{style:Z},t.$discountRatio)),(!!U||!!O)&&i.createElement("div",null,!!U&&!!t.discountPrice&&i.createElement("div",{style:tt},t.price),!!O&&i.createElement("div",{style:et},t.discountPrice||t.price))),!!N&&i.createElement("div",{style:ot}," ",i.createElement(s,{element:B})," ")))})),i.createElement("div",{style:nt},i.createElement("div",{className:"custom-prev-button",style:e(e({},it),W?{opacity:.5,cursor:"not-allowed"}:{}),onClick:function(){R&&(R.slidePrev(),F(R.isEnd),A(R.isBeginning))}},i.createElement(g,null)),i.createElement("div",{className:"custom-next-button",style:e(e({},it),D?{opacity:.5,cursor:"not-allowed"}:{}),onClick:function(){R&&(R.slideNext(),F(R.isEnd),A(R.isBeginning))}},i.createElement(f,null)))))}));export{h as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";import{observer as t}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{getHorizontalAlignment as r}from"../../helpers/index.js";var n=t((function(t){var n=t.element,i=n.socialMediaLinks.filter((function(e){return!!e.link})).sort((function(e,t){return e.order-t.order}));if(!i.length&&t.editModeChildren&&t.popup.isPreviewMode)return t.editModeChildren;var o={display:"flex",alignItems:"center",justifyContent:r(n.horizontalAlignment),padding:"".concat(n.verticalPadding,"px ").concat(n.horizontalPadding,"px"),backgroundColor:n.bgColor,width:"100%"},a={display:"flex",alignItems:"center",gap:"".concat(n.gapBetweenLogos,"px")};return e.createElement("div",{style:o},e.createElement("div",{style:a},i.map((function(t,r){return e.createElement("a",{href:t.link||"",key:r,target:"_blank"},e.createElement("img",{src:t.iconUrlWithoutHash||"",width:24,height:24}))}))))}));export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"react";import{observer as e}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';var o=e((function(e){var o=e.element,r={backgroundColor:o.bgColor,padding:"".concat(o.verticalPadding,"px ").concat(o.horizontalPadding,"px"),height:o.height,width:"100%"};return t.createElement("div",{style:r})}));export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__assign as t}from"../../../ext/tslib/tslib.es6.mjs.js";import o from"react";import{observer as e}from'./../../../../../../../../../ext/mobx-react/dist/mobxreact.esm.js';import{injectFontScript as r}from"../../helpers/index.js";var n=e((function(e){var n=e.element,a=n,i={border:"".concat(a.borderWidth,"px ").concat(a.borderStyle," ").concat(a.borderColor),borderRadius:a.borderRadius,padding:"".concat(a.outerVerticalPadding,"px ").concat(a.outerHorizontalPadding,"px")},d={color:a.color,fontSize:a.fontSize,fontWeight:a.fontWeight,fontFamily:r(a.fontFamily),textAlign:a.horizontalAlignment,padding:"".concat(a.verticalPadding,"px ").concat(a.horizontalPadding,"px"),backgroundColor:a.bgColor};return o.createElement("div",{style:i},o.createElement("div",{dangerouslySetInnerHTML:{__html:n.text},style:t({},d)}))}));export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__extends as o}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as t,observable as r}from"mobx";import{PopupElementTypeEnum as i,IkasPopupRendererFontFamily as n,BaseElement as e}from"../base/index.js";import{ButtonBorderStyle as l}from"../../../background-settings/index.js";import{Popup as d}from"../../../../index.js";var a=function(e){function a(o){var a,u,s,b,m,g,p,f,v=this;return(v=e.call(this,o)||this).text=o.text||d.t("popup:initialClassTranslations.buttonText"),v.type=i.BUTTON,v.color=o.color||"#FFFFFF",v.buttonBgColor=o.buttonBgColor||"",v.bgColor=o.bgColor||"",v.fontFamily=new n(o.fontFamily),v.fontSize=null!==(a=o.fontSize)&&void 0!==a?a:16,v.fontWeight=null!==(u=o.fontWeight)&&void 0!==u?u:400,v.borderRadius=null!==(s=o.borderRadius)&&void 0!==s?s:4,v.borderColor=o.borderColor||"",v.borderStyle=o.borderStyle||l.SOLID,v.borderWidth=null!==(b=o.borderWidth)&&void 0!==b?b:0,v.link=o.link||null,v.verticalPadding=null!==(m=o.verticalPadding)&&void 0!==m?m:12,v.horizontalPadding=null!==(g=o.horizontalPadding)&&void 0!==g?g:12,v.outerVerticalPadding=null!==(p=o.outerVerticalPadding)&&void 0!==p?p:10,v.outerHorizontalPadding=null!==(f=o.outerHorizontalPadding)&&void 0!==f?f:0,t(v,{text:r,color:r,buttonBgColor:r,bgColor:r,fontFamily:r,fontSize:r,fontWeight:r,borderRadius:r,borderColor:r,borderStyle:r,borderWidth:r,link:r}),v}return o(a,e),a}(e);export{a as ButtonElement};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{makeObservable as i,observable as t}from"mobx";import{TextElement as n}from"../../text/index.js";import"../../base/index.js";import{Popup as o}from"../../../../../index.js";var a,e,r=function(o){void 0===o&&(o={}),this.image=o.image?new s(o.image):new s({}),this.name=o.name?new n(o.name):new n({horizontalPadding:0,verticalPadding:6}),this.discountRatio=o.discountRatio?new n(o.discountRatio):null,this.originalPrice=o.originalPrice?new n(o.originalPrice):new n({horizontalPadding:0,verticalPadding:2,fontSize:14,color:"#697586"}),this.finalPrice=o.finalPrice?new n(o.finalPrice):new n({horizontalPadding:0,verticalPadding:2}),this.button=o.button?new d(o.button):new d({}),i(this,{image:t,name:t,discountRatio:t,originalPrice:t,finalPrice:t,button:t})},s=function(n){var o,a;this.bgColor=n.bgColor||"",this.maxWidth=null!==(o=n.maxWidth)&&void 0!==o?o:100,this.borderRadius=null!==(a=n.borderRadius)&&void 0!==a?a:0,i(this,{bgColor:t,maxWidth:t,borderRadius:t})};(e=a||(a={})).ADD_TO_CART="ADD_TO_CART",e.NAVIGATE_TO_PRODUCT_DETAIL="NAVIGATE_TO_PRODUCT_DETAIL";var d=function(n){void 0===n&&(n={}),this.text=n.text||o.t("popup:initialClassTranslations.productButtonText"),this.action=n.action||a.ADD_TO_CART,i(this,{text:t,action:t})};export{a as ProductActionTypeEnum,d as ProductButtonSettings,r as ProductDetailSettings,s as ProductImageSettings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__extends as t}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as o,observable as i}from"mobx";import{PopupElementTypeEnum as n,BaseElement as e}from"../base/index.js";import{ProductDetailSettings as r}from"./detail-settings/index.js";import{ButtonElement as a}from"../button/index.js";var u,d,s,E;(E=u||(u={})).ASC_AVERAGE_RATING="ASC_AVERAGE_RATING",E.DESC_AVERAGE_RATING="DESC_AVERAGE_RATING",E.ASC_CREATED_AT="ASC_CREATED_AT",E.DESC_CREATED_AT="DESC_CREATED_AT",E.ASC_DISCOUNT_RATIO="ASC_DISCOUNT_RATIO",E.DESC_DISCOUNT_RATIO="DESC_DISCOUNT_RATIO",E.ASC_NAME="ASC_NAME",E.DESC_NAME="DESC_NAME",E.ASC_PRICE="ASC_PRICE",E.DESC_PRICE="DESC_PRICE",E.ASC_REVIEW_COUNT="ASC_REVIEW_COUNT",E.DESC_REVIEW_COUNT="DESC_REVIEW_COUNT",E.ASC_SALE_COUNT="ASC_SALE_COUNT",E.DESC_SALE_COUNT="DESC_SALE_COUNT",function(t){t.ALL="ALL",t.SPECIFIC="SPECIFIC",t.CATEGORY="CATEGORY",t.LAST_VIEWED="LAST_VIEWED"}(d||(d={})),function(t){t.ONE_COLUMN="ONE_COLUMN",t.TWO_COLUMN="TWO_COLUMN",t.THREE_COLUMN="THREE_COLUMN"}(s||(s={}));var l=10,C=function(e){function E(t){void 0===t&&(t={});var E,l,C,_,c,A,S,T,p,g,P=this;return(P=e.call(this,t)||this).type=n.PRODUCT_LIST,P.listType=t.listType||d.ALL,P.sortType=t.sortType||u.ASC_CREATED_AT,P.maxProductsToShow=null!==(E=t.maxProductsToShow)&&void 0!==E?E:10,P.categoryId=null!==(l=t.categoryId)&&void 0!==l?l:null,P.variantPairs=null!==(C=t.variantPairs)&&void 0!==C?C:null,P.layout=null!==(_=t.layout)&&void 0!==_?_:s.TWO_COLUMN,P.productDetailSettings=t.productDetailSettings?new r(t.productDetailSettings):new r,P.buttonSettings=t.buttonSettings?new a(t.buttonSettings):new a({outerHorizontalPadding:0,buttonBgColor:"#000000",borderColor:"#000000"}),P.productBgColor=t.productBgColor||"",P.gapBetweenProductElements=null!==(c=t.gapBetweenProductElements)&&void 0!==c?c:12,P.gapBetweenProducts=null!==(A=t.gapBetweenProducts)&&void 0!==A?A:12,P.outerHorizontalPadding=null!==(S=t.outerHorizontalPadding)&&void 0!==S?S:0,P.outerVerticalPadding=null!==(T=t.outerVerticalPadding)&&void 0!==T?T:10,P.verticalPadding=null!==(p=t.verticalPadding)&&void 0!==p?p:0,P.horizontalPadding=null!==(g=t.horizontalPadding)&&void 0!==g?g:0,o(P,{type:i,listType:i,sortType:i,maxProductsToShow:i,categoryId:i,variantPairs:i,layout:i,productDetailSettings:i,buttonSettings:i,productBgColor:i,gapBetweenProductElements:i,gapBetweenProducts:i}),P}return t(E,e),E}(e),_=function(){function t(t){void 0===t&&(t={}),this.productId=t.productId||Date.now().toString(),this.variantId=t.variantId||Date.now().toString(),this.name=t.name||"",this.price=t.price||"",this.discountPrice=t.discountPrice||null,this.discountRatio=t.discountRatio||null,this.imageURL=t.imageURL?"".concat(t.imageURL,"/image_").concat(1080,".jpeg"):null,this.url=t.url||null,o(this,{productId:i,variantId:i,name:i,price:i,discountPrice:i,discountRatio:i,imageURL:i,url:i})}return Object.defineProperty(t.prototype,"$discountRatio",{get:function(){return this.discountRatio?"%"+this.discountRatio:null},enumerable:!1,configurable:!0}),t}();export{l as MAX_PRODUCT_COUNT,_ as PopupProduct,C as ProductListElement,s as ProductListLayoutEnum,u as ProductListSortTypeEnum,d as ProductListTypeEnum};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|