vviinn-widgets 2.3.1 → 2.4.2

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 (224) hide show
  1. package/dist/cjs/{app-globals-6b5da080.js → app-globals-d999d944.js} +1 -1
  2. package/dist/cjs/{highlight-box_22.cjs.entry.js → cropper-handler_27.cjs.entry.js} +486 -92
  3. package/dist/cjs/{customized-slots-8bc78ad4.js → customized-slots-90e8e849.js} +1 -1
  4. package/dist/cjs/{index-5b9a60ac.js → index-53400160.js} +1 -1
  5. package/dist/cjs/{imageSearch.store-042e9f45.js → index-c0d08aca.js} +15288 -11038
  6. package/dist/cjs/{index-553c2b4f.js → index-e8cf5dc5.js} +1 -1
  7. package/dist/cjs/loader.cjs.js +3 -3
  8. package/dist/cjs/{vviinn-carousel_3.cjs.entry.js → vviinn-carousel_2.cjs.entry.js} +50 -206
  9. package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +2 -2
  10. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +2 -2
  11. package/dist/cjs/vviinn-vps-button.cjs.entry.js +3 -3
  12. package/dist/cjs/vviinn-widgets.cjs.js +3 -3
  13. package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.js +27 -7
  14. package/dist/collection/components/image-search/search-filters/search-filters.js +24 -1
  15. package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +3 -3
  16. package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +4 -4
  17. package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +18 -1
  18. package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +57 -12
  19. package/dist/collection/components/vviinn-vpr-widget/stories/args.js +8 -8
  20. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +46 -10
  21. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +5 -0
  22. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +106 -10
  23. package/dist/collection/network/utils.js +1 -1
  24. package/dist/collection/openApi/index.js +27 -0
  25. package/dist/collection/{components/vviinn-vpr-widget/GridMode.js → recommendation/events.js} +0 -0
  26. package/dist/collection/store/store.js +7 -9
  27. package/dist/collection/store/tracking.store.js +3 -0
  28. package/dist/collection/tracking/event.js +3 -0
  29. package/dist/collection/tracking/filter.js +5 -0
  30. package/dist/collection/tracking/index.js +13 -0
  31. package/dist/collection/tracking/models.js +6 -0
  32. package/dist/collection/tracking/product.js +18 -0
  33. package/dist/collection/tracking/search.js +5 -0
  34. package/dist/collection/tracking/widget.js +10 -0
  35. package/dist/esm/{app-globals-90d99f95.js → app-globals-f91c6f94.js} +1 -1
  36. package/dist/esm/{highlight-box_22.entry.js → cropper-handler_27.entry.js} +417 -28
  37. package/dist/esm/{customized-slots-65b2467d.js → customized-slots-7be7f3b8.js} +1 -1
  38. package/dist/esm/{index-ac2e3b9d.js → index-00c7b7c2.js} +2 -2
  39. package/dist/esm/{imageSearch.store-f35e14f8.js → index-840ec915.js} +15232 -10993
  40. package/dist/esm/{index-d7c7df1c.js → index-d7147986.js} +1 -1
  41. package/dist/esm/loader.js +3 -3
  42. package/dist/esm/{vviinn-carousel_3.entry.js → vviinn-carousel_2.entry.js} +42 -197
  43. package/dist/esm/vviinn-recommendations-sidebar.entry.js +2 -2
  44. package/dist/esm/vviinn-vpr-button.entry.js +2 -2
  45. package/dist/esm/vviinn-vps-button.entry.js +3 -3
  46. package/dist/esm/vviinn-widgets.js +3 -3
  47. package/dist/types/Image/error.d.ts +1 -0
  48. package/dist/types/Image/form.d.ts +1 -0
  49. package/dist/types/Image/fromFile.d.ts +1 -0
  50. package/dist/types/Image/imageToB64.d.ts +1 -0
  51. package/dist/types/Image/index.d.ts +1 -0
  52. package/dist/types/Image/renderPromise.d.ts +1 -0
  53. package/dist/types/Image/resizeImage.d.ts +1 -0
  54. package/dist/types/Image/sizing.d.ts +1 -0
  55. package/dist/types/Image/toFile.d.ts +1 -0
  56. package/dist/types/analytics/GAnalytics.d.ts +1 -0
  57. package/dist/types/analytics/GeneralAnalytics.d.ts +1 -0
  58. package/dist/types/analytics/GtagAnalytics.d.ts +1 -0
  59. package/dist/types/analytics/ProductAnalytics.d.ts +1 -0
  60. package/dist/types/campaign/Campaign.d.ts +1 -0
  61. package/dist/types/campaign/CampaignService.d.ts +1 -0
  62. package/dist/types/campaign/VCSCampaign.d.ts +1 -0
  63. package/dist/types/campaign/VCSCampaignResponse.d.ts +1 -0
  64. package/dist/types/campaign/VCSCampaignService.d.ts +1 -0
  65. package/dist/types/campaign/VPRCampaignResponse.d.ts +1 -0
  66. package/dist/types/campaign/VPRCampaignService.d.ts +1 -0
  67. package/dist/types/components/customized-slots.d.ts +1 -0
  68. package/dist/types/components/image-search/image-view/highlight-box/highlight-box.d.ts +1 -0
  69. package/dist/types/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.d.ts +1 -0
  70. package/dist/types/components/image-search/image-view/image-cropper/image-cropper.d.ts +4 -0
  71. package/dist/types/components/image-search/search-filters/search-filters.d.ts +4 -0
  72. package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +1 -0
  73. package/dist/types/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.d.ts +1 -0
  74. package/dist/types/components/vviinn-error/vviinn-error.d.ts +1 -0
  75. package/dist/types/components/vviinn-error/vviinn-server-error/vviinn-server-error.d.ts +1 -0
  76. package/dist/types/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.d.ts +1 -0
  77. package/dist/types/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.d.ts +1 -0
  78. package/dist/types/components/vviinn-example-images/vviinn-example-images.d.ts +1 -0
  79. package/dist/types/components/vviinn-icons/index.d.ts +1 -0
  80. package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +1 -0
  81. package/dist/types/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.d.ts +3 -0
  82. package/dist/types/components/vviinn-image-view/vviinn-image-view.d.ts +1 -0
  83. package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +1 -0
  84. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.d.ts +1 -0
  85. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.d.ts +1 -0
  86. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.d.ts +1 -0
  87. package/dist/types/components/vviinn-onboarding/vviinn-onboarding.d.ts +1 -0
  88. package/dist/types/components/vviinn-overlay/vviinn-overlay.d.ts +1 -0
  89. package/dist/types/components/vviinn-overlayed-modal/vviinn-overlayed-modal.d.ts +1 -0
  90. package/dist/types/components/vviinn-preloader/vviinn-preloader.d.ts +1 -0
  91. package/dist/types/components/vviinn-privacy-badge/vviinn-privacy-badge.d.ts +1 -0
  92. package/dist/types/components/vviinn-product-card/render-helpers.d.ts +1 -0
  93. package/dist/types/components/vviinn-product-card/stories/args.d.ts +1 -0
  94. package/dist/types/components/vviinn-product-card/stories/decorators.d.ts +1 -0
  95. package/dist/types/components/vviinn-product-card/stories/vviinn-product-card.stories.d.ts +1 -0
  96. package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +9 -3
  97. package/dist/types/components/vviinn-slider/arrow.d.ts +1 -0
  98. package/dist/types/components/vviinn-slider/vviinn-slide/vviinn-slide.d.ts +1 -0
  99. package/dist/types/components/vviinn-slider/vviinn-slider.d.ts +1 -0
  100. package/dist/types/components/vviinn-teaser/vviinn-teaser.d.ts +1 -0
  101. package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +1 -0
  102. package/dist/types/components/vviinn-vpr-button/stories/args.d.ts +1 -0
  103. package/dist/types/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.d.ts +1 -0
  104. package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +1 -0
  105. package/dist/types/components/vviinn-vpr-widget/stories/args.d.ts +1 -0
  106. package/dist/types/components/vviinn-vpr-widget/stories/decorators.d.ts +1 -0
  107. package/dist/types/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.d.ts +1 -0
  108. package/dist/types/components/vviinn-vpr-widget/token-helpers.d.ts +1 -0
  109. package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +9 -1
  110. package/dist/types/components/vviinn-vps-button/stories/vviinn-vps-button.stories.d.ts +1 -0
  111. package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +1 -0
  112. package/dist/types/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.d.ts +1 -0
  113. package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +13 -1
  114. package/dist/types/components.d.ts +10 -4
  115. package/dist/types/cropper/Cropper.d.ts +1 -0
  116. package/dist/types/cropper/Handler.d.ts +1 -0
  117. package/dist/types/dom/index.d.ts +1 -0
  118. package/dist/types/error.d.ts +1 -0
  119. package/dist/types/file/index.d.ts +1 -0
  120. package/dist/types/geometry/Clip.d.ts +1 -0
  121. package/dist/types/geometry/Point.d.ts +1 -0
  122. package/dist/types/geometry/Rectangle.d.ts +1 -0
  123. package/dist/types/geometry/RectangleAlt.d.ts +1 -0
  124. package/dist/types/geometry/Sized.d.ts +1 -0
  125. package/dist/types/global.d.ts +1 -0
  126. package/dist/types/index.d.ts +1 -0
  127. package/dist/types/interfaces/generated.d.ts +1 -0
  128. package/dist/types/interfaces/recommendation.d.ts +1 -0
  129. package/dist/types/network/apiClient.d.ts +1 -0
  130. package/dist/types/network/ion/File.d.ts +1 -0
  131. package/dist/types/network/ion/Form.d.ts +1 -0
  132. package/dist/types/network/ion/Link.d.ts +1 -0
  133. package/dist/types/network/ion/ValueObject.d.ts +1 -0
  134. package/dist/types/network/request.d.ts +1 -0
  135. package/dist/types/network/utils.d.ts +1 -0
  136. package/dist/types/openApi/index.d.ts +6 -0
  137. package/dist/types/recommendation/events.d.ts +6 -0
  138. package/dist/types/recommendation/recommendation.d.ts +1 -0
  139. package/dist/types/searchSession/searchSession.d.ts +1 -0
  140. package/dist/types/sentry.d.ts +1 -0
  141. package/dist/types/slider/GridMode.d.ts +1 -0
  142. package/dist/types/store/file-processing.d.ts +1 -0
  143. package/dist/types/store/imageSearch.store.d.ts +1 -0
  144. package/dist/types/store/store.d.ts +8 -6
  145. package/dist/types/store/tracking.store.d.ts +4 -0
  146. package/dist/types/stories/image-selector.stories.d.ts +1 -0
  147. package/dist/types/stories/image-view.stories.d.ts +1 -0
  148. package/dist/types/stories/modal.stories.d.ts +1 -0
  149. package/dist/types/stories/onboarding.stories.d.ts +1 -0
  150. package/dist/types/stories/overlay.stories.d.ts +1 -0
  151. package/dist/types/stories/overlayedModal.stories.d.ts +1 -0
  152. package/dist/types/stories/privacy-badge.stories.d.ts +1 -0
  153. package/dist/types/stories/slider.stories.d.ts +1 -0
  154. package/dist/types/stories/teaser.stories.d.ts +1 -0
  155. package/dist/types/stories/vps-widget.stories.d.ts +1 -0
  156. package/dist/types/stories/vviinn-product.stories.d.ts +1 -0
  157. package/dist/types/tracking/event.d.ts +4 -0
  158. package/dist/types/tracking/filter.d.ts +3 -0
  159. package/dist/types/tracking/index.d.ts +9 -0
  160. package/dist/types/tracking/models.d.ts +13 -0
  161. package/dist/types/tracking/product.d.ts +7 -0
  162. package/dist/types/tracking/search.d.ts +3 -0
  163. package/dist/types/tracking/widget.d.ts +5 -0
  164. package/dist/types/utils/collections/collectionsUtils.d.ts +1 -0
  165. package/dist/types/utils/either.d.ts +1 -0
  166. package/dist/types/utils/enum/enumUtils.d.ts +1 -0
  167. package/dist/types/utils/event/Events.d.ts +1 -0
  168. package/dist/types/utils/number/index.d.ts +1 -0
  169. package/dist/types/utils/option/option.d.ts +1 -0
  170. package/dist/types/utils/semigroup/semigroupDiff.d.ts +1 -0
  171. package/dist/types/utils/token/tokenUtils.d.ts +1 -0
  172. package/dist/vviinn-widgets/{p-e362fa80.entry.js → p-07d8ba79.entry.js} +1 -1
  173. package/dist/vviinn-widgets/p-196479f9.js +1 -0
  174. package/dist/vviinn-widgets/{p-a5b69a48.entry.js → p-2d4cb17f.entry.js} +1 -1
  175. package/dist/vviinn-widgets/{p-679ea2ce.js → p-7d5af04d.js} +1 -1
  176. package/dist/vviinn-widgets/{p-4530ca32.entry.js → p-9c7297c8.entry.js} +1 -1
  177. package/{www/build/p-55491d9b.js → dist/vviinn-widgets/p-a66512b2.js} +1 -1
  178. package/dist/vviinn-widgets/p-ae524f97.entry.js +1 -0
  179. package/{www/build/p-e882fbeb.js → dist/vviinn-widgets/p-ce96f232.js} +1 -1
  180. package/dist/vviinn-widgets/{p-b4b46a70.js → p-dc2da207.js} +1 -1
  181. package/dist/vviinn-widgets/p-fce4183d.entry.js +1 -0
  182. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  183. package/package.json +11 -3
  184. package/www/build/{p-e362fa80.entry.js → p-07d8ba79.entry.js} +1 -1
  185. package/www/build/p-196479f9.js +1 -0
  186. package/www/build/{p-a5b69a48.entry.js → p-2d4cb17f.entry.js} +1 -1
  187. package/www/build/p-32bb0615.js +1 -0
  188. package/www/build/{p-679ea2ce.js → p-7d5af04d.js} +1 -1
  189. package/www/build/{p-4530ca32.entry.js → p-9c7297c8.entry.js} +1 -1
  190. package/{dist/vviinn-widgets/p-55491d9b.js → www/build/p-a66512b2.js} +1 -1
  191. package/www/build/p-ae524f97.entry.js +1 -0
  192. package/{dist/vviinn-widgets/p-e882fbeb.js → www/build/p-ce96f232.js} +1 -1
  193. package/www/build/{p-b4b46a70.js → p-dc2da207.js} +1 -1
  194. package/www/build/p-fce4183d.entry.js +1 -0
  195. package/www/build/vviinn-widgets.esm.js +1 -1
  196. package/www/index.html +1 -107
  197. package/dist/cjs/Handler-d1a8a86a.js +0 -329
  198. package/dist/cjs/cropper-handler.cjs.entry.js +0 -27
  199. package/dist/cjs/vviinn-error.cjs.entry.js +0 -19
  200. package/dist/cjs/vviinn-preloader.cjs.entry.js +0 -26
  201. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +0 -97
  202. package/dist/esm/Handler-639a4cb3.js +0 -308
  203. package/dist/esm/cropper-handler.entry.js +0 -23
  204. package/dist/esm/vviinn-error.entry.js +0 -15
  205. package/dist/esm/vviinn-preloader.entry.js +0 -22
  206. package/dist/esm/vviinn-vps-widget.entry.js +0 -93
  207. package/dist/types/components/vviinn-vpr-widget/GridMode.d.ts +0 -1
  208. package/dist/vviinn-widgets/p-1c141479.entry.js +0 -1
  209. package/dist/vviinn-widgets/p-320844ea.entry.js +0 -1
  210. package/dist/vviinn-widgets/p-6239a782.entry.js +0 -1
  211. package/dist/vviinn-widgets/p-757849fd.entry.js +0 -1
  212. package/dist/vviinn-widgets/p-80f0d4e0.js +0 -1
  213. package/dist/vviinn-widgets/p-935b4f49.entry.js +0 -1
  214. package/dist/vviinn-widgets/p-b0243e84.entry.js +0 -1
  215. package/dist/vviinn-widgets/p-f582db5c.js +0 -1
  216. package/www/build/p-1c141479.entry.js +0 -1
  217. package/www/build/p-320844ea.entry.js +0 -1
  218. package/www/build/p-4379b1c2.js +0 -1
  219. package/www/build/p-6239a782.entry.js +0 -1
  220. package/www/build/p-757849fd.entry.js +0 -1
  221. package/www/build/p-80f0d4e0.js +0 -1
  222. package/www/build/p-935b4f49.entry.js +0 -1
  223. package/www/build/p-b0243e84.entry.js +0 -1
  224. package/www/build/p-f582db5c.js +0 -1
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
21
21
  }
22
22
 
23
23
  const NAMESPACE = 'vviinn-widgets';
24
- const Env = /* vviinn-widgets */ {"packageVersion":"2.3.0","packageName":"vviinn-widgets","environment":"local"};
24
+ const Env = /* vviinn-widgets */ {"packageVersion":"2.4.1","packageName":"vviinn-widgets","environment":"local"};
25
25
 
26
26
  let scopeId;
27
27
  let hostTagName;
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-553c2b4f.js');
6
- const appGlobals = require('./app-globals-6b5da080.js');
5
+ const index = require('./index-e8cf5dc5.js');
6
+ const appGlobals = require('./app-globals-d999d944.js');
7
7
 
8
8
  /*
9
9
  Stencil Client Patch Esm v2.9.0 | MIT Licensed | https://stenciljs.com
@@ -16,7 +16,7 @@ const defineCustomElements = (win, options) => {
16
16
  if (typeof window === 'undefined') return Promise.resolve();
17
17
  return patchEsm().then(() => {
18
18
  appGlobals.globalScripts();
19
- return index.bootstrapLazy([["cropper-handler.cjs",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error.cjs",[[1,"vviinn-error"]]],["vviinn-preloader.cjs",[[1,"vviinn-preloader"]]],["vviinn-carousel_3.cjs",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32]},[[0,"productImageLoaded","lol"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}],[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"imageLoaded":[32]}]]],["highlight-box_22.cjs",[[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{"active":[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{"filter":[16],"selectedCategoryId":[32],"hideFilters":[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{"disabled":[4],"handleMove":[32]}],[1,"vviinn-example-image",{"src":[1],"width":[2],"height":[2],"selected":[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{"detectedObject":[16],"position":[32]}],[1,"vviinn-modal",{"active":[1540],"slider":[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32]}]]],["vviinn-vps-widget.cjs",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"slidePosition":[32],"width":[32],"wrongImageFormat":[32]}]]],["vviinn-vps-button.cjs",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["vviinn-recommendations-sidebar.cjs",[[1,"vviinn-recommendations-sidebar",{"sidebarTitle":[1,"sidebar-title"],"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"widgetScrollbar":[4,"widget-scrollbar"],"state":[32]},[[16,"click","bodyClickListener"]]]]],["vviinn-vpr-button.cjs",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"]}]]]], options);
19
+ return index.bootstrapLazy([["cropper-handler_27.cjs",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"slidePosition":[32],"width":[32],"wrongImageFormat":[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]],[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{"active":[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{"filter":[16],"selectedCategoryId":[32],"hideFilters":[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{"disabled":[4],"handleMove":[32]}],[1,"vviinn-example-image",{"src":[1],"width":[2],"height":[2],"selected":[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{"detectedObject":[16],"position":[32]}],[1,"vviinn-modal",{"active":[1540],"slider":[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32]}],[1,"cropper-handler",{"handler":[16],"disabled":[4]}],[1,"vviinn-error"],[1,"vviinn-preloader"],[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"index":[2],"imageLoaded":[32]}]]],["vviinn-vps-button.cjs",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["vviinn-carousel_2.cjs",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}]]],["vviinn-recommendations-sidebar.cjs",[[1,"vviinn-recommendations-sidebar",{"sidebarTitle":[1,"sidebar-title"],"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"widgetScrollbar":[4,"widget-scrollbar"],"state":[32]},[[16,"click","bodyClickListener"]]]]],["vviinn-vpr-button.cjs",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"]}]]]], options);
20
20
  });
21
21
  };
22
22
 
@@ -2,10 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-553c2b4f.js');
6
- const imageSearch_store = require('./imageSearch.store-042e9f45.js');
7
- const index$1 = require('./index-5b9a60ac.js');
8
- const Handler = require('./Handler-d1a8a86a.js');
5
+ const index = require('./index-e8cf5dc5.js');
6
+ const index$1 = require('./index-c0d08aca.js');
7
+ const index$2 = require('./index-53400160.js');
9
8
 
10
9
  const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button{fill:#525252}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";
11
10
 
@@ -174,8 +173,8 @@ let VviinnCarousel = class {
174
173
  "show-scrollbar": this.showScrollbar(),
175
174
  };
176
175
  }
177
- renderRecommendation(recommendation) {
178
- return (index.h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.mode === "continuity" }));
176
+ renderRecommendation(recommendation, rank) {
177
+ return (index.h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.mode === "continuity", index: rank }));
179
178
  }
180
179
  renderRecommendationGroup(elements) {
181
180
  return index.h("div", { class: CONTENT_GROUP_CSS_CLASS }, elements);
@@ -189,11 +188,11 @@ let VviinnCarousel = class {
189
188
  : this.renderRecommendationsElements();
190
189
  }
191
190
  renderRecommendationsElements() {
192
- return this.recommendations.map((r) => this.renderRecommendation(r));
191
+ return this.recommendations.map((r, i) => this.renderRecommendation(r, i));
193
192
  }
194
193
  renderGrid() {
195
194
  const recommendations = this.renderRecommendationsElements();
196
- const grouppedContent = imageSearch_store._Array.chunksOf(this.getColumnsNumber())(recommendations);
195
+ const grouppedContent = index$1._Array.chunksOf(this.getColumnsNumber())(recommendations);
197
196
  return this.renderRecommendationGroups(grouppedContent);
198
197
  }
199
198
  renderBullets() {
@@ -205,187 +204,12 @@ let VviinnCarousel = class {
205
204
  }, onClick: () => this.scroll(index$1) })));
206
205
  }
207
206
  render() {
208
- return (index.h(index.Host, { class: this.getClassMap() }, index.h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, index.h("button", { class: "prev", onClick: () => this.showPrev(), part: "carousel-button" }, index.h(index$1.ChevronIcon, null)), index.h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }, this.renderRecommendations()), index.h("button", { class: "next", onClick: () => this.showNext(), part: "carousel-button" }, index.h(index$1.ChevronIcon, null))), this.showBullets() ? (index.h("div", { class: "bullets" }, this.renderBullets())) : ("")));
207
+ return (index.h(index.Host, { class: this.getClassMap() }, index.h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, index.h("button", { class: "prev", onClick: () => this.showPrev(), part: "carousel-button" }, index.h(index$2.ChevronIcon, null)), index.h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }, this.renderRecommendations()), index.h("button", { class: "next", onClick: () => this.showNext(), part: "carousel-button" }, index.h(index$2.ChevronIcon, null))), this.showBullets() ? (index.h("div", { class: "bullets" }, this.renderBullets())) : ("")));
209
208
  }
210
209
  get el() { return index.getElement(this); }
211
210
  };
212
211
  VviinnCarousel.style = vviinnCarouselCss;
213
212
 
214
- class GtagAnalytics {
215
- sendImpression(product) {
216
- var _a, _b, _c;
217
- gtag('event', 'view_item_list', {
218
- items: [
219
- {
220
- id: product.productId,
221
- name: product.title,
222
- brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
223
- category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
224
- list_name: 'VI VPR View',
225
- price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
226
- }
227
- ]
228
- });
229
- return undefined;
230
- }
231
- sendClick(product) {
232
- var _a, _b, _c;
233
- gtag('event', 'select_content', {
234
- content_type: 'product',
235
- items: [
236
- {
237
- id: product.productId,
238
- name: product.title,
239
- brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
240
- category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
241
- list_name: 'VI VPR View',
242
- price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
243
- }
244
- ]
245
- });
246
- return undefined;
247
- }
248
- }
249
-
250
- class GAnalytics {
251
- constructor() {
252
- ga('require', 'ec');
253
- }
254
- convertProduct(product) {
255
- var _a, _b, _c;
256
- return {
257
- id: product.productId,
258
- name: product.title,
259
- brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
260
- category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
261
- list: 'VI VPR View',
262
- price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
263
- };
264
- }
265
- sendImpression(product) {
266
- ga('ec:addImpression', this.convertProduct(product));
267
- return undefined;
268
- }
269
- sendClick(product) {
270
- var _a, _b, _c;
271
- ga('ec:addProduct', {
272
- id: product.productId,
273
- name: product.title,
274
- brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
275
- category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
276
- price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
277
- });
278
- ga('ec:setAction', 'click', { list: 'VI VPR View' });
279
- return undefined;
280
- }
281
- }
282
-
283
- const getGtagAnalytics = () => imageSearch_store._function.pipe(imageSearch_store.Option.fromNullable(window.gtag), imageSearch_store.Option.map(() => new GtagAnalytics()));
284
- const getCommonAnalytics = () => imageSearch_store._function.pipe(imageSearch_store.Option.fromNullable(window.ga), imageSearch_store.Option.map(() => new GAnalytics()));
285
- const analyticsMonoid = imageSearch_store.Option.getMonoid(imageSearch_store.Semigroup.first());
286
- const getAnalyticsModule = analyticsMonoid.concat(getGtagAnalytics(), getCommonAnalytics());
287
-
288
- const FIT_EXPR = /fit\/\d+\//;
289
- const containsFit = (url) => {
290
- return imageSearch_store._function.pipe(url.match(FIT_EXPR), imageSearch_store.Either.fromNullable(url), imageSearch_store.Either.map(() => url));
291
- };
292
- const processWidth = (url, size) => {
293
- return imageSearch_store._function.pipe(containsFit(url), imageSearch_store.Either.map((url) => url.replace(FIT_EXPR, `fit/${size}/`)), imageSearch_store.Either.getOrElse(() => url));
294
- };
295
- const Linked = (props, child) => props.deeplink ? (index.h("a", { class: props.part, part: props.part, href: props.deeplink }, child)) : (child);
296
- const FormattedPrice = (props) => {
297
- var _a;
298
- const locale = props.locale;
299
- const formattedPrice = new Intl.NumberFormat(locale, {
300
- minimumFractionDigits: 2,
301
- }).format(props.price);
302
- const fullPrice = `${(_a = props.prefix) !== null && _a !== void 0 ? _a : ""} ${formattedPrice} ${props.currency}`;
303
- return (index.h("span", { class: "price-amount", part: "price-amount" }, fullPrice));
304
- };
305
- const Price = (props) => {
306
- const priceEl = (index.h(FormattedPrice, { prefix: props.prefix, currency: props.currency, price: props.price, locale: props.locale }));
307
- return (index.h("span", { class: "price-container", part: "price-container" }, props.salePrice ? ([
308
- index.h("span", { class: "price-sale", part: "price-sale" },
309
- index.h(FormattedPrice, { prefix: props.prefix, currency: props.currency, price: props.salePrice, locale: props.locale })),
310
- index.h("span", { class: "price-outdated", part: "price-outdated" }, priceEl),
311
- ]) : (index.h("span", { class: "price-regular", part: "price-regular" }, priceEl))));
312
- };
313
- const Image = (props, onLoadEnd = () => undefined) => (index.h("picture", null,
314
- index.h("img", { loading: props.lazy ? "lazy" : "eager", part: "image", class: "image", width: props.width, height: props.height, src: processWidth(props.src, props.width), alt: props.title, onLoad: onLoadEnd })));
315
- const ResponsiveImage = (props, onLoadEnd = () => undefined) => (index.h("picture", null,
316
- index.h("img", { loading: props.lazy ? "lazy" : "eager", part: "image", class: "image responsive", src: processWidth(props.src, props.width), alt: props.title, onLoad: onLoadEnd })));
317
-
318
- const vviinnProductCardCss = ":host{align-items:center;display:flex;flex-direction:column;gap:8px;height:100%}.price-container{display:flex;flex-direction:column}.price-sale,.price-regular{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#161616}.price-outdated{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#757575;text-decoration:line-through}.product-type{word-wrap:anywhere}.image{display:grid;align-content:center;-o-object-position:50% 50%;object-position:50% 50%;-o-object-fit:contain;object-fit:contain;text-align:center;box-sizing:border-box}img.responsive{width:100%;height:auto;aspect-ratio:1}.brand,.type{display:none}.title{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#161616;display:-webkit-box;font-size:16px;font-style:normal;font-weight:500;line-height:24px;margin-bottom:8px;overflow:hidden}.deeplink{text-decoration:none}.image-link{display:contents}picture{position:relative;width:100%}:host(.dimmed) picture::before{content:\"\";width:100%;height:100%;box-sizing:border-box;background:#f7f7f7;display:block;top:0;left:0;position:absolute;mix-blend-mode:multiply}";
319
-
320
- let VviinnProductCard = class {
321
- constructor(hostRef) {
322
- index.registerInstance(this, hostRef);
323
- this.recommendationLoad = index.createEvent(this, "recommendationLoad", 7);
324
- this.recommendationView = index.createEvent(this, "recommendationView", 7);
325
- this.recommendationClick = index.createEvent(this, "recommendationClick", 7);
326
- this.productImageLoaded = index.createEvent(this, "productImageLoaded", 7);
327
- this.currency = undefined;
328
- this.imageRatio = 1;
329
- this.imageWidth = 200;
330
- this.locale = undefined;
331
- this.pricePrefix = undefined;
332
- this.responsive = false;
333
- this.dimmedBackground = false;
334
- this.imageLoaded = false;
335
- this.intersectionObserver = new IntersectionObserver(this.intersectionCallback.bind(this), { threshold: 1.0 });
336
- }
337
- intersectionCallback(data) {
338
- if (data.some((entry) => entry.isIntersecting)) {
339
- imageSearch_store._function.pipe(getAnalyticsModule, imageSearch_store.Option.map((analytics) => analytics.sendImpression(this.getProduct())));
340
- this.recommendationView.emit(this.productId);
341
- this.intersectionObserver.disconnect();
342
- }
343
- }
344
- componentDidLoad() {
345
- this.recommendationLoad.emit(this.productId);
346
- this.intersectionObserver.observe(this.el);
347
- const links = this.el.shadowRoot.querySelectorAll("a");
348
- links.forEach((link) => link.addEventListener("mousedown", (event) => {
349
- this.recommendationClick.emit(this.productId);
350
- if (window.ga) {
351
- event.preventDefault();
352
- }
353
- imageSearch_store._function.pipe(getAnalyticsModule, imageSearch_store.Option.match(() => null, (analytics) => analytics.sendClick(this.getProduct())));
354
- if (window.ga) {
355
- ga("send", "event", "UX", "click", "Results", {
356
- hitCallback: function () {
357
- document.location.href = this.deeplink;
358
- },
359
- });
360
- }
361
- }));
362
- }
363
- getProduct() {
364
- return imageSearch_store.imageSearchState.results.find((r) => r.productId === this.productId);
365
- }
366
- renderImage() {
367
- const props = {
368
- width: this.imageWidth,
369
- height: this.imageWidth * this.imageRatio,
370
- src: this.image,
371
- title: this.productTitle,
372
- lazy: false,
373
- };
374
- return this.responsive
375
- ? ResponsiveImage(props, () => this.kek())
376
- : Image(props, () => this.kek());
377
- }
378
- kek() {
379
- this.productImageLoaded.emit(this.productId);
380
- }
381
- render() {
382
- var _a, _b, _c;
383
- return (index.h(index.Host, { part: "product-card", class: { dimmed: this.dimmedBackground }, exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title" }, index.h(Linked, { deeplink: this.deeplink, part: "image-link" }, this.renderImage()), index.h(Linked, { deeplink: this.deeplink, part: "deeplink" }, index.h("span", { class: "title", part: "title" }, this.productTitle)), index.h("span", { class: "brand", part: "brand" }, this.brand), index.h("span", { class: "type", part: "type" }, this.productType), index.h(Price, { prefix: (_a = this.pricePrefix) !== null && _a !== void 0 ? _a : imageSearch_store.state.pricePrefix, currency: (_b = this.currency) !== null && _b !== void 0 ? _b : imageSearch_store.state.currencySign, price: this.price, salePrice: this.salePrice, locale: (_c = this.locale) !== null && _c !== void 0 ? _c : imageSearch_store.state.locale })));
384
- }
385
- get el() { return index.getElement(this); }
386
- };
387
- VviinnProductCard.style = vviinnProductCardCss;
388
-
389
213
  const createBearerString = (x) => `Bearer ${x}`;
390
214
  const createAuthedHeader = (x) => new Headers({
391
215
  Authorization: x,
@@ -395,7 +219,7 @@ const createFetchAuthOptions = (x) => {
395
219
  headers: x,
396
220
  };
397
221
  };
398
- const createBearAuthedHeader = imageSearch_store._function.flow(createBearerString, createAuthedHeader, createFetchAuthOptions);
222
+ const createBearAuthedHeader = index$1._function.flow(createBearerString, createAuthedHeader, createFetchAuthOptions);
399
223
 
400
224
  const isVPR = (c) => c._tag === "VPR";
401
225
  function fold(onVPR, onVCS) {
@@ -405,8 +229,8 @@ function fromString(s) {
405
229
  return s === "VPR" ? { _tag: "VPR" } : { _tag: "VCS" };
406
230
  }
407
231
 
408
- const sequenceToEither = imageSearch_store.sequenceT(imageSearch_store.Apply);
409
- const apiGet = (path, data = {}) => Handler.pipe(sequenceToEither(imageSearch_store.getApiPath(), imageSearch_store.createInitGetRequest), imageSearch_store.fromEither, imageSearch_store.chainW(imageSearch_store.makeRequest(path, data)));
232
+ const sequenceToEither = index$1.sequenceT(index$1.Apply);
233
+ const apiGet = (path, data = {}) => index$1.pipe(sequenceToEither(index$1.getApiPath(), index$1.createInitGetRequest), index$1.fromEither, index$1.chainW(index$1.makeRequest(path, data)));
410
234
 
411
235
  const getVPRRecommendations = (productId) => (options) => {
412
236
  const url = `product/${productId}/similar-products`;
@@ -418,7 +242,7 @@ const getVCSRecommendations = (productId) => (options) => {
418
242
  return apiGet(url, options);
419
243
  };
420
244
 
421
- const getRecommendationsService = (campaignType) => imageSearch_store._function.pipe(fromString(campaignType), fold(() => getVPRRecommendations, () => getVCSRecommendations));
245
+ const getRecommendationsService = (campaignType) => index$1._function.pipe(fromString(campaignType), fold(() => getVPRRecommendations, () => getVCSRecommendations));
422
246
 
423
247
  function isFunction(value) {
424
248
  return typeof value === 'function';
@@ -1065,20 +889,42 @@ let VviinnVprWidget = class {
1065
889
  this.getRecommendations();
1066
890
  }
1067
891
  handleApiPathChange(newPath) {
1068
- imageSearch_store.state$1.apiPath = newPath;
892
+ index$1.state.apiPath = newPath;
1069
893
  this.getRecommendations();
1070
894
  }
1071
- lol({ detail }) {
895
+ handleImageLoading({ detail }) {
1072
896
  this.productImageLoadedSubject.next(detail);
1073
897
  }
898
+ trackRecommendationView({ detail }) {
899
+ const recommendationViewEvent = index$1.createProductViewVprEvent(Object.assign({ session_id: this.uiSessionId }, detail));
900
+ this.trackingApi.trackEvent(recommendationViewEvent);
901
+ }
902
+ trackRecommendationClick({ detail }) {
903
+ const recommendationClickEvent = index$1.createProductViewVprEvent(Object.assign({ session_id: this.uiSessionId }, detail));
904
+ this.trackingApi.trackEvent(recommendationClickEvent);
905
+ }
1074
906
  connectedCallback() {
1075
- imageSearch_store.state$1.apiPath = this.apiPath;
1076
- imageSearch_store.state$1.currencySign = this.currencySign;
1077
- imageSearch_store.state$1.locale = this.locale;
907
+ index$1.state.apiPath = this.apiPath;
908
+ index$1.state.currencySign = this.currencySign;
909
+ index$1.state.locale = this.locale;
910
+ this.uiSessionId = index$1.v4();
911
+ this.trackingApi = index$1.createTrackingApi(this.apiPath, this.token);
912
+ const widgetOpenEvent = index$1.createWidgetVprEvent({
913
+ action: "open",
914
+ session_id: this.uiSessionId,
915
+ });
916
+ this.trackingApi.trackEvent(widgetOpenEvent);
917
+ }
918
+ disconnectedCallback() {
919
+ const widgetCloseEvent = index$1.createWidgetVprEvent({
920
+ action: "close",
921
+ session_id: this.uiSessionId,
922
+ });
923
+ this.trackingApi.trackEvent(widgetCloseEvent);
1078
924
  }
1079
925
  async componentWillLoad() {
1080
- imageSearch_store.state$1.pricePrefix = this.pricePrefix;
1081
- imageSearch_store.state$1.currencySign = this.currencySign;
926
+ index$1.state.pricePrefix = this.pricePrefix;
927
+ index$1.state.currencySign = this.currencySign;
1082
928
  this.getRecommendations();
1083
929
  }
1084
930
  async getRecommendations() {
@@ -1086,9 +932,9 @@ let VviinnVprWidget = class {
1086
932
  return;
1087
933
  const campaignType = this.campaignType.length > 0 ? this.campaignType : "VPR";
1088
934
  const headers = createBearAuthedHeader(this.token);
1089
- const request = imageSearch_store._function.pipe(imageSearch_store.TaskEither.of(getRecommendationsService(campaignType)), imageSearch_store.TaskEither.ap(imageSearch_store.TaskEither.of(this.productId)), imageSearch_store.TaskEither.ap(imageSearch_store.TaskEither.of(headers)), imageSearch_store.TaskEither.flatten);
935
+ const request = index$1._function.pipe(index$1.TaskEither.of(getRecommendationsService(campaignType)), index$1.TaskEither.ap(index$1.TaskEither.of(this.productId)), index$1.TaskEither.ap(index$1.TaskEither.of(headers)), index$1.TaskEither.flatten);
1090
936
  const runRequest = await request();
1091
- imageSearch_store._function.pipe(runRequest, imageSearch_store.Either.fold((error) => this.handleError(error), (data) => this.handleRecommendationsSucces(data)));
937
+ index$1._function.pipe(runRequest, index$1.Either.fold((error) => this.handleError(error), (data) => this.handleRecommendationsSucces(data)));
1092
938
  }
1093
939
  handleError(error) {
1094
940
  console.log("ERROR:", error);
@@ -1096,12 +942,11 @@ let VviinnVprWidget = class {
1096
942
  handleRecommendationsSucces(data) {
1097
943
  var _a;
1098
944
  this.recommendations = (_a = data === null || data === void 0 ? void 0 : data.extended) !== null && _a !== void 0 ? _a : data;
1099
- imageSearch_store.imageSearchState.results = this.recommendations;
945
+ index$1.imageSearchState.results = this.recommendations;
1100
946
  this.loaded = true;
1101
- //this.recommendationsLoaded.emit();
1102
- this.productIds = this.recommendations.map(r => r.productId);
947
+ this.productIds = this.recommendations.map((r) => r.productId);
1103
948
  this.productImageLoadedSubject.subscribe((id) => {
1104
- this.productIds = this.productIds.filter(x => x !== id);
949
+ this.productIds = this.productIds.filter((x) => x !== id);
1105
950
  if (this.productIds.length === 0) {
1106
951
  this.recommendationsLoaded.emit();
1107
952
  }
@@ -1118,16 +963,16 @@ let VviinnVprWidget = class {
1118
963
  loaded: this.loaded,
1119
964
  empty: this.recommendations.length == 0,
1120
965
  [this.mode]: true,
1121
- }, "aria-hidden": this.loaded ? "false" : "true" }, this.renderExternalCSS(), index.h("style", null, imageSearch_store.state$1.fallbackStyles), index.h("h2", { part: "recommendations-title" }, this.blockTitle), this.useCarousel ? this.renderCarousel() : this.renderResults()));
966
+ }, "aria-hidden": this.loaded ? "false" : "true" }, this.renderExternalCSS(), index.h("style", null, index$1.state.fallbackStyles), index.h("h2", { part: "recommendations-title" }, this.blockTitle), this.useCarousel ? this.renderCarousel() : this.renderResults()));
1122
967
  }
1123
- renderRecommendation(recommendation) {
1124
- return (index.h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.useDimmedBackgroundInCard() }));
968
+ renderRecommendation(recommendation, index$1) {
969
+ return (index.h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.useDimmedBackgroundInCard(), index: index$1 }));
1125
970
  }
1126
971
  useDimmedBackgroundInCard() {
1127
972
  return this.mode === "continuity" || !this.useCarousel;
1128
973
  }
1129
974
  renderResults() {
1130
- return (index.h("div", { class: "recommendations-grid", part: "recommendations-grid" }, this.recommendations.map((r) => this.renderRecommendation(r))));
975
+ return (index.h("div", { class: "recommendations-grid", part: "recommendations-grid" }, this.recommendations.map((r, i) => this.renderRecommendation(r, i))));
1131
976
  }
1132
977
  renderCarousel() {
1133
978
  return (index.h("vviinn-carousel", { mode: this.mode, imageWidth: this.imageWidth, showScroll: this.showScroll, recommendations: this.recommendations }));
@@ -1142,5 +987,4 @@ let VviinnVprWidget = class {
1142
987
  VviinnVprWidget.style = vviinnVprWidgetCss;
1143
988
 
1144
989
  exports.vviinn_carousel = VviinnCarousel;
1145
- exports.vviinn_product_card = VviinnProductCard;
1146
990
  exports.vviinn_vpr_widget = VviinnVprWidget;
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-553c2b4f.js');
6
- const index$1 = require('./index-5b9a60ac.js');
5
+ const index = require('./index-e8cf5dc5.js');
6
+ const index$1 = require('./index-53400160.js');
7
7
 
8
8
  const recommendationsSidebarCss = ":host{--vviinn-carousel-columns:0;box-sizing:border-box;display:block;display:flex;height:100vh;left:0;position:fixed;top:0;transition:background 0.1s ease-in-out;width:100vw}:host(.open){background:rgba(0, 0, 0, 0.2)}:host(.bottom){flex-direction:column;justify-content:end}:host(.right){flex-direction:row;justify-content:flex-end}header{position:relative;text-align:center;padding:32px}header.contains-source-img{display:grid;justify-items:center;grid-gap:12px}img.source-image{width:64px;height:64px;border-radius:50%;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);padding:8px}:host(.right) header{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.1)}main{padding:0 24px}:host(.right) main{overflow:auto}.sidebar{background:white;box-sizing:border-box;display:flex;flex-direction:column}:host(.bottom.idle) .sidebar,:host(.bottom.closed) .sidebar{transform:translateY(100%)}:host(.bottom.closed) .sidebar{-webkit-animation-name:slideOutFromBottom;animation-name:slideOutFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.bottom.open) .sidebar{-webkit-animation-name:slideInFromBottom;animation-name:slideInFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.idle) .sidebar{transform:translateX(100%)}:host(.right.closed) .sidebar{-webkit-animation-name:slideOutFromRight;animation-name:slideOutFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.open) .sidebar{-webkit-animation-name:slideInFromRight;animation-name:slideInFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right) .sidebar{max-width:480px}:host(.right) vviinn-vpr-widget::part(recommendations-grid){display:grid;grid-template-columns:repeat(2, 1fr);grid-gap:24px}:host(.right) vviinn-vpr-widget{overflow:auto}:host(.right) vviinn-vpr-widget::part(image){border:none}.title{font-style:normal;font-weight:500;font-size:28px;line-height:40px;text-align:center;color:#000000}vviinn-vpr-widget::part(title),vviinn-vpr-widget::part(brand),vviinn-vpr-widget::part(type){text-align:left}vviinn-vpr-widget::part(price-container){align-self:start}.close-sidebar{background:transparent;border:none;cursor:pointer;margin:0;padding:0;position:absolute;right:24px;top:24px}@-webkit-keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}";
9
9
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-553c2b4f.js');
6
- const index$1 = require('./index-5b9a60ac.js');
5
+ const index = require('./index-e8cf5dc5.js');
6
+ const index$1 = require('./index-53400160.js');
7
7
 
8
8
  const vviinnVprButtonCss = ":host{display:block}.open-button{align-items:center;background:rgba(255, 255, 255, 0.8);border-radius:50%;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);box-sizing:border-box;cursor:pointer;display:grid;height:40px;justify-items:center;padding:0;width:40px;transition:all 0.25s ease-in-out}.open-button:hover{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.25)}.open-button:focus{border:2px solid rgba(15, 98, 254, 0.5);outline:none}.open-button:active{background:#F4F4F4;outline:none}";
9
9
 
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-553c2b4f.js');
6
- const index$1 = require('./index-5b9a60ac.js');
7
- const customizedSlots = require('./customized-slots-8bc78ad4.js');
5
+ const index = require('./index-e8cf5dc5.js');
6
+ const index$1 = require('./index-53400160.js');
7
+ const customizedSlots = require('./customized-slots-90e8e849.js');
8
8
 
9
9
  const vviinnVpsButtonCss = ":host{cursor:pointer}";
10
10
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-553c2b4f.js');
4
- const appGlobals = require('./app-globals-6b5da080.js');
3
+ const index = require('./index-e8cf5dc5.js');
4
+ const appGlobals = require('./app-globals-d999d944.js');
5
5
 
6
6
  /*
7
7
  Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
@@ -17,5 +17,5 @@ const patchBrowser = () => {
17
17
 
18
18
  patchBrowser().then(options => {
19
19
  appGlobals.globalScripts();
20
- return index.bootstrapLazy([["cropper-handler.cjs",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error.cjs",[[1,"vviinn-error"]]],["vviinn-preloader.cjs",[[1,"vviinn-preloader"]]],["vviinn-carousel_3.cjs",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32]},[[0,"productImageLoaded","lol"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}],[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"imageLoaded":[32]}]]],["highlight-box_22.cjs",[[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{"active":[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{"filter":[16],"selectedCategoryId":[32],"hideFilters":[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{"disabled":[4],"handleMove":[32]}],[1,"vviinn-example-image",{"src":[1],"width":[2],"height":[2],"selected":[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{"detectedObject":[16],"position":[32]}],[1,"vviinn-modal",{"active":[1540],"slider":[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32]}]]],["vviinn-vps-widget.cjs",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"slidePosition":[32],"width":[32],"wrongImageFormat":[32]}]]],["vviinn-vps-button.cjs",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["vviinn-recommendations-sidebar.cjs",[[1,"vviinn-recommendations-sidebar",{"sidebarTitle":[1,"sidebar-title"],"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"widgetScrollbar":[4,"widget-scrollbar"],"state":[32]},[[16,"click","bodyClickListener"]]]]],["vviinn-vpr-button.cjs",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"]}]]]], options);
20
+ return index.bootstrapLazy([["cropper-handler_27.cjs",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"slidePosition":[32],"width":[32],"wrongImageFormat":[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]],[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{"active":[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{"filter":[16],"selectedCategoryId":[32],"hideFilters":[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{"disabled":[4],"handleMove":[32]}],[1,"vviinn-example-image",{"src":[1],"width":[2],"height":[2],"selected":[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{"detectedObject":[16],"position":[32]}],[1,"vviinn-modal",{"active":[1540],"slider":[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32]}],[1,"cropper-handler",{"handler":[16],"disabled":[4]}],[1,"vviinn-error"],[1,"vviinn-preloader"],[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"index":[2],"imageLoaded":[32]}]]],["vviinn-vps-button.cjs",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["vviinn-carousel_2.cjs",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}]]],["vviinn-recommendations-sidebar.cjs",[[1,"vviinn-recommendations-sidebar",{"sidebarTitle":[1,"sidebar-title"],"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"widgetScrollbar":[4,"widget-scrollbar"],"state":[32]},[[16,"click","bodyClickListener"]]]]],["vviinn-vpr-button.cjs",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"]}]]]], options);
21
21
  });
@@ -1,4 +1,4 @@
1
- import { Component, Host, h, State, Element, Prop } from "@stencil/core";
1
+ import { Component, Host, h, State, Element, Prop, Event, } from "@stencil/core";
2
2
  import { move, transform } from "../../../../geometry/Rectangle";
3
3
  import { fromMouseEvent, pointDiffSemigroup, } from "../../../../geometry/Point";
4
4
  import { imageSearchState, makeRectangularSearchRequest, } from "../../../../store/imageSearch.store";
@@ -27,18 +27,21 @@ export class ImageCropper {
27
27
  };
28
28
  pipe(imageSearchState.searchArea, O.map((area) => {
29
29
  const newSearchArea = transform(area, transformedHandler);
30
- if (newSearchArea.width < MIN_SEARCHAREA_SIZE ||
31
- newSearchArea.height < MIN_SEARCHAREA_SIZE ||
32
- newSearchArea.x < 0 ||
33
- newSearchArea.y < 0 ||
34
- this.bounds.height - (newSearchArea.y + newSearchArea.height) < 0 ||
35
- this.bounds.width - (newSearchArea.x + newSearchArea.width) < 0)
30
+ if (this.outOfBounds(newSearchArea))
36
31
  return;
37
32
  imageSearchState.searchArea = O.some(newSearchArea);
38
33
  this.mouseStartPoint = destination;
39
34
  imageSearchState.detectedObject = undefined;
40
35
  }));
41
36
  }
37
+ outOfBounds(area) {
38
+ return (area.width < MIN_SEARCHAREA_SIZE ||
39
+ area.height < MIN_SEARCHAREA_SIZE ||
40
+ area.x < 0 ||
41
+ area.y < 0 ||
42
+ this.bounds.height - (area.y + area.height) < 0 ||
43
+ this.bounds.width - (area.x + area.width) < 0);
44
+ }
42
45
  handleCropperMove(ev) {
43
46
  ev.preventDefault();
44
47
  ev.stopPropagation();
@@ -79,6 +82,7 @@ export class ImageCropper {
79
82
  document.removeEventListener("pointerup", this.pointerReleaseListener);
80
83
  this.mouseStartPoint = undefined;
81
84
  makeRectangularSearchRequest();
85
+ this.cropperChanged.emit();
82
86
  }
83
87
  getStyleMap() {
84
88
  return pipe(imageSearchState.searchArea, O.map((rectangle) => {
@@ -131,5 +135,21 @@ export class ImageCropper {
131
135
  static get states() { return {
132
136
  "handleMove": {}
133
137
  }; }
138
+ static get events() { return [{
139
+ "method": "cropperChanged",
140
+ "name": "cropperChanged",
141
+ "bubbles": true,
142
+ "cancelable": true,
143
+ "composed": true,
144
+ "docs": {
145
+ "tags": [],
146
+ "text": ""
147
+ },
148
+ "complexType": {
149
+ "original": "any",
150
+ "resolved": "any",
151
+ "references": {}
152
+ }
153
+ }]; }
134
154
  static get elementRef() { return "el"; }
135
155
  }
@@ -1,4 +1,4 @@
1
- import { Component, Host, h, Prop, State, Element } from "@stencil/core";
1
+ import { Component, Host, h, Prop, State, Element, Event } from "@stencil/core";
2
2
  import { imageSearchState } from "../../../store/imageSearch.store";
3
3
  import { CheckIcon } from "../../vviinn-icons";
4
4
  const FILTERS_COUNT = 5;
@@ -18,11 +18,13 @@ export class SearchFilters {
18
18
  selectFilter(filter) {
19
19
  this.selectedCategoryId = getFilterId(filter);
20
20
  imageSearchState.activeIonLink = filter;
21
+ this.filterSelected.emit("select");
21
22
  }
22
23
  clearSelectedFilter() {
23
24
  this.selectedCategoryId = null;
24
25
  imageSearchState.activeIonLink = undefined;
25
26
  this.findSelectedFilter().blur();
27
+ this.filterSelected.emit("deselect");
26
28
  }
27
29
  findSelectedFilter() {
28
30
  return this.el.shadowRoot.querySelector(ACTIVE_FILTER_CLASSNAME);
@@ -98,5 +100,26 @@ export class SearchFilters {
98
100
  "selectedCategoryId": {},
99
101
  "hideFilters": {}
100
102
  }; }
103
+ static get events() { return [{
104
+ "method": "filterSelected",
105
+ "name": "filterSelected",
106
+ "bubbles": true,
107
+ "cancelable": true,
108
+ "composed": true,
109
+ "docs": {
110
+ "tags": [],
111
+ "text": ""
112
+ },
113
+ "complexType": {
114
+ "original": "FilterAction",
115
+ "resolved": "\"deselect\" | \"select\"",
116
+ "references": {
117
+ "FilterAction": {
118
+ "location": "import",
119
+ "path": "@vviinn/tracking-client-ts"
120
+ }
121
+ }
122
+ }
123
+ }]; }
101
124
  static get elementRef() { return "el"; }
102
125
  }
@@ -168,8 +168,8 @@ export class VviinnCarousel {
168
168
  "show-scrollbar": this.showScrollbar(),
169
169
  };
170
170
  }
171
- renderRecommendation(recommendation) {
172
- return (h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.mode === "continuity" }));
171
+ renderRecommendation(recommendation, rank) {
172
+ return (h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.mode === "continuity", index: rank }));
173
173
  }
174
174
  renderRecommendationGroup(elements) {
175
175
  return h("div", { class: CONTENT_GROUP_CSS_CLASS }, elements);
@@ -183,7 +183,7 @@ export class VviinnCarousel {
183
183
  : this.renderRecommendationsElements();
184
184
  }
185
185
  renderRecommendationsElements() {
186
- return this.recommendations.map((r) => this.renderRecommendation(r));
186
+ return this.recommendations.map((r, i) => this.renderRecommendation(r, i));
187
187
  }
188
188
  renderGrid() {
189
189
  const recommendations = this.renderRecommendationsElements();