vviinn-widgets 2.49.2 → 2.49.3

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 (30) hide show
  1. package/dist/cjs/{package-cc6cc310.js → package-63c9c51a.js} +1 -1
  2. package/dist/cjs/vviinn-carousel_4.cjs.entry.js +17 -35
  3. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
  4. package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
  5. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +1 -1
  6. package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +0 -1
  7. package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +15 -33
  8. package/dist/esm/{package-aac1b6b8.js → package-087515d9.js} +1 -1
  9. package/dist/esm/vviinn-carousel_4.entry.js +17 -35
  10. package/dist/esm/vviinn-vpr-button.entry.js +1 -1
  11. package/dist/esm/vviinn-vps-button.entry.js +1 -1
  12. package/dist/esm/vviinn-vps-widget.entry.js +1 -1
  13. package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +1 -3
  14. package/dist/vviinn-widgets/{p-ed2ec1e7.entry.js → p-76dc0b45.entry.js} +1 -1
  15. package/dist/vviinn-widgets/p-7a70bfb0.js +1 -0
  16. package/dist/vviinn-widgets/{p-fba08738.entry.js → p-bfda52d8.entry.js} +1 -1
  17. package/{www/build/p-61977fe5.entry.js → dist/vviinn-widgets/p-cb81c9a6.entry.js} +1 -1
  18. package/dist/vviinn-widgets/p-d36d6a6a.entry.js +1 -0
  19. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  20. package/package.json +1 -1
  21. package/www/build/{p-ed2ec1e7.entry.js → p-76dc0b45.entry.js} +1 -1
  22. package/www/build/p-7a70bfb0.js +1 -0
  23. package/www/build/{p-fba08738.entry.js → p-bfda52d8.entry.js} +1 -1
  24. package/{dist/vviinn-widgets/p-61977fe5.entry.js → www/build/p-cb81c9a6.entry.js} +1 -1
  25. package/www/build/p-d36d6a6a.entry.js +1 -0
  26. package/www/build/vviinn-widgets.esm.js +1 -1
  27. package/dist/vviinn-widgets/p-4b571be0.js +0 -1
  28. package/dist/vviinn-widgets/p-a2de4bb7.entry.js +0 -1
  29. package/www/build/p-4b571be0.js +0 -1
  30. package/www/build/p-a2de4bb7.entry.js +0 -1
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "2.49.2";
3
+ const version = "2.49.3";
4
4
 
5
5
  exports.version = version;
@@ -7,7 +7,7 @@ const search_store = require('./search.store-7605f369.js');
7
7
  const i18next = require('./i18next-74ff3413.js');
8
8
  const PlusIcon = require('./PlusIcon-5e585127.js');
9
9
  const customizedSlots = require('./customized-slots-67b24737.js');
10
- const _package = require('./package-cc6cc310.js');
10
+ const _package = require('./package-63c9c51a.js');
11
11
  const index$1 = require('./index-4445cb70.js');
12
12
 
13
13
  const BasketIcon = () => (index.h("svg", { width: "25", height: "24", viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
@@ -43,7 +43,7 @@ const generateRandomNumber = (min, max) => {
43
43
  return Math.floor(Math.random() * (max - min + 1)) + min;
44
44
  };
45
45
 
46
- const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4)}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.bullets{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;gap:8px;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) .prev,:host(.continuity) .next{border-radius:2px}:host(.grid) .prev,:host(.grid) .next{border-radius:50%}.prev,.next{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);fill:#525252;cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}.next:disabled,.prev:disabled{display:none}.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}@media (max-width: 480px){.items-group{grid-template-columns:repeat(2, 1fr)}}.body.set{max-width:100%;justify-content:space-between;margin-left:auto;display:flex;flex-direction:row;gap:112px}.body.set::-webkit-scrollbar{display:none}@media (max-width: 768px){.body.set{gap:40px}}.content.set{grid-gap:20px;height:-moz-fit-content;height:fit-content;max-width:-moz-fit-content;max-width:fit-content;overflow:unset}";
46
+ const vviinnCarouselCss = ":host{--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4)}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.bullets{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;gap:8px;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) .prev,:host(.continuity) .next{border-radius:2px}:host(.grid) .prev,:host(.grid) .next{border-radius:50%}.prev,.next{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);fill:#525252;cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}.next:disabled,.prev:disabled{display:none}.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}@media (max-width: 480px){.items-group{grid-template-columns:repeat(2, 1fr)}}.body.set{max-width:100%;justify-content:space-between;margin-left:auto;display:flex;flex-direction:row;gap:112px}.body.set::-webkit-scrollbar{display:none}@media (max-width: 768px){.body.set{gap:40px}}.content.set{grid-gap:20px;height:-moz-fit-content;height:fit-content;max-width:-moz-fit-content;max-width:fit-content;overflow:unset}";
47
47
 
48
48
  const VviinnCarousel = class {
49
49
  constructor(hostRef) {
@@ -53,9 +53,9 @@ const VviinnCarousel = class {
53
53
  this.defaultAnimationInterval = 2000;
54
54
  this.mutationObserver = new MutationObserver(() => this.cloneSlottedContent());
55
55
  this.handleWindowResize = () => this.setImageWidthSetMode("100%");
56
- this.isLastGroup = () => this.activeContentGroup === this.getContentGroups().length - 1 &&
57
- this.isGridMode;
58
- this.isFirstGroup = () => this.activeContentGroup === 0 && this.isGridMode;
56
+ this.isLastGroup = () => this.isGridMode &&
57
+ this.activeContentGroup === this.getContentGroups().length - 1;
58
+ this.isFirstGroup = () => this.isGridMode && this.activeContentGroup === 0;
59
59
  this.updateCard = (productId, step, animationInterval) => {
60
60
  let clickedProduct = this.crossSellingRecommendations.find((item) => item.productId === productId);
61
61
  const crossSellingIndex = this.crossSellingRecommendations.indexOf(clickedProduct);
@@ -121,11 +121,16 @@ const VviinnCarousel = class {
121
121
  }
122
122
  componentDidLoad() {
123
123
  this.setWidth();
124
- this.processScrollbarWidth();
125
124
  this.columns = this.getColumnsNumber();
126
125
  const slot = this.el.querySelector(".content");
127
126
  this.mutationObserver.observe(slot, { subtree: true, childList: true });
128
127
  this.resizeObserver.observe(this.getHostParent());
128
+ if (this.isGridMode) {
129
+ const contentNode = this.getContentNode();
130
+ contentNode.addEventListener("scrollend", () => {
131
+ this.activeContentGroup = this.getActiveGroupIndex();
132
+ });
133
+ }
129
134
  }
130
135
  updatingAllCardsWatcher() {
131
136
  if (!this.updatingAllCards)
@@ -175,7 +180,6 @@ const VviinnCarousel = class {
175
180
  }
176
181
  handleResize() {
177
182
  this.setWidth();
178
- this.processScrollbarWidth();
179
183
  this.setItemWidth();
180
184
  const newColumns = this.getColumnsNumber();
181
185
  if (newColumns !== this.columns) {
@@ -212,10 +216,6 @@ const VviinnCarousel = class {
212
216
  this.setWidth();
213
217
  }
214
218
  getActiveGroupIndex() {
215
- var _a, _b;
216
- const contentNodeLeft = (_b = (_a = this.getContentNode()) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.left;
217
- if (!contentNodeLeft)
218
- return 0;
219
219
  const groups = this.getContentGroups();
220
220
  const groupsPositions = groups.map((g) => g.getBoundingClientRect().left);
221
221
  const indexedPositions = groupsPositions
@@ -243,24 +243,15 @@ const VviinnCarousel = class {
243
243
  getContentGroups() {
244
244
  return Array.from(this.el.querySelectorAll(`.${CONTENT_GROUP_CSS_CLASS}`));
245
245
  }
246
- showNext() {
247
- this.moveDirection = "right";
246
+ handleCarouselButtonClick(action) {
247
+ this.moveDirection = action;
248
248
  const contentContainer = this.getContentNode();
249
+ const { scrollLeft } = contentContainer;
250
+ const step = this.calculateMoveStep();
249
251
  requestAnimationFrame(() => {
250
252
  contentContainer.scrollTo({
251
253
  top: 0,
252
- left: contentContainer.scrollLeft + this.calculateMoveStep(),
253
- behavior: "smooth",
254
- });
255
- });
256
- }
257
- showPrev() {
258
- this.moveDirection = "left";
259
- const contentContainer = this.getContentNode();
260
- requestAnimationFrame(() => {
261
- contentContainer.scrollTo({
262
- top: 0,
263
- left: contentContainer.scrollLeft - this.calculateMoveStep(),
254
+ left: action === "right" ? scrollLeft + step : scrollLeft - step,
264
255
  behavior: "smooth",
265
256
  });
266
257
  });
@@ -275,15 +266,6 @@ const VviinnCarousel = class {
275
266
  });
276
267
  });
277
268
  }
278
- processScrollbarWidth() {
279
- const target = this.getContentNode();
280
- if (!target)
281
- return;
282
- const scrollRatio = (target.scrollLeft + target.clientWidth) / target.scrollWidth;
283
- const scrolledWidth = target.clientWidth * scrollRatio;
284
- this.el.style.setProperty("--vviinn-progressbar-width", `${scrolledWidth}px`);
285
- this.activeContentGroup = this.getActiveGroupIndex();
286
- }
287
269
  showBullets() {
288
270
  return this.isGridMode && this.showScroll;
289
271
  }
@@ -336,7 +318,7 @@ const VviinnCarousel = class {
336
318
  }, onClick: () => this.scroll(index$1) })));
337
319
  }
338
320
  render() {
339
- return (index.h(index.Host, { class: this.getClassMap() }, index.h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, !this.isSetMode && (index.h("button", { class: "prev", onClick: () => this.showPrev(), part: "carousel-button", disabled: this.gridArrowsDynamic && this.isFirstGroup() }, index.h(ChevronIcon, null))), this.isSetMode && (index.h("vviinn-product-card", { part: "product-part", class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: this.sourceProduct.image.thumbnail, price: this.sourceProduct.price.actual, imageRatio: 1, imageWidth: 300, dimmedBackground: true, isSourceProduct: true })), index.h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }, this.renderRecommendations()), !this.isSetMode && (index.h("button", { class: "next", onClick: () => this.showNext(), part: "carousel-button", disabled: this.gridArrowsDynamic && this.isLastGroup() }, index.h(ChevronIcon, null)))), this.showBullets() && (index.h("div", { class: "bullets" }, this.renderBullets()))));
321
+ return (index.h(index.Host, { class: this.getClassMap() }, index.h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, !this.isSetMode && (index.h("button", { class: "prev", onClick: () => this.handleCarouselButtonClick("left"), part: "carousel-button", disabled: this.gridArrowsDynamic && this.isFirstGroup() }, index.h(ChevronIcon, null))), this.isSetMode && (index.h("vviinn-product-card", { part: "product-part", class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: this.sourceProduct.image.thumbnail, price: this.sourceProduct.price.actual, imageRatio: 1, imageWidth: 300, dimmedBackground: true, isSourceProduct: true })), index.h("div", { class: this.getContentClassMap() }, this.renderRecommendations()), !this.isSetMode && (index.h("button", { class: "next", onClick: () => this.handleCarouselButtonClick("right"), part: "carousel-button", disabled: this.gridArrowsDynamic && this.isLastGroup() }, index.h(ChevronIcon, null)))), this.showBullets() && (index.h("div", { class: "bullets" }, this.renderBullets()))));
340
322
  }
341
323
  get el() { return index.getElement(this); }
342
324
  static get watchers() { return {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const _package = require('./package-cc6cc310.js');
6
+ const _package = require('./package-63c9c51a.js');
7
7
  const VisualSearchIcon = require('./VisualSearchIcon-1180d079.js');
8
8
 
9
9
  const vviinnVprButtonCss = ":host{display:block}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const _package = require('./package-cc6cc310.js');
6
+ const _package = require('./package-63c9c51a.js');
7
7
  const customizedSlots = require('./customized-slots-67b24737.js');
8
8
  const constants = require('./constants-7684cbfc.js');
9
9
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-5619b5ec.js');
6
6
  const search_store = require('./search.store-7605f369.js');
7
7
  const i18next = require('./i18next-74ff3413.js');
8
- const _package = require('./package-cc6cc310.js');
8
+ const _package = require('./package-63c9c51a.js');
9
9
  const customizedSlots = require('./customized-slots-67b24737.js');
10
10
  const index$1 = require('./index-4445cb70.js');
11
11
  const constants = require('./constants-7684cbfc.js');
@@ -1,5 +1,4 @@
1
1
  :host {
2
- --vviinn-progressbar-width: 0;
3
2
  --vviinn-carousel-columns-internal: var(--vviinn-carousel-columns, 4);
4
3
  }
5
4
 
@@ -14,9 +14,9 @@ export class VviinnCarousel {
14
14
  this.defaultAnimationInterval = 2000;
15
15
  this.mutationObserver = new MutationObserver(() => this.cloneSlottedContent());
16
16
  this.handleWindowResize = () => this.setImageWidthSetMode("100%");
17
- this.isLastGroup = () => this.activeContentGroup === this.getContentGroups().length - 1 &&
18
- this.isGridMode;
19
- this.isFirstGroup = () => this.activeContentGroup === 0 && this.isGridMode;
17
+ this.isLastGroup = () => this.isGridMode &&
18
+ this.activeContentGroup === this.getContentGroups().length - 1;
19
+ this.isFirstGroup = () => this.isGridMode && this.activeContentGroup === 0;
20
20
  this.updateCard = (productId, step, animationInterval) => {
21
21
  let clickedProduct = this.crossSellingRecommendations.find((item) => item.productId === productId);
22
22
  const crossSellingIndex = this.crossSellingRecommendations.indexOf(clickedProduct);
@@ -82,11 +82,16 @@ export class VviinnCarousel {
82
82
  }
83
83
  componentDidLoad() {
84
84
  this.setWidth();
85
- this.processScrollbarWidth();
86
85
  this.columns = this.getColumnsNumber();
87
86
  const slot = this.el.querySelector(".content");
88
87
  this.mutationObserver.observe(slot, { subtree: true, childList: true });
89
88
  this.resizeObserver.observe(this.getHostParent());
89
+ if (this.isGridMode) {
90
+ const contentNode = this.getContentNode();
91
+ contentNode.addEventListener("scrollend", () => {
92
+ this.activeContentGroup = this.getActiveGroupIndex();
93
+ });
94
+ }
90
95
  }
91
96
  updatingAllCardsWatcher() {
92
97
  if (!this.updatingAllCards)
@@ -136,7 +141,6 @@ export class VviinnCarousel {
136
141
  }
137
142
  handleResize() {
138
143
  this.setWidth();
139
- this.processScrollbarWidth();
140
144
  this.setItemWidth();
141
145
  const newColumns = this.getColumnsNumber();
142
146
  if (newColumns !== this.columns) {
@@ -173,10 +177,6 @@ export class VviinnCarousel {
173
177
  this.setWidth();
174
178
  }
175
179
  getActiveGroupIndex() {
176
- var _a, _b;
177
- const contentNodeLeft = (_b = (_a = this.getContentNode()) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.left;
178
- if (!contentNodeLeft)
179
- return 0;
180
180
  const groups = this.getContentGroups();
181
181
  const groupsPositions = groups.map((g) => g.getBoundingClientRect().left);
182
182
  const indexedPositions = groupsPositions
@@ -204,24 +204,15 @@ export class VviinnCarousel {
204
204
  getContentGroups() {
205
205
  return Array.from(this.el.querySelectorAll(`.${CONTENT_GROUP_CSS_CLASS}`));
206
206
  }
207
- showNext() {
208
- this.moveDirection = "right";
207
+ handleCarouselButtonClick(action) {
208
+ this.moveDirection = action;
209
209
  const contentContainer = this.getContentNode();
210
+ const { scrollLeft } = contentContainer;
211
+ const step = this.calculateMoveStep();
210
212
  requestAnimationFrame(() => {
211
213
  contentContainer.scrollTo({
212
214
  top: 0,
213
- left: contentContainer.scrollLeft + this.calculateMoveStep(),
214
- behavior: "smooth",
215
- });
216
- });
217
- }
218
- showPrev() {
219
- this.moveDirection = "left";
220
- const contentContainer = this.getContentNode();
221
- requestAnimationFrame(() => {
222
- contentContainer.scrollTo({
223
- top: 0,
224
- left: contentContainer.scrollLeft - this.calculateMoveStep(),
215
+ left: action === "right" ? scrollLeft + step : scrollLeft - step,
225
216
  behavior: "smooth",
226
217
  });
227
218
  });
@@ -236,15 +227,6 @@ export class VviinnCarousel {
236
227
  });
237
228
  });
238
229
  }
239
- processScrollbarWidth() {
240
- const target = this.getContentNode();
241
- if (!target)
242
- return;
243
- const scrollRatio = (target.scrollLeft + target.clientWidth) / target.scrollWidth;
244
- const scrolledWidth = target.clientWidth * scrollRatio;
245
- this.el.style.setProperty("--vviinn-progressbar-width", `${scrolledWidth}px`);
246
- this.activeContentGroup = this.getActiveGroupIndex();
247
- }
248
230
  showBullets() {
249
231
  return this.isGridMode && this.showScroll;
250
232
  }
@@ -297,7 +279,7 @@ export class VviinnCarousel {
297
279
  }, onClick: () => this.scroll(index) })));
298
280
  }
299
281
  render() {
300
- return (h(Host, { class: this.getClassMap() }, h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, !this.isSetMode && (h("button", { class: "prev", onClick: () => this.showPrev(), part: "carousel-button", disabled: this.gridArrowsDynamic && this.isFirstGroup() }, h(ChevronIcon, null))), this.isSetMode && (h("vviinn-product-card", { part: "product-part", class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: this.sourceProduct.image.thumbnail, price: this.sourceProduct.price.actual, imageRatio: 1, imageWidth: 300, dimmedBackground: true, isSourceProduct: true })), h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }, this.renderRecommendations()), !this.isSetMode && (h("button", { class: "next", onClick: () => this.showNext(), part: "carousel-button", disabled: this.gridArrowsDynamic && this.isLastGroup() }, h(ChevronIcon, null)))), this.showBullets() && (h("div", { class: "bullets" }, this.renderBullets()))));
282
+ return (h(Host, { class: this.getClassMap() }, h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, !this.isSetMode && (h("button", { class: "prev", onClick: () => this.handleCarouselButtonClick("left"), part: "carousel-button", disabled: this.gridArrowsDynamic && this.isFirstGroup() }, h(ChevronIcon, null))), this.isSetMode && (h("vviinn-product-card", { part: "product-part", class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: this.sourceProduct.image.thumbnail, price: this.sourceProduct.price.actual, imageRatio: 1, imageWidth: 300, dimmedBackground: true, isSourceProduct: true })), h("div", { class: this.getContentClassMap() }, this.renderRecommendations()), !this.isSetMode && (h("button", { class: "next", onClick: () => this.handleCarouselButtonClick("right"), part: "carousel-button", disabled: this.gridArrowsDynamic && this.isLastGroup() }, h(ChevronIcon, null)))), this.showBullets() && (h("div", { class: "bullets" }, this.renderBullets()))));
301
283
  }
302
284
  static get is() { return "vviinn-carousel"; }
303
285
  static get originalStyleUrls() {
@@ -1,3 +1,3 @@
1
- const version = "2.49.2";
1
+ const version = "2.49.3";
2
2
 
3
3
  export { version as v };
@@ -3,7 +3,7 @@ import { _ as _function, a as _Array, O as Option, S as Semigroup, h as has, t a
3
3
  import { i as instance } from './i18next-387f2b0a.js';
4
4
  import { P as PlusIcon } from './PlusIcon-af795e23.js';
5
5
  import { s as slotChangeListener, c as campaignTypeNames, f as fromString, a as fold, S as SlotSkeleton } from './customized-slots-e56251a2.js';
6
- import { v as version } from './package-aac1b6b8.js';
6
+ import { v as version } from './package-087515d9.js';
7
7
  import { v as v4, c as createTrackingApi, a as createAddToBasketVpcEvent, b as createAddToBasketVprEvent, d as createWidgetVpcEvent, e as createWidgetVprEvent, f as createResultVpcEventByType, g as createResultVprEventByType, h as createProductVpcEventByType, i as createProductVprEventByType } from './index-76fe67d1.js';
8
8
 
9
9
  const BasketIcon = () => (h("svg", { width: "25", height: "24", viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
@@ -39,7 +39,7 @@ const generateRandomNumber = (min, max) => {
39
39
  return Math.floor(Math.random() * (max - min + 1)) + min;
40
40
  };
41
41
 
42
- const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4)}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.bullets{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;gap:8px;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) .prev,:host(.continuity) .next{border-radius:2px}:host(.grid) .prev,:host(.grid) .next{border-radius:50%}.prev,.next{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);fill:#525252;cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}.next:disabled,.prev:disabled{display:none}.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}@media (max-width: 480px){.items-group{grid-template-columns:repeat(2, 1fr)}}.body.set{max-width:100%;justify-content:space-between;margin-left:auto;display:flex;flex-direction:row;gap:112px}.body.set::-webkit-scrollbar{display:none}@media (max-width: 768px){.body.set{gap:40px}}.content.set{grid-gap:20px;height:-moz-fit-content;height:fit-content;max-width:-moz-fit-content;max-width:fit-content;overflow:unset}";
42
+ const vviinnCarouselCss = ":host{--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4)}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.bullets{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;gap:8px;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) .prev,:host(.continuity) .next{border-radius:2px}:host(.grid) .prev,:host(.grid) .next{border-radius:50%}.prev,.next{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);fill:#525252;cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}.next:disabled,.prev:disabled{display:none}.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}@media (max-width: 480px){.items-group{grid-template-columns:repeat(2, 1fr)}}.body.set{max-width:100%;justify-content:space-between;margin-left:auto;display:flex;flex-direction:row;gap:112px}.body.set::-webkit-scrollbar{display:none}@media (max-width: 768px){.body.set{gap:40px}}.content.set{grid-gap:20px;height:-moz-fit-content;height:fit-content;max-width:-moz-fit-content;max-width:fit-content;overflow:unset}";
43
43
 
44
44
  const VviinnCarousel = class {
45
45
  constructor(hostRef) {
@@ -49,9 +49,9 @@ const VviinnCarousel = class {
49
49
  this.defaultAnimationInterval = 2000;
50
50
  this.mutationObserver = new MutationObserver(() => this.cloneSlottedContent());
51
51
  this.handleWindowResize = () => this.setImageWidthSetMode("100%");
52
- this.isLastGroup = () => this.activeContentGroup === this.getContentGroups().length - 1 &&
53
- this.isGridMode;
54
- this.isFirstGroup = () => this.activeContentGroup === 0 && this.isGridMode;
52
+ this.isLastGroup = () => this.isGridMode &&
53
+ this.activeContentGroup === this.getContentGroups().length - 1;
54
+ this.isFirstGroup = () => this.isGridMode && this.activeContentGroup === 0;
55
55
  this.updateCard = (productId, step, animationInterval) => {
56
56
  let clickedProduct = this.crossSellingRecommendations.find((item) => item.productId === productId);
57
57
  const crossSellingIndex = this.crossSellingRecommendations.indexOf(clickedProduct);
@@ -117,11 +117,16 @@ const VviinnCarousel = class {
117
117
  }
118
118
  componentDidLoad() {
119
119
  this.setWidth();
120
- this.processScrollbarWidth();
121
120
  this.columns = this.getColumnsNumber();
122
121
  const slot = this.el.querySelector(".content");
123
122
  this.mutationObserver.observe(slot, { subtree: true, childList: true });
124
123
  this.resizeObserver.observe(this.getHostParent());
124
+ if (this.isGridMode) {
125
+ const contentNode = this.getContentNode();
126
+ contentNode.addEventListener("scrollend", () => {
127
+ this.activeContentGroup = this.getActiveGroupIndex();
128
+ });
129
+ }
125
130
  }
126
131
  updatingAllCardsWatcher() {
127
132
  if (!this.updatingAllCards)
@@ -171,7 +176,6 @@ const VviinnCarousel = class {
171
176
  }
172
177
  handleResize() {
173
178
  this.setWidth();
174
- this.processScrollbarWidth();
175
179
  this.setItemWidth();
176
180
  const newColumns = this.getColumnsNumber();
177
181
  if (newColumns !== this.columns) {
@@ -208,10 +212,6 @@ const VviinnCarousel = class {
208
212
  this.setWidth();
209
213
  }
210
214
  getActiveGroupIndex() {
211
- var _a, _b;
212
- const contentNodeLeft = (_b = (_a = this.getContentNode()) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.left;
213
- if (!contentNodeLeft)
214
- return 0;
215
215
  const groups = this.getContentGroups();
216
216
  const groupsPositions = groups.map((g) => g.getBoundingClientRect().left);
217
217
  const indexedPositions = groupsPositions
@@ -239,24 +239,15 @@ const VviinnCarousel = class {
239
239
  getContentGroups() {
240
240
  return Array.from(this.el.querySelectorAll(`.${CONTENT_GROUP_CSS_CLASS}`));
241
241
  }
242
- showNext() {
243
- this.moveDirection = "right";
242
+ handleCarouselButtonClick(action) {
243
+ this.moveDirection = action;
244
244
  const contentContainer = this.getContentNode();
245
+ const { scrollLeft } = contentContainer;
246
+ const step = this.calculateMoveStep();
245
247
  requestAnimationFrame(() => {
246
248
  contentContainer.scrollTo({
247
249
  top: 0,
248
- left: contentContainer.scrollLeft + this.calculateMoveStep(),
249
- behavior: "smooth",
250
- });
251
- });
252
- }
253
- showPrev() {
254
- this.moveDirection = "left";
255
- const contentContainer = this.getContentNode();
256
- requestAnimationFrame(() => {
257
- contentContainer.scrollTo({
258
- top: 0,
259
- left: contentContainer.scrollLeft - this.calculateMoveStep(),
250
+ left: action === "right" ? scrollLeft + step : scrollLeft - step,
260
251
  behavior: "smooth",
261
252
  });
262
253
  });
@@ -271,15 +262,6 @@ const VviinnCarousel = class {
271
262
  });
272
263
  });
273
264
  }
274
- processScrollbarWidth() {
275
- const target = this.getContentNode();
276
- if (!target)
277
- return;
278
- const scrollRatio = (target.scrollLeft + target.clientWidth) / target.scrollWidth;
279
- const scrolledWidth = target.clientWidth * scrollRatio;
280
- this.el.style.setProperty("--vviinn-progressbar-width", `${scrolledWidth}px`);
281
- this.activeContentGroup = this.getActiveGroupIndex();
282
- }
283
265
  showBullets() {
284
266
  return this.isGridMode && this.showScroll;
285
267
  }
@@ -332,7 +314,7 @@ const VviinnCarousel = class {
332
314
  }, onClick: () => this.scroll(index) })));
333
315
  }
334
316
  render() {
335
- return (h(Host, { class: this.getClassMap() }, h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, !this.isSetMode && (h("button", { class: "prev", onClick: () => this.showPrev(), part: "carousel-button", disabled: this.gridArrowsDynamic && this.isFirstGroup() }, h(ChevronIcon, null))), this.isSetMode && (h("vviinn-product-card", { part: "product-part", class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: this.sourceProduct.image.thumbnail, price: this.sourceProduct.price.actual, imageRatio: 1, imageWidth: 300, dimmedBackground: true, isSourceProduct: true })), h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }, this.renderRecommendations()), !this.isSetMode && (h("button", { class: "next", onClick: () => this.showNext(), part: "carousel-button", disabled: this.gridArrowsDynamic && this.isLastGroup() }, h(ChevronIcon, null)))), this.showBullets() && (h("div", { class: "bullets" }, this.renderBullets()))));
317
+ return (h(Host, { class: this.getClassMap() }, h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, !this.isSetMode && (h("button", { class: "prev", onClick: () => this.handleCarouselButtonClick("left"), part: "carousel-button", disabled: this.gridArrowsDynamic && this.isFirstGroup() }, h(ChevronIcon, null))), this.isSetMode && (h("vviinn-product-card", { part: "product-part", class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: this.sourceProduct.image.thumbnail, price: this.sourceProduct.price.actual, imageRatio: 1, imageWidth: 300, dimmedBackground: true, isSourceProduct: true })), h("div", { class: this.getContentClassMap() }, this.renderRecommendations()), !this.isSetMode && (h("button", { class: "next", onClick: () => this.handleCarouselButtonClick("right"), part: "carousel-button", disabled: this.gridArrowsDynamic && this.isLastGroup() }, h(ChevronIcon, null)))), this.showBullets() && (h("div", { class: "bullets" }, this.renderBullets()))));
336
318
  }
337
319
  get el() { return getElement(this); }
338
320
  static get watchers() { return {
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-1f3eaf12.js';
2
- import { v as version } from './package-aac1b6b8.js';
2
+ import { v as version } from './package-087515d9.js';
3
3
  import { V as VisualSearchIcon } from './VisualSearchIcon-13f7da6a.js';
4
4
 
5
5
  const vviinnVprButtonCss = ":host{display:block}";
@@ -1,5 +1,5 @@
1
1
  import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-1f3eaf12.js';
2
- import { v as version } from './package-aac1b6b8.js';
2
+ import { v as version } from './package-087515d9.js';
3
3
  import { c as campaignTypeNames, S as SlotSkeleton } from './customized-slots-e56251a2.js';
4
4
  import { D as DEFAULT_EXAMPLE_IMAGE } from './constants-8bf233a9.js';
5
5
 
@@ -1,7 +1,7 @@
1
1
  import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-1f3eaf12.js';
2
2
  import { s as searchState, b as state, k as parseExcluded, O as Option } from './search.store-44630818.js';
3
3
  import { i as instance } from './i18next-387f2b0a.js';
4
- import { v as version } from './package-aac1b6b8.js';
4
+ import { v as version } from './package-087515d9.js';
5
5
  import { c as campaignTypeNames, s as slotChangeListener, S as SlotSkeleton } from './customized-slots-e56251a2.js';
6
6
  import { j as createSearchEvent, k as createFilterEvent, v as v4, c as createTrackingApi, l as createWidgetVpsEvent, m as createProductVpsEventByType, n as createResultVpsEventByType } from './index-76fe67d1.js';
7
7
  import { D as DEFAULT_EXAMPLE_IMAGE } from './constants-8bf233a9.js';
@@ -63,10 +63,8 @@ export declare class VviinnCarousel {
63
63
  private getContent;
64
64
  private getColumnsNumber;
65
65
  private getContentGroups;
66
- private showNext;
67
- private showPrev;
66
+ private handleCarouselButtonClick;
68
67
  private scroll;
69
- private processScrollbarWidth;
70
68
  private showBullets;
71
69
  private showScrollbar;
72
70
  private getClassMap;
@@ -1 +1 @@
1
- import{r as i,c as t,h as s,H as h,g as n}from"./p-1e83e6ba.js";import{v as o}from"./p-4b571be0.js";import{V as e}from"./p-b21ebac9.js";const v=class{constructor(s){i(this,s),this.vviinnWidgetLoad=t(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=t(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=t(this,"vviinnWidgetClose",7),this.vviinnProductLoad=t(this,"vviinnProductLoad",7),this.vviinnProductClick=t(this,"vviinnProductClick",7),this.vviinnProductView=t(this,"vviinnProductView",7),this.vviinnResultLoad=t(this,"vviinnResultLoad",7),this.vviinnResultView=t(this,"vviinnResultView",7),this.vviinnNoResult=t(this,"vviinnNoResult",7),this.vviinnAddToBasket=t(this,"vviinnAddToBasket",7),this.sidebar=null,this.sidebarCloseListener=()=>{document.body.removeChild(this.sidebar)},this.token=void 0,this.productId=void 0,this.position="bottom",this.sourceImage=null,this.sidebarTitle="Visually similar products",this.modalScrollbar=!1,this.campaigns="",this.campaignType="VPR",this.locale="de-DE",this.color="",this.addStyle=!0,this.mode="continuity",this.imageWidth=300,this.currencySign="€",this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.excluded="",this.productDetailNewTab=!1,this.addToBasketShow=!1,this.apiPath="https://api.vviinn.com"}render(){return s(h,{onClick:()=>{this.handleClick()},role:"button",tabindex:"0"},s("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(e,null))))}handleClick(){const i=document.createElement("vviinn-recommendations-sidebar");i.sidebarTitle=this.sidebarTitle,i.productId=this.productId,i.token=this.token,i.position=this.position,i.sourceImage=this.sourceImage,i.widgetScrollbar=this.modalScrollbar,i.campaigns=this.campaigns,i.campaignType=this.campaignType,i.color=this.color,i.locale=this.locale,i.mode="right"===this.position?"grid":this.mode,i.imageWidth=this.imageWidth,i.currencySign=this.currencySign,i.apiPath=this.apiPath,i.buttonElementId=this.el.id,i.noResultText=this.noResultText,i.noResultShow=this.noResultShow,i.gridArrowsDynamic=this.gridArrowsDynamic,i.productDetailNewTab=this.productDetailNewTab,i.widgetVersion=o,i.showingInButton=!0,i.excluded=this.excluded,i.addToBasketShow=this.addToBasketShow,i.buttonChildren=this.el.children,this.sidebar=i,i.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&this.sidebar.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener)}get el(){return n(this)}};v.style=":host{display:block}";export{v as vviinn_vpr_button}
1
+ import{r as i,c as t,h as s,H as h,g as n}from"./p-1e83e6ba.js";import{v as o}from"./p-7a70bfb0.js";import{V as e}from"./p-b21ebac9.js";const v=class{constructor(s){i(this,s),this.vviinnWidgetLoad=t(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=t(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=t(this,"vviinnWidgetClose",7),this.vviinnProductLoad=t(this,"vviinnProductLoad",7),this.vviinnProductClick=t(this,"vviinnProductClick",7),this.vviinnProductView=t(this,"vviinnProductView",7),this.vviinnResultLoad=t(this,"vviinnResultLoad",7),this.vviinnResultView=t(this,"vviinnResultView",7),this.vviinnNoResult=t(this,"vviinnNoResult",7),this.vviinnAddToBasket=t(this,"vviinnAddToBasket",7),this.sidebar=null,this.sidebarCloseListener=()=>{document.body.removeChild(this.sidebar)},this.token=void 0,this.productId=void 0,this.position="bottom",this.sourceImage=null,this.sidebarTitle="Visually similar products",this.modalScrollbar=!1,this.campaigns="",this.campaignType="VPR",this.locale="de-DE",this.color="",this.addStyle=!0,this.mode="continuity",this.imageWidth=300,this.currencySign="€",this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.excluded="",this.productDetailNewTab=!1,this.addToBasketShow=!1,this.apiPath="https://api.vviinn.com"}render(){return s(h,{onClick:()=>{this.handleClick()},role:"button",tabindex:"0"},s("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(e,null))))}handleClick(){const i=document.createElement("vviinn-recommendations-sidebar");i.sidebarTitle=this.sidebarTitle,i.productId=this.productId,i.token=this.token,i.position=this.position,i.sourceImage=this.sourceImage,i.widgetScrollbar=this.modalScrollbar,i.campaigns=this.campaigns,i.campaignType=this.campaignType,i.color=this.color,i.locale=this.locale,i.mode="right"===this.position?"grid":this.mode,i.imageWidth=this.imageWidth,i.currencySign=this.currencySign,i.apiPath=this.apiPath,i.buttonElementId=this.el.id,i.noResultText=this.noResultText,i.noResultShow=this.noResultShow,i.gridArrowsDynamic=this.gridArrowsDynamic,i.productDetailNewTab=this.productDetailNewTab,i.widgetVersion=o,i.showingInButton=!0,i.excluded=this.excluded,i.addToBasketShow=this.addToBasketShow,i.buttonChildren=this.el.children,this.sidebar=i,i.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&this.sidebar.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener)}get el(){return n(this)}};v.style=":host{display:block}";export{v as vviinn_vpr_button}
@@ -0,0 +1 @@
1
+ const o="2.49.3";export{o as v}
@@ -1 +1 @@
1
- import{h as t,r as i,c as e,H as s,g as a}from"./p-1e83e6ba.js";import{s as n,b as r,k as o,O as h}from"./p-1c1be428.js";import{i as l}from"./p-2e76a5c3.js";import{v as d}from"./p-4b571be0.js";import{c,s as p,S as u}from"./p-49417192.js";import{j as g,k as v,v as m,c as b,l as x,m as f,n as y}from"./p-dbcc6488.js";import{D as w}from"./p-cc013cd2.js";const k=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M12 17.5C13.25 17.5 14.3125 17.0625 15.1875 16.1875C16.0625 15.3125 16.5 14.25 16.5 13C16.5 11.75 16.0625 10.6875 15.1875 9.8125C14.3125 8.9375 13.25 8.5 12 8.5C10.75 8.5 9.6875 8.9375 8.8125 9.8125C7.9375 10.6875 7.5 11.75 7.5 13C7.5 14.25 7.9375 15.3125 8.8125 16.1875C9.6875 17.0625 10.75 17.5 12 17.5ZM12 15.5C11.3 15.5 10.7083 15.2583 10.225 14.775C9.74167 14.2917 9.5 13.7 9.5 13C9.5 12.3 9.74167 11.7083 10.225 11.225C10.7083 10.7417 11.3 10.5 12 10.5C12.7 10.5 13.2917 10.7417 13.775 11.225C14.2583 11.7083 14.5 12.3 14.5 13C14.5 13.7 14.2583 14.2917 13.775 14.775C13.2917 15.2583 12.7 15.5 12 15.5ZM4 21C3.45 21 2.97917 20.8042 2.5875 20.4125C2.19583 20.0208 2 19.55 2 19V7C2 6.45 2.19583 5.97917 2.5875 5.5875C2.97917 5.19583 3.45 5 4 5H7.15L8.4 3.65C8.58333 3.45 8.80417 3.29167 9.0625 3.175C9.32083 3.05833 9.59167 3 9.875 3H14.125C14.4083 3 14.6792 3.05833 14.9375 3.175C15.1958 3.29167 15.4167 3.45 15.6 3.65L16.85 5H20C20.55 5 21.0208 5.19583 21.4125 5.5875C21.8042 5.97917 22 6.45 22 7V19C22 19.55 21.8042 20.0208 21.4125 20.4125C21.0208 20.8042 20.55 21 20 21H4Z",fill:"currentColor"})),C=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M4.5 21C4.1 21 3.75 20.85 3.45 20.55C3.15 20.25 3 19.9 3 19.5V4.5C3 4.1 3.15 3.75 3.45 3.45C3.75 3.15 4.1 3 4.5 3H19.5C19.9 3 20.25 3.15 20.55 3.45C20.85 3.75 21 4.1 21 4.5V19.5C21 19.9 20.85 20.25 20.55 20.55C20.25 20.85 19.9 21 19.5 21H4.5ZM6.65 17.075H17.375C17.525 17.075 17.6333 17.0083 17.7 16.875C17.7667 16.7417 17.7583 16.6083 17.675 16.475L14.75 12.575C14.6667 12.475 14.5667 12.425 14.45 12.425C14.3333 12.425 14.2333 12.475 14.15 12.575L11.15 16.45L9.125 13.675C9.04167 13.575 8.94167 13.525 8.825 13.525C8.70833 13.525 8.60833 13.575 8.525 13.675L6.375 16.475C6.275 16.6083 6.25833 16.7417 6.325 16.875C6.39167 17.0083 6.5 17.075 6.65 17.075Z",fill:"currentColor"})),B={de:{translation:{exampleImagesTitle:"Mit den Beispielbildern die Suche direkt ausprobieren",imageUploadButtonText:"Bild hochladen",cameraButtonTextStart:"Kamera starten",cameraButtonTextStop:"Kamera stoppen",privacyBadgeText:"Durch das Hochladen eines Bildes willigst Du in die Verarbeitung durch unseren Partner Vviinn ein. Das Bild wird nach einer Stunde Inaktivität gelöscht.",teaserText:"Finde Produkte auf \n einem Foto",imageSearchModalTitle:"Bildsuche",textSearchPlaceholder:"mit Text suchen",emptyResultsBlock:{title:"Leider nichts gefunden",button:"Neues Bild hochladen"},serverErrorBlock:{title:"Keine Verbindung",button:"Erneut versuchen"},wrongFormatBlock:{title:"Dateityp wird nicht unterstützt",text:"Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch.",button:"Neues Bild hochladen"},wrongAspectRatioBlock:{title:"Das Bild ist zu schmal",button:"Neues Bild hochladen"}}},en:{translation:{exampleImagesTitle:"Try out the search with the example images",imageUploadButtonText:"Upload Photo",cameraButtonTextStart:"Start Camera",cameraButtonTextStop:"Stop Camera",privacyBadgeText:"By uploading a picture you agree to the processing by our partner Vviinn. The image will be deleted after one hour of inactivity.",teaserText:"Find Product by Photo",imageSearchModalTitle:"Visual Search",textSearchPlaceholder:"Search by text",emptyResultsBlock:{title:"Sorry, nothing found",button:"Upload another image"},serverErrorBlock:{title:"Something went wrong",button:"Try again"},wrongFormatBlock:{title:"Wrong file format",text:"Please upload a .jpg, .png or .webp image file.",button:"Upload another file"},wrongAspectRatioBlock:{title:"The image is too narrow",button:"Upload another image"}}}},T={facingMode:"environment",width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}};var S=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(s=Object.getOwnPropertySymbols(t);a<s.length;a++)i.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(e[s[a]]=t[s[a]])}return e};const j=class{constructor(t){i(this,t),this.globalSlotsChanged=e(this,"globalSlotsChanged",7),this.vviinnWidgetLoad=e(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=e(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=e(this,"vviinnWidgetClose",7),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnProductLoad=e(this,"vviinnProductLoad",7),this.vviinnProductView=e(this,"vviinnProductView",7),this.vviinnProductClick=e(this,"vviinnProductClick",7),this.vviinnResultLoad=e(this,"vviinnResultLoad",7),this.vviinnResultView=e(this,"vviinnResultView",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnImageCrop=e(this,"vviinnImageCrop",7),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.vviinnSelectFilter=e(this,"vviinnSelectFilter",7),this.imageSource=null,this.resultLoaded=!1,this.resultViewed=!1,this.cameraAvailable=!1,this.isDesktop=!1,this.videoTrack=null,this.handleVviinnImageUpload=t=>{this.trackInitialSearch(),this.uploadSource=t},this.handleVviinnImageUploadFinished=()=>{this.handleImageSelection(),"upload"===this.mode&&this.showingInButton&&(this.active=!0)},this.handleVviinnNoResult=t=>{"client"===t.reason&&(this.wrongImageFormat=!0)},this.adjustCameraSettings=async()=>{if(!this.videoTrack)return;const t=this.videoTrack.getCapabilities();if("focusMode"in t)try{await this.videoTrack.applyConstraints({advanced:[{focusMode:"continuous"}]})}catch(t){console.error("Failed to apply focus mode constraints",t)}if("focusMode"in t)try{await this.videoTrack.applyConstraints({advanced:[{exposureMode:"continuous"}]})}catch(t){console.error("Failed to apply exposure mode constraints",t)}if("whiteBalanceMode"in t)try{await this.videoTrack.applyConstraints({advanced:[{whiteBalanceMode:"continuous"}]})}catch(t){console.error("Failed to apply white balance mode constraints",t)}},this.handleStartCameraClick=async()=>{this.stream?this.resetState():(this.cameraInitializing=!0,setTimeout((async()=>{this.cameraButtonClicked=!0;try{const t=await navigator.mediaDevices.getUserMedia({video:T});this.videoTrack=t.getVideoTracks()[0],this.adjustCameraSettings(),this.stream=t,this.uploadSource="startCamera"}catch(t){console.log("Error accessing camera: ",t.message),this.resetState(),this.cameraInitializing=!1}}),500))},this.setShowAspectRatioError=t=>{this.showAspectRatioError=t},this.setTrackingDeactivated=t=>{"rejected"===t.status&&(this.trackingDeactivated=!0)},this.getBasicEventData=()=>{var t;return{widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:c.VPS,widgetId:null!==(t=this.buttonElementId)&&void 0!==t?t:this.id,widgetVersion:d}},this.token=void 0,this.active=!0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.excluded="",this.productDetailNewTab=!0,this.imageResolutionWidth=250,this.exampleImageSource=w,this.textSearchShow=!1,this.apiPath="https://api.vviinn.com",this.showingInButton=!1,this.buttonElementId=void 0,this.buttonPressed=void 0,this.mode="modal",this.resetVpsButton=void 0,this.slidePosition=0,this.width=0,this.wrongImageFormat=!1,this.trackingDeactivated=!1,this.stream=null,this.cameraInitializing=!1,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.uploadSource=void 0,this.showAspectRatioError=!1,this.products=[],this.initialSearchQuery=""}initResultEvents(){this.resultLoaded=!1,this.resultViewed=!1}stopStreamTracks(){var t;null===(t=this.stream)||void 0===t||t.getTracks().forEach((t=>{t.stop()}))}isOnboardingSlide(){return 0===this.slidePosition}isResultSlide(){return 1===this.slidePosition}findProductById(t){return n.results.find((i=>i.productId===t))}handleOpenLink(t,i){if(this.productDetailNewTab||i.ctrlKey||i.metaKey){let i=window.open();i?i.location.href=t:window.location.href=t}else window.location.href=t}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit(Array.from(t))}activeWatcher(t){t?(this.overflow=document.body.style.overflow,document.body.style.overflow="hidden",this.vviinnWidgetOpen.emit(this.getBasicEventData()),"camera"===this.mode&&this.handleStartCameraClick(),this.trackWidgetEvent("open")):(document.body.style.overflow=this.overflow,this.initResultEvents())}trackCameraEnabled({detail:t}){this.cameraEnabled=t,this.cameraInitializing=!1}trackProductLoad({detail:t}){const i=this.getProductTrackEvent(t,"load");i&&this.trackingApi.trackEvent(i).then(this.setTrackingDeactivated)}trackProductView({detail:t}){this.resultViewed||(this.resultViewed=!0,this.vviinnResultView.emit(this.getBasicEventData()),this.trackResultEvent("view"));const i=this.getProductTrackEvent(t,"view");i&&this.trackingApi.trackEvent(i).then(this.setTrackingDeactivated)}async trackProductClick({detail:t}){const{productId:i,clickEvent:e}=t,s=this.getProductTrackEvent(t,"click"),a=this.findProductById(i);a&&a.deeplink&&(this.trackingDeactivated?this.handleOpenLink(a.deeplink,e):await this.trackingApi.trackEvent(s).then(this.setTrackingDeactivated).finally((()=>{this.handleOpenLink(a.deeplink,e)})))}async trackAuxClick({detail:t}){const{productId:i}=t,e=this.getProductTrackEvent(t,"click"),s=this.findProductById(i);s&&s.deeplink&&(this.trackingDeactivated||await this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated))}trachSearchAreaChanges(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=S(t,["campaignTypeId"]),e=g(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"manual-selection"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackDetectedObject(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=S(t,["campaignTypeId"]),e=g(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"attention-point"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackFilter({detail:t}){if(this.initResultEvents(),this.trackingDeactivated)return;const i=this.getBasicEventData(),e=S(i,["campaignTypeId"]),s=v(Object.assign({session_id:this.uiSessionId,source:this.imageSource,kind:t.kind,action:t.action},e));this.trackingApi.trackEvent(s).then(this.setTrackingDeactivated)}async trackTextSearchFinished({detail:t}){this.initialSearchQuery=t,this.slidePosition=1}connectedCallback(){this.isDesktop="desktop"===(()=>{const t=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"})(),r.apiPath=this.apiPath,r.currencySign=this.currencySign,r.locale=this.locale,this.cameraAvailable=!!navigator.mediaDevices&&!!navigator.mediaDevices.getUserMedia,this.excluded&&(this.excluded=o(this.excluded)),n.token=this.token,n.campaignId=this.campaignId,n.excluded=this.excluded,this.uiSessionId=m(),this.trackingApi=b(this.apiPath,this.token),this.id=this.el.id}async componentWillLoad(){await l.init({lng:this.locale,fallbackLng:"en",resources:B}),p(this,this.el),this.vviinnWidgetLoad.emit(this.getBasicEventData()),this.trackWidgetEvent("load")}trackWidgetEvent(t){if(this.trackingDeactivated)return;const i=this.getBasicEventData(),e=S(i,["campaignTypeId","widgetType"]),s=Object.assign({action:t,session_id:this.uiSessionId},e),a=x(s);this.trackingApi.trackEvent(a).then(this.setTrackingDeactivated)}getProductTrackEvent(t,i){if(this.trackingDeactivated)return null;const{productRank:e,productId:s}=t,a=S(t,["productRank","productId","campaignTypeId","widgetType","clickEvent"]),n=Object.assign({session_id:this.uiSessionId,rank:e,product:s},a);return f(i)(n)}trackResultEvent(t){if(this.trackingDeactivated)return;const i=this.getBasicEventData(),e=S(i,["campaignTypeId","widgetType"]);let s=y(t)(Object.assign({session_id:this.uiSessionId},e));this.trackingApi.trackEvent(s).then(this.setTrackingDeactivated)}trackInitialSearch(){if(this.trackingDeactivated)return;const t=this.getBasicEventData(),i=S(t,["campaignTypeId","widgetType"]),e=g(Object.assign({session_id:this.uiSessionId,search_area:"full",source:"upload"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}handleImageSelection(){this.imageSource="upload",this.slidePosition=1,this.el.shadowRoot.querySelector("vviinn-overlayed-modal").shadowRoot.querySelector("vviinn-overlay").querySelector("vviinn-modal").shadowRoot.querySelector(".body").scrollTop=0,this.stopStreamTracks()}renderButtons(){const i=[this.cameraAvailable&&t("button",{class:"action-button",part:"start-camera_button",onClick:()=>{this.handleStartCameraClick()}},n.loading&&"image"===n.searchType&&"startCamera"===this.uploadSource||this.cameraInitializing?t("vviinn-preloader",null):t("span",{class:"action-button-content"},t("slot",{name:"vviinn-camera-icon"},t(k,null)),this.cameraEnabled?t("slot",{name:"vviinn-camera-button-text-stop"},t("span",null,l.t("cameraButtonTextStop"))):t("slot",{name:"vviinn-camera-button-text-start"},t("span",null,l.t("cameraButtonTextStart"))))),t("vviinn-image-selector",{class:"action-button",onClick:()=>this.uploadSource="uploadPhoto",onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("uploadPhoto")},onVviinnNoResult:({detail:t})=>this.handleVviinnNoResult(t),resetVpsButton:this.resetVpsButton,basicEventData:this.getBasicEventData(),part:"upload-photo_button",startUpload:this.buttonPressed&&this.showingInButton&&"upload"===this.mode,loading:n.loading&&"image"===n.searchType&&"uploadPhoto"===this.uploadSource},t("span",{slot:"upload-button-text",class:"action-button-content"},t("slot",{name:"vviinn-image-upload-icon"},t(C,null)),t("slot",{name:"vviinn-image-upload-button-text"},t("span",null,l.t("imageUploadButtonText")))))];return this.isDesktop?i.reverse():i}renderResults(){return 0!==n.results.length&&this.isResultSlide()?(this.resultLoaded||(this.vviinnResultLoad.emit(this.getBasicEventData()),this.trackResultEvent("load"),this.resultLoaded=!0),n.results.map(((i,e)=>{var s;return t("vviinn-product-card",{key:i.productId,hidden:!0,productTitle:i.title,productId:i.productId,productType:i.productType,brand:i.brand,deeplink:i.deeplink,price:i.price.actual,salePrice:i.price.sale,responsive:!0,imageWidth:this.imageResolutionWidth,image:null!==(s=i.image.thumbnail)&&void 0!==s?s:i.image.original,part:"product-card",campaignTypeId:"VPS",index:e,widgetElementId:this.id,buttonElementId:this.buttonElementId,widgetVersion:d})}))):null}resetState(){this.resetScroll("start-page_block"),this.slidePosition=0,n.resetCategoryLink=void 0,n.activeIonLink=void 0,n.image=h.none,n.imageUrl=h.none,n.imageBounds=h.none,n.searchArea=h.none,n.results=[],n.filters=[],n.detectedObjects=[],n.rectangleSearchForm=void 0,n.loading=!1,n.serverError=!1,n.searchType=void 0,this.wrongImageFormat=!1,this.resetScroll("results-block"),this.stopStreamTracks(),this.initResultEvents(),this.stream=null,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.cameraInitializing=!1,this.setShowAspectRatioError(!1)}haveErrors(){return this.wrongImageFormat||n.serverError}resetScroll(t,i="auto"){this.el.shadowRoot.getElementById(t).scroll({top:0,left:0,behavior:i})}handleModalClose(){this.active=!1,this.resetState(),["start-page_block","results-block"].forEach((t=>this.resetScroll(t))),this.trackWidgetEvent("close")}render(){var i;return t(s,{exportparts:"text-search-input"},!this.showingInButton&&t(u,null),t("vviinn-overlayed-modal",{class:{"first-screen":this.isOnboardingSlide()},isFirstScreen:this.isOnboardingSlide(),active:this.active,resetState:this.resetState.bind(this),onVviinnWidgetClose:()=>this.handleModalClose(),buttonElementId:null!==(i=this.buttonElementId)&&void 0!==i?i:this.id,widgetVersion:d,hideBackButton:"upload"===this.mode&&this.showingInButton||!this.cameraEnabled&&this.isOnboardingSlide(),exportparts:"secondary-action, title, close-button"},t("vviinn-slider",{showBullets:!1,position:this.slidePosition},t("vviinn-slide",{class:{"start-page":!0,"camera-enabled":this.cameraEnabled}},t("vviinn-example-image",{onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("startCamera")},basicEventData:this.getBasicEventData(),srcObject:this.stream,cameraButtonClicked:this.cameraButtonClicked,exampleImageSource:this.exampleImageSource}),t("div",{class:{error:this.haveErrors()},id:"start-page_block"},t("div",{class:"start-page_main-content"},t("div",{class:{"start-page_errors-block":!0,hidden:!this.wrongImageFormat&&!n.serverError}},t("vviinn-wrong-format",{class:{hidden:!this.wrongImageFormat},handler:()=>this.resetState()}),t("vviinn-server-error",{class:{hidden:!n.serverError},handler:()=>this.resetState()})),!this.haveErrors()&&t("vviinn-teaser",null),!this.haveErrors()&&t("div",{class:"buttons-group"},this.renderButtons()),this.textSearchShow&&!this.haveErrors()&&t("vviinn-text-search",{clearSearchQuery:!0})),t("vviinn-privacy-badge",{privacyBadgeText:l.t("privacyBadgeText"),class:{invisible:this.haveErrors()}}))),t("vviinn-slide",{class:{"results-page":!0,active:this.isResultSlide()}},this.isResultSlide()&&"image"===n.searchType&&t("div",{class:"image-wrapper"},t("vviinn-image-view",{basicEventData:this.getBasicEventData(),setShowAspectRatioError:this.setShowAspectRatioError,showAspectRatioError:this.showAspectRatioError}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"filters"},n.filters.map((i=>t("search-filters",{filter:i,basicEventData:this.getBasicEventData()})))))),this.textSearchShow&&this.isResultSlide()&&"text"===n.searchType&&t("div",{class:"text-search-wrapper"},t("vviinn-text-search",{initialSearchQuery:this.initialSearchQuery})),t("div",{id:"results-block",class:"products-wrapper"},t("div",{class:{"nothing-found":!0,hidden:n.results.length>0}},t("vviinn-empty-results",{handler:()=>this.resetState()})),t("div",{class:{"nothing-found":!0,hidden:!this.showAspectRatioError}},t("vviinn-wrong-aspect-ratio",{handler:()=>this.resetState()})),t("div",{class:{hidden:0===n.results.length||this.showAspectRatioError,products:!0}},this.renderResults()))))))}get el(){return a(this)}static get watchers(){return{active:["activeWatcher"]}}};j.style=":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);height:640px}#start-page_block{box-sizing:border-box;display:flex;overflow-y:auto;flex-direction:column;justify-content:center;padding:42px 62px}#start-page_block.error{align-content:center}.start-page_main-content{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.start-page_errors-block{display:flex;flex-direction:column;justify-content:center;gap:12px}#start-page_block vviinn-text-search{margin-top:12px}.buttons-group{display:flex;flex-direction:column;gap:12px;margin-top:24px}.action-button{font-family:inherit;display:grid;border:none;cursor:pointer;align-items:center;border-radius:8px;font-size:16px;height:48px;justify-items:center;transition:background 0.1s ease-in-out;color:#525252;background-color:#f4f4f4}.action-button:hover{background-color:#eaeaea}.action-button:first-child{background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));color:white}.action-button:first-child:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}.action-button:active{border-color:black}.action-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:max-content auto;grid-gap:8px}.results-page{margin-top:64px;display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.results-page .text-search-wrapper{width:100%;padding:24px}.products{width:100%;align-content:center;align-items:start;box-sizing:border-box;display:grid;grid-gap:32px 16px;grid-template-columns:repeat(auto-fill, minmax(130px, 1fr));justify-items:center;padding:24px;position:absolute}.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{display:grid;grid-template-rows:min-content 1fr;min-width:100%}.filters-wrapper{margin-top:24px;overflow-x:auto;transform:translateX(-24px);min-width:calc(100% + 48px)}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:8px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:400;line-height:20px}search-filters::part(show-more-filters){display:flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid #f4f4f4;min-width:40px;height:40px;border-radius:100px;box-sizing:border-box;color:#161616}search-filters::part(show-more-filters):hover{background:#eaeaea}search-filters::part(filter active){background:var(--color-primary, var(--color-primary-system));color:white}.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%}vviinn-preloader{--preloader-size:24px;display:flex}@media (max-width: 1080px){#start-page_block{padding:24px 36px}}@media (max-width: 768px){.start-page{display:flex;flex-direction:column;height:100%}vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:visible}.start-page.active{height:calc(100vh - 64px);height:calc(100svh - 64px)}.start-page:not(.active){overflow:hidden}.results-page{margin-top:0}.results-page>*{box-sizing:border-box;padding:12px 24px 24px}.image-wrapper{padding:0}.filters-wrapper{padding-left:24px;min-width:calc(100% + 40px)}.results-page{grid-template-rows:min-content;grid-template-columns:unset}#start-page_block{overflow-y:unset;min-height:-moz-fit-content;min-height:fit-content;padding:24px 20px}.image{margin-bottom:8px}.image-wrapper{grid-template-rows:min-content auto;width:100%}.products-wrapper{align-content:start;position:static;overflow-y:unset;width:100%;padding-top:0;margin-top:24px}.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: 480px){.start-page{padding-top:0}.action-button-content{grid-gap:10px}}@media (max-width: 380px){.filters-wrapper{padding-left:24px}.products{grid-gap:24px 10px}}vviinn-wrong-format,vviinn-server-error{width:280px;align-self:center;justify-self:center}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}";export{j as vviinn_vps_widget}
1
+ import{h as t,r as i,c as e,H as s,g as a}from"./p-1e83e6ba.js";import{s as n,b as r,k as o,O as h}from"./p-1c1be428.js";import{i as l}from"./p-2e76a5c3.js";import{v as d}from"./p-7a70bfb0.js";import{c,s as p,S as u}from"./p-49417192.js";import{j as g,k as v,v as m,c as b,l as x,m as f,n as y}from"./p-dbcc6488.js";import{D as w}from"./p-cc013cd2.js";const k=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M12 17.5C13.25 17.5 14.3125 17.0625 15.1875 16.1875C16.0625 15.3125 16.5 14.25 16.5 13C16.5 11.75 16.0625 10.6875 15.1875 9.8125C14.3125 8.9375 13.25 8.5 12 8.5C10.75 8.5 9.6875 8.9375 8.8125 9.8125C7.9375 10.6875 7.5 11.75 7.5 13C7.5 14.25 7.9375 15.3125 8.8125 16.1875C9.6875 17.0625 10.75 17.5 12 17.5ZM12 15.5C11.3 15.5 10.7083 15.2583 10.225 14.775C9.74167 14.2917 9.5 13.7 9.5 13C9.5 12.3 9.74167 11.7083 10.225 11.225C10.7083 10.7417 11.3 10.5 12 10.5C12.7 10.5 13.2917 10.7417 13.775 11.225C14.2583 11.7083 14.5 12.3 14.5 13C14.5 13.7 14.2583 14.2917 13.775 14.775C13.2917 15.2583 12.7 15.5 12 15.5ZM4 21C3.45 21 2.97917 20.8042 2.5875 20.4125C2.19583 20.0208 2 19.55 2 19V7C2 6.45 2.19583 5.97917 2.5875 5.5875C2.97917 5.19583 3.45 5 4 5H7.15L8.4 3.65C8.58333 3.45 8.80417 3.29167 9.0625 3.175C9.32083 3.05833 9.59167 3 9.875 3H14.125C14.4083 3 14.6792 3.05833 14.9375 3.175C15.1958 3.29167 15.4167 3.45 15.6 3.65L16.85 5H20C20.55 5 21.0208 5.19583 21.4125 5.5875C21.8042 5.97917 22 6.45 22 7V19C22 19.55 21.8042 20.0208 21.4125 20.4125C21.0208 20.8042 20.55 21 20 21H4Z",fill:"currentColor"})),C=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M4.5 21C4.1 21 3.75 20.85 3.45 20.55C3.15 20.25 3 19.9 3 19.5V4.5C3 4.1 3.15 3.75 3.45 3.45C3.75 3.15 4.1 3 4.5 3H19.5C19.9 3 20.25 3.15 20.55 3.45C20.85 3.75 21 4.1 21 4.5V19.5C21 19.9 20.85 20.25 20.55 20.55C20.25 20.85 19.9 21 19.5 21H4.5ZM6.65 17.075H17.375C17.525 17.075 17.6333 17.0083 17.7 16.875C17.7667 16.7417 17.7583 16.6083 17.675 16.475L14.75 12.575C14.6667 12.475 14.5667 12.425 14.45 12.425C14.3333 12.425 14.2333 12.475 14.15 12.575L11.15 16.45L9.125 13.675C9.04167 13.575 8.94167 13.525 8.825 13.525C8.70833 13.525 8.60833 13.575 8.525 13.675L6.375 16.475C6.275 16.6083 6.25833 16.7417 6.325 16.875C6.39167 17.0083 6.5 17.075 6.65 17.075Z",fill:"currentColor"})),B={de:{translation:{exampleImagesTitle:"Mit den Beispielbildern die Suche direkt ausprobieren",imageUploadButtonText:"Bild hochladen",cameraButtonTextStart:"Kamera starten",cameraButtonTextStop:"Kamera stoppen",privacyBadgeText:"Durch das Hochladen eines Bildes willigst Du in die Verarbeitung durch unseren Partner Vviinn ein. Das Bild wird nach einer Stunde Inaktivität gelöscht.",teaserText:"Finde Produkte auf \n einem Foto",imageSearchModalTitle:"Bildsuche",textSearchPlaceholder:"mit Text suchen",emptyResultsBlock:{title:"Leider nichts gefunden",button:"Neues Bild hochladen"},serverErrorBlock:{title:"Keine Verbindung",button:"Erneut versuchen"},wrongFormatBlock:{title:"Dateityp wird nicht unterstützt",text:"Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch.",button:"Neues Bild hochladen"},wrongAspectRatioBlock:{title:"Das Bild ist zu schmal",button:"Neues Bild hochladen"}}},en:{translation:{exampleImagesTitle:"Try out the search with the example images",imageUploadButtonText:"Upload Photo",cameraButtonTextStart:"Start Camera",cameraButtonTextStop:"Stop Camera",privacyBadgeText:"By uploading a picture you agree to the processing by our partner Vviinn. The image will be deleted after one hour of inactivity.",teaserText:"Find Product by Photo",imageSearchModalTitle:"Visual Search",textSearchPlaceholder:"Search by text",emptyResultsBlock:{title:"Sorry, nothing found",button:"Upload another image"},serverErrorBlock:{title:"Something went wrong",button:"Try again"},wrongFormatBlock:{title:"Wrong file format",text:"Please upload a .jpg, .png or .webp image file.",button:"Upload another file"},wrongAspectRatioBlock:{title:"The image is too narrow",button:"Upload another image"}}}},T={facingMode:"environment",width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}};var S=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(s=Object.getOwnPropertySymbols(t);a<s.length;a++)i.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(e[s[a]]=t[s[a]])}return e};const j=class{constructor(t){i(this,t),this.globalSlotsChanged=e(this,"globalSlotsChanged",7),this.vviinnWidgetLoad=e(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=e(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=e(this,"vviinnWidgetClose",7),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnProductLoad=e(this,"vviinnProductLoad",7),this.vviinnProductView=e(this,"vviinnProductView",7),this.vviinnProductClick=e(this,"vviinnProductClick",7),this.vviinnResultLoad=e(this,"vviinnResultLoad",7),this.vviinnResultView=e(this,"vviinnResultView",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnImageCrop=e(this,"vviinnImageCrop",7),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.vviinnSelectFilter=e(this,"vviinnSelectFilter",7),this.imageSource=null,this.resultLoaded=!1,this.resultViewed=!1,this.cameraAvailable=!1,this.isDesktop=!1,this.videoTrack=null,this.handleVviinnImageUpload=t=>{this.trackInitialSearch(),this.uploadSource=t},this.handleVviinnImageUploadFinished=()=>{this.handleImageSelection(),"upload"===this.mode&&this.showingInButton&&(this.active=!0)},this.handleVviinnNoResult=t=>{"client"===t.reason&&(this.wrongImageFormat=!0)},this.adjustCameraSettings=async()=>{if(!this.videoTrack)return;const t=this.videoTrack.getCapabilities();if("focusMode"in t)try{await this.videoTrack.applyConstraints({advanced:[{focusMode:"continuous"}]})}catch(t){console.error("Failed to apply focus mode constraints",t)}if("focusMode"in t)try{await this.videoTrack.applyConstraints({advanced:[{exposureMode:"continuous"}]})}catch(t){console.error("Failed to apply exposure mode constraints",t)}if("whiteBalanceMode"in t)try{await this.videoTrack.applyConstraints({advanced:[{whiteBalanceMode:"continuous"}]})}catch(t){console.error("Failed to apply white balance mode constraints",t)}},this.handleStartCameraClick=async()=>{this.stream?this.resetState():(this.cameraInitializing=!0,setTimeout((async()=>{this.cameraButtonClicked=!0;try{const t=await navigator.mediaDevices.getUserMedia({video:T});this.videoTrack=t.getVideoTracks()[0],this.adjustCameraSettings(),this.stream=t,this.uploadSource="startCamera"}catch(t){console.log("Error accessing camera: ",t.message),this.resetState(),this.cameraInitializing=!1}}),500))},this.setShowAspectRatioError=t=>{this.showAspectRatioError=t},this.setTrackingDeactivated=t=>{"rejected"===t.status&&(this.trackingDeactivated=!0)},this.getBasicEventData=()=>{var t;return{widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:c.VPS,widgetId:null!==(t=this.buttonElementId)&&void 0!==t?t:this.id,widgetVersion:d}},this.token=void 0,this.active=!0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.excluded="",this.productDetailNewTab=!0,this.imageResolutionWidth=250,this.exampleImageSource=w,this.textSearchShow=!1,this.apiPath="https://api.vviinn.com",this.showingInButton=!1,this.buttonElementId=void 0,this.buttonPressed=void 0,this.mode="modal",this.resetVpsButton=void 0,this.slidePosition=0,this.width=0,this.wrongImageFormat=!1,this.trackingDeactivated=!1,this.stream=null,this.cameraInitializing=!1,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.uploadSource=void 0,this.showAspectRatioError=!1,this.products=[],this.initialSearchQuery=""}initResultEvents(){this.resultLoaded=!1,this.resultViewed=!1}stopStreamTracks(){var t;null===(t=this.stream)||void 0===t||t.getTracks().forEach((t=>{t.stop()}))}isOnboardingSlide(){return 0===this.slidePosition}isResultSlide(){return 1===this.slidePosition}findProductById(t){return n.results.find((i=>i.productId===t))}handleOpenLink(t,i){if(this.productDetailNewTab||i.ctrlKey||i.metaKey){let i=window.open();i?i.location.href=t:window.location.href=t}else window.location.href=t}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit(Array.from(t))}activeWatcher(t){t?(this.overflow=document.body.style.overflow,document.body.style.overflow="hidden",this.vviinnWidgetOpen.emit(this.getBasicEventData()),"camera"===this.mode&&this.handleStartCameraClick(),this.trackWidgetEvent("open")):(document.body.style.overflow=this.overflow,this.initResultEvents())}trackCameraEnabled({detail:t}){this.cameraEnabled=t,this.cameraInitializing=!1}trackProductLoad({detail:t}){const i=this.getProductTrackEvent(t,"load");i&&this.trackingApi.trackEvent(i).then(this.setTrackingDeactivated)}trackProductView({detail:t}){this.resultViewed||(this.resultViewed=!0,this.vviinnResultView.emit(this.getBasicEventData()),this.trackResultEvent("view"));const i=this.getProductTrackEvent(t,"view");i&&this.trackingApi.trackEvent(i).then(this.setTrackingDeactivated)}async trackProductClick({detail:t}){const{productId:i,clickEvent:e}=t,s=this.getProductTrackEvent(t,"click"),a=this.findProductById(i);a&&a.deeplink&&(this.trackingDeactivated?this.handleOpenLink(a.deeplink,e):await this.trackingApi.trackEvent(s).then(this.setTrackingDeactivated).finally((()=>{this.handleOpenLink(a.deeplink,e)})))}async trackAuxClick({detail:t}){const{productId:i}=t,e=this.getProductTrackEvent(t,"click"),s=this.findProductById(i);s&&s.deeplink&&(this.trackingDeactivated||await this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated))}trachSearchAreaChanges(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=S(t,["campaignTypeId"]),e=g(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"manual-selection"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackDetectedObject(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=S(t,["campaignTypeId"]),e=g(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"attention-point"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackFilter({detail:t}){if(this.initResultEvents(),this.trackingDeactivated)return;const i=this.getBasicEventData(),e=S(i,["campaignTypeId"]),s=v(Object.assign({session_id:this.uiSessionId,source:this.imageSource,kind:t.kind,action:t.action},e));this.trackingApi.trackEvent(s).then(this.setTrackingDeactivated)}async trackTextSearchFinished({detail:t}){this.initialSearchQuery=t,this.slidePosition=1}connectedCallback(){this.isDesktop="desktop"===(()=>{const t=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"})(),r.apiPath=this.apiPath,r.currencySign=this.currencySign,r.locale=this.locale,this.cameraAvailable=!!navigator.mediaDevices&&!!navigator.mediaDevices.getUserMedia,this.excluded&&(this.excluded=o(this.excluded)),n.token=this.token,n.campaignId=this.campaignId,n.excluded=this.excluded,this.uiSessionId=m(),this.trackingApi=b(this.apiPath,this.token),this.id=this.el.id}async componentWillLoad(){await l.init({lng:this.locale,fallbackLng:"en",resources:B}),p(this,this.el),this.vviinnWidgetLoad.emit(this.getBasicEventData()),this.trackWidgetEvent("load")}trackWidgetEvent(t){if(this.trackingDeactivated)return;const i=this.getBasicEventData(),e=S(i,["campaignTypeId","widgetType"]),s=Object.assign({action:t,session_id:this.uiSessionId},e),a=x(s);this.trackingApi.trackEvent(a).then(this.setTrackingDeactivated)}getProductTrackEvent(t,i){if(this.trackingDeactivated)return null;const{productRank:e,productId:s}=t,a=S(t,["productRank","productId","campaignTypeId","widgetType","clickEvent"]),n=Object.assign({session_id:this.uiSessionId,rank:e,product:s},a);return f(i)(n)}trackResultEvent(t){if(this.trackingDeactivated)return;const i=this.getBasicEventData(),e=S(i,["campaignTypeId","widgetType"]);let s=y(t)(Object.assign({session_id:this.uiSessionId},e));this.trackingApi.trackEvent(s).then(this.setTrackingDeactivated)}trackInitialSearch(){if(this.trackingDeactivated)return;const t=this.getBasicEventData(),i=S(t,["campaignTypeId","widgetType"]),e=g(Object.assign({session_id:this.uiSessionId,search_area:"full",source:"upload"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}handleImageSelection(){this.imageSource="upload",this.slidePosition=1,this.el.shadowRoot.querySelector("vviinn-overlayed-modal").shadowRoot.querySelector("vviinn-overlay").querySelector("vviinn-modal").shadowRoot.querySelector(".body").scrollTop=0,this.stopStreamTracks()}renderButtons(){const i=[this.cameraAvailable&&t("button",{class:"action-button",part:"start-camera_button",onClick:()=>{this.handleStartCameraClick()}},n.loading&&"image"===n.searchType&&"startCamera"===this.uploadSource||this.cameraInitializing?t("vviinn-preloader",null):t("span",{class:"action-button-content"},t("slot",{name:"vviinn-camera-icon"},t(k,null)),this.cameraEnabled?t("slot",{name:"vviinn-camera-button-text-stop"},t("span",null,l.t("cameraButtonTextStop"))):t("slot",{name:"vviinn-camera-button-text-start"},t("span",null,l.t("cameraButtonTextStart"))))),t("vviinn-image-selector",{class:"action-button",onClick:()=>this.uploadSource="uploadPhoto",onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("uploadPhoto")},onVviinnNoResult:({detail:t})=>this.handleVviinnNoResult(t),resetVpsButton:this.resetVpsButton,basicEventData:this.getBasicEventData(),part:"upload-photo_button",startUpload:this.buttonPressed&&this.showingInButton&&"upload"===this.mode,loading:n.loading&&"image"===n.searchType&&"uploadPhoto"===this.uploadSource},t("span",{slot:"upload-button-text",class:"action-button-content"},t("slot",{name:"vviinn-image-upload-icon"},t(C,null)),t("slot",{name:"vviinn-image-upload-button-text"},t("span",null,l.t("imageUploadButtonText")))))];return this.isDesktop?i.reverse():i}renderResults(){return 0!==n.results.length&&this.isResultSlide()?(this.resultLoaded||(this.vviinnResultLoad.emit(this.getBasicEventData()),this.trackResultEvent("load"),this.resultLoaded=!0),n.results.map(((i,e)=>{var s;return t("vviinn-product-card",{key:i.productId,hidden:!0,productTitle:i.title,productId:i.productId,productType:i.productType,brand:i.brand,deeplink:i.deeplink,price:i.price.actual,salePrice:i.price.sale,responsive:!0,imageWidth:this.imageResolutionWidth,image:null!==(s=i.image.thumbnail)&&void 0!==s?s:i.image.original,part:"product-card",campaignTypeId:"VPS",index:e,widgetElementId:this.id,buttonElementId:this.buttonElementId,widgetVersion:d})}))):null}resetState(){this.resetScroll("start-page_block"),this.slidePosition=0,n.resetCategoryLink=void 0,n.activeIonLink=void 0,n.image=h.none,n.imageUrl=h.none,n.imageBounds=h.none,n.searchArea=h.none,n.results=[],n.filters=[],n.detectedObjects=[],n.rectangleSearchForm=void 0,n.loading=!1,n.serverError=!1,n.searchType=void 0,this.wrongImageFormat=!1,this.resetScroll("results-block"),this.stopStreamTracks(),this.initResultEvents(),this.stream=null,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.cameraInitializing=!1,this.setShowAspectRatioError(!1)}haveErrors(){return this.wrongImageFormat||n.serverError}resetScroll(t,i="auto"){this.el.shadowRoot.getElementById(t).scroll({top:0,left:0,behavior:i})}handleModalClose(){this.active=!1,this.resetState(),["start-page_block","results-block"].forEach((t=>this.resetScroll(t))),this.trackWidgetEvent("close")}render(){var i;return t(s,{exportparts:"text-search-input"},!this.showingInButton&&t(u,null),t("vviinn-overlayed-modal",{class:{"first-screen":this.isOnboardingSlide()},isFirstScreen:this.isOnboardingSlide(),active:this.active,resetState:this.resetState.bind(this),onVviinnWidgetClose:()=>this.handleModalClose(),buttonElementId:null!==(i=this.buttonElementId)&&void 0!==i?i:this.id,widgetVersion:d,hideBackButton:"upload"===this.mode&&this.showingInButton||!this.cameraEnabled&&this.isOnboardingSlide(),exportparts:"secondary-action, title, close-button"},t("vviinn-slider",{showBullets:!1,position:this.slidePosition},t("vviinn-slide",{class:{"start-page":!0,"camera-enabled":this.cameraEnabled}},t("vviinn-example-image",{onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("startCamera")},basicEventData:this.getBasicEventData(),srcObject:this.stream,cameraButtonClicked:this.cameraButtonClicked,exampleImageSource:this.exampleImageSource}),t("div",{class:{error:this.haveErrors()},id:"start-page_block"},t("div",{class:"start-page_main-content"},t("div",{class:{"start-page_errors-block":!0,hidden:!this.wrongImageFormat&&!n.serverError}},t("vviinn-wrong-format",{class:{hidden:!this.wrongImageFormat},handler:()=>this.resetState()}),t("vviinn-server-error",{class:{hidden:!n.serverError},handler:()=>this.resetState()})),!this.haveErrors()&&t("vviinn-teaser",null),!this.haveErrors()&&t("div",{class:"buttons-group"},this.renderButtons()),this.textSearchShow&&!this.haveErrors()&&t("vviinn-text-search",{clearSearchQuery:!0})),t("vviinn-privacy-badge",{privacyBadgeText:l.t("privacyBadgeText"),class:{invisible:this.haveErrors()}}))),t("vviinn-slide",{class:{"results-page":!0,active:this.isResultSlide()}},this.isResultSlide()&&"image"===n.searchType&&t("div",{class:"image-wrapper"},t("vviinn-image-view",{basicEventData:this.getBasicEventData(),setShowAspectRatioError:this.setShowAspectRatioError,showAspectRatioError:this.showAspectRatioError}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"filters"},n.filters.map((i=>t("search-filters",{filter:i,basicEventData:this.getBasicEventData()})))))),this.textSearchShow&&this.isResultSlide()&&"text"===n.searchType&&t("div",{class:"text-search-wrapper"},t("vviinn-text-search",{initialSearchQuery:this.initialSearchQuery})),t("div",{id:"results-block",class:"products-wrapper"},t("div",{class:{"nothing-found":!0,hidden:n.results.length>0}},t("vviinn-empty-results",{handler:()=>this.resetState()})),t("div",{class:{"nothing-found":!0,hidden:!this.showAspectRatioError}},t("vviinn-wrong-aspect-ratio",{handler:()=>this.resetState()})),t("div",{class:{hidden:0===n.results.length||this.showAspectRatioError,products:!0}},this.renderResults()))))))}get el(){return a(this)}static get watchers(){return{active:["activeWatcher"]}}};j.style=":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);height:640px}#start-page_block{box-sizing:border-box;display:flex;overflow-y:auto;flex-direction:column;justify-content:center;padding:42px 62px}#start-page_block.error{align-content:center}.start-page_main-content{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.start-page_errors-block{display:flex;flex-direction:column;justify-content:center;gap:12px}#start-page_block vviinn-text-search{margin-top:12px}.buttons-group{display:flex;flex-direction:column;gap:12px;margin-top:24px}.action-button{font-family:inherit;display:grid;border:none;cursor:pointer;align-items:center;border-radius:8px;font-size:16px;height:48px;justify-items:center;transition:background 0.1s ease-in-out;color:#525252;background-color:#f4f4f4}.action-button:hover{background-color:#eaeaea}.action-button:first-child{background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));color:white}.action-button:first-child:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}.action-button:active{border-color:black}.action-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:max-content auto;grid-gap:8px}.results-page{margin-top:64px;display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.results-page .text-search-wrapper{width:100%;padding:24px}.products{width:100%;align-content:center;align-items:start;box-sizing:border-box;display:grid;grid-gap:32px 16px;grid-template-columns:repeat(auto-fill, minmax(130px, 1fr));justify-items:center;padding:24px;position:absolute}.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{display:grid;grid-template-rows:min-content 1fr;min-width:100%}.filters-wrapper{margin-top:24px;overflow-x:auto;transform:translateX(-24px);min-width:calc(100% + 48px)}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:8px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:400;line-height:20px}search-filters::part(show-more-filters){display:flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid #f4f4f4;min-width:40px;height:40px;border-radius:100px;box-sizing:border-box;color:#161616}search-filters::part(show-more-filters):hover{background:#eaeaea}search-filters::part(filter active){background:var(--color-primary, var(--color-primary-system));color:white}.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%}vviinn-preloader{--preloader-size:24px;display:flex}@media (max-width: 1080px){#start-page_block{padding:24px 36px}}@media (max-width: 768px){.start-page{display:flex;flex-direction:column;height:100%}vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:visible}.start-page.active{height:calc(100vh - 64px);height:calc(100svh - 64px)}.start-page:not(.active){overflow:hidden}.results-page{margin-top:0}.results-page>*{box-sizing:border-box;padding:12px 24px 24px}.image-wrapper{padding:0}.filters-wrapper{padding-left:24px;min-width:calc(100% + 40px)}.results-page{grid-template-rows:min-content;grid-template-columns:unset}#start-page_block{overflow-y:unset;min-height:-moz-fit-content;min-height:fit-content;padding:24px 20px}.image{margin-bottom:8px}.image-wrapper{grid-template-rows:min-content auto;width:100%}.products-wrapper{align-content:start;position:static;overflow-y:unset;width:100%;padding-top:0;margin-top:24px}.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: 480px){.start-page{padding-top:0}.action-button-content{grid-gap:10px}}@media (max-width: 380px){.filters-wrapper{padding-left:24px}.products{grid-gap:24px 10px}}vviinn-wrong-format,vviinn-server-error{width:280px;align-self:center;justify-self:center}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}";export{j as vviinn_vps_widget}
@@ -1 +1 @@
1
- import{h as t,r as i,c as s,H as e,g as h}from"./p-1e83e6ba.js";import{v as n}from"./p-4b571be0.js";import{c as o,S as a}from"./p-49417192.js";import{D as l}from"./p-cc013cd2.js";const r=()=>t("svg",{width:"22",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.567 3H19A3.01 3.01 0 0 1 22 6v7.69h-2V6c0-.55-.451-1-1.001-1h-3.502l-2.03-3H8.543L6.603 5H3.001c-.55 0-1 .45-1 1v11c0 .55.45 1 1 1h5.933v2H3.001A3.01 3.01 0 0 1 0 17V6c0-1.65 1.35-3 3.001-3h2.522l1.94-3h7.074l2.03 3Zm-5.562 3c1.28 0 2.561.48 3.542 1.46h-.01a4.992 4.992 0 0 1 .64 6.29l3.051 3.05-1.41 1.41-3.052-3.05c-.84.55-1.8.83-2.76.83-1.282 0-2.562-.48-3.543-1.46a5.002 5.002 0 0 1 0-7.07A5.026 5.026 0 0 1 11.005 6Zm-2.771 5a2.763 2.763 0 0 0 2.771 2.77A2.763 2.763 0 0 0 13.776 11a2.763 2.763 0 0 0-2.771-2.77A2.763 2.763 0 0 0 8.234 11Z",fill:"#161616"})),d=class{constructor(t){i(this,t),this.vviinnWidgetLoad=s(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=s(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=s(this,"vviinnWidgetClose",7),this.vviinnImageUpload=s(this,"vviinnImageUpload",7),this.vviinnProductLoad=s(this,"vviinnProductLoad",7),this.vviinnProductClick=s(this,"vviinnProductClick",7),this.vviinnProductView=s(this,"vviinnProductView",7),this.vviinnResultLoad=s(this,"vviinnResultLoad",7),this.vviinnResultView=s(this,"vviinnResultView",7),this.vviinnNoResult=s(this,"vviinnNoResult",7),this.vviinnImageCrop=s(this,"vviinnImageCrop",7),this.vviinnSelectObject=s(this,"vviinnSelectObject",7),this.vviinnSelectFilter=s(this,"vviinnSelectFilter",7),this.globalSlotsChanged=s(this,"globalSlotsChanged",7),this.getBasicEventData=()=>({widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:o.VPS,widgetId:this.el.id,widgetVersion:n}),this.token=void 0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.addStyle=!1,this.mode="modal",this.excluded="",this.productDetailNewTab=!0,this.imageResolutionWidth=250,this.exampleImageSource=l,this.textSearchShow=!1,this.apiPath=void 0,this.buttonPressed=!1}handleModalClosed(){this.buttonPressed=!1}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit(Array.from(t))}handleClick(){this.buttonPressed=!0}resetButton(){this.buttonPressed=!1}render(){return t(e,{tabindex:"0",role:"button"},t("vviinn-button",{onClick:()=>{this.handleClick()},addStyle:this.addStyle,part:"vviinn-button"},t("slot",null,t(r,null))),t(a,null),t("vviinn-vps-widget",{mode:this.mode,"currency-sign":this.currencySign,token:this.token,locale:this.locale,apiPath:this.apiPath,exportparts:"brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card, upload-photo_button, show-files_button, start-camera_button",campaignId:this.campaignId,showingInButton:!0,buttonPressed:this.buttonPressed,resetVpsButton:this.resetButton.bind(this),buttonElementId:this.el.id,active:this.buttonPressed&&("modal"===this.mode||"camera"===this.mode),excluded:this.excluded,productDetailNewTab:this.productDetailNewTab,imageResolutionWidth:this.imageResolutionWidth,exampleImageSource:this.exampleImageSource,textSearchShow:this.textSearchShow}))}get el(){return h(this)}};d.style=":host{display:block}";export{d as vviinn_vps_button}
1
+ import{h as t,r as i,c as s,H as e,g as h}from"./p-1e83e6ba.js";import{v as n}from"./p-7a70bfb0.js";import{c as o,S as a}from"./p-49417192.js";import{D as l}from"./p-cc013cd2.js";const r=()=>t("svg",{width:"22",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.567 3H19A3.01 3.01 0 0 1 22 6v7.69h-2V6c0-.55-.451-1-1.001-1h-3.502l-2.03-3H8.543L6.603 5H3.001c-.55 0-1 .45-1 1v11c0 .55.45 1 1 1h5.933v2H3.001A3.01 3.01 0 0 1 0 17V6c0-1.65 1.35-3 3.001-3h2.522l1.94-3h7.074l2.03 3Zm-5.562 3c1.28 0 2.561.48 3.542 1.46h-.01a4.992 4.992 0 0 1 .64 6.29l3.051 3.05-1.41 1.41-3.052-3.05c-.84.55-1.8.83-2.76.83-1.282 0-2.562-.48-3.543-1.46a5.002 5.002 0 0 1 0-7.07A5.026 5.026 0 0 1 11.005 6Zm-2.771 5a2.763 2.763 0 0 0 2.771 2.77A2.763 2.763 0 0 0 13.776 11a2.763 2.763 0 0 0-2.771-2.77A2.763 2.763 0 0 0 8.234 11Z",fill:"#161616"})),d=class{constructor(t){i(this,t),this.vviinnWidgetLoad=s(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=s(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=s(this,"vviinnWidgetClose",7),this.vviinnImageUpload=s(this,"vviinnImageUpload",7),this.vviinnProductLoad=s(this,"vviinnProductLoad",7),this.vviinnProductClick=s(this,"vviinnProductClick",7),this.vviinnProductView=s(this,"vviinnProductView",7),this.vviinnResultLoad=s(this,"vviinnResultLoad",7),this.vviinnResultView=s(this,"vviinnResultView",7),this.vviinnNoResult=s(this,"vviinnNoResult",7),this.vviinnImageCrop=s(this,"vviinnImageCrop",7),this.vviinnSelectObject=s(this,"vviinnSelectObject",7),this.vviinnSelectFilter=s(this,"vviinnSelectFilter",7),this.globalSlotsChanged=s(this,"globalSlotsChanged",7),this.getBasicEventData=()=>({widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:o.VPS,widgetId:this.el.id,widgetVersion:n}),this.token=void 0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.addStyle=!1,this.mode="modal",this.excluded="",this.productDetailNewTab=!0,this.imageResolutionWidth=250,this.exampleImageSource=l,this.textSearchShow=!1,this.apiPath=void 0,this.buttonPressed=!1}handleModalClosed(){this.buttonPressed=!1}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit(Array.from(t))}handleClick(){this.buttonPressed=!0}resetButton(){this.buttonPressed=!1}render(){return t(e,{tabindex:"0",role:"button"},t("vviinn-button",{onClick:()=>{this.handleClick()},addStyle:this.addStyle,part:"vviinn-button"},t("slot",null,t(r,null))),t(a,null),t("vviinn-vps-widget",{mode:this.mode,"currency-sign":this.currencySign,token:this.token,locale:this.locale,apiPath:this.apiPath,exportparts:"brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card, upload-photo_button, show-files_button, start-camera_button",campaignId:this.campaignId,showingInButton:!0,buttonPressed:this.buttonPressed,resetVpsButton:this.resetButton.bind(this),buttonElementId:this.el.id,active:this.buttonPressed&&("modal"===this.mode||"camera"===this.mode),excluded:this.excluded,productDetailNewTab:this.productDetailNewTab,imageResolutionWidth:this.imageResolutionWidth,exampleImageSource:this.exampleImageSource,textSearchShow:this.textSearchShow}))}get el(){return h(this)}};d.style=":host{display:block}";export{d as vviinn_vps_button}