@ikas/storefront 5.0.65 → 5.0.67
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.js +1 -1
- package/build/components/checkout/components/form-item/index.js +1 -1
- package/build/components/checkout/components/iyzico/index.js +1 -1
- package/build/components/checkout/components/step-container/index.js +1 -1
- package/build/components/checkout/model.d.ts +1 -0
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/steps/step-info/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
- package/build/components/checkout/style.module.scss.js +1 -1
- package/build/hooks/useDimension.js +1 -1
- package/build/store/customer/api.d.ts +7 -1
- package/build/store/customer/api.js +1 -1
- package/build/store/customer/index.d.ts +7 -1
- package/build/store/customer/index.js +1 -1
- package/package.json +11 -11
- package/build/components/popup/index.d.ts +0 -2
- package/build/components/popup/renderer/index.d.ts +0 -8
- package/build/components/popup/renderer/model.d.ts +0 -24
- package/build/components/popup/utils/index.d.ts +0 -13
|
@@ -1 +1 @@
|
|
|
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 i}from"mobx-react-lite";import a 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 u}from"../../../../utils/i18n.js";import{CartItem as m}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 f from"../svg/cross.js";import g from"../svg/gift.js";import h 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 S from"../../../../hooks/useDimension.js";import I 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 w from"../svg/arrow-loyalty.js";import O from"../svg/star-loyalty.js";import{LoyaltyProgramMethodSpendingTypeEnum as A,searchProducts as D,useLoyaltyPoints as F}from"@ikas/storefront-api";import R 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 _}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 V}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=i((function(e){var t,n,i,a,l,y,p,v,f,g,h,P,k=e.vm,N=e.allowExpand,I=e.isSuccessPageSummary,M=k.checkout,x=u().t,T=o.useState(!N),j=T[0],b=T[1],w=o.useState(!1),O=w[0],A=w[1],D=o.useState(null),F=D[0],R=D[1],_=o.useState(0),V=_[0],U=_[1],B=o.useState(null),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],ie=o.useState(!1),ae=ie[0],le=ie[1],se=S().isMobile;o.useEffect((function(){N&&(j?q&&U(q.getBoundingClientRect().height):U(0))}),[j,q,N,Z,ne,O,ae]);var re=o.useMemo((function(){switch(F){case H.COUPON_CODE_NOT_EXIST:return x("checkout-page:giftCodeErrorDescription");case H.COUPON_CODE_NOT_EXIST_FOR_GUESS:return x("checkout-page:mustBeSignInToApplyCampaign");case H.COUPON_APPLIED_WITHOUT_DISCOUNT:return x("checkout-page:couponInvalidForCartItems");default:return""}}),[F]),ce=[C.CartSummary,N?C.HideOnDesktop:"",I?C.SuccessPageCartSummary:""].join(" "),de=N?{height:V+"px"}:void 0,ue=[C.ArrowDown,j?C.Rotated:""].join(" ");return M?o.createElement(o.Fragment,null,!!N&&o.createElement(o.Fragment,null,o.createElement("div",{id:"checkout-mobile-summary-header"}),o.createElement("div",{className:C.ExpandHeader,onClick:function(){if(!j){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}b(!j)}},o.createElement("div",{className:C.Left},x("checkout-page:summary")),o.createElement("div",{className:C.Price},o.createElement("span",{className:C.PriceText},"".concat(d(k.finalPrice||0,M.currencyCode,M.currencySymbol)," (").concat(M.itemQuantity," ").concat(x("checkout-page:cartItemProduct"),")")),o.createElement("span",{className:ue},o.createElement(E,null))))),o.createElement("div",{className:ce},o.createElement("div",{className:[C.DetailsContainer,I?C.SuccessPageDetailContainer:""].join(" "),style:de},o.createElement("div",{className:C.Details,ref:Y},o.createElement("div",{className:C.ItemsContainer},o.createElement("div",null,M.items.map((function(e,t){return o.createElement(m,{key:t,vm:k,cartItem:e,currencyCode:M.currencyCode,onChange:le,isSuccessPageSummary:I})})))),o.createElement("div",{className:C.Divider}),o.createElement("div",{className:C.SubTotalInfo},O&&o.createElement("div",{className:C.NotificationContainer},o.createElement(s,{type:"warning",title:x("checkout-page:giftCodeErrorTitle"),content:re,onClose:function(){A(!1),R(null)}})),o.createElement(G,{label:x("checkout-page:subtotal"),value:M.formattedTotalPrice,tooltipText:x("checkout-page:subtotalTooltip"),hideMarginBottom:!(k.isCouponCodeVisible||(null===(t=k.checkout.giftCardLines)||void 0===t?void 0:t.length)||(null===(n=k.checkout.loyaltyLines)||void 0===n?void 0:n.length)||(null===(i=k.checkout.nonCouponAdjustments)||void 0===i?void 0:i.length))}),!!(null===(a=M.shippingLines)||void 0===a?void 0:a.length)&&(k.step===r.SUCCESS?o.createElement(G,{label:x("checkout-page:cartShippingTitle"),value:M.shippingTotal?M.formattedShippingTotal:x("checkout-page:free")}):M.shippingLines.map((function(e,t){return o.createElement(G,{key:t,label:e.paymentMethod?e.title:x("checkout-page:cartShippingTitle"),value:e.finalPrice?d(e.finalPrice,M.currencyCode,M.currencySymbol):x("checkout-page:free")})}))),o.createElement(X,{vm:k}),o.createElement(z,{vm:k}),(k.step===r.SUCCESS&&(!!k.checkout.note||!!k.checkout.appliedCouponCode)||k.step!==r.SUCCESS)&&k.isCouponCodeVisible&&o.createElement("div",{className:C.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),!!(null===(l=k.loyaltySpendingMethods)||void 0===l?void 0:l.length)&&(null===(y=k.loyaltySpendingMethods)||void 0===y?void 0:y.length)>0&&!se&&!!(null===(p=k.customizationProps)||void 0===p?void 0:p.showLoyaltyPoints)&&o.createElement($,{vm:k,isVisibleLoyaltyPoints:k.isLoyaltyPointsVisible,setIsVisibleLoyaltyPoints:k.setIsLoyaltyPointsVisible,isMobile:se}),o.createElement(K,{vm:k,isVisibleLoyaltyPoints:k.isLoyaltyPointsVisible,setIsVisibleLoyaltyPoints:k.setIsLoyaltyPointsVisible}),o.createElement(W,{vm:k,isAddingCoupon:ne,setAddingCoupon:oe,setCouponError:A,setCouponErrorCode:R}),o.createElement(Q,{vm:k,isAddingNote:Z,setAddingNote:ee}),!!k.installmentExtraPrice&&k.installmentExtraPrice>0&&o.createElement(o.Fragment,null,o.createElement("div",{className:C.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement(G,{label:x("checkout-page:cartInterest"),value:d(k.installmentExtraPrice,M.currencyCode,M.currencySymbol)}))),k.isOpenEditOrderWithTransaction&&o.createElement("div",{className:C.SubTotalInfo,style:{}},!!(null===(v=k.openEditOrderTransaction)||void 0===v?void 0:v.chargedAmount)&&o.createElement(G,{label:x("checkout-page:chargedAmount"),value:d((null===(f=k.openEditOrderTransaction)||void 0===f?void 0:f.chargedAmount)||0,M.currencyCode,M.currencySymbol)}),!!(null===(g=k.openEditOrderTransaction)||void 0===g?void 0:g.refundedAmount)&&o.createElement(G,{label:x("checkout-page:refundedAmount"),value:d((null===(h=k.openEditOrderTransaction)||void 0===h?void 0:h.refundedAmount)||0,M.currencyCode,M.currencySymbol)})),o.createElement("div",{className:[C.TotalContainer,I?C.SuccessPageTotalContainer:""].join(" ")},o.createElement("div",{className:C.TitleContainer},o.createElement("div",{className:C.Title},k.isOpenEditOrderWithTransaction?x("checkout-page:totalAmountPayable"):x("checkout-page:total"))),o.createElement("div",null,o.createElement("div",{className:C.TotalPricesContainer},o.createElement("div",{className:C.TotalPrice},d(k.finalPrice||0,M.currencyCode,M.currencySymbol)),!!M.$totalTax&&!!(null===(P=k.customizationProps)||void 0===P?void 0:P.showTax)&&o.createElement("div",{className:[C.TotalTax].join(" ")},x("checkout-page:cartTaxTitle")+" "+M.$formattedTotalTax)))),!!k.loyaltyEarningMethod&&!!k.loyaltyCustomerInfo&&o.createElement("div",{className:C.LoyaltyEarningMethod},o.createElement("div",{className:C.LoyaltyEarningMethodTitle},x("checkout-page:loyaltyEarningMethodTitle",{value:(k.loyaltyEarningMethod.pointsEarned/(k.loyaltyEarningMethod.amountPerPointsEarned||1)*k.finalPrice).toFixed(2)}))),!I&&!k.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=i((function(e){var t=e.label,n=e.value,i=e.tooltipText,a=e.hideMarginBottom;return o.createElement("div",{className:[C.InfoRow,a?C.hideMb:""].join(" ")},o.createElement("div",{className:C.Label},o.createElement("span",null,t),!!i&&o.createElement(v,{text:i,style:{marginLeft:"8px"}})),o.createElement("div",{className:C.Value},n))})),X=i((function(e){var t=e.vm,n=u().t;return t.checkout?o.createElement(o.Fragment,null,a(t.checkout.nonCouponAdjustments||[],"order").filter((function(e){return e.createdFor!==k.LOYALTY_SPEND})).map((function(e,i){return o.createElement("div",{className:C.InfoRow,key:i},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})),z=i((function(e){var t,n=e.vm,i=u().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(g,{style:{position:"relative",top:"-1px"}}),o.createElement("span",null,i("checkout-page:giftPackage")))),o.createElement("div",{className:C.Value},o.createElement("span",null,d(e.price,n.checkout.currencyCode,n.checkout.currencySymbol))))}))):null})),W=i((function(n){var i=n.vm,a=n.isAddingCoupon,s=n.setAddingCoupon,c=n.setCouponError,d=n.setCouponErrorCode,m=n.isOpenCouponCode,v=n.isMobile,E=n.showOnlyMobile,f=u().t,g=o.useState(""),L=g[0],k=g[1],N=o.useState(!1),S=N[0],I=N[1],M=o.useRef(null);o.useEffect((function(){a&&M.current&&M.current.focus()}),[a]);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 i.checkout.couponCode=L,I(!0),[4,i.onCouponCodeApply(!0)];case 1:return t.sent(),I(!1),k(""),e=i.checkout.giftCardLines&&!!i.checkout.giftCardLines.length,i.couponError?[3,4]:i.checkout.appliedCouponCode||e?(c(!1),d(null),[4,i.reInitPaymentMethod()]):[3,3];case 2:t.sent(),t.label=3;case 3:return[3,5];case 4:i.checkout.couponCode=null,c(!0),d(i.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 I(!0),[4,i.removeGiftCardLine(n)];case 1:return e.sent(),[4,i.reInitPaymentMethod()];case 2:return e.sent(),I(!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 I(!0),[4,i.removeLoyaltyPointsFromCart(n)];case 1:return e.sent(),[4,i.reInitPaymentMethod()];case 2:return e.sent(),I(!1),[2]}}))}))};i.step,r.SUCCESS;var b=i.step===r.SHIPPING,w=!!i.checkout.appliedCouponCode||!!(i.checkout.giftCardLines&&i.checkout.giftCardLines.length>0)||!!(i.checkout.loyaltyLines&&i.checkout.loyaltyLines.length>0),O=!!i.checkout.appliedCouponCode&&m,A=!a&&i.isCouponCodeVisible&&!i.isCouponCodeRequirementOpen&&i.step!==r.SUCCESS,D=w&&(!m||v);return o.createElement(o.Fragment,null,!!m&&o.createElement(o.Fragment,null,o.createElement("div",{className:[C.CartSummary,C.OpenCouponCodeSummary].join(" ")},o.createElement("div",{className:h.FormSectionTitle},o.createElement("div",{style:{paddingBottom:O?0:6},className:h.Title},f("checkout-page:couponCode"))))),w&&!b&&!i.isCouponCodeRequirementDefult&&o.createElement("div",{className:C.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement("div",{className:A?C.InfoRow:""},A&&o.createElement("div",{className:C.ActionTextBtn,onClick:function(){return s(!0)}},f("checkout-page:addCouponCode")),a&&!m&&o.createElement("div",{style:{marginBottom:"10px"}},o.createElement(l,{value:L,placeholder:f("checkout-page:couponCode"),buttonLabel:f("checkout-page:actions.apply"),inputRef:M,onClick:x,isLoading:S,onChange:k})),m&&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:f("checkout-page:addCouponCode"),type:p.TEXT,value:L,onChange:k}),o.createElement(P,{style:{width:"33%"},text:f("checkout-page:actions.apply"),isLoading:S,onClick:x}))),D&&o.createElement(o.Fragment,null,!!i.checkout.appliedCouponCode&&o.createElement("div",{className:[C.InfoRow,E?C.InfoRowGiftCardMobile:""].join(" ")},o.createElement(q,{vm:i,onClearCouponCode:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return i.checkout.couponCode=null,I(!0),[4,i.onCouponCodeApply(!1)];case 1:return e.sent(),[4,i.reInitPaymentMethod()];case 2:return e.sent(),I(!1),[2]}}))}))},couponCode:i.checkout.appliedCouponCode})),!!i.checkout.giftCardLines&&!!i.checkout.giftCardLines.length&&i.checkout.giftCardLines.map((function(e){return o.createElement("div",{className:[C.InfoRow,E?C.InfoRowGiftCardMobile:""].join(" ")},o.createElement(q,{vm:i,onClearGiftCode:T,couponCode:e.code,giftCardLine:e}))})),!!i.checkout.loyaltyLines&&!!i.checkout.loyaltyLines.length&&i.checkout.loyaltyLines.map((function(e){return o.createElement("div",{className:[C.InfoRow,E?C.InfoRowGiftCardMobile:""].join(" ")},o.createElement(Y,{vm:i,onClearLoyaltyPoints:j,loyaltyPointsLine:e}))}))))})),q=i((function(e){var t=e.vm,n=e.onClearCouponCode,i=e.couponCode,a=e.giftCardLine,l=e.onClearGiftCode,s=t.checkout.couponAdjustment,c=u().t,m=!a,y=(null==a?void 0:a.type)===N.STORE_CREDIT;return o.createElement(o.Fragment,null,o.createElement("div",{className:[C.ActionTextBtn,C.NoUnderline].join(" ")},a&&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(" ")},m?o.createElement("span",{style:{height:"16px"}},o.createElement(I,null)):!y&&o.createElement("span",{style:{height:"16px"}},o.createElement(M,null)),o.createElement("span",{className:C.CouponCode},i),t.step!==r.SUCCESS&&!t.isOpenEditOrderWithTransaction&&o.createElement("span",{className:C.ClearCoupon,onClick:function(){return a?l&&l(a.giftCardId):n&&n()}},o.createElement(f,null)))),o.createElement("div",null,a?o.createElement("div",{className:C.Value},o.createElement("span",null,"-")," ",o.createElement("span",null,d((null==a?void 0:a.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=i((function(e){var t,n,i=e.vm,a=e.onClearLoyaltyPoints,l=e.loyaltyPointsLine,s=null===(t=i.checkout.nonCouponAdjustments)||void 0===t?void 0:t.find((function(e){return e.campaignId===l.id})),c=u().t,m=null===(n=i.loyaltySpendingMethodsAll)||void 0===n?void 0:n.find((function(e){return e.id===l.loyaltySpendingMethodId})),y=function(){return m?m.type===A.FREE_PRODUCT?{icon:o.createElement(T,null),title:c("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProductAdded")}:m.type===A.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,i.checkout.currencyCode,i.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,i.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),i.step!==r.SUCCESS&&!i.isOpenEditOrderWithTransaction&&o.createElement("span",{className:C.ClearCouponLoyalty,onClick:function(){return a&&a(l.loyaltySpendingMethodId)}},o.createElement(f,null)))),o.createElement("span",{className:C.LoyaltyPointSpending},"(",c("checkout-page:loyaltyPointSpending",{point:l.amount}),")")),m?m.type!==A.FREE_PRODUCT&&m.type!==A.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,i.checkout.currencyCode,i.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,i.checkout.currencyCode,i.checkout.currencySymbol)))))})),$=i((function(e){var t,n,i,a,l,s,r,c,m,y=e.vm;e.isVisibleLoyaltyPoints;var p=e.setIsVisibleLoyaltyPoints,v=e.isMobile,E=o.useState("undefined"!=typeof window?window.innerWidth:1500),f=E[0],g=E[1];o.useEffect((function(){var e=function(){return g(window.innerWidth)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var h=null===(t=y.loyaltySpendingMethods)||void 0===t?void 0:t.filter((function(e){return e.type===A.FREE_PRODUCT})),L=null!==(n=null==h?void 0:h.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:[],P=L.length?Math.min.apply(Math,L):null,k=L.length?Math.max.apply(Math,L):null,N=1===(null===(i=y.loyaltySpendingMethods)||void 0===i?void 0:i.length),S=function(e){var t,n,i,a,l,s="",r=null;return e.type===A.FIXED_AMOUNT&&e.isDynamic&&(s=N?"".concat(I("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmount")," (").concat(I("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,y.checkout.currencyCode,y.checkout.currencySymbol)}),")"):I("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmount"),r=o.createElement(b,null)),e.type===A.FREE_SHIPPING&&(s=I("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeShipping"),r=o.createElement(j,null)),e.type!==A.FIXED_AMOUNT||e.isDynamic||(s=N?I("checkout-page:loyaltyPointsLinesModalContentItemTitleFixedAmountOneRow",{value:d((null===(i=e.discountSettings)||void 0===i?void 0:i.discountAmount)||0,y.checkout.currencyCode,y.checkout.currencySymbol)}):I("checkout-page:loyaltyPointsLinesModalContentItemTitleFixedAmount",{value:d((null===(a=e.discountSettings)||void 0===a?void 0:a.discountAmount)||0,y.checkout.currencyCode,y.checkout.currencySymbol)}),r=o.createElement(b,null)),e.type===A.FREE_PRODUCT&&(s=I("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProduct"),r=o.createElement(T,null)),e.type===A.RATIO&&(s="".concat(I("checkout-page:loyaltyPointsLinesModalContentItemTitleRatio")," (%").concat((null===(l=e.discountSettings)||void 0===l?void 0:l.discountAmount)||0,")"),r=o.createElement(b,null)),{title:s,icon:r}},I=u().t,M=null!==(l=null===(a=y.loyaltySpendingMethods)||void 0===a?void 0:a.filter((function(e){return e.type!==A.FREE_PRODUCT})))&&void 0!==l?l:[],x=f>1380||v?h&&h.length>0?2:3:f<1100?h&&h.length>0?0:1:h&&h.length>0?1:2,O=M.slice(0,Math.min(x,M.length));return 1===(null===(s=y.loyaltySpendingMethods)||void 0===s?void 0:s.length)?o.createElement("div",{className:C.LoyaltyPointsContainer},o.createElement("div",{className:C.LoyaltyPointsLineOneRow,onClick:function(){return p(!0)}},o.createElement("div",{className:C.LoyaltyPointsLineOneRowTitle},S(null===(r=y.loyaltySpendingMethods)||void 0===r?void 0:r[0]).icon&&S(null===(c=y.loyaltySpendingMethods)||void 0===c?void 0:c[0]).icon,o.createElement("span",{className:C.LoyaltyPointsLineOneRowTitleText},S(null===(m=y.loyaltySpendingMethods)||void 0===m?void 0:m[0]).title)),o.createElement(w,null))):o.createElement("div",{className:C.LoyaltyPointsContainer},o.createElement("div",{className:C.LoyaltyPointsTitle},I("checkout-page:loyaltyPointsTitle")),o.createElement("div",{className:C.LoyaltyPointsLines},O.map((function(e){var t;return o.createElement("div",{key:e.id,className:C.LoyaltyPointsLine,onClick:function(){return p(!0)}},o.createElement("div",{className:C.LoyaltyPointsLineTitle},S(e).icon&&S(e).icon,o.createElement("span",{className:C.LoyaltyPointsLineTitleText},S(e).title)),o.createElement("span",{className:C.LoyaltyPointsLineValue},(null===(t=e.discountSettings)||void 0===t?void 0:t.point)||0," ",I("checkout-page:loyaltyPoint")))})),h&&h.length>0&&o.createElement("div",{className:C.LoyaltyPointsLine,onClick:function(){return p(!0)}},o.createElement("div",{className:C.LoyaltyPointsLineTitle},o.createElement(T,null),o.createElement("span",{className:C.LoyaltyPointsLineTitleText},I("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProduct"))),o.createElement("span",{className:C.LoyaltyPointsLineValue},P&&k?"".concat(P," ~ ").concat(k):""," ",I("checkout-page:loyaltyPoint"))),o.createElement("div",{className:[C.LoyaltyPointsLine,C.LoyaltyPointsLineAllMain].join(" "),onClick:function(){return p(!0)}},o.createElement("div",{className:C.LoyaltyPointsLineAllContainer},o.createElement("span",{className:C.LoyaltyPointsLineAll},I("checkout-page:loyaltyPointsViewAll")),o.createElement(w,null)))))})),K=i((function(i){var a,l,s,r,m,y,p,v,E,g,h,L,k,N=i.vm,S=i.isVisibleLoyaltyPoints,I=i.setIsVisibleLoyaltyPoints,M=o.useState(!1),x=M[0],w=M[1],H=o.useState(!1),B=H[0],G=H[1],X=o.useState(!1),z=X[0],W=X[1],q=o.useState(!1),Y=q[0],$=q[1],K=o.useState(!1),Q=K[0],J=K[1],Z=o.useState(!1),ee=Z[0],te=Z[1],ne=o.useState(null),oe=ne[0],ie=ne[1],ae=o.useState(0),le=ae[0],se=ae[1];o.useEffect((function(){if(S&&!Q){var e=requestAnimationFrame((function(){requestAnimationFrame((function(){return te(!0)}))}));return function(){return cancelAnimationFrame(e)}}S||te(!1)}),[S,Q]),o.useEffect((function(){if(Q){var e=setTimeout((function(){I(!1),J(!1)}),250);return function(){return clearTimeout(e)}}}),[Q]);var re=o.useCallback((function(){J(!0)}),[]),ce=o.useCallback((function(){G(!0)}),[]),de=o.useCallback((function(){$(!0)}),[]);o.useEffect((function(){if(B){var e=setTimeout((function(){w(!1),G(!1)}),180);return function(){return clearTimeout(e)}}}),[B]),o.useEffect((function(){if(Y){var e=setTimeout((function(){W(!1),ie(null),$(!1)}),180);return function(){return clearTimeout(e)}}}),[Y]),o.useEffect((function(){var e,t;if(oe){var n=(null===(e=oe.discountSettings)||void 0===e?void 0:e.point)||1,o=null===(t=oe.pointUsageLimit)||void 0===t?void 0:t.minPointLimit;se("number"==typeof o&&o>0?o:n)}}),[oe]);var ue=null===(a=N.loyaltySpendingMethods)||void 0===a?void 0:a.filter((function(e){return e.type===A.FREE_PRODUCT})),me=o.useState("undefined"!=typeof window?window.innerHeight:1200),ye=me[0],pe=me[1];o.useEffect((function(){var e=function(){return pe(window.innerHeight)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),o.useEffect((function(){S&&ge((null==ue?void 0:ue.map((function(e){var t;return(null===(t=e.discountSettings)||void 0===t?void 0:t.freeProductId)||""})))||[])}),[S]);var ve=o.useState([]),Ee=ve[0],fe=ve[1],ge=function(n){return e(void 0,void 0,void 0,(function(){var e,o,i;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===(i=e.data)||void 0===i?void 0:i.data)||[],fe(o.map((function(e){var t,n,o,i,a,l;return{id:e.id,name:e.name,mainImageSrc:new V({id:(null===(a=null===(i=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===i?void 0:i.image)||void 0===a?void 0:a.id)||null,isVideo:!1}).thumbnailSrc,variants:(null===(l=e.variants)||void 0===l?void 0:l.map((function(e){var t,n,o,i;return{id:e.id,mainImageSrc:new V({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===(i=e.variantValues)||void 0===i?void 0:i.map((function(e){return e.name})).join(" / "))||null}})))||[]}}))),[2]}}))}))},he=null!==(l=null==ue?void 0:ue.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:[],Ce=he.length?Math.min.apply(Math,he):null,Le=he.length?Math.max.apply(Math,he):null,Pe=function(e){var t,n,i="",a=null;return e.type===A.FIXED_AMOUNT&&e.isDynamic&&(i=Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmount"),a=o.createElement(b,null)),e.type===A.FREE_SHIPPING&&(i=Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeShipping"),a=o.createElement(j,null)),e.type!==A.FIXED_AMOUNT||e.isDynamic||(i=Ie("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===A.FREE_PRODUCT&&(i=Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProduct"),a=o.createElement(T,null)),e.type===A.RATIO&&(i="".concat(Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleRatio")," (%").concat((null===(n=e.discountSettings)||void 0===n?void 0:n.discountAmount)||0,")"),a=o.createElement(b,null)),{title:i,icon:a}},ke=null===(s=N.loyaltySpendingMethods)||void 0===s?void 0:s.filter((function(e){return e.type!==A.FREE_PRODUCT})),Ne=function(e,t){var n,o,i,a,l=null!==(o=null===(n=N.loyaltyCustomerInfo)||void 0===n?void 0:n.totalPoint)&&void 0!==o?o:0;return(null==t?void 0:t.type)===A.FIXED_AMOUNT&&(null==t?void 0:t.isDynamic)?!!((null===(i=t.pointUsageLimit)||void 0===i?void 0:i.minPointLimit)&&(null===(a=t.pointUsageLimit)||void 0===a?void 0:a.minPointLimit)>l):!l||l<e},Se=function(o,i,a){return e(void 0,void 0,void 0,(function(){var e,l;return t(this,(function(t){switch(t.label){case 0:return[4,F({input:n({cartId:N.checkout.id,loyaltyProgramId:o,loyaltySpendingMethodId:i},a?{amount:a}:{})})];case 1:return(e=t.sent()).isSuccess?(re(),l=e.data,N.checkout=new _(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]}}))}))},Ie=u().t;if(!S&&!Q)return null;var Me=[C.LoyaltyPointsLinesModalContainer,ee&&!Q&&C.LoyaltyPointsLinesModalContainerVisible,Q&&C.LoyaltyPointsLinesModalContainerClosing].filter(Boolean).join(" ");return o.createElement("div",{className:Me,onClick:re,role:"presentation"},o.createElement("div",{className:C.LoyaltyPointsLinesModal,onClick:function(e){return e.stopPropagation()},role:"dialog","aria-modal":"true"},o.createElement("span",{onClick:re,className:C.LoyaltyPointsLinesModalCloseButton},o.createElement(f,null)),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeader},o.createElement("div",{className:C.LoyaltyPointsLinesModalHeaderTitle},Ie("checkout-page:loyaltyPointsLinesModalTitle")),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeaderDescription},Ie("checkout-page:loyaltyPointsLinesModalDescription"))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContent,style:z?{maxHeight:"316px"}:{maxHeight:ye<748?ye-140+"px":650}},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeader},o.createElement("span",null,Ie("checkout-page:loyaltyPointsLinesModalCurrentPoints")," "),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValue},o.createElement("div",{style:{width:"18px",height:"18px"}},o.createElement(O,null)),o.createElement("span",null,(null===(r=N.loyaltyCustomerInfo)||void 0===r?void 0:r.totalPoint)||0," ",Ie("checkout-page:loyaltyPoint")))),null==ke?void 0:ke.map((function(n,i){var a,l,s,r;return o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItems},o.createElement("div",{className:[C.LoyaltyPointsLinesModalContentItem,0===i?C.LoyaltyPointsLinesModalContentItemsFirst:"",i!==((null==ke?void 0:ke.length)||0)-1||ue?"":C.LoyaltyPointsLinesModalContentItemsLast].join(" ")},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueIconContainer},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueIcon},Pe(n).icon&&Pe(n).icon),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMain},o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainTitle},Pe(n).title),o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainValue},n.type===A.FIXED_AMOUNT&&n.isDynamic?Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmountDescription",{point:(null===(a=n.discountSettings)||void 0===a?void 0:a.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(Ie("checkout-page:loyaltyPoint"))))),o.createElement("div",null,o.createElement("button",{type:"button",disabled:Ne((null===(r=n.discountSettings)||void 0===r?void 0:r.point)||0,n),onClick:function(){return e(void 0,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:return e=(null===(o=n.discountSettings)||void 0===o?void 0:o.point)||0,Ne(e,n)?[2]:n.type===A.FIXED_AMOUNT&&n.isDynamic?(ie(n),W(!0),[3,3]):[3,1];case 1:return[4,Se(n.loyaltyProgramId,n.id)];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},className:C.LoyaltyPointsLinesModalContentItemButton},Ie("checkout-page:loyaltyPointsLineItemButtonApply")))))})),ue&&ue.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},Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProduct")),o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainValue},Ce&&Le?"".concat(Ce," ~ ").concat(Le):""," ",Ie("checkout-page:loyaltyPoint")))),o.createElement("div",null,o.createElement("button",{type:"button",disabled:function(){var e,t,n=null!==(t=null===(e=N.loyaltyCustomerInfo)||void 0===e?void 0:e.totalPoint)&&void 0!==t?t:0;return!n||n<(null!=Ce?Ce:0)}(),className:C.LoyaltyPointsLinesModalContentItemButton,onClick:function(){var e,t,n=null!==(t=null===(e=N.loyaltyCustomerInfo)||void 0===e?void 0:e.totalPoint)&&void 0!==t?t:0;!n||n<(null!=Ce?Ce:0)||w(!0)}},Ie("checkout-page:loyaltyPointsLineItemButtonSelectGift")))))),(x||B)&&o.createElement("div",{className:C.LoyaltyPointsGiftModalOverlay},o.createElement("div",{className:[C.LoyaltyPointsGiftModal,B&&C.LoyaltyPointsGiftModalClosing].filter(Boolean).join(" ")},o.createElement("span",{onClick:re,className:C.LoyaltyPointsLinesModalCloseButton},o.createElement(f,null)),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeader},o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",cursor:"pointer"},onClick:ce,className:C.LoyaltyPointsLinesModalHeaderTitle},o.createElement(R,null),Ie("checkout-page:loyaltyPointsGiftModalTitle")),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeaderDescription},Ie("checkout-page:loyaltyPointsGiftModalDescription"))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContent},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeader},o.createElement("span",null,Ie("checkout-page:loyaltyPointsLinesModalCurrentPoints")," "),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValue},o.createElement("div",{style:{width:"18px",height:"18px"}},o.createElement(O,null)),o.createElement("span",null,(null===(m=N.loyaltyCustomerInfo)||void 0===m?void 0:m.totalPoint)||0," ",Ie("checkout-page:loyaltyPoint")))),null==Ee?void 0:Ee.map((function(n,i){var a,l,s,r,c,d;return o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItems},o.createElement("div",{className:[C.LoyaltyPointsLinesModalContentItemFreeProduct,C.LoyaltyPointsLinesModalContentItem,0===i?C.LoyaltyPointsLinesModalContentItemsFirst:"",i===((null==Ee?void 0:Ee.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===(a=n.variants)||void 0===a?void 0:a.find((function(e){var t,o;return e.id===(null===(o=null===(t=null==ue?void 0:ue.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==ue?void 0:ue.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," ",Ie("checkout-page:loyaltyPoint")))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemButtonContainerMobile},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemPointMobile},(null===(d=null===(c=null==ue?void 0:ue.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," ",Ie("checkout-page:loyaltyPoint")),function(){var i,a=null==ue?void 0:ue.find((function(e){var t;return(null===(t=e.discountSettings)||void 0===t?void 0:t.freeProductId)===n.id})),l=(null===(i=null==a?void 0:a.discountSettings)||void 0===i?void 0:i.point)||0,s=Ne(l,a);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||!a?[2]:[4,Se(a.loyaltyProgramId,a.id)];case 1:return e.sent(),[2]}}))}))},className:C.LoyaltyPointsLinesModalContentItemButton},Ie("checkout-page:loyaltyPointsLineItemButtonAddFree"))}())))}))))),(z&&oe||Y)&&o.createElement("div",{className:C.LoyaltyPointsGiftModalOverlay},o.createElement("div",{className:[C.LoyaltyPointsGiftModal,Y&&C.LoyaltyPointsGiftModalClosing].filter(Boolean).join(" ")},o.createElement("span",{onClick:re,className:C.LoyaltyPointsLinesModalCloseButton},o.createElement(f,null)),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeader},o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",cursor:"pointer"},onClick:de,className:C.LoyaltyPointsLinesModalHeaderTitle},o.createElement(R,null),Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleFixedAmount",{value:d((null===(y=null==oe?void 0:oe.discountSettings)||void 0===y?void 0:y.discountAmount)||0,N.checkout.currencyCode,N.checkout.currencySymbol)})),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeaderDescription},Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmountDescription",{point:(null===(p=null==oe?void 0:oe.discountSettings)||void 0===p?void 0:p.point)||0,amount:d((null===(v=null==oe?void 0:oe.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,Ie("checkout-page:loyaltyPointsLinesModalCurrentPoints")," "),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValue},o.createElement("div",{style:{width:"18px",height:"18px"}},o.createElement(O,null)),o.createElement("span",null,(null===(E=N.loyaltyCustomerInfo)||void 0===E?void 0:E.totalPoint)||0," ",Ie("checkout-page:loyaltyPoint")))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemSlider},o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfo},o.createElement("span",null,le," ",Ie("checkout-page:loyaltyPoint")),o.createElement(U,null),o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfoValue},o.createElement(b,null),o.createElement("span",null,d(le/((null===(g=null==oe?void 0:oe.discountSettings)||void 0===g?void 0:g.point)||1)*((null===(h=null==oe?void 0:oe.discountSettings)||void 0===h?void 0:h.discountAmount)||0),N.checkout.currencyCode,N.checkout.currencySymbol)))),o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfoSlider},function(){var e,t,n,i,a,l,s,r=(null===(e=null==oe?void 0:oe.discountSettings)||void 0===e?void 0:e.point)||1,c=null!==(n=null===(t=null==oe?void 0:oe.pointUsageLimit)||void 0===t?void 0:t.minPointLimit)&&void 0!==n?n:r,d=null!==(s=null!==(a=null===(i=null==oe?void 0:oe.pointUsageLimit)||void 0===i?void 0:i.maxPointLimit)&&void 0!==a?a:null===(l=N.loyaltyCustomerInfo)||void 0===l?void 0:l.totalPoint)&&void 0!==s?s:r,u=Math.max(d-c,0),m=u>0?(le-c)/u*100:0,y=Math.min(100,Math.max(0,m));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:le,onChange:function(e){return se(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,Se(oe.loyaltyProgramId,oe.id,le)];case 1:return e.sent(),[2]}}))}))},style:{width:"100%"},text:Ie("checkout-page:loyaltyPointsLineItemButtonApplyAmount",{amount:d(le/((null===(L=null==oe?void 0:oe.discountSettings)||void 0===L?void 0:L.point)||1)*((null===(k=null==oe?void 0:oe.discountSettings)||void 0===k?void 0:k.discountAmount)||0),N.checkout.currencyCode,N.checkout.currencySymbol)})})))))))})),Q=i((function(e){var t=e.vm,n=e.isAddingNote,i=e.setAddingNote,a=u().t,l=o.useState(t.checkout.note?a("checkout-page:editOrderNote"):a("checkout-page:addOrderNote"))[0],s=o.useCallback((function(){i(!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},a("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,W as Coupon,H as CouponErrorCode,$ as LoyaltyPointsLine};
|
|
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 i}from"mobx-react-lite";import a 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 u}from"../../../../utils/i18n.js";import{CartItem as m}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 f from"../svg/cross.js";import g from"../svg/gift.js";import h 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{IkasCartCreatedBy as k,IkasCampaignCreatedFor as N,IkasGiftCardType as S}from"@ikas/storefront-models";import I from"../../../../hooks/useDimension.js";import M from"../svg/coupon-code-tag.js";import x from"../svg/gift-cart-tag.js";import T from"../svg/store-credit-tag.js";import j from"../svg/gift-loyalty.js";import b from"../svg/package-loyalty.js";import w from"../svg/percentage-loyalty.js";import O from"../svg/arrow-loyalty.js";import A from"../svg/star-loyalty.js";import{LoyaltyProgramMethodSpendingTypeEnum as D,searchProducts as F,useLoyaltyPoints as R}from"@ikas/storefront-api";import _ 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 V}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 U}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 H from"../svg/arrow-right-loyalty.js";var B;!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"}(B||(B={}));var G=i((function(e){var t,n,i,a,l,y,p,v,f,g,h,P,N=e.vm,S=e.allowExpand,M=e.isSuccessPageSummary,x=N.checkout,T=u().t,j=o.useState(!S),b=j[0],w=j[1],O=o.useState(!1),A=O[0],D=O[1],F=o.useState(null),R=F[0],_=F[1],V=o.useState(0),U=V[0],H=V[1],G=o.useState(null),Y=G[0],$=G[1],Z=o.useState(!1),ee=Z[0],te=Z[1],ne=o.useState(!1),oe=ne[0],ie=ne[1],ae=o.useState(!1),le=ae[0],se=ae[1],re=I().isMobile;o.useEffect((function(){S&&(b?Y&&H(Y.getBoundingClientRect().height):H(0))}),[b,Y,S,ee,oe,A,le]);var ce=o.useMemo((function(){switch(R){case B.COUPON_CODE_NOT_EXIST:return T("checkout-page:giftCodeErrorDescription");case B.COUPON_CODE_NOT_EXIST_FOR_GUESS:return T("checkout-page:mustBeSignInToApplyCampaign");case B.COUPON_APPLIED_WITHOUT_DISCOUNT:return T("checkout-page:couponInvalidForCartItems");default:return""}}),[R]),de=[C.CartSummary,S?C.HideOnDesktop:"",M?C.SuccessPageCartSummary:""].join(" "),ue=S?{height:U+"px"}:void 0,me=[C.ArrowDown,b?C.Rotated:""].join(" "),ye=!!(null===(t=N.loyaltySpendingMethods)||void 0===t?void 0:t.length)&&(null===(n=N.loyaltySpendingMethods)||void 0===n?void 0:n.length)>0&&!re&&!!(null===(i=N.customizationProps)||void 0===i?void 0:i.showLoyaltyPoints)&&!N.isOpenEditOrderWithTransaction&&!(N.checkout.createdBy===k.UPSELL||N.checkout.createdBy===k.ADMIN);return x?o.createElement(o.Fragment,null,!!S&&o.createElement(o.Fragment,null,o.createElement("div",{id:"checkout-mobile-summary-header"}),o.createElement("div",{className:C.ExpandHeader,onClick:function(){if(!b){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}w(!b)}},o.createElement("div",{className:C.Left},T("checkout-page:summary")),o.createElement("div",{className:C.Price},o.createElement("span",{className:C.PriceText},"".concat(d(N.finalPrice||0,x.currencyCode,x.currencySymbol)," (").concat(x.itemQuantity," ").concat(T("checkout-page:cartItemProduct"),")")),o.createElement("span",{className:me},o.createElement(E,null))))),o.createElement("div",{className:de},o.createElement("div",{className:[C.DetailsContainer,M?C.SuccessPageDetailContainer:""].join(" "),style:ue},o.createElement("div",{className:C.Details,ref:$},o.createElement("div",{className:C.ItemsContainer},o.createElement("div",null,x.items.map((function(e,t){return o.createElement(m,{key:t,vm:N,cartItem:e,currencyCode:x.currencyCode,onChange:se,isSuccessPageSummary:M})})))),o.createElement("div",{className:C.Divider}),o.createElement("div",{className:C.SubTotalInfo},A&&o.createElement("div",{className:C.NotificationContainer},o.createElement(s,{type:"warning",title:T("checkout-page:giftCodeErrorTitle"),content:ce,onClose:function(){D(!1),_(null)}})),o.createElement(X,{label:T("checkout-page:subtotal"),value:x.formattedTotalPrice,tooltipText:T("checkout-page:subtotalTooltip"),hideMarginBottom:!(N.isCouponCodeVisible||(null===(a=N.checkout.giftCardLines)||void 0===a?void 0:a.length)||(null===(l=N.checkout.loyaltyLines)||void 0===l?void 0:l.length)||(null===(y=N.checkout.nonCouponAdjustments)||void 0===y?void 0:y.length))}),!!(null===(p=x.shippingLines)||void 0===p?void 0:p.length)&&(N.step===r.SUCCESS?o.createElement(X,{label:T("checkout-page:cartShippingTitle"),value:x.shippingTotal?x.formattedShippingTotal:T("checkout-page:free")}):x.shippingLines.map((function(e,t){return o.createElement(X,{key:t,label:e.paymentMethod?e.title:T("checkout-page:cartShippingTitle"),value:e.finalPrice?d(e.finalPrice,x.currencyCode,x.currencySymbol):T("checkout-page:free")})}))),o.createElement(W,{vm:N}),o.createElement(z,{vm:N}),(N.step===r.SUCCESS&&(!!N.checkout.note||!!N.checkout.appliedCouponCode)||N.step!==r.SUCCESS)&&N.isCouponCodeVisible&&o.createElement("div",{className:C.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),ye&&o.createElement(K,{vm:N,isVisibleLoyaltyPoints:N.isLoyaltyPointsVisible,setIsVisibleLoyaltyPoints:N.setIsLoyaltyPointsVisible,isMobile:re}),o.createElement(Q,{vm:N,isVisibleLoyaltyPoints:N.isLoyaltyPointsVisible,setIsVisibleLoyaltyPoints:N.setIsLoyaltyPointsVisible}),o.createElement(q,{vm:N,isAddingCoupon:oe,setAddingCoupon:ie,setCouponError:D,setCouponErrorCode:_}),o.createElement(J,{vm:N,isAddingNote:ee,setAddingNote:te}),!!N.installmentExtraPrice&&N.installmentExtraPrice>0&&o.createElement(o.Fragment,null,o.createElement("div",{className:C.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement(X,{label:T("checkout-page:cartInterest"),value:d(N.installmentExtraPrice,x.currencyCode,x.currencySymbol)}))),N.isOpenEditOrderWithTransaction&&o.createElement("div",{className:C.SubTotalInfo,style:{}},!!(null===(v=N.openEditOrderTransaction)||void 0===v?void 0:v.chargedAmount)&&o.createElement(X,{label:T("checkout-page:chargedAmount"),value:d((null===(f=N.openEditOrderTransaction)||void 0===f?void 0:f.chargedAmount)||0,x.currencyCode,x.currencySymbol)}),!!(null===(g=N.openEditOrderTransaction)||void 0===g?void 0:g.refundedAmount)&&o.createElement(X,{label:T("checkout-page:refundedAmount"),value:d((null===(h=N.openEditOrderTransaction)||void 0===h?void 0:h.refundedAmount)||0,x.currencyCode,x.currencySymbol)})),o.createElement("div",{className:[C.TotalContainer,M?C.SuccessPageTotalContainer:""].join(" ")},o.createElement("div",{className:C.TitleContainer},o.createElement("div",{className:C.Title},N.isOpenEditOrderWithTransaction?T("checkout-page:totalAmountPayable"):T("checkout-page:total"))),o.createElement("div",null,o.createElement("div",{className:C.TotalPricesContainer},o.createElement("div",{className:C.TotalPrice},d(N.finalPrice||0,x.currencyCode,x.currencySymbol)),!!x.$totalTax&&!!(null===(P=N.customizationProps)||void 0===P?void 0:P.showTax)&&o.createElement("div",{className:[C.TotalTax].join(" ")},T("checkout-page:cartTaxTitle")+" "+x.$formattedTotalTax)))),!!N.loyaltyEarningMethod&&!!N.loyaltyCustomerInfo&&o.createElement("div",{className:C.LoyaltyEarningMethod},o.createElement("div",{className:C.LoyaltyEarningMethodTitle},T("checkout-page:loyaltyEarningMethodTitle",{value:(N.loyaltyEarningMethod.pointsEarned/(N.loyaltyEarningMethod.amountPerPointsEarned||1)*N.finalPrice).toFixed(2)}))),!M&&!N.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})),X=i((function(e){var t=e.label,n=e.value,i=e.tooltipText,a=e.hideMarginBottom;return o.createElement("div",{className:[C.InfoRow,a?C.hideMb:""].join(" ")},o.createElement("div",{className:C.Label},o.createElement("span",null,t),!!i&&o.createElement(v,{text:i,style:{marginLeft:"8px"}})),o.createElement("div",{className:C.Value},n))})),W=i((function(e){var t=e.vm,n=u().t;return t.checkout?o.createElement(o.Fragment,null,a(t.checkout.nonCouponAdjustments||[],"order").filter((function(e){return e.createdFor!==N.LOYALTY_SPEND})).map((function(e,i){return o.createElement("div",{className:C.InfoRow,key:i},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})),z=i((function(e){var t,n=e.vm,i=u().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(g,{style:{position:"relative",top:"-1px"}}),o.createElement("span",null,i("checkout-page:giftPackage")))),o.createElement("div",{className:C.Value},o.createElement("span",null,d(e.price,n.checkout.currencyCode,n.checkout.currencySymbol))))}))):null})),q=i((function(n){var i=n.vm,a=n.isAddingCoupon,s=n.setAddingCoupon,c=n.setCouponError,d=n.setCouponErrorCode,m=n.isOpenCouponCode,v=n.isMobile,E=n.showOnlyMobile,f=u().t,g=o.useState(""),L=g[0],k=g[1],N=o.useState(!1),S=N[0],I=N[1],M=o.useRef(null);o.useEffect((function(){a&&M.current&&M.current.focus()}),[a]);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 i.checkout.couponCode=L,I(!0),[4,i.onCouponCodeApply(!0)];case 1:return t.sent(),I(!1),k(""),e=i.checkout.giftCardLines&&!!i.checkout.giftCardLines.length,i.couponError?[3,4]:i.checkout.appliedCouponCode||e?(c(!1),d(null),[4,i.reInitPaymentMethod()]):[3,3];case 2:t.sent(),t.label=3;case 3:return[3,5];case 4:i.checkout.couponCode=null,c(!0),d(i.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 I(!0),[4,i.removeGiftCardLine(n)];case 1:return e.sent(),[4,i.reInitPaymentMethod()];case 2:return e.sent(),I(!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 I(!0),[4,i.removeLoyaltyPointsFromCart(n)];case 1:return e.sent(),[4,i.reInitPaymentMethod()];case 2:return e.sent(),I(!1),[2]}}))}))};i.step,r.SUCCESS;var b=i.step===r.SHIPPING,w=!!i.checkout.appliedCouponCode||!!(i.checkout.giftCardLines&&i.checkout.giftCardLines.length>0)||!!(i.checkout.loyaltyLines&&i.checkout.loyaltyLines.length>0),O=!!i.checkout.appliedCouponCode&&m,A=!a&&i.isCouponCodeVisible&&!i.isCouponCodeRequirementOpen&&i.step!==r.SUCCESS,D=w&&(!m||v);return o.createElement(o.Fragment,null,!!m&&o.createElement(o.Fragment,null,o.createElement("div",{className:[C.CartSummary,C.OpenCouponCodeSummary].join(" ")},o.createElement("div",{className:h.FormSectionTitle},o.createElement("div",{style:{paddingBottom:O?0:6},className:h.Title},f("checkout-page:couponCode"))))),w&&!b&&!i.isCouponCodeRequirementDefult&&o.createElement("div",{className:C.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement("div",{className:A?C.InfoRow:""},A&&o.createElement("div",{className:C.ActionTextBtn,onClick:function(){return s(!0)}},f("checkout-page:addCouponCode")),a&&!m&&o.createElement("div",{style:{marginBottom:"10px"}},o.createElement(l,{value:L,placeholder:f("checkout-page:couponCode"),buttonLabel:f("checkout-page:actions.apply"),inputRef:M,onClick:x,isLoading:S,onChange:k})),m&&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:f("checkout-page:addCouponCode"),type:p.TEXT,value:L,onChange:k}),o.createElement(P,{style:{width:"33%"},text:f("checkout-page:actions.apply"),isLoading:S,onClick:x}))),D&&o.createElement(o.Fragment,null,!!i.checkout.appliedCouponCode&&o.createElement("div",{className:[C.InfoRow,E?C.InfoRowGiftCardMobile:""].join(" ")},o.createElement(Y,{vm:i,onClearCouponCode:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return i.checkout.couponCode=null,I(!0),[4,i.onCouponCodeApply(!1)];case 1:return e.sent(),[4,i.reInitPaymentMethod()];case 2:return e.sent(),I(!1),[2]}}))}))},couponCode:i.checkout.appliedCouponCode})),!!i.checkout.giftCardLines&&!!i.checkout.giftCardLines.length&&i.checkout.giftCardLines.map((function(e){return o.createElement("div",{className:[C.InfoRow,E?C.InfoRowGiftCardMobile:""].join(" ")},o.createElement(Y,{vm:i,onClearGiftCode:T,couponCode:e.code,giftCardLine:e}))})),!!i.checkout.loyaltyLines&&!!i.checkout.loyaltyLines.length&&i.checkout.loyaltyLines.map((function(e){return o.createElement("div",{className:[C.InfoRow,E?C.InfoRowGiftCardMobile:""].join(" ")},o.createElement($,{vm:i,onClearLoyaltyPoints:j,loyaltyPointsLine:e}))}))))})),Y=i((function(e){var t=e.vm,n=e.onClearCouponCode,i=e.couponCode,a=e.giftCardLine,l=e.onClearGiftCode,s=t.checkout.couponAdjustment,c=u().t,m=!a,y=(null==a?void 0:a.type)===S.STORE_CREDIT;return o.createElement(o.Fragment,null,o.createElement("div",{className:[C.ActionTextBtn,C.NoUnderline].join(" ")},a&&y&&o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"5px"}},o.createElement("span",{style:{height:"20px"}},o.createElement(T,null)),o.createElement("span",{className:C.StoreCreditTag},c("checkout-page:storeCredit"))),!y&&o.createElement("span",{className:[C.AppliedCoupon,t.isCouponCodeRequirementDefult?"":C.NotClosed].join(" ")},m?o.createElement("span",{style:{height:"16px"}},o.createElement(M,null)):!y&&o.createElement("span",{style:{height:"16px"}},o.createElement(x,null)),o.createElement("span",{className:C.CouponCode},i),t.step!==r.SUCCESS&&!t.isOpenEditOrderWithTransaction&&o.createElement("span",{className:C.ClearCoupon,onClick:function(){return a?l&&l(a.giftCardId):n&&n()}},o.createElement(f,null)))),o.createElement("div",null,a?o.createElement("div",{className:C.Value},o.createElement("span",null,"-")," ",o.createElement("span",null,d((null==a?void 0:a.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)))))})),$=i((function(e){var t,n,i=e.vm,a=e.onClearLoyaltyPoints,l=e.loyaltyPointsLine,s=null===(t=i.checkout.nonCouponAdjustments)||void 0===t?void 0:t.find((function(e){return e.campaignId===l.id})),c=u().t,m=null===(n=i.loyaltySpendingMethodsAll)||void 0===n?void 0:n.find((function(e){return e.id===l.loyaltySpendingMethodId})),y=function(){return m?m.type===D.FREE_PRODUCT?{icon:o.createElement(j,null),title:c("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProductAdded")}:m.type===D.FREE_SHIPPING?{icon:o.createElement(b,null),title:c("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeShipping")}:{icon:o.createElement(w,null),title:c("checkout-page:loyaltyPointsLinesModalContentItemTitleFixedAmount",{value:d((null==s?void 0:s.amount)||0,i.checkout.currencyCode,i.checkout.currencySymbol)})}:{icon:o.createElement(w,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,i.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),i.step!==r.SUCCESS&&!i.isOpenEditOrderWithTransaction&&o.createElement("span",{className:C.ClearCouponLoyalty,onClick:function(){return a&&a(l.loyaltySpendingMethodId)}},o.createElement(f,null)))),o.createElement("span",{className:C.LoyaltyPointSpending},"(",c("checkout-page:loyaltyPointSpending",{point:l.amount}),")")),m?m.type!==D.FREE_PRODUCT&&m.type!==D.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,i.checkout.currencyCode,i.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,i.checkout.currencyCode,i.checkout.currencySymbol)))))})),K=i((function(e){var t,n,i,a,l,s,r,c,m,y=e.vm;e.isVisibleLoyaltyPoints;var p=e.setIsVisibleLoyaltyPoints,v=e.isMobile,E=o.useState("undefined"!=typeof window?window.innerWidth:1500),f=E[0],g=E[1];o.useEffect((function(){var e=function(){return g(window.innerWidth)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var h=null===(t=y.loyaltySpendingMethods)||void 0===t?void 0:t.filter((function(e){return e.type===D.FREE_PRODUCT})),L=null!==(n=null==h?void 0:h.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:[],P=L.length?Math.min.apply(Math,L):null,k=L.length?Math.max.apply(Math,L):null,N=1===(null===(i=y.loyaltySpendingMethods)||void 0===i?void 0:i.length),S=function(e){var t,n,i,a,l,s="",r=null;return e.type===D.FIXED_AMOUNT&&e.isDynamic&&(s=N?"".concat(I("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmount")," (").concat(I("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,y.checkout.currencyCode,y.checkout.currencySymbol)}),")"):I("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmount"),r=o.createElement(w,null)),e.type===D.FREE_SHIPPING&&(s=I("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeShipping"),r=o.createElement(b,null)),e.type!==D.FIXED_AMOUNT||e.isDynamic||(s=N?I("checkout-page:loyaltyPointsLinesModalContentItemTitleFixedAmountOneRow",{value:d((null===(i=e.discountSettings)||void 0===i?void 0:i.discountAmount)||0,y.checkout.currencyCode,y.checkout.currencySymbol)}):I("checkout-page:loyaltyPointsLinesModalContentItemTitleFixedAmount",{value:d((null===(a=e.discountSettings)||void 0===a?void 0:a.discountAmount)||0,y.checkout.currencyCode,y.checkout.currencySymbol)}),r=o.createElement(w,null)),e.type===D.FREE_PRODUCT&&(s=I("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProduct"),r=o.createElement(j,null)),e.type===D.RATIO&&(s="".concat(I("checkout-page:loyaltyPointsLinesModalContentItemTitleRatio")," (%").concat((null===(l=e.discountSettings)||void 0===l?void 0:l.discountAmount)||0,")"),r=o.createElement(w,null)),{title:s,icon:r}},I=u().t,M=null!==(l=null===(a=y.loyaltySpendingMethods)||void 0===a?void 0:a.filter((function(e){return e.type!==D.FREE_PRODUCT})))&&void 0!==l?l:[],x=f>1380||v?h&&h.length>0?2:3:f<1100?h&&h.length>0?0:1:h&&h.length>0?1:2,T=M.slice(0,Math.min(x,M.length));return 1===(null===(s=y.loyaltySpendingMethods)||void 0===s?void 0:s.length)?o.createElement("div",{className:C.LoyaltyPointsContainer},o.createElement("div",{className:C.LoyaltyPointsLineOneRow,onClick:function(){return p(!0)}},o.createElement("div",{className:C.LoyaltyPointsLineOneRowTitle},S(null===(r=y.loyaltySpendingMethods)||void 0===r?void 0:r[0]).icon&&S(null===(c=y.loyaltySpendingMethods)||void 0===c?void 0:c[0]).icon,o.createElement("span",{className:C.LoyaltyPointsLineOneRowTitleText},S(null===(m=y.loyaltySpendingMethods)||void 0===m?void 0:m[0]).title)),o.createElement(O,null))):o.createElement("div",{className:C.LoyaltyPointsContainer},o.createElement("div",{className:C.LoyaltyPointsTitle},I("checkout-page:loyaltyPointsTitle")),o.createElement("div",{className:C.LoyaltyPointsLines},T.map((function(e){var t;return o.createElement("div",{key:e.id,className:C.LoyaltyPointsLine,onClick:function(){return p(!0)}},o.createElement("div",{className:C.LoyaltyPointsLineTitle},S(e).icon&&S(e).icon,o.createElement("span",{className:C.LoyaltyPointsLineTitleText},S(e).title)),o.createElement("span",{className:C.LoyaltyPointsLineValue},(null===(t=e.discountSettings)||void 0===t?void 0:t.point)||0," ",I("checkout-page:loyaltyPoint")))})),h&&h.length>0&&o.createElement("div",{className:C.LoyaltyPointsLine,onClick:function(){return p(!0)}},o.createElement("div",{className:C.LoyaltyPointsLineTitle},o.createElement(j,null),o.createElement("span",{className:C.LoyaltyPointsLineTitleText},I("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProduct"))),o.createElement("span",{className:C.LoyaltyPointsLineValue},P&&k?"".concat(P," ~ ").concat(k):""," ",I("checkout-page:loyaltyPoint"))),o.createElement("div",{className:[C.LoyaltyPointsLine,C.LoyaltyPointsLineAllMain].join(" "),onClick:function(){return p(!0)}},o.createElement("div",{className:C.LoyaltyPointsLineAllContainer},o.createElement("span",{className:C.LoyaltyPointsLineAll},I("checkout-page:loyaltyPointsViewAll")),o.createElement(O,null)))))})),Q=i((function(i){var a,l,s,r,m,y,p,v,E,g,h,L,k,N=i.vm,S=i.isVisibleLoyaltyPoints,I=i.setIsVisibleLoyaltyPoints,M=o.useState(!1),x=M[0],T=M[1],O=o.useState(!1),B=O[0],G=O[1],X=o.useState(!1),W=X[0],z=X[1],q=o.useState(!1),Y=q[0],$=q[1],K=o.useState(!1),Q=K[0],J=K[1],Z=o.useState(!1),ee=Z[0],te=Z[1],ne=o.useState(null),oe=ne[0],ie=ne[1],ae=o.useState(0),le=ae[0],se=ae[1];o.useEffect((function(){if(S&&!Q){var e=requestAnimationFrame((function(){requestAnimationFrame((function(){return te(!0)}))}));return function(){return cancelAnimationFrame(e)}}S||te(!1)}),[S,Q]),o.useEffect((function(){if(Q){var e=setTimeout((function(){I(!1),J(!1)}),250);return function(){return clearTimeout(e)}}}),[Q]);var re=o.useCallback((function(){J(!0)}),[]),ce=o.useCallback((function(){G(!0)}),[]),de=o.useCallback((function(){$(!0)}),[]);o.useEffect((function(){if(B){var e=setTimeout((function(){T(!1),G(!1)}),180);return function(){return clearTimeout(e)}}}),[B]),o.useEffect((function(){if(Y){var e=setTimeout((function(){z(!1),ie(null),$(!1)}),180);return function(){return clearTimeout(e)}}}),[Y]),o.useEffect((function(){var e,t;if(oe){var n=(null===(e=oe.discountSettings)||void 0===e?void 0:e.point)||1,o=null===(t=oe.pointUsageLimit)||void 0===t?void 0:t.minPointLimit;se("number"==typeof o&&o>0?o:n)}}),[oe]);var ue=null===(a=N.loyaltySpendingMethods)||void 0===a?void 0:a.filter((function(e){return e.type===D.FREE_PRODUCT})),me=o.useState("undefined"!=typeof window?window.innerHeight:1200),ye=me[0],pe=me[1];o.useEffect((function(){var e=function(){return pe(window.innerHeight)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),o.useEffect((function(){S&&ge((null==ue?void 0:ue.map((function(e){var t;return(null===(t=e.discountSettings)||void 0===t?void 0:t.freeProductId)||""})))||[])}),[S]);var ve=o.useState([]),Ee=ve[0],fe=ve[1],ge=function(n){return e(void 0,void 0,void 0,(function(){var e,o,i;return t(this,(function(t){switch(t.label){case 0:return(null==n?void 0:n.length)?[4,F({input:{productIdList:n,page:1,perPage:n.length,priceListId:c.getPriceListId(),salesChannelId:c.getSalesChannelId()}},[])]:[2,[]];case 1:return e=t.sent(),o=(null===(i=e.data)||void 0===i?void 0:i.data)||[],fe(o.map((function(e){var t,n,o,i,a,l;return{id:e.id,name:e.name,mainImageSrc:new U({id:(null===(a=null===(i=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===i?void 0:i.image)||void 0===a?void 0:a.id)||null,isVideo:!1}).thumbnailSrc,variants:(null===(l=e.variants)||void 0===l?void 0:l.map((function(e){var t,n,o,i;return{id:e.id,mainImageSrc:new U({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===(i=e.variantValues)||void 0===i?void 0:i.map((function(e){return e.name})).join(" / "))||null}})))||[]}}))),[2]}}))}))},he=null!==(l=null==ue?void 0:ue.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:[],Ce=he.length?Math.min.apply(Math,he):null,Le=he.length?Math.max.apply(Math,he):null,Pe=function(e){var t,n,i="",a=null;return e.type===D.FIXED_AMOUNT&&e.isDynamic&&(i=Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmount"),a=o.createElement(w,null)),e.type===D.FREE_SHIPPING&&(i=Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeShipping"),a=o.createElement(b,null)),e.type!==D.FIXED_AMOUNT||e.isDynamic||(i=Ie("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(w,null)),e.type===D.FREE_PRODUCT&&(i=Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProduct"),a=o.createElement(j,null)),e.type===D.RATIO&&(i="".concat(Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleRatio")," (%").concat((null===(n=e.discountSettings)||void 0===n?void 0:n.discountAmount)||0,")"),a=o.createElement(w,null)),{title:i,icon:a}},ke=null===(s=N.loyaltySpendingMethods)||void 0===s?void 0:s.filter((function(e){return e.type!==D.FREE_PRODUCT})),Ne=function(e,t){var n,o,i,a,l=null!==(o=null===(n=N.loyaltyCustomerInfo)||void 0===n?void 0:n.totalPoint)&&void 0!==o?o:0;return(null==t?void 0:t.type)===D.FIXED_AMOUNT&&(null==t?void 0:t.isDynamic)?!!((null===(i=t.pointUsageLimit)||void 0===i?void 0:i.minPointLimit)&&(null===(a=t.pointUsageLimit)||void 0===a?void 0:a.minPointLimit)>l):!l||l<e},Se=function(o,i,a){return e(void 0,void 0,void 0,(function(){var e,l;return t(this,(function(t){switch(t.label){case 0:return[4,R({input:n({cartId:N.checkout.id,loyaltyProgramId:o,loyaltySpendingMethodId:i},a?{amount:a}:{})})];case 1:return(e=t.sent()).isSuccess?(re(),l=e.data,N.checkout=new V(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]}}))}))},Ie=u().t;if(!S&&!Q)return null;var Me=[C.LoyaltyPointsLinesModalContainer,ee&&!Q&&C.LoyaltyPointsLinesModalContainerVisible,Q&&C.LoyaltyPointsLinesModalContainerClosing].filter(Boolean).join(" ");return o.createElement("div",{className:Me,onClick:re,role:"presentation"},o.createElement("div",{className:C.LoyaltyPointsLinesModal,onClick:function(e){return e.stopPropagation()},role:"dialog","aria-modal":"true"},o.createElement("span",{onClick:re,className:C.LoyaltyPointsLinesModalCloseButton},o.createElement(f,null)),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeader},o.createElement("div",{className:C.LoyaltyPointsLinesModalHeaderTitle},Ie("checkout-page:loyaltyPointsLinesModalTitle")),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeaderDescription},Ie("checkout-page:loyaltyPointsLinesModalDescription"))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContent,style:W?{maxHeight:"316px"}:{maxHeight:ye<748?ye-140+"px":650}},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeader},o.createElement("span",null,Ie("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," ",Ie("checkout-page:loyaltyPoint")))),null==ke?void 0:ke.map((function(n,i){var a,l,s,r;return o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItems},o.createElement("div",{className:[C.LoyaltyPointsLinesModalContentItem,0===i?C.LoyaltyPointsLinesModalContentItemsFirst:"",i!==((null==ke?void 0:ke.length)||0)-1||ue?"":C.LoyaltyPointsLinesModalContentItemsLast].join(" ")},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueIconContainer},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueIcon},Pe(n).icon&&Pe(n).icon),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMain},o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainTitle},Pe(n).title),o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainValue},n.type===D.FIXED_AMOUNT&&n.isDynamic?Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmountDescription",{point:(null===(a=n.discountSettings)||void 0===a?void 0:a.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(Ie("checkout-page:loyaltyPoint"))))),o.createElement("div",null,o.createElement("button",{type:"button",disabled:Ne((null===(r=n.discountSettings)||void 0===r?void 0:r.point)||0,n),onClick:function(){return e(void 0,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:return e=(null===(o=n.discountSettings)||void 0===o?void 0:o.point)||0,Ne(e,n)?[2]:n.type===D.FIXED_AMOUNT&&n.isDynamic?(ie(n),z(!0),[3,3]):[3,1];case 1:return[4,Se(n.loyaltyProgramId,n.id)];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},className:C.LoyaltyPointsLinesModalContentItemButton},Ie("checkout-page:loyaltyPointsLineItemButtonApply")))))})),ue&&ue.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(j,null)),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMain},o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainTitle},Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleFreeProduct")),o.createElement("span",{className:C.LoyaltyPointsLinesModalContentItemHeaderValueTextMainValue},Ce&&Le?"".concat(Ce," ~ ").concat(Le):""," ",Ie("checkout-page:loyaltyPoint")))),o.createElement("div",null,o.createElement("button",{type:"button",disabled:function(){var e,t,n=null!==(t=null===(e=N.loyaltyCustomerInfo)||void 0===e?void 0:e.totalPoint)&&void 0!==t?t:0;return!n||n<(null!=Ce?Ce:0)}(),className:C.LoyaltyPointsLinesModalContentItemButton,onClick:function(){var e,t,n=null!==(t=null===(e=N.loyaltyCustomerInfo)||void 0===e?void 0:e.totalPoint)&&void 0!==t?t:0;!n||n<(null!=Ce?Ce:0)||T(!0)}},Ie("checkout-page:loyaltyPointsLineItemButtonSelectGift")))))),(x||B)&&o.createElement("div",{className:C.LoyaltyPointsGiftModalOverlay},o.createElement("div",{className:[C.LoyaltyPointsGiftModal,B&&C.LoyaltyPointsGiftModalClosing].filter(Boolean).join(" ")},o.createElement("span",{onClick:re,className:C.LoyaltyPointsLinesModalCloseButton},o.createElement(f,null)),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeader},o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",cursor:"pointer"},onClick:ce,className:C.LoyaltyPointsLinesModalHeaderTitle},o.createElement(_,null),Ie("checkout-page:loyaltyPointsGiftModalTitle")),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeaderDescription},Ie("checkout-page:loyaltyPointsGiftModalDescription"))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContent},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemHeader},o.createElement("span",null,Ie("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===(m=N.loyaltyCustomerInfo)||void 0===m?void 0:m.totalPoint)||0," ",Ie("checkout-page:loyaltyPoint")))),null==Ee?void 0:Ee.map((function(n,i){var a,l,s,r,c,d;return o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItems},o.createElement("div",{className:[C.LoyaltyPointsLinesModalContentItemFreeProduct,C.LoyaltyPointsLinesModalContentItem,0===i?C.LoyaltyPointsLinesModalContentItemsFirst:"",i===((null==Ee?void 0:Ee.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===(a=n.variants)||void 0===a?void 0:a.find((function(e){var t,o;return e.id===(null===(o=null===(t=null==ue?void 0:ue.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==ue?void 0:ue.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," ",Ie("checkout-page:loyaltyPoint")))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemButtonContainerMobile},o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemPointMobile},(null===(d=null===(c=null==ue?void 0:ue.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," ",Ie("checkout-page:loyaltyPoint")),function(){var i,a=null==ue?void 0:ue.find((function(e){var t;return(null===(t=e.discountSettings)||void 0===t?void 0:t.freeProductId)===n.id})),l=(null===(i=null==a?void 0:a.discountSettings)||void 0===i?void 0:i.point)||0,s=Ne(l,a);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||!a?[2]:[4,Se(a.loyaltyProgramId,a.id)];case 1:return e.sent(),[2]}}))}))},className:C.LoyaltyPointsLinesModalContentItemButton},Ie("checkout-page:loyaltyPointsLineItemButtonAddFree"))}())))}))))),(W&&oe||Y)&&o.createElement("div",{className:C.LoyaltyPointsGiftModalOverlay},o.createElement("div",{className:[C.LoyaltyPointsGiftModal,Y&&C.LoyaltyPointsGiftModalClosing].filter(Boolean).join(" ")},o.createElement("span",{onClick:re,className:C.LoyaltyPointsLinesModalCloseButton},o.createElement(f,null)),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeader},o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",cursor:"pointer"},onClick:de,className:C.LoyaltyPointsLinesModalHeaderTitle},o.createElement(_,null),Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleFixedAmount",{value:d((null===(y=null==oe?void 0:oe.discountSettings)||void 0===y?void 0:y.discountAmount)||0,N.checkout.currencyCode,N.checkout.currencySymbol)})),o.createElement("div",{className:C.LoyaltyPointsLinesModalHeaderDescription},Ie("checkout-page:loyaltyPointsLinesModalContentItemTitleDynamicAmountDescription",{point:(null===(p=null==oe?void 0:oe.discountSettings)||void 0===p?void 0:p.point)||0,amount:d((null===(v=null==oe?void 0:oe.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,Ie("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," ",Ie("checkout-page:loyaltyPoint")))),o.createElement("div",{className:C.LoyaltyPointsLinesModalContentItemSlider},o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfo},o.createElement("span",null,le," ",Ie("checkout-page:loyaltyPoint")),o.createElement(H,null),o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfoValue},o.createElement(w,null),o.createElement("span",null,d(le/((null===(g=null==oe?void 0:oe.discountSettings)||void 0===g?void 0:g.point)||1)*((null===(h=null==oe?void 0:oe.discountSettings)||void 0===h?void 0:h.discountAmount)||0),N.checkout.currencyCode,N.checkout.currencySymbol)))),o.createElement("div",{className:C.LoyaltyPointsLinesModalSliderInfoSlider},function(){var e,t,n,i,a,l,s,r=(null===(e=null==oe?void 0:oe.discountSettings)||void 0===e?void 0:e.point)||1,c=null!==(n=null===(t=null==oe?void 0:oe.pointUsageLimit)||void 0===t?void 0:t.minPointLimit)&&void 0!==n?n:r,d=null!==(s=null!==(a=null===(i=null==oe?void 0:oe.pointUsageLimit)||void 0===i?void 0:i.maxPointLimit)&&void 0!==a?a:null===(l=N.loyaltyCustomerInfo)||void 0===l?void 0:l.totalPoint)&&void 0!==s?s:r,u=Math.max(d-c,0),m=u>0?(le-c)/u*100:0,y=Math.min(100,Math.max(0,m));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:le,onChange:function(e){return se(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,Se(oe.loyaltyProgramId,oe.id,le)];case 1:return e.sent(),[2]}}))}))},style:{width:"100%"},text:Ie("checkout-page:loyaltyPointsLineItemButtonApplyAmount",{amount:d(le/((null===(L=null==oe?void 0:oe.discountSettings)||void 0===L?void 0:L.point)||1)*((null===(k=null==oe?void 0:oe.discountSettings)||void 0===k?void 0:k.discountAmount)||0),N.checkout.currencyCode,N.checkout.currencySymbol)})})))))))})),J=i((function(e){var t=e.vm,n=e.isAddingNote,i=e.setAddingNote,a=u().t,l=o.useState(t.checkout.note?a("checkout-page:editOrderNote"):a("checkout-page:addOrderNote"))[0],s=o.useCallback((function(){i(!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},a("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{G as CartSummary,q as Coupon,B as CouponErrorCode,K as LoyaltyPointsLine};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{runInAction as t}from"mobx";import{observer as n}from"mobx-react-lite";import a,{FormItemType as o}from"./model.js";import l from"./caret-down.js";import r from"./style.module.scss.js";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../utils/i18n.js";import u from"react-tooltip";import{PhoneNumberInput as c}from"../phone-number-input/index.js";var s=n((function(n){var l=i().t,s=e.useState((function(){return new a(n)})),p=s[0]
|
|
1
|
+
import*as e from"react";import{runInAction as t}from"mobx";import{observer as n}from"mobx-react-lite";import a,{FormItemType as o}from"./model.js";import l from"./caret-down.js";import r from"./style.module.scss.js";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../utils/i18n.js";import u from"react-tooltip";import{PhoneNumberInput as c}from"../phone-number-input/index.js";var s=n((function(n){var l=i().t,s=e.useState((function(){return new a(n)})),p=s[0];s[1];var E=e.useRef(null),v=e.useRef(null),y=e.useRef(null);e.useEffect((function(){u.rebuild()}),[]),e.useEffect((function(){t((function(){p.type=n.type}))}),[n.type]),e.useEffect((function(){t((function(){p.inputType=n.inputType}))}),[n.inputType]),e.useEffect((function(){t((function(){p.inputMode=n.inputMode}))}),[n.inputMode]),e.useEffect((function(){t((function(){p.value=n.value}))}),[n.value]),e.useEffect((function(){t((function(){p.options=n.options}))}),[n.options]),e.useEffect((function(){t((function(){p.label=n.label}))}),[n.label]),e.useEffect((function(){t((function(){p.hasError=n.hasError}))}),[n.hasError]),e.useEffect((function(){t((function(){p.errorText=n.errorText}))}),[n.errorText]),e.useEffect((function(){t((function(){p.textAreaPlaceholder=n.textAreaPlaceholder}))}),[n.textAreaPlaceholder]),e.useEffect((function(){t((function(){p.rightContent=n.rightContent}))}),[n.rightContent]),e.useEffect((function(){t((function(){p.disabled=n.disabled||!1}))}),[n.disabled]),e.useEffect((function(){t((function(){p.isLoading=n.isLoading||!1}))}),[n.isLoading]),e.useEffect((function(){t((function(){p.disableResize=n.disableResize}))}),[n.disableResize]),e.useEffect((function(){t((function(){p.onChange=n.onChange}))}),[n.onChange]),e.useEffect((function(){!p.country&&n.currentCountryCode&&p.onCountryChange(n.currentCountryCode)}),[n.currentCountryCode]);var h=p.type===o.TEXT||p.type===o.TEXT_AREA||p.type===o.TEL;return e.createElement("div",{className:p.formItemStyle,style:n.style},e.createElement("div",{className:r.FormItemWrapper},e.createElement("div",{className:r.FormItemInputWrapper,onClick:h?function(e){var t,n,a;"SELECT"!==e.target.tagName&&(p.type===o.TEXT?null===(t=E.current)||void 0===t||t.focus():p.type===o.TEXT_AREA?null===(n=v.current)||void 0===n||n.focus():p.type===o.TEL&&(null===(a=y.current)||void 0===a||a.focus()))}:void 0,style:h?void 0:{cursor:"default"}},e.createElement("label",{className:p.labelStyle,id:n.name+"-label",htmlFor:n.name},p.label),p.type===o.TEXT&&e.createElement(m,{ref:E,vm:p,type:p.inputType,disabled:p.disabled,required:n.required,pattern:n.pattern,autocomplete:n.autocomplete,name:n.name,placeholder:n.placeholder,autocapitalize:n.autocapitalize,autocorrect:n.autocorrect,spellcheck:n.spellcheck,ariaLabelledBy:n.name+"-label"}),p.type===o.TEL&&e.createElement(c,{ref:y,key:n.currentCountryCode||"1",disabled:p.disabled,defaultCountry:n.currentCountryCode,placeholder:l("checkout-page:enterPhoneNumber"),value:p.value?p.value:"",onChange:p.onPhoneChange}),p.type===o.TEXT_AREA&&e.createElement(d,{ref:v,vm:p,name:n.name}),p.type===o.SELECT&&e.createElement(f,{ariaLabelledBy:n.name+"-label",vm:p,autocomplete:n.autocomplete,name:n.name})),!!p.hasError&&e.createElement("div",{className:r.ErrorMsg},p.errorText||""),!!n.tooltipText&&e.createElement("div",{className:r.FormItemTooltipContainer,"data-tip":n.tooltipText,"data-event":"touchstart focus mouseover","data-event-off":"mouseout"},"?"),!!p.rightContent&&e.createElement("div",{className:r.RightContent},p.rightContent)))})),m=n(e.forwardRef((function(t,n){var a=t.vm,o=t.name,l=t.autocomplete,r=t.type,i=t.pattern,u=t.required,c=t.disabled,s=t.placeholder,m=t.autocapitalize,d=t.autocorrect,f=t.spellcheck,p=t.ariaLabelledBy;return e.createElement("input",{ref:n,id:o,required:u,type:r||"text",name:o,pattern:i,disabled:c,autoComplete:l,inputMode:a.inputMode||"text",className:a.inputStyle,value:a.value||"",onInput:a.onValueChange,placeholder:a.value?"":s,autoCapitalize:m,autoCorrect:d,spellCheck:f,"aria-labelledby":p})}))),d=n(e.forwardRef((function(t,n){var a,o=t.vm,l=t.name;return e.createElement(e.Fragment,null,e.createElement("textarea",{ref:n,style:{resize:o.disableResize?"none":"initial"},name:l,value:o.value||"",disabled:o.disabled,onInput:o.onTextAreaValueChange,placeholder:o.value?"":o.textAreaPlaceholder||"",maxLength:o.maxLength}),o.maxLength&&e.createElement("div",{className:r.TextareaInfo},(null===(a=o.value)||void 0===a?void 0:a.length)||0," / ",o.maxLength))}))),f=n((function(t){var n,a,o=t.vm,i=t.autocomplete,u=t.name,c=t.ariaLabelledBy,s=null===(n=o.options)||void 0===n?void 0:n.find((function(e){return e.value===o.value}));return e.createElement(e.Fragment,null,e.createElement("select",{id:u,"aria-labelledby":c,name:u,className:o.inputStyle,disabled:o.isLoading||o.disabled,autoComplete:i,value:(null==s?void 0:s.label)||"",onChange:o.onSelectChange},!o.value&&e.createElement("option",{value:"",disabled:!0,key:-1}),null===(a=o.options)||void 0===a?void 0:a.map((function(t,n){return e.createElement("option",{key:n+t.value,value:t.label},t.label)}))),e.createElement("div",{className:r.ArrowContainer},!o.isLoading&&e.createElement(l,null),o.isLoading&&e.createElement("div",{className:r.Loader})))}));export{s as FormItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from'./../../../../ext/tslib/tslib.es6.js';import*as
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import*as n from"react";import{observer as i}from"mobx-react-lite";var c=i((function(i){var c,o=i.vm;i.isSelected;var a=n.useRef(null),s=null===(c=o.iyzicoResponse)||void 0===c?void 0:c.checkoutFormContent;return n.useEffect((function(){if(s&&a.current){var e=a.current;window.iyziInit=void 0;var t=document.createElement("div");return t.innerHTML=s,t.querySelectorAll("script").forEach((function(t){var r=document.createElement("script");r.type="text/javascript",t.src?r.src=t.src:r.textContent=t.textContent,e.appendChild(r)})),function(){e.querySelectorAll("script").forEach((function(e){return e.remove()})),delete window.iyziInit}}}),[s]),n.useEffect((function(){var e=a.current;if(e&&s){var n=!1,i=function(e){return t(void 0,void 0,void 0,(function(){var t,i;return r(this,(function(r){switch(r.label){case 0:if(t=e.target,!(i=t.closest("#iyz-payment-button"))||n)return[2];e.preventDefault(),e.stopImmediatePropagation(),n=!0,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,o.saveCart()];case 2:return r.sent(),[3,4];case 3:return i.click(),n=!1,[7];case 4:return[2]}}))}))};return e.addEventListener("click",i,!0),function(){e.removeEventListener("click",i,!0)}}}),[s,o]),s?n.createElement("div",{style:e({},!o.showIyzicoContainer&&{display:"none"}),ref:a},n.createElement("div",{id:"iyzipay-checkout-form",className:"responsive"})):null}));export{c as Iyzico};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import{makeAutoObservable as i}from"mobx";import
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import{makeAutoObservable as i}from"mobx";import o from"../checkbox/check.js";import n from"./style.module.scss.js";import{PayWithIkas as l}from"../../../pay-with-ikas/index.js";import{CheckoutStep as s}from"../../model.js";import{IkasStorefrontConfig as a}from"@ikas/storefront-config";import{LoyaltyPointsLine as r}from"../cart-summary/index.js";import{IkasCartCreatedBy as c}from"@ikas/storefront-models";var m=t((function(t){var i,m,d,p=t.steps,h=t.stepContent,u=t.step,y=t.hasTopMargin,v=t.vm,f=t.isMobile;e.useEffect((function(){var e,t;if(document.body.getBoundingClientRect().width<768){var i=p.findIndex((function(e){return e.isSelected}));if(0===i)return;2===i?null===(e=document.getElementById("step-".concat(1)))||void 0===e||e.scrollIntoView():null===(t=document.getElementById("step-".concat(i)))||void 0===t||t.scrollIntoView()}}),[]);var C=a.getPayWithIkasUrl(),g=a.getCurrentRouting(),E="tr"===(null==g?void 0:g.locale)&&"TRY"===(null==g?void 0:g.currencyCode)&&C&&u===s.INFO,S=!!(null===(i=v.loyaltySpendingMethods)||void 0===i?void 0:i.length)&&(null===(m=v.loyaltySpendingMethods)||void 0===m?void 0:m.length)>0&&f&&!!(null===(d=v.customizationProps)||void 0===d?void 0:d.showLoyaltyPoints)&&!v.isOpenEditOrderWithTransaction&&!(v.checkout.createdBy===c.UPSELL||v.checkout.createdBy===c.ADMIN);return e.createElement("div",{className:n.StepContainer},S&&e.createElement(r,{vm:v,isVisibleLoyaltyPoints:v.isLoyaltyPointsVisible,setIsVisibleLoyaltyPoints:v.setIsLoyaltyPointsVisible,isMobile:f}),E&&e.createElement("div",{className:[n.PayWithIkasContainer,y?n.HasTopMargin:""].join(" ")},e.createElement("div",{className:n.PayWithIkasContent},e.createElement("span",{className:n.PayWithIkasTitle},"Hızlı Öde ile Kolay Alışveriş"),e.createElement("span",{className:n.PayWithIkasDescription},"Bilgilerini bir kez kaydet, 20.000 e-ticaret sitesinde tek tıkla öde.")),e.createElement("div",{className:n.PayWithIkasButton},e.createElement(l,{useExistingCart:!0}))),p.map((function(t,i){return e.createElement("div",{className:n.Step},e.createElement("div",{id:"step-".concat(i),className:[n.StepTitleContainer,0===i?n.First:""].join(" ")},e.createElement("div",{className:[n.StepTitleTop,t.titleRightContent?n.WithRightContent:""].join(" ")},e.createElement("div",{className:[n.StepCircle,t.isSelected||t.isComplete?n.Selected:""].join(" ").trim()},t.isComplete?e.createElement(o,null):i+1),e.createElement("div",{className:[n.StepTitle,t.isSelected||t.isComplete?"":n.Light].join(" ")},t.label),!!t.titleRightContent&&e.createElement("div",{className:n.StepTitleRightContent},t.titleRightContent)),!!t.titleBottomContent&&e.createElement("div",{className:n.StepTitleBottom},t.titleBottomContent)),t.isSelected&&e.createElement("div",{className:n.StepContent},h))})))})),d=function(e,t,o,n,l){this.label=e,this.isSelected=t,this.isComplete=o,this.titleRightContent=n,this.titleBottomContent=l,i(this)};export{d as Step,m as default};
|
|
@@ -146,6 +146,7 @@ export default class CheckoutViewModel {
|
|
|
146
146
|
get isOpenEditOrderWithTransaction(): boolean;
|
|
147
147
|
get isEPayKolayEnabled(): boolean;
|
|
148
148
|
get isPoweredByHidden(): boolean;
|
|
149
|
+
get hasEmailError(): boolean;
|
|
149
150
|
saveCart: () => Promise<import("../../models").IkasCart | null | undefined>;
|
|
150
151
|
inStockDeliveryInputData: (input: SaveCartInput) => Promise<SaveCartInput>;
|
|
151
152
|
checkStocks: () => Promise<void>;
|