vviinn-widgets 2.20.21 → 2.20.29

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 (97) hide show
  1. package/dist/cjs/highlight-box_22.cjs.entry.js +25 -10
  2. package/dist/cjs/i18next-74ff3413.js +2258 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{package-1c24894e.js → package-fc932371.js} +1 -1
  5. package/dist/cjs/vviinn-carousel_3.cjs.entry.js +86 -65
  6. package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +2 -1
  7. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +4 -2
  8. package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
  9. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +69 -2
  10. package/dist/cjs/vviinn-widgets.cjs.js +1 -1
  11. package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +2 -1
  12. package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +19 -1
  13. package/dist/collection/components/vviinn-modal/vviinn-modal.css +20 -2
  14. package/dist/collection/components/vviinn-modal/vviinn-modal.js +12 -1
  15. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +43 -1
  16. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +43 -1
  17. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +43 -1
  18. package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +2 -1
  19. package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +25 -1
  20. package/dist/collection/components/vviinn-product-card/stories/vviinn-product-card.stories.js +1 -1
  21. package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +2 -1
  22. package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +24 -1
  23. package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +5 -1
  24. package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +29 -4
  25. package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +5 -2
  26. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +26 -12
  27. package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +3 -0
  28. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +9 -4
  29. package/dist/collection/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.js +10 -8
  30. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +22 -10
  31. package/dist/collection/locale/index.js +1 -0
  32. package/dist/collection/locale/resources-vpr.js +12 -0
  33. package/dist/collection/locale/resources-vps.js +60 -0
  34. package/dist/esm/highlight-box_22.entry.js +25 -10
  35. package/dist/esm/i18next-387f2b0a.js +2256 -0
  36. package/dist/esm/loader.js +1 -1
  37. package/dist/esm/package-e2f2d588.js +3 -0
  38. package/dist/esm/vviinn-carousel_3.entry.js +86 -65
  39. package/dist/esm/vviinn-recommendations-sidebar.entry.js +2 -1
  40. package/dist/esm/vviinn-vpr-button.entry.js +4 -2
  41. package/dist/esm/vviinn-vps-button.entry.js +1 -1
  42. package/dist/esm/vviinn-vps-widget.entry.js +69 -2
  43. package/dist/esm/vviinn-widgets.js +1 -1
  44. package/dist/types/components/vviinn-example-images/vviinn-example-images.d.ts +1 -0
  45. package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +1 -0
  46. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.d.ts +2 -0
  47. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.d.ts +2 -0
  48. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.d.ts +2 -0
  49. package/dist/types/components/vviinn-privacy-badge/vviinn-privacy-badge.d.ts +1 -0
  50. package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +2 -0
  51. package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +5 -2
  52. package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +5 -4
  53. package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +3 -2
  54. package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +3 -2
  55. package/dist/types/components.d.ts +48 -20
  56. package/dist/types/locale/index.d.ts +1 -0
  57. package/dist/types/locale/resources-vpr.d.ts +2 -0
  58. package/dist/types/locale/resources-vps.d.ts +2 -0
  59. package/dist/vviinn-widgets/p-2e76a5c3.js +1 -0
  60. package/dist/vviinn-widgets/p-51dd5bb7.entry.js +1 -0
  61. package/dist/vviinn-widgets/p-5283bad8.entry.js +1 -0
  62. package/dist/vviinn-widgets/p-643545b1.entry.js +1 -0
  63. package/dist/vviinn-widgets/p-a4d06752.entry.js +1 -0
  64. package/dist/vviinn-widgets/p-c06f6765.entry.js +1 -0
  65. package/dist/vviinn-widgets/p-d99266bf.js +1 -0
  66. package/dist/vviinn-widgets/p-df710209.entry.js +1 -0
  67. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  68. package/package.json +3 -2
  69. package/www/build/p-2e76a5c3.js +1 -0
  70. package/www/build/p-51dd5bb7.entry.js +1 -0
  71. package/www/build/p-5283bad8.entry.js +1 -0
  72. package/www/build/p-643545b1.entry.js +1 -0
  73. package/www/build/p-9e468d0a.js +161 -0
  74. package/www/build/p-a4d06752.entry.js +1 -0
  75. package/www/build/p-c06f6765.entry.js +1 -0
  76. package/www/build/p-d99266bf.js +1 -0
  77. package/www/build/p-df710209.entry.js +1 -0
  78. package/www/build/p-e0153ae2.css +6 -0
  79. package/www/build/vviinn-widgets.esm.js +1 -1
  80. package/www/index.html +4 -1
  81. package/dist/esm/package-4909a9ed.js +0 -3
  82. package/dist/vviinn-widgets/p-1aa66c1a.entry.js +0 -1
  83. package/dist/vviinn-widgets/p-4cb106e3.entry.js +0 -1
  84. package/dist/vviinn-widgets/p-637925f0.entry.js +0 -1
  85. package/dist/vviinn-widgets/p-6a189f8f.js +0 -1
  86. package/dist/vviinn-widgets/p-a1c3ccce.entry.js +0 -1
  87. package/dist/vviinn-widgets/p-ab973311.entry.js +0 -1
  88. package/dist/vviinn-widgets/p-e5fbf695.entry.js +0 -1
  89. package/www/build/p-1aa66c1a.entry.js +0 -1
  90. package/www/build/p-3fe5816c.js +0 -1
  91. package/www/build/p-4cb106e3.entry.js +0 -1
  92. package/www/build/p-637925f0.entry.js +0 -1
  93. package/www/build/p-6a189f8f.js +0 -1
  94. package/www/build/p-a1c3ccce.entry.js +0 -1
  95. package/www/build/p-a67898be.css +0 -1
  96. package/www/build/p-ab973311.entry.js +0 -1
  97. package/www/build/p-e5fbf695.entry.js +0 -1
@@ -1,6 +1,7 @@
1
1
  import { EventEmitter } from "../../stencil-public-runtime";
2
2
  import { EventConfirmation } from "vviinn-tracking-client-ts";
3
3
  import { ProductCardEvent, BasicEventData, SelectFilterEventData, ProductCardEventData, SelectObjectEventData } from "../../recommendation/events";
4
+ import { Locale } from "../../locale";
4
5
  /**
5
6
  * @part close-button - Close Button in the modal's header.
6
7
  * @part secondary-action - Back Button in the modal's header.
@@ -49,8 +50,8 @@ export declare class VviinnVpsWidget {
49
50
  active: boolean;
50
51
  /** The currency sign is displayed after the price */
51
52
  currencySign: string;
52
- /** The locale for currency formatting */
53
- locale: string;
53
+ /** The locale for currency formatting and text localization */
54
+ locale: Locale;
54
55
  /** Campaign ID applied for visual search */
55
56
  campaignId: string;
56
57
  /** Excluded filter. Example: "brand:Nike;custom_label_0:summer" */
@@ -13,6 +13,7 @@ import { CampaignName, CampaignTypeId } from "./campaign/Campaign";
13
13
  import { Recommendation } from "./recommendation/recommendation";
14
14
  import { ValueObject } from "./network/ion/ValueObject";
15
15
  import { CarouselMode as CarouselMode1 } from "./components/vviinn-carousel/vviinn-carousel";
16
+ import { Locale } from "./locale";
16
17
  export { Handler } from "./cropper/Handler";
17
18
  export { BasicEventData, ProductCardEventData, SelectFilterEventData, SelectObjectEventData } from "./recommendation/events";
18
19
  export { DetectedObject, SearchSessionFilter } from "./searchSession/searchSession";
@@ -21,6 +22,7 @@ export { CampaignName, CampaignTypeId } from "./campaign/Campaign";
21
22
  export { Recommendation } from "./recommendation/recommendation";
22
23
  export { ValueObject } from "./network/ion/ValueObject";
23
24
  export { CarouselMode as CarouselMode1 } from "./components/vviinn-carousel/vviinn-carousel";
25
+ export { Locale } from "./locale";
24
26
  export namespace Components {
25
27
  interface CropperHandler {
26
28
  "disabled": boolean;
@@ -65,6 +67,7 @@ export namespace Components {
65
67
  }
66
68
  interface VviinnExampleImages {
67
69
  "basicEventData": BasicEventData;
70
+ "exampleImagesTitle": string;
68
71
  }
69
72
  interface VviinnImageSelector {
70
73
  "basicEventData": BasicEventData;
@@ -84,10 +87,16 @@ export namespace Components {
84
87
  interface VviinnOnboarding {
85
88
  }
86
89
  interface VviinnOnboardingCard1 {
90
+ "cardText": string;
91
+ "cardTitle": string;
87
92
  }
88
93
  interface VviinnOnboardingCard2 {
94
+ "cardText": string;
95
+ "cardTitle": string;
89
96
  }
90
97
  interface VviinnOnboardingCard3 {
98
+ "cardText": string;
99
+ "cardTitle": string;
91
100
  }
92
101
  interface VviinnOverlay {
93
102
  }
@@ -101,6 +110,7 @@ export namespace Components {
101
110
  interface VviinnPreloader {
102
111
  }
103
112
  interface VviinnPrivacyBadge {
113
+ "privacyBadgeText": string;
104
114
  }
105
115
  interface VviinnProductCard {
106
116
  "brand": string | undefined;
@@ -140,6 +150,7 @@ export namespace Components {
140
150
  */
141
151
  "gridArrowsDynamic": boolean;
142
152
  "imageWidth": number;
153
+ "locale": Locale;
143
154
  "mode": CarouselMode1;
144
155
  "noResultShow": boolean;
145
156
  "noResultText": string;
@@ -202,6 +213,10 @@ export namespace Components {
202
213
  * Width of each recommended product image
203
214
  */
204
215
  "imageWidth": number;
216
+ /**
217
+ * The locale for currency formatting and text localization
218
+ */
219
+ "locale": Locale;
205
220
  /**
206
221
  * Show or hide the scrollbar
207
222
  */
@@ -215,7 +230,7 @@ export namespace Components {
215
230
  */
216
231
  "noResultShow": boolean;
217
232
  /**
218
- * The message is displayed when no results
233
+ * A custom message is displayed when no results
219
234
  */
220
235
  "noResultText": string;
221
236
  /**
@@ -231,7 +246,7 @@ export namespace Components {
231
246
  */
232
247
  "productId": string;
233
248
  /**
234
- * Sidebar title
249
+ * Sidebar title (change it to fit your locale)
235
250
  */
236
251
  "sidebarTitle": string;
237
252
  /**
@@ -246,7 +261,7 @@ export namespace Components {
246
261
  interface VviinnVprWidget {
247
262
  "apiPath": string | undefined;
248
263
  /**
249
- * Widget’s title
264
+ * Widget’s title (change it to fit your locale)
250
265
  */
251
266
  "blockTitle": string;
252
267
  "buttonElementId"?: string;
@@ -287,9 +302,9 @@ export namespace Components {
287
302
  */
288
303
  "imageWidth": number;
289
304
  /**
290
- * The locale for currency formatting
305
+ * The locale for currency formatting and text localization
291
306
  */
292
- "locale": string;
307
+ "locale": Locale;
293
308
  /**
294
309
  * Switch between carousel modes
295
310
  */
@@ -299,7 +314,7 @@ export namespace Components {
299
314
  */
300
315
  "noResultShow": boolean;
301
316
  /**
302
- * The message is displayed when no results
317
+ * A custom message is displayed when no results
303
318
  */
304
319
  "noResultText": string;
305
320
  /**
@@ -344,9 +359,9 @@ export namespace Components {
344
359
  */
345
360
  "excluded": string;
346
361
  /**
347
- * The locale for currency formatting
362
+ * The locale for currency formatting and text localization
348
363
  */
349
- "locale": string;
364
+ "locale": Locale;
350
365
  /**
351
366
  * Show the onboarding step or skip it and move to the direct image upload.
352
367
  */
@@ -381,9 +396,9 @@ export namespace Components {
381
396
  */
382
397
  "excluded": string;
383
398
  /**
384
- * The locale for currency formatting
399
+ * The locale for currency formatting and text localization
385
400
  */
386
- "locale": string;
401
+ "locale": Locale;
387
402
  "mode": "modal" | "upload";
388
403
  /**
389
404
  * Toggle for opening product link in new tab or not
@@ -739,6 +754,7 @@ declare namespace LocalJSX {
739
754
  }
740
755
  interface VviinnExampleImages {
741
756
  "basicEventData"?: BasicEventData;
757
+ "exampleImagesTitle"?: string;
742
758
  "onVviinnImageUpload"?: (event: VviinnExampleImagesCustomEvent<BasicEventData>) => void;
743
759
  "onVviinnNoResult"?: (event: VviinnExampleImagesCustomEvent<BasicEventData>) => void;
744
760
  }
@@ -769,10 +785,16 @@ declare namespace LocalJSX {
769
785
  interface VviinnOnboarding {
770
786
  }
771
787
  interface VviinnOnboardingCard1 {
788
+ "cardText"?: string;
789
+ "cardTitle"?: string;
772
790
  }
773
791
  interface VviinnOnboardingCard2 {
792
+ "cardText"?: string;
793
+ "cardTitle"?: string;
774
794
  }
775
795
  interface VviinnOnboardingCard3 {
796
+ "cardText"?: string;
797
+ "cardTitle"?: string;
776
798
  }
777
799
  interface VviinnOverlay {
778
800
  }
@@ -784,6 +806,7 @@ declare namespace LocalJSX {
784
806
  interface VviinnPreloader {
785
807
  }
786
808
  interface VviinnPrivacyBadge {
809
+ "privacyBadgeText"?: string;
787
810
  }
788
811
  interface VviinnProductCard {
789
812
  "brand"?: string | undefined;
@@ -828,6 +851,7 @@ declare namespace LocalJSX {
828
851
  */
829
852
  "gridArrowsDynamic"?: boolean;
830
853
  "imageWidth"?: number;
854
+ "locale"?: Locale;
831
855
  "mode"?: CarouselMode1;
832
856
  "noResultShow"?: boolean;
833
857
  "noResultText"?: string;
@@ -888,6 +912,10 @@ declare namespace LocalJSX {
888
912
  * Width of each recommended product image
889
913
  */
890
914
  "imageWidth"?: number;
915
+ /**
916
+ * The locale for currency formatting and text localization
917
+ */
918
+ "locale"?: Locale;
891
919
  /**
892
920
  * Show or hide the scrollbar
893
921
  */
@@ -901,7 +929,7 @@ declare namespace LocalJSX {
901
929
  */
902
930
  "noResultShow"?: boolean;
903
931
  /**
904
- * The message is displayed when no results
932
+ * A custom message is displayed when no results
905
933
  */
906
934
  "noResultText"?: string;
907
935
  /**
@@ -945,7 +973,7 @@ declare namespace LocalJSX {
945
973
  */
946
974
  "productId"?: string;
947
975
  /**
948
- * Sidebar title
976
+ * Sidebar title (change it to fit your locale)
949
977
  */
950
978
  "sidebarTitle"?: string;
951
979
  /**
@@ -959,7 +987,7 @@ declare namespace LocalJSX {
959
987
  }
960
988
  interface VviinnVprWidget {
961
989
  /**
962
- * Widget’s title
990
+ * Widget’s title (change it to fit your locale)
963
991
  */
964
992
  "blockTitle"?: string;
965
993
  /**
@@ -999,9 +1027,9 @@ declare namespace LocalJSX {
999
1027
  */
1000
1028
  "imageWidth"?: number;
1001
1029
  /**
1002
- * The locale for currency formatting
1030
+ * The locale for currency formatting and text localization
1003
1031
  */
1004
- "locale"?: string;
1032
+ "locale"?: Locale;
1005
1033
  /**
1006
1034
  * Switch between carousel modes
1007
1035
  */
@@ -1011,7 +1039,7 @@ declare namespace LocalJSX {
1011
1039
  */
1012
1040
  "noResultShow"?: boolean;
1013
1041
  /**
1014
- * The message is displayed when no results
1042
+ * A custom message is displayed when no results
1015
1043
  */
1016
1044
  "noResultText"?: string;
1017
1045
  /**
@@ -1073,9 +1101,9 @@ declare namespace LocalJSX {
1073
1101
  */
1074
1102
  "excluded"?: string;
1075
1103
  /**
1076
- * The locale for currency formatting
1104
+ * The locale for currency formatting and text localization
1077
1105
  */
1078
- "locale"?: string;
1106
+ "locale"?: Locale;
1079
1107
  /**
1080
1108
  * Show the onboarding step or skip it and move to the direct image upload.
1081
1109
  */
@@ -1151,9 +1179,9 @@ declare namespace LocalJSX {
1151
1179
  */
1152
1180
  "excluded"?: string;
1153
1181
  /**
1154
- * The locale for currency formatting
1182
+ * The locale for currency formatting and text localization
1155
1183
  */
1156
- "locale"?: string;
1184
+ "locale"?: Locale;
1157
1185
  /**
1158
1186
  * Crop area changes
1159
1187
  */
@@ -0,0 +1 @@
1
+ export type Locale = "en-US" | "de-DE";
@@ -0,0 +1,2 @@
1
+ import { Resource } from "i18next";
2
+ export declare const resources: Resource;
@@ -0,0 +1,2 @@
1
+ import { Resource } from "i18next";
2
+ export declare const resources: Resource;
@@ -0,0 +1 @@
1
+ const t={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,s){console&&console[t]&&console[t].apply(console,s)}};class s{constructor(t){this.init(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}init(s){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=s||t,this.options=i,this.debug=i.debug}log(){for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];return this.forward(s,"log","",!0)}warn(){for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];return this.forward(s,"warn","",!0)}error(){for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];return this.forward(s,"error","")}deprecate(){for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];return this.forward(s,"warn","WARNING DEPRECATED: ",!0)}forward(t,s,i,e){return e&&!this.debug?null:("string"==typeof t[0]&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[s](t))}create(t){return new s(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new s(this.logger,t)}}var i=new s;class e{constructor(){this.observers={}}on(t,s){return t.split(" ").forEach((t=>{this.observers[t]=this.observers[t]||[],this.observers[t].push(s)})),this}off(t,s){this.observers[t]&&(s?this.observers[t]=this.observers[t].filter((t=>t!==s)):delete this.observers[t])}emit(t){for(var s=arguments.length,i=new Array(s>1?s-1:0),e=1;e<s;e++)i[e-1]=arguments[e];this.observers[t]&&[].concat(this.observers[t]).forEach((t=>{t(...i)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((s=>{s.apply(s,[t,...i])}))}}function n(){let t,s;const i=new Promise(((i,e)=>{t=i,s=e}));return i.resolve=t,i.reject=s,i}function r(t){return null==t?"":""+t}function o(t,s,i){function e(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function n(){return!t||"string"==typeof t}const r="string"!=typeof s?[].concat(s):s.split(".");for(;r.length>1;){if(n())return{};const s=e(r.shift());!t[s]&&i&&(t[s]=new i),t=Object.prototype.hasOwnProperty.call(t,s)?t[s]:{}}return n()?{}:{obj:t,k:e(r.shift())}}function h(t,s,i){const{obj:e,k:n}=o(t,s,Object);e[n]=i}function a(t,s){const{obj:i,k:e}=o(t,s);if(i)return i[e]}function u(t,s,i){for(const e in s)"__proto__"!==e&&"constructor"!==e&&(e in t?"string"==typeof t[e]||t[e]instanceof String||"string"==typeof s[e]||s[e]instanceof String?i&&(t[e]=s[e]):u(t[e],s[e],i):t[e]=s[e]);return t}function c(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function f(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(t=>l[t])):t}const d=[" ",",","?","!",";"];function g(t,s){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!t)return;if(t[s])return t[s];const e=s.split(i);let n=t;for(let t=0;t<e.length;++t){if(!n)return;if("string"==typeof n[e[t]]&&t+1<e.length)return;if(void 0===n[e[t]]){let r=2,o=e.slice(t,t+r).join(i),h=n[o];for(;void 0===h&&e.length>t+r;)r++,o=e.slice(t,t+r).join(i),h=n[o];if(void 0===h)return;if(null===h)return null;if(s.endsWith(o)){if("string"==typeof h)return h;if(o&&"string"==typeof h[o])return h[o]}const a=e.slice(t+r).join(i);return a?g(h,a,i):void 0}n=n[e[t]]}return n}function p(t){return t&&t.indexOf("_")>0?t.replace("_","-"):t}class v extends e{constructor(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=s,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const s=this.options.ns.indexOf(t);s>-1&&this.options.ns.splice(s,1)}getResource(t,s,i){let e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const n=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,r=void 0!==e.ignoreJSONStructure?e.ignoreJSONStructure:this.options.ignoreJSONStructure;let o=[t,s];i&&"string"!=typeof i&&(o=o.concat(i)),i&&"string"==typeof i&&(o=o.concat(n?i.split(n):i)),t.indexOf(".")>-1&&(o=t.split("."));const h=a(this.data,o);return h||!r||"string"!=typeof i?h:g(this.data&&this.data[t]&&this.data[t][s],i,n)}addResource(t,s,i,e){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let o=[t,s];i&&(o=o.concat(r?i.split(r):i)),t.indexOf(".")>-1&&(o=t.split("."),e=s,s=o[1]),this.addNamespaces(s),h(this.data,o,e),n.silent||this.emit("added",t,s,i,e)}addResources(t,s,i){let e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const e in i)"string"!=typeof i[e]&&"[object Array]"!==Object.prototype.toString.apply(i[e])||this.addResource(t,s,e,i[e],{silent:!0});e.silent||this.emit("added",t,s,i)}addResourceBundle(t,s,i,e,n){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},o=[t,s];t.indexOf(".")>-1&&(o=t.split("."),e=i,i=s,s=o[1]),this.addNamespaces(s);let c=a(this.data,o)||{};e?u(c,i,n):c={...c,...i},h(this.data,o,c),r.silent||this.emit("added",t,s,i)}removeResourceBundle(t,s){this.hasResourceBundle(t,s)&&delete this.data[t][s],this.removeNamespaces(s),this.emit("removed",t,s)}hasResourceBundle(t,s){return void 0!==this.getResource(t,s)}getResourceBundle(t,s){return s||(s=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(t,s)}:this.getResource(t,s)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const s=this.getDataByLanguage(t);return!!(s&&Object.keys(s)||[]).find((t=>s[t]&&Object.keys(s[t]).length>0))}toJSON(){return this.data}}var y={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,s,i,e,n){return t.forEach((t=>{this.processors[t]&&(s=this.processors[t].process(s,i,e,n))})),s}};const m={};class b extends e{constructor(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var e,n;super(),e=t,n=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((t=>{e[t]&&(n[t]=e[t])})),this.options=s,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=i.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){if(null==t)return!1;const s=this.resolve(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}});return s&&void 0!==s.res}extractFromKey(t,s){let i=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");const e=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator;let n=s.ns||this.options.defaultNS||[];const r=i&&t.indexOf(i)>-1,o=!(this.options.userDefinedKeySeparator||s.keySeparator||this.options.userDefinedNsSeparator||s.nsSeparator||function(t,s,i){s=s||"",i=i||"";const e=d.filter((t=>s.indexOf(t)<0&&i.indexOf(t)<0));if(0===e.length)return!0;const n=new RegExp(`(${e.map((t=>"?"===t?"\\?":t)).join("|")})`);let r=!n.test(t);if(!r){const s=t.indexOf(i);s>0&&!n.test(t.substring(0,s))&&(r=!0)}return r}(t,i,e));if(r&&!o){const s=t.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:t,namespaces:n};const r=t.split(i);(i!==e||i===e&&this.options.ns.indexOf(r[0])>-1)&&(n=r.shift()),t=r.join(e)}return"string"==typeof n&&(n=[n]),{key:t,namespaces:n}}translate(t,s,i){if("object"!=typeof s&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof s&&(s={...s}),s||(s={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);const e=void 0!==s.returnDetails?s.returnDetails:this.options.returnDetails,n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,{key:r,namespaces:o}=this.extractFromKey(t[t.length-1],s),h=o[o.length-1],a=s.lng||this.language,u=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(a&&"cimode"===a.toLowerCase()){if(u){const t=s.nsSeparator||this.options.nsSeparator;return e?{res:`${h}${t}${r}`,usedKey:r,exactUsedKey:r,usedLng:a,usedNS:h}:`${h}${t}${r}`}return e?{res:r,usedKey:r,exactUsedKey:r,usedLng:a,usedNS:h}:r}const c=this.resolve(t,s);let l=c&&c.res;const f=c&&c.usedKey||r,d=c&&c.exactUsedKey||r,g=Object.prototype.toString.apply(l),p=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&l&&"string"!=typeof l&&"boolean"!=typeof l&&"number"!=typeof l&&["[object Number]","[object Function]","[object RegExp]"].indexOf(g)<0&&("string"!=typeof p||"[object Array]"!==g)){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,l,{...s,ns:o}):`key '${r} (${this.language})' returned an object instead of string.`;return e?(c.res=t,c):t}if(n){const t="[object Array]"===g,i=t?[]:{},e=t?d:f;for(const t in l)if(Object.prototype.hasOwnProperty.call(l,t)){const r=`${e}${n}${t}`;i[t]=this.translate(r,{...s,joinArrays:!1,ns:o}),i[t]===r&&(i[t]=l[t])}l=i}}else if(v&&"string"==typeof p&&"[object Array]"===g)l=l.join(p),l&&(l=this.extendTranslation(l,t,s,i));else{let e=!1,o=!1;const u=void 0!==s.count&&"string"!=typeof s.count,f=b.hasDefaultValue(s),d=u?this.pluralResolver.getSuffix(a,s.count,s):"",g=s.ordinal&&u?this.pluralResolver.getSuffix(a,s.count,{ordinal:!1}):"",p=s[`defaultValue${d}`]||s[`defaultValue${g}`]||s.defaultValue;!this.isValidLookup(l)&&f&&(e=!0,l=p),this.isValidLookup(l)||(o=!0,l=r);const v=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:l,y=f&&p!==l&&this.options.updateMissing;if(o||e||y){if(this.logger.log(y?"updateKey":"missingKey",a,h,r,y?p:l),n){const t=this.resolve(r,{...s,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const i=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if("fallback"===this.options.saveMissingTo&&i&&i[0])for(let s=0;s<i.length;s++)t.push(i[s]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(s.lng||this.language):t.push(s.lng||this.language);const e=(t,i,e)=>{const n=f&&e!==l?e:v;this.options.missingKeyHandler?this.options.missingKeyHandler(t,h,i,n,y,s):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(t,h,i,n,y,s),this.emit("missingKey",t,h,i,l)};this.options.saveMissing&&(this.options.saveMissingPlurals&&u?t.forEach((t=>{this.pluralResolver.getSuffixes(t,s).forEach((i=>{e([t],r+i,s[`defaultValue${i}`]||p)}))})):e(t,r,p))}l=this.extendTranslation(l,t,s,c,i),o&&l===r&&this.options.appendNamespaceToMissingKey&&(l=`${h}:${r}`),(o||e)&&this.options.parseMissingKeyHandler&&(l="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}:${r}`:r,e?l:void 0):this.options.parseMissingKeyHandler(l))}return e?(c.res=l,c):l}extendTranslation(t,s,i,e,n){var r=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},e.usedLng,e.usedNS,e.usedKey,{resolved:e});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const o="string"==typeof t&&(i&&i.interpolation&&void 0!==i.interpolation.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(o){const s=t.match(this.interpolator.nestingRegexp);h=s&&s.length}let a=i.replace&&"string"!=typeof i.replace?i.replace:i;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),t=this.interpolator.interpolate(t,a,i.lng||this.language,i),o){const s=t.match(this.interpolator.nestingRegexp);h<(s&&s.length)&&(i.nest=!1)}!i.lng&&"v1"!==this.options.compatibilityAPI&&e&&e.res&&(i.lng=e.usedLng),!1!==i.nest&&(t=this.interpolator.nest(t,(function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return n&&n[0]===e[0]&&!i.context?(r.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${s[0]}`),null):r.translate(...e,s)}),i)),i.interpolation&&this.interpolator.reset()}const o=i.postProcess||this.options.postProcess,h="string"==typeof o?[o]:o;return null!=t&&h&&h.length&&!1!==i.applyPostProcessor&&(t=y.handle(h,t,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:e,...i}:i,this)),t}resolve(t){let s,i,e,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((t=>{if(this.isValidLookup(s))return;const h=this.extractFromKey(t,o),a=h.key;i=a;let u=h.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const c=void 0!==o.count&&"string"!=typeof o.count,l=c&&!o.ordinal&&0===o.count&&this.pluralResolver.shouldUseIntlApi(),f=void 0!==o.context&&("string"==typeof o.context||"number"==typeof o.context)&&""!==o.context,d=o.lngs?o.lngs:this.languageUtils.toResolveHierarchy(o.lng||this.language,o.fallbackLng);u.forEach((t=>{this.isValidLookup(s)||(r=t,!m[`${d[0]}-${t}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(r)&&(m[`${d[0]}-${t}`]=!0,this.logger.warn(`key "${i}" for languages "${d.join(", ")}" won't get resolved as namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach((i=>{if(this.isValidLookup(s))return;n=i;const r=[a];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(r,a,i,t,o);else{let t;c&&(t=this.pluralResolver.getSuffix(i,o.count,o));const s=`${this.options.pluralSeparator}zero`,e=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(r.push(a+t),o.ordinal&&0===t.indexOf(e)&&r.push(a+t.replace(e,this.options.pluralSeparator)),l&&r.push(a+s)),f){const i=`${a}${this.options.contextSeparator}${o.context}`;r.push(i),c&&(r.push(i+t),o.ordinal&&0===t.indexOf(e)&&r.push(i+t.replace(e,this.options.pluralSeparator)),l&&r.push(i+s))}}let h;for(;h=r.pop();)this.isValidLookup(s)||(e=h,s=this.getResource(i,t,h,o))})))}))})),{res:s,usedKey:i,exactUsedKey:e,usedLng:n,usedNS:r}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,s,i){let e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,s,i,e):this.resourceStore.getResource(t,s,i,e)}static hasDefaultValue(t){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"defaultValue"===s.substring(0,12)&&void 0!==t[s])return!0;return!1}}function $(t){return t.charAt(0).toUpperCase()+t.slice(1)}class w{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=i.create("languageUtils")}getScriptPartFromCode(t){if(!(t=p(t))||t.indexOf("-")<0)return null;const s=t.split("-");return 2===s.length?null:(s.pop(),"x"===s[s.length-1].toLowerCase()?null:this.formatLanguageCode(s.join("-")))}getLanguagePartFromCode(t){if(!(t=p(t))||t.indexOf("-")<0)return t;const s=t.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(t){if("string"==typeof t&&t.indexOf("-")>-1){const s=["hans","hant","latn","cyrl","cans","mong","arab"];let i=t.split("-");return this.options.lowerCaseLng?i=i.map((t=>t.toLowerCase())):2===i.length?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),s.indexOf(i[1].toLowerCase())>-1&&(i[1]=$(i[1].toLowerCase()))):3===i.length&&(i[0]=i[0].toLowerCase(),2===i[1].length&&(i[1]=i[1].toUpperCase()),"sgn"!==i[0]&&2===i[2].length&&(i[2]=i[2].toUpperCase()),s.indexOf(i[1].toLowerCase())>-1&&(i[1]=$(i[1].toLowerCase())),s.indexOf(i[2].toLowerCase())>-1&&(i[2]=$(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let s;return t.forEach((t=>{if(s)return;const i=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(i)||(s=i)})),!s&&this.options.supportedLngs&&t.forEach((t=>{if(s)return;const i=this.getLanguagePartFromCode(t);if(this.isSupportedCode(i))return s=i;s=this.options.supportedLngs.find((t=>t===i?t:t.indexOf("-")<0&&i.indexOf("-")<0?void 0:0===t.indexOf(i)?t:void 0))})),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(t,s){if(!t)return[];if("function"==typeof t&&(t=t(s)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!s)return t.default||[];let i=t[s];return i||(i=t[this.getScriptPartFromCode(s)]),i||(i=t[this.formatLanguageCode(s)]),i||(i=t[this.getLanguagePartFromCode(s)]),i||(i=t.default),i||[]}toResolveHierarchy(t,s){const i=this.getFallbackCodes(s||this.options.fallbackLng||[],t),e=[],n=t=>{t&&(this.isSupportedCode(t)?e.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return"string"==typeof t&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&n(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&n(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&n(this.getLanguagePartFromCode(t))):"string"==typeof t&&n(this.formatLanguageCode(t)),i.forEach((t=>{e.indexOf(t)<0&&n(this.formatLanguageCode(t))})),e}}let N=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],j={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}};const k=["v1","v2","v3"],x=["v4"],O={zero:0,one:1,two:2,few:3,many:4,other:5};class R{constructor(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=t,this.options=s,this.logger=i.create("pluralResolver"),this.options.compatibilityJSON&&!x.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){const t={};return N.forEach((s=>{s.lngs.forEach((i=>{t[i]={numbers:s.nr,plurals:j[s.fc]}}))})),t}()}addRule(t,s){this.rules[t]=s}getRule(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(p(t),{type:s.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){const s=this.getRule(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return this.shouldUseIntlApi()?s&&s.resolvedOptions().pluralCategories.length>1:s&&s.numbers.length>1}getPluralFormsOfKey(t,s){return this.getSuffixes(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).map((t=>`${s}${t}`))}getSuffixes(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=this.getRule(t,s);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(((t,s)=>O[t]-O[s])).map((t=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):i.numbers.map((i=>this.getSuffix(t,i,s))):[]}getSuffix(t,s){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const e=this.getRule(t,i);return e?this.shouldUseIntlApi()?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${e.select(s)}`:this.getSuffixRetroCompatible(e,s):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,s){const i=t.plurals(t.noAbs?s:Math.abs(s));let e=t.numbers[i];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===e?e="plural":1===e&&(e=""));const n=()=>this.options.prepend&&e.toString()?this.options.prepend+e.toString():e.toString();return"v1"===this.options.compatibilityJSON?1===e?"":"number"==typeof e?`_plural_${e.toString()}`:n():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?n():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}shouldUseIntlApi(){return!k.includes(this.options.compatibilityJSON)}}function S(t,s,i){let e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=function(t,s,i){const e=a(t,i);return void 0!==e?e:a(s,i)}(t,s,i);return!r&&n&&"string"==typeof i&&(r=g(t,i,e),void 0===r&&(r=g(s,i,e))),r}class L{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(t=>t),this.init(t)}init(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const s=t.interpolation;this.escape=void 0!==s.escape?s.escape:f,this.escapeValue=void 0===s.escapeValue||s.escapeValue,this.useRawValueToEscape=void 0!==s.useRawValueToEscape&&s.useRawValueToEscape,this.prefix=s.prefix?c(s.prefix):s.prefixEscaped||"{{",this.suffix=s.suffix?c(s.suffix):s.suffixEscaped||"}}",this.formatSeparator=s.formatSeparator?s.formatSeparator:s.formatSeparator||",",this.unescapePrefix=s.unescapeSuffix?"":s.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":s.unescapeSuffix||"",this.nestingPrefix=s.nestingPrefix?c(s.nestingPrefix):s.nestingPrefixEscaped||c("$t("),this.nestingSuffix=s.nestingSuffix?c(s.nestingSuffix):s.nestingSuffixEscaped||c(")"),this.nestingOptionsSeparator=s.nestingOptionsSeparator?s.nestingOptionsSeparator:s.nestingOptionsSeparator||",",this.maxReplaces=s.maxReplaces?s.maxReplaces:1e3,this.alwaysFormat=void 0!==s.alwaysFormat&&s.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){this.regexp=new RegExp(`${this.prefix}(.+?)${this.suffix}`,"g"),this.regexpUnescape=new RegExp(`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`,"g"),this.nestingRegexp=new RegExp(`${this.nestingPrefix}(.+?)${this.nestingSuffix}`,"g")}interpolate(t,s,i,e){let n,o,h;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(t){return t.replace(/\$/g,"$$$$")}const c=t=>{if(t.indexOf(this.formatSeparator)<0){const n=S(s,a,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(n,void 0,i,{...e,...s,interpolationkey:t}):n}const n=t.split(this.formatSeparator),r=n.shift().trim(),o=n.join(this.formatSeparator).trim();return this.format(S(s,a,r,this.options.keySeparator,this.options.ignoreJSONStructure),o,i,{...e,...s,interpolationkey:r})};this.resetRegExp();const l=e&&e.missingInterpolationHandler||this.options.missingInterpolationHandler,f=e&&e.interpolation&&void 0!==e.interpolation.skipOnVariables?e.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>u(t)},{regex:this.regexp,safeValue:t=>u(this.escapeValue?this.escape(t):t)}].forEach((s=>{for(h=0;n=s.regex.exec(t);){const i=n[1].trim();if(o=c(i),void 0===o)if("function"==typeof l){const s=l(t,n,e);o="string"==typeof s?s:""}else if(e&&Object.prototype.hasOwnProperty.call(e,i))o="";else{if(f){o=n[0];continue}this.logger.warn(`missed to pass in variable ${i} for interpolating ${t}`),o=""}else"string"==typeof o||this.useRawValueToEscape||(o=r(o));const a=s.safeValue(o);if(t=t.replace(n[0],a),f?(s.regex.lastIndex+=o.length,s.regex.lastIndex-=n[0].length):s.regex.lastIndex=0,h++,h>=this.maxReplaces)break}})),t}nest(t,s){let i,e,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function h(t,s){const i=this.nestingOptionsSeparator;if(t.indexOf(i)<0)return t;const e=t.split(new RegExp(`${i}[ ]*{`));let r=`{${e[1]}`;t=e[0],r=this.interpolate(r,n);const o=r.match(/'/g),h=r.match(/"/g);(o&&o.length%2==0&&!h||h.length%2!=0)&&(r=r.replace(/'/g,'"'));try{n=JSON.parse(r),s&&(n={...s,...n})}catch(s){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,s),`${t}${i}${r}`}return delete n.defaultValue,t}for(;i=this.nestingRegexp.exec(t);){let a=[];n={...o},n=n.replace&&"string"!=typeof n.replace?n.replace:n,n.applyPostProcessor=!1,delete n.defaultValue;let u=!1;if(-1!==i[0].indexOf(this.formatSeparator)&&!/{.*}/.test(i[1])){const t=i[1].split(this.formatSeparator).map((t=>t.trim()));i[1]=t.shift(),a=t,u=!0}if(e=s(h.call(this,i[1].trim(),n),n),e&&i[0]===t&&"string"!=typeof e)return e;"string"!=typeof e&&(e=r(e)),e||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),e=""),u&&(e=a.reduce(((t,s)=>this.format(t,s,o.lng,{...o,interpolationkey:i[1].trim()})),e.trim())),t=t.replace(i[0],e),this.regexp.lastIndex=0}return t}}function P(t){const s={};return function(i,e,n){const r=e+JSON.stringify(n);let o=s[r];return o||(o=t(p(e),n),s[r]=o),o(i)}}class A{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i.create("formatter"),this.options=t,this.formats={number:P(((t,s)=>{const i=new Intl.NumberFormat(t,{...s});return t=>i.format(t)})),currency:P(((t,s)=>{const i=new Intl.NumberFormat(t,{...s,style:"currency"});return t=>i.format(t)})),datetime:P(((t,s)=>{const i=new Intl.DateTimeFormat(t,{...s});return t=>i.format(t)})),relativetime:P(((t,s)=>{const i=new Intl.RelativeTimeFormat(t,{...s});return t=>i.format(t,s.range||"day")})),list:P(((t,s)=>{const i=new Intl.ListFormat(t,{...s});return t=>i.format(t)}))},this.init(t)}init(t){const s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=s.formatSeparator?s.formatSeparator:s.formatSeparator||","}add(t,s){this.formats[t.toLowerCase().trim()]=s}addCached(t,s){this.formats[t.toLowerCase().trim()]=P(s)}format(t,s,i){let e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return s.split(this.formatSeparator).reduce(((t,s)=>{const{formatName:n,formatOptions:r}=function(t){let s=t.toLowerCase().trim();const i={};if(t.indexOf("(")>-1){const e=t.split("(");s=e[0].toLowerCase().trim();const n=e[1].substring(0,e[1].length-1);"currency"===s&&n.indexOf(":")<0?i.currency||(i.currency=n.trim()):"relativetime"===s&&n.indexOf(":")<0?i.range||(i.range=n.trim()):n.split(";").forEach((t=>{if(!t)return;const[s,...e]=t.split(":"),n=e.join(":").trim().replace(/^'+|'+$/g,"");i[s.trim()]||(i[s.trim()]=n),"false"===n&&(i[s.trim()]=!1),"true"===n&&(i[s.trim()]=!0),isNaN(n)||(i[s.trim()]=parseInt(n,10))}))}return{formatName:s,formatOptions:i}}(s);if(this.formats[n]){let s=t;try{const o=e&&e.formatParams&&e.formatParams[e.interpolationkey]||{};s=this.formats[n](t,o.locale||o.lng||e.locale||e.lng||i,{...r,...e,...o})}catch(t){this.logger.warn(t)}return s}return this.logger.warn(`there was no format function for ${n}`),t}),t)}}class I extends e{constructor(t,s,e){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=t,this.store=s,this.services=e,this.languageUtils=e.languageUtils,this.options=n,this.logger=i.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(e,n.backend,n)}queueLoad(t,s,i,e){const n={},r={},o={},h={};return t.forEach((t=>{let e=!0;s.forEach((s=>{const o=`${t}|${s}`;!i.reload&&this.store.hasResourceBundle(t,s)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===r[o]&&(r[o]=!0):(this.state[o]=1,e=!1,void 0===r[o]&&(r[o]=!0),void 0===n[o]&&(n[o]=!0),void 0===h[s]&&(h[s]=!0)))})),e||(o[t]=!0)})),(Object.keys(n).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:e}),{toLoad:Object.keys(n),pending:Object.keys(r),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(h)}}loaded(t,s,i){const e=t.split("|"),n=e[0],r=e[1];s&&this.emit("failedLoading",n,r,s),i&&this.store.addResourceBundle(n,r,i),this.state[t]=s?-1:2;const h={};this.queue.forEach((i=>{!function(t,s,i){const{obj:e,k:n}=o(t,s,Object);e[n]=e[n]||[],e[n].push(i)}(i.loaded,[n],r),function(t,s){void 0!==t.pending[s]&&(delete t.pending[s],t.pendingCount--)}(i,t),s&&i.errors.push(s),0!==i.pendingCount||i.done||(Object.keys(i.loaded).forEach((t=>{h[t]||(h[t]={});const s=i.loaded[t];s.length&&s.forEach((s=>{void 0===h[t][s]&&(h[t][s]=!0)}))})),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())})),this.emit("loaded",h),this.queue=this.queue.filter((t=>!t.done))}read(t,s,i){let e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,r=arguments.length>5?arguments[5]:void 0;if(!t.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:s,fcName:i,tried:e,wait:n,callback:r});this.readingCalls++;const o=(o,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}o&&h&&e<this.maxRetries?setTimeout((()=>{this.read.call(this,t,s,i,e+1,2*n,r)}),n):r(o,h)},h=this.backend[i].bind(this.backend);if(2!==h.length)return h(t,s,o);try{const i=h(t,s);i&&"function"==typeof i.then?i.then((t=>o(null,t))).catch(o):o(null,i)}catch(t){o(t)}}prepareLoading(t,s){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),e&&e();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof s&&(s=[s]);const n=this.queueLoad(t,s,i,e);if(!n.toLoad.length)return n.pending.length||e(),null;n.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,s,i){this.prepareLoading(t,s,{},i)}reload(t,s,i){this.prepareLoading(t,s,{reload:!0},i)}loadOne(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const i=t.split("|"),e=i[0],n=i[1];this.read(e,n,"read",void 0,void 0,((i,r)=>{i&&this.logger.warn(`${s}loading namespace ${n} for language ${e} failed`,i),!i&&r&&this.logger.log(`${s}loaded namespace ${n} for language ${e}`,r),this.loaded(t,i,r)}))}saveMissing(t,s,i,e,n){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(s))this.logger.warn(`did not save key "${i}" as the namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=i&&""!==i){if(this.backend&&this.backend.create){const h={...r,isUpdate:n},a=this.backend.create.bind(this.backend);if(a.length<6)try{let n;n=5===a.length?a(t,s,i,e,h):a(t,s,i,e),n&&"function"==typeof n.then?n.then((t=>o(null,t))).catch(o):o(null,n)}catch(t){o(t)}else a(t,s,i,e,o,h)}t&&t[0]&&this.store.addResource(t[0],s,i,e)}}}function C(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let s={};if("object"==typeof t[1]&&(s=t[1]),"string"==typeof t[1]&&(s.defaultValue=t[1]),"string"==typeof t[2]&&(s.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const i=t[3]||t[2];Object.keys(i).forEach((t=>{s[t]=i[t]}))}return s},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function E(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function K(){}class T extends e{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;var e;if(super(),this.options=E(t),this.services={},this.logger=i,this.modules={external:[]},e=this,Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})),s&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,s),this;setTimeout((()=>{this.init(t,s)}),0)}}init(){var t=this;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;"function"==typeof s&&(e=s,s={}),!s.defaultNS&&!1!==s.defaultNS&&s.ns&&("string"==typeof s.ns?s.defaultNS=s.ns:s.ns.indexOf("translation")<0&&(s.defaultNS=s.ns[0]));const r=C();function o(t){return t?"function"==typeof t?new t:t:null}if(this.options={...r,...this.options,...E(s)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==s.keySeparator&&(this.options.userDefinedKeySeparator=s.keySeparator),void 0!==s.nsSeparator&&(this.options.userDefinedNsSeparator=s.nsSeparator),!this.options.isClone){let s;i.init(this.modules.logger?o(this.modules.logger):null,this.options),this.modules.formatter?s=this.modules.formatter:"undefined"!=typeof Intl&&(s=A);const e=new w(this.options);this.store=new v(this.options.resources,this.options);const n=this.services;n.logger=i,n.resourceStore=this.store,n.languageUtils=e,n.pluralResolver=new R(e,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!s||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(n.formatter=o(s),n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new L(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new I(o(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",(function(s){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];t.emit(s,...e)})),this.modules.languageDetector&&(n.languageDetector=o(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=o(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new b(this.services,this.options),this.translator.on("*",(function(s){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];t.emit(s,...e)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,e||(e=K),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((s=>{this[s]=function(){return t.store[s](...arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((s=>{this[s]=function(){return t.store[s](...arguments),t}}));const h=n(),a=()=>{const t=(t,s)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),h.resolve(s),e(t,s)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initImmediate?a():setTimeout(a,0),h}loadResources(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K;const i="string"==typeof t?t:this.language;if("function"==typeof t&&(s=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return s();const t=[],e=s=>{s&&this.services.languageUtils.toResolveHierarchy(s).forEach((s=>{t.indexOf(s)<0&&t.push(s)}))};i?e(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>e(t))),this.options.preload&&this.options.preload.forEach((t=>e(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),s(t)}))}else s(null)}reloadResources(t,s,i){const e=n();return t||(t=this.languages),s||(s=this.options.ns),i||(i=K),this.services.backendConnector.reload(t,s,(t=>{e.resolve(),i(t)})),e}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&y.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}changeLanguage(t,s){var i=this;this.isLanguageChangingTo=t;const e=n();this.emit("languageChanging",t);const r=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},o=(t,n)=>{n?(r(n),this.translator.changeLanguage(n),this.isLanguageChangingTo=void 0,this.emit("languageChanged",n),this.logger.log("languageChanged",n)):this.isLanguageChangingTo=void 0,e.resolve((function(){return i.t(...arguments)})),s&&s(t,(function(){return i.t(...arguments)}))},h=s=>{t||s||!this.services.languageDetector||(s=[]);const i="string"==typeof s?s:this.services.languageUtils.getBestMatchFromCodes(s);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(i)),this.loadResources(i,(t=>{o(t,i)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(h):this.services.languageDetector.detect(h):h(t):h(this.services.languageDetector.detect()),e}getFixedT(t,s,i){var e=this;const n=function(t,s){let r;if("object"!=typeof s){for(var o=arguments.length,h=new Array(o>2?o-2:0),a=2;a<o;a++)h[a-2]=arguments[a];r=e.options.overloadTranslationOptionHandler([t,s].concat(h))}else r={...s};r.lng=r.lng||n.lng,r.lngs=r.lngs||n.lngs,r.ns=r.ns||n.ns,r.keyPrefix=r.keyPrefix||i||n.keyPrefix;const u=e.options.keySeparator||".";let c;return c=r.keyPrefix&&Array.isArray(t)?t.map((t=>`${r.keyPrefix}${u}${t}`)):r.keyPrefix?`${r.keyPrefix}${u}${t}`:t,e.t(c,r)};return"string"==typeof t?n.lng=t:n.lngs=t,n.ns=s,n.keyPrefix=i,n}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=s.lng||this.resolvedLanguage||this.languages[0],e=!!this.options&&this.options.fallbackLng,n=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;const r=(t,s)=>{const i=this.services.backendConnector.state[`${t}|${s}`];return-1===i||2===i};if(s.precheck){const t=s.precheck(this,r);if(void 0!==t)return t}return!(!this.hasResourceBundle(i,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!r(i,t)||e&&!r(n,t)))}loadNamespaces(t,s){const i=n();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{i.resolve(),s&&s(t)})),i):(s&&s(),Promise.resolve())}loadLanguages(t,s){const i=n();"string"==typeof t&&(t=[t]);const e=this.options.preload||[],r=t.filter((t=>e.indexOf(t)<0));return r.length?(this.options.preload=e.concat(r),this.loadResources((t=>{i.resolve(),s&&s(t)})),i):(s&&s(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const s=this.services&&this.services.languageUtils||new w(C());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(s.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new T(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K;const i=t.forkResourceStore;i&&delete t.forkResourceStore;const e={...this.options,...t,isClone:!0},n=new T(e);return void 0===t.debug&&void 0===t.prefix||(n.logger=n.logger.clone(t)),["store","services","language"].forEach((t=>{n[t]=this[t]})),n.services={...this.services},n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},i&&(n.store=new v(this.store.data,e),n.services.resourceStore=n.store),n.translator=new b(n.services,e),n.translator.on("*",(function(t){for(var s=arguments.length,i=new Array(s>1?s-1:0),e=1;e<s;e++)i[e-1]=arguments[e];n.emit(t,...i)})),n.init(e,s),n.translator.options=e,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const z=T.createInstance();z.createInstance=T.createInstance;export{z as i}
@@ -0,0 +1 @@
1
+ import{r as t,h as i,H as e,c as s,g as n}from"./p-fa17e81f.js";import{O as o,o as r,i as a,a as l,t as h,q as c,r as d,u as p,v as g,w as v,x as u,y as m,z as b,B as x,E as f,C as y,D as w,F as k,G as z,N as C}from"./p-90e24b10.js";import{p as _,q as j,u as L}from"./p-3b99c62d.js";import{i as F}from"./p-2e76a5c3.js";import{s as W}from"./p-53eacbe3.js";import{c as D}from"./p-badde98c.js";import{O as E,c as M,d as S,A as T}from"./p-60ea7665.js";const B=class{constructor(i){t(this,i)}getInsetValue(){return _(r(a.searchArea,a.imageBounds),o.map((([t,i])=>{return`inset(${(e=t,s=i,n={top:`${e.y}px`,right:s.width-(e.x+e.width)+"px",bottom:s.height-(e.y+e.height)+"px",left:`${e.x}px`}).top} ${n.right} ${n.bottom} ${n.left})`;var e,s,n})),o.getOrElse((()=>"")))}renderImage(){return _(r(a.imageUrl,a.imageBounds),o.map((([t,e])=>i("img",{src:t,width:e.width,height:e.height,style:{"clip-path":`${this.getInsetValue()}`}}))),o.getOrElse((()=>"")))}render(){return i(e,null,this.renderImage())}};B.style=':host{display:grid;position:absolute;box-sizing:border-box;border:none;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;--size:10px;--x-position:0;--y-position:0}img{-webkit-user-select:none;-moz-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);animation:0.25s linear fadein;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}@keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}';const I=class{constructor(i){t(this,i),this.vviinnImageCrop=s(this,"vviinnImageCrop",7),this.mouseStartPoint=void 0,this.bounds=void 0,this.resizeObserver=new ResizeObserver((()=>{this.bounds=this.el.getBoundingClientRect()})),this.disabled=!1,this.basicEventData=void 0,this.handleMove=!1}componentDidLoad(){this.resizeObserver.observe(this.el)}disconnectedCallback(){this.resizeObserver.disconnect()}handleHandlerMove(t){t.preventDefault(),t.stopPropagation();const i=L(t),e={position:j.concat(i,this.mouseStartPoint),direction:this.handlerMoveDirection};l.pipe(a.searchArea,o.map((t=>{const s=h(t,e);this.outOfBounds(s)||(a.searchArea=o.some(s),this.mouseStartPoint=i,a.detectedObject=void 0)})))}outOfBounds(t){return t.width<40||t.height<40||t.x<0||t.y<0||this.bounds.height-(t.y+t.height)<0||this.bounds.width-(t.x+t.width)<0}handleCropperMove(t){t.preventDefault(),t.stopPropagation();const i=L(t),e=j.concat(i,this.mouseStartPoint);l.pipe(a.searchArea,o.map((t=>{const s=c(t,e);s.x<0||s.y<0||this.bounds.height-(s.y+s.height)<0||this.bounds.width-(s.x+s.width)<0||(a.detectedObject=void 0,a.searchArea=o.some(s),this.mouseStartPoint=i)})))}handlePointerDown(t){t.stopPropagation(),this.mouseStartPoint=L(t);const i=t.target;"cropper-handler"===i.localName?(this.handlerMoveDirection=i.handler.direction,this.pointerMoveListener=this.handleHandlerMove.bind(this)):this.pointerMoveListener=this.handleCropperMove.bind(this),this.pointerReleaseListener=this.handleSearchAreaRelease.bind(this),this.el.addEventListener("pointermove",this.pointerMoveListener),window.addEventListener("pointerup",this.pointerReleaseListener,{once:!0})}handleSearchAreaRelease(){this.el.removeEventListener("pointermove",this.pointerMoveListener),document.removeEventListener("pointerup",this.pointerReleaseListener),this.mouseStartPoint=void 0,d(),this.vviinnImageCrop.emit(this.basicEventData)}getStyleMap(){return l.pipe(a.searchArea,o.map((t=>({width:`${t.width}px`,height:`${t.height}px`,transform:`translate3d(${t.x}px, ${t.y}px, 0)`,cursor:this.handleMove?"move":"default"}))),o.getOrElse((()=>({}))))}render(){return i(e,{exportparts:"handle, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize"},i("div",{class:{"crop-area":!0,active:this.handleMove,disabled:this.disabled},draggable:!1,style:this.getStyleMap(),onContextMenu:()=>!1,onPointerDown:t=>this.handlePointerDown(t)},a.cropperHandlers.map((t=>i("cropper-handler",{disabled:this.disabled,handler:t,onPointerDown:t=>this.handlePointerDown(t)})))))}get el(){return n(this)}};I.style=":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}";const G=(t,i)=>{if(!t)return"";const e={};return t.href.split("?")[1].split("included[]=").join("").split("&").forEach((t=>{const[i,s]=t.split("%3A");e[i]=s})),"categories"===i?e.product_type:e[i]},O=class{constructor(i){t(this,i),this.vviinnSelectFilter=s(this,"vviinnSelectFilter",7),this.filterType=this.filter.name,this.filter=null,this.basicEventData=void 0,this.selectedFilter="",this.hideFilters=!0}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter(t):this.selectFilter(t)}selectFilter(t){a.activeIonLink=t,this.selectedFilter=G(t,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"select",filterName:t.name}))}clearSelectedFilter(t){a.activeIonLink=t.clear,this.selectedFilter=G(t.clear,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"deselect"}))}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,i){"Enter"===t.key&&this.handleFilterSelection(i)}isFilterSelected(t){return"categories"===this.filterType?this.selectedFilter===G(t,"categories"):this.selectedFilter===t.name}render(){if(!this.filter)return null;const{name:t,filters:s}=this.filter;return i(e,{exportparts:"filter, show-more-filters"},i("div",{class:{filters:!0,"no-scrollbar-mobile":"categories"===this.filterType,"no-scrollbar":"categories"!==this.filterType}},s.filter(((t,i)=>!this.hideFilters||i<5)).map(((e,s)=>{const n="categories"===t?this.selectedFilter===G(e,"categories"):this.selectedFilter===e.name;return i("div",{role:"button",tabindex:"0",key:s,part:n?"filter active":"filter",class:{filter:!0,active:n},style:{"animation-delay":10*s+"ms"},onPointerUp:t=>{a.loading||(t.stopPropagation(),this.handleFilterSelection(e))},onKeyPress:t=>{a.loading||this.handleEnter(t,e)}},e.name)})),this.hideFilters&&i("div",{class:{"show-more":!0,hidden:s.length<=5,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>{setTimeout((()=>this.toggleFilters()),300)},onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"})))}get el(){return n(this)}};O.style=".filters{display:flex;flex-direction:row;overflow-x:auto;padding-left:24px;padding-right:12px;margin-bottom:12px}.filter{align-items:center;color:#525252;cursor:pointer;display:flex;margin-right:12px;height:-moz-max-content;height:max-content;min-width:-moz-max-content;min-width:max-content;transition-property:background;transition-duration:0.5s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:10px 12px}.show-more{display:flex}.show-more.hidden{display:none !important}.show-more::after{position:relative;content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;transform:rotate(-90deg);left:2px}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}@media (max-width: 640px){.no-scrollbar-mobile{-ms-overflow-style:none;scrollbar-width:none}.no-scrollbar-mobile::-webkit-scrollbar{display:none}}";const $=class{constructor(i){t(this,i),this.vviinnSelectObject=s(this,"vviinnSelectObject",7),this.detectedObject=void 0,this.basicEventData=void 0,this.position=["0","0"]}getObjectPosition(){return l.pipe(a.imageBounds,o.map((t=>{const i=p(g(this.detectedObject).rectangle),{x:e,y:s}=l.pipe(i,v(t),u);return[`${e}px`,`${s}px`]})),o.getOrElse((()=>["0","0"])))}selectDetectedObject(){l.pipe(a.imageBounds,o.map((t=>{const i=g(this.detectedObject).rectangle,e=p(i),s=v(t)(e);a.detectedObject=this.detectedObject,a.searchArea=o.some(s)}))),d(),this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject}))}isActive(){if(!this.detectedObject)return!1;if(!a.detectedObject)return!1;const t=g(this.detectedObject),i=g(a.detectedObject);return m.equals(t,i)}render(){return i(e,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};$.style=':host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--size:32px;--x-position:0;--y-position:0;background:rgba(22, 22, 22, 0.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}';const A=class{constructor(i){t(this,i)}render(){return i(e,null,i("vviinn-error",null,i("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("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"}),i("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"})),i("h4",{slot:"title"},F.t("emptyResultsBlock.title")),i("span",{slot:"text"},F.t("emptyResultsBlock.text"))))}};A.style=":host{display:grid}vviinn-error{justify-items:center}";const P=class{constructor(i){t(this,i),this.vviinnImageUpload=s(this,"vviinnImageUpload",7),this.vviinnNoResult=s(this,"vviinnNoResult",7),this.src="",this.width=0,this.height=0,this.basicEventData=void 0,this.selected=!1}async selectImage(){this.selected=!0;const t=await b(this.src),i=await x(t);l.pipe(i,f.match((()=>this.vviinnNoResult.emit(this.basicEventData)),(()=>this.vviinnImageUpload.emit(this.basicEventData)))),this.selected=!1}handleKeyPress({key:t}){"Enter"!==t&&" "!==t||this.selectImage()}showPreloader(){return(a.objectDetectionInProgress||a.loading)&&this.selected}render(){return i(e,{onClick:()=>this.selectImage(),onKeyUp:t=>this.handleKeyPress(t)},this.showPreloader()?i("div",{class:"image-preloader"},i("vviinn-preloader",null)):null,i("img",{src:this.src,width:this.width,height:this.height,tabindex:1}))}};P.style=":host{display:block;margin-bottom:8px;position:relative}:host(:focus){border:2px solid var(--color-primary)}img{width:100%;height:auto;cursor:pointer}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:12px;display:none;padding:4px 6px;position:absolute;right:12px;z-index:4}vviinn-preloader{--preloader-size:12px}@media (max-width: 640px){.image-preloader{display:block}}";const R=class{constructor(i){t(this,i),this.vviinnImageUpload=s(this,"vviinnImageUpload",7),this.vviinnNoResult=s(this,"vviinnNoResult",7),this.basicEventData=void 0,this.exampleImagesTitle=void 0}componentWillLoad(){W(this,this.el)}delegateFocus(){this.imagesBlock.childNodes[0].childNodes[0].focus()}render(){return i(e,{onFocus:()=>this.delegateFocus()},i("slot",{name:"vviinn-example-images-title"},i("h3",null,this.exampleImagesTitle)),i("div",{class:"images",ref:t=>this.imagesBlock=t},i("slot",{name:"vviinn-example-images-1"},i("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc=",basicEventData:this.basicEventData})),i("slot",{name:"vviinn-example-images-2"},i("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc=",basicEventData:this.basicEventData})),i("slot",{name:"vviinn-example-images-3"},i("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc=",basicEventData:this.basicEventData})),i("slot",{name:"vviinn-example-images-4"},i("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc=",basicEventData:this.basicEventData}))))}get el(){return n(this)}};R.style="h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}.images{display:block;-moz-column-count:2;column-count:2;-moz-column-gap:16px;column-gap:16px}";const V=class{constructor(i){t(this,i),this.vviinnImageUpload=s(this,"vviinnImageUpload",7),this.vviinnNoResult=s(this,"vviinnNoResult",7),this.basicEventData=void 0,this.startUpload=void 0,this.resetVpsButton=void 0}async handleInputChange(t){const i=t.target,e=await x(i.files[0]);l.pipe(e,y((()=>this.vviinnNoResult.emit(this.basicEventData)),(()=>this.vviinnImageUpload.emit(this.basicEventData)))),i.value=null}isLoading(){return a.loading}startUploadWatcher(t){t&&(this.fileInput.click(),this.resetVpsButton())}render(){return i(e,{exportparts:"button"},this.isLoading()?i("vviinn-preloader",null):null,this.isLoading()?null:i("label",{htmlFor:"fileInput",part:"button"},i("slot",{name:"upload-button-text"},"Upload image")),i("input",{id:"fileInput",class:"visually-hidden",type:"file",accept:"image/*",onChange:t=>this.handleInputChange(t),ref:t=>this.fileInput=t}))}static get watchers(){return{startUpload:["startUploadWatcher"]}}};V.style=":host{display:block}:host(::hover){background:whitesmoke}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;width:100%;height:100%;transition:background 0.1s ease-in-out}";const K=class{constructor(i){t(this,i),this.basicEventData=void 0}handleInitialImageLoad(t){const i=w(t.target),{x:e,y:s}=c(i,{x:12,y:12}),n={x:e,y:s,width:i.width-24,height:i.height-24};a.imageBounds=o.some(i),a.searchArea=o.some(n)}renderDetectedObject(t){return i("vviinn-detected-object",{detectedObject:t,basicEventData:this.basicEventData})}renderImage(){return l.pipe(r(a.imageUrl,a.image),o.map((([t,e])=>{const[s,n]=(t=>{const i=k(t),e=z(288)(i).map((t=>t.size));return[e[0],e[1]]})(e);return i("img",{decoding:"async",width:s,height:n,src:t,onLoad:t=>this.handleInitialImageLoad(t),draggable:!1})})),o.getOrElse((()=>null)))}renderCropper(){return l.pipe(a.imageUrl,o.map((()=>i("image-cropper",{basicEventData:this.basicEventData}))),o.getOrElse((()=>null)))}render(){return i(e,null,a.loading||a.objectDetectionInProgress?i("div",{class:"image-preloader"},i("vviinn-preloader",null)):null,i("highlight-box",null),this.renderImage(),this.renderCropper(),a.detectedObjects.map((t=>this.renderDetectedObject(t))))}};K.style=":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;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}";const H=class{constructor(i){t(this,i),this.vviinnWidgetClose=s(this,"vviinnWidgetClose",7),this.active=!1,this.resetState=void 0,this.buttonElementId=void 0,this.widgetVersion=void 0,this.hideBackButton=!1,this.slider=!1}componentWillLoad(){W(this,this.el)}close(){this.active=!1,setTimeout((()=>{this.vviinnWidgetClose.emit({widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:D.VPS,widgetId:this.buttonElementId,widgetVersion:this.widgetVersion})}),this.slider?500:0)}handleAnimationEnd(t){"fade-in"===t.animationName&&(this.slider=!0)}renderImage(){return l.pipe(r(a.imageUrl,a.image),o.map((([t])=>i("img",{width:"32",height:"32",src:t,class:"title-image"}))),o.getOrElse((()=>null)))}render(){return i(e,{exportparts:"secondary-action, title, close-button",class:{closed:!this.active},onAnimationEnd:t=>this.handleAnimationEnd(t)},i("div",{class:"head"},!this.hideBackButton&&i("button",{part:"secondary-action",onClick:()=>this.resetState()},i("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M20.25 12H3.75",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),i("path",{d:"M10.5 5.25L3.75 12L10.5 18.75",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))),i("div",{class:"title",part:"title"},this.renderImage(),i("slot",{name:"vviinn-image-search-modal-title"},F.t("imageSearchModalTitle"))),i("button",{onClick:()=>this.close(),class:"close-button",part:"close-button"},i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("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:"currentColor"})))),i("div",{class:"body"},i("slot",null)))}get el(){return n(this)}};H.style=":host{background:white;border-radius:4px;box-sizing:border-box;display:grid;grid-template-rows:min-content auto;max-width:960px;overflow:auto}@media (max-width: 640px){:host{animation-name:fade-in;animation-duration:0.5s;animation-fill-mode:forwards}:host(.closed){animation-name:fade-out;animation-fill-mode:none}.body{overflow-y:auto}}.head{display:flex;align-items:center;border-bottom:1px solid #f4f4f4;padding:16px}.title{display:flex;align-items:center;transform:translateX(-6px);font-weight:600;font-size:18px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:4px;color:#c6c6c6}button:hover{color:#000}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";const N=class{constructor(i){t(this,i)}componentWillLoad(){W(this,this.el)}render(){return i(e,null,i("slot",{name:"vviinn-onboarding-title"},i("h3",null,F.t("onboardingBlock.onboardingTitleText"))),i("vviinn-slider",{showArrows:!0},i("vviinn-slide",null,i("vviinn-onboarding-card-1",{cardTitle:F.t("onboardingBlock.onboardingCard1.title"),cardText:F.t("onboardingBlock.onboardingCard1.text")})),i("vviinn-slide",null,i("vviinn-onboarding-card-2",{cardTitle:F.t("onboardingBlock.onboardingCard2.title"),cardText:F.t("onboardingBlock.onboardingCard2.text")})),i("vviinn-slide",null,i("vviinn-onboarding-card-3",{cardTitle:F.t("onboardingBlock.onboardingCard3.title"),cardText:F.t("onboardingBlock.onboardingCard3.text")}))))}get el(){return n(this)}};N.style=":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))}";const U=class{constructor(i){t(this,i),this.cardTitle=void 0,this.cardText=void 0}componentWillLoad(){W(this,this.el)}render(){return i(e,null,i("slot",{name:"onboarding-card-1-icon"},i(E,null)),i("slot",{name:"onboarding-card-1-text"},i("div",{class:"text"},i("h4",null,this.cardTitle),i("p",null,this.cardText))))}get el(){return n(this)}};U.style=":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}";const Y=class{constructor(i){t(this,i),this.cardTitle=void 0,this.cardText=void 0}componentWillLoad(){W(this,this.el)}render(){return i(e,null,i("slot",{name:"onboarding-card-2-icon"},i(M,null)),i("slot",{name:"onboarding-card-2-text"},i("div",{class:"text"},i("h4",null,this.cardTitle),i("p",null,this.cardText))))}get el(){return n(this)}};Y.style=":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}";const Z=class{constructor(i){t(this,i),this.cardTitle=void 0,this.cardText=void 0}componentWillLoad(){W(this,this.el)}render(){return i(e,null,i("slot",{name:"onboarding-card-3-icon"},i(S,null)),i("slot",{name:"onboarding-card-3-text"},i("div",{class:"text"},i("h4",null,this.cardTitle),i("p",null,this.cardText))))}get el(){return n(this)}};Z.style=":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}";const q=class{constructor(i){t(this,i)}render(){return i(e,null,i("slot",null))}};q.style=":host{animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";const X=class{constructor(i){t(this,i),this.vviinnWidgetClose=s(this,"vviinnWidgetClose",7),this.active=!1,this.resetState=void 0,this.buttonElementId=void 0,this.hideBackButton=!1,this.widgetVersion=void 0}render(){return i(e,{class:{active:this.active}},i("vviinn-overlay",null,i("vviinn-modal",{resetState:this.resetState,active:this.active,buttonElementId:this.buttonElementId,hideBackButton:this.hideBackButton,widgetVersion:this.widgetVersion},i("slot",null,"CONTENT"))))}};X.style=":host{display:none}:host(.active){display:block}vviinn-overlay{align-items:center;display:grid;justify-items:center;cursor:default}@media (max-width: 640px){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}}";const Q=class{constructor(i){t(this,i),this.privacyBadgeText=void 0}componentWillLoad(){W(this,this.el)}render(){return i(e,null,i("slot",null,i("div",{class:"content"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none"},i("defs",null),i("path",{fill:"#525252",d:"M8.5 11V7h-2v1h1v3H6v1h4v-1H8.5zM8 4a.75.75 0 100 1.5A.75.75 0 008 4z"}),i("path",{fill:"#525252",d:"M8 15A7 7 0 118 1a7 7 0 010 14zM8 2a6 6 0 100 12A6 6 0 008 2z"})),i("slot",{name:"vviinn-privacy-badge-text"},i("p",null,this.privacyBadgeText)))))}get el(){return n(this)}};Q.style=":host{display:block;background:#F4F4F4;padding:17px}.content{display:grid;grid-template-columns:min-content auto;grid-gap:9px}.content p{color:#525252;font-size:12px;line-height:16px;margin:unset}";const J=class{constructor(i){t(this,i),this.handler=void 0}render(){return i(e,null,i("vviinn-error",null,i("h4",{slot:"title"},"Keine Verbindung"),i("span",{slot:"text"},"Etwas hat leider nicht funktioniert. Bitte prüfen Sie Ihre Internetverbindung und laden Sie das Bild noch einmal hoch."),i("button",{slot:"action",onClick:this.handler},"Erneut versuchen")))}};J.style=":host{display:block}";const tt=class{constructor(i){t(this,i)}render(){return i(e,null,i("slot",null))}};tt.style=":host{display:grid;justify-items:center}";const it=({kind:t,tabindex:e,disabled:s,onClick:n,onKeyDown:o})=>{return i("div",{class:(r={kind:t,disabled:s},{"arrow-wrapper":!0,[r.kind]:!0,disabled:r.disabled}),onClick:n,tabindex:e,onKeyDown:o},i(T,null));var r},et=class{constructor(i){t(this,i),this.elementsCount=0,this.internalPosition=0,this.swipeStartPosition=o.none,this.isRTL=!1,this.showBullets=!0,this.position=0,this.showArrows=!1}positionWatchHandler(t){this.internalPosition=t,this.el.style.setProperty("--position",`${this.calculatePosition(t)}`),this.setActiveCssClassToSlide(t)}componentWillLoad(){this.isRTL="rtl"===document.dir}connectedCallback(){this.handleDomContentChanges()}handleDomContentChanges(){const t=this.el.querySelectorAll("vviinn-slide");this.elementsCount=t.length,this.el.style.setProperty("--num-items",`${this.elementsCount}`),this.setActiveCssClassToSlide(0)}setActiveCssClassToSlide(t){const i=this.el.querySelectorAll("vviinn-slide");i.forEach((t=>t.classList.remove("active"))),i[t].classList.add("active")}goToSlide(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}renderBullets(){return this.showBullets?i("div",{class:"controls"},C.range(0,this.elementsCount-1).map((t=>i("div",{class:{bullet:!0,active:t==Math.abs(this.internalPosition)%this.elementsCount},onClick:()=>this.goToSlide(t)})))):null}nextSlide(){this.internalPosition++,this.renderSlidePosition()}prevSlide(){const t=this.internalPosition-1;this.internalPosition=t>-1?t:this.elementsCount-1,this.renderSlidePosition()}renderSlidePosition(){const t=this.internalPosition%this.elementsCount;requestAnimationFrame((()=>{this.el.style.setProperty("--position",`${this.calculatePosition(t)}`)}))}calculatePosition(t){return this.isRTL?-1*t:t}handleKeyDown(t){if("Space"===t.key||"Enter"===t.key)switch(t.target.className.includes("prev")?"prev":"next"){case"prev":this.prevSlide();break;case"next":this.nextSlide()}}handleTouchStart(t){this.showBullets&&(this.swipeStartPosition=l.pipe(t.touches[0],o.fromNullable,o.map((t=>t.clientX))))}handleTouchEnd(t){if(!this.showBullets)return;const i=l.pipe(t.changedTouches[0],o.fromNullable,o.map((t=>t.clientX)));l.pipe(r(this.swipeStartPosition,i),o.map((([t,i])=>{return(e=t)<(s=i)?-1:e>s?1:0;var e,s})),o.map((t=>{switch(t){case 1:return this.nextSlide();case-1:return this.prevSlide()}})))}render(){return i(e,null,i("div",{class:"items-wrapper"},i("div",{class:"items",onTouchStart:t=>this.handleTouchStart(t),onTouchEnd:t=>this.handleTouchEnd(t)},i("slot",null))),this.showArrows?[i(it,{kind:"prev",onClick:()=>this.isRTL?this.nextSlide():this.prevSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:1,disabled:!1}),i(it,{kind:"next",onClick:()=>this.isRTL?this.prevSlide():this.nextSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:0,disabled:!1})]:null,this.renderBullets())}get el(){return n(this)}static get watchers(){return{position:["positionWatchHandler"]}}};et.style=":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), 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}";const st=class{constructor(i){t(this,i)}componentWillLoad(){W(this,this.el)}render(){return i(e,null,i("slot",null,i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",fill:"none"},i("defs",null),i("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"}),i("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"})),i("span",{class:"vviinn-teaser-text"},i("slot",{name:"vviinn-teaser-text"},F.t("teaserText_1"),i("br",null),F.t("teaserText_2")))))}get el(){return n(this)}};st.style=":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}";const nt=class{constructor(i){t(this,i),this.handler=void 0}render(){return i(e,null,i("vviinn-error",null,i("h4",{slot:"title"},"Dateityp wird nicht unterstützt"),i("span",{slot:"text"},"Leider unterstützen wir dieses Format nicht. Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch."),i("button",{slot:"action",onClick:this.handler},"Neues Bild hochladen")))}};nt.style=":host{display:block}";export{B as highlight_box,I as image_cropper,O as search_filters,$ as vviinn_detected_object,A as vviinn_empty_results,P as vviinn_example_image,R as vviinn_example_images,V as vviinn_image_selector,K as vviinn_image_view,H as vviinn_modal,N as vviinn_onboarding,U as vviinn_onboarding_card_1,Y as vviinn_onboarding_card_2,Z as vviinn_onboarding_card_3,q as vviinn_overlay,X as vviinn_overlayed_modal,Q as vviinn_privacy_badge,J as vviinn_server_error,tt as vviinn_slide,et as vviinn_slider,st as vviinn_teaser,nt as vviinn_wrong_format}
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as s,H as h,g as n}from"./p-fa17e81f.js";import{v as o}from"./p-d99266bf.js";import{V as e}from"./p-60ea7665.js";const v=class{constructor(s){i(this,s),this.vviinnWidgetLoad=t(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=t(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=t(this,"vviinnWidgetClose",7),this.vviinnNoResult=t(this,"vviinnNoResult",7),this.vviinnProductLoad=t(this,"vviinnProductLoad",7),this.vviinnProductClick=t(this,"vviinnProductClick",7),this.vviinnProductView=t(this,"vviinnProductView",7),this.sidebar=null,this.sidebarCloseListener=()=>{document.body.removeChild(this.sidebar)},this.token=void 0,this.productId=void 0,this.position="bottom",this.sourceImage=null,this.sidebarTitle="Visually similar products",this.modalScrollbar=!1,this.campaigns="",this.campaignType="VPR",this.locale="de-DE",this.color="",this.addStyle=!0,this.mode="continuity",this.imageWidth=300,this.currencySign="€",this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.excluded="",this.productDetailNewTab=!1,this.apiPath="https://api.vviinn.com"}render(){return s(h,{onClick:()=>{this.handleClick()},role:"button",tabindex:"0"},s("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(e,null))))}handleClick(){const i=document.createElement("vviinn-recommendations-sidebar");i.sidebarTitle=this.sidebarTitle,i.productId=this.productId,i.token=this.token,i.position=this.position,i.sourceImage=this.sourceImage,i.widgetScrollbar=this.modalScrollbar,i.campaigns=this.campaigns,i.campaignType=this.campaignType,i.color=this.color,i.locale=this.locale,i.mode="right"===this.position?"grid":this.mode,i.imageWidth=this.imageWidth,i.currencySign=this.currencySign,i.apiPath=this.apiPath,i.buttonElementId=this.el.id,i.noResultText=this.noResultText,i.noResultShow=this.noResultShow,i.gridArrowsDynamic=this.gridArrowsDynamic,i.productDetailNewTab=this.productDetailNewTab,i.widgetVersion=o,i.showingInButton=!0,i.excluded=this.excluded,this.sidebar=i,i.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&(this.sidebar.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.removeChild(this.sidebar))}get el(){return n(this)}};v.style=":host{display:block}";export{v as vviinn_vpr_button}
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as s,H as e,g as n}from"./p-fa17e81f.js";import{v as h}from"./p-d99266bf.js";import{a as o}from"./p-60ea7665.js";import{S as a}from"./p-53eacbe3.js";import{c as r}from"./p-badde98c.js";const d=class{constructor(s){i(this,s),this.vviinnWidgetLoad=t(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=t(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=t(this,"vviinnWidgetClose",7),this.vviinnImageUpload=t(this,"vviinnImageUpload",7),this.vviinnNoResult=t(this,"vviinnNoResult",7),this.vviinnProductLoad=t(this,"vviinnProductLoad",7),this.vviinnProductClick=t(this,"vviinnProductClick",7),this.vviinnProductView=t(this,"vviinnProductView",7),this.vviinnImageCrop=t(this,"vviinnImageCrop",7),this.vviinnSelectObject=t(this,"vviinnSelectObject",7),this.vviinnSelectFilter=t(this,"vviinnSelectFilter",7),this.globalSlotsChanged=t(this,"globalSlotsChanged",7),this.getBasicEventData=()=>({widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:r.VPS,widgetId:this.el.id,widgetVersion:h}),this.token=void 0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.addStyle=!1,this.mode="modal",this.excluded="",this.productDetailNewTab=!0,this.apiPath=void 0,this.buttonPressed=!1}handleModalClosed(){this.buttonPressed=!1}componentDidLoad(){const i=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit(Array.from(i))}handleClick(){this.buttonPressed=!0}resetButton(){this.buttonPressed=!1}render(){return s(e,{tabindex:"0",role:"button"},s("vviinn-button",{onClick:()=>{this.handleClick()},addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(o,null))),s(a,null),s("vviinn-vps-widget",{mode:this.mode,"currency-sign":this.currencySign,token:this.token,locale:this.locale,apiPath:this.apiPath,exportparts:"brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card, example-images",campaignId:this.campaignId,showingInButton:!0,buttonPressed:this.buttonPressed,resetVpsButton:this.resetButton.bind(this),buttonElementId:this.el.id,active:this.buttonPressed,excluded:this.excluded,productDetailNewTab:this.productDetailNewTab}))}get el(){return n(this)}};d.style=":host{display:block}";export{d as vviinn_vps_button}
@@ -0,0 +1 @@
1
+ import{r as t,h as i,H as e,g as s,c as n,F as r}from"./p-fa17e81f.js";import{_ as o,O as a,S as c,a as h,E as d,i as l,s as u,c as p,m as v,f as g,g as m,b as f,A as b,d as y,e as w,h as x,p as k,T as C,j as I}from"./p-90e24b10.js";import{C as P}from"./p-60ea7665.js";import{c as T,f as _,a as R}from"./p-badde98c.js";import{i as j}from"./p-2e76a5c3.js";import{v as S}from"./p-d99266bf.js";import{h as V,t as E,p as $}from"./p-3b99c62d.js";import{c as A,a as N,v as O,b as z,d as L}from"./p-c8b070c2.js";const D="--vviinn-carousel-image-width",W="items-group",M=class{constructor(i){t(this,i),this.columns=0,this.resizeObserver=new ResizeObserver((()=>this.handleResize())),this.mutationObserver=new MutationObserver((()=>this.cloneSlottedContent())),this.isLastGroup=()=>this.activeContentGroup===this.getContentGroups().length-1&&"grid"===this.mode,this.isFirstGroup=()=>0===this.activeContentGroup&&"grid"===this.mode,this.moveDirection="right",this.contentGroups=[],this.activeContentGroup=0,this.isRTL=!1,this.mode="continuity",this.imageWidth=140,this.showScroll=!0,this.campaignTypeId=void 0,this.widgetElementId=void 0,this.gridArrowsDynamic=void 0,this.recommendations=[],this.widgetVersion=void 0}componentWillLoad(){this.isRTL="rtl"===document.dir}connectedCallback(){this.setItemWidth()}disconnectedCallback(){this.resizeObserver.disconnect()}componentDidLoad(){this.setWidth(),this.processScrollbarWidth(),this.columns=this.getColumnsNumber();const t=this.el.querySelector(".content");this.mutationObserver.observe(t,{subtree:!0,childList:!0}),this.resizeObserver.observe(this.getHostParent())}getItemWidthFromDocument(){return parseInt(getComputedStyle(document.body).getPropertyValue(D))}setItemWidth(){const t=this.getItemWidthFromDocument(),i=isNaN(t)?this.imageWidth:t;this.el.style.setProperty(D,`${i}px`)}getContentClassMap(){return{content:!0,[this.moveDirection]:!0,[this.mode]:!0,"show-scrollbar":this.showScroll}}handleResize(){this.setWidth(),this.processScrollbarWidth(),this.setItemWidth();const t=this.getColumnsNumber();t!==this.columns&&(this.columns=t)}calculateMoveStep(){const t=this.getContent().map((t=>t.getBoundingClientRect().width));return t.reduce(((t,i)=>t+i),0)/t.length}getHostParent(){return this.el.parentNode.host.parentElement}setWidth(){const t=this.getHostParent();if(!t)return;const i=getComputedStyle(t),e=t.getBoundingClientRect().width-(parseInt(i["padding-right"])+parseInt(i["padding-left"]));this.el.style.setProperty("--vviinn-carousel-content-width",`${e}px`)}getParent(){return this.el.parentNode.host.parentElement}cloneSlottedContent(){this.setWidth()}getActiveGroupIndex(){var t,i;if(!(null===(i=null===(t=this.getContentNode())||void 0===t?void 0:t.getBoundingClientRect())||void 0===i?void 0:i.left))return 0;const e=this.getContentGroups().map((t=>t.getBoundingClientRect().left)).map(((t,i)=>[t,i])).filter((t=>t[0]>=0));return e.length>0?this.isRTL?e[e.length-1][1]:e[0][1]:0}getContentNode(){return this.el.querySelector(".content")}getContent(){const t=this.getContentNode().children;return Array.from(t).map((t=>t))}getColumnsNumber(){const t=getComputedStyle(this.el).getPropertyValue("--vviinn-carousel-columns-internal"),i=parseInt(t);return i&&!isNaN(i)?i:4}getContentGroups(){return Array.from(this.el.querySelectorAll(`.${W}`))}showNext(){this.moveDirection="right";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft+this.calculateMoveStep(),behavior:"smooth"})}))}showPrev(){this.moveDirection="left";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft-this.calculateMoveStep(),behavior:"smooth"})}))}scroll(t){const i=this.getContentNode();requestAnimationFrame((()=>{i.scrollTo({top:0,left:this.calculateMoveStep()*t,behavior:"smooth"})}))}processScrollbarWidth(){const t=this.getContentNode();t&&(this.el.style.setProperty("--vviinn-progressbar-width",t.clientWidth*((t.scrollLeft+t.clientWidth)/t.scrollWidth)+"px"),this.activeContentGroup=this.getActiveGroupIndex())}showBullets(){return"grid"===this.mode&&this.showScroll}showScrollbar(){return"continuity"===this.mode&&this.showScroll}getClassMap(){return{[this.mode]:!0,"show-scrollbar":this.showScrollbar()}}renderRecommendation(t,e){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,productType:t.productType,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:"continuity"===this.mode,campaignTypeId:this.campaignTypeId,index:e,widgetElementId:this.widgetElementId,widgetVersion:this.widgetVersion})}renderRecommendationGroup(t){return i("div",{class:W,part:"items-group"},...t)}renderRecommendationGroups(t){return t.map((t=>this.renderRecommendationGroup(t)))}renderRecommendations(){return"grid"===this.mode?this.renderGrid():this.renderRecommendationsElements()}renderRecommendationsElements(){return this.recommendations.map(((t,i)=>this.renderRecommendation(t,i)))}renderGrid(){const t=this.renderRecommendationsElements(),i=o.chunksOf(this.getColumnsNumber())(t);return this.renderRecommendationGroups(i)}renderBullets(){const t=Math.ceil(this.recommendations.length/this.getColumnsNumber());return Array.from(Array(t).keys()).map((t=>i("div",{class:{bullet:!0,active:this.activeContentGroup===t},onClick:()=>this.scroll(t)})))}render(){return i(e,{class:this.getClassMap()},i("div",{class:Object.assign({body:!0},this.getClassMap())},i("button",{class:"prev",onClick:()=>this.showPrev(),part:"carousel-button",disabled:this.gridArrowsDynamic&&this.isFirstGroup()},i(P,null)),i("div",{class:this.getContentClassMap(),onScroll:()=>this.processScrollbarWidth()},this.renderRecommendations()),i("button",{class:"next",onClick:()=>this.showNext(),part:"carousel-button",disabled:this.gridArrowsDynamic&&this.isLastGroup()},i(P,null))),this.showBullets()&&i("div",{class:"bullets"},this.renderBullets()))}get el(){return s(this)}};M.style=":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#e0e0e0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button{fill:#525252}button:disabled{display:none}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";class F{sendImpression(t){var i,e,s;gtag("event","view_item_list",{items:[{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(s=t.price.sale)&&void 0!==s?s:1/0)}]})}sendClick(t){var i,e,s;gtag("event","select_content",{content_type:"product",items:[{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(s=t.price.sale)&&void 0!==s?s:1/0)}]})}}class B{constructor(){ga("require","ec")}convertProduct(t){var i,e,s;return{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list:"VI VPR View",price:Math.min(t.price.actual,null!==(s=t.price.sale)&&void 0!==s?s:1/0)}}sendImpression(t){ga("ec:addImpression",this.convertProduct(t))}sendClick(t){var i,e,s;ga("ec:addProduct",{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",price:Math.min(t.price.actual,null!==(s=t.price.sale)&&void 0!==s?s:1/0)}),ga("ec:setAction","click",{list:"VI VPR View"})}}const U=a.getMonoid(c.first()).concat(h.pipe(a.fromNullable(window.gtag),a.map((()=>new F))),h.pipe(a.fromNullable(window.ga),a.map((()=>new B))));function G(t,i,e){return function(s){for(var n=Array(e.length+1),r=0;r<e.length;r++)n[r]=e[r];return n[e.length]=s,0===i?t.apply(null,n):G(t,i-1,n)}}var q={1:function(t){return[t]},2:function(t){return function(i){return[t,i]}},3:function(t){return function(i){return function(e){return[t,i,e]}}},4:function(t){return function(i){return function(e){return function(s){return[t,i,e,s]}}}},5:function(t){return function(i){return function(e){return function(s){return function(n){return[t,i,e,s,n]}}}}}};function H(t){return V.call(q,t)||(q[t]=G(E,t-1,[])),q[t]}const K=/fit\/\d+\//,J=(t,i)=>h.pipe((t=>h.pipe(t.match(K),d.fromNullable(t),d.map((()=>t))))(t),d.map((t=>t.replace(K,`fit/${i}/`))),d.getOrElse((()=>t))),Q=(t,e)=>t.deeplink?i("a",{class:t.part,part:t.part,href:t.deeplink},e):e,X=t=>{const e=t.priceType,s=new Intl.NumberFormat(t.locale,{minimumFractionDigits:2}).format(t.price),n=t.prefix?i("span",{part:"price-prefix"},t.prefix+" "):null,r=t.currency?i("span",{part:"currency"}," "+t.currency):null;return i("span",{class:"price-amount",part:"price-amount"+(e?"-"+e:"")},n,s,r)},Y=t=>i("span",{class:"price-container",part:"price-container"},t.salePrice?[i("span",{class:"price-sale",part:"price-sale"},i(X,{prefix:t.prefix,currency:t.currency,price:t.salePrice,locale:t.locale,priceType:"sale"})),i("span",{class:"price-outdated",part:"price-outdated"},i(X,{prefix:t.prefix,currency:t.currency,price:t.price,locale:t.locale,priceType:"outdated"}))]:i("span",{class:"price-regular",part:"price-regular"},i(X,{prefix:t.prefix,currency:t.currency,price:t.price,locale:t.locale,priceType:"regular"}))),Z=class{constructor(i){t(this,i),this.vviinnProductLoad=n(this,"vviinnProductLoad",7),this.vviinnProductView=n(this,"vviinnProductView",7),this.vviinnProductClick=n(this,"vviinnProductClick",7),this.productData=null,this.intersectionObserver=new IntersectionObserver(this.intersectionCallback.bind(this),{threshold:1}),this.brand=void 0,this.currency=void 0,this.deeplink=void 0,this.image=void 0,this.imageRatio=1,this.imageWidth=200,this.locale=void 0,this.price=void 0,this.pricePrefix=void 0,this.productId=void 0,this.productTitle=void 0,this.productType=void 0,this.salePrice=void 0,this.responsive=!1,this.dimmedBackground=!1,this.campaignTypeId=void 0,this.widgetElementId=void 0,this.buttonElementId=void 0,this.widgetVersion=void 0,this.index=0,this.imageLoaded=!1}connectedCallback(){this.productData=this.getProductData()}getWidgetType(){return"VPR"===this.campaignTypeId||"VCS"===this.campaignTypeId?"VPR":"VPS"}getProductData(){var t;return{productId:this.productId,productRank:this.index,productName:this.productTitle,productType:this.productType,widgetType:this.getWidgetType(),campaignTypeId:this.campaignTypeId,campaignTypeName:T[this.campaignTypeId],widgetId:null!==(t=this.buttonElementId)&&void 0!==t?t:this.widgetElementId,widgetVersion:this.widgetVersion}}intersectionCallback(t){t.some((t=>t.isIntersecting))&&(h.pipe(U,a.map((t=>t.sendImpression(this.getProduct())))),this.vviinnProductView.emit(this.productData),this.intersectionObserver.disconnect())}componentDidLoad(){this.vviinnProductLoad.emit(this.productData),this.intersectionObserver.observe(this.el),this.el.shadowRoot.querySelectorAll("a").forEach((t=>t.addEventListener("click",(t=>{t.preventDefault(),t.stopImmediatePropagation(),this.vviinnProductClick.emit(this.productData),h.pipe(U,a.match((()=>null),(t=>t.sendClick(this.getProduct()))))}))))}getProduct(){return l.results.find((t=>t.productId===this.productId))}renderImage(){const t={width:this.imageWidth,height:this.imageWidth*this.imageRatio,src:this.image,title:this.productTitle,lazy:!1};return this.responsive?((t,e=(()=>{}))=>i("picture",null,i("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image responsive",src:J(t.src,t.width),alt:t.title,onLoad:e})))(t):((t,e=(()=>{}))=>i("picture",null,i("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image",width:t.width,height:t.height,src:J(t.src,t.width),alt:t.title,onLoad:e})))(t)}render(){var t,s,n;return i(e,{part:"product-card",class:{dimmed:this.dimmedBackground},exportparts:"brand, currency, deeplink, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title"},i(Q,{deeplink:this.deeplink,part:"image-link"},this.renderImage()),i(Q,{deeplink:this.deeplink,part:"deeplink"},i("span",{class:"title",part:"title"},this.productTitle)),i("span",{class:"brand",part:"brand"},this.brand),i("span",{class:"type",part:"type"},this.productType),i(Y,{prefix:null!==(t=this.pricePrefix)&&void 0!==t?t:u.pricePrefix,currency:null!==(s=this.currency)&&void 0!==s?s:u.currencySign,price:this.price,salePrice:this.salePrice,locale:null!==(n=this.locale)&&void 0!==n?n:u.locale}))}get el(){return s(this)}};function tt(t){return"function"==typeof t}function it(t){const i=t((t=>{Error.call(t),t.stack=(new Error).stack}));return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i}Z.style=':host{align-items:center;display:flex;flex-direction:column;gap:8px;height:100%}.price-container{display:flex;flex-direction:column}.price-sale,.price-regular{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#161616}.price-outdated{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#757575;text-decoration:line-through}.product-type{word-wrap:anywhere}.image{display:grid;align-content:center;-o-object-position:50% 50%;object-position:50% 50%;-o-object-fit:contain;object-fit:contain;text-align:center;box-sizing:border-box}img.responsive{width:100%;height:auto;aspect-ratio:1}.brand,.type{display:none}.title{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#161616;display:-webkit-box;font-size:16px;font-style:normal;font-weight:500;line-height:24px;margin-bottom:8px;overflow:hidden}.deeplink{text-decoration:none}.image-link{display:contents}picture{position:relative;width:100%}:host(.dimmed) picture::before{content:"";width:100%;height:100%;box-sizing:border-box;background:#f7f7f7;display:block;top:0;left:0;position:absolute;mix-blend-mode:multiply}';const et=it((t=>function(i){t(this),this.message=i?`${i.length} errors occurred during unsubscription:\n${i.map(((t,i)=>`${i+1}) ${t.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=i}));function st(t,i){if(t){const e=t.indexOf(i);0<=e&&t.splice(e,1)}}class nt{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:i}=this;if(i)if(this._parentage=null,Array.isArray(i))for(const t of i)t.remove(this);else i.remove(this);const{initialTeardown:e}=this;if(tt(e))try{e()}catch(i){t=i instanceof et?i.errors:[i]}const{_finalizers:s}=this;if(s){this._finalizers=null;for(const i of s)try{at(i)}catch(i){t=null!=t?t:[],i instanceof et?t=[...t,...i.errors]:t.push(i)}}if(t)throw new et(t)}}add(t){var i;if(t&&t!==this)if(this.closed)at(t);else{if(t instanceof nt){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(i=this._finalizers)&&void 0!==i?i:[]).push(t)}}_hasParent(t){const{_parentage:i}=this;return i===t||Array.isArray(i)&&i.includes(t)}_addParent(t){const{_parentage:i}=this;this._parentage=Array.isArray(i)?(i.push(t),i):i?[i,t]:t}_removeParent(t){const{_parentage:i}=this;i===t?this._parentage=null:Array.isArray(i)&&st(i,t)}remove(t){const{_finalizers:i}=this;i&&st(i,t),t instanceof nt&&t._removeParent(this)}}nt.EMPTY=(()=>{const t=new nt;return t.closed=!0,t})();const rt=nt.EMPTY;function ot(t){return t instanceof nt||t&&"closed"in t&&tt(t.remove)&&tt(t.add)&&tt(t.unsubscribe)}function at(t){tt(t)?t():t.unsubscribe()}const ct={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ht={setTimeout(t,i,...e){const{delegate:s}=ht;return(null==s?void 0:s.setTimeout)?s.setTimeout(t,i,...e):setTimeout(t,i,...e)},clearTimeout(t){const{delegate:i}=ht;return((null==i?void 0:i.clearTimeout)||clearTimeout)(t)},delegate:void 0};function dt(){}const lt=ut("C",void 0,void 0);function ut(t,i,e){return{kind:t,value:i,error:e}}function pt(t){t()}class vt extends nt{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,ot(t)&&t.add(this)):this.destination=xt}static create(t,i,e){return new bt(t,i,e)}next(t){this.isStopped?wt(function(t){return ut("N",t,void 0)}(t),this):this._next(t)}error(t){this.isStopped?wt(ut("E",void 0,t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?wt(lt,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const gt=Function.prototype.bind;function mt(t,i){return gt.call(t,i)}class ft{constructor(t){this.partialObserver=t}next(t){const{partialObserver:i}=this;if(i.next)try{i.next(t)}catch(t){yt(t)}}error(t){const{partialObserver:i}=this;if(i.error)try{i.error(t)}catch(t){yt(t)}else yt(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(t){yt(t)}}}class bt extends vt{constructor(t,i,e){let s;if(super(),tt(t)||!t)s={next:null!=t?t:void 0,error:null!=i?i:void 0,complete:null!=e?e:void 0};else{let i;this&&ct.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),s={next:t.next&&mt(t.next,i),error:t.error&&mt(t.error,i),complete:t.complete&&mt(t.complete,i)}):s=t}this.destination=new ft(s)}}function yt(t){var i;i=t,ht.setTimeout((()=>{const{onUnhandledError:t}=ct;if(!t)throw i;t(i)}))}function wt(t,i){const{onStoppedNotification:e}=ct;e&&ht.setTimeout((()=>e(t,i)))}const xt={closed:!0,next:dt,error:function(t){throw t},complete:dt},kt="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ct(t){return t}class It{constructor(t){t&&(this._subscribe=t)}lift(t){const i=new It;return i.source=this,i.operator=t,i}subscribe(t,i,e){const s=(n=t)&&n instanceof vt||function(t){return t&&tt(t.next)&&tt(t.error)&&tt(t.complete)}(n)&&ot(n)?t:new bt(t,i,e);var n;return pt((()=>{const{operator:t,source:i}=this;s.add(t?t.call(s,i):i?this._subscribe(s):this._trySubscribe(s))})),s}_trySubscribe(t){try{return this._subscribe(t)}catch(i){t.error(i)}}forEach(t,i){return new(i=Pt(i))(((i,e)=>{const s=new bt({next:i=>{try{t(i)}catch(t){e(t),s.unsubscribe()}},error:e,complete:i});this.subscribe(s)}))}_subscribe(t){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(t)}[kt](){return this}pipe(...t){return(0===(i=t).length?Ct:1===i.length?i[0]:function(t){return i.reduce(((t,i)=>i(t)),t)})(this);var i}toPromise(t){return new(t=Pt(t))(((t,i)=>{let e;this.subscribe((t=>e=t),(t=>i(t)),(()=>t(e)))}))}}function Pt(t){var i;return null!==(i=null!=t?t:ct.Promise)&&void 0!==i?i:Promise}It.create=t=>new It(t);const Tt=it((t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}));class _t extends It{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const i=new Rt(this,this);return i.operator=t,i}_throwIfClosed(){if(this.closed)throw new Tt}next(t){pt((()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(t)}}))}error(t){pt((()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:i}=this;for(;i.length;)i.shift().error(t)}}))}complete(){pt((()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}}))}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:i,isStopped:e,observers:s}=this;return i||e?rt:(this.currentObservers=null,s.push(t),new nt((()=>{this.currentObservers=null,st(s,t)})))}_checkFinalizedStatuses(t){const{hasError:i,thrownError:e,isStopped:s}=this;i?t.error(e):s&&t.complete()}asObservable(){const t=new It;return t.source=this,t}}_t.create=(t,i)=>new Rt(t,i);class Rt extends _t{constructor(t,i){super(),this.destination=t,this.source=i}next(t){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.next)||void 0===e||e.call(i,t)}error(t){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.error)||void 0===e||e.call(i,t)}complete(){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===i||i.call(t)}_subscribe(t){var i,e;return null!==(e=null===(i=this.source)||void 0===i?void 0:i.subscribe(t))&&void 0!==e?e:rt}}const jt=h.flow((t=>`Bearer ${t}`),(t=>new Headers({Authorization:t})),(t=>({headers:t}))),St=(Vt=b,function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];for(var e=t.length,s=H(e),n=Vt.map(t[0],s),r=1;r<e;r++)n=Vt.ap(n,t[r]);return n});var Vt;const Et=(t,i={})=>$(St(m(),f),g,p(v(t,i))),$t=t=>i=>e=>s=>n=>{const r=h.pipe(s,y(encodeURIComponent),w((()=>{const s=[];i&&s.push(`color=${i}`),e&&s.push(e);const n=x(s);return`product/${t}/similar-products${n}`}),(s=>{const n=[];s&&n.push(`campaigns=${s}`),i&&n.push(`color=${i}`),e&&n.push(e);const r=x(n);return`product/${t}/similar-products${r}`})));return Et(r,n)},At=t=>i=>e=>s=>n=>{const r=h.pipe(s,y(encodeURIComponent),w((()=>{const s=[];i&&s.push(`color=${i}`),e&&s.push(e);const n=x(s);return`product/${t}/cross-selling-products${n}`}),(s=>{const n=[];s&&n.push(`campaigns=${s}`),i&&n.push(`color=${i}`),e&&n.push(e);const r=x(n);return`product/${t}/cross-selling-products${r}`})));return Et(r,n)},Nt={de:{translation:{noResultText:"Keine Ergebnisse! Versuche es bitte später erneut."}},en:{translation:{noResultText:"No results! Please, try again later."}}};var Ot=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)i.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(e[s[n]]=t[s[n]])}return e};const zt=class{constructor(i){t(this,i),this.vviinnWidgetLoad=n(this,"vviinnWidgetLoad",7),this.vviinnProductLoad=n(this,"vviinnProductLoad",7),this.vviinnProductClick=n(this,"vviinnProductClick",7),this.vviinnProductView=n(this,"vviinnProductView",7),this.vviinnNoResult=n(this,"vviinnNoResult",7),this.vviinnRecommendationsLoaded=n(this,"vviinnRecommendationsLoaded",7),this.vviinnWidgetOpen=n(this,"vviinnWidgetOpen",7),this.productImageLoadedSubject=new _t,this.setTrackingDeactivated=t=>{"rejected"===t.status&&(this.trackingDeactivated=!0)},this.blockTitle="Recommended products",this.imageRatio=1,this.imageWidth=300,this.productId=void 0,this.token=void 0,this.currencySign="€",this.pricePrefix="",this.mode="continuity",this.campaignType="VPR",this.locale="de-DE",this.campaigns="",this.color="",this.gridArrowsDynamic=!1,this.noResultText="",this.noResultShow=!0,this.showScroll=!0,this.cssUrl=null,this.excluded="",this.productDetailNewTab=!1,this.apiPath="https://api.vviinn.com",this.useCarousel=!0,this.showingInButton=!1,this.buttonElementId=void 0,this.recommendations=[],this.trackingDeactivated=!1,this.hasErrorOnLoad=!1}getEventData(){return{widgetType:"VPR",campaignTypeId:this.campaignType,campaignTypeName:T[this.campaignType],widgetId:this.id,widgetVersion:S}}handleOpenLink(t){this.productDetailNewTab?window.open(t):window.location.href=t}handleProductIdChange(){this.getRecommendations()}handleCampaignTypeChange(){this.getRecommendations()}handleCampaignsChange(){this.getRecommendations()}handleApiPathChange(t){u.apiPath=t,this.getRecommendations()}handleProductLoading({detail:t}){this.productImageLoadedSubject.next(t.productId)}trackProductView({detail:t}){if(this.trackingDeactivated)return;const{productRank:i,productId:e}=t,s=Ot(t,["productRank","productId","productName","widgetType","widgetId","campaignTypeId","campaignTypeName"]),n=A(Object.assign({session_id:this.uiSessionId,rank:i,product:e},s));this.trackingApi.trackEvent(n).then(this.setTrackingDeactivated)}async trackProductClick({detail:t}){const{productRank:i,productId:e}=t,s=Ot(t,["productRank","productId","productName","widgetType","widgetId","campaignTypeId","campaignTypeName"]),n=N(Object.assign({session_id:this.uiSessionId,rank:i,product:e},s)),r=this.recommendations.find((i=>i.productId===t.productId));r&&r.deeplink&&(this.trackingDeactivated?this.handleOpenLink(r.deeplink):await this.trackingApi.trackEvent(n).then(this.setTrackingDeactivated).finally((()=>{this.handleOpenLink(r.deeplink)})))}connectedCallback(){var t;if(u.apiPath=this.apiPath,u.currencySign=this.currencySign,u.locale=this.locale,this.id=null!==(t=this.buttonElementId)&&void 0!==t?t:this.el.id,this.uiSessionId=O(),this.trackingApi=z(this.apiPath,this.token),this.trackingDeactivated)return;const i=L({action:"open",session_id:this.uiSessionId});this.trackingApi.trackEvent(i).then(this.setTrackingDeactivated),j.init({lng:this.locale,fallbackLng:"de-DE",resources:Nt})}disconnectedCallback(){if(this.trackingDeactivated)return;const t=L({action:"close",session_id:this.uiSessionId});this.trackingApi.trackEvent(t).then(this.setTrackingDeactivated)}async componentWillLoad(){u.pricePrefix=this.pricePrefix,u.currencySign=this.currencySign,this.excluded&&(this.excluded=k(this.excluded)),this.vviinnWidgetLoad.emit(this.getEventData()),this.getRecommendations()}async getRecommendations(){if(void 0===this.productId||void 0===this.token)return;const t=this.campaignType.length>0?this.campaignType:"VPR",i=jt(this.token),e=h.pipe(C.of((t=>h.pipe(_(t),R((()=>$t),(()=>At))))(t)),C.ap(C.of(this.productId)),C.ap(C.of(this.color)),C.ap(C.of(this.excluded)),C.ap(C.of(I(this.campaigns))),C.ap(C.of(i)),C.flatten),s=await e();h.pipe(s,d.fold((t=>{this.handleError(t),this.vviinnNoResult.emit(this.getEventData()),this.vviinnRecommendationsLoaded.emit()}),(t=>this.handleRecommendationsSuccess(t))))}handleError(t){this.hasErrorOnLoad=!0}handleRecommendationsSuccess(t){var i;this.recommendations=null!==(i=null==t?void 0:t.extended)&&void 0!==i?i:t,l.results=this.recommendations,this.productIds=this.recommendations.map((t=>t.productId)),this.productImageLoadedSubject.subscribe((t=>{this.productIds=this.productIds.filter((i=>i!==t)),0===this.productIds.length&&this.vviinnRecommendationsLoaded.emit()}))}isExternalCSS(){return this.cssUrl&&this.cssUrl.length>0}renderExternalCSS(){return this.isExternalCSS()?i("link",{href:this.cssUrl,rel:"stylesheet"}):""}render(){return 0===this.recommendations.length&&!1===this.noResultShow?null:i(e,{class:{loaded:!0,empty:0==this.recommendations.length,[this.mode]:!0},"aria-hidden":"false"},i(r,null,this.renderExternalCSS(),i("style",null,u.fallbackStyles),i("h2",{part:"recommendations-title"},this.blockTitle),this.recommendations.length>0&&(this.useCarousel?this.renderCarousel():this.renderResults()),0===this.recommendations.length&&this.hasErrorOnLoad&&i("p",{class:"no-result-text"},this.noResultText.length?this.noResultText:j.t("noResultText"))))}renderRecommendation(t,e){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,productType:t.productType,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:this.useDimmedBackgroundInCard(),campaignTypeId:this.campaignType,index:e,widgetElementId:this.id,widgetVersion:S})}useDimmedBackgroundInCard(){return"continuity"===this.mode||!this.useCarousel}renderResults(){return i("div",{class:"recommendations-grid",part:"recommendations-grid"},this.recommendations.map(((t,i)=>this.renderRecommendation(t,i))))}renderCarousel(){return this.showingInButton&&this.vviinnWidgetOpen.emit(this.getEventData()),i("vviinn-carousel",{mode:this.mode,campaignTypeId:this.campaignType,imageWidth:this.imageWidth,showScroll:this.showScroll,recommendations:this.recommendations,widgetElementId:this.id,widgetVersion:S,gridArrowsDynamic:this.gridArrowsDynamic})}get el(){return s(this)}static get watchers(){return{productId:["handleProductIdChange"],campaignType:["handleCampaignTypeChange"],campaigns:["handleCampaignsChange"],apiPath:["handleApiPathChange"]}}};zt.style=":host{display:grid;grid-gap:1rem;width:100%}:host(:not(.loaded)){position:absolute;visibility:hidden}:host(.grid) vviinn-product-card::part(image){border:1px solid #dddddd;width:100%}h2{margin:0}vviinn-product-card::part(price-container){align-self:flex-start;text-align:left;display:flex}.results{display:grid;grid-gap:1rem}.no-result-text{font-size:20px}.visually-hidden{position:absolute;top:0;left:0;z-index:-1;height:0;width:0}h2{margin:0}:host(.grid) h2{justify-content:center}:host(.grid) vviinn-product-card::part(image){min-width:100%}:host(.grid) vviinn-product-card::part(image-link){width:100%}:host(.grid) vviinn-product-card::part(title),:host(.grid) vviinn-product-card::part(brand),:host(.grid) vviinn-product-card::part(type){text-align:center}:host(.grid) vviinn-product-card::part(price-container){align-self:center}:host(.continuity) vviinn-product-card::part(title),:host(.continuity) vviinn-product-card::part(brand),:host(.continuity) vviinn-product-card::part(type),:host(.continuity) vviinn-product-card::part(deeplink){text-align:left;max-width:unset;align-self:start}";export{M as vviinn_carousel,Z as vviinn_product_card,zt as vviinn_vpr_widget}
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as o,H as e,g as s}from"./p-fa17e81f.js";import{b as r}from"./p-60ea7665.js";import{c as a}from"./p-badde98c.js";const n=class{constructor(o){t(this,o),this.vviinnWidgetClose=i(this,"vviinnWidgetClose",7),this.sidebarTitle=void 0,this.token=void 0,this.productId=void 0,this.position="bottom",this.sourceImage=null,this.widgetScrollbar=!1,this.mode="continuity",this.campaigns="",this.campaignType=void 0,this.color=void 0,this.locale=void 0,this.imageWidth=300,this.currencySign="€",this.noResultText=void 0,this.noResultShow=void 0,this.gridArrowsDynamic=void 0,this.excluded=void 0,this.productDetailNewTab=void 0,this.apiPath="https://api.vviinn.com",this.buttonElementId=void 0,this.widgetVersion=void 0,this.showingInButton=void 0,this.state="idle"}bodyClickListener(t){const{clientX:i,clientY:o}=t,e=this.getSidebarRectangle();e&&(i>=e.left&&i<=e.right&&o>=e.top&&o<=e.bottom||(this.state="closed"))}getClassMap(){return{[this.position]:!0,[this.state]:!0}}getSidebarRectangle(){var t;return null===(t=this.el.shadowRoot.querySelector("aside"))||void 0===t?void 0:t.getBoundingClientRect()}render(){return o(e,{class:this.getClassMap()},o("aside",{class:"sidebar",part:"body",onAnimationEnd:t=>this.handleAnimationEnd(t)},o("header",{class:{"contains-source-img":this.isSourceImageValid()},part:"sidebar-header"},this.isSourceImageValid()?this.renderSourceImage():null,o("span",{class:"title",part:"title"},this.sidebarTitle),o("button",{class:"close-sidebar",onClick:()=>this.state="closed"},o(r,null))),o("main",{part:"sidebar-content"},o("vviinn-vpr-widget",{exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-prefix, price-outdated, price-regular, price-sale, title: product-title, carousel-button, product-card, items-group",token:this.token,productId:this.productId,imageWidth:this.imageWidth,blockTitle:"",mode:this.mode,useCarousel:"bottom"===this.position,onVviinnRecommendationsLoaded:()=>this.state="open",showScroll:this.widgetScrollbar,campaigns:this.campaigns,color:this.color,currencySign:this.currencySign,apiPath:this.apiPath,locale:this.locale,buttonElementId:this.buttonElementId,noResultText:this.noResultText,noResultShow:this.noResultShow,gridArrowsDynamic:this.gridArrowsDynamic,showingInButton:this.showingInButton,excluded:this.excluded,productDetailNewTab:this.productDetailNewTab}))))}renderSourceImage(){return o("img",{class:"source-image",part:"source-image",src:this.sourceImage})}isSourceImageValid(){var t;return(null===(t=this.sourceImage)||void 0===t?void 0:t.length)>0}handleAnimationEnd({animationName:t}){t.includes("slideOut")&&this.vviinnWidgetClose.emit({widgetType:"VPR",campaignTypeId:this.campaignType,campaignTypeName:a[this.campaignType],widgetId:this.buttonElementId,widgetVersion:this.widgetVersion})}get el(){return s(this)}};n.style=":host{--vviinn-carousel-columns:4;box-sizing:border-box;display:block;display:flex;height:100vh;left:0;position:fixed;top:0;transition:background 0.1s ease-in-out;width:100vw}:host(.open){background:rgba(0, 0, 0, 0.2)}:host(.bottom){flex-direction:column;justify-content:end}:host(.right){flex-direction:row;justify-content:flex-end}header{position:relative;text-align:center;padding:32px}header.contains-source-img{display:grid;justify-items:center;grid-gap:12px}img.source-image{width:64px;height:64px;border-radius:50%;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);padding:8px}:host(.right) header{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.1)}main{padding:0 24px;min-height:100px}:host(.right) main{overflow:auto}.sidebar{background:white;box-sizing:border-box;display:flex;flex-direction:column;max-height:100vh;overflow-y:auto}:host(.bottom.idle) .sidebar,:host(.bottom.closed) .sidebar{transform:translateY(100%)}:host(.bottom.closed) .sidebar{animation-name:slideOutFromBottom;animation-duration:0.5s;animation-fill-mode:forwards}:host(.bottom.open) .sidebar{animation-name:slideInFromBottom;animation-duration:0.5s;animation-fill-mode:forwards}:host(.right.idle) .sidebar{transform:translateX(100%)}:host(.right.closed) .sidebar{animation-name:slideOutFromRight;animation-duration:0.5s;animation-fill-mode:forwards}:host(.right.open) .sidebar{animation-name:slideInFromRight;animation-duration:0.5s;animation-fill-mode:forwards}:host(.right) .sidebar{max-width:480px}:host(.right) vviinn-vpr-widget::part(recommendations-grid){display:grid;grid-template-columns:repeat(2, 1fr);grid-gap:24px}:host(.right) vviinn-vpr-widget{overflow:auto}:host(.right) vviinn-vpr-widget::part(image){border:none}.title{font-style:normal;font-weight:500;font-size:28px;line-height:40px;text-align:center;color:#000000}vviinn-vpr-widget::part(title),vviinn-vpr-widget::part(brand),vviinn-vpr-widget::part(type){text-align:left}vviinn-vpr-widget::part(price-container){align-self:start}.close-sidebar{background:transparent;border:none;cursor:pointer;margin:0;padding:0;position:absolute;right:24px;top:24px}@keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}@media (max-width: 768px){:host{--vviinn-carousel-columns:2}}";export{n as vviinn_recommendations_sidebar}
@@ -0,0 +1 @@
1
+ const o="2.20.29";export{o as v}