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,770 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-7f1325a7.js');
6
- const imageSearch_store = require('./imageSearch.store-98824653.js');
7
- const Handler = require('./Handler-176539c8.js');
8
- const index$1 = require('./index-cb410762.js');
9
- const customizedSlots = require('./customized-slots-6e56c354.js');
10
- const Campaign = require('./Campaign-13258569.js');
11
-
12
- // -------------------------------------------------------------------------------------
13
- // -------------------------------------------------------------------------------------
14
- // instances
15
- // -------------------------------------------------------------------------------------
16
- /**
17
- * @category instances
18
- * @since 2.10.0
19
- */
20
- var Eq = {
21
- equals: function (first, second) { return first === second; }
22
- };
23
- /**
24
- * @category instances
25
- * @since 2.10.0
26
- */
27
- var Ord = {
28
- equals: Eq.equals,
29
- compare: function (first, second) { return (first < second ? -1 : first > second ? 1 : 0); }
30
- };
31
-
32
- const fromRectangle = (shape, target) => {
33
- const top = `${shape.y}px`;
34
- const left = `${shape.x}px`;
35
- const right = `${target.width - (shape.x + shape.width)}px`;
36
- const bottom = `${target.height - (shape.y + shape.height)}px`;
37
- return {
38
- top,
39
- right,
40
- bottom,
41
- left,
42
- };
43
- };
44
- const printClip = (clip) => `inset(${clip.top} ${clip.right} ${clip.bottom} ${clip.left})`;
45
- const getClipValue = (shape, target) => printClip(fromRectangle(shape, target));
46
-
47
- 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)}}";
48
-
49
- let HighlightBox = class {
50
- constructor(hostRef) {
51
- index.registerInstance(this, hostRef);
52
- }
53
- getInsetValue() {
54
- return Handler.pipe(imageSearch_store.sequenceToOption(imageSearch_store.imageSearchState.searchArea, imageSearch_store.imageSearchState.imageBounds), imageSearch_store.Option.map(([selection, image]) => getClipValue(selection, image)), imageSearch_store.Option.getOrElse(() => ""));
55
- }
56
- renderImage() {
57
- return Handler.pipe(imageSearch_store.sequenceToOption(imageSearch_store.imageSearchState.imageUrl, imageSearch_store.imageSearchState.imageBounds), imageSearch_store.Option.map(([url, bounds]) => (index.h("img", { src: url, width: bounds.width, height: bounds.height, style: { "clip-path": `${this.getInsetValue()}` } }))), imageSearch_store.Option.getOrElse(() => ""));
58
- }
59
- render() {
60
- return index.h(index.Host, null, this.renderImage());
61
- }
62
- };
63
- HighlightBox.style = highlightBoxCss;
64
-
65
- const findTarget = (ev) => {
66
- return ev.target;
67
- };
68
-
69
- 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}";
70
-
71
- const MIN_SEARCHAREA_SIZE = 40;
72
- let ImageCropper = class {
73
- constructor(hostRef) {
74
- index.registerInstance(this, hostRef);
75
- this.vviinnImageCrop = index.createEvent(this, "vviinnImageCrop", 7);
76
- this.disabled = false;
77
- this.handleMove = false;
78
- this.mouseStartPoint = undefined;
79
- this.bounds = undefined;
80
- this.resizeObserver = new ResizeObserver(() => {
81
- this.bounds = this.el.getBoundingClientRect();
82
- });
83
- }
84
- componentDidLoad() {
85
- this.resizeObserver.observe(this.el);
86
- }
87
- disconnectedCallback() {
88
- this.resizeObserver.disconnect();
89
- }
90
- handleHandlerMove(event) {
91
- event.preventDefault();
92
- event.stopPropagation();
93
- const destination = Handler.fromMouseEvent(event);
94
- const distance = Handler.pointDiffSemigroup.concat(destination, this.mouseStartPoint);
95
- const transformedHandler = {
96
- position: distance,
97
- direction: this.handlerMoveDirection,
98
- };
99
- imageSearch_store._function.pipe(imageSearch_store.imageSearchState.searchArea, imageSearch_store.Option.map((area) => {
100
- const newSearchArea = imageSearch_store.transform(area, transformedHandler);
101
- if (this.outOfBounds(newSearchArea))
102
- return;
103
- imageSearch_store.imageSearchState.searchArea = imageSearch_store.Option.some(newSearchArea);
104
- this.mouseStartPoint = destination;
105
- imageSearch_store.imageSearchState.detectedObject = undefined;
106
- }));
107
- }
108
- outOfBounds(area) {
109
- return (area.width < MIN_SEARCHAREA_SIZE ||
110
- area.height < MIN_SEARCHAREA_SIZE ||
111
- area.x < 0 ||
112
- area.y < 0 ||
113
- this.bounds.height - (area.y + area.height) < 0 ||
114
- this.bounds.width - (area.x + area.width) < 0);
115
- }
116
- handleCropperMove(ev) {
117
- ev.preventDefault();
118
- ev.stopPropagation();
119
- const destination = Handler.fromMouseEvent(ev);
120
- const distance = Handler.pointDiffSemigroup.concat(destination, this.mouseStartPoint);
121
- imageSearch_store._function.pipe(imageSearch_store.imageSearchState.searchArea, imageSearch_store.Option.map((searchArea) => {
122
- const newSearchArea = imageSearch_store.move(searchArea, distance);
123
- if (newSearchArea.x < 0 ||
124
- newSearchArea.y < 0 ||
125
- this.bounds.height - (newSearchArea.y + newSearchArea.height) < 0 ||
126
- this.bounds.width - (newSearchArea.x + newSearchArea.width) < 0)
127
- return;
128
- imageSearch_store.imageSearchState.detectedObject = undefined;
129
- imageSearch_store.imageSearchState.searchArea = imageSearch_store.Option.some(newSearchArea);
130
- this.mouseStartPoint = destination;
131
- }));
132
- }
133
- handlePointerDown(event) {
134
- event.stopPropagation();
135
- this.mouseStartPoint = Handler.fromMouseEvent(event);
136
- // should be htmlelement or handler
137
- const target = findTarget(event);
138
- if (target.localName === "cropper-handler") {
139
- this.handlerMoveDirection = target.handler.direction;
140
- this.pointerMoveListener = this.handleHandlerMove.bind(this);
141
- }
142
- else {
143
- this.pointerMoveListener = this.handleCropperMove.bind(this);
144
- }
145
- this.pointerReleaseListener = this.handleSearchAreaRelease.bind(this);
146
- this.el.addEventListener("pointermove", this.pointerMoveListener);
147
- window.addEventListener("pointerup", this.pointerReleaseListener, {
148
- once: true,
149
- });
150
- }
151
- handleSearchAreaRelease() {
152
- this.el.removeEventListener("pointermove", this.pointerMoveListener);
153
- document.removeEventListener("pointerup", this.pointerReleaseListener);
154
- this.mouseStartPoint = undefined;
155
- imageSearch_store.makeRectangularSearchRequest();
156
- this.vviinnImageCrop.emit(this.basicEventData);
157
- }
158
- getStyleMap() {
159
- return imageSearch_store._function.pipe(imageSearch_store.imageSearchState.searchArea, imageSearch_store.Option.map((rectangle) => {
160
- return {
161
- width: `${rectangle.width}px`,
162
- height: `${rectangle.height}px`,
163
- transform: `translate3d(${rectangle.x}px, ${rectangle.y}px, 0)`,
164
- cursor: this.handleMove ? "move" : "default",
165
- };
166
- }), imageSearch_store.Option.getOrElse(() => {
167
- return {};
168
- }));
169
- }
170
- render() {
171
- return (index.h(index.Host, { exportparts: "handle, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize" }, index.h("div", { class: {
172
- "crop-area": true,
173
- active: this.handleMove,
174
- disabled: this.disabled,
175
- }, draggable: false, style: this.getStyleMap(), onContextMenu: () => false, onPointerDown: (ev) => this.handlePointerDown(ev) }, imageSearch_store.imageSearchState.cropperHandlers.map((handler) => (index.h("cropper-handler", { disabled: this.disabled, handler: handler, onPointerDown: (ev) => this.handlePointerDown(ev) }))))));
176
- }
177
- get el() { return index.getElement(this); }
178
- };
179
- ImageCropper.style = imageCropperCss;
180
-
181
- 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}}";
182
-
183
- const FILTERS_COUNT = 5;
184
- const ACTIVE_FILTER_CLASSNAME = ".filter.active";
185
- const getFilterId = (filter) => filter.href.split("/").reverse()[0];
186
- let SearchFilters = class {
187
- constructor(hostRef) {
188
- index.registerInstance(this, hostRef);
189
- this.vviinnSelectFilter = index.createEvent(this, "vviinnSelectFilter", 7);
190
- this.filter = null;
191
- this.selectedCategoryId = null;
192
- this.hideFilters = true;
193
- }
194
- handleFilterSelection(filter) {
195
- return this.isFilterSelected(filter)
196
- ? this.clearSelectedFilter()
197
- : this.selectFilter(filter);
198
- }
199
- selectFilter(filter) {
200
- this.selectedCategoryId = getFilterId(filter);
201
- imageSearch_store.imageSearchState.activeIonLink = filter;
202
- this.vviinnSelectFilter.emit(Object.assign(Object.assign({}, this.basicEventData), { action: "select", filterName: filter.name }));
203
- }
204
- clearSelectedFilter() {
205
- this.selectedCategoryId = null;
206
- imageSearch_store.imageSearchState.activeIonLink = undefined;
207
- this.findSelectedFilter().blur();
208
- this.vviinnSelectFilter.emit(Object.assign(Object.assign({}, this.basicEventData), { action: "deselect" }));
209
- }
210
- findSelectedFilter() {
211
- return this.el.shadowRoot.querySelector(ACTIVE_FILTER_CLASSNAME);
212
- }
213
- toggleFilters() {
214
- this.hideFilters = !this.hideFilters;
215
- }
216
- handleEnter(ev, f) {
217
- if (ev.key !== "Enter")
218
- return;
219
- this.handleFilterSelection(f);
220
- }
221
- isFilterSelected(filterLink) {
222
- return this.selectedCategoryId === getFilterId(filterLink);
223
- }
224
- render() {
225
- return (index.h(index.Host, { exportparts: "filter, show-more-filters" }, index.h("div", { class: "filters" }, this.filter.filters
226
- .filter((_, i) => (this.hideFilters ? i < FILTERS_COUNT : true))
227
- .map((f, n) => (index.h("div", { role: "button", tabindex: "0", part: this.isFilterSelected(f) ? "filter active" : "filter", class: {
228
- filter: true,
229
- active: this.selectedCategoryId === getFilterId(f),
230
- }, style: { "animation-delay": `${n * 10}ms` }, onPointerUp: (ev) => {
231
- ev.stopPropagation();
232
- this.handleFilterSelection(f);
233
- }, onKeyPress: (ev) => this.handleEnter(ev, f) }, this.isFilterSelected(f) ? index.h(index$1.CheckIcon, null) : null, f.name))), index.h("div", { class: {
234
- filter: true,
235
- "show-more": true,
236
- hidden: this.filter.filters.length <= FILTERS_COUNT,
237
- active: !this.hideFilters,
238
- }, role: "button", tabindex: "0", "aria-role": "button", onClick: () => this.toggleFilters(), onKeyPress: (ev) => {
239
- if (ev.key === "Enter") {
240
- this.toggleFilters();
241
- }
242
- }, part: "show-more-filters" }, this.hideFilters ? "Zeige mehr" : "Zeige weniger"))));
243
- }
244
- get el() { return index.getElement(this); }
245
- };
246
- SearchFilters.style = searchFiltersCss;
247
-
248
- 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}";
249
-
250
- let VviinnDetectedObject = class {
251
- constructor(hostRef) {
252
- index.registerInstance(this, hostRef);
253
- this.vviinnSelectObject = index.createEvent(this, "vviinnSelectObject", 7);
254
- this.position = ["0", "0"];
255
- }
256
- getObjectPosition() {
257
- return imageSearch_store._function.pipe(imageSearch_store.imageSearchState.imageBounds, imageSearch_store.Option.map((bounds) => {
258
- const objectRectangle = imageSearch_store.fromAlt(imageSearch_store.foldValueObject(this.detectedObject).rectangle);
259
- const { x, y } = imageSearch_store._function.pipe(objectRectangle, imageSearch_store.scaleWithSized(bounds), imageSearch_store.center);
260
- return [`${x}px`, `${y}px`];
261
- }), imageSearch_store.Option.getOrElse(() => ["0", "0"]));
262
- }
263
- selectDetectedObject() {
264
- imageSearch_store._function.pipe(imageSearch_store.imageSearchState.imageBounds, imageSearch_store.Option.map((bounds) => {
265
- const rectangle = imageSearch_store.foldValueObject(this.detectedObject).rectangle;
266
- const transformedRect = imageSearch_store.fromAlt(rectangle);
267
- const scaledRect = imageSearch_store.scaleWithSized(bounds)(transformedRect);
268
- imageSearch_store.imageSearchState.detectedObject = this.detectedObject;
269
- imageSearch_store.imageSearchState.searchArea = imageSearch_store.Option.some(scaledRect);
270
- }));
271
- imageSearch_store.makeRectangularSearchRequest();
272
- this.vviinnSelectObject.emit(Object.assign(Object.assign({}, this.basicEventData), { detectedObject: this.detectedObject }));
273
- }
274
- isActive() {
275
- if (!this.detectedObject)
276
- return false;
277
- if (!imageSearch_store.imageSearchState.detectedObject)
278
- return false;
279
- const thisObject = imageSearch_store.foldValueObject(this.detectedObject);
280
- const savedObject = imageSearch_store.foldValueObject(imageSearch_store.imageSearchState.detectedObject);
281
- return imageSearch_store.detectedObjectEq.equals(thisObject, savedObject);
282
- }
283
- render() {
284
- return (index.h(index.Host, { class: {
285
- active: this.isActive(),
286
- }, onClick: () => this.selectDetectedObject(), style: {
287
- "--x-position": this.getObjectPosition()[0],
288
- "--y-position": this.getObjectPosition()[1],
289
- } }));
290
- }
291
- };
292
- VviinnDetectedObject.style = vviinnDetectedObjectCss;
293
-
294
- const vviinnEmptyResultsCss = ":host{display:grid}vviinn-error{justify-items:center}";
295
-
296
- let VviinnEmptyResults = class {
297
- constructor(hostRef) {
298
- index.registerInstance(this, hostRef);
299
- }
300
- render() {
301
- return (index.h(index.Host, null, index.h("vviinn-error", null, index.h("svg", { slot: "icon", class: "icon", width: "32", height: "32", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.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" }), index.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" })), index.h("h4", { slot: "title" }, "Leider nichts gefunden"), index.h("span", { slot: "text" }, "Leider konnten wir keine passenden Produkte finden. Bitte versuche es mit einem anderen Bildausschnitt noch einmal."))));
302
- }
303
- };
304
- VviinnEmptyResults.style = vviinnEmptyResultsCss;
305
-
306
- 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}}";
307
-
308
- let VviinnExampleImage = class {
309
- constructor(hostRef) {
310
- index.registerInstance(this, hostRef);
311
- this.vviinnImageUpload = index.createEvent(this, "vviinnImageUpload", 7);
312
- this.vviinnNoResult = index.createEvent(this, "vviinnNoResult", 7);
313
- this.src = "";
314
- this.width = 0;
315
- this.height = 0;
316
- this.selected = false;
317
- }
318
- async selectImage() {
319
- this.selected = true;
320
- const file = await imageSearch_store.toFile(this.src);
321
- const processResult = await imageSearch_store.processSelectedFile(file);
322
- imageSearch_store._function.pipe(processResult, imageSearch_store.Either.match(() => this.vviinnNoResult.emit(this.basicEventData), () => this.vviinnImageUpload.emit(this.basicEventData)));
323
- this.selected = false;
324
- }
325
- handleKeyPress({ key }) {
326
- if (key !== "Enter" && key !== " ")
327
- return;
328
- this.selectImage();
329
- }
330
- showPreloader() {
331
- return ((imageSearch_store.imageSearchState.objectDetectionInProgress ||
332
- imageSearch_store.imageSearchState.loading) &&
333
- this.selected);
334
- }
335
- render() {
336
- return (index.h(index.Host, { onClick: () => this.selectImage(), onKeyUp: (ev) => this.handleKeyPress(ev) }, this.showPreloader() ? (index.h("div", { class: "image-preloader" }, index.h("vviinn-preloader", null))) : null, index.h("img", { src: this.src, width: this.width, height: this.height, tabindex: 1 })));
337
- }
338
- };
339
- VviinnExampleImage.style = vviinnExampleImageCss;
340
-
341
- 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}";
342
-
343
- let VviinnExampleImages = class {
344
- constructor(hostRef) {
345
- index.registerInstance(this, hostRef);
346
- this.vviinnImageUpload = index.createEvent(this, "vviinnImageUpload", 7);
347
- this.vviinnNoResult = index.createEvent(this, "vviinnNoResult", 7);
348
- }
349
- componentWillLoad() {
350
- customizedSlots.slotChangeListener(this, this.el);
351
- }
352
- delegateFocus() {
353
- const firstSlot = this.imagesBlock.childNodes[0];
354
- const firstExampleImage = firstSlot.childNodes[0];
355
- firstExampleImage.focus();
356
- }
357
- render() {
358
- return (index.h(index.Host, { onFocus: () => this.delegateFocus() }, index.h("slot", { name: "vviinn-example-images-title" }, index.h("h3", null, "Mit den Beispielbildern die Suche direkt ausprobieren")), index.h("div", { class: "images", ref: (el) => (this.imagesBlock = el) }, index.h("slot", { name: "vviinn-example-images-1" }, index.h("vviinn-example-image", { width: 480, height: 640, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc=", basicEventData: this.basicEventData })), index.h("slot", { name: "vviinn-example-images-2" }, index.h("vviinn-example-image", { width: 280, height: 480, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc=", basicEventData: this.basicEventData })), index.h("slot", { name: "vviinn-example-images-3" }, index.h("vviinn-example-image", { width: 280, height: 480, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc=", basicEventData: this.basicEventData })), index.h("slot", { name: "vviinn-example-images-4" }, index.h("vviinn-example-image", { width: 480, height: 640, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc=", basicEventData: this.basicEventData })))));
359
- }
360
- get el() { return index.getElement(this); }
361
- };
362
- VviinnExampleImages.style = vviinnExampleImagesCss;
363
-
364
- 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}";
365
-
366
- let VviinnImageSelector = class {
367
- constructor(hostRef) {
368
- index.registerInstance(this, hostRef);
369
- this.vviinnImageUpload = index.createEvent(this, "vviinnImageUpload", 7);
370
- this.vviinnNoResult = index.createEvent(this, "vviinnNoResult", 7);
371
- }
372
- async handleInputChange(event) {
373
- const input = event.target;
374
- const processingResult = await imageSearch_store.processSelectedFile(input.files[0]);
375
- imageSearch_store._function.pipe(processingResult, imageSearch_store.match$1(() => this.vviinnNoResult.emit(this.basicEventData), () => this.vviinnImageUpload.emit(this.basicEventData)));
376
- input.value = null;
377
- }
378
- isLoading() {
379
- return imageSearch_store.imageSearchState.loading;
380
- }
381
- render() {
382
- return (index.h(index.Host, { exportparts: "button" }, this.isLoading() ? index.h("vviinn-preloader", null) : null, this.isLoading() ? null : (index.h("label", { htmlFor: "fileInput", part: "button" }, index.h("slot", { name: "upload-button-text" }, "Upload image"))), index.h("input", { id: "fileInput", class: "visually-hidden", type: "file", accept: "image/*", onChange: (event) => this.handleInputChange(event) })));
383
- }
384
- };
385
- VviinnImageSelector.style = vviinnImageSelectorCss;
386
-
387
- 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}";
388
-
389
- const getImageSizes = (i) => {
390
- const dimensions = imageSearch_store.dimensionsFromImage(i);
391
- const resize = imageSearch_store.scaleByLargestSide(288);
392
- const newDimensions = resize(dimensions);
393
- const sizes = newDimensions.map((d) => d.size);
394
- return [sizes[0], sizes[1]];
395
- };
396
- let VviinnImageView = class {
397
- constructor(hostRef) {
398
- index.registerInstance(this, hostRef);
399
- }
400
- handleInitialImageLoad(ev) {
401
- const target = ev.target;
402
- const imageBounds = imageSearch_store.fromImage(target);
403
- const padding = 12;
404
- const { x, y } = imageSearch_store.move(imageBounds, { x: padding, y: padding });
405
- const searchArea = {
406
- x,
407
- y,
408
- width: imageBounds.width - padding * 2,
409
- height: imageBounds.height - padding * 2,
410
- };
411
- imageSearch_store.imageSearchState.imageBounds = imageSearch_store.Option.some(imageBounds);
412
- imageSearch_store.imageSearchState.searchArea = imageSearch_store.Option.some(searchArea);
413
- }
414
- renderDetectedObject(object) {
415
- return (index.h("vviinn-detected-object", { detectedObject: object, basicEventData: this.basicEventData }));
416
- }
417
- renderImage() {
418
- return imageSearch_store._function.pipe(imageSearch_store.sequenceToOption(imageSearch_store.imageSearchState.imageUrl, imageSearch_store.imageSearchState.image), imageSearch_store.Option.map(([url, refImage]) => {
419
- const [width, height] = getImageSizes(refImage);
420
- const image = (index.h("img", { decoding: "async", width: width, height: height, src: url, onLoad: (el) => this.handleInitialImageLoad(el), draggable: false }));
421
- return image;
422
- }), imageSearch_store.Option.getOrElse(() => null));
423
- }
424
- renderCropper() {
425
- return imageSearch_store._function.pipe(imageSearch_store.imageSearchState.imageUrl, imageSearch_store.Option.map(() => index.h("image-cropper", { basicEventData: this.basicEventData })), imageSearch_store.Option.getOrElse(() => null));
426
- }
427
- render() {
428
- return (index.h(index.Host, null, imageSearch_store.imageSearchState.loading ||
429
- imageSearch_store.imageSearchState.objectDetectionInProgress ? (index.h("div", { class: "image-preloader" }, index.h("vviinn-preloader", null))) : null, index.h("highlight-box", null), this.renderImage(), this.renderCropper(), imageSearch_store.imageSearchState.detectedObjects.map((o) => this.renderDetectedObject(o))));
430
- }
431
- };
432
- VviinnImageView.style = vviinnImageViewCss;
433
-
434
- 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%)}}";
435
-
436
- let VviinnModal = class {
437
- constructor(hostRef) {
438
- index.registerInstance(this, hostRef);
439
- this.vviinnWidgetClose = index.createEvent(this, "vviinnWidgetClose", 7);
440
- this.active = false;
441
- this.slider = false;
442
- }
443
- componentWillLoad() {
444
- customizedSlots.slotChangeListener(this, this.el);
445
- }
446
- close() {
447
- this.active = false;
448
- setTimeout(() => {
449
- this.vviinnWidgetClose.emit({
450
- widgetType: "VPS",
451
- campaignTypeId: "VPS",
452
- campaignTypeName: Campaign.campaignTypeNames["VPS"],
453
- widgetId: this.buttonElementId,
454
- });
455
- }, this.slider ? 500 : 0);
456
- }
457
- handleAnimationEnd(ev) {
458
- if (ev.animationName !== "fade-in")
459
- return;
460
- this.slider = true;
461
- }
462
- render() {
463
- return (index.h(index.Host, { exportparts: "secondary-action, title, close-button", class: { closed: !this.active }, onAnimationEnd: (ev) => this.handleAnimationEnd(ev) }, index.h("div", { class: "head" }, index.h("button", { part: "secondary-action", onClick: () => this.resetState() }, index.h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M20.25 12H3.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M10.5 5.25L3.75 12L10.5 18.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))), index.h("div", { class: "title", part: "title" }, index.h("slot", { name: "vviinn-image-search-modal-title" }, "Bildsuche")), index.h("button", { onClick: () => this.close(), class: "close-button", part: "close-button" }, index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.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" })))), index.h("div", { class: "body" }, index.h("slot", null))));
464
- }
465
- get el() { return index.getElement(this); }
466
- };
467
- VviinnModal.style = vviinnModalCss;
468
-
469
- 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))}";
470
-
471
- let VviinnOnboarding = class {
472
- constructor(hostRef) {
473
- index.registerInstance(this, hostRef);
474
- }
475
- componentWillLoad() {
476
- customizedSlots.slotChangeListener(this, this.el);
477
- }
478
- render() {
479
- return (index.h(index.Host, null, index.h("slot", { name: "vviinn-onboarding-title" }, index.h("h3", null, "So funktioniert es")), index.h("vviinn-slider", { showArrows: true }, index.h("vviinn-slide", null, index.h("vviinn-onboarding-card-1", null)), index.h("vviinn-slide", null, index.h("vviinn-onboarding-card-2", null)), index.h("vviinn-slide", null, index.h("vviinn-onboarding-card-3", null)))));
480
- }
481
- get el() { return index.getElement(this); }
482
- };
483
- VviinnOnboarding.style = vviinnOnboardingCss;
484
-
485
- 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}";
486
-
487
- let VviinnOnboardingCard1 = class {
488
- constructor(hostRef) {
489
- index.registerInstance(this, hostRef);
490
- }
491
- componentWillLoad() {
492
- customizedSlots.slotChangeListener(this, this.el);
493
- }
494
- render() {
495
- return (index.h(index.Host, null, index.h("slot", { name: "onboarding-card-1-icon" }, index.h(index$1.OnboardingCard1Icon, null)), index.h("slot", { name: "onboarding-card-1-text" }, index.h("div", { class: "text" }, index.h("h4", null, "Starte die Bildsuche"), index.h("p", null, "Lade ein Bild aus Deiner Galerie hoch oder fotografiere ein Produkt mit Deiner Kamera.")))));
496
- }
497
- get el() { return index.getElement(this); }
498
- };
499
- VviinnOnboardingCard1.style = onboardingCardCss$2;
500
-
501
- 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}";
502
-
503
- let VviinnOnboardingCard2 = class {
504
- constructor(hostRef) {
505
- index.registerInstance(this, hostRef);
506
- }
507
- componentWillLoad() {
508
- customizedSlots.slotChangeListener(this, this.el);
509
- }
510
- render() {
511
- return (index.h(index.Host, null, index.h("slot", { name: "onboarding-card-2-icon" }, index.h(index$1.OnboardingCard2Icon, null)), index.h("slot", { name: "onboarding-card-2-text" }, index.h("div", { class: "text" }, index.h("h4", null, "Verfeiner deine Suche"), index.h("p", null, "Du kannst den Bildrahmen selber festlegen und so die Produkte genau ausw\u00E4hlen.")))));
512
- }
513
- get el() { return index.getElement(this); }
514
- };
515
- VviinnOnboardingCard2.style = onboardingCardCss$1;
516
-
517
- 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}";
518
-
519
- let VviinnOnboardingCard3 = class {
520
- constructor(hostRef) {
521
- index.registerInstance(this, hostRef);
522
- }
523
- componentWillLoad() {
524
- customizedSlots.slotChangeListener(this, this.el);
525
- }
526
- render() {
527
- return (index.h(index.Host, null, index.h("slot", { name: "onboarding-card-3-icon" }, index.h(index$1.OnboardingCard3Icon, null)), index.h("slot", { name: "onboarding-card-3-text" }, index.h("div", { class: "text" }, index.h("h4", null, "Ohne Hintergrund"), index.h("p", null, "Die besten Ergebnisse erh\u00E4ltst Du, wenn das gesuchte Objekt mit einfarbigem und hellem Hintergrund zu sehen ist.")))));
528
- }
529
- get el() { return index.getElement(this); }
530
- };
531
- VviinnOnboardingCard3.style = onboardingCardCss;
532
-
533
- 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}}";
534
-
535
- let VviinnOverlay = class {
536
- constructor(hostRef) {
537
- index.registerInstance(this, hostRef);
538
- }
539
- render() {
540
- return (index.h(index.Host, null, index.h("slot", null)));
541
- }
542
- };
543
- VviinnOverlay.style = vviinnOverlayCss;
544
-
545
- 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}}";
546
-
547
- let VviinnOverlayedModal = class {
548
- constructor(hostRef) {
549
- index.registerInstance(this, hostRef);
550
- this.vviinnWidgetClose = index.createEvent(this, "vviinnWidgetClose", 7);
551
- this.active = false;
552
- }
553
- render() {
554
- return (index.h(index.Host, { class: { active: this.active } }, index.h("vviinn-overlay", null, index.h("vviinn-modal", { resetState: this.resetState, active: this.active, buttonElementId: this.buttonElementId }, index.h("slot", null, "CONTENT")))));
555
- }
556
- };
557
- VviinnOverlayedModal.style = vviinnOverlayedModalCss;
558
-
559
- 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}";
560
-
561
- let VviinnPrivacyBadge = class {
562
- constructor(hostRef) {
563
- index.registerInstance(this, hostRef);
564
- }
565
- componentWillLoad() {
566
- customizedSlots.slotChangeListener(this, this.el);
567
- }
568
- render() {
569
- return (index.h(index.Host, null, index.h("slot", null, index.h("div", { class: "content" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" }, index.h("defs", null), index.h("path", { fill: "#525252", d: "M8.5 11V7h-2v1h1v3H6v1h4v-1H8.5zM8 4a.75.75 0 100 1.5A.75.75 0 008 4z" }), index.h("path", { fill: "#525252", d: "M8 15A7 7 0 118 1a7 7 0 010 14zM8 2a6 6 0 100 12A6 6 0 008 2z" })), index.h("slot", { name: "vviinn-privacy-badge-text" }, index.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."))))));
570
- }
571
- get el() { return index.getElement(this); }
572
- };
573
- VviinnPrivacyBadge.style = vviinnPrivacyBadgeCss;
574
-
575
- const vviinnServerErrorCss = ":host{display:block}";
576
-
577
- let VviinnServerError = class {
578
- constructor(hostRef) {
579
- index.registerInstance(this, hostRef);
580
- }
581
- render() {
582
- return (index.h(index.Host, null, index.h("vviinn-error", null, index.h("h4", { slot: "title" }, "Keine Verbindung"), index.h("span", { slot: "text" }, "Etwas hat leider nicht funktioniert. Bitte pr\u00FCfen Sie Ihre Internetverbindung und laden Sie das Bild noch einmal hoch."), index.h("button", { slot: "action", onClick: this.handler }, "Erneut versuchen"))));
583
- }
584
- };
585
- VviinnServerError.style = vviinnServerErrorCss;
586
-
587
- const vviinnSlideCss = ":host{display:grid;justify-items:center}";
588
-
589
- let VviinnSlide = class {
590
- constructor(hostRef) {
591
- index.registerInstance(this, hostRef);
592
- }
593
- render() {
594
- return (index.h(index.Host, null, index.h("slot", null)));
595
- }
596
- };
597
- VviinnSlide.style = vviinnSlideCss;
598
-
599
- const getStyleMap = (data) => {
600
- return {
601
- "arrow-wrapper": true,
602
- [data.kind]: true,
603
- disabled: data.disabled,
604
- };
605
- };
606
- const Arrow = ({ kind, tabindex, disabled, onClick, onKeyDown, }) => (index.h("div", { class: getStyleMap({ kind, disabled }), onClick: onClick, tabindex: tabindex, onKeyDown: onKeyDown },
607
- index.h(index$1.ArrowIcon, null)));
608
-
609
- 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}";
610
-
611
- let VviinnSlider = class {
612
- constructor(hostRef) {
613
- index.registerInstance(this, hostRef);
614
- this.elementsCount = 0;
615
- this.internalPosition = 0;
616
- this.swipeStartPosition = imageSearch_store.Option.none;
617
- this.isRTL = false;
618
- this.showBullets = true;
619
- this.position = 0;
620
- this.showArrows = false;
621
- }
622
- positionWatchHandler(newValue) {
623
- this.internalPosition = newValue;
624
- this.el.style.setProperty("--position", `${this.calculatePosition(newValue)}`);
625
- this.setActiveCssClassToSlide(newValue);
626
- }
627
- componentWillLoad() {
628
- this.isRTL = document.dir === "rtl";
629
- }
630
- connectedCallback() {
631
- this.handleDomContentChanges();
632
- }
633
- handleDomContentChanges() {
634
- const items = this.el.querySelectorAll("vviinn-slide");
635
- this.elementsCount = items.length;
636
- this.el.style.setProperty("--num-items", `${this.elementsCount}`);
637
- this.setActiveCssClassToSlide(0);
638
- }
639
- setActiveCssClassToSlide(index) {
640
- const items = this.el.querySelectorAll("vviinn-slide");
641
- items.forEach((i) => i.classList.remove("active"));
642
- items[index].classList.add("active");
643
- }
644
- goToSlide(index) {
645
- this.internalPosition = index;
646
- this.el.style.setProperty("--position", `${index}`);
647
- this.setActiveCssClassToSlide(index);
648
- }
649
- renderBullets() {
650
- return this.showBullets ? (index.h("div", { class: "controls" }, imageSearch_store.NonEmptyArray.range(0, this.elementsCount - 1).map((i) => (index.h("div", { class: {
651
- bullet: true,
652
- active: i == Math.abs(this.internalPosition) % this.elementsCount,
653
- }, onClick: () => this.goToSlide(i) }))))) : null;
654
- }
655
- nextSlide() {
656
- this.internalPosition++;
657
- this.renderSlidePosition();
658
- }
659
- prevSlide() {
660
- const nextPostion = this.internalPosition - 1;
661
- this.internalPosition =
662
- nextPostion > -1 ? nextPostion : this.elementsCount - 1;
663
- this.renderSlidePosition();
664
- }
665
- renderSlidePosition() {
666
- const position = this.internalPosition % this.elementsCount;
667
- requestAnimationFrame(() => {
668
- this.el.style.setProperty("--position", `${this.calculatePosition(position)}`);
669
- });
670
- }
671
- calculatePosition(position) {
672
- return this.isRTL ? position * -1 : position;
673
- }
674
- handleKeyDown(event) {
675
- if (event.key !== "Space" && event.key !== "Enter")
676
- return;
677
- const target = event.target;
678
- const direction = target.className.includes("prev") ? "prev" : "next";
679
- switch (direction) {
680
- case "prev":
681
- this.prevSlide();
682
- break;
683
- case "next":
684
- this.nextSlide();
685
- break;
686
- }
687
- }
688
- handleTouchStart(event) {
689
- if (!this.showBullets)
690
- return;
691
- this.swipeStartPosition = imageSearch_store._function.pipe(event.touches[0], imageSearch_store.Option.fromNullable, imageSearch_store.Option.map((t) => t.clientX));
692
- }
693
- handleTouchEnd(event) {
694
- if (!this.showBullets)
695
- return;
696
- const swipeEndPosition = imageSearch_store._function.pipe(event.changedTouches[0], imageSearch_store.Option.fromNullable, imageSearch_store.Option.map((t) => t.clientX));
697
- imageSearch_store._function.pipe(imageSearch_store.sequenceToOption(this.swipeStartPosition, swipeEndPosition), imageSearch_store.Option.map(([start, end]) => Ord.compare(start, end)), imageSearch_store.Option.map((swipeDirection) => {
698
- switch (swipeDirection) {
699
- case 1:
700
- return this.nextSlide();
701
- case -1:
702
- return this.prevSlide();
703
- }
704
- }));
705
- }
706
- render() {
707
- return (index.h(index.Host, null, index.h("div", { class: "items-wrapper" }, index.h("div", { class: "items", onTouchStart: (e) => this.handleTouchStart(e), onTouchEnd: (e) => this.handleTouchEnd(e) }, index.h("slot", null))), this.showArrows
708
- ? [
709
- index.h(Arrow, { kind: "prev", onClick: () => this.isRTL ? this.nextSlide() : this.prevSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 1, disabled: false }),
710
- index.h(Arrow, { kind: "next", onClick: () => this.isRTL ? this.prevSlide() : this.nextSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 0, disabled: false }),
711
- ]
712
- : null, this.renderBullets()));
713
- }
714
- get el() { return index.getElement(this); }
715
- static get watchers() { return {
716
- "position": ["positionWatchHandler"]
717
- }; }
718
- };
719
- VviinnSlider.style = vviinnSliderCss;
720
-
721
- 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}";
722
-
723
- let VviinnTeaser = class {
724
- constructor(hostRef) {
725
- index.registerInstance(this, hostRef);
726
- }
727
- componentWillLoad() {
728
- customizedSlots.slotChangeListener(this, this.el);
729
- }
730
- render() {
731
- return (index.h(index.Host, null, index.h("slot", null, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "64", height: "64", fill: "none" }, index.h("defs", null), index.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" }), index.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" })), index.h("span", { class: "vviinn-teaser-text" }, index.h("slot", { name: "vviinn-teaser-text" }, "Finde Produkte auf ", index.h("br", null), " einem Foto")))));
732
- }
733
- get el() { return index.getElement(this); }
734
- };
735
- VviinnTeaser.style = vviinnTeaserCss;
736
-
737
- const vviinnWrongFormatCss = ":host{display:block}";
738
-
739
- let VviinnWrongFormat = class {
740
- constructor(hostRef) {
741
- index.registerInstance(this, hostRef);
742
- }
743
- render() {
744
- return (index.h(index.Host, null, index.h("vviinn-error", null, index.h("h4", { slot: "title" }, "Dateityp wird nicht unterst\u00FCtzt"), index.h("span", { slot: "text" }, "Leider unterst\u00FCtzen wir dieses Format nicht. Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch."), index.h("button", { slot: "action", onClick: this.handler }, "Neues Bild hochladen"))));
745
- }
746
- };
747
- VviinnWrongFormat.style = vviinnWrongFormatCss;
748
-
749
- exports.highlight_box = HighlightBox;
750
- exports.image_cropper = ImageCropper;
751
- exports.search_filters = SearchFilters;
752
- exports.vviinn_detected_object = VviinnDetectedObject;
753
- exports.vviinn_empty_results = VviinnEmptyResults;
754
- exports.vviinn_example_image = VviinnExampleImage;
755
- exports.vviinn_example_images = VviinnExampleImages;
756
- exports.vviinn_image_selector = VviinnImageSelector;
757
- exports.vviinn_image_view = VviinnImageView;
758
- exports.vviinn_modal = VviinnModal;
759
- exports.vviinn_onboarding = VviinnOnboarding;
760
- exports.vviinn_onboarding_card_1 = VviinnOnboardingCard1;
761
- exports.vviinn_onboarding_card_2 = VviinnOnboardingCard2;
762
- exports.vviinn_onboarding_card_3 = VviinnOnboardingCard3;
763
- exports.vviinn_overlay = VviinnOverlay;
764
- exports.vviinn_overlayed_modal = VviinnOverlayedModal;
765
- exports.vviinn_privacy_badge = VviinnPrivacyBadge;
766
- exports.vviinn_server_error = VviinnServerError;
767
- exports.vviinn_slide = VviinnSlide;
768
- exports.vviinn_slider = VviinnSlider;
769
- exports.vviinn_teaser = VviinnTeaser;
770
- exports.vviinn_wrong_format = VviinnWrongFormat;