@ikas/storefront 2.0.56 → 2.0.57

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.
@@ -1 +1 @@
1
- import e from'../ext/strict-uri-encode/index.js';export{default}from"../node_modules/strict-uri-encode/index.js";
1
+ import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
@@ -1 +1 @@
1
- import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
1
+ import e from'../ext/strict-uri-encode/index.js';export{default}from"../node_modules/strict-uri-encode/index.js";
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/blog/index.js";import"../../../../../models/data/brand/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/customer-review/index.js";import"mobx";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/installment-info/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../api/product-option-file/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product-attribute/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product-filter/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import"../../../../../models/data/order-transaction/index.js";import{IkasProductOptionType as i}from"../../../../../models/data/product-option-set/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/product-campaing/campaign/index.js";import"../../../../../models/data/customer-attribute/index.js";import"../../../../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../../../../models/theme/theme.js";import"../../../../../models/theme/page/index.js";import"../../../../../models/theme/component/prop/index.js";import"../../../../../models/theme/page/component/prop-value/link.js";import"../../../../../models/ui/brand-list/index.js";import"../../../../../models/ui/blog-list/index.js";import"../../../../../models/ui/blog-category-list/index.js";import"../../../../../models/ui/category-list/index.js";import"../../../../../models/ui/product-detail/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/register.js";import"../../../../../models/ui/validator/form/contact-form.js";import"../../../../../models/ui/validator/form/forgot-password.js";import"../../../../../models/ui/validator/form/recover-password.js";import"../../../../../models/ui/validator/form/account-info.js";import"../../../../../models/ui/validator/form/raffle-form.js";import"../../../../../models/ui/validator/form/customer-review.js";import"../../../../../models/ui/raffle-list/index.js";import"../../../../../models/theme/settings/index.js";import"../../../../../models/theme/custom-data/index.js";import{formatDate as a}from"../../../../../utils/helper.js";import{formatMoney as o}from"../../../../../utils/currency.js";import{useTranslation as r}from"../../../../../utils/i18n.js";import{Modal as m}from"../../modal/index.js";import s from"./style.module.scss.js";var n=t((function(t){var n,d,l,c=t.vm,u=t.currencyCode,p=t.cartItem,v=r().t,j=e.useState(!1),x=j[0],f=j[1],E=null===(n=c.checkout.adjustments)||void 0===n?void 0:n.map((function(e){var t;return(null===(t=e.appliedOrderLines)||void 0===t?void 0:t.filter((function(e){return e.orderLineId===p.id})).reduce((function(e,t){return e+(t.amount||0)}),0))||0})),N=null==E?void 0:E.reduce((function(e,t){return e+t}),0),g=e.useMemo((function(){var t;return e.createElement("div",null,null===(t=p.options)||void 0===t?void 0:t.map((function(t){switch(t.type){case i.TEXT:case i.TEXT_AREA:case i.CHOICE:return e.createElement("div",{className:s.OptionRow},e.createElement("div",{className:s.OptionName},t.name),e.createElement("div",{className:s.OptionValue},t.values.map((function(e){return e.name||e.value})).join(", ")));case i.DATE_PICKER:return e.createElement("div",{className:s.OptionRow},e.createElement("div",{className:s.OptionName},t.name),e.createElement("div",{className:s.OptionValue},t.values.map((function(e){return t=e.value,(i=a(new Date(t)).split(" ")).splice(-1),i.join(" ");var t,i})).join(", ")));case i.FILE:return e.createElement("div",{className:s.OptionRow},e.createElement("div",{className:s.OptionName},t.name),e.createElement("div",{className:s.OptionValue},t.values.map((function(e){return t=e.value,decodeURIComponent(t.split("/")[t.split("/").length-1]);var t})).join(", ")));case i.CHECKBOX:return e.createElement("div",{className:s.OptionRow},e.createElement("div",{className:s.OptionName},t.name),e.createElement("div",{className:s.OptionValue},t.values.length&&"true"===t.values[0].value?v("checkout-page:yes"):v("checkout-page:no")));case i.COLOR_PICKER:return e.createElement("div",{className:s.OptionRow},e.createElement("div",{className:s.OptionName},t.name),e.createElement("div",{className:s.OptionsHorContainer},t.values.map((function(t,i){return e.createElement("div",{key:i,className:s.OptionColorValue,style:{backgroundColor:t.value}})}))))}})))}),[]);return e.createElement("div",{className:s.CheckoutItem},e.createElement("div",{className:s.ImageContainer},e.createElement("img",{className:s.Image,src:null===(d=p.variant.mainImage)||void 0===d?void 0:d.thumbnailSrc})),e.createElement("div",{className:s.Right},e.createElement("div",{className:s.Name},p.variant.name),e.createElement("div",{className:s.LightText},"".concat(v("checkout-page:quantity"),": ")+p.quantity),e.createElement("div",{className:s.LightText},p.variant.variantValues.map((function(e){return e.variantValueName})).join(" / ")),!!(null===(l=p.options)||void 0===l?void 0:l.length)&&e.createElement("div",{className:s.OptionsText,onClick:function(){return f(!0)}},v("checkout-page:customizedProduct")),!!x&&e.createElement(m,{title:p.variant.name,modalContent:g,onClose:function(){return f(!1)}}),e.createElement("div",{className:s.Price},!!p.overridenPriceWithQuantity&&e.createElement("span",{className:s.GrayPrice},o(N?p.finalPriceWithQuantity:p.overridenPriceWithQuantity,u)),o(N?p.finalPriceWithQuantity-N:p.finalPriceWithQuantity,u))))}));export{n as CartItem};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/blog/index.js";import"../../../../../models/data/brand/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/customer-review/index.js";import"mobx";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/installment-info/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../api/product-option-file/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product-attribute/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product-filter/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import"../../../../../models/data/order-transaction/index.js";import{IkasProductOptionType as i}from"../../../../../models/data/product-option-set/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/product-campaing/campaign/index.js";import"../../../../../models/data/customer-attribute/index.js";import"../../../../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../../../../models/theme/theme.js";import"../../../../../models/theme/page/index.js";import"../../../../../models/theme/component/prop/index.js";import"../../../../../models/theme/page/component/prop-value/link.js";import"../../../../../models/ui/brand-list/index.js";import"../../../../../models/ui/blog-list/index.js";import"../../../../../models/ui/blog-category-list/index.js";import"../../../../../models/ui/category-list/index.js";import"../../../../../models/ui/product-detail/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/register.js";import"../../../../../models/ui/validator/form/contact-form.js";import"../../../../../models/ui/validator/form/forgot-password.js";import"../../../../../models/ui/validator/form/recover-password.js";import"../../../../../models/ui/validator/form/account-info.js";import"../../../../../models/ui/validator/form/raffle-form.js";import"../../../../../models/ui/validator/form/customer-review.js";import"../../../../../models/ui/raffle-list/index.js";import"../../../../../models/theme/settings/index.js";import"../../../../../models/theme/custom-data/index.js";import{formatDate as a}from"../../../../../utils/helper.js";import{formatMoney as o}from"../../../../../utils/currency.js";import{useTranslation as r}from"../../../../../utils/i18n.js";import{Modal as m}from"../../modal/index.js";import s from"./style.module.scss.js";var n=t((function(t){var n,d,l,c=t.vm,u=t.currencyCode,p=t.cartItem,v=r().t,j=e.useState(!1),x=j[0],f=j[1],E=null===(n=c.checkout.adjustments)||void 0===n?void 0:n.map((function(e){var t;return(null===(t=e.appliedOrderLines)||void 0===t?void 0:t.filter((function(e){return e.orderLineId===p.id})).reduce((function(e,t){return e+(t.amount||0)}),0))||0})),N=null==E?void 0:E.reduce((function(e,t){return e+t}),0),g=e.useMemo((function(){var t;return e.createElement("div",null,null===(t=p.options)||void 0===t?void 0:t.map((function(t){switch(t.type){case i.TEXT:case i.TEXT_AREA:case i.CHOICE:return e.createElement("div",{className:s.OptionRow},e.createElement("div",{className:s.OptionName},t.name),e.createElement("div",{className:s.OptionValue},t.values.map((function(e){return e.name||e.value})).join(", ")));case i.DATE_PICKER:return e.createElement("div",{className:s.OptionRow},e.createElement("div",{className:s.OptionName},t.name),e.createElement("div",{className:s.OptionValue},t.values.map((function(e){return t=e.value,(i=a(new Date(t)).split(" ")).splice(-1),i.join(" ");var t,i})).join(", ")));case i.FILE:return e.createElement("div",{className:s.OptionRow},e.createElement("div",{className:s.OptionName},t.name),e.createElement("div",{className:s.OptionValue},t.values.map((function(e){return t=e.value,decodeURIComponent(t.split("/")[t.split("/").length-1]);var t})).join(", ")));case i.CHECKBOX:return e.createElement("div",{className:s.OptionRow},e.createElement("div",{className:s.OptionName},t.name),e.createElement("div",{className:s.OptionValue},t.values.length&&"true"===t.values[0].value?v("checkout-page:yes"):v("checkout-page:no")));case i.COLOR_PICKER:return e.createElement("div",{className:s.OptionRow},e.createElement("div",{className:s.OptionName},t.name),e.createElement("div",{className:s.OptionsHorContainer},t.values.map((function(t,i){return e.createElement("div",{key:i,className:s.OptionColorValue,style:{backgroundColor:t.value}})}))))}})))}),[]);return e.createElement("div",{className:s.CheckoutItem},e.createElement("div",{className:s.ImageContainer},e.createElement("img",{className:s.Image,src:null===(d=p.variant.mainImage)||void 0===d?void 0:d.thumbnailSrc})),e.createElement("div",{className:s.Right},e.createElement("div",{className:s.Name},p.variant.name),e.createElement("div",{className:s.LightText},"".concat(v("checkout-page:quantity"),": ")+p.quantity),e.createElement("div",{className:s.LightText},p.variant.variantValues.map((function(e){return e.variantValueName})).join(" / ")),!!(null===(l=p.options)||void 0===l?void 0:l.length)&&e.createElement("div",{className:s.OptionsText,onClick:function(){return f(!0)}},v("checkout-page:customizedProduct")),!!x&&e.createElement(m,{title:p.variant.name,modalContent:g,onClose:function(){return f(!1)}}),e.createElement("div",{className:s.Price},!!p.overridenPriceWithQuantity&&e.createElement("span",{className:s.GrayPrice},o(N?p.finalPriceWithQuantity:p.overridenPriceWithQuantity,u,!0)),o(N?p.finalPriceWithQuantity-N:p.finalPriceWithQuantity,u,!0))))}));export{n as CartItem};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'../../../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as a}from"mobx-react-lite";import n from'../../../../ext/lodash/sortBy.js';import c from"../input-with-button/index.js";import l from"../notification-box/index.js";import{CheckoutStep as r}from"../../model.js";import{IkasStorefrontConfig as i}from"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney 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 d}from"../form-item/index.js";import{FormItemType as p}from"../form-item/model.js";import E from"../tooltip/index.js";import v from"../svg/arrow-down.js";import C from"../svg/cross.js";import h from"../svg/gift.js";import f from"./style.module.scss.js";import g from"../svg/ikas.js";var k=a((function(e){var t,a,n,c=e.vm,d=e.allowExpand,p=c.cart,E=c.checkout,C=u().t,h=o.useState(!d),k=h[0],x=h[1],j=o.useState(!1),A=j[0],w=j[1],P=o.useState(0),I=P[0],L=P[1],R=o.useState(null),D=R[0],B=R[1],_=o.useState(!1),U=_[0],F=_[1],V=o.useState(!1),G=V[0],M=V[1];o.useEffect((function(){d&&(k?D&&L(D.getBoundingClientRect().height):L(0))}),[k,D,d,U,G,A]);var O=[f.CartSummary,d?f.HideOnDesktop:""].join(" "),z=d?{height:I+"px"}:void 0,H=[f.ArrowDown,k?f.Rotated:""].join(" ");return p?o.createElement(o.Fragment,null,!!d&&o.createElement(o.Fragment,null,o.createElement("div",{id:"checkout-mobile-summary-header"}),o.createElement("div",{className:f.ExpandHeader,onClick:function(){if(!k){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}x(!k)}},o.createElement("div",{className:f.Left},C("checkout-page:summary")),o.createElement("div",{className:f.Price},o.createElement("span",{className:f.PriceText},"".concat(s(c.finalPrice||0,p.currencyCode)," (").concat(null===(t=c.cart)||void 0===t?void 0:t.items.length," ").concat(C("checkout-page:cartItemProduct"),")")),o.createElement("span",{className:H},o.createElement(v,null))))),o.createElement("div",{className:O},o.createElement("div",{className:f.DetailsContainer,style:z},o.createElement("div",{className:f.Details,ref:B},null==p?void 0:p.items.map((function(e,t){return o.createElement("div",{key:t},o.createElement(m,{vm:c,cartItem:e,currencyCode:p.currencyCode}))})),o.createElement("div",{className:f.Divider}),o.createElement("div",{className:f.SubTotalInfo},A&&o.createElement("div",{className:f.NotificationContainer},o.createElement(l,{type:"warning",title:C("checkout-page:giftCodeErrorTitle"),content:C("checkout-page:giftCodeErrorDescription"),onClose:function(){return w(!1)}})),o.createElement(N,{label:C("checkout-page:subtotal"),value:s(p.totalPrice,p.currencyCode),tooltipText:C("checkout-page:subtotalTooltip")}),!!(null===(a=E.shippingLines)||void 0===a?void 0:a.length)&&o.createElement(N,{label:C("checkout-page:cartShippingTitle"),value:E.shippingTotal?s(E.shippingTotal,p.currencyCode):C("checkout-page:free")}),!!c.checkout.totalTax&&!!(null===(n=c.customizationProps)||void 0===n?void 0:n.showTax)&&o.createElement(N,{label:C("checkout-page:cartTaxTitle"),value:s(c.checkout.totalTax,p.currencyCode)}),!!c.installmentExtraPrice&&o.createElement(N,{label:C("checkout-page:cartInterest"),value:s(c.installmentExtraPrice,p.currencyCode)}),o.createElement(y,{vm:c}),o.createElement(T,{vm:c}),(c.step===r.SUCCESS&&(!!c.checkout.note||!!c.checkout.appliedCouponCode)||c.step!==r.SUCCESS)&&o.createElement("div",{className:f.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement(S,{vm:c,isAddingCoupon:G,setAddingCoupon:M,setCouponError:w}),o.createElement(b,{vm:c,isAddingNote:U,setAddingNote:F})),o.createElement("div",{className:f.TotalContainer},o.createElement("div",{className:f.TitleContainer},o.createElement("div",{className:f.Title},C("checkout-page:total"))),o.createElement("div",{className:f.TotalPrice},s(c.finalPrice||0,p.currencyCode))),o.createElement("div",{className:f.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(g,null))))))):null})),N=a((function(e){var t=e.label,a=e.value,n=e.tooltipText;return o.createElement("div",{className:f.InfoRow},o.createElement("div",{className:f.Label},o.createElement("span",null,t),!!n&&o.createElement(E,{text:n,style:{marginLeft:"8px"}})),o.createElement("div",{className:f.Value},a))})),y=a((function(e){var t=e.vm,a=u().t;return t.cart?o.createElement(o.Fragment,null,n(t.checkout.nonCouponAdjustments||[],"order").map((function(e,n){return o.createElement("div",{className:f.InfoRow,key:n},o.createElement("div",{className:f.Label},"INTEREST"===e.name?a("checkout-page:cartInterest"):e.name),o.createElement("div",{className:f.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,s(e.amount,t.cart.currencyCode))))}))):null})),T=a((function(e){var t,a,n=e.vm,c=u().t;return n.cart?o.createElement(o.Fragment,null,n.step!==r.SUCCESS&&((null===(t=n.checkout.selectedPaymentGateway)||void 0===t?void 0:t.getCalculatedAdditionalPrices(n.checkout.totalFinalPrice||0,n.checkout.shippingLines||null))||[]).filter((function(e){return 0!==e.amount})).map((function(e,t){return o.createElement("div",{className:f.InfoRow,key:t},o.createElement("div",{className:f.Label},e.name),o.createElement("div",{className:f.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,s(e.amount,n.cart.currencyCode))))})),null===(a=n.checkout.giftPackageLines)||void 0===a?void 0:a.map((function(e,t){return o.createElement("div",{className:f.InfoRow,key:t},o.createElement("div",{className:f.Label},o.createElement("div",{className:f.GiftLabel},o.createElement(h,{style:{position:"relative",top:"-1px"}}),o.createElement("span",null,c("checkout-page:giftPackage")))),o.createElement("div",{className:f.Value},o.createElement("span",null,s(e.price,n.cart.currencyCode))))}))):null})),S=a((function(a){var n=a.vm,l=a.isAddingCoupon,i=a.setAddingCoupon,m=a.setCouponError,d=u().t,p=o.useState(""),E=p[0],v=p[1],h=o.useState(!1),g=h[0],k=h[1];if(n.step===r.SUCCESS&&!n.checkout.appliedCouponCode)return null;var N=n.checkout.couponAdjustment;return o.createElement("div",{className:f.InfoRow},!n.checkout.appliedCouponCode&&!l&&o.createElement("div",{className:f.ActionTextBtn,onClick:function(){return i(!0)}},d("checkout-page:addCouponCode")),l&&o.createElement(c,{value:E,placeholder:d("checkout-page:couponCode"),buttonLabel:d("checkout-page:actions.apply"),onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return n.checkout.couponCode=E,k(!0),[4,n.onCouponCodeApply()];case 1:return e.sent(),k(!1),v(""),n.checkout.appliedCouponCode?(i(!1),m(!1)):(m(!0),n.checkout.couponCode=null),[2]}}))}))},isLoading:g,onChange:v}),!!n.checkout.appliedCouponCode&&!l&&o.createElement("div",{className:[f.ActionTextBtn,f.NoUnderline,f.Light].join(" ")},d("checkout-page:couponCode"),o.createElement("span",{className:f.AppliedCoupon},o.createElement("span",{className:f.CouponCode},n.checkout.appliedCouponCode),n.step!==r.SUCCESS&&o.createElement("span",{className:f.ClearCoupon,onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return n.checkout.couponCode=null,k(!0),[4,n.onCouponCodeApply()];case 1:return e.sent(),k(!1),[2]}}))}))}},o.createElement(C,null)))),!!n.checkout.appliedCouponCode&&!l&&o.createElement("div",{className:f.Value},o.createElement("span",null,"DECREMENT"===(null==N?void 0:N.type)?"- ":"")," ",o.createElement("span",null,s((null==N?void 0:N.amount)||0,n.cart.currencyCode))))})),b=a((function(e){var t=e.vm,a=e.isAddingNote,n=e.setAddingNote,c=u().t,l=o.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=o.useCallback((function(){n(!0)}),[]),s=o.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===r.SUCCESS;return m&&!t.checkout.note?null:o.createElement("div",{className:f.InfoRow},!a&&!m&&o.createElement("div",{className:f.ActionTextBtn,onClick:i},l),(a||m)&&o.createElement("div",{className:[f.CheckoutNoteContainer,m?f.Success:""].join(" ")},o.createElement("div",{className:f.Title},c("checkout-page:orderNote")),m?o.createElement("div",{className:f.CheckoutNoteDisplay},t.checkout.note):o.createElement(d,{style:{width:"100%"},type:p.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:s})))}));export{k as CartSummary};
1
+ import{__awaiter as e,__generator as t}from'../../../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as a}from"mobx-react-lite";import n from'../../../../ext/lodash/sortBy.js';import c from"../input-with-button/index.js";import l from"../notification-box/index.js";import{CheckoutStep as r}from"../../model.js";import{IkasStorefrontConfig as i}from"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney 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 d}from"../form-item/index.js";import{FormItemType as p}from"../form-item/model.js";import E from"../tooltip/index.js";import v from"../svg/arrow-down.js";import C from"../svg/cross.js";import h from"../svg/gift.js";import f from"./style.module.scss.js";import g from"../svg/ikas.js";var k=a((function(e){var t,a,n,c=e.vm,d=e.allowExpand,p=c.cart,E=c.checkout,C=u().t,h=o.useState(!d),k=h[0],x=h[1],j=o.useState(!1),A=j[0],w=j[1],P=o.useState(0),I=P[0],L=P[1],R=o.useState(null),D=R[0],B=R[1],_=o.useState(!1),U=_[0],F=_[1],V=o.useState(!1),G=V[0],M=V[1];o.useEffect((function(){d&&(k?D&&L(D.getBoundingClientRect().height):L(0))}),[k,D,d,U,G,A]);var O=[f.CartSummary,d?f.HideOnDesktop:""].join(" "),z=d?{height:I+"px"}:void 0,H=[f.ArrowDown,k?f.Rotated:""].join(" ");return p?o.createElement(o.Fragment,null,!!d&&o.createElement(o.Fragment,null,o.createElement("div",{id:"checkout-mobile-summary-header"}),o.createElement("div",{className:f.ExpandHeader,onClick:function(){if(!k){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}x(!k)}},o.createElement("div",{className:f.Left},C("checkout-page:summary")),o.createElement("div",{className:f.Price},o.createElement("span",{className:f.PriceText},"".concat(s(c.finalPrice||0,p.currencyCode,!0)," (").concat(null===(t=c.cart)||void 0===t?void 0:t.items.length," ").concat(C("checkout-page:cartItemProduct"),")")),o.createElement("span",{className:H},o.createElement(v,null))))),o.createElement("div",{className:O},o.createElement("div",{className:f.DetailsContainer,style:z},o.createElement("div",{className:f.Details,ref:B},null==p?void 0:p.items.map((function(e,t){return o.createElement("div",{key:t},o.createElement(m,{vm:c,cartItem:e,currencyCode:p.currencyCode}))})),o.createElement("div",{className:f.Divider}),o.createElement("div",{className:f.SubTotalInfo},A&&o.createElement("div",{className:f.NotificationContainer},o.createElement(l,{type:"warning",title:C("checkout-page:giftCodeErrorTitle"),content:C("checkout-page:giftCodeErrorDescription"),onClose:function(){return w(!1)}})),o.createElement(N,{label:C("checkout-page:subtotal"),value:s(p.totalPrice,p.currencyCode,!0),tooltipText:C("checkout-page:subtotalTooltip")}),!!(null===(a=E.shippingLines)||void 0===a?void 0:a.length)&&o.createElement(N,{label:C("checkout-page:cartShippingTitle"),value:E.shippingTotal?s(E.shippingTotal,p.currencyCode,!0):C("checkout-page:free")}),!!c.checkout.totalTax&&!!(null===(n=c.customizationProps)||void 0===n?void 0:n.showTax)&&o.createElement(N,{label:C("checkout-page:cartTaxTitle"),value:s(c.checkout.totalTax,p.currencyCode,!0)}),!!c.installmentExtraPrice&&o.createElement(N,{label:C("checkout-page:cartInterest"),value:s(c.installmentExtraPrice,p.currencyCode,!0)}),o.createElement(y,{vm:c}),o.createElement(T,{vm:c}),(c.step===r.SUCCESS&&(!!c.checkout.note||!!c.checkout.appliedCouponCode)||c.step!==r.SUCCESS)&&o.createElement("div",{className:f.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement(S,{vm:c,isAddingCoupon:G,setAddingCoupon:M,setCouponError:w}),o.createElement(b,{vm:c,isAddingNote:U,setAddingNote:F})),o.createElement("div",{className:f.TotalContainer},o.createElement("div",{className:f.TitleContainer},o.createElement("div",{className:f.Title},C("checkout-page:total"))),o.createElement("div",{className:f.TotalPrice},s(c.finalPrice||0,p.currencyCode,!0))),o.createElement("div",{className:f.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(g,null))))))):null})),N=a((function(e){var t=e.label,a=e.value,n=e.tooltipText;return o.createElement("div",{className:f.InfoRow},o.createElement("div",{className:f.Label},o.createElement("span",null,t),!!n&&o.createElement(E,{text:n,style:{marginLeft:"8px"}})),o.createElement("div",{className:f.Value},a))})),y=a((function(e){var t=e.vm,a=u().t;return t.cart?o.createElement(o.Fragment,null,n(t.checkout.nonCouponAdjustments||[],"order").map((function(e,n){return o.createElement("div",{className:f.InfoRow,key:n},o.createElement("div",{className:f.Label},"INTEREST"===e.name?a("checkout-page:cartInterest"):e.name),o.createElement("div",{className:f.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,s(e.amount,t.cart.currencyCode,!0))))}))):null})),T=a((function(e){var t,a,n=e.vm,c=u().t;return n.cart?o.createElement(o.Fragment,null,n.step!==r.SUCCESS&&((null===(t=n.checkout.selectedPaymentGateway)||void 0===t?void 0:t.getCalculatedAdditionalPrices(n.checkout.totalFinalPrice||0,n.checkout.shippingLines||null))||[]).filter((function(e){return 0!==e.amount})).map((function(e,t){return o.createElement("div",{className:f.InfoRow,key:t},o.createElement("div",{className:f.Label},e.name),o.createElement("div",{className:f.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,s(e.amount,n.cart.currencyCode,!0))))})),null===(a=n.checkout.giftPackageLines)||void 0===a?void 0:a.map((function(e,t){return o.createElement("div",{className:f.InfoRow,key:t},o.createElement("div",{className:f.Label},o.createElement("div",{className:f.GiftLabel},o.createElement(h,{style:{position:"relative",top:"-1px"}}),o.createElement("span",null,c("checkout-page:giftPackage")))),o.createElement("div",{className:f.Value},o.createElement("span",null,s(e.price,n.cart.currencyCode,!0))))}))):null})),S=a((function(a){var n=a.vm,l=a.isAddingCoupon,i=a.setAddingCoupon,m=a.setCouponError,d=u().t,p=o.useState(""),E=p[0],v=p[1],h=o.useState(!1),g=h[0],k=h[1];if(n.step===r.SUCCESS&&!n.checkout.appliedCouponCode)return null;var N=n.checkout.couponAdjustment;return o.createElement("div",{className:f.InfoRow},!n.checkout.appliedCouponCode&&!l&&o.createElement("div",{className:f.ActionTextBtn,onClick:function(){return i(!0)}},d("checkout-page:addCouponCode")),l&&o.createElement(c,{value:E,placeholder:d("checkout-page:couponCode"),buttonLabel:d("checkout-page:actions.apply"),onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return n.checkout.couponCode=E,k(!0),[4,n.onCouponCodeApply()];case 1:return e.sent(),k(!1),v(""),n.checkout.appliedCouponCode?(i(!1),m(!1)):(m(!0),n.checkout.couponCode=null),[2]}}))}))},isLoading:g,onChange:v}),!!n.checkout.appliedCouponCode&&!l&&o.createElement("div",{className:[f.ActionTextBtn,f.NoUnderline,f.Light].join(" ")},d("checkout-page:couponCode"),o.createElement("span",{className:f.AppliedCoupon},o.createElement("span",{className:f.CouponCode},n.checkout.appliedCouponCode),n.step!==r.SUCCESS&&o.createElement("span",{className:f.ClearCoupon,onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return n.checkout.couponCode=null,k(!0),[4,n.onCouponCodeApply()];case 1:return e.sent(),k(!1),[2]}}))}))}},o.createElement(C,null)))),!!n.checkout.appliedCouponCode&&!l&&o.createElement("div",{className:f.Value},o.createElement("span",null,"DECREMENT"===(null==N?void 0:N.type)?"- ":"")," ",o.createElement("span",null,s((null==N?void 0:N.amount)||0,n.cart.currencyCode,!0))))})),b=a((function(e){var t=e.vm,a=e.isAddingNote,n=e.setAddingNote,c=u().t,l=o.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=o.useCallback((function(){n(!0)}),[]),s=o.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===r.SUCCESS;return m&&!t.checkout.note?null:o.createElement("div",{className:f.InfoRow},!a&&!m&&o.createElement("div",{className:f.ActionTextBtn,onClick:i},l),(a||m)&&o.createElement("div",{className:[f.CheckoutNoteContainer,m?f.Success:""].join(" ")},o.createElement("div",{className:f.Title},c("checkout-page:orderNote")),m?o.createElement("div",{className:f.CheckoutNoteDisplay},t.checkout.note):o.createElement(d,{style:{width:"100%"},type:p.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:s})))}));export{k as CartSummary};
@@ -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 s,{CheckoutStep as c}from"./model.js";import n from"./steps/step-info/index.js";import{CheckoutStepShipping as a}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as m}from"./steps/step-payment/index.js";import{CartSummary as l}from"./components/cart-summary/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../../api/product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import{IkasThemePageType as d}from"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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/register.js";import{ContactForm as u}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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{StepSuccess as p}from"./steps/step-success/index.js";import{Modal as v}from"./components/modal/index.js";import h from"./style.module.scss.js";import{IkasPageHead as E}from"../page/head.js";import{Analytics as g}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{Image as f}from"../image/index.js";import x from"next/link.js";import k,{Step as y}from"./components/step-container/index.js";import{IkasStorefrontConfig as j}from"../../storefront/index.js";import'../../ext/lodash/isArguments.js';import'../../ext/lodash/isBuffer.js';import'../../ext/lodash/isTypedArray.js';import'../../ext/lodash/_baseGetTag.js';import{formatMoney as C}from"../../utils/currency.js";import{useTranslation as N}from"../../utils/i18n.js";import{StockError as b}from"./components/error/stock-error/index.js";import F from"./components/svg/ikas.js";import P from'../../ext/react-tooltip/dist/index.es.js';import{FullscreenLoading as T}from"./components/fullscreen-loading/index.js";import S from"./components/notification-box/index.js";import{FormItem as A}from"./components/form-item/index.js";import{FormItemType as M}from"./components/form-item/model.js";import{Button as w}from"./components/button/index.js";var I=r((function(e){var t,r,n,a=e.checkout,m=e.checkoutSettings,u=e.merchantSettings,f=e.customizationProps,x=e.returnPolicy,k=e.privacyPolicy,y=e.termsOfService,C=N().t,S=i(),A=o.useState((function(){return new s(a,m,u,S,x,k,y,C,f||{})}))[0];return A.step===c.PAYMENT&&g.disableHTML(),o.useEffect((function(){A.checkoutSettings.isAccountRequired&&!A.checkout.hasCustomer&&S.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),g.beginCheckout(A.checkout),g.pageView(d.CHECKOUT)}),[]),o.useEffect((function(){A.customizationProps=f,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")}(f)}),[f]),A.isCheckoutLoaded&&A.store.customerStore.initialized?A.checkout.hasCustomer&&(null===(t=A.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(r=A.checkout.customer)||void 0===r?void 0:r.id)?(S.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(E,{pageType:d.CHECKOUT,pageTitle:((null===(n=A.merchantSettings)||void 0===n?void 0:n.merchantName)||"")+" - "+C("checkout-page:securePayment"),pageDescription:C("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:h.CheckoutPage},o.createElement(P,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:h.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:h.Left},o.createElement("div",{className:h.LeftContent},o.createElement("div",null,o.createElement(B,{vm:A}),A.hasStockError&&o.createElement("div",{className:h.ErrorContainer},o.createElement(b,{vm:A,error:A.error})),!A.hasStockError&&o.createElement(o.Fragment,null,o.createElement(l,{vm:A,allowExpand:!0}),A.step===c.SUCCESS?o.createElement(p,{vm:A}):o.createElement(L,{vm:A})),o.createElement("div",{className:h.Space})),o.createElement(U,{vm:A}))),o.createElement("div",{className:h.Right},o.createElement("div",{className:h.RightContent},o.createElement(l,{vm:A}),o.createElement("div",{className:h.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===j.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(F,null))))),!!A.policyModalText&&o.createElement(v,{title:A.policyModalTitle,modalContent:A.policyModalText,onClose:function(){A.policyModalText=""}}),A.isContactModalVisible&&o.createElement(H,{vm:A,setVisible:A.setContactModalVisible}))):o.createElement(T,null)})),B=r((function(e){var t,r,i=e.vm,s=N().t;return o.createElement("div",{className:h.Header},o.createElement(x,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=i.merchantSettings)||void 0===t?void 0:t.logoId)?o.createElement("div",{className:h.Logo},o.createElement(f,{layout:"fill",image:i.merchantSettings.logo,sizes:"360px"})):(null===(r=i.merchantSettings)||void 0===r?void 0:r.merchantName)||"")),!i.checkout.hasCustomer&&o.createElement("div",{className:h.LoginText},o.createElement("span",{className:h.LoginCta},s("checkout-page:alreadyHaveAnAccount")),o.createElement(x,{href:"/account/login?redirect="+encodeURIComponent(i.checkoutUrl),passHref:!0},o.createElement("a",{className:h.LoginBtn},s("checkout-page:actions.login")))),i.checkout.hasCustomer&&o.createElement("div",{className:h.CustomerInfo},o.createElement("div",{className:h.Name},i.checkout.customerFullName),o.createElement("div",{className:h.Email},i.checkout.customerEmail)))})),L=r((function(e){var t=e.vm,r=N().t,i=o.useMemo((function(){switch(t.step){case c.INFO:return o.createElement(n,{vm:t});case c.SHIPPING:return o.createElement(a,{vm:t});case c.PAYMENT:return o.createElement(m,{vm:t});case c.SUCCESS:return o.createElement(p,{vm:t})}}),[t,t.step]),s=[new y(r("checkout-page:address"),t.step===c.INFO,t.step!==c.INFO,t.step!==c.INFO?o.createElement("div",{className:h.AdressStepInfo},o.createElement(O,{vm:t}),o.createElement("div",{className:h.EditBtn,onClick:t.onBackToInfoClick},r("checkout-page:actions.edit"))):void 0,t.step!==c.INFO?o.createElement("div",{className:h.AddressStepInfoMobile},o.createElement(O,{vm:t})):void 0),new y(r("checkout-page:shipping"),t.step===c.SHIPPING,t.step===c.PAYMENT,t.step===c.PAYMENT?o.createElement("div",{className:h.AdressStepInfo},o.createElement(R,{vm:t}),t.checkout.availableShippingMethods.length>1&&o.createElement("div",{className:h.EditBtn,onClick:t.onBackToShippingClick},r("checkout-page:actions.edit"))):void 0,t.step===c.PAYMENT?o.createElement("div",{className:h.AddressStepInfoMobile},o.createElement(R,{vm:t})):void 0),new y(r("checkout-page:payment"),t.step===c.PAYMENT,!1)];return o.createElement(k,{steps:s,stepContent:i})})),O=r((function(e){var t,r,i,s,c,n=e.vm;return o.createElement("div",{className:h.Address},o.createElement("div",{className:[h.Text,h.WithMBottom].join(" ")},(null===(t=n.checkout.customer)||void 0===t?void 0:t.email)||""),o.createElement("div",{className:h.Text},((null===(r=n.checkout.customer)||void 0===r?void 0:r.firstName)||"")+" "+((null===(i=n.checkout.customer)||void 0===i?void 0:i.lastName)||"")),o.createElement("div",{className:[h.Text,h.Gray].join(" ")},null===(s=n.checkout.shippingAddress)||void 0===s?void 0:s.phone),o.createElement("div",{className:[h.Text,h.Gray].join(" ")},null===(c=n.checkout.shippingAddress)||void 0===c?void 0:c.addressText))})),R=r((function(e){var t=e.vm,r=N().t;return o.createElement("div",{className:h.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:h.LightText}," / "+(0===t.checkout.shippingLines[0].price?r("checkout-page:free"):C(t.checkout.shippingLines[0].price,t.checkout.cart.currencyCode)))):r("checkout-page:standartShipping"))})),U=r((function(e){var t=e.vm,r=N().t;return o.createElement("div",{className:h.Footer},o.createElement("div",{className:h.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},r("checkout-page:returnPolicy")),o.createElement("div",{className:h.FooterBullet},"•"),o.createElement("div",{className:h.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},r("checkout-page:privacyPolicy")),o.createElement("div",{className:h.FooterBullet},"•"),o.createElement("div",{className:h.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},r("checkout-page:termsOfService")))})),H=r((function(r){var i,s,c=r.vm,n=r.setVisible,a=N().t,m=o.useState(!1),l=m[0],d=m[1],p=o.useState(!1),h=p[0],E=p[1],g=o.useState(new u({message:{requiredRule:"",emailRule:"",minRule:""},store:c.store}))[0];g.email=c.checkout.customerEmail,g.firstName=(null===(i=c.checkout.customer)||void 0===i?void 0:i.firstName)||"",g.lastName=(null===(s=c.checkout.customer)||void 0===s?void 0:s.lastName)||"";var f=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,n(!1)]:(d(!0),[4,g.saveContactForm()]);case 1:return e.sent()&&E(!0),d(!1),[2]}}))}))}),[l]);return o.createElement(v,{title:a("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(S,{type:"success",title:a("checkout-page:contactFormSent"),content:a("checkout-page:contactFormDescription")})),o.createElement(A,{type:M.TEXT_AREA,label:"",value:g.message||"",onChange:g.onMessageChange,textAreaPlaceholder:a("checkout-page:contactFormCta")}),o.createElement(w,{style:{width:"100%",marginTop:"24px"},text:a(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:l,isDisabled:!g.message,onClick:f})),onClose:function(){return n(!1)}})}));export{I 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 s,{CheckoutStep as c}from"./model.js";import n from"./steps/step-info/index.js";import{CheckoutStepShipping as a}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as m}from"./steps/step-payment/index.js";import{CartSummary as l}from"./components/cart-summary/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../../api/product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import{IkasThemePageType as d}from"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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/register.js";import{ContactForm as u}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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{StepSuccess as p}from"./steps/step-success/index.js";import{Modal as v}from"./components/modal/index.js";import h from"./style.module.scss.js";import{IkasPageHead as E}from"../page/head.js";import{Analytics as g}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{Image as f}from"../image/index.js";import x from"next/link.js";import k,{Step as y}from"./components/step-container/index.js";import{IkasStorefrontConfig as j}from"../../storefront/index.js";import'../../ext/lodash/isArguments.js';import'../../ext/lodash/isBuffer.js';import'../../ext/lodash/isTypedArray.js';import'../../ext/lodash/_baseGetTag.js';import{formatMoney as C}from"../../utils/currency.js";import{useTranslation as N}from"../../utils/i18n.js";import{StockError as b}from"./components/error/stock-error/index.js";import F from"./components/svg/ikas.js";import P from'../../ext/react-tooltip/dist/index.es.js';import{FullscreenLoading as T}from"./components/fullscreen-loading/index.js";import S from"./components/notification-box/index.js";import{FormItem as A}from"./components/form-item/index.js";import{FormItemType as M}from"./components/form-item/model.js";import{Button as w}from"./components/button/index.js";var I=r((function(e){var t,r,n,a=e.checkout,m=e.checkoutSettings,u=e.merchantSettings,f=e.customizationProps,x=e.returnPolicy,k=e.privacyPolicy,y=e.termsOfService,C=N().t,S=i(),A=o.useState((function(){return new s(a,m,u,S,x,k,y,C,f||{})}))[0];return A.step===c.PAYMENT&&g.disableHTML(),o.useEffect((function(){A.checkoutSettings.isAccountRequired&&!A.checkout.hasCustomer&&S.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),g.beginCheckout(A.checkout),g.pageView(d.CHECKOUT)}),[]),o.useEffect((function(){A.customizationProps=f,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")}(f)}),[f]),A.isCheckoutLoaded&&A.store.customerStore.initialized?A.checkout.hasCustomer&&(null===(t=A.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(r=A.checkout.customer)||void 0===r?void 0:r.id)?(S.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(E,{pageType:d.CHECKOUT,pageTitle:((null===(n=A.merchantSettings)||void 0===n?void 0:n.merchantName)||"")+" - "+C("checkout-page:securePayment"),pageDescription:C("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:h.CheckoutPage},o.createElement(P,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:h.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:h.Left},o.createElement("div",{className:h.LeftContent},o.createElement("div",null,o.createElement(B,{vm:A}),A.hasStockError&&o.createElement("div",{className:h.ErrorContainer},o.createElement(b,{vm:A,error:A.error})),!A.hasStockError&&o.createElement(o.Fragment,null,o.createElement(l,{vm:A,allowExpand:!0}),A.step===c.SUCCESS?o.createElement(p,{vm:A}):o.createElement(L,{vm:A})),o.createElement("div",{className:h.Space})),o.createElement(U,{vm:A}))),o.createElement("div",{className:h.Right},o.createElement("div",{className:h.RightContent},o.createElement(l,{vm:A}),o.createElement("div",{className:h.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===j.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(F,null))))),!!A.policyModalText&&o.createElement(v,{title:A.policyModalTitle,modalContent:A.policyModalText,onClose:function(){A.policyModalText=""}}),A.isContactModalVisible&&o.createElement(H,{vm:A,setVisible:A.setContactModalVisible}))):o.createElement(T,null)})),B=r((function(e){var t,r,i=e.vm,s=N().t;return o.createElement("div",{className:h.Header},o.createElement(x,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=i.merchantSettings)||void 0===t?void 0:t.logoId)?o.createElement("div",{className:h.Logo},o.createElement(f,{layout:"fill",image:i.merchantSettings.logo,sizes:"360px"})):(null===(r=i.merchantSettings)||void 0===r?void 0:r.merchantName)||"")),!i.checkout.hasCustomer&&o.createElement("div",{className:h.LoginText},o.createElement("span",{className:h.LoginCta},s("checkout-page:alreadyHaveAnAccount")),o.createElement(x,{href:"/account/login?redirect="+encodeURIComponent(i.checkoutUrl),passHref:!0},o.createElement("a",{className:h.LoginBtn},s("checkout-page:actions.login")))),i.checkout.hasCustomer&&o.createElement("div",{className:h.CustomerInfo},o.createElement("div",{className:h.Name},i.checkout.customerFullName),o.createElement("div",{className:h.Email},i.checkout.customerEmail)))})),L=r((function(e){var t=e.vm,r=N().t,i=o.useMemo((function(){switch(t.step){case c.INFO:return o.createElement(n,{vm:t});case c.SHIPPING:return o.createElement(a,{vm:t});case c.PAYMENT:return o.createElement(m,{vm:t});case c.SUCCESS:return o.createElement(p,{vm:t})}}),[t,t.step]),s=[new y(r("checkout-page:address"),t.step===c.INFO,t.step!==c.INFO,t.step!==c.INFO?o.createElement("div",{className:h.AdressStepInfo},o.createElement(O,{vm:t}),o.createElement("div",{className:h.EditBtn,onClick:t.onBackToInfoClick},r("checkout-page:actions.edit"))):void 0,t.step!==c.INFO?o.createElement("div",{className:h.AddressStepInfoMobile},o.createElement(O,{vm:t})):void 0),new y(r("checkout-page:shipping"),t.step===c.SHIPPING,t.step===c.PAYMENT,t.step===c.PAYMENT?o.createElement("div",{className:h.AdressStepInfo},o.createElement(R,{vm:t}),t.checkout.availableShippingMethods.length>1&&o.createElement("div",{className:h.EditBtn,onClick:t.onBackToShippingClick},r("checkout-page:actions.edit"))):void 0,t.step===c.PAYMENT?o.createElement("div",{className:h.AddressStepInfoMobile},o.createElement(R,{vm:t})):void 0),new y(r("checkout-page:payment"),t.step===c.PAYMENT,!1)];return o.createElement(k,{steps:s,stepContent:i})})),O=r((function(e){var t,r,i,s,c,n=e.vm;return o.createElement("div",{className:h.Address},o.createElement("div",{className:[h.Text,h.WithMBottom].join(" ")},(null===(t=n.checkout.customer)||void 0===t?void 0:t.email)||""),o.createElement("div",{className:h.Text},((null===(r=n.checkout.customer)||void 0===r?void 0:r.firstName)||"")+" "+((null===(i=n.checkout.customer)||void 0===i?void 0:i.lastName)||"")),o.createElement("div",{className:[h.Text,h.Gray].join(" ")},null===(s=n.checkout.shippingAddress)||void 0===s?void 0:s.phone),o.createElement("div",{className:[h.Text,h.Gray].join(" ")},null===(c=n.checkout.shippingAddress)||void 0===c?void 0:c.addressText))})),R=r((function(e){var t=e.vm,r=N().t;return o.createElement("div",{className:h.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:h.LightText}," / "+(0===t.checkout.shippingLines[0].price?r("checkout-page:free"):C(t.checkout.shippingLines[0].price,t.checkout.cart.currencyCode,!0)))):r("checkout-page:standartShipping"))})),U=r((function(e){var t=e.vm,r=N().t;return o.createElement("div",{className:h.Footer},o.createElement("div",{className:h.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},r("checkout-page:returnPolicy")),o.createElement("div",{className:h.FooterBullet},"•"),o.createElement("div",{className:h.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},r("checkout-page:privacyPolicy")),o.createElement("div",{className:h.FooterBullet},"•"),o.createElement("div",{className:h.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},r("checkout-page:termsOfService")))})),H=r((function(r){var i,s,c=r.vm,n=r.setVisible,a=N().t,m=o.useState(!1),l=m[0],d=m[1],p=o.useState(!1),h=p[0],E=p[1],g=o.useState(new u({message:{requiredRule:"",emailRule:"",minRule:""},store:c.store}))[0];g.email=c.checkout.customerEmail,g.firstName=(null===(i=c.checkout.customer)||void 0===i?void 0:i.firstName)||"",g.lastName=(null===(s=c.checkout.customer)||void 0===s?void 0:s.lastName)||"";var f=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,n(!1)]:(d(!0),[4,g.saveContactForm()]);case 1:return e.sent()&&E(!0),d(!1),[2]}}))}))}),[l]);return o.createElement(v,{title:a("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(S,{type:"success",title:a("checkout-page:contactFormSent"),content:a("checkout-page:contactFormDescription")})),o.createElement(A,{type:M.TEXT_AREA,label:"",value:g.message||"",onChange:g.onMessageChange,textAreaPlaceholder:a("checkout-page:contactFormCta")}),o.createElement(w,{style:{width:"100%",marginTop:"24px"},text:a(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:l,isDisabled:!g.message,onClick:f})),onClose:function(){return n(!1)}})}));export{I as default};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import{IkasPaymentMethodType as n,IkasPaymentGatewayType as o,IkasPaymentGatewayAdditionalPriceAmountType as r,IkasPaymentMethodAdditionalPriceType as a}from"../../../../../models/data/payment-gateway/index.js";import{CreditCardForm as m}from"../../../components/credit-card-form/index.js";import{Installments as l}from"./installments/index.js";import i from"../../../components/select-box/index.js";import s from"./style.module.scss.js";import"../../../../../storefront/index.js";import'../../../../../ext/lodash/isArguments.js';import'../../../../../ext/lodash/isBuffer.js';import'../../../../../ext/lodash/isTypedArray.js';import'../../../../../ext/lodash/_baseGetTag.js';import{formatMoney as c}from"../../../../../utils/currency.js";import{useTranslation as d}from"../../../../../utils/i18n.js";import p from"../../../components/svg/external.js";var u=t((function(t){var u=t.vm,y=d().t,f=function(t){return e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap"}},t.children)},E=function(t){return e.createElement("div",{className:s.AdditionalPrice},t.children)};return e.createElement(e.Fragment,null,u.paymentGateways.map((function(t,d){var g,h;return e.createElement(i,{key:t.id,label:t.paymentMethodType===n.CREDIT_CARD&&t.type===o.INTERNAL?y("checkout-page:creditCard"):t.name,isSelected:u.selectedPaymentGatewayIndex===d,rightContent:(null===(g=t.additionalPrices)||void 0===g?void 0:g.length)?e.createElement(E,null,(h=t.additionalPrices[0],0===h.amount?"":"".concat(h.amountType===r.AMOUNT?c(h.amount,u.cart.currencyCode):" %"+h.amount).concat(h.type===a.DECREMENT?" "+y("checkout-page:paymentMethodDiscount"):" "+y("checkout-page:paymentMethodAdditionalPrice")))):e.createElement(f,null,!!t.logoUrl&&e.createElement("div",{className:s.PaymentLogoContainer},e.createElement("img",{src:t.logoUrl}))),bottomContent:t.paymentMethodType===n.CREDIT_CARD&&t.type===o.INTERNAL?e.createElement("div",null,e.createElement(m,{vm:u}),u.installmentInfo&&e.createElement(l,{vm:u})):t.description?e.createElement(e.Fragment,null,t.type===o.EXTERNAL&&e.createElement("div",{style:{height:"52px",display:"flex",justifyContent:"center",margin:"24px 0"}},e.createElement(p,null)),e.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}})):void 0,onClick:function(){return u.selectedPaymentGatewayIndex!==d&&u.setPaymentGateway(d)}})})))}));export{u as PaymentGateways};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import{IkasPaymentMethodType as n,IkasPaymentGatewayType as o,IkasPaymentGatewayAdditionalPriceAmountType as r,IkasPaymentMethodAdditionalPriceType as a}from"../../../../../models/data/payment-gateway/index.js";import{CreditCardForm as m}from"../../../components/credit-card-form/index.js";import{Installments as l}from"./installments/index.js";import i from"../../../components/select-box/index.js";import s from"./style.module.scss.js";import"../../../../../storefront/index.js";import'../../../../../ext/lodash/isArguments.js';import'../../../../../ext/lodash/isBuffer.js';import'../../../../../ext/lodash/isTypedArray.js';import'../../../../../ext/lodash/_baseGetTag.js';import{formatMoney as c}from"../../../../../utils/currency.js";import{useTranslation as d}from"../../../../../utils/i18n.js";import p from"../../../components/svg/external.js";var u=t((function(t){var u=t.vm,y=d().t,f=function(t){return e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",flexWrap:"wrap"}},t.children)},E=function(t){return e.createElement("div",{className:s.AdditionalPrice},t.children)};return e.createElement(e.Fragment,null,u.paymentGateways.map((function(t,d){var g,h;return e.createElement(i,{key:t.id,label:t.paymentMethodType===n.CREDIT_CARD&&t.type===o.INTERNAL?y("checkout-page:creditCard"):t.name,isSelected:u.selectedPaymentGatewayIndex===d,rightContent:(null===(g=t.additionalPrices)||void 0===g?void 0:g.length)?e.createElement(E,null,(h=t.additionalPrices[0],0===h.amount?"":"".concat(h.amountType===r.AMOUNT?c(h.amount,u.cart.currencyCode,!0):" %"+h.amount).concat(h.type===a.DECREMENT?" "+y("checkout-page:paymentMethodDiscount"):" "+y("checkout-page:paymentMethodAdditionalPrice")))):e.createElement(f,null,!!t.logoUrl&&e.createElement("div",{className:s.PaymentLogoContainer},e.createElement("img",{src:t.logoUrl}))),bottomContent:t.paymentMethodType===n.CREDIT_CARD&&t.type===o.INTERNAL?e.createElement("div",null,e.createElement(m,{vm:u}),u.installmentInfo&&e.createElement(l,{vm:u})):t.description?e.createElement(e.Fragment,null,t.type===o.EXTERNAL&&e.createElement("div",{style:{height:"52px",display:"flex",justifyContent:"center",margin:"24px 0"}},e.createElement(p,null)),e.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}})):void 0,onClick:function(){return u.selectedPaymentGatewayIndex!==d&&u.setPaymentGateway(d)}})})))}));export{u as PaymentGateways};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../../storefront/index.js";import'../../../../../../ext/lodash/isArguments.js';import'../../../../../../ext/lodash/isBuffer.js';import'../../../../../../ext/lodash/isTypedArray.js';import'../../../../../../ext/lodash/_baseGetTag.js';import{formatMoney as n}from"../../../../../../utils/currency.js";import{useTranslation as l}from"../../../../../../utils/i18n.js";import s from"./style.module.scss.js";import{Toggle as a}from"../../../../components/toggle/index.js";var o=t((function(t){var o,m=t.vm,r=l().t;return e.createElement("div",{className:s.Installments},e.createElement("div",{className:s.Title},r("checkout-page:installmentOptions")),e.createElement("div",{className:s.Container},null===(o=m.installmentInfo)||void 0===o?void 0:o.installmentPrices.map((function(t,l){return e.createElement("div",{className:s.Row,onClick:function(){return m.setInstallmentCount(t.installmentCount||1)}},e.createElement(a,{value:m.selectedInstallmentIndex===l}),e.createElement("div",{className:s.InstallmentInfo},e.createElement("div",{className:s.InstallmentCount},1===t.installmentCount?r("checkout-page:singleInstallment"):"".concat(t.installmentCount," ").concat(r("checkout-page:installments"))),1!==t.installmentCount&&e.createElement("div",{className:s.InstallmentPrice},n(t.installmentPrice,m.checkout.cart.currencyCode))),e.createElement("div",{className:s.Price},n(t.totalPrice,m.checkout.cart.currencyCode)))}))))}));export{o as Installments};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../../storefront/index.js";import'../../../../../../ext/lodash/isArguments.js';import'../../../../../../ext/lodash/isBuffer.js';import'../../../../../../ext/lodash/isTypedArray.js';import'../../../../../../ext/lodash/_baseGetTag.js';import{formatMoney as n}from"../../../../../../utils/currency.js";import{useTranslation as l}from"../../../../../../utils/i18n.js";import s from"./style.module.scss.js";import{Toggle as a}from"../../../../components/toggle/index.js";var o=t((function(t){var o,m=t.vm,r=l().t;return e.createElement("div",{className:s.Installments},e.createElement("div",{className:s.Title},r("checkout-page:installmentOptions")),e.createElement("div",{className:s.Container},null===(o=m.installmentInfo)||void 0===o?void 0:o.installmentPrices.map((function(t,l){return e.createElement("div",{className:s.Row,onClick:function(){return m.setInstallmentCount(t.installmentCount||1)}},e.createElement(a,{value:m.selectedInstallmentIndex===l}),e.createElement("div",{className:s.InstallmentInfo},e.createElement("div",{className:s.InstallmentCount},1===t.installmentCount?r("checkout-page:singleInstallment"):"".concat(t.installmentCount," ").concat(r("checkout-page:installments"))),1!==t.installmentCount&&e.createElement("div",{className:s.InstallmentPrice},n(t.installmentPrice,m.checkout.cart.currencyCode,!0))),e.createElement("div",{className:s.Price},n(t.totalPrice,m.checkout.cart.currencyCode,!0)))}))))}));export{o as Installments};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney as o}from"../../../../utils/currency.js";import{useTranslation as i}from"../../../../utils/i18n.js";import n from"./style.module.scss.js";import{Button as c}from"../../components/button/index.js";import{Checkbox as r}from"../../components/checkbox/index.js";import{FormItemType as a}from"../../components/form-item/model.js";import{FormItem as s}from"../../components/form-item/index.js";import m from"../../components/error/index.js";import p from"../../components/select-box/index.js";var l=t((function(t){var o=t.vm,r=i().t;return e.createElement("div",{className:[n.StepShipping].join(" ")},e.createElement(u,{vm:o}),e.createElement(d,{vm:o}),e.createElement(c,{style:{width:"100%",marginTop:"32px"},text:r("checkout-page:actions.continueWithPayment"),isLoading:o.isStepLoading,onClick:o.onProceedToPaymentClick}))})),u=t((function(t){var c=t.vm,r=i().t;return e.createElement("div",{className:[n.InfoBox,c.isChangingShippingMethod?n.Dimmed:""].join(" ")},e.createElement(m,{vm:c}),c.checkout.availableShippingMethods.map((function(t,i){return e.createElement(p,{key:t.shippingSettingsId+t.shippingZoneRateId,label:t.rateName,isSelected:c.checkout.shippingSettingsId===t.shippingSettingsId&&c.checkout.shippingZoneRateId===t.shippingZoneRateId,rightContent:e.createElement("div",{className:n.ShippingPrice},0===t.price?r("checkout-page:free"):o(t.price,c.checkout.cart.currencyCode)),onClick:function(){return c.onShippingMethodChange(t)}})})))})),d=t((function(t){var c=t.vm,m=i().t,p=e.useCallback((function(e){c.checkout.isGiftPackage=e}),[c]),l=e.useCallback((function(e){c.checkout.giftPackageNote=e}),[c,c.checkout]),u=e.useMemo((function(){var e;return null===(e=c.checkoutSettings.giftPackagePriceList)||void 0===e?void 0:e.find((function(e){var t;return e.currencyCode===(null===(t=c.cart)||void 0===t?void 0:t.currencyCode)}))}),[c,c.checkoutSettings,c.cart]),d=m("checkout-page:giftPackageCta")+(u&&u.price?" (+ ".concat(o(u.price,u.currencyCode),")"):"");return c.checkoutSettings.isGiftPackageEnabled?e.createElement("div",{className:n.GiftSection},e.createElement(r,{value:c.checkout.isGiftPackage,label:d,onChange:p,removePadding:!0}),c.checkout.isGiftPackage&&e.createElement(s,{type:a.TEXT_AREA,label:"",value:c.checkout.giftPackageNote||"",onChange:l,style:{marginTop:"16px"},textAreaPlaceholder:m("checkout-page:giftPackageCtaPlaceholder")})):null}));export{l as CheckoutStepShipping};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney as o}from"../../../../utils/currency.js";import{useTranslation as i}from"../../../../utils/i18n.js";import n from"./style.module.scss.js";import{Button as c}from"../../components/button/index.js";import{Checkbox as r}from"../../components/checkbox/index.js";import{FormItemType as a}from"../../components/form-item/model.js";import{FormItem as s}from"../../components/form-item/index.js";import m from"../../components/error/index.js";import p from"../../components/select-box/index.js";var l=t((function(t){var o=t.vm,r=i().t;return e.createElement("div",{className:[n.StepShipping].join(" ")},e.createElement(u,{vm:o}),e.createElement(d,{vm:o}),e.createElement(c,{style:{width:"100%",marginTop:"32px"},text:r("checkout-page:actions.continueWithPayment"),isLoading:o.isStepLoading,onClick:o.onProceedToPaymentClick}))})),u=t((function(t){var c=t.vm,r=i().t;return e.createElement("div",{className:[n.InfoBox,c.isChangingShippingMethod?n.Dimmed:""].join(" ")},e.createElement(m,{vm:c}),c.checkout.availableShippingMethods.map((function(t,i){return e.createElement(p,{key:t.shippingSettingsId+t.shippingZoneRateId,label:t.rateName,isSelected:c.checkout.shippingSettingsId===t.shippingSettingsId&&c.checkout.shippingZoneRateId===t.shippingZoneRateId,rightContent:e.createElement("div",{className:n.ShippingPrice},0===t.price?r("checkout-page:free"):o(t.price,c.checkout.cart.currencyCode,!0)),onClick:function(){return c.onShippingMethodChange(t)}})})))})),d=t((function(t){var c=t.vm,m=i().t,p=e.useCallback((function(e){c.checkout.isGiftPackage=e}),[c]),l=e.useCallback((function(e){c.checkout.giftPackageNote=e}),[c,c.checkout]),u=e.useMemo((function(){var e;return null===(e=c.checkoutSettings.giftPackagePriceList)||void 0===e?void 0:e.find((function(e){var t;return e.currencyCode===(null===(t=c.cart)||void 0===t?void 0:t.currencyCode)}))}),[c,c.checkoutSettings,c.cart]),d=m("checkout-page:giftPackageCta")+(u&&u.price?" (+ ".concat(o(u.price,u.currencyCode,!0),")"):"");return c.checkoutSettings.isGiftPackageEnabled?e.createElement("div",{className:n.GiftSection},e.createElement(r,{value:c.checkout.isGiftPackage,label:d,onChange:p,removePadding:!0}),c.checkout.isGiftPackage&&e.createElement(s,{type:a.TEXT_AREA,label:"",value:c.checkout.giftPackageNote||"",onChange:l,style:{marginTop:"16px"},textAreaPlaceholder:m("checkout-page:giftPackageCtaPlaceholder")})):null}));export{l as CheckoutStepShipping};
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as o}from"../../components/button/index.js";import{CART_LS_KEY as a,CHECKOUT_LS_KEY as s}from"../../../../store/cart.js";import r from"./style.module.scss.js";import i from"../../components/svg/success-circle.js";import l from"../../components/expandable-section/index.js";import{IkasTransactionCardAssociationEnum as n}from"../../../../models/data/order-transaction/index.js";import d from"../../components/credit-card-form/svg/amex.js";import c from"../../components/credit-card-form/svg/master-card.js";import m from"../../components/credit-card-form/svg/troy.js";import u from"../../components/credit-card-form/svg/visa.js";import"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney as p}from"../../../../utils/currency.js";import{useTranslation as v}from"../../../../utils/i18n.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/customer-review/index.js";import"mobx";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/installment-info/index.js";import{IkasOrderPackageStatus as E}from"../../../../models/data/order/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../api/product-option-file/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product-attribute/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product-filter/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"../../../../models/data/product-option-set/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/product-campaing/campaign/index.js";import"../../../../models/data/customer-attribute/index.js";import"../../../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../../../models/theme/theme.js";import"../../../../models/theme/page/index.js";import"../../../../models/theme/component/prop/index.js";import"../../../../models/theme/page/component/prop-value/link.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-detail/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/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";import"../../../../models/theme/settings/index.js";import"../../../../models/theme/custom-data/index.js";import{IkasPaymentMethodType as f,IkasPaymentGatewayType as g}from"../../../../models/data/payment-gateway/index.js";var x=t((function(t){var E,x,j,k,T=t.vm,I=v().t;e.useEffect((function(){if("undefined"!=typeof localStorage){var e=localStorage.getItem(a),t=localStorage.getItem(s);e&&e===T.checkout.cartId&&localStorage.removeItem(a),t&&t===T.checkout.id&&localStorage.removeItem(s)}}),[]);var N=((null===(E=T.checkout.customer)||void 0===E?void 0:E.firstName)||"")+" "+((null===(x=T.checkout.customer)||void 0===x?void 0:x.lastName)||""),y=T.paymentGateways.find((function(e){var t;return e.id===(null===(t=T.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),L=null===(j=T.successTransaction)||void 0===j?void 0:j.paymentMethodDetail,A=e.useMemo((function(){var t,o,a,s;return e.createElement("div",{className:[r.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:r.InfoTitle},I("checkout-page:paymentMethod")),y&&e.createElement(e.Fragment,null,!!y.logoUrl&&e.createElement("div",{className:r.PaymentLogoContainer},e.createElement("img",{src:y.logoUrl})),!y.logoUrl&&e.createElement("div",{className:r.InfoText},y.paymentMethodType===f.CREDIT_CARD&&y.type===g.INTERNAL?I("checkout-page:creditCard"):y.name),!!y.description&&y.type!==g.EXTERNAL&&e.createElement("div",{className:r.InfoText},e.createElement("div",{dangerouslySetInnerHTML:{__html:y.description}}))),"CREDIT_CARD"===(null===(t=T.successTransaction)||void 0===t?void 0:t.paymentMethod)&&e.createElement(e.Fragment,null,e.createElement("div",{className:r.InfoText},e.createElement("div",{className:r.CardLogoContainer},function(){var t,o;switch(null===(o=null===(t=T.successTransaction)||void 0===t?void 0:t.paymentMethodDetail)||void 0===o?void 0:o.cardAssociation){case n.AMERICAN_EXPRESS:return e.createElement(d,null);case n.MASTER_CARD:return e.createElement(c,null);case n.TROY:return e.createElement(m,null);case n.VISA:return e.createElement(u,null);default:return e.createElement("div",null)}}()),e.createElement("span",null,"**** ".concat((null==L?void 0:L.lastFourDigits)||""))),(null===(o=null==L?void 0:L.installment)||void 0===o?void 0:o.installmentCount)&&L.installment.installmentCount>1&&e.createElement(e.Fragment,null,e.createElement("div",{className:r.InfoText},"".concat(L.installment.installmentCount," ").concat(I("checkout-page:installments"))),null!==L.installment.installmentPrice&&e.createElement("div",{className:r.InfoText},"".concat(L.installment.installmentCount," x ").concat(p(L.installment.installmentPrice,T.checkout.cart.currencyCode)))))),e.createElement("div",null,e.createElement("div",{className:r.InfoTitle},I("checkout-page:billingAddress")),!!(null===(a=T.checkout.billingAddress)||void 0===a?void 0:a.company)&&e.createElement("div",{className:[r.InfoText,r.InfoTextBold].join(" ")},T.checkout.billingAddress.company),e.createElement("div",{className:r.InfoText},null===(s=T.checkout.billingAddress)||void 0===s?void 0:s.addressText)))}),[]),S=e.useMemo((function(){var t,o,a,s,i;return e.createElement("div",{className:[r.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:r.InfoTitle},I("checkout-page:contactInfo")),e.createElement("div",{className:r.InfoText},null===(t=T.checkout.customer)||void 0===t?void 0:t.email),e.createElement("div",{className:r.InfoText},N),!!(null===(o=T.checkout.shippingAddress)||void 0===o?void 0:o.phone)&&e.createElement("div",{className:r.InfoText},null===(a=T.checkout.shippingAddress)||void 0===a?void 0:a.phone)),e.createElement("div",null,e.createElement("div",{className:r.InfoTitle},I("checkout-page:shippingAddress")),!!(null===(s=T.checkout.shippingAddress)||void 0===s?void 0:s.company)&&e.createElement("div",{className:[r.InfoText,r.InfoTextBold].join(" ")},T.checkout.shippingAddress.company),e.createElement("div",{className:r.InfoText},null===(i=T.checkout.shippingAddress)||void 0===i?void 0:i.addressText)))}),[]);return e.createElement("div",{className:r.StepSuccess},e.createElement("div",{className:r.SuccessTitleContainer},e.createElement(i,null),e.createElement("span",{className:r.SuccessTitle},I("checkout-page:orderSuccessTitle"))),e.createElement("div",{className:r.SuccessSubTitle},I("checkout-page:orderSuccessDescription",{customerName:N})),e.createElement("div",{className:[r.InfoGrid,r.WithBorder].join(" ")},e.createElement("div",null,e.createElement("div",{className:r.InfoTitle},I("checkout-page:orderNoAndDate")),e.createElement("div",{className:[r.InfoText,r.InfoTextBold].join(" ")},"#"+(T.checkout.orderNumber||"")),e.createElement("div",{className:r.InfoText},T.checkout.dateStr),e.createElement(h,{vm:T})),e.createElement("div",null,e.createElement("div",{className:r.InfoTitle},I("checkout-page:contactInfo")),e.createElement("div",{className:r.InfoText},null===(k=T.checkout.customer)||void 0===k?void 0:k.email),e.createElement("div",{className:r.InfoText},N))),e.createElement(l,{title:I("checkout-page:paymentSummary")},A),e.createElement(l,{title:I("checkout-page:shippingSummary")},S),e.createElement("div",{className:r.Actions},e.createElement("div",{className:r.HelpText},e.createElement("span",null,I("checkout-page:helpCtaQuestion")),e.createElement("span",{className:r.Cta,onClick:function(){return T.setContactModalVisible(!0)}},I("checkout-page:helpCta"))),e.createElement(o,{text:I("checkout-page:actions.backToShopping"),onClick:T.onBackToShoppingClick,style:{flex:"0 0 auto"}})))})),h=t((function(t){var o,a,s,i=t.vm,l=v().t,n=r.Yellow;switch(null===(o=i.order)||void 0===o?void 0:o.orderPackageStatus){case E.FULFILLED:case E.PARTIALLY_FULFILLED:case E.DELIVERED:case E.PARTIALLY_DELIVERED:n=r.Green;break;case E.CANCELLED:case E.PARTIALLY_CANCELLED:case E.CANCEL_REJECTED:case E.CANCEL_REQUESTED:n=r.Red}return e.createElement("div",{className:[r.OrderStatus,n].join(" ")},(null===(a=i.order)||void 0===a?void 0:a.orderPackageStatus)?null===(s=[{types:[E.UNFULFILLED],text:l("checkout-page:orderPackageStatus.unfulfilled")},{types:[E.READY_FOR_SHIPMENT],text:l("checkout-page:orderPackageStatus.readyForShipment")},{types:[E.PARTIALLY_FULFILLED],text:l("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[E.FULFILLED],text:l("checkout-page:orderPackageStatus.fulfilled")},{types:[E.DELIVERED,E.PARTIALLY_DELIVERED],text:l("checkout-page:orderPackageStatus.delivered")},{types:[E.UNABLE_TO_DELIVER],text:l("checkout-page:orderPackageStatus.unableToDeliver")},{types:[E.CANCELLED,E.PARTIALLY_CANCELLED],text:l("checkout-page:orderPackageStatus.cancelled")},{types:[E.CANCEL_REJECTED],text:l("checkout-page:orderPackageStatus.cancelRejected")},{types:[E.REFUNDED,E.PARTIALLY_REFUNDED],text:l("checkout-page:orderPackageStatus.refunded")},{types:[E.REFUND_REQUEST_ACCEPTED],text:l("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[E.REFUND_REJECTED],text:l("checkout-page:orderPackageStatus.refundRejected")},{types:[E.REFUND_REQUESTED],text:l("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(i.order.orderPackageStatus)})))||void 0===s?void 0:s.text:"")}));export{x as StepSuccess};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as o}from"../../components/button/index.js";import{CART_LS_KEY as a,CHECKOUT_LS_KEY as s}from"../../../../store/cart.js";import r from"./style.module.scss.js";import i from"../../components/svg/success-circle.js";import l from"../../components/expandable-section/index.js";import{IkasTransactionCardAssociationEnum as n}from"../../../../models/data/order-transaction/index.js";import d from"../../components/credit-card-form/svg/amex.js";import c from"../../components/credit-card-form/svg/master-card.js";import m from"../../components/credit-card-form/svg/troy.js";import u from"../../components/credit-card-form/svg/visa.js";import"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney as p}from"../../../../utils/currency.js";import{useTranslation as v}from"../../../../utils/i18n.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/customer-review/index.js";import"mobx";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/installment-info/index.js";import{IkasOrderPackageStatus as E}from"../../../../models/data/order/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../api/product-option-file/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product-attribute/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product-filter/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"../../../../models/data/product-option-set/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/product-campaing/campaign/index.js";import"../../../../models/data/customer-attribute/index.js";import"../../../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../../../models/theme/theme.js";import"../../../../models/theme/page/index.js";import"../../../../models/theme/component/prop/index.js";import"../../../../models/theme/page/component/prop-value/link.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-detail/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/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";import"../../../../models/theme/settings/index.js";import"../../../../models/theme/custom-data/index.js";import{IkasPaymentMethodType as f,IkasPaymentGatewayType as g}from"../../../../models/data/payment-gateway/index.js";var x=t((function(t){var E,x,j,k,T=t.vm,I=v().t;e.useEffect((function(){if("undefined"!=typeof localStorage){var e=localStorage.getItem(a),t=localStorage.getItem(s);e&&e===T.checkout.cartId&&localStorage.removeItem(a),t&&t===T.checkout.id&&localStorage.removeItem(s)}}),[]);var N=((null===(E=T.checkout.customer)||void 0===E?void 0:E.firstName)||"")+" "+((null===(x=T.checkout.customer)||void 0===x?void 0:x.lastName)||""),y=T.paymentGateways.find((function(e){var t;return e.id===(null===(t=T.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),L=null===(j=T.successTransaction)||void 0===j?void 0:j.paymentMethodDetail,A=e.useMemo((function(){var t,o,a,s;return e.createElement("div",{className:[r.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:r.InfoTitle},I("checkout-page:paymentMethod")),y&&e.createElement(e.Fragment,null,!!y.logoUrl&&e.createElement("div",{className:r.PaymentLogoContainer},e.createElement("img",{src:y.logoUrl})),!y.logoUrl&&e.createElement("div",{className:r.InfoText},y.paymentMethodType===f.CREDIT_CARD&&y.type===g.INTERNAL?I("checkout-page:creditCard"):y.name),!!y.description&&y.type!==g.EXTERNAL&&e.createElement("div",{className:r.InfoText},e.createElement("div",{dangerouslySetInnerHTML:{__html:y.description}}))),"CREDIT_CARD"===(null===(t=T.successTransaction)||void 0===t?void 0:t.paymentMethod)&&e.createElement(e.Fragment,null,e.createElement("div",{className:r.InfoText},e.createElement("div",{className:r.CardLogoContainer},function(){var t,o;switch(null===(o=null===(t=T.successTransaction)||void 0===t?void 0:t.paymentMethodDetail)||void 0===o?void 0:o.cardAssociation){case n.AMERICAN_EXPRESS:return e.createElement(d,null);case n.MASTER_CARD:return e.createElement(c,null);case n.TROY:return e.createElement(m,null);case n.VISA:return e.createElement(u,null);default:return e.createElement("div",null)}}()),e.createElement("span",null,"**** ".concat((null==L?void 0:L.lastFourDigits)||""))),(null===(o=null==L?void 0:L.installment)||void 0===o?void 0:o.installmentCount)&&L.installment.installmentCount>1&&e.createElement(e.Fragment,null,e.createElement("div",{className:r.InfoText},"".concat(L.installment.installmentCount," ").concat(I("checkout-page:installments"))),null!==L.installment.installmentPrice&&e.createElement("div",{className:r.InfoText},"".concat(L.installment.installmentCount," x ").concat(p(L.installment.installmentPrice,T.checkout.cart.currencyCode,!0)))))),e.createElement("div",null,e.createElement("div",{className:r.InfoTitle},I("checkout-page:billingAddress")),!!(null===(a=T.checkout.billingAddress)||void 0===a?void 0:a.company)&&e.createElement("div",{className:[r.InfoText,r.InfoTextBold].join(" ")},T.checkout.billingAddress.company),e.createElement("div",{className:r.InfoText},null===(s=T.checkout.billingAddress)||void 0===s?void 0:s.addressText)))}),[]),S=e.useMemo((function(){var t,o,a,s,i;return e.createElement("div",{className:[r.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:r.InfoTitle},I("checkout-page:contactInfo")),e.createElement("div",{className:r.InfoText},null===(t=T.checkout.customer)||void 0===t?void 0:t.email),e.createElement("div",{className:r.InfoText},N),!!(null===(o=T.checkout.shippingAddress)||void 0===o?void 0:o.phone)&&e.createElement("div",{className:r.InfoText},null===(a=T.checkout.shippingAddress)||void 0===a?void 0:a.phone)),e.createElement("div",null,e.createElement("div",{className:r.InfoTitle},I("checkout-page:shippingAddress")),!!(null===(s=T.checkout.shippingAddress)||void 0===s?void 0:s.company)&&e.createElement("div",{className:[r.InfoText,r.InfoTextBold].join(" ")},T.checkout.shippingAddress.company),e.createElement("div",{className:r.InfoText},null===(i=T.checkout.shippingAddress)||void 0===i?void 0:i.addressText)))}),[]);return e.createElement("div",{className:r.StepSuccess},e.createElement("div",{className:r.SuccessTitleContainer},e.createElement(i,null),e.createElement("span",{className:r.SuccessTitle},I("checkout-page:orderSuccessTitle"))),e.createElement("div",{className:r.SuccessSubTitle},I("checkout-page:orderSuccessDescription",{customerName:N})),e.createElement("div",{className:[r.InfoGrid,r.WithBorder].join(" ")},e.createElement("div",null,e.createElement("div",{className:r.InfoTitle},I("checkout-page:orderNoAndDate")),e.createElement("div",{className:[r.InfoText,r.InfoTextBold].join(" ")},"#"+(T.checkout.orderNumber||"")),e.createElement("div",{className:r.InfoText},T.checkout.dateStr),e.createElement(h,{vm:T})),e.createElement("div",null,e.createElement("div",{className:r.InfoTitle},I("checkout-page:contactInfo")),e.createElement("div",{className:r.InfoText},null===(k=T.checkout.customer)||void 0===k?void 0:k.email),e.createElement("div",{className:r.InfoText},N))),e.createElement(l,{title:I("checkout-page:paymentSummary")},A),e.createElement(l,{title:I("checkout-page:shippingSummary")},S),e.createElement("div",{className:r.Actions},e.createElement("div",{className:r.HelpText},e.createElement("span",null,I("checkout-page:helpCtaQuestion")),e.createElement("span",{className:r.Cta,onClick:function(){return T.setContactModalVisible(!0)}},I("checkout-page:helpCta"))),e.createElement(o,{text:I("checkout-page:actions.backToShopping"),onClick:T.onBackToShoppingClick,style:{flex:"0 0 auto"}})))})),h=t((function(t){var o,a,s,i=t.vm,l=v().t,n=r.Yellow;switch(null===(o=i.order)||void 0===o?void 0:o.orderPackageStatus){case E.FULFILLED:case E.PARTIALLY_FULFILLED:case E.DELIVERED:case E.PARTIALLY_DELIVERED:n=r.Green;break;case E.CANCELLED:case E.PARTIALLY_CANCELLED:case E.CANCEL_REJECTED:case E.CANCEL_REQUESTED:n=r.Red}return e.createElement("div",{className:[r.OrderStatus,n].join(" ")},(null===(a=i.order)||void 0===a?void 0:a.orderPackageStatus)?null===(s=[{types:[E.UNFULFILLED],text:l("checkout-page:orderPackageStatus.unfulfilled")},{types:[E.READY_FOR_SHIPMENT],text:l("checkout-page:orderPackageStatus.readyForShipment")},{types:[E.PARTIALLY_FULFILLED],text:l("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[E.FULFILLED],text:l("checkout-page:orderPackageStatus.fulfilled")},{types:[E.DELIVERED,E.PARTIALLY_DELIVERED],text:l("checkout-page:orderPackageStatus.delivered")},{types:[E.UNABLE_TO_DELIVER],text:l("checkout-page:orderPackageStatus.unableToDeliver")},{types:[E.CANCELLED,E.PARTIALLY_CANCELLED],text:l("checkout-page:orderPackageStatus.cancelled")},{types:[E.CANCEL_REJECTED],text:l("checkout-page:orderPackageStatus.cancelRejected")},{types:[E.REFUNDED,E.PARTIALLY_REFUNDED],text:l("checkout-page:orderPackageStatus.refunded")},{types:[E.REFUND_REQUEST_ACCEPTED],text:l("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[E.REFUND_REJECTED],text:l("checkout-page:orderPackageStatus.refundRejected")},{types:[E.REFUND_REQUESTED],text:l("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(i.order.orderPackageStatus)})))||void 0===s?void 0:s.text:"")}));export{x as StepSuccess};
@@ -3,5 +3,5 @@
3
3
  * @param price Price to format
4
4
  * @param currency Code for the currency, USD, EUR, TRY, etc..
5
5
  */
6
- export declare const formatMoney: (price: number, currency: string) => string;
6
+ export declare const formatMoney: (price: number, currency: string, omitZeroDecimal?: boolean) => string;
7
7
  export declare function getCurrencySymbol(currencyCode: string): string;
@@ -1 +1 @@
1
- import{IkasStorefrontConfig as D}from"../storefront/index.js";var S=function(S,$){try{var r=R($);return r+" "+(K=",",B=".",M="\\d(?=(\\d{"+(3||3)+"})+"+((P=2)>0?"\\D":"$")+")",N=S.toFixed(Math.max(0,~~P)),(B?N.replace(".",B):N).replace(new RegExp(M,"g"),"$&"+(K||",")))}catch(R){return console.error(R),new Intl.NumberFormat(D.getCurrentLocale(),{style:"currency",currency:$||"TRY"}).format(S)}var P,K,B,M,N};function R(D){return $[D]||D}var $={TRY:"₺",USD:"$",EUR:"€",AZN:"₼",AED:"د.إ.",AFN:"؋",ALL:"L",AMD:"դր",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",BAM:"КМ",BBD:"$",BDT:"৳",BGN:"лв.",BHD:"د.ب.",BIF:"FBu",BMD:"$",BND:"$",BOB:"Bs.",BRL:"R$",BSD:"$",BTN:"Nu.",BWP:"P",BYN:"руб.",BZD:"$",CAD:"$",CDF:"₣",CHF:"₣",CKD:"$",CLP:"$",CNY:"¥元",COP:"$",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"ف.ج.",DKK:"kr.",DOP:"$",DZD:"د.ج.",EGP:"ج.م.",EHP:"Ptas.",ERN:"ناكفا",ETB:"ብር",FJD:"$",FKP:"£",FOK:"kr",GBP:"£",GEL:"₾",GGP:"£",GHS:"₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"$",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"د.ع.",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"$",JOD:"د.أ.",JPY:"¥",KES:"KSh",KGS:"с",KHR:"៛",KID:"$",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"د.ك.",KYD:"$",KZT:"₸",LAK:"₭",LBP:"ل.ل.",LKR:"රු or ரூ",LRD:"$",LSL:"L",LYD:"ل.د.",MAD:"د.م.",MDL:"L",MGA:"Ar",MKD:"ден",MMK:"Ks",MNT:"₮",MOP:"MOP$",MRU:"أ.م.",MUR:"रु ",MVR:".ރ",MWK:"MK",MXN:"$",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"रू",NZD:"$",OMR:"ر.ع.",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"Rs",PLN:"zł",PND:"$",PRB:"р.",PYG:"₲",QAR:"ر.ق.",RON:"L",RSD:"дин",RUB:"₽",RWF:"R₣",SAR:"ر.س.",SBD:"$",SCR:"Rs",SDG:"ج.س.",SEK:"kr",SGD:"$",SHP:"£",SLL:"Le",SLS:"Sl",SOS:"Ssh",SRD:"$",SSP:"SS£",STN:"Db",SVC:"₡",SYP:"ل.س.",SZL:"L",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت.",TOP:"PT",TTD:"$",TVD:"$",TWD:"圓",TZS:"TSh",UAH:"грн",UGX:"Sh",UYU:"$",UZS:"сум",VED:"Bs.",VES:"Bs.F",VND:"₫",VUV:"VT",WST:"ST",XAF:"Fr.",XCD:"$",XOF:"₣",XPF:"₣",YER:"ر.ي.",ZAR:"R",ZMW:"ZK",ZWB:"",ZWL:"$",Abkhazia:"",Artsakh:"դր."};export{S as formatMoney,R as getCurrencySymbol};
1
+ import{IkasStorefrontConfig as D}from"../storefront/index.js";var S=function(S,R,$){void 0===$&&($=!1);var P,K,B,M,N,L=r(R);try{var T=L+" "+(K=",",B=".",M="\\d(?=(\\d{"+(3||3)+"})+"+((P=2)>0?"\\D":"$")+")",N=S.toFixed(Math.max(0,~~P)),(B?N.replace(".",B):N).replace(new RegExp(M,"g"),"$&"+(K||",")));return $?function(D){var S=D.split(".");return"00"===S[S.length-1]?S[0]:D}(T):T}catch(r){return console.error(r),new Intl.NumberFormat(D.getCurrentLocale(),{style:"currency",currency:R||"TRY"}).format(S)}};function r(D){return R[D]||D}var R={TRY:"₺",USD:"$",EUR:"€",AZN:"₼",AED:"د.إ.",AFN:"؋",ALL:"L",AMD:"դր",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",BAM:"КМ",BBD:"$",BDT:"৳",BGN:"лв.",BHD:"د.ب.",BIF:"FBu",BMD:"$",BND:"$",BOB:"Bs.",BRL:"R$",BSD:"$",BTN:"Nu.",BWP:"P",BYN:"руб.",BZD:"$",CAD:"$",CDF:"₣",CHF:"₣",CKD:"$",CLP:"$",CNY:"¥元",COP:"$",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"ف.ج.",DKK:"kr.",DOP:"$",DZD:"د.ج.",EGP:"ج.م.",EHP:"Ptas.",ERN:"ناكفا",ETB:"ብር",FJD:"$",FKP:"£",FOK:"kr",GBP:"£",GEL:"₾",GGP:"£",GHS:"₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"$",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"د.ع.",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"$",JOD:"د.أ.",JPY:"¥",KES:"KSh",KGS:"с",KHR:"៛",KID:"$",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"د.ك.",KYD:"$",KZT:"₸",LAK:"₭",LBP:"ل.ل.",LKR:"රු or ரூ",LRD:"$",LSL:"L",LYD:"ل.د.",MAD:"د.م.",MDL:"L",MGA:"Ar",MKD:"ден",MMK:"Ks",MNT:"₮",MOP:"MOP$",MRU:"أ.م.",MUR:"रु ",MVR:".ރ",MWK:"MK",MXN:"$",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"रू",NZD:"$",OMR:"ر.ع.",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"Rs",PLN:"zł",PND:"$",PRB:"р.",PYG:"₲",QAR:"ر.ق.",RON:"L",RSD:"дин",RUB:"₽",RWF:"R₣",SAR:"ر.س.",SBD:"$",SCR:"Rs",SDG:"ج.س.",SEK:"kr",SGD:"$",SHP:"£",SLL:"Le",SLS:"Sl",SOS:"Ssh",SRD:"$",SSP:"SS£",STN:"Db",SVC:"₡",SYP:"ل.س.",SZL:"L",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت.",TOP:"PT",TTD:"$",TVD:"$",TWD:"圓",TZS:"TSh",UAH:"грн",UGX:"Sh",UYU:"$",UZS:"сум",VED:"Bs.",VES:"Bs.F",VND:"₫",VUV:"VT",WST:"ST",XAF:"Fr.",XCD:"$",XOF:"₣",XPF:"₣",YER:"ر.ي.",ZAR:"R",ZMW:"ZK",ZWB:"",ZWL:"$",Abkhazia:"",Artsakh:"դր."};export{S as formatMoney,r as getCurrencySymbol};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "2.0.56",
3
+ "version": "2.0.57",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.js",
6
6
  "author": "Umut Ozan Yıldırım",