@ikas/storefront 5.0.59 → 5.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/checkout/components/step-container/index.d.ts +3 -0
- package/build/components/checkout/components/step-container/index.js +1 -1
- package/build/components/checkout/components/step-container/style.module.scss.js +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/style.module.scss.js +1 -1
- package/build/components/page/head.js +1 -1
- package/build/components/page/widgets/loyaltyWidget.js +1 -1
- package/build/components/page/widgets/popupWidget.js +1 -1
- package/build/components/pay-with-ikas/index.d.ts +1 -0
- package/build/components/pay-with-ikas/index.js +1 -1
- package/build/hooks/useStore.js +1 -1
- package/build/pages/checkout.js +1 -1
- package/build/store/cart/index.d.ts +1 -1
- package/build/store/cart/index.js +1 -1
- package/package.json +12 -12
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { CheckoutStep } from "../../model";
|
|
2
3
|
declare type Props = {
|
|
3
4
|
steps: Step[];
|
|
4
5
|
stepContent: React.ReactElement;
|
|
6
|
+
step?: CheckoutStep;
|
|
7
|
+
hasTopMargin?: boolean;
|
|
5
8
|
};
|
|
6
9
|
declare const StepContainer: React.FC<Props>;
|
|
7
10
|
export default StepContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import{makeAutoObservable as i}from"mobx";import n from"../checkbox/check.js";import a from"./style.module.scss.js";import{PayWithIkas as l}from"../../../pay-with-ikas/index.js";import{CheckoutStep as o}from"../../model.js";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";var r=t((function(t){var i=t.steps,r=t.stepContent,c=t.step,m=t.hasTopMargin;e.useEffect((function(){var e,t;if(document.body.getBoundingClientRect().width<768){var n=i.findIndex((function(e){return e.isSelected}));if(0===n)return;2===n?null===(e=document.getElementById("step-".concat(1)))||void 0===e||e.scrollIntoView():null===(t=document.getElementById("step-".concat(n)))||void 0===t||t.scrollIntoView()}}),[]);var d=s.getPayWithIkasUrl();return e.createElement("div",{className:a.StepContainer},c===o.INFO&&d&&e.createElement("div",{className:[a.PayWithIkasContainer,m?a.HasTopMargin:""].join(" ")},e.createElement("div",{className:a.PayWithIkasContent},e.createElement("span",{className:a.PayWithIkasTitle},"Hızlı Öde ile Kolay Alışveriş"),e.createElement("span",{className:a.PayWithIkasDescription},"Bilgilerini bir kez kaydet, 20.000 e-ticaret sitesinde tek tıkla öde.")),e.createElement("div",{className:a.PayWithIkasButton},e.createElement(l,{useExistingCart:!0}))),i.map((function(t,i){return e.createElement("div",{className:a.Step},e.createElement("div",{id:"step-".concat(i),className:[a.StepTitleContainer,0===i?a.First:""].join(" ")},e.createElement("div",{className:[a.StepTitleTop,t.titleRightContent?a.WithRightContent:""].join(" ")},e.createElement("div",{className:[a.StepCircle,t.isSelected||t.isComplete?a.Selected:""].join(" ").trim()},t.isComplete?e.createElement(n,null):i+1),e.createElement("div",{className:[a.StepTitle,t.isSelected||t.isComplete?"":a.Light].join(" ")},t.label),!!t.titleRightContent&&e.createElement("div",{className:a.StepTitleRightContent},t.titleRightContent)),!!t.titleBottomContent&&e.createElement("div",{className:a.StepTitleBottom},t.titleBottomContent)),t.isSelected&&e.createElement("div",{className:a.StepContent},r))})))})),c=function(e,t,n,a,l){this.label=e,this.isSelected=t,this.isComplete=n,this.titleRightContent=a,this.titleBottomContent=l,i(this)};export{c as Step,r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var t={StepContainer:"style-module_StepContainer__2C4C1",Step:"style-module_Step__y2Vro",StepTitleContainer:"style-module_StepTitleContainer__A8Lkg",First:"style-module_First__jH8s6",StepTitleTop:"style-module_StepTitleTop__3PuCO",WithRightContent:"style-module_WithRightContent__IhjA-",StepCircle:"style-module_StepCircle__PGY--",Selected:"style-module_Selected__-Y7Yq",StepTitle:"style-module_StepTitle__hyDmR",Light:"style-module_Light__y8MER",StepTitleRightContent:"style-module_StepTitleRightContent__oFGFw",StepContent:"style-module_StepContent__9pGUV"};e(".style-module_StepContainer__2C4C1 {\n width: 100%;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro {\n width: 100%;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg {\n padding: 24px 0;\n border-top: 1px solid var(--checkout-border-color);\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg.style-module_First__jH8s6 {\n border-top: none;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepTitleTop__3PuCO {\n display: flex;\n align-items: center;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepTitleTop__3PuCO.style-module_WithRightContent__IhjA- {\n align-items: flex-start;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepCircle__PGY-- {\n width: 32px;\n height: 32px;\n border-radius: 100%;\n border: 1px solid var(--checkout-button-bg-color);\n color: var(--checkout-button-bg-color);\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 16px;\n flex: 0 0 auto;\n font-size: 20px;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepCircle__PGY--.style-module_Selected__-Y7Yq {\n background-color: var(--checkout-button-bg-color);\n color: var(--checkout-button-text-color);\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepCircle__PGY--.style-module_Selected__-Y7Yq svg {\n transform: scale(1.5);\n position: relative;\n right: -1px;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepTitle__hyDmR {\n font-size: 22px;\n color: var(--checkout-primary-text-color);\n flex: 0 0 auto;\n font-weight: 600;\n line-height: 32px;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepTitle__hyDmR.style-module_Light__y8MER {\n color: var(--checkout-button-disabled-text-color);\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepTitleRightContent__oFGFw {\n flex: 1 1 auto;\n}\n.style-module_StepContainer__2C4C1 .style-module_StepContent__9pGUV {\n padding-bottom: 24px;\n padding-left: 48px;\n width: 100%;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_StepContainer__2C4C1 {\n padding: 0 24px;\n }\n .style-module_StepContainer__2C4C1 .style-module_StepContent__9pGUV {\n padding-left: 0px;\n }\n}");export{t as default};
|
|
1
|
+
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var t={StepContainer:"style-module_StepContainer__2C4C1",Step:"style-module_Step__y2Vro",StepTitleContainer:"style-module_StepTitleContainer__A8Lkg",First:"style-module_First__jH8s6",StepTitleTop:"style-module_StepTitleTop__3PuCO",WithRightContent:"style-module_WithRightContent__IhjA-",StepCircle:"style-module_StepCircle__PGY--",Selected:"style-module_Selected__-Y7Yq",StepTitle:"style-module_StepTitle__hyDmR",Light:"style-module_Light__y8MER",StepTitleRightContent:"style-module_StepTitleRightContent__oFGFw",StepContent:"style-module_StepContent__9pGUV",PayWithIkasContainer:"style-module_PayWithIkasContainer__ex863",PayWithIkasContent:"style-module_PayWithIkasContent__WSxkH",PayWithIkasTitle:"style-module_PayWithIkasTitle__67vhn",PayWithIkasDescription:"style-module_PayWithIkasDescription__k6kqx",PayWithIkasButton:"style-module_PayWithIkasButton__Z1rka",HasTopMargin:"style-module_HasTopMargin__6-CHw"};e(".style-module_StepContainer__2C4C1 {\n width: 100%;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro {\n width: 100%;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg {\n padding: 24px 0;\n border-top: 1px solid var(--checkout-border-color);\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg.style-module_First__jH8s6 {\n border-top: none;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepTitleTop__3PuCO {\n display: flex;\n align-items: center;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepTitleTop__3PuCO.style-module_WithRightContent__IhjA- {\n align-items: flex-start;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepCircle__PGY-- {\n width: 32px;\n height: 32px;\n border-radius: 100%;\n border: 1px solid var(--checkout-button-bg-color);\n color: var(--checkout-button-bg-color);\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 16px;\n flex: 0 0 auto;\n font-size: 20px;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepCircle__PGY--.style-module_Selected__-Y7Yq {\n background-color: var(--checkout-button-bg-color);\n color: var(--checkout-button-text-color);\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepCircle__PGY--.style-module_Selected__-Y7Yq svg {\n transform: scale(1.5);\n position: relative;\n right: -1px;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepTitle__hyDmR {\n font-size: 22px;\n color: var(--checkout-primary-text-color);\n flex: 0 0 auto;\n font-weight: 600;\n line-height: 32px;\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepTitle__hyDmR.style-module_Light__y8MER {\n color: var(--checkout-button-disabled-text-color);\n}\n.style-module_StepContainer__2C4C1 .style-module_Step__y2Vro .style-module_StepTitleContainer__A8Lkg .style-module_StepTitleRightContent__oFGFw {\n flex: 1 1 auto;\n}\n.style-module_StepContainer__2C4C1 .style-module_StepContent__9pGUV {\n padding-bottom: 24px;\n padding-left: 48px;\n width: 100%;\n}\n.style-module_StepContainer__2C4C1 .style-module_PayWithIkasContainer__ex863 {\n border-radius: 8px;\n border: 1px solid #f4f4f5;\n padding: 20px;\n gap: 32px;\n height: 112px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background-color: #fafafa;\n margin-bottom: 20px;\n}\n.style-module_StepContainer__2C4C1 .style-module_PayWithIkasContent__WSxkH {\n display: flex;\n flex-direction: column;\n}\n.style-module_StepContainer__2C4C1 .style-module_PayWithIkasTitle__67vhn {\n font-size: 18px;\n font-weight: 500;\n color: #09090b;\n line-height: 28px;\n margin-bottom: 4px;\n}\n.style-module_StepContainer__2C4C1 .style-module_PayWithIkasDescription__k6kqx {\n font-size: 14px;\n font-weight: 400;\n color: #52525b;\n line-height: 20px;\n}\n.style-module_StepContainer__2C4C1 .style-module_PayWithIkasButton__Z1rka {\n height: 56px;\n}\n.style-module_StepContainer__2C4C1 .style-module_HasTopMargin__6-CHw {\n margin-top: 24px;\n}\n@media only screen and (max-width: 1280px) {\n .style-module_StepContainer__2C4C1 .style-module_PayWithIkasContainer__ex863 {\n border-radius: 8px;\n border: 1px solid #f4f4f5;\n padding: 20px;\n gap: 16px;\n height: auto;\n flex-direction: column;\n align-items: inherit;\n margin-bottom: 8px;\n margin-top: 24px;\n }\n}\n@media only screen and (max-width: 1000px) {\n .style-module_StepContainer__2C4C1 {\n padding: 0 24px;\n }\n .style-module_StepContainer__2C4C1 .style-module_StepContent__9pGUV {\n padding-left: 0px;\n }\n}");export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as r}from"mobx-react-lite";import{useRouter as i}from"next/router.js";import n from"react-tooltip";import a,{CheckoutStep as s}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as l}from"../../utils/currency.js";import{useTranslation as m}from"../../utils/i18n.js";import d from"./steps/step-info/index.js";import{CheckoutStepShipping as p}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as u}from"./steps/step-payment/index.js";import{CouponErrorCode as f,Coupon as g,CartSummary as v}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as h}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as E}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as y}from"./steps/step-success/index.js";import{Modal as x}from"./components/modal/index.js";import k from"./components/master-pass/modal-otp/index.js";import C from"./components/master-pass/modal-response/index.js";import j from"./components/master-pass/modal-success/index.js";import{Image as P}from"../image/index.js";import N,{Step as O}from"./components/step-container/index.js";import{StockError as b}from"./components/error/stock-error/index.js";import{FullscreenLoading as S}from"./components/fullscreen-loading/index.js";import M from"./components/notification-box/index.js";import{FormItem as F}from"./components/form-item/index.js";import{FormItemType as T}from"./components/form-item/model.js";import{Button as w}from"./components/button/index.js";import{IkasPageHead as I}from"../page/head.js";import A from"./components/offer-product/index.js";import B from"./components/offer-product/placeholder-offer-product.js";import L from"./components/svg/ikas.js";import D from"./style.module.scss.js";import{Analytics as V}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import U from"./components/svg/success-circle.js";import R from"./components/offer-product/offer-dots/index.js";import z from"./components/offer-product/offer-arrows/index.js";import _ from"./components/offer-product/useCampaignOffer.js";import H from"../../hooks/useDimension.js";var W=r((function(e){var t,r,l,d,p,u,f,g=e.checkout,E=e.checkoutSettings,N=e.customizationProps,O=e.returnPolicy,M=e.privacyPolicy,F=e.termsOfService,T=e.imprint,A=e.shippingPolicy,R=m().t,z=i(),H=o.useState(Date.now()),W=H[0],X=H[1],K=o.useState((function(){return new a(g,E,z,O,M,F,T,A,R,N||{})}))[0];o.useEffect((function(){X(Date.now())}),[g.campaignOffers,K.campaignOffers,K.isCampaignOfferLoaded]);var ee=_(K),te=ee.setShowDetailPage,oe=ee.isPopupShowIndexPage,re=ee.isShowSuccessPageMiddlePhase;o.useMemo((function(){return Date.now()}),[]);return K.step,s.PAYMENT,o.useEffect((function(){var e;K.checkoutSettings.isAccountRequired&&!K.checkout.hasCustomer&&z.push("/account/login?redirect="+encodeURIComponent(K.checkoutUrl)),new URLSearchParams(window.location.search).get("step")!==s.SUCCESS&&(K.checkoutSettings.isAccountRequired&&(null===(e=K.checkout.customer)||void 0===e?void 0:e.isGuestCheckout)||V.beginCheckout(K.checkout)),V.pageView(h.CHECKOUT)}),[]),o.useEffect((function(){K.customizationProps=N,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==e?void 0:e.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==e?void 0:e.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==e?void 0:e.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==e?void 0:e.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==e?void 0:e.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==e?void 0:e.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==e?void 0:e.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==e?void 0:e.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==e?void 0:e.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==e?void 0:e.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==e?void 0:e.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==e?void 0:e.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(N)}),[N]),K.isCheckoutLoaded&&K.store.customerStore.initialized?K.checkout.hasCustomer&&(null===(t=K.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(r=K.checkout.customer)||void 0===r?void 0:r.id)?(z.push("/account/login?redirect="+encodeURIComponent(K.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(I,{pageType:h.CHECKOUT,pageTitle:((null===(l=K.merchantSettings)||void 0===l?void 0:l.merchantName)||"")+" - "+R("checkout-page:securePayment"),pageDescription:R("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:D.CheckoutPage},re?o.createElement("div",{className:D.FullPageOfferMain},o.createElement("div",{className:D.FullPageOfferContainer},o.createElement("div",{className:D.LogoMain},(null===(d=K.customizationProps)||void 0===d?void 0:d.logo)?o.createElement("div",{className:D.Logo},o.createElement(P,{layout:"fill",image:K.customizationProps.logo,sizes:"360px"})):(null===(p=K.merchantSettings)||void 0===p?void 0:p.logo)?o.createElement("div",{className:D.Logo},o.createElement(P,{layout:"fill",image:K.merchantSettings.logo,sizes:"360px"})):(null===(u=K.merchantSettings)||void 0===u?void 0:u.merchantName)||""),o.createElement("div",{className:D.OfferSuccessInfo},o.createElement("div",null,o.createElement("div",{className:D.OfferSuccessHeader},o.createElement(U,{className:D.SuccessCircle}),o.createElement("span",{className:D.SuccessTitle},R("checkout-page:orderSuccessShortTitle"))),o.createElement("div",{className:D.OfferOrderInfoMain},o.createElement("div",{className:D.InfoTitle},R("checkout-page:orderNoAndDate"),":"),o.createElement("div",{className:D.InfoText},"#"+(K.checkout.orderNumber||"")," ",K.checkout.dateStr))),o.createElement("div",null,o.createElement(w,{classes:D.OfferButton,isLine:!0,text:R("checkout-page:actions.goOrderDetailPage"),onClick:function(){te(!1)}}))),o.createElement("div",null,o.createElement(Z,{vm:K,key:W})))):null,o.createElement(n,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:D.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[D.Left].join(" ")},o.createElement("div",{className:D.LeftContent},o.createElement("div",null,o.createElement(G,{vm:K}),K.hasStockError&&o.createElement("div",{className:D.ErrorContainer},o.createElement(b,{vm:K,error:K.error})),!K.hasStockError&&o.createElement(o.Fragment,null,K.step!==s.SUCCESS&&o.createElement(v,{vm:K,allowExpand:!0}),K.step===s.SUCCESS?o.createElement(y,{vm:K}):o.createElement(o.Fragment,null,!!(null===(f=K.customizationProps)||void 0===f?void 0:f.showCampaignOffersDesign)&&c.getIsEditor()&&o.createElement(B,{vm:K}),oe&&o.createElement("div",{className:[D.MiddlePhaseOverlay,oe?D.MiddlePhaseOverlayPopup:""].join(" ")}),K.campaignOffers&&!!K.campaignOffers.length&&K.isCampaignOfferLoaded&&o.createElement($,{key:W,vm:K}),K.isCouponCodeRequirementOpen&&o.createElement(Y,{vm:K}),o.createElement(q,{vm:K}))),o.createElement("div",{className:D.Space})),o.createElement(J,{vm:K}))),o.createElement("div",{className:D.Right},o.createElement("div",{className:D.RightContent},o.createElement(v,{vm:K}),!K.isPoweredByHidden&&o.createElement("div",{className:D.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(L,null))))),!!K.policyModalText&&o.createElement(x,{title:K.policyModalTitle,modalContent:K.policyModalText,onClose:function(){K.policyModalText=""},isPolicyModal:!0}),K.isContactModalVisible&&o.createElement(Q,{vm:K,setVisible:K.setContactModalVisible}),K.mpVM.isOtpModalVisible&&o.createElement(k,{vm:K,visible:K.mpVM.isOtpModalVisible,type:K.mpVM.otpModalType,onClose:K.mpVM.hideOtpModal}),K.mpVM.isResponseModalVisible&&o.createElement(C,{visible:K.mpVM.isResponseModalVisible,text:K.mpVM.mfsResponseModalText,onClose:K.mpVM.onResponseModalClose}),K.mpVM.isSuccessModalVisible&&o.createElement(j,{visible:K.mpVM.isSuccessModalVisible,type:K.mpVM.successModalType,onClose:K.mpVM.onSuccessModalClose}))):o.createElement(S,null)})),G=r((function(e){var t,r,i,n,a=e.vm,s=c.getCurrentRouting(),l=(null==s?void 0:s.path)?"/".concat(s.path):"/",d=m().t;return o.createElement("div",{className:D.Header},o.createElement("a",{href:l},(null===(t=a.customizationProps)||void 0===t?void 0:t.logo)?o.createElement("div",{className:D.Logo},o.createElement(P,{layout:"fill",image:a.customizationProps.logo,sizes:"360px"})):(null===(r=a.merchantSettings)||void 0===r?void 0:r.logo)?o.createElement("div",{className:D.Logo},o.createElement(P,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.merchantName)||""),!a.checkout.hasCustomer&&!a.isOpenEditOrderWithTransaction&&!a.checkout.edited&&o.createElement("div",{className:D.LoginText},o.createElement("span",{className:D.LoginCta},d("checkout-page:alreadyHaveAnAccount")),o.createElement("a",{href:a.getGoToLoginHref(),className:D.LoginBtn},d("checkout-page:actions.login"))),(a.checkout.hasCustomer||a.isOpenEditOrderWithTransaction||a.checkout.edited)&&o.createElement("div",{className:D.CustomerInfo},o.createElement("div",{className:D.Name},a.checkout.customerFullName),o.createElement("div",{className:D.Email},null===(n=a.checkout.customer)||void 0===n?void 0:n.email)))})),Y=r((function(e){var t=e.vm,r=m().t,i=o.useState(!1),n=i[0],a=i[1],s=o.useState(null),c=s[0],l=s[1],d=H().isMobile,p=o.useMemo((function(){switch(c){case f.COUPON_CODE_NOT_EXIST:return r("checkout-page:giftCodeErrorDescription");case f.COUPON_CODE_NOT_EXIST_FOR_GUESS:return r("checkout-page:mustBeSignInToApplyCampaign");case f.COUPON_APPLIED_WITHOUT_DISCOUNT:return r("checkout-page:couponInvalidForCartItems");default:return""}}),[c]);return o.createElement("div",{className:D.CouponContainer},n&&o.createElement("div",{className:D.NotificationContainer},o.createElement(M,{type:"warning",title:r("checkout-page:giftCodeErrorTitle"),content:p,onClose:function(){a(!1),l(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:n?12:0}},o.createElement(g,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:a,setCouponErrorCode:l,showOnlyMobile:!0,isMobile:d})))})),q=r((function(e){var t=e.vm,r=m().t,i=o.useMemo((function(){switch(t.step){case s.INFO:return o.createElement(d,{vm:t});case s.SHIPPING:return o.createElement(p,{vm:t});case s.PAYMENT:return o.createElement(u,{vm:t});case s.SUCCESS:return o.createElement(y,{vm:t})}}),[t,t.step]),n=[new O(r("checkout-page:address"),t.step===s.INFO,t.step!==s.INFO,t.step!==s.INFO?o.createElement("div",{className:D.AdressStepInfo},o.createElement(X,{vm:t}),!(t.isUpsellOrder||t.isOpenEditOrderWithTransaction)&&o.createElement("div",{className:D.EditBtn,onClick:t.onBackToInfoClick},r("checkout-page:actions.edit"))):void 0,t.step!==s.INFO?o.createElement("div",{className:D.AddressStepInfoMobile},o.createElement(X,{vm:t})):void 0),new O(r("checkout-page:payment"),t.step===s.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||n.splice(1,0,new O(r("checkout-page:shipping"),t.step===s.SHIPPING,t.step===s.PAYMENT,t.step===s.PAYMENT?o.createElement("div",{className:D.AdressStepInfo},o.createElement(K,{vm:t}),!(t.isUpsellOrder||t.isOpenEditOrderWithTransaction)&&!t.isManualOrderWithShippingLines&&(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:D.EditBtn,onClick:t.onBackToShippingClick},r("checkout-page:actions.edit"))):void 0,t.step===s.PAYMENT?o.createElement("div",{className:D.AddressStepInfoMobile},o.createElement(K,{vm:t})):void 0)),o.createElement(N,{steps:n,stepContent:i})})),X=r((function(e){var t,r,i,n,a,s,c,l,d,p=e.vm,u=m().t,f=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(r=p.checkout.billingAddress)||void 0===r?void 0:r.lastName)||""):((null===(i=p.checkout.shippingAddress)||void 0===i?void 0:i.firstName)||"")+" "+((null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.lastName)||"");return o.createElement("div",{className:D.Address},o.createElement("div",{className:[D.Text,D.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:D.Text},f):o.createElement(o.Fragment,null,o.createElement("div",{className:D.Text},u("checkout-page:receiver")),o.createElement("div",{className:[D.Text,D.Gray].join(" ")},f)),o.createElement("div",{className:[D.Text,D.Gray].join(" ")},p.isDigitalOnly?null===(s=p.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(c=p.checkout.shippingAddress)||void 0===c?void 0:c.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[D.Text,D.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[D.Text,D.Gray].join(" ")},p.isDigitalOnly?null===(l=p.checkout.billingAddress)||void 0===l?void 0:l.addressText:null===(d=p.checkout.shippingAddress)||void 0===d?void 0:d.addressText))})),K=r((function(e){var t=e.vm,r=m().t;return o.createElement("div",{className:D.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:D.LightText}," / "+(0===t.checkout.shippingLines[0].finalPrice?r("checkout-page:free"):l(t.checkout.shippingLines[0].finalPrice,t.checkout.currencyCode,t.checkout.currencySymbol)))):r("checkout-page:standartShipping"))})),J=r((function(e){var t=e.vm,r=m().t;return o.createElement("div",{className:D.Footer},o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},r("checkout-page:returnPolicy")),o.createElement("div",{className:D.FooterBullet},"•"),o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},r("checkout-page:privacyPolicy")),o.createElement("div",{className:D.FooterBullet},"•"),o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},r("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:D.FooterBullet},"•"),o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:imprint"),t.policyModalText=t.imprint}},r("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:D.FooterBullet},"•"),o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},r("checkout-page:shippingPolicy"))))})),Q=r((function(r){var i,n,a,s=r.vm,c=r.setVisible,l=m().t,d=o.useState(!1),p=d[0],u=d[1],f=o.useState(!1),g=f[0],v=f[1],h=o.useState(new E({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];h.email=(null===(i=s.checkout.customer)||void 0===i?void 0:i.email)||"",h.firstName=(null===(n=s.checkout.customer)||void 0===n?void 0:n.firstName)||"",h.lastName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.lastName)||"";var y=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return g?[2,c(!1)]:(u(!0),[4,h.saveContactForm()]);case 1:return e.sent()&&v(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(x,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,g&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(M,{type:"success",title:l("checkout-page:contactFormSent"),content:l("checkout-page:contactFormDescription")})),o.createElement(F,{name:"message",type:T.TEXT_AREA,label:"",value:h.message||"",onChange:h.onMessageChange,textAreaPlaceholder:l("checkout-page:contactFormCta")}),o.createElement(w,{style:{width:"100%",marginTop:"24px"},text:l(g?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!h.message,onClick:y})),onClose:function(){return c(!1)}})})),Z=r((function(e){var t=e.vm,r=_(t),i=r.setActiveIndex,n=r.handlePrev,a=r.handleNext,s=r.activeIndex;return t.campaignOffers&&t.campaignOffers.length&&t.isCampaignOfferLoaded?o.createElement("div",{className:D.CampaignOfferMain},o.createElement("div",{className:D.OfferSlider},t.campaignOffers.map((function(e,r){var c;return o.createElement(A,{vm:t,campaignOffer:e,index:r,activeIndex:s,offersLength:(null===(c=t.campaignOffers)||void 0===c?void 0:c.length)||0,handlePrev:n,handleNext:a,setActiveIndex:function(e){return i(e)},desktopMiddlePhase:!0,step:t.step})}))),t.campaignOffers.length>1&&o.createElement(z,{handlePrev:n,handleNext:a}),t.campaignOffers.length>1&&o.createElement(R,{vm:t,activeIndex:s})):null})),$=r((function(e){var t=e.vm,r=_(t),i=r.setActiveIndex,n=r.setIsActiveOverlay,a=r.handlePrev,s=r.handleNext,c=r.isPopupClosedIndexPage,l=r.isPopupShowIndexPage,m=r.activeIndex;return t.campaignOffers&&t.campaignOffers.length&&t.isCampaignOfferLoaded?o.createElement("div",{className:[D.CampaignOfferMain,l?D.OverlayPopupMain:""].join(" ")},o.createElement("div",{className:D.OfferSlider},t.campaignOffers.map((function(e,r){var d;return o.createElement(A,{vm:t,campaignOffer:e,index:r,activeIndex:m,offersLength:(null===(d=t.campaignOffers)||void 0===d?void 0:d.length)||0,handlePrev:a,handleNext:s,setActiveIndex:function(e){return i(e)},step:t.step,isPopupClosed:c,isPopupShow:l,closePopup:function(){return n(!1)},showPopup:function(){return n(!0)}})}))),t.campaignOffers.length>1&&o.createElement(z,{handlePrev:a,handleNext:s}),t.campaignOffers.length>1&&o.createElement(R,{isPopupShow:l,vm:t,activeIndex:m})):null}));export{W as default};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as r}from"mobx-react-lite";import{useRouter as i}from"next/router.js";import n from"react-tooltip";import a,{CheckoutStep as s}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as l}from"../../utils/currency.js";import{useTranslation as m}from"../../utils/i18n.js";import d from"./steps/step-info/index.js";import{CheckoutStepShipping as p}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as u}from"./steps/step-payment/index.js";import{CouponErrorCode as f,Coupon as g,CartSummary as v}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as h}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as E}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as y}from"./steps/step-success/index.js";import{Modal as x}from"./components/modal/index.js";import k from"./components/master-pass/modal-otp/index.js";import C from"./components/master-pass/modal-response/index.js";import j from"./components/master-pass/modal-success/index.js";import{Image as P}from"../image/index.js";import N,{Step as O}from"./components/step-container/index.js";import{StockError as b}from"./components/error/stock-error/index.js";import{FullscreenLoading as S}from"./components/fullscreen-loading/index.js";import M from"./components/notification-box/index.js";import{FormItem as F}from"./components/form-item/index.js";import{FormItemType as T}from"./components/form-item/model.js";import{Button as w}from"./components/button/index.js";import{IkasPageHead as I}from"../page/head.js";import A from"./components/offer-product/index.js";import L from"./components/offer-product/placeholder-offer-product.js";import B from"./components/svg/ikas.js";import D from"./style.module.scss.js";import{Analytics as V}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import R from"./components/svg/success-circle.js";import U from"./components/offer-product/offer-dots/index.js";import z from"./components/offer-product/offer-arrows/index.js";import _ from"./components/offer-product/useCampaignOffer.js";import H from"../../hooks/useDimension.js";var W=r((function(e){var t,r,l,d,p,u,f,g=e.checkout,E=e.checkoutSettings,N=e.customizationProps,O=e.returnPolicy,M=e.privacyPolicy,F=e.termsOfService,T=e.imprint,A=e.shippingPolicy,U=m().t,z=i(),H=o.useState(Date.now()),W=H[0],X=H[1],K=o.useState((function(){return new a(g,E,z,O,M,F,T,A,U,N||{})}))[0];o.useEffect((function(){X(Date.now())}),[g.campaignOffers,K.campaignOffers,K.isCampaignOfferLoaded]);var ee=_(K),te=ee.setShowDetailPage,oe=ee.isPopupShowIndexPage,re=ee.isShowSuccessPageMiddlePhase;o.useMemo((function(){return Date.now()}),[]);return K.step,s.PAYMENT,o.useEffect((function(){var e;K.checkoutSettings.isAccountRequired&&!K.checkout.hasCustomer&&z.push("/account/login?redirect="+encodeURIComponent(K.checkoutUrl)),new URLSearchParams(window.location.search).get("step")!==s.SUCCESS&&(K.checkoutSettings.isAccountRequired&&(null===(e=K.checkout.customer)||void 0===e?void 0:e.isGuestCheckout)||V.beginCheckout(K.checkout)),V.pageView(h.CHECKOUT)}),[]),o.useEffect((function(){K.customizationProps=N,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==e?void 0:e.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==e?void 0:e.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==e?void 0:e.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==e?void 0:e.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==e?void 0:e.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==e?void 0:e.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==e?void 0:e.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==e?void 0:e.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==e?void 0:e.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==e?void 0:e.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==e?void 0:e.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==e?void 0:e.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(N)}),[N]),o.useEffect((function(){var e=document.querySelector(".ikas-storefront-widget");e&&e.remove()}),[]),K.isCheckoutLoaded&&K.store.customerStore.initialized?K.checkout.hasCustomer&&(null===(t=K.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(r=K.checkout.customer)||void 0===r?void 0:r.id)?(z.push("/account/login?redirect="+encodeURIComponent(K.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(I,{pageType:h.CHECKOUT,pageTitle:((null===(l=K.merchantSettings)||void 0===l?void 0:l.merchantName)||"")+" - "+U("checkout-page:securePayment"),pageDescription:U("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:D.CheckoutPage},re?o.createElement("div",{className:D.FullPageOfferMain},o.createElement("div",{className:D.FullPageOfferContainer},o.createElement("div",{className:D.LogoMain},(null===(d=K.customizationProps)||void 0===d?void 0:d.logo)?o.createElement("div",{className:D.Logo},o.createElement(P,{layout:"fill",image:K.customizationProps.logo,sizes:"360px"})):(null===(p=K.merchantSettings)||void 0===p?void 0:p.logo)?o.createElement("div",{className:D.Logo},o.createElement(P,{layout:"fill",image:K.merchantSettings.logo,sizes:"360px"})):(null===(u=K.merchantSettings)||void 0===u?void 0:u.merchantName)||""),o.createElement("div",{className:D.OfferSuccessInfo},o.createElement("div",null,o.createElement("div",{className:D.OfferSuccessHeader},o.createElement(R,{className:D.SuccessCircle}),o.createElement("span",{className:D.SuccessTitle},U("checkout-page:orderSuccessShortTitle"))),o.createElement("div",{className:D.OfferOrderInfoMain},o.createElement("div",{className:D.InfoTitle},U("checkout-page:orderNoAndDate"),":"),o.createElement("div",{className:D.InfoText},"#"+(K.checkout.orderNumber||"")," ",K.checkout.dateStr))),o.createElement("div",null,o.createElement(w,{classes:D.OfferButton,isLine:!0,text:U("checkout-page:actions.goOrderDetailPage"),onClick:function(){te(!1)}}))),o.createElement("div",null,o.createElement(Z,{vm:K,key:W})))):null,o.createElement(n,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:D.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[D.Left].join(" ")},o.createElement("div",{className:D.LeftContent},o.createElement("div",null,o.createElement(G,{vm:K}),K.hasStockError&&o.createElement("div",{className:D.ErrorContainer},o.createElement(b,{vm:K,error:K.error})),!K.hasStockError&&o.createElement(o.Fragment,null,K.step!==s.SUCCESS&&o.createElement(v,{vm:K,allowExpand:!0}),K.step===s.SUCCESS?o.createElement(y,{vm:K}):o.createElement(o.Fragment,null,!!(null===(f=K.customizationProps)||void 0===f?void 0:f.showCampaignOffersDesign)&&c.getIsEditor()&&o.createElement(L,{vm:K}),oe&&o.createElement("div",{className:[D.MiddlePhaseOverlay,oe?D.MiddlePhaseOverlayPopup:""].join(" ")}),K.campaignOffers&&!!K.campaignOffers.length&&K.isCampaignOfferLoaded&&o.createElement($,{key:W,vm:K}),K.isCouponCodeRequirementOpen&&o.createElement(q,{vm:K}),o.createElement(Y,{vm:K}))),o.createElement("div",{className:D.Space})),o.createElement(J,{vm:K}))),o.createElement("div",{className:D.Right},o.createElement("div",{className:D.RightContent},o.createElement(v,{vm:K}),!K.isPoweredByHidden&&o.createElement("div",{className:D.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(B,null))))),!!K.policyModalText&&o.createElement(x,{title:K.policyModalTitle,modalContent:K.policyModalText,onClose:function(){K.policyModalText=""},isPolicyModal:!0}),K.isContactModalVisible&&o.createElement(Q,{vm:K,setVisible:K.setContactModalVisible}),K.mpVM.isOtpModalVisible&&o.createElement(k,{vm:K,visible:K.mpVM.isOtpModalVisible,type:K.mpVM.otpModalType,onClose:K.mpVM.hideOtpModal}),K.mpVM.isResponseModalVisible&&o.createElement(C,{visible:K.mpVM.isResponseModalVisible,text:K.mpVM.mfsResponseModalText,onClose:K.mpVM.onResponseModalClose}),K.mpVM.isSuccessModalVisible&&o.createElement(j,{visible:K.mpVM.isSuccessModalVisible,type:K.mpVM.successModalType,onClose:K.mpVM.onSuccessModalClose}))):o.createElement(S,null)})),G=r((function(e){var t,r,i,n,a=e.vm,s=c.getCurrentRouting(),l=(null==s?void 0:s.path)?"/".concat(s.path):"/",d=m().t;return o.createElement("div",{className:D.Header},o.createElement("a",{href:l},(null===(t=a.customizationProps)||void 0===t?void 0:t.logo)?o.createElement("div",{className:D.Logo},o.createElement(P,{layout:"fill",image:a.customizationProps.logo,sizes:"360px"})):(null===(r=a.merchantSettings)||void 0===r?void 0:r.logo)?o.createElement("div",{className:D.Logo},o.createElement(P,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.merchantName)||""),!a.checkout.hasCustomer&&!a.isOpenEditOrderWithTransaction&&!a.checkout.edited&&o.createElement("div",{className:D.LoginText},o.createElement("span",{className:D.LoginCta},d("checkout-page:alreadyHaveAnAccount")),o.createElement("a",{href:a.getGoToLoginHref(),className:D.LoginBtn},d("checkout-page:actions.login"))),(a.checkout.hasCustomer||a.isOpenEditOrderWithTransaction||a.checkout.edited)&&o.createElement("div",{className:D.CustomerInfo},o.createElement("div",{className:D.Name},a.checkout.customerFullName),o.createElement("div",{className:D.Email},null===(n=a.checkout.customer)||void 0===n?void 0:n.email)))})),q=r((function(e){var t=e.vm,r=m().t,i=o.useState(!1),n=i[0],a=i[1],s=o.useState(null),c=s[0],l=s[1],d=H().isMobile,p=o.useMemo((function(){switch(c){case f.COUPON_CODE_NOT_EXIST:return r("checkout-page:giftCodeErrorDescription");case f.COUPON_CODE_NOT_EXIST_FOR_GUESS:return r("checkout-page:mustBeSignInToApplyCampaign");case f.COUPON_APPLIED_WITHOUT_DISCOUNT:return r("checkout-page:couponInvalidForCartItems");default:return""}}),[c]);return o.createElement("div",{className:D.CouponContainer},n&&o.createElement("div",{className:D.NotificationContainer},o.createElement(M,{type:"warning",title:r("checkout-page:giftCodeErrorTitle"),content:p,onClose:function(){a(!1),l(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:n?12:0}},o.createElement(g,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:a,setCouponErrorCode:l,showOnlyMobile:!0,isMobile:d})))})),Y=r((function(e){var t=e.vm,r=m().t,i=o.useMemo((function(){switch(t.step){case s.INFO:return o.createElement(d,{vm:t});case s.SHIPPING:return o.createElement(p,{vm:t});case s.PAYMENT:return o.createElement(u,{vm:t});case s.SUCCESS:return o.createElement(y,{vm:t})}}),[t,t.step]),n=[new O(r("checkout-page:address"),t.step===s.INFO,t.step!==s.INFO,t.step!==s.INFO?o.createElement("div",{className:D.AdressStepInfo},o.createElement(X,{vm:t}),!(t.isUpsellOrder||t.isOpenEditOrderWithTransaction)&&o.createElement("div",{className:D.EditBtn,onClick:t.onBackToInfoClick},r("checkout-page:actions.edit"))):void 0,t.step!==s.INFO?o.createElement("div",{className:D.AddressStepInfoMobile},o.createElement(X,{vm:t})):void 0),new O(r("checkout-page:payment"),t.step===s.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||n.splice(1,0,new O(r("checkout-page:shipping"),t.step===s.SHIPPING,t.step===s.PAYMENT,t.step===s.PAYMENT?o.createElement("div",{className:D.AdressStepInfo},o.createElement(K,{vm:t}),!(t.isUpsellOrder||t.isOpenEditOrderWithTransaction)&&!t.isManualOrderWithShippingLines&&(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:D.EditBtn,onClick:t.onBackToShippingClick},r("checkout-page:actions.edit"))):void 0,t.step===s.PAYMENT?o.createElement("div",{className:D.AddressStepInfoMobile},o.createElement(K,{vm:t})):void 0)),o.createElement(N,{steps:n,stepContent:i,step:t.step,hasTopMargin:t.isCouponCodeRequirementOpen||t.campaignOffers&&!!t.campaignOffers.length&&t.isCampaignOfferLoaded})})),X=r((function(e){var t,r,i,n,a,s,c,l,d,p=e.vm,u=m().t,f=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(r=p.checkout.billingAddress)||void 0===r?void 0:r.lastName)||""):((null===(i=p.checkout.shippingAddress)||void 0===i?void 0:i.firstName)||"")+" "+((null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.lastName)||"");return o.createElement("div",{className:D.Address},o.createElement("div",{className:[D.Text,D.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:D.Text},f):o.createElement(o.Fragment,null,o.createElement("div",{className:D.Text},u("checkout-page:receiver")),o.createElement("div",{className:[D.Text,D.Gray].join(" ")},f)),o.createElement("div",{className:[D.Text,D.Gray].join(" ")},p.isDigitalOnly?null===(s=p.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(c=p.checkout.shippingAddress)||void 0===c?void 0:c.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[D.Text,D.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[D.Text,D.Gray].join(" ")},p.isDigitalOnly?null===(l=p.checkout.billingAddress)||void 0===l?void 0:l.addressText:null===(d=p.checkout.shippingAddress)||void 0===d?void 0:d.addressText))})),K=r((function(e){var t=e.vm,r=m().t;return o.createElement("div",{className:D.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:D.LightText}," / "+(0===t.checkout.shippingLines[0].finalPrice?r("checkout-page:free"):l(t.checkout.shippingLines[0].finalPrice,t.checkout.currencyCode,t.checkout.currencySymbol)))):r("checkout-page:standartShipping"))})),J=r((function(e){var t=e.vm,r=m().t;return o.createElement("div",{className:D.Footer},o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},r("checkout-page:returnPolicy")),o.createElement("div",{className:D.FooterBullet},"•"),o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},r("checkout-page:privacyPolicy")),o.createElement("div",{className:D.FooterBullet},"•"),o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},r("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:D.FooterBullet},"•"),o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:imprint"),t.policyModalText=t.imprint}},r("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:D.FooterBullet},"•"),o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},r("checkout-page:shippingPolicy"))))})),Q=r((function(r){var i,n,a,s=r.vm,c=r.setVisible,l=m().t,d=o.useState(!1),p=d[0],u=d[1],f=o.useState(!1),g=f[0],v=f[1],h=o.useState(new E({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];h.email=(null===(i=s.checkout.customer)||void 0===i?void 0:i.email)||"",h.firstName=(null===(n=s.checkout.customer)||void 0===n?void 0:n.firstName)||"",h.lastName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.lastName)||"";var y=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return g?[2,c(!1)]:(u(!0),[4,h.saveContactForm()]);case 1:return e.sent()&&v(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(x,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,g&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(M,{type:"success",title:l("checkout-page:contactFormSent"),content:l("checkout-page:contactFormDescription")})),o.createElement(F,{name:"message",type:T.TEXT_AREA,label:"",value:h.message||"",onChange:h.onMessageChange,textAreaPlaceholder:l("checkout-page:contactFormCta")}),o.createElement(w,{style:{width:"100%",marginTop:"24px"},text:l(g?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!h.message,onClick:y})),onClose:function(){return c(!1)}})})),Z=r((function(e){var t=e.vm,r=_(t),i=r.setActiveIndex,n=r.handlePrev,a=r.handleNext,s=r.activeIndex;return t.campaignOffers&&t.campaignOffers.length&&t.isCampaignOfferLoaded?o.createElement("div",{className:D.CampaignOfferMain},o.createElement("div",{className:D.OfferSlider},t.campaignOffers.map((function(e,r){var c;return o.createElement(A,{vm:t,campaignOffer:e,index:r,activeIndex:s,offersLength:(null===(c=t.campaignOffers)||void 0===c?void 0:c.length)||0,handlePrev:n,handleNext:a,setActiveIndex:function(e){return i(e)},desktopMiddlePhase:!0,step:t.step})}))),t.campaignOffers.length>1&&o.createElement(z,{handlePrev:n,handleNext:a}),t.campaignOffers.length>1&&o.createElement(U,{vm:t,activeIndex:s})):null})),$=r((function(e){var t=e.vm,r=_(t),i=r.setActiveIndex,n=r.setIsActiveOverlay,a=r.handlePrev,s=r.handleNext,c=r.isPopupClosedIndexPage,l=r.isPopupShowIndexPage,m=r.activeIndex;return t.campaignOffers&&t.campaignOffers.length&&t.isCampaignOfferLoaded?o.createElement("div",{className:[D.CampaignOfferMain,l?D.OverlayPopupMain:""].join(" ")},o.createElement("div",{className:D.OfferSlider},t.campaignOffers.map((function(e,r){var d;return o.createElement(A,{vm:t,campaignOffer:e,index:r,activeIndex:m,offersLength:(null===(d=t.campaignOffers)||void 0===d?void 0:d.length)||0,handlePrev:a,handleNext:s,setActiveIndex:function(e){return i(e)},step:t.step,isPopupClosed:c,isPopupShow:l,closePopup:function(){return n(!1)},showPopup:function(){return n(!0)}})}))),t.campaignOffers.length>1&&o.createElement(z,{handlePrev:a,handleNext:s}),t.campaignOffers.length>1&&o.createElement(U,{isPopupShow:l,vm:t,activeIndex:m})):null}));export{W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../ext/style-inject/dist/style-inject.es.js';var t={CheckoutPage:"style-module_CheckoutPage__ZhJkP",Left:"style-module_Left__Fi9Ka",epaykolay:"style-module_epaykolay__3MlS-",LeftContent:"style-module_LeftContent__9OjX9",Space:"style-module_Space__rZnAy",Footer:"style-module_Footer__x-8Uy",FooterItem:"style-module_FooterItem__33V-M",FooterBullet:"style-module_FooterBullet__ReSoQ",AdressStepInfo:"style-module_AdressStepInfo__n4JGO",Address:"style-module_Address__yS7Ou",Text:"style-module_Text__jEuRS",WithMBottom:"style-module_WithMBottom__4Eb0o",WithMTop:"style-module_WithMTop__I550k",Gray:"style-module_Gray__p6WTS",EditBtn:"style-module_EditBtn__1BG0f",AddressStepInfoMobile:"style-module_AddressStepInfoMobile__7awcG",ErrorContainer:"style-module_ErrorContainer__TAK-J",Header:"style-module_Header__V7Pe2",Logo:"style-module_Logo__y9GGC",LoginText:"style-module_LoginText__OOD8r",LoginBtn:"style-module_LoginBtn__m-qco",CustomerInfo:"style-module_CustomerInfo__ECTKP",Name:"style-module_Name__iIq-v",Email:"style-module_Email__UX6fN",LoginCta:"style-module_LoginCta__TDolx",MobileCartSummary:"style-module_MobileCartSummary__bUmJj",RowPB:"style-module_RowPB__tAM9q",Right:"style-module_Right__1BcGi",RightContent:"style-module_RightContent__qvFkp",PoweredBy:"style-module_PoweredBy__3k1Sx",LightText:"style-module_LightText__IsehB",ReactTooltipWrap:"style-module_ReactTooltipWrap__HX-4g",CouponContainer:"style-module_CouponContainer__75r01",OfferSlider:"style-module_OfferSlider__-XwAY",OfferArrow:"style-module_OfferArrow__xVE-T",OfferArrowLeft:"style-module_OfferArrowLeft__Xravz",OfferArrowRight:"style-module_OfferArrowRight__8dOYq",CampaignOfferMain:"style-module_CampaignOfferMain__YuOGC",FullPageOfferMain:"style-module_FullPageOfferMain__I10XC",FullPageOfferContainer:"style-module_FullPageOfferContainer__C5BUd",OfferSuccessInfo:"style-module_OfferSuccessInfo__dqaz7",OfferSuccessHeader:"style-module_OfferSuccessHeader__XXQT0",SuccessCircle:"style-module_SuccessCircle__MTabL",SuccessTitle:"style-module_SuccessTitle__tCH2A",OfferOrderInfoMain:"style-module_OfferOrderInfoMain__-aqgA",InfoTitle:"style-module_InfoTitle__Zd6Dd",InfoText:"style-module_InfoText__MOjKO",OfferButton:"style-module_OfferButton__0hTNI",MiddlePhaseOverlay:"style-module_MiddlePhaseOverlay__LPV2A",MiddlePhaseOverlayPopup:"style-module_MiddlePhaseOverlayPopup__BNC61",OverlayPopupMain:"style-module_OverlayPopupMain__4PrI0",LogoMain:"style-module_LogoMain__TVrEL"};e('.style-module_CheckoutPage__ZhJkP {\n all: unset;\n font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n font-size: 16px !important;\n width: 100%;\n height: 100vh;\n overflow: auto;\n overflow-x: hidden;\n display: flex;\n color: var(--checkout-primary-text-color);\n background-color: var(--checkout-primary-bg-color);\n}\n.style-module_CheckoutPage__ZhJkP input::placeholder,\n.style-module_CheckoutPage__ZhJkP textarea::placeholder {\n all: unset;\n}\n.style-module_CheckoutPage__ZhJkP a,\n.style-module_CheckoutPage__ZhJkP a:hover,\n.style-module_CheckoutPage__ZhJkP a:focus,\n.style-module_CheckoutPage__ZhJkP a:active {\n color: inherit;\n}\n.style-module_CheckoutPage__ZhJkP * {\n box-sizing: border-box !important;\n font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n font-size: 16px;\n letter-spacing: normal;\n font-weight: normal;\n line-height: unset;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka {\n width: 50%;\n flex: 0 0 auto;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n padding-left: 20px;\n padding-right: 64px;\n background-color: var(--checkout-primary-bg-color);\n z-index: 1;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka.style-module_epaykolay__3MlS- {\n padding-left: 0;\n padding-right: 0;\n z-index: 2;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 {\n width: 100%;\n min-width: 400px;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n min-height: 100vh;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Space__rZnAy {\n width: 100%;\n height: 100px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Space__rZnAy {\n height: 48px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy {\n flex: 0 0 auto;\n background-color: transparent;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-wrap: wrap;\n padding: 12.205px 0;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterItem__33V-M {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n cursor: pointer;\n user-select: none;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterItem__33V-M:hover {\n color: var(--checkout-primary-text-color);\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterBullet__ReSoQ {\n margin: 0 12px;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy {\n width: 100%;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterItem__33V-M {\n text-align: center;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO {\n display: flex;\n justify-content: space-between;\n padding-left: 78px;\n padding-top: 5px;\n width: 100%;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou {\n font-size: 16px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS {\n font-size: 14px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_WithMBottom__4Eb0o {\n margin-bottom: 12px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_WithMTop__I550k {\n margin-top: 12px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_Gray__p6WTS {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_EditBtn__1BG0f {\n cursor: pointer;\n user-select: none;\n align-self: flex-start;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_EditBtn__1BG0f:hover {\n text-decoration: underline;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO {\n padding-top: 0;\n justify-content: flex-end;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou {\n display: none;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG {\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG {\n display: block;\n padding-top: 16px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou {\n font-size: 16px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou .style-module_Text__jEuRS {\n font-size: 14px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_WithMBottom__4Eb0o {\n margin-bottom: 12px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_Gray__p6WTS {\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_ErrorContainer__TAK-J {\n padding: 0 24px;\n }\n}\n@media only screen and (max-width: 480px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_ErrorContainer__TAK-J {\n padding: 0 10px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 {\n width: 100%;\n height: 96px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-weight: 500;\n font-size: 20px;\n margin-bottom: 44px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 a {\n flex: 1 1 auto;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_Logo__y9GGC {\n width: calc(100% - 24px);\n max-width: 200px;\n height: 64px;\n position: relative;\n user-select: none;\n cursor: pointer;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_Logo__y9GGC img {\n object-fit: contain;\n object-position: left;\n pointer-events: none;\n}\n@media only screen and (max-width: 1280px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_Logo__y9GGC {\n max-width: 150px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r {\n font-size: 14px;\n text-align: right;\n flex: 0 0 auto;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r span {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginBtn__m-qco {\n margin-left: 4px;\n font-weight: bold;\n user-select: none;\n cursor: pointer;\n font-weight: 500;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Name__iIq-v {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Email__UX6fN {\n font-weight: 500;\n font-size: 14px;\n user-select: none;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 {\n height: 72px;\n margin-bottom: 0;\n padding: 0 24px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Name__iIq-v {\n font-size: 15px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Email__UX6fN {\n font-size: 13px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r {\n display: flex;\n flex-direction: column;\n padding-bottom: 0;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r .style-module_LoginCta__TDolx {\n display: none;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_MobileCartSummary__bUmJj {\n position: sticky;\n top: 0;\n z-index: 10;\n}\n@media only screen and (min-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_MobileCartSummary__bUmJj {\n display: none;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_RowPB__tAM9q {\n padding-bottom: 16px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka {\n width: 100%;\n justify-content: center;\n padding-right: 0px;\n padding-left: 0px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 {\n width: 100%;\n min-width: auto;\n max-width: 100%;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi {\n width: 50%;\n min-height: 100%;\n flex: 0 0 auto;\n background-color: var(--checkout-secondary-bg-color);\n display: flex;\n padding-left: 64px;\n padding-right: 20px;\n position: sticky;\n top: 0;\n overflow-y: auto;\n z-index: 1;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp {\n width: 100%;\n max-width: 600px;\n padding-top: 64px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp .style-module_PoweredBy__3k1Sx {\n width: 100%;\n padding: 16px 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n user-select: none;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp .style-module_PoweredBy__3k1Sx span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp .style-module_PoweredBy__3k1Sx a {\n display: flex;\n align-items: center;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi {\n display: none;\n }\n}\n\n.style-module_LightText__IsehB {\n color: var(--checkout-secondary-text-color);\n}\n\n.style-module_ReactTooltipWrap__HX-4g {\n max-width: 300px;\n}\n\n.style-module_CouponContainer__75r01 {\n width: 100%;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CouponContainer__75r01 {\n padding: 0 24px;\n margin-top: 24px;\n }\n}\n\n.style-module_OfferSlider__-XwAY {\n display: flex;\n overflow: hidden;\n position: relative;\n}\n\n.style-module_OfferArrow__xVE-T {\n padding: 10px;\n justify-content: center;\n align-items: center;\n border-radius: 32px;\n border: 1px solid var(--checkout-border-color);\n display: flex;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 40px;\n height: 40px;\n cursor: pointer;\n z-index: 9;\n background-color: #fff;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_OfferArrow__xVE-T {\n display: none;\n }\n}\n\n.style-module_OfferArrowLeft__Xravz {\n left: -20px;\n}\n\n.style-module_OfferArrowRight__8dOYq {\n right: -20px;\n}\n\n.style-module_CampaignOfferMain__YuOGC {\n position: relative;\n}\n\n.style-module_FullPageOfferMain__I10XC {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n background-color: #fff;\n z-index: 2;\n overflow: auto;\n}\n\n.style-module_FullPageOfferContainer__C5BUd {\n margin: 10% auto;\n max-width: 1048px;\n}\n.style-module_FullPageOfferContainer__C5BUd .style-module_OfferSuccessInfo__dqaz7 {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 32px;\n}\n.style-module_FullPageOfferContainer__C5BUd .style-module_OfferSuccessInfo__dqaz7 .style-module_OfferSuccessHeader__XXQT0 {\n display: flex;\n align-items: center;\n margin-bottom: 8px;\n}\n.style-module_FullPageOfferContainer__C5BUd .style-module_OfferSuccessInfo__dqaz7 .style-module_OfferSuccessHeader__XXQT0 svg {\n width: 24px;\n height: 24px;\n}\n.style-module_FullPageOfferContainer__C5BUd .style-module_OfferSuccessInfo__dqaz7 .style-module_SuccessCircle__MTabL {\n color: #2dca73;\n}\n.style-module_FullPageOfferContainer__C5BUd .style-module_OfferSuccessInfo__dqaz7 .style-module_SuccessTitle__tCH2A {\n font-size: 20px;\n font-weight: 400;\n line-height: 28px;\n margin-left: 12px;\n}\n\n.style-module_OfferOrderInfoMain__-aqgA {\n display: flex;\n gap: 4px;\n}\n.style-module_OfferOrderInfoMain__-aqgA .style-module_InfoTitle__Zd6Dd {\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_OfferOrderInfoMain__-aqgA .style-module_InfoText__MOjKO {\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px;\n color: var(--checkout-primary-text-color);\n}\n\n.style-module_OfferButton__0hTNI {\n font-weight: 500 !important;\n width: 100%;\n height: 52px !important;\n font-size: 16px;\n}\n\n.style-module_MiddlePhaseOverlay__LPV2A {\n position: fixed;\n background-color: var(--checkout-campaign-middle-phase-overlay-color);\n width: 100%;\n height: 100%;\n z-index: 99;\n top: 72px;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: auto;\n}\n\n.style-module_MiddlePhaseOverlayPopup__BNC61 {\n top: 0;\n}\n\n.style-module_CampaignOfferMain__YuOGC {\n position: relative;\n z-index: 100;\n background-color: transparent;\n}\n\n.style-module_OverlayPopupMain__4PrI0 {\n width: 95%;\n margin: 0 auto;\n border-radius: 12px;\n position: fixed;\n top: 5%;\n left: 2.5%;\n height: 80vh;\n overflow: auto;\n}\n\n.style-module_LogoMain__TVrEL {\n margin-bottom: 32px;\n display: flex;\n justify-content: center;\n}\n.style-module_LogoMain__TVrEL .style-module_Logo__y9GGC {\n width: calc(100% - 24px);\n max-width: 200px;\n height: 64px;\n position: relative;\n user-select: none;\n}\n.style-module_LogoMain__TVrEL .style-module_Logo__y9GGC img {\n object-fit: contain;\n pointer-events: none;\n}\n@media only screen and (max-width: 1280px) {\n .style-module_LogoMain__TVrEL .style-module_Logo__y9GGC {\n max-width: 150px;\n }\n}');export{t as default};
|
|
1
|
+
import e from'./../../ext/style-inject/dist/style-inject.es.js';var t={CheckoutPage:"style-module_CheckoutPage__ZhJkP",Left:"style-module_Left__Fi9Ka",epaykolay:"style-module_epaykolay__3MlS-",LeftContent:"style-module_LeftContent__9OjX9",Space:"style-module_Space__rZnAy",Footer:"style-module_Footer__x-8Uy",FooterItem:"style-module_FooterItem__33V-M",FooterBullet:"style-module_FooterBullet__ReSoQ",AdressStepInfo:"style-module_AdressStepInfo__n4JGO",Address:"style-module_Address__yS7Ou",Text:"style-module_Text__jEuRS",WithMBottom:"style-module_WithMBottom__4Eb0o",WithMTop:"style-module_WithMTop__I550k",Gray:"style-module_Gray__p6WTS",EditBtn:"style-module_EditBtn__1BG0f",AddressStepInfoMobile:"style-module_AddressStepInfoMobile__7awcG",ErrorContainer:"style-module_ErrorContainer__TAK-J",Header:"style-module_Header__V7Pe2",Logo:"style-module_Logo__y9GGC",LoginText:"style-module_LoginText__OOD8r",LoginBtn:"style-module_LoginBtn__m-qco",CustomerInfo:"style-module_CustomerInfo__ECTKP",Name:"style-module_Name__iIq-v",Email:"style-module_Email__UX6fN",LoginCta:"style-module_LoginCta__TDolx",MobileCartSummary:"style-module_MobileCartSummary__bUmJj",RowPB:"style-module_RowPB__tAM9q",Right:"style-module_Right__1BcGi",RightContent:"style-module_RightContent__qvFkp",PoweredBy:"style-module_PoweredBy__3k1Sx",LightText:"style-module_LightText__IsehB",ReactTooltipWrap:"style-module_ReactTooltipWrap__HX-4g",CouponContainer:"style-module_CouponContainer__75r01",OfferSlider:"style-module_OfferSlider__-XwAY",OfferArrow:"style-module_OfferArrow__xVE-T",OfferArrowLeft:"style-module_OfferArrowLeft__Xravz",OfferArrowRight:"style-module_OfferArrowRight__8dOYq",CampaignOfferMain:"style-module_CampaignOfferMain__YuOGC",FullPageOfferMain:"style-module_FullPageOfferMain__I10XC",FullPageOfferContainer:"style-module_FullPageOfferContainer__C5BUd",OfferSuccessInfo:"style-module_OfferSuccessInfo__dqaz7",OfferSuccessHeader:"style-module_OfferSuccessHeader__XXQT0",SuccessCircle:"style-module_SuccessCircle__MTabL",SuccessTitle:"style-module_SuccessTitle__tCH2A",OfferOrderInfoMain:"style-module_OfferOrderInfoMain__-aqgA",InfoTitle:"style-module_InfoTitle__Zd6Dd",InfoText:"style-module_InfoText__MOjKO",OfferButton:"style-module_OfferButton__0hTNI",MiddlePhaseOverlay:"style-module_MiddlePhaseOverlay__LPV2A",MiddlePhaseOverlayPopup:"style-module_MiddlePhaseOverlayPopup__BNC61",OverlayPopupMain:"style-module_OverlayPopupMain__4PrI0",LogoMain:"style-module_LogoMain__TVrEL"};e('.style-module_CheckoutPage__ZhJkP {\n all: unset;\n font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n font-size: 16px !important;\n width: 100%;\n height: 100vh;\n overflow: auto;\n overflow-x: hidden;\n display: flex;\n color: var(--checkout-primary-text-color);\n background-color: var(--checkout-primary-bg-color);\n}\n.style-module_CheckoutPage__ZhJkP input::placeholder,\n.style-module_CheckoutPage__ZhJkP textarea::placeholder {\n all: unset;\n}\n.style-module_CheckoutPage__ZhJkP a,\n.style-module_CheckoutPage__ZhJkP a:hover,\n.style-module_CheckoutPage__ZhJkP a:focus,\n.style-module_CheckoutPage__ZhJkP a:active {\n color: inherit;\n text-decoration: inherit;\n}\n.style-module_CheckoutPage__ZhJkP * {\n box-sizing: border-box !important;\n font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n font-size: 16px;\n letter-spacing: normal;\n font-weight: normal;\n line-height: unset;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka {\n width: 50%;\n flex: 0 0 auto;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n padding-left: 20px;\n padding-right: 64px;\n background-color: var(--checkout-primary-bg-color);\n z-index: 1;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka.style-module_epaykolay__3MlS- {\n padding-left: 0;\n padding-right: 0;\n z-index: 2;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 {\n width: 100%;\n min-width: 400px;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n min-height: 100vh;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Space__rZnAy {\n width: 100%;\n height: 100px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Space__rZnAy {\n height: 48px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy {\n flex: 0 0 auto;\n background-color: transparent;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-wrap: wrap;\n padding: 12.205px 0;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterItem__33V-M {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n cursor: pointer;\n user-select: none;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterItem__33V-M:hover {\n color: var(--checkout-primary-text-color);\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterBullet__ReSoQ {\n margin: 0 12px;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy {\n width: 100%;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterItem__33V-M {\n text-align: center;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO {\n display: flex;\n justify-content: space-between;\n padding-left: 78px;\n padding-top: 5px;\n width: 100%;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou {\n font-size: 16px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS {\n font-size: 14px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_WithMBottom__4Eb0o {\n margin-bottom: 12px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_WithMTop__I550k {\n margin-top: 12px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_Gray__p6WTS {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_EditBtn__1BG0f {\n cursor: pointer;\n user-select: none;\n align-self: flex-start;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_EditBtn__1BG0f:hover {\n text-decoration: underline;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO {\n padding-top: 0;\n justify-content: flex-end;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou {\n display: none;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG {\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG {\n display: block;\n padding-top: 16px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou {\n font-size: 16px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou .style-module_Text__jEuRS {\n font-size: 14px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_WithMBottom__4Eb0o {\n margin-bottom: 12px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_Gray__p6WTS {\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_ErrorContainer__TAK-J {\n padding: 0 24px;\n }\n}\n@media only screen and (max-width: 480px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_ErrorContainer__TAK-J {\n padding: 0 10px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 {\n width: 100%;\n height: 96px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-weight: 500;\n font-size: 20px;\n margin-bottom: 44px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 a {\n flex: 1 1 auto;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_Logo__y9GGC {\n width: calc(100% - 24px);\n max-width: 200px;\n height: 64px;\n position: relative;\n user-select: none;\n cursor: pointer;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_Logo__y9GGC img {\n object-fit: contain;\n object-position: left;\n pointer-events: none;\n}\n@media only screen and (max-width: 1280px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_Logo__y9GGC {\n max-width: 150px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r {\n font-size: 14px;\n text-align: right;\n flex: 0 0 auto;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r span {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginBtn__m-qco {\n margin-left: 4px;\n font-weight: bold;\n user-select: none;\n cursor: pointer;\n font-weight: 500;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Name__iIq-v {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Email__UX6fN {\n font-weight: 500;\n font-size: 14px;\n user-select: none;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 {\n height: 72px;\n margin-bottom: 0;\n padding: 0 24px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Name__iIq-v {\n font-size: 15px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Email__UX6fN {\n font-size: 13px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r {\n display: flex;\n flex-direction: column;\n padding-bottom: 0;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r .style-module_LoginCta__TDolx {\n display: none;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_MobileCartSummary__bUmJj {\n position: sticky;\n top: 0;\n z-index: 10;\n}\n@media only screen and (min-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_MobileCartSummary__bUmJj {\n display: none;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_RowPB__tAM9q {\n padding-bottom: 16px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka {\n width: 100%;\n justify-content: center;\n padding-right: 0px;\n padding-left: 0px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 {\n width: 100%;\n min-width: auto;\n max-width: 100%;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi {\n width: 50%;\n min-height: 100%;\n flex: 0 0 auto;\n background-color: var(--checkout-secondary-bg-color);\n display: flex;\n padding-left: 64px;\n padding-right: 20px;\n position: sticky;\n top: 0;\n overflow-y: auto;\n z-index: 1;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp {\n width: 100%;\n max-width: 600px;\n padding-top: 64px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp .style-module_PoweredBy__3k1Sx {\n width: 100%;\n padding: 16px 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n user-select: none;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp .style-module_PoweredBy__3k1Sx span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp .style-module_PoweredBy__3k1Sx a {\n display: flex;\n align-items: center;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi {\n display: none;\n }\n}\n\n.style-module_LightText__IsehB {\n color: var(--checkout-secondary-text-color);\n}\n\n.style-module_ReactTooltipWrap__HX-4g {\n max-width: 300px;\n}\n\n.style-module_CouponContainer__75r01 {\n width: 100%;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CouponContainer__75r01 {\n padding: 0 24px;\n margin-top: 24px;\n }\n}\n\n.style-module_OfferSlider__-XwAY {\n display: flex;\n overflow: hidden;\n position: relative;\n}\n\n.style-module_OfferArrow__xVE-T {\n padding: 10px;\n justify-content: center;\n align-items: center;\n border-radius: 32px;\n border: 1px solid var(--checkout-border-color);\n display: flex;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 40px;\n height: 40px;\n cursor: pointer;\n z-index: 9;\n background-color: #fff;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_OfferArrow__xVE-T {\n display: none;\n }\n}\n\n.style-module_OfferArrowLeft__Xravz {\n left: -20px;\n}\n\n.style-module_OfferArrowRight__8dOYq {\n right: -20px;\n}\n\n.style-module_CampaignOfferMain__YuOGC {\n position: relative;\n}\n\n.style-module_FullPageOfferMain__I10XC {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n background-color: #fff;\n z-index: 2;\n overflow: auto;\n}\n\n.style-module_FullPageOfferContainer__C5BUd {\n margin: 10% auto;\n max-width: 1048px;\n}\n.style-module_FullPageOfferContainer__C5BUd .style-module_OfferSuccessInfo__dqaz7 {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 32px;\n}\n.style-module_FullPageOfferContainer__C5BUd .style-module_OfferSuccessInfo__dqaz7 .style-module_OfferSuccessHeader__XXQT0 {\n display: flex;\n align-items: center;\n margin-bottom: 8px;\n}\n.style-module_FullPageOfferContainer__C5BUd .style-module_OfferSuccessInfo__dqaz7 .style-module_OfferSuccessHeader__XXQT0 svg {\n width: 24px;\n height: 24px;\n}\n.style-module_FullPageOfferContainer__C5BUd .style-module_OfferSuccessInfo__dqaz7 .style-module_SuccessCircle__MTabL {\n color: #2dca73;\n}\n.style-module_FullPageOfferContainer__C5BUd .style-module_OfferSuccessInfo__dqaz7 .style-module_SuccessTitle__tCH2A {\n font-size: 20px;\n font-weight: 400;\n line-height: 28px;\n margin-left: 12px;\n}\n\n.style-module_OfferOrderInfoMain__-aqgA {\n display: flex;\n gap: 4px;\n}\n.style-module_OfferOrderInfoMain__-aqgA .style-module_InfoTitle__Zd6Dd {\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_OfferOrderInfoMain__-aqgA .style-module_InfoText__MOjKO {\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px;\n color: var(--checkout-primary-text-color);\n}\n\n.style-module_OfferButton__0hTNI {\n font-weight: 500 !important;\n width: 100%;\n height: 52px !important;\n font-size: 16px;\n}\n\n.style-module_MiddlePhaseOverlay__LPV2A {\n position: fixed;\n background-color: var(--checkout-campaign-middle-phase-overlay-color);\n width: 100%;\n height: 100%;\n z-index: 99;\n top: 72px;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: auto;\n}\n\n.style-module_MiddlePhaseOverlayPopup__BNC61 {\n top: 0;\n}\n\n.style-module_CampaignOfferMain__YuOGC {\n position: relative;\n z-index: 100;\n background-color: transparent;\n}\n\n.style-module_OverlayPopupMain__4PrI0 {\n width: 95%;\n margin: 0 auto;\n border-radius: 12px;\n position: fixed;\n top: 5%;\n left: 2.5%;\n height: 80vh;\n overflow: auto;\n}\n\n.style-module_LogoMain__TVrEL {\n margin-bottom: 32px;\n display: flex;\n justify-content: center;\n}\n.style-module_LogoMain__TVrEL .style-module_Logo__y9GGC {\n width: calc(100% - 24px);\n max-width: 200px;\n height: 64px;\n position: relative;\n user-select: none;\n}\n.style-module_LogoMain__TVrEL .style-module_Logo__y9GGC img {\n object-fit: contain;\n pointer-events: none;\n}\n@media only screen and (max-width: 1280px) {\n .style-module_LogoMain__TVrEL .style-module_Logo__y9GGC {\n max-width: 150px;\n }\n}');export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import i from"next/head.js";import{useRouter as a}from"next/router";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 r}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/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{IkasProductList as s}from"../../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{IkasStorefrontConfig as d}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/index.js";import"../paypal-express-checkout/index.js";import{IkasBaseStore as l}from"../../store/base.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var c=o((function(o){var s,c,g,v=o.pageType,f=o.pageTitle,h=o.pageDescription,j=o.canonicals,x=o.disableIndex,y=o.pageSpecificData,b=o.merchantSettings,T=o.addOgpMetas,C=o.productReviewSummary,D=o.pageComponentPropValues,O=a(),L="undefined"!=typeof window,w="local"===process.env.NEXT_PUBLIC_ENV,k=O.asPath.split(/[?#]/)[0].replace("/",""),P=(k="/"===k.charAt(k.length-1)?k.slice(0,-1):k).startsWith("pages/"),R=v===r.BLOG,E=d.getCurrentRouting(),I=((null===(s=d.getMerchantSettings())||void 0===s?void 0:s.defaultLocale)||"tr")===(null==E?void 0:E.locale),S=!!y&&v===r.PRODUCT,_=!!y&&v===r.CATEGORY,V=!!y&&v===r.BRAND,A=S||_||V,M=null;(S||V||_)&&(M=y);var N=null===(c=null==M?void 0:M.translations)||void 0===c?void 0:c.find((function(e){return e.locale===(null==E?void 0:E.locale)})),B=(null==E?void 0:E.path)?"/"+E.path:"",G=w?"http://localhost:3333":"https://"+d.getDomain(),U=null===(g=d.getIndexPageSeoSettings())||void 0===g?void 0:g.find((function(e){return e.locale===d.getCurrentLocale()})),F=U?new n(U):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[v,y]);var Y=t.useMemo((function(){if(y&&y.href)return"".concat(G).concat(y.href)}),[y]),H=t.useMemo((function(){if(y&&y.href){var e=y.href;return B?"".concat(G).concat(B).concat(e):"".concat(G).concat(e)}}),[y]),z=t.useMemo((function(){var e,t,o,i=[];if(T){if(i.push({property:"og:type",content:"website"}),i.push({property:"og:site_name",content:(null==F?void 0:F.pageTitle)||"https://"+d.getDomain()}),f&&i.push({property:"og:title",content:f}),h&&i.push({property:"og:description",content:h}),v===r.INDEX){var a=null,n=null;!f&&(null==F?void 0:F.pageTitle)&&(a=F.pageTitle),!h&&(null==F?void 0:F.description)&&(n=F.description),(s=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===v})))&&(a=u(y,v,s.titleTemplate||""),n=u(y,v,s.descriptionTemplate||"")),a&&i.push({property:"og:title",content:a}),n&&i.push({property:"og:description",content:n})}if(v===r.PRODUCT||v===r.CATEGORY||v===r.BRAND){var s,l=null,c=null;if((s=null===(t=d.getMetaTemplates())||void 0===t?void 0:t.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===v})))&&(l=u(y,v,s.titleTemplate||""),c=u(y,v,s.descriptionTemplate||"")),!f){var p=l||A&&I&&(null==M?void 0:M.name)||A&&!I&&(null==N?void 0:N.name);p&&i.push({property:"og:title",content:p})}if(!h){var m=c||A&&!I&&(null==N?void 0:N.description);m&&i.push({property:"og:description",content:m})}}i.push({property:"og:url",content:H||(L?window.location.href:"")||"https://".concat(d.getDomain())});var g=null;if(y&&v===r.PRODUCT){var j=y.selectedVariant.mainImage;(null==j?void 0:j.image)&&(g={property:"og:image",content:j.image.src.replace(".webp",".jpg")})}if(y&&v===r.CATEGORY){var x=y;x.image&&(g={property:"og:image",content:x.image.src.replace(".webp",".jpg")})}if(y&&v===r.BRAND){var C=y;C.image&&(g={property:"og:image",content:C.image.src.replace(".webp",".jpg")})}if(y&&v===r.BLOG_CATEGORY){var D=y;D.image&&(g={property:"og:image",content:D.image.src.replace(".webp",".jpg")})}if(y&&v===r.BLOG){var O=y;O.image&&(g={property:"og:image",content:O.image.src.replace(".webp",".jpg")})}!g&&(null==F?void 0:F.icon)&&(g={property:"og:image",content:null===(o=null==F?void 0:F.icon)||void 0===o?void 0:o.src.replace(".webp",".jpg")}),!g&&(null==b?void 0:b.logo)&&(g={property:"og:image",content:b.logo.src.replace(".webp",".jpg")}),g&&i.push(g)}return i}),[f,y,Y,h,b,T,b]),X=t.useMemo((function(){var t=[],o=(null==F?void 0:F.pageTitle)||(null==b?void 0:b.merchantName)||"";if(b){var i={"@context":"https://schema.org","@type":"Website",url:"https://"+d.getDomain()},a=function(t){var o,i,a,r,n,s,l=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:l,image:l,url:"https://"+d.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(a=null===(i=t.address)||void 0===i?void 0:i.city)||void 0===a?void 0:a.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(s=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===s?void 0:s.code})}}(b);t.push(i),t.push(a)}if(y&&v===r.PRODUCT){var n=y,s=function(t,o){var i,a,n,s,l,c;try{var p=["c7d934c7-2d44-43c3-b023-de7aa93fe435"],m=null===(i=d.getMerchantSettings())||void 0===i?void 0:i.merchantId,g=d.getCurrentRouting(),v=null==g?void 0:g.path,f=function(e){return v?"https://".concat(d.getDomain(),"/").concat(v).concat(e):"https://".concat(d.getDomain()).concat(e)},h=t.selectedVariant,j=null,x=null===(a=d.getMetaTemplates())||void 0===a?void 0:a.find((function(e){return e.locale===d.getCurrentLocale()&&r.PRODUCT}));return x&&(j=u(t,r.PRODUCT,x.descriptionTemplate||"")),e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:(null===(n=t.metaData)||void 0===n?void 0:n.description)||j,image:null===(s=h.images)||void 0===s?void 0:s.map((function(e){return e.image?e.image.src:""})),productId:h.id,sku:h.sku,mpn:(null===(l=h.barcodeList)||void 0===l?void 0:l.length)?h.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(c=t.brand)||void 0===c?void 0:c.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),p.some((function(e){return e!==m}))?{offers:t.variants.map((function(e){var o;return{"@type":"Offer",url:f(t.productHref+"?vid="+e.id),priceCurrency:e.price.currency||"TRY",price:(null!==(o=e.campaignPrice)&&void 0!==o?o:e.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:e.stock>0||e.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}))}:{})}catch(e){}}(n,C||null);if(s&&t.push(s),n.categories.length)(c=p(n.categories[0],o,n))&&t.push(c)}if(y&&v===r.CATEGORY){var l=function(e){var t,o;try{var i=d.getCurrentRouting(),a=null==i?void 0:i.path,r=function(e){return a?"https://".concat(d.getDomain(),"/").concat(a).concat(e):"https://".concat(d.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(y),c=p(y,o),g=m(D);l&&t.push(l),c&&t.push(c),g&&t.push(g)}y&&v===r.BRAND&&((g=m(D))&&t.push(g));if(y&&v===r.BLOG){var f=function(t){var o;try{var i="https://".concat(d.getDomain()).concat(t.href),a="".concat(t.writer.firstName," ").concat(t.writer.lastName),r=(new DOMParser).parseFromString(t.blogContent.content,"text/html").body.textContent;return e(e({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,image:null===(o=t.image)||void 0===o?void 0:o.src},t.category&&{genre:t.category.name}),{url:i,datePublished:new Date(t.createdAt).toISOString(),dateCreated:new Date(t.createdAt).toISOString(),dateModified:new Date(t.updatedAt).toISOString(),description:t.shortDescription,articleBody:r,author:{"@type":"Person",name:a}})}catch(e){}}(y);f&&t.push(f)}return t}),[y,b]),W=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===v}));return t?u(y,v,t.titleTemplate||""):null}),[v,y]),J=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===v}));return t?u(y,v,t.descriptionTemplate||""):null}),[v,y]),q=t.useMemo((function(){return!d.getFavicon()&&(null==F?void 0:F.favIcon)?F.favIcon:null}),[]),K=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){K.push({routing:e,hrefLang:e.locale+"-"+t})})):K.push({routing:e,hrefLang:e.locale})}));var Q=function(e){var t,o,i,a,r,n=y,s=null===(o=null===(t=null==n?void 0:n.metaData)||void 0===t?void 0:t.translations)||void 0===o?void 0:o.find((function(t){return t.locale===e.locale}));if(s&&(null==s?void 0:s.slug))return s.slug;var d=K.find((function(e){return!e.routing.path}));return d&&(null===(r=null===(a=null===(i=null==n?void 0:n.metaData)||void 0===i?void 0:i.translations)||void 0===a?void 0:a.find((function(e){return e.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""},Z=l.getInstance();return t.createElement(i,null,t.createElement("title",null,f||W||(A?I?(null==M?void 0:M.name)||"":(null==N?void 0:N.name)||"":(null==F?void 0:F.pageTitle)||"")),t.createElement("meta",{name:"description",content:h||J||(A?(null==N?void 0:N.description)||"":(null==F?void 0:F.description)||"")}),K.length>1&&!P&&!R&&K.filter((function(e){return!P||e.routing.id===(null==E?void 0:E.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(G+(e.routing.path?"/"+e.routing.path:""),"/").concat(Q(e.routing))})})),!!x&&t.createElement("meta",{name:"robots",content:"noindex"}),!!T&&z.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!j&&j.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(G).concat(B).concat(e)})})),q&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(q,"/image_180.webp"),type:"image/webp"}),!j&&Z.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(G).concat(B,"/").concat(k)}),!!X.length&&X.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function p(e,t,o){try{var i=l.getInstance(),a=d.getCurrentRouting(),n=null==a?void 0:a.path,s=function(e){return n?"https://".concat(d.getDomain(),"/").concat(n).concat(e):"https://".concat(d.getDomain()).concat(e)},c=[{"@type":"ListItem",position:1,name:t,item:"https://".concat(d.getDomain())}];return(c=c.concat(e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+2,name:e.name,item:s(e.href)}})))).push({"@type":"ListItem",position:c.length+1,name:e.name,item:s(e.href)}),i.currentPageType===r.PRODUCT&&o&&c.push({"@type":"ListItem",position:c.length+1,name:o.name,item:s(o.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:c}}catch(e){}}function m(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var i=(e.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[]).find((function(e){return Object.values(e.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}))}));if(i){var a=Object.values(i.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(a)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(a.data||[]).slice(0,10).map((function(e,t){var i,a,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(a=null===(i=e.selectedVariant.mainImage)||void 0===i?void 0:i.image)||void 0===a?void 0:a.src)||"",offers:{"@type":"Offer",url:(n=e.href,o?"https://".concat(d.getDomain(),"/").concat(o).concat(n):"https://".concat(d.getDomain()).concat(n)),priceCurrency:e.selectedVariant.price.currency||"TRY",price:(null!==(r=e.selectedVariant.campaignPrice)&&void 0!==r?r:e.selectedVariant.finalPrice).toFixed(2),availability:e.selectedVariant.stock>0||e.selectedVariant.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}}}))}}}}catch(e){}}function u(e,t,o){var i,a,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,l=(null===(i=s.brand)||void 0===i?void 0:i.name)||"",c=s.selectedVariant.sku||"",p=(null===(a=s.selectedVariant.barcodeList)||void 0===a?void 0:a.length)?s.selectedVariant.barcodeList[0]:"",m=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",l)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",c)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",p)),n.includes("{{price}}")&&(n=g(n,"{{price}}",m.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var u=e.name||"";n.includes("{{name}}")&&(n=g(n,"{{name}}",u));break;case r.BLOG:var v=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",v))}}catch(e){}return n.trimEnd()}function g(e,t,o){var i=new RegExp(t,"g");return e.replace(i,o)}export{c as IkasPageHead};
|
|
1
|
+
import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import i from"next/head.js";import{useRouter as a}from"next/router";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 r}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/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{IkasProductList as s}from"../../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{IkasStorefrontConfig as d}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/index.js";import"../paypal-express-checkout/index.js";import{IkasBaseStore as l}from"../../store/base.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var c=o((function(o){var s,c,g,f=o.pageType,v=o.pageTitle,h=o.pageDescription,j=o.canonicals,x=o.disableIndex,y=o.pageSpecificData,b=o.merchantSettings,T=o.addOgpMetas,C=o.productReviewSummary,D=o.pageComponentPropValues,L=a(),O="undefined"!=typeof window,w="local"===process.env.NEXT_PUBLIC_ENV,k=L.asPath.split(/[?#]/)[0].replace("/",""),P=(k="/"===k.charAt(k.length-1)?k.slice(0,-1):k).startsWith("pages/"),R=f===r.BLOG,E=d.getCurrentRouting(),I=((null===(s=d.getMerchantSettings())||void 0===s?void 0:s.defaultLocale)||"tr")===(null==E?void 0:E.locale),S=!!y&&f===r.PRODUCT,_=!!y&&f===r.CATEGORY,V=!!y&&f===r.BRAND,A=S||_||V,M=null;(S||V||_)&&(M=y);var N=null===(c=null==M?void 0:M.translations)||void 0===c?void 0:c.find((function(e){return e.locale===(null==E?void 0:E.locale)})),B=(null==E?void 0:E.path)?"/"+E.path:"",G=w?"http://localhost:3333":"https://"+d.getDomain(),U=null===(g=d.getIndexPageSeoSettings())||void 0===g?void 0:g.find((function(e){return e.locale===d.getCurrentLocale()})),F=U?new n(U):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[f,y]);var Y=t.useMemo((function(){if(y&&y.href)return"".concat(G).concat(y.href)}),[y]),H=t.useMemo((function(){if(y&&y.href){var e=y.href;return B?"".concat(G).concat(B).concat(e):"".concat(G).concat(e)}}),[y]),z=t.useMemo((function(){var e,t,o,i=[];if(T){if(i.push({property:"og:type",content:"website"}),i.push({property:"og:site_name",content:(null==F?void 0:F.pageTitle)||"https://"+d.getDomain()}),v&&i.push({property:"og:title",content:v}),h&&i.push({property:"og:description",content:h}),f===r.INDEX){var a=null,n=null;!v&&(null==F?void 0:F.pageTitle)&&(a=F.pageTitle),!h&&(null==F?void 0:F.description)&&(n=F.description),(s=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f})))&&(a=u(y,f,s.titleTemplate||""),n=u(y,f,s.descriptionTemplate||"")),a&&i.push({property:"og:title",content:a}),n&&i.push({property:"og:description",content:n})}if(f===r.PRODUCT||f===r.CATEGORY||f===r.BRAND){var s,l=null,c=null;if((s=null===(t=d.getMetaTemplates())||void 0===t?void 0:t.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f})))&&(l=u(y,f,s.titleTemplate||""),c=u(y,f,s.descriptionTemplate||"")),!v){var p=l||A&&I&&(null==M?void 0:M.name)||A&&!I&&(null==N?void 0:N.name);p&&i.push({property:"og:title",content:p})}if(!h){var m=c||A&&!I&&(null==N?void 0:N.description);m&&i.push({property:"og:description",content:m})}}i.push({property:"og:url",content:H||(O?window.location.href:"")||"https://".concat(d.getDomain())});var g=null;if(y&&f===r.PRODUCT){var j=y.selectedVariant.mainImage;(null==j?void 0:j.image)&&(g={property:"og:image",content:j.image.src.replace(".webp",".jpg")})}if(y&&f===r.CATEGORY){var x=y;x.image&&(g={property:"og:image",content:x.image.src.replace(".webp",".jpg")})}if(y&&f===r.BRAND){var C=y;C.image&&(g={property:"og:image",content:C.image.src.replace(".webp",".jpg")})}if(y&&f===r.BLOG_CATEGORY){var D=y;D.image&&(g={property:"og:image",content:D.image.src.replace(".webp",".jpg")})}if(y&&f===r.BLOG){var L=y;L.image&&(g={property:"og:image",content:L.image.src.replace(".webp",".jpg")})}!g&&(null==F?void 0:F.icon)&&(g={property:"og:image",content:null===(o=null==F?void 0:F.icon)||void 0===o?void 0:o.src.replace(".webp",".jpg")}),!g&&(null==b?void 0:b.logo)&&(g={property:"og:image",content:b.logo.src.replace(".webp",".jpg")}),g&&i.push(g)}return i}),[v,y,Y,h,b,T,b]),X=t.useMemo((function(){var t=[],o=(null==F?void 0:F.pageTitle)||(null==b?void 0:b.merchantName)||"";if(b){var i={"@context":"https://schema.org","@type":"Website",url:"https://"+d.getDomain()},a=function(t){var o,i,a,r,n,s,l=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:l,image:l,url:"https://"+d.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(a=null===(i=t.address)||void 0===i?void 0:i.city)||void 0===a?void 0:a.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(s=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===s?void 0:s.code})}}(b);t.push(i),t.push(a)}if(y&&f===r.PRODUCT){var n=y,s=function(t,o){var i,a,n,s,l,c;try{var p=["c7d934c7-2d44-43c3-b023-de7aa93fe435"],m=null===(i=d.getMerchantSettings())||void 0===i?void 0:i.merchantId,g=d.getCurrentRouting(),f=null==g?void 0:g.path,v=function(e){return f?"https://".concat(d.getDomain(),"/").concat(f).concat(e):"https://".concat(d.getDomain()).concat(e)},h=t.selectedVariant,j=null,x=null===(a=d.getMetaTemplates())||void 0===a?void 0:a.find((function(e){return e.locale===d.getCurrentLocale()&&r.PRODUCT}));return x&&(j=u(t,r.PRODUCT,x.descriptionTemplate||"")),e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:(null===(n=t.metaData)||void 0===n?void 0:n.description)||j,image:null===(s=h.images)||void 0===s?void 0:s.map((function(e){return e.image?e.image.src:""})),productId:h.id,sku:h.sku,mpn:(null===(l=h.barcodeList)||void 0===l?void 0:l.length)?h.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(c=t.brand)||void 0===c?void 0:c.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),p.some((function(e){return e!==m}))?{offers:t.variants.map((function(e){var o;return{"@type":"Offer",url:v(t.productHref+"?vid="+e.id),priceCurrency:e.price.currency||"TRY",price:(null!==(o=e.campaignPrice)&&void 0!==o?o:e.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:e.stock>0||e.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}))}:{})}catch(e){}}(n,C||null);if(s&&t.push(s),n.categories.length)(c=p(n.categories[0],o,n))&&t.push(c)}if(y&&f===r.CATEGORY){var l=function(e){var t,o;try{var i=d.getCurrentRouting(),a=null==i?void 0:i.path,r=function(e){return a?"https://".concat(d.getDomain(),"/").concat(a).concat(e):"https://".concat(d.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(y),c=p(y,o),g=m(D);l&&t.push(l),c&&t.push(c),g&&t.push(g)}y&&f===r.BRAND&&((g=m(D))&&t.push(g));if(y&&f===r.BLOG){var v=function(t){var o;try{var i="https://".concat(d.getDomain()).concat(t.href),a="".concat(t.writer.firstName," ").concat(t.writer.lastName),r=(new DOMParser).parseFromString(t.blogContent.content,"text/html").body.textContent;return e(e({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,image:null===(o=t.image)||void 0===o?void 0:o.src},t.category&&{genre:t.category.name}),{url:i,datePublished:new Date(t.createdAt).toISOString(),dateCreated:new Date(t.createdAt).toISOString(),dateModified:new Date(t.updatedAt).toISOString(),description:t.shortDescription,articleBody:r,author:{"@type":"Person",name:a}})}catch(e){}}(y);v&&t.push(v)}return t}),[y,b]),W=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f}));return t?u(y,f,t.titleTemplate||""):null}),[f,y]),J=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===f}));return t?u(y,f,t.descriptionTemplate||""):null}),[f,y]),q=t.useMemo((function(){return!d.getFavicon()&&(null==F?void 0:F.favIcon)?F.favIcon:null}),[]),K=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){K.push({routing:e,hrefLang:e.locale+"-"+t})})):K.push({routing:e,hrefLang:e.locale})}));var Q=function(e){var t,o,i,a,r,n=y,s=null===(o=null===(t=null==n?void 0:n.metaData)||void 0===t?void 0:t.translations)||void 0===o?void 0:o.find((function(t){return t.locale===e.locale}));if(s&&(null==s?void 0:s.slug))return s.slug;var d=K.find((function(e){return!e.routing.path}));return d&&(null===(r=null===(a=null===(i=null==n?void 0:n.metaData)||void 0===i?void 0:i.translations)||void 0===a?void 0:a.find((function(e){return e.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""},Z=l.getInstance();return t.createElement(i,null,t.createElement("title",null,v||W||(A?I?(null==M?void 0:M.name)||"":(null==N?void 0:N.name)||"":(null==F?void 0:F.pageTitle)||"")),t.createElement("meta",{name:"description",content:h||J||(A?(null==N?void 0:N.description)||"":(null==F?void 0:F.description)||"")}),K.length>1&&!P&&!R&&t.createElement(t.Fragment,null,K.filter((function(e){return!P||e.routing.id===(null==E?void 0:E.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(G+(e.routing.path?"/"+e.routing.path:""),"/").concat(Q(e.routing))})})),t.createElement("link",{rel:"alternate",hrefLang:"x-default",href:"".concat(G,"/").concat(k)})),!!x&&t.createElement("meta",{name:"robots",content:"noindex"}),!!T&&z.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!j&&j.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(G).concat(B).concat(e)})})),q&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(q,"/image_180.webp"),type:"image/webp"}),!j&&Z.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(G).concat(B,"/").concat(k)}),!!X.length&&X.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function p(e,t,o){try{var i=l.getInstance(),a=d.getCurrentRouting(),n=null==a?void 0:a.path,s=function(e){return n?"https://".concat(d.getDomain(),"/").concat(n).concat(e):"https://".concat(d.getDomain()).concat(e)},c=[{"@type":"ListItem",position:1,name:t,item:"https://".concat(d.getDomain())}];return(c=c.concat(e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+2,name:e.name,item:s(e.href)}})))).push({"@type":"ListItem",position:c.length+1,name:e.name,item:s(e.href)}),i.currentPageType===r.PRODUCT&&o&&c.push({"@type":"ListItem",position:c.length+1,name:o.name,item:s(o.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:c}}catch(e){}}function m(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var i=(e.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[]).find((function(e){return Object.values(e.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}))}));if(i){var a=Object.values(i.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(a)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(a.data||[]).slice(0,10).map((function(e,t){var i,a,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(a=null===(i=e.selectedVariant.mainImage)||void 0===i?void 0:i.image)||void 0===a?void 0:a.src)||"",offers:{"@type":"Offer",url:(n=e.href,o?"https://".concat(d.getDomain(),"/").concat(o).concat(n):"https://".concat(d.getDomain()).concat(n)),priceCurrency:e.selectedVariant.price.currency||"TRY",price:(null!==(r=e.selectedVariant.campaignPrice)&&void 0!==r?r:e.selectedVariant.finalPrice).toFixed(2),availability:e.selectedVariant.stock>0||e.selectedVariant.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}}}))}}}}catch(e){}}function u(e,t,o){var i,a,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,l=(null===(i=s.brand)||void 0===i?void 0:i.name)||"",c=s.selectedVariant.sku||"",p=(null===(a=s.selectedVariant.barcodeList)||void 0===a?void 0:a.length)?s.selectedVariant.barcodeList[0]:"",m=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",l)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",c)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",p)),n.includes("{{price}}")&&(n=g(n,"{{price}}",m.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var u=e.name||"";n.includes("{{name}}")&&(n=g(n,"{{name}}",u));break;case r.BLOG:var f=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",f))}}catch(e){}return n.trimEnd()}function g(e,t,o){var i=new RegExp(t,"g");return e.replace(i,o)}export{c as IkasPageHead};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e}from'./../../../ext/tslib/tslib.es6.js';import*as n from"react";import{
|
|
1
|
+
import{__awaiter as t,__generator as e}from'./../../../ext/tslib/tslib.es6.js';import*as n from"react";import{StorefrontWidgetSettingsStatusEnum as r,getStorefrontWidgetSettings as o,listEarningMethods as i,listLoyaltyProgramTiers as a,listSpendingMethodsByCartId as s,getLoyaltyCustomerInfo as u,listLoyaltyProgramPointHistory as c,useLoyaltyPoints as d,removeLoyaltyPointsFromCart as l}from"@ikas/storefront-api";import{IkasStorefrontConfig as f}from"@ikas/storefront-config";import{IkasBaseStore as v}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";import g from"../../../store/product/index.js";import y from"../../../store/category/index.js";import h from"../../../store/brand/index.js";import{resolveStoreUrl as m}from"./common.js";import{formatCurrency as p}from"../../../utils/currency.js";import"lodash/get";function w(n){var r,m=this,w=v.getInstance(),b=function(){var t;return null===(t=w.cartStore.cart)||void 0===t?void 0:t.id},I=function(t){var e,n=null!==(e=null==t?void 0:t.themeSettingsJson)&&void 0!==e?e:t;if(!n)throw new Error("Loyalty widget settings not found");if("string"==typeof n)try{return JSON.parse(n)}catch(t){throw new Error("Loyalty widget settings format is invalid")}return n};return{getLoyaltyWidget:function(){return t(m,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return n?[2,I(n)]:[4,o()];case 1:if((t=e.sent()).isSuccess&&t.data)return[2,I(t.data)];throw new Error("Loyalty widget settings not found")}}))}))},subscribeToMarketingNotifications:function(){return t(m,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v.getInstance().customerStore.createEmailSubscription((null===(t=v.getInstance().customerStore.customer)||void 0===t?void 0:t.email)||"")];case 1:return[2,e.sent()]}}))}))},listEarningMethods:function(){return t(m,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,i()];case 1:return[2,t.sent().data||[]]}}))}))},listLoyaltyProgramTier:function(n){return t(m,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,a()];case 1:return[2,t.sent().data||[]]}}))}))},listSpendingMethodsByCartId:function(n){return t(m,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,s({cartId:n||b()})];case 1:return[2,t.sent().data||[]]}}))}))},getLoyaltyCustomerInfo:function(){return t(m,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u({cartId:b()||null})];case 1:return[2,t.sent().data||null]}}))}))},listLoyaltyProgramPointHistory:function(n){return t(m,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return t={},(r=null==n?void 0:n.type)&&(t.type=Array.isArray(r)?{in:r}:{eq:r}),[4,c(t)];case 1:return[2,e.sent().data||[]]}}))}))},useLoyaltyPoints:function(n){return t(m,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,d({input:n})];case 1:return(t=e.sent()).isSuccess?(r=n.loyaltySpendingMethodId,[4,w.cartStore.getCart()]):[3,3];case 2:e.sent(),e.label=3;case 3:return[2,!!t.isSuccess]}}))}))},removeLoyaltyPointsFromCart:function(){return t(m,void 0,void 0,(function(){var t,n,o,i,a;return e(this,(function(e){switch(e.label){case 0:return t=b(),n=r||(null===(a=null===(i=null===(o=w.cartStore.cart)||void 0===o?void 0:o.loyaltyLines)||void 0===i?void 0:i[0])||void 0===a?void 0:a.loyaltySpendingMethodId),t&&n?[4,l({cartId:t,loyaltySpendingMethodId:n})]:[2];case 1:return e.sent().isSuccess?[4,w.cartStore.getCart()]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},getProducts:function(n){return t(m,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return(null==n?void 0:n.length)?[4,g.searchProducts({input:{productIdList:n,page:1,perPage:n.length,priceListId:f.getPriceListId(),salesChannelId:f.getSalesChannelId()}},[])]:[2,[]];case 1:return t=e.sent(),[2,(null===(r=t.data)||void 0===r?void 0:r.data)||[]]}}))}))},getCategories:function(n){return t(m,void 0,void 0,(function(){var t,r,o;return e(this,(function(e){switch(e.label){case 0:return(null==n?void 0:n.length)?(t={id:{in:n},pagination:{limit:n.length,page:1}},[4,y.listCategory(t)]):[2,[]];case 1:return r=e.sent(),[2,(null===(o=r.data)||void 0===o?void 0:o.data)||[]]}}))}))},getBrands:function(n){return t(m,void 0,void 0,(function(){var t,r,o;return e(this,(function(e){switch(e.label){case 0:return(null==n?void 0:n.length)?(t={id:{in:n},pagination:{limit:n.length,page:1}},[4,h.listProductBrand(t)]):[2,[]];case 1:return r=e.sent(),[2,(null===(o=r.data)||void 0===o?void 0:o.data)||[]]}}))}))},getTags:function(n){return t(m,void 0,void 0,(function(){return e(this,(function(t){return[2,[]]}))}))},formatCurrency:function(t){return p(t,f.getDefaultCurrencyCode()||"TRY",f.getDefaultCurrencySymbol()||"TRY")}}}var b=function(){n.useEffect((function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var n=!1,i=function(t){if("function"==typeof window.startIkasLoyaltyWidget)try{window.startIkasLoyaltyWidget(t)}catch(t){console.error("[@ikas/storefront] Failed to start loyalty widget",t)}},a=function(t){var e=window.location.href.includes("http://localhost:3333/")?"http://localhost:3000/storefront-widget-script-injector.iife.js":"/sf/assets/popup/storefront-widget-script-injector.iife.js";if(e){var r=document.querySelector('script[data-ikas-loyalty-widget="true"]');if(r)"true"===r.dataset.loaded?i(t):r.addEventListener("load",(function(){return i(t)}),{once:!0});else{var o=document.createElement("script");o.src=e,o.defer=!0,o.setAttribute("data-ikas-loyalty-widget","true"),o.addEventListener("load",(function(){o.dataset.loaded="true",n||i(t)}),{once:!0}),o.addEventListener("error",(function(t){console.error("[@ikas/storefront] Failed to load loyalty widget script",e,t)}),{once:!0}),document.body.appendChild(o)}}};return t(void 0,void 0,void 0,(function(){var n,i,s,u,c;return e(this,(function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),f.getLoyaltyPrograms().length?[4,o()]:[2];case 1:return(null==(n=d.sent())?void 0:n.isSuccess)&&n.data?(i=f.getStorefrontRoutingId(),(s=n.data.storefrontRoutings||[]).length>0&&i&&(!s.some((function(t){return t.storefrontRoutingId===i}))||n.data.status!==r.ACTIVE)?[2]:[4,(l=n.data,t(void 0,void 0,void 0,(function(){var t,n,r,o;return e(this,(function(e){switch(e.label){case 0:return t={cdnURL:f.getCdnUrl()||"",merchantId:(null===(r=f.getMerchantSettings())||void 0===r?void 0:r.merchantId)||"",currency:f.getDefaultCurrencySymbol()||"TRY",callbacks:w(l),position:"fixed",storeURL:m()},[4,new Promise((function(t){var e=setInterval((function(){var n=f.getSessionId();n&&(clearInterval(e),t(n))}),100)}))];case 1:return e.sent(),(n=null===(o=v.getInstance().cartStore.cart)||void 0===o?void 0:o.id)&&(t.cartId=n),l&&(t.widgetSettings=l),[2,t]}}))})))]):[2];case 2:return u=d.sent(),window.ikasLoyaltyWidgetConfig=u,a(u),[3,4];case 3:return c=d.sent(),console.error("[@ikas/storefront] Failed to initialize loyalty widget",c),[3,4];case 4:return[2]}var l}))})),function(){n=!0}}}),[])};export{b as useLoyaltyWidget};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as r}from'./../../../ext/tslib/tslib.es6.js';import*as n from"react";import{listStorefrontPopup as o,SortByDirectionEnum as i}from"@ikas/storefront-api";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import{Analytics as a}from"../../../analytics/analytics.js";import"../../../analytics/head/index.js";import{IkasBaseStore as u}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";import c from"../../../store/product/index.js";import{resolveStoreUrl as d,resolveCartUrl as l}from"./common.js";var p=function(r){return t(void 0,void 0,void 0,(function(){var n,o,i,p,v,m,h,g,w,I,P,S,y,C
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as r}from'./../../../ext/tslib/tslib.es6.js';import*as n from"react";import{listStorefrontPopup as o,SortByDirectionEnum as i}from"@ikas/storefront-api";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import{Analytics as a}from"../../../analytics/analytics.js";import"../../../analytics/head/index.js";import{IkasBaseStore as u}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";import c from"../../../store/product/index.js";import{resolveStoreUrl as d,resolveCartUrl as l}from"./common.js";var p=function(r){return t(void 0,void 0,void 0,(function(){var n,o,i,p,v,m,h,g,w,I,P,S,y,k,C;return e(this,(function(L){switch(L.label){case 0:return n={popups:r,cartUrl:""},[4,function(){return new Promise((function(t){var e=setInterval((function(){var r=s.getSessionId();r&&(clearInterval(e),t(r))}),100)}))}()];case 1:return L.sent(),(o=s.getSessionId())&&(n.sessionId=o),(i=s.getCdnUrl())&&(n.cdnUrl=i),(p=null===(y=s.getMerchantSettings())||void 0===y?void 0:y.merchantId)&&(n.merchantId=p),(v=d())&&(n.storeUrl=v),(m=l())&&(n.cartUrl=m),(h=s.getCustomerToken())&&(n.customerToken=h),(g=s.getCurrentLocale())&&(n.locale=g),(w=null===(C=null===(k=s.getCurrentRouting())||void 0===k?void 0:k.countryCodes)||void 0===C?void 0:C[0])&&(n.countryCode=w),(I=s.getPriceListId())&&(n.priceListId=I),(P=s.getSalesChannelId())&&(n.salesChannelId=P),b=u.getInstance().customerStore.customer,(S=b?{email:b.email,firstName:b.firstName,lastName:b.lastName,birthDate:b.birthDate,phone:b.phone}:null)&&(n.customer=S),n.services=function(){var r=this,n=u.getInstance();return{searchProducts:function(n){return t(r,void 0,void 0,(function(){var t,r,o;return e(this,(function(e){switch(e.label){case 0:return[4,c.searchProducts(f(n))];case 1:return(null==(t=e.sent())?void 0:t.isSuccess)&&(null===(o=null===(r=t.data)||void 0===r?void 0:r.data)||void 0===o?void 0:o.length)?[2,t.data.data]:[2,[]]}}))}))},addItemToCart:function(o){var i=o.product,s=o.variant,a=o.quantity;return t(r,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n.cartStore.addItem(s,i,null!=a?a:1)];case 1:return[2,{success:!!(null==(t=e.sent())?void 0:t.success)}]}}))}))},saveCustomerFormData:function(o){return t(r,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,n.customerStore.saveCustomerFormData({email:o.email,firstName:o.firstName,lastName:o.lastName,birthDate:o.birthDate||"",phone:o.phone||"",storefrontPopupId:o.popupId,subscriptions:o.subscriptions})];case 1:return t.sent(),[2]}}))}))},getLastViewedProducts:function(){return t(r,void 0,void 0,(function(){var t;return e(this,(function(e){return"function"==typeof(t=n.customerStore).getLastViewedProducts?[2,t.getLastViewedProducts()]:[2,[]]}))}))},formatVariantSellPrice:function(t){return t.formattedSellPrice||""},formatVariantDiscountPrice:function(t){return t.formattedDiscountPrice||null},hasVariantDiscount:function(t){return!!t.hasDiscount},getVariantDiscountPercentage:function(t){var e=t.discountPercentage;return null==e?null:"number"==typeof e?e.toString():e},redirectToProduct:function(t){return!!t.url&&(window.location.href=t.url,!0)},viewPopup:function(t){a.viewStorefrontPopup(t)}}}(),[2,n]}var b}))}))};function f(t){var e,r,n,o,a,u=null===(e=t.order)||void 0===e?void 0:e.map((function(t){return{direction:"ASC"===t.direction?i.ASC:i.DESC,type:t.type}}));return{input:{page:null!==(r=t.page)&&void 0!==r?r:1,perPage:null!==(n=t.perPage)&&void 0!==n?n:10,order:u,productIdList:t.productIdList,categoryIdList:t.categoryIdList,priceListId:null!==(o=t.priceListId)&&void 0!==o?o:s.getPriceListId(),salesChannelId:null!==(a=t.salesChannelId)&&void 0!==a?a:s.getSalesChannelId()}}}function v(i){var a=this,u=i.router,c=i.pageSpecificDataId,d=i.pageType;n.useEffect((function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var n,i=!1,u=function(t,e){if(function(t){t.setAttribute("data-ikas-popup-widget","true"),!t.dataset.ikasPopupWidgetUrl&&t.src&&(t.dataset.ikasPopupWidgetUrl=t.src)}(t),"true"===t.dataset.ikasPopupWidgetLoaded)return e(),function(){};var r=function(){t.dataset.ikasPopupWidgetLoaded="true",e()},n=function(e){console.error("[@ikas/storefront] Failed to load popup widget script",t.src,e)};return t.addEventListener("load",r,{once:!0}),t.addEventListener("error",n,{once:!0}),function(){t.removeEventListener("load",r),t.removeEventListener("error",n)}},c=function(t){var e=window.location.href.includes("http://localhost:3333/")?"http://localhost:9000/popup-script-injector.iife.js":"/sf/assets/popup/popup-script-injector.iife.js";if(e){var r=function(){i||function(t){if("function"==typeof window.startIkasPopupWidget)try{window.startIkasPopupWidget(t)}catch(t){console.error("[@ikas/storefront] Failed to start popup widget",t)}}(t)},o=document.querySelector('script[data-ikas-popup-widget="true"]');if(o)n=u(o,r);else{var s=document.createElement("script");s.src=e,s.defer=!0,n=u(s,r),document.body.appendChild(s)}}},d=function(t){var e=window.location.href.includes("http://localhost:3333/")?"http://localhost:9000/style.css":"/sf/assets/popup/style.css";if(e&&!document.querySelector('link[href="'.concat(e,'"]'))){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.setAttribute("data-ikas-popup-widget","true");r.addEventListener("error",(function(t){console.error("[@ikas/storefront] Failed to load popup widget CSS",e,t)}),{once:!0}),document.head.appendChild(r)}};return t(a,void 0,void 0,(function(){var n,u,l;return e(this,(function(f){switch(f.label){case 0:return n=s.getStorefrontPopups()||[],[4,(v=n,t(a,void 0,void 0,(function(){var t,n,i,s,a;return e(this,(function(e){switch(e.label){case 0:if(!(t=v.map((function(t){return t.id})).filter(Boolean)).length)return[2,v];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,o({idList:t})];case 2:return(null==(n=e.sent())?void 0:n.isSuccess)&&(null===(a=n.data)||void 0===a?void 0:a.length)?(i=n.data,[2,v.map((function(t){var e=i.find((function(e){return e.id===t.id}));return e?r(r({},e),{isFilteredOnServerSide:t.isFilteredOnServerSide}):t}))]):[3,4];case 3:return s=e.sent(),console.error("[@ikas/storefront] Failed to fetch popup details",s),[3,4];case 4:return[2,v]}}))})))];case 1:return u=f.sent(),i?[2]:[4,p(u)];case 2:return l=f.sent(),window.ikasPopupConfig=l,c(l),d(),[2]}var v}))})),function(){i=!0,null==n||n();var t=document.getElementById("ikas-popup-widget-container");t&&t.remove()}}}),[u.asPath,c,d])}export{v as usePopupWidget};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as r from"react";import{IkasStorefrontConfig as n}from"@ikas/storefront-config";import{IkasBaseStore as o}from"../../store/base.js";import{autorun as i}from"mobx";var a=!1,s=function(s){var d,l=s.product,u=s.quantity,c=void 0===u?1:u,v=s.useExistingCart,f=void 0!==v&&v,p=n.getPayWithIkasUrl();if(!p)return null;var g=null!==(d=process.env.NEXT_PUBLIC_GQL_URL)&&void 0!==d?d:"",m=null==g?void 0:g.includes(".dev"),b="https://pay.ikas.".concat(m?"dev":"com","/widget?isAddToCartEnabled=true&radius=12&color=light_blue"),y=(null==l?void 0:l.isAddToCartEnabled)||!1,h=new URL(p);h.searchParams.set("isAddToCartEnabled",y.toString());var w=f?b:h.toString(),E=r.useRef(null),k=null;return r.useEffect((function(){var r=function(r){return e(void 0,void 0,void 0,(function(){var e,n,i,s,d,u;return t(this,(function(t){switch(t.label){case 0:if("ikas-buy-click"!==r.data.type)return[2];if((null===(n=E.current)||void 0===n?void 0:n.contentWindow)!==r.source)return[2];if(a)return[2];if(a=!0,f&&!(null===(i=o.getInstance().cartStore.cart)||void 0===i?void 0:i.id))return console.error("No existing cart found"),[2];t.label=1;case 1:return t.trys.push([1,,3,4]),[4,o.getInstance().cartStore.createPayWithIkasSession(l,c,f?null===(s=o.getInstance().cartStore.cart)||void 0===s?void 0:s.id:void 0)];case 2:return e=t.sent(),null===(u=null===(d=E.current)||void 0===d?void 0:d.contentWindow)||void 0===u||u.postMessage({type:"ikas-buy-loading-stop"},"*"),e.success&&e.payUrl?(v=e.payUrl,window.location.href=v,[3,4]):(console.error("Pay with ikas error:",e.error),[2]);case 3:return a=!1,[7];case 4:return[2]}var v}))}))};return window.addEventListener("message",r),k=i((function(){var e,t;console.log("Notify ikas-pay"),null===(t=null===(e=E.current)||void 0===e?void 0:e.contentWindow)||void 0===t||t.postMessage({type:"ikas-buy-enabled-state-change",isAddToCartEnabled:!!f||((null==l?void 0:l.isAddToCartEnabled)||!1)},"*")})),function(){window.removeEventListener("message",r),null==k||k()}}),[l,c]),r.createElement("iframe",{ref:E,src:w,width:"100%",height:"100%",style:{border:"none"}})};export{s as PayWithIkas};
|
package/build/hooks/useStore.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"@ikas/storefront-config";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/index.js";import{IkasBaseStore as o}from"../store/base.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"@ikas/storefront-models";import"
|
|
1
|
+
import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"@ikas/storefront-config";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/index.js";import{IkasBaseStore as o}from"../store/base.js";import"mobx";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../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"../pages/home.js";import"../pages/_slug_/index.js";import"../pages/pages/_slug_.js";import"../pages/checkout.js";import"../pages/account/index.js";import"../pages/account/addresses.js";import"../pages/account/orders/index.js";import"../pages/account/orders/_id_.js";import"../pages/account/login.js";import"../pages/account/register.js";import"../pages/account/forgot-password.js";import"../pages/account/recover-password.js";import"../pages/cart.js";import"../pages/editor.js";import"../pages/account/favorite-products.js";import"../pages/search.js";import"next/error.js";import"../pages/blog/index.js";import"../pages/blog/_slug_.js";import"../pages/raffle/_slug_.js";import"../pages/raffle/index.js";import"../pages/account/raffles.js";import"../pages/account/activate.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";function t(){return o.getInstance()}export{t as useStore};
|
package/build/pages/checkout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as o,__awaiter as e,__generator as t,__assign as r}from'./../ext/tslib/tslib.es6.js';import*as s from"react";import{observer as i}from"mobx-react-lite";import d from"../components/checkout/index.js";import{useRouter as n}from"next/router.js";import{FullscreenLoading as a}from"../components/checkout/components/fullscreen-loading/index.js";import{CheckoutStep as m}from"../components/checkout/model.js";import{setAPIClientConfig as l,getCartById as c,CampaignOfferTargetPageTypeEnum as p}from"@ikas/storefront-api";import{IkasStorefrontConfig as u}from"@ikas/storefront-config";import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/index.js";import{IkasBaseStore as j}from"../store/base.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"@ikas/storefront-models";import"mobx";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import{IkasCart as f}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import{IkasCheckout as g}from"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import{LocalizedAddressConfig as x}from"@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"./home.js";import"./_slug_/index.js";import"./pages/_slug_.js";import"./account/index.js";import"./account/addresses.js";import"./account/orders/index.js";import"./account/orders/_id_.js";import"./account/login.js";import"./account/register.js";import"./account/forgot-password.js";import"./account/recover-password.js";import"./cart.js";import"./editor.js";import"./account/favorite-products.js";import"./search.js";import"next/error.js";import"./blog/index.js";import"./blog/_slug_.js";import"./raffle/_slug_.js";import"./raffle/index.js";import"./account/raffles.js";import"./account/activate.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";import{initIkasEvents as y}from"../analytics/events.js";import{APIErrorCode as v}from'./../ext/@ikas/fe-api-client/build/utils/api.js';import'./../ext/axios/index.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import h from"../store/checkout/index.js";var C=i((function(i){var C=i.customizationProps,b=i.configJson,E=o(i,["customizationProps","configJson"]),k=n(),F=s.useState(),P=F[0],w=F[1],_=s.useState(E.checkoutSettings),B=_[0],T=_[1];u.init(b),x.setCDNUrl(process.env.NEXT_PUBLIC_SETTINGS_CDN_URL),l(),s.useEffect((function(){!function(o){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==o?void 0:o.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==o?void 0:o.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==o?void 0:o.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==o?void 0:o.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==o?void 0:o.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==o?void 0:o.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==o?void 0:o.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==o?void 0:o.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==o?void 0:o.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==o?void 0:o.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==o?void 0:o.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==o?void 0:o.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==o?void 0:o.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==o?void 0:o.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==o?void 0:o.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==o?void 0:o.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==o?void 0:o.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==o?void 0:o.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==o?void 0:o.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==o?void 0:o.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==o?void 0:o.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==o?void 0:o.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==o?void 0:o.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==o?void 0:o.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==o?void 0:o.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==o?void 0:o.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==o?void 0:o.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==o?void 0:o.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(C)}),[C]),s.useEffect((function(){j.getInstance().checkLocalization(),S(),y()}),[]);var S=s.useCallback((function(){return e(void 0,void 0,void 0,(function(){var o,e,r,s,i,d,n,a,l,x,y,C,b,E,F,P,_,S,I;return t(this,(function(t){switch(t.label){case 0:if(o=new URLSearchParams(window.location.search),e=o.get("id"),r=o.get("step"),s=o.get("lines"),i=o.get("couponCode"),!s)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),(d=j.getInstance().cartStore).removeCart(),n=s.split(","),a=n.map((function(o){var e=o.split(":"),t=e[0],r=e[1];return{variantId:t,quantity:parseInt(r)}})),l={variantLines:a,couponCode:i||void 0},[4,d.createCart(l)];case 2:return(x=t.sent()).success&&(y=u.getCurrentRouting(),C=(null==y?void 0:y.path)?"/".concat(y.path):"",window.location.href="".concat(C,"/checkout?id=").concat(null===(S=x.response.data)||void 0===S?void 0:S.id,"&step=info")),[3,4];case 3:return b=t.sent(),console.error("Error creating cart:",b),[3,4];case 4:return[2];case 5:return e?(E=!1,r&&r===m.SUCCESS&&(E=!0),[4,c({id:e,getCompletedCart:E,targetPageType:p.CHECKOUT})]):[2,k.replace("/")];case 6:return F=t.sent(),B?[3,8]:[4,h.listCheckoutSettings({})];case 7:(P=t.sent()).isSuccess&&(null===(I=P.data)||void 0===I?void 0:I.length)?T(P.data[0]):(console.error("CHECKOUT SETTINGS FETCH FAILED!"),console.error(P),console.error(P.graphQLErrors),console.error(P.errorCodes)),t.label=8;case 8:return F.isSuccess&&F.data?(_=F.data,w(new g(_)),j.getInstance().cartStore.setCart(new f(_))):F.errorCodes.some((function(o){return o===v.LOGIN_REQUIRED}))?k.replace("/account/login?redirect="+encodeURIComponent(window.location.href)):k.replace("/"),[2]}}))}))}),[]);return P&&B?s.createElement(d,r({checkout:P,customizationProps:C},E,{checkoutSettings:B})):s.createElement(a,null)}));export{C as default};
|
|
1
|
+
import{__rest as o,__awaiter as e,__generator as t,__assign as r}from'./../ext/tslib/tslib.es6.js';import*as s from"react";import{observer as i}from"mobx-react-lite";import d from"../components/checkout/index.js";import{useRouter as n}from"next/router.js";import{FullscreenLoading as a}from"../components/checkout/components/fullscreen-loading/index.js";import{CheckoutStep as m}from"../components/checkout/model.js";import{setAPIClientConfig as l,getCartById as c,CampaignOfferTargetPageTypeEnum as p}from"@ikas/storefront-api";import{IkasStorefrontConfig as u}from"@ikas/storefront-config";import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/index.js";import{IkasBaseStore as j}from"../store/base.js";import"mobx";import"../models/data/blog/category/index.js";import"../models/data/blog/content/index.js";import"../models/data/blog/meta-data/index.js";import"../models/data/blog/tag/index.js";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"@ikas/storefront-models";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import{IkasCart as f}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import{IkasCheckout as g}from"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import{LocalizedAddressConfig as x}from"@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"./home.js";import"./_slug_/index.js";import"./pages/_slug_.js";import"./account/index.js";import"./account/addresses.js";import"./account/orders/index.js";import"./account/orders/_id_.js";import"./account/login.js";import"./account/register.js";import"./account/forgot-password.js";import"./account/recover-password.js";import"./cart.js";import"./editor.js";import"./account/favorite-products.js";import"./search.js";import"next/error.js";import"./blog/index.js";import"./blog/_slug_.js";import"./raffle/_slug_.js";import"./raffle/index.js";import"./account/raffles.js";import"./account/activate.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";import{initIkasEvents as y}from"../analytics/events.js";import{APIErrorCode as v}from'./../ext/@ikas/fe-api-client/build/utils/api.js';import'./../ext/axios/index.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import h from"../store/checkout/index.js";var C=i((function(i){var C=i.customizationProps,E=i.configJson,b=o(i,["customizationProps","configJson"]),k=n(),F=s.useState(),P=F[0],w=F[1],_=s.useState(b.checkoutSettings),B=_[0],T=_[1];u.init(E),x.setCDNUrl(process.env.NEXT_PUBLIC_SETTINGS_CDN_URL),l(),s.useEffect((function(){!function(o){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==o?void 0:o.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==o?void 0:o.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==o?void 0:o.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==o?void 0:o.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==o?void 0:o.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==o?void 0:o.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==o?void 0:o.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==o?void 0:o.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==o?void 0:o.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==o?void 0:o.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==o?void 0:o.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==o?void 0:o.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==o?void 0:o.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==o?void 0:o.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==o?void 0:o.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==o?void 0:o.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==o?void 0:o.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==o?void 0:o.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==o?void 0:o.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==o?void 0:o.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==o?void 0:o.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==o?void 0:o.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==o?void 0:o.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==o?void 0:o.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==o?void 0:o.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==o?void 0:o.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==o?void 0:o.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==o?void 0:o.campaignOffersMiddlePhaseOverlayColor)||"#292727ad"),document.documentElement.style.lineHeight="1.5"}(C)}),[C]),s.useEffect((function(){j.getInstance().checkLocalization(),S(),y()}),[]);var S=s.useCallback((function(){return e(void 0,void 0,void 0,(function(){var o,e,r,s,i,d,n,a,l,x,y,C,E,b,F,P,_,S,I;return t(this,(function(t){switch(t.label){case 0:if(o=new URLSearchParams(window.location.search),e=o.get("id"),r=o.get("step"),s=o.get("lines"),i=o.get("couponCode"),!s)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),(d=j.getInstance().cartStore).removeCart(),n=s.split(","),a=n.map((function(o){var e=o.split(":"),t=e[0],r=e[1];return{variantId:t,quantity:parseInt(r)}})),l={variantLines:a,couponCode:i||void 0},[4,d.createCart(l)];case 2:return(x=t.sent()).success&&(y=u.getCurrentRouting(),C=(null==y?void 0:y.path)?"/".concat(y.path):"",window.location.href="".concat(C,"/checkout?id=").concat(null===(S=x.response.data)||void 0===S?void 0:S.id,"&step=info")),[3,4];case 3:return E=t.sent(),console.error("Error creating cart:",E),[3,4];case 4:return[2];case 5:return e?(b=!1,r&&r===m.SUCCESS&&(b=!0),[4,c({id:e,getCompletedCart:b,targetPageType:p.CHECKOUT})]):[2,k.replace("/")];case 6:return F=t.sent(),B?[3,8]:[4,h.listCheckoutSettings({})];case 7:(P=t.sent()).isSuccess&&(null===(I=P.data)||void 0===I?void 0:I.length)?T(P.data[0]):(console.error("CHECKOUT SETTINGS FETCH FAILED!"),console.error(P),console.error(P.graphQLErrors),console.error(P.errorCodes)),t.label=8;case 8:return F.isSuccess&&F.data?(_=F.data,w(new g(_)),j.getInstance().cartStore.setCart(new f(_))):F.errorCodes.some((function(o){return o===v.LOGIN_REQUIRED}))?k.replace("/account/login?redirect="+encodeURIComponent(window.location.href)):k.replace("/"),[2]}}))}))}),[]);return P&&B?s.createElement(d,r({checkout:P,customizationProps:C},b,{checkoutSettings:B})):s.createElement(a,null)}));export{C as default};
|
|
@@ -41,7 +41,7 @@ export declare class IkasCartStore {
|
|
|
41
41
|
* @param quantity - The quantity to purchase (defaults to 1)
|
|
42
42
|
* @returns PayWithIkasResult with the session URL or error
|
|
43
43
|
*/
|
|
44
|
-
createPayWithIkasSession(product
|
|
44
|
+
createPayWithIkasSession(product?: IkasProduct, quantity?: number, existingCartId?: string | null): Promise<PayWithIkasResult>;
|
|
45
45
|
private setCart;
|
|
46
46
|
private beforeCartOperationCheck;
|
|
47
47
|
private createCartLineOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as i}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import n from"./api.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{IkasProductOptionType as a,IkasCustomerEmailSubscriptionStatus as o}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import{Analytics as d}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{SaveCartInput as u,createPayWithIkasSessionUrl as c}from"@ikas/storefront-api";import{getCookieValue as l}from"../../utils/helper.js";var p,m="cartId",v=function(){function m(c){var m=this;this.cart=null,this._isLoadingCart=!1,this._isCartLoadFinished=!1,this.addItem=function(r,a,o,u){return void 0===o&&(o=1),t(m,void 0,void 0,(function(){var t,c,m,v,f,h,I,g,C,b,S,y,j,x,O,P,_,T,L,E;return e(this,(function(e){switch(e.label){case 0:t=null!==(y=null==u?void 0:u.isPayWithIkas)&&void 0!==y&&y,e.label=1;case 1:return e.trys.push([1,7,,8]),!t&&a.productOptionSetId&&!a.productOptionSet&&this.baseStore.router?(this.baseStore.router.push(a.productHref),[2,{success:!1,validationError:p.INVALID_PRODUCT_OPTION_VALUES}]):a.hasValidProductOptionValues?r.hasStock||r.sellIfOutOfStock?(c=void 0,t?[3,3]:[4,this.beforeCartOperationCheck()]):[2,{success:!1,validationError:p.INSUFFICIENT_STOCK}]:[2,{success:!1,validationError:p.INVALID_PRODUCT_OPTION_VALUES}];case 2:if(e.sent(),this.cart&&(c=this.findExistingItem(r,a))){if(null===(j=a.productOptionSet)||void 0===j||j.initOptionValues(),!r.bundleSettings)return[2,this.changeItemQuantity(c,c.quantity+1,a.offers,a)];if(!this.getEditLineID())return[2,this.changeItemQuantity(c,c.quantity+1,a.offers,a)]}e.label=3;case 3:return m=this.getOptionValues(a),v=o,(null==(f=null===(x=a.salesChannels)||void 0===x?void 0:x.find((function(t){return t.id===s.getSalesChannelId()})))?void 0:f.minQuantityPerCart)&&o<f.minQuantityPerCart&&(v=f.minQuantityPerCart),(null==f?void 0:f.maxQuantityPerCart)&&o>f.maxQuantityPerCart&&(v=f.maxQuantityPerCart),h=t?null:(null===(O=this.cart)||void 0===O?void 0:O.id)||localStorage.getItem("cartId"),[4,n.addItemToCart({input:i({cartId:h,item:{id:null!==(P=null==c?void 0:c.id)&&void 0!==P?P:null,quantity:null!==(_=null==c?void 0:c.quantity)&&void 0!==_?_:v,variant:{id:r.id,name:a.name,bundleProducts:null===(T=r.bundleSettings)||void 0===T?void 0:T.products.map((function(t){var e,i,r;return{id:t.id,productId:(null===(e=t.product)||void 0===e?void 0:e.id)||"",variantId:(null===(r=null===(i=t.product)||void 0===i?void 0:i.selectedVariant)||void 0===r?void 0:r.id)||"",quantity:t.quantity}}))}},acceptedOffers:this.getAcceptedOffers(a.offers),options:m.length?m:null,priceListId:s.getPriceListId()||null,salesChannelId:s.getSalesChannelId(),storefrontThemeId:s.getStorefrontThemeId(),metadata:{_fbp:l("_fbp"),_fbc:l("_fbc"),_ga:l("_ga")}},a.selectedVariant.subscriptionPlan&&a.selectedVariant.subscriptionPlan.isSelected?{subscriptionPlanId:a.selectedVariant.subscriptionPlan.subscriptionPlanId,subscriptionPlanPeriodId:null===(L=a.selectedVariant.subscriptionPlan.periods.find((function(t){return t.isSelected})))||void 0===L?void 0:L.id}:{})})];case 4:return I=e.sent(),t?[3,6]:I.isSuccess&&I.data?[4,this.setCart(I.data)]:[3,6];case 5:e.sent(),e.label=6;case 6:return(g=t?I.data:this.cart)&&(C="".concat(g.id,"-").concat(g.updatedAt),(b=g.items.find((function(t){return t.variant.id===r.id})))&&d.addToCart(b,o,C,g,a)),null===(E=a.productOptionSet)||void 0===E||E.initOptionValues(),[2,{success:I.isSuccess,response:I}];case 7:return S=e.sent(),console.log(S),[2,{success:!1}];case 8:return[2]}}))}))},this.changeItemQuantity=function(r,a,o,u){return t(m,void 0,void 0,(function(){var t,c,p,m,v,f,h,I,g;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,5,,6]),[4,this.beforeCartOperationCheck()];case 1:return e.sent(),[4,n.addItemToCart({input:i({cartId:(null===(v=this.cart)||void 0===v?void 0:v.id)||null,item:{id:r.id,quantity:a,variant:{id:r.variant.id,name:r.variant.name,bundleProducts:null===(f=r.variant.bundleProducts)||void 0===f?void 0:f.map((function(t){return{id:t.id,productId:t.variant.productId||"",variantId:t.variant.id||"",quantity:t.quantity}}))}},acceptedOffers:this.getAcceptedOffers(o),options:this.createCartLineOptions(r),priceListId:s.getPriceListId()||null,salesChannelId:s.getSalesChannelId(),storefrontThemeId:s.getStorefrontThemeId(),metadata:{_fbp:l("_fbp"),_fbc:l("_fbc"),_ga:l("_ga")}},(null===(h=null==u?void 0:u.selectedVariant)||void 0===h?void 0:h.subscriptionPlan)&&(null===(I=null==u?void 0:u.selectedVariant)||void 0===I?void 0:I.subscriptionPlan.isSelected)?{subscriptionPlanId:null==u?void 0:u.selectedVariant.subscriptionPlan.subscriptionPlanId,subscriptionPlanPeriodId:null===(g=null==u?void 0:u.selectedVariant.subscriptionPlan.periods.find((function(t){return t.isSelected})))||void 0===g?void 0:g.id}:{})})];case 2:return(t=e.sent()).isSuccess&&t.data?[4,this.setCart(t.data)]:[3,4];case 3:e.sent(),e.label=4;case 4:return this.cart&&(c="".concat(this.cart.id,"-").concat(this.cart.updatedAt),(p=r.quantity)>a?d.removeFromCart(r,p-a,this.cart):d.addToCart(r,a-p,c,this.cart,u)),this.removeCardIfEmpty(),[2,{success:t.isSuccess,response:t}];case 5:return m=e.sent(),console.log(m),[2,{success:!1}];case 6:return[2]}}))}))},this.createCart=function(i){return t(m,void 0,void 0,(function(){var t,r=this;return e(this,(function(e){switch(e.label){case 0:return[4,n.createCart({input:{items:i.variantLines.map((function(t){return{variant:{id:t.variantId},quantity:t.quantity}})),couponCode:i.couponCode,salesChannelId:s.getSalesChannelId(),storefrontThemeId:s.getStorefrontThemeId()}})];case 1:return(t=e.sent()).isSuccess&&t.data?[4,this.setCart(t.data)]:[3,3];case 2:e.sent(),e.label=3;case 3:return i.variantLines.forEach((function(t){if(r.cart){var e="".concat(r.cart.id,"-").concat(r.cart.updatedAt),i=r.cart.items.find((function(e){return e.variant.id===t.variantId}));i&&d.addToCart(i,t.quantity,e,r.cart)}})),[2,{success:t.isSuccess,response:t}]}}))}))},this.removeItem=function(i){return t(m,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,this.changeItemQuantity(i,0)];case 1:return[2,t.sent()]}}))}))},this.removeCart=function(){localStorage.removeItem("cartId"),m.cart=void 0},this.waitUntilInitialized=function(){return new Promise((function(t){var e=setInterval((function(){m.isCartLoadFinished&&(clearInterval(e),t(null))}),100)}))},this.getEditLineID=function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("editLineID")||""},this.findExistingItem=function(t,e){var i,r,n,a,o,s;if(!e.productOptionSetId&&!t.bundleSettings)return null===(i=m.cart)||void 0===i?void 0:i.orderLineItems.find((function(e){return e.variant.id===t.id}));if(t.bundleSettings){var d=m.getEditLineID();if(d)if(S=null===(r=m.cart)||void 0===r?void 0:r.orderLineItems.find((function(t){return t.id===d})))return S}var u=(null===(n=m.cart)||void 0===n?void 0:n.orderLineItems.filter((function(e){return e.variant.id===t.id})))||[];if(e.productOptionSetId)for(var c=m.getOptionValues(e),l=u.filter((function(t){var e;return(null===(e=t.options)||void 0===e?void 0:e.length)===c.length}))||[],p=0,v=l;p<v.length;p++){if((S=v[p]).options){for(var f=!0,h=function(t){var i=t.values.map((function(t){return t.value})),r=null===(s=null===(o=null===(a=e.productOptionSet)||void 0===a?void 0:a.options)||void 0===o?void 0:o.find((function(e){return e.id===t.productOptionId})))||void 0===s?void 0:s.values;if(!(f=f&&i.length===(null==r?void 0:r.length)&&i.every((function(t){return null==r?void 0:r.includes(t)}))))return"break"},I=0,g=S.options;I<g.length;I++){if("break"===h(g[I]))break}if(f){if(!t.bundleSettings)return S;if(m.isSameBundleItem(t,S))return S}}}else if(t.bundleSettings)for(var C=0,b=u;C<b.length;C++){var S=b[C];if(m.isSameBundleItem(t,S))return S}},this.isSameBundleItem=function(t,e){var i,r=null===(i=t.bundleSettings)||void 0===i?void 0:i.products,n=e.variant.bundleProducts;return!!r&&((null==r?void 0:r.length)===(null==n?void 0:n.length)&&(null==r?void 0:r.every((function(t){return!!(null==n?void 0:n.find((function(e){var i;return e.id===t.id&&e.quantity===t.quantity&&e.variant.id===(null===(i=t.product)||void 0===i?void 0:i.selectedVariant.id)})))}))))},this.saveCouponCode=function(i){return t(m,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.cart?[4,n.saveCartCouponCode({cartId:this.cart.id,couponCode:i})]:[2,{success:!1,validationError:p.EMPTY_CART}];case 1:return(t=e.sent()).isSuccess&&t.data&&(this.cart=t.data),[2,{success:t.isSuccess,response:t}]}}))}))},this.removeCouponCode=function(){return t(m,void 0,void 0,(function(){return e(this,(function(t){return[2,this.saveCouponCode(null)]}))}))},this.removeGiftCardLine=function(i){return t(m,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.cart?[4,n.removeGiftCardFromCart({cartId:this.cart.id,giftCardId:i})]:[2,{success:!1,validationError:p.EMPTY_CART}];case 1:return(t=e.sent()).isSuccess&&t.data&&(this.cart=t.data),[2,{success:t.isSuccess,response:t}]}}))}))},this.removeLoyaltyPointsFromCart=function(i){return t(m,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.cart?[4,n.removeLoyaltyPointsFromCart({cartId:this.cart.id,loyaltySpendingMethodId:i})]:[2,{success:!1,validationError:p.EMPTY_CART}];case 1:return(t=e.sent()).isSuccess&&t.data&&(this.cart=t.data),[2,{success:t.isSuccess,response:t}]}}))}))},this.saveCart=function(i){return t(m,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return(t=new u(i)).customer&&this.baseStore.customerStore.customer&&(t.customer.notificationsAccepted=this.baseStore.customerStore.customer.subscriptionStatus===o.SUBSCRIBED),[4,n.saveCart({input:t})];case 1:return[2,{success:(r=e.sent()).isSuccess,response:r}]}}))}))},this.removeCardIfEmpty=function(){var t;0===(null===(t=m.cart)||void 0===t?void 0:t.itemCount)&&m.removeCart()},this.getCart=function(){return t(m,void 0,void 0,(function(){var t,i,r,a,o,s;return e(this,(function(e){switch(e.label){case 0:if(!("undefined"!=typeof localStorage))return[2];e.label=1;case 1:return e.trys.push([1,6,7,8]),this._isLoadingCart=!0,t=null===(o=this.baseStore.customerStore.customer)||void 0===o?void 0:o.id,(i=(null===(s=this.cart)||void 0===s?void 0:s.id)||localStorage.getItem("cartId"))||t?[4,n.getCartById({id:i})]:[2];case 2:return(r=e.sent()).isSuccess&&r.data?[4,this.setCart(r.data)]:[3,4];case 3:return e.sent(),[3,5];case 4:this.removeCart(),e.label=5;case 5:return[3,8];case 6:return a=e.sent(),console.log(a),[3,8];case 7:return this._isLoadingCart=!1,this._isCartLoadFinished=!0,[7];case 8:return[2]}}))}))},this.setCart=function(i){return t(m,void 0,void 0,(function(){return e(this,(function(t){return localStorage.setItem("cartId",i.id),this.cart=i,[2]}))}))},this.beforeCartOperationCheck=function(){return t(m,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t=localStorage.getItem("cartId"),!this.cart||t?[3,1]:(this.removeCart(),[3,3]);case 1:return this.cart||!t?[3,3]:[4,this.getCart()];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},this.createCartLineOptions=function(t){if(t&&t.options){for(var e=[],i=0,r=t.options;i<r.length;i++){var n=r[i],a={productOptionId:n.productOptionId,productOptionsSetId:n.productOptionsSetId,values:n.values.map((function(t){return t.value}))};e.push(a)}return e}return null},this.getOptionValues=function(t){var e,i=[];return null===(e=t.productOptionSet)||void 0===e||e.options.forEach((function(t){var e=t.values;t.type===a.DATE_PICKER&&(e=t.values.map((function(t){var e=new Date(t);return isNaN(e.getTime())?t:e.toISOString().split("T")[0]}))),t.values.length&&i.push({productOptionId:t.id,productOptionsSetId:t.productOptionSetId,values:e})})),i},this._windowAddToCart=function(i){return t(m,void 0,void 0,(function(){var t,r,a,o,u,c,p,m,v,f,h;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,5,,6]),[4,this.beforeCartOperationCheck()];case 1:return e.sent(),t=i.itemId?null===(v=this.cart)||void 0===v?void 0:v.items.find((function(t){return t.id===i.itemId})):null,[4,n.addItemToCart({input:{cartId:(null===(f=this.cart)||void 0===f?void 0:f.id)||null,item:{id:i.itemId||null,quantity:i.quantity,variant:{id:i.variantId}},priceListId:s.getPriceListId()||null,salesChannelId:s.getSalesChannelId(),storefrontThemeId:s.getStorefrontThemeId(),metadata:{_fbp:l("_fbp"),_fbc:l("_fbc"),_ga:l("_ga")}}})];case 2:return(r=e.sent()).isSuccess&&r.data?(i.itemId||(a=(null===(h=this.cart)||void 0===h?void 0:h.items.map((function(t){return t.id})))||[],o=r.data.items.map((function(t){return t.id})),(u=o.find((function(t){return!a.includes(t)})))&&(t=r.data.items.find((function(t){return t.id===u})))),[4,this.setCart(r.data)]):[3,4];case 3:e.sent(),e.label=4;case 4:return this.cart&&t&&(c="".concat(this.cart.id,"-").concat(this.cart.updatedAt),(p=i.quantity)>i.quantity?d.removeFromCart(t,p-i.quantity,this.cart):d.addToCart(t,i.quantity-p,c,this.cart)),this.removeCardIfEmpty(),[2,{success:r.isSuccess,response:r}];case 5:return m=e.sent(),console.log(m),[2,{success:!1}];case 6:return[2]}}))}))},this.baseStore=c,r(this)}return Object.defineProperty(m.prototype,"isLoadingCart",{get:function(){return this._isLoadingCart},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"isCartLoadFinished",{get:function(){return this._isCartLoadFinished},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"checkoutId",{get:function(){var t;return null===(t=this.cart)||void 0===t?void 0:t.id},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"checkoutUrl",{get:function(){if(this.checkoutId)return"/checkout?id=".concat(this.checkoutId,"&step=info")},enumerable:!1,configurable:!0}),m.prototype.getAcceptedOffers=function(t){var e=(null==t?void 0:t.filter((function(t){return t.isSelected&&!t.isAccepted})).map((function(t){return{campaignOfferId:t.campaignOfferId,campaignOfferProductId:t.campaignOfferProductId,productId:t.product.id,quantity:t.quantity,variantId:t.product.selectedVariant.id}})))||[];return e.length?e:void 0},m.prototype.createPayWithIkasSession=function(i,r){var n,a,o,d,u,l,p,m;return void 0===r&&(r=1),t(this,void 0,void 0,(function(){var t,v,f,h,I,g,C;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),t=s.getSalesChannelId(),v=s.getStorefrontThemeId(),t&&v?(f=i.selectedVariant)?[4,this.addItem(f,i,r,{isPayWithIkas:!0})]:[2,{success:!1,error:"No variant selected"}]:[2,{success:!1,error:"Missing storefront configuration"}];case 1:return(h=e.sent()).success&&(null===(a=null===(n=h.response)||void 0===n?void 0:n.data)||void 0===a?void 0:a.id)?(I=h.response.data.id,[4,c({cartId:I})]):[2,{success:!1,error:(null===(u=null===(d=null===(o=h.response)||void 0===o?void 0:o.graphQLErrors)||void 0===d?void 0:d[0])||void 0===u?void 0:u.message)||"Failed to create cart"}];case 2:return!(g=e.sent()).data||(null===(l=g.graphQLErrors)||void 0===l?void 0:l.length)?[2,{success:!1,error:(null===(m=null===(p=g.graphQLErrors)||void 0===p?void 0:p[0])||void 0===m?void 0:m.message)||"Failed to create Pay with ikas session"}]:[2,{success:!0,payUrl:g.data.payUrl,expiresAt:g.data.expiresAt}];case 3:return[2,{success:!1,error:(C=e.sent())instanceof Error?C.message:"Unknown error occurred"}];case 4:return[2]}}))}))},m}();!function(t){t.INSUFFICIENT_STOCK="INSUFFICIENT_STOCK",t.INVALID_PRODUCT_OPTION_VALUES="INVALID_PRODUCT_OPTION_VALUES",t.EMPTY_CART="EMPTY_CART"}(p||(p={}));export{m as CART_LS_KEY,p as IkasCartOperationValidationError,v as IkasCartStore};
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as i}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import n from"./api.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{IkasProductOptionType as a,IkasCustomerEmailSubscriptionStatus as o}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import{Analytics as d}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{SaveCartInput as c,createPayWithIkasSessionUrl as u}from"@ikas/storefront-api";import{getCookieValue as l}from"../../utils/helper.js";var p,m="cartId",f=function(){function m(u){var m=this;this.cart=null,this._isLoadingCart=!1,this._isCartLoadFinished=!1,this.addItem=function(r,a,o,c){return void 0===o&&(o=1),t(m,void 0,void 0,(function(){var t,u,m,f,v,h,I,g,C,b,S,y,j,x,O,P,_,T,L,E;return e(this,(function(e){switch(e.label){case 0:t=null!==(y=null==c?void 0:c.isPayWithIkas)&&void 0!==y&&y,e.label=1;case 1:return e.trys.push([1,7,,8]),!t&&a.productOptionSetId&&!a.productOptionSet&&this.baseStore.router?(this.baseStore.router.push(a.productHref),[2,{success:!1,validationError:p.INVALID_PRODUCT_OPTION_VALUES}]):a.hasValidProductOptionValues?r.hasStock||r.sellIfOutOfStock?(u=void 0,t?[3,3]:[4,this.beforeCartOperationCheck()]):[2,{success:!1,validationError:p.INSUFFICIENT_STOCK}]:[2,{success:!1,validationError:p.INVALID_PRODUCT_OPTION_VALUES}];case 2:if(e.sent(),this.cart&&(u=this.findExistingItem(r,a))){if(null===(j=a.productOptionSet)||void 0===j||j.initOptionValues(),!r.bundleSettings)return[2,this.changeItemQuantity(u,u.quantity+1,a.offers,a)];if(!this.getEditLineID())return[2,this.changeItemQuantity(u,u.quantity+1,a.offers,a)]}e.label=3;case 3:return m=this.getOptionValues(a),f=o,(null==(v=null===(x=a.salesChannels)||void 0===x?void 0:x.find((function(t){return t.id===s.getSalesChannelId()})))?void 0:v.minQuantityPerCart)&&o<v.minQuantityPerCart&&(f=v.minQuantityPerCart),(null==v?void 0:v.maxQuantityPerCart)&&o>v.maxQuantityPerCart&&(f=v.maxQuantityPerCart),h=t?null:(null===(O=this.cart)||void 0===O?void 0:O.id)||localStorage.getItem("cartId"),[4,n.addItemToCart({input:i({cartId:h,item:{id:null!==(P=null==u?void 0:u.id)&&void 0!==P?P:null,quantity:null!==(_=null==u?void 0:u.quantity)&&void 0!==_?_:f,variant:{id:r.id,name:a.name,bundleProducts:null===(T=r.bundleSettings)||void 0===T?void 0:T.products.map((function(t){var e,i,r;return{id:t.id,productId:(null===(e=t.product)||void 0===e?void 0:e.id)||"",variantId:(null===(r=null===(i=t.product)||void 0===i?void 0:i.selectedVariant)||void 0===r?void 0:r.id)||"",quantity:t.quantity}}))}},acceptedOffers:this.getAcceptedOffers(a.offers),options:m.length?m:null,priceListId:s.getPriceListId()||null,salesChannelId:s.getSalesChannelId(),storefrontThemeId:s.getStorefrontThemeId(),metadata:{_fbp:l("_fbp"),_fbc:l("_fbc"),_ga:l("_ga")}},a.selectedVariant.subscriptionPlan&&a.selectedVariant.subscriptionPlan.isSelected?{subscriptionPlanId:a.selectedVariant.subscriptionPlan.subscriptionPlanId,subscriptionPlanPeriodId:null===(L=a.selectedVariant.subscriptionPlan.periods.find((function(t){return t.isSelected})))||void 0===L?void 0:L.id}:{})})];case 4:return I=e.sent(),t?[3,6]:I.isSuccess&&I.data?[4,this.setCart(I.data)]:[3,6];case 5:e.sent(),e.label=6;case 6:return(g=t?I.data:this.cart)&&(C="".concat(g.id,"-").concat(g.updatedAt),(b=g.items.find((function(t){return t.variant.id===r.id})))&&d.addToCart(b,o,C,g,a)),null===(E=a.productOptionSet)||void 0===E||E.initOptionValues(),[2,{success:I.isSuccess,response:I}];case 7:return S=e.sent(),console.log(S),[2,{success:!1}];case 8:return[2]}}))}))},this.changeItemQuantity=function(r,a,o,c){return t(m,void 0,void 0,(function(){var t,u,p,m,f,v,h,I,g;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,5,,6]),[4,this.beforeCartOperationCheck()];case 1:return e.sent(),[4,n.addItemToCart({input:i({cartId:(null===(f=this.cart)||void 0===f?void 0:f.id)||null,item:{id:r.id,quantity:a,variant:{id:r.variant.id,name:r.variant.name,bundleProducts:null===(v=r.variant.bundleProducts)||void 0===v?void 0:v.map((function(t){return{id:t.id,productId:t.variant.productId||"",variantId:t.variant.id||"",quantity:t.quantity}}))}},acceptedOffers:this.getAcceptedOffers(o),options:this.createCartLineOptions(r),priceListId:s.getPriceListId()||null,salesChannelId:s.getSalesChannelId(),storefrontThemeId:s.getStorefrontThemeId(),metadata:{_fbp:l("_fbp"),_fbc:l("_fbc"),_ga:l("_ga")}},(null===(h=null==c?void 0:c.selectedVariant)||void 0===h?void 0:h.subscriptionPlan)&&(null===(I=null==c?void 0:c.selectedVariant)||void 0===I?void 0:I.subscriptionPlan.isSelected)?{subscriptionPlanId:null==c?void 0:c.selectedVariant.subscriptionPlan.subscriptionPlanId,subscriptionPlanPeriodId:null===(g=null==c?void 0:c.selectedVariant.subscriptionPlan.periods.find((function(t){return t.isSelected})))||void 0===g?void 0:g.id}:{})})];case 2:return(t=e.sent()).isSuccess&&t.data?[4,this.setCart(t.data)]:[3,4];case 3:e.sent(),e.label=4;case 4:return this.cart&&(u="".concat(this.cart.id,"-").concat(this.cart.updatedAt),(p=r.quantity)>a?d.removeFromCart(r,p-a,this.cart):d.addToCart(r,a-p,u,this.cart,c)),this.removeCardIfEmpty(),[2,{success:t.isSuccess,response:t}];case 5:return m=e.sent(),console.log(m),[2,{success:!1}];case 6:return[2]}}))}))},this.createCart=function(i){return t(m,void 0,void 0,(function(){var t,r=this;return e(this,(function(e){switch(e.label){case 0:return[4,n.createCart({input:{items:i.variantLines.map((function(t){return{variant:{id:t.variantId},quantity:t.quantity}})),couponCode:i.couponCode,salesChannelId:s.getSalesChannelId(),storefrontThemeId:s.getStorefrontThemeId()}})];case 1:return(t=e.sent()).isSuccess&&t.data?[4,this.setCart(t.data)]:[3,3];case 2:e.sent(),e.label=3;case 3:return i.variantLines.forEach((function(t){if(r.cart){var e="".concat(r.cart.id,"-").concat(r.cart.updatedAt),i=r.cart.items.find((function(e){return e.variant.id===t.variantId}));i&&d.addToCart(i,t.quantity,e,r.cart)}})),[2,{success:t.isSuccess,response:t}]}}))}))},this.removeItem=function(i){return t(m,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,this.changeItemQuantity(i,0)];case 1:return[2,t.sent()]}}))}))},this.removeCart=function(){localStorage.removeItem("cartId"),m.cart=void 0},this.waitUntilInitialized=function(){return new Promise((function(t){var e=setInterval((function(){m.isCartLoadFinished&&(clearInterval(e),t(null))}),100)}))},this.getEditLineID=function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("editLineID")||""},this.findExistingItem=function(t,e){var i,r,n,a,o,s;if(!e.productOptionSetId&&!t.bundleSettings)return null===(i=m.cart)||void 0===i?void 0:i.orderLineItems.find((function(e){return e.variant.id===t.id}));if(t.bundleSettings){var d=m.getEditLineID();if(d)if(S=null===(r=m.cart)||void 0===r?void 0:r.orderLineItems.find((function(t){return t.id===d})))return S}var c=(null===(n=m.cart)||void 0===n?void 0:n.orderLineItems.filter((function(e){return e.variant.id===t.id})))||[];if(e.productOptionSetId)for(var u=m.getOptionValues(e),l=c.filter((function(t){var e;return(null===(e=t.options)||void 0===e?void 0:e.length)===u.length}))||[],p=0,f=l;p<f.length;p++){if((S=f[p]).options){for(var v=!0,h=function(t){var i=t.values.map((function(t){return t.value})),r=null===(s=null===(o=null===(a=e.productOptionSet)||void 0===a?void 0:a.options)||void 0===o?void 0:o.find((function(e){return e.id===t.productOptionId})))||void 0===s?void 0:s.values;if(!(v=v&&i.length===(null==r?void 0:r.length)&&i.every((function(t){return null==r?void 0:r.includes(t)}))))return"break"},I=0,g=S.options;I<g.length;I++){if("break"===h(g[I]))break}if(v){if(!t.bundleSettings)return S;if(m.isSameBundleItem(t,S))return S}}}else if(t.bundleSettings)for(var C=0,b=c;C<b.length;C++){var S=b[C];if(m.isSameBundleItem(t,S))return S}},this.isSameBundleItem=function(t,e){var i,r=null===(i=t.bundleSettings)||void 0===i?void 0:i.products,n=e.variant.bundleProducts;return!!r&&((null==r?void 0:r.length)===(null==n?void 0:n.length)&&(null==r?void 0:r.every((function(t){return!!(null==n?void 0:n.find((function(e){var i;return e.id===t.id&&e.quantity===t.quantity&&e.variant.id===(null===(i=t.product)||void 0===i?void 0:i.selectedVariant.id)})))}))))},this.saveCouponCode=function(i){return t(m,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.cart?[4,n.saveCartCouponCode({cartId:this.cart.id,couponCode:i})]:[2,{success:!1,validationError:p.EMPTY_CART}];case 1:return(t=e.sent()).isSuccess&&t.data&&(this.cart=t.data),[2,{success:t.isSuccess,response:t}]}}))}))},this.removeCouponCode=function(){return t(m,void 0,void 0,(function(){return e(this,(function(t){return[2,this.saveCouponCode(null)]}))}))},this.removeGiftCardLine=function(i){return t(m,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.cart?[4,n.removeGiftCardFromCart({cartId:this.cart.id,giftCardId:i})]:[2,{success:!1,validationError:p.EMPTY_CART}];case 1:return(t=e.sent()).isSuccess&&t.data&&(this.cart=t.data),[2,{success:t.isSuccess,response:t}]}}))}))},this.removeLoyaltyPointsFromCart=function(i){return t(m,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.cart?[4,n.removeLoyaltyPointsFromCart({cartId:this.cart.id,loyaltySpendingMethodId:i})]:[2,{success:!1,validationError:p.EMPTY_CART}];case 1:return(t=e.sent()).isSuccess&&t.data&&(this.cart=t.data),[2,{success:t.isSuccess,response:t}]}}))}))},this.saveCart=function(i){return t(m,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return(t=new c(i)).customer&&this.baseStore.customerStore.customer&&(t.customer.notificationsAccepted=this.baseStore.customerStore.customer.subscriptionStatus===o.SUBSCRIBED),[4,n.saveCart({input:t})];case 1:return[2,{success:(r=e.sent()).isSuccess,response:r}]}}))}))},this.removeCardIfEmpty=function(){var t;0===(null===(t=m.cart)||void 0===t?void 0:t.itemCount)&&m.removeCart()},this.getCart=function(){return t(m,void 0,void 0,(function(){var t,i,r,a,o,s;return e(this,(function(e){switch(e.label){case 0:if(!("undefined"!=typeof localStorage))return[2];e.label=1;case 1:return e.trys.push([1,6,7,8]),this._isLoadingCart=!0,t=null===(o=this.baseStore.customerStore.customer)||void 0===o?void 0:o.id,(i=(null===(s=this.cart)||void 0===s?void 0:s.id)||localStorage.getItem("cartId"))||t?[4,n.getCartById({id:i})]:[2];case 2:return(r=e.sent()).isSuccess&&r.data?[4,this.setCart(r.data)]:[3,4];case 3:return e.sent(),[3,5];case 4:this.removeCart(),e.label=5;case 5:return[3,8];case 6:return a=e.sent(),console.log(a),[3,8];case 7:return this._isLoadingCart=!1,this._isCartLoadFinished=!0,[7];case 8:return[2]}}))}))},this.setCart=function(i){return t(m,void 0,void 0,(function(){return e(this,(function(t){return localStorage.setItem("cartId",i.id),this.cart=i,[2]}))}))},this.beforeCartOperationCheck=function(){return t(m,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t=localStorage.getItem("cartId"),!this.cart||t?[3,1]:(this.removeCart(),[3,3]);case 1:return this.cart||!t?[3,3]:[4,this.getCart()];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},this.createCartLineOptions=function(t){if(t&&t.options){for(var e=[],i=0,r=t.options;i<r.length;i++){var n=r[i],a={productOptionId:n.productOptionId,productOptionsSetId:n.productOptionsSetId,values:n.values.map((function(t){return t.value}))};e.push(a)}return e}return null},this.getOptionValues=function(t){var e,i=[];return null===(e=t.productOptionSet)||void 0===e||e.options.forEach((function(t){var e=t.values;t.type===a.DATE_PICKER&&(e=t.values.map((function(t){var e=new Date(t);return isNaN(e.getTime())?t:e.toISOString().split("T")[0]}))),t.values.length&&i.push({productOptionId:t.id,productOptionsSetId:t.productOptionSetId,values:e})})),i},this._windowAddToCart=function(i){return t(m,void 0,void 0,(function(){var t,r,a,o,c,u,p,m,f,v,h;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,5,,6]),[4,this.beforeCartOperationCheck()];case 1:return e.sent(),t=i.itemId?null===(f=this.cart)||void 0===f?void 0:f.items.find((function(t){return t.id===i.itemId})):null,[4,n.addItemToCart({input:{cartId:(null===(v=this.cart)||void 0===v?void 0:v.id)||null,item:{id:i.itemId||null,quantity:i.quantity,variant:{id:i.variantId}},priceListId:s.getPriceListId()||null,salesChannelId:s.getSalesChannelId(),storefrontThemeId:s.getStorefrontThemeId(),metadata:{_fbp:l("_fbp"),_fbc:l("_fbc"),_ga:l("_ga")}}})];case 2:return(r=e.sent()).isSuccess&&r.data?(i.itemId||(a=(null===(h=this.cart)||void 0===h?void 0:h.items.map((function(t){return t.id})))||[],o=r.data.items.map((function(t){return t.id})),(c=o.find((function(t){return!a.includes(t)})))&&(t=r.data.items.find((function(t){return t.id===c})))),[4,this.setCart(r.data)]):[3,4];case 3:e.sent(),e.label=4;case 4:return this.cart&&t&&(u="".concat(this.cart.id,"-").concat(this.cart.updatedAt),(p=i.quantity)>i.quantity?d.removeFromCart(t,p-i.quantity,this.cart):d.addToCart(t,i.quantity-p,u,this.cart)),this.removeCardIfEmpty(),[2,{success:r.isSuccess,response:r}];case 5:return m=e.sent(),console.log(m),[2,{success:!1}];case 6:return[2]}}))}))},this.baseStore=u,r(this)}return Object.defineProperty(m.prototype,"isLoadingCart",{get:function(){return this._isLoadingCart},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"isCartLoadFinished",{get:function(){return this._isCartLoadFinished},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"checkoutId",{get:function(){var t;return null===(t=this.cart)||void 0===t?void 0:t.id},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"checkoutUrl",{get:function(){if(this.checkoutId)return"/checkout?id=".concat(this.checkoutId,"&step=info")},enumerable:!1,configurable:!0}),m.prototype.getAcceptedOffers=function(t){var e=(null==t?void 0:t.filter((function(t){return t.isSelected&&!t.isAccepted})).map((function(t){return{campaignOfferId:t.campaignOfferId,campaignOfferProductId:t.campaignOfferProductId,productId:t.product.id,quantity:t.quantity,variantId:t.product.selectedVariant.id}})))||[];return e.length?e:void 0},m.prototype.createPayWithIkasSession=function(i,r,n){var a,o,d,c,l,p,m,f;return void 0===r&&(r=1),t(this,void 0,void 0,(function(){var t,v,h,I,g,C,b;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),t=n,n?[3,2]:(v=s.getSalesChannelId(),h=s.getStorefrontThemeId(),v&&h&&i?(I=i.selectedVariant)?[4,this.addItem(I,i,r,{isPayWithIkas:!0})]:[2,{success:!1,error:"No variant selected"}]:[2,{success:!1,error:"Missing storefront configuration"}]);case 1:if(!(g=e.sent()).success||!(null===(o=null===(a=g.response)||void 0===a?void 0:a.data)||void 0===o?void 0:o.id))return[2,{success:!1,error:(null===(l=null===(c=null===(d=g.response)||void 0===d?void 0:d.graphQLErrors)||void 0===c?void 0:c[0])||void 0===l?void 0:l.message)||"Failed to create cart"}];t=g.response.data.id,e.label=2;case 2:return t?[4,u({cartId:t})]:[2,{success:!1,error:"Failed to create cart"}];case 3:return!(C=e.sent()).data||(null===(p=C.graphQLErrors)||void 0===p?void 0:p.length)?[2,{success:!1,error:(null===(f=null===(m=C.graphQLErrors)||void 0===m?void 0:m[0])||void 0===f?void 0:f.message)||"Failed to create Pay with ikas session"}]:[2,{success:!0,payUrl:C.data.payUrl,expiresAt:C.data.expiresAt}];case 4:return[2,{success:!1,error:(b=e.sent())instanceof Error?b.message:"Unknown error occurred"}];case 5:return[2]}}))}))},m}();!function(t){t.INSUFFICIENT_STOCK="INSUFFICIENT_STOCK",t.INVALID_PRODUCT_OPTION_VALUES="INVALID_PRODUCT_OPTION_VALUES",t.EMPTY_CART="EMPTY_CART"}(p||(p={}));export{m as CART_LS_KEY,p as IkasCartOperationValidationError,f as IkasCartStore};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.60",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ikas/loyalty-widget-renderer": "1.0.0-alpha.
|
|
20
|
+
"@ikas/loyalty-widget-renderer": "1.0.0-alpha.79",
|
|
21
21
|
"@ikas/popup-renderer": "1.0.227",
|
|
22
22
|
"@ikas/popup-script-injector": "1.0.0-alpha.21",
|
|
23
23
|
"swiper": "11.0.6"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@ikas/storefront-api": "^5.0.
|
|
27
|
-
"@ikas/storefront-config": "^5.0.
|
|
28
|
-
"@ikas/storefront-model-functions": "^5.0.
|
|
29
|
-
"@ikas/storefront-models": "^5.0.
|
|
30
|
-
"@ikas/storefront-providers": "^5.0.
|
|
26
|
+
"@ikas/storefront-api": "^5.0.60",
|
|
27
|
+
"@ikas/storefront-config": "^5.0.60",
|
|
28
|
+
"@ikas/storefront-model-functions": "^5.0.60",
|
|
29
|
+
"@ikas/storefront-models": "^5.0.60",
|
|
30
|
+
"@ikas/storefront-providers": "^5.0.60",
|
|
31
31
|
"@ikas/localized-address": "1.0.0-beta.6",
|
|
32
32
|
"@adyen/adyen-web": "^5.57.0",
|
|
33
33
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@ikas/localized-address": "1.0.0-beta.6",
|
|
65
|
-
"@ikas/storefront-api": "^5.0.
|
|
66
|
-
"@ikas/storefront-config": "^5.0.
|
|
67
|
-
"@ikas/storefront-model-functions": "^5.0.
|
|
68
|
-
"@ikas/storefront-models": "^5.0.
|
|
69
|
-
"@ikas/storefront-providers": "^5.0.
|
|
65
|
+
"@ikas/storefront-api": "^5.0.60",
|
|
66
|
+
"@ikas/storefront-config": "^5.0.60",
|
|
67
|
+
"@ikas/storefront-model-functions": "^5.0.60",
|
|
68
|
+
"@ikas/storefront-models": "^5.0.60",
|
|
69
|
+
"@ikas/storefront-providers": "^5.0.60",
|
|
70
70
|
"mobx": "^6.1.3",
|
|
71
71
|
"mobx-react-lite": "^3.1.5",
|
|
72
72
|
"next": "12.2.0",
|