@ikas/storefront 5.0.13 → 5.0.15

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 (169) hide show
  1. package/build/analytics/analytics.d.ts +2 -1
  2. package/build/analytics/analytics.js +1 -1
  3. package/build/analytics/events.d.ts +2 -1
  4. package/build/analytics/events.js +1 -1
  5. package/build/analytics/googleAnalytics.js +1 -1
  6. package/build/analytics/googleTagManager.js +1 -1
  7. package/build/analytics/ikas.d.ts +3 -1
  8. package/build/analytics/ikas.js +1 -1
  9. package/build/components/checkout/components/address-form/model.js +1 -1
  10. package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
  11. package/build/components/checkout/components/customer-addresses/model.js +1 -1
  12. package/build/components/checkout/components/offer-product/index.js +1 -1
  13. package/build/components/checkout/components/quick-registration/model.js +1 -1
  14. package/build/components/checkout/index.js +1 -1
  15. package/build/components/checkout/model.d.ts +1 -0
  16. package/build/components/checkout/model.js +1 -1
  17. package/build/components/checkout/steps/step-payment/billing-address/index.js +1 -1
  18. package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
  19. package/build/components/checkout/steps/step-success/index.js +1 -1
  20. package/build/components/page/head.js +1 -1
  21. package/build/components/page/index.js +1 -1
  22. package/build/components/page-editor/ThemeComponentEditor.js +1 -1
  23. package/build/components/page-editor/model.js +1 -1
  24. package/build/components/popup/index.js +1 -1
  25. package/build/components/popup/renderer/index.d.ts +0 -3
  26. package/build/components/popup/renderer/index.js +1 -1
  27. package/build/components/popup/renderer/model.d.ts +5 -2
  28. package/build/components/popup/renderer/model.js +1 -1
  29. package/build/components/popup/utils/index.d.ts +5 -1
  30. package/build/components/popup/utils/index.js +1 -1
  31. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouType.js +1 -0
  32. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js +1 -0
  33. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js +1 -0
  34. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.complete.js +1 -0
  35. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.js +1 -0
  36. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.util.js +1 -0
  37. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeParser.js +1 -0
  38. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeState.js +1 -0
  39. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/ParseError.js +1 -0
  40. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/PhoneNumber.js +1 -0
  41. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/PhoneNumberMatcher.js +1 -0
  42. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/constants.js +1 -0
  43. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/LRUCache.js +1 -0
  44. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/Leniency.js +1 -0
  45. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/RegExpCache.js +1 -0
  46. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/isValidCandidate.js +1 -0
  47. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/isValidPreCandidate.js +1 -0
  48. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +1 -0
  49. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/parsePreCandidate.js +1 -0
  50. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/utf-8.js +1 -0
  51. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/util.js +1 -0
  52. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/format.js +1 -0
  53. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/RFC3966.js +1 -0
  54. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +1 -0
  55. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/checkNumberLength.js +1 -0
  56. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +1 -0
  57. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extension/extractExtension.js +1 -0
  58. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +1 -0
  59. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +1 -0
  60. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +1 -0
  61. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractNationalNumber.js +1 -0
  62. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +1 -0
  63. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/extractPhoneContext.js +1 -0
  64. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +1 -0
  65. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +1 -0
  66. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +1 -0
  67. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getIddPrefix.js +1 -0
  68. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getNumberType.js +1 -0
  69. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +1 -0
  70. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/isObject.js +1 -0
  71. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +1 -0
  72. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/matchesEntirely.js +1 -0
  73. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/mergeArrays.js +1 -0
  74. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/parseDigits.js +1 -0
  75. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/helpers/stripIddPrefix.js +1 -0
  76. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/isPossible.js +1 -0
  77. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/isValid.js +1 -0
  78. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/isValidPhoneNumber.js +1 -0
  79. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/legacy/findPhoneNumbersInitialImplementation.js +1 -0
  80. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/metadata.js +1 -0
  81. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/normalizeArguments.js +1 -0
  82. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parse.js +1 -0
  83. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parseIncompletePhoneNumber.js +1 -0
  84. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parsePhoneNumber.js +1 -0
  85. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parsePhoneNumberWithError_.js +1 -0
  86. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/parsePhoneNumber_.js +1 -0
  87. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/tools/semver-compare.js +1 -0
  88. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/index.es6.exports/PhoneNumberSearch.js +1 -0
  89. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/metadata.min.json.js +1 -0
  90. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/AsYouType.js +1 -0
  91. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/Metadata.js +1 -0
  92. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/PhoneNumberMatcher.js +1 -0
  93. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/isValidPhoneNumber.js +1 -0
  94. package/build/ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/withMetadataArgument.js +1 -0
  95. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/button-element-renderer/index.js +1 -1
  96. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/divider-element-renderer/index.js +1 -1
  97. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/checkbox-item-view/index.js +1 -1
  98. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/index.js +1 -1
  99. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/form-element-renderer/input-item-view/index.js +1 -1
  100. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-column-element-renderer/index.js +1 -1
  101. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/image-element-renderer/index.js +1 -1
  102. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/index.js +1 -1
  103. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/product-list-renderer/index.js +1 -1
  104. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/social-element-renderer/index.js +1 -1
  105. package/build/ext/@ikas/popup-renderer/build/popup-renderer/components/text-element-renderer/index.js +1 -1
  106. package/build/ext/@ikas/popup-renderer/build/popup-renderer/helpers/index.js +1 -1
  107. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js +1 -1
  108. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js +1 -1
  109. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js +1 -1
  110. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js +1 -1
  111. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js +1 -1
  112. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-email/index.js +1 -1
  113. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-phone/index.js +1 -1
  114. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js +1 -1
  115. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js +1 -1
  116. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js +1 -1
  117. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js +1 -1
  118. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js +1 -1
  119. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js +1 -1
  120. package/build/ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js +1 -1
  121. package/build/hooks/useCustomerReviews.js +1 -1
  122. package/build/hooks/useStore.js +1 -1
  123. package/build/index.js +1 -1
  124. package/build/models/data/checkout-settings/index.d.ts +2 -1
  125. package/build/models/data/checkout-settings/index.js +1 -1
  126. package/build/models/data/index.d.ts +7 -0
  127. package/build/models/data/product/campaign/data/index.d.ts +2 -0
  128. package/build/models/data/product/campaign/data/index.js +1 -1
  129. package/build/models/data/product/campaign/product-tiered-discount/index.d.ts +20 -0
  130. package/build/models/data/product/campaign/product-tiered-discount/index.js +1 -0
  131. package/build/models/data/product/index.d.ts +1 -0
  132. package/build/models/data/product/index.js +1 -1
  133. package/build/models/data/product/variant/index.d.ts +33 -0
  134. package/build/models/data/product/variant/index.js +1 -1
  135. package/build/models/data/storefront-popup/index.d.ts +1 -1
  136. package/build/models/data/storefront-popup/index.js +1 -1
  137. package/build/models/data/storefront-popup/storefront-popup-page-filter/index.d.ts +3 -1
  138. package/build/models/data/storefront-popup/storefront-popup-page-filter/index.js +1 -1
  139. package/build/models/ui/blog-category-list/index.js +1 -1
  140. package/build/models/ui/brand-list/index.js +1 -1
  141. package/build/models/ui/category-list/index.js +1 -1
  142. package/build/models/ui/customer-review-list/index.d.ts +1 -1
  143. package/build/models/ui/customer-review-list/index.js +1 -1
  144. package/build/models/ui/customer-review-summary-list/index.js +1 -1
  145. package/build/models/ui/product-list/index.js +1 -1
  146. package/build/models/ui/raffle-list/index.js +1 -1
  147. package/build/models/ui/validator/form/account-info.js +1 -1
  148. package/build/models/ui/validator/form/address.js +1 -1
  149. package/build/models/ui/validator/form/ikas-address.js +1 -1
  150. package/build/models/ui/validator/form/register.js +1 -1
  151. package/build/page-data-init/index.js +1 -1
  152. package/build/pages/checkout.js +1 -1
  153. package/build/pages/pages/_slug_.js +1 -1
  154. package/build/store/blog/index.js +1 -1
  155. package/build/store/brand/index.js +1 -1
  156. package/build/store/cart/index.js +1 -1
  157. package/build/store/category/index.js +1 -1
  158. package/build/store/checkout/index.js +1 -1
  159. package/build/store/customer/api.js +1 -1
  160. package/build/store/customer/index.js +1 -1
  161. package/build/store/html-meta-data/index.js +1 -1
  162. package/build/store/location/index.js +1 -1
  163. package/build/store/product/index.js +1 -1
  164. package/package.json +12 -12
  165. package/build/ext/swiper/modules/navigation.css.js +0 -1
  166. package/build/ext/swiper/modules/pagination.css.js +0 -1
  167. package/build/ext/swiper/swiper.css.js +0 -1
  168. /package/build/models/data/storefront-popup/{storefront-popup-date-f/304/261lter/index.d.ts" → storefront-popup-date-filter/index.d.ts} +0 -0
  169. /package/build/models/data/storefront-popup/{storefront-popup-date-f/304/261lter/index.js" → storefront-popup-date-filter/index.js} +0 -0
@@ -53,6 +53,22 @@ export declare class IkasProductVariant implements IProductVariant {
53
53
  get sellPriceWithCampaignOffers(): number;
54
54
  get formattedSellPriceWithCampaignOffers(): string;
55
55
  get campaignOffersDiscountPercentage(): string | 0;
56
+ get tieredDiscountProducts(): {
57
+ amount: number | null;
58
+ lineItemQuantityRange: {
59
+ min: number;
60
+ max: number;
61
+ };
62
+ type: IkasCampaignType;
63
+ sellPrice: number;
64
+ finalPrice: number;
65
+ sellPriceWithQuantity: number;
66
+ finalPriceWithQuantity: number;
67
+ formattedSellPrice: string;
68
+ formattedSellPriceWithQuantity: string;
69
+ formattedFinalPrice: string;
70
+ formattedFinalPriceWithQuantity: string;
71
+ }[];
56
72
  saveBackInStockReminder(email: string): Promise<boolean>;
57
73
  toJSON(): this;
58
74
  }
@@ -61,3 +77,20 @@ export declare type AppliedCampaignAmount = {
61
77
  formattedPrice: string | null;
62
78
  discountPercentage: string | null;
63
79
  };
80
+ declare type IkasProductTieredDiscountItem = {
81
+ amount: number | null;
82
+ lineItemQuantityRange: {
83
+ min: number;
84
+ max: number;
85
+ };
86
+ type: IkasCampaignType;
87
+ sellPrice: number;
88
+ sellPriceWithQuantity: number;
89
+ finalPriceWithQuantity: number;
90
+ finalPrice: number;
91
+ formattedSellPrice: string;
92
+ formattedSellPriceWithQuantity: string;
93
+ formattedFinalPrice: string;
94
+ formattedFinalPriceWithQuantity: string;
95
+ };
96
+ export type { IkasProductTieredDiscountItem };
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t,__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{IkasProductPrice as r}from"./price/index.js";import{IkasVariantValue as n}from"../../variant-type/variant-value/index.js";import{IkasProductAttributeValue as o}from"../attribute-value/index.js";import{IkasProductImage as u}from"../image/index.js";import{IkasBundleSettings as c}from"./bundle-settings/index.js";import{IkasCustomerPriceListRuleValueType as s,IkasCampaignType as a,IkasCustomerPriceListRuleFilterType as l}from"@ikas/storefront-models";import{IkasProductVariantFunctions as d,IkasProductPriceFunctions as f}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";import{saveProductBackInStockRemind as m,listProductBackInStockRemind as b}from"@ikas/storefront-api";import v from"lodash/groupBy";import h from"lodash/sortBy";import{IkasProductVariantUnit as g}from"./unit/index.js";import{formatCurrency as P}from"../../../../utils/currency.js";import{makeAutoObservable as y}from"mobx";import{IkasBaseStore as O}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";var S=function(){function S(e){void 0===e&&(e={}),this._backInStockReminderSaved=!1,this.product=null,this.id=e.id||Date.now()+"",this.productId=e.productId||"",this.sku=e.sku||null,this.barcodeList=e.barcodeList||[],this.baseBundlePrices=e.baseBundlePrices?e.baseBundlePrices.map((function(e){return new r(e)})):[],this.bundleSettings=e.bundleSettings?new c(e.bundleSettings):null,this.variantValues=e.variantValues?e.variantValues.map((function(e){return new n(e)})):[],this.images=e.images?e.images.map((function(e){return new u(e)})):[],this.attributes=e.attributes?e.attributes.map((function(e){return new o(e)})):[],this.prices=e.prices?e.prices.map((function(e){return new r(e)})):[],this.stock=e.stock||0,this.isActive=void 0===e.isActive||e.isActive,this.campaigns=e.campaigns||[],this.unit=e.unit?new g(e.unit):null,this.sellIfOutOfStock=e.sellIfOutOfStock||!1,this.images=h(this.images,"order"),y(this)}return Object.defineProperty(S.prototype,"mainImage",{get:function(){var e=d.getMainImage(this);return e?new u(e):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"hasStock",{get:function(){return d.hasStock(this)},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isBackInStockEnabled",{get:function(){return p.isBackInStockEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isBackInStockCustomerLoginRequired",{get:function(){return p.isCustomerLoginRequiredForBackInStock()},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"isBackInStockReminderSaved",{get:function(){return this._backInStockReminderSaved},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"groupedAttributeValues",{get:function(){var e,t=v(this.attributes,"productAttributeId");return(null===(e=this.attributes)||void 0===e?void 0:e.map((function(e){var i=e.productAttributeId;if(i){var r=t[i];return(null==r?void 0:r.length)&&r[0].productAttribute?{attribute:r[0].productAttribute,values:r}:void 0}})).filter((function(e){return!!e})))||[]},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"b2bPriceRule",{get:function(){var e,t,i=this,r=O.getInstance().customerStore.customer,n=null==r?void 0:r.priceListRules,o=function(e){var t,r,n,o;if(e.type===l.CATEGORY)return u=null===(t=e.valueList)||void 0===t?void 0:t.some((function(e){var t;return null===(t=i.product)||void 0===t?void 0:t.categories.find((function(t){return t.id===e}))}));if(e.type===l.PRODUCT)return u=null===(r=e.valueList)||void 0===r?void 0:r.some((function(e){return i.id===e}));if(e.type===l.PRODUCT_BRAND){var u=null===(n=e.valueList)||void 0===n?void 0:n.some((function(e){var t,r;return(null===(r=null===(t=i.product)||void 0===t?void 0:t.brand)||void 0===r?void 0:r.id)===e}));return u}if(e.type===l.PRODUCT_TAG){u=null===(o=e.valueList)||void 0===o?void 0:o.some((function(e){var t,r;return null===(r=null===(t=i.product)||void 0===t?void 0:t.tags)||void 0===r?void 0:r.find((function(t){return t.id===e}))}));return u}};if(n){for(var u=0,c=n;u<c.length;u++){var s=c[u];if(s.shouldMatchAllFilters?null===(e=s.filters)||void 0===e?void 0:e.every(o):null===(t=s.filters)||void 0===t?void 0:t.some(o))return s}return null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"price",{get:function(){var e,t;if(p.isB2BStorefront()){var i=O.getInstance().customerStore.customer;if(null==i?void 0:i.priceListId){var r=null===(e=this.prices)||void 0===e?void 0:e.find((function(e){return e.priceListId===i.priceListId}));if(r)return r}}return null===(t=this.prices)||void 0===t?void 0:t.find((function(e){return p.getPriceListId()?e.priceListId===p.getPriceListId():null===e.priceListId}))},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"bundlePrice",{get:function(){var e,t;if(p.isB2BStorefront()){var i=O.getInstance().customerStore.customer;if(null==i?void 0:i.priceListId){var r=null===(e=this.baseBundlePrices)||void 0===e?void 0:e.find((function(e){return e.priceListId===i.priceListId}));if(r)return r}}return(null===(t=this.baseBundlePrices)||void 0===t?void 0:t.find((function(e){return p.getPriceListId()?e.priceListId===p.getPriceListId():null===e.priceListId})))||this.price},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"finalPrice",{get:function(){var e=0;this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?e=f.getFinalPrice(this.bundlePrice)+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.finalPriceWithQuantity:0)}),0):e=f.getFinalPrice(this.price);if(!this.b2bPriceRule)return e;switch(this.b2bPriceRule.valueType){case s.DISCOUNT_RATE:return e*((100-this.b2bPriceRule.value)/100);case s.DISCOUNT_AMOUNT:return e-this.b2bPriceRule.value;case s.FIXED_PRICE:return this.b2bPriceRule.value;default:return e}},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"formattedFinalPrice",{get:function(){return P(this.finalPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"sellPrice",{get:function(){return this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?this.bundlePrice.sellPrice+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.sellPriceWithQuantity:0)}),0):this.price.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"formattedSellPrice",{get:function(){return P(this.sellPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"formattedBuyPrice",{get:function(){return P(this.price.buyPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"appliedCampaignAmount",{get:function(){var e,t,i,r,n,o,u,c=this;if(!(null===(e=this.price.campaignPrice)||void 0===e?void 0:e.campaignId))return null;var s=(null===(r=null===(i=null===(t=this.product)||void 0===t?void 0:t.campaigns)||void 0===i?void 0:i.find((function(e){var t;return e.campaign.id===(null===(t=c.price.campaignPrice)||void 0===t?void 0:t.campaignId)})))||void 0===r?void 0:r.campaign)||null;if(!s)return null;var l={type:s.type,formattedPrice:null,discountPercentage:null};return s.type===a.FIXED_AMOUNT&&(l.formattedPrice=P((null===(n=s.fixedDiscount)||void 0===n?void 0:n.amount)||0,this.price.currency||"",this.price.currencySymbol||"")),s.type===a.RATIO&&(l.discountPercentage=(null===(u=null===(o=s.fixedDiscount)||void 0===o?void 0:o.amount)||void 0===u?void 0:u.toString())||null),l},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"campaignPrice",{get:function(){var e;return(null===(e=this.price.campaignPrice)||void 0===e?void 0:e.campaignPrice)||null},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"formattedCampaignPrice",{get:function(){return P(this.campaignPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"discountPrice",{get:function(){return this.finalPrice===this.sellPrice?null:this.finalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"formattedDiscountPrice",{get:function(){return P(this.discountPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"hasDiscount",{get:function(){return this.finalPrice!==this.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"discountAmount",{get:function(){return this.hasDiscount?this.sellPrice-this.finalPrice:0},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"discountPercentage",{get:function(){return this.hasDiscount?(100-100*this.finalPrice/this.sellPrice).toFixed(0):0},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"finalPriceWithCampaignOffers",{get:function(){var e,t;return this.finalPrice+((null===(t=null===(e=this.product)||void 0===e?void 0:e.offers)||void 0===t?void 0:t.filter((function(e){return e.isSelected&&!e.isAccepted})).reduce((function(e,t){return e+t.product.selectedVariant.finalPrice}),0))||0)},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"formattedFinalPriceWithCampaignOffers",{get:function(){return P(this.finalPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"sellPriceWithCampaignOffers",{get:function(){var e,t;return this.sellPrice+((null===(t=null===(e=this.product)||void 0===e?void 0:e.offers)||void 0===t?void 0:t.filter((function(e){return e.isSelected&&!e.isAccepted})).reduce((function(e,t){return e+t.product.selectedVariant.sellPrice}),0))||0)},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"formattedSellPriceWithCampaignOffers",{get:function(){return P(this.sellPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"campaignOffersDiscountPercentage",{get:function(){return this.finalPriceWithCampaignOffers!==this.sellPriceWithCampaignOffers?(100-100*this.finalPriceWithCampaignOffers/this.sellPriceWithCampaignOffers).toFixed(0):0},enumerable:!1,configurable:!0}),S.prototype.saveBackInStockReminder=function(i){var r;return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,b({email:{eq:i},productId:{eq:this.productId},variantId:{eq:this.id}})];case 1:return(e=t.sent())&&(null===(r=e.data)||void 0===r?void 0:r.length)?(this._backInStockReminderSaved=!0,[2,!1]):[3,2];case 2:return[4,m({input:{email:i,productId:this.productId,variantId:this.id}})];case 3:return t.sent().isSuccess?(this._backInStockReminderSaved=!0,[2,!0]):(this._backInStockReminderSaved=!1,[2,!1]);case 4:return[2]}}))}))},S.prototype.toJSON=function(){var e=i({},this);return delete e.product,e},S}();export{S as IkasProductVariant};
1
+ import{__awaiter as e,__generator as t,__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{IkasProductPrice as r}from"./price/index.js";import{IkasVariantValue as n}from"../../variant-type/variant-value/index.js";import{IkasProductAttributeValue as o}from"../attribute-value/index.js";import{IkasProductImage as c}from"../image/index.js";import{IkasBundleSettings as u}from"./bundle-settings/index.js";import{IkasCustomerPriceListRuleValueType as l,IkasCampaignType as a,IkasCampaignFilterType as s,IkasCampaignApplicablePrice as d,IkasCustomerPriceListRuleFilterType as p}from"@ikas/storefront-models";import{IkasProductVariantFunctions as f,IkasProductPriceFunctions as m}from"@ikas/storefront-model-functions";import{IkasStorefrontConfig as b}from"@ikas/storefront-config";import{saveProductBackInStockRemind as v,listProductBackInStockRemind as h}from"@ikas/storefront-api";import g from"lodash/groupBy";import y from"lodash/sortBy";import{IkasProductVariantUnit as P}from"./unit/index.js";import{formatCurrency as I}from"../../../../utils/currency.js";import{makeAutoObservable as S}from"mobx";import{IkasBaseStore as O}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";var j=function(){function j(e){void 0===e&&(e={}),this._backInStockReminderSaved=!1,this.product=null,this.id=e.id||Date.now()+"",this.productId=e.productId||"",this.sku=e.sku||null,this.barcodeList=e.barcodeList||[],this.baseBundlePrices=e.baseBundlePrices?e.baseBundlePrices.map((function(e){return new r(e)})):[],this.bundleSettings=e.bundleSettings?new u(e.bundleSettings):null,this.variantValues=e.variantValues?e.variantValues.map((function(e){return new n(e)})):[],this.images=e.images?e.images.map((function(e){return new c(e)})):[],this.attributes=e.attributes?e.attributes.map((function(e){return new o(e)})):[],this.prices=e.prices?e.prices.map((function(e){return new r(e)})):[],this.stock=e.stock||0,this.isActive=void 0===e.isActive||e.isActive,this.campaigns=e.campaigns||[],this.unit=e.unit?new P(e.unit):null,this.sellIfOutOfStock=e.sellIfOutOfStock||!1,this.images=y(this.images,"order"),S(this)}return Object.defineProperty(j.prototype,"mainImage",{get:function(){var e=f.getMainImage(this);return e?new c(e):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasStock",{get:function(){return f.hasStock(this)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockEnabled",{get:function(){return b.isBackInStockEnabled()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockCustomerLoginRequired",{get:function(){return b.isCustomerLoginRequiredForBackInStock()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isBackInStockReminderSaved",{get:function(){return this._backInStockReminderSaved},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"groupedAttributeValues",{get:function(){var e,t=g(this.attributes,"productAttributeId");return(null===(e=this.attributes)||void 0===e?void 0:e.map((function(e){var i=e.productAttributeId;if(i){var r=t[i];return(null==r?void 0:r.length)&&r[0].productAttribute?{attribute:r[0].productAttribute,values:r}:void 0}})).filter((function(e){return!!e})))||[]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"b2bPriceRule",{get:function(){var e,t,i=this,r=O.getInstance().customerStore.customer,n=null==r?void 0:r.priceListRules,o=function(e){var t,r,n,o;if(e.type===p.CATEGORY)return c=null===(t=e.valueList)||void 0===t?void 0:t.some((function(e){var t;return null===(t=i.product)||void 0===t?void 0:t.categories.find((function(t){return t.id===e}))}));if(e.type===p.PRODUCT)return c=null===(r=e.valueList)||void 0===r?void 0:r.some((function(e){return i.id===e}));if(e.type===p.PRODUCT_BRAND){var c=null===(n=e.valueList)||void 0===n?void 0:n.some((function(e){var t,r;return(null===(r=null===(t=i.product)||void 0===t?void 0:t.brand)||void 0===r?void 0:r.id)===e}));return c}if(e.type===p.PRODUCT_TAG){c=null===(o=e.valueList)||void 0===o?void 0:o.some((function(e){var t,r;return null===(r=null===(t=i.product)||void 0===t?void 0:t.tags)||void 0===r?void 0:r.find((function(t){return t.id===e}))}));return c}};if(n){for(var c=0,u=n;c<u.length;c++){var l=u[c];if(l.shouldMatchAllFilters?null===(e=l.filters)||void 0===e?void 0:e.every(o):null===(t=l.filters)||void 0===t?void 0:t.some(o))return l}return null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"price",{get:function(){var e,t;if(b.isB2BStorefront()){var i=O.getInstance().customerStore.customer;if(null==i?void 0:i.priceListId){var r=null===(e=this.prices)||void 0===e?void 0:e.find((function(e){return e.priceListId===i.priceListId}));if(r)return r}}return null===(t=this.prices)||void 0===t?void 0:t.find((function(e){return b.getPriceListId()?e.priceListId===b.getPriceListId():null===e.priceListId}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"bundlePrice",{get:function(){var e,t;if(b.isB2BStorefront()){var i=O.getInstance().customerStore.customer;if(null==i?void 0:i.priceListId){var r=null===(e=this.baseBundlePrices)||void 0===e?void 0:e.find((function(e){return e.priceListId===i.priceListId}));if(r)return r}}return(null===(t=this.baseBundlePrices)||void 0===t?void 0:t.find((function(e){return b.getPriceListId()?e.priceListId===b.getPriceListId():null===e.priceListId})))||this.price},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"finalPrice",{get:function(){var e=0;this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?e=m.getFinalPrice(this.bundlePrice)+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.finalPriceWithQuantity:0)}),0):e=m.getFinalPrice(this.price);if(!this.b2bPriceRule)return e;switch(this.b2bPriceRule.valueType){case l.DISCOUNT_RATE:return e*((100-this.b2bPriceRule.value)/100);case l.DISCOUNT_AMOUNT:return e-this.b2bPriceRule.value;case l.FIXED_PRICE:return this.b2bPriceRule.value;default:return e}},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedFinalPrice",{get:function(){return I(this.finalPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"sellPrice",{get:function(){return this.bundleSettings&&this.bundleSettings.products.every((function(e){return!!e.product}))?this.bundlePrice.sellPrice+this.bundleSettings.products.reduce((function(e,t){return e+(t.addToBundleBasePrice?t.sellPriceWithQuantity:0)}),0):this.price.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedSellPrice",{get:function(){return I(this.sellPrice,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedBuyPrice",{get:function(){return I(this.price.buyPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"appliedCampaignAmount",{get:function(){var e,t,i,r,n,o,c,u=this;if(!(null===(e=this.price.campaignPrice)||void 0===e?void 0:e.campaignId))return null;var l=(null===(r=null===(i=null===(t=this.product)||void 0===t?void 0:t.campaigns)||void 0===i?void 0:i.find((function(e){var t;return e.campaign.id===(null===(t=u.price.campaignPrice)||void 0===t?void 0:t.campaignId)})))||void 0===r?void 0:r.campaign)||null;if(!l)return null;var s={type:l.type,formattedPrice:null,discountPercentage:null};return l.type===a.FIXED_AMOUNT&&(s.formattedPrice=I((null===(n=l.fixedDiscount)||void 0===n?void 0:n.amount)||0,this.price.currency||"",this.price.currencySymbol||"")),l.type===a.RATIO&&(s.discountPercentage=(null===(c=null===(o=l.fixedDiscount)||void 0===o?void 0:o.amount)||void 0===c?void 0:c.toString())||null),s},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"campaignPrice",{get:function(){var e;return(null===(e=this.price.campaignPrice)||void 0===e?void 0:e.campaignPrice)||null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedCampaignPrice",{get:function(){return I(this.campaignPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountPrice",{get:function(){return this.finalPrice===this.sellPrice?null:this.finalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedDiscountPrice",{get:function(){return I(this.discountPrice||0,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasDiscount",{get:function(){return this.finalPrice!==this.sellPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountAmount",{get:function(){return this.hasDiscount?this.sellPrice-this.finalPrice:0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"discountPercentage",{get:function(){return this.hasDiscount?(100-100*this.finalPrice/this.sellPrice).toFixed(0):0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"finalPriceWithCampaignOffers",{get:function(){var e,t;return this.finalPrice+((null===(t=null===(e=this.product)||void 0===e?void 0:e.offers)||void 0===t?void 0:t.filter((function(e){return e.isSelected&&!e.isAccepted})).reduce((function(e,t){return e+t.product.selectedVariant.finalPrice}),0))||0)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedFinalPriceWithCampaignOffers",{get:function(){return I(this.finalPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"sellPriceWithCampaignOffers",{get:function(){var e,t;return this.sellPrice+((null===(t=null===(e=this.product)||void 0===e?void 0:e.offers)||void 0===t?void 0:t.filter((function(e){return e.isSelected&&!e.isAccepted})).reduce((function(e,t){return e+t.product.selectedVariant.sellPrice}),0))||0)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"formattedSellPriceWithCampaignOffers",{get:function(){return I(this.sellPriceWithCampaignOffers,this.price.currency||"",this.price.currencySymbol||"")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"campaignOffersDiscountPercentage",{get:function(){return this.finalPriceWithCampaignOffers!==this.sellPriceWithCampaignOffers?(100-100*this.finalPriceWithCampaignOffers/this.sellPriceWithCampaignOffers).toFixed(0):0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"tieredDiscountProducts",{get:function(){var e,t,i,r,n=this,o=null===(i=null===(t=null===(e=this.product)||void 0===e?void 0:e.campaigns)||void 0===t?void 0:t.find((function(e){return!!e.campaign.tieredDiscount})))||void 0===i?void 0:i.campaign,c=null===(r=null==o?void 0:o.tieredDiscount)||void 0===r?void 0:r.filters;if(c){var u=c.find((function(e){return e.type===s.PRODUCT_AND_VARIANT}));if(u){var l=[];if(u.idList.map((function(e){l.push(e.replace("p:","").replace("v:",""))})),!l.some((function(e){return n.id===e||n.productId===e})))return[]}}return o&&o.tieredDiscount?o.tieredDiscount.rules.map((function(e){var t,i,r,c,u=o.applicablePrice===d.SELL_PRICE?n.sellPrice:n.finalPrice,l=u*((null===(t=e.lineItemQuantityRange)||void 0===t?void 0:t.min)||1),s=I(u,n.price.currency||"",n.price.currencySymbol||""),p=I(l,n.price.currency||"",n.price.currencySymbol||""),f=o.type===a.RATIO?u-u*(e.amount||1)/100:u,m=f*((null===(i=e.lineItemQuantityRange)||void 0===i?void 0:i.min)||1)-(o.type===a.FIXED_AMOUNT&&e.amount||0),b=I(f,n.price.currency||"",n.price.currencySymbol||""),v=I(m,n.price.currency||"",n.price.currencySymbol||"");return{amount:e.amount,lineItemQuantityRange:{min:(null===(r=e.lineItemQuantityRange)||void 0===r?void 0:r.min)||0,max:(null===(c=e.lineItemQuantityRange)||void 0===c?void 0:c.max)||0},type:o.type,sellPrice:u,finalPrice:f,sellPriceWithQuantity:l,finalPriceWithQuantity:m,formattedSellPrice:s,formattedSellPriceWithQuantity:p,formattedFinalPrice:b,formattedFinalPriceWithQuantity:v}})):[]},enumerable:!1,configurable:!0}),j.prototype.saveBackInStockReminder=function(i){var r;return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,h({email:{eq:i},productId:{eq:this.productId},variantId:{eq:this.id}})];case 1:return(e=t.sent())&&(null===(r=e.data)||void 0===r?void 0:r.length)?(this._backInStockReminderSaved=!0,[2,!1]):[3,2];case 2:return[4,v({input:{email:i,productId:this.productId,variantId:this.id}})];case 3:return t.sent().isSuccess?(this._backInStockReminderSaved=!0,[2,!0]):(this._backInStockReminderSaved=!1,[2,!1]);case 4:return[2]}}))}))},j.prototype.toJSON=function(){var e=i({},this);return delete e.product,e},j}();export{j as IkasProductVariant};
@@ -1,7 +1,7 @@
1
1
  import { IkasBaseModel } from "../base";
2
2
  import { IkasStorefrontPopup as IStorefrontPopup } from "@ikas/storefront-models";
3
3
  import { IkasStorefrontPopupAnalytics } from "./storefront-popup-analytics";
4
- import { IkasStorefrontPopupDateFilter } from "./storefront-popup-date-fılter";
4
+ import { IkasStorefrontPopupDateFilter } from "./storefront-popup-date-filter";
5
5
  import { IkasStorefrontPopupDisplayFilter } from "./storefront-popup-display-filter";
6
6
  import { IkasStorefrontPopupDisplaySettings } from "./storefront-popup-display-settings";
7
7
  import { IkasStorefrontPopupPageFilter } from "./storefront-popup-page-filter";
@@ -1 +1 @@
1
- import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasBaseModel as o}from"../base/index.js";import{IkasStorefrontPopupAnalytics as r}from"./storefront-popup-analytics/index.js";import{IkasStorefrontPopupDateFilter as p}from"./storefront-popup-date-fılter/index.js";import{IkasStorefrontPopupDisplayFilter as d}from"./storefront-popup-display-filter/index.js";import{IkasStorefrontPopupDisplaySettings as s}from"./storefront-popup-display-settings/index.js";import{IkasStorefrontPopupPageFilter as n}from"./storefront-popup-page-filter/index.js";import{IkasStorefrontPopupRouting as i}from"./storefront-popup-routing/index.js";import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/components/index.js';import'./../../../ext/@ikas/popup-renderer/build/ext/tslib/tslib.es6.mjs.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js';import{Popup as t}from'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js';import"mobx";import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js';import{IkasStorefrontConfig as l}from"@ikas/storefront-config";var m,u,a,b=function(o){function b(e){var b,f=this;(f=o.call(this,e)||this).analytics=e.analytics?new r(e.analytics):null,f.dateFilter=e.dateFilter?new p(e.dateFilter):null,f.displayFilters=e.displayFilters?e.displayFilters.map((function(e){return new d(e)})):null,f.displaySettings=e.displaySettings?new s(e.displaySettings):new s,f.name=e.name||"",f.pageFilters=e.pageFilters?e.pageFilters.map((function(e){return new n(e)})):null,f.status=e.status||m.ACTIVE,f.storefrontRoutings=e.storefrontRoutings?e.storefrontRoutings.map((function(e){return new i(e)})):[],f.type=e.type||u.FORM,f.visibleDevice=e.visibleDevice||a.ALL;var x=(null===(b=l.getMerchantSettings())||void 0===b?void 0:b.merchantId)||"",c=l.getCdnUrl()||"";return f.contentJson=e.contentJson?new t(e.contentJson,c,x):null,f}return e(b,o),b}(o);!function(e){e.ACTIVE="ACTIVE",e.DRAFT="DRAFT",e.PASSIVE="PASSIVE"}(m||(m={})),function(e){e.FORM="FORM",e.NOTIFICATION="NOTIFICATION",e.NOTIFICATION_BAR="NOTIFICATION_BAR",e.PAGE_OVERLAY="PAGE_OVERLAY",e.POPUP="POPUP"}(u||(u={})),function(e){e.ALL="ALL",e.DESKTOP="DESKTOP",e.MOBILE="MOBILE"}(a||(a={}));export{b as IkasStorefrontPopup,a as IkasStorefrontPopupDeviceTypeEnum,m as IkasStorefrontPopupStatusEnum,u as IkasStorefrontPopupTypeEnum};
1
+ import{__extends as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasBaseModel as r}from"../base/index.js";import{IkasStorefrontPopupAnalytics as o}from"./storefront-popup-analytics/index.js";import{IkasStorefrontPopupDateFilter as p}from"./storefront-popup-date-filter/index.js";import{IkasStorefrontPopupDisplayFilter as s}from"./storefront-popup-display-filter/index.js";import{IkasStorefrontPopupDisplaySettings as d}from"./storefront-popup-display-settings/index.js";import{IkasStorefrontPopupPageFilter as n}from"./storefront-popup-page-filter/index.js";import{IkasStorefrontPopupRouting as i}from"./storefront-popup-routing/index.js";import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/components/index.js';import'./../../../ext/@ikas/popup-renderer/build/ext/tslib/tslib.es6.mjs.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/PhoneNumberMatcher.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/AsYouTypeFormatter.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/ParseError.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/metadata.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/PhoneNumber.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/PhoneNumberMatcher.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/AsYouType.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/min/exports/Metadata.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/es6/findNumbers/isValidCandidate.js';import'./../../../ext/@ikas/popup-renderer/build/ext/libphonenumber-js/index.es6.exports/PhoneNumberSearch.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/base/index.js';import{Popup as t}from'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/index.js';import"mobx";import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/settings/visibility-condition/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/teaser/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/button/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/divider/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/checkbox/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-attribute/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/form/customer-gender/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/image-column/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/product/detail-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/social/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/space/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/step/elements/text/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/background-settings/index.js';import'./../../../ext/@ikas/popup-renderer/build/popup-renderer/models/modal/close-settings/index.js';import{IkasStorefrontConfig as l}from"@ikas/storefront-config";var u,m,a,b=function(r){function b(e){var b,j=this;(j=r.call(this,e)||this).analytics=e.analytics?new o(e.analytics):null,j.dateFilter=e.dateFilter?new p(e.dateFilter):null,j.displayFilters=e.displayFilters?e.displayFilters.map((function(e){return new s(e)})):null,j.displaySettings=e.displaySettings?new d(e.displaySettings):new d,j.name=e.name||"",j.pageFilters=e.pageFilters?e.pageFilters.map((function(e){return new n(e)})):null,j.status=e.status||u.ACTIVE,j.storefrontRoutings=e.storefrontRoutings?e.storefrontRoutings.map((function(e){return new i(e)})):[],j.type=e.type||m.FORM,j.visibleDevice=e.visibleDevice||a.ALL;var x=(null===(b=l.getMerchantSettings())||void 0===b?void 0:b.merchantId)||"",_=l.getCdnUrl()||"";return j.contentJson=e.contentJson?new t(e.contentJson,_,x):null,j}return e(b,r),b}(r);!function(e){e.ACTIVE="ACTIVE",e.DRAFT="DRAFT",e.PASSIVE="PASSIVE"}(u||(u={})),function(e){e.FORM="FORM",e.NOTIFICATION="NOTIFICATION",e.NOTIFICATION_BAR="NOTIFICATION_BAR",e.PAGE_OVERLAY="PAGE_OVERLAY",e.POPUP="POPUP"}(m||(m={})),function(e){e.ALL="ALL",e.DESKTOP="DESKTOP",e.MOBILE="MOBILE"}(a||(a={}));export{b as IkasStorefrontPopup,a as IkasStorefrontPopupDeviceTypeEnum,u as IkasStorefrontPopupStatusEnum,m as IkasStorefrontPopupTypeEnum};
@@ -12,5 +12,7 @@ export declare enum IkasStorefrontPopupPageFilterTypeEnum {
12
12
  CUSTOM = "CUSTOM",
13
13
  HOME = "HOME",
14
14
  PRODUCT = "PRODUCT",
15
- PRODUCT_BRAND = "PRODUCT_BRAND"
15
+ PRODUCT_BRAND = "PRODUCT_BRAND",
16
+ REGISTER = "REGISTER",
17
+ LOGIN = "LOGIN"
16
18
  }
@@ -1 +1 @@
1
- import{IkasStorefrontPopupPageFilterData as C}from"./storefront-popup-page-filter-data/index.js";var t,T=function(T){void 0===T&&(T={}),this.filters=T.filters?T.filters.map((function(t){return new C(t)})):null,this.pageType=T.pageType||t.ACCOUNT};!function(C){C.ACCOUNT="ACCOUNT",C.CART="CART",C.CATEGORY="CATEGORY",C.CUSTOM="CUSTOM",C.HOME="HOME",C.PRODUCT="PRODUCT",C.PRODUCT_BRAND="PRODUCT_BRAND"}(t||(t={}));export{T as IkasStorefrontPopupPageFilter,t as IkasStorefrontPopupPageFilterTypeEnum};
1
+ import{IkasStorefrontPopupPageFilterData as T}from"./storefront-popup-page-filter-data/index.js";var C,t=function(t){void 0===t&&(t={}),this.filters=t.filters?t.filters.map((function(C){return new T(C)})):null,this.pageType=t.pageType||C.ACCOUNT};!function(T){T.ACCOUNT="ACCOUNT",T.CART="CART",T.CATEGORY="CATEGORY",T.CUSTOM="CUSTOM",T.HOME="HOME",T.PRODUCT="PRODUCT",T.PRODUCT_BRAND="PRODUCT_BRAND",T.REGISTER="REGISTER",T.LOGIN="LOGIN"}(C||(C={}));export{t as IkasStorefrontPopupPageFilter,C as IkasStorefrontPopupPageFilterTypeEnum};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as e}from"mobx";import a from"../../../store/blog/index.js";import{IkasBlogCategory as o}from"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import"@ikas/storefront-models";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";var r,n=function(){function n(a){var n=this;this._initialized=!1,this._minPage=null,this._isLoading=!1,this.getPrev=function(){return t(n,void 0,void 0,(function(){var t,e,a,o,r,n;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),t=this._minPage-1,[4,this.listBlogCategories(t,this.limit)];case 2:return e=i.sent(),this.data=(null===(r=null===(o=e.data)||void 0===o?void 0:o.data)||void 0===r?void 0:r.concat(this.data))||this.data,this._count=(null===(n=e.data)||void 0===n?void 0:n.count)||this._count,this._minPage=t,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(n,void 0,void 0,(function(){var t,e,a,o;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasNext)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listBlogCategories(this.page+1,this.limit)];case 2:return t=i.sent(),this.data=this.data.concat((null===(a=t.data)||void 0===a?void 0:a.data)||[]),this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||this._count,this._page=this.page+1,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(e){return t(n,void 0,void 0,(function(){var t,a,o,r;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||this.isStatic)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listBlogCategories(e,this.limit)];case 2:return t=i.sent(),this.data=(null===(o=t.data)||void 0===o?void 0:o.data)||[],this._count=(null===(r=t.data)||void 0===r?void 0:r.count)||0,this._page=e,this._minPage=e,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.data=a.data?a.data.map((function(t){return new o(t)})):[],this._type=a.type||a.blogCategoryListPropValue.blogCategoryListType||r.ALL,this._limit=a.limit||a.blogCategoryListPropValue.initialLimit||20,this._page=a.page||1,this._count=a.count||0,this._initialized=a.initialized||!1,this._minPage=a.minPage,this._blogCategoryListPropValue=a.blogCategoryListPropValue,e(this)}return Object.defineProperty(n.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isStatic",{get:function(){return this._type===r.STATIC},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasPrev",{get:function(){return!(this.isStatic||!this._minPage)&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasNext",{get:function(){return!this.isStatic&&this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),n.prototype.listBlogCategories=function(e,o){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,a.listBlogCategory({id:this.isStatic&&this._blogCategoryListPropValue.blogCategoryIds?{in:this._blogCategoryListPropValue.blogCategoryIds}:void 0,pagination:{page:e,limit:o}})];case 1:return[2,t.sent()]}}))}))},n.prototype.toJSON=function(){return{data:this.data,type:this._type,limit:this._limit,page:this._page,count:this._count,initialized:this._initialized,minPage:this._minPage,blogCategoryListPropValue:this._blogCategoryListPropValue}},n}();!function(t){t.ALL="ALL",t.STATIC="STATIC"}(r||(r={}));export{n as IkasBlogCategoryList,r as IkasBlogCategoryListType};
1
+ import{__awaiter as t,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as e}from"mobx";import a from"../../../store/blog/index.js";import{IkasBlogCategory as o}from"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import"@ikas/storefront-models";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../data/storefront-popup/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";var r,n=function(){function n(a){var n=this;this._initialized=!1,this._minPage=null,this._isLoading=!1,this.getPrev=function(){return t(n,void 0,void 0,(function(){var t,e,a,o,r,n;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),t=this._minPage-1,[4,this.listBlogCategories(t,this.limit)];case 2:return e=i.sent(),this.data=(null===(r=null===(o=e.data)||void 0===o?void 0:o.data)||void 0===r?void 0:r.concat(this.data))||this.data,this._count=(null===(n=e.data)||void 0===n?void 0:n.count)||this._count,this._minPage=t,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(n,void 0,void 0,(function(){var t,e,a,o;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasNext)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listBlogCategories(this.page+1,this.limit)];case 2:return t=i.sent(),this.data=this.data.concat((null===(a=t.data)||void 0===a?void 0:a.data)||[]),this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||this._count,this._page=this.page+1,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(e){return t(n,void 0,void 0,(function(){var t,a,o,r;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||this.isStatic)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listBlogCategories(e,this.limit)];case 2:return t=i.sent(),this.data=(null===(o=t.data)||void 0===o?void 0:o.data)||[],this._count=(null===(r=t.data)||void 0===r?void 0:r.count)||0,this._page=e,this._minPage=e,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.data=a.data?a.data.map((function(t){return new o(t)})):[],this._type=a.type||a.blogCategoryListPropValue.blogCategoryListType||r.ALL,this._limit=a.limit||a.blogCategoryListPropValue.initialLimit||20,this._page=a.page||1,this._count=a.count||0,this._initialized=a.initialized||!1,this._minPage=a.minPage,this._blogCategoryListPropValue=a.blogCategoryListPropValue,e(this)}return Object.defineProperty(n.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isStatic",{get:function(){return this._type===r.STATIC},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasPrev",{get:function(){return!(this.isStatic||!this._minPage)&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasNext",{get:function(){return!this.isStatic&&this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),n.prototype.listBlogCategories=function(e,o){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,a.listBlogCategory({id:this.isStatic&&this._blogCategoryListPropValue.blogCategoryIds?{in:this._blogCategoryListPropValue.blogCategoryIds}:void 0,pagination:{page:e,limit:o}})];case 1:return[2,t.sent()]}}))}))},n.prototype.toJSON=function(){return{data:this.data,type:this._type,limit:this._limit,page:this._page,count:this._count,initialized:this._initialized,minPage:this._minPage,blogCategoryListPropValue:this._blogCategoryListPropValue}},n}();!function(t){t.ALL="ALL",t.STATIC="STATIC"}(r||(r={}));export{n as IkasBlogCategoryList,r as IkasBlogCategoryListType};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import{IkasBrand as e}from"../../data/brand/index.js";import"@ikas/storefront-models";import{makeAutoObservable as a}from"mobx";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";import r from"../../../store/brand/index.js";var n,o,s=function(){function s(s){var d=this;this._initialized=!1,this._minPage=null,this._isLoading=!1,this.getInitial=function(){return t(d,void 0,void 0,(function(){var t,e,a,n,o;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,r.listProductBrand({id:this.isStatic&&this._brandListPropValue.brandIds?{in:this._brandListPropValue.brandIds}:void 0,pagination:{page:this.isStatic?void 0:this.page,limit:this.isStatic?void 0:this.limit},sort:this.getSortParams()})];case 2:return t=i.sent(),this.isStatic?this.data=(null===(a=this._brandListPropValue.brandIds)||void 0===a?void 0:a.map((function(i){var e,a;return null===(a=null===(e=t.data)||void 0===e?void 0:e.data)||void 0===a?void 0:a.find((function(t){return t.id===i}))})).filter((function(t){return!!t})))||[]:this.data=(null===(n=t.data)||void 0===n?void 0:n.data)||[],this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||0,this._initialized=!0,this._minPage=this.page,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPrev=function(){return t(d,void 0,void 0,(function(){var t,e,a,n,o,s;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),t=this._minPage-1,[4,r.listProductBrand({pagination:{page:t,limit:this.limit},sort:this.getSortParams()})];case 2:return e=i.sent(),this.data=(null===(o=null===(n=e.data)||void 0===n?void 0:n.data)||void 0===o?void 0:o.concat(this.data))||this.data,this._count=(null===(s=e.data)||void 0===s?void 0:s.count)||0,this._minPage=t,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(d,void 0,void 0,(function(){var t,e,a,n;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasNext)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,r.listProductBrand({pagination:{page:this.page+1,limit:this.limit},sort:this.getSortParams()})];case 2:return t=i.sent(),this.data=this.data.concat((null===(a=t.data)||void 0===a?void 0:a.data)||[]),this._count=(null===(n=t.data)||void 0===n?void 0:n.count)||this.count,this._page=this.page+1,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(e){return t(d,void 0,void 0,(function(){var t,a,n,o;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||this.isStatic)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,r.listProductBrand({pagination:{page:e,limit:this.limit},sort:this.getSortParams()})];case 2:return t=i.sent(),this.data=(null===(n=t.data)||void 0===n?void 0:n.data)||[],this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||0,this._page=e,this._minPage=e,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.data=s.data?s.data.map((function(t){return new e(t)})):[],this._type=s.type||s.brandListPropValue.brandListType||n.ALL,this._sort=s.sort||s.brandListPropValue.initialSort||o.A_Z,this._limit=s.limit||s.brandListPropValue.initialLimit||20,this._page=s.page||1,this._count=s.count||0,this._initialized=s.initialized||!1,this._minPage=s.minPage,this._brandListPropValue=s.brandListPropValue,a(this)}return Object.defineProperty(s.prototype,"sort",{get:function(){return this._sort},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isStatic",{get:function(){return this._type===n.STATIC},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"hasPrev",{get:function(){return!(this.isStatic||!this._minPage)&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"hasNext",{get:function(){return!this.isStatic&&this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),s.prototype.getSortParams=function(){return this._sort===o.A_Z?"name":"-name"},s.prototype.setSortType=function(e){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this._sort=e,[4,this.getInitial()];case 1:return t.sent(),[2]}}))}))},s.prototype.toJSON=function(){return{data:this.data,type:this._type,sort:this._sort,limit:this._limit,page:this._page,count:this._count,initialized:this._initialized,minPage:this._minPage,brandListPropValue:this._brandListPropValue}},s}();!function(t){t.ALL="ALL",t.STATIC="STATIC"}(n||(n={})),function(t){t.A_Z="A_Z",t.Z_A="Z_A"}(o||(o={}));export{s as IkasBrandList,o as IkasBrandListSortType,n as IkasBrandListType};
1
+ import{__awaiter as t,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import{IkasBrand as e}from"../../data/brand/index.js";import"@ikas/storefront-models";import{makeAutoObservable as a}from"mobx";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../data/storefront-popup/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";import r from"../../../store/brand/index.js";var n,o,s=function(){function s(s){var d=this;this._initialized=!1,this._minPage=null,this._isLoading=!1,this.getInitial=function(){return t(d,void 0,void 0,(function(){var t,e,a,n,o;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,r.listProductBrand({id:this.isStatic&&this._brandListPropValue.brandIds?{in:this._brandListPropValue.brandIds}:void 0,pagination:{page:this.isStatic?void 0:this.page,limit:this.isStatic?void 0:this.limit},sort:this.getSortParams()})];case 2:return t=i.sent(),this.isStatic?this.data=(null===(a=this._brandListPropValue.brandIds)||void 0===a?void 0:a.map((function(i){var e,a;return null===(a=null===(e=t.data)||void 0===e?void 0:e.data)||void 0===a?void 0:a.find((function(t){return t.id===i}))})).filter((function(t){return!!t})))||[]:this.data=(null===(n=t.data)||void 0===n?void 0:n.data)||[],this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||0,this._initialized=!0,this._minPage=this.page,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPrev=function(){return t(d,void 0,void 0,(function(){var t,e,a,n,o,s;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),t=this._minPage-1,[4,r.listProductBrand({pagination:{page:t,limit:this.limit},sort:this.getSortParams()})];case 2:return e=i.sent(),this.data=(null===(o=null===(n=e.data)||void 0===n?void 0:n.data)||void 0===o?void 0:o.concat(this.data))||this.data,this._count=(null===(s=e.data)||void 0===s?void 0:s.count)||0,this._minPage=t,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(d,void 0,void 0,(function(){var t,e,a,n;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasNext)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,r.listProductBrand({pagination:{page:this.page+1,limit:this.limit},sort:this.getSortParams()})];case 2:return t=i.sent(),this.data=this.data.concat((null===(a=t.data)||void 0===a?void 0:a.data)||[]),this._count=(null===(n=t.data)||void 0===n?void 0:n.count)||this.count,this._page=this.page+1,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(e){return t(d,void 0,void 0,(function(){var t,a,n,o;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||this.isStatic)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,r.listProductBrand({pagination:{page:e,limit:this.limit},sort:this.getSortParams()})];case 2:return t=i.sent(),this.data=(null===(n=t.data)||void 0===n?void 0:n.data)||[],this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||0,this._page=e,this._minPage=e,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.data=s.data?s.data.map((function(t){return new e(t)})):[],this._type=s.type||s.brandListPropValue.brandListType||n.ALL,this._sort=s.sort||s.brandListPropValue.initialSort||o.A_Z,this._limit=s.limit||s.brandListPropValue.initialLimit||20,this._page=s.page||1,this._count=s.count||0,this._initialized=s.initialized||!1,this._minPage=s.minPage,this._brandListPropValue=s.brandListPropValue,a(this)}return Object.defineProperty(s.prototype,"sort",{get:function(){return this._sort},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isStatic",{get:function(){return this._type===n.STATIC},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"hasPrev",{get:function(){return!(this.isStatic||!this._minPage)&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"hasNext",{get:function(){return!this.isStatic&&this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),s.prototype.getSortParams=function(){return this._sort===o.A_Z?"name":"-name"},s.prototype.setSortType=function(e){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this._sort=e,[4,this.getInitial()];case 1:return t.sent(),[2]}}))}))},s.prototype.toJSON=function(){return{data:this.data,type:this._type,sort:this._sort,limit:this._limit,page:this._page,count:this._count,initialized:this._initialized,minPage:this._minPage,brandListPropValue:this._brandListPropValue}},s}();!function(t){t.ALL="ALL",t.STATIC="STATIC"}(n||(n={})),function(t){t.A_Z="A_Z",t.Z_A="Z_A"}(o||(o={}));export{s as IkasBrandList,o as IkasBrandListSortType,n as IkasBrandListType};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import"@ikas/storefront-models";import{makeAutoObservable as e}from"mobx";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import{IkasCategory as a}from"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";import r from"../../../store/category/index.js";var o,n,s=function(){function s(s){var d=this;this._initialized=!1,this._minPage=null,this._isLoading=!1,this.getInitial=function(){return t(d,void 0,void 0,(function(){var t,e,a,o,n;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,r.listCategory({id:this.isStatic&&this._categoryListPropValue.categoryIds?{in:this._categoryListPropValue.categoryIds}:void 0,pagination:{page:this.isStatic?void 0:this.page,limit:this.isStatic?void 0:this.limit},sort:this.getSortParams()})];case 2:return t=i.sent(),this.isStatic?this.data=(null===(a=this._categoryListPropValue.categoryIds)||void 0===a?void 0:a.map((function(i){var e,a;return null===(a=null===(e=t.data)||void 0===e?void 0:e.data)||void 0===a?void 0:a.find((function(t){return t.id===i}))})).filter((function(t){return!!t})))||[]:this.data=(null===(o=t.data)||void 0===o?void 0:o.data)||[],this._count=(null===(n=t.data)||void 0===n?void 0:n.count)||0,this._initialized=!0,this._minPage=this.page,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPrev=function(){return t(d,void 0,void 0,(function(){var t,e,a,o,n,s;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),t=this._minPage-1,[4,r.listCategory({pagination:{page:t,limit:this.limit},sort:this.getSortParams()})];case 2:return e=i.sent(),this.data=(null===(n=null===(o=e.data)||void 0===o?void 0:o.data)||void 0===n?void 0:n.concat(this.data))||this.data,this._count=(null===(s=e.data)||void 0===s?void 0:s.count)||this._count,this._minPage=t,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(d,void 0,void 0,(function(){var t,e,a,o;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasNext)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,r.listCategory({pagination:{page:this.page+1,limit:this.limit},sort:this.getSortParams()})];case 2:return t=i.sent(),this.data=this.data.concat((null===(a=t.data)||void 0===a?void 0:a.data)||[]),this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||this._count,this._page=this.page+1,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(e){return t(d,void 0,void 0,(function(){var t,a,o,n;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||this.isStatic)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,r.listCategory({pagination:{page:e,limit:this.limit},sort:this.getSortParams()})];case 2:return t=i.sent(),this.data=(null===(o=t.data)||void 0===o?void 0:o.data)||[],this._count=(null===(n=t.data)||void 0===n?void 0:n.count)||0,this._page=e,this._minPage=e,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.data=s.data?s.data.map((function(t){return new a(t)})):[],this._type=s.type||s.categoryListPropValue.categoryListType||o.ALL,this._sort=s.sort||s.categoryListPropValue.initialSort||n.A_Z,this._limit=s.limit||s.categoryListPropValue.initialLimit||20,this._page=s.page||1,this._count=s.count||0,this._initialized=s.initialized||!1,this._minPage=s.minPage,this._categoryListPropValue=s.categoryListPropValue,e(this)}return Object.defineProperty(s.prototype,"sort",{get:function(){return this._sort},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isStatic",{get:function(){return this._type===o.STATIC},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"hasPrev",{get:function(){return!(this.isStatic||!this._minPage)&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"hasNext",{get:function(){return!this.isStatic&&this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),s.prototype.getSortParams=function(){return this._sort===n.A_Z?"name":"-name"},s.prototype.setSortType=function(e){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this._sort=e,[4,this.getInitial()];case 1:return t.sent(),[2]}}))}))},s.prototype.toJSON=function(){return{data:this.data,type:this._type,sort:this._sort,limit:this._limit,page:this._page,count:this._count,initialized:this._initialized,minPage:this._minPage,categoryListPropValue:this._categoryListPropValue}},s}();!function(t){t.ALL="ALL",t.STATIC="STATIC"}(o||(o={})),function(t){t.A_Z="A_Z",t.Z_A="Z_A"}(n||(n={}));export{s as IkasCategoryList,n as IkasCategoryListSortType,o as IkasCategoryListType};
1
+ import{__awaiter as t,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import"@ikas/storefront-models";import{makeAutoObservable as e}from"mobx";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import{IkasCategory as a}from"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../data/storefront-popup/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";import r from"../../../store/category/index.js";var o,n,s=function(){function s(s){var d=this;this._initialized=!1,this._minPage=null,this._isLoading=!1,this.getInitial=function(){return t(d,void 0,void 0,(function(){var t,e,a,o,n;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,r.listCategory({id:this.isStatic&&this._categoryListPropValue.categoryIds?{in:this._categoryListPropValue.categoryIds}:void 0,pagination:{page:this.isStatic?void 0:this.page,limit:this.isStatic?void 0:this.limit},sort:this.getSortParams()})];case 2:return t=i.sent(),this.isStatic?this.data=(null===(a=this._categoryListPropValue.categoryIds)||void 0===a?void 0:a.map((function(i){var e,a;return null===(a=null===(e=t.data)||void 0===e?void 0:e.data)||void 0===a?void 0:a.find((function(t){return t.id===i}))})).filter((function(t){return!!t})))||[]:this.data=(null===(o=t.data)||void 0===o?void 0:o.data)||[],this._count=(null===(n=t.data)||void 0===n?void 0:n.count)||0,this._initialized=!0,this._minPage=this.page,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPrev=function(){return t(d,void 0,void 0,(function(){var t,e,a,o,n,s;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),t=this._minPage-1,[4,r.listCategory({pagination:{page:t,limit:this.limit},sort:this.getSortParams()})];case 2:return e=i.sent(),this.data=(null===(n=null===(o=e.data)||void 0===o?void 0:o.data)||void 0===n?void 0:n.concat(this.data))||this.data,this._count=(null===(s=e.data)||void 0===s?void 0:s.count)||this._count,this._minPage=t,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(d,void 0,void 0,(function(){var t,e,a,o;return i(this,(function(i){switch(i.label){case 0:if(this.isStatic||this._isLoading||!this.hasNext)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,r.listCategory({pagination:{page:this.page+1,limit:this.limit},sort:this.getSortParams()})];case 2:return t=i.sent(),this.data=this.data.concat((null===(a=t.data)||void 0===a?void 0:a.data)||[]),this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||this._count,this._page=this.page+1,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(e){return t(d,void 0,void 0,(function(){var t,a,o,n;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||this.isStatic)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,r.listCategory({pagination:{page:e,limit:this.limit},sort:this.getSortParams()})];case 2:return t=i.sent(),this.data=(null===(o=t.data)||void 0===o?void 0:o.data)||[],this._count=(null===(n=t.data)||void 0===n?void 0:n.count)||0,this._page=e,this._minPage=e,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.data=s.data?s.data.map((function(t){return new a(t)})):[],this._type=s.type||s.categoryListPropValue.categoryListType||o.ALL,this._sort=s.sort||s.categoryListPropValue.initialSort||n.A_Z,this._limit=s.limit||s.categoryListPropValue.initialLimit||20,this._page=s.page||1,this._count=s.count||0,this._initialized=s.initialized||!1,this._minPage=s.minPage,this._categoryListPropValue=s.categoryListPropValue,e(this)}return Object.defineProperty(s.prototype,"sort",{get:function(){return this._sort},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isStatic",{get:function(){return this._type===o.STATIC},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"hasPrev",{get:function(){return!(this.isStatic||!this._minPage)&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"hasNext",{get:function(){return!this.isStatic&&this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),s.prototype.getSortParams=function(){return this._sort===n.A_Z?"name":"-name"},s.prototype.setSortType=function(e){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this._sort=e,[4,this.getInitial()];case 1:return t.sent(),[2]}}))}))},s.prototype.toJSON=function(){return{data:this.data,type:this._type,sort:this._sort,limit:this._limit,page:this._page,count:this._count,initialized:this._initialized,minPage:this._minPage,categoryListPropValue:this._categoryListPropValue}},s}();!function(t){t.ALL="ALL",t.STATIC="STATIC"}(o||(o={})),function(t){t.A_Z="A_Z",t.Z_A="Z_A"}(n||(n={}));export{s as IkasCategoryList,n as IkasCategoryListSortType,o as IkasCategoryListType};
@@ -44,6 +44,6 @@ export declare type IkasCustomerReviewListParams = {
44
44
  initialized?: boolean;
45
45
  minPage?: number;
46
46
  productId?: string;
47
- productIds?: string[];
47
+ productIds?: string[] | null;
48
48
  hasImage?: boolean;
49
49
  };
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i,__assign as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as a}from"@ikas/storefront-config";import{makeAutoObservable as r}from"mobx";import o from"../../../store/customer/api.js";import n from"../../../store/product/index.js";import"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import"@ikas/storefront-models";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import{IkasCustomerReview as s}from"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";var d=function(){function d(e){var a=this;this._initialized=!1,this._minPage=null,this._productId=null,this._hasImage=!1,this._productIds=null,this._isLoading=!1,this.getInitial=function(){return t(a,void 0,void 0,(function(){var t,e,a,r;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listCustomerReviews(this.page,this.limit,this.hasImage,this.productIds)];case 2:return t=i.sent(),this.data=(null===(a=t.data)||void 0===a?void 0:a.data)||[],this._count=(null===(r=t.data)||void 0===r?void 0:r.count)||0,this._initialized=!0,this._minPage=this.page,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPrev=function(){return t(a,void 0,void 0,(function(){var t,e,a,r,o;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),t=this._minPage-1,[4,this.listCustomerReviews(t,this.limit,this.hasImage,this.productIds)];case 2:return e=i.sent(),this.data=(null===(r=e.data)||void 0===r?void 0:r.data.concat(this.data))||this.data,this._count=(null===(o=e.data)||void 0===o?void 0:o.count)||this._count,this._minPage=t,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(a,void 0,void 0,(function(){var t,e,a,r;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||!this.hasNext)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listCustomerReviews(this.page+1,this.limit,this.hasImage,this.productIds)];case 2:return t=i.sent(),this.data=this.data.concat((null===(a=t.data)||void 0===a?void 0:a.data)||[]),this._count=(null===(r=t.data)||void 0===r?void 0:r.count)||this._count,this._page=this.page+1,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(e){return t(a,void 0,void 0,(function(){var t,a,r,o;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listCustomerReviews(e,this.limit,this.hasImage,this.productIds)];case 2:return t=i.sent(),this.data=(null===(r=t.data)||void 0===r?void 0:r.data)||[],this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||0,this._page=e,this._minPage=e,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.data=e.data?e.data.map((function(t){return new s(t)})):[],this._limit=e.limit||5,this._page=e.page||1,this._count=e.count||0,this._initialized=e.initialized||!1,this._hasImage=e.hasImage||!1,this._minPage=e.minPage,this._productId=e.productId||null,this._productIds=e.productIds||null,r(this)}return Object.defineProperty(d.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"hasPrev",{get:function(){return!!this._minPage&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"hasNext",{get:function(){return this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"hasImage",{get:function(){return this._hasImage},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"productIds",{get:function(){return this._productIds},enumerable:!1,configurable:!0}),d.prototype.listCustomerReviews=function(r,s,d,u){var c,p,m;return t(this,void 0,void 0,(function(){var t,l,h;return i(this,(function(i){switch(i.label){case 0:return[4,o.listCustomerReviews(e(e(e({},this._productId?{productId:this._productId}:{}),{input:{salesChannelId:a.getSalesChannelId()||""},pagination:{page:r,limit:s},hasImage:d}),u?{productIds:u}:{}))];case 1:return t=i.sent(),!(null===(c=t.data)||void 0===c?void 0:c.data)||this._productId?[3,3]:(l=null===(p=null==t?void 0:t.data)||void 0===p?void 0:p.data.map((function(t){return null==t?void 0:t.productId})),[4,n.searchProducts({input:{productIdList:l}})]);case 2:h=i.sent(),t.data.data=null===(m=null==t?void 0:t.data)||void 0===m?void 0:m.data.map((function(t){var i,a,r=null===(a=null===(i=null==h?void 0:h.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.find((function(i){return i.id===t.productId}));return e(e({},t),{product:r})})).filter((function(t){return t.product&&!t.product.deleted})),i.label=3;case 3:return[2,t]}}))}))},d.prototype.toJSON=function(){return{data:this.data,limit:this._limit,page:this._page,count:this._count,initialized:this._initialized,minPage:this._minPage,productId:this._productId}},d}();export{d as IkasCustomerReviewList};
1
+ import{__awaiter as t,__generator as i,__assign as e}from'./../../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as a}from"@ikas/storefront-config";import{makeAutoObservable as r}from"mobx";import o from"../../../store/customer/api.js";import n from"../../../store/product/index.js";import"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import"@ikas/storefront-models";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import{IkasCustomerReview as s}from"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../data/storefront-popup/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";var d=function(){function d(e){var a=this;this._initialized=!1,this._minPage=null,this._productId=null,this._hasImage=!1,this._productIds=null,this._isLoading=!1,this.getInitial=function(){return t(a,void 0,void 0,(function(){var t,e,a,r;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listCustomerReviews(this.page,this.limit,this.hasImage,this.productIds)];case 2:return t=i.sent(),this.data=(null===(a=t.data)||void 0===a?void 0:a.data)||[],this._count=(null===(r=t.data)||void 0===r?void 0:r.count)||0,this._initialized=!0,this._minPage=this.page,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPrev=function(){return t(a,void 0,void 0,(function(){var t,e,a,r,o;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),t=this._minPage-1,[4,this.listCustomerReviews(t,this.limit,this.hasImage,this.productIds)];case 2:return e=i.sent(),this.data=(null===(r=e.data)||void 0===r?void 0:r.data.concat(this.data))||this.data,this._count=(null===(o=e.data)||void 0===o?void 0:o.count)||this._count,this._minPage=t,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(a,void 0,void 0,(function(){var t,e,a,r;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||!this.hasNext)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listCustomerReviews(this.page+1,this.limit,this.hasImage,this.productIds)];case 2:return t=i.sent(),this.data=this.data.concat((null===(a=t.data)||void 0===a?void 0:a.data)||[]),this._count=(null===(r=t.data)||void 0===r?void 0:r.count)||this._count,this._page=this.page+1,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(e){return t(a,void 0,void 0,(function(){var t,a,r,o;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listCustomerReviews(e,this.limit,this.hasImage,this.productIds)];case 2:return t=i.sent(),this.data=(null===(r=t.data)||void 0===r?void 0:r.data)||[],this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||0,this._page=e,this._minPage=e,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.data=e.data?e.data.map((function(t){return new s(t)})):[],this._limit=e.limit||5,this._page=e.page||1,this._count=e.count||0,this._initialized=e.initialized||!1,this._hasImage=e.hasImage||!1,this._minPage=e.minPage,this._productId=e.productId||null,this._productIds=e.productIds||null,r(this)}return Object.defineProperty(d.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"hasPrev",{get:function(){return!!this._minPage&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"hasNext",{get:function(){return this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"hasImage",{get:function(){return this._hasImage},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"productIds",{get:function(){return this._productIds},enumerable:!1,configurable:!0}),d.prototype.listCustomerReviews=function(r,s,d,u){var p,c,m;return t(this,void 0,void 0,(function(){var t,l,h;return i(this,(function(i){switch(i.label){case 0:return[4,o.listCustomerReviews(e(e(e({},this._productId?{productId:this._productId}:{}),{input:{salesChannelId:a.getSalesChannelId()||""},pagination:{page:r,limit:s},hasImage:d}),u?{productIds:u}:{}))];case 1:return t=i.sent(),!(null===(p=t.data)||void 0===p?void 0:p.data)||this._productId?[3,3]:(l=null===(c=null==t?void 0:t.data)||void 0===c?void 0:c.data.map((function(t){return null==t?void 0:t.productId})),[4,n.searchProducts({input:{productIdList:l}})]);case 2:h=i.sent(),t.data.data=null===(m=null==t?void 0:t.data)||void 0===m?void 0:m.data.map((function(t){var i,a,r=null===(a=null===(i=null==h?void 0:h.data)||void 0===i?void 0:i.data)||void 0===a?void 0:a.find((function(i){return i.id===t.productId}));return e(e({},t),{product:r})})).filter((function(t){return t.product&&!t.product.deleted})),i.label=3;case 3:return[2,t]}}))}))},d.prototype.toJSON=function(){return{data:this.data,limit:this._limit,page:this._page,count:this._count,initialized:this._initialized,minPage:this._minPage,productId:this._productId}},d}();export{d as IkasCustomerReviewList};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as e}from"mobx";import a from"../../../store/customer/api.js";import"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import"@ikas/storefront-models";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import{IkasCustomerReviewSummary as r}from"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";var n=function(){function n(a){var n=this;this._initialized=!1,this._minPage=null,this._isLoading=!1,this.getInitial=function(){return t(n,void 0,void 0,(function(){var t,e,a,r;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listCustomerReviewSummary(this.page,this.limit)];case 2:return t=i.sent(),this.data=(null===(a=t.data)||void 0===a?void 0:a.data)||[],this._count=(null===(r=t.data)||void 0===r?void 0:r.count)||0,this._initialized=!0,this._minPage=this.page,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPrev=function(){return t(n,void 0,void 0,(function(){var t,e,a,r,n,o;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),t=this._minPage-1,[4,this.listCustomerReviewSummary(t,this.limit)];case 2:return e=i.sent(),this.data=(null===(n=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.concat(this.data))||this.data,this._count=(null===(o=e.data)||void 0===o?void 0:o.count)||this._count,this._minPage=t,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(n,void 0,void 0,(function(){var t,e,a,r;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||!this.hasNext)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listCustomerReviewSummary(this.page+1,this.limit)];case 2:return t=i.sent(),this.data=this.data.concat((null===(a=t.data)||void 0===a?void 0:a.data)||[]),this._count=(null===(r=t.data)||void 0===r?void 0:r.count)||this._count,this._page=this.page+1,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(e){return t(n,void 0,void 0,(function(){var t,a,r,n;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listCustomerReviewSummary(e,this.limit)];case 2:return t=i.sent(),this.data=(null===(r=t.data)||void 0===r?void 0:r.data)||[],this._count=(null===(n=t.data)||void 0===n?void 0:n.count)||0,this._page=e,this._minPage=e,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.data=a.data?a.data.map((function(t){return new r(t)})):[],this._limit=a.limit||5,this._page=a.page||1,this._count=a.count||0,this._initialized=a.initialized||!1,this._minPage=a.minPage,this._productId=a.productId,e(this)}return Object.defineProperty(n.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasPrev",{get:function(){return!!this._minPage&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasNext",{get:function(){return this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),n.prototype.listCustomerReviewSummary=function(e,r){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,a.listCustomerReviewSummary({productId:{eq:this._productId},pagination:{page:e,limit:r}})];case 1:return[2,t.sent()]}}))}))},n.prototype.toJSON=function(){return{data:this.data,limit:this._limit,page:this._page,count:this._count,initialized:this._initialized,minPage:this._minPage,productId:this._productId}},n}();export{n as IkasCustomerReviewSummaryList};
1
+ import{__awaiter as t,__generator as i}from'./../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as e}from"mobx";import a from"../../../store/customer/api.js";import"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import"@ikas/storefront-models";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import{IkasCustomerReviewSummary as r}from"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../data/storefront-popup/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";var o=function(){function o(a){var o=this;this._initialized=!1,this._minPage=null,this._isLoading=!1,this.getInitial=function(){return t(o,void 0,void 0,(function(){var t,e,a,r;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listCustomerReviewSummary(this.page,this.limit)];case 2:return t=i.sent(),this.data=(null===(a=t.data)||void 0===a?void 0:a.data)||[],this._count=(null===(r=t.data)||void 0===r?void 0:r.count)||0,this._initialized=!0,this._minPage=this.page,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPrev=function(){return t(o,void 0,void 0,(function(){var t,e,a,r,o,n;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),t=this._minPage-1,[4,this.listCustomerReviewSummary(t,this.limit)];case 2:return e=i.sent(),this.data=(null===(o=null===(r=e.data)||void 0===r?void 0:r.data)||void 0===o?void 0:o.concat(this.data))||this.data,this._count=(null===(n=e.data)||void 0===n?void 0:n.count)||this._count,this._minPage=t,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(o,void 0,void 0,(function(){var t,e,a,r;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading||!this.hasNext)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listCustomerReviewSummary(this.page+1,this.limit)];case 2:return t=i.sent(),this.data=this.data.concat((null===(a=t.data)||void 0===a?void 0:a.data)||[]),this._count=(null===(r=t.data)||void 0===r?void 0:r.count)||this._count,this._page=this.page+1,[3,5];case 3:return e=i.sent(),console.log(e),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(e){return t(o,void 0,void 0,(function(){var t,a,r,o;return i(this,(function(i){switch(i.label){case 0:if(this._isLoading)return[2];this._isLoading=!0,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.listCustomerReviewSummary(e,this.limit)];case 2:return t=i.sent(),this.data=(null===(r=t.data)||void 0===r?void 0:r.data)||[],this._count=(null===(o=t.data)||void 0===o?void 0:o.count)||0,this._page=e,this._minPage=e,[3,5];case 3:return a=i.sent(),console.log(a),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.data=a.data?a.data.map((function(t){return new r(t)})):[],this._limit=a.limit||5,this._page=a.page||1,this._count=a.count||0,this._initialized=a.initialized||!1,this._minPage=a.minPage,this._productId=a.productId,e(this)}return Object.defineProperty(o.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"hasPrev",{get:function(){return!!this._minPage&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"hasNext",{get:function(){return this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),o.prototype.listCustomerReviewSummary=function(e,r){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,a.listCustomerReviewSummary({productId:{eq:this._productId},pagination:{page:e,limit:r}})];case 1:return[2,t.sent()]}}))}))},o.prototype.toJSON=function(){return{data:this.data,limit:this._limit,page:this._page,count:this._count,initialized:this._initialized,minPage:this._minPage,productId:this._productId}},o}();export{o as IkasCustomerReviewSummaryList};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as i}from'./../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import s from"lodash/debounce";import"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import{IkasThemeJsonPageType as o,IkasCategoryProductsOrderType as a,IkasThemeJsonStockPreference as n}from"@ikas/storefront-models";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import{IkasFilterCategory as d}from"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import{IkasProductFilter as c,IkasProductFilterValue as u}from"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import{IkasProduct as l}from"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";import p from"../../../store/product/index.js";import h from"query-string";import{SortByDirectionEnum as f,SortByTypeEnum as m,GetSuggestedProductsMethodEnum as g}from"@ikas/storefront-api";import{IkasStorefrontConfig as _}from"@ikas/storefront-config";import{Analytics as v}from"../../../analytics/analytics.js";import"../../../analytics/head/index.js";import"../../../components/page/index.js";import"../../../components/page/head.js";import"react";import"next/image.js";import{IkasProductVariantFunctions as y}from"@ikas/storefront-model-functions";import"../../../components/link/index.js";import"../../../components/page-editor/loader/style.module.scss.js";import"../../../components/google-captcha/index.js";import"../blog-list/index.js";import"../blog-category-list/index.js";import"../brand-list/index.js";import"../category-list/index.js";import"../product-attribute-detail/index.js";import"../product-attribute-list/index.js";import"../customer-review-list/index.js";import"../customer-review-summary-list/index.js";import"../validator/index.js";import"../validator/rules/index.js";import"../validator/form/login.js";import"../validator/form/address.js";import"../validator/form/ikas-address.js";import"../validator/form/register.js";import"../validator/form/contact-form.js";import"../validator/form/forgot-password.js";import"../validator/form/recover-password.js";import"../validator/form/account-info.js";import"../validator/form/raffle-form.js";import"../validator/form/customer-review.js";import"../raffle-list/index.js";import"../../../pages/home.js";import"../../../pages/_slug_/index.js";import"../../../pages/pages/_slug_.js";import"../../../pages/checkout.js";import"../../../pages/account/index.js";import"../../../pages/account/addresses.js";import"../../../pages/account/orders/index.js";import"../../../pages/account/orders/_id_.js";import"../../../pages/account/login.js";import"../../../pages/account/register.js";import"../../../pages/account/forgot-password.js";import"../../../pages/account/recover-password.js";import"../../../pages/cart.js";import"../../../pages/editor.js";import"../../../pages/account/favorite-products.js";import"../../../pages/search.js";import"next/error.js";import"../../../pages/blog/index.js";import"../../../pages/blog/_slug_.js";import"../../../pages/raffle/_slug_.js";import"../../../pages/raffle/index.js";import"../../../pages/account/raffles.js";import"../../../pages/account/activate.js";import{IkasBaseStore as E}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";import"lodash/get";var I,S,C,T,A,P=function(){function I(a,n){var u=this;this.filters=null,this._filterCategories=null,this._infiniteScrollPage=null,this._initialized=!1,this._minPage=null,this._filterBrandId=null,this._filterCategoryId=null,this._relatedProductData=null,this._viewedTogetherProductData=null,this.pageSpecificData=null,this._recommendFor=null,this._isLoading=!1,this._fetchRequestTime=0,this.router=null,this._excludedFields=null,this._disabledSortTypes=null,this.applyFilters=function(){return t(u,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getInitial()];case 1:return t=e.sent(),[o.CATEGORY,o.BRAND,o.SEARCH].includes(this._pageType)?(t&&this.setQueryParams(),[2]):[2]}}))}))},this.getSelectedVariant=function(t){return t.variants[0]},this.getInitial=function(r,s){return t(u,void 0,void 0,(function(){var t,o,a,n,d,c,u,p,h,f,m,g,_,v,I,S=this;return e(this,(function(e){switch(e.label){case 0:this._isLoading=!0,t=Date.now(),this._fetchRequestTime=t,e.label=1;case 1:return e.trys.push([1,14,15,16]),o=s?this._page:1,a=this._limit,!this.isFilterable||this.filters?[3,3]:[4,this.getFilters()];case 2:e.sent(),e.label=3;case 3:return this.applyQueryParamFilters(r),this.isSearch&&!this.hasAppliedfilter?(this.data=[],this._page=1,this._minPage=1,this._count=0,this._initialized=!0,[2,!0]):(n=void 0,d=!1,this.isStatic?(o=void 0,a=200,[3,10]):[3,4]);case 4:return this.isDiscounted?(o=1,a=10,[3,10]):[3,5];case 5:return this.isRecommended?(o=1,a=10,[3,10]):[3,6];case 6:return this.isLastViewed?this.isBrowser()?[4,this.waitForCustomerStoreInit()]:[3,9]:[3,10];case 7:return e.sent(),[4,E.getInstance().customerStore.getLastViewedProducts()];case 8:return(c=e.sent())&&c.length?(n=c.map((function(t){return t.productId})),d=E.getInstance().customerStore.useLastViewedProductResponse,[3,10]):[2];case 9:return[2];case 10:return d?(p=E.getInstance().customerStore._savedLastViewedProductsResponse,[3,13]):[3,11];case 11:return[4,this.searchProducts(o||1,a||10,n)];case 12:p=e.sent(),e.label=13;case 13:return(u=p)&&this._fetchRequestTime===t?(h=[],!d&&this.isLastViewed&&E.getInstance().customerStore.setSavedLastViewedProductsResponse(u),this.isStatic||this.isLastViewed?(f=this.isStatic?this._productListPropValue.productIds:E.getInstance().customerStore._lastViewedProducts,h=(null==f?void 0:f.map((function(t){var e,r,s=null===(r=null===(e=u.data)||void 0===e?void 0:e.data)||void 0===r?void 0:r.find((function(e){return e.id===t.productId})),o=null==s?void 0:s.variants.find((function(e){return e.id===t.variantId}));if((null==o?void 0:o.isActive)&&y.hasStock(o)||(o=null==s?void 0:s.variants.find((function(t){return t.isActive&&y.hasStock(t)}))),s&&o)return new l(i(i({},s),{selectedVariantValues:o.variantValues}))})).filter((function(t){return!!t})))||[]):h=(null===(_=null===(g=u.data)||void 0===g?void 0:g.data)||void 0===_?void 0:_.map((function(t){var e=S.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})))||[],this.applyFacets(null===(v=u.data)||void 0===v?void 0:v.facets),this.data=h,this._count=(null===(I=u.data)||void 0===I?void 0:I.count)||0,this._initialized=!0,this._page=o||1,this._minPage=this.page,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),s||(this._infiniteScrollPage=null),this.handleListingEvent(),[2,!0]):[2];case 14:return m=e.sent(),console.log(m),[3,16];case 15:return t===this._fetchRequestTime&&(this._isLoading=!1),[7];case 16:return[2]}}))}))},this.getPrev=function(){return t(u,void 0,void 0,(function(){var t,r,s,o,a,n,d,c=this;return e(this,(function(e){switch(e.label){case 0:if(this.isStatic||this.isDiscounted||this.isRecommended||this.isLastViewed||this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),t=this._minPage-1,[4,this.searchProducts(t,this.limit)];case 2:return(r=e.sent())?(s=null===(n=null===(a=r.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.map((function(t){var e=c.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})),this.data=(null==s?void 0:s.concat(this.data))||this.data,this._count=(null===(d=r.data)||void 0===d?void 0:d.count)||this._count,this._minPage=t,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),[3,5]):[2];case 3:return o=e.sent(),console.log(o),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(u,void 0,void 0,(function(){var t,r,s,o,a,n,d=this;return e(this,(function(e){switch(e.label){case 0:if(this.isStatic||this.isDiscounted||this.isRecommended||this.isLastViewed||this._isLoading||!this.hasNext)return[2];this._isLoading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,this.searchProducts(this.page+1,this.limit)];case 2:return(t=e.sent())?(r=null===(a=null===(o=t.data)||void 0===o?void 0:o.data)||void 0===a?void 0:a.map((function(t){var e=d.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})),this.data=this.data.concat(r||[]),this._count=(null===(n=t.data)||void 0===n?void 0:n.count)||this._count,this._page=this.page+1,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),[3,5]):[2];case 3:return s=e.sent(),console.log(s),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(r){return t(u,void 0,void 0,(function(){var t,s,o,a,n,d,c=this;return e(this,(function(e){switch(e.label){case 0:if(this._isLoading||this.isStatic||this.isDiscounted||this.isRecommended||this.isLastViewed)return[2];this._isLoading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,this.searchProducts(r,this.limit)];case 2:return(t=e.sent())?(s=null===(n=null===(a=t.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.map((function(t){var e=c.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})),this.data=s||[],this._count=(null===(d=t.data)||void 0===d?void 0:d.count)||0,this._page=r,this._minPage=r,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),[3,5]):[2];case 3:return o=e.sent(),console.log(o),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.setVisibleInfiniteScrollPage=function(t){var e;u._infiniteScrollPage!==t&&(u._infiniteScrollPage=t,_.getIsEditor()||null===(e=u.router)||void 0===e||e.replace("".concat(location.pathname).concat(u.queryParams?"?"+u.queryParams:""),void 0,{shallow:!0}))},this.searchDebouncer=s((function(){u.applyFilters()}),500),this.searchAnalyticsDebouncer=s((function(){v.search(u._searchKeyword)}),1e3);var p=a,h=a;if(this.data=a.data?a.data.map((function(t){return new l(t)})):[],this._type=p.type||h._type||p.productListPropValue.productListType||h._productListPropValue.productListType||S.ALL,this._pageType=a.pageType,this._sort=a.sort||a.productListPropValue.initialSort||C.LAST_ADDED,this._limit=a.limit||p.productListPropValue.initialLimit||h._productListPropValue.initialLimit||20,this._page=a.page||1,this._minPage=a.minPage||null,this._count=a.count||0,this._searchKeyword=a.searchKeyword||"",this._productListPropValue=p.productListPropValue||h._productListPropValue,this._filterBrandId=p.filterBrandId||h._filterBrandId||null,this._filterCategoryId=p.filterCategoryId||h._filterCategoryId||null,this._relatedProductData=p.relatedProductData||h._relatedProductData||null,this._viewedTogetherProductData=p.viewedTogetherProductData||h._viewedTogetherProductData||null,this._excludedFields=p.excludedFields||h._excludedFields||null,this._disabledSortTypes=p.disabledSortTypes||h._disabledSortTypes||null,this._recommendFor=p.recommendFor||h._recommendFor,this.filters=a.filters?a.filters.map((function(t){return new c(t,u)})):null,this._filterCategories=a.filterCategories?a.filterCategories.map((function(t){return new d(t)})):null,this.pageSpecificData=p.pageSpecificData||h.pageSpecificData||null,this.router=n,r(this,{router:!1}),this.setPageSpecificSort(),this.setIsFilteredForProducts(),this.setIsStaticForProducts(),this.isBrowser())if(this.restoreInfiniteScrollPage(),location.search&&(this.isFilterable||this._type===S.SEARCH)){var f=this.getQueryParams();this.getInitial(f,this._page>1)}else this._page>1?this.getInitial(void 0,!0):this.isLastViewed?this.getInitial():this.handleListingEvent()}return Object.defineProperty(I.prototype,"sort",{get:function(){return this._sort},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"pageType",{get:function(){return this._pageType},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"minPage",{get:function(){return this._minPage||1},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"searchKeyword",{get:function(){return this._searchKeyword},set:function(t){t!==this._searchKeyword&&(this._searchKeyword=t,this.searchDebouncer(),this.searchAnalyticsDebouncer())},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isFilterable",{get:function(){return this._type===S.ALL||this._type===S.CATEGORY},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isFiltered",{get:function(){var t,e;return(null===(t=this.filters)||void 0===t?void 0:t.some((function(t){return!!t.valueList.length})))||!!this._searchKeyword||this._pageType!==o.CATEGORY&&(!!this._filterCategoryId||(null===(e=this._filterCategories)||void 0===e?void 0:e.some((function(t){return t.isSelected}))))},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isStatic",{get:function(){return this._type===S.STATIC},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isDiscounted",{get:function(){return this._type===S.DISCOUNTED},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isRecommended",{get:function(){return this._type===S.RECOMMENDED},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isLastViewed",{get:function(){return this._type===S.LAST_VIEWED},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isRelatedProducts",{get:function(){return this._type===S.RELATED_PRODUCTS},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isViewedTogetherProducts",{get:function(){return this._type===S.VIEWED_TOGETHER},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isSearch",{get:function(){return this._type===S.SEARCH},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"hasPrev",{get:function(){return!(this.isStatic||this.isDiscounted||this.isRecommended||!this._minPage)&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"hasNext",{get:function(){return!(this.isStatic||this.isDiscounted||this.isRecommended)&&this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"queryParams",{get:function(){var t,e,i,r,s=this,a={};if(null===(t=this.filters)||void 0===t||t.forEach((function(t){t.keyList.length&&(a[t.key]=t.keyList)})),this._searchKeyword&&(a.s=this._searchKeyword),this._sort&&(a.o=b[this._sort]),this._infiniteScrollPage&&(a.page=this._infiniteScrollPage),this._pageType!==o.CATEGORY){var n=null===(e=this.filterCategories)||void 0===e?void 0:e.filter((function(t){return t.isSelected}));if(!!(null==n?void 0:n.length))a.c=null==n?void 0:n.map((function(t){return t.slug}));else if(this._filterCategoryId){var d=null===(r=null===(i=this.filterCategories)||void 0===i?void 0:i.find((function(t){return t.id===s._filterCategoryId})))||void 0===r?void 0:r.slug;d&&(a.c=d)}}return h.stringify(a,{arrayFormat:"comma"})},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"filterCategories",{get:function(){var t;return null===(t=this._filterCategories)||void 0===t?void 0:t.filter((function(t){return 0!==t.resultCount}))},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"hasAppliedfilter",{get:function(){var t;return!!this._searchKeyword||(null===(t=this.filters)||void 0===t?void 0:t.some((function(t){return!!t.valueList.length})))},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isFeaturedSortEnabled",{get:function(){var t;return(null===(t=this.pageSpecificData)||void 0===t?void 0:t.orderType)===a.MANUALLY&&[S.ALL,S.CATEGORY].includes(this._type)},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"disabledSortTypes",{get:function(){return this._disabledSortTypes},enumerable:!1,configurable:!0}),I.prototype.setIsFilteredForProducts=function(){var t=this;this.data.forEach((function(e){return e.isFiltered=t.isFiltered||!1}))},I.prototype.setIsStaticForProducts=function(){var t=this;this.data.forEach((function(e){return e.isStatic=t.isStatic||!1}))},I.prototype.setPageSpecificSort=function(){var t;if((null===(t=this.pageSpecificData)||void 0===t?void 0:t.orderType)&&[S.ALL].includes(this._type))switch(this.pageSpecificData.orderType){case a.HIGHEST_DISCOUNT_RATIO:this._sort=C.DECRASING_DISCOUNT;break;case a.LOWEST_DISCOUNT_RATIO:this._sort=C.INCREASING_DISCOUNT;break;case a.HIGHEST_PRICE:this._sort=C.DECREASING_PRICE;break;case a.LOWEST_PRICE:this._sort=C.INCREASING_PRICE;break;case a.NEWEST:this._sort=C.LAST_ADDED;break;case a.OLDEST:this._sort=C.FIRST_ADDED;break;case a.MANUALLY:this._sort=C.FEATURED}},I.prototype.getSortParams=function(){var t,e;switch(this._sort){case C.INCREASING_PRICE:t=f.ASC,e=m.PRICE;break;case C.DECREASING_PRICE:t=f.DESC,e=m.PRICE;break;case C.FIRST_ADDED:t=f.ASC,e=m.CREATED_AT;break;case C.LAST_ADDED:t=f.DESC,e=m.CREATED_AT;break;case C.INCREASING_DISCOUNT:t=f.ASC,e=m.DISCOUNT_RATIO;break;case C.DECRASING_DISCOUNT:t=f.DESC,e=m.DISCOUNT_RATIO;break;case C.FEATURED:if(this.isSearch)return;t=f.ASC,e=m.MANUAL_SORT;break;case C.DEFAULT:t=void 0,e=void 0;break;case C.AVERAGE_RATING:t=f.DESC,e=m.AVERAGE_RATING;break;case C.REVIEW_COUNT:t=f.DESC,e=m.REVIEW_COUNT;break;case C.SALE_COUNT:t=f.DESC,e=m.SALE_COUNT;break;case C.A_Z:t=f.ASC,e=m.NAME;break;case C.Z_A:t=f.DESC,e=m.NAME}if(t&&e)return{direction:t,type:e}},I.prototype.searchProducts=function(i,r,s){var a,d,c;return t(this,void 0,void 0,(function(){var t,l,h,f,m;return e(this,(function(e){switch(e.label){case 0:return t=[],l=[],null===(a=this.filters)||void 0===a||a.forEach((function(e){e.valueList.length&&t.push(new u({id:e.id,type:e.type,displayType:e.displayType,valueList:e.valueList})),e.isFacetFilter&&l.push({id:e.id,type:e.type,displayType:e.displayType})})),h=null===(d=this._filterCategories)||void 0===d?void 0:d.filter((function(t){return t.isSelected})).map((function(t){return t.id})),f=this.getSortParams(),this.isRelatedProducts&&this._relatedProductData?[4,p.getSuggestedProducts({priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),productId:this._relatedProductData.productId,brandIds:this._relatedProductData.brandIds,categoryIds:this._relatedProductData.categoryIds,locale:_.getCurrentLocale()})]:[3,2];case 1:case 3:case 5:return[2,e.sent()];case 2:return this.isViewedTogetherProducts&&this._viewedTogetherProductData?[4,p.getSuggestedProducts({priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),method:g.VIEWED_TOGETHER,productIds:this._viewedTogetherProductData.productIds,locale:_.getCurrentLocale()})]:[3,4];case 4:return m={input:{page:i,perPage:r,productIdList:this.isStatic?null===(c=this._productListPropValue.productIds)||void 0===c?void 0:c.map((function(t){return t.productId})):s,filterList:t,facetList:l,brandId:this._pageType===o.BRAND&&this._type!==S.SEARCH?this._filterBrandId:void 0,categoryIdList:h&&h.length?h:this._filterCategoryId?[this._filterCategoryId]:void 0,priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),query:this._searchKeyword,order:f?[f]:[],showStockOption:_.getStockPreference()||n.SHOW_ALL}},[4,p.searchProducts(m,this._excludedFields)]}}))}))},I.prototype.getFilters=function(){var i,r,s,a;return t(this,void 0,void 0,(function(){var t,n,d=this;return e(this,(function(e){switch(e.label){case 0:return[4,p.getProductFilterData({categoryId:this._filterCategoryId?this._filterCategoryId:void 0,locale:_.getCurrentLocale()})];case 1:return t=e.sent(),this.filters=null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.filters.map((function(t){return new c(t,d)})),this._filterCategories=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.categories,this._disabledSortTypes=null===(s=t.data)||void 0===s?void 0:s.disabledSortTypes,this.pageType!==o.CATEGORY&&this._filterCategoryId&&(n=null===(a=this._filterCategories)||void 0===a?void 0:a.find((function(t){return t.id===d._filterCategoryId})))&&(n.isSelected=!0),this.filters&&this.filters.sort((function(t,e){return t.order>e.order?1:-1})),[2]}}))}))},I.prototype.applyQueryParamFilters=function(t){var e,i=this;try{null==t||t.forEach((function(t,e){var r,s=null===(r=i.filters)||void 0===r?void 0:r.find((function(t){return t.key===e}));s&&s.applyQueryParam(t)}));var r=null==t?void 0:t.get("s");r&&(this._searchKeyword=r);var s=null==t?void 0:t.get("o");if(s){var a=parseInt(s),n=Object.entries(b).find((function(t){return t[1]===a}));n&&(this._sort=n[0])}if(this._pageType!==o.CATEGORY){var d=null==t?void 0:t.get("c"),c=null==d?void 0:d.split(",");c&&c.length&&(null===(e=this.filterCategories)||void 0===e||e.forEach((function(t){t.isSelected=c.some((function(e){return e===t.slug}))})))}}catch(t){console.log(t)}},I.prototype.applyFacets=function(t){var e,i;null===(e=this.filters)||void 0===e||e.forEach((function(e){var i,r,s,o=null==t?void 0:t.find((function(t){return t.id===e.id}));o?null===(i=e.values)||void 0===i||i.forEach((function(t){var i=o.values.find((function(e){return e.id===t.id}));i?t.resultCount=i.count:e.isCustomValueFilter?t.resultCount=null:t.resultCount=0})):e.isCustomValueFilter?null===(r=e.values)||void 0===r||r.forEach((function(t){return t.resultCount=null})):null===(s=e.values)||void 0===s||s.forEach((function(t){return t.resultCount=0}))}));var r=null==t?void 0:t.find((function(t){return"category"===t.id}));r&&(null===(i=this._filterCategories)||void 0===i||i.forEach((function(t){var e=r.values.find((function(e){return e.id===t.id}));t.resultCount=e?e.count:0})))},I.prototype.setQueryParams=function(){var t;!this.isBrowser()||this.isSearch||_.getIsEditor()||null===(t=this.router)||void 0===t||t.replace("".concat(location.pathname).concat(this.queryParams?"?"+this.queryParams:""),void 0,{shallow:!0})},I.prototype.clearFilters=function(){var t,e;null===(t=this.filters)||void 0===t||t.forEach((function(t){return t.clear()})),this._searchKeyword="",this._pageType!==o.CATEGORY&&(this._filterCategoryId=void 0),null===(e=this._filterCategories)||void 0===e||e.forEach((function(t){return t.isSelected=!1})),this.applyFilters()},I.prototype.setSortType=function(i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this._sort=i,[4,this.getInitial()];case 1:return t.sent()&&this.setQueryParams(),[2]}}))}))},I.prototype.onFilterCategoryClick=function(i,r){var s,o;return void 0===r&&(r=!1),t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return r?(null===(s=this._filterCategories)||void 0===s||s.forEach((function(t){t.id===i.id&&(t.isSelected=!t.isSelected)})),[4,this.applyFilters()]):[3,2];case 1:return t.sent(),[3,3];case 2:_.getIsEditor()||null===(o=E.getInstance().router)||void 0===o||o.push(i.href+(this.queryParams?"?"+this.queryParams:"")),t.label=3;case 3:return[2]}}))}))},I.prototype.toJSON=function(){return{data:this.data,type:this._type,pageType:this._pageType,sort:this._sort,limit:this._limit,page:this._page,count:this._count,searchKeyword:this._searchKeyword,initialized:this._initialized,minPage:this._minPage,filterBrandId:this._filterBrandId,filterCategoryId:this._filterCategoryId,filterCategories:this._filterCategories,filters:this.filters,recommendFor:this._recommendFor,productListPropValue:this._productListPropValue}},I.prototype.restoreInfiniteScrollPage=function(){var t=this.getQueryParams(),e=null==t?void 0:t.get("page");if(e){var i=parseInt(e);isNaN(i)||(this._page=i,this._infiniteScrollPage=i)}},I.prototype.getQueryParams=function(){if(this.isBrowser())return new URLSearchParams(location.search)},I.prototype.isBrowser=function(){return"undefined"!=typeof window},I.prototype.waitForCustomerStoreInit=function(){return new Promise((function(t){var e=setInterval((function(){E.getInstance().customerStore.initialized&&(clearInterval(e),t(null))}),1e3)}))},I.prototype.handleListingEvent=function(){this.searchKeyword&&this.data.length?v.viewSearchResults(this._searchKeyword,this.data):this.data.length&&this._type===S.ALL&&v.viewListing(this.data)},I}();!function(t){t.ALL="ALL",t.STATIC="STATIC",t.DISCOUNTED="DISCOUNTED",t.RECOMMENDED="RECOMMENDED",t.CATEGORY="CATEGORY",t.SEARCH="SEARCH",t.LAST_VIEWED="LAST_VIEWED",t.RELATED_PRODUCTS="RELATED_PRODUCTS",t.VIEWED_TOGETHER="VIEWED_TOGETHER"}(S||(S={})),function(t){t.INCREASING_PRICE="INCREASING_PRICE",t.DECREASING_PRICE="DECREASING_PRICE",t.LAST_ADDED="LAST_ADDED",t.FIRST_ADDED="FIRST_ADDED",t.INCREASING_DISCOUNT="INCREASING_DISCOUNT",t.DECRASING_DISCOUNT="DECRASING_DISCOUNT",t.FEATURED="FEATURED",t.DEFAULT="DEFAULT",t.AVERAGE_RATING="AVERAGE_RATING",t.REVIEW_COUNT="REVIEW_COUNT",t.SALE_COUNT="SALE_COUNT",t.A_Z="A_Z",t.Z_A="Z_A"}(C||(C={})),function(t){t.AVERAGE_RATING="AVERAGE_RATING",t.CREATED_AT="CREATED_AT",t.DISCOUNT_RATIO="DISCOUNT_RATIO",t.MANUAL_SORT="MANUAL_SORT",t.NAME="NAME",t.PRICE="PRICE",t.REVIEW_COUNT="REVIEW_COUNT",t.SALE_COUNT="SALE_COUNT"}(T||(T={})),function(t){t.CATEGORY="CATEGORY",t.BRAND="BRAND"}(A||(A={}));var b=((I={})[C.INCREASING_PRICE]=1,I[C.DECREASING_PRICE]=2,I[C.LAST_ADDED]=3,I[C.FIRST_ADDED]=4,I[C.INCREASING_DISCOUNT]=5,I[C.DECRASING_DISCOUNT]=6,I[C.FEATURED]=7,I[C.DEFAULT]=8,I[C.AVERAGE_RATING]=9,I[C.REVIEW_COUNT]=10,I[C.SALE_COUNT]=11,I[C.A_Z]=12,I[C.Z_A]=13,I);export{P as IkasProductList,T as IkasProductListSortByTypeEnum,C as IkasProductListSortType,S as IkasProductListType,A as IkasRelatedProductsType};
1
+ import{__awaiter as t,__generator as e,__assign as i}from'./../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as r}from"mobx";import s from"lodash/debounce";import"../../data/blog/category/index.js";import"../../data/blog/content/index.js";import"../../data/blog/meta-data/index.js";import"../../data/blog/tag/index.js";import"../../data/blog/index.js";import"../../data/brand/index.js";import{IkasThemeJsonPageType as o,IkasCategoryProductsOrderType as a,IkasThemeJsonStockPreference as n}from"@ikas/storefront-models";import"../../data/campaign-offer/index.js";import"../../data/cart/campaign-offer/index.js";import"../../data/cart/index.js";import"../../data/category/path-item/index.js";import"../../data/category/index.js";import"../../data/checkout/index.js";import"../../data/checkout-settings/index.js";import"../../data/city/index.js";import"../../data/country/index.js";import"../../data/customer/address/region/index.js";import"../../data/customer/address/index.js";import"../../data/customer/address/ikas-localized-customer-address.js";import"../../data/customer/attribute/index.js";import"../../data/customer/review/summary/index.js";import"../../data/customer/review/index.js";import"../../data/customer/index.js";import"../../data/customer-form-data-input/index.js";import"../../data/district/index.js";import"../../data/favorite-product/index.js";import{IkasFilterCategory as d}from"../../data/filter-category/index.js";import"../../data/html-meta-data/index.js";import"../../data/image/index.js";import"../../data/order/address/region/index.js";import"../../data/order/address/index.js";import"../../data/order/line-item/option/value/index.js";import"../../data/order/line-item/variant/value/index.js";import"../../data/order/line-item/variant/index.js";import"../../data/order/line-item/index.js";import"../../data/order/package/index.js";import"../../data/order/transaction/index.js";import"../../data/order/index.js";import"../../data/payment-gateway/index.js";import"../../data/product/attribute-value/index.js";import{IkasProductFilter as u,IkasProductFilterValue as c}from"../../data/product/filter/index.js";import"../../data/product/campaign-offer/index.js";import"../../data/product/option-set/option/index.js";import"../../data/product/option-set/index.js";import"../../data/product/stock-location/index.js";import"../../data/product/variant/price/index.js";import"../../data/product/variant/index.js";import"../../data/variant-type/index.js";import{IkasProduct as l}from"../../data/product/index.js";import"../../data/raffle/index.js";import"../../data/shipping-zone/state/city/district/region/index.js";import"../../data/state/index.js";import"../../data/storefront-popup/storefront-popup-display-filter/index.js";import"../../data/storefront-popup/storefront-popup-display-settings/index.js";import"../../data/storefront-popup/storefront-popup-page-filter/index.js";import"../../data/storefront-popup/index.js";import"../../data/theme-json/index.js";import"../../data/theme-json/component/index.js";import"../../data/theme-json/custom-data/index.js";import"../../data/variant-type/variant-value/index.js";import"@ikas/localized-address";import p from"../../../store/product/index.js";import h from"query-string";import{SortByDirectionEnum as f,SortByTypeEnum as m,GetSuggestedProductsMethodEnum as g}from"@ikas/storefront-api";import{IkasStorefrontConfig as _}from"@ikas/storefront-config";import{Analytics as v}from"../../../analytics/analytics.js";import"../../../analytics/head/index.js";import"../../../components/page/index.js";import"../../../components/page/head.js";import"react";import"next/image.js";import{IkasProductVariantFunctions as y}from"@ikas/storefront-model-functions";import"../../../components/link/index.js";import"../../../components/page-editor/loader/style.module.scss.js";import"../../../components/google-captcha/index.js";import"../blog-list/index.js";import"../blog-category-list/index.js";import"../brand-list/index.js";import"../category-list/index.js";import"../product-attribute-detail/index.js";import"../product-attribute-list/index.js";import"../customer-review-list/index.js";import"../customer-review-summary-list/index.js";import"../validator/index.js";import"../validator/rules/index.js";import"../validator/form/login.js";import"../validator/form/address.js";import"../validator/form/ikas-address.js";import"../validator/form/register.js";import"../validator/form/contact-form.js";import"../validator/form/forgot-password.js";import"../validator/form/recover-password.js";import"../validator/form/account-info.js";import"../validator/form/raffle-form.js";import"../validator/form/customer-review.js";import"../raffle-list/index.js";import"../../../pages/home.js";import"../../../pages/_slug_/index.js";import"../../../pages/pages/_slug_.js";import"../../../pages/checkout.js";import"../../../pages/account/index.js";import"../../../pages/account/addresses.js";import"../../../pages/account/orders/index.js";import"../../../pages/account/orders/_id_.js";import"../../../pages/account/login.js";import"../../../pages/account/register.js";import"../../../pages/account/forgot-password.js";import"../../../pages/account/recover-password.js";import"../../../pages/cart.js";import"../../../pages/editor.js";import"../../../pages/account/favorite-products.js";import"../../../pages/search.js";import"next/error.js";import"../../../pages/blog/index.js";import"../../../pages/blog/_slug_.js";import"../../../pages/raffle/_slug_.js";import"../../../pages/raffle/index.js";import"../../../pages/account/raffles.js";import"../../../pages/account/activate.js";import{IkasBaseStore as E}from"../../../store/base.js";import"../../../store/customer/index.js";import"../../../store/cart/index.js";import"lodash/get";var I,S,C,T,A,P=function(){function I(a,n){var c=this;this.filters=null,this._filterCategories=null,this._infiniteScrollPage=null,this._initialized=!1,this._minPage=null,this._filterBrandId=null,this._filterCategoryId=null,this._relatedProductData=null,this._viewedTogetherProductData=null,this.pageSpecificData=null,this._recommendFor=null,this._isLoading=!1,this._fetchRequestTime=0,this.router=null,this._excludedFields=null,this._disabledSortTypes=null,this.applyFilters=function(){return t(c,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,this.getInitial()];case 1:return t=e.sent(),[o.CATEGORY,o.BRAND,o.SEARCH].includes(this._pageType)?(t&&this.setQueryParams(),[2]):[2]}}))}))},this.getSelectedVariant=function(t){return t.variants[0]},this.getInitial=function(r,s){return t(c,void 0,void 0,(function(){var t,o,a,n,d,u,c,p,h,f,m,g,_,v,I,S=this;return e(this,(function(e){switch(e.label){case 0:this._isLoading=!0,t=Date.now(),this._fetchRequestTime=t,e.label=1;case 1:return e.trys.push([1,14,15,16]),o=s?this._page:1,a=this._limit,!this.isFilterable||this.filters?[3,3]:[4,this.getFilters()];case 2:e.sent(),e.label=3;case 3:return this.applyQueryParamFilters(r),this.isSearch&&!this.hasAppliedfilter?(this.data=[],this._page=1,this._minPage=1,this._count=0,this._initialized=!0,[2,!0]):(n=void 0,d=!1,this.isStatic?(o=void 0,a=200,[3,10]):[3,4]);case 4:return this.isDiscounted?(o=1,a=10,[3,10]):[3,5];case 5:return this.isRecommended?(o=1,a=10,[3,10]):[3,6];case 6:return this.isLastViewed?this.isBrowser()?[4,this.waitForCustomerStoreInit()]:[3,9]:[3,10];case 7:return e.sent(),[4,E.getInstance().customerStore.getLastViewedProducts()];case 8:return(u=e.sent())&&u.length?(n=u.map((function(t){return t.productId})),d=E.getInstance().customerStore.useLastViewedProductResponse,[3,10]):[2];case 9:return[2];case 10:return d?(p=E.getInstance().customerStore._savedLastViewedProductsResponse,[3,13]):[3,11];case 11:return[4,this.searchProducts(o||1,a||10,n)];case 12:p=e.sent(),e.label=13;case 13:return(c=p)&&this._fetchRequestTime===t?(h=[],!d&&this.isLastViewed&&E.getInstance().customerStore.setSavedLastViewedProductsResponse(c),this.isStatic||this.isLastViewed?(f=this.isStatic?this._productListPropValue.productIds:E.getInstance().customerStore._lastViewedProducts,h=(null==f?void 0:f.map((function(t){var e,r,s=null===(r=null===(e=c.data)||void 0===e?void 0:e.data)||void 0===r?void 0:r.find((function(e){return e.id===t.productId})),o=null==s?void 0:s.variants.find((function(e){return e.id===t.variantId}));if((null==o?void 0:o.isActive)&&y.hasStock(o)||(o=null==s?void 0:s.variants.find((function(t){return t.isActive&&y.hasStock(t)}))),s&&o)return new l(i(i({},s),{selectedVariantValues:o.variantValues}))})).filter((function(t){return!!t})))||[]):h=(null===(_=null===(g=c.data)||void 0===g?void 0:g.data)||void 0===_?void 0:_.map((function(t){var e=S.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})))||[],this.applyFacets(null===(v=c.data)||void 0===v?void 0:v.facets),this.data=h,this._count=(null===(I=c.data)||void 0===I?void 0:I.count)||0,this._initialized=!0,this._page=o||1,this._minPage=this.page,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),s||(this._infiniteScrollPage=null),this.handleListingEvent(),[2,!0]):[2];case 14:return m=e.sent(),console.log(m),[3,16];case 15:return t===this._fetchRequestTime&&(this._isLoading=!1),[7];case 16:return[2]}}))}))},this.getPrev=function(){return t(c,void 0,void 0,(function(){var t,r,s,o,a,n,d,u=this;return e(this,(function(e){switch(e.label){case 0:if(this.isStatic||this.isDiscounted||this.isRecommended||this.isLastViewed||this._isLoading||!this.hasPrev)return[2];this._isLoading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),t=this._minPage-1,[4,this.searchProducts(t,this.limit)];case 2:return(r=e.sent())?(s=null===(n=null===(a=r.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.map((function(t){var e=u.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})),this.data=(null==s?void 0:s.concat(this.data))||this.data,this._count=(null===(d=r.data)||void 0===d?void 0:d.count)||this._count,this._minPage=t,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),[3,5]):[2];case 3:return o=e.sent(),console.log(o),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getNext=function(){return t(c,void 0,void 0,(function(){var t,r,s,o,a,n,d=this;return e(this,(function(e){switch(e.label){case 0:if(this.isStatic||this.isDiscounted||this.isRecommended||this.isLastViewed||this._isLoading||!this.hasNext)return[2];this._isLoading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,this.searchProducts(this.page+1,this.limit)];case 2:return(t=e.sent())?(r=null===(a=null===(o=t.data)||void 0===o?void 0:o.data)||void 0===a?void 0:a.map((function(t){var e=d.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})),this.data=this.data.concat(r||[]),this._count=(null===(n=t.data)||void 0===n?void 0:n.count)||this._count,this._page=this.page+1,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),[3,5]):[2];case 3:return s=e.sent(),console.log(s),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.getPage=function(r){return t(c,void 0,void 0,(function(){var t,s,o,a,n,d,u=this;return e(this,(function(e){switch(e.label){case 0:if(this._isLoading||this.isStatic||this.isDiscounted||this.isRecommended||this.isLastViewed)return[2];this._isLoading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,this.searchProducts(r,this.limit)];case 2:return(t=e.sent())?(s=null===(n=null===(a=t.data)||void 0===a?void 0:a.data)||void 0===n?void 0:n.map((function(t){var e=u.getSelectedVariant(t);return new l(i(i({},t),{selectedVariantValues:e.variantValues}))})),this.data=s||[],this._count=(null===(d=t.data)||void 0===d?void 0:d.count)||0,this._page=r,this._minPage=r,this.setIsFilteredForProducts(),this.setIsStaticForProducts(),[3,5]):[2];case 3:return o=e.sent(),console.log(o),[3,5];case 4:return this._isLoading=!1,[7];case 5:return[2]}}))}))},this.setVisibleInfiniteScrollPage=function(t){var e;c._infiniteScrollPage!==t&&(c._infiniteScrollPage=t,_.getIsEditor()||null===(e=c.router)||void 0===e||e.replace("".concat(location.pathname).concat(c.queryParams?"?"+c.queryParams:""),void 0,{shallow:!0}))},this.searchDebouncer=s((function(){c.applyFilters()}),500),this.searchAnalyticsDebouncer=s((function(){v.search(c._searchKeyword)}),1e3);var p=a,h=a;if(this.data=a.data?a.data.map((function(t){return new l(t)})):[],this._type=p.type||h._type||p.productListPropValue.productListType||h._productListPropValue.productListType||S.ALL,this._pageType=a.pageType,this._sort=a.sort||a.productListPropValue.initialSort||C.LAST_ADDED,this._limit=a.limit||p.productListPropValue.initialLimit||h._productListPropValue.initialLimit||20,this._page=a.page||1,this._minPage=a.minPage||null,this._count=a.count||0,this._searchKeyword=a.searchKeyword||"",this._productListPropValue=p.productListPropValue||h._productListPropValue,this._filterBrandId=p.filterBrandId||h._filterBrandId||null,this._filterCategoryId=p.filterCategoryId||h._filterCategoryId||null,this._relatedProductData=p.relatedProductData||h._relatedProductData||null,this._viewedTogetherProductData=p.viewedTogetherProductData||h._viewedTogetherProductData||null,this._excludedFields=p.excludedFields||h._excludedFields||null,this._disabledSortTypes=p.disabledSortTypes||h._disabledSortTypes||null,this._recommendFor=p.recommendFor||h._recommendFor,this.filters=a.filters?a.filters.map((function(t){return new u(t,c)})):null,this._filterCategories=a.filterCategories?a.filterCategories.map((function(t){return new d(t)})):null,this.pageSpecificData=p.pageSpecificData||h.pageSpecificData||null,this.router=n,r(this,{router:!1}),this.setPageSpecificSort(),this.setIsFilteredForProducts(),this.setIsStaticForProducts(),this.isBrowser())if(this.restoreInfiniteScrollPage(),location.search&&(this.isFilterable||this._type===S.SEARCH)){var f=this.getQueryParams();this.getInitial(f,this._page>1)}else this._page>1?this.getInitial(void 0,!0):this.isLastViewed?this.getInitial():this.handleListingEvent()}return Object.defineProperty(I.prototype,"sort",{get:function(){return this._sort},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"limit",{get:function(){return this._limit},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"pageType",{get:function(){return this._pageType},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"page",{get:function(){return this._page},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"minPage",{get:function(){return this._minPage||1},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"pageCount",{get:function(){return Math.ceil(this._count/this._limit)},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"searchKeyword",{get:function(){return this._searchKeyword},set:function(t){t!==this._searchKeyword&&(this._searchKeyword=t,this.searchDebouncer(),this.searchAnalyticsDebouncer())},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isInitialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isFilterable",{get:function(){return this._type===S.ALL||this._type===S.CATEGORY},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isFiltered",{get:function(){var t,e;return(null===(t=this.filters)||void 0===t?void 0:t.some((function(t){return!!t.valueList.length})))||!!this._searchKeyword||this._pageType!==o.CATEGORY&&(!!this._filterCategoryId||(null===(e=this._filterCategories)||void 0===e?void 0:e.some((function(t){return t.isSelected}))))},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isStatic",{get:function(){return this._type===S.STATIC},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isDiscounted",{get:function(){return this._type===S.DISCOUNTED},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isRecommended",{get:function(){return this._type===S.RECOMMENDED},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isLastViewed",{get:function(){return this._type===S.LAST_VIEWED},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isRelatedProducts",{get:function(){return this._type===S.RELATED_PRODUCTS},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isViewedTogetherProducts",{get:function(){return this._type===S.VIEWED_TOGETHER},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isSearch",{get:function(){return this._type===S.SEARCH},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"hasPrev",{get:function(){return!(this.isStatic||this.isDiscounted||this.isRecommended||!this._minPage)&&this._minPage>1},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"hasNext",{get:function(){return!(this.isStatic||this.isDiscounted||this.isRecommended)&&this.page*this.limit<this.count},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"queryParams",{get:function(){var t,e,i,r,s=this,a={};if(null===(t=this.filters)||void 0===t||t.forEach((function(t){t.keyList.length&&(a[t.key]=t.keyList)})),this._searchKeyword&&(a.s=this._searchKeyword),this._sort&&(a.o=b[this._sort]),this._infiniteScrollPage&&(a.page=this._infiniteScrollPage),this._pageType!==o.CATEGORY){var n=null===(e=this.filterCategories)||void 0===e?void 0:e.filter((function(t){return t.isSelected}));if(!!(null==n?void 0:n.length))a.c=null==n?void 0:n.map((function(t){return t.slug}));else if(this._filterCategoryId){var d=null===(r=null===(i=this.filterCategories)||void 0===i?void 0:i.find((function(t){return t.id===s._filterCategoryId})))||void 0===r?void 0:r.slug;d&&(a.c=d)}}return h.stringify(a,{arrayFormat:"comma"})},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"filterCategories",{get:function(){var t;return null===(t=this._filterCategories)||void 0===t?void 0:t.filter((function(t){return 0!==t.resultCount}))},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"hasAppliedfilter",{get:function(){var t;return!!this._searchKeyword||(null===(t=this.filters)||void 0===t?void 0:t.some((function(t){return!!t.valueList.length})))},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"isFeaturedSortEnabled",{get:function(){var t;return(null===(t=this.pageSpecificData)||void 0===t?void 0:t.orderType)===a.MANUALLY&&[S.ALL,S.CATEGORY].includes(this._type)},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"disabledSortTypes",{get:function(){return this._disabledSortTypes},enumerable:!1,configurable:!0}),I.prototype.setIsFilteredForProducts=function(){var t=this;this.data.forEach((function(e){return e.isFiltered=t.isFiltered||!1}))},I.prototype.setIsStaticForProducts=function(){var t=this;this.data.forEach((function(e){return e.isStatic=t.isStatic||!1}))},I.prototype.setPageSpecificSort=function(){var t;if((null===(t=this.pageSpecificData)||void 0===t?void 0:t.orderType)&&[S.ALL].includes(this._type))switch(this.pageSpecificData.orderType){case a.HIGHEST_DISCOUNT_RATIO:this._sort=C.DECRASING_DISCOUNT;break;case a.LOWEST_DISCOUNT_RATIO:this._sort=C.INCREASING_DISCOUNT;break;case a.HIGHEST_PRICE:this._sort=C.DECREASING_PRICE;break;case a.LOWEST_PRICE:this._sort=C.INCREASING_PRICE;break;case a.NEWEST:this._sort=C.LAST_ADDED;break;case a.OLDEST:this._sort=C.FIRST_ADDED;break;case a.MANUALLY:this._sort=C.FEATURED}},I.prototype.getSortParams=function(){var t,e;switch(this._sort){case C.INCREASING_PRICE:t=f.ASC,e=m.PRICE;break;case C.DECREASING_PRICE:t=f.DESC,e=m.PRICE;break;case C.FIRST_ADDED:t=f.ASC,e=m.CREATED_AT;break;case C.LAST_ADDED:t=f.DESC,e=m.CREATED_AT;break;case C.INCREASING_DISCOUNT:t=f.ASC,e=m.DISCOUNT_RATIO;break;case C.DECRASING_DISCOUNT:t=f.DESC,e=m.DISCOUNT_RATIO;break;case C.FEATURED:if(this.isSearch)return;t=f.ASC,e=m.MANUAL_SORT;break;case C.DEFAULT:t=void 0,e=void 0;break;case C.AVERAGE_RATING:t=f.DESC,e=m.AVERAGE_RATING;break;case C.REVIEW_COUNT:t=f.DESC,e=m.REVIEW_COUNT;break;case C.SALE_COUNT:t=f.DESC,e=m.SALE_COUNT;break;case C.A_Z:t=f.ASC,e=m.NAME;break;case C.Z_A:t=f.DESC,e=m.NAME}if(t&&e)return{direction:t,type:e}},I.prototype.searchProducts=function(i,r,s){var a,d,u;return t(this,void 0,void 0,(function(){var t,l,h,f,m;return e(this,(function(e){switch(e.label){case 0:return t=[],l=[],null===(a=this.filters)||void 0===a||a.forEach((function(e){e.valueList.length&&t.push(new c({id:e.id,type:e.type,displayType:e.displayType,valueList:e.valueList})),e.isFacetFilter&&l.push({id:e.id,type:e.type,displayType:e.displayType})})),h=null===(d=this._filterCategories)||void 0===d?void 0:d.filter((function(t){return t.isSelected})).map((function(t){return t.id})),f=this.getSortParams(),this.isRelatedProducts&&this._relatedProductData?[4,p.getSuggestedProducts({priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),productId:this._relatedProductData.productId,brandIds:this._relatedProductData.brandIds,categoryIds:this._relatedProductData.categoryIds,locale:_.getCurrentLocale()})]:[3,2];case 1:case 3:case 5:return[2,e.sent()];case 2:return this.isViewedTogetherProducts&&this._viewedTogetherProductData?[4,p.getSuggestedProducts({priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),method:g.VIEWED_TOGETHER,productIds:this._viewedTogetherProductData.productIds,locale:_.getCurrentLocale()})]:[3,4];case 4:return m={input:{page:i,perPage:r,productIdList:this.isStatic?null===(u=this._productListPropValue.productIds)||void 0===u?void 0:u.map((function(t){return t.productId})):s,filterList:t,facetList:l,brandId:this._pageType===o.BRAND&&this._type!==S.SEARCH?this._filterBrandId:void 0,categoryIdList:h&&h.length?h:this._filterCategoryId?[this._filterCategoryId]:void 0,priceListId:_.getPriceListId(),salesChannelId:_.getSalesChannelId(),query:this._searchKeyword,order:f?[f]:[],showStockOption:_.getStockPreference()||n.SHOW_ALL}},[4,p.searchProducts(m,this._excludedFields)]}}))}))},I.prototype.getFilters=function(){var i,r,s,a;return t(this,void 0,void 0,(function(){var t,n,d=this;return e(this,(function(e){switch(e.label){case 0:return[4,p.getProductFilterData({categoryId:this._filterCategoryId?this._filterCategoryId:void 0,locale:_.getCurrentLocale()})];case 1:return t=e.sent(),this.filters=null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.filters.map((function(t){return new u(t,d)})),this._filterCategories=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.categories,this._disabledSortTypes=null===(s=t.data)||void 0===s?void 0:s.disabledSortTypes,this.pageType!==o.CATEGORY&&this._filterCategoryId&&(n=null===(a=this._filterCategories)||void 0===a?void 0:a.find((function(t){return t.id===d._filterCategoryId})))&&(n.isSelected=!0),this.filters&&this.filters.sort((function(t,e){return t.order>e.order?1:-1})),[2]}}))}))},I.prototype.applyQueryParamFilters=function(t){var e,i=this;try{null==t||t.forEach((function(t,e){var r,s=null===(r=i.filters)||void 0===r?void 0:r.find((function(t){return t.key===e}));s&&s.applyQueryParam(t)}));var r=null==t?void 0:t.get("s");r&&(this._searchKeyword=r);var s=null==t?void 0:t.get("o");if(s){var a=parseInt(s),n=Object.entries(b).find((function(t){return t[1]===a}));n&&(this._sort=n[0])}if(this._pageType!==o.CATEGORY){var d=null==t?void 0:t.get("c"),u=null==d?void 0:d.split(",");u&&u.length&&(null===(e=this.filterCategories)||void 0===e||e.forEach((function(t){t.isSelected=u.some((function(e){return e===t.slug}))})))}}catch(t){console.log(t)}},I.prototype.applyFacets=function(t){var e,i;null===(e=this.filters)||void 0===e||e.forEach((function(e){var i,r,s,o=null==t?void 0:t.find((function(t){return t.id===e.id}));o?null===(i=e.values)||void 0===i||i.forEach((function(t){var i=o.values.find((function(e){return e.id===t.id}));i?t.resultCount=i.count:e.isCustomValueFilter?t.resultCount=null:t.resultCount=0})):e.isCustomValueFilter?null===(r=e.values)||void 0===r||r.forEach((function(t){return t.resultCount=null})):null===(s=e.values)||void 0===s||s.forEach((function(t){return t.resultCount=0}))}));var r=null==t?void 0:t.find((function(t){return"category"===t.id}));r&&(null===(i=this._filterCategories)||void 0===i||i.forEach((function(t){var e=r.values.find((function(e){return e.id===t.id}));t.resultCount=e?e.count:0})))},I.prototype.setQueryParams=function(){var t;!this.isBrowser()||this.isSearch||_.getIsEditor()||null===(t=this.router)||void 0===t||t.replace("".concat(location.pathname).concat(this.queryParams?"?"+this.queryParams:""),void 0,{shallow:!0})},I.prototype.clearFilters=function(){var t,e;null===(t=this.filters)||void 0===t||t.forEach((function(t){return t.clear()})),this._searchKeyword="",this._pageType!==o.CATEGORY&&(this._filterCategoryId=void 0),null===(e=this._filterCategories)||void 0===e||e.forEach((function(t){return t.isSelected=!1})),this.applyFilters()},I.prototype.setSortType=function(i){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return this._sort=i,[4,this.getInitial()];case 1:return t.sent()&&this.setQueryParams(),[2]}}))}))},I.prototype.onFilterCategoryClick=function(i,r){var s,o;return void 0===r&&(r=!1),t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return r?(null===(s=this._filterCategories)||void 0===s||s.forEach((function(t){t.id===i.id&&(t.isSelected=!t.isSelected)})),[4,this.applyFilters()]):[3,2];case 1:return t.sent(),[3,3];case 2:_.getIsEditor()||null===(o=E.getInstance().router)||void 0===o||o.push(i.href+(this.queryParams?"?"+this.queryParams:"")),t.label=3;case 3:return[2]}}))}))},I.prototype.toJSON=function(){return{data:this.data,type:this._type,pageType:this._pageType,sort:this._sort,limit:this._limit,page:this._page,count:this._count,searchKeyword:this._searchKeyword,initialized:this._initialized,minPage:this._minPage,filterBrandId:this._filterBrandId,filterCategoryId:this._filterCategoryId,filterCategories:this._filterCategories,filters:this.filters,recommendFor:this._recommendFor,productListPropValue:this._productListPropValue}},I.prototype.restoreInfiniteScrollPage=function(){var t=this.getQueryParams(),e=null==t?void 0:t.get("page");if(e){var i=parseInt(e);isNaN(i)||(this._page=i,this._infiniteScrollPage=i)}},I.prototype.getQueryParams=function(){if(this.isBrowser())return new URLSearchParams(location.search)},I.prototype.isBrowser=function(){return"undefined"!=typeof window},I.prototype.waitForCustomerStoreInit=function(){return new Promise((function(t){var e=setInterval((function(){E.getInstance().customerStore.initialized&&(clearInterval(e),t(null))}),1e3)}))},I.prototype.handleListingEvent=function(){this.searchKeyword&&this.data.length?v.viewSearchResults(this._searchKeyword,this.data):this.data.length&&this._type===S.ALL&&v.viewListing(this.data)},I}();!function(t){t.ALL="ALL",t.STATIC="STATIC",t.DISCOUNTED="DISCOUNTED",t.RECOMMENDED="RECOMMENDED",t.CATEGORY="CATEGORY",t.SEARCH="SEARCH",t.LAST_VIEWED="LAST_VIEWED",t.RELATED_PRODUCTS="RELATED_PRODUCTS",t.VIEWED_TOGETHER="VIEWED_TOGETHER"}(S||(S={})),function(t){t.INCREASING_PRICE="INCREASING_PRICE",t.DECREASING_PRICE="DECREASING_PRICE",t.LAST_ADDED="LAST_ADDED",t.FIRST_ADDED="FIRST_ADDED",t.INCREASING_DISCOUNT="INCREASING_DISCOUNT",t.DECRASING_DISCOUNT="DECRASING_DISCOUNT",t.FEATURED="FEATURED",t.DEFAULT="DEFAULT",t.AVERAGE_RATING="AVERAGE_RATING",t.REVIEW_COUNT="REVIEW_COUNT",t.SALE_COUNT="SALE_COUNT",t.A_Z="A_Z",t.Z_A="Z_A"}(C||(C={})),function(t){t.AVERAGE_RATING="AVERAGE_RATING",t.CREATED_AT="CREATED_AT",t.DISCOUNT_RATIO="DISCOUNT_RATIO",t.MANUAL_SORT="MANUAL_SORT",t.NAME="NAME",t.PRICE="PRICE",t.REVIEW_COUNT="REVIEW_COUNT",t.SALE_COUNT="SALE_COUNT"}(T||(T={})),function(t){t.CATEGORY="CATEGORY",t.BRAND="BRAND"}(A||(A={}));var b=((I={})[C.INCREASING_PRICE]=1,I[C.DECREASING_PRICE]=2,I[C.LAST_ADDED]=3,I[C.FIRST_ADDED]=4,I[C.INCREASING_DISCOUNT]=5,I[C.DECRASING_DISCOUNT]=6,I[C.FEATURED]=7,I[C.DEFAULT]=8,I[C.AVERAGE_RATING]=9,I[C.REVIEW_COUNT]=10,I[C.SALE_COUNT]=11,I[C.A_Z]=12,I[C.Z_A]=13,I);export{P as IkasProductList,T as IkasProductListSortByTypeEnum,C as IkasProductListSortType,S as IkasProductListType,A as IkasRelatedProductsType};