vviinn-widgets 2.221.0 → 2.222.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/{index-sL3iGA57.js → index-RlbsyJJk.js} +1 -1
- package/dist/cjs/{search.store-C-fS-eJR.js → search.store-D4WiAMcl.js} +1 -1
- package/dist/cjs/vviinn-button_6.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-camera_12.cjs.entry.js +109 -66
- package/dist/cjs/vviinn-carousel_10.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-shop-the-look.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-text-search.cjs.entry.js +1 -1
- package/dist/collection/components/vviinn-suggestions/helpers.js +27 -10
- package/dist/collection/components/vviinn-suggestions/render-helpers.js +42 -15
- package/dist/esm/{index-D5yWioO8.js → index-CEzGPs5u.js} +1 -1
- package/dist/esm/{search.store-C8LIDQfX.js → search.store-Cgs5icgA.js} +1 -1
- package/dist/esm/vviinn-button_6.entry.js +1 -1
- package/dist/esm/vviinn-camera_12.entry.js +109 -66
- package/dist/esm/vviinn-carousel_10.entry.js +2 -2
- package/dist/esm/vviinn-shop-the-look.entry.js +1 -1
- package/dist/esm/vviinn-text-search.entry.js +1 -1
- package/dist/types/components/vviinn-suggestions/helpers.d.ts +1 -0
- package/dist/vviinn-widgets/{p-e7b0a5b9.entry.js → p-0b7e8e2e.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-f46ad1fd.entry.js → p-818a1e53.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-BpHXy3Gg.js → p-B246LK7U.js} +1 -1
- package/dist/vviinn-widgets/{p-DTASrq1W.js → p-Cxd6yzhY.js} +1 -1
- package/dist/vviinn-widgets/{p-95423f25.entry.js → p-c1eac87b.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-07211a51.entry.js → p-df4365fb.entry.js} +1 -1
- package/{www/build/p-f48452fd.entry.js → dist/vviinn-widgets/p-df9a1d66.entry.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/{p-e7b0a5b9.entry.js → p-0b7e8e2e.entry.js} +1 -1
- package/www/build/{p-f46ad1fd.entry.js → p-818a1e53.entry.js} +1 -1
- package/www/build/{p-BpHXy3Gg.js → p-B246LK7U.js} +1 -1
- package/www/build/{p-DTASrq1W.js → p-Cxd6yzhY.js} +1 -1
- package/www/build/{p-95423f25.entry.js → p-c1eac87b.entry.js} +1 -1
- package/www/build/{p-07211a51.entry.js → p-df4365fb.entry.js} +1 -1
- package/{dist/vviinn-widgets/p-f48452fd.entry.js → www/build/p-df9a1d66.entry.js} +1 -1
- package/www/build/{p-2d5777fa.js → p-e969c76d.js} +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement, F as Fragment } from './index-B89nCb_F.js';
|
|
2
2
|
import { _ as _functionExports, E as EitherExports, f as fold, b as fromImage, a as divideOnSized, e as isLeft, m as match, O as OptionExports } from './Rectangle-dmgo4KMB.js';
|
|
3
|
-
import { t as toFile, c as makeUploadFileRequest, w as getImageSizes, v as version, f as campaignTypeNames, h as addIfNotEmpty, m as makeVisualSearchRequest, u as useSearchStore, x as checkImageType, g as getAcceptableFileFormats, d as setTextSearchQuery, y as resetStore, j as makeTextSearchRequest, z as makeProductListingPageRequest, A as checkDeviceType, p as parseStringToExcluded } from './search.store-
|
|
3
|
+
import { t as toFile, c as makeUploadFileRequest, w as getImageSizes, v as version, f as campaignTypeNames, h as addIfNotEmpty, m as makeVisualSearchRequest, u as useSearchStore, x as checkImageType, g as getAcceptableFileFormats, d as setTextSearchQuery, y as resetStore, j as makeTextSearchRequest, z as makeProductListingPageRequest, A as checkDeviceType, p as parseStringToExcluded } from './search.store-Cgs5icgA.js';
|
|
4
4
|
import { s as slotChangeListener, a as addEventListenersWithSignal, p as productCardSlotNames, v as vprIconSlotName, f as findSlotElements, g as getSlotNames, b as setElementInteractivity, S as SlotSkeleton } from './index-C1-PYhS4.js';
|
|
5
|
-
import { g as getRemoveFilterAriaLabel, F as FilterIconClose, P as PlusIcon, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, c as createWidgetEvent, a as createFilterEvent, v as v4, b as createAddToBasketEvent, d as createAddToWishlistEvent, e as createResultEventByType, f as createProductEventByType, h as getCustomLabels, t as triggerFilter, i as triggerRemoveIntervalFilter, j as announceToScreenReader, s as syncRequestFilters, k as isSubFilterActive, l as RenderFilterButton, m as getIntervalLabel, n as createImageSearchEvent } from './index-
|
|
5
|
+
import { g as getRemoveFilterAriaLabel, F as FilterIconClose, P as PlusIcon, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, c as createWidgetEvent, a as createFilterEvent, v as v4, b as createAddToBasketEvent, d as createAddToWishlistEvent, e as createResultEventByType, f as createProductEventByType, h as getCustomLabels, t as triggerFilter, i as triggerRemoveIntervalFilter, j as announceToScreenReader, s as syncRequestFilters, k as isSubFilterActive, l as RenderFilterButton, m as getIntervalLabel, n as createImageSearchEvent } from './index-CEzGPs5u.js';
|
|
6
6
|
import { i as instance, t as trackEvent, a as isTrackingEnabled, d as defaultConfig } from './store-BJxQCbNV.js';
|
|
7
7
|
import { M as MIN_SEARCH_AREA_SIZE, S as SUPPORTED_ASPECT_RATIO, a as MIN_IMAGE_SIDE_FOR_CROPPER, C as Cropper, c as cropperOptions, g as getCropBoxData, i as isCropBoxChangeMinimal, D as DEFAULT_IMAGE_SIZE } from './cropperUtils-CkB6bG3L.js';
|
|
8
8
|
import { r as renderExternalCSS } from './cssUrlHelper-Byz4s-MD.js';
|
|
@@ -1442,6 +1442,72 @@ ${e}</tr>
|
|
|
1442
1442
|
`}strong({tokens:e}){return `<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return `<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return `<code>${O(e,true)}</code>`}br(e){return "<br>"}del({tokens:e}){return `<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=J(e);if(i===null)return r;e=i;let s='<a href="'+e+'"';return t&&(s+=' title="'+O(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=J(e);if(i===null)return O(n);e=i;let s=`<img src="${e}" alt="${O(n)}"`;return t&&(s+=` title="${O(t)}"`),s+=">",s}text(e){return "tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:O(e.text)}};var $=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return ""+e}image({text:e}){return ""+e}br(){return ""}checkbox({raw:e}){return e}};var b=class u{options;renderer;textRenderer;constructor(e){this.options=e||T,this.options.renderer=this.options.renderer||new y,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $;}static parse(e,t){return new u(t).parse(e)}static parseInline(e,t){return new u(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let s=r,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==false||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){t+=a||"";continue}}let i=r;switch(i.type){case "space":{t+=this.renderer.space(i);break}case "hr":{t+=this.renderer.hr(i);break}case "heading":{t+=this.renderer.heading(i);break}case "code":{t+=this.renderer.code(i);break}case "table":{t+=this.renderer.table(i);break}case "blockquote":{t+=this.renderer.blockquote(i);break}case "list":{t+=this.renderer.list(i);break}case "checkbox":{t+=this.renderer.checkbox(i);break}case "html":{t+=this.renderer.html(i);break}case "def":{t+=this.renderer.def(i);break}case "paragraph":{t+=this.renderer.paragraph(i);break}case "text":{t+=this.renderer.text(i);break}default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}let s=i;switch(s.type){case "escape":{n+=t.text(s);break}case "html":{n+=t.html(s);break}case "link":{n+=t.link(s);break}case "image":{n+=t.image(s);break}case "checkbox":{n+=t.checkbox(s);break}case "strong":{n+=t.strong(s);break}case "em":{n+=t.em(s);break}case "codespan":{n+=t.codespan(s);break}case "br":{n+=t.br(s);break}case "del":{n+=t.del(s);break}case "text":{n+=t.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}};var P=class{options;block;constructor(e){this.options=e||T;}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?x.lex:x.lexInline}provideParser(){return this.block?b.parse:b.parseInline}};var D=class{defaults=M();options=this.setOptions;parse=this.parseMarkdown(true);parseInline=this.parseMarkdown(false);Parser=b;Renderer=y;TextRenderer=$;Lexer=x;Tokenizer=w;Hooks=P;constructor(...e){this.use(...e);}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case "table":{let i=r;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,t));for(let s of i.rows)for(let a of s)n=n.concat(this.walkTokens(a.tokens,t));break}case "list":{let i=r;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,t));}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)));}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||false,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===false&&(o=s.apply(this,a)),o}:t.renderers[i.name]=i.renderer;}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]));}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens);}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new y(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,o=n.renderer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return c===false&&(c=l.apply(i,p)),c||""};}r.renderer=i;}if(n.tokenizer){let i=this.defaults.tokenizer||new w(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,o=n.tokenizer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return c===false&&(c=l.apply(i,p)),c};}r.tokenizer=i;}if(n.hooks){let i=this.defaults.hooks||new P;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,o=n.hooks[a],l=i[a];P.passThroughHooks.has(s)?i[a]=p=>{if(this.defaults.async&&P.passThroughHooksRespectAsync.has(s))return (async()=>{let d=await o.call(i,p);return l.call(i,d)})();let c=o.call(i,p);return l.call(i,c)}:i[a]=(...p)=>{if(this.defaults.async)return (async()=>{let d=await o.apply(i,p);return d===false&&(d=await l.apply(i,p)),d})();let c=o.apply(i,p);return c===false&&(c=l.apply(i,p)),c};}r.hooks=i;}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o};}this.defaults={...this.defaults,...r};}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return x.lex(e,t??this.defaults)}parser(e,t){return b.parse(e,t??this.defaults)}parseMarkdown(e){return (n,r)=>{let i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===true&&i.async===false)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return (async()=>{let o=s.hooks?await s.hooks.preprocess(n):n,p=await(s.hooks?await s.hooks.provideLexer():e?x.lex:x.lexInline)(o,s),c=s.hooks?await s.hooks.processAllTokens(p):p;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():e?b.parse:b.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let l=(s.hooks?s.hooks.provideLexer():e?x.lex:x.lexInline)(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=(s.hooks?s.hooks.provideParser():e?b.parse:b.parseInline)(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(e,t){return n=>{if(n.message+=`
|
|
1443
1443
|
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+O(n.message+"",true)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}};var L=new D;function g(u,e){return L.parse(u,e)}g.options=g.setOptions=function(u){return L.setOptions(u),g.defaults=L.defaults,G(g.defaults),g};g.getDefaults=M;g.defaults=T;g.use=function(...u){return L.use(...u),g.defaults=L.defaults,G(g.defaults),g};g.walkTokens=function(u,e){return L.walkTokens(u,e)};g.parseInline=L.parseInline;g.Parser=b;g.parser=b.parse;g.Renderer=y;g.TextRenderer=$;g.Lexer=x;g.lexer=x.lex;g.Tokenizer=w;g.Hooks=P;g.parse=g;
|
|
1444
1444
|
|
|
1445
|
+
const toggleFilterInSet = (appliedFilters, suggestionText) => {
|
|
1446
|
+
const newAppliedFilters = new Set(appliedFilters);
|
|
1447
|
+
if (newAppliedFilters.has(suggestionText)) {
|
|
1448
|
+
newAppliedFilters.delete(suggestionText);
|
|
1449
|
+
}
|
|
1450
|
+
else {
|
|
1451
|
+
newAppliedFilters.add(suggestionText);
|
|
1452
|
+
}
|
|
1453
|
+
return newAppliedFilters;
|
|
1454
|
+
};
|
|
1455
|
+
const formatIntervalKey = (column, start, end) => `${column}:${start}-${end}`;
|
|
1456
|
+
const extractActiveFilterValues = (activeFilters) => {
|
|
1457
|
+
const activeValues = new Set();
|
|
1458
|
+
activeFilters.forEach((filter) => {
|
|
1459
|
+
if (!Array.isArray(filter.values))
|
|
1460
|
+
return;
|
|
1461
|
+
filter.values.forEach((v) => {
|
|
1462
|
+
// Interval values are `{start, end}` objects; categorical values are strings.
|
|
1463
|
+
if (v !== null && typeof v === "object" && "start" in v) {
|
|
1464
|
+
activeValues.add(formatIntervalKey(filter.column, v.start, v.end));
|
|
1465
|
+
}
|
|
1466
|
+
else {
|
|
1467
|
+
activeValues.add(`${filter.column}:${String(v)}`);
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
});
|
|
1471
|
+
return activeValues;
|
|
1472
|
+
};
|
|
1473
|
+
const syncSuggestionFilters = (activeFilters, stream) => {
|
|
1474
|
+
var _a, _b, _c;
|
|
1475
|
+
const activeValues = extractActiveFilterValues(activeFilters);
|
|
1476
|
+
const updatedAppliedFilters = new Set();
|
|
1477
|
+
if (!(stream === null || stream === void 0 ? void 0 : stream.items))
|
|
1478
|
+
return updatedAppliedFilters;
|
|
1479
|
+
for (const item of stream.items) {
|
|
1480
|
+
if (item.role !== "assistant" || !item.parts)
|
|
1481
|
+
continue;
|
|
1482
|
+
for (const part of item.parts) {
|
|
1483
|
+
if (!((_a = part.text) === null || _a === void 0 ? void 0 : _a.annotations))
|
|
1484
|
+
continue;
|
|
1485
|
+
for (const annotation of part.text.annotations) {
|
|
1486
|
+
if (!((_c = (_b = annotation.interactions) === null || _b === void 0 ? void 0 : _b.dynamicFilters) === null || _c === void 0 ? void 0 : _c.length))
|
|
1487
|
+
continue;
|
|
1488
|
+
for (const filter of annotation.interactions.dynamicFilters) {
|
|
1489
|
+
if (filter.type === "categorical" && "values" in filter) {
|
|
1490
|
+
filter.values.forEach((value) => {
|
|
1491
|
+
if (activeValues.has(`${filter.column}:${String(value.value)}`)) {
|
|
1492
|
+
updatedAppliedFilters.add(`${filter.column}:${value.value}`);
|
|
1493
|
+
}
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1496
|
+
else if (filter.type === "interval" && "selectedValues" in filter) {
|
|
1497
|
+
filter.selectedValues.forEach((interval) => {
|
|
1498
|
+
const key = formatIntervalKey(filter.column, interval.start, interval.end);
|
|
1499
|
+
if (activeValues.has(key)) {
|
|
1500
|
+
updatedAppliedFilters.add(key);
|
|
1501
|
+
}
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
return updatedAppliedFilters;
|
|
1509
|
+
};
|
|
1510
|
+
|
|
1445
1511
|
const extractDataItems = (annotation) => annotation.data.items;
|
|
1446
1512
|
const findMatchingFilterValue = (item, filter) => {
|
|
1447
1513
|
if (filter.type !== "categorical" ||
|
|
@@ -1462,18 +1528,38 @@ const applyFiltersForItems = (dataItems, interactions, currentRequestFilters, ha
|
|
|
1462
1528
|
let updatedFilters = currentRequestFilters;
|
|
1463
1529
|
if (dataItems.length === 0) {
|
|
1464
1530
|
for (const filter of filters) {
|
|
1465
|
-
if (filter.type
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
}
|
|
1531
|
+
if (filter.type === "categorical" && "values" in filter) {
|
|
1532
|
+
for (const filterValue of filter.values) {
|
|
1533
|
+
updatedFilters = triggerFilter({
|
|
1534
|
+
filterValue: filterValue,
|
|
1535
|
+
selectedFilter: filter,
|
|
1536
|
+
requestFilters: updatedFilters,
|
|
1537
|
+
vviinnFilterTriggered: handlers.vviinnFilterTriggered,
|
|
1538
|
+
vviinnFiltersChanged: handlers.vviinnFiltersChanged,
|
|
1539
|
+
el: handlers.el,
|
|
1540
|
+
isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
|
|
1541
|
+
});
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
else if (filter.type === "interval" && "selectedValues" in filter) {
|
|
1545
|
+
// A suggestion chip represents one specific range to toggle, not a slider.
|
|
1546
|
+
// The backend emits `full === selectedValues[0]`, which would make
|
|
1547
|
+
// `isFullRangeInterval` read every click as "cleared to the full range"
|
|
1548
|
+
// (deselect-only). Neutralize `full` so the shared toggle logic selects /
|
|
1549
|
+
// deselects this exact interval by value match. Only the object passed to
|
|
1550
|
+
// `triggerFilter` is affected; `value` still carries the real interval.
|
|
1551
|
+
const chipFilter = Object.assign(Object.assign({}, filter), { full: { start: undefined, end: undefined } });
|
|
1552
|
+
for (const interval of filter.selectedValues) {
|
|
1553
|
+
updatedFilters = triggerFilter({
|
|
1554
|
+
filterValue: { interval },
|
|
1555
|
+
selectedFilter: chipFilter,
|
|
1556
|
+
requestFilters: updatedFilters,
|
|
1557
|
+
vviinnFilterTriggered: handlers.vviinnFilterTriggered,
|
|
1558
|
+
vviinnFiltersChanged: handlers.vviinnFiltersChanged,
|
|
1559
|
+
el: handlers.el,
|
|
1560
|
+
isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
|
|
1561
|
+
});
|
|
1562
|
+
}
|
|
1477
1563
|
}
|
|
1478
1564
|
}
|
|
1479
1565
|
return updatedFilters;
|
|
@@ -1522,9 +1608,15 @@ const splitContentByLocators = (content, annotations) => {
|
|
|
1522
1608
|
};
|
|
1523
1609
|
const getAnnotationFilterKeys = (annotation) => {
|
|
1524
1610
|
var _a, _b, _c;
|
|
1525
|
-
return (_c = (_b = (_a = annotation.interactions) === null || _a === void 0 ? void 0 : _a.dynamicFilters) === null || _b === void 0 ? void 0 : _b.flatMap((filter) =>
|
|
1526
|
-
|
|
1527
|
-
|
|
1611
|
+
return (_c = (_b = (_a = annotation.interactions) === null || _a === void 0 ? void 0 : _a.dynamicFilters) === null || _b === void 0 ? void 0 : _b.flatMap((filter) => {
|
|
1612
|
+
if (filter.type === "categorical" && "values" in filter) {
|
|
1613
|
+
return filter.values.map((v) => `${filter.column}:${v.value}`);
|
|
1614
|
+
}
|
|
1615
|
+
if (filter.type === "interval" && "selectedValues" in filter) {
|
|
1616
|
+
return filter.selectedValues.map((interval) => formatIntervalKey(filter.column, interval.start, interval.end));
|
|
1617
|
+
}
|
|
1618
|
+
return [];
|
|
1619
|
+
})) !== null && _c !== void 0 ? _c : [];
|
|
1528
1620
|
};
|
|
1529
1621
|
const getAnnotationDeeplink = (annotation) => {
|
|
1530
1622
|
for (const item of annotation.data.items) {
|
|
@@ -1551,55 +1643,6 @@ const renderAnnotatedContent = (content, annotations, onAnnotationClick, applied
|
|
|
1551
1643
|
};
|
|
1552
1644
|
const renderInfoText = (content, key) => (h("div", { class: "suggestion-info-text", part: "suggestion-info-text", key: key, innerHTML: g.parse(content) }));
|
|
1553
1645
|
|
|
1554
|
-
const toggleFilterInSet = (appliedFilters, suggestionText) => {
|
|
1555
|
-
const newAppliedFilters = new Set(appliedFilters);
|
|
1556
|
-
if (newAppliedFilters.has(suggestionText)) {
|
|
1557
|
-
newAppliedFilters.delete(suggestionText);
|
|
1558
|
-
}
|
|
1559
|
-
else {
|
|
1560
|
-
newAppliedFilters.add(suggestionText);
|
|
1561
|
-
}
|
|
1562
|
-
return newAppliedFilters;
|
|
1563
|
-
};
|
|
1564
|
-
const extractActiveFilterValues = (activeFilters) => {
|
|
1565
|
-
const activeValues = new Set();
|
|
1566
|
-
activeFilters.forEach((filter) => {
|
|
1567
|
-
if (Array.isArray(filter.values)) {
|
|
1568
|
-
filter.values.forEach((v) => activeValues.add(`${filter.column}:${String(v)}`));
|
|
1569
|
-
}
|
|
1570
|
-
});
|
|
1571
|
-
return activeValues;
|
|
1572
|
-
};
|
|
1573
|
-
const syncSuggestionFilters = (activeFilters, stream) => {
|
|
1574
|
-
var _a, _b, _c;
|
|
1575
|
-
const activeValues = extractActiveFilterValues(activeFilters);
|
|
1576
|
-
const updatedAppliedFilters = new Set();
|
|
1577
|
-
if (!(stream === null || stream === void 0 ? void 0 : stream.items))
|
|
1578
|
-
return updatedAppliedFilters;
|
|
1579
|
-
for (const item of stream.items) {
|
|
1580
|
-
if (item.role !== "assistant" || !item.parts)
|
|
1581
|
-
continue;
|
|
1582
|
-
for (const part of item.parts) {
|
|
1583
|
-
if (!((_a = part.text) === null || _a === void 0 ? void 0 : _a.annotations))
|
|
1584
|
-
continue;
|
|
1585
|
-
for (const annotation of part.text.annotations) {
|
|
1586
|
-
if (!((_c = (_b = annotation.interactions) === null || _b === void 0 ? void 0 : _b.dynamicFilters) === null || _c === void 0 ? void 0 : _c.length))
|
|
1587
|
-
continue;
|
|
1588
|
-
for (const filter of annotation.interactions.dynamicFilters) {
|
|
1589
|
-
if (filter.type !== "categorical" || !("values" in filter))
|
|
1590
|
-
continue;
|
|
1591
|
-
filter.values.forEach((value) => {
|
|
1592
|
-
if (activeValues.has(`${filter.column}:${String(value.value)}`)) {
|
|
1593
|
-
updatedAppliedFilters.add(`${filter.column}:${value.value}`);
|
|
1594
|
-
}
|
|
1595
|
-
});
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
return updatedAppliedFilters;
|
|
1601
|
-
};
|
|
1602
|
-
|
|
1603
1646
|
const vviinnSuggestionsCss = ":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-display:32px;--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-display:40px;--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-width:155px;--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:#707070;--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;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--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;--sidebar-animation-duration-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}:host{display:contents}.container{display:flex;flex-direction:column;gap:var(--spacing-150);font-family:var(--font-family, var(--font-family-base));padding-right:var(--spacing-100);line-height:normal}.header{display:flex;align-items:center;gap:var(--spacing-100)}.icon{font-size:20px}.title{margin:0;font-size:var(--font-size-headline);line-height:var(--line-height-headline);font-weight:600;color:var(--color-text-primary)}.suggestions-wrapper{display:flex;flex-direction:column;gap:var(--spacing-100);width:100%}.suggestions-list{list-style:none;margin:0;padding:0;padding-right:var(--spacing-100);display:flex;align-items:center;gap:var(--spacing-100);flex-wrap:wrap;font-size:var(--font-size-label)}.suggestion-item{display:contents}.suggestion-link{background:none;border:none;color:var(--color-primary-500);text-decoration:underline;cursor:pointer;font-size:inherit;line-height:inherit;padding:0;margin:0}.suggestion-link:hover{color:var(--color-primary-600)}.suggestion-link:focus{outline:2px solid var(--color-primary-500);outline-offset:2px;border-radius:2px}.suggestion-filter-button{background:none;border:none;cursor:pointer;display:flex;align-items:center;height:36px;padding:var(--spacing-75);gap:var(--spacing-50);white-space:nowrap;border-radius:var(--border-radius-100);background-color:var(--surface-bg-color-01);transition:background-color 0.1s;font-family:var(--font-family, var(--font-family-base));font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-filter-button:hover{background-color:var(--surface-bg-color-01-hover)}.suggestion-filter-button.active{background:var(--surface-bg-color-inverse);color:var(--color-text-inverse)}.suggestion-info-text{font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-info-text *{font-size:var(--font-size-label);margin:0}";
|
|
1604
1647
|
|
|
1605
1648
|
const VviinnSuggestions = class {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, f as forceUpdate, F as Fragment, H as Host, g as getElement } from './index-B89nCb_F.js';
|
|
2
|
-
import { f as campaignTypeNames, h as addIfNotEmpty, _ as _ArrayExports, u as useSearchStore, B as isMobile, C as fromString, D as fold, v as version } from './search.store-
|
|
2
|
+
import { f as campaignTypeNames, h as addIfNotEmpty, _ as _ArrayExports, u as useSearchStore, B as isMobile, C as fromString, D as fold, v as version } from './search.store-Cgs5icgA.js';
|
|
3
3
|
import { X as has, Y as tuple, _ as _functionExports, g as requireSemigroup, O as OptionExports, v as pipe$1, N as chainW, Z as makeRequest, L as fromEither, $ as resolveApiPath, a0 as createInitPostRequest, a1 as Apply, a2 as TaskEitherExports, E as EitherExports } from './Rectangle-dmgo4KMB.js';
|
|
4
4
|
import { i as instance, d as defaultConfig, t as trackEvent, a as isTrackingEnabled } from './store-BJxQCbNV.js';
|
|
5
|
-
import { S as SET_MODE_IMAGE_WIDTH_CSS_VAR, C as CONTENT_GROUP_CSS_CLASS, o as CAROUSEL_IMAGE_WIDTH_CSS_VAR, p as CAROUSEL_CONTENT_WIDTH_CSS_VAR, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, q as CAROUSEL_COLUMNS_CSS_VAR, D as DEFAULT_COLUMNS_NUMBER, h as getCustomLabels, r as SCROLL_POSITION_TOLERANCE, u as triggerResetFilters, t as triggerFilter, j as announceToScreenReader, m as getIntervalLabel, w as isPriceFilter, k as isSubFilterActive, l as RenderFilterButton, s as syncRequestFilters, P as PlusIcon, x as CUSTOM_LABELS_DELIMITER, v as v4, c as createWidgetEvent, e as createResultEventByType, b as createAddToBasketEvent, d as createAddToWishlistEvent, f as createProductEventByType, y as getRecommendationsBody } from './index-
|
|
5
|
+
import { S as SET_MODE_IMAGE_WIDTH_CSS_VAR, C as CONTENT_GROUP_CSS_CLASS, o as CAROUSEL_IMAGE_WIDTH_CSS_VAR, p as CAROUSEL_CONTENT_WIDTH_CSS_VAR, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, q as CAROUSEL_COLUMNS_CSS_VAR, D as DEFAULT_COLUMNS_NUMBER, h as getCustomLabels, r as SCROLL_POSITION_TOLERANCE, u as triggerResetFilters, t as triggerFilter, j as announceToScreenReader, m as getIntervalLabel, w as isPriceFilter, k as isSubFilterActive, l as RenderFilterButton, s as syncRequestFilters, P as PlusIcon, x as CUSTOM_LABELS_DELIMITER, v as v4, c as createWidgetEvent, e as createResultEventByType, b as createAddToBasketEvent, d as createAddToWishlistEvent, f as createProductEventByType, y as getRecommendationsBody } from './index-CEzGPs5u.js';
|
|
6
6
|
import { P as PRODUCT_CARD_IMAGE_WIDTH, D as DISCOVERY_WIDGET_IMAGE_RESOLUTION_WIDTH, c as PRODUCT_CARD_IMAGE_RESOLUTION_WIDTH } from './constants-rqiiCPBX.js';
|
|
7
7
|
import { s as slotChangeListener, a as addEventListenersWithSignal, i as isElementInSelector, S as SlotSkeleton } from './index-C1-PYhS4.js';
|
|
8
8
|
import { o as energyLabelParts, i as initializeLocale, j as extendedFiltersParts, h as filtersParts, q as imageParts, e as contentCardParts, l as listCardParts, p as productCardParts, t as priceRangeParts } from './index-BCrstDkj.js';
|
|
@@ -2,7 +2,7 @@ import { h, r as registerInstance, c as createEvent, H as Host, g as getElement
|
|
|
2
2
|
import { a as divideOnSized, E as EitherExports } from './Rectangle-dmgo4KMB.js';
|
|
3
3
|
import { C as Cropper, c as cropperOptions, g as getCropBoxData, i as isCropBoxChangeMinimal } from './cropperUtils-CkB6bG3L.js';
|
|
4
4
|
import { g as getSwiperStyles, c as configureSwiperElement, r as register, e as extractSlideIndex, s as setupIntersectionObserver } from './swiper-element-Er2KrWw1.js';
|
|
5
|
-
import { i as isDesktop$1, s as shopTheLookState, m as makeVisualSearchRequest, a as makeVisualSearchByUrlRequest, b as imageFromFileTask, c as makeUploadFileRequest, g as getAcceptableFileFormats } from './search.store-
|
|
5
|
+
import { i as isDesktop$1, s as shopTheLookState, m as makeVisualSearchRequest, a as makeVisualSearchByUrlRequest, b as imageFromFileTask, c as makeUploadFileRequest, g as getAcceptableFileFormats } from './search.store-Cgs5icgA.js';
|
|
6
6
|
import { S as SecondaryActionIcon } from './SecondaryActionIcon-D4f3aMUD.js';
|
|
7
7
|
import { i as initializeLocale, a as shopTheLookParts } from './index-BCrstDkj.js';
|
|
8
8
|
import { d as defaultConfig } from './store-BJxQCbNV.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-B89nCb_F.js';
|
|
2
2
|
import { _ as _functionExports, f as fold } from './Rectangle-dmgo4KMB.js';
|
|
3
|
-
import { d as setTextSearchQuery, e as makeAutoSuggestRequest, v as version, f as campaignTypeNames, h as addIfNotEmpty, j as makeTextSearchRequest, u as useSearchStore } from './search.store-
|
|
3
|
+
import { d as setTextSearchQuery, e as makeAutoSuggestRequest, v as version, f as campaignTypeNames, h as addIfNotEmpty, j as makeTextSearchRequest, u as useSearchStore } from './search.store-Cgs5icgA.js';
|
|
4
4
|
import { s as slotChangeListener, f as findSlotElements } from './index-C1-PYhS4.js';
|
|
5
5
|
import { i as instance, d as defaultConfig } from './store-BJxQCbNV.js';
|
|
6
6
|
import { i as initializeLocale, b as searchBarParts, s as searchModalFirstScreenParts } from './index-BCrstDkj.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RequestDynamicFilterItem } from "../../campaign/VPRCampaignService";
|
|
2
2
|
import { Stream } from "../../interfaces";
|
|
3
3
|
export declare const toggleFilterInSet: (appliedFilters: Set<string>, suggestionText: string) => Set<string>;
|
|
4
|
+
export declare const formatIntervalKey: (column: string, start: unknown, end: unknown) => string;
|
|
4
5
|
export declare const extractActiveFilterValues: (activeFilters: RequestDynamicFilterItem[]) => Set<string>;
|
|
5
6
|
export declare const syncSuggestionFilters: (activeFilters: RequestDynamicFilterItem[], stream: Stream | null) => Set<string>;
|