vviinn-widgets 2.3.0 → 2.4.1

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 (230) hide show
  1. package/dist/cjs/{app-globals-30781f30.js → app-globals-324e9cd0.js} +1 -1
  2. package/dist/cjs/{highlight-box_22.cjs.entry.js → cropper-handler_27.cjs.entry.js} +485 -91
  3. package/dist/cjs/{customized-slots-5d904d8e.js → customized-slots-703cd28d.js} +1 -1
  4. package/dist/cjs/{index-363cfe0b.js → index-6078b9e5.js} +5 -7
  5. package/dist/cjs/{imageSearch.store-128957a4.js → index-a00145c0.js} +15288 -11038
  6. package/dist/cjs/{index-741a970d.js → index-a821350a.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} +47 -203
  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 +4 -4
  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-icons/index.js +4 -6
  16. package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +18 -1
  17. package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +57 -12
  18. package/dist/collection/components/vviinn-vpr-widget/stories/args.js +8 -8
  19. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +46 -10
  20. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +5 -0
  21. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.css +3 -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-345e497d.js → app-globals-02b550a1.js} +1 -1
  36. package/dist/esm/{highlight-box_22.entry.js → cropper-handler_27.entry.js} +416 -27
  37. package/dist/esm/{customized-slots-a76a8d41.js → customized-slots-472f6e69.js} +1 -1
  38. package/dist/esm/{imageSearch.store-8eab0da1.js → index-26769494.js} +15232 -10993
  39. package/dist/esm/{index-9e125c6c.js → index-711602a5.js} +6 -8
  40. package/dist/esm/{index-6fa21e24.js → index-b908268d.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} +39 -194
  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 +4 -4
  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-13842a39.js +1 -0
  173. package/dist/vviinn-widgets/p-19b7a59e.entry.js +1 -0
  174. package/dist/vviinn-widgets/p-4a7d9763.entry.js +1 -0
  175. package/dist/vviinn-widgets/{p-a95c00c9.entry.js → p-4fb28a11.entry.js} +1 -1
  176. package/dist/vviinn-widgets/p-6715be5d.entry.js +1 -0
  177. package/dist/vviinn-widgets/{p-3734a3ef.entry.js → p-70f54b8b.entry.js} +1 -1
  178. package/dist/vviinn-widgets/p-817158df.js +1 -0
  179. package/{www/build/p-78ccc9eb.js → dist/vviinn-widgets/p-cd711bcd.js} +1 -1
  180. package/dist/vviinn-widgets/{p-e67cae57.js → p-e031c06c.js} +1 -1
  181. package/dist/vviinn-widgets/{p-e1ba8626.js → p-ee679114.js} +1 -1
  182. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  183. package/package.json +11 -3
  184. package/www/build/p-13842a39.js +1 -0
  185. package/www/build/p-19b7a59e.entry.js +1 -0
  186. package/www/build/p-4a7d9763.entry.js +1 -0
  187. package/www/build/{p-a95c00c9.entry.js → p-4fb28a11.entry.js} +1 -1
  188. package/www/build/p-6715be5d.entry.js +1 -0
  189. package/www/build/{p-3734a3ef.entry.js → p-70f54b8b.entry.js} +1 -1
  190. package/www/build/p-817158df.js +1 -0
  191. package/www/build/p-92df8b33.js +125 -0
  192. package/{dist/vviinn-widgets/p-78ccc9eb.js → www/build/p-cd711bcd.js} +1 -1
  193. package/www/build/p-e0153ae2.css +6 -0
  194. package/www/build/{p-e67cae57.js → p-e031c06c.js} +1 -1
  195. package/www/build/{p-e1ba8626.js → p-ee679114.js} +1 -1
  196. package/www/build/vviinn-widgets.esm.js +1 -1
  197. package/www/index.html +1 -107
  198. package/dist/cjs/Handler-d1a8a86a.js +0 -329
  199. package/dist/cjs/cropper-handler.cjs.entry.js +0 -27
  200. package/dist/cjs/vviinn-error.cjs.entry.js +0 -19
  201. package/dist/cjs/vviinn-preloader.cjs.entry.js +0 -26
  202. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +0 -97
  203. package/dist/esm/Handler-639a4cb3.js +0 -308
  204. package/dist/esm/cropper-handler.entry.js +0 -23
  205. package/dist/esm/vviinn-error.entry.js +0 -15
  206. package/dist/esm/vviinn-preloader.entry.js +0 -22
  207. package/dist/esm/vviinn-vps-widget.entry.js +0 -93
  208. package/dist/types/components/vviinn-vpr-widget/GridMode.d.ts +0 -1
  209. package/dist/vviinn-widgets/p-126775a2.js +0 -1
  210. package/dist/vviinn-widgets/p-1f0c8cf6.entry.js +0 -1
  211. package/dist/vviinn-widgets/p-59edfbe2.js +0 -1
  212. package/dist/vviinn-widgets/p-71809bed.entry.js +0 -1
  213. package/dist/vviinn-widgets/p-9d24f51e.entry.js +0 -1
  214. package/dist/vviinn-widgets/p-9ea96a69.entry.js +0 -1
  215. package/dist/vviinn-widgets/p-e38f4aa2.entry.js +0 -1
  216. package/dist/vviinn-widgets/p-f47e82b2.entry.js +0 -1
  217. package/dist/vviinn-widgets/p-f582db5c.js +0 -1
  218. package/dist/vviinn-widgets/p-fb14e3cc.entry.js +0 -1
  219. package/www/build/p-126775a2.js +0 -1
  220. package/www/build/p-1f0c8cf6.entry.js +0 -1
  221. package/www/build/p-4379b1c2.js +0 -1
  222. package/www/build/p-59edfbe2.js +0 -1
  223. package/www/build/p-71809bed.entry.js +0 -1
  224. package/www/build/p-9d24f51e.entry.js +0 -1
  225. package/www/build/p-9ea96a69.entry.js +0 -1
  226. package/www/build/p-a67898be.css +0 -1
  227. package/www/build/p-e38f4aa2.entry.js +0 -1
  228. package/www/build/p-f47e82b2.entry.js +0 -1
  229. package/www/build/p-f582db5c.js +0 -1
  230. package/www/build/p-fb14e3cc.entry.js +0 -1
@@ -1,308 +0,0 @@
1
- // -------------------------------------------------------------------------------------
2
- /**
3
- * @since 2.0.0
4
- */
5
- function identity(a) {
6
- return a;
7
- }
8
- function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
9
- switch (arguments.length) {
10
- case 1:
11
- return ab;
12
- case 2:
13
- return function () {
14
- return bc(ab.apply(this, arguments));
15
- };
16
- case 3:
17
- return function () {
18
- return cd(bc(ab.apply(this, arguments)));
19
- };
20
- case 4:
21
- return function () {
22
- return de(cd(bc(ab.apply(this, arguments))));
23
- };
24
- case 5:
25
- return function () {
26
- return ef(de(cd(bc(ab.apply(this, arguments)))));
27
- };
28
- case 6:
29
- return function () {
30
- return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
31
- };
32
- case 7:
33
- return function () {
34
- return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
35
- };
36
- case 8:
37
- return function () {
38
- return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
39
- };
40
- case 9:
41
- return function () {
42
- return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
43
- };
44
- }
45
- return;
46
- }
47
- /**
48
- * @since 2.0.0
49
- */
50
- function tuple() {
51
- var t = [];
52
- for (var _i = 0; _i < arguments.length; _i++) {
53
- t[_i] = arguments[_i];
54
- }
55
- return t;
56
- }
57
- function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
58
- switch (arguments.length) {
59
- case 1:
60
- return a;
61
- case 2:
62
- return ab(a);
63
- case 3:
64
- return bc(ab(a));
65
- case 4:
66
- return cd(bc(ab(a)));
67
- case 5:
68
- return de(cd(bc(ab(a))));
69
- case 6:
70
- return ef(de(cd(bc(ab(a)))));
71
- case 7:
72
- return fg(ef(de(cd(bc(ab(a))))));
73
- case 8:
74
- return gh(fg(ef(de(cd(bc(ab(a)))))));
75
- case 9:
76
- return hi(gh(fg(ef(de(cd(bc(ab(a))))))));
77
- default:
78
- var ret = arguments[0];
79
- for (var i = 1; i < arguments.length; i++) {
80
- ret = arguments[i](ret);
81
- }
82
- return ret;
83
- }
84
- }
85
-
86
- // -------------------------------------------------------------------------------------
87
- // Option
88
- // -------------------------------------------------------------------------------------
89
- /** @internal */
90
- var isNone = function (fa) { return fa._tag === 'None'; };
91
- /** @internal */
92
- var isSome = function (fa) { return fa._tag === 'Some'; };
93
- /** @internal */
94
- var none = { _tag: 'None' };
95
- /** @internal */
96
- var some = function (a) { return ({ _tag: 'Some', value: a }); };
97
- // -------------------------------------------------------------------------------------
98
- // Either
99
- // -------------------------------------------------------------------------------------
100
- /** @internal */
101
- var isLeft = function (ma) { return ma._tag === 'Left'; };
102
- /** @internal */
103
- var left = function (e) { return ({ _tag: 'Left', left: e }); };
104
- /** @internal */
105
- var right = function (a) { return ({ _tag: 'Right', right: a }); };
106
- // -------------------------------------------------------------------------------------
107
- // Record
108
- // -------------------------------------------------------------------------------------
109
- /** @internal */
110
- var has = Object.prototype.hasOwnProperty;
111
-
112
- /**
113
- * If a type `A` can form a `Semigroup` it has an **associative** binary operation.
114
- *
115
- * ```ts
116
- * interface Semigroup<A> {
117
- * readonly concat: (x: A, y: A) => A
118
- * }
119
- * ```
120
- *
121
- * Associativity means the following equality must hold for any choice of `x`, `y`, and `z`.
122
- *
123
- * ```ts
124
- * concat(x, concat(y, z)) = concat(concat(x, y), z)
125
- * ```
126
- *
127
- * A common example of a semigroup is the type `string` with the operation `+`.
128
- *
129
- * ```ts
130
- * import { Semigroup } from 'fp-ts/Semigroup'
131
- *
132
- * const semigroupString: Semigroup<string> = {
133
- * concat: (x, y) => x + y
134
- * }
135
- *
136
- * const x = 'x'
137
- * const y = 'y'
138
- * const z = 'z'
139
- *
140
- * semigroupString.concat(x, y) // 'xy'
141
- *
142
- * semigroupString.concat(x, semigroupString.concat(y, z)) // 'xyz'
143
- *
144
- * semigroupString.concat(semigroupString.concat(x, y), z) // 'xyz'
145
- * ```
146
- *
147
- * *Adapted from https://typelevel.org/cats*
148
- *
149
- * @since 2.0.0
150
- */
151
- /**
152
- * Given a struct of semigroups returns a semigroup for the struct.
153
- *
154
- * @example
155
- * import { struct } from 'fp-ts/Semigroup'
156
- * import * as N from 'fp-ts/number'
157
- *
158
- * interface Point {
159
- * readonly x: number
160
- * readonly y: number
161
- * }
162
- *
163
- * const S = struct<Point>({
164
- * x: N.SemigroupSum,
165
- * y: N.SemigroupSum
166
- * })
167
- *
168
- * assert.deepStrictEqual(S.concat({ x: 1, y: 2 }, { x: 3, y: 4 }), { x: 4, y: 6 })
169
- *
170
- * @category combinators
171
- * @since 2.10.0
172
- */
173
- var struct = function (semigroups) { return ({
174
- concat: function (first, second) {
175
- var r = {};
176
- for (var k in semigroups) {
177
- if (has.call(semigroups, k)) {
178
- r[k] = semigroups[k].concat(first[k], second[k]);
179
- }
180
- }
181
- return r;
182
- }
183
- }); };
184
- // -------------------------------------------------------------------------------------
185
- // instances
186
- // -------------------------------------------------------------------------------------
187
- /**
188
- * Always return the first argument.
189
- *
190
- * @example
191
- * import * as S from 'fp-ts/Semigroup'
192
- *
193
- * assert.deepStrictEqual(S.first<number>().concat(1, 2), 1)
194
- *
195
- * @category instances
196
- * @since 2.10.0
197
- */
198
- var first = function () { return ({ concat: identity }); };
199
- /**
200
- * Always return the last argument.
201
- *
202
- * @example
203
- * import * as S from 'fp-ts/Semigroup'
204
- *
205
- * assert.deepStrictEqual(S.last<number>().concat(1, 2), 2)
206
- *
207
- * @category instances
208
- * @since 2.10.0
209
- */
210
- var last = function () { return ({ concat: function (_, y) { return y; } }); };
211
- /**
212
- * Use [`SemigroupSum`](./number.ts.html#SemigroupSum) instead.
213
- *
214
- * @category instances
215
- * @since 2.0.0
216
- * @deprecated
217
- */
218
- var semigroupSum = {
219
- concat: function (x, y) { return x + y; }
220
- };
221
-
222
- const semigroupDiff = {
223
- concat: (x, y) => x - y,
224
- };
225
-
226
- const fromRectangle$1 = ({ x, y }) => {
227
- return {
228
- x,
229
- y,
230
- };
231
- };
232
- const fromMouseEvent = ({ clientX, clientY }) => {
233
- return {
234
- x: clientX,
235
- y: clientY,
236
- };
237
- };
238
- const pointDiffSemigroup = struct({
239
- x: semigroupDiff,
240
- y: semigroupDiff,
241
- });
242
- const pointSumSemigroup = struct({
243
- x: semigroupSum,
244
- y: semigroupSum,
245
- });
246
-
247
- var HandlerDirection;
248
- (function (HandlerDirection) {
249
- HandlerDirection[HandlerDirection["East"] = 0] = "East";
250
- HandlerDirection[HandlerDirection["North"] = 1] = "North";
251
- HandlerDirection[HandlerDirection["NorthEast"] = 2] = "NorthEast";
252
- HandlerDirection[HandlerDirection["NorthWest"] = 3] = "NorthWest";
253
- HandlerDirection[HandlerDirection["South"] = 4] = "South";
254
- HandlerDirection[HandlerDirection["SouthEast"] = 5] = "SouthEast";
255
- HandlerDirection[HandlerDirection["SouthWest"] = 6] = "SouthWest";
256
- HandlerDirection[HandlerDirection["West"] = 7] = "West";
257
- })(HandlerDirection || (HandlerDirection = {}));
258
- const getCursorValue = (direction) => {
259
- switch (direction) {
260
- case HandlerDirection.East:
261
- return "e-resize";
262
- case HandlerDirection.North:
263
- return "n-resize";
264
- case HandlerDirection.NorthEast:
265
- return "ne-resize";
266
- case HandlerDirection.NorthWest:
267
- return "nw-resize";
268
- case HandlerDirection.South:
269
- return "s-resize";
270
- case HandlerDirection.SouthEast:
271
- return "se-resize";
272
- case HandlerDirection.SouthWest:
273
- return "sw-resize";
274
- case HandlerDirection.West:
275
- return "w-resize";
276
- default:
277
- return "pointer";
278
- }
279
- };
280
- const fromRectangle = (r) => [
281
- {
282
- position: fromRectangle$1(r),
283
- direction: HandlerDirection.NorthWest,
284
- },
285
- {
286
- position: pointSumSemigroup.concat(fromRectangle$1(r), {
287
- x: r.width,
288
- y: 0,
289
- }),
290
- direction: HandlerDirection.NorthEast,
291
- },
292
- {
293
- position: pointSumSemigroup.concat(fromRectangle$1(r), {
294
- x: 0,
295
- y: r.height,
296
- }),
297
- direction: HandlerDirection.SouthWest,
298
- },
299
- {
300
- position: pointSumSemigroup.concat(fromRectangle$1(r), {
301
- x: r.width,
302
- y: r.height,
303
- }),
304
- direction: HandlerDirection.SouthEast,
305
- },
306
- ];
307
-
308
- export { HandlerDirection as H, isLeft as a, identity as b, flow as c, struct as d, last as e, first as f, pointSumSemigroup as g, fromRectangle$1 as h, isNone as i, isSome as j, fromRectangle as k, left as l, pointDiffSemigroup as m, none as n, fromMouseEvent as o, pipe as p, getCursorValue as q, right as r, some as s, tuple as t };
@@ -1,23 +0,0 @@
1
- import { r as registerInstance, h, H as Host } from './index-6fa21e24.js';
2
- import { q as getCursorValue } from './Handler-639a4cb3.js';
3
-
4
- const cropperHandlerCss = ":host{--size:20px;background:transparent;border:4px solid white;box-sizing:content-box;display:block;height:var(--size);touch-action:none;position:absolute;width:var(--size);z-index:4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.disabled){opacity:0.25}:host(.nw-resize){border-bottom:none;border-right:none;top:0;left:0}:host(.ne-resize){border-left:none;border-bottom:none;right:0;top:0}:host(.sw-resize){border-right:none;border-top:none;left:0;bottom:0}:host(.se-resize){border-left:none;border-top:none;bottom:0;right:0}";
5
-
6
- let CropperHandler = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.disabled = false;
10
- }
11
- render() {
12
- return (h(Host, { part: `handle ${getCursorValue(this.handler.direction)}`, class: {
13
- disabled: this.disabled,
14
- [getCursorValue(this.handler.direction)]: true,
15
- }, style: {
16
- "--size": "20px",
17
- cursor: getCursorValue(this.handler.direction),
18
- }, draggable: false }));
19
- }
20
- };
21
- CropperHandler.style = cropperHandlerCss;
22
-
23
- export { CropperHandler as cropper_handler };
@@ -1,15 +0,0 @@
1
- import { r as registerInstance, h, H as Host } from './index-6fa21e24.js';
2
-
3
- const vviinnErrorCss = ":host{background:#F4F4F4;border-radius:8px;display:grid;grid-gap:20px;padding:24px;text-align:center}::slotted(svg){display:grid;align-self:center}::slotted(h4){margin:unset;font-weight:600;font-size:18px;line-height:24px}::slotted(span){font-size:14px;line-height:20px}::slotted(button){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;color:var(--color-primary, var(--color-primary-system));font-weight:600;font-size:16px;line-height:20px;cursor:pointer}";
4
-
5
- let VviinnError = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- }
9
- render() {
10
- return (h(Host, null, h("slot", { name: "icon" }), h("slot", { name: "title" }), h("slot", { name: "text" }), h("slot", { name: "action" })));
11
- }
12
- };
13
- VviinnError.style = vviinnErrorCss;
14
-
15
- export { VviinnError as vviinn_error };
@@ -1,22 +0,0 @@
1
- import { r as registerInstance, h, H as Host } from './index-6fa21e24.js';
2
- import { i as imageSearchState } from './imageSearch.store-8eab0da1.js';
3
- import './Handler-639a4cb3.js';
4
-
5
- const vviinnPreloaderCss = ":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;-webkit-animation:rotate 3s linear infinite;animation:rotate 3s linear infinite;border:var(--preloader-width) solid white;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@-webkit-keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";
6
-
7
- let VviinnPreloader = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- }
11
- isActive() {
12
- return (imageSearchState.loading || imageSearchState.objectDetectionInProgress);
13
- }
14
- render() {
15
- return (h(Host, { class: {
16
- active: this.isActive(),
17
- } }));
18
- }
19
- };
20
- VviinnPreloader.style = vviinnPreloaderCss;
21
-
22
- export { VviinnPreloader as vviinn_preloader };
@@ -1,93 +0,0 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-6fa21e24.js';
2
- import { e as state, i as imageSearchState, O as Option } from './imageSearch.store-8eab0da1.js';
3
- import { s as slotChangeListener } from './customized-slots-a76a8d41.js';
4
- import './Handler-639a4cb3.js';
5
-
6
- const vviinnVpsWidgetCss = ":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);min-height:580px}.start-page_block{align-content:start;border-right:1px solid #F4F4F4;display:grid;padding:48px}.start-page_block.error{align-content:center}#onboarding-block{border-right:unset;box-sizing:border-box;grid-gap:24px;overflow-y:auto;position:relative;width:100%}vviinn-teaser{margin-bottom:32px;margin-top:-24px}vviinn-image-selector{align-items:center;background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));border-radius:2px;color:white;display:grid;font-size:16px;font-weight:600;height:56px;justify-items:center;margin-bottom:16px;transition:background 0.1s ease-in-out}vviinn-image-selector:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}vviinn-image-selector:active{border-color:black}.upload-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:-webkit-max-content auto;grid-template-columns:max-content auto;grid-gap:16px}.results-page{display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.products{align-content:center;align-items:start;box-sizing:border-box;display:grid;grid-gap:32px 16px;grid-template-columns:repeat(auto-fill, minmax(152px, 1fr));justify-items:center;padding:24px;padding-right:0;position:absolute;width:calc(100% - 16px)}.products.hidden{display:none}vviinn-empty-results{width:280px;align-self:center;justify-self:center}.products-wrapper{display:grid;overflow-y:auto;overflow-x:hidden;padding:unset;position:relative;width:100%}.image-wrapper{border-right:1px solid #F4F4F4;display:grid;grid-template-rows:-webkit-min-content 170px;grid-template-rows:min-content 170px;grid-gap:24px;min-width:100%}.onboarding-wrapper{position:absolute;width:100%;padding:48px;box-sizing:border-box;display:grid;grid-gap:64px;padding-bottom:24px}vviinn-product-card{gap:0;width:100%}vviinn-product-card::part(image){border:1px solid #eaeaea;margin-bottom:8px}vviinn-product-card::part(price-container),vviinn-product-card::part(deeplink),vviinn-product-card::part(title){align-self:start}search-filters span{display:none}search-filters::part(filter){background:#F4F4F4;border-radius:4px;border:1px solid #F4F4F4;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px}search-filters::part(show-more-filters){border:1px solid #f4f4f4;border-radius:4px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px;padding:6px 16px}search-filters::part(show-more-filters):hover{background:#EAEAEA}search-filters::part(filter):hover{background:#EAEAEA}search-filters::part(filter):focus{outline:none;border:1px solid var(--color-primary, var(--color-primary-system))}search-filters::part(filter active){background:rgba(15, 98, 254, 0.15);color:var(--color-primary, var(--color-primary-system))}.filters-wrapper{overflow:auto}.results-page:not(.active){display:none}.nothing-found{display:grid;grid-gap:64px;justify-self:center;padding-top:64px;padding-bottom:16px;position:absolute;width:60%}@media (max-width: 768px){.start-page_block{padding:24px}.onboarding-wrapper{padding:24px}}@media (max-width: 640px){.start-page{grid-template-rows:-webkit-min-content;grid-template-rows:min-content;grid-template-columns:unset;grid-gap:48px;padding:24px 0 48px 0}}@media (max-width: 640px) and (min-width: 415px){.onboarding-wrapper{position:unset}#onboarding-block{overflow:unset}.start-page.active{height:1px;overflow:auto}}@media (max-width: 415px){.results-page>*{box-sizing:border-box;padding:24px}vviinn-slide{padding-bottom:48px}.start-page_block:last-of-type{border-right:unset;overflow-y:unset;position:static;box-sizing:border-box;width:unset}.start-page_block{padding:0 24px}vviinn-teaser{margin-top:24px}.onboarding-wrapper{position:static;width:unset;padding:unset;box-sizing:border-box}.results-page{grid-template-columns:unset;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto}.image{margin-bottom:8px}.image-wrapper{grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;width:100%}.products-wrapper{align-content:start;position:static;overflow-y:unset;width:100%;padding-top:0}.products{position:static;padding:0;width:unset;grid-gap:32px 16px;justify-content:center}.nothing-found{position:static;grid-gap:64px;padding:unset;align-content:start;width:unset}}@media (max-width: 320px){.products{grid-template-columns:unset}}vviinn-wrong-format,vviinn-server-error{width:280px;align-self:center;justify-self:center}";
7
-
8
- let VviinnVpsWidget = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- /** When true modal window with widget will be shown */
12
- this.active = false;
13
- /** Currency sign will shown after price */
14
- this.currencySign = "€";
15
- /** Locale for currency formatting */
16
- this.locale = "de-DE";
17
- this.slidePosition = 0;
18
- this.width = 0;
19
- this.wrongImageFormat = false;
20
- }
21
- activeWatcher(value) {
22
- if (value) {
23
- this.overflow = document.body.style.overflow;
24
- document.body.style.overflow = "hidden";
25
- }
26
- else {
27
- document.body.style.overflow = this.overflow;
28
- }
29
- }
30
- componentWillLoad() {
31
- slotChangeListener(this, this.el);
32
- }
33
- connectedCallback() {
34
- state.apiPath = this.apiPath;
35
- state.currencySign = this.currencySign;
36
- state.locale = this.locale;
37
- imageSearchState.token = this.token;
38
- }
39
- handleImageSelection() {
40
- this.slidePosition = 1;
41
- const root = this.el.shadowRoot.querySelector("vviinn-overlayed-modal");
42
- const overlay = root.shadowRoot.querySelector("vviinn-overlay");
43
- const modal = overlay.querySelector("vviinn-modal");
44
- const modalBody = modal.shadowRoot.querySelector(".body");
45
- modalBody.scrollTop = 0;
46
- }
47
- resetState() {
48
- this.resetScroll("onboarding-block");
49
- this.slidePosition = 0;
50
- imageSearchState.image = Option.none;
51
- imageSearchState.imageUrl = Option.none;
52
- imageSearchState.imageBounds = Option.none;
53
- imageSearchState.searchArea = Option.none;
54
- imageSearchState.results = [];
55
- imageSearchState.filters = [];
56
- imageSearchState.detectedObjects = [];
57
- imageSearchState.activeIonLink = undefined;
58
- imageSearchState.rectangleSearchForm = undefined;
59
- this.resetScroll("results-block");
60
- }
61
- haveErrors() {
62
- return this.wrongImageFormat || imageSearchState.serverError;
63
- }
64
- resetScroll(elementId, behavior = "auto") {
65
- const element = this.el.shadowRoot.getElementById(elementId);
66
- element.scroll({ top: 0, left: 0, behavior });
67
- }
68
- handleModalClose() {
69
- this.active = false;
70
- this.resetState();
71
- const elementsToReset = ["onboarding-block", "results-block"];
72
- elementsToReset.forEach((name) => this.resetScroll(name));
73
- }
74
- render() {
75
- return (h(Host, null, h("vviinn-overlayed-modal", { class: { "first-screen": this.slidePosition === 0 }, active: this.active, onSecondaryActionClicked: () => this.resetState(), onModalClosed: () => this.handleModalClose(), exportparts: "secondary-action, title, close-button" }, h("vviinn-slider", { showBullets: false, position: this.slidePosition }, h("vviinn-slide", { class: { "start-page": true } }, h("div", { class: {
76
- error: this.haveErrors(),
77
- "start-page_block": true,
78
- } }, h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, onActionClick: () => (this.wrongImageFormat = false) }), h("vviinn-server-error", { class: { hidden: !imageSearchState.serverError }, onActionClick: () => (imageSearchState.serverError = false) }), h("vviinn-teaser", { class: { hidden: this.haveErrors() } }), h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection(), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" }, h("span", { slot: "upload-button-text", class: "upload-button-content" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "29", height: "28", fill: "none" }, h("defs", null), h("path", { fill: "#fff", "fill-rule": "evenodd", d: "M10.271 3.89A.875.875 0 0111 3.5h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.75A2.625 2.625 0 013.125 21V8.75A2.625 2.625 0 015.75 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.75a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z", "clip-rule": "evenodd" }), h("path", { fill: "#fff", "fill-rule": "evenodd", d: "M14.5 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z", "clip-rule": "evenodd" })), h("slot", { name: "vviinn-image-upload-button-text" }, h("span", null, "Kamera oder Bild ausw\u00E4hlen")))), h("vviinn-privacy-badge", { class: { hidden: this.haveErrors() } })), h("div", { id: "onboarding-block", class: "start-page_block" }, h("div", { class: "onboarding-wrapper" }, h("vviinn-onboarding", null), h("vviinn-example-images", { onImageSelected: () => this.handleImageSelection(), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))), h("vviinn-slide", { class: { "results-page": true, active: this.slidePosition == 1 } }, h("div", { class: "image-wrapper" }, h("vviinn-image-view", null), h("div", { class: "filters-wrapper" }, h("div", { class: "filters" }, imageSearchState.filters.map((filter) => (h("search-filters", { filter: filter })))))), h("div", { id: "results-block", class: "products-wrapper" }, h("div", { class: { "nothing-found": true, hidden: imageSearchState.results.length > 0 } }, h("vviinn-empty-results", null), h("vviinn-onboarding", null)), h("div", { class: {
79
- hidden: imageSearchState.results.length <= 0,
80
- products: true,
81
- } }, imageSearchState.results.map((p) => {
82
- var _a;
83
- return (h("vviinn-product-card", { hidden: true, productTitle: p.title, productId: p.productId, brand: p.brand, deeplink: p.deeplink, price: p.price.actual, salePrice: p.price.sale, imageWidth: 160, image: (_a = p.image.thumbnail) !== null && _a !== void 0 ? _a : p.image.original, part: "product-card" }));
84
- }))))))));
85
- }
86
- get el() { return getElement(this); }
87
- static get watchers() { return {
88
- "active": ["activeWatcher"]
89
- }; }
90
- };
91
- VviinnVpsWidget.style = vviinnVpsWidgetCss;
92
-
93
- export { VviinnVpsWidget as vviinn_vps_widget };
@@ -1 +0,0 @@
1
- export declare type GridMode = "grid" | "auto";
@@ -1 +0,0 @@
1
- import{h as a}from"./p-e1ba8626.js";const l=()=>a("svg",{width:"12",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z"})),h=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none"},a("defs",null),a("path",{fill:"#525252","fill-rule":"evenodd",d:"M9.771 3.89a.875.875 0 01.728-.39h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.25A2.625 2.625 0 012.625 21V8.75A2.625 2.625 0 015.25 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.25a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z","clip-rule":"evenodd"}),a("path",{fill:"#525252","fill-rule":"evenodd",d:"M14 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z","clip-rule":"evenodd"})),t=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"120",height:"120",fill:"none"},a("defs",null),a("path",{fill:"#393939",d:"M74.55 20a5.06 5.06 0 014.14 2l4.72 9.32.1.18.11.17A5.07 5.07 0 0087.93 34h13.87c5.07 0 9.2 3.59 9.2 8v50c0 4.41-4.13 8-9.2 8H18.2c-5.07 0-9.2-3.59-9.2-8V42c0-4.41 4.13-8 9.2-8h13.87a5.072 5.072 0 004.31-2.34l.11-.17.1-.18L41.31 22a5.06 5.06 0 014.14-2h29.1zm0-4h-29.1a9 9 0 00-7.6 4L33 29.5a1.13 1.13 0 01-1 .5H18.2C10.91 30 5 35.37 5 42v50c0 6.63 5.91 12 13.2 12h83.6c7.29 0 13.2-5.37 13.2-12V42c0-6.63-5.91-12-13.2-12H87.93a1.13 1.13 0 01-1-.5L82.15 20a9 9 0 00-7.6-4z"}),a("path",{fill:"#393939",d:"M96 46a4 4 0 110 8 4 4 0 010-8zm0-4a8 8 0 100 16.001A8 8 0 0096 42z"}),a("path",{class:"colored",d:"M60 42a24 24 0 100 48.001A24 24 0 0060 42zm12 26H62v10a2 2 0 01-4 0V68H48a2 2 0 010-4h10V54a2 2 0 014 0v10h10a2 2 0 110 4z"})),s=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"120",height:"120",fill:"none"},a("defs",null),a("path",{fill:"#393939",d:"M110.35 96.52l-24.8-22.66a6.22 6.22 0 00-8.14-.27l-.09.07-10.57 8.93-18.33-17.88a6.001 6.001 0 00-8.51-.35L8.69 91.49a2 2 0 002.62 3l31.3-27.2a2 2 0 012.233-.359 2 2 0 01.637.479l.1.1 45 43.9a2.005 2.005 0 002.83-.03 2.003 2.003 0 00-.03-2.83L69.63 85.39l10.22-8.63a2.3 2.3 0 013 .07l24.77 22.65c.377.343.871.529 1.38.52a2 2 0 001.35-3.48zM75 31a10 10 0 110 20 10 10 0 010-20zm0-4a14 14 0 100 28 14 14 0 000-28z"}),a("path",{class:"colored",d:"M12 36H8V20A12 12 0 0120 8h16v4H20a8 8 0 00-8 8v16zM112 36h-4V20a8.001 8.001 0 00-8-8H84V8h16a11.998 11.998 0 0112 12v16zM36 112H20a11.998 11.998 0 01-12-12V84h4v16a8 8 0 008 8h16v4zM100 112H84v-4h16a8 8 0 008-8V84h4v16c0 3.183-1.264 6.235-3.515 8.485A11.996 11.996 0 01100 112z"})),v=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"120",height:"120",fill:"none"},a("defs",null),a("path",{class:"colored",d:"M84.09 43.24a.53.53 0 00-.29-.48L60.28 29.4a.522.522 0 00-.27-.07.531.531 0 00-.28.07L36.2 42.76a.54.54 0 000 1l23.53 13.3a.54.54 0 00.55 0L83.8 43.72a.53.53 0 00.29-.48zM57.28 61.23L33.73 47.88a.569.569 0 00-.85.48V75a.54.54 0 00.29.48L56.72 88.8a.56.56 0 00.56 0 .53.53 0 00.28-.48V61.71a.56.56 0 00-.28-.48zM86.84 47.88a.63.63 0 00-.29-.08.55.55 0 00-.28.08L62.73 61.23a.56.56 0 00-.28.48v26.61a.53.53 0 00.28.48.56.56 0 00.56 0l23.54-13.29a.54.54 0 00.29-.48V48.36a.55.55 0 00-.28-.48z"}),a("path",{class:"colored",d:"M100 7.94H20a12 12 0 00-12 12v80a11.998 11.998 0 0012 12h80c3.183 0 6.235-1.264 8.485-3.515A11.996 11.996 0 00112 99.94v-80a11.998 11.998 0 00-12-12zm-8 69.24a1.69 1.69 0 01-.85 1.45l-30.31 17.1a1.77 1.77 0 01-1.67 0l-30.32-17.1a1.689 1.689 0 01-.85-1.45V42.82a1.66 1.66 0 01.85-1.45l30.32-17.21a1.71 1.71 0 011.67 0l30.31 17.21a1.67 1.67 0 01.85 1.45v34.36z"})),w=()=>a("svg",{width:"14",height:"11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M5 10.414 0 5.413 1.413 4 5 7.586 12.585 0 14 1.415l-9 8.999Z",fill:"var(--color-primary, var(--color-primary-system))"})),e=()=>a("svg",{width:"9",height:"16",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"m9 8-7.895 8L0 14.88 6.79 8 0 1.12 1.105 0 9 8Z"})),d=()=>a("svg",{width:"22",height:"22",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M18 0h-3v2h3c1.103 0 2 .897 2 2v3h2V4c0-2.206-1.794-4-4-4Zm2 18c0 1.103-.897 2-2 2h-3v2h3c2.206 0 4-1.794 4-4v-3h-2v3ZM2 18v-3H0v3c0 2.206 1.794 4 4 4h3v-2H4c-1.103 0-2-.897-2-2ZM2 4c0-1.103.897-2 2-2h3V0H4C1.794 0 0 1.794 0 4v3h2V4Zm6 6.5C8 9.122 9.122 8 10.5 8S13 9.122 13 10.5 11.878 13 10.5 13A2.503 2.503 0 0 1 8 10.5Zm7.5 6.5a1.503 1.503 0 0 0 1.061-2.561l-2.012-2.011c.293-.6.448-1.26.451-1.928C15 8.019 12.981 6 10.5 6A4.505 4.505 0 0 0 6 10.5c0 2.481 2.019 4.5 4.5 4.5.693 0 1.341-.17 1.928-.451l2.011 2.012c.293.293.677.439 1.061.439Z"})),i=()=>a("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z",fill:"#161616"}));export{l as A,e as C,t as O,d as V,h as a,i as b,w as c,s as d,v as e}
@@ -1 +0,0 @@
1
- import{r as t,h as i,H as e,g as r,c as s}from"./p-e1ba8626.js";import{_ as n,O as o,S as a,a as c,E as h,i as l,s as d,c as u,m as p,f as v,g as m,b as g,d as f,A as b,e as w,T as y}from"./p-59edfbe2.js";import{C as x}from"./p-126775a2.js";import{p as k}from"./p-f582db5c.js";let C=class{constructor(i){t(this,i),this.moveDirection="right",this.contentGroups=[],this.activeContentGroup=0,this.mode="continuity",this.imageWidth=140,this.showScroll=!0,this.recommendations=[],this.columns=0,this.resizeObserver=new ResizeObserver((()=>this.handleResize())),this.mutationObserver=new MutationObserver((()=>this.cloneSlottedContent()))}connectedCallback(){this.setItemWidth()}disconnectedCallback(){this.resizeObserver.disconnect()}componentDidLoad(){this.setWidth(),this.processScrollbarWidth(),this.columns=this.getColumnsNumber();const t=this.el.querySelector(".content");this.mutationObserver.observe(t,{subtree:!0,childList:!0}),this.resizeObserver.observe(this.getHostParent())}getItemWidthFromDocument(){return parseInt(getComputedStyle(document.body).getPropertyValue("--vviinn-carousel-image-width"))}setItemWidth(){const t=this.getItemWidthFromDocument(),i=isNaN(t)?this.imageWidth:t;this.el.style.setProperty("--vviinn-carousel-image-width",`${i}px`)}getContentClassMap(){return{content:!0,[this.moveDirection]:!0,[this.mode]:!0,"show-scrollbar":this.showScroll}}handleResize(){this.setWidth(),this.processScrollbarWidth(),this.setItemWidth();const t=this.getColumnsNumber();t!==this.columns&&(this.columns=t)}calculateMoveStep(){const t=this.getContent().map((t=>t.getBoundingClientRect().width));return t.reduce(((t,i)=>t+i),0)/t.length}getHostParent(){return this.el.parentNode.host.parentElement}setWidth(){const t=this.getHostParent();if(!t)return;const i=getComputedStyle(t),e=t.getBoundingClientRect().width-(parseInt(i["padding-right"])+parseInt(i["padding-left"]));this.el.style.setProperty("--vviinn-carousel-content-width",`${e}px`)}getParent(){return this.el.parentNode.host.parentElement}cloneSlottedContent(){this.setWidth()}getActiveGroupIndex(){var t,i;if(!(null===(i=null===(t=this.getContentNode())||void 0===t?void 0:t.getBoundingClientRect())||void 0===i?void 0:i.left))return 0;const e=this.getContentGroups().map((t=>t.getBoundingClientRect().left)).map(((t,i)=>[t,i])).filter((t=>t[0]>=0));return e.length>0?e[0][1]:0}getContentNode(){return this.el.querySelector(".content")}getContent(){const t=this.getContentNode().children;return Array.from(t).map((t=>t))}getColumnsNumber(){const t=getComputedStyle(this.el).getPropertyValue("--vviinn-carousel-columns-internal");return parseInt(t)}getContentGroups(){return Array.from(this.el.querySelectorAll(".items-group"))}showNext(){this.moveDirection="right";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft+this.calculateMoveStep(),behavior:"smooth"})}))}showPrev(){this.moveDirection="left";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft-this.calculateMoveStep(),behavior:"smooth"})}))}scroll(t){const i=this.getContentNode();requestAnimationFrame((()=>{i.scrollTo({top:0,left:this.calculateMoveStep()*t,behavior:"smooth"})}))}processScrollbarWidth(){const t=this.getContentNode();this.el.style.setProperty("--vviinn-progressbar-width",t.clientWidth*((t.scrollLeft+t.clientWidth)/t.scrollWidth)+"px"),this.activeContentGroup=this.getActiveGroupIndex()}showBullets(){return"grid"===this.mode&&this.showScroll}showScrollbar(){return"continuity"===this.mode&&this.showScroll}getClassMap(){return{[this.mode]:!0,"show-scrollbar":this.showScrollbar()}}renderRecommendation(t){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:"continuity"===this.mode})}renderRecommendationGroup(t){return i("div",{class:"items-group"},t)}renderRecommendationGroups(t){return t.map((t=>this.renderRecommendationGroup(t)))}renderRecommendations(){return"grid"===this.mode?this.renderGrid():this.renderRecommendationsElements()}renderRecommendationsElements(){return this.recommendations.map((t=>this.renderRecommendation(t)))}renderGrid(){const t=this.renderRecommendationsElements(),i=n.chunksOf(this.getColumnsNumber())(t);return this.renderRecommendationGroups(i)}renderBullets(){const t=Math.ceil(this.recommendations.length/this.getColumnsNumber());return Array.from(Array(t).keys()).map((t=>i("div",{class:{bullet:!0,active:this.activeContentGroup===t},onClick:()=>this.scroll(t)})))}render(){return i(e,{class:this.getClassMap()},i("div",{class:Object.assign({body:!0},this.getClassMap())},i("button",{class:"prev",onClick:()=>this.showPrev(),part:"carousel-button"},i(x,null)),i("div",{class:this.getContentClassMap(),onScroll:()=>this.processScrollbarWidth()},this.renderRecommendations()),i("button",{class:"next",onClick:()=>this.showNext(),part:"carousel-button"},i(x,null))),this.showBullets()?i("div",{class:"bullets"},this.renderBullets()):"")}get el(){return r(this)}};C.style=":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)}}";class _{sendImpression(t){var i,e,r;gtag("event","view_item_list",{items:[{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}]})}sendClick(t){var i,e,r;gtag("event","select_content",{content_type:"product",items:[{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}]})}}class P{constructor(){ga("require","ec")}convertProduct(t){var i,e,r;return{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}}sendImpression(t){ga("ec:addImpression",this.convertProduct(t))}sendClick(t){var i,e,r;ga("ec:addProduct",{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}),ga("ec:setAction","click",{list:"VI VPR View"})}}const R=o.getMonoid(a.first()).concat(c.pipe(o.fromNullable(window.gtag),o.map((()=>new _))),c.pipe(o.fromNullable(window.ga),o.map((()=>new P)))),S=/fit\/\d+\//,I=(t,i)=>c.pipe((t=>c.pipe(t.match(S),h.fromNullable(t),h.map((()=>t))))(t),h.map((t=>t.replace(S,`fit/${i}/`))),h.getOrElse((()=>t))),E=(t,e)=>t.deeplink?i("a",{class:t.part,part:t.part,href:t.deeplink},e):e,V=t=>{var e;const r=new Intl.NumberFormat(t.locale,{minimumFractionDigits:2}).format(t.price),s=`${null!==(e=t.prefix)&&void 0!==e?e:""} ${r} ${t.currency}`;return i("span",{class:"price-amount",part:"price-amount"},s)},A=t=>{const e=i(V,{prefix:t.prefix,currency:t.currency,price:t.price,locale:t.locale});return i("span",{class:"price-container",part:"price-container"},t.salePrice?[i("span",{class:"price-sale",part:"price-sale"},i(V,{prefix:t.prefix,currency:t.currency,price:t.salePrice,locale:t.locale})),i("span",{class:"price-outdated",part:"price-outdated"},e)]:i("span",{class:"price-regular",part:"price-regular"},e))};let z=class{constructor(i){t(this,i),this.recommendationLoad=s(this,"recommendationLoad",7),this.recommendationView=s(this,"recommendationView",7),this.recommendationClick=s(this,"recommendationClick",7),this.productImageLoaded=s(this,"productImageLoaded",7),this.currency=void 0,this.imageRatio=1,this.imageWidth=200,this.locale=void 0,this.pricePrefix=void 0,this.responsive=!1,this.dimmedBackground=!1,this.imageLoaded=!1,this.intersectionObserver=new IntersectionObserver(this.intersectionCallback.bind(this),{threshold:1})}intersectionCallback(t){t.some((t=>t.isIntersecting))&&(c.pipe(R,o.map((t=>t.sendImpression(this.getProduct())))),this.recommendationView.emit(this.productId),this.intersectionObserver.disconnect())}componentDidLoad(){this.recommendationLoad.emit(this.productId),this.intersectionObserver.observe(this.el),this.el.shadowRoot.querySelectorAll("a").forEach((t=>t.addEventListener("mousedown",(t=>{this.recommendationClick.emit(this.productId),window.ga&&t.preventDefault(),c.pipe(R,o.match((()=>null),(t=>t.sendClick(this.getProduct())))),window.ga&&ga("send","event","UX","click","Results",{hitCallback:function(){document.location.href=this.deeplink}})}))))}getProduct(){return l.results.find((t=>t.productId===this.productId))}renderImage(){const t={width:this.imageWidth,height:this.imageWidth*this.imageRatio,src:this.image,title:this.productTitle,lazy:!1};return this.responsive?((t,e=(()=>{}))=>i("picture",null,i("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image responsive",src:I(t.src,t.width),alt:t.title,onLoad:e})))(t,(()=>this.kek())):((t,e=(()=>{}))=>i("picture",null,i("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image",width:t.width,height:t.height,src:I(t.src,t.width),alt:t.title,onLoad:e})))(t,(()=>this.kek()))}kek(){this.productImageLoaded.emit(this.productId)}render(){var t,r,s;return i(e,{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"},i(E,{deeplink:this.deeplink,part:"image-link"},this.renderImage()),i(E,{deeplink:this.deeplink,part:"deeplink"},i("span",{class:"title",part:"title"},this.productTitle)),i("span",{class:"brand",part:"brand"},this.brand),i("span",{class:"type",part:"type"},this.productType),i(A,{prefix:null!==(t=this.pricePrefix)&&void 0!==t?t:d.pricePrefix,currency:null!==(r=this.currency)&&void 0!==r?r:d.currencySign,price:this.price,salePrice:this.salePrice,locale:null!==(s=this.locale)&&void 0!==s?s:d.locale}))}get el(){return r(this)}};z.style=':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}';const j=c.flow((t=>`Bearer ${t}`),(t=>new Headers({Authorization:t})),(t=>({headers:t}))),D=f(b),O=(t,i={})=>k(D(m(),g),v,u(p(t,i))),$=t=>i=>O(`product/${t}/similar-products`,i),T=t=>i=>O(`product/${t}/cross-selling-products`,i);function L(t){return"function"==typeof t}function M(t){const i=t((t=>{Error.call(t),t.stack=(new Error).stack}));return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i}const N=M((t=>function(i){t(this),this.message=i?`${i.length} errors occurred during unsubscription:\n${i.map(((t,i)=>`${i+1}) ${t.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=i}));function W(t,i){if(t){const e=t.indexOf(i);0<=e&&t.splice(e,1)}}class F{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:i}=this;if(i)if(this._parentage=null,Array.isArray(i))for(const t of i)t.remove(this);else i.remove(this);const{initialTeardown:e}=this;if(L(e))try{e()}catch(i){t=i instanceof N?i.errors:[i]}const{_finalizers:r}=this;if(r){this._finalizers=null;for(const i of r)try{U(i)}catch(i){t=null!=t?t:[],i instanceof N?t=[...t,...i.errors]:t.push(i)}}if(t)throw new N(t)}}add(t){var i;if(t&&t!==this)if(this.closed)U(t);else{if(t instanceof F){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(i=this._finalizers)&&void 0!==i?i:[]).push(t)}}_hasParent(t){const{_parentage:i}=this;return i===t||Array.isArray(i)&&i.includes(t)}_addParent(t){const{_parentage:i}=this;this._parentage=Array.isArray(i)?(i.push(t),i):i?[i,t]:t}_removeParent(t){const{_parentage:i}=this;i===t?this._parentage=null:Array.isArray(i)&&W(i,t)}remove(t){const{_finalizers:i}=this;i&&W(i,t),t instanceof F&&t._removeParent(this)}}F.EMPTY=(()=>{const t=new F;return t.closed=!0,t})();const B=F.EMPTY;function G(t){return t instanceof F||t&&"closed"in t&&L(t.remove)&&L(t.add)&&L(t.unsubscribe)}function U(t){L(t)?t():t.unsubscribe()}const q={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},H={setTimeout(t,i,...e){const{delegate:r}=H;return(null==r?void 0:r.setTimeout)?r.setTimeout(t,i,...e):setTimeout(t,i,...e)},clearTimeout(t){const{delegate:i}=H;return((null==i?void 0:i.clearTimeout)||clearTimeout)(t)},delegate:void 0};function X(){}const J=K("C",void 0,void 0);function K(t,i,e){return{kind:t,value:i,error:e}}function Q(t){t()}class Y extends F{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,G(t)&&t.add(this)):this.destination=nt}static create(t,i,e){return new et(t,i,e)}next(t){this.isStopped?st(function(t){return K("N",t,void 0)}(t),this):this._next(t)}error(t){this.isStopped?st(K("E",void 0,t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?st(J,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const Z=Function.prototype.bind;function tt(t,i){return Z.call(t,i)}class it{constructor(t){this.partialObserver=t}next(t){const{partialObserver:i}=this;if(i.next)try{i.next(t)}catch(t){rt(t)}}error(t){const{partialObserver:i}=this;if(i.error)try{i.error(t)}catch(t){rt(t)}else rt(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(t){rt(t)}}}class et extends Y{constructor(t,i,e){let r;if(super(),L(t)||!t)r={next:null!=t?t:void 0,error:null!=i?i:void 0,complete:null!=e?e:void 0};else{let i;this&&q.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),r={next:t.next&&tt(t.next,i),error:t.error&&tt(t.error,i),complete:t.complete&&tt(t.complete,i)}):r=t}this.destination=new it(r)}}function rt(t){var i;i=t,H.setTimeout((()=>{const{onUnhandledError:t}=q;if(!t)throw i;t(i)}))}function st(t,i){const{onStoppedNotification:e}=q;e&&H.setTimeout((()=>e(t,i)))}const nt={closed:!0,next:X,error:function(t){throw t},complete:X},ot="function"==typeof Symbol&&Symbol.observable||"@@observable";function at(t){return t}class ct{constructor(t){t&&(this._subscribe=t)}lift(t){const i=new ct;return i.source=this,i.operator=t,i}subscribe(t,i,e){const r=(s=t)&&s instanceof Y||function(t){return t&&L(t.next)&&L(t.error)&&L(t.complete)}(s)&&G(s)?t:new et(t,i,e);var s;return Q((()=>{const{operator:t,source:i}=this;r.add(t?t.call(r,i):i?this._subscribe(r):this._trySubscribe(r))})),r}_trySubscribe(t){try{return this._subscribe(t)}catch(i){t.error(i)}}forEach(t,i){return new(i=ht(i))(((i,e)=>{const r=new et({next:i=>{try{t(i)}catch(t){e(t),r.unsubscribe()}},error:e,complete:i});this.subscribe(r)}))}_subscribe(t){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(t)}[ot](){return this}pipe(...t){return(0===(i=t).length?at:1===i.length?i[0]:function(t){return i.reduce(((t,i)=>i(t)),t)})(this);var i}toPromise(t){return new(t=ht(t))(((t,i)=>{let e;this.subscribe((t=>e=t),(t=>i(t)),(()=>t(e)))}))}}function ht(t){var i;return null!==(i=null!=t?t:q.Promise)&&void 0!==i?i:Promise}ct.create=t=>new ct(t);const lt=M((t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}));class dt extends ct{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const i=new ut(this,this);return i.operator=t,i}_throwIfClosed(){if(this.closed)throw new lt}next(t){Q((()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(t)}}))}error(t){Q((()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:i}=this;for(;i.length;)i.shift().error(t)}}))}complete(){Q((()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}}))}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:i,isStopped:e,observers:r}=this;return i||e?B:(this.currentObservers=null,r.push(t),new F((()=>{this.currentObservers=null,W(r,t)})))}_checkFinalizedStatuses(t){const{hasError:i,thrownError:e,isStopped:r}=this;i?t.error(e):r&&t.complete()}asObservable(){const t=new ct;return t.source=this,t}}dt.create=(t,i)=>new ut(t,i);class ut extends dt{constructor(t,i){super(),this.destination=t,this.source=i}next(t){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.next)||void 0===e||e.call(i,t)}error(t){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.error)||void 0===e||e.call(i,t)}complete(){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===i||i.call(t)}_subscribe(t){var i,e;return null!==(e=null===(i=this.source)||void 0===i?void 0:i.subscribe(t))&&void 0!==e?e:B}}let pt=class{constructor(i){t(this,i),this.recommendationsLoaded=s(this,"recommendationsLoaded",7),this.blockTitle="Recommended products",this.imageRatio=1,this.imageWidth=300,this.currencySign="€",this.mode="continuity",this.campaignType="VPR",this.locale="de-DE",this.apiPath="https://api.vviinn.com",this.useCarousel=!0,this.showScroll=!0,this.cssUrl=null,this.recommendations=[],this.loaded=!1,this.productImageLoadedSubject=new dt}handleProductIdChange(){this.getRecommendations()}handleCampaignTypeChange(){this.getRecommendations()}handleApiPathChange(t){w.apiPath=t,this.getRecommendations()}lol({detail:t}){this.productImageLoadedSubject.next(t)}connectedCallback(){w.apiPath=this.apiPath,w.currencySign=this.currencySign,w.locale=this.locale}async componentWillLoad(){w.pricePrefix=this.pricePrefix,w.currencySign=this.currencySign,this.getRecommendations()}async getRecommendations(){if(void 0===this.productId||void 0===this.token)return;const t=this.campaignType.length>0?this.campaignType:"VPR",i=j(this.token),e=c.pipe(y.of((t=>{return c.pipe("VPR"===t?{_tag:"VPR"}:{_tag:"VCS"},(i=()=>$,e=()=>T,t=>(t=>"VPR"===t._tag)(t)?i():e()));var i,e})(t)),y.ap(y.of(this.productId)),y.ap(y.of(i)),y.flatten),r=await e();c.pipe(r,h.fold((t=>this.handleError(t)),(t=>this.handleRecommendationsSucces(t))))}handleError(t){console.log("ERROR:",t)}handleRecommendationsSucces(t){var i;this.recommendations=null!==(i=null==t?void 0:t.extended)&&void 0!==i?i:t,l.results=this.recommendations,this.loaded=!0,this.productIds=this.recommendations.map((t=>t.productId)),this.productImageLoadedSubject.subscribe((t=>{this.productIds=this.productIds.filter((i=>i!==t)),0===this.productIds.length&&this.recommendationsLoaded.emit()}))}isExternalCSS(){return this.cssUrl&&this.cssUrl.length>0}renderExternalCSS(){return this.isExternalCSS()?i("link",{href:this.cssUrl,rel:"stylesheet"}):""}render(){return i(e,{class:{loaded:this.loaded,empty:0==this.recommendations.length,[this.mode]:!0},"aria-hidden":this.loaded?"false":"true"},this.renderExternalCSS(),i("style",null,w.fallbackStyles),i("h2",{part:"recommendations-title"},this.blockTitle),this.useCarousel?this.renderCarousel():this.renderResults())}renderRecommendation(t){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:this.useDimmedBackgroundInCard()})}useDimmedBackgroundInCard(){return"continuity"===this.mode||!this.useCarousel}renderResults(){return i("div",{class:"recommendations-grid",part:"recommendations-grid"},this.recommendations.map((t=>this.renderRecommendation(t))))}renderCarousel(){return i("vviinn-carousel",{mode:this.mode,imageWidth:this.imageWidth,showScroll:this.showScroll,recommendations:this.recommendations})}get el(){return r(this)}static get watchers(){return{productId:["handleProductIdChange"],campaignType:["handleCampaignTypeChange"],apiPath:["handleApiPathChange"]}}};pt.style=":host{display:grid;grid-gap:1rem;width:100%}:host(:not(.loaded)){position:absolute;visibility:hidden}:host(.grid) vviinn-product-card::part(image){border:1px solid #DDDDDD;width:100%}h2{margin:0}vviinn-product-card::part(price-container){align-self:flex-start;text-align:left;display:flex}.results{display:grid;grid-gap:1rem}.visually-hidden{position:absolute;top:0;left:0;z-index:-1;height:0;width:0}h2{margin:0}:host(.grid) h2{justify-content:center}:host(.grid) vviinn-product-card::part(image){min-width:100%}:host(.grid) vviinn-product-card::part(image-link){width:100%}:host(.grid) vviinn-product-card::part(title),:host(.grid) vviinn-product-card::part(brand),:host(.grid) vviinn-product-card::part(type){text-align:center}:host(.grid) vviinn-product-card::part(price-container){align-self:center}:host(.continuity) vviinn-product-card::part(title),:host(.continuity) vviinn-product-card::part(brand),:host(.continuity) vviinn-product-card::part(type),:host(.continuity) vviinn-product-card::part(deeplink){text-align:left;max-width:unset;align-self:start}";export{C as vviinn_carousel,z as vviinn_product_card,pt as vviinn_vpr_widget}