vviinn-widgets 2.18.21 → 2.19.1

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 (183) hide show
  1. package/dist/cjs/{index-cb410762.js → Campaign-a94a827a.js} +17 -1
  2. package/dist/cjs/cropper-handler_29.cjs.entry.js +1418 -0
  3. package/dist/cjs/{imageSearch.store-98824653.js → index-48c94264.js} +16016 -11171
  4. package/dist/cjs/{index-7f1325a7.js → index-a4becaff.js} +683 -303
  5. package/dist/cjs/loader.cjs.js +4 -3
  6. package/dist/cjs/{vviinn-carousel_3.cjs.entry.js → vviinn-carousel_2.cjs.entry.js} +150 -270
  7. package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +14 -8
  8. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +12 -14
  9. package/dist/cjs/vviinn-widgets.cjs.js +10 -3
  10. package/dist/collection/Image/sizing.spec.js +66 -0
  11. package/dist/collection/collection-manifest.json +2 -2
  12. package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.css +2 -16
  13. package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.js +11 -7
  14. package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.css +0 -1
  15. package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.js +40 -37
  16. package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.js +73 -67
  17. package/dist/collection/components/image-search/search-filters/search-filters.css +4 -23
  18. package/dist/collection/components/image-search/search-filters/search-filters.js +97 -91
  19. package/dist/collection/components/vviinn-button/vviinn-button.js +34 -31
  20. package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +1 -2
  21. package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +161 -156
  22. package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +12 -14
  23. package/dist/collection/components/vviinn-error/vviinn-error.js +12 -12
  24. package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +35 -30
  25. package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js +35 -30
  26. package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js +129 -121
  27. package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +75 -75
  28. package/dist/collection/components/vviinn-icons/index.js +10 -27
  29. package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +120 -67
  30. package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +81 -69
  31. package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +0 -1
  32. package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +27 -28
  33. package/dist/collection/components/vviinn-modal/vviinn-modal.css +7 -36
  34. package/dist/collection/components/vviinn-modal/vviinn-modal.js +115 -93
  35. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +12 -14
  36. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +12 -14
  37. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +12 -14
  38. package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +12 -17
  39. package/dist/collection/components/vviinn-overlay/vviinn-overlay.css +1 -12
  40. package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +12 -9
  41. package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +107 -78
  42. package/dist/collection/components/vviinn-preloader/vviinn-preloader.css +1 -11
  43. package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +11 -7
  44. package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.css +0 -1
  45. package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +12 -16
  46. package/dist/collection/components/vviinn-product-card/render-helpers.js +6 -14
  47. package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +425 -415
  48. package/dist/collection/components/vviinn-slider/arrow.js +1 -2
  49. package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +12 -9
  50. package/dist/collection/components/vviinn-slider/vviinn-slider.css +0 -1
  51. package/dist/collection/components/vviinn-slider/vviinn-slider.js +87 -82
  52. package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +12 -18
  53. package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +12 -64
  54. package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +371 -360
  55. package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +448 -444
  56. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +545 -542
  57. package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +2 -0
  58. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +368 -332
  59. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +0 -5
  60. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.e2e.js +26 -0
  61. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +502 -425
  62. package/dist/collection/geometry/Clip.spec.js +16 -0
  63. package/dist/collection/geometry/Rectangle.spec.js +66 -0
  64. package/dist/collection/geometry/Sized.spec.js +16 -0
  65. package/dist/collection/interfaces/generated.js +0 -4
  66. package/dist/collection/network/ion/Form.spec.js +43 -0
  67. package/dist/esm/{index-b31d86ce.js → Campaign-4aa53f29.js} +15 -2
  68. package/dist/esm/cropper-handler_29.entry.js +1386 -0
  69. package/dist/esm/{index-590cb67e.js → index-48ef9564.js} +683 -304
  70. package/dist/esm/{imageSearch.store-9dde5360.js → index-976acf7e.js} +16124 -11292
  71. package/dist/esm/loader.js +4 -3
  72. package/dist/esm/polyfills/css-shim.js +1 -1
  73. package/dist/esm/{vviinn-carousel_3.entry.js → vviinn-carousel_2.entry.js} +106 -225
  74. package/dist/esm/vviinn-recommendations-sidebar.entry.js +13 -7
  75. package/dist/esm/vviinn-vpr-button.entry.js +11 -13
  76. package/dist/esm/vviinn-widgets.js +7 -3
  77. package/dist/loader/index.d.ts +9 -0
  78. package/dist/loader/package.json +1 -0
  79. package/dist/types/Image/sizing.d.ts +4 -4
  80. package/dist/types/campaign/Campaign.d.ts +5 -5
  81. package/dist/types/campaign/VCSCampaignResponse.d.ts +1 -1
  82. package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +2 -2
  83. package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +4 -0
  84. package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +2 -0
  85. package/dist/types/components/vviinn-overlayed-modal/vviinn-overlayed-modal.d.ts +2 -0
  86. package/dist/types/components/vviinn-product-card/render-helpers.d.ts +3 -3
  87. package/dist/types/components/vviinn-slider/arrow.d.ts +2 -2
  88. package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +2 -2
  89. package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +9 -4
  90. package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +8 -0
  91. package/dist/types/components.d.ts +154 -54
  92. package/dist/types/error.d.ts +1 -1
  93. package/dist/types/geometry/Point.d.ts +1 -1
  94. package/dist/types/geometry/Rectangle.d.ts +1 -1
  95. package/dist/types/geometry/Sized.d.ts +1 -1
  96. package/dist/types/interfaces/generated.d.ts +192 -371
  97. package/dist/types/network/ion/File.d.ts +2 -2
  98. package/dist/types/network/ion/Form.d.ts +5 -5
  99. package/dist/types/network/ion/Link.d.ts +1 -1
  100. package/dist/types/network/ion/ValueObject.d.ts +4 -4
  101. package/dist/types/network/utils.d.ts +3 -3
  102. package/dist/types/recommendation/events.d.ts +5 -5
  103. package/dist/types/recommendation/recommendation.d.ts +1 -1
  104. package/dist/types/searchSession/searchSession.d.ts +7 -7
  105. package/dist/types/slider/GridMode.d.ts +1 -1
  106. package/dist/types/stencil-public-runtime.d.ts +98 -23
  107. package/dist/types/store/imageSearch.store.d.ts +1 -1
  108. package/dist/types/tracking/models.d.ts +2 -2
  109. package/dist/types/utils/event/Events.d.ts +1 -1
  110. package/dist/vviinn-widgets/p-312b0eb7.entry.js +1 -0
  111. package/dist/vviinn-widgets/p-414b2291.js +1 -0
  112. package/dist/vviinn-widgets/p-5b50c7e5.entry.js +1 -0
  113. package/dist/vviinn-widgets/p-8deaa5da.entry.js +1 -0
  114. package/dist/vviinn-widgets/p-c6209bc1.entry.js +1 -0
  115. package/{www/build/p-2f9ee951.js → dist/vviinn-widgets/p-d08ce429.js} +1 -1
  116. package/dist/vviinn-widgets/p-fa17e81f.js +2 -0
  117. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  118. package/package.json +12 -12
  119. package/www/build/p-312b0eb7.entry.js +1 -0
  120. package/www/build/p-414b2291.js +1 -0
  121. package/www/build/p-5b50c7e5.entry.js +1 -0
  122. package/www/build/p-8deaa5da.entry.js +1 -0
  123. package/www/build/p-c6209bc1.entry.js +1 -0
  124. package/{dist/vviinn-widgets/p-2f9ee951.js → www/build/p-d08ce429.js} +1 -1
  125. package/www/build/p-d39b7d70.js +161 -0
  126. package/www/build/p-fa17e81f.js +2 -0
  127. package/www/build/vviinn-widgets.esm.js +1 -1
  128. package/www/index.html +2 -2
  129. package/dist/cjs/Campaign-13258569.js +0 -18
  130. package/dist/cjs/Handler-176539c8.js +0 -331
  131. package/dist/cjs/cropper-handler.cjs.entry.js +0 -27
  132. package/dist/cjs/customized-slots-6e56c354.js +0 -54
  133. package/dist/cjs/highlight-box_22.cjs.entry.js +0 -770
  134. package/dist/cjs/index-a99edb90.js +0 -3235
  135. package/dist/cjs/vviinn-button.cjs.entry.js +0 -21
  136. package/dist/cjs/vviinn-error.cjs.entry.js +0 -19
  137. package/dist/cjs/vviinn-preloader.cjs.entry.js +0 -26
  138. package/dist/cjs/vviinn-vps-button.cjs.entry.js +0 -65
  139. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +0 -251
  140. package/dist/esm/Campaign-90ba7e06.js +0 -14
  141. package/dist/esm/Handler-f9b8735c.js +0 -309
  142. package/dist/esm/cropper-handler.entry.js +0 -23
  143. package/dist/esm/customized-slots-00afe247.js +0 -51
  144. package/dist/esm/highlight-box_22.entry.js +0 -745
  145. package/dist/esm/index-4d5b52ba.js +0 -3224
  146. package/dist/esm/vviinn-button.entry.js +0 -17
  147. package/dist/esm/vviinn-error.entry.js +0 -15
  148. package/dist/esm/vviinn-preloader.entry.js +0 -22
  149. package/dist/esm/vviinn-vps-button.entry.js +0 -61
  150. package/dist/esm/vviinn-vps-widget.entry.js +0 -247
  151. package/dist/vviinn-widgets/p-11f61564.js +0 -1
  152. package/dist/vviinn-widgets/p-12851e97.entry.js +0 -1
  153. package/dist/vviinn-widgets/p-18fd769b.js +0 -1
  154. package/dist/vviinn-widgets/p-339c6838.js +0 -1
  155. package/dist/vviinn-widgets/p-3b2c91c0.entry.js +0 -1
  156. package/dist/vviinn-widgets/p-45df9f28.entry.js +0 -1
  157. package/dist/vviinn-widgets/p-57ed5303.entry.js +0 -1
  158. package/dist/vviinn-widgets/p-69850e5b.js +0 -1
  159. package/dist/vviinn-widgets/p-7c2f762a.entry.js +0 -1
  160. package/dist/vviinn-widgets/p-7c3b7388.entry.js +0 -1
  161. package/dist/vviinn-widgets/p-85006f41.entry.js +0 -1
  162. package/dist/vviinn-widgets/p-8a3dd76d.entry.js +0 -1
  163. package/dist/vviinn-widgets/p-99e58be7.entry.js +0 -1
  164. package/dist/vviinn-widgets/p-a2b450b6.entry.js +0 -1
  165. package/dist/vviinn-widgets/p-bcc1ccf0.js +0 -1
  166. package/dist/vviinn-widgets/p-e6fee8d2.js +0 -1
  167. package/www/build/p-11f61564.js +0 -1
  168. package/www/build/p-12851e97.entry.js +0 -1
  169. package/www/build/p-18fd769b.js +0 -1
  170. package/www/build/p-339c6838.js +0 -1
  171. package/www/build/p-3b2c91c0.entry.js +0 -1
  172. package/www/build/p-45df9f28.entry.js +0 -1
  173. package/www/build/p-57ed5303.entry.js +0 -1
  174. package/www/build/p-69850e5b.js +0 -1
  175. package/www/build/p-7c2f762a.entry.js +0 -1
  176. package/www/build/p-7c3b7388.entry.js +0 -1
  177. package/www/build/p-85006f41.entry.js +0 -1
  178. package/www/build/p-8a3dd76d.entry.js +0 -1
  179. package/www/build/p-99e58be7.entry.js +0 -1
  180. package/www/build/p-9e2c131a.js +0 -125
  181. package/www/build/p-a2b450b6.entry.js +0 -1
  182. package/www/build/p-bcc1ccf0.js +0 -1
  183. package/www/build/p-e6fee8d2.js +0 -1
@@ -1,745 +0,0 @@
1
- import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './index-590cb67e.js';
2
- import { O as Option, o as sequenceToOption, i as imageSearchState, a as _function, t as transform, p as move, q as makeRectangularSearchRequest, r as fromAlt, u as foldValueObject, v as scaleWithSized, w as center, x as detectedObjectEq, y as toFile, z as processSelectedFile, E as Either, B as match, C as fromImage, D as dimensionsFromImage, F as scaleByLargestSide, N as NonEmptyArray } from './imageSearch.store-9dde5360.js';
3
- import { p as pipe, o as pointDiffSemigroup, q as fromMouseEvent } from './Handler-f9b8735c.js';
4
- import { c as CheckIcon, O as OnboardingCard1Icon, d as OnboardingCard2Icon, e as OnboardingCard3Icon, A as ArrowIcon } from './index-b31d86ce.js';
5
- import { s as slotChangeListener } from './customized-slots-00afe247.js';
6
- import { c as campaignTypeNames } from './Campaign-90ba7e06.js';
7
-
8
- // -------------------------------------------------------------------------------------
9
- // -------------------------------------------------------------------------------------
10
- // instances
11
- // -------------------------------------------------------------------------------------
12
- /**
13
- * @category instances
14
- * @since 2.10.0
15
- */
16
- var Eq = {
17
- equals: function (first, second) { return first === second; }
18
- };
19
- /**
20
- * @category instances
21
- * @since 2.10.0
22
- */
23
- var Ord = {
24
- equals: Eq.equals,
25
- compare: function (first, second) { return (first < second ? -1 : first > second ? 1 : 0); }
26
- };
27
-
28
- const fromRectangle = (shape, target) => {
29
- const top = `${shape.y}px`;
30
- const left = `${shape.x}px`;
31
- const right = `${target.width - (shape.x + shape.width)}px`;
32
- const bottom = `${target.height - (shape.y + shape.height)}px`;
33
- return {
34
- top,
35
- right,
36
- bottom,
37
- left,
38
- };
39
- };
40
- const printClip = (clip) => `inset(${clip.top} ${clip.right} ${clip.bottom} ${clip.left})`;
41
- const getClipValue = (shape, target) => printClip(fromRectangle(shape, target));
42
-
43
- const highlightBoxCss = ":host{display:grid;position:absolute;box-sizing:border-box;border:none;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;--size:10px;--x-position:0;--y-position:0}img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pointer{position:absolute;width:var(--size);height:var(--size);background:black;border-radius:50%;z-index:2;cursor:pointer;transform:translate(var(--x-position), var(--y-position)) scale(0);-webkit-animation:0.25s linear fadein;animation:0.25s linear fadein;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.pointer::after{content:\"\";cursor:pointer;border:5px solid black;border-radius:50%;width:var(--size);height:var(--size);display:block;transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));padding:calc(var(--size) * 0.5);opacity:.75}@-webkit-keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}@keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}";
44
-
45
- let HighlightBox = class {
46
- constructor(hostRef) {
47
- registerInstance(this, hostRef);
48
- }
49
- getInsetValue() {
50
- return pipe(sequenceToOption(imageSearchState.searchArea, imageSearchState.imageBounds), Option.map(([selection, image]) => getClipValue(selection, image)), Option.getOrElse(() => ""));
51
- }
52
- renderImage() {
53
- return pipe(sequenceToOption(imageSearchState.imageUrl, imageSearchState.imageBounds), Option.map(([url, bounds]) => (h("img", { src: url, width: bounds.width, height: bounds.height, style: { "clip-path": `${this.getInsetValue()}` } }))), Option.getOrElse(() => ""));
54
- }
55
- render() {
56
- return h(Host, null, this.renderImage());
57
- }
58
- };
59
- HighlightBox.style = highlightBoxCss;
60
-
61
- const findTarget = (ev) => {
62
- return ev.target;
63
- };
64
-
65
- const imageCropperCss = ":host{display:block;height:100%;left:0;position:absolute;top:0;width:100%}:host(.hidden){visibility:hidden}.crop-area{border:1px solid white;box-sizing:border-box;position:absolute;touch-action:none;transition-property:border-color, opacity;transition-duration:.25s;transition-timing-function:ease-in-out;z-index:2;position:relative;will-change:transform}.crop-area.active{border-color:whitesmoke}.crop-area.disabled{opacity:0.25}";
66
-
67
- const MIN_SEARCHAREA_SIZE = 40;
68
- let ImageCropper = class {
69
- constructor(hostRef) {
70
- registerInstance(this, hostRef);
71
- this.vviinnImageCrop = createEvent(this, "vviinnImageCrop", 7);
72
- this.disabled = false;
73
- this.handleMove = false;
74
- this.mouseStartPoint = undefined;
75
- this.bounds = undefined;
76
- this.resizeObserver = new ResizeObserver(() => {
77
- this.bounds = this.el.getBoundingClientRect();
78
- });
79
- }
80
- componentDidLoad() {
81
- this.resizeObserver.observe(this.el);
82
- }
83
- disconnectedCallback() {
84
- this.resizeObserver.disconnect();
85
- }
86
- handleHandlerMove(event) {
87
- event.preventDefault();
88
- event.stopPropagation();
89
- const destination = fromMouseEvent(event);
90
- const distance = pointDiffSemigroup.concat(destination, this.mouseStartPoint);
91
- const transformedHandler = {
92
- position: distance,
93
- direction: this.handlerMoveDirection,
94
- };
95
- _function.pipe(imageSearchState.searchArea, Option.map((area) => {
96
- const newSearchArea = transform(area, transformedHandler);
97
- if (this.outOfBounds(newSearchArea))
98
- return;
99
- imageSearchState.searchArea = Option.some(newSearchArea);
100
- this.mouseStartPoint = destination;
101
- imageSearchState.detectedObject = undefined;
102
- }));
103
- }
104
- outOfBounds(area) {
105
- return (area.width < MIN_SEARCHAREA_SIZE ||
106
- area.height < MIN_SEARCHAREA_SIZE ||
107
- area.x < 0 ||
108
- area.y < 0 ||
109
- this.bounds.height - (area.y + area.height) < 0 ||
110
- this.bounds.width - (area.x + area.width) < 0);
111
- }
112
- handleCropperMove(ev) {
113
- ev.preventDefault();
114
- ev.stopPropagation();
115
- const destination = fromMouseEvent(ev);
116
- const distance = pointDiffSemigroup.concat(destination, this.mouseStartPoint);
117
- _function.pipe(imageSearchState.searchArea, Option.map((searchArea) => {
118
- const newSearchArea = move(searchArea, distance);
119
- if (newSearchArea.x < 0 ||
120
- newSearchArea.y < 0 ||
121
- this.bounds.height - (newSearchArea.y + newSearchArea.height) < 0 ||
122
- this.bounds.width - (newSearchArea.x + newSearchArea.width) < 0)
123
- return;
124
- imageSearchState.detectedObject = undefined;
125
- imageSearchState.searchArea = Option.some(newSearchArea);
126
- this.mouseStartPoint = destination;
127
- }));
128
- }
129
- handlePointerDown(event) {
130
- event.stopPropagation();
131
- this.mouseStartPoint = fromMouseEvent(event);
132
- // should be htmlelement or handler
133
- const target = findTarget(event);
134
- if (target.localName === "cropper-handler") {
135
- this.handlerMoveDirection = target.handler.direction;
136
- this.pointerMoveListener = this.handleHandlerMove.bind(this);
137
- }
138
- else {
139
- this.pointerMoveListener = this.handleCropperMove.bind(this);
140
- }
141
- this.pointerReleaseListener = this.handleSearchAreaRelease.bind(this);
142
- this.el.addEventListener("pointermove", this.pointerMoveListener);
143
- window.addEventListener("pointerup", this.pointerReleaseListener, {
144
- once: true,
145
- });
146
- }
147
- handleSearchAreaRelease() {
148
- this.el.removeEventListener("pointermove", this.pointerMoveListener);
149
- document.removeEventListener("pointerup", this.pointerReleaseListener);
150
- this.mouseStartPoint = undefined;
151
- makeRectangularSearchRequest();
152
- this.vviinnImageCrop.emit(this.basicEventData);
153
- }
154
- getStyleMap() {
155
- return _function.pipe(imageSearchState.searchArea, Option.map((rectangle) => {
156
- return {
157
- width: `${rectangle.width}px`,
158
- height: `${rectangle.height}px`,
159
- transform: `translate3d(${rectangle.x}px, ${rectangle.y}px, 0)`,
160
- cursor: this.handleMove ? "move" : "default",
161
- };
162
- }), Option.getOrElse(() => {
163
- return {};
164
- }));
165
- }
166
- render() {
167
- return (h(Host, { exportparts: "handle, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize" }, h("div", { class: {
168
- "crop-area": true,
169
- active: this.handleMove,
170
- disabled: this.disabled,
171
- }, draggable: false, style: this.getStyleMap(), onContextMenu: () => false, onPointerDown: (ev) => this.handlePointerDown(ev) }, imageSearchState.cropperHandlers.map((handler) => (h("cropper-handler", { disabled: this.disabled, handler: handler, onPointerDown: (ev) => this.handlePointerDown(ev) }))))));
172
- }
173
- get el() { return getElement(this); }
174
- };
175
- ImageCropper.style = imageCropperCss;
176
-
177
- const searchFiltersCss = ":host{display:grid;grid-gap:1rem}.filters{display:flex;flex-direction:row;flex-wrap:wrap;gap:0.5rem}.filter{align-items:center;-webkit-animation-duration:0.25s;animation-duration:0.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-name:scalein;animation-name:scalein;border:1px solid lightgray;cursor:pointer;display:flex;flex-direction:row;grid-gap:8px;height:-webkit-max-content;height:-moz-max-content;height:max-content;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;padding:0.1rem;transform:scale(0);transition-property:background;transition-duration:0.25s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:6px 16px}.filter.active{border:1px solid black;padding:6px 8px}.filter:hover{border:1px solid gray}.show-more{display:flex}.show-more.hidden{display:none}.show-more::after{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;height:16px;margin-top:1px;margin-left:8px}.show-more.active::after{transform:rotateX(180deg)}@-webkit-keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@media (max-width: 415px){.show-more::after{transform:rotate(-90deg)}.show-more.active::after{transform:rotate(90deg)}}@media (max-width: 800px){.filters{flex-wrap:nowrap;overflow-x:scroll;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;grid-gap:unset}.filter{scroll-snap-align:end;margin-right:0.5rem}}";
178
-
179
- const FILTERS_COUNT = 5;
180
- const ACTIVE_FILTER_CLASSNAME = ".filter.active";
181
- const getFilterId = (filter) => filter.href.split("/").reverse()[0];
182
- let SearchFilters = class {
183
- constructor(hostRef) {
184
- registerInstance(this, hostRef);
185
- this.vviinnSelectFilter = createEvent(this, "vviinnSelectFilter", 7);
186
- this.filter = null;
187
- this.selectedCategoryId = null;
188
- this.hideFilters = true;
189
- }
190
- handleFilterSelection(filter) {
191
- return this.isFilterSelected(filter)
192
- ? this.clearSelectedFilter()
193
- : this.selectFilter(filter);
194
- }
195
- selectFilter(filter) {
196
- this.selectedCategoryId = getFilterId(filter);
197
- imageSearchState.activeIonLink = filter;
198
- this.vviinnSelectFilter.emit(Object.assign(Object.assign({}, this.basicEventData), { action: "select", filterName: filter.name }));
199
- }
200
- clearSelectedFilter() {
201
- this.selectedCategoryId = null;
202
- imageSearchState.activeIonLink = undefined;
203
- this.findSelectedFilter().blur();
204
- this.vviinnSelectFilter.emit(Object.assign(Object.assign({}, this.basicEventData), { action: "deselect" }));
205
- }
206
- findSelectedFilter() {
207
- return this.el.shadowRoot.querySelector(ACTIVE_FILTER_CLASSNAME);
208
- }
209
- toggleFilters() {
210
- this.hideFilters = !this.hideFilters;
211
- }
212
- handleEnter(ev, f) {
213
- if (ev.key !== "Enter")
214
- return;
215
- this.handleFilterSelection(f);
216
- }
217
- isFilterSelected(filterLink) {
218
- return this.selectedCategoryId === getFilterId(filterLink);
219
- }
220
- render() {
221
- return (h(Host, { exportparts: "filter, show-more-filters" }, h("div", { class: "filters" }, this.filter.filters
222
- .filter((_, i) => (this.hideFilters ? i < FILTERS_COUNT : true))
223
- .map((f, n) => (h("div", { role: "button", tabindex: "0", part: this.isFilterSelected(f) ? "filter active" : "filter", class: {
224
- filter: true,
225
- active: this.selectedCategoryId === getFilterId(f),
226
- }, style: { "animation-delay": `${n * 10}ms` }, onPointerUp: (ev) => {
227
- ev.stopPropagation();
228
- this.handleFilterSelection(f);
229
- }, onKeyPress: (ev) => this.handleEnter(ev, f) }, this.isFilterSelected(f) ? h(CheckIcon, null) : null, f.name))), h("div", { class: {
230
- filter: true,
231
- "show-more": true,
232
- hidden: this.filter.filters.length <= FILTERS_COUNT,
233
- active: !this.hideFilters,
234
- }, role: "button", tabindex: "0", "aria-role": "button", onClick: () => this.toggleFilters(), onKeyPress: (ev) => {
235
- if (ev.key === "Enter") {
236
- this.toggleFilters();
237
- }
238
- }, part: "show-more-filters" }, this.hideFilters ? "Zeige mehr" : "Zeige weniger"))));
239
- }
240
- get el() { return getElement(this); }
241
- };
242
- SearchFilters.style = searchFiltersCss;
243
-
244
- const vviinnDetectedObjectCss = ":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.5);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(calc(var(--x-position) - (var(--size) * 0.5)), calc(var(--y-position) - (var(--size) * 0.5)));transition:background 0.1 ease-in-out}:host(:hover){background:rgba(22, 22, 22, 0.75)}: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(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));width:calc(var(--size) * 0.25);background:white}";
245
-
246
- let VviinnDetectedObject = class {
247
- constructor(hostRef) {
248
- registerInstance(this, hostRef);
249
- this.vviinnSelectObject = createEvent(this, "vviinnSelectObject", 7);
250
- this.position = ["0", "0"];
251
- }
252
- getObjectPosition() {
253
- return _function.pipe(imageSearchState.imageBounds, Option.map((bounds) => {
254
- const objectRectangle = fromAlt(foldValueObject(this.detectedObject).rectangle);
255
- const { x, y } = _function.pipe(objectRectangle, scaleWithSized(bounds), center);
256
- return [`${x}px`, `${y}px`];
257
- }), Option.getOrElse(() => ["0", "0"]));
258
- }
259
- selectDetectedObject() {
260
- _function.pipe(imageSearchState.imageBounds, Option.map((bounds) => {
261
- const rectangle = foldValueObject(this.detectedObject).rectangle;
262
- const transformedRect = fromAlt(rectangle);
263
- const scaledRect = scaleWithSized(bounds)(transformedRect);
264
- imageSearchState.detectedObject = this.detectedObject;
265
- imageSearchState.searchArea = Option.some(scaledRect);
266
- }));
267
- makeRectangularSearchRequest();
268
- this.vviinnSelectObject.emit(Object.assign(Object.assign({}, this.basicEventData), { detectedObject: this.detectedObject }));
269
- }
270
- isActive() {
271
- if (!this.detectedObject)
272
- return false;
273
- if (!imageSearchState.detectedObject)
274
- return false;
275
- const thisObject = foldValueObject(this.detectedObject);
276
- const savedObject = foldValueObject(imageSearchState.detectedObject);
277
- return detectedObjectEq.equals(thisObject, savedObject);
278
- }
279
- render() {
280
- return (h(Host, { class: {
281
- active: this.isActive(),
282
- }, onClick: () => this.selectDetectedObject(), style: {
283
- "--x-position": this.getObjectPosition()[0],
284
- "--y-position": this.getObjectPosition()[1],
285
- } }));
286
- }
287
- };
288
- VviinnDetectedObject.style = vviinnDetectedObjectCss;
289
-
290
- const vviinnEmptyResultsCss = ":host{display:grid}vviinn-error{justify-items:center}";
291
-
292
- let VviinnEmptyResults = class {
293
- constructor(hostRef) {
294
- registerInstance(this, hostRef);
295
- }
296
- render() {
297
- return (h(Host, null, h("vviinn-error", null, h("svg", { slot: "icon", class: "icon", width: "32", height: "32", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("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" }), h("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" })), h("h4", { slot: "title" }, "Leider nichts gefunden"), h("span", { slot: "text" }, "Leider konnten wir keine passenden Produkte finden. Bitte versuche es mit einem anderen Bildausschnitt noch einmal."))));
298
- }
299
- };
300
- VviinnEmptyResults.style = vviinnEmptyResultsCss;
301
-
302
- const vviinnExampleImageCss = ":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}}";
303
-
304
- let VviinnExampleImage = class {
305
- constructor(hostRef) {
306
- registerInstance(this, hostRef);
307
- this.vviinnImageUpload = createEvent(this, "vviinnImageUpload", 7);
308
- this.vviinnNoResult = createEvent(this, "vviinnNoResult", 7);
309
- this.src = "";
310
- this.width = 0;
311
- this.height = 0;
312
- this.selected = false;
313
- }
314
- async selectImage() {
315
- this.selected = true;
316
- const file = await toFile(this.src);
317
- const processResult = await processSelectedFile(file);
318
- _function.pipe(processResult, Either.match(() => this.vviinnNoResult.emit(this.basicEventData), () => this.vviinnImageUpload.emit(this.basicEventData)));
319
- this.selected = false;
320
- }
321
- handleKeyPress({ key }) {
322
- if (key !== "Enter" && key !== " ")
323
- return;
324
- this.selectImage();
325
- }
326
- showPreloader() {
327
- return ((imageSearchState.objectDetectionInProgress ||
328
- imageSearchState.loading) &&
329
- this.selected);
330
- }
331
- render() {
332
- return (h(Host, { onClick: () => this.selectImage(), onKeyUp: (ev) => this.handleKeyPress(ev) }, this.showPreloader() ? (h("div", { class: "image-preloader" }, h("vviinn-preloader", null))) : null, h("img", { src: this.src, width: this.width, height: this.height, tabindex: 1 })));
333
- }
334
- };
335
- VviinnExampleImage.style = vviinnExampleImageCss;
336
-
337
- const vviinnExampleImagesCss = "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}";
338
-
339
- let VviinnExampleImages = class {
340
- constructor(hostRef) {
341
- registerInstance(this, hostRef);
342
- this.vviinnImageUpload = createEvent(this, "vviinnImageUpload", 7);
343
- this.vviinnNoResult = createEvent(this, "vviinnNoResult", 7);
344
- }
345
- componentWillLoad() {
346
- slotChangeListener(this, this.el);
347
- }
348
- delegateFocus() {
349
- const firstSlot = this.imagesBlock.childNodes[0];
350
- const firstExampleImage = firstSlot.childNodes[0];
351
- firstExampleImage.focus();
352
- }
353
- render() {
354
- return (h(Host, { onFocus: () => this.delegateFocus() }, h("slot", { name: "vviinn-example-images-title" }, h("h3", null, "Mit den Beispielbildern die Suche direkt ausprobieren")), h("div", { class: "images", ref: (el) => (this.imagesBlock = el) }, h("slot", { name: "vviinn-example-images-1" }, h("vviinn-example-image", { width: 480, height: 640, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc=", basicEventData: this.basicEventData })), h("slot", { name: "vviinn-example-images-2" }, h("vviinn-example-image", { width: 280, height: 480, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc=", basicEventData: this.basicEventData })), h("slot", { name: "vviinn-example-images-3" }, h("vviinn-example-image", { width: 280, height: 480, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc=", basicEventData: this.basicEventData })), h("slot", { name: "vviinn-example-images-4" }, h("vviinn-example-image", { width: 480, height: 640, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc=", basicEventData: this.basicEventData })))));
355
- }
356
- get el() { return getElement(this); }
357
- };
358
- VviinnExampleImages.style = vviinnExampleImagesCss;
359
-
360
- const vviinnImageSelectorCss = ":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}";
361
-
362
- let VviinnImageSelector = class {
363
- constructor(hostRef) {
364
- registerInstance(this, hostRef);
365
- this.vviinnImageUpload = createEvent(this, "vviinnImageUpload", 7);
366
- this.vviinnNoResult = createEvent(this, "vviinnNoResult", 7);
367
- }
368
- async handleInputChange(event) {
369
- const input = event.target;
370
- const processingResult = await processSelectedFile(input.files[0]);
371
- _function.pipe(processingResult, match(() => this.vviinnNoResult.emit(this.basicEventData), () => this.vviinnImageUpload.emit(this.basicEventData)));
372
- input.value = null;
373
- }
374
- isLoading() {
375
- return imageSearchState.loading;
376
- }
377
- render() {
378
- return (h(Host, { exportparts: "button" }, this.isLoading() ? h("vviinn-preloader", null) : null, this.isLoading() ? null : (h("label", { htmlFor: "fileInput", part: "button" }, h("slot", { name: "upload-button-text" }, "Upload image"))), h("input", { id: "fileInput", class: "visually-hidden", type: "file", accept: "image/*", onChange: (event) => this.handleInputChange(event) })));
379
- }
380
- };
381
- VviinnImageSelector.style = vviinnImageSelectorCss;
382
-
383
- const vviinnImageViewCss = ":host{display:grid;position:relative;justify-self:center;direction:ltr}img{box-sizing:border-box;filter:brightness(60%);position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:18px;padding:4px 6px;pointer-events:none;position:absolute;right:18px;z-index:4}vviinn-preloader{--preloader-size:12px}";
384
-
385
- const getImageSizes = (i) => {
386
- const dimensions = dimensionsFromImage(i);
387
- const resize = scaleByLargestSide(288);
388
- const newDimensions = resize(dimensions);
389
- const sizes = newDimensions.map((d) => d.size);
390
- return [sizes[0], sizes[1]];
391
- };
392
- let VviinnImageView = class {
393
- constructor(hostRef) {
394
- registerInstance(this, hostRef);
395
- }
396
- handleInitialImageLoad(ev) {
397
- const target = ev.target;
398
- const imageBounds = fromImage(target);
399
- const padding = 12;
400
- const { x, y } = move(imageBounds, { x: padding, y: padding });
401
- const searchArea = {
402
- x,
403
- y,
404
- width: imageBounds.width - padding * 2,
405
- height: imageBounds.height - padding * 2,
406
- };
407
- imageSearchState.imageBounds = Option.some(imageBounds);
408
- imageSearchState.searchArea = Option.some(searchArea);
409
- }
410
- renderDetectedObject(object) {
411
- return (h("vviinn-detected-object", { detectedObject: object, basicEventData: this.basicEventData }));
412
- }
413
- renderImage() {
414
- return _function.pipe(sequenceToOption(imageSearchState.imageUrl, imageSearchState.image), Option.map(([url, refImage]) => {
415
- const [width, height] = getImageSizes(refImage);
416
- const image = (h("img", { decoding: "async", width: width, height: height, src: url, onLoad: (el) => this.handleInitialImageLoad(el), draggable: false }));
417
- return image;
418
- }), Option.getOrElse(() => null));
419
- }
420
- renderCropper() {
421
- return _function.pipe(imageSearchState.imageUrl, Option.map(() => h("image-cropper", { basicEventData: this.basicEventData })), Option.getOrElse(() => null));
422
- }
423
- render() {
424
- return (h(Host, null, imageSearchState.loading ||
425
- imageSearchState.objectDetectionInProgress ? (h("div", { class: "image-preloader" }, h("vviinn-preloader", null))) : null, h("highlight-box", null), this.renderImage(), this.renderCropper(), imageSearchState.detectedObjects.map((o) => this.renderDetectedObject(o))));
426
- }
427
- };
428
- VviinnImageView.style = vviinnImageViewCss;
429
-
430
- const vviinnModalCss = ":host{background:white;border-radius:4px;box-sizing:border-box;display:grid;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;max-width:960px;overflow:auto}@media (max-width: 415px){:host{-webkit-animation-name:fade-in;animation-name:fade-in;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.closed){-webkit-animation-name:fade-out;animation-name:fade-out;-webkit-animation-fill-mode:none;animation-fill-mode:none}.body{overflow-y:auto}}@media (max-width: 640px) and (min-width: 415px){:host{max-width:80%}}.head{align-items:center;border-bottom:1px solid #f4f4f4;display:grid;grid-gap:16px;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;justify-items:center;padding:16px}.title{font-weight:600;font-size:18px;line-height:24px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:unset}@-webkit-keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";
431
-
432
- let VviinnModal = class {
433
- constructor(hostRef) {
434
- registerInstance(this, hostRef);
435
- this.vviinnWidgetClose = createEvent(this, "vviinnWidgetClose", 7);
436
- this.active = false;
437
- this.slider = false;
438
- }
439
- componentWillLoad() {
440
- slotChangeListener(this, this.el);
441
- }
442
- close() {
443
- this.active = false;
444
- setTimeout(() => {
445
- this.vviinnWidgetClose.emit({
446
- widgetType: "VPS",
447
- campaignTypeId: "VPS",
448
- campaignTypeName: campaignTypeNames["VPS"],
449
- widgetId: this.buttonElementId,
450
- });
451
- }, this.slider ? 500 : 0);
452
- }
453
- handleAnimationEnd(ev) {
454
- if (ev.animationName !== "fade-in")
455
- return;
456
- this.slider = true;
457
- }
458
- render() {
459
- return (h(Host, { exportparts: "secondary-action, title, close-button", class: { closed: !this.active }, onAnimationEnd: (ev) => this.handleAnimationEnd(ev) }, h("div", { class: "head" }, h("button", { part: "secondary-action", onClick: () => this.resetState() }, h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M20.25 12H3.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M10.5 5.25L3.75 12L10.5 18.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("div", { class: "title", part: "title" }, h("slot", { name: "vviinn-image-search-modal-title" }, "Bildsuche")), h("button", { onClick: () => this.close(), class: "close-button", part: "close-button" }, h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z", fill: "#333333" })))), h("div", { class: "body" }, h("slot", null))));
460
- }
461
- get el() { return getElement(this); }
462
- };
463
- VviinnModal.style = vviinnModalCss;
464
-
465
- const vviinnOnboardingCss = ":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}::host{display:block}h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}vviinn-slide{background:#f4f4f4;padding:24px}svg{padding:16px 0}.text{display:grid;grid-gap:8px}.text>h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}.text>p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}";
466
-
467
- let VviinnOnboarding = class {
468
- constructor(hostRef) {
469
- registerInstance(this, hostRef);
470
- }
471
- componentWillLoad() {
472
- slotChangeListener(this, this.el);
473
- }
474
- render() {
475
- return (h(Host, null, h("slot", { name: "vviinn-onboarding-title" }, h("h3", null, "So funktioniert es")), h("vviinn-slider", { showArrows: true }, h("vviinn-slide", null, h("vviinn-onboarding-card-1", null)), h("vviinn-slide", null, h("vviinn-onboarding-card-2", null)), h("vviinn-slide", null, h("vviinn-onboarding-card-3", null)))));
476
- }
477
- get el() { return getElement(this); }
478
- };
479
- VviinnOnboarding.style = vviinnOnboardingCss;
480
-
481
- const onboardingCardCss$2 = ":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";
482
-
483
- let VviinnOnboardingCard1 = class {
484
- constructor(hostRef) {
485
- registerInstance(this, hostRef);
486
- }
487
- componentWillLoad() {
488
- slotChangeListener(this, this.el);
489
- }
490
- render() {
491
- return (h(Host, null, h("slot", { name: "onboarding-card-1-icon" }, h(OnboardingCard1Icon, null)), h("slot", { name: "onboarding-card-1-text" }, h("div", { class: "text" }, h("h4", null, "Starte die Bildsuche"), h("p", null, "Lade ein Bild aus Deiner Galerie hoch oder fotografiere ein Produkt mit Deiner Kamera.")))));
492
- }
493
- get el() { return getElement(this); }
494
- };
495
- VviinnOnboardingCard1.style = onboardingCardCss$2;
496
-
497
- const onboardingCardCss$1 = ":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";
498
-
499
- let VviinnOnboardingCard2 = class {
500
- constructor(hostRef) {
501
- registerInstance(this, hostRef);
502
- }
503
- componentWillLoad() {
504
- slotChangeListener(this, this.el);
505
- }
506
- render() {
507
- return (h(Host, null, h("slot", { name: "onboarding-card-2-icon" }, h(OnboardingCard2Icon, null)), h("slot", { name: "onboarding-card-2-text" }, h("div", { class: "text" }, h("h4", null, "Verfeiner deine Suche"), h("p", null, "Du kannst den Bildrahmen selber festlegen und so die Produkte genau ausw\u00E4hlen.")))));
508
- }
509
- get el() { return getElement(this); }
510
- };
511
- VviinnOnboardingCard2.style = onboardingCardCss$1;
512
-
513
- const onboardingCardCss = ":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";
514
-
515
- let VviinnOnboardingCard3 = class {
516
- constructor(hostRef) {
517
- registerInstance(this, hostRef);
518
- }
519
- componentWillLoad() {
520
- slotChangeListener(this, this.el);
521
- }
522
- render() {
523
- return (h(Host, null, h("slot", { name: "onboarding-card-3-icon" }, h(OnboardingCard3Icon, null)), h("slot", { name: "onboarding-card-3-text" }, h("div", { class: "text" }, h("h4", null, "Ohne Hintergrund"), h("p", null, "Die besten Ergebnisse erh\u00E4ltst Du, wenn das gesuchte Objekt mit einfarbigem und hellem Hintergrund zu sehen ist.")))));
524
- }
525
- get el() { return getElement(this); }
526
- };
527
- VviinnOnboardingCard3.style = onboardingCardCss;
528
-
529
- const vviinnOverlayCss = ":host{-webkit-animation:fade-in 0.5s ease-in-out;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}@-webkit-keyframes fade-in{from{opacity:0.1}to{opacity:1}}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";
530
-
531
- let VviinnOverlay = class {
532
- constructor(hostRef) {
533
- registerInstance(this, hostRef);
534
- }
535
- render() {
536
- return (h(Host, null, h("slot", null)));
537
- }
538
- };
539
- VviinnOverlay.style = vviinnOverlayCss;
540
-
541
- const vviinnOverlayedModalCss = ":host{display:none}:host(.active){display:block}vviinn-overlay{align-items:center;display:grid;justify-items:center;cursor:default}@media (max-width: 415px){vviinn-modal{border-radius:4px 4px 0 0;height:100vh;margin-top:32px;transform:translateY(100%);width:100vw}vviinn-overlay{align-items:end;display:grid;justify-items:center}}";
542
-
543
- let VviinnOverlayedModal = class {
544
- constructor(hostRef) {
545
- registerInstance(this, hostRef);
546
- this.vviinnWidgetClose = createEvent(this, "vviinnWidgetClose", 7);
547
- this.active = false;
548
- }
549
- render() {
550
- return (h(Host, { class: { active: this.active } }, h("vviinn-overlay", null, h("vviinn-modal", { resetState: this.resetState, active: this.active, buttonElementId: this.buttonElementId }, h("slot", null, "CONTENT")))));
551
- }
552
- };
553
- VviinnOverlayedModal.style = vviinnOverlayedModalCss;
554
-
555
- const vviinnPrivacyBadgeCss = ":host{display:block;background:#F4F4F4;padding:17px}.content{display:grid;grid-template-columns:-webkit-min-content auto;grid-template-columns:min-content auto;grid-gap:9px}.content p{color:#525252;font-size:12px;line-height:16px;margin:unset}";
556
-
557
- let VviinnPrivacyBadge = class {
558
- constructor(hostRef) {
559
- registerInstance(this, hostRef);
560
- }
561
- componentWillLoad() {
562
- slotChangeListener(this, this.el);
563
- }
564
- render() {
565
- return (h(Host, null, h("slot", null, h("div", { class: "content" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" }, h("defs", null), h("path", { fill: "#525252", d: "M8.5 11V7h-2v1h1v3H6v1h4v-1H8.5zM8 4a.75.75 0 100 1.5A.75.75 0 008 4z" }), h("path", { fill: "#525252", d: "M8 15A7 7 0 118 1a7 7 0 010 14zM8 2a6 6 0 100 12A6 6 0 008 2z" })), h("slot", { name: "vviinn-privacy-badge-text" }, h("p", null, "Durch das Hochladen eines Bildes willigen Sie in die Verarbeitung durch unseren Partner Vviinn ein. Das Bild wird nach einer Stunde Inaktivit\u00E4t gel\u00F6scht."))))));
566
- }
567
- get el() { return getElement(this); }
568
- };
569
- VviinnPrivacyBadge.style = vviinnPrivacyBadgeCss;
570
-
571
- const vviinnServerErrorCss = ":host{display:block}";
572
-
573
- let VviinnServerError = class {
574
- constructor(hostRef) {
575
- registerInstance(this, hostRef);
576
- }
577
- render() {
578
- return (h(Host, null, h("vviinn-error", null, h("h4", { slot: "title" }, "Keine Verbindung"), h("span", { slot: "text" }, "Etwas hat leider nicht funktioniert. Bitte pr\u00FCfen Sie Ihre Internetverbindung und laden Sie das Bild noch einmal hoch."), h("button", { slot: "action", onClick: this.handler }, "Erneut versuchen"))));
579
- }
580
- };
581
- VviinnServerError.style = vviinnServerErrorCss;
582
-
583
- const vviinnSlideCss = ":host{display:grid;justify-items:center}";
584
-
585
- let VviinnSlide = class {
586
- constructor(hostRef) {
587
- registerInstance(this, hostRef);
588
- }
589
- render() {
590
- return (h(Host, null, h("slot", null)));
591
- }
592
- };
593
- VviinnSlide.style = vviinnSlideCss;
594
-
595
- const getStyleMap = (data) => {
596
- return {
597
- "arrow-wrapper": true,
598
- [data.kind]: true,
599
- disabled: data.disabled,
600
- };
601
- };
602
- const Arrow = ({ kind, tabindex, disabled, onClick, onKeyDown, }) => (h("div", { class: getStyleMap({ kind, disabled }), onClick: onClick, tabindex: tabindex, onKeyDown: onKeyDown },
603
- h(ArrowIcon, null)));
604
-
605
- const vviinnSliderCss = ":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--num-items:0;--position:0;display:grid;grid-gap:20px;justify-items:center;position:relative}.items-wrapper{overflow:hidden;width:100%}.items{box-sizing:border-box;display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--num-items), 100%);transform:translateX(calc(-100% * var(--position)));transition:transform 0.33s ease-in-out}.controls{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--num-items), -webkit-min-content);grid-template-columns:repeat(var(--num-items), min-content)}.bullet{background:#e0e0e0;border-radius:50%;box-sizing:border-box;cursor:pointer;height:8px;width:8px;transition:background 0.1s ease-in-out}.bullet:hover{background:#c6c6c6}.bullet.active{background:var(--color-primary, var(--color-primary-system))}.bullet:active{background:transparent;border:2px solid var(--color-primary, var(--color-primary-system))}.arrow-wrapper{align-items:center;cursor:pointer;background:white;border:2px solid white;bottom:0;box-sizing:border-box;display:grid;height:calc(var(--spacer) * 6);justify-items:center;margin:auto;position:absolute;top:0;transform:translate3d(0, -50%, 0);transition:border 0.25ms ease-in-out;width:calc(var(--spacer) * 4)}.arrow-wrapper:active{border-color:var(--color-primary, var(--color-primary-system));opacity:0.75}.arrow-wrapper:focus{border-color:var(--color-primary, var(--color-primary-system));opacity:0.5;outline:none}.prev{left:0}.next{right:0}.next>svg{transform:rotate3d(0, 1, 0, 180deg)}.arrow-wrapper>svg{transition:fill 0.25ms ease-in-out;fill:#a8a8a8}.arrow-wrapper:hover>svg{fill:#8d8d8d}";
606
-
607
- let VviinnSlider = class {
608
- constructor(hostRef) {
609
- registerInstance(this, hostRef);
610
- this.elementsCount = 0;
611
- this.internalPosition = 0;
612
- this.swipeStartPosition = Option.none;
613
- this.isRTL = false;
614
- this.showBullets = true;
615
- this.position = 0;
616
- this.showArrows = false;
617
- }
618
- positionWatchHandler(newValue) {
619
- this.internalPosition = newValue;
620
- this.el.style.setProperty("--position", `${this.calculatePosition(newValue)}`);
621
- this.setActiveCssClassToSlide(newValue);
622
- }
623
- componentWillLoad() {
624
- this.isRTL = document.dir === "rtl";
625
- }
626
- connectedCallback() {
627
- this.handleDomContentChanges();
628
- }
629
- handleDomContentChanges() {
630
- const items = this.el.querySelectorAll("vviinn-slide");
631
- this.elementsCount = items.length;
632
- this.el.style.setProperty("--num-items", `${this.elementsCount}`);
633
- this.setActiveCssClassToSlide(0);
634
- }
635
- setActiveCssClassToSlide(index) {
636
- const items = this.el.querySelectorAll("vviinn-slide");
637
- items.forEach((i) => i.classList.remove("active"));
638
- items[index].classList.add("active");
639
- }
640
- goToSlide(index) {
641
- this.internalPosition = index;
642
- this.el.style.setProperty("--position", `${index}`);
643
- this.setActiveCssClassToSlide(index);
644
- }
645
- renderBullets() {
646
- return this.showBullets ? (h("div", { class: "controls" }, NonEmptyArray.range(0, this.elementsCount - 1).map((i) => (h("div", { class: {
647
- bullet: true,
648
- active: i == Math.abs(this.internalPosition) % this.elementsCount,
649
- }, onClick: () => this.goToSlide(i) }))))) : null;
650
- }
651
- nextSlide() {
652
- this.internalPosition++;
653
- this.renderSlidePosition();
654
- }
655
- prevSlide() {
656
- const nextPostion = this.internalPosition - 1;
657
- this.internalPosition =
658
- nextPostion > -1 ? nextPostion : this.elementsCount - 1;
659
- this.renderSlidePosition();
660
- }
661
- renderSlidePosition() {
662
- const position = this.internalPosition % this.elementsCount;
663
- requestAnimationFrame(() => {
664
- this.el.style.setProperty("--position", `${this.calculatePosition(position)}`);
665
- });
666
- }
667
- calculatePosition(position) {
668
- return this.isRTL ? position * -1 : position;
669
- }
670
- handleKeyDown(event) {
671
- if (event.key !== "Space" && event.key !== "Enter")
672
- return;
673
- const target = event.target;
674
- const direction = target.className.includes("prev") ? "prev" : "next";
675
- switch (direction) {
676
- case "prev":
677
- this.prevSlide();
678
- break;
679
- case "next":
680
- this.nextSlide();
681
- break;
682
- }
683
- }
684
- handleTouchStart(event) {
685
- if (!this.showBullets)
686
- return;
687
- this.swipeStartPosition = _function.pipe(event.touches[0], Option.fromNullable, Option.map((t) => t.clientX));
688
- }
689
- handleTouchEnd(event) {
690
- if (!this.showBullets)
691
- return;
692
- const swipeEndPosition = _function.pipe(event.changedTouches[0], Option.fromNullable, Option.map((t) => t.clientX));
693
- _function.pipe(sequenceToOption(this.swipeStartPosition, swipeEndPosition), Option.map(([start, end]) => Ord.compare(start, end)), Option.map((swipeDirection) => {
694
- switch (swipeDirection) {
695
- case 1:
696
- return this.nextSlide();
697
- case -1:
698
- return this.prevSlide();
699
- }
700
- }));
701
- }
702
- render() {
703
- return (h(Host, null, h("div", { class: "items-wrapper" }, h("div", { class: "items", onTouchStart: (e) => this.handleTouchStart(e), onTouchEnd: (e) => this.handleTouchEnd(e) }, h("slot", null))), this.showArrows
704
- ? [
705
- h(Arrow, { kind: "prev", onClick: () => this.isRTL ? this.nextSlide() : this.prevSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 1, disabled: false }),
706
- h(Arrow, { kind: "next", onClick: () => this.isRTL ? this.prevSlide() : this.nextSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 0, disabled: false }),
707
- ]
708
- : null, this.renderBullets()));
709
- }
710
- get el() { return getElement(this); }
711
- static get watchers() { return {
712
- "position": ["positionWatchHandler"]
713
- }; }
714
- };
715
- VviinnSlider.style = vviinnSliderCss;
716
-
717
- const vviinnTeaserCss = ":host{align-items:center;display:grid;justify-items:center;grid-gap:16px}.vviinn-teaser-text{font-size:28px;font-weight:600;line-height:40px;size:28px;text-align:center}";
718
-
719
- let VviinnTeaser = class {
720
- constructor(hostRef) {
721
- registerInstance(this, hostRef);
722
- }
723
- componentWillLoad() {
724
- slotChangeListener(this, this.el);
725
- }
726
- render() {
727
- return (h(Host, null, h("slot", null, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "64", height: "64", fill: "none" }, h("defs", null), h("path", { fill: "#C6C6C6", d: "M48 28a11.98 11.98 0 00-9.77 18.942L28 57.172 30.828 60l10.23-10.23A11.994 11.994 0 1048 28zm0 20a8 8 0 118-8 8.009 8.009 0 01-8 8zM34 24a6 6 0 10-6-6 6.006 6.006 0 006 6zm0-8a2 2 0 110 4 2 2 0 010-4z" }), h("path", { fill: "#C6C6C6", d: "M24 48H8V35.993L18 26l11.172 11.172L32 34.336 20.828 23.165a4 4 0 00-5.656 0L8 30.336V8h40v12h4V8a4.004 4.004 0 00-4-4H8a4.004 4.004 0 00-4 4v40a4.005 4.005 0 004 4h16v-4z" })), h("span", { class: "vviinn-teaser-text" }, h("slot", { name: "vviinn-teaser-text" }, "Finde Produkte auf ", h("br", null), " einem Foto")))));
728
- }
729
- get el() { return getElement(this); }
730
- };
731
- VviinnTeaser.style = vviinnTeaserCss;
732
-
733
- const vviinnWrongFormatCss = ":host{display:block}";
734
-
735
- let VviinnWrongFormat = class {
736
- constructor(hostRef) {
737
- registerInstance(this, hostRef);
738
- }
739
- render() {
740
- return (h(Host, null, h("vviinn-error", null, h("h4", { slot: "title" }, "Dateityp wird nicht unterst\u00FCtzt"), h("span", { slot: "text" }, "Leider unterst\u00FCtzen wir dieses Format nicht. Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch."), h("button", { slot: "action", onClick: this.handler }, "Neues Bild hochladen"))));
741
- }
742
- };
743
- VviinnWrongFormat.style = vviinnWrongFormatCss;
744
-
745
- export { HighlightBox as highlight_box, ImageCropper as image_cropper, SearchFilters as search_filters, VviinnDetectedObject as vviinn_detected_object, VviinnEmptyResults as vviinn_empty_results, VviinnExampleImage as vviinn_example_image, VviinnExampleImages as vviinn_example_images, VviinnImageSelector as vviinn_image_selector, VviinnImageView as vviinn_image_view, VviinnModal as vviinn_modal, VviinnOnboarding as vviinn_onboarding, VviinnOnboardingCard1 as vviinn_onboarding_card_1, VviinnOnboardingCard2 as vviinn_onboarding_card_2, VviinnOnboardingCard3 as vviinn_onboarding_card_3, VviinnOverlay as vviinn_overlay, VviinnOverlayedModal as vviinn_overlayed_modal, VviinnPrivacyBadge as vviinn_privacy_badge, VviinnServerError as vviinn_server_error, VviinnSlide as vviinn_slide, VviinnSlider as vviinn_slider, VviinnTeaser as vviinn_teaser, VviinnWrongFormat as vviinn_wrong_format };