@ikas/storefront 2.0.61-alpha.4 → 2.0.61-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/build/_virtual/index.js_commonjs-proxy3.js +1 -1
  2. package/build/_virtual/index.js_commonjs-proxy4.js +1 -1
  3. package/build/analytics/analytics.js +1 -1
  4. package/build/analytics/googleAnalytics.js +1 -1
  5. package/build/analytics/googleTagManager.js +1 -1
  6. package/build/analytics/googleUniversal.js +1 -1
  7. package/build/analytics/ikas.js +1 -1
  8. package/build/api/brand/index.js +1 -1
  9. package/build/api/category/index.js +1 -1
  10. package/build/api/checkout/index.js +1 -1
  11. package/build/api/customer/index.js +1 -1
  12. package/build/api/customer-review/index.js +1 -1
  13. package/build/api/customer-review-summary/index.js +1 -1
  14. package/build/api/favorite-product/index.js +1 -1
  15. package/build/api/html-meta-data/index.js +1 -1
  16. package/build/api/merchant/index.js +1 -1
  17. package/build/api/product-search/index.js +1 -1
  18. package/build/components/checkout/components/address-form/model.js +1 -1
  19. package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
  20. package/build/components/checkout/components/cart-summary/index.js +1 -1
  21. package/build/components/checkout/components/credit-card-form/index.js +1 -1
  22. package/build/components/checkout/components/customer-addresses/model.js +1 -1
  23. package/build/components/checkout/index.js +1 -1
  24. package/build/components/checkout/model.js +1 -1
  25. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  26. package/build/components/checkout/steps/step-payment/payment-gateways/installments/index.js +1 -1
  27. package/build/components/checkout/steps/step-shipping/index.js +1 -1
  28. package/build/components/checkout/steps/step-success/index.js +1 -1
  29. package/build/components/page/index.js +1 -1
  30. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  31. package/build/components/page-editor/model.js +1 -1
  32. package/build/ikas.js +2 -2
  33. package/build/models/data/merchant-settings/index.d.ts +14 -0
  34. package/build/models/data/merchant-settings/index.js +1 -1
  35. package/build/models/data/product/variant/index.js +1 -1
  36. package/build/models/ui/blog-category-list/index.js +1 -1
  37. package/build/models/ui/blog-list/index.js +1 -1
  38. package/build/models/ui/brand-list/index.js +1 -1
  39. package/build/models/ui/category-list/index.js +1 -1
  40. package/build/models/ui/customer-review-list/index.js +1 -1
  41. package/build/models/ui/customer-review-summary-list/index.js +1 -1
  42. package/build/models/ui/product-detail/index.js +1 -1
  43. package/build/models/ui/product-list/index.js +1 -1
  44. package/build/models/ui/raffle-list/index.js +1 -1
  45. package/build/models/ui/validator/form/address.js +1 -1
  46. package/build/pages/404.js +1 -1
  47. package/build/pages/_slug_/index.js +1 -1
  48. package/build/pages/account/addresses.js +1 -1
  49. package/build/pages/account/favorite-products.js +1 -1
  50. package/build/pages/account/forgot-password.js +1 -1
  51. package/build/pages/account/index.js +1 -1
  52. package/build/pages/account/login.js +1 -1
  53. package/build/pages/account/orders/_id_.js +1 -1
  54. package/build/pages/account/orders/index.js +1 -1
  55. package/build/pages/account/raffles.js +1 -1
  56. package/build/pages/account/recover-password.js +1 -1
  57. package/build/pages/account/register.js +1 -1
  58. package/build/pages/blog/_slug_.js +1 -1
  59. package/build/pages/blog/index.js +1 -1
  60. package/build/pages/cart.js +1 -1
  61. package/build/pages/checkout.js +1 -1
  62. package/build/pages/editor.js +1 -1
  63. package/build/pages/home.js +1 -1
  64. package/build/pages/pages/_slug_.js +1 -1
  65. package/build/pages/raffle/_slug_.js +1 -1
  66. package/build/pages/raffle/index.js +1 -1
  67. package/build/pages/search.js +1 -1
  68. package/build/providers/helpers/raffles.js +1 -1
  69. package/build/providers/page-data-get.js +1 -1
  70. package/build/providers/page-data-init.js +1 -1
  71. package/build/providers/page-data-next.js +1 -1
  72. package/build/providers/placeholders.js +1 -1
  73. package/build/providers/prop-value/attribute-list.js +1 -1
  74. package/build/providers/prop-value/attribute.js +1 -1
  75. package/build/providers/prop-value/blog-category-list.js +1 -1
  76. package/build/providers/prop-value/blog-category.js +1 -1
  77. package/build/providers/prop-value/blog-list.js +1 -1
  78. package/build/providers/prop-value/blog.js +1 -1
  79. package/build/providers/prop-value/brand-list.js +1 -1
  80. package/build/providers/prop-value/brand.js +1 -1
  81. package/build/providers/prop-value/category-list.js +1 -1
  82. package/build/providers/prop-value/category.js +1 -1
  83. package/build/providers/prop-value/custom.js +1 -1
  84. package/build/providers/prop-value/image-list.js +1 -1
  85. package/build/providers/prop-value/image.js +1 -1
  86. package/build/providers/prop-value/link.js +1 -1
  87. package/build/providers/prop-value/product-detail.js +1 -1
  88. package/build/providers/prop-value/product-list.js +1 -1
  89. package/build/providers/prop-value/raffle-list.js +1 -1
  90. package/build/providers/prop-value/raffle.js +1 -1
  91. package/build/scripts/generators/types/index.js +1 -1
  92. package/build/store/base.js +1 -1
  93. package/build/store/cart.js +1 -1
  94. package/build/store/customer.js +1 -1
  95. package/build/storefront/index.d.ts +3 -2
  96. package/build/storefront/index.js +1 -1
  97. package/build/utils/currency.d.ts +2 -2
  98. package/build/utils/currency.js +1 -1
  99. package/package.json +1 -1
@@ -1 +1 @@
1
- import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
1
+ import o from'../ext/split-on-first/index.js';export{default}from"../node_modules/split-on-first/index.js";
@@ -1 +1 @@
1
- import o from'../ext/split-on-first/index.js';export{default}from"../node_modules/split-on-first/index.js";
1
+ import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t,__assign as r}from'../ext/tslib/tslib.es6.js';import{makeAutoObservable as o}from"mobx";import"../models/data/blog/index.js";import{IkasBrand as i}from"../models/data/brand/index.js";import{IkasCategory as s}from"../models/data/category/index.js";import{IkasCheckout as a}from"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as c}from"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{FacebookPixel as n}from"./facebookPixel.js";import{GoogleTagManager as u}from"./googleTagManager.js";import{IkasCart as d}from"../models/data/cart/index.js";import{IkasEventType as m}from"./events.js";import{IkasStorefrontConfig as l}from"../storefront/index.js";import p from'../ext/lodash/cloneDeep.js';import{tryForEach as b}from"../utils/helper.js";import"../utils/i18n.js";import f from"./ikas.js";import{GoogleAnalytics as h}from"./googleAnalytics.js";import{GoogleUniversal as g}from"./googleUniversal.js";var v=function(){function v(){o(this)}return v.getCustomerInfo=function(){return e(this,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:return[4,(e=l.store).customerStore.waitUntilInitialized()];case 1:return t.sent(),(o=e.customerStore.customer)?[2,r(r({},o.basicInfo),{consentGranted:e.customerStore.customerConsentGranted})]:[2,null]}}))}))},v.pageView=function(r){return e(this,void 0,void 0,(function(){var e,o,i;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=window.location.href,[4,v.getCustomerInfo()];case 1:return o=t.sent(),u.pageView(e),f.pageView(r),b(v.subscribers,(function(t){t.callback({type:m.PAGE_VIEW,data:{url:e,pageType:r,customer:o}})})),[3,3];case 2:return i=t.sent(),console.error(i),[3,3];case 3:return[2]}}))}))},v.productView=function(e){try{if(n.productView(e),u.productView(e),f.productView(e),h.productView(e),g.productView(e),v.subscribers.length){var t=p(e),r=new c(t.product,t.selectedVariantValues);b(v.subscribers,(function(e){e.callback({type:m.PRODUCT_VIEW,data:{productDetail:r}})}))}}catch(e){console.error(e)}},v.addToCart=function(e,t,r,o){try{if(n.addToCart(e,t,r),u.addToCart(e,t),f.addToCart(e,t,o),h.addToCart(e,t),g.addToCart(e,t),v.subscribers.length){var i=p(e),s=new d(p(o));b(v.subscribers,(function(e){e.callback({type:m.ADD_TO_CART,data:{item:i,quantity:t,cart:s}})}))}}catch(e){console.error(e)}},v.removeFromCart=function(e,t,r){try{if(u.removeFromCart(e,t),h.removeFromCart(e,t),g.removeFromCart(e,t),v.subscribers.length){var o=p(e),i=new d(p(r));b(v.subscribers,(function(e){e.callback({type:m.REMOVE_FROM_CART,data:{item:o,quantity:t,cart:i}})}))}}catch(e){console.error(e)}},v.beginCheckout=function(e){try{var t=localStorage.getItem("gtmBeginCheckout");if(t&&e.id===t)return;if(localStorage.setItem("gtmBeginCheckout",e.id),n.beginCheckout(e),u.beginCheckout(e),f.beginCheckout(e),h.beginCheckout(e),v.subscribers.length){var r=new a(p(e));b(v.subscribers,(function(e){e.callback({type:m.BEGIN_CHECKOUT,data:{checkout:r}})}))}}catch(e){console.error(e)}},v.purchase=function(e,t){try{if(localStorage.removeItem("gtmBeginCheckout"),n.purchase(e,e.orderNumber||""),u.purchase(e,e.orderNumber||""),f.orderSuccess(e),h.purchase(e,e.orderNumber||""),g.purchase(e,e.orderNumber||""),v.subscribers.length){var r=new a(p(e)),o=p(t);b(v.subscribers,(function(e){e.callback({type:m.COMPLETE_CHECKOUT,data:{checkout:r,transaction:o}})}))}}catch(e){console.error(e)}},v.checkoutStep=function(e,t){try{if(u.checkoutStep(e,t),f.checkoutStep(e,t),h.checkoutStep(e,t),v.subscribers.length){var r=new a(p(e));b(v.subscribers,(function(e){e.callback({type:m.CHECKOUT_STEP,data:{checkout:r,step:t}})}))}}catch(e){console.error(e)}},v.disableHTML=function(){try{u.disableHTML()}catch(e){console.error(e)}},v.addToWishlist=function(e){try{n.addToWishlist(e),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.ADD_TO_WISHLIST,data:{productId:e}})}))}catch(e){console.error(e)}},v.search=function(e){try{n.search(e),u.search(e),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.SEARCH,data:{searchKeyword:e}})}))}catch(e){console.error(e)}},v.completeRegistration=function(e){try{n.completeRegistration(),u.completeRegistration(),f.customerRegister(),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.CUSTOMER_REGISTER,data:{email:e.email,firstName:e.firstName,lastName:e.lastName}})}))}catch(e){console.error(e)}},v.createEmailSubscripition=function(e){try{v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.EMAIL_SUBSCRIPTION,data:{email:e}})}))}catch(e){console.error(e)}},v.customerLogin=function(){return e(this,void 0,void 0,(function(){var e,r;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,v.getCustomerInfo()];case 1:return(e=t.sent())&&e.email?(u.customerLogin(e.email),f.customerLogin(),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.CUSTOMER_LOGIN,data:{customer:e}})})),[3,3]):[2];case 2:return r=t.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},v.customerLogout=function(){return e(this,void 0,void 0,(function(){return t(this,(function(e){try{v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:m.CUSTOMER_LOGOUT,data:{}})}))}catch(e){console.error(e)}return[2]}))}))},v.customerVisit=function(){return e(this,void 0,void 0,(function(){var e,r;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,v.getCustomerInfo()];case 1:return(e=t.sent())&&e.email?(u.customerVisit(e.email),f.customerVisit(),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.CUSTOMER_VISIT,data:{customer:e}})})),[3,3]):[2];case 2:return r=t.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},v.viewCart=function(e){try{if(e&&(n.viewCart(e),f.viewCart(e),h.viewCart(e),v.subscribers.length)){var t=new d(p(e));b(v.subscribers,(function(e){e.callback({type:m.VIEW_CART,data:{cart:t}})}))}}catch(e){console.error(e)}},v.viewCategory=function(e,t){try{if(n.viewCategory(e),u.viewCategory(t,e),f.viewCategory(t),v.subscribers.length){var r=new s(p(t));b(v.subscribers,(function(t){t.callback({type:m.VIEW_CATEGORY,data:{categoryPath:e,category:r}})}))}}catch(e){console.error(e)}},v.viewBrand=function(e){try{if(f.viewBrand(e),v.subscribers.length){var t=new i(p(e));b(v.subscribers,(function(e){e.callback({type:m.VIEW_BRAND,data:{brand:t}})}))}}catch(e){console.error(e)}},v.viewSearchResults=function(e,t){try{if(v.subscribers.length){var r=p(t).map((function(e){return new c(e.product,e.selectedVariantValues)}));b(v.subscribers,(function(t){t.callback({type:m.VIEW_SEARCH_RESULTS,data:{searchKeyword:e,productDetails:r}})}))}}catch(e){console.error(e)}},v.viewListing=function(e){try{if(v.subscribers.length){var t=p(e).map((function(e){return new c(e.product,e.selectedVariantValues)}));b(v.subscribers,(function(e){e.callback({type:m.VIEW_LISTING,data:{productDetails:t}})}))}}catch(e){console.error(e)}},v.contactForm=function(e){try{if(n.contactForm(),v.subscribers.length){var t=p(e);b(v.subscribers,(function(e){e.callback({type:m.CONTACT_FORM,data:{form:t}})}))}}catch(e){console.error(e)}},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/index.js";import{IkasBrand as s}from"../models/data/brand/index.js";import{IkasCategory as i}from"../models/data/category/index.js";import{IkasCheckout as a}from"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as c}from"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{FacebookPixel as n}from"./facebookPixel.js";import{GoogleTagManager as u}from"./googleTagManager.js";import{IkasCart as d}from"../models/data/cart/index.js";import{IkasEventType as m}from"./events.js";import{IkasStorefrontConfig as l}from"../storefront/index.js";import p from'../ext/lodash/cloneDeep.js';import{tryForEach as b}from"../utils/helper.js";import"../utils/i18n.js";import f from"./ikas.js";import{GoogleAnalytics as h}from"./googleAnalytics.js";import{GoogleUniversal as g}from"./googleUniversal.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=l.store).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;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=window.location.href,[4,v.getCustomerInfo()];case 1:return o=e.sent(),u.pageView(t),f.pageView(r),b(v.subscribers,(function(e){e.callback({type:m.PAGE_VIEW,data:{url:t,pageType:r,customer:o}})})),[3,3];case 2:return s=e.sent(),console.error(s),[3,3];case 3:return[2]}}))}))},v.productView=function(t){try{if(n.productView(t),u.productView(t),f.productView(t),h.productView(t),g.productView(t),v.subscribers.length){var e=p(t),r=new c(e.product,e.selectedVariantValues);b(v.subscribers,(function(t){t.callback({type:m.PRODUCT_VIEW,data:{productDetail:r}})}))}}catch(t){console.error(t)}},v.addToCart=function(t,e,r,o){try{if(n.addToCart(t,e,r),u.addToCart(t,e),f.addToCart(t,e,o),h.addToCart(t,e),g.addToCart(t,e),v.subscribers.length){var s=p(t),i=new d(p(o));b(v.subscribers,(function(t){t.callback({type:m.ADD_TO_CART,data:{item:s,quantity:e,cart:i}})}))}}catch(t){console.error(t)}},v.removeFromCart=function(t,e,r){try{if(u.removeFromCart(t,e),h.removeFromCart(t,e),g.removeFromCart(t,e),v.subscribers.length){var o=p(t),s=new d(p(r));b(v.subscribers,(function(t){t.callback({type:m.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;if(localStorage.setItem("gtmBeginCheckout",t.id),n.beginCheckout(t),u.beginCheckout(t),f.beginCheckout(t),h.beginCheckout(t),v.subscribers.length){var r=new a(p(t));b(v.subscribers,(function(t){t.callback({type:m.BEGIN_CHECKOUT,data:{checkout:r}})}))}}catch(t){console.error(t)}},v.purchase=function(t,e){try{if(localStorage.removeItem("gtmBeginCheckout"),n.purchase(t,t.orderNumber||""),u.purchase(t,t.orderNumber||""),f.orderSuccess(t),h.purchase(t,t.orderNumber||""),g.purchase(t,t.orderNumber||""),v.subscribers.length){var r=new a(p(t)),o=p(e);b(v.subscribers,(function(t){t.callback({type:m.COMPLETE_CHECKOUT,data:{checkout:r,transaction:o}})}))}}catch(t){console.error(t)}},v.checkoutStep=function(t,e){try{if(u.checkoutStep(t,e),f.checkoutStep(t,e),h.checkoutStep(t,e),v.subscribers.length){var r=new a(p(t));b(v.subscribers,(function(t){t.callback({type:m.CHECKOUT_STEP,data:{checkout:r,step:e}})}))}}catch(t){console.error(t)}},v.disableHTML=function(){try{u.disableHTML()}catch(t){console.error(t)}},v.addToWishlist=function(t){try{n.addToWishlist(t),v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:m.ADD_TO_WISHLIST,data:{productId:t}})}))}catch(t){console.error(t)}},v.search=function(t){try{n.search(t),u.search(t),v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:m.SEARCH,data:{searchKeyword:t}})}))}catch(t){console.error(t)}},v.completeRegistration=function(t){try{n.completeRegistration(),u.completeRegistration(),f.customerRegister(),v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:m.CUSTOMER_REGISTER,data:{email:t.email,firstName:t.firstName,lastName:t.lastName}})}))}catch(t){console.error(t)}},v.createEmailSubscripition=function(t){try{v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:m.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,2,,3]),[4,v.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(u.customerLogin(t.email),f.customerLogin(),v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:m.CUSTOMER_LOGIN,data:{customer:t}})})),[3,3]):[2];case 2:return r=e.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},v.customerLogout=function(){return t(this,void 0,void 0,(function(){return e(this,(function(t){try{v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.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,2,,3]),[4,v.getCustomerInfo()];case 1:return(t=e.sent())&&t.email?(u.customerVisit(t.email),f.customerVisit(),v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:m.CUSTOMER_VISIT,data:{customer:t}})})),[3,3]):[2];case 2:return r=e.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},v.viewCart=function(t){try{if(t&&(n.viewCart(t),f.viewCart(t),h.viewCart(t),v.subscribers.length)){var e=new d(p(t));b(v.subscribers,(function(t){t.callback({type:m.VIEW_CART,data:{cart:e}})}))}}catch(t){console.error(t)}},v.viewCategory=function(t,e){try{if(n.viewCategory(t),u.viewCategory(e,t),f.viewCategory(e),v.subscribers.length){var r=new i(p(e));b(v.subscribers,(function(e){e.callback({type:m.VIEW_CATEGORY,data:{categoryPath:t,category:r}})}))}}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:m.VIEW_BRAND,data:{brand: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.product,t.selectedVariantValues)}));b(v.subscribers,(function(e){e.callback({type:m.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.product,t.selectedVariantValues)}));b(v.subscribers,(function(t){t.callback({type:m.VIEW_LISTING,data:{productDetails:e}})}))}}catch(t){console.error(t)}},v.contactForm=function(t){try{if(n.contactForm(),v.subscribers.length){var e=p(t);b(v.subscribers,(function(t){t.callback({type:m.CONTACT_FORM,data:{form:e}})}))}}catch(t){console.error(t)}},v.subscribers=[],v}();export{v as Analytics};
@@ -1 +1 @@
1
- import{makeAutoObservable as e}from"mobx";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as t}from"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{CheckoutStep as i}from"../components/checkout/model.js";var o="undefined"==typeof window,r=function(){function r(){e(this)}return r.productView=function(e){try{return void(!o&&window.gtag&&window.gtag("event","view_item",{currency:""===e.selectedVariant.price.currency?"TRY":e.selectedVariant.price.currency,value:e.selectedVariant.price.finalPrice,items:[a(e)]}))}catch(e){console.error(e)}},r.addToCart=function(e,i){try{return void(!o&&window.gtag&&window.gtag("event","add_to_cart",{currency:e instanceof t?""===e.selectedVariant.price.currency?"TRY":e.selectedVariant.price.currency:e.currencyCode,value:e instanceof t?e.selectedVariant.price.finalPrice:e.finalPrice,items:[e instanceof t?a(e,i):n(e,i)]}))}catch(e){console.error(e)}},r.removeFromCart=function(e,i){try{return void(!o&&window.gtag&&window.gtag("event","remove_from_cart",{currency:e instanceof t?""===e.selectedVariant.price.currency?"TRY":e.selectedVariant.price.currency:e.currencyCode,value:e instanceof t?e.selectedVariant.price.finalPrice:e.finalPrice,items:[e instanceof t?a(e,i):n(e,i)]}))}catch(e){console.error(e)}},r.viewCart=function(e){try{return void(!o&&window.gtag&&window.gtag("event","view_cart",{currency:e.currencyCode,value:e.totalPrice,items:e.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}},r.beginCheckout=function(e){var t,i;try{return void(!o&&window.gtag&&window.gtag("event","begin_checkout",{currency:null===(t=e.cart)||void 0===t?void 0:t.currencyCode,value:e.totalFinalPrice,items:null===(i=e.cart)||void 0===i?void 0:i.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}},r.purchase=function(e,t){var i,r,a;try{return void(!o&&window.gtag&&window.gtag("event","purchase",{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+(null===(i=e.cart)||void 0===i?void 0:i.totalTax),shipping:""+e.shippingTotal,currency:null===(r=e.cart)||void 0===r?void 0:r.currencyCode,coupon:e.couponCode,items:null===(a=e.cart)||void 0===a?void 0:a.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}},r.checkoutStep=function(e,t){var r,a,d,c,m;if(t===i.SHIPPING)try{return void(!o&&window.gtag&&window.gtag("event","add_shipping_info",{currency:null===(r=e.cart)||void 0===r?void 0:r.currencyCode,value:e.totalFinalPrice,shipping_tier:"Ground",coupon:e.couponCode,items:null===(a=e.cart)||void 0===a?void 0:a.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}if(t===i.PAYMENT)try{return void(!o&&window.gtag&&window.gtag("event","add_payment_info",{currency:null===(d=e.cart)||void 0===d?void 0:d.currencyCode,value:e.totalFinalPrice,coupon:e.couponCode,payment_type:null===(c=e.selectedPaymentGateway)||void 0===c?void 0:c.paymentMethodType,items:null===(m=e.cart)||void 0===m?void 0:m.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}},r}();function a(e,t){var i;return void 0===t&&(t=1),{item_name:e.product.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(i=e.product.brand)||void 0===i?void 0:i.name)||"",item_category:e.product.categories.length?e.product.categories[0].name:"",item_category_2:e.product.categories.length>1?e.product.categories[1].name:"",item_category_3:e.product.categories.length>2?e.product.categories[2].name:"",item_category_4:e.product.categories.length>3?e.product.categories[3].name:"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function n(e,t){return void 0===t&&(t=1),{item_name:e.variant.name,item_id:e.variant.id,price:""+e.finalPrice,item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:"",item_variant:e.variant.variantValues.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}export{r as GoogleAnalytics};
1
+ import{makeAutoObservable as e}from"mobx";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as t}from"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{CheckoutStep as i}from"../components/checkout/model.js";var o="undefined"==typeof window,r=function(){function r(){e(this)}return r.productView=function(e){try{return void(!o&&window.gtag&&window.gtag("event","view_item",{currency:""===e.selectedVariant.price.currency?"TRY":e.selectedVariant.price.currency,value:e.selectedVariant.price.finalPrice,items:[a(e)]}))}catch(e){console.error(e)}},r.addToCart=function(e,i){try{return void(!o&&window.gtag&&window.gtag("event","add_to_cart",{currency:e instanceof t?""===e.selectedVariant.price.currency?"TRY":e.selectedVariant.price.currency:e.currencyCode,value:e instanceof t?e.selectedVariant.price.finalPrice:e.finalPrice,items:[e instanceof t?a(e,i):n(e,i)]}))}catch(e){console.error(e)}},r.removeFromCart=function(e,i){try{return void(!o&&window.gtag&&window.gtag("event","remove_from_cart",{currency:e instanceof t?""===e.selectedVariant.price.currency?"TRY":e.selectedVariant.price.currency:e.currencyCode,value:e instanceof t?e.selectedVariant.price.finalPrice:e.finalPrice,items:[e instanceof t?a(e,i):n(e,i)]}))}catch(e){console.error(e)}},r.viewCart=function(e){try{return void(!o&&window.gtag&&window.gtag("event","view_cart",{currency:e.currencyCode,value:e.totalPrice,items:e.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}},r.beginCheckout=function(e){var t,i;try{return void(!o&&window.gtag&&window.gtag("event","begin_checkout",{currency:null===(t=e.cart)||void 0===t?void 0:t.currencyCode,value:e.totalFinalPrice,items:null===(i=e.cart)||void 0===i?void 0:i.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}},r.purchase=function(e,t){var i,r,a;try{return void(!o&&window.gtag&&window.gtag("event","purchase",{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+(null===(i=e.cart)||void 0===i?void 0:i.totalTax),shipping:""+e.shippingTotal,currency:null===(r=e.cart)||void 0===r?void 0:r.currencyCode,coupon:e.couponCode,items:null===(a=e.cart)||void 0===a?void 0:a.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}},r.checkoutStep=function(e,t){var r,a,d,c,m;if(t===i.SHIPPING)try{return void(!o&&window.gtag&&window.gtag("event","add_shipping_info",{currency:null===(r=e.cart)||void 0===r?void 0:r.currencyCode,value:e.totalFinalPrice,shipping_tier:"Ground",coupon:e.couponCode,items:null===(a=e.cart)||void 0===a?void 0:a.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}if(t===i.PAYMENT)try{return void(!o&&window.gtag&&window.gtag("event","add_payment_info",{currency:null===(d=e.cart)||void 0===d?void 0:d.currencyCode,value:e.totalFinalPrice,coupon:e.couponCode,payment_type:null===(c=e.selectedPaymentGateway)||void 0===c?void 0:c.paymentMethodType,items:null===(m=e.cart)||void 0===m?void 0:m.items.map((function(e){return n(e,e.quantity)}))}))}catch(e){console.error(e)}},r}();function a(e,t){var i;return void 0===t&&(t=1),{item_name:e.product.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(i=e.product.brand)||void 0===i?void 0:i.name)||"",item_category:e.product.categories.length?e.product.categories[0].name:"",item_category_2:e.product.categories.length>1?e.product.categories[1].name:"",item_category_3:e.product.categories.length>2?e.product.categories[2].name:"",item_category_4:e.product.categories.length>3?e.product.categories[3].name:"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function n(e,t){return void 0===t&&(t=1),{item_name:e.variant.name,item_id:e.variant.id,price:""+e.finalPrice,item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:"",item_variant:e.variant.variantValues.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}export{r as GoogleAnalytics};
@@ -1 +1 @@
1
- import{makeAutoObservable as e}from"mobx";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as t}from"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{CheckoutStep as r}from"../components/checkout/model.js";import{IkasStorefrontConfig as o}from"../storefront/index.js";var a="undefined"==typeof window,i=function(){function i(){e(this)}return i.pageView=function(e){try{var t={event:"page-view",page:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.productView=function(e){var t;try{var r={event:"view_item",ecommerce:{items:[n(e)],extraParams:{parent_id:e.product.id,currency:e.selectedVariant.price.currency,url:"https://".concat(window.location.hostname).concat(e.href),item_image:(null===(t=e.selectedVariant.mainImage)||void 0===t?void 0:t.src)||""}}};return!a&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.addToCart=function(e,r){var i=o.store.cartStore.cart;try{var m={event:"add_to_cart",ecommerce:{items:[e instanceof t?n(e,r):d(e,r)],cart:i}};return!a&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},i.removeFromCart=function(e,r){var i=o.store.cartStore.cart;try{var m={event:"remove_from_cart",ecommerce:{items:[e instanceof t?n(e,r):d(e,r)],cart:0===(null==i?void 0:i.itemCount)?null:i}};return!a&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},i.beginCheckout=function(e){var t;try{var r={event:"begin_checkout",ecommerce:{items:null===(t=e.cart)||void 0===t?void 0:t.items.map((function(e){return d(e,e.quantity)}))}};return!a&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.purchase=function(e,t){var r,o,i;try{var n={event:"purchase",ecommerce:{purchase:{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+(null===(r=e.cart)||void 0===r?void 0:r.totalTax),shipping:""+e.shippingTotal,currency:null===(o=e.cart)||void 0===o?void 0:o.currencyCode,coupon:e.couponCode,items:null===(i=e.cart)||void 0===i?void 0:i.items.map((function(e){return d(e,e.quantity)}))}}};return!a&&window.dataLayer&&window.dataLayer.push(n),n}catch(e){console.error(e)}},i.checkoutStep=function(e,t){var o,i="";t===r.INFO?i="checkout_info":t===r.SHIPPING?i="checkout_shipping":t===r.PAYMENT?i="checkout_payment":t===r.SUCCESS&&(i="checkout_success");try{var n={event:i,ecommerce:{items:null===(o=e.cart)||void 0===o?void 0:o.items.map((function(e){return d(e,e.quantity)}))}};return!a&&window.dataLayer&&window.dataLayer.push(n),n}catch(e){console.error(e)}},i.disableHTML=function(){try{!a&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},i.completeRegistration=function(){try{var e={event:"customer_register"};return!a&&window.dataLayer&&window.dataLayer.push(e),e}catch(e){console.error(e)}},i.search=function(e){try{var t={event:"search",search_string:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.viewCategory=function(e,t){try{var r={event:"view_category",ecommerce:{category:[{id:e.id,name:e.name,metaData:e.metaData,href:e.href,image:e.image,path:t}]}};return!a&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.customerLogin=function(e){try{var t={event:"customer_login",email:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.customerVisit=function(e){try{var t={event:"customer_visit",email:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i}();function n(e,t){var r;return void 0===t&&(t=1),{item_name:e.product.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(r=e.product.brand)||void 0===r?void 0:r.name)||"",item_category:e.product.categories.length?e.product.categories[0].name:"",item_category_2:e.product.categories.length>1?e.product.categories[1].name:"",item_category_3:e.product.categories.length>2?e.product.categories[2].name:"",item_category_4:e.product.categories.length>3?e.product.categories[3].name:"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function d(e,t){return void 0===t&&(t=1),{item_name:e.variant.name,item_id:e.variant.id,price:""+e.finalPrice,item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:"",item_variant:e.variant.variantValues.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}export{i as GoogleTagManager};
1
+ import{makeAutoObservable as e}from"mobx";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as t}from"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{CheckoutStep as r}from"../components/checkout/model.js";import{IkasStorefrontConfig as o}from"../storefront/index.js";var a="undefined"==typeof window,i=function(){function i(){e(this)}return i.pageView=function(e){try{var t={event:"page-view",page:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.productView=function(e){var t;try{var r={event:"view_item",ecommerce:{items:[n(e)],extraParams:{parent_id:e.product.id,currency:e.selectedVariant.price.currency,url:"https://".concat(window.location.hostname).concat(e.href),item_image:(null===(t=e.selectedVariant.mainImage)||void 0===t?void 0:t.src)||""}}};return!a&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.addToCart=function(e,r){var i=o.store.cartStore.cart;try{var m={event:"add_to_cart",ecommerce:{items:[e instanceof t?n(e,r):d(e,r)],cart:i}};return!a&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},i.removeFromCart=function(e,r){var i=o.store.cartStore.cart;try{var m={event:"remove_from_cart",ecommerce:{items:[e instanceof t?n(e,r):d(e,r)],cart:0===(null==i?void 0:i.itemCount)?null:i}};return!a&&window.dataLayer&&window.dataLayer.push(m),m}catch(e){console.error(e)}},i.beginCheckout=function(e){var t;try{var r={event:"begin_checkout",ecommerce:{items:null===(t=e.cart)||void 0===t?void 0:t.items.map((function(e){return d(e,e.quantity)}))}};return!a&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.purchase=function(e,t){var r,o,i;try{var n={event:"purchase",ecommerce:{purchase:{transaction_id:t,affiliation:window.location.hostname,value:""+e.totalFinalPrice,tax:""+(null===(r=e.cart)||void 0===r?void 0:r.totalTax),shipping:""+e.shippingTotal,currency:null===(o=e.cart)||void 0===o?void 0:o.currencyCode,coupon:e.couponCode,items:null===(i=e.cart)||void 0===i?void 0:i.items.map((function(e){return d(e,e.quantity)}))}}};return!a&&window.dataLayer&&window.dataLayer.push(n),n}catch(e){console.error(e)}},i.checkoutStep=function(e,t){var o,i="";t===r.INFO?i="checkout_info":t===r.SHIPPING?i="checkout_shipping":t===r.PAYMENT?i="checkout_payment":t===r.SUCCESS&&(i="checkout_success");try{var n={event:i,ecommerce:{items:null===(o=e.cart)||void 0===o?void 0:o.items.map((function(e){return d(e,e.quantity)}))}};return!a&&window.dataLayer&&window.dataLayer.push(n),n}catch(e){console.error(e)}},i.disableHTML=function(){try{!a&&window.dataLayer&&window.dataLayer.push({"gtm.blocklist":["html","customScripts","customPixels","nonGoogleScripts"]})}catch(e){console.error(e)}},i.completeRegistration=function(){try{var e={event:"customer_register"};return!a&&window.dataLayer&&window.dataLayer.push(e),e}catch(e){console.error(e)}},i.search=function(e){try{var t={event:"search",search_string:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.viewCategory=function(e,t){try{var r={event:"view_category",ecommerce:{category:[{id:e.id,name:e.name,metaData:e.metaData,href:e.href,image:e.image,path:t}]}};return!a&&window.dataLayer&&window.dataLayer.push(r),r}catch(e){console.error(e)}},i.customerLogin=function(e){try{var t={event:"customer_login",email:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i.customerVisit=function(e){try{var t={event:"customer_visit",email:e};return!a&&window.dataLayer&&window.dataLayer.push(t),t}catch(e){console.error(e)}},i}();function n(e,t){var r;return void 0===t&&(t=1),{item_name:e.product.name,item_id:e.selectedVariant.id,price:e.selectedVariant.price.finalPrice,item_brand:(null===(r=e.product.brand)||void 0===r?void 0:r.name)||"",item_category:e.product.categories.length?e.product.categories[0].name:"",item_category_2:e.product.categories.length>1?e.product.categories[1].name:"",item_category_3:e.product.categories.length>2?e.product.categories[2].name:"",item_category_4:e.product.categories.length>3?e.product.categories[3].name:"",item_variant:e.selectedVariant.variantValues.map((function(e){return e.name})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}function d(e,t){return void 0===t&&(t=1),{item_name:e.variant.name,item_id:e.variant.id,price:""+e.finalPrice,item_brand:"",item_category:"",item_category_2:"",item_category_3:"",item_category_4:"",item_variant:e.variant.variantValues.map((function(e){return e.variantValueName})).join(" / "),item_list_name:"",item_list_id:"",index:1,quantity:t}}export{i as GoogleTagManager};
@@ -1 +1 @@
1
- import{makeAutoObservable as t}from"mobx";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as o}from"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";var e="undefined"==typeof window,i=function(){function i(){t(this)}return i.productView=function(t){try{return void(!e&&window.ga&&(window.ga("ec:addProduct",function(t,o){var e;return{id:t.selectedVariant.id,name:t.product.name,brand:(null===(e=t.product.brand)||void 0===e?void 0:e.name)||"",category:t.product.categories.map((function(t){return t.name})).join(" / "),variant:t.selectedVariant.variantValues.map((function(t){return t.name})).join(" / ")}}(t)),window.ga("ec:setAction","detail"),window.ga("send","pageview")))}catch(t){console.error(t)}},i.addToCart=function(t,i){try{return void(!e&&window.ga&&(window.ga("ec:addProduct",t instanceof o?r(t,i):a(t,i)),window.ga("ec:setAction","add"),window.ga("send","event","UX","click","add to cart")))}catch(t){console.error(t)}},i.removeFromCart=function(t,i){try{return void(!e&&window.ga&&(window.ga("ec:addProduct",t instanceof o?r(t,i):a(t,i)),window.ga("ec:setAction","remove"),window.ga("send","event","UX","click","add to cart")))}catch(t){console.error(t)}},i.purchase=function(t,o){var i,r,d;try{return void(!e&&window.ga&&(window.ga("set","currencyCode",null===(i=t.cart)||void 0===i?void 0:i.currencyCode),null===(r=t.cart)||void 0===r||r.items.map((function(t){return window.ga("ec:addProduct",a(t,t.quantity))})),window.ga("ec:setAction","purchase",{id:o,affiliation:window.location.hostname,revenue:""+t.totalFinalPrice,tax:""+(null===(d=t.cart)||void 0===d?void 0:d.totalTax),shipping:""+t.shippingTotal,coupon:t.couponCode}),window.ga("send","pageview")))}catch(t){console.error(t)}},i}();function r(t,o){var e;return void 0===o&&(o=1),{id:t.selectedVariant.id,name:t.product.name,brand:(null===(e=t.product.brand)||void 0===e?void 0:e.name)||"",category:t.product.categories.map((function(t){return t.name})).join(" / "),variant:t.selectedVariant.variantValues.map((function(t){return t.name})).join(" / "),price:t.selectedVariant.price.finalPrice,quantity:o}}function a(t,o){return void 0===o&&(o=1),{name:t.variant.name,id:t.variant.id,price:""+t.finalPrice,brand:"",category:"",variant:t.variant.variantValues.map((function(t){return t.variantValueName})).join(" / "),quantity:o}}export{i as GoogleUniversal};
1
+ import{makeAutoObservable as t}from"mobx";import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as o}from"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";var e="undefined"==typeof window,i=function(){function i(){t(this)}return i.productView=function(t){try{return void(!e&&window.ga&&(window.ga("ec:addProduct",function(t,o){var e;return{id:t.selectedVariant.id,name:t.product.name,brand:(null===(e=t.product.brand)||void 0===e?void 0:e.name)||"",category:t.product.categories.map((function(t){return t.name})).join(" / "),variant:t.selectedVariant.variantValues.map((function(t){return t.name})).join(" / ")}}(t)),window.ga("ec:setAction","detail"),window.ga("send","pageview")))}catch(t){console.error(t)}},i.addToCart=function(t,i){try{return void(!e&&window.ga&&(window.ga("ec:addProduct",t instanceof o?r(t,i):a(t,i)),window.ga("ec:setAction","add"),window.ga("send","event","UX","click","add to cart")))}catch(t){console.error(t)}},i.removeFromCart=function(t,i){try{return void(!e&&window.ga&&(window.ga("ec:addProduct",t instanceof o?r(t,i):a(t,i)),window.ga("ec:setAction","remove"),window.ga("send","event","UX","click","add to cart")))}catch(t){console.error(t)}},i.purchase=function(t,o){var i,r,d;try{return void(!e&&window.ga&&(window.ga("set","currencyCode",null===(i=t.cart)||void 0===i?void 0:i.currencyCode),null===(r=t.cart)||void 0===r||r.items.map((function(t){return window.ga("ec:addProduct",a(t,t.quantity))})),window.ga("ec:setAction","purchase",{id:o,affiliation:window.location.hostname,revenue:""+t.totalFinalPrice,tax:""+(null===(d=t.cart)||void 0===d?void 0:d.totalTax),shipping:""+t.shippingTotal,coupon:t.couponCode}),window.ga("send","pageview")))}catch(t){console.error(t)}},i}();function r(t,o){var e;return void 0===o&&(o=1),{id:t.selectedVariant.id,name:t.product.name,brand:(null===(e=t.product.brand)||void 0===e?void 0:e.name)||"",category:t.product.categories.map((function(t){return t.name})).join(" / "),variant:t.selectedVariant.variantValues.map((function(t){return t.name})).join(" / "),price:t.selectedVariant.price.finalPrice,quantity:o}}function a(t,o){return void 0===o&&(o=1),{name:t.variant.name,id:t.variant.id,price:""+t.finalPrice,brand:"",category:"",variant:t.variant.variantValues.map((function(t){return t.variantValueName})).join(" / "),quantity:o}}export{i as GoogleUniversal};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as s}from'../ext/tslib/tslib.es6.js';import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"mobx";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import{IkasThemePageType as i}from"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{IkasStorefrontConfig as r}from"../storefront/index.js";import n from'../ext/uuid/dist/esm-browser/v4.js';var o,a;!function(t){t[t.SESSION_START=1]="SESSION_START",t[t.PAGE_VIEW=2]="PAGE_VIEW",t[t.PRODUCT_VIEW=3]="PRODUCT_VIEW",t[t.ADD_TO_CART=4]="ADD_TO_CART",t[t.VIEW_CART=5]="VIEW_CART",t[t.ORDER_SUCCESS=6]="ORDER_SUCCESS",t[t.BEGIN_CHECKOUT=7]="BEGIN_CHECKOUT",t[t.CHECKOUT_STEP=8]="CHECKOUT_STEP",t[t.CUSTOMER_REGISTER=9]="CUSTOMER_REGISTER",t[t.CUSTOMER_VISIT=10]="CUSTOMER_VISIT",t[t.CUSTOMER_LOGIN=11]="CUSTOMER_LOGIN",t[t.BRAND_VIEW=12]="BRAND_VIEW",t[t.CATEGORY_VIEW=13]="CATEGORY_VIEW"}(o||(o={})),function(t){t[t.INDEX=1]="INDEX",t[t.CATEGORY=2]="CATEGORY",t[t.BRAND=3]="BRAND",t[t.PRODUCT=4]="PRODUCT",t[t.CUSTOM=5]="CUSTOM",t[t.ACCOUNT=6]="ACCOUNT",t[t.ADDRESSES=7]="ADDRESSES",t[t.ORDERS=8]="ORDERS",t[t.ORDER_DETAIL=9]="ORDER_DETAIL",t[t.LOGIN=10]="LOGIN",t[t.REGISTER=11]="REGISTER",t[t.FORGOT_PASSWORD=12]="FORGOT_PASSWORD",t[t.RECOVER_PASSWORD=13]="RECOVER_PASSWORD",t[t.CART=14]="CART",t[t.FAVORITE_PRODUCTS=15]="FAVORITE_PRODUCTS",t[t.SEARCH=16]="SEARCH",t[t.NOT_FOUND=17]="NOT_FOUND",t[t.BLOG=18]="BLOG",t[t.BLOG_INDEX=19]="BLOG_INDEX",t[t.BLOG_CATEGORY=20]="BLOG_CATEGORY",t[t.CHECKOUT=21]="CHECKOUT"}(a||(a={}));var d=process.env.NEXT_PUBLIC_ANALYTICS_URL?"".concat(process.env.NEXT_PUBLIC_ANALYTICS_URL,"/sendEvent"):"https://0.myikas.com/sendEvent",u=function(){function u(){}return u.createSessionId=function(){return t(this,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t={id:n(),expiry:Date.now()+this.EXPIRY_LENGTH},localStorage.setItem(this.SESSION_ID_KEY,JSON.stringify(t)),this.sessionId=t.id,[4,this.sessionStart()];case 1:return e.sent(),[3,3];case 2:return s=e.sent(),console.error(s),[3,3];case 3:return[2]}}))}))},u.checkSessionId=function(){return t(this,void 0,void 0,(function(){var t,s,i;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,7,,8]),(t=localStorage.getItem(this.SESSION_ID_KEY))?(s=JSON.parse(t)).expiry<Date.now()?[4,this.createSessionId()]:[3,2]:[3,4];case 1:return e.sent(),[3,3];case 2:s.expiry=Date.now()+this.EXPIRY_LENGTH,localStorage.setItem(this.SESSION_ID_KEY,JSON.stringify(s)),this.sessionId=s.id,e.label=3;case 3:return[3,6];case 4:return[4,this.createSessionId()];case 5:e.sent(),e.label=6;case 6:return[3,8];case 7:return i=e.sent(),console.error(i),[3,8];case 8:return[2]}}))}))},u.checkVisitorId=function(){try{var t=localStorage.getItem(this.VISITOR_ID_KEY);t?this.visitorId=t:(this.visitorId=n(),localStorage.setItem(this.VISITOR_ID_KEY,this.visitorId))}catch(t){console.error(t)}},u.getPageType=function(t){switch(t){case i.INDEX:return a.INDEX;case i.CATEGORY:return a.CATEGORY;case i.BRAND:return a.BRAND;case i.PRODUCT:return a.PRODUCT;case i.CUSTOM:return a.CUSTOM;case i.ACCOUNT:return a.ACCOUNT;case i.ADDRESSES:return a.ADDRESSES;case i.ORDERS:return a.ORDERS;case i.ORDER_DETAIL:return a.ORDER_DETAIL;case i.LOGIN:return a.LOGIN;case i.REGISTER:return a.REGISTER;case i.FORGOT_PASSWORD:return a.FORGOT_PASSWORD;case i.RECOVER_PASSWORD:return a.RECOVER_PASSWORD;case i.CART:return a.CART;case i.FAVORITE_PRODUCTS:return a.FAVORITE_PRODUCTS;case i.SEARCH:return a.SEARCH;case i.NOT_FOUND:return a.NOT_FOUND;case i.BLOG:return a.BLOG;case i.BLOG_INDEX:return a.BLOG_INDEX;case i.BLOG_CATEGORY:return a.BLOG_CATEGORY;case i.CHECKOUT:return a.CHECKOUT}},u.getCustomerData=function(){var t=r.store.customerStore.customer;return{id:null==t?void 0:t.id,e:null==t?void 0:t.email,c:r.store.customerStore.customerConsentGranted}},u.getCommonEventData=function(){return{u:window.location.href,r:document.referrer,pt:r.store.currentPageType?this.getPageType(r.store.currentPageType):void 0}},u.sendEvents=function(s){var i;return t(this,void 0,void 0,(function(){var t,n;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,this.checkSessionId()];case 1:return e.sent(),this.checkVisitorId(),t={e:s,scid:r.salesChannelId,sfid:r.storefrontId,sid:this.sessionId,vid:this.visitorId,cid:null===(i=r.store.customerStore.customer)||void 0===i?void 0:i.id},[4,fetch(d,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json","x-api-key":r.config.apiKey}})];case 2:return e.sent(),[3,4];case 3:return n=e.sent(),console.error(n),[3,4];case 4:return[2]}}))}))},u.sessionStart=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.SESSION_START,ts:Date.now(),d:s({},this.getCommonEventData())},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.pageView=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.PAGE_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{pt:this.getPageType(i)})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.productView=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.PRODUCT_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{pr:{id:i.product.id,vid:i.selectedVariant.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.addToCart=function(i,r,n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.ADD_TO_CART,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{crt:{id:n.id,c:n.itemCount},crtItm:{id:i.id,c:r}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.viewCart=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.VIEW_CART,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{crt:{id:i.id,c:i.itemCount}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.orderSuccess=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.ORDER_SUCCESS,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{chk:{id:i.id,s:"success"}}})},[4,this.sendEvents([t])];case 1:return e.sent(),this.createSessionId(),[2]}}))}))},u.beginCheckout=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.BEGIN_CHECKOUT,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{chk:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.checkoutStep=function(i,r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CHECKOUT_STEP,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{chk:{id:i.id,s:r}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.customerRegister=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CUSTOMER_REGISTER,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.customerLogin=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CUSTOMER_LOGIN,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.customerVisit=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CUSTOMER_VISIT,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.viewBrand=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.BRAND_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData(),br:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.viewCategory=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CATEGORY_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData(),ctg:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},u.SESSION_ID_KEY="ikas_session_id",u.VISITOR_ID_KEY="ikas_visitor_id",u.EXPIRY_LENGTH=18e5,u}();export{u as default};
1
+ import{__awaiter as t,__generator as e,__assign as s}from'../ext/tslib/tslib.es6.js';import"../models/data/blog/index.js";import"../models/data/brand/index.js";import"../models/data/category/index.js";import"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"mobx";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/merchant-settings/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import{IkasThemePageType as i}from"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{IkasStorefrontConfig as r}from"../storefront/index.js";import n from'../ext/uuid/dist/esm-browser/v4.js';var o,a;!function(t){t[t.SESSION_START=1]="SESSION_START",t[t.PAGE_VIEW=2]="PAGE_VIEW",t[t.PRODUCT_VIEW=3]="PRODUCT_VIEW",t[t.ADD_TO_CART=4]="ADD_TO_CART",t[t.VIEW_CART=5]="VIEW_CART",t[t.ORDER_SUCCESS=6]="ORDER_SUCCESS",t[t.BEGIN_CHECKOUT=7]="BEGIN_CHECKOUT",t[t.CHECKOUT_STEP=8]="CHECKOUT_STEP",t[t.CUSTOMER_REGISTER=9]="CUSTOMER_REGISTER",t[t.CUSTOMER_VISIT=10]="CUSTOMER_VISIT",t[t.CUSTOMER_LOGIN=11]="CUSTOMER_LOGIN",t[t.BRAND_VIEW=12]="BRAND_VIEW",t[t.CATEGORY_VIEW=13]="CATEGORY_VIEW"}(o||(o={})),function(t){t[t.INDEX=1]="INDEX",t[t.CATEGORY=2]="CATEGORY",t[t.BRAND=3]="BRAND",t[t.PRODUCT=4]="PRODUCT",t[t.CUSTOM=5]="CUSTOM",t[t.ACCOUNT=6]="ACCOUNT",t[t.ADDRESSES=7]="ADDRESSES",t[t.ORDERS=8]="ORDERS",t[t.ORDER_DETAIL=9]="ORDER_DETAIL",t[t.LOGIN=10]="LOGIN",t[t.REGISTER=11]="REGISTER",t[t.FORGOT_PASSWORD=12]="FORGOT_PASSWORD",t[t.RECOVER_PASSWORD=13]="RECOVER_PASSWORD",t[t.CART=14]="CART",t[t.FAVORITE_PRODUCTS=15]="FAVORITE_PRODUCTS",t[t.SEARCH=16]="SEARCH",t[t.NOT_FOUND=17]="NOT_FOUND",t[t.BLOG=18]="BLOG",t[t.BLOG_INDEX=19]="BLOG_INDEX",t[t.BLOG_CATEGORY=20]="BLOG_CATEGORY",t[t.CHECKOUT=21]="CHECKOUT"}(a||(a={}));var d=process.env.NEXT_PUBLIC_ANALYTICS_URL?"".concat(process.env.NEXT_PUBLIC_ANALYTICS_URL,"/sendEvent"):"https://0.myikas.com/sendEvent",c=function(){function c(){}return c.createSessionId=function(){return t(this,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t={id:n(),expiry:Date.now()+this.EXPIRY_LENGTH},localStorage.setItem(this.SESSION_ID_KEY,JSON.stringify(t)),this.sessionId=t.id,[4,this.sessionStart()];case 1:return e.sent(),[3,3];case 2:return s=e.sent(),console.error(s),[3,3];case 3:return[2]}}))}))},c.checkSessionId=function(){return t(this,void 0,void 0,(function(){var t,s,i;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,7,,8]),(t=localStorage.getItem(this.SESSION_ID_KEY))?(s=JSON.parse(t)).expiry<Date.now()?[4,this.createSessionId()]:[3,2]:[3,4];case 1:return e.sent(),[3,3];case 2:s.expiry=Date.now()+this.EXPIRY_LENGTH,localStorage.setItem(this.SESSION_ID_KEY,JSON.stringify(s)),this.sessionId=s.id,e.label=3;case 3:return[3,6];case 4:return[4,this.createSessionId()];case 5:e.sent(),e.label=6;case 6:return[3,8];case 7:return i=e.sent(),console.error(i),[3,8];case 8:return[2]}}))}))},c.checkVisitorId=function(){try{var t=localStorage.getItem(this.VISITOR_ID_KEY);t?this.visitorId=t:(this.visitorId=n(),localStorage.setItem(this.VISITOR_ID_KEY,this.visitorId))}catch(t){console.error(t)}},c.getPageType=function(t){switch(t){case i.INDEX:return a.INDEX;case i.CATEGORY:return a.CATEGORY;case i.BRAND:return a.BRAND;case i.PRODUCT:return a.PRODUCT;case i.CUSTOM:return a.CUSTOM;case i.ACCOUNT:return a.ACCOUNT;case i.ADDRESSES:return a.ADDRESSES;case i.ORDERS:return a.ORDERS;case i.ORDER_DETAIL:return a.ORDER_DETAIL;case i.LOGIN:return a.LOGIN;case i.REGISTER:return a.REGISTER;case i.FORGOT_PASSWORD:return a.FORGOT_PASSWORD;case i.RECOVER_PASSWORD:return a.RECOVER_PASSWORD;case i.CART:return a.CART;case i.FAVORITE_PRODUCTS:return a.FAVORITE_PRODUCTS;case i.SEARCH:return a.SEARCH;case i.NOT_FOUND:return a.NOT_FOUND;case i.BLOG:return a.BLOG;case i.BLOG_INDEX:return a.BLOG_INDEX;case i.BLOG_CATEGORY:return a.BLOG_CATEGORY;case i.CHECKOUT:return a.CHECKOUT}},c.getCustomerData=function(){var t=r.store.customerStore.customer;return{id:null==t?void 0:t.id,e:null==t?void 0:t.email,c:r.store.customerStore.customerConsentGranted}},c.getCommonEventData=function(){return{u:window.location.href,r:document.referrer,pt:r.store.currentPageType?this.getPageType(r.store.currentPageType):void 0}},c.sendEvents=function(s){var i;return t(this,void 0,void 0,(function(){var t,n;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,this.checkSessionId()];case 1:return e.sent(),this.checkVisitorId(),t={e:s,scid:r.salesChannelId,sfid:r.storefrontId,sid:this.sessionId,vid:this.visitorId,cid:null===(i=r.store.customerStore.customer)||void 0===i?void 0:i.id},[4,fetch(d,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json","x-api-key":r.config.apiKey}})];case 2:return e.sent(),[3,4];case 3:return n=e.sent(),console.error(n),[3,4];case 4:return[2]}}))}))},c.sessionStart=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.SESSION_START,ts:Date.now(),d:s({},this.getCommonEventData())},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.pageView=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.PAGE_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{pt:this.getPageType(i)})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.productView=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.PRODUCT_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{pr:{id:i.product.id,vid:i.selectedVariant.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.addToCart=function(i,r,n){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.ADD_TO_CART,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{crt:{id:n.id,c:n.itemCount},crtItm:{id:i.id,c:r}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.viewCart=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.VIEW_CART,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{crt:{id:i.id,c:i.itemCount}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.orderSuccess=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.ORDER_SUCCESS,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{chk:{id:i.id,s:"success"}}})},[4,this.sendEvents([t])];case 1:return e.sent(),this.createSessionId(),[2]}}))}))},c.beginCheckout=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.BEGIN_CHECKOUT,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{chk:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.checkoutStep=function(i,r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CHECKOUT_STEP,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{chk:{id:i.id,s:r}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.customerRegister=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CUSTOMER_REGISTER,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.customerLogin=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CUSTOMER_LOGIN,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.customerVisit=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CUSTOMER_VISIT,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData()}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.viewBrand=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.BRAND_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData(),br:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.viewCategory=function(i){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return t={t:o.CATEGORY_VIEW,ts:Date.now(),d:s(s({},this.getCommonEventData()),{d:{cst:this.getCustomerData(),ctg:{id:i.id}}})},[4,this.sendEvents([t])];case 1:return e.sent(),[2]}}))}))},c.SESSION_ID_KEY="ikas_session_id",c.VISITOR_ID_KEY="ikas_visitor_id",c.EXPIRY_LENGTH=18e5,c}();export{c as default};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i,__makeTemplateObject as e}from'../../ext/tslib/tslib.es6.js';import o from'../../ext/graphql-tag/src/index.js';import{apollo as n}from"../apollo.js";import"../../models/data/blog/index.js";import{IkasBrand as r}from"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import{IkasImage as a}from"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";var d,s=function(){function s(){}return s.listBrands=function(s){return t(this,void 0,void 0,(function(){var t,m,l,p,u,c;return i(this,(function(i){switch(i.label){case 0:t=o(d||(d=e(["\n query listProductBrand(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listProductBrand(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n name\n description\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n }\n count\n }\n }\n "],["\n query listProductBrand(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listProductBrand(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n name\n description\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n }\n count\n }\n }\n "]))),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.getClient().query({query:t,variables:{id:(null==s?void 0:s.idList)&&s.idList.length?{in:s.idList}:void 0,pagination:(null==s?void 0:s.page)?{page:s.page,limit:s.limit||10}:void 0,search:null==s?void 0:s.search,sort:(null==s?void 0:s.sort)||null}})];case 2:return m=i.sent(),l=m.data,(p=m.errors)&&p.length?(console.log(p),[2,{brands:[],count:0}]):(u=l.listProductBrand.count,[2,{brands:l.listProductBrand.data.map((function(t){return new r({id:t.id,name:t.name,description:t.description,metaData:t.metaData||void 0,translations:t.translations,image:t.imageId?new a(t.imageId):void 0,orderType:t.orderType})})),count:u}]);case 3:return c=i.sent(),console.log(c),[2,{brands:[],count:0}];case 4:return[2]}}))}))},s}();export{s as IkasBrandAPI};
1
+ import{__awaiter as t,__generator as i,__makeTemplateObject as e}from'../../ext/tslib/tslib.es6.js';import o from'../../ext/graphql-tag/src/index.js';import{apollo as n}from"../apollo.js";import"../../models/data/blog/index.js";import{IkasBrand as r}from"../../models/data/brand/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import{IkasImage as a}from"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/merchant-settings/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";var d,s=function(){function s(){}return s.listBrands=function(s){return t(this,void 0,void 0,(function(){var t,m,l,p,u,c;return i(this,(function(i){switch(i.label){case 0:t=o(d||(d=e(["\n query listProductBrand(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listProductBrand(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n name\n description\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n }\n count\n }\n }\n "],["\n query listProductBrand(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listProductBrand(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n name\n description\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n }\n count\n }\n }\n "]))),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.getClient().query({query:t,variables:{id:(null==s?void 0:s.idList)&&s.idList.length?{in:s.idList}:void 0,pagination:(null==s?void 0:s.page)?{page:s.page,limit:s.limit||10}:void 0,search:null==s?void 0:s.search,sort:(null==s?void 0:s.sort)||null}})];case 2:return m=i.sent(),l=m.data,(p=m.errors)&&p.length?(console.log(p),[2,{brands:[],count:0}]):(u=l.listProductBrand.count,[2,{brands:l.listProductBrand.data.map((function(t){return new r({id:t.id,name:t.name,description:t.description,metaData:t.metaData||void 0,translations:t.translations,image:t.imageId?new a(t.imageId):void 0,orderType:t.orderType})})),count:u}]);case 3:return c=i.sent(),console.log(c),[2,{brands:[],count:0}];case 4:return[2]}}))}))},s}();export{s as IkasBrandAPI};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__makeTemplateObject as i}from'../../ext/tslib/tslib.es6.js';import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasCategory as n,IkasCategoryPath as a}from"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import{IkasImage as r}from"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import o from'../../ext/graphql-tag/src/index.js';import{apollo as s}from"../apollo.js";var d,l,m=function(){function m(){}return m.listCategories=function(a){return t(this,void 0,void 0,(function(){var t,l,m,p,u,c,g,j,h,v,x;return e(this,(function(f){switch(f.label){case 0:t=o(d||(d=i(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listCategory(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n parentId\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n categoryPath\n }\n count\n }\n }\n "],["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listCategory(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n parentId\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n categoryPath\n }\n count\n }\n }\n "]))),f.label=1;case 1:return f.trys.push([1,10,,11]),[4,s.getClient().query({query:t,variables:{id:(null==a?void 0:a.idList)&&a.idList.length?{in:a.idList}:void 0,pagination:(null==a?void 0:a.page)?{page:a.page,limit:a.limit||10}:void 0,search:null==a?void 0:a.search,sort:(null==a?void 0:a.sort)||null}})];case 2:if(l=f.sent(),m=l.data,(p=l.errors)&&p.length)return[2,{categories:[],count:0}];u=m.listCategory.count,c=m.listCategory.data.map((function(t){return new n({id:t.id,name:t.name,description:t.description,parentId:t.parentId,metaData:t.metaData||void 0,translations:t.translations,image:t.imageId?new r(t.imageId):void 0,orderType:t.orderType})})),f.label=3;case 3:f.trys.push([3,8,,9]),g=function(t){var i,n,a;return e(this,(function(e){switch(e.label){case 0:return(i=m.listCategory.data[t].categoryPath)&&i.length?(n=[],[4,j.listCategoryPaths({idList:i})]):[3,2];case 1:a=e.sent(),i.forEach((function(t){var e=a.find((function(e){return e.id===t}));e&&n.push(e)})),c[t].path=n,e.label=2;case 2:return[2]}}))},j=this,h=0,f.label=4;case 4:return h<m.listCategory.data.length?[5,g(h)]:[3,7];case 5:f.sent(),f.label=6;case 6:return h++,[3,4];case 7:return[3,9];case 8:return v=f.sent(),console.log(v),[3,9];case 9:return[2,{categories:c,count:u}];case 10:return x=f.sent(),console.log(x),[2,{categories:[],count:0}];case 11:return[2]}}))}))},m.listCategoryPaths=function(n){return t(this,void 0,void 0,(function(){var t,r,d,m,p,u;return e(this,(function(e){switch(e.label){case 0:t=o(l||(l=i(["\n query listCategoryPaths(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n ) {\n listCategory(id: $id, pagination: $pagination, search: $search) {\n data {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "],["\n query listCategoryPaths(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n ) {\n listCategory(id: $id, pagination: $pagination, search: $search) {\n data {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s.getClient().query({query:t,variables:{id:(null==n?void 0:n.idList)&&n.idList.length?{in:n.idList}:void 0,pagination:(null==n?void 0:n.page)?{page:n.page,limit:n.limit||10}:void 0,search:null==n?void 0:n.search}})];case 2:return r=e.sent(),d=r.data,(m=r.errors)&&m.length?[2,[]]:(p=d.listCategory.data.map((function(t){var e;return new a({id:t.id,name:t.name,slug:null===(e=t.metaData)||void 0===e?void 0:e.slug})})),[2,p]);case 3:return u=e.sent(),console.log(u),[2,[]];case 4:return[2]}}))}))},m}();export{m as IkasCategoryAPI};
1
+ import{__awaiter as t,__generator as e,__makeTemplateObject as i}from'../../ext/tslib/tslib.es6.js';import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasCategory as n,IkasCategoryPath as a}from"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import{IkasImage as r}from"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/merchant-settings/index.js";import"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import o from'../../ext/graphql-tag/src/index.js';import{apollo as s}from"../apollo.js";var d,l,m=function(){function m(){}return m.listCategories=function(a){return t(this,void 0,void 0,(function(){var t,l,m,p,u,c,g,j,h,v,x;return e(this,(function(f){switch(f.label){case 0:t=o(d||(d=i(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listCategory(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n parentId\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n categoryPath\n }\n count\n }\n }\n "],["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n $sort: String\n ) {\n listCategory(\n id: $id\n pagination: $pagination\n search: $search\n sort: $sort\n ) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n description\n parentId\n imageId\n orderType\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n translations {\n description\n locale\n pageTitle\n }\n }\n translations {\n description\n locale\n name\n }\n categoryPath\n }\n count\n }\n }\n "]))),f.label=1;case 1:return f.trys.push([1,10,,11]),[4,s.getClient().query({query:t,variables:{id:(null==a?void 0:a.idList)&&a.idList.length?{in:a.idList}:void 0,pagination:(null==a?void 0:a.page)?{page:a.page,limit:a.limit||10}:void 0,search:null==a?void 0:a.search,sort:(null==a?void 0:a.sort)||null}})];case 2:if(l=f.sent(),m=l.data,(p=l.errors)&&p.length)return[2,{categories:[],count:0}];u=m.listCategory.count,c=m.listCategory.data.map((function(t){return new n({id:t.id,name:t.name,description:t.description,parentId:t.parentId,metaData:t.metaData||void 0,translations:t.translations,image:t.imageId?new r(t.imageId):void 0,orderType:t.orderType})})),f.label=3;case 3:f.trys.push([3,8,,9]),g=function(t){var i,n,a;return e(this,(function(e){switch(e.label){case 0:return(i=m.listCategory.data[t].categoryPath)&&i.length?(n=[],[4,j.listCategoryPaths({idList:i})]):[3,2];case 1:a=e.sent(),i.forEach((function(t){var e=a.find((function(e){return e.id===t}));e&&n.push(e)})),c[t].path=n,e.label=2;case 2:return[2]}}))},j=this,h=0,f.label=4;case 4:return h<m.listCategory.data.length?[5,g(h)]:[3,7];case 5:f.sent(),f.label=6;case 6:return h++,[3,4];case 7:return[3,9];case 8:return v=f.sent(),console.log(v),[3,9];case 9:return[2,{categories:c,count:u}];case 10:return x=f.sent(),console.log(x),[2,{categories:[],count:0}];case 11:return[2]}}))}))},m.listCategoryPaths=function(n){return t(this,void 0,void 0,(function(){var t,r,d,m,p,u;return e(this,(function(e){switch(e.label){case 0:t=o(l||(l=i(["\n query listCategoryPaths(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n ) {\n listCategory(id: $id, pagination: $pagination, search: $search) {\n data {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "],["\n query listCategoryPaths(\n $id: StringFilterInput\n $pagination: PaginationInput\n $search: String\n ) {\n listCategory(id: $id, pagination: $pagination, search: $search) {\n data {\n id\n name\n metaData {\n slug\n }\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s.getClient().query({query:t,variables:{id:(null==n?void 0:n.idList)&&n.idList.length?{in:n.idList}:void 0,pagination:(null==n?void 0:n.page)?{page:n.page,limit:n.limit||10}:void 0,search:null==n?void 0:n.search}})];case 2:return r=e.sent(),d=r.data,(m=r.errors)&&m.length?[2,[]]:(p=d.listCategory.data.map((function(t){var e;return new a({id:t.id,name:t.name,slug:null===(e=t.metaData)||void 0===e?void 0:e.slug})})),[2,p]);case 3:return u=e.sent(),console.log(u),[2,[]];case 4:return[2]}}))}))},m}();export{m as IkasCategoryAPI};
@@ -1 +1 @@
1
- import{__awaiter as n,__generator as e,__makeTemplateObject as t}from'../../ext/tslib/tslib.es6.js';import i from'../../ext/graphql-tag/src/index.js';import{apollo as a}from"../apollo.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import{IkasCheckout as r}from"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasOrder as o}from"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasPaymentGateway as d}from"../../models/data/payment-gateway/index.js";import{IkasStorefrontConfig as s}from"../../storefront/index.js";import{IkasCheckoutSettings as c}from"../../models/data/checkout-settings/index.js";var u,l,m,p,g,h,y,I,f,v,C=function(){function C(){}return C.getCheckoutId=function(r){return n(this,void 0,void 0,(function(){var n,o,d,s,c;return e(this,(function(e){switch(e.label){case 0:n=i(u||(u=t(["\n query getCheckoutByCartId($cartId: String!) {\n getCheckoutByCartId(cartId: $cartId) {\n id\n }\n }\n "],["\n query getCheckoutByCartId($cartId: String!) {\n getCheckoutByCartId(cartId: $cartId) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{cartId:r}})];case 2:return o=e.sent(),d=o.data,(s=o.errors)&&s.length&&console.log(s),d?[2,d.getCheckoutByCartId.id]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getCheckoutById=function(o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(l||(l=t(["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n iso2\n iso3\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "],["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n iso2\n iso3\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{id:o}})];case 2:return d=e.sent(),s=d.data,(c=d.errors)&&c.length&&console.log(c),s?[2,new r(s.getCheckoutById)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.getOrder=function(r){return n(this,void 0,void 0,(function(){var n,d,s;return e(this,(function(e){switch(e.label){case 0:n=i(m||(m=t(["\n query getOrder($orderId: String!) {\n getOrder(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getOrder($orderId: String!) {\n getOrder(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{orderId:r}})];case 2:return d=e.sent(),(s=d.data)&&s.getOrder?[2,new o(s.getOrder)]:[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},C.saveCheckout=function(r){var o,d,s,c;return n(this,void 0,void 0,(function(){var n,u,l,m,g;return e(this,(function(e){switch(e.label){case 0:n=i(p||(p=t(["\n mutation saveCheckout($input: SaveCheckoutInput!) {\n saveCheckout(input: $input) {\n id\n }\n }\n "],["\n mutation saveCheckout($input: SaveCheckoutInput!) {\n saveCheckout(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:{id:r.id,cartId:r.cartId,shippingMethod:r.shippingMethod,shippingSettingsId:r.shippingSettingsId,shippingZoneRateId:r.shippingZoneRateId,billingAddress:r.billingAddress&&r.billingAddress.addressLine1?{id:r.billingAddress.id,addressLine1:r.billingAddress.addressLine1||"",addressLine2:r.billingAddress.addressLine2||null,city:r.billingAddress.city,country:r.billingAddress.country,state:r.billingAddress.state,district:r.billingAddress.district||null,firstName:r.billingAddress.firstName,lastName:r.billingAddress.lastName,postalCode:r.billingAddress.postalCode,company:r.billingAddress.company||null,phone:r.billingAddress.phone||null,taxNumber:r.billingAddress.taxNumber||null,taxOffice:r.billingAddress.taxOffice||null,isDefault:r.billingAddress.isDefault||!1,identityNumber:r.billingAddress.identityNumber||null}:null,shippingAddress:r.shippingAddress&&r.shippingAddress.addressLine1?{id:r.shippingAddress.id,addressLine1:r.shippingAddress.addressLine1||"",addressLine2:r.shippingAddress.addressLine2||null,city:r.shippingAddress.city,country:r.shippingAddress.country,state:r.shippingAddress.state,district:r.shippingAddress.district||null,firstName:r.shippingAddress.firstName,lastName:r.shippingAddress.lastName,postalCode:r.shippingAddress.postalCode,company:r.shippingAddress.company||null,phone:r.shippingAddress.phone||null,taxNumber:r.shippingAddress.taxNumber||null,taxOffice:r.shippingAddress.taxOffice||null,isDefault:r.shippingAddress.isDefault||!1,identityNumber:r.shippingAddress.identityNumber||null}:null,couponCode:r.couponCode||null,customer:r.customer?{id:null===(o=r.customer)||void 0===o?void 0:o.id,email:null===(d=r.customer)||void 0===d?void 0:d.email,firstName:null===(s=r.customer)||void 0===s?void 0:s.firstName,lastName:null===(c=r.customer)||void 0===c?void 0:c.lastName,notificationsAccepted:r.customer.notificationsAccepted||!1}:null,note:r.note,isGiftPackage:r.isGiftPackage,giftPackageNote:r.giftPackageNote}}})];case 2:return u=e.sent(),l=u.data,m=u.errors,[2,{data:(null==l?void 0:l.saveCheckout.id)||void 0,errors:m}];case 3:return g=e.sent(),console.log(g),g&&g.graphQLErrors?[2,{data:void 0,errors:g.graphQLErrors}]:[3,4];case 4:return[2]}}))}))},C.createSaleTransactionWithCheckout=function(r,o,d){return n(this,void 0,void 0,(function(){var n,s,c,u,l;return e(this,(function(e){switch(e.label){case 0:n=i(g||(g=t(["\n mutation createSaleTransactionWithCheckout(\n $input: CreateSaleTransactionWithCheckoutInput!\n ) {\n createSaleTransactionWithCheckout(input: $input) {\n orderId\n orderNumber\n transactionId\n transactionStatus\n returnSlug\n error {\n code\n declineCode\n message\n }\n }\n }\n "],["\n mutation createSaleTransactionWithCheckout(\n $input: CreateSaleTransactionWithCheckoutInput!\n ) {\n createSaleTransactionWithCheckout(input: $input) {\n orderId\n orderNumber\n transactionId\n transactionStatus\n returnSlug\n error {\n code\n declineCode\n message\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:{checkoutId:r,paymentGatewayId:o,paymentMethodDetail:d}}})];case 2:return s=e.sent(),c=s.data,(u=s.errors)&&u.length?[2]:c?[2,c.createSaleTransactionWithCheckout]:[3,4];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},C.listPaymentGateway=function(r){return n(this,void 0,void 0,(function(){var n,o,c,u,l;return e(this,(function(e){switch(e.label){case 0:n=i(h||(h=t(["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n availableCountries\n }\n }\n "],["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n availableCountries\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{id:r?{in:r}:void 0,locale:s.getCurrentLocale()}})];case 2:return o=e.sent(),c=o.data,(u=o.errors)&&u.length&&console.log(u),c?[2,c.listPaymentGateway.map((function(n){return new d(n)}))]:[3,4];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},C.retrieveInstallmentInfo=function(r){return n(this,void 0,void 0,(function(){var n,o,d,s,c;return e(this,(function(e){switch(e.label){case 0:n=i(y||(y=t(["\n mutation retrieveInstallmentInfo($input: RetrieveInstallmentInfoInput!) {\n retrieveInstallmentInfo(input: $input) {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installmentPrices {\n totalPrice\n installmentPrice\n installmentCount\n }\n price\n }\n }\n "],["\n mutation retrieveInstallmentInfo($input: RetrieveInstallmentInfoInput!) {\n retrieveInstallmentInfo(input: $input) {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installmentPrices {\n totalPrice\n installmentPrice\n installmentCount\n }\n price\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:r}})];case 2:return o=e.sent(),d=o.data,(s=o.errors)&&s.length&&console.log(s),d?[2,d.retrieveInstallmentInfo]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.checkStocks=function(r,o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(I||(I=t(["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "],["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{lines:r,stockLocationIdList:o.length?o:null}})];case 2:return d=e.sent(),s=d.data,(c=d.errors)&&c.length&&console.log(c),s?[2,s.checkStocks]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.listCheckoutSettings=function(){return n(this,void 0,void 0,(function(){var n,r,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=i(f||(f=t(["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showCheckoutNote\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n isGiftPackageEnabled\n giftPackagePriceList {\n currencyCode\n price\n }\n postalCodeRequirement\n }\n }\n "],["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showCheckoutNote\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n isGiftPackageEnabled\n giftPackagePriceList {\n currencyCode\n price\n }\n postalCodeRequirement\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{storefrontId:{eq:s.storefrontId}}})];case 2:return r=e.sent(),o=r.data,(d=r.errors)&&d.length&&console.log(d),o?[2,o.listCheckoutSettings.map((function(n){return new c(n)}))]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.addCouponCodeToCheckout=function(r,o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(v||(v=t(["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "],["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{checkoutId:r,couponCode:o}})];case 2:return d=e.sent(),s=d.data,c=d.errors,[2,{data:s.addCouponCodeToCheckout.id,errors:c}];case 3:return u=e.sent(),console.log(u),u&&u.graphQLErrors?[2,{data:void 0,errors:u.graphQLErrors}]:[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCheckoutAPI};
1
+ import{__awaiter as n,__generator as e,__makeTemplateObject as t}from'../../ext/tslib/tslib.es6.js';import i from'../../ext/graphql-tag/src/index.js';import{apollo as a}from"../apollo.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/category/index.js";import{IkasCheckout as r}from"../../models/data/checkout/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-review/index.js";import"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import"../../models/data/merchant-settings/index.js";import{IkasOrder as o}from"../../models/data/order/index.js";import"../../models/data/order/line-item/index.js";import"../product-option-file/index.js";import"../../models/data/product/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product-attribute/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/data/order-transaction/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/product-campaing/campaign/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{IkasPaymentGateway as d}from"../../models/data/payment-gateway/index.js";import{IkasStorefrontConfig as s}from"../../storefront/index.js";import{IkasCheckoutSettings as c}from"../../models/data/checkout-settings/index.js";var u,l,m,p,g,h,y,I,f,v,C=function(){function C(){}return C.getCheckoutId=function(r){return n(this,void 0,void 0,(function(){var n,o,d,s,c;return e(this,(function(e){switch(e.label){case 0:n=i(u||(u=t(["\n query getCheckoutByCartId($cartId: String!) {\n getCheckoutByCartId(cartId: $cartId) {\n id\n }\n }\n "],["\n query getCheckoutByCartId($cartId: String!) {\n getCheckoutByCartId(cartId: $cartId) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{cartId:r}})];case 2:return o=e.sent(),d=o.data,(s=o.errors)&&s.length&&console.log(s),d?[2,d.getCheckoutByCartId.id]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.getCheckoutById=function(o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(l||(l=t(["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n iso2\n iso3\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "],["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n iso2\n iso3\n }\n district {\n code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n iso2\n iso3\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{id:o}})];case 2:return d=e.sent(),s=d.data,(c=d.errors)&&c.length&&console.log(c),s?[2,new r(s.getCheckoutById)]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.getOrder=function(r){return n(this,void 0,void 0,(function(){var n,d,s;return e(this,(function(e){switch(e.label){case 0:n=i(m||(m=t(["\n query getOrder($orderId: String!) {\n getOrder(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "],["\n query getOrder($orderId: String!) {\n getOrder(orderId: $orderId) {\n billingAddress {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n name\n id\n code\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n cancelledAt\n cancelReason\n createdAt\n currencyCode\n currencyRates {\n rate\n originalRate\n code\n }\n customer {\n lastName\n firstName\n email\n id\n }\n deleted\n id\n merchantId\n note\n orderedAt\n orderAdjustments {\n type\n order\n name\n amountType\n amount\n }\n orderLineItems {\n createdAt\n currencyCode\n deleted\n discount {\n reason\n amountType\n amount\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n variantValueName\n variantValueId\n variantTypeName\n variantTypeId\n order\n }\n }\n options {\n name\n productOptionId\n productOptionsSetId\n type\n values {\n name\n price\n value\n }\n }\n }\n orderNumber\n orderPackages {\n updatedAt\n trackingInfo {\n trackingNumber\n trackingLink\n isSendNotification\n cargoCompany\n }\n stockLocationId\n orderPackageNumber\n orderPackageFulfillStatus\n orderLineItemIds\n id\n deleted\n createdAt\n }\n orderPackageStatus\n orderPaymentStatus\n orderTagIds\n shippingAddress {\n taxOffice\n taxNumber\n state {\n name\n id\n code\n }\n postalCode\n phone\n lastName\n isDefault\n identityNumber\n firstName\n district {\n name\n id\n code\n }\n country {\n name\n id\n code\n }\n company\n city {\n id\n code\n name\n }\n addressLine2\n addressLine1\n }\n shippingLines {\n title\n taxValue\n price\n }\n shippingMethod\n status\n taxLines {\n rate\n price\n }\n totalFinalPrice\n totalPrice\n updatedAt\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{orderId:r}})];case 2:return d=e.sent(),(s=d.data)&&s.getOrder?[2,new o(s.getOrder)]:[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},C.saveCheckout=function(r){var o,d,s,c;return n(this,void 0,void 0,(function(){var n,u,l,m,g;return e(this,(function(e){switch(e.label){case 0:n=i(p||(p=t(["\n mutation saveCheckout($input: SaveCheckoutInput!) {\n saveCheckout(input: $input) {\n id\n }\n }\n "],["\n mutation saveCheckout($input: SaveCheckoutInput!) {\n saveCheckout(input: $input) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:{id:r.id,cartId:r.cartId,shippingMethod:r.shippingMethod,shippingSettingsId:r.shippingSettingsId,shippingZoneRateId:r.shippingZoneRateId,billingAddress:r.billingAddress&&r.billingAddress.addressLine1?{id:r.billingAddress.id,addressLine1:r.billingAddress.addressLine1||"",addressLine2:r.billingAddress.addressLine2||null,city:r.billingAddress.city,country:r.billingAddress.country,state:r.billingAddress.state,district:r.billingAddress.district||null,firstName:r.billingAddress.firstName,lastName:r.billingAddress.lastName,postalCode:r.billingAddress.postalCode,company:r.billingAddress.company||null,phone:r.billingAddress.phone||null,taxNumber:r.billingAddress.taxNumber||null,taxOffice:r.billingAddress.taxOffice||null,isDefault:r.billingAddress.isDefault||!1,identityNumber:r.billingAddress.identityNumber||null}:null,shippingAddress:r.shippingAddress&&r.shippingAddress.addressLine1?{id:r.shippingAddress.id,addressLine1:r.shippingAddress.addressLine1||"",addressLine2:r.shippingAddress.addressLine2||null,city:r.shippingAddress.city,country:r.shippingAddress.country,state:r.shippingAddress.state,district:r.shippingAddress.district||null,firstName:r.shippingAddress.firstName,lastName:r.shippingAddress.lastName,postalCode:r.shippingAddress.postalCode,company:r.shippingAddress.company||null,phone:r.shippingAddress.phone||null,taxNumber:r.shippingAddress.taxNumber||null,taxOffice:r.shippingAddress.taxOffice||null,isDefault:r.shippingAddress.isDefault||!1,identityNumber:r.shippingAddress.identityNumber||null}:null,couponCode:r.couponCode||null,customer:r.customer?{id:null===(o=r.customer)||void 0===o?void 0:o.id,email:null===(d=r.customer)||void 0===d?void 0:d.email,firstName:null===(s=r.customer)||void 0===s?void 0:s.firstName,lastName:null===(c=r.customer)||void 0===c?void 0:c.lastName,notificationsAccepted:r.customer.notificationsAccepted||!1}:null,note:r.note,isGiftPackage:r.isGiftPackage,giftPackageNote:r.giftPackageNote}}})];case 2:return u=e.sent(),l=u.data,m=u.errors,[2,{data:(null==l?void 0:l.saveCheckout.id)||void 0,errors:m}];case 3:return g=e.sent(),console.log(g),g&&g.graphQLErrors?[2,{data:void 0,errors:g.graphQLErrors}]:[3,4];case 4:return[2]}}))}))},C.createSaleTransactionWithCheckout=function(r,o,d){return n(this,void 0,void 0,(function(){var n,s,c,u,l;return e(this,(function(e){switch(e.label){case 0:n=i(g||(g=t(["\n mutation createSaleTransactionWithCheckout(\n $input: CreateSaleTransactionWithCheckoutInput!\n ) {\n createSaleTransactionWithCheckout(input: $input) {\n orderId\n orderNumber\n transactionId\n transactionStatus\n returnSlug\n error {\n code\n declineCode\n message\n }\n }\n }\n "],["\n mutation createSaleTransactionWithCheckout(\n $input: CreateSaleTransactionWithCheckoutInput!\n ) {\n createSaleTransactionWithCheckout(input: $input) {\n orderId\n orderNumber\n transactionId\n transactionStatus\n returnSlug\n error {\n code\n declineCode\n message\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:{checkoutId:r,paymentGatewayId:o,paymentMethodDetail:d}}})];case 2:return s=e.sent(),c=s.data,(u=s.errors)&&u.length?[2]:c?[2,c.createSaleTransactionWithCheckout]:[3,4];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},C.listPaymentGateway=function(r){return n(this,void 0,void 0,(function(){var n,o,c,u,l;return e(this,(function(e){switch(e.label){case 0:n=i(h||(h=t(["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n availableCountries\n }\n }\n "],["\n query listPaymentGateway($id: StringFilterInput, $locale: String) {\n listPaymentGateway(id: $id, locale: $locale) {\n paymentMethods {\n name\n logoUrl\n }\n paymentMethodType\n id\n name\n description\n testMode\n code\n type\n logoUrl\n additionalPrices {\n amount\n amountType\n name\n type\n }\n translations {\n description\n locale\n name\n }\n supportedCurrencies\n availableCountries\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{id:r?{in:r}:void 0,locale:s.getCurrentLocale()}})];case 2:return o=e.sent(),c=o.data,(u=o.errors)&&u.length&&console.log(u),c?[2,c.listPaymentGateway.map((function(n){return new d(n)}))]:[3,4];case 3:return l=e.sent(),console.log(l),[3,4];case 4:return[2]}}))}))},C.retrieveInstallmentInfo=function(r){return n(this,void 0,void 0,(function(){var n,o,d,s,c;return e(this,(function(e){switch(e.label){case 0:n=i(y||(y=t(["\n mutation retrieveInstallmentInfo($input: RetrieveInstallmentInfoInput!) {\n retrieveInstallmentInfo(input: $input) {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installmentPrices {\n totalPrice\n installmentPrice\n installmentCount\n }\n price\n }\n }\n "],["\n mutation retrieveInstallmentInfo($input: RetrieveInstallmentInfoInput!) {\n retrieveInstallmentInfo(input: $input) {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installmentPrices {\n totalPrice\n installmentPrice\n installmentCount\n }\n price\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().mutate({mutation:n,variables:{input:r}})];case 2:return o=e.sent(),d=o.data,(s=o.errors)&&s.length&&console.log(s),d?[2,d.retrieveInstallmentInfo]:[3,4];case 3:return c=e.sent(),console.log(c),[3,4];case 4:return[2]}}))}))},C.checkStocks=function(r,o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(I||(I=t(["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "],["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{lines:r,stockLocationIdList:o.length?o:null}})];case 2:return d=e.sent(),s=d.data,(c=d.errors)&&c.length&&console.log(c),s?[2,s.checkStocks]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.listCheckoutSettings=function(){return n(this,void 0,void 0,(function(){var n,r,o,d,u;return e(this,(function(e){switch(e.label){case 0:n=i(f||(f=t(["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showCheckoutNote\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n isGiftPackageEnabled\n giftPackagePriceList {\n currencyCode\n price\n }\n postalCodeRequirement\n }\n }\n "],["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showCheckoutNote\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n isGiftPackageEnabled\n giftPackagePriceList {\n currencyCode\n price\n }\n postalCodeRequirement\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{storefrontId:{eq:s.storefrontId}}})];case 2:return r=e.sent(),o=r.data,(d=r.errors)&&d.length&&console.log(d),o?[2,o.listCheckoutSettings.map((function(n){return new c(n)}))]:[3,4];case 3:return u=e.sent(),console.log(u),[3,4];case 4:return[2]}}))}))},C.addCouponCodeToCheckout=function(r,o){return n(this,void 0,void 0,(function(){var n,d,s,c,u;return e(this,(function(e){switch(e.label){case 0:n=i(v||(v=t(["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "],["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "]))),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.getClient().query({query:n,variables:{checkoutId:r,couponCode:o}})];case 2:return d=e.sent(),s=d.data,c=d.errors,[2,{data:s.addCouponCodeToCheckout.id,errors:c}];case 3:return u=e.sent(),console.log(u),u&&u.graphQLErrors?[2,{data:void 0,errors:u.graphQLErrors}]:[3,4];case 4:return[2]}}))}))},C}();export{C as IkasCheckoutAPI};