@ikas/storefront 4.0.15 → 4.0.17
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/analytics/ikas.js +1 -1
- package/build/components/checkout/components/address-form/index.js +1 -1
- package/build/components/checkout/components/credit-card-form/index.js +1 -1
- package/build/components/checkout/components/form-item/index.js +1 -1
- package/build/components/checkout/components/form-item/model.d.ts +8 -0
- package/build/components/checkout/components/form-item/model.js +1 -1
- package/build/components/checkout/components/master-pass/link-card-to-client/index.d.ts +8 -0
- package/build/components/checkout/components/master-pass/link-card-to-client/index.js +1 -0
- package/build/components/checkout/components/master-pass/link-card-to-client/style.module.scss.js +1 -0
- package/build/components/checkout/components/master-pass/link-card-to-client/svg/close.d.ts +2 -0
- package/build/components/checkout/components/master-pass/link-card-to-client/svg/close.js +1 -0
- package/build/components/checkout/components/master-pass/{modal-link-card-to-client → link-card-to-client}/svg/info-mark.d.ts +0 -0
- package/build/components/checkout/components/master-pass/{modal-link-card-to-client → link-card-to-client}/svg/info-mark.js +0 -0
- package/build/components/checkout/components/master-pass/{modal-link-card-to-client → link-card-to-client}/svg/master-pass-by-master-card-big.d.ts +0 -0
- package/build/components/checkout/components/master-pass/{modal-link-card-to-client → link-card-to-client}/svg/master-pass-by-master-card-big.js +0 -0
- package/build/components/checkout/components/master-pass/modal/style.module.scss.js +1 -1
- package/build/components/checkout/components/master-pass/modal/svg/modal-close.js +1 -1
- package/build/components/checkout/components/master-pass/modal-otp/index.js +1 -1
- package/build/components/checkout/components/quick-registration/completed.d.ts +7 -0
- package/build/components/checkout/components/quick-registration/completed.js +1 -0
- package/build/components/checkout/components/quick-registration/index.d.ts +7 -0
- package/build/components/checkout/components/quick-registration/index.js +1 -0
- package/build/components/checkout/components/quick-registration/model.d.ts +19 -0
- package/build/components/checkout/components/quick-registration/model.js +1 -0
- package/build/components/checkout/components/quick-registration/style.module.scss.js +1 -0
- package/build/components/checkout/components/svg/success-circle.js +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +8 -0
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/modelMasterPass.d.ts +4 -4
- package/build/components/checkout/modelMasterPass.js +1 -1
- package/build/components/checkout/steps/step-info/index.js +1 -1
- package/build/components/checkout/steps/step-payment/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/style.module.scss.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/components/checkout/steps/step-success/style.module.scss.js +1 -1
- package/build/components/page-editor/ThemeComponentEditor.js +1 -1
- package/build/models/data/checkout-settings/index.d.ts +1 -0
- package/build/models/data/checkout-settings/index.js +1 -1
- package/build/models/data/product/index.d.ts +1 -0
- package/build/models/data/product/index.js +1 -1
- package/build/models/ui/product-list/index.js +1 -1
- package/build/pages/checkout.js +1 -1
- package/build/store/base.d.ts +10 -0
- package/build/store/base.js +1 -1
- package/build/store/customer/index.d.ts +8 -3
- package/build/store/customer/index.js +1 -1
- package/package.json +11 -11
- package/build/components/checkout/components/master-pass/modal-link-card-to-client/index.d.ts +0 -10
- package/build/components/checkout/components/master-pass/modal-link-card-to-client/index.js +0 -1
- package/build/components/checkout/components/master-pass/modal-link-card-to-client/style.module.scss.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as i}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import n from"lodash/cloneDeep";import r from"lodash/sortBy";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{IkasTransactionStatus as o,IkasPaymentMethodType as a,IkasPaymentGatewayType as c,IkasCartCampaignOfferStatus as d,IkasCampaignOfferTargetPageType as u,IkasOrderShippingMethod as l}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{IkasCheckout as h}from"../../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{IkasCustomerAddress as p}from"../../models/data/customer/address/index.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/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{IkasMerchantSettings as m}from"../../models/data/merchant-settings/index.js";import{IkasOrderAddress as f}from"../../models/data/order/address/index.js";import{IkasOrderCustomer as g}from"../../models/data/order/customer/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/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/option-set/option/index.js";import"../../models/data/product/option-set/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{IkasProduct as v}from"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import y from"./components/credit-card-form/model.js";import S from"../../store/customer/api.js";import k from"../../store/checkout/index.js";import b from"../../store/cart/api.js";import C,{MFS_ELEMENT_ID as I,MFS_SCRIPT_URL as P}from"./modelMasterPass.js";import A from"../../store/product/index.js";import{IkasBaseStore as w}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{IkasStorefrontConfig as N}from"@ikas/storefront-config";import{Analytics as O}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{SaveCartInput as j,CheckStocksLineInput as E}from"@ikas/storefront-api";var R,T,x=/^\d+$/,D="undefined"==typeof localStorage,G=function(){function x(l,m,x,G,_,V,U,K,F,H){var Y=this;this.storefront=null,this.isCheckoutLoaded=!1,this.isErrorsVisible=!1,this.isStepLoading=!1,this.isTermsAndConditionsChecked=!1,this.isChangingShippingMethod=!1,this.isContactModalVisible=!1,this.step=R.INFO,this.customizationProps=null,this.cardData=null,this.paymentGateways=[],this.installmentInfo=null,this.useDifferentAddress=!1,this.shouldSaveAddress=!0,this.addressTitle="",this.shippingCountryIds=null,this.selectedShippingAddressId="-1",this.selectedBillingAddressId="-1",this.stockLocations=[],this.availableStockLocations=[],this.deliveryMethod="address",this.stripeResponse=null,this.klarnaResponse=null,this.isKlarnaPaymentCompleted=!1,this.policyModalTitle="",this.policyModalText="",this.error=null,this.showTestModal=!1,this.init=function(){return t(Y,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,w.getInstance().customerStore.waitUntilInitialized()];case 1:return t.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getCampaignOffer()];case 2:return t.sent(),[4,this.initStep()];case 3:return t.sent(),[2]}}))}))},this.initStep=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:if(N.getIsEditor())return this.step=R.INFO,this.isCheckoutLoaded=!0,[2];if(t=new URLSearchParams(window.location.search),i=t.get("step"),s=t.get("failed"),n=t.get("error"),i){if(this.step=i,this.step===R.SHIPPING&&!this.canProceedToShipping)return[2,this.changeStep(R.INFO)];if(this.step!==R.PAYMENT||this.canProceedToPayment){if(this.step===R.SUCCESS&&!this.canProceedToPayment)return[2,this.changeStep(R.INFO)];if(![R.INFO,R.SUCCESS,R.SHIPPING,R.PAYMENT].includes(this.step))return[2,this.changeStep(R.INFO)]}else{if(!this.isInStoreDelivery)return[2,this.changeStep(R.INFO)];this.deliveryMethod="in-store"}}return s&&(this.error={type:T.PAYMENT_ERROR,data:n||null}),this.step!==R.INFO?[3,4]:[4,this.getShippingCountries()];case 1:return e.sent(),this.checkShippingCountries(),[4,this.getStockLocations()];case 2:return e.sent(),[4,this.getAvailableStockLocations()];case 3:e.sent(),this.isInStoreDelivery&&(this.deliveryMethod="in-store"),e.label=4;case 4:return this.step!==R.SHIPPING||1!==(null===(o=this.checkout.availableShippingMethods)||void 0===o?void 0:o.length)||this.checkoutSettings.isGiftPackageEnabled||(this.step=R.PAYMENT,this.router.replace("/checkout?id=".concat(this.checkout.id,"&step=").concat(this.step),void 0,{shallow:!0})),this.step!==R.SHIPPING||(null===(a=this.checkout.availableShippingMethods)||void 0===a?void 0:a.length)?this.step!==R.PAYMENT&&this.step!==R.SUCCESS?[3,8]:[4,this.listPaymentGateways()]:(this.error={type:T.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2]);case 5:return e.sent(),this.isInStoreDelivery?(this.deliveryMethod="in-store",[4,this.getStockLocations()]):[3,7];case 6:e.sent(),e.label=7;case 7:if(!this.paymentGateways.length)return this.error={type:T.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2];e.label=8;case 8:return this.step===R.SUCCESS?[3,12]:this.checkout.isComplete?[2,this.changeStep(R.SUCCESS)]:[3,9];case 9:return[4,this.initialStockCheck()];case 10:e.sent(),e.label=11;case 11:return[3,14];case 12:return[4,this.getSuccessTransaction()];case 13:e.sent(),this.successTransaction&&(r=this.successTransaction.paymentGatewayId,this.checkout.selectedPaymentGateway=this.paymentGateways.find((function(t){return t.id===r}))),e.label=14;case 14:return this.isCheckoutLoaded=!0,O.checkoutStep(this.checkout,this.step),[2]}}))}))},this.getSuccessTransaction=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return[4,S.listOrderTransactions({orderId:{eq:this.checkout.id}})];case 1:return t=e.sent(),this.successTransaction=t.isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)?t.data[0]:void 0,[2]}}))}))},this.saveCart=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n;return e(this,(function(e){switch(e.label){case 0:return t=new j(this.checkout),"in-store"!==this.deliveryMethod?[3,2]:[4,this.inStockDeliveryInputData(t)];case 1:t=e.sent(),e.label=2;case 2:return this.step!==R.INFO&&this.step!==R.SHIPPING||this.isDigitalOnly||(t.billingAddress=null),this.isDigitalOnly&&(t.shippingAddress=null),[4,b.saveCart({input:t})];case 3:if((null==(i=e.sent())?void 0:i.graphQLErrors)&&i.graphQLErrors.length)throw s=i.graphQLErrors[0],"CUSTOMER_LOGIN_REQUIRED"===(null===(n=s.extensions)||void 0===n?void 0:n.code)?{type:T.CUSTOMER_LOGIN_REQUIRED_ERROR}:{type:T.API_ERROR,data:i.firstErrorMessage};return[2,i.data]}}))}))},this.inStockDeliveryInputData=function(i){return t(Y,void 0,void 0,(function(){var t,s,n=this;return e(this,(function(e){return t=i,(s=this.stockLocations.find((function(t){return t.id===n.checkout.stockLocationId})))&&t.shippingAddress&&s.address&&(t.shippingAddress.country=s.address.country,t.shippingAddress.city=s.address.city,t.shippingAddress.state=s.address.state,t.shippingAddress.district=s.address.district,t.shippingAddress.postalCode=s.address.postalCode,t.shippingAddress.addressLine1=s.address.address||"",t.shippingAddress.addressLine2=null),[2,t]}))}))},this.checkStocks=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n,r,o,a,c,d,u,l,h;return e(this,(function(e){switch(e.label){case 0:return t=this.checkout.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,k.checkStocks({lines:t.map((function(t){return new E(t)})),stockLocationIdList:(null===(u=N.getStockLocationIds())||void 0===u?void 0:u.length)?N.getStockLocationIds():null})];case 1:if(!(i=e.sent()).isSuccess)throw{type:T.API_ERROR,data:i.firstErrorMessage};if(null==(s=null===(h=null===(l=i.data)||void 0===l?void 0:l.lines)||void 0===h?void 0:h.filter((function(t){return!t.isAvailable})))?void 0:s.length){for(n=[],r=function(t){var e=o.checkout.items.find((function(e){return e.variant.id===t.variantId}));e&&n.push({item:e,stockCount:t.stockCount})},o=this,a=0,c=s;a<c.length;a++)d=c[a],r(d);throw{type:T.STOCK_ERROR,data:n}}return[2]}}))}))},this.setIsKlarnaPaymentCompleted=function(i){return t(Y,void 0,void 0,(function(){return e(this,(function(t){return this.isKlarnaPaymentCompleted=i,[2]}))}))},this.removeUnavailableItems=function(i){return t(Y,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:t=0,s=i,e.label=1;case 1:return t<s.length?(n=s[t],[4,w.getInstance().cartStore.changeItemQuantity(n.item,n.stockCount)]):[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},this.getShippingCountries=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,k.getAvailableShippingCountries({salesChannelId:N.getSalesChannelId()})];case 1:return t=e.sent(),this.shippingCountryIds=t.data,[2]}}))}))},this.getStockLocations=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return N.getPickupStockLocationIds()?[4,k.listStockLocation({id:{in:N.getPickupStockLocationIds()}})]:[3,2];case 1:if(!(t=e.sent()).isSuccess||!(null===(i=t.data)||void 0===i?void 0:i.length))return this.error={type:T.API_ERROR,data:t.firstErrorMessage},[2];this.stockLocations=t.data,e.label=2;case 2:return[2]}}))}))},this.getAvailableStockLocations=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return N.getPickupStockLocationIds()?(t=this.checkout.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,k.getAvailableStockLocations({lines:t.map((function(t){return new E(t)})),stockLocationIdList:N.getPickupStockLocationIds()})]):[3,2];case 1:if(!(i=e.sent()).isSuccess)return this.error={type:T.API_ERROR},[2];this.availableStockLocations=i.data||[],e.label=2;case 2:return[2]}}))}))},this.checkShippingCountries=function(){var t;(null===(t=Y.shippingCountryIds)||void 0===t?void 0:t.length)||(Y.error={type:T.NO_SHIPPING_ERROR})},this.onDeliveryMethodChange=function(t){"address"===t&&(Y.checkout.stockLocationId=null),Y.deliveryMethod=t,Y.isErrorsVisible=!1},this.initialStockCheck=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.checkStocks()];case 1:return e.sent(),[3,3];case 2:return void 0!==typeof(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:T.UNKNOWN}),[3,3];case 3:return[2]}}))}))},this.listPaymentGateways=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n,o,a,c,d,u,l,h=this;return e(this,(function(e){switch(e.label){case 0:return t="local"===process.env.NEXT_PUBLIC_ENV,i=N.getPaymentGateways().map((function(t){return t.id})),[4,k.listPaymentGateway({id:t?void 0:{in:i},locale:N.getCurrentLocale()})];case 1:return(s=e.sent()).isSuccess&&(null===(u=s.data)||void 0===u?void 0:u.length)?(n=s.data,this.step===R.PAYMENT&&(n=n.filter((function(t){var e;return!(null===(e=t.supportedCurrencies)||void 0===e?void 0:e.length)||t.supportedCurrencies.includes(h.checkout.currencyCode)})),(o=null===(l=this.checkout.shippingAddress)||void 0===l?void 0:l.country)&&o.iso2&&(n=n.filter((function(t){var e;return!(null===(e=t.availableCountries)||void 0===e?void 0:e.length)||t.availableCountries.includes(o.iso2||"")})))),a=[],r(N.getPaymentGateways(),"order").forEach((function(t){var e=null==n?void 0:n.find((function(e){return e.id===t.id}));e&&a.push(e)})),this.paymentGateways=t?n:a,this.checkout.selectedPaymentGateway||this.setPaymentGateway(0),this.step===R.PAYMENT&&(c=n.find((function(t){return!!t.masterPassClientId})))&&(this.checkout.masterPassPaymentGateway=c,(d=document.createElement("script")).id=I,d.src=P,d.onload=function(){h.mpVM.checkMasterPass({checkout:h.checkout,store:w.getInstance()})},document.head.appendChild(d)),[2]):(this.error={type:T.API_ERROR,data:s.firstErrorMessage},[2])}}))}))},this.retrieveInstallmentInfo=function(i){return t(Y,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return[4,k.retrieveInstallmentInfo(i)];case 1:return t=e.sent(),s=t.data,null===(n=null==s?void 0:s.installmentPrices)||void 0===n||n.sort((function(t,e){return(t.installmentCount||-1)>(e.installmentCount||-1)?1:-1})),this.installmentInfo=s,[2]}}))}))},this.createCustomer=function(){var t;Y.store.customerStore.customer?(null===(t=Y.store.customerStore.customer.addresses)||void 0===t||t.forEach((function(t){return t.checkoutSettings=Y.checkoutSettings})),Y.checkout.customer=new g(Y.store.customerStore.customer)):Y.checkout.customer=new g(Y.checkout.customer||{})},this.createShippingAddress=function(){if(!Y.isDigitalOnly)if(Y.checkout.shippingAddress){if(Y.store.customerStore.customer){var t=null==(e=Y.store.customerStore.customer.addresses)?void 0:e.find((function(t){var e;return t.id===(null===(e=Y.checkout.shippingAddress)||void 0===e?void 0:e.id)}));if(t)return Y.onSelectedShippingAddressIdChange(t.id),void(Y.checkout.shippingAddress.checkoutSettings=Y.checkoutSettings)}Y.checkout.shippingAddress=new f(n(Y.checkout.shippingAddress)||{}),Y.checkout.shippingAddress.checkoutSettings=Y.checkoutSettings}else if(Y.store.customerStore.customer){var e=Y.store.customerStore.customer.addresses;Y.onSelectedShippingAddressIdChange((null==e?void 0:e.length)?e[0].id:"-1")}else Y.onSelectedShippingAddressIdChange("-1")},this.createBillingAddress=function(){if("undefined"!=typeof localStorage)if(Y.useDifferentAddress=!!localStorage.getItem("sAddr"),Y.checkout.billingAddress){if(Y.store.customerStore.customer){var t=null==(e=Y.store.customerStore.customer.addresses)?void 0:e.find((function(t){var e;return t.id===(null===(e=Y.checkout.billingAddress)||void 0===e?void 0:e.id)}));if(t)return Y.onSelectedShippingAddressIdChange(t.id),void(Y.checkout.billingAddress.checkoutSettings=Y.checkoutSettings)}Y.checkout.billingAddress=new f(n(Y.checkout.billingAddress)||{}),Y.checkout.billingAddress.checkoutSettings=Y.checkoutSettings}else if(Y.store.customerStore.customer){var e=Y.store.customerStore.customer.addresses;Y.onSelectedBillingAddressIdChange((null==e?void 0:e.length)?e[0].id:"-1")}else Y.onSelectedBillingAddressIdChange("-1"),Y.useDifferentAddress||!Y.checkout.shippingAddress||Y.isInStoreDelivery||(Y.checkout.billingAddress=new f(n(Y.checkout.shippingAddress)),Y.checkout.billingAddress.checkoutSettings=Y.checkoutSettings)},this.onShippingMethodChange=function(i){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isChangingShippingMethod?[2]:(this.isChangingShippingMethod=!0,this.checkout.shippingSettingsId=i.shippingSettingsId,this.checkout.shippingZoneRateId=i.shippingZoneRateId,[4,this.saveCart()]);case 1:return(t=e.sent())&&(this.checkout=new h(t)),this.checkout.shippingAddress&&(this.checkout.shippingAddress.checkoutSettings=this.checkoutSettings),this.isChangingShippingMethod=!1,[2]}}))}))},this.onStockLocationChange=function(i){return t(Y,void 0,void 0,(function(){return e(this,(function(t){return this.checkout.stockLocationId=i.id,[2]}))}))},this.onCouponCodeApply=function(){return t(Y,void 0,void 0,(function(){var t,s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,b.saveCartCouponCode({cartId:this.checkout.id,couponCode:this.checkout.couponCode||null})];case 1:return(t=e.sent()).isSuccess&&t.data&&(s=t.data,n=null===(a=null===(o=this.cardData)||void 0===o?void 0:o.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.step===R.PAYMENT&&(null==n?void 0:n.length)&&n.length>=6&&this.retrieveInstallmentInfo({input:{binNumber:n.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:s.totalFinalPrice}}),s&&(r=this.checkout,this.checkout=new h(i(i({},s),{shippingAddress:r.shippingAddress,billingAddress:r.billingAddress,customer:r.customer,selectedPaymentGateway:r.selectedPaymentGateway})))),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}}))}))},this.onSelectedShippingAddressIdChange=function(t){var e,i;if(Y.selectedShippingAddressId=t,"-1"===t)Y.checkout.shippingAddress=new f;else{var s=null===(i=null===(e=Y.store.customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===i?void 0:i.find((function(e){return e.id===t}));s&&(Y.checkout.shippingAddress=new f(s))}Y.checkout.shippingAddress&&(Y.checkout.shippingAddress.checkoutSettings=Y.checkoutSettings)},this.onSelectedBillingAddressIdChange=function(t){var e,i;if(Y.selectedBillingAddressId=t,"-1"===t)Y.checkout.billingAddress=new f;else{var s=null===(i=null===(e=Y.store.customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===i?void 0:i.find((function(e){return e.id===t}));s&&(Y.checkout.billingAddress=new f(s))}Y.checkout.billingAddress&&(Y.checkout.billingAddress.checkoutSettings=Y.checkoutSettings)},this.onTermsAndConditionsCheckedChange=function(t){Y.isTermsAndConditionsChecked=t},this.onCardNumberChange=function(t){if(Y.cardData&&(!(t.length>Y.cardData.cardNumber.length)||M(t))){var e=(Y.cardData.cardNumber||"").split(" ").join(""),i=t.split(" ").join("");i.length>16||(e.length<6&&i.length>=6&&!Y.installmentInfo?Y.retrieveInstallmentInfo({input:{binNumber:i.slice(0,6),paymentGatewayId:Y.checkout.selectedPaymentGateway.id,price:Y.checkout.totalFinalPrice}}):i.length<6&&e.length>i.length&&(Y.cardData.installmentCount=1,Y.installmentInfo=void 0),Y.cardData.cardNumber=L(i,4).join(" "))}},this.onCardHolderNameChange=function(t){Y.cardData&&(Y.cardData.cardHolderName=t)},this.onExpirationDateChange=function(t){var e;if(Y.cardData&&(!(t.length>Y.cardData.expirationDate.length)||M(t))){if(0===(null===(e=Y.cardData.expirationDate)||void 0===e?void 0:e.length)){var i=t.replace(".","/").split("/");if(2===i.length){var s=i[0].trim(),n=i[1].trim();if(4===s.length&&2===n.length){var r=parseInt(s.slice(2)),o=parseInt(n);if(!isNaN(r)&&!isNaN(o))return void(Y.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&4===n.length){o=parseInt(s),r=parseInt(n.slice(2));if(!isNaN(r)&&!isNaN(o))return void(Y.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}}}var a=t.split(" / ").join("");a.length>4||(Y.cardData.expirationDate=L(a,2).join(" / "))}},this.onCvcChange=function(t){Y.cardData&&(t.length>Y.cardData.cvv.length&&!M(t)||t.length>4||(Y.cardData.cvv=t))},this.saveAddress=function(s){return t(Y,void 0,void 0,(function(){var t,r,o,a,c,d,u=this;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.shouldSaveAddress&&this.store.customerStore.customer?(t="shipping"===s?this.checkout.shippingAddress:this.checkout.billingAddress,(null===(c=this.store.customerStore.customer.addresses)||void 0===c?void 0:c.find((function(e){return e.id===(null==t?void 0:t.id)})))?[2]:(r=new p(i(i({},t),{title:this.addressTitle||this.t("checkout-page:newAddress")})),(o=n(this.store.customerStore.customer)).addresses||(o.addresses=[]),o.addresses.push(r),[4,this.store.customerStore.saveCustomer(o)])):[3,2];case 1:e.sent(),null===(d=this.store.customerStore.customer.addresses)||void 0===d||d.forEach((function(t){return t.checkoutSettings=u.checkoutSettings})),"shipping"===s?(this.checkout.shippingAddress.id=r.id,this.selectedShippingAddressId=r.id||"-1"):(this.checkout.billingAddress.id=r.id,this.selectedBillingAddressId=r.id||"-1"),e.label=2;case 2:return[3,4];case 3:return a=e.sent(),console.error(a),[3,4];case 4:return[2]}}))}))},this.onGoToCartClick=function(){Y.router.push("/cart")},this.onBackToShoppingClick=function(){Y.router.push("/")},this.onProceedToShippingClick=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if("address"===this.deliveryMethod){if(!this.canProceedToShipping)return this.isErrorsVisible=!0,[2]}else if(!this.canProceedToInStoreDelivery)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,6,,7]),this.isStepLoading=!0,"address"!==this.deliveryMethod?[3,3]:[4,this.saveAddress("shipping")];case 2:e.sent(),e.label=3;case 3:return[4,this.checkStocks()];case 4:return e.sent(),[4,this.saveCart()];case 5:return e.sent(),"address"===this.deliveryMethod?this.changeStep(R.SHIPPING):this.changeStep(R.PAYMENT),[3,7];case 6:return void 0!==typeof(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:T.UNKNOWN}),this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.onProceedToDigitalOnlyPaymentClick=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCart()];case 3:return e.sent(),this.changeStep(R.PAYMENT),[3,5];case 4:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:T.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.onProceedToPaymentClick=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCart()];case 3:return e.sent(),this.error=void 0,this.changeStep(R.PAYMENT),[3,5];case 4:return void 0!==typeof(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:T.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.onCompletePaymentClick=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!this.canPerformPayment)return this.isErrorsVisible=!0,[2];if(this.useDifferentAddress||(this.checkout.billingAddress=this.checkout.shippingAddress),this.isKlarna)return this.setIsKlarnaPaymentCompleted(!0),[2];e.label=1;case 1:return e.trys.push([1,7,,8]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),"address"!==this.deliveryMethod?[3,4]:[4,this.saveAddress("billing")];case 3:e.sent(),e.label=4;case 4:return[4,this.saveCart()];case 5:return e.sent(),this.isCustomFlowStripe?((t=document.querySelector("#stripe-form-btn"))&&t.click(),[2]):[4,this.createSaleTransaction()];case 6:return e.sent(),[3,8];case 7:return void 0!==typeof(i=e.sent()).type?this.error=i:this.error={type:T.UNKNOWN},this.isStepLoading=!1,[3,8];case 8:return[2]}}))}))},this.onCompleteDigitalOnlyPaymentClick=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment||this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return this.isErrorsVisible=!0,[2];if(this.isKlarna)return this.setIsKlarnaPaymentCompleted(!0),[2];e.label=1;case 1:return e.trys.push([1,5,,6]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCart()];case 3:return e.sent(),this.isCustomFlowStripe?((t=document.querySelector("#stripe-form-btn"))&&t.click(),[2]):[4,this.createSaleTransaction()];case 4:return e.sent(),[3,6];case 5:return(i=e.sent()).type?this.error=i:this.error={type:T.UNKNOWN},this.isStepLoading=!1,[3,6];case 6:return[2]}}))}))},this.createSaleTransaction=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n,r,d,u,l,h,p,m,f,g,v,y;return e(this,(function(e){switch(e.label){case 0:return(i=this.mpVM.selectedCard)&&(null===(l=this.mpVM.selectedCard)||void 0===l?void 0:l.Name)?((n=this.mpVM.phoneNumber({store:this.store,checkout:this.checkout}))&&(t=n),void 0===(null===(h=this.cardData)||void 0===h?void 0:h.installmentCount)?[2]:[4,k.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:{phoneNumber:t,savedCardName:null===(p=this.mpVM.selectedCard)||void 0===p?void 0:p.Name},paymentGatewayId:null===(m=this.mpVM.selectedCard)||void 0===m?void 0:m.paymentGatewayId,paymentMethodDetail:{cardNumber:this.mpVM.selectedCard.Value1,cardHolderName:this.mpVM.selectedCard.Name,cvv:this.mpVM.selectedCard.Value2,expiredMonth:11,expiredYear:11,installmentCount:this.cardData.installmentCount,threeDSecure:!!(null===(f=this.cardData)||void 0===f?void 0:f.threeDSecure)}}})]):[3,2];case 1:return s=e.sent(),[3,4];case 2:return this.checkout.selectedPaymentGateway?[4,k.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:i&&t?{phoneNumber:t,savedCardName:null===(g=this.mpVM.selectedCard)||void 0===g?void 0:g.Name}:void 0,paymentGatewayId:this.checkout.selectedPaymentGateway.id,paymentMethodDetail:i?void 0:this.checkout.selectedPaymentGateway.paymentMethodType===a.CREDIT_CARD&&this.checkout.selectedPaymentGateway.type===c.INTERNAL&&this.cardData?this.cardData.toInput():void 0}})]:[2];case 3:s=e.sent(),e.label=4;case 4:return r=null===(v=null==s?void 0:s.data)||void 0===v?void 0:v.transactionStatus,d=r&&[o.SUCCESS,o.AUTHORIZED].includes(r),u=r===o.PENDING,d?[4,this.getSuccessTransaction()]:[3,7];case 5:return e.sent(),[4,this.onCheckoutTransactionSuccess()];case 6:return e.sent(),[3,8];case 7:if(!u||!(null===(y=null==s?void 0:s.data)||void 0===y?void 0:y.returnSlug))throw{data:s.firstErrorMessage,type:T.UNKNOWN};window.location.href=process.env.NEXT_PUBLIC_BASE_URL+s.data.returnSlug,e.label=8;case 8:return[2]}}))}))},this.onCheckoutTransactionSuccess=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return localStorage.removeItem("sAddr"),(null===(t=this.checkout.customer)||void 0===t?void 0:t.notificationsAccepted)?[4,this.store.customerStore.createEmailSubscription((null===(i=this.checkout.customer)||void 0===i?void 0:i.email)||"")]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.changeStep(R.SUCCESS),[2]}}))}))},this.onBackToInfoClick=function(){Y.changeStep(R.INFO)},this.onBackToShippingClick=function(){Y.changeStep(R.SHIPPING)},this.setCustomerConsentGranted=function(t){Y.checkout.customer&&(Y.checkout.customer.notificationsAccepted=t)},this.setUseDifferentAddress=function(t){Y.useDifferentAddress=t,Y.useDifferentAddress?(localStorage.setItem("sAddr","1"),Y.checkout.billingAddress=Y.checkout.billingAddress||new f):(localStorage.removeItem("sAddr"),Y.checkout.billingAddress=Y.checkout.shippingAddress)},this.setShouldSaveAddress=function(t){Y.shouldSaveAddress=t},this.setAddressTitle=function(t){Y.addressTitle=t},this.setPaymentGateway=function(i){return t(Y,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return this.paymentGateways.length?"STRIPE"!==(t=this.paymentGateways[i]).code||!(null===(n=t.settings)||void 0===n?void 0:n.find((function(t){return"allow_custom_flow"===t.label&&"true"===t.value})))||this.stripeResponse?[3,2]:[4,k.createStripePaymentIntent({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})]:[2];case 1:(s=e.sent()).isSuccess&&s.data&&(this.stripeResponse=s.data),e.label=2;case 2:return"KLARNA"!==t.code||this.klarnaResponse?[3,4]:[4,k.createKlarnaClientToken({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})];case 3:(s=e.sent()).isSuccess&&s.data&&(this.klarnaResponse=s.data),e.label=4;case 4:return this.checkout.selectedPaymentGateway=t,this.step!==R.SUCCESS&&(t.paymentMethodType===a.CREDIT_CARD&&t.type===c.INTERNAL&&(this.cardData=new y,t.masterPassClientId&&(console.log("called 1511 ikas log"),this.mpVM.checkMasterPass({checkout:this.checkout,store:this.store}))),this.installmentInfo=void 0),[2]}}))}))},this.setInstallmentCount=function(t){Y.cardData&&(Y.cardData.installmentCount=t)},this.changeStep=function(i){return t(Y,void 0,void 0,(function(){return e(this,(function(t){return D||window.location.replace("".concat(window.location.pathname,"?id=").concat(this.checkout.id,"&step=").concat(i)),[2]}))}))},this.logout=function(){return t(Y,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:this.checkout.customer=null,this.store.customerStore.logout(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.saveCart()];case 2:case 3:return t.sent(),[3,4];case 4:return this.createCustomer(),[2]}}))}))},this.setContactModalVisible=function(t){Y.isContactModalVisible=t},this.getCampaignOfferProducts=function(i){return t(Y,void 0,void 0,(function(){var t,s,n,r;return e(this,(function(o){switch(o.label){case 0:if(!this.checkout.campaignOffers||!this.checkout.campaignOffers.length)return[3,4];if(t=this.checkout.campaignOffers.filter((function(t){var e;return t.status===d.WAITING_FOR_ACTION&&(null===(e=t.campaignOffer)||void 0===e?void 0:e.targetPageTypes.some((function(t){return t===i})))})),!t.length)return[3,4];s=function(i){var s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:return(s=t[i]).campaignOffer&&(n=s.campaignOffer.offers.find((function(t){return t.id===s.campaignOfferProductId})))?[4,A.searchProducts({input:{productIdList:[n.productId]}})]:[3,2];case 1:if((r=e.sent()).isSuccess&&r.data&&r.data.data&&r.data.data.length&&(o=r.data.data[0],a=[],n.excludedVariantIdList&&n.excludedVariantIdList.length?o.variants.map((function(t){var e;t.hasStock&&!(null===(e=n.excludedVariantIdList)||void 0===e?void 0:e.some((function(e){return e===t.id})))&&a.push(t)})):a.push.apply(a,o.variants.filter((function(t){return t.hasStock}))),a.length))return[2,{value:{product:new v(o),variants:a,campaignOffer:s,offer:n}}];e.label=2;case 2:return[2]}}))},n=0,o.label=1;case 1:return n<t.length?[5,s(n)]:[3,4];case 2:if("object"==typeof(r=o.sent()))return[2,r.value];o.label=3;case 3:return n++,[3,1];case 4:return[2,void 0]}}))}))},this.getCampaignOffer=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return t=this,[4,this.getCampaignOfferProducts(u.CHECKOUT)];case 1:return t.checkoutCampaignOffer=e.sent(),i=this,[4,this.getCampaignOfferProducts(u.POST_CHECKOUT)];case 2:return i.postCheckoutCampaignOffer=e.sent(),[2]}}))}))},this.updateCartCampaignOffer=function(i){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isCheckoutLoaded=!1,[4,b.updateCartCampaignOffer({input:i})];case 1:return(t=e.sent())&&t.isSuccess&&t.data?(this.checkout=new h(t.data),[4,this.init()]):[3,3];case 2:e.sent(),e.label=3;case 3:return this.isCheckoutLoaded=!0,[2]}}))}))},this.checkout=l,this.checkoutSettings=m,this.router=x,this.returnPolicy=G,this.privacyPolicy=_,this.termsOfService=V,this.imprint=U,this.shippingPolicy=K,this.t=F,this.customizationProps=H,this.mpVM=new C,this.isTermsAndConditionsChecked=this.checkoutSettings.isTermsAndConditionsDefaultChecked||!1,this.init(),s(this)}return Object.defineProperty(x.prototype,"merchantSettings",{get:function(){return new m(N.getMerchantSettings())},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"selectedPaymentGatewayIndex",{get:function(){var t=this;return this.paymentGateways.findIndex((function(e){var i;return e.id===(null===(i=t.checkout.selectedPaymentGateway)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"selectedInstallmentIndex",{get:function(){var t,e,i=this;return(null===(e=null===(t=this.installmentInfo)||void 0===t?void 0:t.installmentPrices)||void 0===e?void 0:e.findIndex((function(t){var e;return t.installmentCount===(null===(e=i.cardData)||void 0===e?void 0:e.installmentCount)})))||0},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"checkoutUrl",{get:function(){return"/checkout?id=".concat(this.checkout.id,"&step=info")},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"customerAddressOptions",{get:function(){var t,e,i={label:this.t("checkout-page:newAddress"),value:"-1"},s=(null===(e=null===(t=w.getInstance().customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===e?void 0:e.map((function(t){return{label:t.title+" - "+t.addressText,value:t.id}})))||[];return[i].concat(s)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"installmentPrice",{get:function(){var t,e,i,s=this;if(this.installmentInfo&&(null===(t=this.cardData)||void 0===t?void 0:t.installmentCount))return null===(i=null===(e=this.installmentInfo.installmentPrices)||void 0===e?void 0:e.find((function(t){var e;return t.installmentCount===(null===(e=s.cardData)||void 0===e?void 0:e.installmentCount)})))||void 0===i?void 0:i.totalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"installmentExtraPrice",{get:function(){if(this.installmentPrice&&this.checkout.totalFinalPrice)return this.installmentPrice-this.checkout.totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"finalPrice",{get:function(){return this.step===R.SUCCESS?this.checkout.totalFinalPrice:this.installmentPrice||this.checkout.$totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"hasStockError",{get:function(){var t;return(null===(t=this.error)||void 0===t?void 0:t.type)===T.STOCK_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isPaymentGatewayHasMasterPass",{get:function(){return-1!==this.selectedPaymentGatewayIndex&&(!!this.paymentGateways.length&&!!this.paymentGateways[this.selectedPaymentGatewayIndex].masterPassClientId)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"canProceedToShipping",{get:function(){var t,e,i;return(this.isDigitalOnly?null===(t=this.checkout.billingAddress)||void 0===t?void 0:t.isValid:null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.isValid)&&this.checkout.hasValidCustomerEmail&&(null===(i=this.error)||void 0===i?void 0:i.type)!==T.NO_SHIPPING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"canProceedToInStoreDelivery",{get:function(){var t,e,i;return!!((null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.firstName)&&(null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.lastName)&&(null===(i=this.checkout.customer)||void 0===i?void 0:i.email)&&this.checkout.stockLocationId)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"canProceedToPayment",{get:function(){return this.canProceedToShipping},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isInStoreDelivery",{get:function(){return!!this.checkout.stockLocationId},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"klarnaPaymentGateway",{get:function(){var t=this.paymentGateways.findIndex((function(t){return"KLARNA"===t.code}));if(-1!==t)return this.paymentGateways[t]},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"klarnaPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(t){return"KLARNA"===t.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isCustomFlowStripe",{get:function(){var t,e=this.checkout.selectedPaymentGateway;return e&&"STRIPE"===e.code&&(null===(t=e.settings)||void 0===t?void 0:t.find((function(t){return"allow_custom_flow"===t.label&&"true"===t.value})))},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isKlarna",{get:function(){var t=this.checkout.selectedPaymentGateway;return t&&"KLARNA"===t.code},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"store",{get:function(){return w.getInstance()},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"canPerformPayment",{get:function(){var t,e;if(this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return!1;var i=this.checkout.selectedPaymentGateway,s=!!("in-store"===this.deliveryMethod)||!!this.canProceedToShipping,n=!!(null===(t=this.checkout.billingAddress)||void 0===t?void 0:t.isValid),r=!!this.mpVM.selectedCard||((null==i?void 0:i.paymentMethodType)===a.CREDIT_CARD&&i.type===c.INTERNAL?!!this.isCustomFlowStripe||(!!this.isKlarna||(null===(e=this.cardData)||void 0===e?void 0:e.isValid)):!!i);return s&&n&&r},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isDigitalOnly",{get:function(){return this.checkout.shippingMethod===l.DIGITAL_DELIVERY},enumerable:!1,configurable:!0}),x}();function L(t,e){return t.match(new RegExp(".{1,"+e+"}","g"))||[]}function M(t){return t&&x.test(t.charAt(t.length-1))}!function(t){t.INFO="info",t.SHIPPING="shipping",t.PAYMENT="payment",t.SUCCESS="success"}(R||(R={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.API_ERROR=1]="API_ERROR",t[t.STOCK_ERROR=2]="STOCK_ERROR",t[t.PAYMENT_ERROR=3]="PAYMENT_ERROR",t[t.NO_SHIPPING_ERROR=4]="NO_SHIPPING_ERROR",t[t.CUSTOMER_LOGIN_REQUIRED_ERROR=5]="CUSTOMER_LOGIN_REQUIRED_ERROR"}(T||(T={}));export{R as CheckoutStep,T as ErrorType,G as default};
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as i}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import n from"lodash/cloneDeep";import r from"lodash/sortBy";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{IkasTransactionStatus as o,IkasPaymentMethodType as a,IkasPaymentGatewayType as c,IkasCartCampaignOfferStatus as d,IkasCampaignOfferTargetPageType as u,IkasOrderShippingMethod as l}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{IkasCheckout as h}from"../../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{IkasCustomerAddress as p}from"../../models/data/customer/address/index.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/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{IkasMerchantSettings as m}from"../../models/data/merchant-settings/index.js";import{IkasOrderAddress as f}from"../../models/data/order/address/index.js";import{IkasOrderCustomer as g}from"../../models/data/order/customer/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/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/option-set/option/index.js";import"../../models/data/product/option-set/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{IkasProduct as v}from"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import y from"./components/credit-card-form/model.js";import k from"../../store/customer/api.js";import S from"../../store/checkout/index.js";import b from"../../store/cart/api.js";import C,{MFS_ELEMENT_ID as I,MFS_SCRIPT_URL as P}from"./modelMasterPass.js";import A from"../../store/product/index.js";import{IkasBaseStore as w}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{IkasStorefrontConfig as N}from"@ikas/storefront-config";import{Analytics as O}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{SaveCartInput as j,CheckStocksLineInput as R}from"@ikas/storefront-api";var E,T,x=/^\d+$/,D="undefined"==typeof localStorage,G=function(){function x(l,m,x,G,_,V,U,K,F,H){var Y=this;this.storefront=null,this.isCheckoutLoaded=!1,this.isErrorsVisible=!1,this.isStepLoading=!1,this.isTermsAndConditionsChecked=!1,this.isChangingShippingMethod=!1,this.isContactModalVisible=!1,this.step=E.INFO,this.customizationProps=null,this.cardData=null,this.paymentGateways=[],this.installmentInfo=null,this.useDifferentAddress=!1,this.shouldSaveAddress=!0,this.addressTitle="",this.shippingCountryIds=null,this.selectedShippingAddressId="-1",this.selectedBillingAddressId="-1",this.stockLocations=[],this.availableStockLocations=[],this.deliveryMethod="address",this.stripeResponse=null,this.klarnaResponse=null,this.isKlarnaPaymentCompleted=!1,this.policyModalTitle="",this.policyModalText="",this.error=null,this.showTestModal=!1,this.init=function(){return t(Y,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,w.getInstance().customerStore.waitUntilInitialized()];case 1:return t.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getCampaignOffer()];case 2:return t.sent(),[4,this.initStep()];case 3:return t.sent(),[2]}}))}))},this.initStep=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:if(N.getIsEditor())return this.step=E.INFO,this.isCheckoutLoaded=!0,[2];if(t=new URLSearchParams(window.location.search),i=t.get("step"),s=t.get("failed"),n=t.get("error"),i){if(this.step=i,this.step===E.SHIPPING&&!this.canProceedToShipping)return[2,this.changeStep(E.INFO)];if(this.step!==E.PAYMENT||this.canProceedToPayment){if(this.step===E.SUCCESS&&!this.canProceedToPayment)return[2,this.changeStep(E.INFO)];if(![E.INFO,E.SUCCESS,E.SHIPPING,E.PAYMENT].includes(this.step))return[2,this.changeStep(E.INFO)]}else{if(!this.isInStoreDelivery)return[2,this.changeStep(E.INFO)];this.deliveryMethod="in-store"}}return s&&(this.error={type:T.PAYMENT_ERROR,data:n||null}),this.step!==E.INFO?[3,4]:[4,this.getShippingCountries()];case 1:return e.sent(),this.checkShippingCountries(),[4,this.getStockLocations()];case 2:return e.sent(),[4,this.getAvailableStockLocations()];case 3:e.sent(),this.isInStoreDelivery&&(this.deliveryMethod="in-store"),e.label=4;case 4:return this.step!==E.SHIPPING||1!==(null===(o=this.checkout.availableShippingMethods)||void 0===o?void 0:o.length)||this.checkoutSettings.isGiftPackageEnabled||(this.step=E.PAYMENT,this.router.replace("/checkout?id=".concat(this.checkout.id,"&step=").concat(this.step),void 0,{shallow:!0})),this.step!==E.SHIPPING||(null===(a=this.checkout.availableShippingMethods)||void 0===a?void 0:a.length)?this.step!==E.PAYMENT&&this.step!==E.SUCCESS?[3,8]:[4,this.listPaymentGateways()]:(this.error={type:T.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2]);case 5:return e.sent(),this.isInStoreDelivery?(this.deliveryMethod="in-store",[4,this.getStockLocations()]):[3,7];case 6:e.sent(),e.label=7;case 7:if(!this.paymentGateways.length)return this.error={type:T.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2];e.label=8;case 8:return this.step===E.SUCCESS?[3,12]:this.checkout.isComplete?[2,this.changeStep(E.SUCCESS)]:[3,9];case 9:return[4,this.initialStockCheck()];case 10:e.sent(),e.label=11;case 11:return[3,14];case 12:return[4,this.getSuccessTransaction()];case 13:e.sent(),this.successTransaction&&(r=this.successTransaction.paymentGatewayId,this.checkout.selectedPaymentGateway=this.paymentGateways.find((function(t){return t.id===r}))),e.label=14;case 14:return this.isCheckoutLoaded=!0,O.checkoutStep(this.checkout,this.step),[2]}}))}))},this.getSuccessTransaction=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return[4,k.listOrderTransactions({orderId:{eq:this.checkout.id}})];case 1:return t=e.sent(),this.successTransaction=t.isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)?t.data[0]:void 0,[2]}}))}))},this.saveCart=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n;return e(this,(function(e){switch(e.label){case 0:return t=new j(this.checkout),"in-store"!==this.deliveryMethod?[3,2]:[4,this.inStockDeliveryInputData(t)];case 1:t=e.sent(),e.label=2;case 2:return this.step!==E.INFO&&this.step!==E.SHIPPING||this.isDigitalOnly||(t.billingAddress=null),this.isDigitalOnly&&(t.shippingAddress=null),[4,b.saveCart({input:t})];case 3:if((null==(i=e.sent())?void 0:i.graphQLErrors)&&i.graphQLErrors.length)throw s=i.graphQLErrors[0],"CUSTOMER_LOGIN_REQUIRED"===(null===(n=s.extensions)||void 0===n?void 0:n.code)?{type:T.CUSTOMER_LOGIN_REQUIRED_ERROR}:{type:T.API_ERROR,data:i.firstErrorMessage};return[2,i.data]}}))}))},this.inStockDeliveryInputData=function(i){return t(Y,void 0,void 0,(function(){var t,s,n=this;return e(this,(function(e){return t=i,(s=this.stockLocations.find((function(t){return t.id===n.checkout.stockLocationId})))&&t.shippingAddress&&s.address&&(t.shippingAddress.country=s.address.country,t.shippingAddress.city=s.address.city,t.shippingAddress.state=s.address.state,t.shippingAddress.district=s.address.district,t.shippingAddress.postalCode=s.address.postalCode,t.shippingAddress.addressLine1=s.address.address||"",t.shippingAddress.addressLine2=null),[2,t]}))}))},this.checkStocks=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n,r,o,a,c,d,u,l,h;return e(this,(function(e){switch(e.label){case 0:return t=this.checkout.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,S.checkStocks({lines:t.map((function(t){return new R(t)})),stockLocationIdList:(null===(u=N.getStockLocationIds())||void 0===u?void 0:u.length)?N.getStockLocationIds():null})];case 1:if(!(i=e.sent()).isSuccess)throw{type:T.API_ERROR,data:i.firstErrorMessage};if(null==(s=null===(h=null===(l=i.data)||void 0===l?void 0:l.lines)||void 0===h?void 0:h.filter((function(t){return!t.isAvailable})))?void 0:s.length){for(n=[],r=function(t){var e=o.checkout.items.find((function(e){return e.variant.id===t.variantId}));e&&n.push({item:e,stockCount:t.stockCount})},o=this,a=0,c=s;a<c.length;a++)d=c[a],r(d);throw{type:T.STOCK_ERROR,data:n}}return[2]}}))}))},this.setIsKlarnaPaymentCompleted=function(i){return t(Y,void 0,void 0,(function(){return e(this,(function(t){return this.isKlarnaPaymentCompleted=i,[2]}))}))},this.removeUnavailableItems=function(i){return t(Y,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:t=0,s=i,e.label=1;case 1:return t<s.length?(n=s[t],[4,w.getInstance().cartStore.changeItemQuantity(n.item,n.stockCount)]):[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},this.getShippingCountries=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,S.getAvailableShippingCountries({salesChannelId:N.getSalesChannelId()})];case 1:return t=e.sent(),this.shippingCountryIds=t.data,[2]}}))}))},this.getStockLocations=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return N.getPickupStockLocationIds()?[4,S.listStockLocation({id:{in:N.getPickupStockLocationIds()}})]:[3,2];case 1:if(!(t=e.sent()).isSuccess||!(null===(i=t.data)||void 0===i?void 0:i.length))return this.error={type:T.API_ERROR,data:t.firstErrorMessage},[2];this.stockLocations=t.data,e.label=2;case 2:return[2]}}))}))},this.getAvailableStockLocations=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return N.getPickupStockLocationIds()?(t=this.checkout.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,S.getAvailableStockLocations({lines:t.map((function(t){return new R(t)})),stockLocationIdList:N.getPickupStockLocationIds()})]):[3,2];case 1:if(!(i=e.sent()).isSuccess)return this.error={type:T.API_ERROR},[2];this.availableStockLocations=i.data||[],e.label=2;case 2:return[2]}}))}))},this.checkShippingCountries=function(){var t;(null===(t=Y.shippingCountryIds)||void 0===t?void 0:t.length)||(Y.error={type:T.NO_SHIPPING_ERROR})},this.onDeliveryMethodChange=function(t){"address"===t&&(Y.checkout.stockLocationId=null),Y.deliveryMethod=t,Y.isErrorsVisible=!1},this.initialStockCheck=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.checkStocks()];case 1:return e.sent(),[3,3];case 2:return void 0!==typeof(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:T.UNKNOWN}),[3,3];case 3:return[2]}}))}))},this.listPaymentGateways=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n,o,a,c,d,u,l,h=this;return e(this,(function(e){switch(e.label){case 0:return t="local"===process.env.NEXT_PUBLIC_ENV,i=N.getPaymentGateways().map((function(t){return t.id})),[4,S.listPaymentGateway({id:t?void 0:{in:i},locale:N.getCurrentLocale(),transactionAmount:this.checkout.totalFinalPrice})];case 1:return(s=e.sent()).isSuccess&&(null===(u=s.data)||void 0===u?void 0:u.length)?(n=s.data,this.step===E.PAYMENT&&(n=n.filter((function(t){var e;return!(null===(e=t.supportedCurrencies)||void 0===e?void 0:e.length)||t.supportedCurrencies.includes(h.checkout.currencyCode)})),(o=null===(l=this.checkout.shippingAddress)||void 0===l?void 0:l.country)&&o.iso2&&(n=n.filter((function(t){var e;return!(null===(e=t.availableCountries)||void 0===e?void 0:e.length)||t.availableCountries.includes(o.iso2||"")})))),a=[],r(N.getPaymentGateways(),"order").forEach((function(t){var e=null==n?void 0:n.find((function(e){return e.id===t.id}));e&&a.push(e)})),this.paymentGateways=t?n:a,this.checkout.selectedPaymentGateway||this.setPaymentGateway(0),this.step===E.PAYMENT&&(c=n.find((function(t){return!!t.masterPassClientId})))&&(this.checkout.masterPassPaymentGateway=c,(d=document.createElement("script")).id=I,d.src=P,d.onload=function(){h.mpVM.checkMasterPass({checkout:h.checkout,store:w.getInstance()})},document.head.appendChild(d)),[2]):(this.error={type:T.API_ERROR,data:s.firstErrorMessage},[2])}}))}))},this.retrieveInstallmentInfo=function(i){return t(Y,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return[4,S.retrieveInstallmentInfo(i)];case 1:return t=e.sent(),s=t.data,null===(n=null==s?void 0:s.installmentPrices)||void 0===n||n.sort((function(t,e){return(t.installmentCount||-1)>(e.installmentCount||-1)?1:-1})),this.installmentInfo=s,[2]}}))}))},this.createCustomer=function(){var t;Y.store.customerStore.customer?(null===(t=Y.store.customerStore.customer.addresses)||void 0===t||t.forEach((function(t){return t.checkoutSettings=Y.checkoutSettings})),Y.checkout.customer=new g(Y.store.customerStore.customer)):Y.checkout.customer=new g(Y.checkout.customer||{})},this.createShippingAddress=function(){if(!Y.isDigitalOnly)if(Y.checkout.shippingAddress){if(Y.store.customerStore.customer){var t=null==(e=Y.store.customerStore.customer.addresses)?void 0:e.find((function(t){var e;return t.id===(null===(e=Y.checkout.shippingAddress)||void 0===e?void 0:e.id)}));if(t)return Y.onSelectedShippingAddressIdChange(t.id),void(Y.checkout.shippingAddress.checkoutSettings=Y.checkoutSettings)}Y.checkout.shippingAddress=new f(n(Y.checkout.shippingAddress)||{}),Y.checkout.shippingAddress.checkoutSettings=Y.checkoutSettings}else if(Y.store.customerStore.customer){var e=Y.store.customerStore.customer.addresses;Y.onSelectedShippingAddressIdChange((null==e?void 0:e.length)?e[0].id:"-1")}else Y.onSelectedShippingAddressIdChange("-1")},this.createBillingAddress=function(){if("undefined"!=typeof localStorage)if(Y.useDifferentAddress=!!localStorage.getItem("sAddr"),Y.checkout.billingAddress){if(Y.store.customerStore.customer){var t=null==(e=Y.store.customerStore.customer.addresses)?void 0:e.find((function(t){var e;return t.id===(null===(e=Y.checkout.billingAddress)||void 0===e?void 0:e.id)}));if(t)return Y.onSelectedShippingAddressIdChange(t.id),void(Y.checkout.billingAddress.checkoutSettings=Y.checkoutSettings)}Y.checkout.billingAddress=new f(n(Y.checkout.billingAddress)||{}),Y.checkout.billingAddress.checkoutSettings=Y.checkoutSettings}else if(Y.store.customerStore.customer){var e=Y.store.customerStore.customer.addresses;Y.onSelectedBillingAddressIdChange((null==e?void 0:e.length)?e[0].id:"-1")}else Y.onSelectedBillingAddressIdChange("-1"),Y.useDifferentAddress||!Y.checkout.shippingAddress||Y.isInStoreDelivery||(Y.checkout.billingAddress=new f(n(Y.checkout.shippingAddress)),Y.checkout.billingAddress.checkoutSettings=Y.checkoutSettings)},this.onShippingMethodChange=function(i){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isChangingShippingMethod?[2]:(this.isChangingShippingMethod=!0,this.checkout.shippingSettingsId=i.shippingSettingsId,this.checkout.shippingZoneRateId=i.shippingZoneRateId,[4,this.saveCart()]);case 1:return(t=e.sent())&&(this.checkout=new h(t)),this.checkout.shippingAddress&&(this.checkout.shippingAddress.checkoutSettings=this.checkoutSettings),this.isChangingShippingMethod=!1,[2]}}))}))},this.onStockLocationChange=function(i){return t(Y,void 0,void 0,(function(){return e(this,(function(t){return this.checkout.stockLocationId=i.id,[2]}))}))},this.onCouponCodeApply=function(){return t(Y,void 0,void 0,(function(){var t,s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,b.saveCartCouponCode({cartId:this.checkout.id,couponCode:this.checkout.couponCode||null})];case 1:return(t=e.sent()).isSuccess&&t.data&&(s=t.data,n=null===(a=null===(o=this.cardData)||void 0===o?void 0:o.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.step===E.PAYMENT&&(null==n?void 0:n.length)&&n.length>=6&&this.retrieveInstallmentInfo({input:{binNumber:n.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:s.totalFinalPrice}}),s&&(r=this.checkout,this.checkout=new h(i(i({},s),{shippingAddress:r.shippingAddress,billingAddress:r.billingAddress,customer:r.customer,selectedPaymentGateway:r.selectedPaymentGateway})))),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}}))}))},this.onSelectedShippingAddressIdChange=function(t){var e,i;if(Y.selectedShippingAddressId=t,"-1"===t)Y.checkout.shippingAddress=new f;else{var s=null===(i=null===(e=Y.store.customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===i?void 0:i.find((function(e){return e.id===t}));s&&(Y.checkout.shippingAddress=new f(s))}Y.checkout.shippingAddress&&(Y.checkout.shippingAddress.checkoutSettings=Y.checkoutSettings)},this.onSelectedBillingAddressIdChange=function(t){var e,i;if(Y.selectedBillingAddressId=t,"-1"===t)Y.checkout.billingAddress=new f;else{var s=null===(i=null===(e=Y.store.customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===i?void 0:i.find((function(e){return e.id===t}));s&&(Y.checkout.billingAddress=new f(s))}Y.checkout.billingAddress&&(Y.checkout.billingAddress.checkoutSettings=Y.checkoutSettings)},this.onTermsAndConditionsCheckedChange=function(t){Y.isTermsAndConditionsChecked=t},this.onCardNumberChange=function(t){if(Y.cardData&&(!(t.length>Y.cardData.cardNumber.length)||M(t))){var e=(Y.cardData.cardNumber||"").split(" ").join(""),i=t.split(" ").join("");i.length>16||(e.length<6&&i.length>=6&&!Y.installmentInfo?Y.retrieveInstallmentInfo({input:{binNumber:i.slice(0,6),paymentGatewayId:Y.checkout.selectedPaymentGateway.id,price:Y.checkout.totalFinalPrice}}):i.length<6&&e.length>i.length&&(Y.cardData.installmentCount=1,Y.installmentInfo=void 0),Y.cardData.cardNumber=L(i,4).join(" "))}},this.onCardHolderNameChange=function(t){Y.cardData&&(Y.cardData.cardHolderName=t)},this.onExpirationDateChange=function(t){var e;if(Y.cardData&&(!(t.length>Y.cardData.expirationDate.length)||M(t))){if(0===(null===(e=Y.cardData.expirationDate)||void 0===e?void 0:e.length)){var i=t.replace(".","/").split("/");if(2===i.length){var s=i[0].trim(),n=i[1].trim();if(4===s.length&&2===n.length){var r=parseInt(s.slice(2)),o=parseInt(n);if(!isNaN(r)&&!isNaN(o))return void(Y.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&4===n.length){o=parseInt(s),r=parseInt(n.slice(2));if(!isNaN(r)&&!isNaN(o))return void(Y.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&2===n.length){var a=parseInt(s),c=parseInt(n);o=a<=12?a:c,r=c>12?c:a;if(!isNaN(r)&&!isNaN(o))return void(Y.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}}}var d=t.split(" / ").join("");d.length>4||(Y.cardData.expirationDate=L(d,2).join(" / "))}},this.onCvcChange=function(t){Y.cardData&&(t.length>Y.cardData.cvv.length&&!M(t)||t.length>4||(Y.cardData.cvv=t))},this.saveAddress=function(s){return t(Y,void 0,void 0,(function(){var t,r,o,a,c,d,u=this;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.shouldSaveAddress&&this.store.customerStore.customer?(t="shipping"===s?this.checkout.shippingAddress:this.checkout.billingAddress,(null===(c=this.store.customerStore.customer.addresses)||void 0===c?void 0:c.find((function(e){return e.id===(null==t?void 0:t.id)})))?[2]:(r=new p(i(i({},t),{title:this.addressTitle||this.t("checkout-page:newAddress")})),(o=n(this.store.customerStore.customer)).addresses||(o.addresses=[]),o.addresses.push(r),[4,this.store.customerStore.saveCustomer(o)])):[3,2];case 1:e.sent(),null===(d=this.store.customerStore.customer.addresses)||void 0===d||d.forEach((function(t){return t.checkoutSettings=u.checkoutSettings})),"shipping"===s?(this.checkout.shippingAddress.id=r.id,this.selectedShippingAddressId=r.id||"-1"):(this.checkout.billingAddress.id=r.id,this.selectedBillingAddressId=r.id||"-1"),e.label=2;case 2:return[3,4];case 3:return a=e.sent(),console.error(a),[3,4];case 4:return[2]}}))}))},this.onGoToCartClick=function(){Y.router.push("/cart")},this.onBackToShoppingClick=function(){Y.router.push("/")},this.onGoToLoginClick=function(){Y.router.push("/account/login")},this.onProceedToShippingClick=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if("address"===this.deliveryMethod){if(!this.canProceedToShipping)return this.isErrorsVisible=!0,[2]}else if(!this.canProceedToInStoreDelivery)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,6,,7]),this.isStepLoading=!0,"address"!==this.deliveryMethod?[3,3]:[4,this.saveAddress("shipping")];case 2:e.sent(),e.label=3;case 3:return[4,this.checkStocks()];case 4:return e.sent(),[4,this.saveCart()];case 5:return e.sent(),"address"===this.deliveryMethod?this.changeStep(E.SHIPPING):this.changeStep(E.PAYMENT),[3,7];case 6:return void 0!==typeof(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:T.UNKNOWN}),this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.onProceedToDigitalOnlyPaymentClick=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCart()];case 3:return e.sent(),this.changeStep(E.PAYMENT),[3,5];case 4:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:T.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.onProceedToPaymentClick=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCart()];case 3:return e.sent(),this.error=void 0,this.changeStep(E.PAYMENT),[3,5];case 4:return void 0!==typeof(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:T.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.onCompletePaymentClick=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!this.canPerformPayment)return this.isErrorsVisible=!0,[2];if(this.useDifferentAddress||(this.checkout.billingAddress=this.checkout.shippingAddress),this.isKlarna)return this.setIsKlarnaPaymentCompleted(!0),[2];e.label=1;case 1:return e.trys.push([1,7,,8]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),"address"!==this.deliveryMethod?[3,4]:[4,this.saveAddress("billing")];case 3:e.sent(),e.label=4;case 4:return[4,this.saveCart()];case 5:return e.sent(),this.isCustomFlowStripe?((t=document.querySelector("#stripe-form-btn"))&&t.click(),[2]):[4,this.createSaleTransaction()];case 6:return e.sent(),[3,8];case 7:return void 0!==typeof(i=e.sent()).type?this.error=i:this.error={type:T.UNKNOWN},this.isStepLoading=!1,[3,8];case 8:return[2]}}))}))},this.onCompleteDigitalOnlyPaymentClick=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment||this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return this.isErrorsVisible=!0,[2];if(this.isKlarna)return this.setIsKlarnaPaymentCompleted(!0),[2];e.label=1;case 1:return e.trys.push([1,5,,6]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCart()];case 3:return e.sent(),this.isCustomFlowStripe?((t=document.querySelector("#stripe-form-btn"))&&t.click(),[2]):[4,this.createSaleTransaction()];case 4:return e.sent(),[3,6];case 5:return(i=e.sent()).type?this.error=i:this.error={type:T.UNKNOWN},this.isStepLoading=!1,[3,6];case 6:return[2]}}))}))},this.createSaleTransaction=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n,r,d,u,l,h,p,m,f,g,v,y;return e(this,(function(e){switch(e.label){case 0:return(i=this.mpVM.selectedCard)&&(null===(l=this.mpVM.selectedCard)||void 0===l?void 0:l.Name)?((n=this.mpVM.phoneNumber({store:this.store,checkout:this.checkout}))&&(t=n),void 0===(null===(h=this.cardData)||void 0===h?void 0:h.installmentCount)?[2]:[4,S.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:{phoneNumber:t,savedCardName:null===(p=this.mpVM.selectedCard)||void 0===p?void 0:p.Name},paymentGatewayId:null===(m=this.mpVM.selectedCard)||void 0===m?void 0:m.paymentGatewayId,paymentMethodDetail:{cardNumber:this.mpVM.selectedCard.Value1,cardHolderName:this.mpVM.selectedCard.Name,cvv:this.mpVM.selectedCard.Value2,expiredMonth:11,expiredYear:11,installmentCount:this.cardData.installmentCount,threeDSecure:!!(null===(f=this.cardData)||void 0===f?void 0:f.threeDSecure)}}})]):[3,2];case 1:return s=e.sent(),[3,4];case 2:return this.checkout.selectedPaymentGateway?[4,S.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:i&&t?{phoneNumber:t,savedCardName:null===(g=this.mpVM.selectedCard)||void 0===g?void 0:g.Name}:void 0,paymentGatewayId:this.checkout.selectedPaymentGateway.id,paymentMethodDetail:i?void 0:this.checkout.selectedPaymentGateway.paymentMethodType===a.CREDIT_CARD&&this.checkout.selectedPaymentGateway.type===c.INTERNAL&&this.cardData?this.cardData.toInput():void 0}})]:[2];case 3:s=e.sent(),e.label=4;case 4:return r=null===(v=null==s?void 0:s.data)||void 0===v?void 0:v.transactionStatus,d=r&&[o.SUCCESS,o.AUTHORIZED].includes(r),u=r===o.PENDING,d?[4,this.getSuccessTransaction()]:[3,7];case 5:return e.sent(),[4,this.onCheckoutTransactionSuccess()];case 6:return e.sent(),[3,8];case 7:if(!u||!(null===(y=null==s?void 0:s.data)||void 0===y?void 0:y.returnSlug))throw{data:s.firstErrorMessage,type:T.UNKNOWN};window.location.href=process.env.NEXT_PUBLIC_BASE_URL+s.data.returnSlug,e.label=8;case 8:return[2]}}))}))},this.onCheckoutTransactionSuccess=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return localStorage.removeItem("sAddr"),(null===(t=this.checkout.customer)||void 0===t?void 0:t.notificationsAccepted)?[4,this.store.customerStore.createEmailSubscription((null===(i=this.checkout.customer)||void 0===i?void 0:i.email)||"")]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.changeStep(E.SUCCESS),[2]}}))}))},this.onBackToInfoClick=function(){Y.changeStep(E.INFO)},this.onBackToShippingClick=function(){Y.changeStep(E.SHIPPING)},this.setCustomerConsentGranted=function(t){Y.checkout.customer&&(Y.checkout.customer.notificationsAccepted=t)},this.setUseDifferentAddress=function(t){Y.useDifferentAddress=t,Y.useDifferentAddress?(localStorage.setItem("sAddr","1"),Y.checkout.billingAddress=Y.checkout.billingAddress||new f):(localStorage.removeItem("sAddr"),Y.checkout.billingAddress=Y.checkout.shippingAddress)},this.setShouldSaveAddress=function(t){Y.shouldSaveAddress=t},this.setAddressTitle=function(t){Y.addressTitle=t},this.setPaymentGateway=function(i){return t(Y,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return this.paymentGateways.length?"STRIPE"!==(t=this.paymentGateways[i]).code||!(null===(n=t.settings)||void 0===n?void 0:n.find((function(t){return"allow_custom_flow"===t.label&&"true"===t.value})))||this.stripeResponse?[3,2]:[4,S.createStripePaymentIntent({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})]:[2];case 1:(s=e.sent()).isSuccess&&s.data&&(this.stripeResponse=s.data),e.label=2;case 2:return"KLARNA"!==t.code||this.klarnaResponse?[3,4]:[4,S.createKlarnaClientToken({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})];case 3:(s=e.sent()).isSuccess&&s.data&&(this.klarnaResponse=s.data),e.label=4;case 4:return this.checkout.selectedPaymentGateway=t,this.step!==E.SUCCESS&&(t.paymentMethodType===a.CREDIT_CARD&&t.type===c.INTERNAL&&(this.cardData=new y,t.masterPassClientId&&(console.log("called 1511 ikas log"),this.mpVM.checkMasterPass({checkout:this.checkout,store:this.store}))),this.installmentInfo=void 0),[2]}}))}))},this.setInstallmentCount=function(t){Y.cardData&&(Y.cardData.installmentCount=t)},this.changeStep=function(i){return t(Y,void 0,void 0,(function(){return e(this,(function(t){return D||window.location.replace("".concat(window.location.pathname,"?id=").concat(this.checkout.id,"&step=").concat(i)),[2]}))}))},this.logout=function(){return t(Y,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:this.checkout.customer=null,this.store.customerStore.logout(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.saveCart()];case 2:case 3:return t.sent(),[3,4];case 4:return this.createCustomer(),[2]}}))}))},this.setContactModalVisible=function(t){Y.isContactModalVisible=t},this.getCampaignOfferProducts=function(i){return t(Y,void 0,void 0,(function(){var t,s,n,r;return e(this,(function(o){switch(o.label){case 0:if(!this.checkout.campaignOffers||!this.checkout.campaignOffers.length)return[3,4];if(t=this.checkout.campaignOffers.filter((function(t){var e;return t.status===d.WAITING_FOR_ACTION&&(null===(e=t.campaignOffer)||void 0===e?void 0:e.targetPageTypes.some((function(t){return t===i})))})),!t.length)return[3,4];s=function(i){var s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:return(s=t[i]).campaignOffer&&(n=s.campaignOffer.offers.find((function(t){return t.id===s.campaignOfferProductId})))?[4,A.searchProducts({input:{productIdList:[n.productId]}})]:[3,2];case 1:if((r=e.sent()).isSuccess&&r.data&&r.data.data&&r.data.data.length&&(o=r.data.data[0],a=[],n.excludedVariantIdList&&n.excludedVariantIdList.length?o.variants.map((function(t){var e;t.hasStock&&!(null===(e=n.excludedVariantIdList)||void 0===e?void 0:e.some((function(e){return e===t.id})))&&a.push(t)})):a.push.apply(a,o.variants.filter((function(t){return t.hasStock}))),a.length))return[2,{value:{product:new v(o),variants:a,campaignOffer:s,offer:n}}];e.label=2;case 2:return[2]}}))},n=0,o.label=1;case 1:return n<t.length?[5,s(n)]:[3,4];case 2:if("object"==typeof(r=o.sent()))return[2,r.value];o.label=3;case 3:return n++,[3,1];case 4:return[2,void 0]}}))}))},this.getCampaignOffer=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return t=this,[4,this.getCampaignOfferProducts(u.CHECKOUT)];case 1:return t.checkoutCampaignOffer=e.sent(),i=this,[4,this.getCampaignOfferProducts(u.POST_CHECKOUT)];case 2:return i.postCheckoutCampaignOffer=e.sent(),[2]}}))}))},this.updateCartCampaignOffer=function(i){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isCheckoutLoaded=!1,[4,b.updateCartCampaignOffer({input:i})];case 1:return(t=e.sent())&&t.isSuccess&&t.data?(this.checkout=new h(t.data),[4,this.init()]):[3,3];case 2:e.sent(),e.label=3;case 3:return this.isCheckoutLoaded=!0,[2]}}))}))},this.registerCustomer=function(i){return t(Y,void 0,void 0,(function(){var t,s,n,r;return e(this,(function(e){switch(e.label){case 0:return this.checkout.customer?(t=this.checkout.customer,s=t.firstName,n=t.lastName,r=t.email,s&&n&&r?[4,k.register({orderId:this.checkout.id,firstName:s,lastName:n,email:r,password:i})]:[3,2]):[3,2];case 1:return[2,e.sent()];case 2:return[2]}}))}))},this.checkout=l,this.checkoutSettings=m,this.router=x,this.returnPolicy=G,this.privacyPolicy=_,this.termsOfService=V,this.imprint=U,this.shippingPolicy=K,this.t=F,this.customizationProps=H,this.mpVM=new C,this.isTermsAndConditionsChecked=this.checkoutSettings.isTermsAndConditionsDefaultChecked||!1,this.init(),s(this)}return Object.defineProperty(x.prototype,"merchantSettings",{get:function(){return new m(N.getMerchantSettings())},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"selectedPaymentGatewayIndex",{get:function(){var t=this;return this.paymentGateways.findIndex((function(e){var i;return e.id===(null===(i=t.checkout.selectedPaymentGateway)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"selectedInstallmentIndex",{get:function(){var t,e,i=this;return(null===(e=null===(t=this.installmentInfo)||void 0===t?void 0:t.installmentPrices)||void 0===e?void 0:e.findIndex((function(t){var e;return t.installmentCount===(null===(e=i.cardData)||void 0===e?void 0:e.installmentCount)})))||0},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"checkoutUrl",{get:function(){return"/checkout?id=".concat(this.checkout.id,"&step=info")},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"customerAddressOptions",{get:function(){var t,e,i={label:this.t("checkout-page:newAddress"),value:"-1"},s=(null===(e=null===(t=w.getInstance().customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===e?void 0:e.map((function(t){return{label:t.title+" - "+t.addressText,value:t.id}})))||[];return[i].concat(s)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"installmentPrice",{get:function(){var t,e,i,s=this;if(this.installmentInfo&&(null===(t=this.cardData)||void 0===t?void 0:t.installmentCount))return null===(i=null===(e=this.installmentInfo.installmentPrices)||void 0===e?void 0:e.find((function(t){var e;return t.installmentCount===(null===(e=s.cardData)||void 0===e?void 0:e.installmentCount)})))||void 0===i?void 0:i.totalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"installmentExtraPrice",{get:function(){if(this.installmentPrice&&this.checkout.totalFinalPrice)return this.installmentPrice-this.checkout.totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"finalPrice",{get:function(){return this.step===E.SUCCESS?this.checkout.totalFinalPrice:this.installmentPrice||this.checkout.$totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"hasStockError",{get:function(){var t;return(null===(t=this.error)||void 0===t?void 0:t.type)===T.STOCK_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isPaymentGatewayHasMasterPass",{get:function(){return-1!==this.selectedPaymentGatewayIndex&&(!!this.paymentGateways.length&&!!this.paymentGateways[this.selectedPaymentGatewayIndex].masterPassClientId)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"hasQuickRegistration",{get:function(){return this.checkoutSettings.isQuickRegistrationEnabled&&this.checkout.customer&&this.checkout.customer.isGuestCheckout},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"canProceedToShipping",{get:function(){var t,e,i;return(this.isDigitalOnly?null===(t=this.checkout.billingAddress)||void 0===t?void 0:t.isValid:null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.isValid)&&this.checkout.hasValidCustomerEmail&&(null===(i=this.error)||void 0===i?void 0:i.type)!==T.NO_SHIPPING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"canProceedToInStoreDelivery",{get:function(){var t,e,i;return!!((null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.firstName)&&(null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.lastName)&&(null===(i=this.checkout.customer)||void 0===i?void 0:i.email)&&this.checkout.stockLocationId)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"canProceedToPayment",{get:function(){return this.canProceedToShipping},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isInStoreDelivery",{get:function(){return!!this.checkout.stockLocationId},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"klarnaPaymentGateway",{get:function(){var t=this.paymentGateways.findIndex((function(t){return"KLARNA"===t.code}));if(-1!==t)return this.paymentGateways[t]},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"klarnaPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(t){return"KLARNA"===t.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isCustomFlowStripe",{get:function(){var t,e=this.checkout.selectedPaymentGateway;return e&&"STRIPE"===e.code&&(null===(t=e.settings)||void 0===t?void 0:t.find((function(t){return"allow_custom_flow"===t.label&&"true"===t.value})))},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isKlarna",{get:function(){var t=this.checkout.selectedPaymentGateway;return t&&"KLARNA"===t.code},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"store",{get:function(){return w.getInstance()},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"canPerformPayment",{get:function(){var t,e;if(this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return!1;var i=this.checkout.selectedPaymentGateway,s=!!("in-store"===this.deliveryMethod)||!!this.canProceedToShipping,n=!!(null===(t=this.checkout.billingAddress)||void 0===t?void 0:t.isValid),r=!!this.mpVM.selectedCard||((null==i?void 0:i.paymentMethodType)===a.CREDIT_CARD&&i.type===c.INTERNAL?!!this.isCustomFlowStripe||(!!this.isKlarna||(null===(e=this.cardData)||void 0===e?void 0:e.isValid)):!!i);return s&&n&&r},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isDigitalOnly",{get:function(){return this.checkout.shippingMethod===l.DIGITAL_DELIVERY},enumerable:!1,configurable:!0}),x}();function L(t,e){return t.match(new RegExp(".{1,"+e+"}","g"))||[]}function M(t){return t&&x.test(t.charAt(t.length-1))}!function(t){t.INFO="info",t.SHIPPING="shipping",t.PAYMENT="payment",t.SUCCESS="success"}(E||(E={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.API_ERROR=1]="API_ERROR",t[t.STOCK_ERROR=2]="STOCK_ERROR",t[t.PAYMENT_ERROR=3]="PAYMENT_ERROR",t[t.NO_SHIPPING_ERROR=4]="NO_SHIPPING_ERROR",t[t.CUSTOMER_LOGIN_REQUIRED_ERROR=5]="CUSTOMER_LOGIN_REQUIRED_ERROR"}(T||(T={}));export{E as CheckoutStep,T as ErrorType,G as default};
|
|
@@ -61,7 +61,7 @@ export default class MasterPassModel {
|
|
|
61
61
|
text: string;
|
|
62
62
|
};
|
|
63
63
|
isOtpFormSubmitAtLeastOnce: boolean;
|
|
64
|
-
visibleModal?: "otpModalBank" | "otpModalMasterPass" | "otpModalSuccess" | "
|
|
64
|
+
visibleModal?: "otpModalBank" | "otpModalMasterPass" | "otpModalSuccess" | "linkCardToClient" | "linkCardToClientModalSuccess" | "mfsResponseModal";
|
|
65
65
|
mfsResponseModalText?: string;
|
|
66
66
|
cards: Card[];
|
|
67
67
|
selectedCard?: Card;
|
|
@@ -81,14 +81,14 @@ export default class MasterPassModel {
|
|
|
81
81
|
onSaveCardToMasterPassCardNameChange: (value: string) => void;
|
|
82
82
|
onSaveCardToMasterPassPhoneNumberChange: (value: string) => void;
|
|
83
83
|
onSaveCardToMasterPassSendConfirmationButtonClick: ({ creditCard, store, checkout, paymentGateway, callback, }: RegisterParams) => void;
|
|
84
|
-
get
|
|
84
|
+
get isLinkCardToClientVisible(): boolean;
|
|
85
85
|
get isOtpModalVisible(): boolean;
|
|
86
86
|
get isResponseModalVisible(): boolean;
|
|
87
87
|
get isSuccessModalVisible(): boolean;
|
|
88
88
|
get otpModalType(): OtpModalType;
|
|
89
89
|
get successModalType(): SuccessModalType;
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
showLinkCardToClient: () => void;
|
|
91
|
+
hideLinkCardToClient: () => void;
|
|
92
92
|
showOtpModal: (modalType: OtpModalType) => void;
|
|
93
93
|
hideOtpModal: () => void;
|
|
94
94
|
onResponseModalClose: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as s,__rest as t}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as o}from"mobx";import{useTranslation as a}from"../../utils/i18n.js";import{getMasterPassRequestToken as n,MasterPassOperationTypeEnum as r}from"@ikas/storefront-api";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";var c="ikasMasterPass",u="https://cdn.myikas.com/sf/scripts/mfs-client-nojquery.min.js",d="undefined"==typeof localStorage,l=/000000[0|1]{10}/g,h=/[0|1]1100[0|1]{11}/g,p=/[0|1]11100[0|1]{10}/g,m=function(){function c(){var c=this;this.checkMasterPassData={status:""},this.saveCardToMasterPass={isCheckboxChecked:!1,cardName:"",phoneNumber:"",isSendConfirmationButtonPending:!1},this.otpResponse={status:"",text:""},this.isOtpFormSubmitAtLeastOnce=!1,this.visibleModal=void 0,this.cards=[],this.saveCardToMasterPassPhoneNumberDisabledInputValue=function(e){var s=e.store,t=e.checkout,o=e.withPlus;return c.phoneNumber({store:s,checkout:t,withPlus:o})||""},this.onSaveCardToMasterPassCheckedChange=function(e){c.saveCardToMasterPass.isCheckboxChecked=e},this.onSaveCardToMasterPassCardNameChange=function(e){c.saveCardToMasterPass.cardName=e},this.onSaveCardToMasterPassPhoneNumberChange=function(e){c.saveCardToMasterPass.phoneNumber=e},this.onSaveCardToMasterPassSendConfirmationButtonClick=function(e){var s=e.creditCard,t=e.store,o=e.checkout,a=e.paymentGateway,n=e.callback;console.log("onSaveCardToMasterPassSendConfirmationButtonClick 1"),c.register({creditCard:s,store:t,checkout:o,paymentGateway:a,callback:n})},this.showLinkCardToClientModal=function(){c.visibleModal="linkCardToClientModal"},this.hideLinkCardToClientModal=function(){c.visibleModal=void 0},this.showOtpModal=function(e){c.otpResponse.text="",c.otpResponse.status="",c.visibleModal="masterPassOtp"===e?"otpModalMasterPass":"otpModalBank",console.log("calisti",c.visibleModal)},this.hideOtpModal=function(){c.visibleModal=void 0,c.otpResponse.text="",c.otpResponse.status="",c.isOtpFormSubmitAtLeastOnce=!1},this.onResponseModalClose=function(){c.visibleModal=void 0,c.mfsResponseModalText=""},this.onSuccessModalClose=function(){c.visibleModal=void 0},this.onLinkCardToClientButtonClick=function(e){c.linkCardToClient(e)},this.onOtpFormSubmit=function(e){c.otpResponse.text="",c.otpResponse.status="",c.validateTransaction(e)},this.MFS=function(){var e;if(!d){if(window.MFS&&(null===(e=window.MFS)||void 0===e?void 0:e.setClientId)){var s=window.MFS;return s.setAddress("https://ui.masterpassturkiye.com/v2"),s}console.error("MFS can not use.")}},this.getToken=function(t){var o=t.cartId,a=t.paymentGatewayId,r=t.operationType,i=t.phoneNumber;return e(c,void 0,void 0,(function(){var e;return s(this,(function(s){switch(s.label){case 0:return[4,n({cartId:o,paymentGatewayId:a,operationType:r,phoneNumber:i})];case 1:return(e=s.sent()).data&&e.isSuccess&&!e.errors.length?[2,e.data]:(this.showTokenErrorWithModal(),[2])}}))}))},this.phoneNumber=function(e){var s,t,o=e.store,a=e.checkout,n=e.withPlus,r=void 0!==n&&n,i=(null===(s=o.customerStore.customer)||void 0===s?void 0:s.phone)||(null===(t=a.shippingAddress)||void 0===t?void 0:t.phone);return i&&i.includes("+")&&!r&&(i=i.replace("+","")),i},this.sendSmsLanguage=function(e){var s,t="tur";if(e.localeOptions.length){var o=e.localeOptions.find((function(e){return e.routing.locale===i.getCurrentLocale()}));o&&o.iso3&&(t=null===(s=o.iso3)||void 0===s?void 0:s.toLowerCase())}return t},this.clearSaveCardToMasterPassForm=function(){c.saveCardToMasterPass.isCheckboxChecked=!1,c.saveCardToMasterPass.phoneNumber="",c.saveCardToMasterPass.cardName="",c.saveCardToMasterPass.isSendConfirmationButtonPending=!1},this.mfsResponseHandler=function(e){return function(s,t){console.log({field:"mfsResponseHandler",response:t}),e.callback&&e.callback();var o,a=function(e){var s;return null===(s=null==t?void 0:t.accountStatus)||void 0===s?void 0:s.match(e)};a(l)&&(c.checkMasterPassData.status="noMasterPassAccount",(o=c.phoneNumber({checkout:e.checkout,store:e.store,withPlus:!0}))&&(c.saveCardToMasterPass.phoneNumber=o));a(h)&&(c.checkMasterPassData.status="hasMasterPassAccountButDoesNotHaveAnyOperation",c.showLinkCardToClientModal(),(o=c.phoneNumber({checkout:e.checkout,store:e.store,withPlus:!0}))&&(c.saveCardToMasterPass.phoneNumber=o));if(a(p)&&(c.checkMasterPassData.status="hasMasterPassAccountAndHasRelation",(null==e?void 0:e.checkout)&&e.store&&(c.listCards({store:e.store,checkout:e.checkout}),console.log("call listcards"))),"validateTransaction"!==e.source&&"resendOtp"!==e.source||!t.responseDescription||(c.otpResponse.text=t.responseDescription,"1409"===t.responseCode&&(c.otpResponse.status="error")),"0000"!=t.responseCode&&""!=t.responseCode||(console.log("Register Success"),"deleteCard"===e.source&&c.listCards({store:e.store,checkout:e.checkout}),"validateTransaction"===e.source&&(null==e?void 0:e.checkout)&&e.store&&("hasMasterPassAccountButDoesNotHaveAnyOperation"===c.checkMasterPassData.status?c.visibleModal="linkCardToClientModalSuccess":c.visibleModal="otpModalSuccess",e.checkout.selectedPaymentGateway=void 0,c.clearSaveCardToMasterPassForm(),c.listCards({store:e.store,checkout:e.checkout}))),"5196"===t.responseCode&&t.responseDescription&&(c.visibleModal="mfsResponseModal",c.mfsResponseModalText=t.responseDescription),"5001"==t.responseCode||"5008"==t.responseCode){var n="5001"===t.responseCode?"bankOtp":"masterPassOtp";c.showOtpModal(n)}if("5010"==t.responseCode&&"undefined"!=typeof window)return console.log('response.responseCode == "5010"'),void window.location.assign(t.url3D+"&returnUrl="+window.location.href);console.log({source:"MFS response.responseDescription",responseDescription:t.responseDescription,response:t})}},this.showTokenErrorWithModal=function(){var e=a().t;c.visibleModal="mfsResponseModal",c.mfsResponseModalText=e("checkout-page:errorUnknown")},this.checkMasterPass=function(o){return e(c,void 0,void 0,(function(){var e,a,n,i,c,u,d=o.checkout,l=o.store;return t(o,["checkout","store"]),s(this,(function(s){switch(s.label){case 0:return console.log("checkMasterPass 1"),(e=this.MFS())?(a=this.phoneNumber({store:l,checkout:d}),console.log("checkMasterPass 2"),n=d.masterPassPaymentGateway,a&&n&&n.masterPassClientId?(console.log("checkMasterPass 3",a),[4,this.getToken({cartId:d.id,paymentGatewayId:n.id,operationType:r.CHECK_MASTER_PASS_USER,phoneNumber:a})]):[2]):[2];case 1:return(i=s.sent())?(e.setClientId(n.masterPassClientId),c=this.sendSmsLanguage(l),u=this.prepareFormData({sendSmsLanguage:c,sendSms:"N",referenceNo:i.requestReferenceNumber,token:i.token,userId:a}),e.checkMasterPass(u,this.mfsResponseHandler({source:"checkMasterPass",checkout:d,store:l})),console.log("checkMasterPass 4"),[2]):[2]}}))}))},this.register=function(t){var o=t.creditCard,a=t.store,n=t.checkout,i=t.paymentGateway,u=t.callback;return e(c,void 0,void 0,(function(){var e,t,c,d;return s(this,(function(s){switch(s.label){case 0:return console.log("register 1"),(e=this.MFS())?(console.log("register 2"),(t=o.phoneNumber)&&i.masterPassClientId?(console.log("register 3"),[4,this.getToken({cartId:n.id,paymentGatewayId:i.id,operationType:r.REGISTER_CARD,phoneNumber:t})]):[2]):[2];case 1:return c=s.sent(),console.log("register 4"),(null==c?void 0:c.token)?(d=this.prepareFormData({msisdn:t,token:null==c?void 0:c.token,referenceNo:c.requestReferenceNumber,sendSmsLanguage:this.sendSmsLanguage(a),rtaPan:o.rtaPan,expiryDate:o.expiryDate,cvc:o.cvc,accountAliasName:o.accountAliasName,timeZone:c.timeZone,sendSms:"Y",actionType:"A",clientIp:"",delinkReason:"",eActionType:"A",cardTypeFlag:"05",cpinFlag:"Y",defaultAccount:"Y",mmrpConfig:"110010",identityVerificationFlag:"Y",mobileAccountConfig:"MWA",uiChannelType:"6"}),console.log("reigster 5"),e.setClientId(i.masterPassClientId),e.register(d,this.mfsResponseHandler({source:"register",store:a,checkout:n,callback:u})),[2]):[2]}}))}))},this.resendOtp=function(t){var o=t.store,a=t.checkout,n=t.callback;return e(c,void 0,void 0,(function(){var e,t,r;return s(this,(function(s){return this.isOtpFormSubmitAtLeastOnce&&(e=this.MFS())?(t=e.getLastToken(),r=this.sendSmsLanguage(o),e.resendOtp(t,r,this.mfsResponseHandler({source:"resendOtp",store:o,checkout:a,callback:n})),[2]):[2]}))}))},this.linkCardToClient=function(t){var o=t.store,a=t.checkout,n=t.callback;return e(c,void 0,void 0,(function(){var e,t,i,c,u;return s(this,(function(s){switch(s.label){case 0:return(e=this.MFS())&&((t=this.phoneNumber({store:o,checkout:a}))&&(null==(i=a.masterPassPaymentGateway)?void 0:i.id))?[4,this.getToken({cartId:a.id,paymentGatewayId:i.id,operationType:r.REGISTER_CARD,phoneNumber:t})]:[2];case 1:return(c=s.sent())?(u=this.prepareFormData({sendSms:"Y",sendSmsLanguage:this.sendSmsLanguage(o),token:c.token,referenceNo:c.requestReferenceNumber,cardAliasName:"",msisdn:t}),e.linkCardToClient(u,this.mfsResponseHandler({source:"linkCardToClient",store:o,checkout:a,callback:n})),[2]):(n&&n(),[2])}}))}))},this.validateTransaction=function(t){var o=t.validationCode,a=t.store,n=t.checkout,i=t.callback;return e(c,void 0,void 0,(function(){var e,t,c,u,d;return s(this,(function(s){switch(s.label){case 0:return(e=this.MFS())&&((t=this.phoneNumber({store:a,checkout:n}))&&(c=n.masterPassPaymentGateway))?[4,this.getToken({cartId:n.id,paymentGatewayId:c.id,operationType:r.REGISTER_CARD,phoneNumber:t})]:[2];case 1:return(u=s.sent())?(d=this.prepareFormData({pinType:"otp",validationCode:o,sendSms:"Y",sendSmsLanguage:this.sendSmsLanguage(a),token:u.token,referenceNo:u.requestReferenceNumber}),this.isOtpFormSubmitAtLeastOnce||(this.isOtpFormSubmitAtLeastOnce=!0),e.validateTransaction(d,this.mfsResponseHandler({source:"validateTransaction",store:a,checkout:n,callback:i})),[2]):[2]}}))}))},this.listCards=function(t){var o=t.store,a=t.checkout;return e(c,void 0,void 0,(function(){var e,t,n,i,c,u,d=this;return s(this,(function(s){switch(s.label){case 0:return(e=this.MFS())&&(t=this.phoneNumber({store:o,checkout:a}))?(n=null===(u=a.masterPassPaymentGateway)||void 0===u?void 0:u.id,console.log("listCards paymentGatewayId",n),n?[4,this.getToken({cartId:a.id,paymentGatewayId:n,operationType:r.LIST_CARDS,phoneNumber:t})]:[2]):[2];case 1:return(i=s.sent())?(c=function(e,s){"0000"!=s.responseCode&&""!=s.responseCode&&(console.error({source:"mfs response.responseDescription",responseDescription:s.responseDescription,response:s}),console.log("TransactionID->",s.transactionId));var t=[];if(Array.isArray(s.cards)&&s.cards.length)for(var o=0;o<s.cards.length;o++){var a=s.cards[o];a.paymentGatewayId=n,t.push(a)}d.cards=t,console.log("list_card response->",s),console.log("Cards",t),console.log("TransactionID->",s.transactionId)},e.listCards(t,i.token,c),[2]):[2]}}))}))},this.deleteCard=function(t){var o=t.store,a=t.checkout,n=t.card;return e(c,void 0,void 0,(function(){var e,t,i,c;return s(this,(function(s){switch(s.label){case 0:return(e=this.MFS())&&(t=this.phoneNumber({store:o,checkout:a}))?[4,this.getToken({cartId:a.id,paymentGatewayId:n.paymentGatewayId,operationType:r.DELETE_CARD,phoneNumber:t})]:[2];case 1:return(i=s.sent())?(c=this.prepareFormData({sendSms:"N",msisdn:t,token:i.token,referenceNo:i.requestReferenceNumber,sendSmsLanguage:this.sendSmsLanguage(o),accountAliasName:n.Name}),e.deleteCard(c,this.mfsResponseHandler({source:"deleteCard",store:o,checkout:a})),[2]):[2]}}))}))},o(this)}return Object.defineProperty(c.prototype,"isSaveCardToMasterPassPhoneNumberInputVisible",{get:function(){return("hasMasterPassAccountAndHasRelation"!==this.checkMasterPassData.status||!this.cards.length)&&("hasMasterPassAccountButDoesNotHaveAnyOperation"===this.checkMasterPassData.status||this.checkMasterPassData.status,!0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isSaveCardToMasterPassPhoneNumberInputDisabled",{get:function(){return!("hasMasterPassAccountAndHasRelation"!==this.checkMasterPassData.status||!this.cards.length)||("hasMasterPassAccountButDoesNotHaveAnyOperation"===this.checkMasterPassData.status||"noMasterPassAccount"===this.checkMasterPassData.status)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isSendConfirmationButtonDisabled",{get:function(){return this.isSaveCardToMasterPassPhoneNumberInputVisible?this.isSaveCardToMasterPassPhoneNumberInputDisabled?!this.saveCardToMasterPass.cardName:!this.saveCardToMasterPass.cardName||!this.saveCardToMasterPass.phoneNumber:!this.saveCardToMasterPass.cardName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isLinkCardToClientModalVisible",{get:function(){return"linkCardToClientModal"===this.visibleModal},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOtpModalVisible",{get:function(){return"otpModalBank"===this.visibleModal||"otpModalMasterPass"===this.visibleModal},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isResponseModalVisible",{get:function(){return!("mfsResponseModal"!==this.visibleModal||!this.mfsResponseModalText)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isSuccessModalVisible",{get:function(){return"linkCardToClientModalSuccess"===this.visibleModal||"otpModalSuccess"===this.visibleModal},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"otpModalType",{get:function(){return"otpModalMasterPass"===this.visibleModal?"masterPassOtp":"bankOtp"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"successModalType",{get:function(){return"hasMasterPassAccountButDoesNotHaveAnyOperation"===this.checkMasterPassData.status?"linkCardToClient":"register"},enumerable:!1,configurable:!0}),c.prototype.prepareFormData=function(e){var s=new FormData;return Object.entries(e).forEach((function(e){var t=e[0],o=e[1];return s.append(t,o)})),s},c}();export{c as MFS_ELEMENT_ID,u as MFS_SCRIPT_URL,m as default};
|
|
1
|
+
import{__awaiter as e,__generator as s,__rest as t}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as o}from"mobx";import{useTranslation as a}from"../../utils/i18n.js";import{getMasterPassRequestToken as n,MasterPassOperationTypeEnum as r}from"@ikas/storefront-api";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";var c="ikasMasterPass",u="https://cdn.myikas.com/sf/scripts/mfs-client-nojquery.min.js",d="undefined"==typeof localStorage,l=/000000[0|1]{10}/g,h=/[0|1]1100[0|1]{11}/g,p=/[0|1]11100[0|1]{10}/g,m=function(){function c(){var c=this;this.checkMasterPassData={status:""},this.saveCardToMasterPass={isCheckboxChecked:!1,cardName:"",phoneNumber:"",isSendConfirmationButtonPending:!1},this.otpResponse={status:"",text:""},this.isOtpFormSubmitAtLeastOnce=!1,this.visibleModal=void 0,this.cards=[],this.saveCardToMasterPassPhoneNumberDisabledInputValue=function(e){var s=e.store,t=e.checkout,o=e.withPlus;return c.phoneNumber({store:s,checkout:t,withPlus:o})||""},this.onSaveCardToMasterPassCheckedChange=function(e){c.saveCardToMasterPass.isCheckboxChecked=e},this.onSaveCardToMasterPassCardNameChange=function(e){c.saveCardToMasterPass.cardName=e},this.onSaveCardToMasterPassPhoneNumberChange=function(e){c.saveCardToMasterPass.phoneNumber=e},this.onSaveCardToMasterPassSendConfirmationButtonClick=function(e){var s=e.creditCard,t=e.store,o=e.checkout,a=e.paymentGateway,n=e.callback;console.log("onSaveCardToMasterPassSendConfirmationButtonClick 1"),c.register({creditCard:s,store:t,checkout:o,paymentGateway:a,callback:n})},this.showLinkCardToClient=function(){c.visibleModal="linkCardToClient"},this.hideLinkCardToClient=function(){c.visibleModal=void 0},this.showOtpModal=function(e){c.otpResponse.text="",c.otpResponse.status="",c.visibleModal="masterPassOtp"===e?"otpModalMasterPass":"otpModalBank",console.log("calisti",c.visibleModal)},this.hideOtpModal=function(){c.visibleModal=void 0,c.otpResponse.text="",c.otpResponse.status="",c.isOtpFormSubmitAtLeastOnce=!1},this.onResponseModalClose=function(){c.visibleModal=void 0,c.mfsResponseModalText=""},this.onSuccessModalClose=function(){c.visibleModal=void 0},this.onLinkCardToClientButtonClick=function(e){c.linkCardToClient(e)},this.onOtpFormSubmit=function(e){c.otpResponse.text="",c.otpResponse.status="",c.validateTransaction(e)},this.MFS=function(){var e;if(!d){if(window.MFS&&(null===(e=window.MFS)||void 0===e?void 0:e.setClientId)){var s=window.MFS;return s.setAddress("https://ui.masterpassturkiye.com/v2"),s}console.error("MFS can not use.")}},this.getToken=function(t){var o=t.cartId,a=t.paymentGatewayId,r=t.operationType,i=t.phoneNumber;return e(c,void 0,void 0,(function(){var e;return s(this,(function(s){switch(s.label){case 0:return[4,n({cartId:o,paymentGatewayId:a,operationType:r,phoneNumber:i})];case 1:return(e=s.sent()).data&&e.isSuccess&&!e.errors.length?[2,e.data]:(this.showTokenErrorWithModal(),[2])}}))}))},this.phoneNumber=function(e){var s,t,o=e.store,a=e.checkout,n=e.withPlus,r=void 0!==n&&n,i=(null===(s=o.customerStore.customer)||void 0===s?void 0:s.phone)||(null===(t=a.shippingAddress)||void 0===t?void 0:t.phone);return i&&i.includes("+")&&!r&&(i=i.replace("+","")),i},this.sendSmsLanguage=function(e){var s,t="tur";if(e.localeOptions.length){var o=e.localeOptions.find((function(e){return e.routing.locale===i.getCurrentLocale()}));o&&o.iso3&&(t=null===(s=o.iso3)||void 0===s?void 0:s.toLowerCase())}return t},this.clearSaveCardToMasterPassForm=function(){c.saveCardToMasterPass.isCheckboxChecked=!1,c.saveCardToMasterPass.phoneNumber="",c.saveCardToMasterPass.cardName="",c.saveCardToMasterPass.isSendConfirmationButtonPending=!1},this.mfsResponseHandler=function(e){return function(s,t){console.log({field:"mfsResponseHandler",response:t}),e.callback&&e.callback();var o,a=function(e){var s;return null===(s=null==t?void 0:t.accountStatus)||void 0===s?void 0:s.match(e)};a(l)&&(c.checkMasterPassData.status="noMasterPassAccount",(o=c.phoneNumber({checkout:e.checkout,store:e.store,withPlus:!0}))&&(c.saveCardToMasterPass.phoneNumber=o));a(h)&&(c.checkMasterPassData.status="hasMasterPassAccountButDoesNotHaveAnyOperation",c.showLinkCardToClient(),(o=c.phoneNumber({checkout:e.checkout,store:e.store,withPlus:!0}))&&(c.saveCardToMasterPass.phoneNumber=o));if(a(p)&&(c.checkMasterPassData.status="hasMasterPassAccountAndHasRelation",(null==e?void 0:e.checkout)&&e.store&&(c.listCards({store:e.store,checkout:e.checkout}),console.log("call listcards"))),"validateTransaction"!==e.source&&"resendOtp"!==e.source||!t.responseDescription||(c.otpResponse.text=t.responseDescription,"1409"===t.responseCode&&(c.otpResponse.status="error")),"0000"!=t.responseCode&&""!=t.responseCode||(console.log("Register Success"),"deleteCard"===e.source&&c.listCards({store:e.store,checkout:e.checkout}),"validateTransaction"===e.source&&(null==e?void 0:e.checkout)&&e.store&&("hasMasterPassAccountButDoesNotHaveAnyOperation"===c.checkMasterPassData.status?c.visibleModal="linkCardToClientModalSuccess":c.visibleModal="otpModalSuccess",e.checkout.selectedPaymentGateway=void 0,c.clearSaveCardToMasterPassForm(),c.listCards({store:e.store,checkout:e.checkout}))),"5196"===t.responseCode&&t.responseDescription&&(c.visibleModal="mfsResponseModal",c.mfsResponseModalText=t.responseDescription),"5001"==t.responseCode||"5008"==t.responseCode){var n="5001"===t.responseCode?"bankOtp":"masterPassOtp";c.showOtpModal(n)}if("5010"==t.responseCode&&"undefined"!=typeof window)return console.log('response.responseCode == "5010"'),void window.location.assign(t.url3D+"&returnUrl="+window.location.href);console.log({source:"MFS response.responseDescription",responseDescription:t.responseDescription,response:t})}},this.showTokenErrorWithModal=function(){var e=a().t;c.visibleModal="mfsResponseModal",c.mfsResponseModalText=e("checkout-page:errorUnknown")},this.checkMasterPass=function(o){return e(c,void 0,void 0,(function(){var e,a,n,i,c,u,d=o.checkout,l=o.store;return t(o,["checkout","store"]),s(this,(function(s){switch(s.label){case 0:return console.log("checkMasterPass 1"),(e=this.MFS())?(a=this.phoneNumber({store:l,checkout:d}),console.log("checkMasterPass 2"),n=d.masterPassPaymentGateway,a&&n&&n.masterPassClientId?(console.log("checkMasterPass 3",a),[4,this.getToken({cartId:d.id,paymentGatewayId:n.id,operationType:r.CHECK_MASTER_PASS_USER,phoneNumber:a})]):[2]):[2];case 1:return(i=s.sent())?(e.setClientId(n.masterPassClientId),c=this.sendSmsLanguage(l),u=this.prepareFormData({sendSmsLanguage:c,sendSms:"N",referenceNo:i.requestReferenceNumber,token:i.token,userId:a}),e.checkMasterPass(u,this.mfsResponseHandler({source:"checkMasterPass",checkout:d,store:l})),console.log("checkMasterPass 4"),[2]):[2]}}))}))},this.register=function(t){var o=t.creditCard,a=t.store,n=t.checkout,i=t.paymentGateway,u=t.callback;return e(c,void 0,void 0,(function(){var e,t,c,d;return s(this,(function(s){switch(s.label){case 0:return console.log("register 1"),(e=this.MFS())?(console.log("register 2"),(t=o.phoneNumber)&&i.masterPassClientId?(console.log("register 3"),[4,this.getToken({cartId:n.id,paymentGatewayId:i.id,operationType:r.REGISTER_CARD,phoneNumber:t})]):[2]):[2];case 1:return c=s.sent(),console.log("register 4"),(null==c?void 0:c.token)?(d=this.prepareFormData({msisdn:t,token:null==c?void 0:c.token,referenceNo:c.requestReferenceNumber,sendSmsLanguage:this.sendSmsLanguage(a),rtaPan:o.rtaPan,expiryDate:o.expiryDate,cvc:o.cvc,accountAliasName:o.accountAliasName,timeZone:c.timeZone,sendSms:"Y",actionType:"A",clientIp:"",delinkReason:"",eActionType:"A",cardTypeFlag:"05",cpinFlag:"Y",defaultAccount:"Y",mmrpConfig:"110010",identityVerificationFlag:"Y",mobileAccountConfig:"MWA",uiChannelType:"6"}),console.log("reigster 5"),e.setClientId(i.masterPassClientId),e.register(d,this.mfsResponseHandler({source:"register",store:a,checkout:n,callback:u})),[2]):[2]}}))}))},this.resendOtp=function(t){var o=t.store,a=t.checkout,n=t.callback;return e(c,void 0,void 0,(function(){var e,t,r;return s(this,(function(s){return this.isOtpFormSubmitAtLeastOnce&&(e=this.MFS())?(t=e.getLastToken(),r=this.sendSmsLanguage(o),e.resendOtp(t,r,this.mfsResponseHandler({source:"resendOtp",store:o,checkout:a,callback:n})),[2]):[2]}))}))},this.linkCardToClient=function(t){var o=t.store,a=t.checkout,n=t.callback;return e(c,void 0,void 0,(function(){var e,t,i,c,u;return s(this,(function(s){switch(s.label){case 0:return(e=this.MFS())&&((t=this.phoneNumber({store:o,checkout:a}))&&(null==(i=a.masterPassPaymentGateway)?void 0:i.id))?[4,this.getToken({cartId:a.id,paymentGatewayId:i.id,operationType:r.REGISTER_CARD,phoneNumber:t})]:[2];case 1:return(c=s.sent())?(u=this.prepareFormData({sendSms:"Y",sendSmsLanguage:this.sendSmsLanguage(o),token:c.token,referenceNo:c.requestReferenceNumber,cardAliasName:"",msisdn:t}),e.linkCardToClient(u,this.mfsResponseHandler({source:"linkCardToClient",store:o,checkout:a,callback:n})),[2]):(n&&n(),[2])}}))}))},this.validateTransaction=function(t){var o=t.validationCode,a=t.store,n=t.checkout,i=t.callback;return e(c,void 0,void 0,(function(){var e,t,c,u,d;return s(this,(function(s){switch(s.label){case 0:return(e=this.MFS())&&((t=this.phoneNumber({store:a,checkout:n}))&&(c=n.masterPassPaymentGateway))?[4,this.getToken({cartId:n.id,paymentGatewayId:c.id,operationType:r.REGISTER_CARD,phoneNumber:t})]:[2];case 1:return(u=s.sent())?(d=this.prepareFormData({pinType:"otp",validationCode:o,sendSms:"Y",sendSmsLanguage:this.sendSmsLanguage(a),token:u.token,referenceNo:u.requestReferenceNumber}),this.isOtpFormSubmitAtLeastOnce||(this.isOtpFormSubmitAtLeastOnce=!0),e.validateTransaction(d,this.mfsResponseHandler({source:"validateTransaction",store:a,checkout:n,callback:i})),[2]):[2]}}))}))},this.listCards=function(t){var o=t.store,a=t.checkout;return e(c,void 0,void 0,(function(){var e,t,n,i,c,u,d=this;return s(this,(function(s){switch(s.label){case 0:return(e=this.MFS())&&(t=this.phoneNumber({store:o,checkout:a}))?(n=null===(u=a.masterPassPaymentGateway)||void 0===u?void 0:u.id,console.log("listCards paymentGatewayId",n),n?[4,this.getToken({cartId:a.id,paymentGatewayId:n,operationType:r.LIST_CARDS,phoneNumber:t})]:[2]):[2];case 1:return(i=s.sent())?(c=function(e,s){"0000"!=s.responseCode&&""!=s.responseCode&&(console.error({source:"mfs response.responseDescription",responseDescription:s.responseDescription,response:s}),console.log("TransactionID->",s.transactionId));var t=[];if(Array.isArray(s.cards)&&s.cards.length)for(var o=0;o<s.cards.length;o++){var a=s.cards[o];a.paymentGatewayId=n,t.push(a)}d.cards=t,console.log("list_card response->",s),console.log("Cards",t),console.log("TransactionID->",s.transactionId)},e.listCards(t,i.token,c),[2]):[2]}}))}))},this.deleteCard=function(t){var o=t.store,a=t.checkout,n=t.card;return e(c,void 0,void 0,(function(){var e,t,i,c;return s(this,(function(s){switch(s.label){case 0:return(e=this.MFS())&&(t=this.phoneNumber({store:o,checkout:a}))?[4,this.getToken({cartId:a.id,paymentGatewayId:n.paymentGatewayId,operationType:r.DELETE_CARD,phoneNumber:t})]:[2];case 1:return(i=s.sent())?(c=this.prepareFormData({sendSms:"N",msisdn:t,token:i.token,referenceNo:i.requestReferenceNumber,sendSmsLanguage:this.sendSmsLanguage(o),accountAliasName:n.Name}),e.deleteCard(c,this.mfsResponseHandler({source:"deleteCard",store:o,checkout:a})),[2]):[2]}}))}))},o(this)}return Object.defineProperty(c.prototype,"isSaveCardToMasterPassPhoneNumberInputVisible",{get:function(){return("hasMasterPassAccountAndHasRelation"!==this.checkMasterPassData.status||!this.cards.length)&&("hasMasterPassAccountButDoesNotHaveAnyOperation"===this.checkMasterPassData.status||this.checkMasterPassData.status,!0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isSaveCardToMasterPassPhoneNumberInputDisabled",{get:function(){return!("hasMasterPassAccountAndHasRelation"!==this.checkMasterPassData.status||!this.cards.length)||("hasMasterPassAccountButDoesNotHaveAnyOperation"===this.checkMasterPassData.status||"noMasterPassAccount"===this.checkMasterPassData.status)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isSendConfirmationButtonDisabled",{get:function(){return this.isSaveCardToMasterPassPhoneNumberInputVisible?this.isSaveCardToMasterPassPhoneNumberInputDisabled?!this.saveCardToMasterPass.cardName:!this.saveCardToMasterPass.cardName||!this.saveCardToMasterPass.phoneNumber:!this.saveCardToMasterPass.cardName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isLinkCardToClientVisible",{get:function(){return"linkCardToClient"===this.visibleModal},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOtpModalVisible",{get:function(){return"otpModalBank"===this.visibleModal||"otpModalMasterPass"===this.visibleModal},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isResponseModalVisible",{get:function(){return!("mfsResponseModal"!==this.visibleModal||!this.mfsResponseModalText)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isSuccessModalVisible",{get:function(){return"linkCardToClientModalSuccess"===this.visibleModal||"otpModalSuccess"===this.visibleModal},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"otpModalType",{get:function(){return"otpModalMasterPass"===this.visibleModal?"masterPassOtp":"bankOtp"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"successModalType",{get:function(){return"hasMasterPassAccountButDoesNotHaveAnyOperation"===this.checkMasterPassData.status?"linkCardToClient":"register"},enumerable:!1,configurable:!0}),c.prototype.prepareFormData=function(e){var s=new FormData;return Object.entries(e).forEach((function(e){var t=e[0],o=e[1];return s.append(t,o)})),s},c}();export{c as MFS_ELEMENT_ID,u as MFS_SCRIPT_URL,m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import{FormItem as o}from"../../components/form-item/index.js";import{FormItemType as i,
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import{FormItem as o}from"../../components/form-item/index.js";import{FormItemType as i,FormItemInputMode as r}from"../../components/form-item/model.js";import{Button as n}from"../../components/button/index.js";import{Checkbox as c}from"../../components/checkbox/index.js";import m from"../../components/error/index.js";import s from"../../styles/common.module.scss.js";import a from"../../components/customer-addresses/index.js";import l from"../../components/customer-addresses/model.js";import"@ikas/storefront-config";import{useTranslation as u}from"../../../../utils/i18n.js";var p=t((function(t){var p,d,h=t.vm,g=u().t,f=e.useCallback((function(e){h.checkout.customer&&(h.checkout.customer.email=e?e.trim():e)}),[h,h.checkout,h.checkout.customer]),k=e.useMemo((function(){return h.isDigitalOnly?new l(h,"billing"):new l(h,"shipping")}),[h]);return e.createElement("div",null,e.createElement(m,{vm:h}),!h.checkout.hasCustomer&&e.createElement("div",{style:{marginTop:"8px",marginBottom:"40px"}},e.createElement("div",{className:s.FormSectionTitle},e.createElement("div",{className:s.Title},g("checkout-page:contactInfo"))),e.createElement(o,{type:i.TEXT,inputMode:r.EMAIL,label:g("checkout-page:email"),autocomplete:"email",value:(null===(p=h.checkout.customer)||void 0===p?void 0:p.email)||"",onChange:f,hasError:h.isErrorsVisible&&!h.checkout.hasValidCustomerEmail,errorText:g("checkout-page:emailError"),tooltipText:g("checkout-page:guestEmailTooltip")}),e.createElement(c,{value:(null===(d=h.checkout.customer)||void 0===d?void 0:d.notificationsAccepted)||!1,label:g("checkout-page:customerConsentCta"),onChange:h.setCustomerConsentGranted})),e.createElement(a,{vm:k}),!k.editingCustomerAddress&&e.createElement(n,{style:{width:"100%",marginTop:h.store.customerStore.customer?"0px":"32px"},text:"address"!==h.deliveryMethod||h.isDigitalOnly?g("checkout-page:actions.continueWithPayment"):g("checkout-page:actions.continueWithShipping"),isLoading:h.isStepLoading,onClick:h.isDigitalOnly?h.onProceedToDigitalOnlyPaymentClick:h.onProceedToShippingClick}))}));export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import{
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import{IkasStorefrontConfig as o}from"@ikas/storefront-config";import{Checkbox as i}from"../../components/checkbox/index.js";import n from"../../components/error/index.js";import{PaymentGateways as r}from"./payment-gateways/index.js";import{BillingAddress as a}from"./billing-address/index.js";import{Button as c}from"../../components/button/index.js";import s from"../../components/master-pass/link-card-to-client/index.js";import{createTranslationInputData as l,useTranslation as m}from"../../../../utils/i18n.js";import p from"../../components/svg/lock.js";import d from"./style.module.scss.js";var k=t((function(t){var k=t.vm,u=m().t,y=e.useCallback((function(e){e.stopPropagation(),k.policyModalTitle=u("checkout-page:privacyPolicy"),k.policyModalText=k.privacyPolicy}),[k,k.privacyPolicy]),g=e.useCallback((function(e){e.stopPropagation(),k.policyModalTitle=u("checkout-page:termsOfService"),k.policyModalText=k.termsOfService}),[k,k.termsOfService]),v=o.getTranslations()["checkout-page"],f=l(v.ackPoliciesSentence).map((function(t){return t.isVariable?e.createElement("span",{className:[d.TermsLabelSpan,k.isErrorsVisible&&!k.isTermsAndConditionsChecked?d.Error:""].join(" "),onClick:"{{ ackPrivacyPolicy }}"===t.value?y:g},"{{ ackPrivacyPolicy }}"===t.value?u("checkout-page:ackPrivacyPolicy"):u("checkout-page:ackTermsOfService")):t.value}));return e.createElement("div",{className:[d.StepPayment].join(" ")},e.createElement(n,{vm:k}),k.mpVM.isLinkCardToClientVisible&&e.createElement(s,{vm:k}),e.createElement(r,{vm:k}),e.createElement(a,{vm:k}),k.checkoutSettings.showTermsAndConditionsCheckbox&&e.createElement("div",{style:{marginTop:k.useDifferentAddress?"12px":"0px"}},e.createElement(i,{value:k.isTermsAndConditionsChecked,hasError:k.isErrorsVisible&&!k.isTermsAndConditionsChecked,label:e.createElement(e.Fragment,null,f),onChange:k.onTermsAndConditionsCheckedChange})),e.createElement(c,{style:{width:"100%",marginTop:"24px"},text:u("checkout-page:actions.completeOrder"),isLoading:k.isStepLoading,onClick:k.isDigitalOnly?k.onCompleteDigitalOnlyPaymentClick:k.onCompletePaymentClick}),!!u("checkout-page:securePaymentTooltip")&&e.createElement("div",{className:d.SecurePaymentContainer},e.createElement("span",{className:d.Lock},e.createElement(p,null)),e.createElement("span",null,u("checkout-page:securePaymentTooltip"))))}));export{k as CheckoutStepPayment};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../../ext/style-inject/dist/style-inject.es.js';var
|
|
1
|
+
import e from'./../../../../../ext/style-inject/dist/style-inject.es.js';var n={PaymentLogoContainer:"style-module_PaymentLogoContainer__h4VF0",AdditionalPrice:"style-module_AdditionalPrice__42TO1",MasterPassSelectBoxDeleteButton:"style-module_MasterPassSelectBoxDeleteButton__J1RSJ",MasterPassSelectBoxLabelLogo:"style-module_MasterPassSelectBoxLabelLogo__fIhG7",Hidden:"style-module_Hidden__5-IfX"};e(".style-module_PaymentLogoContainer__h4VF0 {\n margin-left: 10px;\n font-size: 0.7em;\n}\n.style-module_PaymentLogoContainer__h4VF0 img {\n height: 20px;\n}\n\n.style-module_AdditionalPrice__42TO1 {\n color: var(--checkout-primary-text-color);\n font-weight: 600;\n}\n\n.style-module_MasterPassSelectBoxDeleteButton__J1RSJ {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n padding: 4px 8px;\n margin-right: -8px;\n background-color: transparent;\n border: none;\n outline: none;\n cursor: pointer;\n}\n.style-module_MasterPassSelectBoxDeleteButton__J1RSJ:hover {\n text-decoration: underline;\n}\n\n.style-module_MasterPassSelectBoxLabelLogo__fIhG7 {\n display: inline-flex;\n margin-right: 12px;\n width: 32px;\n}\n.style-module_MasterPassSelectBoxLabelLogo__fIhG7 svg {\n width: 100%;\n height: 100%;\n}\n\n.style-module_Hidden__5-IfX {\n display: none;\n}");export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as a}from"../../components/button/index.js";import{CART_LS_KEY as o}from"../../../../store/cart/index.js";import i from"./style.module.scss.js";import s from"../../components/svg/success-circle.js";import r from"../../components/expandable-section/index.js";import n from"../../components/credit-card-form/svg/amex.js";import d from"../../components/credit-card-form/svg/master-card.js";import c from"../../components/credit-card-form/svg/troy.js";import l from"../../components/credit-card-form/svg/visa.js";import"@ikas/storefront-config";import{formatCurrency as m}from"../../../../utils/currency.js";import{useTranslation as u}from"../../../../utils/i18n.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{IkasPaymentMethodType as p,IkasPaymentGatewayType as v,IkasOrderPackageStatus as E,IkasTransactionCardAssociation as f}from"@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/index.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/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/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/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/option-set/option/index.js";import"../../../../models/data/product/option-set/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/state/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/custom-data/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-list/index.js";import"../../../../models/ui/product-attribute-detail/index.js";import"../../../../models/ui/product-attribute-list/index.js";import"../../../../models/ui/customer-review-list/index.js";import"../../../../models/ui/customer-review-summary-list/index.js";import"../../../../models/ui/validator/index.js";import"../../../../models/ui/validator/rules/index.js";import"../../../../models/ui/validator/form/login.js";import"../../../../models/ui/validator/form/address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";import g from"../../components/offer-product/index.js";import{Analytics as x}from"../../../../analytics/analytics.js";import"../../../../analytics/head/index.js";var h=t((function(t){var E,h,k,T,y,N,I=t.vm,L=u().t;e.useEffect((function(){if("undefined"!=typeof localStorage){var e=localStorage.getItem(o);e&&e===I.checkout.id&&(I.successTransaction&&x.purchase(I.checkout,I.successTransaction),localStorage.removeItem(o)),window&&window.handleKlarna&&window.handleKlarna(void 0)}}),[]);var A=((null===(E=I.checkout.customer)||void 0===E?void 0:E.firstName)||"")+" "+((null===(h=I.checkout.customer)||void 0===h?void 0:h.lastName)||""),C=((null===(k=I.checkout.shippingAddress)||void 0===k?void 0:k.firstName)||"")+" "+((null===(T=I.checkout.shippingAddress)||void 0===T?void 0:T.lastName)||""),D=I.paymentGateways.find((function(e){var t;return e.id===(null===(t=I.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),S=null===(y=I.successTransaction)||void 0===y?void 0:y.paymentMethodDetail,R=e.useMemo((function(){var t,a,o,s;return e.createElement("div",{className:[i.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},L("checkout-page:paymentMethod")),D&&e.createElement(e.Fragment,null,!!D.logoUrl&&e.createElement("div",{className:i.PaymentLogoContainer},e.createElement("img",{src:D.logoUrl})),!D.logoUrl&&e.createElement("div",{className:i.InfoText},D.paymentMethodType===p.CREDIT_CARD&&D.type===v.INTERNAL?L("checkout-page:creditCard"):D.name),!!D.description&&D.type!==v.EXTERNAL&&e.createElement("div",{className:i.InfoText},e.createElement("div",{dangerouslySetInnerHTML:{__html:D.description}}))),"CREDIT_CARD"===(null===(t=I.successTransaction)||void 0===t?void 0:t.paymentMethod)&&e.createElement(e.Fragment,null,e.createElement("div",{className:i.InfoText},e.createElement("div",{className:i.CardLogoContainer},function(){var t,a;switch(null===(a=null===(t=I.successTransaction)||void 0===t?void 0:t.paymentMethodDetail)||void 0===a?void 0:a.cardAssociation){case f.AMERICAN_EXPRESS:return e.createElement(n,null);case f.MASTER_CARD:return e.createElement(d,null);case f.TROY:return e.createElement(c,null);case f.VISA:return e.createElement(l,null);default:return e.createElement("div",null)}}()),e.createElement("span",null,"**** ".concat((null==S?void 0:S.lastFourDigits)||""))),(null===(a=null==S?void 0:S.installment)||void 0===a?void 0:a.installmentCount)&&S.installment.installmentCount>1&&e.createElement(e.Fragment,null,e.createElement("div",{className:i.InfoText},"".concat(S.installment.installmentCount," ").concat(L("checkout-page:installments"))),null!==S.installment.installmentPrice&&e.createElement("div",{className:i.InfoText},"".concat(S.installment.installmentCount," x ").concat(m(S.installment.installmentPrice,I.checkout.currencyCode,I.checkout.currencySymbol)))))),e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},L("checkout-page:billingAddress")),!!(null===(o=I.checkout.billingAddress)||void 0===o?void 0:o.company)&&e.createElement("div",{className:[i.InfoText,i.InfoTextBold].join(" ")},I.checkout.billingAddress.company),e.createElement("div",{className:i.InfoText},null===(s=I.checkout.billingAddress)||void 0===s?void 0:s.addressText)))}),[]),b=e.useMemo((function(){var t,a,o,s,r;return e.createElement("div",{className:[i.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},L("checkout-page:contactInfo")),e.createElement("div",{className:i.InfoText},null===(t=I.checkout.customer)||void 0===t?void 0:t.email),e.createElement("div",{className:i.InfoText},A),!!(null===(a=I.checkout.shippingAddress)||void 0===a?void 0:a.phone)&&e.createElement("div",{className:i.InfoText},null===(o=I.checkout.shippingAddress)||void 0===o?void 0:o.phone)),e.createElement("div",null,"in-store"===I.deliveryMethod&&e.createElement(e.Fragment,null,e.createElement("div",{className:i.InfoTitle},L("checkout-page:receiver")),e.createElement("div",{className:[i.InfoText,i.withMBottom].join(" ")},C)),e.createElement("div",{className:i.InfoTitle},"address"===I.deliveryMethod?L("checkout-page:shippingAddress"):L("checkout-page:pickUpLocation")),!!(null===(s=I.checkout.shippingAddress)||void 0===s?void 0:s.company)&&e.createElement("div",{className:[i.InfoText,i.InfoTextBold].join(" ")},I.checkout.shippingAddress.company),e.createElement("div",{className:i.InfoText},null===(r=I.checkout.shippingAddress)||void 0===r?void 0:r.addressText)))}),[]);return e.createElement("div",{className:i.StepSuccess},e.createElement("div",{className:i.SuccessTitleContainer},e.createElement(s,null),e.createElement("span",{className:i.SuccessTitle},L("checkout-page:orderSuccessTitle"))),e.createElement("div",{className:i.SuccessSubTitle},L("address"===I.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:A})),e.createElement("div",{className:[i.InfoGrid,i.WithBorder].join(" ")},e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},L("checkout-page:orderNoAndDate")),e.createElement("div",{className:[i.InfoText,i.InfoTextBold].join(" ")},"#"+(I.checkout.orderNumber||"")),e.createElement("div",{className:i.InfoText},I.checkout.dateStr),e.createElement(j,{vm:I})),e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},L("checkout-page:contactInfo")),e.createElement("div",{className:i.InfoText},null===(N=I.checkout.customer)||void 0===N?void 0:N.email),e.createElement("div",{className:i.InfoText},A))),I.postCheckoutCampaignOffer&&e.createElement(g,{vm:I,campaignOffer:I.postCheckoutCampaignOffer}),e.createElement(r,{title:L("checkout-page:paymentSummary")},R),!I.isDigitalOnly&&e.createElement(r,{title:L("checkout-page:shippingSummary")},b),e.createElement("div",{className:i.Actions},e.createElement("div",{className:i.HelpText},e.createElement("span",null,L("checkout-page:helpCtaQuestion")),e.createElement("span",{className:i.Cta,onClick:function(){return I.setContactModalVisible(!0)}},L("checkout-page:helpCta"))),e.createElement(a,{text:L("checkout-page:actions.backToShopping"),onClick:I.onBackToShoppingClick,style:{flex:"0 0 auto"}})))})),j=t((function(t){var a,o=t.vm,s=u().t,r=i.Yellow;switch(o.checkout.orderPackageStatus){case E.FULFILLED:case E.PARTIALLY_FULFILLED:case E.DELIVERED:case E.PARTIALLY_DELIVERED:r=i.Green;break;case E.CANCELLED:case E.PARTIALLY_CANCELLED:case E.CANCEL_REJECTED:case E.CANCEL_REQUESTED:r=i.Red}return e.createElement("div",{className:[i.OrderStatus,r].join(" ")},o.checkout.orderPackageStatus?null===(a=[{types:[E.UNFULFILLED],text:s("checkout-page:orderPackageStatus.unfulfilled")},{types:[E.READY_FOR_SHIPMENT],text:s("checkout-page:orderPackageStatus.readyForShipment")},{types:[E.PARTIALLY_FULFILLED],text:s("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[E.FULFILLED],text:s("checkout-page:orderPackageStatus.fulfilled")},{types:[E.DELIVERED,E.PARTIALLY_DELIVERED],text:s("checkout-page:orderPackageStatus.delivered")},{types:[E.UNABLE_TO_DELIVER],text:s("checkout-page:orderPackageStatus.unableToDeliver")},{types:[E.CANCELLED,E.PARTIALLY_CANCELLED],text:s("checkout-page:orderPackageStatus.cancelled")},{types:[E.CANCEL_REJECTED],text:s("checkout-page:orderPackageStatus.cancelRejected")},{types:[E.REFUNDED,E.PARTIALLY_REFUNDED],text:s("checkout-page:orderPackageStatus.refunded")},{types:[E.REFUND_REQUEST_ACCEPTED],text:s("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[E.REFUND_REJECTED],text:s("checkout-page:orderPackageStatus.refundRejected")},{types:[E.REFUND_REQUESTED],text:s("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(o.checkout.orderPackageStatus)})))||void 0===a?void 0:a.text:"")}));export{h as StepSuccess};
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as a}from"../../components/button/index.js";import{CART_LS_KEY as o}from"../../../../store/cart/index.js";import i from"./style.module.scss.js";import s from"../../components/svg/success-circle.js";import r from"../../components/expandable-section/index.js";import n from"../../components/credit-card-form/svg/amex.js";import d from"../../components/credit-card-form/svg/master-card.js";import c from"../../components/credit-card-form/svg/troy.js";import l from"../../components/credit-card-form/svg/visa.js";import"@ikas/storefront-config";import{formatCurrency as m}from"../../../../utils/currency.js";import{useTranslation as u}from"../../../../utils/i18n.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{IkasPaymentMethodType as p,IkasPaymentGatewayType as v,IkasOrderPackageStatus as E,IkasTransactionCardAssociation as f}from"@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/index.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/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/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/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/option-set/option/index.js";import"../../../../models/data/product/option-set/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/state/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/custom-data/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-list/index.js";import"../../../../models/ui/product-attribute-detail/index.js";import"../../../../models/ui/product-attribute-list/index.js";import"../../../../models/ui/customer-review-list/index.js";import"../../../../models/ui/customer-review-summary-list/index.js";import"../../../../models/ui/validator/index.js";import"../../../../models/ui/validator/rules/index.js";import"../../../../models/ui/validator/form/login.js";import"../../../../models/ui/validator/form/address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";import g from"../../components/offer-product/index.js";import{Analytics as x}from"../../../../analytics/analytics.js";import"../../../../analytics/head/index.js";import{QuickRegistration as h}from"../../components/quick-registration/index.js";var j=t((function(t){var E,j,T,y,N,I,L=t.vm,A=u().t;e.useEffect((function(){if("undefined"!=typeof localStorage){var e=localStorage.getItem(o);e&&e===L.checkout.id&&(L.successTransaction&&x.purchase(L.checkout,L.successTransaction),localStorage.removeItem(o)),window&&window.handleKlarna&&window.handleKlarna(void 0)}}),[]);var C=((null===(E=L.checkout.customer)||void 0===E?void 0:E.firstName)||"")+" "+((null===(j=L.checkout.customer)||void 0===j?void 0:j.lastName)||""),D=((null===(T=L.checkout.shippingAddress)||void 0===T?void 0:T.firstName)||"")+" "+((null===(y=L.checkout.shippingAddress)||void 0===y?void 0:y.lastName)||""),S=L.paymentGateways.find((function(e){var t;return e.id===(null===(t=L.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),R=null===(N=L.successTransaction)||void 0===N?void 0:N.paymentMethodDetail,b=e.useMemo((function(){var t,a,o,s;return e.createElement("div",{className:[i.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},A("checkout-page:paymentMethod")),S&&e.createElement(e.Fragment,null,!!S.logoUrl&&e.createElement("div",{className:i.PaymentLogoContainer},e.createElement("img",{src:S.logoUrl})),!S.logoUrl&&e.createElement("div",{className:i.InfoText},S.paymentMethodType===p.CREDIT_CARD&&S.type===v.INTERNAL?A("checkout-page:creditCard"):S.name),!!S.description&&S.type!==v.EXTERNAL&&e.createElement("div",{className:i.InfoText},e.createElement("div",{dangerouslySetInnerHTML:{__html:S.description}}))),"CREDIT_CARD"===(null===(t=L.successTransaction)||void 0===t?void 0:t.paymentMethod)&&e.createElement(e.Fragment,null,e.createElement("div",{className:i.InfoText},e.createElement("div",{className:i.CardLogoContainer},function(){var t,a;switch(null===(a=null===(t=L.successTransaction)||void 0===t?void 0:t.paymentMethodDetail)||void 0===a?void 0:a.cardAssociation){case f.AMERICAN_EXPRESS:return e.createElement(n,null);case f.MASTER_CARD:return e.createElement(d,null);case f.TROY:return e.createElement(c,null);case f.VISA:return e.createElement(l,null);default:return e.createElement("div",null)}}()),e.createElement("span",null,"**** ".concat((null==R?void 0:R.lastFourDigits)||""))),(null===(a=null==R?void 0:R.installment)||void 0===a?void 0:a.installmentCount)&&R.installment.installmentCount>1&&e.createElement(e.Fragment,null,e.createElement("div",{className:i.InfoText},"".concat(R.installment.installmentCount," ").concat(A("checkout-page:installments"))),null!==R.installment.installmentPrice&&e.createElement("div",{className:i.InfoText},"".concat(R.installment.installmentCount," x ").concat(m(R.installment.installmentPrice,L.checkout.currencyCode,L.checkout.currencySymbol)))))),e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},A("checkout-page:billingAddress")),!!(null===(o=L.checkout.billingAddress)||void 0===o?void 0:o.company)&&e.createElement("div",{className:[i.InfoText,i.InfoTextBold].join(" ")},L.checkout.billingAddress.company),e.createElement("div",{className:i.InfoText},null===(s=L.checkout.billingAddress)||void 0===s?void 0:s.addressText)))}),[]),P=e.useMemo((function(){var t,a,o,s,r;return e.createElement("div",{className:[i.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},A("checkout-page:contactInfo")),e.createElement("div",{className:i.InfoText},null===(t=L.checkout.customer)||void 0===t?void 0:t.email),e.createElement("div",{className:i.InfoText},C),!!(null===(a=L.checkout.shippingAddress)||void 0===a?void 0:a.phone)&&e.createElement("div",{className:i.InfoText},null===(o=L.checkout.shippingAddress)||void 0===o?void 0:o.phone)),e.createElement("div",null,"in-store"===L.deliveryMethod&&e.createElement(e.Fragment,null,e.createElement("div",{className:i.InfoTitle},A("checkout-page:receiver")),e.createElement("div",{className:[i.InfoText,i.withMBottom].join(" ")},D)),e.createElement("div",{className:i.InfoTitle},"address"===L.deliveryMethod?A("checkout-page:shippingAddress"):A("checkout-page:pickUpLocation")),!!(null===(s=L.checkout.shippingAddress)||void 0===s?void 0:s.company)&&e.createElement("div",{className:[i.InfoText,i.InfoTextBold].join(" ")},L.checkout.shippingAddress.company),e.createElement("div",{className:i.InfoText},null===(r=L.checkout.shippingAddress)||void 0===r?void 0:r.addressText)))}),[]);return e.createElement("div",{className:i.StepSuccess},e.createElement("div",{className:i.SuccessTitleContainer},e.createElement(s,{className:i.SuccessCircle}),e.createElement("span",{className:i.SuccessTitle},A("checkout-page:orderSuccessTitle"))),e.createElement("div",{className:i.SuccessSubTitle},A("address"===L.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:C})),e.createElement("div",{className:[i.InfoGrid,i.WithBorder].join(" ")},e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},A("checkout-page:orderNoAndDate")),e.createElement("div",{className:[i.InfoText,i.InfoTextBold].join(" ")},"#"+(L.checkout.orderNumber||"")),e.createElement("div",{className:i.InfoText},L.checkout.dateStr),e.createElement(k,{vm:L})),e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},A("checkout-page:contactInfo")),e.createElement("div",{className:i.InfoText},null===(I=L.checkout.customer)||void 0===I?void 0:I.email),e.createElement("div",{className:i.InfoText},C))),L.postCheckoutCampaignOffer&&e.createElement(g,{vm:L,campaignOffer:L.postCheckoutCampaignOffer}),L.hasQuickRegistration&&e.createElement(h,{vm:L}),e.createElement(r,{title:A("checkout-page:paymentSummary")},b),!L.isDigitalOnly&&e.createElement(r,{title:A("checkout-page:shippingSummary")},P),e.createElement("div",{className:i.Actions},e.createElement("div",{className:i.HelpText},e.createElement("span",null,A("checkout-page:helpCtaQuestion")),e.createElement("span",{className:i.Cta,onClick:function(){return L.setContactModalVisible(!0)}},A("checkout-page:helpCta"))),e.createElement(a,{text:A("checkout-page:actions.backToShopping"),onClick:L.onBackToShoppingClick,style:{flex:"0 0 auto"}})))})),k=t((function(t){var a,o=t.vm,s=u().t,r=i.Yellow;switch(o.checkout.orderPackageStatus){case E.FULFILLED:case E.PARTIALLY_FULFILLED:case E.DELIVERED:case E.PARTIALLY_DELIVERED:r=i.Green;break;case E.CANCELLED:case E.PARTIALLY_CANCELLED:case E.CANCEL_REJECTED:case E.CANCEL_REQUESTED:r=i.Red}return e.createElement("div",{className:[i.OrderStatus,r].join(" ")},o.checkout.orderPackageStatus?null===(a=[{types:[E.UNFULFILLED],text:s("checkout-page:orderPackageStatus.unfulfilled")},{types:[E.READY_FOR_SHIPMENT],text:s("checkout-page:orderPackageStatus.readyForShipment")},{types:[E.PARTIALLY_FULFILLED],text:s("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[E.FULFILLED],text:s("checkout-page:orderPackageStatus.fulfilled")},{types:[E.DELIVERED,E.PARTIALLY_DELIVERED],text:s("checkout-page:orderPackageStatus.delivered")},{types:[E.UNABLE_TO_DELIVER],text:s("checkout-page:orderPackageStatus.unableToDeliver")},{types:[E.CANCELLED,E.PARTIALLY_CANCELLED],text:s("checkout-page:orderPackageStatus.cancelled")},{types:[E.CANCEL_REJECTED],text:s("checkout-page:orderPackageStatus.cancelRejected")},{types:[E.REFUNDED,E.PARTIALLY_REFUNDED],text:s("checkout-page:orderPackageStatus.refunded")},{types:[E.REFUND_REQUEST_ACCEPTED],text:s("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[E.REFUND_REJECTED],text:s("checkout-page:orderPackageStatus.refundRejected")},{types:[E.REFUND_REQUESTED],text:s("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(o.checkout.orderPackageStatus)})))||void 0===a?void 0:a.text:"")}));export{j as StepSuccess};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var t={StepSuccess:"style-module_StepSuccess__Z1fJf",SuccessTitleContainer:"style-module_SuccessTitleContainer__nuvae",SuccessTitle:"style-module_SuccessTitle__5KjBJ",SuccessSubTitle:"style-module_SuccessSubTitle__ToDuD",InfoGrid:"style-module_InfoGrid__XrEQa",InfoTitle:"style-module_InfoTitle__AHygg",InfoText:"style-module_InfoText__4oiHL",InfoTextBold:"style-module_InfoTextBold__LVBB6",WithBorder:"style-module_WithBorder__JQ5Qf",CardLogoContainer:"style-module_CardLogoContainer__upSYf",PaymentLogoContainer:"style-module_PaymentLogoContainer__loO75",Actions:"style-module_Actions__RCwtF",HelpText:"style-module_HelpText__xrYQr",Cta:"style-module_Cta__rhsFl",OrderStatus:"style-module_OrderStatus__377-N",Yellow:"style-module_Yellow__gF1-u",Green:"style-module_Green__-80q-",Red:"style-module_Red__zXV4o",withMBottom:"style-module_withMBottom__8N71-"};e(".style-module_StepSuccess__Z1fJf {\n padding-top: 24px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_SuccessTitleContainer__nuvae {\n margin-bottom: 24px;\n display: flex;\n align-items: center;\n}\n.style-module_StepSuccess__Z1fJf .style-module_SuccessTitleContainer__nuvae .style-module_SuccessTitle__5KjBJ {\n font-size: 28px;\n font-weight: 600;\n margin-left: 16px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_SuccessSubTitle__ToDuD {\n margin: auto;\n margin-bottom: 32px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa {\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-gap: 48px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa .style-module_InfoTitle__AHygg {\n font-size: 16px;\n line-height: 24px;\n margin-bottom: 12px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa .style-module_InfoText__4oiHL {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa .style-module_InfoTextBold__LVBB6 {\n font-weight: 600;\n color: var(--checkout-primary-text-color);\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa.style-module_WithBorder__JQ5Qf {\n border-bottom: 1px solid var(--checkout-border-color);\n padding-bottom: 24px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa .style-module_CardLogoContainer__upSYf {\n display: flex;\n align-items: center;\n margin-right: 4px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa .style-module_PaymentLogoContainer__loO75 img {\n height: 20px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF {\n width: 100%;\n display: flex;\n justify-content: space-between;\n margin: auto;\n margin-top: 24px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF .style-module_HelpText__xrYQr {\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n flex-wrap: wrap;\n}\n.style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF .style-module_HelpText__xrYQr .style-module_Cta__rhsFl {\n color: var(--checkout-primary-text-color);\n margin-left: 4px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF .style-module_HelpText__xrYQr .style-module_Cta__rhsFl:hover {\n cursor: pointer;\n text-decoration: underline;\n}\n@media only screen and (max-width: 400px) {\n .style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF {\n flex-direction: column;\n }\n .style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF .style-module_HelpText__xrYQr {\n margin-bottom: 12px;\n }\n .style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF .style-module_HelpText__xrYQr .style-module_Cta__rhsFl {\n margin-left: 0;\n }\n}\n.style-module_StepSuccess__Z1fJf .style-module_OrderStatus__377-N {\n padding: 4px 8px;\n border-radius: 6px;\n margin-top: 8px;\n font-size: 14px;\n font-weight: 500;\n display: inline-flex;\n}\n.style-module_StepSuccess__Z1fJf .style-module_OrderStatus__377-N.style-module_Yellow__gF1-u {\n color: var(--checkout-warning-color);\n background-color: var(--checkout-warning-light-color);\n border: 1px solid var(--checkout-warning-color);\n}\n.style-module_StepSuccess__Z1fJf .style-module_OrderStatus__377-N.style-module_Green__-80q- {\n color: var(--checkout-success-color);\n background-color: var(--checkout-success-light-color);\n border: 1px solid var(--checkout-success-color);\n}\n.style-module_StepSuccess__Z1fJf .style-module_OrderStatus__377-N.style-module_Red__zXV4o {\n color: var(--checkout-error-color);\n background-color: var(--checkout-error-light-color);\n border: 1px solid var(--checkout-error-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_StepSuccess__Z1fJf {\n padding-left: 24px;\n padding-right: 24px;\n }\n .style-module_StepSuccess__Z1fJf .style-module_SuccessTitleContainer__nuvae {\n margin-bottom: 12px;\n }\n .style-module_StepSuccess__Z1fJf .style-module_SuccessTitleContainer__nuvae .style-module_SuccessTitle__5KjBJ {\n font-size: 20px;\n }\n .style-module_StepSuccess__Z1fJf .style-module_SuccessSubTitle__ToDuD {\n max-width: 400px;\n margin-left: 56px;\n }\n}\n@media only screen and (max-width: 400px) {\n .style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa {\n grid-template-columns: 1fr;\n grid-gap: 24px;\n }\n .style-module_StepSuccess__Z1fJf .style-module_SuccessSubTitle__ToDuD {\n margin-left: 0;\n }\n}\n\n.style-module_withMBottom__8N71- {\n margin-bottom: 12px;\n}");export{t as default};
|
|
1
|
+
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var t={StepSuccess:"style-module_StepSuccess__Z1fJf",SuccessTitleContainer:"style-module_SuccessTitleContainer__nuvae",SuccessCircle:"style-module_SuccessCircle__bU5W0",SuccessTitle:"style-module_SuccessTitle__5KjBJ",SuccessSubTitle:"style-module_SuccessSubTitle__ToDuD",InfoGrid:"style-module_InfoGrid__XrEQa",InfoTitle:"style-module_InfoTitle__AHygg",InfoText:"style-module_InfoText__4oiHL",InfoTextBold:"style-module_InfoTextBold__LVBB6",WithBorder:"style-module_WithBorder__JQ5Qf",CardLogoContainer:"style-module_CardLogoContainer__upSYf",PaymentLogoContainer:"style-module_PaymentLogoContainer__loO75",Actions:"style-module_Actions__RCwtF",HelpText:"style-module_HelpText__xrYQr",Cta:"style-module_Cta__rhsFl",OrderStatus:"style-module_OrderStatus__377-N",Yellow:"style-module_Yellow__gF1-u",Green:"style-module_Green__-80q-",Red:"style-module_Red__zXV4o",withMBottom:"style-module_withMBottom__8N71-"};e(".style-module_StepSuccess__Z1fJf {\n padding-top: 24px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_SuccessTitleContainer__nuvae {\n margin-bottom: 24px;\n display: flex;\n align-items: center;\n}\n.style-module_StepSuccess__Z1fJf .style-module_SuccessTitleContainer__nuvae .style-module_SuccessCircle__bU5W0 {\n color: #2DCA73;\n}\n.style-module_StepSuccess__Z1fJf .style-module_SuccessTitleContainer__nuvae .style-module_SuccessTitle__5KjBJ {\n font-size: 28px;\n font-weight: 600;\n margin-left: 16px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_SuccessSubTitle__ToDuD {\n margin: auto;\n margin-bottom: 32px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa {\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-gap: 48px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa .style-module_InfoTitle__AHygg {\n font-size: 16px;\n line-height: 24px;\n margin-bottom: 12px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa .style-module_InfoText__4oiHL {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa .style-module_InfoTextBold__LVBB6 {\n font-weight: 600;\n color: var(--checkout-primary-text-color);\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa.style-module_WithBorder__JQ5Qf {\n border-bottom: 1px solid var(--checkout-border-color);\n padding-bottom: 24px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa .style-module_CardLogoContainer__upSYf {\n display: flex;\n align-items: center;\n margin-right: 4px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa .style-module_PaymentLogoContainer__loO75 img {\n height: 20px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF {\n width: 100%;\n display: flex;\n justify-content: space-between;\n margin: auto;\n margin-top: 24px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF .style-module_HelpText__xrYQr {\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n flex-wrap: wrap;\n}\n.style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF .style-module_HelpText__xrYQr .style-module_Cta__rhsFl {\n color: var(--checkout-primary-text-color);\n margin-left: 4px;\n}\n.style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF .style-module_HelpText__xrYQr .style-module_Cta__rhsFl:hover {\n cursor: pointer;\n text-decoration: underline;\n}\n@media only screen and (max-width: 400px) {\n .style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF {\n flex-direction: column;\n }\n .style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF .style-module_HelpText__xrYQr {\n margin-bottom: 12px;\n }\n .style-module_StepSuccess__Z1fJf .style-module_Actions__RCwtF .style-module_HelpText__xrYQr .style-module_Cta__rhsFl {\n margin-left: 0;\n }\n}\n.style-module_StepSuccess__Z1fJf .style-module_OrderStatus__377-N {\n padding: 4px 8px;\n border-radius: 6px;\n margin-top: 8px;\n font-size: 14px;\n font-weight: 500;\n display: inline-flex;\n}\n.style-module_StepSuccess__Z1fJf .style-module_OrderStatus__377-N.style-module_Yellow__gF1-u {\n color: var(--checkout-warning-color);\n background-color: var(--checkout-warning-light-color);\n border: 1px solid var(--checkout-warning-color);\n}\n.style-module_StepSuccess__Z1fJf .style-module_OrderStatus__377-N.style-module_Green__-80q- {\n color: var(--checkout-success-color);\n background-color: var(--checkout-success-light-color);\n border: 1px solid var(--checkout-success-color);\n}\n.style-module_StepSuccess__Z1fJf .style-module_OrderStatus__377-N.style-module_Red__zXV4o {\n color: var(--checkout-error-color);\n background-color: var(--checkout-error-light-color);\n border: 1px solid var(--checkout-error-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_StepSuccess__Z1fJf {\n padding-left: 24px;\n padding-right: 24px;\n }\n .style-module_StepSuccess__Z1fJf .style-module_SuccessTitleContainer__nuvae {\n margin-bottom: 12px;\n }\n .style-module_StepSuccess__Z1fJf .style-module_SuccessTitleContainer__nuvae .style-module_SuccessTitle__5KjBJ {\n font-size: 20px;\n }\n .style-module_StepSuccess__Z1fJf .style-module_SuccessSubTitle__ToDuD {\n max-width: 400px;\n margin-left: 56px;\n }\n}\n@media only screen and (max-width: 400px) {\n .style-module_StepSuccess__Z1fJf .style-module_InfoGrid__XrEQa {\n grid-template-columns: 1fr;\n grid-gap: 24px;\n }\n .style-module_StepSuccess__Z1fJf .style-module_SuccessSubTitle__ToDuD {\n margin-left: 0;\n }\n}\n\n.style-module_withMBottom__8N71- {\n margin-bottom: 12px;\n}");export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__extends as e,__assign as o}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import r from"./error/index.js";import{makeObservable as i,computed as n}from"mobx";import a from"../checkout/index.js";import{Observer as d}from"mobx-react-lite";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{IkasThemeJsonPageType as s,IkasOrderLineItemStatus as m,IkasCheckoutRequirement as l,IkasThemeJsonComponentPropType as p}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{IkasCheckout as u}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as c}from"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.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/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/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{IkasOrderLineItem as f}from"../../models/data/order/line-item/index.js";import"../../models/data/order/package/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/option-set/option/index.js";import"../../models/data/product/option-set/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/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as v}from"@ikas/storefront-config";import{IkasPageDataInit as
|
|
1
|
+
import{__extends as e,__assign as o}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import r from"./error/index.js";import{makeObservable as i,computed as n}from"mobx";import a from"../checkout/index.js";import{Observer as d}from"mobx-react-lite";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{IkasThemeJsonPageType as s,IkasOrderLineItemStatus as m,IkasCheckoutRequirement as l,IkasThemeJsonComponentPropType as p}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{IkasCheckout as u}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as c}from"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.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/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/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{IkasOrderLineItem as f}from"../../models/data/order/line-item/index.js";import"../../models/data/order/package/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/option-set/option/index.js";import"../../models/data/product/option-set/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/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as v}from"@ikas/storefront-config";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{IkasBaseStore as j}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";var x=function(x){function y(e){var o=x.call(this,e)||this;return o.state={hasError:!1},o.onMouseEnter=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseOver(r.id)},o.onMouseLeave=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseLeave(r.id)},o.onClick=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onClick(r.id)},o.ref=t.createRef(),i(o,{pageComponentPropValue:n,propValues:n,isSelected:n,isHovered:n,hasNullValue:n,rendered:n,Component:n}),o}return e(y,x),y.prototype.componentDidMount=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},y.prototype.componentDidUpdate=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},y.getDerivedStateFromError=function(e){return console.error(e),{hasError:!0}},Object.defineProperty(y.prototype,"pageComponentPropValue",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.initializedPropValues.find((function(e){return e.pageComponent.id===t.id}))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"propValues",{get:function(){var e,t,r=this.props.vm,i=null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.propValues;(null===(t=r.page)||void 0===t?void 0:t.type)===s.CHECKOUT&&(i={checkout:new u({currencyCode:"TRY",currencySymbol:"₺",orderLineItems:[new f({id:"",createdAt:0,updatedAt:0,currencyCode:"TRY",currencySymbol:"₺",discount:null,discountPrice:null,finalPrice:100,options:null,originalOrderLineItemId:null,price:100,quantity:1,status:m.UNFULFILLED,statusUpdatedAt:null,stockLocationId:null,taxValue:null,unitPrice:null,finalUnitPrice:null,variant:{barcodeList:null,brand:null,categories:null,id:null,mainImageId:null,name:"",prices:null,productId:null,sku:null,slug:null,tagIds:null,taxValue:null,type:null,weight:null,variantValues:[],baseUnit:null,unit:null},orderedAt:0})]}),checkoutSettings:new c({createdAt:0,updatedAt:0,id:"",giftPackagePriceList:null,identityNumberRequirement:l.OPTIONAL,isAccountRequired:!1,isGiftPackageEnabled:!1,isQuickRegistrationEnabled:!1,isShowPostalCode:!0,isTermsAndConditionsDefaultChecked:null,options:null,phoneRequirement:l.OPTIONAL,postalCodeRequirement:l.OPTIONAL,showCheckoutNote:!0,showTermsAndConditionsCheckbox:!0,storefrontId:""}),customizationProps:o({},i),returnPolicy:"",privacyPolicy:"",termsOfService:"",imprint:"",shippingPolicy:""});return i},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isSelected",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.selectedPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isHovered",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.hoveredPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"hasNullValue",{get:function(){var e,o=this;return!!(null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.props.some((function(e){var t;if(e.isRequired){var r=(o.propValues||{})[e.name],i=null===(t=o.pageComponentPropValue)||void 0===t?void 0:t.component.props.find((function(o){return o.id===e.requiredPropId}));if(i){var n=(o.propValues||{})[i.name];if(i.type===p.BOOLEAN&&!n||i.type===p.CUSTOM&&n!==e.requiredEnumOptionValue)return!1}return null===r||null==r}})))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"rendered",{get:function(){var e,i,n=this.Component,a=this.props.vm;return this.hasNullValue||this.state.hasError?t.createElement(r,{name:null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.displayName}):t.createElement(n,o({},this.propValues,{store:j.getInstance(),settings:null===(i=a.theme)||void 0===i?void 0:i.settings,pageSpecificData:g.pageSpecificData}))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"Component",{get:function(){var e,o=this.props,t=o.vm,r=o.pageComponent,i=v.getCurrentPageComponents();if(!i)return null;var n=i[r.componentId];return(null===(e=t.page)||void 0===e?void 0:e.type)===s.CHECKOUT&&(n=a),n},enumerable:!1,configurable:!0}),y.prototype.render=function(){var e=this;return t.createElement(d,null,(function(){var o;return e.state.hasError?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onClick:e.onClick},t.createElement(r,{name:null===(o=e.pageComponentPropValue)||void 0===o?void 0:o.component.displayName}),";"):v.getCurrentPageComponents()?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},e.rendered):(console.error("Components for the page not found."),null)}))},y}(t.Component);export{x as ThemeEditorComponent};
|
|
@@ -7,6 +7,7 @@ export declare class IkasCheckoutSettings extends IkasBaseModel implements IChec
|
|
|
7
7
|
identityNumberRequirement: IkasCheckoutRequirement;
|
|
8
8
|
isAccountRequired: boolean;
|
|
9
9
|
isGiftPackageEnabled: boolean | null;
|
|
10
|
+
isQuickRegistrationEnabled: boolean | null;
|
|
10
11
|
isShowPostalCode: boolean | null;
|
|
11
12
|
isTermsAndConditionsDefaultChecked: boolean | null;
|
|
12
13
|
options: IkasCheckoutOption[] | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';export{IkasCheckoutRequirement}from"@ikas/storefront-models";import{IkasBaseModel as
|
|
1
|
+
import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';export{IkasCheckoutRequirement}from"@ikas/storefront-models";import{IkasBaseModel as i}from"../base/index.js";import{IkasCheckoutOption as o}from"./option/index.js";import{IkasCheckoutSettingsPrice as t}from"./price/index.js";var n=function(i){function n(e){var n,s,r=this;return(r=i.call(this,e)||this).giftPackagePriceList=null,r.isGiftPackageEnabled=null,r.isShowPostalCode=null,r.isTermsAndConditionsDefaultChecked=null,r.options=null,r.postalCodeRequirement=null,r.showCheckoutNote=null,r.giftPackagePriceList=(null===(n=e.giftPackagePriceList)||void 0===n?void 0:n.map((function(e){return new t(e)})))||null,r.identityNumberRequirement=e.identityNumberRequirement,r.isAccountRequired=e.isAccountRequired,r.isGiftPackageEnabled=e.isGiftPackageEnabled,r.isQuickRegistrationEnabled=e.isQuickRegistrationEnabled,r.isShowPostalCode=e.isShowPostalCode,r.isTermsAndConditionsDefaultChecked=e.isTermsAndConditionsDefaultChecked,r.options=(null===(s=e.options)||void 0===s?void 0:s.map((function(e){return new o(e)})))||null,r.phoneRequirement=e.phoneRequirement,r.postalCodeRequirement=e.postalCodeRequirement||null,r.showCheckoutNote=e.showCheckoutNote||null,r.showTermsAndConditionsCheckbox=e.showTermsAndConditionsCheckbox,r.storefrontId=e.storefrontId,r}return e(n,i),n}(i);export{n as IkasCheckoutSettings};
|