@ikas/storefront 6.1.0-beta.9 → 6.1.0-beta.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/build/analytics/analytics.d.ts +3 -3
  2. package/build/analytics/analytics.js +1 -1
  3. package/build/analytics/googleAnalytics.js +1 -1
  4. package/build/analytics/googleTagManager.d.ts +3 -2
  5. package/build/analytics/googleTagManager.js +1 -1
  6. package/build/analytics/ikasV3.d.ts +5 -0
  7. package/build/analytics/ikasV3.js +1 -1
  8. package/build/components/checkout/components/address-form/index.js +1 -1
  9. package/build/components/checkout/components/address-form/model.d.ts +3 -0
  10. package/build/components/checkout/components/address-form/model.js +1 -1
  11. package/build/components/checkout/components/cart-summary/index.d.ts +2 -0
  12. package/build/components/checkout/components/cart-summary/index.js +1 -1
  13. package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
  14. package/build/components/checkout/components/customer-addresses/index.d.ts +1 -0
  15. package/build/components/checkout/components/customer-addresses/index.js +1 -1
  16. package/build/components/checkout/components/form-item/index.js +1 -1
  17. package/build/components/checkout/components/form-item/model.d.ts +2 -0
  18. package/build/components/checkout/components/form-item/model.js +1 -1
  19. package/build/components/checkout/components/form-item/style.module.scss.js +1 -1
  20. package/build/components/checkout/components/hepsipay/index.d.ts +9 -0
  21. package/build/components/checkout/components/hepsipay/index.js +1 -0
  22. package/build/components/checkout/components/input-with-button/style.module.scss.js +1 -1
  23. package/build/components/checkout/components/modal/index.d.ts +1 -0
  24. package/build/components/checkout/components/modal/index.js +1 -1
  25. package/build/components/checkout/components/modal/style.module.scss.js +1 -1
  26. package/build/components/checkout/components/offer-product/index.js +1 -1
  27. package/build/components/checkout/components/stripe/checkout-form.js +1 -1
  28. package/build/components/checkout/index.js +1 -1
  29. package/build/components/checkout/model.d.ts +13 -3
  30. package/build/components/checkout/model.js +1 -1
  31. package/build/components/checkout/steps/step-info/index.js +1 -1
  32. package/build/components/checkout/steps/step-payment/billing-address/index.js +1 -1
  33. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  34. package/build/components/checkout/steps/step-success/index.js +1 -1
  35. package/build/components/image/index.d.ts +1 -0
  36. package/build/components/image/index.js +1 -1
  37. package/build/components/index.d.ts +2 -0
  38. package/build/components/page/head.js +1 -1
  39. package/build/components/page/index.js +1 -1
  40. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  41. package/build/components/page-editor/model.js +1 -1
  42. package/build/components/paypal-express-checkout/index.d.ts +9 -0
  43. package/build/components/paypal-express-checkout/index.js +1 -0
  44. package/build/components/plain-image/index.d.ts +13 -0
  45. package/build/components/plain-image/index.js +1 -0
  46. package/build/components/popup/index.js +1 -1
  47. package/build/components/popup/renderer/index.js +1 -1
  48. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/formatIncompletePhoneNumber.js +1 -0
  49. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/getCountries.js +1 -0
  50. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/formatIncompletePhoneNumber.js +1 -0
  51. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/getCountries.js +1 -0
  52. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/getCountryCallingCode.js +1 -0
  53. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/isSupportedCountry.js +1 -0
  54. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/parsePhoneNumber.js +1 -0
  55. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/ObserverComponent.js +1 -0
  56. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/index.js +1 -0
  57. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/observer.js +1 -0
  58. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/useObserver.js +1 -0
  59. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/UniversalFinalizationRegistry.js +1 -0
  60. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/assertEnvironment.js +1 -0
  61. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/observerBatching.js +1 -0
  62. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/observerFinalizationRegistry.js +1 -0
  63. package/build/ext/@ikas/popup-renderer/build/ext/mobx-react-lite/es/utils/printDebugValue.js +1 -0
  64. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +1 -1
  65. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +1 -1
  66. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +1 -1
  67. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/phone-input-item-view/get-countries.js +1 -0
  68. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/phone-input-item-view/index.js +1 -0
  69. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +1 -1
  70. package/build/ext/@ikas/popup-renderer/build/popup-renderer/helpers/index.js +1 -1
  71. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/form-settings/index.js +1 -1
  72. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js +1 -1
  73. package/build/hooks/useCustomerReviews.d.ts +1 -0
  74. package/build/hooks/useCustomerReviews.js +1 -1
  75. package/build/hooks/useStore.js +1 -1
  76. package/build/index.js +1 -1
  77. package/build/models/data/checkout-settings/index.d.ts +1 -0
  78. package/build/models/data/checkout-settings/index.js +1 -1
  79. package/build/models/data/customer/review/index.d.ts +4 -1
  80. package/build/models/data/customer/review/index.js +1 -1
  81. package/build/models/data/order/gift-card-line/index.d.ts +8 -0
  82. package/build/models/data/order/gift-card-line/index.js +1 -0
  83. package/build/models/data/order/index.d.ts +2 -0
  84. package/build/models/data/order/index.js +1 -1
  85. package/build/models/data/order/line-item/bundle-product-settings/index.d.ts +7 -0
  86. package/build/models/data/order/line-item/bundle-product-settings/index.js +1 -0
  87. package/build/models/data/order/line-item/index.d.ts +2 -0
  88. package/build/models/data/order/line-item/index.js +1 -1
  89. package/build/models/data/product/index.d.ts +1 -0
  90. package/build/models/data/product/index.js +1 -1
  91. package/build/models/data/product/variant/index.d.ts +1 -0
  92. package/build/models/data/product/variant/index.js +1 -1
  93. package/build/models/ui/customer-review-list/index.d.ts +4 -0
  94. package/build/models/ui/customer-review-list/index.js +1 -1
  95. package/build/models/ui/product-list/index.js +1 -1
  96. package/build/page-data-init/index.js +1 -1
  97. package/build/pages/checkout.js +1 -1
  98. package/build/store/cart/api.d.ts +2 -1
  99. package/build/store/cart/api.js +1 -1
  100. package/build/store/checkout/index.d.ts +3 -1
  101. package/build/store/checkout/index.js +1 -1
  102. package/build/store/customer/index.js +1 -1
  103. package/package.json +12 -12
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as n}from"mobx-react-lite";import a from"lodash/sortBy";import c from"../input-with-button/index.js";import r from"../notification-box/index.js";import{CheckoutStep as l}from"../../model.js";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{formatCurrency as s}from"../../../../utils/currency.js";import{useTranslation as u}from"../../../../utils/i18n.js";import{CartItem as m}from"./cart-item/index.js";import{FormItem as p}from"../form-item/index.js";import{FormItemType as d}from"../form-item/model.js";import C from"../tooltip/index.js";import E from"../svg/arrow-down.js";import h from"../svg/cross.js";import v from"../svg/gift.js";import f from"../../styles/common.module.scss.js";import g from"./style.module.scss.js";import k from"../svg/ikas.js";import{Button as N}from"../button/index.js";var y;!function(e){e.COUPON_CODE_NOT_EXIST="COUPON_CODE_NOT_EXIST",e.COUPON_CODE_NOT_EXIST_FOR_GUESS="COUPON_CODE_NOT_EXIST_FOR_GUESS"}(y||(y={}));var S=n((function(e){var t,n,a=e.vm,c=e.allowExpand,p=e.isSuccessPageSummary,d=a.checkout,C=u().t,h=o.useState(!c),v=h[0],f=h[1],N=o.useState(!1),S=N[0],j=N[1],_=o.useState(null),I=_[0],w=_[1],A=o.useState(0),D=A[0],R=A[1],B=o.useState(null),U=B[0],L=B[1],F=o.useState(!1),M=F[0],X=F[1],V=o.useState(!1),G=V[0],H=V[1],q=o.useState(!1),z=q[0],$=q[1];o.useEffect((function(){c&&(v?U&&R(U.getBoundingClientRect().height):R(0))}),[v,U,c,M,G,S,z]);var K=o.useMemo((function(){switch(I){case y.COUPON_CODE_NOT_EXIST:return C("checkout-page:giftCodeErrorDescription");case y.COUPON_CODE_NOT_EXIST_FOR_GUESS:return C("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[I]),Q=[g.CartSummary,c?g.HideOnDesktop:"",p?g.SuccessPageCartSummary:""].join(" "),J=c?{height:D+"px"}:void 0,W=[g.ArrowDown,v?g.Rotated:""].join(" ");return d?o.createElement(o.Fragment,null,!!c&&o.createElement(o.Fragment,null,o.createElement("div",{id:"checkout-mobile-summary-header"}),o.createElement("div",{className:g.ExpandHeader,onClick:function(){if(!v){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}f(!v)}},o.createElement("div",{className:g.Left},C("checkout-page:summary")),o.createElement("div",{className:g.Price},o.createElement("span",{className:g.PriceText},"".concat(s(a.finalPrice||0,d.currencyCode,d.currencySymbol)," (").concat(d.itemQuantity," ").concat(C("checkout-page:cartItemProduct"),")")),o.createElement("span",{className:W},o.createElement(E,null))))),o.createElement("div",{className:Q},o.createElement("div",{className:[g.DetailsContainer,p?g.SuccessPageDetailContainer:""].join(" "),style:J},o.createElement("div",{className:g.Details,ref:L},o.createElement("div",{className:g.ItemsContainer},o.createElement("div",null,d.items.map((function(e,t){return o.createElement(m,{key:t,vm:a,cartItem:e,currencyCode:d.currencyCode,onChange:$,isSuccessPageSummary:p})})))),o.createElement("div",{className:g.Divider}),o.createElement("div",{className:g.SubTotalInfo},S&&o.createElement("div",{className:g.NotificationContainer},o.createElement(r,{type:"warning",title:C("checkout-page:giftCodeErrorTitle"),content:K,onClose:function(){j(!1),w(null)}})),o.createElement(T,{label:C("checkout-page:subtotal"),value:d.formattedTotalPrice,tooltipText:C("checkout-page:subtotalTooltip"),hideMarginBottom:!a.isCouponCodeVisible}),!!(null===(t=d.shippingLines)||void 0===t?void 0:t.length)&&(a.step===l.SUCCESS?o.createElement(T,{label:C("checkout-page:cartShippingTitle"),value:d.shippingTotal?d.formattedShippingTotal:C("checkout-page:free")}):d.shippingLines.map((function(e,t){return o.createElement(T,{key:t,label:e.paymentMethod?e.title:C("checkout-page:cartShippingTitle"),value:e.finalPrice?s(e.finalPrice,d.currencyCode,d.currencySymbol):C("checkout-page:free")})}))),!!a.installmentExtraPrice&&o.createElement(T,{label:C("checkout-page:cartInterest"),value:s(a.installmentExtraPrice,d.currencyCode,d.currencySymbol)}),o.createElement(b,{vm:a}),o.createElement(x,{vm:a}),(a.step===l.SUCCESS&&(!!a.checkout.note||!!a.checkout.appliedCouponCode)||a.step!==l.SUCCESS)&&a.isCouponCodeVisible&&o.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement(O,{vm:a,isAddingCoupon:G,setAddingCoupon:H,setCouponError:j,setCouponErrorCode:w}),o.createElement(P,{vm:a,isAddingNote:M,setAddingNote:X})),o.createElement("div",{className:[g.TotalContainer,p?g.SuccessPageTotalContainer:""].join(" ")},o.createElement("div",{className:g.TitleContainer},o.createElement("div",{className:g.Title},C("checkout-page:total"))),o.createElement("div",null,o.createElement("div",{className:g.TotalPricesContainer},o.createElement("div",{className:g.TotalPrice},s(a.finalPrice||0,d.currencyCode,d.currencySymbol)),!!d.$totalTax&&!!(null===(n=a.customizationProps)||void 0===n?void 0:n.showTax)&&o.createElement("div",{className:[g.TotalTax].join(" ")},C("checkout-page:cartTaxTitle")+" "+d.$formattedTotalTax)))),!p&&!a.isPoweredByHidden&&o.createElement("div",{className:g.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(k,null))))))):null})),T=n((function(e){var t=e.label,n=e.value,a=e.tooltipText,c=e.hideMarginBottom;return o.createElement("div",{className:[g.InfoRow,c?g.hideMb:""].join(" ")},o.createElement("div",{className:g.Label},o.createElement("span",null,t),!!a&&o.createElement(C,{text:a,style:{marginLeft:"8px"}})),o.createElement("div",{className:g.Value},n))})),b=n((function(e){var t=e.vm,n=u().t;return t.checkout?o.createElement(o.Fragment,null,a(t.checkout.nonCouponAdjustments||[],"order").map((function(e,a){return o.createElement("div",{className:g.InfoRow,key:a},o.createElement("div",{className:g.Label},"INTEREST"===e.name?n("checkout-page:cartInterest"):e.name),o.createElement("div",{className:g.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,s(e.amount,t.checkout.currencyCode,t.checkout.currencySymbol))))}))):null})),x=n((function(e){var t,n=e.vm,a=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:g.InfoRow,key:t},o.createElement("div",{className:g.Label},o.createElement("div",{className:g.GiftLabel},o.createElement(v,{style:{position:"relative",top:"-1px"}}),o.createElement("span",null,a("checkout-page:giftPackage")))),o.createElement("div",{className:g.Value},o.createElement("span",null,s(e.price,n.checkout.currencyCode,n.checkout.currencySymbol))))}))):null})),O=n((function(n){var a=n.vm,r=n.isAddingCoupon,i=n.setAddingCoupon,m=n.setCouponError,C=n.setCouponErrorCode,E=n.isOpenCouponCode,v=u().t,k=o.useState(""),y=k[0],S=k[1],T=o.useState(!1),b=T[0],x=T[1],O=o.useRef(null);o.useEffect((function(){r&&O.current&&O.current.focus()}),[r]);var P=function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=y,x(!0),[4,a.onCouponCodeApply()];case 1:return e.sent(),x(!1),S(""),!a.checkout.appliedCouponCode||a.couponError?[3,3]:(i(!1),m(!1),C(null),[4,a.reInitPaymentMethod()]);case 2:return e.sent(),[3,4];case 3:a.checkout.couponCode=null,m(!0),C(a.couponError),e.label=4;case 4:return[2]}}))}))},j=function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=null,x(!0),[4,a.onCouponCodeApply()];case 1:return e.sent(),[4,a.reInitPaymentMethod()];case 2:return e.sent(),x(!1),[2]}}))}))},_=a.step===l.SUCCESS,I=a.step===l.SHIPPING;if(_&&!a.checkout.appliedCouponCode)return null;var w=a.checkout.couponAdjustment,A=!(!a.checkout.appliedCouponCode||r),D=!!a.checkout.appliedCouponCode&&E;return o.createElement(o.Fragment,null,!!E&&o.createElement(o.Fragment,null,o.createElement("div",{className:[g.CartSummary,g.OpenCouponCodeSummary].join(" ")},o.createElement("div",{className:f.FormSectionTitle},o.createElement("div",{style:{paddingBottom:D?0:6},className:f.Title},v("checkout-page:couponCode")),D&&o.createElement("div",{className:[g.ActionTextBtn,g.NoUnderline,g.Light].join(" ")},o.createElement("span",{className:[g.AppliedCoupon,g.AppliedCouponBgGray].join(" ")},o.createElement("span",{className:g.CouponCode},a.checkout.appliedCouponCode),!_&&o.createElement("span",{className:g.ClearCoupon,onClick:j},o.createElement(h,null))))))),A&&!I&&!a.isCouponCodeRequirementDefult&&o.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement("div",{className:g.InfoRow},!a.checkout.appliedCouponCode&&!r&&a.isCouponCodeVisible&&o.createElement("div",{className:g.ActionTextBtn,onClick:function(){return i(!0)}},v("checkout-page:addCouponCode")),r&&!E&&o.createElement(c,{value:y,placeholder:v("checkout-page:couponCode"),buttonLabel:v("checkout-page:actions.apply"),inputRef:O,onClick:P,isLoading:b,onChange:S}),E&&!D&&o.createElement("div",{tabIndex:0,onKeyDown:function(e){"Enter"===e.key&&P()},className:g.OpenCouponCodeMain},o.createElement(p,{label:v("checkout-page:couponCode"),type:d.TEXT,value:y,onChange:S}),o.createElement(N,{style:{width:"33%"},text:v("checkout-page:actions.apply"),isLoading:b,onClick:P})),A&&o.createElement("div",{className:[g.ActionTextBtn,g.NoUnderline,g.Light].join(" ")},v("checkout-page:couponCode"),o.createElement("span",{className:[g.AppliedCoupon,a.isCouponCodeRequirementDefult?"":g.NotClosed].join(" ")},o.createElement("span",{className:g.CouponCode},a.checkout.appliedCouponCode),a.step!==l.SUCCESS&&a.isCouponCodeRequirementDefult&&o.createElement("span",{className:g.ClearCoupon,onClick:j},o.createElement(h,null)))),A&&o.createElement("div",{className:g.Value},o.createElement("span",null,"DECREMENT"===(null==w?void 0:w.type)?"- ":"")," ",o.createElement("span",null,s((null==w?void 0:w.amount)||0,a.checkout.currencyCode,a.checkout.currencySymbol)))))})),P=n((function(e){var t=e.vm,n=e.isAddingNote,a=e.setAddingNote,c=u().t,r=o.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=o.useCallback((function(){a(!0)}),[]),s=o.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===l.SUCCESS;return m&&!t.checkout.note?null:o.createElement("div",{className:g.InfoRow},!n&&!m&&o.createElement("div",{className:g.ActionTextBtn,onClick:i},r),(n||m)&&o.createElement("div",{className:[g.CheckoutNoteContainer,m?g.Success:""].join(" ")},o.createElement("div",{className:g.Title},c("checkout-page:orderNote")),m?o.createElement("div",{className:g.CheckoutNoteDisplay},t.checkout.note):o.createElement(p,{style:{width:"100%"},type:d.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:s,maxLength:320})))}));export{S as CartSummary,O as Coupon,y as CouponErrorCode};
1
+ import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as n from"react";import{observer as o}from"mobx-react-lite";import a from"lodash/sortBy";import c from"../input-with-button/index.js";import r from"../notification-box/index.js";import{CheckoutStep as l}from"../../model.js";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{formatCurrency as u}from"../../../../utils/currency.js";import{useTranslation as s}from"../../../../utils/i18n.js";import{CartItem as m}from"./cart-item/index.js";import{FormItem as d}from"../form-item/index.js";import{FormItemType as p}from"../form-item/model.js";import C from"../tooltip/index.js";import E from"../svg/arrow-down.js";import h from"../svg/cross.js";import f from"../svg/gift.js";import v from"../../styles/common.module.scss.js";import g from"./style.module.scss.js";import k from"../svg/ikas.js";import{Button as N}from"../button/index.js";import y from"../../../../hooks/useDimension.js";var S;!function(e){e.COUPON_CODE_NOT_EXIST="COUPON_CODE_NOT_EXIST",e.COUPON_CODE_NOT_EXIST_FOR_GUESS="COUPON_CODE_NOT_EXIST_FOR_GUESS"}(S||(S={}));var T=o((function(e){var t,o,a=e.vm,c=e.allowExpand,d=e.isSuccessPageSummary,p=a.checkout,C=s().t,h=n.useState(!c),f=h[0],v=h[1],N=n.useState(!1),T=N[0],P=N[1],w=n.useState(null),_=w[0],L=w[1],R=n.useState(0),D=R[0],A=R[1],M=n.useState(null),B=M[0],U=M[1],F=n.useState(!1),G=F[0],V=F[1],X=n.useState(!1),H=X[0],q=X[1],z=n.useState(!1),$=z[0],K=z[1];y().isMobile,n.useEffect((function(){c&&(f?B&&A(B.getBoundingClientRect().height):A(0))}),[f,B,c,G,H,T,$]);var Q=n.useMemo((function(){switch(_){case S.COUPON_CODE_NOT_EXIST:return C("checkout-page:giftCodeErrorDescription");case S.COUPON_CODE_NOT_EXIST_FOR_GUESS:return C("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[_]),W=[g.CartSummary,c?g.HideOnDesktop:"",d?g.SuccessPageCartSummary:""].join(" "),J=c?{height:D+"px"}:void 0,Y=[g.ArrowDown,f?g.Rotated:""].join(" ");return p?n.createElement(n.Fragment,null,!!c&&n.createElement(n.Fragment,null,n.createElement("div",{id:"checkout-mobile-summary-header"}),n.createElement("div",{className:g.ExpandHeader,onClick:function(){if(!f){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}v(!f)}},n.createElement("div",{className:g.Left},C("checkout-page:summary")),n.createElement("div",{className:g.Price},n.createElement("span",{className:g.PriceText},"".concat(u(a.finalPrice||0,p.currencyCode,p.currencySymbol)," (").concat(p.itemQuantity," ").concat(C("checkout-page:cartItemProduct"),")")),n.createElement("span",{className:Y},n.createElement(E,null))))),n.createElement("div",{className:W},n.createElement("div",{className:[g.DetailsContainer,d?g.SuccessPageDetailContainer:""].join(" "),style:J},n.createElement("div",{className:g.Details,ref:U},n.createElement("div",{className:g.ItemsContainer},n.createElement("div",null,p.items.map((function(e,t){return n.createElement(m,{key:t,vm:a,cartItem:e,currencyCode:p.currencyCode,onChange:K,isSuccessPageSummary:d})})))),n.createElement("div",{className:g.Divider}),n.createElement("div",{className:g.SubTotalInfo},T&&n.createElement("div",{className:g.NotificationContainer},n.createElement(r,{type:"warning",title:C("checkout-page:giftCodeErrorTitle"),content:Q,onClose:function(){P(!1),L(null)}})),n.createElement(b,{label:C("checkout-page:subtotal"),value:p.formattedTotalPrice,tooltipText:C("checkout-page:subtotalTooltip"),hideMarginBottom:!a.isCouponCodeVisible}),!!(null===(t=p.shippingLines)||void 0===t?void 0:t.length)&&(a.step===l.SUCCESS?n.createElement(b,{label:C("checkout-page:cartShippingTitle"),value:p.shippingTotal?p.formattedShippingTotal:C("checkout-page:free")}):p.shippingLines.map((function(e,t){return n.createElement(b,{key:t,label:e.paymentMethod?e.title:C("checkout-page:cartShippingTitle"),value:e.finalPrice?u(e.finalPrice,p.currencyCode,p.currencySymbol):C("checkout-page:free")})}))),n.createElement(x,{vm:a}),n.createElement(O,{vm:a}),(a.step===l.SUCCESS&&(!!a.checkout.note||!!a.checkout.appliedCouponCode)||a.step!==l.SUCCESS)&&a.isCouponCodeVisible&&n.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),n.createElement(j,{vm:a,isAddingCoupon:H,setAddingCoupon:q,setCouponError:P,setCouponErrorCode:L}),n.createElement(I,{vm:a,isAddingNote:G,setAddingNote:V}),!!a.installmentExtraPrice&&n.createElement(n.Fragment,null,n.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),n.createElement(b,{label:C("checkout-page:cartInterest"),value:u(a.installmentExtraPrice,p.currencyCode,p.currencySymbol)}))),n.createElement("div",{className:[g.TotalContainer,d?g.SuccessPageTotalContainer:""].join(" ")},n.createElement("div",{className:g.TitleContainer},n.createElement("div",{className:g.Title},C("checkout-page:total"))),n.createElement("div",null,n.createElement("div",{className:g.TotalPricesContainer},n.createElement("div",{className:g.TotalPrice},u(a.finalPrice||0,p.currencyCode,p.currencySymbol)),!!p.$totalTax&&!!(null===(o=a.customizationProps)||void 0===o?void 0:o.showTax)&&n.createElement("div",{className:[g.TotalTax].join(" ")},C("checkout-page:cartTaxTitle")+" "+p.$formattedTotalTax)))),!d&&!a.isPoweredByHidden&&n.createElement("div",{className:g.PoweredBy},n.createElement("span",null,"powered by"),n.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},n.createElement(k,null))))))):null})),b=o((function(e){var t=e.label,o=e.value,a=e.tooltipText,c=e.hideMarginBottom;return n.createElement("div",{className:[g.InfoRow,c?g.hideMb:""].join(" ")},n.createElement("div",{className:g.Label},n.createElement("span",null,t),!!a&&n.createElement(C,{text:a,style:{marginLeft:"8px"}})),n.createElement("div",{className:g.Value},o))})),x=o((function(e){var t=e.vm,o=s().t;return t.checkout?n.createElement(n.Fragment,null,a(t.checkout.nonCouponAdjustments||[],"order").map((function(e,a){return n.createElement("div",{className:g.InfoRow,key:a},n.createElement("div",{className:g.Label},"INTEREST"===e.name?o("checkout-page:cartInterest"):e.name),n.createElement("div",{className:g.Value},n.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",n.createElement("span",null,u(e.amount,t.checkout.currencyCode,t.checkout.currencySymbol))))}))):null})),O=o((function(e){var t,o=e.vm,a=s().t;return o.checkout?n.createElement(n.Fragment,null,null===(t=o.checkout.giftPackageLines)||void 0===t?void 0:t.map((function(e,t){return n.createElement("div",{className:g.InfoRow,key:t},n.createElement("div",{className:g.Label},n.createElement("div",{className:g.GiftLabel},n.createElement(f,{style:{position:"relative",top:"-1px"}}),n.createElement("span",null,a("checkout-page:giftPackage")))),n.createElement("div",{className:g.Value},n.createElement("span",null,u(e.price,o.checkout.currencyCode,o.checkout.currencySymbol))))}))):null})),j=o((function(o){var a=o.vm,r=o.isAddingCoupon,i=o.setAddingCoupon,u=o.setCouponError,m=o.setCouponErrorCode,C=o.isOpenCouponCode,E=o.isMobile,h=o.showOnlyMobile,f=s().t,k=n.useState(""),y=k[0],S=k[1],T=n.useState(!1),b=T[0],x=T[1],O=n.useRef(null);n.useEffect((function(){r&&O.current&&O.current.focus()}),[r]);var j=function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return a.checkout.couponCode=y,x(!0),[4,a.onCouponCodeApply()];case 1:return t.sent(),x(!1),S(""),e=a.checkout.giftCardLines&&!!a.checkout.giftCardLines.length,a.couponError?[3,4]:a.checkout.appliedCouponCode||e?(u(!1),m(null),[4,a.reInitPaymentMethod()]):[3,3];case 2:t.sent(),t.label=3;case 3:return[3,5];case 4:a.checkout.couponCode=null,u(!0),m(a.couponError),t.label=5;case 5:return[2]}}))}))},I=function(n){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return x(!0),[4,a.removeGiftCardLine(n)];case 1:return e.sent(),[4,a.reInitPaymentMethod()];case 2:return e.sent(),x(!1),[2]}}))}))};a.step,l.SUCCESS;var w=a.step===l.SHIPPING,_=!!a.checkout.appliedCouponCode||!!(a.checkout.giftCardLines&&a.checkout.giftCardLines.length>0),L=!!a.checkout.appliedCouponCode&&C,R=!r&&a.isCouponCodeVisible&&!a.isCouponCodeRequirementOpen&&a.step!==l.SUCCESS,D=_&&(!C||E);return n.createElement(n.Fragment,null,!!C&&n.createElement(n.Fragment,null,n.createElement("div",{className:[g.CartSummary,g.OpenCouponCodeSummary].join(" ")},n.createElement("div",{className:v.FormSectionTitle},n.createElement("div",{style:{paddingBottom:L?0:6},className:v.Title},f("checkout-page:couponCode"))))),_&&!w&&!a.isCouponCodeRequirementDefult&&n.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),n.createElement("div",{className:R?g.InfoRow:""},R&&n.createElement("div",{className:g.ActionTextBtn,onClick:function(){return i(!0)}},f("checkout-page:addCouponCode")),r&&!C&&n.createElement("div",{style:{marginBottom:"10px"}},n.createElement(c,{value:y,placeholder:f("checkout-page:couponCode"),buttonLabel:f("checkout-page:actions.apply"),inputRef:O,onClick:j,isLoading:b,onChange:S})),C&&n.createElement("div",{tabIndex:0,onKeyDown:function(e){"Enter"===e.key&&j()},className:[g.OpenCouponCodeMain,D?g.OpenCouponCodeMainWithMb:""].join(" ")},n.createElement(d,{label:f("checkout-page:addCouponCode"),type:p.TEXT,value:y,onChange:S}),n.createElement(N,{style:{width:"33%"},text:f("checkout-page:actions.apply"),isLoading:b,onClick:j}))),D&&n.createElement(n.Fragment,null,!!a.checkout.appliedCouponCode&&n.createElement("div",{className:[g.InfoRow,h?g.InfoRowGiftCardMobile:""].join(" ")},n.createElement(P,{vm:a,onClearCouponCode:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=null,x(!0),[4,a.onCouponCodeApply()];case 1:return e.sent(),[4,a.reInitPaymentMethod()];case 2:return e.sent(),x(!1),[2]}}))}))},couponCode:a.checkout.appliedCouponCode})),!!a.checkout.giftCardLines&&!!a.checkout.giftCardLines.length&&a.checkout.giftCardLines.map((function(e){return n.createElement("div",{className:[g.InfoRow,h?g.InfoRowGiftCardMobile:""].join(" ")},n.createElement(P,{vm:a,onClearGiftCode:I,couponCode:e.code,giftCardLine:e}))}))))})),P=o((function(e){var t=e.vm,o=e.onClearCouponCode,a=e.couponCode,c=e.giftCardLine,r=e.onClearGiftCode,i=t.checkout.couponAdjustment,m=s().t;return n.createElement(n.Fragment,null,n.createElement("div",{className:[g.ActionTextBtn,g.NoUnderline,g.Light].join(" ")},m(c?"checkout-page:giftCode":"checkout-page:couponCode"),n.createElement("span",{className:[g.AppliedCoupon,t.isCouponCodeRequirementDefult?"":g.NotClosed].join(" ")},n.createElement("span",{className:g.CouponCode},a),t.step!==l.SUCCESS&&n.createElement("span",{className:g.ClearCoupon,onClick:function(){return c?r&&r(c.giftCardId):o&&o()}},n.createElement(h,null)))),n.createElement("div",null,c?n.createElement("div",{className:g.Value},n.createElement("span",null,"-")," ",n.createElement("span",null,u((null==c?void 0:c.amount)||0,t.checkout.currencyCode,t.checkout.currencySymbol))):n.createElement("div",{className:g.Value},n.createElement("span",null,"DECREMENT"===(null==i?void 0:i.type)?"- ":"")," ",n.createElement("span",null,u((null==i?void 0:i.amount)||0,t.checkout.currencyCode,t.checkout.currencySymbol)))))})),I=o((function(e){var t=e.vm,o=e.isAddingNote,a=e.setAddingNote,c=s().t,r=n.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=n.useCallback((function(){a(!0)}),[]),u=n.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===l.SUCCESS;return m&&!t.checkout.note?null:n.createElement("div",{className:g.InfoRow},!o&&!m&&n.createElement("div",{className:g.ActionTextBtn,onClick:i},r),(o||m)&&n.createElement("div",{className:[g.CheckoutNoteContainer,m?g.Success:""].join(" ")},n.createElement("div",{className:g.Title},c("checkout-page:orderNote")),m?n.createElement("div",{className:g.CheckoutNoteDisplay},t.checkout.note):n.createElement(d,{style:{width:"100%"},type:p.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:u,maxLength:320})))}));export{T as CartSummary,j as Coupon,S as CouponErrorCode};
@@ -1 +1 @@
1
- import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={ExpandHeader:"style-module_ExpandHeader__LQwWm",Left:"style-module_Left__-N12h",Price:"style-module_Price__OT1Wh",PriceText:"style-module_PriceText__bq1pk",ArrowDown:"style-module_ArrowDown__YhRny",Rotated:"style-module_Rotated__ZPfId",CartSummary:"style-module_CartSummary__m77tn",OpenCouponCodeSummary:"style-module_OpenCouponCodeSummary__ua9wx",HideOnDesktop:"style-module_HideOnDesktop__Vs5AV",ItemsContainer:"style-module_ItemsContainer__QFKQV",DetailsContainer:"style-module_DetailsContainer__PK33m",SuccessPageDetailContainer:"style-module_SuccessPageDetailContainer__-p8kJ",Details:"style-module_Details__hWJ9o",Divider:"style-module_Divider__MNDti",ActionTextBtn:"style-module_ActionTextBtn__7yua4",NoUnderline:"style-module_NoUnderline__FphKn",Light:"style-module_Light__dIcW-",SubTotalInfo:"style-module_SubTotalInfo__JMqK9",InfoRow:"style-module_InfoRow__oAvZS",hideMb:"style-module_hideMb__j7VBr",Label:"style-module_Label__28Bij",Value:"style-module_Value__7rELF",TotalContainer:"style-module_TotalContainer__sGR7d",TitleContainer:"style-module_TitleContainer__LgmJI",Title:"style-module_Title__oMVSD",TotalPricesContainer:"style-module_TotalPricesContainer__-PsOD",TotalPrice:"style-module_TotalPrice__QBdM1",TotalTax:"style-module_TotalTax__9pA4Y",SuccessPageTotalContainer:"style-module_SuccessPageTotalContainer__NZGFF",AppliedCoupon:"style-module_AppliedCoupon__UNo1h",AppliedCouponBgGray:"style-module_AppliedCouponBgGray__MYoYu",NotClosed:"style-module_NotClosed__E-N9z",CouponCode:"style-module_CouponCode__UKPmf",ClearCoupon:"style-module_ClearCoupon__CBAzl",NotificationContainer:"style-module_NotificationContainer__AXfJT",CheckoutNoteContainer:"style-module_CheckoutNoteContainer__d-z4m",CheckoutNoteDisplay:"style-module_CheckoutNoteDisplay__DtnXo",Success:"style-module_Success__VI2Bw",GiftLabel:"style-module_GiftLabel__cazrS",PoweredBy:"style-module_PoweredBy__DKBJF",SuccessPageCartSummary:"style-module_SuccessPageCartSummary__pjgea",OpenCouponCodeMain:"style-module_OpenCouponCodeMain__lZtb3"};e(".style-module_ExpandHeader__LQwWm {\n position: sticky;\n top: 0;\n z-index: 10;\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n padding: 0 24px;\n width: 100%;\n border-top: 1px solid var(--checkout-border-color);\n border-bottom: 1px solid var(--checkout-border-color);\n transition: border-bottom 0.3s;\n user-select: none;\n background-color: var(--checkout-primary-bg-color);\n}\n@media only screen and (min-width: 1000px) {\n .style-module_ExpandHeader__LQwWm {\n display: none;\n }\n}\n.style-module_ExpandHeader__LQwWm .style-module_Left__-N12h {\n display: flex;\n align-items: center;\n font-size: 16px;\n font-weight: 600;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh {\n font-weight: 600;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_PriceText__bq1pk {\n font-weight: 600;\n margin-right: 8px;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny {\n transition: all 0.3s;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny.style-module_Rotated__ZPfId {\n transform: rotate(-180deg);\n}\n\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn {\n width: 100%;\n background-color: var(--checkout-card-bg-color);\n }\n .style-module_CartSummary__m77tn.style-module_OpenCouponCodeSummary__ua9wx {\n background-color: #fff;\n }\n}\n@media only screen and (min-width: 1000px) {\n .style-module_CartSummary__m77tn.style-module_HideOnDesktop__Vs5AV {\n display: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: 50vh;\n overflow-y: auto;\n margin-bottom: 24px;\n /* Track */\n /* Handle */\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: unset;\n overflow-y: unset;\n margin-bottom: 0;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar {\n width: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-track {\n box-shadow: inset 0 0 20px 20px #e3e7ef;\n border-left: 16px solid transparent;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 20px 20px #000000;\n border-left: 16px solid transparent;\n}\n.style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n overflow: hidden;\n width: 100%;\n transition: height 0.3s ease-in-out;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n padding: 0 24px;\n box-shadow: 1px 2px 5px 0px rgba(0, 0, 0, 0.2);\n }\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_SuccessPageDetailContainer__-p8kJ {\n padding: 0;\n box-shadow: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageDetailContainer__-p8kJ .style-module_Details__hWJ9o {\n padding-top: 0;\n}\n.style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n overflow: hidden;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n padding-top: 24px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_Divider__MNDti {\n width: 100%;\n height: 1px;\n margin: auto;\n background-color: var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4 {\n color: var(--checkout-primary-text-color);\n user-select: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4:hover {\n text-decoration: underline;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_NoUnderline__FphKn:hover {\n text-decoration: none;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_Light__dIcW- {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 {\n padding: 24px 0;\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS.style-module_hideMb__j7VBr {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Label__28Bij {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Value__7rELF {\n flex: 0 0 auto;\n padding-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS:last-of-type {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n display: flex;\n justify-content: space-between;\n margin-top: 12px;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TitleContainer__LgmJI .style-module_Title__oMVSD {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPricesContainer__-PsOD {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPrice__QBdM1 {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalTax__9pA4Y {\n font-size: 14px;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n height: 64px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF {\n height: unset;\n margin-top: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF .style-module_Title__oMVSD {\n font-weight: 500 !important;\n line-height: 32px;\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF .style-module_TotalPrice__QBdM1 {\n font-weight: 500 !important;\n line-height: 32px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 6px;\n margin-left: 12px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_AppliedCouponBgGray__MYoYu {\n background-color: var(--checkout-secondary-bg-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_NotClosed__E-N9z {\n padding: 4px 4px 4px 4px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_CouponCode__UKPmf {\n font-size: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl svg {\n transform: scale(0.8);\n}\n.style-module_CartSummary__m77tn .style-module_NotificationContainer__AXfJT {\n margin-bottom: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 24px;\n width: calc(100% - 2px);\n margin-left: 1px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_Title__oMVSD {\n font-size: 16px;\n color: var(--checkout-primary-text-color);\n margin-bottom: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_CheckoutNoteDisplay__DtnXo {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m.style-module_Success__VI2Bw {\n margin-top: 0;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 0px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS {\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS span {\n margin-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n width: 100%;\n height: 50px;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n display: flex;\n }\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF a {\n display: flex;\n align-items: center;\n}\n\n.style-module_SuccessPageCartSummary__pjgea {\n background-color: #fff;\n}\n\n.style-module_OpenCouponCodeMain__lZtb3 {\n display: flex;\n}\n.style-module_OpenCouponCodeMain__lZtb3 input {\n width: calc(100% - 12px);\n}");export{n as default};
1
+ import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={ExpandHeader:"style-module_ExpandHeader__LQwWm",Left:"style-module_Left__-N12h",Price:"style-module_Price__OT1Wh",PriceText:"style-module_PriceText__bq1pk",ArrowDown:"style-module_ArrowDown__YhRny",Rotated:"style-module_Rotated__ZPfId",CartSummary:"style-module_CartSummary__m77tn",OpenCouponCodeSummary:"style-module_OpenCouponCodeSummary__ua9wx",HideOnDesktop:"style-module_HideOnDesktop__Vs5AV",ItemsContainer:"style-module_ItemsContainer__QFKQV",DetailsContainer:"style-module_DetailsContainer__PK33m",SuccessPageDetailContainer:"style-module_SuccessPageDetailContainer__-p8kJ",Details:"style-module_Details__hWJ9o",Divider:"style-module_Divider__MNDti",ActionTextBtn:"style-module_ActionTextBtn__7yua4",NoUnderline:"style-module_NoUnderline__FphKn",Light:"style-module_Light__dIcW-",SubTotalInfo:"style-module_SubTotalInfo__JMqK9",InfoRow:"style-module_InfoRow__oAvZS",hideMb:"style-module_hideMb__j7VBr",Label:"style-module_Label__28Bij",Value:"style-module_Value__7rELF",TotalContainer:"style-module_TotalContainer__sGR7d",TitleContainer:"style-module_TitleContainer__LgmJI",Title:"style-module_Title__oMVSD",TotalPricesContainer:"style-module_TotalPricesContainer__-PsOD",TotalPrice:"style-module_TotalPrice__QBdM1",TotalTax:"style-module_TotalTax__9pA4Y",SuccessPageTotalContainer:"style-module_SuccessPageTotalContainer__NZGFF",AppliedCoupon:"style-module_AppliedCoupon__UNo1h",AppliedCouponBgGray:"style-module_AppliedCouponBgGray__MYoYu",NotClosed:"style-module_NotClosed__E-N9z",CouponCode:"style-module_CouponCode__UKPmf",ClearCoupon:"style-module_ClearCoupon__CBAzl",NotificationContainer:"style-module_NotificationContainer__AXfJT",CheckoutNoteContainer:"style-module_CheckoutNoteContainer__d-z4m",CheckoutNoteDisplay:"style-module_CheckoutNoteDisplay__DtnXo",Success:"style-module_Success__VI2Bw",GiftLabel:"style-module_GiftLabel__cazrS",PoweredBy:"style-module_PoweredBy__DKBJF",SuccessPageCartSummary:"style-module_SuccessPageCartSummary__pjgea",OpenCouponCodeMain:"style-module_OpenCouponCodeMain__lZtb3",OpenCouponCodeMainWithMb:"style-module_OpenCouponCodeMainWithMb__DqVmh",InfoRowGiftCardMobile:"style-module_InfoRowGiftCardMobile__Kp-zh",Deneme:"style-module_Deneme__4H1Cb"};e(".style-module_ExpandHeader__LQwWm {\n position: sticky;\n top: 0;\n z-index: 10;\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n padding: 0 24px;\n width: 100%;\n border-top: 1px solid var(--checkout-border-color);\n border-bottom: 1px solid var(--checkout-border-color);\n transition: border-bottom 0.3s;\n user-select: none;\n background-color: var(--checkout-primary-bg-color);\n}\n@media only screen and (min-width: 1000px) {\n .style-module_ExpandHeader__LQwWm {\n display: none;\n }\n}\n.style-module_ExpandHeader__LQwWm .style-module_Left__-N12h {\n display: flex;\n align-items: center;\n font-size: 16px;\n font-weight: 600;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh {\n font-weight: 600;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_PriceText__bq1pk {\n font-weight: 600;\n margin-right: 8px;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny {\n transition: all 0.3s;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny.style-module_Rotated__ZPfId {\n transform: rotate(-180deg);\n}\n\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn {\n width: 100%;\n background-color: var(--checkout-card-bg-color);\n }\n .style-module_CartSummary__m77tn.style-module_OpenCouponCodeSummary__ua9wx {\n background-color: #fff;\n }\n}\n@media only screen and (min-width: 1000px) {\n .style-module_CartSummary__m77tn.style-module_HideOnDesktop__Vs5AV {\n display: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: 50vh;\n overflow-y: auto;\n margin-bottom: 24px;\n /* Track */\n /* Handle */\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: unset;\n overflow-y: unset;\n margin-bottom: 0;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar {\n width: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-track {\n box-shadow: inset 0 0 20px 20px #e3e7ef;\n border-left: 16px solid transparent;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 20px 20px #000000;\n border-left: 16px solid transparent;\n}\n.style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n overflow: hidden;\n width: 100%;\n transition: height 0.3s ease-in-out;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n padding: 0 24px;\n box-shadow: 1px 2px 5px 0px rgba(0, 0, 0, 0.2);\n }\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_SuccessPageDetailContainer__-p8kJ {\n padding: 0;\n box-shadow: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageDetailContainer__-p8kJ .style-module_Details__hWJ9o {\n padding-top: 0;\n}\n.style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n overflow: hidden;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n padding-top: 24px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_Divider__MNDti {\n width: 100%;\n height: 1px;\n margin: auto;\n background-color: var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4 {\n color: var(--checkout-primary-text-color);\n user-select: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4:hover {\n text-decoration: underline;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_NoUnderline__FphKn:hover {\n text-decoration: none;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_Light__dIcW- {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 {\n padding: 24px 0;\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS.style-module_hideMb__j7VBr {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Label__28Bij {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Value__7rELF {\n flex: 0 0 auto;\n padding-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS:last-of-type {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n display: flex;\n justify-content: space-between;\n margin-top: 12px;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TitleContainer__LgmJI .style-module_Title__oMVSD {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPricesContainer__-PsOD {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPrice__QBdM1 {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalTax__9pA4Y {\n font-size: 14px;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n height: 64px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF {\n height: unset;\n margin-top: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF .style-module_Title__oMVSD {\n font-weight: 500 !important;\n line-height: 32px;\n}\n.style-module_CartSummary__m77tn .style-module_SuccessPageTotalContainer__NZGFF .style-module_TotalPrice__QBdM1 {\n font-weight: 500 !important;\n line-height: 32px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 6px;\n margin-left: 12px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_AppliedCouponBgGray__MYoYu {\n background-color: var(--checkout-secondary-bg-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_NotClosed__E-N9z {\n padding: 4px 4px 4px 4px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_CouponCode__UKPmf {\n font-size: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl svg {\n transform: scale(0.8);\n}\n.style-module_CartSummary__m77tn .style-module_NotificationContainer__AXfJT {\n margin-bottom: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 24px;\n width: calc(100% - 2px);\n margin-left: 1px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_Title__oMVSD {\n font-size: 16px;\n color: var(--checkout-primary-text-color);\n margin-bottom: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_CheckoutNoteDisplay__DtnXo {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m.style-module_Success__VI2Bw {\n margin-top: 0;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 0px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS {\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS span {\n margin-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n width: 100%;\n height: 50px;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n display: flex;\n }\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF a {\n display: flex;\n align-items: center;\n}\n\n.style-module_SuccessPageCartSummary__pjgea {\n background-color: #fff;\n}\n\n.style-module_OpenCouponCodeMain__lZtb3 {\n display: flex;\n}\n.style-module_OpenCouponCodeMain__lZtb3 input {\n width: calc(100% - 12px);\n}\n.style-module_OpenCouponCodeMain__lZtb3.style-module_OpenCouponCodeMainWithMb__DqVmh {\n margin-bottom: 12px;\n}\n\n.style-module_InfoRowGiftCardMobile__Kp-zh {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh.style-module_hideMb__j7VBr {\n margin-bottom: 0;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_Label__28Bij {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_Value__7rELF {\n flex: 0 0 auto;\n padding-left: 8px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh:last-of-type {\n margin-bottom: 0;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4 {\n color: var(--checkout-primary-text-color);\n user-select: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4:hover {\n text-decoration: underline;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4.style-module_NoUnderline__FphKn:hover {\n text-decoration: none;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_ActionTextBtn__7yua4.style-module_Light__dIcW- {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 6px;\n margin-left: 12px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h.style-module_AppliedCoupon__UNo1h {\n background-color: var(--checkout-secondary-bg-color);\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h.style-module_NotClosed__E-N9z {\n padding: 4px 4px 4px 4px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h .style-module_CouponCode__UKPmf {\n font-size: 14px;\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_InfoRowGiftCardMobile__Kp-zh .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl svg {\n transform: scale(0.8);\n}\n\n.style-module_Deneme__4H1Cb {\n margin-top: 10px;\n}");export{n as default};
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
  import CustomerAddressesViewModel from "./model";
3
3
  declare type Props = {
4
4
  vm: CustomerAddressesViewModel;
5
+ showBillingAddressOnShippingStep?: boolean;
5
6
  };
6
7
  declare const _default: React.FunctionComponent<Props>;
7
8
  export default _default;
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import s from"../../style.module.scss.js";import r from"../select-box/index.js";import{AddressForm as d}from"../address-form/index.js";import{Checkbox as i}from"../checkbox/index.js";import{FormItem as a}from"../form-item/index.js";import{FormItemType as o}from"../form-item/model.js";import n from"./style.module.scss.js";import l from"../../styles/common.module.scss.js";import{Button as c}from"../button/index.js";import{IkasStorefrontConfig as m}from"@ikas/storefront-config";import{useTranslation as u}from"../../../../utils/i18n.js";import v from"../delivery-methods/index.js";import{CheckoutStep as p}from"../../model.js";var h=t((function(t){var d,i=t.vm,a=u().t,o=e.useMemo((function(){return e.createElement("div",null,e.createElement(g,{vm:i}),e.createElement(k,{vm:i}))}),[i]),h=e.useMemo((function(){return e.createElement("div",null,e.createElement(E,{vm:i}))}),[i]),C=e.useState("-1"),f=C[0],A=C[1];e.useEffect((function(){i.vm.checkout.stockLocationId&&A(i.vm.checkout.stockLocationId)}),[]);var y=function(e){if(!e.address)return"";var t=[];return e.address.address&&t.push(e.address.address),e.address.postalCode&&t.push(e.address.postalCode),e.address.district&&e.address.district.name&&t.push(e.address.district.name),e.address.city&&e.address.city.name&&t.push(e.address.city.name),e.address.state&&e.address.state.name&&"Default"!==e.address.state.name&&t.push(e.address.state.name),e.address.country&&e.address.country.name&&t.push(e.address.country.name),t.join(", ")};return e.createElement(e.Fragment,null,!!m.getPickupStockLocationIds()&&!i.vm.isDigitalOnly&&i.vm.availableStockLocations.length>0&&i.vm.step!==p.PAYMENT&&e.createElement(e.Fragment,null,e.createElement("div",{className:l.FormSectionTitle},e.createElement("div",{className:l.Title},a("checkout-page:deliveryMethod"))),e.createElement(v,{deliveryMethod:i.vm.deliveryMethod,onClick:function(e){"address"===e&&A("-1"),i.vm.onDeliveryMethodChange(e)}})),e.createElement("div",{className:l.FormSectionTitle},"address"===i.vm.deliveryMethod?e.createElement("div",{className:l.Title},i.editingCustomerAddress?a("checkout-page:editAddress"):"billing"===i.addressType?a("checkout-page:billingAddress"):a("checkout-page:shippingAddress")):i.vm.step===p.PAYMENT?e.createElement("div",{className:l.Title},a("checkout-page:billingAddress")):e.createElement("div",{className:l.Title},a("checkout-page:pickUpLocation"),e.createElement("span",{className:n.ErrorMessage},i.vm.isErrorsVisible&&!i.vm.checkout.stockLocationId&&a("checkout-page:errorPickupLocationRequired"))),!!i.editingCustomerAddress&&e.createElement("div",{className:n.CancelEdit,onClick:i.onCancelEditAddressClick},a("checkout-page:actions.cancel"))),!!i.vm.store.customerStore.customer&&!i.editingCustomerAddress&&("address"===i.vm.deliveryMethod||i.vm.step===p.PAYMENT&&"in-store"===i.vm.deliveryMethod)&&e.createElement("div",{className:s.RowPB},null===(d=i.vm.customerAddresses)||void 0===d?void 0:d.map((function(t){return e.createElement(r,{key:t.id,label:t.title||"",isSelected:t.id===i.selectedAddressId,rightContent:e.createElement("div",{onClick:function(){return i.onEditAddressClick(t)}},a("checkout-page:actions.edit")),bottomContent:e.createElement("div",{className:n.AddressContent},e.createElement("div",{className:n.AddressText},t.firstName," ",t.lastName),e.createElement("div",{className:n.AddressText},t.addressText)),bottomContentVisible:!0,hasError:!t.isValidAddress,errorText:a("checkout-page:missingAddressFields"),onClick:function(){return t.id!==i.selectedAddressId&&i.onAddressSelect(t)}})})),e.createElement(r,{label:a("checkout-page:newAddress"),isSelected:"-1"===i.selectedAddressId,bottomContent:o,onClick:function(){return"-1"!==i.selectedAddressId&&i.onAddressSelect()}})),i.vm.store.customerStore.customer||i.vm.step!==p.INFO||"address"!==i.vm.deliveryMethod?i.vm.step===p.PAYMENT&&!i.vm.store.customerStore.customer&&o:o,"in-store"===i.vm.deliveryMethod&&e.createElement("div",{className:s.RowPB},i.vm.stockLocations.map((function(t){return function(e){return e.address&&e.address.address&&e.address.city&&e.address.country&&i.vm.availableStockLocations.find((function(t){return t.id===e.id}))}(t)&&e.createElement(r,{key:t.id,label:t.name||"",isSelected:f===t.id,bottomContent:e.createElement("div",null,e.createElement("div",{className:n.AddressText},y(t)),t.deliveryTime&&e.createElement("div",{className:n.DeliveryTime},a("checkout-page:stockLocation.deliveryTime.".concat(t.deliveryTime)))),bottomContentVisible:!0,onClick:function(){i.vm.onStockLocationChange(t),A(t.id)}})}))),"in-store"===i.vm.deliveryMethod&&i.vm.step!==p.PAYMENT&&e.createElement(e.Fragment,null,e.createElement("div",{className:l.FormSectionTitle},e.createElement("div",{className:l.Title},a("checkout-page:recipientsInfo"))),h),!!i.editingCustomerAddress&&e.createElement(g,{vm:i}),!!i.editingCustomerAddress&&e.createElement("div",{className:n.EditAddressActions},e.createElement(c,{style:{width:"100%"},text:a("checkout-page:deleteAddress"),isLine:!0,isLoading:i.isDeleteAddressLoading,isDisabled:i.isEditAddressLoading,onClick:i.onDeleteAddressClick}),e.createElement(c,{style:{width:"100%",marginTop:i.vm.store.customerStore.customer?"0px":"32px"},text:a("checkout-page:actions.save"),isLoading:i.isEditAddressLoading,isDisabled:i.isDeleteAddressLoading,onClick:i.onSaveAddressClick})))})),g=t((function(t){var s,r=t.vm,i=(!!(null===(s=r.vm.checkout.customer)||void 0===s?void 0:s.isGuestCheckout)||!!r.vm.store.customerStore.customer)&&r.vm.isCorporateInvoiceVisible&&!!r.vm.checkoutSettings.showCompanyInfoInShippingAddress;return e.createElement(d,{address:r.editingCustomerAddress||r.address,isErrorsVisible:r.isEditAddressErrorsVisible||r.vm.isErrorsVisible,allowedCountryIds:r.vm.shippingCountryIds||void 0,allowCorporateInfo:"billing"===r.addressType?!i:i,firstNameChangeCallback:r.firstNameChangeCallback,lastNameChangeCallback:r.lastNameChangeCallback,allowTitleChange:!!r.editingCustomerAddress,deliveryMethod:"address"})})),E=t((function(t){var s=t.vm;return e.createElement(d,{address:s.editingCustomerAddress||s.address,isErrorsVisible:s.isEditAddressErrorsVisible||s.vm.isErrorsVisible,firstNameChangeCallback:s.firstNameChangeCallback,lastNameChangeCallback:s.lastNameChangeCallback,deliveryMethod:"in-store"})})),k=t((function(t){var s=t.vm,r=u().t;return s.vm.store.customerStore.customer&&"-1"===s.selectedAddressId?e.createElement("div",{style:{marginTop:"12px"}},e.createElement(i,{value:s.vm.shouldSaveAddress,label:r("checkout-page:saveAddressCta"),onChange:s.vm.setShouldSaveAddress}),s.vm.shouldSaveAddress&&e.createElement("div",{style:{marginTop:"8px"}},e.createElement(a,{type:o.TEXT,label:r("checkout-page:addressTitle"),value:s.vm.addressTitle,onChange:s.vm.setAddressTitle}))):null}));export{g as CustomerAddressForm,E as RecipientForm,k as SaveAddressCheckboxAndTitle,h as default};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import s from"../../style.module.scss.js";import r from"../select-box/index.js";import{AddressForm as d}from"../address-form/index.js";import{Checkbox as i}from"../checkbox/index.js";import{FormItem as o}from"../form-item/index.js";import{FormItemType as a}from"../form-item/model.js";import n from"./style.module.scss.js";import l from"../../styles/common.module.scss.js";import{Button as c}from"../button/index.js";import{IkasStorefrontConfig as m}from"@ikas/storefront-config";import{useTranslation as u}from"../../../../utils/i18n.js";import v from"../delivery-methods/index.js";import{CheckoutStep as p}from"../../model.js";var h=t((function(t){var d,i=t.vm,o=t.showBillingAddressOnShippingStep,a=u().t,h=e.useMemo((function(){return e.createElement("div",null,e.createElement(g,{vm:i}),e.createElement(k,{vm:i}))}),[i]),C=e.useMemo((function(){return e.createElement("div",null,e.createElement(E,{vm:i}))}),[i]),A=e.useState("-1"),f=A[0],y=A[1];e.useEffect((function(){i.vm.checkout.stockLocationId&&y(i.vm.checkout.stockLocationId)}),[]);var b=function(e){if(!e.address)return"";var t=[];return e.address.address&&t.push(e.address.address),e.address.postalCode&&t.push(e.address.postalCode),e.address.district&&e.address.district.name&&t.push(e.address.district.name),e.address.city&&e.address.city.name&&t.push(e.address.city.name),e.address.state&&e.address.state.name&&"Default"!==e.address.state.name&&t.push(e.address.state.name),e.address.country&&e.address.country.name&&t.push(e.address.country.name),t.join(", ")};return e.createElement(e.Fragment,null,!!m.getPickupStockLocationIds()&&!i.vm.isDigitalOnly&&i.vm.availableStockLocations.length>0&&i.vm.step!==p.PAYMENT&&!o&&e.createElement(e.Fragment,null,e.createElement("div",{className:l.FormSectionTitle},e.createElement("div",{className:l.Title},a("checkout-page:deliveryMethod"))),e.createElement(v,{deliveryMethod:i.vm.deliveryMethod,onClick:function(e){"address"===e&&y("-1"),i.vm.onDeliveryMethodChange(e)}})),e.createElement("div",{className:l.FormSectionTitle},"address"===i.vm.deliveryMethod?e.createElement("div",{className:l.Title},i.editingCustomerAddress?a("checkout-page:editAddress"):"billing"===i.addressType?a("checkout-page:billingAddress"):a("checkout-page:shippingAddress")):i.vm.step===p.PAYMENT||o?e.createElement("div",{className:l.Title},a("checkout-page:billingAddress")):e.createElement("div",{className:l.Title},a("checkout-page:pickUpLocation"),e.createElement("span",{className:n.ErrorMessage},i.vm.isErrorsVisible&&!i.vm.checkout.stockLocationId&&a("checkout-page:errorPickupLocationRequired"))),!!i.editingCustomerAddress&&e.createElement("div",{className:n.CancelEdit,onClick:i.onCancelEditAddressClick},a("checkout-page:actions.cancel"))),!!i.vm.store.customerStore.customer&&!i.editingCustomerAddress&&("address"===i.vm.deliveryMethod||i.vm.step===p.PAYMENT&&"in-store"===i.vm.deliveryMethod||o)&&e.createElement("div",{className:s.RowPB},null===(d=i.vm.customerAddresses)||void 0===d?void 0:d.map((function(t){return e.createElement(r,{key:t.id,label:t.title||"",isSelected:t.id===i.selectedAddressId,rightContent:e.createElement("div",{onClick:function(){return i.onEditAddressClick(t)}},a("checkout-page:actions.edit")),bottomContent:e.createElement("div",{className:n.AddressContent},e.createElement("div",{className:n.AddressText},t.firstName," ",t.lastName),e.createElement("div",{className:n.AddressText},t.addressText)),bottomContentVisible:!0,hasError:!t.isValidAddress,errorText:a("checkout-page:missingAddressFields"),onClick:function(){return t.id!==i.selectedAddressId&&i.onAddressSelect(t)}})})),e.createElement(r,{label:a("checkout-page:newAddress"),isSelected:"-1"===i.selectedAddressId,bottomContent:h,onClick:function(){return"-1"!==i.selectedAddressId&&i.onAddressSelect()}})),i.vm.store.customerStore.customer||i.vm.step!==p.INFO||"address"!==i.vm.deliveryMethod?(o&&!i.vm.store.customerStore.customer||i.vm.step===p.PAYMENT&&!i.vm.store.customerStore.customer)&&h:h,"in-store"===i.vm.deliveryMethod&&!o&&e.createElement("div",{className:s.RowPB},i.vm.stockLocations.map((function(t){return function(e){return e.address&&e.address.address&&e.address.city&&e.address.country&&i.vm.availableStockLocations.find((function(t){return t.id===e.id}))}(t)&&e.createElement(r,{key:t.id,label:t.name||"",isSelected:f===t.id,bottomContent:e.createElement("div",null,e.createElement("div",{className:n.AddressText},b(t)),t.deliveryTime&&e.createElement("div",{className:n.DeliveryTime},a("checkout-page:stockLocation.deliveryTime.".concat(t.deliveryTime)))),bottomContentVisible:!0,onClick:function(){i.vm.onStockLocationChange(t),y(t.id)}})}))),"in-store"===i.vm.deliveryMethod&&i.vm.step!==p.PAYMENT&&!o&&e.createElement(e.Fragment,null,e.createElement("div",{className:l.FormSectionTitle},e.createElement("div",{className:l.Title},a("checkout-page:recipientsInfo"))),C),!!i.editingCustomerAddress&&e.createElement(g,{vm:i}),!!i.editingCustomerAddress&&e.createElement("div",{className:n.EditAddressActions},e.createElement(c,{style:{width:"100%"},text:a("checkout-page:deleteAddress"),isLine:!0,isLoading:i.isDeleteAddressLoading,isDisabled:i.isEditAddressLoading,onClick:i.onDeleteAddressClick}),e.createElement(c,{style:{width:"100%",marginTop:i.vm.store.customerStore.customer?"0px":"32px"},text:a("checkout-page:actions.save"),isLoading:i.isEditAddressLoading,isDisabled:i.isDeleteAddressLoading,onClick:i.onSaveAddressClick})))})),g=t((function(t){var s,r=t.vm,i=(!!(null===(s=r.vm.checkout.customer)||void 0===s?void 0:s.isGuestCheckout)||!!r.vm.store.customerStore.customer)&&r.vm.isCorporateInvoiceVisible&&!!r.vm.checkoutSettings.showCompanyInfoInShippingAddress;return e.createElement(d,{address:r.editingCustomerAddress||r.address,isErrorsVisible:r.isEditAddressErrorsVisible||r.vm.isErrorsVisible,allowedCountryIds:r.vm.shippingCountryIds||void 0,allowCorporateInfo:"billing"===r.addressType?"in-store"===r.vm.deliveryMethod||(r.vm.isDigitalOnly?i:!i):i,firstNameChangeCallback:r.firstNameChangeCallback,lastNameChangeCallback:r.lastNameChangeCallback,allowTitleChange:!!r.editingCustomerAddress,deliveryMethod:"address"})})),E=t((function(t){var s=t.vm;return e.createElement(d,{address:s.editingCustomerAddress||s.address,isErrorsVisible:s.isEditAddressErrorsVisible||s.vm.isErrorsVisible,firstNameChangeCallback:s.firstNameChangeCallback,lastNameChangeCallback:s.lastNameChangeCallback,deliveryMethod:"in-store"})})),k=t((function(t){var s=t.vm,r=u().t;return s.vm.store.customerStore.customer&&"-1"===s.selectedAddressId?e.createElement("div",{style:{marginTop:"12px"}},e.createElement(i,{value:s.vm.shouldSaveAddress,label:r("checkout-page:saveAddressCta"),onChange:s.vm.setShouldSaveAddress}),s.vm.shouldSaveAddress&&e.createElement("div",{style:{marginTop:"8px"}},e.createElement(o,{type:a.TEXT,label:r("checkout-page:addressTitle"),value:s.vm.addressTitle,onChange:s.vm.setAddressTitle}))):null}));export{g as CustomerAddressForm,E as RecipientForm,k as SaveAddressCheckboxAndTitle,h as default};
@@ -1 +1 @@
1
- import*as e from"react";import{runInAction as t}from"mobx";import{observer as n}from"mobx-react-lite";import o,{FormItemType as r}from"./model.js";import a from"./caret-down.js";import l from"./style.module.scss.js";import"@ikas/storefront-config";import{useTranslation as u}from"../../../../utils/i18n.js";import i from"react-tooltip";import{PhoneNumberInput as c}from"../phone-number-input/index.js";var s=n((function(n){var a=u().t,s=e.useState((function(){return new o(n)})),p=s[0],E=s[1];return e.useEffect((function(){i.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.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.disableResize=n.disableResize}))}),[n.disableResize]),e.useEffect((function(){t((function(){E(new o(n))}))}),[n.onChange]),e.useEffect((function(){!p.country&&n.currentCountryCode&&p.onCountryChange(n.currentCountryCode)}),[n.currentCountryCode]),e.createElement("div",{className:p.formItemStyle,style:n.style},e.createElement("div",{className:l.FormItemWrapper},e.createElement("div",{className:l.FormItemInputWrapper},e.createElement("label",{className:p.labelStyle},p.label),p.type===r.TEXT&&e.createElement(m,{vm:p,type:p.inputType,disabled:p.disabled,required:n.required,pattern:n.pattern,autocomplete:n.autocomplete,name:n.name,placeholder:n.placeholder}),p.type===r.TEL&&e.createElement(c,{key:n.currentCountryCode||"1",disabled:p.disabled,defaultCountry:n.currentCountryCode,placeholder:a("checkout-page:enterPhoneNumber"),value:p.value?p.value:"",onChange:p.onPhoneChange}),p.type===r.TEXT_AREA&&e.createElement(f,{vm:p}),p.type===r.SELECT&&e.createElement(d,{vm:p,autocomplete:n.autocomplete})),!!p.hasError&&e.createElement("div",{className:l.ErrorMsg},p.errorText||""),!!n.tooltipText&&e.createElement("div",{className:l.FormItemTooltipContainer,"data-tip":n.tooltipText,"data-event":"touchstart focus mouseover","data-event-off":"mouseout"},"?"),!!p.rightContent&&e.createElement("div",{className:l.RightContent},p.rightContent)))})),m=n((function(t){var n=t.vm,o=t.name,r=t.autocomplete,a=t.type,l=t.pattern,u=t.required,i=t.disabled,c=t.placeholder;return e.createElement("input",{required:u,type:a||"text",name:o,pattern:l,disabled:i,autoComplete:r,inputMode:n.inputMode||"text",className:n.inputStyle,value:n.value,onChange:n.onValueChange,placeholder:n.isFocused?c:void 0,onFocus:n.handleOnFocus,onBlur:n.handleOnBlur})})),f=n((function(t){var n,o=t.vm;return e.createElement(e.Fragment,null,e.createElement("textarea",{style:{resize:o.disableResize?"none":"initial"},value:o.value,disabled:o.disabled,onChange:o.onTextAreaValueChange,placeholder:o.textAreaPlaceholder||"",maxLength:o.maxLength}),o.maxLength&&e.createElement("div",{className:l.TextareaInfo},(null===(n=o.value)||void 0===n?void 0:n.length)||0," / ",o.maxLength))})),d=n((function(t){var n,o=t.vm,r=t.autocomplete;return e.createElement(e.Fragment,null,e.createElement("select",{className:o.inputStyle,disabled:o.disabled,autoComplete:r,onChange:o.onSelectChange},!o.value&&e.createElement("option",{selected:!0,disabled:!0,key:-1}),null===(n=o.options)||void 0===n?void 0:n.map((function(t,n){return e.createElement("option",{key:n+t.value,value:t.label,selected:o.value===t.value},t.label)}))),e.createElement("div",{className:l.ArrowContainer},e.createElement(a,null)))}));export{s as FormItem};
1
+ import*as e from"react";import{runInAction as t}from"mobx";import{observer as n}from"mobx-react-lite";import o,{FormItemType as a}from"./model.js";import r from"./caret-down.js";import l 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 r=i().t,s=e.useState((function(){return new o(n)})),p=s[0],E=s[1];return 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.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(){E(new o(n))}))}),[n.onChange]),e.useEffect((function(){!p.country&&n.currentCountryCode&&p.onCountryChange(n.currentCountryCode)}),[n.currentCountryCode]),e.createElement("div",{className:p.formItemStyle,style:n.style},e.createElement("div",{className:l.FormItemWrapper},e.createElement("div",{className:l.FormItemInputWrapper},e.createElement("label",{className:p.labelStyle},p.label),p.type===a.TEXT&&e.createElement(m,{vm:p,type:p.inputType,disabled:p.disabled,required:n.required,pattern:n.pattern,autocomplete:n.autocomplete,name:n.name,placeholder:n.placeholder}),p.type===a.TEL&&e.createElement(c,{key:n.currentCountryCode||"1",disabled:p.disabled,defaultCountry:n.currentCountryCode,placeholder:r("checkout-page:enterPhoneNumber"),value:p.value?p.value:"",onChange:p.onPhoneChange}),p.type===a.TEXT_AREA&&e.createElement(d,{vm:p}),p.type===a.SELECT&&e.createElement(f,{vm:p,autocomplete:n.autocomplete})),!!p.hasError&&e.createElement("div",{className:l.ErrorMsg},p.errorText||""),!!n.tooltipText&&e.createElement("div",{className:l.FormItemTooltipContainer,"data-tip":n.tooltipText,"data-event":"touchstart focus mouseover","data-event-off":"mouseout"},"?"),!!p.rightContent&&e.createElement("div",{className:l.RightContent},p.rightContent)))})),m=n((function(t){var n=t.vm,o=t.name,a=t.autocomplete,r=t.type,l=t.pattern,i=t.required,u=t.disabled,c=t.placeholder;return e.createElement("input",{required:i,type:r||"text",name:o,pattern:l,disabled:u,autoComplete:a,inputMode:n.inputMode||"text",className:n.inputStyle,value:n.value,onChange:n.onValueChange,placeholder:n.isFocused?c:void 0,onFocus:n.handleOnFocus,onBlur:n.handleOnBlur})})),d=n((function(t){var n,o=t.vm;return e.createElement(e.Fragment,null,e.createElement("textarea",{style:{resize:o.disableResize?"none":"initial"},value:o.value,disabled:o.disabled,onChange:o.onTextAreaValueChange,placeholder:o.textAreaPlaceholder||"",maxLength:o.maxLength}),o.maxLength&&e.createElement("div",{className:l.TextareaInfo},(null===(n=o.value)||void 0===n?void 0:n.length)||0," / ",o.maxLength))})),f=n((function(t){var n,o=t.vm,a=t.autocomplete;return e.createElement(e.Fragment,null,e.createElement("select",{className:o.inputStyle,disabled:o.isLoading||o.disabled,autoComplete:a,onChange:o.onSelectChange},!o.value&&e.createElement("option",{selected:!0,disabled:!0,key:-1}),null===(n=o.options)||void 0===n?void 0:n.map((function(t,n){return e.createElement("option",{key:n+t.value,value:t.label,selected:o.value===t.value},t.label)}))),e.createElement("div",{className:l.ArrowContainer},!o.isLoading&&e.createElement(r,null),o.isLoading&&e.createElement("div",{className:l.Loader})))}));export{s as FormItem};
@@ -16,6 +16,7 @@ export default class FormItemViewModel implements Props {
16
16
  rightContent?: React.ReactElement | null;
17
17
  disableResize?: boolean;
18
18
  disabled: boolean;
19
+ isLoading: boolean;
19
20
  isFocused: boolean;
20
21
  onChange: (value: string) => void;
21
22
  constructor(props: Props);
@@ -53,6 +54,7 @@ export interface Props {
53
54
  rightContent?: React.ReactElement | null;
54
55
  disableResize?: boolean;
55
56
  disabled?: boolean;
57
+ isLoading?: boolean;
56
58
  onChange: (value: string) => void;
57
59
  }
58
60
  export declare enum FormItemType {
@@ -1 +1 @@
1
- import{makeAutoObservable as e}from"mobx";import t from"./style.module.scss.js";var i,n,o,s=function(){function n(t){var i=this;this.country=null,this.textAreaPlaceholder=null,this.onValueChange=function(e){i.disabled||i.onChange(e.target.value)},this.onTextAreaValueChange=function(e){i.disabled||i.onChange(e.target.value)},this.onSelectChange=function(e){var t;if(!i.disabled){var n=null===(t=i.options)||void 0===t?void 0:t.find((function(t){return t.label===e.target.value}));n&&i.onChange(n.value)}},this.onPhoneChange=function(e){i.disabled||i.onChange(e)},this.onCountryChange=function(e){i.disabled||(i.country=e)},this.handleOnFocus=function(){i.isFocused=!0},this.handleOnBlur=function(){i.isFocused=!1},this.type=t.type,this.inputType=t.inputType,this.inputMode=t.inputMode,this.options=t.options,this.label=t.label,this.placeholder=t.placeholder,this.value=t.value,this.hasError=t.hasError,this.errorText=t.errorText,this.tooltipText=t.tooltipText,this.country=t.country||null,this.textAreaPlaceholder=t.textAreaPlaceholder||null,this.maxLength=t.maxLength,this.rightContent=t.rightContent||null,this.disableResize=t.disableResize||!1,this.disabled=t.disabled||!1,this.isFocused=!1,this.onChange=t.onChange,e(this)}return Object.defineProperty(n.prototype,"formItemStyle",{get:function(){var e=[t.FormItem];return this.type===i.TEL&&this.hasError&&e.push(t.PhoneError),e.join(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"labelStyle",{get:function(){return this.value||this.type===i.TEL||this.placeholder&&this.isFocused?[t.FieldLabel,t.FieldLabelTop].join(" "):[t.FieldLabel].join(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inputStyle",{get:function(){var e=[];return(this.value||this.placeholder&&this.isFocused)&&e.push(t.Bottom),this.hasError&&e.push(t.Error),this.tooltipText&&e.push(t.WithTooltip),this.type===i.TEL&&e.push(t.Tel),this.disabled&&e.push(t.Disabled),e.join(" ")},enumerable:!1,configurable:!0}),n}();!function(e){e[e.TEXT=0]="TEXT",e[e.TEXT_AREA=1]="TEXT_AREA",e[e.SELECT=2]="SELECT",e[e.TEL=3]="TEL"}(i||(i={})),function(e){e.TEXT="text",e.PASSWORD="password"}(n||(n={})),function(e){e.NUMERIC="numeric",e.TEL="tel",e.EMAIL="email"}(o||(o={}));export{o as FormItemInputMode,n as FormItemInputType,i as FormItemType,s as default};
1
+ import{makeAutoObservable as e}from"mobx";import t from"./style.module.scss.js";var i,n,o,s=function(){function n(t){var i=this;this.country=null,this.textAreaPlaceholder=null,this.onValueChange=function(e){i.disabled||i.onChange(e.target.value)},this.onTextAreaValueChange=function(e){i.disabled||i.onChange(e.target.value)},this.onSelectChange=function(e){var t;if(!i.disabled){var n=null===(t=i.options)||void 0===t?void 0:t.find((function(t){return t.label===e.target.value}));n&&i.onChange(n.value)}},this.onPhoneChange=function(e){i.disabled||i.onChange(e)},this.onCountryChange=function(e){i.disabled||(i.country=e)},this.handleOnFocus=function(){i.isFocused=!0},this.handleOnBlur=function(){i.isFocused=!1},this.type=t.type,this.inputType=t.inputType,this.inputMode=t.inputMode,this.options=t.options,this.label=t.label,this.placeholder=t.placeholder,this.value=t.value,this.hasError=t.hasError,this.errorText=t.errorText,this.tooltipText=t.tooltipText,this.country=t.country||null,this.textAreaPlaceholder=t.textAreaPlaceholder||null,this.maxLength=t.maxLength,this.rightContent=t.rightContent||null,this.disableResize=t.disableResize||!1,this.disabled=t.disabled||!1,this.isLoading=t.isLoading||!1,this.isFocused=!1,this.onChange=t.onChange,e(this)}return Object.defineProperty(n.prototype,"formItemStyle",{get:function(){var e=[t.FormItem];return this.type===i.TEL&&this.hasError&&e.push(t.PhoneError),e.join(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"labelStyle",{get:function(){return this.value||this.type===i.TEL||this.placeholder&&this.isFocused?[t.FieldLabel,t.FieldLabelTop].join(" "):[t.FieldLabel].join(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inputStyle",{get:function(){var e=[];return(this.value||this.placeholder&&this.isFocused)&&e.push(t.Bottom),this.hasError&&e.push(t.Error),this.tooltipText&&e.push(t.WithTooltip),this.type===i.TEL&&e.push(t.Tel),this.disabled&&e.push(t.Disabled),e.join(" ")},enumerable:!1,configurable:!0}),n}();!function(e){e[e.TEXT=0]="TEXT",e[e.TEXT_AREA=1]="TEXT_AREA",e[e.SELECT=2]="SELECT",e[e.TEL=3]="TEL"}(i||(i={})),function(e){e.TEXT="text",e.PASSWORD="password"}(n||(n={})),function(e){e.NUMERIC="numeric",e.TEL="tel",e.EMAIL="email"}(o||(o={}));export{o as FormItemInputMode,n as FormItemInputType,i as FormItemType,s as default};
@@ -1 +1 @@
1
- import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var t={FormSectionTitle:"style-module_FormSectionTitle__VB-M-",Title:"style-module_Title__vKJBI",WithSubTitle:"style-module_WithSubTitle__D0bIa",SubTitle:"style-module_SubTitle__QOgiQ",Grid:"style-module_Grid__zW07u",Grid2:"style-module_Grid2__ngFn-",Grid3:"style-module_Grid3__WkRIF",FormItem:"style-module_FormItem__Uk50U",FormItemWrapper:"style-module_FormItemWrapper__7lb91",RightContent:"style-module_RightContent__mPnNX",FormItemInputWrapper:"style-module_FormItemInputWrapper__-bMzj",FieldLabel:"style-module_FieldLabel__FLtYi",FieldLabelTop:"style-module_FieldLabelTop__-neJm",Bottom:"style-module_Bottom__Syp-M",Error:"style-module_Error__TxUpM",WithTooltip:"style-module_WithTooltip__vErQH",ArrowContainer:"style-module_ArrowContainer__4GCN2",ErrorMsg:"style-module_ErrorMsg__AL-SH",fadeInFromRight:"style-module_fadeInFromRight__jtf8N",PhoneError:"style-module_PhoneError__Jl0Ig",FormItemTooltipContainer:"style-module_FormItemTooltipContainer__Het-k",TextareaInfo:"style-module_TextareaInfo__MkOI-"};e('.style-module_FormSectionTitle__VB-M- {\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.style-module_FormSectionTitle__VB-M- .style-module_Title__vKJBI {\n flex: 1 1 auto;\n padding-bottom: 16px;\n color: var(--checkout-primary-text-color);\n font-size: 20px;\n line-height: 32px;\n}\n.style-module_FormSectionTitle__VB-M- .style-module_Title__vKJBI.style-module_WithSubTitle__D0bIa {\n line-height: auto;\n padding-bottom: 0;\n}\n\n.style-module_SubTitle__QOgiQ {\n color: var(--checkout-secondary-text-color);\n font-size: 14px;\n padding-bottom: 16px;\n padding-top: 2px;\n}\n\n.style-module_Grid__zW07u {\n display: grid;\n grid-gap: 16px;\n grid-template-columns: 1fr;\n}\n.style-module_Grid__zW07u.style-module_Grid2__ngFn- {\n grid-template-columns: repeat(2, 1fr);\n}\n.style-module_Grid__zW07u.style-module_Grid3__WkRIF {\n grid-template-columns: repeat(3, 1fr);\n}\n@media only screen and (max-width: 768px) {\n .style-module_Grid__zW07u {\n grid-template-columns: 1fr !important;\n }\n}\n\n@keyframes style-module_fadeInFromRight__jtf8N {\n from {\n opacity: 0;\n transform: translateY(10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n.style-module_FormItem__Uk50U {\n width: 100%;\n}\n.style-module_FormItemWrapper__7lb91 {\n width: 100%;\n position: relative;\n}\n.style-module_FormItemWrapper__7lb91 .style-module_RightContent__mPnNX {\n position: absolute;\n height: 100%;\n top: 0;\n right: 0;\n}\n.style-module_FormItemInputWrapper__-bMzj {\n position: relative;\n width: 100%;\n}\n.style-module_FormItemInputWrapper__-bMzj label.style-module_FieldLabel__FLtYi {\n color: var(--checkout-secondary-text-color);\n position: absolute;\n top: 0;\n left: 17px;\n width: 100%;\n z-index: 1;\n user-select: none;\n pointer-events: none;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n transition: transform 0.1s;\n transform: translateY(18px);\n font-size: 0.85em;\n line-height: 22px;\n}\n.style-module_FormItemInputWrapper__-bMzj label.style-module_FieldLabelTop__-neJm {\n transform: translateY(8px);\n font-size: 0.7em;\n}\n.style-module_FormItemInputWrapper__-bMzj input,\n.style-module_FormItemInputWrapper__-bMzj select,\n.style-module_FormItemInputWrapper__-bMzj textarea {\n border: 1px solid var(--checkout-border-color);\n background-color: var(--checkout-primary-bg-color);\n color: var(--checkout-primary-text-color);\n background-clip: padding-box;\n border-radius: 8px;\n display: block;\n width: 100%;\n height: 56px;\n padding: 8px 16px;\n outline: none;\n transition: padding 0.1s, border-color 0.5s, box-shadow 0.5s;\n box-shadow: 0 0 0 1px transparent;\n -moz-appearance: none;\n -webkit-appearance: none;\n}\n.style-module_FormItemInputWrapper__-bMzj input:focus,\n.style-module_FormItemInputWrapper__-bMzj select:focus,\n.style-module_FormItemInputWrapper__-bMzj textarea:focus {\n box-shadow: 0 0 0 1px var(--checkout-button-bg-color);\n border-color: var(--checkout-button-bg-color);\n}\n.style-module_FormItemInputWrapper__-bMzj input.style-module_Bottom__Syp-M,\n.style-module_FormItemInputWrapper__-bMzj select.style-module_Bottom__Syp-M,\n.style-module_FormItemInputWrapper__-bMzj textarea.style-module_Bottom__Syp-M {\n padding-top: 1.2em;\n padding-bottom: 0.2em;\n}\n.style-module_FormItemInputWrapper__-bMzj input.style-module_Error__TxUpM,\n.style-module_FormItemInputWrapper__-bMzj select.style-module_Error__TxUpM,\n.style-module_FormItemInputWrapper__-bMzj textarea.style-module_Error__TxUpM {\n box-shadow: 0 0 0 1px var(--checkout-error-color);\n border-color: var(--checkout-error-color);\n}\n.style-module_FormItemInputWrapper__-bMzj input.style-module_WithTooltip__vErQH,\n.style-module_FormItemInputWrapper__-bMzj select.style-module_WithTooltip__vErQH,\n.style-module_FormItemInputWrapper__-bMzj textarea.style-module_WithTooltip__vErQH {\n padding-right: 40px;\n}\n.style-module_FormItemInputWrapper__-bMzj input::-ms-expand,\n.style-module_FormItemInputWrapper__-bMzj select::-ms-expand,\n.style-module_FormItemInputWrapper__-bMzj textarea::-ms-expand {\n display: none;\n}\n.style-module_FormItemInputWrapper__-bMzj input::placeholder,\n.style-module_FormItemInputWrapper__-bMzj select::placeholder,\n.style-module_FormItemInputWrapper__-bMzj textarea::placeholder {\n color: var(--checkout-secondary-text-color) !important;\n}\n.style-module_FormItemInputWrapper__-bMzj textarea {\n min-height: 120px;\n}\n.style-module_FormItemInputWrapper__-bMzj .style-module_ArrowContainer__4GCN2 {\n position: absolute;\n right: 1px;\n padding-right: 0.5em;\n top: 1px;\n height: calc(100% - 2px);\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n background-color: var(--checkout-primary-bg-color);\n z-index: 2;\n border-radius: 6px;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInput {\n display: flex;\n align-items: center;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputInput {\n padding-left: 64px;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputInput:disabled {\n color: var(--checkout-button-disabled-text-color) !important;\n background-color: var(--checkout-button-disabled-bg-color) !important;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputInput::placeholder {\n color: var(--checkout-secondary-text-color) !important;\n font-size: 14px !important;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputCountry {\n position: absolute;\n align-self: stretch;\n display: flex;\n align-items: center;\n top: 26px;\n left: 16px;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputCountrySelect {\n border: none;\n display: inline-flex;\n width: 60px;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n z-index: 1;\n border: 0;\n opacity: 0;\n cursor: pointer;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputCountryIcon {\n width: 1.5em;\n height: 1em;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputCountrySelectArrow {\n display: block;\n content: "";\n width: 0.3em;\n height: 0.3em;\n margin-left: 0.35em;\n border-style: solid;\n border-color: inherit;\n border-top-width: 0;\n border-bottom-width: 1px;\n border-left-width: 0;\n border-right-width: 1px;\n transform: rotate(45deg);\n opacity: 0.45;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputCountryIconImg {\n width: 24px;\n}\n.style-module_FormItem__Uk50U .style-module_ErrorMsg__AL-SH {\n color: var(--checkout-error-color);\n font-size: 12px;\n margin-top: 8px;\n animation-name: style-module_fadeInFromRight__jtf8N;\n animation-duration: 0.3s;\n}\n.style-module_FormItem__Uk50U.style-module_PhoneError__Jl0Ig input {\n box-shadow: 0 0 0 1px var(--checkout-error-color) !important;\n border-color: var(--checkout-error-color) !important;\n}\n\n.style-module_FormItemWrapper__7lb91 {\n position: relative;\n}\n\n.style-module_FormItemTooltipContainer__Het-k {\n width: 16px;\n height: 16px;\n border-radius: 100%;\n color: white;\n background-color: var(--checkout-secondary-text-color);\n position: absolute;\n top: 20px;\n right: 16px;\n margin: auto;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 12px !important;\n line-height: 16px !important;\n cursor: pointer;\n}\n\n.style-module_TextareaInfo__MkOI- {\n text-align: right;\n}');export{t as default};
1
+ import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var t={FormSectionTitle:"style-module_FormSectionTitle__VB-M-",Title:"style-module_Title__vKJBI",WithSubTitle:"style-module_WithSubTitle__D0bIa",SubTitle:"style-module_SubTitle__QOgiQ",Grid:"style-module_Grid__zW07u",Grid2:"style-module_Grid2__ngFn-",Grid3:"style-module_Grid3__WkRIF",FormItem:"style-module_FormItem__Uk50U",FormItemWrapper:"style-module_FormItemWrapper__7lb91",RightContent:"style-module_RightContent__mPnNX",FormItemInputWrapper:"style-module_FormItemInputWrapper__-bMzj",FieldLabel:"style-module_FieldLabel__FLtYi",FieldLabelTop:"style-module_FieldLabelTop__-neJm",Bottom:"style-module_Bottom__Syp-M",Error:"style-module_Error__TxUpM",WithTooltip:"style-module_WithTooltip__vErQH",ArrowContainer:"style-module_ArrowContainer__4GCN2",ErrorMsg:"style-module_ErrorMsg__AL-SH",fadeInFromRight:"style-module_fadeInFromRight__jtf8N",PhoneError:"style-module_PhoneError__Jl0Ig",FormItemTooltipContainer:"style-module_FormItemTooltipContainer__Het-k",TextareaInfo:"style-module_TextareaInfo__MkOI-",Loader:"style-module_Loader__2Juf8",load8:"style-module_load8__GVBWV"};e('.style-module_FormSectionTitle__VB-M- {\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.style-module_FormSectionTitle__VB-M- .style-module_Title__vKJBI {\n flex: 1 1 auto;\n padding-bottom: 16px;\n color: var(--checkout-primary-text-color);\n font-size: 20px;\n line-height: 32px;\n}\n.style-module_FormSectionTitle__VB-M- .style-module_Title__vKJBI.style-module_WithSubTitle__D0bIa {\n line-height: auto;\n padding-bottom: 0;\n}\n\n.style-module_SubTitle__QOgiQ {\n color: var(--checkout-secondary-text-color);\n font-size: 14px;\n padding-bottom: 16px;\n padding-top: 2px;\n}\n\n.style-module_Grid__zW07u {\n display: grid;\n grid-gap: 16px;\n grid-template-columns: 1fr;\n}\n.style-module_Grid__zW07u.style-module_Grid2__ngFn- {\n grid-template-columns: repeat(2, 1fr);\n}\n.style-module_Grid__zW07u.style-module_Grid3__WkRIF {\n grid-template-columns: repeat(3, 1fr);\n}\n@media only screen and (max-width: 768px) {\n .style-module_Grid__zW07u {\n grid-template-columns: 1fr !important;\n }\n}\n\n@keyframes style-module_fadeInFromRight__jtf8N {\n from {\n opacity: 0;\n transform: translateY(10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n.style-module_FormItem__Uk50U {\n width: 100%;\n}\n.style-module_FormItemWrapper__7lb91 {\n width: 100%;\n position: relative;\n}\n.style-module_FormItemWrapper__7lb91 .style-module_RightContent__mPnNX {\n position: absolute;\n height: 100%;\n top: 0;\n right: 0;\n}\n.style-module_FormItemInputWrapper__-bMzj {\n position: relative;\n width: 100%;\n}\n.style-module_FormItemInputWrapper__-bMzj label.style-module_FieldLabel__FLtYi {\n color: var(--checkout-secondary-text-color);\n position: absolute;\n top: 0;\n left: 17px;\n width: 100%;\n z-index: 1;\n user-select: none;\n pointer-events: none;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n transition: transform 0.1s;\n transform: translateY(18px);\n font-size: 0.85em;\n line-height: 22px;\n}\n.style-module_FormItemInputWrapper__-bMzj label.style-module_FieldLabelTop__-neJm {\n transform: translateY(8px);\n font-size: 0.7em;\n}\n.style-module_FormItemInputWrapper__-bMzj input,\n.style-module_FormItemInputWrapper__-bMzj select,\n.style-module_FormItemInputWrapper__-bMzj textarea {\n border: 1px solid var(--checkout-border-color);\n background-color: var(--checkout-primary-bg-color);\n color: var(--checkout-primary-text-color);\n background-clip: padding-box;\n border-radius: 8px;\n display: block;\n width: 100%;\n height: 56px;\n padding: 8px 16px;\n outline: none;\n transition: padding 0.1s, border-color 0.5s, box-shadow 0.5s;\n box-shadow: 0 0 0 1px transparent;\n -moz-appearance: none;\n -webkit-appearance: none;\n}\n.style-module_FormItemInputWrapper__-bMzj input:focus,\n.style-module_FormItemInputWrapper__-bMzj select:focus,\n.style-module_FormItemInputWrapper__-bMzj textarea:focus {\n box-shadow: 0 0 0 1px var(--checkout-button-bg-color);\n border-color: var(--checkout-button-bg-color);\n}\n.style-module_FormItemInputWrapper__-bMzj input.style-module_Bottom__Syp-M,\n.style-module_FormItemInputWrapper__-bMzj select.style-module_Bottom__Syp-M,\n.style-module_FormItemInputWrapper__-bMzj textarea.style-module_Bottom__Syp-M {\n padding-top: 1.2em;\n padding-bottom: 0.2em;\n}\n.style-module_FormItemInputWrapper__-bMzj input.style-module_Error__TxUpM,\n.style-module_FormItemInputWrapper__-bMzj select.style-module_Error__TxUpM,\n.style-module_FormItemInputWrapper__-bMzj textarea.style-module_Error__TxUpM {\n box-shadow: 0 0 0 1px var(--checkout-error-color);\n border-color: var(--checkout-error-color);\n}\n.style-module_FormItemInputWrapper__-bMzj input.style-module_WithTooltip__vErQH,\n.style-module_FormItemInputWrapper__-bMzj select.style-module_WithTooltip__vErQH,\n.style-module_FormItemInputWrapper__-bMzj textarea.style-module_WithTooltip__vErQH {\n padding-right: 40px;\n}\n.style-module_FormItemInputWrapper__-bMzj input::-ms-expand,\n.style-module_FormItemInputWrapper__-bMzj select::-ms-expand,\n.style-module_FormItemInputWrapper__-bMzj textarea::-ms-expand {\n display: none;\n}\n.style-module_FormItemInputWrapper__-bMzj input::placeholder,\n.style-module_FormItemInputWrapper__-bMzj select::placeholder,\n.style-module_FormItemInputWrapper__-bMzj textarea::placeholder {\n color: var(--checkout-secondary-text-color) !important;\n}\n.style-module_FormItemInputWrapper__-bMzj textarea {\n min-height: 120px;\n}\n.style-module_FormItemInputWrapper__-bMzj .style-module_ArrowContainer__4GCN2 {\n position: absolute;\n right: 1px;\n padding-right: 0.5em;\n top: 1px;\n height: calc(100% - 2px);\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n background-color: var(--checkout-primary-bg-color);\n z-index: 2;\n border-radius: 6px;\n width: 25px;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInput {\n display: flex;\n align-items: center;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputInput {\n padding-left: 64px;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputInput:disabled {\n color: var(--checkout-button-disabled-text-color) !important;\n background-color: var(--checkout-button-disabled-bg-color) !important;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputInput::placeholder {\n color: var(--checkout-secondary-text-color) !important;\n font-size: 14px !important;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputCountry {\n position: absolute;\n align-self: stretch;\n display: flex;\n align-items: center;\n top: 26px;\n left: 16px;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputCountrySelect {\n border: none;\n display: inline-flex;\n width: 60px;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n z-index: 1;\n border: 0;\n opacity: 0;\n cursor: pointer;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputCountryIcon {\n width: 1.5em;\n height: 1em;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputCountrySelectArrow {\n display: block;\n content: "";\n width: 0.3em;\n height: 0.3em;\n margin-left: 0.35em;\n border-style: solid;\n border-color: inherit;\n border-top-width: 0;\n border-bottom-width: 1px;\n border-left-width: 0;\n border-right-width: 1px;\n transform: rotate(45deg);\n opacity: 0.45;\n}\n.style-module_FormItemInputWrapper__-bMzj .PhoneInputCountryIconImg {\n width: 24px;\n}\n.style-module_FormItem__Uk50U .style-module_ErrorMsg__AL-SH {\n color: var(--checkout-error-color);\n font-size: 12px;\n margin-top: 8px;\n animation-name: style-module_fadeInFromRight__jtf8N;\n animation-duration: 0.3s;\n}\n.style-module_FormItem__Uk50U.style-module_PhoneError__Jl0Ig input {\n box-shadow: 0 0 0 1px var(--checkout-error-color) !important;\n border-color: var(--checkout-error-color) !important;\n}\n\n.style-module_FormItemWrapper__7lb91 {\n position: relative;\n}\n\n.style-module_FormItemTooltipContainer__Het-k {\n width: 16px;\n height: 16px;\n border-radius: 100%;\n color: white;\n background-color: var(--checkout-secondary-text-color);\n position: absolute;\n top: 20px;\n right: 16px;\n margin: auto;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 12px !important;\n line-height: 16px !important;\n cursor: pointer;\n}\n\n.style-module_TextareaInfo__MkOI- {\n text-align: right;\n}\n\n.style-module_Loader__2Juf8,\n.style-module_Loader__2Juf8:after {\n border-radius: 50%;\n width: 0.9em;\n height: 0.9em;\n}\n\n.style-module_Loader__2Juf8 {\n font-size: 12px;\n position: relative;\n text-indent: -9999em;\n border-top: 0.13em solid rgba(255, 255, 255, 0.2);\n border-right: 0.13em solid rgba(255, 255, 255, 0.2);\n border-bottom: 0.13em solid rgba(255, 255, 255, 0.2);\n border-left: 0.13em solid var(--checkout-button-bg-color);\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n -webkit-animation: style-module_load8__GVBWV 1.1s infinite linear;\n animation: style-module_load8__GVBWV 1.1s infinite linear;\n}\n\n@-webkit-keyframes style-module_load8__GVBWV {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes style-module_load8__GVBWV {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}');export{t as default};
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../model";
3
+ import "@adyen/adyen-web/dist/adyen.css";
4
+ declare type Props = {
5
+ vm: CheckoutViewModel;
6
+ isSelected?: boolean;
7
+ };
8
+ export declare const HepsiPay: React.FC<Props>;
9
+ export {};
@@ -0,0 +1 @@
1
+ import{__awaiter as e,__generator as n}from'./../../../../ext/tslib/tslib.es6.js';import*as a from"react";import{observer as i}from"mobx-react-lite";import"@adyen/adyen-web/dist/adyen.css";var o=i((function(i){var o=i.vm;i.isSelected;var r=a.useCallback((function(){if(o.hepsipayFrameInitResponse)if(window.HepsipaySdk){var a={frameUrl:o.hepsipayFrameInitResponse.frameUrl,frameDivId:"hepsipayFrameContainer",paymentStatusCallback:function(a){return e(void 0,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))},frameFailureCallback:function(){return console.error("Frame failed to load")},onPaymentFailureLogCallback:function(e){console.log("onPaymentFailureLogCallback",e),o.isStepLoading=!1},onPaymentSuccessCallback:function(a){return e(void 0,void 0,void 0,(function(){return n(this,(function(e){return console.log("onPaymentSuccessCallback",a),a&&"hp-payment-success"===a.messageType&&(window.location.href=a.merchantCallBackUrl),[2]}))}))},maxHeight:"400",disableDynamicHeight:!1,showFramePaymentButton:!1,useApiCallOnSuccessCallback:!1,overrideFontFamily:"Inter",hideHeader:!1};window.HepsipaySdk.init(a)}else console.error("HepsipaySdk is not available")}),[o.hepsipayFrameInitResponse]);return a.useEffect((function(){var a=document.createElement("script");a.src="https://images.hepsiburada.net/hepsipay/packages/pf/hepsipay-0.3.1.min.js",a.async=!0,a.onload=r,a.onerror=function(){return console.error("Failed to load Hepsipay SDK")},document.body.appendChild(a);var i=function(a){return e(void 0,void 0,void 0,(function(){var e;return n(this,(function(n){return a.origin!==window.location.origin||((e=a.data).messageType,e.data),[2]}))}))};return window.addEventListener("message",i),function(){document.body.removeChild(a),window.removeEventListener("message",i)}}),[r]),a.createElement("div",null,a.createElement("div",{id:"hepsipayFrameContainer"}))}));export{o as HepsiPay};
@@ -1 +1 @@
1
- import n from'./../../../../ext/style-inject/dist/style-inject.es.js';var e={Container:"style-module_Container__lcmQH",Button:"style-module_Button__f1URY",loader:"style-module_loader__JSw-M",load8:"style-module_load8__8s2-g"};n(".style-module_Container__lcmQH {\n width: 100%;\n height: 44px;\n background-color: white;\n border-radius: 8px;\n display: flex;\n justify-content: flex-end;\n position: relative;\n}\n.style-module_Container__lcmQH input {\n width: calc(100% - 2px);\n height: 100%;\n padding: 10px 16px;\n outline: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n transition: all 0.5s;\n box-shadow: 0 0 0 1px transparent;\n border: 1px solid transparent;\n border-radius: 9px;\n margin-left: 1px;\n color: var(--checkout-primary-text-color);\n position: absolute;\n top: 0px;\n left: 0px;\n padding-right: calc(33% + 16px);\n}\n.style-module_Container__lcmQH input::placeholder {\n color: var(--checkout-secondary-text-color) !important;\n}\n.style-module_Container__lcmQH input:focus {\n box-shadow: 0 0 0 1px var(--checkout-button-bg-color);\n border-color: var(--checkout-button-bg-color);\n}\n.style-module_Container__lcmQH .style-module_Button__f1URY {\n flex: 0 0 auto;\n height: 100%;\n width: 33%;\n color: var(--checkout-button-text-color);\n background-color: var(--checkout-button-bg-color);\n border-radius: 8px;\n font-weight: 600;\n text-align: center;\n position: relative;\n transition: all 0.2s;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n cursor: pointer;\n}\n.style-module_Container__lcmQH .style-module_Button__f1URY .style-module_loader__JSw-M,\n.style-module_Container__lcmQH .style-module_Button__f1URY .style-module_loader__JSw-M:after {\n border-radius: 50%;\n width: 5em;\n height: 5em;\n}\n.style-module_Container__lcmQH .style-module_Button__f1URY .style-module_loader__JSw-M {\n font-size: 4px;\n position: relative;\n text-indent: -9999em;\n border-top: 0.5em solid rgba(255, 255, 255, 0.2);\n border-right: 0.5em solid rgba(255, 255, 255, 0.2);\n border-bottom: 0.5em solid rgba(255, 255, 255, 0.2);\n border-left: 0.5em solid var(--checkout-button-text-color);\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n -webkit-animation: style-module_load8__8s2-g 1.1s infinite linear;\n animation: style-module_load8__8s2-g 1.1s infinite linear;\n}\n@-webkit-keyframes style-module_load8__8s2-g {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes style-module_load8__8s2-g {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}");export{e as default};
1
+ import n from'./../../../../ext/style-inject/dist/style-inject.es.js';var e={Container:"style-module_Container__lcmQH",Button:"style-module_Button__f1URY",loader:"style-module_loader__JSw-M",load8:"style-module_load8__8s2-g"};n(".style-module_Container__lcmQH {\n width: 100%;\n height: 44px;\n background-color: white;\n border-radius: 8px;\n display: flex;\n justify-content: flex-end;\n position: relative;\n}\n.style-module_Container__lcmQH input {\n width: calc(100% - 2px);\n height: 100%;\n padding: 10px 16px;\n outline: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n transition: all 0.5s;\n box-shadow: 0 0 0 1px transparent;\n border: 1px solid transparent;\n border-radius: 9px;\n margin-left: 1px;\n background-color: var(--checkout-primary-bg-color);\n color: var(--checkout-primary-text-color);\n position: absolute;\n top: 0px;\n left: 0px;\n padding-right: calc(33% + 16px);\n}\n.style-module_Container__lcmQH input::placeholder {\n color: var(--checkout-secondary-text-color) !important;\n}\n.style-module_Container__lcmQH input:focus {\n box-shadow: 0 0 0 1px var(--checkout-button-bg-color);\n border-color: var(--checkout-button-bg-color);\n}\n.style-module_Container__lcmQH .style-module_Button__f1URY {\n flex: 0 0 auto;\n height: 100%;\n width: 33%;\n color: var(--checkout-button-text-color);\n background-color: var(--checkout-button-bg-color);\n border-radius: 8px;\n font-weight: 600;\n text-align: center;\n position: relative;\n transition: all 0.2s;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n cursor: pointer;\n}\n.style-module_Container__lcmQH .style-module_Button__f1URY .style-module_loader__JSw-M,\n.style-module_Container__lcmQH .style-module_Button__f1URY .style-module_loader__JSw-M:after {\n border-radius: 50%;\n width: 5em;\n height: 5em;\n}\n.style-module_Container__lcmQH .style-module_Button__f1URY .style-module_loader__JSw-M {\n font-size: 4px;\n position: relative;\n text-indent: -9999em;\n border-top: 0.5em solid rgba(255, 255, 255, 0.2);\n border-right: 0.5em solid rgba(255, 255, 255, 0.2);\n border-bottom: 0.5em solid rgba(255, 255, 255, 0.2);\n border-left: 0.5em solid var(--checkout-button-text-color);\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n -webkit-animation: style-module_load8__8s2-g 1.1s infinite linear;\n animation: style-module_load8__8s2-g 1.1s infinite linear;\n}\n@-webkit-keyframes style-module_load8__8s2-g {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes style-module_load8__8s2-g {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}");export{e as default};
@@ -3,6 +3,7 @@ declare type Props = {
3
3
  title: string;
4
4
  modalContent: string | React.ReactElement;
5
5
  onClose: () => void;
6
+ isPolicyModal?: boolean;
6
7
  };
7
8
  export declare const Modal: React.FC<Props>;
8
9
  export {};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import a from"./useEscape.js";import o from"../svg/cross.js";import l from"./style.module.scss.js";var r=t((function(t){var r=t.title,n=t.onClose,s=t.modalContent;return a({callback:n}),e.createElement("div",{className:l.ModalContainer,onClick:n},e.createElement("div",{className:l.Modal,onClick:function(e){return e.stopPropagation()}},e.createElement("div",{className:l.ModalHeader},e.createElement("div",{className:l.ModalTitle},r),e.createElement("div",{className:l.CloseButton,onClick:n},e.createElement(o,null))),"string"==typeof s?e.createElement("div",{className:l.ModalContent,dangerouslySetInnerHTML:{__html:s}}):e.createElement("div",{className:l.ModalContent},s)))}));export{r as Modal};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import a from"./useEscape.js";import o from"../svg/cross.js";import l from"./style.module.scss.js";var n=t((function(t){var n=t.title,r=t.onClose,s=t.modalContent,c=t.isPolicyModal;return a({callback:r}),e.createElement("div",{className:l.ModalContainer,onClick:r},e.createElement("div",{className:l.Modal,onClick:function(e){return e.stopPropagation()}},e.createElement("div",{className:l.ModalHeader},e.createElement("div",{className:l.ModalTitle},n),e.createElement("div",{className:l.CloseButton,onClick:r},e.createElement(o,null))),"string"==typeof s?e.createElement("div",{className:[l.ModalContent,c?l.PolicyModal:""].join(" "),dangerouslySetInnerHTML:{__html:s}}):e.createElement("div",{className:l.ModalContent},s)))}));export{n as Modal};
@@ -1 +1 @@
1
- import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var o={ModalContainer:"style-module_ModalContainer__moKsA",Modal:"style-module_Modal__zb62t",ModalHeader:"style-module_ModalHeader__9gl-m",ModalTitle:"style-module_ModalTitle__1p8oq",CloseButton:"style-module_CloseButton__7ZNe8",ModalContent:"style-module_ModalContent__Zs4AZ"};e(".style-module_ModalContainer__moKsA {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.6);\n backdrop-filter: blur(6px);\n z-index: 99999999;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t {\n border-radius: 8px;\n background-color: white;\n color: var(--checkout-primary-text-color);\n min-width: 400px;\n max-width: 750px;\n max-height: 90%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_ModalHeader__9gl-m {\n flex: 0 0 auto;\n padding: 16px;\n font-size: 18px;\n border-bottom: 1px solid var(--checkout-border-color);\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_ModalHeader__9gl-m .style-module_ModalTitle__1p8oq {\n font-weight: 500;\n max-width: 300px;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_ModalHeader__9gl-m .style-module_CloseButton__7ZNe8 {\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_ModalContent__Zs4AZ {\n flex: 1 1 auto;\n padding: 24px;\n overflow-y: auto;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_ModalContainer__moKsA .style-module_Modal__zb62t {\n max-width: unset;\n max-height: unset;\n min-width: unset;\n width: 100%;\n height: 100%;\n margin: 0;\n border-radius: 0;\n }\n .style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_ModalHeader__9gl-m {\n padding: 1.5em;\n }\n}");export{o as default};
1
+ import l from'./../../../../ext/style-inject/dist/style-inject.es.js';var e={ModalContainer:"style-module_ModalContainer__moKsA",Modal:"style-module_Modal__zb62t",ModalHeader:"style-module_ModalHeader__9gl-m",ModalTitle:"style-module_ModalTitle__1p8oq",CloseButton:"style-module_CloseButton__7ZNe8",ModalContent:"style-module_ModalContent__Zs4AZ",PolicyModal:"style-module_PolicyModal__B6KSz"};l(".style-module_ModalContainer__moKsA {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.6);\n backdrop-filter: blur(6px);\n z-index: 99999999;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t {\n border-radius: 8px;\n background-color: white;\n color: var(--checkout-primary-text-color);\n min-width: 400px;\n max-width: 750px;\n max-height: 90%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_ModalHeader__9gl-m {\n flex: 0 0 auto;\n padding: 16px;\n font-size: 18px;\n border-bottom: 1px solid var(--checkout-border-color);\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_ModalHeader__9gl-m .style-module_ModalTitle__1p8oq {\n font-weight: 500;\n max-width: 300px;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_ModalHeader__9gl-m .style-module_CloseButton__7ZNe8 {\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_ModalContent__Zs4AZ {\n flex: 1 1 auto;\n padding: 24px;\n overflow-y: auto;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_PolicyModal__B6KSz h1 {\n font-size: 2em;\n font-weight: bold;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_PolicyModal__B6KSz h2 {\n font-size: 1.5em;\n font-weight: bold;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_PolicyModal__B6KSz h3 {\n font-size: 1.17em;\n font-weight: bold;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_PolicyModal__B6KSz h4 {\n font-size: 1em;\n font-weight: bold;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_PolicyModal__B6KSz h5 {\n font-size: 0.83em;\n font-weight: bold;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_PolicyModal__B6KSz h6 {\n font-size: 0.67em;\n font-weight: bold;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_PolicyModal__B6KSz ol {\n list-style-type: decimal;\n padding-left: 24px;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_PolicyModal__B6KSz ul {\n list-style-type: disc;\n padding-left: 24px;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_PolicyModal__B6KSz b {\n font-weight: bolder;\n}\n.style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_PolicyModal__B6KSz i {\n font-style: italic;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_ModalContainer__moKsA .style-module_Modal__zb62t {\n max-width: unset;\n max-height: unset;\n min-width: unset;\n width: 100%;\n height: 100%;\n margin: 0;\n border-radius: 0;\n }\n .style-module_ModalContainer__moKsA .style-module_Modal__zb62t .style-module_ModalHeader__9gl-m {\n padding: 1.5em;\n }\n}");export{e as default};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import{CheckoutStep as n}from"../../model.js";import{Button as a}from"../button/index.js";import i from"./select/index.js";import o from"../svg/cross.js";import{useTranslation as r}from"../../../../utils/i18n.js";import c from"./style.module.scss.js";import{IkasAmountType as s}from"@ikas/storefront-models";import"@ikas/storefront-config";import{formatCurrency as l}from"../../../../utils/currency.js";var u=function(t){var a,i,o=t.seconds,s=t.onFinish,l=t.campaignOffer,u=t.vm,f=t.isPopupClosed,m=t.step,p=r().t,v=e.useState(o),g=v[0],C=v[1];e.useEffect((function(){C(o)}),[o]),e.useEffect((function(){var e=setInterval((function(){g>0?C(g-1):(clearInterval(e),s())}),1e3);return function(){return clearInterval(e)}}),[g]);var S=l.offer.countdownMinutes&&(m!==n.SUCCESS?!!(null===(a=u.customizationProps)||void 0===a?void 0:a.campaignOfferCountdownStyleIsLine):!!(null===(i=u.customizationProps)||void 0===i?void 0:i.campaignOfferCountdownStyleIsLineSuccessPage))||f;return e.createElement("div",{className:S?c.CountdownContainerIsLine:c.CountdownContainer},e.createElement("div",{className:c.CountdownTextMain},!S&&e.createElement("span",{className:c.CountdownText},p("checkout-page:timeRemaining")),e.createElement("span",{className:c.CountdownTime},d(g))))},d=function(e){var t=Math.floor(e/60/60),n=Math.floor(e/60)-60*t,a=e%60;return 0!==t?t.toString().padStart(2,"0")+":":n.toString().padStart(2,"0")+":"+a.toString().padStart(2,"0")},f=t((function(t){var d,f,m,p,v,g,C,S=t.vm,h=t.campaignOffer,E=t.index,P=t.activeIndex,O=t.offersLength,V=t.handleNext,I=t.handlePrev,w=t.setActiveIndex,N=t.isPopupShow,y=t.closePopup,M=t.showPopup,j=t.isPopupClosed,B=t.desktopMiddlePhase,k=t.step,T=r().t,A=h.product,x=k!==n.SUCCESS?!!(null===(d=S.customizationProps)||void 0===d?void 0:d.campaignOfferIsSmallDesign)&&N:!!(null===(f=S.customizationProps)||void 0===f?void 0:f.showCampaignIsBiggerImage)&&k===n.SUCCESS,D=e.useRef(null),L=e.useRef(null),z=e.useRef(null),R=e.useState(0),b=R[0],U=R[1];e.useEffect((function(){var e,t,a,i,o,r,c,s;if(void 0!==typeof window){var l=.8*window.innerHeight,u=0,d=0,f=0;D.current&&(u=null===(t=null===(e=D.current)||void 0===e?void 0:e.getBoundingClientRect())||void 0===t?void 0:t.height),L.current&&(d=null===(i=null===(a=L.current)||void 0===a?void 0:a.getBoundingClientRect())||void 0===i?void 0:i.height),z.current&&(f=null===(r=null===(o=z.current)||void 0===o?void 0:o.getBoundingClientRect())||void 0===r?void 0:r.height);var m=(k===n.SUCCESS?null===(c=S.customizationProps)||void 0===c?void 0:c.campaignOfferCountdownStyleIsLineSuccessPage:null===(s=S.customizationProps)||void 0===s?void 0:s.campaignOfferCountdownStyleIsLine)?25:70,p=navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)?20:0;U(l-u-d-f-p-m)}}),[N]);var F=e.useState(null),H=F[0],X=F[1],q=e.useState(null),G=q[0],J=q[1],K=e.useMemo((function(){var e,t,n,a,i,o,r,c=null===(e=A.selectedVariant.images)||void 0===e?void 0:e.filter((function(e){return!e.isVideo}));return(null===(t=A.selectedVariant.mainImage)||void 0===t?void 0:t.isVideo)&&(null==c?void 0:c.length)?null===(n=c[0].image)||void 0===n?void 0:n.thumbnailSrc:x||B?null===(i=null===(a=A.selectedVariant.mainImage)||void 0===a?void 0:a.image)||void 0===i?void 0:i.getSrc(360):null===(r=null===(o=A.selectedVariant.mainImage)||void 0===o?void 0:o.image)||void 0===r?void 0:r.thumbnailSrc}),[A.selectedVariant,x,B]),Q=e.useMemo((function(){if(!h.offer.countdownMinutes||!h.campaignOffer.offerStartDate)return 0;var e=Math.round(((new Date).getTime()-new Date(h.campaignOffer.offerStartDate).getTime())/1e3);return e>60*h.offer.countdownMinutes?0:60*h.offer.countdownMinutes-e}),[h]),W=function(e){w(0),S.updateCartCampaignOffer({accepted:e,cartId:S.checkout.id,campaignOfferId:h.campaignOffer.campaignOfferId,campaignOfferProductId:h.offer.id,productId:h.offer.productId,variantId:A.selectedVariant.id})},Y=function(){W(!0)},Z=function(){W(!1)},$=function(e,t){var n=null;A.displayedVariantTypes.forEach((function(t){t.displayedVariantValues.forEach((function(t){t.variant.id===e&&(n=t.variantValue)}))}));var a=A.variants.find((function(t){return t.id===e})),i=!!a&&!!a.variantValues&&!!a.variantValues.length&&a.variantValues[t];i&&A.selectVariantValue(i,!0),A.displayedVariantTypes.forEach((function(t){t.displayedVariantValues.forEach((function(t){t.variant.id===e&&(n=t.variantValue)}))})),n?A.selectVariantValue(n,!0):$(e,t+1)},_=h.offer.countdownMinutes&&(k!==n.SUCCESS?!!(null===(m=S.customizationProps)||void 0===m?void 0:m.campaignOfferCountdownStyleIsLine):!!(null===(p=S.customizationProps)||void 0===p?void 0:p.campaignOfferCountdownStyleIsLineSuccessPage))||j&&h.offer.countdownMinutes;return e.createElement("div",{style:{transform:"translateX(-".concat(100*P,"%)")},className:[c.Container,E===P?c.ActiveOffer:"",N?c.PopupContainer:"",B?c.PopupContainerDesktop:"",k===n.SUCCESS?c.Border:""].join(" ")},h.offer.countdownMinutes&&(k!==n.SUCCESS?!(null===(v=S.customizationProps)||void 0===v?void 0:v.campaignOfferCountdownStyleIsLine):!(null===(g=S.customizationProps)||void 0===g?void 0:g.campaignOfferCountdownStyleIsLineSuccessPage))&&!j&&e.createElement(u,{seconds:Q,onFinish:Z,vm:S,campaignOffer:h,step:k}),e.createElement("div",{onTouchStart:function(e){J(null),X(e.targetTouches[0].clientX)},onTouchMove:function(e){return J(e.targetTouches[0].clientX)},onTouchEnd:function(){if(H&&G&&O>1){var e=H-G,t=e>50;(t||e<-50)&&(t?V():I())}},className:[c.ContentContainer,O>1?c.ContentContainerItems:"",j?O>1?c.ContentContainerPopup:c.ContentContainerPopupItems:""].join(" ")},!!N&&e.createElement("div",{className:c.RejectButton,onClick:function(){return y&&y()}},e.createElement(o,null)),e.createElement("div",{ref:D,className:[c.HeaderMain,x&&!j?c.IsBigProductImage:"",_?c.IsLineCountDown:"",j?c.MobileSmallHeader:""].join(" ")},e.createElement("div",{className:c.Header},e.createElement("div",{className:c.Title},h.offer.title),!!h.offer.description&&!j&&e.createElement("div",{className:c.Description},h.offer.description)),_&&e.createElement(u,{seconds:Q,onFinish:Z,vm:S,campaignOffer:h,isPopupClosed:j,step:k})),e.createElement("div",{className:[c.ProductContainer,x&&!j?c.IsLineProductContainer:""].join(" ")},e.createElement("div",{style:N?{width:b,height:b}:{},className:[c.ImageContainer,x&&!j?c.BigImage:"",j?c.SmallImage:"",B?c.BiggerImage:""].join(" ")},e.createElement("img",{className:c.Image,src:K})),e.createElement("div",{ref:L,className:c.ProductDetails},e.createElement("div",{className:c.ProductName},A.name),A.hasVariant&&1===A.variants.length&&e.createElement("div",{className:c.VariantName},A.selectedVariant.variantValues.map((function(e){return e.name})).join(", ")),!(null===(C=S.customizationProps)||void 0===C?void 0:C.showCampaignHideDiscountBadge)&&A.selectedVariant.hasDiscount&&e.createElement("span",{className:c.DiscountBadge},h.offer.discountType===s.RATIO?"%".concat(A.selectedVariant.discountPercentage):l(h.offer.discountAmount||0,A.selectedVariant.price.currency||"",A.selectedVariant.price.currencySymbol||"")," ",T("checkout-page:discount")),e.createElement("div",{className:c.ProductPriceMain},A.selectedVariant.hasDiscount&&e.createElement("span",{className:c.Discount},A.selectedVariant.formattedSellPrice," "),e.createElement("span",{className:c.ProductPrice},h.offer.discountType===s.AMOUNT?l(A.selectedVariant.price.sellPrice-(h.offer.discountAmount||0),A.selectedVariant.price.currency||"",A.selectedVariant.price.currencySymbol||""):A.selectedVariant.formattedFinalPrice)),!j&&A.variants.length>1&&e.createElement("div",{className:c.Actions},A.variants.length>1&&e.createElement(i,{value:A.selectedVariant.id,onSelectChange:function(e){$(e,0)},options:A.variants.map((function(e){return{label:e.variantValues.map((function(e){return e.name})).join(", "),value:e.id}}))})),!!j&&e.createElement(a,{classes:[c.OfferButton,x?c.OfferAcceptButton:"",c.PopupOfferButton].join(" "),text:T("checkout-page:actions.acceptOffer"),onClick:function(){A.hasVariant?M&&M():Y()}}),!!B&&e.createElement("div",{className:[c.OfferActionsMain,x?c.OfferActionsMainBigImage:"",c.OfferActionsMainMiddlePhase].join(" ")},e.createElement(a,{classes:c.OfferButton,isLine:!0,text:T("checkout-page:actions.rejectOffer"),onClick:Z}),e.createElement(a,{classes:[c.OfferButton,x?c.OfferAcceptButton:""].join(" "),text:e.createElement("div",null,e.createElement("span",null,T("checkout-page:actions.acceptOffer")),e.createElement("span",null),e.createElement("span",null,A.selectedVariant.price.formattedFinalPrice)),onClick:Y})))),!(j||B)&&e.createElement("div",{ref:z,className:[c.OfferActionsMain,x?c.OfferActionsMainBigImage:""].join(" ")},e.createElement(a,{classes:c.OfferButton,isLine:!0,text:T("checkout-page:actions.rejectOffer"),onClick:Z}),e.createElement(a,{classes:[c.OfferButton,x?c.OfferAcceptButton:""].join(" "),text:T("checkout-page:actions.acceptOffer"),onClick:Y}))))}));export{f as default};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import{CheckoutStep as n}from"../../model.js";import{Button as a}from"../button/index.js";import i from"./select/index.js";import o from"../svg/cross.js";import{useTranslation as r}from"../../../../utils/i18n.js";import c from"./style.module.scss.js";import{IkasAmountType as s}from"@ikas/storefront-models";import"@ikas/storefront-config";import{formatCurrency as l}from"../../../../utils/currency.js";var u=function(t){var a,i,o=t.seconds,s=t.onFinish,l=t.campaignOffer,u=t.vm,f=t.isPopupClosed,m=t.step,p=r().t,v=e.useState(o),g=v[0],C=v[1];e.useEffect((function(){C(o)}),[o]),e.useEffect((function(){var e=setInterval((function(){g>0?C(g-1):(clearInterval(e),s())}),1e3);return function(){return clearInterval(e)}}),[g]);var S=l.offer.countdownMinutes&&(m!==n.SUCCESS?!!(null===(a=u.customizationProps)||void 0===a?void 0:a.campaignOfferCountdownStyleIsLine):!!(null===(i=u.customizationProps)||void 0===i?void 0:i.campaignOfferCountdownStyleIsLineSuccessPage))||f;return e.createElement("div",{className:S?c.CountdownContainerIsLine:c.CountdownContainer},e.createElement("div",{className:c.CountdownTextMain},!S&&e.createElement("span",{className:c.CountdownText},p("checkout-page:timeRemaining")),e.createElement("span",{className:c.CountdownTime},d(g))))},d=function(e){var t=Math.floor(e/60/60),n=Math.floor(e/60)-60*t,a=e%60;return 0!==t?t.toString().padStart(2,"0")+":":n.toString().padStart(2,"0")+":"+a.toString().padStart(2,"0")},f=t((function(t){var d,f,m,p,v,g,C,S=t.vm,h=t.campaignOffer,E=t.index,P=t.activeIndex,O=t.offersLength,V=t.handleNext,I=t.handlePrev,w=t.setActiveIndex,N=t.isPopupShow,y=t.closePopup,M=t.showPopup,j=t.isPopupClosed,B=t.desktopMiddlePhase,k=t.step,T=r().t,A=h.product,x=k!==n.SUCCESS?!!(null===(d=S.customizationProps)||void 0===d?void 0:d.campaignOfferIsSmallDesign)&&N:!!(null===(f=S.customizationProps)||void 0===f?void 0:f.showCampaignIsBiggerImage)&&k===n.SUCCESS,D=e.useRef(null),L=e.useRef(null),z=e.useRef(null),R=e.useState(0),b=R[0],U=R[1];e.useEffect((function(){var e,t,a,i,o,r,c,s;if(void 0!==typeof window){var l=.8*window.innerHeight,u=0,d=0,f=0;D.current&&(u=null===(t=null===(e=D.current)||void 0===e?void 0:e.getBoundingClientRect())||void 0===t?void 0:t.height),L.current&&(d=null===(i=null===(a=L.current)||void 0===a?void 0:a.getBoundingClientRect())||void 0===i?void 0:i.height),z.current&&(f=null===(r=null===(o=z.current)||void 0===o?void 0:o.getBoundingClientRect())||void 0===r?void 0:r.height);var m=(k===n.SUCCESS?null===(c=S.customizationProps)||void 0===c?void 0:c.campaignOfferCountdownStyleIsLineSuccessPage:null===(s=S.customizationProps)||void 0===s?void 0:s.campaignOfferCountdownStyleIsLine)?25:70,p=navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)?20:0;U(l-u-d-f-p-m)}}),[N]);var F=e.useState(null),H=F[0],X=F[1],q=e.useState(null),G=q[0],J=q[1],K=e.useMemo((function(){var e,t,n,a,i,o,r,c=null===(e=A.selectedVariant.images)||void 0===e?void 0:e.filter((function(e){return!e.isVideo}));return(null===(t=A.selectedVariant.mainImage)||void 0===t?void 0:t.isVideo)&&(null==c?void 0:c.length)?null===(n=c[0].image)||void 0===n?void 0:n.thumbnailSrc:x||B?null===(i=null===(a=A.selectedVariant.mainImage)||void 0===a?void 0:a.image)||void 0===i?void 0:i.getSrc(360):null===(r=null===(o=A.selectedVariant.mainImage)||void 0===o?void 0:o.image)||void 0===r?void 0:r.thumbnailSrc}),[A.selectedVariant,x,B]),Q=function(e){w(0),S.updateCartCampaignOffer({accepted:e,cartId:S.checkout.id,campaignOfferId:h.campaignOffer.campaignOfferId,campaignOfferProductId:h.offer.id,productId:h.offer.productId,variantId:A.selectedVariant.id})},W=function(){Q(!1)},Y=function(){Q(!0)},Z=e.useMemo((function(){if(!h.offer.countdownMinutes||!h.campaignOffer.offerStartDate)return 0;var e=Math.round(((new Date).getTime()-new Date(h.campaignOffer.offerStartDate).getTime())/1e3);return e>60*h.offer.countdownMinutes?(W(),0):60*h.offer.countdownMinutes-e}),[h]),$=function(e,t){var n=null;A.displayedVariantTypes.forEach((function(t){t.displayedVariantValues.forEach((function(t){t.variant.id===e&&(n=t.variantValue)}))}));var a=A.variants.find((function(t){return t.id===e})),i=!!a&&!!a.variantValues&&!!a.variantValues.length&&a.variantValues[t];i&&A.selectVariantValue(i,!0),A.displayedVariantTypes.forEach((function(t){t.displayedVariantValues.forEach((function(t){t.variant.id===e&&(n=t.variantValue)}))})),n?A.selectVariantValue(n,!0):$(e,t+1)},_=h.offer.countdownMinutes&&(k!==n.SUCCESS?!!(null===(m=S.customizationProps)||void 0===m?void 0:m.campaignOfferCountdownStyleIsLine):!!(null===(p=S.customizationProps)||void 0===p?void 0:p.campaignOfferCountdownStyleIsLineSuccessPage))||j&&h.offer.countdownMinutes;return e.createElement("div",{style:{transform:"translateX(-".concat(100*P,"%)")},className:[c.Container,E===P?c.ActiveOffer:"",N?c.PopupContainer:"",B?c.PopupContainerDesktop:"",k===n.SUCCESS?c.Border:""].join(" ")},h.offer.countdownMinutes&&(k!==n.SUCCESS?!(null===(v=S.customizationProps)||void 0===v?void 0:v.campaignOfferCountdownStyleIsLine):!(null===(g=S.customizationProps)||void 0===g?void 0:g.campaignOfferCountdownStyleIsLineSuccessPage))&&!j&&e.createElement(u,{seconds:Z,onFinish:W,vm:S,campaignOffer:h,step:k}),e.createElement("div",{onTouchStart:function(e){J(null),X(e.targetTouches[0].clientX)},onTouchMove:function(e){return J(e.targetTouches[0].clientX)},onTouchEnd:function(){if(H&&G&&O>1){var e=H-G,t=e>50;(t||e<-50)&&(t?V():I())}},className:[c.ContentContainer,O>1?c.ContentContainerItems:"",j?O>1?c.ContentContainerPopup:c.ContentContainerPopupItems:""].join(" ")},!!N&&e.createElement("div",{className:c.RejectButton,onClick:function(){return y&&y()}},e.createElement(o,null)),e.createElement("div",{ref:D,className:[c.HeaderMain,x&&!j?c.IsBigProductImage:"",_?c.IsLineCountDown:"",j?c.MobileSmallHeader:""].join(" ")},e.createElement("div",{className:c.Header},e.createElement("div",{className:c.Title},h.offer.title),!!h.offer.description&&!j&&e.createElement("div",{className:c.Description},h.offer.description)),_&&e.createElement(u,{seconds:Z,onFinish:W,vm:S,campaignOffer:h,isPopupClosed:j,step:k})),e.createElement("div",{className:[c.ProductContainer,x&&!j?c.IsLineProductContainer:""].join(" ")},e.createElement("div",{style:N?{width:b,height:b}:{},className:[c.ImageContainer,x&&!j?c.BigImage:"",j?c.SmallImage:"",B?c.BiggerImage:""].join(" ")},e.createElement("img",{className:c.Image,src:K})),e.createElement("div",{ref:L,className:c.ProductDetails},e.createElement("div",{className:c.ProductName},A.name),A.hasVariant&&1===A.variants.length&&e.createElement("div",{className:c.VariantName},A.selectedVariant.variantValues.map((function(e){return e.name})).join(", ")),!(null===(C=S.customizationProps)||void 0===C?void 0:C.showCampaignHideDiscountBadge)&&A.selectedVariant.hasDiscount&&e.createElement("span",{className:c.DiscountBadge},h.offer.discountType===s.RATIO?"%".concat(A.selectedVariant.discountPercentage):l(h.offer.discountAmount||0,A.selectedVariant.price.currency||"",A.selectedVariant.price.currencySymbol||"")," ",T("checkout-page:discount")),e.createElement("div",{className:c.ProductPriceMain},A.selectedVariant.hasDiscount&&e.createElement("span",{className:c.Discount},A.selectedVariant.formattedSellPrice," "),e.createElement("span",{className:c.ProductPrice},h.offer.discountType===s.AMOUNT?l(A.selectedVariant.price.sellPrice-(h.offer.discountAmount||0),A.selectedVariant.price.currency||"",A.selectedVariant.price.currencySymbol||""):A.selectedVariant.formattedFinalPrice)),!j&&A.variants.length>1&&e.createElement("div",{className:c.Actions},A.variants.length>1&&e.createElement(i,{value:A.selectedVariant.id,onSelectChange:function(e){$(e,0)},options:A.variants.map((function(e){return{label:e.variantValues.map((function(e){return e.name})).join(", "),value:e.id}}))})),!!j&&e.createElement(a,{classes:[c.OfferButton,x?c.OfferAcceptButton:"",c.PopupOfferButton].join(" "),text:T("checkout-page:actions.acceptOffer"),onClick:function(){A.hasVariant?M&&M():Y()}}),!!B&&e.createElement("div",{className:[c.OfferActionsMain,x?c.OfferActionsMainBigImage:"",c.OfferActionsMainMiddlePhase].join(" ")},e.createElement(a,{classes:c.OfferButton,isLine:!0,text:T("checkout-page:actions.rejectOffer"),onClick:W}),e.createElement(a,{classes:[c.OfferButton,x?c.OfferAcceptButton:""].join(" "),text:e.createElement("div",null,e.createElement("span",null,T("checkout-page:actions.acceptOffer")),e.createElement("span",null),e.createElement("span",null,A.selectedVariant.price.formattedFinalPrice)),onClick:Y})))),!(j||B)&&e.createElement("div",{ref:z,className:[c.OfferActionsMain,x?c.OfferActionsMainBigImage:""].join(" ")},e.createElement(a,{classes:c.OfferButton,isLine:!0,text:T("checkout-page:actions.rejectOffer"),onClick:W}),e.createElement(a,{classes:[c.OfferButton,x?c.OfferAcceptButton:""].join(" "),text:T("checkout-page:actions.acceptOffer"),onClick:Y}))))}));export{f as default};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as n}from"mobx-react-lite";import{ErrorType as m}from"../../model.js";import{useStripe as o,useElements as a,PaymentElement as s}from"@stripe/react-stripe-js";import i from"./style.module.scss.js";var l=n((function(n){var l=n.callbackUrl,c=n.vm,d=o(),u=a(),f=t.useState(!0),p=f[0],b=f[1];return t.createElement(t.Fragment,null,t.createElement("form",{className:i.Form,id:"stripe-form",onSubmit:function(t){return e(void 0,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return t.preventDefault(),d&&u&&l?(b(!0),[4,d.confirmPayment({elements:u,confirmParams:{return_url:l}})]):[2];case 1:return(e=r.sent().error)&&(c.handlePaymentError(m.PAYMENT_ERROR,e.message),c.isStepLoading=!1,b(!1)),[2]}}))}))}},t.createElement(s,{onReady:function(){return b(!1)}}),t.createElement("button",{id:"stripe-form-btn",hidden:!0,disabled:!d}),p&&t.createElement("div",{className:i.Disabled},t.createElement("div",{className:i.loader}))))}));export{l as CheckoutForm};
1
+ import{__awaiter as e,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import{ErrorType as n}from"../../model.js";import{useStripe as m,useElements as a,PaymentElement as s}from"@stripe/react-stripe-js";import i from"./style.module.scss.js";var l=o((function(o){var l=o.callbackUrl,c=o.vm,d=m(),u=a(),f=t.useState(!0),p=f[0],b=f[1];return t.createElement(t.Fragment,null,t.createElement("form",{className:i.Form,id:"stripe-form",onSubmit:function(t){return e(void 0,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return t.preventDefault(),d&&u&&l?(b(!0),[4,d.confirmPayment({elements:u,confirmParams:{return_url:l}})]):[2];case 1:return(e=r.sent().error)&&(console.log("stripe error",e),c.handlePaymentError(n.PAYMENT_ERROR,e.message),c.isStepLoading=!1,b(!1)),[2]}}))}))}},t.createElement(s,{onReady:function(){return b(!1)}}),t.createElement("button",{id:"stripe-form-btn",hidden:!0,disabled:!d}),p&&t.createElement("div",{className:i.Disabled},t.createElement("div",{className:i.loader}))))}));export{l as CheckoutForm};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as r}from"mobx-react-lite";import{useRouter as i}from"next/router.js";import n from"next/link.js";import a from"react-tooltip";import s,{CheckoutStep as l}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as f}from"./steps/step-payment/index.js";import{CouponErrorCode as g,Coupon as v,CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as E}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as y}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as x}from"./steps/step-success/index.js";import{Modal as k}from"./components/modal/index.js";import j from"./components/master-pass/modal-otp/index.js";import C from"./components/master-pass/modal-response/index.js";import N from"./components/master-pass/modal-success/index.js";import{Image as P}from"../image/index.js";import b,{Step as O}from"./components/step-container/index.js";import{StockError as S}from"./components/error/stock-error/index.js";import{FullscreenLoading as F}from"./components/fullscreen-loading/index.js";import M from"./components/notification-box/index.js";import{FormItem as T}from"./components/form-item/index.js";import{FormItemType as w}from"./components/form-item/model.js";import{Button as I}from"./components/button/index.js";import{IkasPageHead as A}from"../page/head.js";import B from"./components/offer-product/index.js";import L from"./components/offer-product/placeholder-offer-product.js";import D from"./components/svg/ikas.js";import V from"./style.module.scss.js";import{Analytics as U}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import R from"./components/svg/success-circle.js";import z from"./components/offer-product/offer-dots/index.js";import _ from"./components/offer-product/offer-arrows/index.js";import H from"./components/offer-product/useCampaignOffer.js";var G=r((function(e){var t,r,n,m,p,u,f,g=e.checkout,v=e.checkoutSettings,y=e.customizationProps,b=e.returnPolicy,O=e.privacyPolicy,M=e.termsOfService,T=e.imprint,w=e.shippingPolicy,G=d().t,X=i(),K=o.useState((function(){return new s(g,v,X,b,O,M,T,w,G,y||{})}))[0],Z=H(K),$=Z.setShowDetailPage,ee=Z.setActiveIndex,te=Z.setIsActiveOverlay,oe=Z.handlePrev,re=Z.handleNext,ie=Z.isPopupClosedIndexPage,ne=Z.isPopupShowIndexPage,ae=Z.isShowSuccessPageMiddlePhase,se=Z.activeIndex;o.useMemo((function(){return Date.now()}),[]);return K.step,l.PAYMENT,o.useEffect((function(){K.checkoutSettings.isAccountRequired&&!K.checkout.hasCustomer&&X.push("/account/login?redirect="+encodeURIComponent(K.checkoutUrl)),new URLSearchParams(window.location.search).get("step")!==l.SUCCESS&&U.beginCheckout(K.checkout),U.pageView(E.CHECKOUT)}),[]),o.useEffect((function(){K.customizationProps=y,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==e?void 0:e.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==e?void 0:e.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==e?void 0:e.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==e?void 0:e.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==e?void 0:e.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==e?void 0:e.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==e?void 0:e.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==e?void 0:e.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==e?void 0:e.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==e?void 0:e.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==e?void 0:e.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==e?void 0:e.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(y)}),[y]),K.isCheckoutLoaded&&K.store.customerStore.initialized?K.checkout.hasCustomer&&(null===(t=K.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(r=K.checkout.customer)||void 0===r?void 0:r.id)?(X.push("/account/login?redirect="+encodeURIComponent(K.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(A,{pageType:E.CHECKOUT,pageTitle:((null===(n=K.merchantSettings)||void 0===n?void 0:n.merchantName)||"")+" - "+G("checkout-page:securePayment"),pageDescription:G("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:V.CheckoutPage},ae?o.createElement("div",{className:V.FullPageOfferMain},o.createElement("div",{className:V.FullPageOfferContainer},o.createElement("div",{className:V.LogoMain},(null===(m=K.customizationProps)||void 0===m?void 0:m.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:K.customizationProps.logo,sizes:"360px"})):(null===(p=K.merchantSettings)||void 0===p?void 0:p.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:K.merchantSettings.logo,sizes:"360px"})):(null===(u=K.merchantSettings)||void 0===u?void 0:u.merchantName)||""),o.createElement("div",{className:V.OfferSuccessInfo},o.createElement("div",null,o.createElement("div",{className:V.OfferSuccessHeader},o.createElement(R,{className:V.SuccessCircle}),o.createElement("span",{className:V.SuccessTitle},G("checkout-page:orderSuccessShortTitle"))),o.createElement("div",{className:V.OfferOrderInfoMain},o.createElement("div",{className:V.InfoTitle},G("checkout-page:orderNoAndDate"),":"),o.createElement("div",{className:V.InfoText},"#"+(K.checkout.orderNumber||"")," ",K.checkout.dateStr))),o.createElement("div",null,o.createElement(I,{classes:V.OfferButton,isLine:!0,text:G("checkout-page:actions.goOrderDetailPage"),onClick:function(){$(!1)}}))),o.createElement("div",null,K.campaignOffers&&!!K.campaignOffers.length&&K.isCampaignOfferLoaded&&o.createElement("div",{className:V.CampaignOfferMain},o.createElement("div",{className:V.OfferSlider},K.campaignOffers.map((function(e,t){var r;return o.createElement(B,{vm:K,campaignOffer:e,index:t,activeIndex:se,offersLength:(null===(r=K.campaignOffers)||void 0===r?void 0:r.length)||0,handlePrev:oe,handleNext:re,setActiveIndex:function(e){return ee(e)},desktopMiddlePhase:!0,step:K.step})}))),K.campaignOffers.length>1&&o.createElement(_,{handlePrev:oe,handleNext:re}),K.campaignOffers.length>1&&o.createElement(z,{vm:K,activeIndex:se}))))):null,o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:V.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[V.Left].join(" ")},o.createElement("div",{className:V.LeftContent},o.createElement("div",null,o.createElement(Y,{vm:K}),K.hasStockError&&o.createElement("div",{className:V.ErrorContainer},o.createElement(S,{vm:K,error:K.error})),!K.hasStockError&&o.createElement(o.Fragment,null,K.step!==l.SUCCESS&&o.createElement(h,{vm:K,allowExpand:!0}),K.step===l.SUCCESS?o.createElement(x,{vm:K}):o.createElement(o.Fragment,null,!!(null===(f=K.customizationProps)||void 0===f?void 0:f.showCampaignOffersDesign)&&c.getIsEditor()&&o.createElement(L,{vm:K}),ne&&o.createElement("div",{className:[V.MiddlePhaseOverlay,ne?V.MiddlePhaseOverlayPopup:""].join(" ")}),K.campaignOffers&&!!K.campaignOffers.length&&K.isCampaignOfferLoaded&&o.createElement("div",{className:[V.CampaignOfferMain,ne?V.OverlayPopupMain:""].join(" ")},o.createElement("div",{className:V.OfferSlider},K.campaignOffers.map((function(e,t){var r;return o.createElement(B,{vm:K,campaignOffer:e,index:t,activeIndex:se,offersLength:(null===(r=K.campaignOffers)||void 0===r?void 0:r.length)||0,handlePrev:oe,handleNext:re,setActiveIndex:function(e){return ee(e)},step:K.step,isPopupClosed:ie,isPopupShow:ne,closePopup:function(){return te(!1)},showPopup:function(){return te(!0)}})}))),K.campaignOffers.length>1&&o.createElement(_,{handlePrev:oe,handleNext:re}),K.campaignOffers.length>1&&o.createElement(z,{isPopupShow:ne,vm:K,activeIndex:se})),K.isCouponCodeRequirementOpen&&o.createElement(W,{vm:K}),o.createElement(q,{vm:K}))),o.createElement("div",{className:V.Space})),o.createElement(J,{vm:K}))),o.createElement("div",{className:V.Right},o.createElement("div",{className:V.RightContent},o.createElement(h,{vm:K}),!K.isPoweredByHidden&&o.createElement("div",{className:V.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(D,null))))),!!K.policyModalText&&o.createElement(k,{title:K.policyModalTitle,modalContent:K.policyModalText,onClose:function(){K.policyModalText=""}}),K.isContactModalVisible&&o.createElement(Q,{vm:K,setVisible:K.setContactModalVisible}),K.mpVM.isOtpModalVisible&&o.createElement(j,{vm:K,visible:K.mpVM.isOtpModalVisible,type:K.mpVM.otpModalType,onClose:K.mpVM.hideOtpModal}),K.mpVM.isResponseModalVisible&&o.createElement(C,{visible:K.mpVM.isResponseModalVisible,text:K.mpVM.mfsResponseModalText,onClose:K.mpVM.onResponseModalClose}),K.mpVM.isSuccessModalVisible&&o.createElement(N,{visible:K.mpVM.isSuccessModalVisible,type:K.mpVM.successModalType,onClose:K.mpVM.onSuccessModalClose}))):o.createElement(F,null)})),Y=r((function(e){var t,r,i,a,s=e.vm,l=d().t;return o.createElement("div",{className:V.Header},o.createElement(n,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=s.customizationProps)||void 0===t?void 0:t.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:s.customizationProps.logo,sizes:"360px"})):(null===(r=s.merchantSettings)||void 0===r?void 0:r.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:s.merchantSettings.logo,sizes:"360px"})):(null===(i=s.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!s.checkout.hasCustomer&&o.createElement("div",{className:V.LoginText},o.createElement("span",{className:V.LoginCta},l("checkout-page:alreadyHaveAnAccount")),o.createElement(n,{href:"/account/login?redirect="+encodeURIComponent(s.checkoutUrl),passHref:!0},o.createElement("a",{className:V.LoginBtn},l("checkout-page:actions.login")))),s.checkout.hasCustomer&&o.createElement("div",{className:V.CustomerInfo},o.createElement("div",{className:V.Name},s.checkout.customerFullName),o.createElement("div",{className:V.Email},null===(a=s.checkout.customer)||void 0===a?void 0:a.email)))})),W=r((function(e){var t=e.vm,r=d().t,i=o.useState(!1),n=i[0],a=i[1],s=o.useState(null),l=s[0],c=s[1],m=o.useMemo((function(){switch(l){case g.COUPON_CODE_NOT_EXIST:return r("checkout-page:giftCodeErrorDescription");case g.COUPON_CODE_NOT_EXIST_FOR_GUESS:return r("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[l]);return o.createElement("div",{className:V.CouponContainer},n&&o.createElement("div",{className:V.NotificationContainer},o.createElement(M,{type:"warning",title:r("checkout-page:giftCodeErrorTitle"),content:m,onClose:function(){a(!1),c(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:n?12:0}},o.createElement(v,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:a,setCouponErrorCode:c})))})),q=r((function(e){var t=e.vm,r=d().t,i=o.useMemo((function(){switch(t.step){case l.INFO:return o.createElement(p,{vm:t});case l.SHIPPING:return o.createElement(u,{vm:t});case l.PAYMENT:return o.createElement(f,{vm:t});case l.SUCCESS:return o.createElement(x,{vm:t})}}),[t,t.step]),n=[new O(r("checkout-page:address"),t.step===l.INFO,t.step!==l.INFO,t.step!==l.INFO?o.createElement("div",{className:V.AdressStepInfo},o.createElement(X,{vm:t}),!t.isUpsellOrder&&o.createElement("div",{className:V.EditBtn,onClick:t.onBackToInfoClick},r("checkout-page:actions.edit"))):void 0,t.step!==l.INFO?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(X,{vm:t})):void 0),new O(r("checkout-page:payment"),t.step===l.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||n.splice(1,0,new O(r("checkout-page:shipping"),t.step===l.SHIPPING,t.step===l.PAYMENT,t.step===l.PAYMENT?o.createElement("div",{className:V.AdressStepInfo},o.createElement(K,{vm:t}),!t.isUpsellOrder&&!t.isManualOrderWithShippingLines&&(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:V.EditBtn,onClick:t.onBackToShippingClick},r("checkout-page:actions.edit"))):void 0,t.step===l.PAYMENT?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(K,{vm:t})):void 0)),o.createElement(b,{steps:n,stepContent:i})})),X=r((function(e){var t,r,i,n,a,s,l,c,m,p=e.vm,u=d().t,f=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(r=p.checkout.billingAddress)||void 0===r?void 0:r.lastName)||""):((null===(i=p.checkout.shippingAddress)||void 0===i?void 0:i.firstName)||"")+" "+((null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.lastName)||"");return o.createElement("div",{className:V.Address},o.createElement("div",{className:[V.Text,V.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:V.Text},f):o.createElement(o.Fragment,null,o.createElement("div",{className:V.Text},u("checkout-page:receiver")),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},f)),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},p.isDigitalOnly?null===(s=p.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(l=p.checkout.shippingAddress)||void 0===l?void 0:l.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[V.Text,V.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},p.isDigitalOnly?null===(c=p.checkout.billingAddress)||void 0===c?void 0:c.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),K=r((function(e){var t=e.vm,r=d().t;return o.createElement("div",{className:V.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:V.LightText}," / "+(0===t.checkout.shippingLines[0].finalPrice?r("checkout-page:free"):m(t.checkout.shippingLines[0].finalPrice,t.checkout.currencyCode,t.checkout.currencySymbol)))):r("checkout-page:standartShipping"))})),J=r((function(e){var t=e.vm,r=d().t;return o.createElement("div",{className:V.Footer},o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},r("checkout-page:returnPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},r("checkout-page:privacyPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},r("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:imprint"),t.policyModalText=t.imprint}},r("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},r("checkout-page:shippingPolicy"))))})),Q=r((function(r){var i,n,a,s=r.vm,l=r.setVisible,c=d().t,m=o.useState(!1),p=m[0],u=m[1],f=o.useState(!1),g=f[0],v=f[1],h=o.useState(new y({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];h.email=(null===(i=s.checkout.customer)||void 0===i?void 0:i.email)||"",h.firstName=(null===(n=s.checkout.customer)||void 0===n?void 0:n.firstName)||"",h.lastName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.lastName)||"";var E=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return g?[2,l(!1)]:(u(!0),[4,h.saveContactForm()]);case 1:return e.sent()&&v(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(k,{title:c("checkout-page:contactForm"),modalContent:o.createElement("div",null,g&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(M,{type:"success",title:c("checkout-page:contactFormSent"),content:c("checkout-page:contactFormDescription")})),o.createElement(T,{type:w.TEXT_AREA,label:"",value:h.message||"",onChange:h.onMessageChange,textAreaPlaceholder:c("checkout-page:contactFormCta")}),o.createElement(I,{style:{width:"100%",marginTop:"24px"},text:c(g?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!h.message,onClick:E})),onClose:function(){return l(!1)}})}));export{G as default};
1
+ import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as r}from"mobx-react-lite";import{useRouter as i}from"next/router.js";import n from"next/link.js";import a from"react-tooltip";import s,{CheckoutStep as l}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as f}from"./steps/step-payment/index.js";import{CouponErrorCode as v,Coupon as g,CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as E}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as y}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as x}from"./steps/step-success/index.js";import{Modal as k}from"./components/modal/index.js";import j from"./components/master-pass/modal-otp/index.js";import C from"./components/master-pass/modal-response/index.js";import N from"./components/master-pass/modal-success/index.js";import{Image as P}from"../image/index.js";import O,{Step as b}from"./components/step-container/index.js";import{StockError as S}from"./components/error/stock-error/index.js";import{FullscreenLoading as M}from"./components/fullscreen-loading/index.js";import F from"./components/notification-box/index.js";import{FormItem as T}from"./components/form-item/index.js";import{FormItemType as w}from"./components/form-item/model.js";import{Button as I}from"./components/button/index.js";import{IkasPageHead as A}from"../page/head.js";import B from"./components/offer-product/index.js";import L from"./components/offer-product/placeholder-offer-product.js";import D from"./components/svg/ikas.js";import V from"./style.module.scss.js";import{Analytics as R}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import U from"./components/svg/success-circle.js";import z from"./components/offer-product/offer-dots/index.js";import _ from"./components/offer-product/offer-arrows/index.js";import H from"./components/offer-product/useCampaignOffer.js";import G from"../../hooks/useDimension.js";var Y=r((function(e){var t,r,n,m,p,u,f,v=e.checkout,g=e.checkoutSettings,y=e.customizationProps,O=e.returnPolicy,b=e.privacyPolicy,F=e.termsOfService,T=e.imprint,w=e.shippingPolicy,B=d().t,z=i(),_=o.useState(Date.now()),G=_[0],Y=_[1],K=o.useState((function(){return new s(v,g,z,O,b,F,T,w,B,y||{})}))[0];o.useEffect((function(){Y(Date.now())}),[v.campaignOffers,K.campaignOffers,K.isCampaignOfferLoaded]);var J=H(K),te=J.setShowDetailPage,oe=J.isPopupShowIndexPage,re=J.isShowSuccessPageMiddlePhase;o.useMemo((function(){return Date.now()}),[]);return K.step,l.PAYMENT,o.useEffect((function(){var e;K.checkoutSettings.isAccountRequired&&!K.checkout.hasCustomer&&z.push("/account/login?redirect="+encodeURIComponent(K.checkoutUrl)),new URLSearchParams(window.location.search).get("step")!==l.SUCCESS&&(K.checkoutSettings.isAccountRequired&&(null===(e=K.checkout.customer)||void 0===e?void 0:e.isGuestCheckout)||R.beginCheckout(K.checkout)),R.pageView(E.CHECKOUT)}),[]),o.useEffect((function(){K.customizationProps=y,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==e?void 0:e.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==e?void 0:e.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==e?void 0:e.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==e?void 0:e.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==e?void 0:e.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==e?void 0:e.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==e?void 0:e.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==e?void 0:e.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==e?void 0:e.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==e?void 0:e.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==e?void 0:e.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==e?void 0:e.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(y)}),[y]),K.isCheckoutLoaded&&K.store.customerStore.initialized?K.checkout.hasCustomer&&(null===(t=K.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(r=K.checkout.customer)||void 0===r?void 0:r.id)?(z.push("/account/login?redirect="+encodeURIComponent(K.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(A,{pageType:E.CHECKOUT,pageTitle:((null===(n=K.merchantSettings)||void 0===n?void 0:n.merchantName)||"")+" - "+B("checkout-page:securePayment"),pageDescription:B("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:V.CheckoutPage},re?o.createElement("div",{className:V.FullPageOfferMain},o.createElement("div",{className:V.FullPageOfferContainer},o.createElement("div",{className:V.LogoMain},(null===(m=K.customizationProps)||void 0===m?void 0:m.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:K.customizationProps.logo,sizes:"360px"})):(null===(p=K.merchantSettings)||void 0===p?void 0:p.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:K.merchantSettings.logo,sizes:"360px"})):(null===(u=K.merchantSettings)||void 0===u?void 0:u.merchantName)||""),o.createElement("div",{className:V.OfferSuccessInfo},o.createElement("div",null,o.createElement("div",{className:V.OfferSuccessHeader},o.createElement(U,{className:V.SuccessCircle}),o.createElement("span",{className:V.SuccessTitle},B("checkout-page:orderSuccessShortTitle"))),o.createElement("div",{className:V.OfferOrderInfoMain},o.createElement("div",{className:V.InfoTitle},B("checkout-page:orderNoAndDate"),":"),o.createElement("div",{className:V.InfoText},"#"+(K.checkout.orderNumber||"")," ",K.checkout.dateStr))),o.createElement("div",null,o.createElement(I,{classes:V.OfferButton,isLine:!0,text:B("checkout-page:actions.goOrderDetailPage"),onClick:function(){te(!1)}}))),o.createElement("div",null,o.createElement($,{vm:K,key:G})))):null,o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:V.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[V.Left].join(" ")},o.createElement("div",{className:V.LeftContent},o.createElement("div",null,o.createElement(W,{vm:K}),K.hasStockError&&o.createElement("div",{className:V.ErrorContainer},o.createElement(S,{vm:K,error:K.error})),!K.hasStockError&&o.createElement(o.Fragment,null,K.step!==l.SUCCESS&&o.createElement(h,{vm:K,allowExpand:!0}),K.step===l.SUCCESS?o.createElement(x,{vm:K}):o.createElement(o.Fragment,null,!!(null===(f=K.customizationProps)||void 0===f?void 0:f.showCampaignOffersDesign)&&c.getIsEditor()&&o.createElement(L,{vm:K}),oe&&o.createElement("div",{className:[V.MiddlePhaseOverlay,oe?V.MiddlePhaseOverlayPopup:""].join(" ")}),K.campaignOffers&&!!K.campaignOffers.length&&K.isCampaignOfferLoaded&&o.createElement(ee,{key:G,vm:K}),K.isCouponCodeRequirementOpen&&o.createElement(q,{vm:K}),o.createElement(X,{vm:K}))),o.createElement("div",{className:V.Space})),o.createElement(Q,{vm:K}))),o.createElement("div",{className:V.Right},o.createElement("div",{className:V.RightContent},o.createElement(h,{vm:K}),!K.isPoweredByHidden&&o.createElement("div",{className:V.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(D,null))))),!!K.policyModalText&&o.createElement(k,{title:K.policyModalTitle,modalContent:K.policyModalText,onClose:function(){K.policyModalText=""},isPolicyModal:!0}),K.isContactModalVisible&&o.createElement(Z,{vm:K,setVisible:K.setContactModalVisible}),K.mpVM.isOtpModalVisible&&o.createElement(j,{vm:K,visible:K.mpVM.isOtpModalVisible,type:K.mpVM.otpModalType,onClose:K.mpVM.hideOtpModal}),K.mpVM.isResponseModalVisible&&o.createElement(C,{visible:K.mpVM.isResponseModalVisible,text:K.mpVM.mfsResponseModalText,onClose:K.mpVM.onResponseModalClose}),K.mpVM.isSuccessModalVisible&&o.createElement(N,{visible:K.mpVM.isSuccessModalVisible,type:K.mpVM.successModalType,onClose:K.mpVM.onSuccessModalClose}))):o.createElement(M,null)})),W=r((function(e){var t,r,i,a,s=e.vm,l=d().t;return o.createElement("div",{className:V.Header},o.createElement(n,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=s.customizationProps)||void 0===t?void 0:t.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:s.customizationProps.logo,sizes:"360px"})):(null===(r=s.merchantSettings)||void 0===r?void 0:r.logo)?o.createElement("div",{className:V.Logo},o.createElement(P,{layout:"fill",image:s.merchantSettings.logo,sizes:"360px"})):(null===(i=s.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!s.checkout.hasCustomer&&o.createElement("div",{className:V.LoginText},o.createElement("span",{className:V.LoginCta},l("checkout-page:alreadyHaveAnAccount")),o.createElement(n,{href:"/account/login?redirect="+encodeURIComponent(s.checkoutUrl),passHref:!0},o.createElement("a",{className:V.LoginBtn},l("checkout-page:actions.login")))),s.checkout.hasCustomer&&o.createElement("div",{className:V.CustomerInfo},o.createElement("div",{className:V.Name},s.checkout.customerFullName),o.createElement("div",{className:V.Email},null===(a=s.checkout.customer)||void 0===a?void 0:a.email)))})),q=r((function(e){var t=e.vm,r=d().t,i=o.useState(!1),n=i[0],a=i[1],s=o.useState(null),l=s[0],c=s[1],m=G().isMobile,p=o.useMemo((function(){switch(l){case v.COUPON_CODE_NOT_EXIST:return r("checkout-page:giftCodeErrorDescription");case v.COUPON_CODE_NOT_EXIST_FOR_GUESS:return r("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[l]);return o.createElement("div",{className:V.CouponContainer},n&&o.createElement("div",{className:V.NotificationContainer},o.createElement(F,{type:"warning",title:r("checkout-page:giftCodeErrorTitle"),content:p,onClose:function(){a(!1),c(null)},ignoreScroll:!0})),o.createElement("div",{style:{marginTop:n?12:0}},o.createElement(g,{vm:t,isOpenCouponCode:!0,isAddingCoupon:!0,setAddingCoupon:function(){},setCouponError:a,setCouponErrorCode:c,showOnlyMobile:!0,isMobile:m})))})),X=r((function(e){var t=e.vm,r=d().t,i=o.useMemo((function(){switch(t.step){case l.INFO:return o.createElement(p,{vm:t});case l.SHIPPING:return o.createElement(u,{vm:t});case l.PAYMENT:return o.createElement(f,{vm:t});case l.SUCCESS:return o.createElement(x,{vm:t})}}),[t,t.step]),n=[new b(r("checkout-page:address"),t.step===l.INFO,t.step!==l.INFO,t.step!==l.INFO?o.createElement("div",{className:V.AdressStepInfo},o.createElement(K,{vm:t}),!t.isUpsellOrder&&o.createElement("div",{className:V.EditBtn,onClick:t.onBackToInfoClick},r("checkout-page:actions.edit"))):void 0,t.step!==l.INFO?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(K,{vm:t})):void 0),new b(r("checkout-page:payment"),t.step===l.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||n.splice(1,0,new b(r("checkout-page:shipping"),t.step===l.SHIPPING,t.step===l.PAYMENT,t.step===l.PAYMENT?o.createElement("div",{className:V.AdressStepInfo},o.createElement(J,{vm:t}),!t.isUpsellOrder&&!t.isManualOrderWithShippingLines&&(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:V.EditBtn,onClick:t.onBackToShippingClick},r("checkout-page:actions.edit"))):void 0,t.step===l.PAYMENT?o.createElement("div",{className:V.AddressStepInfoMobile},o.createElement(J,{vm:t})):void 0)),o.createElement(O,{steps:n,stepContent:i})})),K=r((function(e){var t,r,i,n,a,s,l,c,m,p=e.vm,u=d().t,f=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(r=p.checkout.billingAddress)||void 0===r?void 0:r.lastName)||""):((null===(i=p.checkout.shippingAddress)||void 0===i?void 0:i.firstName)||"")+" "+((null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.lastName)||"");return o.createElement("div",{className:V.Address},o.createElement("div",{className:[V.Text,V.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:V.Text},f):o.createElement(o.Fragment,null,o.createElement("div",{className:V.Text},u("checkout-page:receiver")),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},f)),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},p.isDigitalOnly?null===(s=p.checkout.billingAddress)||void 0===s?void 0:s.phone:null===(l=p.checkout.shippingAddress)||void 0===l?void 0:l.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[V.Text,V.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[V.Text,V.Gray].join(" ")},p.isDigitalOnly?null===(c=p.checkout.billingAddress)||void 0===c?void 0:c.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),J=r((function(e){var t=e.vm,r=d().t;return o.createElement("div",{className:V.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:V.LightText}," / "+(0===t.checkout.shippingLines[0].finalPrice?r("checkout-page:free"):m(t.checkout.shippingLines[0].finalPrice,t.checkout.currencyCode,t.checkout.currencySymbol)))):r("checkout-page:standartShipping"))})),Q=r((function(e){var t=e.vm,r=d().t;return o.createElement("div",{className:V.Footer},o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},r("checkout-page:returnPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},r("checkout-page:privacyPolicy")),o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},r("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:imprint"),t.policyModalText=t.imprint}},r("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:V.FooterBullet},"•"),o.createElement("div",{className:V.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},r("checkout-page:shippingPolicy"))))})),Z=r((function(r){var i,n,a,s=r.vm,l=r.setVisible,c=d().t,m=o.useState(!1),p=m[0],u=m[1],f=o.useState(!1),v=f[0],g=f[1],h=o.useState(new y({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];h.email=(null===(i=s.checkout.customer)||void 0===i?void 0:i.email)||"",h.firstName=(null===(n=s.checkout.customer)||void 0===n?void 0:n.firstName)||"",h.lastName=(null===(a=s.checkout.customer)||void 0===a?void 0:a.lastName)||"";var E=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return v?[2,l(!1)]:(u(!0),[4,h.saveContactForm()]);case 1:return e.sent()&&g(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(k,{title:c("checkout-page:contactForm"),modalContent:o.createElement("div",null,v&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(F,{type:"success",title:c("checkout-page:contactFormSent"),content:c("checkout-page:contactFormDescription")})),o.createElement(T,{type:w.TEXT_AREA,label:"",value:h.message||"",onChange:h.onMessageChange,textAreaPlaceholder:c("checkout-page:contactFormCta")}),o.createElement(I,{style:{width:"100%",marginTop:"24px"},text:c(v?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!h.message,onClick:E})),onClose:function(){return l(!1)}})})),$=r((function(e){var t=e.vm,r=H(t),i=r.setActiveIndex,n=r.handlePrev,a=r.handleNext,s=r.activeIndex;return t.campaignOffers&&t.campaignOffers.length&&t.isCampaignOfferLoaded?o.createElement("div",{className:V.CampaignOfferMain},o.createElement("div",{className:V.OfferSlider},t.campaignOffers.map((function(e,r){var l;return o.createElement(B,{vm:t,campaignOffer:e,index:r,activeIndex:s,offersLength:(null===(l=t.campaignOffers)||void 0===l?void 0:l.length)||0,handlePrev:n,handleNext:a,setActiveIndex:function(e){return i(e)},desktopMiddlePhase:!0,step:t.step})}))),t.campaignOffers.length>1&&o.createElement(_,{handlePrev:n,handleNext:a}),t.campaignOffers.length>1&&o.createElement(z,{vm:t,activeIndex:s})):null})),ee=r((function(e){var t=e.vm,r=H(t),i=r.setActiveIndex,n=r.setIsActiveOverlay,a=r.handlePrev,s=r.handleNext,l=r.isPopupClosedIndexPage,c=r.isPopupShowIndexPage,m=r.activeIndex;return t.campaignOffers&&t.campaignOffers.length&&t.isCampaignOfferLoaded?o.createElement("div",{className:[V.CampaignOfferMain,c?V.OverlayPopupMain:""].join(" ")},o.createElement("div",{className:V.OfferSlider},t.campaignOffers.map((function(e,r){var d;return o.createElement(B,{vm:t,campaignOffer:e,index:r,activeIndex:m,offersLength:(null===(d=t.campaignOffers)||void 0===d?void 0:d.length)||0,handlePrev:a,handleNext:s,setActiveIndex:function(e){return i(e)},step:t.step,isPopupClosed:l,isPopupShow:c,closePopup:function(){return n(!1)},showPopup:function(){return n(!0)}})}))),t.campaignOffers.length>1&&o.createElement(_,{handlePrev:a,handleNext:s}),t.campaignOffers.length>1&&o.createElement(z,{isPopupShow:c,vm:t,activeIndex:m})):null}));export{Y as default};