@ikas/storefront 2.0.40 → 2.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/_virtual/index.js_commonjs-proxy2.js +1 -1
- package/build/_virtual/index.js_commonjs-proxy4.js +1 -1
- package/build/assets/translations/checkout/en.js +1 -1
- package/build/assets/translations/checkout/tr.js +1 -1
- package/build/components/checkout/components/address-form/index.js +1 -1
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/steps/step-info/index.js +1 -1
- package/build/components/page/head.d.ts +1 -1
- package/build/components/page/head.js +1 -1
- package/build/ikas.js +1 -1
- package/build/index.js +1 -1
- package/build/models/data/checkout/index.d.ts +1 -1
- package/build/models/data/checkout/index.js +1 -1
- package/build/utils/helper.d.ts +1 -0
- package/build/utils/helper.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from'../ext/split-on-first/index.js';export{default}from"../node_modules/split-on-first/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={actions:{login:"Login",edit:"Edit",apply:"Apply",close:"Close",cancel:"Cancel",save:"Save",continue:"Continue",show:"Show",hide:"Hide",sendMessage:"Send Message",continueWithShipping:"Continue with Shipping",continueWithPayment:"Continue with Payment",completeOrder:"Complete the Order",backToShopping:"Back to Shopping",backToCart:"Back to Cart"},securePayment:"Secure Payment",alreadyHaveAnAccount:"Already have an account?",address:"Address",addressError:"Enter address",missingAddressFields:"There are some missing required fields in this address.",editAddress:"Edit Address",deleteAddress:"Delete Address",saveAddressCta:"Save this address for future purchases",firstName:"Name",firstNameError:"Enter name",lastName:"Surname",lastNameError:"Enter surname",identityNumber:"Identity Number",identityNumberError:"Enter identity number",addressTitle:"Adress Title",adressTitleError:"Enter address title",addressLine2:"Address Second Line",postalCode:"Postal Code",postalCodeError:"Enter postal code",country:"Country",countryError:"Select country",state:"State",stateError:"Select state",city:"City",cityError:"Select city",district:"District",districtError:"Select district",phone:"Phone",phoneError:"Enter a valid phone number",companyName:"Company Name",taxOffice:"Tax Office",taxNumber:"Tax Number",shipping:"Shipping",payment:"Payment",summary:"Summary",free:"Free",standartShipping:"Standart Shipping",returnPolicy:"Return Policy",privacyPolicy:"Privacy Policy",termsOfService:"Terms of Service",newAddress:"New Address",billingAddress:"Billing Address",shippingAddress:"Shipping Address",corporateInvoice:"Corporate invoice",contactInfo:"Contact Information",email:"E-Mail",emailError:"Enter a valid e-mail",guestEmailTooltip:"Your order information will be sent to this e-mail address",customerConsentCta:"Contact me about the news and promotions",useShippingForBilling:"Use shipping address for billing",installmentOptions:"Installment Options",singleInstallment:"Single Payment",installments:"Installments",creditCard:"Credit Card",ackPrivacyPolicy:"Privacy Policy",ackTermsOfService:"Terms of Service",ackPoliciesSentence:"I acknowledge the {{ ackPrivacyPolicy }} and {{ ackTermsOfService }}.",securePaymentTooltip:"All payments are secure and encrypted",giftPackage:"Gift Package",giftPackageCta:"Gift wrap this order",giftPackageCtaPlaceholder:"Enter your gift message",paymentMethod:"Payment Method",paymentMethodDiscount:"Discount",paymentMethodAdditionalPrice:"Fee",orderSuccessTitle:"Thank you for your order!",orderSuccessDescription:"Dear {{ customerName }}, we have received your order. We will notify you when your order is shipped.",orderNoAndDate:"Order Number / Date",paymentSummary:"Payment Summary",shippingSummary:"Shipping Summary",helpCtaQuestion:"Do you need help?",helpCta:"Contact us",contactForm:"Contact Form",contactFormSent:"Message sent successfully",contactFormDescription:"We will respond to your message as soon as possible",contactFormCta:"Type your message",orderPackageStatus:{unfulfilled:"Unfulfilled",readyForShipment:"Ready For Shipment",fulfilled:"Fulfilled",partiallyFulfilled:"Partially Fulfilled",delivered:"Delivered",unableToDeliver:"Unable to Deliver",cancelled:"Cancelled",cancelRejected:"Cancel Rejected",cancelRequested:"Cancel Requested",refunded:"Refunded",refundRequestAccepted:"Refund Request Accepted",refundRejected:"Refund Rejected",refundRequested:"Refund Requested"},quantity:"Quantity",cartItemProduct:"product",giftCodeErrorTitle:"Gift Code Error",giftCodeErrorDescription:"The gift code you entered is not valid or not applicable to the products in your cart. Please check your code and try again.",subtotal:"Subtotal",total:"Total",subtotalTooltip:"Subtotal reflects the total for your cart before the discounts and does not include the shipping fees.",cartShippingTitle:"Delivery / Shipping",cartTaxTitle:"Tax",cartInterest:"Interest",couponCode:"Coupon Code",addCouponCode:"Add coupon code",addOrderNote:"Add order note",editOrderNote:"Edit order note",orderNote:"Order Note",enterPhoneNumber:"Enter phone number",cardNumber:"Card Number",cardNumberError:"Please enter a valid card number",cardHolderName:"Cardholder Name",cardHolderError:"Enter cardholder name",cardExpiry:"Month / Year",cardExpiryError:"Enter a valid date",cardCVC:"CVC",cardCVCError:"Enter a valid CVC",cardCVCTooltip:"CVC is the 3 digit number behind your card",errorCustomerRequired:"This e-mail address belongs to a registered user. Please login to your account.",errorNoShipping:"Your region is not available for shipping.",errorPayment:"Your payment could not be received. Please check your information and try again.",errorStockTitle:"Stock Update!",errorStockDescription:"Some items in your cart are out of stock. Would you like to continue by removing these products from your cart?",errorUnknown:"An unexpected error has occurred. Please try again.",customizedProduct:"Customized Product",yes:"Yes",no:"No"};export{e as default};
|
|
1
|
+
var e={actions:{login:"Login",edit:"Edit",apply:"Apply",close:"Close",cancel:"Cancel",save:"Save",continue:"Continue",show:"Show",hide:"Hide",sendMessage:"Send Message",continueWithShipping:"Continue with Shipping",continueWithPayment:"Continue with Payment",completeOrder:"Complete the Order",backToShopping:"Back to Shopping",backToCart:"Back to Cart"},securePayment:"Secure Payment",alreadyHaveAnAccount:"Already have an account?",address:"Address",addressError:"Enter address",missingAddressFields:"There are some missing required fields in this address.",editAddress:"Edit Address",deleteAddress:"Delete Address",saveAddressCta:"Save this address for future purchases",firstName:"Name",firstNameError:"Enter name",lastName:"Surname",lastNameError:"Enter surname",identityNumber:"Identity Number",identityNumberError:"Enter identity number",addressTitle:"Adress Title",adressTitleError:"Enter address title",addressLine1:"Address",addressLine2:"Address Second Line",postalCode:"Postal Code",postalCodeError:"Enter postal code",country:"Country",countryError:"Select country",state:"State",stateError:"Select state",city:"City",cityError:"Select city",district:"District",districtError:"Select district",phone:"Phone",phoneError:"Enter a valid phone number",companyName:"Company Name",taxOffice:"Tax Office",taxNumber:"Tax Number",shipping:"Shipping",payment:"Payment",summary:"Summary",free:"Free",standartShipping:"Standart Shipping",returnPolicy:"Return Policy",privacyPolicy:"Privacy Policy",termsOfService:"Terms of Service",newAddress:"New Address",billingAddress:"Billing Address",shippingAddress:"Shipping Address",corporateInvoice:"Corporate invoice",contactInfo:"Contact Information",email:"E-Mail",emailError:"Enter a valid e-mail",guestEmailTooltip:"Your order information will be sent to this e-mail address",customerConsentCta:"Contact me about the news and promotions",useShippingForBilling:"Use shipping address for billing",installmentOptions:"Installment Options",singleInstallment:"Single Payment",installments:"Installments",creditCard:"Credit Card",ackPrivacyPolicy:"Privacy Policy",ackTermsOfService:"Terms of Service",ackPoliciesSentence:"I acknowledge the {{ ackPrivacyPolicy }} and {{ ackTermsOfService }}.",securePaymentTooltip:"All payments are secure and encrypted",giftPackage:"Gift Package",giftPackageCta:"Gift wrap this order",giftPackageCtaPlaceholder:"Enter your gift message",paymentMethod:"Payment Method",paymentMethodDiscount:"Discount",paymentMethodAdditionalPrice:"Fee",orderSuccessTitle:"Thank you for your order!",orderSuccessDescription:"Dear {{ customerName }}, we have received your order. We will notify you when your order is shipped.",orderNoAndDate:"Order Number / Date",paymentSummary:"Payment Summary",shippingSummary:"Shipping Summary",helpCtaQuestion:"Do you need help?",helpCta:"Contact us",contactForm:"Contact Form",contactFormSent:"Message sent successfully",contactFormDescription:"We will respond to your message as soon as possible",contactFormCta:"Type your message",orderPackageStatus:{unfulfilled:"Unfulfilled",readyForShipment:"Ready For Shipment",fulfilled:"Fulfilled",partiallyFulfilled:"Partially Fulfilled",delivered:"Delivered",unableToDeliver:"Unable to Deliver",cancelled:"Cancelled",cancelRejected:"Cancel Rejected",cancelRequested:"Cancel Requested",refunded:"Refunded",refundRequestAccepted:"Refund Request Accepted",refundRejected:"Refund Rejected",refundRequested:"Refund Requested"},quantity:"Quantity",cartItemProduct:"product",giftCodeErrorTitle:"Gift Code Error",giftCodeErrorDescription:"The gift code you entered is not valid or not applicable to the products in your cart. Please check your code and try again.",subtotal:"Subtotal",total:"Total",subtotalTooltip:"Subtotal reflects the total for your cart before the discounts and does not include the shipping fees.",cartShippingTitle:"Delivery / Shipping",cartTaxTitle:"Tax",cartInterest:"Interest",couponCode:"Coupon Code",addCouponCode:"Add coupon code",addOrderNote:"Add order note",editOrderNote:"Edit order note",orderNote:"Order Note",enterPhoneNumber:"Enter phone number",cardNumber:"Card Number",cardNumberError:"Please enter a valid card number",cardHolderName:"Cardholder Name",cardHolderError:"Enter cardholder name",cardExpiry:"Month / Year",cardExpiryError:"Enter a valid date",cardCVC:"CVC",cardCVCError:"Enter a valid CVC",cardCVCTooltip:"CVC is the 3 digit number behind your card",errorCustomerRequired:"This e-mail address belongs to a registered user. Please login to your account.",errorNoShipping:"Your region is not available for shipping.",errorPayment:"Your payment could not be received. Please check your information and try again.",errorStockTitle:"Stock Update!",errorStockDescription:"Some items in your cart are out of stock. Would you like to continue by removing these products from your cart?",errorUnknown:"An unexpected error has occurred. Please try again.",customizedProduct:"Customized Product",yes:"Yes",no:"No"};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={actions:{login:"Giriş Yap",edit:"Düzenle",apply:"Uygula",close:"Kapat",cancel:"Vazgeç",save:"Kaydet",continue:"Devam Et",show:"Göster",hide:"Gizle",sendMessage:"Mesajı Gönder",continueWithShipping:"Kargo ile Devam Et",continueWithPayment:"Ödeme ile Devam Et",completeOrder:"Siparişi Tamamla",backToShopping:"Alışverişe Dön",backToCart:"Sepete Dön"},securePayment:"Güvenli Ödeme",alreadyHaveAnAccount:"Zaten hesabınız var mı?",address:"Adres",addressError:"Adres girin",missingAddressFields:"Adres bilgilerinde bazı zorunlu alanlar eksik.",editAddress:"Adres Düzenle",deleteAddress:"Adresi Sil",saveAddressCta:"Bir sonraki işlem için bu adresi kaydet",firstName:"Ad",firstNameError:"Ad girin",lastName:"Soyad",lastNameError:"Soyad girin",identityNumber:"TC Kimlik No",identityNumberError:"TC kimlik no girin",addressTitle:"Adres Başlığı",adressTitleError:"Adres başlığı girin",addressLine2:"Apartman, daire, vb.",postalCode:"Posta Kodu",postalCodeError:"Posta kodu girin",country:"Ülke",countryError:"Ülke seçin",state:"Eyalet",stateError:"Eyalet seçin",city:"İl",cityError:"İl seçin",district:"İlçe",districtError:"İlçe seçin",phone:"Telefon",phoneError:"Geçerli bir telefon girin",companyName:"Firma Adı",taxOffice:"Vergi Dairesi",taxNumber:"Vergi Numarası",shipping:"Kargo",payment:"Ödeme",summary:"Özet",free:"Ücretsiz",standartShipping:"Standart Kargo",returnPolicy:"Para İade Politikası",privacyPolicy:"Gizlilik Politikası",termsOfService:"Hizmet Şartları",newAddress:"Yeni Adres",billingAddress:"Fatura Adresi",shippingAddress:"Teslimat Adresi",corporateInvoice:"Kurumsal fatura",contactInfo:"İletişim Bilgileri",email:"E-Posta",emailError:"Geçerli bir e-posta girin",guestEmailTooltip:"Sipariş bilgileri bu e-posta adresine gönderilecektir",customerConsentCta:"Beni haberlerden ve özel tekliflerden haberdar et",useShippingForBilling:"Fatura adresim teslimat adresimle aynı",installmentOptions:"Taksit Seçenekleri",singleInstallment:"Tek Çekim",installments:"Taksit",creditCard:"Kredi Kartı",ackPrivacyPolicy:"Gizlilik Sözleşmesini",ackTermsOfService:"Satış Sözleşmesini",ackPoliciesSentence:"{{ ackPrivacyPolicy }} ve {{ ackTermsOfService }} okudum, onaylıyorum.",securePaymentTooltip:"Ödemeler güvenli ve şifrelidir",giftPackage:"Hediye Paketi",giftPackageCta:"Hediye paketi istiyorum",giftPackageCtaPlaceholder:"Hediye mesajınızı giriniz",paymentMethod:"Ödeme Yöntemi",paymentMethodDiscount:"İndirim",paymentMethodAdditionalPrice:"İşlem Bedeli",orderSuccessTitle:"Siparişiniz için teşekkür ederiz!",orderSuccessDescription:"Sevgili {{ customerName }}, siparişiniz bize ulaşmıştır. Siparişiniz kargoya verildiğinde sizi e-posta ile bilgilendireceğiz.",orderNoAndDate:"Sipariş No / Tarih",paymentSummary:"Ödeme Özeti",shippingSummary:"Teslimat Özeti",helpCtaQuestion:"Yardıma mı ihtiyacınız var?",helpCta:"Bizimle iletişime geçin",contactForm:"İletişim Formu",contactFormSent:"Mesaj başarıyla gönderildi",contactFormDescription:"Mesajınızla ilgili olarak size en kısa zamanda e-posta veya telefon aracılığıyla geri dönüş yapılacaktır.",contactFormCta:"Mesajınızı yazın",orderPackageStatus:{unfulfilled:"Oluşturuldu",readyForShipment:"Kargoya Hazır",fulfilled:"Gönderildi",partiallyFulfilled:"Kısmi Gönderildi",delivered:"Teslim Edildi",unableToDeliver:"Teslim Edilemedi",cancelled:"İptal Edildi",cancelRejected:"İptal Talebi Reddedildi",cancelRequested:"İptal İstendi",refunded:"İade Edildi",refundRequestAccepted:"İade Talebi Onaylandı",refundRejected:"İade Talebi Reddedildi",refundRequested:"İade Talep Edildi"},quantity:"Adet",cartItemProduct:"ürün",giftCodeErrorTitle:"İndirim Kodu Hatası",giftCodeErrorDescription:"İndirim kodunuz geçersiz veya sepetinizdeki ürünlere uygulanabilir değil. Lütfen kodunuzu kontrol edip tekrar deneyin.",subtotal:"Ara Toplam",total:"Toplam",subtotalTooltip:"Ara toplam, tüm geçerli indirimlerden önce siparişinizin toplam fiyatını yansıtır. kargo ücretini içermez.",cartShippingTitle:"Teslimat / Kargo",cartTaxTitle:"Vergi",cartInterest:"Vade Farkı",couponCode:"İndirim Kodu",addCouponCode:"İndirim kodu ekle",addOrderNote:"Sipariş notu ekle",editOrderNote:"Sipariş notu düzenle",orderNote:"Sipariş Notu",enterPhoneNumber:"Telefon numarası girin",cardNumber:"Kart Numarası",cardNumberError:"Geçerli bir kart numarası girin",cardHolderName:"Kart Üzerindeki İsim",cardHolderError:"Ad soyad girin",cardExpiry:"Ay / Yıl",cardExpiryError:"Geçerli bir tarih girin",cardCVC:"CVC",cardCVCError:"Geçerli bir güvenlik kodu girin",cardCVCTooltip:"Kartınızın arkasındaki 3 haneli güvenlik kodu",errorCustomerRequired:"Bu e-posta adresine ait kayıtlı bir hesap bulunuyor. Lütfen hesabınıza giriş yapınız.",errorNoShipping:"Bulunduğunuz konuma gönderim yapılmamaktadır.",errorPayment:"Ödemeniz alınamadı. Lütfen bilgilerinizi kontrol edip tekrar deneyin.",errorStockTitle:"Stoklar Güncellendi!",errorStockDescription:"Sepetinizdeki bazı ürünlerin stoğu tükenmiştir. Bu ürünleri sepetinizden çıkararak devam etmek ister misiniz?",errorUnknown:"Beklenmedik bir hata oluştu. Lütfen tekrar deneyin.",customizedProduct:"Kişiselleştirilmiş Ürün",yes:"Evet",no:"Hayır"};export{e as default};
|
|
1
|
+
var e={actions:{login:"Giriş Yap",edit:"Düzenle",apply:"Uygula",close:"Kapat",cancel:"Vazgeç",save:"Kaydet",continue:"Devam Et",show:"Göster",hide:"Gizle",sendMessage:"Mesajı Gönder",continueWithShipping:"Kargo ile Devam Et",continueWithPayment:"Ödeme ile Devam Et",completeOrder:"Siparişi Tamamla",backToShopping:"Alışverişe Dön",backToCart:"Sepete Dön"},securePayment:"Güvenli Ödeme",alreadyHaveAnAccount:"Zaten hesabınız var mı?",address:"Adres",addressError:"Adres girin",missingAddressFields:"Adres bilgilerinde bazı zorunlu alanlar eksik.",editAddress:"Adres Düzenle",deleteAddress:"Adresi Sil",saveAddressCta:"Bir sonraki işlem için bu adresi kaydet",firstName:"Ad",firstNameError:"Ad girin",lastName:"Soyad",lastNameError:"Soyad girin",identityNumber:"TC Kimlik No",identityNumberError:"TC kimlik no girin",addressTitle:"Adres Başlığı",adressTitleError:"Adres başlığı girin",addressLine1:"Adres",addressLine2:"Apartman, daire, vb.",postalCode:"Posta Kodu",postalCodeError:"Posta kodu girin",country:"Ülke",countryError:"Ülke seçin",state:"Eyalet",stateError:"Eyalet seçin",city:"İl",cityError:"İl seçin",district:"İlçe",districtError:"İlçe seçin",phone:"Telefon",phoneError:"Geçerli bir telefon girin",companyName:"Firma Adı",taxOffice:"Vergi Dairesi",taxNumber:"Vergi Numarası",shipping:"Kargo",payment:"Ödeme",summary:"Özet",free:"Ücretsiz",standartShipping:"Standart Kargo",returnPolicy:"Para İade Politikası",privacyPolicy:"Gizlilik Politikası",termsOfService:"Hizmet Şartları",newAddress:"Yeni Adres",billingAddress:"Fatura Adresi",shippingAddress:"Teslimat Adresi",corporateInvoice:"Kurumsal fatura",contactInfo:"İletişim Bilgileri",email:"E-Posta",emailError:"Geçerli bir e-posta girin",guestEmailTooltip:"Sipariş bilgileri bu e-posta adresine gönderilecektir",customerConsentCta:"Beni haberlerden ve özel tekliflerden haberdar et",useShippingForBilling:"Fatura adresim teslimat adresimle aynı",installmentOptions:"Taksit Seçenekleri",singleInstallment:"Tek Çekim",installments:"Taksit",creditCard:"Kredi Kartı",ackPrivacyPolicy:"Gizlilik Sözleşmesini",ackTermsOfService:"Satış Sözleşmesini",ackPoliciesSentence:"{{ ackPrivacyPolicy }} ve {{ ackTermsOfService }} okudum, onaylıyorum.",securePaymentTooltip:"Ödemeler güvenli ve şifrelidir",giftPackage:"Hediye Paketi",giftPackageCta:"Hediye paketi istiyorum",giftPackageCtaPlaceholder:"Hediye mesajınızı giriniz",paymentMethod:"Ödeme Yöntemi",paymentMethodDiscount:"İndirim",paymentMethodAdditionalPrice:"İşlem Bedeli",orderSuccessTitle:"Siparişiniz için teşekkür ederiz!",orderSuccessDescription:"Sevgili {{ customerName }}, siparişiniz bize ulaşmıştır. Siparişiniz kargoya verildiğinde sizi e-posta ile bilgilendireceğiz.",orderNoAndDate:"Sipariş No / Tarih",paymentSummary:"Ödeme Özeti",shippingSummary:"Teslimat Özeti",helpCtaQuestion:"Yardıma mı ihtiyacınız var?",helpCta:"Bizimle iletişime geçin",contactForm:"İletişim Formu",contactFormSent:"Mesaj başarıyla gönderildi",contactFormDescription:"Mesajınızla ilgili olarak size en kısa zamanda e-posta veya telefon aracılığıyla geri dönüş yapılacaktır.",contactFormCta:"Mesajınızı yazın",orderPackageStatus:{unfulfilled:"Oluşturuldu",readyForShipment:"Kargoya Hazır",fulfilled:"Gönderildi",partiallyFulfilled:"Kısmi Gönderildi",delivered:"Teslim Edildi",unableToDeliver:"Teslim Edilemedi",cancelled:"İptal Edildi",cancelRejected:"İptal Talebi Reddedildi",cancelRequested:"İptal İstendi",refunded:"İade Edildi",refundRequestAccepted:"İade Talebi Onaylandı",refundRejected:"İade Talebi Reddedildi",refundRequested:"İade Talep Edildi"},quantity:"Adet",cartItemProduct:"ürün",giftCodeErrorTitle:"İndirim Kodu Hatası",giftCodeErrorDescription:"İndirim kodunuz geçersiz veya sepetinizdeki ürünlere uygulanabilir değil. Lütfen kodunuzu kontrol edip tekrar deneyin.",subtotal:"Ara Toplam",total:"Toplam",subtotalTooltip:"Ara toplam, tüm geçerli indirimlerden önce siparişinizin toplam fiyatını yansıtır. kargo ücretini içermez.",cartShippingTitle:"Teslimat / Kargo",cartTaxTitle:"Vergi",cartInterest:"Vade Farkı",couponCode:"İndirim Kodu",addCouponCode:"İndirim kodu ekle",addOrderNote:"Sipariş notu ekle",editOrderNote:"Sipariş notu düzenle",orderNote:"Sipariş Notu",enterPhoneNumber:"Telefon numarası girin",cardNumber:"Kart Numarası",cardNumberError:"Geçerli bir kart numarası girin",cardHolderName:"Kart Üzerindeki İsim",cardHolderError:"Ad soyad girin",cardExpiry:"Ay / Yıl",cardExpiryError:"Geçerli bir tarih girin",cardCVC:"CVC",cardCVCError:"Geçerli bir güvenlik kodu girin",cardCVCTooltip:"Kartınızın arkasındaki 3 haneli güvenlik kodu",errorCustomerRequired:"Bu e-posta adresine ait kayıtlı bir hesap bulunuyor. Lütfen hesabınıza giriş yapınız.",errorNoShipping:"Bulunduğunuz konuma gönderim yapılmamaktadır.",errorPayment:"Ödemeniz alınamadı. Lütfen bilgilerinizi kontrol edip tekrar deneyin.",errorStockTitle:"Stoklar Güncellendi!",errorStockDescription:"Sepetinizdeki bazı ürünlerin stoğu tükenmiştir. Bu ürünleri sepetinizden çıkararak devam etmek ister misiniz?",errorUnknown:"Beklenmedik bir hata oluştu. Lütfen tekrar deneyin.",customizedProduct:"Kişiselleştirilmiş Ürün",yes:"Evet",no:"Hayır"};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from'../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as r}from"mobx-react-lite";import{FormItem as a}from"../form-item/index.js";import{FormItemType as o,FormItemInputType as n}from"../form-item/model.js";import i from"./model.js";import{IkasCheckoutRequirementEnum as l}from"../../../../models/data/checkout-settings/index.js";import{Checkbox as s}from"../checkbox/index.js";import c from"../../styles/common.module.scss.js";import d 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{useTranslation as m}from"../../../../utils/i18n.js";var u=r((function(r){var a,o=m().t,n=t.useMemo((function(){return new i(e({},r))}),[]);return t.useEffect((function(){Object.entries(r).forEach((function(e){n[e[0]]=e[1]}))}),Object.values(r)),t.createElement("div",null,n.allowTitleChange&&t.createElement("div",{className:d.RowPB},t.createElement(h,e({},r,{vm:n}))),t.createElement("div",{className:[c.Grid,c.Grid2].join(" ")},t.createElement(v,e({},r,{vm:n})),t.createElement(p,e({},r,{vm:n})),t.createElement("div",null)," "),!!n.address.checkoutSettings&&n.address.checkoutSettings.identityNumberRequirement!==l.INVISIBLE&&t.createElement("div",{className:d.RowPB},t.createElement(E,e({},r,{vm:n}))),(null===(a=n.address.checkoutSettings)||void 0===a?void 0:a.postalCodeRequirement)!==l.INVISIBLE?t.createElement(t.Fragment,null,t.createElement("div",{className:d.RowPB},t.createElement(g,e({},r,{vm:n}))),t.createElement("div",{className:[c.Grid,c.Grid2].join(" ")},t.createElement(C,e({},r,{vm:n})),t.createElement(y,e({},r,{vm:n})),t.createElement("div",null)," ")):t.createElement(t.Fragment,null,t.createElement("div",{className:d.RowPB},t.createElement(g,e({},r,{vm:n}))),t.createElement("div",{className:d.RowPB},t.createElement(C,e({},r,{vm:n})))),(n.countryOptions.length>1||n.hasState)&&t.createElement("div",{className:[d.RowPB,c.Grid,n.countryOptions.length>1&&n.hasState?c.Grid2:""].join(" ")},t.createElement(f,e({},r,{vm:n})),n.hasState&&t.createElement(T,e({},r,{vm:n}))),t.createElement("div",{className:[c.Grid,c.Grid2,d.RowPB].join(" ")},n.isFreeTextCity?t.createElement(k,e({},r,{vm:n})):t.createElement(b,e({},r,{vm:n})),n.districtOptions.length?t.createElement(N,e({},r,{vm:n})):t.createElement(x,e({},r,{vm:n}))),!!n.address.checkoutSettings&&n.address.checkoutSettings.phoneRequirement!==l.INVISIBLE&&t.createElement("div",null,t.createElement(j,e({},r,{vm:n}))),!!n.allowCorporateInfo&&t.createElement("div",{style:{marginTop:"12px"}},t.createElement(s,{value:n.isCorporate,label:o("checkout-page:corporateInvoice"),onChange:n.onCorporateChange})),!!n.isCorporate&&t.createElement("div",{className:c.Grid,style:{marginTop:"12px"}},t.createElement(R,e({},r,{vm:n})),t.createElement(L,e({},r,{vm:n})),t.createElement(S,e({},r,{vm:n}))))})),v=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:firstName"),autocomplete:"given-name",value:n.firstName||"",onChange:n.onFirstNameChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.firstName),errorText:i("checkout-page:firstNameError")})})),p=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:lastName"),autocomplete:"family-name",value:n.lastName||"",onChange:n.onLastNameChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.lastName),errorText:i("checkout-page:lastNameError")})})),E=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:identityNumber"),value:n.identityNumber||"",onChange:n.onIdentityNumberChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.identityNumber),errorText:i("checkout-page:identityNumberError")})})),h=r((function(e){var r=e.vm,n=m().t;return t.createElement(a,{type:o.TEXT,label:n("checkout-page:addressTitle"),value:r.address.title||"",onChange:r.onAddressTitleChange,hasError:r.isErrorsVisible&&!r.address.title,errorText:n("checkout-page:addressTitleError")})})),g=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:
|
|
1
|
+
import{__assign as e}from'../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as r}from"mobx-react-lite";import{FormItem as a}from"../form-item/index.js";import{FormItemType as o,FormItemInputType as n}from"../form-item/model.js";import i from"./model.js";import{IkasCheckoutRequirementEnum as l}from"../../../../models/data/checkout-settings/index.js";import{Checkbox as s}from"../checkbox/index.js";import c from"../../styles/common.module.scss.js";import d 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{useTranslation as m}from"../../../../utils/i18n.js";var u=r((function(r){var a,o=m().t,n=t.useMemo((function(){return new i(e({},r))}),[]);return t.useEffect((function(){Object.entries(r).forEach((function(e){n[e[0]]=e[1]}))}),Object.values(r)),t.createElement("div",null,n.allowTitleChange&&t.createElement("div",{className:d.RowPB},t.createElement(h,e({},r,{vm:n}))),t.createElement("div",{className:[c.Grid,c.Grid2].join(" ")},t.createElement(v,e({},r,{vm:n})),t.createElement(p,e({},r,{vm:n})),t.createElement("div",null)," "),!!n.address.checkoutSettings&&n.address.checkoutSettings.identityNumberRequirement!==l.INVISIBLE&&t.createElement("div",{className:d.RowPB},t.createElement(E,e({},r,{vm:n}))),(null===(a=n.address.checkoutSettings)||void 0===a?void 0:a.postalCodeRequirement)!==l.INVISIBLE?t.createElement(t.Fragment,null,t.createElement("div",{className:d.RowPB},t.createElement(g,e({},r,{vm:n}))),t.createElement("div",{className:[c.Grid,c.Grid2].join(" ")},t.createElement(C,e({},r,{vm:n})),t.createElement(y,e({},r,{vm:n})),t.createElement("div",null)," ")):t.createElement(t.Fragment,null,t.createElement("div",{className:d.RowPB},t.createElement(g,e({},r,{vm:n}))),t.createElement("div",{className:d.RowPB},t.createElement(C,e({},r,{vm:n})))),(n.countryOptions.length>1||n.hasState)&&t.createElement("div",{className:[d.RowPB,c.Grid,n.countryOptions.length>1&&n.hasState?c.Grid2:""].join(" ")},t.createElement(f,e({},r,{vm:n})),n.hasState&&t.createElement(T,e({},r,{vm:n}))),t.createElement("div",{className:[c.Grid,c.Grid2,d.RowPB].join(" ")},n.isFreeTextCity?t.createElement(k,e({},r,{vm:n})):t.createElement(b,e({},r,{vm:n})),n.districtOptions.length?t.createElement(N,e({},r,{vm:n})):t.createElement(x,e({},r,{vm:n}))),!!n.address.checkoutSettings&&n.address.checkoutSettings.phoneRequirement!==l.INVISIBLE&&t.createElement("div",null,t.createElement(j,e({},r,{vm:n}))),!!n.allowCorporateInfo&&t.createElement("div",{style:{marginTop:"12px"}},t.createElement(s,{value:n.isCorporate,label:o("checkout-page:corporateInvoice"),onChange:n.onCorporateChange})),!!n.isCorporate&&t.createElement("div",{className:c.Grid,style:{marginTop:"12px"}},t.createElement(R,e({},r,{vm:n})),t.createElement(L,e({},r,{vm:n})),t.createElement(S,e({},r,{vm:n}))))})),v=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:firstName"),autocomplete:"given-name",value:n.firstName||"",onChange:n.onFirstNameChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.firstName),errorText:i("checkout-page:firstNameError")})})),p=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:lastName"),autocomplete:"family-name",value:n.lastName||"",onChange:n.onLastNameChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.lastName),errorText:i("checkout-page:lastNameError")})})),E=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:identityNumber"),value:n.identityNumber||"",onChange:n.onIdentityNumberChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.identityNumber),errorText:i("checkout-page:identityNumberError")})})),h=r((function(e){var r=e.vm,n=m().t;return t.createElement(a,{type:o.TEXT,label:n("checkout-page:addressTitle"),value:r.address.title||"",onChange:r.onAddressTitleChange,hasError:r.isErrorsVisible&&!r.address.title,errorText:n("checkout-page:addressTitleError")})})),g=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:addressLine1"),autocomplete:"address-line1",value:n.address.addressLine1||"",onChange:n.onAddressLine1Change,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.addressLine1),errorText:i("checkout-page:addressError")})})),C=r((function(e){var r=e.vm,n=m().t;return t.createElement(a,{type:o.TEXT,autocomplete:"address-line2",label:n("checkout-page:addressLine2"),value:r.address.addressLine2||"",onChange:r.onAddressLine2Change})})),y=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:postalCode"),autocomplete:"postal-code",value:n.address.postalCode||"",onChange:n.onAddressPostalCodeChange,hasError:n.isErrorsVisible&&!(null===(r=n.address.validationResult)||void 0===r?void 0:r.postalCode),errorText:i("checkout-page:postalCodeError")})})),f=r((function(e){var r,n,i=e.vm,l=m().t;return i.countryOptions.length<=1?null:t.createElement(a,{type:o.SELECT,label:l("checkout-page:country"),autocomplete:"country-name",value:(null===(r=i.country)||void 0===r?void 0:r.id)||"",onChange:i.onCountryChange,options:i.countryOptions,hasError:i.isErrorsVisible&&!(null===(n=i.address.validationResult)||void 0===n?void 0:n.country),errorText:l("checkout-page:countryError")})})),T=r((function(e){var r,n,i=e.vm,l=m().t;return t.createElement(a,{type:o.SELECT,label:l("checkout-page:state"),value:(null===(r=i.state)||void 0===r?void 0:r.id)||"",onChange:i.onStateChange,options:i.stateOptions,hasError:i.isErrorsVisible&&!(null===(n=i.address.validationResult)||void 0===n?void 0:n.state),errorText:l("checkout-page:stateError")})})),b=r((function(e){var r,n,i=e.vm,l=m().t;return t.createElement(a,{type:o.SELECT,label:l("checkout-page:city"),autocomplete:"off",value:(null===(r=i.city)||void 0===r?void 0:r.id)||"",onChange:i.onCityChange,options:i.cityOptions,hasError:i.isErrorsVisible&&!(null===(n=i.address.validationResult)||void 0===n?void 0:n.city),errorText:l("checkout-page:cityError")})})),k=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,autocomplete:"address-level3",label:i("checkout-page:city"),value:(null===(r=n.city)||void 0===r?void 0:r.name)||"",onChange:n.onCityInputChange})})),N=r((function(e){var r,n,i=e.vm,l=m().t;return t.createElement(a,{type:o.SELECT,label:l("checkout-page:district"),autocomplete:"off",value:(null===(r=i.district)||void 0===r?void 0:r.id)||"",onChange:i.onDistrictChange,options:i.districtOptions,hasError:i.isErrorsVisible&&!(null===(n=i.address.validationResult)||void 0===n?void 0:n.district),errorText:l("checkout-page:districtError")})})),x=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,autocomplete:"address-level3",label:i("checkout-page:district"),value:(null===(r=n.district)||void 0===r?void 0:r.name)||"",onChange:n.onDistrictInputChange})})),j=r((function(e){var r,i=e.vm,l=m().t;return t.createElement(a,{type:o.TEL,inputType:n.TEL,label:l("checkout-page:phone"),autocomplete:"tel",value:i.phone||"",onChange:i.onPhoneChange,hasError:i.isErrorsVisible&&!(null===(r=i.address.validationResult)||void 0===r?void 0:r.phone),currentCountryCode:i.myCountryCode,errorText:l("checkout-page:phoneError")})})),R=r((function(e){var r=e.vm,n=m().t;return t.createElement(a,{type:o.TEXT,label:n("checkout-page:companyName"),value:r.address.company||"",onChange:r.onCompanyChange})})),L=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:taxOffice"),value:(null===(r=n.address)||void 0===r?void 0:r.taxOffice)||"",onChange:n.onTaxOfficeChange})})),S=r((function(e){var r,n=e.vm,i=m().t;return t.createElement(a,{type:o.TEXT,label:i("checkout-page:taxNumber"),value:(null===(r=n.address)||void 0===r?void 0:r.taxNumber)||"",onChange:n.onTaxNumberChange})}));export{u as AddressForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as i}from'../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import n from'../../ext/lodash/cloneDeep.js';import r from'../../ext/lodash/sortBy.js';import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import{IkasCheckout as o,IkasCheckoutCustomer as a}from"../../models/data/checkout/index.js";import{IkasCustomerAddress as c}from"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";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{IkasTransactionStatusEnum as d}from"../../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"../../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{IkasOrderAddress as u}from"../../models/data/order/address/index.js";import{IkasPaymentMethodType as h,IkasPaymentGatewayType as l}from"../../models/data/payment-gateway/index.js";import"../../api/blog/index.js";import"../../api/brand/index.js";import"../../api/cart/index.js";import"../../api/category/index.js";import{IkasCheckoutAPI as p}from"../../api/checkout/index.js";import"../../api/city/index.js";import{IkasCountryAPI as m}from"../../api/country/index.js";import{IkasCustomerAPI as f}from"../../api/customer/index.js";import"../../api/customer-review/index.js";import"../../api/customer-review-summary/index.js";import"../../api/district/index.js";import"../../api/html-meta-data/index.js";import{IkasMerchantAPI as g}from"../../api/merchant/index.js";import"../../api/product-search/index.js";import"../../api/apollo.js";import"../../api/favorite-product/index.js";import"../../api/contact-form/index.js";import"../../api/state/index.js";import"../../api/product-option-set/index.js";import"../../api/raffle/index.js";import"../../api/back-in-stock-reminder/index.js";import"../../api/product-campaign/index.js";import v from"./components/credit-card-form/model.js";import{IkasStorefrontConfig as k}from"../../storefront/index.js";import{IkasCheckoutSettings as S}from"../../models/data/checkout-settings/index.js";import{Analytics as y}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import b from'../../ext/uuid/dist/esm-browser/v4.js';var C,I,P=/^\d+$/,A="undefined"==typeof localStorage,j=function(){function P(P,j,R,x,E,O,T,D){var G=this;this.checkout=new o,this.checkoutSettings=new S,this.storefront=null,this.store=k.store,this.isCheckoutLoaded=!1,this.isErrorsVisible=!1,this.isStepLoading=!1,this.isTermsAndConditionsChecked=!1,this.isChangingShippingMethod=!1,this.isContactModalVisible=!1,this.step=C.INFO,this.cardData=null,this.paymentGateways=[],this.installmentInfo=null,this.useDifferentAddress=!1,this.shouldSaveAddress=!1,this.addressTitle="",this.shippingCountryIds=null,this.selectedShippingAddressId="-1",this.selectedBillingAddressId="-1",this.policyModalTitle="",this.policyModalText="",this.error=null,this.init=function(){return t(G,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,this.store.customerStore.waitUntilInitialized()];case 1:return t.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getMerchantSettings()];case 2:return t.sent(),[4,this.initStep()];case 3:return t.sent(),[2]}}))}))},this.initStep=function(){return t(G,void 0,void 0,(function(){var t,i,s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:if(k.isEditor)return this.step=C.INFO,this.isCheckoutLoaded=!0,[2];if(t=new URLSearchParams(window.location.search),i=t.get("step"),s=t.get("failed"),n=t.get("error"),i){if(this.step=i,this.step===C.SHIPPING&&!this.canProceedToShipping)return[2,this.changeStep(C.INFO)];if(this.step===C.PAYMENT&&!this.canProceedToPayment)return[2,this.changeStep(C.INFO)];if(![C.INFO,C.SUCCESS,C.SHIPPING,C.PAYMENT].includes(this.step))return[2,this.changeStep(C.INFO)]}return s&&(this.error={type:I.PAYMENT_ERROR,data:n||null}),this.step!==C.INFO?[3,2]:[4,this.getShippingCountries()];case 1:e.sent(),this.checkShippingCountries(),e.label=2;case 2:return this.step!==C.SHIPPING||1!==this.checkout.availableShippingMethods.length||this.checkoutSettings.isGiftPackageEnabled||(this.step=C.PAYMENT,this.router.replace("/checkout?id=".concat(this.checkout.id,"&step=").concat(this.step),void 0,{shallow:!0})),this.step!==C.SHIPPING||this.checkout.availableShippingMethods.length?this.step!==C.PAYMENT&&this.step!==C.SUCCESS?[3,4]:[4,this.listPaymentGateways()]:(this.error={type:I.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2]);case 3:if(e.sent(),!this.paymentGateways.length)return this.error={type:I.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2];e.label=4;case 4:return this.step===C.SUCCESS?[3,8]:this.checkout.isComplete?[2,this.changeStep(C.SUCCESS)]:[3,5];case 5:return[4,this.initialStockCheck()];case 6:e.sent(),e.label=7;case 7:return[3,11];case 8:return r=this,[4,p.getOrder(this.checkout.orderId)];case 9:return r.order=e.sent(),[4,f.getOrderTransactions({orderId:this.checkout.orderId})];case 10:o=e.sent(),this.successTransaction=o.length?o[0]:void 0,this.successTransaction&&(a=this.successTransaction.paymentGatewayId,this.checkout.selectedPaymentGateway=this.paymentGateways.find((function(t){return t.id===a}))),e.label=11;case 11:return this.isCheckoutLoaded=!0,y.checkoutStep(this.checkout,this.step),[2]}}))}))},this.getMerchantSettings=function(){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.merchantSettings?[3,2]:(t=this,[4,g.listMerchantSettings()]);case 1:t.merchantSettings=e.sent(),e.label=2;case 2:return[2]}}))}))},this.saveCheckout=function(){return t(G,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:return[4,p.saveCheckout(this.checkout)];case 1:if((null==(t=e.sent())?void 0:t.errors)&&t.errors.length)throw i=t.errors[0],"CUSTOMER_LOGIN_REQUIRED"===(null===(s=i.extensions)||void 0===s?void 0:s.code)?{type:I.CUSTOMER_LOGIN_REQUIRED_ERROR}:{type:I.API_ERROR};return[2]}}))}))},this.checkStocks=function(){return t(G,void 0,void 0,(function(){var t,i,s,n,r,o,a,c,d,u,h;return e(this,(function(e){switch(e.label){case 0:return t=this.cart.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,p.checkStocks(t,k.stockLocationIds||[])];case 1:if(!(i=e.sent()))throw{type:I.API_ERROR};if(null==(s=null===(u=i.lines)||void 0===u?void 0:u.filter((function(t){return!t.isAvailable})))?void 0:s.length){for(n=[],r=function(t){var e=null===(h=o.store.cartStore.cart)||void 0===h?void 0:h.items.find((function(e){return e.variant.id===t.variantId}));e&&n.push(e)},o=this,a=0,c=s;a<c.length;a++)d=c[a],r(d);throw{type:I.STOCK_ERROR,data:n}}return[2]}}))}))},this.removeUnavailableItems=function(i){return t(G,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:t=0,s=i,e.label=1;case 1:return t<s.length?(n=s[t],[4,this.store.cartStore.removeItem(n)]):[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},this.getShippingCountries=function(){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t=this,[4,m.listShippingCountries(k.salesChannelId)];case 1:return t.shippingCountryIds=e.sent(),[2]}}))}))},this.checkShippingCountries=function(){var t;(null===(t=G.shippingCountryIds)||void 0===t?void 0:t.length)||(G.error={type:I.NO_SHIPPING_ERROR})},this.initialStockCheck=function(){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.checkStocks()];case 1:return e.sent(),[3,3];case 2:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:I.UNKNOWN}),[3,3];case 3:return[2]}}))}))},this.listPaymentGateways=function(){return t(G,void 0,void 0,(function(){var t,i,s,n,o,a,c=this;return e(this,(function(e){switch(e.label){case 0:return t="local"===process.env.NEXT_PUBLIC_ENV,i=k.paymentGateways.map((function(t){return t.id})),[4,p.listPaymentGateway(t?void 0:i)];case 1:return(s=e.sent())&&s.length?(this.step===C.PAYMENT&&(s=s.filter((function(t){return!t.supportedCurrencies.length||t.supportedCurrencies.includes(c.checkout.cart.currencyCode)})),(n=null===(a=this.checkout.shippingAddress)||void 0===a?void 0:a.country)&&n.iso2&&(s=s.filter((function(t){return!t.availableCountries.length||t.availableCountries.includes(n.iso2||"")})))),o=[],r(k.paymentGateways,"order").forEach((function(t){var e=null==s?void 0:s.find((function(e){return e.id===t.id}));e&&o.push(e)})),this.paymentGateways=t?s:o,this.checkout.selectedPaymentGateway||this.setPaymentGateway(0),[2]):(this.error={type:I.API_ERROR},[2])}}))}))},this.retrieveInstallmentInfo=function(i){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p.retrieveInstallmentInfo(i)];case 1:return null==(t=e.sent())||t.installmentPrices.sort((function(t,e){return(t.installmentCount||-1)>(e.installmentCount||-1)?1:-1})),this.installmentInfo=t,[2]}}))}))},this.createCustomer=function(){G.store.customerStore.customer?(G.store.customerStore.customer.addresses.forEach((function(t){return t.checkoutSettings=G.checkoutSettings})),G.checkout.customer=new a(G.store.customerStore.customer)):G.checkout.customer||(G.checkout.customer=new a({}))},this.createShippingAddress=function(){var t;if(G.checkout.shippingAddress)G.selectedShippingAddressId=G.checkout.shippingAddress.id||"-1",G.checkout.shippingAddress.checkoutSettings=G.checkoutSettings;else{var e=null===(t=G.store.customerStore.customer)||void 0===t?void 0:t.addresses;G.onSelectedShippingAddressIdChange((null==e?void 0:e.length)?e[0].id:"-1")}},this.createBillingAddress=function(){"undefined"!=typeof localStorage&&(G.useDifferentAddress=!!localStorage.getItem("sAddr"),G.useDifferentAddress?(G.checkout.billingAddress&&(G.selectedBillingAddressId=G.checkout.billingAddress.id||"-1"),G.checkout.billingAddress=G.checkout.billingAddress||new u):G.checkout.billingAddress=new u(n(G.checkout.shippingAddress)||{}),G.checkout.billingAddress.checkoutSettings=G.checkoutSettings)},this.onShippingMethodChange=function(i){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isChangingShippingMethod?[2]:(this.isChangingShippingMethod=!0,this.checkout.shippingSettingsId=i.shippingSettingsId,this.checkout.shippingZoneRateId=i.shippingZoneRateId,[4,this.saveCheckout()]);case 1:return e.sent(),[4,p.getCheckoutById(this.checkout.id)];case 2:return(t=e.sent())&&(this.checkout=t),this.isChangingShippingMethod=!1,[2]}}))}))},this.onCouponCodeApply=function(){return t(G,void 0,void 0,(function(){var t,s,n,r,a;return e(this,(function(e){switch(e.label){case 0:if(!this.checkout.couponCode)return[2];e.label=1;case 1:return e.trys.push([1,7,,8]),[4,p.addCouponCodeToCheckout(this.checkout.id,this.checkout.couponCode)];case 2:return e.sent()?[4,p.getCheckoutById(this.checkout.id)]:[3,6];case 3:return(t=e.sent())?(s=null===(a=null===(r=this.cardData)||void 0===r?void 0:r.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.step===C.PAYMENT&&(null==s?void 0:s.length)&&s.length>=6?[4,this.retrieveInstallmentInfo({binNumber:s.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:t.totalFinalPrice})]:[3,5]):[3,6];case 4:e.sent(),e.label=5;case 5:n=this.checkout,this.checkout=new o(i(i({},t),{shippingAddress:n.shippingAddress,billingAddress:n.billingAddress,customer:n.customer,selectedPaymentGateway:n.selectedPaymentGateway})),e.label=6;case 6:return[3,8];case 7:return e.sent(),[3,8];case 8:return[2]}}))}))},this.onCouponCodeDelete=function(){return t(G,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,this.saveCheckout()];case 1:return e.sent(),[4,p.getCheckoutById(this.checkout.id)];case 2:return(t=e.sent())&&(s=this.checkout,this.checkout=new o(i(i({},t),{shippingAddress:s.shippingAddress,billingAddress:s.billingAddress,customer:s.customer,selectedPaymentGateway:s.selectedPaymentGateway}))),[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},this.onSelectedShippingAddressIdChange=function(t){var e;if(G.selectedShippingAddressId=t,"-1"===t)G.checkout.shippingAddress=new u;else{var i=null===(e=G.store.customerStore.customer)||void 0===e?void 0:e.addresses.find((function(e){return e.id===t}));i&&(G.checkout.shippingAddress=new u(i))}G.checkout.shippingAddress&&(G.checkout.shippingAddress.checkoutSettings=G.checkoutSettings)},this.onSelectedBillingAddressIdChange=function(t){var e;if(G.selectedBillingAddressId=t,"-1"===t)G.checkout.billingAddress=new u;else{var i=null===(e=G.store.customerStore.customer)||void 0===e?void 0:e.addresses.find((function(e){return e.id===t}));i&&(G.checkout.billingAddress=new u(i))}G.checkout.billingAddress&&(G.checkout.billingAddress.checkoutSettings=G.checkoutSettings)},this.onTermsAndConditionsCheckedChange=function(t){G.isTermsAndConditionsChecked=t},this.onCardNumberChange=function(t){if(G.cardData&&(!(t.length>G.cardData.cardNumber.length)||N(t))){var e=(G.cardData.cardNumber||"").split(" ").join(""),i=t.split(" ").join("");i.length>16||(e.length<6&&i.length>=6&&!G.installmentInfo?G.retrieveInstallmentInfo({binNumber:i.slice(0,6),paymentGatewayId:G.checkout.selectedPaymentGateway.id,price:G.checkout.totalFinalPrice}):i.length<6&&e.length>i.length&&(G.cardData.installmentCount=1,G.installmentInfo=void 0),G.cardData.cardNumber=w(i,4).join(" "))}},this.onCardHolderNameChange=function(t){G.cardData&&(G.cardData.cardHolderName=t)},this.onExpirationDateChange=function(t){var e;if(G.cardData&&(!(t.length>G.cardData.expirationDate.length)||N(t))){if(0===(null===(e=G.cardData.expirationDate)||void 0===e?void 0:e.length)){var i=t.split("/");if(2===i.length){var s=i[0].trim(),n=i[1].trim();if(4===s.length&&2===n.length){var r=parseInt(s.slice(2)),o=parseInt(n);if(!isNaN(r)&&!isNaN(o))return void(G.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&4===n.length){o=parseInt(s),r=parseInt(n.slice(2));if(!isNaN(r)&&!isNaN(o))return void(G.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}}}var a=t.split(" / ").join("");a.length>4||(G.cardData.expirationDate=w(a,2).join(" / "))}},this.onCvcChange=function(t){G.cardData&&(t.length>G.cardData.cvv.length&&!N(t)||t.length>4||(G.cardData.cvv=t))},this.saveAddress=function(s){return t(G,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return this.shouldSaveAddress?(t=new c(i(i({},"shipping"===s?this.checkout.shippingAddress:this.checkout.billingAddress),{title:this.addressTitle||this.t("checkout-page:newAddress"),id:b()})),(r=n(this.store.customerStore.customer)).addresses.push(t),[4,this.store.customerStore.saveCustomer(r)]):[3,2];case 1:e.sent(),"shipping"===s?(this.checkout.shippingAddress.id=t.id,this.selectedShippingAddressId=t.id||"-1"):(this.checkout.billingAddress.id=t.id,this.selectedBillingAddressId=t.id||"-1"),e.label=2;case 2:return[2]}}))}))},this.onGoToCartClick=function(){G.router.push("/cart")},this.onBackToShoppingClick=function(){G.router.push("/")},this.onProceedToShippingClick=function(){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToShipping)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,5,,6]),this.isStepLoading=!0,[4,this.saveAddress("shipping")];case 2:return e.sent(),[4,this.checkStocks()];case 3:return e.sent(),[4,this.saveCheckout()];case 4:return e.sent(),this.changeStep(C.SHIPPING),[3,6];case 5:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:I.UNKNOWN}),this.isStepLoading=!1,[3,6];case 6:return[2]}}))}))},this.onProceedToPaymentClick=function(){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCheckout()];case 3:return e.sent(),this.error=void 0,this.changeStep(C.PAYMENT),[3,5];case 4:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:I.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.onCompletePaymentClick=function(){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canPerformPayment)return this.isErrorsVisible=!0,[2];this.useDifferentAddress||(this.checkout.billingAddress=this.checkout.shippingAddress),e.label=1;case 1:return e.trys.push([1,6,,7]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveAddress("billing")];case 3:return e.sent(),[4,this.saveCheckout()];case 4:return e.sent(),[4,this.createSaleTransaction()];case 5:return e.sent(),[3,7];case 6:return(t=e.sent()).type?this.error=t:this.error={type:I.UNKNOWN},this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.createSaleTransaction=function(){return t(G,void 0,void 0,(function(){var t,i,s,n;return e(this,(function(e){switch(e.label){case 0:return this.checkout.selectedPaymentGateway?[4,p.createSaleTransactionWithCheckout(this.checkout.id,this.checkout.selectedPaymentGateway.id,this.checkout.selectedPaymentGateway.paymentMethodType===h.CREDIT_CARD&&this.checkout.selectedPaymentGateway.type===l.INTERNAL&&this.cardData?this.cardData.toInput():void 0)]:[2];case 1:return t=e.sent(),i=null==t?void 0:t.transactionStatus,s=i&&[d.SUCCESS,d.AUTHORIZED].includes(i),n=i===d.PENDING,s?[4,this.onCheckoutTransactionSuccess()]:[3,3];case 2:return e.sent(),[3,4];case 3:if(!n||!(null==t?void 0:t.returnSlug))throw{type:I.UNKNOWN};window.location.href=process.env.NEXT_PUBLIC_BASE_URL+t.returnSlug,e.label=4;case 4:return[2]}}))}))},this.onCheckoutTransactionSuccess=function(){return t(G,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return localStorage.removeItem("sAddr"),(null===(t=this.checkout.customer)||void 0===t?void 0:t.notificationsAccepted)?[4,this.store.customerStore.createEmailSubscription((null===(i=this.checkout.customer)||void 0===i?void 0:i.email)||"")]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.changeStep(C.SUCCESS),[2]}}))}))},this.onBackToInfoClick=function(){G.changeStep(C.INFO)},this.onBackToShippingClick=function(){G.changeStep(C.SHIPPING)},this.setCustomerConsentGranted=function(t){G.checkout.customer&&(G.checkout.customer.notificationsAccepted=t)},this.setUseDifferentAddress=function(t){G.useDifferentAddress=t,G.useDifferentAddress?(localStorage.setItem("sAddr","1"),G.checkout.billingAddress=G.checkout.billingAddress||new u):(localStorage.removeItem("sAddr"),G.checkout.billingAddress=G.checkout.shippingAddress)},this.setShouldSaveAddress=function(t){G.shouldSaveAddress=t},this.setAddressTitle=function(t){G.addressTitle=t},this.setPaymentGateway=function(t){if(G.paymentGateways.length){var e=G.paymentGateways[t];G.checkout.selectedPaymentGateway=e,G.step!==C.SUCCESS&&(e.paymentMethodType===h.CREDIT_CARD&&e.type===l.INTERNAL&&(G.cardData=new v),G.installmentInfo=void 0)}},this.setInstallmentCount=function(t){G.cardData&&(G.cardData.installmentCount=t)},this.changeStep=function(i){return t(G,void 0,void 0,(function(){return e(this,(function(t){return A||window.location.replace("".concat(window.location.pathname,"?id=").concat(this.checkout.id,"&step=").concat(i)),[2]}))}))},this.logout=function(){return t(G,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:this.checkout.customer=void 0,this.store.customerStore.logout(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.saveCheckout()];case 2:case 3:return t.sent(),[3,4];case 4:return this.createCustomer(),[2]}}))}))},this.setContactModalVisible=function(t){G.isContactModalVisible=t},this.checkout=P,this.checkoutSettings=j,this.router=x,this.returnPolicy=E,this.privacyPolicy=O,this.termsOfService=T,this.t=D,R&&(this.merchantSettings=R),this.isTermsAndConditionsChecked=this.checkoutSettings.isTermsAndConditionsDefaultChecked,this.store.cartStore.cart=this.checkout.cart,this.init(),s(this)}return Object.defineProperty(P.prototype,"cart",{get:function(){return this.checkout.cart},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"selectedPaymentGatewayIndex",{get:function(){var t=this;return this.paymentGateways.findIndex((function(e){var i;return e.id===(null===(i=t.checkout.selectedPaymentGateway)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"selectedInstallmentIndex",{get:function(){var t,e=this;return(null===(t=this.installmentInfo)||void 0===t?void 0:t.installmentPrices.findIndex((function(t){var i;return t.installmentCount===(null===(i=e.cardData)||void 0===i?void 0:i.installmentCount)})))||0},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"checkoutUrl",{get:function(){return"/checkout?id=".concat(this.checkout.id,"&step=info")},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"customerAddressOptions",{get:function(){var t,e={label:this.t("checkout-page:newAddress"),value:"-1"},i=(null===(t=this.store.customerStore.customer)||void 0===t?void 0:t.addresses.map((function(t){return{label:t.title+" - "+t.addressText,value:t.id}})))||[];return[e].concat(i)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"installmentPrice",{get:function(){var t,e,i=this;if(this.installmentInfo&&(null===(t=this.cardData)||void 0===t?void 0:t.installmentCount))return null===(e=this.installmentInfo.installmentPrices.find((function(t){var e;return t.installmentCount===(null===(e=i.cardData)||void 0===e?void 0:e.installmentCount)})))||void 0===e?void 0:e.totalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"installmentExtraPrice",{get:function(){if(this.installmentPrice&&this.checkout.totalFinalPrice)return this.installmentPrice-this.checkout.totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"finalPrice",{get:function(){return this.step===C.SUCCESS?this.order?this.order.totalFinalPrice:this.checkout.totalFinalPrice:this.installmentPrice||this.checkout.$totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"hasStockError",{get:function(){var t;return(null===(t=this.error)||void 0===t?void 0:t.type)===I.STOCK_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"canProceedToShipping",{get:function(){var t,e;return(null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.isValid)&&this.checkout.hasValidCustomer&&(null===(e=this.error)||void 0===e?void 0:e.type)!==I.NO_SHIPPING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"canProceedToPayment",{get:function(){return this.canProceedToShipping},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"canPerformPayment",{get:function(){var t,e;if(this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return!1;var i=this.checkout.selectedPaymentGateway;return this.canProceedToShipping&&!!(null===(t=this.checkout.billingAddress)||void 0===t?void 0:t.isValid)&&((null==i?void 0:i.paymentMethodType)===h.CREDIT_CARD&&i.type===l.INTERNAL?null===(e=this.cardData)||void 0===e?void 0:e.isValid:!!i)},enumerable:!1,configurable:!0}),P}();function w(t,e){return t.match(new RegExp(".{1,"+e+"}","g"))||[]}function N(t){return t&&P.test(t.charAt(t.length-1))}!function(t){t.INFO="info",t.SHIPPING="shipping",t.PAYMENT="payment",t.SUCCESS="success"}(C||(C={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.API_ERROR=1]="API_ERROR",t[t.STOCK_ERROR=2]="STOCK_ERROR",t[t.PAYMENT_ERROR=3]="PAYMENT_ERROR",t[t.NO_SHIPPING_ERROR=4]="NO_SHIPPING_ERROR",t[t.CUSTOMER_LOGIN_REQUIRED_ERROR=5]="CUSTOMER_LOGIN_REQUIRED_ERROR"}(I||(I={}));export{C as CheckoutStep,I as ErrorType,j as default};
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as i}from'../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import n from'../../ext/lodash/cloneDeep.js';import r from'../../ext/lodash/sortBy.js';import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import{IkasCheckout as o,IkasCheckoutCustomer as a}from"../../models/data/checkout/index.js";import{IkasCustomerAddress as c}from"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";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{IkasTransactionStatusEnum as d}from"../../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"../../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{IkasOrderAddress as u}from"../../models/data/order/address/index.js";import{IkasPaymentMethodType as h,IkasPaymentGatewayType as l}from"../../models/data/payment-gateway/index.js";import"../../api/blog/index.js";import"../../api/brand/index.js";import"../../api/cart/index.js";import"../../api/category/index.js";import{IkasCheckoutAPI as p}from"../../api/checkout/index.js";import"../../api/city/index.js";import{IkasCountryAPI as m}from"../../api/country/index.js";import{IkasCustomerAPI as f}from"../../api/customer/index.js";import"../../api/customer-review/index.js";import"../../api/customer-review-summary/index.js";import"../../api/district/index.js";import"../../api/html-meta-data/index.js";import{IkasMerchantAPI as g}from"../../api/merchant/index.js";import"../../api/product-search/index.js";import"../../api/apollo.js";import"../../api/favorite-product/index.js";import"../../api/contact-form/index.js";import"../../api/state/index.js";import"../../api/product-option-set/index.js";import"../../api/raffle/index.js";import"../../api/back-in-stock-reminder/index.js";import"../../api/product-campaign/index.js";import v from"./components/credit-card-form/model.js";import{IkasStorefrontConfig as k}from"../../storefront/index.js";import{IkasCheckoutSettings as S}from"../../models/data/checkout-settings/index.js";import{Analytics as y}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import b from'../../ext/uuid/dist/esm-browser/v4.js';var C,I,P=/^\d+$/,A="undefined"==typeof localStorage,j=function(){function P(P,j,R,x,E,O,T,D){var G=this;this.checkout=new o,this.checkoutSettings=new S,this.storefront=null,this.store=k.store,this.isCheckoutLoaded=!1,this.isErrorsVisible=!1,this.isStepLoading=!1,this.isTermsAndConditionsChecked=!1,this.isChangingShippingMethod=!1,this.isContactModalVisible=!1,this.step=C.INFO,this.cardData=null,this.paymentGateways=[],this.installmentInfo=null,this.useDifferentAddress=!1,this.shouldSaveAddress=!0,this.addressTitle="",this.shippingCountryIds=null,this.selectedShippingAddressId="-1",this.selectedBillingAddressId="-1",this.policyModalTitle="",this.policyModalText="",this.error=null,this.init=function(){return t(G,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,this.store.customerStore.waitUntilInitialized()];case 1:return t.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getMerchantSettings()];case 2:return t.sent(),[4,this.initStep()];case 3:return t.sent(),[2]}}))}))},this.initStep=function(){return t(G,void 0,void 0,(function(){var t,i,s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:if(k.isEditor)return this.step=C.INFO,this.isCheckoutLoaded=!0,[2];if(t=new URLSearchParams(window.location.search),i=t.get("step"),s=t.get("failed"),n=t.get("error"),i){if(this.step=i,this.step===C.SHIPPING&&!this.canProceedToShipping)return[2,this.changeStep(C.INFO)];if(this.step===C.PAYMENT&&!this.canProceedToPayment)return[2,this.changeStep(C.INFO)];if(![C.INFO,C.SUCCESS,C.SHIPPING,C.PAYMENT].includes(this.step))return[2,this.changeStep(C.INFO)]}return s&&(this.error={type:I.PAYMENT_ERROR,data:n||null}),this.step!==C.INFO?[3,2]:[4,this.getShippingCountries()];case 1:e.sent(),this.checkShippingCountries(),e.label=2;case 2:return this.step!==C.SHIPPING||1!==this.checkout.availableShippingMethods.length||this.checkoutSettings.isGiftPackageEnabled||(this.step=C.PAYMENT,this.router.replace("/checkout?id=".concat(this.checkout.id,"&step=").concat(this.step),void 0,{shallow:!0})),this.step!==C.SHIPPING||this.checkout.availableShippingMethods.length?this.step!==C.PAYMENT&&this.step!==C.SUCCESS?[3,4]:[4,this.listPaymentGateways()]:(this.error={type:I.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2]);case 3:if(e.sent(),!this.paymentGateways.length)return this.error={type:I.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2];e.label=4;case 4:return this.step===C.SUCCESS?[3,8]:this.checkout.isComplete?[2,this.changeStep(C.SUCCESS)]:[3,5];case 5:return[4,this.initialStockCheck()];case 6:e.sent(),e.label=7;case 7:return[3,11];case 8:return r=this,[4,p.getOrder(this.checkout.orderId)];case 9:return r.order=e.sent(),[4,f.getOrderTransactions({orderId:this.checkout.orderId})];case 10:o=e.sent(),this.successTransaction=o.length?o[0]:void 0,this.successTransaction&&(a=this.successTransaction.paymentGatewayId,this.checkout.selectedPaymentGateway=this.paymentGateways.find((function(t){return t.id===a}))),e.label=11;case 11:return this.isCheckoutLoaded=!0,y.checkoutStep(this.checkout,this.step),[2]}}))}))},this.getMerchantSettings=function(){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.merchantSettings?[3,2]:(t=this,[4,g.listMerchantSettings()]);case 1:t.merchantSettings=e.sent(),e.label=2;case 2:return[2]}}))}))},this.saveCheckout=function(){return t(G,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:return[4,p.saveCheckout(this.checkout)];case 1:if((null==(t=e.sent())?void 0:t.errors)&&t.errors.length)throw i=t.errors[0],"CUSTOMER_LOGIN_REQUIRED"===(null===(s=i.extensions)||void 0===s?void 0:s.code)?{type:I.CUSTOMER_LOGIN_REQUIRED_ERROR}:{type:I.API_ERROR};return[2]}}))}))},this.checkStocks=function(){return t(G,void 0,void 0,(function(){var t,i,s,n,r,o,a,c,d,u,h;return e(this,(function(e){switch(e.label){case 0:return t=this.cart.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,p.checkStocks(t,k.stockLocationIds||[])];case 1:if(!(i=e.sent()))throw{type:I.API_ERROR};if(null==(s=null===(u=i.lines)||void 0===u?void 0:u.filter((function(t){return!t.isAvailable})))?void 0:s.length){for(n=[],r=function(t){var e=null===(h=o.store.cartStore.cart)||void 0===h?void 0:h.items.find((function(e){return e.variant.id===t.variantId}));e&&n.push(e)},o=this,a=0,c=s;a<c.length;a++)d=c[a],r(d);throw{type:I.STOCK_ERROR,data:n}}return[2]}}))}))},this.removeUnavailableItems=function(i){return t(G,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:t=0,s=i,e.label=1;case 1:return t<s.length?(n=s[t],[4,this.store.cartStore.removeItem(n)]):[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},this.getShippingCountries=function(){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t=this,[4,m.listShippingCountries(k.salesChannelId)];case 1:return t.shippingCountryIds=e.sent(),[2]}}))}))},this.checkShippingCountries=function(){var t;(null===(t=G.shippingCountryIds)||void 0===t?void 0:t.length)||(G.error={type:I.NO_SHIPPING_ERROR})},this.initialStockCheck=function(){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.checkStocks()];case 1:return e.sent(),[3,3];case 2:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:I.UNKNOWN}),[3,3];case 3:return[2]}}))}))},this.listPaymentGateways=function(){return t(G,void 0,void 0,(function(){var t,i,s,n,o,a,c=this;return e(this,(function(e){switch(e.label){case 0:return t="local"===process.env.NEXT_PUBLIC_ENV,i=k.paymentGateways.map((function(t){return t.id})),[4,p.listPaymentGateway(t?void 0:i)];case 1:return(s=e.sent())&&s.length?(this.step===C.PAYMENT&&(s=s.filter((function(t){return!t.supportedCurrencies.length||t.supportedCurrencies.includes(c.checkout.cart.currencyCode)})),(n=null===(a=this.checkout.shippingAddress)||void 0===a?void 0:a.country)&&n.iso2&&(s=s.filter((function(t){return!t.availableCountries.length||t.availableCountries.includes(n.iso2||"")})))),o=[],r(k.paymentGateways,"order").forEach((function(t){var e=null==s?void 0:s.find((function(e){return e.id===t.id}));e&&o.push(e)})),this.paymentGateways=t?s:o,this.checkout.selectedPaymentGateway||this.setPaymentGateway(0),[2]):(this.error={type:I.API_ERROR},[2])}}))}))},this.retrieveInstallmentInfo=function(i){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p.retrieveInstallmentInfo(i)];case 1:return null==(t=e.sent())||t.installmentPrices.sort((function(t,e){return(t.installmentCount||-1)>(e.installmentCount||-1)?1:-1})),this.installmentInfo=t,[2]}}))}))},this.createCustomer=function(){G.store.customerStore.customer?(G.store.customerStore.customer.addresses.forEach((function(t){return t.checkoutSettings=G.checkoutSettings})),G.checkout.customer=new a(G.store.customerStore.customer)):G.checkout.customer||(G.checkout.customer=new a({}))},this.createShippingAddress=function(){var t;if(G.checkout.shippingAddress)G.selectedShippingAddressId=G.checkout.shippingAddress.id||"-1",G.checkout.shippingAddress.checkoutSettings=G.checkoutSettings;else{var e=null===(t=G.store.customerStore.customer)||void 0===t?void 0:t.addresses;G.onSelectedShippingAddressIdChange((null==e?void 0:e.length)?e[0].id:"-1")}},this.createBillingAddress=function(){"undefined"!=typeof localStorage&&(G.useDifferentAddress=!!localStorage.getItem("sAddr"),G.useDifferentAddress?(G.checkout.billingAddress&&(G.selectedBillingAddressId=G.checkout.billingAddress.id||"-1"),G.checkout.billingAddress=G.checkout.billingAddress||new u):G.checkout.billingAddress=new u(n(G.checkout.shippingAddress)||{}),G.checkout.billingAddress.checkoutSettings=G.checkoutSettings)},this.onShippingMethodChange=function(i){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isChangingShippingMethod?[2]:(this.isChangingShippingMethod=!0,this.checkout.shippingSettingsId=i.shippingSettingsId,this.checkout.shippingZoneRateId=i.shippingZoneRateId,[4,this.saveCheckout()]);case 1:return e.sent(),[4,p.getCheckoutById(this.checkout.id)];case 2:return(t=e.sent())&&(this.checkout=t),this.isChangingShippingMethod=!1,[2]}}))}))},this.onCouponCodeApply=function(){return t(G,void 0,void 0,(function(){var t,s,n,r,a;return e(this,(function(e){switch(e.label){case 0:if(!this.checkout.couponCode)return[2];e.label=1;case 1:return e.trys.push([1,7,,8]),[4,p.addCouponCodeToCheckout(this.checkout.id,this.checkout.couponCode)];case 2:return e.sent()?[4,p.getCheckoutById(this.checkout.id)]:[3,6];case 3:return(t=e.sent())?(s=null===(a=null===(r=this.cardData)||void 0===r?void 0:r.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.step===C.PAYMENT&&(null==s?void 0:s.length)&&s.length>=6?[4,this.retrieveInstallmentInfo({binNumber:s.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:t.totalFinalPrice})]:[3,5]):[3,6];case 4:e.sent(),e.label=5;case 5:n=this.checkout,this.checkout=new o(i(i({},t),{shippingAddress:n.shippingAddress,billingAddress:n.billingAddress,customer:n.customer,selectedPaymentGateway:n.selectedPaymentGateway})),e.label=6;case 6:return[3,8];case 7:return e.sent(),[3,8];case 8:return[2]}}))}))},this.onCouponCodeDelete=function(){return t(G,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,this.saveCheckout()];case 1:return e.sent(),[4,p.getCheckoutById(this.checkout.id)];case 2:return(t=e.sent())&&(s=this.checkout,this.checkout=new o(i(i({},t),{shippingAddress:s.shippingAddress,billingAddress:s.billingAddress,customer:s.customer,selectedPaymentGateway:s.selectedPaymentGateway}))),[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},this.onSelectedShippingAddressIdChange=function(t){var e;if(G.selectedShippingAddressId=t,"-1"===t)G.checkout.shippingAddress=new u;else{var i=null===(e=G.store.customerStore.customer)||void 0===e?void 0:e.addresses.find((function(e){return e.id===t}));i&&(G.checkout.shippingAddress=new u(i))}G.checkout.shippingAddress&&(G.checkout.shippingAddress.checkoutSettings=G.checkoutSettings)},this.onSelectedBillingAddressIdChange=function(t){var e;if(G.selectedBillingAddressId=t,"-1"===t)G.checkout.billingAddress=new u;else{var i=null===(e=G.store.customerStore.customer)||void 0===e?void 0:e.addresses.find((function(e){return e.id===t}));i&&(G.checkout.billingAddress=new u(i))}G.checkout.billingAddress&&(G.checkout.billingAddress.checkoutSettings=G.checkoutSettings)},this.onTermsAndConditionsCheckedChange=function(t){G.isTermsAndConditionsChecked=t},this.onCardNumberChange=function(t){if(G.cardData&&(!(t.length>G.cardData.cardNumber.length)||N(t))){var e=(G.cardData.cardNumber||"").split(" ").join(""),i=t.split(" ").join("");i.length>16||(e.length<6&&i.length>=6&&!G.installmentInfo?G.retrieveInstallmentInfo({binNumber:i.slice(0,6),paymentGatewayId:G.checkout.selectedPaymentGateway.id,price:G.checkout.totalFinalPrice}):i.length<6&&e.length>i.length&&(G.cardData.installmentCount=1,G.installmentInfo=void 0),G.cardData.cardNumber=w(i,4).join(" "))}},this.onCardHolderNameChange=function(t){G.cardData&&(G.cardData.cardHolderName=t)},this.onExpirationDateChange=function(t){var e;if(G.cardData&&(!(t.length>G.cardData.expirationDate.length)||N(t))){if(0===(null===(e=G.cardData.expirationDate)||void 0===e?void 0:e.length)){var i=t.split("/");if(2===i.length){var s=i[0].trim(),n=i[1].trim();if(4===s.length&&2===n.length){var r=parseInt(s.slice(2)),o=parseInt(n);if(!isNaN(r)&&!isNaN(o))return void(G.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&4===n.length){o=parseInt(s),r=parseInt(n.slice(2));if(!isNaN(r)&&!isNaN(o))return void(G.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}}}var a=t.split(" / ").join("");a.length>4||(G.cardData.expirationDate=w(a,2).join(" / "))}},this.onCvcChange=function(t){G.cardData&&(t.length>G.cardData.cvv.length&&!N(t)||t.length>4||(G.cardData.cvv=t))},this.saveAddress=function(s){return t(G,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return this.shouldSaveAddress?(t=new c(i(i({},"shipping"===s?this.checkout.shippingAddress:this.checkout.billingAddress),{title:this.addressTitle||this.t("checkout-page:newAddress"),id:b()})),(r=n(this.store.customerStore.customer)).addresses.push(t),[4,this.store.customerStore.saveCustomer(r)]):[3,2];case 1:e.sent(),"shipping"===s?(this.checkout.shippingAddress.id=t.id,this.selectedShippingAddressId=t.id||"-1"):(this.checkout.billingAddress.id=t.id,this.selectedBillingAddressId=t.id||"-1"),e.label=2;case 2:return[2]}}))}))},this.onGoToCartClick=function(){G.router.push("/cart")},this.onBackToShoppingClick=function(){G.router.push("/")},this.onProceedToShippingClick=function(){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToShipping)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,5,,6]),this.isStepLoading=!0,[4,this.saveAddress("shipping")];case 2:return e.sent(),[4,this.checkStocks()];case 3:return e.sent(),[4,this.saveCheckout()];case 4:return e.sent(),this.changeStep(C.SHIPPING),[3,6];case 5:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:I.UNKNOWN}),this.isStepLoading=!1,[3,6];case 6:return[2]}}))}))},this.onProceedToPaymentClick=function(){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCheckout()];case 3:return e.sent(),this.error=void 0,this.changeStep(C.PAYMENT),[3,5];case 4:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:I.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.onCompletePaymentClick=function(){return t(G,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canPerformPayment)return this.isErrorsVisible=!0,[2];this.useDifferentAddress||(this.checkout.billingAddress=this.checkout.shippingAddress),e.label=1;case 1:return e.trys.push([1,6,,7]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveAddress("billing")];case 3:return e.sent(),[4,this.saveCheckout()];case 4:return e.sent(),[4,this.createSaleTransaction()];case 5:return e.sent(),[3,7];case 6:return(t=e.sent()).type?this.error=t:this.error={type:I.UNKNOWN},this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.createSaleTransaction=function(){return t(G,void 0,void 0,(function(){var t,i,s,n;return e(this,(function(e){switch(e.label){case 0:return this.checkout.selectedPaymentGateway?[4,p.createSaleTransactionWithCheckout(this.checkout.id,this.checkout.selectedPaymentGateway.id,this.checkout.selectedPaymentGateway.paymentMethodType===h.CREDIT_CARD&&this.checkout.selectedPaymentGateway.type===l.INTERNAL&&this.cardData?this.cardData.toInput():void 0)]:[2];case 1:return t=e.sent(),i=null==t?void 0:t.transactionStatus,s=i&&[d.SUCCESS,d.AUTHORIZED].includes(i),n=i===d.PENDING,s?[4,this.onCheckoutTransactionSuccess()]:[3,3];case 2:return e.sent(),[3,4];case 3:if(!n||!(null==t?void 0:t.returnSlug))throw{type:I.UNKNOWN};window.location.href=process.env.NEXT_PUBLIC_BASE_URL+t.returnSlug,e.label=4;case 4:return[2]}}))}))},this.onCheckoutTransactionSuccess=function(){return t(G,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return localStorage.removeItem("sAddr"),(null===(t=this.checkout.customer)||void 0===t?void 0:t.notificationsAccepted)?[4,this.store.customerStore.createEmailSubscription((null===(i=this.checkout.customer)||void 0===i?void 0:i.email)||"")]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.changeStep(C.SUCCESS),[2]}}))}))},this.onBackToInfoClick=function(){G.changeStep(C.INFO)},this.onBackToShippingClick=function(){G.changeStep(C.SHIPPING)},this.setCustomerConsentGranted=function(t){G.checkout.customer&&(G.checkout.customer.notificationsAccepted=t)},this.setUseDifferentAddress=function(t){G.useDifferentAddress=t,G.useDifferentAddress?(localStorage.setItem("sAddr","1"),G.checkout.billingAddress=G.checkout.billingAddress||new u):(localStorage.removeItem("sAddr"),G.checkout.billingAddress=G.checkout.shippingAddress)},this.setShouldSaveAddress=function(t){G.shouldSaveAddress=t},this.setAddressTitle=function(t){G.addressTitle=t},this.setPaymentGateway=function(t){if(G.paymentGateways.length){var e=G.paymentGateways[t];G.checkout.selectedPaymentGateway=e,G.step!==C.SUCCESS&&(e.paymentMethodType===h.CREDIT_CARD&&e.type===l.INTERNAL&&(G.cardData=new v),G.installmentInfo=void 0)}},this.setInstallmentCount=function(t){G.cardData&&(G.cardData.installmentCount=t)},this.changeStep=function(i){return t(G,void 0,void 0,(function(){return e(this,(function(t){return A||window.location.replace("".concat(window.location.pathname,"?id=").concat(this.checkout.id,"&step=").concat(i)),[2]}))}))},this.logout=function(){return t(G,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:this.checkout.customer=void 0,this.store.customerStore.logout(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.saveCheckout()];case 2:case 3:return t.sent(),[3,4];case 4:return this.createCustomer(),[2]}}))}))},this.setContactModalVisible=function(t){G.isContactModalVisible=t},this.checkout=P,this.checkoutSettings=j,this.router=x,this.returnPolicy=E,this.privacyPolicy=O,this.termsOfService=T,this.t=D,R&&(this.merchantSettings=R),this.isTermsAndConditionsChecked=this.checkoutSettings.isTermsAndConditionsDefaultChecked,this.store.cartStore.cart=this.checkout.cart,this.init(),s(this)}return Object.defineProperty(P.prototype,"cart",{get:function(){return this.checkout.cart},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"selectedPaymentGatewayIndex",{get:function(){var t=this;return this.paymentGateways.findIndex((function(e){var i;return e.id===(null===(i=t.checkout.selectedPaymentGateway)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"selectedInstallmentIndex",{get:function(){var t,e=this;return(null===(t=this.installmentInfo)||void 0===t?void 0:t.installmentPrices.findIndex((function(t){var i;return t.installmentCount===(null===(i=e.cardData)||void 0===i?void 0:i.installmentCount)})))||0},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"checkoutUrl",{get:function(){return"/checkout?id=".concat(this.checkout.id,"&step=info")},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"customerAddressOptions",{get:function(){var t,e={label:this.t("checkout-page:newAddress"),value:"-1"},i=(null===(t=this.store.customerStore.customer)||void 0===t?void 0:t.addresses.map((function(t){return{label:t.title+" - "+t.addressText,value:t.id}})))||[];return[e].concat(i)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"installmentPrice",{get:function(){var t,e,i=this;if(this.installmentInfo&&(null===(t=this.cardData)||void 0===t?void 0:t.installmentCount))return null===(e=this.installmentInfo.installmentPrices.find((function(t){var e;return t.installmentCount===(null===(e=i.cardData)||void 0===e?void 0:e.installmentCount)})))||void 0===e?void 0:e.totalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"installmentExtraPrice",{get:function(){if(this.installmentPrice&&this.checkout.totalFinalPrice)return this.installmentPrice-this.checkout.totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"finalPrice",{get:function(){return this.step===C.SUCCESS?this.order?this.order.totalFinalPrice:this.checkout.totalFinalPrice:this.installmentPrice||this.checkout.$totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"hasStockError",{get:function(){var t;return(null===(t=this.error)||void 0===t?void 0:t.type)===I.STOCK_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"canProceedToShipping",{get:function(){var t,e;return(null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.isValid)&&this.checkout.hasValidCustomerEmail&&(null===(e=this.error)||void 0===e?void 0:e.type)!==I.NO_SHIPPING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"canProceedToPayment",{get:function(){return this.canProceedToShipping},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"canPerformPayment",{get:function(){var t,e;if(this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return!1;var i=this.checkout.selectedPaymentGateway;return this.canProceedToShipping&&!!(null===(t=this.checkout.billingAddress)||void 0===t?void 0:t.isValid)&&((null==i?void 0:i.paymentMethodType)===h.CREDIT_CARD&&i.type===l.INTERNAL?null===(e=this.cardData)||void 0===e?void 0:e.isValid:!!i)},enumerable:!1,configurable:!0}),P}();function w(t,e){return t.match(new RegExp(".{1,"+e+"}","g"))||[]}function N(t){return t&&P.test(t.charAt(t.length-1))}!function(t){t.INFO="info",t.SHIPPING="shipping",t.PAYMENT="payment",t.SUCCESS="success"}(C||(C={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.API_ERROR=1]="API_ERROR",t[t.STOCK_ERROR=2]="STOCK_ERROR",t[t.PAYMENT_ERROR=3]="PAYMENT_ERROR",t[t.NO_SHIPPING_ERROR=4]="NO_SHIPPING_ERROR",t[t.CUSTOMER_LOGIN_REQUIRED_ERROR=5]="CUSTOMER_LOGIN_REQUIRED_ERROR"}(I||(I={}));export{C as CheckoutStep,I as ErrorType,j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as o}from"mobx-react-lite";import{FormItem as t}from"../../components/form-item/index.js";import{FormItemType as r,FormItemInputType as m}from"../../components/form-item/model.js";import{Button as s}from"../../components/button/index.js";import{Checkbox as i}from"../../components/checkbox/index.js";import n from"../../components/error/index.js";import c from"../../styles/common.module.scss.js";import a from"../../components/customer-addresses/index.js";import l from"../../components/customer-addresses/model.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{useTranslation as u}from"../../../../utils/i18n.js";var p=o((function(o){var p,d,h
|
|
1
|
+
import*as e from"react";import{observer as o}from"mobx-react-lite";import{FormItem as t}from"../../components/form-item/index.js";import{FormItemType as r,FormItemInputType as m}from"../../components/form-item/model.js";import{Button as s}from"../../components/button/index.js";import{Checkbox as i}from"../../components/checkbox/index.js";import n from"../../components/error/index.js";import c from"../../styles/common.module.scss.js";import a from"../../components/customer-addresses/index.js";import l from"../../components/customer-addresses/model.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{useTranslation as u}from"../../../../utils/i18n.js";var p=o((function(o){var p,d,h=o.vm,f=u().t,g=e.useCallback((function(e){h.checkout.customer&&(h.checkout.customer.email=e?e.trim():e)}),[h,h.checkout,h.checkout.customer]),k=e.useMemo((function(){return new l(h,"shipping")}),[h]);return e.createElement("div",null,e.createElement(n,{vm:h}),!h.checkout.hasCustomer&&e.createElement("div",{style:{marginTop:"8px",marginBottom:"40px"}},e.createElement("div",{className:c.FormSectionTitle},e.createElement("div",{className:c.Title},f("checkout-page:contactInfo"))),e.createElement(t,{type:r.TEXT,inputType:m.EMAIL,label:f("checkout-page:email"),autocomplete:"email",value:(null===(p=h.checkout.customer)||void 0===p?void 0:p.email)||"",onChange:g,hasError:h.isErrorsVisible&&!h.checkout.hasValidCustomerEmail,errorText:f("checkout-page:emailError"),tooltipText:f("checkout-page:guestEmailTooltip")}),e.createElement(i,{value:(null===(d=h.checkout.customer)||void 0===d?void 0:d.notificationsAccepted)||!1,label:f("checkout-page:customerConsentCta"),onChange:h.setCustomerConsentGranted})),e.createElement(a,{vm:k}),!k.editingCustomerAddress&&e.createElement(s,{style:{width:"100%",marginTop:h.store.customerStore.customer?"0px":"32px"},text:f("checkout-page:actions.continueWithShipping"),isLoading:h.isStepLoading,onClick:h.onProceedToShippingClick}))}));export{p as default};
|
|
@@ -7,7 +7,7 @@ declare type Props = {
|
|
|
7
7
|
pageSpecificDataStr?: string;
|
|
8
8
|
merchantSettingsStr?: string;
|
|
9
9
|
addOgpMetas?: boolean;
|
|
10
|
-
productReviewSummary
|
|
10
|
+
productReviewSummary?: string | null;
|
|
11
11
|
};
|
|
12
12
|
export declare const IkasPageHead: React.FC<Props>;
|
|
13
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t,__spreadArray as e}from'../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import r from"next/head.js";import"../../models/data/blog/index.js";import{IkasBrand as a}from"../../models/data/brand/index.js";import{IkasCategory as n}from"../../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{IkasMerchantSettings as s}from"../../models/data/merchant-settings/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{IkasProductDetail as m}from"../../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{IkasStorefrontConfig as p}from"../../storefront/index.js";import{IkasPageDataInit as l}from"../../providers/page-data-init.js";var c=i((function(i){var c=i.pageType,u=i.pageTitle,f=i.pageDescription,g=i.pageSpecificDataStr,h=i.merchantSettingsStr,v=i.addOgpMetas,j=i.productReviewSummary,x="undefined"!=typeof window
|
|
1
|
+
import{__assign as t,__spreadArray as e}from'../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import r from"next/head.js";import"../../models/data/blog/index.js";import{IkasBrand as a}from"../../models/data/brand/index.js";import{IkasCategory as n}from"../../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{IkasMerchantSettings as s}from"../../models/data/merchant-settings/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{IkasProductDetail as m}from"../../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{IkasStorefrontConfig as p}from"../../storefront/index.js";import{IkasPageDataInit as l}from"../../providers/page-data-init.js";var c=i((function(i){var c=i.pageType,u=i.pageTitle,f=i.pageDescription,g=i.pageSpecificDataStr,h=i.merchantSettingsStr,v=i.addOgpMetas,j=i.productReviewSummary,x="undefined"!=typeof window;o.useEffect((function(){var t;document.documentElement.lang=(null===(t=p.routings.find((function(t){return t.id===p.storefrontRoutingId})))||void 0===t?void 0:t.locale)||"tr"}),[c]);var y=o.useMemo((function(){if(h)return new s(JSON.parse(h))}),[h]),b=o.useMemo((function(){if(!g)return g;var t=JSON.parse(g);switch(c){case d.PRODUCT:return new m(t.product,t.selectedVariantValues);case d.CATEGORY:return new n(t);case d.BRAND:return new a(t);default:return g}}),[g]),w=o.useMemo((function(){if(b&&b.href)return"https://".concat(p.domain).concat(b.href)}),[b]),O=o.useMemo((function(){var t,e=[];if(v)if(e.push({property:"og:type",content:"website"}),e.push({property:"og:site_name",content:"https://"+p.domain}),u&&e.push({property:"og:title",content:u}),f&&e.push({property:"og:description",content:f}),e.push({property:"og:url",content:w||(x?window.location.href:"")||"https://".concat(p.domain)}),b&&c===d.PRODUCT){var o=b;o.selectedVariant.mainImage&&e.push({property:"og:image",content:null===(t=o.selectedVariant.mainImage)||void 0===t?void 0:t.src})}else y&&e.push({property:"og:image",content:y.logo.src});return e}),[u,b,w,f,y,v,y]),S=o.useMemo((function(){var o=[];if(y){var i={"@context":"https://schema.org","@type":"Website",url:"https://"+p.domain},r=function(t){var e,o;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:null===(e=null==t?void 0:t.logo)||void 0===e?void 0:e.src,image:null===(o=null==t?void 0:t.logo)||void 0===o?void 0:o.src,url:"https://"+p.domain}}(y);o.push(i),o.push(r)}if(b&&c===d.PRODUCT){var a=function(e,o){var i,r;try{"undefined"!=typeof window&&l._initProductDetailOnBrowser(e);var a="https://".concat(p.domain).concat(e.href);return t(t({"@context":"https://schema.org/","@type":"Product",name:e.product.name,description:null===(i=e.product.metaData)||void 0===i?void 0:i.description,image:e.selectedVariant.images.map((function(t){return t.src})),productId:e.selectedVariant.id,sku:e.selectedVariant.sku,mpn:e.selectedVariant.barcodeList.length?e.selectedVariant.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(r=e.product.brand)||void 0===r?void 0:r.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:a,priceCurrency:e.selectedVariant.price.currency||"TRY",price:e.selectedVariant.price.finalPrice,priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:e.selectedVariant.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(t){}}(b,j?JSON.parse(j):null);a&&o.push(a)}if(b&&c===d.CATEGORY){var n=function(t){var e,o,i;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(p.domain).concat(t.href),name:null===(e=t.metaData)||void 0===e?void 0:e.pageTitle,description:null===(o=t.metaData)||void 0===o?void 0:o.description,image:null===(i=t.image)||void 0===i?void 0:i.src}}catch(t){}}(b),s=function(t){try{return{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:t.path.length?e(e([],t.path.map((function(t,e){return{"@type":"ListItem",position:e+1,name:t.name,item:"https://"+p.domain+t.href}})),!0),[{"@type":"ListItem",position:t.path.length+1,name:t.name,item:"https://"+p.domain+t.href}],!1):[{"@type":"ListItem",position:1,name:t.name,item:"https://"+p.domain+t.href}]}}catch(t){}}(b);n&&o.push(n),s&&o.push(s)}return o}),[b,y]);return o.createElement(r,null,o.createElement("title",null,u||""),o.createElement("meta",{name:"description",content:f||""}),!!v&&O.map((function(t,e){return o.createElement("meta",{key:"".concat(t.content,"-").concat(e),property:t.property,content:t.content})})),!!S.length&&S.map((function(t,e){return o.createElement("script",{key:e,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(t)}})})))}));export{c as IkasPageHead};
|