vviinn-widgets 2.147.0 → 2.148.0
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.
- package/dist/cjs/{package-be3b6479.js → package-ba3c2037.js} +1 -1
- package/dist/cjs/search-filters_13.cjs.entry.js +3 -2
- package/dist/cjs/vviinn-carousel_9.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-detected-object_7.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-text-search.cjs.entry.js +10 -8
- package/dist/collection/components/vviinn-camera/vviinn-camera.js +2 -1
- package/dist/collection/components/vviinn-text-search/vviinn-text-search.js +10 -8
- package/dist/esm/{package-8b59911b.js → package-8e84d41c.js} +1 -1
- package/dist/esm/search-filters_13.entry.js +3 -2
- package/dist/esm/vviinn-carousel_9.entry.js +1 -1
- package/dist/esm/vviinn-detected-object_7.entry.js +1 -1
- package/dist/esm/vviinn-text-search.entry.js +10 -8
- package/dist/vviinn-widgets/{p-372800cd.entry.js → p-292fb8ee.entry.js} +1 -1
- package/dist/vviinn-widgets/p-2c8b8407.entry.js +1 -0
- package/{www/build/p-210e23ca.entry.js → dist/vviinn-widgets/p-92d9bce8.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-dc294125.entry.js → p-95d88be2.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-6ce0e94b.js → p-ff6a652d.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/{p-372800cd.entry.js → p-292fb8ee.entry.js} +1 -1
- package/www/build/p-2c8b8407.entry.js +1 -0
- package/{dist/vviinn-widgets/p-210e23ca.entry.js → www/build/p-92d9bce8.entry.js} +1 -1
- package/www/build/{p-dc294125.entry.js → p-95d88be2.entry.js} +1 -1
- package/www/build/{p-6ce0e94b.js → p-ff6a652d.js} +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/dist/vviinn-widgets/p-156807de.entry.js +0 -1
- package/www/build/p-156807de.entry.js +0 -1
|
@@ -7,7 +7,7 @@ const search_store = require('./search.store-f6717a99.js');
|
|
|
7
7
|
const customizedSlots = require('./customized-slots-93d9f5c9.js');
|
|
8
8
|
const index$1 = require('./index-ab40eb55.js');
|
|
9
9
|
const Rectangle = require('./Rectangle-99c25901.js');
|
|
10
|
-
const _package = require('./package-
|
|
10
|
+
const _package = require('./package-ba3c2037.js');
|
|
11
11
|
const i18next = require('./i18next-74ff3413.js');
|
|
12
12
|
const resources = require('./resources-f8c5d64c.js');
|
|
13
13
|
const index$2 = require('./index-9ea9f6a5.js');
|
|
@@ -175,11 +175,12 @@ const VviinnExampleImage = class {
|
|
|
175
175
|
const { max, min } = this.zoomCapabilities;
|
|
176
176
|
const currentSettings = this.videoTrack.getSettings();
|
|
177
177
|
const currentZoom = (_a = currentSettings.zoom) !== null && _a !== void 0 ? _a : min;
|
|
178
|
-
const step = (max - min) /
|
|
178
|
+
const step = (max - min) / 5;
|
|
179
179
|
const roundedStep = Math.round(step * 10) / 10;
|
|
180
180
|
let newZoom;
|
|
181
181
|
newZoom =
|
|
182
182
|
action === "in" ? currentZoom + roundedStep : currentZoom - roundedStep;
|
|
183
|
+
newZoom = action === "in" && currentZoom < 1 ? 1 : newZoom;
|
|
183
184
|
if (newZoom < min)
|
|
184
185
|
newZoom = min;
|
|
185
186
|
if (newZoom > max)
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-711d38e6.js');
|
|
6
6
|
const search_store = require('./search.store-f6717a99.js');
|
|
7
|
-
const _package = require('./package-
|
|
7
|
+
const _package = require('./package-ba3c2037.js');
|
|
8
8
|
const index$1 = require('./index-ab40eb55.js');
|
|
9
9
|
const i18next = require('./i18next-74ff3413.js');
|
|
10
10
|
const customizedSlots = require('./customized-slots-93d9f5c9.js');
|
|
@@ -8,7 +8,7 @@ const Rectangle = require('./Rectangle-99c25901.js');
|
|
|
8
8
|
const i18next = require('./i18next-74ff3413.js');
|
|
9
9
|
const WarningIcon = require('./WarningIcon-65f4b692.js');
|
|
10
10
|
const customizedSlots = require('./customized-slots-93d9f5c9.js');
|
|
11
|
-
const _package = require('./package-
|
|
11
|
+
const _package = require('./package-ba3c2037.js');
|
|
12
12
|
const index$1 = require('./index-9ea9f6a5.js');
|
|
13
13
|
|
|
14
14
|
const SecondaryActionIcon = () => (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
|
|
@@ -205,14 +205,16 @@ const VviinnTextSearch = class {
|
|
|
205
205
|
return;
|
|
206
206
|
this.trackTextSearch();
|
|
207
207
|
if (this.showInWidget) {
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
208
|
+
const response = search_store._function.pipe(await search_store.makeTextSearchRequest(this.storeName, this.searchQuery), search_store.getOrElse(() => null), (response) => response);
|
|
209
|
+
if (response) {
|
|
210
|
+
this.widgetTextSearchFinished.emit({
|
|
211
|
+
query: this.searchQuery,
|
|
212
|
+
requestId: response.requestId,
|
|
213
|
+
});
|
|
214
|
+
this.vviinnSelectedFiltersReset.emit({
|
|
215
|
+
isTriggeredByVpsWidget: this.showInWidget,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
216
218
|
}
|
|
217
219
|
else {
|
|
218
220
|
this.showLoader();
|
|
@@ -29,11 +29,12 @@ export class VviinnExampleImage {
|
|
|
29
29
|
const { max, min } = this.zoomCapabilities;
|
|
30
30
|
const currentSettings = this.videoTrack.getSettings();
|
|
31
31
|
const currentZoom = (_a = currentSettings.zoom) !== null && _a !== void 0 ? _a : min;
|
|
32
|
-
const step = (max - min) /
|
|
32
|
+
const step = (max - min) / 5;
|
|
33
33
|
const roundedStep = Math.round(step * 10) / 10;
|
|
34
34
|
let newZoom;
|
|
35
35
|
newZoom =
|
|
36
36
|
action === "in" ? currentZoom + roundedStep : currentZoom - roundedStep;
|
|
37
|
+
newZoom = action === "in" && currentZoom < 1 ? 1 : newZoom;
|
|
37
38
|
if (newZoom < min)
|
|
38
39
|
newZoom = min;
|
|
39
40
|
if (newZoom > max)
|
|
@@ -127,14 +127,16 @@ export class VviinnTextSearch {
|
|
|
127
127
|
return;
|
|
128
128
|
this.trackTextSearch();
|
|
129
129
|
if (this.showInWidget) {
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
const response = pipe(await makeTextSearchRequest(this.storeName, this.searchQuery), E.getOrElse(() => null), (response) => response);
|
|
131
|
+
if (response) {
|
|
132
|
+
this.widgetTextSearchFinished.emit({
|
|
133
|
+
query: this.searchQuery,
|
|
134
|
+
requestId: response.requestId,
|
|
135
|
+
});
|
|
136
|
+
this.vviinnSelectedFiltersReset.emit({
|
|
137
|
+
isTriggeredByVpsWidget: this.showInWidget,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
138
140
|
}
|
|
139
141
|
else {
|
|
140
142
|
this.showLoader();
|
|
@@ -3,7 +3,7 @@ import { s as searchState, k as toFile, _ as _function, l as processSelectedFile
|
|
|
3
3
|
import { s as slotChangeListener, p as productCardSlotNames, v as vprIconSlotName, S as SlotSkeleton } from './customized-slots-790b647b.js';
|
|
4
4
|
import { P as PlusIcon, l as createFilterEvent, c as createTrackingApi, v as v4, m as createResultEventByType, n as createProductWidgetEventByType, g as getCustomLabels, o as createSearchEvent, p as createWidgetVpsEvent } from './index-f0086ec6.js';
|
|
5
5
|
import { f as fromImage } from './Rectangle-6e69b807.js';
|
|
6
|
-
import { c as campaignTypeNames, v as version } from './package-
|
|
6
|
+
import { c as campaignTypeNames, v as version } from './package-8e84d41c.js';
|
|
7
7
|
import { i as instance } from './i18next-387f2b0a.js';
|
|
8
8
|
import { r as resources } from './resources-d6b679c9.js';
|
|
9
9
|
import { a as productCardParts, m as modalParts, f as filtersParts, b as extendedFiltersParts, s as searchBarParts, c as searchWidgetFilterParts, d as searchWidgetButtonParts } from './index-f39001f9.js';
|
|
@@ -171,11 +171,12 @@ const VviinnExampleImage = class {
|
|
|
171
171
|
const { max, min } = this.zoomCapabilities;
|
|
172
172
|
const currentSettings = this.videoTrack.getSettings();
|
|
173
173
|
const currentZoom = (_a = currentSettings.zoom) !== null && _a !== void 0 ? _a : min;
|
|
174
|
-
const step = (max - min) /
|
|
174
|
+
const step = (max - min) / 5;
|
|
175
175
|
const roundedStep = Math.round(step * 10) / 10;
|
|
176
176
|
let newZoom;
|
|
177
177
|
newZoom =
|
|
178
178
|
action === "in" ? currentZoom + roundedStep : currentZoom - roundedStep;
|
|
179
|
+
newZoom = action === "in" && currentZoom < 1 ? 1 : newZoom;
|
|
179
180
|
if (newZoom < min)
|
|
180
181
|
newZoom = min;
|
|
181
182
|
if (newZoom > max)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement, F as Fragment } from './index-8e1dd483.js';
|
|
2
2
|
import { _ as _function, a as _Array, h as has, t as tuple, s as searchState, c as componentsState, O as Option, S as Semigroup, E as Either, p as pipe, b as chainW, m as makeRequest, f as fromEither, g as getApiPath, d as createInitPostRequest, A as Apply, e as state, T as TaskEither } from './search.store-92ec2832.js';
|
|
3
|
-
import { c as campaignTypeNames, f as fromString, a as fold, v as version } from './package-
|
|
3
|
+
import { c as campaignTypeNames, f as fromString, a as fold, v as version } from './package-8e84d41c.js';
|
|
4
4
|
import { g as getCustomLabels, P as PlusIcon, v as v4, c as createTrackingApi, a as createAddToBasketVpcEvent, b as createAddToBasketVprEvent, d as createWidgetVpcEvent, e as createWidgetVprEvent, f as createResultVpcEventByType, h as createResultVprEventByType, i as createProductVpcEventByType, j as createProductVprEventByType, k as getRecommendationsBody } from './index-f0086ec6.js';
|
|
5
5
|
import { i as instance } from './i18next-387f2b0a.js';
|
|
6
6
|
import { s as slotChangeListener, S as SlotSkeleton } from './customized-slots-790b647b.js';
|
|
@@ -4,7 +4,7 @@ import { a as fromAlt, s as scaleWithSized, c as center } from './Rectangle-6e69
|
|
|
4
4
|
import { i as instance } from './i18next-387f2b0a.js';
|
|
5
5
|
import { W as WarningIcon } from './WarningIcon-f5ee2147.js';
|
|
6
6
|
import { s as slotChangeListener } from './customized-slots-790b647b.js';
|
|
7
|
-
import { c as campaignTypeNames, v as version } from './package-
|
|
7
|
+
import { c as campaignTypeNames, v as version } from './package-8e84d41c.js';
|
|
8
8
|
import { m as modalParts } from './index-f39001f9.js';
|
|
9
9
|
|
|
10
10
|
const SecondaryActionIcon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
|
|
@@ -201,14 +201,16 @@ const VviinnTextSearch = class {
|
|
|
201
201
|
return;
|
|
202
202
|
this.trackTextSearch();
|
|
203
203
|
if (this.showInWidget) {
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
204
|
+
const response = _function.pipe(await makeTextSearchRequest(this.storeName, this.searchQuery), getOrElse(() => null), (response) => response);
|
|
205
|
+
if (response) {
|
|
206
|
+
this.widgetTextSearchFinished.emit({
|
|
207
|
+
query: this.searchQuery,
|
|
208
|
+
requestId: response.requestId,
|
|
209
|
+
});
|
|
210
|
+
this.vviinnSelectedFiltersReset.emit({
|
|
211
|
+
isTriggeredByVpsWidget: this.showInWidget,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
212
214
|
}
|
|
213
215
|
else {
|
|
214
216
|
this.showLoader();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as o,H as i,g as r}from"./p-c3953cbf.js";import{_ as s,O as n,B as a,n as l,C as c,s as h,o as d}from"./p-e060a21e.js";import{a as p,s as f,c as b}from"./p-f2d58f7d.js";import{i as g}from"./p-2e76a5c3.js";import{W as u}from"./p-b2aa3af6.js";import{s as x}from"./p-43e147d6.js";import{c as v,v as m}from"./p-6ce0e94b.js";import{m as w}from"./p-1f0dc75e.js";const C=()=>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"})),y=({width:e=24,height:o=24})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:o,viewBox:"0 0 24 24",fill:"currentColor"},t("path",{d:"M4 16V15H2V16C2 19.31 4.69 22 8 22H9V20H8C5.79 20 4 18.21 4 16Z"}),t("path",{d:"M4 8C4 5.79 5.79 4 8 4H9V2H8C4.69 2 2 4.69 2 8V9H4V8Z"}),t("path",{d:"M20 8C20 5.79 18.21 4 16 4H15V2H16C19.31 2 22 4.69 22 8V9H20V8Z"}),t("path",{d:"M20 16C20 18.21 18.21 20 16 20H15V22H16C19.31 22 22 19.31 22 16V15H20V16Z"}),t("path",{d:"M9 8H7C6.45 8 6 8.45 6 9C6 9.55 6.45 10 7 10H9V11C9 11.55 9.45 12 10 12C10.55 12 11 11.55 11 11V7C11 6.45 10.55 6 10 6C9.45 6 9 6.45 9 7V8Z"}),t("path",{d:"M15 16H17C17.55 16 18 15.55 18 15C18 14.45 17.55 14 17 14H15V13C15 12.45 14.55 12 14 12C13.45 12 13 12.45 13 13V17C13 17.55 13.45 18 14 18C14.55 18 15 17.55 15 17V16Z"}),t("path",{d:"M16 9C16 8.45 15.55 8 15 8H12V10H15C15.55 10 16 9.55 16 9Z"}),t("path",{d:"M6 15C6 15.55 6.45 16 7 16H12V14H7C6.45 14 6 14.45 6 15Z"})),k=({width:e=24,height:o=24})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:o,viewBox:"0 0 24 24",fill:"currentColor"},t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20 13C20 13.55 20.45 14 21 14C21.55 14 22 13.55 22 13V5C22 3.35 20.65 2 19 2H11C10.45 2 10 2.45 10 3C10 3.55 10.45 4 11 4H19C19.55 4 20 4.45 20 5V13ZM2 19C2 20.65 3.35 22 5 22H13C13.55 22 14 21.55 14 21C14 20.45 13.55 20 13 20H5C4.45 20 4 19.55 4 19V11C4 10.45 3.55 10 3 10C2.45 10 2 10.45 2 11V19ZM12 16C11.45 16 11 15.55 11 15V13H9C8.45 13 8 12.55 8 12C8 11.45 8.45 11 9 11H11V9C11 8.45 11.45 8 12 8C12.55 8 13 8.45 13 9V11H15C15.55 11 16 11.45 16 12C16 12.55 15.55 13 15 13H13V15C13 15.55 12.55 16 12 16Z"})),z=class{constructor(t){e(this,t),this.vviinnSelectObject=o(this,"vviinnSelectObject",7),this.detectedObject=void 0,this.selectedDetectedObject=void 0,this.basicEventData=void 0,this.imageBounds=void 0,this.showInWidget=void 0,this.position=["0","0"]}connectedCallback(){this.storeName=this.showInWidget?"widget":"components"}getObjectPosition(){return s.pipe(n.fromNullable(this.imageBounds),n.map((t=>{const e=p(a(this.detectedObject).rectangle),{x:o,y:i}=s.pipe(e,f(t),b);return[`${o}px`,`${i}px`]})),n.getOrElse((()=>["0","0"])))}selectDetectedObject(){const t=s.pipe(n.fromNullable(this.imageBounds),n.map((t=>{const e=a(this.detectedObject).rectangle,o=p(e);return f(t)(o)})),n.toNullable);l(this.storeName,t,this.imageBounds),this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject,searchArea:t}))}isActive(){if(!this.detectedObject||!this.selectedDetectedObject)return!1;const t=a(this.detectedObject),e=a(this.selectedDetectedObject);return c.equals(t,e)}render(){return t(i,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};z.style=':host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-size:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#525252;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;}: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 V=class{constructor(t){e(this,t),this.handler=void 0}render(){return t(i,null,t("vviinn-error",null,t(u,null),t("h4",{slot:"title"},g.t("emptyResultsBlock.title")),"image"===h.searchType&&t("button",{slot:"action",onClick:this.handler},g.t("emptyResultsBlock.button"))))}},H=class{constructor(t){e(this,t),this.vviinnWidgetClose=o(this,"vviinnWidgetClose",7),this.active=!1,this.resetState=void 0,this.buttonElementId=void 0,this.widgetVersion=void 0,this.hideBackButton=!1,this.isFirstScreen=void 0,this.slider=!1}componentWillLoad(){x(this,this.el)}resetTopScroll(){const t=this.el.shadowRoot.querySelector(".body");null==t||t.scroll({top:0})}close(){this.active=!1,setTimeout((()=>{this.vviinnWidgetClose.emit({widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:v.VPS,widgetId:this.buttonElementId,widgetVersion:this.widgetVersion})}),this.slider?500:0)}handleAnimationEnd(t){"fade-in"===t.animationName&&(this.slider=!0)}render(){return t(i,{exportparts:w,class:{closed:!this.active,"first-screen":this.isFirstScreen},onAnimationEnd:t=>this.handleAnimationEnd(t)},t("div",{class:"head"},!this.hideBackButton&&t("button",{part:"secondary-action",onClick:()=>{this.resetState(),this.resetTopScroll()}},t(C,null)),t("div",{class:"title",part:"results-title"},s.pipe(d(h.image),n.map((([e])=>t("img",{width:"28",height:"28",src:e.src,class:"title-image"}))),n.getOrElse((()=>null))),t("slot",{name:"vviinn-image-search-modal-title"},g.t("imageSearchModalTitle"))),t("button",{onClick:()=>this.close(),class:"close-button",part:"close-button"},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M12 13.3892L6.91958 18.4696C6.72248 18.6667 6.49095 18.7653 6.225 18.7653C5.95905 18.7653 5.72753 18.6667 5.53043 18.4696C5.33333 18.2725 5.23478 18.041 5.23478 17.775C5.23478 17.5091 5.33333 17.2776 5.53043 17.0805L10.6109 12L5.53043 6.9196C5.33333 6.7225 5.23478 6.49098 5.23478 6.22503C5.23478 5.95908 5.33333 5.72755 5.53043 5.53045C5.72753 5.33335 5.95905 5.2348 6.225 5.2348C6.49095 5.2348 6.72248 5.33335 6.91958 5.53045L12 10.6109L17.0804 5.53045C17.2775 5.33335 17.5091 5.2348 17.775 5.2348C18.041 5.2348 18.2725 5.33335 18.4696 5.53045C18.6667 5.72755 18.7652 5.95908 18.7652 6.22503C18.7652 6.49098 18.6667 6.7225 18.4696 6.9196L13.3892 12L18.4696 17.0805C18.6667 17.2776 18.7652 17.5091 18.7652 17.775C18.7652 18.041 18.6667 18.2725 18.4696 18.4696C18.2725 18.6667 18.041 18.7653 17.775 18.7653C17.5091 18.7653 17.2775 18.6667 17.0804 18.4696L12 13.3892Z",fill:"currentColor"})))),t("div",{class:"body"},t("slot",null)))}get el(){return r(this)}};H.style=":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-size:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#525252;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;}:host{background:white;border-radius:var(--modal-border-radius, var(--border-radius-300));box-sizing:border-box;display:grid;grid-template-rows:min-content auto;max-width:960px;overflow:auto;position:relative}.head{font-family:var(--font-family, var(--font-family-base));position:absolute;width:100%;box-sizing:border-box;display:flex;align-items:center;z-index:1;padding:16px}.title{display:flex;align-items:center;transform:translateX(-6px);font-weight:var(--font-weight-600);font-size:18px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:6px;color:#8d8d8d}button:hover{color:#000}@media (max-width: 768px){:host{animation-name:fade-in;animation-duration:0.5s;animation-fill-mode:forwards;border-radius:24px 24px 0 0}:host(.closed){animation-name:fade-out;animation-fill-mode:none}.head{z-index:1}:host(:not(.first-screen)) .head{position:sticky;background:#ffffff}.body{overflow-y:auto}:host(:not(.first-screen)) .body{padding-bottom:160px}.title{color:#161616;display:flex;align-items:center;font-weight:500;font-size:16px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;color:#6f6f6f;padding:0}button:hover{color:#000}:host(.first-screen) button,:host(.first-screen) button:hover{color:white}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";const j=class{constructor(t){e(this,t)}render(){return t(i,null,t("slot",null))}};j.style=":host{animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";const L=class{constructor(t){e(this,t)}render(){return t(i,null)}};L.style=":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:flex;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";const M=class{constructor(t){e(this,t),this.vviinnWidgetLoad=o(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=o(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=o(this,"vviinnWidgetClose",7),this.vviinnProductLoad=o(this,"vviinnProductLoad",7),this.vviinnProductClick=o(this,"vviinnProductClick",7),this.vviinnProductView=o(this,"vviinnProductView",7),this.vviinnResultLoad=o(this,"vviinnResultLoad",7),this.vviinnResultView=o(this,"vviinnResultView",7),this.vviinnNoResult=o(this,"vviinnNoResult",7),this.vviinnAddToBasket=o(this,"vviinnAddToBasket",7),this.sidebar=null,this.sidebarCloseListener=()=>{this.targetAppendSidebarTo?this.targetAppendSidebarTo.removeChild(this.sidebar):document.body.removeChild(this.sidebar)},this.token=void 0,this.productId=void 0,this.mode="continuity",this.campaigns="",this.excluded="",this.campaignType="set"===this.mode?"VCS":"VPR",this.locale="de-DE",this.color="",this.imageWidth=300,this.imageRatio=1,this.setItemsAmount=4,this.cssUrl=null,this.currencySign="€",this.pricePrefix="",this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.productDetailsNewTab=!1,this.productDetailsRedirect=!0,this.addToBasketShow=!1,this.showFilters=!1,this.addPriceContainer=!1,this.setModeDiscounts="set"===this.mode?"5, 10, 15":"",this.updateButtonLocation="topAndItem",this.sidebarTitle="set"===this.mode?"":"Similar products",this.modalScrollbar=!1,this.position="bottom",this.addStyle=!0,this.appendSidebarTo=void 0,this.favoriteShow=!1,this.appendSidebarToElement=void 0,this.oneClickDiscoveryMode="standalone",this.apiPath="https://api.vviinn.com",this.showInWidget=!1,this.targetAppendSidebarTo=void 0}connectedCallback(){this.iconSideSize="standalone"===this.oneClickDiscoveryMode?24:14}componentWillLoad(){this.appendSidebarToElement?this.targetAppendSidebarTo=this.appendSidebarToElement:this.appendSidebarTo&&(this.targetAppendSidebarTo=document.getElementById(this.appendSidebarTo))}appendSidebarToElementWatcher(){this.appendSidebarToElement&&(this.targetAppendSidebarTo=this.appendSidebarToElement)}render(){return t(i,{onClick:()=>{this.appendSidebarTo&&!this.targetAppendSidebarTo?setTimeout((()=>{this.handleClick()}),250):this.handleClick()},role:"button",tabindex:"0"},t("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},t("slot",null,t("VCS"===this.campaignType?k:y,{width:this.iconSideSize,height:this.iconSideSize}))))}handleClick(){const t=document.createElement("vviinn-recommendations-sidebar");if(t.sidebarTitle=this.sidebarTitle,t.productId=this.productId,t.token=this.token,t.position=this.position,t.widgetScrollbar=this.modalScrollbar,t.campaigns=this.campaigns,t.campaignType=this.campaignType,t.color=this.color,t.locale=this.locale,t.imageWidth=this.imageWidth,t.currencySign=this.currencySign,t.pricePrefix=this.pricePrefix,t.apiPath=this.apiPath,t.buttonElementId=this.el.id,t.noResultText=this.noResultText,t.noResultShow=this.noResultShow,t.gridArrowsDynamic=this.gridArrowsDynamic,t.productDetailsNewTab=this.productDetailsNewTab,t.productDetailsRedirect=this.productDetailsRedirect,t.widgetVersion=m,t.showingInButton=!0,t.excluded=this.excluded,t.addToBasketShow=this.addToBasketShow,t.buttonChildren=this.el.children,t.showFilters=this.showFilters,t.cssUrl=this.cssUrl,t.imageRatio=this.imageRatio,t.setItemsAmount=this.setItemsAmount,t.setModeDiscounts=this.setModeDiscounts,t.updateButtonLocation=this.updateButtonLocation,t.addPriceContainer=this.addPriceContainer,t.favoriteShow=this.favoriteShow,t.showInModal="modal"===this.oneClickDiscoveryMode,this.targetAppendSidebarTo?(t.mode="grid",t.useCarousel="append-slider"===this.oneClickDiscoveryMode):(t.mode="right"===this.position?"grid":this.mode,t.useCarousel="bottom"===this.position),this.sidebar=t,t.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),this.targetAppendSidebarTo)return this.sidebar.showInCustomContainer=!0,this.targetAppendSidebarTo.innerHTML="",void this.targetAppendSidebarTo.append(this.sidebar);document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&this.sidebar.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener)}get el(){return r(this)}static get watchers(){return{appendSidebarToElement:["appendSidebarToElementWatcher"]}}};M.style=":host{display:block}";const Z=class{constructor(t){e(this,t),this.handler=void 0}render(){return t(i,null,t("vviinn-error",null,t(u,null),t("h4",{slot:"title"},g.t("wrongAspectRatioBlock.title")),t("button",{slot:"action",onClick:this.handler},g.t("wrongAspectRatioBlock.button"))))}};export{z as vviinn_detected_object,V as vviinn_empty_results,H as vviinn_modal,j as vviinn_overlay,L as vviinn_preloader,M as vviinn_vpr_button,Z as vviinn_wrong_aspect_ratio}
|
|
1
|
+
import{h as t,r as e,c as o,H as i,g as r}from"./p-c3953cbf.js";import{_ as s,O as n,B as a,n as l,C as c,s as h,o as d}from"./p-e060a21e.js";import{a as p,s as f,c as b}from"./p-f2d58f7d.js";import{i as g}from"./p-2e76a5c3.js";import{W as u}from"./p-b2aa3af6.js";import{s as x}from"./p-43e147d6.js";import{c as v,v as m}from"./p-ff6a652d.js";import{m as w}from"./p-1f0dc75e.js";const C=()=>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"})),y=({width:e=24,height:o=24})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:o,viewBox:"0 0 24 24",fill:"currentColor"},t("path",{d:"M4 16V15H2V16C2 19.31 4.69 22 8 22H9V20H8C5.79 20 4 18.21 4 16Z"}),t("path",{d:"M4 8C4 5.79 5.79 4 8 4H9V2H8C4.69 2 2 4.69 2 8V9H4V8Z"}),t("path",{d:"M20 8C20 5.79 18.21 4 16 4H15V2H16C19.31 2 22 4.69 22 8V9H20V8Z"}),t("path",{d:"M20 16C20 18.21 18.21 20 16 20H15V22H16C19.31 22 22 19.31 22 16V15H20V16Z"}),t("path",{d:"M9 8H7C6.45 8 6 8.45 6 9C6 9.55 6.45 10 7 10H9V11C9 11.55 9.45 12 10 12C10.55 12 11 11.55 11 11V7C11 6.45 10.55 6 10 6C9.45 6 9 6.45 9 7V8Z"}),t("path",{d:"M15 16H17C17.55 16 18 15.55 18 15C18 14.45 17.55 14 17 14H15V13C15 12.45 14.55 12 14 12C13.45 12 13 12.45 13 13V17C13 17.55 13.45 18 14 18C14.55 18 15 17.55 15 17V16Z"}),t("path",{d:"M16 9C16 8.45 15.55 8 15 8H12V10H15C15.55 10 16 9.55 16 9Z"}),t("path",{d:"M6 15C6 15.55 6.45 16 7 16H12V14H7C6.45 14 6 14.45 6 15Z"})),k=({width:e=24,height:o=24})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:o,viewBox:"0 0 24 24",fill:"currentColor"},t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20 13C20 13.55 20.45 14 21 14C21.55 14 22 13.55 22 13V5C22 3.35 20.65 2 19 2H11C10.45 2 10 2.45 10 3C10 3.55 10.45 4 11 4H19C19.55 4 20 4.45 20 5V13ZM2 19C2 20.65 3.35 22 5 22H13C13.55 22 14 21.55 14 21C14 20.45 13.55 20 13 20H5C4.45 20 4 19.55 4 19V11C4 10.45 3.55 10 3 10C2.45 10 2 10.45 2 11V19ZM12 16C11.45 16 11 15.55 11 15V13H9C8.45 13 8 12.55 8 12C8 11.45 8.45 11 9 11H11V9C11 8.45 11.45 8 12 8C12.55 8 13 8.45 13 9V11H15C15.55 11 16 11.45 16 12C16 12.55 15.55 13 15 13H13V15C13 15.55 12.55 16 12 16Z"})),z=class{constructor(t){e(this,t),this.vviinnSelectObject=o(this,"vviinnSelectObject",7),this.detectedObject=void 0,this.selectedDetectedObject=void 0,this.basicEventData=void 0,this.imageBounds=void 0,this.showInWidget=void 0,this.position=["0","0"]}connectedCallback(){this.storeName=this.showInWidget?"widget":"components"}getObjectPosition(){return s.pipe(n.fromNullable(this.imageBounds),n.map((t=>{const e=p(a(this.detectedObject).rectangle),{x:o,y:i}=s.pipe(e,f(t),b);return[`${o}px`,`${i}px`]})),n.getOrElse((()=>["0","0"])))}selectDetectedObject(){const t=s.pipe(n.fromNullable(this.imageBounds),n.map((t=>{const e=a(this.detectedObject).rectangle,o=p(e);return f(t)(o)})),n.toNullable);l(this.storeName,t,this.imageBounds),this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject,searchArea:t}))}isActive(){if(!this.detectedObject||!this.selectedDetectedObject)return!1;const t=a(this.detectedObject),e=a(this.selectedDetectedObject);return c.equals(t,e)}render(){return t(i,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};z.style=':host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-size:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#525252;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;}: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 V=class{constructor(t){e(this,t),this.handler=void 0}render(){return t(i,null,t("vviinn-error",null,t(u,null),t("h4",{slot:"title"},g.t("emptyResultsBlock.title")),"image"===h.searchType&&t("button",{slot:"action",onClick:this.handler},g.t("emptyResultsBlock.button"))))}},H=class{constructor(t){e(this,t),this.vviinnWidgetClose=o(this,"vviinnWidgetClose",7),this.active=!1,this.resetState=void 0,this.buttonElementId=void 0,this.widgetVersion=void 0,this.hideBackButton=!1,this.isFirstScreen=void 0,this.slider=!1}componentWillLoad(){x(this,this.el)}resetTopScroll(){const t=this.el.shadowRoot.querySelector(".body");null==t||t.scroll({top:0})}close(){this.active=!1,setTimeout((()=>{this.vviinnWidgetClose.emit({widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:v.VPS,widgetId:this.buttonElementId,widgetVersion:this.widgetVersion})}),this.slider?500:0)}handleAnimationEnd(t){"fade-in"===t.animationName&&(this.slider=!0)}render(){return t(i,{exportparts:w,class:{closed:!this.active,"first-screen":this.isFirstScreen},onAnimationEnd:t=>this.handleAnimationEnd(t)},t("div",{class:"head"},!this.hideBackButton&&t("button",{part:"secondary-action",onClick:()=>{this.resetState(),this.resetTopScroll()}},t(C,null)),t("div",{class:"title",part:"results-title"},s.pipe(d(h.image),n.map((([e])=>t("img",{width:"28",height:"28",src:e.src,class:"title-image"}))),n.getOrElse((()=>null))),t("slot",{name:"vviinn-image-search-modal-title"},g.t("imageSearchModalTitle"))),t("button",{onClick:()=>this.close(),class:"close-button",part:"close-button"},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M12 13.3892L6.91958 18.4696C6.72248 18.6667 6.49095 18.7653 6.225 18.7653C5.95905 18.7653 5.72753 18.6667 5.53043 18.4696C5.33333 18.2725 5.23478 18.041 5.23478 17.775C5.23478 17.5091 5.33333 17.2776 5.53043 17.0805L10.6109 12L5.53043 6.9196C5.33333 6.7225 5.23478 6.49098 5.23478 6.22503C5.23478 5.95908 5.33333 5.72755 5.53043 5.53045C5.72753 5.33335 5.95905 5.2348 6.225 5.2348C6.49095 5.2348 6.72248 5.33335 6.91958 5.53045L12 10.6109L17.0804 5.53045C17.2775 5.33335 17.5091 5.2348 17.775 5.2348C18.041 5.2348 18.2725 5.33335 18.4696 5.53045C18.6667 5.72755 18.7652 5.95908 18.7652 6.22503C18.7652 6.49098 18.6667 6.7225 18.4696 6.9196L13.3892 12L18.4696 17.0805C18.6667 17.2776 18.7652 17.5091 18.7652 17.775C18.7652 18.041 18.6667 18.2725 18.4696 18.4696C18.2725 18.6667 18.041 18.7653 17.775 18.7653C17.5091 18.7653 17.2775 18.6667 17.0804 18.4696L12 13.3892Z",fill:"currentColor"})))),t("div",{class:"body"},t("slot",null)))}get el(){return r(this)}};H.style=":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-size:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#525252;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;}:host{background:white;border-radius:var(--modal-border-radius, var(--border-radius-300));box-sizing:border-box;display:grid;grid-template-rows:min-content auto;max-width:960px;overflow:auto;position:relative}.head{font-family:var(--font-family, var(--font-family-base));position:absolute;width:100%;box-sizing:border-box;display:flex;align-items:center;z-index:1;padding:16px}.title{display:flex;align-items:center;transform:translateX(-6px);font-weight:var(--font-weight-600);font-size:18px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:6px;color:#8d8d8d}button:hover{color:#000}@media (max-width: 768px){:host{animation-name:fade-in;animation-duration:0.5s;animation-fill-mode:forwards;border-radius:24px 24px 0 0}:host(.closed){animation-name:fade-out;animation-fill-mode:none}.head{z-index:1}:host(:not(.first-screen)) .head{position:sticky;background:#ffffff}.body{overflow-y:auto}:host(:not(.first-screen)) .body{padding-bottom:160px}.title{color:#161616;display:flex;align-items:center;font-weight:500;font-size:16px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;color:#6f6f6f;padding:0}button:hover{color:#000}:host(.first-screen) button,:host(.first-screen) button:hover{color:white}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";const j=class{constructor(t){e(this,t)}render(){return t(i,null,t("slot",null))}};j.style=":host{animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";const L=class{constructor(t){e(this,t)}render(){return t(i,null)}};L.style=":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:flex;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";const M=class{constructor(t){e(this,t),this.vviinnWidgetLoad=o(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=o(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=o(this,"vviinnWidgetClose",7),this.vviinnProductLoad=o(this,"vviinnProductLoad",7),this.vviinnProductClick=o(this,"vviinnProductClick",7),this.vviinnProductView=o(this,"vviinnProductView",7),this.vviinnResultLoad=o(this,"vviinnResultLoad",7),this.vviinnResultView=o(this,"vviinnResultView",7),this.vviinnNoResult=o(this,"vviinnNoResult",7),this.vviinnAddToBasket=o(this,"vviinnAddToBasket",7),this.sidebar=null,this.sidebarCloseListener=()=>{this.targetAppendSidebarTo?this.targetAppendSidebarTo.removeChild(this.sidebar):document.body.removeChild(this.sidebar)},this.token=void 0,this.productId=void 0,this.mode="continuity",this.campaigns="",this.excluded="",this.campaignType="set"===this.mode?"VCS":"VPR",this.locale="de-DE",this.color="",this.imageWidth=300,this.imageRatio=1,this.setItemsAmount=4,this.cssUrl=null,this.currencySign="€",this.pricePrefix="",this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.productDetailsNewTab=!1,this.productDetailsRedirect=!0,this.addToBasketShow=!1,this.showFilters=!1,this.addPriceContainer=!1,this.setModeDiscounts="set"===this.mode?"5, 10, 15":"",this.updateButtonLocation="topAndItem",this.sidebarTitle="set"===this.mode?"":"Similar products",this.modalScrollbar=!1,this.position="bottom",this.addStyle=!0,this.appendSidebarTo=void 0,this.favoriteShow=!1,this.appendSidebarToElement=void 0,this.oneClickDiscoveryMode="standalone",this.apiPath="https://api.vviinn.com",this.showInWidget=!1,this.targetAppendSidebarTo=void 0}connectedCallback(){this.iconSideSize="standalone"===this.oneClickDiscoveryMode?24:14}componentWillLoad(){this.appendSidebarToElement?this.targetAppendSidebarTo=this.appendSidebarToElement:this.appendSidebarTo&&(this.targetAppendSidebarTo=document.getElementById(this.appendSidebarTo))}appendSidebarToElementWatcher(){this.appendSidebarToElement&&(this.targetAppendSidebarTo=this.appendSidebarToElement)}render(){return t(i,{onClick:()=>{this.appendSidebarTo&&!this.targetAppendSidebarTo?setTimeout((()=>{this.handleClick()}),250):this.handleClick()},role:"button",tabindex:"0"},t("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},t("slot",null,t("VCS"===this.campaignType?k:y,{width:this.iconSideSize,height:this.iconSideSize}))))}handleClick(){const t=document.createElement("vviinn-recommendations-sidebar");if(t.sidebarTitle=this.sidebarTitle,t.productId=this.productId,t.token=this.token,t.position=this.position,t.widgetScrollbar=this.modalScrollbar,t.campaigns=this.campaigns,t.campaignType=this.campaignType,t.color=this.color,t.locale=this.locale,t.imageWidth=this.imageWidth,t.currencySign=this.currencySign,t.pricePrefix=this.pricePrefix,t.apiPath=this.apiPath,t.buttonElementId=this.el.id,t.noResultText=this.noResultText,t.noResultShow=this.noResultShow,t.gridArrowsDynamic=this.gridArrowsDynamic,t.productDetailsNewTab=this.productDetailsNewTab,t.productDetailsRedirect=this.productDetailsRedirect,t.widgetVersion=m,t.showingInButton=!0,t.excluded=this.excluded,t.addToBasketShow=this.addToBasketShow,t.buttonChildren=this.el.children,t.showFilters=this.showFilters,t.cssUrl=this.cssUrl,t.imageRatio=this.imageRatio,t.setItemsAmount=this.setItemsAmount,t.setModeDiscounts=this.setModeDiscounts,t.updateButtonLocation=this.updateButtonLocation,t.addPriceContainer=this.addPriceContainer,t.favoriteShow=this.favoriteShow,t.showInModal="modal"===this.oneClickDiscoveryMode,this.targetAppendSidebarTo?(t.mode="grid",t.useCarousel="append-slider"===this.oneClickDiscoveryMode):(t.mode="right"===this.position?"grid":this.mode,t.useCarousel="bottom"===this.position),this.sidebar=t,t.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),this.targetAppendSidebarTo)return this.sidebar.showInCustomContainer=!0,this.targetAppendSidebarTo.innerHTML="",void this.targetAppendSidebarTo.append(this.sidebar);document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&this.sidebar.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener)}get el(){return r(this)}static get watchers(){return{appendSidebarToElement:["appendSidebarToElementWatcher"]}}};M.style=":host{display:block}";const Z=class{constructor(t){e(this,t),this.handler=void 0}render(){return t(i,null,t("vviinn-error",null,t(u,null),t("h4",{slot:"title"},g.t("wrongAspectRatioBlock.title")),t("button",{slot:"action",onClick:this.handler},g.t("wrongAspectRatioBlock.button"))))}};export{z as vviinn_detected_object,V as vviinn_empty_results,H as vviinn_modal,j as vviinn_overlay,L as vviinn_preloader,M as vviinn_vpr_button,Z as vviinn_wrong_aspect_ratio}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,r as e,c as i,H as o,g as r}from"./p-c3953cbf.js";import{s,c as n,_ as a,w as c,x as h}from"./p-e060a21e.js";import{s as l}from"./p-43e147d6.js";import{i as d}from"./p-2e76a5c3.js";import{r as p}from"./p-645df5cc.js";import{s as f}from"./p-1f0dc75e.js";import"./p-f2d58f7d.js";const b=()=>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"})),g=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",width:"24",height:"24"},t("path",{d:"M12 14C11.1667 14 10.4583 13.7083 9.87501 13.125C9.29168 12.5417 9.00001 11.8333 9.00001 11V5C9.00001 4.16667 9.29168 3.45833 9.87501 2.875C10.4583 2.29167 11.1667 2 12 2C12.8333 2 13.5417 2.29167 14.125 2.875C14.7083 3.45833 15 4.16667 15 5V11C15 11.8333 14.7083 12.5417 14.125 13.125C13.5417 13.7083 12.8333 14 12 14ZM11 20V17.925C9.46668 17.7083 8.15418 17.0583 7.06251 15.975C5.97085 14.8917 5.30835 13.575 5.07501 12.025C5.04168 11.7417 5.11668 11.5 5.30001 11.3C5.48335 11.1 5.71668 11 6.00001 11C6.28335 11 6.52085 11.0958 6.71251 11.2875C6.90418 11.4792 7.03335 11.7167 7.10001 12C7.33335 13.1667 7.91251 14.125 8.83751 14.875C9.76251 15.625 10.8167 16 12 16C13.2 16 14.2583 15.6208 15.175 14.8625C16.0917 14.1042 16.6667 13.15 16.9 12C16.9667 11.7167 17.0958 11.4792 17.2875 11.2875C17.4792 11.0958 17.7167 11 18 11C18.2833 11 18.5167 11.1 18.7 11.3C18.8833 11.5 18.9583 11.7417 18.925 12.025C18.6917 13.5417 18.0333 14.85 16.95 15.95C15.8667 17.05 14.55 17.7083 13 17.925V20C13 20.2833 12.9042 20.5208 12.7125 20.7125C12.5208 20.9042 12.2833 21 12 21C11.7167 21 11.4792 20.9042 11.2875 20.7125C11.0958 20.5208 11 20.2833 11 20Z",fill:"#161616"})),u=()=>{var t;const e=window,i=window.navigator,o=i.vendor,r=[void 0!==e.opr,i.userAgent.indexOf("Firefox")>-1,i.userAgent.indexOf("Edg")>-1].some((t=>!0===t)),s=void 0!==i.userAgentData?"Google Chrome"===(null===(t=i.userAgentData.brands[0])||void 0===t?void 0:t.brand):"Google Inc."===o;return{forbiddenBrowser:r,isChrome:s,isSafari:i.userAgent.indexOf("Safari")>-1&&!s}},x=class{constructor(t){e(this,t),this.vviinnTextSearchStarted=i(this,"vviinnTextSearchStarted",7),this.vviinnSearchIdReceived=i(this,"vviinnSearchIdReceived",7),this.vviinnFilterTriggered=i(this,"vviinnFilterTriggered",7),this.widgetTextSearchFinished=i(this,"widgetTextSearchFinished",7),this.resultsSearchFinished=i(this,"resultsSearchFinished",7),this.vviinnSelectedFiltersReset=i(this,"vviinnSelectedFiltersReset",7),this.isShowPreloader=()=>this.state.loading&&"text"===this.state.searchType,this.showLoader=()=>this.isLoading=!0,this.hideLoader=()=>this.isLoading=!1,this.isShowRecording=()=>this.isRecording,this.showRecording=()=>this.isRecording=!0,this.hideRecording=()=>this.isRecording=!1,this.setShowTooltip=t=>{this.showTooltip=t},this.tooltipText=(()=>{const{isSafari:t}=u();return t?"speechRecognition.tooltip.siri":"speechRecognition.tooltip.general"})(),this.recognition=((t,e,i,o)=>{const r=(()=>{const t=window,e=t.webkitSpeechRecognition||t.SpeechRecognition;if(!e)return;const{forbiddenBrowser:i,isChrome:o,isSafari:r}=u();return i?void 0:o||r?e:void 0})();if(!r)return;const s=new r;let n;return s.interimResults=!1,s.maxAlternatives=1,s.continuous=!1,s.lang=t,s.onstart=()=>{e(),n=setTimeout((()=>{s.stop()}),1e4)},s.onspeechend=()=>{s.stop(),i(),clearTimeout(n)},s.onend=i,s.onresult=t=>{o(t.results[0][0].transcript)},s})(this.locale,(()=>{this.showRecording(),this.setShowTooltip(!1),clearTimeout(this.triggerTooltipStart)}),this.hideRecording,(t=>{this.setSearchQuery(t),this.handleTextSearch()})),this.filterTriggeredHandler=({detail:t})=>{const{action:e,customTrigger:i}=t;"deselect"===e&&"TPS"===i&&(this.searchQuery="")},this.trackTextSearch=()=>this.vviinnFilterTriggered.emit({kind:this.searchQuery,action:"select",customTrigger:"TPS",isTriggeredByVpsWidget:this.showInWidget}),this.setSearchQuery=t=>{this.searchQuery=t},this.token=void 0,this.locale="de-DE",this.mode="basic",this.showInWidget=!1,this.searchQuery=void 0,this.apiPath="https://api.vviinn.com",this.isLoading=!1,this.isRecording=!1,this.showTooltip=!1}connectedCallback(){this.storeName=this.showInWidget?"widget":"components",this.state=this.showInWidget?s:n,this.token&&(this.state.token=this.token),document.addEventListener("resultsSearchFinished",this.hideLoader),document.addEventListener("vviinnFilterTriggered",this.filterTriggeredHandler)}disconnectedCallback(){document.removeEventListener("resultsSearchFinished",this.hideLoader),document.removeEventListener("vviinnFilterTriggered",this.filterTriggeredHandler),clearTimeout(this.triggerTooltipStart),clearTimeout(this.triggerTooltipEnd)}async componentWillLoad(){var t;await d.init({lng:this.locale,fallbackLng:"en",resources:p}),l(this,this.el),!this.showInWidget&&(null===(t=this.searchQuery)||void 0===t?void 0:t.length)>0&&(this.showLoader(),this.vviinnTextSearchStarted.emit({query:this.searchQuery,isTriggeredByVpsWidget:this.showInWidget}),this.trackTextSearch())}imageUploadFinished({detail:t}){this.showInWidget||(this.showLoader(),this.vviinnSearchIdReceived.emit({searchId:t.searchId}))}handleInputChange(t){this.setSearchQuery(t.target.value)}async handleSpeech(){this.isRecording?(this.recognition.stop(),this.hideRecording(),this.setShowTooltip(!1)):(this.recognition.start(),this.setSearchQuery(""),this.triggerTooltipStart=setTimeout((()=>{this.isRecording||(this.setShowTooltip(!0),this.triggerTooltipEnd=setTimeout((()=>{this.setShowTooltip(!1)}),5e3))}),1e3))}async handleTextSearch(){if(this.searchQuery)if(this.trackTextSearch(),this.showInWidget){const t=a.pipe(await c(this.storeName,this.searchQuery),h((()=>null)),(t=>t));t&&(this.widgetTextSearchFinished.emit({query:this.searchQuery,requestId:t.requestId}),this.vviinnSelectedFiltersReset.emit({isTriggeredByVpsWidget:this.showInWidget}))}else this.showLoader(),this.vviinnTextSearchStarted.emit({query:this.searchQuery})}handleKeyPress(t){"Enter"===t.key&&this.handleTextSearch()}render(){return t(o,{exportparts:f},t("div",{class:"text-search-container",part:"text-search-container"},t("input",{class:"text-search-input",part:"text-search-input",type:"text",placeholder:d.t(this.isShowRecording()?"speechRecognition.placeholder":"textSearchPlaceholder"),value:this.searchQuery,onInput:t=>this.handleInputChange(t),onKeyUp:t=>this.handleKeyPress(t)}),"extended"===this.mode&&t("vviinn-vps-button",{token:this.token,locale:this.locale,addStyle:!1,useComponentsStore:!0,apiPath:this.apiPath}),"basic"===this.mode&&t("slot",{name:"vviinn-text-search-actions"}),("extended"===this.mode||this.showInWidget)&&this.recognition&&t("button",{class:"speech-button",part:"speech-button",onClick:()=>this.handleSpeech()},t(g,null),this.isShowRecording()&&t("span",{class:"recording-indicator"})),t("button",{class:"text-search-button",part:"text-search-button",onClick:()=>this.handleTextSearch(),disabled:this.state.loading},this.isShowPreloader()?t("vviinn-preloader",null):t("slot",{name:"vviinn-text-search-icon"},t(b,null)))),this.showTooltip&&t("p",{class:"text-search-tooltip",part:"text-search-tooltip"},d.t(this.tooltipText)))}get el(){return r(this)}};x.style=':host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-size:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#525252;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;}:host{display:block;position:relative;width:100%;}.text-search-container{display:flex;align-items:center;gap:var(--spacing-50);width:100%;height:46px;border:1px solid var(--color-border-02);border-radius:8px;transition:border-color 0.2s;overflow:hidden;box-sizing:border-box}.text-search-container:focus-within{border-color:#8d8d8d}.text-search-input,.text-search-tooltip{font-size:16px;font-style:normal;font-weight:400;font-family:var(--font-family, var(--font-family-base))}.text-search-input{height:100%;padding-left:16px;box-sizing:border-box;border:none;outline:none;overflow:hidden;flex-grow:2;width:150px}.text-search-input::-moz-placeholder{color:#a8a8a8}.text-search-input::placeholder{color:#a8a8a8}.text-search-input:focus,.text-search-input:active{border-color:#8d8d8d}vviinn-vps-button{height:100%}.text-search-button,.speech-button,vviinn-vps-button::part(vviinn-button){border:none;height:100%;display:flex;justify-content:center;align-items:center;transition:background-color 0.2s;cursor:pointer}.speech-button,vviinn-vps-button::part(vviinn-button){padding:0 8px}.text-search-button{width:44px}.upload-button-text{display:contents}.text-search-button{background-color:#f4f4f4}.speech-button{background-color:transparent;position:relative}@keyframes recordingSpeech{0%{background-color:#ff0000;scale:1}100%{background-color:#ff8888;scale:1.5}}.recording-indicator{border-radius:50%;width:8px;height:8px;left:24px;top:24px;background-color:#ff0000;position:absolute;animation:recordingSpeech 1s infinite alternate ease-in-out}@keyframes fade-out{0%{opacity:0}20%{opacity:1}80%{opacity:1}100%{opacity:0;display:none}}.text-search-tooltip{position:absolute;right:0;top:80%;background:#f4f4f4;animation:fade-out 5s forwards;width:-moz-fit-content;width:fit-content;padding:24px;border-radius:8px;border:1px solid #8d8d8d;box-sizing:border-box}.text-search-button:not(:disabled):hover{background-color:#e0e0e0}.text-search-button:disabled{cursor:unset}vviinn-image-selector,::slotted([slot="vviinn-text-search-actions"]){margin:auto 8px}vviinn-preloader{--preloader-size:16px;display:flex;color:#525252}';export{x as vviinn_text_search}
|