@ikas/storefront 4.15.3 → 4.15.5

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 (24) hide show
  1. package/build/components/checkout/components/cart-summary/cart-item/index.d.ts +1 -0
  2. package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
  3. package/build/components/checkout/components/cart-summary/cart-item/style.module.scss.js +1 -1
  4. package/build/components/checkout/components/cart-summary/index.d.ts +1 -0
  5. package/build/components/checkout/components/cart-summary/index.js +1 -1
  6. package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
  7. package/build/components/checkout/components/expandable-section/style.module.scss.js +1 -1
  8. package/build/components/checkout/components/klarna/index.js +1 -1
  9. package/build/components/checkout/components/paypal/index.js +1 -1
  10. package/build/components/checkout/components/stripe/checkout-form.js +1 -1
  11. package/build/components/checkout/index.js +1 -1
  12. package/build/components/checkout/model.d.ts +6 -3
  13. package/build/components/checkout/model.js +1 -1
  14. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  15. package/build/components/checkout/steps/step-shipping/index.js +1 -1
  16. package/build/components/checkout/steps/step-success/index.js +1 -1
  17. package/build/components/page/head.d.ts +2 -0
  18. package/build/components/page/head.js +1 -1
  19. package/build/components/page/index.js +1 -1
  20. package/build/models/ui/product-list/index.js +1 -1
  21. package/build/models/ui/validator/form/register.js +1 -1
  22. package/build/store/checkout/index.d.ts +2 -2
  23. package/build/store/checkout/index.js +1 -1
  24. package/package.json +11 -11
@@ -7,6 +7,7 @@ declare type Props = {
7
7
  cartItem: IkasOrderLineItem;
8
8
  stockErrorItem?: IUnavailableItems;
9
9
  onChange?: (value: boolean) => void;
10
+ isSuccessPageSummary?: boolean;
10
11
  };
11
12
  export declare const CartItem: React.FC<Props>;
12
13
  export {};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/blog/category/index.js";import"../../../../../models/data/blog/content/index.js";import"../../../../../models/data/blog/meta-data/index.js";import"../../../../../models/data/blog/tag/index.js";import"../../../../../models/data/blog/index.js";import"../../../../../models/data/brand/index.js";import{IkasProductOptionType as a}from"@ikas/storefront-models";import"mobx";import"../../../../../models/data/campaign-offer/index.js";import"../../../../../models/data/cart/campaign-offer/index.js";import"../../../../../models/data/cart/index.js";import"../../../../../models/data/category/path-item/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/checkout-settings/index.js";import"../../../../../models/data/city/index.js";import"../../../../../models/data/country/index.js";import"../../../../../models/data/customer/address/region/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../../models/data/customer/attribute/index.js";import"../../../../../models/data/customer/review/summary/index.js";import"../../../../../models/data/customer/review/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/district/index.js";import"../../../../../models/data/favorite-product/index.js";import"../../../../../models/data/filter-category/index.js";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/order/address/region/index.js";import"../../../../../models/data/order/address/index.js";import"../../../../../models/data/order/line-item/option/value/index.js";import"../../../../../models/data/order/line-item/variant/value/index.js";import"../../../../../models/data/order/line-item/variant/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../models/data/order/package/index.js";import"../../../../../models/data/order/transaction/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/payment-gateway/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product/filter/index.js";import"../../../../../models/data/product/campaign-offer/index.js";import"../../../../../models/data/product/option-set/option/index.js";import"../../../../../models/data/product/option-set/index.js";import"../../../../../models/data/product/stock-location/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../../models/data/state/index.js";import"../../../../../models/data/theme-json/index.js";import"../../../../../models/data/theme-json/component/index.js";import"../../../../../models/data/theme-json/custom-data/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../../../../models/ui/blog-list/index.js";import"../../../../../models/ui/blog-category-list/index.js";import"../../../../../models/ui/brand-list/index.js";import"../../../../../models/ui/category-list/index.js";import"../../../../../models/ui/product-list/index.js";import"../../../../../models/ui/product-attribute-detail/index.js";import"../../../../../models/ui/product-attribute-list/index.js";import"../../../../../models/ui/customer-review-list/index.js";import"../../../../../models/ui/customer-review-summary-list/index.js";import"../../../../../models/ui/validator/index.js";import"../../../../../models/ui/validator/rules/index.js";import"../../../../../models/ui/validator/form/login.js";import"../../../../../models/ui/validator/form/address.js";import"../../../../../models/ui/validator/form/ikas-address.js";import"../../../../../models/ui/validator/form/register.js";import"../../../../../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{formatDate as o}from"../../../../../utils/helper.js";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../../utils/i18n.js";import{Modal as r}from"../../modal/index.js";import{BundleProductItem as s}from"./bundle-product-item/index.js";import m from"./svg/arrow-right.js";import d from"./svg/arrow-down.js";import n from"./style.module.scss.js";var l=t((function(t){var l,c,u,p;t.vm,t.currencyCode;var v=t.cartItem,j=t.stockErrorItem,x=t.onChange,f=i().t,g=!j,E=e.useRef(null),N=e.useState(0),h=N[0],y=N[1],b=e.useState(!1),k=b[0],C=b[1],O=e.useState(!1),P=O[0],w=O[1];e.useEffect((function(){if(E.current){var e=24;Array.from(E.current.children).map((function(t){return e=e+t.clientHeight+12})),y(e)}}),[]),e.useEffect((function(){E.current&&(E.current.style.maxHeight=P?"".concat(h,"px"):"0")}),[P]);var I=e.useMemo((function(){var t;return e.createElement("div",null,null===(t=v.options)||void 0===t?void 0:t.map((function(t){switch(t.type){case a.TEXT:case a.TEXT_AREA:case a.CHOICE:return e.createElement("div",{className:n.OptionRow},e.createElement("div",{className:n.OptionName},t.name),e.createElement("div",{className:n.OptionValue},t.values.map((function(e){return e.name||e.value})).join(", ")));case a.DATE_PICKER:return e.createElement("div",{className:n.OptionRow},e.createElement("div",{className:n.OptionName},t.name),e.createElement("div",{className:n.OptionValue},t.values.map((function(e){return t=e.value,(a=o(new Date(t)).split(" ")).splice(-1),a.join(" ");var t,a})).join(", ")));case a.FILE:return e.createElement("div",{className:n.OptionRow},e.createElement("div",{className:n.OptionName},t.name),e.createElement("div",{className:n.OptionValue},t.values.map((function(e){return t=e.value,decodeURIComponent(t.split("/")[t.split("/").length-1]);var t})).join(", ")));case a.CHECKBOX:return e.createElement("div",{className:n.OptionRow},e.createElement("div",{className:n.OptionName},t.name),e.createElement("div",{className:n.OptionValue},t.values.length&&"true"===t.values[0].value?f("checkout-page:yes"):f("checkout-page:no")));case a.COLOR_PICKER:return e.createElement("div",{className:n.OptionRow},e.createElement("div",{className:n.OptionName},t.name),e.createElement("div",{className:n.OptionsHorContainer},t.values.map((function(t,a){return e.createElement("div",{key:a,className:n.OptionColorValue,style:{backgroundColor:t.value}})}))))}})))}),[]),R=[n.BundleProductsContainer,P?n.VisibleBundleProducts:""].join(" ");return e.createElement(e.Fragment,null,e.createElement("div",{className:n.CheckoutItem},e.createElement("div",{className:n.ImageContainer},e.createElement("img",{className:n.Image,src:null===(l=v.variant.mainImage)||void 0===l?void 0:l.thumbnailSrc}),e.createElement("div",{className:n.QuantityCircle},v.quantity)),e.createElement("div",{className:n.Center},!!j&&e.createElement("div",{className:n.StockErrorItemMain},e.createElement("span",null,v.quantity," ",f("checkout-page:quantity")),e.createElement("span",null,e.createElement(m,null)),e.createElement("span",null,j.stockCount<0?0:j.stockCount," ",f("checkout-page:quantity"))),e.createElement("div",{className:n.Name},v.variant.name),e.createElement("div",{className:[n.LightText,n.Small].join(" ")},null===(c=v.variant.variantValues)||void 0===c?void 0:c.map((function(e){return e.variantValueName})).join(" / ")),!!(null===(u=v.options)||void 0===u?void 0:u.length)&&e.createElement("div",{className:n.OptionsText,onClick:function(){return C(!0)}},f("checkout-page:customizedProduct")),v.variant.bundleProducts&&0!==v.variant.bundleProducts.length&&e.createElement("div",{className:n.BundleProducts,onClick:function(){w(!P),x&&setTimeout((function(){x(!P)}),200)}},f("checkout-page:bundleProductsQuantity",{value:v.variant.bundleProducts.length}),e.createElement("span",{style:{paddingTop:2,transform:P?void 0:"rotate(180deg)"}},e.createElement(d,null))),!!k&&e.createElement(r,{title:v.variant.name,modalContent:I,onClose:function(){return C(!1)}})),g&&e.createElement("div",{className:n.Right},e.createElement("div",{className:n.Price},!!v.overridenPriceWithQuantity&&e.createElement("span",{className:n.GrayPrice},v.formattedOverridenPriceWithQuantity),v.formattedFinalPriceWithQuantity),v.unitPriceText&&e.createElement("div",{className:[n.LightText,n.Small].join(" ")},v.unitPriceText))),e.createElement("div",{ref:E,className:R},null===(p=v.variant.bundleProducts)||void 0===p?void 0:p.map((function(t){return e.createElement(s,{bundleProduct:t})}))))}));export{l as CartItem};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/blog/category/index.js";import"../../../../../models/data/blog/content/index.js";import"../../../../../models/data/blog/meta-data/index.js";import"../../../../../models/data/blog/tag/index.js";import"../../../../../models/data/blog/index.js";import"../../../../../models/data/brand/index.js";import{IkasProductOptionType as a}from"@ikas/storefront-models";import"mobx";import"../../../../../models/data/campaign-offer/index.js";import"../../../../../models/data/cart/campaign-offer/index.js";import"../../../../../models/data/cart/index.js";import"../../../../../models/data/category/path-item/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/checkout-settings/index.js";import"../../../../../models/data/city/index.js";import"../../../../../models/data/country/index.js";import"../../../../../models/data/customer/address/region/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../../models/data/customer/attribute/index.js";import"../../../../../models/data/customer/review/summary/index.js";import"../../../../../models/data/customer/review/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/district/index.js";import"../../../../../models/data/favorite-product/index.js";import"../../../../../models/data/filter-category/index.js";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/order/address/region/index.js";import"../../../../../models/data/order/address/index.js";import"../../../../../models/data/order/line-item/option/value/index.js";import"../../../../../models/data/order/line-item/variant/value/index.js";import"../../../../../models/data/order/line-item/variant/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../models/data/order/package/index.js";import"../../../../../models/data/order/transaction/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/payment-gateway/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product/filter/index.js";import"../../../../../models/data/product/campaign-offer/index.js";import"../../../../../models/data/product/option-set/option/index.js";import"../../../../../models/data/product/option-set/index.js";import"../../../../../models/data/product/stock-location/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../../models/data/state/index.js";import"../../../../../models/data/theme-json/index.js";import"../../../../../models/data/theme-json/component/index.js";import"../../../../../models/data/theme-json/custom-data/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../../../../models/ui/blog-list/index.js";import"../../../../../models/ui/blog-category-list/index.js";import"../../../../../models/ui/brand-list/index.js";import"../../../../../models/ui/category-list/index.js";import"../../../../../models/ui/product-list/index.js";import"../../../../../models/ui/product-attribute-detail/index.js";import"../../../../../models/ui/product-attribute-list/index.js";import"../../../../../models/ui/customer-review-list/index.js";import"../../../../../models/ui/customer-review-summary-list/index.js";import"../../../../../models/ui/validator/index.js";import"../../../../../models/ui/validator/rules/index.js";import"../../../../../models/ui/validator/form/login.js";import"../../../../../models/ui/validator/form/address.js";import"../../../../../models/ui/validator/form/ikas-address.js";import"../../../../../models/ui/validator/form/register.js";import"../../../../../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{formatDate as i}from"../../../../../utils/helper.js";import"@ikas/storefront-config";import{useTranslation as o}from"../../../../../utils/i18n.js";import{Modal as r}from"../../modal/index.js";import{BundleProductItem as s}from"./bundle-product-item/index.js";import m from"./svg/arrow-right.js";import n from"./svg/arrow-down.js";import d from"./style.module.scss.js";var l=t((function(t){var l,c,u,p;t.vm,t.currencyCode;var v=t.cartItem,j=t.stockErrorItem,x=t.onChange,f=t.isSuccessPageSummary,g=o().t,E=!j,N=e.useRef(null),h=e.useState(0),y=h[0],P=h[1],b=e.useState(!1),C=b[0],k=b[1],O=e.useState(!1),w=O[0],T=O[1];e.useEffect((function(){if(N.current){var e=24;Array.from(N.current.children).map((function(t){return e=e+t.clientHeight+12})),P(e)}}),[]),e.useEffect((function(){N.current&&(N.current.style.maxHeight=w?"".concat(y,"px"):"0")}),[w]);var I=e.useMemo((function(){var t;return e.createElement("div",null,null===(t=v.options)||void 0===t?void 0:t.map((function(t){switch(t.type){case a.TEXT:case a.TEXT_AREA:case a.CHOICE:return e.createElement("div",{className:d.OptionRow},e.createElement("div",{className:d.OptionName},t.name),e.createElement("div",{className:d.OptionValue},t.values.map((function(e){return e.name||e.value})).join(", ")));case a.DATE_PICKER:return e.createElement("div",{className:d.OptionRow},e.createElement("div",{className:d.OptionName},t.name),e.createElement("div",{className:d.OptionValue},t.values.map((function(e){return t=e.value,(a=i(new Date(t)).split(" ")).splice(-1),a.join(" ");var t,a})).join(", ")));case a.FILE:return e.createElement("div",{className:d.OptionRow},e.createElement("div",{className:d.OptionName},t.name),e.createElement("div",{className:d.OptionValue},t.values.map((function(e){return t=e.value,decodeURIComponent(t.split("/")[t.split("/").length-1]);var t})).join(", ")));case a.CHECKBOX:return e.createElement("div",{className:d.OptionRow},e.createElement("div",{className:d.OptionName},t.name),e.createElement("div",{className:d.OptionValue},t.values.length&&"true"===t.values[0].value?g("checkout-page:yes"):g("checkout-page:no")));case a.COLOR_PICKER:return e.createElement("div",{className:d.OptionRow},e.createElement("div",{className:d.OptionName},t.name),e.createElement("div",{className:d.OptionsHorContainer},t.values.map((function(t,a){return e.createElement("div",{key:a,className:d.OptionColorValue,style:{backgroundColor:t.value}})}))))}})))}),[]),R=[d.BundleProductsContainer,w?d.VisibleBundleProducts:""].join(" ");return e.createElement(e.Fragment,null,e.createElement("div",{className:d.CheckoutItem},e.createElement("div",{className:[d.ImageContainer,f?d.SuccessPageImageContainer:""].join(" ")},e.createElement("img",{className:d.Image,src:null===(l=v.variant.mainImage)||void 0===l?void 0:l.thumbnailSrc}),e.createElement("div",{className:d.QuantityCircle},v.quantity)),e.createElement("div",{className:d.Center},!!j&&e.createElement("div",{className:d.StockErrorItemMain},e.createElement("span",null,v.quantity," ",g("checkout-page:quantity")),e.createElement("span",null,e.createElement(m,null)),e.createElement("span",null,j.stockCount<0?0:j.stockCount," ",g("checkout-page:quantity"))),e.createElement("div",{className:[d.Name,f?d.SuccessPageName:""].join(" ")},v.variant.name),e.createElement("div",{className:[d.LightText,f?"":d.Small].join(" ")},null===(c=v.variant.variantValues)||void 0===c?void 0:c.map((function(e){return e.variantValueName})).join(" / ")),!!f&&E&&e.createElement("div",{className:[d.Right,f?d.SuccessPagePriceMain:""].join(" ")},e.createElement("div",{className:d.Price},!!v.overridenPriceWithQuantity&&e.createElement("span",{className:d.GrayPrice},v.formattedOverridenPriceWithQuantity),e.createElement("span",{className:d.FinalPrice},v.formattedFinalPriceWithQuantity)),v.unitPriceText&&e.createElement("div",{className:[d.LightText,d.Small].join(" ")},v.unitPriceText)),!!(null===(u=v.options)||void 0===u?void 0:u.length)&&e.createElement("div",{className:d.OptionsText,onClick:function(){return k(!0)}},g("checkout-page:customizedProduct")),v.variant.bundleProducts&&0!==v.variant.bundleProducts.length&&e.createElement("div",{className:d.BundleProducts,onClick:function(){T(!w),x&&setTimeout((function(){x(!w)}),200)}},g("checkout-page:bundleProductsQuantity",{value:v.variant.bundleProducts.length}),e.createElement("span",{style:{paddingTop:2,transform:w?void 0:"rotate(180deg)"}},e.createElement(n,null))),!!C&&e.createElement(r,{title:v.variant.name,modalContent:I,onClose:function(){return k(!1)}})),E&&!f&&e.createElement("div",{className:d.Right},e.createElement("div",{className:d.Price},!!v.overridenPriceWithQuantity&&e.createElement("span",{className:d.GrayPrice},v.formattedOverridenPriceWithQuantity),v.formattedFinalPriceWithQuantity),v.unitPriceText&&e.createElement("div",{className:[d.LightText,d.Small].join(" ")},v.unitPriceText))),e.createElement("div",{ref:N,className:R},null===(p=v.variant.bundleProducts)||void 0===p?void 0:p.map((function(t){return e.createElement(s,{bundleProduct:t})}))))}));export{l as CartItem};
@@ -1 +1 @@
1
- import e from'./../../../../../ext/style-inject/dist/style-inject.es.js';var t={CheckoutItem:"style-module_CheckoutItem__DaU-Y",ImageContainer:"style-module_ImageContainer__Nr1VF",Image:"style-module_Image__EskwT",QuantityCircle:"style-module_QuantityCircle__sv1mk",Center:"style-module_Center__ZOloc",StockErrorItemMain:"style-module_StockErrorItemMain__RprLM",Name:"style-module_Name__z-5-n",OptionsText:"style-module_OptionsText__7Gcy6",BundleProducts:"style-module_BundleProducts__fbCWu",Right:"style-module_Right__WoFoc",Price:"style-module_Price__4WmJv",GrayPrice:"style-module_GrayPrice__Gtch1",LightText:"style-module_LightText__uO43H",Small:"style-module_Small__peZjv",OptionRow:"style-module_OptionRow__lt6CJ",OptionName:"style-module_OptionName__09oij",OptionValue:"style-module_OptionValue__4fCYP",OptionsHorContainer:"style-module_OptionsHorContainer__eTmOO",OptionColorValue:"style-module_OptionColorValue__oNEyN",BundleProductsContainer:"style-module_BundleProductsContainer__em-6w",VisibleBundleProducts:"style-module_VisibleBundleProducts__YwXXL"};e(".style-module_CheckoutItem__DaU-Y {\n display: flex;\n width: 100%;\n margin-bottom: 24px;\n}\n.style-module_CheckoutItem__DaU-Y:last-child {\n margin-bottom: 0;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF {\n flex: 0 0 auto;\n width: 80px;\n height: 74px;\n position: relative;\n padding-right: 16px;\n overflow: hidden;\n padding-top: 10px;\n}\n@media only screen and (max-width: 375px) {\n .style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF {\n width: 72px;\n height: 66px;\n }\n}\n.style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF .style-module_Image__EskwT {\n object-fit: contain;\n border-radius: 8px;\n width: 64px;\n height: 64px;\n}\n@media only screen and (max-width: 375px) {\n .style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF .style-module_Image__EskwT {\n width: 56px;\n height: 56px;\n }\n}\n.style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF .style-module_QuantityCircle__sv1mk {\n width: 20px;\n height: 20px;\n border-radius: 10px;\n background-color: var(--checkout-button-bg-color);\n color: var(--checkout-button-text-color);\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 12px;\n font-weight: 500;\n position: absolute;\n top: 0px;\n right: 8px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc {\n position: relative;\n flex: 1 1 auto;\n padding-top: 10px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_StockErrorItemMain__RprLM {\n display: flex;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_StockErrorItemMain__RprLM span {\n margin-right: 6px;\n font-size: 14px;\n font-weight: 500;\n text-transform: lowercase;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_StockErrorItemMain__RprLM span:first-child {\n color: var(--checkout-button-disabled-text-color);\n text-decoration-line: line-through;\n font-weight: 400;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_Name__z-5-n {\n font-size: 14px;\n font-weight: 600;\n color: var(--checkout-primary-text-color);\n line-height: 20px;\n max-height: 40px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_OptionsText__7Gcy6 {\n font-size: 12px;\n color: var(--checkout-primary-text-color);\n line-height: 16px;\n margin-top: 2px;\n user-select: none;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_OptionsText__7Gcy6:hover {\n cursor: pointer;\n text-decoration: underline;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_BundleProducts__fbCWu {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 12px;\n color: #6f55ff;\n line-height: 16px;\n cursor: pointer;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Right__WoFoc {\n flex: 0 0 auto;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n padding-left: 12px;\n padding-top: 10px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Right__WoFoc .style-module_Price__4WmJv {\n font-size: 14px;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n color: var(--checkout-primary-text-color);\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Right__WoFoc .style-module_GrayPrice__Gtch1 {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n text-decoration: line-through;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_LightText__uO43H {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n line-height: 20px;\n margin-top: 2px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_LightText__uO43H.style-module_Small__peZjv {\n font-size: 12px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ {\n display: flex;\n flex-direction: column;\n margin-bottom: 24px;\n max-width: 400px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionName__09oij {\n font-size: 14px;\n color: var(--checkout-primary-text-color);\n margin-right: 8px;\n font-weight: 500;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionValue__4fCYP {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionsHorContainer__eTmOO {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionColorValue__oNEyN {\n width: 24px;\n height: 24px;\n border-radius: 4px;\n margin-right: 4px;\n}\n\n.style-module_BundleProductsContainer__em-6w {\n margin-left: 32px;\n padding-left: 24px;\n border-left: 1px solid var(--checkout-border-color);\n margin-top: -8px;\n overflow: hidden;\n max-height: 0;\n transition: max-height 0.2s ease;\n}\n.style-module_BundleProductsContainer__em-6w.style-module_VisibleBundleProducts__YwXXL {\n max-height: 1000px;\n margin-bottom: 24px;\n}");export{t as default};
1
+ import e from'./../../../../../ext/style-inject/dist/style-inject.es.js';var t={CheckoutItem:"style-module_CheckoutItem__DaU-Y",ImageContainer:"style-module_ImageContainer__Nr1VF",Image:"style-module_Image__EskwT",QuantityCircle:"style-module_QuantityCircle__sv1mk",SuccessPageImageContainer:"style-module_SuccessPageImageContainer__Bzs7z",Center:"style-module_Center__ZOloc",StockErrorItemMain:"style-module_StockErrorItemMain__RprLM",Name:"style-module_Name__z-5-n",SuccessPageName:"style-module_SuccessPageName__N9QRQ",OptionsText:"style-module_OptionsText__7Gcy6",BundleProducts:"style-module_BundleProducts__fbCWu",Right:"style-module_Right__WoFoc",Price:"style-module_Price__4WmJv",GrayPrice:"style-module_GrayPrice__Gtch1",SuccessPagePriceMain:"style-module_SuccessPagePriceMain__Zl1lq",FinalPrice:"style-module_FinalPrice__beHZg",LightText:"style-module_LightText__uO43H",Small:"style-module_Small__peZjv",OptionRow:"style-module_OptionRow__lt6CJ",OptionName:"style-module_OptionName__09oij",OptionValue:"style-module_OptionValue__4fCYP",OptionsHorContainer:"style-module_OptionsHorContainer__eTmOO",OptionColorValue:"style-module_OptionColorValue__oNEyN",BundleProductsContainer:"style-module_BundleProductsContainer__em-6w",VisibleBundleProducts:"style-module_VisibleBundleProducts__YwXXL"};e(".style-module_CheckoutItem__DaU-Y {\n display: flex;\n width: 100%;\n margin-bottom: 24px;\n}\n.style-module_CheckoutItem__DaU-Y:last-child {\n margin-bottom: 0;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF {\n flex: 0 0 auto;\n width: 80px;\n height: 74px;\n position: relative;\n padding-right: 16px;\n overflow: hidden;\n padding-top: 10px;\n}\n@media only screen and (max-width: 375px) {\n .style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF {\n width: 72px;\n height: 66px;\n }\n}\n.style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF .style-module_Image__EskwT {\n object-fit: contain;\n border-radius: 8px;\n width: 64px;\n height: 64px;\n}\n@media only screen and (max-width: 375px) {\n .style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF .style-module_Image__EskwT {\n width: 56px;\n height: 56px;\n }\n}\n.style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF .style-module_QuantityCircle__sv1mk {\n width: 20px;\n height: 20px;\n border-radius: 10px;\n background-color: var(--checkout-button-bg-color);\n color: var(--checkout-button-text-color);\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 12px;\n font-weight: 500;\n position: absolute;\n top: 0px;\n right: 8px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_SuccessPageImageContainer__Bzs7z {\n overflow: unset;\n width: unset;\n height: unset;\n padding-top: 8px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_SuccessPageImageContainer__Bzs7z .style-module_Image__EskwT {\n object-fit: contain;\n border-radius: 4px;\n width: 72px;\n height: 72px;\n border: 1px solid var(--checkout-border-color);\n}\n@media only screen and (max-width: 375px) {\n .style-module_CheckoutItem__DaU-Y .style-module_SuccessPageImageContainer__Bzs7z .style-module_Image__EskwT {\n width: 56px;\n height: 56px;\n }\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc {\n position: relative;\n flex: 1 1 auto;\n padding-top: 10px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_StockErrorItemMain__RprLM {\n display: flex;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_StockErrorItemMain__RprLM span {\n margin-right: 6px;\n font-size: 14px;\n font-weight: 500;\n text-transform: lowercase;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_StockErrorItemMain__RprLM span:first-child {\n color: var(--checkout-button-disabled-text-color);\n text-decoration-line: line-through;\n font-weight: 400;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_Name__z-5-n {\n font-size: 14px;\n font-weight: 600;\n color: var(--checkout-primary-text-color);\n line-height: 20px;\n max-height: 40px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_SuccessPageName__N9QRQ {\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n max-height: unset;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_OptionsText__7Gcy6 {\n font-size: 12px;\n color: var(--checkout-primary-text-color);\n line-height: 16px;\n margin-top: 2px;\n user-select: none;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_OptionsText__7Gcy6:hover {\n cursor: pointer;\n text-decoration: underline;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_BundleProducts__fbCWu {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 12px;\n color: #6f55ff;\n line-height: 16px;\n cursor: pointer;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Right__WoFoc {\n flex: 0 0 auto;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n padding-left: 12px;\n padding-top: 10px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Right__WoFoc .style-module_Price__4WmJv {\n font-size: 14px;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n color: var(--checkout-primary-text-color);\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Right__WoFoc .style-module_GrayPrice__Gtch1 {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n text-decoration: line-through;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_SuccessPagePriceMain__Zl1lq {\n align-items: flex-start;\n padding: 0;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_SuccessPagePriceMain__Zl1lq .style-module_Price__4WmJv {\n flex-direction: row;\n align-items: flex-start;\n column-gap: 8px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_SuccessPagePriceMain__Zl1lq .style-module_Price__4WmJv .style-module_FinalPrice__beHZg {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n}\n.style-module_CheckoutItem__DaU-Y .style-module_LightText__uO43H {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n line-height: 20px;\n margin-top: 2px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_LightText__uO43H.style-module_Small__peZjv {\n font-size: 12px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ {\n display: flex;\n flex-direction: column;\n margin-bottom: 24px;\n max-width: 400px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionName__09oij {\n font-size: 14px;\n color: var(--checkout-primary-text-color);\n margin-right: 8px;\n font-weight: 500;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionValue__4fCYP {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionsHorContainer__eTmOO {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionColorValue__oNEyN {\n width: 24px;\n height: 24px;\n border-radius: 4px;\n margin-right: 4px;\n}\n\n.style-module_BundleProductsContainer__em-6w {\n margin-left: 32px;\n padding-left: 24px;\n border-left: 1px solid var(--checkout-border-color);\n margin-top: -8px;\n overflow: hidden;\n max-height: 0;\n transition: max-height 0.2s ease;\n}\n.style-module_BundleProductsContainer__em-6w.style-module_VisibleBundleProducts__YwXXL {\n max-height: 1000px;\n margin-bottom: 24px;\n}");export{t as default};
@@ -3,6 +3,7 @@ import CheckoutViewModel from "../../model";
3
3
  declare type Props = {
4
4
  vm: CheckoutViewModel;
5
5
  allowExpand?: boolean;
6
+ isSuccessPageSummary?: boolean;
6
7
  };
7
8
  export declare enum CouponErrorCode {
8
9
  COUPON_CODE_NOT_EXIST = "COUPON_CODE_NOT_EXIST",
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as n}from"mobx-react-lite";import a from"lodash/sortBy";import c from"../input-with-button/index.js";import l from"../notification-box/index.js";import{CheckoutStep as r}from"../../model.js";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{formatCurrency as u}from"../../../../utils/currency.js";import{useTranslation as s}from"../../../../utils/i18n.js";import{CartItem as m}from"./cart-item/index.js";import{FormItem as d}from"../form-item/index.js";import{FormItemType as p}from"../form-item/model.js";import E from"../tooltip/index.js";import C from"../svg/arrow-down.js";import h from"../svg/cross.js";import v from"../svg/gift.js";import f from"../../styles/common.module.scss.js";import g from"./style.module.scss.js";import k from"../svg/ikas.js";import{Button as N}from"../button/index.js";var y;!function(e){e.COUPON_CODE_NOT_EXIST="COUPON_CODE_NOT_EXIST",e.COUPON_CODE_NOT_EXIST_FOR_GUESS="COUPON_CODE_NOT_EXIST_FOR_GUESS"}(y||(y={}));var S=n((function(e){var t,n,a=e.vm,c=e.allowExpand,d=a.checkout,p=s().t,E=o.useState(!c),h=E[0],v=E[1],f=o.useState(!1),N=f[0],S=f[1],P=o.useState(null),_=P[0],I=P[1],A=o.useState(0),w=A[0],R=A[1],D=o.useState(null),L=D[0],U=D[1],B=o.useState(!1),F=B[0],M=B[1],V=o.useState(!1),X=V[0],G=V[1],q=o.useState(!1),H=q[0],z=q[1];o.useEffect((function(){c&&(h?L&&R(L.getBoundingClientRect().height):R(0))}),[h,L,c,F,X,N,H]);var $=o.useMemo((function(){switch(_){case y.COUPON_CODE_NOT_EXIST:return p("checkout-page:giftCodeErrorDescription");case y.COUPON_CODE_NOT_EXIST_FOR_GUESS:return p("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[_]),Q=[g.CartSummary,c?g.HideOnDesktop:""].join(" "),J=c?{height:w+"px"}:void 0,K=[g.ArrowDown,h?g.Rotated:""].join(" ");return d?o.createElement(o.Fragment,null,!!c&&o.createElement(o.Fragment,null,o.createElement("div",{id:"checkout-mobile-summary-header"}),o.createElement("div",{className:g.ExpandHeader,onClick:function(){if(!h){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}v(!h)}},o.createElement("div",{className:g.Left},p("checkout-page:summary")),o.createElement("div",{className:g.Price},o.createElement("span",{className:g.PriceText},"".concat(u(a.finalPrice||0,d.currencyCode,d.currencySymbol)," (").concat(d.itemQuantity," ").concat(p("checkout-page:cartItemProduct"),")")),o.createElement("span",{className:K},o.createElement(C,null))))),o.createElement("div",{className:Q},o.createElement("div",{className:g.DetailsContainer,style:J},o.createElement("div",{className:g.Details,ref:U},o.createElement("div",{className:g.ItemsContainer},o.createElement("div",null,d.items.map((function(e,t){return o.createElement(m,{key:t,vm:a,cartItem:e,currencyCode:d.currencyCode,onChange:z})})))),o.createElement("div",{className:g.Divider}),o.createElement("div",{className:g.SubTotalInfo},N&&o.createElement("div",{className:g.NotificationContainer},o.createElement(l,{type:"warning",title:p("checkout-page:giftCodeErrorTitle"),content:$,onClose:function(){S(!1),I(null)}})),o.createElement(T,{label:p("checkout-page:subtotal"),value:d.formattedTotalPrice,tooltipText:p("checkout-page:subtotalTooltip"),hideMarginBottom:!a.isCouponCodeVisible}),!!(null===(t=d.shippingLines)||void 0===t?void 0:t.length)&&o.createElement(T,{label:p("checkout-page:cartShippingTitle"),value:d.shippingTotal?d.formattedShippingTotal:p("checkout-page:free")}),!!a.installmentExtraPrice&&o.createElement(T,{label:p("checkout-page:cartInterest"),value:u(a.installmentExtraPrice,d.currencyCode,d.currencySymbol)}),o.createElement(b,{vm:a}),o.createElement(x,{vm:a}),(a.step===r.SUCCESS&&(!!a.checkout.note||!!a.checkout.appliedCouponCode)||a.step!==r.SUCCESS)&&a.isCouponCodeVisible&&o.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement(O,{vm:a,isAddingCoupon:X,setAddingCoupon:G,setCouponError:S,setCouponErrorCode:I}),o.createElement(j,{vm:a,isAddingNote:F,setAddingNote:M})),o.createElement("div",{className:g.TotalContainer},o.createElement("div",{className:g.TitleContainer},o.createElement("div",{className:g.Title},p("checkout-page:total"))),o.createElement("div",null,o.createElement("div",{className:g.TotalPricesContainer},o.createElement("div",{className:g.TotalPrice},u(a.finalPrice||0,d.currencyCode,d.currencySymbol)),!!d.$totalTax&&!!(null===(n=a.customizationProps)||void 0===n?void 0:n.showTax)&&o.createElement("div",{className:[g.TotalTax].join(" ")},p("checkout-page:cartTaxTitle")+" "+d.$formattedTotalTax)))),o.createElement("div",{className:g.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(k,null))))))):null})),T=n((function(e){var t=e.label,n=e.value,a=e.tooltipText,c=e.hideMarginBottom;return o.createElement("div",{className:[g.InfoRow,c?g.hideMb:""].join(" ")},o.createElement("div",{className:g.Label},o.createElement("span",null,t),!!a&&o.createElement(E,{text:a,style:{marginLeft:"8px"}})),o.createElement("div",{className:g.Value},n))})),b=n((function(e){var t=e.vm,n=s().t;return t.checkout?o.createElement(o.Fragment,null,a(t.checkout.nonCouponAdjustments||[],"order").map((function(e,a){return o.createElement("div",{className:g.InfoRow,key:a},o.createElement("div",{className:g.Label},"INTEREST"===e.name?n("checkout-page:cartInterest"):e.name),o.createElement("div",{className:g.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,u(e.amount,t.checkout.currencyCode,t.checkout.currencySymbol))))}))):null})),x=n((function(e){var t,n,a=e.vm,c=s().t;return a.checkout?o.createElement(o.Fragment,null,a.step!==r.SUCCESS&&((null===(t=a.checkout.selectedPaymentGateway)||void 0===t?void 0:t.getCalculatedAdditionalPrices(a.checkout.totalFinalPrice||0,a.checkout.shippingLines||null))||[]).filter((function(e){return 0!==e.amount})).map((function(e,t){return o.createElement("div",{className:g.InfoRow,key:t},o.createElement("div",{className:g.Label},e.name),o.createElement("div",{className:g.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,u(e.amount,a.checkout.currencyCode,a.checkout.currencySymbol))))})),null===(n=a.checkout.giftPackageLines)||void 0===n?void 0:n.map((function(e,t){return o.createElement("div",{className:g.InfoRow,key:t},o.createElement("div",{className:g.Label},o.createElement("div",{className:g.GiftLabel},o.createElement(v,{style:{position:"relative",top:"-1px"}}),o.createElement("span",null,c("checkout-page:giftPackage")))),o.createElement("div",{className:g.Value},o.createElement("span",null,u(e.price,a.checkout.currencyCode,a.checkout.currencySymbol))))}))):null})),O=n((function(n){var a=n.vm,l=n.isAddingCoupon,i=n.setAddingCoupon,m=n.setCouponError,E=n.setCouponErrorCode,C=n.isOpenCouponCode,v=s().t,k=o.useState(""),y=k[0],S=k[1],T=o.useState(!1),b=T[0],x=T[1],O=o.useRef(null);o.useEffect((function(){l&&O.current&&O.current.focus()}),[l]);var j=function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=y,x(!0),[4,a.onCouponCodeApply()];case 1:return e.sent(),x(!1),S(""),!a.checkout.appliedCouponCode||a.couponError?[3,3]:(i(!1),m(!1),E(null),[4,a.reInitPaymentMethod()]);case 2:return e.sent(),[3,4];case 3:a.checkout.couponCode=null,m(!0),E(a.couponError),e.label=4;case 4:return[2]}}))}))},P=function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=null,x(!0),[4,a.onCouponCodeApply()];case 1:return e.sent(),[4,a.reInitPaymentMethod()];case 2:return e.sent(),x(!1),[2]}}))}))},_=a.step===r.SUCCESS,I=a.step===r.SHIPPING;if(_&&!a.checkout.appliedCouponCode)return null;var A=a.checkout.couponAdjustment,w=!(!a.checkout.appliedCouponCode||l),R=!!a.checkout.appliedCouponCode&&C;return o.createElement(o.Fragment,null,!!C&&o.createElement(o.Fragment,null,o.createElement("div",{className:[g.CartSummary,g.OpenCouponCodeSummary].join(" ")},o.createElement("div",{className:f.FormSectionTitle},o.createElement("div",{style:{paddingBottom:R?0:6},className:f.Title},v("checkout-page:couponCode")),R&&o.createElement("div",{className:[g.ActionTextBtn,g.NoUnderline,g.Light].join(" ")},o.createElement("span",{className:[g.AppliedCoupon,g.AppliedCouponBgGray].join(" ")},o.createElement("span",{className:g.CouponCode},a.checkout.appliedCouponCode),!_&&o.createElement("span",{className:g.ClearCoupon,onClick:P},o.createElement(h,null))))))),w&&!I&&!a.isCouponCodeRequirementDefult&&o.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement("div",{className:g.InfoRow},!a.checkout.appliedCouponCode&&!l&&a.isCouponCodeVisible&&o.createElement("div",{className:g.ActionTextBtn,onClick:function(){return i(!0)}},v("checkout-page:addCouponCode")),l&&!C&&o.createElement(c,{value:y,placeholder:v("checkout-page:couponCode"),buttonLabel:v("checkout-page:actions.apply"),inputRef:O,onClick:j,isLoading:b,onChange:S}),C&&!R&&o.createElement("div",{className:g.OpenCouponCodeMain},o.createElement(d,{label:v("checkout-page:couponCode"),type:p.TEXT,value:y,onChange:S}),o.createElement(N,{style:{width:"33%"},text:v("checkout-page:actions.apply"),isLoading:b,onClick:j})),w&&o.createElement("div",{className:[g.ActionTextBtn,g.NoUnderline,g.Light].join(" ")},v("checkout-page:couponCode"),o.createElement("span",{className:[g.AppliedCoupon,a.isCouponCodeRequirementDefult?"":g.NotClosed].join(" ")},o.createElement("span",{className:g.CouponCode},a.checkout.appliedCouponCode),a.step!==r.SUCCESS&&a.isCouponCodeRequirementDefult&&o.createElement("span",{className:g.ClearCoupon,onClick:P},o.createElement(h,null)))),w&&o.createElement("div",{className:g.Value},o.createElement("span",null,"DECREMENT"===(null==A?void 0:A.type)?"- ":"")," ",o.createElement("span",null,u((null==A?void 0:A.amount)||0,a.checkout.currencyCode,a.checkout.currencySymbol)))))})),j=n((function(e){var t=e.vm,n=e.isAddingNote,a=e.setAddingNote,c=s().t,l=o.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=o.useCallback((function(){a(!0)}),[]),u=o.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===r.SUCCESS;return m&&!t.checkout.note?null:o.createElement("div",{className:g.InfoRow},!n&&!m&&o.createElement("div",{className:g.ActionTextBtn,onClick:i},l),(n||m)&&o.createElement("div",{className:[g.CheckoutNoteContainer,m?g.Success:""].join(" ")},o.createElement("div",{className:g.Title},c("checkout-page:orderNote")),m?o.createElement("div",{className:g.CheckoutNoteDisplay},t.checkout.note):o.createElement(d,{style:{width:"100%"},type:p.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:u,maxLength:320})))}));export{S as CartSummary,O as Coupon,y as CouponErrorCode};
1
+ import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as n from"react";import{observer as o}from"mobx-react-lite";import a from"lodash/sortBy";import c from"../input-with-button/index.js";import l from"../notification-box/index.js";import{CheckoutStep as r}from"../../model.js";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{formatCurrency as u}from"../../../../utils/currency.js";import{useTranslation as s}from"../../../../utils/i18n.js";import{CartItem as m}from"./cart-item/index.js";import{FormItem as d}from"../form-item/index.js";import{FormItemType as p}from"../form-item/model.js";import E from"../tooltip/index.js";import C from"../svg/arrow-down.js";import h from"../svg/cross.js";import v from"../svg/gift.js";import f from"../../styles/common.module.scss.js";import g from"./style.module.scss.js";import k from"../svg/ikas.js";import{Button as N}from"../button/index.js";var y;!function(e){e.COUPON_CODE_NOT_EXIST="COUPON_CODE_NOT_EXIST",e.COUPON_CODE_NOT_EXIST_FOR_GUESS="COUPON_CODE_NOT_EXIST_FOR_GUESS"}(y||(y={}));var S=o((function(e){var t,o,a=e.vm,c=e.allowExpand,d=e.isSuccessPageSummary,p=a.checkout,E=s().t,h=n.useState(!c),v=h[0],f=h[1],N=n.useState(!1),S=N[0],j=N[1],I=n.useState(null),_=I[0],w=I[1],A=n.useState(0),D=A[0],R=A[1],L=n.useState(null),U=L[0],B=L[1],F=n.useState(!1),M=F[0],V=F[1],X=n.useState(!1),G=X[0],q=X[1],H=n.useState(!1),z=H[0],$=H[1];n.useEffect((function(){c&&(v?U&&R(U.getBoundingClientRect().height):R(0))}),[v,U,c,M,G,S,z]);var K=n.useMemo((function(){switch(_){case y.COUPON_CODE_NOT_EXIST:return E("checkout-page:giftCodeErrorDescription");case y.COUPON_CODE_NOT_EXIST_FOR_GUESS:return E("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[_]),Q=[g.CartSummary,c?g.HideOnDesktop:"",d?g.SuccessPageCartSummary:""].join(" "),J=c?{height:D+"px"}:void 0,W=[g.ArrowDown,v?g.Rotated:""].join(" ");return p?n.createElement(n.Fragment,null,!!c&&n.createElement(n.Fragment,null,n.createElement("div",{id:"checkout-mobile-summary-header"}),n.createElement("div",{className:g.ExpandHeader,onClick:function(){if(!v){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}f(!v)}},n.createElement("div",{className:g.Left},E("checkout-page:summary")),n.createElement("div",{className:g.Price},n.createElement("span",{className:g.PriceText},"".concat(u(a.finalPrice||0,p.currencyCode,p.currencySymbol)," (").concat(p.itemQuantity," ").concat(E("checkout-page:cartItemProduct"),")")),n.createElement("span",{className:W},n.createElement(C,null))))),n.createElement("div",{className:Q},n.createElement("div",{className:[g.DetailsContainer,d?g.SuccessPageDetailContainer:""].join(" "),style:J},n.createElement("div",{className:g.Details,ref:B},n.createElement("div",{className:g.ItemsContainer},n.createElement("div",null,p.items.map((function(e,t){return n.createElement(m,{key:t,vm:a,cartItem:e,currencyCode:p.currencyCode,onChange:$,isSuccessPageSummary:d})})))),n.createElement("div",{className:g.Divider}),n.createElement("div",{className:g.SubTotalInfo},S&&n.createElement("div",{className:g.NotificationContainer},n.createElement(l,{type:"warning",title:E("checkout-page:giftCodeErrorTitle"),content:K,onClose:function(){j(!1),w(null)}})),n.createElement(T,{label:E("checkout-page:subtotal"),value:p.formattedTotalPrice,tooltipText:E("checkout-page:subtotalTooltip"),hideMarginBottom:!a.isCouponCodeVisible}),!!(null===(t=p.shippingLines)||void 0===t?void 0:t.length)&&n.createElement(T,{label:E("checkout-page:cartShippingTitle"),value:p.shippingTotal?p.formattedShippingTotal:E("checkout-page:free")}),!!a.installmentExtraPrice&&n.createElement(T,{label:E("checkout-page:cartInterest"),value:u(a.installmentExtraPrice,p.currencyCode,p.currencySymbol)}),n.createElement(b,{vm:a}),n.createElement(x,{vm:a}),(a.step===r.SUCCESS&&(!!a.checkout.note||!!a.checkout.appliedCouponCode)||a.step!==r.SUCCESS)&&a.isCouponCodeVisible&&n.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),n.createElement(O,{vm:a,isAddingCoupon:G,setAddingCoupon:q,setCouponError:j,setCouponErrorCode:w}),n.createElement(P,{vm:a,isAddingNote:M,setAddingNote:V})),n.createElement("div",{className:[g.TotalContainer,d?g.SuccessPageTotalContainer:""].join(" ")},n.createElement("div",{className:g.TitleContainer},n.createElement("div",{className:g.Title},E("checkout-page:total"))),n.createElement("div",null,n.createElement("div",{className:g.TotalPricesContainer},n.createElement("div",{className:g.TotalPrice},u(a.finalPrice||0,p.currencyCode,p.currencySymbol)),!!p.$totalTax&&!!(null===(o=a.customizationProps)||void 0===o?void 0:o.showTax)&&n.createElement("div",{className:[g.TotalTax].join(" ")},E("checkout-page:cartTaxTitle")+" "+p.$formattedTotalTax)))),!d&&n.createElement("div",{className:g.PoweredBy},n.createElement("span",null,"powered by"),n.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},n.createElement(k,null))))))):null})),T=o((function(e){var t=e.label,o=e.value,a=e.tooltipText,c=e.hideMarginBottom;return n.createElement("div",{className:[g.InfoRow,c?g.hideMb:""].join(" ")},n.createElement("div",{className:g.Label},n.createElement("span",null,t),!!a&&n.createElement(E,{text:a,style:{marginLeft:"8px"}})),n.createElement("div",{className:g.Value},o))})),b=o((function(e){var t=e.vm,o=s().t;return t.checkout?n.createElement(n.Fragment,null,a(t.checkout.nonCouponAdjustments||[],"order").map((function(e,a){return n.createElement("div",{className:g.InfoRow,key:a},n.createElement("div",{className:g.Label},"INTEREST"===e.name?o("checkout-page:cartInterest"):e.name),n.createElement("div",{className:g.Value},n.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",n.createElement("span",null,u(e.amount,t.checkout.currencyCode,t.checkout.currencySymbol))))}))):null})),x=o((function(e){var t,o,a=e.vm,c=s().t;return a.checkout?n.createElement(n.Fragment,null,a.step!==r.SUCCESS&&((null===(t=a.checkout.selectedPaymentGateway)||void 0===t?void 0:t.getCalculatedAdditionalPrices(a.checkout.totalFinalPrice||0,a.checkout.shippingLines||null))||[]).filter((function(e){return 0!==e.amount})).map((function(e,t){return n.createElement("div",{className:g.InfoRow,key:t},n.createElement("div",{className:g.Label},e.name),n.createElement("div",{className:g.Value},n.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",n.createElement("span",null,u(e.amount,a.checkout.currencyCode,a.checkout.currencySymbol))))})),null===(o=a.checkout.giftPackageLines)||void 0===o?void 0:o.map((function(e,t){return n.createElement("div",{className:g.InfoRow,key:t},n.createElement("div",{className:g.Label},n.createElement("div",{className:g.GiftLabel},n.createElement(v,{style:{position:"relative",top:"-1px"}}),n.createElement("span",null,c("checkout-page:giftPackage")))),n.createElement("div",{className:g.Value},n.createElement("span",null,u(e.price,a.checkout.currencyCode,a.checkout.currencySymbol))))}))):null})),O=o((function(o){var a=o.vm,l=o.isAddingCoupon,i=o.setAddingCoupon,m=o.setCouponError,E=o.setCouponErrorCode,C=o.isOpenCouponCode,v=s().t,k=n.useState(""),y=k[0],S=k[1],T=n.useState(!1),b=T[0],x=T[1],O=n.useRef(null);n.useEffect((function(){l&&O.current&&O.current.focus()}),[l]);var P=function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=y,x(!0),[4,a.onCouponCodeApply()];case 1:return e.sent(),x(!1),S(""),!a.checkout.appliedCouponCode||a.couponError?[3,3]:(i(!1),m(!1),E(null),[4,a.reInitPaymentMethod()]);case 2:return e.sent(),[3,4];case 3:a.checkout.couponCode=null,m(!0),E(a.couponError),e.label=4;case 4:return[2]}}))}))},j=function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=null,x(!0),[4,a.onCouponCodeApply()];case 1:return e.sent(),[4,a.reInitPaymentMethod()];case 2:return e.sent(),x(!1),[2]}}))}))},I=a.step===r.SUCCESS,_=a.step===r.SHIPPING;if(I&&!a.checkout.appliedCouponCode)return null;var w=a.checkout.couponAdjustment,A=!(!a.checkout.appliedCouponCode||l),D=!!a.checkout.appliedCouponCode&&C;return n.createElement(n.Fragment,null,!!C&&n.createElement(n.Fragment,null,n.createElement("div",{className:[g.CartSummary,g.OpenCouponCodeSummary].join(" ")},n.createElement("div",{className:f.FormSectionTitle},n.createElement("div",{style:{paddingBottom:D?0:6},className:f.Title},v("checkout-page:couponCode")),D&&n.createElement("div",{className:[g.ActionTextBtn,g.NoUnderline,g.Light].join(" ")},n.createElement("span",{className:[g.AppliedCoupon,g.AppliedCouponBgGray].join(" ")},n.createElement("span",{className:g.CouponCode},a.checkout.appliedCouponCode),!I&&n.createElement("span",{className:g.ClearCoupon,onClick:j},n.createElement(h,null))))))),A&&!_&&!a.isCouponCodeRequirementDefult&&n.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),n.createElement("div",{className:g.InfoRow},!a.checkout.appliedCouponCode&&!l&&a.isCouponCodeVisible&&n.createElement("div",{className:g.ActionTextBtn,onClick:function(){return i(!0)}},v("checkout-page:addCouponCode")),l&&!C&&n.createElement(c,{value:y,placeholder:v("checkout-page:couponCode"),buttonLabel:v("checkout-page:actions.apply"),inputRef:O,onClick:P,isLoading:b,onChange:S}),C&&!D&&n.createElement("div",{tabIndex:0,onKeyDown:function(e){"Enter"===e.key&&P()},className:g.OpenCouponCodeMain},n.createElement(d,{label:v("checkout-page:couponCode"),type:p.TEXT,value:y,onChange:S}),n.createElement(N,{style:{width:"33%"},text:v("checkout-page:actions.apply"),isLoading:b,onClick:P})),A&&n.createElement("div",{className:[g.ActionTextBtn,g.NoUnderline,g.Light].join(" ")},v("checkout-page:couponCode"),n.createElement("span",{className:[g.AppliedCoupon,a.isCouponCodeRequirementDefult?"":g.NotClosed].join(" ")},n.createElement("span",{className:g.CouponCode},a.checkout.appliedCouponCode),a.step!==r.SUCCESS&&a.isCouponCodeRequirementDefult&&n.createElement("span",{className:g.ClearCoupon,onClick:j},n.createElement(h,null)))),A&&n.createElement("div",{className:g.Value},n.createElement("span",null,"DECREMENT"===(null==w?void 0:w.type)?"- ":"")," ",n.createElement("span",null,u((null==w?void 0:w.amount)||0,a.checkout.currencyCode,a.checkout.currencySymbol)))))})),P=o((function(e){var t=e.vm,o=e.isAddingNote,a=e.setAddingNote,c=s().t,l=n.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=n.useCallback((function(){a(!0)}),[]),u=n.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===r.SUCCESS;return m&&!t.checkout.note?null:n.createElement("div",{className:g.InfoRow},!o&&!m&&n.createElement("div",{className:g.ActionTextBtn,onClick:i},l),(o||m)&&n.createElement("div",{className:[g.CheckoutNoteContainer,m?g.Success:""].join(" ")},n.createElement("div",{className:g.Title},c("checkout-page:orderNote")),m?n.createElement("div",{className:g.CheckoutNoteDisplay},t.checkout.note):n.createElement(d,{style:{width:"100%"},type:p.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:u,maxLength:320})))}));export{S as CartSummary,O as Coupon,y as CouponErrorCode};
@@ -1 +1 @@
1
- import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={ExpandHeader:"style-module_ExpandHeader__LQwWm",Left:"style-module_Left__-N12h",Price:"style-module_Price__OT1Wh",PriceText:"style-module_PriceText__bq1pk",ArrowDown:"style-module_ArrowDown__YhRny",Rotated:"style-module_Rotated__ZPfId",CartSummary:"style-module_CartSummary__m77tn",OpenCouponCodeSummary:"style-module_OpenCouponCodeSummary__ua9wx",HideOnDesktop:"style-module_HideOnDesktop__Vs5AV",ItemsContainer:"style-module_ItemsContainer__QFKQV",DetailsContainer:"style-module_DetailsContainer__PK33m",Details:"style-module_Details__hWJ9o",Divider:"style-module_Divider__MNDti",ActionTextBtn:"style-module_ActionTextBtn__7yua4",NoUnderline:"style-module_NoUnderline__FphKn",Light:"style-module_Light__dIcW-",SubTotalInfo:"style-module_SubTotalInfo__JMqK9",InfoRow:"style-module_InfoRow__oAvZS",hideMb:"style-module_hideMb__j7VBr",Label:"style-module_Label__28Bij",Value:"style-module_Value__7rELF",TotalContainer:"style-module_TotalContainer__sGR7d",TitleContainer:"style-module_TitleContainer__LgmJI",Title:"style-module_Title__oMVSD",TotalPricesContainer:"style-module_TotalPricesContainer__-PsOD",TotalPrice:"style-module_TotalPrice__QBdM1",TotalTax:"style-module_TotalTax__9pA4Y",AppliedCoupon:"style-module_AppliedCoupon__UNo1h",AppliedCouponBgGray:"style-module_AppliedCouponBgGray__MYoYu",NotClosed:"style-module_NotClosed__E-N9z",CouponCode:"style-module_CouponCode__UKPmf",ClearCoupon:"style-module_ClearCoupon__CBAzl",NotificationContainer:"style-module_NotificationContainer__AXfJT",CheckoutNoteContainer:"style-module_CheckoutNoteContainer__d-z4m",CheckoutNoteDisplay:"style-module_CheckoutNoteDisplay__DtnXo",Success:"style-module_Success__VI2Bw",GiftLabel:"style-module_GiftLabel__cazrS",PoweredBy:"style-module_PoweredBy__DKBJF",OpenCouponCodeMain:"style-module_OpenCouponCodeMain__lZtb3"};e(".style-module_ExpandHeader__LQwWm {\n position: sticky;\n top: 0;\n z-index: 10;\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n padding: 0 24px;\n width: 100%;\n border-top: 1px solid var(--checkout-border-color);\n border-bottom: 1px solid var(--checkout-border-color);\n transition: border-bottom 0.3s;\n user-select: none;\n background-color: var(--checkout-primary-bg-color);\n}\n@media only screen and (min-width: 1000px) {\n .style-module_ExpandHeader__LQwWm {\n display: none;\n }\n}\n.style-module_ExpandHeader__LQwWm .style-module_Left__-N12h {\n display: flex;\n align-items: center;\n font-size: 16px;\n font-weight: 600;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh {\n font-weight: 600;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_PriceText__bq1pk {\n font-weight: 600;\n margin-right: 8px;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny {\n transition: all 0.3s;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny.style-module_Rotated__ZPfId {\n transform: rotate(-180deg);\n}\n\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn {\n width: 100%;\n background-color: var(--checkout-card-bg-color);\n }\n .style-module_CartSummary__m77tn.style-module_OpenCouponCodeSummary__ua9wx {\n background-color: #fff;\n }\n}\n@media only screen and (min-width: 1000px) {\n .style-module_CartSummary__m77tn.style-module_HideOnDesktop__Vs5AV {\n display: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: 50vh;\n overflow-y: auto;\n margin-bottom: 24px;\n /* Track */\n /* Handle */\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: unset;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar {\n width: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-track {\n box-shadow: inset 0 0 20px 20px #E3E7EF;\n border-left: 16px solid transparent;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 20px 20px #000000;\n border-left: 16px solid transparent;\n}\n.style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n overflow: hidden;\n width: 100%;\n transition: height 0.3s ease-in-out;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n padding: 0 24px;\n box-shadow: 1px 2px 5px 0px rgba(0, 0, 0, 0.2);\n }\n}\n.style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n overflow: hidden;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n padding-top: 24px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_Divider__MNDti {\n width: 100%;\n height: 1px;\n margin: auto;\n background-color: var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4 {\n color: var(--checkout-primary-text-color);\n user-select: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4:hover {\n text-decoration: underline;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_NoUnderline__FphKn:hover {\n text-decoration: none;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_Light__dIcW- {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 {\n padding: 24px 0;\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS.style-module_hideMb__j7VBr {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Label__28Bij {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Value__7rELF {\n flex: 0 0 auto;\n padding-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS:last-of-type {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n display: flex;\n justify-content: space-between;\n margin-top: 12px;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TitleContainer__LgmJI .style-module_Title__oMVSD {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPricesContainer__-PsOD {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPrice__QBdM1 {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalTax__9pA4Y {\n font-size: 14px;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n height: 64px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 6px;\n margin-left: 12px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_AppliedCouponBgGray__MYoYu {\n background-color: var(--checkout-secondary-bg-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_NotClosed__E-N9z {\n padding: 4px 4px 4px 4px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_CouponCode__UKPmf {\n font-size: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl svg {\n transform: scale(0.8);\n}\n.style-module_CartSummary__m77tn .style-module_NotificationContainer__AXfJT {\n margin-bottom: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 24px;\n width: calc(100% - 2px);\n margin-left: 1px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_Title__oMVSD {\n font-size: 16px;\n color: var(--checkout-primary-text-color);\n margin-bottom: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_CheckoutNoteDisplay__DtnXo {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m.style-module_Success__VI2Bw {\n margin-top: 0;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 0px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS {\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS span {\n margin-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n width: 100%;\n height: 50px;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n display: flex;\n }\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF a {\n display: flex;\n align-items: center;\n}\n\n.style-module_OpenCouponCodeMain__lZtb3 {\n display: flex;\n}\n.style-module_OpenCouponCodeMain__lZtb3 input {\n width: calc(100% - 12px);\n}");export{n as default};
1
+ import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={ExpandHeader:"style-module_ExpandHeader__LQwWm",Left:"style-module_Left__-N12h",Price:"style-module_Price__OT1Wh",PriceText:"style-module_PriceText__bq1pk",ArrowDown:"style-module_ArrowDown__YhRny",Rotated:"style-module_Rotated__ZPfId",CartSummary:"style-module_CartSummary__m77tn",OpenCouponCodeSummary:"style-module_OpenCouponCodeSummary__ua9wx",HideOnDesktop:"style-module_HideOnDesktop__Vs5AV",ItemsContainer:"style-module_ItemsContainer__QFKQV",DetailsContainer:"style-module_DetailsContainer__PK33m",SuccessPageDetailContainer:"style-module_SuccessPageDetailContainer__-p8kJ",Details:"style-module_Details__hWJ9o",Divider:"style-module_Divider__MNDti",ActionTextBtn:"style-module_ActionTextBtn__7yua4",NoUnderline:"style-module_NoUnderline__FphKn",Light:"style-module_Light__dIcW-",SubTotalInfo:"style-module_SubTotalInfo__JMqK9",InfoRow:"style-module_InfoRow__oAvZS",hideMb:"style-module_hideMb__j7VBr",Label:"style-module_Label__28Bij",Value:"style-module_Value__7rELF",TotalContainer:"style-module_TotalContainer__sGR7d",TitleContainer:"style-module_TitleContainer__LgmJI",Title:"style-module_Title__oMVSD",TotalPricesContainer:"style-module_TotalPricesContainer__-PsOD",TotalPrice:"style-module_TotalPrice__QBdM1",TotalTax:"style-module_TotalTax__9pA4Y",SuccessPageTotalContainer:"style-module_SuccessPageTotalContainer__NZGFF",AppliedCoupon:"style-module_AppliedCoupon__UNo1h",AppliedCouponBgGray:"style-module_AppliedCouponBgGray__MYoYu",NotClosed:"style-module_NotClosed__E-N9z",CouponCode:"style-module_CouponCode__UKPmf",ClearCoupon:"style-module_ClearCoupon__CBAzl",NotificationContainer:"style-module_NotificationContainer__AXfJT",CheckoutNoteContainer:"style-module_CheckoutNoteContainer__d-z4m",CheckoutNoteDisplay:"style-module_CheckoutNoteDisplay__DtnXo",Success:"style-module_Success__VI2Bw",GiftLabel:"style-module_GiftLabel__cazrS",PoweredBy:"style-module_PoweredBy__DKBJF",SuccessPageCartSummary:"style-module_SuccessPageCartSummary__pjgea",OpenCouponCodeMain:"style-module_OpenCouponCodeMain__lZtb3"};e(".style-module_ExpandHeader__LQwWm {\n position: sticky;\n top: 0;\n z-index: 10;\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n padding: 0 24px;\n width: 100%;\n border-top: 1px solid var(--checkout-border-color);\n border-bottom: 1px solid var(--checkout-border-color);\n transition: border-bottom 0.3s;\n user-select: none;\n background-color: var(--checkout-primary-bg-color);\n}\n@media only screen and (min-width: 1000px) {\n .style-module_ExpandHeader__LQwWm {\n display: none;\n }\n}\n.style-module_ExpandHeader__LQwWm .style-module_Left__-N12h {\n display: flex;\n align-items: center;\n font-size: 16px;\n font-weight: 600;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh {\n font-weight: 600;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_PriceText__bq1pk {\n font-weight: 600;\n margin-right: 8px;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny {\n transition: all 0.3s;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny.style-module_Rotated__ZPfId {\n transform: rotate(-180deg);\n}\n\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn {\n width: 100%;\n background-color: var(--checkout-card-bg-color);\n }\n .style-module_CartSummary__m77tn.style-module_OpenCouponCodeSummary__ua9wx {\n background-color: #fff;\n }\n}\n@media only screen and (min-width: 1000px) {\n .style-module_CartSummary__m77tn.style-module_HideOnDesktop__Vs5AV {\n display: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: 50vh;\n overflow-y: auto;\n margin-bottom: 24px;\n /* Track */\n /* Handle */\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: unset;\n overflow-y: unset;\n margin-bottom: 0;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar {\n width: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-track {\n box-shadow: inset 0 0 20px 20px #e3e7ef;\n border-left: 16px solid transparent;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 20px 20px #000000;\n border-left: 16px solid transparent;\n}\n.style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n overflow: hidden;\n width: 100%;\n transition: height 0.3s ease-in-out;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n padding: 0 24px;\n box-shadow: 1px 2px 5px 0px rgba(0, 0, 0, 0.2);\n }\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_SuccessPageDetailContainer__-p8kJ {\n padding: 0;\n box-shadow: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageDetailContainer__-p8kJ .style-module_Details__hWJ9o {\n padding-top: 0;\n}\n.style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n overflow: hidden;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n padding-top: 24px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_Divider__MNDti {\n width: 100%;\n height: 1px;\n margin: auto;\n background-color: var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4 {\n color: var(--checkout-primary-text-color);\n user-select: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4:hover {\n text-decoration: underline;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_NoUnderline__FphKn:hover {\n text-decoration: none;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_Light__dIcW- {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 {\n padding: 24px 0;\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS.style-module_hideMb__j7VBr {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Label__28Bij {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Value__7rELF {\n flex: 0 0 auto;\n padding-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS:last-of-type {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n display: flex;\n justify-content: space-between;\n margin-top: 12px;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TitleContainer__LgmJI .style-module_Title__oMVSD {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPricesContainer__-PsOD {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPrice__QBdM1 {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalTax__9pA4Y {\n font-size: 14px;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n height: 64px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF {\n height: unset;\n margin-top: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF .style-module_Title__oMVSD {\n font-weight: 500 !important;\n line-height: 32px;\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF .style-module_TotalPrice__QBdM1 {\n font-weight: 500 !important;\n line-height: 32px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 6px;\n margin-left: 12px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_AppliedCouponBgGray__MYoYu {\n background-color: var(--checkout-secondary-bg-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_NotClosed__E-N9z {\n padding: 4px 4px 4px 4px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_CouponCode__UKPmf {\n font-size: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl svg {\n transform: scale(0.8);\n}\n.style-module_CartSummary__m77tn .style-module_NotificationContainer__AXfJT {\n margin-bottom: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 24px;\n width: calc(100% - 2px);\n margin-left: 1px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_Title__oMVSD {\n font-size: 16px;\n color: var(--checkout-primary-text-color);\n margin-bottom: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_CheckoutNoteDisplay__DtnXo {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m.style-module_Success__VI2Bw {\n margin-top: 0;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 0px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS {\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS span {\n margin-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n width: 100%;\n height: 50px;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n display: flex;\n }\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF a {\n display: flex;\n align-items: center;\n}\n\n.style-module_SuccessPageCartSummary__pjgea {\n background-color: #fff;\n}\n\n.style-module_OpenCouponCodeMain__lZtb3 {\n display: flex;\n}\n.style-module_OpenCouponCodeMain__lZtb3 input {\n width: calc(100% - 12px);\n}");export{n as default};
@@ -1 +1 @@
1
- import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={ExpandableSection:"style-module_ExpandableSection__Q5p-E",Top:"style-module_Top__s93Gc",Title:"style-module_Title__8iUDa",HideBtn:"style-module_HideBtn__Q2c0N",Content:"style-module_Content__-qdRF",TransForm:"style-module_TransForm__If-bD"};e(".style-module_ExpandableSection__Q5p-E {\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Top__s93Gc {\n padding: 16px 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n user-select: none;\n cursor: pointer;\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Top__s93Gc .style-module_Title__8iUDa {\n font-size: 20px;\n font-weight: 500;\n line-height: 32px;\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Top__s93Gc .style-module_HideBtn__Q2c0N {\n font-size: 14px;\n user-select: none;\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Content__-qdRF {\n padding-bottom: 24px;\n}\n.style-module_ExpandableSection__Q5p-E .style-module_TransForm__If-bD {\n transform: rotate(180deg);\n}");export{n as default};
1
+ import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={ExpandableSection:"style-module_ExpandableSection__Q5p-E",Top:"style-module_Top__s93Gc",Title:"style-module_Title__8iUDa",HideBtn:"style-module_HideBtn__Q2c0N",Content:"style-module_Content__-qdRF",TransForm:"style-module_TransForm__If-bD"};e(".style-module_ExpandableSection__Q5p-E {\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Top__s93Gc {\n padding: 16px 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n user-select: none;\n cursor: pointer;\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Top__s93Gc .style-module_Title__8iUDa {\n font-size: 20px;\n font-weight: 500;\n line-height: 32px;\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Top__s93Gc .style-module_HideBtn__Q2c0N {\n font-size: 14px;\n user-select: none;\n}\n.style-module_ExpandableSection__Q5p-E .style-module_Content__-qdRF {\n padding-bottom: 24px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_ExpandableSection__Q5p-E .style-module_Content__-qdRF {\n padding-bottom: 16px;\n }\n}\n.style-module_ExpandableSection__Q5p-E .style-module_TransForm__If-bD {\n transform: rotate(180deg);\n}");export{n as default};
@@ -1 +1 @@
1
- import*as n from"react";import{observer as e}from"mobx-react-lite";import t from"next/script";import"@ikas/storefront-config";import{useTranslation as a}from"../../../../utils/i18n.js";var r=e((function(e){var r=e.vm;return a().t,n.useEffect((function(){window.handleKlarna=function(n){var e;n&&(r.isStepLoading=!0,fetch((null===(e=r.klarnaResponse)||void 0===e?void 0:e.authorizeUrl)+"&data="+n).then((function(n){return n.json()})).then((function(n){window.location.href=n.redirectUrl})).catch((function(n){r.isStepLoading=!1})))}}),[]),r.klarnaResponse?n.createElement(n.Fragment,null,n.createElement("div",{id:"klarna-payments-container"}),n.createElement(t,{dangerouslySetInnerHTML:{__html:'window.klarnaAsyncCallback = function () {\n try {\n Klarna.Payments.init({\n client_token: "'.concat(r.klarnaResponse.clientToken,'",\n });\n Klarna.Payments.load({\n container: "#klarna-payments-container",\n },\n function (res) {\n }\n );\n } catch (e) {\n console.log("error", e);\n }\n };')}}),n.createElement(t,{dangerouslySetInnerHTML:{__html:"".concat(r.isKlarnaPaymentCompleted&&"Klarna.Payments.authorize({ auto_finalize: true }, function (res) {\n if (res.approved && !!res.authorization_token) {\n window.handleKlarna(JSON.stringify(res))\n } else{\n ".concat(setTimeout((function(){r.setIsKlarnaPaymentCompleted(!1)}),2e3),"\n }\n });"))}}),n.createElement(t,{src:"https://x.klarnacdn.net/kp/lib/v1/api.js"})):null}));export{r as Klarna};
1
+ import*as n from"react";import{observer as e}from"mobx-react-lite";import a from"next/script";import"@ikas/storefront-config";import{useTranslation as t}from"../../../../utils/i18n.js";var r=e((function(e){var r=e.vm;return t().t,n.useEffect((function(){window.handleKlarna=function(n){var e;n&&(r.isStepLoading=!0,fetch((null===(e=r.klarnaResponse)||void 0===e?void 0:e.authorizeUrl)+"&data="+n).then((function(n){return n.json()})).then((function(n){window.location.href=n.redirectUrl})).catch((function(n){r.isStepLoading=!1})))},window.errorKlarna=function(){r.klarnaResponse&&r.klarnaResponse.failUrl&&(window.location.href=r.klarnaResponse.failUrl)}}),[]),r.klarnaResponse?n.createElement(n.Fragment,null,n.createElement("div",{id:"klarna-payments-container"}),n.createElement(a,{dangerouslySetInnerHTML:{__html:'window.klarnaAsyncCallback = function () {\n try {\n Klarna.Payments.init({\n client_token: "'.concat(r.klarnaResponse.clientToken,'",\n });\n Klarna.Payments.load({\n container: "#klarna-payments-container",\n },\n function (res) {\n }\n );\n } catch (e) {\n console.log("error", e);\n }\n };')}}),n.createElement(a,{dangerouslySetInnerHTML:{__html:"".concat(r.isKlarnaPaymentCompleted&&"Klarna.Payments.authorize({ auto_finalize: true }, function (res) {\n if (res.approved && !!res.authorization_token) {\n window.handleKlarna(JSON.stringify(res))\n } else{\n window.errorKlarna()\n ".concat(setTimeout((function(){r.setIsKlarnaPaymentCompleted(!1)}),2e3),"\n }\n });"))}}),n.createElement(a,{src:"https://x.klarnacdn.net/kp/lib/v1/api.js"})):null}));export{r as Klarna};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as n}from"mobx-react-lite";import{ErrorType as o}from"../../model.js";import{PayPalScriptProvider as a,usePayPalScriptReducer as i,PayPalButtons as l}from"@paypal/react-paypal-js";import c from"../../../../store/checkout/index.js";import s from"./style.module.scss.js";var d=n((function(n){var d=n.vm;if(!d.payPalClientIdResponse)return null;var u={"client-id":d.payPalClientIdResponse.clientId,currency:d.checkout.currencyCode,"merchant-id":d.payPalClientIdResponse.merchantId};return r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement(a,{options:u},r.createElement((function(){return i()[0].isPending?r.createElement("div",{className:s.Main},r.createElement("div",{className:s.loader})):r.createElement(l,{style:{layout:"horizontal"},onClick:function(e,t){return d.checkPaypalButtonAvailable()?t.resolve():t.reject()},onCancel:function(e,t){d.isStepLoading=!1},createOrder:function(r,n){return e(void 0,void 0,void 0,(function(){var e,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,d.onCompletePaymentClick()];case 1:return t.sent(),[4,c.createPayPalOrder({input:{cartId:d.checkout.id,paymentGatewayId:(null===(r=d.checkout.selectedPaymentGateway)||void 0===r?void 0:r.id)||""}})];case 2:return!(e=t.sent()).isSuccess&&e.errors.length&&(d.error={type:o.PAYMENT_ERROR,data:e.errors[0]}),e.data&&(d.paypalOrderResponse=e.data),[2,e&&(null===(n=e.data)||void 0===n?void 0:n.sessionToken)||""]}}))}))},onApprove:function(r,n){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return d.paypalOrderResponse&&(window.location.href="".concat(d.paypalOrderResponse.returnUrl)),[2]}))}))}})}),null))))}));export{d as PayPal};
1
+ import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as n}from"mobx-react-lite";import{ErrorType as o}from"../../model.js";import{PayPalScriptProvider as a,usePayPalScriptReducer as i,PayPalButtons as l}from"@paypal/react-paypal-js";import c from"../../../../store/checkout/index.js";import s from"./style.module.scss.js";var d=n((function(n){var d=n.vm;if(!d.payPalClientIdResponse)return null;var p={"client-id":d.payPalClientIdResponse.clientId,currency:d.checkout.currencyCode,"merchant-id":d.payPalClientIdResponse.merchantId};return r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement(a,{options:p},r.createElement((function(){return i()[0].isPending?r.createElement("div",{className:s.Main},r.createElement("div",{className:s.loader})):r.createElement(l,{style:{layout:"horizontal"},onClick:function(e,t){return d.checkPaypalButtonAvailable()?t.resolve():t.reject()},onCancel:function(e,t){d.paypalOrderResponse&&(window.location.href="".concat(d.paypalOrderResponse.failUrl)),d.isStepLoading=!1},createOrder:function(r,n){return e(void 0,void 0,void 0,(function(){var e,r,n;return t(this,(function(t){switch(t.label){case 0:return[4,d.onCompletePaymentClick()];case 1:return t.sent(),[4,c.createPayPalOrder({input:{cartId:d.checkout.id,paymentGatewayId:(null===(r=d.checkout.selectedPaymentGateway)||void 0===r?void 0:r.id)||""}})];case 2:return!(e=t.sent()).isSuccess&&e.errors.length&&(d.error={type:o.PAYMENT_ERROR,data:e.errors[0]}),e.data&&(d.paypalOrderResponse=e.data),[2,e&&(null===(n=e.data)||void 0===n?void 0:n.sessionToken)||""]}}))}))},onApprove:function(r,n){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return d.paypalOrderResponse&&(window.location.href="".concat(d.paypalOrderResponse.returnUrl)),[2]}))}))}})}),null))))}));export{d as PayPal};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as n}from"mobx-react-lite";import{useStripe as o,useElements as a,PaymentElement as i}from"@stripe/react-stripe-js";import m from"./style.module.scss.js";var s=n((function(n){var s=n.callbackUrl,l=n.vm,c=o(),u=a(),d=r.useState(!0),f=d[0],p=d[1];return r.createElement(r.Fragment,null,r.createElement("form",{className:m.Form,id:"stripe-form",onSubmit:function(r){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return r.preventDefault(),c&&u&&s?(p(!0),[4,c.confirmPayment({elements:u,confirmParams:{return_url:s}})]):[2];case 1:return e.sent().error&&(l.isStepLoading=!1,p(!1)),[2]}}))}))}},r.createElement(i,{onReady:function(){return p(!1)}}),r.createElement("button",{id:"stripe-form-btn",hidden:!0,disabled:!c}),f&&r.createElement("div",{className:m.Disabled},r.createElement("div",{className:m.loader}))))}));export{s as CheckoutForm};
1
+ import{__awaiter as e,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as n}from"mobx-react-lite";import{ErrorType as m}from"../../model.js";import{useStripe as o,useElements as a,PaymentElement as s}from"@stripe/react-stripe-js";import i from"./style.module.scss.js";var l=n((function(n){var l=n.callbackUrl,c=n.vm,d=o(),u=a(),f=t.useState(!0),p=f[0],b=f[1];return t.createElement(t.Fragment,null,t.createElement("form",{className:i.Form,id:"stripe-form",onSubmit:function(t){return e(void 0,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return t.preventDefault(),d&&u&&l?(b(!0),[4,d.confirmPayment({elements:u,confirmParams:{return_url:l}})]):[2];case 1:return(e=r.sent().error)&&(c.handlePaymentError(m.PAYMENT_ERROR,e.message),c.isStepLoading=!1,b(!1)),[2]}}))}))}},t.createElement(s,{onReady:function(){return b(!1)}}),t.createElement("button",{id:"stripe-form-btn",hidden:!0,disabled:!d}),p&&t.createElement("div",{className:i.Disabled},t.createElement("div",{className:i.loader}))))}));export{l as CheckoutForm};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as n}from"mobx-react-lite";import{useRouter as i}from"next/router.js";import r from"next/link.js";import a from"react-tooltip";import s,{CheckoutStep as c}from"./model.js";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import u from"./steps/step-info/index.js";import{CheckoutStepShipping as p}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CouponErrorCode as f,Coupon as g,CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as E}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as y}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as x}from"./steps/step-success/index.js";import{Modal as k}from"./components/modal/index.js";import C from"./components/master-pass/modal-otp/index.js";import j from"./components/master-pass/modal-response/index.js";import P from"./components/master-pass/modal-success/index.js";import{Image as N}from"../image/index.js";import b,{Step as S}from"./components/step-container/index.js";import{StockError as O}from"./components/error/stock-error/index.js";import{FullscreenLoading as F}from"./components/fullscreen-loading/index.js";import M from"./components/notification-box/index.js";import{FormItem as T}from"./components/form-item/index.js";import{FormItemType as w}from"./components/form-item/model.js";import{Button as I}from"./components/button/index.js";import{IkasPageHead as A}from"../page/head.js";import B from"./components/offer-product/index.js";import L from"./components/offer-product/placeholder-offer-product.js";import D from"./components/svg/ikas.js";import U from"./style.module.scss.js";import{Analytics as V}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import R from"./components/epaykolay-button/index.js";import _ from"./components/svg/success-circle.js";import z from"./components/offer-product/offer-dots/index.js";import H from"./components/offer-product/offer-arrows/index.js";import K from"./components/offer-product/useCampaignOffer.js";var G=n((function(n){var r,m,u,p,v,f,g,y=n.checkout,b=n.checkoutSettings,S=n.customizationProps,M=n.returnPolicy,T=n.privacyPolicy,w=n.termsOfService,G=n.imprint,q=n.shippingPolicy,J=d().t,$=i(),ee=o.useState((function(){return new s(y,b,$,M,T,w,G,q,J,S||{})}))[0],te=K(ee),oe=te.setShowDetailPage,ne=te.setActiveIndex,ie=te.setIsActiveOverlay,re=te.handlePrev,ae=te.handleNext,se=te.isPopupClosedIndexPage,ce=te.isPopupShowIndexPage,le=te.isShowSuccessPageMiddlePhase,me=te.activeIndex,de=o.useMemo((function(){return Date.now()}),[]);ee.step===c.PAYMENT&&V.disableHTML();var ue=function(o,n,i,r,a){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/get-basket"),[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()},body:JSON.stringify({cartId:ee.checkout.id,customerNumber:o,sessionsState:de,addressDto:i,paymentType:r,totalPrice:a})})];case 1:return[2,t.sent().json()]}}))}))};o.useEffect((function(){ee.checkoutSettings.isAccountRequired&&!ee.checkout.hasCustomer&&$.push("/account/login?redirect="+encodeURIComponent(ee.checkoutUrl)),V.beginCheckout(ee.checkout),V.pageView(E.CHECKOUT)}),[]),o.useEffect((function(){ee.customizationProps=S,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==e?void 0:e.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==e?void 0:e.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==e?void 0:e.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==e?void 0:e.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==e?void 0:e.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==e?void 0:e.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==e?void 0:e.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==e?void 0:e.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==e?void 0:e.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==e?void 0:e.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==e?void 0:e.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(S)}),[S]),o.useEffect((function(){if(ee.isEPayKolayEnabled)var o=setInterval((function(){var n,i;window.setContainerService&&ee.isCheckoutLoaded&&(window.setContainerService(null===(n=l.getMerchantSettings())||void 0===n?void 0:n.merchantId,ue,(function(o){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,pe(o)];case 1:return[2,e.sent()]}}))}))}),(function(){console.log("Switching to epaykolay"),ee.isEPayKolayPayment=!0}),"https://cdn-epeykolay.mncdn.com/".concat((null===(i=l.getApiUrl())||void 0===i?void 0:i.includes("myikas.com"))?"epay":"epay-uat","/")),clearInterval(o))}),100)}),[]);var pe=o.useCallback((function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,fetch("".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/complete-payment"),{method:"POST",body:JSON.stringify({data:o,cartId:ee.checkout.id}),headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()}})];case 1:return[4,t.sent().json()];case 2:return e=t.sent(),[2,{redirectUrl:"".concat(window.location.pathname,"?id=").concat(ee.checkout.id,"&step=").concat(e.success?"success":"info"),orderId:e.orderNumber||null}]}}))}))}),[]);if(!ee.isCheckoutLoaded||!ee.store.customerStore.initialized)return o.createElement(F,null);if(ee.checkout.hasCustomer&&(null===(r=ee.store.customerStore.customer)||void 0===r?void 0:r.id)!==(null===(m=ee.checkout.customer)||void 0===m?void 0:m.id))return $.push("/account/login?redirect="+encodeURIComponent(ee.checkoutUrl)),null;return o.createElement(o.Fragment,null,o.createElement(A,{pageType:E.CHECKOUT,pageTitle:((null===(u=ee.merchantSettings)||void 0===u?void 0:u.merchantName)||"")+" - "+J("checkout-page:securePayment"),pageDescription:J("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:U.CheckoutPage},le?o.createElement("div",{className:U.FullPageOfferMain},o.createElement("div",{className:U.FullPageOfferContainer},o.createElement("div",{className:U.LogoMain},(null===(p=ee.customizationProps)||void 0===p?void 0:p.logo)?o.createElement("div",{className:U.Logo},o.createElement(N,{layout:"fill",image:ee.customizationProps.logo,sizes:"360px"})):(null===(v=ee.merchantSettings)||void 0===v?void 0:v.logo)?o.createElement("div",{className:U.Logo},o.createElement(N,{layout:"fill",image:ee.merchantSettings.logo,sizes:"360px"})):(null===(f=ee.merchantSettings)||void 0===f?void 0:f.merchantName)||""),o.createElement("div",{className:U.OfferSuccessInfo},o.createElement("div",null,o.createElement("div",{className:U.OfferSuccessHeader},o.createElement(_,{className:U.SuccessCircle}),o.createElement("span",{className:U.SuccessTitle},J("checkout-page:orderSuccessShortTitle"))),o.createElement("div",{className:U.OfferOrderInfoMain},o.createElement("div",{className:U.InfoTitle},J("checkout-page:orderNoAndDate"),":"),o.createElement("div",{className:U.InfoText},"#"+(ee.checkout.orderNumber||"")," ",ee.checkout.dateStr))),o.createElement("div",null,o.createElement(I,{classes:U.OfferButton,isLine:!0,text:J("checkout-page:actions.goOrderDetailPage"),onClick:function(){oe(!1)}}))),o.createElement("div",null,ee.campaignOffers&&!!ee.campaignOffers.length&&ee.isCampaignOfferLoaded&&o.createElement("div",{className:U.CampaignOfferMain},o.createElement("div",{className:U.OfferSlider},ee.campaignOffers.map((function(e,t){var n;return o.createElement(B,{vm:ee,campaignOffer:e,index:t,activeIndex:me,offersLength:(null===(n=ee.campaignOffers)||void 0===n?void 0:n.length)||0,handlePrev:re,handleNext:ae,setActiveIndex:function(e){return ne(e)},desktopMiddlePhase:!0,step:ee.step})}))),ee.campaignOffers.length>1&&o.createElement(H,{handlePrev:re,handleNext:ae}),ee.campaignOffers.length>1&&o.createElement(z,{vm:ee,activeIndex:me}))))):null,o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:U.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[U.Left,ee.isEPayKolayPayment?U.epaykolay:""].join(" ")},ee.isEPayKolayEnabled&&o.createElement("div",{id:"plateau_ui_placeholder",style:{width:"100%"}}),!ee.isEPayKolayPayment&&o.createElement("div",{className:U.LeftContent},o.createElement("div",null,o.createElement(Y,{vm:ee}),ee.hasStockError&&o.createElement("div",{className:U.ErrorContainer},o.createElement(O,{vm:ee,error:ee.error})),!ee.hasStockError&&o.createElement(o.Fragment,null,ee.step!==c.SUCCESS&&o.createElement(h,{vm:ee,allowExpand:!0}),o.createElement("div",null,ee.step!==c.SUCCESS&&ee.isEPayKolayEnabled&&o.createElement(R,{onClick:function(){window.frictionless()}})),ee.step===c.SUCCESS?o.createElement(x,{vm:ee}):o.createElement(o.Fragment,null,!!(null===(g=ee.customizationProps)||void 0===g?void 0:g.showCampaignOffersDesign)&&l.getIsEditor()&&o.createElement(L,{vm:ee}),ce&&o.createElement("div",{className:[U.MiddlePhaseOverlay,ce?U.MiddlePhaseOverlayPopup:""].join(" ")}),ee.campaignOffers&&!!ee.campaignOffers.length&&ee.isCampaignOfferLoaded&&o.createElement("div",{className:[U.CampaignOfferMain,ce?U.OverlayPopupMain:""].join(" ")},o.createElement("div",{className:U.OfferSlider},ee.campaignOffers.map((function(e,t){var n;return o.createElement(B,{vm:ee,campaignOffer:e,index:t,activeIndex:me,offersLength:(null===(n=ee.campaignOffers)||void 0===n?void 0:n.length)||0,handlePrev:re,handleNext:ae,setActiveIndex:function(e){return ne(e)},step:ee.step,isPopupClosed:se,isPopupShow:ce,closePopup:function(){return ie(!1)},showPopup:function(){return ie(!0)}})}))),ee.campaignOffers.length>1&&o.createElement(H,{handlePrev:re,handleNext:ae}),ee.campaignOffers.length>1&&o.createElement(z,{isPopupShow:ce,vm:ee,activeIndex:me})),ee.isCouponCodeRequirementOpen&&o.createElement(X,{vm:ee}),o.createElement(W,{vm:ee}))),o.createElement("div",{className:U.Space})),o.createElement(Q,{vm:ee}))),o.createElement("div",{className:U.Right},o.createElement("div",{className:U.RightContent},o.createElement(h,{vm:ee}),!ee.isPoweredByHidden&&o.createElement("div",{className:U.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===l.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(D,null))))),!!ee.policyModalText&&o.createElement(k,{title:ee.policyModalTitle,modalContent:ee.policyModalText,onClose:function(){ee.policyModalText=""}}),ee.isContactModalVisible&&o.createElement(Z,{vm:ee,setVisible:ee.setContactModalVisible}),ee.mpVM.isOtpModalVisible&&o.createElement(C,{vm:ee,visible:ee.mpVM.isOtpModalVisible,type:ee.mpVM.otpModalType,onClose:ee.mpVM.hideOtpModal}),ee.mpVM.isResponseModalVisible&&o.createElement(j,{visible:ee.mpVM.isResponseModalVisible,text:ee.mpVM.mfsResponseModalText,onClose:ee.mpVM.onResponseModalClose}),ee.mpVM.isSuccessModalVisible&&o.createElement(P,{visible:ee.mpVM.isSuccessModalVisible,type:ee.mpVM.successModalType,onClose:ee.mpVM.onSuccessModalClose})))})),Y=n((function(e){var t,n,i,a,s=e.vm,c=d().t;return o.createElement("div",{className:U.Header},o.createElement(r,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=s.customizationProps)||void 0===t?void 0:t.logo)?o.createElement("div",{className:U.Logo},o.createElement(N,{layout:"fill",image:s.customizationProps.logo,sizes:"360px"})):(null===(n=s.merchantSettings)||void 0===n?void 0:n.logo)?o.createElement("div",{className:U.Logo},o.createElement(N,{layout:"fill",image:s.merchantSettings.logo,sizes:"360px"})):(null===(i=s.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!s.checkout.hasCustomer&&o.createElement("div",{className:U.LoginText},o.createElement("span",{className:U.LoginCta},c("checkout-page:alreadyHaveAnAccount")),o.createElement(r,{href:"/account/login?redirect="+encodeURIComponent(s.checkoutUrl),passHref:!0},o.createElement("a",{className:U.LoginBtn},c("checkout-page:actions.login")))),s.checkout.hasCustomer&&o.createElement("div",{className:U.CustomerInfo},o.createElement("div",{className:U.Name},s.checkout.customerFullName),o.createElement("div",{className:U.Email},null===(a=s.checkout.customer)||void 0===a?void 0:a.email)))})),X=n((function(e){var t=e.vm,n=d().t,i=o.useState(!1),r=i[0],a=i[1],s=o.useState(null),c=s[0],l=s[1],m=o.useMemo((function(){switch(c){case f.COUPON_CODE_NOT_EXIST:return n("checkout-page:giftCodeErrorDescription");case f.COUPON_CODE_NOT_EXIST_FOR_GUESS:return n("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[c]);return o.createElement("div",{className:U.CouponContainer},r&&o.createElement("div",{className:U.NotificationContainer},o.createElement(M,{type:"warning",title:n("checkout-page:giftCodeErrorTitle"),content:m,onClose:function(){a(!1),l(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:r?12:0}},o.createElement(g,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:a,setCouponErrorCode:l})))})),W=n((function(e){var t=e.vm,n=d().t,i=o.useMemo((function(){switch(t.step){case c.INFO:return o.createElement(u,{vm:t});case c.SHIPPING:return o.createElement(p,{vm:t});case c.PAYMENT:return o.createElement(v,{vm:t});case c.SUCCESS:return o.createElement(x,{vm:t})}}),[t,t.step]),r=[new S(n("checkout-page:address"),t.step===c.INFO,t.step!==c.INFO,t.step!==c.INFO?o.createElement("div",{className:U.AdressStepInfo},o.createElement(q,{vm:t}),!t.isUpsellOrder&&o.createElement("div",{className:U.EditBtn,onClick:t.onBackToInfoClick},n("checkout-page:actions.edit"))):void 0,t.step!==c.INFO?o.createElement("div",{className:U.AddressStepInfoMobile},o.createElement(q,{vm:t})):void 0),new S(n("checkout-page:payment"),t.step===c.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||r.splice(1,0,new S(n("checkout-page:shipping"),t.step===c.SHIPPING,t.step===c.PAYMENT,t.step===c.PAYMENT?o.createElement("div",{className:U.AdressStepInfo},o.createElement(J,{vm:t}),!t.isUpsellOrder&&(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:U.EditBtn,onClick:t.onBackToShippingClick},n("checkout-page:actions.edit"))):void 0,t.step===c.PAYMENT?o.createElement("div",{className:U.AddressStepInfoMobile},o.createElement(J,{vm:t})):void 0)),o.createElement(b,{steps:r,stepContent:i})})),q=n((function(e){var t,n,i,r,a,s,c,l,m,u=e.vm,p=d().t,v=u.isDigitalOnly?((null===(t=u.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(n=u.checkout.billingAddress)||void 0===n?void 0:n.lastName)||""):((null===(i=u.checkout.shippingAddress)||void 0===i?void 0:i.firstName)||"")+" "+((null===(r=u.checkout.shippingAddress)||void 0===r?void 0:r.lastName)||"");return o.createElement("div",{className:U.Address},o.createElement("div",{className:[U.Text,U.WithMBottom].join(" ")},(null===(a=u.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===u.deliveryMethod?o.createElement("div",{className:U.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:U.Text},p("checkout-page:receiver")),o.createElement("div",{className:[U.Text,U.Gray].join(" ")},v)),o.createElement("div",{className:[U.Text,U.Gray].join(" ")},u.isDigitalOnly?null===(s=u.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(c=u.checkout.shippingAddress)||void 0===c?void 0:c.phone),"in-store"===u.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[U.Text,U.WithMTop].join(" ")},p("checkout-page:pickUpLocation"))),o.createElement("div",{className:[U.Text,U.Gray].join(" ")},u.isDigitalOnly?null===(l=u.checkout.billingAddress)||void 0===l?void 0:l.addressText:null===(m=u.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),J=n((function(e){var t=e.vm,n=d().t;return o.createElement("div",{className:U.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:U.LightText}," / "+(0===t.checkout.shippingLines[0].price?n("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):n("checkout-page:standartShipping"))})),Q=n((function(e){var t=e.vm,n=d().t;return o.createElement("div",{className:U.Footer},o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},n("checkout-page:returnPolicy")),o.createElement("div",{className:U.FooterBullet},"•"),o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},n("checkout-page:privacyPolicy")),o.createElement("div",{className:U.FooterBullet},"•"),o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},n("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:U.FooterBullet},"•"),o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:imprint"),t.policyModalText=t.imprint}},n("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:U.FooterBullet},"•"),o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},n("checkout-page:shippingPolicy"))))})),Z=n((function(n){var i,r,a,s=n.vm,c=n.setVisible,l=d().t,m=o.useState(!1),u=m[0],p=m[1],v=o.useState(!1),f=v[0],g=v[1],h=o.useState(new y({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];h.email=(null===(i=s.checkout.customer)||void 0===i?void 0:i.email)||"",h.firstName=(null===(r=s.checkout.customer)||void 0===r?void 0:r.firstName)||"",h.lastName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.lastName)||"";var E=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return f?[2,c(!1)]:(p(!0),[4,h.saveContactForm()]);case 1:return e.sent()&&g(!0),p(!1),[2]}}))}))}),[u]);return o.createElement(k,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,f&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(M,{type:"success",title:l("checkout-page:contactFormSent"),content:l("checkout-page:contactFormDescription")})),o.createElement(T,{type:w.TEXT_AREA,label:"",value:h.message||"",onChange:h.onMessageChange,textAreaPlaceholder:l("checkout-page:contactFormCta")}),o.createElement(I,{style:{width:"100%",marginTop:"24px"},text:l(f?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:u,isDisabled:!h.message,onClick:E})),onClose:function(){return c(!1)}})}));export{G as default};
1
+ import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as n}from"mobx-react-lite";import{useRouter as i}from"next/router.js";import r from"next/link.js";import a from"react-tooltip";import s,{CheckoutStep as c}from"./model.js";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import u from"./steps/step-info/index.js";import{CheckoutStepShipping as p}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CouponErrorCode as f,Coupon as g,CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as E}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as y}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as x}from"./steps/step-success/index.js";import{Modal as k}from"./components/modal/index.js";import C from"./components/master-pass/modal-otp/index.js";import j from"./components/master-pass/modal-response/index.js";import P from"./components/master-pass/modal-success/index.js";import{Image as N}from"../image/index.js";import b,{Step as S}from"./components/step-container/index.js";import{StockError as O}from"./components/error/stock-error/index.js";import{FullscreenLoading as F}from"./components/fullscreen-loading/index.js";import M from"./components/notification-box/index.js";import{FormItem as T}from"./components/form-item/index.js";import{FormItemType as w}from"./components/form-item/model.js";import{Button as I}from"./components/button/index.js";import{IkasPageHead as A}from"../page/head.js";import B from"./components/offer-product/index.js";import L from"./components/offer-product/placeholder-offer-product.js";import D from"./components/svg/ikas.js";import U from"./style.module.scss.js";import{Analytics as V}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import R from"./components/epaykolay-button/index.js";import _ from"./components/svg/success-circle.js";import z from"./components/offer-product/offer-dots/index.js";import H from"./components/offer-product/offer-arrows/index.js";import K from"./components/offer-product/useCampaignOffer.js";var G=n((function(n){var r,m,u,p,v,f,g,y=n.checkout,b=n.checkoutSettings,S=n.customizationProps,M=n.returnPolicy,T=n.privacyPolicy,w=n.termsOfService,G=n.imprint,q=n.shippingPolicy,J=d().t,$=i(),ee=o.useState((function(){return new s(y,b,$,M,T,w,G,q,J,S||{})}))[0],te=K(ee),oe=te.setShowDetailPage,ne=te.setActiveIndex,ie=te.setIsActiveOverlay,re=te.handlePrev,ae=te.handleNext,se=te.isPopupClosedIndexPage,ce=te.isPopupShowIndexPage,le=te.isShowSuccessPageMiddlePhase,me=te.activeIndex,de=o.useMemo((function(){return Date.now()}),[]);ee.step===c.PAYMENT&&V.disableHTML();var ue=function(o,n,i,r,a){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/get-basket"),[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()},body:JSON.stringify({cartId:ee.checkout.id,customerNumber:o,sessionsState:de,addressDto:i,paymentType:r,totalPrice:a})})];case 1:return[2,t.sent().json()]}}))}))};o.useEffect((function(){ee.checkoutSettings.isAccountRequired&&!ee.checkout.hasCustomer&&$.push("/account/login?redirect="+encodeURIComponent(ee.checkoutUrl)),V.beginCheckout(ee.checkout),V.pageView(E.CHECKOUT)}),[]),o.useEffect((function(){ee.customizationProps=S,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==e?void 0:e.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==e?void 0:e.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==e?void 0:e.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==e?void 0:e.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==e?void 0:e.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==e?void 0:e.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==e?void 0:e.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==e?void 0:e.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==e?void 0:e.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==e?void 0:e.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==e?void 0:e.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(S)}),[S]),o.useEffect((function(){if(ee.isEPayKolayEnabled)var o=setInterval((function(){var n,i;window.setContainerService&&ee.isCheckoutLoaded&&(window.setContainerService(null===(n=l.getMerchantSettings())||void 0===n?void 0:n.merchantId,ue,(function(o){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,pe(o)];case 1:return[2,e.sent()]}}))}))}),(function(){console.log("Switching to epaykolay"),ee.isEPayKolayPayment=!0}),"https://cdn-epeykolay.mncdn.com/".concat((null===(i=l.getApiUrl())||void 0===i?void 0:i.includes("myikas.com"))?"epay":"epay-uat","/")),clearInterval(o))}),100)}),[]);var pe=o.useCallback((function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,fetch("".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/complete-payment"),{method:"POST",body:JSON.stringify({data:o,cartId:ee.checkout.id}),headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()}})];case 1:return[4,t.sent().json()];case 2:return e=t.sent(),[2,{redirectUrl:"".concat(window.location.pathname,"?id=").concat(ee.checkout.id,"&step=").concat(e.success?"success":"info"),orderId:e.orderNumber||null}]}}))}))}),[]);if(!ee.isCheckoutLoaded||!ee.store.customerStore.initialized)return o.createElement(F,null);if(ee.checkout.hasCustomer&&(null===(r=ee.store.customerStore.customer)||void 0===r?void 0:r.id)!==(null===(m=ee.checkout.customer)||void 0===m?void 0:m.id))return $.push("/account/login?redirect="+encodeURIComponent(ee.checkoutUrl)),null;return o.createElement(o.Fragment,null,o.createElement(A,{pageType:E.CHECKOUT,pageTitle:((null===(u=ee.merchantSettings)||void 0===u?void 0:u.merchantName)||"")+" - "+J("checkout-page:securePayment"),pageDescription:J("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:U.CheckoutPage},le?o.createElement("div",{className:U.FullPageOfferMain},o.createElement("div",{className:U.FullPageOfferContainer},o.createElement("div",{className:U.LogoMain},(null===(p=ee.customizationProps)||void 0===p?void 0:p.logo)?o.createElement("div",{className:U.Logo},o.createElement(N,{layout:"fill",image:ee.customizationProps.logo,sizes:"360px"})):(null===(v=ee.merchantSettings)||void 0===v?void 0:v.logo)?o.createElement("div",{className:U.Logo},o.createElement(N,{layout:"fill",image:ee.merchantSettings.logo,sizes:"360px"})):(null===(f=ee.merchantSettings)||void 0===f?void 0:f.merchantName)||""),o.createElement("div",{className:U.OfferSuccessInfo},o.createElement("div",null,o.createElement("div",{className:U.OfferSuccessHeader},o.createElement(_,{className:U.SuccessCircle}),o.createElement("span",{className:U.SuccessTitle},J("checkout-page:orderSuccessShortTitle"))),o.createElement("div",{className:U.OfferOrderInfoMain},o.createElement("div",{className:U.InfoTitle},J("checkout-page:orderNoAndDate"),":"),o.createElement("div",{className:U.InfoText},"#"+(ee.checkout.orderNumber||"")," ",ee.checkout.dateStr))),o.createElement("div",null,o.createElement(I,{classes:U.OfferButton,isLine:!0,text:J("checkout-page:actions.goOrderDetailPage"),onClick:function(){oe(!1)}}))),o.createElement("div",null,ee.campaignOffers&&!!ee.campaignOffers.length&&ee.isCampaignOfferLoaded&&o.createElement("div",{className:U.CampaignOfferMain},o.createElement("div",{className:U.OfferSlider},ee.campaignOffers.map((function(e,t){var n;return o.createElement(B,{vm:ee,campaignOffer:e,index:t,activeIndex:me,offersLength:(null===(n=ee.campaignOffers)||void 0===n?void 0:n.length)||0,handlePrev:re,handleNext:ae,setActiveIndex:function(e){return ne(e)},desktopMiddlePhase:!0,step:ee.step})}))),ee.campaignOffers.length>1&&o.createElement(H,{handlePrev:re,handleNext:ae}),ee.campaignOffers.length>1&&o.createElement(z,{vm:ee,activeIndex:me}))))):null,o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:U.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[U.Left,ee.isEPayKolayPayment?U.epaykolay:""].join(" ")},ee.isEPayKolayEnabled&&o.createElement("div",{id:"plateau_ui_placeholder",style:{width:"100%"}}),!ee.isEPayKolayPayment&&o.createElement("div",{className:U.LeftContent},o.createElement("div",null,o.createElement(Y,{vm:ee}),ee.hasStockError&&o.createElement("div",{className:U.ErrorContainer},o.createElement(O,{vm:ee,error:ee.error})),!ee.hasStockError&&o.createElement(o.Fragment,null,ee.step!==c.SUCCESS&&o.createElement(h,{vm:ee,allowExpand:!0}),o.createElement("div",null,ee.step!==c.SUCCESS&&ee.isEPayKolayEnabled&&o.createElement(R,{onClick:function(){window.frictionless()}})),ee.step===c.SUCCESS?o.createElement(x,{vm:ee}):o.createElement(o.Fragment,null,!!(null===(g=ee.customizationProps)||void 0===g?void 0:g.showCampaignOffersDesign)&&l.getIsEditor()&&o.createElement(L,{vm:ee}),ce&&o.createElement("div",{className:[U.MiddlePhaseOverlay,ce?U.MiddlePhaseOverlayPopup:""].join(" ")}),ee.campaignOffers&&!!ee.campaignOffers.length&&ee.isCampaignOfferLoaded&&o.createElement("div",{className:[U.CampaignOfferMain,ce?U.OverlayPopupMain:""].join(" ")},o.createElement("div",{className:U.OfferSlider},ee.campaignOffers.map((function(e,t){var n;return o.createElement(B,{vm:ee,campaignOffer:e,index:t,activeIndex:me,offersLength:(null===(n=ee.campaignOffers)||void 0===n?void 0:n.length)||0,handlePrev:re,handleNext:ae,setActiveIndex:function(e){return ne(e)},step:ee.step,isPopupClosed:se,isPopupShow:ce,closePopup:function(){return ie(!1)},showPopup:function(){return ie(!0)}})}))),ee.campaignOffers.length>1&&o.createElement(H,{handlePrev:re,handleNext:ae}),ee.campaignOffers.length>1&&o.createElement(z,{isPopupShow:ce,vm:ee,activeIndex:me})),ee.isCouponCodeRequirementOpen&&o.createElement(W,{vm:ee}),o.createElement(X,{vm:ee}))),o.createElement("div",{className:U.Space})),o.createElement(Q,{vm:ee}))),o.createElement("div",{className:U.Right},o.createElement("div",{className:U.RightContent},o.createElement(h,{vm:ee}),!ee.isPoweredByHidden&&o.createElement("div",{className:U.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===l.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(D,null))))),!!ee.policyModalText&&o.createElement(k,{title:ee.policyModalTitle,modalContent:ee.policyModalText,onClose:function(){ee.policyModalText=""}}),ee.isContactModalVisible&&o.createElement(Z,{vm:ee,setVisible:ee.setContactModalVisible}),ee.mpVM.isOtpModalVisible&&o.createElement(C,{vm:ee,visible:ee.mpVM.isOtpModalVisible,type:ee.mpVM.otpModalType,onClose:ee.mpVM.hideOtpModal}),ee.mpVM.isResponseModalVisible&&o.createElement(j,{visible:ee.mpVM.isResponseModalVisible,text:ee.mpVM.mfsResponseModalText,onClose:ee.mpVM.onResponseModalClose}),ee.mpVM.isSuccessModalVisible&&o.createElement(P,{visible:ee.mpVM.isSuccessModalVisible,type:ee.mpVM.successModalType,onClose:ee.mpVM.onSuccessModalClose})))})),Y=n((function(e){var t,n,i,a,s=e.vm,c=d().t;return o.createElement("div",{className:U.Header},o.createElement(r,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=s.customizationProps)||void 0===t?void 0:t.logo)?o.createElement("div",{className:U.Logo},o.createElement(N,{layout:"fill",image:s.customizationProps.logo,sizes:"360px"})):(null===(n=s.merchantSettings)||void 0===n?void 0:n.logo)?o.createElement("div",{className:U.Logo},o.createElement(N,{layout:"fill",image:s.merchantSettings.logo,sizes:"360px"})):(null===(i=s.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!s.checkout.hasCustomer&&o.createElement("div",{className:U.LoginText},o.createElement("span",{className:U.LoginCta},c("checkout-page:alreadyHaveAnAccount")),o.createElement(r,{href:"/account/login?redirect="+encodeURIComponent(s.checkoutUrl),passHref:!0},o.createElement("a",{className:U.LoginBtn},c("checkout-page:actions.login")))),s.checkout.hasCustomer&&o.createElement("div",{className:U.CustomerInfo},o.createElement("div",{className:U.Name},s.checkout.customerFullName),o.createElement("div",{className:U.Email},null===(a=s.checkout.customer)||void 0===a?void 0:a.email)))})),W=n((function(e){var t=e.vm,n=d().t,i=o.useState(!1),r=i[0],a=i[1],s=o.useState(null),c=s[0],l=s[1],m=o.useMemo((function(){switch(c){case f.COUPON_CODE_NOT_EXIST:return n("checkout-page:giftCodeErrorDescription");case f.COUPON_CODE_NOT_EXIST_FOR_GUESS:return n("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[c]);return o.createElement("div",{className:U.CouponContainer},r&&o.createElement("div",{className:U.NotificationContainer},o.createElement(M,{type:"warning",title:n("checkout-page:giftCodeErrorTitle"),content:m,onClose:function(){a(!1),l(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:r?12:0}},o.createElement(g,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:a,setCouponErrorCode:l})))})),X=n((function(e){var t=e.vm,n=d().t,i=o.useMemo((function(){switch(t.step){case c.INFO:return o.createElement(u,{vm:t});case c.SHIPPING:return o.createElement(p,{vm:t});case c.PAYMENT:return o.createElement(v,{vm:t});case c.SUCCESS:return o.createElement(x,{vm:t})}}),[t,t.step]),r=[new S(n("checkout-page:address"),t.step===c.INFO,t.step!==c.INFO,t.step!==c.INFO?o.createElement("div",{className:U.AdressStepInfo},o.createElement(q,{vm:t}),!t.isUpsellOrder&&o.createElement("div",{className:U.EditBtn,onClick:t.onBackToInfoClick},n("checkout-page:actions.edit"))):void 0,t.step!==c.INFO?o.createElement("div",{className:U.AddressStepInfoMobile},o.createElement(q,{vm:t})):void 0),new S(n("checkout-page:payment"),t.step===c.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||r.splice(1,0,new S(n("checkout-page:shipping"),t.step===c.SHIPPING,t.step===c.PAYMENT,t.step===c.PAYMENT?o.createElement("div",{className:U.AdressStepInfo},o.createElement(J,{vm:t}),!t.isUpsellOrder&&!t.isManualOrderWithShippingLines&&(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:U.EditBtn,onClick:t.onBackToShippingClick},n("checkout-page:actions.edit"))):void 0,t.step===c.PAYMENT?o.createElement("div",{className:U.AddressStepInfoMobile},o.createElement(J,{vm:t})):void 0)),o.createElement(b,{steps:r,stepContent:i})})),q=n((function(e){var t,n,i,r,a,s,c,l,m,u=e.vm,p=d().t,v=u.isDigitalOnly?((null===(t=u.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(n=u.checkout.billingAddress)||void 0===n?void 0:n.lastName)||""):((null===(i=u.checkout.shippingAddress)||void 0===i?void 0:i.firstName)||"")+" "+((null===(r=u.checkout.shippingAddress)||void 0===r?void 0:r.lastName)||"");return o.createElement("div",{className:U.Address},o.createElement("div",{className:[U.Text,U.WithMBottom].join(" ")},(null===(a=u.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===u.deliveryMethod?o.createElement("div",{className:U.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:U.Text},p("checkout-page:receiver")),o.createElement("div",{className:[U.Text,U.Gray].join(" ")},v)),o.createElement("div",{className:[U.Text,U.Gray].join(" ")},u.isDigitalOnly?null===(s=u.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(c=u.checkout.shippingAddress)||void 0===c?void 0:c.phone),"in-store"===u.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[U.Text,U.WithMTop].join(" ")},p("checkout-page:pickUpLocation"))),o.createElement("div",{className:[U.Text,U.Gray].join(" ")},u.isDigitalOnly?null===(l=u.checkout.billingAddress)||void 0===l?void 0:l.addressText:null===(m=u.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),J=n((function(e){var t=e.vm,n=d().t;return o.createElement("div",{className:U.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:U.LightText}," / "+(0===t.checkout.shippingLines[0].price?n("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):n("checkout-page:standartShipping"))})),Q=n((function(e){var t=e.vm,n=d().t;return o.createElement("div",{className:U.Footer},o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},n("checkout-page:returnPolicy")),o.createElement("div",{className:U.FooterBullet},"•"),o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},n("checkout-page:privacyPolicy")),o.createElement("div",{className:U.FooterBullet},"•"),o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},n("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:U.FooterBullet},"•"),o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:imprint"),t.policyModalText=t.imprint}},n("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:U.FooterBullet},"•"),o.createElement("div",{className:U.FooterItem,onClick:function(){t.policyModalTitle=n("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},n("checkout-page:shippingPolicy"))))})),Z=n((function(n){var i,r,a,s=n.vm,c=n.setVisible,l=d().t,m=o.useState(!1),u=m[0],p=m[1],v=o.useState(!1),f=v[0],g=v[1],h=o.useState(new y({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];h.email=(null===(i=s.checkout.customer)||void 0===i?void 0:i.email)||"",h.firstName=(null===(r=s.checkout.customer)||void 0===r?void 0:r.firstName)||"",h.lastName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.lastName)||"";var E=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return f?[2,c(!1)]:(p(!0),[4,h.saveContactForm()]);case 1:return e.sent()&&g(!0),p(!1),[2]}}))}))}),[u]);return o.createElement(k,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,f&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(M,{type:"success",title:l("checkout-page:contactFormSent"),content:l("checkout-page:contactFormDescription")})),o.createElement(T,{type:w.TEXT_AREA,label:"",value:h.message||"",onChange:h.onMessageChange,textAreaPlaceholder:l("checkout-page:contactFormCta")}),o.createElement(I,{style:{width:"100%",marginTop:"24px"},text:l(f?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:u,isDisabled:!h.message,onClick:E})),onClose:function(){return c(!1)}})}));export{G as default};
@@ -9,7 +9,7 @@ import { TFunction } from "../../utils/i18n";
9
9
  import { IkasCheckoutCustomizationProps } from ".";
10
10
  import MasterPassModel from "./modelMasterPass";
11
11
  import { APIResponse } from "@ikas/fe-api-client";
12
- import { CreateStripePaymentIntentResponse, RetrieveInstallmentInfoResponse, UpdateCartCampaignOfferInput, CreateKlarnaTokenResponse, CreateAdyenSessionResponse, GetPaypalClientIdResponse, CreatePaypalOrderResponse } from "@ikas/storefront-api";
12
+ import { CreateStripePaymentIntentResponse, RetrieveInstallmentInfoResponse, UpdateCartCampaignOfferInput, CreateKlarnaTokenResponse, GetPaypalClientIdResponse, CreatePaypalOrderResponse, CreateAdyenPlatformSessionResponse } from "@ikas/storefront-api";
13
13
  import { IkasBaseStore } from "../../store";
14
14
  import { RetrieveInstallmentInfoQueryParams, SaveCartInput } from "@ikas/storefront-api";
15
15
  import { LocalizedAddressModel } from "@ikas/localized-address";
@@ -48,7 +48,8 @@ export default class CheckoutViewModel {
48
48
  stripeError: CheckoutError | null;
49
49
  klarnaResponse: CreateKlarnaTokenResponse | null;
50
50
  isKlarnaPaymentCompleted: boolean;
51
- adyenResponse: CreateAdyenSessionResponse | null;
51
+ klarnaError: CheckoutError | null;
52
+ adyenResponse: CreateAdyenPlatformSessionResponse | null;
52
53
  adyenDropinElement: any;
53
54
  payPalClientIdResponse: GetPaypalClientIdResponse | null;
54
55
  paypalOrderResponse: CreatePaypalOrderResponse | null;
@@ -91,6 +92,7 @@ export default class CheckoutViewModel {
91
92
  get canProceedToInStoreDelivery(): boolean;
92
93
  get canProceedToPayment(): boolean | "" | null | undefined;
93
94
  get isValidShippingSettings(): boolean | "" | null | undefined;
95
+ get isManualOrderWithShippingLines(): boolean | 0 | undefined;
94
96
  get isInStoreDelivery(): boolean;
95
97
  get klarnaPaymentGateway(): IkasPaymentGateway | undefined;
96
98
  get klarnaPaymentGatewayIndex(): number;
@@ -153,6 +155,7 @@ export default class CheckoutViewModel {
153
155
  onProceedToDigitalOnlyPaymentClick: () => Promise<void>;
154
156
  onProceedToPaymentClick: () => Promise<void>;
155
157
  checkPaypalButtonAvailable: () => boolean;
158
+ handlePaymentError: (type: ErrorType, data: any) => void;
156
159
  onCompletePaymentClick: () => Promise<void>;
157
160
  onCompleteDigitalOnlyPaymentClick: () => Promise<void>;
158
161
  createSaleTransaction: () => Promise<void>;
@@ -166,7 +169,7 @@ export default class CheckoutViewModel {
166
169
  reInitPaymentMethod: () => Promise<void>;
167
170
  createStripePaymentIntent: (paymentGateway: IkasPaymentGateway) => Promise<void>;
168
171
  createKlarnaClientToken: (paymentGateway: IkasPaymentGateway) => Promise<void>;
169
- createAdyenClientToken: (paymentGateway: IkasPaymentGateway) => Promise<void>;
172
+ createAdyenBalancePlatformPaymentSession: (paymentGateway: IkasPaymentGateway) => Promise<void>;
170
173
  getPayPalClientId: (paymentGateway: IkasPaymentGateway) => Promise<void>;
171
174
  setPaymentGateway: (index: number) => Promise<void>;
172
175
  setInstallmentCount: (count: number) => void;