vviinn-widgets 2.31.0 → 2.31.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/cjs/{imageSearch.store-24310860.js → imageSearch.store-dc4e98b3.js} +1 -1
  2. package/dist/cjs/{index-6c6c5e1b.js → index-7ff2ab5f.js} +1 -1
  3. package/dist/cjs/{package-27d3ad12.js → package-af6d184f.js} +1 -1
  4. package/dist/cjs/search-filters_20.cjs.entry.js +1 -1
  5. package/dist/cjs/vviinn-carousel_3.cjs.entry.js +3 -3
  6. package/dist/cjs/vviinn-preloader.cjs.entry.js +1 -1
  7. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
  8. package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
  9. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +3 -3
  10. package/dist/esm/{imageSearch.store-b2df9ae3.js → imageSearch.store-c0f2a178.js} +1 -1
  11. package/dist/esm/{index-2a2eb584.js → index-53105ad4.js} +1 -1
  12. package/dist/esm/{package-5a7a3a18.js → package-3e2a1157.js} +1 -1
  13. package/dist/esm/search-filters_20.entry.js +1 -1
  14. package/dist/esm/vviinn-carousel_3.entry.js +3 -3
  15. package/dist/esm/vviinn-preloader.entry.js +1 -1
  16. package/dist/esm/vviinn-vpr-button.entry.js +1 -1
  17. package/dist/esm/vviinn-vps-button.entry.js +1 -1
  18. package/dist/esm/vviinn-vps-widget.entry.js +3 -3
  19. package/dist/vviinn-widgets/{p-f4a18796.entry.js → p-22beb468.entry.js} +1 -1
  20. package/{www/build/p-4f2ffdf6.entry.js → dist/vviinn-widgets/p-774581dc.entry.js} +1 -1
  21. package/dist/vviinn-widgets/{p-73284c6c.js → p-987a8e9f.js} +1 -1
  22. package/dist/vviinn-widgets/{p-cd04cf6d.entry.js → p-a71d8adc.entry.js} +1 -1
  23. package/dist/vviinn-widgets/{p-dfc9e91e.entry.js → p-a8515396.entry.js} +1 -1
  24. package/dist/vviinn-widgets/p-aace2b88.js +1 -0
  25. package/{www/build/p-b466395d.js → dist/vviinn-widgets/p-da7273ce.js} +1 -1
  26. package/dist/vviinn-widgets/p-de658f4c.entry.js +1 -0
  27. package/dist/vviinn-widgets/{p-a8c21d18.entry.js → p-e3da288b.entry.js} +1 -1
  28. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  29. package/package.json +3 -3
  30. package/www/build/{p-f4a18796.entry.js → p-22beb468.entry.js} +1 -1
  31. package/{dist/vviinn-widgets/p-4f2ffdf6.entry.js → www/build/p-774581dc.entry.js} +1 -1
  32. package/www/build/{p-73284c6c.js → p-987a8e9f.js} +1 -1
  33. package/www/build/{p-cd04cf6d.entry.js → p-a71d8adc.entry.js} +1 -1
  34. package/www/build/{p-dfc9e91e.entry.js → p-a8515396.entry.js} +1 -1
  35. package/www/build/p-aace2b88.js +1 -0
  36. package/{dist/vviinn-widgets/p-b466395d.js → www/build/p-da7273ce.js} +1 -1
  37. package/www/build/p-de658f4c.entry.js +1 -0
  38. package/www/build/{p-a8c21d18.entry.js → p-e3da288b.entry.js} +1 -1
  39. package/www/build/vviinn-widgets.esm.js +1 -1
  40. package/dist/vviinn-widgets/p-3e403567.js +0 -1
  41. package/dist/vviinn-widgets/p-5bbb50c3.entry.js +0 -1
  42. package/www/build/p-3e403567.js +0 -1
  43. package/www/build/p-5bbb50c3.entry.js +0 -1
@@ -16436,7 +16436,7 @@ const emptyApiPathError = {
16436
16436
  };
16437
16437
 
16438
16438
  const stringMonoid = getMonoid(Monoid);
16439
- const getApiPath = () => pipe(getFirstMonoid().concat(fromNullable(state$1.apiPath), fromNullable(`${process.env.API_PATH}`)), fromOption$1(() => emptyApiPathError));
16439
+ const getApiPath = () => pipe(getFirstMonoid().concat(fromNullable(state$1.apiPath), fromNullable(`${"https://api.vviinn.com"}`)), fromOption$1(() => emptyApiPathError));
16440
16440
  const headersSemigroupSum = {
16441
16441
  concat: (x, y) => {
16442
16442
  const result = new Headers();
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const imageSearch_store = require('./imageSearch.store-24310860.js');
3
+ const imageSearch_store = require('./imageSearch.store-dc4e98b3.js');
4
4
 
5
5
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
6
6
  // require the crypto API and do not support built-in fallback to lower quality random number
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "2.31.0";
3
+ const version = "2.31.4";
4
4
 
5
5
  exports.version = version;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const imageSearch_store = require('./imageSearch.store-24310860.js');
6
+ const imageSearch_store = require('./imageSearch.store-dc4e98b3.js');
7
7
  const i18next = require('./i18next-74ff3413.js');
8
8
  const customizedSlots = require('./customized-slots-0a8d663c.js');
9
9
  const index$1 = require('./index-fcf59d51.js');
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const imageSearch_store = require('./imageSearch.store-24310860.js');
6
+ const imageSearch_store = require('./imageSearch.store-dc4e98b3.js');
7
7
  const index$1 = require('./index-fcf59d51.js');
8
8
  const i18next = require('./i18next-74ff3413.js');
9
9
  const customizedSlots = require('./customized-slots-0a8d663c.js');
10
- const _package = require('./package-27d3ad12.js');
11
- const index$2 = require('./index-6c6c5e1b.js');
10
+ const _package = require('./package-af6d184f.js');
11
+ const index$2 = require('./index-7ff2ab5f.js');
12
12
 
13
13
  const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#e0e0e0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button{fill:#525252}button:disabled{display:none}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";
14
14
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const imageSearch_store = require('./imageSearch.store-24310860.js');
6
+ const imageSearch_store = require('./imageSearch.store-dc4e98b3.js');
7
7
 
8
8
  const vviinnPreloaderCss = ":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;animation:rotate 3s linear infinite;border:var(--preloader-width) solid white;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";
9
9
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const _package = require('./package-27d3ad12.js');
6
+ const _package = require('./package-af6d184f.js');
7
7
  const index$1 = require('./index-fcf59d51.js');
8
8
 
9
9
  const vviinnVprButtonCss = ":host{display:block}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const _package = require('./package-27d3ad12.js');
6
+ const _package = require('./package-af6d184f.js');
7
7
  const index$1 = require('./index-fcf59d51.js');
8
8
  const customizedSlots = require('./customized-slots-0a8d663c.js');
9
9
 
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const imageSearch_store = require('./imageSearch.store-24310860.js');
6
+ const imageSearch_store = require('./imageSearch.store-dc4e98b3.js');
7
7
  const i18next = require('./i18next-74ff3413.js');
8
- const _package = require('./package-27d3ad12.js');
8
+ const _package = require('./package-af6d184f.js');
9
9
  const customizedSlots = require('./customized-slots-0a8d663c.js');
10
- const index$1 = require('./index-6c6c5e1b.js');
10
+ const index$1 = require('./index-7ff2ab5f.js');
11
11
 
12
12
  const resources = {
13
13
  "de-DE": {
@@ -16434,7 +16434,7 @@ const emptyApiPathError = {
16434
16434
  };
16435
16435
 
16436
16436
  const stringMonoid = getMonoid(Monoid);
16437
- const getApiPath = () => pipe(getFirstMonoid().concat(fromNullable(state$1.apiPath), fromNullable(`${process.env.API_PATH}`)), fromOption$1(() => emptyApiPathError));
16437
+ const getApiPath = () => pipe(getFirstMonoid().concat(fromNullable(state$1.apiPath), fromNullable(`${"https://api.vviinn.com"}`)), fromOption$1(() => emptyApiPathError));
16438
16438
  const headersSemigroupSum = {
16439
16439
  concat: (x, y) => {
16440
16440
  const result = new Headers();
@@ -1,4 +1,4 @@
1
- import { n as commonjsGlobal, o as createCommonjsModule } from './imageSearch.store-b2df9ae3.js';
1
+ import { n as commonjsGlobal, o as createCommonjsModule } from './imageSearch.store-c0f2a178.js';
2
2
 
3
3
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
4
4
  // require the crypto API and do not support built-in fallback to lower quality random number
@@ -1,3 +1,3 @@
1
- const version = "2.31.0";
1
+ const version = "2.31.4";
2
2
 
3
3
  export { version as v };
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-1f3eaf12.js';
2
- import { i as imageSearchState, a as _function, O as Option, r as fromAlt, u as foldValueObject, v as scaleWithSized, w as center, x as makeRectangularSearchRequest, y as detectedObjectEq, z as toFile, B as processSelectedFile, E as Either, C as match, o as createCommonjsModule, n as commonjsGlobal, D as sequenceToOption, F as fromImage, G as dimensionsFromImage, H as scaleByLargestSide, N as NonEmptyArray } from './imageSearch.store-b2df9ae3.js';
2
+ import { i as imageSearchState, a as _function, O as Option, r as fromAlt, u as foldValueObject, v as scaleWithSized, w as center, x as makeRectangularSearchRequest, y as detectedObjectEq, z as toFile, B as processSelectedFile, E as Either, C as match, o as createCommonjsModule, n as commonjsGlobal, D as sequenceToOption, F as fromImage, G as dimensionsFromImage, H as scaleByLargestSide, N as NonEmptyArray } from './imageSearch.store-c0f2a178.js';
3
3
  import { i as instance } from './i18next-387f2b0a.js';
4
4
  import { s as slotChangeListener, c as campaignTypeNames } from './customized-slots-136b5f71.js';
5
5
  import { O as OnboardingCard1Icon, c as OnboardingCard2Icon, d as OnboardingCard3Icon, A as ArrowIcon } from './index-d1215e03.js';
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement, c as createEvent, F as Fragment } from './index-1f3eaf12.js';
2
- import { _ as _Array, O as Option, S as Semigroup, a as _function, h as has, t as tuple, E as Either, i as imageSearchState, s as state, p as pipe, c as chainW, m as makeRequest, f as fromEither, g as getApiPath, b as createInitGetRequest, A as Apply, d as map, e as match, j as arrayToQueryString, k as parseExcluded, T as TaskEither, l as checkEmpryString } from './imageSearch.store-b2df9ae3.js';
2
+ import { _ as _Array, O as Option, S as Semigroup, a as _function, h as has, t as tuple, E as Either, i as imageSearchState, s as state, p as pipe, c as chainW, m as makeRequest, f as fromEither, g as getApiPath, b as createInitGetRequest, A as Apply, d as map, e as match, j as arrayToQueryString, k as parseExcluded, T as TaskEither, l as checkEmpryString } from './imageSearch.store-c0f2a178.js';
3
3
  import { C as ChevronIcon } from './index-d1215e03.js';
4
4
  import { i as instance } from './i18next-387f2b0a.js';
5
5
  import { s as slotChangeListener, c as campaignTypeNames, f as fromString, a as fold, S as SlotSkeleton } from './customized-slots-136b5f71.js';
6
- import { v as version } from './package-5a7a3a18.js';
7
- import { v as v4, c as createTrackingApi, a as createAddToBasketVpcEvent, b as createAddToBasketVprEvent, d as createWidgetVpcEvent, e as createWidgetVprEvent, f as createResultVpcEventByType, g as createResultVprEventByType, h as createProductVpcEventByType, i as createProductVprEventByType } from './index-2a2eb584.js';
6
+ import { v as version } from './package-3e2a1157.js';
7
+ import { v as v4, c as createTrackingApi, a as createAddToBasketVpcEvent, b as createAddToBasketVprEvent, d as createWidgetVpcEvent, e as createWidgetVprEvent, f as createResultVpcEventByType, g as createResultVprEventByType, h as createProductVpcEventByType, i as createProductVprEventByType } from './index-53105ad4.js';
8
8
 
9
9
  const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#e0e0e0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button{fill:#525252}button:disabled{display:none}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";
10
10
 
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-1f3eaf12.js';
2
- import { i as imageSearchState } from './imageSearch.store-b2df9ae3.js';
2
+ import { i as imageSearchState } from './imageSearch.store-c0f2a178.js';
3
3
 
4
4
  const vviinnPreloaderCss = ":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;animation:rotate 3s linear infinite;border:var(--preloader-width) solid white;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-1f3eaf12.js';
2
- import { v as version } from './package-5a7a3a18.js';
2
+ import { v as version } from './package-3e2a1157.js';
3
3
  import { V as VisualSearchIcon } from './index-d1215e03.js';
4
4
 
5
5
  const vviinnVprButtonCss = ":host{display:block}";
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-1f3eaf12.js';
2
- import { v as version } from './package-5a7a3a18.js';
2
+ import { v as version } from './package-3e2a1157.js';
3
3
  import { a as CameraIcon } from './index-d1215e03.js';
4
4
  import { c as campaignTypeNames, S as SlotSkeleton } from './customized-slots-136b5f71.js';
5
5
 
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-1f3eaf12.js';
2
- import { i as imageSearchState, s as state, a as _function, O as Option, k as parseExcluded, q as isEmpty } from './imageSearch.store-b2df9ae3.js';
2
+ import { i as imageSearchState, s as state, a as _function, O as Option, k as parseExcluded, q as isEmpty } from './imageSearch.store-c0f2a178.js';
3
3
  import { i as instance } from './i18next-387f2b0a.js';
4
- import { v as version } from './package-5a7a3a18.js';
4
+ import { v as version } from './package-3e2a1157.js';
5
5
  import { c as campaignTypeNames, s as slotChangeListener, S as SlotSkeleton } from './customized-slots-136b5f71.js';
6
- import { j as createSearchEvent, k as createFilterEvent, v as v4, c as createTrackingApi, l as createWidgetVpsEvent, m as createProductVpsEventByType, n as createResultVpsEventByType } from './index-2a2eb584.js';
6
+ import { j as createSearchEvent, k as createFilterEvent, v as v4, c as createTrackingApi, l as createWidgetVpsEvent, m as createProductVpsEventByType, n as createResultVpsEventByType } from './index-53105ad4.js';
7
7
 
8
8
  const resources = {
9
9
  "de-DE": {
@@ -1 +1 @@
1
- import{r as i,c as t,h as s,H as h,g as n}from"./p-1e83e6ba.js";import{v as o}from"./p-3e403567.js";import{V as e}from"./p-a69d3568.js";const v=class{constructor(s){i(this,s),this.vviinnWidgetLoad=t(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=t(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=t(this,"vviinnWidgetClose",7),this.vviinnProductLoad=t(this,"vviinnProductLoad",7),this.vviinnProductClick=t(this,"vviinnProductClick",7),this.vviinnProductView=t(this,"vviinnProductView",7),this.vviinnResultLoad=t(this,"vviinnResultLoad",7),this.vviinnResultView=t(this,"vviinnResultView",7),this.vviinnNoResult=t(this,"vviinnNoResult",7),this.vviinnAddToBasket=t(this,"vviinnAddToBasket",7),this.sidebar=null,this.sidebarCloseListener=()=>{document.body.removeChild(this.sidebar)},this.token=void 0,this.productId=void 0,this.position="bottom",this.sourceImage=null,this.sidebarTitle="Visually similar products",this.modalScrollbar=!1,this.campaigns="",this.campaignType="VPR",this.locale="de-DE",this.color="",this.addStyle=!0,this.mode="continuity",this.imageWidth=300,this.currencySign="€",this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.excluded="",this.productDetailNewTab=!1,this.addToBasketShow=!1,this.apiPath="https://api.vviinn.com"}render(){return s(h,{onClick:()=>{this.handleClick()},role:"button",tabindex:"0"},s("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(e,null))))}handleClick(){const i=document.createElement("vviinn-recommendations-sidebar");i.sidebarTitle=this.sidebarTitle,i.productId=this.productId,i.token=this.token,i.position=this.position,i.sourceImage=this.sourceImage,i.widgetScrollbar=this.modalScrollbar,i.campaigns=this.campaigns,i.campaignType=this.campaignType,i.color=this.color,i.locale=this.locale,i.mode="right"===this.position?"grid":this.mode,i.imageWidth=this.imageWidth,i.currencySign=this.currencySign,i.apiPath=this.apiPath,i.buttonElementId=this.el.id,i.noResultText=this.noResultText,i.noResultShow=this.noResultShow,i.gridArrowsDynamic=this.gridArrowsDynamic,i.productDetailNewTab=this.productDetailNewTab,i.widgetVersion=o,i.showingInButton=!0,i.excluded=this.excluded,i.addToBasketShow=this.addToBasketShow,i.buttonChildren=this.el.children,this.sidebar=i,i.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&(this.sidebar.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.removeChild(this.sidebar))}get el(){return n(this)}};v.style=":host{display:block}";export{v as vviinn_vpr_button}
1
+ import{r as i,c as t,h as s,H as h,g as n}from"./p-1e83e6ba.js";import{v as o}from"./p-aace2b88.js";import{V as e}from"./p-a69d3568.js";const v=class{constructor(s){i(this,s),this.vviinnWidgetLoad=t(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=t(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=t(this,"vviinnWidgetClose",7),this.vviinnProductLoad=t(this,"vviinnProductLoad",7),this.vviinnProductClick=t(this,"vviinnProductClick",7),this.vviinnProductView=t(this,"vviinnProductView",7),this.vviinnResultLoad=t(this,"vviinnResultLoad",7),this.vviinnResultView=t(this,"vviinnResultView",7),this.vviinnNoResult=t(this,"vviinnNoResult",7),this.vviinnAddToBasket=t(this,"vviinnAddToBasket",7),this.sidebar=null,this.sidebarCloseListener=()=>{document.body.removeChild(this.sidebar)},this.token=void 0,this.productId=void 0,this.position="bottom",this.sourceImage=null,this.sidebarTitle="Visually similar products",this.modalScrollbar=!1,this.campaigns="",this.campaignType="VPR",this.locale="de-DE",this.color="",this.addStyle=!0,this.mode="continuity",this.imageWidth=300,this.currencySign="€",this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.excluded="",this.productDetailNewTab=!1,this.addToBasketShow=!1,this.apiPath="https://api.vviinn.com"}render(){return s(h,{onClick:()=>{this.handleClick()},role:"button",tabindex:"0"},s("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(e,null))))}handleClick(){const i=document.createElement("vviinn-recommendations-sidebar");i.sidebarTitle=this.sidebarTitle,i.productId=this.productId,i.token=this.token,i.position=this.position,i.sourceImage=this.sourceImage,i.widgetScrollbar=this.modalScrollbar,i.campaigns=this.campaigns,i.campaignType=this.campaignType,i.color=this.color,i.locale=this.locale,i.mode="right"===this.position?"grid":this.mode,i.imageWidth=this.imageWidth,i.currencySign=this.currencySign,i.apiPath=this.apiPath,i.buttonElementId=this.el.id,i.noResultText=this.noResultText,i.noResultShow=this.noResultShow,i.gridArrowsDynamic=this.gridArrowsDynamic,i.productDetailNewTab=this.productDetailNewTab,i.widgetVersion=o,i.showingInButton=!0,i.excluded=this.excluded,i.addToBasketShow=this.addToBasketShow,i.buttonChildren=this.el.children,this.sidebar=i,i.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&(this.sidebar.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.removeChild(this.sidebar))}get el(){return n(this)}};v.style=":host{display:block}";export{v as vviinn_vpr_button}
@@ -1,4 +1,4 @@
1
- import{r as t,c as i,h as n,H as e,g as s}from"./p-1e83e6ba.js";import{i as r,a as o,O as a,r as h,u as c,v as l,w as d,x as p,y as u,z as v,B as m,E as g,C as f,o as b,n as w,D as x,F as y,G as k,H as M,N as C}from"./p-73284c6c.js";import{i as z}from"./p-2e76a5c3.js";import{s as j,c as O}from"./p-5303d4a8.js";import{O as E,c as T,d as D,A as W}from"./p-a69d3568.js";const F=(t,i)=>{var n;if(!t)return"";const e={};return t.href.split("?")[1].split("included[]=").join("").split("&").forEach((t=>{const[i,n]=t.split("%3A");e[i]=n})),"categories"===i?null!==(n=e.product_type)&&void 0!==n?n:e.google_product_category:e[i]},L=class{constructor(n){t(this,n),this.vviinnSelectFilter=i(this,"vviinnSelectFilter",7),this.filterType=this.filter.name,this.filter=null,this.basicEventData=void 0,this.selectedFilter="",this.hideFilters=!0}isCategoriesFilterType(){return"categories"===this.filterType}getFilterKind(){return this.isCategoriesFilterType()?"category":this.filterType}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter(t):this.selectFilter(t)}selectFilter(t){r.activeIonLink=t,this.selectedFilter=F(t,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"select",kind:this.getFilterKind()}))}clearSelectedFilter(t){r.activeIonLink=t.clear,this.selectedFilter=F(t.clear,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"deselect",kind:this.getFilterKind()}))}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,i){"Enter"===t.key&&this.handleFilterSelection(i)}isFilterSelected(t){return this.isCategoriesFilterType()?this.selectedFilter===F(t,"categories"):this.selectedFilter===t.name}render(){if(!this.filter)return null;const{name:t,filters:i}=this.filter;return n(e,{exportparts:"filter, show-more-filters"},n("div",{class:{filters:!0,"no-scrollbar-mobile":this.isCategoriesFilterType(),"no-scrollbar":!this.isCategoriesFilterType()}},i.filter(((t,i)=>!this.hideFilters||i<5)).map(((i,e)=>{const s="categories"===t?this.selectedFilter===F(i,"categories"):this.selectedFilter===i.name;return n("div",{role:"button",tabindex:"0",key:e,part:s?"filter active":"filter",class:{filter:!0,active:s},style:{"animation-delay":10*e+"ms"},onPointerUp:t=>{r.loading||(t.stopPropagation(),this.handleFilterSelection(i))},onKeyPress:t=>{r.loading||this.handleEnter(t,i)}},i.name)})),this.hideFilters&&n("div",{class:{"show-more":!0,hidden:i.length<=5,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>{setTimeout((()=>this.toggleFilters()),300)},onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"})))}get el(){return s(this)}};L.style=".filters{display:flex;flex-direction:row;overflow-x:auto;padding-left:24px;padding-right:12px;margin-bottom:12px}.filter{align-items:center;color:#525252;cursor:pointer;display:flex;margin-right:12px;height:-moz-max-content;height:max-content;min-width:-moz-max-content;min-width:max-content;transition-property:background;transition-duration:0.5s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:10px 12px}.show-more{display:flex}.show-more.hidden{display:none !important}.show-more::after{position:relative;content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;transform:rotate(-90deg);left:2px}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}@media (max-width: 640px){.no-scrollbar-mobile{-ms-overflow-style:none;scrollbar-width:none}.no-scrollbar-mobile::-webkit-scrollbar{display:none}}";const A=class{constructor(n){t(this,n),this.vviinnSelectObject=i(this,"vviinnSelectObject",7),this.detectedObject=void 0,this.basicEventData=void 0,this.position=["0","0"]}getObjectPosition(){return o.pipe(r.imageBounds,a.map((t=>{const i=h(c(this.detectedObject).rectangle),{x:n,y:e}=o.pipe(i,l(t),d);return[`${n}px`,`${e}px`]})),a.getOrElse((()=>["0","0"])))}selectDetectedObject(){o.pipe(r.imageBounds,a.map((t=>{const i=c(this.detectedObject).rectangle,n=h(i),e=l(t)(n);r.detectedObject=this.detectedObject,r.searchArea=a.some(e)}))),p(),this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject}))}isActive(){if(!this.detectedObject)return!1;if(!r.detectedObject)return!1;const t=c(this.detectedObject),i=c(r.detectedObject);return u.equals(t,i)}render(){return n(e,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};A.style=':host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--size:32px;--x-position:0;--y-position:0;background:rgba(22, 22, 22, 0.4);border-radius:50%;border:none;cursor:pointer;display:block;height:var(--size);position:absolute;transition:opacity 0.25s;width:var(--size);z-index:2;transform:translate(\n calc(var(--x-position) - (var(--size) * 0.5)),\n calc(var(--y-position) - (var(--size) * 0.5))\n );transition:background 0.1 ease-in-out}:host(:hover){background:rgba(22, 22, 22, 0.6)}:host(.active){background:var(--color-primary, var(--color-primary-system)) !important;border:2px solid white}:host::after{--size:32px;border-radius:50%;content:"";cursor:pointer;display:block;height:calc(var(--size) * 0.25);transform:translate(\n calc(-50% + var(--size) * 0.5),\n calc(-50% + var(--size) * 0.5)\n );width:calc(var(--size) * 0.25);background:white}';const _=class{constructor(i){t(this,i)}render(){return n(e,null,n("vviinn-error",null,n("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z",fill:"#525252"}),n("path",{d:"M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",fill:"#525252"})),n("h4",{slot:"title"},z.t("emptyResultsBlock.title")),n("span",{slot:"text"},z.t("emptyResultsBlock.text"))))}};_.style=":host{display:grid}vviinn-error{justify-items:center}";const N=class{constructor(n){t(this,n),this.vviinnImageUpload=i(this,"vviinnImageUpload",7),this.vviinnNoResult=i(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=i(this,"vviinnImageUploadFinished",7),this.src="",this.width=0,this.height=0,this.basicEventData=void 0,this.selected=!1}async selectImage(){this.selected=!0,this.vviinnImageUpload.emit(this.basicEventData);const t=await v(this.src),i=await m(t);o.pipe(i,g.match((()=>this.vviinnNoResult.emit(this.basicEventData)),(()=>this.vviinnImageUploadFinished.emit()))),this.selected=!1}handleKeyPress({key:t}){"Enter"!==t&&" "!==t||this.selectImage()}showPreloader(){return(r.objectDetectionInProgress||r.loading)&&this.selected}render(){return n(e,{onClick:()=>this.selectImage(),onKeyUp:t=>this.handleKeyPress(t)},this.showPreloader()?n("div",{class:"image-preloader"},n("vviinn-preloader",null)):null,n("img",{src:this.src,width:this.width,height:this.height,tabindex:1}))}};N.style=":host{display:block;margin-bottom:8px;position:relative}:host(:focus){border:2px solid var(--color-primary)}img{width:100%;height:auto;cursor:pointer}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:12px;display:none;padding:4px 6px;position:absolute;right:12px;z-index:4}vviinn-preloader{--preloader-size:12px}@media (max-width: 640px){.image-preloader{display:block}}";const S=class{constructor(n){t(this,n),this.vviinnImageUpload=i(this,"vviinnImageUpload",7),this.vviinnNoResult=i(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=i(this,"vviinnImageUploadFinished",7),this.basicEventData=void 0,this.exampleImagesTitle=void 0}componentWillLoad(){j(this,this.el)}delegateFocus(){this.imagesBlock.childNodes[0].childNodes[0].focus()}render(){return n(e,{onFocus:()=>this.delegateFocus()},n("slot",{name:"vviinn-example-images-title"},n("h3",null,this.exampleImagesTitle)),n("div",{class:"images",ref:t=>this.imagesBlock=t},n("slot",{name:"vviinn-example-images-1"},n("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc=",basicEventData:this.basicEventData})),n("slot",{name:"vviinn-example-images-2"},n("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc=",basicEventData:this.basicEventData})),n("slot",{name:"vviinn-example-images-3"},n("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc=",basicEventData:this.basicEventData})),n("slot",{name:"vviinn-example-images-4"},n("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc=",basicEventData:this.basicEventData}))))}get el(){return s(this)}};S.style="h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}.images{display:block;-moz-column-count:2;column-count:2;-moz-column-gap:16px;column-gap:16px}";const B=class{constructor(n){t(this,n),this.vviinnImageUpload=i(this,"vviinnImageUpload",7),this.vviinnNoResult=i(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=i(this,"vviinnImageUploadFinished",7),this.basicEventData=void 0,this.startUpload=void 0,this.resetVpsButton=void 0}async handleInputChange(t){this.vviinnImageUpload.emit(this.basicEventData);const i=t.target,n=await m(i.files[0]);o.pipe(n,f((()=>this.vviinnNoResult.emit(this.basicEventData)),(()=>this.vviinnImageUploadFinished.emit()))),i.value=null}isLoading(){return r.loading}startUploadWatcher(t){t&&(this.fileInput.click(),this.resetVpsButton())}render(){return n(e,{exportparts:"button"},this.isLoading()?n("vviinn-preloader",null):null,this.isLoading()?null:n("label",{htmlFor:"fileInput",part:"button"},n("slot",{name:"upload-button-text"},"Upload image")),n("input",{id:"fileInput",class:"visually-hidden",type:"file",accept:"image/*",onChange:t=>this.handleInputChange(t),ref:t=>this.fileInput=t}))}static get watchers(){return{startUpload:["startUploadWatcher"]}}};B.style=":host{display:block}:host(::hover){background:whitesmoke}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;width:100%;height:100%;transition:background 0.1s ease-in-out}";var R=b((function(t){
1
+ import{r as t,c as i,h as n,H as e,g as s}from"./p-1e83e6ba.js";import{i as r,a as o,O as a,r as h,u as c,v as l,w as d,x as p,y as u,z as v,B as m,E as g,C as f,o as b,n as w,D as x,F as y,G as k,H as M,N as C}from"./p-987a8e9f.js";import{i as z}from"./p-2e76a5c3.js";import{s as j,c as O}from"./p-5303d4a8.js";import{O as E,c as T,d as D,A as W}from"./p-a69d3568.js";const F=(t,i)=>{var n;if(!t)return"";const e={};return t.href.split("?")[1].split("included[]=").join("").split("&").forEach((t=>{const[i,n]=t.split("%3A");e[i]=n})),"categories"===i?null!==(n=e.product_type)&&void 0!==n?n:e.google_product_category:e[i]},L=class{constructor(n){t(this,n),this.vviinnSelectFilter=i(this,"vviinnSelectFilter",7),this.filterType=this.filter.name,this.filter=null,this.basicEventData=void 0,this.selectedFilter="",this.hideFilters=!0}isCategoriesFilterType(){return"categories"===this.filterType}getFilterKind(){return this.isCategoriesFilterType()?"category":this.filterType}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter(t):this.selectFilter(t)}selectFilter(t){r.activeIonLink=t,this.selectedFilter=F(t,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"select",kind:this.getFilterKind()}))}clearSelectedFilter(t){r.activeIonLink=t.clear,this.selectedFilter=F(t.clear,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"deselect",kind:this.getFilterKind()}))}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,i){"Enter"===t.key&&this.handleFilterSelection(i)}isFilterSelected(t){return this.isCategoriesFilterType()?this.selectedFilter===F(t,"categories"):this.selectedFilter===t.name}render(){if(!this.filter)return null;const{name:t,filters:i}=this.filter;return n(e,{exportparts:"filter, show-more-filters"},n("div",{class:{filters:!0,"no-scrollbar-mobile":this.isCategoriesFilterType(),"no-scrollbar":!this.isCategoriesFilterType()}},i.filter(((t,i)=>!this.hideFilters||i<5)).map(((i,e)=>{const s="categories"===t?this.selectedFilter===F(i,"categories"):this.selectedFilter===i.name;return n("div",{role:"button",tabindex:"0",key:e,part:s?"filter active":"filter",class:{filter:!0,active:s},style:{"animation-delay":10*e+"ms"},onPointerUp:t=>{r.loading||(t.stopPropagation(),this.handleFilterSelection(i))},onKeyPress:t=>{r.loading||this.handleEnter(t,i)}},i.name)})),this.hideFilters&&n("div",{class:{"show-more":!0,hidden:i.length<=5,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>{setTimeout((()=>this.toggleFilters()),300)},onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"})))}get el(){return s(this)}};L.style=".filters{display:flex;flex-direction:row;overflow-x:auto;padding-left:24px;padding-right:12px;margin-bottom:12px}.filter{align-items:center;color:#525252;cursor:pointer;display:flex;margin-right:12px;height:-moz-max-content;height:max-content;min-width:-moz-max-content;min-width:max-content;transition-property:background;transition-duration:0.5s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:10px 12px}.show-more{display:flex}.show-more.hidden{display:none !important}.show-more::after{position:relative;content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;transform:rotate(-90deg);left:2px}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}@media (max-width: 640px){.no-scrollbar-mobile{-ms-overflow-style:none;scrollbar-width:none}.no-scrollbar-mobile::-webkit-scrollbar{display:none}}";const A=class{constructor(n){t(this,n),this.vviinnSelectObject=i(this,"vviinnSelectObject",7),this.detectedObject=void 0,this.basicEventData=void 0,this.position=["0","0"]}getObjectPosition(){return o.pipe(r.imageBounds,a.map((t=>{const i=h(c(this.detectedObject).rectangle),{x:n,y:e}=o.pipe(i,l(t),d);return[`${n}px`,`${e}px`]})),a.getOrElse((()=>["0","0"])))}selectDetectedObject(){o.pipe(r.imageBounds,a.map((t=>{const i=c(this.detectedObject).rectangle,n=h(i),e=l(t)(n);r.detectedObject=this.detectedObject,r.searchArea=a.some(e)}))),p(),this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject}))}isActive(){if(!this.detectedObject)return!1;if(!r.detectedObject)return!1;const t=c(this.detectedObject),i=c(r.detectedObject);return u.equals(t,i)}render(){return n(e,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};A.style=':host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--size:32px;--x-position:0;--y-position:0;background:rgba(22, 22, 22, 0.4);border-radius:50%;border:none;cursor:pointer;display:block;height:var(--size);position:absolute;transition:opacity 0.25s;width:var(--size);z-index:2;transform:translate(\n calc(var(--x-position) - (var(--size) * 0.5)),\n calc(var(--y-position) - (var(--size) * 0.5))\n );transition:background 0.1 ease-in-out}:host(:hover){background:rgba(22, 22, 22, 0.6)}:host(.active){background:var(--color-primary, var(--color-primary-system)) !important;border:2px solid white}:host::after{--size:32px;border-radius:50%;content:"";cursor:pointer;display:block;height:calc(var(--size) * 0.25);transform:translate(\n calc(-50% + var(--size) * 0.5),\n calc(-50% + var(--size) * 0.5)\n );width:calc(var(--size) * 0.25);background:white}';const _=class{constructor(i){t(this,i)}render(){return n(e,null,n("vviinn-error",null,n("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z",fill:"#525252"}),n("path",{d:"M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",fill:"#525252"})),n("h4",{slot:"title"},z.t("emptyResultsBlock.title")),n("span",{slot:"text"},z.t("emptyResultsBlock.text"))))}};_.style=":host{display:grid}vviinn-error{justify-items:center}";const N=class{constructor(n){t(this,n),this.vviinnImageUpload=i(this,"vviinnImageUpload",7),this.vviinnNoResult=i(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=i(this,"vviinnImageUploadFinished",7),this.src="",this.width=0,this.height=0,this.basicEventData=void 0,this.selected=!1}async selectImage(){this.selected=!0,this.vviinnImageUpload.emit(this.basicEventData);const t=await v(this.src),i=await m(t);o.pipe(i,g.match((()=>this.vviinnNoResult.emit(this.basicEventData)),(()=>this.vviinnImageUploadFinished.emit()))),this.selected=!1}handleKeyPress({key:t}){"Enter"!==t&&" "!==t||this.selectImage()}showPreloader(){return(r.objectDetectionInProgress||r.loading)&&this.selected}render(){return n(e,{onClick:()=>this.selectImage(),onKeyUp:t=>this.handleKeyPress(t)},this.showPreloader()?n("div",{class:"image-preloader"},n("vviinn-preloader",null)):null,n("img",{src:this.src,width:this.width,height:this.height,tabindex:1}))}};N.style=":host{display:block;margin-bottom:8px;position:relative}:host(:focus){border:2px solid var(--color-primary)}img{width:100%;height:auto;cursor:pointer}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:12px;display:none;padding:4px 6px;position:absolute;right:12px;z-index:4}vviinn-preloader{--preloader-size:12px}@media (max-width: 640px){.image-preloader{display:block}}";const S=class{constructor(n){t(this,n),this.vviinnImageUpload=i(this,"vviinnImageUpload",7),this.vviinnNoResult=i(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=i(this,"vviinnImageUploadFinished",7),this.basicEventData=void 0,this.exampleImagesTitle=void 0}componentWillLoad(){j(this,this.el)}delegateFocus(){this.imagesBlock.childNodes[0].childNodes[0].focus()}render(){return n(e,{onFocus:()=>this.delegateFocus()},n("slot",{name:"vviinn-example-images-title"},n("h3",null,this.exampleImagesTitle)),n("div",{class:"images",ref:t=>this.imagesBlock=t},n("slot",{name:"vviinn-example-images-1"},n("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc=",basicEventData:this.basicEventData})),n("slot",{name:"vviinn-example-images-2"},n("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc=",basicEventData:this.basicEventData})),n("slot",{name:"vviinn-example-images-3"},n("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc=",basicEventData:this.basicEventData})),n("slot",{name:"vviinn-example-images-4"},n("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc=",basicEventData:this.basicEventData}))))}get el(){return s(this)}};S.style="h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}.images{display:block;-moz-column-count:2;column-count:2;-moz-column-gap:16px;column-gap:16px}";const B=class{constructor(n){t(this,n),this.vviinnImageUpload=i(this,"vviinnImageUpload",7),this.vviinnNoResult=i(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=i(this,"vviinnImageUploadFinished",7),this.basicEventData=void 0,this.startUpload=void 0,this.resetVpsButton=void 0}async handleInputChange(t){this.vviinnImageUpload.emit(this.basicEventData);const i=t.target,n=await m(i.files[0]);o.pipe(n,f((()=>this.vviinnNoResult.emit(this.basicEventData)),(()=>this.vviinnImageUploadFinished.emit()))),i.value=null}isLoading(){return r.loading}startUploadWatcher(t){t&&(this.fileInput.click(),this.resetVpsButton())}render(){return n(e,{exportparts:"button"},this.isLoading()?n("vviinn-preloader",null):null,this.isLoading()?null:n("label",{htmlFor:"fileInput",part:"button"},n("slot",{name:"upload-button-text"},"Upload image")),n("input",{id:"fileInput",class:"visually-hidden",type:"file",accept:"image/*",onChange:t=>this.handleInputChange(t),ref:t=>this.fileInput=t}))}static get watchers(){return{startUpload:["startUploadWatcher"]}}};B.style=":host{display:block}:host(::hover){background:whitesmoke}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;width:100%;height:100%;transition:background 0.1s ease-in-out}";var R=b((function(t){
2
2
  /*!
3
3
  * Cropper.js v1.5.13
4
4
  * https://fengyuanchen.github.io/cropperjs