@trackunit/iris-app-runtime-core 0.3.4 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.cjs +255 -2034
  2. package/package.json +3 -3
package/index.cjs CHANGED
@@ -30,2040 +30,261 @@ function __awaiter(thisArg, _arguments, P, generator) {
30
30
  });
31
31
  }
32
32
 
33
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
34
-
35
- var check = function (it) {
36
- return it && it.Math == Math && it;
37
- };
38
-
39
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
40
- var global$d =
41
- // eslint-disable-next-line es/no-global-this -- safe
42
- check(typeof globalThis == 'object' && globalThis) ||
43
- check(typeof window == 'object' && window) ||
44
- // eslint-disable-next-line no-restricted-globals -- safe
45
- check(typeof self == 'object' && self) ||
46
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
47
- // eslint-disable-next-line no-new-func -- fallback
48
- (function () { return this; })() || Function('return this')();
49
-
50
- var objectGetOwnPropertyDescriptor = {};
51
-
52
- var fails$e = function (exec) {
53
- try {
54
- return !!exec();
55
- } catch (error) {
56
- return true;
57
- }
58
- };
59
-
60
- var fails$d = fails$e;
61
-
62
- // Detect IE8's incomplete defineProperty implementation
63
- var descriptors = !fails$d(function () {
64
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
65
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
66
- });
67
-
68
- var fails$c = fails$e;
69
-
70
- var functionBindNative = !fails$c(function () {
71
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
72
- var test = (function () { /* empty */ }).bind();
73
- // eslint-disable-next-line no-prototype-builtins -- safe
74
- return typeof test != 'function' || test.hasOwnProperty('prototype');
75
- });
76
-
77
- var NATIVE_BIND$1 = functionBindNative;
78
-
79
- var call$6 = Function.prototype.call;
80
-
81
- var functionCall = NATIVE_BIND$1 ? call$6.bind(call$6) : function () {
82
- return call$6.apply(call$6, arguments);
83
- };
84
-
85
- var objectPropertyIsEnumerable = {};
86
-
87
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
88
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
89
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
90
-
91
- // Nashorn ~ JDK8 bug
92
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
93
-
94
- // `Object.prototype.propertyIsEnumerable` method implementation
95
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
96
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
97
- var descriptor = getOwnPropertyDescriptor$1(this, V);
98
- return !!descriptor && descriptor.enumerable;
99
- } : $propertyIsEnumerable;
100
-
101
- var createPropertyDescriptor$3 = function (bitmap, value) {
102
- return {
103
- enumerable: !(bitmap & 1),
104
- configurable: !(bitmap & 2),
105
- writable: !(bitmap & 4),
106
- value: value
107
- };
108
- };
109
-
110
- var NATIVE_BIND = functionBindNative;
111
-
112
- var FunctionPrototype$1 = Function.prototype;
113
- var call$5 = FunctionPrototype$1.call;
114
- var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype$1.bind.bind(call$5, call$5);
115
-
116
- var functionUncurryThis = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
117
- return function () {
118
- return call$5.apply(fn, arguments);
119
- };
120
- };
121
-
122
- var uncurryThis$c = functionUncurryThis;
123
-
124
- var toString$5 = uncurryThis$c({}.toString);
125
- var stringSlice = uncurryThis$c(''.slice);
126
-
127
- var classofRaw$1 = function (it) {
128
- return stringSlice(toString$5(it), 8, -1);
129
- };
130
-
131
- var uncurryThis$b = functionUncurryThis;
132
- var fails$b = fails$e;
133
- var classof$2 = classofRaw$1;
134
-
135
- var $Object$4 = Object;
136
- var split = uncurryThis$b(''.split);
137
-
138
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
139
- var indexedObject = fails$b(function () {
140
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
141
- // eslint-disable-next-line no-prototype-builtins -- safe
142
- return !$Object$4('z').propertyIsEnumerable(0);
143
- }) ? function (it) {
144
- return classof$2(it) == 'String' ? split(it, '') : $Object$4(it);
145
- } : $Object$4;
146
-
147
- // we can't use just `it == null` since of `document.all` special case
148
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
149
- var isNullOrUndefined$2 = function (it) {
150
- return it === null || it === undefined;
151
- };
152
-
153
- var isNullOrUndefined$1 = isNullOrUndefined$2;
154
-
155
- var $TypeError$6 = TypeError;
156
-
157
- // `RequireObjectCoercible` abstract operation
158
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
159
- var requireObjectCoercible$3 = function (it) {
160
- if (isNullOrUndefined$1(it)) throw $TypeError$6("Can't call method on " + it);
161
- return it;
162
- };
163
-
164
- // toObject with fallback for non-array-like ES3 strings
165
- var IndexedObject$1 = indexedObject;
166
- var requireObjectCoercible$2 = requireObjectCoercible$3;
167
-
168
- var toIndexedObject$5 = function (it) {
169
- return IndexedObject$1(requireObjectCoercible$2(it));
170
- };
171
-
172
- var documentAll$2 = typeof document == 'object' && document.all;
173
-
174
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
175
- var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
176
-
177
- var documentAll_1 = {
178
- all: documentAll$2,
179
- IS_HTMLDDA: IS_HTMLDDA
180
- };
181
-
182
- var $documentAll$1 = documentAll_1;
183
-
184
- var documentAll$1 = $documentAll$1.all;
185
-
186
- // `IsCallable` abstract operation
187
- // https://tc39.es/ecma262/#sec-iscallable
188
- var isCallable$f = $documentAll$1.IS_HTMLDDA ? function (argument) {
189
- return typeof argument == 'function' || argument === documentAll$1;
190
- } : function (argument) {
191
- return typeof argument == 'function';
192
- };
193
-
194
- var isCallable$e = isCallable$f;
195
- var $documentAll = documentAll_1;
196
-
197
- var documentAll = $documentAll.all;
198
-
199
- var isObject$6 = $documentAll.IS_HTMLDDA ? function (it) {
200
- return typeof it == 'object' ? it !== null : isCallable$e(it) || it === documentAll;
201
- } : function (it) {
202
- return typeof it == 'object' ? it !== null : isCallable$e(it);
203
- };
204
-
205
- var global$c = global$d;
206
- var isCallable$d = isCallable$f;
207
-
208
- var aFunction = function (argument) {
209
- return isCallable$d(argument) ? argument : undefined;
210
- };
211
-
212
- var getBuiltIn$4 = function (namespace, method) {
213
- return arguments.length < 2 ? aFunction(global$c[namespace]) : global$c[namespace] && global$c[namespace][method];
214
- };
215
-
216
- var uncurryThis$a = functionUncurryThis;
217
-
218
- var objectIsPrototypeOf = uncurryThis$a({}.isPrototypeOf);
219
-
220
- var getBuiltIn$3 = getBuiltIn$4;
221
-
222
- var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
223
-
224
- var global$b = global$d;
225
- var userAgent = engineUserAgent;
226
-
227
- var process = global$b.process;
228
- var Deno = global$b.Deno;
229
- var versions = process && process.versions || Deno && Deno.version;
230
- var v8 = versions && versions.v8;
231
- var match, version;
232
-
233
- if (v8) {
234
- match = v8.split('.');
235
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
236
- // but their correct versions are not interesting for us
237
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
238
- }
239
-
240
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
241
- // so check `userAgent` even if `.v8` exists, but 0
242
- if (!version && userAgent) {
243
- match = userAgent.match(/Edge\/(\d+)/);
244
- if (!match || match[1] >= 74) {
245
- match = userAgent.match(/Chrome\/(\d+)/);
246
- if (match) version = +match[1];
247
- }
248
- }
249
-
250
- var engineV8Version = version;
251
-
252
- /* eslint-disable es/no-symbol -- required for testing */
253
-
254
- var V8_VERSION = engineV8Version;
255
- var fails$a = fails$e;
256
-
257
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
258
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$a(function () {
259
- var symbol = Symbol();
260
- // Chrome 38 Symbol has incorrect toString conversion
261
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
262
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
263
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
264
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
265
- });
266
-
267
- /* eslint-disable es/no-symbol -- required for testing */
268
-
269
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
270
-
271
- var useSymbolAsUid = NATIVE_SYMBOL$1
272
- && !Symbol.sham
273
- && typeof Symbol.iterator == 'symbol';
274
-
275
- var getBuiltIn$2 = getBuiltIn$4;
276
- var isCallable$c = isCallable$f;
277
- var isPrototypeOf = objectIsPrototypeOf;
278
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
279
-
280
- var $Object$3 = Object;
281
-
282
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
283
- return typeof it == 'symbol';
284
- } : function (it) {
285
- var $Symbol = getBuiltIn$2('Symbol');
286
- return isCallable$c($Symbol) && isPrototypeOf($Symbol.prototype, $Object$3(it));
287
- };
288
-
289
- var $String$3 = String;
290
-
291
- var tryToString$1 = function (argument) {
292
- try {
293
- return $String$3(argument);
294
- } catch (error) {
295
- return 'Object';
296
- }
297
- };
298
-
299
- var isCallable$b = isCallable$f;
300
- var tryToString = tryToString$1;
301
-
302
- var $TypeError$5 = TypeError;
303
-
304
- // `Assert: IsCallable(argument) is true`
305
- var aCallable$1 = function (argument) {
306
- if (isCallable$b(argument)) return argument;
307
- throw $TypeError$5(tryToString(argument) + ' is not a function');
308
- };
309
-
310
- var aCallable = aCallable$1;
311
- var isNullOrUndefined = isNullOrUndefined$2;
312
-
313
- // `GetMethod` abstract operation
314
- // https://tc39.es/ecma262/#sec-getmethod
315
- var getMethod$1 = function (V, P) {
316
- var func = V[P];
317
- return isNullOrUndefined(func) ? undefined : aCallable(func);
318
- };
319
-
320
- var call$4 = functionCall;
321
- var isCallable$a = isCallable$f;
322
- var isObject$5 = isObject$6;
323
-
324
- var $TypeError$4 = TypeError;
325
-
326
- // `OrdinaryToPrimitive` abstract operation
327
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
328
- var ordinaryToPrimitive$1 = function (input, pref) {
329
- var fn, val;
330
- if (pref === 'string' && isCallable$a(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
331
- if (isCallable$a(fn = input.valueOf) && !isObject$5(val = call$4(fn, input))) return val;
332
- if (pref !== 'string' && isCallable$a(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
333
- throw $TypeError$4("Can't convert object to primitive value");
334
- };
335
-
336
- var shared$3 = {exports: {}};
337
-
338
- var global$a = global$d;
339
-
340
- // eslint-disable-next-line es/no-object-defineproperty -- safe
341
- var defineProperty$5 = Object.defineProperty;
342
-
343
- var defineGlobalProperty$3 = function (key, value) {
344
- try {
345
- defineProperty$5(global$a, key, { value: value, configurable: true, writable: true });
346
- } catch (error) {
347
- global$a[key] = value;
348
- } return value;
349
- };
350
-
351
- var global$9 = global$d;
352
- var defineGlobalProperty$2 = defineGlobalProperty$3;
353
-
354
- var SHARED = '__core-js_shared__';
355
- var store$3 = global$9[SHARED] || defineGlobalProperty$2(SHARED, {});
356
-
357
- var sharedStore = store$3;
358
-
359
- var store$2 = sharedStore;
360
-
361
- (shared$3.exports = function (key, value) {
362
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
363
- })('versions', []).push({
364
- version: '3.26.1',
365
- mode: 'global',
366
- copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
367
- license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE',
368
- source: 'https://github.com/zloirock/core-js'
369
- });
370
-
371
- var requireObjectCoercible$1 = requireObjectCoercible$3;
372
-
373
- var $Object$2 = Object;
374
-
375
- // `ToObject` abstract operation
376
- // https://tc39.es/ecma262/#sec-toobject
377
- var toObject$3 = function (argument) {
378
- return $Object$2(requireObjectCoercible$1(argument));
379
- };
380
-
381
- var uncurryThis$9 = functionUncurryThis;
382
- var toObject$2 = toObject$3;
383
-
384
- var hasOwnProperty = uncurryThis$9({}.hasOwnProperty);
385
-
386
- // `HasOwnProperty` abstract operation
387
- // https://tc39.es/ecma262/#sec-hasownproperty
388
- // eslint-disable-next-line es/no-object-hasown -- safe
389
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
390
- return hasOwnProperty(toObject$2(it), key);
391
- };
392
-
393
- var uncurryThis$8 = functionUncurryThis;
394
-
395
- var id = 0;
396
- var postfix = Math.random();
397
- var toString$4 = uncurryThis$8(1.0.toString);
398
-
399
- var uid$2 = function (key) {
400
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$4(++id + postfix, 36);
401
- };
402
-
403
- var global$8 = global$d;
404
- var shared$2 = shared$3.exports;
405
- var hasOwn$8 = hasOwnProperty_1;
406
- var uid$1 = uid$2;
407
- var NATIVE_SYMBOL = symbolConstructorDetection;
408
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
409
-
410
- var WellKnownSymbolsStore = shared$2('wks');
411
- var Symbol$3 = global$8.Symbol;
412
- var symbolFor = Symbol$3 && Symbol$3['for'];
413
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
414
-
415
- var wellKnownSymbol$8 = function (name) {
416
- if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
417
- var description = 'Symbol.' + name;
418
- if (NATIVE_SYMBOL && hasOwn$8(Symbol$3, name)) {
419
- WellKnownSymbolsStore[name] = Symbol$3[name];
420
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
421
- WellKnownSymbolsStore[name] = symbolFor(description);
422
- } else {
423
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
424
- }
425
- } return WellKnownSymbolsStore[name];
426
- };
427
-
428
- var call$3 = functionCall;
429
- var isObject$4 = isObject$6;
430
- var isSymbol$1 = isSymbol$2;
431
- var getMethod = getMethod$1;
432
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
433
- var wellKnownSymbol$7 = wellKnownSymbol$8;
434
-
435
- var $TypeError$3 = TypeError;
436
- var TO_PRIMITIVE = wellKnownSymbol$7('toPrimitive');
437
-
438
- // `ToPrimitive` abstract operation
439
- // https://tc39.es/ecma262/#sec-toprimitive
440
- var toPrimitive$1 = function (input, pref) {
441
- if (!isObject$4(input) || isSymbol$1(input)) return input;
442
- var exoticToPrim = getMethod(input, TO_PRIMITIVE);
443
- var result;
444
- if (exoticToPrim) {
445
- if (pref === undefined) pref = 'default';
446
- result = call$3(exoticToPrim, input, pref);
447
- if (!isObject$4(result) || isSymbol$1(result)) return result;
448
- throw $TypeError$3("Can't convert object to primitive value");
449
- }
450
- if (pref === undefined) pref = 'number';
451
- return ordinaryToPrimitive(input, pref);
452
- };
453
-
454
- var toPrimitive = toPrimitive$1;
455
- var isSymbol = isSymbol$2;
456
-
457
- // `ToPropertyKey` abstract operation
458
- // https://tc39.es/ecma262/#sec-topropertykey
459
- var toPropertyKey$2 = function (argument) {
460
- var key = toPrimitive(argument, 'string');
461
- return isSymbol(key) ? key : key + '';
462
- };
463
-
464
- var global$7 = global$d;
465
- var isObject$3 = isObject$6;
466
-
467
- var document$1 = global$7.document;
468
- // typeof document.createElement is 'object' in old IE
469
- var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
470
-
471
- var documentCreateElement$2 = function (it) {
472
- return EXISTS$1 ? document$1.createElement(it) : {};
473
- };
474
-
475
- var DESCRIPTORS$9 = descriptors;
476
- var fails$9 = fails$e;
477
- var createElement = documentCreateElement$2;
478
-
479
- // Thanks to IE8 for its funny defineProperty
480
- var ie8DomDefine = !DESCRIPTORS$9 && !fails$9(function () {
481
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
482
- return Object.defineProperty(createElement('div'), 'a', {
483
- get: function () { return 7; }
484
- }).a != 7;
485
- });
486
-
487
- var DESCRIPTORS$8 = descriptors;
488
- var call$2 = functionCall;
489
- var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
490
- var createPropertyDescriptor$2 = createPropertyDescriptor$3;
491
- var toIndexedObject$4 = toIndexedObject$5;
492
- var toPropertyKey$1 = toPropertyKey$2;
493
- var hasOwn$7 = hasOwnProperty_1;
494
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
495
-
496
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
497
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
498
-
499
- // `Object.getOwnPropertyDescriptor` method
500
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
501
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
502
- O = toIndexedObject$4(O);
503
- P = toPropertyKey$1(P);
504
- if (IE8_DOM_DEFINE$1) try {
505
- return $getOwnPropertyDescriptor$1(O, P);
506
- } catch (error) { /* empty */ }
507
- if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
508
- };
509
-
510
- var objectDefineProperty = {};
511
-
512
- var DESCRIPTORS$7 = descriptors;
513
- var fails$8 = fails$e;
514
-
515
- // V8 ~ Chrome 36-
516
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
517
- var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$8(function () {
518
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
519
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
520
- value: 42,
521
- writable: false
522
- }).prototype != 42;
523
- });
524
-
525
- var isObject$2 = isObject$6;
526
-
527
- var $String$2 = String;
528
- var $TypeError$2 = TypeError;
529
-
530
- // `Assert: Type(argument) is Object`
531
- var anObject$5 = function (argument) {
532
- if (isObject$2(argument)) return argument;
533
- throw $TypeError$2($String$2(argument) + ' is not an object');
534
- };
535
-
536
- var DESCRIPTORS$6 = descriptors;
537
- var IE8_DOM_DEFINE = ie8DomDefine;
538
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
539
- var anObject$4 = anObject$5;
540
- var toPropertyKey = toPropertyKey$2;
541
-
542
- var $TypeError$1 = TypeError;
543
- // eslint-disable-next-line es/no-object-defineproperty -- safe
544
- var $defineProperty = Object.defineProperty;
545
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
546
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
547
- var ENUMERABLE = 'enumerable';
548
- var CONFIGURABLE$1 = 'configurable';
549
- var WRITABLE = 'writable';
550
-
551
- // `Object.defineProperty` method
552
- // https://tc39.es/ecma262/#sec-object.defineproperty
553
- objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
554
- anObject$4(O);
555
- P = toPropertyKey(P);
556
- anObject$4(Attributes);
557
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
558
- var current = $getOwnPropertyDescriptor(O, P);
559
- if (current && current[WRITABLE]) {
560
- O[P] = Attributes.value;
561
- Attributes = {
562
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
563
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
564
- writable: false
565
- };
566
- }
567
- } return $defineProperty(O, P, Attributes);
568
- } : $defineProperty : function defineProperty(O, P, Attributes) {
569
- anObject$4(O);
570
- P = toPropertyKey(P);
571
- anObject$4(Attributes);
572
- if (IE8_DOM_DEFINE) try {
573
- return $defineProperty(O, P, Attributes);
574
- } catch (error) { /* empty */ }
575
- if ('get' in Attributes || 'set' in Attributes) throw $TypeError$1('Accessors not supported');
576
- if ('value' in Attributes) O[P] = Attributes.value;
577
- return O;
578
- };
579
-
580
- var DESCRIPTORS$5 = descriptors;
581
- var definePropertyModule$3 = objectDefineProperty;
582
- var createPropertyDescriptor$1 = createPropertyDescriptor$3;
583
-
584
- var createNonEnumerableProperty$4 = DESCRIPTORS$5 ? function (object, key, value) {
585
- return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
586
- } : function (object, key, value) {
587
- object[key] = value;
588
- return object;
589
- };
590
-
591
- var makeBuiltIn$2 = {exports: {}};
592
-
593
- var DESCRIPTORS$4 = descriptors;
594
- var hasOwn$6 = hasOwnProperty_1;
595
-
596
- var FunctionPrototype = Function.prototype;
597
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
598
- var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
599
-
600
- var EXISTS = hasOwn$6(FunctionPrototype, 'name');
601
- // additional protection from minified / mangled / dropped function names
602
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
603
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype, 'name').configurable));
604
-
605
- var functionName = {
606
- EXISTS: EXISTS,
607
- PROPER: PROPER,
608
- CONFIGURABLE: CONFIGURABLE
609
- };
610
-
611
- var uncurryThis$7 = functionUncurryThis;
612
- var isCallable$9 = isCallable$f;
613
- var store$1 = sharedStore;
614
-
615
- var functionToString = uncurryThis$7(Function.toString);
616
-
617
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
618
- if (!isCallable$9(store$1.inspectSource)) {
619
- store$1.inspectSource = function (it) {
620
- return functionToString(it);
621
- };
622
- }
623
-
624
- var inspectSource$1 = store$1.inspectSource;
625
-
626
- var global$6 = global$d;
627
- var isCallable$8 = isCallable$f;
628
-
629
- var WeakMap$1 = global$6.WeakMap;
630
-
631
- var weakMapBasicDetection = isCallable$8(WeakMap$1) && /native code/.test(String(WeakMap$1));
632
-
633
- var shared$1 = shared$3.exports;
634
- var uid = uid$2;
635
-
636
- var keys = shared$1('keys');
637
-
638
- var sharedKey$3 = function (key) {
639
- return keys[key] || (keys[key] = uid(key));
640
- };
641
-
642
- var hiddenKeys$4 = {};
643
-
644
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
645
- var global$5 = global$d;
646
- var isObject$1 = isObject$6;
647
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
648
- var hasOwn$5 = hasOwnProperty_1;
649
- var shared = sharedStore;
650
- var sharedKey$2 = sharedKey$3;
651
- var hiddenKeys$3 = hiddenKeys$4;
652
-
653
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
654
- var TypeError$1 = global$5.TypeError;
655
- var WeakMap = global$5.WeakMap;
656
- var set, get, has;
657
-
658
- var enforce = function (it) {
659
- return has(it) ? get(it) : set(it, {});
660
- };
661
-
662
- var getterFor = function (TYPE) {
663
- return function (it) {
664
- var state;
665
- if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
666
- throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
667
- } return state;
668
- };
669
- };
670
-
671
- if (NATIVE_WEAK_MAP || shared.state) {
672
- var store = shared.state || (shared.state = new WeakMap());
673
- /* eslint-disable no-self-assign -- prototype methods protection */
674
- store.get = store.get;
675
- store.has = store.has;
676
- store.set = store.set;
677
- /* eslint-enable no-self-assign -- prototype methods protection */
678
- set = function (it, metadata) {
679
- if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
680
- metadata.facade = it;
681
- store.set(it, metadata);
682
- return metadata;
683
- };
684
- get = function (it) {
685
- return store.get(it) || {};
686
- };
687
- has = function (it) {
688
- return store.has(it);
689
- };
690
- } else {
691
- var STATE = sharedKey$2('state');
692
- hiddenKeys$3[STATE] = true;
693
- set = function (it, metadata) {
694
- if (hasOwn$5(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
695
- metadata.facade = it;
696
- createNonEnumerableProperty$3(it, STATE, metadata);
697
- return metadata;
698
- };
699
- get = function (it) {
700
- return hasOwn$5(it, STATE) ? it[STATE] : {};
701
- };
702
- has = function (it) {
703
- return hasOwn$5(it, STATE);
704
- };
705
- }
706
-
707
- var internalState = {
708
- set: set,
709
- get: get,
710
- has: has,
711
- enforce: enforce,
712
- getterFor: getterFor
713
- };
714
-
715
- var fails$7 = fails$e;
716
- var isCallable$7 = isCallable$f;
717
- var hasOwn$4 = hasOwnProperty_1;
718
- var DESCRIPTORS$3 = descriptors;
719
- var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
720
- var inspectSource = inspectSource$1;
721
- var InternalStateModule$1 = internalState;
722
-
723
- var enforceInternalState = InternalStateModule$1.enforce;
724
- var getInternalState$1 = InternalStateModule$1.get;
725
- // eslint-disable-next-line es/no-object-defineproperty -- safe
726
- var defineProperty$4 = Object.defineProperty;
727
-
728
- var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$7(function () {
729
- return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
730
- });
731
-
732
- var TEMPLATE = String(String).split('String');
733
-
734
- var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
735
- if (String(name).slice(0, 7) === 'Symbol(') {
736
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
737
- }
738
- if (options && options.getter) name = 'get ' + name;
739
- if (options && options.setter) name = 'set ' + name;
740
- if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
741
- if (DESCRIPTORS$3) defineProperty$4(value, 'name', { value: name, configurable: true });
742
- else value.name = name;
743
- }
744
- if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
745
- defineProperty$4(value, 'length', { value: options.arity });
746
- }
747
- try {
748
- if (options && hasOwn$4(options, 'constructor') && options.constructor) {
749
- if (DESCRIPTORS$3) defineProperty$4(value, 'prototype', { writable: false });
750
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
751
- } else if (value.prototype) value.prototype = undefined;
752
- } catch (error) { /* empty */ }
753
- var state = enforceInternalState(value);
754
- if (!hasOwn$4(state, 'source')) {
755
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
756
- } return value;
757
- };
758
-
759
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
760
- // eslint-disable-next-line no-extend-native -- required
761
- Function.prototype.toString = makeBuiltIn$1(function toString() {
762
- return isCallable$7(this) && getInternalState$1(this).source || inspectSource(this);
763
- }, 'toString');
764
-
765
- var isCallable$6 = isCallable$f;
766
- var definePropertyModule$2 = objectDefineProperty;
767
- var makeBuiltIn = makeBuiltIn$2.exports;
768
- var defineGlobalProperty$1 = defineGlobalProperty$3;
769
-
770
- var defineBuiltIn$3 = function (O, key, value, options) {
771
- if (!options) options = {};
772
- var simple = options.enumerable;
773
- var name = options.name !== undefined ? options.name : key;
774
- if (isCallable$6(value)) makeBuiltIn(value, name, options);
775
- if (options.global) {
776
- if (simple) O[key] = value;
777
- else defineGlobalProperty$1(key, value);
778
- } else {
779
- try {
780
- if (!options.unsafe) delete O[key];
781
- else if (O[key]) simple = true;
782
- } catch (error) { /* empty */ }
783
- if (simple) O[key] = value;
784
- else definePropertyModule$2.f(O, key, {
785
- value: value,
786
- enumerable: false,
787
- configurable: !options.nonConfigurable,
788
- writable: !options.nonWritable
789
- });
790
- } return O;
791
- };
792
-
793
- var objectGetOwnPropertyNames = {};
794
-
795
- var ceil = Math.ceil;
796
- var floor = Math.floor;
797
-
798
- // `Math.trunc` method
799
- // https://tc39.es/ecma262/#sec-math.trunc
800
- // eslint-disable-next-line es/no-math-trunc -- safe
801
- var mathTrunc = Math.trunc || function trunc(x) {
802
- var n = +x;
803
- return (n > 0 ? floor : ceil)(n);
804
- };
805
-
806
- var trunc = mathTrunc;
807
-
808
- // `ToIntegerOrInfinity` abstract operation
809
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
810
- var toIntegerOrInfinity$2 = function (argument) {
811
- var number = +argument;
812
- // eslint-disable-next-line no-self-compare -- NaN check
813
- return number !== number || number === 0 ? 0 : trunc(number);
814
- };
815
-
816
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
817
-
818
- var max = Math.max;
819
- var min$1 = Math.min;
820
-
821
- // Helper for a popular repeating case of the spec:
822
- // Let integer be ? ToInteger(index).
823
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
824
- var toAbsoluteIndex$1 = function (index, length) {
825
- var integer = toIntegerOrInfinity$1(index);
826
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
827
- };
828
-
829
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
830
-
831
- var min = Math.min;
832
-
833
- // `ToLength` abstract operation
834
- // https://tc39.es/ecma262/#sec-tolength
835
- var toLength$1 = function (argument) {
836
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
837
- };
838
-
839
- var toLength = toLength$1;
840
-
841
- // `LengthOfArrayLike` abstract operation
842
- // https://tc39.es/ecma262/#sec-lengthofarraylike
843
- var lengthOfArrayLike$1 = function (obj) {
844
- return toLength(obj.length);
845
- };
846
-
847
- var toIndexedObject$3 = toIndexedObject$5;
848
- var toAbsoluteIndex = toAbsoluteIndex$1;
849
- var lengthOfArrayLike = lengthOfArrayLike$1;
850
-
851
- // `Array.prototype.{ indexOf, includes }` methods implementation
852
- var createMethod$1 = function (IS_INCLUDES) {
853
- return function ($this, el, fromIndex) {
854
- var O = toIndexedObject$3($this);
855
- var length = lengthOfArrayLike(O);
856
- var index = toAbsoluteIndex(fromIndex, length);
857
- var value;
858
- // Array#includes uses SameValueZero equality algorithm
859
- // eslint-disable-next-line no-self-compare -- NaN check
860
- if (IS_INCLUDES && el != el) while (length > index) {
861
- value = O[index++];
862
- // eslint-disable-next-line no-self-compare -- NaN check
863
- if (value != value) return true;
864
- // Array#indexOf ignores holes, Array#includes - not
865
- } else for (;length > index; index++) {
866
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
867
- } return !IS_INCLUDES && -1;
868
- };
869
- };
870
-
871
- var arrayIncludes = {
872
- // `Array.prototype.includes` method
873
- // https://tc39.es/ecma262/#sec-array.prototype.includes
874
- includes: createMethod$1(true),
875
- // `Array.prototype.indexOf` method
876
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
877
- indexOf: createMethod$1(false)
878
- };
879
-
880
- var uncurryThis$6 = functionUncurryThis;
881
- var hasOwn$3 = hasOwnProperty_1;
882
- var toIndexedObject$2 = toIndexedObject$5;
883
- var indexOf = arrayIncludes.indexOf;
884
- var hiddenKeys$2 = hiddenKeys$4;
885
-
886
- var push = uncurryThis$6([].push);
887
-
888
- var objectKeysInternal = function (object, names) {
889
- var O = toIndexedObject$2(object);
890
- var i = 0;
891
- var result = [];
892
- var key;
893
- for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push(result, key);
894
- // Don't enum bug & hidden keys
895
- while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
896
- ~indexOf(result, key) || push(result, key);
897
- }
898
- return result;
899
- };
900
-
901
- // IE8- don't enum bug keys
902
- var enumBugKeys$3 = [
903
- 'constructor',
904
- 'hasOwnProperty',
905
- 'isPrototypeOf',
906
- 'propertyIsEnumerable',
907
- 'toLocaleString',
908
- 'toString',
909
- 'valueOf'
910
- ];
911
-
912
- var internalObjectKeys$1 = objectKeysInternal;
913
- var enumBugKeys$2 = enumBugKeys$3;
914
-
915
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
916
-
917
- // `Object.getOwnPropertyNames` method
918
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
919
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
920
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
921
- return internalObjectKeys$1(O, hiddenKeys$1);
922
- };
923
-
924
- var objectGetOwnPropertySymbols = {};
925
-
926
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
927
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
928
-
929
- var getBuiltIn$1 = getBuiltIn$4;
930
- var uncurryThis$5 = functionUncurryThis;
931
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
932
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
933
- var anObject$3 = anObject$5;
934
-
935
- var concat$1 = uncurryThis$5([].concat);
936
-
937
- // all object keys, includes non-enumerable and symbols
938
- var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
939
- var keys = getOwnPropertyNamesModule.f(anObject$3(it));
940
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
941
- return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
942
- };
943
-
944
- var hasOwn$2 = hasOwnProperty_1;
945
- var ownKeys = ownKeys$1;
946
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
947
- var definePropertyModule$1 = objectDefineProperty;
948
-
949
- var copyConstructorProperties$1 = function (target, source, exceptions) {
950
- var keys = ownKeys(source);
951
- var defineProperty = definePropertyModule$1.f;
952
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
953
- for (var i = 0; i < keys.length; i++) {
954
- var key = keys[i];
955
- if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
956
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
957
- }
958
- }
959
- };
960
-
961
- var fails$6 = fails$e;
962
- var isCallable$5 = isCallable$f;
963
-
964
- var replacement = /#|\.prototype\./;
965
-
966
- var isForced$1 = function (feature, detection) {
967
- var value = data[normalize(feature)];
968
- return value == POLYFILL ? true
969
- : value == NATIVE ? false
970
- : isCallable$5(detection) ? fails$6(detection)
971
- : !!detection;
972
- };
973
-
974
- var normalize = isForced$1.normalize = function (string) {
975
- return String(string).replace(replacement, '.').toLowerCase();
976
- };
977
-
978
- var data = isForced$1.data = {};
979
- var NATIVE = isForced$1.NATIVE = 'N';
980
- var POLYFILL = isForced$1.POLYFILL = 'P';
981
-
982
- var isForced_1 = isForced$1;
983
-
984
- var global$4 = global$d;
985
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
986
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
987
- var defineBuiltIn$2 = defineBuiltIn$3;
988
- var defineGlobalProperty = defineGlobalProperty$3;
989
- var copyConstructorProperties = copyConstructorProperties$1;
990
- var isForced = isForced_1;
991
-
992
- /*
993
- options.target - name of the target object
994
- options.global - target is the global object
995
- options.stat - export as static methods of target
996
- options.proto - export as prototype methods of target
997
- options.real - real prototype method for the `pure` version
998
- options.forced - export even if the native feature is available
999
- options.bind - bind methods to the target, required for the `pure` version
1000
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1001
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
1002
- options.sham - add a flag to not completely full polyfills
1003
- options.enumerable - export as enumerable property
1004
- options.dontCallGetSet - prevent calling a getter on target
1005
- options.name - the .name of the function if it does not match the key
1006
- */
1007
- var _export = function (options, source) {
1008
- var TARGET = options.target;
1009
- var GLOBAL = options.global;
1010
- var STATIC = options.stat;
1011
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1012
- if (GLOBAL) {
1013
- target = global$4;
1014
- } else if (STATIC) {
1015
- target = global$4[TARGET] || defineGlobalProperty(TARGET, {});
1016
- } else {
1017
- target = (global$4[TARGET] || {}).prototype;
1018
- }
1019
- if (target) for (key in source) {
1020
- sourceProperty = source[key];
1021
- if (options.dontCallGetSet) {
1022
- descriptor = getOwnPropertyDescriptor(target, key);
1023
- targetProperty = descriptor && descriptor.value;
1024
- } else targetProperty = target[key];
1025
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1026
- // contained in target
1027
- if (!FORCED && targetProperty !== undefined) {
1028
- if (typeof sourceProperty == typeof targetProperty) continue;
1029
- copyConstructorProperties(sourceProperty, targetProperty);
1030
- }
1031
- // add a flag to not completely full polyfills
1032
- if (options.sham || (targetProperty && targetProperty.sham)) {
1033
- createNonEnumerableProperty$2(sourceProperty, 'sham', true);
1034
- }
1035
- defineBuiltIn$2(target, key, sourceProperty, options);
1036
- }
1037
- };
1038
-
1039
- var internalObjectKeys = objectKeysInternal;
1040
- var enumBugKeys$1 = enumBugKeys$3;
1041
-
1042
- // `Object.keys` method
1043
- // https://tc39.es/ecma262/#sec-object.keys
1044
- // eslint-disable-next-line es/no-object-keys -- safe
1045
- var objectKeys$2 = Object.keys || function keys(O) {
1046
- return internalObjectKeys(O, enumBugKeys$1);
1047
- };
1048
-
1049
- var DESCRIPTORS$2 = descriptors;
1050
- var uncurryThis$4 = functionUncurryThis;
1051
- var call$1 = functionCall;
1052
- var fails$5 = fails$e;
1053
- var objectKeys$1 = objectKeys$2;
1054
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1055
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1056
- var toObject$1 = toObject$3;
1057
- var IndexedObject = indexedObject;
1058
-
1059
- // eslint-disable-next-line es/no-object-assign -- safe
1060
- var $assign = Object.assign;
1061
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1062
- var defineProperty$3 = Object.defineProperty;
1063
- var concat = uncurryThis$4([].concat);
1064
-
1065
- // `Object.assign` method
1066
- // https://tc39.es/ecma262/#sec-object.assign
1067
- var objectAssign = !$assign || fails$5(function () {
1068
- // should have correct order of operations (Edge bug)
1069
- if (DESCRIPTORS$2 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
1070
- enumerable: true,
1071
- get: function () {
1072
- defineProperty$3(this, 'b', {
1073
- value: 3,
1074
- enumerable: false
1075
- });
1076
- }
1077
- }), { b: 2 })).b !== 1) return true;
1078
- // should work with symbols and should have deterministic property order (V8 bug)
1079
- var A = {};
1080
- var B = {};
1081
- // eslint-disable-next-line es/no-symbol -- safe
1082
- var symbol = Symbol();
1083
- var alphabet = 'abcdefghijklmnopqrst';
1084
- A[symbol] = 7;
1085
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1086
- return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
1087
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1088
- var T = toObject$1(target);
1089
- var argumentsLength = arguments.length;
1090
- var index = 1;
1091
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1092
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
1093
- while (argumentsLength > index) {
1094
- var S = IndexedObject(arguments[index++]);
1095
- var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1096
- var length = keys.length;
1097
- var j = 0;
1098
- var key;
1099
- while (length > j) {
1100
- key = keys[j++];
1101
- if (!DESCRIPTORS$2 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
1102
- }
1103
- } return T;
1104
- } : $assign;
1105
-
1106
- var $$4 = _export;
1107
- var assign = objectAssign;
1108
-
1109
- // `Object.assign` method
1110
- // https://tc39.es/ecma262/#sec-object.assign
1111
- // eslint-disable-next-line es/no-object-assign -- required for testing
1112
- $$4({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1113
- assign: assign
1114
- });
1115
-
1116
- const setupHostConnector = subscribedMethods => {
1117
- const methods = Object.assign({
1118
- onGlobalSelectionChanged: () => {},
1119
- onTokenChanged: () => {},
1120
- onAssetSortingStateChanged: () => {}
1121
- }, subscribedMethods);
1122
- const connection = penpal.connectToParent({
1123
- methods
1124
- });
1125
- penpal.connectToParent({
1126
- methods
1127
- }).promise.catch(err => {
1128
- // TODO consider how to handle this catch
1129
- // eslint-disable-next-line no-console
1130
- console.log(err);
1131
- });
1132
- return connection;
1133
- };
1134
- const hostConnector = setupHostConnector({});
1135
- const getHostConnector = () => {
1136
- return hostConnector.promise;
1137
- };
1138
-
1139
- const AssetRuntime = {
1140
- getAssetInfo: () => __awaiter(void 0, void 0, void 0, function* () {
1141
- const api = yield getHostConnector();
1142
- return api.getAssetInfo();
1143
- }),
1144
- gotoAssetHome: (assetId, irisAppId, extensionId) => __awaiter(void 0, void 0, void 0, function* () {
1145
- const api = yield getHostConnector();
1146
- return api.gotoAssetHome(assetId, irisAppId, extensionId);
1147
- })
1148
- };
1149
-
1150
- var objectDefineProperties = {};
1151
-
1152
- var DESCRIPTORS$1 = descriptors;
1153
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1154
- var definePropertyModule = objectDefineProperty;
1155
- var anObject$2 = anObject$5;
1156
- var toIndexedObject$1 = toIndexedObject$5;
1157
- var objectKeys = objectKeys$2;
1158
-
1159
- // `Object.defineProperties` method
1160
- // https://tc39.es/ecma262/#sec-object.defineproperties
1161
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1162
- objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1163
- anObject$2(O);
1164
- var props = toIndexedObject$1(Properties);
1165
- var keys = objectKeys(Properties);
1166
- var length = keys.length;
1167
- var index = 0;
1168
- var key;
1169
- while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1170
- return O;
1171
- };
1172
-
1173
- var getBuiltIn = getBuiltIn$4;
1174
-
1175
- var html$1 = getBuiltIn('document', 'documentElement');
1176
-
1177
- /* global ActiveXObject -- old IE, WSH */
1178
-
1179
- var anObject$1 = anObject$5;
1180
- var definePropertiesModule = objectDefineProperties;
1181
- var enumBugKeys = enumBugKeys$3;
1182
- var hiddenKeys = hiddenKeys$4;
1183
- var html = html$1;
1184
- var documentCreateElement$1 = documentCreateElement$2;
1185
- var sharedKey$1 = sharedKey$3;
1186
-
1187
- var GT = '>';
1188
- var LT = '<';
1189
- var PROTOTYPE = 'prototype';
1190
- var SCRIPT = 'script';
1191
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1192
-
1193
- var EmptyConstructor = function () { /* empty */ };
1194
-
1195
- var scriptTag = function (content) {
1196
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1197
- };
1198
-
1199
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1200
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1201
- activeXDocument.write(scriptTag(''));
1202
- activeXDocument.close();
1203
- var temp = activeXDocument.parentWindow.Object;
1204
- activeXDocument = null; // avoid memory leak
1205
- return temp;
1206
- };
1207
-
1208
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1209
- var NullProtoObjectViaIFrame = function () {
1210
- // Thrash, waste and sodomy: IE GC bug
1211
- var iframe = documentCreateElement$1('iframe');
1212
- var JS = 'java' + SCRIPT + ':';
1213
- var iframeDocument;
1214
- iframe.style.display = 'none';
1215
- html.appendChild(iframe);
1216
- // https://github.com/zloirock/core-js/issues/475
1217
- iframe.src = String(JS);
1218
- iframeDocument = iframe.contentWindow.document;
1219
- iframeDocument.open();
1220
- iframeDocument.write(scriptTag('document.F=Object'));
1221
- iframeDocument.close();
1222
- return iframeDocument.F;
1223
- };
1224
-
1225
- // Check for document.domain and active x support
1226
- // No need to use active x approach when document.domain is not set
1227
- // see https://github.com/es-shims/es5-shim/issues/150
1228
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1229
- // avoid IE GC bug
1230
- var activeXDocument;
1231
- var NullProtoObject = function () {
1232
- try {
1233
- activeXDocument = new ActiveXObject('htmlfile');
1234
- } catch (error) { /* ignore */ }
1235
- NullProtoObject = typeof document != 'undefined'
1236
- ? document.domain && activeXDocument
1237
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1238
- : NullProtoObjectViaIFrame()
1239
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1240
- var length = enumBugKeys.length;
1241
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1242
- return NullProtoObject();
1243
- };
1244
-
1245
- hiddenKeys[IE_PROTO$1] = true;
1246
-
1247
- // `Object.create` method
1248
- // https://tc39.es/ecma262/#sec-object.create
1249
- // eslint-disable-next-line es/no-object-create -- safe
1250
- var objectCreate = Object.create || function create(O, Properties) {
1251
- var result;
1252
- if (O !== null) {
1253
- EmptyConstructor[PROTOTYPE] = anObject$1(O);
1254
- result = new EmptyConstructor();
1255
- EmptyConstructor[PROTOTYPE] = null;
1256
- // add "__proto__" for Object.getPrototypeOf polyfill
1257
- result[IE_PROTO$1] = O;
1258
- } else result = NullProtoObject();
1259
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1260
- };
1261
-
1262
- var wellKnownSymbol$6 = wellKnownSymbol$8;
1263
- var create$1 = objectCreate;
1264
- var defineProperty$2 = objectDefineProperty.f;
1265
-
1266
- var UNSCOPABLES = wellKnownSymbol$6('unscopables');
1267
- var ArrayPrototype = Array.prototype;
1268
-
1269
- // Array.prototype[@@unscopables]
1270
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1271
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
1272
- defineProperty$2(ArrayPrototype, UNSCOPABLES, {
1273
- configurable: true,
1274
- value: create$1(null)
1275
- });
1276
- }
1277
-
1278
- // add a key to Array.prototype[@@unscopables]
1279
- var addToUnscopables$1 = function (key) {
1280
- ArrayPrototype[UNSCOPABLES][key] = true;
1281
- };
1282
-
1283
- var iterators = {};
1284
-
1285
- var fails$4 = fails$e;
1286
-
1287
- var correctPrototypeGetter = !fails$4(function () {
1288
- function F() { /* empty */ }
1289
- F.prototype.constructor = null;
1290
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1291
- return Object.getPrototypeOf(new F()) !== F.prototype;
1292
- });
1293
-
1294
- var hasOwn$1 = hasOwnProperty_1;
1295
- var isCallable$4 = isCallable$f;
1296
- var toObject = toObject$3;
1297
- var sharedKey = sharedKey$3;
1298
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1299
-
1300
- var IE_PROTO = sharedKey('IE_PROTO');
1301
- var $Object$1 = Object;
1302
- var ObjectPrototype = $Object$1.prototype;
1303
-
1304
- // `Object.getPrototypeOf` method
1305
- // https://tc39.es/ecma262/#sec-object.getprototypeof
1306
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
1307
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1308
- var object = toObject(O);
1309
- if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
1310
- var constructor = object.constructor;
1311
- if (isCallable$4(constructor) && object instanceof constructor) {
1312
- return constructor.prototype;
1313
- } return object instanceof $Object$1 ? ObjectPrototype : null;
1314
- };
1315
-
1316
- var fails$3 = fails$e;
1317
- var isCallable$3 = isCallable$f;
1318
- var isObject = isObject$6;
1319
- var getPrototypeOf$1 = objectGetPrototypeOf;
1320
- var defineBuiltIn$1 = defineBuiltIn$3;
1321
- var wellKnownSymbol$5 = wellKnownSymbol$8;
1322
-
1323
- var ITERATOR$4 = wellKnownSymbol$5('iterator');
1324
- var BUGGY_SAFARI_ITERATORS$1 = false;
1325
-
1326
- // `%IteratorPrototype%` object
1327
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1328
- var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1329
-
1330
- /* eslint-disable es/no-array-prototype-keys -- safe */
1331
- if ([].keys) {
1332
- arrayIterator = [].keys();
1333
- // Safari 8 has buggy iterators w/o `next`
1334
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1335
- else {
1336
- PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1337
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1338
- }
1339
- }
1340
-
1341
- var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$3(function () {
1342
- var test = {};
1343
- // FF44- legacy iterators case
1344
- return IteratorPrototype$2[ITERATOR$4].call(test) !== test;
1345
- });
1346
-
1347
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1348
-
1349
- // `%IteratorPrototype%[@@iterator]()` method
1350
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1351
- if (!isCallable$3(IteratorPrototype$2[ITERATOR$4])) {
1352
- defineBuiltIn$1(IteratorPrototype$2, ITERATOR$4, function () {
1353
- return this;
1354
- });
1355
- }
1356
-
1357
- var iteratorsCore = {
1358
- IteratorPrototype: IteratorPrototype$2,
1359
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1360
- };
1361
-
1362
- var defineProperty$1 = objectDefineProperty.f;
1363
- var hasOwn = hasOwnProperty_1;
1364
- var wellKnownSymbol$4 = wellKnownSymbol$8;
1365
-
1366
- var TO_STRING_TAG$3 = wellKnownSymbol$4('toStringTag');
1367
-
1368
- var setToStringTag$2 = function (target, TAG, STATIC) {
1369
- if (target && !STATIC) target = target.prototype;
1370
- if (target && !hasOwn(target, TO_STRING_TAG$3)) {
1371
- defineProperty$1(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1372
- }
1373
- };
1374
-
1375
- var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1376
- var create = objectCreate;
1377
- var createPropertyDescriptor = createPropertyDescriptor$3;
1378
- var setToStringTag$1 = setToStringTag$2;
1379
- var Iterators$2 = iterators;
1380
-
1381
- var returnThis$1 = function () { return this; };
1382
-
1383
- var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1384
- var TO_STRING_TAG = NAME + ' Iterator';
1385
- IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1386
- setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
1387
- Iterators$2[TO_STRING_TAG] = returnThis$1;
1388
- return IteratorConstructor;
1389
- };
1390
-
1391
- var isCallable$2 = isCallable$f;
1392
-
1393
- var $String$1 = String;
1394
- var $TypeError = TypeError;
1395
-
1396
- var aPossiblePrototype$1 = function (argument) {
1397
- if (typeof argument == 'object' || isCallable$2(argument)) return argument;
1398
- throw $TypeError("Can't set " + $String$1(argument) + ' as a prototype');
1399
- };
1400
-
1401
- /* eslint-disable no-proto -- safe */
1402
-
1403
- var uncurryThis$3 = functionUncurryThis;
1404
- var anObject = anObject$5;
1405
- var aPossiblePrototype = aPossiblePrototype$1;
1406
-
1407
- // `Object.setPrototypeOf` method
1408
- // https://tc39.es/ecma262/#sec-object.setprototypeof
1409
- // Works with __proto__ only. Old v8 can't work with null proto objects.
1410
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
1411
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1412
- var CORRECT_SETTER = false;
1413
- var test = {};
1414
- var setter;
1415
- try {
1416
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1417
- setter = uncurryThis$3(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1418
- setter(test, []);
1419
- CORRECT_SETTER = test instanceof Array;
1420
- } catch (error) { /* empty */ }
1421
- return function setPrototypeOf(O, proto) {
1422
- anObject(O);
1423
- aPossiblePrototype(proto);
1424
- if (CORRECT_SETTER) setter(O, proto);
1425
- else O.__proto__ = proto;
1426
- return O;
1427
- };
1428
- }() : undefined);
1429
-
1430
- var $$3 = _export;
1431
- var call = functionCall;
1432
- var FunctionName = functionName;
1433
- var isCallable$1 = isCallable$f;
1434
- var createIteratorConstructor = iteratorCreateConstructor;
1435
- var getPrototypeOf = objectGetPrototypeOf;
1436
- var setPrototypeOf = objectSetPrototypeOf;
1437
- var setToStringTag = setToStringTag$2;
1438
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
1439
- var defineBuiltIn = defineBuiltIn$3;
1440
- var wellKnownSymbol$3 = wellKnownSymbol$8;
1441
- var Iterators$1 = iterators;
1442
- var IteratorsCore = iteratorsCore;
1443
-
1444
- var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
1445
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1446
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
1447
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1448
- var ITERATOR$3 = wellKnownSymbol$3('iterator');
1449
- var KEYS = 'keys';
1450
- var VALUES = 'values';
1451
- var ENTRIES = 'entries';
1452
-
1453
- var returnThis = function () { return this; };
1454
-
1455
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1456
- createIteratorConstructor(IteratorConstructor, NAME, next);
1457
-
1458
- var getIterationMethod = function (KIND) {
1459
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1460
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
1461
- switch (KIND) {
1462
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1463
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1464
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1465
- } return function () { return new IteratorConstructor(this); };
1466
- };
1467
-
1468
- var TO_STRING_TAG = NAME + ' Iterator';
1469
- var INCORRECT_VALUES_NAME = false;
1470
- var IterablePrototype = Iterable.prototype;
1471
- var nativeIterator = IterablePrototype[ITERATOR$3]
1472
- || IterablePrototype['@@iterator']
1473
- || DEFAULT && IterablePrototype[DEFAULT];
1474
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1475
- var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1476
- var CurrentIteratorPrototype, methods, KEY;
1477
-
1478
- // fix native
1479
- if (anyNativeIterator) {
1480
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1481
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1482
- if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1483
- if (setPrototypeOf) {
1484
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1485
- } else if (!isCallable$1(CurrentIteratorPrototype[ITERATOR$3])) {
1486
- defineBuiltIn(CurrentIteratorPrototype, ITERATOR$3, returnThis);
1487
- }
1488
- }
1489
- // Set @@toStringTag to native iterators
1490
- setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
1491
- }
1492
- }
1493
-
1494
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1495
- if (PROPER_FUNCTION_NAME$1 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1496
- if (CONFIGURABLE_FUNCTION_NAME) {
1497
- createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
1498
- } else {
1499
- INCORRECT_VALUES_NAME = true;
1500
- defaultIterator = function values() { return call(nativeIterator, this); };
1501
- }
1502
- }
1503
-
1504
- // export additional methods
1505
- if (DEFAULT) {
1506
- methods = {
1507
- values: getIterationMethod(VALUES),
1508
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1509
- entries: getIterationMethod(ENTRIES)
1510
- };
1511
- if (FORCED) for (KEY in methods) {
1512
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1513
- defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
1514
- }
1515
- } else $$3({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1516
- }
1517
-
1518
- // define iterator
1519
- if (IterablePrototype[ITERATOR$3] !== defaultIterator) {
1520
- defineBuiltIn(IterablePrototype, ITERATOR$3, defaultIterator, { name: DEFAULT });
1521
- }
1522
- Iterators$1[NAME] = defaultIterator;
1523
-
1524
- return methods;
1525
- };
1526
-
1527
- // `CreateIterResultObject` abstract operation
1528
- // https://tc39.es/ecma262/#sec-createiterresultobject
1529
- var createIterResultObject$1 = function (value, done) {
1530
- return { value: value, done: done };
1531
- };
1532
-
1533
- var toIndexedObject = toIndexedObject$5;
1534
- var addToUnscopables = addToUnscopables$1;
1535
- var Iterators = iterators;
1536
- var InternalStateModule = internalState;
1537
- var defineProperty = objectDefineProperty.f;
1538
- var defineIterator = iteratorDefine;
1539
- var createIterResultObject = createIterResultObject$1;
1540
- var DESCRIPTORS = descriptors;
1541
-
1542
- var ARRAY_ITERATOR = 'Array Iterator';
1543
- var setInternalState = InternalStateModule.set;
1544
- var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
1545
-
1546
- // `Array.prototype.entries` method
1547
- // https://tc39.es/ecma262/#sec-array.prototype.entries
1548
- // `Array.prototype.keys` method
1549
- // https://tc39.es/ecma262/#sec-array.prototype.keys
1550
- // `Array.prototype.values` method
1551
- // https://tc39.es/ecma262/#sec-array.prototype.values
1552
- // `Array.prototype[@@iterator]` method
1553
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1554
- // `CreateArrayIterator` internal method
1555
- // https://tc39.es/ecma262/#sec-createarrayiterator
1556
- var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1557
- setInternalState(this, {
1558
- type: ARRAY_ITERATOR,
1559
- target: toIndexedObject(iterated), // target
1560
- index: 0, // next index
1561
- kind: kind // kind
1562
- });
1563
- // `%ArrayIteratorPrototype%.next` method
1564
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1565
- }, function () {
1566
- var state = getInternalState(this);
1567
- var target = state.target;
1568
- var kind = state.kind;
1569
- var index = state.index++;
1570
- if (!target || index >= target.length) {
1571
- state.target = undefined;
1572
- return createIterResultObject(undefined, true);
1573
- }
1574
- if (kind == 'keys') return createIterResultObject(index, false);
1575
- if (kind == 'values') return createIterResultObject(target[index], false);
1576
- return createIterResultObject([index, target[index]], false);
1577
- }, 'values');
1578
-
1579
- // argumentsList[@@iterator] is %ArrayProto_values%
1580
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1581
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1582
- var values = Iterators.Arguments = Iterators.Array;
1583
-
1584
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1585
- addToUnscopables('keys');
1586
- addToUnscopables('values');
1587
- addToUnscopables('entries');
1588
-
1589
- // V8 ~ Chrome 45- bug
1590
- if (DESCRIPTORS && values.name !== 'values') try {
1591
- defineProperty(values, 'name', { value: 'values' });
1592
- } catch (error) { /* empty */ }
1593
-
1594
- // iterable DOM collections
1595
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1596
- var domIterables = {
1597
- CSSRuleList: 0,
1598
- CSSStyleDeclaration: 0,
1599
- CSSValueList: 0,
1600
- ClientRectList: 0,
1601
- DOMRectList: 0,
1602
- DOMStringList: 0,
1603
- DOMTokenList: 1,
1604
- DataTransferItemList: 0,
1605
- FileList: 0,
1606
- HTMLAllCollection: 0,
1607
- HTMLCollection: 0,
1608
- HTMLFormElement: 0,
1609
- HTMLSelectElement: 0,
1610
- MediaList: 0,
1611
- MimeTypeArray: 0,
1612
- NamedNodeMap: 0,
1613
- NodeList: 1,
1614
- PaintRequestList: 0,
1615
- Plugin: 0,
1616
- PluginArray: 0,
1617
- SVGLengthList: 0,
1618
- SVGNumberList: 0,
1619
- SVGPathSegList: 0,
1620
- SVGPointList: 0,
1621
- SVGStringList: 0,
1622
- SVGTransformList: 0,
1623
- SourceBufferList: 0,
1624
- StyleSheetList: 0,
1625
- TextTrackCueList: 0,
1626
- TextTrackList: 0,
1627
- TouchList: 0
1628
- };
1629
-
1630
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1631
- var documentCreateElement = documentCreateElement$2;
1632
-
1633
- var classList = documentCreateElement('span').classList;
1634
- var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1635
-
1636
- var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1637
-
1638
- var global$3 = global$d;
1639
- var DOMIterables = domIterables;
1640
- var DOMTokenListPrototype = domTokenListPrototype;
1641
- var ArrayIteratorMethods = es_array_iterator;
1642
- var createNonEnumerableProperty = createNonEnumerableProperty$4;
1643
- var wellKnownSymbol$2 = wellKnownSymbol$8;
1644
-
1645
- var ITERATOR$2 = wellKnownSymbol$2('iterator');
1646
- var TO_STRING_TAG$2 = wellKnownSymbol$2('toStringTag');
1647
- var ArrayValues = ArrayIteratorMethods.values;
1648
-
1649
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1650
- if (CollectionPrototype) {
1651
- // some Chrome versions have non-configurable methods on DOMTokenList
1652
- if (CollectionPrototype[ITERATOR$2] !== ArrayValues) try {
1653
- createNonEnumerableProperty(CollectionPrototype, ITERATOR$2, ArrayValues);
1654
- } catch (error) {
1655
- CollectionPrototype[ITERATOR$2] = ArrayValues;
1656
- }
1657
- if (!CollectionPrototype[TO_STRING_TAG$2]) {
1658
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
1659
- }
1660
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1661
- // some Chrome versions have non-configurable methods on DOMTokenList
1662
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1663
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1664
- } catch (error) {
1665
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1666
- }
1667
- }
1668
- }
1669
- };
1670
-
1671
- for (var COLLECTION_NAME in DOMIterables) {
1672
- handlePrototype(global$3[COLLECTION_NAME] && global$3[COLLECTION_NAME].prototype, COLLECTION_NAME);
1673
- }
1674
-
1675
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1676
-
1677
- const AssetSortingRuntime = {
1678
- getAssetSortingState: () => __awaiter(void 0, void 0, void 0, function* () {
1679
- const api = yield getHostConnector();
1680
- return api.getAssetSortingState();
1681
- }),
1682
- setAssetSortingState: (...args) => __awaiter(void 0, void 0, void 0, function* () {
1683
- const api = yield getHostConnector();
1684
- return api.setAssetSortingState(...args);
1685
- })
1686
- };
1687
-
1688
- const CurrentUserRuntime = {
1689
- getCurrentUserContext: () => __awaiter(void 0, void 0, void 0, function* () {
1690
- const api = yield getHostConnector();
1691
- return api.getCurrentUserContext();
1692
- }),
1693
- getCurrentUserRole: userIds => __awaiter(void 0, void 0, void 0, function* () {
1694
- const api = yield getHostConnector();
1695
- return api.getCurrentUserRole(userIds);
1696
- })
1697
- };
1698
-
1699
- var wellKnownSymbol$1 = wellKnownSymbol$8;
1700
-
1701
- var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
1702
- var test = {};
1703
-
1704
- test[TO_STRING_TAG$1] = 'z';
1705
-
1706
- var toStringTagSupport = String(test) === '[object z]';
1707
-
1708
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1709
- var isCallable = isCallable$f;
1710
- var classofRaw = classofRaw$1;
1711
- var wellKnownSymbol = wellKnownSymbol$8;
1712
-
1713
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1714
- var $Object = Object;
1715
-
1716
- // ES3 wrong here
1717
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1718
-
1719
- // fallback for IE11 Script Access Denied error
1720
- var tryGet = function (it, key) {
1721
- try {
1722
- return it[key];
1723
- } catch (error) { /* empty */ }
1724
- };
1725
-
1726
- // getting tag from ES6+ `Object.prototype.toString`
1727
- var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1728
- var O, tag, result;
1729
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1730
- // @@toStringTag case
1731
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1732
- // builtinTag case
1733
- : CORRECT_ARGUMENTS ? classofRaw(O)
1734
- // ES3 arguments fallback
1735
- : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
1736
- };
1737
-
1738
- var classof = classof$1;
1739
-
1740
- var $String = String;
1741
-
1742
- var toString$3 = function (argument) {
1743
- if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1744
- return $String(argument);
1745
- };
1746
-
1747
- // a string of all valid unicode whitespaces
1748
- var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1749
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1750
-
1751
- var uncurryThis$2 = functionUncurryThis;
1752
- var requireObjectCoercible = requireObjectCoercible$3;
1753
- var toString$2 = toString$3;
1754
- var whitespaces$3 = whitespaces$4;
1755
-
1756
- var replace = uncurryThis$2(''.replace);
1757
- var whitespace = '[' + whitespaces$3 + ']';
1758
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
1759
- var rtrim = RegExp(whitespace + whitespace + '*$');
1760
-
1761
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1762
- var createMethod = function (TYPE) {
1763
- return function ($this) {
1764
- var string = toString$2(requireObjectCoercible($this));
1765
- if (TYPE & 1) string = replace(string, ltrim, '');
1766
- if (TYPE & 2) string = replace(string, rtrim, '');
1767
- return string;
1768
- };
1769
- };
1770
-
1771
- var stringTrim = {
1772
- // `String.prototype.{ trimLeft, trimStart }` methods
1773
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1774
- start: createMethod(1),
1775
- // `String.prototype.{ trimRight, trimEnd }` methods
1776
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
1777
- end: createMethod(2),
1778
- // `String.prototype.trim` method
1779
- // https://tc39.es/ecma262/#sec-string.prototype.trim
1780
- trim: createMethod(3)
1781
- };
1782
-
1783
- var global$2 = global$d;
1784
- var fails$2 = fails$e;
1785
- var uncurryThis$1 = functionUncurryThis;
1786
- var toString$1 = toString$3;
1787
- var trim$1 = stringTrim.trim;
1788
- var whitespaces$2 = whitespaces$4;
1789
-
1790
- var $parseInt$1 = global$2.parseInt;
1791
- var Symbol$2 = global$2.Symbol;
1792
- var ITERATOR$1 = Symbol$2 && Symbol$2.iterator;
1793
- var hex = /^[+-]?0x/i;
1794
- var exec = uncurryThis$1(hex.exec);
1795
- var FORCED$1 = $parseInt$1(whitespaces$2 + '08') !== 8 || $parseInt$1(whitespaces$2 + '0x16') !== 22
1796
- // MS Edge 18- broken with boxed symbols
1797
- || (ITERATOR$1 && !fails$2(function () { $parseInt$1(Object(ITERATOR$1)); }));
1798
-
1799
- // `parseInt` method
1800
- // https://tc39.es/ecma262/#sec-parseint-string-radix
1801
- var numberParseInt = FORCED$1 ? function parseInt(string, radix) {
1802
- var S = trim$1(toString$1(string));
1803
- return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
1804
- } : $parseInt$1;
1805
-
1806
- var $$2 = _export;
1807
- var $parseInt = numberParseInt;
1808
-
1809
- // `parseInt` method
1810
- // https://tc39.es/ecma262/#sec-parseint-string-radix
1811
- $$2({ global: true, forced: parseInt != $parseInt }, {
1812
- parseInt: $parseInt
1813
- });
1814
-
1815
- var global$1 = global$d;
1816
- var fails$1 = fails$e;
1817
- var uncurryThis = functionUncurryThis;
1818
- var toString = toString$3;
1819
- var trim = stringTrim.trim;
1820
- var whitespaces$1 = whitespaces$4;
1821
-
1822
- var charAt = uncurryThis(''.charAt);
1823
- var $parseFloat$1 = global$1.parseFloat;
1824
- var Symbol$1 = global$1.Symbol;
1825
- var ITERATOR = Symbol$1 && Symbol$1.iterator;
1826
- var FORCED = 1 / $parseFloat$1(whitespaces$1 + '-0') !== -Infinity
1827
- // MS Edge 18- broken with boxed symbols
1828
- || (ITERATOR && !fails$1(function () { $parseFloat$1(Object(ITERATOR)); }));
1829
-
1830
- // `parseFloat` method
1831
- // https://tc39.es/ecma262/#sec-parsefloat-string
1832
- var numberParseFloat = FORCED ? function parseFloat(string) {
1833
- var trimmedString = trim(toString(string));
1834
- var result = $parseFloat$1(trimmedString);
1835
- return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;
1836
- } : $parseFloat$1;
1837
-
1838
- var $$1 = _export;
1839
- var $parseFloat = numberParseFloat;
1840
-
1841
- // `parseFloat` method
1842
- // https://tc39.es/ecma262/#sec-parsefloat-string
1843
- $$1({ global: true, forced: parseFloat != $parseFloat }, {
1844
- parseFloat: $parseFloat
1845
- });
1846
-
1847
- var PROPER_FUNCTION_NAME = functionName.PROPER;
1848
- var fails = fails$e;
1849
- var whitespaces = whitespaces$4;
1850
-
1851
- var non = '\u200B\u0085\u180E';
1852
-
1853
- // check that a method works with the correct list
1854
- // of whitespaces and has a correct name
1855
- var stringTrimForced = function (METHOD_NAME) {
1856
- return fails(function () {
1857
- return !!whitespaces[METHOD_NAME]()
1858
- || non[METHOD_NAME]() !== non
1859
- || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
1860
- });
1861
- };
1862
-
1863
- var $ = _export;
1864
- var $trim = stringTrim.trim;
1865
- var forcedStringTrimMethod = stringTrimForced;
1866
-
1867
- // `String.prototype.trim` method
1868
- // https://tc39.es/ecma262/#sec-string.prototype.trim
1869
- $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1870
- trim: function trim() {
1871
- return $trim(this);
1872
- }
1873
- });
1874
-
1875
- const getCustomFieldValueFromRawValue = (customFieldDefinition, newValue) => {
1876
- if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.BOOLEAN) {
1877
- return {
1878
- booleanValue: newValue ? true : false,
1879
- type: irisAppRuntimeCoreApi.CustomFieldType.BOOLEAN
1880
- };
1881
- } else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.DATE) {
1882
- return {
1883
- dateValue: getStringValue(newValue),
1884
- type: irisAppRuntimeCoreApi.CustomFieldType.DATE
1885
- };
1886
- } else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.DROPDOWN) {
1887
- const stringArrayValue = [];
1888
- if (Array.isArray(newValue)) {
1889
- newValue.forEach(item => {
1890
- if (typeof item === "string") {
1891
- stringArrayValue.push(item);
1892
- } else {
1893
- stringArrayValue.push(item === null || item === void 0 ? void 0 : item.value);
1894
- }
1895
- });
1896
- } else {
1897
- if (typeof newValue === "string") {
1898
- stringArrayValue.push(newValue);
1899
- } else if (typeof newValue === "object") {
1900
- stringArrayValue.push(newValue === null || newValue === void 0 ? void 0 : newValue.value);
1901
- }
1902
- }
1903
- return {
1904
- stringArrayValue: stringArrayValue,
1905
- type: irisAppRuntimeCoreApi.CustomFieldType.DROPDOWN
1906
- };
1907
- } else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.EMAIL) {
1908
- return {
1909
- stringValue: getStringValue(newValue),
1910
- type: irisAppRuntimeCoreApi.CustomFieldType.EMAIL
1911
- };
1912
- } else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.NUMBER) {
1913
- let value = customFieldDefinition.isInteger ? parseInt(newValue) : parseFloat(newValue);
1914
- if (isNaN(value)) {
1915
- value = null;
1916
- }
1917
- return {
1918
- numberValue: value,
1919
- type: irisAppRuntimeCoreApi.CustomFieldType.NUMBER
1920
- };
1921
- } else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.PHONE_NUMBER) {
1922
- return {
1923
- stringValue: getStringValue(newValue),
1924
- type: irisAppRuntimeCoreApi.CustomFieldType.PHONE_NUMBER
1925
- };
1926
- } else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.STRING) {
1927
- return {
1928
- stringValue: getStringValue(newValue),
1929
- type: irisAppRuntimeCoreApi.CustomFieldType.STRING
1930
- };
1931
- } else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.WEB_ADDRESS) {
1932
- return {
1933
- stringValue: getStringValue(newValue),
1934
- type: irisAppRuntimeCoreApi.CustomFieldType.WEB_ADDRESS
1935
- };
1936
- }
1937
- throw new Error("Unsupported custom field type");
1938
- };
1939
- const getStringValue = value => {
1940
- const stringValue = value;
1941
- if (!isNaN(new Date(stringValue).getDate())) {
1942
- return new Date(stringValue).toISOString();
1943
- } else if (stringValue === null || stringValue === undefined) {
1944
- return null;
1945
- } else if (stringValue.trim().length === 0) {
1946
- return null;
1947
- } else {
1948
- return stringValue.trim();
1949
- }
1950
- };
1951
- const CustomFieldRuntime = {
1952
- getCustomFieldsFor: entity => __awaiter(void 0, void 0, void 0, function* () {
1953
- const api = yield getHostConnector();
1954
- return api.getCustomFieldsFor(entity);
1955
- }),
1956
- setCustomFieldsFor: (entity, values) => __awaiter(void 0, void 0, void 0, function* () {
1957
- const api = yield getHostConnector();
1958
- return api.setCustomFieldsFor(entity, values);
1959
- }),
1960
- setCustomFieldsFromFormData: (entity, formData, originalDefinitions) => __awaiter(void 0, void 0, void 0, function* () {
1961
- const api = yield getHostConnector();
1962
- const values = [];
1963
- Object.keys(formData).forEach(key => {
1964
- var _a;
1965
- const found = (_a = originalDefinitions.find(originalDefinition => originalDefinition.definition.key === key)) === null || _a === void 0 ? void 0 : _a.definition;
1966
- if (found) {
1967
- values.push({
1968
- definitionKey: key,
1969
- value: getCustomFieldValueFromRawValue(found, formData[key])
1970
- });
1971
- } else {
1972
- throw new Error("Unsupported custom field type: " + key);
1973
- }
1974
- });
1975
- return api.setCustomFieldsFor(entity, values);
1976
- })
1977
- };
1978
-
1979
- const DeveloperSettingsRuntime = {
1980
- getDeveloperSettingsContext: () => __awaiter(void 0, void 0, void 0, function* () {
1981
- const api = yield getHostConnector();
1982
- return api.getDeveloperSettingsContext();
1983
- })
1984
- };
1985
-
1986
- const EnvironmentRuntime = {
1987
- getEnvironmentContext: () => __awaiter(void 0, void 0, void 0, function* () {
1988
- const api = yield getHostConnector();
1989
- return api.getEnvironmentContext();
1990
- })
1991
- };
1992
-
1993
- const GlobalSelectionRuntime = {
1994
- getGlobalSelection: () => __awaiter(void 0, void 0, void 0, function* () {
1995
- const api = yield getHostConnector();
1996
- return api.getGlobalSelectionContext();
1997
- })
1998
- };
1999
-
2000
- const NavigationRuntime = {
2001
- setDeepLink: props => __awaiter(void 0, void 0, void 0, function* () {
2002
- const api = yield getHostConnector();
2003
- return api.setDeepLink(props);
2004
- })
2005
- };
2006
-
2007
- const ParamsRuntime = {
2008
- getAppName: () => __awaiter(void 0, void 0, void 0, function* () {
2009
- const api = yield getHostConnector();
2010
- return api.getAppName();
2011
- }),
2012
- getOrgName: () => __awaiter(void 0, void 0, void 0, function* () {
2013
- const api = yield getHostConnector();
2014
- return api.getOrgName();
2015
- }),
2016
- getExtensionName: () => __awaiter(void 0, void 0, void 0, function* () {
2017
- const api = yield getHostConnector();
2018
- return api.getExtensionName();
2019
- })
2020
- };
2021
-
2022
- const RestRuntime = {
2023
- apiHost: "https://API_HOST",
2024
- request(path, method, requestParams, body, bodyType, secureByDefault) {
2025
- return __awaiter(this, void 0, void 0, function* () {
2026
- const api = yield getHostConnector();
2027
- return api.requestTrackunitRestApi(path, method, requestParams, body, bodyType, secureByDefault);
2028
- });
2029
- }
2030
- };
2031
-
2032
- const ToastRuntime = {
2033
- addToast(toast) {
2034
- var _a, _b;
2035
- return __awaiter(this, void 0, void 0, function* () {
2036
- const api = yield getHostConnector();
2037
- return api.addToast(Object.assign(Object.assign({}, toast), {
2038
- primaryAction: (_a = toast.primaryAction) === null || _a === void 0 ? void 0 : _a.label,
2039
- secondaryAction: (_b = toast.secondaryAction) === null || _b === void 0 ? void 0 : _b.label
2040
- })).then(res => {
2041
- var _a, _b, _c, _d;
2042
- switch (res) {
2043
- case "primaryAction":
2044
- (_b = (_a = toast.primaryAction) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
2045
- break;
2046
- case "secondaryAction":
2047
- (_d = (_c = toast.secondaryAction) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.call(_c);
2048
- break;
2049
- }
2050
- });
2051
- });
2052
- }
2053
- };
2054
-
2055
- const TokenRuntime = {
2056
- getTokenContext: () => __awaiter(void 0, void 0, void 0, function* () {
2057
- const api = yield getHostConnector();
2058
- return api.getTokenContext();
2059
- })
2060
- };
2061
-
2062
- const UserSubscriptionRuntime = {
2063
- getUserSubscriptionContext: () => __awaiter(void 0, void 0, void 0, function* () {
2064
- const api = yield getHostConnector();
2065
- return api.getUserSubscriptionContext();
2066
- })
33
+ const setupHostConnector = (subscribedMethods) => {
34
+ const methods = Object.assign({ onGlobalSelectionChanged: () => { }, onTokenChanged: () => { }, onAssetSortingStateChanged: () => { } }, subscribedMethods);
35
+ const connection = penpal.connectToParent({ methods });
36
+ penpal.connectToParent({ methods }).promise.catch(err => {
37
+ // TODO consider how to handle this catch
38
+ // eslint-disable-next-line no-console
39
+ console.log(err);
40
+ });
41
+ return connection;
42
+ };
43
+ const hostConnector = setupHostConnector({});
44
+ const getHostConnector = () => {
45
+ return hostConnector.promise;
46
+ };
47
+
48
+ const AssetRuntime = {
49
+ getAssetInfo: () => __awaiter(void 0, void 0, void 0, function* () {
50
+ const api = yield getHostConnector();
51
+ return api.getAssetInfo();
52
+ }),
53
+ gotoAssetHome: (assetId, irisAppId, extensionId) => __awaiter(void 0, void 0, void 0, function* () {
54
+ const api = yield getHostConnector();
55
+ return api.gotoAssetHome(assetId, irisAppId, extensionId);
56
+ }),
57
+ };
58
+
59
+ const AssetSortingRuntime = {
60
+ getAssetSortingState: () => __awaiter(void 0, void 0, void 0, function* () {
61
+ const api = yield getHostConnector();
62
+ return api.getAssetSortingState();
63
+ }),
64
+ setAssetSortingState: (...args) => __awaiter(void 0, void 0, void 0, function* () {
65
+ const api = yield getHostConnector();
66
+ return api.setAssetSortingState(...args);
67
+ }),
68
+ };
69
+
70
+ const CurrentUserRuntime = {
71
+ getCurrentUserContext: () => __awaiter(void 0, void 0, void 0, function* () {
72
+ const api = yield getHostConnector();
73
+ return api.getCurrentUserContext();
74
+ }),
75
+ getCurrentUserRole: (userIds) => __awaiter(void 0, void 0, void 0, function* () {
76
+ const api = yield getHostConnector();
77
+ return api.getCurrentUserRole(userIds);
78
+ }),
79
+ };
80
+
81
+ const getCustomFieldValueFromRawValue = (customFieldDefinition, newValue) => {
82
+ if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.BOOLEAN) {
83
+ return {
84
+ booleanValue: newValue ? true : false,
85
+ type: irisAppRuntimeCoreApi.CustomFieldType.BOOLEAN,
86
+ };
87
+ }
88
+ else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.DATE) {
89
+ return {
90
+ dateValue: getStringValue(newValue),
91
+ type: irisAppRuntimeCoreApi.CustomFieldType.DATE,
92
+ };
93
+ }
94
+ else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.DROPDOWN) {
95
+ const stringArrayValue = [];
96
+ if (Array.isArray(newValue)) {
97
+ newValue.forEach(item => {
98
+ if (typeof item === "string") {
99
+ stringArrayValue.push(item);
100
+ }
101
+ else {
102
+ stringArrayValue.push(item === null || item === void 0 ? void 0 : item.value);
103
+ }
104
+ });
105
+ }
106
+ else {
107
+ if (typeof newValue === "string") {
108
+ stringArrayValue.push(newValue);
109
+ }
110
+ else if (typeof newValue === "object") {
111
+ stringArrayValue.push(newValue === null || newValue === void 0 ? void 0 : newValue.value);
112
+ }
113
+ }
114
+ return {
115
+ stringArrayValue: stringArrayValue,
116
+ type: irisAppRuntimeCoreApi.CustomFieldType.DROPDOWN,
117
+ };
118
+ }
119
+ else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.EMAIL) {
120
+ return {
121
+ stringValue: getStringValue(newValue),
122
+ type: irisAppRuntimeCoreApi.CustomFieldType.EMAIL,
123
+ };
124
+ }
125
+ else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.NUMBER) {
126
+ let value = customFieldDefinition.isInteger
127
+ ? parseInt(newValue)
128
+ : parseFloat(newValue);
129
+ if (isNaN(value)) {
130
+ value = null;
131
+ }
132
+ return {
133
+ numberValue: value,
134
+ type: irisAppRuntimeCoreApi.CustomFieldType.NUMBER,
135
+ };
136
+ }
137
+ else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.PHONE_NUMBER) {
138
+ return {
139
+ stringValue: getStringValue(newValue),
140
+ type: irisAppRuntimeCoreApi.CustomFieldType.PHONE_NUMBER,
141
+ };
142
+ }
143
+ else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.STRING) {
144
+ return {
145
+ stringValue: getStringValue(newValue),
146
+ type: irisAppRuntimeCoreApi.CustomFieldType.STRING,
147
+ };
148
+ }
149
+ else if (customFieldDefinition.type === irisAppRuntimeCoreApi.CustomFieldType.WEB_ADDRESS) {
150
+ return {
151
+ stringValue: getStringValue(newValue),
152
+ type: irisAppRuntimeCoreApi.CustomFieldType.WEB_ADDRESS,
153
+ };
154
+ }
155
+ throw new Error("Unsupported custom field type");
156
+ };
157
+ const getStringValue = (value) => {
158
+ const stringValue = value;
159
+ if (!isNaN(new Date(stringValue).getDate())) {
160
+ return new Date(stringValue).toISOString();
161
+ }
162
+ else if (stringValue === null || stringValue === undefined) {
163
+ return null;
164
+ }
165
+ else if (stringValue.trim().length === 0) {
166
+ return null;
167
+ }
168
+ else {
169
+ return stringValue.trim();
170
+ }
171
+ };
172
+ const CustomFieldRuntime = {
173
+ getCustomFieldsFor: (entity) => __awaiter(void 0, void 0, void 0, function* () {
174
+ const api = yield getHostConnector();
175
+ return api.getCustomFieldsFor(entity);
176
+ }),
177
+ setCustomFieldsFor: (entity, values) => __awaiter(void 0, void 0, void 0, function* () {
178
+ const api = yield getHostConnector();
179
+ return api.setCustomFieldsFor(entity, values);
180
+ }),
181
+ setCustomFieldsFromFormData: (entity, formData, originalDefinitions) => __awaiter(void 0, void 0, void 0, function* () {
182
+ const api = yield getHostConnector();
183
+ const values = [];
184
+ Object.keys(formData).forEach(key => {
185
+ var _a;
186
+ const found = (_a = originalDefinitions.find(originalDefinition => originalDefinition.definition.key === key)) === null || _a === void 0 ? void 0 : _a.definition;
187
+ if (found) {
188
+ values.push({
189
+ definitionKey: key,
190
+ value: getCustomFieldValueFromRawValue(found, formData[key]),
191
+ });
192
+ }
193
+ else {
194
+ throw new Error("Unsupported custom field type: " + key);
195
+ }
196
+ });
197
+ return api.setCustomFieldsFor(entity, values);
198
+ }),
199
+ };
200
+
201
+ const DeveloperSettingsRuntime = {
202
+ getDeveloperSettingsContext: () => __awaiter(void 0, void 0, void 0, function* () {
203
+ const api = yield getHostConnector();
204
+ return api.getDeveloperSettingsContext();
205
+ }),
206
+ };
207
+
208
+ const EnvironmentRuntime = {
209
+ getEnvironmentContext: () => __awaiter(void 0, void 0, void 0, function* () {
210
+ const api = yield getHostConnector();
211
+ return api.getEnvironmentContext();
212
+ }),
213
+ };
214
+
215
+ const GlobalSelectionRuntime = {
216
+ getGlobalSelection: () => __awaiter(void 0, void 0, void 0, function* () {
217
+ const api = yield getHostConnector();
218
+ return api.getGlobalSelectionContext();
219
+ }),
220
+ };
221
+
222
+ const NavigationRuntime = {
223
+ setDeepLink: (props) => __awaiter(void 0, void 0, void 0, function* () {
224
+ const api = yield getHostConnector();
225
+ return api.setDeepLink(props);
226
+ }),
227
+ };
228
+
229
+ const ParamsRuntime = {
230
+ getAppName: () => __awaiter(void 0, void 0, void 0, function* () {
231
+ const api = yield getHostConnector();
232
+ return api.getAppName();
233
+ }),
234
+ getOrgName: () => __awaiter(void 0, void 0, void 0, function* () {
235
+ const api = yield getHostConnector();
236
+ return api.getOrgName();
237
+ }),
238
+ getExtensionName: () => __awaiter(void 0, void 0, void 0, function* () {
239
+ const api = yield getHostConnector();
240
+ return api.getExtensionName();
241
+ }),
242
+ };
243
+
244
+ const RestRuntime = {
245
+ apiHost: "https://API_HOST",
246
+ request(path, method, requestParams, body, bodyType, secureByDefault) {
247
+ return __awaiter(this, void 0, void 0, function* () {
248
+ const api = yield getHostConnector();
249
+ return api.requestTrackunitRestApi(path, method, requestParams, body, bodyType, secureByDefault);
250
+ });
251
+ },
252
+ };
253
+
254
+ const ToastRuntime = {
255
+ addToast(toast) {
256
+ var _a, _b;
257
+ return __awaiter(this, void 0, void 0, function* () {
258
+ const api = yield getHostConnector();
259
+ return api
260
+ .addToast(Object.assign(Object.assign({}, toast), { primaryAction: (_a = toast.primaryAction) === null || _a === void 0 ? void 0 : _a.label, secondaryAction: (_b = toast.secondaryAction) === null || _b === void 0 ? void 0 : _b.label }))
261
+ .then(res => {
262
+ var _a, _b, _c, _d;
263
+ switch (res) {
264
+ case "primaryAction":
265
+ (_b = (_a = toast.primaryAction) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
266
+ break;
267
+ case "secondaryAction":
268
+ (_d = (_c = toast.secondaryAction) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.call(_c);
269
+ break;
270
+ }
271
+ });
272
+ });
273
+ },
274
+ };
275
+
276
+ const TokenRuntime = {
277
+ getTokenContext: () => __awaiter(void 0, void 0, void 0, function* () {
278
+ const api = yield getHostConnector();
279
+ return api.getTokenContext();
280
+ }),
281
+ };
282
+
283
+ const UserSubscriptionRuntime = {
284
+ getUserSubscriptionContext: () => __awaiter(void 0, void 0, void 0, function* () {
285
+ const api = yield getHostConnector();
286
+ return api.getUserSubscriptionContext();
287
+ }),
2067
288
  };
2068
289
 
2069
290
  exports.AssetRuntime = AssetRuntime;