@openfin/node-adapter 34.78.8 → 34.78.10

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.
@@ -2,17 +2,16 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var require$$0 = require('events');
6
5
  var require$$3 = require('lodash');
7
- var require$$0$2 = require('fs');
6
+ var require$$0$1 = require('fs');
8
7
  var require$$1$1 = require('crypto');
9
8
  var require$$2$1 = require('ws');
10
9
  var require$$1 = require('net');
11
- var require$$0$3 = require('path');
12
- var require$$0$4 = require('os');
10
+ var require$$0$2 = require('path');
11
+ var require$$0$3 = require('os');
13
12
  var require$$4 = require('timers');
14
13
  var require$$2 = require('child_process');
15
- var require$$0$1 = require('node:url');
14
+ var require$$0 = require('node:url');
16
15
 
17
16
  function _mergeNamespaces(n, m) {
18
17
  m.forEach(function (e) {
@@ -31,17 +30,493 @@ function _mergeNamespaces(n, m) {
31
30
 
32
31
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
33
32
 
34
- function getDefaultExportFromCjs (x) {
35
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
36
- }
37
-
38
33
  var main$1 = {};
39
34
 
40
35
  var fin = {};
41
36
 
42
- var system$1 = {};
37
+ var eventsExports = {};
38
+ var events = {
39
+ get exports(){ return eventsExports; },
40
+ set exports(v){ eventsExports = v; },
41
+ };
42
+
43
+ var R = typeof Reflect === 'object' ? Reflect : null;
44
+ var ReflectApply = R && typeof R.apply === 'function'
45
+ ? R.apply
46
+ : function ReflectApply(target, receiver, args) {
47
+ return Function.prototype.apply.call(target, receiver, args);
48
+ };
49
+
50
+ var ReflectOwnKeys;
51
+ if (R && typeof R.ownKeys === 'function') {
52
+ ReflectOwnKeys = R.ownKeys;
53
+ } else if (Object.getOwnPropertySymbols) {
54
+ ReflectOwnKeys = function ReflectOwnKeys(target) {
55
+ return Object.getOwnPropertyNames(target)
56
+ .concat(Object.getOwnPropertySymbols(target));
57
+ };
58
+ } else {
59
+ ReflectOwnKeys = function ReflectOwnKeys(target) {
60
+ return Object.getOwnPropertyNames(target);
61
+ };
62
+ }
63
+
64
+ function ProcessEmitWarning(warning) {
65
+ if (console && console.warn) console.warn(warning);
66
+ }
67
+
68
+ var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
69
+ return value !== value;
70
+ };
71
+
72
+ function EventEmitter() {
73
+ EventEmitter.init.call(this);
74
+ }
75
+ events.exports = EventEmitter;
76
+ eventsExports.once = once;
77
+
78
+ // Backwards-compat with node 0.10.x
79
+ EventEmitter.EventEmitter = EventEmitter;
80
+
81
+ EventEmitter.prototype._events = undefined;
82
+ EventEmitter.prototype._eventsCount = 0;
83
+ EventEmitter.prototype._maxListeners = undefined;
84
+
85
+ // By default EventEmitters will print a warning if more than 10 listeners are
86
+ // added to it. This is a useful default which helps finding memory leaks.
87
+ var defaultMaxListeners = 10;
88
+
89
+ function checkListener(listener) {
90
+ if (typeof listener !== 'function') {
91
+ throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
92
+ }
93
+ }
94
+
95
+ Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
96
+ enumerable: true,
97
+ get: function() {
98
+ return defaultMaxListeners;
99
+ },
100
+ set: function(arg) {
101
+ if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
102
+ throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
103
+ }
104
+ defaultMaxListeners = arg;
105
+ }
106
+ });
107
+
108
+ EventEmitter.init = function() {
109
+
110
+ if (this._events === undefined ||
111
+ this._events === Object.getPrototypeOf(this)._events) {
112
+ this._events = Object.create(null);
113
+ this._eventsCount = 0;
114
+ }
115
+
116
+ this._maxListeners = this._maxListeners || undefined;
117
+ };
118
+
119
+ // Obviously not all Emitters should be limited to 10. This function allows
120
+ // that to be increased. Set to zero for unlimited.
121
+ EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
122
+ if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
123
+ throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
124
+ }
125
+ this._maxListeners = n;
126
+ return this;
127
+ };
128
+
129
+ function _getMaxListeners(that) {
130
+ if (that._maxListeners === undefined)
131
+ return EventEmitter.defaultMaxListeners;
132
+ return that._maxListeners;
133
+ }
134
+
135
+ EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
136
+ return _getMaxListeners(this);
137
+ };
138
+
139
+ EventEmitter.prototype.emit = function emit(type) {
140
+ var args = [];
141
+ for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
142
+ var doError = (type === 'error');
143
+
144
+ var events = this._events;
145
+ if (events !== undefined)
146
+ doError = (doError && events.error === undefined);
147
+ else if (!doError)
148
+ return false;
149
+
150
+ // If there is no 'error' event listener then throw.
151
+ if (doError) {
152
+ var er;
153
+ if (args.length > 0)
154
+ er = args[0];
155
+ if (er instanceof Error) {
156
+ // Note: The comments on the `throw` lines are intentional, they show
157
+ // up in Node's output if this results in an unhandled exception.
158
+ throw er; // Unhandled 'error' event
159
+ }
160
+ // At least give some kind of context to the user
161
+ var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
162
+ err.context = er;
163
+ throw err; // Unhandled 'error' event
164
+ }
165
+
166
+ var handler = events[type];
167
+
168
+ if (handler === undefined)
169
+ return false;
170
+
171
+ if (typeof handler === 'function') {
172
+ ReflectApply(handler, this, args);
173
+ } else {
174
+ var len = handler.length;
175
+ var listeners = arrayClone(handler, len);
176
+ for (var i = 0; i < len; ++i)
177
+ ReflectApply(listeners[i], this, args);
178
+ }
179
+
180
+ return true;
181
+ };
182
+
183
+ function _addListener(target, type, listener, prepend) {
184
+ var m;
185
+ var events;
186
+ var existing;
187
+
188
+ checkListener(listener);
189
+
190
+ events = target._events;
191
+ if (events === undefined) {
192
+ events = target._events = Object.create(null);
193
+ target._eventsCount = 0;
194
+ } else {
195
+ // To avoid recursion in the case that type === "newListener"! Before
196
+ // adding it to the listeners, first emit "newListener".
197
+ if (events.newListener !== undefined) {
198
+ target.emit('newListener', type,
199
+ listener.listener ? listener.listener : listener);
200
+
201
+ // Re-assign `events` because a newListener handler could have caused the
202
+ // this._events to be assigned to a new object
203
+ events = target._events;
204
+ }
205
+ existing = events[type];
206
+ }
207
+
208
+ if (existing === undefined) {
209
+ // Optimize the case of one listener. Don't need the extra array object.
210
+ existing = events[type] = listener;
211
+ ++target._eventsCount;
212
+ } else {
213
+ if (typeof existing === 'function') {
214
+ // Adding the second element, need to change to array.
215
+ existing = events[type] =
216
+ prepend ? [listener, existing] : [existing, listener];
217
+ // If we've already got an array, just append.
218
+ } else if (prepend) {
219
+ existing.unshift(listener);
220
+ } else {
221
+ existing.push(listener);
222
+ }
223
+
224
+ // Check for listener leak
225
+ m = _getMaxListeners(target);
226
+ if (m > 0 && existing.length > m && !existing.warned) {
227
+ existing.warned = true;
228
+ // No error code for this since it is a Warning
229
+ // eslint-disable-next-line no-restricted-syntax
230
+ var w = new Error('Possible EventEmitter memory leak detected. ' +
231
+ existing.length + ' ' + String(type) + ' listeners ' +
232
+ 'added. Use emitter.setMaxListeners() to ' +
233
+ 'increase limit');
234
+ w.name = 'MaxListenersExceededWarning';
235
+ w.emitter = target;
236
+ w.type = type;
237
+ w.count = existing.length;
238
+ ProcessEmitWarning(w);
239
+ }
240
+ }
241
+
242
+ return target;
243
+ }
244
+
245
+ EventEmitter.prototype.addListener = function addListener(type, listener) {
246
+ return _addListener(this, type, listener, false);
247
+ };
248
+
249
+ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
250
+
251
+ EventEmitter.prototype.prependListener =
252
+ function prependListener(type, listener) {
253
+ return _addListener(this, type, listener, true);
254
+ };
255
+
256
+ function onceWrapper() {
257
+ if (!this.fired) {
258
+ this.target.removeListener(this.type, this.wrapFn);
259
+ this.fired = true;
260
+ if (arguments.length === 0)
261
+ return this.listener.call(this.target);
262
+ return this.listener.apply(this.target, arguments);
263
+ }
264
+ }
265
+
266
+ function _onceWrap(target, type, listener) {
267
+ var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
268
+ var wrapped = onceWrapper.bind(state);
269
+ wrapped.listener = listener;
270
+ state.wrapFn = wrapped;
271
+ return wrapped;
272
+ }
273
+
274
+ EventEmitter.prototype.once = function once(type, listener) {
275
+ checkListener(listener);
276
+ this.on(type, _onceWrap(this, type, listener));
277
+ return this;
278
+ };
279
+
280
+ EventEmitter.prototype.prependOnceListener =
281
+ function prependOnceListener(type, listener) {
282
+ checkListener(listener);
283
+ this.prependListener(type, _onceWrap(this, type, listener));
284
+ return this;
285
+ };
286
+
287
+ // Emits a 'removeListener' event if and only if the listener was removed.
288
+ EventEmitter.prototype.removeListener =
289
+ function removeListener(type, listener) {
290
+ var list, events, position, i, originalListener;
291
+
292
+ checkListener(listener);
293
+
294
+ events = this._events;
295
+ if (events === undefined)
296
+ return this;
297
+
298
+ list = events[type];
299
+ if (list === undefined)
300
+ return this;
301
+
302
+ if (list === listener || list.listener === listener) {
303
+ if (--this._eventsCount === 0)
304
+ this._events = Object.create(null);
305
+ else {
306
+ delete events[type];
307
+ if (events.removeListener)
308
+ this.emit('removeListener', type, list.listener || listener);
309
+ }
310
+ } else if (typeof list !== 'function') {
311
+ position = -1;
312
+
313
+ for (i = list.length - 1; i >= 0; i--) {
314
+ if (list[i] === listener || list[i].listener === listener) {
315
+ originalListener = list[i].listener;
316
+ position = i;
317
+ break;
318
+ }
319
+ }
320
+
321
+ if (position < 0)
322
+ return this;
323
+
324
+ if (position === 0)
325
+ list.shift();
326
+ else {
327
+ spliceOne(list, position);
328
+ }
329
+
330
+ if (list.length === 1)
331
+ events[type] = list[0];
332
+
333
+ if (events.removeListener !== undefined)
334
+ this.emit('removeListener', type, originalListener || listener);
335
+ }
336
+
337
+ return this;
338
+ };
339
+
340
+ EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
341
+
342
+ EventEmitter.prototype.removeAllListeners =
343
+ function removeAllListeners(type) {
344
+ var listeners, events, i;
345
+
346
+ events = this._events;
347
+ if (events === undefined)
348
+ return this;
349
+
350
+ // not listening for removeListener, no need to emit
351
+ if (events.removeListener === undefined) {
352
+ if (arguments.length === 0) {
353
+ this._events = Object.create(null);
354
+ this._eventsCount = 0;
355
+ } else if (events[type] !== undefined) {
356
+ if (--this._eventsCount === 0)
357
+ this._events = Object.create(null);
358
+ else
359
+ delete events[type];
360
+ }
361
+ return this;
362
+ }
363
+
364
+ // emit removeListener for all listeners on all events
365
+ if (arguments.length === 0) {
366
+ var keys = Object.keys(events);
367
+ var key;
368
+ for (i = 0; i < keys.length; ++i) {
369
+ key = keys[i];
370
+ if (key === 'removeListener') continue;
371
+ this.removeAllListeners(key);
372
+ }
373
+ this.removeAllListeners('removeListener');
374
+ this._events = Object.create(null);
375
+ this._eventsCount = 0;
376
+ return this;
377
+ }
378
+
379
+ listeners = events[type];
380
+
381
+ if (typeof listeners === 'function') {
382
+ this.removeListener(type, listeners);
383
+ } else if (listeners !== undefined) {
384
+ // LIFO order
385
+ for (i = listeners.length - 1; i >= 0; i--) {
386
+ this.removeListener(type, listeners[i]);
387
+ }
388
+ }
389
+
390
+ return this;
391
+ };
392
+
393
+ function _listeners(target, type, unwrap) {
394
+ var events = target._events;
395
+
396
+ if (events === undefined)
397
+ return [];
398
+
399
+ var evlistener = events[type];
400
+ if (evlistener === undefined)
401
+ return [];
402
+
403
+ if (typeof evlistener === 'function')
404
+ return unwrap ? [evlistener.listener || evlistener] : [evlistener];
405
+
406
+ return unwrap ?
407
+ unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
408
+ }
409
+
410
+ EventEmitter.prototype.listeners = function listeners(type) {
411
+ return _listeners(this, type, true);
412
+ };
413
+
414
+ EventEmitter.prototype.rawListeners = function rawListeners(type) {
415
+ return _listeners(this, type, false);
416
+ };
417
+
418
+ EventEmitter.listenerCount = function(emitter, type) {
419
+ if (typeof emitter.listenerCount === 'function') {
420
+ return emitter.listenerCount(type);
421
+ } else {
422
+ return listenerCount.call(emitter, type);
423
+ }
424
+ };
425
+
426
+ EventEmitter.prototype.listenerCount = listenerCount;
427
+ function listenerCount(type) {
428
+ var events = this._events;
429
+
430
+ if (events !== undefined) {
431
+ var evlistener = events[type];
432
+
433
+ if (typeof evlistener === 'function') {
434
+ return 1;
435
+ } else if (evlistener !== undefined) {
436
+ return evlistener.length;
437
+ }
438
+ }
439
+
440
+ return 0;
441
+ }
442
+
443
+ EventEmitter.prototype.eventNames = function eventNames() {
444
+ return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
445
+ };
446
+
447
+ function arrayClone(arr, n) {
448
+ var copy = new Array(n);
449
+ for (var i = 0; i < n; ++i)
450
+ copy[i] = arr[i];
451
+ return copy;
452
+ }
453
+
454
+ function spliceOne(list, index) {
455
+ for (; index + 1 < list.length; index++)
456
+ list[index] = list[index + 1];
457
+ list.pop();
458
+ }
459
+
460
+ function unwrapListeners(arr) {
461
+ var ret = new Array(arr.length);
462
+ for (var i = 0; i < ret.length; ++i) {
463
+ ret[i] = arr[i].listener || arr[i];
464
+ }
465
+ return ret;
466
+ }
467
+
468
+ function once(emitter, name) {
469
+ return new Promise(function (resolve, reject) {
470
+ function errorListener(err) {
471
+ emitter.removeListener(name, resolver);
472
+ reject(err);
473
+ }
474
+
475
+ function resolver() {
476
+ if (typeof emitter.removeListener === 'function') {
477
+ emitter.removeListener('error', errorListener);
478
+ }
479
+ resolve([].slice.call(arguments));
480
+ }
481
+ eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
482
+ if (name !== 'error') {
483
+ addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
484
+ }
485
+ });
486
+ }
487
+
488
+ function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
489
+ if (typeof emitter.on === 'function') {
490
+ eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
491
+ }
492
+ }
493
+
494
+ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
495
+ if (typeof emitter.on === 'function') {
496
+ if (flags.once) {
497
+ emitter.once(name, listener);
498
+ } else {
499
+ emitter.on(name, listener);
500
+ }
501
+ } else if (typeof emitter.addEventListener === 'function') {
502
+ // EventTarget does not have `error` event semantics like Node
503
+ // EventEmitters, we do not listen for `error` events here.
504
+ emitter.addEventListener(name, function wrapListener(arg) {
505
+ // IE does not have builtin `{ once: true }` support so we
506
+ // have to do it manually.
507
+ if (flags.once) {
508
+ emitter.removeEventListener(name, wrapListener);
509
+ }
510
+ listener(arg);
511
+ });
512
+ } else {
513
+ throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
514
+ }
515
+ }
516
+
517
+ var system = {};
43
518
 
44
- var base$1 = {};
519
+ var base = {};
45
520
 
46
521
  var promises = {};
47
522
 
@@ -84,8 +559,8 @@ var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateF
84
559
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
85
560
  };
86
561
  var _EmitterBase_emitterAccessor;
87
- Object.defineProperty(base$1, "__esModule", { value: true });
88
- base$1.Reply = base$1.EmitterBase = base$1.Base = void 0;
562
+ Object.defineProperty(base, "__esModule", { value: true });
563
+ base.Reply = base.EmitterBase = base.Base = void 0;
89
564
  const promises_1$2 = promises;
90
565
  class Base {
91
566
  /**
@@ -106,18 +581,11 @@ class Base {
106
581
  get fin() {
107
582
  return this.wire.getFin();
108
583
  }
109
- /**
110
- * Provides access to the OpenFin representation of the current code context (usually a document
111
- * such as a {@link OpenFin.View} or {@link OpenFin.Window}), as well as to the current `Interop` context.
112
- *
113
- * Useful for debugging in the devtools console, where this will intelligently type itself based
114
- * on the context in which the devtools panel was opened.
115
- */
116
584
  get me() {
117
585
  return this.wire.me;
118
586
  }
119
587
  }
120
- base$1.Base = Base;
588
+ base.Base = Base;
121
589
  /**
122
590
  * An entity that emits OpenFin events.
123
591
  *
@@ -147,9 +615,6 @@ class EmitterBase extends Base {
147
615
  this.topic = topic;
148
616
  _EmitterBase_emitterAccessor.set(this, void 0);
149
617
  this.eventNames = () => (this.hasEmitter() ? this.getOrCreateEmitter().eventNames() : []);
150
- /**
151
- * @internal
152
- */
153
618
  this.emit = (eventType, payload, ...args) => {
154
619
  return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
155
620
  };
@@ -192,13 +657,16 @@ class EmitterBase extends Base {
192
657
  // This will only be reached if unsubscribe from event that does not exist but do not want to error here
193
658
  return Promise.resolve();
194
659
  };
660
+ this.addListener = this.on;
195
661
  __classPrivateFieldSet$d(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
196
662
  this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
197
663
  }
198
664
  /**
199
665
  * Adds a listener to the end of the listeners array for the specified event.
200
666
  *
201
- * @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
667
+ * @param eventType
668
+ * @param listener
669
+ * @param options
202
670
  */
203
671
  async on(eventType, listener, options) {
204
672
  await this.registerEventListener(eventType, options, (emitter) => {
@@ -208,16 +676,12 @@ class EmitterBase extends Base {
208
676
  });
209
677
  return this;
210
678
  }
211
- /**
212
- * Adds a listener to the end of the listeners array for the specified event.
213
- */
214
- async addListener(eventType, listener, options) {
215
- return this.on(eventType, listener, options);
216
- }
217
679
  /**
218
680
  * Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.
219
681
  *
220
- * @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
682
+ * @param eventType
683
+ * @param listener
684
+ * @param options
221
685
  */
222
686
  async once(eventType, listener, options) {
223
687
  const deregister = () => this.deregisterEventListener(eventType);
@@ -233,7 +697,9 @@ class EmitterBase extends Base {
233
697
  /**
234
698
  * Adds a listener to the beginning of the listeners array for the specified event.
235
699
  *
236
- * @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
700
+ * @param eventType
701
+ * @param listener
702
+ * @param options
237
703
  */
238
704
  async prependListener(eventType, listener, options) {
239
705
  await this.registerEventListener(eventType, options, (emitter) => {
@@ -247,7 +713,9 @@ class EmitterBase extends Base {
247
713
  * Adds a one time listener for the event. The listener is invoked only the first time the event is fired,
248
714
  * after which it is removed. The listener is added to the beginning of the listeners array.
249
715
  *
250
- * @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
716
+ * @param eventType
717
+ * @param listener
718
+ * @param options
251
719
  */
252
720
  async prependOnceListener(eventType, listener, options) {
253
721
  const deregister = () => this.deregisterEventListener(eventType);
@@ -264,6 +732,10 @@ class EmitterBase extends Base {
264
732
  * Remove a listener from the listener array for the specified event.
265
733
  *
266
734
  * @remarks Caution: Calling this method changes the array indices in the listener array behind the listener.
735
+ *
736
+ * @param eventType
737
+ * @param listener
738
+ * @param options
267
739
  */
268
740
  async removeListener(eventType, listener, options) {
269
741
  const emitter = await this.deregisterEventListener(eventType, options);
@@ -290,6 +762,7 @@ class EmitterBase extends Base {
290
762
  /**
291
763
  * Removes all listeners, or those of the specified event.
292
764
  *
765
+ * @param eventType
293
766
  */
294
767
  async removeAllListeners(eventType) {
295
768
  const removeByEvent = async (event) => {
@@ -314,11 +787,11 @@ class EmitterBase extends Base {
314
787
  }
315
788
  }
316
789
  }
317
- base$1.EmitterBase = EmitterBase;
790
+ base.EmitterBase = EmitterBase;
318
791
  _EmitterBase_emitterAccessor = new WeakMap();
319
792
  class Reply {
320
793
  }
321
- base$1.Reply = Reply;
794
+ base.Reply = Reply;
322
795
 
323
796
  var transportErrors = {};
324
797
 
@@ -351,7 +824,7 @@ class InternalError extends Error {
351
824
  const { message, name, stack, ...rest } = err;
352
825
  super(message);
353
826
  this.name = name || 'Error';
354
- this.stack = stack ?? this.toString();
827
+ this.stack = stack !== null && stack !== void 0 ? stack : this.toString();
355
828
  Object.keys(rest).forEach(key => {
356
829
  this[key] = rest[key];
357
830
  });
@@ -360,6 +833,7 @@ class InternalError extends Error {
360
833
  // For documentation of the error methods being used see here: https://v8.dev/docs/stack-trace-api
361
834
  class RuntimeError extends Error {
362
835
  static getCallSite(callsToRemove = 0) {
836
+ var _a, _b;
363
837
  const length = Error.stackTraceLimit;
364
838
  const realCallsToRemove = callsToRemove + 1; // remove this call;
365
839
  Error.stackTraceLimit = length + realCallsToRemove;
@@ -368,7 +842,7 @@ class RuntimeError extends Error {
368
842
  // This will be called when we access the `stack` property
369
843
  Error.prepareStackTrace = (_, stack) => stack;
370
844
  // stack is optional in non chromium contexts
371
- const stack = new Error().stack?.slice(realCallsToRemove) ?? [];
845
+ const stack = (_b = (_a = new Error().stack) === null || _a === void 0 ? void 0 : _a.slice(realCallsToRemove)) !== null && _b !== void 0 ? _b : [];
372
846
  Error.prepareStackTrace = _prepareStackTrace;
373
847
  Error.stackTraceLimit = length;
374
848
  return stack;
@@ -390,7 +864,7 @@ class RuntimeError extends Error {
390
864
  const { reason, error } = payload;
391
865
  super(reason);
392
866
  this.name = 'RuntimeError';
393
- if (error?.stack) {
867
+ if (error === null || error === void 0 ? void 0 : error.stack) {
394
868
  this.cause = new InternalError(error);
395
869
  }
396
870
  if (callSites) {
@@ -400,7 +874,7 @@ class RuntimeError extends Error {
400
874
  }
401
875
  transportErrors.RuntimeError = RuntimeError;
402
876
 
403
- var window$2 = {};
877
+ var window$1 = {};
404
878
 
405
879
  var Factory$8 = {};
406
880
 
@@ -419,30 +893,16 @@ validate.validateIdentity = validateIdentity;
419
893
 
420
894
  var Instance$7 = {};
421
895
 
422
- var application$1 = {};
896
+ var application = {};
423
897
 
424
898
  var Factory$7 = {};
425
899
 
426
900
  var Instance$6 = {};
427
901
 
428
- var view$1 = {};
902
+ var view = {};
429
903
 
430
904
  var Factory$6 = {};
431
905
 
432
- var warnings = {};
433
-
434
- Object.defineProperty(warnings, "__esModule", { value: true });
435
- warnings.handleDeprecatedWarnings = void 0;
436
- const handleDeprecatedWarnings = (options) => {
437
- if (options.contentNavigation?.whitelist ||
438
- options.contentNavigation?.blacklist ||
439
- options.contentRedirect?.whitelist ||
440
- options.contentRedirect?.blacklist) {
441
- console.warn(`The properties 'whitelist' and 'blacklist' have been marked as deprecated and will be removed in a future version. Please use 'allowlist' and 'denylist'.`);
442
- }
443
- };
444
- warnings.handleDeprecatedWarnings = handleDeprecatedWarnings;
445
-
446
906
  var hasRequiredFactory$3;
447
907
 
448
908
  function requireFactory$3 () {
@@ -450,10 +910,9 @@ function requireFactory$3 () {
450
910
  hasRequiredFactory$3 = 1;
451
911
  Object.defineProperty(Factory$6, "__esModule", { value: true });
452
912
  Factory$6.ViewModule = void 0;
453
- const base_1 = base$1;
913
+ const base_1 = base;
454
914
  const validate_1 = validate;
455
915
  const index_1 = requireView();
456
- const warnings_1 = warnings;
457
916
  /**
458
917
  * Static namespace for OpenFin API methods that interact with the {@link View} class, available under `fin.View`.
459
918
  */
@@ -491,7 +950,6 @@ function requireFactory$3 () {
491
950
  if (!options.name || typeof options.name !== 'string') {
492
951
  throw new Error('Please provide a name property as a string in order to create a View.');
493
952
  }
494
- (0, warnings_1.handleDeprecatedWarnings)(options);
495
953
  if (this.wire.environment.childViews) {
496
954
  await this.wire.environment.createChildContent({
497
955
  entityType: 'view',
@@ -779,7 +1237,7 @@ class ChannelsExposer {
779
1237
  this.exposeFunction = async (target, config) => {
780
1238
  const { key, options, meta } = config;
781
1239
  const { id } = meta;
782
- const action = `${id}.${options?.action || key}`;
1240
+ const action = `${id}.${(options === null || options === void 0 ? void 0 : options.action) || key}`;
783
1241
  await this.channelProviderOrClient.register(action, async ({ args }) => {
784
1242
  return target(...args);
785
1243
  });
@@ -810,7 +1268,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
810
1268
  };
811
1269
  Object.defineProperty(exports, "__esModule", { value: true });
812
1270
  __exportStar(channelsConsumer, exports);
813
- __exportStar(channelsExposer, exports);
1271
+ __exportStar(channelsExposer, exports);
814
1272
  } (openfinChannels));
815
1273
 
816
1274
  (function (exports) {
@@ -829,7 +1287,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
829
1287
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
830
1288
  };
831
1289
  Object.defineProperty(exports, "__esModule", { value: true });
832
- __exportStar(openfinChannels, exports);
1290
+ __exportStar(openfinChannels, exports);
833
1291
  } (strategies));
834
1292
 
835
1293
  (function (exports) {
@@ -851,7 +1309,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
851
1309
  __exportStar(apiConsumer, exports);
852
1310
  __exportStar(apiExposer, exports);
853
1311
  __exportStar(strategies, exports);
854
- __exportStar(decorators, exports);
1312
+ __exportStar(decorators, exports);
855
1313
  } (apiExposer$1));
856
1314
 
857
1315
  var channelApiRelay = {};
@@ -1092,14 +1550,14 @@ _LayoutNode_client = new WeakMap();
1092
1550
  /**
1093
1551
  * @ignore
1094
1552
  * @internal
1095
- * Encapsulates Api consumption of {@link LayoutEntitiesClient} with a relayed dispatch
1553
+ * Encapsulates Api consumption of {@link LayoutEntitiesController} with a relayed dispatch
1096
1554
  * @param client
1097
1555
  * @param controllerId
1098
1556
  * @param identity
1099
1557
  * @returns a new instance of {@link LayoutEntitiesClient} with bound to the controllerId
1100
1558
  */
1101
1559
  LayoutNode.newLayoutEntitiesClient = async (client, controllerId, identity) => {
1102
- const dispatch = (0, channel_api_relay_1.createRelayedDispatch)(client, identity, 'layout-relay', 'You are trying to interact with a layout component on a window that does not exist or has been destroyed.');
1560
+ const dispatch = (0, channel_api_relay_1.createRelayedDispatch)(client, identity, 'layout-relay', 'You are trying to interact with a layout component on a window that has been destroyed.');
1103
1561
  const consumer = new api_exposer_1.ApiConsumer(new api_exposer_1.ChannelsConsumer({ dispatch }));
1104
1562
  return consumer.consume({ id: controllerId });
1105
1563
  };
@@ -1409,20 +1867,15 @@ _ColumnOrRow_client = new WeakMap();
1409
1867
  var layout_constants = {};
1410
1868
 
1411
1869
  Object.defineProperty(layout_constants, "__esModule", { value: true });
1412
- layout_constants.DEFAULT_LAYOUT_KEY = layout_constants.LAYOUT_CONTROLLER_ID = void 0;
1870
+ layout_constants.LAYOUT_CONTROLLER_ID = void 0;
1413
1871
  layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
1414
- layout_constants.DEFAULT_LAYOUT_KEY = 'default';
1415
1872
 
1416
1873
  var main = {};
1417
1874
 
1418
1875
  Object.defineProperty(main, "__esModule", { value: true });
1419
1876
  main.WebContents = void 0;
1420
- const base_1$k = base$1;
1877
+ const base_1$k = base;
1421
1878
  class WebContents extends base_1$k.EmitterBase {
1422
- /**
1423
- * @param identity The identity of the {@link OpenFin.WebContentsEvents WebContents}.
1424
- * @param entityType The type of the {@link OpenFin.WebContentsEvents WebContents}.
1425
- */
1426
1879
  constructor(wire, identity, entityType) {
1427
1880
  super(wire, entityType, identity.uuid, identity.name);
1428
1881
  this.identity = identity;
@@ -1475,11 +1928,6 @@ class WebContents extends base_1$k.EmitterBase {
1475
1928
  * }
1476
1929
  * console.log(await wnd.capturePage(options));
1477
1930
  * ```
1478
- *
1479
- * @remarks
1480
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1481
- * We do not expose an explicit superclass for this functionality, but it does have its own
1482
- * {@link OpenFin.WebContentsEvents event namespace}.
1483
1931
  */
1484
1932
  capturePage(options) {
1485
1933
  return this.wire.sendAction('capture-page', { options, ...this.identity }).then(({ payload }) => payload.data);
@@ -1515,10 +1963,6 @@ class WebContents extends base_1$k.EmitterBase {
1515
1963
  *
1516
1964
  * executeJavaScript(`console.log('Hello, Openfin')`).then(() => console.log('Javascript excuted')).catch(err => console.log(err));
1517
1965
  * ```
1518
- * @remarks
1519
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1520
- * We do not expose an explicit superclass for this functionality, but it does have its own
1521
- * {@link OpenFin.WebContentsEvents event namespace}.
1522
1966
  */
1523
1967
  executeJavaScript(code) {
1524
1968
  return this.wire
@@ -1558,10 +2002,6 @@ class WebContents extends base_1$k.EmitterBase {
1558
2002
  *
1559
2003
  * getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
1560
2004
  * ```
1561
- * @remarks
1562
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1563
- * We do not expose an explicit superclass for this functionality, but it does have its own
1564
- * {@link OpenFin.WebContentsEvents event namespace}.
1565
2005
  */
1566
2006
  getZoomLevel() {
1567
2007
  return this.wire.sendAction('get-zoom-level', this.identity).then(({ payload }) => payload.data);
@@ -1600,10 +2040,6 @@ class WebContents extends base_1$k.EmitterBase {
1600
2040
  *
1601
2041
  * setZoomLevel(4).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
1602
2042
  * ```
1603
- * @remarks
1604
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1605
- * We do not expose an explicit superclass for this functionality, but it does have its own
1606
- * {@link OpenFin.WebContentsEvents event namespace}.
1607
2043
  */
1608
2044
  setZoomLevel(level) {
1609
2045
  return this.wire.sendAction('set-zoom-level', { ...this.identity, level }).then(() => undefined);
@@ -1611,7 +2047,7 @@ class WebContents extends base_1$k.EmitterBase {
1611
2047
  /**
1612
2048
  * Navigates the WebContents to a specified URL.
1613
2049
  *
1614
- * Note: The url must contain the protocol prefix such as http:// or https://.
2050
+ * @remarks The url must contain the protocol prefix such as http:// or https://.
1615
2051
  * @param url - The URL to navigate the WebContents to.
1616
2052
  *
1617
2053
  * @example
@@ -1641,10 +2077,6 @@ class WebContents extends base_1$k.EmitterBase {
1641
2077
  * navigate().then(() => console.log('Navigate to tutorial')).catch(err => console.log(err));
1642
2078
  * ```
1643
2079
  * @experimental
1644
- * @remarks
1645
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1646
- * We do not expose an explicit superclass for this functionality, but it does have its own
1647
- * {@link OpenFin.WebContentsEvents event namespace}.
1648
2080
  */
1649
2081
  navigate(url) {
1650
2082
  return this.wire.sendAction('navigate-window', { ...this.identity, url }).then(() => undefined);
@@ -1672,10 +2104,6 @@ class WebContents extends base_1$k.EmitterBase {
1672
2104
  * }
1673
2105
  * navigateBack().then(() => console.log('Navigated back')).catch(err => console.log(err));
1674
2106
  * ```
1675
- * @remarks
1676
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1677
- * We do not expose an explicit superclass for this functionality, but it does have its own
1678
- * {@link OpenFin.WebContentsEvents event namespace}.
1679
2107
  */
1680
2108
  navigateBack() {
1681
2109
  return this.wire.sendAction('navigate-window-back', { ...this.identity }).then(() => undefined);
@@ -1705,10 +2133,6 @@ class WebContents extends base_1$k.EmitterBase {
1705
2133
  * }
1706
2134
  * navigateForward().then(() => console.log('Navigated forward')).catch(err => console.log(err));
1707
2135
  * ```
1708
- * @remarks
1709
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1710
- * We do not expose an explicit superclass for this functionality, but it does have its own
1711
- * {@link OpenFin.WebContentsEvents event namespace}.
1712
2136
  */
1713
2137
  async navigateForward() {
1714
2138
  await this.wire.sendAction('navigate-window-forward', { ...this.identity });
@@ -1736,10 +2160,6 @@ class WebContents extends base_1$k.EmitterBase {
1736
2160
  * }
1737
2161
  * stopNavigation().then(() => console.log('you shall not navigate')).catch(err => console.log(err));
1738
2162
  * ```
1739
- * @remarks
1740
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1741
- * We do not expose an explicit superclass for this functionality, but it does have its own
1742
- * {@link OpenFin.WebContentsEvents event namespace}.
1743
2163
  */
1744
2164
  stopNavigation() {
1745
2165
  return this.wire.sendAction('stop-window-navigation', { ...this.identity }).then(() => undefined);
@@ -1777,10 +2197,6 @@ class WebContents extends base_1$k.EmitterBase {
1777
2197
  * console.log('Reloaded window')
1778
2198
  * }).catch(err => console.log(err));
1779
2199
  * ```
1780
- * @remarks
1781
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1782
- * We do not expose an explicit superclass for this functionality, but it does have its own
1783
- * {@link OpenFin.WebContentsEvents event namespace}.
1784
2200
  */
1785
2201
  reload(ignoreCache = false) {
1786
2202
  return this.wire
@@ -1794,7 +2210,7 @@ class WebContents extends base_1$k.EmitterBase {
1794
2210
  * Prints the WebContents.
1795
2211
  * @param options Printer Options
1796
2212
  *
1797
- * Note: When `silent` is set to `true`, the API will pick the system's default printer if deviceName
2213
+ * @remarks When `silent` is set to `true`, the API will pick the system's default printer if deviceName
1798
2214
  * is empty and the default settings for printing.
1799
2215
  *
1800
2216
  * Use the CSS style `page-break-before: always;` to force print to a new page.
@@ -1807,10 +2223,6 @@ class WebContents extends base_1$k.EmitterBase {
1807
2223
  * console.log('print call has been sent to the system');
1808
2224
  * });
1809
2225
  * ```
1810
- * @remarks
1811
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1812
- * We do not expose an explicit superclass for this functionality, but it does have its own
1813
- * {@link OpenFin.WebContentsEvents event namespace}.
1814
2226
  */
1815
2227
  print(options = {}) {
1816
2228
  return this.wire.sendAction('print', { ...this.identity, options }).then(() => undefined);
@@ -1820,7 +2232,7 @@ class WebContents extends base_1$k.EmitterBase {
1820
2232
  * @param searchTerm Term to find in page
1821
2233
  * @param options Search options
1822
2234
  *
1823
- * Note: By default, each subsequent call will highlight the next text that matches the search term.
2235
+ * @remarks By default, each subsequent call will highlight the next text that matches the search term.
1824
2236
  *
1825
2237
  * Returns a promise with the results for the request. By subscribing to the
1826
2238
  * found-in-page event, you can get the results of this call as well.
@@ -1855,10 +2267,6 @@ class WebContents extends base_1$k.EmitterBase {
1855
2267
  * console.log(result)
1856
2268
  * });
1857
2269
  * ```
1858
- * @remarks
1859
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1860
- * We do not expose an explicit superclass for this functionality, but it does have its own
1861
- * {@link OpenFin.WebContentsEvents event namespace}.
1862
2270
  */
1863
2271
  findInPage(searchTerm, options) {
1864
2272
  return this.wire
@@ -1902,10 +2310,6 @@ class WebContents extends base_1$k.EmitterBase {
1902
2310
  * console.log(results);
1903
2311
  * });
1904
2312
  * ```
1905
- * @remarks
1906
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1907
- * We do not expose an explicit superclass for this functionality, but it does have its own
1908
- * {@link OpenFin.WebContentsEvents event namespace}.
1909
2313
  */
1910
2314
  stopFindInPage(action) {
1911
2315
  return this.wire.sendAction('stop-find-in-page', { ...this.identity, action }).then(() => undefined);
@@ -1948,10 +2352,6 @@ class WebContents extends base_1$k.EmitterBase {
1948
2352
  * console.log(err);
1949
2353
  * });
1950
2354
  * ```
1951
- * @remarks
1952
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1953
- * We do not expose an explicit superclass for this functionality, but it does have its own
1954
- * {@link OpenFin.WebContentsEvents event namespace}.
1955
2355
  */
1956
2356
  getPrinters() {
1957
2357
  return this.wire.sendAction('get-printers', { ...this.identity }).then(({ payload }) => payload.data);
@@ -1974,10 +2374,6 @@ class WebContents extends base_1$k.EmitterBase {
1974
2374
  *
1975
2375
  * focusWindow().then(() => console.log('Window focused')).catch(err => console.log(err));
1976
2376
  * ```
1977
- * @remarks
1978
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
1979
- * We do not expose an explicit superclass for this functionality, but it does have its own
1980
- * {@link OpenFin.WebContentsEvents event namespace}.
1981
2377
  */
1982
2378
  async focus({ emitSynthFocused } = { emitSynthFocused: true }) {
1983
2379
  await this.wire.sendAction('focus-window', { emitSynthFocused, ...this.identity });
@@ -2009,10 +2405,6 @@ class WebContents extends base_1$k.EmitterBase {
2009
2405
  * .then(() => console.log('Showing dev tools'))
2010
2406
  * .catch(err => console.error(err));
2011
2407
  * ```
2012
- * @remarks
2013
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2014
- * We do not expose an explicit superclass for this functionality, but it does have its own
2015
- * {@link OpenFin.WebContentsEvents event namespace}.
2016
2408
  */
2017
2409
  async showDeveloperTools() {
2018
2410
  // Note this hits the system action map in core state for legacy reasons.
@@ -2021,7 +2413,7 @@ class WebContents extends base_1$k.EmitterBase {
2021
2413
  /**
2022
2414
  * Retrieves the process information associated with a WebContents.
2023
2415
  *
2024
- * Note: This includes any iframes associated with the WebContents
2416
+ * @remarks This includes any iframes associated with the WebContents
2025
2417
  *
2026
2418
  * @example
2027
2419
  * View:
@@ -2035,10 +2427,6 @@ class WebContents extends base_1$k.EmitterBase {
2035
2427
  * const win = await fin.Window.getCurrent();
2036
2428
  * const processInfo = await win.getProcessInfo();
2037
2429
  * ```
2038
- * @remarks
2039
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2040
- * We do not expose an explicit superclass for this functionality, but it does have its own
2041
- * {@link OpenFin.WebContentsEvents event namespace}.
2042
2430
  */
2043
2431
  async getProcessInfo() {
2044
2432
  const { payload: { data } } = await this.wire.sendAction('get-process-info', this.identity);
@@ -2074,10 +2462,6 @@ class WebContents extends base_1$k.EmitterBase {
2074
2462
  * const win = await fin.Window.create(winOption);
2075
2463
  * const sharedWorkers = await win.getSharedWorkers();
2076
2464
  * ```
2077
- * @remarks
2078
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2079
- * We do not expose an explicit superclass for this functionality, but it does have its own
2080
- * {@link OpenFin.WebContentsEvents event namespace}.
2081
2465
  */
2082
2466
  async getSharedWorkers() {
2083
2467
  return this.wire.sendAction('get-shared-workers', this.identity).then(({ payload }) => payload.data);
@@ -2112,10 +2496,6 @@ class WebContents extends base_1$k.EmitterBase {
2112
2496
  * const win = await fin.Window.create(winOption);
2113
2497
  * await win.inspectSharedWorker();
2114
2498
  * ```
2115
- * @remarks
2116
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2117
- * We do not expose an explicit superclass for this functionality, but it does have its own
2118
- * {@link OpenFin.WebContentsEvents event namespace}.
2119
2499
  */
2120
2500
  async inspectSharedWorker() {
2121
2501
  await this.wire.sendAction('inspect-shared-worker', { ...this.identity });
@@ -2153,10 +2533,6 @@ class WebContents extends base_1$k.EmitterBase {
2153
2533
  * const sharedWorkers = await win.getSharedWorkers();
2154
2534
  * await win.inspectSharedWorkerById(sharedWorkers[0].id);
2155
2535
  * ```
2156
- * @remarks
2157
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2158
- * We do not expose an explicit superclass for this functionality, but it does have its own
2159
- * {@link OpenFin.WebContentsEvents event namespace}.
2160
2536
  */
2161
2537
  async inspectSharedWorkerById(workerId) {
2162
2538
  await this.wire.sendAction('inspect-shared-worker-by-id', { ...this.identity, workerId });
@@ -2191,10 +2567,6 @@ class WebContents extends base_1$k.EmitterBase {
2191
2567
  * const win = await fin.Window.create(winOption);
2192
2568
  * await win.inspectServiceWorker();
2193
2569
  * ```
2194
- * @remarks
2195
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2196
- * We do not expose an explicit superclass for this functionality, but it does have its own
2197
- * {@link OpenFin.WebContentsEvents event namespace}.
2198
2570
  */
2199
2571
  async inspectServiceWorker() {
2200
2572
  await this.wire.sendAction('inspect-service-worker', { ...this.identity });
@@ -2202,7 +2574,7 @@ class WebContents extends base_1$k.EmitterBase {
2202
2574
  /**
2203
2575
  * Shows a popup window.
2204
2576
  *
2205
- * Note: If this WebContents is a view and its attached window has a popup open, this will close it.
2577
+ * @remarks If this WebContents is a view and its attached window has a popup open, this will close it.
2206
2578
  *
2207
2579
  * Shows a popup window. Including a `name` in `options` will attempt to show an existing window as a popup, if
2208
2580
  * that window doesn't exist or no `name` is included a window will be created. If the caller view or the caller
@@ -2210,7 +2582,7 @@ class WebContents extends base_1$k.EmitterBase {
2210
2582
  * open popup window before showing the new popup window. Also, if the caller view is destroyed or detached, the popup
2211
2583
  * will be dismissed.
2212
2584
  *
2213
- * Note: in the case where the window being shown as a popup needs to be created, it is a child of the caller view's parent window.
2585
+ * NOTE: in the case where the window being shown as a popup needs to be created, it is a child of the caller view's parent window.
2214
2586
  *
2215
2587
  * @example
2216
2588
  *
@@ -2405,16 +2777,12 @@ class WebContents extends base_1$k.EmitterBase {
2405
2777
  * onPopupReady: popupWindowCallback;
2406
2778
  * });
2407
2779
  * ```
2408
- * @remarks
2409
- * `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
2410
- * We do not expose an explicit superclass for this functionality, but it does have its own
2411
- * {@link OpenFin.WebContentsEvents event namespace}.
2412
2780
  */
2413
2781
  async showPopupWindow(options) {
2414
2782
  this.wire.sendAction(`${this.entityType}-show-popup-window`, this.identity).catch(() => {
2415
2783
  // we do not want to expose this error, just continue if this analytics-only call fails
2416
2784
  });
2417
- if (options?.onPopupReady) {
2785
+ if (options === null || options === void 0 ? void 0 : options.onPopupReady) {
2418
2786
  const readyListener = async ({ popupName }) => {
2419
2787
  try {
2420
2788
  const popupWindow = this.fin.Window.wrapSync({ uuid: this.fin.me.uuid, name: popupName });
@@ -2433,8 +2801,8 @@ class WebContents extends base_1$k.EmitterBase {
2433
2801
  ...options,
2434
2802
  // Internal use only.
2435
2803
  // @ts-expect-error
2436
- hasResultCallback: !!options?.onPopupResult,
2437
- hasReadyCallback: !!options?.onPopupReady
2804
+ hasResultCallback: !!(options === null || options === void 0 ? void 0 : options.onPopupResult),
2805
+ hasReadyCallback: !!(options === null || options === void 0 ? void 0 : options.onPopupReady)
2438
2806
  },
2439
2807
  ...this.identity
2440
2808
  });
@@ -2459,7 +2827,7 @@ class WebContents extends base_1$k.EmitterBase {
2459
2827
  }
2460
2828
  return popupResult;
2461
2829
  };
2462
- if (options?.onPopupResult) {
2830
+ if (options === null || options === void 0 ? void 0 : options.onPopupResult) {
2463
2831
  const dispatchResultListener = async (payload) => {
2464
2832
  await options.onPopupResult(normalizePopupResult(payload));
2465
2833
  };
@@ -2785,49 +3153,6 @@ function requireInstance$2 () {
2785
3153
  this.show = async () => {
2786
3154
  await this.wire.sendAction('show-view', { ...this.identity });
2787
3155
  };
2788
- /**
2789
- * Sets the bounds (top, left, width, height) of the view relative to its window and shows it if it is hidden.
2790
- * This method ensures the view is both positioned and showing. It will reposition a visible view and both show and reposition a hidden view.
2791
- *
2792
- * @remarks View position is relative to the bounds of the window.
2793
- * ({top: 0, left: 0} represents the top left corner of the window)
2794
- *
2795
- * @example
2796
- * ```js
2797
- * let view;
2798
- * async function createView() {
2799
- * const me = await fin.Window.getCurrent();
2800
- * return fin.View.create({
2801
- * name: 'viewNameSetBounds',
2802
- * target: me.identity,
2803
- * bounds: {top: 10, left: 10, width: 200, height: 200}
2804
- * });
2805
- * }
2806
- *
2807
- * async function showViewAt() {
2808
- * view = await createView();
2809
- * console.log('View created.');
2810
- *
2811
- * await view.navigate('https://google.com');
2812
- * console.log('View navigated to given url.');
2813
- *
2814
- * await view.showAt({
2815
- * top: 100,
2816
- * left: 100,
2817
- * width: 300,
2818
- * height: 300
2819
- * });
2820
- * }
2821
- *
2822
- * showViewAt()
2823
- * .then(() => console.log('View set to new bounds and shown.'))
2824
- * .catch(err => console.log(err));
2825
- * ```
2826
- * @experimental
2827
- */
2828
- this.showAt = async (bounds) => {
2829
- await this.wire.sendAction('show-view-at', { bounds, ...this.identity });
2830
- };
2831
3156
  /**
2832
3157
  * Hides the current view if it is currently visible.
2833
3158
  *
@@ -2987,24 +3312,8 @@ function requireInstance$2 () {
2987
3312
  this.wire.sendAction('view-get-parent-layout', { ...this.identity }).catch(() => {
2988
3313
  // don't expose
2989
3314
  });
2990
- const layoutWindow = await this.getCurrentWindow();
2991
- try {
2992
- const providerChannelClient = await __classPrivateFieldGet(this, _View_providerChannelClient, "f").getValue();
2993
- const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindow.identity);
2994
- const layoutIdentity = await client.getLayoutIdentityForViewOrThrow(this.identity);
2995
- return this.fin.Platform.Layout.wrap(layoutIdentity);
2996
- }
2997
- catch (e) {
2998
- const allowedErrors = [
2999
- 'No action registered at target for',
3000
- 'getLayoutIdentityForViewOrThrow is not a function'
3001
- ];
3002
- if (!allowedErrors.some((m) => e.message.includes(m))) {
3003
- throw e;
3004
- }
3005
- // fallback logic for missing endpoint
3006
- return this.fin.Platform.Layout.wrap(layoutWindow.identity);
3007
- }
3315
+ const currentWindow = await this.getCurrentWindow();
3316
+ return currentWindow.getLayout();
3008
3317
  };
3009
3318
  /**
3010
3319
  * Gets the View's options.
@@ -3219,7 +3528,7 @@ function requireInstance$2 () {
3219
3528
  var hasRequiredView;
3220
3529
 
3221
3530
  function requireView () {
3222
- if (hasRequiredView) return view$1;
3531
+ if (hasRequiredView) return view;
3223
3532
  hasRequiredView = 1;
3224
3533
  (function (exports) {
3225
3534
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -3238,9 +3547,9 @@ function requireView () {
3238
3547
  };
3239
3548
  Object.defineProperty(exports, "__esModule", { value: true });
3240
3549
  /**
3241
- * Entry points for the OpenFin `View` API (`fin.View`).
3550
+ * Entry points for the OpenFin `View` API.
3242
3551
  *
3243
- * * {@link ViewModule} contains static members of the `View` API, accessible through `fin.View`.
3552
+ * * {@link ViewModule} contains static methods relating to the `View` type, accessible through `fin.View`.
3244
3553
  * * {@link View} describes an instance of an OpenFin View, e.g. as returned by `fin.View.getCurrent`.
3245
3554
  *
3246
3555
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -3249,9 +3558,9 @@ function requireView () {
3249
3558
  * @packageDocumentation
3250
3559
  */
3251
3560
  __exportStar(requireFactory$3(), exports);
3252
- __exportStar(requireInstance$2(), exports);
3253
- } (view$1));
3254
- return view$1;
3561
+ __exportStar(requireInstance$2(), exports);
3562
+ } (view));
3563
+ return view;
3255
3564
  }
3256
3565
 
3257
3566
  var hasRequiredInstance$1;
@@ -3262,7 +3571,7 @@ function requireInstance$1 () {
3262
3571
  Object.defineProperty(Instance$6, "__esModule", { value: true });
3263
3572
  Instance$6.Application = void 0;
3264
3573
  /* eslint-disable import/prefer-default-export */
3265
- const base_1 = base$1;
3574
+ const base_1 = base;
3266
3575
  const window_1 = requireWindow();
3267
3576
  const view_1 = requireView();
3268
3577
  /**
@@ -3737,7 +4046,6 @@ function requireInstance$1 () {
3737
4046
  /**
3738
4047
  * Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
3739
4048
  * If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
3740
- *
3741
4049
  * Note: If the "name" property is omitted it defaults to "tasks".
3742
4050
  * @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
3743
4051
  *
@@ -4038,7 +4346,6 @@ function requireInstance$1 () {
4038
4346
  }
4039
4347
  /**
4040
4348
  * Sets file auto download location. It's only allowed in the same application.
4041
- *
4042
4349
  * Note: This method is restricted by default and must be enabled via
4043
4350
  * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
4044
4351
  * @param downloadLocation file auto download location
@@ -4064,7 +4371,6 @@ function requireInstance$1 () {
4064
4371
  }
4065
4372
  /**
4066
4373
  * Gets file auto download location. It's only allowed in the same application. If file auto download location is not set, it will return the default location.
4067
- *
4068
4374
  * Note: This method is restricted by default and must be enabled via
4069
4375
  * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
4070
4376
  *
@@ -4092,7 +4398,7 @@ function requireFactory$2 () {
4092
4398
  hasRequiredFactory$2 = 1;
4093
4399
  Object.defineProperty(Factory$7, "__esModule", { value: true });
4094
4400
  Factory$7.ApplicationModule = void 0;
4095
- const base_1 = base$1;
4401
+ const base_1 = base;
4096
4402
  const validate_1 = validate;
4097
4403
  const Instance_1 = requireInstance$1();
4098
4404
  /**
@@ -4360,7 +4666,7 @@ function requireFactory$2 () {
4360
4666
  var hasRequiredApplication;
4361
4667
 
4362
4668
  function requireApplication () {
4363
- if (hasRequiredApplication) return application$1;
4669
+ if (hasRequiredApplication) return application;
4364
4670
  hasRequiredApplication = 1;
4365
4671
  (function (exports) {
4366
4672
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -4379,9 +4685,9 @@ function requireApplication () {
4379
4685
  };
4380
4686
  Object.defineProperty(exports, "__esModule", { value: true });
4381
4687
  /**
4382
- * Entry points for the OpenFin `Application` API (`fin.Application`).
4688
+ * Entry points for the OpenFin `Application` API.
4383
4689
  *
4384
- * * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
4690
+ * * {@link ApplicationModule} contains static methods relating to the `Application` type, accessible through `fin.Application`.
4385
4691
  * * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
4386
4692
  *
4387
4693
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -4390,9 +4696,9 @@ function requireApplication () {
4390
4696
  * @packageDocumentation
4391
4697
  */
4392
4698
  __exportStar(requireFactory$2(), exports);
4393
- __exportStar(requireInstance$1(), exports);
4394
- } (application$1));
4395
- return application$1;
4699
+ __exportStar(requireInstance$1(), exports);
4700
+ } (application));
4701
+ return application;
4396
4702
  }
4397
4703
 
4398
4704
  var hasRequiredInstance;
@@ -4409,7 +4715,6 @@ function requireInstance () {
4409
4715
  const application_1 = requireApplication();
4410
4716
  const main_1 = main;
4411
4717
  const view_1 = requireView();
4412
- const warnings_1 = warnings;
4413
4718
  /**
4414
4719
  * @PORTED
4415
4720
  * @typedef { object } Margins
@@ -4894,6 +5199,7 @@ function requireInstance () {
4894
5199
  */
4895
5200
  constructor(wire, identity) {
4896
5201
  super(wire, identity, 'window');
5202
+ this.identity = identity;
4897
5203
  }
4898
5204
  /**
4899
5205
  * Adds a listener to the end of the listeners array for the specified event.
@@ -5019,7 +5325,6 @@ function requireInstance () {
5019
5325
  if (options.autoShow === undefined) {
5020
5326
  options.autoShow = true;
5021
5327
  }
5022
- (0, warnings_1.handleDeprecatedWarnings)(options);
5023
5328
  const windowCreation = this.wire.environment.createChildContent({ entityType: 'window', options });
5024
5329
  Promise.all([pageResponse, windowCreation])
5025
5330
  .then((resolvedArr) => {
@@ -5436,15 +5741,15 @@ function requireInstance () {
5436
5741
  * ```
5437
5742
  * @experimental
5438
5743
  */
5439
- async getLayout(layoutIdentity) {
5744
+ async getLayout() {
5440
5745
  this.wire.sendAction('window-get-layout', this.identity).catch((e) => {
5441
5746
  // don't expose
5442
5747
  });
5443
5748
  const opts = await this.getOptions();
5444
- if (!opts.layout || !opts.layoutSnapshot) {
5749
+ if (!opts.layout) {
5445
5750
  throw new Error('Window does not have a Layout');
5446
5751
  }
5447
- return this.fin.Platform.Layout.wrap(layoutIdentity ?? this.identity);
5752
+ return this.fin.Platform.Layout.wrap(this.identity);
5448
5753
  }
5449
5754
  /**
5450
5755
  * Gets the current settings of the window.
@@ -6073,10 +6378,7 @@ function requireInstance () {
6073
6378
  * Calling this method will close previously opened menus.
6074
6379
  * @experimental
6075
6380
  * @param options
6076
- * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
6077
- * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
6078
- * of all possible data shapes for the entire menu, and the click handler should process
6079
- * these with a "reducer" pattern.
6381
+ *
6080
6382
  * @example
6081
6383
  * This could be used to show a drop down menu over views in a platform window:
6082
6384
  * ```js
@@ -6275,7 +6577,7 @@ function requireFactory$1 () {
6275
6577
  hasRequiredFactory$1 = 1;
6276
6578
  Object.defineProperty(Factory$8, "__esModule", { value: true });
6277
6579
  Factory$8._WindowModule = void 0;
6278
- const base_1 = base$1;
6580
+ const base_1 = base;
6279
6581
  const validate_1 = validate;
6280
6582
  const Instance_1 = requireInstance();
6281
6583
  /**
@@ -6417,7 +6719,7 @@ function requireFactory$1 () {
6417
6719
  var hasRequiredWindow;
6418
6720
 
6419
6721
  function requireWindow () {
6420
- if (hasRequiredWindow) return window$2;
6722
+ if (hasRequiredWindow) return window$1;
6421
6723
  hasRequiredWindow = 1;
6422
6724
  (function (exports) {
6423
6725
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -6436,9 +6738,9 @@ function requireWindow () {
6436
6738
  };
6437
6739
  Object.defineProperty(exports, "__esModule", { value: true });
6438
6740
  /**
6439
- * Entry points for the OpenFin `Window` API (`fin.Window`).
6741
+ * Entry points for the OpenFin `Window` API.
6440
6742
  *
6441
- * * {@link _WindowModule} contains static members of the `Window` API, accessible through `fin.Window`.
6743
+ * * {@link _WindowModule} contains static methods relating to the `Window` type, accessible through `fin.Window`.
6442
6744
  * * {@link _Window} describes an instance of an OpenFin Window, e.g. as returned by `fin.Window.getCurrent`.
6443
6745
  *
6444
6746
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -6449,24 +6751,17 @@ function requireWindow () {
6449
6751
  * @packageDocumentation
6450
6752
  */
6451
6753
  __exportStar(requireFactory$1(), exports);
6452
- __exportStar(requireInstance(), exports);
6453
- } (window$2));
6454
- return window$2;
6754
+ __exportStar(requireInstance(), exports);
6755
+ } (window$1));
6756
+ return window$1;
6455
6757
  }
6456
6758
 
6457
- /**
6458
- * Entry point for the OpenFin `System` API (`fin.System`).
6459
- *
6460
- * * {@link System} contains static members of the `System` API (available under `fin.System`)
6461
- *
6462
- * @packageDocumentation
6463
- */
6464
- Object.defineProperty(system$1, "__esModule", { value: true });
6465
- system$1.System = void 0;
6466
- const base_1$j = base$1;
6759
+ Object.defineProperty(system, "__esModule", { value: true });
6760
+ system.System = void 0;
6761
+ const base_1$j = base;
6467
6762
  const transport_errors_1$2 = transportErrors;
6468
6763
  const window_1 = requireWindow();
6469
- const events_1$6 = require$$0;
6764
+ const events_1$6 = eventsExports;
6470
6765
  /**
6471
6766
  * An object representing the core of OpenFin Runtime. Allows the developer
6472
6767
  * to perform system-level actions, such as accessing logs, viewing processes,
@@ -7436,59 +7731,6 @@ class System extends base_1$j.EmitterBase {
7436
7731
  openUrlWithBrowser(url) {
7437
7732
  return this.wire.sendAction('open-url-with-browser', { url }).then(() => undefined);
7438
7733
  }
7439
- /**
7440
- * Creates a new registry entry under the HKCU root Windows registry key if the given custom protocol name doesn't exist or
7441
- * overwrites the existing registry entry if the given custom protocol name already exists.
7442
- *
7443
- * Note: This method is restricted by default and must be enabled via
7444
- * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
7445
- *
7446
- *
7447
- * @remarks These protocols are reserved and cannot be registered:
7448
- * - fin
7449
- * - fins
7450
- * - openfin
7451
- * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
7452
- *
7453
- * @throws if a given custom protocol failed to be registered.
7454
- * @throws if a manifest URL contains the '%1' string.
7455
- * @throws if a manifest URL contains a query string parameter which name equals to the Protocol Launch Request Parameter Name.
7456
- * @throws if the full length of the command string that is to be written to the registry exceeds 2048 bytes.
7457
- *
7458
- * @example
7459
- * ```js
7460
- * fin.System.registerCustomProtocol({protocolName:'protocol1'}).then(console.log).catch(console.error);
7461
- * ```
7462
- */
7463
- async registerCustomProtocol(options) {
7464
- if (typeof options !== 'object') {
7465
- throw new Error('Must provide an object with a `protocolName` property having a string value.');
7466
- }
7467
- await this.wire.sendAction('register-custom-protocol', options);
7468
- }
7469
- /**
7470
- * Removes the registry entry for a given custom protocol.
7471
- *
7472
- * Note: This method is restricted by default and must be enabled via
7473
- * {@link https://developers.openfin.co/docs/api-security API security settings}. It requires RVM 12 or higher version.
7474
- *
7475
- *
7476
- * @remarks These protocols are reserved and cannot be unregistered:
7477
- * - fin
7478
- * - fins
7479
- * - openfin
7480
- * - URI Schemes registered with {@link https://en.wikipedia.org/wiki/List_of_URI_schemes#Official_IANA-registered_schemes IANA}
7481
- *
7482
- * @throws if a protocol entry failed to be removed in registry.
7483
- *
7484
- * @example
7485
- * ```js
7486
- * await fin.System.unregisterCustomProtocol('protocol1');
7487
- * ```
7488
- */
7489
- async unregisterCustomProtocol(protocolName) {
7490
- await this.wire.sendAction('unregister-custom-protocol', { protocolName });
7491
- }
7492
7734
  /**
7493
7735
  * Removes the process entry for the passed UUID obtained from a prior call
7494
7736
  * of fin.System.launchExternalProcess().
@@ -7521,8 +7763,7 @@ class System extends base_1$j.EmitterBase {
7521
7763
  }
7522
7764
  /**
7523
7765
  * Attempt to close an external process. The process will be terminated if it
7524
- * has not closed after the elapsed timeout in milliseconds.
7525
- *
7766
+ * has not closed after the elapsed timeout in milliseconds.<br>
7526
7767
  * Note: This method is restricted by default and must be enabled via
7527
7768
  * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
7528
7769
  * @param options A object defined in the TerminateExternalRequestType interface
@@ -7558,8 +7799,7 @@ class System extends base_1$j.EmitterBase {
7558
7799
  return this.wire.sendAction('update-proxy', options).then(() => undefined);
7559
7800
  }
7560
7801
  /**
7561
- * Downloads the given application asset.
7562
- *
7802
+ * Downloads the given application asset<br>
7563
7803
  * Note: This method is restricted by default and must be enabled via
7564
7804
  * <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
7565
7805
  * @param appAsset App asset object
@@ -8362,7 +8602,7 @@ class System extends base_1$j.EmitterBase {
8362
8602
  await this.wire.sendAction('set-domain-settings', { domainSettings, ...this.identity });
8363
8603
  }
8364
8604
  }
8365
- system$1.System = System;
8605
+ system.System = System;
8366
8606
 
8367
8607
  var interappbus = {};
8368
8608
 
@@ -8453,7 +8693,7 @@ class ChannelBase {
8453
8693
  try {
8454
8694
  const mainAction = this.subscriptions.has(topic)
8455
8695
  ? this.subscriptions.get(topic)
8456
- : (currentPayload, id) => (this.defaultAction ?? ChannelBase.defaultAction)(topic, currentPayload, id);
8696
+ : (currentPayload, id) => { var _a; return ((_a = this.defaultAction) !== null && _a !== void 0 ? _a : ChannelBase.defaultAction)(topic, currentPayload, id); };
8457
8697
  const preActionProcessed = this.preAction ? await this.preAction(topic, payload, senderIdentity) : payload;
8458
8698
  const actionProcessed = await mainAction(preActionProcessed, senderIdentity);
8459
8699
  return this.postAction ? await this.postAction(topic, actionProcessed, senderIdentity) : actionProcessed;
@@ -8986,6 +9226,7 @@ class ClassicStrategy {
8986
9226
  // connection problems occur
8987
9227
  _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map);
8988
9228
  this.send = async (endpointId, action, payload) => {
9229
+ var _a;
8989
9230
  const to = __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
8990
9231
  if (!to) {
8991
9232
  throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
@@ -9005,12 +9246,13 @@ class ClassicStrategy {
9005
9246
  action,
9006
9247
  payload
9007
9248
  });
9008
- __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
9249
+ (_a = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)) === null || _a === void 0 ? void 0 : _a.add(p);
9009
9250
  const raw = await p.catch((error) => {
9010
9251
  throw new Error(error.message);
9011
9252
  }).finally(() => {
9253
+ var _a;
9012
9254
  // clean up the pending promise
9013
- __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
9255
+ (_a = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)) === null || _a === void 0 ? void 0 : _a.delete(p);
9014
9256
  });
9015
9257
  return raw.payload.data.result;
9016
9258
  };
@@ -9031,8 +9273,8 @@ class ClassicStrategy {
9031
9273
  const id = __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
9032
9274
  __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
9033
9275
  const pendingSet = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
9034
- pendingSet?.forEach((p) => {
9035
- const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
9276
+ pendingSet === null || pendingSet === void 0 ? void 0 : pendingSet.forEach((p) => {
9277
+ const errorMsg = `Channel connection with identity uuid: ${id === null || id === void 0 ? void 0 : id.uuid} / name: ${id === null || id === void 0 ? void 0 : id.name} / endpointId: ${endpointId} no longer connected.`;
9036
9278
  p.cancel(new Error(errorMsg));
9037
9279
  });
9038
9280
  }
@@ -9044,8 +9286,9 @@ class ClassicStrategy {
9044
9286
  __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
9045
9287
  }
9046
9288
  isValidEndpointPayload(payload) {
9047
- return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
9048
- typeof payload?.endpointIdentity?.channelId === 'string');
9289
+ var _a, _b;
9290
+ return (typeof ((_a = payload === null || payload === void 0 ? void 0 : payload.endpointIdentity) === null || _a === void 0 ? void 0 : _a.endpointId) === 'string' ||
9291
+ typeof ((_b = payload === null || payload === void 0 ? void 0 : payload.endpointIdentity) === null || _b === void 0 ? void 0 : _b.channelId) === 'string');
9049
9292
  }
9050
9293
  }
9051
9294
  strategy$2.ClassicStrategy = ClassicStrategy;
@@ -9122,12 +9365,13 @@ class RTCEndpoint {
9122
9365
  this.rtc.rtcClient.close();
9123
9366
  };
9124
9367
  this.rtc.channels.response.addEventListener('message', (e) => {
9368
+ var _a;
9125
9369
  let { data } = e;
9126
9370
  if (e.data instanceof ArrayBuffer) {
9127
9371
  data = new TextDecoder().decode(e.data);
9128
9372
  }
9129
9373
  const { messageId, payload, success, error } = JSON.parse(data);
9130
- const { resolve, reject } = this.responseMap.get(messageId) ?? {};
9374
+ const { resolve, reject } = (_a = this.responseMap.get(messageId)) !== null && _a !== void 0 ? _a : {};
9131
9375
  if (resolve && reject) {
9132
9376
  this.responseMap.delete(messageId);
9133
9377
  if (success) {
@@ -9300,7 +9544,7 @@ var iceManager = {};
9300
9544
 
9301
9545
  Object.defineProperty(iceManager, "__esModule", { value: true });
9302
9546
  iceManager.RTCICEManager = void 0;
9303
- const base_1$i = base$1;
9547
+ const base_1$i = base;
9304
9548
  /*
9305
9549
  Singleton that facilitates Offer and Answer exchange required for establishing RTC connections.
9306
9550
  */
@@ -9376,8 +9620,9 @@ class RTCICEManager extends base_1$i.EmitterBase {
9376
9620
  const rtcConnectionId = Math.random().toString();
9377
9621
  const rtcClient = this.createRtcPeer();
9378
9622
  rtcClient.addEventListener('icecandidate', async (e) => {
9623
+ var _a;
9379
9624
  if (e.candidate) {
9380
- await this.raiseClientIce(rtcConnectionId, { candidate: e.candidate?.toJSON() });
9625
+ await this.raiseClientIce(rtcConnectionId, { candidate: (_a = e.candidate) === null || _a === void 0 ? void 0 : _a.toJSON() });
9381
9626
  }
9382
9627
  });
9383
9628
  await this.listenForProviderIce(rtcConnectionId, async (payload) => {
@@ -9402,8 +9647,9 @@ class RTCICEManager extends base_1$i.EmitterBase {
9402
9647
  const requestChannelPromise = RTCICEManager.createDataChannelPromise('request', rtcClient);
9403
9648
  const responseChannelPromise = RTCICEManager.createDataChannelPromise('response', rtcClient);
9404
9649
  rtcClient.addEventListener('icecandidate', async (e) => {
9650
+ var _a;
9405
9651
  if (e.candidate) {
9406
- await this.raiseProviderIce(rtcConnectionId, { candidate: e.candidate?.toJSON() });
9652
+ await this.raiseProviderIce(rtcConnectionId, { candidate: (_a = e.candidate) === null || _a === void 0 ? void 0 : _a.toJSON() });
9407
9653
  }
9408
9654
  });
9409
9655
  await this.listenForClientIce(rtcConnectionId, async (payload) => {
@@ -9585,7 +9831,8 @@ class ChannelProvider extends channel_1.ChannelBase {
9585
9831
  * ```
9586
9832
  */
9587
9833
  dispatch(to, action, payload) {
9588
- const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
9834
+ var _a;
9835
+ const endpointId = (_a = to.endpointId) !== null && _a !== void 0 ? _a : this.getEndpointIdForOpenFinId(to, action);
9589
9836
  if (endpointId && __classPrivateFieldGet$9(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
9590
9837
  return __classPrivateFieldGet$9(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload);
9591
9838
  }
@@ -9761,12 +10008,13 @@ class ChannelProvider extends channel_1.ChannelBase {
9761
10008
  }
9762
10009
  }
9763
10010
  getEndpointIdForOpenFinId(clientIdentity, action) {
10011
+ var _a;
9764
10012
  const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
9765
10013
  if (matchingConnections.length >= 2) {
9766
10014
  const protectedObj = __classPrivateFieldGet$9(this, _ChannelProvider_protectedObj, "f");
9767
10015
  const { uuid, name } = clientIdentity;
9768
- const providerUuid = protectedObj?.providerIdentity.uuid;
9769
- const providerName = protectedObj?.providerIdentity.name;
10016
+ const providerUuid = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.uuid;
10017
+ const providerName = protectedObj === null || protectedObj === void 0 ? void 0 : protectedObj.providerIdentity.name;
9770
10018
  // eslint-disable-next-line no-console
9771
10019
  console.warn(`WARNING: Dispatch call may have unintended results. The "to" argument of your dispatch call is missing the
9772
10020
  "endpointId" parameter. The identity you are dispatching to ({uuid: ${uuid}, name: ${name}})
@@ -9774,7 +10022,7 @@ class ChannelProvider extends channel_1.ChannelBase {
9774
10022
  ({uuid: ${providerUuid}, name: ${providerName}}) will only be processed by the most recently-created client.`);
9775
10023
  }
9776
10024
  // Pop to return the most recently created endpointId.
9777
- return matchingConnections.pop()?.endpointId;
10025
+ return (_a = matchingConnections.pop()) === null || _a === void 0 ? void 0 : _a.endpointId;
9778
10026
  }
9779
10027
  // eslint-disable-next-line class-methods-use-this
9780
10028
  static clientIdentityIncludesEndpointId(subscriptionIdentity) {
@@ -9791,12 +10039,12 @@ _ChannelProvider_connections = new WeakMap(), _ChannelProvider_protectedObj = ne
9791
10039
  // static #removalMap = new WeakMap<ChannelProvider, Function>();
9792
10040
  ChannelProvider.removalMap = new WeakMap();
9793
10041
 
9794
- var messageReceiver$1 = {};
10042
+ var messageReceiver = {};
9795
10043
 
9796
- Object.defineProperty(messageReceiver$1, "__esModule", { value: true });
9797
- messageReceiver$1.MessageReceiver = void 0;
10044
+ Object.defineProperty(messageReceiver, "__esModule", { value: true });
10045
+ messageReceiver.MessageReceiver = void 0;
9798
10046
  const client_1$1 = client;
9799
- const base_1$h = base$1;
10047
+ const base_1$h = base;
9800
10048
  /*
9801
10049
  This is a singleton (per fin object) tasked with routing messages coming off the ipc to the correct endpoint.
9802
10050
  It needs to be a singleton because there can only be one per wire. It tracks both clients and providers' processAction passed in via the strategy.
@@ -9817,10 +10065,9 @@ class MessageReceiver extends base_1$h.Base {
9817
10065
  wire.registerMessageHandler(this.onmessage.bind(this));
9818
10066
  }
9819
10067
  async processChannelMessage(msg) {
10068
+ var _a, _b;
9820
10069
  const { senderIdentity, providerIdentity, action, ackToSender, payload, intendedTargetIdentity } = msg.payload;
9821
- const key = intendedTargetIdentity.channelId ?? // The recipient is a provider
9822
- intendedTargetIdentity.endpointId ?? // The recipient is a client
9823
- this.latestEndpointIdByChannelId.get(providerIdentity.channelId); // No endpointId was passed, make best attempt
10070
+ const key = (_b = (_a = intendedTargetIdentity.channelId) !== null && _a !== void 0 ? _a : intendedTargetIdentity.endpointId) !== null && _b !== void 0 ? _b : this.latestEndpointIdByChannelId.get(providerIdentity.channelId); // No endpointId was passed, make best attempt
9824
10071
  const handler = this.endpointMap.get(key);
9825
10072
  if (!handler) {
9826
10073
  ackToSender.payload.success = false;
@@ -9865,7 +10112,7 @@ class MessageReceiver extends base_1$h.Base {
9865
10112
  }
9866
10113
  }
9867
10114
  }
9868
- messageReceiver$1.MessageReceiver = MessageReceiver;
10115
+ messageReceiver.MessageReceiver = MessageReceiver;
9869
10116
 
9870
10117
  var protocolManager = {};
9871
10118
 
@@ -9900,9 +10147,12 @@ class ProtocolManager {
9900
10147
  return supported;
9901
10148
  };
9902
10149
  this.getCompatibleProtocols = (providerProtocols, clientOffer) => {
9903
- const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) => providerProtocol.type === clientProtocol.type &&
9904
- clientProtocol.version >= providerProtocol.minimumVersion &&
9905
- providerProtocol.version >= (clientProtocol.minimumVersion ?? 0)));
10150
+ const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) => {
10151
+ var _a;
10152
+ return providerProtocol.type === clientProtocol.type &&
10153
+ clientProtocol.version >= providerProtocol.minimumVersion &&
10154
+ providerProtocol.version >= ((_a = clientProtocol.minimumVersion) !== null && _a !== void 0 ? _a : 0);
10155
+ }));
9906
10156
  return supported.slice(0, clientOffer.maxProtocols);
9907
10157
  };
9908
10158
  }
@@ -9984,12 +10234,12 @@ var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
9984
10234
  Object.defineProperty(connectionManager, "__esModule", { value: true });
9985
10235
  connectionManager.ConnectionManager = void 0;
9986
10236
  const exhaustive_1 = exhaustive;
9987
- const base_1$g = base$1;
10237
+ const base_1$g = base;
9988
10238
  const strategy_1 = strategy$2;
9989
10239
  const strategy_2 = strategy$1;
9990
10240
  const ice_manager_1 = iceManager;
9991
10241
  const provider_1$1 = provider;
9992
- const message_receiver_1 = messageReceiver$1;
10242
+ const message_receiver_1 = messageReceiver;
9993
10243
  const protocol_manager_1 = protocolManager;
9994
10244
  const strategy_3 = strategy;
9995
10245
  class ConnectionManager extends base_1$g.Base {
@@ -10027,7 +10277,7 @@ class ConnectionManager extends base_1$g.Base {
10027
10277
  }
10028
10278
  createProvider(options, providerIdentity) {
10029
10279
  const opts = Object.assign(this.wire.environment.getDefaultChannelOptions().create, options || {});
10030
- const protocols = this.protocolManager.getProviderProtocols(opts?.protocols);
10280
+ const protocols = this.protocolManager.getProviderProtocols(opts === null || opts === void 0 ? void 0 : opts.protocols);
10031
10281
  const createSingleStrategy = (stratType) => {
10032
10282
  switch (stratType) {
10033
10283
  case 'rtc':
@@ -10064,7 +10314,7 @@ class ConnectionManager extends base_1$g.Base {
10064
10314
  return channel;
10065
10315
  }
10066
10316
  async createClientOffer(options) {
10067
- const protocols = this.protocolManager.getClientProtocols(options?.protocols);
10317
+ const protocols = this.protocolManager.getClientProtocols(options === null || options === void 0 ? void 0 : options.protocols);
10068
10318
  let rtcPacket;
10069
10319
  const supportedProtocols = await Promise.all(protocols.map(async (type) => {
10070
10320
  switch (type) {
@@ -10092,13 +10342,14 @@ class ConnectionManager extends base_1$g.Base {
10092
10342
  };
10093
10343
  }
10094
10344
  async createClientStrategy(rtcPacket, routingInfo) {
10345
+ var _a;
10095
10346
  if (!routingInfo.endpointId) {
10096
10347
  routingInfo.endpointId = this.wire.environment.getNextMessageId();
10097
10348
  // For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
10098
10349
  // clients that are in the same context as the newly-connected client.
10099
10350
  __classPrivateFieldGet$8(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
10100
10351
  }
10101
- const answer = routingInfo.answer ?? {
10352
+ const answer = (_a = routingInfo.answer) !== null && _a !== void 0 ? _a : {
10102
10353
  supportedProtocols: [{ type: 'classic', version: 1 }]
10103
10354
  };
10104
10355
  const createStrategyFromAnswer = async (protocol) => {
@@ -10156,7 +10407,7 @@ class ConnectionManager extends base_1$g.Base {
10156
10407
  if (!(provider instanceof provider_1$1.ChannelProvider)) {
10157
10408
  throw Error('Cannot connect to a channel client');
10158
10409
  }
10159
- const offer = clientOffer ?? {
10410
+ const offer = clientOffer !== null && clientOffer !== void 0 ? clientOffer : {
10160
10411
  supportedProtocols: [{ type: 'classic', version: 1 }],
10161
10412
  maxProtocols: 1
10162
10413
  };
@@ -10214,15 +10465,6 @@ class ConnectionManager extends base_1$g.Base {
10214
10465
  connectionManager.ConnectionManager = ConnectionManager;
10215
10466
  _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnectionManager = new WeakMap();
10216
10467
 
10217
- /**
10218
- * Entry points for the `Channel` subset of the `InterApplicationBus` API (`fin.InterApplicationBus.Channel`).
10219
- *
10220
- * * {@link Channel} contains static members of the `Channel` API, accessible through `fin.InterApplicationBus.Channel`.
10221
- * * {@link OpenFin.ChannelClient} describes a client of a channel, e.g. as returned by `fin.InterApplicationBus.Channel.connect`.
10222
- * * {@link OpenFin.ChannelProvider} describes a provider of a channel, e.g. as returned by `fin.InterApplicationBus.Channel.create`.
10223
- *
10224
- * @packageDocumentation
10225
- */
10226
10468
  var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
10227
10469
  if (kind === "m") throw new TypeError("Private method is not writable");
10228
10470
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -10238,9 +10480,9 @@ var _Channel_connectionManager, _Channel_internalEmitter, _Channel_readyToConnec
10238
10480
  Object.defineProperty(channel$1, "__esModule", { value: true });
10239
10481
  channel$1.Channel = void 0;
10240
10482
  /* eslint-disable no-console */
10241
- const events_1$5 = require$$0;
10483
+ const events_1$5 = eventsExports;
10242
10484
  const lazy_1$1 = lazy;
10243
- const base_1$f = base$1;
10485
+ const base_1$f = base;
10244
10486
  const client_1 = client;
10245
10487
  const connection_manager_1 = connectionManager;
10246
10488
  const provider_1 = provider;
@@ -10558,15 +10800,8 @@ _Channel_connectionManager = new WeakMap(), _Channel_internalEmitter = new WeakM
10558
10800
 
10559
10801
  Object.defineProperty(interappbus, "__esModule", { value: true });
10560
10802
  interappbus.InterAppPayload = interappbus.InterApplicationBus = void 0;
10561
- /**
10562
- * Entry point for the OpenFin `InterApplicationBus` API (`fin.InterApplicationBus`).
10563
- *
10564
- * * {@link InterApplicationBus} contains static members of the `InterApplicationBus` API, accessible through `fin.InterApplicationBus`.
10565
- *
10566
- * @packageDocumentation
10567
- */
10568
- const events_1$4 = require$$0;
10569
- const base_1$e = base$1;
10803
+ const events_1$4 = eventsExports;
10804
+ const base_1$e = base;
10570
10805
  const ref_counter_1 = refCounter;
10571
10806
  const index_1$2 = channel$1;
10572
10807
  const validate_1$3 = validate;
@@ -10773,16 +11008,9 @@ function createKey(...toHash) {
10773
11008
 
10774
11009
  var clipboard = {};
10775
11010
 
10776
- /**
10777
- * Entry point for the OpenFin `Clipboard` API (`fin.Clipboard`).
10778
- *
10779
- * * {@link Clipboard} contains static members of the `Clipboard` API, accessible through `fin.Clipboard`.
10780
- *
10781
- * @packageDocumentation
10782
- */
10783
11011
  Object.defineProperty(clipboard, "__esModule", { value: true });
10784
11012
  clipboard.Clipboard = void 0;
10785
- const base_1$d = base$1;
11013
+ const base_1$d = base;
10786
11014
  /**
10787
11015
  * @PORTED
10788
11016
  * WriteRequestType interface
@@ -10981,7 +11209,7 @@ class Clipboard extends base_1$d.Base {
10981
11209
  }
10982
11210
  clipboard.Clipboard = Clipboard;
10983
11211
 
10984
- var externalApplication$1 = {};
11212
+ var externalApplication = {};
10985
11213
 
10986
11214
  var Factory$5 = {};
10987
11215
 
@@ -10990,7 +11218,7 @@ var Instance$4 = {};
10990
11218
  Object.defineProperty(Instance$4, "__esModule", { value: true });
10991
11219
  Instance$4.ExternalApplication = void 0;
10992
11220
  /* eslint-disable import/prefer-default-export */
10993
- const base_1$c = base$1;
11221
+ const base_1$c = base;
10994
11222
  /**
10995
11223
  * An ExternalApplication object representing native language adapter connections to the runtime. Allows
10996
11224
  * the developer to listen to {@link OpenFin.ExternalApplicationEvents external application events}.
@@ -11106,7 +11334,7 @@ Instance$4.ExternalApplication = ExternalApplication;
11106
11334
 
11107
11335
  Object.defineProperty(Factory$5, "__esModule", { value: true });
11108
11336
  Factory$5.ExternalApplicationModule = void 0;
11109
- const base_1$b = base$1;
11337
+ const base_1$b = base;
11110
11338
  const Instance_1$4 = Instance$4;
11111
11339
  /**
11112
11340
  * Static namespace for OpenFin API methods that interact with the {@link ExternalApplication} class, available under `fin.ExternalApplication`.
@@ -11170,9 +11398,9 @@ Factory$5.ExternalApplicationModule = ExternalApplicationModule;
11170
11398
  };
11171
11399
  Object.defineProperty(exports, "__esModule", { value: true });
11172
11400
  /**
11173
- * Entry points for the OpenFin `ExternalApplication` API (`fin.ExternalApplication`).
11401
+ * Entry points for the OpenFin `ExternalApplication` API.
11174
11402
  *
11175
- * * {@link ExternalApplicationModule} contains static members of the `ExternalApplication` type, accessible through `fin.ExternalApplication`.
11403
+ * * {@link ExternalApplicationModule} contains static methods relating to the `ExternalApplication` type, accessible through `fin.ExternalApplication`.
11176
11404
  * * {@link ExternalApplication} describes an instance of an OpenFin ExternalApplication, e.g. as returned by `fin.ExternalApplication.getCurrent`.
11177
11405
  *
11178
11406
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -11181,10 +11409,10 @@ Factory$5.ExternalApplicationModule = ExternalApplicationModule;
11181
11409
  * @packageDocumentation
11182
11410
  */
11183
11411
  __exportStar(Factory$5, exports);
11184
- __exportStar(Instance$4, exports);
11185
- } (externalApplication$1));
11412
+ __exportStar(Instance$4, exports);
11413
+ } (externalApplication));
11186
11414
 
11187
- var frame$1 = {};
11415
+ var frame = {};
11188
11416
 
11189
11417
  var Factory$4 = {};
11190
11418
 
@@ -11193,7 +11421,7 @@ var Instance$3 = {};
11193
11421
  Object.defineProperty(Instance$3, "__esModule", { value: true });
11194
11422
  Instance$3._Frame = void 0;
11195
11423
  /* eslint-disable import/prefer-default-export */
11196
- const base_1$a = base$1;
11424
+ const base_1$a = base;
11197
11425
  /**
11198
11426
  * An iframe represents an embedded HTML page within a parent HTML page. Because this embedded page
11199
11427
  * has its own DOM and global JS context (which may or may not be linked to that of the parent depending
@@ -11335,7 +11563,7 @@ Instance$3._Frame = _Frame;
11335
11563
 
11336
11564
  Object.defineProperty(Factory$4, "__esModule", { value: true });
11337
11565
  Factory$4._FrameModule = void 0;
11338
- const base_1$9 = base$1;
11566
+ const base_1$9 = base;
11339
11567
  const validate_1$2 = validate;
11340
11568
  const Instance_1$3 = Instance$3;
11341
11569
  /**
@@ -11421,9 +11649,9 @@ Factory$4._FrameModule = _FrameModule;
11421
11649
 
11422
11650
  (function (exports) {
11423
11651
  /**
11424
- * Entry points for the OpenFin `Frame` API (`fin.Frame`).
11652
+ * Entry points for the OpenFin `Frame` API.
11425
11653
  *
11426
- * * {@link _FrameModule} contains static members of the `Frame` API, accessible through `fin.Frame`.
11654
+ * * {@link _FrameModule} contains static methods relating to the `Frame` type, accessible through `fin.Frame`.
11427
11655
  * * {@link _Frame} describes an instance of an OpenFin Frame, e.g. as returned by `fin.Frame.getCurrent`.
11428
11656
  *
11429
11657
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -11449,14 +11677,14 @@ Factory$4._FrameModule = _FrameModule;
11449
11677
  };
11450
11678
  Object.defineProperty(exports, "__esModule", { value: true });
11451
11679
  __exportStar(Factory$4, exports);
11452
- __exportStar(Instance$3, exports);
11453
- } (frame$1));
11680
+ __exportStar(Instance$3, exports);
11681
+ } (frame));
11454
11682
 
11455
- var globalHotkey$1 = {};
11683
+ var globalHotkey = {};
11456
11684
 
11457
- Object.defineProperty(globalHotkey$1, "__esModule", { value: true });
11458
- globalHotkey$1.GlobalHotkey = void 0;
11459
- const base_1$8 = base$1;
11685
+ Object.defineProperty(globalHotkey, "__esModule", { value: true });
11686
+ globalHotkey.GlobalHotkey = void 0;
11687
+ const base_1$8 = base;
11460
11688
  /**
11461
11689
  * The GlobalHotkey module can register/unregister a global hotkeys.
11462
11690
  *
@@ -11472,8 +11700,6 @@ class GlobalHotkey extends base_1$8.EmitterBase {
11472
11700
  * Registers a global hotkey with the operating system.
11473
11701
  * @param hotkey a hotkey string
11474
11702
  * @param listener called when the registered hotkey is pressed by the user.
11475
- * @throws If the `hotkey` is reserved, see list below.
11476
- * @throws if the `hotkey` is already registered by another application.
11477
11703
  *
11478
11704
  * @remarks The `hotkey` parameter expects an electron compatible [accelerator](https://github.com/electron/electron/blob/master/docs/api/accelerator.md) and the `listener` will be called if the `hotkey` is pressed by the user.
11479
11705
  * If successfull, the hotkey will be 'claimed' by the application, meaning that this register call can be called multiple times from within the same application but will fail if another application has registered the hotkey.
@@ -11566,7 +11792,7 @@ class GlobalHotkey extends base_1$8.EmitterBase {
11566
11792
  return undefined;
11567
11793
  }
11568
11794
  /**
11569
- * Checks if a given hotkey has been registered by an application within the current runtime.
11795
+ * Checks if a given hotkey has been registered
11570
11796
  * @param hotkey a hotkey string
11571
11797
  *
11572
11798
  * @example
@@ -11587,9 +11813,9 @@ class GlobalHotkey extends base_1$8.EmitterBase {
11587
11813
  return data;
11588
11814
  }
11589
11815
  }
11590
- globalHotkey$1.GlobalHotkey = GlobalHotkey;
11816
+ globalHotkey.GlobalHotkey = GlobalHotkey;
11591
11817
 
11592
- var platform$1 = {};
11818
+ var platform = {};
11593
11819
 
11594
11820
  var Factory$3 = {};
11595
11821
 
@@ -11604,14 +11830,16 @@ var _Platform_connectToProvider;
11604
11830
  Object.defineProperty(Instance$2, "__esModule", { value: true });
11605
11831
  Instance$2.Platform = void 0;
11606
11832
  /* eslint-disable import/prefer-default-export, no-undef */
11607
- const base_1$7 = base$1;
11833
+ const base_1$7 = base;
11608
11834
  const validate_1$1 = validate;
11609
11835
  // Reuse clients to avoid overwriting already-registered client in provider
11610
11836
  const clientMap = new Map();
11611
11837
  /** Manages the life cycle of windows and views in the application.
11612
11838
  *
11613
- * Enables taking snapshots of itself and applying them to restore a previous configuration
11839
+ * Enables taking snapshots of itself and applyi
11840
+ * ng them to restore a previous configuration
11614
11841
  * as well as listen to {@link OpenFin.PlatformEvents platform events}.
11842
+ *
11615
11843
  */
11616
11844
  class Platform extends base_1$7.EmitterBase {
11617
11845
  /**
@@ -11977,6 +12205,7 @@ class Platform extends base_1$7.EmitterBase {
11977
12205
  *
11978
12206
  */
11979
12207
  async reparentView(viewIdentity, target) {
12208
+ var _a;
11980
12209
  // eslint-disable-next-line no-console
11981
12210
  console.warn('Platform.reparentView has been deprecated, please use Platform.createView');
11982
12211
  this.wire.sendAction('platform-reparent-view', this.identity).catch((e) => {
@@ -11984,7 +12213,7 @@ class Platform extends base_1$7.EmitterBase {
11984
12213
  });
11985
12214
  const normalizedViewIdentity = {
11986
12215
  ...viewIdentity,
11987
- uuid: viewIdentity.uuid ?? this.identity.uuid
12216
+ uuid: (_a = viewIdentity.uuid) !== null && _a !== void 0 ? _a : this.identity.uuid
11988
12217
  };
11989
12218
  const view = await this.fin.View.wrap(normalizedViewIdentity);
11990
12219
  const viewOptions = await view.getOptions();
@@ -12463,7 +12692,7 @@ Object.defineProperty(Instance$1, "__esModule", { value: true });
12463
12692
  Instance$1.Layout = void 0;
12464
12693
  const lazy_1 = lazy;
12465
12694
  const validate_1 = validate;
12466
- const base_1$6 = base$1;
12695
+ const base_1$6 = base;
12467
12696
  const common_utils_1 = commonUtils;
12468
12697
  const layout_entities_1 = layoutEntities;
12469
12698
  const layout_constants_1 = layout_constants;
@@ -12772,30 +13001,10 @@ class Layout extends base_1$6.Base {
12772
13001
  // don't expose
12773
13002
  });
12774
13003
  const client = await this.platform.getClient();
12775
- console.log(`Layout::toConfig() called!`);
12776
13004
  return client.dispatch('get-frame-snapshot', {
12777
13005
  target: this.identity
12778
13006
  });
12779
13007
  }
12780
- /**
12781
- * Retrieves the attached views in current window layout.
12782
- *
12783
- * @example
12784
- * ```js
12785
- * const layout = fin.Platform.Layout.getCurrentSync();
12786
- * const views = await layout.getCurrentViews();
12787
- * ```
12788
- */
12789
- async getCurrentViews() {
12790
- this.wire.sendAction('layout-get-views').catch((e) => {
12791
- // don't expose
12792
- });
12793
- const client = await this.platform.getClient();
12794
- const viewIdentities = await client.dispatch('get-layout-views', {
12795
- target: this.identity
12796
- });
12797
- return viewIdentities.map((identity) => this.fin.View.wrapSync(identity));
12798
- }
12799
13008
  /**
12800
13009
  * Retrieves the top level content item of the layout.
12801
13010
  *
@@ -12822,7 +13031,7 @@ class Layout extends base_1$6.Base {
12822
13031
  // don't expose
12823
13032
  });
12824
13033
  const client = await __classPrivateFieldGet$5(this, _Layout_layoutClient, "f").getValue();
12825
- const root = await client.getRoot(this.identity);
13034
+ const root = await client.getRoot();
12826
13035
  return layout_entities_1.LayoutNode.getEntity(root, client);
12827
13036
  }
12828
13037
  }
@@ -12840,11 +13049,11 @@ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
12840
13049
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
12841
13050
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12842
13051
  };
12843
- var _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager;
13052
+ var _LayoutModule_layoutInitializationAttempted;
12844
13053
  Object.defineProperty(Factory$2, "__esModule", { value: true });
12845
13054
  Factory$2.LayoutModule = void 0;
12846
13055
  /* eslint-disable no-undef, import/prefer-default-export */
12847
- const base_1$5 = base$1;
13056
+ const base_1$5 = base;
12848
13057
  const Instance_1$2 = Instance$1;
12849
13058
  /**
12850
13059
  * Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
@@ -12853,7 +13062,6 @@ class LayoutModule extends base_1$5.Base {
12853
13062
  constructor() {
12854
13063
  super(...arguments);
12855
13064
  _LayoutModule_layoutInitializationAttempted.set(this, false);
12856
- _LayoutModule_layoutManager.set(this, null);
12857
13065
  /**
12858
13066
  * Initialize the window's Layout.
12859
13067
  *
@@ -12903,17 +13111,7 @@ class LayoutModule extends base_1$5.Base {
12903
13111
  throw new Error('Layout for this window already initialized, please use Layout.replace call to replace the layout.');
12904
13112
  }
12905
13113
  __classPrivateFieldSet$4(this, _LayoutModule_layoutInitializationAttempted, true, "f");
12906
- // TODO: remove this.wire and always use this.fin
12907
- __classPrivateFieldSet$4(this, _LayoutModule_layoutManager, await this.wire.environment.initLayout(this.fin, this.wire, options), "f");
12908
- // TODO: if create() wasn't called, warn!! aka, if lm.getLayouts().length === 0
12909
- const layoutInstance = await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").resolveLayout();
12910
- const layout = this.wrapSync(layoutInstance.identity);
12911
- // Adding this to the returned instance undocumented/typed for Browser
12912
- // TODO: if not overridden, then return layoutManager: layoutInstance
12913
- return Object.assign(layout, { layoutManager: layoutInstance });
12914
- };
12915
- this.getCurrentLayoutManagerSync = () => {
12916
- return __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f");
13114
+ return this.wire.environment.initLayout(this.fin, this.wire, options);
12917
13115
  };
12918
13116
  }
12919
13117
  /**
@@ -13011,13 +13209,13 @@ class LayoutModule extends base_1$5.Base {
13011
13209
  }
13012
13210
  }
13013
13211
  Factory$2.LayoutModule = LayoutModule;
13014
- _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap();
13212
+ _LayoutModule_layoutInitializationAttempted = new WeakMap();
13015
13213
 
13016
13214
  (function (exports) {
13017
13215
  /**
13018
- * Entry point for the OpenFin `Layout` subset of the `Platform` API (`fin.Platform.Layout`).
13216
+ * Entry point for the OpenFin `Layout` namespace.
13019
13217
  *
13020
- * * {@link LayoutModule} contains static members of the `Layout` API, accessible through `fin.Platform.Layout`.
13218
+ * * {@link LayoutModule} contains static methods relating to the `Layout` type, accessible through `fin.Platform.Layout`.
13021
13219
  * * {@link Layout} describes an instance of an OpenFin Layout, e.g. as returned by `fin.Platform.Layout.getCurrent`.
13022
13220
  *
13023
13221
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -13042,12 +13240,12 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layou
13042
13240
  };
13043
13241
  Object.defineProperty(exports, "__esModule", { value: true });
13044
13242
  __exportStar(Factory$2, exports);
13045
- __exportStar(Instance$1, exports);
13243
+ __exportStar(Instance$1, exports);
13046
13244
  } (layout));
13047
13245
 
13048
13246
  Object.defineProperty(Factory$3, "__esModule", { value: true });
13049
13247
  Factory$3.PlatformModule = void 0;
13050
- const base_1$4 = base$1;
13248
+ const base_1$4 = base;
13051
13249
  const Instance_1$1 = Instance$2;
13052
13250
  const index_1$1 = layout;
13053
13251
  /**
@@ -13296,9 +13494,9 @@ Factory$3.PlatformModule = PlatformModule;
13296
13494
  };
13297
13495
  Object.defineProperty(exports, "__esModule", { value: true });
13298
13496
  /**
13299
- * Entry points for the OpenFin `Platform` API (`fin.Platform`)
13497
+ * Entry points for the OpenFin `Platform` API.
13300
13498
  *
13301
- * * {@link PlatformModule} contains static members of the `Platform` API, accessible through `fin.Platform`.
13499
+ * * {@link PlatformModule} contains static methods relating to the `Platform` type, accessible through `fin.Platform`.
13302
13500
  * * {@link Platform} describes an instance of an OpenFin Platform, e.g. as returned by `fin.Platform.getCurrent`.
13303
13501
  *
13304
13502
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -13307,8 +13505,8 @@ Factory$3.PlatformModule = PlatformModule;
13307
13505
  * @packageDocumentation
13308
13506
  */
13309
13507
  __exportStar(Factory$3, exports);
13310
- __exportStar(Instance$2, exports);
13311
- } (platform$1));
13508
+ __exportStar(Instance$2, exports);
13509
+ } (platform));
13312
13510
 
13313
13511
  var me = {};
13314
13512
 
@@ -13316,9 +13514,9 @@ var me = {};
13316
13514
  Object.defineProperty(exports, "__esModule", { value: true });
13317
13515
  exports.getMe = exports.getBaseMe = exports.environmentUnsupportedMessage = void 0;
13318
13516
  const view_1 = requireView();
13319
- const frame_1 = frame$1;
13517
+ const frame_1 = frame;
13320
13518
  const window_1 = requireWindow();
13321
- const external_application_1 = externalApplication$1;
13519
+ const external_application_1 = externalApplication;
13322
13520
  exports.environmentUnsupportedMessage = 'You are not running in OpenFin.';
13323
13521
  function getBaseMe(entityType, uuid, name) {
13324
13522
  const entityTypeHelpers = {
@@ -13445,7 +13643,7 @@ var me = {};
13445
13643
  };
13446
13644
  }
13447
13645
  }
13448
- exports.getMe = getMe;
13646
+ exports.getMe = getMe;
13449
13647
  } (me));
13450
13648
 
13451
13649
  var interop = {};
@@ -13548,8 +13746,9 @@ function requireSessionContextGroupBroker () {
13548
13746
  this.lastContext = context;
13549
13747
  const clientSubscriptionStates = Array.from(this.clients.values());
13550
13748
  clientSubscriptionStates.forEach((client) => {
13749
+ var _a;
13551
13750
  // eslint-disable-next-line no-unused-expressions
13552
- client.contextHandlers.get(context.type)?.forEach((handlerId) => {
13751
+ (_a = client.contextHandlers.get(context.type)) === null || _a === void 0 ? void 0 : _a.forEach((handlerId) => {
13553
13752
  this.provider.dispatch(client.clientIdentity, handlerId, context);
13554
13753
  });
13555
13754
  if (client.globalHandler) {
@@ -13683,7 +13882,7 @@ var utils$1 = {};
13683
13882
  }
13684
13883
  };
13685
13884
  };
13686
- exports.wrapIntentHandler = wrapIntentHandler;
13885
+ exports.wrapIntentHandler = wrapIntentHandler;
13687
13886
  } (utils$1));
13688
13887
 
13689
13888
  var PrivateChannelProvider = {};
@@ -13978,7 +14177,7 @@ function requireInteropBroker () {
13978
14177
  hasRequiredInteropBroker = 1;
13979
14178
  Object.defineProperty(InteropBroker, "__esModule", { value: true });
13980
14179
  InteropBroker.InteropBroker = void 0;
13981
- const base_1 = base$1;
14180
+ const base_1 = base;
13982
14181
  const SessionContextGroupBroker_1 = requireSessionContextGroupBroker();
13983
14182
  const utils_1 = utils$1;
13984
14183
  const lodash_1 = require$$3;
@@ -14156,10 +14355,10 @@ function requireInteropBroker () {
14156
14355
  this.getProvider = getProvider;
14157
14356
  this.interopClients = new Map();
14158
14357
  this.contextGroupsById = new Map();
14159
- if (options?.contextGroups) {
14358
+ if (options === null || options === void 0 ? void 0 : options.contextGroups) {
14160
14359
  contextGroups = options.contextGroups;
14161
14360
  }
14162
- if (options?.logging) {
14361
+ if (options === null || options === void 0 ? void 0 : options.logging) {
14163
14362
  this.logging = options.logging;
14164
14363
  }
14165
14364
  this.intentClientMap = new Map();
@@ -14294,17 +14493,18 @@ function requireInteropBroker () {
14294
14493
  *
14295
14494
  */
14296
14495
  getCurrentContext(getCurrentContextOptions, clientIdentity) {
14496
+ var _a;
14297
14497
  this.wire.sendAction('interop-broker-get-current-context').catch((e) => {
14298
14498
  // don't expose, analytics-only call
14299
14499
  });
14300
14500
  const clientState = this.getClientState(clientIdentity);
14301
- if (!clientState?.contextGroupId) {
14501
+ if (!(clientState === null || clientState === void 0 ? void 0 : clientState.contextGroupId)) {
14302
14502
  throw new Error('You must be a member of a context group to call getCurrentContext');
14303
14503
  }
14304
14504
  const { contextGroupId } = clientState;
14305
14505
  const contextGroupState = this.contextGroupsById.get(contextGroupId);
14306
14506
  const lastContextType = this.lastContextMap.get(contextGroupId);
14307
- const contextType = getCurrentContextOptions?.contextType ?? lastContextType;
14507
+ const contextType = (_a = getCurrentContextOptions === null || getCurrentContextOptions === void 0 ? void 0 : getCurrentContextOptions.contextType) !== null && _a !== void 0 ? _a : lastContextType;
14308
14508
  return contextGroupState && contextType ? contextGroupState.get(contextType) : undefined;
14309
14509
  }
14310
14510
  /*
@@ -14955,9 +15155,10 @@ function requireInteropBroker () {
14955
15155
  }
14956
15156
  // Used to restore interop broker state in snapshots.
14957
15157
  applySnapshot(snapshot, options) {
14958
- const contextGroupStates = snapshot?.interopSnapshotDetails?.contextGroupStates;
15158
+ var _a;
15159
+ const contextGroupStates = (_a = snapshot === null || snapshot === void 0 ? void 0 : snapshot.interopSnapshotDetails) === null || _a === void 0 ? void 0 : _a.contextGroupStates;
14959
15160
  if (contextGroupStates) {
14960
- if (!options?.closeExistingWindows) {
15161
+ if (!(options === null || options === void 0 ? void 0 : options.closeExistingWindows)) {
14961
15162
  this.updateExistingClients(contextGroupStates);
14962
15163
  }
14963
15164
  this.rehydrateContextGroupStates(contextGroupStates);
@@ -15008,7 +15209,7 @@ function requireInteropBroker () {
15008
15209
  contextHandlerRegistered({ contextType, handlerId }, clientIdentity) {
15009
15210
  const handlerInfo = { contextType, handlerId };
15010
15211
  const clientState = this.getClientState(clientIdentity);
15011
- clientState?.contextHandlers.set(handlerId, handlerInfo);
15212
+ clientState === null || clientState === void 0 ? void 0 : clientState.contextHandlers.set(handlerId, handlerInfo);
15012
15213
  if (clientState && clientState.contextGroupId) {
15013
15214
  const { contextGroupId } = clientState;
15014
15215
  const contextGroupMap = this.contextGroupsById.get(contextGroupId);
@@ -15030,7 +15231,7 @@ function requireInteropBroker () {
15030
15231
  async intentHandlerRegistered(payload, clientIdentity) {
15031
15232
  const { handlerId } = payload;
15032
15233
  const clientIntentInfo = this.intentClientMap.get(clientIdentity.name);
15033
- const handlerInfo = clientIntentInfo?.get(handlerId);
15234
+ const handlerInfo = clientIntentInfo === null || clientIntentInfo === void 0 ? void 0 : clientIntentInfo.get(handlerId);
15034
15235
  if (!clientIntentInfo) {
15035
15236
  this.intentClientMap.set(clientIdentity.name, new Map());
15036
15237
  const newHandlerInfoMap = this.intentClientMap.get(clientIdentity.name);
@@ -15199,8 +15400,8 @@ function requireInteropBroker () {
15199
15400
  clientIdentity
15200
15401
  };
15201
15402
  // Only allow the client to join a contextGroup that actually exists.
15202
- if (payload?.currentContextGroup && this.contextGroupsById.has(payload.currentContextGroup)) {
15203
- clientSubscriptionState.contextGroupId = payload?.currentContextGroup;
15403
+ if ((payload === null || payload === void 0 ? void 0 : payload.currentContextGroup) && this.contextGroupsById.has(payload.currentContextGroup)) {
15404
+ clientSubscriptionState.contextGroupId = payload === null || payload === void 0 ? void 0 : payload.currentContextGroup;
15204
15405
  }
15205
15406
  this.interopClients.set(clientIdentity.endpointId, clientSubscriptionState);
15206
15407
  });
@@ -15218,15 +15419,17 @@ function requireInteropBroker () {
15218
15419
  this.clientDisconnected(clientIdentity);
15219
15420
  });
15220
15421
  channel.beforeAction(async (action, payload, clientIdentity) => {
15422
+ var _a, _b;
15221
15423
  if (!(await this.isActionAuthorized(action, payload, clientIdentity))) {
15222
15424
  throw new Error(`Action (${action}) not authorized for ${clientIdentity.uuid}, ${clientIdentity.name}`);
15223
15425
  }
15224
- if (this.logging?.beforeAction?.enabled) {
15426
+ if ((_b = (_a = this.logging) === null || _a === void 0 ? void 0 : _a.beforeAction) === null || _b === void 0 ? void 0 : _b.enabled) {
15225
15427
  console.log(action, payload, clientIdentity);
15226
15428
  }
15227
15429
  });
15228
15430
  channel.afterAction((action, payload, clientIdentity) => {
15229
- if (this.logging?.afterAction?.enabled) {
15431
+ var _a, _b;
15432
+ if ((_b = (_a = this.logging) === null || _a === void 0 ? void 0 : _a.afterAction) === null || _b === void 0 ? void 0 : _b.enabled) {
15230
15433
  console.log(action, payload, clientIdentity);
15231
15434
  }
15232
15435
  });
@@ -15308,7 +15511,7 @@ var __classPrivateFieldGet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateF
15308
15511
  };
15309
15512
  var _SessionContextGroupClient_clientPromise;
15310
15513
  Object.defineProperty(SessionContextGroupClient$1, "__esModule", { value: true });
15311
- const base_1$3 = base$1;
15514
+ const base_1$3 = base;
15312
15515
  const utils_1$3 = utils$1;
15313
15516
  class SessionContextGroupClient extends base_1$3.Base {
15314
15517
  constructor(wire, client, id) {
@@ -15395,7 +15598,7 @@ var __classPrivateFieldGet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateF
15395
15598
  var _InteropClient_clientPromise, _InteropClient_sessionContextGroups;
15396
15599
  Object.defineProperty(InteropClient$1, "__esModule", { value: true });
15397
15600
  InteropClient$1.InteropClient = void 0;
15398
- const base_1$2 = base$1;
15601
+ const base_1$2 = base;
15399
15602
  const SessionContextGroupClient_1 = SessionContextGroupClient$1;
15400
15603
  const utils_1$2 = utils$1;
15401
15604
  /**
@@ -16064,45 +16267,39 @@ class InteropClient extends base_1$2.Base {
16064
16267
  InteropClient$1.InteropClient = InteropClient;
16065
16268
  _InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap();
16066
16269
 
16067
- var overrideCheck = {};
16270
+ var overrideCheck$1 = {};
16068
16271
 
16069
- var hasRequiredOverrideCheck;
16070
-
16071
- function requireOverrideCheck () {
16072
- if (hasRequiredOverrideCheck) return overrideCheck;
16073
- hasRequiredOverrideCheck = 1;
16074
- Object.defineProperty(overrideCheck, "__esModule", { value: true });
16075
- overrideCheck.overrideCheck = overrideCheck.getDefaultViewFdc3VersionFromAppInfo = void 0;
16076
- const InteropBroker_1 = requireInteropBroker();
16077
- function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
16078
- const setVersion = manifest.platform?.defaultViewOptions?.fdc3InteropApi ?? initialOptions.defaultViewOptions?.fdc3InteropApi;
16079
- return ['1.2', '2.0'].includes(setVersion ?? '') ? setVersion : undefined;
16080
- }
16081
- overrideCheck.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
16082
- // TODO: Unit test this
16083
- function overrideCheck$1(overriddenBroker, fdc3InteropApi) {
16084
- if (fdc3InteropApi && fdc3InteropApi === '2.0') {
16085
- const mustOverrideAPIs = [
16086
- 'fdc3HandleFindInstances',
16087
- 'handleInfoForIntent',
16088
- 'handleInfoForIntentsByContext',
16089
- 'fdc3HandleGetAppMetadata',
16090
- 'fdc3HandleGetInfo',
16091
- 'fdc3HandleOpen',
16092
- 'handleFiredIntent',
16093
- 'handleFiredIntentForContext'
16094
- ];
16095
- const notOverridden = mustOverrideAPIs.filter((api) => {
16096
- return overriddenBroker[api] === InteropBroker_1.InteropBroker.prototype[api];
16097
- });
16098
- if (notOverridden.length > 0) {
16099
- console.warn(`WARNING: FDC3 2.0 has been set as a default option for Views in this Platform, but the required InteropBroker APIs for FDC3 2.0 compliance have not all been overridden.\nThe following APIs need to be overridden:\n${notOverridden.join('\n')}`);
16100
- }
16101
- }
16102
- }
16103
- overrideCheck.overrideCheck = overrideCheck$1;
16104
- return overrideCheck;
16272
+ Object.defineProperty(overrideCheck$1, "__esModule", { value: true });
16273
+ overrideCheck$1.overrideCheck = overrideCheck$1.getDefaultViewFdc3VersionFromAppInfo = void 0;
16274
+ const InteropBroker_1 = requireInteropBroker();
16275
+ function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
16276
+ var _a, _b, _c, _d;
16277
+ const setVersion = (_c = (_b = (_a = manifest.platform) === null || _a === void 0 ? void 0 : _a.defaultViewOptions) === null || _b === void 0 ? void 0 : _b.fdc3InteropApi) !== null && _c !== void 0 ? _c : (_d = initialOptions.defaultViewOptions) === null || _d === void 0 ? void 0 : _d.fdc3InteropApi;
16278
+ return ['1.2', '2.0'].includes(setVersion !== null && setVersion !== void 0 ? setVersion : '') ? setVersion : undefined;
16279
+ }
16280
+ overrideCheck$1.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
16281
+ // TODO: Unit test this
16282
+ function overrideCheck(overriddenBroker, fdc3InteropApi) {
16283
+ if (fdc3InteropApi && fdc3InteropApi === '2.0') {
16284
+ const mustOverrideAPIs = [
16285
+ 'fdc3HandleFindInstances',
16286
+ 'handleInfoForIntent',
16287
+ 'handleInfoForIntentsByContext',
16288
+ 'fdc3HandleGetAppMetadata',
16289
+ 'fdc3HandleGetInfo',
16290
+ 'fdc3HandleOpen',
16291
+ 'handleFiredIntent',
16292
+ 'handleFiredIntentForContext'
16293
+ ];
16294
+ const notOverridden = mustOverrideAPIs.filter((api) => {
16295
+ return overriddenBroker[api] === InteropBroker_1.InteropBroker.prototype[api];
16296
+ });
16297
+ if (notOverridden.length > 0) {
16298
+ console.warn(`WARNING: FDC3 2.0 has been set as a default option for Views in this Platform, but the required InteropBroker APIs for FDC3 2.0 compliance have not all been overridden.\nThe following APIs need to be overridden:\n${notOverridden.join('\n')}`);
16299
+ }
16300
+ }
16105
16301
  }
16302
+ overrideCheck$1.overrideCheck = overrideCheck;
16106
16303
 
16107
16304
  var hasRequiredFactory;
16108
16305
 
@@ -16113,10 +16310,10 @@ function requireFactory () {
16113
16310
  Factory$1.InteropModule = void 0;
16114
16311
  const lodash_1 = require$$3;
16115
16312
  const inaccessibleObject_1 = inaccessibleObject;
16116
- const base_1 = base$1;
16313
+ const base_1 = base;
16117
16314
  const InteropBroker_1 = requireInteropBroker();
16118
16315
  const InteropClient_1 = InteropClient$1;
16119
- const overrideCheck_1 = requireOverrideCheck();
16316
+ const overrideCheck_1 = overrideCheck$1;
16120
16317
  const common_utils_1 = commonUtils;
16121
16318
  const defaultOverride = (Class) => new Class();
16122
16319
  const BrokerParamAccessError = 'You have attempted to use or modify InteropBroker parameters, which is not allowed. You are likely using an older InteropBroker override scheme. Please consult our Interop docs for guidance on migrating to the new override scheme.';
@@ -16149,12 +16346,13 @@ function requireFactory () {
16149
16346
  * ```
16150
16347
  */
16151
16348
  async init(name, override = defaultOverride) {
16349
+ var _a;
16152
16350
  this.wire.sendAction('interop-init').catch(() => {
16153
16351
  // don't expose, analytics-only call
16154
16352
  });
16155
16353
  // Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
16156
16354
  const options = await this.fin.Application.getCurrentSync().getInfo();
16157
- const opts = options.initialOptions.interopBrokerConfiguration ?? {};
16355
+ const opts = (_a = options.initialOptions.interopBrokerConfiguration) !== null && _a !== void 0 ? _a : {};
16158
16356
  const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
16159
16357
  const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(opts));
16160
16358
  let provider;
@@ -16222,9 +16420,9 @@ function requireInterop () {
16222
16420
  hasRequiredInterop = 1;
16223
16421
  (function (exports) {
16224
16422
  /**
16225
- * Entry point for the OpenFin `Interop` API (`fin.Interop`).
16423
+ * Entry point for the OpenFin Interop namespace.
16226
16424
  *
16227
- * * {@link InteropModule} contains static members of the `Interop` API (available under `fin.Interop`)
16425
+ * * {@link InteropModule} contains static members of the `Interop` namespace (available under `fin.Interop`)
16228
16426
  * * {@link InteropClient} and {@link InteropBroker} document instances of their respective classes.
16229
16427
  *
16230
16428
  * @packageDocumentation
@@ -16246,8 +16444,8 @@ function requireInterop () {
16246
16444
  Object.defineProperty(exports, "__esModule", { value: true });
16247
16445
  __exportStar(requireFactory(), exports);
16248
16446
  __exportStar(InteropClient$1, exports);
16249
- __exportStar(requireInteropBroker(), exports);
16250
- } (interop));
16447
+ __exportStar(requireInteropBroker(), exports);
16448
+ } (interop));
16251
16449
  return interop;
16252
16450
  }
16253
16451
 
@@ -16280,14 +16478,12 @@ var _SnapshotSource_identity, _SnapshotSource_getConnection, _SnapshotSource_get
16280
16478
  Object.defineProperty(Instance, "__esModule", { value: true });
16281
16479
  Instance.SnapshotSource = void 0;
16282
16480
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
16283
- const base_1$1 = base$1;
16481
+ const base_1$1 = base;
16284
16482
  const utils_1$1 = utils;
16285
16483
  const connectionMap = new Map();
16286
16484
  /**
16287
16485
  * Enables configuring a SnapshotSource with custom getSnapshot and applySnapshot methods.
16288
16486
  *
16289
- * @typeParam Snapshot Implementation-defined shape of an application snapshot. Allows
16290
- * custom snapshot implementations for legacy applications to define their own snapshot format.
16291
16487
  */
16292
16488
  class SnapshotSource extends base_1$1.Base {
16293
16489
  /**
@@ -16423,7 +16619,7 @@ _SnapshotSource_identity = new WeakMap(), _SnapshotSource_getConnection = new We
16423
16619
 
16424
16620
  Object.defineProperty(Factory, "__esModule", { value: true });
16425
16621
  Factory.SnapshotSourceModule = void 0;
16426
- const base_1 = base$1;
16622
+ const base_1 = base;
16427
16623
  const Instance_1 = Instance;
16428
16624
  const utils_1 = utils;
16429
16625
  /**
@@ -16433,9 +16629,6 @@ class SnapshotSourceModule extends base_1.Base {
16433
16629
  /**
16434
16630
  * Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
16435
16631
  *
16436
- * @typeParam Snapshot Implementation-defined shape of an application snapshot. Allows
16437
- * custom snapshot implementations for legacy applications to define their own snapshot format.
16438
- *
16439
16632
  * @example
16440
16633
  * ```js
16441
16634
  * const snapshotProvider = {
@@ -16451,7 +16644,6 @@ class SnapshotSourceModule extends base_1.Base {
16451
16644
  *
16452
16645
  * await fin.SnapshotSource.init(snapshotProvider);
16453
16646
  * ```
16454
- *
16455
16647
  */
16456
16648
  async init(provider) {
16457
16649
  this.wire.sendAction('snapshot-source-init').catch((e) => {
@@ -16506,9 +16698,9 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
16506
16698
 
16507
16699
  (function (exports) {
16508
16700
  /**
16509
- * Entry points for the OpenFin `SnapshotSource` API (`fin.SnapshotSource`).
16701
+ * Entry points for the OpenFin `SnapshotSource` API.
16510
16702
  *
16511
- * * {@link SnapshotSourceModule} contains static members of the `SnapshotSource` API, accessible through `fin.SnapshotSource`.
16703
+ * * {@link SnapshotSourceModule} contains static methods relating to the `SnapshotSource` type, accessible through `fin.SnapshotSource`.
16512
16704
  * * {@link SnapshotSource} describes an instance of an OpenFin SnapshotSource, e.g. as returned by `fin.SnapshotSource.wrap`.
16513
16705
  *
16514
16706
  * These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
@@ -16532,29 +16724,26 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
16532
16724
  };
16533
16725
  Object.defineProperty(exports, "__esModule", { value: true });
16534
16726
  __exportStar(Factory, exports);
16535
- __exportStar(Instance, exports);
16727
+ __exportStar(Instance, exports);
16536
16728
  } (snapshotSource));
16537
16729
 
16538
16730
  Object.defineProperty(fin, "__esModule", { value: true });
16539
16731
  fin.Fin = void 0;
16540
- const events_1$3 = require$$0;
16732
+ const events_1$3 = eventsExports;
16541
16733
  // Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
16542
- const index_1 = system$1;
16734
+ const index_1 = system;
16543
16735
  const index_2 = requireWindow();
16544
16736
  const index_3 = requireApplication();
16545
16737
  const index_4 = interappbus;
16546
16738
  const index_5 = clipboard;
16547
- const index_6 = externalApplication$1;
16548
- const index_7 = frame$1;
16549
- const index_8 = globalHotkey$1;
16739
+ const index_6 = externalApplication;
16740
+ const index_7 = frame;
16741
+ const index_8 = globalHotkey;
16550
16742
  const index_9 = requireView();
16551
- const index_10 = platform$1;
16743
+ const index_10 = platform;
16552
16744
  const me_1$1 = me;
16553
16745
  const interop_1 = requireInterop();
16554
16746
  const snapshot_source_1 = snapshotSource;
16555
- /**
16556
- * @internal
16557
- */
16558
16747
  class Fin extends events_1$3.EventEmitter {
16559
16748
  /**
16560
16749
  * @internal
@@ -16587,7 +16776,7 @@ fin.Fin = Fin;
16587
16776
  var wire = {};
16588
16777
 
16589
16778
  Object.defineProperty(wire, "__esModule", { value: true });
16590
- wire.isInternalConnectConfig = wire.isPortDiscoveryConfig = wire.isNewConnectConfig = wire.isConfigWithReceiver = wire.isRemoteConfig = wire.isExistingConnectConfig = wire.isExternalConfig = void 0;
16779
+ wire.isInternalConnectConfig = wire.isPortDiscoveryConfig = wire.isNewConnectConfig = wire.isRemoteConfig = wire.isExistingConnectConfig = wire.isExternalConfig = void 0;
16591
16780
  function isExternalConfig(config) {
16592
16781
  if (typeof config.manifestUrl === 'string') {
16593
16782
  return true;
@@ -16603,10 +16792,6 @@ function isRemoteConfig(config) {
16603
16792
  return isExistingConnectConfig(config) && typeof config.token === 'string';
16604
16793
  }
16605
16794
  wire.isRemoteConfig = isRemoteConfig;
16606
- function isConfigWithReceiver(config) {
16607
- return typeof config.receiver === 'object' && isRemoteConfig({ ...config, address: '' });
16608
- }
16609
- wire.isConfigWithReceiver = isConfigWithReceiver;
16610
16795
  function hasUuid(config) {
16611
16796
  return typeof config.uuid === 'string';
16612
16797
  }
@@ -16647,8 +16832,8 @@ var http = {};
16647
16832
  (function (exports) {
16648
16833
  Object.defineProperty(exports, "__esModule", { value: true });
16649
16834
  exports.fetchJson = exports.downloadFile = exports.fetch = exports.getRequestOptions = exports.getProxy = void 0;
16650
- const node_url_1 = require$$0$1; // This must explicitly use node builtin to avoid accidentally bundling npm:url.
16651
- const fs = require$$0$2;
16835
+ const node_url_1 = require$$0; // This must explicitly use node builtin to avoid accidentally bundling npm:url.
16836
+ const fs = require$$0$1;
16652
16837
  const getProxyVar = () => {
16653
16838
  return process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy;
16654
16839
  };
@@ -16733,13 +16918,13 @@ var http = {};
16733
16918
  const res = await (0, exports.fetch)(url);
16734
16919
  return JSON.parse(res);
16735
16920
  };
16736
- exports.fetchJson = fetchJson;
16921
+ exports.fetchJson = fetchJson;
16737
16922
  } (http));
16738
16923
 
16739
16924
  Object.defineProperty(util, "__esModule", { value: true });
16740
16925
  util.resolveDir = util.first = util.resolveRuntimeVersion = util.rmDir = util.unzip = util.exists = void 0;
16741
- const path$1 = require$$0$3;
16742
- const fs$1 = require$$0$2;
16926
+ const path$1 = require$$0$2;
16927
+ const fs$1 = require$$0$1;
16743
16928
  const child_process_1$1 = require$$2;
16744
16929
  const promises_1$1 = promises;
16745
16930
  const http_1$1 = http;
@@ -16841,7 +17026,7 @@ async function resolveDir(base, paths) {
16841
17026
  util.resolveDir = resolveDir;
16842
17027
 
16843
17028
  Object.defineProperty(winLaunch, "__esModule", { value: true });
16844
- const path = require$$0$3;
17029
+ const path = require$$0$2;
16845
17030
  const child_process_1 = require$$2;
16846
17031
  const util_1 = util;
16847
17032
  function launchRVM(config, manifestLocation, namedPipeName, rvm) {
@@ -16863,7 +17048,7 @@ function launchRVM(config, manifestLocation, namedPipeName, rvm) {
16863
17048
  async function checkRvmPath() {
16864
17049
  let rvmPath = path.resolve(process.env.LOCALAPPDATA, 'OpenFin', 'OpenFinRVM.exe');
16865
17050
  if (!(await (0, util_1.exists)(rvmPath))) {
16866
- rvmPath = path.join(__dirname, '..', 'resources', 'win', 'OpenFinRVM.exe');
17051
+ rvmPath = path.join(__dirname, '..', '..', 'resources', 'win', 'OpenFinRVM.exe');
16867
17052
  }
16868
17053
  return rvmPath;
16869
17054
  }
@@ -16925,8 +17110,8 @@ function requireServices () {
16925
17110
  const startServices = async (services) => {
16926
17111
  await (0, promises_1.promiseMapSerial)(services, exports.launchService);
16927
17112
  };
16928
- exports.startServices = startServices;
16929
- } (services));
17113
+ exports.startServices = startServices;
17114
+ } (services));
16930
17115
  return services;
16931
17116
  }
16932
17117
 
@@ -16937,8 +17122,8 @@ function requireNixLaunch () {
16937
17122
  hasRequiredNixLaunch = 1;
16938
17123
  Object.defineProperty(nixLaunch, "__esModule", { value: true });
16939
17124
  nixLaunch.install = nixLaunch.getRuntimePath = nixLaunch.download = nixLaunch.getUrl = void 0;
16940
- const fs = require$$0$2;
16941
- const path = require$$0$3;
17125
+ const fs = require$$0$1;
17126
+ const path = require$$0$2;
16942
17127
  const child_process_1 = require$$2;
16943
17128
  const promises_1 = promises;
16944
17129
  const util_1 = util;
@@ -17045,8 +17230,8 @@ function requireLauncher () {
17045
17230
  if (hasRequiredLauncher) return launcher;
17046
17231
  hasRequiredLauncher = 1;
17047
17232
  Object.defineProperty(launcher, "__esModule", { value: true });
17048
- const os = require$$0$4;
17049
- const path = require$$0$3;
17233
+ const os = require$$0$3;
17234
+ const path = require$$0$2;
17050
17235
  const win_launch_1 = winLaunch;
17051
17236
  const nix_launch_1 = requireNixLaunch();
17052
17237
  class Launcher {
@@ -17121,10 +17306,10 @@ function requirePortDiscovery () {
17121
17306
  hasRequiredPortDiscovery = 1;
17122
17307
  Object.defineProperty(portDiscovery, "__esModule", { value: true });
17123
17308
  /* eslint-disable @typescript-eslint/naming-convention */
17124
- const fs = require$$0$2;
17309
+ const fs = require$$0$1;
17125
17310
  const net = require$$1;
17126
- const path = require$$0$3;
17127
- const os = require$$0$4;
17311
+ const path = require$$0$2;
17312
+ const os = require$$0$3;
17128
17313
  const timers_1 = require$$4;
17129
17314
  const wire_1 = wire;
17130
17315
  const launcher_1 = requireLauncher();
@@ -17399,17 +17584,12 @@ function requireNodeEnv () {
17399
17584
  hasRequiredNodeEnv = 1;
17400
17585
  Object.defineProperty(nodeEnv, "__esModule", { value: true });
17401
17586
  /* eslint-disable class-methods-use-this */
17402
- const fs_1 = require$$0$2;
17587
+ const fs_1 = require$$0$1;
17403
17588
  const crypto_1 = require$$1$1;
17404
- const _WS = require$$2$1;
17589
+ const WS = require$$2$1;
17405
17590
  const environment_1 = environment;
17406
17591
  const port_discovery_1 = requirePortDiscovery();
17407
17592
  const transport_errors_1 = transportErrors;
17408
- // Due to https://github.com/rollup/rollup/issues/1267, we need this guard
17409
- // to ensure the import works with and without the 'esModuleInterop' ts flag.
17410
- // This is due to our mocha tests not being compatible with esModuleInterop,
17411
- // whereas rollup enforces it.
17412
- const WS = _WS.default || _WS;
17413
17593
  class NodeEnvironment {
17414
17594
  constructor() {
17415
17595
  this.messageCounter = 0;
@@ -17484,7 +17664,7 @@ var emitterMap = {};
17484
17664
 
17485
17665
  Object.defineProperty(emitterMap, "__esModule", { value: true });
17486
17666
  emitterMap.EmitterMap = void 0;
17487
- const events_1$2 = require$$0;
17667
+ const events_1$2 = eventsExports;
17488
17668
  class EmitterMap {
17489
17669
  constructor() {
17490
17670
  this.storage = new Map();
@@ -17566,7 +17746,7 @@ var __classPrivateFieldGet = (commonjsGlobal && commonjsGlobal.__classPrivateFie
17566
17746
  var _Transport_wire, _Transport_fin;
17567
17747
  Object.defineProperty(transport, "__esModule", { value: true });
17568
17748
  transport.Transport = void 0;
17569
- const events_1$1 = require$$0;
17749
+ const events_1$1 = eventsExports;
17570
17750
  const wire_1$1 = wire;
17571
17751
  const transport_errors_1$1 = transportErrors;
17572
17752
  const eventAggregator_1 = eventAggregator;
@@ -17608,13 +17788,13 @@ class Transport extends events_1$1.EventEmitter {
17608
17788
  }
17609
17789
  getFin() {
17610
17790
  if (!__classPrivateFieldGet(this, _Transport_fin, "f")) {
17611
- throw new Error('No Fin object registered for this transport');
17791
+ throw new Error("No Fin object registered for this transport");
17612
17792
  }
17613
17793
  return __classPrivateFieldGet(this, _Transport_fin, "f");
17614
17794
  }
17615
17795
  registerFin(_fin) {
17616
17796
  if (__classPrivateFieldGet(this, _Transport_fin, "f")) {
17617
- throw new Error('Fin object has already been registered for this transport');
17797
+ throw new Error("Fin object has already been registered for this transport");
17618
17798
  }
17619
17799
  __classPrivateFieldSet(this, _Transport_fin, _fin, "f");
17620
17800
  }
@@ -17623,10 +17803,6 @@ class Transport extends events_1$1.EventEmitter {
17623
17803
  return wire.shutdown();
17624
17804
  }
17625
17805
  async connect(config) {
17626
- if ((0, wire_1$1.isConfigWithReceiver)(config)) {
17627
- await __classPrivateFieldGet(this, _Transport_wire, "f").connect(config.receiver);
17628
- return this.authorize(config);
17629
- }
17630
17806
  if ((0, wire_1$1.isRemoteConfig)(config)) {
17631
17807
  return this.connectRemote(config);
17632
17808
  }
@@ -17640,14 +17816,14 @@ class Transport extends events_1$1.EventEmitter {
17640
17816
  return undefined;
17641
17817
  }
17642
17818
  async connectRemote(config) {
17643
- await __classPrivateFieldGet(this, _Transport_wire, "f").connect(new (this.environment.getWsConstructor())(config.address));
17819
+ await __classPrivateFieldGet(this, _Transport_wire, "f").connect(config.address, this.environment.getWsConstructor());
17644
17820
  return this.authorize(config);
17645
17821
  }
17646
17822
  async connectByPort(config) {
17647
17823
  const { address, uuid } = config;
17648
17824
  const reqAuthPayload = { ...config, type: 'file-token' };
17649
17825
  const wire = __classPrivateFieldGet(this, _Transport_wire, "f");
17650
- await wire.connect(new (this.environment.getWsConstructor())(config.address));
17826
+ await wire.connect(address, this.environment.getWsConstructor());
17651
17827
  const requestExtAuthRet = await this.sendAction('request-external-authorization', {
17652
17828
  uuid,
17653
17829
  type: 'file-token'
@@ -17667,9 +17843,7 @@ class Transport extends events_1$1.EventEmitter {
17667
17843
  throw new transport_errors_1$1.RuntimeError(requestAuthRet.payload);
17668
17844
  }
17669
17845
  }
17670
- sendAction(action, payload = {}, uncorrelated = false
17671
- // specialResponse type is only used for 'requestAuthorization'
17672
- ) {
17846
+ sendAction(action, payload = {}, uncorrelated = false) {
17673
17847
  // eslint-disable-next-line @typescript-eslint/no-empty-function
17674
17848
  let cancel = () => { };
17675
17849
  // We want the callsite from the caller of this function, not from here.
@@ -17719,10 +17893,7 @@ class Transport extends events_1$1.EventEmitter {
17719
17893
  this.uncorrelatedListener = resolve;
17720
17894
  }
17721
17895
  else if (this.wireListeners.has(id)) {
17722
- handleNack({
17723
- reason: 'Duplicate handler id',
17724
- error: (0, errors_1.errorToPOJO)(new transport_errors_1$1.DuplicateCorrelationError(String(id)))
17725
- });
17896
+ handleNack({ reason: 'Duplicate handler id', error: (0, errors_1.errorToPOJO)(new transport_errors_1$1.DuplicateCorrelationError(String(id))) });
17726
17897
  }
17727
17898
  else {
17728
17899
  this.wireListeners.set(id, { resolve, handleNack });
@@ -17782,19 +17953,9 @@ _Transport_wire = new WeakMap(), _Transport_fin = new WeakMap();
17782
17953
 
17783
17954
  var websocket = {};
17784
17955
 
17785
- var messageReceiver = {};
17786
-
17787
- Object.defineProperty(messageReceiver, "__esModule", { value: true });
17788
- messageReceiver.isOpen = void 0;
17789
- function isOpen(receiver) {
17790
- return receiver.readyState === 'open' || receiver.readyState === 1;
17791
- }
17792
- messageReceiver.isOpen = isOpen;
17793
-
17794
17956
  Object.defineProperty(websocket, "__esModule", { value: true });
17795
- const events_1 = require$$0;
17957
+ const events_1 = eventsExports;
17796
17958
  const transport_errors_1 = transportErrors;
17797
- const messageReceiver_1 = messageReceiver;
17798
17959
  /* `READY_STATE` is an instance var set by `constructor` to reference the `WebTransportSocket.READY_STATE` enum.
17799
17960
  * This is syntactic sugar that makes the enum accessible through the `wire` property of the various `fin` singletons.
17800
17961
  * For example, `fin.system.wire.READY_STATE` is a shortcut to `fin.system.wire.wire.constructor.READY_STATE`.
@@ -17812,18 +17973,15 @@ var READY_STATE;
17812
17973
  class WebSocketTransport extends events_1.EventEmitter {
17813
17974
  constructor(onmessage) {
17814
17975
  super();
17815
- this.connect = (messageReceiver) => {
17976
+ this.connect = (address, WsConstructor) => {
17816
17977
  return new Promise((resolve, reject) => {
17817
- this.wire = messageReceiver;
17818
- this.wire.addEventListener('open', () => resolve());
17978
+ this.wire = new WsConstructor(address);
17979
+ this.wire.addEventListener('open', resolve);
17819
17980
  this.wire.addEventListener('error', reject);
17820
17981
  this.wire.addEventListener('message', (message) => this.onmessage.call(null, JSON.parse(message.data)));
17821
17982
  this.wire.addEventListener('close', () => {
17822
17983
  this.emit('disconnected');
17823
17984
  });
17824
- if ((0, messageReceiver_1.isOpen)(this.wire)) {
17825
- resolve();
17826
- }
17827
17985
  });
17828
17986
  };
17829
17987
  this.connectSync = () => {
@@ -17833,7 +17991,7 @@ class WebSocketTransport extends events_1.EventEmitter {
17833
17991
  }
17834
17992
  send(data, flags) {
17835
17993
  return new Promise((resolve, reject) => {
17836
- if (!(0, messageReceiver_1.isOpen)(this.wire)) {
17994
+ if (this.wire.readyState !== READY_STATE.OPEN) {
17837
17995
  reject(new transport_errors_1.DisconnectedError(READY_STATE[this.wire.readyState]));
17838
17996
  }
17839
17997
  else {
@@ -17847,7 +18005,6 @@ class WebSocketTransport extends events_1.EventEmitter {
17847
18005
  return Promise.resolve();
17848
18006
  }
17849
18007
  getPort() {
17850
- // @ts-expect-error
17851
18008
  return this.wire.url.split(':').slice(-1)[0];
17852
18009
  }
17853
18010
  }
@@ -17857,8 +18014,8 @@ var normalizeConfig$1 = {};
17857
18014
 
17858
18015
  Object.defineProperty(normalizeConfig$1, "__esModule", { value: true });
17859
18016
  normalizeConfig$1.validateConfig = normalizeConfig$1.normalizeConfig = void 0;
17860
- const fs = require$$0$2;
17861
- const node_url_1 = require$$0$1; // This must explicitly use node builtin to avoid accidentally bundling npm:url
18017
+ const fs = require$$0$1;
18018
+ const node_url_1 = require$$0; // This must explicitly use node builtin to avoid accidentally bundling npm:url
17862
18019
  const wire_1 = wire;
17863
18020
  const promises_1 = promises;
17864
18021
  const http_1 = http;
@@ -17927,9 +18084,9 @@ function requireMain () {
17927
18084
  Object.defineProperty(exports, "ChannelClient", { enumerable: true, get: function () { return client_1.ChannelClient; } });
17928
18085
  const provider_1 = provider;
17929
18086
  Object.defineProperty(exports, "ChannelProvider", { enumerable: true, get: function () { return provider_1.ChannelProvider; } });
17930
- const frame_1 = frame$1;
18087
+ const frame_1 = frame;
17931
18088
  Object.defineProperty(exports, "Frame", { enumerable: true, get: function () { return frame_1._Frame; } });
17932
- const system_1 = system$1;
18089
+ const system_1 = system;
17933
18090
  Object.defineProperty(exports, "System", { enumerable: true, get: function () { return system_1.System; } });
17934
18091
  const wire_1 = wire;
17935
18092
  const node_env_1 = requireNodeEnv();
@@ -17940,10 +18097,11 @@ function requireMain () {
17940
18097
  const environment = new node_env_1.default();
17941
18098
  // Connect to an OpenFin Runtime
17942
18099
  async function connect(config) {
18100
+ var _a;
17943
18101
  const normalized = await (0, normalize_config_1.validateConfig)(config);
17944
18102
  const wire = new transport_1.Transport(websocket_1.default, environment, {
17945
18103
  ...normalized,
17946
- name: normalized.name ?? normalized.uuid
18104
+ name: (_a = normalized.name) !== null && _a !== void 0 ? _a : normalized.uuid
17947
18105
  });
17948
18106
  await wire.connect(normalized);
17949
18107
  return new fin_1.Fin(wire);
@@ -17957,268 +18115,22 @@ function requireMain () {
17957
18115
  const pd = new port_discovery_1.default(normalized, environment);
17958
18116
  return pd.retrievePort();
17959
18117
  }
17960
- exports.launch = launch;
17961
- } (main$1));
18118
+ exports.launch = launch;
18119
+ } (main$1));
17962
18120
  return main$1;
17963
18121
  }
17964
18122
 
17965
18123
  var mainExports = requireMain();
17966
18124
 
17967
- var OpenFin$2 = {};
17968
-
17969
- var events = {};
17970
-
17971
- var application = {};
17972
-
17973
- /**
17974
- * Namespace for events that can be emitted by an {@link OpenFin.Application}. Includes events
17975
- * re-propagated from the {@link OpenFin.Window} (and, transitively, {@link OpenFin.View}) level, prefixed with `window-` (and also, if applicable, `view-`).
17976
- * For example, a view's "attached" event will fire as 'window-view-attached' at the application level.
17977
- *
17978
- * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
17979
- *
17980
- * This namespace contains only payload shapes for events that are unique to `Application`. Events that propagate to `Application` from
17981
- * child {@link OpenFin.Window windows} and {@link OpenFin.View views} are defined in the {@link OpenFin.WindowEvents} and
17982
- * {@link OpenFin.ViewEvents} namespaces. For a list of valid string keys for *all* application events, see {@link Application.on Application.on}.
17983
- *
17984
- * {@link ApplicationSourcedEvent Application-sourced events} (i.e. those that have not propagated from {@link OpenFin.ViewEvents Views}
17985
- * or {@link OpenFin.WindowEvents Windows} re-propagate to {@link OpenFin.SystemEvents System} with their type string prefixed with `application-`.
17986
- * {@link ApplicationWindowEvent Application events that are tied to Windows but do not propagate from them}
17987
- * are propagated to `System` without any type string prefixing.
17988
- *
17989
- * "Requested" events (e.g. {@link RunRequestedEvent}) do not propagate.
17990
- *
17991
- * @packageDocumentation
17992
- */
17993
- Object.defineProperty(application, "__esModule", { value: true });
17994
-
17995
- var base = {};
17996
-
17997
- /**
17998
- * Namespace for shared event payloads and utility types common to all event emitters.
17999
- *
18000
- * @packageDocumentation
18001
- */
18002
- Object.defineProperty(base, "__esModule", { value: true });
18003
-
18004
- var externalApplication = {};
18005
-
18006
- /**
18007
- * Namespace for events that can be transmitted by an {@link OpenFin.ExternalApplication}.
18008
- *
18009
- * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
18010
- *
18011
- * For a list of valid string keys for external application events, see {@link ExternalApplication.on ExternalApplication.on}.
18012
- *
18013
- * @packageDocumentation
18014
- */
18015
- Object.defineProperty(externalApplication, "__esModule", { value: true });
18016
-
18017
- var frame = {};
18018
-
18019
- Object.defineProperty(frame, "__esModule", { value: true });
18020
-
18021
- var globalHotkey = {};
18022
-
18023
- Object.defineProperty(globalHotkey, "__esModule", { value: true });
18024
-
18025
- var platform = {};
18026
-
18027
- /**
18028
- *
18029
- * Namespace for events that can emitted by a {@link OpenFin.Platform}.
18030
- *
18031
- * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
18032
- *
18033
- * The Platform `EventEmitter` is a superset of the {@link OpenFin.Application} `EventEmitter`,
18034
- * meaning it can listen to all {@link OpenFin.ApplicationEvents Application events} in addition to the
18035
- * Platform-specific events listed here. For a list of valid string keys for *all* platform events, see
18036
- * {@link Platform.on Platform.on}.
18037
- *
18038
- * @packageDocumentation
18039
- */
18040
- Object.defineProperty(platform, "__esModule", { value: true });
18041
-
18042
- var system = {};
18043
-
18044
- /**
18045
- * Namespace for runtime-wide OpenFin events emitted by {@link System.System}. Includes events
18046
- * re-propagated from {@link OpenFin.Application}, {@link OpenFin.Window}, and {@link OpenFin.View} (prefixed with `application-`, `window-`, and `view-`). All
18047
- * event propagations are visible at the System level. Propagated events from WebContents (windows, views, frames) to the Application level will *not*
18048
- * transitively re-propagate to the System level, because they are already visible at the system level and contain the identity
18049
- * of the application. For example, an application's "closed" event will fire as 'application-closed' at the system level. A view's 'shown' event
18050
- * will be visible as 'view-shown' at the system level, but *not* as `application-window-view-shown`.
18051
- *
18052
- * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
18053
- *
18054
- * This namespace contains only payload shapes for events that are unique to `System`. Events that propagate to `System` from
18055
- * child {@link OpenFin.Application applications}, {@link OpenFin.Window windows}, and {@link OpenFin.View views} are defined in the
18056
- * {@link OpenFin.ApplicationEvents}, {@link OpenFin.WindowEvents}, and {@link OpenFin.ViewEvents} namespaces. For a list of valid string keys for *all*
18057
- * system events, see {@link System.on System.on}.
18058
- *
18059
- * @packageDocumentation
18060
- */
18061
- Object.defineProperty(system, "__esModule", { value: true });
18062
-
18063
- var view = {};
18064
-
18065
- /**
18066
- * Namespace for events that can be emitted by a {@link OpenFin.View}.
18067
- *
18068
- * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
18069
- *
18070
- * This namespace contains only payload shapes for events that are unique to `View`. Events that are shared between all `WebContents`
18071
- * (i.e. {@link OpenFin.Window}, {@link OpenFin.View}) are defined in {@link OpenFin.WebContentsEvents}. For a list
18072
- * of valid string keys for *all* View events, see {@link View.on View.on}.
18073
- *
18074
- * View events propagate to their parent {@link OpenFin.WindowEvents Window}, {@link OpenFin.ApplicationEvents Application},
18075
- * and {@link OpenFin.SystemEvents System} with an added `viewIdentity` property and their event types prefixed with `'view-'`.
18076
- *
18077
- * @packageDocumentation
18078
- */
18079
- Object.defineProperty(view, "__esModule", { value: true });
18080
-
18081
- var webcontents = {};
18082
-
18083
- /**
18084
- * Namespace for events shared by all OpenFin WebContents elements (i.e. {@link OpenFin.Window},
18085
- * {@link OpenFin.View}).
18086
- *
18087
- * WebContents events are divided into two groups: {@link WillPropagateWebContentsEvent} and {@link NonPropagatedWebContentsEvent}. Propagating events
18088
- * will re-emit on parent entities - e.g., a propagating event in a view will also be emitted on the view's
18089
- * parent window, and propagating events in a window will also be emitted on the window's parent {@link OpenFin.Application}.
18090
- *
18091
- * Non-propagating events will not re-emit on parent entities.
18092
- *
18093
- * @packageDocumentation
18094
- */
18095
- Object.defineProperty(webcontents, "__esModule", { value: true });
18096
-
18097
- var window$1 = {};
18098
-
18099
- /**
18100
- * Namespace for events that can be emitted by a {@link OpenFin.Window}.
18101
- *
18102
- * Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
18103
- *
18104
- * This namespace contains only payload shapes for events that are unique to `Window`. Events that are shared between all `WebContents`
18105
- * (i.e. {@link OpenFin.Window}, {@link OpenFin.View}) are defined in {@link OpenFin.WebContentsEvents}. Events that
18106
- * propagate from `View` are defined in {@link OpenFin.ViewEvents}. For a list of valid string keys for *all* Window events, see
18107
- * {@link Window.on Window.on}
18108
- *
18109
- * {@link OpenFin.WindowEvents.WindowSourcedEvent Window-sourced events} (i.e. those that are not propagated from a
18110
- * {@link OpenFin.ViewEvents View}) propagate to their parent {@link OpenFin.ApplicationEvents Application} and
18111
- * {@link OpenFin.SystemEvents System} with their event types prefixed with `'window-'`).
18112
- *
18113
- * "Requested" events (e.g. {@link AuthRequestedEvent}) do not propagate to `System. The {@link OpenFin.WindowEvents.WindowCloseRequestedEvent}
18114
- * does not propagate at all.
18115
- *
18116
- * @packageDocumentation
18117
- */
18118
- Object.defineProperty(window$1, "__esModule", { value: true });
18119
-
18120
- /**
18121
- * Namespace for OpenFin event types. Each entity that emits OpenFin events has its own sub-namespace. Event payloads
18122
- * themselves are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
18123
- *
18124
- * #### Event emitters
18125
- *
18126
- * The following entities emit OpenFin events, and have corresponding sub-namespaces:
18127
- *
18128
- * * {@link OpenFin.Application}: {@link OpenFin.ApplicationEvents}
18129
- * * {@link OpenFin.ExternalApplication}: {@link OpenFin.ExternalApplicationEvents}
18130
- * * {@link OpenFin.Frame}: {@link OpenFin.FrameEvents}
18131
- * * {@link OpenFin.GlobalHotkey}: {@link OpenFin.GlobalHotkeyEvents}
18132
- * * {@link OpenFin.Platform}: {@link OpenFin.PlatformEvents}
18133
- * * {@link OpenFin.System}: {@link OpenFin.SystemEvents}
18134
- * * {@link OpenFin.View}: {@link OpenFin.ViewEvents}
18135
- * * {@link OpenFin.Window}: {@link OpenFin.WindowEvents}
18136
- *
18137
- * These `EventEmitter` entities share a common set of methods for interacting with the OpenFin event bus, which can be
18138
- * seen on the individual documentation pages for each entity type.
18139
- *
18140
- * Registering event handlers is an asynchronous operation. It is important to ensure that the returned Promises are awaited to reduce the
18141
- * risk of race conditions.
18142
- *
18143
- * When the `EventEmitter` receives an event from the browser process and emits on the renderer, all of the functions attached to that
18144
- * specific event are called synchronously. Any values returned by the called listeners are ignored and will be discarded. If the window document
18145
- * is destroyed by page navigation or reload, its registered event listeners will be removed.
18146
- *
18147
- * We recommend using Arrow Functions for event listeners to ensure the this scope is consistent with the original function context.
18148
- *
18149
- * Events re-propagate from smaller/more-local scopes to larger/more-global scopes. For example, an event emitted on a specific
18150
- * view will propagate to the window in which the view is embedded, and then to the application in which the window is running, and
18151
- * finally to the OpenFin runtime itself at the "system" level. For details on propagation semantics, see the namespace for
18152
- * the propagating (or propagated-to) entity.
18153
- *
18154
- * If you need the payload type for a specific type of event (especially propagated events), use the emitting topic's `Payload` generic
18155
- * (e.g. {@link WindowEvents.Payload}) with the event's `type` string. For example, the payload of
18156
- * a {@link ViewEvents.CreatedEvent} after it has propagated to its parent {@link WindowEvents Window} can be found with
18157
- * `WindowEvents.Payload<'view-created'>`.
18158
- *
18159
- * @packageDocumentation
18160
- */
18161
- Object.defineProperty(events, "__esModule", { value: true });
18162
- events.WindowEvents = events.WebContentsEvents = events.ViewEvents = events.SystemEvents = events.PlatformEvents = events.GlobalHotkeyEvents = events.FrameEvents = events.ExternalApplicationEvents = events.BaseEvents = events.ApplicationEvents = void 0;
18163
- const ApplicationEvents = application;
18164
- events.ApplicationEvents = ApplicationEvents;
18165
- const BaseEvents = base;
18166
- events.BaseEvents = BaseEvents;
18167
- const ExternalApplicationEvents = externalApplication;
18168
- events.ExternalApplicationEvents = ExternalApplicationEvents;
18169
- const FrameEvents = frame;
18170
- events.FrameEvents = FrameEvents;
18171
- const GlobalHotkeyEvents = globalHotkey;
18172
- events.GlobalHotkeyEvents = GlobalHotkeyEvents;
18173
- const PlatformEvents = platform;
18174
- events.PlatformEvents = PlatformEvents;
18175
- const SystemEvents = system;
18176
- events.SystemEvents = SystemEvents;
18177
- const ViewEvents = view;
18178
- events.ViewEvents = ViewEvents;
18179
- const WebContentsEvents = webcontents;
18180
- events.WebContentsEvents = WebContentsEvents;
18181
- const WindowEvents = window$1;
18182
- events.WindowEvents = WindowEvents;
18183
-
18184
- (function (exports) {
18185
- /**
18186
- * Top-level namespace for types referenced by the OpenFin API. Contains:
18187
- *
18188
- * * The type of the global `fin` entry point ({@link FinApi})
18189
- * * Classes that act as static namespaces returned from the `fin` global (e.g. {@link ApplicationModule}, accessible via `fin.Application`)
18190
- * * Instance classes that are returned from API calls (e.g. {@link Application}, accessible via `fin.Application.getCurrentSync()`)
18191
- * * Parameter shapes for API methods (e.g. {@link ApplicationOptions}, used in `fin.Application.start()`)
18192
- * * Event namespaces and payload union types (e.g. {@link ApplicationEvents} and {@link ApplicationEvent})
18193
- *
18194
- * @packageDocumentation
18195
- */
18196
- var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18197
- if (k2 === undefined) k2 = k;
18198
- var desc = Object.getOwnPropertyDescriptor(m, k);
18199
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18200
- desc = { enumerable: true, get: function() { return m[k]; } };
18201
- }
18202
- Object.defineProperty(o, k2, desc);
18203
- }) : (function(o, m, k, k2) {
18204
- if (k2 === undefined) k2 = k;
18205
- o[k2] = m[k];
18206
- }));
18207
- var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
18208
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18209
- };
18210
- Object.defineProperty(exports, "__esModule", { value: true });
18211
- // Deprecated shim to preserve v30 namespace names
18212
- __exportStar(events, exports);
18213
- } (OpenFin$2));
18125
+ var OpenFin$1 = {};
18214
18126
 
18215
- var OpenFin = /*@__PURE__*/getDefaultExportFromCjs(OpenFin$2);
18127
+ Object.defineProperty(OpenFin$1, "__esModule", { value: true });
18216
18128
 
18217
- var OpenFin$1 = /*#__PURE__*/_mergeNamespaces({
18129
+ var OpenFin = /*#__PURE__*/_mergeNamespaces({
18218
18130
  __proto__: null,
18219
- default: OpenFin
18220
- }, [OpenFin$2]);
18131
+ default: OpenFin$1
18132
+ }, [OpenFin$1]);
18221
18133
 
18222
18134
  exports.connect = mainExports.connect;
18223
- exports.default = OpenFin$1;
18135
+ exports.default = OpenFin;
18224
18136
  exports.launch = mainExports.launch;