@luzmo/embed 5.0.4 → 5.0.6

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.
package/index.umd.js DELETED
@@ -1,2852 +0,0 @@
1
- (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["libs/embedded-libs/embed"] = {}));
3
- })(this, function(exports2) {
4
- var _a;
5
- "use strict";
6
- const _handleError = (errorMessage, parameters) => {
7
- let message = "The dashboard component encountered an error";
8
- if (typeof (parameters == null ? void 0 : parameters.dashboardId) === "string") {
9
- message += ` for dashboard with id ${parameters.dashboardId}`;
10
- }
11
- if (typeof (parameters == null ? void 0 : parameters.dashboardSlug) === "string") {
12
- message += ` for dashboard with slug ${parameters.dashboardSlug}`;
13
- }
14
- if (typeof (parameters == null ? void 0 : parameters.container) === "string") {
15
- message += ` in container ${parameters.container}`;
16
- }
17
- if (errorMessage) {
18
- message += `:
19
- ${errorMessage}`;
20
- console.error(message);
21
- }
22
- };
23
- const _browserCheck = (dashboardComponent) => {
24
- let hasError = false;
25
- let errorMessage = "";
26
- const document_ = document.body || document.documentElement;
27
- const style = document_.style;
28
- const browserCheck = {
29
- svg: !!("createElementNS" in document && document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect),
30
- flexbox: style.webkitFlexWrap === "" || style.flexWrap === "",
31
- postMessage: !!window.postMessage
32
- };
33
- const browserCheckKeys = ["svg", "flexbox", "postMessage"];
34
- for (const key of browserCheckKeys) {
35
- if (!browserCheck[key]) {
36
- hasError = true;
37
- dashboardComponent.browserNotSupported = dashboardComponent.browserNotSupported || [];
38
- dashboardComponent.browserNotSupported.push(key);
39
- errorMessage += `Your browser does not support: ${key}
40
- `;
41
- }
42
- }
43
- const ua = window.navigator.userAgent;
44
- const msie = ua.includes("MSIE");
45
- const trident = ua.includes("Trident/");
46
- if (msie || trident) {
47
- hasError = true;
48
- errorMessage = "IE is not supported.";
49
- }
50
- if (hasError) {
51
- _handleError(errorMessage);
52
- }
53
- };
54
- const DEFAULT_PARAMETERS = {
55
- appServer: "https://app.luzmo.com/",
56
- apiHost: "https://api.luzmo.com/",
57
- dashboardId: null,
58
- dashboardSlug: null,
59
- container: null,
60
- key: null,
61
- token: null,
62
- language: "auto",
63
- qeVersion: null,
64
- editMode: null,
65
- screenMode: null,
66
- switchScreenModeOnResize: true,
67
- itemId: null,
68
- mainColor: "",
69
- accentColor: "",
70
- itemDimensions: {
71
- width: "auto",
72
- height: "auto"
73
- },
74
- loaderBackground: "#f9f9f9",
75
- loaderFontColor: "#5a5a5a",
76
- loaderSpinnerColor: "rgba(255, 165, 0, 0.7)",
77
- loaderSpinnerBackground: "rgba(169, 169, 169, 0.14)",
78
- timezoneId: null
79
- };
80
- const EXTENTS = [
81
- { mode: "mobile", width: [150, 767] },
82
- { mode: "tablet", width: [768, 1199] },
83
- { mode: "desktop", width: [1200, 1599] },
84
- { mode: "largeScreen", width: [1600, 9999] },
85
- { mode: "fixed", width: [] }
86
- ];
87
- const TRANSLATIONS = {
88
- initializing: { en: "Initializing...", nl: "Laden...", fr: "Chargement..." },
89
- errorDashboard: {
90
- en: "Oops, we could not load this dashboard!",
91
- nl: "Oeps, we konden het dashboard niet laden.",
92
- fr: "Le chargement a echoué."
93
- },
94
- errorItem: {
95
- en: "Oops, we could not load this item!",
96
- nl: "Oeps, we konden de grafiek niet laden.",
97
- fr: "Le chargement a echoué."
98
- }
99
- };
100
- const addTrailingSlash = (serverUrl) => {
101
- if (!serverUrl) {
102
- return "";
103
- }
104
- return serverUrl.endsWith("/") ? serverUrl : `${serverUrl}/`;
105
- };
106
- const removeTrailingSlash = (serverUrl) => {
107
- if (!serverUrl) {
108
- return "";
109
- }
110
- return serverUrl.endsWith("/") ? serverUrl.slice(0, -1) : serverUrl;
111
- };
112
- const formatDashboardList = (dashboards, integrationId, user, dashboardComponent) => {
113
- var _a2;
114
- const combineRights = (securable, user2) => {
115
- var _a3;
116
- const matchingUser = securable.users.find((u2) => u2.id === user2.id);
117
- const securableAccessRights = matchingUser && matchingUser.userAccessRight ? {
118
- flagRead: matchingUser.userAccessRight.flagRead,
119
- flagUse: matchingUser.userAccessRight.flagUse,
120
- flagModify: matchingUser.userAccessRight.flagModify,
121
- flagOwn: matchingUser.userAccessRight.flagOwn
122
- } : {
123
- flagRead: false,
124
- flagUse: false,
125
- flagModify: false,
126
- flagOwn: false
127
- };
128
- const groups = securable.groups.filter(
129
- (group) => user2.userGroups.includes(group.id) || group.public === true
130
- );
131
- const groupsAccess = groups.map((group) => {
132
- if (group.groupAccessRight) {
133
- return group.groupAccessRight;
134
- }
135
- });
136
- for (const groupAccess of groupsAccess) {
137
- if (!securableAccessRights.flagRead && groupAccess.flagRead) {
138
- securableAccessRights.flagRead = groupAccess.flagRead;
139
- }
140
- if (!securableAccessRights.flagUse && groupAccess.flagUse) {
141
- securableAccessRights.flagUse = groupAccess.flagUse;
142
- }
143
- if (!securableAccessRights.flagModify && groupAccess.flagModify) {
144
- securableAccessRights.flagModify = groupAccess.flagModify;
145
- }
146
- if (!securableAccessRights.flagOwn && groupAccess.flagOwn) {
147
- securableAccessRights.flagOwn = groupAccess.flagOwn;
148
- }
149
- }
150
- const integrationsAccess = ((_a3 = securable.integrations) == null ? void 0 : _a3.length) > 0 ? securable.integrations.map((integration) => {
151
- if (integration.integrationAccessRight) {
152
- return integration.integrationAccessRight;
153
- }
154
- }) : [];
155
- for (const integrationAccess of integrationsAccess) {
156
- if (!securableAccessRights.flagRead && integrationAccess.flagRead) {
157
- securableAccessRights.flagRead = integrationAccess.flagRead;
158
- }
159
- if (!securableAccessRights.flagUse && integrationAccess.flagUse) {
160
- securableAccessRights.flagUse = integrationAccess.flagUse;
161
- }
162
- if (!securableAccessRights.flagModify && integrationAccess.flagModify) {
163
- securableAccessRights.flagModify = integrationAccess.flagModify;
164
- }
165
- }
166
- return securableAccessRights;
167
- };
168
- const localize = (item, locale) => {
169
- if (item === null || item === void 0) {
170
- return "";
171
- }
172
- if (typeof item !== "object" || Object.keys(item).length === 0) {
173
- if (typeof item === "object" && Object.keys(item).length === 0) {
174
- return "";
175
- }
176
- return item;
177
- }
178
- let localizedItem;
179
- localizedItem = locale && item[locale] ? item[locale] : item[Object.keys(item)[0]];
180
- if (localizedItem === void 0 || localizedItem === null) {
181
- localizedItem = "";
182
- }
183
- return localizedItem;
184
- };
185
- const treatedDashboards = [];
186
- for (const dashboard of dashboards) {
187
- const treatedDashboard = {
188
- accessibleBy: [],
189
- accessRights: combineRights(dashboard, user),
190
- id: dashboard.id,
191
- modifiedAt: dashboard.modified_at,
192
- name: localize(dashboard.name, dashboardComponent.language),
193
- slug: null,
194
- tags: dashboard.tags.map((t2) => t2.tag).sort((t1, t2) => t1.localeCompare(t2))
195
- };
196
- const currentIntegration = dashboard.integrations.find(
197
- (i2) => i2.id === integrationId
198
- );
199
- if ((_a2 = currentIntegration == null ? void 0 : currentIntegration.integrationAccessRight) == null ? void 0 : _a2.slug) {
200
- treatedDashboard.slug = currentIntegration.integrationAccessRight.slug;
201
- }
202
- const users = dashboard.users.map((u2) => ({
203
- model: "User",
204
- id: u2.id,
205
- name: localize(u2.name, user.locale_id)
206
- }));
207
- const groups = dashboard.groups.map((g2) => ({
208
- model: "Group",
209
- id: g2.id,
210
- name: localize(g2.name, user.locale_id) || {}
211
- }));
212
- const integrations = dashboard.integrations.map((i2) => ({
213
- model: "Integration",
214
- id: i2.id,
215
- name: localize(i2.name, user.locale_id) || {}
216
- }));
217
- treatedDashboard.accessibleBy = [...users, ...groups, ...integrations];
218
- treatedDashboards.push(treatedDashboard);
219
- }
220
- return treatedDashboards;
221
- };
222
- const VERSION = "0.0.0-shared-luzmo";
223
- const sanitizeUrl = (url) => {
224
- const invalidPrototcolRegex = /^(%20|\s)*(javascript|data)/im;
225
- const ctrlCharactersRegex = /[^\u0020-\u007E]/gim;
226
- const urlSchemeRegex = /^([^:]+):/gm;
227
- const relativeFirstCharacters = /* @__PURE__ */ new Set([".", "/"]);
228
- const isRelativeUrlWithoutProtocol = (relativeUrl) => relativeFirstCharacters.has(relativeUrl[0]);
229
- if (!url) {
230
- return "about:blank";
231
- }
232
- const sanitizedUrl = url.replaceAll(ctrlCharactersRegex, "").trim();
233
- if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {
234
- return sanitizedUrl;
235
- }
236
- const urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex);
237
- if (!urlSchemeParseResults) {
238
- return sanitizedUrl;
239
- }
240
- const urlScheme = urlSchemeParseResults[0];
241
- if (invalidPrototcolRegex.test(urlScheme)) {
242
- return "about:blank";
243
- }
244
- return sanitizedUrl;
245
- };
246
- const cloneDeep = (obj) => JSON.parse(JSON.stringify(obj));
247
- const isObject = (o2) => o2 && typeof o2 === "object";
248
- const defaultsDeep = (target, defaults) => {
249
- Object.entries(defaults).forEach(([k2, v2]) => {
250
- if (k2 in target) {
251
- if (target[k2] === void 0) {
252
- target[k2] = v2;
253
- } else {
254
- target[k2] = isObject(v2) ? defaultsDeep(
255
- target[k2],
256
- v2
257
- ) : target[k2];
258
- }
259
- } else {
260
- target[k2] = v2;
261
- }
262
- });
263
- return target;
264
- };
265
- const uuidv4 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g, function(c2) {
266
- const r2 = Math.random() * 16 | 0;
267
- const v2 = c2 == "x" ? r2 : r2 & 3 | 8;
268
- return v2.toString(16);
269
- });
270
- const createIframeUrl = (dashboardContent) => {
271
- const searchString = [];
272
- const {
273
- appServer,
274
- language,
275
- qeVersion,
276
- loaderBackground,
277
- loaderSpinnerColor,
278
- loaderSpinnerBackground,
279
- loaderFontColor,
280
- screenMode,
281
- key,
282
- token,
283
- timezoneId,
284
- itemEmbedding,
285
- itemDimensions,
286
- dashboardId,
287
- dashboardSlug,
288
- itemId,
289
- mainColor,
290
- accentColor,
291
- editMode
292
- } = dashboardContent.params;
293
- if (language && language !== "auto") {
294
- searchString.push("language=" + language);
295
- }
296
- if (qeVersion) {
297
- searchString.push(`qe_version=${qeVersion}`);
298
- }
299
- if (loaderBackground) {
300
- searchString.push(`ldrbg=${loaderBackground}`);
301
- }
302
- if (loaderFontColor) {
303
- searchString.push(`ldrftclr=${loaderFontColor}`);
304
- }
305
- if (loaderSpinnerColor) {
306
- searchString.push(`ldrspclr=${loaderSpinnerColor}`);
307
- }
308
- if (loaderSpinnerBackground) {
309
- searchString.push(`ldrspbg=${loaderSpinnerBackground}`);
310
- }
311
- if (mainColor) {
312
- searchString.push(`mainColor=${mainColor}`);
313
- }
314
- if (accentColor) {
315
- searchString.push(`accentColor=${accentColor}`);
316
- }
317
- if (screenMode && screenMode !== "auto") {
318
- searchString.push("screenMode=" + screenMode);
319
- }
320
- if (timezoneId) {
321
- searchString.push("timezoneId=" + timezoneId);
322
- }
323
- if (itemEmbedding && itemDimensions && itemDimensions.width) {
324
- searchString.push("width=" + itemDimensions.width);
325
- }
326
- if (itemEmbedding && itemDimensions && itemDimensions.height) {
327
- searchString.push("height=" + itemDimensions.height);
328
- }
329
- if (editMode) {
330
- searchString.push("editMode=" + editMode);
331
- }
332
- const keyTokenUrlAnchor = key && token ? "#" + key + ":" + token : "";
333
- searchString.push("version=" + (dashboardContent.VERSION || VERSION));
334
- const iframeUrl = itemEmbedding ? `${appServer}i/${dashboardId || dashboardSlug}/${itemId}?${encodeURIComponent(
335
- searchString.join("&")
336
- )}${keyTokenUrlAnchor}` : `${appServer}i/${dashboardId || dashboardSlug}?${encodeURIComponent(
337
- searchString.join("&")
338
- )}${keyTokenUrlAnchor}`;
339
- return sanitizeUrl(iframeUrl);
340
- };
341
- const getLoader = (dashboardComponent) => {
342
- let errorMsg;
343
- if (dashboardComponent.params.error || dashboardComponent.browserNotSupported.length > 0) {
344
- dashboardComponent.params.error = true;
345
- if (dashboardComponent.browserNotSupported) {
346
- errorMsg = "Browser is not supported.";
347
- }
348
- }
349
- const loadingMsg = TRANSLATIONS.initializing[dashboardComponent.params.language] || TRANSLATIONS.initializing.en;
350
- return dashboardComponent.browserNotSupported || dashboardComponent.params.error ? { loadingMsg, errorMsg } : { loadingMsg, errorMsg: "" };
351
- };
352
- function resolvePromise(dashboardComponent, requestId, data) {
353
- if (dashboardComponent.promises[requestId]) {
354
- dashboardComponent.promises[requestId].resolve(data);
355
- delete dashboardComponent.promises[requestId];
356
- }
357
- }
358
- function rejectPromise(dashboardComponent, requestId, data) {
359
- if (dashboardComponent.promises[requestId]) {
360
- dashboardComponent.promises[requestId].reject(data);
361
- delete dashboardComponent.promises[requestId];
362
- }
363
- }
364
- function containerStyles(dashboardComponent) {
365
- const styles = {
366
- width: "100%",
367
- height: "100%"
368
- };
369
- if (dashboardComponent.params.loaderBackground && !dashboardComponent.iframeLoaded) {
370
- styles.background = dashboardComponent.params.loaderBackground;
371
- }
372
- return styles;
373
- }
374
- function containerLoaderStyles(dashboardComponent) {
375
- var _a2;
376
- const height = ((_a2 = dashboardComponent.params.itemDimensions) == null ? void 0 : _a2.height) || DEFAULT_PARAMETERS.itemDimensions.height;
377
- const chartHeightDefined = dashboardComponent.params.itemEmbedding && height !== "auto";
378
- const display = dashboardComponent.iframeLoaded ? "none" : "";
379
- return {
380
- display,
381
- height: `${chartHeightDefined ? height : dashboardComponent.minHeight}px`
382
- };
383
- }
384
- function loaderStyles(dashboardComponent) {
385
- var _a2, _b;
386
- const background = dashboardComponent.params.loaderBackground || DEFAULT_PARAMETERS.loaderBackground;
387
- if (dashboardComponent.params.itemEmbedding) {
388
- dashboardComponent.loaderSize = 24;
389
- dashboardComponent.borderWidth = 4;
390
- dashboardComponent.minHeight = 200;
391
- const width = ((_a2 = dashboardComponent.params.itemDimensions) == null ? void 0 : _a2.width) || DEFAULT_PARAMETERS.itemDimensions.width;
392
- const height = ((_b = dashboardComponent.params.itemDimensions) == null ? void 0 : _b.height) || DEFAULT_PARAMETERS.itemDimensions.height;
393
- const chartWidthDefined = width !== "auto";
394
- const chartHeightDefined = height !== "auto";
395
- return {
396
- background,
397
- width: chartWidthDefined ? `${width}px` : "100%",
398
- height: `${chartHeightDefined ? height : "200"}px`,
399
- "min-height": chartHeightDefined ? "" : "200px"
400
- };
401
- }
402
- return {
403
- background
404
- };
405
- }
406
- function plStyles(dashboardComponent) {
407
- const {
408
- loaderSpinnerColor: defaultSpinnerColor,
409
- loaderSpinnerBackground: defaultSpinnerBackground
410
- } = DEFAULT_PARAMETERS;
411
- const spinnerColorBorder = generateBorderStyle(
412
- dashboardComponent.borderWidth,
413
- dashboardComponent.params.loaderSpinnerColor || defaultSpinnerColor
414
- );
415
- const spinnerBackgroundBorder = generateBorderStyle(
416
- dashboardComponent.borderWidth,
417
- dashboardComponent.params.loaderSpinnerBackground || defaultSpinnerBackground
418
- );
419
- const size = `${dashboardComponent.loaderSize}px`;
420
- return {
421
- "border-top": spinnerColorBorder,
422
- "border-right": spinnerColorBorder,
423
- "border-bottom": spinnerBackgroundBorder,
424
- "border-left": spinnerBackgroundBorder,
425
- width: size,
426
- height: size
427
- };
428
- }
429
- function lcStyles(dashboardComponent) {
430
- var _a2;
431
- const height = ((_a2 = dashboardComponent.params.itemDimensions) == null ? void 0 : _a2.height) || DEFAULT_PARAMETERS.itemDimensions.height;
432
- const chartHeightDefined = dashboardComponent.params.itemEmbedding && height !== "auto";
433
- const getPaddingStr = (value) => `${(value - dashboardComponent.loaderSize - 32) / 2}px`;
434
- const verticalPadding = dashboardComponent.params.itemId ? chartHeightDefined ? getPaddingStr(Number.parseInt(`${height}`, 10)) : getPaddingStr(dashboardComponent.minHeight) : "128px";
435
- return {
436
- padding: `${verticalPadding} 16px`
437
- };
438
- }
439
- function calculateIframeStyles(dashboardComponent) {
440
- var _a2, _b;
441
- const height = ((_a2 = dashboardComponent.params.itemDimensions) == null ? void 0 : _a2.height) || DEFAULT_PARAMETERS.itemDimensions.height;
442
- const width = ((_b = dashboardComponent.params.itemDimensions) == null ? void 0 : _b.width) || DEFAULT_PARAMETERS.itemDimensions.width;
443
- if (dashboardComponent.params.itemEmbedding && height !== "auto") {
444
- dashboardComponent.iframeHeight = `${height}px`;
445
- } else if (dashboardComponent.params.itemEmbedding) {
446
- dashboardComponent.iframeHeight = "200px";
447
- } else if (["editFull", "editLimited"].includes(dashboardComponent.params.editMode)) {
448
- dashboardComponent.iframeHeight = "100%";
449
- } else {
450
- dashboardComponent.iframeHeight = "400px";
451
- }
452
- dashboardComponent.iframeWidth = dashboardComponent.params.itemEmbedding && width !== "auto" ? `${width}px` : "100%";
453
- const styles = {
454
- height: dashboardComponent.iframeHeight,
455
- width: dashboardComponent.iframeWidth
456
- };
457
- if (dashboardComponent.iframeLoaded) {
458
- styles.opacity = 1;
459
- } else if (dashboardComponent.error) {
460
- styles.opacity = 1;
461
- styles.width = "100%";
462
- styles.height = "400px";
463
- } else {
464
- styles.opacity = 0;
465
- }
466
- return styles;
467
- }
468
- function generateBorderStyle(borderWidth, color) {
469
- return `${borderWidth}px solid ${color}`;
470
- }
471
- const updateIframeUrl = (iframe, iframeUrl) => {
472
- if (iframe == null ? void 0 : iframe.contentWindow) {
473
- iframe.contentWindow.location.replace(iframeUrl);
474
- }
475
- };
476
- const remotesMap = {
477
- // "remote_app": { url: "http://localhost:4201/remoteEntry.mjs", format: "esm", from: "vite" },
478
- };
479
- const loadJS = async (url, fn) => {
480
- const resolvedUrl = typeof url === "function" ? await url() : url;
481
- const script = document.createElement("script");
482
- script.type = "text/javascript";
483
- script.onload = fn;
484
- script.src = resolvedUrl;
485
- document.getElementsByTagName("head")[0].appendChild(script);
486
- };
487
- const wrapShareModule = (remoteFrom) => {
488
- return {};
489
- };
490
- async function __federation_method_ensure(remoteId) {
491
- const remote = remotesMap[remoteId];
492
- if (!remote.inited) {
493
- if ("var" === remote.format) {
494
- return new Promise((resolve) => {
495
- const callback = () => {
496
- if (!remote.inited) {
497
- remote.lib = window[remoteId];
498
- remote.lib.init(wrapShareModule(remote.from));
499
- remote.inited = true;
500
- }
501
- resolve(remote.lib);
502
- };
503
- return loadJS(remote.url, callback);
504
- });
505
- } else if (["esm", "systemjs"].includes(remote.format)) {
506
- return new Promise((resolve, reject) => {
507
- const getUrl = typeof remote.url === "function" ? remote.url : () => Promise.resolve(remote.url);
508
- getUrl().then((url) => {
509
- import(
510
- /* @vite-ignore */
511
- url
512
- ).then((lib) => {
513
- if (!remote.inited) {
514
- const shareScope = wrapShareModule(remote.from);
515
- lib.init(shareScope);
516
- remote.lib = lib;
517
- remote.lib.init(shareScope);
518
- remote.inited = true;
519
- }
520
- resolve(remote.lib);
521
- }).catch(reject);
522
- });
523
- });
524
- }
525
- } else {
526
- return remote.lib;
527
- }
528
- }
529
- function __federation_method_wrapDefault(module2, need) {
530
- if (!(module2 == null ? void 0 : module2.default) && need) {
531
- let obj = /* @__PURE__ */ Object.create(null);
532
- obj.default = module2;
533
- obj.__esModule = true;
534
- return obj;
535
- }
536
- return module2;
537
- }
538
- function __federation_method_getRemote(remoteName, componentName) {
539
- return __federation_method_ensure(remoteName).then((remote) => remote.get(componentName).then((factory) => factory()));
540
- }
541
- const exportDashboard = (dashboardComponent, iframe, format) => {
542
- const requestId = uuidv4();
543
- if (iframe == null ? void 0 : iframe.contentWindow) {
544
- iframe.contentWindow.postMessage(
545
- {
546
- action: "exportDashboard",
547
- format: format || "png",
548
- _version: dashboardComponent.VERSION,
549
- requestId
550
- },
551
- "*"
552
- );
553
- return new Promise((resolve, reject) => {
554
- dashboardComponent.promises[requestId] = { resolve, reject };
555
- setTimeout(() => {
556
- if (dashboardComponent.promises[requestId]) {
557
- const errorMessage = "exportDashboard request timed out.";
558
- dashboardComponent.promises[requestId].reject(
559
- new Error(errorMessage)
560
- );
561
- delete dashboardComponent.promises[requestId];
562
- }
563
- }, 12e5);
564
- });
565
- }
566
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
567
- };
568
- const getAccessibleDashboards = (dashboardComponent, iframe) => {
569
- if ((dashboardComponent.dashboardId || dashboardComponent.dashboardSlug) && (iframe == null ? void 0 : iframe.contentWindow)) {
570
- const requestId = uuidv4();
571
- iframe.contentWindow.postMessage(
572
- {
573
- action: "getAccessibleDashboards",
574
- _version: dashboardComponent.VERSION,
575
- requestId
576
- },
577
- "*"
578
- );
579
- return new Promise((resolve, reject) => {
580
- dashboardComponent.promises[requestId] = { resolve, reject };
581
- setTimeout(() => {
582
- if (dashboardComponent.promises[requestId]) {
583
- const errorMessage = "getAccessibleDashboards request timed out.";
584
- dashboardComponent.promises[requestId].reject(
585
- new Error(errorMessage)
586
- );
587
- delete dashboardComponent.promises[requestId];
588
- }
589
- }, 2e3);
590
- });
591
- }
592
- const fetchUser = new Promise((resolve, reject) => {
593
- void (() => {
594
- try {
595
- const responsePromise = window.fetch(
596
- `${String(dashboardComponent.params.apiHost)}0.1.0/authorization`,
597
- {
598
- method: "POST",
599
- mode: "cors",
600
- cache: "no-cache",
601
- headers: { "Content-Type": "application/json" },
602
- redirect: "follow",
603
- body: JSON.stringify({
604
- action: "get",
605
- version: "0.1.0",
606
- key: dashboardComponent.authKey,
607
- token: dashboardComponent.authToken,
608
- find: {
609
- where: { id: dashboardComponent.authKey },
610
- attributes: ["id", "integration_id"],
611
- include: [
612
- {
613
- model: "User",
614
- attributes: ["id", "name", "locale_id"],
615
- include: [{ model: "Group" }]
616
- }
617
- ]
618
- }
619
- })
620
- }
621
- );
622
- responsePromise.then((response) => response.json()).then((data) => {
623
- if (!data || !data.rows || data.rows.length === 0 || !data.rows[0].user || !data.rows[0].integration_id) {
624
- reject();
625
- } else {
626
- data.rows[0].user.userGroups = data.rows[0].user.groups.map(
627
- (group) => group.id
628
- );
629
- delete data.rows[0].user.groups;
630
- resolve({
631
- integrationId: data.rows[0].integration_id,
632
- user: data.rows[0].user
633
- });
634
- }
635
- });
636
- } catch (error) {
637
- reject(error);
638
- }
639
- })();
640
- });
641
- return new Promise((resolve, reject) => void (() => {
642
- try {
643
- fetchUser.then((authorizationData) => {
644
- const responsePromise = window.fetch(
645
- `${String(dashboardComponent.params.apiHost)}0.1.0/securable`,
646
- {
647
- method: "POST",
648
- mode: "cors",
649
- cache: "no-cache",
650
- headers: { "Content-Type": "application/json" },
651
- redirect: "follow",
652
- body: JSON.stringify({
653
- action: "get",
654
- version: "0.1.0",
655
- key: dashboardComponent.authKey,
656
- token: dashboardComponent.authToken,
657
- find: {
658
- where: { type: "dashboard", is_variant: false },
659
- attributes: ["id", "name", "modified_at"],
660
- order: [["modified_at", "desc"]],
661
- include: [
662
- { model: "Tag", attributes: ["tag"] },
663
- { model: "User", attributes: ["id", "name"] },
664
- {
665
- model: "Group",
666
- attributes: ["id", "name", "public"]
667
- },
668
- { model: "Integration", attributes: ["id", "name"] }
669
- ]
670
- }
671
- })
672
- }
673
- );
674
- responsePromise.then((response) => response.json()).then((data) => {
675
- const dashboardList = data.rows.length > 0 ? formatDashboardList(
676
- data.rows,
677
- authorizationData.integrationId,
678
- authorizationData.user,
679
- dashboardComponent
680
- ) : [];
681
- resolve(dashboardList);
682
- });
683
- }).catch((error) => {
684
- reject(error);
685
- });
686
- } catch (error) {
687
- reject(error);
688
- }
689
- })());
690
- };
691
- const getData = (dashboardComponent, iframe, itemId) => {
692
- if (iframe == null ? void 0 : iframe.contentWindow) {
693
- const requestId = uuidv4();
694
- iframe.contentWindow.postMessage(
695
- {
696
- action: "getData",
697
- id: itemId,
698
- _version: dashboardComponent.VERSION,
699
- requestId
700
- },
701
- "*"
702
- );
703
- return new Promise((resolve, reject) => {
704
- dashboardComponent.promises[requestId] = { resolve, reject };
705
- setTimeout(() => {
706
- if (dashboardComponent.promises[requestId]) {
707
- const errorMessage = "getData request timed out.";
708
- dashboardComponent.promises[requestId].reject(
709
- new Error(errorMessage)
710
- );
711
- delete dashboardComponent.promises[requestId];
712
- }
713
- }, 2e3);
714
- });
715
- }
716
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
717
- };
718
- const getFilters = (dashboardComponent, iframe) => {
719
- if (iframe == null ? void 0 : iframe.contentWindow) {
720
- const requestId = uuidv4();
721
- iframe.contentWindow.postMessage(
722
- { action: "getFilters", _version: dashboardComponent.VERSION, requestId },
723
- "*"
724
- );
725
- return new Promise((resolve, reject) => {
726
- dashboardComponent.promises[requestId] = { resolve, reject };
727
- setTimeout(() => {
728
- if (dashboardComponent.promises[requestId]) {
729
- const errorMessage = "getFilters request timed out.";
730
- dashboardComponent.promises[requestId].reject(
731
- new Error(errorMessage)
732
- );
733
- delete dashboardComponent.promises[requestId];
734
- }
735
- }, 2e3);
736
- });
737
- }
738
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
739
- };
740
- const refreshData = (dashboardComponent, iframe, itemId) => {
741
- if (iframe) {
742
- iframe.contentWindow.postMessage(
743
- {
744
- action: "refreshData",
745
- id: itemId ?? null,
746
- _version: dashboardComponent.VERSION
747
- },
748
- "*"
749
- );
750
- return Promise.resolve();
751
- }
752
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
753
- };
754
- const reloadDashboard = (dashboardComponent, iframe) => {
755
- if (iframe) {
756
- iframe.contentWindow.postMessage(
757
- { action: "reloadDashboard", _version: dashboardComponent.VERSION },
758
- "*"
759
- );
760
- return Promise.resolve();
761
- }
762
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
763
- };
764
- const setAuthorization = (dashboardComponent, iframe, key, token) => {
765
- if (iframe) {
766
- iframe.contentWindow.postMessage(
767
- {
768
- action: "setAuthorization",
769
- key,
770
- token,
771
- _version: dashboardComponent.VERSION
772
- },
773
- "*"
774
- );
775
- return Promise.resolve();
776
- }
777
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
778
- };
779
- const setEditMode = (dashboardComponent, iframe, editMode) => {
780
- if (iframe && iframe.contentWindow) {
781
- const requestId = uuidv4();
782
- if (dashboardComponent.params.editMode === editMode) {
783
- return Promise.reject(
784
- new Error("editMode parameter is currently already set to " + editMode)
785
- );
786
- } else if (editMode !== "editFull" && editMode !== "editLimited" && editMode !== "view") {
787
- return Promise.reject(
788
- new Error(
789
- "The editMode parameter must be one of the following values: 'editFull', 'editLimited' or 'view'."
790
- )
791
- );
792
- }
793
- iframe.contentWindow.postMessage(
794
- {
795
- action: "setEditMode",
796
- editMode,
797
- _version: dashboardComponent.VERSION,
798
- requestId
799
- },
800
- "*"
801
- );
802
- return new Promise((resolve, reject) => {
803
- dashboardComponent.promises[requestId] = { resolve, reject };
804
- });
805
- }
806
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
807
- };
808
- const setFilters = (dashboardComponent, iframe, itemId, filters) => {
809
- if (iframe) {
810
- const requestId = uuidv4();
811
- iframe.contentWindow.postMessage(
812
- {
813
- action: "setFilters",
814
- itemId,
815
- filters,
816
- _version: dashboardComponent.VERSION,
817
- requestId
818
- },
819
- "*"
820
- );
821
- return new Promise((resolve, reject) => {
822
- dashboardComponent.promises[requestId] = { resolve, reject };
823
- setTimeout(() => {
824
- if (dashboardComponent.promises[requestId]) {
825
- const errorMessage = "setFilters request timed out.";
826
- dashboardComponent.promises[requestId].reject(
827
- new Error(errorMessage)
828
- );
829
- delete dashboardComponent.promises[requestId];
830
- }
831
- }, 2e3);
832
- });
833
- }
834
- return Promise.reject();
835
- };
836
- const setPreview = (dashboardComponent, iframe, preview) => {
837
- if (iframe) {
838
- const requestId = uuidv4();
839
- iframe.contentWindow.postMessage(
840
- {
841
- action: "setPreview",
842
- preview,
843
- requestId,
844
- _version: dashboardComponent.VERSION
845
- },
846
- "*"
847
- );
848
- return new Promise((resolve, reject) => {
849
- dashboardComponent.promises[requestId] = { resolve, reject };
850
- setTimeout(() => {
851
- if (dashboardComponent.promises[requestId]) {
852
- const errorMessage = "setPreview request timed out.";
853
- dashboardComponent.promises[requestId].reject(
854
- new Error(errorMessage)
855
- );
856
- delete dashboardComponent.promises[requestId];
857
- }
858
- }, 2e3);
859
- });
860
- }
861
- return Promise.reject(new Error("Cannot retrieve contentWindow."));
862
- };
863
- const _setCalculatedDimensions = (dashboardComponent) => {
864
- var _a2, _b, _c, _d, _e, _f, _g, _h;
865
- if (!dashboardComponent.dimensions) {
866
- dashboardComponent.params.error = true;
867
- _handleError("Got no valid dimensions.", dashboardComponent.params);
868
- return;
869
- }
870
- const dashboardDimensionKeys = Object.keys(
871
- dashboardComponent.dimensions
872
- );
873
- const availableScreenModeExtents = [];
874
- let currentMode;
875
- let currentWidth = 0;
876
- let currentHeight = 0;
877
- if (!dashboardComponent.params.switchScreenModeOnResize && dashboardComponent.currentScreenMode) {
878
- dashboardComponent.params.screenMode = dashboardComponent.currentScreenMode;
879
- }
880
- if (dashboardComponent.dimensions && (dashboardDimensionKeys == null ? void 0 : dashboardDimensionKeys[0]) === "fixed") {
881
- currentMode = "fixed";
882
- currentWidth = dashboardComponent.dimensions.fixed[0];
883
- currentHeight = dashboardComponent.dimensions.fixed[1];
884
- } else {
885
- const screenModes = [
886
- "mobile",
887
- "tablet",
888
- "desktop",
889
- "largeScreen"
890
- ];
891
- if (dashboardComponent.params.itemEmbedding) {
892
- const [firstMatch] = dashboardDimensionKeys;
893
- let match = cloneDeep(firstMatch);
894
- for (const screenMode of screenModes) {
895
- const found = dashboardDimensionKeys.find((key) => key === screenMode);
896
- if (found) {
897
- match = cloneDeep(found);
898
- } else {
899
- dashboardComponent.dimensions[screenMode] = dashboardComponent.dimensions[match];
900
- }
901
- }
902
- }
903
- for (const key of dashboardDimensionKeys) {
904
- if (screenModes.includes(key)) {
905
- const screenMode = EXTENTS.find((extent) => extent.mode === key);
906
- availableScreenModeExtents.push({
907
- ...screenMode,
908
- height: dashboardComponent.dimensions[key][1] || 50
909
- });
910
- }
911
- }
912
- if (!availableScreenModeExtents.map((screenModeExtent) => screenModeExtent.mode).includes(dashboardComponent.params.screenMode)) {
913
- dashboardComponent.params.screenMode = "auto";
914
- }
915
- if (dashboardComponent.params.screenMode === "auto") {
916
- availableScreenModeExtents.sort(
917
- (a2, b2) => screenModes.indexOf(a2.mode) - screenModes.indexOf(b2.mode)
918
- );
919
- for (const screenModeExtent of availableScreenModeExtents) {
920
- const [screenModeExtentMinWidth, screenModeExtentMaxWidth] = screenModeExtent.width;
921
- if (dashboardComponent.params.itemEmbedding && dashboardComponent.params.itemDimensions && dashboardComponent.params.itemDimensions.width !== "auto" && dashboardComponent.params.itemDimensions.height === "auto") {
922
- if (screenModeExtentMinWidth < dashboardComponent.params.itemDimensions.width) {
923
- currentMode = screenModeExtent.mode;
924
- currentWidth = Number.parseInt(
925
- dashboardComponent.params.itemDimensions.width,
926
- 10
927
- );
928
- currentHeight = dashboardComponent.dimensions[currentMode][1];
929
- }
930
- } else {
931
- if (screenModeExtentMinWidth < dashboardComponent.containerWidth) {
932
- currentMode = screenModeExtent.mode;
933
- if (dashboardComponent.params.itemEmbedding) {
934
- currentWidth = ((_a2 = dashboardComponent.params.itemDimensions) == null ? void 0 : _a2.width) && ((_b = dashboardComponent.params.itemDimensions) == null ? void 0 : _b.width) !== "auto" ? Number.parseInt(
935
- dashboardComponent.params.itemDimensions.width,
936
- 10
937
- ) : Math.min(
938
- dashboardComponent.containerWidth,
939
- screenModeExtentMaxWidth
940
- );
941
- currentHeight = ((_c = dashboardComponent.params.itemDimensions) == null ? void 0 : _c.height) && ((_d = dashboardComponent.params.itemDimensions) == null ? void 0 : _d.height) !== "auto" ? Number.parseInt(
942
- dashboardComponent.params.itemDimensions.height,
943
- 10
944
- ) : dashboardComponent.dimensions[currentMode][1];
945
- if (dashboardComponent.params.itemDimensions && dashboardComponent.params.itemDimensions.width !== "auto" && dashboardComponent.params.itemDimensions.height === "auto") {
946
- currentWidth = Number.parseInt(
947
- dashboardComponent.params.itemDimensions.width,
948
- 10
949
- );
950
- currentHeight = dashboardComponent.dimensions[currentMode][1];
951
- }
952
- } else {
953
- currentWidth = Math.max(
954
- Math.min(
955
- screenModeExtentMaxWidth,
956
- dashboardComponent.containerWidth
957
- ),
958
- screenModeExtentMinWidth
959
- );
960
- currentHeight = screenModeExtent.height;
961
- }
962
- }
963
- }
964
- }
965
- } else {
966
- const {
967
- height: chosenModeHeight,
968
- width: [chosenModeMinWidth, chosenModeMaxWidth]
969
- } = availableScreenModeExtents.find(
970
- (d2) => d2.mode === dashboardComponent.params.screenMode
971
- );
972
- currentMode = dashboardComponent.params.screenMode;
973
- currentWidth = Math.max(
974
- Math.min(chosenModeMaxWidth, dashboardComponent.containerWidth),
975
- chosenModeMinWidth
976
- );
977
- currentHeight = chosenModeHeight;
978
- if (dashboardComponent.params.itemEmbedding) {
979
- if (((_e = dashboardComponent.params.itemDimensions) == null ? void 0 : _e.width) && ((_f = dashboardComponent.params.itemDimensions) == null ? void 0 : _f.width) !== "auto") {
980
- currentWidth = Number.parseInt(
981
- dashboardComponent.params.itemDimensions.width,
982
- 10
983
- );
984
- }
985
- if (((_g = dashboardComponent.params.itemDimensions) == null ? void 0 : _g.height) && ((_h = dashboardComponent.params.itemDimensions) == null ? void 0 : _h.height) !== "auto") {
986
- currentHeight = Number.parseInt(
987
- dashboardComponent.params.itemDimensions.height,
988
- 10
989
- );
990
- }
991
- }
992
- }
993
- if (!currentMode && availableScreenModeExtents.length > 0) {
994
- const [lowestModeExtent] = availableScreenModeExtents;
995
- currentMode = lowestModeExtent.mode;
996
- currentWidth = lowestModeExtent.width[0];
997
- currentHeight = lowestModeExtent.height;
998
- }
999
- }
1000
- dashboardComponent.currentScreenMode = currentMode;
1001
- const style = {
1002
- height: currentHeight === 0 ? "100%" : `${String(currentHeight)}px`,
1003
- width: currentWidth === 0 ? "100%" : `${String(currentWidth)}px`,
1004
- opacity: 1
1005
- };
1006
- const dashboardEditModes = ["editFull", "editLimited"];
1007
- if (dashboardEditModes.includes(dashboardComponent.params.editMode)) {
1008
- style.height = "100%";
1009
- style.width = "100%";
1010
- } else if (dashboardComponent.params.itemEmbedding && dashboardComponent.params.itemDimensions) {
1011
- style.height = dashboardComponent.params.itemDimensions.height === "auto" ? style.height : `${String(dashboardComponent.params.itemDimensions.height).replace(
1012
- "px",
1013
- ""
1014
- )}px`;
1015
- style.width = dashboardComponent.params.itemDimensions.width === "auto" ? style.width : `${String(dashboardComponent.params.itemDimensions.width).replace(
1016
- "px",
1017
- ""
1018
- )}px`;
1019
- } else {
1020
- style.height = currentHeight === 0 ? "100%" : `${String(currentHeight)}px`;
1021
- style.width = currentWidth === 0 ? "100%" : `${String(currentWidth)}px`;
1022
- }
1023
- dashboardComponent.currentScreenMode = currentMode;
1024
- dashboardComponent.iframeStyle = style;
1025
- };
1026
- const _extendAndValidate = (dashboardContent) => {
1027
- const defaultKeys = Object.keys(
1028
- DEFAULT_PARAMETERS
1029
- );
1030
- const errorMessages = [];
1031
- const requiredStringParams = [
1032
- "appServer",
1033
- "language",
1034
- "apiHost"
1035
- ];
1036
- const requiredStringOrEmptyParams = [
1037
- "key",
1038
- "token",
1039
- "screenMode",
1040
- "timezoneId",
1041
- "itemId",
1042
- "container",
1043
- "loaderBackground",
1044
- "loaderFontColor",
1045
- "loaderSpinnerColor",
1046
- "loaderSpinnerBackground"
1047
- ];
1048
- const objectParams = ["itemDimensions"];
1049
- const screenModes = [
1050
- "mobile",
1051
- "tablet",
1052
- "desktop",
1053
- "largeScreen",
1054
- "fixed",
1055
- "auto"
1056
- ];
1057
- for (const key of defaultKeys) {
1058
- if (dashboardContent.params[key] === null) {
1059
- delete dashboardContent.params[key];
1060
- }
1061
- }
1062
- dashboardContent.params = defaultsDeep(
1063
- dashboardContent.params,
1064
- DEFAULT_PARAMETERS
1065
- );
1066
- if ((!dashboardContent.params.dashboardId || typeof dashboardContent.params.dashboardId !== "string") && (!dashboardContent.params.dashboardSlug || typeof dashboardContent.params.dashboardSlug !== "string")) {
1067
- delete dashboardContent.params.dashboardId;
1068
- delete dashboardContent.params.dashboardSlug;
1069
- }
1070
- for (const key of requiredStringParams) {
1071
- if (typeof dashboardContent.params[key] !== "string") {
1072
- delete dashboardContent.params[key];
1073
- errorMessages.push(`${key} needs to be of type string.`);
1074
- }
1075
- }
1076
- for (const key of requiredStringOrEmptyParams) {
1077
- if (typeof dashboardContent.params[key] !== "string" && dashboardContent.params[key] !== null && dashboardContent.params[key] !== void 0) {
1078
- delete dashboardContent.params[key];
1079
- errorMessages.push(`${key} needs to be of type string or empty.`);
1080
- }
1081
- }
1082
- if (dashboardContent.params.screenMode && !screenModes.includes(dashboardContent.params.screenMode)) {
1083
- const validTypesString = screenModes.map((mode) => `"${mode}"`).join(", ");
1084
- errorMessages.push(
1085
- `"screenMode" needs should be one of these types: ${validTypesString}`
1086
- );
1087
- dashboardContent.params.screenMode = "auto";
1088
- }
1089
- if (dashboardContent.params.itemId) {
1090
- dashboardContent.params.itemEmbedding = true;
1091
- }
1092
- for (const key of objectParams) {
1093
- if (typeof dashboardContent.params[key] !== "object" && dashboardContent.params[key] !== null) {
1094
- delete dashboardContent.params[key];
1095
- errorMessages.push(`${key} needs to be of type object or empty.`);
1096
- }
1097
- }
1098
- if (typeof dashboardContent.params.switchScreenModeOnResize !== "boolean") {
1099
- errorMessages.push("switchScreenModeOnResize needs to be of type boolean.");
1100
- dashboardContent.params.switchScreenModeOnResize = true;
1101
- }
1102
- if (dashboardContent.params.itemDimensions) {
1103
- const itemDimensionsKeys = [
1104
- "width",
1105
- "height"
1106
- ];
1107
- for (const key of itemDimensionsKeys) {
1108
- if (!["string", "number"].includes(
1109
- typeof dashboardContent.params.itemDimensions[key]
1110
- ) && dashboardContent.params.itemDimensions[key] !== null) {
1111
- errorMessages.push(
1112
- `itemDimensions ${key} needs to be of type string, number or empty.`
1113
- );
1114
- }
1115
- }
1116
- }
1117
- dashboardContent.params = defaultsDeep(
1118
- dashboardContent.params,
1119
- DEFAULT_PARAMETERS
1120
- );
1121
- if (dashboardContent.params.screenMode && dashboardContent.params.screenMode !== "auto") {
1122
- dashboardContent.params.switchScreenModeOnResize = false;
1123
- }
1124
- if (dashboardContent.params.itemDimensions.width !== "auto") {
1125
- dashboardContent.params.itemDimensions.width = Number.parseInt(
1126
- `${dashboardContent.params.itemDimensions.width}`.replace("px", ""),
1127
- 10
1128
- ) || "auto";
1129
- }
1130
- if (dashboardContent.params.itemDimensions.height !== "auto") {
1131
- dashboardContent.params.itemDimensions.height = Number.parseInt(
1132
- `${dashboardContent.params.itemDimensions.height}`.replace("px", ""),
1133
- 10
1134
- ) || "auto";
1135
- }
1136
- dashboardContent.params.itemEmbedding = !!dashboardContent.params.itemId;
1137
- if (dashboardContent.params.error || errorMessages.length > 0) {
1138
- _handleError(errorMessages.join("\n"), dashboardContent.params);
1139
- }
1140
- };
1141
- /**
1142
- * @license
1143
- * Copyright 2019 Google LLC
1144
- * SPDX-License-Identifier: BSD-3-Clause
1145
- */
1146
- const t$3 = globalThis, e$5 = t$3.ShadowRoot && (void 0 === t$3.ShadyCSS || t$3.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$2 = Symbol(), o$4 = /* @__PURE__ */ new WeakMap();
1147
- let n$4 = class n {
1148
- constructor(t2, e2, o2) {
1149
- if (this._$cssResult$ = true, o2 !== s$2)
1150
- throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
1151
- this.cssText = t2, this.t = e2;
1152
- }
1153
- get styleSheet() {
1154
- let t2 = this.o;
1155
- const s2 = this.t;
1156
- if (e$5 && void 0 === t2) {
1157
- const e2 = void 0 !== s2 && 1 === s2.length;
1158
- e2 && (t2 = o$4.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && o$4.set(s2, t2));
1159
- }
1160
- return t2;
1161
- }
1162
- toString() {
1163
- return this.cssText;
1164
- }
1165
- };
1166
- const r$5 = (t2) => new n$4("string" == typeof t2 ? t2 : t2 + "", void 0, s$2), i$4 = (t2, ...e2) => {
1167
- const o2 = 1 === t2.length ? t2[0] : e2.reduce((e3, s2, o3) => e3 + ((t3) => {
1168
- if (true === t3._$cssResult$)
1169
- return t3.cssText;
1170
- if ("number" == typeof t3)
1171
- return t3;
1172
- throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
1173
- })(s2) + t2[o3 + 1], t2[0]);
1174
- return new n$4(o2, t2, s$2);
1175
- }, S$1 = (s2, o2) => {
1176
- if (e$5)
1177
- s2.adoptedStyleSheets = o2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet);
1178
- else
1179
- for (const e2 of o2) {
1180
- const o3 = document.createElement("style"), n2 = t$3.litNonce;
1181
- void 0 !== n2 && o3.setAttribute("nonce", n2), o3.textContent = e2.cssText, s2.appendChild(o3);
1182
- }
1183
- }, c$2 = e$5 ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => {
1184
- let e2 = "";
1185
- for (const s2 of t3.cssRules)
1186
- e2 += s2.cssText;
1187
- return r$5(e2);
1188
- })(t2) : t2;
1189
- /**
1190
- * @license
1191
- * Copyright 2017 Google LLC
1192
- * SPDX-License-Identifier: BSD-3-Clause
1193
- */
1194
- const { is: i$3, defineProperty: e$4, getOwnPropertyDescriptor: r$4, getOwnPropertyNames: h$1, getOwnPropertySymbols: o$3, getPrototypeOf: n$3 } = Object, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (t2, s2) => t2, u$1 = { toAttribute(t2, s2) {
1195
- switch (s2) {
1196
- case Boolean:
1197
- t2 = t2 ? l$1 : null;
1198
- break;
1199
- case Object:
1200
- case Array:
1201
- t2 = null == t2 ? t2 : JSON.stringify(t2);
1202
- }
1203
- return t2;
1204
- }, fromAttribute(t2, s2) {
1205
- let i2 = t2;
1206
- switch (s2) {
1207
- case Boolean:
1208
- i2 = null !== t2;
1209
- break;
1210
- case Number:
1211
- i2 = null === t2 ? null : Number(t2);
1212
- break;
1213
- case Object:
1214
- case Array:
1215
- try {
1216
- i2 = JSON.parse(t2);
1217
- } catch (t3) {
1218
- i2 = null;
1219
- }
1220
- }
1221
- return i2;
1222
- } }, f$1 = (t2, s2) => !i$3(t2, s2), y$1 = { attribute: true, type: String, converter: u$1, reflect: false, hasChanged: f$1 };
1223
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), a$1.litPropertyMetadata ?? (a$1.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
1224
- class b extends HTMLElement {
1225
- static addInitializer(t2) {
1226
- this._$Ei(), (this.l ?? (this.l = [])).push(t2);
1227
- }
1228
- static get observedAttributes() {
1229
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
1230
- }
1231
- static createProperty(t2, s2 = y$1) {
1232
- if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) {
1233
- const i2 = Symbol(), r2 = this.getPropertyDescriptor(t2, i2, s2);
1234
- void 0 !== r2 && e$4(this.prototype, t2, r2);
1235
- }
1236
- }
1237
- static getPropertyDescriptor(t2, s2, i2) {
1238
- const { get: e2, set: h2 } = r$4(this.prototype, t2) ?? { get() {
1239
- return this[s2];
1240
- }, set(t3) {
1241
- this[s2] = t3;
1242
- } };
1243
- return { get() {
1244
- return e2 == null ? void 0 : e2.call(this);
1245
- }, set(s3) {
1246
- const r2 = e2 == null ? void 0 : e2.call(this);
1247
- h2.call(this, s3), this.requestUpdate(t2, r2, i2);
1248
- }, configurable: true, enumerable: true };
1249
- }
1250
- static getPropertyOptions(t2) {
1251
- return this.elementProperties.get(t2) ?? y$1;
1252
- }
1253
- static _$Ei() {
1254
- if (this.hasOwnProperty(d$1("elementProperties")))
1255
- return;
1256
- const t2 = n$3(this);
1257
- t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties);
1258
- }
1259
- static finalize() {
1260
- if (this.hasOwnProperty(d$1("finalized")))
1261
- return;
1262
- if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
1263
- const t3 = this.properties, s2 = [...h$1(t3), ...o$3(t3)];
1264
- for (const i2 of s2)
1265
- this.createProperty(i2, t3[i2]);
1266
- }
1267
- const t2 = this[Symbol.metadata];
1268
- if (null !== t2) {
1269
- const s2 = litPropertyMetadata.get(t2);
1270
- if (void 0 !== s2)
1271
- for (const [t3, i2] of s2)
1272
- this.elementProperties.set(t3, i2);
1273
- }
1274
- this._$Eh = /* @__PURE__ */ new Map();
1275
- for (const [t3, s2] of this.elementProperties) {
1276
- const i2 = this._$Eu(t3, s2);
1277
- void 0 !== i2 && this._$Eh.set(i2, t3);
1278
- }
1279
- this.elementStyles = this.finalizeStyles(this.styles);
1280
- }
1281
- static finalizeStyles(s2) {
1282
- const i2 = [];
1283
- if (Array.isArray(s2)) {
1284
- const e2 = new Set(s2.flat(1 / 0).reverse());
1285
- for (const s3 of e2)
1286
- i2.unshift(c$2(s3));
1287
- } else
1288
- void 0 !== s2 && i2.push(c$2(s2));
1289
- return i2;
1290
- }
1291
- static _$Eu(t2, s2) {
1292
- const i2 = s2.attribute;
1293
- return false === i2 ? void 0 : "string" == typeof i2 ? i2 : "string" == typeof t2 ? t2.toLowerCase() : void 0;
1294
- }
1295
- constructor() {
1296
- super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
1297
- }
1298
- _$Ev() {
1299
- var _a2;
1300
- this._$Eg = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$ES(), this.requestUpdate(), (_a2 = this.constructor.l) == null ? void 0 : _a2.forEach((t2) => t2(this));
1301
- }
1302
- addController(t2) {
1303
- var _a2;
1304
- (this._$E_ ?? (this._$E_ = /* @__PURE__ */ new Set())).add(t2), void 0 !== this.renderRoot && this.isConnected && ((_a2 = t2.hostConnected) == null ? void 0 : _a2.call(t2));
1305
- }
1306
- removeController(t2) {
1307
- var _a2;
1308
- (_a2 = this._$E_) == null ? void 0 : _a2.delete(t2);
1309
- }
1310
- _$ES() {
1311
- const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties;
1312
- for (const i2 of s2.keys())
1313
- this.hasOwnProperty(i2) && (t2.set(i2, this[i2]), delete this[i2]);
1314
- t2.size > 0 && (this._$Ep = t2);
1315
- }
1316
- createRenderRoot() {
1317
- const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
1318
- return S$1(t2, this.constructor.elementStyles), t2;
1319
- }
1320
- connectedCallback() {
1321
- var _a2;
1322
- this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), (_a2 = this._$E_) == null ? void 0 : _a2.forEach((t2) => {
1323
- var _a3;
1324
- return (_a3 = t2.hostConnected) == null ? void 0 : _a3.call(t2);
1325
- });
1326
- }
1327
- enableUpdating(t2) {
1328
- }
1329
- disconnectedCallback() {
1330
- var _a2;
1331
- (_a2 = this._$E_) == null ? void 0 : _a2.forEach((t2) => {
1332
- var _a3;
1333
- return (_a3 = t2.hostDisconnected) == null ? void 0 : _a3.call(t2);
1334
- });
1335
- }
1336
- attributeChangedCallback(t2, s2, i2) {
1337
- this._$AK(t2, i2);
1338
- }
1339
- _$EO(t2, s2) {
1340
- var _a2;
1341
- const i2 = this.constructor.elementProperties.get(t2), e2 = this.constructor._$Eu(t2, i2);
1342
- if (void 0 !== e2 && true === i2.reflect) {
1343
- const r2 = (void 0 !== ((_a2 = i2.converter) == null ? void 0 : _a2.toAttribute) ? i2.converter : u$1).toAttribute(s2, i2.type);
1344
- this._$Em = t2, null == r2 ? this.removeAttribute(e2) : this.setAttribute(e2, r2), this._$Em = null;
1345
- }
1346
- }
1347
- _$AK(t2, s2) {
1348
- var _a2;
1349
- const i2 = this.constructor, e2 = i2._$Eh.get(t2);
1350
- if (void 0 !== e2 && this._$Em !== e2) {
1351
- const t3 = i2.getPropertyOptions(e2), r2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== ((_a2 = t3.converter) == null ? void 0 : _a2.fromAttribute) ? t3.converter : u$1;
1352
- this._$Em = e2, this[e2] = r2.fromAttribute(s2, t3.type), this._$Em = null;
1353
- }
1354
- }
1355
- requestUpdate(t2, s2, i2, e2 = false, r2) {
1356
- if (void 0 !== t2) {
1357
- if (i2 ?? (i2 = this.constructor.getPropertyOptions(t2)), !(i2.hasChanged ?? f$1)(e2 ? r2 : this[t2], s2))
1358
- return;
1359
- this.C(t2, s2, i2);
1360
- }
1361
- false === this.isUpdatePending && (this._$Eg = this._$EP());
1362
- }
1363
- C(t2, s2, i2) {
1364
- this._$AL.has(t2) || this._$AL.set(t2, s2), true === i2.reflect && this._$Em !== t2 && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t2);
1365
- }
1366
- async _$EP() {
1367
- this.isUpdatePending = true;
1368
- try {
1369
- await this._$Eg;
1370
- } catch (t3) {
1371
- Promise.reject(t3);
1372
- }
1373
- const t2 = this.scheduleUpdate();
1374
- return null != t2 && await t2, !this.isUpdatePending;
1375
- }
1376
- scheduleUpdate() {
1377
- return this.performUpdate();
1378
- }
1379
- performUpdate() {
1380
- var _a2;
1381
- if (!this.isUpdatePending)
1382
- return;
1383
- if (!this.hasUpdated) {
1384
- if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
1385
- for (const [t4, s3] of this._$Ep)
1386
- this[t4] = s3;
1387
- this._$Ep = void 0;
1388
- }
1389
- const t3 = this.constructor.elementProperties;
1390
- if (t3.size > 0)
1391
- for (const [s3, i2] of t3)
1392
- true !== i2.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.C(s3, this[s3], i2);
1393
- }
1394
- let t2 = false;
1395
- const s2 = this._$AL;
1396
- try {
1397
- t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), (_a2 = this._$E_) == null ? void 0 : _a2.forEach((t3) => {
1398
- var _a3;
1399
- return (_a3 = t3.hostUpdate) == null ? void 0 : _a3.call(t3);
1400
- }), this.update(s2)) : this._$ET();
1401
- } catch (s3) {
1402
- throw t2 = false, this._$ET(), s3;
1403
- }
1404
- t2 && this._$AE(s2);
1405
- }
1406
- willUpdate(t2) {
1407
- }
1408
- _$AE(t2) {
1409
- var _a2;
1410
- (_a2 = this._$E_) == null ? void 0 : _a2.forEach((t3) => {
1411
- var _a3;
1412
- return (_a3 = t3.hostUpdated) == null ? void 0 : _a3.call(t3);
1413
- }), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2);
1414
- }
1415
- _$ET() {
1416
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
1417
- }
1418
- get updateComplete() {
1419
- return this.getUpdateComplete();
1420
- }
1421
- getUpdateComplete() {
1422
- return this._$Eg;
1423
- }
1424
- shouldUpdate(t2) {
1425
- return true;
1426
- }
1427
- update(t2) {
1428
- this._$Ej && (this._$Ej = this._$Ej.forEach((t3) => this._$EO(t3, this[t3]))), this._$ET();
1429
- }
1430
- updated(t2) {
1431
- }
1432
- firstUpdated(t2) {
1433
- }
1434
- }
1435
- b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d$1("elementProperties")] = /* @__PURE__ */ new Map(), b[d$1("finalized")] = /* @__PURE__ */ new Map(), p$1 == null ? void 0 : p$1({ ReactiveElement: b }), (a$1.reactiveElementVersions ?? (a$1.reactiveElementVersions = [])).push("2.0.2");
1436
- /**
1437
- * @license
1438
- * Copyright 2017 Google LLC
1439
- * SPDX-License-Identifier: BSD-3-Clause
1440
- */
1441
- const t$2 = globalThis, i$2 = t$2.trustedTypes, s$1 = i$2 ? i$2.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, e$3 = "$lit$", h = `lit$${(Math.random() + "").slice(9)}$`, o$2 = "?" + h, n$2 = `<${o$2}>`, r$3 = document, l = () => r$3.createComment(""), c = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, a = Array.isArray, u = (t2) => a(t2) || "function" == typeof (t2 == null ? void 0 : t2[Symbol.iterator]), d = "[ \n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^
1442
- \f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), x = y(1), w = Symbol.for("lit-noChange"), T = Symbol.for("lit-nothing"), A = /* @__PURE__ */ new WeakMap(), E = r$3.createTreeWalker(r$3, 129);
1443
- function C(t2, i2) {
1444
- if (!Array.isArray(t2) || !t2.hasOwnProperty("raw"))
1445
- throw Error("invalid template strings array");
1446
- return void 0 !== s$1 ? s$1.createHTML(i2) : i2;
1447
- }
1448
- const P = (t2, i2) => {
1449
- const s2 = t2.length - 1, o2 = [];
1450
- let r2, l2 = 2 === i2 ? "<svg>" : "", c2 = f;
1451
- for (let i3 = 0; i3 < s2; i3++) {
1452
- const s3 = t2[i3];
1453
- let a2, u2, d2 = -1, y2 = 0;
1454
- for (; y2 < s3.length && (c2.lastIndex = y2, u2 = c2.exec(s3), null !== u2); )
1455
- y2 = c2.lastIndex, c2 === f ? "!--" === u2[1] ? c2 = v : void 0 !== u2[1] ? c2 = _ : void 0 !== u2[2] ? ($.test(u2[2]) && (r2 = RegExp("</" + u2[2], "g")), c2 = m) : void 0 !== u2[3] && (c2 = m) : c2 === m ? ">" === u2[0] ? (c2 = r2 ?? f, d2 = -1) : void 0 === u2[1] ? d2 = -2 : (d2 = c2.lastIndex - u2[2].length, a2 = u2[1], c2 = void 0 === u2[3] ? m : '"' === u2[3] ? g : p) : c2 === g || c2 === p ? c2 = m : c2 === v || c2 === _ ? c2 = f : (c2 = m, r2 = void 0);
1456
- const x2 = c2 === m && t2[i3 + 1].startsWith("/>") ? " " : "";
1457
- l2 += c2 === f ? s3 + n$2 : d2 >= 0 ? (o2.push(a2), s3.slice(0, d2) + e$3 + s3.slice(d2) + h + x2) : s3 + h + (-2 === d2 ? i3 : x2);
1458
- }
1459
- return [C(t2, l2 + (t2[s2] || "<?>") + (2 === i2 ? "</svg>" : "")), o2];
1460
- };
1461
- class V {
1462
- constructor({ strings: t2, _$litType$: s2 }, n2) {
1463
- let r2;
1464
- this.parts = [];
1465
- let c2 = 0, a2 = 0;
1466
- const u2 = t2.length - 1, d2 = this.parts, [f2, v2] = P(t2, s2);
1467
- if (this.el = V.createElement(f2, n2), E.currentNode = this.el.content, 2 === s2) {
1468
- const t3 = this.el.content.firstChild;
1469
- t3.replaceWith(...t3.childNodes);
1470
- }
1471
- for (; null !== (r2 = E.nextNode()) && d2.length < u2; ) {
1472
- if (1 === r2.nodeType) {
1473
- if (r2.hasAttributes())
1474
- for (const t3 of r2.getAttributeNames())
1475
- if (t3.endsWith(e$3)) {
1476
- const i2 = v2[a2++], s3 = r2.getAttribute(t3).split(h), e2 = /([.?@])?(.*)/.exec(i2);
1477
- d2.push({ type: 1, index: c2, name: e2[2], strings: s3, ctor: "." === e2[1] ? k : "?" === e2[1] ? H : "@" === e2[1] ? I : R }), r2.removeAttribute(t3);
1478
- } else
1479
- t3.startsWith(h) && (d2.push({ type: 6, index: c2 }), r2.removeAttribute(t3));
1480
- if ($.test(r2.tagName)) {
1481
- const t3 = r2.textContent.split(h), s3 = t3.length - 1;
1482
- if (s3 > 0) {
1483
- r2.textContent = i$2 ? i$2.emptyScript : "";
1484
- for (let i2 = 0; i2 < s3; i2++)
1485
- r2.append(t3[i2], l()), E.nextNode(), d2.push({ type: 2, index: ++c2 });
1486
- r2.append(t3[s3], l());
1487
- }
1488
- }
1489
- } else if (8 === r2.nodeType)
1490
- if (r2.data === o$2)
1491
- d2.push({ type: 2, index: c2 });
1492
- else {
1493
- let t3 = -1;
1494
- for (; -1 !== (t3 = r2.data.indexOf(h, t3 + 1)); )
1495
- d2.push({ type: 7, index: c2 }), t3 += h.length - 1;
1496
- }
1497
- c2++;
1498
- }
1499
- }
1500
- static createElement(t2, i2) {
1501
- const s2 = r$3.createElement("template");
1502
- return s2.innerHTML = t2, s2;
1503
- }
1504
- }
1505
- function N(t2, i2, s2 = t2, e2) {
1506
- var _a2, _b;
1507
- if (i2 === w)
1508
- return i2;
1509
- let h2 = void 0 !== e2 ? (_a2 = s2._$Co) == null ? void 0 : _a2[e2] : s2._$Cl;
1510
- const o2 = c(i2) ? void 0 : i2._$litDirective$;
1511
- return (h2 == null ? void 0 : h2.constructor) !== o2 && ((_b = h2 == null ? void 0 : h2._$AO) == null ? void 0 : _b.call(h2, false), void 0 === o2 ? h2 = void 0 : (h2 = new o2(t2), h2._$AT(t2, s2, e2)), void 0 !== e2 ? (s2._$Co ?? (s2._$Co = []))[e2] = h2 : s2._$Cl = h2), void 0 !== h2 && (i2 = N(t2, h2._$AS(t2, i2.values), h2, e2)), i2;
1512
- }
1513
- class S {
1514
- constructor(t2, i2) {
1515
- this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2;
1516
- }
1517
- get parentNode() {
1518
- return this._$AM.parentNode;
1519
- }
1520
- get _$AU() {
1521
- return this._$AM._$AU;
1522
- }
1523
- u(t2) {
1524
- const { el: { content: i2 }, parts: s2 } = this._$AD, e2 = ((t2 == null ? void 0 : t2.creationScope) ?? r$3).importNode(i2, true);
1525
- E.currentNode = e2;
1526
- let h2 = E.nextNode(), o2 = 0, n2 = 0, l2 = s2[0];
1527
- for (; void 0 !== l2; ) {
1528
- if (o2 === l2.index) {
1529
- let i3;
1530
- 2 === l2.type ? i3 = new M(h2, h2.nextSibling, this, t2) : 1 === l2.type ? i3 = new l2.ctor(h2, l2.name, l2.strings, this, t2) : 6 === l2.type && (i3 = new L(h2, this, t2)), this._$AV.push(i3), l2 = s2[++n2];
1531
- }
1532
- o2 !== (l2 == null ? void 0 : l2.index) && (h2 = E.nextNode(), o2++);
1533
- }
1534
- return E.currentNode = r$3, e2;
1535
- }
1536
- p(t2) {
1537
- let i2 = 0;
1538
- for (const s2 of this._$AV)
1539
- void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i2), i2 += s2.strings.length - 2) : s2._$AI(t2[i2])), i2++;
1540
- }
1541
- }
1542
- class M {
1543
- get _$AU() {
1544
- var _a2;
1545
- return ((_a2 = this._$AM) == null ? void 0 : _a2._$AU) ?? this._$Cv;
1546
- }
1547
- constructor(t2, i2, s2, e2) {
1548
- this.type = 2, this._$AH = T, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$Cv = (e2 == null ? void 0 : e2.isConnected) ?? true;
1549
- }
1550
- get parentNode() {
1551
- let t2 = this._$AA.parentNode;
1552
- const i2 = this._$AM;
1553
- return void 0 !== i2 && 11 === (t2 == null ? void 0 : t2.nodeType) && (t2 = i2.parentNode), t2;
1554
- }
1555
- get startNode() {
1556
- return this._$AA;
1557
- }
1558
- get endNode() {
1559
- return this._$AB;
1560
- }
1561
- _$AI(t2, i2 = this) {
1562
- t2 = N(this, t2, i2), c(t2) ? t2 === T || null == t2 || "" === t2 ? (this._$AH !== T && this._$AR(), this._$AH = T) : t2 !== this._$AH && t2 !== w && this._(t2) : void 0 !== t2._$litType$ ? this.g(t2) : void 0 !== t2.nodeType ? this.$(t2) : u(t2) ? this.T(t2) : this._(t2);
1563
- }
1564
- k(t2) {
1565
- return this._$AA.parentNode.insertBefore(t2, this._$AB);
1566
- }
1567
- $(t2) {
1568
- this._$AH !== t2 && (this._$AR(), this._$AH = this.k(t2));
1569
- }
1570
- _(t2) {
1571
- this._$AH !== T && c(this._$AH) ? this._$AA.nextSibling.data = t2 : this.$(r$3.createTextNode(t2)), this._$AH = t2;
1572
- }
1573
- g(t2) {
1574
- var _a2;
1575
- const { values: i2, _$litType$: s2 } = t2, e2 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = V.createElement(C(s2.h, s2.h[0]), this.options)), s2);
1576
- if (((_a2 = this._$AH) == null ? void 0 : _a2._$AD) === e2)
1577
- this._$AH.p(i2);
1578
- else {
1579
- const t3 = new S(e2, this), s3 = t3.u(this.options);
1580
- t3.p(i2), this.$(s3), this._$AH = t3;
1581
- }
1582
- }
1583
- _$AC(t2) {
1584
- let i2 = A.get(t2.strings);
1585
- return void 0 === i2 && A.set(t2.strings, i2 = new V(t2)), i2;
1586
- }
1587
- T(t2) {
1588
- a(this._$AH) || (this._$AH = [], this._$AR());
1589
- const i2 = this._$AH;
1590
- let s2, e2 = 0;
1591
- for (const h2 of t2)
1592
- e2 === i2.length ? i2.push(s2 = new M(this.k(l()), this.k(l()), this, this.options)) : s2 = i2[e2], s2._$AI(h2), e2++;
1593
- e2 < i2.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i2.length = e2);
1594
- }
1595
- _$AR(t2 = this._$AA.nextSibling, i2) {
1596
- var _a2;
1597
- for ((_a2 = this._$AP) == null ? void 0 : _a2.call(this, false, true, i2); t2 && t2 !== this._$AB; ) {
1598
- const i3 = t2.nextSibling;
1599
- t2.remove(), t2 = i3;
1600
- }
1601
- }
1602
- setConnected(t2) {
1603
- var _a2;
1604
- void 0 === this._$AM && (this._$Cv = t2, (_a2 = this._$AP) == null ? void 0 : _a2.call(this, t2));
1605
- }
1606
- }
1607
- class R {
1608
- get tagName() {
1609
- return this.element.tagName;
1610
- }
1611
- get _$AU() {
1612
- return this._$AM._$AU;
1613
- }
1614
- constructor(t2, i2, s2, e2, h2) {
1615
- this.type = 1, this._$AH = T, this._$AN = void 0, this.element = t2, this.name = i2, this._$AM = e2, this.options = h2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = T;
1616
- }
1617
- _$AI(t2, i2 = this, s2, e2) {
1618
- const h2 = this.strings;
1619
- let o2 = false;
1620
- if (void 0 === h2)
1621
- t2 = N(this, t2, i2, 0), o2 = !c(t2) || t2 !== this._$AH && t2 !== w, o2 && (this._$AH = t2);
1622
- else {
1623
- const e3 = t2;
1624
- let n2, r2;
1625
- for (t2 = h2[0], n2 = 0; n2 < h2.length - 1; n2++)
1626
- r2 = N(this, e3[s2 + n2], i2, n2), r2 === w && (r2 = this._$AH[n2]), o2 || (o2 = !c(r2) || r2 !== this._$AH[n2]), r2 === T ? t2 = T : t2 !== T && (t2 += (r2 ?? "") + h2[n2 + 1]), this._$AH[n2] = r2;
1627
- }
1628
- o2 && !e2 && this.O(t2);
1629
- }
1630
- O(t2) {
1631
- t2 === T ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? "");
1632
- }
1633
- }
1634
- class k extends R {
1635
- constructor() {
1636
- super(...arguments), this.type = 3;
1637
- }
1638
- O(t2) {
1639
- this.element[this.name] = t2 === T ? void 0 : t2;
1640
- }
1641
- }
1642
- class H extends R {
1643
- constructor() {
1644
- super(...arguments), this.type = 4;
1645
- }
1646
- O(t2) {
1647
- this.element.toggleAttribute(this.name, !!t2 && t2 !== T);
1648
- }
1649
- }
1650
- class I extends R {
1651
- constructor(t2, i2, s2, e2, h2) {
1652
- super(t2, i2, s2, e2, h2), this.type = 5;
1653
- }
1654
- _$AI(t2, i2 = this) {
1655
- if ((t2 = N(this, t2, i2, 0) ?? T) === w)
1656
- return;
1657
- const s2 = this._$AH, e2 = t2 === T && s2 !== T || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h2 = t2 !== T && (s2 === T || e2);
1658
- e2 && this.element.removeEventListener(this.name, this, s2), h2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2;
1659
- }
1660
- handleEvent(t2) {
1661
- var _a2;
1662
- "function" == typeof this._$AH ? this._$AH.call(((_a2 = this.options) == null ? void 0 : _a2.host) ?? this.element, t2) : this._$AH.handleEvent(t2);
1663
- }
1664
- }
1665
- class L {
1666
- constructor(t2, i2, s2) {
1667
- this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i2, this.options = s2;
1668
- }
1669
- get _$AU() {
1670
- return this._$AM._$AU;
1671
- }
1672
- _$AI(t2) {
1673
- N(this, t2);
1674
- }
1675
- }
1676
- const Z = t$2.litHtmlPolyfillSupport;
1677
- Z == null ? void 0 : Z(V, M), (t$2.litHtmlVersions ?? (t$2.litHtmlVersions = [])).push("3.1.0");
1678
- const j = (t2, i2, s2) => {
1679
- const e2 = (s2 == null ? void 0 : s2.renderBefore) ?? i2;
1680
- let h2 = e2._$litPart$;
1681
- if (void 0 === h2) {
1682
- const t3 = (s2 == null ? void 0 : s2.renderBefore) ?? null;
1683
- e2._$litPart$ = h2 = new M(i2.insertBefore(l(), t3), t3, void 0, s2 ?? {});
1684
- }
1685
- return h2._$AI(t2), h2;
1686
- };
1687
- /**
1688
- * @license
1689
- * Copyright 2017 Google LLC
1690
- * SPDX-License-Identifier: BSD-3-Clause
1691
- */
1692
- class s extends b {
1693
- constructor() {
1694
- super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
1695
- }
1696
- createRenderRoot() {
1697
- var _a2;
1698
- const t2 = super.createRenderRoot();
1699
- return (_a2 = this.renderOptions).renderBefore ?? (_a2.renderBefore = t2.firstChild), t2;
1700
- }
1701
- update(t2) {
1702
- const i2 = this.render();
1703
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = j(i2, this.renderRoot, this.renderOptions);
1704
- }
1705
- connectedCallback() {
1706
- var _a2;
1707
- super.connectedCallback(), (_a2 = this._$Do) == null ? void 0 : _a2.setConnected(true);
1708
- }
1709
- disconnectedCallback() {
1710
- var _a2;
1711
- super.disconnectedCallback(), (_a2 = this._$Do) == null ? void 0 : _a2.setConnected(false);
1712
- }
1713
- render() {
1714
- return w;
1715
- }
1716
- }
1717
- s._$litElement$ = true, s["finalized"] = true, (_a = globalThis.litElementHydrateSupport) == null ? void 0 : _a.call(globalThis, { LitElement: s });
1718
- const r$2 = globalThis.litElementPolyfillSupport;
1719
- r$2 == null ? void 0 : r$2({ LitElement: s });
1720
- (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.2");
1721
- /**
1722
- * @license
1723
- * Copyright 2017 Google LLC
1724
- * SPDX-License-Identifier: BSD-3-Clause
1725
- */
1726
- const t$1 = (t2) => (e2, o2) => {
1727
- void 0 !== o2 ? o2.addInitializer(() => {
1728
- customElements.define(t2, e2);
1729
- }) : customElements.define(t2, e2);
1730
- };
1731
- /**
1732
- * @license
1733
- * Copyright 2017 Google LLC
1734
- * SPDX-License-Identifier: BSD-3-Clause
1735
- */
1736
- const o$1 = { attribute: true, type: String, converter: u$1, reflect: false, hasChanged: f$1 }, r$1 = (t2 = o$1, e2, r2) => {
1737
- const { kind: n2, metadata: i2 } = r2;
1738
- let s2 = globalThis.litPropertyMetadata.get(i2);
1739
- if (void 0 === s2 && globalThis.litPropertyMetadata.set(i2, s2 = /* @__PURE__ */ new Map()), s2.set(r2.name, t2), "accessor" === n2) {
1740
- const { name: o2 } = r2;
1741
- return { set(r3) {
1742
- const n3 = e2.get.call(this);
1743
- e2.set.call(this, r3), this.requestUpdate(o2, n3, t2);
1744
- }, init(e3) {
1745
- return void 0 !== e3 && this.C(o2, void 0, t2), e3;
1746
- } };
1747
- }
1748
- if ("setter" === n2) {
1749
- const { name: o2 } = r2;
1750
- return function(r3) {
1751
- const n3 = this[o2];
1752
- e2.call(this, r3), this.requestUpdate(o2, n3, t2);
1753
- };
1754
- }
1755
- throw Error("Unsupported decorator location: " + n2);
1756
- };
1757
- function n$1(t2) {
1758
- return (e2, o2) => "object" == typeof o2 ? r$1(t2, e2, o2) : ((t3, e3, o3) => {
1759
- const r2 = e3.hasOwnProperty(o3);
1760
- return e3.constructor.createProperty(o3, r2 ? { ...t3, wrapped: true } : t3), r2 ? Object.getOwnPropertyDescriptor(e3, o3) : void 0;
1761
- })(t2, e2, o2);
1762
- }
1763
- /**
1764
- * @license
1765
- * Copyright 2017 Google LLC
1766
- * SPDX-License-Identifier: BSD-3-Clause
1767
- */
1768
- function r(r2) {
1769
- return n$1({ ...r2, state: true, attribute: false });
1770
- }
1771
- /**
1772
- * @license
1773
- * Copyright 2017 Google LLC
1774
- * SPDX-License-Identifier: BSD-3-Clause
1775
- */
1776
- const e$2 = (e2, t2, c2) => (c2.configurable = true, c2.enumerable = true, Reflect.decorate && "object" != typeof t2 && Object.defineProperty(e2, t2, c2), c2);
1777
- /**
1778
- * @license
1779
- * Copyright 2017 Google LLC
1780
- * SPDX-License-Identifier: BSD-3-Clause
1781
- */
1782
- function e$1(e2, r2) {
1783
- return (n2, s2, i2) => {
1784
- const o2 = (t2) => {
1785
- var _a2;
1786
- return ((_a2 = t2.renderRoot) == null ? void 0 : _a2.querySelector(e2)) ?? null;
1787
- };
1788
- if (r2) {
1789
- const { get: e3, set: r3 } = "object" == typeof s2 ? n2 : i2 ?? (() => {
1790
- const t2 = Symbol();
1791
- return { get() {
1792
- return this[t2];
1793
- }, set(e4) {
1794
- this[t2] = e4;
1795
- } };
1796
- })();
1797
- return e$2(n2, s2, { get() {
1798
- let t2 = e3.call(this);
1799
- return void 0 === t2 && (t2 = o2(this), (null !== t2 || this.hasUpdated) && r3.call(this, t2)), t2;
1800
- } });
1801
- }
1802
- return e$2(n2, s2, { get() {
1803
- return o2(this);
1804
- } });
1805
- };
1806
- }
1807
- /**
1808
- * @license
1809
- * Copyright 2017 Google LLC
1810
- * SPDX-License-Identifier: BSD-3-Clause
1811
- */
1812
- const t = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, e = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 });
1813
- let i$1 = class i {
1814
- constructor(t2) {
1815
- }
1816
- get _$AU() {
1817
- return this._$AM._$AU;
1818
- }
1819
- _$AT(t2, e2, i2) {
1820
- this._$Ct = t2, this._$AM = e2, this._$Ci = i2;
1821
- }
1822
- _$AS(t2, e2) {
1823
- return this.update(t2, e2);
1824
- }
1825
- update(t2, e2) {
1826
- return this.render(...e2);
1827
- }
1828
- };
1829
- /**
1830
- * @license
1831
- * Copyright 2018 Google LLC
1832
- * SPDX-License-Identifier: BSD-3-Clause
1833
- */
1834
- const n = "important", i = " !" + n, o = e(class extends i$1 {
1835
- constructor(t$12) {
1836
- var _a2;
1837
- if (super(t$12), t$12.type !== t.ATTRIBUTE || "style" !== t$12.name || ((_a2 = t$12.strings) == null ? void 0 : _a2.length) > 2)
1838
- throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
1839
- }
1840
- render(t2) {
1841
- return Object.keys(t2).reduce((e2, r2) => {
1842
- const s2 = t2[r2];
1843
- return null == s2 ? e2 : e2 + `${r2 = r2.includes("-") ? r2 : r2.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s2};`;
1844
- }, "");
1845
- }
1846
- update(e2, [r2]) {
1847
- const { style: s2 } = e2.element;
1848
- if (void 0 === this.ut)
1849
- return this.ut = new Set(Object.keys(r2)), this.render(r2);
1850
- for (const t2 of this.ut)
1851
- null == r2[t2] && (this.ut.delete(t2), t2.includes("-") ? s2.removeProperty(t2) : s2[t2] = null);
1852
- for (const t2 in r2) {
1853
- const e3 = r2[t2];
1854
- if (null != e3) {
1855
- this.ut.add(t2);
1856
- const r3 = "string" == typeof e3 && e3.endsWith(i);
1857
- t2.includes("-") || r3 ? s2.setProperty(t2, r3 ? e3.slice(0, -11) : e3, r3 ? n : "") : s2[t2] = e3;
1858
- }
1859
- }
1860
- return w;
1861
- }
1862
- });
1863
- const version = "5.0.3";
1864
- class LuzmoService {
1865
- constructor() {
1866
- this._components = [];
1867
- }
1868
- }
1869
- const LuzmoService$1 = new LuzmoService();
1870
- const _setEventHandler = () => {
1871
- if (typeof window.__luzmoMessageHandler === "function") {
1872
- return;
1873
- }
1874
- window.__luzmoMessageHandler = (event) => {
1875
- var _a2;
1876
- const dashboardComponent = LuzmoService$1._components.find(
1877
- (c2) => event.data.name === c2._iframeId
1878
- );
1879
- if (!dashboardComponent) {
1880
- return;
1881
- }
1882
- switch ((_a2 = event.data) == null ? void 0 : _a2.type) {
1883
- case "load": {
1884
- dashboardComponent.dispatchEvent(
1885
- new CustomEvent("load", { detail: { data: event.data } })
1886
- );
1887
- if (dashboardComponent._loadTimeoutHandle) {
1888
- clearTimeout(dashboardComponent._loadTimeoutHandle);
1889
- dashboardComponent._loadTimeoutHandle = void 0;
1890
- }
1891
- dashboardComponent.iframeLoaded = true;
1892
- dashboardComponent.dimensions = event.data.dimensions;
1893
- dashboardComponent._calculateDimAfterDashboardLoaded();
1894
- break;
1895
- }
1896
- case "error": {
1897
- dashboardComponent.dashboardError = true;
1898
- if (dashboardComponent._loadTimeoutHandle) {
1899
- clearTimeout(dashboardComponent._loadTimeoutHandle);
1900
- dashboardComponent._loadTimeoutHandle = void 0;
1901
- }
1902
- dashboardComponent.iframeLoaded = true;
1903
- dashboardComponent._displayError();
1904
- break;
1905
- }
1906
- case "data": {
1907
- resolvePromise(
1908
- dashboardComponent,
1909
- event.data.requestId,
1910
- event.data.data
1911
- );
1912
- break;
1913
- }
1914
- case "filters": {
1915
- resolvePromise(
1916
- dashboardComponent,
1917
- event.data.requestId,
1918
- event.data.filters
1919
- );
1920
- break;
1921
- }
1922
- case "getAccessibleDashboards": {
1923
- resolvePromise(
1924
- dashboardComponent,
1925
- event.data.requestId,
1926
- event.data.accessibleDashboards
1927
- );
1928
- break;
1929
- }
1930
- case "dashboardAction": {
1931
- dashboardComponent.dispatchEvent(
1932
- new CustomEvent("dashboardAction", { detail: { data: event.data } })
1933
- );
1934
- break;
1935
- }
1936
- case "export": {
1937
- if (event.data.error) {
1938
- rejectPromise(
1939
- dashboardComponent,
1940
- event.data.requestId,
1941
- event.data
1942
- );
1943
- } else {
1944
- dashboardComponent.dispatchEvent(
1945
- new CustomEvent("exported", { detail: { data: event.data } })
1946
- );
1947
- resolvePromise(
1948
- dashboardComponent,
1949
- event.data.requestId,
1950
- event.data
1951
- );
1952
- }
1953
- break;
1954
- }
1955
- case "changedFilters": {
1956
- dashboardComponent.dispatchEvent(
1957
- new CustomEvent("changedFilters", { detail: { data: event.data } })
1958
- );
1959
- break;
1960
- }
1961
- case "customEvent": {
1962
- dashboardComponent.dispatchEvent(
1963
- new CustomEvent("customEvent", { detail: { data: event.data } })
1964
- );
1965
- break;
1966
- }
1967
- case "chartsRendered":
1968
- case "itemsRendered": {
1969
- event.data.type = "itemsRendered";
1970
- dashboardComponent.dispatchEvent(
1971
- new CustomEvent("itemsRendered", { detail: { data: event.data } })
1972
- );
1973
- break;
1974
- }
1975
- case "setEditMode": {
1976
- if (event.data.error) {
1977
- rejectPromise(
1978
- dashboardComponent,
1979
- event.data.requestId,
1980
- event.data
1981
- );
1982
- } else {
1983
- resolvePromise(
1984
- dashboardComponent,
1985
- event.data.requestId,
1986
- event.data
1987
- );
1988
- dashboardComponent.params.editMode = event.data.editMode;
1989
- dashboardComponent._containerStyle = containerStyles(dashboardComponent);
1990
- if (dashboardComponent.dimensions) {
1991
- _setCalculatedDimensions(dashboardComponent);
1992
- }
1993
- }
1994
- break;
1995
- }
1996
- case "setFilters": {
1997
- event.data.error ? rejectPromise(
1998
- dashboardComponent,
1999
- event.data.requestId,
2000
- event.data
2001
- ) : resolvePromise(
2002
- dashboardComponent,
2003
- event.data.requestId,
2004
- event.data
2005
- );
2006
- break;
2007
- }
2008
- case "setPreview": {
2009
- event.data.error ? rejectPromise(
2010
- dashboardComponent,
2011
- event.data.requestId,
2012
- event.data
2013
- ) : resolvePromise(
2014
- dashboardComponent,
2015
- event.data.requestId,
2016
- event.data
2017
- );
2018
- break;
2019
- }
2020
- }
2021
- };
2022
- window.addEventListener("message", window.__luzmoMessageHandler, false);
2023
- };
2024
- const dashboardStyles = i$4`
2025
- @-webkit-keyframes spin {
2026
- 0% {
2027
- -webkit-transform: rotate(0deg);
2028
- transform: rotate(0deg);
2029
- }
2030
- 100% {
2031
- -webkit-transform: rotate(360deg);
2032
- transform: rotate(360deg);
2033
- }
2034
- }
2035
-
2036
- @keyframes spin {
2037
- 0% {
2038
- -webkit-transform: rotate(0deg);
2039
- transform: rotate(0deg);
2040
- }
2041
- 100% {
2042
- -webkit-transform: rotate(360deg);
2043
- transform: rotate(360deg);
2044
- }
2045
- }
2046
- :host {
2047
- position: relative;
2048
- width: 100%;
2049
- }
2050
-
2051
- .luzmo-embed-dashboard {
2052
- background: transparent;
2053
- padding: 0;
2054
- border: 0;
2055
- }
2056
-
2057
- .luzmo-container-loader {
2058
- width: 100%;
2059
- position: relative;
2060
- }
2061
-
2062
- .luzmo-lc {
2063
- margin: 0 auto;
2064
- }
2065
-
2066
- .luzmo-loading-message {
2067
- width: 100%;
2068
- height: 20px;
2069
- text-align: center;
2070
- margin-bottom: 16px;
2071
- font-family: Helvetica, Arial, sans-serif;
2072
- font-size: 14px;
2073
- }
2074
-
2075
- .luzmo-loading-circle {
2076
- box-sizing: border-box;
2077
- margin: 16px auto;
2078
- position: relative;
2079
- text-indent: -9999em;
2080
- animation: spin 0.6s infinite linear;
2081
- }
2082
-
2083
- .luzmo-loading-circle,
2084
- .luzmo-loading-circle:after {
2085
- border-radius: 50%;
2086
- width: 32px;
2087
- height: 32px;
2088
- }
2089
-
2090
- .itemEmbedding:after {
2091
- width: 24px;
2092
- height: 24px;
2093
- }
2094
-
2095
- .luzmo-error {
2096
- background: transparent;
2097
- padding: 48px 0;
2098
- margin: 0 auto;
2099
- width: 80%;
2100
- border: 0;
2101
- text-align: center;
2102
- min-height: 192px;
2103
- }
2104
-
2105
- .dashboard-error {
2106
- font-size: 30px;
2107
- background: transparent;
2108
- padding: 48px 0;
2109
- margin: 0 auto;
2110
- width: 80%;
2111
- border: 0;
2112
- text-align: center;
2113
- min-height: 192px;
2114
- }
2115
-
2116
- .luzmo-loader {
2117
- top: 0;
2118
- left: 0;
2119
- width: 100%;
2120
- min-height: 400px;
2121
- position: absolute;
2122
- transition-duration: 0.3s;
2123
- }
2124
- `;
2125
- var __defProp = Object.defineProperty;
2126
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2127
- var __decorateClass = (decorators, target, key, kind) => {
2128
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
2129
- for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
2130
- if (decorator = decorators[i2])
2131
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2132
- if (kind && result)
2133
- __defProp(target, key, result);
2134
- return result;
2135
- };
2136
- exports2.LuzmoDashboard = class LuzmoDashboard extends s {
2137
- constructor(inputParameters) {
2138
- super();
2139
- this.language = "auto";
2140
- this.screenMode = "auto";
2141
- this.switchScreenModeOnResize = true;
2142
- this.editMode = "view";
2143
- this.dev = false;
2144
- this.iframeStyle = {};
2145
- this._containerStyle = {};
2146
- this._loaderStyle = {};
2147
- this._lcStyle = {};
2148
- this._loadingCircleStyle = {};
2149
- this._containerLoaderStyle = {};
2150
- this._loaderMsg = "";
2151
- this._itemEmbedding = false;
2152
- this.browserError = false;
2153
- this.browserErrorMsg = "";
2154
- this.dashboardError = false;
2155
- this.browserNotSupported = [];
2156
- this.VERSION = version + "-wc-luzmo";
2157
- this.isLibraryLoaded = false;
2158
- this.attributesMap = {
2159
- dashboardId: "dashboard-id",
2160
- dashboardSlug: "dashboard-slug",
2161
- itemId: "item-id",
2162
- language: "language",
2163
- qeVersion: "qe-version",
2164
- screenMode: "screen-mode",
2165
- switchScreenModeOnResize: "switch-screen-mode-on-resize",
2166
- authKey: "auth-key",
2167
- authToken: "auth-token",
2168
- editMode: "edit-mode",
2169
- mainColor: "main-color",
2170
- accentColor: "accent-color",
2171
- loaderBackground: "loader-background",
2172
- loaderFontColor: "loader-font-color",
2173
- loaderSpinnerColor: "loader-spinner-color",
2174
- loaderSpinnerBackground: "loader-spinner-background",
2175
- appServer: "app-server",
2176
- apiHost: "api-host",
2177
- itemDimensions: "item-dimensions",
2178
- timezoneId: "timezone-id"
2179
- };
2180
- this.loaderSize = 32;
2181
- this.borderWidth = 3;
2182
- this.minHeight = 400;
2183
- this._containerId = uuidv4();
2184
- this._iframeId = `luzmo-dashboard-${this._containerId}`;
2185
- this.iframeLoaded = false;
2186
- this.promises = {};
2187
- this.setInputParameters(inputParameters);
2188
- this.params = this._setOptions();
2189
- this._onResize = () => {
2190
- var _a2;
2191
- if ((_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(".dashboard-container")) {
2192
- this.containerWidth = this.container.clientWidth;
2193
- if (this.params.switchScreenModeOnResize && this.params.screenMode === "auto") {
2194
- for (const d2 of EXTENTS) {
2195
- if (d2.width[0] <= window.innerWidth && window.innerWidth <= d2.width[1]) {
2196
- this.currentScreenMode = d2.mode;
2197
- }
2198
- }
2199
- }
2200
- if (this.iframeLoaded) {
2201
- this._calculateDimAfterDashboardLoaded();
2202
- }
2203
- }
2204
- };
2205
- this._resizeObserver = new ResizeObserver((entries) => {
2206
- window.requestAnimationFrame(() => {
2207
- if (!Array.isArray(entries) || entries.length === 0) {
2208
- return;
2209
- }
2210
- this._onResize();
2211
- });
2212
- });
2213
- }
2214
- loadLibrary(appServer) {
2215
- if (remotesMap[appServer]) {
2216
- return Promise.resolve(remotesMap[appServer].module);
2217
- }
2218
- remotesMap[appServer] = { url: (appServer == null ? void 0 : appServer.startsWith("http://localhost")) ? `${removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`, format: "esm", from: "vite", module: void 0 };
2219
- return __federation_method_getRemote(appServer, "./DashboardApp").then((module2) => {
2220
- const wrappedModule = __federation_method_wrapDefault(module2, true);
2221
- remotesMap[appServer].module = wrappedModule;
2222
- return wrappedModule;
2223
- });
2224
- }
2225
- setInputParameters(inputParameters) {
2226
- if (!inputParameters) {
2227
- return;
2228
- }
2229
- const params = [
2230
- "dashboardId",
2231
- "dashboardSlug",
2232
- "itemId",
2233
- "language",
2234
- "qeVersion",
2235
- "screenMode",
2236
- "switchScreenModeOnResize",
2237
- "accentColor",
2238
- "mainColor",
2239
- "authToken",
2240
- "authKey",
2241
- "editMode",
2242
- "loaderBackground",
2243
- "loaderFontColor",
2244
- "loaderSpinnerColor",
2245
- "loaderSpinnerBackground",
2246
- "timezoneId",
2247
- "itemDimensions",
2248
- "apiHost"
2249
- ];
2250
- for (const key of params) {
2251
- const value = inputParameters[key];
2252
- if (value) {
2253
- this[key] = value;
2254
- }
2255
- }
2256
- if (inputParameters.dev) {
2257
- this.dev = inputParameters.dev;
2258
- }
2259
- if (inputParameters.appServer) {
2260
- this.appServer = addTrailingSlash(inputParameters.appServer);
2261
- }
2262
- }
2263
- // Set resize event listener
2264
- connectedCallback() {
2265
- super.connectedCallback();
2266
- }
2267
- // Set resize event listener
2268
- disconnectedCallback() {
2269
- super.disconnectedCallback();
2270
- this._resizeObserver.disconnect();
2271
- for (const promiseKey of Object.keys(this.promises)) {
2272
- this.promises[promiseKey].reject(
2273
- new Error("Dashboard component was removed")
2274
- );
2275
- }
2276
- }
2277
- firstUpdated() {
2278
- var _a2;
2279
- this._loaderMsg = (_a2 = getLoader(this)) == null ? void 0 : _a2.loadingMsg;
2280
- this._loaderStyles();
2281
- LuzmoService$1._components.push(this);
2282
- this.initComponent();
2283
- }
2284
- initComponent() {
2285
- var _a2, _b;
2286
- this.params = this._setOptions();
2287
- if (this.getIsViewMode()) {
2288
- this.loadLibrary(this.params.appServer).then(async () => {
2289
- this.isLibraryLoaded = true;
2290
- await this.updateComplete;
2291
- const oldReference = this.renderRoot.querySelector("dashboard-component");
2292
- this.dashboardReference = oldReference.cloneNode(true);
2293
- oldReference.replaceWith(this.dashboardReference);
2294
- this.dashboardReference.addEventListener("load", (payload) => this.dispatchEvent(new CustomEvent("load", payload)));
2295
- this.dashboardReference.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
2296
- this.dashboardReference.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
2297
- this.dashboardReference.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
2298
- this.dashboardReference.addEventListener("dashboardAction", (payload) => this.dispatchEvent(new CustomEvent("dashboardAction", payload)));
2299
- this.dashboardReference.addEventListener("export", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
2300
- this.setAllAttributes();
2301
- });
2302
- } else {
2303
- this.containerWidth = (_a2 = this.container) == null ? void 0 : _a2.clientWidth;
2304
- _extendAndValidate(this);
2305
- _browserCheck(this);
2306
- this._setupLoader();
2307
- if (!this.params.error) {
2308
- this._loaderStyles();
2309
- _setEventHandler();
2310
- this._iframeUrl = createIframeUrl(this);
2311
- (_b = this.iframe) == null ? void 0 : _b.setAttribute("src", this._iframeUrl);
2312
- this.iframeStyle = calculateIframeStyles(this);
2313
- }
2314
- if (this.container) {
2315
- this._resizeObserver.observe(this.container);
2316
- }
2317
- }
2318
- }
2319
- setAllAttributes() {
2320
- if (this.dashboardReference) {
2321
- for (const key in this.attributesMap) {
2322
- if (!["authKey", "authToken", "apiHost"].includes(key) && this.params[key]) {
2323
- this.dashboardReference.setAttribute(this.attributesMap[key], this.params[key]);
2324
- }
2325
- if (this.params.apiHost) {
2326
- this.dashboardReference.setAttribute("api-host", removeTrailingSlash(this.params.apiHost));
2327
- }
2328
- if (this.params.key) {
2329
- this.dashboardReference.setAttribute("auth-key", this.params.key);
2330
- }
2331
- if (this.params.token) {
2332
- this.dashboardReference.setAttribute("auth-token", this.params.token);
2333
- }
2334
- }
2335
- }
2336
- }
2337
- // Reload dashboard when triggerproperty changes
2338
- updated(changedProperties) {
2339
- const triggerProperties = /* @__PURE__ */ new Set([
2340
- "dashboardId",
2341
- "dashboardSlug",
2342
- "itemId",
2343
- "language",
2344
- "qeVersion",
2345
- "editMode",
2346
- "screenMode",
2347
- "switchScreenModeOnResize",
2348
- "authToken",
2349
- "authKey",
2350
- "appServer",
2351
- "timezoneId",
2352
- "itemDimensions"
2353
- ]);
2354
- if (!this.getIsViewMode()) {
2355
- for (const [propertyName] of changedProperties.entries()) {
2356
- if (triggerProperties.has(propertyName) && propertyName !== "editMode") {
2357
- this.iframeLoaded = false;
2358
- if (this._loadTimeoutHandle) {
2359
- clearTimeout(this._loadTimeoutHandle);
2360
- }
2361
- this._loadTimeoutHandle = setTimeout(() => {
2362
- console.error(
2363
- "Failed to load dashboard, appServer is likely down or unreachable."
2364
- );
2365
- }, 15 * 1e3);
2366
- this.params = this._setOptions();
2367
- _extendAndValidate(this);
2368
- this._setupLoader();
2369
- this._loaderStyles();
2370
- this._iframeUrl = createIframeUrl(this);
2371
- if (this.iframe) {
2372
- this._updateIframeUrl();
2373
- }
2374
- this.iframeStyle = calculateIframeStyles(this);
2375
- } else if (triggerProperties.has(propertyName) && propertyName === "editMode") {
2376
- if (this.iframeLoaded) {
2377
- this.setEditMode(this.editMode);
2378
- }
2379
- this.params = this._setOptions();
2380
- }
2381
- }
2382
- } else {
2383
- if (this.dashboardReference) {
2384
- for (const [propertyName] of changedProperties.entries()) {
2385
- if (propertyName === "appSever") {
2386
- this.loadLibrary(changedProperties[propertyName]).then(async () => {
2387
- this.isLibraryLoaded = true;
2388
- await this.updateComplete;
2389
- this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
2390
- this.setAllAttributes();
2391
- });
2392
- } else if (this.attributesMap[propertyName]) {
2393
- this.dashboardReference.setAttribute(this.attributesMap[propertyName] ?? propertyName, this[propertyName]);
2394
- }
2395
- }
2396
- }
2397
- }
2398
- }
2399
- // Set params
2400
- _setOptions() {
2401
- const defaultParameters = {
2402
- dashboardId: this.dashboardId,
2403
- dashboardSlug: this.dashboardSlug
2404
- };
2405
- if (this.itemId) {
2406
- defaultParameters.itemId = this.itemId;
2407
- this._itemEmbedding = true;
2408
- } else {
2409
- this._itemEmbedding = false;
2410
- }
2411
- if (this.language) {
2412
- defaultParameters.language = this.language;
2413
- }
2414
- if (this.qeVersion) {
2415
- defaultParameters.qeVersion = this.qeVersion;
2416
- }
2417
- if (this.screenMode) {
2418
- defaultParameters.screenMode = this.screenMode;
2419
- }
2420
- defaultParameters.switchScreenModeOnResize = this.switchScreenModeOnResize;
2421
- if (this.authToken) {
2422
- defaultParameters.token = this.authToken;
2423
- }
2424
- if (this.authKey) {
2425
- defaultParameters.key = this.authKey;
2426
- }
2427
- if (this.editMode) {
2428
- defaultParameters.editMode = this.editMode;
2429
- }
2430
- if (this.mainColor) {
2431
- defaultParameters.mainColor = this.mainColor;
2432
- }
2433
- if (this.accentColor) {
2434
- defaultParameters.accentColor = this.accentColor;
2435
- }
2436
- if (this.loaderBackground) {
2437
- defaultParameters.loaderBackground = this.loaderBackground;
2438
- }
2439
- if (this.loaderFontColor) {
2440
- defaultParameters.loaderFontColor = this.loaderFontColor;
2441
- }
2442
- if (this.loaderSpinnerColor) {
2443
- defaultParameters.loaderSpinnerColor = this.loaderSpinnerColor;
2444
- }
2445
- if (this.loaderSpinnerBackground) {
2446
- defaultParameters.loaderSpinnerBackground = this.loaderSpinnerBackground;
2447
- }
2448
- if (this.timezoneId) {
2449
- defaultParameters.timezoneId = this.timezoneId;
2450
- }
2451
- if (this.itemDimensions) {
2452
- defaultParameters.itemDimensions = this.itemDimensions;
2453
- }
2454
- if (this.appServer) {
2455
- this.appServer = this.getIsViewMode() ? removeTrailingSlash(this.appServer) : addTrailingSlash(this.appServer);
2456
- defaultParameters.appServer = this.appServer;
2457
- } else {
2458
- this.appServer = addTrailingSlash(
2459
- DEFAULT_PARAMETERS.appServer
2460
- );
2461
- defaultParameters.appServer = this.appServer;
2462
- }
2463
- if (this.apiHost) {
2464
- this.apiHost = this.getIsViewMode() ? removeTrailingSlash(this.apiHost) : addTrailingSlash(this.apiHost);
2465
- defaultParameters.apiHost = this.apiHost;
2466
- } else {
2467
- this.apiHost = this.appServer.endsWith("luzmo.com/") ? this.appServer.replace("app", "api") : this.appServer;
2468
- defaultParameters.apiHost = this.apiHost;
2469
- }
2470
- return defaultParameters;
2471
- }
2472
- _updateIframeUrl() {
2473
- updateIframeUrl(this.iframe, this._iframeUrl);
2474
- }
2475
- // Setup loader / browser error
2476
- _setupLoader() {
2477
- const data = getLoader(this);
2478
- this._loaderMsg = data.loadingMsg;
2479
- if (data.errorMsg) {
2480
- this.browserError = true;
2481
- this.browserErrorMsg = data.errorMsg;
2482
- this._displayError();
2483
- }
2484
- }
2485
- _displayError() {
2486
- if (this.dashboardError) {
2487
- this._loaderStyles();
2488
- this.iframeStyle.opacity = 1;
2489
- }
2490
- if (this.browserError) {
2491
- this._containerStyle.display = "none";
2492
- }
2493
- }
2494
- _calculateDimAfterDashboardLoaded() {
2495
- this.dashboardError = false;
2496
- this._loaderStyles();
2497
- _setCalculatedDimensions(this);
2498
- }
2499
- // Set loader styles
2500
- _loaderStyles() {
2501
- this._containerStyle = containerStyles(this);
2502
- this._loaderStyle = loaderStyles(this);
2503
- this._loadingCircleStyle = plStyles(this);
2504
- this._containerLoaderStyle = containerLoaderStyles(this);
2505
- this._lcStyle = lcStyles(this);
2506
- }
2507
- static get styles() {
2508
- return [dashboardStyles];
2509
- }
2510
- render() {
2511
- let toBeRenderedHTML = x``;
2512
- const loader = x`
2513
- <div
2514
- class="luzmo-container-loader"
2515
- id="luzmo-container-loader-${this._containerId}"
2516
- style=${o(
2517
- this._containerLoaderStyle
2518
- )}
2519
- >
2520
- <div
2521
- class="luzmo-loader"
2522
- id="luzmo-loader-${this._containerId}"
2523
- style=${o(this._loaderStyle)}
2524
- >
2525
- <div
2526
- class="luzmo-lc"
2527
- style=${o(this._lcStyle)}
2528
- >
2529
- <div
2530
- class="luzmo-loading-circle"
2531
- style=${o(
2532
- this._loadingCircleStyle
2533
- )}
2534
- ></div>
2535
- ${this._itemEmbedding ? "" : x`
2536
- <div
2537
- class="luzmo-loading-message"
2538
- style=${o({ color: this.loaderFontColor })}
2539
- >
2540
- ${this._loaderMsg}
2541
- </div>
2542
- `}
2543
- </div>
2544
- </div>
2545
- </div>
2546
- `;
2547
- if (!this.getIsViewMode()) {
2548
- toBeRenderedHTML = x`
2549
- ${this.dashboardId || this.dashboardSlug ? x`
2550
- ${loader}
2551
- <iframe
2552
- class="luzmo-embed-dashboard"
2553
- id="${this._iframeId}"
2554
- name="${this._iframeId}"
2555
- style=${o(this.iframeStyle)}
2556
- src="${this._iframeUrl}"
2557
- frameborder="0"
2558
- ></iframe>
2559
- ` : x`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
2560
- ${this.browserError ? x`
2561
- <div id="luzmo-error-${this._containerId}">
2562
- <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
2563
- </div>
2564
- ` : ""}
2565
- `;
2566
- } else {
2567
- toBeRenderedHTML = this.isLibraryLoaded ? x`
2568
- ${this.dashboardId || this.dashboardSlug ? x`<dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}" api-host="${this.params.apiHost}"></dashboard-component>` : x`
2569
- <div id="luzmo-error-${this._containerId}">
2570
- <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
2571
- </div>
2572
- `}
2573
- ` : x`${loader}`;
2574
- }
2575
- return x`
2576
- <div
2577
- class="dashboard-container"
2578
- style=${o(this._containerStyle)}
2579
- >
2580
- ${toBeRenderedHTML}
2581
- </div>
2582
- `;
2583
- }
2584
- getDashboards() {
2585
- return new Promise(
2586
- (resolve) => resolve(LuzmoService$1._components)
2587
- );
2588
- }
2589
- // Public methods
2590
- getData(itemId) {
2591
- if (this.getIsViewMode() && this.dashboardReference) {
2592
- return this.dashboardReference.getData(itemId);
2593
- }
2594
- if (!this.getIsViewMode()) {
2595
- return getData(this, this.iframe, itemId);
2596
- }
2597
- return Promise.reject();
2598
- }
2599
- getFilters() {
2600
- if (this.getIsViewMode() && this.dashboardReference) {
2601
- return this.dashboardReference.getFilters();
2602
- }
2603
- if (!this.getIsViewMode()) {
2604
- return getFilters(this, this.iframe);
2605
- }
2606
- return Promise.reject();
2607
- }
2608
- setFilters(itemId, filters) {
2609
- if (this.getIsViewMode() && this.dashboardReference) {
2610
- return Promise.reject();
2611
- }
2612
- if (!this.getIsViewMode()) {
2613
- return setFilters(this, this.iframe, itemId, filters);
2614
- }
2615
- return Promise.reject();
2616
- }
2617
- setAuthorization(key, token) {
2618
- if (this.getIsViewMode() && this.dashboardReference) {
2619
- return this.dashboardReference.setAuthorization(key, token);
2620
- }
2621
- if (!this.getIsViewMode()) {
2622
- return setAuthorization(this, this.iframe, key, token);
2623
- }
2624
- return Promise.reject();
2625
- }
2626
- refreshData(itemId) {
2627
- if (this.getIsViewMode() && this.dashboardReference) {
2628
- return this.dashboardReference.refreshData(itemId);
2629
- }
2630
- if (!this.getIsViewMode()) {
2631
- return itemId ? refreshData(this, this.iframe, itemId) : refreshData(this, this.iframe);
2632
- }
2633
- return Promise.reject();
2634
- }
2635
- reloadDashboard() {
2636
- if (this.getIsViewMode() && this.dashboardReference) {
2637
- return this.dashboardReference.reloadDashboard();
2638
- }
2639
- if (!this.getIsViewMode()) {
2640
- return reloadDashboard(this, this.iframe);
2641
- }
2642
- return Promise.reject();
2643
- }
2644
- exportDashboard(format) {
2645
- if (this.getIsViewMode() && this.dashboardReference) {
2646
- return this.dashboardReference.exportDashboard(format);
2647
- }
2648
- if (!this.getIsViewMode()) {
2649
- return format ? exportDashboard(this, this.iframe, format) : exportDashboard(this, this.iframe);
2650
- }
2651
- return Promise.reject();
2652
- }
2653
- getAccessibleDashboards() {
2654
- if (!this.getIsViewMode()) {
2655
- return getAccessibleDashboards(this, this.iframe);
2656
- }
2657
- if (this.getIsViewMode() && this.dashboardReference) {
2658
- return this.dashboardReference.getAccessibleDashboards();
2659
- }
2660
- return Promise.reject();
2661
- }
2662
- setEditMode(editMode) {
2663
- if (this.dashboardReference && editMode === "view") {
2664
- this.editMode = "view";
2665
- this.params.editMode = "view";
2666
- this.initComponent();
2667
- return Promise.resolve({
2668
- type: "setEditMode",
2669
- editMode
2670
- });
2671
- }
2672
- if (this.dashboardReference && ["editFull", "editLimited"].includes(editMode)) {
2673
- this.editMode = editMode;
2674
- this.params.editMode = editMode;
2675
- this.initComponent();
2676
- return Promise.resolve({
2677
- type: "setEditMode",
2678
- editMode
2679
- });
2680
- }
2681
- if (this.getIsViewMode() && this.dashboardReference) {
2682
- return this.dashboardReference.setEditMode(editMode);
2683
- }
2684
- if (!this.getIsViewMode()) {
2685
- return setEditMode(this, this.iframe, editMode);
2686
- }
2687
- return Promise.reject();
2688
- }
2689
- setPreview(preview) {
2690
- if (this.getIsViewMode() && this.dashboardReference) {
2691
- return this.dashboardReference.setPreview(preview);
2692
- }
2693
- return setPreview(this, this.iframe, preview);
2694
- }
2695
- getIsViewMode() {
2696
- if (this.dev && this.params.editMode === "view" || this.params.editMode === void 0) {
2697
- return true;
2698
- }
2699
- return false;
2700
- }
2701
- };
2702
- __decorateClass([
2703
- e$1(".dashboard-container")
2704
- ], exports2.LuzmoDashboard.prototype, "container", 2);
2705
- __decorateClass([
2706
- e$1("iframe")
2707
- ], exports2.LuzmoDashboard.prototype, "iframe", 2);
2708
- __decorateClass([
2709
- n$1()
2710
- ], exports2.LuzmoDashboard.prototype, "dashboardId", 2);
2711
- __decorateClass([
2712
- n$1()
2713
- ], exports2.LuzmoDashboard.prototype, "dashboardSlug", 2);
2714
- __decorateClass([
2715
- n$1()
2716
- ], exports2.LuzmoDashboard.prototype, "itemId", 2);
2717
- __decorateClass([
2718
- n$1()
2719
- ], exports2.LuzmoDashboard.prototype, "language", 2);
2720
- __decorateClass([
2721
- n$1()
2722
- ], exports2.LuzmoDashboard.prototype, "qeVersion", 2);
2723
- __decorateClass([
2724
- n$1()
2725
- ], exports2.LuzmoDashboard.prototype, "screenMode", 2);
2726
- __decorateClass([
2727
- n$1({
2728
- converter: {
2729
- fromAttribute: (value) => value === "true",
2730
- toAttribute: String
2731
- }
2732
- })
2733
- ], exports2.LuzmoDashboard.prototype, "switchScreenModeOnResize", 2);
2734
- __decorateClass([
2735
- n$1()
2736
- ], exports2.LuzmoDashboard.prototype, "editMode", 2);
2737
- __decorateClass([
2738
- n$1()
2739
- ], exports2.LuzmoDashboard.prototype, "mainColor", 2);
2740
- __decorateClass([
2741
- n$1()
2742
- ], exports2.LuzmoDashboard.prototype, "accentColor", 2);
2743
- __decorateClass([
2744
- n$1()
2745
- ], exports2.LuzmoDashboard.prototype, "authToken", 2);
2746
- __decorateClass([
2747
- n$1()
2748
- ], exports2.LuzmoDashboard.prototype, "authKey", 2);
2749
- __decorateClass([
2750
- n$1()
2751
- ], exports2.LuzmoDashboard.prototype, "loaderBackground", 2);
2752
- __decorateClass([
2753
- n$1()
2754
- ], exports2.LuzmoDashboard.prototype, "loaderFontColor", 2);
2755
- __decorateClass([
2756
- n$1()
2757
- ], exports2.LuzmoDashboard.prototype, "loaderSpinnerColor", 2);
2758
- __decorateClass([
2759
- n$1()
2760
- ], exports2.LuzmoDashboard.prototype, "loaderSpinnerBackground", 2);
2761
- __decorateClass([
2762
- n$1()
2763
- ], exports2.LuzmoDashboard.prototype, "appServer", 2);
2764
- __decorateClass([
2765
- n$1()
2766
- ], exports2.LuzmoDashboard.prototype, "timezoneId", 2);
2767
- __decorateClass([
2768
- n$1()
2769
- ], exports2.LuzmoDashboard.prototype, "apiHost", 2);
2770
- __decorateClass([
2771
- n$1({ type: Object })
2772
- ], exports2.LuzmoDashboard.prototype, "itemDimensions", 2);
2773
- __decorateClass([
2774
- n$1()
2775
- ], exports2.LuzmoDashboard.prototype, "dev", 2);
2776
- __decorateClass([
2777
- n$1({ attribute: false })
2778
- ], exports2.LuzmoDashboard.prototype, "_containerId", 2);
2779
- __decorateClass([
2780
- n$1({ attribute: false })
2781
- ], exports2.LuzmoDashboard.prototype, "_iframeId", 2);
2782
- __decorateClass([
2783
- n$1({ attribute: false })
2784
- ], exports2.LuzmoDashboard.prototype, "params", 2);
2785
- __decorateClass([
2786
- n$1({ attribute: false })
2787
- ], exports2.LuzmoDashboard.prototype, "_iframeUrl", 2);
2788
- __decorateClass([
2789
- n$1({ attribute: false })
2790
- ], exports2.LuzmoDashboard.prototype, "iframeLoaded", 2);
2791
- __decorateClass([
2792
- n$1({ attribute: false })
2793
- ], exports2.LuzmoDashboard.prototype, "promises", 2);
2794
- __decorateClass([
2795
- n$1({ attribute: false })
2796
- ], exports2.LuzmoDashboard.prototype, "iframeStyle", 2);
2797
- __decorateClass([
2798
- n$1({ attribute: false })
2799
- ], exports2.LuzmoDashboard.prototype, "_containerStyle", 2);
2800
- __decorateClass([
2801
- n$1({ attribute: false })
2802
- ], exports2.LuzmoDashboard.prototype, "_loaderStyle", 2);
2803
- __decorateClass([
2804
- n$1({ attribute: false })
2805
- ], exports2.LuzmoDashboard.prototype, "_lcStyle", 2);
2806
- __decorateClass([
2807
- n$1({ attribute: false })
2808
- ], exports2.LuzmoDashboard.prototype, "_loadingCircleStyle", 2);
2809
- __decorateClass([
2810
- n$1({ attribute: false })
2811
- ], exports2.LuzmoDashboard.prototype, "_containerLoaderStyle", 2);
2812
- __decorateClass([
2813
- n$1({ attribute: false })
2814
- ], exports2.LuzmoDashboard.prototype, "_loaderMsg", 2);
2815
- __decorateClass([
2816
- n$1({ attribute: false })
2817
- ], exports2.LuzmoDashboard.prototype, "containerWidth", 2);
2818
- __decorateClass([
2819
- n$1({ attribute: false })
2820
- ], exports2.LuzmoDashboard.prototype, "dimensions", 2);
2821
- __decorateClass([
2822
- n$1({ attribute: false })
2823
- ], exports2.LuzmoDashboard.prototype, "currentScreenMode", 2);
2824
- __decorateClass([
2825
- n$1({ attribute: false })
2826
- ], exports2.LuzmoDashboard.prototype, "_itemEmbedding", 2);
2827
- __decorateClass([
2828
- n$1({ attribute: false })
2829
- ], exports2.LuzmoDashboard.prototype, "browserError", 2);
2830
- __decorateClass([
2831
- n$1({ attribute: false })
2832
- ], exports2.LuzmoDashboard.prototype, "browserErrorMsg", 2);
2833
- __decorateClass([
2834
- n$1({ attribute: false })
2835
- ], exports2.LuzmoDashboard.prototype, "dashboardError", 2);
2836
- __decorateClass([
2837
- n$1({ attribute: false })
2838
- ], exports2.LuzmoDashboard.prototype, "browserNotSupported", 2);
2839
- __decorateClass([
2840
- n$1({ attribute: false })
2841
- ], exports2.LuzmoDashboard.prototype, "VERSION", 2);
2842
- __decorateClass([
2843
- r()
2844
- ], exports2.LuzmoDashboard.prototype, "isLibraryLoaded", 2);
2845
- __decorateClass([
2846
- r()
2847
- ], exports2.LuzmoDashboard.prototype, "dashboardReference", 2);
2848
- exports2.LuzmoDashboard = __decorateClass([
2849
- t$1("luzmo-dashboard")
2850
- ], exports2.LuzmoDashboard);
2851
- Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
2852
- });