@luzmo/embed 5.0.9 → 5.0.11
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/CHANGELOG.md +12 -0
- package/README.md +8 -8
- package/index.cjs +79 -59
- package/index.d.ts +1 -0
- package/index.js +80 -59
- package/index.libs.d.ts +1 -0
- package/lib/dashboard-component/dashboard-base.d.ts +96 -0
- package/lib/dashboard-component/dashboard-component.d.ts +2 -91
- package/lib/dashboard-component/dashboard-web-component.d.ts +3 -0
- package/luzmo-embed.libs.js +3094 -0
- package/luzmo-embed.min.js +1483 -1466
- package/package.json +1 -1
package/luzmo-embed.min.js
CHANGED
|
@@ -42,521 +42,872 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
42
42
|
// libs/embed-libs/embed/src/index.ts
|
|
43
43
|
var src_exports2 = {};
|
|
44
44
|
__export(src_exports2, {
|
|
45
|
-
LuzmoDashboard: () =>
|
|
45
|
+
LuzmoDashboard: () => LuzmoDashboard2
|
|
46
46
|
});
|
|
47
47
|
module.exports = __toCommonJS(src_exports2);
|
|
48
48
|
|
|
49
|
-
//
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
if (typeof parameters?.dashboardSlug === "string") {
|
|
56
|
-
message += ` for dashboard with slug ${parameters.dashboardSlug}`;
|
|
57
|
-
}
|
|
58
|
-
if (typeof parameters?.container === "string") {
|
|
59
|
-
message += ` in container ${parameters.container}`;
|
|
60
|
-
}
|
|
61
|
-
if (errorMessage) {
|
|
62
|
-
message += `:
|
|
63
|
-
${errorMessage}`;
|
|
64
|
-
console.error(message);
|
|
65
|
-
}
|
|
49
|
+
// node_modules/@lit/reactive-element/decorators/custom-element.js
|
|
50
|
+
var t = (t5) => (e7, o6) => {
|
|
51
|
+
void 0 !== o6 ? o6.addInitializer(() => {
|
|
52
|
+
customElements.define(t5, e7);
|
|
53
|
+
}) : customElements.define(t5, e7);
|
|
66
54
|
};
|
|
67
55
|
|
|
68
|
-
//
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
const browserCheckKeys = ["svg", "flexbox", "postMessage"];
|
|
80
|
-
for (const key of browserCheckKeys) {
|
|
81
|
-
if (!browserCheck[key]) {
|
|
82
|
-
hasError = true;
|
|
83
|
-
dashboardComponent.browserNotSupported = dashboardComponent.browserNotSupported || [];
|
|
84
|
-
dashboardComponent.browserNotSupported.push(key);
|
|
85
|
-
errorMessage += `Your browser does not support: ${key}
|
|
86
|
-
`;
|
|
87
|
-
}
|
|
56
|
+
// node_modules/@lit/reactive-element/css-tag.js
|
|
57
|
+
var t2 = globalThis;
|
|
58
|
+
var e = t2.ShadowRoot && (void 0 === t2.ShadyCSS || t2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
|
|
59
|
+
var s = Symbol();
|
|
60
|
+
var o = /* @__PURE__ */ new WeakMap();
|
|
61
|
+
var n = class {
|
|
62
|
+
constructor(t5, e7, o6) {
|
|
63
|
+
if (this._$cssResult$ = true, o6 !== s)
|
|
64
|
+
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
65
|
+
this.cssText = t5, this.t = e7;
|
|
88
66
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
67
|
+
get styleSheet() {
|
|
68
|
+
let t5 = this.o;
|
|
69
|
+
const s4 = this.t;
|
|
70
|
+
if (e && void 0 === t5) {
|
|
71
|
+
const e7 = void 0 !== s4 && 1 === s4.length;
|
|
72
|
+
e7 && (t5 = o.get(s4)), void 0 === t5 && ((this.o = t5 = new CSSStyleSheet()).replaceSync(this.cssText), e7 && o.set(s4, t5));
|
|
73
|
+
}
|
|
74
|
+
return t5;
|
|
95
75
|
}
|
|
96
|
-
|
|
97
|
-
|
|
76
|
+
toString() {
|
|
77
|
+
return this.cssText;
|
|
98
78
|
}
|
|
99
79
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
language: "auto",
|
|
111
|
-
qeVersion: null,
|
|
112
|
-
editMode: null,
|
|
113
|
-
screenMode: null,
|
|
114
|
-
switchScreenModeOnResize: true,
|
|
115
|
-
itemId: null,
|
|
116
|
-
mainColor: "",
|
|
117
|
-
accentColor: "",
|
|
118
|
-
itemDimensions: {
|
|
119
|
-
width: "auto",
|
|
120
|
-
height: "auto"
|
|
121
|
-
},
|
|
122
|
-
loaderBackground: "#f9f9f9",
|
|
123
|
-
loaderFontColor: "#5a5a5a",
|
|
124
|
-
loaderSpinnerColor: "rgba(255, 165, 0, 0.7)",
|
|
125
|
-
loaderSpinnerBackground: "rgba(169, 169, 169, 0.14)",
|
|
126
|
-
timezoneId: null,
|
|
127
|
-
contextId: null
|
|
80
|
+
var r = (t5) => new n("string" == typeof t5 ? t5 : t5 + "", void 0, s);
|
|
81
|
+
var i = (t5, ...e7) => {
|
|
82
|
+
const o6 = 1 === t5.length ? t5[0] : e7.reduce((e8, s4, o7) => e8 + ((t6) => {
|
|
83
|
+
if (true === t6._$cssResult$)
|
|
84
|
+
return t6.cssText;
|
|
85
|
+
if ("number" == typeof t6)
|
|
86
|
+
return t6;
|
|
87
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + t6 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
88
|
+
})(s4) + t5[o7 + 1], t5[0]);
|
|
89
|
+
return new n(o6, t5, s);
|
|
128
90
|
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
];
|
|
138
|
-
|
|
139
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/translations.ts
|
|
140
|
-
var TRANSLATIONS = {
|
|
141
|
-
initializing: { en: "Initializing...", nl: "Laden...", fr: "Chargement..." },
|
|
142
|
-
errorDashboard: {
|
|
143
|
-
en: "Oops, we could not load this dashboard!",
|
|
144
|
-
nl: "Oeps, we konden het dashboard niet laden.",
|
|
145
|
-
fr: "Le chargement a echou\xE9."
|
|
146
|
-
},
|
|
147
|
-
errorItem: {
|
|
148
|
-
en: "Oops, we could not load this item!",
|
|
149
|
-
nl: "Oeps, we konden de grafiek niet laden.",
|
|
150
|
-
fr: "Le chargement a echou\xE9."
|
|
151
|
-
}
|
|
91
|
+
var S = (s4, o6) => {
|
|
92
|
+
if (e)
|
|
93
|
+
s4.adoptedStyleSheets = o6.map((t5) => t5 instanceof CSSStyleSheet ? t5 : t5.styleSheet);
|
|
94
|
+
else
|
|
95
|
+
for (const e7 of o6) {
|
|
96
|
+
const o7 = document.createElement("style"), n6 = t2.litNonce;
|
|
97
|
+
void 0 !== n6 && o7.setAttribute("nonce", n6), o7.textContent = e7.cssText, s4.appendChild(o7);
|
|
98
|
+
}
|
|
152
99
|
};
|
|
153
|
-
var
|
|
100
|
+
var c = e ? (t5) => t5 : (t5) => t5 instanceof CSSStyleSheet ? ((t6) => {
|
|
101
|
+
let e7 = "";
|
|
102
|
+
for (const s4 of t6.cssRules)
|
|
103
|
+
e7 += s4.cssText;
|
|
104
|
+
return r(e7);
|
|
105
|
+
})(t5) : t5;
|
|
154
106
|
|
|
155
|
-
//
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
var
|
|
163
|
-
|
|
164
|
-
|
|
107
|
+
// node_modules/@lit/reactive-element/reactive-element.js
|
|
108
|
+
var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object;
|
|
109
|
+
var a = globalThis;
|
|
110
|
+
var c2 = a.trustedTypes;
|
|
111
|
+
var l = c2 ? c2.emptyScript : "";
|
|
112
|
+
var p = a.reactiveElementPolyfillSupport;
|
|
113
|
+
var d = (t5, s4) => t5;
|
|
114
|
+
var u = { toAttribute(t5, s4) {
|
|
115
|
+
switch (s4) {
|
|
116
|
+
case Boolean:
|
|
117
|
+
t5 = t5 ? l : null;
|
|
118
|
+
break;
|
|
119
|
+
case Object:
|
|
120
|
+
case Array:
|
|
121
|
+
t5 = null == t5 ? t5 : JSON.stringify(t5);
|
|
165
122
|
}
|
|
166
|
-
return
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
const groups = securable.groups.filter(
|
|
183
|
-
(group) => user2.userGroups.includes(group.id) || group.public === true
|
|
184
|
-
);
|
|
185
|
-
const groupsAccess = groups.map((group) => {
|
|
186
|
-
if (group.groupAccessRight) {
|
|
187
|
-
return group.groupAccessRight;
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
for (const groupAccess of groupsAccess) {
|
|
191
|
-
if (!securableAccessRights.flagRead && groupAccess.flagRead) {
|
|
192
|
-
securableAccessRights.flagRead = groupAccess.flagRead;
|
|
193
|
-
}
|
|
194
|
-
if (!securableAccessRights.flagUse && groupAccess.flagUse) {
|
|
195
|
-
securableAccessRights.flagUse = groupAccess.flagUse;
|
|
196
|
-
}
|
|
197
|
-
if (!securableAccessRights.flagModify && groupAccess.flagModify) {
|
|
198
|
-
securableAccessRights.flagModify = groupAccess.flagModify;
|
|
199
|
-
}
|
|
200
|
-
if (!securableAccessRights.flagOwn && groupAccess.flagOwn) {
|
|
201
|
-
securableAccessRights.flagOwn = groupAccess.flagOwn;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
const integrationsAccess = securable.integrations?.length > 0 ? securable.integrations.map((integration) => {
|
|
205
|
-
if (integration.integrationAccessRight) {
|
|
206
|
-
return integration.integrationAccessRight;
|
|
207
|
-
}
|
|
208
|
-
}) : [];
|
|
209
|
-
for (const integrationAccess of integrationsAccess) {
|
|
210
|
-
if (!securableAccessRights.flagRead && integrationAccess.flagRead) {
|
|
211
|
-
securableAccessRights.flagRead = integrationAccess.flagRead;
|
|
212
|
-
}
|
|
213
|
-
if (!securableAccessRights.flagUse && integrationAccess.flagUse) {
|
|
214
|
-
securableAccessRights.flagUse = integrationAccess.flagUse;
|
|
215
|
-
}
|
|
216
|
-
if (!securableAccessRights.flagModify && integrationAccess.flagModify) {
|
|
217
|
-
securableAccessRights.flagModify = integrationAccess.flagModify;
|
|
123
|
+
return t5;
|
|
124
|
+
}, fromAttribute(t5, s4) {
|
|
125
|
+
let i6 = t5;
|
|
126
|
+
switch (s4) {
|
|
127
|
+
case Boolean:
|
|
128
|
+
i6 = null !== t5;
|
|
129
|
+
break;
|
|
130
|
+
case Number:
|
|
131
|
+
i6 = null === t5 ? null : Number(t5);
|
|
132
|
+
break;
|
|
133
|
+
case Object:
|
|
134
|
+
case Array:
|
|
135
|
+
try {
|
|
136
|
+
i6 = JSON.parse(t5);
|
|
137
|
+
} catch (t6) {
|
|
138
|
+
i6 = null;
|
|
218
139
|
}
|
|
140
|
+
}
|
|
141
|
+
return i6;
|
|
142
|
+
} };
|
|
143
|
+
var f = (t5, s4) => !i2(t5, s4);
|
|
144
|
+
var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f };
|
|
145
|
+
Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
146
|
+
var b = class extends HTMLElement {
|
|
147
|
+
static addInitializer(t5) {
|
|
148
|
+
this._$Ei(), (this.l ??= []).push(t5);
|
|
149
|
+
}
|
|
150
|
+
static get observedAttributes() {
|
|
151
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
152
|
+
}
|
|
153
|
+
static createProperty(t5, s4 = y) {
|
|
154
|
+
if (s4.state && (s4.attribute = false), this._$Ei(), this.elementProperties.set(t5, s4), !s4.noAccessor) {
|
|
155
|
+
const i6 = Symbol(), r7 = this.getPropertyDescriptor(t5, i6, s4);
|
|
156
|
+
void 0 !== r7 && e2(this.prototype, t5, r7);
|
|
219
157
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
158
|
+
}
|
|
159
|
+
static getPropertyDescriptor(t5, s4, i6) {
|
|
160
|
+
const { get: e7, set: h3 } = r2(this.prototype, t5) ?? { get() {
|
|
161
|
+
return this[s4];
|
|
162
|
+
}, set(t6) {
|
|
163
|
+
this[s4] = t6;
|
|
164
|
+
} };
|
|
165
|
+
return { get() {
|
|
166
|
+
return e7?.call(this);
|
|
167
|
+
}, set(s5) {
|
|
168
|
+
const r7 = e7?.call(this);
|
|
169
|
+
h3.call(this, s5), this.requestUpdate(t5, r7, i6);
|
|
170
|
+
}, configurable: true, enumerable: true };
|
|
171
|
+
}
|
|
172
|
+
static getPropertyOptions(t5) {
|
|
173
|
+
return this.elementProperties.get(t5) ?? y;
|
|
174
|
+
}
|
|
175
|
+
static _$Ei() {
|
|
176
|
+
if (this.hasOwnProperty(d("elementProperties")))
|
|
177
|
+
return;
|
|
178
|
+
const t5 = n2(this);
|
|
179
|
+
t5.finalize(), void 0 !== t5.l && (this.l = [...t5.l]), this.elementProperties = new Map(t5.elementProperties);
|
|
180
|
+
}
|
|
181
|
+
static finalize() {
|
|
182
|
+
if (this.hasOwnProperty(d("finalized")))
|
|
183
|
+
return;
|
|
184
|
+
if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
|
|
185
|
+
const t6 = this.properties, s4 = [...h(t6), ...o2(t6)];
|
|
186
|
+
for (const i6 of s4)
|
|
187
|
+
this.createProperty(i6, t6[i6]);
|
|
231
188
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
189
|
+
const t5 = this[Symbol.metadata];
|
|
190
|
+
if (null !== t5) {
|
|
191
|
+
const s4 = litPropertyMetadata.get(t5);
|
|
192
|
+
if (void 0 !== s4)
|
|
193
|
+
for (const [t6, i6] of s4)
|
|
194
|
+
this.elementProperties.set(t6, i6);
|
|
236
195
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const treatedDashboard = {
|
|
242
|
-
accessibleBy: [],
|
|
243
|
-
accessRights: combineRights(dashboard, user),
|
|
244
|
-
id: dashboard.id,
|
|
245
|
-
modifiedAt: dashboard.modified_at,
|
|
246
|
-
name: localize(dashboard.name, dashboardComponent.language),
|
|
247
|
-
slug: null,
|
|
248
|
-
tags: dashboard.tags.map((t5) => t5.tag).sort((t1, t22) => t1.localeCompare(t22))
|
|
249
|
-
};
|
|
250
|
-
const currentIntegration = dashboard.integrations.find(
|
|
251
|
-
(i6) => i6.id === integrationId
|
|
252
|
-
);
|
|
253
|
-
if (currentIntegration?.integrationAccessRight?.slug) {
|
|
254
|
-
treatedDashboard.slug = currentIntegration.integrationAccessRight.slug;
|
|
196
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
197
|
+
for (const [t6, s4] of this.elementProperties) {
|
|
198
|
+
const i6 = this._$Eu(t6, s4);
|
|
199
|
+
void 0 !== i6 && this._$Eh.set(i6, t6);
|
|
255
200
|
}
|
|
256
|
-
|
|
257
|
-
model: "User",
|
|
258
|
-
id: u3.id,
|
|
259
|
-
name: localize(u3.name, user.locale_id)
|
|
260
|
-
}));
|
|
261
|
-
const groups = dashboard.groups.map((g2) => ({
|
|
262
|
-
model: "Group",
|
|
263
|
-
id: g2.id,
|
|
264
|
-
name: localize(g2.name, user.locale_id) || {}
|
|
265
|
-
}));
|
|
266
|
-
const integrations = dashboard.integrations.map((i6) => ({
|
|
267
|
-
model: "Integration",
|
|
268
|
-
id: i6.id,
|
|
269
|
-
name: localize(i6.name, user.locale_id) || {}
|
|
270
|
-
}));
|
|
271
|
-
treatedDashboard.accessibleBy = [...users, ...groups, ...integrations];
|
|
272
|
-
treatedDashboards.push(treatedDashboard);
|
|
201
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
273
202
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
if (!url) {
|
|
284
|
-
return "about:blank";
|
|
203
|
+
static finalizeStyles(s4) {
|
|
204
|
+
const i6 = [];
|
|
205
|
+
if (Array.isArray(s4)) {
|
|
206
|
+
const e7 = new Set(s4.flat(1 / 0).reverse());
|
|
207
|
+
for (const s5 of e7)
|
|
208
|
+
i6.unshift(c(s5));
|
|
209
|
+
} else
|
|
210
|
+
void 0 !== s4 && i6.push(c(s4));
|
|
211
|
+
return i6;
|
|
285
212
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return
|
|
213
|
+
static _$Eu(t5, s4) {
|
|
214
|
+
const i6 = s4.attribute;
|
|
215
|
+
return false === i6 ? void 0 : "string" == typeof i6 ? i6 : "string" == typeof t5 ? t5.toLowerCase() : void 0;
|
|
289
216
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
return sanitizedUrl;
|
|
217
|
+
constructor() {
|
|
218
|
+
super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
|
|
293
219
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
return "about:blank";
|
|
220
|
+
_$Ev() {
|
|
221
|
+
this._$ES = new Promise((t5) => this.enableUpdating = t5), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t5) => t5(this));
|
|
297
222
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
var cloneDeep = (obj) => JSON.parse(JSON.stringify(obj));
|
|
301
|
-
var isObject = (o6) => o6 && typeof o6 === "object";
|
|
302
|
-
var defaultsDeep = (target, defaults) => {
|
|
303
|
-
Object.entries(defaults).forEach(([k2, v2]) => {
|
|
304
|
-
if (k2 in target) {
|
|
305
|
-
if (target[k2] === void 0) {
|
|
306
|
-
target[k2] = v2;
|
|
307
|
-
} else {
|
|
308
|
-
target[k2] = isObject(v2) ? defaultsDeep(
|
|
309
|
-
target[k2],
|
|
310
|
-
v2
|
|
311
|
-
) : target[k2];
|
|
312
|
-
}
|
|
313
|
-
} else {
|
|
314
|
-
target[k2] = v2;
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
return target;
|
|
318
|
-
};
|
|
319
|
-
var uuidv4 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g, function(c4) {
|
|
320
|
-
const r7 = Math.random() * 16 | 0;
|
|
321
|
-
const v2 = c4 == "x" ? r7 : r7 & 3 | 8;
|
|
322
|
-
return v2.toString(16);
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/iframe-url.ts
|
|
326
|
-
var createIframeUrl = (dashboardContent) => {
|
|
327
|
-
const searchString = [];
|
|
328
|
-
const {
|
|
329
|
-
appServer,
|
|
330
|
-
language,
|
|
331
|
-
qeVersion,
|
|
332
|
-
loaderBackground,
|
|
333
|
-
loaderSpinnerColor,
|
|
334
|
-
loaderSpinnerBackground,
|
|
335
|
-
loaderFontColor,
|
|
336
|
-
screenMode,
|
|
337
|
-
key,
|
|
338
|
-
token,
|
|
339
|
-
timezoneId,
|
|
340
|
-
itemEmbedding,
|
|
341
|
-
itemDimensions,
|
|
342
|
-
dashboardId,
|
|
343
|
-
dashboardSlug,
|
|
344
|
-
itemId,
|
|
345
|
-
mainColor,
|
|
346
|
-
accentColor,
|
|
347
|
-
editMode
|
|
348
|
-
} = dashboardContent.params;
|
|
349
|
-
if (language && language !== "auto") {
|
|
350
|
-
searchString.push("language=" + language);
|
|
223
|
+
addController(t5) {
|
|
224
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(t5), void 0 !== this.renderRoot && this.isConnected && t5.hostConnected?.();
|
|
351
225
|
}
|
|
352
|
-
|
|
353
|
-
|
|
226
|
+
removeController(t5) {
|
|
227
|
+
this._$EO?.delete(t5);
|
|
354
228
|
}
|
|
355
|
-
|
|
356
|
-
|
|
229
|
+
_$E_() {
|
|
230
|
+
const t5 = /* @__PURE__ */ new Map(), s4 = this.constructor.elementProperties;
|
|
231
|
+
for (const i6 of s4.keys())
|
|
232
|
+
this.hasOwnProperty(i6) && (t5.set(i6, this[i6]), delete this[i6]);
|
|
233
|
+
t5.size > 0 && (this._$Ep = t5);
|
|
357
234
|
}
|
|
358
|
-
|
|
359
|
-
|
|
235
|
+
createRenderRoot() {
|
|
236
|
+
const t5 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
237
|
+
return S(t5, this.constructor.elementStyles), t5;
|
|
360
238
|
}
|
|
361
|
-
|
|
362
|
-
|
|
239
|
+
connectedCallback() {
|
|
240
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t5) => t5.hostConnected?.());
|
|
363
241
|
}
|
|
364
|
-
|
|
365
|
-
searchString.push(`ldrspbg=${loaderSpinnerBackground}`);
|
|
242
|
+
enableUpdating(t5) {
|
|
366
243
|
}
|
|
367
|
-
|
|
368
|
-
|
|
244
|
+
disconnectedCallback() {
|
|
245
|
+
this._$EO?.forEach((t5) => t5.hostDisconnected?.());
|
|
369
246
|
}
|
|
370
|
-
|
|
371
|
-
|
|
247
|
+
attributeChangedCallback(t5, s4, i6) {
|
|
248
|
+
this._$AK(t5, i6);
|
|
372
249
|
}
|
|
373
|
-
|
|
374
|
-
|
|
250
|
+
_$EC(t5, s4) {
|
|
251
|
+
const i6 = this.constructor.elementProperties.get(t5), e7 = this.constructor._$Eu(t5, i6);
|
|
252
|
+
if (void 0 !== e7 && true === i6.reflect) {
|
|
253
|
+
const r7 = (void 0 !== i6.converter?.toAttribute ? i6.converter : u).toAttribute(s4, i6.type);
|
|
254
|
+
this._$Em = t5, null == r7 ? this.removeAttribute(e7) : this.setAttribute(e7, r7), this._$Em = null;
|
|
255
|
+
}
|
|
375
256
|
}
|
|
376
|
-
|
|
377
|
-
|
|
257
|
+
_$AK(t5, s4) {
|
|
258
|
+
const i6 = this.constructor, e7 = i6._$Eh.get(t5);
|
|
259
|
+
if (void 0 !== e7 && this._$Em !== e7) {
|
|
260
|
+
const t6 = i6.getPropertyOptions(e7), r7 = "function" == typeof t6.converter ? { fromAttribute: t6.converter } : void 0 !== t6.converter?.fromAttribute ? t6.converter : u;
|
|
261
|
+
this._$Em = e7, this[e7] = r7.fromAttribute(s4, t6.type), this._$Em = null;
|
|
262
|
+
}
|
|
378
263
|
}
|
|
379
|
-
|
|
380
|
-
|
|
264
|
+
requestUpdate(t5, s4, i6) {
|
|
265
|
+
if (void 0 !== t5) {
|
|
266
|
+
if (i6 ??= this.constructor.getPropertyOptions(t5), !(i6.hasChanged ?? f)(this[t5], s4))
|
|
267
|
+
return;
|
|
268
|
+
this.P(t5, s4, i6);
|
|
269
|
+
}
|
|
270
|
+
false === this.isUpdatePending && (this._$ES = this._$ET());
|
|
381
271
|
}
|
|
382
|
-
|
|
383
|
-
|
|
272
|
+
P(t5, s4, i6) {
|
|
273
|
+
this._$AL.has(t5) || this._$AL.set(t5, s4), true === i6.reflect && this._$Em !== t5 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t5);
|
|
384
274
|
}
|
|
385
|
-
|
|
386
|
-
|
|
275
|
+
async _$ET() {
|
|
276
|
+
this.isUpdatePending = true;
|
|
277
|
+
try {
|
|
278
|
+
await this._$ES;
|
|
279
|
+
} catch (t6) {
|
|
280
|
+
Promise.reject(t6);
|
|
281
|
+
}
|
|
282
|
+
const t5 = this.scheduleUpdate();
|
|
283
|
+
return null != t5 && await t5, !this.isUpdatePending;
|
|
387
284
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
285
|
+
scheduleUpdate() {
|
|
286
|
+
return this.performUpdate();
|
|
287
|
+
}
|
|
288
|
+
performUpdate() {
|
|
289
|
+
if (!this.isUpdatePending)
|
|
290
|
+
return;
|
|
291
|
+
if (!this.hasUpdated) {
|
|
292
|
+
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
293
|
+
for (const [t7, s5] of this._$Ep)
|
|
294
|
+
this[t7] = s5;
|
|
295
|
+
this._$Ep = void 0;
|
|
296
|
+
}
|
|
297
|
+
const t6 = this.constructor.elementProperties;
|
|
298
|
+
if (t6.size > 0)
|
|
299
|
+
for (const [s5, i6] of t6)
|
|
300
|
+
true !== i6.wrapped || this._$AL.has(s5) || void 0 === this[s5] || this.P(s5, this[s5], i6);
|
|
301
|
+
}
|
|
302
|
+
let t5 = false;
|
|
303
|
+
const s4 = this._$AL;
|
|
304
|
+
try {
|
|
305
|
+
t5 = this.shouldUpdate(s4), t5 ? (this.willUpdate(s4), this._$EO?.forEach((t6) => t6.hostUpdate?.()), this.update(s4)) : this._$EU();
|
|
306
|
+
} catch (s5) {
|
|
307
|
+
throw t5 = false, this._$EU(), s5;
|
|
405
308
|
}
|
|
309
|
+
t5 && this._$AE(s4);
|
|
406
310
|
}
|
|
407
|
-
|
|
408
|
-
return dashboardComponent.browserNotSupported || dashboardComponent.params.error ? { loadingMsg, errorMsg } : { loadingMsg, errorMsg: "" };
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
// libs/embed-libs/shared-embed/src/lib/helpers/promise-dispatch.ts
|
|
412
|
-
function resolvePromise(dashboardComponent, requestId, data) {
|
|
413
|
-
if (dashboardComponent.promises[requestId]) {
|
|
414
|
-
dashboardComponent.promises[requestId].resolve(data);
|
|
415
|
-
delete dashboardComponent.promises[requestId];
|
|
311
|
+
willUpdate(t5) {
|
|
416
312
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
if (dashboardComponent.promises[requestId]) {
|
|
420
|
-
dashboardComponent.promises[requestId].reject(data);
|
|
421
|
-
delete dashboardComponent.promises[requestId];
|
|
313
|
+
_$AE(t5) {
|
|
314
|
+
this._$EO?.forEach((t6) => t6.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t5)), this.updated(t5);
|
|
422
315
|
}
|
|
423
|
-
|
|
316
|
+
_$EU() {
|
|
317
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
|
|
318
|
+
}
|
|
319
|
+
get updateComplete() {
|
|
320
|
+
return this.getUpdateComplete();
|
|
321
|
+
}
|
|
322
|
+
getUpdateComplete() {
|
|
323
|
+
return this._$ES;
|
|
324
|
+
}
|
|
325
|
+
shouldUpdate(t5) {
|
|
326
|
+
return true;
|
|
327
|
+
}
|
|
328
|
+
update(t5) {
|
|
329
|
+
this._$Ej &&= this._$Ej.forEach((t6) => this._$EC(t6, this[t6])), this._$EU();
|
|
330
|
+
}
|
|
331
|
+
updated(t5) {
|
|
332
|
+
}
|
|
333
|
+
firstUpdated(t5) {
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4");
|
|
424
337
|
|
|
425
|
-
//
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
338
|
+
// node_modules/@lit/reactive-element/decorators/property.js
|
|
339
|
+
var o3 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f };
|
|
340
|
+
var r3 = (t5 = o3, e7, r7) => {
|
|
341
|
+
const { kind: n6, metadata: i6 } = r7;
|
|
342
|
+
let s4 = globalThis.litPropertyMetadata.get(i6);
|
|
343
|
+
if (void 0 === s4 && globalThis.litPropertyMetadata.set(i6, s4 = /* @__PURE__ */ new Map()), s4.set(r7.name, t5), "accessor" === n6) {
|
|
344
|
+
const { name: o6 } = r7;
|
|
345
|
+
return { set(r8) {
|
|
346
|
+
const n7 = e7.get.call(this);
|
|
347
|
+
e7.set.call(this, r8), this.requestUpdate(o6, n7, t5);
|
|
348
|
+
}, init(e8) {
|
|
349
|
+
return void 0 !== e8 && this.P(o6, void 0, t5), e8;
|
|
350
|
+
} };
|
|
430
351
|
}
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
function
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
const display = dashboardComponent.iframeLoaded ? "none" : "";
|
|
437
|
-
return {
|
|
438
|
-
display,
|
|
439
|
-
height: `${chartHeightDefined ? height : dashboardComponent.minHeight}px`
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
function loaderStyles(dashboardComponent) {
|
|
443
|
-
const background = dashboardComponent.params.loaderBackground || DEFAULT_PARAMETERS.loaderBackground;
|
|
444
|
-
if (dashboardComponent.params.itemEmbedding) {
|
|
445
|
-
dashboardComponent.loaderSize = 24;
|
|
446
|
-
dashboardComponent.borderWidth = 4;
|
|
447
|
-
dashboardComponent.minHeight = 200;
|
|
448
|
-
const width = dashboardComponent.params.itemDimensions?.width || DEFAULT_PARAMETERS.itemDimensions.width;
|
|
449
|
-
const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
|
|
450
|
-
const chartWidthDefined = width !== "auto";
|
|
451
|
-
const chartHeightDefined = height !== "auto";
|
|
452
|
-
return {
|
|
453
|
-
background,
|
|
454
|
-
width: chartWidthDefined ? `${width}px` : "100%",
|
|
455
|
-
height: `${chartHeightDefined ? height : "200"}px`,
|
|
456
|
-
"min-height": chartHeightDefined ? "" : "200px"
|
|
352
|
+
if ("setter" === n6) {
|
|
353
|
+
const { name: o6 } = r7;
|
|
354
|
+
return function(r8) {
|
|
355
|
+
const n7 = this[o6];
|
|
356
|
+
e7.call(this, r8), this.requestUpdate(o6, n7, t5);
|
|
457
357
|
};
|
|
458
358
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
359
|
+
throw Error("Unsupported decorator location: " + n6);
|
|
360
|
+
};
|
|
361
|
+
function n3(t5) {
|
|
362
|
+
return (e7, o6) => "object" == typeof o6 ? r3(t5, e7, o6) : ((t6, e8, o7) => {
|
|
363
|
+
const r7 = e8.hasOwnProperty(o7);
|
|
364
|
+
return e8.constructor.createProperty(o7, r7 ? { ...t6, wrapped: true } : t6), r7 ? Object.getOwnPropertyDescriptor(e8, o7) : void 0;
|
|
365
|
+
})(t5, e7, o6);
|
|
462
366
|
}
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
} = DEFAULT_PARAMETERS;
|
|
468
|
-
const spinnerColorBorder = generateBorderStyle(
|
|
469
|
-
dashboardComponent.borderWidth,
|
|
470
|
-
dashboardComponent.params.loaderSpinnerColor || defaultSpinnerColor
|
|
471
|
-
);
|
|
472
|
-
const spinnerBackgroundBorder = generateBorderStyle(
|
|
473
|
-
dashboardComponent.borderWidth,
|
|
474
|
-
dashboardComponent.params.loaderSpinnerBackground || defaultSpinnerBackground
|
|
475
|
-
);
|
|
476
|
-
const size = `${dashboardComponent.loaderSize}px`;
|
|
477
|
-
return {
|
|
478
|
-
"border-top": spinnerColorBorder,
|
|
479
|
-
"border-right": spinnerColorBorder,
|
|
480
|
-
"border-bottom": spinnerBackgroundBorder,
|
|
481
|
-
"border-left": spinnerBackgroundBorder,
|
|
482
|
-
width: size,
|
|
483
|
-
height: size
|
|
484
|
-
};
|
|
367
|
+
|
|
368
|
+
// node_modules/@lit/reactive-element/decorators/state.js
|
|
369
|
+
function r4(r7) {
|
|
370
|
+
return n3({ ...r7, state: true, attribute: false });
|
|
485
371
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
372
|
+
|
|
373
|
+
// node_modules/@lit/reactive-element/decorators/base.js
|
|
374
|
+
var e3 = (e7, t5, c4) => (c4.configurable = true, c4.enumerable = true, Reflect.decorate && "object" != typeof t5 && Object.defineProperty(e7, t5, c4), c4);
|
|
375
|
+
|
|
376
|
+
// node_modules/@lit/reactive-element/decorators/query.js
|
|
377
|
+
function e4(e7, r7) {
|
|
378
|
+
return (n6, s4, i6) => {
|
|
379
|
+
const o6 = (t5) => t5.renderRoot?.querySelector(e7) ?? null;
|
|
380
|
+
if (r7) {
|
|
381
|
+
const { get: e8, set: r8 } = "object" == typeof s4 ? n6 : i6 ?? (() => {
|
|
382
|
+
const t5 = Symbol();
|
|
383
|
+
return { get() {
|
|
384
|
+
return this[t5];
|
|
385
|
+
}, set(e9) {
|
|
386
|
+
this[t5] = e9;
|
|
387
|
+
} };
|
|
388
|
+
})();
|
|
389
|
+
return e3(n6, s4, { get() {
|
|
390
|
+
let t5 = e8.call(this);
|
|
391
|
+
return void 0 === t5 && (t5 = o6(this), (null !== t5 || this.hasUpdated) && r8.call(this, t5)), t5;
|
|
392
|
+
} });
|
|
393
|
+
}
|
|
394
|
+
return e3(n6, s4, { get() {
|
|
395
|
+
return o6(this);
|
|
396
|
+
} });
|
|
493
397
|
};
|
|
494
398
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
dashboardComponent.iframeHeight = "200px";
|
|
502
|
-
} else if (["editFull", "editLimited"].includes(dashboardComponent.params.editMode)) {
|
|
503
|
-
dashboardComponent.iframeHeight = "100%";
|
|
504
|
-
} else {
|
|
505
|
-
dashboardComponent.iframeHeight = "400px";
|
|
399
|
+
|
|
400
|
+
// libs/embed-libs/shared-embed/src/lib/helpers/error.ts
|
|
401
|
+
var _handleError = (errorMessage, parameters) => {
|
|
402
|
+
let message = "The dashboard component encountered an error";
|
|
403
|
+
if (typeof parameters?.dashboardId === "string") {
|
|
404
|
+
message += ` for dashboard with id ${parameters.dashboardId}`;
|
|
506
405
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
height: dashboardComponent.iframeHeight,
|
|
510
|
-
width: dashboardComponent.iframeWidth
|
|
511
|
-
};
|
|
512
|
-
if (dashboardComponent.iframeLoaded) {
|
|
513
|
-
styles.opacity = 1;
|
|
514
|
-
} else if (dashboardComponent.error) {
|
|
515
|
-
styles.opacity = 1;
|
|
516
|
-
styles.width = "100%";
|
|
517
|
-
styles.height = "400px";
|
|
518
|
-
} else {
|
|
519
|
-
styles.opacity = 0;
|
|
406
|
+
if (typeof parameters?.dashboardSlug === "string") {
|
|
407
|
+
message += ` for dashboard with slug ${parameters.dashboardSlug}`;
|
|
520
408
|
}
|
|
521
|
-
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
var updateIframeUrl = (iframe, iframeUrl) => {
|
|
529
|
-
if (iframe?.contentWindow) {
|
|
530
|
-
iframe.contentWindow.location.replace(iframeUrl);
|
|
409
|
+
if (typeof parameters?.container === "string") {
|
|
410
|
+
message += ` in container ${parameters.container}`;
|
|
411
|
+
}
|
|
412
|
+
if (errorMessage) {
|
|
413
|
+
message += `:
|
|
414
|
+
${errorMessage}`;
|
|
415
|
+
console.error(message);
|
|
531
416
|
}
|
|
532
417
|
};
|
|
533
418
|
|
|
534
|
-
// libs/embed-libs/shared-embed/src/lib/
|
|
535
|
-
var
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
419
|
+
// libs/embed-libs/shared-embed/src/lib/helpers/browser-check.ts
|
|
420
|
+
var _browserCheck = (dashboardComponent) => {
|
|
421
|
+
let hasError = false;
|
|
422
|
+
let errorMessage = "";
|
|
423
|
+
const document_ = document.body || document.documentElement;
|
|
424
|
+
const style = document_.style;
|
|
425
|
+
const browserCheck = {
|
|
426
|
+
svg: !!("createElementNS" in document && document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect),
|
|
427
|
+
flexbox: style.webkitFlexWrap === "" || style.flexWrap === "",
|
|
428
|
+
postMessage: !!window.postMessage
|
|
429
|
+
};
|
|
430
|
+
const browserCheckKeys = ["svg", "flexbox", "postMessage"];
|
|
431
|
+
for (const key of browserCheckKeys) {
|
|
432
|
+
if (!browserCheck[key]) {
|
|
433
|
+
hasError = true;
|
|
434
|
+
dashboardComponent.browserNotSupported = dashboardComponent.browserNotSupported || [];
|
|
435
|
+
dashboardComponent.browserNotSupported.push(key);
|
|
436
|
+
errorMessage += `Your browser does not support: ${key}
|
|
437
|
+
`;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
const ua = window.navigator.userAgent;
|
|
441
|
+
const msie = ua.includes("MSIE");
|
|
442
|
+
const trident = ua.includes("Trident/");
|
|
443
|
+
if (msie || trident) {
|
|
444
|
+
hasError = true;
|
|
445
|
+
errorMessage = "IE is not supported.";
|
|
446
|
+
}
|
|
447
|
+
if (hasError) {
|
|
448
|
+
_handleError(errorMessage);
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
// libs/embed-libs/shared-embed/src/lib/helpers/default-parameters.ts
|
|
453
|
+
var DEFAULT_PARAMETERS = {
|
|
454
|
+
appServer: "https://app.luzmo.com/",
|
|
455
|
+
apiHost: "https://api.luzmo.com/",
|
|
456
|
+
dashboardId: null,
|
|
457
|
+
dashboardSlug: null,
|
|
458
|
+
container: null,
|
|
459
|
+
key: null,
|
|
460
|
+
token: null,
|
|
461
|
+
language: "auto",
|
|
462
|
+
qeVersion: null,
|
|
463
|
+
editMode: null,
|
|
464
|
+
screenMode: null,
|
|
465
|
+
switchScreenModeOnResize: true,
|
|
466
|
+
itemId: null,
|
|
467
|
+
mainColor: "",
|
|
468
|
+
accentColor: "",
|
|
469
|
+
itemDimensions: {
|
|
470
|
+
width: "auto",
|
|
471
|
+
height: "auto"
|
|
472
|
+
},
|
|
473
|
+
loaderBackground: "#f9f9f9",
|
|
474
|
+
loaderFontColor: "#5a5a5a",
|
|
475
|
+
loaderSpinnerColor: "rgba(255, 165, 0, 0.7)",
|
|
476
|
+
loaderSpinnerBackground: "rgba(169, 169, 169, 0.14)",
|
|
477
|
+
timezoneId: null,
|
|
478
|
+
contextId: null
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
// libs/embed-libs/shared-embed/src/lib/helpers/extents.ts
|
|
482
|
+
var EXTENTS = [
|
|
483
|
+
{ mode: "mobile", width: [150, 767] },
|
|
484
|
+
{ mode: "tablet", width: [768, 1199] },
|
|
485
|
+
{ mode: "desktop", width: [1200, 1599] },
|
|
486
|
+
{ mode: "largeScreen", width: [1600, 9999] },
|
|
487
|
+
{ mode: "fixed", width: [] }
|
|
488
|
+
];
|
|
489
|
+
|
|
490
|
+
// libs/embed-libs/shared-embed/src/lib/helpers/translations.ts
|
|
491
|
+
var TRANSLATIONS = {
|
|
492
|
+
initializing: { en: "Initializing...", nl: "Laden...", fr: "Chargement..." },
|
|
493
|
+
errorDashboard: {
|
|
494
|
+
en: "Oops, we could not load this dashboard!",
|
|
495
|
+
nl: "Oeps, we konden het dashboard niet laden.",
|
|
496
|
+
fr: "Le chargement a echou\xE9."
|
|
497
|
+
},
|
|
498
|
+
errorItem: {
|
|
499
|
+
en: "Oops, we could not load this item!",
|
|
500
|
+
nl: "Oeps, we konden de grafiek niet laden.",
|
|
501
|
+
fr: "Le chargement a echou\xE9."
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
var translations_default = TRANSLATIONS;
|
|
505
|
+
|
|
506
|
+
// libs/embed-libs/shared-embed/src/lib/helpers/utils.ts
|
|
507
|
+
var addTrailingSlash = (serverUrl) => {
|
|
508
|
+
if (!serverUrl) {
|
|
509
|
+
return "";
|
|
510
|
+
}
|
|
511
|
+
return serverUrl.endsWith("/") ? serverUrl : `${serverUrl}/`;
|
|
512
|
+
};
|
|
513
|
+
var removeTrailingSlash = (serverUrl) => {
|
|
514
|
+
if (!serverUrl) {
|
|
515
|
+
return "";
|
|
516
|
+
}
|
|
517
|
+
return serverUrl.endsWith("/") ? serverUrl.slice(0, -1) : serverUrl;
|
|
518
|
+
};
|
|
519
|
+
var formatDashboardList = (dashboards, integrationId, user, dashboardComponent) => {
|
|
520
|
+
const combineRights = (securable, user2) => {
|
|
521
|
+
const matchingUser = securable.users.find((u3) => u3.id === user2.id);
|
|
522
|
+
const securableAccessRights = matchingUser && matchingUser.userAccessRight ? {
|
|
523
|
+
flagRead: matchingUser.userAccessRight.flagRead,
|
|
524
|
+
flagUse: matchingUser.userAccessRight.flagUse,
|
|
525
|
+
flagModify: matchingUser.userAccessRight.flagModify,
|
|
526
|
+
flagOwn: matchingUser.userAccessRight.flagOwn
|
|
527
|
+
} : {
|
|
528
|
+
flagRead: false,
|
|
529
|
+
flagUse: false,
|
|
530
|
+
flagModify: false,
|
|
531
|
+
flagOwn: false
|
|
532
|
+
};
|
|
533
|
+
const groups = securable.groups.filter(
|
|
534
|
+
(group) => user2.userGroups.includes(group.id) || group.public === true
|
|
535
|
+
);
|
|
536
|
+
const groupsAccess = groups.map((group) => {
|
|
537
|
+
if (group.groupAccessRight) {
|
|
538
|
+
return group.groupAccessRight;
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
for (const groupAccess of groupsAccess) {
|
|
542
|
+
if (!securableAccessRights.flagRead && groupAccess.flagRead) {
|
|
543
|
+
securableAccessRights.flagRead = groupAccess.flagRead;
|
|
544
|
+
}
|
|
545
|
+
if (!securableAccessRights.flagUse && groupAccess.flagUse) {
|
|
546
|
+
securableAccessRights.flagUse = groupAccess.flagUse;
|
|
547
|
+
}
|
|
548
|
+
if (!securableAccessRights.flagModify && groupAccess.flagModify) {
|
|
549
|
+
securableAccessRights.flagModify = groupAccess.flagModify;
|
|
550
|
+
}
|
|
551
|
+
if (!securableAccessRights.flagOwn && groupAccess.flagOwn) {
|
|
552
|
+
securableAccessRights.flagOwn = groupAccess.flagOwn;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
const integrationsAccess = securable.integrations?.length > 0 ? securable.integrations.map((integration) => {
|
|
556
|
+
if (integration.integrationAccessRight) {
|
|
557
|
+
return integration.integrationAccessRight;
|
|
558
|
+
}
|
|
559
|
+
}) : [];
|
|
560
|
+
for (const integrationAccess of integrationsAccess) {
|
|
561
|
+
if (!securableAccessRights.flagRead && integrationAccess.flagRead) {
|
|
562
|
+
securableAccessRights.flagRead = integrationAccess.flagRead;
|
|
563
|
+
}
|
|
564
|
+
if (!securableAccessRights.flagUse && integrationAccess.flagUse) {
|
|
565
|
+
securableAccessRights.flagUse = integrationAccess.flagUse;
|
|
566
|
+
}
|
|
567
|
+
if (!securableAccessRights.flagModify && integrationAccess.flagModify) {
|
|
568
|
+
securableAccessRights.flagModify = integrationAccess.flagModify;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
return securableAccessRights;
|
|
572
|
+
};
|
|
573
|
+
const localize = (item, locale) => {
|
|
574
|
+
if (item === null || item === void 0) {
|
|
575
|
+
return "";
|
|
576
|
+
}
|
|
577
|
+
if (typeof item !== "object" || Object.keys(item).length === 0) {
|
|
578
|
+
if (typeof item === "object" && Object.keys(item).length === 0) {
|
|
579
|
+
return "";
|
|
580
|
+
}
|
|
581
|
+
return item;
|
|
582
|
+
}
|
|
583
|
+
let localizedItem;
|
|
584
|
+
localizedItem = locale && item[locale] ? item[locale] : item[Object.keys(item)[0]];
|
|
585
|
+
if (localizedItem === void 0 || localizedItem === null) {
|
|
586
|
+
localizedItem = "";
|
|
587
|
+
}
|
|
588
|
+
return localizedItem;
|
|
589
|
+
};
|
|
590
|
+
const treatedDashboards = [];
|
|
591
|
+
for (const dashboard of dashboards) {
|
|
592
|
+
const treatedDashboard = {
|
|
593
|
+
accessibleBy: [],
|
|
594
|
+
accessRights: combineRights(dashboard, user),
|
|
595
|
+
id: dashboard.id,
|
|
596
|
+
modifiedAt: dashboard.modified_at,
|
|
597
|
+
name: localize(dashboard.name, dashboardComponent.language),
|
|
598
|
+
slug: null,
|
|
599
|
+
tags: dashboard.tags.map((t5) => t5.tag).sort((t1, t22) => t1.localeCompare(t22))
|
|
600
|
+
};
|
|
601
|
+
const currentIntegration = dashboard.integrations.find(
|
|
602
|
+
(i6) => i6.id === integrationId
|
|
603
|
+
);
|
|
604
|
+
if (currentIntegration?.integrationAccessRight?.slug) {
|
|
605
|
+
treatedDashboard.slug = currentIntegration.integrationAccessRight.slug;
|
|
606
|
+
}
|
|
607
|
+
const users = dashboard.users.map((u3) => ({
|
|
608
|
+
model: "User",
|
|
609
|
+
id: u3.id,
|
|
610
|
+
name: localize(u3.name, user.locale_id)
|
|
611
|
+
}));
|
|
612
|
+
const groups = dashboard.groups.map((g2) => ({
|
|
613
|
+
model: "Group",
|
|
614
|
+
id: g2.id,
|
|
615
|
+
name: localize(g2.name, user.locale_id) || {}
|
|
616
|
+
}));
|
|
617
|
+
const integrations = dashboard.integrations.map((i6) => ({
|
|
618
|
+
model: "Integration",
|
|
619
|
+
id: i6.id,
|
|
620
|
+
name: localize(i6.name, user.locale_id) || {}
|
|
621
|
+
}));
|
|
622
|
+
treatedDashboard.accessibleBy = [...users, ...groups, ...integrations];
|
|
623
|
+
treatedDashboards.push(treatedDashboard);
|
|
624
|
+
}
|
|
625
|
+
return treatedDashboards;
|
|
626
|
+
};
|
|
627
|
+
var VERSION = "0.0.0-shared-luzmo";
|
|
628
|
+
var sanitizeUrl = (url) => {
|
|
629
|
+
const invalidPrototcolRegex = /^(%20|\s)*(javascript|data)/im;
|
|
630
|
+
const ctrlCharactersRegex = /[^\u0020-\u007E]/gim;
|
|
631
|
+
const urlSchemeRegex = /^([^:]+):/gm;
|
|
632
|
+
const relativeFirstCharacters = /* @__PURE__ */ new Set([".", "/"]);
|
|
633
|
+
const isRelativeUrlWithoutProtocol = (relativeUrl) => relativeFirstCharacters.has(relativeUrl[0]);
|
|
634
|
+
if (!url) {
|
|
635
|
+
return "about:blank";
|
|
636
|
+
}
|
|
637
|
+
const sanitizedUrl = url.replaceAll(ctrlCharactersRegex, "").trim();
|
|
638
|
+
if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {
|
|
639
|
+
return sanitizedUrl;
|
|
640
|
+
}
|
|
641
|
+
const urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex);
|
|
642
|
+
if (!urlSchemeParseResults) {
|
|
643
|
+
return sanitizedUrl;
|
|
644
|
+
}
|
|
645
|
+
const urlScheme = urlSchemeParseResults[0];
|
|
646
|
+
if (invalidPrototcolRegex.test(urlScheme)) {
|
|
647
|
+
return "about:blank";
|
|
648
|
+
}
|
|
649
|
+
return sanitizedUrl;
|
|
650
|
+
};
|
|
651
|
+
var cloneDeep = (obj) => JSON.parse(JSON.stringify(obj));
|
|
652
|
+
var isObject = (o6) => o6 && typeof o6 === "object";
|
|
653
|
+
var defaultsDeep = (target, defaults) => {
|
|
654
|
+
Object.entries(defaults).forEach(([k2, v2]) => {
|
|
655
|
+
if (k2 in target) {
|
|
656
|
+
if (target[k2] === void 0) {
|
|
657
|
+
target[k2] = v2;
|
|
658
|
+
} else {
|
|
659
|
+
target[k2] = isObject(v2) ? defaultsDeep(
|
|
660
|
+
target[k2],
|
|
661
|
+
v2
|
|
662
|
+
) : target[k2];
|
|
663
|
+
}
|
|
664
|
+
} else {
|
|
665
|
+
target[k2] = v2;
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
return target;
|
|
669
|
+
};
|
|
670
|
+
var uuidv4 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g, function(c4) {
|
|
671
|
+
const r7 = Math.random() * 16 | 0;
|
|
672
|
+
const v2 = c4 == "x" ? r7 : r7 & 3 | 8;
|
|
673
|
+
return v2.toString(16);
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
// libs/embed-libs/shared-embed/src/lib/helpers/iframe-url.ts
|
|
677
|
+
var createIframeUrl = (dashboardContent) => {
|
|
678
|
+
const searchString = [];
|
|
679
|
+
const {
|
|
680
|
+
appServer,
|
|
681
|
+
language,
|
|
682
|
+
qeVersion,
|
|
683
|
+
loaderBackground,
|
|
684
|
+
loaderSpinnerColor,
|
|
685
|
+
loaderSpinnerBackground,
|
|
686
|
+
loaderFontColor,
|
|
687
|
+
screenMode,
|
|
688
|
+
key,
|
|
689
|
+
token,
|
|
690
|
+
timezoneId,
|
|
691
|
+
itemEmbedding,
|
|
692
|
+
itemDimensions,
|
|
693
|
+
dashboardId,
|
|
694
|
+
dashboardSlug,
|
|
695
|
+
itemId,
|
|
696
|
+
mainColor,
|
|
697
|
+
accentColor,
|
|
698
|
+
editMode
|
|
699
|
+
} = dashboardContent.params;
|
|
700
|
+
if (language && language !== "auto") {
|
|
701
|
+
searchString.push("language=" + language);
|
|
702
|
+
}
|
|
703
|
+
if (qeVersion) {
|
|
704
|
+
searchString.push(`qe_version=${qeVersion}`);
|
|
705
|
+
}
|
|
706
|
+
if (loaderBackground) {
|
|
707
|
+
searchString.push(`ldrbg=${loaderBackground}`);
|
|
708
|
+
}
|
|
709
|
+
if (loaderFontColor) {
|
|
710
|
+
searchString.push(`ldrftclr=${loaderFontColor}`);
|
|
711
|
+
}
|
|
712
|
+
if (loaderSpinnerColor) {
|
|
713
|
+
searchString.push(`ldrspclr=${loaderSpinnerColor}`);
|
|
714
|
+
}
|
|
715
|
+
if (loaderSpinnerBackground) {
|
|
716
|
+
searchString.push(`ldrspbg=${loaderSpinnerBackground}`);
|
|
717
|
+
}
|
|
718
|
+
if (mainColor) {
|
|
719
|
+
searchString.push(`mainColor=${mainColor}`);
|
|
720
|
+
}
|
|
721
|
+
if (accentColor) {
|
|
722
|
+
searchString.push(`accentColor=${accentColor}`);
|
|
723
|
+
}
|
|
724
|
+
if (screenMode && screenMode !== "auto") {
|
|
725
|
+
searchString.push("screenMode=" + screenMode);
|
|
726
|
+
}
|
|
727
|
+
if (timezoneId) {
|
|
728
|
+
searchString.push("timezoneId=" + timezoneId);
|
|
729
|
+
}
|
|
730
|
+
if (itemEmbedding && itemDimensions && itemDimensions.width) {
|
|
731
|
+
searchString.push("width=" + itemDimensions.width);
|
|
732
|
+
}
|
|
733
|
+
if (itemEmbedding && itemDimensions && itemDimensions.height) {
|
|
734
|
+
searchString.push("height=" + itemDimensions.height);
|
|
735
|
+
}
|
|
736
|
+
if (editMode) {
|
|
737
|
+
searchString.push("editMode=" + editMode);
|
|
738
|
+
}
|
|
739
|
+
const keyTokenUrlAnchor = key && token ? "#" + key + ":" + token : "";
|
|
740
|
+
searchString.push("version=" + (dashboardContent.VERSION || VERSION));
|
|
741
|
+
const iframeUrl = itemEmbedding ? `${appServer}i/${dashboardId || dashboardSlug}/${itemId}?${encodeURIComponent(
|
|
742
|
+
searchString.join("&")
|
|
743
|
+
)}${keyTokenUrlAnchor}` : `${appServer}i/${dashboardId || dashboardSlug}?${encodeURIComponent(
|
|
744
|
+
searchString.join("&")
|
|
745
|
+
)}${keyTokenUrlAnchor}`;
|
|
746
|
+
return sanitizeUrl(iframeUrl);
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
// libs/embed-libs/shared-embed/src/lib/helpers/get-loader.ts
|
|
750
|
+
var getLoader = (dashboardComponent) => {
|
|
751
|
+
let errorMsg;
|
|
752
|
+
if (dashboardComponent.params.error || dashboardComponent.browserNotSupported.length > 0) {
|
|
753
|
+
dashboardComponent.params.error = true;
|
|
754
|
+
if (dashboardComponent.browserNotSupported) {
|
|
755
|
+
errorMsg = "Browser is not supported.";
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
const loadingMsg = translations_default.initializing[dashboardComponent.params.language] || translations_default.initializing.en;
|
|
759
|
+
return dashboardComponent.browserNotSupported || dashboardComponent.params.error ? { loadingMsg, errorMsg } : { loadingMsg, errorMsg: "" };
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
// libs/embed-libs/shared-embed/src/lib/helpers/promise-dispatch.ts
|
|
763
|
+
function resolvePromise(dashboardComponent, requestId, data) {
|
|
764
|
+
if (dashboardComponent.promises[requestId]) {
|
|
765
|
+
dashboardComponent.promises[requestId].resolve(data);
|
|
766
|
+
delete dashboardComponent.promises[requestId];
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
function rejectPromise(dashboardComponent, requestId, data) {
|
|
770
|
+
if (dashboardComponent.promises[requestId]) {
|
|
771
|
+
dashboardComponent.promises[requestId].reject(data);
|
|
772
|
+
delete dashboardComponent.promises[requestId];
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
// libs/embed-libs/shared-embed/src/lib/helpers/styles.ts
|
|
777
|
+
function containerStyles(dashboardComponent) {
|
|
778
|
+
const styles = {};
|
|
779
|
+
if (dashboardComponent.params.loaderBackground && !dashboardComponent.iframeLoaded) {
|
|
780
|
+
styles.background = dashboardComponent.params.loaderBackground;
|
|
781
|
+
}
|
|
782
|
+
return styles;
|
|
783
|
+
}
|
|
784
|
+
function containerLoaderStyles(dashboardComponent) {
|
|
785
|
+
const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
|
|
786
|
+
const chartHeightDefined = dashboardComponent.params.itemEmbedding && height !== "auto";
|
|
787
|
+
const display = dashboardComponent.iframeLoaded ? "none" : "";
|
|
788
|
+
return {
|
|
789
|
+
display,
|
|
790
|
+
height: `${chartHeightDefined ? height : dashboardComponent.minHeight}px`
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
function loaderStyles(dashboardComponent) {
|
|
794
|
+
const background = dashboardComponent.params.loaderBackground || DEFAULT_PARAMETERS.loaderBackground;
|
|
795
|
+
if (dashboardComponent.params.itemEmbedding) {
|
|
796
|
+
dashboardComponent.loaderSize = 24;
|
|
797
|
+
dashboardComponent.borderWidth = 4;
|
|
798
|
+
dashboardComponent.minHeight = 200;
|
|
799
|
+
const width = dashboardComponent.params.itemDimensions?.width || DEFAULT_PARAMETERS.itemDimensions.width;
|
|
800
|
+
const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
|
|
801
|
+
const chartWidthDefined = width !== "auto";
|
|
802
|
+
const chartHeightDefined = height !== "auto";
|
|
803
|
+
return {
|
|
804
|
+
background,
|
|
805
|
+
width: chartWidthDefined ? `${width}px` : "100%",
|
|
806
|
+
height: `${chartHeightDefined ? height : "200"}px`,
|
|
807
|
+
"min-height": chartHeightDefined ? "" : "200px"
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
return {
|
|
811
|
+
background
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
function plStyles(dashboardComponent) {
|
|
815
|
+
const {
|
|
816
|
+
loaderSpinnerColor: defaultSpinnerColor,
|
|
817
|
+
loaderSpinnerBackground: defaultSpinnerBackground
|
|
818
|
+
} = DEFAULT_PARAMETERS;
|
|
819
|
+
const spinnerColorBorder = generateBorderStyle(
|
|
820
|
+
dashboardComponent.borderWidth,
|
|
821
|
+
dashboardComponent.params.loaderSpinnerColor || defaultSpinnerColor
|
|
822
|
+
);
|
|
823
|
+
const spinnerBackgroundBorder = generateBorderStyle(
|
|
824
|
+
dashboardComponent.borderWidth,
|
|
825
|
+
dashboardComponent.params.loaderSpinnerBackground || defaultSpinnerBackground
|
|
826
|
+
);
|
|
827
|
+
const size = `${dashboardComponent.loaderSize}px`;
|
|
828
|
+
return {
|
|
829
|
+
"border-top": spinnerColorBorder,
|
|
830
|
+
"border-right": spinnerColorBorder,
|
|
831
|
+
"border-bottom": spinnerBackgroundBorder,
|
|
832
|
+
"border-left": spinnerBackgroundBorder,
|
|
833
|
+
width: size,
|
|
834
|
+
height: size
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
function lcStyles(dashboardComponent) {
|
|
838
|
+
const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
|
|
839
|
+
const chartHeightDefined = dashboardComponent.params.itemEmbedding && height !== "auto";
|
|
840
|
+
const getPaddingStr = (value) => `${(value - dashboardComponent.loaderSize - 32) / 2}px`;
|
|
841
|
+
const verticalPadding = dashboardComponent.params.itemId ? chartHeightDefined ? getPaddingStr(Number.parseInt(`${height}`, 10)) : getPaddingStr(dashboardComponent.minHeight) : "128px";
|
|
842
|
+
return {
|
|
843
|
+
padding: `${verticalPadding} 16px`
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
function calculateIframeStyles(dashboardComponent) {
|
|
847
|
+
const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
|
|
848
|
+
const width = dashboardComponent.params.itemDimensions?.width || DEFAULT_PARAMETERS.itemDimensions.width;
|
|
849
|
+
if (dashboardComponent.params.itemEmbedding && height !== "auto") {
|
|
850
|
+
dashboardComponent.iframeHeight = `${height}px`;
|
|
851
|
+
} else if (dashboardComponent.params.itemEmbedding) {
|
|
852
|
+
dashboardComponent.iframeHeight = "200px";
|
|
853
|
+
} else if (["editFull", "editLimited"].includes(dashboardComponent.params.editMode)) {
|
|
854
|
+
dashboardComponent.iframeHeight = "100%";
|
|
855
|
+
} else {
|
|
856
|
+
dashboardComponent.iframeHeight = "400px";
|
|
857
|
+
}
|
|
858
|
+
dashboardComponent.iframeWidth = dashboardComponent.params.itemEmbedding && width !== "auto" ? `${width}px` : "100%";
|
|
859
|
+
const styles = {
|
|
860
|
+
height: dashboardComponent.iframeHeight,
|
|
861
|
+
width: dashboardComponent.iframeWidth
|
|
862
|
+
};
|
|
863
|
+
if (dashboardComponent.iframeLoaded) {
|
|
864
|
+
styles.opacity = 1;
|
|
865
|
+
} else if (dashboardComponent.error) {
|
|
866
|
+
styles.opacity = 1;
|
|
867
|
+
styles.width = "100%";
|
|
868
|
+
styles.height = "400px";
|
|
869
|
+
} else {
|
|
870
|
+
styles.opacity = 0;
|
|
871
|
+
}
|
|
872
|
+
return styles;
|
|
873
|
+
}
|
|
874
|
+
function generateBorderStyle(borderWidth, color) {
|
|
875
|
+
return `${borderWidth}px solid ${color}`;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
// libs/embed-libs/shared-embed/src/lib/helpers/update-iframe-url.ts
|
|
879
|
+
var updateIframeUrl = (iframe, iframeUrl) => {
|
|
880
|
+
if (iframe?.contentWindow) {
|
|
881
|
+
iframe.contentWindow.location.replace(iframeUrl);
|
|
882
|
+
}
|
|
883
|
+
};
|
|
884
|
+
|
|
885
|
+
// libs/embed-libs/shared-embed/src/lib/methods/export-dashboard.ts
|
|
886
|
+
var exportDashboard = (dashboardComponent, iframe, format) => {
|
|
887
|
+
const requestId = uuidv4();
|
|
888
|
+
if (iframe?.contentWindow) {
|
|
889
|
+
iframe.contentWindow.postMessage(
|
|
890
|
+
{
|
|
891
|
+
action: "exportDashboard",
|
|
892
|
+
format: format || "png",
|
|
893
|
+
_version: dashboardComponent.VERSION,
|
|
894
|
+
requestId
|
|
895
|
+
},
|
|
896
|
+
"*"
|
|
897
|
+
);
|
|
898
|
+
return new Promise((resolve, reject) => {
|
|
899
|
+
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
900
|
+
setTimeout(() => {
|
|
901
|
+
if (dashboardComponent.promises[requestId]) {
|
|
902
|
+
const errorMessage = "exportDashboard request timed out.";
|
|
903
|
+
dashboardComponent.promises[requestId].reject(
|
|
904
|
+
new Error(errorMessage)
|
|
905
|
+
);
|
|
906
|
+
delete dashboardComponent.promises[requestId];
|
|
907
|
+
}
|
|
908
|
+
}, 12e5);
|
|
909
|
+
});
|
|
910
|
+
}
|
|
560
911
|
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
561
912
|
};
|
|
562
913
|
|
|
@@ -648,181 +999,51 @@ var getAccessibleDashboards = (dashboardComponent, iframe) => {
|
|
|
648
999
|
body: JSON.stringify({
|
|
649
1000
|
action: "get",
|
|
650
1001
|
version: "0.1.0",
|
|
651
|
-
key: dashboardComponent.authKey,
|
|
652
|
-
token: dashboardComponent.authToken,
|
|
653
|
-
find: {
|
|
654
|
-
where: { type: "dashboard", is_variant: false },
|
|
655
|
-
attributes: ["id", "name", "modified_at"],
|
|
656
|
-
order: [["modified_at", "desc"]],
|
|
657
|
-
include: [
|
|
658
|
-
{ model: "Tag", attributes: ["tag"] },
|
|
659
|
-
{ model: "User", attributes: ["id", "name"] },
|
|
660
|
-
{
|
|
661
|
-
model: "Group",
|
|
662
|
-
attributes: ["id", "name", "public"]
|
|
663
|
-
},
|
|
664
|
-
{ model: "Integration", attributes: ["id", "name"] }
|
|
665
|
-
]
|
|
666
|
-
}
|
|
667
|
-
})
|
|
668
|
-
}
|
|
669
|
-
);
|
|
670
|
-
responsePromise.then((response) => response.json()).then((data) => {
|
|
671
|
-
const dashboardList = data.rows.length > 0 ? formatDashboardList(
|
|
672
|
-
data.rows,
|
|
673
|
-
authorizationData.integrationId,
|
|
674
|
-
authorizationData.user,
|
|
675
|
-
dashboardComponent
|
|
676
|
-
) : [];
|
|
677
|
-
resolve(dashboardList);
|
|
678
|
-
});
|
|
679
|
-
}).catch((error) => {
|
|
680
|
-
reject(error);
|
|
681
|
-
});
|
|
682
|
-
} catch (error) {
|
|
683
|
-
reject(error);
|
|
684
|
-
}
|
|
685
|
-
})());
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
// libs/embed-libs/shared-embed/src/lib/methods/get-data.ts
|
|
689
|
-
var getData = (dashboardComponent, iframe, itemId) => {
|
|
690
|
-
if (iframe?.contentWindow) {
|
|
691
|
-
const requestId = uuidv4();
|
|
692
|
-
iframe.contentWindow.postMessage(
|
|
693
|
-
{
|
|
694
|
-
action: "getData",
|
|
695
|
-
id: itemId,
|
|
696
|
-
_version: dashboardComponent.VERSION,
|
|
697
|
-
requestId
|
|
698
|
-
},
|
|
699
|
-
"*"
|
|
700
|
-
);
|
|
701
|
-
return new Promise((resolve, reject) => {
|
|
702
|
-
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
703
|
-
setTimeout(() => {
|
|
704
|
-
if (dashboardComponent.promises[requestId]) {
|
|
705
|
-
const errorMessage = "getData request timed out.";
|
|
706
|
-
dashboardComponent.promises[requestId].reject(
|
|
707
|
-
new Error(errorMessage)
|
|
708
|
-
);
|
|
709
|
-
delete dashboardComponent.promises[requestId];
|
|
710
|
-
}
|
|
711
|
-
}, 2e3);
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
715
|
-
};
|
|
716
|
-
|
|
717
|
-
// libs/embed-libs/shared-embed/src/lib/methods/get-filters.ts
|
|
718
|
-
var getFilters = (dashboardComponent, iframe) => {
|
|
719
|
-
if (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
|
-
|
|
741
|
-
// libs/embed-libs/shared-embed/src/lib/methods/refresh-data.ts
|
|
742
|
-
var refreshData = (dashboardComponent, iframe, itemId) => {
|
|
743
|
-
if (iframe) {
|
|
744
|
-
iframe.contentWindow.postMessage(
|
|
745
|
-
{
|
|
746
|
-
action: "refreshData",
|
|
747
|
-
id: itemId ?? null,
|
|
748
|
-
_version: dashboardComponent.VERSION
|
|
749
|
-
},
|
|
750
|
-
"*"
|
|
751
|
-
);
|
|
752
|
-
return Promise.resolve();
|
|
753
|
-
}
|
|
754
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
755
|
-
};
|
|
756
|
-
|
|
757
|
-
// libs/embed-libs/shared-embed/src/lib/methods/reload-dashboard.ts
|
|
758
|
-
var reloadDashboard = (dashboardComponent, iframe) => {
|
|
759
|
-
if (iframe) {
|
|
760
|
-
iframe.contentWindow.postMessage(
|
|
761
|
-
{ action: "reloadDashboard", _version: dashboardComponent.VERSION },
|
|
762
|
-
"*"
|
|
763
|
-
);
|
|
764
|
-
return Promise.resolve();
|
|
765
|
-
}
|
|
766
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
767
|
-
};
|
|
768
|
-
|
|
769
|
-
// libs/embed-libs/shared-embed/src/lib/methods/set-authorization.ts
|
|
770
|
-
var setAuthorization = (dashboardComponent, iframe, key, token) => {
|
|
771
|
-
if (iframe) {
|
|
772
|
-
iframe.contentWindow.postMessage(
|
|
773
|
-
{
|
|
774
|
-
action: "setAuthorization",
|
|
775
|
-
key,
|
|
776
|
-
token,
|
|
777
|
-
_version: dashboardComponent.VERSION
|
|
778
|
-
},
|
|
779
|
-
"*"
|
|
780
|
-
);
|
|
781
|
-
return Promise.resolve();
|
|
782
|
-
}
|
|
783
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
784
|
-
};
|
|
785
|
-
|
|
786
|
-
// libs/embed-libs/shared-embed/src/lib/methods/set-edit-mode.ts
|
|
787
|
-
var setEditMode = (dashboardComponent, iframe, editMode) => {
|
|
788
|
-
if (iframe && iframe.contentWindow) {
|
|
789
|
-
const requestId = uuidv4();
|
|
790
|
-
if (dashboardComponent.params.editMode === editMode) {
|
|
791
|
-
return Promise.reject(
|
|
792
|
-
new Error("editMode parameter is currently already set to " + editMode)
|
|
793
|
-
);
|
|
794
|
-
} else if (editMode !== "editFull" && editMode !== "editLimited" && editMode !== "view") {
|
|
795
|
-
return Promise.reject(
|
|
796
|
-
new Error(
|
|
797
|
-
"The editMode parameter must be one of the following values: 'editFull', 'editLimited' or 'view'."
|
|
798
|
-
)
|
|
799
|
-
);
|
|
1002
|
+
key: dashboardComponent.authKey,
|
|
1003
|
+
token: dashboardComponent.authToken,
|
|
1004
|
+
find: {
|
|
1005
|
+
where: { type: "dashboard", is_variant: false },
|
|
1006
|
+
attributes: ["id", "name", "modified_at"],
|
|
1007
|
+
order: [["modified_at", "desc"]],
|
|
1008
|
+
include: [
|
|
1009
|
+
{ model: "Tag", attributes: ["tag"] },
|
|
1010
|
+
{ model: "User", attributes: ["id", "name"] },
|
|
1011
|
+
{
|
|
1012
|
+
model: "Group",
|
|
1013
|
+
attributes: ["id", "name", "public"]
|
|
1014
|
+
},
|
|
1015
|
+
{ model: "Integration", attributes: ["id", "name"] }
|
|
1016
|
+
]
|
|
1017
|
+
}
|
|
1018
|
+
})
|
|
1019
|
+
}
|
|
1020
|
+
);
|
|
1021
|
+
responsePromise.then((response) => response.json()).then((data) => {
|
|
1022
|
+
const dashboardList = data.rows.length > 0 ? formatDashboardList(
|
|
1023
|
+
data.rows,
|
|
1024
|
+
authorizationData.integrationId,
|
|
1025
|
+
authorizationData.user,
|
|
1026
|
+
dashboardComponent
|
|
1027
|
+
) : [];
|
|
1028
|
+
resolve(dashboardList);
|
|
1029
|
+
});
|
|
1030
|
+
}).catch((error) => {
|
|
1031
|
+
reject(error);
|
|
1032
|
+
});
|
|
1033
|
+
} catch (error) {
|
|
1034
|
+
reject(error);
|
|
800
1035
|
}
|
|
801
|
-
|
|
802
|
-
{
|
|
803
|
-
action: "setEditMode",
|
|
804
|
-
editMode,
|
|
805
|
-
_version: dashboardComponent.VERSION,
|
|
806
|
-
requestId
|
|
807
|
-
},
|
|
808
|
-
"*"
|
|
809
|
-
);
|
|
810
|
-
return new Promise((resolve, reject) => {
|
|
811
|
-
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
812
|
-
});
|
|
813
|
-
}
|
|
814
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
1036
|
+
})());
|
|
815
1037
|
};
|
|
816
1038
|
|
|
817
|
-
// libs/embed-libs/shared-embed/src/lib/methods/
|
|
818
|
-
var
|
|
819
|
-
if (iframe) {
|
|
1039
|
+
// libs/embed-libs/shared-embed/src/lib/methods/get-data.ts
|
|
1040
|
+
var getData = (dashboardComponent, iframe, itemId) => {
|
|
1041
|
+
if (iframe?.contentWindow) {
|
|
820
1042
|
const requestId = uuidv4();
|
|
821
1043
|
iframe.contentWindow.postMessage(
|
|
822
1044
|
{
|
|
823
|
-
action: "
|
|
824
|
-
itemId,
|
|
825
|
-
filters,
|
|
1045
|
+
action: "getData",
|
|
1046
|
+
id: itemId,
|
|
826
1047
|
_version: dashboardComponent.VERSION,
|
|
827
1048
|
requestId
|
|
828
1049
|
},
|
|
@@ -832,688 +1053,536 @@ var setFilters = (dashboardComponent, iframe, itemId, filters) => {
|
|
|
832
1053
|
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
833
1054
|
setTimeout(() => {
|
|
834
1055
|
if (dashboardComponent.promises[requestId]) {
|
|
835
|
-
const errorMessage = "
|
|
836
|
-
dashboardComponent.promises[requestId].reject(
|
|
837
|
-
new Error(errorMessage)
|
|
838
|
-
);
|
|
839
|
-
delete dashboardComponent.promises[requestId];
|
|
840
|
-
}
|
|
841
|
-
}, 2e3);
|
|
842
|
-
});
|
|
843
|
-
}
|
|
844
|
-
return Promise.reject();
|
|
845
|
-
};
|
|
846
|
-
|
|
847
|
-
// libs/embed-libs/shared-embed/src/lib/methods/set-preview.ts
|
|
848
|
-
var setPreview = (dashboardComponent, iframe, preview) => {
|
|
849
|
-
if (iframe) {
|
|
850
|
-
const requestId = uuidv4();
|
|
851
|
-
iframe.contentWindow.postMessage(
|
|
852
|
-
{
|
|
853
|
-
action: "setPreview",
|
|
854
|
-
preview,
|
|
855
|
-
requestId,
|
|
856
|
-
_version: dashboardComponent.VERSION
|
|
857
|
-
},
|
|
858
|
-
"*"
|
|
859
|
-
);
|
|
860
|
-
return new Promise((resolve, reject) => {
|
|
861
|
-
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
862
|
-
setTimeout(() => {
|
|
863
|
-
if (dashboardComponent.promises[requestId]) {
|
|
864
|
-
const errorMessage = "setPreview request timed out.";
|
|
1056
|
+
const errorMessage = "getData request timed out.";
|
|
865
1057
|
dashboardComponent.promises[requestId].reject(
|
|
866
1058
|
new Error(errorMessage)
|
|
867
1059
|
);
|
|
868
1060
|
delete dashboardComponent.promises[requestId];
|
|
869
|
-
}
|
|
870
|
-
}, 2e3);
|
|
871
|
-
});
|
|
872
|
-
}
|
|
873
|
-
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
874
|
-
};
|
|
875
|
-
|
|
876
|
-
// libs/embed-libs/shared-embed/src/lib/service/calculate-dimensions.ts
|
|
877
|
-
var _setCalculatedDimensions = (dashboardComponent) => {
|
|
878
|
-
if (!dashboardComponent.dimensions) {
|
|
879
|
-
dashboardComponent.params.error = true;
|
|
880
|
-
_handleError("Got no valid dimensions.", dashboardComponent.params);
|
|
881
|
-
return;
|
|
882
|
-
}
|
|
883
|
-
const dashboardDimensionKeys = Object.keys(
|
|
884
|
-
dashboardComponent.dimensions
|
|
885
|
-
);
|
|
886
|
-
const availableScreenModeExtents = [];
|
|
887
|
-
let currentMode;
|
|
888
|
-
let currentWidth = 0;
|
|
889
|
-
let currentHeight = 0;
|
|
890
|
-
if (!dashboardComponent.params.switchScreenModeOnResize && dashboardComponent.currentScreenMode) {
|
|
891
|
-
dashboardComponent.params.screenMode = dashboardComponent.currentScreenMode;
|
|
892
|
-
}
|
|
893
|
-
if (dashboardComponent.dimensions && dashboardDimensionKeys?.[0] === "fixed") {
|
|
894
|
-
currentMode = "fixed";
|
|
895
|
-
currentWidth = dashboardComponent.dimensions.fixed[0];
|
|
896
|
-
currentHeight = dashboardComponent.dimensions.fixed[1];
|
|
897
|
-
} else {
|
|
898
|
-
const screenModes = [
|
|
899
|
-
"mobile",
|
|
900
|
-
"tablet",
|
|
901
|
-
"desktop",
|
|
902
|
-
"largeScreen"
|
|
903
|
-
];
|
|
904
|
-
if (dashboardComponent.params.itemEmbedding) {
|
|
905
|
-
const [firstMatch] = dashboardDimensionKeys;
|
|
906
|
-
let match = cloneDeep(firstMatch);
|
|
907
|
-
for (const screenMode of screenModes) {
|
|
908
|
-
const found = dashboardDimensionKeys.find((key) => key === screenMode);
|
|
909
|
-
if (found) {
|
|
910
|
-
match = cloneDeep(found);
|
|
911
|
-
} else {
|
|
912
|
-
dashboardComponent.dimensions[screenMode] = dashboardComponent.dimensions[match];
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
for (const key of dashboardDimensionKeys) {
|
|
917
|
-
if (screenModes.includes(key)) {
|
|
918
|
-
const screenMode = EXTENTS.find((extent) => extent.mode === key);
|
|
919
|
-
availableScreenModeExtents.push({
|
|
920
|
-
...screenMode,
|
|
921
|
-
height: dashboardComponent.dimensions[key][1] || 50
|
|
922
|
-
});
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
if (!availableScreenModeExtents.map((screenModeExtent) => screenModeExtent.mode).includes(dashboardComponent.params.screenMode)) {
|
|
926
|
-
dashboardComponent.params.screenMode = "auto";
|
|
927
|
-
}
|
|
928
|
-
if (dashboardComponent.params.screenMode === "auto") {
|
|
929
|
-
availableScreenModeExtents.sort(
|
|
930
|
-
(a3, b3) => screenModes.indexOf(a3.mode) - screenModes.indexOf(b3.mode)
|
|
931
|
-
);
|
|
932
|
-
for (const screenModeExtent of availableScreenModeExtents) {
|
|
933
|
-
const [screenModeExtentMinWidth, screenModeExtentMaxWidth] = screenModeExtent.width;
|
|
934
|
-
if (dashboardComponent.params.itemEmbedding && dashboardComponent.params.itemDimensions && dashboardComponent.params.itemDimensions.width !== "auto" && dashboardComponent.params.itemDimensions.height === "auto") {
|
|
935
|
-
if (screenModeExtentMinWidth < dashboardComponent.params.itemDimensions.width) {
|
|
936
|
-
currentMode = screenModeExtent.mode;
|
|
937
|
-
currentWidth = Number.parseInt(
|
|
938
|
-
dashboardComponent.params.itemDimensions.width,
|
|
939
|
-
10
|
|
940
|
-
);
|
|
941
|
-
currentHeight = dashboardComponent.dimensions[currentMode][1];
|
|
942
|
-
}
|
|
943
|
-
} else {
|
|
944
|
-
if (screenModeExtentMinWidth < dashboardComponent.containerWidth) {
|
|
945
|
-
currentMode = screenModeExtent.mode;
|
|
946
|
-
if (dashboardComponent.params.itemEmbedding) {
|
|
947
|
-
currentWidth = dashboardComponent.params.itemDimensions?.width && dashboardComponent.params.itemDimensions?.width !== "auto" ? Number.parseInt(
|
|
948
|
-
dashboardComponent.params.itemDimensions.width,
|
|
949
|
-
10
|
|
950
|
-
) : Math.min(
|
|
951
|
-
dashboardComponent.containerWidth,
|
|
952
|
-
screenModeExtentMaxWidth
|
|
953
|
-
);
|
|
954
|
-
currentHeight = dashboardComponent.params.itemDimensions?.height && dashboardComponent.params.itemDimensions?.height !== "auto" ? Number.parseInt(
|
|
955
|
-
dashboardComponent.params.itemDimensions.height,
|
|
956
|
-
10
|
|
957
|
-
) : dashboardComponent.dimensions[currentMode][1];
|
|
958
|
-
if (dashboardComponent.params.itemDimensions && dashboardComponent.params.itemDimensions.width !== "auto" && dashboardComponent.params.itemDimensions.height === "auto") {
|
|
959
|
-
currentWidth = Number.parseInt(
|
|
960
|
-
dashboardComponent.params.itemDimensions.width,
|
|
961
|
-
10
|
|
962
|
-
);
|
|
963
|
-
currentHeight = dashboardComponent.dimensions[currentMode][1];
|
|
964
|
-
}
|
|
965
|
-
} else {
|
|
966
|
-
currentWidth = Math.max(
|
|
967
|
-
Math.min(
|
|
968
|
-
screenModeExtentMaxWidth,
|
|
969
|
-
dashboardComponent.containerWidth
|
|
970
|
-
),
|
|
971
|
-
screenModeExtentMinWidth
|
|
972
|
-
);
|
|
973
|
-
currentHeight = screenModeExtent.height;
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
} else {
|
|
979
|
-
const {
|
|
980
|
-
height: chosenModeHeight,
|
|
981
|
-
width: [chosenModeMinWidth, chosenModeMaxWidth]
|
|
982
|
-
} = availableScreenModeExtents.find(
|
|
983
|
-
(d3) => d3.mode === dashboardComponent.params.screenMode
|
|
984
|
-
);
|
|
985
|
-
currentMode = dashboardComponent.params.screenMode;
|
|
986
|
-
currentWidth = Math.max(
|
|
987
|
-
Math.min(chosenModeMaxWidth, dashboardComponent.containerWidth),
|
|
988
|
-
chosenModeMinWidth
|
|
989
|
-
);
|
|
990
|
-
currentHeight = chosenModeHeight;
|
|
991
|
-
if (dashboardComponent.params.itemEmbedding) {
|
|
992
|
-
if (dashboardComponent.params.itemDimensions?.width && dashboardComponent.params.itemDimensions?.width !== "auto") {
|
|
993
|
-
currentWidth = Number.parseInt(
|
|
994
|
-
dashboardComponent.params.itemDimensions.width,
|
|
995
|
-
10
|
|
996
|
-
);
|
|
997
|
-
}
|
|
998
|
-
if (dashboardComponent.params.itemDimensions?.height && dashboardComponent.params.itemDimensions?.height !== "auto") {
|
|
999
|
-
currentHeight = Number.parseInt(
|
|
1000
|
-
dashboardComponent.params.itemDimensions.height,
|
|
1001
|
-
10
|
|
1002
|
-
);
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
if (!currentMode && availableScreenModeExtents.length > 0) {
|
|
1007
|
-
const [lowestModeExtent] = availableScreenModeExtents;
|
|
1008
|
-
currentMode = lowestModeExtent.mode;
|
|
1009
|
-
currentWidth = lowestModeExtent.width[0];
|
|
1010
|
-
currentHeight = lowestModeExtent.height;
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
dashboardComponent.currentScreenMode = currentMode;
|
|
1014
|
-
const style = {
|
|
1015
|
-
height: currentHeight === 0 ? "100%" : `${String(currentHeight)}px`,
|
|
1016
|
-
width: currentWidth === 0 ? "100%" : `${String(currentWidth)}px`,
|
|
1017
|
-
opacity: 1
|
|
1018
|
-
};
|
|
1019
|
-
const dashboardEditModes = ["editFull", "editLimited"];
|
|
1020
|
-
if (dashboardEditModes.includes(dashboardComponent.params.editMode)) {
|
|
1021
|
-
style.height = "100%";
|
|
1022
|
-
style.width = "100%";
|
|
1023
|
-
} else if (dashboardComponent.params.itemEmbedding && dashboardComponent.params.itemDimensions) {
|
|
1024
|
-
style.height = dashboardComponent.params.itemDimensions.height === "auto" ? style.height : `${String(dashboardComponent.params.itemDimensions.height).replace(
|
|
1025
|
-
"px",
|
|
1026
|
-
""
|
|
1027
|
-
)}px`;
|
|
1028
|
-
style.width = dashboardComponent.params.itemDimensions.width === "auto" ? style.width : `${String(dashboardComponent.params.itemDimensions.width).replace(
|
|
1029
|
-
"px",
|
|
1030
|
-
""
|
|
1031
|
-
)}px`;
|
|
1032
|
-
} else {
|
|
1033
|
-
style.height = currentHeight === 0 ? "100%" : `${String(currentHeight)}px`;
|
|
1034
|
-
style.width = currentWidth === 0 ? "100%" : `${String(currentWidth)}px`;
|
|
1061
|
+
}
|
|
1062
|
+
}, 2e3);
|
|
1063
|
+
});
|
|
1035
1064
|
}
|
|
1036
|
-
|
|
1037
|
-
dashboardComponent.iframeStyle = style;
|
|
1065
|
+
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
1038
1066
|
};
|
|
1039
1067
|
|
|
1040
|
-
// libs/embed-libs/shared-embed/src/lib/
|
|
1041
|
-
var
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
"appServer",
|
|
1048
|
-
"language",
|
|
1049
|
-
"apiHost"
|
|
1050
|
-
];
|
|
1051
|
-
const requiredStringOrEmptyParams = [
|
|
1052
|
-
"key",
|
|
1053
|
-
"token",
|
|
1054
|
-
"screenMode",
|
|
1055
|
-
"timezoneId",
|
|
1056
|
-
"itemId",
|
|
1057
|
-
"container",
|
|
1058
|
-
"loaderBackground",
|
|
1059
|
-
"loaderFontColor",
|
|
1060
|
-
"loaderSpinnerColor",
|
|
1061
|
-
"loaderSpinnerBackground"
|
|
1062
|
-
];
|
|
1063
|
-
const objectParams = ["itemDimensions"];
|
|
1064
|
-
const screenModes = [
|
|
1065
|
-
"mobile",
|
|
1066
|
-
"tablet",
|
|
1067
|
-
"desktop",
|
|
1068
|
-
"largeScreen",
|
|
1069
|
-
"fixed",
|
|
1070
|
-
"auto"
|
|
1071
|
-
];
|
|
1072
|
-
for (const key of defaultKeys) {
|
|
1073
|
-
if (dashboardContent.params[key] === null) {
|
|
1074
|
-
delete dashboardContent.params[key];
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
dashboardContent.params = defaultsDeep(
|
|
1078
|
-
dashboardContent.params,
|
|
1079
|
-
DEFAULT_PARAMETERS
|
|
1080
|
-
);
|
|
1081
|
-
if ((!dashboardContent.params.dashboardId || typeof dashboardContent.params.dashboardId !== "string") && (!dashboardContent.params.dashboardSlug || typeof dashboardContent.params.dashboardSlug !== "string")) {
|
|
1082
|
-
delete dashboardContent.params.dashboardId;
|
|
1083
|
-
delete dashboardContent.params.dashboardSlug;
|
|
1084
|
-
}
|
|
1085
|
-
for (const key of requiredStringParams) {
|
|
1086
|
-
if (typeof dashboardContent.params[key] !== "string") {
|
|
1087
|
-
delete dashboardContent.params[key];
|
|
1088
|
-
errorMessages.push(`${key} needs to be of type string.`);
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
for (const key of requiredStringOrEmptyParams) {
|
|
1092
|
-
if (typeof dashboardContent.params[key] !== "string" && dashboardContent.params[key] !== null && dashboardContent.params[key] !== void 0) {
|
|
1093
|
-
delete dashboardContent.params[key];
|
|
1094
|
-
errorMessages.push(`${key} needs to be of type string or empty.`);
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
if (dashboardContent.params.screenMode && !screenModes.includes(dashboardContent.params.screenMode)) {
|
|
1098
|
-
const validTypesString = screenModes.map((mode) => `"${mode}"`).join(", ");
|
|
1099
|
-
errorMessages.push(
|
|
1100
|
-
`"screenMode" needs should be one of these types: ${validTypesString}`
|
|
1068
|
+
// libs/embed-libs/shared-embed/src/lib/methods/get-filters.ts
|
|
1069
|
+
var getFilters = (dashboardComponent, iframe) => {
|
|
1070
|
+
if (iframe?.contentWindow) {
|
|
1071
|
+
const requestId = uuidv4();
|
|
1072
|
+
iframe.contentWindow.postMessage(
|
|
1073
|
+
{ action: "getFilters", _version: dashboardComponent.VERSION, requestId },
|
|
1074
|
+
"*"
|
|
1101
1075
|
);
|
|
1102
|
-
|
|
1076
|
+
return new Promise((resolve, reject) => {
|
|
1077
|
+
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
1078
|
+
setTimeout(() => {
|
|
1079
|
+
if (dashboardComponent.promises[requestId]) {
|
|
1080
|
+
const errorMessage = "getFilters request timed out.";
|
|
1081
|
+
dashboardComponent.promises[requestId].reject(
|
|
1082
|
+
new Error(errorMessage)
|
|
1083
|
+
);
|
|
1084
|
+
delete dashboardComponent.promises[requestId];
|
|
1085
|
+
}
|
|
1086
|
+
}, 2e3);
|
|
1087
|
+
});
|
|
1103
1088
|
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1089
|
+
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
1090
|
+
};
|
|
1091
|
+
|
|
1092
|
+
// libs/embed-libs/shared-embed/src/lib/methods/refresh-data.ts
|
|
1093
|
+
var refreshData = (dashboardComponent, iframe, itemId) => {
|
|
1094
|
+
if (iframe) {
|
|
1095
|
+
iframe.contentWindow.postMessage(
|
|
1096
|
+
{
|
|
1097
|
+
action: "refreshData",
|
|
1098
|
+
id: itemId ?? null,
|
|
1099
|
+
_version: dashboardComponent.VERSION
|
|
1100
|
+
},
|
|
1101
|
+
"*"
|
|
1102
|
+
);
|
|
1103
|
+
return Promise.resolve();
|
|
1106
1104
|
}
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1105
|
+
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
// libs/embed-libs/shared-embed/src/lib/methods/reload-dashboard.ts
|
|
1109
|
+
var reloadDashboard = (dashboardComponent, iframe) => {
|
|
1110
|
+
if (iframe) {
|
|
1111
|
+
iframe.contentWindow.postMessage(
|
|
1112
|
+
{ action: "reloadDashboard", _version: dashboardComponent.VERSION },
|
|
1113
|
+
"*"
|
|
1114
|
+
);
|
|
1115
|
+
return Promise.resolve();
|
|
1112
1116
|
}
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1117
|
+
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
1118
|
+
};
|
|
1119
|
+
|
|
1120
|
+
// libs/embed-libs/shared-embed/src/lib/methods/set-authorization.ts
|
|
1121
|
+
var setAuthorization = (dashboardComponent, iframe, key, token) => {
|
|
1122
|
+
if (iframe) {
|
|
1123
|
+
iframe.contentWindow.postMessage(
|
|
1124
|
+
{
|
|
1125
|
+
action: "setAuthorization",
|
|
1126
|
+
key,
|
|
1127
|
+
token,
|
|
1128
|
+
_version: dashboardComponent.VERSION
|
|
1129
|
+
},
|
|
1130
|
+
"*"
|
|
1131
|
+
);
|
|
1132
|
+
return Promise.resolve();
|
|
1116
1133
|
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1134
|
+
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
// libs/embed-libs/shared-embed/src/lib/methods/set-edit-mode.ts
|
|
1138
|
+
var setEditMode = (dashboardComponent, iframe, editMode) => {
|
|
1139
|
+
if (iframe && iframe.contentWindow) {
|
|
1140
|
+
const requestId = uuidv4();
|
|
1141
|
+
if (dashboardComponent.params.editMode === editMode) {
|
|
1142
|
+
return Promise.reject(
|
|
1143
|
+
new Error("editMode parameter is currently already set to " + editMode)
|
|
1144
|
+
);
|
|
1145
|
+
} else if (editMode !== "editFull" && editMode !== "editLimited" && editMode !== "view") {
|
|
1146
|
+
return Promise.reject(
|
|
1147
|
+
new Error(
|
|
1148
|
+
"The editMode parameter must be one of the following values: 'editFull', 'editLimited' or 'view'."
|
|
1149
|
+
)
|
|
1150
|
+
);
|
|
1130
1151
|
}
|
|
1152
|
+
iframe.contentWindow.postMessage(
|
|
1153
|
+
{
|
|
1154
|
+
action: "setEditMode",
|
|
1155
|
+
editMode,
|
|
1156
|
+
_version: dashboardComponent.VERSION,
|
|
1157
|
+
requestId
|
|
1158
|
+
},
|
|
1159
|
+
"*"
|
|
1160
|
+
);
|
|
1161
|
+
return new Promise((resolve, reject) => {
|
|
1162
|
+
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
1163
|
+
});
|
|
1131
1164
|
}
|
|
1132
|
-
|
|
1133
|
-
dashboardContent.params,
|
|
1134
|
-
DEFAULT_PARAMETERS
|
|
1135
|
-
);
|
|
1136
|
-
if (dashboardContent.params.screenMode && dashboardContent.params.screenMode !== "auto") {
|
|
1137
|
-
dashboardContent.params.switchScreenModeOnResize = false;
|
|
1138
|
-
}
|
|
1139
|
-
if (dashboardContent.params.itemDimensions.width !== "auto") {
|
|
1140
|
-
dashboardContent.params.itemDimensions.width = Number.parseInt(
|
|
1141
|
-
`${dashboardContent.params.itemDimensions.width}`.replace("px", ""),
|
|
1142
|
-
10
|
|
1143
|
-
) || "auto";
|
|
1144
|
-
}
|
|
1145
|
-
if (dashboardContent.params.itemDimensions.height !== "auto") {
|
|
1146
|
-
dashboardContent.params.itemDimensions.height = Number.parseInt(
|
|
1147
|
-
`${dashboardContent.params.itemDimensions.height}`.replace("px", ""),
|
|
1148
|
-
10
|
|
1149
|
-
) || "auto";
|
|
1150
|
-
}
|
|
1151
|
-
dashboardContent.params.itemEmbedding = !!dashboardContent.params.itemId;
|
|
1152
|
-
if (dashboardContent.params.error || errorMessages.length > 0) {
|
|
1153
|
-
_handleError(errorMessages.join("\n"), dashboardContent.params);
|
|
1154
|
-
}
|
|
1165
|
+
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
1155
1166
|
};
|
|
1156
1167
|
|
|
1157
|
-
// libs/embed-libs/shared-embed/src/lib/
|
|
1158
|
-
var
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
const callback = () => {
|
|
1181
|
-
if (!remote.inited) {
|
|
1182
|
-
remote.lib = window[remoteId];
|
|
1183
|
-
remote.lib.init(wrapShareModule(remote.from));
|
|
1184
|
-
remote.inited = true;
|
|
1168
|
+
// libs/embed-libs/shared-embed/src/lib/methods/set-filters.ts
|
|
1169
|
+
var setFilters = (dashboardComponent, iframe, itemId, filters) => {
|
|
1170
|
+
if (iframe) {
|
|
1171
|
+
const requestId = uuidv4();
|
|
1172
|
+
iframe.contentWindow.postMessage(
|
|
1173
|
+
{
|
|
1174
|
+
action: "setFilters",
|
|
1175
|
+
itemId,
|
|
1176
|
+
filters,
|
|
1177
|
+
_version: dashboardComponent.VERSION,
|
|
1178
|
+
requestId
|
|
1179
|
+
},
|
|
1180
|
+
"*"
|
|
1181
|
+
);
|
|
1182
|
+
return new Promise((resolve, reject) => {
|
|
1183
|
+
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
1184
|
+
setTimeout(() => {
|
|
1185
|
+
if (dashboardComponent.promises[requestId]) {
|
|
1186
|
+
const errorMessage = "setFilters request timed out.";
|
|
1187
|
+
dashboardComponent.promises[requestId].reject(
|
|
1188
|
+
new Error(errorMessage)
|
|
1189
|
+
);
|
|
1190
|
+
delete dashboardComponent.promises[requestId];
|
|
1185
1191
|
}
|
|
1186
|
-
|
|
1187
|
-
};
|
|
1188
|
-
return loadJS(remote.url, callback);
|
|
1192
|
+
}, 2e3);
|
|
1189
1193
|
});
|
|
1190
|
-
}
|
|
1194
|
+
}
|
|
1195
|
+
return Promise.reject();
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1198
|
+
// libs/embed-libs/shared-embed/src/lib/methods/set-preview.ts
|
|
1199
|
+
var setPreview = (dashboardComponent, iframe, preview) => {
|
|
1200
|
+
if (iframe) {
|
|
1201
|
+
const requestId = uuidv4();
|
|
1202
|
+
iframe.contentWindow.postMessage(
|
|
1203
|
+
{
|
|
1204
|
+
action: "setPreview",
|
|
1205
|
+
preview,
|
|
1206
|
+
requestId,
|
|
1207
|
+
_version: dashboardComponent.VERSION
|
|
1208
|
+
},
|
|
1209
|
+
"*"
|
|
1210
|
+
);
|
|
1191
1211
|
return new Promise((resolve, reject) => {
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
remote.lib = lib;
|
|
1203
|
-
remote.lib.init(shareScope);
|
|
1204
|
-
remote.inited = true;
|
|
1205
|
-
}
|
|
1206
|
-
resolve(remote.lib);
|
|
1207
|
-
}).catch(reject);
|
|
1208
|
-
});
|
|
1212
|
+
dashboardComponent.promises[requestId] = { resolve, reject };
|
|
1213
|
+
setTimeout(() => {
|
|
1214
|
+
if (dashboardComponent.promises[requestId]) {
|
|
1215
|
+
const errorMessage = "setPreview request timed out.";
|
|
1216
|
+
dashboardComponent.promises[requestId].reject(
|
|
1217
|
+
new Error(errorMessage)
|
|
1218
|
+
);
|
|
1219
|
+
delete dashboardComponent.promises[requestId];
|
|
1220
|
+
}
|
|
1221
|
+
}, 2e3);
|
|
1209
1222
|
});
|
|
1210
1223
|
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
if (!(module2 == null ? void 0 : module2.default) && need) {
|
|
1214
|
-
const obj = /* @__PURE__ */ Object.create(null);
|
|
1215
|
-
obj.default = module2;
|
|
1216
|
-
obj.__esModule = true;
|
|
1217
|
-
return obj;
|
|
1218
|
-
}
|
|
1219
|
-
return module2;
|
|
1220
|
-
}
|
|
1221
|
-
async function __federationMethodGetRemote(remoteName, componentName) {
|
|
1222
|
-
return __federationMethodEnsure(remoteName).then((remote) => remote.get(componentName).then((factory) => factory()));
|
|
1223
|
-
}
|
|
1224
|
+
return Promise.reject(new Error("Cannot retrieve contentWindow."));
|
|
1225
|
+
};
|
|
1224
1226
|
|
|
1225
|
-
//
|
|
1226
|
-
var
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
constructor(t5, e7, o6) {
|
|
1232
|
-
if (this._$cssResult$ = true, o6 !== s)
|
|
1233
|
-
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
1234
|
-
this.cssText = t5, this.t = e7;
|
|
1235
|
-
}
|
|
1236
|
-
get styleSheet() {
|
|
1237
|
-
let t5 = this.o;
|
|
1238
|
-
const s4 = this.t;
|
|
1239
|
-
if (e && void 0 === t5) {
|
|
1240
|
-
const e7 = void 0 !== s4 && 1 === s4.length;
|
|
1241
|
-
e7 && (t5 = o.get(s4)), void 0 === t5 && ((this.o = t5 = new CSSStyleSheet()).replaceSync(this.cssText), e7 && o.set(s4, t5));
|
|
1242
|
-
}
|
|
1243
|
-
return t5;
|
|
1227
|
+
// libs/embed-libs/shared-embed/src/lib/service/calculate-dimensions.ts
|
|
1228
|
+
var _setCalculatedDimensions = (dashboardComponent) => {
|
|
1229
|
+
if (!dashboardComponent.dimensions) {
|
|
1230
|
+
dashboardComponent.params.error = true;
|
|
1231
|
+
_handleError("Got no valid dimensions.", dashboardComponent.params);
|
|
1232
|
+
return;
|
|
1244
1233
|
}
|
|
1245
|
-
|
|
1246
|
-
|
|
1234
|
+
const dashboardDimensionKeys = Object.keys(
|
|
1235
|
+
dashboardComponent.dimensions
|
|
1236
|
+
);
|
|
1237
|
+
const availableScreenModeExtents = [];
|
|
1238
|
+
let currentMode;
|
|
1239
|
+
let currentWidth = 0;
|
|
1240
|
+
let currentHeight = 0;
|
|
1241
|
+
if (!dashboardComponent.params.switchScreenModeOnResize && dashboardComponent.currentScreenMode) {
|
|
1242
|
+
dashboardComponent.params.screenMode = dashboardComponent.currentScreenMode;
|
|
1247
1243
|
}
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1244
|
+
if (dashboardComponent.dimensions && dashboardDimensionKeys?.[0] === "fixed") {
|
|
1245
|
+
currentMode = "fixed";
|
|
1246
|
+
currentWidth = dashboardComponent.dimensions.fixed[0];
|
|
1247
|
+
currentHeight = dashboardComponent.dimensions.fixed[1];
|
|
1248
|
+
} else {
|
|
1249
|
+
const screenModes = [
|
|
1250
|
+
"mobile",
|
|
1251
|
+
"tablet",
|
|
1252
|
+
"desktop",
|
|
1253
|
+
"largeScreen"
|
|
1254
|
+
];
|
|
1255
|
+
if (dashboardComponent.params.itemEmbedding) {
|
|
1256
|
+
const [firstMatch] = dashboardDimensionKeys;
|
|
1257
|
+
let match = cloneDeep(firstMatch);
|
|
1258
|
+
for (const screenMode of screenModes) {
|
|
1259
|
+
const found = dashboardDimensionKeys.find((key) => key === screenMode);
|
|
1260
|
+
if (found) {
|
|
1261
|
+
match = cloneDeep(found);
|
|
1262
|
+
} else {
|
|
1263
|
+
dashboardComponent.dimensions[screenMode] = dashboardComponent.dimensions[match];
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1267
1266
|
}
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
})
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1267
|
+
for (const key of dashboardDimensionKeys) {
|
|
1268
|
+
if (screenModes.includes(key)) {
|
|
1269
|
+
const screenMode = EXTENTS.find((extent) => extent.mode === key);
|
|
1270
|
+
availableScreenModeExtents.push({
|
|
1271
|
+
...screenMode,
|
|
1272
|
+
height: dashboardComponent.dimensions[key][1] || 50
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
if (!availableScreenModeExtents.map((screenModeExtent) => screenModeExtent.mode).includes(dashboardComponent.params.screenMode)) {
|
|
1277
|
+
dashboardComponent.params.screenMode = "auto";
|
|
1278
|
+
}
|
|
1279
|
+
if (dashboardComponent.params.screenMode === "auto") {
|
|
1280
|
+
availableScreenModeExtents.sort(
|
|
1281
|
+
(a3, b3) => screenModes.indexOf(a3.mode) - screenModes.indexOf(b3.mode)
|
|
1282
|
+
);
|
|
1283
|
+
for (const screenModeExtent of availableScreenModeExtents) {
|
|
1284
|
+
const [screenModeExtentMinWidth, screenModeExtentMaxWidth] = screenModeExtent.width;
|
|
1285
|
+
if (dashboardComponent.params.itemEmbedding && dashboardComponent.params.itemDimensions && dashboardComponent.params.itemDimensions.width !== "auto" && dashboardComponent.params.itemDimensions.height === "auto") {
|
|
1286
|
+
if (screenModeExtentMinWidth < dashboardComponent.params.itemDimensions.width) {
|
|
1287
|
+
currentMode = screenModeExtent.mode;
|
|
1288
|
+
currentWidth = Number.parseInt(
|
|
1289
|
+
dashboardComponent.params.itemDimensions.width,
|
|
1290
|
+
10
|
|
1291
|
+
);
|
|
1292
|
+
currentHeight = dashboardComponent.dimensions[currentMode][1];
|
|
1293
|
+
}
|
|
1294
|
+
} else {
|
|
1295
|
+
if (screenModeExtentMinWidth < dashboardComponent.containerWidth) {
|
|
1296
|
+
currentMode = screenModeExtent.mode;
|
|
1297
|
+
if (dashboardComponent.params.itemEmbedding) {
|
|
1298
|
+
currentWidth = dashboardComponent.params.itemDimensions?.width && dashboardComponent.params.itemDimensions?.width !== "auto" ? Number.parseInt(
|
|
1299
|
+
dashboardComponent.params.itemDimensions.width,
|
|
1300
|
+
10
|
|
1301
|
+
) : Math.min(
|
|
1302
|
+
dashboardComponent.containerWidth,
|
|
1303
|
+
screenModeExtentMaxWidth
|
|
1304
|
+
);
|
|
1305
|
+
currentHeight = dashboardComponent.params.itemDimensions?.height && dashboardComponent.params.itemDimensions?.height !== "auto" ? Number.parseInt(
|
|
1306
|
+
dashboardComponent.params.itemDimensions.height,
|
|
1307
|
+
10
|
|
1308
|
+
) : dashboardComponent.dimensions[currentMode][1];
|
|
1309
|
+
if (dashboardComponent.params.itemDimensions && dashboardComponent.params.itemDimensions.width !== "auto" && dashboardComponent.params.itemDimensions.height === "auto") {
|
|
1310
|
+
currentWidth = Number.parseInt(
|
|
1311
|
+
dashboardComponent.params.itemDimensions.width,
|
|
1312
|
+
10
|
|
1313
|
+
);
|
|
1314
|
+
currentHeight = dashboardComponent.dimensions[currentMode][1];
|
|
1315
|
+
}
|
|
1316
|
+
} else {
|
|
1317
|
+
currentWidth = Math.max(
|
|
1318
|
+
Math.min(
|
|
1319
|
+
screenModeExtentMaxWidth,
|
|
1320
|
+
dashboardComponent.containerWidth
|
|
1321
|
+
),
|
|
1322
|
+
screenModeExtentMinWidth
|
|
1323
|
+
);
|
|
1324
|
+
currentHeight = screenModeExtent.height;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
} else {
|
|
1330
|
+
const {
|
|
1331
|
+
height: chosenModeHeight,
|
|
1332
|
+
width: [chosenModeMinWidth, chosenModeMaxWidth]
|
|
1333
|
+
} = availableScreenModeExtents.find(
|
|
1334
|
+
(d3) => d3.mode === dashboardComponent.params.screenMode
|
|
1335
|
+
);
|
|
1336
|
+
currentMode = dashboardComponent.params.screenMode;
|
|
1337
|
+
currentWidth = Math.max(
|
|
1338
|
+
Math.min(chosenModeMaxWidth, dashboardComponent.containerWidth),
|
|
1339
|
+
chosenModeMinWidth
|
|
1340
|
+
);
|
|
1341
|
+
currentHeight = chosenModeHeight;
|
|
1342
|
+
if (dashboardComponent.params.itemEmbedding) {
|
|
1343
|
+
if (dashboardComponent.params.itemDimensions?.width && dashboardComponent.params.itemDimensions?.width !== "auto") {
|
|
1344
|
+
currentWidth = Number.parseInt(
|
|
1345
|
+
dashboardComponent.params.itemDimensions.width,
|
|
1346
|
+
10
|
|
1347
|
+
);
|
|
1348
|
+
}
|
|
1349
|
+
if (dashboardComponent.params.itemDimensions?.height && dashboardComponent.params.itemDimensions?.height !== "auto") {
|
|
1350
|
+
currentHeight = Number.parseInt(
|
|
1351
|
+
dashboardComponent.params.itemDimensions.height,
|
|
1352
|
+
10
|
|
1353
|
+
);
|
|
1354
|
+
}
|
|
1308
1355
|
}
|
|
1309
|
-
}
|
|
1310
|
-
return i6;
|
|
1311
|
-
} };
|
|
1312
|
-
var f = (t5, s4) => !i2(t5, s4);
|
|
1313
|
-
var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f };
|
|
1314
|
-
Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
1315
|
-
var b = class extends HTMLElement {
|
|
1316
|
-
static addInitializer(t5) {
|
|
1317
|
-
this._$Ei(), (this.l ??= []).push(t5);
|
|
1318
|
-
}
|
|
1319
|
-
static get observedAttributes() {
|
|
1320
|
-
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
1321
|
-
}
|
|
1322
|
-
static createProperty(t5, s4 = y) {
|
|
1323
|
-
if (s4.state && (s4.attribute = false), this._$Ei(), this.elementProperties.set(t5, s4), !s4.noAccessor) {
|
|
1324
|
-
const i6 = Symbol(), r7 = this.getPropertyDescriptor(t5, i6, s4);
|
|
1325
|
-
void 0 !== r7 && e2(this.prototype, t5, r7);
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
static getPropertyDescriptor(t5, s4, i6) {
|
|
1329
|
-
const { get: e7, set: h3 } = r2(this.prototype, t5) ?? { get() {
|
|
1330
|
-
return this[s4];
|
|
1331
|
-
}, set(t6) {
|
|
1332
|
-
this[s4] = t6;
|
|
1333
|
-
} };
|
|
1334
|
-
return { get() {
|
|
1335
|
-
return e7?.call(this);
|
|
1336
|
-
}, set(s5) {
|
|
1337
|
-
const r7 = e7?.call(this);
|
|
1338
|
-
h3.call(this, s5), this.requestUpdate(t5, r7, i6);
|
|
1339
|
-
}, configurable: true, enumerable: true };
|
|
1340
|
-
}
|
|
1341
|
-
static getPropertyOptions(t5) {
|
|
1342
|
-
return this.elementProperties.get(t5) ?? y;
|
|
1343
|
-
}
|
|
1344
|
-
static _$Ei() {
|
|
1345
|
-
if (this.hasOwnProperty(d("elementProperties")))
|
|
1346
|
-
return;
|
|
1347
|
-
const t5 = n2(this);
|
|
1348
|
-
t5.finalize(), void 0 !== t5.l && (this.l = [...t5.l]), this.elementProperties = new Map(t5.elementProperties);
|
|
1349
|
-
}
|
|
1350
|
-
static finalize() {
|
|
1351
|
-
if (this.hasOwnProperty(d("finalized")))
|
|
1352
|
-
return;
|
|
1353
|
-
if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
|
|
1354
|
-
const t6 = this.properties, s4 = [...h(t6), ...o2(t6)];
|
|
1355
|
-
for (const i6 of s4)
|
|
1356
|
-
this.createProperty(i6, t6[i6]);
|
|
1357
|
-
}
|
|
1358
|
-
const t5 = this[Symbol.metadata];
|
|
1359
|
-
if (null !== t5) {
|
|
1360
|
-
const s4 = litPropertyMetadata.get(t5);
|
|
1361
|
-
if (void 0 !== s4)
|
|
1362
|
-
for (const [t6, i6] of s4)
|
|
1363
|
-
this.elementProperties.set(t6, i6);
|
|
1364
1356
|
}
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1357
|
+
if (!currentMode && availableScreenModeExtents.length > 0) {
|
|
1358
|
+
const [lowestModeExtent] = availableScreenModeExtents;
|
|
1359
|
+
currentMode = lowestModeExtent.mode;
|
|
1360
|
+
currentWidth = lowestModeExtent.width[0];
|
|
1361
|
+
currentHeight = lowestModeExtent.height;
|
|
1369
1362
|
}
|
|
1370
|
-
this.elementStyles = this.finalizeStyles(this.styles);
|
|
1371
|
-
}
|
|
1372
|
-
static finalizeStyles(s4) {
|
|
1373
|
-
const i6 = [];
|
|
1374
|
-
if (Array.isArray(s4)) {
|
|
1375
|
-
const e7 = new Set(s4.flat(1 / 0).reverse());
|
|
1376
|
-
for (const s5 of e7)
|
|
1377
|
-
i6.unshift(c(s5));
|
|
1378
|
-
} else
|
|
1379
|
-
void 0 !== s4 && i6.push(c(s4));
|
|
1380
|
-
return i6;
|
|
1381
|
-
}
|
|
1382
|
-
static _$Eu(t5, s4) {
|
|
1383
|
-
const i6 = s4.attribute;
|
|
1384
|
-
return false === i6 ? void 0 : "string" == typeof i6 ? i6 : "string" == typeof t5 ? t5.toLowerCase() : void 0;
|
|
1385
|
-
}
|
|
1386
|
-
constructor() {
|
|
1387
|
-
super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
|
|
1388
|
-
}
|
|
1389
|
-
_$Ev() {
|
|
1390
|
-
this._$ES = new Promise((t5) => this.enableUpdating = t5), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t5) => t5(this));
|
|
1391
|
-
}
|
|
1392
|
-
addController(t5) {
|
|
1393
|
-
(this._$EO ??= /* @__PURE__ */ new Set()).add(t5), void 0 !== this.renderRoot && this.isConnected && t5.hostConnected?.();
|
|
1394
|
-
}
|
|
1395
|
-
removeController(t5) {
|
|
1396
|
-
this._$EO?.delete(t5);
|
|
1397
|
-
}
|
|
1398
|
-
_$E_() {
|
|
1399
|
-
const t5 = /* @__PURE__ */ new Map(), s4 = this.constructor.elementProperties;
|
|
1400
|
-
for (const i6 of s4.keys())
|
|
1401
|
-
this.hasOwnProperty(i6) && (t5.set(i6, this[i6]), delete this[i6]);
|
|
1402
|
-
t5.size > 0 && (this._$Ep = t5);
|
|
1403
|
-
}
|
|
1404
|
-
createRenderRoot() {
|
|
1405
|
-
const t5 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
1406
|
-
return S(t5, this.constructor.elementStyles), t5;
|
|
1407
|
-
}
|
|
1408
|
-
connectedCallback() {
|
|
1409
|
-
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t5) => t5.hostConnected?.());
|
|
1410
|
-
}
|
|
1411
|
-
enableUpdating(t5) {
|
|
1412
1363
|
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1364
|
+
dashboardComponent.currentScreenMode = currentMode;
|
|
1365
|
+
const style = {
|
|
1366
|
+
height: currentHeight === 0 ? "100%" : `${String(currentHeight)}px`,
|
|
1367
|
+
width: currentWidth === 0 ? "100%" : `${String(currentWidth)}px`,
|
|
1368
|
+
opacity: 1
|
|
1369
|
+
};
|
|
1370
|
+
const dashboardEditModes = ["editFull", "editLimited"];
|
|
1371
|
+
if (dashboardEditModes.includes(dashboardComponent.params.editMode)) {
|
|
1372
|
+
style.height = "100%";
|
|
1373
|
+
style.width = "100%";
|
|
1374
|
+
} else if (dashboardComponent.params.itemEmbedding && dashboardComponent.params.itemDimensions) {
|
|
1375
|
+
style.height = dashboardComponent.params.itemDimensions.height === "auto" ? style.height : `${String(dashboardComponent.params.itemDimensions.height).replace(
|
|
1376
|
+
"px",
|
|
1377
|
+
""
|
|
1378
|
+
)}px`;
|
|
1379
|
+
style.width = dashboardComponent.params.itemDimensions.width === "auto" ? style.width : `${String(dashboardComponent.params.itemDimensions.width).replace(
|
|
1380
|
+
"px",
|
|
1381
|
+
""
|
|
1382
|
+
)}px`;
|
|
1383
|
+
} else {
|
|
1384
|
+
style.height = currentHeight === 0 ? "100%" : `${String(currentHeight)}px`;
|
|
1385
|
+
style.width = currentWidth === 0 ? "100%" : `${String(currentWidth)}px`;
|
|
1418
1386
|
}
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1387
|
+
dashboardComponent.currentScreenMode = currentMode;
|
|
1388
|
+
dashboardComponent.iframeStyle = style;
|
|
1389
|
+
};
|
|
1390
|
+
|
|
1391
|
+
// libs/embed-libs/shared-embed/src/lib/service/extend-and-validate.ts
|
|
1392
|
+
var _extendAndValidate = (dashboardContent) => {
|
|
1393
|
+
const defaultKeys = Object.keys(
|
|
1394
|
+
DEFAULT_PARAMETERS
|
|
1395
|
+
);
|
|
1396
|
+
const errorMessages = [];
|
|
1397
|
+
const requiredStringParams = [
|
|
1398
|
+
"appServer",
|
|
1399
|
+
"language",
|
|
1400
|
+
"apiHost"
|
|
1401
|
+
];
|
|
1402
|
+
const requiredStringOrEmptyParams = [
|
|
1403
|
+
"key",
|
|
1404
|
+
"token",
|
|
1405
|
+
"screenMode",
|
|
1406
|
+
"timezoneId",
|
|
1407
|
+
"itemId",
|
|
1408
|
+
"container",
|
|
1409
|
+
"loaderBackground",
|
|
1410
|
+
"loaderFontColor",
|
|
1411
|
+
"loaderSpinnerColor",
|
|
1412
|
+
"loaderSpinnerBackground"
|
|
1413
|
+
];
|
|
1414
|
+
const objectParams = ["itemDimensions"];
|
|
1415
|
+
const screenModes = [
|
|
1416
|
+
"mobile",
|
|
1417
|
+
"tablet",
|
|
1418
|
+
"desktop",
|
|
1419
|
+
"largeScreen",
|
|
1420
|
+
"fixed",
|
|
1421
|
+
"auto"
|
|
1422
|
+
];
|
|
1423
|
+
for (const key of defaultKeys) {
|
|
1424
|
+
if (dashboardContent.params[key] === null) {
|
|
1425
|
+
delete dashboardContent.params[key];
|
|
1424
1426
|
}
|
|
1425
1427
|
}
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1428
|
+
dashboardContent.params = defaultsDeep(
|
|
1429
|
+
dashboardContent.params,
|
|
1430
|
+
DEFAULT_PARAMETERS
|
|
1431
|
+
);
|
|
1432
|
+
if ((!dashboardContent.params.dashboardId || typeof dashboardContent.params.dashboardId !== "string") && (!dashboardContent.params.dashboardSlug || typeof dashboardContent.params.dashboardSlug !== "string")) {
|
|
1433
|
+
delete dashboardContent.params.dashboardId;
|
|
1434
|
+
delete dashboardContent.params.dashboardSlug;
|
|
1432
1435
|
}
|
|
1433
|
-
|
|
1434
|
-
if (
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
this.P(t5, s4, i6);
|
|
1436
|
+
for (const key of requiredStringParams) {
|
|
1437
|
+
if (typeof dashboardContent.params[key] !== "string") {
|
|
1438
|
+
delete dashboardContent.params[key];
|
|
1439
|
+
errorMessages.push(`${key} needs to be of type string.`);
|
|
1438
1440
|
}
|
|
1439
|
-
false === this.isUpdatePending && (this._$ES = this._$ET());
|
|
1440
|
-
}
|
|
1441
|
-
P(t5, s4, i6) {
|
|
1442
|
-
this._$AL.has(t5) || this._$AL.set(t5, s4), true === i6.reflect && this._$Em !== t5 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t5);
|
|
1443
1441
|
}
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
} catch (t6) {
|
|
1449
|
-
Promise.reject(t6);
|
|
1442
|
+
for (const key of requiredStringOrEmptyParams) {
|
|
1443
|
+
if (typeof dashboardContent.params[key] !== "string" && dashboardContent.params[key] !== null && dashboardContent.params[key] !== void 0) {
|
|
1444
|
+
delete dashboardContent.params[key];
|
|
1445
|
+
errorMessages.push(`${key} needs to be of type string or empty.`);
|
|
1450
1446
|
}
|
|
1451
|
-
const t5 = this.scheduleUpdate();
|
|
1452
|
-
return null != t5 && await t5, !this.isUpdatePending;
|
|
1453
1447
|
}
|
|
1454
|
-
|
|
1455
|
-
|
|
1448
|
+
if (dashboardContent.params.screenMode && !screenModes.includes(dashboardContent.params.screenMode)) {
|
|
1449
|
+
const validTypesString = screenModes.map((mode) => `"${mode}"`).join(", ");
|
|
1450
|
+
errorMessages.push(
|
|
1451
|
+
`"screenMode" needs should be one of these types: ${validTypesString}`
|
|
1452
|
+
);
|
|
1453
|
+
dashboardContent.params.screenMode = "auto";
|
|
1456
1454
|
}
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
this._$Ep = void 0;
|
|
1465
|
-
}
|
|
1466
|
-
const t6 = this.constructor.elementProperties;
|
|
1467
|
-
if (t6.size > 0)
|
|
1468
|
-
for (const [s5, i6] of t6)
|
|
1469
|
-
true !== i6.wrapped || this._$AL.has(s5) || void 0 === this[s5] || this.P(s5, this[s5], i6);
|
|
1470
|
-
}
|
|
1471
|
-
let t5 = false;
|
|
1472
|
-
const s4 = this._$AL;
|
|
1473
|
-
try {
|
|
1474
|
-
t5 = this.shouldUpdate(s4), t5 ? (this.willUpdate(s4), this._$EO?.forEach((t6) => t6.hostUpdate?.()), this.update(s4)) : this._$EU();
|
|
1475
|
-
} catch (s5) {
|
|
1476
|
-
throw t5 = false, this._$EU(), s5;
|
|
1455
|
+
if (dashboardContent.params.itemId) {
|
|
1456
|
+
dashboardContent.params.itemEmbedding = true;
|
|
1457
|
+
}
|
|
1458
|
+
for (const key of objectParams) {
|
|
1459
|
+
if (typeof dashboardContent.params[key] !== "object" && dashboardContent.params[key] !== null) {
|
|
1460
|
+
delete dashboardContent.params[key];
|
|
1461
|
+
errorMessages.push(`${key} needs to be of type object or empty.`);
|
|
1477
1462
|
}
|
|
1478
|
-
t5 && this._$AE(s4);
|
|
1479
1463
|
}
|
|
1480
|
-
|
|
1464
|
+
if (typeof dashboardContent.params.switchScreenModeOnResize !== "boolean") {
|
|
1465
|
+
errorMessages.push("switchScreenModeOnResize needs to be of type boolean.");
|
|
1466
|
+
dashboardContent.params.switchScreenModeOnResize = true;
|
|
1481
1467
|
}
|
|
1482
|
-
|
|
1483
|
-
|
|
1468
|
+
if (dashboardContent.params.itemDimensions) {
|
|
1469
|
+
const itemDimensionsKeys = [
|
|
1470
|
+
"width",
|
|
1471
|
+
"height"
|
|
1472
|
+
];
|
|
1473
|
+
for (const key of itemDimensionsKeys) {
|
|
1474
|
+
if (!["string", "number"].includes(
|
|
1475
|
+
typeof dashboardContent.params.itemDimensions[key]
|
|
1476
|
+
) && dashboardContent.params.itemDimensions[key] !== null) {
|
|
1477
|
+
errorMessages.push(
|
|
1478
|
+
`itemDimensions ${key} needs to be of type string, number or empty.`
|
|
1479
|
+
);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1484
1482
|
}
|
|
1485
|
-
|
|
1486
|
-
|
|
1483
|
+
dashboardContent.params = defaultsDeep(
|
|
1484
|
+
dashboardContent.params,
|
|
1485
|
+
DEFAULT_PARAMETERS
|
|
1486
|
+
);
|
|
1487
|
+
if (dashboardContent.params.screenMode && dashboardContent.params.screenMode !== "auto") {
|
|
1488
|
+
dashboardContent.params.switchScreenModeOnResize = false;
|
|
1487
1489
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
+
if (dashboardContent.params.itemDimensions.width !== "auto") {
|
|
1491
|
+
dashboardContent.params.itemDimensions.width = Number.parseInt(
|
|
1492
|
+
`${dashboardContent.params.itemDimensions.width}`.replace("px", ""),
|
|
1493
|
+
10
|
|
1494
|
+
) || "auto";
|
|
1490
1495
|
}
|
|
1491
|
-
|
|
1492
|
-
|
|
1496
|
+
if (dashboardContent.params.itemDimensions.height !== "auto") {
|
|
1497
|
+
dashboardContent.params.itemDimensions.height = Number.parseInt(
|
|
1498
|
+
`${dashboardContent.params.itemDimensions.height}`.replace("px", ""),
|
|
1499
|
+
10
|
|
1500
|
+
) || "auto";
|
|
1493
1501
|
}
|
|
1494
|
-
|
|
1495
|
-
|
|
1502
|
+
dashboardContent.params.itemEmbedding = !!dashboardContent.params.itemId;
|
|
1503
|
+
if (dashboardContent.params.error || errorMessages.length > 0) {
|
|
1504
|
+
_handleError(errorMessages.join("\n"), dashboardContent.params);
|
|
1496
1505
|
}
|
|
1497
|
-
|
|
1498
|
-
|
|
1506
|
+
};
|
|
1507
|
+
|
|
1508
|
+
// libs/embed-libs/shared-embed/src/lib/constants/class-constants.ts
|
|
1509
|
+
var luzmoEmbedContainerClass = "luzmo-embed-container";
|
|
1510
|
+
|
|
1511
|
+
// libs/embed-libs/shared-embed/src/lib/helpers/remote-federation.ts
|
|
1512
|
+
var remotesMap = {
|
|
1513
|
+
// "remote_app": { url: "http://localhost:4201/remoteEntry.mjs", format: "esm", from: "vite" },
|
|
1514
|
+
};
|
|
1515
|
+
var loadJS = async (url, fn) => {
|
|
1516
|
+
const resolvedUrl = typeof url === "function" ? await url() : url;
|
|
1517
|
+
const script = document.createElement("script");
|
|
1518
|
+
script.type = "text/javascript";
|
|
1519
|
+
script.addEventListener("load", fn);
|
|
1520
|
+
script.src = resolvedUrl;
|
|
1521
|
+
document.querySelectorAll("head")[0].append(script);
|
|
1522
|
+
};
|
|
1523
|
+
var wrapShareModule = (remoteFrom) => ({});
|
|
1524
|
+
async function __federationMethodEnsure(remoteId) {
|
|
1525
|
+
const remote = remotesMap[remoteId];
|
|
1526
|
+
if (remote.inited) {
|
|
1527
|
+
return remote.lib;
|
|
1499
1528
|
}
|
|
1500
|
-
|
|
1529
|
+
if (remote.format === "var") {
|
|
1530
|
+
return new Promise((resolve) => {
|
|
1531
|
+
const callback = () => {
|
|
1532
|
+
if (!remote.inited) {
|
|
1533
|
+
remote.lib = window[remoteId];
|
|
1534
|
+
remote.lib.init(wrapShareModule(remote.from));
|
|
1535
|
+
remote.inited = true;
|
|
1536
|
+
}
|
|
1537
|
+
resolve(remote.lib);
|
|
1538
|
+
};
|
|
1539
|
+
return loadJS(remote.url, callback);
|
|
1540
|
+
});
|
|
1541
|
+
} else if (["esm", "systemjs"].includes(remote.format)) {
|
|
1542
|
+
return new Promise((resolve, reject) => {
|
|
1543
|
+
const getUrl = typeof remote.url === "function" ? remote.url : () => Promise.resolve(remote.url);
|
|
1544
|
+
getUrl().then((url) => {
|
|
1545
|
+
import(
|
|
1546
|
+
/* @vite-ignore */
|
|
1547
|
+
/* webpackIgnore: true */
|
|
1548
|
+
url
|
|
1549
|
+
).then((lib) => {
|
|
1550
|
+
if (!remote.inited) {
|
|
1551
|
+
const shareScope = wrapShareModule(remote.from);
|
|
1552
|
+
lib.init(shareScope);
|
|
1553
|
+
remote.lib = lib;
|
|
1554
|
+
remote.lib.init(shareScope);
|
|
1555
|
+
remote.inited = true;
|
|
1556
|
+
}
|
|
1557
|
+
resolve(remote.lib);
|
|
1558
|
+
}).catch(reject);
|
|
1559
|
+
});
|
|
1560
|
+
});
|
|
1501
1561
|
}
|
|
1502
|
-
|
|
1562
|
+
}
|
|
1563
|
+
function __federationMethodWrapDefault(module2, need) {
|
|
1564
|
+
if (!(module2 == null ? void 0 : module2.default) && need) {
|
|
1565
|
+
const obj = /* @__PURE__ */ Object.create(null);
|
|
1566
|
+
obj.default = module2;
|
|
1567
|
+
obj.__esModule = true;
|
|
1568
|
+
return obj;
|
|
1503
1569
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1570
|
+
return module2;
|
|
1571
|
+
}
|
|
1572
|
+
async function __federationMethodGetRemote(remoteName, componentName) {
|
|
1573
|
+
return __federationMethodEnsure(remoteName).then((remote) => remote.get(componentName).then((factory) => factory()));
|
|
1574
|
+
}
|
|
1506
1575
|
|
|
1507
1576
|
// node_modules/lit-html/lit-html.js
|
|
1508
|
-
var
|
|
1509
|
-
var i3 =
|
|
1577
|
+
var t3 = globalThis;
|
|
1578
|
+
var i3 = t3.trustedTypes;
|
|
1510
1579
|
var s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (t5) => t5 }) : void 0;
|
|
1511
|
-
var
|
|
1580
|
+
var e5 = "$lit$";
|
|
1512
1581
|
var h2 = `lit$${(Math.random() + "").slice(9)}$`;
|
|
1513
|
-
var
|
|
1514
|
-
var
|
|
1515
|
-
var
|
|
1516
|
-
var l2 = () =>
|
|
1582
|
+
var o4 = "?" + h2;
|
|
1583
|
+
var n4 = `<${o4}>`;
|
|
1584
|
+
var r5 = document;
|
|
1585
|
+
var l2 = () => r5.createComment("");
|
|
1517
1586
|
var c3 = (t5) => null === t5 || "object" != typeof t5 && "function" != typeof t5;
|
|
1518
1587
|
var a2 = Array.isArray;
|
|
1519
1588
|
var u2 = (t5) => a2(t5) || "function" == typeof t5?.[Symbol.iterator];
|
|
@@ -1532,7 +1601,7 @@ var b2 = y2(2);
|
|
|
1532
1601
|
var w = Symbol.for("lit-noChange");
|
|
1533
1602
|
var T = Symbol.for("lit-nothing");
|
|
1534
1603
|
var A = /* @__PURE__ */ new WeakMap();
|
|
1535
|
-
var E =
|
|
1604
|
+
var E = r5.createTreeWalker(r5, 129);
|
|
1536
1605
|
function C(t5, i6) {
|
|
1537
1606
|
if (!Array.isArray(t5) || !t5.hasOwnProperty("raw"))
|
|
1538
1607
|
throw Error("invalid template strings array");
|
|
@@ -1547,7 +1616,7 @@ var P = (t5, i6) => {
|
|
|
1547
1616
|
for (; y3 < s5.length && (c4.lastIndex = y3, u3 = c4.exec(s5), null !== u3); )
|
|
1548
1617
|
y3 = c4.lastIndex, c4 === f2 ? "!--" === u3[1] ? c4 = v : void 0 !== u3[1] ? c4 = _ : void 0 !== u3[2] ? ($.test(u3[2]) && (r7 = RegExp("</" + u3[2], "g")), c4 = m) : void 0 !== u3[3] && (c4 = m) : c4 === m ? ">" === u3[0] ? (c4 = r7 ?? f2, d3 = -1) : void 0 === u3[1] ? d3 = -2 : (d3 = c4.lastIndex - u3[2].length, a3 = u3[1], c4 = void 0 === u3[3] ? m : '"' === u3[3] ? g : p2) : c4 === g || c4 === p2 ? c4 = m : c4 === v || c4 === _ ? c4 = f2 : (c4 = m, r7 = void 0);
|
|
1549
1618
|
const x2 = c4 === m && t5[i7 + 1].startsWith("/>") ? " " : "";
|
|
1550
|
-
l3 += c4 === f2 ? s5 +
|
|
1619
|
+
l3 += c4 === f2 ? s5 + n4 : d3 >= 0 ? (o6.push(a3), s5.slice(0, d3) + e5 + s5.slice(d3) + h2 + x2) : s5 + h2 + (-2 === d3 ? i7 : x2);
|
|
1551
1620
|
}
|
|
1552
1621
|
return [C(t5, l3 + (t5[s4] || "<?>") + (2 === i6 ? "</svg>" : "")), o6];
|
|
1553
1622
|
};
|
|
@@ -1565,7 +1634,7 @@ var V = class _V {
|
|
|
1565
1634
|
if (1 === r7.nodeType) {
|
|
1566
1635
|
if (r7.hasAttributes())
|
|
1567
1636
|
for (const t6 of r7.getAttributeNames())
|
|
1568
|
-
if (t6.endsWith(
|
|
1637
|
+
if (t6.endsWith(e5)) {
|
|
1569
1638
|
const i6 = v2[a3++], s5 = r7.getAttribute(t6).split(h2), e7 = /([.?@])?(.*)/.exec(i6);
|
|
1570
1639
|
d3.push({ type: 1, index: c4, name: e7[2], strings: s5, ctor: "." === e7[1] ? k : "?" === e7[1] ? H : "@" === e7[1] ? I : R }), r7.removeAttribute(t6);
|
|
1571
1640
|
} else
|
|
@@ -1580,7 +1649,7 @@ var V = class _V {
|
|
|
1580
1649
|
}
|
|
1581
1650
|
}
|
|
1582
1651
|
} else if (8 === r7.nodeType)
|
|
1583
|
-
if (r7.data ===
|
|
1652
|
+
if (r7.data === o4)
|
|
1584
1653
|
d3.push({ type: 2, index: c4 });
|
|
1585
1654
|
else {
|
|
1586
1655
|
let t6 = -1;
|
|
@@ -1591,7 +1660,7 @@ var V = class _V {
|
|
|
1591
1660
|
}
|
|
1592
1661
|
}
|
|
1593
1662
|
static createElement(t5, i6) {
|
|
1594
|
-
const s4 =
|
|
1663
|
+
const s4 = r5.createElement("template");
|
|
1595
1664
|
return s4.innerHTML = t5, s4;
|
|
1596
1665
|
}
|
|
1597
1666
|
};
|
|
@@ -1613,7 +1682,7 @@ var S2 = class {
|
|
|
1613
1682
|
return this._$AM._$AU;
|
|
1614
1683
|
}
|
|
1615
1684
|
u(t5) {
|
|
1616
|
-
const { el: { content: i6 }, parts: s4 } = this._$AD, e7 = (t5?.creationScope ??
|
|
1685
|
+
const { el: { content: i6 }, parts: s4 } = this._$AD, e7 = (t5?.creationScope ?? r5).importNode(i6, true);
|
|
1617
1686
|
E.currentNode = e7;
|
|
1618
1687
|
let h3 = E.nextNode(), o6 = 0, n6 = 0, l3 = s4[0];
|
|
1619
1688
|
for (; void 0 !== l3; ) {
|
|
@@ -1623,7 +1692,7 @@ var S2 = class {
|
|
|
1623
1692
|
}
|
|
1624
1693
|
o6 !== l3?.index && (h3 = E.nextNode(), o6++);
|
|
1625
1694
|
}
|
|
1626
|
-
return E.currentNode =
|
|
1695
|
+
return E.currentNode = r5, e7;
|
|
1627
1696
|
}
|
|
1628
1697
|
p(t5) {
|
|
1629
1698
|
let i6 = 0;
|
|
@@ -1659,7 +1728,7 @@ var M = class _M {
|
|
|
1659
1728
|
this._$AH !== t5 && (this._$AR(), this._$AH = this.S(t5));
|
|
1660
1729
|
}
|
|
1661
1730
|
_(t5) {
|
|
1662
|
-
this._$AH !== T && c3(this._$AH) ? this._$AA.nextSibling.data = t5 : this.T(
|
|
1731
|
+
this._$AH !== T && c3(this._$AH) ? this._$AA.nextSibling.data = t5 : this.T(r5.createTextNode(t5)), this._$AH = t5;
|
|
1663
1732
|
}
|
|
1664
1733
|
$(t5) {
|
|
1665
1734
|
const { values: i6, _$litType$: s4 } = t5, e7 = "number" == typeof s4 ? this._$AC(t5) : (void 0 === s4.el && (s4.el = V.createElement(C(s4.h, s4.h[0]), this.options)), s4);
|
|
@@ -1760,8 +1829,8 @@ var L = class {
|
|
|
1760
1829
|
N(this, t5);
|
|
1761
1830
|
}
|
|
1762
1831
|
};
|
|
1763
|
-
var Z =
|
|
1764
|
-
Z?.(V, M), (
|
|
1832
|
+
var Z = t3.litHtmlPolyfillSupport;
|
|
1833
|
+
Z?.(V, M), (t3.litHtmlVersions ??= []).push("3.1.2");
|
|
1765
1834
|
var j = (t5, i6, s4) => {
|
|
1766
1835
|
const e7 = s4?.renderBefore ?? i6;
|
|
1767
1836
|
let h3 = e7._$litPart$;
|
|
@@ -1796,79 +1865,10 @@ var s3 = class extends b {
|
|
|
1796
1865
|
}
|
|
1797
1866
|
};
|
|
1798
1867
|
s3._$litElement$ = true, s3["finalized", "finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: s3 });
|
|
1799
|
-
var
|
|
1800
|
-
|
|
1868
|
+
var r6 = globalThis.litElementPolyfillSupport;
|
|
1869
|
+
r6?.({ LitElement: s3 });
|
|
1801
1870
|
(globalThis.litElementVersions ??= []).push("4.0.4");
|
|
1802
1871
|
|
|
1803
|
-
// node_modules/@lit/reactive-element/decorators/custom-element.js
|
|
1804
|
-
var t3 = (t5) => (e7, o6) => {
|
|
1805
|
-
void 0 !== o6 ? o6.addInitializer(() => {
|
|
1806
|
-
customElements.define(t5, e7);
|
|
1807
|
-
}) : customElements.define(t5, e7);
|
|
1808
|
-
};
|
|
1809
|
-
|
|
1810
|
-
// node_modules/@lit/reactive-element/decorators/property.js
|
|
1811
|
-
var o4 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f };
|
|
1812
|
-
var r5 = (t5 = o4, e7, r7) => {
|
|
1813
|
-
const { kind: n6, metadata: i6 } = r7;
|
|
1814
|
-
let s4 = globalThis.litPropertyMetadata.get(i6);
|
|
1815
|
-
if (void 0 === s4 && globalThis.litPropertyMetadata.set(i6, s4 = /* @__PURE__ */ new Map()), s4.set(r7.name, t5), "accessor" === n6) {
|
|
1816
|
-
const { name: o6 } = r7;
|
|
1817
|
-
return { set(r8) {
|
|
1818
|
-
const n7 = e7.get.call(this);
|
|
1819
|
-
e7.set.call(this, r8), this.requestUpdate(o6, n7, t5);
|
|
1820
|
-
}, init(e8) {
|
|
1821
|
-
return void 0 !== e8 && this.P(o6, void 0, t5), e8;
|
|
1822
|
-
} };
|
|
1823
|
-
}
|
|
1824
|
-
if ("setter" === n6) {
|
|
1825
|
-
const { name: o6 } = r7;
|
|
1826
|
-
return function(r8) {
|
|
1827
|
-
const n7 = this[o6];
|
|
1828
|
-
e7.call(this, r8), this.requestUpdate(o6, n7, t5);
|
|
1829
|
-
};
|
|
1830
|
-
}
|
|
1831
|
-
throw Error("Unsupported decorator location: " + n6);
|
|
1832
|
-
};
|
|
1833
|
-
function n4(t5) {
|
|
1834
|
-
return (e7, o6) => "object" == typeof o6 ? r5(t5, e7, o6) : ((t6, e8, o7) => {
|
|
1835
|
-
const r7 = e8.hasOwnProperty(o7);
|
|
1836
|
-
return e8.constructor.createProperty(o7, r7 ? { ...t6, wrapped: true } : t6), r7 ? Object.getOwnPropertyDescriptor(e8, o7) : void 0;
|
|
1837
|
-
})(t5, e7, o6);
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
// node_modules/@lit/reactive-element/decorators/state.js
|
|
1841
|
-
function r6(r7) {
|
|
1842
|
-
return n4({ ...r7, state: true, attribute: false });
|
|
1843
|
-
}
|
|
1844
|
-
|
|
1845
|
-
// node_modules/@lit/reactive-element/decorators/base.js
|
|
1846
|
-
var e4 = (e7, t5, c4) => (c4.configurable = true, c4.enumerable = true, Reflect.decorate && "object" != typeof t5 && Object.defineProperty(e7, t5, c4), c4);
|
|
1847
|
-
|
|
1848
|
-
// node_modules/@lit/reactive-element/decorators/query.js
|
|
1849
|
-
function e5(e7, r7) {
|
|
1850
|
-
return (n6, s4, i6) => {
|
|
1851
|
-
const o6 = (t5) => t5.renderRoot?.querySelector(e7) ?? null;
|
|
1852
|
-
if (r7) {
|
|
1853
|
-
const { get: e8, set: r8 } = "object" == typeof s4 ? n6 : i6 ?? (() => {
|
|
1854
|
-
const t5 = Symbol();
|
|
1855
|
-
return { get() {
|
|
1856
|
-
return this[t5];
|
|
1857
|
-
}, set(e9) {
|
|
1858
|
-
this[t5] = e9;
|
|
1859
|
-
} };
|
|
1860
|
-
})();
|
|
1861
|
-
return e4(n6, s4, { get() {
|
|
1862
|
-
let t5 = e8.call(this);
|
|
1863
|
-
return void 0 === t5 && (t5 = o6(this), (null !== t5 || this.hasUpdated) && r8.call(this, t5)), t5;
|
|
1864
|
-
} });
|
|
1865
|
-
}
|
|
1866
|
-
return e4(n6, s4, { get() {
|
|
1867
|
-
return o6(this);
|
|
1868
|
-
} });
|
|
1869
|
-
};
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
1872
|
// node_modules/lit-html/directive.js
|
|
1873
1873
|
var t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
|
|
1874
1874
|
var e6 = (t5) => (...e7) => ({ _$litDirective$: t5, values: e7 });
|
|
@@ -1922,7 +1922,7 @@ var o5 = e6(class extends i4 {
|
|
|
1922
1922
|
});
|
|
1923
1923
|
|
|
1924
1924
|
// libs/embed-libs/embed/package.json
|
|
1925
|
-
var version = "5.0.
|
|
1925
|
+
var version = "5.0.11";
|
|
1926
1926
|
|
|
1927
1927
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
1928
1928
|
var LuzmoService = class {
|
|
@@ -2089,6 +2089,10 @@ var _setEventHandler = () => {
|
|
|
2089
2089
|
|
|
2090
2090
|
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-styles.ts
|
|
2091
2091
|
var dashboardStyles = i`
|
|
2092
|
+
:host {
|
|
2093
|
+
display: block;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2092
2096
|
@-webkit-keyframes spin {
|
|
2093
2097
|
0% {
|
|
2094
2098
|
-webkit-transform: rotate(0deg);
|
|
@@ -2195,7 +2199,7 @@ var dashboardStyles = i`
|
|
|
2195
2199
|
}
|
|
2196
2200
|
`;
|
|
2197
2201
|
|
|
2198
|
-
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-
|
|
2202
|
+
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-base.ts
|
|
2199
2203
|
var LuzmoDashboard = class extends s3 {
|
|
2200
2204
|
constructor(inputParameters) {
|
|
2201
2205
|
super();
|
|
@@ -2282,7 +2286,12 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2282
2286
|
if (remotesMap[appServer]) {
|
|
2283
2287
|
return Promise.resolve(remotesMap[appServer].module);
|
|
2284
2288
|
}
|
|
2285
|
-
remotesMap[appServer] = {
|
|
2289
|
+
remotesMap[appServer] = {
|
|
2290
|
+
url: appServer?.startsWith("http://localhost") ? `${removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`,
|
|
2291
|
+
format: "esm",
|
|
2292
|
+
from: "vite",
|
|
2293
|
+
module: void 0
|
|
2294
|
+
};
|
|
2286
2295
|
return __federationMethodGetRemote(appServer, "./DashboardApp").then((module2) => {
|
|
2287
2296
|
const wrappedModule = __federationMethodWrapDefault(module2, true);
|
|
2288
2297
|
remotesMap[appServer].module = wrappedModule;
|
|
@@ -2585,68 +2594,70 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2585
2594
|
return [dashboardStyles];
|
|
2586
2595
|
}
|
|
2587
2596
|
render() {
|
|
2588
|
-
let toBeRenderedHTML
|
|
2597
|
+
let toBeRenderedHTML;
|
|
2589
2598
|
const loader = x`
|
|
2590
2599
|
<div
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2600
|
+
class="luzmo-container-loader"
|
|
2601
|
+
id="luzmo-container-loader-${this._containerId}"
|
|
2602
|
+
style=${o5(
|
|
2594
2603
|
this._containerLoaderStyle
|
|
2595
2604
|
)}
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2605
|
+
>
|
|
2606
|
+
<div
|
|
2607
|
+
class="luzmo-loader"
|
|
2608
|
+
id="luzmo-loader-${this._containerId}"
|
|
2609
|
+
style=${o5(this._loaderStyle)}
|
|
2610
|
+
>
|
|
2611
|
+
<div
|
|
2612
|
+
class="luzmo-lc"
|
|
2613
|
+
style=${o5(this._lcStyle)}
|
|
2614
|
+
>
|
|
2615
|
+
<div
|
|
2616
|
+
class="luzmo-loading-circle"
|
|
2617
|
+
style=${o5(
|
|
2609
2618
|
this._loadingCircleStyle
|
|
2610
2619
|
)}
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
</div>
|
|
2619
|
-
`}
|
|
2620
|
+
></div>
|
|
2621
|
+
${this._itemEmbedding ? "" : x`
|
|
2622
|
+
<div
|
|
2623
|
+
class="luzmo-loading-message"
|
|
2624
|
+
style=${o5({ color: this.loaderFontColor })}
|
|
2625
|
+
>
|
|
2626
|
+
${this._loaderMsg}
|
|
2620
2627
|
</div>
|
|
2621
|
-
|
|
2622
|
-
|
|
2628
|
+
`}
|
|
2629
|
+
</div>
|
|
2630
|
+
</div>
|
|
2631
|
+
</div>
|
|
2623
2632
|
`;
|
|
2624
2633
|
if (this.getIsViewMode()) {
|
|
2625
2634
|
toBeRenderedHTML = this.isLibraryLoaded ? x`
|
|
2626
|
-
${this.dashboardId || this.dashboardSlug ? x
|
|
2635
|
+
${this.dashboardId || this.dashboardSlug ? x`
|
|
2636
|
+
<dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}"
|
|
2637
|
+
api-host="${this.params.apiHost}"></dashboard-component>` : x`
|
|
2627
2638
|
<div id="luzmo-error-${this._containerId}">
|
|
2628
|
-
|
|
2629
|
-
|
|
2639
|
+
<h3 class="luzmo-error">${this.browserErrorMsg}</h3>
|
|
2640
|
+
</div>
|
|
2630
2641
|
`}
|
|
2631
2642
|
` : x`${loader}`;
|
|
2632
2643
|
} else {
|
|
2633
2644
|
toBeRenderedHTML = x`
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
+
${this.dashboardId || this.dashboardSlug ? x`
|
|
2646
|
+
${loader}
|
|
2647
|
+
<iframe
|
|
2648
|
+
class="luzmo-embed-dashboard"
|
|
2649
|
+
id="${this._iframeId}"
|
|
2650
|
+
name="${this._iframeId}"
|
|
2651
|
+
style=${o5(this.iframeStyle)}
|
|
2652
|
+
src="${this._iframeUrl}"
|
|
2653
|
+
frameborder="0"
|
|
2654
|
+
></iframe>
|
|
2655
|
+
` : x`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
|
|
2645
2656
|
${this.browserError ? x`
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2657
|
+
<div id="luzmo-error-${this._containerId}">
|
|
2658
|
+
<h3 class="luzmo-error">${this.browserErrorMsg}</h3>
|
|
2659
|
+
</div>
|
|
2660
|
+
` : ""}
|
|
2650
2661
|
`;
|
|
2651
2662
|
}
|
|
2652
2663
|
return x`
|
|
@@ -2779,41 +2790,38 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2779
2790
|
return setPreview(this, this.iframe, preview);
|
|
2780
2791
|
}
|
|
2781
2792
|
getIsViewMode() {
|
|
2782
|
-
|
|
2783
|
-
return true;
|
|
2784
|
-
}
|
|
2785
|
-
return false;
|
|
2793
|
+
return this.experimental && this.params.editMode === "view" || this.params.editMode === void 0;
|
|
2786
2794
|
}
|
|
2787
2795
|
};
|
|
2788
2796
|
__decorateClass([
|
|
2789
|
-
|
|
2797
|
+
e4(".dashboard-container")
|
|
2790
2798
|
], LuzmoDashboard.prototype, "container", 2);
|
|
2791
2799
|
__decorateClass([
|
|
2792
|
-
|
|
2800
|
+
e4(`.${luzmoEmbedContainerClass}`)
|
|
2793
2801
|
], LuzmoDashboard.prototype, "luzmoEmbedContainer", 2);
|
|
2794
2802
|
__decorateClass([
|
|
2795
|
-
|
|
2803
|
+
e4("iframe")
|
|
2796
2804
|
], LuzmoDashboard.prototype, "iframe", 2);
|
|
2797
2805
|
__decorateClass([
|
|
2798
|
-
|
|
2806
|
+
n3()
|
|
2799
2807
|
], LuzmoDashboard.prototype, "dashboardId", 2);
|
|
2800
2808
|
__decorateClass([
|
|
2801
|
-
|
|
2809
|
+
n3()
|
|
2802
2810
|
], LuzmoDashboard.prototype, "dashboardSlug", 2);
|
|
2803
2811
|
__decorateClass([
|
|
2804
|
-
|
|
2812
|
+
n3()
|
|
2805
2813
|
], LuzmoDashboard.prototype, "itemId", 2);
|
|
2806
2814
|
__decorateClass([
|
|
2807
|
-
|
|
2815
|
+
n3()
|
|
2808
2816
|
], LuzmoDashboard.prototype, "language", 2);
|
|
2809
2817
|
__decorateClass([
|
|
2810
|
-
|
|
2818
|
+
n3()
|
|
2811
2819
|
], LuzmoDashboard.prototype, "qeVersion", 2);
|
|
2812
2820
|
__decorateClass([
|
|
2813
|
-
|
|
2821
|
+
n3()
|
|
2814
2822
|
], LuzmoDashboard.prototype, "screenMode", 2);
|
|
2815
2823
|
__decorateClass([
|
|
2816
|
-
|
|
2824
|
+
n3({
|
|
2817
2825
|
converter: {
|
|
2818
2826
|
fromAttribute: (value) => value === "true",
|
|
2819
2827
|
toAttribute: String
|
|
@@ -2821,226 +2829,235 @@ __decorateClass([
|
|
|
2821
2829
|
})
|
|
2822
2830
|
], LuzmoDashboard.prototype, "switchScreenModeOnResize", 2);
|
|
2823
2831
|
__decorateClass([
|
|
2824
|
-
|
|
2832
|
+
n3()
|
|
2825
2833
|
], LuzmoDashboard.prototype, "editMode", 2);
|
|
2826
2834
|
__decorateClass([
|
|
2827
|
-
|
|
2835
|
+
n3()
|
|
2828
2836
|
], LuzmoDashboard.prototype, "mainColor", 2);
|
|
2829
2837
|
__decorateClass([
|
|
2830
|
-
|
|
2838
|
+
n3()
|
|
2831
2839
|
], LuzmoDashboard.prototype, "accentColor", 2);
|
|
2832
2840
|
__decorateClass([
|
|
2833
|
-
|
|
2841
|
+
n3()
|
|
2834
2842
|
], LuzmoDashboard.prototype, "authToken", 2);
|
|
2835
2843
|
__decorateClass([
|
|
2836
|
-
|
|
2844
|
+
n3()
|
|
2837
2845
|
], LuzmoDashboard.prototype, "authKey", 2);
|
|
2838
2846
|
__decorateClass([
|
|
2839
|
-
|
|
2847
|
+
n3()
|
|
2840
2848
|
], LuzmoDashboard.prototype, "loaderBackground", 2);
|
|
2841
2849
|
__decorateClass([
|
|
2842
|
-
|
|
2850
|
+
n3()
|
|
2843
2851
|
], LuzmoDashboard.prototype, "loaderFontColor", 2);
|
|
2844
2852
|
__decorateClass([
|
|
2845
|
-
|
|
2853
|
+
n3()
|
|
2846
2854
|
], LuzmoDashboard.prototype, "loaderSpinnerColor", 2);
|
|
2847
2855
|
__decorateClass([
|
|
2848
|
-
|
|
2856
|
+
n3()
|
|
2849
2857
|
], LuzmoDashboard.prototype, "loaderSpinnerBackground", 2);
|
|
2850
2858
|
__decorateClass([
|
|
2851
|
-
|
|
2859
|
+
n3()
|
|
2852
2860
|
], LuzmoDashboard.prototype, "appServer", 2);
|
|
2853
2861
|
__decorateClass([
|
|
2854
|
-
|
|
2862
|
+
n3()
|
|
2855
2863
|
], LuzmoDashboard.prototype, "timezoneId", 2);
|
|
2856
2864
|
__decorateClass([
|
|
2857
|
-
|
|
2865
|
+
n3()
|
|
2858
2866
|
], LuzmoDashboard.prototype, "apiHost", 2);
|
|
2859
2867
|
__decorateClass([
|
|
2860
|
-
|
|
2868
|
+
n3({ type: Object })
|
|
2861
2869
|
], LuzmoDashboard.prototype, "itemDimensions", 2);
|
|
2862
2870
|
__decorateClass([
|
|
2863
|
-
|
|
2871
|
+
n3({
|
|
2872
|
+
converter: {
|
|
2873
|
+
fromAttribute: (value) => value === "true",
|
|
2874
|
+
toAttribute: String
|
|
2875
|
+
}
|
|
2876
|
+
})
|
|
2864
2877
|
], LuzmoDashboard.prototype, "experimental", 2);
|
|
2865
2878
|
__decorateClass([
|
|
2866
|
-
|
|
2879
|
+
n3({ attribute: false })
|
|
2867
2880
|
], LuzmoDashboard.prototype, "_containerId", 2);
|
|
2868
2881
|
__decorateClass([
|
|
2869
|
-
|
|
2882
|
+
n3({ attribute: false })
|
|
2870
2883
|
], LuzmoDashboard.prototype, "_iframeId", 2);
|
|
2871
2884
|
__decorateClass([
|
|
2872
|
-
|
|
2885
|
+
n3({ attribute: false })
|
|
2873
2886
|
], LuzmoDashboard.prototype, "params", 2);
|
|
2874
2887
|
__decorateClass([
|
|
2875
|
-
|
|
2888
|
+
n3({ attribute: false })
|
|
2876
2889
|
], LuzmoDashboard.prototype, "_iframeUrl", 2);
|
|
2877
2890
|
__decorateClass([
|
|
2878
|
-
|
|
2891
|
+
n3({ attribute: false })
|
|
2879
2892
|
], LuzmoDashboard.prototype, "iframeLoaded", 2);
|
|
2880
2893
|
__decorateClass([
|
|
2881
|
-
|
|
2894
|
+
n3({ attribute: false })
|
|
2882
2895
|
], LuzmoDashboard.prototype, "promises", 2);
|
|
2883
2896
|
__decorateClass([
|
|
2884
|
-
|
|
2897
|
+
n3({ attribute: false })
|
|
2885
2898
|
], LuzmoDashboard.prototype, "iframeStyle", 2);
|
|
2886
2899
|
__decorateClass([
|
|
2887
|
-
|
|
2900
|
+
n3({ attribute: false })
|
|
2888
2901
|
], LuzmoDashboard.prototype, "_containerStyle", 2);
|
|
2889
2902
|
__decorateClass([
|
|
2890
|
-
|
|
2903
|
+
n3({ attribute: false })
|
|
2891
2904
|
], LuzmoDashboard.prototype, "_loaderStyle", 2);
|
|
2892
2905
|
__decorateClass([
|
|
2893
|
-
|
|
2906
|
+
n3({ attribute: false })
|
|
2894
2907
|
], LuzmoDashboard.prototype, "_lcStyle", 2);
|
|
2895
2908
|
__decorateClass([
|
|
2896
|
-
|
|
2909
|
+
n3({ attribute: false })
|
|
2897
2910
|
], LuzmoDashboard.prototype, "_loadingCircleStyle", 2);
|
|
2898
2911
|
__decorateClass([
|
|
2899
|
-
|
|
2912
|
+
n3({ attribute: false })
|
|
2900
2913
|
], LuzmoDashboard.prototype, "_containerLoaderStyle", 2);
|
|
2901
2914
|
__decorateClass([
|
|
2902
|
-
|
|
2915
|
+
n3({ attribute: false })
|
|
2903
2916
|
], LuzmoDashboard.prototype, "_loaderMsg", 2);
|
|
2904
2917
|
__decorateClass([
|
|
2905
|
-
|
|
2918
|
+
n3({ attribute: false })
|
|
2906
2919
|
], LuzmoDashboard.prototype, "containerWidth", 2);
|
|
2907
2920
|
__decorateClass([
|
|
2908
|
-
|
|
2921
|
+
n3({ attribute: false })
|
|
2909
2922
|
], LuzmoDashboard.prototype, "dimensions", 2);
|
|
2910
2923
|
__decorateClass([
|
|
2911
|
-
|
|
2924
|
+
n3({ attribute: false })
|
|
2912
2925
|
], LuzmoDashboard.prototype, "currentScreenMode", 2);
|
|
2913
2926
|
__decorateClass([
|
|
2914
|
-
|
|
2927
|
+
n3({ attribute: false })
|
|
2915
2928
|
], LuzmoDashboard.prototype, "_itemEmbedding", 2);
|
|
2916
2929
|
__decorateClass([
|
|
2917
|
-
|
|
2930
|
+
n3({ attribute: false })
|
|
2918
2931
|
], LuzmoDashboard.prototype, "browserError", 2);
|
|
2919
2932
|
__decorateClass([
|
|
2920
|
-
|
|
2933
|
+
n3({ attribute: false })
|
|
2921
2934
|
], LuzmoDashboard.prototype, "browserErrorMsg", 2);
|
|
2922
2935
|
__decorateClass([
|
|
2923
|
-
|
|
2936
|
+
n3({ attribute: false })
|
|
2924
2937
|
], LuzmoDashboard.prototype, "dashboardError", 2);
|
|
2925
2938
|
__decorateClass([
|
|
2926
|
-
|
|
2939
|
+
n3({ attribute: false })
|
|
2927
2940
|
], LuzmoDashboard.prototype, "browserNotSupported", 2);
|
|
2928
2941
|
__decorateClass([
|
|
2929
|
-
|
|
2942
|
+
n3()
|
|
2930
2943
|
], LuzmoDashboard.prototype, "VERSION", 2);
|
|
2931
2944
|
__decorateClass([
|
|
2932
|
-
|
|
2945
|
+
r4()
|
|
2933
2946
|
], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
|
|
2934
2947
|
__decorateClass([
|
|
2935
|
-
|
|
2948
|
+
r4()
|
|
2936
2949
|
], LuzmoDashboard.prototype, "dashboardReference", 2);
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2950
|
+
|
|
2951
|
+
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
|
|
2952
|
+
var LuzmoDashboard2 = class extends LuzmoDashboard {
|
|
2953
|
+
};
|
|
2954
|
+
LuzmoDashboard2 = __decorateClass([
|
|
2955
|
+
t("luzmo-dashboard")
|
|
2956
|
+
], LuzmoDashboard2);
|
|
2940
2957
|
/*! Bundled license information:
|
|
2941
2958
|
|
|
2942
|
-
@lit/reactive-element/
|
|
2959
|
+
@lit/reactive-element/decorators/custom-element.js:
|
|
2943
2960
|
(**
|
|
2944
2961
|
* @license
|
|
2945
|
-
* Copyright
|
|
2962
|
+
* Copyright 2017 Google LLC
|
|
2946
2963
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2947
2964
|
*)
|
|
2948
2965
|
|
|
2949
|
-
@lit/reactive-element/
|
|
2966
|
+
@lit/reactive-element/css-tag.js:
|
|
2950
2967
|
(**
|
|
2951
2968
|
* @license
|
|
2952
|
-
* Copyright
|
|
2969
|
+
* Copyright 2019 Google LLC
|
|
2953
2970
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2954
2971
|
*)
|
|
2955
2972
|
|
|
2956
|
-
lit-
|
|
2973
|
+
@lit/reactive-element/reactive-element.js:
|
|
2957
2974
|
(**
|
|
2958
2975
|
* @license
|
|
2959
2976
|
* Copyright 2017 Google LLC
|
|
2960
2977
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2961
2978
|
*)
|
|
2962
2979
|
|
|
2963
|
-
lit-element/
|
|
2980
|
+
@lit/reactive-element/decorators/property.js:
|
|
2964
2981
|
(**
|
|
2965
2982
|
* @license
|
|
2966
2983
|
* Copyright 2017 Google LLC
|
|
2967
2984
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2968
2985
|
*)
|
|
2969
2986
|
|
|
2970
|
-
lit-
|
|
2987
|
+
@lit/reactive-element/decorators/state.js:
|
|
2971
2988
|
(**
|
|
2972
2989
|
* @license
|
|
2973
|
-
* Copyright
|
|
2990
|
+
* Copyright 2017 Google LLC
|
|
2974
2991
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2975
2992
|
*)
|
|
2976
2993
|
|
|
2977
|
-
@lit/reactive-element/decorators/
|
|
2994
|
+
@lit/reactive-element/decorators/event-options.js:
|
|
2978
2995
|
(**
|
|
2979
2996
|
* @license
|
|
2980
2997
|
* Copyright 2017 Google LLC
|
|
2981
2998
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2982
2999
|
*)
|
|
2983
3000
|
|
|
2984
|
-
@lit/reactive-element/decorators/
|
|
3001
|
+
@lit/reactive-element/decorators/base.js:
|
|
2985
3002
|
(**
|
|
2986
3003
|
* @license
|
|
2987
3004
|
* Copyright 2017 Google LLC
|
|
2988
3005
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2989
3006
|
*)
|
|
2990
3007
|
|
|
2991
|
-
@lit/reactive-element/decorators/
|
|
3008
|
+
@lit/reactive-element/decorators/query.js:
|
|
2992
3009
|
(**
|
|
2993
3010
|
* @license
|
|
2994
3011
|
* Copyright 2017 Google LLC
|
|
2995
3012
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2996
3013
|
*)
|
|
2997
3014
|
|
|
2998
|
-
@lit/reactive-element/decorators/
|
|
3015
|
+
@lit/reactive-element/decorators/query-all.js:
|
|
2999
3016
|
(**
|
|
3000
3017
|
* @license
|
|
3001
3018
|
* Copyright 2017 Google LLC
|
|
3002
3019
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3003
3020
|
*)
|
|
3004
3021
|
|
|
3005
|
-
@lit/reactive-element/decorators/
|
|
3022
|
+
@lit/reactive-element/decorators/query-async.js:
|
|
3006
3023
|
(**
|
|
3007
3024
|
* @license
|
|
3008
3025
|
* Copyright 2017 Google LLC
|
|
3009
3026
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3010
3027
|
*)
|
|
3011
3028
|
|
|
3012
|
-
@lit/reactive-element/decorators/query.js:
|
|
3029
|
+
@lit/reactive-element/decorators/query-assigned-elements.js:
|
|
3013
3030
|
(**
|
|
3014
3031
|
* @license
|
|
3015
|
-
* Copyright
|
|
3032
|
+
* Copyright 2021 Google LLC
|
|
3016
3033
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3017
3034
|
*)
|
|
3018
3035
|
|
|
3019
|
-
@lit/reactive-element/decorators/query-
|
|
3036
|
+
@lit/reactive-element/decorators/query-assigned-nodes.js:
|
|
3020
3037
|
(**
|
|
3021
3038
|
* @license
|
|
3022
3039
|
* Copyright 2017 Google LLC
|
|
3023
3040
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3024
3041
|
*)
|
|
3025
3042
|
|
|
3026
|
-
|
|
3043
|
+
lit-html/lit-html.js:
|
|
3027
3044
|
(**
|
|
3028
3045
|
* @license
|
|
3029
3046
|
* Copyright 2017 Google LLC
|
|
3030
3047
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3031
3048
|
*)
|
|
3032
3049
|
|
|
3033
|
-
|
|
3050
|
+
lit-element/lit-element.js:
|
|
3034
3051
|
(**
|
|
3035
3052
|
* @license
|
|
3036
|
-
* Copyright
|
|
3053
|
+
* Copyright 2017 Google LLC
|
|
3037
3054
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3038
3055
|
*)
|
|
3039
3056
|
|
|
3040
|
-
|
|
3057
|
+
lit-html/is-server.js:
|
|
3041
3058
|
(**
|
|
3042
3059
|
* @license
|
|
3043
|
-
* Copyright
|
|
3060
|
+
* Copyright 2022 Google LLC
|
|
3044
3061
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3045
3062
|
*)
|
|
3046
3063
|
|