@ikas/storefront 6.1.0-beta.270 → 6.1.0-beta.271
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/cart-summary/index.d.ts +6 -0
- package/build/components/checkout/components/cart-summary/index.js +1 -1
- package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
- package/build/components/checkout/components/step-container/index.d.ts +3 -1
- package/build/components/checkout/components/step-container/index.js +1 -1
- package/build/components/checkout/components/svg/arrow-loyalty.d.ts +6 -0
- package/build/components/checkout/components/svg/arrow-loyalty.js +1 -0
- package/build/components/checkout/components/svg/arrow-right-loyalty.d.ts +6 -0
- package/build/components/checkout/components/svg/arrow-right-loyalty.js +1 -0
- package/build/components/checkout/components/svg/gift-loyalty.d.ts +6 -0
- package/build/components/checkout/components/svg/gift-loyalty.js +1 -0
- package/build/components/checkout/components/svg/left-arrow-loyalty.d.ts +6 -0
- package/build/components/checkout/components/svg/left-arrow-loyalty.js +1 -0
- package/build/components/checkout/components/svg/package-loyalty.d.ts +6 -0
- package/build/components/checkout/components/svg/package-loyalty.js +1 -0
- package/build/components/checkout/components/svg/percentage-loyalty.d.ts +6 -0
- package/build/components/checkout/components/svg/percentage-loyalty.js +1 -0
- package/build/components/checkout/components/svg/star-loyalty.d.ts +6 -0
- package/build/components/checkout/components/svg/star-loyalty.js +1 -0
- package/build/components/checkout/index.d.ts +1 -0
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +10 -1
- package/build/components/checkout/model.js +1 -1
- package/build/models/data/theme-json/index.js +1 -1
- package/package.json +11 -11
|
@@ -24,4 +24,10 @@ declare type CouponProps = {
|
|
|
24
24
|
showOnlyMobile?: boolean;
|
|
25
25
|
} & CommonProps;
|
|
26
26
|
export declare const Coupon: React.FC<CouponProps>;
|
|
27
|
+
declare type LoyaltyPointsLineProps = {
|
|
28
|
+
vm: CheckoutViewModel;
|
|
29
|
+
isVisibleLoyaltyPoints: boolean;
|
|
30
|
+
setIsVisibleLoyaltyPoints: (value: boolean) => void;
|
|
31
|
+
} & CommonProps;
|
|
32
|
+
export declare const LoyaltyPointsLine: React.FC<LoyaltyPointsLineProps>;
|
|
27
33
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as n from"react";import{observer as o}from"mobx-react-lite";import a from"lodash/sortBy";import c from"../input-with-button/index.js";import r from"../notification-box/index.js";import{CheckoutStep as l}from"../../model.js";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{formatCurrency as u}from"../../../../utils/currency.js";import{useTranslation as s}from"../../../../utils/i18n.js";import{CartItem as m}from"./cart-item/index.js";import{FormItem as d}from"../form-item/index.js";import{FormItemType as p}from"../form-item/model.js";import C from"../tooltip/index.js";import E from"../svg/arrow-down.js";import h from"../svg/cross.js";import v from"../svg/gift.js";import f from"../../styles/common.module.scss.js";import g from"./style.module.scss.js";import y from"../svg/ikas.js";import{Button as k}from"../button/index.js";import{IkasCampaignCreatedFor as N,IkasGiftCardType as S}from"@ikas/storefront-models";import T from"../../../../hooks/useDimension.js";import b from"../svg/coupon-code-tag.js";import O from"../svg/gift-cart-tag.js";import P from"../svg/store-credit-tag.js";var I;!function(e){e.COUPON_CODE_NOT_EXIST="COUPON_CODE_NOT_EXIST",e.COUPON_CODE_NOT_EXIST_FOR_GUESS="COUPON_CODE_NOT_EXIST_FOR_GUESS",e.COUPON_APPLIED_WITHOUT_DISCOUNT="COUPON_APPLIED_WITHOUT_DISCOUNT"}(I||(I={}));var x=o((function(e){var t,o,a,c,d,p,C=e.vm,h=e.allowExpand,v=e.isSuccessPageSummary,f=C.checkout,k=s().t,N=n.useState(!h),S=N[0],b=N[1],O=n.useState(!1),P=O[0],x=O[1],w=n.useState(null),D=w[0],U=w[1],M=n.useState(0),B=M[0],F=M[1],G=n.useState(null),V=G[0],W=G[1],X=n.useState(!1),H=X[0],q=X[1],z=n.useState(!1),Y=z[0],$=z[1],K=n.useState(!1),Q=K[0],J=K[1];T().isMobile,n.useEffect((function(){h&&(S?V&&F(V.getBoundingClientRect().height):F(0))}),[S,V,h,H,Y,P,Q]);var Z=n.useMemo((function(){switch(D){case I.COUPON_CODE_NOT_EXIST:return k("checkout-page:giftCodeErrorDescription");case I.COUPON_CODE_NOT_EXIST_FOR_GUESS:return k("checkout-page:mustBeSignInToApplyCampaign");case I.COUPON_APPLIED_WITHOUT_DISCOUNT:return k("checkout-page:couponInvalidForCartItems");default:return""}}),[D]),ee=[g.CartSummary,h?g.HideOnDesktop:"",v?g.SuccessPageCartSummary:""].join(" "),te=h?{height:B+"px"}:void 0,ne=[g.ArrowDown,S?g.Rotated:""].join(" ");return f?n.createElement(n.Fragment,null,!!h&&n.createElement(n.Fragment,null,n.createElement("div",{id:"checkout-mobile-summary-header"}),n.createElement("div",{className:g.ExpandHeader,onClick:function(){if(!S){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}b(!S)}},n.createElement("div",{className:g.Left},k("checkout-page:summary")),n.createElement("div",{className:g.Price},n.createElement("span",{className:g.PriceText},"".concat(u(C.finalPrice||0,f.currencyCode,f.currencySymbol)," (").concat(f.itemQuantity," ").concat(k("checkout-page:cartItemProduct"),")")),n.createElement("span",{className:ne},n.createElement(E,null))))),n.createElement("div",{className:ee},n.createElement("div",{className:[g.DetailsContainer,v?g.SuccessPageDetailContainer:""].join(" "),style:te},n.createElement("div",{className:g.Details,ref:W},n.createElement("div",{className:g.ItemsContainer},n.createElement("div",null,f.items.map((function(e,t){return n.createElement(m,{key:t,vm:C,cartItem:e,currencyCode:f.currencyCode,onChange:J,isSuccessPageSummary:v})})))),n.createElement("div",{className:g.Divider}),n.createElement("div",{className:g.SubTotalInfo},P&&n.createElement("div",{className:g.NotificationContainer},n.createElement(r,{type:"warning",title:k("checkout-page:giftCodeErrorTitle"),content:Z,onClose:function(){x(!1),U(null)}})),n.createElement(j,{label:k("checkout-page:subtotal"),value:f.formattedTotalPrice,tooltipText:k("checkout-page:subtotalTooltip")}),!!(null===(t=f.shippingLines)||void 0===t?void 0:t.length)&&(C.step===l.SUCCESS?n.createElement(j,{label:k("checkout-page:cartShippingTitle"),value:f.shippingTotal?f.formattedShippingTotal:k("checkout-page:free")}):f.shippingLines.map((function(e,t){return n.createElement(j,{key:t,label:e.paymentMethod?e.title:k("checkout-page:cartShippingTitle"),value:e.finalPrice?u(e.finalPrice,f.currencyCode,f.currencySymbol):k("checkout-page:free")})}))),n.createElement(L,{vm:C}),n.createElement(_,{vm:C}),(C.step===l.SUCCESS&&(!!C.checkout.note||!!C.checkout.appliedCouponCode)||C.step!==l.SUCCESS)&&C.isCouponCodeVisible&&n.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),n.createElement(A,{vm:C,isAddingCoupon:Y,setAddingCoupon:$,setCouponError:x,setCouponErrorCode:U}),n.createElement(R,{vm:C,isAddingNote:H,setAddingNote:q}),!!C.installmentExtraPrice&&C.installmentExtraPrice>0&&n.createElement(n.Fragment,null,n.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),n.createElement(j,{label:k("checkout-page:cartInterest"),value:u(C.installmentExtraPrice,f.currencyCode,f.currencySymbol)}))),C.isOpenEditOrderWithTransaction&&n.createElement("div",{className:g.SubTotalInfo,style:{}},!!(null===(o=C.openEditOrderTransaction)||void 0===o?void 0:o.chargedAmount)&&n.createElement(j,{label:k("checkout-page:chargedAmount"),value:u((null===(a=C.openEditOrderTransaction)||void 0===a?void 0:a.chargedAmount)||0,f.currencyCode,f.currencySymbol)}),!!(null===(c=C.openEditOrderTransaction)||void 0===c?void 0:c.refundedAmount)&&n.createElement(j,{label:k("checkout-page:refundedAmount"),value:u((null===(d=C.openEditOrderTransaction)||void 0===d?void 0:d.refundedAmount)||0,f.currencyCode,f.currencySymbol)})),n.createElement("div",{className:[g.TotalContainer,v?g.SuccessPageTotalContainer:""].join(" ")},n.createElement("div",{className:g.TitleContainer},n.createElement("div",{className:g.Title},C.isOpenEditOrderWithTransaction?k("checkout-page:totalAmountPayable"):k("checkout-page:total"))),n.createElement("div",null,n.createElement("div",{className:g.TotalPricesContainer},n.createElement("div",{className:g.TotalPrice},u(C.finalPrice||0,f.currencyCode,f.currencySymbol)),!!f.$totalTax&&!!(null===(p=C.customizationProps)||void 0===p?void 0:p.showTax)&&n.createElement("div",{className:[g.TotalTax].join(" ")},k("checkout-page:cartTaxTitle")+" "+f.$formattedTotalTax)))),!v&&!C.isPoweredByHidden&&n.createElement("div",{className:g.PoweredBy},n.createElement("span",null,"powered by"),n.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},n.createElement(y,null))))))):null})),j=o((function(e){var t=e.label,o=e.value,a=e.tooltipText,c=e.hideMarginBottom;return n.createElement("div",{className:[g.InfoRow,c?g.hideMb:""].join(" ")},n.createElement("div",{className:g.Label},n.createElement("span",null,t),!!a&&n.createElement(C,{text:a,style:{marginLeft:"8px"}})),n.createElement("div",{className:g.Value},o))})),L=o((function(e){var t=e.vm,o=s().t;return t.checkout?n.createElement(n.Fragment,null,a(t.checkout.nonCouponAdjustments||[],"order").filter((function(e){return e.createdFor!==N.LOYALTY_SPEND})).map((function(e,a){return n.createElement("div",{className:g.InfoRow,key:a},n.createElement("div",{className:g.Label},"INTEREST"===e.name?o("checkout-page:cartInterest"):e.name),n.createElement("div",{className:g.Value},n.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",n.createElement("span",null,u(e.amount,t.checkout.currencyCode,t.checkout.currencySymbol))))}))):null})),_=o((function(e){var t,o=e.vm,a=s().t;return o.checkout?n.createElement(n.Fragment,null,null===(t=o.checkout.giftPackageLines)||void 0===t?void 0:t.map((function(e,t){return n.createElement("div",{className:g.InfoRow,key:t},n.createElement("div",{className:g.Label},n.createElement("div",{className:g.GiftLabel},n.createElement(v,{style:{position:"relative",top:"-1px"}}),n.createElement("span",null,a("checkout-page:giftPackage")))),n.createElement("div",{className:g.Value},n.createElement("span",null,u(e.price,o.checkout.currencyCode,o.checkout.currencySymbol))))}))):null})),A=o((function(o){var a=o.vm,r=o.isAddingCoupon,i=o.setAddingCoupon,u=o.setCouponError,m=o.setCouponErrorCode,C=o.isOpenCouponCode,E=o.isMobile,h=o.showOnlyMobile,v=s().t,y=n.useState(""),N=y[0],S=y[1],T=n.useState(!1),b=T[0],O=T[1],P=n.useRef(null);n.useEffect((function(){r&&P.current&&P.current.focus()}),[r]);var I=function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return a.checkout.couponCode=N,O(!0),[4,a.onCouponCodeApply(!0)];case 1:return t.sent(),O(!1),S(""),e=a.checkout.giftCardLines&&!!a.checkout.giftCardLines.length,a.couponError?[3,4]:a.checkout.appliedCouponCode||e?(u(!1),m(null),[4,a.reInitPaymentMethod()]):[3,3];case 2:t.sent(),t.label=3;case 3:return[3,5];case 4:a.checkout.couponCode=null,u(!0),m(a.couponError),t.label=5;case 5:return[2]}}))}))},x=function(n){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return O(!0),[4,a.removeGiftCardLine(n)];case 1:return e.sent(),[4,a.reInitPaymentMethod()];case 2:return e.sent(),O(!1),[2]}}))}))},j=function(n){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return O(!0),[4,a.removeLoyaltyPointsFromCart(n)];case 1:return e.sent(),[4,a.reInitPaymentMethod()];case 2:return e.sent(),O(!1),[2]}}))}))};a.step,l.SUCCESS;var L=a.step===l.SHIPPING,_=!!a.checkout.appliedCouponCode||!!(a.checkout.giftCardLines&&a.checkout.giftCardLines.length>0)||!!(a.checkout.loyaltyLines&&a.checkout.loyaltyLines.length>0),A=!!a.checkout.appliedCouponCode&&C,R=!r&&a.isCouponCodeVisible&&!a.isCouponCodeRequirementOpen&&a.step!==l.SUCCESS,U=_&&(!C||E);return n.createElement(n.Fragment,null,!!C&&n.createElement(n.Fragment,null,n.createElement("div",{className:[g.CartSummary,g.OpenCouponCodeSummary].join(" ")},n.createElement("div",{className:f.FormSectionTitle},n.createElement("div",{style:{paddingBottom:A?0:6},className:f.Title},v("checkout-page:couponCode"))))),_&&!L&&!a.isCouponCodeRequirementDefult&&n.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),n.createElement("div",{className:R?g.InfoRow:""},R&&n.createElement("div",{className:g.ActionTextBtn,onClick:function(){return i(!0)}},v("checkout-page:addCouponCode")),r&&!C&&n.createElement("div",{style:{marginBottom:"10px"}},n.createElement(c,{value:N,placeholder:v("checkout-page:couponCode"),buttonLabel:v("checkout-page:actions.apply"),inputRef:P,onClick:I,isLoading:b,onChange:S})),C&&n.createElement("div",{tabIndex:0,onKeyDown:function(e){"Enter"===e.key&&I()},className:[g.OpenCouponCodeMain,U?g.OpenCouponCodeMainWithMb:""].join(" ")},n.createElement(d,{name:"couponCode",label:v("checkout-page:addCouponCode"),type:p.TEXT,value:N,onChange:S}),n.createElement(k,{style:{width:"33%"},text:v("checkout-page:actions.apply"),isLoading:b,onClick:I}))),U&&n.createElement(n.Fragment,null,!!a.checkout.appliedCouponCode&&n.createElement("div",{className:[g.InfoRow,h?g.InfoRowGiftCardMobile:""].join(" ")},n.createElement(w,{vm:a,onClearCouponCode:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=null,O(!0),[4,a.onCouponCodeApply(!1)];case 1:return e.sent(),[4,a.reInitPaymentMethod()];case 2:return e.sent(),O(!1),[2]}}))}))},couponCode:a.checkout.appliedCouponCode})),!!a.checkout.giftCardLines&&!!a.checkout.giftCardLines.length&&a.checkout.giftCardLines.map((function(e){return n.createElement("div",{className:[g.InfoRow,h?g.InfoRowGiftCardMobile:""].join(" ")},n.createElement(w,{vm:a,onClearGiftCode:x,couponCode:e.code,giftCardLine:e}))})),!!a.checkout.loyaltyLines&&!!a.checkout.loyaltyLines.length&&a.checkout.loyaltyLines.map((function(e){return n.createElement("div",{className:[g.InfoRow,h?g.InfoRowGiftCardMobile:""].join(" ")},n.createElement(D,{vm:a,onClearLoyaltyPoints:j,loyaltyPointsLine:e}))}))))})),w=o((function(e){var t=e.vm,o=e.onClearCouponCode,a=e.couponCode,c=e.giftCardLine,r=e.onClearGiftCode,i=t.checkout.couponAdjustment,m=s().t,d=!c,p=(null==c?void 0:c.type)===S.STORE_CREDIT;return n.createElement(n.Fragment,null,n.createElement("div",{className:[g.ActionTextBtn,g.NoUnderline].join(" ")},c&&p&&n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"5px"}},n.createElement("span",{style:{height:"20px"}},n.createElement(P,null)),n.createElement("span",{className:g.StoreCreditTag},m("checkout-page:storeCredit"))),!p&&n.createElement("span",{className:[g.AppliedCoupon,t.isCouponCodeRequirementDefult?"":g.NotClosed].join(" ")},d?n.createElement("span",{style:{height:"16px"}},n.createElement(b,null)):!p&&n.createElement("span",{style:{height:"16px"}},n.createElement(O,null)),n.createElement("span",{className:g.CouponCode},a),t.step!==l.SUCCESS&&!t.isOpenEditOrderWithTransaction&&n.createElement("span",{className:g.ClearCoupon,onClick:function(){return c?r&&r(c.giftCardId):o&&o()}},n.createElement(h,null)))),n.createElement("div",null,c?n.createElement("div",{className:g.Value},n.createElement("span",null,"-")," ",n.createElement("span",null,u((null==c?void 0:c.amount)||0,t.checkout.currencyCode,t.checkout.currencySymbol))):n.createElement("div",{className:g.Value},n.createElement("span",null,"DECREMENT"===(null==i?void 0:i.type)?"- ":"")," ",n.createElement("span",null,u((null==i?void 0:i.amount)||0,t.checkout.currencyCode,t.checkout.currencySymbol)))))})),D=o((function(e){var t,o=e.vm,a=e.onClearLoyaltyPoints,c=e.loyaltyPointsLine,r=null===(t=o.checkout.nonCouponAdjustments)||void 0===t?void 0:t.find((function(e){return e.campaignId===c.id})),i=s().t;return n.createElement(n.Fragment,null,n.createElement("div",{className:[g.ActionTextBtn,g.NoUnderline].join(" ")},n.createElement("span",{className:[g.AppliedCoupon,o.isCouponCodeRequirementDefult?"":g.NotClosed].join(" ")},n.createElement("span",{style:{height:"16px"}},n.createElement(b,null)),n.createElement("span",{className:g.CouponCode},c.amount," ",i("checkout-page:loyaltyPoints")),o.step!==l.SUCCESS&&!o.isOpenEditOrderWithTransaction&&n.createElement("span",{className:g.ClearCoupon,onClick:function(){return a&&a(c.loyaltySpendingMethodId)}},n.createElement(h,null)))),n.createElement("div",null,n.createElement("div",{className:g.Value},n.createElement("span",null,"-")," ",n.createElement("span",null,u((null==r?void 0:r.amount)||0,o.checkout.currencyCode,o.checkout.currencySymbol)))))})),R=o((function(e){var t=e.vm,o=e.isAddingNote,a=e.setAddingNote,c=s().t,r=n.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=n.useCallback((function(){a(!0)}),[]),u=n.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===l.SUCCESS;return m&&!t.checkout.note?null:n.createElement("div",{className:g.InfoRow},!o&&!m&&n.createElement("div",{className:g.ActionTextBtn,onClick:i},r),(o||m)&&n.createElement("div",{className:[g.CheckoutNoteContainer,m?g.Success:""].join(" ")},n.createElement("div",{className:g.Title},c("checkout-page:orderNote")),m?n.createElement("div",{className:g.CheckoutNoteDisplay},t.checkout.note):n.createElement(d,{style:{width:"100%"},type:p.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:u,maxLength:320})))}));export{x as CartSummary,A as Coupon,I as CouponErrorCode};
|
|
1
|
+
import{__awaiter as e,__generator as t,__assign as n}from'./../../../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as a}from"mobx-react-lite";import i from"lodash/sortBy";import l from"../input-with-button/index.js";import s from"../notification-box/index.js";import{CheckoutStep as r}from"../../model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as d}from"../../../../utils/currency.js";import{useTranslation as m}from"../../../../utils/i18n.js";import{CartItem as u}from"./cart-item/index.js";import{FormItem as y}from"../form-item/index.js";import{FormItemType as p}from"../form-item/model.js";import v from"../tooltip/index.js";import E from"../svg/arrow-down.js";import g from"../svg/cross.js";import h from"../svg/gift.js";import f from"../../styles/common.module.scss.js";import C from"./style.module.scss.js";import L from"../svg/ikas.js";import{Button as P}from"../button/index.js";import{IkasCampaignCreatedFor as k,IkasGiftCardType as N}from"@ikas/storefront-models";import I from"../../../../hooks/useDimension.js";import S from"../svg/coupon-code-tag.js";import M from"../svg/gift-cart-tag.js";import x from"../svg/store-credit-tag.js";import T from"../svg/gift-loyalty.js";import j from"../svg/package-loyalty.js";import b from"../svg/percentage-loyalty.js";import O from"../svg/arrow-loyalty.js";import A from"../svg/star-loyalty.js";import{LoyaltyProgramMethodSpendingTypeEnum as w,searchProducts as D,useLoyaltyPoints as _}from"@ikas/storefront-api";import V from"../svg/left-arrow-loyalty.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"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{IkasCheckout as R}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{IkasImage as F}from"../../../../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 U from"../svg/arrow-right-loyalty.js";var H;!function(e){e.COUPON_CODE_NOT_EXIST="COUPON_CODE_NOT_EXIST",e.COUPON_CODE_NOT_EXIST_FOR_GUESS="COUPON_CODE_NOT_EXIST_FOR_GUESS",e.COUPON_APPLIED_WITHOUT_DISCOUNT="COUPON_APPLIED_WITHOUT_DISCOUNT"}(H||(H={}));var B=a((function(e){var t,n,a,i,l,y,p,v,g,h=e.vm,f=e.allowExpand,P=e.isSuccessPageSummary,k=h.checkout,N=m().t,S=o.useState(!f),M=S[0],x=S[1],T=o.useState(!1),j=T[0],b=T[1],O=o.useState(null),A=O[0],w=O[1],D=o.useState(0),_=D[0],V=D[1],R=o.useState(null),F=R[0],U=R[1],B=o.useState(!1),q=B[0],Y=B[1],J=o.useState(!1),Z=J[0],ee=J[1],te=o.useState(!1),ne=te[0],oe=te[1],ae=I().isMobile;o.useEffect((function(){f&&(M?F&&V(F.getBoundingClientRect().height):V(0))}),[M,F,f,q,Z,j,ne]);var ie=o.useMemo((function(){switch(A){case H.COUPON_CODE_NOT_EXIST:return N("checkout-page:giftCodeErrorDescription");case H.COUPON_CODE_NOT_EXIST_FOR_GUESS:return N("checkout-page:mustBeSignInToApplyCampaign");case H.COUPON_APPLIED_WITHOUT_DISCOUNT:return N("checkout-page:couponInvalidForCartItems");default:return""}}),[A]),le=[C.CartSummary,f?C.HideOnDesktop:"",P?C.SuccessPageCartSummary:""].join(" "),se=f?{height:_+"px"}:void 0,re=[C.ArrowDown,M?C.Rotated:""].join(" ");return k?o.createElement(o.Fragment,null,!!f&&o.createElement(o.Fragment,null,o.createElement("div",{id:"checkout-mobile-summary-header"}),o.createElement("div",{className:C.ExpandHeader,onClick:function(){if(!M){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}x(!M)}},o.createElement("div",{className:C.Left},N("checkout-page:summary")),o.createElement("div",{className:C.Price},o.createElement("span",{className:C.PriceText},"".concat(d(h.finalPrice||0,k.currencyCode,k.currencySymbol)," (").concat(k.itemQuantity," ").concat(N("checkout-page:cartItemProduct"),")")),o.createElement("span",{className:re},o.createElement(E,null))))),o.createElement("div",{className:le},o.createElement("div",{className:[C.DetailsContainer,P?C.SuccessPageDetailContainer:""].join(" "),style:se},o.createElement("div",{className:C.Details,ref:U},o.createElement("div",{className:C.ItemsContainer},o.createElement("div",null,k.items.map((function(e,t){return o.createElement(u,{key:t,vm:h,cartItem:e,currencyCode:k.currencyCode,onChange:oe,isSuccessPageSummary:P})})))),o.createElement("div",{className:C.Divider}),o.createElement("div",{className:C.SubTotalInfo},j&&o.createElement("div",{className:C.NotificationContainer},o.createElement(s,{type:"warning",title:N("checkout-page:giftCodeErrorTitle"),content:ie,onClose:function(){b(!1),w(null)}})),o.createElement(G,{label:N("checkout-page:subtotal"),value:k.formattedTotalPrice,tooltipText:N("checkout-page:subtotalTooltip")}),!!(null===(t=k.shippingLines)||void 0===t?void 0:t.length)&&(h.step===r.SUCCESS?o.createElement(G,{label:N("checkout-page:cartShippingTitle"),value:k.shippingTotal?k.formattedShippingTotal:N("checkout-page:free")}):k.shippingLines.map((function(e,t){return o.createElement(G,{key:t,label:e.paymentMethod?e.title:N("checkout-page:cartShippingTitle"),value:e.finalPrice?d(e.finalPrice,k.currencyCode,k.currencySymbol):N("checkout-page:free")})}))),o.createElement(X,{vm:h}),o.createElement(W,{vm:h}),(h.step===r.SUCCESS&&(!!h.checkout.note||!!h.checkout.appliedCouponCode)||h.step!==r.SUCCESS)&&h.isCouponCodeVisible&&o.createElement("div",{className:C.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),!!(null===(n=h.loyaltySpendingMethods)||void 0===n?void 0:n.length)&&(null===(a=h.loyaltySpendingMethods)||void 0===a?void 0:a.length)>0&&!ae&&!!(null===(i=h.customizationProps)||void 0===i?void 0:i.showLoyaltyPoints)&&o.createElement($,{vm:h,isVisibleLoyaltyPoints:h.isLoyaltyPointsVisible,setIsVisibleLoyaltyPoints:h.setIsLoyaltyPointsVisible}),h.isLoyaltyPointsVisible&&o.createElement(K,{vm:h,isVisibleLoyaltyPoints:h.isLoyaltyPointsVisible,setIsVisibleLoyaltyPoints:h.setIsLoyaltyPointsVisible}),o.createElement(z,{vm:h,isAddingCoupon:Z,setAddingCoupon:ee,setCouponError:b,setCouponErrorCode:w}),o.createElement(Q,{vm:h,isAddingNote:q,setAddingNote:Y}),!!h.installmentExtraPrice&&h.installmentExtraPrice>0&&o.createElement(o.Fragment,null,o.createElement("div",{className:C.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement(G,{label:N("checkout-page:cartInterest"),value:d(h.installmentExtraPrice,k.currencyCode,k.currencySymbol)}))),h.isOpenEditOrderWithTransaction&&o.createElement("div",{className:C.SubTotalInfo,style:{}},!!(null===(l=h.openEditOrderTransaction)||void 0===l?void 0:l.chargedAmount)&&o.createElement(G,{label:N("checkout-page:chargedAmount"),value:d((null===(y=h.openEditOrderTransaction)||void 0===y?void 0:y.chargedAmount)||0,k.currencyCode,k.currencySymbol)}),!!(null===(p=h.openEditOrderTransaction)||void 0===p?void 0:p.refundedAmount)&&o.createElement(G,{label:N("checkout-page:refundedAmount"),value:d((null===(v=h.openEditOrderTransaction)||void 0===v?void 0:v.refundedAmount)||0,k.currencyCode,k.currencySymbol)})),o.createElement("div",{className:[C.TotalContainer,P?C.SuccessPageTotalContainer:""].join(" ")},o.createElement("div",{className:C.TitleContainer},o.createElement("div",{className:C.Title},h.isOpenEditOrderWithTransaction?N("checkout-page:totalAmountPayable"):N("checkout-page:total"))),o.createElement("div",null,o.createElement("div",{className:C.TotalPricesContainer},o.createElement("div",{className:C.TotalPrice},d(h.finalPrice||0,k.currencyCode,k.currencySymbol)),!!k.$totalTax&&!!(null===(g=h.customizationProps)||void 0===g?void 0:g.showTax)&&o.createElement("div",{className:[C.TotalTax].join(" ")},N("checkout-page:cartTaxTitle")+" "+k.$formattedTotalTax)))),!!h.loyaltyEarningMethod&&!!h.loyaltyCustomerInfo&&o.createElement("div",{className:C.LoyaltyEarningMethod},o.createElement("div",{className:C.LoyaltyEarningMethodTitle},N("checkout-page:loyaltyEarningMethodTitle",{value:h.loyaltyEarningMethod.pointsEarned/(h.loyaltyEarningMethod.amountPerPointsEarned||1)*h.finalPrice}))),!P&&!h.isPoweredByHidden&&o.createElement("div",{className:C.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(L,null))))))):null})),G=a((function(e){var t=e.label,n=e.value,a=e.tooltipText,i=e.hideMarginBottom;return o.createElement("div",{className:[C.InfoRow,i?C.hideMb:""].join(" ")},o.createElement("div",{className:C.Label},o.createElement("span",null,t),!!a&&o.createElement(v,{text:a,style:{marginLeft:"8px"}})),o.createElement("div",{className:C.Value},n))})),X=a((function(e){var t=e.vm,n=m().t;return t.checkout?o.createElement(o.Fragment,null,i(t.checkout.nonCouponAdjustments||[],"order").filter((function(e){return e.createdFor!==k.LOYALTY_SPEND})).map((function(e,a){return o.createElement("div",{className:C.InfoRow,key:a},o.createElement("div",{className:C.Label},"INTEREST"===e.name?n("checkout-page:cartInterest"):e.name),o.createElement("div",{className:C.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,d(e.amount,t.checkout.currencyCode,t.checkout.currencySymbol))))}))):null})),W=a((function(e){var t,n=e.vm,a=m().t;return n.checkout?o.createElement(o.Fragment,null,null===(t=n.checkout.giftPackageLines)||void 0===t?void 0:t.map((function(e,t){return o.createElement("div",{className:C.InfoRow,key:t},o.createElement("div",{className:C.Label},o.createElement("div",{className:C.GiftLabel},o.createElement(h,{style:{position:"relative",top:"-1px"}}),o.createElement("span",null,a("checkout-page:giftPackage")))),o.createElement("div",{className:C.Value},o.createElement("span",null,d(e.price,n.checkout.currencyCode,n.checkout.currencySymbol))))}))):null})),z=a((function(n){var a=n.vm,i=n.isAddingCoupon,s=n.setAddingCoupon,c=n.setCouponError,d=n.setCouponErrorCode,u=n.isOpenCouponCode,v=n.isMobile,E=n.showOnlyMobile,g=m().t,h=o.useState(""),L=h[0],k=h[1],N=o.useState(!1),I=N[0],S=N[1],M=o.useRef(null);o.useEffect((function(){i&&M.current&&M.current.focus()}),[i]);var x=function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return a.checkout.couponCode=L,S(!0),[4,a.onCouponCodeApply(!0)];case 1:return t.sent(),S(!1),k(""),e=a.checkout.giftCardLines&&!!a.checkout.giftCardLines.length,a.couponError?[3,4]:a.checkout.appliedCouponCode||e?(c(!1),d(null),[4,a.reInitPaymentMethod()]):[3,3];case 2:t.sent(),t.label=3;case 3:return[3,5];case 4:a.checkout.couponCode=null,c(!0),d(a.couponError),t.label=5;case 5:return[2]}}))}))},T=function(n){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return S(!0),[4,a.removeGiftCardLine(n)];case 1:return e.sent(),[4,a.reInitPaymentMethod()];case 2:return e.sent(),S(!1),[2]}}))}))},j=function(n){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return S(!0),[4,a.removeLoyaltyPointsFromCart(n)];case 1:return e.sent(),[4,a.reInitPaymentMethod()];case 2:return e.sent(),S(!1),[2]}}))}))};a.step,r.SUCCESS;var b=a.step===r.SHIPPING,O=!!a.checkout.appliedCouponCode||!!(a.checkout.giftCardLines&&a.checkout.giftCardLines.length>0)||!!(a.checkout.loyaltyLines&&a.checkout.loyaltyLines.length>0),A=!!a.checkout.appliedCouponCode&&u,w=!i&&a.isCouponCodeVisible&&!a.isCouponCodeRequirementOpen&&a.step!==r.SUCCESS,D=O&&(!u||v);return o.createElement(o.Fragment,null,!!u&&o.createElement(o.Fragment,null,o.createElement("div",{className:[C.CartSummary,C.OpenCouponCodeSummary].join(" ")},o.createElement("div",{className:f.FormSectionTitle},o.createElement("div",{style:{paddingBottom:A?0:6},className:f.Title},g("checkout-page:couponCode"))))),O&&!b&&!a.isCouponCodeRequirementDefult&&o.createElement("div",{className:C.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement("div",{className:w?C.InfoRow:""},w&&o.createElement("div",{className:C.ActionTextBtn,onClick:function(){return s(!0)}},g("checkout-page:addCouponCode")),i&&!u&&o.createElement("div",{style:{marginBottom:"10px"}},o.createElement(l,{value:L,placeholder:g("checkout-page:couponCode"),buttonLabel:g("checkout-page:actions.apply"),inputRef:M,onClick:x,isLoading:I,onChange:k})),u&&o.createElement("div",{tabIndex:0,onKeyDown:function(e){"Enter"===e.key&&x()},className:[C.OpenCouponCodeMain,D?C.OpenCouponCodeMainWithMb:""].join(" ")},o.createElement(y,{name:"couponCode",label:g("checkout-page:addCouponCode"),type:p.TEXT,value:L,onChange:k}),o.createElement(P,{style:{width:"33%"},text:g("checkout-page:actions.apply"),isLoading:I,onClick:x}))),D&&o.createElement(o.Fragment,null,!!a.checkout.appliedCouponCode&&o.createElement("div",{className:[C.InfoRow,E?C.InfoRowGiftCardMobile:""].join(" ")},o.createElement(q,{vm:a,onClearCouponCode:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=null,S(!0),[4,a.onCouponCodeApply(!1)];case 1:return e.sent(),[4,a.reInitPaymentMethod()];case 2:return e.sent(),S(!1),[2]}}))}))},couponCode:a.checkout.appliedCouponCode})),!!a.checkout.giftCardLines&&!!a.checkout.giftCardLines.length&&a.checkout.giftCardLines.map((function(e){return o.createElement("div",{className:[C.InfoRow,E?C.InfoRowGiftCardMobile:""].join(" ")},o.createElement(q,{vm:a,onClearGiftCode:T,couponCode:e.code,giftCardLine:e}))})),!!a.checkout.loyaltyLines&&!!a.checkout.loyaltyLines.length&&a.checkout.loyaltyLines.map((function(e){return o.createElement("div",{className:[C.InfoRow,E?C.InfoRowGiftCardMobile:""].join(" ")},o.createElement(Y,{vm:a,onClearLoyaltyPoints:j,loyaltyPointsLine:e}))}))))})),q=a((function(e){var t=e.vm,n=e.onClearCouponCode,a=e.couponCode,i=e.giftCardLine,l=e.onClearGiftCode,s=t.checkout.couponAdjustment,c=m().t,u=!i,y=(null==i?void 0:i.type)===N.STORE_CREDIT;return o.createElement(o.Fragment,null,o.createElement("div",{className:[C.ActionTextBtn,C.NoUnderline].join(" ")},i&&y&&o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"5px"}},o.createElement("span",{style:{height:"20px"}},o.createElement(x,null)),o.createElement("span",{className:C.StoreCreditTag},c("checkout-page:storeCredit"))),!y&&o.createElement("span",{className:[C.AppliedCoupon,t.isCouponCodeRequirementDefult?"":C.NotClosed].join(" ")},u?o.createElement("span",{style:{height:"16px"}},o.createElement(S,null)):!y&&o.createElement("span",{style:{height:"16px"}},o.createElement(M,null)),o.createElement("span",{className:C.CouponCode},a),t.step!==r.SUCCESS&&!t.isOpenEditOrderWithTransaction&&o.createElement("span",{className:C.ClearCoupon,onClick:function(){return i?l&&l(i.giftCardId):n&&n()}},o.createElement(g,null)))),o.createElement("div",null,i?o.createElement("div",{className:C.Value},o.createElement("span",null,"-")," ",o.createElement("span",null,d((null==i?void 0:i.amount)||0,t.checkout.currencyCode,t.checkout.currencySymbol))):o.createElement("div",{className:C.Value},o.createElement("span",null,"DECREMENT"===(null==s?void 0:s.type)?"- ":"")," ",o.createElement("span",null,d((null==s?void 0:s.amount)||0,t.checkout.currencyCode,t.checkout.currencySymbol)))))})),Y=a((function(e){var t,n,a=e.vm,i=e.onClearLoyaltyPoints,l=e.loyaltyPointsLine,s=null===(t=a.checkout.nonCouponAdjustments)||void 0===t?void 0:t.find((function(e){return e.campaignId===l.id})),c=m().t,u=null===(n=a.loyaltySpendingMethodsAll)||void 0===n?void 0:n.find((function(e){return e.id===l.loyaltySpendingMethodId})),y=function(){return u?u.type===w.FREE_PRODUCT?{icon:o.createElement(T,null),title:c("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProductAdded")}:u.type===w.FREE_SHIPPING?{icon:o.createElement(j,null),title:c("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeShipping")}:{icon:o.createElement(b,null),title:c("checkout-page:loyaltyPointsLinesModalContentItemTitleFixedAmount",{value:d((null==s?void 0:s.amount)||0,a.checkout.currencyCode,a.checkout.currencySymbol)})}:{icon:o.createElement(b,null),title:c("checkout-page:loyaltyPoints")}};return o.createElement(o.Fragment,null,o.createElement("div",{className:C.LoyaltyPointsLineContainer},o.createElement("div",{className:[C.ActionTextBtn,C.NoUnderline].join(" ")},o.createElement("span",{className:[C.AppliedCouponLoyalty,a.isCouponCodeRequirementDefult?"":C.NotClosed].join(" ")},o.createElement("div",{style:{width:"16px",height:"16px"},className:C.LoyaltyPointsLineIcon},y().icon),o.createElement("span",{className:C.CouponCode},y().title),a.step!==r.SUCCESS&&!a.isOpenEditOrderWithTransaction&&o.createElement("span",{className:C.ClearCouponLoyalty,onClick:function(){return i&&i(l.loyaltySpendingMethodId)}},o.createElement(g,null)))),o.createElement("span",{className:C.LoyaltyPointSpending},"(",c("checkout-page:loyaltyPointSpending",{point:l.amount}),")")),u?u.type!==w.FREE_PRODUCT&&u.type!==w.FREE_SHIPPING?o.createElement("div",null,o.createElement("div",{className:C.ValueLoyalty},o.createElement("span",null,"-")," ",o.createElement("span",null,d((null==s?void 0:s.amount)||0,a.checkout.currencyCode,a.checkout.currencySymbol)))):null:o.createElement("div",null,o.createElement("div",{className:C.ValueLoyalty},o.createElement("span",null,"-")," ",o.createElement("span",null,d((null==s?void 0:s.amount)||0,a.checkout.currencyCode,a.checkout.currencySymbol)))))})),$=a((function(e){var t,n,a,i,l,s,r,c,u=e.vm;e.isVisibleLoyaltyPoints;var y=e.setIsVisibleLoyaltyPoints,p=null===(t=u.loyaltySpendingMethods)||void 0===t?void 0:t.filter((function(e){return e.type===w.FREE_PRODUCT})),v=null!==(n=null==p?void 0:p.map((function(e){var t;return null===(t=e.discountSettings)||void 0===t?void 0:t.point})).filter((function(e){return"number"==typeof e})))&&void 0!==n?n:[],E=v.length?Math.min.apply(Math,v):null,g=v.length?Math.max.apply(Math,v):null,h=1===(null===(a=u.loyaltySpendingMethods)||void 0===a?void 0:a.length),f=function(e){var t,n,a,i,l="",s=null;return e.type===w.FIXED_AMOUNT&&e.isDynamic&&(l=h?"".concat(L("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmount")," (").concat(L("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmountDescription",{point:(null===(t=e.discountSettings)||void 0===t?void 0:t.point)||0,amount:d((null===(n=e.discountSettings)||void 0===n?void 0:n.discountAmount)||0,u.checkout.currencyCode,u.checkout.currencySymbol)}),")"):L("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmount"),s=o.createElement(b,null)),e.type===w.FREE_SHIPPING&&(l=L("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeShipping"),s=o.createElement(j,null)),e.type!==w.FIXED_AMOUNT||e.isDynamic||(l=h?L("checkout-page:loyaltyPointsLinesModalContentItemTitleFixedAmountOneRow",{value:d((null===(a=e.discountSettings)||void 0===a?void 0:a.discountAmount)||0,u.checkout.currencyCode,u.checkout.currencySymbol)}):L("checkout-page:loyaltyPointsLinesModalContentItemTitleFixedAmount",{value:d((null===(i=e.discountSettings)||void 0===i?void 0:i.discountAmount)||0,u.checkout.currencyCode,u.checkout.currencySymbol)}),s=o.createElement(b,null)),e.type===w.FREE_PRODUCT&&(l=L("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProduct"),s=o.createElement(T,null)),{title:l,icon:s}},L=m().t;return 1===(null===(i=u.loyaltySpendingMethods)||void 0===i?void 0:i.length)?o.createElement("div",{className:C.LoyaltyPointsContainer},o.createElement("div",{className:C.LoyaltyPointsLineOneRow,onClick:function(){return y(!0)}},o.createElement("div",{className:C.LoyaltyPointsLineOneRowTitle},f(null===(l=u.loyaltySpendingMethods)||void 0===l?void 0:l[0]).icon&&f(null===(s=u.loyaltySpendingMethods)||void 0===s?void 0:s[0]).icon,o.createElement("span",{className:C.LoyaltyPointsLineOneRowTitleText},f(null===(r=u.loyaltySpendingMethods)||void 0===r?void 0:r[0]).title)),o.createElement(O,null))):o.createElement("div",{className:C.LoyaltyPointsContainer},o.createElement("div",{className:C.LoyaltyPointsTitle},L("checkout-page:loyaltyPointsTitle")),o.createElement("div",{className:C.LoyaltyPointsLines},null===(c=u.loyaltySpendingMethods)||void 0===c?void 0:c.slice(0,p&&p.length>0?2:3).filter((function(e){return e.type!==w.FREE_PRODUCT})).map((function(e){var t;return o.createElement("div",{key:e.id,className:C.LoyaltyPointsLine,onClick:function(){return y(!0)}},o.createElement("div",{className:C.LoyaltyPointsLineTitle},f(e).icon&&f(e).icon,o.createElement("span",{className:C.LoyaltyPointsLineTitleText},f(e).title)),o.createElement("span",{className:C.LoyaltyPointsLineValue},(null===(t=e.discountSettings)||void 0===t?void 0:t.point)||0," ",L("checkout-page:loyaltyPoint")))})),p&&p.length>0&&o.createElement("div",{className:C.LoyaltyPointsLine,onClick:function(){return y(!0)}},o.createElement("div",{className:C.LoyaltyPointsLineTitle},o.createElement(T,null),o.createElement("span",{className:C.LoyaltyPointsLineTitleText},L("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProduct"))),o.createElement("span",{className:C.LoyaltyPointsLineValue},E&&g?"".concat(E," ~ ").concat(g):""," ",L("checkout-page:loyaltyPoint"))),o.createElement("div",{className:C.LoyaltyPointsLine,onClick:function(){return y(!0)}},o.createElement("div",{className:C.LoyaltyPointsLineAllContainer},o.createElement("span",{className:C.LoyaltyPointsLineAll},L("checkout-page:loyaltyPointsViewAll")),o.createElement(O,null)))))})),K=a((function(a){var i,l,s,r,u,y,p,v,E,h,f,L,k,N=a.vm,I=a.isVisibleLoyaltyPoints,S=a.setIsVisibleLoyaltyPoints,M=o.useState(!1),x=M[0],O=M[1],H=o.useState(!1),B=H[0],G=H[1],X=o.useState(null),W=X[0],z=X[1],q=o.useState(0),Y=q[0],$=q[1];o.useEffect((function(){var e,t;if(W){var n=(null===(e=W.discountSettings)||void 0===e?void 0:e.point)||1,o=null===(t=W.pointUsageLimit)||void 0===t?void 0:t.minPointLimit;$("number"==typeof o&&o>0?o:n)}}),[W]);var K=null===(i=N.loyaltySpendingMethods)||void 0===i?void 0:i.filter((function(e){return e.type===w.FREE_PRODUCT}));o.useEffect((function(){I&&ee((null==K?void 0:K.map((function(e){var t;return(null===(t=e.discountSettings)||void 0===t?void 0:t.freeProductId)||""})))||[])}),[I]);var Q=o.useState([]),J=Q[0],Z=Q[1],ee=function(n){return e(void 0,void 0,void 0,(function(){var e,o,a;return t(this,(function(t){switch(t.label){case 0:return(null==n?void 0:n.length)?[4,D({input:{productIdList:n,page:1,perPage:n.length,priceListId:c.getPriceListId(),salesChannelId:c.getSalesChannelId()}},[])]:[2,[]];case 1:return e=t.sent(),o=(null===(a=e.data)||void 0===a?void 0:a.data)||[],Z(o.map((function(e){var t,n,o,a,i,l;return{id:e.id,name:e.name,mainImageSrc:new F({id:(null===(i=null===(a=null===(o=null===(n=null===(t=e.variants)||void 0===t?void 0:t[0])||void 0===n?void 0:n.images)||void 0===o?void 0:o.find((function(e){return e.isMain})))||void 0===a?void 0:a.image)||void 0===i?void 0:i.id)||null,isVideo:!1}).thumbnailSrc,variants:(null===(l=e.variants)||void 0===l?void 0:l.map((function(e){var t,n,o,a;return{id:e.id,mainImageSrc:new F({id:(null===(o=null===(n=null===(t=e.images)||void 0===t?void 0:t.find((function(e){return e.isMain})))||void 0===n?void 0:n.image)||void 0===o?void 0:o.id)||null,isVideo:!1}).thumbnailSrc,variantText:(null===(a=e.variantValues)||void 0===a?void 0:a.map((function(e){return e.name})).join(" / "))||null}})))||[]}}))),[2]}}))}))},te=null!==(l=null==K?void 0:K.map((function(e){var t;return null===(t=e.discountSettings)||void 0===t?void 0:t.point})).filter((function(e){return"number"==typeof e})))&&void 0!==l?l:[],ne=te.length?Math.min.apply(Math,te):null,oe=te.length?Math.max.apply(Math,te):null,ae=function(e){var t,n="",a=null;return e.type===w.FIXED_AMOUNT&&e.isDynamic&&(n=se("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmount"),a=o.createElement(b,null)),e.type===w.FREE_SHIPPING&&(n=se("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeShipping"),a=o.createElement(j,null)),e.type!==w.FIXED_AMOUNT||e.isDynamic||(n=se("checkout-page:loyaltyPointsLinesModalContentItemTitleFixedAmount",{value:d((null===(t=e.discountSettings)||void 0===t?void 0:t.discountAmount)||0,N.checkout.currencyCode,N.checkout.currencySymbol)}),a=o.createElement(b,null)),e.type===w.FREE_PRODUCT&&(n=se("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProduct"),a=o.createElement(T,null)),{title:n,icon:a}},ie=null===(s=N.loyaltySpendingMethods)||void 0===s?void 0:s.filter((function(e){return e.type!==w.FREE_PRODUCT})),le=function(o,a,i){return e(void 0,void 0,void 0,(function(){var e,l;return t(this,(function(t){switch(t.label){case 0:return[4,_({input:n({cartId:N.checkout.id,loyaltyProgramId:o,loyaltySpendingMethodId:a},i?{amount:i}:{})})];case 1:return(e=t.sent()).isSuccess?(S(!1),l=e.data,N.checkout=new R(n(n({},l),{shippingAddress:N.checkout.shippingAddress,billingAddress:N.checkout.billingAddress,customer:N.checkout.customer,selectedPaymentGateway:N.checkout.selectedPaymentGateway}),N.countrySettings),[4,N.getLoyaltyCustomerInfo()]):[3,4];case 2:return t.sent(),[4,N.listSpendingMethodsByCartId()];case 3:t.sent(),t.label=4;case 4:return[2,e]}}))}))},se=m().t;return o.createElement("div",{className:C.LoyaltyPointsLinesModalContainer},o.createElement("div",{className:C.LoyaltyPointsLinesModal},o.createElement("span",{onClick:function(){return S(!1)},className:C.LoyaltyPointsLinesModalCloseButton},o.createElement(g,null)),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeader},o.createElement("div",{className:C.LoyaltyPointsLinesModalHeaderTitle},se("checkout-page:loyaltyPointsLinesModalTitle")),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeaderDescription},se("checkout-page:loyaltyPointsLinesModalDescription"))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContent,style:B?{maxHeight:"316px"}:{}},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeader},o.createElement("span",null,se("checkout-page:loyaltyPointsLinesModalCurrentPoints")," "),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValue},o.createElement("div",{style:{width:"18px",height:"18px"}},o.createElement(A,null)),o.createElement("span",null,(null===(r=N.loyaltyCustomerInfo)||void 0===r?void 0:r.totalPoint)||0," ",se("checkout-page:loyaltyPoint")))),null==ie?void 0:ie.map((function(n,a){var i,l,s;return o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItems},o.createElement("div",{className:[C.LoyaltyPointsLinesModalContentItem,0===a?C.LoyaltyPointsLinesModalContentItemsFirst:"",a!==((null==ie?void 0:ie.length)||0)-1||K?"":C.LoyaltyPointsLinesModalContentItemsLast].join(" ")},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueIconContainer},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueIcon},ae(n).icon&&ae(n).icon),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMain},o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainTitle},ae(n).title),o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainValue},n.type===w.FIXED_AMOUNT&&n.isDynamic?se("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmountDescription",{point:(null===(i=n.discountSettings)||void 0===i?void 0:i.point)||0,amount:d((null===(l=n.discountSettings)||void 0===l?void 0:l.discountAmount)||0,N.checkout.currencyCode,N.checkout.currencySymbol)}):"".concat((null===(s=n.discountSettings)||void 0===s?void 0:s.point)||0," ").concat(se("checkout-page:loyaltyPoint"))))),o.createElement("div",null,o.createElement("button",{onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return n.type===w.FIXED_AMOUNT&&n.isDynamic?(z(n),G(!0),[3,3]):[3,1];case 1:return[4,le(n.loyaltyProgramId,n.id)];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},className:C.LoyaltyPointsLinesModalContentItemButton},se("checkout-page:loyaltyPointsLineItemButtonApply")))))})),K&&K.length>0&&o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItems},o.createElement("div",{className:[C.LoyaltyPointsLinesModalContentItem,C.LoyaltyPointsLinesModalContentItemsLast].join(" ")},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueIconContainer},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueIcon},o.createElement(T,null)),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMain},o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainTitle},se("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProduct")),o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainValue},ne&&oe?"".concat(ne," ~ ").concat(oe):""," ",se("checkout-page:loyaltyPoint")))),o.createElement("div",null,o.createElement("button",{className:C.LoyaltyPointsLinesModalContentItemButton,onClick:function(){return O(!0)}},se("checkout-page:loyaltyPointsLineItemButtonSelectGift")))))),x&&o.createElement("div",{className:C.LoyaltyPointsGiftModalOverlay},o.createElement("div",{className:C.LoyaltyPointsGiftModal},o.createElement("span",{onClick:function(){return S(!1)},className:C.LoyaltyPointsLinesModalCloseButton},o.createElement(g,null)),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeader},o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",cursor:"pointer"},onClick:function(){return O(!1)},className:C.LoyaltyPointsLinesModalHeaderTitle},o.createElement(V,null),se("checkout-page:loyaltyPointsGiftModalTitle")),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeaderDescription},se("checkout-page:loyaltyPointsGiftModalDescription"))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContent},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeader},o.createElement("span",null,se("checkout-page:loyaltyPointsLinesModalCurrentPoints")," "),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValue},o.createElement("div",{style:{width:"18px",height:"18px"}},o.createElement(A,null)),o.createElement("span",null,(null===(u=N.loyaltyCustomerInfo)||void 0===u?void 0:u.totalPoint)||0," ",se("checkout-page:loyaltyPoint")))),null==J?void 0:J.map((function(n,a){var i,l,s,r,c,d;return o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItems},o.createElement("div",{className:[C.LoyaltyPointsLinesModalContentItemFreeProduct,C.LoyaltyPointsLinesModalContentItem,0===a?C.LoyaltyPointsLinesModalContentItemsFirst:"",a===((null==J?void 0:J.length)||0)-1?C.LoyaltyPointsLinesModalContentItemsLast:""].join(" ")},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueIconContainer},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueIconImage},n.mainImageSrc&&o.createElement("img",{src:n.mainImageSrc,alt:n.name})),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMain},o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainTitle},n.name),o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainValue},(null===(l=null===(i=n.variants)||void 0===i?void 0:i.find((function(e){var t,o;return e.id===(null===(o=null===(t=null==K?void 0:K.find((function(e){var t;return(null===(t=e.discountSettings)||void 0===t?void 0:t.freeProductId)===n.id})))||void 0===t?void 0:t.discountSettings)||void 0===o?void 0:o.freeProductVariantId)})))||void 0===l?void 0:l.variantText)||""),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemPoint},(null===(r=null===(s=null==K?void 0:K.find((function(e){var t;return(null===(t=e.discountSettings)||void 0===t?void 0:t.freeProductId)===n.id})))||void 0===s?void 0:s.discountSettings)||void 0===r?void 0:r.point)||0," ",se("checkout-page:loyaltyPoint")))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemButtonContainerMobile},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemPointMobile},(null===(d=null===(c=null==K?void 0:K.find((function(e){var t;return(null===(t=e.discountSettings)||void 0===t?void 0:t.freeProductId)===n.id})))||void 0===c?void 0:c.discountSettings)||void 0===d?void 0:d.point)||0," ",se("checkout-page:loyaltyPoint")),function(){var a,i,l=null==K?void 0:K.find((function(e){var t;return(null===(t=e.discountSettings)||void 0===t?void 0:t.freeProductId)===n.id})),s=((null===(a=null==l?void 0:l.discountSettings)||void 0===a?void 0:a.point)||0)>((null===(i=N.loyaltyCustomerInfo)||void 0===i?void 0:i.totalPoint)||0);return o.createElement("button",{type:"button",disabled:s,onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return s||!l?[2]:[4,le(l.loyaltyProgramId,l.id)];case 1:return e.sent(),[2]}}))}))},className:C.LoyaltyPointsLinesModalContentItemButton},se("checkout-page:loyaltyPointsLineItemButtonAddFree"))}())))}))))),B&&W&&o.createElement("div",{className:C.LoyaltyPointsGiftModalOverlay},o.createElement("div",{className:C.LoyaltyPointsGiftModal},o.createElement("span",{onClick:function(){return S(!1)},className:C.LoyaltyPointsLinesModalCloseButton},o.createElement(g,null)),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeader},o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",cursor:"pointer"},onClick:function(){return G(!1)},className:C.LoyaltyPointsLinesModalHeaderTitle},o.createElement(V,null),se("checkout-page:loyaltyPointsLinesModalContentItemTitleFixedAmount",{value:d((null===(y=null==W?void 0:W.discountSettings)||void 0===y?void 0:y.discountAmount)||0,N.checkout.currencyCode,N.checkout.currencySymbol)})),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeaderDescription},se("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmountDescription",{point:(null===(p=W.discountSettings)||void 0===p?void 0:p.point)||0,amount:d((null===(v=null==W?void 0:W.discountSettings)||void 0===v?void 0:v.discountAmount)||0,N.checkout.currencyCode,N.checkout.currencySymbol)}))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContent,style:{maxHeight:"316px",overflow:"hidden"}},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeader},o.createElement("span",null,se("checkout-page:loyaltyPointsLinesModalCurrentPoints")," "),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValue},o.createElement("div",{style:{width:"18px",height:"18px"}},o.createElement(A,null)),o.createElement("span",null,(null===(E=N.loyaltyCustomerInfo)||void 0===E?void 0:E.totalPoint)||0," ",se("checkout-page:loyaltyPoint")))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemSlider},o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfo},o.createElement("span",null,Y," ",se("checkout-page:loyaltyPoint")),o.createElement(U,null),o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfoValue},o.createElement(b,null),o.createElement("span",null,d(Y/((null===(h=null==W?void 0:W.discountSettings)||void 0===h?void 0:h.point)||1)*((null===(f=null==W?void 0:W.discountSettings)||void 0===f?void 0:f.discountAmount)||0),N.checkout.currencyCode,N.checkout.currencySymbol)))),o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfoSlider},function(){var e,t,n,a,i,l,s,r=(null===(e=null==W?void 0:W.discountSettings)||void 0===e?void 0:e.point)||1,c=null!==(n=null===(t=null==W?void 0:W.pointUsageLimit)||void 0===t?void 0:t.minPointLimit)&&void 0!==n?n:r,d=null!==(s=null!==(i=null===(a=null==W?void 0:W.pointUsageLimit)||void 0===a?void 0:a.maxPointLimit)&&void 0!==i?i:null===(l=N.loyaltyCustomerInfo)||void 0===l?void 0:l.totalPoint)&&void 0!==s?s:r,m=Math.max(d-c,0),u=m>0?(Y-c)/m*100:0,y=Math.min(100,Math.max(0,u));return o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfoSlider},o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfoSliderValue}),o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfoSliderValueText,style:{width:"".concat(y,"%")}}),o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfoSliderValueTextValue,style:{left:"".concat(y,"%")}}),o.createElement("input",{type:"range",min:c,max:d,step:r,className:C.LoyaltyPointsLinesModalSliderInput,value:Y,onChange:function(e){return $(Number(e.target.value))}}))}())),o.createElement("div",{style:{display:"flex",width:"100%",marginTop:"24px",marginBottom:"24px"}},o.createElement(P,{onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,le(W.loyaltyProgramId,W.id,Y)];case 1:return e.sent(),[2]}}))}))},style:{width:"100%"},text:se("checkout-page:loyaltyPointsLineItemButtonApplyAmount",{amount:d(Y/((null===(L=null==W?void 0:W.discountSettings)||void 0===L?void 0:L.point)||1)*((null===(k=null==W?void 0:W.discountSettings)||void 0===k?void 0:k.discountAmount)||0),N.checkout.currencyCode,N.checkout.currencySymbol)})})))))))})),Q=a((function(e){var t=e.vm,n=e.isAddingNote,a=e.setAddingNote,i=m().t,l=o.useState(t.checkout.note?i("checkout-page:editOrderNote"):i("checkout-page:addOrderNote"))[0],s=o.useCallback((function(){a(!0)}),[]),c=o.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var d=t.step===r.SUCCESS;return d&&!t.checkout.note?null:o.createElement("div",{className:C.InfoRow},!n&&!d&&o.createElement("div",{className:C.ActionTextBtn,onClick:s},l),(n||d)&&o.createElement("div",{className:[C.CheckoutNoteContainer,d?C.Success:""].join(" ")},o.createElement("div",{className:C.Title},i("checkout-page:orderNote")),d?o.createElement("div",{className:C.CheckoutNoteDisplay},t.checkout.note):o.createElement(y,{style:{width:"100%"},type:p.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:c,maxLength:320})))}));export{B as CartSummary,z as Coupon,H as CouponErrorCode,$ as LoyaltyPointsLine};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={ExpandHeader:"style-module_ExpandHeader__LQwWm",Left:"style-module_Left__-N12h",Price:"style-module_Price__OT1Wh",PriceText:"style-module_PriceText__bq1pk",ArrowDown:"style-module_ArrowDown__YhRny",Rotated:"style-module_Rotated__ZPfId",CartSummary:"style-module_CartSummary__m77tn",OpenCouponCodeSummary:"style-module_OpenCouponCodeSummary__ua9wx",HideOnDesktop:"style-module_HideOnDesktop__Vs5AV",ItemsContainer:"style-module_ItemsContainer__QFKQV",DetailsContainer:"style-module_DetailsContainer__PK33m",SuccessPageDetailContainer:"style-module_SuccessPageDetailContainer__-p8kJ",Details:"style-module_Details__hWJ9o",Divider:"style-module_Divider__MNDti",ActionTextBtn:"style-module_ActionTextBtn__7yua4",NoUnderline:"style-module_NoUnderline__FphKn",Light:"style-module_Light__dIcW-",SubTotalInfo:"style-module_SubTotalInfo__JMqK9",InfoRow:"style-module_InfoRow__oAvZS",hideMb:"style-module_hideMb__j7VBr",LoyaltyPoints:"style-module_LoyaltyPoints__3gd4k",Label:"style-module_Label__28Bij",Value:"style-module_Value__7rELF",TotalContainer:"style-module_TotalContainer__sGR7d",TitleContainer:"style-module_TitleContainer__LgmJI",Title:"style-module_Title__oMVSD",TotalPricesContainer:"style-module_TotalPricesContainer__-PsOD",TotalPrice:"style-module_TotalPrice__QBdM1",TotalTax:"style-module_TotalTax__9pA4Y",SuccessPageTotalContainer:"style-module_SuccessPageTotalContainer__NZGFF",AppliedCoupon:"style-module_AppliedCoupon__UNo1h",AppliedCouponBgGray:"style-module_AppliedCouponBgGray__MYoYu",NotClosed:"style-module_NotClosed__E-N9z",CouponCode:"style-module_CouponCode__UKPmf",ClearCoupon:"style-module_ClearCoupon__CBAzl",NotificationContainer:"style-module_NotificationContainer__AXfJT",CheckoutNoteContainer:"style-module_CheckoutNoteContainer__d-z4m",CheckoutNoteDisplay:"style-module_CheckoutNoteDisplay__DtnXo",Success:"style-module_Success__VI2Bw",GiftLabel:"style-module_GiftLabel__cazrS",PoweredBy:"style-module_PoweredBy__DKBJF",SuccessPageCartSummary:"style-module_SuccessPageCartSummary__pjgea",OpenCouponCodeMain:"style-module_OpenCouponCodeMain__lZtb3",OpenCouponCodeMainWithMb:"style-module_OpenCouponCodeMainWithMb__DqVmh",InfoRowGiftCardMobile:"style-module_InfoRowGiftCardMobile__Kp-zh",StoreCreditTag:"style-module_StoreCreditTag__D1TtS"};e(".style-module_ExpandHeader__LQwWm {\n position: sticky;\n top: 0;\n z-index: 10;\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n padding: 0 24px;\n width: 100%;\n border-top: 1px solid var(--checkout-border-color);\n border-bottom: 1px solid var(--checkout-border-color);\n transition: border-bottom 0.3s;\n user-select: none;\n background-color: var(--checkout-primary-bg-color);\n}\n@media only screen and (min-width: 1000px) {\n .style-module_ExpandHeader__LQwWm {\n display: none;\n }\n}\n.style-module_ExpandHeader__LQwWm .style-module_Left__-N12h {\n display: flex;\n align-items: center;\n font-size: 16px;\n font-weight: 600;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh {\n font-weight: 600;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_PriceText__bq1pk {\n font-weight: 600;\n margin-right: 8px;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny {\n transition: all 0.3s;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny.style-module_Rotated__ZPfId {\n transform: rotate(-180deg);\n}\n\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn {\n width: 100%;\n background-color: var(--checkout-card-bg-color);\n }\n .style-module_CartSummary__m77tn.style-module_OpenCouponCodeSummary__ua9wx {\n background-color: transparent;\n }\n}\n@media only screen and (min-width: 1000px) {\n .style-module_CartSummary__m77tn.style-module_HideOnDesktop__Vs5AV {\n display: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: 50vh;\n overflow-y: auto;\n margin-bottom: 24px;\n /* Track */\n /* Handle */\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: unset;\n overflow-y: unset;\n margin-bottom: 0;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar {\n width: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-track {\n box-shadow: inset 0 0 20px 20px #e3e7ef;\n border-left: 16px solid transparent;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 20px 20px #000000;\n border-left: 16px solid transparent;\n}\n.style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n overflow: hidden;\n width: 100%;\n transition: height 0.3s ease-in-out;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n padding: 0 24px;\n box-shadow: 1px 2px 5px 0px rgba(0, 0, 0, 0.2);\n }\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_SuccessPageDetailContainer__-p8kJ {\n padding: 0;\n box-shadow: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageDetailContainer__-p8kJ .style-module_Details__hWJ9o {\n padding-top: 0;\n}\n.style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n overflow: hidden;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n padding-top: 24px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_Divider__MNDti {\n width: 100%;\n height: 1px;\n margin: auto;\n background-color: var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4 {\n color: var(--checkout-primary-text-color);\n user-select: none;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4:hover {\n text-decoration: underline;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_NoUnderline__FphKn:hover {\n text-decoration: none;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_Light__dIcW- {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 {\n padding: 24px 0;\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS.style-module_hideMb__j7VBr {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_LoyaltyPoints__3gd4k {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n margin-right: 4px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Label__28Bij {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Value__7rELF {\n flex: 0 0 auto;\n padding-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS:last-of-type {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n display: flex;\n justify-content: space-between;\n margin-top: 12px;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TitleContainer__LgmJI .style-module_Title__oMVSD {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPricesContainer__-PsOD {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPrice__QBdM1 {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalTax__9pA4Y {\n font-size: 14px;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n height: 64px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF {\n height: unset;\n margin-top: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF .style-module_Title__oMVSD {\n font-weight: 500 !important;\n line-height: 32px;\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF .style-module_TotalPrice__QBdM1 {\n font-weight: 500 !important;\n line-height: 32px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 2px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_AppliedCouponBgGray__MYoYu {\n background-color: var(--checkout-secondary-bg-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_NotClosed__E-N9z {\n padding: 4px 4px 4px 4px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_CouponCode__UKPmf {\n font-size: 14px;\n margin-left: 6px;\n margin-right: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl svg {\n transform: scale(0.8);\n}\n.style-module_CartSummary__m77tn .style-module_NotificationContainer__AXfJT {\n margin-bottom: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 24px;\n width: calc(100% - 2px);\n margin-left: 1px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_Title__oMVSD {\n font-size: 16px;\n color: var(--checkout-primary-text-color);\n margin-bottom: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_CheckoutNoteDisplay__DtnXo {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m.style-module_Success__VI2Bw {\n margin-top: 0;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 0px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS {\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS span {\n margin-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n width: 100%;\n height: 50px;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n display: flex;\n }\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF a {\n display: flex;\n align-items: center;\n}\n\n.style-module_SuccessPageCartSummary__pjgea {\n background-color: #fff;\n}\n\n.style-module_OpenCouponCodeMain__lZtb3 {\n display: flex;\n}\n.style-module_OpenCouponCodeMain__lZtb3 input {\n width: calc(100% - 12px);\n}\n.style-module_OpenCouponCodeMain__lZtb3.style-module_OpenCouponCodeMainWithMb__DqVmh {\n margin-bottom: 12px;\n}\n\n.style-module_InfoRowGiftCardMobile__Kp-zh {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh.style-module_hideMb__j7VBr {\n margin-bottom: 0;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_Label__28Bij {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_Value__7rELF {\n flex: 0 0 auto;\n padding-left: 8px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh:last-of-type {\n margin-bottom: 0;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4 {\n color: var(--checkout-primary-text-color);\n user-select: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4 .style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4:hover {\n text-decoration: underline;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4.style-module_NoUnderline__FphKn:hover {\n text-decoration: none;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4.style-module_Light__dIcW- {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 6px;\n margin-left: 12px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h.style-module_AppliedCoupon__UNo1h {\n background-color: var(--checkout-secondary-bg-color);\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h.style-module_NotClosed__E-N9z {\n padding: 4px 4px 4px 4px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h .style-module_CouponCode__UKPmf {\n font-size: 14px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl svg {\n transform: scale(0.8);\n}\n\n.style-module_StoreCreditTag__D1TtS {\n color: var(--checkout-secondary-text-color);\n}");export{n as default};
|
|
1
|
+
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={ExpandHeader:"style-module_ExpandHeader__LQwWm",Left:"style-module_Left__-N12h",Price:"style-module_Price__OT1Wh",PriceText:"style-module_PriceText__bq1pk",ArrowDown:"style-module_ArrowDown__YhRny",Rotated:"style-module_Rotated__ZPfId",CartSummary:"style-module_CartSummary__m77tn",OpenCouponCodeSummary:"style-module_OpenCouponCodeSummary__ua9wx",HideOnDesktop:"style-module_HideOnDesktop__Vs5AV",ItemsContainer:"style-module_ItemsContainer__QFKQV",DetailsContainer:"style-module_DetailsContainer__PK33m",SuccessPageDetailContainer:"style-module_SuccessPageDetailContainer__-p8kJ",Details:"style-module_Details__hWJ9o",Divider:"style-module_Divider__MNDti",ActionTextBtn:"style-module_ActionTextBtn__7yua4",NoUnderline:"style-module_NoUnderline__FphKn",Light:"style-module_Light__dIcW-",SubTotalInfo:"style-module_SubTotalInfo__JMqK9",InfoRow:"style-module_InfoRow__oAvZS",hideMb:"style-module_hideMb__j7VBr",LoyaltyPoints:"style-module_LoyaltyPoints__3gd4k",Label:"style-module_Label__28Bij",Value:"style-module_Value__7rELF",TotalContainer:"style-module_TotalContainer__sGR7d",TitleContainer:"style-module_TitleContainer__LgmJI",Title:"style-module_Title__oMVSD",TotalPricesContainer:"style-module_TotalPricesContainer__-PsOD",TotalPrice:"style-module_TotalPrice__QBdM1",TotalTax:"style-module_TotalTax__9pA4Y",SuccessPageTotalContainer:"style-module_SuccessPageTotalContainer__NZGFF",AppliedCoupon:"style-module_AppliedCoupon__UNo1h",AppliedCouponBgGray:"style-module_AppliedCouponBgGray__MYoYu",NotClosed:"style-module_NotClosed__E-N9z",CouponCode:"style-module_CouponCode__UKPmf",ClearCoupon:"style-module_ClearCoupon__CBAzl",NotificationContainer:"style-module_NotificationContainer__AXfJT",CheckoutNoteContainer:"style-module_CheckoutNoteContainer__d-z4m",CheckoutNoteDisplay:"style-module_CheckoutNoteDisplay__DtnXo",Success:"style-module_Success__VI2Bw",GiftLabel:"style-module_GiftLabel__cazrS",PoweredBy:"style-module_PoweredBy__DKBJF",SuccessPageCartSummary:"style-module_SuccessPageCartSummary__pjgea",OpenCouponCodeMain:"style-module_OpenCouponCodeMain__lZtb3",OpenCouponCodeMainWithMb:"style-module_OpenCouponCodeMainWithMb__DqVmh",InfoRowGiftCardMobile:"style-module_InfoRowGiftCardMobile__Kp-zh",StoreCreditTag:"style-module_StoreCreditTag__D1TtS",LoyaltyPointsContainer:"style-module_LoyaltyPointsContainer__NDR6k",LoyaltyPointsTitle:"style-module_LoyaltyPointsTitle__4rwqg",LoyaltyPointsLines:"style-module_LoyaltyPointsLines__rAHEY",LoyaltyPointsLine:"style-module_LoyaltyPointsLine__WPMxS",LoyaltyPointsLineTitle:"style-module_LoyaltyPointsLineTitle__ikVAx",LoyaltyPointsLineTitleText:"style-module_LoyaltyPointsLineTitleText__bngZY",LoyaltyPointsLineValue:"style-module_LoyaltyPointsLineValue__EDVfX",LoyaltyPointsLineAll:"style-module_LoyaltyPointsLineAll__RHBd4",LoyaltyPointsLineAllContainer:"style-module_LoyaltyPointsLineAllContainer__IX7I0",LoyaltyPointsLinesModalContainer:"style-module_LoyaltyPointsLinesModalContainer__cjW0h",LoyaltyPointsLinesModal:"style-module_LoyaltyPointsLinesModal__h1aD-",LoyaltyPointsLinesModalHeader:"style-module_LoyaltyPointsLinesModalHeader__-Zcj7",LoyaltyPointsLinesModalCloseButton:"style-module_LoyaltyPointsLinesModalCloseButton__nb3-5",LoyaltyPointsLinesModalHeaderTitle:"style-module_LoyaltyPointsLinesModalHeaderTitle__xcD59",LoyaltyPointsLinesModalHeaderDescription:"style-module_LoyaltyPointsLinesModalHeaderDescription__9N8ot",LoyaltyPointsLinesModalContent:"style-module_LoyaltyPointsLinesModalContent__hjwxz",LoyaltyPointsLinesModalContentItemHeader:"style-module_LoyaltyPointsLinesModalContentItemHeader__aQV4i",LoyaltyPointsLinesModalContentItemHeaderValue:"style-module_LoyaltyPointsLinesModalContentItemHeaderValue__T9r6z",LoyaltyPointsLinesModalContentItem:"style-module_LoyaltyPointsLinesModalContentItem__r1qmE",LoyaltyPointsLinesModalContentItemFreeProduct:"style-module_LoyaltyPointsLinesModalContentItemFreeProduct__aAUrx",LoyaltyPointsLinesModalContentItemsFirst:"style-module_LoyaltyPointsLinesModalContentItemsFirst__Sj8rF",LoyaltyPointsLinesModalContentItemsLast:"style-module_LoyaltyPointsLinesModalContentItemsLast__gc8cc",LoyaltyPointsLinesModalContentItemHeaderValueIcon:"style-module_LoyaltyPointsLinesModalContentItemHeaderValueIcon__c4CR6",LoyaltyPointsLinesModalContentItemHeaderValueIconContainer:"style-module_LoyaltyPointsLinesModalContentItemHeaderValueIconContainer__26F-5",LoyaltyPointsLinesModalContentItemHeaderValueTextMain:"style-module_LoyaltyPointsLinesModalContentItemHeaderValueTextMain__aft8A",LoyaltyPointsLinesModalContentItemHeaderValueTextMainTitle:"style-module_LoyaltyPointsLinesModalContentItemHeaderValueTextMainTitle__TQC3n",LoyaltyPointsLinesModalContentItemHeaderValueTextMainValue:"style-module_LoyaltyPointsLinesModalContentItemHeaderValueTextMainValue__TSz0-",LoyaltyPointsLinesModalContentItemButton:"style-module_LoyaltyPointsLinesModalContentItemButton__Xwvm7",LoyaltyPointsGiftModalOverlay:"style-module_LoyaltyPointsGiftModalOverlay__xeQyA",LoyaltyPointsGiftModal:"style-module_LoyaltyPointsGiftModal__C7rhN",LoyaltyGiftSlideIn:"style-module_LoyaltyGiftSlideIn__sZfMa",LoyaltyPointsGiftModalHeader:"style-module_LoyaltyPointsGiftModalHeader__54vAK",LoyaltyPointsGiftModalTitle:"style-module_LoyaltyPointsGiftModalTitle__qnzx3",LoyaltyPointsGiftModalDescription:"style-module_LoyaltyPointsGiftModalDescription__80l9h",LoyaltyPointsGiftModalClose:"style-module_LoyaltyPointsGiftModalClose__bsSO2",LoyaltyPointsGiftModalBody:"style-module_LoyaltyPointsGiftModalBody__aLoj3",LoyaltyPointsLinesModalContentItemHeaderValueIconImage:"style-module_LoyaltyPointsLinesModalContentItemHeaderValueIconImage__BQic0",LoyaltyPointsLinesModalContentItemPoint:"style-module_LoyaltyPointsLinesModalContentItemPoint__xvR23",LoyaltyPointsLinesModalContentItemPointMobile:"style-module_LoyaltyPointsLinesModalContentItemPointMobile__AUrpP",LoyaltyPointsLinesModalContentItemSlider:"style-module_LoyaltyPointsLinesModalContentItemSlider__iWpgU",LoyaltyPointsLinesModalSliderInfo:"style-module_LoyaltyPointsLinesModalSliderInfo__WiA8X",LoyaltyPointsLinesModalSliderInfoSlider:"style-module_LoyaltyPointsLinesModalSliderInfoSlider__tnBdu",LoyaltyPointsLinesModalSliderInfoSliderValue:"style-module_LoyaltyPointsLinesModalSliderInfoSliderValue__oG1fM",LoyaltyPointsLinesModalSliderInfoSliderValueText:"style-module_LoyaltyPointsLinesModalSliderInfoSliderValueText__fnKQh",LoyaltyPointsLinesModalSliderInfoSliderValueTextValue:"style-module_LoyaltyPointsLinesModalSliderInfoSliderValueTextValue__lGm4z",LoyaltyPointsLinesModalSliderInput:"style-module_LoyaltyPointsLinesModalSliderInput__sgZrN",LoyaltyPointsLinesModalSliderInfoValue:"style-module_LoyaltyPointsLinesModalSliderInfoValue__RuqZ6",LoyaltyEarningMethod:"style-module_LoyaltyEarningMethod__UNcvo",LoyaltyEarningMethodTitle:"style-module_LoyaltyEarningMethodTitle__d5p2X",LoyaltyPointsLineOneRow:"style-module_LoyaltyPointsLineOneRow__YdQkF",LoyaltyPointsLineOneRowTitle:"style-module_LoyaltyPointsLineOneRowTitle__V04li",LoyaltyPointsLineOneRowTitleText:"style-module_LoyaltyPointsLineOneRowTitleText__y3UOy",AppliedCouponLoyalty:"style-module_AppliedCouponLoyalty__p2Mi0",LoyaltyPointsLineIcon:"style-module_LoyaltyPointsLineIcon__ECQ1W",ClearCouponLoyalty:"style-module_ClearCouponLoyalty__vRYH4",ValueLoyalty:"style-module_ValueLoyalty__jdjW9",LoyaltyPointSpending:"style-module_LoyaltyPointSpending__qam9Z",LoyaltyPointsLineContainer:"style-module_LoyaltyPointsLineContainer__85Cvs",LoyaltyPointsLinesModalContentItemButtonContainerMobile:"style-module_LoyaltyPointsLinesModalContentItemButtonContainerMobile__iNiif"};e(".style-module_ExpandHeader__LQwWm {\n position: sticky;\n top: 0;\n z-index: 10;\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n padding: 0 24px;\n width: 100%;\n border-top: 1px solid var(--checkout-border-color);\n border-bottom: 1px solid var(--checkout-border-color);\n transition: border-bottom 0.3s;\n user-select: none;\n background-color: var(--checkout-primary-bg-color);\n}\n@media only screen and (min-width: 1000px) {\n .style-module_ExpandHeader__LQwWm {\n display: none;\n }\n}\n.style-module_ExpandHeader__LQwWm .style-module_Left__-N12h {\n display: flex;\n align-items: center;\n font-size: 16px;\n font-weight: 600;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh {\n font-weight: 600;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_PriceText__bq1pk {\n font-weight: 600;\n margin-right: 8px;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny {\n transition: all 0.3s;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny.style-module_Rotated__ZPfId {\n transform: rotate(-180deg);\n}\n\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn {\n width: 100%;\n background-color: var(--checkout-card-bg-color);\n }\n .style-module_CartSummary__m77tn.style-module_OpenCouponCodeSummary__ua9wx {\n background-color: transparent;\n }\n}\n@media only screen and (min-width: 1000px) {\n .style-module_CartSummary__m77tn.style-module_HideOnDesktop__Vs5AV {\n display: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: 50vh;\n overflow-y: auto;\n margin-bottom: 24px;\n /* Track */\n /* Handle */\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: unset;\n overflow-y: unset;\n margin-bottom: 0;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar {\n width: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-track {\n box-shadow: inset 0 0 20px 20px #e3e7ef;\n border-left: 16px solid transparent;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 20px 20px #000000;\n border-left: 16px solid transparent;\n}\n.style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n overflow: hidden;\n width: 100%;\n transition: height 0.3s ease-in-out;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n padding: 0 24px;\n box-shadow: 1px 2px 5px 0px rgba(0, 0, 0, 0.2);\n }\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_SuccessPageDetailContainer__-p8kJ {\n padding: 0;\n box-shadow: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageDetailContainer__-p8kJ .style-module_Details__hWJ9o {\n padding-top: 0;\n}\n.style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n overflow: hidden;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n padding-top: 24px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_Divider__MNDti {\n width: 100%;\n height: 1px;\n margin: auto;\n background-color: var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4 {\n color: var(--checkout-primary-text-color);\n user-select: none;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4:hover {\n text-decoration: underline;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_NoUnderline__FphKn:hover {\n text-decoration: none;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_Light__dIcW- {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 {\n padding: 24px 0;\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS.style-module_hideMb__j7VBr {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_LoyaltyPoints__3gd4k {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n margin-right: 4px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Label__28Bij {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Value__7rELF {\n flex: 0 0 auto;\n padding-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS:last-of-type {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n display: flex;\n justify-content: space-between;\n margin-top: 12px;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TitleContainer__LgmJI .style-module_Title__oMVSD {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPricesContainer__-PsOD {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPrice__QBdM1 {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalTax__9pA4Y {\n font-size: 14px;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF {\n height: unset;\n margin-top: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF .style-module_Title__oMVSD {\n font-weight: 500 !important;\n line-height: 32px;\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF .style-module_TotalPrice__QBdM1 {\n font-weight: 500 !important;\n line-height: 32px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 2px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_AppliedCouponBgGray__MYoYu {\n background-color: var(--checkout-secondary-bg-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_NotClosed__E-N9z {\n padding: 4px 4px 4px 4px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_CouponCode__UKPmf {\n font-size: 14px;\n margin-left: 6px;\n margin-right: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl svg {\n transform: scale(0.8);\n}\n.style-module_CartSummary__m77tn .style-module_NotificationContainer__AXfJT {\n margin-bottom: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 24px;\n width: calc(100% - 2px);\n margin-left: 1px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_Title__oMVSD {\n font-size: 16px;\n color: var(--checkout-primary-text-color);\n margin-bottom: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_CheckoutNoteDisplay__DtnXo {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m.style-module_Success__VI2Bw {\n margin-top: 0;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 0px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS {\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS span {\n margin-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n width: 100%;\n height: 50px;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n display: none;\n margin-top: 32px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n display: flex;\n }\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF a {\n display: flex;\n align-items: center;\n}\n\n.style-module_SuccessPageCartSummary__pjgea {\n background-color: #fff;\n}\n\n.style-module_OpenCouponCodeMain__lZtb3 {\n display: flex;\n}\n.style-module_OpenCouponCodeMain__lZtb3 input {\n width: calc(100% - 12px);\n}\n.style-module_OpenCouponCodeMain__lZtb3.style-module_OpenCouponCodeMainWithMb__DqVmh {\n margin-bottom: 12px;\n}\n\n.style-module_InfoRowGiftCardMobile__Kp-zh {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh.style-module_hideMb__j7VBr {\n margin-bottom: 0;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_Label__28Bij {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_Value__7rELF {\n flex: 0 0 auto;\n padding-left: 8px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh:last-of-type {\n margin-bottom: 0;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4 {\n color: var(--checkout-primary-text-color);\n user-select: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4 .style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4:hover {\n text-decoration: underline;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4.style-module_NoUnderline__FphKn:hover {\n text-decoration: none;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4.style-module_Light__dIcW- {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 6px;\n margin-left: 12px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h.style-module_AppliedCoupon__UNo1h {\n background-color: var(--checkout-secondary-bg-color);\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h.style-module_NotClosed__E-N9z {\n padding: 4px 4px 4px 4px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h .style-module_CouponCode__UKPmf {\n font-size: 14px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl svg {\n transform: scale(0.8);\n}\n\n.style-module_StoreCreditTag__D1TtS {\n color: var(--checkout-secondary-text-color);\n}\n\n.style-module_LoyaltyPointsContainer__NDR6k {\n margin-bottom: 24px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsContainer__NDR6k {\n margin-bottom: 0;\n margin-top: 16px;\n }\n}\n.style-module_LoyaltyPointsContainer__NDR6k .style-module_LoyaltyPointsTitle__4rwqg {\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n color: var(--checkout-primary-text-color);\n margin-bottom: 8px;\n}\n.style-module_LoyaltyPointsContainer__NDR6k .style-module_LoyaltyPointsLines__rAHEY {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n gap: 8px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsContainer__NDR6k .style-module_LoyaltyPointsLines__rAHEY {\n overflow: auto;\n }\n}\n.style-module_LoyaltyPointsContainer__NDR6k .style-module_LoyaltyPointsLines__rAHEY .style-module_LoyaltyPointsLine__WPMxS {\n border: 1px solid var(--checkout-border-color);\n border-radius: 8px;\n padding: 10px 12px;\n background-color: #fff;\n display: flex;\n flex-direction: column;\n justify-content: center;\n cursor: pointer;\n white-space: nowrap;\n}\n.style-module_LoyaltyPointsContainer__NDR6k .style-module_LoyaltyPointsLines__rAHEY .style-module_LoyaltyPointsLineTitle__ikVAx {\n display: flex;\n gap: 6px;\n align-items: center;\n margin-bottom: 2px;\n}\n.style-module_LoyaltyPointsContainer__NDR6k .style-module_LoyaltyPointsLines__rAHEY .style-module_LoyaltyPointsLineTitle__ikVAx .style-module_LoyaltyPointsLineTitleText__bngZY {\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n letter-spacing: 0;\n white-space: nowrap;\n width: 100px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.style-module_LoyaltyPointsContainer__NDR6k .style-module_LoyaltyPointsLines__rAHEY .style-module_LoyaltyPointsLineValue__EDVfX {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n letter-spacing: 0;\n}\n.style-module_LoyaltyPointsContainer__NDR6k .style-module_LoyaltyPointsLines__rAHEY .style-module_LoyaltyPointsLineAll__RHBd4 {\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n}\n.style-module_LoyaltyPointsContainer__NDR6k .style-module_LoyaltyPointsLines__rAHEY .style-module_LoyaltyPointsLineAllContainer__IX7I0 {\n display: flex;\n gap: 6px;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n align-self: center;\n}\n.style-module_LoyaltyPointsContainer__NDR6k .style-module_LoyaltyPointsLines__rAHEY .style-module_LoyaltyPointsLineAllContainer__IX7I0 svg path {\n stroke: var(--checkout-primary-text-color);\n}\n\n.style-module_LoyaltyPointsLinesModalContainer__cjW0h {\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background-color: rgba(39, 39, 39, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n}\n\n.style-module_LoyaltyPointsLinesModal__h1aD- {\n width: 720px;\n border-radius: 8px;\n background-color: #fff;\n position: relative;\n overflow: hidden;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLinesModal__h1aD- {\n width: 96%;\n }\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalHeader__-Zcj7 {\n border-bottom: 1px solid var(--checkout-border-color);\n padding: 24px;\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalCloseButton__nb3-5 {\n position: absolute;\n top: 16px;\n right: 16px;\n width: 24px;\n height: 24px;\n cursor: pointer;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalHeaderTitle__xcD59 {\n font-size: 22px;\n font-weight: 500;\n line-height: 32px;\n color: var(--checkout-primary-text-color);\n margin-bottom: 4px;\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalHeaderDescription__9N8ot {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContent__hjwxz {\n padding: 24px;\n max-height: 650px;\n overflow: auto;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContent__hjwxz {\n max-height: 500px;\n }\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemHeader__aQV4i {\n display: flex;\n gap: 6px;\n align-items: center;\n margin-bottom: 16px;\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemHeader__aQV4i span {\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemHeaderValue__T9r6z {\n display: flex;\n gap: 4px;\n align-items: center;\n background-color: #f7f7f9;\n padding: 2px 6px;\n border-radius: 28px;\n line-height: 22px;\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItem__r1qmE {\n padding: 16px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border: 1px solid var(--checkout-border-color);\n border-bottom: none;\n transition: background-color 0.3s ease;\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItem__r1qmE:hover {\n background-color: #f7f7f9;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemFreeProduct__aAUrx {\n flex-direction: column;\n align-items: flex-start;\n gap: 12px;\n }\n .style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemFreeProduct__aAUrx button {\n display: flex;\n }\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemsFirst__Sj8rF {\n border-top-right-radius: 8px;\n border-top-left-radius: 8px;\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemsLast__gc8cc {\n border-bottom-right-radius: 8px;\n border-bottom-left-radius: 8px;\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemHeaderValueIcon__c4CR6 {\n width: 40px;\n height: 40px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--checkout-border-color);\n border-radius: 8px;\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemHeaderValueIconContainer__26F-5 {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemHeaderValueTextMain__aft8A {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemHeaderValueTextMain__aft8A {\n width: 72%;\n }\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemHeaderValueTextMainTitle__TQC3n {\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n color: var(--checkout-primary-text-color);\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemHeaderValueTextMainValue__TSz0- {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemButton__Xwvm7 {\n background-color: var(--checkout-button-bg-color);\n border-radius: 8px;\n padding: 8px 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n cursor: pointer;\n color: var(--checkout-button-text-color);\n outline: none;\n border: none;\n min-width: 123px;\n transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemButton__Xwvm7 {\n min-width: unset;\n }\n}\n.style-module_LoyaltyPointsLinesModal__h1aD- .style-module_LoyaltyPointsLinesModalContentItemButton__Xwvm7:disabled {\n background-color: #e3e8ef;\n color: var(--checkout-secondary-text-color);\n cursor: not-allowed;\n opacity: 0.8;\n}\n\n.style-module_LoyaltyPointsGiftModalOverlay__xeQyA {\n position: absolute;\n inset: 0;\n z-index: 10;\n display: flex;\n justify-content: flex-end;\n align-items: stretch;\n border-radius: 8px;\n}\n\n.style-module_LoyaltyPointsGiftModal__C7rhN {\n width: 100%;\n max-width: 100%;\n height: 100%;\n background-color: #fff;\n border-radius: 8px;\n display: flex;\n flex-direction: column;\n transform: translateX(0);\n animation: style-module_LoyaltyGiftSlideIn__sZfMa 0.28s ease-out forwards;\n}\n\n.style-module_LoyaltyPointsGiftModalHeader__54vAK {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 12px;\n padding: 20px 24px;\n border-bottom: 1px solid var(--checkout-border-color);\n}\n\n.style-module_LoyaltyPointsGiftModalTitle__qnzx3 {\n font-size: 18px;\n font-weight: 600;\n line-height: 26px;\n color: var(--checkout-primary-text-color);\n}\n\n.style-module_LoyaltyPointsGiftModalDescription__80l9h {\n margin-top: 4px;\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n}\n\n.style-module_LoyaltyPointsGiftModalClose__bsSO2 {\n width: 28px;\n height: 28px;\n border-radius: 999px;\n border: none;\n background-color: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_LoyaltyPointsGiftModalClose__bsSO2:hover {\n background-color: var(--checkout-secondary-bg-color);\n}\n\n.style-module_LoyaltyPointsGiftModalBody__aLoj3 {\n padding: 16px 24px 24px;\n overflow-y: auto;\n flex: 1;\n}\n\n@keyframes style-module_LoyaltyGiftSlideIn__sZfMa {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0%);\n }\n}\n.style-module_LoyaltyPointsLinesModalContentItemHeaderValueIconImage__BQic0 {\n width: 72px;\n height: 72px;\n border-radius: 8px;\n border: 1px solid var(--checkout-border-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLinesModalContentItemHeaderValueIconImage__BQic0 {\n width: 42px;\n height: 42px;\n }\n}\n.style-module_LoyaltyPointsLinesModalContentItemHeaderValueIconImage__BQic0 img {\n width: 72px;\n height: 72px;\n object-fit: contain;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLinesModalContentItemHeaderValueIconImage__BQic0 img {\n width: 42px;\n height: 42px;\n }\n}\n\n.style-module_LoyaltyPointsLinesModalContentItemPoint__xvR23 {\n border-radius: 12px;\n padding: 2px 8px;\n border: 1px solid var(--checkout-border-color);\n background-color: #f7f7f9;\n width: fit-content;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLinesModalContentItemPoint__xvR23 {\n display: none;\n }\n}\n\n.style-module_LoyaltyPointsLinesModalContentItemPointMobile__AUrpP {\n border-radius: 12px;\n padding: 2px 8px;\n border: 1px solid var(--checkout-border-color);\n background-color: #f7f7f9;\n width: fit-content;\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLinesModalContentItemPointMobile__AUrpP {\n display: flex;\n }\n}\n\n.style-module_LoyaltyPointsLinesModalContentItemSlider__iWpgU {\n height: 152px;\n background-color: #f7f7f9;\n padding: 32px 48px;\n border-radius: 8px;\n align-items: center;\n justify-content: center;\n display: flex;\n flex-direction: column;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLinesModalContentItemSlider__iWpgU {\n padding: 32px 16px;\n }\n}\n\n.style-module_LoyaltyPointsLinesModalSliderInfo__WiA8X {\n display: flex;\n gap: 12px;\n align-items: center;\n}\n.style-module_LoyaltyPointsLinesModalSliderInfo__WiA8X span {\n font-size: 20px;\n font-weight: 500;\n line-height: 32px;\n color: var(--checkout-primary-text-color);\n white-space: nowrap;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLinesModalSliderInfo__WiA8X span {\n font-size: 18px !important;\n line-height: 30px !important;\n }\n}\n\n.style-module_LoyaltyPointsLinesModalSliderInfoSlider__tnBdu {\n position: relative;\n width: 100%;\n height: 24px;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n cursor: pointer;\n margin-top: 24px;\n}\n\n.style-module_LoyaltyPointsLinesModalSliderInfoSliderValue__oG1fM {\n position: absolute;\n left: 0;\n right: 0;\n height: 6px;\n border-radius: 3px;\n background-color: #e3e8ef;\n}\n\n.style-module_LoyaltyPointsLinesModalSliderInfoSliderValueText__fnKQh {\n position: absolute;\n left: 0;\n height: 6px;\n width: 0;\n border-radius: 3px;\n background: linear-gradient(90deg, #36398e 0%, #6d76cb 100%);\n}\n\n.style-module_LoyaltyPointsLinesModalSliderInfoSliderValueTextValue__lGm4z {\n position: absolute;\n left: 0;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n -ms-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: #ffffff;\n border: 2px solid #ffffff;\n box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1), 0 0.5px 4px rgba(0, 0, 0, 0.1);\n z-index: 2;\n pointer-events: none;\n}\n\n.style-module_LoyaltyPointsLinesModalSliderInput__sgZrN {\n position: absolute;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n z-index: 3;\n margin: 0;\n}\n\n.style-module_LoyaltyPointsLinesModalSliderInfoValue__RuqZ6 {\n display: flex;\n border-radius: 8px;\n background-color: #fff;\n padding: 2px 8px;\n border: 0.6px solid #cfced3;\n gap: 8px;\n align-items: center;\n}\n.style-module_LoyaltyPointsLinesModalSliderInfoValue__RuqZ6 svg {\n width: 22px;\n height: 22px;\n}\n.style-module_LoyaltyPointsLinesModalSliderInfoValue__RuqZ6 svg path {\n stroke: var(--checkout-secondary-text-color);\n}\n.style-module_LoyaltyPointsLinesModalSliderInfoValue__RuqZ6 span {\n font-size: 20px;\n font-weight: 500;\n line-height: 32px;\n color: var(--checkout-primary-text-color);\n}\n\n.style-module_LoyaltyEarningMethod__UNcvo {\n margin-top: 2px;\n}\n.style-module_LoyaltyEarningMethod__UNcvo .style-module_LoyaltyEarningMethodTitle__d5p2X {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n display: flex;\n gap: 4px;\n align-items: center;\n}\n.style-module_LoyaltyEarningMethod__UNcvo .style-module_LoyaltyEarningMethodTitle__d5p2X span {\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n}\n\n.style-module_LoyaltyPointsLineOneRow__YdQkF {\n border-radius: 8px;\n padding: 10px 12px;\n background-color: #fff;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n cursor: pointer;\n border: 1px solid var(--checkout-border-color);\n align-items: center;\n}\n.style-module_LoyaltyPointsLineOneRow__YdQkF svg path {\n stroke: var(--checkout-primary-text-color);\n}\n\n.style-module_LoyaltyPointsLineOneRowTitle__V04li {\n display: flex;\n gap: 8px;\n align-items: center;\n}\n\n.style-module_LoyaltyPointsLineOneRowTitleText__y3UOy {\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n color: var(--checkout-primary-text-color);\n}\n\n.style-module_AppliedCouponLoyalty__p2Mi0 {\n border-radius: 8px;\n border: 1px solid var(--checkout-border-color);\n padding: 4px 8px;\n background-color: #fff;\n display: flex;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n line-height: 20px;\n}\n.style-module_AppliedCouponLoyalty__p2Mi0 .style-module_CouponCode__UKPmf {\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n}\n\n.style-module_LoyaltyPointsLineIcon__ECQ1W svg path {\n stroke: var(--checkout-secondary-text-color);\n}\n\n.style-module_ClearCouponLoyalty__vRYH4 {\n width: 20px;\n height: 20px;\n}\n\n.style-module_ClearCouponLoyalty__vRYH4 svg {\n width: 20px;\n height: 20px;\n}\n.style-module_ClearCouponLoyalty__vRYH4 svg path {\n color: var(--checkout-secondary-text-color);\n}\n\n.style-module_ValueLoyalty__jdjW9 {\n color: var(--checkout-error-color);\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n}\n\n.style-module_LoyaltyPointSpending__qam9Z {\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n}\n\n.style-module_LoyaltyPointsLineContainer__85Cvs {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLineContainer__85Cvs {\n flex-direction: column;\n gap: 2px;\n align-items: flex-start;\n }\n}\n\n@media only screen and (max-width: 1000px) {\n .style-module_LoyaltyPointsLinesModalContentItemButtonContainerMobile__iNiif {\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n }\n}");export{n as default};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { CheckoutStep } from "../../model";
|
|
2
|
+
import CheckoutViewModel, { CheckoutStep } from "../../model";
|
|
3
3
|
declare type Props = {
|
|
4
4
|
steps: Step[];
|
|
5
5
|
stepContent: React.ReactElement;
|
|
6
6
|
step?: CheckoutStep;
|
|
7
7
|
hasTopMargin?: boolean;
|
|
8
|
+
vm: CheckoutViewModel;
|
|
9
|
+
isMobile?: boolean;
|
|
8
10
|
};
|
|
9
11
|
declare const StepContainer: React.FC<Props>;
|
|
10
12
|
export default StepContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import{makeAutoObservable as i}from"mobx";import n from"../checkbox/check.js";import
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import{makeAutoObservable as i}from"mobx";import n from"../checkbox/check.js";import o from"./style.module.scss.js";import{PayWithIkas as l}from"../../../pay-with-ikas/index.js";import{CheckoutStep as s}from"../../model.js";import{IkasStorefrontConfig as a}from"@ikas/storefront-config";import{LoyaltyPointsLine as m}from"../cart-summary/index.js";var r=t((function(t){var i,r,c,d=t.steps,p=t.stepContent,h=t.step,v=t.hasTopMargin,y=t.vm,u=t.isMobile;e.useEffect((function(){var e,t;if(document.body.getBoundingClientRect().width<768){var i=d.findIndex((function(e){return e.isSelected}));if(0===i)return;2===i?null===(e=document.getElementById("step-".concat(1)))||void 0===e||e.scrollIntoView():null===(t=document.getElementById("step-".concat(i)))||void 0===t||t.scrollIntoView()}}),[]);var f=a.getPayWithIkasUrl();return e.createElement("div",{className:o.StepContainer},!!(null===(i=y.loyaltySpendingMethods)||void 0===i?void 0:i.length)&&(null===(r=y.loyaltySpendingMethods)||void 0===r?void 0:r.length)>0&&u&&!!(null===(c=y.customizationProps)||void 0===c?void 0:c.showLoyaltyPoints)&&e.createElement(m,{vm:y,isVisibleLoyaltyPoints:y.isLoyaltyPointsVisible,setIsVisibleLoyaltyPoints:y.setIsLoyaltyPointsVisible}),h===s.INFO&&f&&e.createElement("div",{className:[o.PayWithIkasContainer,v?o.HasTopMargin:""].join(" ")},e.createElement("div",{className:o.PayWithIkasContent},e.createElement("span",{className:o.PayWithIkasTitle},"Hızlı Öde ile Kolay Alışveriş"),e.createElement("span",{className:o.PayWithIkasDescription},"Bilgilerini bir kez kaydet, 20.000 e-ticaret sitesinde tek tıkla öde.")),e.createElement("div",{className:o.PayWithIkasButton},e.createElement(l,{useExistingCart:!0}))),d.map((function(t,i){return e.createElement("div",{className:o.Step},e.createElement("div",{id:"step-".concat(i),className:[o.StepTitleContainer,0===i?o.First:""].join(" ")},e.createElement("div",{className:[o.StepTitleTop,t.titleRightContent?o.WithRightContent:""].join(" ")},e.createElement("div",{className:[o.StepCircle,t.isSelected||t.isComplete?o.Selected:""].join(" ").trim()},t.isComplete?e.createElement(n,null):i+1),e.createElement("div",{className:[o.StepTitle,t.isSelected||t.isComplete?"":o.Light].join(" ")},t.label),!!t.titleRightContent&&e.createElement("div",{className:o.StepTitleRightContent},t.titleRightContent)),!!t.titleBottomContent&&e.createElement("div",{className:o.StepTitleBottom},t.titleBottomContent)),t.isSelected&&e.createElement("div",{className:o.StepContent},p))})))})),c=function(e,t,n,o,l){this.label=e,this.isSelected=t,this.isComplete=n,this.titleRightContent=o,this.titleBottomContent=l,i(this)};export{c as Step,r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var t=function(t){return t.className,e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},e.createElement("path",{d:"M6.75 13.5L11.25 9L6.75 4.5",stroke:"#4A33DA","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}))};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var t=function(t){return t.className,e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none"},e.createElement("path",{d:"M0.796875 6.63411H12.4635M12.4635 6.63411L6.63021 0.800781M12.4635 6.63411L6.63021 12.4674",stroke:"#8A8B94","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"}))};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var t=function(t){return t.className,e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},e.createElement("path",{d:"M2.66406 7.33398V10.0007C2.66406 12.2005 2.66406 13.3005 3.34748 13.9839C4.0309 14.6673 5.13084 14.6673 7.33073 14.6673H8.66406C10.8639 14.6673 11.9639 14.6673 12.6473 13.9839C13.3307 13.3005 13.3307 12.2005 13.3307 10.0007V7.33398",stroke:"#272727","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElement("path",{d:"M2 5.99935C2 5.50089 2 5.25166 2.13397 5.06602C2.22174 4.9444 2.34798 4.84341 2.5 4.7732C2.73205 4.66602 3.04359 4.66602 3.66667 4.66602H12.3333C12.9564 4.66602 13.2679 4.66602 13.5 4.7732C13.652 4.84341 13.7783 4.9444 13.866 5.06602C14 5.25166 14 5.50089 14 5.99935C14 6.49781 14 6.74702 13.866 6.93268C13.7783 7.05428 13.652 7.15528 13.5 7.22548C13.2679 7.33268 12.9564 7.33268 12.3333 7.33268H3.66667C3.04359 7.33268 2.73205 7.33268 2.5 7.22548C2.34798 7.15528 2.22174 7.05428 2.13397 6.93268C2 6.74702 2 6.49781 2 5.99935Z",stroke:"#272727","stroke-width":"1.2","stroke-linejoin":"round"}),e.createElement("path",{d:"M4 2.52446C4 1.86698 4.53299 1.33398 5.19047 1.33398H5.42857C6.84873 1.33398 8 2.48525 8 3.90541V4.66732H6.14286C4.95939 4.66732 4 3.70792 4 2.52446Z",stroke:"#272727","stroke-width":"1.2","stroke-linejoin":"round"}),e.createElement("path",{d:"M12 2.52446C12 1.86698 11.467 1.33398 10.8095 1.33398H10.5714C9.15127 1.33398 8 2.48525 8 3.90541V4.66732H9.85713C11.0406 4.66732 12 3.70792 12 2.52446Z",stroke:"#272727","stroke-width":"1.2","stroke-linejoin":"round"}),e.createElement("path",{d:"M8 7.33398V14.6673",stroke:"#272727","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}))};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var t=function(t){return t.className,e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"14",viewBox:"0 0 18 14",fill:"none"},e.createElement("path",{d:"M16.7969 6.80078H0.796875M0.796875 6.80078L6.79688 12.8008M0.796875 6.80078L6.79688 0.800781",stroke:"#8A8B94","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"}))};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var t=function(t){return t.className,e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},e.createElement("path",{d:"M14 4.66602V7.99935M2 4.66602C2 6.70902 2 11.1821 2 11.4402C2 12.3619 3.29709 12.9098 5.89129 14.0057C6.93347 14.4459 7.45453 14.666 8 14.666V7.56922",stroke:"#272727","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElement("path",{d:"M10 12.6667C10 12.6667 10.5833 12.6667 11.1667 14C11.1667 14 13.0196 10.6667 14.6667 10",stroke:"#272727","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElement("path",{d:"M5.55061 6.46157L3.60315 5.51922C2.53438 5.00205 2 4.74347 2 4.33398C2 3.9245 2.53438 3.66592 3.60315 3.14875L5.55061 2.2064C6.75253 1.62479 7.35353 1.33398 8 1.33398C8.64647 1.33398 9.24747 1.62478 10.4494 2.2064L12.3969 3.14875C13.4656 3.66592 14 3.9245 14 4.33398C14 4.74347 13.4656 5.00205 12.3969 5.51922L10.4494 6.46157C9.24747 7.04318 8.64647 7.33398 8 7.33398C7.35353 7.33398 6.75253 7.04318 5.55061 6.46157Z",stroke:"#272727","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElement("path",{d:"M4 8L5.33333 8.66667",stroke:"#272727","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElement("path",{d:"M11.3307 2.66602L4.66406 5.99935",stroke:"#272727","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}))};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var t=function(t){return t.className,e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},e.createElement("path",{d:"M7.32812 6.66602H7.33812M7.33059 10.666H7.34059",stroke:"#272727","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElement("path",{d:"M4.66406 8.66602H9.9974",stroke:"#272727","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElement("path",{d:"M11.6641 3.33398C12.2163 3.33398 12.6641 3.7817 12.6641 4.33398C12.6641 4.88627 12.2163 5.33398 11.6641 5.33398C11.1118 5.33398 10.6641 4.88627 10.6641 4.33398C10.6641 3.7817 11.1118 3.33398 11.6641 3.33398Z",stroke:"#272727","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElement("path",{d:"M1.85209 7.42992C1.18333 8.17685 1.16894 9.30372 1.78271 10.0965C3.00068 11.6695 4.33377 13.0026 5.90683 14.2205C6.69954 14.8343 7.82641 14.8199 8.57334 14.1512C10.6012 12.3355 12.4583 10.4379 14.2505 8.35258C14.4277 8.14645 14.5385 7.89378 14.5634 7.62305C14.6734 6.42597 14.8994 2.9771 13.9628 2.04048C13.0261 1.10386 9.57727 1.32983 8.38021 1.43982C8.10947 1.4647 7.85681 1.57554 7.65061 1.75272C5.56535 3.54496 3.66781 5.40206 1.85209 7.42992Z",stroke:"#272727","stroke-width":"1.2"}))};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var t=function(t){return t.className,e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},e.createElement("g",{filter:"url(#filter0_dii_4527_5468)"},e.createElement("path",{d:"M7.73445 0.617758C7.90731 0.267554 7.99375 0.0924516 8.11108 0.0365064C8.21317 -0.0121688 8.33178 -0.0121688 8.43386 0.0365064C8.5512 0.0924516 8.63763 0.267554 8.8105 0.617758L10.4505 3.94023C10.5015 4.04362 10.5271 4.09532 10.5643 4.13545C10.5974 4.17099 10.637 4.19978 10.6809 4.22024C10.7306 4.24334 10.7877 4.25168 10.9018 4.26835L14.5702 4.80455C14.9565 4.86101 15.1497 4.88925 15.239 4.9836C15.3168 5.06569 15.3534 5.17849 15.3386 5.2906C15.3216 5.41946 15.1817 5.55566 14.9021 5.82806L12.2485 8.41258C12.1658 8.49315 12.1245 8.53344 12.0978 8.58137C12.0742 8.62381 12.059 8.67043 12.0531 8.71865C12.0465 8.77311 12.0563 8.83002 12.0758 8.94382L12.7019 12.5944C12.768 12.9794 12.801 13.1719 12.7389 13.2861C12.6849 13.3855 12.589 13.4553 12.4778 13.4759C12.3499 13.4996 12.1771 13.4087 11.8313 13.2268L8.55174 11.5021C8.44956 11.4484 8.39847 11.4215 8.34464 11.411C8.29698 11.4016 8.24796 11.4016 8.2003 11.411C8.14648 11.4215 8.09539 11.4484 7.9932 11.5021L4.71365 13.2268C4.3679 13.4087 4.19502 13.4996 4.06719 13.4759C3.95597 13.4553 3.86 13.3855 3.80601 13.2861C3.74396 13.1719 3.77698 12.9794 3.84302 12.5944L4.46913 8.94382C4.48864 8.83002 4.4984 8.77311 4.4918 8.71865C4.48595 8.67043 4.47079 8.62381 4.44717 8.58137C4.42048 8.53344 4.37912 8.49315 4.2964 8.41258L1.64288 5.82806C1.36321 5.55566 1.22337 5.41946 1.20636 5.2906C1.19155 5.17849 1.22813 5.06569 1.3059 4.9836C1.39529 4.88925 1.58844 4.86101 1.97474 4.80455L5.64319 4.26835C5.75728 4.25168 5.81432 4.24334 5.864 4.22024C5.90798 4.19978 5.94758 4.17099 5.9806 4.13545C6.01789 4.09532 6.04341 4.04362 6.09444 3.94023L7.73445 0.617758Z",fill:"url(#paint0_linear_4527_5468)"})),e.createElement("defs",null,e.createElement("filter",{id:"filter0_dii_4527_5468",x:"0.00312495",y:"-1.2",width:"16.5406",height:"17.0805",filterUnits:"userSpaceOnUse","color-interpolation-filters":"sRGB"},e.createElement("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),e.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:"1.2"}),e.createElement("feGaussianBlur",{stdDeviation:"0.6"}),e.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),e.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.552941 0 0 0 0 0.294118 0 0 0 0 0 0 0 0 0.24 0"}),e.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_4527_5468"}),e.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_4527_5468",result:"shape"}),e.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:"-1.2"}),e.createElement("feGaussianBlur",{stdDeviation:"1.2"}),e.createElement("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),e.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.844933 0 0 0 0 0.523295 0 0 0 0 0.161948 0 0 0 1 0"}),e.createElement("feBlend",{mode:"normal",in2:"shape",result:"effect2_innerShadow_4527_5468"}),e.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.createElement("feOffset",{dy:"1.2"}),e.createElement("feGaussianBlur",{stdDeviation:"1.2"}),e.createElement("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),e.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"}),e.createElement("feBlend",{mode:"normal",in2:"effect2_innerShadow_4527_5468",result:"effect3_innerShadow_4527_5468"})),e.createElement("linearGradient",{id:"paint0_linear_4527_5468",x1:"8.27247",y1:"0",x2:"8.27247",y2:"13.4796",gradientUnits:"userSpaceOnUse"},e.createElement("stop",{"stop-color":"#FFE6B1"}),e.createElement("stop",{offset:"1","stop-color":"#F49D30"}))))};export{t as default};
|
|
@@ -15,6 +15,7 @@ export declare type IkasCheckoutPageProps = {
|
|
|
15
15
|
export declare type IkasCheckoutCustomizationProps = {
|
|
16
16
|
logo?: IkasImage;
|
|
17
17
|
showTax?: boolean;
|
|
18
|
+
showLoyaltyPoints?: boolean;
|
|
18
19
|
showCampaignIsBiggerImage?: boolean;
|
|
19
20
|
showCampaignOffersDesign?: boolean;
|
|
20
21
|
campaignOfferIsSmallDesign?: boolean;
|
|
@@ -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 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
|
+
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import n from"react-tooltip";import a,{CheckoutStep as s}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as l}from"../../utils/currency.js";import{useTranslation as m}from"../../utils/i18n.js";import d from"./steps/step-info/index.js";import{CheckoutStepShipping as p}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as u}from"./steps/step-payment/index.js";import{CouponErrorCode as f,Coupon as g,CartSummary as v}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as h}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-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=i((function(e){var t,i,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=r(),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,ie=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===(i=K.checkout.customer)||void 0===i?void 0:i.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},ie?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=i((function(e){var t,i,r,n,a=e.vm,s=c.getCurrentRouting(),l=(null==s?void 0:s.path)?"/".concat(s.path):"/",d=m().t;return o.createElement("div",{className: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===(i=a.merchantSettings)||void 0===i?void 0:i.logo)?o.createElement("div",{className:D.Logo},o.createElement(P,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(r=a.merchantSettings)||void 0===r?void 0:r.merchantName)||""),!a.checkout.hasCustomer&&!a.isOpenEditOrderWithTransaction&&!a.checkout.edited&&o.createElement("div",{className: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=i((function(e){var t=e.vm,i=m().t,r=o.useState(!1),n=r[0],a=r[1],s=o.useState(null),c=s[0],l=s[1],d=H().isMobile,p=o.useMemo((function(){switch(c){case f.COUPON_CODE_NOT_EXIST:return i("checkout-page:giftCodeErrorDescription");case f.COUPON_CODE_NOT_EXIST_FOR_GUESS:return i("checkout-page:mustBeSignInToApplyCampaign");case f.COUPON_APPLIED_WITHOUT_DISCOUNT:return i("checkout-page:couponInvalidForCartItems");default:return""}}),[c]);return o.createElement("div",{className:D.CouponContainer},n&&o.createElement("div",{className:D.NotificationContainer},o.createElement(M,{type:"warning",title:i("checkout-page:giftCodeErrorTitle"),content:p,onClose:function(){a(!1),l(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:n?12:0}},o.createElement(g,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:a,setCouponErrorCode:l,showOnlyMobile:!0,isMobile:d})))})),Y=i((function(e){var t=e.vm,i=m().t,r=o.useMemo((function(){switch(t.step){case s.INFO:return o.createElement(d,{vm:t});case s.SHIPPING:return o.createElement(p,{vm:t});case s.PAYMENT:return o.createElement(u,{vm:t});case s.SUCCESS:return o.createElement(y,{vm:t})}}),[t,t.step]),n=H().isMobile,a=[new O(i("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},i("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(i("checkout-page:payment"),t.step===s.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||a.splice(1,0,new O(i("checkout-page:shipping"),t.step===s.SHIPPING,t.step===s.PAYMENT,t.step===s.PAYMENT?o.createElement("div",{className: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},i("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:a,stepContent:r,step:t.step,hasTopMargin:t.isCouponCodeRequirementOpen||t.campaignOffers&&!!t.campaignOffers.length&&t.isCampaignOfferLoaded,vm:t,isMobile:n})})),X=i((function(e){var t,i,r,n,a,s,c,l,d,p=e.vm,u=m().t,f=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=p.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=p.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.lastName)||"");return o.createElement("div",{className: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=i((function(e){var t=e.vm,i=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?i("checkout-page:free"):l(t.checkout.shippingLines[0].finalPrice,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),J=i((function(e){var t=e.vm,i=m().t;return o.createElement("div",{className:D.Footer},o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:D.FooterBullet},"•"),o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:D.FooterBullet},"•"),o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:D.FooterBullet},"•"),o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:D.FooterBullet},"•"),o.createElement("div",{className:D.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),Q=i((function(i){var r,n,a,s=i.vm,c=i.setVisible,l=m().t,d=o.useState(!1),p=d[0],u=d[1],f=o.useState(!1),g=f[0],v=f[1],h=o.useState(new E({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];h.email=(null===(r=s.checkout.customer)||void 0===r?void 0:r.email)||"",h.firstName=(null===(n=s.checkout.customer)||void 0===n?void 0:n.firstName)||"",h.lastName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.lastName)||"";var y=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return g?[2,c(!1)]:(u(!0),[4,h.saveContactForm()]);case 1:return e.sent()&&v(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(x,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,g&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(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=i((function(e){var t=e.vm,i=_(t),r=i.setActiveIndex,n=i.handlePrev,a=i.handleNext,s=i.activeIndex;return t.campaignOffers&&t.campaignOffers.length&&t.isCampaignOfferLoaded?o.createElement("div",{className:D.CampaignOfferMain},o.createElement("div",{className:D.OfferSlider},t.campaignOffers.map((function(e,i){var c;return o.createElement(A,{vm:t,campaignOffer:e,index:i,activeIndex:s,offersLength:(null===(c=t.campaignOffers)||void 0===c?void 0:c.length)||0,handlePrev:n,handleNext:a,setActiveIndex:function(e){return r(e)},desktopMiddlePhase:!0,step:t.step})}))),t.campaignOffers.length>1&&o.createElement(z,{handlePrev:n,handleNext:a}),t.campaignOffers.length>1&&o.createElement(U,{vm:t,activeIndex:s})):null})),$=i((function(e){var t=e.vm,i=_(t),r=i.setActiveIndex,n=i.setIsActiveOverlay,a=i.handlePrev,s=i.handleNext,c=i.isPopupClosedIndexPage,l=i.isPopupShowIndexPage,m=i.activeIndex;return t.campaignOffers&&t.campaignOffers.length&&t.isCampaignOfferLoaded?o.createElement("div",{className:[D.CampaignOfferMain,l?D.OverlayPopupMain:""].join(" ")},o.createElement("div",{className:D.OfferSlider},t.campaignOffers.map((function(e,i){var d;return o.createElement(A,{vm:t,campaignOffer:e,index:i,activeIndex:m,offersLength:(null===(d=t.campaignOffers)||void 0===d?void 0:d.length)||0,handlePrev:a,handleNext:s,setActiveIndex:function(e){return r(e)},step:t.step,isPopupClosed:c,isPopupShow:l,closePopup:function(){return n(!1)},showPopup:function(){return n(!0)}})}))),t.campaignOffers.length>1&&o.createElement(z,{handlePrev:a,handleNext:s}),t.campaignOffers.length>1&&o.createElement(U,{isPopupShow:l,vm:t,activeIndex:m})):null}));export{W as default};
|
|
@@ -9,7 +9,7 @@ import { TFunction } from "../../utils/i18n";
|
|
|
9
9
|
import { IkasCheckoutCustomizationProps } from ".";
|
|
10
10
|
import MasterPassModel from "./modelMasterPass";
|
|
11
11
|
import { APIResponse } from "@ikas/fe-api-client";
|
|
12
|
-
import { CreateStripePaymentIntentResponse, RetrieveInstallmentInfoResponse, UpdateCartCampaignOfferInput, CreateKlarnaTokenResponse, GetPaypalClientIdResponse, CreatePaypalOrderResponse, CreateAdyenPlatformSessionResponse, HepsipayFrameInitResponse } from "@ikas/storefront-api";
|
|
12
|
+
import { CreateStripePaymentIntentResponse, RetrieveInstallmentInfoResponse, UpdateCartCampaignOfferInput, CreateKlarnaTokenResponse, GetPaypalClientIdResponse, CreatePaypalOrderResponse, CreateAdyenPlatformSessionResponse, HepsipayFrameInitResponse, LoyaltyCustomerInfo, LoyaltyProgramSpendingMethod, LoyaltyProgramEarningMethod } from "@ikas/storefront-api";
|
|
13
13
|
import { IkasBaseStore } from "../../store";
|
|
14
14
|
import { RetrieveInstallmentInfoQueryParams, SaveCartInput } from "@ikas/storefront-api";
|
|
15
15
|
import { LocalizedAddressModel } from "@ikas/localized-address";
|
|
@@ -71,6 +71,11 @@ export default class CheckoutViewModel {
|
|
|
71
71
|
successTransaction?: IkasOrderTransaction;
|
|
72
72
|
successTransactions?: IkasOrderTransaction[];
|
|
73
73
|
storeCreditBalance?: IkasStoreCreditBalance | null;
|
|
74
|
+
loyaltyCustomerInfo?: LoyaltyCustomerInfo | null;
|
|
75
|
+
loyaltySpendingMethods?: LoyaltyProgramSpendingMethod[] | null;
|
|
76
|
+
loyaltySpendingMethodsAll?: LoyaltyProgramSpendingMethod[] | null;
|
|
77
|
+
loyaltyEarningMethod?: LoyaltyProgramEarningMethod | null;
|
|
78
|
+
isLoyaltyPointsVisible: boolean;
|
|
74
79
|
isMinTransactionError?: boolean;
|
|
75
80
|
mpVM: MasterPassModel;
|
|
76
81
|
showTestModal: boolean;
|
|
@@ -139,6 +144,7 @@ export default class CheckoutViewModel {
|
|
|
139
144
|
inStockDeliveryInputData: (input: SaveCartInput) => Promise<SaveCartInput>;
|
|
140
145
|
checkStocks: () => Promise<void>;
|
|
141
146
|
setIsKlarnaPaymentCompleted: (status: boolean) => Promise<void>;
|
|
147
|
+
setIsLoyaltyPointsVisible: (value: boolean) => void;
|
|
142
148
|
removeUnavailableItems: (items: IUnavailableItems[]) => Promise<void>;
|
|
143
149
|
getShippingCountries: () => Promise<void>;
|
|
144
150
|
getStockLocations: () => Promise<void>;
|
|
@@ -147,6 +153,9 @@ export default class CheckoutViewModel {
|
|
|
147
153
|
onDeliveryMethodChange: (deliveryMethod: "address" | "in-store") => void;
|
|
148
154
|
initialStockCheck: () => Promise<void>;
|
|
149
155
|
getStoreCreditBalance: () => Promise<void>;
|
|
156
|
+
getLoyaltyCustomerInfo: () => Promise<void>;
|
|
157
|
+
listSpendingMethodsByCartId: () => Promise<void>;
|
|
158
|
+
listEarningMethods: () => Promise<void>;
|
|
150
159
|
listPaymentGateways: () => Promise<void>;
|
|
151
160
|
retrieveInstallmentInfo: (params: RetrieveInstallmentInfoQueryParams) => Promise<void>;
|
|
152
161
|
createCustomer: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t,__assign as i}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import n from"lodash/cloneDeep";import r from"lodash/sortBy";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasCustomerEmailSubscriptionStatus as o,IkasCartCreatedBy as a,IkasCouponCodeRequirement as c,IkasCorporateInvoiceRequirement as d,IkasPaymentMethodType as u,IkasPaymentGatewayType as l,IkasOrderShippingMethod as h,IkasOrderStatus as p,IkasOrderPaymentStatus as m,IkasTransactionStatus as g,IkasCartCampaignOfferStatus as f,IkasCampaignOfferTargetPageType as v,IkasOrderLineItemStatus as y,IkasAmountType as S,IkasCampaignOfferProductApplicablePriceEnum as k}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import{IkasCheckout as b}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as P}from"../../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{IkasCustomerAddress as A}from"../../models/data/customer/address/index.js";import{IkasLocalizedCustomerAddress as C}from"../../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{IkasMerchantSettings as I}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import{IkasOrderCustomer as O}from"../../models/data/order/customer/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/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{IkasProductPrice as w}from"../../models/data/product/variant/price/index.js";import{IkasProductVariant as E}from"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import{IkasProduct as R}from"../../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{LocalizedAddressModel as N}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 T from"./components/credit-card-form/model.js";import j from"../../store/customer/api.js";import M from"../../store/checkout/index.js";import L from"../../store/cart/api.js";import G,{MFS_ELEMENT_ID as D,MFS_SCRIPT_URL as x}from"./modelMasterPass.js";import _ from"../../store/product/index.js";import{TransactionCardAssociationEnum as V,SaveCartInput as F,CheckStocksLineInput as U,CampaignOfferTargetPageTypeEnum as B}from"@ikas/storefront-api";import{IkasBaseStore as H}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{IkasStorefrontConfig as Y}from"@ikas/storefront-config";import{Analytics as K}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import Z from"../../models/data/order/address/ikas-localized-order-address.js";import W from"../../store/location/index.js";import{isEqual as q,getCookieValue as Q}from"../../utils/helper.js";import z from"../../analytics/ikasV3.js";var X,J,$=/^\d+$/,ee="undefined"==typeof localStorage,te=function(){function $(a,d,p,C,I,$,te,ne,re,oe){var ae=this;this.storefront=null,this.isCheckoutLoaded=!1,this.isErrorsVisible=!1,this.isStepLoading=!1,this.isTermsAndConditionsChecked=!1,this.isChangingShippingMethod=!1,this.isContactModalVisible=!1,this.isPaymentMethodVisible=!0,this.step=X.INFO,this.customizationProps=null,this.cardData=null,this.paymentGateways=[],this.productFiles=[],this.installmentInfo=null,this.useDifferentAddress=!1,this.shouldSaveAddress=!0,this.addressTitle="",this.shippingCountryIds=null,this.selectedShippingAddressId="-1",this.selectedBillingAddressId="-1",this.stockLocations=[],this.availableStockLocations=[],this.deliveryMethod="address",this.stripeResponse=null,this.stripeError=null,this.klarnaResponse=null,this.isKlarnaPaymentCompleted=!1,this.klarnaError=null,this.adyenResponse=null,this.payPalClientIdResponse=null,this.paypalOrderResponse=null,this.hepsipayFrameInitResponse=null,this.isCampaignOfferLoaded=!0,this.shippingZones=null,this.policyModalTitle="",this.policyModalText="",this.error=null,this.couponError=null,this.storeCreditBalance=null,this.showTestModal=!1,this.openEditOrderTransaction=null,this.previousRawValue="",this.previousBin=null,this.init=function(){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,this.countrySettings.waitUntilInitialized()];case 1:return t.sent(),[4,H.getInstance().customerStore.waitUntilInitialized()];case 2:return t.sent(),(e=this.isOpenEditOrder||this.checkout.edited)?[4,this.getOpenEditOrderTransaction()]:[3,4];case 3:t.sent(),t.label=4;case 4:return e&&(this.openEditOrderTransaction||this.checkout.edited)||this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.initStep()];case 5:return t.sent(),[2]}}))}))},this.initStep=function(){return e(ae,void 0,void 0,(function(){var e,s,n,r,o,a,d;return t(this,(function(t){switch(t.label){case 0:if(Y.getIsEditor())return this.step=X.INFO,this.isCheckoutLoaded=!0,[2];if(e=new URLSearchParams(window.location.search),s=e.get("step"),n=e.get("failed"),r=e.get("error"),s){if(this.step=s,this.step===X.SHIPPING&&!this.canProceedToShipping)return[2,this.changeStep(X.INFO)];if(this.step!==X.PAYMENT||this.canProceedToPayment){if(this.step===X.SUCCESS&&!this.canProceedToPayment)return[2,this.changeStep(X.INFO)];if(![X.INFO,X.SUCCESS,X.SHIPPING,X.PAYMENT].includes(this.step))return[2,this.changeStep(X.INFO)]}else{if(!this.isInStoreDelivery)return this.isValidShippingSettings||this.isManualOrderWithoutShippingLines?[2,this.changeStep(X.INFO)]:[2,this.changeStep(X.SHIPPING)];this.deliveryMethod="in-store"}}return[4,this.createCampaignOffer()];case 1:return t.sent(),this.step!==X.SHIPPING&&this.step!==X.PAYMENT||this.isCouponCodeRequirementInvisible||(this.checkoutSettings=new P(i(i({},this.checkoutSettings),{couponCodeRequirement:c.DEFAULT}))),this.step!==X.INFO?[3,7]:this.isDigitalOnly?[3,4]:[4,this.getAvailableShippingZones()];case 2:return t.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getShippingCountries()];case 3:t.sent(),this.checkShippingCountries(),t.label=4;case 4:return[4,this.getStockLocations()];case 5:return t.sent(),[4,this.getAvailableStockLocations()];case 6:t.sent(),this.isInStoreDelivery&&(this.deliveryMethod="in-store"),t.label=7;case 7:return this.step!==X.SHIPPING||1!==(null===(a=this.checkout.availableShippingMethods)||void 0===a?void 0:a.length)||this.checkoutSettings.isGiftPackageEnabled||(this.step=X.PAYMENT,this.router.replace("/checkout?id=".concat(this.checkout.id,"&step=").concat(this.step),void 0,{shallow:!0})),this.step!==X.SHIPPING||(null===(d=this.checkout.availableShippingMethods)||void 0===d?void 0:d.length)?this.step!==X.SUCCESS||this.checkout.orderPaymentStatus!==m.PAID?[3,9]:[4,this.listProductFile()]:(this.error={type:J.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2]);case 8:t.sent(),t.label=9;case 9:return this.step!==X.PAYMENT&&this.step!==X.SUCCESS?[3,15]:[4,this.listPaymentGateways()];case 10:return t.sent(),this.checkout.hasCustomer?[4,this.getStoreCreditBalance()]:[3,12];case 11:t.sent(),t.label=12;case 12:return this.isInStoreDelivery?(this.deliveryMethod="in-store",[4,this.getStockLocations()]):[3,14];case 13:t.sent(),t.label=14;case 14:if(!this.paymentGateways.length&&!this.isFree)return this.error={type:J.NO_SHIPPING_ERROR},this.isMinTransactionError&&(this.error={type:J.API_ERROR,data:this.t("checkout-page:minTransactionErrorMessage",{value:200})}),this.isCheckoutLoaded=!0,[2];t.label=15;case 15:return this.step===X.SUCCESS?[3,19]:this.isOpenEditOrder?[3,18]:this.checkout.isComplete?[2,this.changeStep(X.SUCCESS)]:[3,16];case 16:return[4,this.initialStockCheck()];case 17:t.sent(),t.label=18;case 18:return[3,21];case 19:return[4,this.getSuccessTransaction()];case 20:t.sent(),this.successTransaction&&(o=this.successTransaction.paymentGatewayId,this.checkout.selectedPaymentGateway=this.paymentGateways.find((function(e){return e.id===o}))),t.label=21;case 21:return n&&(this.error={type:J.PAYMENT_ERROR,data:r||null}),this.isCheckoutLoaded=!0,K.checkoutStep(this.checkout,this.step,this.checkoutSettings),[2]}}))}))},this.getOpenEditOrderTransaction=function(){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,j.listOrderTransactionsWithPrices({input:{orderId:this.checkout.id}})];case 1:return(e=t.sent()).isSuccess&&e.data&&e.data.chargedAmount&&(this.openEditOrderTransaction=e.data),[2]}}))}))},this.getSuccessTransaction=function(){return e(ae,void 0,void 0,(function(){var e,i,s;return t(this,(function(t){switch(t.label){case 0:return[4,j.listOrderTransactions({orderId:{eq:this.checkout.id}})];case 1:return e=t.sent(),this.successTransactions=e.isSuccess&&(null===(i=e.data)||void 0===i?void 0:i.length)?e.data:[],this.successTransaction=e.isSuccess&&(null===(s=e.data)||void 0===s?void 0:s.length)?e.data[e.data.length-1]:void 0,[2]}}))}))},this.saveCart=function(){return e(ae,void 0,void 0,(function(){var e,i,s,n,r,a,c,d,u,l,h,p,m,g,f,v,y;return t(this,(function(t){switch(t.label){case 0:return e=new F(this.checkout),"in-store"!==this.deliveryMethod?[3,2]:[4,this.inStockDeliveryInputData(e)];case 1:e=t.sent(),t.label=2;case 2:return this.step!==X.INFO&&this.step!==X.SHIPPING&&this.step!==X.PAYMENT||this.isDigitalOnly||(this.isShowBillingAddressOnShippingStep||this.step===X.PAYMENT||(e.billingAddress=null),e.billingAddress&&(this.isShowBillingAddressOnShippingStep&&this.useDifferentAddress||this.useDifferentAddress&&!this.isShowBillingAddressOnShippingStep&&this.checkoutSettings.showCompanyInfoInShippingAddress)&&(e.billingAddress.company=(null===(n=e.shippingAddress)||void 0===n?void 0:n.company)||null,e.billingAddress.taxNumber=(null===(r=e.shippingAddress)||void 0===r?void 0:r.taxNumber)||null,e.billingAddress.taxOffice=(null===(a=e.shippingAddress)||void 0===a?void 0:a.taxOffice)||null)),this.isDigitalOnly&&(e.shippingAddress=null),e.customer&&(this.store.customerStore.customer?e.customer.notificationsAccepted=this.store.customerStore.customer.subscriptionStatus===o.SUBSCRIBED:this.checkout.customer&&(e.customer.notificationsAccepted=this.checkout.customer.notificationsAccepted||!1)),null===(null===(d=null===(c=e.shippingAddress)||void 0===c?void 0:c.city)||void 0===d?void 0:d.code)&&""===(null===(l=null===(u=e.shippingAddress)||void 0===u?void 0:u.city)||void 0===l?void 0:l.name)&&(e.shippingAddress.city.name="-"),null===(null===(p=null===(h=e.billingAddress)||void 0===h?void 0:h.city)||void 0===p?void 0:p.code)&&""===(null===(g=null===(m=e.billingAddress)||void 0===m?void 0:m.city)||void 0===g?void 0:g.name)&&(e.billingAddress.city.name="-"),[4,L.saveCart({input:e})];case 3:if((null==(i=t.sent())?void 0:i.graphQLErrors)&&i.graphQLErrors.length)throw s=i.graphQLErrors[0],"CUSTOMER_LOGIN_REQUIRED"===(null===(f=s.extensions)||void 0===f?void 0:f.code)?{type:J.CUSTOMER_LOGIN_REQUIRED_ERROR}:"CUSTOMER_ACCOUNT_DISABLED"===(null===(v=s.extensions)||void 0===v?void 0:v.code)?{type:J.CUSTOMER_ACCOUNT_DISABLED_ERROR}:"ARGUMENT_VALIDATION_ERROR"===(null===(y=s.extensions)||void 0===y?void 0:y.code)?{type:J.ARGUMENT_VALIDATION_ERROR,data:s.extensions.validationErrors}:{type:J.API_ERROR,data:i.firstErrorMessage};return[2,i.data]}}))}))},this.inStockDeliveryInputData=function(i){return e(ae,void 0,void 0,(function(){var e,s,n=this;return t(this,(function(t){return e=i,(s=this.stockLocations.find((function(e){return e.id===n.checkout.stockLocationId})))&&e.shippingAddress&&s.address&&(e.shippingAddress.country=s.address.country,e.shippingAddress.city=s.address.city,e.shippingAddress.state=s.address.state,e.shippingAddress.district=s.address.district,e.shippingAddress.postalCode=s.address.postalCode,e.shippingAddress.addressLine1=s.address.address||"",e.shippingAddress.addressLine2=null),[2,e]}))}))},this.checkStocks=function(){return e(ae,void 0,void 0,(function(){var e,i,s,n,r,o,a,c,d,u,l,p,m,g;return t(this,(function(t){switch(t.label){case 0:return this.isManualOrder||this.isOpenEditOrderWithTransaction?[2]:(e=this.checkout.stockLocationId&&this.checkout.shippingMethod===h.CLICK_AND_COLLECT?[this.checkout.stockLocationId]:(null===(p=Y.getStockLocationIds())||void 0===p?void 0:p.length)?Y.getStockLocationIds():null,[4,M.checkCartStocks({cartId:this.checkout.id,stockLocationIdList:e})]);case 1:if(!(i=t.sent()).isSuccess)throw s="UPSELL"===this.checkout.createdBy,n=s?this.t("checkout-page:upsellTimeErrorMessage"):i.firstErrorMessage,{type:J.API_ERROR,data:n};if(null==(r=null===(g=null===(m=i.data)||void 0===m?void 0:m.lines)||void 0===g?void 0:g.filter((function(e){return!e.isAvailable})))?void 0:r.length){for(o=[],a=function(e){var t=c.checkout.items.find((function(t){return t.variant.id===e.variantId}));t&&o.push({item:t,stockCount:e.stockCount})},c=this,d=0,u=r;d<u.length;d++)l=u[d],a(l);throw{type:J.STOCK_ERROR,data:o}}return[2]}}))}))},this.setIsKlarnaPaymentCompleted=function(i){return e(ae,void 0,void 0,(function(){return t(this,(function(e){return this.isKlarnaPaymentCompleted=i,[2]}))}))},this.removeUnavailableItems=function(i){return e(ae,void 0,void 0,(function(){var e,s,n;return t(this,(function(t){switch(t.label){case 0:e=0,s=i,t.label=1;case 1:return e<s.length?(n=s[e],[4,H.getInstance().cartStore.changeItemQuantity(n.item,n.stockCount<0?0:n.stockCount)]):[3,4];case 2:t.sent(),t.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},this.getShippingCountries=function(){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.getAvailableShippingCountries({salesChannelId:Y.getSalesChannelId()})];case 1:return e=t.sent(),this.shippingCountryIds=e.data,[2]}}))}))},this.getStockLocations=function(){return e(ae,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return Y.getPickupStockLocationIds()?[4,M.listStockLocation({id:{in:Y.getPickupStockLocationIds()}})]:[3,2];case 1:if(!(e=t.sent()).isSuccess||!(null===(i=e.data)||void 0===i?void 0:i.length))return this.error={type:J.API_ERROR,data:e.firstErrorMessage},[2];this.stockLocations=e.data,t.label=2;case 2:return[2]}}))}))},this.getAvailableStockLocations=function(){return e(ae,void 0,void 0,(function(){var e,i,s,n=this;return t(this,(function(t){switch(t.label){case 0:return Y.getPickupStockLocationIds()?(e=this.checkout.items.map((function(e){return{quantity:e.quantity,variantId:e.variant.id,productId:e.variant.productId}})),[4,M.getAvailableStockLocations({lines:e.map((function(e){return new U(e)})),stockLocationIdList:Y.getPickupStockLocationIds(),cartId:this.checkout.id})]):[3,2];case 1:if(!(i=t.sent()).isSuccess)return this.error={type:J.API_ERROR},[2];s=Y.getCurrentRouting(),this.availableStockLocations=(i.data||[]).filter((function(e){var t,i,r,o;return(null===(i=null===(t=e.address)||void 0===t?void 0:t.country)||void 0===i?void 0:i.id)&&e.address.country.iso2&&(null===(r=n.shippingCountryIds)||void 0===r?void 0:r.includes(e.address.country.id))&&(!(null===(o=null==s?void 0:s.countryCodes)||void 0===o?void 0:o.length)||s.countryCodes.includes(e.address.country.iso2))})),t.label=2;case 2:return[2]}}))}))},this.checkShippingCountries=function(){var e;(null===(e=ae.shippingCountryIds)||void 0===e?void 0:e.length)||(ae.error={type:J.NO_SHIPPING_ERROR})},this.onDeliveryMethodChange=function(e){var t;ae.deliveryMethod!==e&&("address"===e&&(ae.checkout.stockLocationId=null,(null===(t=ae.customerAddresses)||void 0===t?void 0:t.length)?ae.onSelectedShippingAddressIdChange(ae.customerAddresses[0].id||"-1"):(ae.checkout.shippingAddress=new Z,ae.checkout.shippingAddress.countrySettings=ae.countrySettings,ae.checkout.shippingAddress.checkoutSettings=ae.checkoutSettings,ae.checkout.shippingAddress.shippingZones=ae.shippingZones)),ae.deliveryMethod=e,ae.isErrorsVisible=!1)},this.initialStockCheck=function(){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.checkStocks()];case 1:return t.sent(),[3,3];case 2:return void 0!==typeof(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:J.UNKNOWN}),[3,3];case 3:return[2]}}))}))},this.getStoreCreditBalance=function(){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.getStoreCreditBalance()];case 1:return e=t.sent(),this.storeCreditBalance=e.data,[2]}}))}))},this.listPaymentGateways=function(){return e(ae,void 0,void 0,(function(){var e,i,s,n,o,a,c,d,u,l,h,p,m,g,f,v=this;return t(this,(function(t){switch(t.label){case 0:return e="local"===process.env.NEXT_PUBLIC_ENV,i=Y.getPaymentGateways().map((function(e){return e.id})),[4,M.listPaymentGateway({cartId:this.checkout.id,id:e?void 0:{in:i},locale:Y.getCurrentLocale(),transactionAmount:this.checkout.totalFinalPrice})];case 1:return(s=t.sent()).isSuccess?(null===(p=s.data)||void 0===p?void 0:p.length)||this.isFree?(this.error=void 0,n=null===(m=s.data)||void 0===m?void 0:m.some((function(e){return"IKAS_WALLET"===e.code})),this.isMinTransactionError=n&&this.finalPrice<200&&!this.isDigitalOnly,this.isMinTransactionError?[2]:(o=s.data||[],this.step===X.PAYMENT&&(o=o.filter((function(e){var t;return!(null===(t=e.supportedCurrencies)||void 0===t?void 0:t.length)||e.supportedCurrencies.includes(v.checkout.currencyCode)})),(a=null===(g=this.checkout.shippingAddress)||void 0===g?void 0:g.country)&&a.iso2&&(o=o.filter((function(e){var t;return!(null===(t=e.availableCountries)||void 0===t?void 0:t.length)||e.availableCountries.includes(a.iso2||"")}))),c=null===(f=this.checkout.billingAddress)||void 0===f?void 0:f.country,!a&&c&&c.iso2&&(o=o.filter((function(e){var t;return!(null===(t=e.availableCountries)||void 0===t?void 0:t.length)||e.availableCountries.includes(c.iso2||"")})))),d=[],r(Y.getPaymentGateways(),"order").forEach((function(e){var t=null==o?void 0:o.find((function(t){return t.id===e.id}));t&&d.push(t)})),this.paymentGateways=e?o:d,u=this.paymentGateways.findIndex((function(e){return"ADYEN_PLATFORM"===e.code})),this.checkout.selectedPaymentGateway&&this.paymentGateways.some((function(e){var t;return e.id===(null===(t=v.checkout.selectedPaymentGateway)||void 0===t?void 0:t.id)}))?[3,2]:(this.setPaymentGateway(-1!==u?u:0),[3,4]))):(this.error={type:J.NO_SHIPPING_ERROR},[2]):(this.error={type:J.API_ERROR,data:s.firstErrorMessage},[2]);case 2:return this.step!==X.PAYMENT?[3,4]:[4,this.updatePaymentGateway(this.checkout.selectedPaymentGateway)];case 3:t.sent(),t.label=4;case 4:return this.step===X.PAYMENT&&(l=o.find((function(e){return!!e.masterPassClientId})))&&(this.checkout.masterPassPaymentGateway=l,(h=document.createElement("script")).id=D,h.src=x,h.onload=function(){v.mpVM.checkMasterPass({checkout:v.checkout,store:H.getInstance()})},document.head.appendChild(h)),[2]}}))}))},this.retrieveInstallmentInfo=function(i){return e(ae,void 0,void 0,(function(){var e,s,n;return t(this,(function(t){switch(t.label){case 0:return[4,M.retrieveInstallmentInfo(i)];case 1:return e=t.sent(),s=e.data,null===(n=null==s?void 0:s.installmentPrices)||void 0===n||n.sort((function(e,t){return(e.installmentCount||-1)>(t.installmentCount||-1)?1:-1})),this.installmentInfo=s,[2]}}))}))},this.createCustomer=function(){var e;ae.store.customerStore.customer?(null===(e=ae.customerAddresses)||void 0===e||e.forEach((function(e){e.checkoutSettings=ae.checkoutSettings,e.shippingZones=ae.shippingZones})),ae.checkout.customer=new O(i(i({},ae.store.customerStore.customer),{notificationsAccepted:ae.store.customerStore.customer.subscriptionStatus===o.SUBSCRIBED}))):ae.checkout.customer=new O(ae.checkout.customer||{})},this.setCheckoutShippingAddressSettings=function(){ae.checkout.shippingAddress&&(ae.checkout.shippingAddress.checkoutSettings=ae.checkoutSettings,ae.checkout.shippingAddress.shippingZones=ae.shippingZones,ae.checkout.shippingAddress.countrySettings=ae.countrySettings,ae.checkout.shippingAddress.getValidatedCustomerAddress())},this.setCheckoutBillingAddressSettings=function(){ae.checkout.billingAddress&&(ae.checkout.billingAddress.checkoutSettings=ae.checkoutSettings,ae.checkout.billingAddress.shippingZones=ae.shippingZones,ae.checkout.billingAddress.countrySettings=ae.countrySettings,ae.checkout.billingAddress.getValidatedCustomerAddress())},this.createShippingAddress=function(){if(!ae.isDigitalOnly)if(ae.isInStoreDelivery)ae.setCheckoutShippingAddressSettings();else if(ae.checkout.shippingAddress){if(ae.store.customerStore.customer){var e=null==(t=ae.customerAddresses)?void 0:t.find((function(e){var t;return e.id===(null===(t=ae.checkout.shippingAddress)||void 0===t?void 0:t.id)}));if(e)return ae.onSelectedShippingAddressIdChange(e.id||"-1"),void ae.setCheckoutShippingAddressSettings()}ae.checkout.shippingAddress=new Z(n(ae.checkout.shippingAddress)||{}),ae.setCheckoutShippingAddressSettings()}else if(ae.store.customerStore.customer){var t=ae.customerAddresses;ae.onSelectedShippingAddressIdChange((null==t?void 0:t.length)?t[0].id:"-1")}else ae.onSelectedShippingAddressIdChange("-1")},this.createBillingAddress=function(){if("undefined"!=typeof localStorage)if(ae.useDifferentAddress=!!localStorage.getItem("sAddr"),ae.checkout.billingAddress){if(ae.store.customerStore.customer){var e=null==(t=ae.customerAddresses)?void 0:t.find((function(e){var t;return e.id===(null===(t=ae.checkout.billingAddress)||void 0===t?void 0:t.id)}));if(e)return ae.onSelectedBillingAddressIdChange(e.id||"-1"),void ae.setCheckoutBillingAddressSettings()}ae.checkout.billingAddress=new Z(n(ae.checkout.billingAddress)||{}),ae.setCheckoutBillingAddressSettings()}else if(ae.store.customerStore.customer){var t=ae.customerAddresses;ae.onSelectedBillingAddressIdChange((null==t?void 0:t.length)?t[0].id:"-1"),(null==t?void 0:t.length)||ae.useDifferentAddress||!ae.checkout.shippingAddress||ae.isInStoreDelivery||(ae.checkout.billingAddress=new Z(n(ae.checkout.shippingAddress)),ae.setCheckoutBillingAddressSettings())}else ae.onSelectedBillingAddressIdChange("-1"),ae.useDifferentAddress||!ae.checkout.shippingAddress||ae.isInStoreDelivery||(ae.checkout.billingAddress=new Z(n(ae.checkout.shippingAddress)),ae.setCheckoutBillingAddressSettings())},this.onShippingMethodChange=function(i){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.isChangingShippingMethod?[2]:(this.isChangingShippingMethod=!0,this.checkout.shippingSettingsId=i.shippingSettingsId,this.checkout.shippingZoneRateId=i.shippingZoneRateId,[4,this.saveCart()]);case 1:return(e=t.sent())&&(this.checkout=new b(e,this.countrySettings)),this.checkout.shippingAddress&&(this.checkout.shippingAddress.checkoutSettings=this.checkoutSettings,this.checkout.shippingAddress.shippingZones=this.shippingZones),this.isChangingShippingMethod=!1,[2]}}))}))},this.onStockLocationChange=function(i){return e(ae,void 0,void 0,(function(){return t(this,(function(e){return this.checkout.stockLocationId=i.id,[2]}))}))},this.onCouponCodeApply=function(s){return e(ae,void 0,void 0,(function(){var e,n,r,o,a,c;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,8,,9]),[4,L.saveCartCouponCode({cartId:this.checkout.id,couponCode:this.checkout.couponCode||null})];case 1:return(e=t.sent()).isSuccess&&e.data?(n=e.data,r=null===(c=null===(a=this.cardData)||void 0===a?void 0:a.cardNumber)||void 0===c?void 0:c.split(" ").join(""),this.couponError=null,this.step===X.PAYMENT&&(null==r?void 0:r.length)&&r.length>=6&&this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:r.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:n.totalFinalPrice,currencyCode:this.checkout.currencyCode}}),this.mpVM.selectedCard&&this.mpVM.selectedCard.Value1?[4,this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:this.mpVM.selectedCard.Value1.slice(0,6),paymentGatewayId:this.mpVM.selectedCard.paymentGatewayId,price:n.totalFinalPrice,currencyCode:this.checkout.currencyCode}})]:[3,3]):[3,7];case 2:t.sent(),t.label=3;case 3:return n?(o=this.checkout,this.checkout=new b(i(i({},n),{shippingAddress:this.checkout.shippingAddress,billingAddress:this.checkout.billingAddress,customer:this.checkout.customer,selectedPaymentGateway:this.checkout.selectedPaymentGateway}),this.countrySettings),this.step!==X.PAYMENT||this.checkout.totalFinalPrice===o.totalFinalPrice&&!this.checkout.giftCardLines?[3,5]:[4,this.listPaymentGateways()]):[3,7];case 4:t.sent(),t.label=5;case 5:return this.checkout.campaignOffers=n.campaignOffers,this.isCampaignOfferLoaded=!1,[4,this.createCampaignOffer()];case 6:t.sent(),this.isCampaignOfferLoaded=!0,s?K.addCouponCode(n):K.removeCouponCode(n),t.label=7;case 7:return e.isSuccess||(this.couponError=e.errorCodes[0]),[3,9];case 8:return t.sent(),[3,9];case 9:return[2]}}))}))},this.removeGiftCardLine=function(s){return e(ae,void 0,void 0,(function(){var e,n,r,o,a;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,8,,9]),[4,L.removeGiftCardFromCart({cartId:this.checkout.id,giftCardId:s})];case 1:return(e=t.sent()).isSuccess&&e.data?(n=e.data,r=null===(a=null===(o=this.cardData)||void 0===o?void 0:o.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.couponError=null,this.step===X.PAYMENT&&(null==r?void 0:r.length)&&r.length>=6&&this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:r.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:n.totalFinalPrice,currencyCode:this.checkout.currencyCode}}),this.mpVM.selectedCard&&this.mpVM.selectedCard.Value1?[4,this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:this.mpVM.selectedCard.Value1.slice(0,6),paymentGatewayId:this.mpVM.selectedCard.paymentGatewayId,price:n.totalFinalPrice,currencyCode:this.checkout.currencyCode}})]:[3,3]):[3,7];case 2:t.sent(),t.label=3;case 3:return n?(this.checkout,this.checkout=new b(i(i({},n),{shippingAddress:this.checkout.shippingAddress,billingAddress:this.checkout.billingAddress,customer:this.checkout.customer,selectedPaymentGateway:this.checkout.selectedPaymentGateway}),this.countrySettings),this.step!==X.PAYMENT?[3,5]:[4,this.listPaymentGateways()]):[3,7];case 4:t.sent(),t.label=5;case 5:return this.checkout.campaignOffers=n.campaignOffers,this.isCampaignOfferLoaded=!1,[4,this.createCampaignOffer()];case 6:t.sent(),this.isCampaignOfferLoaded=!0,t.label=7;case 7:return[3,9];case 8:return t.sent(),[3,9];case 9:return[2]}}))}))},this.removeLoyaltyPointsFromCart=function(s){return e(ae,void 0,void 0,(function(){var e,n,r,o,a;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,8,,9]),[4,L.removeLoyaltyPointsFromCart({cartId:this.checkout.id,loyaltySpendingMethodId:s})];case 1:return(e=t.sent()).isSuccess&&e.data?(n=e.data,r=null===(a=null===(o=this.cardData)||void 0===o?void 0:o.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.couponError=null,this.step===X.PAYMENT&&(null==r?void 0:r.length)&&r.length>=6&&this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:r.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:n.totalFinalPrice,currencyCode:this.checkout.currencyCode}}),this.mpVM.selectedCard&&this.mpVM.selectedCard.Value1?[4,this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:this.mpVM.selectedCard.Value1.slice(0,6),paymentGatewayId:this.mpVM.selectedCard.paymentGatewayId,price:n.totalFinalPrice,currencyCode:this.checkout.currencyCode}})]:[3,3]):[3,7];case 2:t.sent(),t.label=3;case 3:return n?(this.checkout,this.checkout=new b(i(i({},n),{shippingAddress:this.checkout.shippingAddress,billingAddress:this.checkout.billingAddress,customer:this.checkout.customer,selectedPaymentGateway:this.checkout.selectedPaymentGateway}),this.countrySettings),this.step!==X.PAYMENT?[3,5]:[4,this.listPaymentGateways()]):[3,7];case 4:t.sent(),t.label=5;case 5:return this.checkout.campaignOffers=n.campaignOffers,this.isCampaignOfferLoaded=!1,[4,this.createCampaignOffer()];case 6:t.sent(),this.isCampaignOfferLoaded=!0,K.removeLoyaltyPoints(n),t.label=7;case 7:return[3,9];case 8:return t.sent(),[3,9];case 9:return[2]}}))}))},this.getAvailableShippingZones=function(){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,W.getAvailableShippingZones({salesChannelId:Y.getSalesChannelId()})];case 1:return e=t.sent(),this.shippingZones=e.data||null,[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))}))},this.onSelectedShippingAddressIdChange=function(e){var t;if(ae.selectedShippingAddressId=e,"-1"===e)ae.checkout.shippingAddress=new Z,ae.checkout.shippingAddress.countrySettings=ae.countrySettings;else{var i=null===(t=ae.customerAddresses)||void 0===t?void 0:t.find((function(t){return t.id===e}));i&&(ae.checkout.shippingAddress=new Z(i),ae.checkout.shippingAddress.countrySettings=ae.countrySettings)}ae.checkout.shippingAddress&&(ae.checkout.shippingAddress.checkoutSettings=ae.checkoutSettings,ae.checkout.shippingAddress.shippingZones=ae.shippingZones)},this.onSelectedBillingAddressIdChange=function(e){var t;if(ae.selectedBillingAddressId=e,"-1"===e)ae.checkout.billingAddress=new Z,ae.checkout.billingAddress.countrySettings=ae.countrySettings;else{var i=null===(t=ae.customerAddresses)||void 0===t?void 0:t.find((function(t){return t.id===e}));i&&(ae.checkout.billingAddress=new Z(i),ae.checkout.billingAddress.countrySettings=ae.countrySettings)}ae.checkout.billingAddress&&(ae.checkout.billingAddress.checkoutSettings=ae.checkoutSettings,ae.checkout.billingAddress.shippingZones=ae.shippingZones)},this.onTermsAndConditionsCheckedChange=function(e){ae.isTermsAndConditionsChecked=e},this.onCardNumberChange=function(e){var t;if(ae.cardData){var i=(e||"").replace(/\D/g,""),s=ae.previousRawValue,n=i.slice(0,6),r=ae.previousBin;if(!(i.length>16)){var o=s.length<6&&i.length>=6,a=6===n.length&&n!==r;(o||a)&&6===n.length&&(ae.getRetrieveInstallmentInfo(i),ae.previousBin=n),i.length<6&&s.length>=6&&(ae.cardData.installmentCount=1,ae.installmentInfo=void 0,ae.previousBin=null),(null===(t=ae.installmentInfo)||void 0===t?void 0:t.cardAssociation)===V.AMERICAN_EXPRESS?ae.cardData.cardNumber=function(e){var t=[],i=e.slice(0,4),s=e.slice(4,10),n=e.slice(10,15);i&&t.push(i);s&&t.push(s);n&&t.push(n);return t}(i).join(" "):ae.cardData.cardNumber=ie(i,4).join(" "),ae.previousRawValue=i}}},this.getRetrieveInstallmentInfo=function(i){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:i.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:this.checkout.totalFinalPrice,currencyCode:this.checkout.currencyCode}})];case 1:return t.sent(),(null===(e=this.cardData)||void 0===e?void 0:e.cardNumber)&&this.onCardNumberChange(this.cardData.cardNumber),[2]}}))}))},this.onCardHolderNameChange=function(e){ae.cardData&&(ae.cardData.cardHolderName=e)},this.onExpirationDateChange=function(e){var t;if(ae.cardData&&(!(e.length>ae.cardData.expirationDate.length)||se(e))){if(0===(null===(t=ae.cardData.expirationDate)||void 0===t?void 0:t.length)){var i=e.replace(".","/").split("/");if(2===i.length){var s=i[0].trim(),n=i[1].trim();if(4===s.length&&2===n.length){var r=parseInt(s.slice(2)),o=parseInt(n);if(!isNaN(r)&&!isNaN(o))return void(ae.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&4===n.length){o=parseInt(s),r=parseInt(n.slice(2));if(!isNaN(r)&&!isNaN(o))return void(ae.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&2===n.length){var a=parseInt(s),c=parseInt(n);o=a<=12?a:c,r=c>12?c:a;if(!isNaN(r)&&!isNaN(o))return void(ae.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}}}var d=e.split(" / ").join("");d.length>4||(ae.cardData.expirationDate=ie(d,2).join(" / "))}},this.onCvcChange=function(e){if(ae.cardData&&(!(e.length>ae.cardData.cvv.length)||se(e))){if(ae.installmentInfo){if(ae.installmentInfo.cardAssociation===V.AMERICAN_EXPRESS&&e.length>4)return;if(ae.installmentInfo.cardAssociation!==V.AMERICAN_EXPRESS&&e.length>3)return}else if(e.length>3)return;ae.cardData.cvv=e}},this.saveAddress=function(s){return e(ae,void 0,void 0,(function(){var e,r,o,a,c,d,u,l,h,p,m,g,f=this;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),this.shouldSaveAddress&&this.store.customerStore.customer?(e="shipping"===s?this.checkout.shippingAddress:this.checkout.billingAddress,(null===(h=this.customerAddresses)||void 0===h?void 0:h.find((function(t){return t.id===(null==e?void 0:e.id)})))?[2]:(r=null===(p=this.customerAddresses)||void 0===p?void 0:p.map((function(e){return e.id})),o=new A(i(i({},e),{title:this.addressTitle||this.t("checkout-page:newAddress")})),(a=n(this.store.customerStore.customer)).addresses||(a.addresses=[]),a.addresses.push(o),[4,this.store.customerStore.saveCustomer(a)])):[3,2];case 1:t.sent(),null===(m=this.customerAddresses)||void 0===m||m.forEach((function(e){e.checkoutSettings=f.checkoutSettings,e.shippingZones=f.shippingZones})),c=null===(g=this.customerAddresses)||void 0===g?void 0:g.map((function(e){return e.id})),d=null==c?void 0:c.filter((function(e){return!(null==r?void 0:r.includes(e))})),u=(null==d?void 0:d.length)?d[0]:void 0,"shipping"===s?(this.checkout.shippingAddress.id=u||"",this.selectedShippingAddressId=u||"-1"):(this.checkout.billingAddress.id=u||"",this.selectedBillingAddressId=u||"-1"),t.label=2;case 2:return[3,4];case 3:return l=t.sent(),console.error(l),[3,4];case 4:return[2]}}))}))},this.getRoutingPath=function(){var e=Y.getCurrentRouting();return(null==e?void 0:e.path)?"/".concat(e.path):""},this.getGoToCartHref=function(){var e=ae.getRoutingPath();return"".concat(e,"/cart")},this.getBackToShoppingHref=function(){var e=ae.getRoutingPath();return"".concat(e,"/")},this.getGoToLoginHref=function(){var e=ae.getRoutingPath();return"".concat(e)+"/account/login?redirect="+encodeURIComponent(ae.checkoutUrl)},this.onHandleBillingAddressOnShippingStep=function(){return e(ae,void 0,void 0,(function(){return t(this,(function(e){return this.isShowBillingAddressOnShippingStep&&!this.useDifferentAddress&&("address"===this.deliveryMethod&&this.checkout.shippingAddress?this.checkout.billingAddress=new Z(i({},this.checkout.shippingAddress)):this.checkout.billingAddress=new Z(i({},this.checkout.billingAddress))),[2]}))}))},this.onProceedToShippingClick=function(){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.isShowBillingAddressOnShippingStep?[4,this.onHandleBillingAddressOnShippingStep()]:[3,2];case 1:t.sent(),t.label=2;case 2:if("address"===this.deliveryMethod){if(!this.canProceedToShipping)return this.isErrorsVisible=!0,[2]}else if(!this.canProceedToInStoreDelivery)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,t.label=3;case 3:return t.trys.push([3,10,,11]),this.isStepLoading=!0,"address"!==this.deliveryMethod||this.isShowBillingAddressOnShippingStep?[3,5]:[4,this.saveAddress("shipping")];case 4:t.sent(),t.label=5;case 5:return this.isShowBillingAddressOnShippingStep?[4,this.saveAddress("billing")]:[3,7];case 6:t.sent(),t.label=7;case 7:return[4,this.checkStocks()];case 8:return t.sent(),[4,this.saveCart()];case 9:return t.sent(),this.isManualOrderWithShippingLines?[2,this.changeStep(X.PAYMENT)]:("address"===this.deliveryMethod?this.changeStep(X.SHIPPING):this.changeStep(X.PAYMENT),[3,11]);case 10:return void 0!==typeof(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:J.UNKNOWN}),this.isStepLoading=!1,[3,11];case 11:return[2]}}))}))},this.onProceedToDigitalOnlyPaymentClick=function(){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.isShowBillingAddressOnShippingStep?[4,this.onHandleBillingAddressOnShippingStep()]:[3,2];case 1:t.sent(),t.label=2;case 2:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,t.label=3;case 3:return t.trys.push([3,6,,7]),this.isStepLoading=!0,[4,this.checkStocks()];case 4:return t.sent(),[4,this.saveCart()];case 5:return t.sent(),this.changeStep(X.PAYMENT),[3,7];case 6:return(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:J.UNKNOWN}),this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.onProceedToPaymentClick=function(){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,t.label=1;case 1:return t.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return t.sent(),[4,this.saveCart()];case 3:return t.sent(),this.error=void 0,this.changeStep(X.PAYMENT),[3,5];case 4:return void 0!==typeof(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:J.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.checkPaypalButtonAvailable=function(){return!!ae.canPerformPayment||(ae.isErrorsVisible=!0,!1)},this.handlePaymentError=function(e,t){ae.error={type:e,data:t}},this.onCompletePaymentClick=function(){return e(ae,void 0,void 0,(function(){var e,i,s,n,r,o,a,c;return t(this,(function(t){switch(t.label){case 0:return this.canPerformPayment?(this.useDifferentAddress||(this.checkout.billingAddress=this.checkout.shippingAddress),this.isFree||!this.isKlarna?[3,2]:[4,this.saveCart()]):(this.isErrorsVisible=!0,[2]);case 1:return t.sent(),this.setIsKlarnaPaymentCompleted(!0),[2];case 2:if(this.isFree||!this.isHepsiPay)return[3,9];t.label=3;case 3:return t.trys.push([3,7,,8]),window.HepsipaySdk&&(null===(o=this.hepsipayFrameInitResponse)||void 0===o?void 0:o.frameUrl)?(this.isStepLoading=!0,[4,this.saveCart()]):[3,5];case 4:return t.sent(),window.HepsipaySdk.initPayment(),[3,6];case 5:console.error("HepsipaySdk is not available"),t.label=6;case 6:return[3,8];case 7:return t.sent(),this.isStepLoading=!1,[2];case 8:return[2];case 9:return t.trys.push([9,15,,16]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 10:return t.sent(),"address"===this.deliveryMethod&&this.useDifferentAddress?[4,this.saveAddress("billing")]:[3,12];case 11:t.sent(),t.label=12;case 12:return[4,this.saveCart()];case 13:return e=t.sent(),this.checkout.shippingMethod===h.SHIPMENT&&(i=null!==(a=null==e?void 0:e.availableShippingMethods)&&void 0!==a?a:[],s=null!==(c=this.checkout.availableShippingMethods)&&void 0!==c?c:[],!q(i,s))?(this.changeStep(X.SHIPPING),[2]):!this.isFree&&this.isCustomFlowStripe?((n=document.querySelector("#stripe-form-btn"))&&n.click(),[2]):!this.isFree&&this.isAdyen?(this.adyenDropinElement.submit(),this.adyenDropinElement.isValid||(this.isStepLoading=!1),[2]):!this.isFree&&this.isPayPal?[2]:[4,this.createSaleTransaction()];case 14:return t.sent(),[3,16];case 15:return void 0!==typeof(r=t.sent()).type?this.error=r:this.error={type:J.UNKNOWN},this.isStepLoading=!1,[3,16];case 16:return[2]}}))}))},this.onCompleteDigitalOnlyPaymentClick=function(){return e(ae,void 0,void 0,(function(){var e,i,s;return t(this,(function(t){switch(t.label){case 0:return!this.canProceedToPayment||this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked?(this.isErrorsVisible=!0,[2]):this.isKlarna?[4,this.saveCart()]:[3,2];case 1:return t.sent(),this.setIsKlarnaPaymentCompleted(!0),[2];case 2:if(this.isFree||!this.isHepsiPay)return[3,9];t.label=3;case 3:return t.trys.push([3,7,,8]),window.HepsipaySdk&&(null===(s=this.hepsipayFrameInitResponse)||void 0===s?void 0:s.frameUrl)?(this.isStepLoading=!0,[4,this.saveCart()]):[3,5];case 4:return t.sent(),window.HepsipaySdk.initPayment(),[3,6];case 5:console.error("HepsipaySdk is not available"),t.label=6;case 6:return[3,8];case 7:return t.sent(),this.isStepLoading=!1,[2];case 8:return[2];case 9:return t.trys.push([9,13,,14]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 10:return t.sent(),[4,this.saveCart()];case 11:return t.sent(),!this.isFree&&this.isCustomFlowStripe?((e=document.querySelector("#stripe-form-btn"))&&e.click(),[2]):!this.isFree&&this.isAdyen?(this.adyenDropinElement.submit(),this.adyenDropinElement.isValid||(this.isStepLoading=!1),[2]):!this.isFree&&this.isPayPal?[2]:[4,this.createSaleTransaction()];case 12:return t.sent(),[3,14];case 13:return(i=t.sent()).type?this.error=i:this.error={type:J.UNKNOWN},this.isStepLoading=!1,[3,14];case 14:return[2]}}))}))},this.createSaleTransaction=function(){return e(ae,void 0,void 0,(function(){var e,i,s,n,r,o,a,c,d,h,p,m,f,v,y,S,k,b,P,A,C,I;return t(this,(function(t){switch(t.label){case 0:return i=this.mpVM.selectedCard,!this.isFree&&i&&(null===(d=this.mpVM.selectedCard)||void 0===d?void 0:d.Name)?((n=this.mpVM.phoneNumber({store:this.store,checkout:this.checkout}))&&(e=n),void 0===(null===(h=this.cardData)||void 0===h?void 0:h.installmentCount)?[2]:[4,M.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:{phoneNumber:e,savedCardName:null===(p=this.mpVM.selectedCard)||void 0===p?void 0:p.Name},paymentGatewayId:null===(m=this.mpVM.selectedCard)||void 0===m?void 0:m.paymentGatewayId,paymentMethodDetail:{cardNumber:this.mpVM.selectedCard.Value1,cardHolderName:this.mpVM.selectedCard.Name,cvv:this.mpVM.selectedCard.Value2,expiredMonth:11,expiredYear:11,installmentCount:this.cardData.installmentCount,threeDSecure:!!(null===(f=this.cardData)||void 0===f?void 0:f.threeDSecure)},metadata:{_fbp:Q("_fbp"),_fbc:Q("_fbc"),_ga:Q("_ga")}}})]):[3,2];case 1:return s=t.sent(),[3,4];case 2:return this.checkout.selectedPaymentGateway||this.isFree?[4,M.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:this.isFree?void 0:i&&e?{phoneNumber:e,savedCardName:null===(v=this.mpVM.selectedCard)||void 0===v?void 0:v.Name}:void 0,paymentGatewayId:this.isFree?"9d41af41-4793-4879-a19c-e9a66c929726":null===(y=this.checkout.selectedPaymentGateway)||void 0===y?void 0:y.id,paymentMethodDetail:this.isFree||i?void 0:(null===(S=this.checkout.selectedPaymentGateway)||void 0===S?void 0:S.paymentMethodType)===u.CREDIT_CARD&&(null===(k=this.checkout.selectedPaymentGateway)||void 0===k?void 0:k.type)===l.INTERNAL&&this.cardData?this.cardData.toInput():void 0,metadata:{_fbp:Q("_fbp"),_fbc:Q("_fbc"),_ga:Q("_ga")}}})]:[2];case 3:s=t.sent(),t.label=4;case 4:return r=null===(b=null==s?void 0:s.data)||void 0===b?void 0:b.transactionStatus,o=r&&[g.SUCCESS,g.AUTHORIZED].includes(r),a=r===g.PENDING,o?[4,this.getSuccessTransaction()]:[3,7];case 5:return t.sent(),[4,this.onCheckoutTransactionSuccess((null===(P=null==s?void 0:s.data)||void 0===P?void 0:P.orderId)||void 0)];case 6:return t.sent(),[3,8];case 7:if(!a||!(null===(A=null==s?void 0:s.data)||void 0===A?void 0:A.returnSlug))throw c=s.firstErrorMessage,"IKAS_WALLET_501"===(null===(I=null===(C=s.data)||void 0===C?void 0:C.error)||void 0===I?void 0:I.code)&&(c=this.t("checkout-page:errorContactStore")),{data:c,type:J.UNKNOWN};window.location.href=process.env.NEXT_PUBLIC_BASE_URL+s.data.returnSlug,t.label=8;case 8:return[2]}}))}))},this.onCheckoutTransactionSuccess=function(i){return e(ae,void 0,void 0,(function(){var e,s;return t(this,(function(t){switch(t.label){case 0:return localStorage.removeItem("sAddr"),(null===(e=this.checkout.customer)||void 0===e?void 0:e.notificationsAccepted)?[4,this.store.customerStore.createEmailSubscription((null===(s=this.checkout.customer)||void 0===s?void 0:s.email)||"")]:[3,2];case 1:t.sent(),t.label=2;case 2:return z.refreshJourneyId(),this.changeStep(X.SUCCESS,i),[2]}}))}))},this.onBackToInfoClick=function(){ae.changeStep(X.INFO)},this.onBackToShippingClick=function(){ae.changeStep(X.SHIPPING)},this.setCustomerConsentGranted=function(e){ae.checkout.customer&&(ae.checkout.customer.notificationsAccepted=e)},this.setUseDifferentAddress=function(e,t){var s;ae.useDifferentAddress=e,ae.useDifferentAddress?(localStorage.setItem("sAddr","1"),ae.checkout.billingAddress=ae.checkout.billingAddress||new Z,ae.checkout.billingAddress.countrySettings=ae.countrySettings):(localStorage.removeItem("sAddr"),ae.checkout.billingAddress=new Z(i({},ae.checkout.shippingAddress)),ae.store.customerStore.customer&&(null===(s=ae.customerAddresses)||void 0===s?void 0:s.length)&&t&&ae.isShowBillingAddressOnShippingStep&&ae.onSelectedBillingAddressIdChange(ae.checkout.billingAddress.id||"-1"))},this.setShouldSaveAddress=function(e){ae.shouldSaveAddress=e},this.setAddressTitle=function(e){ae.addressTitle=e},this.reInitPaymentMethod=function(){return e(ae,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return this.checkout.selectedPaymentGateway?this.isCustomFlowStripe?[4,this.createStripePaymentIntent(this.checkout.selectedPaymentGateway)]:[3,2]:[3,8];case 1:e.sent(),e.label=2;case 2:return this.isKlarna&&window.location.reload(),this.isAdyen?[4,this.createAdyenBalancePlatformPaymentSession(this.checkout.selectedPaymentGateway)]:[3,4];case 3:e.sent(),e.label=4;case 4:return this.isPayPal?[4,this.getPayPalClientId(this.checkout.selectedPaymentGateway)]:[3,6];case 5:e.sent(),e.label=6;case 6:return this.isHepsiPay?[4,this.hepsipayFrameInit(this.checkout.selectedPaymentGateway)]:[3,8];case 7:e.sent(),e.label=8;case 8:return[2]}}))}))},this.createStripePaymentIntent=function(i){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.createStripePaymentIntent({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data?(this.stripeResponse=e.data,this.stripeError=null):this.stripeError={type:J.API_ERROR,data:e.firstErrorMessage},[2]}}))}))},this.createKlarnaClientToken=function(i){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.createKlarnaClientToken({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data?(this.klarnaResponse=e.data,this.klarnaError=null):this.klarnaError={type:J.API_ERROR,data:e.firstErrorMessage},[2]}}))}))},this.createAdyenBalancePlatformPaymentSession=function(i){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.createAdyenBalancePlatformPaymentSession({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.adyenResponse=e.data),[2]}}))}))},this.getPayPalClientId=function(i){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.getPayPalClientId({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.payPalClientIdResponse=e.data),[2]}}))}))},this.hepsipayFrameInit=function(i){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.hepsipayFrameInit({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.hepsipayFrameInitResponse=e.data),[2]}}))}))},this.setPaymentGateway=function(i){return e(ae,void 0,void 0,(function(){var e,s;return t(this,(function(t){switch(t.label){case 0:return this.paymentGateways.length?(e=this.paymentGateways[i],s=!0,this.step!==X.PAYMENT?[3,7]:this.checkout.selectedPaymentGateway?[3,3]:"CUSTOM"!==e.code?[3,2]:[4,this.updatePaymentGateway(e)]):[2];case 1:s=t.sent(),t.label=2;case 2:return[3,7];case 3:return"CUSTOM"!==this.checkout.selectedPaymentGateway.code?[3,5]:[4,this.updatePaymentGateway(e)];case 4:return s=t.sent(),[3,7];case 5:return"CUSTOM"!==e.code?[3,7]:[4,this.updatePaymentGateway(e)];case 6:s=t.sent(),t.label=7;case 7:return s?"STRIPE"!==e.code&&"STRIPE_EU"!==e.code||this.stripeResponse?[3,9]:[4,this.createStripePaymentIntent(e)]:[2];case 8:t.sent(),t.label=9;case 9:return"KLARNA"!==e.code||this.klarnaResponse?[3,11]:[4,this.createKlarnaClientToken(e)];case 10:t.sent(),t.label=11;case 11:return"ADYEN_PLATFORM"!==e.code||this.adyenResponse?[3,13]:[4,this.createAdyenBalancePlatformPaymentSession(e)];case 12:t.sent(),t.label=13;case 13:return"PAYPAL"!==e.code||this.payPalClientIdResponse?[3,15]:[4,this.getPayPalClientId(e)];case 14:t.sent(),t.label=15;case 15:return"HEPSIPAY"!==e.code||this.hepsipayFrameInitResponse?[3,17]:[4,this.hepsipayFrameInit(e)];case 16:t.sent(),t.label=17;case 17:return this.checkout.selectedPaymentGateway=e,this.step!==X.SUCCESS&&(e.paymentMethodType===u.CREDIT_CARD&&e.type===l.INTERNAL&&(this.cardData=new T,this.previousRawValue="",this.previousBin=null,e.masterPassClientId&&this.mpVM.checkMasterPass({checkout:this.checkout,store:this.store})),this.installmentInfo=void 0),[2]}}))}))},this.updatePaymentGateway=function(s){return e(ae,void 0,void 0,(function(){var e,n,r;return t(this,(function(t){switch(t.label){case 0:return this.isPaymentMethodVisible=!1,[4,L.getCartById({id:this.checkout.id,getCompletedCart:!1,paymentGatewayId:s.id,targetPageType:B.CHECKOUT})];case 1:return(e=t.sent()).isSuccess?((n=e.data)&&(r=this.checkout,this.checkout=new b(i(i({},n),{shippingAddress:r.shippingAddress,billingAddress:r.billingAddress,customer:r.customer,selectedPaymentGateway:r.selectedPaymentGateway}),this.countrySettings)),this.isPaymentMethodVisible=!0,[2,!0]):(this.isPaymentMethodVisible=!0,[2,!1])}}))}))},this.setInstallmentCount=function(e){ae.cardData&&(ae.cardData.installmentCount=e)},this.changeStep=function(i,s){return e(ae,void 0,void 0,(function(){return t(this,(function(e){return ee||window.location.replace("".concat(window.location.pathname,"?id=").concat(s||this.checkout.id,"&step=").concat(i)),[2]}))}))},this.logout=function(){return e(ae,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:this.checkout.customer=null,this.store.customerStore.logout(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.saveCart()];case 2:case 3:return e.sent(),[3,4];case 4:return this.createCustomer(),[2]}}))}))},this.setContactModalVisible=function(e){ae.isContactModalVisible=e},this.getCampaignOffer=function(s,n){return e(ae,void 0,void 0,(function(){var r,o,a=this;return t(this,(function(c){switch(c.label){case 0:return(null==n?void 0:n.length)?(r=n.filter((function(e){var t;return e.status===f.WAITING_FOR_ACTION&&(null===(t=e.campaignOffer)||void 0===t?void 0:t.targetPageTypes.some((function(e){return e===s})))})),o=r.map((function(s){return e(a,void 0,void 0,(function(){var e,n,r,o,a,c,d,u,l;return t(this,(function(t){switch(t.label){case 0:return(e=null===(d=s.campaignOffer)||void 0===d?void 0:d.offers.find((function(e){return e.id===s.campaignOfferProductId})))?(n=[e.productId],[4,_.searchProducts({input:{productIdList:n,priceListId:Y.getPriceListId(),salesChannelId:Y.getSalesChannelId()}})]):[2,Promise.reject()];case 1:return(r=t.sent()).isSuccess&&(null===(l=null===(u=r.data)||void 0===u?void 0:u.data)||void 0===l?void 0:l.length)?(o=r.data.data[0],(a=o.variants.filter((function(t){return t.hasStock&&!(e.excludedVariantIdList||[]).some((function(e){return e===t.id}))})).map((function(t){if(!e.discountAmount)return t;var s=!1;return e.discountType===S.AMOUNT&&(s=!0),new E(i(i({},t),{prices:t.prices.map((function(t){var n=t.finalPrice,r=t.finalPrice-(s?e.discountAmount:t.finalPrice*e.discountAmount/100);return e.applicablePrice===k.SELL_PRICE&&(n=t.sellPrice,r=t.sellPrice-(s?e.discountAmount:t.sellPrice*e.discountAmount/100)),new w(i(i({},t),{sellPrice:n,discountPrice:r}))}))}))}))).length?(c=a.find((function(e){return e.isActive})),[2,{product:new R(i(i({},o),{selectedVariantValues:(c||a[0]).variantValues,variants:a})),offer:e,campaignOffer:s}]):[2,Promise.reject()]):[2,Promise.reject()]}}))}))})),[4,Promise.allSettled(o)]):[2,[]];case 1:return[2,c.sent().filter((function(e){return"fulfilled"===e.status&&e.value})).map((function(e){return e.value}))]}}))}))},this.createCampaignOffer=function(){return e(ae,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e=this,[4,this.getCampaignOffer(this.step===X.SUCCESS?v.POST_CHECKOUT:v.CHECKOUT,this.checkout.campaignOffers)];case 1:return e.campaignOffers=t.sent(),[2]}}))}))},this.updateCartCampaignOffer=function(i){return e(ae,void 0,void 0,(function(){var e,s,n;return t(this,(function(t){switch(t.label){case 0:return i.accepted?this.isCheckoutLoaded=!1:this.isCampaignOfferLoaded=!1,[4,L.updateCartCampaignOffer({input:i})];case 1:return(e=t.sent()).isSuccess?i.accepted?(this.changeStep(this.step===X.SUCCESS?X.PAYMENT:this.step,null===(s=e.data)||void 0===s?void 0:s.id),[3,4]):[3,2]:[3,4];case 2:return this.checkout.campaignOffers=(null===(n=e.data)||void 0===n?void 0:n.campaignOffers)||[],[4,this.createCampaignOffer()];case 3:t.sent(),this.isCampaignOfferLoaded=!0,t.label=4;case 4:return[2]}}))}))},this.registerCustomer=function(i){return e(ae,void 0,void 0,(function(){var e,s,n,r;return t(this,(function(t){switch(t.label){case 0:return this.checkout.customer?(e=this.checkout.customer,s=e.firstName,n=e.lastName,r=e.email,s&&n&&r?[4,j.register({orderId:this.checkout.id,firstName:s,lastName:n,email:r,password:i})]:[3,2]):[3,2];case 1:return[2,t.sent()];case 2:return[2]}}))}))},this.listProductFile=function(){return e(ae,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return(e=this.checkout.orderLineItems.filter((function(e){return!!e.variant.fileId&&e.status!==y.REFUNDED})).map((function(e){return e.variant.fileId}))).length?[4,M.listProductFile({id:{in:e}})]:[3,2];case 1:(i=t.sent()).isSuccess&&(this.productFiles=i.data||[]),t.label=2;case 2:return[2]}}))}))},this.getDigitalProductFileDownloadUrl=function(i){return e(ae,void 0,void 0,(function(){var e,s,n,r,o;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),(e=this.checkout.orderLineItems.find((function(e){return e.variant.id===i.variantId})))?[4,M.getDigitalProductFileDownloadUrl({orderId:this.checkout.id,orderLineItemId:e.id})]:[3,2];case 1:s=t.sent(),(n=s.data)&&((r=document.createElement("a")).href=n,r.download=function(e){try{return decodeURIComponent(e.split("/")[e.split("/").length-1])}catch(e){return""}}(i.name),r.click(),r.remove()),t.label=2;case 2:return[3,4];case 3:return o=t.sent(),console.error(o),[3,4];case 4:return[2]}}))}))},this.checkout=a,this.checkoutSettings=d,this.router=p,this.returnPolicy=C,this.privacyPolicy=I,this.termsOfService=$,this.imprint=te,this.shippingPolicy=ne,this.t=re,this.customizationProps=oe,this.mpVM=new G,this.isTermsAndConditionsChecked=this.checkoutSettings.isTermsAndConditionsDefaultChecked||!1,this.countrySettings=new N({currentLocale:Y.getCurrentLocale()}),this.init(),s(this)}return Object.defineProperty($.prototype,"merchantSettings",{get:function(){return new I(Y.getMerchantSettings())},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"selectedPaymentGatewayIndex",{get:function(){var e=this;return this.paymentGateways.findIndex((function(t){var i;return t.id===(null===(i=e.checkout.selectedPaymentGateway)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"selectedInstallmentIndex",{get:function(){var e,t,i=this;return(null===(t=null===(e=this.installmentInfo)||void 0===e?void 0:e.installmentPrices)||void 0===t?void 0:t.findIndex((function(e){var t;return e.installmentCount===(null===(t=i.cardData)||void 0===t?void 0:t.installmentCount)})))||0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"checkoutUrl",{get:function(){return"/checkout?id=".concat(this.checkout.id,"&step=info")},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"customerAddressOptions",{get:function(){var e,t,i={label:this.t("checkout-page:newAddress"),value:"-1"},s=(null===(t=null===(e=H.getInstance().customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===t?void 0:t.map((function(e){return{label:e.title+" - "+e.addressText,value:e.id}})))||[];return[i].concat(s)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"installmentPrice",{get:function(){var e,t,i,s=this;if(this.installmentInfo&&(null===(e=this.cardData)||void 0===e?void 0:e.installmentCount))return null===(i=null===(t=this.installmentInfo.installmentPrices)||void 0===t?void 0:t.find((function(e){var t;return e.installmentCount===(null===(t=s.cardData)||void 0===t?void 0:t.installmentCount)})))||void 0===i?void 0:i.totalPrice},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"giftCardTotalPrice",{get:function(){var e;return(null===(e=this.checkout.giftCardLines)||void 0===e?void 0:e.reduce((function(e,t){return e+t.amount}),0))||0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"installmentExtraPrice",{get:function(){if(this.installmentPrice&&this.checkout.totalFinalPrice){var e=this.checkout.totalFinalPrice;if(this.isOpenEditOrderWithTransaction&&this.openEditOrderTransaction){var t=this.openEditOrderTransaction;e=e-((t.chargedAmount||0)+(t.pendingAmount||0))+(t.refundedAmount||0)}else e-=this.giftCardTotalPrice;return this.installmentPrice-e}},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"finalPrice",{get:function(){if(this.step===X.SUCCESS)return this.checkout.totalFinalPrice-this.giftCardTotalPrice;var e=this.checkout.totalFinalPrice;if(this.isOpenEditOrderWithTransaction&&this.openEditOrderTransaction){var t=this.openEditOrderTransaction;e=e-((t.chargedAmount||0)+(t.pendingAmount||0))+(t.refundedAmount||0)}else e-=this.giftCardTotalPrice;return this.installmentPrice?this.installmentPrice:e},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"hasStockError",{get:function(){var e;return(null===(e=this.error)||void 0===e?void 0:e.type)===J.STOCK_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isPaymentGatewayHasMasterPass",{get:function(){return-1!==this.selectedPaymentGatewayIndex&&(!!this.paymentGateways.length&&!!this.paymentGateways[this.selectedPaymentGatewayIndex].masterPassClientId)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"hasQuickRegistration",{get:function(){return this.checkoutSettings.isQuickRegistrationEnabled&&this.checkout.customer&&this.checkout.customer.isGuestCheckout},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"canProceedToShipping",{get:function(){var e,t,i;return(this.isDigitalOnly||this.isShowBillingAddressOnShippingStep?null===(e=this.checkout.billingAddress)||void 0===e?void 0:e.isValidAddress:null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.isValidAddress)&&(this.checkout.hasCustomer||this.checkout.hasValidCustomerEmail)&&(null===(i=this.error)||void 0===i?void 0:i.type)!==J.NO_SHIPPING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"canProceedToInStoreDelivery",{get:function(){var e,t,i;return!!((null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.firstName)&&(null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.lastName)&&(null===(i=this.checkout.customer)||void 0===i?void 0:i.email)&&this.checkout.stockLocationId)&&(!this.isShowBillingAddressOnShippingStep||this.canProceedToShipping)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"canProceedToPayment",{get:function(){return this.canProceedToShipping&&this.isValidShippingSettings},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isValidShippingSettings",{get:function(){var e,t=this;return!!(this.isInStoreDelivery||this.isDigitalOnly||this.isManualOrderWithShippingLines)||this.checkout.shippingSettingsId&&this.checkout.shippingZoneRateId&&(null===(e=this.checkout.shippingLines)||void 0===e?void 0:e.some((function(e){return e.shippingSettingsId===t.checkout.shippingSettingsId&&e.shippingZoneRateId===t.checkout.shippingZoneRateId})))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isManualOrderWithShippingLines",{get:function(){var e,t;return this.checkout.createdBy===a.ADMIN&&(null===(e=this.checkout.shippingLines)||void 0===e?void 0:e.length)&&!(null===(t=this.checkout.availableShippingMethods)||void 0===t?void 0:t.length)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isManualOrderWithoutShippingLines",{get:function(){var e,t;return this.checkout.createdBy===a.ADMIN&&!(null===(e=this.checkout.shippingLines)||void 0===e?void 0:e.length)&&!(null===(t=this.checkout.availableShippingMethods)||void 0===t?void 0:t.length)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isInStoreDelivery",{get:function(){return!!this.checkout.stockLocationId},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"klarnaPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"KLARNA"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"klarnaPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"KLARNA"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"adyenPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"ADYEN_PLATFORM"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"adyenPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"ADYEN_PLATFORM"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"payPalPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"PAYPAL"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"payPalPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"PAYPAL"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"hepsiPayPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"HEPSIPAY"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"hepsiPayPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"HEPSIPAY"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isCustomFlowStripe",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&("STRIPE"===e.code||"STRIPE_EU"===e.code)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isKlarna",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"KLARNA"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isAdyen",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"ADYEN_PLATFORM"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isPayPal",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"PAYPAL"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isHepsiPay",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"HEPSIPAY"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isFree",{get:function(){return 0===this.checkout.totalFinalPrice||0===this.finalPrice},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"store",{get:function(){return H.getInstance()},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isCouponCodeRequirementDefult",{get:function(){return this.checkoutSettings.couponCodeRequirement===c.DEFAULT||null===this.checkoutSettings.couponCodeRequirement},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isCouponCodeRequirementOpen",{get:function(){return this.checkoutSettings.couponCodeRequirement===c.OPEN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isCouponCodeRequirementInvisible",{get:function(){return this.checkoutSettings.couponCodeRequirement===c.INVISIBLE},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isCouponCodeVisible",{get:function(){return this.isCouponCodeRequirementDefult&&!this.isCouponCodeRequirementInvisible},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isCorporateInvoiceVisible",{get:function(){return this.checkoutSettings.corporateInvoiceRequirement!==d.INVISIBLE},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isShowBillingAddressOnShippingStep",{get:function(){return this.checkoutSettings.showBillingAddressOnShippingStep},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"canPerformPayment",{get:function(){var e,t;if(this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return!1;var i=this.checkout.selectedPaymentGateway,s=!!("in-store"===this.deliveryMethod)||!!this.canProceedToShipping,n=!!(null===(e=this.checkout.billingAddress)||void 0===e?void 0:e.isValidAddress),r=!!this.isFree||(!!this.mpVM.selectedCard||((null==i?void 0:i.paymentMethodType)===u.CREDIT_CARD&&i.type===l.INTERNAL?!!this.isCustomFlowStripe||(!!(this.isKlarna||this.isPayPal||this.isHepsiPay)||(null===(t=this.cardData)||void 0===t?void 0:t.isValid)):!!i));return s&&n&&r},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isDigitalOnly",{get:function(){return this.checkout.shippingMethod===h.DIGITAL_DELIVERY},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"customerAddresses",{get:function(){var e,t,s,n=this,r=null===(e=Y.getCurrentRouting())||void 0===e?void 0:e.countryCodes;return null===(s=null===(t=this.store.customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===s?void 0:s.filter((function(e){var t;return!(null==r?void 0:r.length)||(null===(t=e.country)||void 0===t?void 0:t.iso2)&&r.includes(e.country.iso2)})).map((function(e){var t=new C(i({countrySettings:n.countrySettings},e));return t.checkoutSettings=n.checkoutSettings,t.shippingZones=n.shippingZones,t.getValidatedCustomerAddress(),t}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isManualOrder",{get:function(){return this.checkout.createdBy===a.ADMIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isUpsellOrder",{get:function(){return this.checkout.createdBy===a.UPSELL},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpenEditOrder",{get:function(){return this.checkout.status===p.OPEN&&!!this.checkout.orderNumber},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpenEditOrderWithTransaction",{get:function(){var e,t;return this.checkout.status===p.OPEN&&!!this.checkout.orderNumber&&!!(null===(e=this.openEditOrderTransaction)||void 0===e?void 0:e.chargedAmount)&&(null===(t=this.openEditOrderTransaction)||void 0===t?void 0:t.chargedAmount)>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isEPayKolayEnabled",{get:function(){var e=Y.getCustom();return!!e&&!!e.isEPayKolayEnabled},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isPoweredByHidden",{get:function(){var e=Y.getCustom();return!!e&&!!e.hidePoweredBy},enumerable:!1,configurable:!0}),$.prototype.setAdyenDropinElement=function(e){this.adyenDropinElement=e},$}();function ie(e,t){return e.match(new RegExp(".{1,"+t+"}","g"))||[]}function se(e){return e&&$.test(e.charAt(e.length-1))}!function(e){e.INFO="info",e.SHIPPING="shipping",e.PAYMENT="payment",e.SUCCESS="success"}(X||(X={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.API_ERROR=1]="API_ERROR",e[e.STOCK_ERROR=2]="STOCK_ERROR",e[e.PAYMENT_ERROR=3]="PAYMENT_ERROR",e[e.NO_SHIPPING_ERROR=4]="NO_SHIPPING_ERROR",e[e.CUSTOMER_LOGIN_REQUIRED_ERROR=5]="CUSTOMER_LOGIN_REQUIRED_ERROR",e[e.CUSTOMER_ACCOUNT_DISABLED_ERROR=6]="CUSTOMER_ACCOUNT_DISABLED_ERROR",e[e.ARGUMENT_VALIDATION_ERROR=7]="ARGUMENT_VALIDATION_ERROR"}(J||(J={}));export{X as CheckoutStep,J as ErrorType,te as default};
|
|
1
|
+
import{__awaiter as e,__generator as t,__assign as i}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import n from"lodash/cloneDeep";import r from"lodash/sortBy";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasCustomerEmailSubscriptionStatus as o,IkasCartCreatedBy as a,IkasCouponCodeRequirement as c,IkasCorporateInvoiceRequirement as d,IkasPaymentMethodType as u,IkasPaymentGatewayType as l,IkasOrderShippingMethod as h,IkasOrderStatus as p,IkasOrderPaymentStatus as m,IkasTransactionStatus as g,IkasCartCampaignOfferStatus as f,IkasCampaignOfferTargetPageType as v,IkasOrderLineItemStatus as y,IkasAmountType as S,IkasCampaignOfferProductApplicablePriceEnum as b}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import{IkasCheckout as k}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as P}from"../../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{IkasCustomerAddress as C}from"../../models/data/customer/address/index.js";import{IkasLocalizedCustomerAddress as A}from"../../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{IkasMerchantSettings as I}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import{IkasOrderCustomer as O}from"../../models/data/order/customer/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/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{IkasProductPrice as w}from"../../models/data/product/variant/price/index.js";import{IkasProductVariant as E}from"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import{IkasProduct as R}from"../../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{LocalizedAddressModel as N}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 T from"./components/credit-card-form/model.js";import j from"../../store/customer/api.js";import M from"../../store/checkout/index.js";import L from"../../store/cart/api.js";import D,{MFS_ELEMENT_ID as G,MFS_SCRIPT_URL as x}from"./modelMasterPass.js";import _ from"../../store/product/index.js";import{TransactionCardAssociationEnum as V,SaveCartInput as F,CheckStocksLineInput as U,getLoyaltyCustomerInfo as B,listSpendingMethodsByCartId as H,LoyaltyProgramPointEarningTypeEnum as Y,listEarningMethods as K,CampaignOfferTargetPageTypeEnum as Z}from"@ikas/storefront-api";import{IkasBaseStore as W}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{IkasStorefrontConfig as q}from"@ikas/storefront-config";import{Analytics as Q}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import z from"../../models/data/order/address/ikas-localized-order-address.js";import X from"../../store/location/index.js";import{isEqual as J,getCookieValue as $}from"../../utils/helper.js";import ee from"../../analytics/ikasV3.js";var te,ie,se=/^\d+$/,ne="undefined"==typeof localStorage,re=function(){function se(a,d,p,A,I,se,re,ce,de,ue){var le=this;this.storefront=null,this.isCheckoutLoaded=!1,this.isErrorsVisible=!1,this.isStepLoading=!1,this.isTermsAndConditionsChecked=!1,this.isChangingShippingMethod=!1,this.isContactModalVisible=!1,this.isPaymentMethodVisible=!0,this.step=te.INFO,this.customizationProps=null,this.cardData=null,this.paymentGateways=[],this.productFiles=[],this.installmentInfo=null,this.useDifferentAddress=!1,this.shouldSaveAddress=!0,this.addressTitle="",this.shippingCountryIds=null,this.selectedShippingAddressId="-1",this.selectedBillingAddressId="-1",this.stockLocations=[],this.availableStockLocations=[],this.deliveryMethod="address",this.stripeResponse=null,this.stripeError=null,this.klarnaResponse=null,this.isKlarnaPaymentCompleted=!1,this.klarnaError=null,this.adyenResponse=null,this.payPalClientIdResponse=null,this.paypalOrderResponse=null,this.hepsipayFrameInitResponse=null,this.isCampaignOfferLoaded=!0,this.shippingZones=null,this.policyModalTitle="",this.policyModalText="",this.error=null,this.couponError=null,this.storeCreditBalance=null,this.loyaltyCustomerInfo=null,this.loyaltySpendingMethods=null,this.loyaltySpendingMethodsAll=null,this.loyaltyEarningMethod=null,this.isLoyaltyPointsVisible=!1,this.showTestModal=!1,this.openEditOrderTransaction=null,this.previousRawValue="",this.previousBin=null,this.init=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,this.countrySettings.waitUntilInitialized()];case 1:return t.sent(),[4,W.getInstance().customerStore.waitUntilInitialized()];case 2:return t.sent(),(e=this.isOpenEditOrder||this.checkout.edited)?[4,this.getOpenEditOrderTransaction()]:[3,4];case 3:t.sent(),t.label=4;case 4:return e&&(this.openEditOrderTransaction||this.checkout.edited)||this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.initStep()];case 5:return t.sent(),[2]}}))}))},this.initStep=function(){return e(le,void 0,void 0,(function(){var e,s,n,r,o,a,d;return t(this,(function(t){switch(t.label){case 0:if(q.getIsEditor())return this.step=te.INFO,this.isCheckoutLoaded=!0,[2];if(e=new URLSearchParams(window.location.search),s=e.get("step"),n=e.get("failed"),r=e.get("error"),s){if(this.step=s,this.step===te.SHIPPING&&!this.canProceedToShipping)return[2,this.changeStep(te.INFO)];if(this.step!==te.PAYMENT||this.canProceedToPayment){if(this.step===te.SUCCESS&&!this.canProceedToPayment)return[2,this.changeStep(te.INFO)];if(![te.INFO,te.SUCCESS,te.SHIPPING,te.PAYMENT].includes(this.step))return[2,this.changeStep(te.INFO)]}else{if(!this.isInStoreDelivery)return this.isValidShippingSettings||this.isManualOrderWithoutShippingLines?[2,this.changeStep(te.INFO)]:[2,this.changeStep(te.SHIPPING)];this.deliveryMethod="in-store"}}return[4,this.createCampaignOffer()];case 1:return t.sent(),this.step!==te.SHIPPING&&this.step!==te.PAYMENT||this.isCouponCodeRequirementInvisible||(this.checkoutSettings=new P(i(i({},this.checkoutSettings),{couponCodeRequirement:c.DEFAULT}))),this.step!==te.INFO?[3,10]:this.isDigitalOnly?[3,4]:[4,this.getAvailableShippingZones()];case 2:return t.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getShippingCountries()];case 3:t.sent(),this.checkShippingCountries(),t.label=4;case 4:return[4,this.getStockLocations()];case 5:return t.sent(),[4,this.getAvailableStockLocations()];case 6:return t.sent(),this.isInStoreDelivery&&(this.deliveryMethod="in-store"),this.checkout.hasCustomer?[4,this.getLoyaltyCustomerInfo()]:[3,10];case 7:return t.sent(),[4,this.listSpendingMethodsByCartId()];case 8:return t.sent(),[4,this.listEarningMethods()];case 9:t.sent(),t.label=10;case 10:return this.step!==te.SHIPPING||1!==(null===(a=this.checkout.availableShippingMethods)||void 0===a?void 0:a.length)||this.checkoutSettings.isGiftPackageEnabled||(this.step=te.PAYMENT,this.router.replace("/checkout?id=".concat(this.checkout.id,"&step=").concat(this.step),void 0,{shallow:!0})),this.step!==te.SHIPPING||(null===(d=this.checkout.availableShippingMethods)||void 0===d?void 0:d.length)?this.step!==te.SUCCESS||this.checkout.orderPaymentStatus!==m.PAID?[3,12]:[4,this.listProductFile()]:(this.error={type:ie.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2]);case 11:t.sent(),t.label=12;case 12:return this.step!==te.PAYMENT&&this.step!==te.SUCCESS?[3,18]:[4,this.listPaymentGateways()];case 13:return t.sent(),this.checkout.hasCustomer?[4,this.getStoreCreditBalance()]:[3,15];case 14:t.sent(),t.label=15;case 15:return this.isInStoreDelivery?(this.deliveryMethod="in-store",[4,this.getStockLocations()]):[3,17];case 16:t.sent(),t.label=17;case 17:if(!this.paymentGateways.length&&!this.isFree)return this.error={type:ie.NO_SHIPPING_ERROR},this.isMinTransactionError&&(this.error={type:ie.API_ERROR,data:this.t("checkout-page:minTransactionErrorMessage",{value:200})}),this.isCheckoutLoaded=!0,[2];t.label=18;case 18:return this.step===te.SUCCESS?[3,22]:this.isOpenEditOrder?[3,21]:this.checkout.isComplete?[2,this.changeStep(te.SUCCESS)]:[3,19];case 19:return[4,this.initialStockCheck()];case 20:t.sent(),t.label=21;case 21:return[3,24];case 22:return[4,this.getSuccessTransaction()];case 23:t.sent(),this.successTransaction&&(o=this.successTransaction.paymentGatewayId,this.checkout.selectedPaymentGateway=this.paymentGateways.find((function(e){return e.id===o}))),t.label=24;case 24:return n&&(this.error={type:ie.PAYMENT_ERROR,data:r||null}),this.isCheckoutLoaded=!0,Q.checkoutStep(this.checkout,this.step,this.checkoutSettings),[2]}}))}))},this.getOpenEditOrderTransaction=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,j.listOrderTransactionsWithPrices({input:{orderId:this.checkout.id}})];case 1:return(e=t.sent()).isSuccess&&e.data&&e.data.chargedAmount&&(this.openEditOrderTransaction=e.data),[2]}}))}))},this.getSuccessTransaction=function(){return e(le,void 0,void 0,(function(){var e,i,s;return t(this,(function(t){switch(t.label){case 0:return[4,j.listOrderTransactions({orderId:{eq:this.checkout.id}})];case 1:return e=t.sent(),this.successTransactions=e.isSuccess&&(null===(i=e.data)||void 0===i?void 0:i.length)?e.data:[],this.successTransaction=e.isSuccess&&(null===(s=e.data)||void 0===s?void 0:s.length)?e.data[e.data.length-1]:void 0,[2]}}))}))},this.saveCart=function(){return e(le,void 0,void 0,(function(){var e,i,s,n,r,a,c,d,u,l,h,p,m,g,f,v,y;return t(this,(function(t){switch(t.label){case 0:return e=new F(this.checkout),"in-store"!==this.deliveryMethod?[3,2]:[4,this.inStockDeliveryInputData(e)];case 1:e=t.sent(),t.label=2;case 2:return this.step!==te.INFO&&this.step!==te.SHIPPING&&this.step!==te.PAYMENT||this.isDigitalOnly||(this.isShowBillingAddressOnShippingStep||this.step===te.PAYMENT||(e.billingAddress=null),e.billingAddress&&(this.isShowBillingAddressOnShippingStep&&this.useDifferentAddress||this.useDifferentAddress&&!this.isShowBillingAddressOnShippingStep&&this.checkoutSettings.showCompanyInfoInShippingAddress)&&(e.billingAddress.company=(null===(n=e.shippingAddress)||void 0===n?void 0:n.company)||null,e.billingAddress.taxNumber=(null===(r=e.shippingAddress)||void 0===r?void 0:r.taxNumber)||null,e.billingAddress.taxOffice=(null===(a=e.shippingAddress)||void 0===a?void 0:a.taxOffice)||null)),this.isDigitalOnly&&(e.shippingAddress=null),e.customer&&(this.store.customerStore.customer?e.customer.notificationsAccepted=this.store.customerStore.customer.subscriptionStatus===o.SUBSCRIBED:this.checkout.customer&&(e.customer.notificationsAccepted=this.checkout.customer.notificationsAccepted||!1)),null===(null===(d=null===(c=e.shippingAddress)||void 0===c?void 0:c.city)||void 0===d?void 0:d.code)&&""===(null===(l=null===(u=e.shippingAddress)||void 0===u?void 0:u.city)||void 0===l?void 0:l.name)&&(e.shippingAddress.city.name="-"),null===(null===(p=null===(h=e.billingAddress)||void 0===h?void 0:h.city)||void 0===p?void 0:p.code)&&""===(null===(g=null===(m=e.billingAddress)||void 0===m?void 0:m.city)||void 0===g?void 0:g.name)&&(e.billingAddress.city.name="-"),[4,L.saveCart({input:e})];case 3:if((null==(i=t.sent())?void 0:i.graphQLErrors)&&i.graphQLErrors.length)throw s=i.graphQLErrors[0],"CUSTOMER_LOGIN_REQUIRED"===(null===(f=s.extensions)||void 0===f?void 0:f.code)?{type:ie.CUSTOMER_LOGIN_REQUIRED_ERROR}:"CUSTOMER_ACCOUNT_DISABLED"===(null===(v=s.extensions)||void 0===v?void 0:v.code)?{type:ie.CUSTOMER_ACCOUNT_DISABLED_ERROR}:"ARGUMENT_VALIDATION_ERROR"===(null===(y=s.extensions)||void 0===y?void 0:y.code)?{type:ie.ARGUMENT_VALIDATION_ERROR,data:s.extensions.validationErrors}:{type:ie.API_ERROR,data:i.firstErrorMessage};return[2,i.data]}}))}))},this.inStockDeliveryInputData=function(i){return e(le,void 0,void 0,(function(){var e,s,n=this;return t(this,(function(t){return e=i,(s=this.stockLocations.find((function(e){return e.id===n.checkout.stockLocationId})))&&e.shippingAddress&&s.address&&(e.shippingAddress.country=s.address.country,e.shippingAddress.city=s.address.city,e.shippingAddress.state=s.address.state,e.shippingAddress.district=s.address.district,e.shippingAddress.postalCode=s.address.postalCode,e.shippingAddress.addressLine1=s.address.address||"",e.shippingAddress.addressLine2=null),[2,e]}))}))},this.checkStocks=function(){return e(le,void 0,void 0,(function(){var e,i,s,n,r,o,a,c,d,u,l,p,m,g;return t(this,(function(t){switch(t.label){case 0:return this.isManualOrder||this.isOpenEditOrderWithTransaction?[2]:(e=this.checkout.stockLocationId&&this.checkout.shippingMethod===h.CLICK_AND_COLLECT?[this.checkout.stockLocationId]:(null===(p=q.getStockLocationIds())||void 0===p?void 0:p.length)?q.getStockLocationIds():null,[4,M.checkCartStocks({cartId:this.checkout.id,stockLocationIdList:e})]);case 1:if(!(i=t.sent()).isSuccess)throw s="UPSELL"===this.checkout.createdBy,n=s?this.t("checkout-page:upsellTimeErrorMessage"):i.firstErrorMessage,{type:ie.API_ERROR,data:n};if(null==(r=null===(g=null===(m=i.data)||void 0===m?void 0:m.lines)||void 0===g?void 0:g.filter((function(e){return!e.isAvailable})))?void 0:r.length){for(o=[],a=function(e){var t=c.checkout.items.find((function(t){return t.variant.id===e.variantId}));t&&o.push({item:t,stockCount:e.stockCount})},c=this,d=0,u=r;d<u.length;d++)l=u[d],a(l);throw{type:ie.STOCK_ERROR,data:o}}return[2]}}))}))},this.setIsKlarnaPaymentCompleted=function(i){return e(le,void 0,void 0,(function(){return t(this,(function(e){return this.isKlarnaPaymentCompleted=i,[2]}))}))},this.setIsLoyaltyPointsVisible=function(e){le.isLoyaltyPointsVisible=e},this.removeUnavailableItems=function(i){return e(le,void 0,void 0,(function(){var e,s,n;return t(this,(function(t){switch(t.label){case 0:e=0,s=i,t.label=1;case 1:return e<s.length?(n=s[e],[4,W.getInstance().cartStore.changeItemQuantity(n.item,n.stockCount<0?0:n.stockCount)]):[3,4];case 2:t.sent(),t.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},this.getShippingCountries=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.getAvailableShippingCountries({salesChannelId:q.getSalesChannelId()})];case 1:return e=t.sent(),this.shippingCountryIds=e.data,[2]}}))}))},this.getStockLocations=function(){return e(le,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return q.getPickupStockLocationIds()?[4,M.listStockLocation({id:{in:q.getPickupStockLocationIds()}})]:[3,2];case 1:if(!(e=t.sent()).isSuccess||!(null===(i=e.data)||void 0===i?void 0:i.length))return this.error={type:ie.API_ERROR,data:e.firstErrorMessage},[2];this.stockLocations=e.data,t.label=2;case 2:return[2]}}))}))},this.getAvailableStockLocations=function(){return e(le,void 0,void 0,(function(){var e,i,s,n=this;return t(this,(function(t){switch(t.label){case 0:return q.getPickupStockLocationIds()?(e=this.checkout.items.map((function(e){return{quantity:e.quantity,variantId:e.variant.id,productId:e.variant.productId}})),[4,M.getAvailableStockLocations({lines:e.map((function(e){return new U(e)})),stockLocationIdList:q.getPickupStockLocationIds(),cartId:this.checkout.id})]):[3,2];case 1:if(!(i=t.sent()).isSuccess)return this.error={type:ie.API_ERROR},[2];s=q.getCurrentRouting(),this.availableStockLocations=(i.data||[]).filter((function(e){var t,i,r,o;return(null===(i=null===(t=e.address)||void 0===t?void 0:t.country)||void 0===i?void 0:i.id)&&e.address.country.iso2&&(null===(r=n.shippingCountryIds)||void 0===r?void 0:r.includes(e.address.country.id))&&(!(null===(o=null==s?void 0:s.countryCodes)||void 0===o?void 0:o.length)||s.countryCodes.includes(e.address.country.iso2))})),t.label=2;case 2:return[2]}}))}))},this.checkShippingCountries=function(){var e;(null===(e=le.shippingCountryIds)||void 0===e?void 0:e.length)||(le.error={type:ie.NO_SHIPPING_ERROR})},this.onDeliveryMethodChange=function(e){var t;le.deliveryMethod!==e&&("address"===e&&(le.checkout.stockLocationId=null,(null===(t=le.customerAddresses)||void 0===t?void 0:t.length)?le.onSelectedShippingAddressIdChange(le.customerAddresses[0].id||"-1"):(le.checkout.shippingAddress=new z,le.checkout.shippingAddress.countrySettings=le.countrySettings,le.checkout.shippingAddress.checkoutSettings=le.checkoutSettings,le.checkout.shippingAddress.shippingZones=le.shippingZones)),le.deliveryMethod=e,le.isErrorsVisible=!1)},this.initialStockCheck=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.checkStocks()];case 1:return t.sent(),[3,3];case 2:return void 0!==typeof(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:ie.UNKNOWN}),[3,3];case 3:return[2]}}))}))},this.getStoreCreditBalance=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.getStoreCreditBalance()];case 1:return e=t.sent(),this.storeCreditBalance=e.data,[2]}}))}))},this.getLoyaltyCustomerInfo=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,B({cartId:this.checkout.id})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.loyaltyCustomerInfo=e.data),[2]}}))}))},this.listSpendingMethodsByCartId=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,H({cartId:this.checkout.id})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.loyaltySpendingMethods=e.data.filter((function(e){return e.isAvailable})),this.loyaltySpendingMethodsAll=e.data),[2]}}))}))},this.listEarningMethods=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,K()];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.loyaltyEarningMethod=e.data.find((function(e){return"ORDER_CREATE"===e.methodType&&e.pointEarningType===Y.DYNAMIC_ORDER_AMOUNT}))),[2]}}))}))},this.listPaymentGateways=function(){return e(le,void 0,void 0,(function(){var e,i,s,n,o,a,c,d,u,l,h,p,m,g,f,v=this;return t(this,(function(t){switch(t.label){case 0:return e="local"===process.env.NEXT_PUBLIC_ENV,i=q.getPaymentGateways().map((function(e){return e.id})),[4,M.listPaymentGateway({cartId:this.checkout.id,id:e?void 0:{in:i},locale:q.getCurrentLocale(),transactionAmount:this.checkout.totalFinalPrice})];case 1:return(s=t.sent()).isSuccess?(null===(p=s.data)||void 0===p?void 0:p.length)||this.isFree?(this.error=void 0,n=null===(m=s.data)||void 0===m?void 0:m.some((function(e){return"IKAS_WALLET"===e.code})),this.isMinTransactionError=n&&this.finalPrice<200&&!this.isDigitalOnly,this.isMinTransactionError?[2]:(o=s.data||[],this.step===te.PAYMENT&&(o=o.filter((function(e){var t;return!(null===(t=e.supportedCurrencies)||void 0===t?void 0:t.length)||e.supportedCurrencies.includes(v.checkout.currencyCode)})),(a=null===(g=this.checkout.shippingAddress)||void 0===g?void 0:g.country)&&a.iso2&&(o=o.filter((function(e){var t;return!(null===(t=e.availableCountries)||void 0===t?void 0:t.length)||e.availableCountries.includes(a.iso2||"")}))),c=null===(f=this.checkout.billingAddress)||void 0===f?void 0:f.country,!a&&c&&c.iso2&&(o=o.filter((function(e){var t;return!(null===(t=e.availableCountries)||void 0===t?void 0:t.length)||e.availableCountries.includes(c.iso2||"")})))),d=[],r(q.getPaymentGateways(),"order").forEach((function(e){var t=null==o?void 0:o.find((function(t){return t.id===e.id}));t&&d.push(t)})),this.paymentGateways=e?o:d,u=this.paymentGateways.findIndex((function(e){return"ADYEN_PLATFORM"===e.code})),this.checkout.selectedPaymentGateway&&this.paymentGateways.some((function(e){var t;return e.id===(null===(t=v.checkout.selectedPaymentGateway)||void 0===t?void 0:t.id)}))?[3,2]:(this.setPaymentGateway(-1!==u?u:0),[3,4]))):(this.error={type:ie.NO_SHIPPING_ERROR},[2]):(this.error={type:ie.API_ERROR,data:s.firstErrorMessage},[2]);case 2:return this.step!==te.PAYMENT?[3,4]:[4,this.updatePaymentGateway(this.checkout.selectedPaymentGateway)];case 3:t.sent(),t.label=4;case 4:return this.step===te.PAYMENT&&(l=o.find((function(e){return!!e.masterPassClientId})))&&(this.checkout.masterPassPaymentGateway=l,(h=document.createElement("script")).id=G,h.src=x,h.onload=function(){v.mpVM.checkMasterPass({checkout:v.checkout,store:W.getInstance()})},document.head.appendChild(h)),[2]}}))}))},this.retrieveInstallmentInfo=function(i){return e(le,void 0,void 0,(function(){var e,s,n;return t(this,(function(t){switch(t.label){case 0:return[4,M.retrieveInstallmentInfo(i)];case 1:return e=t.sent(),s=e.data,null===(n=null==s?void 0:s.installmentPrices)||void 0===n||n.sort((function(e,t){return(e.installmentCount||-1)>(t.installmentCount||-1)?1:-1})),this.installmentInfo=s,[2]}}))}))},this.createCustomer=function(){var e;le.store.customerStore.customer?(null===(e=le.customerAddresses)||void 0===e||e.forEach((function(e){e.checkoutSettings=le.checkoutSettings,e.shippingZones=le.shippingZones})),le.checkout.customer=new O(i(i({},le.store.customerStore.customer),{notificationsAccepted:le.store.customerStore.customer.subscriptionStatus===o.SUBSCRIBED}))):le.checkout.customer=new O(le.checkout.customer||{})},this.setCheckoutShippingAddressSettings=function(){le.checkout.shippingAddress&&(le.checkout.shippingAddress.checkoutSettings=le.checkoutSettings,le.checkout.shippingAddress.shippingZones=le.shippingZones,le.checkout.shippingAddress.countrySettings=le.countrySettings,le.checkout.shippingAddress.getValidatedCustomerAddress())},this.setCheckoutBillingAddressSettings=function(){le.checkout.billingAddress&&(le.checkout.billingAddress.checkoutSettings=le.checkoutSettings,le.checkout.billingAddress.shippingZones=le.shippingZones,le.checkout.billingAddress.countrySettings=le.countrySettings,le.checkout.billingAddress.getValidatedCustomerAddress())},this.createShippingAddress=function(){if(!le.isDigitalOnly)if(le.isInStoreDelivery)le.setCheckoutShippingAddressSettings();else if(le.checkout.shippingAddress){if(le.store.customerStore.customer){var e=null==(t=le.customerAddresses)?void 0:t.find((function(e){var t;return e.id===(null===(t=le.checkout.shippingAddress)||void 0===t?void 0:t.id)}));if(e)return le.onSelectedShippingAddressIdChange(e.id||"-1"),void le.setCheckoutShippingAddressSettings()}le.checkout.shippingAddress=new z(n(le.checkout.shippingAddress)||{}),le.setCheckoutShippingAddressSettings()}else if(le.store.customerStore.customer){var t=le.customerAddresses;le.onSelectedShippingAddressIdChange((null==t?void 0:t.length)?t[0].id:"-1")}else le.onSelectedShippingAddressIdChange("-1")},this.createBillingAddress=function(){if("undefined"!=typeof localStorage)if(le.useDifferentAddress=!!localStorage.getItem("sAddr"),le.checkout.billingAddress){if(le.store.customerStore.customer){var e=null==(t=le.customerAddresses)?void 0:t.find((function(e){var t;return e.id===(null===(t=le.checkout.billingAddress)||void 0===t?void 0:t.id)}));if(e)return le.onSelectedBillingAddressIdChange(e.id||"-1"),void le.setCheckoutBillingAddressSettings()}le.checkout.billingAddress=new z(n(le.checkout.billingAddress)||{}),le.setCheckoutBillingAddressSettings()}else if(le.store.customerStore.customer){var t=le.customerAddresses;le.onSelectedBillingAddressIdChange((null==t?void 0:t.length)?t[0].id:"-1"),(null==t?void 0:t.length)||le.useDifferentAddress||!le.checkout.shippingAddress||le.isInStoreDelivery||(le.checkout.billingAddress=new z(n(le.checkout.shippingAddress)),le.setCheckoutBillingAddressSettings())}else le.onSelectedBillingAddressIdChange("-1"),le.useDifferentAddress||!le.checkout.shippingAddress||le.isInStoreDelivery||(le.checkout.billingAddress=new z(n(le.checkout.shippingAddress)),le.setCheckoutBillingAddressSettings())},this.onShippingMethodChange=function(i){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.isChangingShippingMethod?[2]:(this.isChangingShippingMethod=!0,this.checkout.shippingSettingsId=i.shippingSettingsId,this.checkout.shippingZoneRateId=i.shippingZoneRateId,[4,this.saveCart()]);case 1:return(e=t.sent())&&(this.checkout=new k(e,this.countrySettings)),this.checkout.shippingAddress&&(this.checkout.shippingAddress.checkoutSettings=this.checkoutSettings,this.checkout.shippingAddress.shippingZones=this.shippingZones),this.isChangingShippingMethod=!1,[2]}}))}))},this.onStockLocationChange=function(i){return e(le,void 0,void 0,(function(){return t(this,(function(e){return this.checkout.stockLocationId=i.id,[2]}))}))},this.onCouponCodeApply=function(s){return e(le,void 0,void 0,(function(){var e,n,r,o,a,c;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,8,,9]),[4,L.saveCartCouponCode({cartId:this.checkout.id,couponCode:this.checkout.couponCode||null})];case 1:return(e=t.sent()).isSuccess&&e.data?(n=e.data,r=null===(c=null===(a=this.cardData)||void 0===a?void 0:a.cardNumber)||void 0===c?void 0:c.split(" ").join(""),this.couponError=null,this.step===te.PAYMENT&&(null==r?void 0:r.length)&&r.length>=6&&this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:r.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:n.totalFinalPrice,currencyCode:this.checkout.currencyCode}}),this.mpVM.selectedCard&&this.mpVM.selectedCard.Value1?[4,this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:this.mpVM.selectedCard.Value1.slice(0,6),paymentGatewayId:this.mpVM.selectedCard.paymentGatewayId,price:n.totalFinalPrice,currencyCode:this.checkout.currencyCode}})]:[3,3]):[3,7];case 2:t.sent(),t.label=3;case 3:return n?(o=this.checkout,this.checkout=new k(i(i({},n),{shippingAddress:this.checkout.shippingAddress,billingAddress:this.checkout.billingAddress,customer:this.checkout.customer,selectedPaymentGateway:this.checkout.selectedPaymentGateway}),this.countrySettings),this.step!==te.PAYMENT||this.checkout.totalFinalPrice===o.totalFinalPrice&&!this.checkout.giftCardLines?[3,5]:[4,this.listPaymentGateways()]):[3,7];case 4:t.sent(),t.label=5;case 5:return this.checkout.campaignOffers=n.campaignOffers,this.isCampaignOfferLoaded=!1,[4,this.createCampaignOffer()];case 6:t.sent(),this.isCampaignOfferLoaded=!0,s?Q.addCouponCode(n):Q.removeCouponCode(n),t.label=7;case 7:return e.isSuccess||(this.couponError=e.errorCodes[0]),[3,9];case 8:return t.sent(),[3,9];case 9:return[2]}}))}))},this.removeGiftCardLine=function(s){return e(le,void 0,void 0,(function(){var e,n,r,o,a;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,8,,9]),[4,L.removeGiftCardFromCart({cartId:this.checkout.id,giftCardId:s})];case 1:return(e=t.sent()).isSuccess&&e.data?(n=e.data,r=null===(a=null===(o=this.cardData)||void 0===o?void 0:o.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.couponError=null,this.step===te.PAYMENT&&(null==r?void 0:r.length)&&r.length>=6&&this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:r.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:n.totalFinalPrice,currencyCode:this.checkout.currencyCode}}),this.mpVM.selectedCard&&this.mpVM.selectedCard.Value1?[4,this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:this.mpVM.selectedCard.Value1.slice(0,6),paymentGatewayId:this.mpVM.selectedCard.paymentGatewayId,price:n.totalFinalPrice,currencyCode:this.checkout.currencyCode}})]:[3,3]):[3,7];case 2:t.sent(),t.label=3;case 3:return n?(this.checkout,this.checkout=new k(i(i({},n),{shippingAddress:this.checkout.shippingAddress,billingAddress:this.checkout.billingAddress,customer:this.checkout.customer,selectedPaymentGateway:this.checkout.selectedPaymentGateway}),this.countrySettings),this.step!==te.PAYMENT?[3,5]:[4,this.listPaymentGateways()]):[3,7];case 4:t.sent(),t.label=5;case 5:return this.checkout.campaignOffers=n.campaignOffers,this.isCampaignOfferLoaded=!1,[4,this.createCampaignOffer()];case 6:t.sent(),this.isCampaignOfferLoaded=!0,t.label=7;case 7:return[3,9];case 8:return t.sent(),[3,9];case 9:return[2]}}))}))},this.removeLoyaltyPointsFromCart=function(s){return e(le,void 0,void 0,(function(){var e,n,r,o,a;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,10,,11]),[4,L.removeLoyaltyPointsFromCart({cartId:this.checkout.id,loyaltySpendingMethodId:s})];case 1:return(e=t.sent()).isSuccess&&e.data?(n=e.data,r=null===(a=null===(o=this.cardData)||void 0===o?void 0:o.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.couponError=null,this.step===te.PAYMENT&&(null==r?void 0:r.length)&&r.length>=6&&this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:r.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:n.totalFinalPrice,currencyCode:this.checkout.currencyCode}}),this.mpVM.selectedCard&&this.mpVM.selectedCard.Value1?[4,this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:this.mpVM.selectedCard.Value1.slice(0,6),paymentGatewayId:this.mpVM.selectedCard.paymentGatewayId,price:n.totalFinalPrice,currencyCode:this.checkout.currencyCode}})]:[3,3]):[3,9];case 2:t.sent(),t.label=3;case 3:return n?(this.checkout,this.checkout=new k(i(i({},n),{shippingAddress:this.checkout.shippingAddress,billingAddress:this.checkout.billingAddress,customer:this.checkout.customer,selectedPaymentGateway:this.checkout.selectedPaymentGateway}),this.countrySettings),this.step!==te.PAYMENT?[3,5]:[4,this.listPaymentGateways()]):[3,9];case 4:t.sent(),t.label=5;case 5:return this.checkout.campaignOffers=n.campaignOffers,this.isCampaignOfferLoaded=!1,[4,this.createCampaignOffer()];case 6:return t.sent(),this.isCampaignOfferLoaded=!0,Q.removeLoyaltyPoints(n),[4,this.getLoyaltyCustomerInfo()];case 7:return t.sent(),[4,this.listSpendingMethodsByCartId()];case 8:t.sent(),t.label=9;case 9:return[3,11];case 10:return t.sent(),[3,11];case 11:return[2]}}))}))},this.getAvailableShippingZones=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,X.getAvailableShippingZones({salesChannelId:q.getSalesChannelId()})];case 1:return e=t.sent(),this.shippingZones=e.data||null,[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))}))},this.onSelectedShippingAddressIdChange=function(e){var t;if(le.selectedShippingAddressId=e,"-1"===e)le.checkout.shippingAddress=new z,le.checkout.shippingAddress.countrySettings=le.countrySettings;else{var i=null===(t=le.customerAddresses)||void 0===t?void 0:t.find((function(t){return t.id===e}));i&&(le.checkout.shippingAddress=new z(i),le.checkout.shippingAddress.countrySettings=le.countrySettings)}le.checkout.shippingAddress&&(le.checkout.shippingAddress.checkoutSettings=le.checkoutSettings,le.checkout.shippingAddress.shippingZones=le.shippingZones)},this.onSelectedBillingAddressIdChange=function(e){var t;if(le.selectedBillingAddressId=e,"-1"===e)le.checkout.billingAddress=new z,le.checkout.billingAddress.countrySettings=le.countrySettings;else{var i=null===(t=le.customerAddresses)||void 0===t?void 0:t.find((function(t){return t.id===e}));i&&(le.checkout.billingAddress=new z(i),le.checkout.billingAddress.countrySettings=le.countrySettings)}le.checkout.billingAddress&&(le.checkout.billingAddress.checkoutSettings=le.checkoutSettings,le.checkout.billingAddress.shippingZones=le.shippingZones)},this.onTermsAndConditionsCheckedChange=function(e){le.isTermsAndConditionsChecked=e},this.onCardNumberChange=function(e){var t;if(le.cardData){var i=(e||"").replace(/\D/g,""),s=le.previousRawValue,n=i.slice(0,6),r=le.previousBin;if(!(i.length>16)){var o=s.length<6&&i.length>=6,a=6===n.length&&n!==r;(o||a)&&6===n.length&&(le.getRetrieveInstallmentInfo(i),le.previousBin=n),i.length<6&&s.length>=6&&(le.cardData.installmentCount=1,le.installmentInfo=void 0,le.previousBin=null),(null===(t=le.installmentInfo)||void 0===t?void 0:t.cardAssociation)===V.AMERICAN_EXPRESS?le.cardData.cardNumber=function(e){var t=[],i=e.slice(0,4),s=e.slice(4,10),n=e.slice(10,15);i&&t.push(i);s&&t.push(s);n&&t.push(n);return t}(i).join(" "):le.cardData.cardNumber=oe(i,4).join(" "),le.previousRawValue=i}}},this.getRetrieveInstallmentInfo=function(i){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,this.retrieveInstallmentInfo({input:{orderId:this.checkout.id,binNumber:i.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:this.checkout.totalFinalPrice,currencyCode:this.checkout.currencyCode}})];case 1:return t.sent(),(null===(e=this.cardData)||void 0===e?void 0:e.cardNumber)&&this.onCardNumberChange(this.cardData.cardNumber),[2]}}))}))},this.onCardHolderNameChange=function(e){le.cardData&&(le.cardData.cardHolderName=e)},this.onExpirationDateChange=function(e){var t;if(le.cardData&&(!(e.length>le.cardData.expirationDate.length)||ae(e))){if(0===(null===(t=le.cardData.expirationDate)||void 0===t?void 0:t.length)){var i=e.replace(".","/").split("/");if(2===i.length){var s=i[0].trim(),n=i[1].trim();if(4===s.length&&2===n.length){var r=parseInt(s.slice(2)),o=parseInt(n);if(!isNaN(r)&&!isNaN(o))return void(le.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&4===n.length){o=parseInt(s),r=parseInt(n.slice(2));if(!isNaN(r)&&!isNaN(o))return void(le.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&2===n.length){var a=parseInt(s),c=parseInt(n);o=a<=12?a:c,r=c>12?c:a;if(!isNaN(r)&&!isNaN(o))return void(le.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}}}var d=e.split(" / ").join("");d.length>4||(le.cardData.expirationDate=oe(d,2).join(" / "))}},this.onCvcChange=function(e){if(le.cardData&&(!(e.length>le.cardData.cvv.length)||ae(e))){if(le.installmentInfo){if(le.installmentInfo.cardAssociation===V.AMERICAN_EXPRESS&&e.length>4)return;if(le.installmentInfo.cardAssociation!==V.AMERICAN_EXPRESS&&e.length>3)return}else if(e.length>3)return;le.cardData.cvv=e}},this.saveAddress=function(s){return e(le,void 0,void 0,(function(){var e,r,o,a,c,d,u,l,h,p,m,g,f=this;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),this.shouldSaveAddress&&this.store.customerStore.customer?(e="shipping"===s?this.checkout.shippingAddress:this.checkout.billingAddress,(null===(h=this.customerAddresses)||void 0===h?void 0:h.find((function(t){return t.id===(null==e?void 0:e.id)})))?[2]:(r=null===(p=this.customerAddresses)||void 0===p?void 0:p.map((function(e){return e.id})),o=new C(i(i({},e),{title:this.addressTitle||this.t("checkout-page:newAddress")})),(a=n(this.store.customerStore.customer)).addresses||(a.addresses=[]),a.addresses.push(o),[4,this.store.customerStore.saveCustomer(a)])):[3,2];case 1:t.sent(),null===(m=this.customerAddresses)||void 0===m||m.forEach((function(e){e.checkoutSettings=f.checkoutSettings,e.shippingZones=f.shippingZones})),c=null===(g=this.customerAddresses)||void 0===g?void 0:g.map((function(e){return e.id})),d=null==c?void 0:c.filter((function(e){return!(null==r?void 0:r.includes(e))})),u=(null==d?void 0:d.length)?d[0]:void 0,"shipping"===s?(this.checkout.shippingAddress.id=u||"",this.selectedShippingAddressId=u||"-1"):(this.checkout.billingAddress.id=u||"",this.selectedBillingAddressId=u||"-1"),t.label=2;case 2:return[3,4];case 3:return l=t.sent(),console.error(l),[3,4];case 4:return[2]}}))}))},this.getRoutingPath=function(){var e=q.getCurrentRouting();return(null==e?void 0:e.path)?"/".concat(e.path):""},this.getGoToCartHref=function(){var e=le.getRoutingPath();return"".concat(e,"/cart")},this.getBackToShoppingHref=function(){var e=le.getRoutingPath();return"".concat(e,"/")},this.getGoToLoginHref=function(){var e=le.getRoutingPath();return"".concat(e)+"/account/login?redirect="+encodeURIComponent(le.checkoutUrl)},this.onHandleBillingAddressOnShippingStep=function(){return e(le,void 0,void 0,(function(){return t(this,(function(e){return this.isShowBillingAddressOnShippingStep&&!this.useDifferentAddress&&("address"===this.deliveryMethod&&this.checkout.shippingAddress?this.checkout.billingAddress=new z(i({},this.checkout.shippingAddress)):this.checkout.billingAddress=new z(i({},this.checkout.billingAddress))),[2]}))}))},this.onProceedToShippingClick=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.isShowBillingAddressOnShippingStep?[4,this.onHandleBillingAddressOnShippingStep()]:[3,2];case 1:t.sent(),t.label=2;case 2:if("address"===this.deliveryMethod){if(!this.canProceedToShipping)return this.isErrorsVisible=!0,[2]}else if(!this.canProceedToInStoreDelivery)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,t.label=3;case 3:return t.trys.push([3,10,,11]),this.isStepLoading=!0,"address"!==this.deliveryMethod||this.isShowBillingAddressOnShippingStep?[3,5]:[4,this.saveAddress("shipping")];case 4:t.sent(),t.label=5;case 5:return this.isShowBillingAddressOnShippingStep?[4,this.saveAddress("billing")]:[3,7];case 6:t.sent(),t.label=7;case 7:return[4,this.checkStocks()];case 8:return t.sent(),[4,this.saveCart()];case 9:return t.sent(),this.isManualOrderWithShippingLines?[2,this.changeStep(te.PAYMENT)]:("address"===this.deliveryMethod?this.changeStep(te.SHIPPING):this.changeStep(te.PAYMENT),[3,11]);case 10:return void 0!==typeof(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:ie.UNKNOWN}),this.isStepLoading=!1,[3,11];case 11:return[2]}}))}))},this.onProceedToDigitalOnlyPaymentClick=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.isShowBillingAddressOnShippingStep?[4,this.onHandleBillingAddressOnShippingStep()]:[3,2];case 1:t.sent(),t.label=2;case 2:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,t.label=3;case 3:return t.trys.push([3,6,,7]),this.isStepLoading=!0,[4,this.checkStocks()];case 4:return t.sent(),[4,this.saveCart()];case 5:return t.sent(),this.changeStep(te.PAYMENT),[3,7];case 6:return(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:ie.UNKNOWN}),this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.onProceedToPaymentClick=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,t.label=1;case 1:return t.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return t.sent(),[4,this.saveCart()];case 3:return t.sent(),this.error=void 0,this.changeStep(te.PAYMENT),[3,5];case 4:return void 0!==typeof(e=t.sent()).type?this.error=e:(console.log(e),this.error={type:ie.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.checkPaypalButtonAvailable=function(){return!!le.canPerformPayment||(le.isErrorsVisible=!0,!1)},this.handlePaymentError=function(e,t){le.error={type:e,data:t}},this.onCompletePaymentClick=function(){return e(le,void 0,void 0,(function(){var e,i,s,n,r,o,a,c;return t(this,(function(t){switch(t.label){case 0:return this.canPerformPayment?(this.useDifferentAddress||(this.checkout.billingAddress=this.checkout.shippingAddress),this.isFree||!this.isKlarna?[3,2]:[4,this.saveCart()]):(this.isErrorsVisible=!0,[2]);case 1:return t.sent(),this.setIsKlarnaPaymentCompleted(!0),[2];case 2:if(this.isFree||!this.isHepsiPay)return[3,9];t.label=3;case 3:return t.trys.push([3,7,,8]),window.HepsipaySdk&&(null===(o=this.hepsipayFrameInitResponse)||void 0===o?void 0:o.frameUrl)?(this.isStepLoading=!0,[4,this.saveCart()]):[3,5];case 4:return t.sent(),window.HepsipaySdk.initPayment(),[3,6];case 5:console.error("HepsipaySdk is not available"),t.label=6;case 6:return[3,8];case 7:return t.sent(),this.isStepLoading=!1,[2];case 8:return[2];case 9:return t.trys.push([9,15,,16]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 10:return t.sent(),"address"===this.deliveryMethod&&this.useDifferentAddress?[4,this.saveAddress("billing")]:[3,12];case 11:t.sent(),t.label=12;case 12:return[4,this.saveCart()];case 13:return e=t.sent(),this.checkout.shippingMethod===h.SHIPMENT&&(i=null!==(a=null==e?void 0:e.availableShippingMethods)&&void 0!==a?a:[],s=null!==(c=this.checkout.availableShippingMethods)&&void 0!==c?c:[],!J(i,s))?(this.changeStep(te.SHIPPING),[2]):!this.isFree&&this.isCustomFlowStripe?((n=document.querySelector("#stripe-form-btn"))&&n.click(),[2]):!this.isFree&&this.isAdyen?(this.adyenDropinElement.submit(),this.adyenDropinElement.isValid||(this.isStepLoading=!1),[2]):!this.isFree&&this.isPayPal?[2]:[4,this.createSaleTransaction()];case 14:return t.sent(),[3,16];case 15:return void 0!==typeof(r=t.sent()).type?this.error=r:this.error={type:ie.UNKNOWN},this.isStepLoading=!1,[3,16];case 16:return[2]}}))}))},this.onCompleteDigitalOnlyPaymentClick=function(){return e(le,void 0,void 0,(function(){var e,i,s;return t(this,(function(t){switch(t.label){case 0:return!this.canProceedToPayment||this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked?(this.isErrorsVisible=!0,[2]):this.isKlarna?[4,this.saveCart()]:[3,2];case 1:return t.sent(),this.setIsKlarnaPaymentCompleted(!0),[2];case 2:if(this.isFree||!this.isHepsiPay)return[3,9];t.label=3;case 3:return t.trys.push([3,7,,8]),window.HepsipaySdk&&(null===(s=this.hepsipayFrameInitResponse)||void 0===s?void 0:s.frameUrl)?(this.isStepLoading=!0,[4,this.saveCart()]):[3,5];case 4:return t.sent(),window.HepsipaySdk.initPayment(),[3,6];case 5:console.error("HepsipaySdk is not available"),t.label=6;case 6:return[3,8];case 7:return t.sent(),this.isStepLoading=!1,[2];case 8:return[2];case 9:return t.trys.push([9,13,,14]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 10:return t.sent(),[4,this.saveCart()];case 11:return t.sent(),!this.isFree&&this.isCustomFlowStripe?((e=document.querySelector("#stripe-form-btn"))&&e.click(),[2]):!this.isFree&&this.isAdyen?(this.adyenDropinElement.submit(),this.adyenDropinElement.isValid||(this.isStepLoading=!1),[2]):!this.isFree&&this.isPayPal?[2]:[4,this.createSaleTransaction()];case 12:return t.sent(),[3,14];case 13:return(i=t.sent()).type?this.error=i:this.error={type:ie.UNKNOWN},this.isStepLoading=!1,[3,14];case 14:return[2]}}))}))},this.createSaleTransaction=function(){return e(le,void 0,void 0,(function(){var e,i,s,n,r,o,a,c,d,h,p,m,f,v,y,S,b,k,P,C,A,I;return t(this,(function(t){switch(t.label){case 0:return i=this.mpVM.selectedCard,!this.isFree&&i&&(null===(d=this.mpVM.selectedCard)||void 0===d?void 0:d.Name)?((n=this.mpVM.phoneNumber({store:this.store,checkout:this.checkout}))&&(e=n),void 0===(null===(h=this.cardData)||void 0===h?void 0:h.installmentCount)?[2]:[4,M.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:{phoneNumber:e,savedCardName:null===(p=this.mpVM.selectedCard)||void 0===p?void 0:p.Name},paymentGatewayId:null===(m=this.mpVM.selectedCard)||void 0===m?void 0:m.paymentGatewayId,paymentMethodDetail:{cardNumber:this.mpVM.selectedCard.Value1,cardHolderName:this.mpVM.selectedCard.Name,cvv:this.mpVM.selectedCard.Value2,expiredMonth:11,expiredYear:11,installmentCount:this.cardData.installmentCount,threeDSecure:!!(null===(f=this.cardData)||void 0===f?void 0:f.threeDSecure)},metadata:{_fbp:$("_fbp"),_fbc:$("_fbc"),_ga:$("_ga")}}})]):[3,2];case 1:return s=t.sent(),[3,4];case 2:return this.checkout.selectedPaymentGateway||this.isFree?[4,M.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:this.isFree?void 0:i&&e?{phoneNumber:e,savedCardName:null===(v=this.mpVM.selectedCard)||void 0===v?void 0:v.Name}:void 0,paymentGatewayId:this.isFree?"9d41af41-4793-4879-a19c-e9a66c929726":null===(y=this.checkout.selectedPaymentGateway)||void 0===y?void 0:y.id,paymentMethodDetail:this.isFree||i?void 0:(null===(S=this.checkout.selectedPaymentGateway)||void 0===S?void 0:S.paymentMethodType)===u.CREDIT_CARD&&(null===(b=this.checkout.selectedPaymentGateway)||void 0===b?void 0:b.type)===l.INTERNAL&&this.cardData?this.cardData.toInput():void 0,metadata:{_fbp:$("_fbp"),_fbc:$("_fbc"),_ga:$("_ga")}}})]:[2];case 3:s=t.sent(),t.label=4;case 4:return r=null===(k=null==s?void 0:s.data)||void 0===k?void 0:k.transactionStatus,o=r&&[g.SUCCESS,g.AUTHORIZED].includes(r),a=r===g.PENDING,o?[4,this.getSuccessTransaction()]:[3,7];case 5:return t.sent(),[4,this.onCheckoutTransactionSuccess((null===(P=null==s?void 0:s.data)||void 0===P?void 0:P.orderId)||void 0)];case 6:return t.sent(),[3,8];case 7:if(!a||!(null===(C=null==s?void 0:s.data)||void 0===C?void 0:C.returnSlug))throw c=s.firstErrorMessage,"IKAS_WALLET_501"===(null===(I=null===(A=s.data)||void 0===A?void 0:A.error)||void 0===I?void 0:I.code)&&(c=this.t("checkout-page:errorContactStore")),{data:c,type:ie.UNKNOWN};window.location.href=process.env.NEXT_PUBLIC_BASE_URL+s.data.returnSlug,t.label=8;case 8:return[2]}}))}))},this.onCheckoutTransactionSuccess=function(i){return e(le,void 0,void 0,(function(){var e,s;return t(this,(function(t){switch(t.label){case 0:return localStorage.removeItem("sAddr"),(null===(e=this.checkout.customer)||void 0===e?void 0:e.notificationsAccepted)?[4,this.store.customerStore.createEmailSubscription((null===(s=this.checkout.customer)||void 0===s?void 0:s.email)||"")]:[3,2];case 1:t.sent(),t.label=2;case 2:return ee.refreshJourneyId(),this.changeStep(te.SUCCESS,i),[2]}}))}))},this.onBackToInfoClick=function(){le.changeStep(te.INFO)},this.onBackToShippingClick=function(){le.changeStep(te.SHIPPING)},this.setCustomerConsentGranted=function(e){le.checkout.customer&&(le.checkout.customer.notificationsAccepted=e)},this.setUseDifferentAddress=function(e,t){var s;le.useDifferentAddress=e,le.useDifferentAddress?(localStorage.setItem("sAddr","1"),le.checkout.billingAddress=le.checkout.billingAddress||new z,le.checkout.billingAddress.countrySettings=le.countrySettings):(localStorage.removeItem("sAddr"),le.checkout.billingAddress=new z(i({},le.checkout.shippingAddress)),le.store.customerStore.customer&&(null===(s=le.customerAddresses)||void 0===s?void 0:s.length)&&t&&le.isShowBillingAddressOnShippingStep&&le.onSelectedBillingAddressIdChange(le.checkout.billingAddress.id||"-1"))},this.setShouldSaveAddress=function(e){le.shouldSaveAddress=e},this.setAddressTitle=function(e){le.addressTitle=e},this.reInitPaymentMethod=function(){return e(le,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return this.checkout.selectedPaymentGateway?this.isCustomFlowStripe?[4,this.createStripePaymentIntent(this.checkout.selectedPaymentGateway)]:[3,2]:[3,8];case 1:e.sent(),e.label=2;case 2:return this.isKlarna&&window.location.reload(),this.isAdyen?[4,this.createAdyenBalancePlatformPaymentSession(this.checkout.selectedPaymentGateway)]:[3,4];case 3:e.sent(),e.label=4;case 4:return this.isPayPal?[4,this.getPayPalClientId(this.checkout.selectedPaymentGateway)]:[3,6];case 5:e.sent(),e.label=6;case 6:return this.isHepsiPay?[4,this.hepsipayFrameInit(this.checkout.selectedPaymentGateway)]:[3,8];case 7:e.sent(),e.label=8;case 8:return[2]}}))}))},this.createStripePaymentIntent=function(i){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.createStripePaymentIntent({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data?(this.stripeResponse=e.data,this.stripeError=null):this.stripeError={type:ie.API_ERROR,data:e.firstErrorMessage},[2]}}))}))},this.createKlarnaClientToken=function(i){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.createKlarnaClientToken({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data?(this.klarnaResponse=e.data,this.klarnaError=null):this.klarnaError={type:ie.API_ERROR,data:e.firstErrorMessage},[2]}}))}))},this.createAdyenBalancePlatformPaymentSession=function(i){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.createAdyenBalancePlatformPaymentSession({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.adyenResponse=e.data),[2]}}))}))},this.getPayPalClientId=function(i){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.getPayPalClientId({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.payPalClientIdResponse=e.data),[2]}}))}))},this.hepsipayFrameInit=function(i){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,M.hepsipayFrameInit({input:{cartId:this.checkout.id,paymentGatewayId:i.id||""}})];case 1:return(e=t.sent()).isSuccess&&e.data&&(this.hepsipayFrameInitResponse=e.data),[2]}}))}))},this.setPaymentGateway=function(i){return e(le,void 0,void 0,(function(){var e,s;return t(this,(function(t){switch(t.label){case 0:return this.paymentGateways.length?(e=this.paymentGateways[i],s=!0,this.step!==te.PAYMENT?[3,7]:this.checkout.selectedPaymentGateway?[3,3]:"CUSTOM"!==e.code?[3,2]:[4,this.updatePaymentGateway(e)]):[2];case 1:s=t.sent(),t.label=2;case 2:return[3,7];case 3:return"CUSTOM"!==this.checkout.selectedPaymentGateway.code?[3,5]:[4,this.updatePaymentGateway(e)];case 4:return s=t.sent(),[3,7];case 5:return"CUSTOM"!==e.code?[3,7]:[4,this.updatePaymentGateway(e)];case 6:s=t.sent(),t.label=7;case 7:return s?"STRIPE"!==e.code&&"STRIPE_EU"!==e.code||this.stripeResponse?[3,9]:[4,this.createStripePaymentIntent(e)]:[2];case 8:t.sent(),t.label=9;case 9:return"KLARNA"!==e.code||this.klarnaResponse?[3,11]:[4,this.createKlarnaClientToken(e)];case 10:t.sent(),t.label=11;case 11:return"ADYEN_PLATFORM"!==e.code||this.adyenResponse?[3,13]:[4,this.createAdyenBalancePlatformPaymentSession(e)];case 12:t.sent(),t.label=13;case 13:return"PAYPAL"!==e.code||this.payPalClientIdResponse?[3,15]:[4,this.getPayPalClientId(e)];case 14:t.sent(),t.label=15;case 15:return"HEPSIPAY"!==e.code||this.hepsipayFrameInitResponse?[3,17]:[4,this.hepsipayFrameInit(e)];case 16:t.sent(),t.label=17;case 17:return this.checkout.selectedPaymentGateway=e,this.step!==te.SUCCESS&&(e.paymentMethodType===u.CREDIT_CARD&&e.type===l.INTERNAL&&(this.cardData=new T,this.previousRawValue="",this.previousBin=null,e.masterPassClientId&&this.mpVM.checkMasterPass({checkout:this.checkout,store:this.store})),this.installmentInfo=void 0),[2]}}))}))},this.updatePaymentGateway=function(s){return e(le,void 0,void 0,(function(){var e,n,r;return t(this,(function(t){switch(t.label){case 0:return this.isPaymentMethodVisible=!1,[4,L.getCartById({id:this.checkout.id,getCompletedCart:!1,paymentGatewayId:s.id,targetPageType:Z.CHECKOUT})];case 1:return(e=t.sent()).isSuccess?((n=e.data)&&(r=this.checkout,this.checkout=new k(i(i({},n),{shippingAddress:r.shippingAddress,billingAddress:r.billingAddress,customer:r.customer,selectedPaymentGateway:r.selectedPaymentGateway}),this.countrySettings)),this.isPaymentMethodVisible=!0,[2,!0]):(this.isPaymentMethodVisible=!0,[2,!1])}}))}))},this.setInstallmentCount=function(e){le.cardData&&(le.cardData.installmentCount=e)},this.changeStep=function(i,s){return e(le,void 0,void 0,(function(){return t(this,(function(e){return ne||window.location.replace("".concat(window.location.pathname,"?id=").concat(s||this.checkout.id,"&step=").concat(i)),[2]}))}))},this.logout=function(){return e(le,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:this.checkout.customer=null,this.store.customerStore.logout(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.saveCart()];case 2:case 3:return e.sent(),[3,4];case 4:return this.createCustomer(),[2]}}))}))},this.setContactModalVisible=function(e){le.isContactModalVisible=e},this.getCampaignOffer=function(s,n){return e(le,void 0,void 0,(function(){var r,o,a=this;return t(this,(function(c){switch(c.label){case 0:return(null==n?void 0:n.length)?(r=n.filter((function(e){var t;return e.status===f.WAITING_FOR_ACTION&&(null===(t=e.campaignOffer)||void 0===t?void 0:t.targetPageTypes.some((function(e){return e===s})))})),o=r.map((function(s){return e(a,void 0,void 0,(function(){var e,n,r,o,a,c,d,u,l;return t(this,(function(t){switch(t.label){case 0:return(e=null===(d=s.campaignOffer)||void 0===d?void 0:d.offers.find((function(e){return e.id===s.campaignOfferProductId})))?(n=[e.productId],[4,_.searchProducts({input:{productIdList:n,priceListId:q.getPriceListId(),salesChannelId:q.getSalesChannelId()}})]):[2,Promise.reject()];case 1:return(r=t.sent()).isSuccess&&(null===(l=null===(u=r.data)||void 0===u?void 0:u.data)||void 0===l?void 0:l.length)?(o=r.data.data[0],(a=o.variants.filter((function(t){return t.hasStock&&!(e.excludedVariantIdList||[]).some((function(e){return e===t.id}))})).map((function(t){if(!e.discountAmount)return t;var s=!1;return e.discountType===S.AMOUNT&&(s=!0),new E(i(i({},t),{prices:t.prices.map((function(t){var n=t.finalPrice,r=t.finalPrice-(s?e.discountAmount:t.finalPrice*e.discountAmount/100);return e.applicablePrice===b.SELL_PRICE&&(n=t.sellPrice,r=t.sellPrice-(s?e.discountAmount:t.sellPrice*e.discountAmount/100)),new w(i(i({},t),{sellPrice:n,discountPrice:r}))}))}))}))).length?(c=a.find((function(e){return e.isActive})),[2,{product:new R(i(i({},o),{selectedVariantValues:(c||a[0]).variantValues,variants:a})),offer:e,campaignOffer:s}]):[2,Promise.reject()]):[2,Promise.reject()]}}))}))})),[4,Promise.allSettled(o)]):[2,[]];case 1:return[2,c.sent().filter((function(e){return"fulfilled"===e.status&&e.value})).map((function(e){return e.value}))]}}))}))},this.createCampaignOffer=function(){return e(le,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e=this,[4,this.getCampaignOffer(this.step===te.SUCCESS?v.POST_CHECKOUT:v.CHECKOUT,this.checkout.campaignOffers)];case 1:return e.campaignOffers=t.sent(),[2]}}))}))},this.updateCartCampaignOffer=function(i){return e(le,void 0,void 0,(function(){var e,s,n;return t(this,(function(t){switch(t.label){case 0:return i.accepted?this.isCheckoutLoaded=!1:this.isCampaignOfferLoaded=!1,[4,L.updateCartCampaignOffer({input:i})];case 1:return(e=t.sent()).isSuccess?i.accepted?(this.changeStep(this.step===te.SUCCESS?te.PAYMENT:this.step,null===(s=e.data)||void 0===s?void 0:s.id),[3,4]):[3,2]:[3,4];case 2:return this.checkout.campaignOffers=(null===(n=e.data)||void 0===n?void 0:n.campaignOffers)||[],[4,this.createCampaignOffer()];case 3:t.sent(),this.isCampaignOfferLoaded=!0,t.label=4;case 4:return[2]}}))}))},this.registerCustomer=function(i){return e(le,void 0,void 0,(function(){var e,s,n,r;return t(this,(function(t){switch(t.label){case 0:return this.checkout.customer?(e=this.checkout.customer,s=e.firstName,n=e.lastName,r=e.email,s&&n&&r?[4,j.register({orderId:this.checkout.id,firstName:s,lastName:n,email:r,password:i})]:[3,2]):[3,2];case 1:return[2,t.sent()];case 2:return[2]}}))}))},this.listProductFile=function(){return e(le,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return(e=this.checkout.orderLineItems.filter((function(e){return!!e.variant.fileId&&e.status!==y.REFUNDED})).map((function(e){return e.variant.fileId}))).length?[4,M.listProductFile({id:{in:e}})]:[3,2];case 1:(i=t.sent()).isSuccess&&(this.productFiles=i.data||[]),t.label=2;case 2:return[2]}}))}))},this.getDigitalProductFileDownloadUrl=function(i){return e(le,void 0,void 0,(function(){var e,s,n,r,o;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),(e=this.checkout.orderLineItems.find((function(e){return e.variant.id===i.variantId})))?[4,M.getDigitalProductFileDownloadUrl({orderId:this.checkout.id,orderLineItemId:e.id})]:[3,2];case 1:s=t.sent(),(n=s.data)&&((r=document.createElement("a")).href=n,r.download=function(e){try{return decodeURIComponent(e.split("/")[e.split("/").length-1])}catch(e){return""}}(i.name),r.click(),r.remove()),t.label=2;case 2:return[3,4];case 3:return o=t.sent(),console.error(o),[3,4];case 4:return[2]}}))}))},this.checkout=a,this.checkoutSettings=d,this.router=p,this.returnPolicy=A,this.privacyPolicy=I,this.termsOfService=se,this.imprint=re,this.shippingPolicy=ce,this.t=de,this.customizationProps=ue,this.mpVM=new D,this.isTermsAndConditionsChecked=this.checkoutSettings.isTermsAndConditionsDefaultChecked||!1,this.countrySettings=new N({currentLocale:q.getCurrentLocale()}),this.init(),s(this)}return Object.defineProperty(se.prototype,"merchantSettings",{get:function(){return new I(q.getMerchantSettings())},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"selectedPaymentGatewayIndex",{get:function(){var e=this;return this.paymentGateways.findIndex((function(t){var i;return t.id===(null===(i=e.checkout.selectedPaymentGateway)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"selectedInstallmentIndex",{get:function(){var e,t,i=this;return(null===(t=null===(e=this.installmentInfo)||void 0===e?void 0:e.installmentPrices)||void 0===t?void 0:t.findIndex((function(e){var t;return e.installmentCount===(null===(t=i.cardData)||void 0===t?void 0:t.installmentCount)})))||0},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"checkoutUrl",{get:function(){return"/checkout?id=".concat(this.checkout.id,"&step=info")},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"customerAddressOptions",{get:function(){var e,t,i={label:this.t("checkout-page:newAddress"),value:"-1"},s=(null===(t=null===(e=W.getInstance().customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===t?void 0:t.map((function(e){return{label:e.title+" - "+e.addressText,value:e.id}})))||[];return[i].concat(s)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"installmentPrice",{get:function(){var e,t,i,s=this;if(this.installmentInfo&&(null===(e=this.cardData)||void 0===e?void 0:e.installmentCount))return null===(i=null===(t=this.installmentInfo.installmentPrices)||void 0===t?void 0:t.find((function(e){var t;return e.installmentCount===(null===(t=s.cardData)||void 0===t?void 0:t.installmentCount)})))||void 0===i?void 0:i.totalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"giftCardTotalPrice",{get:function(){var e;return(null===(e=this.checkout.giftCardLines)||void 0===e?void 0:e.reduce((function(e,t){return e+t.amount}),0))||0},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"installmentExtraPrice",{get:function(){if(this.installmentPrice&&this.checkout.totalFinalPrice){var e=this.checkout.totalFinalPrice;if(this.isOpenEditOrderWithTransaction&&this.openEditOrderTransaction){var t=this.openEditOrderTransaction;e=e-((t.chargedAmount||0)+(t.pendingAmount||0))+(t.refundedAmount||0)}else e-=this.giftCardTotalPrice;return this.installmentPrice-e}},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"finalPrice",{get:function(){if(this.step===te.SUCCESS)return this.checkout.totalFinalPrice-this.giftCardTotalPrice;var e=this.checkout.totalFinalPrice;if(this.isOpenEditOrderWithTransaction&&this.openEditOrderTransaction){var t=this.openEditOrderTransaction;e=e-((t.chargedAmount||0)+(t.pendingAmount||0))+(t.refundedAmount||0)}else e-=this.giftCardTotalPrice;return this.installmentPrice?this.installmentPrice:e},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"hasStockError",{get:function(){var e;return(null===(e=this.error)||void 0===e?void 0:e.type)===ie.STOCK_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isPaymentGatewayHasMasterPass",{get:function(){return-1!==this.selectedPaymentGatewayIndex&&(!!this.paymentGateways.length&&!!this.paymentGateways[this.selectedPaymentGatewayIndex].masterPassClientId)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"hasQuickRegistration",{get:function(){return this.checkoutSettings.isQuickRegistrationEnabled&&this.checkout.customer&&this.checkout.customer.isGuestCheckout},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"canProceedToShipping",{get:function(){var e,t,i;return(this.isDigitalOnly||this.isShowBillingAddressOnShippingStep?null===(e=this.checkout.billingAddress)||void 0===e?void 0:e.isValidAddress:null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.isValidAddress)&&(this.checkout.hasCustomer||this.checkout.hasValidCustomerEmail)&&(null===(i=this.error)||void 0===i?void 0:i.type)!==ie.NO_SHIPPING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"canProceedToInStoreDelivery",{get:function(){var e,t,i;return!!((null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.firstName)&&(null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.lastName)&&(null===(i=this.checkout.customer)||void 0===i?void 0:i.email)&&this.checkout.stockLocationId)&&(!this.isShowBillingAddressOnShippingStep||this.canProceedToShipping)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"canProceedToPayment",{get:function(){return this.canProceedToShipping&&this.isValidShippingSettings},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isValidShippingSettings",{get:function(){var e,t=this;return!!(this.isInStoreDelivery||this.isDigitalOnly||this.isManualOrderWithShippingLines)||this.checkout.shippingSettingsId&&this.checkout.shippingZoneRateId&&(null===(e=this.checkout.shippingLines)||void 0===e?void 0:e.some((function(e){return e.shippingSettingsId===t.checkout.shippingSettingsId&&e.shippingZoneRateId===t.checkout.shippingZoneRateId})))},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isManualOrderWithShippingLines",{get:function(){var e,t;return this.checkout.createdBy===a.ADMIN&&(null===(e=this.checkout.shippingLines)||void 0===e?void 0:e.length)&&!(null===(t=this.checkout.availableShippingMethods)||void 0===t?void 0:t.length)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isManualOrderWithoutShippingLines",{get:function(){var e,t;return this.checkout.createdBy===a.ADMIN&&!(null===(e=this.checkout.shippingLines)||void 0===e?void 0:e.length)&&!(null===(t=this.checkout.availableShippingMethods)||void 0===t?void 0:t.length)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isInStoreDelivery",{get:function(){return!!this.checkout.stockLocationId},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"klarnaPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"KLARNA"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"klarnaPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"KLARNA"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"adyenPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"ADYEN_PLATFORM"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"adyenPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"ADYEN_PLATFORM"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"payPalPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"PAYPAL"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"payPalPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"PAYPAL"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"hepsiPayPaymentGateway",{get:function(){var e=this.paymentGateways.findIndex((function(e){return"HEPSIPAY"===e.code}));if(-1!==e)return this.paymentGateways[e]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"hepsiPayPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(e){return"HEPSIPAY"===e.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isCustomFlowStripe",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&("STRIPE"===e.code||"STRIPE_EU"===e.code)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isKlarna",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"KLARNA"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isAdyen",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"ADYEN_PLATFORM"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isPayPal",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"PAYPAL"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isHepsiPay",{get:function(){var e=this.checkout.selectedPaymentGateway;return e&&"HEPSIPAY"===e.code},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isFree",{get:function(){return 0===this.checkout.totalFinalPrice||0===this.finalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"store",{get:function(){return W.getInstance()},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isCouponCodeRequirementDefult",{get:function(){return this.checkoutSettings.couponCodeRequirement===c.DEFAULT||null===this.checkoutSettings.couponCodeRequirement},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isCouponCodeRequirementOpen",{get:function(){return this.checkoutSettings.couponCodeRequirement===c.OPEN},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isCouponCodeRequirementInvisible",{get:function(){return this.checkoutSettings.couponCodeRequirement===c.INVISIBLE},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isCouponCodeVisible",{get:function(){return this.isCouponCodeRequirementDefult&&!this.isCouponCodeRequirementInvisible},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isCorporateInvoiceVisible",{get:function(){return this.checkoutSettings.corporateInvoiceRequirement!==d.INVISIBLE},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isShowBillingAddressOnShippingStep",{get:function(){return this.checkoutSettings.showBillingAddressOnShippingStep},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"canPerformPayment",{get:function(){var e,t;if(this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return!1;var i=this.checkout.selectedPaymentGateway,s=!!("in-store"===this.deliveryMethod)||!!this.canProceedToShipping,n=!!(null===(e=this.checkout.billingAddress)||void 0===e?void 0:e.isValidAddress),r=!!this.isFree||(!!this.mpVM.selectedCard||((null==i?void 0:i.paymentMethodType)===u.CREDIT_CARD&&i.type===l.INTERNAL?!!this.isCustomFlowStripe||(!!(this.isKlarna||this.isPayPal||this.isHepsiPay)||(null===(t=this.cardData)||void 0===t?void 0:t.isValid)):!!i));return s&&n&&r},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isDigitalOnly",{get:function(){return this.checkout.shippingMethod===h.DIGITAL_DELIVERY},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"customerAddresses",{get:function(){var e,t,s,n=this,r=null===(e=q.getCurrentRouting())||void 0===e?void 0:e.countryCodes;return null===(s=null===(t=this.store.customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===s?void 0:s.filter((function(e){var t;return!(null==r?void 0:r.length)||(null===(t=e.country)||void 0===t?void 0:t.iso2)&&r.includes(e.country.iso2)})).map((function(e){var t=new A(i({countrySettings:n.countrySettings},e));return t.checkoutSettings=n.checkoutSettings,t.shippingZones=n.shippingZones,t.getValidatedCustomerAddress(),t}))},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isManualOrder",{get:function(){return this.checkout.createdBy===a.ADMIN},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isUpsellOrder",{get:function(){return this.checkout.createdBy===a.UPSELL},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isOpenEditOrder",{get:function(){return this.checkout.status===p.OPEN&&!!this.checkout.orderNumber},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isOpenEditOrderWithTransaction",{get:function(){var e,t;return this.checkout.status===p.OPEN&&!!this.checkout.orderNumber&&!!(null===(e=this.openEditOrderTransaction)||void 0===e?void 0:e.chargedAmount)&&(null===(t=this.openEditOrderTransaction)||void 0===t?void 0:t.chargedAmount)>0},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isEPayKolayEnabled",{get:function(){var e=q.getCustom();return!!e&&!!e.isEPayKolayEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isPoweredByHidden",{get:function(){var e=q.getCustom();return!!e&&!!e.hidePoweredBy},enumerable:!1,configurable:!0}),se.prototype.setAdyenDropinElement=function(e){this.adyenDropinElement=e},se}();function oe(e,t){return e.match(new RegExp(".{1,"+t+"}","g"))||[]}function ae(e){return e&&se.test(e.charAt(e.length-1))}!function(e){e.INFO="info",e.SHIPPING="shipping",e.PAYMENT="payment",e.SUCCESS="success"}(te||(te={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.API_ERROR=1]="API_ERROR",e[e.STOCK_ERROR=2]="STOCK_ERROR",e[e.PAYMENT_ERROR=3]="PAYMENT_ERROR",e[e.NO_SHIPPING_ERROR=4]="NO_SHIPPING_ERROR",e[e.CUSTOMER_LOGIN_REQUIRED_ERROR=5]="CUSTOMER_LOGIN_REQUIRED_ERROR",e[e.CUSTOMER_ACCOUNT_DISABLED_ERROR=6]="CUSTOMER_ACCOUNT_DISABLED_ERROR",e[e.ARGUMENT_VALIDATION_ERROR=7]="ARGUMENT_VALIDATION_ERROR"}(ie||(ie={}));export{te as CheckoutStep,ie as ErrorType,re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as e}from"mobx";import{IkasThemeJsonComponent as n}from"./component/index.js";import{IkasThemeJsonComponentProp as o}from"./component/prop/index.js";import{IkasThemeJsonCustomData as r}from"./custom-data/index.js";import{IkasThemeJsonPage as i}from"./page/index.js";import{IkasThemeJsonPageComponent as t}from"./page/component/index.js";import{IkasThemeJsonSettings as a}from"./settings/index.js";import{IkasThemeJsonComponentPropType as s,IkasThemeJsonPageType as p}from"@ikas/storefront-models";var m="checkout",u=function(){function m(o){var t;void 0===o&&(o={}),this.name=o.name||"",this.components=o.components?o.components.map((function(e){return new n(e)})):[],this.pages=o.pages?o.pages.map((function(e){return new i(e)})):[],this.settings=o.settings?new a(o.settings):new a,this.customData=o.customData?null===(t=o.customData)||void 0===t?void 0:t.map((function(e){return new r(e)})):[],this.createCheckoutData(),e(this)}return Object.defineProperty(m.prototype,"headerComponent",{get:function(){return this.components.find((function(e){return e.isHeader}))},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"footerComponent",{get:function(){return this.components.find((function(e){return e.isFooter}))},enumerable:!1,configurable:!0}),m.prototype.createCheckoutData=function(){var e=this.components.find((function(e){return"checkout"===e.id})),r=this.pages.find((function(e){return"checkout"===e.id}));e||(e=new n({id:"checkout",dir:"",displayName:"",props:[new o({name:"logo",isRequired:!1,type:s.IMAGE}),new o({name:"showTax",isRequired:!1,type:s.BOOLEAN}),new o({name:"showCampaignOffersDesign",isRequired:!1,type:s.BOOLEAN}),new o({name:"showCampaignIsBiggerImage",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOfferIsSmallDesign",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersTitleColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersDescriptionColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersContainerBgColor",isRequired:!1,type:s.COLOR}),new o({name:"showCampaignShowDiscountSettings",isRequired:!1,type:s.BOOLEAN}),new o({name:"showCampaignHideDiscountBadge",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOfferCountdownStyleIsLine",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersDiscountPercentageColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersDiscountPercentageBgColor",isRequired:!1,type:s.COLOR}),new o({name:"showCampaignShowCountdownSettings",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersCountdownTextColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersCountdownTimeColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersCountdownBgColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersEnableMiddlePhase",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersMiddlePhaseOverlayColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOfferCountdownStyleIsLineSuccessPage",isRequired:!1,type:s.BOOLEAN}),new o({name:"buttonBgColor",isRequired:!1,type:s.COLOR}),new o({name:"buttonTextColor",isRequired:!1,type:s.COLOR}),new o({name:"buttonDisabledBgColor",isRequired:!1,type:s.COLOR}),new o({name:"buttonDisabledTextColor",isRequired:!1,type:s.COLOR}),new o({name:"primaryTextColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryTextColor",isRequired:!1,type:s.COLOR}),new o({name:"primaryBgColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryBgColor",isRequired:!1,type:s.COLOR}),new o({name:"borderColor",isRequired:!1,type:s.COLOR}),new o({name:"cardBgColor",isRequired:!1,type:s.COLOR}),new o({name:"errorColor",isRequired:!1,type:s.COLOR}),new o({name:"errorLightColor",isRequired:!1,type:s.COLOR}),new o({name:"warningColor",isRequired:!1,type:s.COLOR}),new o({name:"warningLightColor",isRequired:!1,type:s.COLOR}),new o({name:"successColor",isRequired:!1,type:s.COLOR}),new o({name:"successLightColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryButtonBgColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryButtonTextColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryButtonBorderColor",isRequired:!1,type:s.COLOR})]}),this.components.push(e)),r||this.pages.push(new i({id:"checkout",type:p.CHECKOUT,components:[new t({componentId:e.id,propValues:{logo:null,showTax:!0,showCampaignOffersDesign:!1,showCampaignIsBiggerImage:!1,campaignOfferIsSmallDesign:!1,showCampaignShowDiscountSettings:!1,showCampaignHideDiscountBadge:!1,campaignOfferCountdownStyleIsLine:!1,campaignOfferCountdownStyleIsLineSuccessPage:!1,showCampaignShowCountdownSettings:!1,campaignOffersEnableMiddlePhase:!1,campaignOffersTitleColor:
|
|
1
|
+
import{makeAutoObservable as e}from"mobx";import{IkasThemeJsonComponent as n}from"./component/index.js";import{IkasThemeJsonComponentProp as o}from"./component/prop/index.js";import{IkasThemeJsonCustomData as r}from"./custom-data/index.js";import{IkasThemeJsonPage as i}from"./page/index.js";import{IkasThemeJsonPageComponent as t}from"./page/component/index.js";import{IkasThemeJsonSettings as a}from"./settings/index.js";import{IkasThemeJsonComponentPropType as s,IkasThemeJsonPageType as p}from"@ikas/storefront-models";var m="checkout",u=function(){function m(o){var t;void 0===o&&(o={}),this.name=o.name||"",this.components=o.components?o.components.map((function(e){return new n(e)})):[],this.pages=o.pages?o.pages.map((function(e){return new i(e)})):[],this.settings=o.settings?new a(o.settings):new a,this.customData=o.customData?null===(t=o.customData)||void 0===t?void 0:t.map((function(e){return new r(e)})):[],this.createCheckoutData(),e(this)}return Object.defineProperty(m.prototype,"headerComponent",{get:function(){return this.components.find((function(e){return e.isHeader}))},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"footerComponent",{get:function(){return this.components.find((function(e){return e.isFooter}))},enumerable:!1,configurable:!0}),m.prototype.createCheckoutData=function(){var e=this.components.find((function(e){return"checkout"===e.id})),r=this.pages.find((function(e){return"checkout"===e.id}));e||(e=new n({id:"checkout",dir:"",displayName:"",props:[new o({name:"logo",isRequired:!1,type:s.IMAGE}),new o({name:"showTax",isRequired:!1,type:s.BOOLEAN}),new o({name:"showLoyaltyPoints",isRequired:!1,type:s.BOOLEAN}),new o({name:"showCampaignOffersDesign",isRequired:!1,type:s.BOOLEAN}),new o({name:"showCampaignIsBiggerImage",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOfferIsSmallDesign",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersTitleColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersDescriptionColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersContainerBgColor",isRequired:!1,type:s.COLOR}),new o({name:"showCampaignShowDiscountSettings",isRequired:!1,type:s.BOOLEAN}),new o({name:"showCampaignHideDiscountBadge",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOfferCountdownStyleIsLine",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersDiscountPercentageColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersDiscountPercentageBgColor",isRequired:!1,type:s.COLOR}),new o({name:"showCampaignShowCountdownSettings",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersCountdownTextColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersCountdownTimeColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersCountdownBgColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOffersEnableMiddlePhase",isRequired:!1,type:s.BOOLEAN}),new o({name:"campaignOffersMiddlePhaseOverlayColor",isRequired:!1,type:s.COLOR}),new o({name:"campaignOfferCountdownStyleIsLineSuccessPage",isRequired:!1,type:s.BOOLEAN}),new o({name:"buttonBgColor",isRequired:!1,type:s.COLOR}),new o({name:"buttonTextColor",isRequired:!1,type:s.COLOR}),new o({name:"buttonDisabledBgColor",isRequired:!1,type:s.COLOR}),new o({name:"buttonDisabledTextColor",isRequired:!1,type:s.COLOR}),new o({name:"primaryTextColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryTextColor",isRequired:!1,type:s.COLOR}),new o({name:"primaryBgColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryBgColor",isRequired:!1,type:s.COLOR}),new o({name:"borderColor",isRequired:!1,type:s.COLOR}),new o({name:"cardBgColor",isRequired:!1,type:s.COLOR}),new o({name:"errorColor",isRequired:!1,type:s.COLOR}),new o({name:"errorLightColor",isRequired:!1,type:s.COLOR}),new o({name:"warningColor",isRequired:!1,type:s.COLOR}),new o({name:"warningLightColor",isRequired:!1,type:s.COLOR}),new o({name:"successColor",isRequired:!1,type:s.COLOR}),new o({name:"successLightColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryButtonBgColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryButtonTextColor",isRequired:!1,type:s.COLOR}),new o({name:"secondaryButtonBorderColor",isRequired:!1,type:s.COLOR})]}),this.components.push(e)),r||this.pages.push(new i({id:"checkout",type:p.CHECKOUT,components:[new t({componentId:e.id,propValues:{logo:null,showTax:!0,showLoyaltyPoints:!1,showCampaignOffersDesign:!1,showCampaignIsBiggerImage:!1,campaignOfferIsSmallDesign:!1,showCampaignShowDiscountSettings:!1,showCampaignHideDiscountBadge:!1,campaignOfferCountdownStyleIsLine:!1,campaignOfferCountdownStyleIsLineSuccessPage:!1,showCampaignShowCountdownSettings:!1,campaignOffersEnableMiddlePhase:!1,campaignOffersTitleColor:O,campaignOffersDescriptionColor:c,campaignOffersContainerBgColor:g,campaignOffersDiscountPercentageColor:l,campaignOffersDiscountPercentageBgColor:f,campaignOffersCountdownTextColor:w,campaignOffersCountdownTimeColor:y,campaignOffersCountdownBgColor:R,campaignOffersMiddlePhaseOverlayColor:h,buttonBgColor:C,buttonTextColor:d,buttonDisabledBgColor:L,buttonDisabledTextColor:B,primaryTextColor:F,secondaryTextColor:q,primaryBgColor:E,secondaryBgColor:D,borderColor:b,cardBgColor:x,errorColor:T,errorLightColor:A,warningColor:S,warningLightColor:P,successColor:I,successLightColor:N,secondaryButtonBgColor:j,secondaryButtonTextColor:k,secondaryButtonBorderColor:v}})]}))},m}(),C="#272727",d="#FFFFFF",O="#272727",c="#272727",g="#ffffff",f="#FFF1BD",l="#272727",w="#272727",y="#FB4E4E",R="#FFF5F6",h="#27272799",L="#F7F7F9",B="#8A8B94",F="#272727",q="#8A8B94",E="#FFFFFF",D="#F7F7F9",b="#E5E4E9",x="#F7F7F9",T="#FB4E4E",A="#FCF3F4",S="#FFBC1F",P="#FFFAEE",I="#2DCA73",N="#F6FFED",j="#ffffff0",k="#272727",v="#E5E4E9";export{m as CHECKOUT_ID,u as IkasThemeJson};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "6.1.0-beta.
|
|
3
|
+
"version": "6.1.0-beta.271",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"swiper": "11.0.6"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@ikas/storefront-api": "^6.1.0-beta.
|
|
27
|
-
"@ikas/storefront-config": "^6.1.0-beta.
|
|
28
|
-
"@ikas/storefront-model-functions": "^6.1.0-beta.
|
|
29
|
-
"@ikas/storefront-models": "^6.1.0-beta.
|
|
30
|
-
"@ikas/storefront-providers": "^6.1.0-beta.
|
|
26
|
+
"@ikas/storefront-api": "^6.1.0-beta.271",
|
|
27
|
+
"@ikas/storefront-config": "^6.1.0-beta.271",
|
|
28
|
+
"@ikas/storefront-model-functions": "^6.1.0-beta.271",
|
|
29
|
+
"@ikas/storefront-models": "^6.1.0-beta.271",
|
|
30
|
+
"@ikas/storefront-providers": "^6.1.0-beta.271",
|
|
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": "^6.1.0-beta.
|
|
66
|
-
"@ikas/storefront-config": "^6.1.0-beta.
|
|
67
|
-
"@ikas/storefront-model-functions": "^6.1.0-beta.
|
|
68
|
-
"@ikas/storefront-models": "^6.1.0-beta.
|
|
69
|
-
"@ikas/storefront-providers": "^6.1.0-beta.
|
|
65
|
+
"@ikas/storefront-api": "^6.1.0-beta.271",
|
|
66
|
+
"@ikas/storefront-config": "^6.1.0-beta.271",
|
|
67
|
+
"@ikas/storefront-model-functions": "^6.1.0-beta.271",
|
|
68
|
+
"@ikas/storefront-models": "^6.1.0-beta.271",
|
|
69
|
+
"@ikas/storefront-providers": "^6.1.0-beta.271",
|
|
70
70
|
"mobx": "^6.1.3",
|
|
71
71
|
"mobx-react-lite": "^3.1.5",
|
|
72
72
|
"next": "12.2.0",
|