@ikas/storefront 4.16.3 → 4.16.4

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.
Files changed (48) hide show
  1. package/build/analytics/analytics.js +1 -1
  2. package/build/analytics/head/index.js +1 -1
  3. package/build/components/checkout/components/cart-summary/index.d.ts +0 -7
  4. package/build/components/checkout/components/cart-summary/index.js +1 -1
  5. package/build/components/checkout/components/cart-summary/loyalty/icons.d.ts +4 -0
  6. package/build/components/checkout/components/cart-summary/loyalty/icons.js +1 -0
  7. package/build/components/checkout/components/cart-summary/loyalty/index.d.ts +21 -0
  8. package/build/components/checkout/components/cart-summary/loyalty/index.js +1 -0
  9. package/build/components/checkout/components/cart-summary/loyalty/style.module.scss.js +1 -0
  10. package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
  11. package/build/components/checkout/components/quick-registration/index.js +1 -1
  12. package/build/components/checkout/components/quick-registration/model.d.ts +5 -0
  13. package/build/components/checkout/components/quick-registration/model.js +1 -1
  14. package/build/components/checkout/components/quick-registration/verification-sent.d.ts +7 -0
  15. package/build/components/checkout/components/quick-registration/verification-sent.js +1 -0
  16. package/build/components/checkout/components/step-container/index.js +1 -1
  17. package/build/components/checkout/components/svg/star-loyalty.js +1 -1
  18. package/build/components/checkout/components/tkpay/index.js +1 -1
  19. package/build/components/checkout/index.d.ts +1 -0
  20. package/build/components/checkout/index.js +1 -1
  21. package/build/components/checkout/model.d.ts +49 -5
  22. package/build/components/checkout/model.js +1 -1
  23. package/build/components/checkout/steps/step-payment/index.js +1 -1
  24. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  25. package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/header.d.ts +4 -0
  26. package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/header.js +1 -0
  27. package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/index.js +1 -1
  28. package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/login-required.js +1 -1
  29. package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/miles-smiles-logo.d.ts +7 -0
  30. package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/miles-smiles-logo.js +1 -0
  31. package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/style.module.scss.js +1 -1
  32. package/build/components/checkout/steps/step-payment/payment-gateways/store-credit/index.js +1 -1
  33. package/build/components/page/widgets/loyaltyWidget.js +1 -1
  34. package/build/models/data/cart/index.d.ts +2 -1
  35. package/build/models/data/cart/index.js +1 -1
  36. package/build/models/data/order/line-item/bundle-product-settings/index.d.ts +2 -0
  37. package/build/models/data/order/line-item/bundle-product-settings/index.js +1 -1
  38. package/build/models/data/theme-json/index.js +1 -1
  39. package/build/pages/checkout.js +1 -1
  40. package/package.json +12 -12
  41. package/build/components/checkout/components/svg/arrow-loyalty.d.ts +0 -6
  42. package/build/components/checkout/components/svg/arrow-loyalty.js +0 -1
  43. package/build/components/checkout/components/svg/arrow-right-loyalty.d.ts +0 -6
  44. package/build/components/checkout/components/svg/arrow-right-loyalty.js +0 -1
  45. package/build/components/checkout/components/svg/left-arrow-loyalty.d.ts +0 -6
  46. package/build/components/checkout/components/svg/left-arrow-loyalty.js +0 -1
  47. package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/thy-logo.d.ts +0 -8
  48. package/build/components/checkout/steps/step-payment/payment-gateways/miles-smiles/thy-logo.js +0 -1
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import{FormItem as r}from"../form-item/index.js";import{FormItemType as o,FormItemInputType as a}from"../form-item/model.js";import{Button as i}from"../button/index.js";import"@ikas/storefront-config";import{useTranslation as s}from"../../../../utils/i18n.js";import{QuickRegistrationCompleted as m}from"./completed.js";import{QuickRegistrationViewModel as c}from"./model.js";import n from"./style.module.scss.js";var l=t((function(t){var l=t.vm,u=s().t,p=e.useMemo((function(){return new c(l,u)}),[]);return l.checkout.customer?p.isRegisteredCustomer?e.createElement(m,{vm:l}):e.createElement("div",{className:n.Container},e.createElement("div",{className:n.Title},u("checkout-page:quickRegistration.title")),e.createElement("div",{className:n.SubTitle},u("checkout-page:quickRegistration.subtitle")),e.createElement("div",{className:n.EmailContainer},e.createElement("div",{className:n.Label},u("checkout-page:quickRegistration.accountEmail"),":"),e.createElement("div",{className:n.Email},l.checkout.customer.email)),e.createElement(r,{name:"password",type:o.TEXT,inputType:a.PASSWORD,label:u("checkout-page:password"),value:p.password,onChange:p.onPasswordChange,hasError:!!p.passwordErrorMessage,errorText:p.passwordErrorMessage}),e.createElement(i,{style:{width:"100%",marginTop:16},text:u("checkout-page:actions.signup"),isLoading:p.isLoading,onClick:p.onSubmit})):null}));export{l as QuickRegistration};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import{FormItem as r}from"../form-item/index.js";import{FormItemType as o,FormItemInputType as i}from"../form-item/model.js";import{Button as a}from"../button/index.js";import"@ikas/storefront-config";import{useTranslation as s}from"../../../../utils/i18n.js";import m from"../notification-box/index.js";import{QuickRegistrationCompleted as n}from"./completed.js";import{QuickRegistrationVerificationSent as c}from"./verification-sent.js";import{QuickRegistrationViewModel as l}from"./model.js";import p from"./style.module.scss.js";var u=t((function(t){var u=t.vm,d=s().t,g=e.useMemo((function(){return new l(u,d)}),[]);return u.checkout.customer?g.isRegisteredCustomer?e.createElement(n,{vm:u}):g.isVerificationEmailSent?e.createElement(c,{vm:u}):e.createElement("div",{className:p.Container},e.createElement("div",{className:p.Title},d("checkout-page:quickRegistration.title")),e.createElement("div",{className:p.SubTitle},d("checkout-page:quickRegistration.subtitle")),e.createElement("div",{className:p.EmailContainer},e.createElement("div",{className:p.Label},d("checkout-page:quickRegistration.accountEmail"),":"),e.createElement("div",{className:p.Email},u.checkout.customer.email)),e.createElement(r,{name:"password",type:o.TEXT,inputType:i.PASSWORD,label:d("checkout-page:password"),value:g.password,onChange:g.onPasswordChange,hasError:!!g.passwordErrorMessage,errorText:g.passwordErrorMessage}),!!g.errorMessage&&e.createElement("div",{style:{marginTop:16}},e.createElement(m,{type:"error",content:g.errorMessage,onClose:g.clearErrorMessage,ignoreScroll:!0})),e.createElement(a,{style:{width:"100%",marginTop:16},text:d("checkout-page:actions.signup"),isLoading:g.isLoading,onClick:g.onSubmit})):null}));export{u as QuickRegistration};
@@ -6,14 +6,19 @@ export declare class QuickRegistrationViewModel {
6
6
  private validator;
7
7
  private _isLoading;
8
8
  private _isRegisteredCustomer;
9
+ private _isVerificationEmailSent;
10
+ private _errorMessage;
9
11
  t: TFunction;
10
12
  constructor(vm: CheckoutViewModel, t: TFunction);
11
13
  get password(): string;
12
14
  get isLoading(): boolean;
13
15
  get isRegisteredCustomer(): boolean;
16
+ get isVerificationEmailSent(): boolean;
17
+ get errorMessage(): string | null;
14
18
  get hasError(): boolean;
15
19
  get passwordErrorMessage(): string | undefined;
16
20
  onPasswordChange: (value: string) => void;
21
+ clearErrorMessage: () => void;
17
22
  validateAll: () => Promise<boolean>;
18
23
  onSubmit: () => Promise<void>;
19
24
  }
@@ -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/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/order-transaction-with-prices/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-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
+ import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as o,observable as r}from"mobx";import{IkasRegisterError as i}from"@ikas/storefront-api";import"../../../../models/data/blog/category/index.js";import"../../../../models/data/blog/content/index.js";import"../../../../models/data/blog/meta-data/index.js";import"../../../../models/data/blog/tag/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"@ikas/storefront-models";import"../../../../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/order-transaction-with-prices/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-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 s}from"../../../../models/ui/validator/index.js";import{RequiredRule as a,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 m=function(){function m(m,n){var l=this;this.model={password:""},this._isLoading=!1,this._isRegisteredCustomer=!1,this._isVerificationEmailSent=!1,this._errorMessage=null,this.onPasswordChange=function(e){l.model.password=e,l._errorMessage=null},this.clearErrorMessage=function(){l._errorMessage=null},this.validateAll=function(){return l.validator.validateAll()},this.onSubmit=function(){return e(l,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:return[4,this.validateAll()];case 1:if(t.sent()||this._isLoading)return[3,6];this._isLoading=!0,this._errorMessage=null,t.label=2;case 2:return t.trys.push([2,4,5,6]),[4,this.vm.registerCustomer(this.password)];case 3:return(null==(e=t.sent())?void 0:e.isSuccess)?(this._isRegisteredCustomer=!0,[2]):(o=(null==e?void 0:e.errorCodes)||[]).includes(i.EMAIL_IS_NOT_VERIFIED)?(this._isVerificationEmailSent=!0,[2]):o.includes(i.CUSTOMER_EMAIL_ALREADY_EXISTS)?(this._errorMessage=this.t("checkout-page:quickRegistration.errorEmailAlreadyExists"),[2]):(this._errorMessage=this.t("checkout-page:quickRegistration.errorGeneric"),[3,6]);case 4:return t.sent(),this._errorMessage=this.t("checkout-page:quickRegistration.errorGeneric"),[3,6];case 5:return this._isLoading=!1,[7];case 6:return[2]}}))}))},o(this,{model:r}),this.vm=m,this.t=n,this.validator=new s(this.model,[new a({fieldKey:"password",valuePath:"password",message:n("checkout-page:passwordRequiredError")}),new d({fieldKey:"password",valuePath:"password",minValue:6,message:n("checkout-page:passwordMinError",{value:6})})])}return Object.defineProperty(m.prototype,"password",{get:function(){return this.model.password},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"isRegisteredCustomer",{get:function(){return this._isRegisteredCustomer},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"isVerificationEmailSent",{get:function(){return this._isVerificationEmailSent},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),m}();export{m as QuickRegistrationViewModel};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ };
6
+ export declare const QuickRegistrationVerificationSent: React.FC<Props>;
7
+ export {};
@@ -0,0 +1 @@
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../utils/i18n.js";import a from"../svg/success-circle.js";import c from"./style.module.scss.js";var m=t((function(t){var m,o=t.vm,r=i().t;return e.createElement("div",{className:c.Container},e.createElement("div",{className:c.TitleContainer},e.createElement(a,{className:c.Icon}),e.createElement("div",{className:c.CompletedTitle},r("checkout-page:quickRegistration.verificationSentTitle"))),e.createElement("div",{className:c.SubTitle},r("checkout-page:quickRegistration.verificationSentSubtitle")),!!(null===(m=o.checkout.customer)||void 0===m?void 0:m.email)&&e.createElement("div",{className:c.EmailContainer,style:{marginBottom:0}},e.createElement("div",{className:c.Label},r("checkout-page:quickRegistration.accountEmail"),":"),e.createElement("div",{className:c.Email},o.checkout.customer.email)))}));export{m as QuickRegistrationVerificationSent};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import{makeAutoObservable as i}from"mobx";import n from"../checkbox/check.js";import o from"./style.module.scss.js";import{PayWithIkas as l}from"../../../pay-with-ikas/index.js";import{CheckoutStep as s}from"../../model.js";import{IkasStorefrontConfig as a}from"@ikas/storefront-config";import{LoyaltyPointsLine as r}from"../cart-summary/index.js";import{IkasCartCreatedBy as c}from"@ikas/storefront-models";import m from"next/dynamic";m((function(){return import("../stripe-express/index.js").then((function(e){return e.default}))}));var d=t((function(t){var i,m,d,p=t.steps,u=t.stepContent,h=t.step,y=t.hasTopMargin,v=t.vm,f=t.isMobile;e.useEffect((function(){var e,t;if(document.body.getBoundingClientRect().width<768){var i=p.findIndex((function(e){return e.isSelected}));if(0===i)return;2===i?null===(e=document.getElementById("step-".concat(1)))||void 0===e||e.scrollIntoView():null===(t=document.getElementById("step-".concat(i)))||void 0===t||t.scrollIntoView()}}),[]);var C=a.getPayWithIkasUrl(),g=a.getCurrentRouting(),E="tr"===(null==g?void 0:g.locale)&&"TRY"===(null==g?void 0:g.currencyCode)&&C&&h===s.INFO,S=!!(null===(i=v.loyaltySpendingMethods)||void 0===i?void 0:i.length)&&(null===(m=v.loyaltySpendingMethods)||void 0===m?void 0:m.length)>0&&f&&!!(null===(d=v.customizationProps)||void 0===d?void 0:d.showLoyaltyPoints)&&!v.isOpenEditOrderWithTransaction&&!(v.checkout.createdBy===c.UPSELL||v.checkout.createdBy===c.ADMIN);return e.createElement("div",{className:o.StepContainer},S&&e.createElement(r,{vm:v,isVisibleLoyaltyPoints:v.isLoyaltyPointsVisible,setIsVisibleLoyaltyPoints:v.setIsLoyaltyPointsVisible,isMobile:f}),E&&e.createElement("div",{className:[o.PayWithIkasContainer,y?o.HasTopMargin:""].join(" ")},e.createElement("div",{className:o.PayWithIkasContent},e.createElement("span",{className:o.PayWithIkasTitle},"Hızlı Öde ile Kolay Alışveriş"),e.createElement("span",{className:o.PayWithIkasDescription},"Bilgilerini bir kez kaydet, 20.000 e-ticaret sitesinde tek tıkla öde.")),e.createElement("div",{className:o.PayWithIkasButton},e.createElement(l,{useExistingCart:!0}))),p.map((function(t,i){return e.createElement("div",{className:o.Step},e.createElement("div",{id:"step-".concat(i),className:[o.StepTitleContainer,0===i?o.First:""].join(" ")},e.createElement("div",{className:[o.StepTitleTop,t.titleRightContent?o.WithRightContent:""].join(" ")},e.createElement("div",{className:[o.StepCircle,t.isSelected||t.isComplete?o.Selected:""].join(" ").trim()},t.isComplete?e.createElement(n,null):i+1),e.createElement("div",{className:[o.StepTitle,t.isSelected||t.isComplete?"":o.Light].join(" ")},t.label),!!t.titleRightContent&&e.createElement("div",{className:o.StepTitleRightContent},t.titleRightContent)),!!t.titleBottomContent&&e.createElement("div",{className:o.StepTitleBottom},t.titleBottomContent)),t.isSelected&&e.createElement("div",{className:o.StepContent},u))})))})),p=function(e,t,n,o,l){this.label=e,this.isSelected=t,this.isComplete=n,this.titleRightContent=o,this.titleBottomContent=l,i(this)};export{p as Step,d as default};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import{makeAutoObservable as i}from"mobx";import n from"../checkbox/check.js";import a from"./style.module.scss.js";import{PayWithIkas as o}from"../../../pay-with-ikas/index.js";import{CheckoutStep as l}from"../../model.js";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import{isLoyaltyBlockVisible as r,LoyaltyPointsBlock as m}from"../cart-summary/loyalty/index.js";import c from"next/dynamic";c((function(){return import("../stripe-express/index.js").then((function(e){return e.default}))}));var d=t((function(t){var i=t.steps,c=t.stepContent,d=t.step,p=t.hasTopMargin,u=t.vm,f=t.isMobile;e.useEffect((function(){var e,t;if(document.body.getBoundingClientRect().width<768){var n=i.findIndex((function(e){return e.isSelected}));if(0===n)return;2===n?null===(e=document.getElementById("step-".concat(1)))||void 0===e||e.scrollIntoView():null===(t=document.getElementById("step-".concat(n)))||void 0===t||t.scrollIntoView()}}),[]);var h=s.getPayWithIkasUrl(),v=s.getCurrentRouting(),C="tr"===(null==v?void 0:v.locale)&&"TRY"===(null==v?void 0:v.currencyCode)&&h&&d===l.INFO,E=!!f&&r(u);return e.createElement("div",{className:a.StepContainer},E&&e.createElement(m,{vm:u}),C&&e.createElement("div",{className:[a.PayWithIkasContainer,p?a.HasTopMargin:""].join(" ")},e.createElement("div",{className:a.PayWithIkasContent},e.createElement("span",{className:a.PayWithIkasTitle},"Hızlı Öde ile Kolay Alışveriş"),e.createElement("span",{className:a.PayWithIkasDescription},"Bilgilerini bir kez kaydet, 20.000 e-ticaret sitesinde tek tıkla öde.")),e.createElement("div",{className:a.PayWithIkasButton},e.createElement(o,{useExistingCart:!0}))),i.map((function(t,i){return e.createElement("div",{className:a.Step},e.createElement("div",{id:"step-".concat(i),className:[a.StepTitleContainer,0===i?a.First:""].join(" ")},e.createElement("div",{className:[a.StepTitleTop,t.titleRightContent?a.WithRightContent:""].join(" ")},e.createElement("div",{className:[a.StepCircle,t.isSelected||t.isComplete?a.Selected:""].join(" ").trim()},t.isComplete?e.createElement(n,null):i+1),e.createElement("div",{className:[a.StepTitle,t.isSelected||t.isComplete?"":a.Light].join(" ")},t.label),!!t.titleRightContent&&e.createElement("div",{className:a.StepTitleRightContent},t.titleRightContent)),!!t.titleBottomContent&&e.createElement("div",{className:a.StepTitleBottom},t.titleBottomContent)),t.isSelected&&e.createElement("div",{className:a.StepContent},c))})))})),p=function(e,t,n,a,o){this.label=e,this.isSelected=t,this.isComplete=n,this.titleRightContent=a,this.titleBottomContent=o,i(this)};export{p as Step,d as default};
@@ -1 +1 @@
1
- import*as e from"react";var t=function(t){return t.className,e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},e.createElement("g",{filter:"url(#filter0_dii_4527_5468)"},e.createElement("path",{d:"M7.73445 0.617758C7.90731 0.267554 7.99375 0.0924516 8.11108 0.0365064C8.21317 -0.0121688 8.33178 -0.0121688 8.43386 0.0365064C8.5512 0.0924516 8.63763 0.267554 8.8105 0.617758L10.4505 3.94023C10.5015 4.04362 10.5271 4.09532 10.5643 4.13545C10.5974 4.17099 10.637 4.19978 10.6809 4.22024C10.7306 4.24334 10.7877 4.25168 10.9018 4.26835L14.5702 4.80455C14.9565 4.86101 15.1497 4.88925 15.239 4.9836C15.3168 5.06569 15.3534 5.17849 15.3386 5.2906C15.3216 5.41946 15.1817 5.55566 14.9021 5.82806L12.2485 8.41258C12.1658 8.49315 12.1245 8.53344 12.0978 8.58137C12.0742 8.62381 12.059 8.67043 12.0531 8.71865C12.0465 8.77311 12.0563 8.83002 12.0758 8.94382L12.7019 12.5944C12.768 12.9794 12.801 13.1719 12.7389 13.2861C12.6849 13.3855 12.589 13.4553 12.4778 13.4759C12.3499 13.4996 12.1771 13.4087 11.8313 13.2268L8.55174 11.5021C8.44956 11.4484 8.39847 11.4215 8.34464 11.411C8.29698 11.4016 8.24796 11.4016 8.2003 11.411C8.14648 11.4215 8.09539 11.4484 7.9932 11.5021L4.71365 13.2268C4.3679 13.4087 4.19502 13.4996 4.06719 13.4759C3.95597 13.4553 3.86 13.3855 3.80601 13.2861C3.74396 13.1719 3.77698 12.9794 3.84302 12.5944L4.46913 8.94382C4.48864 8.83002 4.4984 8.77311 4.4918 8.71865C4.48595 8.67043 4.47079 8.62381 4.44717 8.58137C4.42048 8.53344 4.37912 8.49315 4.2964 8.41258L1.64288 5.82806C1.36321 5.55566 1.22337 5.41946 1.20636 5.2906C1.19155 5.17849 1.22813 5.06569 1.3059 4.9836C1.39529 4.88925 1.58844 4.86101 1.97474 4.80455L5.64319 4.26835C5.75728 4.25168 5.81432 4.24334 5.864 4.22024C5.90798 4.19978 5.94758 4.17099 5.9806 4.13545C6.01789 4.09532 6.04341 4.04362 6.09444 3.94023L7.73445 0.617758Z",fill:"url(#paint0_linear_4527_5468)"})),e.createElement("defs",null,e.createElement("filter",{id:"filter0_dii_4527_5468",x:"0.00312495",y:"-1.2",width:"16.5406",height:"17.0805",filterUnits:"userSpaceOnUse","color-interpolation-filters":"sRGB"},e.createElement("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:"1.2"}),e.createElement("feGaussianBlur",{stdDeviation:"0.6"}),e.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),e.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.552941 0 0 0 0 0.294118 0 0 0 0 0 0 0 0 0.24 0"}),e.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_4527_5468"}),e.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_4527_5468",result:"shape"}),e.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:"-1.2"}),e.createElement("feGaussianBlur",{stdDeviation:"1.2"}),e.createElement("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),e.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.844933 0 0 0 0 0.523295 0 0 0 0 0.161948 0 0 0 1 0"}),e.createElement("feBlend",{mode:"normal",in2:"shape",result:"effect2_innerShadow_4527_5468"}),e.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:"1.2"}),e.createElement("feGaussianBlur",{stdDeviation:"1.2"}),e.createElement("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),e.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"}),e.createElement("feBlend",{mode:"normal",in2:"effect2_innerShadow_4527_5468",result:"effect3_innerShadow_4527_5468"})),e.createElement("linearGradient",{id:"paint0_linear_4527_5468",x1:"8.27247",y1:"0",x2:"8.27247",y2:"13.4796",gradientUnits:"userSpaceOnUse"},e.createElement("stop",{"stop-color":"#FFE6B1"}),e.createElement("stop",{offset:"1","stop-color":"#F49D30"}))))};export{t as default};
1
+ import*as C from"react";var e=function(e){var t=e.className;return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 17 16",fill:"none",className:t},C.createElement("path",{d:"M7.73445 1.21776C7.90731 0.867554 7.99375 0.692452 8.11108 0.636506C8.21317 0.587831 8.33178 0.587831 8.43386 0.636506C8.5512 0.692452 8.63763 0.867554 8.8105 1.21776L10.4505 4.54023C10.5015 4.64362 10.5271 4.69532 10.5643 4.73545C10.5974 4.77099 10.637 4.79978 10.6809 4.82024C10.7306 4.84334 10.7877 4.85168 10.9018 4.86835L14.5702 5.40455C14.9565 5.46101 15.1497 5.48925 15.239 5.5836C15.3168 5.66569 15.3534 5.77849 15.3386 5.8906C15.3216 6.01946 15.1817 6.15566 14.9021 6.42806L12.2485 9.01258C12.1658 9.09315 12.1245 9.13344 12.0978 9.18137C12.0742 9.22381 12.059 9.27043 12.0531 9.31865C12.0465 9.37311 12.0563 9.43002 12.0758 9.54382L12.7019 13.1944C12.768 13.5794 12.801 13.7719 12.7389 13.8861C12.6849 13.9855 12.589 14.0553 12.4778 14.0759C12.3499 14.0996 12.1771 14.0087 11.8313 13.8268L8.55174 12.1021C8.44956 12.0484 8.39847 12.0215 8.34464 12.011C8.29698 12.0016 8.24796 12.0016 8.2003 12.011C8.14648 12.0215 8.09539 12.0484 7.9932 12.1021L4.71365 13.8268C4.3679 14.0087 4.19502 14.0996 4.06719 14.0759C3.95597 14.0553 3.86 13.9855 3.80601 13.8861C3.74396 13.7719 3.77698 13.5794 3.84302 13.1944L4.46913 9.54382C4.48864 9.43002 4.4984 9.37311 4.4918 9.31865C4.48595 9.27043 4.47079 9.22381 4.44717 9.18137C4.42048 9.13344 4.37912 9.09315 4.2964 9.01258L1.64288 6.42806C1.36321 6.15566 1.22337 6.01946 1.20636 5.8906C1.19155 5.77849 1.22813 5.66569 1.3059 5.5836C1.39529 5.48925 1.58844 5.46101 1.97474 5.40455L5.64319 4.86835C5.75728 4.85168 5.81432 4.84334 5.864 4.82024C5.90798 4.79978 5.94758 4.77099 5.9806 4.73545C6.01789 4.69532 6.04341 4.64362 6.09444 4.54023L7.73445 1.21776Z",fill:"currentColor"}))};export{e as default};
@@ -1 +1 @@
1
- import{__assign as e,__awaiter as t,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import*as n from"react";import{observer as a}from"mobx-react-lite";var s=["https://sandbox-app.tkpay.com","https://app.tkpay.com"],i=a((function(a){var i,o,c=a.vm;a.isSelected;var l=n.useRef(null),u=n.useRef(!1),p=null===(i=c.tkPayResponse)||void 0===i?void 0:i.paymentPageUrl,d=null===(o=c.tkPayResponse)||void 0===o?void 0:o.callbackUrl;return n.useEffect((function(){u.current=!1}),[p,d]),n.useEffect((function(){if(p){var e=function(e){if(s.includes(e.origin)){var n=e.data||{};if("tkpay:resize"!==n.type){var a;"tkpay:success"===n.type&&n.payload&&(a=n.payload,t(void 0,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:if(!d||u.current)return[2];if(a.status&&"SUCCESS"!==a.status)return[2];u.current=!0,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),u.current=!1,console.error("TkPay callback post failed",e),[3,4];case 4:return[2]}}))})))}else{var i=Number(n.height||0);l.current&&i>0&&(l.current.style.height="".concat(i,"px"))}}};return window.addEventListener("message",e),function(){return window.removeEventListener("message",e)}}}),[p,d]),p?n.createElement("div",{style:e({},!c.showTkPayContainer&&{display:"none"})},n.createElement("iframe",{ref:l,src:p,id:"tkpay-payment-page",className:"responsive",title:"TKPay Payment",style:{width:"100%",height:"600px",border:"none"}})):null}));export{i as TkPay};
1
+ import{__assign as e,__awaiter as t,__generator as n}from'./../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as a}from"mobx-react-lite";var s=["https://sandbox-app.tkpay.com","https://app.tkpay.com"],o=a((function(a){var o,i,c=a.vm;a.isSelected;var u=r.useRef(null),l=r.useRef(!1),p=null===(o=c.tkPayResponse)||void 0===o?void 0:o.paymentPageUrl,d=null===(i=c.tkPayResponse)||void 0===i?void 0:i.callbackUrl;return r.useEffect((function(){l.current=!1}),[p,d]),r.useEffect((function(){if(p){var e=function(e){e.status&&"SUCCESS"!==e.status||c.onTkPayPaymentSuccess((function(){return function(e){return t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:if(!d||l.current)return[2];l.current=!0,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})];case 2:return n.sent(),[3,4];case 3:return t=n.sent(),l.current=!1,console.error("TkPay callback post failed",t),[3,4];case 4:return[2]}}))}))}(e)}))},r=function(t){if(s.includes(t.origin)){var n=t.data||{};if("tkpay:resize"!==n.type)"tkpay:success"===n.type&&n.payload&&e(n.payload);else{var r=Number(n.height||0);u.current&&r>0&&(u.current.style.height="".concat(r,"px"))}}};return window.addEventListener("message",r),function(){return window.removeEventListener("message",r)}}}),[p,d]),p?r.createElement("div",{style:e({},!c.showTkPayContainer&&{display:"none"})},r.createElement("iframe",{ref:u,src:p,id:"tkpay-payment-page",className:"responsive",title:"TKPay Payment",style:{width:"100%",height:"600px",border:"none"}})):null}));export{o as TkPay};
@@ -51,6 +51,7 @@ export declare type IkasCheckoutCustomizationProps = {
51
51
  secondaryButtonBgColor?: string;
52
52
  secondaryButtonTextColor?: string;
53
53
  secondaryButtonBorderColor?: string;
54
+ loyaltyIconColor?: string;
54
55
  };
55
56
  declare const _default: React.FunctionComponent<IkasCheckoutPageProps>;
56
57
  export default _default;
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import n from"react-tooltip";import a,{CheckoutStep as s}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as l}from"../../utils/currency.js";import{useTranslation as m}from"../../utils/i18n.js";import d from"./steps/step-info/index.js";import{CheckoutStepShipping as p}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as u}from"./steps/step-payment/index.js";import{CouponErrorCode as f,Coupon as g,CartSummary as v}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 h}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/order-transaction-with-prices/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-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 E}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 y}from"./steps/step-success/index.js";import{Modal as x}from"./components/modal/index.js";import k from"./components/master-pass/modal-otp/index.js";import C from"./components/master-pass/modal-response/index.js";import j from"./components/master-pass/modal-success/index.js";import{Image as P}from"../image/index.js";import N,{Step as O}from"./components/step-container/index.js";import{StockError as S}from"./components/error/stock-error/index.js";import{FullscreenLoading as b}from"./components/fullscreen-loading/index.js";import{CheckoutLoadFailed as M,getCheckoutHomeHref as F}from"./components/checkout-load-failed/index.js";import T from"./components/notification-box/index.js";import{FormItem as w}from"./components/form-item/index.js";import{FormItemType as I}from"./components/form-item/model.js";import{Button as A}from"./components/button/index.js";import{IkasPageHead as L}from"../page/head.js";import B from"./components/offer-product/index.js";import D from"./components/offer-product/placeholder-offer-product.js";import U 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 _ 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 G from"./components/offer-product/useCampaignOffer.js";import W from"../../hooks/useDimension.js";var q=i((function(e){var t,i,l,d,p,u,f,g,E,N,O=e.checkout,T=e.checkoutSettings,w=e.customizationProps,I=e.returnPolicy,B=e.privacyPolicy,z=e.termsOfService,H=e.imprint,W=e.shippingPolicy,q=m().t,J=r(),Q=o.useState(Date.now()),oe=Q[0],ie=Q[1],re=o.useState((function(){return new a(O,T,J,I,B,z,H,W,q,w||{})}))[0];o.useEffect((function(){ie(Date.now())}),[O.campaignOffers,re.campaignOffers,re.isCampaignOfferLoaded]);var ne=G(re),ae=ne.setShowDetailPage,se=ne.isPopupShowIndexPage,ce=ne.isShowSuccessPageMiddlePhase;o.useMemo((function(){return Date.now()}),[]);return re.step,s.PAYMENT,o.useEffect((function(){var e;re.checkoutSettings.isAccountRequired&&!re.checkout.hasCustomer&&J.push("/account/login?redirect="+encodeURIComponent(re.checkoutUrl)),new URLSearchParams(window.location.search).get("step")!==s.SUCCESS&&(re.checkoutSettings.isAccountRequired&&(null===(e=re.checkout.customer)||void 0===e?void 0:e.isGuestCheckout)||R.beginCheckout(re.checkout)),R.pageView(h.CHECKOUT)}),[]),o.useEffect((function(){re.customizationProps=w,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-container-bg-color",(null==e?void 0:e.campaignOffersContainerBgColor)||"#ffffff"),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")}(w)}),[w]),o.useEffect((function(){var e=document.querySelector(".ikas-storefront-widget");e&&e.remove()}),[]),re.isCheckoutLoadFailed?o.createElement(M,{logo:(null===(t=re.customizationProps)||void 0===t?void 0:t.logo)||(null===(i=re.merchantSettings)||void 0===i?void 0:i.logo),merchantName:null===(l=re.merchantSettings)||void 0===l?void 0:l.merchantName,backHref:F(),returnPolicy:re.returnPolicy,privacyPolicy:re.privacyPolicy,termsOfService:re.termsOfService,imprint:re.imprint,shippingPolicy:re.shippingPolicy}):re.isCheckoutLoaded&&re.store.customerStore.initialized?re.checkout.hasCustomer&&(null===(d=re.store.customerStore.customer)||void 0===d?void 0:d.id)!==(null===(p=re.checkout.customer)||void 0===p?void 0:p.id)?(J.push("/account/login?redirect="+encodeURIComponent(re.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(L,{pageType:h.CHECKOUT,pageTitle:((null===(u=re.merchantSettings)||void 0===u?void 0:u.merchantName)||"")+" - "+q("checkout-page:securePayment"),pageDescription:q("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:V.CheckoutPage},ce?o.createElement("div",{className:V.FullPageOfferMain},o.createElement("div",{className:V.FullPageOfferContainer},o.createElement("div",{className:V.LogoMain},(null===(f=re.customizationProps)||void 0===f?void 0:f.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:re.customizationProps.logo,sizes:"360px"})):(null===(g=re.merchantSettings)||void 0===g?void 0:g.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:re.merchantSettings.logo,sizes:"360px"})):(null===(E=re.merchantSettings)||void 0===E?void 0:E.merchantName)||""),o.createElement("div",{className:V.OfferSuccessInfo},o.createElement("div",null,o.createElement("div",{className:V.OfferSuccessHeader},o.createElement(_,{className:V.SuccessCircle}),o.createElement("span",{className:V.SuccessTitle},q("checkout-page:orderSuccessShortTitle"))),o.createElement("div",{className:V.OfferOrderInfoMain},o.createElement("div",{className:V.InfoTitle},q("checkout-page:orderNoAndDate"),":"),o.createElement("div",{className:V.InfoText},"#"+(re.checkout.orderNumber||"")," ",re.checkout.dateStr))),o.createElement("div",null,o.createElement(A,{classes:V.OfferButton,isLine:!0,text:q("checkout-page:actions.goOrderDetailPage"),onClick:function(){ae(!1)}}))),o.createElement("div",null,o.createElement(ee,{vm:re,key:oe})))):null,o.createElement(n,{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:re}),re.hasStockError&&o.createElement("div",{className:V.ErrorContainer},o.createElement(S,{vm:re,error:re.error})),!re.hasStockError&&o.createElement(o.Fragment,null,re.step!==s.SUCCESS&&o.createElement(v,{vm:re,allowExpand:!0}),re.step===s.SUCCESS?o.createElement(y,{vm:re}):o.createElement(o.Fragment,null,!!(null===(N=re.customizationProps)||void 0===N?void 0:N.showCampaignOffersDesign)&&c.getIsEditor()&&o.createElement(D,{vm:re}),se&&o.createElement("div",{className:[V.MiddlePhaseOverlay,se?V.MiddlePhaseOverlayPopup:""].join(" ")}),re.campaignOffers&&!!re.campaignOffers.length&&re.isCampaignOfferLoaded&&o.createElement(te,{key:oe,vm:re}),re.isCouponCodeRequirementOpen&&o.createElement(X,{vm:re}),o.createElement(K,{vm:re}))),o.createElement("div",{className:V.Space})),o.createElement(Z,{vm:re}))),o.createElement("div",{className:V.Right},o.createElement("div",{className:V.RightContent},o.createElement(v,{vm:re}),!re.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(U,null))))),!!re.policyModalText&&o.createElement(x,{title:re.policyModalTitle,modalContent:re.policyModalText,onClose:function(){re.policyModalText=""},isPolicyModal:!0}),re.isContactModalVisible&&o.createElement($,{vm:re,setVisible:re.setContactModalVisible}),re.mpVM.isOtpModalVisible&&o.createElement(k,{vm:re,visible:re.mpVM.isOtpModalVisible,type:re.mpVM.otpModalType,onClose:re.mpVM.hideOtpModal}),re.mpVM.isResponseModalVisible&&o.createElement(C,{visible:re.mpVM.isResponseModalVisible,text:re.mpVM.mfsResponseModalText,onClose:re.mpVM.onResponseModalClose}),re.mpVM.isSuccessModalVisible&&o.createElement(j,{visible:re.mpVM.isSuccessModalVisible,type:re.mpVM.successModalType,onClose:re.mpVM.onSuccessModalClose}))):o.createElement(b,null)})),Y=i((function(e){var t,i,r,n,a=e.vm,s=c.getCurrentRouting(),l=(null==s?void 0:s.path)?"/".concat(s.path):"/",d=m().t;return o.createElement("div",{className:V.Header},o.createElement("a",{href:l},(null===(t=a.customizationProps)||void 0===t?void 0:t.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:a.customizationProps.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(r=a.merchantSettings)||void 0===r?void 0:r.merchantName)||""),!a.checkout.hasCustomer&&!a.isOpenEditOrderWithTransaction&&!a.checkout.edited&&o.createElement("div",{className:V.LoginText},o.createElement("span",{className:V.LoginCta},d("checkout-page:alreadyHaveAnAccount")),o.createElement("a",{href:a.getGoToLoginHref(),className:V.LoginBtn},d("checkout-page:actions.login"))),(a.checkout.hasCustomer||a.isOpenEditOrderWithTransaction||a.checkout.edited)&&o.createElement("div",{className:V.CustomerInfo},o.createElement("div",{className:V.Name},a.checkout.customerFullName),o.createElement("div",{className:V.Email},null===(n=a.checkout.customer)||void 0===n?void 0:n.email)))})),X=i((function(e){var t=e.vm,i=m().t,r=o.useState(!1),n=r[0],a=r[1],s=o.useState(null),c=s[0],l=s[1],d=W().isMobile,p=o.useMemo((function(){switch(c){case f.COUPON_CODE_NOT_EXIST:return i("checkout-page:giftCodeErrorDescription");case f.COUPON_CODE_NOT_EXIST_FOR_GUESS:return i("checkout-page:mustBeSignInToApplyCampaign");case f.COUPON_APPLIED_WITHOUT_DISCOUNT:return i("checkout-page:couponInvalidForCartItems");case f.COUPON_PERIOD_USAGE_LIMIT_EXCEEDED:return i("checkout-page:couponPeriodUsageLimitExceeded");default:return""}}),[c]);return o.createElement("div",{className:V.CouponContainer},n&&o.createElement("div",{className:V.NotificationContainer},o.createElement(T,{type:"warning",title:i("checkout-page:giftCodeErrorTitle"),content:p,onClose:function(){a(!1),l(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:l,showOnlyMobile:!0,isMobile:d})))})),K=i((function(e){var t=e.vm,i=m().t,r=o.useMemo((function(){switch(t.step){case s.INFO:return o.createElement(d,{vm:t});case s.SHIPPING:return o.createElement(p,{vm:t});case s.PAYMENT:return o.createElement(u,{vm:t});case s.SUCCESS:return o.createElement(y,{vm:t})}}),[t,t.step]),n=W().isMobile,a=[new O(i("checkout-page:address"),t.step===s.INFO,t.step!==s.INFO,t.step!==s.INFO?o.createElement("div",{className:V.AdressStepInfo},o.createElement(J,{vm:t}),!(t.isUpsellOrder||t.isOpenEditOrderWithTransaction)&&o.createElement("div",{className:V.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==s.INFO?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(J,{vm:t})):void 0),new O(i("checkout-page:payment"),t.step===s.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||a.splice(1,0,new O(i("checkout-page:shipping"),t.step===s.SHIPPING,t.step===s.PAYMENT,t.step===s.PAYMENT?o.createElement("div",{className:V.AdressStepInfo},o.createElement(Q,{vm:t}),!(t.isUpsellOrder||t.isOpenEditOrderWithTransaction)&&!t.isManualOrderWithShippingLines&&(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:V.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===s.PAYMENT?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(Q,{vm:t})):void 0)),o.createElement(N,{steps:a,stepContent:r,step:t.step,hasTopMargin:t.isCouponCodeRequirementOpen||t.campaignOffers&&!!t.campaignOffers.length&&t.isCampaignOfferLoaded,vm:t,isMobile:n})})),J=i((function(e){var t,i,r,n,a,s,c,l,d,p=e.vm,u=m().t,f=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=p.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=p.checkout.shippingAddress)||void 0===r?void 0:r.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},f):o.createElement(o.Fragment,null,o.createElement("div",{className:V.Text},u("checkout-page:receiver")),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},f)),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},p.isDigitalOnly?null===(s=p.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(c=p.checkout.shippingAddress)||void 0===c?void 0:c.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===(l=p.checkout.billingAddress)||void 0===l?void 0:l.addressText:null===(d=p.checkout.shippingAddress)||void 0===d?void 0:d.addressText))})),Q=i((function(e){var t=e.vm,i=m().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].finalPrice?i("checkout-page:free"):l(t.checkout.shippingLines[0].finalPrice,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),Z=i((function(e){var t=e.vm,i=m().t;return o.createElement("div",{className:V.Footer},o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("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=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("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=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),$=i((function(i){var r,n,a,s=i.vm,c=i.setVisible,l=m().t,d=o.useState(!1),p=d[0],u=d[1],f=o.useState(!1),g=f[0],v=f[1],h=o.useState(new E({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];h.email=(null===(r=s.checkout.customer)||void 0===r?void 0:r.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 y=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return g?[2,c(!1)]:(u(!0),[4,h.saveContactForm()]);case 1:return e.sent()&&v(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(x,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,g&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(T,{type:"success",title:l("checkout-page:contactFormSent"),content:l("checkout-page:contactFormDescription")})),o.createElement(w,{name:"message",type:I.TEXT_AREA,label:"",value:h.message||"",onChange:h.onMessageChange,textAreaPlaceholder:l("checkout-page:contactFormCta")}),o.createElement(A,{style:{width:"100%",marginTop:"24px"},text:l(g?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!h.message,onClick:y})),onClose:function(){return c(!1)}})})),ee=i((function(e){var t=e.vm,i=G(t),r=i.setActiveIndex,n=i.handlePrev,a=i.handleNext,s=i.activeIndex;return t.campaignOffers&&t.campaignOffers.length&&t.isCampaignOfferLoaded?o.createElement("div",{className:V.CampaignOfferMain},o.createElement("div",{className:V.OfferSlider},t.campaignOffers.map((function(e,i){var c;return o.createElement(B,{vm:t,campaignOffer:e,index:i,activeIndex:s,offersLength:(null===(c=t.campaignOffers)||void 0===c?void 0:c.length)||0,handlePrev:n,handleNext:a,setActiveIndex:function(e){return r(e)},desktopMiddlePhase:!0,step:t.step})}))),t.campaignOffers.length>1&&o.createElement(H,{handlePrev:n,handleNext:a}),t.campaignOffers.length>1&&o.createElement(z,{vm:t,activeIndex:s})):null})),te=i((function(e){var t=e.vm,i=G(t),r=i.setActiveIndex,n=i.setIsActiveOverlay,a=i.handlePrev,s=i.handleNext,c=i.isPopupClosedIndexPage,l=i.isPopupShowIndexPage,m=i.activeIndex;return t.campaignOffers&&t.campaignOffers.length&&t.isCampaignOfferLoaded?o.createElement("div",{className:[V.CampaignOfferMain,l?V.OverlayPopupMain:""].join(" ")},o.createElement("div",{className:V.OfferSlider},t.campaignOffers.map((function(e,i){var d;return o.createElement(B,{vm:t,campaignOffer:e,index:i,activeIndex:m,offersLength:(null===(d=t.campaignOffers)||void 0===d?void 0:d.length)||0,handlePrev:a,handleNext:s,setActiveIndex:function(e){return r(e)},step:t.step,isPopupClosed:c,isPopupShow:l,closePopup:function(){return n(!1)},showPopup:function(){return n(!0)}})}))),t.campaignOffers.length>1&&o.createElement(H,{handlePrev:a,handleNext:s}),t.campaignOffers.length>1&&o.createElement(z,{isPopupShow:l,vm:t,activeIndex:m})):null}));export{q as default};
1
+ import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import n from"react-tooltip";import a,{CheckoutStep as s}from"./model.js";import{IkasStorefrontConfig as c,NAVIGATION_WARNING_SCRIPT_ATTRIBUTE 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 f}from"./steps/step-payment/index.js";import{CouponErrorCode as g,Coupon as v,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/order-transaction-with-prices/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-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 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 O,{Step as S}from"./components/step-container/index.js";import{StockError as b}from"./components/error/stock-error/index.js";import{FullscreenLoading as M}from"./components/fullscreen-loading/index.js";import{CheckoutLoadFailed as F,getCheckoutHomeHref as T}from"./components/checkout-load-failed/index.js";import w from"./components/notification-box/index.js";import{FormItem as I}from"./components/form-item/index.js";import{FormItemType as A}from"./components/form-item/model.js";import{Button as L}from"./components/button/index.js";import{IkasPageHead as B}from"../page/head.js";import D from"./components/offer-product/index.js";import U from"./components/offer-product/placeholder-offer-product.js";import V from"./components/svg/ikas.js";import R from"./style.module.scss.js";import{Analytics as _}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import z from"./components/svg/success-circle.js";import G from"./components/offer-product/offer-dots/index.js";import H from"./components/offer-product/offer-arrows/index.js";import W from"./components/offer-product/useCampaignOffer.js";import q from"../../hooks/useDimension.js";var Y=i((function(e){var t,i,m,u,p,f,g,v,y,O,S=e.checkout,w=e.checkoutSettings,I=e.customizationProps,A=e.returnPolicy,D=e.privacyPolicy,G=e.termsOfService,H=e.imprint,q=e.shippingPolicy,Y=d().t,Q=r(),Z=o.useState(Date.now()),ie=Z[0],re=Z[1],ne=o.useState((function(){return new a(S,w,Q,A,D,G,H,q,Y,I||{})}))[0];o.useEffect((function(){re(Date.now())}),[S.campaignOffers,ne.campaignOffers,ne.isCampaignOfferLoaded]);var ae=W(ne),se=ae.setShowDetailPage,ce=ae.isPopupShowIndexPage,le=ae.isShowSuccessPageMiddlePhase;o.useMemo((function(){return Date.now()}),[]);return ne.step,s.PAYMENT,o.useEffect((function(){var e="ikas-navigation-warning-reload";try{if(!document.querySelector("script[".concat(l,"]")))return void sessionStorage.removeItem(e);if(sessionStorage.getItem(e)===window.location.href)return;sessionStorage.setItem(e,window.location.href)}catch(e){return}window.location.replace(window.location.href)}),[]),o.useEffect((function(){var e;ne.checkoutSettings.isAccountRequired&&!ne.checkout.hasCustomer&&Q.push("/account/login?redirect="+encodeURIComponent(ne.checkoutUrl)),new URLSearchParams(window.location.search).get("step")!==s.SUCCESS&&(ne.checkoutSettings.isAccountRequired&&(null===(e=ne.checkout.customer)||void 0===e?void 0:e.isGuestCheckout)||_.beginCheckout(ne.checkout)),_.pageView(E.CHECKOUT)}),[]),o.useEffect((function(){ne.customizationProps=I,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)||"#ffffff00"),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-loyalty-icon-color",(null==e?void 0:e.loyaltyIconColor)||"#F5B53F"),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-container-bg-color",(null==e?void 0:e.campaignOffersContainerBgColor)||"#ffffff"),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")}(I)}),[I]),o.useEffect((function(){var e=document.querySelector(".ikas-storefront-widget");e&&e.remove()}),[]),ne.isCheckoutLoadFailed?o.createElement(F,{logo:(null===(t=ne.customizationProps)||void 0===t?void 0:t.logo)||(null===(i=ne.merchantSettings)||void 0===i?void 0:i.logo),merchantName:null===(m=ne.merchantSettings)||void 0===m?void 0:m.merchantName,backHref:T(),returnPolicy:ne.returnPolicy,privacyPolicy:ne.privacyPolicy,termsOfService:ne.termsOfService,imprint:ne.milesSmilesPaymentGateway?void 0:ne.imprint,shippingPolicy:ne.shippingPolicy}):ne.isCheckoutLoaded&&ne.store.customerStore.initialized?ne.checkout.hasCustomer&&(null===(u=ne.store.customerStore.customer)||void 0===u?void 0:u.id)!==(null===(p=ne.checkout.customer)||void 0===p?void 0:p.id)?(Q.push("/account/login?redirect="+encodeURIComponent(ne.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(B,{pageType:E.CHECKOUT,pageTitle:((null===(f=ne.merchantSettings)||void 0===f?void 0:f.merchantName)||"")+" - "+Y("checkout-page:securePayment"),pageDescription:Y("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:R.CheckoutPage},le?o.createElement("div",{className:R.FullPageOfferMain},o.createElement("div",{className:R.FullPageOfferContainer},o.createElement("div",{className:R.LogoMain},(null===(g=ne.customizationProps)||void 0===g?void 0:g.logo)?o.createElement("div",{className:R.Logo},o.createElement(N,{layout:"fill",image:ne.customizationProps.logo,sizes:"360px"})):(null===(v=ne.merchantSettings)||void 0===v?void 0:v.logo)?o.createElement("div",{className:R.Logo},o.createElement(N,{layout:"fill",image:ne.merchantSettings.logo,sizes:"360px"})):(null===(y=ne.merchantSettings)||void 0===y?void 0:y.merchantName)||""),o.createElement("div",{className:R.OfferSuccessInfo},o.createElement("div",null,o.createElement("div",{className:R.OfferSuccessHeader},o.createElement(z,{className:R.SuccessCircle}),o.createElement("span",{className:R.SuccessTitle},Y("checkout-page:orderSuccessShortTitle"))),o.createElement("div",{className:R.OfferOrderInfoMain},o.createElement("div",{className:R.InfoTitle},Y("checkout-page:orderNoAndDate"),":"),o.createElement("div",{className:R.InfoText},"#"+(ne.checkout.orderNumber||"")," ",ne.checkout.dateStr))),o.createElement("div",null,o.createElement(L,{classes:R.OfferButton,isLine:!0,text:Y("checkout-page:actions.goOrderDetailPage"),onClick:function(){se(!1)}}))),o.createElement("div",null,o.createElement(te,{vm:ne,key:ie})))):null,o.createElement(n,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:R.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[R.Left].join(" ")},o.createElement("div",{className:R.LeftContent},o.createElement("div",null,o.createElement(X,{vm:ne}),ne.hasStockError&&o.createElement("div",{className:R.ErrorContainer},o.createElement(b,{vm:ne,error:ne.error})),!ne.hasStockError&&o.createElement(o.Fragment,null,ne.step!==s.SUCCESS&&o.createElement(h,{vm:ne,allowExpand:!0}),ne.step===s.SUCCESS?o.createElement(x,{vm:ne}):o.createElement(o.Fragment,null,!!(null===(O=ne.customizationProps)||void 0===O?void 0:O.showCampaignOffersDesign)&&c.getIsEditor()&&o.createElement(U,{vm:ne}),ce&&o.createElement("div",{className:[R.MiddlePhaseOverlay,ce?R.MiddlePhaseOverlayPopup:""].join(" ")}),ne.campaignOffers&&!!ne.campaignOffers.length&&ne.isCampaignOfferLoaded&&o.createElement(oe,{key:ie,vm:ne}),ne.isCouponCodeRequirementOpen&&o.createElement(K,{vm:ne}),o.createElement(J,{vm:ne}))),o.createElement("div",{className:R.Space})),o.createElement($,{vm:ne}))),o.createElement("div",{className:R.Right},o.createElement("div",{className:R.RightContent},o.createElement(h,{vm:ne}),!ne.isPoweredByHidden&&o.createElement("div",{className:R.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(V,null))))),!!ne.policyModalText&&o.createElement(k,{title:ne.policyModalTitle,modalContent:ne.policyModalText,onClose:function(){ne.policyModalText=""},isPolicyModal:!0}),ne.isContactModalVisible&&o.createElement(ee,{vm:ne,setVisible:ne.setContactModalVisible}),ne.mpVM.isOtpModalVisible&&o.createElement(C,{vm:ne,visible:ne.mpVM.isOtpModalVisible,type:ne.mpVM.otpModalType,onClose:ne.mpVM.hideOtpModal}),ne.mpVM.isResponseModalVisible&&o.createElement(j,{visible:ne.mpVM.isResponseModalVisible,text:ne.mpVM.mfsResponseModalText,onClose:ne.mpVM.onResponseModalClose}),ne.mpVM.isSuccessModalVisible&&o.createElement(P,{visible:ne.mpVM.isSuccessModalVisible,type:ne.mpVM.successModalType,onClose:ne.mpVM.onSuccessModalClose}))):o.createElement(M,null)})),X=i((function(e){var t,i,r,n,a=e.vm,s=c.getCurrentRouting(),l=(null==s?void 0:s.path)?"/".concat(s.path):"/",m=d().t;return o.createElement("div",{className:R.Header},o.createElement("a",{href:l},(null===(t=a.customizationProps)||void 0===t?void 0:t.logo)?o.createElement("div",{className:R.Logo},o.createElement(N,{layout:"fill",image:a.customizationProps.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.logo)?o.createElement("div",{className:R.Logo},o.createElement(N,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(r=a.merchantSettings)||void 0===r?void 0:r.merchantName)||""),!a.checkout.hasCustomer&&!a.isOpenEditOrderWithTransaction&&!a.checkout.edited&&o.createElement("div",{className:R.LoginText},o.createElement("span",{className:R.LoginCta},m("checkout-page:alreadyHaveAnAccount")),o.createElement("a",{href:a.getGoToLoginHref(),className:R.LoginBtn},m("checkout-page:actions.login"))),(a.checkout.hasCustomer||a.isOpenEditOrderWithTransaction||a.checkout.edited)&&o.createElement("div",{className:R.CustomerInfo},o.createElement("div",{className:R.Name},a.checkout.customerFullName),o.createElement("div",{className:R.Email},null===(n=a.checkout.customer)||void 0===n?void 0:n.email)))})),K=i((function(e){var t=e.vm,i=d().t,r=o.useState(!1),n=r[0],a=r[1],s=o.useState(null),c=s[0],l=s[1],m=q().isMobile,u=o.useMemo((function(){switch(c){case g.COUPON_CODE_NOT_EXIST:return i("checkout-page:giftCodeErrorDescription");case g.COUPON_CODE_NOT_EXIST_FOR_GUESS:return i("checkout-page:mustBeSignInToApplyCampaign");case g.COUPON_APPLIED_WITHOUT_DISCOUNT:return i("checkout-page:couponInvalidForCartItems");case g.COUPON_PERIOD_USAGE_LIMIT_EXCEEDED:return i("checkout-page:couponPeriodUsageLimitExceeded");default:return""}}),[c]);return o.createElement("div",{className:R.CouponContainer},n&&o.createElement("div",{className:R.NotificationContainer},o.createElement(w,{type:"warning",title:i("checkout-page:giftCodeErrorTitle"),content:u,onClose:function(){a(!1),l(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:n?12:0}},o.createElement(v,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:a,setCouponErrorCode:l,showOnlyMobile:!0,isMobile:m})))})),J=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case s.INFO:return o.createElement(u,{vm:t});case s.SHIPPING:return o.createElement(p,{vm:t});case s.PAYMENT:return o.createElement(f,{vm:t});case s.SUCCESS:return o.createElement(x,{vm:t})}}),[t,t.step]),n=q().isMobile,a=[new S(i("checkout-page:address"),t.step===s.INFO,t.step!==s.INFO,t.step!==s.INFO?o.createElement("div",{className:R.AdressStepInfo},o.createElement(Q,{vm:t}),!(t.isUpsellOrder||t.isOpenEditOrderWithTransaction)&&o.createElement("div",{className:R.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==s.INFO?o.createElement("div",{className:R.AddressStepInfoMobile},o.createElement(Q,{vm:t})):void 0),new S(i("checkout-page:payment"),t.step===s.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||a.splice(1,0,new S(i("checkout-page:shipping"),t.step===s.SHIPPING,t.step===s.PAYMENT,t.step===s.PAYMENT?o.createElement("div",{className:R.AdressStepInfo},o.createElement(Z,{vm:t}),!(t.isUpsellOrder||t.isOpenEditOrderWithTransaction)&&!t.isManualOrderWithShippingLines&&(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:R.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===s.PAYMENT?o.createElement("div",{className:R.AddressStepInfoMobile},o.createElement(Z,{vm:t})):void 0)),o.createElement(O,{steps:a,stepContent:r,step:t.step,hasTopMargin:t.isCouponCodeRequirementOpen||t.campaignOffers&&!!t.campaignOffers.length&&t.isCampaignOfferLoaded,vm:t,isMobile:n})})),Q=i((function(e){var t,i,r,n,a,s,c,l,m,u=e.vm,p=d().t,f=u.isDigitalOnly?((null===(t=u.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=u.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=u.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(n=u.checkout.shippingAddress)||void 0===n?void 0:n.lastName)||"");return o.createElement("div",{className:R.Address},o.createElement("div",{className:[R.Text,R.WithMBottom].join(" ")},(null===(a=u.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===u.deliveryMethod?o.createElement("div",{className:R.Text},f):o.createElement(o.Fragment,null,o.createElement("div",{className:R.Text},p("checkout-page:receiver")),o.createElement("div",{className:[R.Text,R.Gray].join(" ")},f)),o.createElement("div",{className:[R.Text,R.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:[R.Text,R.WithMTop].join(" ")},p("checkout-page:pickUpLocation"))),o.createElement("div",{className:[R.Text,R.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))})),Z=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:R.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:R.LightText}," / "+(0===t.checkout.shippingLines[0].finalPrice?i("checkout-page:free"):m(t.checkout.shippingLines[0].finalPrice,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),$=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:R.Footer},o.createElement("div",{className:R.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:R.FooterBullet},"•"),o.createElement("div",{className:R.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:R.FooterBullet},"•"),o.createElement("div",{className:R.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&!t.milesSmilesPaymentGateway&&o.createElement(o.Fragment,null,o.createElement("div",{className:R.FooterBullet},"•"),o.createElement("div",{className:R.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:R.FooterBullet},"•"),o.createElement("div",{className:R.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),ee=i((function(i){var r,n,a,s=i.vm,c=i.setVisible,l=d().t,m=o.useState(!1),u=m[0],p=m[1],f=o.useState(!1),g=f[0],v=f[1],h=o.useState(new y({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];h.email=(null===(r=s.checkout.customer)||void 0===r?void 0:r.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 g?[2,c(!1)]:(p(!0),[4,h.saveContactForm()]);case 1:return e.sent()&&v(!0),p(!1),[2]}}))}))}),[u]);return o.createElement(k,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,g&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(w,{type:"success",title:l("checkout-page:contactFormSent"),content:l("checkout-page:contactFormDescription")})),o.createElement(I,{name:"message",type:A.TEXT_AREA,label:"",value:h.message||"",onChange:h.onMessageChange,textAreaPlaceholder:l("checkout-page:contactFormCta")}),o.createElement(L,{style:{width:"100%",marginTop:"24px"},text:l(g?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:u,isDisabled:!h.message,onClick:E})),onClose:function(){return c(!1)}})})),te=i((function(e){var t=e.vm,i=W(t),r=i.setActiveIndex,n=i.handlePrev,a=i.handleNext,s=i.activeIndex;return t.campaignOffers&&t.campaignOffers.length&&t.isCampaignOfferLoaded?o.createElement("div",{className:R.CampaignOfferMain},o.createElement("div",{className:R.OfferSlider},t.campaignOffers.map((function(e,i){var c;return o.createElement(D,{vm:t,campaignOffer:e,index:i,activeIndex:s,offersLength:(null===(c=t.campaignOffers)||void 0===c?void 0:c.length)||0,handlePrev:n,handleNext:a,setActiveIndex:function(e){return r(e)},desktopMiddlePhase:!0,step:t.step})}))),t.campaignOffers.length>1&&o.createElement(H,{handlePrev:n,handleNext:a}),t.campaignOffers.length>1&&o.createElement(G,{vm:t,activeIndex:s})):null})),oe=i((function(e){var t=e.vm,i=W(t),r=i.setActiveIndex,n=i.setIsActiveOverlay,a=i.handlePrev,s=i.handleNext,c=i.isPopupClosedIndexPage,l=i.isPopupShowIndexPage,m=i.activeIndex;return t.campaignOffers&&t.campaignOffers.length&&t.isCampaignOfferLoaded?o.createElement("div",{className:[R.CampaignOfferMain,l?R.OverlayPopupMain:""].join(" ")},o.createElement("div",{className:R.OfferSlider},t.campaignOffers.map((function(e,i){var d;return o.createElement(D,{vm:t,campaignOffer:e,index:i,activeIndex:m,offersLength:(null===(d=t.campaignOffers)||void 0===d?void 0:d.length)||0,handlePrev:a,handleNext:s,setActiveIndex:function(e){return r(e)},step:t.step,isPopupClosed:c,isPopupShow:l,closePopup:function(){return n(!1)},showPopup:function(){return n(!0)}})}))),t.campaignOffers.length>1&&o.createElement(H,{handlePrev:a,handleNext:s}),t.campaignOffers.length>1&&o.createElement(G,{isPopupShow:l,vm:t,activeIndex:m})):null}));export{Y as default};
@@ -16,9 +16,9 @@ import { LocalizedAddressModel } from "@ikas/localized-address";
16
16
  import { IkasOrderTransactionWithPrices, IkasStoreCreditBalance } from "@ikas/storefront-models";
17
17
  import { StripeExpressCheckoutAddressInput, StripeExpressCheckoutSessionContextResponse } from "@ikas/storefront-api/src/__api/types";
18
18
  /**
19
- * Approximate TRY value of one mile, used only for the on-screen "≈" hint.
20
- * The authoritative rate lives on the merchant's TK_PAY gateway settings and
21
- * is applied server-side when the miles are charged.
19
+ * Fallback TRY value of one mile, used only when the TK_PAY gateway settings
20
+ * don't expose a usable rate. The authoritative rate lives on those settings
21
+ * and is applied server-side when the miles are charged.
22
22
  */
23
23
  export declare const MILES_SMILES_RATE_PER_POINT: Record<string, number>;
24
24
  /** Error codes that mean "open the bind flow again". */
@@ -47,6 +47,8 @@ export default class CheckoutViewModel {
47
47
  cardData?: CreditCardData | null;
48
48
  paymentGateways: IkasPaymentGateway[];
49
49
  useMilesSmiles: boolean;
50
+ /** Miles&Smiles terms consent; FE only, reset whenever miles are toggled. */
51
+ isMilesSmilesTermsAccepted: boolean;
50
52
  milesToRedeem: number;
51
53
  isMilesSmilesLoginRequired: boolean;
52
54
  isMilesSmilesUnavailable: boolean;
@@ -83,6 +85,13 @@ export default class CheckoutViewModel {
83
85
  tkPayResponse: CreateTkPayCheckoutFormResponse | null;
84
86
  isTkPayLoading: boolean;
85
87
  showTkPayContainer: boolean;
88
+ /** Miles the current TK Pay form was created with (0 = none). */
89
+ private tkPayFormMiles;
90
+ /**
91
+ * Set once the hosted TK Pay form reports success. From then on the form
92
+ * must never be re-created: a new form re-arms the Miles leg on the backend.
93
+ */
94
+ isTkPayPaymentCompleted: boolean;
86
95
  stripeExpressCheckoutSessionResponse: CreateStripePaymentIntentResponse | null;
87
96
  isStripeExpressCheckoutSessionVisible: boolean;
88
97
  campaignOffers: CampaignOfferType[] | undefined;
@@ -116,6 +125,12 @@ export default class CheckoutViewModel {
116
125
  t: TFunction;
117
126
  constructor(checkout: IkasCheckout, checkoutSettings: IkasCheckoutSettings, router: NextRouter, returnPolicy: string, privacyPolicy: string, termsOfService: string, imprint: string, shippingPolicy: string, t: TFunction, customizationProps: IkasCheckoutCustomizationProps);
118
127
  init: () => Promise<void>;
128
+ /**
129
+ * Checkout loaded inside an iframe whose top window is this same store
130
+ * (e.g. the TK Pay callback): navigate the top window to this URL.
131
+ * The editor preview runs on another origin, so it is left alone.
132
+ */
133
+ private redirectTopIfInsideIframe;
119
134
  private waitForCountrySettingsOrFail;
120
135
  initStep: () => Promise<void>;
121
136
  getOpenEditOrderTransaction: () => Promise<void>;
@@ -165,8 +180,8 @@ export default class CheckoutViewModel {
165
180
  /** Merchant's TK_PAY gateway with Miles&Smiles enabled, if any. */
166
181
  get milesSmilesPaymentGateway(): IkasPaymentGateway | undefined;
167
182
  /**
168
- * TRY per mile for the on-screen estimate. Prefers a rate exposed on the
169
- * TK_PAY gateway settings, falls back to the static approximation.
183
+ * TRY per mile for the on-screen estimate. Prefers the per-1000-miles rate
184
+ * exposed on the TK_PAY gateway settings, falls back to the static default.
170
185
  */
171
186
  get milesSmilesRate(): number;
172
187
  get milesSmilesAvailableMiles(): number;
@@ -176,6 +191,14 @@ export default class CheckoutViewModel {
176
191
  get isMilesSmilesFullPayment(): boolean;
177
192
  get milesSmilesAppliedValue(): number;
178
193
  get milesSmilesAmountToPay(): number;
194
+ /** "Use all my miles" checkbox state: the max redeemable amount is entered. */
195
+ get isMilesSmilesAllMilesUsed(): boolean;
196
+ /**
197
+ * Nothing is left to pay before miles are applied (store credit / gift
198
+ * cards cover the cart). Unlike `isFree`, this stays false when the miles
199
+ * themselves cover the order, so the Miles block remains visible then.
200
+ */
201
+ get isMilesSmilesNothingToPay(): boolean;
179
202
  /** `milesSmiles` create-sale input, or undefined when miles are not applied. */
180
203
  get milesSmilesInput(): MilesSmilesPaymentInput | undefined;
181
204
  get store(): IkasBaseStore;
@@ -217,8 +240,15 @@ export default class CheckoutViewModel {
217
240
  * Miles block gate: TK_PAY gateway with `milesSmilesEnabled`, TRY cart and
218
241
  * no "feature unavailable" error from the payment service.
219
242
  */
243
+ /** Miles are entered but the Miles&Smiles terms are not accepted yet. */
244
+ get isMilesSmilesTermsMissing(): boolean;
220
245
  isMilesSmilesActive(): boolean;
221
246
  listPaymentGateways: () => Promise<void>;
247
+ /**
248
+ * Store credit / gift cards cover the cart: drop the Miles selection so the
249
+ * block comes back switched off once the balance is removed.
250
+ */
251
+ resetMilesSmilesIfNothingToPay: () => void;
222
252
  /**
223
253
  * Fetches the member balance for the payment step. Handles the
224
254
  * "linked but session expired" case by switching to the bind CTA.
@@ -234,9 +264,15 @@ export default class CheckoutViewModel {
234
264
  */
235
265
  startMilesSmilesBind: () => Promise<void>;
236
266
  setUseMilesSmiles: (value: boolean) => Promise<void>;
267
+ /** Terms consent checkbox: only records consent, the entered miles stay as is. */
268
+ setMilesSmilesTermsAccepted: (value: boolean) => void;
237
269
  setMilesToRedeem: (value: number) => void;
238
270
  /** Clamps the entered miles to what the UI may offer. */
239
271
  clampMilesToRedeem: () => Promise<void>;
272
+ /** Quick-pick chip: redeem exactly `value` miles. */
273
+ selectMilesSmilesChip: (value: number) => Promise<void>;
274
+ /** "Use all my miles" checkbox: redeem the max, or clear the amount. */
275
+ setUseAllMilesSmiles: (value: boolean) => Promise<void>;
240
276
  /**
241
277
  * TK_PAY hosted checkout form is created per amount; re-create it when the
242
278
  * miles selection changes so the form carries the right `milesSmiles`.
@@ -247,6 +283,11 @@ export default class CheckoutViewModel {
247
283
  * user-facing message when the failure belongs to the Miles leg.
248
284
  */
249
285
  private handleMilesSmilesSaleError;
286
+ /**
287
+ * Shared by create-sale and the TK Pay form: login-required codes switch
288
+ * the block to the reconnect CTA, unavailable codes hide it.
289
+ */
290
+ private handleMilesSmilesErrorCodes;
250
291
  getMilesSmilesErrorMessage: (code?: string | null) => string;
251
292
  retrieveInstallmentInfo: (params: RetrieveInstallmentInfoQueryParams) => Promise<void>;
252
293
  createCustomer: () => void;
@@ -258,6 +299,7 @@ export default class CheckoutViewModel {
258
299
  onStockLocationChange: (location: IkasStockLocation) => Promise<void>;
259
300
  onCouponCodeApply: (isAddingCoupon?: boolean) => Promise<void>;
260
301
  removeGiftCardLine: (giftCardId: string | null) => Promise<void>;
302
+ refreshCheckoutCart: () => Promise<boolean>;
261
303
  removeLoyaltyPointsFromCart: (loyaltySpendingMethodId: string) => Promise<void>;
262
304
  getAvailableShippingZones: () => Promise<void>;
263
305
  onSelectedShippingAddressIdChange: (value: string) => void;
@@ -304,6 +346,8 @@ export default class CheckoutViewModel {
304
346
  shippingZoneRateId?: string | null;
305
347
  }) => Promise<StripeExpressCheckoutSessionContextResponse | null>;
306
348
  setShowIyzicoContainer: (value: boolean) => void;
349
+ /** Hosted TK Pay form reported success: freeze the form, then go to success. */
350
+ onTkPayPaymentSuccess: (postCallback: () => Promise<void>) => Promise<void>;
307
351
  setShowTkPayContainer: (value: boolean) => void;
308
352
  setPaymentGateway: (index: number) => Promise<void>;
309
353
  updatePaymentGateway: (paymentGateway: IkasPaymentGateway) => Promise<boolean>;