@ikas/storefront 6.1.0-beta.6 → 6.1.0-beta.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/build/analytics/analytics.d.ts +1 -1
  2. package/build/analytics/analytics.js +1 -1
  3. package/build/analytics/googleTagManager.js +1 -1
  4. package/build/analytics/ikasV3.d.ts +5 -0
  5. package/build/analytics/ikasV3.js +1 -1
  6. package/build/components/checkout/components/address-form/index.js +1 -1
  7. package/build/components/checkout/components/address-form/model.d.ts +2 -0
  8. package/build/components/checkout/components/address-form/model.js +1 -1
  9. package/build/components/checkout/components/cart-summary/index.d.ts +2 -0
  10. package/build/components/checkout/components/cart-summary/index.js +1 -1
  11. package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
  12. package/build/components/checkout/components/customer-addresses/index.d.ts +1 -0
  13. package/build/components/checkout/components/customer-addresses/index.js +1 -1
  14. package/build/components/checkout/components/form-item/index.js +1 -1
  15. package/build/components/checkout/components/form-item/model.d.ts +2 -0
  16. package/build/components/checkout/components/form-item/model.js +1 -1
  17. package/build/components/checkout/components/form-item/style.module.scss.js +1 -1
  18. package/build/components/checkout/components/input-with-button/style.module.scss.js +1 -1
  19. package/build/components/checkout/components/offer-product/index.js +1 -1
  20. package/build/components/checkout/components/stripe/checkout-form.js +1 -1
  21. package/build/components/checkout/index.js +1 -1
  22. package/build/components/checkout/model.d.ts +7 -2
  23. package/build/components/checkout/model.js +1 -1
  24. package/build/components/checkout/steps/step-info/index.js +1 -1
  25. package/build/components/checkout/steps/step-payment/billing-address/index.js +1 -1
  26. package/build/components/checkout/steps/step-success/index.js +1 -1
  27. package/build/components/index.d.ts +2 -0
  28. package/build/components/page/head.js +1 -1
  29. package/build/components/page/index.js +1 -1
  30. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  31. package/build/components/page-editor/model.js +1 -1
  32. package/build/components/paypal-express-checkout/index.d.ts +12 -0
  33. package/build/components/paypal-express-checkout/index.js +1 -0
  34. package/build/components/plain-image/index.d.ts +13 -0
  35. package/build/components/plain-image/index.js +1 -0
  36. package/build/components/popup/index.js +1 -1
  37. package/build/hooks/useStore.js +1 -1
  38. package/build/index.js +1 -1
  39. package/build/models/data/checkout-settings/index.d.ts +1 -0
  40. package/build/models/data/checkout-settings/index.js +1 -1
  41. package/build/models/data/order/gift-card-line/index.d.ts +8 -0
  42. package/build/models/data/order/gift-card-line/index.js +1 -0
  43. package/build/models/data/order/index.d.ts +2 -0
  44. package/build/models/data/order/index.js +1 -1
  45. package/build/models/data/order/line-item/bundle-product-settings/index.d.ts +7 -0
  46. package/build/models/data/order/line-item/bundle-product-settings/index.js +1 -0
  47. package/build/models/data/order/line-item/index.d.ts +2 -0
  48. package/build/models/data/order/line-item/index.js +1 -1
  49. package/build/models/data/product/index.js +1 -1
  50. package/build/models/ui/product-list/index.js +1 -1
  51. package/build/page-data-init/index.js +1 -1
  52. package/build/pages/checkout.js +1 -1
  53. package/build/store/cart/api.d.ts +2 -1
  54. package/build/store/cart/api.js +1 -1
  55. package/build/store/checkout/index.d.ts +2 -1
  56. package/build/store/checkout/index.js +1 -1
  57. package/build/store/customer/index.js +1 -1
  58. package/package.json +11 -11
@@ -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 i from"next/head.js";import{useRouter as a}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 r}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import{IkasProductList as s}from"../../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 d}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"../../pages/account/activate.js";import{IkasBaseStore as l}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var c=o((function(o){var s,c=o.pageType,g=o.pageTitle,f=o.pageDescription,v=o.canonicals,h=o.disableIndex,j=o.pageSpecificData,x=o.merchantSettings,y=o.addOgpMetas,b=o.productReviewSummary,C=o.pageComponentPropValues,T=a(),D="undefined"!=typeof window,L="local"===process.env.NEXT_PUBLIC_ENV,w=T.asPath.split("?")[0].replace("/",""),k=(w="/"===w.charAt(w.length-1)?w.slice(0,-1):w).startsWith("pages/"),O=d.getCurrentRouting(),P=(null==O?void 0:O.path)?"/"+O.path:"",R=L?"http://localhost:3333":"https://"+d.getDomain(),E=null===(s=d.getIndexPageSeoSettings())||void 0===s?void 0:s.find((function(e){return e.locale===d.getCurrentLocale()})),_=E?new n(E):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[c,j]);var I=t.useMemo((function(){if(j&&j.href)return"".concat(R).concat(j.href)}),[j]),V=t.useMemo((function(){var e,t,o,i=[];if(y){if(i.push({property:"og:type",content:"website"}),i.push({property:"og:site_name",content:"https://"+d.getDomain()}),g&&i.push({property:"og:title",content:g}),f&&i.push({property:"og:description",content:f}),c===r.INDEX){var a=null,n=null;!g&&(null==_?void 0:_.pageTitle)&&(a=_.pageTitle),!f&&(null==_?void 0:_.description)&&(n=_.description),(s=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c})))&&(a=u(j,c,s.titleTemplate||""),n=u(j,c,s.descriptionTemplate||"")),a&&i.push({property:"og:title",content:a}),n&&i.push({property:"og:description",content:n})}if(c===r.PRODUCT){var s,l=null,p=null;(s=null===(t=d.getMetaTemplates())||void 0===t?void 0:t.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c})))&&(l=u(j,c,s.titleTemplate||""),p=u(j,c,s.descriptionTemplate||"")),l&&!g&&i.push({property:"og:title",content:l}),p&&!f&&i.push({property:"og:description",content:p})}i.push({property:"og:url",content:I||(D?window.location.href:"")||"https://".concat(d.getDomain())});var m=null;if(j&&c===r.PRODUCT){var v=j.selectedVariant.mainImage;(null==v?void 0:v.image)&&(m={property:"og:image",content:v.image.src.replace(".webp",".jpg")})}if(j&&c===r.CATEGORY){var h=j;h.image&&(m={property:"og:image",content:h.image.src.replace(".webp",".jpg")})}if(j&&c===r.BRAND){var b=j;b.image&&(m={property:"og:image",content:b.image.src.replace(".webp",".jpg")})}if(j&&c===r.BLOG_CATEGORY){var C=j;C.image&&(m={property:"og:image",content:C.image.src.replace(".webp",".jpg")})}if(j&&c===r.BLOG){var T=j;T.image&&(m={property:"og:image",content:T.image.src.replace(".webp",".jpg")})}!m&&(null==_?void 0:_.icon)&&(m={property:"og:image",content:null===(o=null==_?void 0:_.icon)||void 0===o?void 0:o.src.replace(".webp",".jpg")}),!m&&(null==x?void 0:x.logo)&&(m={property:"og:image",content:x.logo.src.replace(".webp",".jpg")}),m&&i.push(m)}return i}),[g,j,I,f,x,y,x]),S=t.useMemo((function(){var t=[],o=(null==_?void 0:_.pageTitle)||(null==x?void 0:x.merchantName)||"";if(x){var i={"@context":"https://schema.org","@type":"Website",url:"https://"+d.getDomain()},a=function(t){var o,i,a,r,n,s,l=(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:l,image:l,url:"https://"+d.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===(a=null===(i=t.address)||void 0===i?void 0:i.city)||void 0===a?void 0:a.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(s=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===s?void 0:s.code})}}(x);t.push(i),t.push(a)}if(j&&c===r.PRODUCT){var n=j,s=function(t,o){var i,a,r,n,s;try{var l=d.getCurrentRouting(),c=null==l?void 0:l.path,p=function(e){return c?"https://".concat(d.getDomain(),"/").concat(c).concat(e):"https://".concat(d.getDomain()).concat(e)},m=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(i=t.metaData)||void 0===i?void 0:i.description,image:null===(a=m.images)||void 0===a?void 0:a.map((function(e){return e.image?e.image.src:""})),productId:m.id,sku:m.sku,mpn:(null===(r=m.barcodeList)||void 0===r?void 0:r.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:p(t.href),priceCurrency:m.price.currency||"TRY",price:(null!==(s=m.campaignPrice)&&void 0!==s?s:m.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:m.stock>0||m.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(n,b||null);if(s&&t.push(s),n.categories.length)(u=p(n.categories[0],o,n))&&t.push(u)}if(j&&c===r.CATEGORY){var l=function(e){var t,o;try{var i=d.getCurrentRouting(),a=null==i?void 0:i.path,r=function(e){return a?"https://".concat(d.getDomain(),"/").concat(a).concat(e):"https://".concat(d.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(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),u=p(j,o),g=m(C);l&&t.push(l),u&&t.push(u),g&&t.push(g)}j&&c===r.BRAND&&((g=m(C))&&t.push(g));if(j&&c===r.BLOG){var f=function(t){var o;try{var i="https://".concat(d.getDomain()).concat(t.href),a=function(e){var t=new Date(e),o=t.getFullYear(),i=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(i,"-").concat(a)},r="".concat(t.writer.firstName," ").concat(t.writer.lastName),n=(new DOMParser).parseFromString(t.blogContent.content,"text/html").body.textContent;return e(e({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,image:null===(o=t.image)||void 0===o?void 0:o.src},t.category&&{genre:t.category.name}),{url:i,datePublished:a(t.createdAt),dateCreated:a(t.createdAt),dateModified:a(t.updatedAt),description:t.shortDescription,articleBody:n,author:{"@type":"Person",name:r}})}catch(e){}}(j);f&&t.push(f)}return t}),[j,x]),N=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c}));return t?u(j,c,t.titleTemplate||""):null}),[c,j]),A=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c}));return t?u(j,c,t.descriptionTemplate||""):null}),[c,j]),M=t.useMemo((function(){return!d.getFavicon()&&(null==_?void 0:_.favIcon)?_.favIcon:null}),[]),B=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){B.push({routing:e,hrefLang:e.locale+"-"+t})})):B.push({routing:e,hrefLang:e.locale})}));var F=function(e){var t,o,i,a,r,n=j,s=null===(o=null===(t=null==n?void 0:n.metaData)||void 0===t?void 0:t.translations)||void 0===o?void 0:o.find((function(t){return t.locale===e.locale}));if(s&&(null==s?void 0:s.slug))return s.slug;var d=B.find((function(e){return!e.routing.path}));return d&&(null===(r=null===(a=null===(i=null==n?void 0:n.metaData)||void 0===i?void 0:i.translations)||void 0===a?void 0:a.find((function(e){return e.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""},G=l.getInstance();return t.createElement(i,null,t.createElement("title",null,g||N||(null==_?void 0:_.pageTitle)||""),t.createElement("meta",{name:"description",content:f||A||(null==_?void 0:_.description)||""}),B.length>1&&B.filter((function(e){return!k||e.routing.id===(null==O?void 0:O.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(R+(e.routing.path?"/"+e.routing.path:""),"/").concat(F(e.routing))})})),!!h&&t.createElement("meta",{name:"robots",content:"noindex"}),!!y&&V.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!v&&v.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(R).concat(P).concat(e)})})),M&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(M,"/image_180.webp"),type:"image/webp"}),!v&&G.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(R).concat(P,"/").concat(w)}),!!S.length&&S.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function p(e,t,o){try{var i=l.getInstance(),a=d.getCurrentRouting(),n=null==a?void 0:a.path,s=function(e){return n?"https://".concat(d.getDomain(),"/").concat(n).concat(e):"https://".concat(d.getDomain()).concat(e)},c=[{"@type":"ListItem",position:1,name:t,item:"https://".concat(d.getDomain())}];return(c=c.concat(e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+2,name:e.name,item:s(e.href)}})))).push({"@type":"ListItem",position:c.length+1,name:e.name,item:s(e.href)}),i.currentPageType===r.PRODUCT&&o&&c.push({"@type":"ListItem",position:c.length+1,name:o.name,item:s(o.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:c}}catch(e){}}function m(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var i=(e.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[]).find((function(e){return Object.values(e.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}))}));if(i){var a=Object.values(i.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(a)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(a.data||[]).slice(0,10).map((function(e,t){var i,a,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(a=null===(i=e.selectedVariant.mainImage)||void 0===i?void 0:i.image)||void 0===a?void 0:a.src)||"",offers:{"@type":"Offer",url:(n=e.href,o?"https://".concat(d.getDomain(),"/").concat(o).concat(n):"https://".concat(d.getDomain()).concat(n)),priceCurrency:e.selectedVariant.price.currency||"TRY",price:(null!==(r=e.selectedVariant.campaignPrice)&&void 0!==r?r:e.selectedVariant.finalPrice).toFixed(2),availability:e.selectedVariant.stock>0||e.selectedVariant.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}}}))}}}}catch(e){}}function u(e,t,o){var i,a,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,l=(null===(i=s.brand)||void 0===i?void 0:i.name)||"",c=s.selectedVariant.sku||"",p=(null===(a=s.selectedVariant.barcodeList)||void 0===a?void 0:a.length)?s.selectedVariant.barcodeList[0]:"",m=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",l)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",c)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",p)),n.includes("{{price}}")&&(n=g(n,"{{price}}",m.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var u=e.name||"";n.includes("{{name}}")&&(n=g(n,"{{name}}",u));break;case r.BLOG:var f=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",f))}}catch(e){}return n.trimEnd()}function g(e,t,o){var i=new RegExp(t,"g");return e.replace(i,o)}export{c 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 i from"next/head.js";import{useRouter as a}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 r}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import{IkasProductList as s}from"../../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 d}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"../paypal-express-checkout/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"../../pages/account/activate.js";import{IkasBaseStore as l}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var c=o((function(o){var s,c=o.pageType,g=o.pageTitle,f=o.pageDescription,v=o.canonicals,h=o.disableIndex,j=o.pageSpecificData,x=o.merchantSettings,y=o.addOgpMetas,b=o.productReviewSummary,C=o.pageComponentPropValues,T=a(),D="undefined"!=typeof window,L="local"===process.env.NEXT_PUBLIC_ENV,k=T.asPath.split("?")[0].replace("/",""),w=(k="/"===k.charAt(k.length-1)?k.slice(0,-1):k).startsWith("pages/"),O=d.getCurrentRouting(),P=(null==O?void 0:O.path)?"/"+O.path:"",R=L?"http://localhost:3333":"https://"+d.getDomain(),E=null===(s=d.getIndexPageSeoSettings())||void 0===s?void 0:s.find((function(e){return e.locale===d.getCurrentLocale()})),_=E?new n(E):null;t.useEffect((function(){document.documentElement.lang=d.getCurrentLocale()}),[c,j]);var I=t.useMemo((function(){if(j&&j.href)return"".concat(R).concat(j.href)}),[j]),V=t.useMemo((function(){var e,t,o,i=[];if(y){if(i.push({property:"og:type",content:"website"}),i.push({property:"og:site_name",content:"https://"+d.getDomain()}),g&&i.push({property:"og:title",content:g}),f&&i.push({property:"og:description",content:f}),c===r.INDEX){var a=null,n=null;!g&&(null==_?void 0:_.pageTitle)&&(a=_.pageTitle),!f&&(null==_?void 0:_.description)&&(n=_.description),(s=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c})))&&(a=u(j,c,s.titleTemplate||""),n=u(j,c,s.descriptionTemplate||"")),a&&i.push({property:"og:title",content:a}),n&&i.push({property:"og:description",content:n})}if(c===r.PRODUCT){var s,l=null,p=null;(s=null===(t=d.getMetaTemplates())||void 0===t?void 0:t.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c})))&&(l=u(j,c,s.titleTemplate||""),p=u(j,c,s.descriptionTemplate||"")),l&&!g&&i.push({property:"og:title",content:l}),p&&!f&&i.push({property:"og:description",content:p})}i.push({property:"og:url",content:I||(D?window.location.href:"")||"https://".concat(d.getDomain())});var m=null;if(j&&c===r.PRODUCT){var v=j.selectedVariant.mainImage;(null==v?void 0:v.image)&&(m={property:"og:image",content:v.image.src.replace(".webp",".jpg")})}if(j&&c===r.CATEGORY){var h=j;h.image&&(m={property:"og:image",content:h.image.src.replace(".webp",".jpg")})}if(j&&c===r.BRAND){var b=j;b.image&&(m={property:"og:image",content:b.image.src.replace(".webp",".jpg")})}if(j&&c===r.BLOG_CATEGORY){var C=j;C.image&&(m={property:"og:image",content:C.image.src.replace(".webp",".jpg")})}if(j&&c===r.BLOG){var T=j;T.image&&(m={property:"og:image",content:T.image.src.replace(".webp",".jpg")})}!m&&(null==_?void 0:_.icon)&&(m={property:"og:image",content:null===(o=null==_?void 0:_.icon)||void 0===o?void 0:o.src.replace(".webp",".jpg")}),!m&&(null==x?void 0:x.logo)&&(m={property:"og:image",content:x.logo.src.replace(".webp",".jpg")}),m&&i.push(m)}return i}),[g,j,I,f,x,y,x]),S=t.useMemo((function(){var t=[],o=(null==_?void 0:_.pageTitle)||(null==x?void 0:x.merchantName)||"";if(x){var i={"@context":"https://schema.org","@type":"Website",url:"https://"+d.getDomain()},a=function(t){var o,i,a,r,n,s,l=(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:l,image:l,url:"https://"+d.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===(a=null===(i=t.address)||void 0===i?void 0:i.city)||void 0===a?void 0:a.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(s=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===s?void 0:s.code})}}(x);t.push(i),t.push(a)}if(j&&c===r.PRODUCT){var n=j,s=function(t,o){var i,a,n,s,l,c;try{var p=d.getCurrentRouting(),m=null==p?void 0:p.path,g=function(e){return m?"https://".concat(d.getDomain(),"/").concat(m).concat(e):"https://".concat(d.getDomain()).concat(e)},f=t.selectedVariant,v=null,h=null===(i=d.getMetaTemplates())||void 0===i?void 0:i.find((function(e){return e.locale===d.getCurrentLocale()&&r.PRODUCT}));return h&&(v=u(t,r.PRODUCT,h.descriptionTemplate||"")),e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:(null===(a=t.metaData)||void 0===a?void 0:a.description)||v,image:null===(n=f.images)||void 0===n?void 0:n.map((function(e){return e.image?e.image.src:""})),productId:f.id,sku:f.sku,mpn:(null===(s=f.barcodeList)||void 0===s?void 0:s.length)?f.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(l=t.brand)||void 0===l?void 0:l.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:g(t.href),priceCurrency:f.price.currency||"TRY",price:(null!==(c=f.campaignPrice)&&void 0!==c?c:f.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:f.stock>0||f.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(n,b||null);if(s&&t.push(s),n.categories.length)(g=p(n.categories[0],o,n))&&t.push(g)}if(j&&c===r.CATEGORY){var l=function(e){var t,o;try{var i=d.getCurrentRouting(),a=null==i?void 0:i.path,r=function(e){return a?"https://".concat(d.getDomain(),"/").concat(a).concat(e):"https://".concat(d.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(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),g=p(j,o),f=m(C);l&&t.push(l),g&&t.push(g),f&&t.push(f)}j&&c===r.BRAND&&((f=m(C))&&t.push(f));if(j&&c===r.BLOG){var v=function(t){var o;try{var i="https://".concat(d.getDomain()).concat(t.href),a=function(e){var t=new Date(e),o=t.getFullYear(),i=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(i,"-").concat(a)},r="".concat(t.writer.firstName," ").concat(t.writer.lastName),n=(new DOMParser).parseFromString(t.blogContent.content,"text/html").body.textContent;return e(e({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,image:null===(o=t.image)||void 0===o?void 0:o.src},t.category&&{genre:t.category.name}),{url:i,datePublished:a(t.createdAt),dateCreated:a(t.createdAt),dateModified:a(t.updatedAt),description:t.shortDescription,articleBody:n,author:{"@type":"Person",name:r}})}catch(e){}}(j);v&&t.push(v)}return t}),[j,x]),M=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c}));return t?u(j,c,t.titleTemplate||""):null}),[c,j]),N=t.useMemo((function(){var e,t=null===(e=d.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===d.getCurrentLocale()&&e.pageType===c}));return t?u(j,c,t.descriptionTemplate||""):null}),[c,j]),A=t.useMemo((function(){return!d.getFavicon()&&(null==_?void 0:_.favIcon)?_.favIcon:null}),[]),B=[];d.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){B.push({routing:e,hrefLang:e.locale+"-"+t})})):B.push({routing:e,hrefLang:e.locale})}));var U=function(e){var t,o,i,a,r,n=j,s=null===(o=null===(t=null==n?void 0:n.metaData)||void 0===t?void 0:t.translations)||void 0===o?void 0:o.find((function(t){return t.locale===e.locale}));if(s&&(null==s?void 0:s.slug))return s.slug;var d=B.find((function(e){return!e.routing.path}));return d&&(null===(r=null===(a=null===(i=null==n?void 0:n.metaData)||void 0===i?void 0:i.translations)||void 0===a?void 0:a.find((function(e){return e.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""},F=l.getInstance();return t.createElement(i,null,t.createElement("title",null,g||M||(null==_?void 0:_.pageTitle)||""),t.createElement("meta",{name:"description",content:f||N||(null==_?void 0:_.description)||""}),B.length>1&&B.filter((function(e){return!w||e.routing.id===(null==O?void 0:O.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(R+(e.routing.path?"/"+e.routing.path:""),"/").concat(U(e.routing))})})),!!h&&t.createElement("meta",{name:"robots",content:"noindex"}),!!y&&V.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!v&&v.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(R).concat(P).concat(e)})})),A&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(A,"/image_180.webp"),type:"image/webp"}),!v&&F.currentPageType!==r.NOT_FOUND&&t.createElement("link",{rel:"canonical",href:"".concat(R).concat(P,"/").concat(k)}),!!S.length&&S.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function p(e,t,o){try{var i=l.getInstance(),a=d.getCurrentRouting(),n=null==a?void 0:a.path,s=function(e){return n?"https://".concat(d.getDomain(),"/").concat(n).concat(e):"https://".concat(d.getDomain()).concat(e)},c=[{"@type":"ListItem",position:1,name:t,item:"https://".concat(d.getDomain())}];return(c=c.concat(e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+2,name:e.name,item:s(e.href)}})))).push({"@type":"ListItem",position:c.length+1,name:e.name,item:s(e.href)}),i.currentPageType===r.PRODUCT&&o&&c.push({"@type":"ListItem",position:c.length+1,name:o.name,item:s(o.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:c}}catch(e){}}function m(e){try{var t=d.getCurrentRouting(),o=null==t?void 0:t.path;if(e){var i=(e.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[]).find((function(e){return Object.values(e.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}))}));if(i){var a=Object.values(i.propValues).find((function(e){var t;return e instanceof s&&(null===(t=e._productListPropValue)||void 0===t?void 0:t.usePageFilter)}));if(a)return{"@context":"http://schema.org","@type":"ItemList",itemListElement:(a.data||[]).slice(0,10).map((function(e,t){var i,a,r,n;return{"@type":"ListItem",position:t+1,item:{"@type":"Product",name:e.name,image:(null===(a=null===(i=e.selectedVariant.mainImage)||void 0===i?void 0:i.image)||void 0===a?void 0:a.src)||"",offers:{"@type":"Offer",url:(n=e.href,o?"https://".concat(d.getDomain(),"/").concat(o).concat(n):"https://".concat(d.getDomain()).concat(n)),priceCurrency:e.selectedVariant.price.currency||"TRY",price:(null!==(r=e.selectedVariant.campaignPrice)&&void 0!==r?r:e.selectedVariant.finalPrice).toFixed(2),availability:e.selectedVariant.stock>0||e.selectedVariant.sellIfOutOfStock?"https://schema.org/InStock":"https://schema.org/OutOfStock"}}}}))}}}}catch(e){}}function u(e,t,o){var i,a,n=o;try{switch(t){case r.PRODUCT:var s=e,d=s.name,l=(null===(i=s.brand)||void 0===i?void 0:i.name)||"",c=s.selectedVariant.sku||"",p=(null===(a=s.selectedVariant.barcodeList)||void 0===a?void 0:a.length)?s.selectedVariant.barcodeList[0]:"",m=s.selectedVariant.campaignPrice?s.selectedVariant.formattedCampaignPrice:s.selectedVariant.formattedFinalPrice;n.includes("{{name}}")&&(n=g(n,"{{name}}",d)),n.includes("{{brand}}")&&(n=g(n,"{{brand}}",l)),n.includes("{{sku}}")&&(n=g(n,"{{sku}}",c)),n.includes("{{barcode}}")&&(n=g(n,"{{barcode}}",p)),n.includes("{{price}}")&&(n=g(n,"{{price}}",m.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var u=e.name||"";n.includes("{{name}}")&&(n=g(n,"{{name}}",u));break;case r.BLOG:var f=e.title;n.includes("{{name}}")&&(n=g(n,"{{name}}",f))}}catch(e){}return n.trimEnd()}function g(e,t,o){var i=new RegExp(t,"g");return e.replace(i,o)}export{c as IkasPageHead};
@@ -1 +1 @@
1
- import{__assign as e,__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as r}from"mobx-react-lite";import{useRouter as a}from"next/router.js";import s from"next/dynamic";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 d}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasMerchantSettings as n}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as m}from"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import{Analytics as l}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasPageHead as c}from"./head.js";import{ThemeComponent as u}from"./ThemeComponent.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{initIkasEvents as j}from"../../analytics/events.js";import{IkasPageDataInit as x}from"../../page-data-init/index.js";import{setAPIClientConfig as g}from"@ikas/storefront-api";var v=s((function(){return import("../popup/index.js").then((function(e){return e.PopupListRendererForPage}))}),{ssr:!1}),y=r((function(r){var s=r.propValues,u=r.themeJsonComponents,y=r.customDataList,w=r.pageType,b=r.pageTitle,S=r.pageDescription,C=r.pageSpecificData,P=r.canonicals,D=r.disableIndex,k=r.settings,T=r.configJson,E=r.reInitOnBrowser,I=r.addOgpMetas,R=r.components,M=r.productReviewSummary,V=a(),O=i.useState(),z=O[0],B=O[1];p.init(e(e({},T),{currentPageComponents:R,loginRequiredCallback:function(){V.push("/account/login")}})),f.getInstance().router=V,g();var A=f.getInstance();A.router=V,A.currentPageType=w;var F=i.useState(!1),H=F[0],L=F[1],U=i.useMemo((function(){return(null==z?void 0:z.id)===(null==C?void 0:C.id)&&x.pageSpecificData&&x.isBrowser?w===d.PRODUCT&&x._initProductOnBrowser(x.pageSpecificData):x.setPageSpecificData(C,w,H),x.initPagePropValues(s,u,y.map((function(e){return new m(e)})),k,H)}),[H,s,w,k,C,u]);i.useEffect((function(){E&&L("undefined"!=typeof window),window.addToCart=A.cartStore._windowAddToCart,A.cartStore.getCart(),A.checkLocalization(),j()}),[]),i.useEffect((function(){C?(null==z?void 0:z.id)!==C.id&&B(C):B(null)}),[C]),i.useEffect((function(){var e=function(){A.customerStore.routeChangeInit()};return V.events.on("routeChangeStart",e),function(){V.events.off("routeChangeStart",e)}}),[]),i.useEffect((function(){!function(e,i){var r,a;t(this,void 0,void 0,(function(){var t,s,n,m,p,c;return o(this,(function(o){switch(o.label){case 0:t=f.getInstance(),l.pageView(e),o.label=1;case 1:return o.trys.push([1,4,,5]),e===d.PRODUCT&&(s=i,l.productView(s),t.customerStore.onProductView(s.id,s.selectedVariant.id)),e===d.CATEGORY&&(m=null===(r=(n=i).categoryPathItems)||void 0===r?void 0:r.map((function(e){return e.name})).join(" > "),m=n.categoryPathItems&&(null===(a=n.categoryPathItems)||void 0===a?void 0:a.length)>0?m+" > "+n.name:n.name,l.viewCategory(m,n)),e===d.BRAND&&(p=i,l.viewBrand(p)),e!==d.CART?[3,3]:[4,t.cartStore.waitUntilInitialized()];case 2:o.sent(),l.viewCart(t.cartStore.cart),o.label=3;case 3:return[3,5];case 4:return c=o.sent(),console.error(c),[3,5];case 5:return[2]}}))}))}(w,x.pageSpecificData)}),[w,C]);var _=i.useMemo((function(){var e=U.find((function(e){return e.component.isHeader})),t=U.find((function(e){return e.component.isFooter})),o=U.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[];return i.createElement("div",{style:{position:"relative",minHeight:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"}},i.createElement("div",null,e&&h(e,k,-1),o.map((function(e,t){return h(e,k,t)}))),t&&h(t,k,-1),i.createElement(v,{key:Date.now()}))}),[U,k]),J=i.useMemo((function(){return p.getMerchantSettings()?new n(p.getMerchantSettings()):null}),[p.getMerchantSettings()]);return i.createElement(i.Fragment,null,i.createElement(c,{pageType:w,pageTitle:b,pageDescription:S,pageSpecificData:x.pageSpecificData,canonicals:P,disableIndex:D,merchantSettings:J,addOgpMetas:I,productReviewSummary:M,pageComponentPropValues:U}),_)})),h=function(e,t,o){return i.createElement(u,{key:e.pageComponent.id,index:o,pageComponentPropValue:e,settings:t})};export{y as IkasPage,h as renderComponent};
1
+ import{__assign as e,__awaiter as t,__generator as o}from'./../../ext/tslib/tslib.es6.js';import*as i from"react";import{observer as r}from"mobx-react-lite";import{useRouter as a}from"next/router.js";import s from"next/dynamic";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 d}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasMerchantSettings as n}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import{IkasThemeJsonCustomData as m}from"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import{Analytics as l}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasPageHead as c}from"./head.js";import{ThemeComponent as u}from"./ThemeComponent.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{initIkasEvents as j}from"../../analytics/events.js";import{IkasPageDataInit as x}from"../../page-data-init/index.js";import{setAPIClientConfig as g}from"@ikas/storefront-api";var v=s((function(){return import("../popup/index.js").then((function(e){return e.PopupListRendererForPage}))}),{ssr:!1}),y=r((function(r){var s=r.propValues,u=r.themeJsonComponents,y=r.customDataList,w=r.pageType,b=r.pageTitle,S=r.pageDescription,C=r.pageSpecificData,P=r.canonicals,D=r.disableIndex,k=r.settings,T=r.configJson,E=r.reInitOnBrowser,I=r.addOgpMetas,R=r.components,M=r.productReviewSummary,V=a(),O=i.useState(),z=O[0],B=O[1];p.init(e(e({},T),{currentPageComponents:R,loginRequiredCallback:function(){V.push("/account/login")}})),f.getInstance().router=V,g();var A=f.getInstance();A.router=V,A.currentPageType=w;var F=i.useState(!1),H=F[0],L=F[1],U=i.useMemo((function(){return(null==z?void 0:z.id)===(null==C?void 0:C.id)&&x.pageSpecificData&&x.isBrowser?w===d.PRODUCT&&x._initProductOnBrowser(x.pageSpecificData):x.setPageSpecificData(C,w,H),x.initPagePropValues(s,u,y.map((function(e){return new m(e)})),k,H)}),[H,s,w,k,C,u]);i.useEffect((function(){E&&L("undefined"!=typeof window),window.addToCart=A.cartStore._windowAddToCart,A.cartStore.getCart(),A.checkLocalization(),j()}),[]),i.useEffect((function(){C?(null==z?void 0:z.id)!==C.id&&B(C):B(null)}),[C]),i.useEffect((function(){var e=function(){A.customerStore.routeChangeInit()};return V.events.on("routeChangeStart",e),function(){V.events.off("routeChangeStart",e)}}),[]),i.useEffect((function(){!function(e,i){var r,a;t(this,void 0,void 0,(function(){var t,s,n,m,p,c;return o(this,(function(o){switch(o.label){case 0:t=f.getInstance(),l.pageView(e),o.label=1;case 1:return o.trys.push([1,4,,5]),e===d.PRODUCT&&(s=i,l.productView(s),t.customerStore.onProductView(s.id,s.selectedVariant.id)),e===d.CATEGORY&&(m=null===(r=(n=i).categoryPathItems)||void 0===r?void 0:r.map((function(e){return e.name})).join(" > "),m=n.categoryPathItems&&(null===(a=n.categoryPathItems)||void 0===a?void 0:a.length)>0?m+" > "+n.name:n.name,l.viewCategory(m,n)),e===d.BRAND&&(p=i,l.viewBrand(p)),e!==d.CART?[3,3]:[4,t.cartStore.waitUntilInitialized()];case 2:o.sent(),l.viewCart(t.cartStore.cart),o.label=3;case 3:return[3,5];case 4:return c=o.sent(),console.error(c),[3,5];case 5:return[2]}}))}))}(w,x.pageSpecificData)}),[w,C]);var _=i.useMemo((function(){var e=U.find((function(e){return e.component.isHeader})),t=U.find((function(e){return e.component.isFooter})),o=U.filter((function(e){return!e.component.isHeader&&!e.component.isFooter}))||[];return i.createElement("div",{style:{position:"relative",minHeight:"100vh",display:"flex",flexDirection:"column",justifyContent:"space-between"}},i.createElement("div",null,e&&h(e,k,-1),o.map((function(e,t){return h(e,k,t)}))),t&&h(t,k,-1),i.createElement(v,{key:Date.now()}))}),[U,k]),J=i.useMemo((function(){return p.getMerchantSettings()?new n(p.getMerchantSettings()):null}),[p.getMerchantSettings()]);return i.createElement(i.Fragment,null,i.createElement(c,{pageType:w,pageTitle:b,pageDescription:S,pageSpecificData:x.pageSpecificData,canonicals:P&&P.length>0?P:null,disableIndex:D,merchantSettings:J,addOgpMetas:I,productReviewSummary:M,pageComponentPropValues:U}),_)})),h=function(e,t,o){return i.createElement(u,{key:e.pageComponent.id,index:o,pageComponentPropValue:e,settings:t})};export{y as IkasPage,h as renderComponent};
@@ -1 +1 @@
1
- import{__extends as e,__assign as o}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import r from"./error/index.js";import{makeObservable as i,computed as n}from"mobx";import a from"../checkout/index.js";import{Observer as d}from"mobx-react-lite";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 s,IkasOrderLineItemStatus as m,IkasCheckoutRequirement as p,IkasCouponCodeRequirement as l,IkasThemeJsonComponentPropType as u}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import{IkasCheckout as c}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as f}from"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import{IkasOrderLineItem as j}from"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as v}from"@ikas/storefront-config";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{IkasBaseStore as x}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";var y=function(y){function h(e){var o=y.call(this,e)||this;return o.state={hasError:!1},o.onMouseEnter=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseOver(r.id)},o.onMouseLeave=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseLeave(r.id)},o.onClick=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onClick(r.id)},o.ref=t.createRef(),i(o,{pageComponentPropValue:n,propValues:n,isSelected:n,isHovered:n,hasNullValue:n,rendered:n,Component:n}),o}return e(h,y),h.prototype.componentDidMount=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},h.prototype.componentDidUpdate=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},h.getDerivedStateFromError=function(e){return console.error(e),{hasError:!0}},Object.defineProperty(h.prototype,"pageComponentPropValue",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.initializedPropValues.find((function(e){return e.pageComponent.id===t.id}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"propValues",{get:function(){var e,t,r=this.props.vm,i=null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.propValues;(null===(t=r.page)||void 0===t?void 0:t.type)===s.CHECKOUT&&(i={checkout:new c({currencyCode:"TRY",currencySymbol:"₺",orderLineItems:[new j({id:"",createdAt:0,updatedAt:0,currencyCode:"TRY",currencySymbol:"₺",discount:null,discountPrice:null,finalPrice:100,options:null,originalOrderLineItemId:null,price:100,quantity:1,status:m.UNFULFILLED,statusUpdatedAt:null,stockLocationId:null,taxValue:null,unitPrice:null,finalUnitPrice:null,variant:{barcodeList:null,brand:null,categories:null,fileId:null,id:null,mainImageId:null,name:"",prices:null,productId:null,sku:null,slug:null,tagIds:null,taxValue:null,type:null,weight:null,hsCode:null,variantValues:[],baseUnit:null,unit:null,tags:null,bundleProducts:null},orderedAt:0})]}),checkoutSettings:new f({createdAt:0,updatedAt:0,id:"",giftPackagePriceList:null,identityNumberRequirement:p.OPTIONAL,isAccountRequired:!1,isGiftPackageEnabled:!1,isQuickRegistrationEnabled:!1,isShowPostalCode:!0,isTermsAndConditionsDefaultChecked:null,options:null,phoneRequirement:p.OPTIONAL,postalCodeRequirement:p.OPTIONAL,showCheckoutNote:!0,showCompanyInfoInShippingAddress:null,showTermsAndConditionsCheckbox:!0,storefrontId:"",couponCodeRequirement:l.DEFAULT,corporateInvoiceRequirement:null}),customizationProps:o({},i),returnPolicy:"",privacyPolicy:"",termsOfService:"",imprint:"",shippingPolicy:""});return i},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isSelected",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.selectedPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isHovered",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.hoveredPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"hasNullValue",{get:function(){var e,o=this;return!!(null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.props.some((function(e){var t;if(e.isRequired){var r=(o.propValues||{})[e.name],i=null===(t=o.pageComponentPropValue)||void 0===t?void 0:t.component.props.find((function(o){return o.id===e.requiredPropId}));if(i){var n=(o.propValues||{})[i.name];if(i.type===u.BOOLEAN&&!n||i.type===u.CUSTOM&&n!==e.requiredEnumOptionValue)return!1}return null===r||null==r}})))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"rendered",{get:function(){var e,i,n=this.Component,a=this.props.vm;return this.hasNullValue||this.state.hasError?t.createElement(r,{name:null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.displayName}):t.createElement(n,o({},this.propValues,{store:x.getInstance(),settings:null===(i=a.theme)||void 0===i?void 0:i.settings,pageSpecificData:g.pageSpecificData}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"Component",{get:function(){var e,o=this.props,t=o.vm,r=o.pageComponent,i=v.getCurrentPageComponents();if(!i)return null;var n=i[r.componentId];return(null===(e=t.page)||void 0===e?void 0:e.type)===s.CHECKOUT&&(n=a),n},enumerable:!1,configurable:!0}),h.prototype.render=function(){var e=this;return t.createElement(d,null,(function(){var o;return e.state.hasError?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onClick:e.onClick},t.createElement(r,{name:null===(o=e.pageComponentPropValue)||void 0===o?void 0:o.component.displayName})):v.getCurrentPageComponents()?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},e.rendered):(console.error("Components for the page not found."),null)}))},h}(t.Component);export{y as ThemeEditorComponent};
1
+ import{__extends as e,__assign as o}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import r from"./error/index.js";import{makeObservable as i,computed as n}from"mobx";import a from"../checkout/index.js";import{Observer as d}from"mobx-react-lite";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 s,IkasOrderLineItemStatus as m,IkasCheckoutRequirement as l,IkasCouponCodeRequirement as p,IkasThemeJsonComponentPropType as u}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import{IkasCheckout as c}from"../../models/data/checkout/index.js";import{IkasCheckoutSettings as f}from"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import{IkasOrderLineItem as j}from"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as v}from"@ikas/storefront-config";import{IkasPageDataInit as g}from"../../page-data-init/index.js";import{IkasBaseStore as x}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";var h=function(h){function y(e){var o=h.call(this,e)||this;return o.state={hasError:!1},o.onMouseEnter=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseOver(r.id)},o.onMouseLeave=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onMouseLeave(r.id)},o.onClick=function(){var e=o.props,t=e.vm,r=e.pageComponent;t.onClick(r.id)},o.ref=t.createRef(),i(o,{pageComponentPropValue:n,propValues:n,isSelected:n,isHovered:n,hasNullValue:n,rendered:n,Component:n}),o}return e(y,h),y.prototype.componentDidMount=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},y.prototype.componentDidUpdate=function(){var e=this.props,o=e.vm,t=e.pageComponent;o.setComponentRef(this.ref.current,t)},y.getDerivedStateFromError=function(e){return console.error(e),{hasError:!0}},Object.defineProperty(y.prototype,"pageComponentPropValue",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.initializedPropValues.find((function(e){return e.pageComponent.id===t.id}))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"propValues",{get:function(){var e,t,r=this.props.vm,i=null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.propValues;(null===(t=r.page)||void 0===t?void 0:t.type)===s.CHECKOUT&&(i={checkout:new c({currencyCode:"TRY",currencySymbol:"₺",orderLineItems:[new j({id:"",createdAt:0,updatedAt:0,bundleProductSettings:null,currencyCode:"TRY",currencySymbol:"₺",discount:null,discountPrice:null,finalPrice:100,options:null,originalOrderLineItemId:null,price:100,quantity:1,status:m.UNFULFILLED,statusUpdatedAt:null,stockLocationId:null,taxValue:null,unitPrice:null,finalUnitPrice:null,variant:{barcodeList:null,brand:null,categories:null,fileId:null,id:null,mainImageId:null,name:"",prices:null,productId:null,sku:null,slug:null,tagIds:null,taxValue:null,type:null,weight:null,hsCode:null,variantValues:[],baseUnit:null,unit:null,tags:null,bundleProducts:null},orderedAt:0})]}),checkoutSettings:new f({createdAt:0,updatedAt:0,id:"",giftPackagePriceList:null,identityNumberRequirement:l.OPTIONAL,isAccountRequired:!1,isGiftPackageEnabled:!1,isQuickRegistrationEnabled:!1,isShowPostalCode:!0,isTermsAndConditionsDefaultChecked:null,options:null,phoneRequirement:l.OPTIONAL,postalCodeRequirement:l.OPTIONAL,showCheckoutNote:!0,showCompanyInfoInShippingAddress:null,showBillingAddressOnShippingStep:null,showTermsAndConditionsCheckbox:!0,storefrontId:"",couponCodeRequirement:p.DEFAULT,corporateInvoiceRequirement:null}),customizationProps:o({},i),returnPolicy:"",privacyPolicy:"",termsOfService:"",imprint:"",shippingPolicy:""});return i},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isSelected",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.selectedPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isHovered",{get:function(){var e=this.props,o=e.vm,t=e.pageComponent;return o.hoveredPageComponentId===t.id},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"hasNullValue",{get:function(){var e,o=this;return!!(null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.props.some((function(e){var t;if(e.isRequired){var r=(o.propValues||{})[e.name],i=null===(t=o.pageComponentPropValue)||void 0===t?void 0:t.component.props.find((function(o){return o.id===e.requiredPropId}));if(i){var n=(o.propValues||{})[i.name];if(i.type===u.BOOLEAN&&!n||i.type===u.CUSTOM&&n!==e.requiredEnumOptionValue)return!1}return null===r||null==r}})))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"rendered",{get:function(){var e,i,n=this.Component,a=this.props.vm;return this.hasNullValue||this.state.hasError?t.createElement(r,{name:null===(e=this.pageComponentPropValue)||void 0===e?void 0:e.component.displayName}):t.createElement(n,o({},this.propValues,{store:x.getInstance(),settings:null===(i=a.theme)||void 0===i?void 0:i.settings,pageSpecificData:g.pageSpecificData}))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"Component",{get:function(){var e,o=this.props,t=o.vm,r=o.pageComponent,i=v.getCurrentPageComponents();if(!i)return null;var n=i[r.componentId];return(null===(e=t.page)||void 0===e?void 0:e.type)===s.CHECKOUT&&(n=a),n},enumerable:!1,configurable:!0}),y.prototype.render=function(){var e=this;return t.createElement(d,null,(function(){var o;return e.state.hasError?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onClick:e.onClick},t.createElement(r,{name:null===(o=e.pageComponentPropValue)||void 0===o?void 0:o.component.displayName})):v.getCurrentPageComponents()?t.createElement("div",{ref:e.ref,style:{position:"relative"},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},e.rendered):(console.error("Components for the page not found."),null)}))},y}(t.Component);export{h as ThemeEditorComponent};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as o}from"@ikas/storefront-config";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import{IkasBlogMetaDataTargetType as i}from"../../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 n}from"@ikas/storefront-models";import{reaction as s,makeAutoObservable as a,runInAction as r}from"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import{IkasHTMLMetaDataTargetType as d}from"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import{IkasThemeJson as p}from"../../models/data/theme-json/index.js";import{IkasStorefront as l}from"../../models/data/storefront/index.js";import{IkasThemeJsonComponent as c}from"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import{IkasThemeJsonPageComponent as m}from"../../models/data/theme-json/page/component/index.js";import{IkasThemeJsonSettings as u}from"../../models/data/theme-json/settings/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasPageDataProvider as g}from"@ikas/storefront-providers";import{IkasPageDataInit as h}from"../../page-data-init/index.js";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"../page/index.js";import"../page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"./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"../../pages/account/activate.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";import E from"../../store/html-meta-data/index.js";import v from"../../store/blog/index.js";import P from"../../store/raffle/index.js";import O from"../../store/product/index.js";import{setAPIClientConfig as T,listCustomerSettings as C}from"@ikas/storefront-api";var _,j=function(){function j(s){var O=this;this.theme=null,this.page=null,this.selectedPageComponentId=null,this.hoveredPageComponentId=null,this.componentRefs={},this.isLoading=!1,this.updateId="",this.locale="en",this.pageParams={},this.apiKey=null,this.pageDataProvider=null,this.initializedPropValues=[],this.startMessaging=function(){window.addEventListener("message",O.onMessage,!1),O.sendMessage(_.FRAME_DID_LOAD,"5.0.0"),O.createLoadingListener()},this.onMessage=function(o){return e(O,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:switch(e=o.data.type,i=o.data.data,e){case _.UPDATE_FRAME_DATA:return[3,1];case _.UPDATE_THEME_JSON:return[3,3];case _.UPDATE_PROP_VALUE:return[3,5];case _.UPDATE_PAGE_PARAMS:return[3,7];case _.UPDATE_PAGE_COMPONENT_ORDER:return[3,9];case _.ADD_COMPONENT:return[3,11];case _.DELETE_COMPONENT:return[3,12];case _.UPDATE_COMPONENT:return[3,13];case _.ADD_PAGE_COMPONENT:return[3,14];case _.DELETE_PAGE_COMPONENT:return[3,16];case _.SET_SELECTED_COMPONENT:return[3,17];case _.SET_HOVERED_COMPONENT:return[3,18];case _.SCROLL_TO_COMPONENT:return[3,19];case _.EDITOR_RELOAD:return[3,20];case _.UPDATE_THEME_SETTINGS:return[3,21]}return[3,22];case 1:return[4,this.handleUpdateFrameData(i)];case 2:case 4:case 6:case 8:case 10:case 15:return t.sent(),[3,23];case 3:return[4,this.handleUpdateThemeJson(i)];case 5:return[4,this.handleUpdatePropValue(i)];case 7:return[4,this.handleUpdatePageParams(i)];case 9:return[4,this.handleUpdatePageComponentOrder(i)];case 11:return this.handleAddNewComponent(i),[3,23];case 12:return this.handleDeleteComponent(i),[3,23];case 13:return this.handleUpdateComponent(i),[3,23];case 14:return[4,this.handleAddNewPageComponent(i)];case 16:return this.handleDeletePageComponent(i),[3,23];case 17:return this.handleSetSelectedComponent(i),[3,23];case 18:return this.handleSetHoveredComponent(i),[3,23];case 19:return this.handleScrollToComponent(i),[3,23];case 20:return this.handleEditorReload(),[3,23];case 21:return this.updateThemeSettings(i),[3,23];case 22:return[3,23];case 23:return[2]}}))}))},this.onClick=function(e){O.sendMessage(_.COMPONENT_CLICK,{componentId:e})},this.onMouseOver=function(e){O.sendMessage(_.COMPONENT_MOUSE_OVER,{componentId:e})},this.onMouseLeave=function(e){O.sendMessage(_.COMPONENT_MOUSE_LEAVE,{componentId:e})},this.onPageChange=function(o){return e(O,void 0,void 0,(function(){var e,s,a,p,l,c,m,u,g,h,O,T,C,j=this;return t(this,(function(t){switch(t.label){case 0:return e=o.slice(1),s=e.split("?"),e=s[0],a=s[1],this.pageParams={},o.startsWith("/account/orders/")?p=n.ORDER_DETAIL:o.startsWith("/account/orders")?p=n.ORDERS:o.startsWith("/account/addresses")?p=n.ADDRESSES:o.startsWith("/account/favorite-products")?p=n.FAVORITE_PRODUCTS:o.startsWith("/account/forgot-password")?p=n.FORGOT_PASSWORD:o.startsWith("/account/login")?p=n.LOGIN:o.startsWith("/account/raffles")?p=n.RAFFLE_ACCOUNT:o.startsWith("/account/recover-password")?p=n.RECOVER_PASSWORD:o.startsWith("/account/activate")?p=n.ACTIVATE_CUSTOMER:o.startsWith("/account/register")?p=n.REGISTER:o.startsWith("/account")?p=n.ACCOUNT:o.startsWith("/blog/")?p=n.BLOG:o.startsWith("/blog")?p=n.BLOG_INDEX:o.startsWith("/pages")?(p=n.CUSTOM,this.pageParams={slug:e.split("/")[1]}):p=o.startsWith("/raffle/")?n.RAFFLE_DETAIL:o.startsWith("/raffle")?n.RAFFLE:o.startsWith("/404")?n.NOT_FOUND:"/cart"===o||"/cart/"===o?n.CART:o.startsWith("/checkout")?n.CHECKOUT:"/"===o?n.INDEX:o.startsWith("/search")?n.SEARCH:n.PRODUCT,p!==n.PRODUCT?[3,6]:[4,E.listHTMLMetaData({slug:{eq:e}})];case 1:return(c=t.sent()).isSuccess&&(null===(g=c.data)||void 0===g?void 0:g.length)?(m=c.data[0]).targetType!==d.PRODUCT?[3,3]:[4,this.getVariantIdFromParams(m.targetId,a)]:[3,5];case 2:return l=t.sent(),this.pageParams={productId:m.targetId,variantId:l,slug:e},[3,4];case 3:if(m.targetType===d.CATEGORY)p=n.CATEGORY,this.pageParams={categoryId:m.targetId,slug:e};else{if(m.targetType!==d.BRAND)return[2];p=n.BRAND,this.pageParams={brandId:m.targetId,slug:e}}t.label=4;case 4:return[3,6];case 5:return[2];case 6:return p!==n.BLOG?[3,8]:[4,v.listBlogMetaData({slug:{eq:e}})];case 7:if(!(c=t.sent()).isSuccess||!(null===(O=null===(h=c.data)||void 0===h?void 0:h.data)||void 0===O?void 0:O.length))return[2];if((m=c.data.data[0]).targetType===i.BLOG)this.pageParams={blogId:m.targetId,slug:e};else{if(m.targetType!==i.BLOG_CATEGORY)return[2];p=n.BLOG_CATEGORY,this.pageParams={blogCategoryId:m.targetId,slug:e}}t.label=8;case 8:return p!==n.RAFFLE_DETAIL?[3,10]:[4,P.listRaffleMetaData({slug:{eq:e}})];case 9:if(!(c=t.sent()).isSuccess||!(null===(T=c.data)||void 0===T?void 0:T.length))return[2];m=c.data[0],this.pageParams={raffleId:m.targetId,slug:e},t.label=10;case 10:return this.isLoading=!0,[4,this.getPagePropValues(this.theme,p,this.pageParams)];case 11:return u=t.sent(),r((function(){var e,t;f.getInstance().currentPageType=p,j.pageDataProvider=u,p===n.CUSTOM?j.page=null===(e=j.theme)||void 0===e?void 0:e.pages.find((function(e){return e.type===p&&e.slug===j.pageParams.slug})):j.page=null===(t=j.theme)||void 0===t?void 0:t.pages.find((function(e){return e.type===p})),j.setCurrentPageType(),requestAnimationFrame((function(){document.body.scrollTop=0,document.scrollingElement&&(document.scrollingElement.scrollTop=0)}))})),this.sendMessage(_.EDITOR_PAGE_CHANGE,{pageType:p,pageParams:this.pageParams,pageSpecificData:(null===(C=this.pageDataProvider)||void 0===C?void 0:C.pageSpecificData)||null}),this.isLoading=!1,[2]}}))}))},this.onLoadingChange=function(){O.sendMessage(_.EDITOR_LOADING_CHANGE,{isLoading:O.isLoading})},this.sendMessage=function(e,t){window.parent.postMessage({type:e,data:JSON.parse(JSON.stringify(t))},"*")},this.getPagePropValues=function(o,i,s){return e(O,void 0,void 0,(function(){var e,a,r;return t(this,(function(t){switch(t.label){case 0:return e=new g(o,s,i),(s.blogId||s.blogCategoryId)&&(e.possiblePageTypes=[n.BLOG,n.BLOG_CATEGORY]),s.raffleId&&(e.possiblePageTypes=[n.RAFFLE_DETAIL]),[4,e.getPageData()];case 1:return t.sent(),e.pageSpecificData?(h.setPageSpecificData(e.pageSpecificData,i,!0),i===n.PRODUCT&&h.pageSpecificData&&(a=h.pageSpecificData,(r=a.variants.find((function(e){return e.id===s.variantId})))&&(a.selectedVariantValues=r.variantValues))):h.pageSpecificData=void 0,this.initializedPropValues=h.initPagePropValues(e.$pageComponentPropValues,o.components,o.customData,o.settings,!1),[2,e]}}))}))},this.setComponentRef=function(e,t){O.componentRefs[t.id]=e},this.isScrolledIntoView=function(e){var t=e.getBoundingClientRect(),o=t.top,i=t.bottom;return o<window.innerHeight&&i>=0&&i<window.innerHeight&&o>0},this.handleUpdateFrameData=function(i){return e(O,void 0,void 0,(function(){var e,n,s,a,r,d,c=this;return t(this,(function(t){switch(t.label){case 0:return this.theme=new p(i.theme),this.page=null===(r=this.theme)||void 0===r?void 0:r.pages.find((function(e){return e.id===i.selectedPage.id})),this.pageParams=i.pageParams,this.apiKey=i.apiKey,this.locale=i.locale||"en",this.translations=i.translations||void 0,this.setCurrentPageType(),this.page?((e=i.storefront?new l(i.storefront):null)&&(n=e.routings.find((function(e){return e.locale===c.locale})),o.init({storefrontId:e.id,storefrontRoutingId:null==n?void 0:n.id,storefrontThemeId:e.mainStorefrontThemeId||void 0,salesChannelId:e.salesChannelId||void 0,priceListId:(null==n?void 0:n.priceListId)||void 0,routings:e.routings,stockPreference:null===(d=this.theme)||void 0===d?void 0:d.settings.stockPreference,translations:this.translations||o.getTranslations(),isEditor:!0,apiKey:i.apiKey,apiUrl:i.apiUrl,cdnUrl:i.cdnUrl,merchantSettings:i.merchantSettings}),T(),this.setCustomerSettings()),s=Date.now()+"",this.updateId=s,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})]):[2];case 1:return a=t.sent(),this.updateId===s&&(this.pageDataProvider=a,this.isLoading=!1),[2]}}))}))},this.setCustomerSettings=function(){return e(O,void 0,void 0,(function(){var e,i,n;return t(this,(function(t){switch(t.label){case 0:return o.getCustomerSettings()?[3,2]:[4,C({storefrontId:{eq:o.getStorefrontId()}})];case 1:(e=t.sent()).isSuccess&&(null===(n=e.data)||void 0===n?void 0:n.data.length)&&(i=e.data.data[0],o.init({customerSettings:i})),t.label=2;case 2:return[2]}}))}))},this.handleUpdateThemeJson=function(o){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.theme=new p(o.theme),[2]}))}))},this.handleUpdatePropValue=function(o){return e(O,void 0,void 0,(function(){var e,i,n,s,a,r,d,p=this;return t(this,(function(t){switch(t.label){case 0:return e=o.propName,i=o.value,(n=null===(d=null===(r=this.selectedComponent)||void 0===r?void 0:r.props)||void 0===d?void 0:d.find((function(t){return t.name===e})))&&this.selectedPageComponent?(s=this.initializedPropValues.find((function(e){return e.pageComponent.id===p.selectedPageComponentId})),this.pageDataProvider&&s?(this.selectedPageComponent.propValues[e]=i,[4,this.pageDataProvider.getPageComponentPropValue(this.selectedPageComponent,n)]):[2]):[2];case 1:return(a=t.sent())&&JSON.stringify(a).includes("href")?[4,this.pageDataProvider.setLinkSlugs()]:[3,3];case 2:t.sent(),t.label=3;case 3:return s.propValues[e]=h.initPropValue(n,a,this.theme.settings,!0),[2]}}))}))},this.handleUpdatePageParams=function(o){return e(O,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageParams=o.pageParams,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})];case 1:return e=t.sent(),this.pageDataProvider=e,this.isLoading=!1,[2]}}))}))},this.handleUpdatePageComponentOrder=function(o){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.specification?this.specification.components=o.pageComponents.map((function(e){return new m(e)})):this.page.components=o.pageComponents.map((function(e){return new m(e)})),[2]}))}))},this.handleAddNewComponent=function(e){var t,o=new c(e.component);null===(t=O.theme)||void 0===t||t.components.push(o)},this.handleDeleteComponent=function(e){var t,o;(null===(t=O.theme)||void 0===t?void 0:t.components)&&(O.theme.components=O.theme.components.filter((function(t){return t.id!==e.componentId})));var i=O.pageComponents.filter((function(t){return t.componentId!==e.componentId}))||[];O.specification&&O.specification.components&&(O.specification.components=i),!O.specification&&(null===(o=O.page)||void 0===o?void 0:o.components)&&(O.page.components=i)},this.handleUpdateComponent=function(e){var t=O.theme.components.findIndex((function(t){return t.id===e.component.id}));-1!==t&&(O.theme.components[t]=new c(e.component))},this.handleAddNewPageComponent=function(o){return e(O,void 0,void 0,(function(){var e,i,s,a,r,d,p;return t(this,(function(t){switch(t.label){case 0:return e=new m(o.pageComponent),this.pageComponents.some((function(t){return t.id===e.id}))?[2]:[4,this.pageDataProvider.getPageComponentPropValues(e)];case 1:return i=t.sent(),s=h.initPageComponentPropValue(i,[i.component],this.theme.settings,!0),this.initializedPropValues.push(s),(null===(d=this.page)||void 0===d?void 0:d.type)===n.CHECKOUT?[2]:(a=null===(p=this.theme)||void 0===p?void 0:p.components.find((function(t){return t.id===e.componentId})),r=this.pageComponents.find((function(e){return e.componentId===(null==a?void 0:a.id)})),(null==a?void 0:a.isCommon)&&r||(o.customIndex?this.pageComponents.splice(o.customIndex,0,e):this.pageComponents.push(e)),[2])}}))}))},this.handleDeletePageComponent=function(e){O.specification?O.specification.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId})):O.page.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId}))},this.handleSetSelectedComponent=function(e){O.selectedPageComponentId=e.componentId},this.handleSetHoveredComponent=function(e){O.hoveredPageComponentId=e.componentId},this.handleScrollToComponent=function(e){var t=e.componentId,o=O.componentRefs[t];o&&(O.isScrolledIntoView(o)||window.scrollTo({top:o.offsetTop,behavior:"smooth"}))},this.handleEditorReload=function(){window.location.reload()},this.updateThemeSettings=function(e){var t=e.settings;O.theme&&(O.theme.settings=new u(t))},this.router=s,a(this),this.startMessaging()}return Object.defineProperty(j.prototype,"specification",{get:function(){var e,t,o,i,s,a,r,d=this,p=this.page;return(null==p?void 0:p.type)===n.PRODUCT&&(r=null===(e=p.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.productId)}))),(null==p?void 0:p.type)===n.CATEGORY&&(r=null===(t=p.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.categoryId)}))),(null==p?void 0:p.type)===n.BRAND&&(r=null===(o=p.specifications)||void 0===o?void 0:o.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.brandId)}))),(null==p?void 0:p.type)===n.BLOG&&(r=null===(i=p.specifications)||void 0===i?void 0:i.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogId)}))),(null==p?void 0:p.type)===n.BLOG_CATEGORY&&(r=null===(s=p.specifications)||void 0===s?void 0:s.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogCategoryId)}))),(null==p?void 0:p.type)===n.RAFFLE_DETAIL&&(r=null===(a=p.specifications)||void 0===a?void 0:a.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.raffleId)}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedPageComponent",{get:function(){var e=this;return this.pageComponents.find((function(t){return t.id===e.selectedPageComponentId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedComponent",{get:function(){var e,t=this;return null===(e=this.theme)||void 0===e?void 0:e.components.find((function(e){var o;return e.id===(null===(o=t.selectedPageComponent)||void 0===o?void 0:o.componentId)}))},enumerable:!1,configurable:!0}),j.prototype.createLoadingListener=function(){var e=this;s((function(){return e.isLoading}),(function(){e.onLoadingChange()}))},j.prototype.getVariantIdFromParams=function(i,n){var s,a;return e(this,void 0,void 0,(function(){var e,r,d,p,l,c,m;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new URLSearchParams("?"+n),[4,O.searchProducts({input:{productIdList:[i],priceListId:o.getPriceListId(),salesChannelId:o.getSalesChannelId()}})];case 1:return(r=t.sent()).isSuccess&&!(null===(a=null===(s=null==r?void 0:r.data)||void 0===s?void 0:s.data)||void 0===a?void 0:a.length)?[2]:(d=r.data.data[0],p=d.variantTypes.map((function(e){return e.variantType.slug})),l=[],p.forEach((function(t,o){var i=d.variantTypes[o],n=e.get(t);if(n){var s=i.variantType.values.find((function(e){return e.slug===n}));s&&l.push(s)}})),(c=d.variants.find((function(e){return e.variantValues.every((function(e){return l.some((function(t){return t.id===e.id}))}))})))?[2,c.id]:[3,3]);case 2:return m=t.sent(),console.error(m),[3,3];case 3:return[2]}}))}))},j.prototype.setCurrentPageType=function(){this.page&&(f.getInstance().currentPageType=this.page.type)},j}();!function(e){e.FRAME_DID_LOAD="FRAME_DID_LOAD",e.UPDATE_FRAME_DATA="UPDATE_FRAME_DATA",e.UPDATE_THEME_JSON="UPDATE_THEME_JSON",e.UPDATE_PROP_VALUE="UPDATE_PROP_VALUE",e.UPDATE_PAGE_PARAMS="UPDATE_PAGE_PARAMS",e.UPDATE_PAGE_COMPONENT_ORDER="UPDATE_PAGE_COMPONENT_ORDER",e.ADD_COMPONENT="ADD_COMPONENT",e.DELETE_COMPONENT="DELETE_COMPONENT",e.UPDATE_COMPONENT="UPDATE_COMPONENT",e.ADD_PAGE_COMPONENT="ADD_PAGE_COMPONENT",e.DELETE_PAGE_COMPONENT="DELETE_PAGE_COMPONENT",e.COMPONENT_MOUSE_OVER="COMPONENT_MOUSE_OVER",e.COMPONENT_MOUSE_LEAVE="COMPONENT_MOUSE_LEAVE",e.COMPONENT_CLICK="COMPONENT_CLICK",e.SET_SELECTED_COMPONENT="SET_SELECTED_COMPONENT",e.SET_HOVERED_COMPONENT="SET_HOVERED_COMPONENT",e.SCROLL_TO_COMPONENT="SCROLL_TO_COMPONENT",e.UPDATE_THEME_SETTINGS="UPDATE_THEME_SETTINGS",e.EDITOR_PAGE_CHANGE="EDITOR_PAGE_CHANGE",e.EDITOR_LOADING_CHANGE="EDITOR_LOADING_CHANGE",e.EDITOR_RELOAD="EDITOR_RELOAD"}(_||(_={}));export{_ as BridgeMessageType,j as default};
1
+ import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as o}from"@ikas/storefront-config";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import{IkasBlogMetaDataTargetType as i}from"../../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 n}from"@ikas/storefront-models";import{reaction as s,makeAutoObservable as a,runInAction as r}from"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-form-data-input/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import{IkasHTMLMetaDataTargetType as d}from"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/order-transaction-with-prices/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import"../../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../models/data/storefront-popup/index.js";import{IkasThemeJson as p}from"../../models/data/theme-json/index.js";import{IkasStorefront as l}from"../../models/data/storefront/index.js";import{IkasThemeJsonComponent as c}from"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import{IkasThemeJsonPageComponent as m}from"../../models/data/theme-json/page/component/index.js";import{IkasThemeJsonSettings as u}from"../../models/data/theme-json/settings/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasPageDataProvider as g}from"@ikas/storefront-providers";import{IkasPageDataInit as h}from"../../page-data-init/index.js";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"../page/index.js";import"../page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"./loader/style.module.scss.js";import"../google-captcha/index.js";import"../paypal-express-checkout/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"../../pages/account/activate.js";import{IkasBaseStore as f}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";import E from"../../store/html-meta-data/index.js";import v from"../../store/blog/index.js";import P from"../../store/raffle/index.js";import O from"../../store/product/index.js";import{setAPIClientConfig as T,listCustomerSettings as C}from"@ikas/storefront-api";var _,j=function(){function j(s){var O=this;this.theme=null,this.page=null,this.selectedPageComponentId=null,this.hoveredPageComponentId=null,this.componentRefs={},this.isLoading=!1,this.updateId="",this.locale="en",this.pageParams={},this.apiKey=null,this.pageDataProvider=null,this.initializedPropValues=[],this.startMessaging=function(){window.addEventListener("message",O.onMessage,!1),O.sendMessage(_.FRAME_DID_LOAD,"5.0.0"),O.createLoadingListener()},this.onMessage=function(o){return e(O,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:switch(e=o.data.type,i=o.data.data,e){case _.UPDATE_FRAME_DATA:return[3,1];case _.UPDATE_THEME_JSON:return[3,3];case _.UPDATE_PROP_VALUE:return[3,5];case _.UPDATE_PAGE_PARAMS:return[3,7];case _.UPDATE_PAGE_COMPONENT_ORDER:return[3,9];case _.ADD_COMPONENT:return[3,11];case _.DELETE_COMPONENT:return[3,12];case _.UPDATE_COMPONENT:return[3,13];case _.ADD_PAGE_COMPONENT:return[3,14];case _.DELETE_PAGE_COMPONENT:return[3,16];case _.SET_SELECTED_COMPONENT:return[3,17];case _.SET_HOVERED_COMPONENT:return[3,18];case _.SCROLL_TO_COMPONENT:return[3,19];case _.EDITOR_RELOAD:return[3,20];case _.UPDATE_THEME_SETTINGS:return[3,21]}return[3,22];case 1:return[4,this.handleUpdateFrameData(i)];case 2:case 4:case 6:case 8:case 10:case 15:return t.sent(),[3,23];case 3:return[4,this.handleUpdateThemeJson(i)];case 5:return[4,this.handleUpdatePropValue(i)];case 7:return[4,this.handleUpdatePageParams(i)];case 9:return[4,this.handleUpdatePageComponentOrder(i)];case 11:return this.handleAddNewComponent(i),[3,23];case 12:return this.handleDeleteComponent(i),[3,23];case 13:return this.handleUpdateComponent(i),[3,23];case 14:return[4,this.handleAddNewPageComponent(i)];case 16:return this.handleDeletePageComponent(i),[3,23];case 17:return this.handleSetSelectedComponent(i),[3,23];case 18:return this.handleSetHoveredComponent(i),[3,23];case 19:return this.handleScrollToComponent(i),[3,23];case 20:return this.handleEditorReload(),[3,23];case 21:return this.updateThemeSettings(i),[3,23];case 22:return[3,23];case 23:return[2]}}))}))},this.onClick=function(e){O.sendMessage(_.COMPONENT_CLICK,{componentId:e})},this.onMouseOver=function(e){O.sendMessage(_.COMPONENT_MOUSE_OVER,{componentId:e})},this.onMouseLeave=function(e){O.sendMessage(_.COMPONENT_MOUSE_LEAVE,{componentId:e})},this.onPageChange=function(o){return e(O,void 0,void 0,(function(){var e,s,a,p,l,c,m,u,g,h,O,T,C,j=this;return t(this,(function(t){switch(t.label){case 0:return e=o.slice(1),s=e.split("?"),e=s[0],a=s[1],this.pageParams={},o.startsWith("/account/orders/")?p=n.ORDER_DETAIL:o.startsWith("/account/orders")?p=n.ORDERS:o.startsWith("/account/addresses")?p=n.ADDRESSES:o.startsWith("/account/favorite-products")?p=n.FAVORITE_PRODUCTS:o.startsWith("/account/forgot-password")?p=n.FORGOT_PASSWORD:o.startsWith("/account/login")?p=n.LOGIN:o.startsWith("/account/raffles")?p=n.RAFFLE_ACCOUNT:o.startsWith("/account/recover-password")?p=n.RECOVER_PASSWORD:o.startsWith("/account/activate")?p=n.ACTIVATE_CUSTOMER:o.startsWith("/account/register")?p=n.REGISTER:o.startsWith("/account")?p=n.ACCOUNT:o.startsWith("/blog/")?p=n.BLOG:o.startsWith("/blog")?p=n.BLOG_INDEX:o.startsWith("/pages")?(p=n.CUSTOM,this.pageParams={slug:e.split("/")[1]}):p=o.startsWith("/raffle/")?n.RAFFLE_DETAIL:o.startsWith("/raffle")?n.RAFFLE:o.startsWith("/404")?n.NOT_FOUND:"/cart"===o||"/cart/"===o?n.CART:o.startsWith("/checkout")?n.CHECKOUT:"/"===o?n.INDEX:o.startsWith("/search")?n.SEARCH:n.PRODUCT,p!==n.PRODUCT?[3,6]:[4,E.listHTMLMetaData({slug:{eq:e}})];case 1:return(c=t.sent()).isSuccess&&(null===(g=c.data)||void 0===g?void 0:g.length)?(m=c.data[0]).targetType!==d.PRODUCT?[3,3]:[4,this.getVariantIdFromParams(m.targetId,a)]:[3,5];case 2:return l=t.sent(),this.pageParams={productId:m.targetId,variantId:l,slug:e},[3,4];case 3:if(m.targetType===d.CATEGORY)p=n.CATEGORY,this.pageParams={categoryId:m.targetId,slug:e};else{if(m.targetType!==d.BRAND)return[2];p=n.BRAND,this.pageParams={brandId:m.targetId,slug:e}}t.label=4;case 4:return[3,6];case 5:return[2];case 6:return p!==n.BLOG?[3,8]:[4,v.listBlogMetaData({slug:{eq:e}})];case 7:if(!(c=t.sent()).isSuccess||!(null===(O=null===(h=c.data)||void 0===h?void 0:h.data)||void 0===O?void 0:O.length))return[2];if((m=c.data.data[0]).targetType===i.BLOG)this.pageParams={blogId:m.targetId,slug:e};else{if(m.targetType!==i.BLOG_CATEGORY)return[2];p=n.BLOG_CATEGORY,this.pageParams={blogCategoryId:m.targetId,slug:e}}t.label=8;case 8:return p!==n.RAFFLE_DETAIL?[3,10]:[4,P.listRaffleMetaData({slug:{eq:e}})];case 9:if(!(c=t.sent()).isSuccess||!(null===(T=c.data)||void 0===T?void 0:T.length))return[2];m=c.data[0],this.pageParams={raffleId:m.targetId,slug:e},t.label=10;case 10:return this.isLoading=!0,[4,this.getPagePropValues(this.theme,p,this.pageParams)];case 11:return u=t.sent(),r((function(){var e,t;f.getInstance().currentPageType=p,j.pageDataProvider=u,p===n.CUSTOM?j.page=null===(e=j.theme)||void 0===e?void 0:e.pages.find((function(e){return e.type===p&&e.slug===j.pageParams.slug})):j.page=null===(t=j.theme)||void 0===t?void 0:t.pages.find((function(e){return e.type===p})),j.setCurrentPageType(),requestAnimationFrame((function(){document.body.scrollTop=0,document.scrollingElement&&(document.scrollingElement.scrollTop=0)}))})),this.sendMessage(_.EDITOR_PAGE_CHANGE,{pageType:p,pageParams:this.pageParams,pageSpecificData:(null===(C=this.pageDataProvider)||void 0===C?void 0:C.pageSpecificData)||null}),this.isLoading=!1,[2]}}))}))},this.onLoadingChange=function(){O.sendMessage(_.EDITOR_LOADING_CHANGE,{isLoading:O.isLoading})},this.sendMessage=function(e,t){window.parent.postMessage({type:e,data:JSON.parse(JSON.stringify(t))},"*")},this.getPagePropValues=function(o,i,s){return e(O,void 0,void 0,(function(){var e,a,r;return t(this,(function(t){switch(t.label){case 0:return e=new g(o,s,i),(s.blogId||s.blogCategoryId)&&(e.possiblePageTypes=[n.BLOG,n.BLOG_CATEGORY]),s.raffleId&&(e.possiblePageTypes=[n.RAFFLE_DETAIL]),[4,e.getPageData()];case 1:return t.sent(),e.pageSpecificData?(h.setPageSpecificData(e.pageSpecificData,i,!0),i===n.PRODUCT&&h.pageSpecificData&&(a=h.pageSpecificData,(r=a.variants.find((function(e){return e.id===s.variantId})))&&(a.selectedVariantValues=r.variantValues))):h.pageSpecificData=void 0,this.initializedPropValues=h.initPagePropValues(e.$pageComponentPropValues,o.components,o.customData,o.settings,!1),[2,e]}}))}))},this.setComponentRef=function(e,t){O.componentRefs[t.id]=e},this.isScrolledIntoView=function(e){var t=e.getBoundingClientRect(),o=t.top,i=t.bottom;return o<window.innerHeight&&i>=0&&i<window.innerHeight&&o>0},this.handleUpdateFrameData=function(i){return e(O,void 0,void 0,(function(){var e,n,s,a,r,d,c=this;return t(this,(function(t){switch(t.label){case 0:return this.theme=new p(i.theme),this.page=null===(r=this.theme)||void 0===r?void 0:r.pages.find((function(e){return e.id===i.selectedPage.id})),this.pageParams=i.pageParams,this.apiKey=i.apiKey,this.locale=i.locale||"en",this.translations=i.translations||void 0,this.setCurrentPageType(),this.page?((e=i.storefront?new l(i.storefront):null)&&(n=e.routings.find((function(e){return e.locale===c.locale})),o.init({storefrontId:e.id,storefrontRoutingId:null==n?void 0:n.id,storefrontThemeId:e.mainStorefrontThemeId||void 0,salesChannelId:e.salesChannelId||void 0,priceListId:(null==n?void 0:n.priceListId)||void 0,routings:e.routings,stockPreference:null===(d=this.theme)||void 0===d?void 0:d.settings.stockPreference,translations:this.translations||o.getTranslations(),isEditor:!0,apiKey:i.apiKey,apiUrl:i.apiUrl,cdnUrl:i.cdnUrl,merchantSettings:i.merchantSettings}),T(),this.setCustomerSettings()),s=Date.now()+"",this.updateId=s,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})]):[2];case 1:return a=t.sent(),this.updateId===s&&(this.pageDataProvider=a,this.isLoading=!1),[2]}}))}))},this.setCustomerSettings=function(){return e(O,void 0,void 0,(function(){var e,i,n;return t(this,(function(t){switch(t.label){case 0:return o.getCustomerSettings()?[3,2]:[4,C({storefrontId:{eq:o.getStorefrontId()}})];case 1:(e=t.sent()).isSuccess&&(null===(n=e.data)||void 0===n?void 0:n.data.length)&&(i=e.data.data[0],o.init({customerSettings:i})),t.label=2;case 2:return[2]}}))}))},this.handleUpdateThemeJson=function(o){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.theme=new p(o.theme),[2]}))}))},this.handleUpdatePropValue=function(o){return e(O,void 0,void 0,(function(){var e,i,n,s,a,r,d,p=this;return t(this,(function(t){switch(t.label){case 0:return e=o.propName,i=o.value,(n=null===(d=null===(r=this.selectedComponent)||void 0===r?void 0:r.props)||void 0===d?void 0:d.find((function(t){return t.name===e})))&&this.selectedPageComponent?(s=this.initializedPropValues.find((function(e){return e.pageComponent.id===p.selectedPageComponentId})),this.pageDataProvider&&s?(this.selectedPageComponent.propValues[e]=i,[4,this.pageDataProvider.getPageComponentPropValue(this.selectedPageComponent,n)]):[2]):[2];case 1:return(a=t.sent())&&JSON.stringify(a).includes("href")?[4,this.pageDataProvider.setLinkSlugs()]:[3,3];case 2:t.sent(),t.label=3;case 3:return s.propValues[e]=h.initPropValue(n,a,this.theme.settings,!0),[2]}}))}))},this.handleUpdatePageParams=function(o){return e(O,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageParams=o.pageParams,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})];case 1:return e=t.sent(),this.pageDataProvider=e,this.isLoading=!1,[2]}}))}))},this.handleUpdatePageComponentOrder=function(o){return e(O,void 0,void 0,(function(){return t(this,(function(e){return this.specification?this.specification.components=o.pageComponents.map((function(e){return new m(e)})):this.page.components=o.pageComponents.map((function(e){return new m(e)})),[2]}))}))},this.handleAddNewComponent=function(e){var t,o=new c(e.component);null===(t=O.theme)||void 0===t||t.components.push(o)},this.handleDeleteComponent=function(e){var t,o;(null===(t=O.theme)||void 0===t?void 0:t.components)&&(O.theme.components=O.theme.components.filter((function(t){return t.id!==e.componentId})));var i=O.pageComponents.filter((function(t){return t.componentId!==e.componentId}))||[];O.specification&&O.specification.components&&(O.specification.components=i),!O.specification&&(null===(o=O.page)||void 0===o?void 0:o.components)&&(O.page.components=i)},this.handleUpdateComponent=function(e){var t=O.theme.components.findIndex((function(t){return t.id===e.component.id}));-1!==t&&(O.theme.components[t]=new c(e.component))},this.handleAddNewPageComponent=function(o){return e(O,void 0,void 0,(function(){var e,i,s,a,r,d,p;return t(this,(function(t){switch(t.label){case 0:return e=new m(o.pageComponent),this.pageComponents.some((function(t){return t.id===e.id}))?[2]:[4,this.pageDataProvider.getPageComponentPropValues(e)];case 1:return i=t.sent(),s=h.initPageComponentPropValue(i,[i.component],this.theme.settings,!0),this.initializedPropValues.push(s),(null===(d=this.page)||void 0===d?void 0:d.type)===n.CHECKOUT?[2]:(a=null===(p=this.theme)||void 0===p?void 0:p.components.find((function(t){return t.id===e.componentId})),r=this.pageComponents.find((function(e){return e.componentId===(null==a?void 0:a.id)})),(null==a?void 0:a.isCommon)&&r||(o.customIndex?this.pageComponents.splice(o.customIndex,0,e):this.pageComponents.push(e)),[2])}}))}))},this.handleDeletePageComponent=function(e){O.specification?O.specification.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId})):O.page.components=O.pageComponents.filter((function(t){return t.id!==e.pageComponentId}))},this.handleSetSelectedComponent=function(e){O.selectedPageComponentId=e.componentId},this.handleSetHoveredComponent=function(e){O.hoveredPageComponentId=e.componentId},this.handleScrollToComponent=function(e){var t=e.componentId,o=O.componentRefs[t];o&&(O.isScrolledIntoView(o)||window.scrollTo({top:o.offsetTop,behavior:"smooth"}))},this.handleEditorReload=function(){window.location.reload()},this.updateThemeSettings=function(e){var t=e.settings;O.theme&&(O.theme.settings=new u(t))},this.router=s,a(this),this.startMessaging()}return Object.defineProperty(j.prototype,"specification",{get:function(){var e,t,o,i,s,a,r,d=this,p=this.page;return(null==p?void 0:p.type)===n.PRODUCT&&(r=null===(e=p.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.productId)}))),(null==p?void 0:p.type)===n.CATEGORY&&(r=null===(t=p.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.categoryId)}))),(null==p?void 0:p.type)===n.BRAND&&(r=null===(o=p.specifications)||void 0===o?void 0:o.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.brandId)}))),(null==p?void 0:p.type)===n.BLOG&&(r=null===(i=p.specifications)||void 0===i?void 0:i.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogId)}))),(null==p?void 0:p.type)===n.BLOG_CATEGORY&&(r=null===(s=p.specifications)||void 0===s?void 0:s.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogCategoryId)}))),(null==p?void 0:p.type)===n.RAFFLE_DETAIL&&(r=null===(a=p.specifications)||void 0===a?void 0:a.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.raffleId)}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedPageComponent",{get:function(){var e=this;return this.pageComponents.find((function(t){return t.id===e.selectedPageComponentId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedComponent",{get:function(){var e,t=this;return null===(e=this.theme)||void 0===e?void 0:e.components.find((function(e){var o;return e.id===(null===(o=t.selectedPageComponent)||void 0===o?void 0:o.componentId)}))},enumerable:!1,configurable:!0}),j.prototype.createLoadingListener=function(){var e=this;s((function(){return e.isLoading}),(function(){e.onLoadingChange()}))},j.prototype.getVariantIdFromParams=function(i,n){var s,a;return e(this,void 0,void 0,(function(){var e,r,d,p,l,c,m;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new URLSearchParams("?"+n),[4,O.searchProducts({input:{productIdList:[i],priceListId:o.getPriceListId(),salesChannelId:o.getSalesChannelId()}})];case 1:return(r=t.sent()).isSuccess&&!(null===(a=null===(s=null==r?void 0:r.data)||void 0===s?void 0:s.data)||void 0===a?void 0:a.length)?[2]:(d=r.data.data[0],p=d.variantTypes.map((function(e){return e.variantType.slug})),l=[],p.forEach((function(t,o){var i=d.variantTypes[o],n=e.get(t);if(n){var s=i.variantType.values.find((function(e){return e.slug===n}));s&&l.push(s)}})),(c=d.variants.find((function(e){return e.variantValues.every((function(e){return l.some((function(t){return t.id===e.id}))}))})))?[2,c.id]:[3,3]);case 2:return m=t.sent(),console.error(m),[3,3];case 3:return[2]}}))}))},j.prototype.setCurrentPageType=function(){this.page&&(f.getInstance().currentPageType=this.page.type)},j}();!function(e){e.FRAME_DID_LOAD="FRAME_DID_LOAD",e.UPDATE_FRAME_DATA="UPDATE_FRAME_DATA",e.UPDATE_THEME_JSON="UPDATE_THEME_JSON",e.UPDATE_PROP_VALUE="UPDATE_PROP_VALUE",e.UPDATE_PAGE_PARAMS="UPDATE_PAGE_PARAMS",e.UPDATE_PAGE_COMPONENT_ORDER="UPDATE_PAGE_COMPONENT_ORDER",e.ADD_COMPONENT="ADD_COMPONENT",e.DELETE_COMPONENT="DELETE_COMPONENT",e.UPDATE_COMPONENT="UPDATE_COMPONENT",e.ADD_PAGE_COMPONENT="ADD_PAGE_COMPONENT",e.DELETE_PAGE_COMPONENT="DELETE_PAGE_COMPONENT",e.COMPONENT_MOUSE_OVER="COMPONENT_MOUSE_OVER",e.COMPONENT_MOUSE_LEAVE="COMPONENT_MOUSE_LEAVE",e.COMPONENT_CLICK="COMPONENT_CLICK",e.SET_SELECTED_COMPONENT="SET_SELECTED_COMPONENT",e.SET_HOVERED_COMPONENT="SET_HOVERED_COMPONENT",e.SCROLL_TO_COMPONENT="SCROLL_TO_COMPONENT",e.UPDATE_THEME_SETTINGS="UPDATE_THEME_SETTINGS",e.EDITOR_PAGE_CHANGE="EDITOR_PAGE_CHANGE",e.EDITOR_LOADING_CHANGE="EDITOR_LOADING_CHANGE",e.EDITOR_RELOAD="EDITOR_RELOAD"}(_||(_={}));export{_ as BridgeMessageType,j as default};
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { IkasProduct } from "../../models";
3
+ declare type PaypalExpressCheckoutProps = {
4
+ product: IkasProduct;
5
+ layout?: "vertical" | "horizontal";
6
+ color?: "gold" | "blue" | "silver" | "white" | "black";
7
+ shape?: "rect" | "pill";
8
+ label?: "paypal" | "checkout" | "buynow" | "pay" | "installment" | "subscribe" | "donate";
9
+ errorMessage?: string;
10
+ };
11
+ export declare const PaypalExpressCheckout: React.FC<PaypalExpressCheckoutProps>;
12
+ export {};
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as e,__assign as n}from'./../../ext/tslib/tslib.es6.js';import*as r from"react";import{observer as i}from"mobx-react-lite";import{IkasBaseStore as o}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import a from"../../store/checkout/index.js";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";var c=i((function(i){var c=i.product,u=i.layout,l=i.color,d=i.shape,p=i.label,f=i.errorMessage,v=o.getInstance(),h=v.cartStore.cart,m=v.customerStore.customer,g=r.useState(""),y=g[0],w=g[1],I=r.useState(""),b=I[0],P=I[1],S=r.useState(""),E=S[0],C=S[1],U=r.useState(!1),j=U[0],A=U[1],R=r.useRef(null),N=r.useRef(null),O=r.useRef(null);r.useEffect((function(){if(E){t(void 0,void 0,void 0,(function(){var t,n,r,i,o,u;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=s.getPaymentGateways().map((function(t){return t.id})),[4,a.listPaymentGateway({cartId:E,id:{in:t},locale:s.getCurrentLocale(),transactionAmount:c.selectedVariant.finalPrice})];case 1:return n=e.sent(),r=null===(u=null===(o=n.data)||void 0===o?void 0:o.find((function(t){return"PAYPAL"===t.code})))||void 0===u?void 0:u.id,P(r||""),[3,3];case 2:return i=e.sent(),console.error("Error fetching PayPal ID:",i),[3,3];case 3:return[2]}}))}))}}),[E,c.selectedVariant.finalPrice]),r.useEffect((function(){if(E&&b){t(void 0,void 0,void 0,(function(){var t,n,r;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,a.getPayPalClientId({input:{cartId:E,paymentGatewayId:b}})];case 1:return t=e.sent(),w((null===(r=t.data)||void 0===r?void 0:r.clientId)||""),[3,3];case 2:return n=e.sent(),console.error("Error fetching Client ID:",n),[3,3];case 3:return[2]}}))}))}}),[E,b]),r.useEffect((function(){h&&C(h.id)}),[null==h?void 0:h.id]);var _=function(r){return t(void 0,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return(t=R.current)?(i=N.current,[4,a.updatePaypalOrder({input:n(n({cartId:E,transactionId:t,customer:m?{email:m.email,firstName:m.firstName,id:m.id,lastName:m.lastName}:null,address:i?{city:i.city,country:i.countryCode,postalCode:i.postalCode,state:i.state}:null},r.shippingSettingsId?{shippingSettingsId:r.shippingSettingsId}:{}),r.shippingZoneRateId?{shippingZoneRateId:r.shippingZoneRateId}:{})})]):[2,!1];case 1:return[2,!!e.sent().data]}}))}))};return r.useEffect((function(){if(E&&b&&y){var n=document.createElement("script");return n.src="https://www.paypal.com/sdk/js?client-id=".concat(y,"&currency=").concat(c.selectedVariant.price.currency),n.setAttribute("data-page-type","product-details"),n.addEventListener("load",(function(){window.paypal&&window.paypal.Buttons({style:{layout:u,color:l,shape:d,label:p},createOrder:function(){return t(void 0,void 0,void 0,(function(){var t,n,r;return e(this,(function(e){switch(e.label){case 0:return[4,a.createPayPalOrder({input:{cartId:E,paymentGatewayId:b},isPayNow:!0})];case 1:return t=e.sent(),A(!1),(null===(n=t.data)||void 0===n?void 0:n.transactionId)&&(o=t.data.transactionId,R.current=o,i={failUrl:t.data.failUrl,returnUrl:t.data.returnUrl},O.current={failUrl:i.failUrl,returnUrl:i.returnUrl}),[2,null===(r=t.data)||void 0===r?void 0:r.sessionToken]}var i,o}))}))},onShippingOptionsChange:function(n,r){return t(this,void 0,void 0,(function(){var t,i,o;return e(this,(function(e){switch(e.label){case 0:return console.log("selectedShippingOption",n),t=n.selectedShippingOption.id.split(":"),i=t[0],o=t[1],[4,_({shippingSettingsId:i,shippingZoneRateId:o})];case 1:return e.sent()?[2]:[2,r.reject()]}}))}))},onShippingAddressChange:function(n,r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return console.log("SHIPPING_ADDRESS",n),function(t){N.current=t}(n.shippingAddress),[4,_({})];case 1:return t.sent()?[2]:[2,r.reject()]}}))}))},onApprove:function(n,r){return t(this,void 0,void 0,(function(){return e(this,(function(t){return[2,r.order.capture().then((function(t){console.log("data",n),console.log("details",t),console.log("urls",O),O.current&&(console.log("burda"),"COMPLETED"===t.status?window.location.href=O.current.returnUrl:window.location.href=window.location.href=O.current.failUrl)})).catch((function(t){return A(!0)}))]}))}))},onError:function(t){console.error("PayPal button error:",t)}}).render("#paypal-button-container")})),document.body.appendChild(n),function(){document.body.removeChild(n)}}}),[y]),r.createElement("div",null,r.createElement("div",{id:"paypal-button-container"}),!E&&r.createElement("div",{onClick:function(){return t(void 0,void 0,void 0,(function(){var t,n,r,i;return e(this,(function(e){switch(e.label){case 0:return[4,v.cartStore.addItem(c.selectedVariant,c)];case 1:return t=e.sent(),(null===(i=null===(r=t.response)||void 0===r?void 0:r.data)||void 0===i?void 0:i.id)?(n=t.response.data,C(n.id),[2]):[2]}}))}))}},"Paypal Button ******"),!!j&&!!f&&r.createElement("div",{className:"paypal__error__message"},f))}));export{c as PaypalExpressCheckout};
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import { IkasImage } from "../../models/data/image";
3
+ declare type ImageProps = {
4
+ image: IkasImage;
5
+ alt?: string;
6
+ sizes: string;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ loading?: "lazy" | "eager";
10
+ decoding?: "async" | "sync" | "auto";
11
+ };
12
+ export declare const PlainImage: React.FC<ImageProps>;
13
+ export {};
@@ -0,0 +1 @@
1
+ import*as e from"react";import{IkasImageFunctions as t}from"@ikas/storefront-model-functions";var a=[180,360,540,720,900,1080,1296,1512,1728,1950,2560,3840],r=function(a){var r=a.image,o=a.alt,c=void 0===o?"Image":o,i=a.sizes,s=a.className,l=a.style,m=a.loading,d=void 0===m?"lazy":m,g=a.decoding,u=void 0===g?"async":g,f=t.getDefaultSrc;return r?e.createElement("img",{src:f(r),srcSet:n(r),sizes:i,alt:c,className:s,style:l,loading:d,decoding:u}):null},n=function(e){var r=t.getSrc;return a.map((function(t){var a=r(e,t);return"".concat(a," ").concat(t,"w")})).join(", ")};export{r as PlainImage};
@@ -1 +1 @@
1
- import{__spreadArray as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as r}from"mobx-react-lite";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import n from"../../hooks/useDimension.js";import o from"./renderer/index.js";import{checkSavedSessionForPopups as s,checkIsPopupSavedToLocalStorage as l}from"./utils/index.js";import{IkasStorefrontPopupPageFilterTypeEnum as u,IkasStorefrontPopupPageFilterDataTypeEnum as p,IkasStorefrontPopupDeviceTypeEnum as c}from"@ikas/storefront-models";import{IkasBaseStore as a}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";var m=r((function(){var r=n().isMobile,m=t.useState([]),d=m[0],f=m[1];return t.useEffect((function(){s(),a.getInstance().currentPageType;var t=[],n=i.getStorefrontPopups().filter((function(e){var i;if(l(e.id))return!1;var n=[];if((null===(i=e.pageFilters)||void 0===i?void 0:i.length)&&(n=e.pageFilters.filter((function(e){return e.pageType===u.CUSTOM}))).length){var o=window.location.href;o.includes("http://localhost:3333/")&&(o=o.replace("http://localhost:3333/","https://bundle.myikas.dev/")),n.forEach((function(e){var r;null===(r=e.filters)||void 0===r||r.forEach((function(e){e.type===p.CONTAINS&&o.includes(e.value)?t.push(p.CONTAINS):e.type===p.DOES_NOT_CONTAIN&&o.includes(e.value)?t.push(p.DOES_NOT_CONTAIN):e.type===p.EXACT_MATCH&&o===e.value&&t.push(p.EXACT_MATCH)}))}))}if(t.includes(p.DOES_NOT_CONTAIN))return!1;var s=function(){return r?[c.ALL,c.MOBILE].includes(e.visibleDevice):[c.ALL,c.DESKTOP].includes(e.visibleDevice)};return(t.length||!(!t.length&&!e.isFilteredOnServerSide))&&s()})),o=document.head.querySelector('link[href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css"]');if(n.length&&!o){var m=document.createElement("link");m.type="text/css",m.rel="stylesheet",m.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",document.head.appendChild(m)}f(e([],n,!0))}),[r]),t.createElement(t.Fragment,null,d.map((function(e,r){return t.createElement(o,{storefrontPopup:e,key:e.id})})))}));export{m as PopupListRendererForPage};
1
+ import{__awaiter as e,__generator as t,__spreadArray as r}from'./../../ext/tslib/tslib.es6.js';import*as n from"react";import{observer as i}from"mobx-react-lite";import{IkasStorefrontConfig as o}from"@ikas/storefront-config";import s from"../../hooks/useDimension.js";import l from"./renderer/index.js";import{checkSavedSessionForPopups as u,checkIsPopupSavedToLocalStorage as c}from"./utils/index.js";import{IkasStorefrontPopupPageFilterTypeEnum as a,IkasStorefrontPopupPageFilterDataTypeEnum as d,IkasStorefrontPopupDeviceTypeEnum as p}from"@ikas/storefront-models";var f=i((function(){var i=s().isMobile,f=n.useState([]),m=f[0],v=f[1];return n.useEffect((function(){e(void 0,void 0,void 0,(function(){var e,n,s,l;return t(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){var r=o.getSessionId();r&&(clearInterval(t),e(r))}),100)}))];case 1:return t.sent(),u(),e=[],n=o.getStorefrontPopups().filter((function(t){var r;if(c(t.id))return!1;var n=[];if((null===(r=t.pageFilters)||void 0===r?void 0:r.length)&&(n=t.pageFilters.filter((function(e){return e.pageType===a.CUSTOM}))).length){var o=window.location.href;o.includes("http://localhost:3333/")&&(o=o.replace("http://localhost:3333/","https://bundle.myikas.dev/")),n.forEach((function(t){var r;null===(r=t.filters)||void 0===r||r.forEach((function(t){t.type===d.CONTAINS&&o.includes(t.value)?e.push(d.CONTAINS):t.type===d.DOES_NOT_CONTAIN&&o.includes(t.value)?e.push(d.DOES_NOT_CONTAIN):t.type===d.EXACT_MATCH&&o===t.value&&e.push(d.EXACT_MATCH)}))}))}if(e.includes(d.DOES_NOT_CONTAIN))return!1;var s=function(){return i?[p.ALL,p.MOBILE].includes(t.visibleDevice):[p.ALL,p.DESKTOP].includes(t.visibleDevice)};return(e.length||!(!e.length&&!t.isFilteredOnServerSide))&&s()})),s=document.head.querySelector('link[href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css"]'),n.length&&!s&&((l=document.createElement("link")).type="text/css",l.rel="stylesheet",l.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",document.head.appendChild(l)),v(r([],n,!0)),[2]}}))}))}),[i]),n.createElement(n.Fragment,null,m.map((function(e,t){return n.createElement(l,{storefrontPopup:e,key:e.id})})))}));export{f as PopupListRendererForPage};
@@ -1 +1 @@
1
- import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/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"@ikas/storefront-models";import"mobx";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../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"../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"../pages/account/activate.js";import{IkasBaseStore as o}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"@ikas/storefront-config";import"lodash/get";function t(){return o.getInstance()}export{t as useStore};
1
+ import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";import"react";import"next/image.js";import"@ikas/storefront-model-functions";import"../components/link/index.js";import"../components/page-editor/loader/style.module.scss.js";import"../components/google-captcha/index.js";import"../components/paypal-express-checkout/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"@ikas/storefront-models";import"mobx";import"../models/data/campaign-offer/index.js";import"../models/data/cart/campaign-offer/index.js";import"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/checkout-settings/index.js";import"../models/data/city/index.js";import"../models/data/country/index.js";import"../models/data/customer/address/region/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/address/ikas-localized-customer-address.js";import"../models/data/customer/attribute/index.js";import"../models/data/customer/review/summary/index.js";import"../models/data/customer/review/index.js";import"../models/data/customer/index.js";import"../models/data/customer-form-data-input/index.js";import"../models/data/district/index.js";import"../models/data/favorite-product/index.js";import"../models/data/filter-category/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/order/address/region/index.js";import"../models/data/order/address/index.js";import"../models/data/order/line-item/option/value/index.js";import"../models/data/order/line-item/variant/value/index.js";import"../models/data/order/line-item/variant/index.js";import"../models/data/order/line-item/index.js";import"../models/data/order/order-transaction-with-prices/index.js";import"../models/data/order/package/index.js";import"../models/data/order/transaction/index.js";import"../models/data/order/index.js";import"../models/data/payment-gateway/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product/filter/index.js";import"../models/data/product/campaign-offer/index.js";import"../models/data/product/option-set/option/index.js";import"../models/data/product/option-set/index.js";import"../models/data/product/stock-location/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product/variant/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/index.js";import"../models/data/raffle/index.js";import"../models/data/shipping-zone/state/city/district/region/index.js";import"../models/data/state/index.js";import"../models/data/storefront-popup/storefront-popup-display-filter/index.js";import"../models/data/storefront-popup/storefront-popup-display-settings/index.js";import"../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../models/data/storefront-popup/index.js";import"../models/data/theme-json/index.js";import"../models/data/theme-json/component/index.js";import"../models/data/theme-json/custom-data/index.js";import"../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/brand-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/ikas-address.js";import"../models/ui/validator/form/register.js";import"../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"../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"../pages/account/activate.js";import{IkasBaseStore as o}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"@ikas/storefront-config";import"lodash/get";function t(){return o.getInstance()}export{t as useStore};