@epigraph/epigraph-std-lib 5.0.0-alpha.11 → 5.0.0-alpha.13

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 (36) hide show
  1. package/dist/Epigraph/epigraph.cjs +1 -1
  2. package/dist/Epigraph/epigraph.js +94 -126
  3. package/dist/Epigraph/epigraphBaseSolutions.cjs +1 -1
  4. package/dist/Epigraph/epigraphBaseSolutions.js +60 -68
  5. package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs +1 -16
  6. package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +2 -946
  7. package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.cjs +1 -1
  8. package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.js +74 -198
  9. package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs +1 -1
  10. package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js +197 -425
  11. package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs +1 -7
  12. package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js +2 -78
  13. package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs +1 -1
  14. package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js +24 -26
  15. package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.cjs +1 -1
  16. package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js +2 -88
  17. package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs +1 -1
  18. package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js +44 -75
  19. package/dist/enums-BSSe4NAs.js +8 -0
  20. package/dist/enums-PfFMiIoe.cjs +1 -0
  21. package/dist/epigraph-std-lib.cjs +1 -1
  22. package/dist/epigraph-std-lib.d.ts +1 -0
  23. package/dist/epigraph-std-lib.js +11 -72
  24. package/dist/epigraphAnalytics-CF9Czp8C.js +722 -0
  25. package/dist/epigraphAnalytics-H3EZRDUh.cjs +1 -0
  26. package/dist/epigraphQrCodeGenerator-BXUNL2XK.js +54 -0
  27. package/dist/epigraphQrCodeGenerator-F2eLrPC_.cjs +7 -0
  28. package/dist/epigraphUnitsConverter-CwpmWl7p.cjs +1 -0
  29. package/dist/epigraphUnitsConverter-DsX4Rmsp.js +66 -0
  30. package/dist/lit--5TUYSGn.js +508 -0
  31. package/dist/lit-DZtv4Pds.cjs +2 -0
  32. package/package.json +6 -7
  33. package/dist/enums-1vqWxJ0i.cjs +0 -1
  34. package/dist/enums-CvOTKyNu.js +0 -5
  35. package/dist/lit-element-C3moVMGu.js +0 -524
  36. package/dist/lit-element-CYaaFRfk.cjs +0 -19
@@ -0,0 +1,722 @@
1
+ import { n as e } from "./enums-BSSe4NAs.js";
2
+ //#region lib/EpigraphLibs/EpigraphAnalytics/analytics-plugin-interface.ts
3
+ var t = /* @__PURE__ */ function(e) {
4
+ return e.UNAVAILABLE = "unavailable", e.AVAILABLE = "available", e.RESTRICTED = "restricted", e;
5
+ }({}), n = Symbol("data"), r = Symbol("next"), i = class e {
6
+ constructor(e) {
7
+ this[n] = e, this[r] = null;
8
+ }
9
+ get data() {
10
+ return this[n];
11
+ }
12
+ set next(t) {
13
+ if (!(t instanceof e) && t !== null) throw Error("This node is not an instance of the custom class 'Node'.");
14
+ this[r] = t;
15
+ }
16
+ get next() {
17
+ return this[r];
18
+ }
19
+ }, a = Symbol("head"), o = class {
20
+ constructor() {
21
+ this[a] = null;
22
+ }
23
+ set head(e) {
24
+ this[a] = e;
25
+ }
26
+ get head() {
27
+ return this[a];
28
+ }
29
+ addToTail(e) {
30
+ let t = this.head;
31
+ if (t) {
32
+ for (; t.next !== null;) t = t?.next;
33
+ return t.next = new i(e);
34
+ }
35
+ return this.head = new i(e);
36
+ }
37
+ removeHead() {
38
+ let e = this.head;
39
+ if (e) return this.head = e.next, e.data;
40
+ }
41
+ }, s = Symbol("queue"), c = Symbol("size"), l = class {
42
+ constructor() {
43
+ this[s] = new o(), this[c] = 0;
44
+ }
45
+ get queue() {
46
+ return this[s];
47
+ }
48
+ get size() {
49
+ return this[c];
50
+ }
51
+ enqueue(e) {
52
+ this.queue.addToTail(e), this[c]++;
53
+ }
54
+ dequeue() {
55
+ let e = this.queue.removeHead();
56
+ return this[c]--, e;
57
+ }
58
+ }, u = class {
59
+ static {
60
+ this.NOTIFICATION_NAME = "epg-notification";
61
+ }
62
+ static {
63
+ this.ACTION_SEND_EVENT = "send-event";
64
+ }
65
+ static {
66
+ this.ACTION_INITIALIZED = "initialized";
67
+ }
68
+ static {
69
+ this.ACTION_FAILED_INITIALIZATION = "initialization-failed";
70
+ }
71
+ constructor(e, t, n, r, i, a) {
72
+ this._pluginName = e, this._trackingId = t, this._experienceId = n, this._solution = r, this._initializer = i, this._status = a;
73
+ }
74
+ updateStatus(e) {
75
+ this._status = e;
76
+ }
77
+ updateInitializer(e) {
78
+ this._initializer = e;
79
+ }
80
+ notify(e, t) {
81
+ let n = {
82
+ pluginName: this._pluginName,
83
+ trackingId: this._trackingId,
84
+ experienceId: this._experienceId,
85
+ solution: this._solution,
86
+ initializer: this._initializer,
87
+ status: this._status,
88
+ action: e,
89
+ eventDetails: t
90
+ };
91
+ window.dispatchEvent(new CustomEvent("epg-notification", { detail: n }));
92
+ }
93
+ }, d = class {
94
+ constructor({ trackingID: e, experienceID: n, solution: r, verboseLogging: i = !1 }) {
95
+ this.__status = t.UNAVAILABLE, this.__sentEventCount = 0, this.__initializationAttempts = 0, this.__lastInitializationAttempt = performance.now(), this.__maxInitializationAttempts = 10, this.__initializationRetryDelay = 2e3, this.__isInitialized = !1, this.__initializationMethod = "NONE", this.__nexusFailureReported = !1, this.name = this.pluginName = "GA4-PLUGIN", this.trackingID = e, this.experienceID = n, this.solution = r, this.verboseLogging = i, this.__queue = new l(), this.__epigraphNotifier = new u(this.pluginName, this.pluginName, this.experienceID, this.solution, this.__initializationMethod, this.__status), this.initializePlugin();
96
+ }
97
+ getStatus() {
98
+ return this.__status;
99
+ }
100
+ setStatus(e) {
101
+ this.__status = e, this.__epigraphNotifier.updateStatus(e);
102
+ }
103
+ getPendingEventCount() {
104
+ return this.__queue.size;
105
+ }
106
+ getSentEventCount() {
107
+ return this.__sentEventCount;
108
+ }
109
+ getTotalEventCount() {
110
+ return this.getPendingEventCount() + this.getSentEventCount();
111
+ }
112
+ getUniquePluginIdentifier() {
113
+ return `${this.name}-${this.trackingID}`;
114
+ }
115
+ setupPlugin() {
116
+ this.__isInitialized && this.dataLayer !== void 0 && this.dequeueAndSendEvents();
117
+ }
118
+ async sendEvent(e, n) {
119
+ if (this.__queue.enqueue(e), !n) {
120
+ this.__status = t.RESTRICTED;
121
+ return;
122
+ }
123
+ if (!this.__isInitialized) {
124
+ this.logger("Cannot send analytics event: dataLayer not defined or plugin not initialized.");
125
+ return;
126
+ }
127
+ try {
128
+ await this.dequeueAndSendEvents();
129
+ } catch (e) {
130
+ this.logger(e), await this.reportFailureToNexus("EVENT_SEND_ERROR", e?.toString() || "Unknown error");
131
+ }
132
+ }
133
+ initializePlugin() {
134
+ if (this.__isInitialized) return;
135
+ if (this.__initializationAttempts >= this.__maxInitializationAttempts) {
136
+ this.__nexusFailureReported || (this.reportFailureToNexus("MAX_INITIALIZATION_ATTEMPTS", "Maximum initialization attempts reached"), this.__nexusFailureReported = !0, this.__epigraphNotifier.notify(u.ACTION_FAILED_INITIALIZATION, {}));
137
+ return;
138
+ }
139
+ let e = performance.now();
140
+ if (this.__initializationAttempts > 0 && e - this.__lastInitializationAttempt < this.__initializationRetryDelay) return;
141
+ this.__lastInitializationAttempt = e, this.__initializationAttempts++;
142
+ let n = this.detectAndSetupAnalytics();
143
+ n.success ? (this.__isInitialized = !0, this.__status = t.AVAILABLE, this.__initializationMethod = n.method, this.dataLayerName = n.dataLayerName, this.dataLayer = window[this.dataLayerName], this.logger(`Successfully initialized ${n.method} with dataLayer: ${this.dataLayerName}`), this.__epigraphNotifier.notify(u.ACTION_INITIALIZED, {}), this.__queue.size > 0 && this.dequeueAndSendEvents()) : (this.logger(`Initialization attempt ${this.__initializationAttempts} failed: ${n.error}`), this.__initializationAttempts < this.__maxInitializationAttempts && setTimeout(() => {
144
+ this.initializePlugin();
145
+ }, this.__initializationRetryDelay));
146
+ }
147
+ detectAndSetupAnalytics() {
148
+ let e = this.detectGTM();
149
+ if (e) return this.logger(`GTM detected with container ID: ${e.containerId}`), this.__epigraphNotifier.updateInitializer("GTM"), {
150
+ success: !0,
151
+ method: "GTM",
152
+ dataLayerName: e.dataLayerName
153
+ };
154
+ let t = this.findGA4Info(this.trackingID);
155
+ if (t) {
156
+ let e = t.l || "dataLayer";
157
+ return this.logger(`GA4 script found, setting up with dataLayer: ${e}`), this.__epigraphNotifier.updateInitializer("GA4"), {
158
+ success: !0,
159
+ method: "GA4",
160
+ dataLayerName: e
161
+ };
162
+ }
163
+ return {
164
+ success: !1,
165
+ method: "NONE",
166
+ dataLayerName: "dataLayer",
167
+ error: "No analytics setup found and unable to create one"
168
+ };
169
+ }
170
+ detectGTM() {
171
+ let e = document.querySelectorAll("script[src*=\"googletagmanager.com/gtm\"]");
172
+ for (let t of Array.from(e)) {
173
+ let e = t.getAttribute("src");
174
+ if (e) {
175
+ let t = e.match(/gtm\.js\?id=([^&]+)/);
176
+ if (t && t.length > 0) {
177
+ let n = e.match(/&l=([^&]+)/), r = n ? n[1] : "dataLayer";
178
+ return {
179
+ containerId: t[1],
180
+ dataLayerName: r
181
+ };
182
+ }
183
+ }
184
+ }
185
+ return null;
186
+ }
187
+ async dequeueAndSendEvents() {
188
+ if (!this.__isInitialized || !this.dataLayer) return;
189
+ let e = this.__queue.size;
190
+ for (let t = 0; t < e; t++) {
191
+ let e = this.__queue.dequeue();
192
+ try {
193
+ this.__initializationMethod === "GTM" ? (this.sendGTMEvent(e), this.__sentEventCount++, this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${e.eventName}`)) : this.__initializationMethod === "GA4" ? (this.sendGA4Event(e), this.__sentEventCount++, this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${e.eventName}`)) : this.__queue.enqueue(e);
194
+ } catch (t) {
195
+ this.logger(`Error sending event ${e.eventName}: ${t}`), this.__queue.enqueue(e);
196
+ }
197
+ }
198
+ }
199
+ async sendGTMEvent(e) {
200
+ let t = e.getGTMParameters(this.solution, this.experienceID, this.trackingID), n = t;
201
+ this.isValidPayload(t) || (t = await this.convertGTMParametersToEpgEventTag(e.eventName, t)), this.dataLayer && (this.dataLayer.push(t), this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, n));
202
+ }
203
+ async sendGA4Event(e) {
204
+ let t = e.getGa4Parameters(this.solution, this.experienceID, this.trackingID), n = t;
205
+ this.isValidPayload(t) || (t = await this.convertGA4ParametersToEpgEventTag(t)), window.gtag("event", e.eventName, t), this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, n);
206
+ }
207
+ isValidPayload(e) {
208
+ if (Object.keys(e).length >= 25) return !1;
209
+ for (let [t, n] of Object.entries(e)) if (t !== "items" && (t.length > 40 || String(n).length > 100)) return !1;
210
+ return !0;
211
+ }
212
+ async convertGTMParametersToEpgEventTag(e, t) {
213
+ try {
214
+ return {
215
+ event: e,
216
+ epg_event_tag: await this.sendGA4LongParameters(t),
217
+ send_to: this.trackingID
218
+ };
219
+ } catch {
220
+ return t;
221
+ }
222
+ }
223
+ async convertGA4ParametersToEpgEventTag(e) {
224
+ try {
225
+ return {
226
+ epg_event_tag: await this.sendGA4LongParameters(e),
227
+ send_to: this.trackingID
228
+ };
229
+ } catch {
230
+ return e;
231
+ }
232
+ }
233
+ logger(e) {
234
+ this.verboseLogging && console.warn(e);
235
+ }
236
+ async sendGA4LongParameters(e) {
237
+ let t = { parameters: e };
238
+ try {
239
+ let e = await fetch("https://api.myepigraph.com/api/analytics/ga4/custom", {
240
+ method: "POST",
241
+ headers: {
242
+ "Content-Type": "application/json",
243
+ Accept: "application/json"
244
+ },
245
+ body: JSON.stringify(t)
246
+ });
247
+ return e.ok ? (await e.json())?.id ?? "" : "";
248
+ } catch {
249
+ return "";
250
+ }
251
+ }
252
+ async reportFailureToNexus(e, t) {
253
+ try {
254
+ let n = {
255
+ plugin: "GA4",
256
+ trackingId: this.trackingID,
257
+ solution: this.solution,
258
+ experienceId: this.experienceID,
259
+ failureType: e,
260
+ errorMessage: t,
261
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
262
+ url: window.location.href,
263
+ userAgent: navigator.userAgent
264
+ };
265
+ this.logger(`Failure reported to Nexus: ${JSON.stringify(n)}`);
266
+ } catch (e) {
267
+ this.logger(`Error reporting failure to Nexus: ${e}`);
268
+ }
269
+ }
270
+ findGA4Info(e) {
271
+ if (window.google_tag_manager && window.google_tag_manager[e]) {
272
+ let t = window.google_tag_manager[e];
273
+ if (t && t.dataLayerName) return {
274
+ fullSrc: "",
275
+ id: e,
276
+ l: t.dataLayerName
277
+ };
278
+ }
279
+ let t = document.querySelectorAll("script[src]");
280
+ for (let n of t) {
281
+ let t = n.getAttribute("src");
282
+ if (t && t.includes(e)) {
283
+ let e = new URL(t, location.href), n = Object.fromEntries(e.searchParams.entries());
284
+ return {
285
+ fullSrc: e.href,
286
+ id: n.id || void 0,
287
+ l: n.l || void 0
288
+ };
289
+ }
290
+ }
291
+ return null;
292
+ }
293
+ }, f = class {
294
+ constructor({ trackingID: n, experienceID: r, solution: i, sessionId: a, xPath: o, verboseLogging: s = !1, baseUrl: c = e.PRODUCTION }) {
295
+ this.__status = t.UNAVAILABLE, this.__sentEventCount = 0, this.sessionId = a, this.xPath = o, this.name = this.pluginName = "NEXUS-PLUGIN", this.trackingID = n, this.experienceID = r, this.solution = i, this.verboseLogging = s, this.__queue = new l(), this.url = `${c}analytics/event`, this.__status = t.AVAILABLE, this.__epigraphNotifier = new u(this.pluginName, this.trackingID, this.experienceID, this.solution, "NEXUS", this.__status), this.__epigraphNotifier.notify(u.ACTION_INITIALIZED, {});
296
+ }
297
+ getStatus() {
298
+ return this.__status;
299
+ }
300
+ setStatus(e) {
301
+ this.__status = e, this.__epigraphNotifier.updateStatus(e);
302
+ }
303
+ getPendingEventCount() {
304
+ return this.__queue.size;
305
+ }
306
+ getSentEventCount() {
307
+ return this.__sentEventCount;
308
+ }
309
+ getTotalEventCount() {
310
+ return this.getPendingEventCount() + this.getSentEventCount();
311
+ }
312
+ getUniquePluginIdentifier() {
313
+ return this.name + "-" + this.trackingID;
314
+ }
315
+ setupPlugin() {}
316
+ async sendEvent(e, n) {
317
+ if (this.__queue.enqueue(e), !n) {
318
+ this.__status = t.RESTRICTED, this.__epigraphNotifier.updateStatus(this.__status);
319
+ return;
320
+ }
321
+ await this.dequeueAndSendEvents();
322
+ }
323
+ async dequeueAndSendEvents() {
324
+ for (let e = 0; e < this.__queue.size; e++) {
325
+ let e = this.__queue.dequeue(), t = {
326
+ send_to: this.trackingID,
327
+ experience_id: this.experienceID,
328
+ solution: this.solution,
329
+ event: e.eventName,
330
+ parameters: e.getNexusParameters()
331
+ };
332
+ try {
333
+ return (await fetch(this.url, {
334
+ method: "POST",
335
+ headers: {
336
+ "Content-Type": "application/json",
337
+ Accept: "application/json",
338
+ "EPG-SESSION-ID": this.sessionId,
339
+ "EPG-XPATH": this.xPath,
340
+ Origin: typeof window < "u" ? window.location.origin : ""
341
+ },
342
+ body: JSON.stringify(t)
343
+ })).ok && this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, t), "";
344
+ } catch {
345
+ return "";
346
+ }
347
+ this.__sentEventCount++;
348
+ }
349
+ return "";
350
+ }
351
+ }, p = class {
352
+ constructor(e) {
353
+ this.consentSet = !1, this.consent = !1, this.pluginName = "OneTrustConsentPlugin", this.consentIdentifier = e, this.consent = !1, this.addConsentChangedListener();
354
+ }
355
+ hasConsent() {
356
+ if (this.consentSet) return this.consent;
357
+ if (window.OnetrustActiveGroups !== void 0) {
358
+ let e = window.OnetrustActiveGroups;
359
+ e !== void 0 && e.split(",").forEach((e) => {
360
+ e === this.consentIdentifier && (this.consent = !0, this.consentSet = !0);
361
+ });
362
+ }
363
+ return this.consent;
364
+ }
365
+ addConsentChangedListener() {
366
+ window.addEventListener("load", () => {
367
+ this.hasConsent(), window.OneTrust !== void 0 && typeof window.OneTrust == "object" && window.OneTrust.OnConsentChanged(() => {
368
+ this.consentSet = !1, this.hasConsent();
369
+ });
370
+ });
371
+ }
372
+ }, m = /* @__PURE__ */ function(e) {
373
+ return e.OneTrust = "onetrust", e;
374
+ }({}), h = class {
375
+ constructor({ eventName: e, interactiveEvent: t, customParameters: n }) {
376
+ this.eventName = e, this.interactiveEvent = t, this.customParameters = n;
377
+ }
378
+ getGa4Parameters(e, t, n) {
379
+ let r = {
380
+ solution: e,
381
+ experience_id: t,
382
+ interactive_event: this.interactiveEvent,
383
+ send_to: n
384
+ };
385
+ return r = Object.assign(r, JSON.parse(JSON.stringify(this.customParameters))), r;
386
+ }
387
+ getGTMParameters(e, t, n) {
388
+ let r = {
389
+ solution: e,
390
+ experience_id: t,
391
+ event: this.eventName,
392
+ interactive_event: this.interactiveEvent,
393
+ send_to: n
394
+ };
395
+ return r = Object.assign(r, JSON.parse(JSON.stringify(this.customParameters))), r;
396
+ }
397
+ getNexusParameters() {
398
+ let e = { interactive_event: this.interactiveEvent };
399
+ return e = Object.assign(e, JSON.parse(JSON.stringify(this.customParameters))), e;
400
+ }
401
+ }, g = /* @__PURE__ */ function(e) {
402
+ return e.VARIANT = "variant", e.CATEGORY_VARIANT = "category_variant", e.GEOMETRY = "geometry", e.CATEGORY_GEOMETRY = "category_geometry", e.GLOBAL = "global", e;
403
+ }({}), _ = /* @__PURE__ */ function(e) {
404
+ return e.AR = "ar", e.QR = "qr", e.INFO = "info", e.INSTRUCTIONS = "instructions", e.DOWNLOAD = "download", e.PREVIEW_CART = "preview_cart", e.HOTSPOT_PANEL = "hotspot_panel", e.SHARE_MODAL = "share_modal", e.RESTART_MODAL = "restart_modal", e.REMOVE_MODAL = "remove_modal", e.LOAD_PRECONFIG_MODAL = "load_preconfig_modal", e.MOVE_MODAL = "move_modal", e.OUT_OF_STOCK_MODAL = "out_of_stock_modal", e;
405
+ }({}), v = /* @__PURE__ */ function(e) {
406
+ return e.NETWORK = "network", e.EXPERIENCE_CONFIG_ERROR = "experience-config-error", e.SCENE_LOAD_ERROR = "scene-load-error", e.INITIAL_SCENE_LOAD_ERROR = "initial-scene-load-error", e.AUTHENTICATION_FAILED = "authentication-failed", e;
407
+ }({}), y = /* @__PURE__ */ function(e) {
408
+ return e.AUTO = "auto", e.BUTTON = "button", e.HOTSPOT = "hotspot", e.GESTURE = "gesture", e;
409
+ }({}), b = /* @__PURE__ */ function(e) {
410
+ return e.USD = "USD", e.EUR = "EUR", e.GBP = "GBP", e.CAD = "CAD", e;
411
+ }({}), x = /* @__PURE__ */ function(e) {
412
+ return e.AR = "ar", e.QR = "qr", e.AR_WEBGL2 = "ar-webgl2", e.QR_WEBGL2 = "qr-webgl2", e;
413
+ }({}), S = /* @__PURE__ */ function(e) {
414
+ return e.AR_VIEW = "ar_view", e.DIMENSION_TOGGLE = "dimension_toggle", e.HOTSPOTS_TOGGLE = "hotspots_toggle", e.HELP_TOGGLE = "help_toggle", e.UTILITY_MENU_TOGGLE = "utility_menu_toggle", e.HOTSPOT_ENTER = "hotspot_enter", e.HOTSPOT_EXIT = "hotspot_exit", e.SHARE = "share", e.PDF_DOWNLOAD = "pdf_download", e.COPY = "copy", e.RESTART = "restart", e.INSTRUCTIONS_SHOW = "show_instructions", e.REVIEW_CART = "review_cart", e.SHOP_NOW = "shop_now", e.SUB_CATEGORY = "sub_category", e.NEXT_STEP = "next_step", e.PREVIOUS_STEP = "previous_step", e;
415
+ }({}), C = /* @__PURE__ */ function(e) {
416
+ return e.ZOOM = "zoom", e.ROTATE = "rotate", e.PAN = "pan", e;
417
+ }({}), w = /* @__PURE__ */ function(e) {
418
+ return e.CONFIGURATION = "configuration", e.SCENE = "scene", e.PRODUCT = "product", e;
419
+ }({}), T = /* @__PURE__ */ function(e) {
420
+ return e.FACEBOOK = "facebook", e.TWITTER = "twitter", e.EMAIL = "email", e.COPY_LINK = "copy_link", e.WHATSAPP = "whatsapp", e.LINKEDIN = "linkedin", e;
421
+ }({}), E = class extends h {
422
+ constructor(e) {
423
+ super({
424
+ eventName: "epigraph_ar_requested",
425
+ interactiveEvent: !0,
426
+ customParameters: { items: e }
427
+ });
428
+ }
429
+ }, D = class extends h {
430
+ constructor(e) {
431
+ super({
432
+ eventName: "epigraph_module_loading",
433
+ interactiveEvent: !1,
434
+ customParameters: { is_pre_config: e }
435
+ });
436
+ }
437
+ }, O = class extends h {
438
+ constructor(e, t) {
439
+ super({
440
+ eventName: "epigraph_module_ready",
441
+ interactiveEvent: !1,
442
+ customParameters: {
443
+ is_pre_config: e,
444
+ load_time_ms: t
445
+ }
446
+ });
447
+ }
448
+ }, k = class extends h {
449
+ static {
450
+ this.MODULE_FAILED_ERRORS = v;
451
+ }
452
+ constructor(e, t, n) {
453
+ super({
454
+ eventName: "epigraph_module_failed",
455
+ interactiveEvent: !1,
456
+ customParameters: {
457
+ is_pre_config: e,
458
+ load_time_ms: t,
459
+ error_type: n
460
+ }
461
+ });
462
+ }
463
+ }, A = class extends h {
464
+ constructor(e) {
465
+ super({
466
+ eventName: "epigraph_module_closed",
467
+ interactiveEvent: !0,
468
+ customParameters: { items: e }
469
+ });
470
+ }
471
+ }, j = class extends h {
472
+ static {
473
+ this.SUPPORT_TYPE = x;
474
+ }
475
+ constructor(e) {
476
+ super({
477
+ eventName: "epigraph_support_detected",
478
+ interactiveEvent: !1,
479
+ customParameters: { support_type: e }
480
+ });
481
+ }
482
+ }, M = class extends h {
483
+ static {
484
+ this.BUTTON_TYPE = S;
485
+ }
486
+ constructor(e, t) {
487
+ super({
488
+ eventName: "epigraph_button_click",
489
+ interactiveEvent: !0,
490
+ customParameters: {
491
+ button_type: e,
492
+ button_name: t
493
+ }
494
+ });
495
+ }
496
+ }, N = class extends h {
497
+ static {
498
+ this.PANEL_TYPE = _;
499
+ }
500
+ static {
501
+ this.TRIGGER_SOURCE = y;
502
+ }
503
+ constructor(e, t, n, r) {
504
+ super({
505
+ eventName: "epigraph_panel_opened",
506
+ interactiveEvent: e,
507
+ customParameters: {
508
+ items: r,
509
+ panel_type: t,
510
+ trigger_source: n
511
+ }
512
+ });
513
+ }
514
+ }, P = class extends h {
515
+ static {
516
+ this.PANEL_TYPE = _;
517
+ }
518
+ static {
519
+ this.TRIGGER_SOURCE = y;
520
+ }
521
+ constructor(e, t, n, r) {
522
+ super({
523
+ eventName: "epigraph_panel_closed",
524
+ interactiveEvent: e,
525
+ customParameters: {
526
+ items: r,
527
+ panel_type: t,
528
+ trigger_source: n
529
+ }
530
+ });
531
+ }
532
+ }, F = class extends h {
533
+ constructor(e) {
534
+ super({
535
+ eventName: "epigraph_add_to_favourites",
536
+ interactiveEvent: !0,
537
+ customParameters: { items: e }
538
+ });
539
+ }
540
+ }, I = class extends h {
541
+ static {
542
+ this.ACTION_PERFORMED = C;
543
+ }
544
+ constructor(e) {
545
+ super({
546
+ eventName: "epigraph_keyboard_interaction",
547
+ interactiveEvent: !0,
548
+ customParameters: { action_performed: e }
549
+ });
550
+ }
551
+ }, L = class extends h {
552
+ static {
553
+ this.INTERACTION_TYPE = C;
554
+ }
555
+ constructor(e) {
556
+ super({
557
+ eventName: "epigraph_touch_interaction",
558
+ interactiveEvent: !0,
559
+ customParameters: { interaction_type: e }
560
+ });
561
+ }
562
+ }, R = class extends h {
563
+ static {
564
+ this.CURRENCY = b;
565
+ }
566
+ constructor(e, t, n, r, i) {
567
+ super({
568
+ eventName: "epigraph_item_added",
569
+ interactiveEvent: e,
570
+ customParameters: {
571
+ items: i,
572
+ value: t,
573
+ currency: n,
574
+ quantity: r
575
+ }
576
+ });
577
+ }
578
+ }, z = class extends h {
579
+ constructor(e) {
580
+ super({
581
+ eventName: "epigraph_item_moved",
582
+ interactiveEvent: !0,
583
+ customParameters: { items: e }
584
+ });
585
+ }
586
+ }, B = class extends h {
587
+ static {
588
+ this.CURRENCY = b;
589
+ }
590
+ constructor(e, t, n, r) {
591
+ super({
592
+ eventName: "epigraph_item_removed",
593
+ interactiveEvent: !0,
594
+ customParameters: {
595
+ items: r,
596
+ value: e,
597
+ currency: t,
598
+ quantity: n
599
+ }
600
+ });
601
+ }
602
+ }, V = class extends h {
603
+ static {
604
+ this.VARIANT_CHANGE_TYPES = g;
605
+ }
606
+ constructor(e, t) {
607
+ super({
608
+ eventName: "epigraph_variant_changed",
609
+ interactiveEvent: !0,
610
+ customParameters: {
611
+ items: t,
612
+ change_type: e
613
+ }
614
+ });
615
+ }
616
+ }, H = class extends h {
617
+ static {
618
+ this.CONTENT_TYPES = w;
619
+ }
620
+ static {
621
+ this.SHARE_DESTINATIONS = T;
622
+ }
623
+ constructor(e, t, n) {
624
+ super({
625
+ eventName: "epigraph_content_shared",
626
+ interactiveEvent: !0,
627
+ customParameters: {
628
+ items: n,
629
+ content_type: e,
630
+ share_destination: t
631
+ }
632
+ });
633
+ }
634
+ }, U = class extends h {
635
+ static {
636
+ this.CURRENCY = b;
637
+ }
638
+ constructor(e, t, n) {
639
+ super({
640
+ eventName: "epigraph_checkout",
641
+ interactiveEvent: !0,
642
+ customParameters: {
643
+ items: n,
644
+ value: e,
645
+ currency: t
646
+ }
647
+ });
648
+ }
649
+ }, W = class extends h {
650
+ static {
651
+ this.CURRENCY = b;
652
+ }
653
+ constructor(e, t, n) {
654
+ super({
655
+ eventName: "epigraph_conversion",
656
+ interactiveEvent: !0,
657
+ customParameters: {
658
+ items: n,
659
+ value: e,
660
+ currency: t
661
+ }
662
+ });
663
+ }
664
+ }, G = class extends h {
665
+ constructor(e) {
666
+ super({
667
+ eventName: "epigraph_changeRate",
668
+ interactiveEvent: !1,
669
+ customParameters: { value: e }
670
+ });
671
+ }
672
+ }, K = class extends h {
673
+ constructor(e) {
674
+ super({
675
+ eventName: "epigraph_completionRate",
676
+ interactiveEvent: !1,
677
+ customParameters: { value: e }
678
+ });
679
+ }
680
+ }, q = class extends h {
681
+ constructor(e) {
682
+ super({
683
+ eventName: "epigraph_engagementRate",
684
+ interactiveEvent: !1,
685
+ customParameters: { value: e }
686
+ });
687
+ }
688
+ }, J = class extends h {
689
+ constructor(e, t, n) {
690
+ super({
691
+ eventName: e,
692
+ interactiveEvent: t,
693
+ customParameters: n
694
+ });
695
+ }
696
+ }, Y = Symbol("analyticsPluginsMap"), X = class {
697
+ constructor(e, t) {
698
+ this[Y] = /* @__PURE__ */ new Map(), this.__consentPlugin = null, e && t && (this.__consentPlugin = this.buildConsentPlugin(e, t)), window.addEventListener("epigraphAnalyticsConsentChange", this.__onConsentChangeFromEvent);
699
+ }
700
+ __onConsentChangeFromEvent(e) {
701
+ let n = e;
702
+ this.__overrideConsent = n.detail.hasConsent;
703
+ for (let e of this[Y].values()) this.__hasConsent() || e.setStatus(t.RESTRICTED);
704
+ }
705
+ addEventPlugin(e) {
706
+ this[Y].has(e.getUniquePluginIdentifier()) || (this[Y].set(e.getUniquePluginIdentifier(), e), e.setupPlugin());
707
+ }
708
+ __hasConsent() {
709
+ let e = !0;
710
+ return this.__overrideConsent === void 0 ? (this.__consentPlugin && (e = this.__consentPlugin.hasConsent()), e) : (e = this.__overrideConsent, e);
711
+ }
712
+ sendEvent(e) {
713
+ this[Y].forEach((t) => {
714
+ t.sendEvent(e, this.__hasConsent());
715
+ });
716
+ }
717
+ buildConsentPlugin(e, t) {
718
+ return e.toLowerCase() === m.OneTrust.toLowerCase() ? new p(t) : null;
719
+ }
720
+ };
721
+ //#endregion
722
+ export { _ as A, O as C, L as D, j as E, m as F, p as I, f as L, x as M, y as N, V as O, g as P, d as R, D as S, N as T, z as _, b as a, A as b, M as c, K as d, H as f, R as g, q as h, w as i, T as j, v as k, G as l, J as m, C as n, F as o, W as p, S as r, E as s, X as t, U as u, B as v, P as w, k as x, I as y };