@ikas/storefront 6.1.0-beta.56 → 6.1.0-beta.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{__assign as e}from'./../ext/tslib/tslib.es6.js';import{makeAutoObservable as t}from"mobx";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"../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{IkasProduct as o}from"../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{CheckoutStep as r}from"../components/checkout/model.js";import"./analytics.js";import"./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"../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 a}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"@ikas/storefront-config";import"lodash/get";import i from"lodash/cloneDeep";var s="undefined"==typeof window,d=function(){function e(){t(this)}return e.pageView=function(e){try{var t={event:"page-view-GTM",page:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.productView=function(e){var t,o;try{var r={event:"view_item-GTM",ecommerce:{items:[n(e)],extraParams:{parent_id:e.id,currency:e.selectedVariant.price.currency,url:"https://".concat(window.location.hostname).concat(e.href),item_image:(null===(o=null===(t=e.selectedVariant.mainImage)||void 0===t?void 0:t.image)||void 0===o?void 0:o.src)||"",barcode:e.selectedVariant.barcodeList&&e.selectedVariant.barcodeList.length?e.selectedVariant.barcodeList[0]:"",sellPrice:e.selectedVariant.sellPrice,discountPrice:e.selectedVariant.discountPrice||0}}};return!s&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},e.addToCart=function(e,t,r){var i=a.getInstance().cartStore.cart;try{var d={event:"add_to_cart-GTM",ecommerce:{items:[e instanceof o?n(e,t):m(e,t,r)],cart:i}};return!s&&window.dataLayer&&window.dataLayer.push(d),d}catch(e){console.error(e)}},e.removeFromCart=function(e,t){var r=a.getInstance().cartStore.cart;try{var i={event:"remove_from_cart-GTM",ecommerce:{items:[e instanceof o?n(e,t):m(e,t)],cart:0===(null==r?void 0:r.itemCount)?null:r}};return!s&&window.dataLayer&&window.dataLayer.push(i),i}catch(e){console.error(e)}},e.beginCheckout=function(e){try{var t={event:"begin_checkout-GTM",ecommerce:{items:e.items.map((function(e){return m(e,e.quantity)}))}};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.purchase=function(e,t){try{var o={event:"purchase-GTM",ecommerce:{purchase:{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+e.totalTax,shipping:""+e.shippingTotal,currency:e.currencyCode,coupon:e.couponCode,items:e.items.map((function(e){return m(e,e.quantity)}))}}};return!s&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},e.checkoutStep=function(e,t){var o,a,d=i(e);null===(o=d.shippingAddress)||void 0===o||delete o.checkoutSettings,null===(a=d.billingAddress)||void 0===a||delete a.checkoutSettings;var n="";t===r.INFO?n="checkout_info-GTM":t===r.SHIPPING?n="checkout_shipping-GTM":t===r.PAYMENT?n="checkout_payment-GTM":t===r.SUCCESS&&(n="checkout_success-GTM");try{var m={event:n,ecommerce:{cart:d}};return!s&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},e.disableHTML=function(){try{!s&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},e.completeRegistration=function(e){try{var t={event:"customer_register-GTM",customer:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.search=function(e){try{var t={event:"search-GTM",search_string:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.viewCategory=function(e,t){try{var o={event:"view_category-GTM",ecommerce:{category:[{id:e.id,name:e.name,metaData:e.metaData,href:e.href,image:e.image,path:t}]}};return!s&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},e.customerLogin=function(e){try{var t={event:"customer_login-GTM",customer:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.customerLogout=function(){try{var e={event:"customer_logout-GTM"};return!s&&window.dataLayer&&window.dataLayer.push(e),e}catch(e){console.error(e)}},e.customerVisit=function(e){try{var t={event:"customer_visit-GTM",customer:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.viewCart=function(e){try{var t={event:"view_cart-GTM",ecommerce:{cart:e}};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e}();function n(e,t){var o;void 0===t&&(t=1);var r=[],a=e.categories;return a&&a.length&&(a[0].categoryPath&&a[0].categoryPath.map((function(e){return r.push(e)})),r.push(a[0].name)),{item_name:e.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(o=e.brand)||void 0===o?void 0:o.name)||"",item_category:r.length?r[0]:"",item_category_2:r.length>1?r[1]:"",item_category_3:r.length>2?r[2]:"",item_category_4:r.length>3?r.slice(3,r.length).join(" > "):"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function m(t,o,r){var a,i;void 0===o&&(o=1);var s=[],d=null==r?void 0:r.categories;return d&&d.length&&(d[0].categoryPath&&d[0].categoryPath.map((function(e){return s.push(e)})),s.push(d[0].name)),e(e({item_name:t.variant.name,item_id:t.variant.id,price:t.finalPrice||""},r?{item_brand:(null===(a=r.brand)||void 0===a?void 0:a.name)||"",item_category:s.length?s[0]:"",item_category_2:s.length>1?s[1]:"",item_category_3:s.length>2?s[2]:"",item_category_4:s.length>3?s.slice(3,s.length).join(" > "):""}:{item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:""}),{item_variant:null===(i=t.variant.variantValues)||void 0===i?void 0:i.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:o})}export{d as GoogleTagManager};
1
+ import{__assign as e}from'./../ext/tslib/tslib.es6.js';import{makeAutoObservable as t}from"mobx";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"../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{IkasProduct as o}from"../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{CheckoutStep as r}from"../components/checkout/model.js";import"./analytics.js";import"./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"../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 a}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"@ikas/storefront-config";import"lodash/get";import i from"lodash/cloneDeep";var s="undefined"==typeof window,d=function(){function e(){t(this)}return e.pageView=function(e){try{var t={event:"page-view-GTM",page:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.productView=function(e){var t,o;try{var r={event:"view_item-GTM",ecommerce:{items:[n(e)],extraParams:{parent_id:e.id,currency:e.selectedVariant.price.currency,url:"https://".concat(window.location.hostname).concat(e.href),item_image:(null===(o=null===(t=e.selectedVariant.mainImage)||void 0===t?void 0:t.image)||void 0===o?void 0:o.src)||"",barcode:e.selectedVariant.barcodeList&&e.selectedVariant.barcodeList.length?e.selectedVariant.barcodeList[0]:"",sellPrice:e.selectedVariant.sellPrice,discountPrice:e.selectedVariant.discountPrice||0}}};return!s&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},e.addToCart=function(e,t,r){var i=a.getInstance().cartStore.cart;try{var d={event:"add_to_cart-GTM",ecommerce:{items:[e instanceof o?n(e,t):m(e,t,r)],cart:i}};return!s&&window.dataLayer&&window.dataLayer.push(d),d}catch(e){console.error(e)}},e.removeFromCart=function(e,t){var r=a.getInstance().cartStore.cart;try{var i={event:"remove_from_cart-GTM",ecommerce:{items:[e instanceof o?n(e,t):m(e,t)],cart:0===(null==r?void 0:r.itemCount)?null:r}};return!s&&window.dataLayer&&window.dataLayer.push(i),i}catch(e){console.error(e)}},e.beginCheckout=function(e){try{var t={event:"begin_checkout-GTM",ecommerce:{items:e.items.map((function(e){return m(e,e.quantity)}))}};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.purchase=function(e,t){try{var o={event:"purchase-GTM",ecommerce:{purchase:{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+e.totalTax,shipping:""+e.shippingTotal,currency:e.currencyCode,coupon:e.couponCode,items:e.items.map((function(e){return m(e,e.quantity)}))}}};return!s&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},e.checkoutStep=function(e,t){var o,a,d=i(e);null===(o=d.shippingAddress)||void 0===o||delete o.checkoutSettings,null===(a=d.billingAddress)||void 0===a||delete a.checkoutSettings;var n="";t===r.INFO?n="checkout_info-GTM":t===r.SHIPPING?n="checkout_shipping-GTM":t===r.PAYMENT?n="checkout_payment-GTM":t===r.SUCCESS&&(n="checkout_success-GTM");try{var m={event:n,ecommerce:{cart:d}};return!s&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},e.disableHTML=function(){try{!s&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},e.completeRegistration=function(e){try{var t={event:"customer_register-GTM",customer:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.search=function(e){try{var t={event:"search-GTM",search_string:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.viewCategory=function(e,t){try{var o={event:"view_category-GTM",ecommerce:{category:[{id:e.id,name:e.name,metaData:e.metaData,href:e.href,image:e.image,path:t}]}};return!s&&window.dataLayer&&window.dataLayer.push(o),o}catch(e){console.error(e)}},e.customerLogin=function(e){try{var t={event:"customer_login-GTM",customer:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.customerLogout=function(){try{var e={event:"customer_logout-GTM"};return!s&&window.dataLayer&&window.dataLayer.push(e),e}catch(e){console.error(e)}},e.customerVisit=function(e){try{var t={event:"customer_visit-GTM",customer:e};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e.viewCart=function(e){try{var t={event:"view_cart-GTM",ecommerce:{cart:e}};return!s&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},e}();function n(e,t){var o;void 0===t&&(t=1);var r=[],a=e.categories;return a&&a.length&&(a[0].categoryPath&&a[0].categoryPath.map((function(e){return r.push(e)})),r.push(a[0].name)),{item_name:e.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(o=e.brand)||void 0===o?void 0:o.name)||"",item_category:r.length?r[0]:"",item_category_2:r.length>1?r[1]:"",item_category_3:r.length>2?r[2]:"",item_category_4:r.length>3?r.slice(3,r.length).join(" > "):"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function m(t,o,r){var a,i;void 0===o&&(o=1);var s=[],d=null==r?void 0:r.categories;return d&&d.length&&(d[0].categoryPath&&d[0].categoryPath.map((function(e){return s.push(e)})),s.push(d[0].name)),e(e({item_name:t.variant.name,item_id:t.variant.id,price:t.finalPrice||""},r?{item_brand:(null===(a=r.brand)||void 0===a?void 0:a.name)||"",item_category:s.length?s[0]:"",item_category_2:s.length>1?s[1]:"",item_category_3:s.length>2?s[2]:"",item_category_4:s.length>3?s.slice(3,s.length).join(" > "):""}:{item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:""}),{item_variant:null===(i=t.variant.variantValues)||void 0===i?void 0:i.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:o})}export{d as GoogleTagManager};
@@ -4,3 +4,4 @@ export { Image } from "./image";
4
4
  export { default as Link } from "./link";
5
5
  export * from "./page-editor/loader";
6
6
  export { GoogleCaptcha } from "../components/google-captcha";
7
+ export { PaypalExpressCheckout } from "../components/paypal-express-checkout";
@@ -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,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!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(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(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{__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,11 @@
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
+ };
10
+ export declare const PaypalExpressCheckout: React.FC<PaypalExpressCheckoutProps>;
11
+ export {};
@@ -0,0 +1 @@
1
+ import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';import*as n from"react";import{observer as r}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 i}from"@ikas/storefront-config";var c=r((function(r){var c=r.product,s=r.layout,d=r.color,u=r.shape,l=r.label,p=o.getInstance(),f=p.cartStore.cart,v=n.useState(""),m=v[0],y=v[1],h=n.useState(""),g=h[0],I=h[1],P=n.useState(""),w=P[0],b=P[1],E=n.useRef(null);return n.useEffect((function(){if(w){t(void 0,void 0,void 0,(function(){var t,n,r,o,s,d;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=i.getPaymentGateways().map((function(t){return t.id})),[4,a.listPaymentGateway({cartId:w,id:{in:t},locale:i.getCurrentLocale(),transactionAmount:c.selectedVariant.finalPrice})];case 1:return n=e.sent(),r=null===(d=null===(s=n.data)||void 0===s?void 0:s.find((function(t){return"PAYPAL"===t.code})))||void 0===d?void 0:d.id,I(r||""),[3,3];case 2:return o=e.sent(),console.error("Error fetching PayPal ID:",o),[3,3];case 3:return[2]}}))}))}}),[w,c.selectedVariant.finalPrice]),n.useEffect((function(){if(w&&g){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:w,paymentGatewayId:g}})];case 1:return t=e.sent(),y((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]}}))}))}}),[w,g]),n.useEffect((function(){f&&b(f.id)}),[null==f?void 0:f.id]),n.useEffect((function(){if(w&&g&&m){var n=document.createElement("script");return n.src="https://www.paypal.com/sdk/js?client-id=".concat(m,"&currency=").concat(c.selectedVariant.price.currency),n.setAttribute("data-page-type","product-details"),n.addEventListener("load",(function(){window.paypal&&window.paypal.Buttons({style:{layout:s,color:d,shape:u,label:l},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:w,paymentGatewayId:g},isPayNow:!0})];case 1:return t=e.sent(),console.log("res",t.data),(null===(n=t.data)||void 0===n?void 0:n.transactionId)&&(o=t.data.transactionId,E.current=o),[2,null===(r=t.data)||void 0===r?void 0:r.sessionToken]}var o}))}))},onShippingOptionsChange:function(t){console.log("SELECTED_OPTION",t.selectedShippingOption)},onShippingAddressChange:function(n){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return console.log("SHIPPING_ADDRESS",n),t=E.current,console.log("Transaction ID (Ref):",t),t?[4,a.updatePaypalOrder({input:{cartId:w,transactionId:t}})]:[2];case 1:return r=e.sent(),console.log("updatePaypalResponse",r),[2]}}))}))},onApprove:function(t,e){return e.order.capture().then((function(e){console.log("data",t),console.log("details",e)}))}}).render("#paypal-button-container")})),document.body.appendChild(n),function(){document.body.removeChild(n)}}}),[m]),n.createElement("div",null,n.createElement("div",{id:"paypal-button-container"}),n.createElement("div",{onClick:function(){return t(void 0,void 0,void 0,(function(){var t,n,r,o;return e(this,(function(e){switch(e.label){case 0:return[4,p.cartStore.addItem(c.selectedVariant,c)];case 1:return t=e.sent(),(null===(o=null===(r=t.response)||void 0===r?void 0:r.data)||void 0===o?void 0:o.id)?(n=t.response.data,b(n.id),[2]):[2]}}))}))}},"paypal"))}));export{c as PaypalExpressCheckout};
@@ -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};
package/build/index.js CHANGED
@@ -1 +1 @@
1
- export{Analytics}from"./analytics/analytics.js";export{AnalyticsBody,AnalyticsHead}from"./analytics/head/index.js";export{IkasPage}from"./components/page/index.js";export{IkasPageHead}from"./components/page/head.js";export{Image}from"./components/image/index.js";export{default as Link}from"./components/link/index.js";export{IkasEditorComponentLoader}from"./components/page-editor/loader/index.js";export{GoogleCaptcha}from"./components/google-captcha/index.js";export{useStore}from"./hooks/useStore.js";export{useCustomerReviews}from"./hooks/useCustomerReviews.js";import"react";export{IkasBaseModel}from"./models/data/base/index.js";export{IkasBlogCategory}from"./models/data/blog/category/index.js";export{IkasBlogContent}from"./models/data/blog/content/index.js";export{IkasBlogMetaData,IkasBlogMetaDataTargetType}from"./models/data/blog/meta-data/index.js";export{IkasBlogTag}from"./models/data/blog/tag/index.js";export{IkasBlogWriter}from"./models/data/blog/writer/index.js";export{IkasBlog}from"./models/data/blog/index.js";export{IkasProductBrandTranslation}from"./models/data/brand/translation/index.js";export{IkasBrand,IkasBrandOrderType}from"./models/data/brand/index.js";export{IkasCampaignOfferProduct,IkasCampaignOfferProductTranslation}from"./models/data/campaign-offer/product/index.js";export{IkasCampaignOffer,IkasCampaignOfferTriggerSettings}from"./models/data/campaign-offer/index.js";export{IkasAvailableShippingMethod}from"./models/data/cart/available-shipping-method/index.js";export{IkasCartCampaignOffer}from"./models/data/cart/campaign-offer/index.js";export{IkasCart}from"./models/data/cart/index.js";export{IkasCategoryPathItem}from"./models/data/category/path-item/index.js";export{IkasCategoryTranslation}from"./models/data/category/translations/index.js";export{IkasCategory}from"./models/data/category/index.js";export{IkasCheckout}from"./models/data/checkout/index.js";export{IkasCheckoutOption}from"./models/data/checkout-settings/option/index.js";export{IkasCheckoutSettingsPrice}from"./models/data/checkout-settings/price/index.js";export{IkasCheckoutSettings}from"./models/data/checkout-settings/index.js";export{IkasCity}from"./models/data/city/index.js";export{IkasContactForm}from"./models/data/contact-form/index.js";export{IkasCountry}from"./models/data/country/index.js";export{IkasCustomerAddressCity}from"./models/data/customer/address/city/index.js";export{IkasCustomerAddressCountry}from"./models/data/customer/address/country/index.js";export{IkasCustomerAddressDistrict}from"./models/data/customer/address/district/index.js";export{IkasCustomerAddressRegion}from"./models/data/customer/address/region/index.js";export{IkasCustomerAddressState}from"./models/data/customer/address/state/index.js";export{IkasCustomerAddress}from"./models/data/customer/address/index.js";export{IkasLocalizedCustomerAddress}from"./models/data/customer/address/ikas-localized-customer-address.js";export{IkasCustomerAttributeOption}from"./models/data/customer/attribute/option/index.js";export{IkasCustomerAttributeSalesChannel}from"./models/data/customer/attribute/sales-channel/index.js";export{IkasCustomerAttributeOptionTranslation}from"./models/data/customer/attribute/translation/option/index.js";export{IkasCustomerAttributeTranslation}from"./models/data/customer/attribute/translation/index.js";export{IkasCustomerAttributeValue}from"./models/data/customer/attribute/value/index.js";export{IkasCustomerAttribute}from"./models/data/customer/attribute/index.js";export{IkasCustomerPriceListRuleFilter}from"./models/data/customer/price-list-rule/filter/index.js";export{IkasCustomerPriceListRule}from"./models/data/customer/price-list-rule/index.js";export{IkasCustomerReviewSettings}from"./models/data/customer/review/settings/index.js";export{IkasCustomerReviewSummaryStar}from"./models/data/customer/review/summary/star/index.js";export{IkasCustomerReviewSummary}from"./models/data/customer/review/summary/index.js";export{IkasCustomerReview}from"./models/data/customer/review/index.js";export{IkasCustomer}from"./models/data/customer/index.js";export{IkasCustomerRegisterSubscriptionInput}from"./models/data/customer-form-data-input/customer-register-subscription-input/index.js";export{IkasCustomerGenderTypeEnum,IkasSaveCustomerFormDataInput}from"./models/data/customer-form-data-input/index.js";export{IkasDistrict}from"./models/data/district/index.js";export{IkasFavoriteProduct}from"./models/data/favorite-product/index.js";export{IkasFilterCategory}from"./models/data/filter-category/index.js";export{IkasHTMLMetaDataTranslations}from"./models/data/html-meta-data/translations/index.js";export{IkasHTMLMetaData,IkasHTMLMetaDataOverride,IkasHTMLMetaDataTargetType}from"./models/data/html-meta-data/index.js";export{IkasImage}from"./models/data/image/index.js";export{IkasLastViewedProduct}from"./models/data/last-viewed-product/index.js";export{IkasMerchantSettings}from"./models/data/merchant-settings/index.js";export{IkasOrderAddressCity}from"./models/data/order/address/city/index.js";export{IkasOrderAddressCountry}from"./models/data/order/address/country/index.js";export{IkasOrderAddressDistrict}from"./models/data/order/address/district/index.js";export{IkasOrderAddressRegion}from"./models/data/order/address/region/index.js";export{IkasOrderAddressState}from"./models/data/order/address/state/index.js";export{IkasOrderAddress}from"./models/data/order/address/index.js";export{IkasOrderAdjustmentAppliedOrderLine}from"./models/data/order/adjustment/applied-order-line/index.js";export{IkasOrderAdjustment}from"./models/data/order/adjustment/index.js";export{IkasOrderCustomer}from"./models/data/order/customer/index.js";export{IkasOrderGiftPackageLine}from"./models/data/order/gift-line/index.js";export{IkasInvoice}from"./models/data/order/invoice/index.js";export{IkasOrderLineDiscount}from"./models/data/order/line-item/discount/index.js";export{IkasOrderLineItemOptionValue}from"./models/data/order/line-item/option/value/index.js";export{IkasOrderLineItemOption}from"./models/data/order/line-item/option/index.js";export{IkasOrderLineVariantBrand}from"./models/data/order/line-item/variant/brand/index.js";export{IkasOrderLineVariantCategory,IkasOrderLineVariantCategoryPath}from"./models/data/order/line-item/variant/category/index.js";export{IkasOrderLineVariantPrice}from"./models/data/order/line-item/variant/price/index.js";export{IkasOrderLineVariantVariantValue}from"./models/data/order/line-item/variant/value/index.js";export{IkasOrderLineVariant}from"./models/data/order/line-item/variant/index.js";export{IkasOrderLineItem}from"./models/data/order/line-item/index.js";export{IkasOrderTransactionWithPrices}from"./models/data/order/order-transaction-with-prices/index.js";export{IkasTrackingInfo}from"./models/data/order/package/tracking-info/index.js";export{IkasOrderPackage}from"./models/data/order/package/index.js";export{IkasOrderPaymentMethod}from"./models/data/order/payment-method/index.js";export{IkasOrderRefundOrderLineInput}from"./models/data/order/refund/line-item/index.js";export{IkasOrderRefundSettings}from"./models/data/order/refund/settings/index.js";export{IkasRefund}from"./models/data/order/refund/index.js";export{IkasOrderShippingLine}from"./models/data/order/shipping-line/index.js";export{IkasOrderTaxLine}from"./models/data/order/tax-line/index.js";export{IkasTransactionError}from"./models/data/order/transaction/error/index.js";export{IkasTransactionInstallmentPrice}from"./models/data/order/transaction/payment-method-detail/installment-price/index.js";export{IkasTransactionPaymentMethodDetail}from"./models/data/order/transaction/payment-method-detail/index.js";export{IkasOrderTransaction}from"./models/data/order/transaction/index.js";export{IkasOrder}from"./models/data/order/index.js";export{IkasPaymentGatewayAdditionalPrice}from"./models/data/payment-gateway/additional-price/index.js";export{IkasPaymentGatewaySettings}from"./models/data/payment-gateway/settings/index.js";export{IkasPaymentGatewayTranslation}from"./models/data/payment-gateway/translation/index.js";export{IkasPaymentGateway}from"./models/data/payment-gateway/index.js";export{IkasProductAttributeOption}from"./models/data/product/attribute/option/index.js";export{IkasProductAttributeTableCell}from"./models/data/product/attribute/table-cell/index.js";export{IkasProductAttributeTableTemplate}from"./models/data/product/attribute/table-template/index.js";export{IkasProductAttributeOptionTranslation,IkasProductAttributeTranslation}from"./models/data/product/attribute/translation/index.js";export{IkasProductAttribute}from"./models/data/product/attribute/index.js";export{IkasAttributeTableCellValue,IkasProductAttributeMap,IkasProductAttributeValue}from"./models/data/product/attribute-value/index.js";export{IkasProductBackInStockSettings}from"./models/data/product/back-in-stock-settings/index.js";export{IkasApplicableProductFilterValue,IkasFilterRangeValue,IkasProductFilter,IkasProductFilterNumberRangeListOption,IkasProductFilterSettings,IkasProductFilterValue,parseRangeStr}from"./models/data/product/filter/index.js";export{IkasProductCampaignData}from"./models/data/product/campaign/data/index.js";export{IkasProductCampaignFilter}from"./models/data/product/campaign/filter/index.js";export{IkasProductBuyX,IkasProductBuyXThenGetY,IkasProductGetY}from"./models/data/product/campaign/product-buyx-then-gety/index.js";export{IkasProductCampaignDateRangeField}from"./models/data/product/campaign/product-campaign-date-range-field/index.js";export{IkasCampaignMinMaxRangeField,IkasProductFixedDiscount}from"./models/data/product/campaign/product-fixed-discount/index.js";export{IkasProductCampaign}from"./models/data/product/campaign/index.js";export{IkasProductCampaignOffer,IkasProductOffer}from"./models/data/product/campaign-offer/index.js";export{IkasProductImage}from"./models/data/product/image/index.js";export{IkasProductOption,IkasProductOptionDateSettings,IkasProductOptionFileSettings,IkasProductOptionOtherPrice,IkasProductOptionSelectSettings,IkasProductOptionSelectValue,IkasProductOptionTextSettings}from"./models/data/product/option-set/option/index.js";export{IkasProductOptionSelectValueTranslations,IkasProductOptionSet,IkasProductOptionSetTranslations,IkasProductOptionTranslations}from"./models/data/product/option-set/index.js";export{IkasProductStockLocations}from"./models/data/product/stock-location/index.js";export{IkasProductTag}from"./models/data/product/tag/index.js";export{IkasProductPrice}from"./models/data/product/variant/price/index.js";export{IkasProductVariant}from"./models/data/product/variant/index.js";export{IkasProductVariantType}from"./models/data/product/variant-type/index.js";export{IkasProduct}from"./models/data/product/index.js";export{IkasProductFile}from"./models/data/product-file/index.js";export{IkasRaffle,IkasRaffleAppliedProduct,IkasRaffleDateRangeField,IkasRaffleMetaData,IkasRaffleParticipant}from"./models/data/raffle/index.js";export{IkasSalesChannel,IkasSalesChannelPaymentGateway,IkasSalesChannelStockLocation}from"./models/data/sales-channel/index.js";export{IkasShippingZoneRegion}from"./models/data/shipping-zone/state/city/district/region/index.js";export{IkasShippingZoneDistrict}from"./models/data/shipping-zone/state/city/district/index.js";export{IkasShippingZoneCity}from"./models/data/shipping-zone/state/city/index.js";export{IkasShippingZoneState}from"./models/data/shipping-zone/state/index.js";export{IkasShippingZone}from"./models/data/shipping-zone/index.js";export{IkasState}from"./models/data/state/index.js";export{IkasStockLocationAddressCity}from"./models/data/stock-location/address/city/index.js";export{IkasStockLocationAddressCountry}from"./models/data/stock-location/address/country/index.js";export{IkasStockLocationAddressDistrict}from"./models/data/stock-location/address/district/index.js";export{IkasStockLocationAddressState}from"./models/data/stock-location/address/state/index.js";export{IkasStockLocationAddress}from"./models/data/stock-location/address/index.js";export{IkasAvailableStockLocation}from"./models/data/stock-location/available/index.js";export{IkasStockLocation}from"./models/data/stock-location/index.js";export{IkasStorefrontPopupAnalytics}from"./models/data/storefront-popup/storefront-popup-analytics/index.js";export{IkasStorefrontPopupDateFilter}from"./models/data/storefront-popup/storefront-popup-date-filter/index.js";export{IkasStorefrontPopupDisplayFilter,IkasStorefrontPopupDisplayFilterTypeEnum}from"./models/data/storefront-popup/storefront-popup-display-filter/index.js";export{IkasStorefrontPopupDisplayFrequencyEnum,IkasStorefrontPopupDisplaySettings,IkasStorefrontPopupDisplayTriggerTypeEnum}from"./models/data/storefront-popup/storefront-popup-display-settings/index.js";export{IkasStorefrontPopupPageFilter,IkasStorefrontPopupPageFilterTypeEnum}from"./models/data/storefront-popup/storefront-popup-page-filter/index.js";export{IkasStorefrontPopupRouting}from"./models/data/storefront-popup/storefront-popup-routing/index.js";export{IkasStorefrontPopup,IkasStorefrontPopupDeviceTypeEnum,IkasStorefrontPopupStatusEnum,IkasStorefrontPopupTypeEnum}from"./models/data/storefront-popup/index.js";export{IkasStorefrontB2BSettings}from"./models/data/storefront/b2b-settings/index.js";export{IkasStorefrontDomain}from"./models/data/storefront/domain/index.js";export{IkasIndexPageSeoSetting}from"./models/data/storefront/index-page-seo-setting/index.js";export{IkasStorefrontLocalization}from"./models/data/storefront/localization/index.js";export{IkasStorefrontDynamicCurrencySettings}from"./models/data/storefront/routing/dynamic-currency/index.js";export{IkasStorefrontRouting}from"./models/data/storefront/routing/index.js";export{IkasStorefrontTheme}from"./models/data/storefront/theme/index.js";export{IkasStorefrontThemeLocalization}from"./models/data/storefront/theme-localization/index.js";export{IkasStorefront}from"./models/data/storefront/index.js";export{IkasThemeJsonComponentProp}from"./models/data/theme-json/component/prop/index.js";export{ComponentTranslation,IkasThemeJsonComponent}from"./models/data/theme-json/component/index.js";export{IkasThemeJsonCustomData,IkasThemeJsonCustomDataEnumOptionTranslation,IkasThemeJsonCustomDataTranslation,IkasThemeJsonEnumOption}from"./models/data/theme-json/custom-data/index.js";export{IkasThemeJsonPageComponent}from"./models/data/theme-json/page/component/index.js";export{IkasThemeJsonPage,IkasThemeJsonPageSpecification}from"./models/data/theme-json/page/index.js";export{IkasThemeJsonColor,IkasThemeJsonColorTranslation}from"./models/data/theme-json/settings/color/index.js";export{IkasThemeJsonFavicon}from"./models/data/theme-json/settings/favicon/index.js";export{IkasThemeJsonFontFamily}from"./models/data/theme-json/settings/font-family/index.js";export{IkasThemeJsonSettings}from"./models/data/theme-json/settings/index.js";export{CHECKOUT_ID,IkasThemeJson}from"./models/data/theme-json/index.js";export{IkasVariantValue}from"./models/data/variant-type/variant-value/index.js";export{IkasVariantType}from"./models/data/variant-type/index.js";export{IkasVideo}from"./models/data/video/index.js";export{AddressFormItem,BillingFormItem}from"@ikas/localized-address";export{IkasBlogList,IkasBlogListType}from"./models/ui/blog-list/index.js";export{IkasBlogCategoryList,IkasBlogCategoryListType}from"./models/ui/blog-category-list/index.js";export{IkasBrandList,IkasBrandListSortType,IkasBrandListType}from"./models/ui/brand-list/index.js";export{IkasCategoryList,IkasCategoryListSortType,IkasCategoryListType}from"./models/ui/category-list/index.js";export{IkasNavigationLink}from"./models/ui/navigation-link/index.js";export{IkasProductList,IkasProductListSortByTypeEnum,IkasProductListSortType,IkasProductListType,IkasRelatedProductsType}from"./models/ui/product-list/index.js";export{IkasAttributeDetail}from"./models/ui/product-attribute-detail/index.js";export{IkasAttributeList}from"./models/ui/product-attribute-list/index.js";export{IkasCustomerReviewList}from"./models/ui/customer-review-list/index.js";export{IkasCustomerReviewSummaryList}from"./models/ui/customer-review-summary-list/index.js";export{Validator}from"./models/ui/validator/index.js";export{EmailRule,EqualsRule,IdentityNumberRule,LessThanRule,MaxRule,MinRule,PhoneRule,RequiredRule,ValidationRule,ValidatorErrorType}from"./models/ui/validator/rules/index.js";export{LoginForm}from"./models/ui/validator/form/login.js";export{AddressForm}from"./models/ui/validator/form/address.js";export{IkasAddressForm}from"./models/ui/validator/form/ikas-address.js";export{RegisterForm}from"./models/ui/validator/form/register.js";export{ContactForm}from"./models/ui/validator/form/contact-form.js";export{ForgotPasswordForm}from"./models/ui/validator/form/forgot-password.js";export{RecoverPasswordForm}from"./models/ui/validator/form/recover-password.js";export{AccountInfoForm}from"./models/ui/validator/form/account-info.js";export{RaffleForm}from"./models/ui/validator/form/raffle-form.js";export{CustomerReviewForm}from"./models/ui/validator/form/customer-review.js";export{IkasComponentRenderer}from"./models/ui/component-renderer/index.js";export{IkasRaffleList}from"./models/ui/raffle-list/index.js";import*as e from"./pages/home.js";export{e as IndexPage};import*as t from"./pages/_slug_/index.js";export{t as SlugPage};import*as o from"./pages/pages/_slug_.js";export{o as CustomPage};import*as a from"./pages/checkout.js";export{a as CheckoutPage};import*as r from"./pages/account/index.js";export{r as AccountPage};import*as s from"./pages/account/addresses.js";export{s as AddressesPage};import*as d from"./pages/account/orders/index.js";export{d as OrdersPage};import*as i from"./pages/account/orders/_id_.js";export{i as OrderDetailPage};import*as n from"./pages/account/login.js";export{n as LoginPage};import*as m from"./pages/account/register.js";export{m as RegisterPage};import*as p from"./pages/account/forgot-password.js";export{p as ForgotPasswordPage};import*as l from"./pages/account/recover-password.js";export{l as RecoverPasswordPage};import*as x from"./pages/cart.js";export{x as CartPage};import*as u from"./pages/editor.js";export{u as EditorPage};import*as c from"./pages/account/favorite-products.js";export{c as FavoriteProductsPage};import*as f from"./pages/search.js";export{f as SearchPage};import*as k from"./pages/404.js";export{k as NotFoundPage};import*as I from"./pages/blog/index.js";export{I as BlogPage};import*as g from"./pages/blog/_slug_.js";export{g as BlogSlugPage};import*as j from"./pages/raffle/_slug_.js";export{j as RafflePage};import*as y from"./pages/raffle/index.js";export{y as RafflesPage};import*as P from"./pages/account/raffles.js";export{P as AccountRafflesPage};import*as T from"./pages/account/activate.js";export{T as ActivateCustomerPage};export{IkasBaseStore}from"./store/base.js";export{IkasCustomerStore}from"./store/customer/index.js";export{IkasCartStore}from"./store/cart/index.js";export{formatDate}from"./utils/helper.js";export{formatCurrency}from"./utils/currency.js";export{createTranslationInputData,useTranslation}from"./utils/i18n.js";export{IkasAdjustmentType,IkasAmountType,IkasCampaignApplicablePrice,IkasCampaignCreatedFor,IkasCampaignFilterType,IkasCampaignOfferProductShowCriteria,IkasCampaignOfferTargetPageType,IkasCampaignType,IkasCartCampaignOfferStatus,IkasCategoryProductsOrderType as IkasCategoryOrderType,IkasCheckoutRequirement,IkasCustomerAccountStatus,IkasCustomerAttributeType,IkasCustomerEmailSubscriptionStatus,IkasCustomerPriceListRuleFilterType,IkasCustomerPriceListRuleValueType,IkasCustomerRegistrationSource,IkasCustomerReviewStatus,IkasInvoiceType,IkasOrderCancelReason,IkasOrderLineItemStatus,IkasOrderPackageFullfillStatus,IkasOrderPackageStatus,IkasOrderPaymentStatus,IkasOrderShippingMethod,IkasOrderStatus,IkasPaymentGatewayAdditionalPriceType,IkasPaymentGatewaySettingsType,IkasPaymentGatewayTransactionFeeType,IkasPaymentGatewayType,IkasPaymentMethodType,IkasPaymentMethodTypeWithPrices,IkasProductAttributeType,IkasProductFilterDisplayType,IkasProductFilterSortType,IkasProductFilterType,IkasProductOptionSelectType,IkasProductOptionType,IkasProductStockFilterValue,IkasProductType,IkasRaffleMetadataTargetType,IkasRaffleVerificationType,IkasShippingMethod,IkasStockLocationDeliveryTime,IkasStockLocationType,IkasStorefrontB2BShowPricesEnum,IkasStorefrontB2BShowProductsEnum,IkasStorefrontStatus,IkasThemeJsonComponentPropType,IkasThemeJsonPageType,IkasThemeJsonStockPreference,IkasTransactionSourceWithPrices,IkasTransactionStatus,IkasTransactionStatusWithPrices,IkasTransactionType,IkasTransactionTypeWithPrices,IkasVariantSelectionType}from"@ikas/storefront-models";export{IkasTransactionWithPrices}from"./models/data/order/order-transaction-with-prices/transaction-with-prices/index.js";
1
+ export{Analytics}from"./analytics/analytics.js";export{AnalyticsBody,AnalyticsHead}from"./analytics/head/index.js";export{IkasPage}from"./components/page/index.js";export{IkasPageHead}from"./components/page/head.js";export{Image}from"./components/image/index.js";export{default as Link}from"./components/link/index.js";export{IkasEditorComponentLoader}from"./components/page-editor/loader/index.js";export{GoogleCaptcha}from"./components/google-captcha/index.js";export{PaypalExpressCheckout}from"./components/paypal-express-checkout/index.js";export{useStore}from"./hooks/useStore.js";export{useCustomerReviews}from"./hooks/useCustomerReviews.js";import"react";export{IkasBaseModel}from"./models/data/base/index.js";export{IkasBlogCategory}from"./models/data/blog/category/index.js";export{IkasBlogContent}from"./models/data/blog/content/index.js";export{IkasBlogMetaData,IkasBlogMetaDataTargetType}from"./models/data/blog/meta-data/index.js";export{IkasBlogTag}from"./models/data/blog/tag/index.js";export{IkasBlogWriter}from"./models/data/blog/writer/index.js";export{IkasBlog}from"./models/data/blog/index.js";export{IkasProductBrandTranslation}from"./models/data/brand/translation/index.js";export{IkasBrand,IkasBrandOrderType}from"./models/data/brand/index.js";export{IkasCampaignOfferProduct,IkasCampaignOfferProductTranslation}from"./models/data/campaign-offer/product/index.js";export{IkasCampaignOffer,IkasCampaignOfferTriggerSettings}from"./models/data/campaign-offer/index.js";export{IkasAvailableShippingMethod}from"./models/data/cart/available-shipping-method/index.js";export{IkasCartCampaignOffer}from"./models/data/cart/campaign-offer/index.js";export{IkasCart}from"./models/data/cart/index.js";export{IkasCategoryPathItem}from"./models/data/category/path-item/index.js";export{IkasCategoryTranslation}from"./models/data/category/translations/index.js";export{IkasCategory}from"./models/data/category/index.js";export{IkasCheckout}from"./models/data/checkout/index.js";export{IkasCheckoutOption}from"./models/data/checkout-settings/option/index.js";export{IkasCheckoutSettingsPrice}from"./models/data/checkout-settings/price/index.js";export{IkasCheckoutSettings}from"./models/data/checkout-settings/index.js";export{IkasCity}from"./models/data/city/index.js";export{IkasContactForm}from"./models/data/contact-form/index.js";export{IkasCountry}from"./models/data/country/index.js";export{IkasCustomerAddressCity}from"./models/data/customer/address/city/index.js";export{IkasCustomerAddressCountry}from"./models/data/customer/address/country/index.js";export{IkasCustomerAddressDistrict}from"./models/data/customer/address/district/index.js";export{IkasCustomerAddressRegion}from"./models/data/customer/address/region/index.js";export{IkasCustomerAddressState}from"./models/data/customer/address/state/index.js";export{IkasCustomerAddress}from"./models/data/customer/address/index.js";export{IkasLocalizedCustomerAddress}from"./models/data/customer/address/ikas-localized-customer-address.js";export{IkasCustomerAttributeOption}from"./models/data/customer/attribute/option/index.js";export{IkasCustomerAttributeSalesChannel}from"./models/data/customer/attribute/sales-channel/index.js";export{IkasCustomerAttributeOptionTranslation}from"./models/data/customer/attribute/translation/option/index.js";export{IkasCustomerAttributeTranslation}from"./models/data/customer/attribute/translation/index.js";export{IkasCustomerAttributeValue}from"./models/data/customer/attribute/value/index.js";export{IkasCustomerAttribute}from"./models/data/customer/attribute/index.js";export{IkasCustomerPriceListRuleFilter}from"./models/data/customer/price-list-rule/filter/index.js";export{IkasCustomerPriceListRule}from"./models/data/customer/price-list-rule/index.js";export{IkasCustomerReviewSettings}from"./models/data/customer/review/settings/index.js";export{IkasCustomerReviewSummaryStar}from"./models/data/customer/review/summary/star/index.js";export{IkasCustomerReviewSummary}from"./models/data/customer/review/summary/index.js";export{IkasCustomerReview}from"./models/data/customer/review/index.js";export{IkasCustomer}from"./models/data/customer/index.js";export{IkasCustomerRegisterSubscriptionInput}from"./models/data/customer-form-data-input/customer-register-subscription-input/index.js";export{IkasCustomerGenderTypeEnum,IkasSaveCustomerFormDataInput}from"./models/data/customer-form-data-input/index.js";export{IkasDistrict}from"./models/data/district/index.js";export{IkasFavoriteProduct}from"./models/data/favorite-product/index.js";export{IkasFilterCategory}from"./models/data/filter-category/index.js";export{IkasHTMLMetaDataTranslations}from"./models/data/html-meta-data/translations/index.js";export{IkasHTMLMetaData,IkasHTMLMetaDataOverride,IkasHTMLMetaDataTargetType}from"./models/data/html-meta-data/index.js";export{IkasImage}from"./models/data/image/index.js";export{IkasLastViewedProduct}from"./models/data/last-viewed-product/index.js";export{IkasMerchantSettings}from"./models/data/merchant-settings/index.js";export{IkasOrderAddressCity}from"./models/data/order/address/city/index.js";export{IkasOrderAddressCountry}from"./models/data/order/address/country/index.js";export{IkasOrderAddressDistrict}from"./models/data/order/address/district/index.js";export{IkasOrderAddressRegion}from"./models/data/order/address/region/index.js";export{IkasOrderAddressState}from"./models/data/order/address/state/index.js";export{IkasOrderAddress}from"./models/data/order/address/index.js";export{IkasOrderAdjustmentAppliedOrderLine}from"./models/data/order/adjustment/applied-order-line/index.js";export{IkasOrderAdjustment}from"./models/data/order/adjustment/index.js";export{IkasOrderCustomer}from"./models/data/order/customer/index.js";export{IkasOrderGiftPackageLine}from"./models/data/order/gift-line/index.js";export{IkasInvoice}from"./models/data/order/invoice/index.js";export{IkasOrderLineDiscount}from"./models/data/order/line-item/discount/index.js";export{IkasOrderLineItemOptionValue}from"./models/data/order/line-item/option/value/index.js";export{IkasOrderLineItemOption}from"./models/data/order/line-item/option/index.js";export{IkasOrderLineVariantBrand}from"./models/data/order/line-item/variant/brand/index.js";export{IkasOrderLineVariantCategory,IkasOrderLineVariantCategoryPath}from"./models/data/order/line-item/variant/category/index.js";export{IkasOrderLineVariantPrice}from"./models/data/order/line-item/variant/price/index.js";export{IkasOrderLineVariantVariantValue}from"./models/data/order/line-item/variant/value/index.js";export{IkasOrderLineVariant}from"./models/data/order/line-item/variant/index.js";export{IkasOrderLineItem}from"./models/data/order/line-item/index.js";export{IkasOrderTransactionWithPrices}from"./models/data/order/order-transaction-with-prices/index.js";export{IkasTrackingInfo}from"./models/data/order/package/tracking-info/index.js";export{IkasOrderPackage}from"./models/data/order/package/index.js";export{IkasOrderPaymentMethod}from"./models/data/order/payment-method/index.js";export{IkasOrderRefundOrderLineInput}from"./models/data/order/refund/line-item/index.js";export{IkasOrderRefundSettings}from"./models/data/order/refund/settings/index.js";export{IkasRefund}from"./models/data/order/refund/index.js";export{IkasOrderShippingLine}from"./models/data/order/shipping-line/index.js";export{IkasOrderTaxLine}from"./models/data/order/tax-line/index.js";export{IkasTransactionError}from"./models/data/order/transaction/error/index.js";export{IkasTransactionInstallmentPrice}from"./models/data/order/transaction/payment-method-detail/installment-price/index.js";export{IkasTransactionPaymentMethodDetail}from"./models/data/order/transaction/payment-method-detail/index.js";export{IkasOrderTransaction}from"./models/data/order/transaction/index.js";export{IkasOrder}from"./models/data/order/index.js";export{IkasPaymentGatewayAdditionalPrice}from"./models/data/payment-gateway/additional-price/index.js";export{IkasPaymentGatewaySettings}from"./models/data/payment-gateway/settings/index.js";export{IkasPaymentGatewayTranslation}from"./models/data/payment-gateway/translation/index.js";export{IkasPaymentGateway}from"./models/data/payment-gateway/index.js";export{IkasProductAttributeOption}from"./models/data/product/attribute/option/index.js";export{IkasProductAttributeTableCell}from"./models/data/product/attribute/table-cell/index.js";export{IkasProductAttributeTableTemplate}from"./models/data/product/attribute/table-template/index.js";export{IkasProductAttributeOptionTranslation,IkasProductAttributeTranslation}from"./models/data/product/attribute/translation/index.js";export{IkasProductAttribute}from"./models/data/product/attribute/index.js";export{IkasAttributeTableCellValue,IkasProductAttributeMap,IkasProductAttributeValue}from"./models/data/product/attribute-value/index.js";export{IkasProductBackInStockSettings}from"./models/data/product/back-in-stock-settings/index.js";export{IkasApplicableProductFilterValue,IkasFilterRangeValue,IkasProductFilter,IkasProductFilterNumberRangeListOption,IkasProductFilterSettings,IkasProductFilterValue,parseRangeStr}from"./models/data/product/filter/index.js";export{IkasProductCampaignData}from"./models/data/product/campaign/data/index.js";export{IkasProductCampaignFilter}from"./models/data/product/campaign/filter/index.js";export{IkasProductBuyX,IkasProductBuyXThenGetY,IkasProductGetY}from"./models/data/product/campaign/product-buyx-then-gety/index.js";export{IkasProductCampaignDateRangeField}from"./models/data/product/campaign/product-campaign-date-range-field/index.js";export{IkasCampaignMinMaxRangeField,IkasProductFixedDiscount}from"./models/data/product/campaign/product-fixed-discount/index.js";export{IkasProductCampaign}from"./models/data/product/campaign/index.js";export{IkasProductCampaignOffer,IkasProductOffer}from"./models/data/product/campaign-offer/index.js";export{IkasProductImage}from"./models/data/product/image/index.js";export{IkasProductOption,IkasProductOptionDateSettings,IkasProductOptionFileSettings,IkasProductOptionOtherPrice,IkasProductOptionSelectSettings,IkasProductOptionSelectValue,IkasProductOptionTextSettings}from"./models/data/product/option-set/option/index.js";export{IkasProductOptionSelectValueTranslations,IkasProductOptionSet,IkasProductOptionSetTranslations,IkasProductOptionTranslations}from"./models/data/product/option-set/index.js";export{IkasProductStockLocations}from"./models/data/product/stock-location/index.js";export{IkasProductTag}from"./models/data/product/tag/index.js";export{IkasProductPrice}from"./models/data/product/variant/price/index.js";export{IkasProductVariant}from"./models/data/product/variant/index.js";export{IkasProductVariantType}from"./models/data/product/variant-type/index.js";export{IkasProduct}from"./models/data/product/index.js";export{IkasProductFile}from"./models/data/product-file/index.js";export{IkasRaffle,IkasRaffleAppliedProduct,IkasRaffleDateRangeField,IkasRaffleMetaData,IkasRaffleParticipant}from"./models/data/raffle/index.js";export{IkasSalesChannel,IkasSalesChannelPaymentGateway,IkasSalesChannelStockLocation}from"./models/data/sales-channel/index.js";export{IkasShippingZoneRegion}from"./models/data/shipping-zone/state/city/district/region/index.js";export{IkasShippingZoneDistrict}from"./models/data/shipping-zone/state/city/district/index.js";export{IkasShippingZoneCity}from"./models/data/shipping-zone/state/city/index.js";export{IkasShippingZoneState}from"./models/data/shipping-zone/state/index.js";export{IkasShippingZone}from"./models/data/shipping-zone/index.js";export{IkasState}from"./models/data/state/index.js";export{IkasStockLocationAddressCity}from"./models/data/stock-location/address/city/index.js";export{IkasStockLocationAddressCountry}from"./models/data/stock-location/address/country/index.js";export{IkasStockLocationAddressDistrict}from"./models/data/stock-location/address/district/index.js";export{IkasStockLocationAddressState}from"./models/data/stock-location/address/state/index.js";export{IkasStockLocationAddress}from"./models/data/stock-location/address/index.js";export{IkasAvailableStockLocation}from"./models/data/stock-location/available/index.js";export{IkasStockLocation}from"./models/data/stock-location/index.js";export{IkasStorefrontPopupAnalytics}from"./models/data/storefront-popup/storefront-popup-analytics/index.js";export{IkasStorefrontPopupDateFilter}from"./models/data/storefront-popup/storefront-popup-date-filter/index.js";export{IkasStorefrontPopupDisplayFilter,IkasStorefrontPopupDisplayFilterTypeEnum}from"./models/data/storefront-popup/storefront-popup-display-filter/index.js";export{IkasStorefrontPopupDisplayFrequencyEnum,IkasStorefrontPopupDisplaySettings,IkasStorefrontPopupDisplayTriggerTypeEnum}from"./models/data/storefront-popup/storefront-popup-display-settings/index.js";export{IkasStorefrontPopupPageFilter,IkasStorefrontPopupPageFilterTypeEnum}from"./models/data/storefront-popup/storefront-popup-page-filter/index.js";export{IkasStorefrontPopupRouting}from"./models/data/storefront-popup/storefront-popup-routing/index.js";export{IkasStorefrontPopup,IkasStorefrontPopupDeviceTypeEnum,IkasStorefrontPopupStatusEnum,IkasStorefrontPopupTypeEnum}from"./models/data/storefront-popup/index.js";export{IkasStorefrontB2BSettings}from"./models/data/storefront/b2b-settings/index.js";export{IkasStorefrontDomain}from"./models/data/storefront/domain/index.js";export{IkasIndexPageSeoSetting}from"./models/data/storefront/index-page-seo-setting/index.js";export{IkasStorefrontLocalization}from"./models/data/storefront/localization/index.js";export{IkasStorefrontDynamicCurrencySettings}from"./models/data/storefront/routing/dynamic-currency/index.js";export{IkasStorefrontRouting}from"./models/data/storefront/routing/index.js";export{IkasStorefrontTheme}from"./models/data/storefront/theme/index.js";export{IkasStorefrontThemeLocalization}from"./models/data/storefront/theme-localization/index.js";export{IkasStorefront}from"./models/data/storefront/index.js";export{IkasThemeJsonComponentProp}from"./models/data/theme-json/component/prop/index.js";export{ComponentTranslation,IkasThemeJsonComponent}from"./models/data/theme-json/component/index.js";export{IkasThemeJsonCustomData,IkasThemeJsonCustomDataEnumOptionTranslation,IkasThemeJsonCustomDataTranslation,IkasThemeJsonEnumOption}from"./models/data/theme-json/custom-data/index.js";export{IkasThemeJsonPageComponent}from"./models/data/theme-json/page/component/index.js";export{IkasThemeJsonPage,IkasThemeJsonPageSpecification}from"./models/data/theme-json/page/index.js";export{IkasThemeJsonColor,IkasThemeJsonColorTranslation}from"./models/data/theme-json/settings/color/index.js";export{IkasThemeJsonFavicon}from"./models/data/theme-json/settings/favicon/index.js";export{IkasThemeJsonFontFamily}from"./models/data/theme-json/settings/font-family/index.js";export{IkasThemeJsonSettings}from"./models/data/theme-json/settings/index.js";export{CHECKOUT_ID,IkasThemeJson}from"./models/data/theme-json/index.js";export{IkasVariantValue}from"./models/data/variant-type/variant-value/index.js";export{IkasVariantType}from"./models/data/variant-type/index.js";export{IkasVideo}from"./models/data/video/index.js";export{AddressFormItem,BillingFormItem}from"@ikas/localized-address";export{IkasBlogList,IkasBlogListType}from"./models/ui/blog-list/index.js";export{IkasBlogCategoryList,IkasBlogCategoryListType}from"./models/ui/blog-category-list/index.js";export{IkasBrandList,IkasBrandListSortType,IkasBrandListType}from"./models/ui/brand-list/index.js";export{IkasCategoryList,IkasCategoryListSortType,IkasCategoryListType}from"./models/ui/category-list/index.js";export{IkasNavigationLink}from"./models/ui/navigation-link/index.js";export{IkasProductList,IkasProductListSortByTypeEnum,IkasProductListSortType,IkasProductListType,IkasRelatedProductsType}from"./models/ui/product-list/index.js";export{IkasAttributeDetail}from"./models/ui/product-attribute-detail/index.js";export{IkasAttributeList}from"./models/ui/product-attribute-list/index.js";export{IkasCustomerReviewList}from"./models/ui/customer-review-list/index.js";export{IkasCustomerReviewSummaryList}from"./models/ui/customer-review-summary-list/index.js";export{Validator}from"./models/ui/validator/index.js";export{EmailRule,EqualsRule,IdentityNumberRule,LessThanRule,MaxRule,MinRule,PhoneRule,RequiredRule,ValidationRule,ValidatorErrorType}from"./models/ui/validator/rules/index.js";export{LoginForm}from"./models/ui/validator/form/login.js";export{AddressForm}from"./models/ui/validator/form/address.js";export{IkasAddressForm}from"./models/ui/validator/form/ikas-address.js";export{RegisterForm}from"./models/ui/validator/form/register.js";export{ContactForm}from"./models/ui/validator/form/contact-form.js";export{ForgotPasswordForm}from"./models/ui/validator/form/forgot-password.js";export{RecoverPasswordForm}from"./models/ui/validator/form/recover-password.js";export{AccountInfoForm}from"./models/ui/validator/form/account-info.js";export{RaffleForm}from"./models/ui/validator/form/raffle-form.js";export{CustomerReviewForm}from"./models/ui/validator/form/customer-review.js";export{IkasComponentRenderer}from"./models/ui/component-renderer/index.js";export{IkasRaffleList}from"./models/ui/raffle-list/index.js";import*as e from"./pages/home.js";export{e as IndexPage};import*as t from"./pages/_slug_/index.js";export{t as SlugPage};import*as o from"./pages/pages/_slug_.js";export{o as CustomPage};import*as a from"./pages/checkout.js";export{a as CheckoutPage};import*as r from"./pages/account/index.js";export{r as AccountPage};import*as s from"./pages/account/addresses.js";export{s as AddressesPage};import*as d from"./pages/account/orders/index.js";export{d as OrdersPage};import*as i from"./pages/account/orders/_id_.js";export{i as OrderDetailPage};import*as n from"./pages/account/login.js";export{n as LoginPage};import*as m from"./pages/account/register.js";export{m as RegisterPage};import*as p from"./pages/account/forgot-password.js";export{p as ForgotPasswordPage};import*as l from"./pages/account/recover-password.js";export{l as RecoverPasswordPage};import*as x from"./pages/cart.js";export{x as CartPage};import*as u from"./pages/editor.js";export{u as EditorPage};import*as c from"./pages/account/favorite-products.js";export{c as FavoriteProductsPage};import*as f from"./pages/search.js";export{f as SearchPage};import*as k from"./pages/404.js";export{k as NotFoundPage};import*as I from"./pages/blog/index.js";export{I as BlogPage};import*as g from"./pages/blog/_slug_.js";export{g as BlogSlugPage};import*as j from"./pages/raffle/_slug_.js";export{j as RafflePage};import*as y from"./pages/raffle/index.js";export{y as RafflesPage};import*as P from"./pages/account/raffles.js";export{P as AccountRafflesPage};import*as T from"./pages/account/activate.js";export{T as ActivateCustomerPage};export{IkasBaseStore}from"./store/base.js";export{IkasCustomerStore}from"./store/customer/index.js";export{IkasCartStore}from"./store/cart/index.js";export{formatDate}from"./utils/helper.js";export{formatCurrency}from"./utils/currency.js";export{createTranslationInputData,useTranslation}from"./utils/i18n.js";export{IkasAdjustmentType,IkasAmountType,IkasCampaignApplicablePrice,IkasCampaignCreatedFor,IkasCampaignFilterType,IkasCampaignOfferProductShowCriteria,IkasCampaignOfferTargetPageType,IkasCampaignType,IkasCartCampaignOfferStatus,IkasCategoryProductsOrderType as IkasCategoryOrderType,IkasCheckoutRequirement,IkasCustomerAccountStatus,IkasCustomerAttributeType,IkasCustomerEmailSubscriptionStatus,IkasCustomerPriceListRuleFilterType,IkasCustomerPriceListRuleValueType,IkasCustomerRegistrationSource,IkasCustomerReviewStatus,IkasInvoiceType,IkasOrderCancelReason,IkasOrderLineItemStatus,IkasOrderPackageFullfillStatus,IkasOrderPackageStatus,IkasOrderPaymentStatus,IkasOrderShippingMethod,IkasOrderStatus,IkasPaymentGatewayAdditionalPriceType,IkasPaymentGatewaySettingsType,IkasPaymentGatewayTransactionFeeType,IkasPaymentGatewayType,IkasPaymentMethodType,IkasPaymentMethodTypeWithPrices,IkasProductAttributeType,IkasProductFilterDisplayType,IkasProductFilterSortType,IkasProductFilterType,IkasProductOptionSelectType,IkasProductOptionType,IkasProductStockFilterValue,IkasProductType,IkasRaffleMetadataTargetType,IkasRaffleVerificationType,IkasShippingMethod,IkasStockLocationDeliveryTime,IkasStockLocationType,IkasStorefrontB2BShowPricesEnum,IkasStorefrontB2BShowProductsEnum,IkasStorefrontStatus,IkasThemeJsonComponentPropType,IkasThemeJsonPageType,IkasThemeJsonStockPreference,IkasTransactionSourceWithPrices,IkasTransactionStatus,IkasTransactionStatusWithPrices,IkasTransactionType,IkasTransactionTypeWithPrices,IkasVariantSelectionType}from"@ikas/storefront-models";export{IkasTransactionWithPrices}from"./models/data/order/order-transaction-with-prices/transaction-with-prices/index.js";
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as i}from'./../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import s from"lodash/debounce";import"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import{IkasThemeJsonPageType as o,IkasCategoryProductsOrderType as a,IkasThemeJsonStockPreference as n}from"@ikas/storefront-models";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import{IkasFilterCategory as d}from"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/order-transaction-with-prices/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import{IkasProductFilter as c,IkasProductFilterValue as u}from"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import{IkasProduct as l}from"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../data/storefront-popup/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";import p from"../../../store/product/index.js";import h from"query-string";import{SortByDirectionEnum as f,SortByTypeEnum as m,GetSuggestedProductsMethodEnum as g}from"@ikas/storefront-api";import{IkasStorefrontConfig as _}from"@ikas/storefront-config";import{Analytics as v}from"../../../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{stringToSlug as y,IkasProductVariantFunctions as E}from"@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"../blog-list/index.js";import"../blog-category-list/index.js";import"../brand-list/index.js";import"../category-list/index.js";import"../product-attribute-detail/index.js";import"../product-attribute-list/index.js";import"../customer-review-list/index.js";import"../customer-review-summary-list/index.js";import"../validator/index.js";import"../validator/rules/index.js";import"../validator/form/login.js";import"../validator/form/address.js";import"../validator/form/ikas-address.js";import"../validator/form/register.js";import"../validator/form/contact-form.js";import"../validator/form/forgot-password.js";import"../validator/form/recover-password.js";import"../validator/form/account-info.js";import"../validator/form/raffle-form.js";import"../validator/form/customer-review.js";import"../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 I}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";import"lodash/get";var S,C,P,T,A,D=function(){function S(a,n){var u=this;this.filters=null,this._filterCategories=null,this._infiniteScrollPage=null,this._initialized=!1,this._minPage=null,this._filterBrandId=null,this._filterCategoryId=null,this._relatedProductData=null,this._recommendedProductData=null,this._viewedTogetherProductData=null,this.pageSpecificData=null,this._recommendFor=null,this._isLoading=!1,this._fetchRequestTime=0,this.router=null,this._excludedFields=null,this._disabledSortTypes=null,this.applyFilters=function(){return t(u,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getInitial()];case 1:return t=e.sent(),[o.CATEGORY,o.BRAND,o.SEARCH].includes(this._pageType)?(t&&this.setQueryParams(),[2]):[2]}}))}))},this.getSelectedVariant=function(t){return t.variants[0]},this.getInitial=function(r,s){return t(u,void 0,void 0,(function(){var t,o,a,n,d,c,u,p,h,f,m,g,_,v,y,S=this;return e(this,(function(e){switch(e.label){case 0:this._isLoading=!0,t=Date.now(),this._fetchRequestTime=t,e.label=1;case 1:return e.trys.push([1,14,15,16]),o=s?this._page:1,a=this._limit,!this.isFilterable||this.filters?[3,3]:[4,this.getFilters()];case 2:e.sent(),e.label=3;case 3:return this.applyQueryParamFilters(r),this.isSearch&&!this.hasAppliedfilter?(this.data=[],this._page=1,this._minPage=1,this._count=0,this._initialized=!0,[2,!0]):(n=void 0,d=!1,this.isStatic?(o=void 0,a=200,[3,10]):[3,4]);case 4:return this.isDiscounted?(o=1,a=10,[3,10]):[3,5];case 5:return this.isRecommended?(o=1,a=10,[3,10]):[3,6];case 6:return this.isLastViewed?this.isBrowser()?[4,this.waitForCustomerStoreInit()]:[3,9]:[3,10];case 7:return e.sent(),[4,I.getInstance().customerStore.getLastViewedProducts()];case 8:return(c=e.sent())&&c.length?(n=c.map((function(t){return t.productId})),d=I.getInstance().customerStore.useLastViewedProductResponse,[3,10]):[2];case 9:return[2];case 10:return d?(p=I.getInstance().customerStore._savedLastViewedProductsResponse,[3,13]):[3,11];case 11:return[4,this.searchProducts(o||1,a||10,n)];case 12:p=e.sent(),e.label=13;case 13:return(u=p)&&this._fetchRequestTime===t?(h=[],!d&&this.isLastViewed&&I.getInstance().customerStore.setSavedLastViewedProductsResponse(u),this.isStatic||this.isLastViewed?(f=this.isStatic?this._productListPropValue.productIds:I.getInstance().customerStore._lastViewedProducts,h=(null==f?void 0:f.map((function(t){var e,r,s=null===(r=null===(e=u.data)||void 0===e?void 0:e.data)||void 0===r?void 0:r.find((function(e){return e.id===t.productId})),o=null==s?void 0:s.variants.find((function(e){return e.id===t.variantId}));if((null==o?void 0:o.isActive)&&E.hasStock(o)||(o=null==s?void 0:s.variants.find((function(t){return t.isActive&&E.hasStock(t)}))),s&&o)return new l(i(i({},s),{selectedVariantValues:o.variantValues}))})).filter((function(t){return!!t})))||[]):h=(null===(_=null===(g=u.data)||void 0===g?void 0:g.data)||void 0===_?void 0:_.map((function(t){var e=S.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})))||[],this.applyFacets(null===(v=u.data)||void 0===v?void 0:v.facets),this.data=h,this._count=(null===(y=u.data)||void 0===y?void 0:y.count)||0,this._initialized=!0,this._page=o||1,this._minPage=this.page,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),s||(this._infiniteScrollPage=null),this.handleListingEvent(),[2,!0]):[2];case 14:return m=e.sent(),console.log(m),[3,16];case 15:return t===this._fetchRequestTime&&(this._isLoading=!1),[7];case 16:return[2]}}))}))},this.getPrev=function(){return t(u,void 0,void 0,(function(){var t,r,s,o,a,n,d,c=this;return e(this,(function(e){switch(e.label){case 0:if(this.isStatic||this.isDiscounted||this.isRecommended||this.isLastViewed||this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),t=this._minPage-1,[4,this.searchProducts(t,this.limit)];case 2:return(r=e.sent())?(s=null===(n=null===(a=r.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.map((function(t){var e=c.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})),this.data=(null==s?void 0:s.concat(this.data))||this.data,this._count=(null===(d=r.data)||void 0===d?void 0:d.count)||this._count,this._minPage=t,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),[3,5]):[2];case 3:return o=e.sent(),console.log(o),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(u,void 0,void 0,(function(){var t,r,s,o,a,n,d=this;return e(this,(function(e){switch(e.label){case 0:if(this.isStatic||this.isDiscounted||this.isRecommended||this.isLastViewed||this._isLoading||!this.hasNext)return[2];this._isLoading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,this.searchProducts(this.page+1,this.limit)];case 2:return(t=e.sent())?(r=null===(a=null===(o=t.data)||void 0===o?void 0:o.data)||void 0===a?void 0:a.map((function(t){var e=d.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})),this.data=this.data.concat(r||[]),this._count=(null===(n=t.data)||void 0===n?void 0:n.count)||this._count,this._page=this.page+1,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),[3,5]):[2];case 3:return s=e.sent(),console.log(s),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(r){return t(u,void 0,void 0,(function(){var t,s,o,a,n,d,c=this;return e(this,(function(e){switch(e.label){case 0:if(this._isLoading||this.isStatic||this.isDiscounted||this.isRecommended||this.isLastViewed)return[2];this._isLoading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,this.searchProducts(r,this.limit)];case 2:return(t=e.sent())?(s=null===(n=null===(a=t.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.map((function(t){var e=c.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})),this.data=s||[],this._count=(null===(d=t.data)||void 0===d?void 0:d.count)||0,this._page=r,this._minPage=r,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),[3,5]):[2];case 3:return o=e.sent(),console.log(o),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.setVisibleInfiniteScrollPage=function(t){var e;u._infiniteScrollPage!==t&&(u._infiniteScrollPage=t,_.getIsEditor()||null===(e=u.router)||void 0===e||e.replace("".concat(location.pathname).concat(u.queryParams?"?"+u.queryParams:""),void 0,{shallow:!0}))},this.searchDebouncer=s((function(){u.applyFilters()}),500),this.searchAnalyticsDebouncer=s((function(){v.search(u._searchKeyword,u.data.length)}),1e3);var p=a,h=a;if(this.data=a.data?a.data.map((function(t){return new l(t)})):[],this._type=p.type||h._type||p.productListPropValue.productListType||h._productListPropValue.productListType||C.ALL,this._pageType=a.pageType,this._sort=a.sort||a.productListPropValue.initialSort||P.LAST_ADDED,this._limit=a.limit||p.productListPropValue.initialLimit||h._productListPropValue.initialLimit||20,this._page=a.page||1,this._minPage=a.minPage||null,this._count=a.count||0,this._searchKeyword=a.searchKeyword||"",this._productListPropValue=p.productListPropValue||h._productListPropValue,this._filterBrandId=p.filterBrandId||h._filterBrandId||null,this._filterCategoryId=p.filterCategoryId||h._filterCategoryId||null,this._relatedProductData=p.relatedProductData||h._relatedProductData||null,this._recommendedProductData=p.recommendedProductData||h._recommendedProductData||null,this._viewedTogetherProductData=p.viewedTogetherProductData||h._viewedTogetherProductData||null,this._excludedFields=p.excludedFields||h._excludedFields||null,this._disabledSortTypes=p.disabledSortTypes||h._disabledSortTypes||null,this._recommendFor=p.recommendFor||h._recommendFor,this.filters=a.filters?a.filters.map((function(t){return new c(t,u)})):null,this._filterCategories=a.filterCategories?a.filterCategories.map((function(t){return new d(t)})):null,this.pageSpecificData=p.pageSpecificData||h.pageSpecificData||null,this.router=n,r(this,{router:!1}),this.setPageSpecificSort(),this.setIsFilteredForProducts(),this.setIsStaticForProducts(),this.isBrowser())if(this.restoreInfiniteScrollPage(),location.search&&(this.isFilterable||this._type===C.SEARCH)){var f=this.getQueryParams();this.getInitial(f,this._page>1)}else this._page>1?this.getInitial(void 0,!0):this.isLastViewed?this.getInitial():this.handleListingEvent()}return Object.defineProperty(S.prototype,"sort",{get:function(){return this._sort},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"pageType",{get:function(){return this._pageType},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"minPage",{get:function(){return this._minPage||1},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"searchKeyword",{get:function(){return this._searchKeyword},set:function(t){t!==this._searchKeyword&&(this._searchKeyword=t,this.searchDebouncer(),this.searchAnalyticsDebouncer())},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isFilterable",{get:function(){return this._type===C.ALL||this._type===C.CATEGORY},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isFiltered",{get:function(){var t,e;return(null===(t=this.filters)||void 0===t?void 0:t.some((function(t){return!!t.valueList.length})))||!!this._searchKeyword||this._pageType!==o.CATEGORY&&(!!this._filterCategoryId||(null===(e=this._filterCategories)||void 0===e?void 0:e.some((function(t){return t.isSelected}))))},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isStatic",{get:function(){return this._type===C.STATIC},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isDiscounted",{get:function(){return this._type===C.DISCOUNTED},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isRecommended",{get:function(){return this._type===C.RECOMMENDED},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isLastViewed",{get:function(){return this._type===C.LAST_VIEWED},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isRelatedProducts",{get:function(){return this._type===C.RELATED_PRODUCTS},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isRecommendedProducts",{get:function(){return this._type===C.RECOMMENDED_PRODUCTS},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isViewedTogetherProducts",{get:function(){return this._type===C.VIEWED_TOGETHER},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isSearch",{get:function(){return this._type===C.SEARCH},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"hasPrev",{get:function(){return!(this.isStatic||this.isDiscounted||this.isRecommended||!this._minPage)&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"hasNext",{get:function(){return!(this.isStatic||this.isDiscounted||this.isRecommended)&&this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"queryParams",{get:function(){var t,e,i,r,s=this,a={};if(null===(t=this.filters)||void 0===t||t.forEach((function(t){t.keyList.length&&(a[y(t.name)]=t.keyList)})),this._searchKeyword&&(a.s=this._searchKeyword),this._sort&&(a.o=b[this._sort]),this._infiniteScrollPage&&(a.page=this._infiniteScrollPage),this._pageType!==o.CATEGORY){var n=null===(e=this.filterCategories)||void 0===e?void 0:e.filter((function(t){return t.isSelected}));if(!!(null==n?void 0:n.length))a.c=null==n?void 0:n.map((function(t){return t.slug}));else if(this._filterCategoryId){var d=null===(r=null===(i=this.filterCategories)||void 0===i?void 0:i.find((function(t){return t.id===s._filterCategoryId})))||void 0===r?void 0:r.slug;d&&(a.c=d)}}return h.stringify(a,{arrayFormat:"comma",encode:!1})},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"filterCategories",{get:function(){var t;return null===(t=this._filterCategories)||void 0===t?void 0:t.filter((function(t){return 0!==t.resultCount}))},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"hasAppliedfilter",{get:function(){var t;return!!this._searchKeyword||(null===(t=this.filters)||void 0===t?void 0:t.some((function(t){return!!t.valueList.length})))},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isFeaturedSortEnabled",{get:function(){var t;return(null===(t=this.pageSpecificData)||void 0===t?void 0:t.orderType)===a.MANUALLY&&[C.ALL,C.CATEGORY].includes(this._type)},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"disabledSortTypes",{get:function(){return this._disabledSortTypes},enumerable:!1,configurable:!0}),S.prototype.setIsFilteredForProducts=function(){var t=this;this.data.forEach((function(e){return e.isFiltered=t.isFiltered||!1}))},S.prototype.setIsStaticForProducts=function(){var t=this;this.data.forEach((function(e){return e.isStatic=t.isStatic||!1}))},S.prototype.setPageSpecificSort=function(){var t;if((null===(t=this.pageSpecificData)||void 0===t?void 0:t.orderType)&&[C.ALL].includes(this._type))switch(this.pageSpecificData.orderType){case a.HIGHEST_DISCOUNT_RATIO:this._sort=P.DECRASING_DISCOUNT;break;case a.LOWEST_DISCOUNT_RATIO:this._sort=P.INCREASING_DISCOUNT;break;case a.HIGHEST_PRICE:this._sort=P.DECREASING_PRICE;break;case a.LOWEST_PRICE:this._sort=P.INCREASING_PRICE;break;case a.NEWEST:this._sort=P.LAST_ADDED;break;case a.OLDEST:this._sort=P.FIRST_ADDED;break;case a.MANUALLY:this._sort=P.FEATURED}},S.prototype.getSortParams=function(){var t,e;switch(this._sort){case P.INCREASING_PRICE:t=f.ASC,e=m.PRICE;break;case P.DECREASING_PRICE:t=f.DESC,e=m.PRICE;break;case P.FIRST_ADDED:t=f.ASC,e=m.CREATED_AT;break;case P.LAST_ADDED:t=f.DESC,e=m.CREATED_AT;break;case P.INCREASING_DISCOUNT:t=f.ASC,e=m.DISCOUNT_RATIO;break;case P.DECRASING_DISCOUNT:t=f.DESC,e=m.DISCOUNT_RATIO;break;case P.FEATURED:if(this.isSearch)return;t=f.ASC,e=m.MANUAL_SORT;break;case P.DEFAULT:t=void 0,e=void 0;break;case P.AVERAGE_RATING:t=f.DESC,e=m.AVERAGE_RATING;break;case P.REVIEW_COUNT:t=f.DESC,e=m.REVIEW_COUNT;break;case P.SALE_COUNT:t=f.DESC,e=m.SALE_COUNT;break;case P.A_Z:t=f.ASC,e=m.NAME;break;case P.Z_A:t=f.DESC,e=m.NAME}if(t&&e)return{direction:t,type:e}},S.prototype.searchProducts=function(i,r,s){var a,d,c;return t(this,void 0,void 0,(function(){var t,l,h,f,m;return e(this,(function(e){switch(e.label){case 0:return t=[],l=[],null===(a=this.filters)||void 0===a||a.forEach((function(e){e.valueList.length&&t.push(new u({id:e.id,type:e.type,displayType:e.displayType,valueList:e.valueList})),e.isFacetFilter&&l.push({id:e.id,type:e.type,displayType:e.displayType})})),h=null===(d=this._filterCategories)||void 0===d?void 0:d.filter((function(t){return t.isSelected})).map((function(t){return t.id})),f=this.getSortParams(),this.isRelatedProducts&&this._relatedProductData?[4,p.getSuggestedProducts({priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),productId:this._relatedProductData.productId,brandIds:this._relatedProductData.brandIds,categoryIds:this._relatedProductData.categoryIds,locale:_.getCurrentLocale()})]:[3,2];case 1:case 3:case 5:case 7:return[2,e.sent()];case 2:return this.isRecommendedProducts&&this._recommendedProductData?[4,p.getSuggestedProducts({priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),brandIds:this._recommendedProductData.brandIds,categoryIds:this._recommendedProductData.categoryIds,locale:_.getCurrentLocale()})]:[3,4];case 4:return this.isViewedTogetherProducts&&this._viewedTogetherProductData?[4,p.getSuggestedProducts({priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),method:g.VIEWED_TOGETHER,productIds:this._viewedTogetherProductData.productIds,locale:_.getCurrentLocale()})]:[3,6];case 6:return m={input:{page:i,perPage:r,productIdList:this.isStatic?null===(c=this._productListPropValue.productIds)||void 0===c?void 0:c.map((function(t){return t.productId})):s,filterList:t,facetList:l,brandId:this._pageType===o.BRAND&&this._type!==C.SEARCH?this._filterBrandId:void 0,categoryIdList:h&&h.length?h:this._filterCategoryId?[this._filterCategoryId]:void 0,priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),query:this._searchKeyword,order:f?[f]:[],showStockOption:_.getStockPreference()||n.SHOW_ALL}},[4,p.searchProducts(m,this._excludedFields)]}}))}))},S.prototype.getFilters=function(){var i,r,s,a;return t(this,void 0,void 0,(function(){var t,n,d=this;return e(this,(function(e){switch(e.label){case 0:return[4,p.getProductFilterData({categoryId:this._filterCategoryId?this._filterCategoryId:void 0,locale:_.getCurrentLocale()})];case 1:return t=e.sent(),this.filters=null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.filters.map((function(t){return new c(t,d)})),this._filterCategories=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.categories,this._disabledSortTypes=null===(s=t.data)||void 0===s?void 0:s.disabledSortTypes,this.pageType!==o.CATEGORY&&this._filterCategoryId&&(n=null===(a=this._filterCategories)||void 0===a?void 0:a.find((function(t){return t.id===d._filterCategoryId})))&&(n.isSelected=!0),this.filters&&this.filters.sort((function(t,e){return t.order>e.order?1:-1})),[2]}}))}))},S.prototype.applyQueryParamFilters=function(t){var e,i=this;try{null==t||t.forEach((function(t,e){var r,s=null===(r=i.filters)||void 0===r?void 0:r.find((function(t){return t.key===e||t.name===e||y(t.name)===y(e)}));s&&s.applyQueryParam(t)}));var r=null==t?void 0:t.get("s");r&&(this._searchKeyword=r);var s=null==t?void 0:t.get("o");if(s){var a=parseInt(s),n=Object.entries(b).find((function(t){return t[1]===a}));n&&(this._sort=n[0])}if(this._pageType!==o.CATEGORY){var d=null==t?void 0:t.get("c"),c=null==d?void 0:d.split(",");c&&c.length&&(null===(e=this.filterCategories)||void 0===e||e.forEach((function(t){t.isSelected=c.some((function(e){return e===t.slug}))})))}}catch(t){console.log(t)}},S.prototype.applyFacets=function(t){var e,i;null===(e=this.filters)||void 0===e||e.forEach((function(e){var i,r,s,o=null==t?void 0:t.find((function(t){return t.id===e.id}));o?null===(i=e.values)||void 0===i||i.forEach((function(t){var i=o.values.find((function(e){return e.id===t.id}));i?t.resultCount=i.count:e.isCustomValueFilter?t.resultCount=null:t.resultCount=0})):e.isCustomValueFilter?null===(r=e.values)||void 0===r||r.forEach((function(t){return t.resultCount=null})):null===(s=e.values)||void 0===s||s.forEach((function(t){return t.resultCount=0}))}));var r=null==t?void 0:t.find((function(t){return"category"===t.id}));r&&(null===(i=this._filterCategories)||void 0===i||i.forEach((function(t){var e=r.values.find((function(e){return e.id===t.id}));t.resultCount=e?e.count:0})))},S.prototype.setQueryParams=function(){var t;!this.isBrowser()||this.isSearch||_.getIsEditor()||null===(t=this.router)||void 0===t||t.replace("".concat(location.pathname).concat(this.queryParams?"?"+this.queryParams:""),void 0,{shallow:!0})},S.prototype.clearFilters=function(){var t,e;null===(t=this.filters)||void 0===t||t.forEach((function(t){return t.clear()})),this._searchKeyword="",this._pageType!==o.CATEGORY&&(this._filterCategoryId=void 0),null===(e=this._filterCategories)||void 0===e||e.forEach((function(t){return t.isSelected=!1})),this.applyFilters()},S.prototype.setSortType=function(i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this._sort=i,[4,this.getInitial()];case 1:return t.sent()&&this.setQueryParams(),[2]}}))}))},S.prototype.onFilterCategoryClick=function(i,r){var s,o;return void 0===r&&(r=!1),t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return r?(null===(s=this._filterCategories)||void 0===s||s.forEach((function(t){t.id===i.id&&(t.isSelected=!t.isSelected)})),[4,this.applyFilters()]):[3,2];case 1:return t.sent(),[3,3];case 2:_.getIsEditor()||null===(o=I.getInstance().router)||void 0===o||o.push(i.href+(this.queryParams?"?"+this.queryParams:"")),t.label=3;case 3:return[2]}}))}))},S.prototype.toJSON=function(){return{data:this.data,type:this._type,pageType:this._pageType,sort:this._sort,limit:this._limit,page:this._page,count:this._count,searchKeyword:this._searchKeyword,initialized:this._initialized,minPage:this._minPage,filterBrandId:this._filterBrandId,filterCategoryId:this._filterCategoryId,filterCategories:this._filterCategories,filters:this.filters,recommendFor:this._recommendFor,productListPropValue:this._productListPropValue}},S.prototype.restoreInfiniteScrollPage=function(){var t=this.getQueryParams(),e=null==t?void 0:t.get("page");if(e){var i=parseInt(e);isNaN(i)||(this._page=i,this._infiniteScrollPage=i)}},S.prototype.getQueryParams=function(){if(this.isBrowser())return new URLSearchParams(location.search)},S.prototype.isBrowser=function(){return"undefined"!=typeof window},S.prototype.waitForCustomerStoreInit=function(){return new Promise((function(t){var e=setInterval((function(){I.getInstance().customerStore.initialized&&(clearInterval(e),t(null))}),1e3)}))},S.prototype.handleListingEvent=function(){this.searchKeyword&&this.data.length?v.viewSearchResults(this._searchKeyword,this.data):this.data.length&&this._type===C.ALL&&v.viewListing(this.data)},S}();!function(t){t.ALL="ALL",t.STATIC="STATIC",t.DISCOUNTED="DISCOUNTED",t.RECOMMENDED="RECOMMENDED",t.CATEGORY="CATEGORY",t.SEARCH="SEARCH",t.LAST_VIEWED="LAST_VIEWED",t.RELATED_PRODUCTS="RELATED_PRODUCTS",t.VIEWED_TOGETHER="VIEWED_TOGETHER",t.RECOMMENDED_PRODUCTS="RECOMMENDED_PRODUCTS"}(C||(C={})),function(t){t.INCREASING_PRICE="INCREASING_PRICE",t.DECREASING_PRICE="DECREASING_PRICE",t.LAST_ADDED="LAST_ADDED",t.FIRST_ADDED="FIRST_ADDED",t.INCREASING_DISCOUNT="INCREASING_DISCOUNT",t.DECRASING_DISCOUNT="DECRASING_DISCOUNT",t.FEATURED="FEATURED",t.DEFAULT="DEFAULT",t.AVERAGE_RATING="AVERAGE_RATING",t.REVIEW_COUNT="REVIEW_COUNT",t.SALE_COUNT="SALE_COUNT",t.A_Z="A_Z",t.Z_A="Z_A"}(P||(P={})),function(t){t.AVERAGE_RATING="AVERAGE_RATING",t.CREATED_AT="CREATED_AT",t.DISCOUNT_RATIO="DISCOUNT_RATIO",t.MANUAL_SORT="MANUAL_SORT",t.NAME="NAME",t.PRICE="PRICE",t.REVIEW_COUNT="REVIEW_COUNT",t.SALE_COUNT="SALE_COUNT"}(T||(T={})),function(t){t.CATEGORY="CATEGORY",t.BRAND="BRAND"}(A||(A={}));var b=((S={})[P.INCREASING_PRICE]=1,S[P.DECREASING_PRICE]=2,S[P.LAST_ADDED]=3,S[P.FIRST_ADDED]=4,S[P.INCREASING_DISCOUNT]=5,S[P.DECRASING_DISCOUNT]=6,S[P.FEATURED]=7,S[P.DEFAULT]=8,S[P.AVERAGE_RATING]=9,S[P.REVIEW_COUNT]=10,S[P.SALE_COUNT]=11,S[P.A_Z]=12,S[P.Z_A]=13,S);export{D as IkasProductList,T as IkasProductListSortByTypeEnum,P as IkasProductListSortType,C as IkasProductListType,A as IkasRelatedProductsType};
1
+ import{__awaiter as t,__generator as e,__assign as i}from'./../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import s from"lodash/debounce";import"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import{IkasThemeJsonPageType as o,IkasCategoryProductsOrderType as a,IkasThemeJsonStockPreference as n}from"@ikas/storefront-models";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import{IkasFilterCategory as d}from"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/order-transaction-with-prices/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import{IkasProductFilter as c,IkasProductFilterValue as u}from"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import{IkasProduct as l}from"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../data/storefront-popup/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";import p from"../../../store/product/index.js";import h from"query-string";import{SortByDirectionEnum as f,SortByTypeEnum as m,GetSuggestedProductsMethodEnum as g}from"@ikas/storefront-api";import{IkasStorefrontConfig as _}from"@ikas/storefront-config";import{Analytics as v}from"../../../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{stringToSlug as y,IkasProductVariantFunctions as E}from"@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"../blog-list/index.js";import"../blog-category-list/index.js";import"../brand-list/index.js";import"../category-list/index.js";import"../product-attribute-detail/index.js";import"../product-attribute-list/index.js";import"../customer-review-list/index.js";import"../customer-review-summary-list/index.js";import"../validator/index.js";import"../validator/rules/index.js";import"../validator/form/login.js";import"../validator/form/address.js";import"../validator/form/ikas-address.js";import"../validator/form/register.js";import"../validator/form/contact-form.js";import"../validator/form/forgot-password.js";import"../validator/form/recover-password.js";import"../validator/form/account-info.js";import"../validator/form/raffle-form.js";import"../validator/form/customer-review.js";import"../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 I}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";import"lodash/get";var S,C,P,T,A,D=function(){function S(a,n){var u=this;this.filters=null,this._filterCategories=null,this._infiniteScrollPage=null,this._initialized=!1,this._minPage=null,this._filterBrandId=null,this._filterCategoryId=null,this._relatedProductData=null,this._recommendedProductData=null,this._viewedTogetherProductData=null,this.pageSpecificData=null,this._recommendFor=null,this._isLoading=!1,this._fetchRequestTime=0,this.router=null,this._excludedFields=null,this._disabledSortTypes=null,this.applyFilters=function(){return t(u,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getInitial()];case 1:return t=e.sent(),[o.CATEGORY,o.BRAND,o.SEARCH].includes(this._pageType)?(t&&this.setQueryParams(),[2]):[2]}}))}))},this.getSelectedVariant=function(t){return t.variants[0]},this.getInitial=function(r,s){return t(u,void 0,void 0,(function(){var t,o,a,n,d,c,u,p,h,f,m,g,_,v,y,S=this;return e(this,(function(e){switch(e.label){case 0:this._isLoading=!0,t=Date.now(),this._fetchRequestTime=t,e.label=1;case 1:return e.trys.push([1,14,15,16]),o=s?this._page:1,a=this._limit,!this.isFilterable||this.filters?[3,3]:[4,this.getFilters()];case 2:e.sent(),e.label=3;case 3:return this.applyQueryParamFilters(r),this.isSearch&&!this.hasAppliedfilter?(this.data=[],this._page=1,this._minPage=1,this._count=0,this._initialized=!0,[2,!0]):(n=void 0,d=!1,this.isStatic?(o=void 0,a=200,[3,10]):[3,4]);case 4:return this.isDiscounted?(o=1,a=10,[3,10]):[3,5];case 5:return this.isRecommended?(o=1,a=10,[3,10]):[3,6];case 6:return this.isLastViewed?this.isBrowser()?[4,this.waitForCustomerStoreInit()]:[3,9]:[3,10];case 7:return e.sent(),[4,I.getInstance().customerStore.getLastViewedProducts()];case 8:return(c=e.sent())&&c.length?(n=c.map((function(t){return t.productId})),d=I.getInstance().customerStore.useLastViewedProductResponse,[3,10]):[2];case 9:return[2];case 10:return d?(p=I.getInstance().customerStore._savedLastViewedProductsResponse,[3,13]):[3,11];case 11:return[4,this.searchProducts(o||1,a||10,n)];case 12:p=e.sent(),e.label=13;case 13:return(u=p)&&this._fetchRequestTime===t?(h=[],!d&&this.isLastViewed&&I.getInstance().customerStore.setSavedLastViewedProductsResponse(u),this.isStatic||this.isLastViewed?(f=this.isStatic?this._productListPropValue.productIds:I.getInstance().customerStore._lastViewedProducts,h=(null==f?void 0:f.map((function(t){var e,r,s=null===(r=null===(e=u.data)||void 0===e?void 0:e.data)||void 0===r?void 0:r.find((function(e){return e.id===t.productId})),o=null==s?void 0:s.variants.find((function(e){return e.id===t.variantId}));if((null==o?void 0:o.isActive)&&E.hasStock(o)||(o=null==s?void 0:s.variants.find((function(t){return t.isActive&&E.hasStock(t)}))),s&&o)return new l(i(i({},s),{selectedVariantValues:o.variantValues}))})).filter((function(t){return!!t})))||[]):h=(null===(_=null===(g=u.data)||void 0===g?void 0:g.data)||void 0===_?void 0:_.map((function(t){var e=S.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})))||[],this.applyFacets(null===(v=u.data)||void 0===v?void 0:v.facets),this.data=h,this._count=(null===(y=u.data)||void 0===y?void 0:y.count)||0,this._initialized=!0,this._page=o||1,this._minPage=this.page,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),s||(this._infiniteScrollPage=null),this.handleListingEvent(),[2,!0]):[2];case 14:return m=e.sent(),console.log(m),[3,16];case 15:return t===this._fetchRequestTime&&(this._isLoading=!1),[7];case 16:return[2]}}))}))},this.getPrev=function(){return t(u,void 0,void 0,(function(){var t,r,s,o,a,n,d,c=this;return e(this,(function(e){switch(e.label){case 0:if(this.isStatic||this.isDiscounted||this.isRecommended||this.isLastViewed||this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),t=this._minPage-1,[4,this.searchProducts(t,this.limit)];case 2:return(r=e.sent())?(s=null===(n=null===(a=r.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.map((function(t){var e=c.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})),this.data=(null==s?void 0:s.concat(this.data))||this.data,this._count=(null===(d=r.data)||void 0===d?void 0:d.count)||this._count,this._minPage=t,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),[3,5]):[2];case 3:return o=e.sent(),console.log(o),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(u,void 0,void 0,(function(){var t,r,s,o,a,n,d=this;return e(this,(function(e){switch(e.label){case 0:if(this.isStatic||this.isDiscounted||this.isRecommended||this.isLastViewed||this._isLoading||!this.hasNext)return[2];this._isLoading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,this.searchProducts(this.page+1,this.limit)];case 2:return(t=e.sent())?(r=null===(a=null===(o=t.data)||void 0===o?void 0:o.data)||void 0===a?void 0:a.map((function(t){var e=d.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})),this.data=this.data.concat(r||[]),this._count=(null===(n=t.data)||void 0===n?void 0:n.count)||this._count,this._page=this.page+1,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),[3,5]):[2];case 3:return s=e.sent(),console.log(s),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(r){return t(u,void 0,void 0,(function(){var t,s,o,a,n,d,c=this;return e(this,(function(e){switch(e.label){case 0:if(this._isLoading||this.isStatic||this.isDiscounted||this.isRecommended||this.isLastViewed)return[2];this._isLoading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,this.searchProducts(r,this.limit)];case 2:return(t=e.sent())?(s=null===(n=null===(a=t.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.map((function(t){var e=c.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})),this.data=s||[],this._count=(null===(d=t.data)||void 0===d?void 0:d.count)||0,this._page=r,this._minPage=r,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),[3,5]):[2];case 3:return o=e.sent(),console.log(o),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.setVisibleInfiniteScrollPage=function(t){var e;u._infiniteScrollPage!==t&&(u._infiniteScrollPage=t,_.getIsEditor()||null===(e=u.router)||void 0===e||e.replace("".concat(location.pathname).concat(u.queryParams?"?"+u.queryParams:""),void 0,{shallow:!0}))},this.searchDebouncer=s((function(){u.applyFilters()}),500),this.searchAnalyticsDebouncer=s((function(){v.search(u._searchKeyword,u.data.length)}),1e3);var p=a,h=a;if(this.data=a.data?a.data.map((function(t){return new l(t)})):[],this._type=p.type||h._type||p.productListPropValue.productListType||h._productListPropValue.productListType||C.ALL,this._pageType=a.pageType,this._sort=a.sort||a.productListPropValue.initialSort||P.LAST_ADDED,this._limit=a.limit||p.productListPropValue.initialLimit||h._productListPropValue.initialLimit||20,this._page=a.page||1,this._minPage=a.minPage||null,this._count=a.count||0,this._searchKeyword=a.searchKeyword||"",this._productListPropValue=p.productListPropValue||h._productListPropValue,this._filterBrandId=p.filterBrandId||h._filterBrandId||null,this._filterCategoryId=p.filterCategoryId||h._filterCategoryId||null,this._relatedProductData=p.relatedProductData||h._relatedProductData||null,this._recommendedProductData=p.recommendedProductData||h._recommendedProductData||null,this._viewedTogetherProductData=p.viewedTogetherProductData||h._viewedTogetherProductData||null,this._excludedFields=p.excludedFields||h._excludedFields||null,this._disabledSortTypes=p.disabledSortTypes||h._disabledSortTypes||null,this._recommendFor=p.recommendFor||h._recommendFor,this.filters=a.filters?a.filters.map((function(t){return new c(t,u)})):null,this._filterCategories=a.filterCategories?a.filterCategories.map((function(t){return new d(t)})):null,this.pageSpecificData=p.pageSpecificData||h.pageSpecificData||null,this.router=n,r(this,{router:!1}),this.setPageSpecificSort(),this.setIsFilteredForProducts(),this.setIsStaticForProducts(),this.isBrowser())if(this.restoreInfiniteScrollPage(),location.search&&(this.isFilterable||this._type===C.SEARCH)){var f=this.getQueryParams();this.getInitial(f,this._page>1)}else this._page>1?this.getInitial(void 0,!0):this.isLastViewed?this.getInitial():this.handleListingEvent()}return Object.defineProperty(S.prototype,"sort",{get:function(){return this._sort},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"pageType",{get:function(){return this._pageType},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"minPage",{get:function(){return this._minPage||1},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"searchKeyword",{get:function(){return this._searchKeyword},set:function(t){t!==this._searchKeyword&&(this._searchKeyword=t,this.searchDebouncer(),this.searchAnalyticsDebouncer())},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isFilterable",{get:function(){return this._type===C.ALL||this._type===C.CATEGORY},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isFiltered",{get:function(){var t,e;return(null===(t=this.filters)||void 0===t?void 0:t.some((function(t){return!!t.valueList.length})))||!!this._searchKeyword||this._pageType!==o.CATEGORY&&(!!this._filterCategoryId||(null===(e=this._filterCategories)||void 0===e?void 0:e.some((function(t){return t.isSelected}))))},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isStatic",{get:function(){return this._type===C.STATIC},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isDiscounted",{get:function(){return this._type===C.DISCOUNTED},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isRecommended",{get:function(){return this._type===C.RECOMMENDED},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isLastViewed",{get:function(){return this._type===C.LAST_VIEWED},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isRelatedProducts",{get:function(){return this._type===C.RELATED_PRODUCTS},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isRecommendedProducts",{get:function(){return this._type===C.RECOMMENDED_PRODUCTS},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isViewedTogetherProducts",{get:function(){return this._type===C.VIEWED_TOGETHER},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isSearch",{get:function(){return this._type===C.SEARCH},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"hasPrev",{get:function(){return!(this.isStatic||this.isDiscounted||this.isRecommended||!this._minPage)&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"hasNext",{get:function(){return!(this.isStatic||this.isDiscounted||this.isRecommended)&&this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"queryParams",{get:function(){var t,e,i,r,s=this,a={};if(null===(t=this.filters)||void 0===t||t.forEach((function(t){t.keyList.length&&(a[y(t.name)]=t.keyList)})),this._searchKeyword&&(a.s=this._searchKeyword),this._sort&&(a.o=b[this._sort]),this._infiniteScrollPage&&(a.page=this._infiniteScrollPage),this._pageType!==o.CATEGORY){var n=null===(e=this.filterCategories)||void 0===e?void 0:e.filter((function(t){return t.isSelected}));if(!!(null==n?void 0:n.length))a.c=null==n?void 0:n.map((function(t){return t.slug}));else if(this._filterCategoryId){var d=null===(r=null===(i=this.filterCategories)||void 0===i?void 0:i.find((function(t){return t.id===s._filterCategoryId})))||void 0===r?void 0:r.slug;d&&(a.c=d)}}return h.stringify(a,{arrayFormat:"comma",encode:!1})},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"filterCategories",{get:function(){var t;return null===(t=this._filterCategories)||void 0===t?void 0:t.filter((function(t){return 0!==t.resultCount}))},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"hasAppliedfilter",{get:function(){var t;return!!this._searchKeyword||(null===(t=this.filters)||void 0===t?void 0:t.some((function(t){return!!t.valueList.length})))},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isFeaturedSortEnabled",{get:function(){var t;return(null===(t=this.pageSpecificData)||void 0===t?void 0:t.orderType)===a.MANUALLY&&[C.ALL,C.CATEGORY].includes(this._type)},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"disabledSortTypes",{get:function(){return this._disabledSortTypes},enumerable:!1,configurable:!0}),S.prototype.setIsFilteredForProducts=function(){var t=this;this.data.forEach((function(e){return e.isFiltered=t.isFiltered||!1}))},S.prototype.setIsStaticForProducts=function(){var t=this;this.data.forEach((function(e){return e.isStatic=t.isStatic||!1}))},S.prototype.setPageSpecificSort=function(){var t;if((null===(t=this.pageSpecificData)||void 0===t?void 0:t.orderType)&&[C.ALL].includes(this._type))switch(this.pageSpecificData.orderType){case a.HIGHEST_DISCOUNT_RATIO:this._sort=P.DECRASING_DISCOUNT;break;case a.LOWEST_DISCOUNT_RATIO:this._sort=P.INCREASING_DISCOUNT;break;case a.HIGHEST_PRICE:this._sort=P.DECREASING_PRICE;break;case a.LOWEST_PRICE:this._sort=P.INCREASING_PRICE;break;case a.NEWEST:this._sort=P.LAST_ADDED;break;case a.OLDEST:this._sort=P.FIRST_ADDED;break;case a.MANUALLY:this._sort=P.FEATURED}},S.prototype.getSortParams=function(){var t,e;switch(this._sort){case P.INCREASING_PRICE:t=f.ASC,e=m.PRICE;break;case P.DECREASING_PRICE:t=f.DESC,e=m.PRICE;break;case P.FIRST_ADDED:t=f.ASC,e=m.CREATED_AT;break;case P.LAST_ADDED:t=f.DESC,e=m.CREATED_AT;break;case P.INCREASING_DISCOUNT:t=f.ASC,e=m.DISCOUNT_RATIO;break;case P.DECRASING_DISCOUNT:t=f.DESC,e=m.DISCOUNT_RATIO;break;case P.FEATURED:if(this.isSearch)return;t=f.ASC,e=m.MANUAL_SORT;break;case P.DEFAULT:t=void 0,e=void 0;break;case P.AVERAGE_RATING:t=f.DESC,e=m.AVERAGE_RATING;break;case P.REVIEW_COUNT:t=f.DESC,e=m.REVIEW_COUNT;break;case P.SALE_COUNT:t=f.DESC,e=m.SALE_COUNT;break;case P.A_Z:t=f.ASC,e=m.NAME;break;case P.Z_A:t=f.DESC,e=m.NAME}if(t&&e)return{direction:t,type:e}},S.prototype.searchProducts=function(i,r,s){var a,d,c;return t(this,void 0,void 0,(function(){var t,l,h,f,m;return e(this,(function(e){switch(e.label){case 0:return t=[],l=[],null===(a=this.filters)||void 0===a||a.forEach((function(e){e.valueList.length&&t.push(new u({id:e.id,type:e.type,displayType:e.displayType,valueList:e.valueList})),e.isFacetFilter&&l.push({id:e.id,type:e.type,displayType:e.displayType})})),h=null===(d=this._filterCategories)||void 0===d?void 0:d.filter((function(t){return t.isSelected})).map((function(t){return t.id})),f=this.getSortParams(),this.isRelatedProducts&&this._relatedProductData?[4,p.getSuggestedProducts({priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),productId:this._relatedProductData.productId,brandIds:this._relatedProductData.brandIds,categoryIds:this._relatedProductData.categoryIds,locale:_.getCurrentLocale()})]:[3,2];case 1:case 3:case 5:case 7:return[2,e.sent()];case 2:return this.isRecommendedProducts&&this._recommendedProductData?[4,p.getSuggestedProducts({priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),brandIds:this._recommendedProductData.brandIds,categoryIds:this._recommendedProductData.categoryIds,locale:_.getCurrentLocale()})]:[3,4];case 4:return this.isViewedTogetherProducts&&this._viewedTogetherProductData?[4,p.getSuggestedProducts({priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),method:g.VIEWED_TOGETHER,productIds:this._viewedTogetherProductData.productIds,locale:_.getCurrentLocale()})]:[3,6];case 6:return m={input:{page:i,perPage:r,productIdList:this.isStatic?null===(c=this._productListPropValue.productIds)||void 0===c?void 0:c.map((function(t){return t.productId})):s,filterList:t,facetList:l,brandId:this._pageType===o.BRAND&&this._type!==C.SEARCH?this._filterBrandId:void 0,categoryIdList:h&&h.length?h:this._filterCategoryId?[this._filterCategoryId]:void 0,priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),query:this._searchKeyword,order:f?[f]:[],showStockOption:_.getStockPreference()||n.SHOW_ALL}},[4,p.searchProducts(m,this._excludedFields)]}}))}))},S.prototype.getFilters=function(){var i,r,s,a;return t(this,void 0,void 0,(function(){var t,n,d=this;return e(this,(function(e){switch(e.label){case 0:return[4,p.getProductFilterData({categoryId:this._filterCategoryId?this._filterCategoryId:void 0,locale:_.getCurrentLocale()})];case 1:return t=e.sent(),this.filters=null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.filters.map((function(t){return new c(t,d)})),this._filterCategories=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.categories,this._disabledSortTypes=null===(s=t.data)||void 0===s?void 0:s.disabledSortTypes,this.pageType!==o.CATEGORY&&this._filterCategoryId&&(n=null===(a=this._filterCategories)||void 0===a?void 0:a.find((function(t){return t.id===d._filterCategoryId})))&&(n.isSelected=!0),this.filters&&this.filters.sort((function(t,e){return t.order>e.order?1:-1})),[2]}}))}))},S.prototype.applyQueryParamFilters=function(t){var e,i=this;try{null==t||t.forEach((function(t,e){var r,s=null===(r=i.filters)||void 0===r?void 0:r.find((function(t){return t.key===e||t.name===e||y(t.name)===y(e)}));s&&s.applyQueryParam(t)}));var r=null==t?void 0:t.get("s");r&&(this._searchKeyword=r);var s=null==t?void 0:t.get("o");if(s){var a=parseInt(s),n=Object.entries(b).find((function(t){return t[1]===a}));n&&(this._sort=n[0])}if(this._pageType!==o.CATEGORY){var d=null==t?void 0:t.get("c"),c=null==d?void 0:d.split(",");c&&c.length&&(null===(e=this.filterCategories)||void 0===e||e.forEach((function(t){t.isSelected=c.some((function(e){return e===t.slug}))})))}}catch(t){console.log(t)}},S.prototype.applyFacets=function(t){var e,i;null===(e=this.filters)||void 0===e||e.forEach((function(e){var i,r,s,o=null==t?void 0:t.find((function(t){return t.id===e.id}));o?null===(i=e.values)||void 0===i||i.forEach((function(t){var i=o.values.find((function(e){return e.id===t.id}));i?t.resultCount=i.count:e.isCustomValueFilter?t.resultCount=null:t.resultCount=0})):e.isCustomValueFilter?null===(r=e.values)||void 0===r||r.forEach((function(t){return t.resultCount=null})):null===(s=e.values)||void 0===s||s.forEach((function(t){return t.resultCount=0}))}));var r=null==t?void 0:t.find((function(t){return"category"===t.id}));r&&(null===(i=this._filterCategories)||void 0===i||i.forEach((function(t){var e=r.values.find((function(e){return e.id===t.id}));t.resultCount=e?e.count:0})))},S.prototype.setQueryParams=function(){var t;!this.isBrowser()||this.isSearch||_.getIsEditor()||null===(t=this.router)||void 0===t||t.replace("".concat(location.pathname).concat(this.queryParams?"?"+this.queryParams:""),void 0,{shallow:!0})},S.prototype.clearFilters=function(){var t,e;null===(t=this.filters)||void 0===t||t.forEach((function(t){return t.clear()})),this._searchKeyword="",this._pageType!==o.CATEGORY&&(this._filterCategoryId=void 0),null===(e=this._filterCategories)||void 0===e||e.forEach((function(t){return t.isSelected=!1})),this.applyFilters()},S.prototype.setSortType=function(i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this._sort=i,[4,this.getInitial()];case 1:return t.sent()&&this.setQueryParams(),[2]}}))}))},S.prototype.onFilterCategoryClick=function(i,r){var s,o;return void 0===r&&(r=!1),t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return r?(null===(s=this._filterCategories)||void 0===s||s.forEach((function(t){t.id===i.id&&(t.isSelected=!t.isSelected)})),[4,this.applyFilters()]):[3,2];case 1:return t.sent(),[3,3];case 2:_.getIsEditor()||null===(o=I.getInstance().router)||void 0===o||o.push(i.href+(this.queryParams?"?"+this.queryParams:"")),t.label=3;case 3:return[2]}}))}))},S.prototype.toJSON=function(){return{data:this.data,type:this._type,pageType:this._pageType,sort:this._sort,limit:this._limit,page:this._page,count:this._count,searchKeyword:this._searchKeyword,initialized:this._initialized,minPage:this._minPage,filterBrandId:this._filterBrandId,filterCategoryId:this._filterCategoryId,filterCategories:this._filterCategories,filters:this.filters,recommendFor:this._recommendFor,productListPropValue:this._productListPropValue}},S.prototype.restoreInfiniteScrollPage=function(){var t=this.getQueryParams(),e=null==t?void 0:t.get("page");if(e){var i=parseInt(e);isNaN(i)||(this._page=i,this._infiniteScrollPage=i)}},S.prototype.getQueryParams=function(){if(this.isBrowser())return new URLSearchParams(location.search)},S.prototype.isBrowser=function(){return"undefined"!=typeof window},S.prototype.waitForCustomerStoreInit=function(){return new Promise((function(t){var e=setInterval((function(){I.getInstance().customerStore.initialized&&(clearInterval(e),t(null))}),1e3)}))},S.prototype.handleListingEvent=function(){this.searchKeyword&&this.data.length?v.viewSearchResults(this._searchKeyword,this.data):this.data.length&&this._type===C.ALL&&v.viewListing(this.data)},S}();!function(t){t.ALL="ALL",t.STATIC="STATIC",t.DISCOUNTED="DISCOUNTED",t.RECOMMENDED="RECOMMENDED",t.CATEGORY="CATEGORY",t.SEARCH="SEARCH",t.LAST_VIEWED="LAST_VIEWED",t.RELATED_PRODUCTS="RELATED_PRODUCTS",t.VIEWED_TOGETHER="VIEWED_TOGETHER",t.RECOMMENDED_PRODUCTS="RECOMMENDED_PRODUCTS"}(C||(C={})),function(t){t.INCREASING_PRICE="INCREASING_PRICE",t.DECREASING_PRICE="DECREASING_PRICE",t.LAST_ADDED="LAST_ADDED",t.FIRST_ADDED="FIRST_ADDED",t.INCREASING_DISCOUNT="INCREASING_DISCOUNT",t.DECRASING_DISCOUNT="DECRASING_DISCOUNT",t.FEATURED="FEATURED",t.DEFAULT="DEFAULT",t.AVERAGE_RATING="AVERAGE_RATING",t.REVIEW_COUNT="REVIEW_COUNT",t.SALE_COUNT="SALE_COUNT",t.A_Z="A_Z",t.Z_A="Z_A"}(P||(P={})),function(t){t.AVERAGE_RATING="AVERAGE_RATING",t.CREATED_AT="CREATED_AT",t.DISCOUNT_RATIO="DISCOUNT_RATIO",t.MANUAL_SORT="MANUAL_SORT",t.NAME="NAME",t.PRICE="PRICE",t.REVIEW_COUNT="REVIEW_COUNT",t.SALE_COUNT="SALE_COUNT"}(T||(T={})),function(t){t.CATEGORY="CATEGORY",t.BRAND="BRAND"}(A||(A={}));var b=((S={})[P.INCREASING_PRICE]=1,S[P.DECREASING_PRICE]=2,S[P.LAST_ADDED]=3,S[P.FIRST_ADDED]=4,S[P.INCREASING_DISCOUNT]=5,S[P.DECRASING_DISCOUNT]=6,S[P.FEATURED]=7,S[P.DEFAULT]=8,S[P.AVERAGE_RATING]=9,S[P.REVIEW_COUNT]=10,S[P.SALE_COUNT]=11,S[P.A_Z]=12,S[P.Z_A]=13,S);export{D as IkasProductList,T as IkasProductListSortByTypeEnum,P as IkasProductListSortType,C as IkasProductListType,A as IkasRelatedProductsType};
@@ -1 +1 @@
1
- import{__rest as o,__awaiter as e,__generator as t,__assign as r}from'./../ext/tslib/tslib.es6.js';import*as s from"react";import{observer as i}from"mobx-react-lite";import d from"../components/checkout/index.js";import{useRouter as n}from"next/router.js";import{FullscreenLoading as a}from"../components/checkout/components/fullscreen-loading/index.js";import{CheckoutStep as m}from"../components/checkout/model.js";import{setAPIClientConfig as l,getCartById as c,CampaignOfferTargetPageTypeEnum as p}from"@ikas/storefront-api";import{IkasStorefrontConfig as u}from"@ikas/storefront-config";import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";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{IkasCart as j}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import{IkasCheckout as f}from"../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{LocalizedAddressConfig as g}from"@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"./home.js";import"./_slug_/index.js";import"./pages/_slug_.js";import"./account/index.js";import"./account/addresses.js";import"./account/orders/index.js";import"./account/orders/_id_.js";import"./account/login.js";import"./account/register.js";import"./account/forgot-password.js";import"./account/recover-password.js";import"./cart.js";import"./editor.js";import"./account/favorite-products.js";import"./search.js";import"next/error.js";import"./blog/index.js";import"./blog/_slug_.js";import"./raffle/_slug_.js";import"./raffle/index.js";import"./account/raffles.js";import"./account/activate.js";import{IkasBaseStore as x}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";import{initIkasEvents as y}from"../analytics/events.js";import{APIErrorCode as v}from'./../ext/@ikas/fe-api-client/build/utils/api.js';import'./../ext/axios/index.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import h from"../store/checkout/index.js";var b=i((function(i){var b=i.customizationProps,C=i.configJson,E=o(i,["customizationProps","configJson"]),k=n(),F=s.useState(),P=F[0],w=F[1],_=s.useState(E.checkoutSettings),B=_[0],T=_[1];u.init(C),g.setCDNUrl(process.env.NEXT_PUBLIC_SETTINGS_CDN_URL),l(),s.useEffect((function(){!function(o){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==o?void 0:o.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==o?void 0:o.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==o?void 0:o.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==o?void 0:o.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==o?void 0:o.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==o?void 0:o.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==o?void 0:o.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==o?void 0:o.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==o?void 0:o.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==o?void 0:o.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==o?void 0:o.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==o?void 0:o.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==o?void 0:o.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==o?void 0:o.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==o?void 0:o.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==o?void 0:o.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==o?void 0:o.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==o?void 0:o.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==o?void 0:o.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==o?void 0:o.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==o?void 0:o.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==o?void 0:o.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==o?void 0:o.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==o?void 0:o.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==o?void 0:o.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==o?void 0:o.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==o?void 0:o.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==o?void 0:o.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(b)}),[b]),s.useEffect((function(){x.getInstance().checkLocalization(),S(),y()}),[]);var S=s.useCallback((function(){return e(void 0,void 0,void 0,(function(){var o,e,r,s,i,d,n,a,l,u,g,y,b,C,E,F,P;return t(this,(function(t){switch(t.label){case 0:if(o=new URLSearchParams(window.location.search),e=o.get("id"),r=o.get("step"),s=o.get("lines"),i=o.get("couponCode"),!s)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),(d=x.getInstance().cartStore).removeCart(),n=s.split(","),a=n.map((function(o){var e=o.split(":"),t=e[0],r=e[1];return{variantId:t,quantity:parseInt(r)}})),l={variantLines:a,couponCode:i||void 0},[4,d.createCart(l)];case 2:return(u=t.sent()).success&&(window.location.href="/checkout?id=".concat(null===(F=u.response.data)||void 0===F?void 0:F.id,"&step=info")),[3,4];case 3:return g=t.sent(),console.error("Error creating cart:",g),[3,4];case 4:return[2];case 5:return e?(y=!1,r&&r===m.SUCCESS&&(y=!0),[4,c({id:e,getCompletedCart:y,targetPageType:p.CHECKOUT})]):[2,k.replace("/")];case 6:return b=t.sent(),B?[3,8]:[4,h.listCheckoutSettings({})];case 7:(C=t.sent()).isSuccess&&(null===(P=C.data)||void 0===P?void 0:P.length)?T(C.data[0]):(console.error("CHECKOUT SETTINGS FETCH FAILED!"),console.error(C),console.error(C.graphQLErrors),console.error(C.errorCodes)),t.label=8;case 8:return b.isSuccess&&b.data?(E=b.data,w(new f(E)),x.getInstance().cartStore.setCart(new j(E))):b.errorCodes.some((function(o){return o===v.LOGIN_REQUIRED}))?k.replace("/account/login?redirect="+encodeURIComponent(window.location.href)):k.replace("/"),[2]}}))}))}),[]);return P&&B?s.createElement(d,r({checkout:P,customizationProps:b},E,{checkoutSettings:B})):s.createElement(a,null)}));export{b as default};
1
+ import{__rest as o,__awaiter as e,__generator as t,__assign as r}from'./../ext/tslib/tslib.es6.js';import*as s from"react";import{observer as i}from"mobx-react-lite";import d from"../components/checkout/index.js";import{useRouter as n}from"next/router.js";import{FullscreenLoading as a}from"../components/checkout/components/fullscreen-loading/index.js";import{CheckoutStep as m}from"../components/checkout/model.js";import{setAPIClientConfig as l,getCartById as c,CampaignOfferTargetPageTypeEnum as p}from"@ikas/storefront-api";import{IkasStorefrontConfig as u}from"@ikas/storefront-config";import"../analytics/analytics.js";import"../analytics/head/index.js";import"../components/page/index.js";import"../components/page/head.js";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{IkasCart as j}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import"../models/data/category/index.js";import{IkasCheckout as f}from"../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{LocalizedAddressConfig as g}from"@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"./home.js";import"./_slug_/index.js";import"./pages/_slug_.js";import"./account/index.js";import"./account/addresses.js";import"./account/orders/index.js";import"./account/orders/_id_.js";import"./account/login.js";import"./account/register.js";import"./account/forgot-password.js";import"./account/recover-password.js";import"./cart.js";import"./editor.js";import"./account/favorite-products.js";import"./search.js";import"next/error.js";import"./blog/index.js";import"./blog/_slug_.js";import"./raffle/_slug_.js";import"./raffle/index.js";import"./account/raffles.js";import"./account/activate.js";import{IkasBaseStore as x}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import"lodash/get";import{initIkasEvents as y}from"../analytics/events.js";import{APIErrorCode as v}from'./../ext/@ikas/fe-api-client/build/utils/api.js';import'./../ext/axios/index.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import h from"../store/checkout/index.js";var b=i((function(i){var b=i.customizationProps,C=i.configJson,E=o(i,["customizationProps","configJson"]),k=n(),F=s.useState(),P=F[0],w=F[1],_=s.useState(E.checkoutSettings),B=_[0],T=_[1];u.init(C),g.setCDNUrl(process.env.NEXT_PUBLIC_SETTINGS_CDN_URL),l(),s.useEffect((function(){!function(o){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==o?void 0:o.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==o?void 0:o.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==o?void 0:o.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==o?void 0:o.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==o?void 0:o.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==o?void 0:o.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==o?void 0:o.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==o?void 0:o.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==o?void 0:o.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==o?void 0:o.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==o?void 0:o.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==o?void 0:o.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==o?void 0:o.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==o?void 0:o.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==o?void 0:o.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==o?void 0:o.successLightColor)||"#F6FFED"),document.documentElement.style.setProperty("--checkout-secondary-button-bg-color",(null==o?void 0:o.secondaryButtonBgColor)||"#ffffff0"),document.documentElement.style.setProperty("--checkout-secondary-button-text-color",(null==o?void 0:o.secondaryButtonTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-button-border-color",(null==o?void 0:o.secondaryButtonBorderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-campaign-title-color",(null==o?void 0:o.campaignOffersTitleColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-description-color",(null==o?void 0:o.campaignOffersDescriptionColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-container-bg-color",(null==o?void 0:o.campaignOffersContainerBgColor)||"#ffffff"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-color",(null==o?void 0:o.campaignOffersDiscountPercentageColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-discount-percentage-bg-color",(null==o?void 0:o.campaignOffersDiscountPercentageBgColor)||"#FFF1BD"),document.documentElement.style.setProperty("--checkout-campaign-countdown-text-color",(null==o?void 0:o.campaignOffersCountdownTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-campaign-countdown-time-color",(null==o?void 0:o.campaignOffersCountdownTimeColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-campaign-countdown-bg-color",(null==o?void 0:o.campaignOffersCountdownBgColor)||"#FFF5F6"),document.documentElement.style.setProperty("--checkout-campaign-middle-phase-overlay-color",(null==o?void 0:o.campaignOffersMiddlePhaseOverlayColor)||"#292727ad")}(b)}),[b]),s.useEffect((function(){x.getInstance().checkLocalization(),S(),y()}),[]);var S=s.useCallback((function(){return e(void 0,void 0,void 0,(function(){var o,e,r,s,i,d,n,a,l,u,g,y,b,C,E,F,P;return t(this,(function(t){switch(t.label){case 0:if(o=new URLSearchParams(window.location.search),e=o.get("id"),r=o.get("step"),s=o.get("lines"),i=o.get("couponCode"),!s)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),(d=x.getInstance().cartStore).removeCart(),n=s.split(","),a=n.map((function(o){var e=o.split(":"),t=e[0],r=e[1];return{variantId:t,quantity:parseInt(r)}})),l={variantLines:a,couponCode:i||void 0},[4,d.createCart(l)];case 2:return(u=t.sent()).success&&(window.location.href="/checkout?id=".concat(null===(F=u.response.data)||void 0===F?void 0:F.id,"&step=info")),[3,4];case 3:return g=t.sent(),console.error("Error creating cart:",g),[3,4];case 4:return[2];case 5:return e?(y=!1,r&&r===m.SUCCESS&&(y=!0),[4,c({id:e,getCompletedCart:y,targetPageType:p.CHECKOUT})]):[2,k.replace("/")];case 6:return b=t.sent(),B?[3,8]:[4,h.listCheckoutSettings({})];case 7:(C=t.sent()).isSuccess&&(null===(P=C.data)||void 0===P?void 0:P.length)?T(C.data[0]):(console.error("CHECKOUT SETTINGS FETCH FAILED!"),console.error(C),console.error(C.graphQLErrors),console.error(C.errorCodes)),t.label=8;case 8:return b.isSuccess&&b.data?(E=b.data,w(new f(E)),x.getInstance().cartStore.setCart(new j(E))):b.errorCodes.some((function(o){return o===v.LOGIN_REQUIRED}))?k.replace("/account/login?redirect="+encodeURIComponent(window.location.href)):k.replace("/"),[2]}}))}))}),[]);return P&&B?s.createElement(d,r({checkout:P,customizationProps:b},E,{checkoutSettings:B})):s.createElement(a,null)}));export{b as default};
@@ -1,5 +1,5 @@
1
1
  import { APIResponse } from "@ikas/fe-api-client";
2
- import { CheckStocksQueryParams, CreateKlarnaClientTokenParams, CreateSaleTransactionQueryParams, CreateStripePaymentIntentParams, GetAvailableShippingCountriesQueryParams, GetAvailableStockLocationQueryParams, ListCheckoutSettingsQueryParams, ListPaymentGatewayQueryParams, ListProductFileQueryParams, ListStockLocationQueryParams, RetrieveInstallmentInfoQueryParams, GetPayPalClientIdTokenParams, CreatePayPalOrderParams, GetDigitalProductFileDownloadUrlQueryParams, CheckCartStocksQueryParams, CreateAdyenBalancePlatformPaymentParams } from "@ikas/storefront-api";
2
+ import { CheckStocksQueryParams, CreateKlarnaClientTokenParams, CreateSaleTransactionQueryParams, CreateStripePaymentIntentParams, GetAvailableShippingCountriesQueryParams, GetAvailableStockLocationQueryParams, ListCheckoutSettingsQueryParams, ListPaymentGatewayQueryParams, ListProductFileQueryParams, ListStockLocationQueryParams, RetrieveInstallmentInfoQueryParams, GetPayPalClientIdTokenParams, CreatePayPalOrderParams, GetDigitalProductFileDownloadUrlQueryParams, CheckCartStocksQueryParams, CreateAdyenBalancePlatformPaymentParams, UpdatePayPalOrderParams } from "@ikas/storefront-api";
3
3
  import { IkasAvailableStockLocation, IkasCheckoutSettings, IkasPaymentGateway, IkasStockLocation, IkasProductFile } from "../../models/data";
4
4
  export default class CheckoutStore {
5
5
  static createSaleTransactionWithCart(params: CreateSaleTransactionQueryParams): Promise<APIResponse<import("@ikas/storefront-api").TransactionResponse> | APIResponse<undefined>>;
@@ -18,4 +18,5 @@ export default class CheckoutStore {
18
18
  static createAdyenBalancePlatformPaymentSession(params: CreateAdyenBalancePlatformPaymentParams): Promise<APIResponse<import("@ikas/storefront-api").CreateAdyenPlatformSessionResponse>>;
19
19
  static getPayPalClientId(params: GetPayPalClientIdTokenParams): Promise<APIResponse<import("@ikas/storefront-api").GetPaypalClientIdResponse>>;
20
20
  static createPayPalOrder(params: CreatePayPalOrderParams): Promise<APIResponse<import("@ikas/storefront-api").CreatePaypalOrderResponse>>;
21
+ static updatePaypalOrder(params: UpdatePayPalOrderParams): Promise<APIResponse<boolean>>;
21
22
  }
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as r}from'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{createSaleTransactionWithCart as o,listPaymentGateway as i,listProductFile as n,getDigitalProductFileDownloadUrl as a,retrieveInstallmentInfo as s,checkStocks as d,checkCartStocks as m,listCheckoutSettings as u,getAvailableShippingCountries as l,listStockLocations as c,getAvailableStockLocations as p,createStripePaymentIntent as f,createKlarnaClientToken as h,createAdyenBalancePlatformPaymentSession as v,getPayPalClientId as j,createPayPalOrder as x}from"@ikas/storefront-api";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{IkasCheckoutSettings as g}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"../../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{IkasPaymentGateway as w}from"../../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{IkasProductFile as b}from"../../models/data/product-file/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{IkasAvailableStockLocation as k}from"../../models/data/stock-location/available/index.js";import{IkasStockLocation as y}from"../../models/data/stock-location/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";var L=function(){function L(){}return L.createSaleTransactionWithCart=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,o(r)];case 1:return[2,t.sent()]}}))}))},L.listPaymentGateway=function(o){var n;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new r(null===(n=t.data)||void 0===n?void 0:n.map((function(t){return new w(t)})),t.graphQLErrors)]}}))}))},L.listProductFile=function(o){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n(o)];case 1:return t=e.sent(),[2,new r(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new b(t)})),t.graphQLErrors)]}}))}))},L.getDigitalProductFileDownloadUrl=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,a(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},L.retrieveInstallmentInfo=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,s(r)];case 1:return[2,t.sent()]}}))}))},L.checkStocks=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,d(r)];case 1:return[2,t.sent()]}}))}))},L.checkCartStocks=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,m(r)];case 1:return[2,t.sent()]}}))}))},L.listCheckoutSettings=function(o){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,u(o)];case 1:return t=e.sent(),[2,new r(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new g(t)})),t.graphQLErrors)]}}))}))},L.getAvailableShippingCountries=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,l(r)];case 1:return[2,t.sent()]}}))}))},L.listStockLocation=function(o){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,c(o)];case 1:return t=e.sent(),[2,new r(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new y(t)})),t.graphQLErrors)]}}))}))},L.getAvailableStockLocations=function(o){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p(o)];case 1:return t=e.sent(),[2,new r(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new k(t)})),t.graphQLErrors)]}}))}))},L.createStripePaymentIntent=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},L.createKlarnaClientToken=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,h(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},L.createAdyenBalancePlatformPaymentSession=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},L.getPayPalClientId=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,j(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},L.createPayPalOrder=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,x(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},L}();export{L as default};
1
+ import{__awaiter as t,__generator as e}from'./../../ext/tslib/tslib.es6.js';import{APIResponse as r}from'./../../ext/@ikas/fe-api-client/build/utils/api.js';import'./../../ext/axios/index.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'./../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import{createSaleTransactionWithCart as o,listPaymentGateway as i,listProductFile as n,getDigitalProductFileDownloadUrl as a,retrieveInstallmentInfo as s,checkStocks as d,checkCartStocks as u,listCheckoutSettings as m,getAvailableShippingCountries as c,listStockLocations as l,getAvailableStockLocations as p,createStripePaymentIntent as f,createKlarnaClientToken as h,createAdyenBalancePlatformPaymentSession as v,getPayPalClientId as j,createPayPalOrder as x,updatePaypalOrder as g}from"@ikas/storefront-api";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{IkasCheckoutSettings as w}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"../../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{IkasPaymentGateway as b}from"../../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{IkasProductFile as k}from"../../models/data/product-file/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{IkasAvailableStockLocation as y}from"../../models/data/stock-location/available/index.js";import{IkasStockLocation as L}from"../../models/data/stock-location/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";var P=function(){function P(){}return P.createSaleTransactionWithCart=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,o(r)];case 1:return[2,t.sent()]}}))}))},P.listPaymentGateway=function(o){var n;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,i(o)];case 1:return t=e.sent(),[2,new r(null===(n=t.data)||void 0===n?void 0:n.map((function(t){return new b(t)})),t.graphQLErrors)]}}))}))},P.listProductFile=function(o){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,n(o)];case 1:return t=e.sent(),[2,new r(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new k(t)})),t.graphQLErrors)]}}))}))},P.getDigitalProductFileDownloadUrl=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,a(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},P.retrieveInstallmentInfo=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,s(r)];case 1:return[2,t.sent()]}}))}))},P.checkStocks=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,d(r)];case 1:return[2,t.sent()]}}))}))},P.checkCartStocks=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,u(r)];case 1:return[2,t.sent()]}}))}))},P.listCheckoutSettings=function(o){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,m(o)];case 1:return t=e.sent(),[2,new r(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new w(t)})),t.graphQLErrors)]}}))}))},P.getAvailableShippingCountries=function(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,c(r)];case 1:return[2,t.sent()]}}))}))},P.listStockLocation=function(o){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,l(o)];case 1:return t=e.sent(),[2,new r(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new L(t)})),t.graphQLErrors)]}}))}))},P.getAvailableStockLocations=function(o){var i;return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,p(o)];case 1:return t=e.sent(),[2,new r(null===(i=t.data)||void 0===i?void 0:i.map((function(t){return new y(t)})),t.graphQLErrors)]}}))}))},P.createStripePaymentIntent=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},P.createKlarnaClientToken=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,h(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},P.createAdyenBalancePlatformPaymentSession=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,v(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},P.getPayPalClientId=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,j(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},P.createPayPalOrder=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,x(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},P.updatePaypalOrder=function(o){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,g(o)];case 1:return t=e.sent(),[2,new r(t.data,t.graphQLErrors)]}}))}))},P}();export{P as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "6.1.0-beta.56",
3
+ "version": "6.1.0-beta.58",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -21,11 +21,11 @@
21
21
  "swiper": "11.0.6"
22
22
  },
23
23
  "devDependencies": {
24
- "@ikas/storefront-api": "^6.1.0-beta.56",
25
- "@ikas/storefront-config": "^6.1.0-beta.56",
26
- "@ikas/storefront-model-functions": "^6.1.0-beta.56",
27
- "@ikas/storefront-models": "^6.1.0-beta.56",
28
- "@ikas/storefront-providers": "^6.1.0-beta.56",
24
+ "@ikas/storefront-api": "^6.1.0-beta.58",
25
+ "@ikas/storefront-config": "^6.1.0-beta.58",
26
+ "@ikas/storefront-model-functions": "^6.1.0-beta.58",
27
+ "@ikas/storefront-models": "^6.1.0-beta.58",
28
+ "@ikas/storefront-providers": "^6.1.0-beta.58",
29
29
  "@ikas/localized-address": "1.0.0-beta.6",
30
30
  "@adyen/adyen-web": "^5.57.0",
31
31
  "@rollup/plugin-commonjs": "^22.0.0",
@@ -60,11 +60,11 @@
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@ikas/localized-address": "1.0.0-beta.6",
63
- "@ikas/storefront-api": "^6.1.0-beta.56",
64
- "@ikas/storefront-config": "^6.1.0-beta.56",
65
- "@ikas/storefront-model-functions": "^6.1.0-beta.56",
66
- "@ikas/storefront-models": "^6.1.0-beta.56",
67
- "@ikas/storefront-providers": "^6.1.0-beta.56",
63
+ "@ikas/storefront-api": "^6.1.0-beta.58",
64
+ "@ikas/storefront-config": "^6.1.0-beta.58",
65
+ "@ikas/storefront-model-functions": "^6.1.0-beta.58",
66
+ "@ikas/storefront-models": "^6.1.0-beta.58",
67
+ "@ikas/storefront-providers": "^6.1.0-beta.58",
68
68
  "mobx": "^6.1.3",
69
69
  "mobx-react-lite": "^3.1.5",
70
70
  "next": "12.2.0",