@ikas/storefront 5.0.12 → 5.0.14
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/analytics.d.ts +2 -1
- package/build/analytics/analytics.js +1 -1
- package/build/analytics/events.d.ts +2 -1
- package/build/analytics/events.js +1 -1
- package/build/analytics/googleAnalytics.js +1 -1
- package/build/analytics/googleTagManager.js +1 -1
- package/build/analytics/ikas.d.ts +3 -1
- package/build/analytics/ikas.js +1 -1
- package/build/components/checkout/components/address-form/model.js +1 -1
- package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
- package/build/components/checkout/components/customer-addresses/model.js +1 -1
- package/build/components/checkout/components/error/argument-validation-error/index.d.ts +8 -0
- package/build/components/checkout/components/error/argument-validation-error/index.js +1 -0
- package/build/components/checkout/components/error/index.js +1 -1
- package/build/components/checkout/components/master-pass/credit-card-form/index.js +1 -1
- package/build/components/checkout/components/master-pass/modal-otp/index.js +1 -1
- package/build/components/checkout/components/offer-product/index.js +1 -1
- package/build/components/checkout/components/quick-registration/model.js +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +3 -2
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/modelMasterPass.js +1 -1
- package/build/components/checkout/steps/step-payment/billing-address/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/components/page/head.js +1 -1
- package/build/components/page/index.js +1 -1
- package/build/components/page-editor/ThemeComponentEditor.js +1 -1
- package/build/components/page-editor/model.js +1 -1
- package/build/components/popup/index.d.ts +2 -0
- package/build/components/popup/index.js +1 -0
- package/build/components/popup/renderer/index.d.ts +8 -0
- package/build/components/popup/renderer/index.js +1 -0
- package/build/components/popup/renderer/model.d.ts +21 -0
- package/build/components/popup/renderer/model.js +1 -0
- package/build/components/popup/utils/index.d.ts +8 -0
- package/build/components/popup/utils/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/ext/tslib/tslib.es6.mjs.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/assets/left-arrow.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/assets/right-arrow.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/assets/x-close.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/button-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/divider-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/date-item-view/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/gender-item-view/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-column-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/product-list-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/social-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/space-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/text-element-renderer/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/helpers/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-birthday/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-email/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-name/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-phone/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-surname/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/form-settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/window-settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js +1 -0
- package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-time/index.js +1 -0
- package/build/ext/mobx-react/dist/mobxreact.esm.js +1 -0
- package/build/ext/swiper/modules/navigation.mjs.js +1 -0
- package/build/ext/swiper/modules/scrollbar.mjs.js +1 -0
- package/build/ext/swiper/shared/classes-to-selector.mjs.js +1 -0
- package/build/ext/swiper/shared/create-element-if-not-defined.mjs.js +1 -0
- package/build/ext/swiper/shared/ssr-window.esm.mjs.js +1 -0
- package/build/ext/swiper/shared/swiper-core.mjs.js +1 -0
- package/build/ext/swiper/shared/update-on-virtual-data.mjs.js +1 -0
- package/build/ext/swiper/shared/update-swiper.mjs.js +1 -0
- package/build/ext/swiper/shared/utils.mjs.js +1 -0
- package/build/ext/swiper/swiper-react.mjs.js +1 -0
- package/build/hooks/useCustomerReviews.js +1 -1
- package/build/hooks/useStore.js +1 -1
- package/build/index.js +1 -1
- package/build/models/data/checkout-settings/index.d.ts +2 -1
- package/build/models/data/checkout-settings/index.js +1 -1
- package/build/models/data/customer/index.d.ts +8 -1
- package/build/models/data/customer/index.js +1 -1
- package/build/models/data/customer-form-data-input/customer-register-subscription-input/index.d.ts +7 -0
- package/build/models/data/customer-form-data-input/customer-register-subscription-input/index.js +1 -0
- package/build/models/data/customer-form-data-input/index.d.ts +19 -0
- package/build/models/data/customer-form-data-input/index.js +1 -0
- package/build/models/data/index.d.ts +9 -0
- package/build/models/data/product/campaign/data/index.d.ts +2 -0
- package/build/models/data/product/campaign/data/index.js +1 -1
- package/build/models/data/product/campaign/product-tiered-discount/index.d.ts +20 -0
- package/build/models/data/product/campaign/product-tiered-discount/index.js +1 -0
- package/build/models/data/product/index.d.ts +36 -1
- package/build/models/data/product/index.js +1 -1
- package/build/models/data/storefront-popup/index.d.ts +40 -0
- package/build/models/data/storefront-popup/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-analytics/index.d.ts +7 -0
- package/build/models/data/storefront-popup/storefront-popup-analytics/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-date-filter/index.d.ts +6 -0
- package/build/models/data/storefront-popup/storefront-popup-date-filter/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-display-filter/index.d.ts +11 -0
- package/build/models/data/storefront-popup/storefront-popup-display-filter/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-display-settings/index.d.ts +16 -0
- package/build/models/data/storefront-popup/storefront-popup-display-settings/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-page-filter/index.d.ts +16 -0
- package/build/models/data/storefront-popup/storefront-popup-page-filter/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-page-filter/storefront-popup-page-filter-data/index.d.ts +12 -0
- package/build/models/data/storefront-popup/storefront-popup-page-filter/storefront-popup-page-filter-data/index.js +1 -0
- package/build/models/data/storefront-popup/storefront-popup-routing/index.d.ts +6 -0
- package/build/models/data/storefront-popup/storefront-popup-routing/index.js +1 -0
- package/build/models/ui/blog-category-list/index.js +1 -1
- package/build/models/ui/brand-list/index.js +1 -1
- package/build/models/ui/category-list/index.js +1 -1
- package/build/models/ui/customer-review-list/index.d.ts +3 -0
- package/build/models/ui/customer-review-list/index.js +1 -1
- package/build/models/ui/customer-review-summary-list/index.js +1 -1
- package/build/models/ui/product-list/index.js +1 -1
- package/build/models/ui/raffle-list/index.js +1 -1
- package/build/models/ui/validator/form/account-info.js +1 -1
- package/build/models/ui/validator/form/address.js +1 -1
- package/build/models/ui/validator/form/ikas-address.js +1 -1
- package/build/models/ui/validator/form/register.js +1 -1
- package/build/page-data-init/index.js +1 -1
- package/build/pages/checkout.js +1 -1
- package/build/pages/pages/_slug_.js +1 -1
- package/build/store/blog/index.js +1 -1
- package/build/store/brand/index.js +1 -1
- package/build/store/cart/index.js +1 -1
- package/build/store/category/index.js +1 -1
- package/build/store/checkout/index.js +1 -1
- package/build/store/customer/api.d.ts +2 -1
- package/build/store/customer/api.js +1 -1
- package/build/store/customer/index.d.ts +2 -0
- package/build/store/customer/index.js +1 -1
- package/build/store/html-meta-data/index.js +1 -1
- package/build/store/location/index.js +1 -1
- package/build/store/product/index.js +1 -1
- package/build/store/storefront-popup/index.d.ts +74 -0
- package/build/store/storefront-popup/index.js +1 -0
- package/package.json +18 -12
- package/build/components/checkout/components/epaykolay-button/index.d.ts +0 -5
- package/build/components/checkout/components/epaykolay-button/index.js +0 -1
- package/build/components/checkout/components/epaykolay-button/style.module.scss.js +0 -1
- package/build/components/checkout/components/svg/epaykolay.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as r from"react";import{observer as e}from"mobx-react-lite";import{ErrorType as o}from"../../model.js";import{UnknownError as t}from"./unknown-error/index.js";import{PaymentError as n}from"./payment-error/index.js";import{NoShippingError as a}from"./no-shipping-error/index.js";import{CustomerLoginRequiredError as l}from"./customer-login-required-error/index.js";import{CustomerAccountDisabledError as m}from"./customer-account-disabled-error/index.js";import{ArgumentValidationError as i}from"./argument-validation-error/index.js";var s=e((function(e){var s,c=e.vm,R=r.useRef(null),u=r.useCallback((function(){c.error=void 0}),[c]),E=null;switch(null===(s=c.error)||void 0===s?void 0:s.type){case o.PAYMENT_ERROR:E=r.createElement(n,{error:c.error,onClose:u});break;case o.NO_SHIPPING_ERROR:E=r.createElement(a,null);break;case o.CUSTOMER_LOGIN_REQUIRED_ERROR:E=r.createElement(l,{vm:c,onClose:u});break;case o.CUSTOMER_ACCOUNT_DISABLED_ERROR:E=r.createElement(m,{vm:c,onClose:u});break;case o.ARGUMENT_VALIDATION_ERROR:E=r.createElement(i,{error:c.error,onClose:u});break;case o.API_ERROR:case o.UNKNOWN:E=r.createElement(t,{error:c.error,onClose:u});break;default:E=null}return E?(R.current&&R.current.scrollIntoView(),r.createElement("div",{ref:R,style:{marginBottom:"24px"}},E)):null}));export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{observer as a}from"mobx-react-lite";import
|
|
1
|
+
import e from"react";import{observer as a}from"mobx-react-lite";import r from"../svg/master-pass-by-master-card.js";import t from"../../../style.module.scss.js";import s from"./style.module.scss.js";import{createTranslationInputData as o,useTranslation as n}from"../../../../../utils/i18n.js";import{IkasStorefrontConfig as m}from"@ikas/storefront-config";import{Button as i}from"../../button/index.js";import{Checkbox as c}from"../../checkbox/index.js";import{FormItem as d}from"../../form-item/index.js";import{FormItemType as l}from"../../form-item/model.js";var u=a((function(a){var u=a.vm,p=n().t,v=m.getTranslations()["checkout-page"],C=e.useMemo((function(){var e,a;return o(null===(a=null===(e=null==v?void 0:v.masterPass)||void 0===e?void 0:e.creditCardForm)||void 0===a?void 0:a.checkboxLabel)}),[v]),P=e.useMemo((function(){return e.createElement("div",{className:s.CheckboxLabel},C.map((function(a,t){var o,n,m,i;return a.isVariable?"{{ link }}"===a.value?e.createElement("a",{key:t,className:s.MasterPassInfoLink,title:null===(n=null===(o=null==v?void 0:v.masterPass)||void 0===o?void 0:o.creditCardForm)||void 0===n?void 0:n.moreInformation,target:"_blank",href:"https://www.masterpassturkiye.com/TermsAndConditions.aspx"},null===(i=null===(m=null==v?void 0:v.masterPass)||void 0===m?void 0:m.creditCardForm)||void 0===i?void 0:i.checkboxLabelLink):e.createElement("span",{key:t,className:s.Logo},e.createElement(r,null)):e.createElement(e.Fragment,{key:t},a.value)})))}),[C]),M=u.mpVM.isSaveCardToMasterPassPhoneNumberInputDisabled?u.mpVM.saveCardToMasterPassPhoneNumberDisabledInputValue({withPlus:!0,store:u.store,checkout:u.checkout}):u.mpVM.saveCardToMasterPass.phoneNumber;return e.createElement("div",null,e.createElement(c,{label:P,value:u.mpVM.saveCardToMasterPass.isCheckboxChecked,onChange:u.mpVM.onSaveCardToMasterPassCheckedChange}),u.mpVM.saveCardToMasterPass.isCheckboxChecked&&e.createElement("div",{className:s.FormWrapper},e.createElement("div",{className:t.RowPB},e.createElement(d,{name:"masterPassCardName",type:l.TEXT,label:p("checkout-page:masterPass.creditCardForm.cardName"),value:u.mpVM.saveCardToMasterPass.cardName,onChange:u.mpVM.onSaveCardToMasterPassCardNameChange})),u.mpVM.isSaveCardToMasterPassPhoneNumberInputVisible&&e.createElement("div",{className:t.RowPB},e.createElement(d,{name:"masterPassPhoneNumber",autocomplete:"tel",type:l.TEL,currentCountryCode:u.store.currentCountryCode,disabled:u.mpVM.isSaveCardToMasterPassPhoneNumberInputDisabled,label:p("checkout-page:masterPass.creditCardForm.phoneNumber"),value:M,onChange:u.mpVM.onSaveCardToMasterPassPhoneNumberChange})),e.createElement(i,{style:{width:"100%"},text:p("checkout-page:masterPass.creditCardForm.button"),isDisabled:u.mpVM.isSendConfirmationButtonDisabled,isLoading:u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending,onClick:function(){if(!u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending&&u.checkout.selectedPaymentGateway&&u.cardData&&u.cardData.cardNumber&&u.cardData.expirationDate&&u.cardData.cvv&&u.mpVM.saveCardToMasterPass.cardName){var e=u.mpVM.isSaveCardToMasterPassPhoneNumberInputDisabled?u.mpVM.saveCardToMasterPassPhoneNumberDisabledInputValue({withPlus:!1,store:u.store,checkout:u.checkout}):u.mpVM.saveCardToMasterPass.phoneNumber.replace("+","");if(e){var a,r,t,s,o={creditCard:{rtaPan:u.cardData.cardNumber.replace(/ /g,""),expiryDate:(a=u.cardData.expirationDate,r=a.replace(" / ",""),t=r.substring(0,2),s=r.substring(2,4),"".concat(s).concat(t)),cvc:u.cardData.cvv,accountAliasName:u.mpVM.saveCardToMasterPass.cardName,phoneNumber:e},store:u.store,checkout:u.checkout,paymentGateway:u.checkout.selectedPaymentGateway,callback:function(){u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending=!1}};u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending=!0,u.mpVM.onSaveCardToMasterPassSendConfirmationButtonClick(o)}}}})))}));export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useRef as t,useState as o,useEffect as a}from"react";import{observer as n}from"mobx-react-lite";import r from"../modal/index.js";import s from"./svg/master-pass.js";import c from"./style.module.scss.js";import{useTranslation as m}from"../../../../../utils/i18n.js";import{Button as l}from"../../button/index.js";import{FormItem as i}from"../../form-item/index.js";import{FormItemType as p}from"../../form-item/model.js";var u=n((function(n){var u=n.visible,d=n.type,f=n.vm,v=n.onClose,b=m().t,h=t(),k=o(180),x=k[0],
|
|
1
|
+
import e,{useRef as t,useState as o,useEffect as a}from"react";import{observer as n}from"mobx-react-lite";import r from"../modal/index.js";import s from"./svg/master-pass.js";import c from"./style.module.scss.js";import{useTranslation as m}from"../../../../../utils/i18n.js";import{Button as l}from"../../button/index.js";import{FormItem as i}from"../../form-item/index.js";import{FormItemType as p}from"../../form-item/model.js";var u=n((function(n){var u=n.visible,d=n.type,f=n.vm,v=n.onClose,b=m().t,h=t(),k=o(180),x=k[0],M=k[1],g=o(""),E=g[0],P=g[1],T=o(!1),y=T[0],C=T[1],j=o(!1),O=j[0],N=j[1],V=function(){if(!O&&E&&f.checkout.masterPassPaymentGateway){N(!0),f.mpVM.onOtpFormSubmit({validationCode:E,store:f.store,checkout:f.checkout,callback:function(){N(!1),P(""),R()}})}},R=function(){M(0)},w=function(){M(180)},I=function(){M(180)};a((function(){if(!(x<1&&h.current))return h.current&&clearInterval(h.current),h.current=setInterval((function(){M(x-1)}),1e3),function(){h.current&&clearInterval(h.current)};clearInterval(h.current)}),[x]);var L,S,B,D,F,q,A=x<=120,G=e.createElement("div",null,e.createElement("div",{className:c.Wrapper},"masterPassOtp"===d&&e.createElement("span",{"data-mr":!0,className:c.Logo},e.createElement(s,null)),e.createElement("p",{className:c.Text},b("masterPassOtp"===d?"checkout-page:masterPass.otpModal.otpTextMasterPass":"checkout-page:masterPass.otpModal.otpTextBank"))),e.createElement("div",{className:c.Countdown},b("checkout-page:masterPass.otpModal.countdownText"),e.createElement("strong",null,(L=x%3600,S=Math.floor(L/60),B=L%60,D=Math.ceil(B),F=S<10?"0".concat(S):S,q=D<10?"0".concat(D):D,"".concat(F,":").concat(q)))),f.mpVM.otpResponse.text&&e.createElement("div",{role:"error"===f.mpVM.otpResponse.status?"alert":"",className:c.OtpResponseText},f.mpVM.otpResponse.text),e.createElement("form",{onSubmit:function(e){e.preventDefault(),V()}},e.createElement(i,{required:!0,type:p.TEXT,label:b("checkout-page:masterPass.otpModal.inputLabel"),name:"one-time-code",autocomplete:"one-time-code",rightContent:f.mpVM.isOtpFormSubmitAtLeastOnce&&A?e.createElement("button",{type:"button",className:c.ResendButton,disabled:y,onClick:function(e){e.stopPropagation(),y||(C(!0),f.mpVM.resendOtp({store:f.store,checkout:f.checkout,callback:function(){C(!1),I(),P("")}}))}},b("checkout-page:masterPass.otpModal.resendText")):void 0,value:E,onChange:function(e){P(e)}}),e.createElement(l,{type:"submit",style:{width:"100%",marginTop:"16px"},text:b("checkout-page:masterPass.otpModal.buttonText"),isLoading:O,isDisabled:!E,onClick:V})));return a((function(){u?w():R()}),[u]),a((function(){w()}),[d]),e.createElement(r,{visible:u,onClose:v},G)}));export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import{CheckoutStep as n}from"../../model.js";import{Button as a}from"../button/index.js";import i from"./select/index.js";import o from"../svg/cross.js";import{useTranslation as r}from"../../../../utils/i18n.js";import c from"./style.module.scss.js";import{IkasAmountType as s}from"@ikas/storefront-models";import"@ikas/storefront-config";import{formatCurrency as l}from"../../../../utils/currency.js";var u=function(t){var a,i,o=t.seconds,s=t.onFinish,l=t.campaignOffer,u=t.vm,f=t.isPopupClosed,m=t.step,p=r().t,v=e.useState(o),g=v[0],C=v[1];e.useEffect((function(){C(o)}),[o]),e.useEffect((function(){var e=setInterval((function(){g>0?C(g-1):(clearInterval(e),s())}),1e3);return function(){return clearInterval(e)}}),[g]);var S=l.offer.countdownMinutes&&(m!==n.SUCCESS?!!(null===(a=u.customizationProps)||void 0===a?void 0:a.campaignOfferCountdownStyleIsLine):!!(null===(i=u.customizationProps)||void 0===i?void 0:i.campaignOfferCountdownStyleIsLineSuccessPage))||f;return e.createElement("div",{className:S?c.CountdownContainerIsLine:c.CountdownContainer},e.createElement("div",{className:c.CountdownTextMain},!S&&e.createElement("span",{className:c.CountdownText},p("checkout-page:timeRemaining")),e.createElement("span",{className:c.CountdownTime},d(g))))},d=function(e){var t=Math.floor(e/60/60),n=Math.floor(e/60)-60*t,a=e%60;return 0!==t?t.toString().padStart(2,"0")+":":n.toString().padStart(2,"0")+":"+a.toString().padStart(2,"0")},f=t((function(t){var d,f,m,p,v,g,C,S=t.vm,h=t.campaignOffer,E=t.index,P=t.activeIndex,O=t.offersLength,
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import{CheckoutStep as n}from"../../model.js";import{Button as a}from"../button/index.js";import i from"./select/index.js";import o from"../svg/cross.js";import{useTranslation as r}from"../../../../utils/i18n.js";import c from"./style.module.scss.js";import{IkasAmountType as s}from"@ikas/storefront-models";import"@ikas/storefront-config";import{formatCurrency as l}from"../../../../utils/currency.js";var u=function(t){var a,i,o=t.seconds,s=t.onFinish,l=t.campaignOffer,u=t.vm,f=t.isPopupClosed,m=t.step,p=r().t,v=e.useState(o),g=v[0],C=v[1];e.useEffect((function(){C(o)}),[o]),e.useEffect((function(){var e=setInterval((function(){g>0?C(g-1):(clearInterval(e),s())}),1e3);return function(){return clearInterval(e)}}),[g]);var S=l.offer.countdownMinutes&&(m!==n.SUCCESS?!!(null===(a=u.customizationProps)||void 0===a?void 0:a.campaignOfferCountdownStyleIsLine):!!(null===(i=u.customizationProps)||void 0===i?void 0:i.campaignOfferCountdownStyleIsLineSuccessPage))||f;return e.createElement("div",{className:S?c.CountdownContainerIsLine:c.CountdownContainer},e.createElement("div",{className:c.CountdownTextMain},!S&&e.createElement("span",{className:c.CountdownText},p("checkout-page:timeRemaining")),e.createElement("span",{className:c.CountdownTime},d(g))))},d=function(e){var t=Math.floor(e/60/60),n=Math.floor(e/60)-60*t,a=e%60;return 0!==t?t.toString().padStart(2,"0")+":":n.toString().padStart(2,"0")+":"+a.toString().padStart(2,"0")},f=t((function(t){var d,f,m,p,v,g,C,S=t.vm,h=t.campaignOffer,E=t.index,P=t.activeIndex,O=t.offersLength,V=t.handleNext,I=t.handlePrev,w=t.setActiveIndex,N=t.isPopupShow,y=t.closePopup,M=t.showPopup,j=t.isPopupClosed,B=t.desktopMiddlePhase,k=t.step,T=r().t,A=h.product,x=k!==n.SUCCESS?!!(null===(d=S.customizationProps)||void 0===d?void 0:d.campaignOfferIsSmallDesign)&&N:!!(null===(f=S.customizationProps)||void 0===f?void 0:f.showCampaignIsBiggerImage)&&k===n.SUCCESS,D=e.useRef(null),L=e.useRef(null),z=e.useRef(null),R=e.useState(0),b=R[0],U=R[1];e.useEffect((function(){var e,t,a,i,o,r,c,s;if(void 0!==typeof window){var l=.8*window.innerHeight,u=0,d=0,f=0;D.current&&(u=null===(t=null===(e=D.current)||void 0===e?void 0:e.getBoundingClientRect())||void 0===t?void 0:t.height),L.current&&(d=null===(i=null===(a=L.current)||void 0===a?void 0:a.getBoundingClientRect())||void 0===i?void 0:i.height),z.current&&(f=null===(r=null===(o=z.current)||void 0===o?void 0:o.getBoundingClientRect())||void 0===r?void 0:r.height);var m=(k===n.SUCCESS?null===(c=S.customizationProps)||void 0===c?void 0:c.campaignOfferCountdownStyleIsLineSuccessPage:null===(s=S.customizationProps)||void 0===s?void 0:s.campaignOfferCountdownStyleIsLine)?25:70,p=navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)?20:0;U(l-u-d-f-p-m)}}),[N]);var F=e.useState(null),H=F[0],X=F[1],q=e.useState(null),G=q[0],J=q[1],K=e.useMemo((function(){var e,t,n,a,i,o,r,c=null===(e=A.selectedVariant.images)||void 0===e?void 0:e.filter((function(e){return!e.isVideo}));return(null===(t=A.selectedVariant.mainImage)||void 0===t?void 0:t.isVideo)&&(null==c?void 0:c.length)?null===(n=c[0].image)||void 0===n?void 0:n.thumbnailSrc:x||B?null===(i=null===(a=A.selectedVariant.mainImage)||void 0===a?void 0:a.image)||void 0===i?void 0:i.getSrc(360):null===(r=null===(o=A.selectedVariant.mainImage)||void 0===o?void 0:o.image)||void 0===r?void 0:r.thumbnailSrc}),[A.selectedVariant,x,B]),Q=e.useMemo((function(){if(!h.offer.countdownMinutes||!h.campaignOffer.offerStartDate)return 0;var e=Math.round(((new Date).getTime()-new Date(h.campaignOffer.offerStartDate).getTime())/1e3);return e>60*h.offer.countdownMinutes?0:60*h.offer.countdownMinutes-e}),[h]),W=function(e){w(0),S.updateCartCampaignOffer({accepted:e,cartId:S.checkout.id,campaignOfferId:h.campaignOffer.campaignOfferId,campaignOfferProductId:h.offer.id,productId:h.offer.productId,variantId:A.selectedVariant.id})},Y=function(){W(!0)},Z=function(){W(!1)},$=function(e,t){var n=null;A.displayedVariantTypes.forEach((function(t){t.displayedVariantValues.forEach((function(t){t.variant.id===e&&(n=t.variantValue)}))}));var a=A.variants.find((function(t){return t.id===e})),i=!!a&&!!a.variantValues&&!!a.variantValues.length&&a.variantValues[t];i&&A.selectVariantValue(i,!0),A.displayedVariantTypes.forEach((function(t){t.displayedVariantValues.forEach((function(t){t.variant.id===e&&(n=t.variantValue)}))})),n?A.selectVariantValue(n,!0):$(e,t+1)},_=h.offer.countdownMinutes&&(k!==n.SUCCESS?!!(null===(m=S.customizationProps)||void 0===m?void 0:m.campaignOfferCountdownStyleIsLine):!!(null===(p=S.customizationProps)||void 0===p?void 0:p.campaignOfferCountdownStyleIsLineSuccessPage))||j&&h.offer.countdownMinutes;return e.createElement("div",{style:{transform:"translateX(-".concat(100*P,"%)")},className:[c.Container,E===P?c.ActiveOffer:"",N?c.PopupContainer:"",B?c.PopupContainerDesktop:"",k===n.SUCCESS?c.Border:""].join(" ")},h.offer.countdownMinutes&&(k!==n.SUCCESS?!(null===(v=S.customizationProps)||void 0===v?void 0:v.campaignOfferCountdownStyleIsLine):!(null===(g=S.customizationProps)||void 0===g?void 0:g.campaignOfferCountdownStyleIsLineSuccessPage))&&!j&&e.createElement(u,{seconds:Q,onFinish:Z,vm:S,campaignOffer:h,step:k}),e.createElement("div",{onTouchStart:function(e){J(null),X(e.targetTouches[0].clientX)},onTouchMove:function(e){return J(e.targetTouches[0].clientX)},onTouchEnd:function(){if(H&&G&&O>1){var e=H-G,t=e>50;(t||e<-50)&&(t?V():I())}},className:[c.ContentContainer,O>1?c.ContentContainerItems:"",j?O>1?c.ContentContainerPopup:c.ContentContainerPopupItems:""].join(" ")},!!N&&e.createElement("div",{className:c.RejectButton,onClick:function(){return y&&y()}},e.createElement(o,null)),e.createElement("div",{ref:D,className:[c.HeaderMain,x&&!j?c.IsBigProductImage:"",_?c.IsLineCountDown:"",j?c.MobileSmallHeader:""].join(" ")},e.createElement("div",{className:c.Header},e.createElement("div",{className:c.Title},h.offer.title),!!h.offer.description&&!j&&e.createElement("div",{className:c.Description},h.offer.description)),_&&e.createElement(u,{seconds:Q,onFinish:Z,vm:S,campaignOffer:h,isPopupClosed:j,step:k})),e.createElement("div",{className:[c.ProductContainer,x&&!j?c.IsLineProductContainer:""].join(" ")},e.createElement("div",{style:N?{width:b,height:b}:{},className:[c.ImageContainer,x&&!j?c.BigImage:"",j?c.SmallImage:"",B?c.BiggerImage:""].join(" ")},e.createElement("img",{className:c.Image,src:K})),e.createElement("div",{ref:L,className:c.ProductDetails},e.createElement("div",{className:c.ProductName},A.name),A.hasVariant&&1===A.variants.length&&e.createElement("div",{className:c.VariantName},A.selectedVariant.variantValues.map((function(e){return e.name})).join(", ")),!(null===(C=S.customizationProps)||void 0===C?void 0:C.showCampaignHideDiscountBadge)&&A.selectedVariant.hasDiscount&&e.createElement("span",{className:c.DiscountBadge},h.offer.discountType===s.RATIO?"%".concat(A.selectedVariant.discountPercentage):l(h.offer.discountAmount||0,A.selectedVariant.price.currency||"",A.selectedVariant.price.currencySymbol||"")," ",T("checkout-page:discount")),e.createElement("div",{className:c.ProductPriceMain},A.selectedVariant.hasDiscount&&e.createElement("span",{className:c.Discount},A.selectedVariant.formattedSellPrice," "),e.createElement("span",{className:c.ProductPrice},h.offer.discountType===s.AMOUNT?l(A.selectedVariant.price.sellPrice-(h.offer.discountAmount||0),A.selectedVariant.price.currency||"",A.selectedVariant.price.currencySymbol||""):A.selectedVariant.formattedFinalPrice)),!j&&A.variants.length>1&&e.createElement("div",{className:c.Actions},A.variants.length>1&&e.createElement(i,{value:A.selectedVariant.id,onSelectChange:function(e){$(e,0)},options:A.variants.map((function(e){return{label:e.variantValues.map((function(e){return e.name})).join(", "),value:e.id}}))})),!!j&&e.createElement(a,{classes:[c.OfferButton,x?c.OfferAcceptButton:"",c.PopupOfferButton].join(" "),text:T("checkout-page:actions.acceptOffer"),onClick:function(){A.hasVariant?M&&M():Y()}}),!!B&&e.createElement("div",{className:[c.OfferActionsMain,x?c.OfferActionsMainBigImage:"",c.OfferActionsMainMiddlePhase].join(" ")},e.createElement(a,{classes:c.OfferButton,isLine:!0,text:T("checkout-page:actions.rejectOffer"),onClick:Z}),e.createElement(a,{classes:[c.OfferButton,x?c.OfferAcceptButton:""].join(" "),text:e.createElement("div",null,e.createElement("span",null,T("checkout-page:actions.acceptOffer")),e.createElement("span",null),e.createElement("span",null,A.selectedVariant.price.formattedFinalPrice)),onClick:Y})))),!(j||B)&&e.createElement("div",{ref:z,className:[c.OfferActionsMain,x?c.OfferActionsMainBigImage:""].join(" ")},e.createElement(a,{classes:c.OfferButton,isLine:!0,text:T("checkout-page:actions.rejectOffer"),onClick:Z}),e.createElement(a,{classes:[c.OfferButton,x?c.OfferAcceptButton:""].join(" "),text:T("checkout-page:actions.acceptOffer"),onClick:Y}))))}));export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as o,observable as i}from"mobx";import"../../../../models/data/blog/category/index.js";import"../../../../models/data/blog/content/index.js";import"../../../../models/data/blog/meta-data/index.js";import"../../../../models/data/blog/tag/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"@ikas/storefront-models";import"../../../../models/data/campaign-offer/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/path-item/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/checkout-settings/index.js";import"../../../../models/data/city/index.js";import"../../../../models/data/country/index.js";import"../../../../models/data/customer/address/region/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../models/data/customer/attribute/index.js";import"../../../../models/data/customer/review/summary/index.js";import"../../../../models/data/customer/review/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/district/index.js";import"../../../../models/data/favorite-product/index.js";import"../../../../models/data/filter-category/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/order/address/region/index.js";import"../../../../models/data/order/address/index.js";import"../../../../models/data/order/line-item/option/value/index.js";import"../../../../models/data/order/line-item/variant/value/index.js";import"../../../../models/data/order/line-item/variant/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/transaction/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/campaign-offer/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/stock-location/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/component/index.js";import"../../../../models/data/theme-json/custom-data/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../../../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{Validator as
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as o,observable as i}from"mobx";import"../../../../models/data/blog/category/index.js";import"../../../../models/data/blog/content/index.js";import"../../../../models/data/blog/meta-data/index.js";import"../../../../models/data/blog/tag/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"@ikas/storefront-models";import"../../../../models/data/campaign-offer/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/path-item/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/checkout-settings/index.js";import"../../../../models/data/city/index.js";import"../../../../models/data/country/index.js";import"../../../../models/data/customer/address/region/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../models/data/customer/attribute/index.js";import"../../../../models/data/customer/review/summary/index.js";import"../../../../models/data/customer/review/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/customer-form-data-input/index.js";import"../../../../models/data/district/index.js";import"../../../../models/data/favorite-product/index.js";import"../../../../models/data/filter-category/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/order/address/region/index.js";import"../../../../models/data/order/address/index.js";import"../../../../models/data/order/line-item/option/value/index.js";import"../../../../models/data/order/line-item/variant/value/index.js";import"../../../../models/data/order/line-item/variant/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/transaction/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/campaign-offer/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/stock-location/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../models/data/storefront-popup/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/component/index.js";import"../../../../models/data/theme-json/custom-data/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../../../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{Validator as r}from"../../../../models/ui/validator/index.js";import{RequiredRule as s,MinRule as d}from"../../../../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/ikas-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";var a=function(){function a(a,m){var n=this;this.model={password:""},this._isLoading=!1,this._isRegisteredCustomer=!1,this.onPasswordChange=function(e){n.model.password=e},this.validateAll=function(){return n.validator.validateAll()},this.onSubmit=function(){return e(n,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,this.validateAll()];case 1:return t.sent()?[3,3]:(this._isLoading=!0,[4,this.vm.registerCustomer(this.password)]);case 2:(null==(e=t.sent())?void 0:e.isSuccess)&&(this._isRegisteredCustomer=!0),this._isLoading=!1,t.label=3;case 3:return[2]}}))}))},o(this,{model:i}),this.vm=a,this.t=m,this.validator=new r(this.model,[new s({fieldKey:"password",valuePath:"password",message:m("checkout-page:passwordRequiredError")}),new d({fieldKey:"password",valuePath:"password",minValue:6,message:m("checkout-page:passwordMinError",{value:6})})])}return Object.defineProperty(a.prototype,"password",{get:function(){return this.model.password},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isRegisteredCustomer",{get:function(){return this._isRegisteredCustomer},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),a}();export{a as QuickRegistrationViewModel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as n}from"mobx-react-lite";import{useRouter as i}from"next/router.js";import r from"next/link.js";import a from"react-tooltip";import s,{CheckoutStep as c}from"./model.js";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import u from"./steps/step-info/index.js";import{CheckoutStepShipping as p}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CouponErrorCode as f,Coupon as g,CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as E}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/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../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/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as y}from"../../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{StepSuccess as x}from"./steps/step-success/index.js";import{Modal as k}from"./components/modal/index.js";import C from"./components/master-pass/modal-otp/index.js";import j from"./components/master-pass/modal-response/index.js";import P from"./components/master-pass/modal-success/index.js";import{Image as N}from"../image/index.js";import b,{Step as S}from"./components/step-container/index.js";import{StockError as O}from"./components/error/stock-error/index.js";import{FullscreenLoading as F}from"./components/fullscreen-loading/index.js";import M from"./components/notification-box/index.js";import{FormItem as T}from"./components/form-item/index.js";import{FormItemType as w}from"./components/form-item/model.js";import{Button as I}from"./components/button/index.js";import{IkasPageHead as A}from"../page/head.js";import B from"./components/offer-product/index.js";import L from"./components/offer-product/placeholder-offer-product.js";import D from"./components/svg/ikas.js";import U from"./style.module.scss.js";import{Analytics as V}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import R from"./components/epaykolay-button/index.js";import _ from"./components/svg/success-circle.js";import z from"./components/offer-product/offer-dots/index.js";import H from"./components/offer-product/offer-arrows/index.js";import K from"./components/offer-product/useCampaignOffer.js";var G=n((function(n){var r,m,u,p,v,f,g,y=n.checkout,b=n.checkoutSettings,S=n.customizationProps,M=n.returnPolicy,T=n.privacyPolicy,w=n.termsOfService,G=n.imprint,q=n.shippingPolicy,J=d().t,$=i(),ee=o.useState((function(){return new s(y,b,$,M,T,w,G,q,J,S||{})}))[0],te=K(ee),oe=te.setShowDetailPage,ne=te.setActiveIndex,ie=te.setIsActiveOverlay,re=te.handlePrev,ae=te.handleNext,se=te.isPopupClosedIndexPage,ce=te.isPopupShowIndexPage,le=te.isShowSuccessPageMiddlePhase,me=te.activeIndex,de=o.useMemo((function(){return Date.now()}),[]);ee.step,c.PAYMENT;var ue=function(o,n,i,r,a){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/get-basket"),[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()},body:JSON.stringify({cartId:ee.checkout.id,customerNumber:o,sessionsState:de,addressDto:i,paymentType:r,totalPrice:a})})];case 1:return[2,t.sent().json()]}}))}))};o.useEffect((function(){ee.checkoutSettings.isAccountRequired&&!ee.checkout.hasCustomer&&$.push("/account/login?redirect="+encodeURIComponent(ee.checkoutUrl)),V.beginCheckout(ee.checkout),V.pageView(E.CHECKOUT)}),[]),o.useEffect((function(){ee.customizationProps=S,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==e?void 0:e.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==e?void 0:e.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==e?void 0:e.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==e?void 0:e.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==e?void 0:e.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==e?void 0:e.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==e?void 0:e.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==e?void 0:e.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==e?void 0:e.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==e?void 0:e.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==e?void 0:e.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(S)}),[S]),o.useEffect((function(){if(ee.isEPayKolayEnabled)var o=setInterval((function(){var n,i;window.setContainerService&&ee.isCheckoutLoaded&&(window.setContainerService(null===(n=l.getMerchantSettings())||void 0===n?void 0:n.merchantId,ue,(function(o){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,pe(o)];case 1:return[2,e.sent()]}}))}))}),(function(){console.log("Switching to epaykolay"),ee.isEPayKolayPayment=!0}),"https://cdn-epeykolay.mncdn.com/".concat((null===(i=l.getApiUrl())||void 0===i?void 0:i.includes("myikas.com"))?"epay":"epay-uat","/")),clearInterval(o))}),100)}),[]);var pe=o.useCallback((function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,fetch("".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/complete-payment"),{method:"POST",body:JSON.stringify({data:o,cartId:ee.checkout.id}),headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()}})];case 1:return[4,t.sent().json()];case 2:return e=t.sent(),[2,{redirectUrl:"".concat(window.location.pathname,"?id=").concat(ee.checkout.id,"&step=").concat(e.success?"success":"info"),orderId:e.orderNumber||null}]}}))}))}),[]);if(!ee.isCheckoutLoaded||!ee.store.customerStore.initialized)return o.createElement(F,null);if(ee.checkout.hasCustomer&&(null===(r=ee.store.customerStore.customer)||void 0===r?void 0:r.id)!==(null===(m=ee.checkout.customer)||void 0===m?void 0:m.id))return $.push("/account/login?redirect="+encodeURIComponent(ee.checkoutUrl)),null;return o.createElement(o.Fragment,null,o.createElement(A,{pageType:E.CHECKOUT,pageTitle:((null===(u=ee.merchantSettings)||void 0===u?void 0:u.merchantName)||"")+" - "+J("checkout-page:securePayment"),pageDescription:J("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:U.CheckoutPage},le?o.createElement("div",{className:U.FullPageOfferMain},o.createElement("div",{className:U.FullPageOfferContainer},o.createElement("div",{className:U.LogoMain},(null===(p=ee.customizationProps)||void 0===p?void 0:p.logo)?o.createElement("div",{className:U.Logo},o.createElement(N,{layout:"fill",image:ee.customizationProps.logo,sizes:"360px"})):(null===(v=ee.merchantSettings)||void 0===v?void 0:v.logo)?o.createElement("div",{className:U.Logo},o.createElement(N,{layout:"fill",image:ee.merchantSettings.logo,sizes:"360px"})):(null===(f=ee.merchantSettings)||void 0===f?void 0:f.merchantName)||""),o.createElement("div",{className:U.OfferSuccessInfo},o.createElement("div",null,o.createElement("div",{className:U.OfferSuccessHeader},o.createElement(_,{className:U.SuccessCircle}),o.createElement("span",{className:U.SuccessTitle},J("checkout-page:orderSuccessShortTitle"))),o.createElement("div",{className:U.OfferOrderInfoMain},o.createElement("div",{className:U.InfoTitle},J("checkout-page:orderNoAndDate"),":"),o.createElement("div",{className:U.InfoText},"#"+(ee.checkout.orderNumber||"")," ",ee.checkout.dateStr))),o.createElement("div",null,o.createElement(I,{classes:U.OfferButton,isLine:!0,text:J("checkout-page:actions.goOrderDetailPage"),onClick:function(){oe(!1)}}))),o.createElement("div",null,ee.campaignOffers&&!!ee.campaignOffers.length&&ee.isCampaignOfferLoaded&&o.createElement("div",{className:U.CampaignOfferMain},o.createElement("div",{className:U.OfferSlider},ee.campaignOffers.map((function(e,t){var n;return o.createElement(B,{vm:ee,campaignOffer:e,index:t,activeIndex:me,offersLength:(null===(n=ee.campaignOffers)||void 0===n?void 0:n.length)||0,handlePrev:re,handleNext:ae,setActiveIndex:function(e){return ne(e)},desktopMiddlePhase:!0,step:ee.step})}))),ee.campaignOffers.length>1&&o.createElement(H,{handlePrev:re,handleNext:ae}),ee.campaignOffers.length>1&&o.createElement(z,{vm:ee,activeIndex:me}))))):null,o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:U.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[U.Left,ee.isEPayKolayPayment?U.epaykolay:""].join(" ")},ee.isEPayKolayEnabled&&o.createElement("div",{id:"plateau_ui_placeholder",style:{width:"100%"}}),!ee.isEPayKolayPayment&&o.createElement("div",{className:U.LeftContent},o.createElement("div",null,o.createElement(Y,{vm:ee}),ee.hasStockError&&o.createElement("div",{className:U.ErrorContainer},o.createElement(O,{vm:ee,error:ee.error})),!ee.hasStockError&&o.createElement(o.Fragment,null,ee.step!==c.SUCCESS&&o.createElement(h,{vm:ee,allowExpand:!0}),o.createElement("div",null,ee.step!==c.SUCCESS&&ee.isEPayKolayEnabled&&o.createElement(R,{onClick:function(){window.frictionless()}})),ee.step===c.SUCCESS?o.createElement(x,{vm:ee}):o.createElement(o.Fragment,null,!!(null===(g=ee.customizationProps)||void 0===g?void 0:g.showCampaignOffersDesign)&&l.getIsEditor()&&o.createElement(L,{vm:ee}),ce&&o.createElement("div",{className:[U.MiddlePhaseOverlay,ce?U.MiddlePhaseOverlayPopup:""].join(" ")}),ee.campaignOffers&&!!ee.campaignOffers.length&&ee.isCampaignOfferLoaded&&o.createElement("div",{className:[U.CampaignOfferMain,ce?U.OverlayPopupMain:""].join(" ")},o.createElement("div",{className:U.OfferSlider},ee.campaignOffers.map((function(e,t){var n;return o.createElement(B,{vm:ee,campaignOffer:e,index:t,activeIndex:me,offersLength:(null===(n=ee.campaignOffers)||void 0===n?void 0:n.length)||0,handlePrev:re,handleNext:ae,setActiveIndex:function(e){return ne(e)},step:ee.step,isPopupClosed:se,isPopupShow:ce,closePopup:function(){return ie(!1)},showPopup:function(){return ie(!0)}})}))),ee.campaignOffers.length>1&&o.createElement(H,{handlePrev:re,handleNext:ae}),ee.campaignOffers.length>1&&o.createElement(z,{isPopupShow:ce,vm:ee,activeIndex:me})),ee.isCouponCodeRequirementOpen&&o.createElement(W,{vm:ee}),o.createElement(X,{vm:ee}))),o.createElement("div",{className:U.Space})),o.createElement(Q,{vm:ee}))),o.createElement("div",{className:U.Right},o.createElement("div",{className:U.RightContent},o.createElement(h,{vm:ee}),!ee.isPoweredByHidden&&o.createElement("div",{className:U.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===l.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(D,null))))),!!ee.policyModalText&&o.createElement(k,{title:ee.policyModalTitle,modalContent:ee.policyModalText,onClose:function(){ee.policyModalText=""}}),ee.isContactModalVisible&&o.createElement(Z,{vm:ee,setVisible:ee.setContactModalVisible}),ee.mpVM.isOtpModalVisible&&o.createElement(C,{vm:ee,visible:ee.mpVM.isOtpModalVisible,type:ee.mpVM.otpModalType,onClose:ee.mpVM.hideOtpModal}),ee.mpVM.isResponseModalVisible&&o.createElement(j,{visible:ee.mpVM.isResponseModalVisible,text:ee.mpVM.mfsResponseModalText,onClose:ee.mpVM.onResponseModalClose}),ee.mpVM.isSuccessModalVisible&&o.createElement(P,{visible:ee.mpVM.isSuccessModalVisible,type:ee.mpVM.successModalType,onClose:ee.mpVM.onSuccessModalClose})))})),Y=n((function(e){var t,n,i,a,s=e.vm,c=d().t;return o.createElement("div",{className:U.Header},o.createElement(r,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=s.customizationProps)||void 0===t?void 0:t.logo)?o.createElement("div",{className:U.Logo},o.createElement(N,{layout:"fill",image:s.customizationProps.logo,sizes:"360px"})):(null===(n=s.merchantSettings)||void 0===n?void 0:n.logo)?o.createElement("div",{className:U.Logo},o.createElement(N,{layout:"fill",image:s.merchantSettings.logo,sizes:"360px"})):(null===(i=s.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!s.checkout.hasCustomer&&o.createElement("div",{className:U.LoginText},o.createElement("span",{className:U.LoginCta},c("checkout-page:alreadyHaveAnAccount")),o.createElement(r,{href:"/account/login?redirect="+encodeURIComponent(s.checkoutUrl),passHref:!0},o.createElement("a",{className:U.LoginBtn},c("checkout-page:actions.login")))),s.checkout.hasCustomer&&o.createElement("div",{className:U.CustomerInfo},o.createElement("div",{className:U.Name},s.checkout.customerFullName),o.createElement("div",{className:U.Email},null===(a=s.checkout.customer)||void 0===a?void 0:a.email)))})),W=n((function(e){var t=e.vm,n=d().t,i=o.useState(!1),r=i[0],a=i[1],s=o.useState(null),c=s[0],l=s[1],m=o.useMemo((function(){switch(c){case f.COUPON_CODE_NOT_EXIST:return n("checkout-page:giftCodeErrorDescription");case f.COUPON_CODE_NOT_EXIST_FOR_GUESS:return n("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[c]);return o.createElement("div",{className:U.CouponContainer},r&&o.createElement("div",{className:U.NotificationContainer},o.createElement(M,{type:"warning",title:n("checkout-page:giftCodeErrorTitle"),content:m,onClose:function(){a(!1),l(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:r?12:0}},o.createElement(g,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:a,setCouponErrorCode:l})))})),X=n((function(e){var t=e.vm,n=d().t,i=o.useMemo((function(){switch(t.step){case c.INFO:return o.createElement(u,{vm:t});case c.SHIPPING:return o.createElement(p,{vm:t});case c.PAYMENT:return o.createElement(v,{vm:t});case c.SUCCESS:return o.createElement(x,{vm:t})}}),[t,t.step]),r=[new S(n("checkout-page:address"),t.step===c.INFO,t.step!==c.INFO,t.step!==c.INFO?o.createElement("div",{className:U.AdressStepInfo},o.createElement(q,{vm:t}),!t.isUpsellOrder&&o.createElement("div",{className:U.EditBtn,onClick:t.onBackToInfoClick},n("checkout-page:actions.edit"))):void 0,t.step!==c.INFO?o.createElement("div",{className:U.AddressStepInfoMobile},o.createElement(q,{vm:t})):void 0),new S(n("checkout-page:payment"),t.step===c.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||r.splice(1,0,new S(n("checkout-page:shipping"),t.step===c.SHIPPING,t.step===c.PAYMENT,t.step===c.PAYMENT?o.createElement("div",{className:U.AdressStepInfo},o.createElement(J,{vm:t}),!t.isUpsellOrder&&!t.isManualOrderWithShippingLines&&(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:U.EditBtn,onClick:t.onBackToShippingClick},n("checkout-page:actions.edit"))):void 0,t.step===c.PAYMENT?o.createElement("div",{className:U.AddressStepInfoMobile},o.createElement(J,{vm:t})):void 0)),o.createElement(b,{steps:r,stepContent:i})})),q=n((function(e){var t,n,i,r,a,s,c,l,m,u=e.vm,p=d().t,v=u.isDigitalOnly?((null===(t=u.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(n=u.checkout.billingAddress)||void 0===n?void 0:n.lastName)||""):((null===(i=u.checkout.shippingAddress)||void 0===i?void 0:i.firstName)||"")+" "+((null===(r=u.checkout.shippingAddress)||void 0===r?void 0:r.lastName)||"");return o.createElement("div",{className:U.Address},o.createElement("div",{className:[U.Text,U.WithMBottom].join(" ")},(null===(a=u.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===u.deliveryMethod?o.createElement("div",{className:U.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:U.Text},p("checkout-page:receiver")),o.createElement("div",{className:[U.Text,U.Gray].join(" ")},v)),o.createElement("div",{className:[U.Text,U.Gray].join(" ")},u.isDigitalOnly?null===(s=u.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(c=u.checkout.shippingAddress)||void 0===c?void 0:c.phone),"in-store"===u.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[U.Text,U.WithMTop].join(" ")},p("checkout-page:pickUpLocation"))),o.createElement("div",{className:[U.Text,U.Gray].join(" ")},u.isDigitalOnly?null===(l=u.checkout.billingAddress)||void 0===l?void 0:l.addressText:null===(m=u.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),J=n((function(e){var t=e.vm,n=d().t;return o.createElement("div",{className:U.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:U.LightText}," / "+(0===t.checkout.shippingLines[0].price?n("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):n("checkout-page:standartShipping"))})),Q=n((function(e){var t=e.vm,n=d().t;return o.createElement("div",{className:U.Footer},o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},n("checkout-page:returnPolicy")),o.createElement("div",{className:U.FooterBullet},"•"),o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},n("checkout-page:privacyPolicy")),o.createElement("div",{className:U.FooterBullet},"•"),o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},n("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:U.FooterBullet},"•"),o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:imprint"),t.policyModalText=t.imprint}},n("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:U.FooterBullet},"•"),o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},n("checkout-page:shippingPolicy"))))})),Z=n((function(n){var i,r,a,s=n.vm,c=n.setVisible,l=d().t,m=o.useState(!1),u=m[0],p=m[1],v=o.useState(!1),f=v[0],g=v[1],h=o.useState(new y({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];h.email=(null===(i=s.checkout.customer)||void 0===i?void 0:i.email)||"",h.firstName=(null===(r=s.checkout.customer)||void 0===r?void 0:r.firstName)||"",h.lastName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.lastName)||"";var E=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return f?[2,c(!1)]:(p(!0),[4,h.saveContactForm()]);case 1:return e.sent()&&g(!0),p(!1),[2]}}))}))}),[u]);return o.createElement(k,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,f&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(M,{type:"success",title:l("checkout-page:contactFormSent"),content:l("checkout-page:contactFormDescription")})),o.createElement(T,{type:w.TEXT_AREA,label:"",value:h.message||"",onChange:h.onMessageChange,textAreaPlaceholder:l("checkout-page:contactFormCta")}),o.createElement(I,{style:{width:"100%",marginTop:"24px"},text:l(f?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:u,isDisabled:!h.message,onClick:E})),onClose:function(){return c(!1)}})}));export{G as default};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as r}from"mobx-react-lite";import{useRouter as i}from"next/router.js";import n from"next/link.js";import a from"react-tooltip";import s,{CheckoutStep as l}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CouponErrorCode as f,Coupon as g,CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as E}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/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../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/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as y}from"../../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{StepSuccess as x}from"./steps/step-success/index.js";import{Modal as k}from"./components/modal/index.js";import j from"./components/master-pass/modal-otp/index.js";import C from"./components/master-pass/modal-response/index.js";import N from"./components/master-pass/modal-success/index.js";import{Image as P}from"../image/index.js";import b,{Step as O}from"./components/step-container/index.js";import{StockError as F}from"./components/error/stock-error/index.js";import{FullscreenLoading as M}from"./components/fullscreen-loading/index.js";import S from"./components/notification-box/index.js";import{FormItem as T}from"./components/form-item/index.js";import{FormItemType as w}from"./components/form-item/model.js";import{Button as I}from"./components/button/index.js";import{IkasPageHead as A}from"../page/head.js";import B from"./components/offer-product/index.js";import L from"./components/offer-product/placeholder-offer-product.js";import D from"./components/svg/ikas.js";import V from"./style.module.scss.js";import{Analytics as R}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import U from"./components/svg/success-circle.js";import z from"./components/offer-product/offer-dots/index.js";import _ from"./components/offer-product/offer-arrows/index.js";import H from"./components/offer-product/useCampaignOffer.js";var G=r((function(e){var t,r,n,m,p,u,v,f=e.checkout,g=e.checkoutSettings,y=e.customizationProps,b=e.returnPolicy,O=e.privacyPolicy,S=e.termsOfService,T=e.imprint,w=e.shippingPolicy,G=d().t,X=i(),K=o.useState((function(){return new s(f,g,X,b,O,S,T,w,G,y||{})}))[0],Z=H(K),$=Z.setShowDetailPage,ee=Z.setActiveIndex,te=Z.setIsActiveOverlay,oe=Z.handlePrev,re=Z.handleNext,ie=Z.isPopupClosedIndexPage,ne=Z.isPopupShowIndexPage,ae=Z.isShowSuccessPageMiddlePhase,se=Z.activeIndex;o.useMemo((function(){return Date.now()}),[]);return K.step,l.PAYMENT,o.useEffect((function(){K.checkoutSettings.isAccountRequired&&!K.checkout.hasCustomer&&X.push("/account/login?redirect="+encodeURIComponent(K.checkoutUrl)),R.beginCheckout(K.checkout),R.pageView(E.CHECKOUT)}),[]),o.useEffect((function(){K.customizationProps=y,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==e?void 0:e.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==e?void 0:e.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==e?void 0:e.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==e?void 0:e.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==e?void 0:e.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==e?void 0:e.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==e?void 0:e.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==e?void 0:e.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==e?void 0:e.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==e?void 0:e.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==e?void 0:e.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(y)}),[y]),K.isCheckoutLoaded&&K.store.customerStore.initialized?K.checkout.hasCustomer&&(null===(t=K.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(r=K.checkout.customer)||void 0===r?void 0:r.id)?(X.push("/account/login?redirect="+encodeURIComponent(K.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(A,{pageType:E.CHECKOUT,pageTitle:((null===(n=K.merchantSettings)||void 0===n?void 0:n.merchantName)||"")+" - "+G("checkout-page:securePayment"),pageDescription:G("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:V.CheckoutPage},ae?o.createElement("div",{className:V.FullPageOfferMain},o.createElement("div",{className:V.FullPageOfferContainer},o.createElement("div",{className:V.LogoMain},(null===(m=K.customizationProps)||void 0===m?void 0:m.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:K.customizationProps.logo,sizes:"360px"})):(null===(p=K.merchantSettings)||void 0===p?void 0:p.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:K.merchantSettings.logo,sizes:"360px"})):(null===(u=K.merchantSettings)||void 0===u?void 0:u.merchantName)||""),o.createElement("div",{className:V.OfferSuccessInfo},o.createElement("div",null,o.createElement("div",{className:V.OfferSuccessHeader},o.createElement(U,{className:V.SuccessCircle}),o.createElement("span",{className:V.SuccessTitle},G("checkout-page:orderSuccessShortTitle"))),o.createElement("div",{className:V.OfferOrderInfoMain},o.createElement("div",{className:V.InfoTitle},G("checkout-page:orderNoAndDate"),":"),o.createElement("div",{className:V.InfoText},"#"+(K.checkout.orderNumber||"")," ",K.checkout.dateStr))),o.createElement("div",null,o.createElement(I,{classes:V.OfferButton,isLine:!0,text:G("checkout-page:actions.goOrderDetailPage"),onClick:function(){$(!1)}}))),o.createElement("div",null,K.campaignOffers&&!!K.campaignOffers.length&&K.isCampaignOfferLoaded&&o.createElement("div",{className:V.CampaignOfferMain},o.createElement("div",{className:V.OfferSlider},K.campaignOffers.map((function(e,t){var r;return o.createElement(B,{vm:K,campaignOffer:e,index:t,activeIndex:se,offersLength:(null===(r=K.campaignOffers)||void 0===r?void 0:r.length)||0,handlePrev:oe,handleNext:re,setActiveIndex:function(e){return ee(e)},desktopMiddlePhase:!0,step:K.step})}))),K.campaignOffers.length>1&&o.createElement(_,{handlePrev:oe,handleNext:re}),K.campaignOffers.length>1&&o.createElement(z,{vm:K,activeIndex:se}))))):null,o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:V.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[V.Left].join(" ")},o.createElement("div",{className:V.LeftContent},o.createElement("div",null,o.createElement(Y,{vm:K}),K.hasStockError&&o.createElement("div",{className:V.ErrorContainer},o.createElement(F,{vm:K,error:K.error})),!K.hasStockError&&o.createElement(o.Fragment,null,K.step!==l.SUCCESS&&o.createElement(h,{vm:K,allowExpand:!0}),K.step===l.SUCCESS?o.createElement(x,{vm:K}):o.createElement(o.Fragment,null,!!(null===(v=K.customizationProps)||void 0===v?void 0:v.showCampaignOffersDesign)&&c.getIsEditor()&&o.createElement(L,{vm:K}),ne&&o.createElement("div",{className:[V.MiddlePhaseOverlay,ne?V.MiddlePhaseOverlayPopup:""].join(" ")}),K.campaignOffers&&!!K.campaignOffers.length&&K.isCampaignOfferLoaded&&o.createElement("div",{className:[V.CampaignOfferMain,ne?V.OverlayPopupMain:""].join(" ")},o.createElement("div",{className:V.OfferSlider},K.campaignOffers.map((function(e,t){var r;return o.createElement(B,{vm:K,campaignOffer:e,index:t,activeIndex:se,offersLength:(null===(r=K.campaignOffers)||void 0===r?void 0:r.length)||0,handlePrev:oe,handleNext:re,setActiveIndex:function(e){return ee(e)},step:K.step,isPopupClosed:ie,isPopupShow:ne,closePopup:function(){return te(!1)},showPopup:function(){return te(!0)}})}))),K.campaignOffers.length>1&&o.createElement(_,{handlePrev:oe,handleNext:re}),K.campaignOffers.length>1&&o.createElement(z,{isPopupShow:ne,vm:K,activeIndex:se})),K.isCouponCodeRequirementOpen&&o.createElement(W,{vm:K}),o.createElement(q,{vm:K}))),o.createElement("div",{className:V.Space})),o.createElement(J,{vm:K}))),o.createElement("div",{className:V.Right},o.createElement("div",{className:V.RightContent},o.createElement(h,{vm:K}),!K.isPoweredByHidden&&o.createElement("div",{className:V.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(D,null))))),!!K.policyModalText&&o.createElement(k,{title:K.policyModalTitle,modalContent:K.policyModalText,onClose:function(){K.policyModalText=""}}),K.isContactModalVisible&&o.createElement(Q,{vm:K,setVisible:K.setContactModalVisible}),K.mpVM.isOtpModalVisible&&o.createElement(j,{vm:K,visible:K.mpVM.isOtpModalVisible,type:K.mpVM.otpModalType,onClose:K.mpVM.hideOtpModal}),K.mpVM.isResponseModalVisible&&o.createElement(C,{visible:K.mpVM.isResponseModalVisible,text:K.mpVM.mfsResponseModalText,onClose:K.mpVM.onResponseModalClose}),K.mpVM.isSuccessModalVisible&&o.createElement(N,{visible:K.mpVM.isSuccessModalVisible,type:K.mpVM.successModalType,onClose:K.mpVM.onSuccessModalClose}))):o.createElement(M,null)})),Y=r((function(e){var t,r,i,a,s=e.vm,l=d().t;return o.createElement("div",{className:V.Header},o.createElement(n,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=s.customizationProps)||void 0===t?void 0:t.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:s.customizationProps.logo,sizes:"360px"})):(null===(r=s.merchantSettings)||void 0===r?void 0:r.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:s.merchantSettings.logo,sizes:"360px"})):(null===(i=s.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!s.checkout.hasCustomer&&o.createElement("div",{className:V.LoginText},o.createElement("span",{className:V.LoginCta},l("checkout-page:alreadyHaveAnAccount")),o.createElement(n,{href:"/account/login?redirect="+encodeURIComponent(s.checkoutUrl),passHref:!0},o.createElement("a",{className:V.LoginBtn},l("checkout-page:actions.login")))),s.checkout.hasCustomer&&o.createElement("div",{className:V.CustomerInfo},o.createElement("div",{className:V.Name},s.checkout.customerFullName),o.createElement("div",{className:V.Email},null===(a=s.checkout.customer)||void 0===a?void 0:a.email)))})),W=r((function(e){var t=e.vm,r=d().t,i=o.useState(!1),n=i[0],a=i[1],s=o.useState(null),l=s[0],c=s[1],m=o.useMemo((function(){switch(l){case f.COUPON_CODE_NOT_EXIST:return r("checkout-page:giftCodeErrorDescription");case f.COUPON_CODE_NOT_EXIST_FOR_GUESS:return r("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[l]);return o.createElement("div",{className:V.CouponContainer},n&&o.createElement("div",{className:V.NotificationContainer},o.createElement(S,{type:"warning",title:r("checkout-page:giftCodeErrorTitle"),content:m,onClose:function(){a(!1),c(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:n?12:0}},o.createElement(g,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:a,setCouponErrorCode:c})))})),q=r((function(e){var t=e.vm,r=d().t,i=o.useMemo((function(){switch(t.step){case l.INFO:return o.createElement(p,{vm:t});case l.SHIPPING:return o.createElement(u,{vm:t});case l.PAYMENT:return o.createElement(v,{vm:t});case l.SUCCESS:return o.createElement(x,{vm:t})}}),[t,t.step]),n=[new O(r("checkout-page:address"),t.step===l.INFO,t.step!==l.INFO,t.step!==l.INFO?o.createElement("div",{className:V.AdressStepInfo},o.createElement(X,{vm:t}),!t.isUpsellOrder&&o.createElement("div",{className:V.EditBtn,onClick:t.onBackToInfoClick},r("checkout-page:actions.edit"))):void 0,t.step!==l.INFO?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(X,{vm:t})):void 0),new O(r("checkout-page:payment"),t.step===l.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||n.splice(1,0,new O(r("checkout-page:shipping"),t.step===l.SHIPPING,t.step===l.PAYMENT,t.step===l.PAYMENT?o.createElement("div",{className:V.AdressStepInfo},o.createElement(K,{vm:t}),!t.isUpsellOrder&&!t.isManualOrderWithShippingLines&&(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:V.EditBtn,onClick:t.onBackToShippingClick},r("checkout-page:actions.edit"))):void 0,t.step===l.PAYMENT?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(K,{vm:t})):void 0)),o.createElement(b,{steps:n,stepContent:i})})),X=r((function(e){var t,r,i,n,a,s,l,c,m,p=e.vm,u=d().t,v=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(r=p.checkout.billingAddress)||void 0===r?void 0:r.lastName)||""):((null===(i=p.checkout.shippingAddress)||void 0===i?void 0:i.firstName)||"")+" "+((null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.lastName)||"");return o.createElement("div",{className:V.Address},o.createElement("div",{className:[V.Text,V.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:V.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:V.Text},u("checkout-page:receiver")),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},v)),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},p.isDigitalOnly?null===(s=p.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(l=p.checkout.shippingAddress)||void 0===l?void 0:l.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[V.Text,V.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},p.isDigitalOnly?null===(c=p.checkout.billingAddress)||void 0===c?void 0:c.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),K=r((function(e){var t=e.vm,r=d().t;return o.createElement("div",{className:V.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:V.LightText}," / "+(0===t.checkout.shippingLines[0].price?r("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):r("checkout-page:standartShipping"))})),J=r((function(e){var t=e.vm,r=d().t;return o.createElement("div",{className:V.Footer},o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},r("checkout-page:returnPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},r("checkout-page:privacyPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},r("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:imprint"),t.policyModalText=t.imprint}},r("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},r("checkout-page:shippingPolicy"))))})),Q=r((function(r){var i,n,a,s=r.vm,l=r.setVisible,c=d().t,m=o.useState(!1),p=m[0],u=m[1],v=o.useState(!1),f=v[0],g=v[1],h=o.useState(new y({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];h.email=(null===(i=s.checkout.customer)||void 0===i?void 0:i.email)||"",h.firstName=(null===(n=s.checkout.customer)||void 0===n?void 0:n.firstName)||"",h.lastName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.lastName)||"";var E=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return f?[2,l(!1)]:(u(!0),[4,h.saveContactForm()]);case 1:return e.sent()&&g(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(k,{title:c("checkout-page:contactForm"),modalContent:o.createElement("div",null,f&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(S,{type:"success",title:c("checkout-page:contactFormSent"),content:c("checkout-page:contactFormDescription")})),o.createElement(T,{type:w.TEXT_AREA,label:"",value:h.message||"",onChange:h.onMessageChange,textAreaPlaceholder:c("checkout-page:contactFormCta")}),o.createElement(I,{style:{width:"100%",marginTop:"24px"},text:c(f?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!h.message,onClick:E})),onClose:function(){return l(!1)}})}));export{G as default};
|
|
@@ -28,7 +28,6 @@ export default class CheckoutViewModel {
|
|
|
28
28
|
isTermsAndConditionsChecked: boolean;
|
|
29
29
|
isChangingShippingMethod: boolean;
|
|
30
30
|
isContactModalVisible: boolean;
|
|
31
|
-
isEPayKolayPayment: boolean;
|
|
32
31
|
step: CheckoutStep;
|
|
33
32
|
customizationProps?: IkasCheckoutCustomizationProps | null;
|
|
34
33
|
cardData?: CreditCardData | null;
|
|
@@ -110,6 +109,7 @@ export default class CheckoutViewModel {
|
|
|
110
109
|
get isCouponCodeRequirementOpen(): boolean;
|
|
111
110
|
get isCouponCodeRequirementInvisible(): boolean;
|
|
112
111
|
get isCouponCodeVisible(): boolean;
|
|
112
|
+
get isCorporateInvoiceVisible(): boolean;
|
|
113
113
|
get canPerformPayment(): boolean | undefined;
|
|
114
114
|
get isDigitalOnly(): boolean;
|
|
115
115
|
get customerAddresses(): IkasLocalizedCustomerAddress[] | undefined;
|
|
@@ -201,7 +201,8 @@ export declare enum ErrorType {
|
|
|
201
201
|
PAYMENT_ERROR = 3,
|
|
202
202
|
NO_SHIPPING_ERROR = 4,
|
|
203
203
|
CUSTOMER_LOGIN_REQUIRED_ERROR = 5,
|
|
204
|
-
CUSTOMER_ACCOUNT_DISABLED_ERROR = 6
|
|
204
|
+
CUSTOMER_ACCOUNT_DISABLED_ERROR = 6,
|
|
205
|
+
ARGUMENT_VALIDATION_ERROR = 7
|
|
205
206
|
}
|
|
206
207
|
export declare type CheckoutError = {
|
|
207
208
|
type: ErrorType;
|