@ixon-cdk/iframe-adapter 1.13.0-next.2 → 1.13.0
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/dist/index.js +143 -124
- package/dist/index.umd.cjs +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,55 +1,58 @@
|
|
|
1
|
-
var
|
|
2
|
-
var ee = (t, e, n) => e in t ?
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var ee = (t, e, n) => e in t ? x(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var y = (t, e, n) => (ee(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
-
const
|
|
4
|
+
const d = "cdk:cmpctx:", r = {
|
|
5
5
|
// Lifecycle
|
|
6
|
-
Create: `${
|
|
7
|
-
Created: `${
|
|
8
|
-
Destroy: `${
|
|
6
|
+
Create: `${d}create`,
|
|
7
|
+
Created: `${d}created`,
|
|
8
|
+
Destroy: `${d}destroy`,
|
|
9
9
|
// BackendComponentClient
|
|
10
|
-
BackendComponentClientCreate: `${
|
|
11
|
-
BackendComponentClientDestroy: `${
|
|
12
|
-
BackendComponentClientCall: `${
|
|
13
|
-
BackendComponentClientCallResult: `${
|
|
10
|
+
BackendComponentClientCreate: `${d}bcc:create`,
|
|
11
|
+
BackendComponentClientDestroy: `${d}bcc:destroy`,
|
|
12
|
+
BackendComponentClientCall: `${d}bcc:call`,
|
|
13
|
+
BackendComponentClientCallResult: `${d}bcc:callresult`,
|
|
14
14
|
// LoggingDataClient
|
|
15
|
-
LoggingDataClientCreate: `${
|
|
16
|
-
LoggingDataClientDestroy: `${
|
|
17
|
-
LoggingDataClientQuery: `${
|
|
18
|
-
LoggingDataClientQueryResult: `${
|
|
15
|
+
LoggingDataClientCreate: `${d}ldc:create`,
|
|
16
|
+
LoggingDataClientDestroy: `${d}ldc:destroy`,
|
|
17
|
+
LoggingDataClientQuery: `${d}ldc:query`,
|
|
18
|
+
LoggingDataClientQueryResult: `${d}ldc:queryresult`,
|
|
19
19
|
// ResourceDataClient
|
|
20
|
-
ResourceDataClientCreate: `${
|
|
21
|
-
ResourceDataClientDestroy: `${
|
|
22
|
-
ResourceDataClientQuery: `${
|
|
23
|
-
ResourceDataClientQueryResult: `${
|
|
24
|
-
ResourceDataClientRender: `${
|
|
25
|
-
ResourceDataClientRenderResult: `${
|
|
26
|
-
ResourceDataClientUpdate: `${
|
|
27
|
-
ResourceDataClientUpdated: `${
|
|
20
|
+
ResourceDataClientCreate: `${d}rdc:create`,
|
|
21
|
+
ResourceDataClientDestroy: `${d}rdc:destroy`,
|
|
22
|
+
ResourceDataClientQuery: `${d}rdc:query`,
|
|
23
|
+
ResourceDataClientQueryResult: `${d}rdc:queryresult`,
|
|
24
|
+
ResourceDataClientRender: `${d}rdc:render`,
|
|
25
|
+
ResourceDataClientRenderResult: `${d}rdc:renderresult`,
|
|
26
|
+
ResourceDataClientUpdate: `${d}rdc:update`,
|
|
27
|
+
ResourceDataClientUpdated: `${d}rdc:updated`,
|
|
28
28
|
// ActionMenu
|
|
29
|
-
OpenActionMenu: `${
|
|
30
|
-
OpenActionMenuResult: `${
|
|
29
|
+
OpenActionMenu: `${d}openactionmenu`,
|
|
30
|
+
OpenActionMenuResult: `${d}openactionmenuresult`,
|
|
31
31
|
// ActionBottomSheet
|
|
32
|
-
OpenActionBottomSheet: `${
|
|
33
|
-
OpenActionBottomSheetResult: `${
|
|
32
|
+
OpenActionBottomSheet: `${d}openactionbottomsheet`,
|
|
33
|
+
OpenActionBottomSheetResult: `${d}openactionbottomsheetresult`,
|
|
34
34
|
// Dialogs
|
|
35
|
-
OpenAlertDialog: `${
|
|
36
|
-
OpenAlertDialogResult: `${
|
|
37
|
-
OpenConfirmDialog: `${
|
|
38
|
-
OpenConfirmDialogResult: `${
|
|
39
|
-
OpenContentDialog: `${
|
|
40
|
-
OpenContentDialogResult: `${
|
|
41
|
-
OpenFormDialog: `${
|
|
42
|
-
OpenFormDialogResult: `${
|
|
35
|
+
OpenAlertDialog: `${d}openalertdialog`,
|
|
36
|
+
OpenAlertDialogResult: `${d}openalertdialogresult`,
|
|
37
|
+
OpenConfirmDialog: `${d}openconfirmdialog`,
|
|
38
|
+
OpenConfirmDialogResult: `${d}openconfirmdialogresult`,
|
|
39
|
+
OpenContentDialog: `${d}opencontentdialog`,
|
|
40
|
+
OpenContentDialogResult: `${d}opencontentdialogresult`,
|
|
41
|
+
OpenFormDialog: `${d}openformdialog`,
|
|
42
|
+
OpenFormDialogResult: `${d}openformdialogresult`,
|
|
43
|
+
// Toast
|
|
44
|
+
OpenToast: `${d}opentoast`,
|
|
45
|
+
OpenToastResult: `${d}opentoastresult`,
|
|
43
46
|
// VPN
|
|
44
|
-
ShowVpnStatusDetails: `${
|
|
45
|
-
ToggleVpn: `${
|
|
46
|
-
VpnClientStatusChange: `${
|
|
47
|
+
ShowVpnStatusDetails: `${d}showvpnstatusdetails`,
|
|
48
|
+
ToggleVpn: `${d}togglevpn`,
|
|
49
|
+
VpnClientStatusChange: `${d}vpnclientstatuschange`,
|
|
47
50
|
// Miscellaneous
|
|
48
|
-
NavigateByUrl: `${
|
|
49
|
-
SetTimeRange: `${
|
|
50
|
-
TimeRangeChange: `${
|
|
51
|
+
NavigateByUrl: `${d}navigatebyurl`,
|
|
52
|
+
SetTimeRange: `${d}settimerange`,
|
|
53
|
+
TimeRangeChange: `${d}timerangechange`
|
|
51
54
|
};
|
|
52
|
-
function
|
|
55
|
+
function $t({ iframe: t, context: e }) {
|
|
53
56
|
return window.addEventListener("message", a, !1), e.ontimerangechange = (...o) => {
|
|
54
57
|
t.contentWindow && t.contentWindow.postMessage(
|
|
55
58
|
{
|
|
@@ -110,9 +113,9 @@ function Ot({ iframe: t, context: e }) {
|
|
|
110
113
|
break;
|
|
111
114
|
}
|
|
112
115
|
case r.BackendComponentClientCall: {
|
|
113
|
-
const { clientId: i, callId: l, functionName: p, functionArguments:
|
|
116
|
+
const { clientId: i, callId: l, functionName: p, functionArguments: c } = o.data.payload;
|
|
114
117
|
let g = a._clients.get(i);
|
|
115
|
-
g && !g._destroyed && g.call(p,
|
|
118
|
+
g && !g._destroyed && g.call(p, c).then((N) => {
|
|
116
119
|
g && !g.destroyed && t.contentWindow.postMessage(
|
|
117
120
|
{
|
|
118
121
|
type: r.BackendComponentClientCallResult,
|
|
@@ -135,9 +138,9 @@ function Ot({ iframe: t, context: e }) {
|
|
|
135
138
|
}
|
|
136
139
|
case r.LoggingDataClientQuery: {
|
|
137
140
|
const { clientId: i, queryId: l, query: p } = o.data.payload;
|
|
138
|
-
let
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
let c = a._clients.get(i);
|
|
142
|
+
c && !c._destroyed && c.query(p, (g) => {
|
|
143
|
+
c._destroyed || t.contentWindow.postMessage(
|
|
141
144
|
{
|
|
142
145
|
type: r.LoggingDataClientQueryResult,
|
|
143
146
|
payload: { queryId: l, results: g }
|
|
@@ -159,9 +162,9 @@ function Ot({ iframe: t, context: e }) {
|
|
|
159
162
|
}
|
|
160
163
|
case r.ResourceDataClientQuery: {
|
|
161
164
|
const { clientId: i, queryId: l, query: p } = o.data.payload;
|
|
162
|
-
let
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
let c = a._clients.get(i);
|
|
166
|
+
c && !c._destroyed && c.query(p, (g) => {
|
|
167
|
+
c._destroyed || t.contentWindow.postMessage(
|
|
165
168
|
{
|
|
166
169
|
type: r.ResourceDataClientQueryResult,
|
|
167
170
|
payload: { queryId: l, results: g }
|
|
@@ -173,9 +176,9 @@ function Ot({ iframe: t, context: e }) {
|
|
|
173
176
|
}
|
|
174
177
|
case r.ResourceDataClientRender: {
|
|
175
178
|
const { clientId: i, queryId: l, query: p } = o.data.payload;
|
|
176
|
-
let
|
|
177
|
-
|
|
178
|
-
|
|
179
|
+
let c = a._clients.get(i);
|
|
180
|
+
c && !c._destroyed && c.render(p, (g) => {
|
|
181
|
+
c._destroyed || t.contentWindow.postMessage(
|
|
179
182
|
{
|
|
180
183
|
type: r.ResourceDataClientRenderResult,
|
|
181
184
|
payload: { queryId: l, results: g }
|
|
@@ -187,9 +190,9 @@ function Ot({ iframe: t, context: e }) {
|
|
|
187
190
|
}
|
|
188
191
|
case r.ResourceDataClientUpdate: {
|
|
189
192
|
const { clientId: i, updateId: l, update: p } = o.data.payload;
|
|
190
|
-
let
|
|
191
|
-
|
|
192
|
-
|
|
193
|
+
let c = a._clients.get(i);
|
|
194
|
+
c && !c._destroyed && c.update(p).then(() => {
|
|
195
|
+
c && !c._destroyed && t.contentWindow.postMessage(
|
|
193
196
|
{
|
|
194
197
|
type: r.ResourceDataClientUpdated,
|
|
195
198
|
payload: { updateId: l }
|
|
@@ -239,6 +242,12 @@ function Ot({ iframe: t, context: e }) {
|
|
|
239
242
|
t.contentWindow.postMessage({ type: r.OpenFormDialogResult, payload: { result: i } }, "*");
|
|
240
243
|
});
|
|
241
244
|
break;
|
|
245
|
+
case r.OpenToast:
|
|
246
|
+
e.openToast(o.data.payload.options).then((i) => {
|
|
247
|
+
const { id: l } = o.data.payload;
|
|
248
|
+
t.contentWindow.postMessage({ type: r.OpenToastResult, payload: { id: l, result: i } }, "*");
|
|
249
|
+
});
|
|
250
|
+
break;
|
|
242
251
|
case r.ShowVpnStatusDetails:
|
|
243
252
|
e.showVpnStatusDetails(o.data.payload.agentId);
|
|
244
253
|
break;
|
|
@@ -267,9 +276,9 @@ const ae = ne;
|
|
|
267
276
|
var oe = typeof self == "object" && self && self.Object === Object && self, re = ae || oe || Function("return this")();
|
|
268
277
|
const q = re;
|
|
269
278
|
var se = q.Symbol;
|
|
270
|
-
const
|
|
271
|
-
var
|
|
272
|
-
function
|
|
279
|
+
const v = se;
|
|
280
|
+
var V = Object.prototype, ie = V.hasOwnProperty, le = V.toString, _ = v ? v.toStringTag : void 0;
|
|
281
|
+
function de(t) {
|
|
273
282
|
var e = ie.call(t, _), n = t[_];
|
|
274
283
|
try {
|
|
275
284
|
t[_] = void 0;
|
|
@@ -279,13 +288,13 @@ function ce(t) {
|
|
|
279
288
|
var o = le.call(t);
|
|
280
289
|
return a && (e ? t[_] = n : delete t[_]), o;
|
|
281
290
|
}
|
|
282
|
-
var
|
|
291
|
+
var ce = Object.prototype, ue = ce.toString;
|
|
283
292
|
function pe(t) {
|
|
284
293
|
return ue.call(t);
|
|
285
294
|
}
|
|
286
|
-
var ge = "[object Null]", ye = "[object Undefined]", j =
|
|
295
|
+
var ge = "[object Null]", ye = "[object Undefined]", j = v ? v.toStringTag : void 0;
|
|
287
296
|
function fe(t) {
|
|
288
|
-
return t == null ? t === void 0 ? ye : ge : j && j in Object(t) ?
|
|
297
|
+
return t == null ? t === void 0 ? ye : ge : j && j in Object(t) ? de(t) : pe(t);
|
|
289
298
|
}
|
|
290
299
|
function W(t) {
|
|
291
300
|
var e = typeof t;
|
|
@@ -300,18 +309,18 @@ function _e(t) {
|
|
|
300
309
|
}
|
|
301
310
|
var De = q["__core-js_shared__"];
|
|
302
311
|
const E = De;
|
|
303
|
-
var
|
|
312
|
+
var k = function() {
|
|
304
313
|
var t = /[^.]+$/.exec(E && E.keys && E.keys.IE_PROTO || "");
|
|
305
314
|
return t ? "Symbol(src)_1." + t : "";
|
|
306
315
|
}();
|
|
307
316
|
function Re(t) {
|
|
308
|
-
return !!
|
|
317
|
+
return !!k && k in t;
|
|
309
318
|
}
|
|
310
|
-
var be = Function.prototype,
|
|
311
|
-
function
|
|
319
|
+
var be = Function.prototype, Oe = be.toString;
|
|
320
|
+
function ve(t) {
|
|
312
321
|
if (t != null) {
|
|
313
322
|
try {
|
|
314
|
-
return
|
|
323
|
+
return Oe.call(t);
|
|
315
324
|
} catch {
|
|
316
325
|
}
|
|
317
326
|
try {
|
|
@@ -321,14 +330,14 @@ function Se(t) {
|
|
|
321
330
|
}
|
|
322
331
|
return "";
|
|
323
332
|
}
|
|
324
|
-
var
|
|
325
|
-
"^" + Ee.call(Le).replace(
|
|
333
|
+
var $e = /[\\^$.*+?()[\]{}|]/g, Me = /^\[object .+?Constructor\]$/, Se = Function.prototype, Ie = Object.prototype, Ee = Se.toString, Le = Ie.hasOwnProperty, Te = RegExp(
|
|
334
|
+
"^" + Ee.call(Le).replace($e, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
326
335
|
);
|
|
327
336
|
function qe(t) {
|
|
328
337
|
if (!W(t) || Re(t))
|
|
329
338
|
return !1;
|
|
330
|
-
var e = _e(t) ? Te :
|
|
331
|
-
return e.test(
|
|
339
|
+
var e = _e(t) ? Te : Me;
|
|
340
|
+
return e.test(ve(t));
|
|
332
341
|
}
|
|
333
342
|
function Ae(t, e) {
|
|
334
343
|
return t == null ? void 0 : t[e];
|
|
@@ -345,20 +354,20 @@ const D = Ne;
|
|
|
345
354
|
function je() {
|
|
346
355
|
this.__data__ = D ? D(null) : {}, this.size = 0;
|
|
347
356
|
}
|
|
348
|
-
function
|
|
357
|
+
function ke(t) {
|
|
349
358
|
var e = this.has(t) && delete this.__data__[t];
|
|
350
359
|
return this.size -= e ? 1 : 0, e;
|
|
351
360
|
}
|
|
352
|
-
var
|
|
353
|
-
function
|
|
361
|
+
var Be = "__lodash_hash_undefined__", Fe = Object.prototype, Pe = Fe.hasOwnProperty;
|
|
362
|
+
function He(t) {
|
|
354
363
|
var e = this.__data__;
|
|
355
364
|
if (D) {
|
|
356
365
|
var n = e[t];
|
|
357
|
-
return n ===
|
|
366
|
+
return n === Be ? void 0 : n;
|
|
358
367
|
}
|
|
359
368
|
return Pe.call(e, t) ? e[t] : void 0;
|
|
360
369
|
}
|
|
361
|
-
var
|
|
370
|
+
var Ve = Object.prototype, We = Ve.hasOwnProperty;
|
|
362
371
|
function ze(t) {
|
|
363
372
|
var e = this.__data__;
|
|
364
373
|
return D ? e[t] !== void 0 : We.call(e, t);
|
|
@@ -376,36 +385,36 @@ function m(t) {
|
|
|
376
385
|
}
|
|
377
386
|
}
|
|
378
387
|
m.prototype.clear = je;
|
|
379
|
-
m.prototype.delete =
|
|
380
|
-
m.prototype.get =
|
|
388
|
+
m.prototype.delete = ke;
|
|
389
|
+
m.prototype.get = He;
|
|
381
390
|
m.prototype.has = ze;
|
|
382
391
|
m.prototype.set = Ge;
|
|
383
392
|
function Je() {
|
|
384
393
|
this.__data__ = [], this.size = 0;
|
|
385
394
|
}
|
|
386
|
-
function
|
|
395
|
+
function $(t, e) {
|
|
387
396
|
for (var n = t.length; n--; )
|
|
388
397
|
if (Ue(t[n][0], e))
|
|
389
398
|
return n;
|
|
390
399
|
return -1;
|
|
391
400
|
}
|
|
392
401
|
var Ke = Array.prototype, Xe = Ke.splice;
|
|
393
|
-
function
|
|
394
|
-
var e = this.__data__, n =
|
|
402
|
+
function Ye(t) {
|
|
403
|
+
var e = this.__data__, n = $(e, t);
|
|
395
404
|
if (n < 0)
|
|
396
405
|
return !1;
|
|
397
406
|
var a = e.length - 1;
|
|
398
407
|
return n == a ? e.pop() : Xe.call(e, n, 1), --this.size, !0;
|
|
399
408
|
}
|
|
400
|
-
function
|
|
401
|
-
var e = this.__data__, n =
|
|
409
|
+
function Ze(t) {
|
|
410
|
+
var e = this.__data__, n = $(e, t);
|
|
402
411
|
return n < 0 ? void 0 : e[n][1];
|
|
403
412
|
}
|
|
404
|
-
function
|
|
405
|
-
return
|
|
413
|
+
function xe(t) {
|
|
414
|
+
return $(this.__data__, t) > -1;
|
|
406
415
|
}
|
|
407
416
|
function et(t, e) {
|
|
408
|
-
var n = this.__data__, a =
|
|
417
|
+
var n = this.__data__, a = $(n, t);
|
|
409
418
|
return a < 0 ? (++this.size, n.push([t, e])) : n[a][1] = e, this;
|
|
410
419
|
}
|
|
411
420
|
function C(t) {
|
|
@@ -416,9 +425,9 @@ function C(t) {
|
|
|
416
425
|
}
|
|
417
426
|
}
|
|
418
427
|
C.prototype.clear = Je;
|
|
419
|
-
C.prototype.delete =
|
|
420
|
-
C.prototype.get =
|
|
421
|
-
C.prototype.has =
|
|
428
|
+
C.prototype.delete = Ye;
|
|
429
|
+
C.prototype.get = Ze;
|
|
430
|
+
C.prototype.has = xe;
|
|
422
431
|
C.prototype.set = et;
|
|
423
432
|
var tt = z(q, "Map");
|
|
424
433
|
const nt = tt;
|
|
@@ -433,22 +442,22 @@ function ot(t) {
|
|
|
433
442
|
var e = typeof t;
|
|
434
443
|
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
|
|
435
444
|
}
|
|
436
|
-
function
|
|
445
|
+
function M(t, e) {
|
|
437
446
|
var n = t.__data__;
|
|
438
447
|
return ot(e) ? n[typeof e == "string" ? "string" : "hash"] : n.map;
|
|
439
448
|
}
|
|
440
449
|
function rt(t) {
|
|
441
|
-
var e =
|
|
450
|
+
var e = M(this, t).delete(t);
|
|
442
451
|
return this.size -= e ? 1 : 0, e;
|
|
443
452
|
}
|
|
444
453
|
function st(t) {
|
|
445
|
-
return
|
|
454
|
+
return M(this, t).get(t);
|
|
446
455
|
}
|
|
447
456
|
function it(t) {
|
|
448
|
-
return
|
|
457
|
+
return M(this, t).has(t);
|
|
449
458
|
}
|
|
450
459
|
function lt(t, e) {
|
|
451
|
-
var n =
|
|
460
|
+
var n = M(this, t), a = n.size;
|
|
452
461
|
return n.set(t, e), this.size += n.size == a ? 0 : 1, this;
|
|
453
462
|
}
|
|
454
463
|
function w(t) {
|
|
@@ -463,10 +472,10 @@ w.prototype.delete = rt;
|
|
|
463
472
|
w.prototype.get = st;
|
|
464
473
|
w.prototype.has = it;
|
|
465
474
|
w.prototype.set = lt;
|
|
466
|
-
var
|
|
475
|
+
var dt = "Expected a function";
|
|
467
476
|
function A(t, e) {
|
|
468
477
|
if (typeof t != "function" || e != null && typeof e != "function")
|
|
469
|
-
throw new TypeError(
|
|
478
|
+
throw new TypeError(dt);
|
|
470
479
|
var n = function() {
|
|
471
480
|
var a = arguments, o = e ? e.apply(this, a) : a[0], s = n.cache;
|
|
472
481
|
if (s.has(o))
|
|
@@ -477,8 +486,8 @@ function A(t, e) {
|
|
|
477
486
|
return n.cache = new (A.Cache || w)(), n;
|
|
478
487
|
}
|
|
479
488
|
A.Cache = w;
|
|
480
|
-
const
|
|
481
|
-
class
|
|
489
|
+
const ct = 2, Q = 1, G = "";
|
|
490
|
+
class S {
|
|
482
491
|
constructor(e, n, a) {
|
|
483
492
|
this.locale = e, this.queryRef = n, this.rawValue = a;
|
|
484
493
|
}
|
|
@@ -490,9 +499,9 @@ class M {
|
|
|
490
499
|
* @param rawValue the raw value
|
|
491
500
|
*/
|
|
492
501
|
static create(e, n, a) {
|
|
493
|
-
return n.query.postAggr === "count" ? new ut(e, n, a) : new
|
|
502
|
+
return n.query.postAggr === "count" ? new ut(e, n, a) : new S(e, n, a);
|
|
494
503
|
}
|
|
495
|
-
getDecimals(e =
|
|
504
|
+
getDecimals(e = ct) {
|
|
496
505
|
return this.decimals ?? this.queryRef.query.decimals ?? e;
|
|
497
506
|
}
|
|
498
507
|
getFactor() {
|
|
@@ -518,13 +527,13 @@ class M {
|
|
|
518
527
|
}
|
|
519
528
|
toString() {
|
|
520
529
|
var a, o, s, u;
|
|
521
|
-
const e = this.locale ?? void 0, n = A((i, l, p,
|
|
530
|
+
const e = this.locale ?? void 0, n = A((i, l, p, c) => {
|
|
522
531
|
const g = {
|
|
523
532
|
style: "decimal",
|
|
524
533
|
minimumFractionDigits: Math.floor(l),
|
|
525
534
|
maximumFractionDigits: Math.floor(l)
|
|
526
535
|
};
|
|
527
|
-
return `${new Intl.NumberFormat(
|
|
536
|
+
return `${new Intl.NumberFormat(c, g).format(i)}${p ? " " + p : ""}`;
|
|
528
537
|
});
|
|
529
538
|
return this.rawValue === null ? "" : this.queryRef.query.postAggr === "count" ? n(this.rawValue, this.getDecimals(0), this.unit ?? this.queryRef.query.unit, e) : ((a = this.queryRef.variable) == null ? void 0 : a.type) === "str" ? this.rawValue : ((o = this.queryRef.variable) == null ? void 0 : o.type) === "bool" ? this.rawValue ? "True" : "False" : ((s = this.queryRef.variable) == null ? void 0 : s.type) === "int" ? n(
|
|
530
539
|
this.rawValue,
|
|
@@ -534,7 +543,7 @@ class M {
|
|
|
534
543
|
) : ((u = this.queryRef.variable) == null ? void 0 : u.type) === "float" ? n(this.rawValue, this.getDecimals(), this.getUnit(), e) : String(this.getValue());
|
|
535
544
|
}
|
|
536
545
|
}
|
|
537
|
-
class ut extends
|
|
546
|
+
class ut extends S {
|
|
538
547
|
getFactor() {
|
|
539
548
|
return this.factor ?? this.queryRef.query.factor ?? Q;
|
|
540
549
|
}
|
|
@@ -542,9 +551,9 @@ class ut extends M {
|
|
|
542
551
|
return this.unit ?? this.queryRef.query.unit ?? G;
|
|
543
552
|
}
|
|
544
553
|
}
|
|
545
|
-
function
|
|
554
|
+
function B(t) {
|
|
546
555
|
return t.map(({ queryRef: n, time: a, value: o }) => {
|
|
547
|
-
const s = new te(n.query, n.variable, n.tag), u =
|
|
556
|
+
const s = new te(n.query, n.variable, n.tag), u = S.create(o.locale, s, o.rawValue);
|
|
548
557
|
return {
|
|
549
558
|
queryRef: s,
|
|
550
559
|
time: a,
|
|
@@ -573,7 +582,7 @@ function pt(t, e) {
|
|
|
573
582
|
f = { ...n, ...e }, U = gt(f.root, n);
|
|
574
583
|
let a = R(t, "all", () => R(t, "two", () => R(t, "one", () => R(t, "none"))));
|
|
575
584
|
if (a) {
|
|
576
|
-
const o =
|
|
585
|
+
const o = Y(Z(a, t));
|
|
577
586
|
return o.length > 0 && (a = o[0]), I(a);
|
|
578
587
|
} else
|
|
579
588
|
throw new Error("Selector was not found.");
|
|
@@ -587,19 +596,19 @@ function R(t, e, n) {
|
|
|
587
596
|
const i = (/* @__PURE__ */ new Date()).getTime() - J.getTime();
|
|
588
597
|
if (f.timeoutMs !== void 0 && i > f.timeoutMs)
|
|
589
598
|
throw new Error(`Timeout: Can't find a unique selector after ${i}ms`);
|
|
590
|
-
let l =
|
|
599
|
+
let l = O(yt(s)) || O(...ft(s)) || O(...ht(s)) || O(mt(s)) || [H()];
|
|
591
600
|
const p = wt(s);
|
|
592
601
|
if (e == "all")
|
|
593
|
-
p && (l = l.concat(l.filter(L).map((
|
|
602
|
+
p && (l = l.concat(l.filter(L).map((c) => b(c, p))));
|
|
594
603
|
else if (e == "two")
|
|
595
|
-
l = l.slice(0, 1), p && (l = l.concat(l.filter(L).map((
|
|
604
|
+
l = l.slice(0, 1), p && (l = l.concat(l.filter(L).map((c) => b(c, p))));
|
|
596
605
|
else if (e == "one") {
|
|
597
|
-
const [
|
|
598
|
-
p && L(
|
|
606
|
+
const [c] = l = l.slice(0, 1);
|
|
607
|
+
p && L(c) && (l = [b(c, p)]);
|
|
599
608
|
} else
|
|
600
|
-
e == "none" && (l = [
|
|
601
|
-
for (let
|
|
602
|
-
|
|
609
|
+
e == "none" && (l = [H()], p && (l = [b(l[0], p)]));
|
|
610
|
+
for (let c of l)
|
|
611
|
+
c.level = u;
|
|
603
612
|
if (o.push(l), o.length >= f.seedMinLength && (a = F(o, n), a))
|
|
604
613
|
break;
|
|
605
614
|
s = s.parentElement, u++;
|
|
@@ -607,7 +616,7 @@ function R(t, e, n) {
|
|
|
607
616
|
return a || (a = F(o, n)), !a && n ? n() : a;
|
|
608
617
|
}
|
|
609
618
|
function F(t, e) {
|
|
610
|
-
const n =
|
|
619
|
+
const n = Y(X(t));
|
|
611
620
|
if (n.length > f.threshold)
|
|
612
621
|
return e ? e() : null;
|
|
613
622
|
for (let a of n)
|
|
@@ -663,7 +672,7 @@ function mt(t) {
|
|
|
663
672
|
penalty: 2
|
|
664
673
|
} : null;
|
|
665
674
|
}
|
|
666
|
-
function
|
|
675
|
+
function H() {
|
|
667
676
|
return {
|
|
668
677
|
name: "*",
|
|
669
678
|
penalty: 3
|
|
@@ -690,7 +699,7 @@ function b(t, e) {
|
|
|
690
699
|
function L(t) {
|
|
691
700
|
return t.name !== "html" && !t.name.startsWith("#");
|
|
692
701
|
}
|
|
693
|
-
function
|
|
702
|
+
function O(...t) {
|
|
694
703
|
const e = t.filter(Ct);
|
|
695
704
|
return e.length > 0 ? e : null;
|
|
696
705
|
}
|
|
@@ -704,10 +713,10 @@ function* X(t, e = []) {
|
|
|
704
713
|
else
|
|
705
714
|
yield e;
|
|
706
715
|
}
|
|
707
|
-
function
|
|
716
|
+
function Y(t) {
|
|
708
717
|
return [...t].sort((e, n) => P(e) - P(n));
|
|
709
718
|
}
|
|
710
|
-
function*
|
|
719
|
+
function* Z(t, e, n = {
|
|
711
720
|
counter: 0,
|
|
712
721
|
visited: /* @__PURE__ */ new Map()
|
|
713
722
|
}) {
|
|
@@ -721,7 +730,7 @@ function* Y(t, e, n = {
|
|
|
721
730
|
const s = I(o);
|
|
722
731
|
if (n.visited.has(s))
|
|
723
732
|
return;
|
|
724
|
-
K(o) && _t(o, e) && (yield o, n.visited.set(s, !0), yield*
|
|
733
|
+
K(o) && _t(o, e) && (yield o, n.visited.set(s, !0), yield* Z(o, e, n));
|
|
725
734
|
}
|
|
726
735
|
}
|
|
727
736
|
function _t(t, e) {
|
|
@@ -790,7 +799,7 @@ class Dt {
|
|
|
790
799
|
payload: { clientId: e }
|
|
791
800
|
},
|
|
792
801
|
"*"
|
|
793
|
-
), new
|
|
802
|
+
), new Ot(e);
|
|
794
803
|
}
|
|
795
804
|
createTooltip() {
|
|
796
805
|
throw new h();
|
|
@@ -874,6 +883,16 @@ class Dt {
|
|
|
874
883
|
}
|
|
875
884
|
});
|
|
876
885
|
}
|
|
886
|
+
openToast(...e) {
|
|
887
|
+
return new Promise((n) => {
|
|
888
|
+
window.addEventListener("message", s, !1);
|
|
889
|
+
const a = crypto.randomUUID(), o = typeof e[0] == "string" ? { ...e[1] ?? {}, message: e[0] } : e[0];
|
|
890
|
+
window.parent.postMessage({ type: r.OpenToast, payload: { id: a, options: o } }, "*");
|
|
891
|
+
function s(u) {
|
|
892
|
+
u.source === window.parent && u.data.type === r.OpenToastResult && u.data.payload.id === a && (window.removeEventListener("message", s, !1), n(u.data.payload.result));
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
}
|
|
877
896
|
sanitizeHtml() {
|
|
878
897
|
throw new h();
|
|
879
898
|
}
|
|
@@ -959,12 +978,12 @@ class bt {
|
|
|
959
978
|
const { results: u } = s.data.payload;
|
|
960
979
|
if (e.length)
|
|
961
980
|
if (!e.queries || e.format !== "csv") {
|
|
962
|
-
const i = u.map((l) =>
|
|
981
|
+
const i = u.map((l) => B(l));
|
|
963
982
|
n(i);
|
|
964
983
|
} else
|
|
965
984
|
throw new h();
|
|
966
985
|
else {
|
|
967
|
-
const i =
|
|
986
|
+
const i = B(u);
|
|
968
987
|
n(i);
|
|
969
988
|
}
|
|
970
989
|
}
|
|
@@ -980,7 +999,7 @@ class bt {
|
|
|
980
999
|
);
|
|
981
1000
|
}
|
|
982
1001
|
}
|
|
983
|
-
class
|
|
1002
|
+
class Ot {
|
|
984
1003
|
constructor(e) {
|
|
985
1004
|
this.id = e;
|
|
986
1005
|
}
|
|
@@ -1057,6 +1076,6 @@ function T(t) {
|
|
|
1057
1076
|
});
|
|
1058
1077
|
}
|
|
1059
1078
|
export {
|
|
1060
|
-
|
|
1079
|
+
$t as connect,
|
|
1061
1080
|
T as getComponentContext
|
|
1062
1081
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(g,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(g=typeof globalThis<"u"?globalThis:g||self,l(g["@ixon-cdk/iframe-adapter"]={}))})(this,function(g){"use strict";var St=Object.defineProperty;var Ot=(g,l,r)=>l in g?St(g,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):g[l]=r;var y=(g,l,r)=>(Ot(g,typeof l!="symbol"?l+"":l,r),r);const l="cdk:cmpctx:",r={Create:`${l}create`,Created:`${l}created`,Destroy:`${l}destroy`,BackendComponentClientCreate:`${l}bcc:create`,BackendComponentClientDestroy:`${l}bcc:destroy`,BackendComponentClientCall:`${l}bcc:call`,BackendComponentClientCallResult:`${l}bcc:callresult`,LoggingDataClientCreate:`${l}ldc:create`,LoggingDataClientDestroy:`${l}ldc:destroy`,LoggingDataClientQuery:`${l}ldc:query`,LoggingDataClientQueryResult:`${l}ldc:queryresult`,ResourceDataClientCreate:`${l}rdc:create`,ResourceDataClientDestroy:`${l}rdc:destroy`,ResourceDataClientQuery:`${l}rdc:query`,ResourceDataClientQueryResult:`${l}rdc:queryresult`,ResourceDataClientRender:`${l}rdc:render`,ResourceDataClientRenderResult:`${l}rdc:renderresult`,ResourceDataClientUpdate:`${l}rdc:update`,ResourceDataClientUpdated:`${l}rdc:updated`,OpenActionMenu:`${l}openactionmenu`,OpenActionMenuResult:`${l}openactionmenuresult`,OpenActionBottomSheet:`${l}openactionbottomsheet`,OpenActionBottomSheetResult:`${l}openactionbottomsheetresult`,OpenAlertDialog:`${l}openalertdialog`,OpenAlertDialogResult:`${l}openalertdialogresult`,OpenConfirmDialog:`${l}openconfirmdialog`,OpenConfirmDialogResult:`${l}openconfirmdialogresult`,OpenContentDialog:`${l}opencontentdialog`,OpenContentDialogResult:`${l}opencontentdialogresult`,OpenFormDialog:`${l}openformdialog`,OpenFormDialogResult:`${l}openformdialogresult`,ShowVpnStatusDetails:`${l}showvpnstatusdetails`,ToggleVpn:`${l}togglevpn`,VpnClientStatusChange:`${l}vpnclientstatuschange`,NavigateByUrl:`${l}navigatebyurl`,SetTimeRange:`${l}settimerange`,TimeRangeChange:`${l}timerangechange`};function ee({iframe:t,context:e}){return window.addEventListener("message",a,!1),e.ontimerangechange=(...o)=>{t.contentWindow&&t.contentWindow.postMessage({type:r.TimeRangeChange,payload:o},"*")},e.onvpnclientstatuschange=(...o)=>{t.contentWindow&&t.contentWindow.postMessage({type:r.VpnClientStatusChange,payload:o},"*")},{destroy(){window.removeEventListener("message",a,!1)}};function n(o){return{_apiLinkEntries:[...o._getApiLinks().entries()],appData:o.appData,componentBaseUrl:o.componentBaseUrl,destroyed:o.destroyed,mode:o.mode,inputs:o.inputs,timeRange:o.timeRange,timeRangeIsAdjustable:o.timeRangeIsAdjustable,vpnClientStatus:o.vpnClientStatus}}function a(o){if(a._clients=a._clients||new Map([]),o.source===t.contentWindow)switch(o.data.type){case r.Create:t.contentWindow.postMessage({type:r.Created,payload:n(e)},"*");break;case r.Destroy:e.destroy();break;case r.BackendComponentClientCreate:{const{clientId:i}=o.data.payload,d=e.createBackendComponentClient(i);a._clients.set(i,d);break}case r.BackendComponentClientDestroy:{const{clientId:i}=o.data.payload;a._clients.has(i)&&(a._clients.get(i).destroy(),a._clients.delete(i));break}case r.BackendComponentClientCall:{const{clientId:i,callId:d,functionName:p,functionArguments:c}=o.data.payload;let f=a._clients.get(i);f&&!f._destroyed&&f.call(p,c).then(Z=>{f&&!f.destroyed&&t.contentWindow.postMessage({type:r.BackendComponentClientCallResult,payload:{callId:d,result:Z}},"*")});break}case r.LoggingDataClientCreate:{const{clientId:i}=o.data.payload,d=e.createLoggingDataClient(i);a._clients.set(i,d);break}case r.LoggingDataClientDestroy:{const{clientId:i}=o.data.payload;a._clients.has(i)&&(a._clients.get(i).destroy(),a._clients.delete(i));break}case r.LoggingDataClientQuery:{const{clientId:i,queryId:d,query:p}=o.data.payload;let c=a._clients.get(i);c&&!c._destroyed&&c.query(p,f=>{c._destroyed||t.contentWindow.postMessage({type:r.LoggingDataClientQueryResult,payload:{queryId:d,results:f}},"*")});break}case r.ResourceDataClientCreate:{const{clientId:i}=o.data.payload,d=e.createResourceDataClient(i);a._clients.set(i,d);break}case r.ResourceDataClientDestroy:{const{clientId:i}=o.data.payload;a._clients.has(i)&&(a._clients.get(i).destroy(),a._clients.delete(i));break}case r.ResourceDataClientQuery:{const{clientId:i,queryId:d,query:p}=o.data.payload;let c=a._clients.get(i);c&&!c._destroyed&&c.query(p,f=>{c._destroyed||t.contentWindow.postMessage({type:r.ResourceDataClientQueryResult,payload:{queryId:d,results:f}},"*")});break}case r.ResourceDataClientRender:{const{clientId:i,queryId:d,query:p}=o.data.payload;let c=a._clients.get(i);c&&!c._destroyed&&c.render(p,f=>{c._destroyed||t.contentWindow.postMessage({type:r.ResourceDataClientRenderResult,payload:{queryId:d,results:f}},"*")});break}case r.ResourceDataClientUpdate:{const{clientId:i,updateId:d,update:p}=o.data.payload;let c=a._clients.get(i);c&&!c._destroyed&&c.update(p).then(()=>{c&&!c._destroyed&&t.contentWindow.postMessage({type:r.ResourceDataClientUpdated,payload:{updateId:d}},"*")});break}case r.OpenActionBottomSheet:e.openActionBottomSheet(o.data.payload.options).then(i=>{t.contentWindow.postMessage({type:r.OpenActionBottomSheetResult,payload:{result:i}},"*")});break;case r.OpenActionMenu:const s=t.contentDocument.querySelector(o.data.payload.selector),u={getBoundingClientRect:()=>{const i=t.getBoundingClientRect(),d=s.getBoundingClientRect();return{...JSON.parse(JSON.stringify(d)),top:i.top+d.top,x:i.x+d.x}}};e.openActionMenu(u,o.data.payload.options).then(i=>{t.contentWindow.postMessage({type:r.OpenActionMenuResult,payload:{result:i}},"*")});break;case r.OpenAlertDialog:e.openAlertDialog(o.data.payload.options).then(i=>{t.contentWindow.postMessage({type:r.OpenAlertDialogResult,payload:{result:i}},"*")});break;case r.OpenConfirmDialog:e.openConfirmDialog(o.data.payload.options).then(i=>{t.contentWindow.postMessage({type:r.OpenConfirmDialogResult,payload:{result:i}},"*")});break;case r.OpenContentDialog:e.openContentDialog(o.data.payload.options).then(i=>{t.contentWindow.postMessage({type:r.OpenContentDialogResult,payload:{result:i}},"*")});break;case r.OpenFormDialog:e.openFormDialog(o.data.payload.options).then(i=>{t.contentWindow.postMessage({type:r.OpenFormDialogResult,payload:{result:i}},"*")});break;case r.ShowVpnStatusDetails:e.showVpnStatusDetails(o.data.payload.agentId);break;case r.ToggleVpn:e.toggleVpn(o.data.payload.agentId);break;case r.NavigateByUrl:e.navigateByUrl(o.data.payload.url);break;case r.SetTimeRange:e.setTimeRange(o.data.payload.timeRange);break}}}class te{constructor(e,n,a,o){this.query=e,this.variable=n,this.tag=a,this._onCancel=o,Object.freeze(this)}cancel(){this._onCancel&&this._onCancel()}}var ne=typeof global=="object"&&global&&global.Object===Object&&global;const ae=ne;var oe=typeof self=="object"&&self&&self.Object===Object&&self,re=ae||oe||Function("return this")();const T=re;var se=T.Symbol;const b=se;var j=Object.prototype,ie=j.hasOwnProperty,le=j.toString,D=b?b.toStringTag:void 0;function de(t){var e=ie.call(t,D),n=t[D];try{t[D]=void 0;var a=!0}catch{}var o=le.call(t);return a&&(e?t[D]=n:delete t[D]),o}var ce=Object.prototype,ue=ce.toString;function pe(t){return ue.call(t)}var ge="[object Null]",fe="[object Undefined]",k=b?b.toStringTag:void 0;function ye(t){return t==null?t===void 0?fe:ge:k&&k in Object(t)?de(t):pe(t)}function B(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var he="[object AsyncFunction]",me="[object Function]",we="[object GeneratorFunction]",Ce="[object Proxy]";function _e(t){if(!B(t))return!1;var e=ye(t);return e==me||e==we||e==he||e==Ce}var De=T["__core-js_shared__"];const q=De;var F=function(){var t=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Re(t){return!!F&&F in t}var be=Function.prototype,ve=be.toString;function Se(t){if(t!=null){try{return ve.call(t)}catch{}try{return t+""}catch{}}return""}var Oe=/[\\^$.*+?()[\]{}|]/g,Me=/^\[object .+?Constructor\]$/,$e=Function.prototype,Ie=Object.prototype,Ee=$e.toString,Le=Ie.hasOwnProperty,Te=RegExp("^"+Ee.call(Le).replace(Oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qe(t){if(!B(t)||Re(t))return!1;var e=_e(t)?Te:Me;return e.test(Se(t))}function Ae(t,e){return t==null?void 0:t[e]}function P(t,e){var n=Ae(t,e);return qe(n)?n:void 0}function Ue(t,e){return t===e||t!==t&&e!==e}var Ne=P(Object,"create");const R=Ne;function je(){this.__data__=R?R(null):{},this.size=0}function ke(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Be="__lodash_hash_undefined__",Fe=Object.prototype,Pe=Fe.hasOwnProperty;function Ve(t){var e=this.__data__;if(R){var n=e[t];return n===Be?void 0:n}return Pe.call(e,t)?e[t]:void 0}var He=Object.prototype,We=He.hasOwnProperty;function ze(t){var e=this.__data__;return R?e[t]!==void 0:We.call(e,t)}var Qe="__lodash_hash_undefined__";function Ge(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=R&&e===void 0?Qe:e,this}function w(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var a=t[e];this.set(a[0],a[1])}}w.prototype.clear=je,w.prototype.delete=ke,w.prototype.get=Ve,w.prototype.has=ze,w.prototype.set=Ge;function Je(){this.__data__=[],this.size=0}function v(t,e){for(var n=t.length;n--;)if(Ue(t[n][0],e))return n;return-1}var Ke=Array.prototype,xe=Ke.splice;function Xe(t){var e=this.__data__,n=v(e,t);if(n<0)return!1;var a=e.length-1;return n==a?e.pop():xe.call(e,n,1),--this.size,!0}function Ye(t){var e=this.__data__,n=v(e,t);return n<0?void 0:e[n][1]}function Ze(t){return v(this.__data__,t)>-1}function et(t,e){var n=this.__data__,a=v(n,t);return a<0?(++this.size,n.push([t,e])):n[a][1]=e,this}function _(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var a=t[e];this.set(a[0],a[1])}}_.prototype.clear=Je,_.prototype.delete=Xe,_.prototype.get=Ye,_.prototype.has=Ze,_.prototype.set=et;var tt=P(T,"Map");const nt=tt;function at(){this.size=0,this.__data__={hash:new w,map:new(nt||_),string:new w}}function ot(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function S(t,e){var n=t.__data__;return ot(e)?n[typeof e=="string"?"string":"hash"]:n.map}function rt(t){var e=S(this,t).delete(t);return this.size-=e?1:0,e}function st(t){return S(this,t).get(t)}function it(t){return S(this,t).has(t)}function lt(t,e){var n=S(this,t),a=n.size;return n.set(t,e),this.size+=n.size==a?0:1,this}function C(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var a=t[e];this.set(a[0],a[1])}}C.prototype.clear=at,C.prototype.delete=rt,C.prototype.get=st,C.prototype.has=it,C.prototype.set=lt;var dt="Expected a function";function A(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(dt);var n=function(){var a=arguments,o=e?e.apply(this,a):a[0],s=n.cache;if(s.has(o))return s.get(o);var u=t.apply(this,a);return n.cache=s.set(o,u)||s,u};return n.cache=new(A.Cache||C),n}A.Cache=C;const ct=2,V=1,H="";class O{constructor(e,n,a){this.locale=e,this.queryRef=n,this.rawValue=a}static create(e,n,a){return n.query.postAggr==="count"?new ut(e,n,a):new O(e,n,a)}getDecimals(e=ct){return this.decimals??this.queryRef.query.decimals??e}getFactor(){var e,n,a;return this.factor??this.queryRef.query.factor??((n=(e=this.queryRef.tag)==null?void 0:e.variable)!=null&&n.factor?parseFloat(this.queryRef.tag.variable.factor):null)??((a=this.queryRef.variable)!=null&&a.factor?parseFloat(this.queryRef.variable.factor):null)??V}getUnit(){var e,n,a;return this.unit??this.queryRef.query.unit??((n=(e=this.queryRef.tag)==null?void 0:e.variable)==null?void 0:n.unit)??((a=this.queryRef.variable)==null?void 0:a.unit)??H}setDecimals(e){this.decimals=e}setFactor(e){this.factor=e}setUnit(e){this.unit=e}getValue(){return this.rawValue}toString(){var a,o,s,u;const e=this.locale??void 0,n=A((i,d,p,c)=>{const f={style:"decimal",minimumFractionDigits:Math.floor(d),maximumFractionDigits:Math.floor(d)};return`${new Intl.NumberFormat(c,f).format(i)}${p?" "+p:""}`});return this.rawValue===null?"":this.queryRef.query.postAggr==="count"?n(this.rawValue,this.getDecimals(0),this.unit??this.queryRef.query.unit,e):((a=this.queryRef.variable)==null?void 0:a.type)==="str"?this.rawValue:((o=this.queryRef.variable)==null?void 0:o.type)==="bool"?this.rawValue?"True":"False":((s=this.queryRef.variable)==null?void 0:s.type)==="int"?n(this.rawValue,Number.isInteger(this.getFactor())?this.getDecimals(0):this.getDecimals(),this.getUnit(),e):((u=this.queryRef.variable)==null?void 0:u.type)==="float"?n(this.rawValue,this.getDecimals(),this.getUnit(),e):String(this.getValue())}}class ut extends O{getFactor(){return this.factor??this.queryRef.query.factor??V}getUnit(){return this.unit??this.queryRef.query.unit??H}}function W(t){return t.map(({queryRef:n,time:a,value:o})=>{const s=new te(n.query,n.variable,n.tag),u=O.create(o.locale,s,o.rawValue);return{queryRef:s,time:a,value:u}})}let h,U,z;function pt(t,e){if(z=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";const n={root:document.body,idName:o=>!0,className:o=>!0,tagName:o=>!0,attr:(o,s)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};h={...n,...e},U=gt(h.root,n);let a=M(t,"all",()=>M(t,"two",()=>M(t,"one",()=>M(t,"none"))));if(a){const o=X(Y(a,t));return o.length>0&&(a=o[0]),$(a)}else throw new Error("Selector was not found.")}function gt(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function M(t,e,n){let a=null,o=[],s=t,u=0;for(;s;){const i=new Date().getTime()-z.getTime();if(h.timeoutMs!==void 0&&i>h.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${i}ms`);let d=E(ft(s))||E(...yt(s))||E(...ht(s))||E(mt(s))||[K()];const p=wt(s);if(e=="all")p&&(d=d.concat(d.filter(N).map(c=>I(c,p))));else if(e=="two")d=d.slice(0,1),p&&(d=d.concat(d.filter(N).map(c=>I(c,p))));else if(e=="one"){const[c]=d=d.slice(0,1);p&&N(c)&&(d=[I(c,p)])}else e=="none"&&(d=[K()],p&&(d=[I(d[0],p)]));for(let c of d)c.level=u;if(o.push(d),o.length>=h.seedMinLength&&(a=Q(o,n),a))break;s=s.parentElement,u++}return a||(a=Q(o,n)),!a&&n?n():a}function Q(t,e){const n=X(x(t));if(n.length>h.threshold)return e?e():null;for(let a of n)if(J(a))return a;return null}function $(t){let e=t[0],n=e.name;for(let a=1;a<t.length;a++){const o=t[a].level||0;e.level===o-1?n=`${t[a].name} > ${n}`:n=`${t[a].name} ${n}`,e=t[a]}return n}function G(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function J(t){const e=$(t);switch(U.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function ft(t){const e=t.getAttribute("id");return e&&h.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function yt(t){return Array.from(t.attributes).filter(n=>h.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function ht(t){return Array.from(t.classList).filter(h.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function mt(t){const e=t.tagName.toLowerCase();return h.tagName(e)?{name:e,penalty:2}:null}function K(){return{name:"*",penalty:3}}function wt(t){const e=t.parentNode;if(!e)return null;let n=e.firstChild;if(!n)return null;let a=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&a++,n!==t);)n=n.nextSibling;return a}function I(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function N(t){return t.name!=="html"&&!t.name.startsWith("#")}function E(...t){const e=t.filter(Ct);return e.length>0?e:null}function Ct(t){return t!=null}function*x(t,e=[]){if(t.length>0)for(let n of t[0])yield*x(t.slice(1,t.length),e.concat(n));else yield e}function X(t){return[...t].sort((e,n)=>G(e)-G(n))}function*Y(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>h.optimizedMinLength)for(let a=1;a<t.length-1;a++){if(n.counter>h.maxNumberOfTries)return;n.counter+=1;const o=[...t];o.splice(a,1);const s=$(o);if(n.visited.has(s))return;J(o)&&_t(o,e)&&(yield o,n.visited.set(s,!0),yield*Y(o,e,n))}}function _t(t,e){return U.querySelector($(t))===e}class m extends Error{constructor(e="Method is not implemented"){super(e),this.name="NotImplementedError",this.message=e,this.stack=`NotImplementedError: ${e}`}}class Dt{constructor(e){y(this,"ontimerangechange",null);y(this,"onvpnclientstatuschange",null);y(this,"_getApiLinks");y(this,"appData");y(this,"componentBaseUrl");y(this,"destroyed");y(this,"mode");y(this,"inputs");y(this,"inputMap");y(this,"timeRange");y(this,"timeRangeIsAdjustable");y(this,"vpnClientStatus");this._getApiLinks=()=>new Map(e._apiLinkEntries),this.appData=e.appData,this.componentBaseUrl=e.componentBaseUrl,this.destroyed=e.destroyed,this.mode=e.mode,this.inputs=e.inputs,this.inputMap=new Map(Object.entries(this.inputs)),this.timeRange=e.timeRange,this.timeRangeIsAdjustable=e.timeRangeIsAdjustable,this.vpnClientStatus=e.vpnClientStatus,this._messageHandler=this._messageHandler.bind(this),window.addEventListener("message",this._messageHandler,!1)}_messageHandler(e){if(e.source===window.parent)switch(e.data.type){case r.TimeRangeChange:this.ontimerangechange&&this.ontimerangechange(...e.data.payload);break;case r.VpnClientStatusChange:this.onvpnclientstatuschange&&this.onvpnclientstatuschange(...e.data.payload);break}}createBackendComponentClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:r.BackendComponentClientCreate,payload:{clientId:e}},"*"),new Rt(e)}createLoggingDataClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:r.LoggingDataClientCreate,payload:{clientId:e}},"*"),new bt(e)}createObjectStorageClient(){throw new m}createResourceDataClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:r.ResourceDataClientCreate,payload:{clientId:e}},"*"),new vt(e)}createTooltip(){throw new m}destroy(){window.parent.postMessage({type:r.Destroy},"*"),window.removeEventListener("message",this._messageHandler,!1),this.destroyed=!0}getApiUrl(e,n){const a=this._getApiLinks().get(e);if(!a)throw new Error("IxApiError: entry not found");return n?Object.keys(n).sort().reduce((o,s)=>{if(o.includes(`{${s}}`))return o.replace(`{${s}}`,n[s]);const u=new URL(o);return u.searchParams.set(s,n[s]),decodeURIComponent(u.href)},a.href):a.href}navigateByUrl(e){window.parent.postMessage({type:r.NavigateByUrl,payload:{url:e}},"*")}openActionBottomSheet(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:r.OpenActionBottomSheet,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===r.OpenActionBottomSheetResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openActionMenu(e,n){return new Promise(a=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:r.OpenActionMenu,payload:{selector:pt(e),options:n}},"*");function o(s){s.source===window.parent&&s.data.type===r.OpenActionMenuResult&&(window.removeEventListener("message",o,!1),a(s.data.payload.result))}})}openAlertDialog(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:r.OpenAlertDialog,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===r.OpenAlertDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openConfirmDialog(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:r.OpenConfirmDialog,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===r.OpenConfirmDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openContentDialog(e){if(typeof e.onopened=="function")throw new m('The "onopened" option is not implemented');if(typeof e.onclose=="function")throw new m('The "onclose" option is not implemented');if(e.pagination)throw new m('The "pagination" option is not implemented');return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:r.OpenContentDialog,payload:{options:e.htmlContent&&typeof e.htmlContent!="string"?{...e,htmlContent:e.htmlContent.cloneNode(!0).outerHTML}:e}},"*");function a(o){o.source===window.parent&&o.data.type===r.OpenContentDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openFormDialog(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:r.OpenFormDialog,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===r.OpenFormDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}sanitizeHtml(){throw new m}saveAsFile(){throw new m}setTimeRange(e){window.parent.postMessage({type:r.SetTimeRange,payload:{timeRange:e}},"*")}showVpnStatusDetails(e){window.parent.postMessage({type:r.ShowVpnStatusDetails,payload:{agentId:e}},"*")}testVpnAccess(){throw new m}toggleVpn(e){window.parent.postMessage({type:r.ToggleVpn,payload:{agentId:e}},"*")}translate(){throw new m}}class Rt{constructor(e){this.id=e}call(e,n){return new Promise(a=>{const o=crypto.randomUUID();window.addEventListener("message",s,!1),window.parent.postMessage({type:r.BackendComponentClientCall,payload:{clientId:this.id,callId:o,functionName:e,functionArguments:n}});function s(u){u.source===window.parent&&u.data.type===r.BackendComponentClientCallResult&&u.data.payload.callId===o&&(window.removeEventListener("message",s,!1),a(u.data.payload.result))}})}destroy(){window.parent.postMessage({type:r.BackendComponentClientDestroy,payload:{clientId:this.id}},"*")}}class bt{constructor(e){this.id=e}query(e,n){const a=crypto.randomUUID();return window.addEventListener("message",o,!1),window.parent.postMessage({type:r.LoggingDataClientQuery,payload:{clientId:this.id,queryId:a,query:e}},"*"),()=>{window.removeEventListener("message",o,!1)};function o(s){if(s.source===window.parent&&s.data.type===r.LoggingDataClientQueryResult&&s.data.payload.queryId===a){const{results:u}=s.data.payload;if(e.length)if(!e.queries||e.format!=="csv"){const i=u.map(d=>W(d));n(i)}else throw new m;else{const i=W(u);n(i)}}}}destroy(){window.parent.postMessage({type:r.LoggingDataClientDestroy,payload:{clientId:this.id}},"*")}}class vt{constructor(e){this.id=e}query(e,n){const a=crypto.randomUUID();return window.addEventListener("message",o,!1),window.parent.postMessage({type:r.ResourceDataClientQuery,payload:{clientId:this.id,queryId:a,query:e}},"*"),()=>{window.removeEventListener("message",o,!1)};function o(s){s.source===window.parent&&s.data.type===r.ResourceDataClientQueryResult&&s.data.payload.queryId===a&&n(s.data.payload.results)}}update(e){return new Promise(n=>{const a=crypto.randomUUID();window.addEventListener("message",o,!1),window.parent.postMessage({type:r.ResourceDataClientUpdate,payload:{clientId:this.id,updateId:a,update:e}},"*");function o(s){s.source===window.parent&&s.data.type===r.ResourceDataClientUpdated&&s.data.payload.updateId===a&&(window.removeEventListener("message",o,!1),n())}})}render(e,n){const a=crypto.randomUUID();return window.addEventListener("message",o,!1),window.parent.postMessage({type:r.ResourceDataClientRender,payload:{clientId:this.id,queryId:a,query:e}},"*"),()=>{window.removeEventListener("message",o,!1)};function o(s){s.source===window.parent&&s.data.type===r.ResourceDataClientRenderResult&&s.data.payload.queryId===a&&n(s.data.payload.results)}}destroy(){window.parent.postMessage({type:r.ResourceDataClientDestroy,payload:{clientId:this.id}},"*")}}function L(t){const e=!!(t&&t.migrateInputs);return!e&&L.__cache__?Promise.resolve(L.__cache__):new Promise(n=>{window.addEventListener("message",function a(o){if(o.source===window.parent&&o.data&&o.data.type===r.Created){let s=o.data.payload;e&&(s.inputs=t.migrateInputs(s.inputs,null));const u=new Dt(s);n(u),e||(L.__cache__=u),window.removeEventListener("message",a,!1)}},!1),window.parent.postMessage({type:r.Create},"*")})}g.connect=ee,g.getComponentContext=L,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(g,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(g=typeof globalThis<"u"?globalThis:g||self,l(g["@ixon-cdk/iframe-adapter"]={}))})(this,function(g){"use strict";var vt=Object.defineProperty;var St=(g,l,r)=>l in g?vt(g,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):g[l]=r;var f=(g,l,r)=>(St(g,typeof l!="symbol"?l+"":l,r),r);const l="cdk:cmpctx:",r={Create:`${l}create`,Created:`${l}created`,Destroy:`${l}destroy`,BackendComponentClientCreate:`${l}bcc:create`,BackendComponentClientDestroy:`${l}bcc:destroy`,BackendComponentClientCall:`${l}bcc:call`,BackendComponentClientCallResult:`${l}bcc:callresult`,LoggingDataClientCreate:`${l}ldc:create`,LoggingDataClientDestroy:`${l}ldc:destroy`,LoggingDataClientQuery:`${l}ldc:query`,LoggingDataClientQueryResult:`${l}ldc:queryresult`,ResourceDataClientCreate:`${l}rdc:create`,ResourceDataClientDestroy:`${l}rdc:destroy`,ResourceDataClientQuery:`${l}rdc:query`,ResourceDataClientQueryResult:`${l}rdc:queryresult`,ResourceDataClientRender:`${l}rdc:render`,ResourceDataClientRenderResult:`${l}rdc:renderresult`,ResourceDataClientUpdate:`${l}rdc:update`,ResourceDataClientUpdated:`${l}rdc:updated`,OpenActionMenu:`${l}openactionmenu`,OpenActionMenuResult:`${l}openactionmenuresult`,OpenActionBottomSheet:`${l}openactionbottomsheet`,OpenActionBottomSheetResult:`${l}openactionbottomsheetresult`,OpenAlertDialog:`${l}openalertdialog`,OpenAlertDialogResult:`${l}openalertdialogresult`,OpenConfirmDialog:`${l}openconfirmdialog`,OpenConfirmDialogResult:`${l}openconfirmdialogresult`,OpenContentDialog:`${l}opencontentdialog`,OpenContentDialogResult:`${l}opencontentdialogresult`,OpenFormDialog:`${l}openformdialog`,OpenFormDialogResult:`${l}openformdialogresult`,OpenToast:`${l}opentoast`,OpenToastResult:`${l}opentoastresult`,ShowVpnStatusDetails:`${l}showvpnstatusdetails`,ToggleVpn:`${l}togglevpn`,VpnClientStatusChange:`${l}vpnclientstatuschange`,NavigateByUrl:`${l}navigatebyurl`,SetTimeRange:`${l}settimerange`,TimeRangeChange:`${l}timerangechange`};function ee({iframe:t,context:e}){return window.addEventListener("message",a,!1),e.ontimerangechange=(...o)=>{t.contentWindow&&t.contentWindow.postMessage({type:r.TimeRangeChange,payload:o},"*")},e.onvpnclientstatuschange=(...o)=>{t.contentWindow&&t.contentWindow.postMessage({type:r.VpnClientStatusChange,payload:o},"*")},{destroy(){window.removeEventListener("message",a,!1)}};function n(o){return{_apiLinkEntries:[...o._getApiLinks().entries()],appData:o.appData,componentBaseUrl:o.componentBaseUrl,destroyed:o.destroyed,mode:o.mode,inputs:o.inputs,timeRange:o.timeRange,timeRangeIsAdjustable:o.timeRangeIsAdjustable,vpnClientStatus:o.vpnClientStatus}}function a(o){if(a._clients=a._clients||new Map([]),o.source===t.contentWindow)switch(o.data.type){case r.Create:t.contentWindow.postMessage({type:r.Created,payload:n(e)},"*");break;case r.Destroy:e.destroy();break;case r.BackendComponentClientCreate:{const{clientId:i}=o.data.payload,d=e.createBackendComponentClient(i);a._clients.set(i,d);break}case r.BackendComponentClientDestroy:{const{clientId:i}=o.data.payload;a._clients.has(i)&&(a._clients.get(i).destroy(),a._clients.delete(i));break}case r.BackendComponentClientCall:{const{clientId:i,callId:d,functionName:p,functionArguments:c}=o.data.payload;let y=a._clients.get(i);y&&!y._destroyed&&y.call(p,c).then(Z=>{y&&!y.destroyed&&t.contentWindow.postMessage({type:r.BackendComponentClientCallResult,payload:{callId:d,result:Z}},"*")});break}case r.LoggingDataClientCreate:{const{clientId:i}=o.data.payload,d=e.createLoggingDataClient(i);a._clients.set(i,d);break}case r.LoggingDataClientDestroy:{const{clientId:i}=o.data.payload;a._clients.has(i)&&(a._clients.get(i).destroy(),a._clients.delete(i));break}case r.LoggingDataClientQuery:{const{clientId:i,queryId:d,query:p}=o.data.payload;let c=a._clients.get(i);c&&!c._destroyed&&c.query(p,y=>{c._destroyed||t.contentWindow.postMessage({type:r.LoggingDataClientQueryResult,payload:{queryId:d,results:y}},"*")});break}case r.ResourceDataClientCreate:{const{clientId:i}=o.data.payload,d=e.createResourceDataClient(i);a._clients.set(i,d);break}case r.ResourceDataClientDestroy:{const{clientId:i}=o.data.payload;a._clients.has(i)&&(a._clients.get(i).destroy(),a._clients.delete(i));break}case r.ResourceDataClientQuery:{const{clientId:i,queryId:d,query:p}=o.data.payload;let c=a._clients.get(i);c&&!c._destroyed&&c.query(p,y=>{c._destroyed||t.contentWindow.postMessage({type:r.ResourceDataClientQueryResult,payload:{queryId:d,results:y}},"*")});break}case r.ResourceDataClientRender:{const{clientId:i,queryId:d,query:p}=o.data.payload;let c=a._clients.get(i);c&&!c._destroyed&&c.render(p,y=>{c._destroyed||t.contentWindow.postMessage({type:r.ResourceDataClientRenderResult,payload:{queryId:d,results:y}},"*")});break}case r.ResourceDataClientUpdate:{const{clientId:i,updateId:d,update:p}=o.data.payload;let c=a._clients.get(i);c&&!c._destroyed&&c.update(p).then(()=>{c&&!c._destroyed&&t.contentWindow.postMessage({type:r.ResourceDataClientUpdated,payload:{updateId:d}},"*")});break}case r.OpenActionBottomSheet:e.openActionBottomSheet(o.data.payload.options).then(i=>{t.contentWindow.postMessage({type:r.OpenActionBottomSheetResult,payload:{result:i}},"*")});break;case r.OpenActionMenu:const s=t.contentDocument.querySelector(o.data.payload.selector),u={getBoundingClientRect:()=>{const i=t.getBoundingClientRect(),d=s.getBoundingClientRect();return{...JSON.parse(JSON.stringify(d)),top:i.top+d.top,x:i.x+d.x}}};e.openActionMenu(u,o.data.payload.options).then(i=>{t.contentWindow.postMessage({type:r.OpenActionMenuResult,payload:{result:i}},"*")});break;case r.OpenAlertDialog:e.openAlertDialog(o.data.payload.options).then(i=>{t.contentWindow.postMessage({type:r.OpenAlertDialogResult,payload:{result:i}},"*")});break;case r.OpenConfirmDialog:e.openConfirmDialog(o.data.payload.options).then(i=>{t.contentWindow.postMessage({type:r.OpenConfirmDialogResult,payload:{result:i}},"*")});break;case r.OpenContentDialog:e.openContentDialog(o.data.payload.options).then(i=>{t.contentWindow.postMessage({type:r.OpenContentDialogResult,payload:{result:i}},"*")});break;case r.OpenFormDialog:e.openFormDialog(o.data.payload.options).then(i=>{t.contentWindow.postMessage({type:r.OpenFormDialogResult,payload:{result:i}},"*")});break;case r.OpenToast:e.openToast(o.data.payload.options).then(i=>{const{id:d}=o.data.payload;t.contentWindow.postMessage({type:r.OpenToastResult,payload:{id:d,result:i}},"*")});break;case r.ShowVpnStatusDetails:e.showVpnStatusDetails(o.data.payload.agentId);break;case r.ToggleVpn:e.toggleVpn(o.data.payload.agentId);break;case r.NavigateByUrl:e.navigateByUrl(o.data.payload.url);break;case r.SetTimeRange:e.setTimeRange(o.data.payload.timeRange);break}}}class te{constructor(e,n,a,o){this.query=e,this.variable=n,this.tag=a,this._onCancel=o,Object.freeze(this)}cancel(){this._onCancel&&this._onCancel()}}var ne=typeof global=="object"&&global&&global.Object===Object&&global;const ae=ne;var oe=typeof self=="object"&&self&&self.Object===Object&&self,re=ae||oe||Function("return this")();const T=re;var se=T.Symbol;const b=se;var j=Object.prototype,ie=j.hasOwnProperty,le=j.toString,D=b?b.toStringTag:void 0;function de(t){var e=ie.call(t,D),n=t[D];try{t[D]=void 0;var a=!0}catch{}var o=le.call(t);return a&&(e?t[D]=n:delete t[D]),o}var ce=Object.prototype,ue=ce.toString;function pe(t){return ue.call(t)}var ge="[object Null]",ye="[object Undefined]",k=b?b.toStringTag:void 0;function fe(t){return t==null?t===void 0?ye:ge:k&&k in Object(t)?de(t):pe(t)}function B(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var he="[object AsyncFunction]",me="[object Function]",we="[object GeneratorFunction]",Ce="[object Proxy]";function _e(t){if(!B(t))return!1;var e=fe(t);return e==me||e==we||e==he||e==Ce}var De=T["__core-js_shared__"];const q=De;var P=function(){var t=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Re(t){return!!P&&P in t}var be=Function.prototype,Oe=be.toString;function ve(t){if(t!=null){try{return Oe.call(t)}catch{}try{return t+""}catch{}}return""}var Se=/[\\^$.*+?()[\]{}|]/g,Me=/^\[object .+?Constructor\]$/,$e=Function.prototype,Ie=Object.prototype,Ee=$e.toString,Le=Ie.hasOwnProperty,Te=RegExp("^"+Ee.call(Le).replace(Se,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qe(t){if(!B(t)||Re(t))return!1;var e=_e(t)?Te:Me;return e.test(ve(t))}function Ae(t,e){return t==null?void 0:t[e]}function F(t,e){var n=Ae(t,e);return qe(n)?n:void 0}function Ue(t,e){return t===e||t!==t&&e!==e}var Ne=F(Object,"create");const R=Ne;function je(){this.__data__=R?R(null):{},this.size=0}function ke(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Be="__lodash_hash_undefined__",Pe=Object.prototype,Fe=Pe.hasOwnProperty;function He(t){var e=this.__data__;if(R){var n=e[t];return n===Be?void 0:n}return Fe.call(e,t)?e[t]:void 0}var Ve=Object.prototype,We=Ve.hasOwnProperty;function ze(t){var e=this.__data__;return R?e[t]!==void 0:We.call(e,t)}var Qe="__lodash_hash_undefined__";function Ge(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=R&&e===void 0?Qe:e,this}function w(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var a=t[e];this.set(a[0],a[1])}}w.prototype.clear=je,w.prototype.delete=ke,w.prototype.get=He,w.prototype.has=ze,w.prototype.set=Ge;function Je(){this.__data__=[],this.size=0}function O(t,e){for(var n=t.length;n--;)if(Ue(t[n][0],e))return n;return-1}var Ke=Array.prototype,xe=Ke.splice;function Xe(t){var e=this.__data__,n=O(e,t);if(n<0)return!1;var a=e.length-1;return n==a?e.pop():xe.call(e,n,1),--this.size,!0}function Ye(t){var e=this.__data__,n=O(e,t);return n<0?void 0:e[n][1]}function Ze(t){return O(this.__data__,t)>-1}function et(t,e){var n=this.__data__,a=O(n,t);return a<0?(++this.size,n.push([t,e])):n[a][1]=e,this}function _(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var a=t[e];this.set(a[0],a[1])}}_.prototype.clear=Je,_.prototype.delete=Xe,_.prototype.get=Ye,_.prototype.has=Ze,_.prototype.set=et;var tt=F(T,"Map");const nt=tt;function at(){this.size=0,this.__data__={hash:new w,map:new(nt||_),string:new w}}function ot(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function v(t,e){var n=t.__data__;return ot(e)?n[typeof e=="string"?"string":"hash"]:n.map}function rt(t){var e=v(this,t).delete(t);return this.size-=e?1:0,e}function st(t){return v(this,t).get(t)}function it(t){return v(this,t).has(t)}function lt(t,e){var n=v(this,t),a=n.size;return n.set(t,e),this.size+=n.size==a?0:1,this}function C(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var a=t[e];this.set(a[0],a[1])}}C.prototype.clear=at,C.prototype.delete=rt,C.prototype.get=st,C.prototype.has=it,C.prototype.set=lt;var dt="Expected a function";function A(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(dt);var n=function(){var a=arguments,o=e?e.apply(this,a):a[0],s=n.cache;if(s.has(o))return s.get(o);var u=t.apply(this,a);return n.cache=s.set(o,u)||s,u};return n.cache=new(A.Cache||C),n}A.Cache=C;const ct=2,H=1,V="";class S{constructor(e,n,a){this.locale=e,this.queryRef=n,this.rawValue=a}static create(e,n,a){return n.query.postAggr==="count"?new ut(e,n,a):new S(e,n,a)}getDecimals(e=ct){return this.decimals??this.queryRef.query.decimals??e}getFactor(){var e,n,a;return this.factor??this.queryRef.query.factor??((n=(e=this.queryRef.tag)==null?void 0:e.variable)!=null&&n.factor?parseFloat(this.queryRef.tag.variable.factor):null)??((a=this.queryRef.variable)!=null&&a.factor?parseFloat(this.queryRef.variable.factor):null)??H}getUnit(){var e,n,a;return this.unit??this.queryRef.query.unit??((n=(e=this.queryRef.tag)==null?void 0:e.variable)==null?void 0:n.unit)??((a=this.queryRef.variable)==null?void 0:a.unit)??V}setDecimals(e){this.decimals=e}setFactor(e){this.factor=e}setUnit(e){this.unit=e}getValue(){return this.rawValue}toString(){var a,o,s,u;const e=this.locale??void 0,n=A((i,d,p,c)=>{const y={style:"decimal",minimumFractionDigits:Math.floor(d),maximumFractionDigits:Math.floor(d)};return`${new Intl.NumberFormat(c,y).format(i)}${p?" "+p:""}`});return this.rawValue===null?"":this.queryRef.query.postAggr==="count"?n(this.rawValue,this.getDecimals(0),this.unit??this.queryRef.query.unit,e):((a=this.queryRef.variable)==null?void 0:a.type)==="str"?this.rawValue:((o=this.queryRef.variable)==null?void 0:o.type)==="bool"?this.rawValue?"True":"False":((s=this.queryRef.variable)==null?void 0:s.type)==="int"?n(this.rawValue,Number.isInteger(this.getFactor())?this.getDecimals(0):this.getDecimals(),this.getUnit(),e):((u=this.queryRef.variable)==null?void 0:u.type)==="float"?n(this.rawValue,this.getDecimals(),this.getUnit(),e):String(this.getValue())}}class ut extends S{getFactor(){return this.factor??this.queryRef.query.factor??H}getUnit(){return this.unit??this.queryRef.query.unit??V}}function W(t){return t.map(({queryRef:n,time:a,value:o})=>{const s=new te(n.query,n.variable,n.tag),u=S.create(o.locale,s,o.rawValue);return{queryRef:s,time:a,value:u}})}let h,U,z;function pt(t,e){if(z=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";const n={root:document.body,idName:o=>!0,className:o=>!0,tagName:o=>!0,attr:(o,s)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};h={...n,...e},U=gt(h.root,n);let a=M(t,"all",()=>M(t,"two",()=>M(t,"one",()=>M(t,"none"))));if(a){const o=X(Y(a,t));return o.length>0&&(a=o[0]),$(a)}else throw new Error("Selector was not found.")}function gt(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function M(t,e,n){let a=null,o=[],s=t,u=0;for(;s;){const i=new Date().getTime()-z.getTime();if(h.timeoutMs!==void 0&&i>h.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${i}ms`);let d=E(yt(s))||E(...ft(s))||E(...ht(s))||E(mt(s))||[K()];const p=wt(s);if(e=="all")p&&(d=d.concat(d.filter(N).map(c=>I(c,p))));else if(e=="two")d=d.slice(0,1),p&&(d=d.concat(d.filter(N).map(c=>I(c,p))));else if(e=="one"){const[c]=d=d.slice(0,1);p&&N(c)&&(d=[I(c,p)])}else e=="none"&&(d=[K()],p&&(d=[I(d[0],p)]));for(let c of d)c.level=u;if(o.push(d),o.length>=h.seedMinLength&&(a=Q(o,n),a))break;s=s.parentElement,u++}return a||(a=Q(o,n)),!a&&n?n():a}function Q(t,e){const n=X(x(t));if(n.length>h.threshold)return e?e():null;for(let a of n)if(J(a))return a;return null}function $(t){let e=t[0],n=e.name;for(let a=1;a<t.length;a++){const o=t[a].level||0;e.level===o-1?n=`${t[a].name} > ${n}`:n=`${t[a].name} ${n}`,e=t[a]}return n}function G(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function J(t){const e=$(t);switch(U.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function yt(t){const e=t.getAttribute("id");return e&&h.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function ft(t){return Array.from(t.attributes).filter(n=>h.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function ht(t){return Array.from(t.classList).filter(h.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function mt(t){const e=t.tagName.toLowerCase();return h.tagName(e)?{name:e,penalty:2}:null}function K(){return{name:"*",penalty:3}}function wt(t){const e=t.parentNode;if(!e)return null;let n=e.firstChild;if(!n)return null;let a=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&a++,n!==t);)n=n.nextSibling;return a}function I(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function N(t){return t.name!=="html"&&!t.name.startsWith("#")}function E(...t){const e=t.filter(Ct);return e.length>0?e:null}function Ct(t){return t!=null}function*x(t,e=[]){if(t.length>0)for(let n of t[0])yield*x(t.slice(1,t.length),e.concat(n));else yield e}function X(t){return[...t].sort((e,n)=>G(e)-G(n))}function*Y(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>h.optimizedMinLength)for(let a=1;a<t.length-1;a++){if(n.counter>h.maxNumberOfTries)return;n.counter+=1;const o=[...t];o.splice(a,1);const s=$(o);if(n.visited.has(s))return;J(o)&&_t(o,e)&&(yield o,n.visited.set(s,!0),yield*Y(o,e,n))}}function _t(t,e){return U.querySelector($(t))===e}class m extends Error{constructor(e="Method is not implemented"){super(e),this.name="NotImplementedError",this.message=e,this.stack=`NotImplementedError: ${e}`}}class Dt{constructor(e){f(this,"ontimerangechange",null);f(this,"onvpnclientstatuschange",null);f(this,"_getApiLinks");f(this,"appData");f(this,"componentBaseUrl");f(this,"destroyed");f(this,"mode");f(this,"inputs");f(this,"inputMap");f(this,"timeRange");f(this,"timeRangeIsAdjustable");f(this,"vpnClientStatus");this._getApiLinks=()=>new Map(e._apiLinkEntries),this.appData=e.appData,this.componentBaseUrl=e.componentBaseUrl,this.destroyed=e.destroyed,this.mode=e.mode,this.inputs=e.inputs,this.inputMap=new Map(Object.entries(this.inputs)),this.timeRange=e.timeRange,this.timeRangeIsAdjustable=e.timeRangeIsAdjustable,this.vpnClientStatus=e.vpnClientStatus,this._messageHandler=this._messageHandler.bind(this),window.addEventListener("message",this._messageHandler,!1)}_messageHandler(e){if(e.source===window.parent)switch(e.data.type){case r.TimeRangeChange:this.ontimerangechange&&this.ontimerangechange(...e.data.payload);break;case r.VpnClientStatusChange:this.onvpnclientstatuschange&&this.onvpnclientstatuschange(...e.data.payload);break}}createBackendComponentClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:r.BackendComponentClientCreate,payload:{clientId:e}},"*"),new Rt(e)}createLoggingDataClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:r.LoggingDataClientCreate,payload:{clientId:e}},"*"),new bt(e)}createObjectStorageClient(){throw new m}createResourceDataClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:r.ResourceDataClientCreate,payload:{clientId:e}},"*"),new Ot(e)}createTooltip(){throw new m}destroy(){window.parent.postMessage({type:r.Destroy},"*"),window.removeEventListener("message",this._messageHandler,!1),this.destroyed=!0}getApiUrl(e,n){const a=this._getApiLinks().get(e);if(!a)throw new Error("IxApiError: entry not found");return n?Object.keys(n).sort().reduce((o,s)=>{if(o.includes(`{${s}}`))return o.replace(`{${s}}`,n[s]);const u=new URL(o);return u.searchParams.set(s,n[s]),decodeURIComponent(u.href)},a.href):a.href}navigateByUrl(e){window.parent.postMessage({type:r.NavigateByUrl,payload:{url:e}},"*")}openActionBottomSheet(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:r.OpenActionBottomSheet,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===r.OpenActionBottomSheetResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openActionMenu(e,n){return new Promise(a=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:r.OpenActionMenu,payload:{selector:pt(e),options:n}},"*");function o(s){s.source===window.parent&&s.data.type===r.OpenActionMenuResult&&(window.removeEventListener("message",o,!1),a(s.data.payload.result))}})}openAlertDialog(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:r.OpenAlertDialog,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===r.OpenAlertDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openConfirmDialog(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:r.OpenConfirmDialog,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===r.OpenConfirmDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openContentDialog(e){if(typeof e.onopened=="function")throw new m('The "onopened" option is not implemented');if(typeof e.onclose=="function")throw new m('The "onclose" option is not implemented');if(e.pagination)throw new m('The "pagination" option is not implemented');return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:r.OpenContentDialog,payload:{options:e.htmlContent&&typeof e.htmlContent!="string"?{...e,htmlContent:e.htmlContent.cloneNode(!0).outerHTML}:e}},"*");function a(o){o.source===window.parent&&o.data.type===r.OpenContentDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openFormDialog(e){return new Promise(n=>{window.addEventListener("message",a,!1),window.parent.postMessage({type:r.OpenFormDialog,payload:{options:e}},"*");function a(o){o.source===window.parent&&o.data.type===r.OpenFormDialogResult&&(window.removeEventListener("message",a,!1),n(o.data.payload.result))}})}openToast(...e){return new Promise(n=>{window.addEventListener("message",s,!1);const a=crypto.randomUUID(),o=typeof e[0]=="string"?{...e[1]??{},message:e[0]}:e[0];window.parent.postMessage({type:r.OpenToast,payload:{id:a,options:o}},"*");function s(u){u.source===window.parent&&u.data.type===r.OpenToastResult&&u.data.payload.id===a&&(window.removeEventListener("message",s,!1),n(u.data.payload.result))}})}sanitizeHtml(){throw new m}saveAsFile(){throw new m}setTimeRange(e){window.parent.postMessage({type:r.SetTimeRange,payload:{timeRange:e}},"*")}showVpnStatusDetails(e){window.parent.postMessage({type:r.ShowVpnStatusDetails,payload:{agentId:e}},"*")}testVpnAccess(){throw new m}toggleVpn(e){window.parent.postMessage({type:r.ToggleVpn,payload:{agentId:e}},"*")}translate(){throw new m}}class Rt{constructor(e){this.id=e}call(e,n){return new Promise(a=>{const o=crypto.randomUUID();window.addEventListener("message",s,!1),window.parent.postMessage({type:r.BackendComponentClientCall,payload:{clientId:this.id,callId:o,functionName:e,functionArguments:n}});function s(u){u.source===window.parent&&u.data.type===r.BackendComponentClientCallResult&&u.data.payload.callId===o&&(window.removeEventListener("message",s,!1),a(u.data.payload.result))}})}destroy(){window.parent.postMessage({type:r.BackendComponentClientDestroy,payload:{clientId:this.id}},"*")}}class bt{constructor(e){this.id=e}query(e,n){const a=crypto.randomUUID();return window.addEventListener("message",o,!1),window.parent.postMessage({type:r.LoggingDataClientQuery,payload:{clientId:this.id,queryId:a,query:e}},"*"),()=>{window.removeEventListener("message",o,!1)};function o(s){if(s.source===window.parent&&s.data.type===r.LoggingDataClientQueryResult&&s.data.payload.queryId===a){const{results:u}=s.data.payload;if(e.length)if(!e.queries||e.format!=="csv"){const i=u.map(d=>W(d));n(i)}else throw new m;else{const i=W(u);n(i)}}}}destroy(){window.parent.postMessage({type:r.LoggingDataClientDestroy,payload:{clientId:this.id}},"*")}}class Ot{constructor(e){this.id=e}query(e,n){const a=crypto.randomUUID();return window.addEventListener("message",o,!1),window.parent.postMessage({type:r.ResourceDataClientQuery,payload:{clientId:this.id,queryId:a,query:e}},"*"),()=>{window.removeEventListener("message",o,!1)};function o(s){s.source===window.parent&&s.data.type===r.ResourceDataClientQueryResult&&s.data.payload.queryId===a&&n(s.data.payload.results)}}update(e){return new Promise(n=>{const a=crypto.randomUUID();window.addEventListener("message",o,!1),window.parent.postMessage({type:r.ResourceDataClientUpdate,payload:{clientId:this.id,updateId:a,update:e}},"*");function o(s){s.source===window.parent&&s.data.type===r.ResourceDataClientUpdated&&s.data.payload.updateId===a&&(window.removeEventListener("message",o,!1),n())}})}render(e,n){const a=crypto.randomUUID();return window.addEventListener("message",o,!1),window.parent.postMessage({type:r.ResourceDataClientRender,payload:{clientId:this.id,queryId:a,query:e}},"*"),()=>{window.removeEventListener("message",o,!1)};function o(s){s.source===window.parent&&s.data.type===r.ResourceDataClientRenderResult&&s.data.payload.queryId===a&&n(s.data.payload.results)}}destroy(){window.parent.postMessage({type:r.ResourceDataClientDestroy,payload:{clientId:this.id}},"*")}}function L(t){const e=!!(t&&t.migrateInputs);return!e&&L.__cache__?Promise.resolve(L.__cache__):new Promise(n=>{window.addEventListener("message",function a(o){if(o.source===window.parent&&o.data&&o.data.type===r.Created){let s=o.data.payload;e&&(s.inputs=t.migrateInputs(s.inputs,null));const u=new Dt(s);n(u),e||(L.__cache__=u),window.removeEventListener("message",a,!1)}},!1),window.parent.postMessage({type:r.Create},"*")})}g.connect=ee,g.getComponentContext=L,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ixon-cdk/iframe-adapter",
|
|
3
|
-
"version": "1.13.0
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@medv/finder": "3.2.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@ixon-cdk/types": "^1.13.0
|
|
20
|
+
"@ixon-cdk/types": "^1.13.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"typescript": "~5.1.6",
|