vviinn-widgets 2.48.4 → 2.48.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/cjs/{index-bfb8c050.js → index-4445cb70.js} +1 -1
  2. package/dist/cjs/{package-ba749091.js → package-d6dae17b.js} +1 -1
  3. package/dist/cjs/search-filters_17.cjs.entry.js +1 -1
  4. package/dist/cjs/{search.store-d44009d4.js → search.store-7605f369.js} +6 -2
  5. package/dist/cjs/vviinn-carousel_4.cjs.entry.js +3 -3
  6. package/dist/cjs/vviinn-preloader.cjs.entry.js +1 -1
  7. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
  8. package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
  9. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +3 -3
  10. package/dist/collection/store/search.store.js +6 -2
  11. package/dist/esm/{index-3bef9180.js → index-ff13425d.js} +1 -1
  12. package/dist/esm/{package-b3c56ad4.js → package-3c563a3a.js} +1 -1
  13. package/dist/esm/search-filters_17.entry.js +1 -1
  14. package/dist/esm/{search.store-df028218.js → search.store-eaa5f165.js} +6 -2
  15. package/dist/esm/vviinn-carousel_4.entry.js +3 -3
  16. package/dist/esm/vviinn-preloader.entry.js +1 -1
  17. package/dist/esm/vviinn-vpr-button.entry.js +1 -1
  18. package/dist/esm/vviinn-vps-button.entry.js +1 -1
  19. package/dist/esm/vviinn-vps-widget.entry.js +3 -3
  20. package/dist/types/store/search.store.d.ts +1 -1
  21. package/{www/build/p-3b78a9b7.entry.js → dist/vviinn-widgets/p-08ef6197.entry.js} +1 -1
  22. package/{www/build/p-f4ef2f87.js → dist/vviinn-widgets/p-150f1108.js} +1 -1
  23. package/dist/vviinn-widgets/{p-0ece8ea1.entry.js → p-554d2c34.entry.js} +1 -1
  24. package/dist/vviinn-widgets/{p-ce69a00b.entry.js → p-8589dbde.entry.js} +1 -1
  25. package/dist/vviinn-widgets/p-909e2781.js +1 -0
  26. package/dist/vviinn-widgets/{p-81bb3f10.entry.js → p-ad25945b.entry.js} +1 -1
  27. package/dist/vviinn-widgets/{p-95fdd81d.entry.js → p-c99391f1.entry.js} +1 -1
  28. package/dist/vviinn-widgets/{p-a0800504.entry.js → p-dc4d6669.entry.js} +1 -1
  29. package/{www/build/p-e2fe7163.js → dist/vviinn-widgets/p-ec4782a6.js} +1 -1
  30. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  31. package/package.json +1 -1
  32. package/{dist/vviinn-widgets/p-3b78a9b7.entry.js → www/build/p-08ef6197.entry.js} +1 -1
  33. package/{dist/vviinn-widgets/p-f4ef2f87.js → www/build/p-150f1108.js} +1 -1
  34. package/www/build/{p-0ece8ea1.entry.js → p-554d2c34.entry.js} +1 -1
  35. package/www/build/{p-ce69a00b.entry.js → p-8589dbde.entry.js} +1 -1
  36. package/www/build/p-909e2781.js +1 -0
  37. package/www/build/{p-81bb3f10.entry.js → p-ad25945b.entry.js} +1 -1
  38. package/www/build/{p-95fdd81d.entry.js → p-c99391f1.entry.js} +1 -1
  39. package/www/build/{p-a0800504.entry.js → p-dc4d6669.entry.js} +1 -1
  40. package/{dist/vviinn-widgets/p-e2fe7163.js → www/build/p-ec4782a6.js} +1 -1
  41. package/www/build/vviinn-widgets.esm.js +1 -1
  42. package/dist/vviinn-widgets/p-3e1665c8.js +0 -1
  43. package/www/build/p-3e1665c8.js +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const search_store = require('./search.store-d44009d4.js');
3
+ const search_store = require('./search.store-7605f369.js');
4
4
 
5
5
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
6
6
  // require the crypto API and do not support built-in fallback to lower quality random number
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "2.48.4";
3
+ const version = "2.48.5";
4
4
 
5
5
  exports.version = version;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const search_store = require('./search.store-d44009d4.js');
6
+ 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');
@@ -17242,6 +17242,7 @@ const optionalResize = (image, size) => image.naturalWidth > size ? resizeImage(
17242
17242
  const resizeFileTo = (size) => (file) => _function.pipe(file, imageFromFileTask, Task.map((image) => optionalResize(image, size)), Task.chain(convertB64toFileTask));
17243
17243
 
17244
17244
  const RESIZED_IMAGE_WIDTH = 500;
17245
+ const HI_RES_RESIZED_IMAGE_WIDTH = 1024;
17245
17246
  const makeAuthorizedRequest = (token) => pipe(token, processBearerToken, map$4((headers) => {
17246
17247
  return {
17247
17248
  headers,
@@ -17285,7 +17286,7 @@ const detectObjects = async (data) => {
17285
17286
  await pipe(getLink(data, "detectedObjects"), fromOption(() => error), chain(makeLinkRequest), map((objects) => (state.detectedObjects = foldValueObject(objects))))();
17286
17287
  state.objectDetectionInProgress = false;
17287
17288
  };
17288
- const uploadHiresFile = async (sessionResponse, file) => {
17289
+ const uploadHiResFile = async (sessionResponse, file) => {
17289
17290
  const ionFile = await fromFile(file);
17290
17291
  const formPayload = {
17291
17292
  image: ionFile,
@@ -17379,10 +17380,13 @@ const setSelectedImage = (image) => {
17379
17380
  const processSelectedFile = async (file) => {
17380
17381
  const originFile = checkFileWithExtention(file);
17381
17382
  const fileResizer = resizeFileTo(RESIZED_IMAGE_WIDTH);
17383
+ const hiResFileResizer = resizeFileTo(HI_RES_RESIZED_IMAGE_WIDTH);
17382
17384
  const resizeFileTask = pipe(originFile, fromEither, chainTaskK(fileResizer));
17385
+ const resizeHiResFileTask = pipe(originFile, fromEither, chainTaskK(hiResFileResizer));
17383
17386
  const session = await pipe(resizeFileTask, chain(uploadFile))();
17384
- pipe(sequenceToEither(session, originFile), map$4(([sessionObject, file]) => uploadHiresFile(sessionObject, file)));
17385
17387
  await pipe(resizeFileTask, chainTaskK(imageFromFileTask), map(setSelectedImage))();
17388
+ const resizedHiResFile = await resizeHiResFileTask();
17389
+ pipe(sequenceToEither(session, resizedHiResFile), map$4(([sessionObject, file]) => uploadHiResFile(sessionObject, file)));
17386
17390
  return session;
17387
17391
  };
17388
17392
 
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const search_store = require('./search.store-d44009d4.js');
6
+ 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-ba749091.js');
11
- const index$1 = require('./index-bfb8c050.js');
10
+ const _package = require('./package-d6dae17b.js');
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" },
14
14
  index.h("path", { d: "M7.5 22C6.95 22 6.47917 21.8042 6.0875 21.4125C5.69583 21.0208 5.5 20.55 5.5 20C5.5 19.45 5.69583 18.9792 6.0875 18.5875C6.47917 18.1958 6.95 18 7.5 18C8.05 18 8.52083 18.1958 8.9125 18.5875C9.30417 18.9792 9.5 19.45 9.5 20C9.5 20.55 9.30417 21.0208 8.9125 21.4125C8.52083 21.8042 8.05 22 7.5 22ZM17.5 22C16.95 22 16.4792 21.8042 16.0875 21.4125C15.6958 21.0208 15.5 20.55 15.5 20C15.5 19.45 15.6958 18.9792 16.0875 18.5875C16.4792 18.1958 16.95 18 17.5 18C18.05 18 18.5208 18.1958 18.9125 18.5875C19.3042 18.9792 19.5 19.45 19.5 20C19.5 20.55 19.3042 21.0208 18.9125 21.4125C18.5208 21.8042 18.05 22 17.5 22ZM6.65 6L9.05 11H16.05L18.8 6H6.65ZM5.7 4H20.45C20.8333 4 21.125 4.17083 21.325 4.5125C21.525 4.85417 21.5333 5.2 21.35 5.55L17.8 11.95C17.6167 12.2833 17.3708 12.5417 17.0625 12.725C16.7542 12.9083 16.4167 13 16.05 13H8.6L7.5 15H18.5C18.7833 15 19.0208 15.0958 19.2125 15.2875C19.4042 15.4792 19.5 15.7167 19.5 16C19.5 16.2833 19.4042 16.5208 19.2125 16.7125C19.0208 16.9042 18.7833 17 18.5 17H7.5C6.75 17 6.18333 16.6708 5.8 16.0125C5.41667 15.3542 5.4 14.7 5.75 14.05L7.1 11.6L3.5 4H2.5C2.21667 4 1.97917 3.90417 1.7875 3.7125C1.59583 3.52083 1.5 3.28333 1.5 3C1.5 2.71667 1.59583 2.47917 1.7875 2.2875C1.97917 2.09583 2.21667 2 2.5 2H4.125C4.30833 2 4.48333 2.05 4.65 2.15C4.81667 2.25 4.94167 2.39167 5.025 2.575L5.7 4Z", fill: "#525252" })));
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const search_store = require('./search.store-d44009d4.js');
6
+ const search_store = require('./search.store-7605f369.js');
7
7
 
8
8
  const vviinnPreloaderCss = ":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;animation:rotate 3s linear infinite;border:var(--preloader-width) solid currentColor;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";
9
9
 
@@ -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-ba749091.js');
6
+ const _package = require('./package-d6dae17b.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-ba749091.js');
6
+ const _package = require('./package-d6dae17b.js');
7
7
  const customizedSlots = require('./customized-slots-67b24737.js');
8
8
  const constants = require('./constants-7684cbfc.js');
9
9
 
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const search_store = require('./search.store-d44009d4.js');
6
+ const search_store = require('./search.store-7605f369.js');
7
7
  const i18next = require('./i18next-74ff3413.js');
8
- const _package = require('./package-ba749091.js');
8
+ const _package = require('./package-d6dae17b.js');
9
9
  const customizedSlots = require('./customized-slots-67b24737.js');
10
- const index$1 = require('./index-bfb8c050.js');
10
+ const index$1 = require('./index-4445cb70.js');
11
11
  const constants = require('./constants-7684cbfc.js');
12
12
 
13
13
  const CameraActionIcon = () => (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
@@ -17,6 +17,7 @@ import { imageFormFromFile } from "../Image/form";
17
17
  import { checkFileWithExtention, resizeFileTo } from "./file-processing";
18
18
  import { imageFromFileTask } from "../Image/fromFile";
19
19
  const RESIZED_IMAGE_WIDTH = 500;
20
+ const HI_RES_RESIZED_IMAGE_WIDTH = 1024;
20
21
  const makeAuthorizedRequest = (token) => pipe(token, processBearerToken, E.map((headers) => {
21
22
  return {
22
23
  headers,
@@ -60,7 +61,7 @@ const detectObjects = async (data) => {
60
61
  await pipe(getLink(data, "detectedObjects"), TE.fromOption(() => error), TE.chain(makeLinkRequest), TE.map((objects) => (state.detectedObjects = foldValueObject(objects))))();
61
62
  state.objectDetectionInProgress = false;
62
63
  };
63
- export const uploadHiresFile = async (sessionResponse, file) => {
64
+ export const uploadHiResFile = async (sessionResponse, file) => {
64
65
  const ionFile = await F.fromFile(file);
65
66
  const formPayload = {
66
67
  image: ionFile,
@@ -154,9 +155,12 @@ const setSelectedImage = (image) => {
154
155
  export const processSelectedFile = async (file) => {
155
156
  const originFile = checkFileWithExtention(file);
156
157
  const fileResizer = resizeFileTo(RESIZED_IMAGE_WIDTH);
158
+ const hiResFileResizer = resizeFileTo(HI_RES_RESIZED_IMAGE_WIDTH);
157
159
  const resizeFileTask = pipe(originFile, TE.fromEither, TE.chainTaskK(fileResizer));
160
+ const resizeHiResFileTask = pipe(originFile, TE.fromEither, TE.chainTaskK(hiResFileResizer));
158
161
  const session = await pipe(resizeFileTask, TE.chain(uploadFile))();
159
- pipe(sequenceToEither(session, originFile), E.map(([sessionObject, file]) => uploadHiresFile(sessionObject, file)));
160
162
  await pipe(resizeFileTask, TE.chainTaskK(imageFromFileTask), TE.map(setSelectedImage))();
163
+ const resizedHiResFile = await resizeHiResFileTask();
164
+ pipe(sequenceToEither(session, resizedHiResFile), E.map(([sessionObject, file]) => uploadHiResFile(sessionObject, file)));
161
165
  return session;
162
166
  };
@@ -1,4 +1,4 @@
1
- import { n as commonjsGlobal, o as createCommonjsModule } from './search.store-df028218.js';
1
+ import { n as commonjsGlobal, o as createCommonjsModule } from './search.store-eaa5f165.js';
2
2
 
3
3
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
4
4
  // require the crypto API and do not support built-in fallback to lower quality random number
@@ -1,3 +1,3 @@
1
- const version = "2.48.4";
1
+ const version = "2.48.5";
2
2
 
3
3
  export { version as v };
@@ -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 { s as searchState, a as _function, O as Option, q as fromAlt, r as foldValueObject, u as scaleWithSized, v as center, w as makeRectangularSearchRequest, x as detectedObjectEq, y as toFile, z as processSelectedFile, E as Either, B as match, o as createCommonjsModule, n as commonjsGlobal, C as sequenceToOption, D as fromImage, F as dimensionsFromImage, G as scaleByLargestSide, N as NonEmptyArray, H as processSelectedText } from './search.store-df028218.js';
2
+ import { s as searchState, a as _function, O as Option, q as fromAlt, r as foldValueObject, u as scaleWithSized, v as center, w as makeRectangularSearchRequest, x as detectedObjectEq, y as toFile, z as processSelectedFile, E as Either, B as match, o as createCommonjsModule, n as commonjsGlobal, C as sequenceToOption, D as fromImage, F as dimensionsFromImage, G as scaleByLargestSide, N as NonEmptyArray, H as processSelectedText } from './search.store-eaa5f165.js';
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 } from './customized-slots-e56251a2.js';
@@ -17240,6 +17240,7 @@ const optionalResize = (image, size) => image.naturalWidth > size ? resizeImage(
17240
17240
  const resizeFileTo = (size) => (file) => _function.pipe(file, imageFromFileTask, Task.map((image) => optionalResize(image, size)), Task.chain(convertB64toFileTask));
17241
17241
 
17242
17242
  const RESIZED_IMAGE_WIDTH = 500;
17243
+ const HI_RES_RESIZED_IMAGE_WIDTH = 1024;
17243
17244
  const makeAuthorizedRequest = (token) => pipe(token, processBearerToken, map$4((headers) => {
17244
17245
  return {
17245
17246
  headers,
@@ -17283,7 +17284,7 @@ const detectObjects = async (data) => {
17283
17284
  await pipe(getLink(data, "detectedObjects"), fromOption(() => error), chain(makeLinkRequest), map((objects) => (state.detectedObjects = foldValueObject(objects))))();
17284
17285
  state.objectDetectionInProgress = false;
17285
17286
  };
17286
- const uploadHiresFile = async (sessionResponse, file) => {
17287
+ const uploadHiResFile = async (sessionResponse, file) => {
17287
17288
  const ionFile = await fromFile(file);
17288
17289
  const formPayload = {
17289
17290
  image: ionFile,
@@ -17377,10 +17378,13 @@ const setSelectedImage = (image) => {
17377
17378
  const processSelectedFile = async (file) => {
17378
17379
  const originFile = checkFileWithExtention(file);
17379
17380
  const fileResizer = resizeFileTo(RESIZED_IMAGE_WIDTH);
17381
+ const hiResFileResizer = resizeFileTo(HI_RES_RESIZED_IMAGE_WIDTH);
17380
17382
  const resizeFileTask = pipe(originFile, fromEither, chainTaskK(fileResizer));
17383
+ const resizeHiResFileTask = pipe(originFile, fromEither, chainTaskK(hiResFileResizer));
17381
17384
  const session = await pipe(resizeFileTask, chain(uploadFile))();
17382
- pipe(sequenceToEither(session, originFile), map$4(([sessionObject, file]) => uploadHiresFile(sessionObject, file)));
17383
17385
  await pipe(resizeFileTask, chainTaskK(imageFromFileTask), map(setSelectedImage))();
17386
+ const resizedHiResFile = await resizeHiResFileTask();
17387
+ pipe(sequenceToEither(session, resizedHiResFile), map$4(([sessionObject, file]) => uploadHiResFile(sessionObject, file)));
17384
17388
  return session;
17385
17389
  };
17386
17390
 
@@ -1,10 +1,10 @@
1
1
  import { h, r as registerInstance, H as Host, g as getElement, c as createEvent, F as Fragment } from './index-1f3eaf12.js';
2
- import { _ as _Array, O as Option, S as Semigroup, a as _function, h as has, t as tuple, E as Either, s as searchState, b as state, p as pipe, c as chainW, m as makeRequest, f as fromEither, g as getApiPath, d as createInitGetRequest, A as Apply, e as map, i as match, j as arrayToQueryString, k as parseExcluded, T as TaskEither, l as checkEmpryString } from './search.store-df028218.js';
2
+ import { _ as _Array, O as Option, S as Semigroup, a as _function, h as has, t as tuple, E as Either, s as searchState, b as state, p as pipe, c as chainW, m as makeRequest, f as fromEither, g as getApiPath, d as createInitGetRequest, A as Apply, e as map, i as match, j as arrayToQueryString, k as parseExcluded, T as TaskEither, l as checkEmpryString } from './search.store-eaa5f165.js';
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-b3c56ad4.js';
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-3bef9180.js';
6
+ import { v as version } from './package-3c563a3a.js';
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-ff13425d.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" },
10
10
  h("path", { d: "M7.5 22C6.95 22 6.47917 21.8042 6.0875 21.4125C5.69583 21.0208 5.5 20.55 5.5 20C5.5 19.45 5.69583 18.9792 6.0875 18.5875C6.47917 18.1958 6.95 18 7.5 18C8.05 18 8.52083 18.1958 8.9125 18.5875C9.30417 18.9792 9.5 19.45 9.5 20C9.5 20.55 9.30417 21.0208 8.9125 21.4125C8.52083 21.8042 8.05 22 7.5 22ZM17.5 22C16.95 22 16.4792 21.8042 16.0875 21.4125C15.6958 21.0208 15.5 20.55 15.5 20C15.5 19.45 15.6958 18.9792 16.0875 18.5875C16.4792 18.1958 16.95 18 17.5 18C18.05 18 18.5208 18.1958 18.9125 18.5875C19.3042 18.9792 19.5 19.45 19.5 20C19.5 20.55 19.3042 21.0208 18.9125 21.4125C18.5208 21.8042 18.05 22 17.5 22ZM6.65 6L9.05 11H16.05L18.8 6H6.65ZM5.7 4H20.45C20.8333 4 21.125 4.17083 21.325 4.5125C21.525 4.85417 21.5333 5.2 21.35 5.55L17.8 11.95C17.6167 12.2833 17.3708 12.5417 17.0625 12.725C16.7542 12.9083 16.4167 13 16.05 13H8.6L7.5 15H18.5C18.7833 15 19.0208 15.0958 19.2125 15.2875C19.4042 15.4792 19.5 15.7167 19.5 16C19.5 16.2833 19.4042 16.5208 19.2125 16.7125C19.0208 16.9042 18.7833 17 18.5 17H7.5C6.75 17 6.18333 16.6708 5.8 16.0125C5.41667 15.3542 5.4 14.7 5.75 14.05L7.1 11.6L3.5 4H2.5C2.21667 4 1.97917 3.90417 1.7875 3.7125C1.59583 3.52083 1.5 3.28333 1.5 3C1.5 2.71667 1.59583 2.47917 1.7875 2.2875C1.97917 2.09583 2.21667 2 2.5 2H4.125C4.30833 2 4.48333 2.05 4.65 2.15C4.81667 2.25 4.94167 2.39167 5.025 2.575L5.7 4Z", fill: "#525252" })));
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-1f3eaf12.js';
2
- import { s as searchState } from './search.store-df028218.js';
2
+ import { s as searchState } from './search.store-eaa5f165.js';
3
3
 
4
4
  const vviinnPreloaderCss = ":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;animation:rotate 3s linear infinite;border:var(--preloader-width) solid currentColor;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";
5
5
 
@@ -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-b3c56ad4.js';
2
+ import { v as version } from './package-3c563a3a.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-b3c56ad4.js';
2
+ import { v as version } from './package-3c563a3a.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,9 +1,9 @@
1
1
  import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-1f3eaf12.js';
2
- import { s as searchState, b as state, k as parseExcluded, O as Option } from './search.store-df028218.js';
2
+ import { s as searchState, b as state, k as parseExcluded, O as Option } from './search.store-eaa5f165.js';
3
3
  import { i as instance } from './i18next-387f2b0a.js';
4
- import { v as version } from './package-b3c56ad4.js';
4
+ import { v as version } from './package-3c563a3a.js';
5
5
  import { c as campaignTypeNames, s as slotChangeListener, S as SlotSkeleton } from './customized-slots-e56251a2.js';
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-3bef9180.js';
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-ff13425d.js';
7
7
  import { D as DEFAULT_EXAMPLE_IMAGE } from './constants-8bf233a9.js';
8
8
 
9
9
  const CameraActionIcon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
@@ -34,7 +34,7 @@ type SearchStore = {
34
34
  loading: boolean;
35
35
  };
36
36
  export declare const searchState: SearchStore;
37
- export declare const uploadHiresFile: (sessionResponse: SearchSession, file: File) => Promise<void>;
37
+ export declare const uploadHiResFile: (sessionResponse: SearchSession, file: File) => Promise<void>;
38
38
  export declare const makeRectangularSearchRequest: () => Promise<void>;
39
39
  export declare const uploadFile: (file: File) => TE.TaskEither<BasicError<string | Response>, SearchSession>;
40
40
  export declare const processSelectedText: (query: string) => Promise<E.Either<BasicError<string | Response>, import("../searchSession/searchSession").TextSearchSession>>;
@@ -1,4 +1,4 @@
1
- import{h as t,r as i,c as e,H as n,g as s}from"./p-1e83e6ba.js";import{s as r,a as o,O as a,q as h,r as c,u as l,v as d,w as p,x as u,y as v,z as f,E as m,B as g,o as b,n as w,C as x,D as y,F as C,G as k,N as M,H as j}from"./p-f4ef2f87.js";import{i as z}from"./p-2e76a5c3.js";import{P as O}from"./p-ff8db3d2.js";import{s as E,c as L}from"./p-49417192.js";const N=()=>t("svg",{width:"12",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z"})),S=()=>t("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M8.00001 17.3333C7.62223 17.3333 7.30556 17.2056 7.05001 16.95C6.79445 16.6944 6.66667 16.3778 6.66667 16C6.66667 15.6222 6.79445 15.3056 7.05001 15.05C7.30556 14.7944 7.62223 14.6667 8.00001 14.6667H24C24.3778 14.6667 24.6944 14.7944 24.95 15.05C25.2056 15.3056 25.3333 15.6222 25.3333 16C25.3333 16.3778 25.2056 16.6944 24.95 16.95C24.6944 17.2056 24.3778 17.3333 24 17.3333H8.00001Z",fill:"currentColor"})),D=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"80",height:"80",viewBox:"0 0 80 80",fill:"none"},t("circle",{cx:"40",cy:"40",r:"36",fill:"white"}),t("circle",{cx:"40",cy:"40",r:"39",fill:"white","fill-opacity":"0.16",stroke:"white","stroke-width":"2"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M48 29.3333H50.6667C53.6133 29.3333 56 31.72 56 34.6667V45.3333H53.3333V34.6667C53.3333 33.2 52.1333 32 50.6667 32H46.5733L45.7867 30.8133L43.9067 28H36.0933L34.2133 30.8133L33.4267 32H29.3333C27.8667 32 26.6667 33.2 26.6667 34.6667V48C26.6667 49.4667 27.8667 50.6667 29.3333 50.6667H36V53.3333H29.3333C26.3867 53.3333 24 50.9467 24 48V34.6667C24 31.72 26.3867 29.3333 29.3333 29.3333H32L34.6667 25.3333H45.3333L48 29.3333ZM40 34.6667C43.68 34.6667 46.6667 37.6533 46.6667 41.3333L46.6533 41.3467C46.6533 42.6933 46.24 43.96 45.5467 45.0133L51.6 51.0667L49.72 52.9467L43.6667 46.8933C42.6133 47.5867 41.36 48 40 48C36.32 48 33.3333 45.0133 33.3333 41.3333C33.3333 37.6533 36.32 34.6667 40 34.6667ZM36 41.3333C36 43.5333 37.8 45.3333 40 45.3333C42.2 45.3333 44 43.5333 44 41.3333C44 39.1333 42.2 37.3333 40 37.3333C37.8 37.3333 36 39.1333 36 41.3333Z",fill:"#161616"})),T=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M7.82499 13L12.725 17.9C12.925 18.1 13.0208 18.3333 13.0125 18.6C13.0042 18.8667 12.9 19.1 12.7 19.3C12.5 19.4833 12.2667 19.5792 12 19.5875C11.7333 19.5958 11.5 19.5 11.3 19.3L4.69999 12.7C4.59999 12.6 4.52915 12.4917 4.48749 12.375C4.44582 12.2583 4.42499 12.1333 4.42499 12C4.42499 11.8667 4.44582 11.7417 4.48749 11.625C4.52915 11.5083 4.59999 11.4 4.69999 11.3L11.3 4.69999C11.4833 4.51665 11.7125 4.42499 11.9875 4.42499C12.2625 4.42499 12.5 4.51665 12.7 4.69999C12.9 4.89999 13 5.13749 13 5.41249C13 5.68749 12.9 5.92499 12.7 6.12499L7.82499 11H19C19.2833 11 19.5208 11.0958 19.7125 11.2875C19.9042 11.4792 20 11.7167 20 12C20 12.2833 19.9042 12.5208 19.7125 12.7125C19.5208 12.9042 19.2833 13 19 13H7.82499Z",fill:"currentColor"})),A=()=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M20.6 4.57C17.39 4.19 16.88 3.68 16.42 0.37C16.38 0.15 16.22 0 16.01 0C15.8 0 15.63 0.15 15.59 0.37C15.12 3.66 14.63 4.13 11.41 4.57C11.17 4.61 11.01 4.77 11.01 5C11.01 5.23 11.17 5.39 11.41 5.42C14.63 5.81 15.14 6.31 15.59 9.62C15.63 9.84 15.8 10 16.01 10C16.22 10 16.39 9.84 16.42 9.62C16.89 6.31 17.39 5.81 20.6 5.42C20.84 5.38 21 5.22 21 5C21 4.78 20.83 4.6 20.6 4.57Z",fill:"#525252"}),t("path",{d:"M14 12C14 9.24 11.76 7 9 7C6.24 7 4 9.24 4 12C4 14.76 6.24 17 9 17C10.02 17 10.96 16.69 11.75 16.17L16.29 20.71L17.7 19.3L13.16 14.76C13.68 13.97 13.99 13.02 13.99 12.01L14 12ZM9 15C7.35 15 6 13.65 6 12C6 10.35 7.35 9 9 9C10.65 9 12 10.35 12 12C12 13.65 10.65 15 9 15Z",fill:"#525252"})),B=()=>t("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z",fill:"#525252"}),t("path",{d:"M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",fill:"#525252"}));const H=(t,i)=>{var e;if(!t)return"";const n={};return t.href.split("?")[1].split("included[]=").join("").split("&").forEach((t=>{const[i,e]=t.split("%3A");n[i]=e})),"categories"===i?null!==(e=n.product_type)&&void 0!==e?e:n.google_product_category:n[i]},_=class{constructor(t){i(this,t),this.vviinnSelectFilter=e(this,"vviinnSelectFilter",7),this.filterType=this.filter.name,this.filter=null,this.basicEventData=void 0,this.selectedFilter="",this.hideFilters=!0}isCategoriesFilterType(){return"categories"===this.filterType}getFilterKind(){return this.isCategoriesFilterType()?"category":this.filterType}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter(t):this.selectFilter(t)}selectFilter(t){r.activeIonLink=t,this.selectedFilter=H(t,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"select",kind:this.getFilterKind()}))}clearSelectedFilter(t){r.activeIonLink=t.clear,this.selectedFilter=H(t.clear,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"deselect",kind:this.getFilterKind()}))}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,i){"Enter"===t.key&&this.handleFilterSelection(i)}isFilterSelected(t){return this.isCategoriesFilterType()?this.selectedFilter===H(t,"categories"):this.selectedFilter===t.name}render(){if(!this.filter)return null;const{name:i,filters:e}=this.filter;return t(n,{exportparts:"filter, show-more-filters"},t("div",{class:{filters:!0,"no-scrollbar-mobile":this.isCategoriesFilterType(),"no-scrollbar":!this.isCategoriesFilterType()}},e.filter(((t,i)=>!this.hideFilters||i<5)).map(((e,n)=>{const s="categories"===i?this.selectedFilter===H(e,"categories"):this.selectedFilter===e.name;return t("div",{role:"button",tabindex:"0",key:n,part:s?"filter active":"filter",class:{filter:!0,active:s},style:{"animation-delay":10*n+"ms"},onPointerUp:t=>{r.loading||(t.stopPropagation(),this.handleFilterSelection(e))},onKeyPress:t=>{r.loading||this.handleEnter(t,e)}},e.name)})),this.hideFilters&&t("div",{class:{"show-more":!0,hidden:e.length<=5,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>{setTimeout((()=>this.toggleFilters()),300)},onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"})))}get el(){return s(this)}};_.style=".filters{display:flex;flex-direction:row;overflow-x:auto;padding:0 12px 12px 24px}.filter{align-items:center;color:#525252;cursor:pointer;display:flex;margin-right:12px;height:-moz-max-content;height:max-content;min-width:-moz-max-content;min-width:max-content;transition-property:background;transition-duration:0.5s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:10px 12px}.show-more{display:flex}.show-more.hidden{display:none !important}.show-more::after{position:relative;content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;transform:rotate(-90deg);left:2px}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}@media (max-width: 768px){.filters{padding-right:54px;padding-bottom:0}}@media (max-width: 640px){.no-scrollbar-mobile{-ms-overflow-style:none;scrollbar-width:none}.no-scrollbar-mobile::-webkit-scrollbar{display:none}}";const F=class{constructor(t){i(this,t),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.detectedObject=void 0,this.basicEventData=void 0,this.position=["0","0"]}getObjectPosition(){return o.pipe(r.imageBounds,a.map((t=>{const i=h(c(this.detectedObject).rectangle),{x:e,y:n}=o.pipe(i,l(t),d);return[`${e}px`,`${n}px`]})),a.getOrElse((()=>["0","0"])))}selectDetectedObject(){o.pipe(r.imageBounds,a.map((t=>{const i=c(this.detectedObject).rectangle,e=h(i),n=l(t)(e);r.detectedObject=this.detectedObject,r.searchArea=a.some(n)}))),p(),this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject}))}isActive(){if(!this.detectedObject)return!1;if(!r.detectedObject)return!1;const t=c(this.detectedObject),i=c(r.detectedObject);return u.equals(t,i)}render(){return t(n,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};F.style=':host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{display:block;position:absolute;left:calc(var(--x-position));top:calc(var(--y-position));z-index:2}:host::before,:host::after{content:"";cursor:pointer;position:absolute;height:var(--size);width:var(--size);left:calc(-1 * var(--size) / 2);top:calc(-1 * var(--size) / 2)}:host::before{--size:36px;border-radius:50%;z-index:0;background:rgba(0, 0, 0, 0.16);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transition:transform 0.07s ease-in-out}:host::after{--size:13px;border-radius:50%;z-index:1;background:white;box-shadow:0px 2px 2px 0px rgba(0, 0, 0, 0.15);transition:transform 0.07s ease-in-out}:host(.active)::before{transform:scale(0.88);background:rgba(0, 0, 0, 0.4)}:host(.active)::after{transform:scale(0.67)}@media (min-width: 768px){:host(:not(.active):hover)::before{transform:scale(1.08);background:rgba(0, 0, 0, 0.32)}}';const W=class{constructor(t){i(this,t),this.handler=void 0}render(){return t(n,null,t("vviinn-error",null,t(B,null),t("h4",{slot:"title"},z.t("emptyResultsBlock.title")),"image"===r.searchType&&t("button",{slot:"action",onClick:this.handler},z.t("emptyResultsBlock.button"))))}},I=class{constructor(t){i(this,t),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=e(this,"vviinnImageUploadFinished",7),this.vviinnCameraEnabled=e(this,"vviinnCameraEnabled",7),this.videoTrack=null,this.initializeZoom=async()=>{if(!this.videoTrack)return;const t=this.videoTrack.getCapabilities();"zoom"in t&&(this.zoomCapabilities=t.zoom,await this.videoTrack.applyConstraints({advanced:[{zoom:this.zoomCapabilities.min}]}))},this.onZoom=async t=>{var i;if(!this.videoTrack||!this.zoomCapabilities)return;const{max:e,min:n}=this.zoomCapabilities,s=null!==(i=this.videoTrack.getSettings().zoom)&&void 0!==i?i:n,r=Math.round((e-n)/3*10)/10;let o;o="in"===t?s+r:s-r,o<n&&(o=n),o>e&&(o=e),await this.videoTrack.applyConstraints({advanced:[{zoom:o}]})},this.exampleImageSource=void 0,this.width=0,this.height=0,this.basicEventData=void 0,this.srcObject=void 0,this.cameraButtonClicked=!1,this.selected=!1,this.videoInitialized=!1,this.zoomCapabilities=null}componentDidLoad(){this.videoElement=this.el.shadowRoot.getElementById("camera-preview")}createPlaceholderImageCanvas(){const t=this.el.shadowRoot.getElementById("captured-image-placeholder"),i=this.videoElement,{videoWidth:e,videoHeight:n}=i,s=document.createElement("canvas");s.width=e,s.height=n,s.getContext("2d").drawImage(i,0,0,s.width,s.height);const r=s.toDataURL("image/jpeg");t.src=r}async selectImage(){if(!this.srcObject)return;let t;this.vviinnImageUpload.emit(this.basicEventData);const i=this.el.shadowRoot.getElementById("photo-frame"),e=this.videoElement,n=i.getBoundingClientRect(),s=e.getBoundingClientRect(),{videoWidth:r,videoHeight:a}=e,h=document.createElement("canvas");this.selected=!0,this.videoElement.pause(),this.createPlaceholderImageCanvas();const c=r/s.width,l=a/s.height,d=Math.min(n.width*c,n.height*l);h.width=d,h.height=d;const p=(n.left-s.left+(n.width-d/c)/2)*c,u=(n.top-s.top+(n.height-d/l)/2)*l;h.getContext("2d").drawImage(e,p,u,d,d,0,0,h.width,h.height);const g=h.toDataURL("image/jpeg");t=await v(g),o.pipe(await f(t),m.match((()=>this.vviinnNoResult.emit(this.basicEventData)),(()=>this.vviinnImageUploadFinished.emit()))),this.selected=!1,this.videoInitialized=!1,this.vviinnCameraEnabled.emit(!1)}handleKeyPress({key:t}){"Enter"!==t&&" "!==t||this.selectImage()}handleSrcObjectChange(){this.srcObject?(this.videoElement.srcObject=this.srcObject,this.videoTrack=this.srcObject.getVideoTracks()[0],this.initializeZoom(),this.videoElement.onloadedmetadata=()=>{this.vviinnCameraEnabled.emit(!0),this.videoInitialized=!0}):this.videoInitialized=!1}render(){return t(n,{onKeyUp:t=>this.handleKeyPress(t),class:{"video-expanded":this.cameraButtonClicked}},t("video",{id:"camera-preview",class:{hidden:!this.videoInitialized||this.selected},autoplay:!0,playsinline:!0,muted:!0}),t("img",{src:this.exampleImageSource,width:this.width,height:this.height,tabindex:1,class:{hidden:this.videoInitialized||this.selected}}),t("img",{id:"captured-image-placeholder",class:{hidden:!this.selected}}),t("div",{class:"container",id:"container"},t("div",{class:{hidden:!this.videoInitialized},id:"photo-frame"}),this.zoomCapabilities&&this.videoInitialized&&t("div",{class:"buttons-group zoom-buttons"},t("button",{onClick:()=>this.onZoom("out")},t(S,null)),t("button",{onClick:()=>this.onZoom("in")},t(O,null))),t("div",{class:"buttons-group"},t("button",{class:{"photo-button":!0,visible:this.videoInitialized},onClick:()=>this.selectImage()},t(D,null)))))}get el(){return s(this)}static get watchers(){return{srcObject:["handleSrcObjectChange"]}}};I.style=":host{display:block;width:100%;height:100%;min-height:0;position:relative;overflow:hidden;flex-grow:1;transition:min-height 1s}:host(.video-expanded){min-height:100%;transition:min-height 0.8s}img{width:100%;height:100%;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center}#camera-preview{width:100%;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;position:relative}#captured-image-placeholder{height:auto}.container{position:absolute;width:100%;height:96%;left:0;top:0;display:flex;flex-direction:column;padding:56px 25px 0 25px;justify-content:space-around;align-content:center;box-sizing:border-box}@media (min-width: 768px){.container{padding:56px 40px 0 40px}}#photo-frame{position:relative;aspect-ratio:1/1;border:1px solid white;border-radius:10px;background-color:transparent;box-shadow:0 0 0 100vmax rgba(0, 0, 0, 0.32);width:100%;max-width:580px;margin:0 auto}.buttons-group{width:100%;left:0;display:flex;align-items:center}.photo-button{display:none;cursor:pointer;border:none;position:relative;z-index:1;padding:0;color:#6f6f6f;background-color:transparent;-webkit-tap-highlight-color:transparent;line-height:0;margin:0 auto}.zoom-buttons{bottom:168px;justify-content:center;gap:12px}.zoom-buttons button{color:white;display:flex;width:48px;height:48px;padding:8px;justify-content:center;align-items:center;border-radius:var(--radius-radius-md, 8px);background:rgba(0, 0, 0, 0.25);border:none;cursor:pointer}.hidden{display:none}.visible{display:flex}";const R=class{constructor(t){i(this,t),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=e(this,"vviinnImageUploadFinished",7),this.basicEventData=void 0,this.startUpload=void 0,this.loading=!1,this.accept="image",this.resetVpsButton=void 0,this.capture=void 0}async handleInputChange(t){this.vviinnImageUpload.emit(this.basicEventData);const i=t.target,e=await f(i.files[0]);o.pipe(e,g((({kind:t})=>this.vviinnNoResult.emit(Object.assign(Object.assign({},this.basicEventData),{reason:t}))),(()=>this.vviinnImageUploadFinished.emit()))),i.value=null}startUploadWatcher(t){t&&(this.fileInput.click(),this.resetVpsButton())}render(){return t(n,{exportparts:"button"},this.loading?t("vviinn-preloader",null):t("label",{htmlFor:"fileInput",part:"button"},t("slot",{name:"upload-button-text"},"Upload image")),t("input",{id:"fileInput",class:"visually-hidden",type:"file",capture:this.capture,accept:"image"===this.accept?"image/*":"application/octet-stream",onChange:t=>this.handleInputChange(t),ref:t=>this.fileInput=t}))}static get watchers(){return{startUpload:["startUploadWatcher"]}}};R.style=".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}label{cursor:pointer;display:grid;width:100%;height:100%;transition:background 0.1s ease-in-out}";var P=b((function(t){
1
+ import{h as t,r as i,c as e,H as n,g as s}from"./p-1e83e6ba.js";import{s as r,a as o,O as a,q as h,r as c,u as l,v as d,w as p,x as u,y as v,z as f,E as m,B as g,o as b,n as w,C as x,D as y,F as C,G as k,N as M,H as j}from"./p-150f1108.js";import{i as z}from"./p-2e76a5c3.js";import{P as O}from"./p-ff8db3d2.js";import{s as E,c as L}from"./p-49417192.js";const N=()=>t("svg",{width:"12",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z"})),S=()=>t("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M8.00001 17.3333C7.62223 17.3333 7.30556 17.2056 7.05001 16.95C6.79445 16.6944 6.66667 16.3778 6.66667 16C6.66667 15.6222 6.79445 15.3056 7.05001 15.05C7.30556 14.7944 7.62223 14.6667 8.00001 14.6667H24C24.3778 14.6667 24.6944 14.7944 24.95 15.05C25.2056 15.3056 25.3333 15.6222 25.3333 16C25.3333 16.3778 25.2056 16.6944 24.95 16.95C24.6944 17.2056 24.3778 17.3333 24 17.3333H8.00001Z",fill:"currentColor"})),D=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"80",height:"80",viewBox:"0 0 80 80",fill:"none"},t("circle",{cx:"40",cy:"40",r:"36",fill:"white"}),t("circle",{cx:"40",cy:"40",r:"39",fill:"white","fill-opacity":"0.16",stroke:"white","stroke-width":"2"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M48 29.3333H50.6667C53.6133 29.3333 56 31.72 56 34.6667V45.3333H53.3333V34.6667C53.3333 33.2 52.1333 32 50.6667 32H46.5733L45.7867 30.8133L43.9067 28H36.0933L34.2133 30.8133L33.4267 32H29.3333C27.8667 32 26.6667 33.2 26.6667 34.6667V48C26.6667 49.4667 27.8667 50.6667 29.3333 50.6667H36V53.3333H29.3333C26.3867 53.3333 24 50.9467 24 48V34.6667C24 31.72 26.3867 29.3333 29.3333 29.3333H32L34.6667 25.3333H45.3333L48 29.3333ZM40 34.6667C43.68 34.6667 46.6667 37.6533 46.6667 41.3333L46.6533 41.3467C46.6533 42.6933 46.24 43.96 45.5467 45.0133L51.6 51.0667L49.72 52.9467L43.6667 46.8933C42.6133 47.5867 41.36 48 40 48C36.32 48 33.3333 45.0133 33.3333 41.3333C33.3333 37.6533 36.32 34.6667 40 34.6667ZM36 41.3333C36 43.5333 37.8 45.3333 40 45.3333C42.2 45.3333 44 43.5333 44 41.3333C44 39.1333 42.2 37.3333 40 37.3333C37.8 37.3333 36 39.1333 36 41.3333Z",fill:"#161616"})),T=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M7.82499 13L12.725 17.9C12.925 18.1 13.0208 18.3333 13.0125 18.6C13.0042 18.8667 12.9 19.1 12.7 19.3C12.5 19.4833 12.2667 19.5792 12 19.5875C11.7333 19.5958 11.5 19.5 11.3 19.3L4.69999 12.7C4.59999 12.6 4.52915 12.4917 4.48749 12.375C4.44582 12.2583 4.42499 12.1333 4.42499 12C4.42499 11.8667 4.44582 11.7417 4.48749 11.625C4.52915 11.5083 4.59999 11.4 4.69999 11.3L11.3 4.69999C11.4833 4.51665 11.7125 4.42499 11.9875 4.42499C12.2625 4.42499 12.5 4.51665 12.7 4.69999C12.9 4.89999 13 5.13749 13 5.41249C13 5.68749 12.9 5.92499 12.7 6.12499L7.82499 11H19C19.2833 11 19.5208 11.0958 19.7125 11.2875C19.9042 11.4792 20 11.7167 20 12C20 12.2833 19.9042 12.5208 19.7125 12.7125C19.5208 12.9042 19.2833 13 19 13H7.82499Z",fill:"currentColor"})),A=()=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M20.6 4.57C17.39 4.19 16.88 3.68 16.42 0.37C16.38 0.15 16.22 0 16.01 0C15.8 0 15.63 0.15 15.59 0.37C15.12 3.66 14.63 4.13 11.41 4.57C11.17 4.61 11.01 4.77 11.01 5C11.01 5.23 11.17 5.39 11.41 5.42C14.63 5.81 15.14 6.31 15.59 9.62C15.63 9.84 15.8 10 16.01 10C16.22 10 16.39 9.84 16.42 9.62C16.89 6.31 17.39 5.81 20.6 5.42C20.84 5.38 21 5.22 21 5C21 4.78 20.83 4.6 20.6 4.57Z",fill:"#525252"}),t("path",{d:"M14 12C14 9.24 11.76 7 9 7C6.24 7 4 9.24 4 12C4 14.76 6.24 17 9 17C10.02 17 10.96 16.69 11.75 16.17L16.29 20.71L17.7 19.3L13.16 14.76C13.68 13.97 13.99 13.02 13.99 12.01L14 12ZM9 15C7.35 15 6 13.65 6 12C6 10.35 7.35 9 9 9C10.65 9 12 10.35 12 12C12 13.65 10.65 15 9 15Z",fill:"#525252"})),B=()=>t("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z",fill:"#525252"}),t("path",{d:"M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",fill:"#525252"}));const H=(t,i)=>{var e;if(!t)return"";const n={};return t.href.split("?")[1].split("included[]=").join("").split("&").forEach((t=>{const[i,e]=t.split("%3A");n[i]=e})),"categories"===i?null!==(e=n.product_type)&&void 0!==e?e:n.google_product_category:n[i]},_=class{constructor(t){i(this,t),this.vviinnSelectFilter=e(this,"vviinnSelectFilter",7),this.filterType=this.filter.name,this.filter=null,this.basicEventData=void 0,this.selectedFilter="",this.hideFilters=!0}isCategoriesFilterType(){return"categories"===this.filterType}getFilterKind(){return this.isCategoriesFilterType()?"category":this.filterType}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter(t):this.selectFilter(t)}selectFilter(t){r.activeIonLink=t,this.selectedFilter=H(t,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"select",kind:this.getFilterKind()}))}clearSelectedFilter(t){r.activeIonLink=t.clear,this.selectedFilter=H(t.clear,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"deselect",kind:this.getFilterKind()}))}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,i){"Enter"===t.key&&this.handleFilterSelection(i)}isFilterSelected(t){return this.isCategoriesFilterType()?this.selectedFilter===H(t,"categories"):this.selectedFilter===t.name}render(){if(!this.filter)return null;const{name:i,filters:e}=this.filter;return t(n,{exportparts:"filter, show-more-filters"},t("div",{class:{filters:!0,"no-scrollbar-mobile":this.isCategoriesFilterType(),"no-scrollbar":!this.isCategoriesFilterType()}},e.filter(((t,i)=>!this.hideFilters||i<5)).map(((e,n)=>{const s="categories"===i?this.selectedFilter===H(e,"categories"):this.selectedFilter===e.name;return t("div",{role:"button",tabindex:"0",key:n,part:s?"filter active":"filter",class:{filter:!0,active:s},style:{"animation-delay":10*n+"ms"},onPointerUp:t=>{r.loading||(t.stopPropagation(),this.handleFilterSelection(e))},onKeyPress:t=>{r.loading||this.handleEnter(t,e)}},e.name)})),this.hideFilters&&t("div",{class:{"show-more":!0,hidden:e.length<=5,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>{setTimeout((()=>this.toggleFilters()),300)},onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"})))}get el(){return s(this)}};_.style=".filters{display:flex;flex-direction:row;overflow-x:auto;padding:0 12px 12px 24px}.filter{align-items:center;color:#525252;cursor:pointer;display:flex;margin-right:12px;height:-moz-max-content;height:max-content;min-width:-moz-max-content;min-width:max-content;transition-property:background;transition-duration:0.5s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:10px 12px}.show-more{display:flex}.show-more.hidden{display:none !important}.show-more::after{position:relative;content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;transform:rotate(-90deg);left:2px}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}@media (max-width: 768px){.filters{padding-right:54px;padding-bottom:0}}@media (max-width: 640px){.no-scrollbar-mobile{-ms-overflow-style:none;scrollbar-width:none}.no-scrollbar-mobile::-webkit-scrollbar{display:none}}";const F=class{constructor(t){i(this,t),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.detectedObject=void 0,this.basicEventData=void 0,this.position=["0","0"]}getObjectPosition(){return o.pipe(r.imageBounds,a.map((t=>{const i=h(c(this.detectedObject).rectangle),{x:e,y:n}=o.pipe(i,l(t),d);return[`${e}px`,`${n}px`]})),a.getOrElse((()=>["0","0"])))}selectDetectedObject(){o.pipe(r.imageBounds,a.map((t=>{const i=c(this.detectedObject).rectangle,e=h(i),n=l(t)(e);r.detectedObject=this.detectedObject,r.searchArea=a.some(n)}))),p(),this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject}))}isActive(){if(!this.detectedObject)return!1;if(!r.detectedObject)return!1;const t=c(this.detectedObject),i=c(r.detectedObject);return u.equals(t,i)}render(){return t(n,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};F.style=':host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{display:block;position:absolute;left:calc(var(--x-position));top:calc(var(--y-position));z-index:2}:host::before,:host::after{content:"";cursor:pointer;position:absolute;height:var(--size);width:var(--size);left:calc(-1 * var(--size) / 2);top:calc(-1 * var(--size) / 2)}:host::before{--size:36px;border-radius:50%;z-index:0;background:rgba(0, 0, 0, 0.16);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transition:transform 0.07s ease-in-out}:host::after{--size:13px;border-radius:50%;z-index:1;background:white;box-shadow:0px 2px 2px 0px rgba(0, 0, 0, 0.15);transition:transform 0.07s ease-in-out}:host(.active)::before{transform:scale(0.88);background:rgba(0, 0, 0, 0.4)}:host(.active)::after{transform:scale(0.67)}@media (min-width: 768px){:host(:not(.active):hover)::before{transform:scale(1.08);background:rgba(0, 0, 0, 0.32)}}';const W=class{constructor(t){i(this,t),this.handler=void 0}render(){return t(n,null,t("vviinn-error",null,t(B,null),t("h4",{slot:"title"},z.t("emptyResultsBlock.title")),"image"===r.searchType&&t("button",{slot:"action",onClick:this.handler},z.t("emptyResultsBlock.button"))))}},I=class{constructor(t){i(this,t),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=e(this,"vviinnImageUploadFinished",7),this.vviinnCameraEnabled=e(this,"vviinnCameraEnabled",7),this.videoTrack=null,this.initializeZoom=async()=>{if(!this.videoTrack)return;const t=this.videoTrack.getCapabilities();"zoom"in t&&(this.zoomCapabilities=t.zoom,await this.videoTrack.applyConstraints({advanced:[{zoom:this.zoomCapabilities.min}]}))},this.onZoom=async t=>{var i;if(!this.videoTrack||!this.zoomCapabilities)return;const{max:e,min:n}=this.zoomCapabilities,s=null!==(i=this.videoTrack.getSettings().zoom)&&void 0!==i?i:n,r=Math.round((e-n)/3*10)/10;let o;o="in"===t?s+r:s-r,o<n&&(o=n),o>e&&(o=e),await this.videoTrack.applyConstraints({advanced:[{zoom:o}]})},this.exampleImageSource=void 0,this.width=0,this.height=0,this.basicEventData=void 0,this.srcObject=void 0,this.cameraButtonClicked=!1,this.selected=!1,this.videoInitialized=!1,this.zoomCapabilities=null}componentDidLoad(){this.videoElement=this.el.shadowRoot.getElementById("camera-preview")}createPlaceholderImageCanvas(){const t=this.el.shadowRoot.getElementById("captured-image-placeholder"),i=this.videoElement,{videoWidth:e,videoHeight:n}=i,s=document.createElement("canvas");s.width=e,s.height=n,s.getContext("2d").drawImage(i,0,0,s.width,s.height);const r=s.toDataURL("image/jpeg");t.src=r}async selectImage(){if(!this.srcObject)return;let t;this.vviinnImageUpload.emit(this.basicEventData);const i=this.el.shadowRoot.getElementById("photo-frame"),e=this.videoElement,n=i.getBoundingClientRect(),s=e.getBoundingClientRect(),{videoWidth:r,videoHeight:a}=e,h=document.createElement("canvas");this.selected=!0,this.videoElement.pause(),this.createPlaceholderImageCanvas();const c=r/s.width,l=a/s.height,d=Math.min(n.width*c,n.height*l);h.width=d,h.height=d;const p=(n.left-s.left+(n.width-d/c)/2)*c,u=(n.top-s.top+(n.height-d/l)/2)*l;h.getContext("2d").drawImage(e,p,u,d,d,0,0,h.width,h.height);const g=h.toDataURL("image/jpeg");t=await v(g),o.pipe(await f(t),m.match((()=>this.vviinnNoResult.emit(this.basicEventData)),(()=>this.vviinnImageUploadFinished.emit()))),this.selected=!1,this.videoInitialized=!1,this.vviinnCameraEnabled.emit(!1)}handleKeyPress({key:t}){"Enter"!==t&&" "!==t||this.selectImage()}handleSrcObjectChange(){this.srcObject?(this.videoElement.srcObject=this.srcObject,this.videoTrack=this.srcObject.getVideoTracks()[0],this.initializeZoom(),this.videoElement.onloadedmetadata=()=>{this.vviinnCameraEnabled.emit(!0),this.videoInitialized=!0}):this.videoInitialized=!1}render(){return t(n,{onKeyUp:t=>this.handleKeyPress(t),class:{"video-expanded":this.cameraButtonClicked}},t("video",{id:"camera-preview",class:{hidden:!this.videoInitialized||this.selected},autoplay:!0,playsinline:!0,muted:!0}),t("img",{src:this.exampleImageSource,width:this.width,height:this.height,tabindex:1,class:{hidden:this.videoInitialized||this.selected}}),t("img",{id:"captured-image-placeholder",class:{hidden:!this.selected}}),t("div",{class:"container",id:"container"},t("div",{class:{hidden:!this.videoInitialized},id:"photo-frame"}),this.zoomCapabilities&&this.videoInitialized&&t("div",{class:"buttons-group zoom-buttons"},t("button",{onClick:()=>this.onZoom("out")},t(S,null)),t("button",{onClick:()=>this.onZoom("in")},t(O,null))),t("div",{class:"buttons-group"},t("button",{class:{"photo-button":!0,visible:this.videoInitialized},onClick:()=>this.selectImage()},t(D,null)))))}get el(){return s(this)}static get watchers(){return{srcObject:["handleSrcObjectChange"]}}};I.style=":host{display:block;width:100%;height:100%;min-height:0;position:relative;overflow:hidden;flex-grow:1;transition:min-height 1s}:host(.video-expanded){min-height:100%;transition:min-height 0.8s}img{width:100%;height:100%;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center}#camera-preview{width:100%;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;position:relative}#captured-image-placeholder{height:auto}.container{position:absolute;width:100%;height:96%;left:0;top:0;display:flex;flex-direction:column;padding:56px 25px 0 25px;justify-content:space-around;align-content:center;box-sizing:border-box}@media (min-width: 768px){.container{padding:56px 40px 0 40px}}#photo-frame{position:relative;aspect-ratio:1/1;border:1px solid white;border-radius:10px;background-color:transparent;box-shadow:0 0 0 100vmax rgba(0, 0, 0, 0.32);width:100%;max-width:580px;margin:0 auto}.buttons-group{width:100%;left:0;display:flex;align-items:center}.photo-button{display:none;cursor:pointer;border:none;position:relative;z-index:1;padding:0;color:#6f6f6f;background-color:transparent;-webkit-tap-highlight-color:transparent;line-height:0;margin:0 auto}.zoom-buttons{bottom:168px;justify-content:center;gap:12px}.zoom-buttons button{color:white;display:flex;width:48px;height:48px;padding:8px;justify-content:center;align-items:center;border-radius:var(--radius-radius-md, 8px);background:rgba(0, 0, 0, 0.25);border:none;cursor:pointer}.hidden{display:none}.visible{display:flex}";const R=class{constructor(t){i(this,t),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=e(this,"vviinnImageUploadFinished",7),this.basicEventData=void 0,this.startUpload=void 0,this.loading=!1,this.accept="image",this.resetVpsButton=void 0,this.capture=void 0}async handleInputChange(t){this.vviinnImageUpload.emit(this.basicEventData);const i=t.target,e=await f(i.files[0]);o.pipe(e,g((({kind:t})=>this.vviinnNoResult.emit(Object.assign(Object.assign({},this.basicEventData),{reason:t}))),(()=>this.vviinnImageUploadFinished.emit()))),i.value=null}startUploadWatcher(t){t&&(this.fileInput.click(),this.resetVpsButton())}render(){return t(n,{exportparts:"button"},this.loading?t("vviinn-preloader",null):t("label",{htmlFor:"fileInput",part:"button"},t("slot",{name:"upload-button-text"},"Upload image")),t("input",{id:"fileInput",class:"visually-hidden",type:"file",capture:this.capture,accept:"image"===this.accept?"image/*":"application/octet-stream",onChange:t=>this.handleInputChange(t),ref:t=>this.fileInput=t}))}static get watchers(){return{startUpload:["startUploadWatcher"]}}};R.style=".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}label{cursor:pointer;display:grid;width:100%;height:100%;transition:background 0.1s ease-in-out}";var P=b((function(t){
2
2
  /*!
3
3
  * Cropper.js v1.5.13
4
4
  * https://fengyuanchen.github.io/cropperjs