@ikas/storefront 6.1.0-beta.292 → 6.1.0-beta.293

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{__awaiter as t,__generator as e,__assign as r}from'./../ext/tslib/tslib.es6.js';import{makeAutoObservable as o}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{IkasBrand as s}from"../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{IkasCart as i}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import{IkasCategory as a}from"../models/data/category/index.js";import{IkasCheckout as n}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{IkasProduct as c}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{IkasStorefrontPopup as d}from"../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{FacebookPixel as m}from"./facebookPixel.js";import{GoogleTagManager as u}from"./googleTagManager.js";import{IkasEventType as l}from"./events.js";import p from"lodash/cloneDeep";import{tryForEach as b}from"../utils/helper.js";import f from"./ikasV3.js";import{GoogleAnalytics as h}from"./googleAnalytics.js";import{TiktokPixel as g}from"./tiktokPixel.js";import{IkasBaseStore as j}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";var v=function(){function v(){o(this)}return v.getCustomerInfo=function(){return t(this,void 0,void 0,(function(){var t,o;return e(this,(function(e){switch(e.label){case 0:return[4,(t=j.getInstance()).customerStore.waitUntilInitialized()];case 1:return e.sent(),(o=t.customerStore.customer)?[2,r(r({},o.basicInfo),{consentGranted:t.customerStore.customerConsentGranted})]:[2,null]}}))}))},v.pageView=function(r){return t(this,void 0,void 0,(function(){var t,o,s,i;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),[4,f.checkJourneyId()];case 1:return e.sent(),t=window.location.href,[4,v.getCustomerInfo()];case 2:return o=e.sent(),s=Date.now().toString(),u.pageView(t),m.pageView(t,s),[4,f.pageView(r,s)];case 3:return e.sent(),g.pageView(t),b(v.subscribers,(function(e){e.callback({type:l.PAGE_VIEW,data:{url:t,pageType:r,customer:o}})})),[3,5];case 4:return i=e.sent(),console.error(i),[3,5];case 5:return[2]}}))}))},v.productView=function(r){return t(this,void 0,void 0,(function(){var t,o,s;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=Date.now().toString(),m.productView(r,t),u.productView(r),[4,f.productView(r,t)];case 1:return e.sent(),h.productView(r),g.productView(r),v.subscribers.length&&(o=new c(p(r)),b(v.subscribers,(function(t){t.callback({type:l.PRODUCT_VIEW,data:{productDetail:o}})}))),[3,3];case 2:return s=e.sent(),console.error(s),[3,3];case 3:return[2]}}))}))},v.addToCart=function(t,e,r,o,s){try{if(m.addToCart(t,e,r),u.addToCart(t,e,s),f.addToCart(t,e,o,r),h.addToCart(t,e),g.addToCart(t,e),v.subscribers.length){var a=p(t),n=new i(p(o));b(v.subscribers,(function(t){t.callback({type:l.ADD_TO_CART,data:{item:a,quantity:e,cart:n}})}))}}catch(t){console.error(t)}},v.removeFromCart=function(t,e,r){try{if(u.removeFromCart(t,e),h.removeFromCart(t,e),v.subscribers.length){var o=p(t),s=new i(p(r));b(v.subscribers,(function(t){t.callback({type:l.REMOVE_FROM_CART,data:{item:o,quantity:e,cart:s}})}))}}catch(t){console.error(t)}},v.beginCheckout=function(t){try{var e=localStorage.getItem("gtmBeginCheckout");if(e&&t.id===e)return;localStorage.setItem("gtmBeginCheckout",t.id);var r=Date.now().toString();if(m.beginCheckout(t,r),u.beginCheckout(t),f.beginCheckout(t,r),h.beginCheckout(t),g.beginCheckout(t),v.subscribers.length){var o=new n(p(t));b(v.subscribers,(function(t){t.callback({type:l.BEGIN_CHECKOUT,data:{checkout:o}})}))}}catch(t){console.error(t)}},v.purchase=function(t,e){try{if(localStorage.removeItem("gtmBeginCheckout"),m.purchase(t,e.id||""),u.purchase(t,t.orderNumber||""),f.orderSuccess(t,e.id||""),h.purchase(t,t.orderNumber||""),g.purchase(t),v.subscribers.length){var r=new n(p(t)),o=p(e);b(v.subscribers,(function(t){t.callback({type:l.COMPLETE_CHECKOUT,data:{checkout:r,transaction:o}})}))}}catch(t){console.error(t)}},v.checkoutStep=function(t,e,r){try{var o=Date.now().toString();if(u.checkoutStep(t,e,r),f.checkoutStep(t,e),h.checkoutStep(t,e,r),m.checkoutStep(t,e,o),v.subscribers.length){var s=new n(p(t));b(v.subscribers,(function(t){t.callback({type:l.CHECKOUT_STEP,data:{checkout:s,step:e}})}))}}catch(t){console.error(t)}},v.disableHTML=function(){try{u.disableHTML()}catch(t){console.error(t)}},v.addToWishlist=function(t,e){try{var r=Date.now().toString();m.addToWishlist(t,r),g.addToWishlist(t),f.addToWishlist(t,r),h.addToWishlist(t),v.subscribers.length&&b(v.subscribers,(function(r){r.callback({type:e?l.REMOVE_FROM_WISHLIST:l.ADD_TO_WISHLIST,data:{productId:t}})}))}catch(t){console.error(t)}},v.search=function(t,e){try{var r=Date.now().toString();m.search(t,r),u.search(t),g.search(t),h.search(t),f.search(t,r,e),v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:l.SEARCH,data:{searchKeyword:t}})}))}catch(t){console.error(t)}},v.completeRegistration=function(t,e){try{var o=Date.now().toString();e||(m.completeRegistration(o),u.completeRegistration(t),g.completeRegistration()),f.customerRegister(o),v.subscribers.length&&b(v.subscribers,(function(o){o.callback({type:l.CUSTOMER_REGISTER,data:r({email:t.email,firstName:t.firstName,lastName:t.lastName,notificationsAccepted:t.subscriptionStatus},e?{attributes:t.attributes}:{})})}))}catch(t){console.error(t)}},v.createEmailSubscripition=function(t){try{v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:l.EMAIL_SUBSCRIPTION,data:{email:t}})}))}catch(t){console.error(t)}},v.customerLogin=function(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,v.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(u.customerLogin(t),[4,f.customerLogin()]):[2];case 2:return e.sent(),v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:l.CUSTOMER_LOGIN,data:{customer:t}})})),[3,4];case 3:return r=e.sent(),console.error(r),[3,4];case 4:return[2]}}))}))},v.customerLogout=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){try{u.customerLogout(),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:l.CUSTOMER_LOGOUT,data:{}})}))}catch(t){console.error(t)}return[2]}))}))},v.customerVisit=function(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,v.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(u.customerVisit(t),[4,f.customerVisit()]):[2];case 2:return e.sent(),v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:l.CUSTOMER_VISIT,data:{customer:t}})})),[3,4];case 3:return r=e.sent(),console.error(r),[3,4];case 4:return[2]}}))}))},v.viewCart=function(t){try{if(t){var e=Date.now().toString();if(m.viewCart(t,e),f.viewCart(t,e),h.viewCart(t),u.viewCart(t),v.subscribers.length){var r=new i(p(t));b(v.subscribers,(function(t){t.callback({type:l.VIEW_CART,data:{cart:r}})}))}}}catch(t){console.error(t)}},v.viewCategory=function(t,e){try{var r=Date.now().toString();if(m.viewCategory(t,r),u.viewCategory(e,t),f.viewCategory(e,t,r),g.viewCategory(e),v.subscribers.length){var o=new a(p(e));b(v.subscribers,(function(e){e.callback({type:l.VIEW_CATEGORY,data:{categoryPath:t,category:o}})}))}}catch(t){console.error(t)}},v.viewBrand=function(t){try{if(f.viewBrand(t),v.subscribers.length){var e=new s(p(t));b(v.subscribers,(function(t){t.callback({type:l.VIEW_BRAND,data:{brand:e}})}))}}catch(t){console.error(t)}},v.viewStorefrontPopup=function(t){try{if(f.viewPopup(t.id),v.subscribers.length){var e=new d(p(t));b(v.subscribers,(function(t){t.callback({type:l.POPUP_VIEW,data:{popup:e}})}))}}catch(t){console.error(t)}},v.viewSearchResults=function(t,e){try{if(v.subscribers.length){var r=p(e).map((function(t){return new c(t)}));b(v.subscribers,(function(e){e.callback({type:l.VIEW_SEARCH_RESULTS,data:{searchKeyword:t,productDetails:r}})}))}}catch(t){console.error(t)}},v.viewListing=function(t){try{if(v.subscribers.length){var e=p(t).map((function(t){return new c(t)}));b(v.subscribers,(function(t){t.callback({type:l.VIEW_LISTING,data:{productDetails:e}})}))}}catch(t){console.error(t)}},v.contactForm=function(t){try{var e=Date.now().toString();if(m.contactForm(e),g.contactForm(),f.contactForm(e),v.subscribers.length){var r=p(t);b(v.subscribers,(function(t){t.callback({type:l.CONTACT_FORM,data:{form:r}})}))}}catch(t){console.error(t)}},v.addCouponCode=function(t){try{if(t&&v.subscribers.length){var e=new i(p(t));b(v.subscribers,(function(t){t.callback({type:l.ADD_COUPON_CODE,data:{cart:e}})}))}}catch(t){console.error(t)}},v.removeCouponCode=function(t){try{if(t&&v.subscribers.length){var e=new i(p(t));b(v.subscribers,(function(t){t.callback({type:l.REMOVE_COUPON_CODE,data:{cart:e}})}))}}catch(t){console.error(t)}},v.removeLoyaltyPoints=function(t){try{if(t&&v.subscribers.length){var e=new i(p(t));b(v.subscribers,(function(t){t.callback({type:l.REMOVE_LOYALTY_POINTS,data:{cart:e}})}))}}catch(t){console.error(t)}},v.subscribers=[],v}();export{v as Analytics};
1
+ import{__awaiter as t,__generator as e,__assign as r}from'./../ext/tslib/tslib.es6.js';import{makeAutoObservable as o}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{IkasBrand as i}from"../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{IkasCart as s}from"../models/data/cart/index.js";import"../models/data/category/path-item/index.js";import{IkasCategory as a}from"../models/data/category/index.js";import{IkasCheckout as n}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{IkasProduct as d}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{IkasStorefrontPopup as c}from"../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{FacebookPixel as l}from"./facebookPixel.js";import{GoogleTagManager as u}from"./googleTagManager.js";import{IkasEventType as m}from"./events.js";import p from"lodash/cloneDeep";import{tryForEach as v}from"../utils/helper.js";import f from"./ikasV3.js";import{GoogleAnalytics as b}from"./googleAnalytics.js";import{TiktokPixel as h}from"./tiktokPixel.js";import{IkasBaseStore as g}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";var j=function(){function j(){o(this)}return j.getCustomerInfo=function(){return t(this,void 0,void 0,(function(){var t,o;return e(this,(function(e){switch(e.label){case 0:return[4,(t=g.getInstance()).customerStore.waitUntilInitialized()];case 1:return e.sent(),(o=t.customerStore.customer)?[2,r(r({},o.basicInfo),{consentGranted:t.customerStore.customerConsentGranted})]:[2,null]}}))}))},j.pageView=function(r){return t(this,void 0,void 0,(function(){var t,o,i,s;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),[4,f.checkJourneyId()];case 1:return e.sent(),t=window.location.href,[4,j.getCustomerInfo()];case 2:return o=e.sent(),i=Date.now().toString(),u.pageView(t),l.pageView(t,i),[4,f.pageView(r,i)];case 3:return e.sent(),h.pageView(t),v(j.subscribers,(function(e){e.callback({type:m.PAGE_VIEW,data:{url:t,pageType:r,customer:o}})})),[3,5];case 4:return s=e.sent(),console.error(s),[3,5];case 5:return[2]}}))}))},j.productView=function(r){return t(this,void 0,void 0,(function(){var t,o,i;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=Date.now().toString(),l.productView(r,t),u.productView(r),[4,f.productView(r,t)];case 1:return e.sent(),b.productView(r),h.productView(r),j.subscribers.length&&(o=new d(p(r)),v(j.subscribers,(function(t){t.callback({type:m.PRODUCT_VIEW,data:{productDetail:o}})}))),[3,3];case 2:return i=e.sent(),console.error(i),[3,3];case 3:return[2]}}))}))},j.addToCart=function(t,e,r,o,i){try{if(l.addToCart(t,e,r),u.addToCart(t,e,i),f.addToCart(t,e,o,r),b.addToCart(t,e),h.addToCart(t,e),j.subscribers.length){var a=p(t),n=new s(p(o));v(j.subscribers,(function(t){t.callback({type:m.ADD_TO_CART,data:{item:a,quantity:e,cart:n}})}))}}catch(t){console.error(t)}},j.removeFromCart=function(t,e,r){try{if(u.removeFromCart(t,e),b.removeFromCart(t,e),j.subscribers.length){var o=p(t),i=new s(p(r));v(j.subscribers,(function(t){t.callback({type:m.REMOVE_FROM_CART,data:{item:o,quantity:e,cart:i}})}))}}catch(t){console.error(t)}},j.beginCheckout=function(t){var e,r,o,i,s,a,d,c,g,y,x;try{var w=localStorage.getItem("gtmBeginCheckout");if(w&&t.id===w)return;localStorage.setItem("gtmBeginCheckout",t.id),l.initAdvancedMatching({em:null===(e=t.customer)||void 0===e?void 0:e.email,fn:(null===(r=t.customer)||void 0===r?void 0:r.firstName)||(null===(o=t.shippingAddress)||void 0===o?void 0:o.firstName),ln:(null===(i=t.customer)||void 0===i?void 0:i.lastName)||(null===(s=t.shippingAddress)||void 0===s?void 0:s.lastName),ph:null===(a=t.shippingAddress)||void 0===a?void 0:a.phone,external_id:t.customerId,ct:null===(c=null===(d=t.shippingAddress)||void 0===d?void 0:d.city)||void 0===c?void 0:c.name,zp:null===(g=t.shippingAddress)||void 0===g?void 0:g.postalCode,country:null===(x=null===(y=t.shippingAddress)||void 0===y?void 0:y.country)||void 0===x?void 0:x.iso2});var C=Date.now().toString();if(l.beginCheckout(t,C),u.beginCheckout(t),f.beginCheckout(t,C),b.beginCheckout(t),h.beginCheckout(t),j.subscribers.length){var k=new n(p(t));v(j.subscribers,(function(t){t.callback({type:m.BEGIN_CHECKOUT,data:{checkout:k}})}))}}catch(t){console.error(t)}},j.purchase=function(t,e){var r,o,i,s,a,d,c,g,y,x,w;try{if(localStorage.removeItem("gtmBeginCheckout"),l.initAdvancedMatching({em:null===(r=t.customer)||void 0===r?void 0:r.email,fn:(null===(o=t.customer)||void 0===o?void 0:o.firstName)||(null===(i=t.shippingAddress)||void 0===i?void 0:i.firstName),ln:(null===(s=t.customer)||void 0===s?void 0:s.lastName)||(null===(a=t.shippingAddress)||void 0===a?void 0:a.lastName),ph:null===(d=t.shippingAddress)||void 0===d?void 0:d.phone,external_id:t.customerId,ct:null===(g=null===(c=t.shippingAddress)||void 0===c?void 0:c.city)||void 0===g?void 0:g.name,zp:null===(y=t.shippingAddress)||void 0===y?void 0:y.postalCode,country:null===(w=null===(x=t.shippingAddress)||void 0===x?void 0:x.country)||void 0===w?void 0:w.iso2}),l.purchase(t,e.id||""),u.purchase(t,t.orderNumber||""),f.orderSuccess(t,e.id||""),b.purchase(t,t.orderNumber||""),h.purchase(t),j.subscribers.length){var C=new n(p(t)),k=p(e);v(j.subscribers,(function(t){t.callback({type:m.COMPLETE_CHECKOUT,data:{checkout:C,transaction:k}})}))}}catch(t){console.error(t)}},j.checkoutStep=function(t,e,r){var o,i,s,a,d,c,h,g,y,x,w;try{l.initAdvancedMatching({em:null===(o=t.customer)||void 0===o?void 0:o.email,fn:(null===(i=t.customer)||void 0===i?void 0:i.firstName)||(null===(s=t.shippingAddress)||void 0===s?void 0:s.firstName),ln:(null===(a=t.customer)||void 0===a?void 0:a.lastName)||(null===(d=t.shippingAddress)||void 0===d?void 0:d.lastName),ph:null===(c=t.shippingAddress)||void 0===c?void 0:c.phone,external_id:t.customerId,ct:null===(g=null===(h=t.shippingAddress)||void 0===h?void 0:h.city)||void 0===g?void 0:g.name,zp:null===(y=t.shippingAddress)||void 0===y?void 0:y.postalCode,country:null===(w=null===(x=t.shippingAddress)||void 0===x?void 0:x.country)||void 0===w?void 0:w.iso2});var C=Date.now().toString();if(u.checkoutStep(t,e,r),f.checkoutStep(t,e),b.checkoutStep(t,e,r),l.checkoutStep(t,e,C),j.subscribers.length){var k=new n(p(t));v(j.subscribers,(function(t){t.callback({type:m.CHECKOUT_STEP,data:{checkout:k,step:e}})}))}}catch(t){console.error(t)}},j.disableHTML=function(){try{u.disableHTML()}catch(t){console.error(t)}},j.addToWishlist=function(t,e){try{var r=Date.now().toString();l.addToWishlist(t,r),h.addToWishlist(t),f.addToWishlist(t,r),b.addToWishlist(t),j.subscribers.length&&v(j.subscribers,(function(r){r.callback({type:e?m.REMOVE_FROM_WISHLIST:m.ADD_TO_WISHLIST,data:{productId:t}})}))}catch(t){console.error(t)}},j.search=function(t,e){try{var r=Date.now().toString();l.search(t,r),u.search(t),h.search(t),b.search(t),f.search(t,r,e),j.subscribers.length&&v(j.subscribers,(function(e){e.callback({type:m.SEARCH,data:{searchKeyword:t}})}))}catch(t){console.error(t)}},j.completeRegistration=function(t,e){try{var o=Date.now().toString();l.initAdvancedMatching({em:t.email,fn:t.firstName,ln:t.lastName,ph:t.phone,external_id:t.id}),e||(l.completeRegistration(o),u.completeRegistration(t),h.completeRegistration()),f.customerRegister(o),j.subscribers.length&&v(j.subscribers,(function(o){o.callback({type:m.CUSTOMER_REGISTER,data:r({email:t.email,firstName:t.firstName,lastName:t.lastName,notificationsAccepted:t.subscriptionStatus},e?{attributes:t.attributes}:{})})}))}catch(t){console.error(t)}},j.createEmailSubscripition=function(t){try{l.initAdvancedMatching({em:t}),j.subscribers.length&&v(j.subscribers,(function(e){e.callback({type:m.EMAIL_SUBSCRIPTION,data:{email:t}})}))}catch(t){console.error(t)}},j.customerLogin=function(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,j.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(l.initAdvancedMatching({em:t.email,fn:t.firstName,ln:t.lastName,ph:t.phone,external_id:t.id}),u.customerLogin(t),[4,f.customerLogin()]):[2];case 2:return e.sent(),j.subscribers.length&&v(j.subscribers,(function(e){e.callback({type:m.CUSTOMER_LOGIN,data:{customer:t}})})),[3,4];case 3:return r=e.sent(),console.error(r),[3,4];case 4:return[2]}}))}))},j.customerLogout=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){try{u.customerLogout(),j.subscribers.length&&v(j.subscribers,(function(t){t.callback({type:m.CUSTOMER_LOGOUT,data:{}})}))}catch(t){console.error(t)}return[2]}))}))},j.customerVisit=function(){return t(this,void 0,void 0,(function(){var t,r;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,j.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(u.customerVisit(t),[4,f.customerVisit()]):[2];case 2:return e.sent(),j.subscribers.length&&v(j.subscribers,(function(e){e.callback({type:m.CUSTOMER_VISIT,data:{customer:t}})})),[3,4];case 3:return r=e.sent(),console.error(r),[3,4];case 4:return[2]}}))}))},j.viewCart=function(t){try{if(t){var e=Date.now().toString();if(l.viewCart(t,e),f.viewCart(t,e),b.viewCart(t),u.viewCart(t),j.subscribers.length){var r=new s(p(t));v(j.subscribers,(function(t){t.callback({type:m.VIEW_CART,data:{cart:r}})}))}}}catch(t){console.error(t)}},j.viewCategory=function(t,e){try{var r=Date.now().toString();if(l.viewCategory(t,r),u.viewCategory(e,t),f.viewCategory(e,t,r),h.viewCategory(e),j.subscribers.length){var o=new a(p(e));v(j.subscribers,(function(e){e.callback({type:m.VIEW_CATEGORY,data:{categoryPath:t,category:o}})}))}}catch(t){console.error(t)}},j.viewBrand=function(t){try{if(f.viewBrand(t),j.subscribers.length){var e=new i(p(t));v(j.subscribers,(function(t){t.callback({type:m.VIEW_BRAND,data:{brand:e}})}))}}catch(t){console.error(t)}},j.viewStorefrontPopup=function(t){try{if(f.viewPopup(t.id),j.subscribers.length){var e=new c(p(t));v(j.subscribers,(function(t){t.callback({type:m.POPUP_VIEW,data:{popup:e}})}))}}catch(t){console.error(t)}},j.viewSearchResults=function(t,e){try{if(j.subscribers.length){var r=p(e).map((function(t){return new d(t)}));v(j.subscribers,(function(e){e.callback({type:m.VIEW_SEARCH_RESULTS,data:{searchKeyword:t,productDetails:r}})}))}}catch(t){console.error(t)}},j.viewListing=function(t){try{if(j.subscribers.length){var e=p(t).map((function(t){return new d(t)}));v(j.subscribers,(function(t){t.callback({type:m.VIEW_LISTING,data:{productDetails:e}})}))}}catch(t){console.error(t)}},j.contactForm=function(t){try{var e=Date.now().toString();if(l.contactForm(e),h.contactForm(),f.contactForm(e),j.subscribers.length){var r=p(t);v(j.subscribers,(function(t){t.callback({type:m.CONTACT_FORM,data:{form:r}})}))}}catch(t){console.error(t)}},j.addCouponCode=function(t){try{if(t&&j.subscribers.length){var e=new s(p(t));v(j.subscribers,(function(t){t.callback({type:m.ADD_COUPON_CODE,data:{cart:e}})}))}}catch(t){console.error(t)}},j.removeCouponCode=function(t){try{if(t&&j.subscribers.length){var e=new s(p(t));v(j.subscribers,(function(t){t.callback({type:m.REMOVE_COUPON_CODE,data:{cart:e}})}))}}catch(t){console.error(t)}},j.removeLoyaltyPoints=function(t){try{if(t&&j.subscribers.length){var e=new s(p(t));v(j.subscribers,(function(t){t.callback({type:m.REMOVE_LOYALTY_POINTS,data:{cart:e}})}))}}catch(t){console.error(t)}},j.subscribers=[],j}();export{j as Analytics};
@@ -16,4 +16,15 @@ export declare class FacebookPixel {
16
16
  static viewCart(cart: IkasCart, eventId: string): void;
17
17
  static viewCategory(categoryPath: string, eventId: string): void;
18
18
  static contactForm(eventId: string): void;
19
+ static initAdvancedMatching(userData: {
20
+ em?: string | null;
21
+ fn?: string | null;
22
+ ln?: string | null;
23
+ ph?: string | null;
24
+ external_id?: string | null;
25
+ ct?: string | null;
26
+ st?: string | null;
27
+ zp?: string | null;
28
+ country?: string | null;
29
+ }): void;
19
30
  }
@@ -1 +1 @@
1
- import{makeAutoObservable as t}from"mobx";import{IkasStorefrontConfig as e}from"@ikas/storefront-config";import{CheckoutStep as n}from"../components/checkout/model.js";var r="undefined"==typeof window,o=function(){function o(){t(this)}return Object.defineProperty(o,"fbpId",{get:function(){return e.getFbpId()},enumerable:!1,configurable:!0}),o.pageView=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","PageView",{},{eventID:e}))}catch(t){console.error(t)}},o.productView=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","ViewContent",(n=t,{content_name:n.name,content_category:n.categories.length>0?n.categories[0].path.map((function(t){return t.name})).join(" > "):"",content_ids:[n.selectedVariant.id],content_type:"product",value:n.selectedVariant.price.finalPrice,currency:""===n.selectedVariant.price.currency?"TRY":n.selectedVariant.price.currency}),{eventID:e}))}catch(t){console.error(t)}var n},o.addToCart=function(t,e,n){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","AddToCart",c(t,e),{eventID:n}))}catch(t){console.error(t)}},o.beginCheckout=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","InitiateCheckout",i(t),{eventID:e}))}catch(t){console.error(t)}},o.purchase=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","Purchase",i(t),{eventID:e}))}catch(t){console.error(t)}},o.checkoutStep=function(t,e,o){var i,a,d;if(e===n.SHIPPING&&1!==(null===(i=t.availableShippingMethods)||void 0===i?void 0:i.length)||1===(null===(a=t.availableShippingMethods)||void 0===a?void 0:a.length)&&e===n.PAYMENT)try{!r&&this.fbpId&&window.fbq&&window.fbq("track","AddPaymentInfo",{currency:t.currencyCode,value:t.totalFinalPrice,shipping_tier:"Ground",coupon:t.couponCode,items:t.items.map((function(t){return c(t,t.quantity)}))},{eventID:o})}catch(t){console.error(t)}if(e===n.PAYMENT)try{!r&&this.fbpId&&window.fbq&&window.fbq("track","AddPaymentInfo",{currency:t.currencyCode,value:t.totalFinalPrice,coupon:t.couponCode,payment_type:null===(d=t.selectedPaymentGateway)||void 0===d?void 0:d.paymentMethodType,items:t.items.map((function(t){return c(t,t.quantity)}))},{eventID:o})}catch(t){console.error(t)}},o.addToWishlist=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","AddToWishlist",{content_ids:[t]},{eventID:e}))}catch(t){console.error(t)}},o.search=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","Search",{search_string:t},{eventID:e}))}catch(t){console.error(t)}},o.completeRegistration=function(t){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","CompleteRegistration",{status:!0,value:0,currency:"TRY"},{eventID:t}))}catch(t){console.error(t)}},o.viewCart=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","ViewCart",function(t){var e=[],n=[];return t.items.map((function(t){e.push(t.variant.id||""),n.push({id:t.variant.id,quantity:t.quantity})})),{contents:n,content_type:"product",content_ids:e,currency:t.items[0].currencyCode,value:t.totalPrice,num_items:t.items.length}}(t),{eventID:e}))}catch(t){console.error(t)}},o.viewCategory=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","ViewCategory",{content_name:t},{eventID:e}))}catch(t){console.error(t)}},o.contactForm=function(t){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","ContactForm",{},{eventID:t}))}catch(t){console.error(t)}},o}();function i(t){var e=[],n=[];return t.items.map((function(t){e.push(t.variant.id||""),n.push({id:t.variant.id,quantity:t.quantity})})),{contents:n,content_category:"",content_type:"product",content_ids:e,currency:t.items[0].currencyCode,value:t.totalFinalPrice,num_items:t.items.length}}function c(t,e){var n,r,o=[];(null===(n=t.variant.categories)||void 0===n?void 0:n.length)&&(null===(r=t.variant.categories[0].categoryPath)||void 0===r||r.map((function(t){return o.push(t.name)}))),t.variant.categories&&t.variant.categories.length>0&&o.push(t.variant.categories[0].name);var i=o.length>0?o.join(" > "):"";return{content_name:t.variant.name,content_category:i,content_ids:[t.variant.id],content_type:"product",value:t.finalPrice,currency:t.currencyCode}}export{o as FacebookPixel};
1
+ import{makeAutoObservable as t}from"mobx";import{IkasStorefrontConfig as e}from"@ikas/storefront-config";import{CheckoutStep as n}from"../components/checkout/model.js";var r="undefined"==typeof window,o=function(){function o(){t(this)}return Object.defineProperty(o,"fbpId",{get:function(){return e.getFbpId()},enumerable:!1,configurable:!0}),o.pageView=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","PageView",{},{eventID:e}))}catch(t){console.error(t)}},o.productView=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","ViewContent",(n=t,{content_name:n.name,content_category:n.categories.length>0?n.categories[0].path.map((function(t){return t.name})).join(" > "):"",content_ids:[n.selectedVariant.id],content_type:"product",value:n.selectedVariant.price.finalPrice,currency:""===n.selectedVariant.price.currency?"TRY":n.selectedVariant.price.currency}),{eventID:e}))}catch(t){console.error(t)}var n},o.addToCart=function(t,e,n){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","AddToCart",c(t,e),{eventID:n}))}catch(t){console.error(t)}},o.beginCheckout=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","InitiateCheckout",i(t),{eventID:e}))}catch(t){console.error(t)}},o.purchase=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","Purchase",i(t),{eventID:e}))}catch(t){console.error(t)}},o.checkoutStep=function(t,e,o){var i,a,d;if(e===n.SHIPPING&&1!==(null===(i=t.availableShippingMethods)||void 0===i?void 0:i.length)||1===(null===(a=t.availableShippingMethods)||void 0===a?void 0:a.length)&&e===n.PAYMENT)try{!r&&this.fbpId&&window.fbq&&window.fbq("track","AddPaymentInfo",{currency:t.currencyCode,value:t.totalFinalPrice,shipping_tier:"Ground",coupon:t.couponCode,items:t.items.map((function(t){return c(t,t.quantity)}))},{eventID:o})}catch(t){console.error(t)}if(e===n.PAYMENT)try{!r&&this.fbpId&&window.fbq&&window.fbq("track","AddPaymentInfo",{currency:t.currencyCode,value:t.totalFinalPrice,coupon:t.couponCode,payment_type:null===(d=t.selectedPaymentGateway)||void 0===d?void 0:d.paymentMethodType,items:t.items.map((function(t){return c(t,t.quantity)}))},{eventID:o})}catch(t){console.error(t)}},o.addToWishlist=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","AddToWishlist",{content_ids:[t]},{eventID:e}))}catch(t){console.error(t)}},o.search=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","Search",{search_string:t},{eventID:e}))}catch(t){console.error(t)}},o.completeRegistration=function(t){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","CompleteRegistration",{status:!0,value:0,currency:"TRY"},{eventID:t}))}catch(t){console.error(t)}},o.viewCart=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","ViewCart",function(t){var e=[],n=[];return t.items.map((function(t){e.push(t.variant.id||""),n.push({id:t.variant.id,quantity:t.quantity})})),{contents:n,content_type:"product",content_ids:e,currency:t.items[0].currencyCode,value:t.totalPrice,num_items:t.items.length}}(t),{eventID:e}))}catch(t){console.error(t)}},o.viewCategory=function(t,e){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","ViewCategory",{content_name:t},{eventID:e}))}catch(t){console.error(t)}},o.contactForm=function(t){try{return void(!r&&this.fbpId&&window.fbq&&window.fbq("track","ContactForm",{},{eventID:t}))}catch(t){console.error(t)}},o.initAdvancedMatching=function(t){try{if(r||!this.fbpId||!window.fbq)return;var e={};t.em&&(e.em=t.em.toLowerCase().trim()),t.fn&&(e.fn=t.fn.toLowerCase().trim()),t.ln&&(e.ln=t.ln.toLowerCase().trim()),t.ph&&(e.ph=t.ph.replace(/\D/g,"")),t.external_id&&(e.external_id=t.external_id),t.ct&&(e.ct=t.ct.toLowerCase().replace(/\s/g,"")),t.st&&(e.st=t.st.toLowerCase().trim()),t.zp&&(e.zp=t.zp.trim()),t.country&&(e.country=t.country.toLowerCase().trim()),Object.keys(e).length>0&&window.fbq("init",this.fbpId,e)}catch(t){console.error(t)}},o}();function i(t){var e=[],n=[];return t.items.map((function(t){e.push(t.variant.id||""),n.push({id:t.variant.id,quantity:t.quantity})})),{contents:n,content_category:"",content_type:"product",content_ids:e,currency:t.items[0].currencyCode,value:t.totalFinalPrice,num_items:t.items.length}}function c(t,e){var n,r,o=[];(null===(n=t.variant.categories)||void 0===n?void 0:n.length)&&(null===(r=t.variant.categories[0].categoryPath)||void 0===r||r.map((function(t){return o.push(t.name)}))),t.variant.categories&&t.variant.categories.length>0&&o.push(t.variant.categories[0].name);var i=o.length>0?o.join(" > "):"";return{content_name:t.variant.name,content_category:i,content_ids:[t.variant.id],content_type:"product",value:t.finalPrice,currency:t.currencyCode}}export{o as FacebookPixel};
@@ -1 +1 @@
1
- import*as t from"react";import e from"html-react-parser";import{getIkasEventsScript as n}from"../events.js";import{observer as r}from"mobx-react-lite";import{IkasStorefrontConfig as a}from"@ikas/storefront-config";var o=r((function(){var r=a.getGtmId(),o=a.getFbpId(),i=a.getAnalytics4Id(),s=a.getTiktokPixelId(),c=a.getIsEditor(),l=a.getStorefrontJSScripts(),m=a.getHighPriorityStorefrontJSScripts();return t.createElement(t.Fragment,null,m.map((function(t){return e(t)})),r&&!c&&t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','".concat(r,"');")}}),!!o&&!c&&t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '".concat(o,"');\n fbq.disablePushState = true;\n fbq.allowDuplicatePageViews = true;")}}),i&&!c&&t.createElement(t.Fragment,null,t.createElement("script",{async:!0,src:"https://www.googletagmanager.com/gtag/js?id=".concat(i)}),t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat(i,"');")}})),!!s&&!c&&t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:'!function (w, d, t) {\n w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for(var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var i="https://analytics.tiktok.com/i18n/pixel/events.js";ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=i,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=i+"?sdkid="+e+"&lib="+t;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(o,a)};\n ttq.load(\''.concat(s,"');\n ttq.page();\n }(window, document, 'ttq');")}}),e(n()),l.map((function(t){return e(t)})))})),i=function(){var e=a.getGtmId(),n=a.getFbpId(),r=a.getIsEditor();return t.createElement(t.Fragment,null,e&&!r&&t.createElement("noscript",{dangerouslySetInnerHTML:{__html:'<iframe src="https://www.googletagmanager.com/ns.html?id='.concat(e,'" height="0" width="0" style="display:none;visibility:hidden"></iframe>')}}),n&&!r&&t.createElement("noscript",{dangerouslySetInnerHTML:{__html:'<img height="1" width="1" style="display:none" \n src="https://www.facebook.com/tr?id='.concat(n,'&ev=PageView&noscript=1"/>')}}))};export{i as AnalyticsBody,o as AnalyticsHead};
1
+ import*as t from"react";import e from"html-react-parser";import{getIkasEventsScript as n}from"../events.js";import{observer as r}from"mobx-react-lite";import{IkasStorefrontConfig as a}from"@ikas/storefront-config";var o=r((function(){var r=a.getGtmId(),o=a.getFbpId(),i=a.getAnalytics4Id(),s=a.getTiktokPixelId(),c=a.getIsEditor(),l=a.getStorefrontJSScripts(),m=a.getHighPriorityStorefrontJSScripts();return t.createElement(t.Fragment,null,m.map((function(t){return e(t)})),r&&!c&&t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','".concat(r,"');")}}),!!o&&!c&&t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '".concat(o,"');\n fbq.disablePushState = true;\n fbq.allowDuplicatePageViews = true;")}}),i&&!c&&t.createElement(t.Fragment,null,t.createElement("script",{async:!0,src:"https://www.googletagmanager.com/gtag/js?id=".concat(i)}),t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:"window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '".concat(i,"');")}})),!!s&&!c&&t.createElement("script",{defer:!0,dangerouslySetInnerHTML:{__html:'!function (w, d, t) {\n w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for(var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var i="https://analytics.tiktok.com/i18n/pixel/events.js";ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=i,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=i+"?sdkid="+e+"&lib="+t;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(o,a)};\n ttq.load(\''.concat(s,"');\n }(window, document, 'ttq');")}}),e(n()),l.map((function(t){return e(t)})))})),i=function(){var e=a.getGtmId(),n=a.getFbpId(),r=a.getIsEditor();return t.createElement(t.Fragment,null,e&&!r&&t.createElement("noscript",{dangerouslySetInnerHTML:{__html:'<iframe src="https://www.googletagmanager.com/ns.html?id='.concat(e,'" height="0" width="0" style="display:none;visibility:hidden"></iframe>')}}),n&&!r&&t.createElement("noscript",{dangerouslySetInnerHTML:{__html:'<img height="1" width="1" style="display:none" \n src="https://www.facebook.com/tr?id='.concat(n,'&ev=PageView&noscript=1"/>')}}))};export{i as AnalyticsBody,o as AnalyticsHead};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "6.1.0-beta.292",
3
+ "version": "6.1.0-beta.293",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -23,11 +23,11 @@
23
23
  "swiper": "11.0.6"
24
24
  },
25
25
  "devDependencies": {
26
- "@ikas/storefront-api": "^6.1.0-beta.292",
27
- "@ikas/storefront-config": "^6.1.0-beta.292",
28
- "@ikas/storefront-model-functions": "^6.1.0-beta.292",
29
- "@ikas/storefront-models": "^6.1.0-beta.292",
30
- "@ikas/storefront-providers": "^6.1.0-beta.292",
26
+ "@ikas/storefront-api": "^6.1.0-beta.293",
27
+ "@ikas/storefront-config": "^6.1.0-beta.293",
28
+ "@ikas/storefront-model-functions": "^6.1.0-beta.293",
29
+ "@ikas/storefront-models": "^6.1.0-beta.293",
30
+ "@ikas/storefront-providers": "^6.1.0-beta.293",
31
31
  "@ikas/localized-address": "1.0.0-beta.6",
32
32
  "@adyen/adyen-web": "^5.57.0",
33
33
  "@rollup/plugin-commonjs": "^22.0.0",
@@ -62,11 +62,11 @@
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@ikas/localized-address": "1.0.0-beta.6",
65
- "@ikas/storefront-api": "^6.1.0-beta.292",
66
- "@ikas/storefront-config": "^6.1.0-beta.292",
67
- "@ikas/storefront-model-functions": "^6.1.0-beta.292",
68
- "@ikas/storefront-models": "^6.1.0-beta.292",
69
- "@ikas/storefront-providers": "^6.1.0-beta.292",
65
+ "@ikas/storefront-api": "^6.1.0-beta.293",
66
+ "@ikas/storefront-config": "^6.1.0-beta.293",
67
+ "@ikas/storefront-model-functions": "^6.1.0-beta.293",
68
+ "@ikas/storefront-models": "^6.1.0-beta.293",
69
+ "@ikas/storefront-providers": "^6.1.0-beta.293",
70
70
  "mobx": "^6.1.3",
71
71
  "mobx-react-lite": "^3.1.5",
72
72
  "next": "12.2.0",