@ikas/storefront 4.5.0-beta.9 → 5.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import*as t from"react";import e from"html-react-parser";import{getIkasEventsScript as n}from"../events.js";import{observer as a}from"mobx-react-lite";import{IkasStorefrontConfig as r}from"@ikas/storefront-config";var o=a((function(){var a=r.getGtmId(),o=r.getFbpId(),i=r.getAnalytics4Id(),c=r.getUniversalAnalyticsId(),s=r.getTiktokPixelId(),l=r.getIsEditor(),m=r.getStorefrontJSScripts();return t.createElement(t.Fragment,null,a&&!l&&t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','".concat(a,"');")}}),o&&!l&&t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '".concat(o,"');\n fbq('track', 'PageView');")}}),i&&!l&&t.createElement(t.Fragment,null,t.createElement("script",{async:!0,src:"https://www.googletagmanager.com/gtag/js?id=".concat(i)}),t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat(i,"');")}})),c&&!l&&t.createElement(t.Fragment,null,t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;\n ga('create', '".concat(c,"', 'auto');\n ga('require', 'ec');")}}),t.createElement("script",{async:!0,src:"https://www.google-analytics.com/analytics.js"})),s&&!l&&t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:'!function (w, d, t) {\n w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for(var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var i="https://analytics.tiktok.com/i18n/pixel/events.js";ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=i,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=i+"?sdkid="+e+"&lib="+t;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(o,a)};\n ttq.load(\''.concat(s,"');\n ttq.page();\n }(window, document, 'ttq');")}}),e(n()),m.map((function(t){return e(t)})))})),i=function(){var e=r.getGtmId(),n=r.getFbpId(),a=r.getIsEditor();return t.createElement(t.Fragment,null,e&&!a&&t.createElement("noscript",{dangerouslySetInnerHTML:{__html:'<iframe src="https://www.googletagmanager.com/ns.html?id='.concat(e,'" height="0" width="0" style="display:none;visibility:hidden"></iframe>')}}),n&&!a&&t.createElement("noscript",{dangerouslySetInnerHTML:{__html:'<img height="1" width="1" style="display:none" \n src="https://www.facebook.com/tr?id='.concat(n,'&ev=PageView&noscript=1"/>')}}))};export{i as AnalyticsBody,o as AnalyticsHead};
1
+ import*as t from"react";import e from"html-react-parser";import{getIkasEventsScript as n}from"../events.js";import{observer as a}from"mobx-react-lite";import{IkasStorefrontConfig as r}from"@ikas/storefront-config";import{Partytown as o}from'./../../ext/@builder.io/partytown/react/index.mjs.js';var i=a((function(){var a=r.getGtmId(),i=r.getFbpId(),s=r.getAnalytics4Id(),c=r.getUniversalAnalyticsId(),l=r.getTiktokPixelId(),g=r.getIsEditor(),m=r.getStorefrontJSScripts(),d=r.getDomain();return console.log(d),t.createElement(t.Fragment,null,t.createElement(o,{debug:!0,forward:["dataLayer.push","fbq","gtag","ga","ttq"],logScriptExecution:!0,logCalls:!0,resolveUrl:function(t,e,n){if("script"===n){var a=new URL("https://".concat(d,"/partytown/proxy"));return a.searchParams.append("proxy",t.href),console.log(a),a}return t}}),a&&!g&&t.createElement("script",{type:"text/partytown",defer:!0,dangerouslySetInnerHTML:{__html:"(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','".concat(a,"');")}}),i&&!g&&t.createElement("script",{type:"text/partytown",defer:!0,dangerouslySetInnerHTML:{__html:"!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '".concat(i,"');\n fbq('track', 'PageView');")}}),s&&!g&&t.createElement(t.Fragment,null,t.createElement("script",{type:"text/partytown",async:!0,src:"https://www.googletagmanager.com/gtag/js?id=".concat(s)}),t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat(s,"');")}})),c&&!g&&t.createElement(t.Fragment,null,t.createElement("script",{type:"text/partytown",defer:!0,dangerouslySetInnerHTML:{__html:"window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;\n ga('create', '".concat(c,"', 'auto');\n ga('require', 'ec');")}}),t.createElement("script",{async:!0,src:"https://www.google-analytics.com/analytics.js"})),l&&!g&&t.createElement("script",{type:"text/partytown",defer:!0,dangerouslySetInnerHTML:{__html:'!function (w, d, t) {\n w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for(var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var i="https://analytics.tiktok.com/i18n/pixel/events.js";ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=i,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=i+"?sdkid="+e+"&lib="+t;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(o,a)};\n ttq.load(\''.concat(l,"');\n ttq.page();\n }(window, document, 'ttq');")}}),e(n()),m.map((function(t){return e(t)})))})),s=function(){var e=r.getGtmId(),n=r.getFbpId(),a=r.getIsEditor();return t.createElement(t.Fragment,null,e&&!a&&t.createElement("noscript",{dangerouslySetInnerHTML:{__html:'<iframe src="https://www.googletagmanager.com/ns.html?id='.concat(e,'" height="0" width="0" style="display:none;visibility:hidden"></iframe>')}}),n&&!a&&t.createElement("noscript",{dangerouslySetInnerHTML:{__html:'<img height="1" width="1" style="display:none" \n src="https://www.facebook.com/tr?id='.concat(n,'&ev=PageView&noscript=1"/>')}}))};export{s as AnalyticsBody,i as AnalyticsHead};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import s from"next/link.js";import a from"react-tooltip";import l,{CheckoutStep as n}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as g}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout/country-settings-model.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as E}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as f}from"./steps/step-success/index.js";import{Modal as y}from"./components/modal/index.js";import k from"./components/master-pass/modal-otp/index.js";import x from"./components/master-pass/modal-response/index.js";import j from"./components/master-pass/modal-success/index.js";import{Image as C}from"../image/index.js";import b,{Step as N}from"./components/step-container/index.js";import{StockError as F}from"./components/error/stock-error/index.js";import{FullscreenLoading as M}from"./components/fullscreen-loading/index.js";import T from"./components/notification-box/index.js";import{FormItem as P}from"./components/form-item/index.js";import{FormItemType as S}from"./components/form-item/model.js";import{Button as A}from"./components/button/index.js";import{IkasPageHead as w}from"../page/head.js";import I from"./components/offer-product/index.js";import V from"./components/svg/ikas.js";import O from"./style.module.scss.js";import{Analytics as B}from"../../analytics/analytics.js";import"../../analytics/head/index.js";var L=i((function(e){var t,i,s,m,p=e.checkout,u=e.checkoutSettings,v=e.customizationProps,E=e.returnPolicy,C=e.privacyPolicy,b=e.termsOfService,N=e.imprint,T=e.shippingPolicy,P=d().t,S=r(),A=o.useState((function(){return new l(p,u,S,E,C,b,N,T,P,v||{})}))[0];return A.step===n.PAYMENT&&B.disableHTML(),o.useEffect((function(){A.checkoutSettings.isAccountRequired&&!A.checkout.hasCustomer&&S.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),B.beginCheckout(A.checkout),B.pageView(g.CHECKOUT)}),[]),o.useEffect((function(){A.customizationProps=v,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED")}(v)}),[v]),A.isCheckoutLoaded&&A.store.customerStore.initialized?A.checkout.hasCustomer&&(null===(t=A.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(i=A.checkout.customer)||void 0===i?void 0:i.id)&&!(null===(s=A.checkout.customer)||void 0===s?void 0:s.isGuestCheckout)?(S.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(w,{pageType:g.CHECKOUT,pageTitle:((null===(m=A.merchantSettings)||void 0===m?void 0:m.merchantName)||"")+" - "+P("checkout-page:securePayment"),pageDescription:P("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:O.CheckoutPage},o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:O.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:O.Left},o.createElement("div",{className:O.LeftContent},o.createElement("div",null,o.createElement(R,{vm:A}),A.hasStockError&&o.createElement("div",{className:O.ErrorContainer},o.createElement(F,{vm:A,error:A.error})),!A.hasStockError&&o.createElement(o.Fragment,null,o.createElement(h,{vm:A,allowExpand:!0}),A.step===n.SUCCESS?o.createElement(f,{vm:A}):o.createElement(o.Fragment,null,A.checkoutCampaignOffer&&o.createElement(I,{vm:A,campaignOffer:A.checkoutCampaignOffer}),o.createElement(D,{vm:A}))),o.createElement("div",{className:O.Space})),o.createElement(G,{vm:A}))),o.createElement("div",{className:O.Right},o.createElement("div",{className:O.RightContent},o.createElement(h,{vm:A}),o.createElement("div",{className:O.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(V,null))))),!!A.policyModalText&&o.createElement(y,{title:A.policyModalTitle,modalContent:A.policyModalText,onClose:function(){A.policyModalText=""}}),A.isContactModalVisible&&o.createElement(Y,{vm:A,setVisible:A.setContactModalVisible}),A.mpVM.isOtpModalVisible&&o.createElement(k,{vm:A,visible:A.mpVM.isOtpModalVisible,type:A.mpVM.otpModalType,onClose:A.mpVM.hideOtpModal}),A.mpVM.isResponseModalVisible&&o.createElement(x,{visible:A.mpVM.isResponseModalVisible,text:A.mpVM.mfsResponseModalText,onClose:A.mpVM.onResponseModalClose}),A.mpVM.isSuccessModalVisible&&o.createElement(j,{visible:A.mpVM.isSuccessModalVisible,type:A.mpVM.successModalType,onClose:A.mpVM.onSuccessModalClose}))):o.createElement(M,null)})),R=i((function(e){var t,i,r,a=e.vm,l=d().t;return o.createElement("div",{className:O.Header},o.createElement(s,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=a.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:O.Logo},o.createElement(C,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!a.checkout.hasCustomer&&o.createElement("div",{className:O.LoginText},o.createElement("span",{className:O.LoginCta},l("checkout-page:alreadyHaveAnAccount")),o.createElement(s,{href:"/account/login?redirect="+encodeURIComponent(a.checkoutUrl),passHref:!0},o.createElement("a",{className:O.LoginBtn},l("checkout-page:actions.login")))),a.checkout.hasCustomer&&o.createElement("div",{className:O.CustomerInfo},o.createElement("div",{className:O.Name},a.checkout.customerFullName),o.createElement("div",{className:O.Email},null===(r=a.checkout.customer)||void 0===r?void 0:r.email)))})),D=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case n.INFO:return o.createElement(p,{vm:t});case n.SHIPPING:return o.createElement(u,{vm:t});case n.PAYMENT:return o.createElement(v,{vm:t});case n.SUCCESS:return o.createElement(f,{vm:t})}}),[t,t.step]),s=[new N(i("checkout-page:address"),t.step===n.INFO,t.step!==n.INFO,t.step!==n.INFO?o.createElement("div",{className:O.AdressStepInfo},o.createElement(U,{vm:t}),o.createElement("div",{className:O.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==n.INFO?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(U,{vm:t})):void 0),new N(i("checkout-page:payment"),t.step===n.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||s.splice(1,0,new N(i("checkout-page:shipping"),t.step===n.SHIPPING,t.step===n.PAYMENT,t.step===n.PAYMENT?o.createElement("div",{className:O.AdressStepInfo},o.createElement(H,{vm:t}),(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:O.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===n.PAYMENT?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(H,{vm:t})):void 0)),o.createElement(b,{steps:s,stepContent:r})})),U=i((function(e){var t,i,r,s,a,l,n,c,m,p=e.vm,u=d().t,v=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=p.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=p.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(s=p.checkout.shippingAddress)||void 0===s?void 0:s.lastName)||"");return o.createElement("div",{className:O.Address},o.createElement("div",{className:[O.Text,O.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:O.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:O.Text},u("checkout-page:receiver")),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},v)),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(l=p.checkout.billingAddress)||void 0===l?void 0:l.phone:null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[O.Text,O.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(c=p.checkout.billingAddress)||void 0===c?void 0:c.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),H=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:O.LightText}," / "+(0===t.checkout.shippingLines[0].price?i("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),G=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Footer},o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),Y=i((function(i){var r,s,a,l=i.vm,n=i.setVisible,c=d().t,m=o.useState(!1),p=m[0],u=m[1],v=o.useState(!1),h=v[0],g=v[1],f=o.useState(new E({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];f.email=(null===(r=l.checkout.customer)||void 0===r?void 0:r.email)||"",f.firstName=(null===(s=l.checkout.customer)||void 0===s?void 0:s.firstName)||"",f.lastName=(null===(a=l.checkout.customer)||void 0===a?void 0:a.lastName)||"";var k=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,n(!1)]:(u(!0),[4,f.saveContactForm()]);case 1:return e.sent()&&g(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(y,{title:c("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(T,{type:"success",title:c("checkout-page:contactFormSent"),content:c("checkout-page:contactFormDescription")})),o.createElement(P,{type:S.TEXT_AREA,label:"",value:f.message||"",onChange:f.onMessageChange,textAreaPlaceholder:c("checkout-page:contactFormCta")}),o.createElement(A,{style:{width:"100%",marginTop:"24px"},text:c(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!f.message,onClick:k})),onClose:function(){return n(!1)}})}));export{L as default};
1
+ import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import s from"next/link.js";import a from"react-tooltip";import l,{CheckoutStep as n}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as g}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout/country-settings-model.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as E}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as f}from"./steps/step-success/index.js";import{Modal as y}from"./components/modal/index.js";import x from"./components/master-pass/modal-otp/index.js";import k from"./components/master-pass/modal-response/index.js";import j from"./components/master-pass/modal-success/index.js";import{Image as C}from"../image/index.js";import b,{Step as N}from"./components/step-container/index.js";import{StockError as F}from"./components/error/stock-error/index.js";import{FullscreenLoading as M}from"./components/fullscreen-loading/index.js";import T from"./components/notification-box/index.js";import{FormItem as P}from"./components/form-item/index.js";import{FormItemType as S}from"./components/form-item/model.js";import{Button as A}from"./components/button/index.js";import{IkasPageHead as w}from"../page/head.js";import I from"./components/offer-product/index.js";import V from"./components/svg/ikas.js";import O from"./style.module.scss.js";import{Analytics as B}from"../../analytics/analytics.js";import"../../analytics/head/index.js";var L=i((function(e){var t,i,s,m=e.checkout,p=e.checkoutSettings,u=e.customizationProps,v=e.returnPolicy,E=e.privacyPolicy,C=e.termsOfService,b=e.imprint,N=e.shippingPolicy,T=d().t,P=r(),S=o.useState((function(){return new l(m,p,P,v,E,C,b,N,T,u||{})}))[0];return S.step===n.PAYMENT&&B.disableHTML(),o.useEffect((function(){S.checkoutSettings.isAccountRequired&&!S.checkout.hasCustomer&&P.push("/account/login?redirect="+encodeURIComponent(S.checkoutUrl)),B.beginCheckout(S.checkout),B.pageView(g.CHECKOUT)}),[]),o.useEffect((function(){S.customizationProps=u,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED")}(u)}),[u]),S.isCheckoutLoaded&&S.store.customerStore.initialized?S.checkout.hasCustomer&&(null===(t=S.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(i=S.checkout.customer)||void 0===i?void 0:i.id)?(P.push("/account/login?redirect="+encodeURIComponent(S.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(w,{pageType:g.CHECKOUT,pageTitle:((null===(s=S.merchantSettings)||void 0===s?void 0:s.merchantName)||"")+" - "+T("checkout-page:securePayment"),pageDescription:T("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:O.CheckoutPage},o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:O.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:O.Left},o.createElement("div",{className:O.LeftContent},o.createElement("div",null,o.createElement(R,{vm:S}),S.hasStockError&&o.createElement("div",{className:O.ErrorContainer},o.createElement(F,{vm:S,error:S.error})),!S.hasStockError&&o.createElement(o.Fragment,null,o.createElement(h,{vm:S,allowExpand:!0}),S.step===n.SUCCESS?o.createElement(f,{vm:S}):o.createElement(o.Fragment,null,S.checkoutCampaignOffer&&o.createElement(I,{vm:S,campaignOffer:S.checkoutCampaignOffer}),o.createElement(D,{vm:S}))),o.createElement("div",{className:O.Space})),o.createElement(G,{vm:S}))),o.createElement("div",{className:O.Right},o.createElement("div",{className:O.RightContent},o.createElement(h,{vm:S}),o.createElement("div",{className:O.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(V,null))))),!!S.policyModalText&&o.createElement(y,{title:S.policyModalTitle,modalContent:S.policyModalText,onClose:function(){S.policyModalText=""}}),S.isContactModalVisible&&o.createElement(Y,{vm:S,setVisible:S.setContactModalVisible}),S.mpVM.isOtpModalVisible&&o.createElement(x,{vm:S,visible:S.mpVM.isOtpModalVisible,type:S.mpVM.otpModalType,onClose:S.mpVM.hideOtpModal}),S.mpVM.isResponseModalVisible&&o.createElement(k,{visible:S.mpVM.isResponseModalVisible,text:S.mpVM.mfsResponseModalText,onClose:S.mpVM.onResponseModalClose}),S.mpVM.isSuccessModalVisible&&o.createElement(j,{visible:S.mpVM.isSuccessModalVisible,type:S.mpVM.successModalType,onClose:S.mpVM.onSuccessModalClose}))):o.createElement(M,null)})),R=i((function(e){var t,i,r,a=e.vm,l=d().t;return o.createElement("div",{className:O.Header},o.createElement(s,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=a.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:O.Logo},o.createElement(C,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!a.checkout.hasCustomer&&o.createElement("div",{className:O.LoginText},o.createElement("span",{className:O.LoginCta},l("checkout-page:alreadyHaveAnAccount")),o.createElement(s,{href:"/account/login?redirect="+encodeURIComponent(a.checkoutUrl),passHref:!0},o.createElement("a",{className:O.LoginBtn},l("checkout-page:actions.login")))),a.checkout.hasCustomer&&o.createElement("div",{className:O.CustomerInfo},o.createElement("div",{className:O.Name},a.checkout.customerFullName),o.createElement("div",{className:O.Email},null===(r=a.checkout.customer)||void 0===r?void 0:r.email)))})),D=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case n.INFO:return o.createElement(p,{vm:t});case n.SHIPPING:return o.createElement(u,{vm:t});case n.PAYMENT:return o.createElement(v,{vm:t});case n.SUCCESS:return o.createElement(f,{vm:t})}}),[t,t.step]),s=[new N(i("checkout-page:address"),t.step===n.INFO,t.step!==n.INFO,t.step!==n.INFO?o.createElement("div",{className:O.AdressStepInfo},o.createElement(U,{vm:t}),o.createElement("div",{className:O.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==n.INFO?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(U,{vm:t})):void 0),new N(i("checkout-page:payment"),t.step===n.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||s.splice(1,0,new N(i("checkout-page:shipping"),t.step===n.SHIPPING,t.step===n.PAYMENT,t.step===n.PAYMENT?o.createElement("div",{className:O.AdressStepInfo},o.createElement(H,{vm:t}),(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:O.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===n.PAYMENT?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(H,{vm:t})):void 0)),o.createElement(b,{steps:s,stepContent:r})})),U=i((function(e){var t,i,r,s,a,l,n,c,m,p=e.vm,u=d().t,v=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=p.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=p.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(s=p.checkout.shippingAddress)||void 0===s?void 0:s.lastName)||"");return o.createElement("div",{className:O.Address},o.createElement("div",{className:[O.Text,O.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:O.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:O.Text},u("checkout-page:receiver")),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},v)),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(l=p.checkout.billingAddress)||void 0===l?void 0:l.phone:null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[O.Text,O.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(c=p.checkout.billingAddress)||void 0===c?void 0:c.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),H=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:O.LightText}," / "+(0===t.checkout.shippingLines[0].price?i("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),G=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Footer},o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),Y=i((function(i){var r,s,a,l=i.vm,n=i.setVisible,c=d().t,m=o.useState(!1),p=m[0],u=m[1],v=o.useState(!1),h=v[0],g=v[1],f=o.useState(new E({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];f.email=(null===(r=l.checkout.customer)||void 0===r?void 0:r.email)||"",f.firstName=(null===(s=l.checkout.customer)||void 0===s?void 0:s.firstName)||"",f.lastName=(null===(a=l.checkout.customer)||void 0===a?void 0:a.lastName)||"";var x=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,n(!1)]:(u(!0),[4,f.saveContactForm()]);case 1:return e.sent()&&g(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(y,{title:c("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(T,{type:"success",title:c("checkout-page:contactFormSent"),content:c("checkout-page:contactFormDescription")})),o.createElement(P,{type:S.TEXT_AREA,label:"",value:f.message||"",onChange:f.onMessageChange,textAreaPlaceholder:c("checkout-page:contactFormCta")}),o.createElement(A,{style:{width:"100%",marginTop:"24px"},text:c(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!f.message,onClick:x})),onClose:function(){return n(!1)}})}));export{L as default};
@@ -1 +1 @@
1
- import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import a from"next/head.js";import{useRouter as r}from"next/router";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as i}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout/country-settings-model.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import{IkasBaseStore as n}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var d=o((function(o){var n=o.pageType,d=o.pageTitle,c=o.pageDescription,p=o.canonicals,u=o.disableIndex,g=o.pageSpecificData,j=o.merchantSettings,f=o.addOgpMetas,v=o.productReviewSummary,h=r(),x="undefined"!=typeof window,y="local"===process.env.NEXT_PUBLIC_ENV,b=h.asPath.split("?")[0].replace("/",""),k=s.getRoutings().filter((function(e){return e.id!==s.getStorefrontRoutingId()})),w=s.getCurrentRouting(),C=(null==w?void 0:w.path)?"/"+w.path:"",E=y?"http://localhost:3333":"https://"+s.getDomain();t.useEffect((function(){document.documentElement.lang=s.getCurrentLocale()}),[n,g]);var L=t.useMemo((function(){if(g&&g.href)return"".concat(E).concat(g.href)}),[g]),T=t.useMemo((function(){var e=[];if(f)if(e.push({property:"og:type",content:"website"}),e.push({property:"og:site_name",content:"https://"+s.getDomain()}),d&&e.push({property:"og:title",content:d}),c&&e.push({property:"og:description",content:c}),e.push({property:"og:url",content:L||(x?window.location.href:"")||"https://".concat(s.getDomain())}),g&&n===i.PRODUCT){var t=g.selectedVariant.mainImage;(null==t?void 0:t.image)&&e.push({property:"og:image",content:t.image.src})}else(null==j?void 0:j.logo)&&e.push({property:"og:image",content:j.logo.src});return e}),[d,g,L,c,j,f,j]),D=t.useMemo((function(){var t=[];if(j){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+s.getDomain()},a=function(t){var o,a,r,i,n,d,m=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:m,image:m,url:"https://"+s.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(r=null===(a=t.address)||void 0===a?void 0:a.city)||void 0===r?void 0:r.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(i=t.address)||void 0===i?void 0:i.postalCode,addressCountry:null===(d=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===d?void 0:d.code})}}(j);t.push(o),t.push(a)}if(g&&n===i.PRODUCT){var r=g,d=function(t,o){var a,r,i,n;try{var d="https://".concat(s.getDomain()).concat(t.href),m=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(a=t.metaData)||void 0===a?void 0:a.description,image:null===(r=m.images)||void 0===r?void 0:r.map((function(e){return e.image?e.image.src:""})),productId:m.id,sku:m.sku,mpn:(null===(i=m.barcodeList)||void 0===i?void 0:i.length)?m.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(n=t.brand)||void 0===n?void 0:n.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:d,priceCurrency:m.price.currency||"TRY",price:m.price.finalPrice,priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:m.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(r,v||null);if(d&&t.push(d),r.categories.length)(c=m(r.categories[0]))&&t.push(c)}if(g&&n===i.CATEGORY){var l=function(e){var t,o;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(s.getDomain()).concat(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(g),c=m(g);l&&t.push(l),c&&t.push(c)}return t}),[g,j]),R=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===n}));return t?l(g,n,t.titleTemplate||""):null}),[n,g]),_=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===n}));return t?l(g,n,t.descriptionTemplate||""):null}),[n,g]);return t.createElement(a,null,t.createElement("title",null,d||R||""),t.createElement("meta",{name:"description",content:c||_||""}),k.map((function(e){return t.createElement("link",{key:e.id,rel:"alternate",hrefLang:e.locale,href:"".concat(E+(e.path?"/"+e.path:""),"/").concat(b)})})),!!w&&!!k.length&&t.createElement("link",{key:"current-routing-hreflang",rel:"alternate",hrefLang:w.locale,href:"".concat(E).concat(C,"/").concat(b)}),!!u&&t.createElement("meta",{name:"robots",content:"noindex"}),!!f&&T.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!p&&p.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(E).concat(C).concat(e)})})),t.createElement("link",{rel:"canonical",href:"".concat(E).concat(C,"/").concat(b)}),!!D.length&&D.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function m(e){try{var t=n.getInstance(),o=e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:"https://"+s.getDomain()+e.href}}));return t.currentPageType===i.CATEGORY&&o.push({"@type":"ListItem",position:e.categoryPathItems.length+1,name:e.name,item:"https://"+s.getDomain()+e.href}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:e.categoryPathItems.length?o:[{"@type":"ListItem",position:1,name:e.name,item:"https://"+s.getDomain()+e.href}]}}catch(e){}}function l(e,t,o){var a,r,s=o;try{switch(t){case i.PRODUCT:var n=e,d=n.name,m=(null===(a=n.brand)||void 0===a?void 0:a.name)||"",l=n.selectedVariant.sku||"",c=(null===(r=n.selectedVariant.barcodeList)||void 0===r?void 0:r.length)?n.selectedVariant.barcodeList[0]:"";s.includes("{{name}}")&&(s=s.replace("{{name}}",d)),s.includes("{{brand}}")&&(s=s.replace("{{brand}}",m)),s.includes("{{sku}}")&&(s=s.replace("{{sku}}",l)),s.includes("{{barcode}}")&&(s=s.replace("{{barcode}}",c));break;case i.BRAND:case i.CATEGORY:case i.BLOG_CATEGORY:var p=e.name||"";s.includes("{{name}}")&&(s=s.replace("{{name}}",p));break;case i.BLOG:var u=e.title;s.includes("{{name}}")&&(s=s.replace("{{name}}",u))}}catch(e){}return s.trimEnd()}export{d as IkasPageHead};
1
+ import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import a from"next/head.js";import{useRouter as r}from"next/router";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as i}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout/country-settings-model.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import"../../analytics/analytics.js";import{AnalyticsHead as n}from"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import{IkasBaseStore as d}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var m=o((function(o){var d=o.pageType,m=o.pageTitle,p=o.pageDescription,u=o.canonicals,g=o.disableIndex,j=o.pageSpecificData,f=o.merchantSettings,v=o.addOgpMetas,h=o.productReviewSummary,x=r(),y="undefined"!=typeof window,b="local"===process.env.NEXT_PUBLIC_ENV,k=x.asPath.split("?")[0].replace("/",""),E=s.getRoutings().filter((function(e){return e.id!==s.getStorefrontRoutingId()})),w=s.getCurrentRouting(),C=(null==w?void 0:w.path)?"/"+w.path:"",L=b?"http://localhost:3333":"https://"+s.getDomain();t.useEffect((function(){document.documentElement.lang=s.getCurrentLocale()}),[d,j]);var T=t.useMemo((function(){if(j&&j.href)return"".concat(L).concat(j.href)}),[j]),D=t.useMemo((function(){var e=[];if(v)if(e.push({property:"og:type",content:"website"}),e.push({property:"og:site_name",content:"https://"+s.getDomain()}),m&&e.push({property:"og:title",content:m}),p&&e.push({property:"og:description",content:p}),e.push({property:"og:url",content:T||(y?window.location.href:"")||"https://".concat(s.getDomain())}),j&&d===i.PRODUCT){var t=j.selectedVariant.mainImage;(null==t?void 0:t.image)&&e.push({property:"og:image",content:t.image.src})}else(null==f?void 0:f.logo)&&e.push({property:"og:image",content:f.logo.src});return e}),[m,j,T,p,f,v,f]),R=t.useMemo((function(){var t=[];if(f){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+s.getDomain()},a=function(t){var o,a,r,i,n,d,m=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:m,image:m,url:"https://"+s.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(r=null===(a=t.address)||void 0===a?void 0:a.city)||void 0===r?void 0:r.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(i=t.address)||void 0===i?void 0:i.postalCode,addressCountry:null===(d=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===d?void 0:d.code})}}(f);t.push(o),t.push(a)}if(j&&d===i.PRODUCT){var r=j,n=function(t,o){var a,r,i,n;try{var d="https://".concat(s.getDomain()).concat(t.href),m=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(a=t.metaData)||void 0===a?void 0:a.description,image:null===(r=m.images)||void 0===r?void 0:r.map((function(e){return e.image?e.image.src:""})),productId:m.id,sku:m.sku,mpn:(null===(i=m.barcodeList)||void 0===i?void 0:i.length)?m.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(n=t.brand)||void 0===n?void 0:n.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:d,priceCurrency:m.price.currency||"TRY",price:m.price.finalPrice,priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:m.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(r,h||null);if(n&&t.push(n),r.categories.length)(c=l(r.categories[0]))&&t.push(c)}if(j&&d===i.CATEGORY){var m=function(e){var t,o;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(s.getDomain()).concat(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(j),c=l(j);m&&t.push(m),c&&t.push(c)}return t}),[j,f]),_=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===d}));return t?c(j,d,t.titleTemplate||""):null}),[d,j]),I=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===d}));return t?c(j,d,t.descriptionTemplate||""):null}),[d,j]);return t.createElement(a,null,t.createElement("title",null,m||_||""),t.createElement("meta",{name:"description",content:p||I||""}),t.createElement(n,null),E.map((function(e){return t.createElement("link",{key:e.id,rel:"alternate",hrefLang:e.locale,href:"".concat(L+(e.path?"/"+e.path:""),"/").concat(k)})})),!!w&&!!E.length&&t.createElement("link",{key:"current-routing-hreflang",rel:"alternate",hrefLang:w.locale,href:"".concat(L).concat(C,"/").concat(k)}),!!g&&t.createElement("meta",{name:"robots",content:"noindex"}),!!v&&D.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!u&&u.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(L).concat(C).concat(e)})})),t.createElement("link",{rel:"canonical",href:"".concat(L).concat(C,"/").concat(k)}),!!R.length&&R.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function l(e){try{var t=d.getInstance(),o=e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:"https://"+s.getDomain()+e.href}}));return t.currentPageType===i.CATEGORY&&o.push({"@type":"ListItem",position:e.categoryPathItems.length+1,name:e.name,item:"https://"+s.getDomain()+e.href}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:e.categoryPathItems.length?o:[{"@type":"ListItem",position:1,name:e.name,item:"https://"+s.getDomain()+e.href}]}}catch(e){}}function c(e,t,o){var a,r,s=o;try{switch(t){case i.PRODUCT:var n=e,d=n.name,m=(null===(a=n.brand)||void 0===a?void 0:a.name)||"",l=n.selectedVariant.sku||"",c=(null===(r=n.selectedVariant.barcodeList)||void 0===r?void 0:r.length)?n.selectedVariant.barcodeList[0]:"";s.includes("{{name}}")&&(s=s.replace("{{name}}",d)),s.includes("{{brand}}")&&(s=s.replace("{{brand}}",m)),s.includes("{{sku}}")&&(s=s.replace("{{sku}}",l)),s.includes("{{barcode}}")&&(s=s.replace("{{barcode}}",c));break;case i.BRAND:case i.CATEGORY:case i.BLOG_CATEGORY:var p=e.name||"";s.includes("{{name}}")&&(s=s.replace("{{name}}",p));break;case i.BLOG:var u=e.title;s.includes("{{name}}")&&(s=s.replace("{{name}}",u))}}catch(e){}return s.trimEnd()}export{m as IkasPageHead};
@@ -0,0 +1 @@
1
+ const t=t=>((t,e)=>{const{forward:n=[],...i}=t||{},o=JSON.stringify(i,((t,e)=>("function"==typeof e&&(e=String(e)).startsWith(t+"(")&&(e="function "+e),e)));return["!(function(w,p,f,c){",Object.keys(i).length>0?`c=w[p]=Object.assign(w[p]||{},${o});`:"c=w[p]=w[p]||{};","c[f]=(c[f]||[])",n.length>0?`.concat(${JSON.stringify(n)})`:"","})(window,'partytown','forward');",e].join("")})(t,'/* Partytown 0.7.3 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,"/"==(a=(o.lib||"/~partytown/")+(o.debug?"debug/":""))[0]&&(s=e.querySelectorAll(\'script[type="text/partytown"]\'),i!=t?i.dispatchEvent(new CustomEvent("pt1",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener("pt0",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||"partytown-sw.js"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener("statechange",(function(t){"activated"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?"script":"iframe"),t||(c.setAttribute("style","display:block;width:0;height:0;border:0;visibility:hidden"),c.setAttribute("aria-hidden",!0)),c.src=a+"partytown-"+(t?"atomics.js?v=0.7.3":"sandbox-sw.html?"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement("script")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(".").map((function(e,n,i){p=p[i[n]]=n+1<i.length?"push"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),"complete"==e.readyState?u():(t.addEventListener("DOMContentLoaded",u),t.addEventListener("load",u))}(window,document,navigator,top,window.crossOriginIsolated);');export{t as partytownSnippet};
@@ -0,0 +1 @@
1
+ import t from"react";import{partytownSnippet as e}from"../integration/index.mjs.js";const n=(n={})=>{if("undefined"!=typeof document&&!document._partytown){if(!document.querySelector("script[data-partytown]")){const t=document.createElement("script");t.dataset.partytown="",t.innerHTML=e(n),document.head.appendChild(t)}document._partytown=!0}const r=e(n)+'document.currentScript.dataset.partytown="";';return t.createElement("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:r}})};export{n as Partytown};
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.5.0-beta.9",
3
+ "version": "5.0.0-beta.10",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
7
- "main": "build/index.js",
8
- "module": "build/index.js",
7
+ "main": "./build/index.js",
8
+ "module": "./build/index.js",
9
9
  "sideEffects": false,
10
10
  "files": [
11
11
  "build"
@@ -17,11 +17,11 @@
17
17
  "build": "rm -rf build && rollup -c"
18
18
  },
19
19
  "devDependencies": {
20
- "@ikas/storefront-api": "^4.5.0-beta.9",
21
- "@ikas/storefront-config": "^4.5.0-beta.9",
22
- "@ikas/storefront-model-functions": "^4.5.0-beta.9",
23
- "@ikas/storefront-models": "^4.5.0-beta.9",
24
- "@ikas/storefront-providers": "^4.5.0-beta.9",
20
+ "@ikas/storefront-api": "^5.0.0-beta.10",
21
+ "@ikas/storefront-config": "^5.0.0-beta.10",
22
+ "@ikas/storefront-model-functions": "^5.0.0-beta.10",
23
+ "@ikas/storefront-models": "^5.0.0-beta.10",
24
+ "@ikas/storefront-providers": "^5.0.0-beta.10",
25
25
  "@adyen/adyen-web": "^5.28.2",
26
26
  "@rollup/plugin-commonjs": "^22.0.0",
27
27
  "@rollup/plugin-json": "^4.1.0",
@@ -52,11 +52,11 @@
52
52
  "libphonenumber-js": "^1.10.6"
53
53
  },
54
54
  "peerDependencies": {
55
- "@ikas/storefront-api": "^4.5.0-beta.9",
56
- "@ikas/storefront-config": "^4.5.0-beta.9",
57
- "@ikas/storefront-model-functions": "^4.5.0-beta.9",
58
- "@ikas/storefront-models": "^4.5.0-beta.9",
59
- "@ikas/storefront-providers": "^4.5.0-beta.9",
55
+ "@ikas/storefront-api": "^5.0.0-beta.10",
56
+ "@ikas/storefront-config": "^5.0.0-beta.10",
57
+ "@ikas/storefront-model-functions": "^5.0.0-beta.10",
58
+ "@ikas/storefront-models": "^5.0.0-beta.10",
59
+ "@ikas/storefront-providers": "^5.0.0-beta.10",
60
60
  "mobx": "^6.1.3",
61
61
  "mobx-react-lite": "^3.1.5",
62
62
  "next": "12.2.0",