@dynamic-labs/react-native-extension 4.0.0-alpha.0 → 4.0.0-alpha.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.
package/index.cjs CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var assertPackageVersion = require('@dynamic-labs/assert-package-version');
5
6
  var react = require('react');
6
7
  var reactNativeWebview = require('react-native-webview');
7
8
  var messageTransport = require('@dynamic-labs/message-transport');
@@ -11,2910 +12,153 @@ var jsxRuntime = require('react/jsx-runtime');
11
12
  var reactNativePasskeyStamper = require('@turnkey/react-native-passkey-stamper');
12
13
  var expoLinking = require('expo-linking');
13
14
  var expoWebBrowser = require('expo-web-browser');
15
+ var expoSecureStore = require('expo-secure-store');
14
16
 
15
- var version$1 = "4.0.0-alpha.0";
17
+ var version = "4.0.0-alpha.10";
16
18
 
17
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
18
-
19
- var check = function (it) {
20
- return it && it.Math == Math && it;
21
- };
22
-
23
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
24
- var global$j =
25
- // eslint-disable-next-line es/no-global-this -- safe
26
- check(typeof globalThis == 'object' && globalThis) ||
27
- check(typeof window == 'object' && window) ||
28
- // eslint-disable-next-line no-restricted-globals -- safe
29
- check(typeof self == 'object' && self) ||
30
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
31
- // eslint-disable-next-line no-new-func -- fallback
32
- (function () { return this; })() || Function('return this')();
33
-
34
- var objectGetOwnPropertyDescriptor = {};
35
-
36
- var fails$d = function (exec) {
37
- try {
38
- return !!exec();
39
- } catch (error) {
40
- return true;
41
- }
42
- };
43
-
44
- var fails$c = fails$d;
45
-
46
- // Detect IE8's incomplete defineProperty implementation
47
- var descriptors = !fails$c(function () {
48
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
49
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
50
- });
51
-
52
- var fails$b = fails$d;
53
-
54
- var functionBindNative = !fails$b(function () {
55
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
56
- var test = (function () { /* empty */ }).bind();
57
- // eslint-disable-next-line no-prototype-builtins -- safe
58
- return typeof test != 'function' || test.hasOwnProperty('prototype');
59
- });
60
-
61
- var NATIVE_BIND$3 = functionBindNative;
62
-
63
- var call$e = Function.prototype.call;
64
-
65
- var functionCall = NATIVE_BIND$3 ? call$e.bind(call$e) : function () {
66
- return call$e.apply(call$e, arguments);
67
- };
68
-
69
- var objectPropertyIsEnumerable = {};
70
-
71
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
72
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
73
- var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
74
-
75
- // Nashorn ~ JDK8 bug
76
- var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
77
-
78
- // `Object.prototype.propertyIsEnumerable` method implementation
79
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
80
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
81
- var descriptor = getOwnPropertyDescriptor$2(this, V);
82
- return !!descriptor && descriptor.enumerable;
83
- } : $propertyIsEnumerable;
84
-
85
- var createPropertyDescriptor$4 = function (bitmap, value) {
86
- return {
87
- enumerable: !(bitmap & 1),
88
- configurable: !(bitmap & 2),
89
- writable: !(bitmap & 4),
90
- value: value
91
- };
92
- };
93
-
94
- var NATIVE_BIND$2 = functionBindNative;
95
-
96
- var FunctionPrototype$2 = Function.prototype;
97
- var call$d = FunctionPrototype$2.call;
98
- var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$d, call$d);
99
-
100
- var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
101
- return function () {
102
- return call$d.apply(fn, arguments);
103
- };
104
- };
105
-
106
- var uncurryThis$d = functionUncurryThis;
107
-
108
- var toString$1 = uncurryThis$d({}.toString);
109
- var stringSlice = uncurryThis$d(''.slice);
110
-
111
- var classofRaw$2 = function (it) {
112
- return stringSlice(toString$1(it), 8, -1);
113
- };
114
-
115
- var uncurryThis$c = functionUncurryThis;
116
- var fails$a = fails$d;
117
- var classof$4 = classofRaw$2;
118
-
119
- var $Object$4 = Object;
120
- var split = uncurryThis$c(''.split);
121
-
122
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
123
- var indexedObject = fails$a(function () {
124
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
125
- // eslint-disable-next-line no-prototype-builtins -- safe
126
- return !$Object$4('z').propertyIsEnumerable(0);
127
- }) ? function (it) {
128
- return classof$4(it) == 'String' ? split(it, '') : $Object$4(it);
129
- } : $Object$4;
130
-
131
- // we can't use just `it == null` since of `document.all` special case
132
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
133
- var isNullOrUndefined$4 = function (it) {
134
- return it === null || it === undefined;
135
- };
136
-
137
- var isNullOrUndefined$3 = isNullOrUndefined$4;
138
-
139
- var $TypeError$c = TypeError;
140
-
141
- // `RequireObjectCoercible` abstract operation
142
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
143
- var requireObjectCoercible$2 = function (it) {
144
- if (isNullOrUndefined$3(it)) throw $TypeError$c("Can't call method on " + it);
145
- return it;
146
- };
147
-
148
- // toObject with fallback for non-array-like ES3 strings
149
- var IndexedObject$1 = indexedObject;
150
- var requireObjectCoercible$1 = requireObjectCoercible$2;
151
-
152
- var toIndexedObject$5 = function (it) {
153
- return IndexedObject$1(requireObjectCoercible$1(it));
154
- };
155
-
156
- var documentAll$2 = typeof document == 'object' && document.all;
157
-
158
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
159
- // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
160
- var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
161
-
162
- var documentAll_1 = {
163
- all: documentAll$2,
164
- IS_HTMLDDA: IS_HTMLDDA
165
- };
166
-
167
- var $documentAll$1 = documentAll_1;
168
-
169
- var documentAll$1 = $documentAll$1.all;
170
-
171
- // `IsCallable` abstract operation
172
- // https://tc39.es/ecma262/#sec-iscallable
173
- var isCallable$k = $documentAll$1.IS_HTMLDDA ? function (argument) {
174
- return typeof argument == 'function' || argument === documentAll$1;
175
- } : function (argument) {
176
- return typeof argument == 'function';
177
- };
178
-
179
- var isCallable$j = isCallable$k;
180
- var $documentAll = documentAll_1;
181
-
182
- var documentAll = $documentAll.all;
183
-
184
- var isObject$8 = $documentAll.IS_HTMLDDA ? function (it) {
185
- return typeof it == 'object' ? it !== null : isCallable$j(it) || it === documentAll;
186
- } : function (it) {
187
- return typeof it == 'object' ? it !== null : isCallable$j(it);
188
- };
189
-
190
- var global$i = global$j;
191
- var isCallable$i = isCallable$k;
192
-
193
- var aFunction = function (argument) {
194
- return isCallable$i(argument) ? argument : undefined;
195
- };
196
-
197
- var getBuiltIn$8 = function (namespace, method) {
198
- return arguments.length < 2 ? aFunction(global$i[namespace]) : global$i[namespace] && global$i[namespace][method];
199
- };
200
-
201
- var uncurryThis$b = functionUncurryThis;
202
-
203
- var objectIsPrototypeOf = uncurryThis$b({}.isPrototypeOf);
204
-
205
- var getBuiltIn$7 = getBuiltIn$8;
206
-
207
- var engineUserAgent = getBuiltIn$7('navigator', 'userAgent') || '';
208
-
209
- var global$h = global$j;
210
- var userAgent$3 = engineUserAgent;
211
-
212
- var process$3 = global$h.process;
213
- var Deno$1 = global$h.Deno;
214
- var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
215
- var v8 = versions && versions.v8;
216
- var match, version;
217
-
218
- if (v8) {
219
- match = v8.split('.');
220
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
221
- // but their correct versions are not interesting for us
222
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
223
- }
224
-
225
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
226
- // so check `userAgent` even if `.v8` exists, but 0
227
- if (!version && userAgent$3) {
228
- match = userAgent$3.match(/Edge\/(\d+)/);
229
- if (!match || match[1] >= 74) {
230
- match = userAgent$3.match(/Chrome\/(\d+)/);
231
- if (match) version = +match[1];
232
- }
233
- }
234
-
235
- var engineV8Version = version;
236
-
237
- /* eslint-disable es/no-symbol -- required for testing */
238
-
239
- var V8_VERSION$1 = engineV8Version;
240
- var fails$9 = fails$d;
241
-
242
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
243
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$9(function () {
244
- var symbol = Symbol();
245
- // Chrome 38 Symbol has incorrect toString conversion
246
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
247
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
248
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
249
- !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
250
- });
251
-
252
- /* eslint-disable es/no-symbol -- required for testing */
253
-
254
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
255
-
256
- var useSymbolAsUid = NATIVE_SYMBOL$1
257
- && !Symbol.sham
258
- && typeof Symbol.iterator == 'symbol';
259
-
260
- var getBuiltIn$6 = getBuiltIn$8;
261
- var isCallable$h = isCallable$k;
262
- var isPrototypeOf$2 = objectIsPrototypeOf;
263
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
264
-
265
- var $Object$3 = Object;
266
-
267
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
268
- return typeof it == 'symbol';
269
- } : function (it) {
270
- var $Symbol = getBuiltIn$6('Symbol');
271
- return isCallable$h($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$3(it));
272
- };
273
-
274
- var $String$2 = String;
275
-
276
- var tryToString$4 = function (argument) {
277
- try {
278
- return $String$2(argument);
279
- } catch (error) {
280
- return 'Object';
281
- }
282
- };
283
-
284
- var isCallable$g = isCallable$k;
285
- var tryToString$3 = tryToString$4;
286
-
287
- var $TypeError$b = TypeError;
288
-
289
- // `Assert: IsCallable(argument) is true`
290
- var aCallable$7 = function (argument) {
291
- if (isCallable$g(argument)) return argument;
292
- throw $TypeError$b(tryToString$3(argument) + ' is not a function');
293
- };
294
-
295
- var aCallable$6 = aCallable$7;
296
- var isNullOrUndefined$2 = isNullOrUndefined$4;
297
-
298
- // `GetMethod` abstract operation
299
- // https://tc39.es/ecma262/#sec-getmethod
300
- var getMethod$3 = function (V, P) {
301
- var func = V[P];
302
- return isNullOrUndefined$2(func) ? undefined : aCallable$6(func);
303
- };
304
-
305
- var call$c = functionCall;
306
- var isCallable$f = isCallable$k;
307
- var isObject$7 = isObject$8;
308
-
309
- var $TypeError$a = TypeError;
310
-
311
- // `OrdinaryToPrimitive` abstract operation
312
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
313
- var ordinaryToPrimitive$1 = function (input, pref) {
314
- var fn, val;
315
- if (pref === 'string' && isCallable$f(fn = input.toString) && !isObject$7(val = call$c(fn, input))) return val;
316
- if (isCallable$f(fn = input.valueOf) && !isObject$7(val = call$c(fn, input))) return val;
317
- if (pref !== 'string' && isCallable$f(fn = input.toString) && !isObject$7(val = call$c(fn, input))) return val;
318
- throw $TypeError$a("Can't convert object to primitive value");
319
- };
320
-
321
- var shared$3 = {exports: {}};
322
-
323
- var global$g = global$j;
324
-
325
- // eslint-disable-next-line es/no-object-defineproperty -- safe
326
- var defineProperty$5 = Object.defineProperty;
327
-
328
- var defineGlobalProperty$3 = function (key, value) {
329
- try {
330
- defineProperty$5(global$g, key, { value: value, configurable: true, writable: true });
331
- } catch (error) {
332
- global$g[key] = value;
333
- } return value;
334
- };
335
-
336
- var global$f = global$j;
337
- var defineGlobalProperty$2 = defineGlobalProperty$3;
338
-
339
- var SHARED = '__core-js_shared__';
340
- var store$3 = global$f[SHARED] || defineGlobalProperty$2(SHARED, {});
341
-
342
- var sharedStore = store$3;
343
-
344
- var store$2 = sharedStore;
345
-
346
- (shared$3.exports = function (key, value) {
347
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
348
- })('versions', []).push({
349
- version: '3.27.0',
350
- mode: 'global',
351
- copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
352
- license: 'https://github.com/zloirock/core-js/blob/v3.27.0/LICENSE',
353
- source: 'https://github.com/zloirock/core-js'
354
- });
355
-
356
- var requireObjectCoercible = requireObjectCoercible$2;
357
-
358
- var $Object$2 = Object;
359
-
360
- // `ToObject` abstract operation
361
- // https://tc39.es/ecma262/#sec-toobject
362
- var toObject$3 = function (argument) {
363
- return $Object$2(requireObjectCoercible(argument));
364
- };
365
-
366
- var uncurryThis$a = functionUncurryThis;
367
- var toObject$2 = toObject$3;
368
-
369
- var hasOwnProperty = uncurryThis$a({}.hasOwnProperty);
370
-
371
- // `HasOwnProperty` abstract operation
372
- // https://tc39.es/ecma262/#sec-hasownproperty
373
- // eslint-disable-next-line es/no-object-hasown -- safe
374
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
375
- return hasOwnProperty(toObject$2(it), key);
376
- };
377
-
378
- var uncurryThis$9 = functionUncurryThis;
379
-
380
- var id = 0;
381
- var postfix = Math.random();
382
- var toString = uncurryThis$9(1.0.toString);
383
-
384
- var uid$2 = function (key) {
385
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
386
- };
387
-
388
- var global$e = global$j;
389
- var shared$2 = shared$3.exports;
390
- var hasOwn$9 = hasOwnProperty_1;
391
- var uid$1 = uid$2;
392
- var NATIVE_SYMBOL = symbolConstructorDetection;
393
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
394
-
395
- var WellKnownSymbolsStore = shared$2('wks');
396
- var Symbol$1 = global$e.Symbol;
397
- var symbolFor = Symbol$1 && Symbol$1['for'];
398
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
399
-
400
- var wellKnownSymbol$e = function (name) {
401
- if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
402
- var description = 'Symbol.' + name;
403
- if (NATIVE_SYMBOL && hasOwn$9(Symbol$1, name)) {
404
- WellKnownSymbolsStore[name] = Symbol$1[name];
405
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
406
- WellKnownSymbolsStore[name] = symbolFor(description);
407
- } else {
408
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
409
- }
410
- } return WellKnownSymbolsStore[name];
411
- };
412
-
413
- var call$b = functionCall;
414
- var isObject$6 = isObject$8;
415
- var isSymbol$1 = isSymbol$2;
416
- var getMethod$2 = getMethod$3;
417
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
418
- var wellKnownSymbol$d = wellKnownSymbol$e;
419
-
420
- var $TypeError$9 = TypeError;
421
- var TO_PRIMITIVE = wellKnownSymbol$d('toPrimitive');
422
-
423
- // `ToPrimitive` abstract operation
424
- // https://tc39.es/ecma262/#sec-toprimitive
425
- var toPrimitive$1 = function (input, pref) {
426
- if (!isObject$6(input) || isSymbol$1(input)) return input;
427
- var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
428
- var result;
429
- if (exoticToPrim) {
430
- if (pref === undefined) pref = 'default';
431
- result = call$b(exoticToPrim, input, pref);
432
- if (!isObject$6(result) || isSymbol$1(result)) return result;
433
- throw $TypeError$9("Can't convert object to primitive value");
434
- }
435
- if (pref === undefined) pref = 'number';
436
- return ordinaryToPrimitive(input, pref);
437
- };
438
-
439
- var toPrimitive = toPrimitive$1;
440
- var isSymbol = isSymbol$2;
441
-
442
- // `ToPropertyKey` abstract operation
443
- // https://tc39.es/ecma262/#sec-topropertykey
444
- var toPropertyKey$3 = function (argument) {
445
- var key = toPrimitive(argument, 'string');
446
- return isSymbol(key) ? key : key + '';
447
- };
448
-
449
- var global$d = global$j;
450
- var isObject$5 = isObject$8;
451
-
452
- var document$3 = global$d.document;
453
- // typeof document.createElement is 'object' in old IE
454
- var EXISTS$1 = isObject$5(document$3) && isObject$5(document$3.createElement);
455
-
456
- var documentCreateElement$2 = function (it) {
457
- return EXISTS$1 ? document$3.createElement(it) : {};
458
- };
459
-
460
- var DESCRIPTORS$a = descriptors;
461
- var fails$8 = fails$d;
462
- var createElement$1 = documentCreateElement$2;
463
-
464
- // Thanks to IE8 for its funny defineProperty
465
- var ie8DomDefine = !DESCRIPTORS$a && !fails$8(function () {
466
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
467
- return Object.defineProperty(createElement$1('div'), 'a', {
468
- get: function () { return 7; }
469
- }).a != 7;
470
- });
471
-
472
- var DESCRIPTORS$9 = descriptors;
473
- var call$a = functionCall;
474
- var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
475
- var createPropertyDescriptor$3 = createPropertyDescriptor$4;
476
- var toIndexedObject$4 = toIndexedObject$5;
477
- var toPropertyKey$2 = toPropertyKey$3;
478
- var hasOwn$8 = hasOwnProperty_1;
479
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
480
-
481
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
482
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
483
-
484
- // `Object.getOwnPropertyDescriptor` method
485
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
486
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$9 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
487
- O = toIndexedObject$4(O);
488
- P = toPropertyKey$2(P);
489
- if (IE8_DOM_DEFINE$1) try {
490
- return $getOwnPropertyDescriptor$1(O, P);
491
- } catch (error) { /* empty */ }
492
- if (hasOwn$8(O, P)) return createPropertyDescriptor$3(!call$a(propertyIsEnumerableModule$1.f, O, P), O[P]);
493
- };
494
-
495
- var objectDefineProperty = {};
496
-
497
- var DESCRIPTORS$8 = descriptors;
498
- var fails$7 = fails$d;
499
-
500
- // V8 ~ Chrome 36-
501
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
502
- var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$7(function () {
503
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
504
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
505
- value: 42,
506
- writable: false
507
- }).prototype != 42;
508
- });
509
-
510
- var isObject$4 = isObject$8;
511
-
512
- var $String$1 = String;
513
- var $TypeError$8 = TypeError;
514
-
515
- // `Assert: Type(argument) is Object`
516
- var anObject$a = function (argument) {
517
- if (isObject$4(argument)) return argument;
518
- throw $TypeError$8($String$1(argument) + ' is not an object');
519
- };
520
-
521
- var DESCRIPTORS$7 = descriptors;
522
- var IE8_DOM_DEFINE = ie8DomDefine;
523
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
524
- var anObject$9 = anObject$a;
525
- var toPropertyKey$1 = toPropertyKey$3;
526
-
527
- var $TypeError$7 = TypeError;
528
- // eslint-disable-next-line es/no-object-defineproperty -- safe
529
- var $defineProperty = Object.defineProperty;
530
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
531
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
532
- var ENUMERABLE = 'enumerable';
533
- var CONFIGURABLE$1 = 'configurable';
534
- var WRITABLE = 'writable';
535
-
536
- // `Object.defineProperty` method
537
- // https://tc39.es/ecma262/#sec-object.defineproperty
538
- objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
539
- anObject$9(O);
540
- P = toPropertyKey$1(P);
541
- anObject$9(Attributes);
542
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
543
- var current = $getOwnPropertyDescriptor(O, P);
544
- if (current && current[WRITABLE]) {
545
- O[P] = Attributes.value;
546
- Attributes = {
547
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
548
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
549
- writable: false
550
- };
551
- }
552
- } return $defineProperty(O, P, Attributes);
553
- } : $defineProperty : function defineProperty(O, P, Attributes) {
554
- anObject$9(O);
555
- P = toPropertyKey$1(P);
556
- anObject$9(Attributes);
557
- if (IE8_DOM_DEFINE) try {
558
- return $defineProperty(O, P, Attributes);
559
- } catch (error) { /* empty */ }
560
- if ('get' in Attributes || 'set' in Attributes) throw $TypeError$7('Accessors not supported');
561
- if ('value' in Attributes) O[P] = Attributes.value;
562
- return O;
563
- };
564
-
565
- var DESCRIPTORS$6 = descriptors;
566
- var definePropertyModule$5 = objectDefineProperty;
567
- var createPropertyDescriptor$2 = createPropertyDescriptor$4;
568
-
569
- var createNonEnumerableProperty$4 = DESCRIPTORS$6 ? function (object, key, value) {
570
- return definePropertyModule$5.f(object, key, createPropertyDescriptor$2(1, value));
571
- } : function (object, key, value) {
572
- object[key] = value;
573
- return object;
574
- };
575
-
576
- var makeBuiltIn$2 = {exports: {}};
577
-
578
- var DESCRIPTORS$5 = descriptors;
579
- var hasOwn$7 = hasOwnProperty_1;
580
-
581
- var FunctionPrototype$1 = Function.prototype;
582
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
583
- var getDescriptor = DESCRIPTORS$5 && Object.getOwnPropertyDescriptor;
584
-
585
- var EXISTS = hasOwn$7(FunctionPrototype$1, 'name');
586
- // additional protection from minified / mangled / dropped function names
587
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
588
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$5 || (DESCRIPTORS$5 && getDescriptor(FunctionPrototype$1, 'name').configurable));
589
-
590
- var functionName = {
591
- EXISTS: EXISTS,
592
- PROPER: PROPER,
593
- CONFIGURABLE: CONFIGURABLE
594
- };
595
-
596
- var uncurryThis$8 = functionUncurryThis;
597
- var isCallable$e = isCallable$k;
598
- var store$1 = sharedStore;
599
-
600
- var functionToString = uncurryThis$8(Function.toString);
601
-
602
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
603
- if (!isCallable$e(store$1.inspectSource)) {
604
- store$1.inspectSource = function (it) {
605
- return functionToString(it);
606
- };
607
- }
608
-
609
- var inspectSource$3 = store$1.inspectSource;
610
-
611
- var global$c = global$j;
612
- var isCallable$d = isCallable$k;
613
-
614
- var WeakMap$1 = global$c.WeakMap;
615
-
616
- var weakMapBasicDetection = isCallable$d(WeakMap$1) && /native code/.test(String(WeakMap$1));
617
-
618
- var shared$1 = shared$3.exports;
619
- var uid = uid$2;
620
-
621
- var keys = shared$1('keys');
622
-
623
- var sharedKey$3 = function (key) {
624
- return keys[key] || (keys[key] = uid(key));
625
- };
626
-
627
- var hiddenKeys$4 = {};
628
-
629
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
630
- var global$b = global$j;
631
- var isObject$3 = isObject$8;
632
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
633
- var hasOwn$6 = hasOwnProperty_1;
634
- var shared = sharedStore;
635
- var sharedKey$2 = sharedKey$3;
636
- var hiddenKeys$3 = hiddenKeys$4;
637
-
638
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
639
- var TypeError$2 = global$b.TypeError;
640
- var WeakMap = global$b.WeakMap;
641
- var set$1, get, has;
642
-
643
- var enforce = function (it) {
644
- return has(it) ? get(it) : set$1(it, {});
645
- };
646
-
647
- var getterFor = function (TYPE) {
648
- return function (it) {
649
- var state;
650
- if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
651
- throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
652
- } return state;
653
- };
654
- };
655
-
656
- if (NATIVE_WEAK_MAP || shared.state) {
657
- var store = shared.state || (shared.state = new WeakMap());
658
- /* eslint-disable no-self-assign -- prototype methods protection */
659
- store.get = store.get;
660
- store.has = store.has;
661
- store.set = store.set;
662
- /* eslint-enable no-self-assign -- prototype methods protection */
663
- set$1 = function (it, metadata) {
664
- if (store.has(it)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
665
- metadata.facade = it;
666
- store.set(it, metadata);
667
- return metadata;
668
- };
669
- get = function (it) {
670
- return store.get(it) || {};
671
- };
672
- has = function (it) {
673
- return store.has(it);
674
- };
675
- } else {
676
- var STATE = sharedKey$2('state');
677
- hiddenKeys$3[STATE] = true;
678
- set$1 = function (it, metadata) {
679
- if (hasOwn$6(it, STATE)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
680
- metadata.facade = it;
681
- createNonEnumerableProperty$3(it, STATE, metadata);
682
- return metadata;
683
- };
684
- get = function (it) {
685
- return hasOwn$6(it, STATE) ? it[STATE] : {};
686
- };
687
- has = function (it) {
688
- return hasOwn$6(it, STATE);
689
- };
690
- }
691
-
692
- var internalState = {
693
- set: set$1,
694
- get: get,
695
- has: has,
696
- enforce: enforce,
697
- getterFor: getterFor
698
- };
699
-
700
- var fails$6 = fails$d;
701
- var isCallable$c = isCallable$k;
702
- var hasOwn$5 = hasOwnProperty_1;
703
- var DESCRIPTORS$4 = descriptors;
704
- var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
705
- var inspectSource$2 = inspectSource$3;
706
- var InternalStateModule$2 = internalState;
707
-
708
- var enforceInternalState = InternalStateModule$2.enforce;
709
- var getInternalState$1 = InternalStateModule$2.get;
710
- // eslint-disable-next-line es/no-object-defineproperty -- safe
711
- var defineProperty$4 = Object.defineProperty;
712
-
713
- var CONFIGURABLE_LENGTH = DESCRIPTORS$4 && !fails$6(function () {
714
- return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
715
- });
716
-
717
- var TEMPLATE = String(String).split('String');
718
-
719
- var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
720
- if (String(name).slice(0, 7) === 'Symbol(') {
721
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
722
- }
723
- if (options && options.getter) name = 'get ' + name;
724
- if (options && options.setter) name = 'set ' + name;
725
- if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
726
- if (DESCRIPTORS$4) defineProperty$4(value, 'name', { value: name, configurable: true });
727
- else value.name = name;
728
- }
729
- if (CONFIGURABLE_LENGTH && options && hasOwn$5(options, 'arity') && value.length !== options.arity) {
730
- defineProperty$4(value, 'length', { value: options.arity });
731
- }
732
- try {
733
- if (options && hasOwn$5(options, 'constructor') && options.constructor) {
734
- if (DESCRIPTORS$4) defineProperty$4(value, 'prototype', { writable: false });
735
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
736
- } else if (value.prototype) value.prototype = undefined;
737
- } catch (error) { /* empty */ }
738
- var state = enforceInternalState(value);
739
- if (!hasOwn$5(state, 'source')) {
740
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
741
- } return value;
742
- };
743
-
744
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
745
- // eslint-disable-next-line no-extend-native -- required
746
- Function.prototype.toString = makeBuiltIn$1(function toString() {
747
- return isCallable$c(this) && getInternalState$1(this).source || inspectSource$2(this);
748
- }, 'toString');
749
-
750
- var isCallable$b = isCallable$k;
751
- var definePropertyModule$4 = objectDefineProperty;
752
- var makeBuiltIn = makeBuiltIn$2.exports;
753
- var defineGlobalProperty$1 = defineGlobalProperty$3;
754
-
755
- var defineBuiltIn$5 = function (O, key, value, options) {
756
- if (!options) options = {};
757
- var simple = options.enumerable;
758
- var name = options.name !== undefined ? options.name : key;
759
- if (isCallable$b(value)) makeBuiltIn(value, name, options);
760
- if (options.global) {
761
- if (simple) O[key] = value;
762
- else defineGlobalProperty$1(key, value);
763
- } else {
764
- try {
765
- if (!options.unsafe) delete O[key];
766
- else if (O[key]) simple = true;
767
- } catch (error) { /* empty */ }
768
- if (simple) O[key] = value;
769
- else definePropertyModule$4.f(O, key, {
770
- value: value,
771
- enumerable: false,
772
- configurable: !options.nonConfigurable,
773
- writable: !options.nonWritable
774
- });
775
- } return O;
776
- };
777
-
778
- var objectGetOwnPropertyNames = {};
779
-
780
- var ceil = Math.ceil;
781
- var floor = Math.floor;
782
-
783
- // `Math.trunc` method
784
- // https://tc39.es/ecma262/#sec-math.trunc
785
- // eslint-disable-next-line es/no-math-trunc -- safe
786
- var mathTrunc = Math.trunc || function trunc(x) {
787
- var n = +x;
788
- return (n > 0 ? floor : ceil)(n);
789
- };
790
-
791
- var trunc = mathTrunc;
792
-
793
- // `ToIntegerOrInfinity` abstract operation
794
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
795
- var toIntegerOrInfinity$2 = function (argument) {
796
- var number = +argument;
797
- // eslint-disable-next-line no-self-compare -- NaN check
798
- return number !== number || number === 0 ? 0 : trunc(number);
799
- };
800
-
801
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
802
-
803
- var max = Math.max;
804
- var min$1 = Math.min;
805
-
806
- // Helper for a popular repeating case of the spec:
807
- // Let integer be ? ToInteger(index).
808
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
809
- var toAbsoluteIndex$1 = function (index, length) {
810
- var integer = toIntegerOrInfinity$1(index);
811
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
812
- };
813
-
814
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
815
-
816
- var min = Math.min;
817
-
818
- // `ToLength` abstract operation
819
- // https://tc39.es/ecma262/#sec-tolength
820
- var toLength$1 = function (argument) {
821
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
822
- };
823
-
824
- var toLength = toLength$1;
825
-
826
- // `LengthOfArrayLike` abstract operation
827
- // https://tc39.es/ecma262/#sec-lengthofarraylike
828
- var lengthOfArrayLike$2 = function (obj) {
829
- return toLength(obj.length);
830
- };
831
-
832
- var toIndexedObject$3 = toIndexedObject$5;
833
- var toAbsoluteIndex = toAbsoluteIndex$1;
834
- var lengthOfArrayLike$1 = lengthOfArrayLike$2;
835
-
836
- // `Array.prototype.{ indexOf, includes }` methods implementation
837
- var createMethod = function (IS_INCLUDES) {
838
- return function ($this, el, fromIndex) {
839
- var O = toIndexedObject$3($this);
840
- var length = lengthOfArrayLike$1(O);
841
- var index = toAbsoluteIndex(fromIndex, length);
842
- var value;
843
- // Array#includes uses SameValueZero equality algorithm
844
- // eslint-disable-next-line no-self-compare -- NaN check
845
- if (IS_INCLUDES && el != el) while (length > index) {
846
- value = O[index++];
847
- // eslint-disable-next-line no-self-compare -- NaN check
848
- if (value != value) return true;
849
- // Array#indexOf ignores holes, Array#includes - not
850
- } else for (;length > index; index++) {
851
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
852
- } return !IS_INCLUDES && -1;
853
- };
854
- };
855
-
856
- var arrayIncludes = {
857
- // `Array.prototype.includes` method
858
- // https://tc39.es/ecma262/#sec-array.prototype.includes
859
- includes: createMethod(true),
860
- // `Array.prototype.indexOf` method
861
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
862
- indexOf: createMethod(false)
863
- };
864
-
865
- var uncurryThis$7 = functionUncurryThis;
866
- var hasOwn$4 = hasOwnProperty_1;
867
- var toIndexedObject$2 = toIndexedObject$5;
868
- var indexOf = arrayIncludes.indexOf;
869
- var hiddenKeys$2 = hiddenKeys$4;
870
-
871
- var push = uncurryThis$7([].push);
872
-
873
- var objectKeysInternal = function (object, names) {
874
- var O = toIndexedObject$2(object);
875
- var i = 0;
876
- var result = [];
877
- var key;
878
- for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
879
- // Don't enum bug & hidden keys
880
- while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
881
- ~indexOf(result, key) || push(result, key);
882
- }
883
- return result;
884
- };
885
-
886
- // IE8- don't enum bug keys
887
- var enumBugKeys$3 = [
888
- 'constructor',
889
- 'hasOwnProperty',
890
- 'isPrototypeOf',
891
- 'propertyIsEnumerable',
892
- 'toLocaleString',
893
- 'toString',
894
- 'valueOf'
895
- ];
896
-
897
- var internalObjectKeys$1 = objectKeysInternal;
898
- var enumBugKeys$2 = enumBugKeys$3;
899
-
900
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
901
-
902
- // `Object.getOwnPropertyNames` method
903
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
904
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
905
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
906
- return internalObjectKeys$1(O, hiddenKeys$1);
907
- };
908
-
909
- var objectGetOwnPropertySymbols = {};
910
-
911
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
912
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
913
-
914
- var getBuiltIn$5 = getBuiltIn$8;
915
- var uncurryThis$6 = functionUncurryThis;
916
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
917
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
918
- var anObject$8 = anObject$a;
919
-
920
- var concat$1 = uncurryThis$6([].concat);
921
-
922
- // all object keys, includes non-enumerable and symbols
923
- var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
924
- var keys = getOwnPropertyNamesModule.f(anObject$8(it));
925
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
926
- return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
927
- };
928
-
929
- var hasOwn$3 = hasOwnProperty_1;
930
- var ownKeys = ownKeys$1;
931
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
932
- var definePropertyModule$3 = objectDefineProperty;
933
-
934
- var copyConstructorProperties$1 = function (target, source, exceptions) {
935
- var keys = ownKeys(source);
936
- var defineProperty = definePropertyModule$3.f;
937
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
938
- for (var i = 0; i < keys.length; i++) {
939
- var key = keys[i];
940
- if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
941
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
942
- }
943
- }
944
- };
945
-
946
- var fails$5 = fails$d;
947
- var isCallable$a = isCallable$k;
948
-
949
- var replacement = /#|\.prototype\./;
950
-
951
- var isForced$2 = function (feature, detection) {
952
- var value = data[normalize(feature)];
953
- return value == POLYFILL ? true
954
- : value == NATIVE ? false
955
- : isCallable$a(detection) ? fails$5(detection)
956
- : !!detection;
957
- };
958
-
959
- var normalize = isForced$2.normalize = function (string) {
960
- return String(string).replace(replacement, '.').toLowerCase();
961
- };
962
-
963
- var data = isForced$2.data = {};
964
- var NATIVE = isForced$2.NATIVE = 'N';
965
- var POLYFILL = isForced$2.POLYFILL = 'P';
966
-
967
- var isForced_1 = isForced$2;
968
-
969
- var global$a = global$j;
970
- var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
971
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
972
- var defineBuiltIn$4 = defineBuiltIn$5;
973
- var defineGlobalProperty = defineGlobalProperty$3;
974
- var copyConstructorProperties = copyConstructorProperties$1;
975
- var isForced$1 = isForced_1;
976
-
977
- /*
978
- options.target - name of the target object
979
- options.global - target is the global object
980
- options.stat - export as static methods of target
981
- options.proto - export as prototype methods of target
982
- options.real - real prototype method for the `pure` version
983
- options.forced - export even if the native feature is available
984
- options.bind - bind methods to the target, required for the `pure` version
985
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
986
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
987
- options.sham - add a flag to not completely full polyfills
988
- options.enumerable - export as enumerable property
989
- options.dontCallGetSet - prevent calling a getter on target
990
- options.name - the .name of the function if it does not match the key
991
- */
992
- var _export = function (options, source) {
993
- var TARGET = options.target;
994
- var GLOBAL = options.global;
995
- var STATIC = options.stat;
996
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
997
- if (GLOBAL) {
998
- target = global$a;
999
- } else if (STATIC) {
1000
- target = global$a[TARGET] || defineGlobalProperty(TARGET, {});
1001
- } else {
1002
- target = (global$a[TARGET] || {}).prototype;
1003
- }
1004
- if (target) for (key in source) {
1005
- sourceProperty = source[key];
1006
- if (options.dontCallGetSet) {
1007
- descriptor = getOwnPropertyDescriptor$1(target, key);
1008
- targetProperty = descriptor && descriptor.value;
1009
- } else targetProperty = target[key];
1010
- FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1011
- // contained in target
1012
- if (!FORCED && targetProperty !== undefined) {
1013
- if (typeof sourceProperty == typeof targetProperty) continue;
1014
- copyConstructorProperties(sourceProperty, targetProperty);
1015
- }
1016
- // add a flag to not completely full polyfills
1017
- if (options.sham || (targetProperty && targetProperty.sham)) {
1018
- createNonEnumerableProperty$2(sourceProperty, 'sham', true);
1019
- }
1020
- defineBuiltIn$4(target, key, sourceProperty, options);
1021
- }
1022
- };
1023
-
1024
- var internalObjectKeys = objectKeysInternal;
1025
- var enumBugKeys$1 = enumBugKeys$3;
1026
-
1027
- // `Object.keys` method
1028
- // https://tc39.es/ecma262/#sec-object.keys
1029
- // eslint-disable-next-line es/no-object-keys -- safe
1030
- var objectKeys$2 = Object.keys || function keys(O) {
1031
- return internalObjectKeys(O, enumBugKeys$1);
1032
- };
1033
-
1034
- var DESCRIPTORS$3 = descriptors;
1035
- var uncurryThis$5 = functionUncurryThis;
1036
- var call$9 = functionCall;
1037
- var fails$4 = fails$d;
1038
- var objectKeys$1 = objectKeys$2;
1039
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1040
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1041
- var toObject$1 = toObject$3;
1042
- var IndexedObject = indexedObject;
1043
-
1044
- // eslint-disable-next-line es/no-object-assign -- safe
1045
- var $assign = Object.assign;
1046
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1047
- var defineProperty$3 = Object.defineProperty;
1048
- var concat = uncurryThis$5([].concat);
1049
-
1050
- // `Object.assign` method
1051
- // https://tc39.es/ecma262/#sec-object.assign
1052
- var objectAssign = !$assign || fails$4(function () {
1053
- // should have correct order of operations (Edge bug)
1054
- if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
1055
- enumerable: true,
1056
- get: function () {
1057
- defineProperty$3(this, 'b', {
1058
- value: 3,
1059
- enumerable: false
1060
- });
1061
- }
1062
- }), { b: 2 })).b !== 1) return true;
1063
- // should work with symbols and should have deterministic property order (V8 bug)
1064
- var A = {};
1065
- var B = {};
1066
- // eslint-disable-next-line es/no-symbol -- safe
1067
- var symbol = Symbol();
1068
- var alphabet = 'abcdefghijklmnopqrst';
1069
- A[symbol] = 7;
1070
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1071
- return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
1072
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1073
- var T = toObject$1(target);
1074
- var argumentsLength = arguments.length;
1075
- var index = 1;
1076
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1077
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
1078
- while (argumentsLength > index) {
1079
- var S = IndexedObject(arguments[index++]);
1080
- var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1081
- var length = keys.length;
1082
- var j = 0;
1083
- var key;
1084
- while (length > j) {
1085
- key = keys[j++];
1086
- if (!DESCRIPTORS$3 || call$9(propertyIsEnumerable, S, key)) T[key] = S[key];
1087
- }
1088
- } return T;
1089
- } : $assign;
1090
-
1091
- var $$8 = _export;
1092
- var assign = objectAssign;
1093
-
1094
- // `Object.assign` method
1095
- // https://tc39.es/ecma262/#sec-object.assign
1096
- // eslint-disable-next-line es/no-object-assign -- required for testing
1097
- $$8({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1098
- assign: assign
1099
- });
1100
-
1101
- const logger = new logger$1.Logger('react-native-extension');
1102
-
1103
- const useIsMounted = () => {
1104
- const isMountedRef = react.useRef(true);
1105
- react.useEffect(() => () => {
1106
- isMountedRef.current = false;
1107
- }, []);
1108
- return react.useCallback(() => isMountedRef.current, [isMountedRef]);
1109
- };
1110
-
1111
- const useMessageTransportWebViewBridge = (core, webViewRef) => {
1112
- const canBroadcastMessages = useIsMounted();
1113
- /**
1114
- * Receive a message from the webview and forward it to the client
1115
- * message transport
1116
- */
1117
- const onMessageHandler = event => {
1118
- if (!canBroadcastMessages()) return;
1119
- let parsedData = null;
1120
- try {
1121
- parsedData = JSON.parse(event.nativeEvent.data);
1122
- } catch (err) {
1123
- logger.debug('error parsing data', err);
1124
- return;
1125
- }
1126
- const message = messageTransport.parseMessageTransportData(parsedData);
1127
- if (!message) {
1128
- logger.debug('invalid message', message);
1129
- return;
1130
- }
1131
- /**
1132
- * Only forward messages from the created by the webview
1133
- */
1134
- if (message.origin === 'webview') {
1135
- core.messageTransport.emit(message);
1136
- }
1137
- };
1138
- /**
1139
- * Send messages created by the client to the webview
1140
- */
1141
- react.useEffect(() => {
1142
- const sendMessageToWebView = message => {
1143
- if (!canBroadcastMessages()) return;
1144
- /**
1145
- * Only forward messages to the webview
1146
- * that where created by the client/host
1147
- */
1148
- if (message.origin === 'host' && webViewRef.current) {
1149
- webViewRef.current.postMessage(JSON.stringify(message));
1150
- }
1151
- };
1152
- core.messageTransport.on(sendMessageToWebView);
1153
- return () => {
1154
- core.messageTransport.off(sendMessageToWebView);
1155
- };
1156
- }, [core.messageTransport, webViewRef, canBroadcastMessages]);
1157
- return {
1158
- onMessageHandler
1159
- };
1160
- };
1161
-
1162
- var objectDefineProperties = {};
1163
-
1164
- var DESCRIPTORS$2 = descriptors;
1165
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1166
- var definePropertyModule$2 = objectDefineProperty;
1167
- var anObject$7 = anObject$a;
1168
- var toIndexedObject$1 = toIndexedObject$5;
1169
- var objectKeys = objectKeys$2;
1170
-
1171
- // `Object.defineProperties` method
1172
- // https://tc39.es/ecma262/#sec-object.defineproperties
1173
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1174
- objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1175
- anObject$7(O);
1176
- var props = toIndexedObject$1(Properties);
1177
- var keys = objectKeys(Properties);
1178
- var length = keys.length;
1179
- var index = 0;
1180
- var key;
1181
- while (length > index) definePropertyModule$2.f(O, key = keys[index++], props[key]);
1182
- return O;
1183
- };
1184
-
1185
- var getBuiltIn$4 = getBuiltIn$8;
1186
-
1187
- var html$2 = getBuiltIn$4('document', 'documentElement');
1188
-
1189
- /* global ActiveXObject -- old IE, WSH */
1190
-
1191
- var anObject$6 = anObject$a;
1192
- var definePropertiesModule = objectDefineProperties;
1193
- var enumBugKeys = enumBugKeys$3;
1194
- var hiddenKeys = hiddenKeys$4;
1195
- var html$1 = html$2;
1196
- var documentCreateElement$1 = documentCreateElement$2;
1197
- var sharedKey$1 = sharedKey$3;
1198
-
1199
- var GT = '>';
1200
- var LT = '<';
1201
- var PROTOTYPE = 'prototype';
1202
- var SCRIPT = 'script';
1203
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1204
-
1205
- var EmptyConstructor = function () { /* empty */ };
1206
-
1207
- var scriptTag = function (content) {
1208
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1209
- };
1210
-
1211
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1212
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1213
- activeXDocument.write(scriptTag(''));
1214
- activeXDocument.close();
1215
- var temp = activeXDocument.parentWindow.Object;
1216
- activeXDocument = null; // avoid memory leak
1217
- return temp;
1218
- };
1219
-
1220
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1221
- var NullProtoObjectViaIFrame = function () {
1222
- // Thrash, waste and sodomy: IE GC bug
1223
- var iframe = documentCreateElement$1('iframe');
1224
- var JS = 'java' + SCRIPT + ':';
1225
- var iframeDocument;
1226
- iframe.style.display = 'none';
1227
- html$1.appendChild(iframe);
1228
- // https://github.com/zloirock/core-js/issues/475
1229
- iframe.src = String(JS);
1230
- iframeDocument = iframe.contentWindow.document;
1231
- iframeDocument.open();
1232
- iframeDocument.write(scriptTag('document.F=Object'));
1233
- iframeDocument.close();
1234
- return iframeDocument.F;
1235
- };
1236
-
1237
- // Check for document.domain and active x support
1238
- // No need to use active x approach when document.domain is not set
1239
- // see https://github.com/es-shims/es5-shim/issues/150
1240
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1241
- // avoid IE GC bug
1242
- var activeXDocument;
1243
- var NullProtoObject = function () {
1244
- try {
1245
- activeXDocument = new ActiveXObject('htmlfile');
1246
- } catch (error) { /* ignore */ }
1247
- NullProtoObject = typeof document != 'undefined'
1248
- ? document.domain && activeXDocument
1249
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1250
- : NullProtoObjectViaIFrame()
1251
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1252
- var length = enumBugKeys.length;
1253
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1254
- return NullProtoObject();
1255
- };
1256
-
1257
- hiddenKeys[IE_PROTO$1] = true;
1258
-
1259
- // `Object.create` method
1260
- // https://tc39.es/ecma262/#sec-object.create
1261
- // eslint-disable-next-line es/no-object-create -- safe
1262
- var objectCreate = Object.create || function create(O, Properties) {
1263
- var result;
1264
- if (O !== null) {
1265
- EmptyConstructor[PROTOTYPE] = anObject$6(O);
1266
- result = new EmptyConstructor();
1267
- EmptyConstructor[PROTOTYPE] = null;
1268
- // add "__proto__" for Object.getPrototypeOf polyfill
1269
- result[IE_PROTO$1] = O;
1270
- } else result = NullProtoObject();
1271
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1272
- };
1273
-
1274
- var wellKnownSymbol$c = wellKnownSymbol$e;
1275
- var create$1 = objectCreate;
1276
- var defineProperty$2 = objectDefineProperty.f;
1277
-
1278
- var UNSCOPABLES = wellKnownSymbol$c('unscopables');
1279
- var ArrayPrototype$1 = Array.prototype;
1280
-
1281
- // Array.prototype[@@unscopables]
1282
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1283
- if (ArrayPrototype$1[UNSCOPABLES] == undefined) {
1284
- defineProperty$2(ArrayPrototype$1, UNSCOPABLES, {
1285
- configurable: true,
1286
- value: create$1(null)
1287
- });
1288
- }
1289
-
1290
- // add a key to Array.prototype[@@unscopables]
1291
- var addToUnscopables$1 = function (key) {
1292
- ArrayPrototype$1[UNSCOPABLES][key] = true;
1293
- };
1294
-
1295
- var iterators = {};
1296
-
1297
- var fails$3 = fails$d;
1298
-
1299
- var correctPrototypeGetter = !fails$3(function () {
1300
- function F() { /* empty */ }
1301
- F.prototype.constructor = null;
1302
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1303
- return Object.getPrototypeOf(new F()) !== F.prototype;
1304
- });
1305
-
1306
- var hasOwn$2 = hasOwnProperty_1;
1307
- var isCallable$9 = isCallable$k;
1308
- var toObject = toObject$3;
1309
- var sharedKey = sharedKey$3;
1310
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1311
-
1312
- var IE_PROTO = sharedKey('IE_PROTO');
1313
- var $Object$1 = Object;
1314
- var ObjectPrototype = $Object$1.prototype;
1315
-
1316
- // `Object.getPrototypeOf` method
1317
- // https://tc39.es/ecma262/#sec-object.getprototypeof
1318
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
1319
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1320
- var object = toObject(O);
1321
- if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1322
- var constructor = object.constructor;
1323
- if (isCallable$9(constructor) && object instanceof constructor) {
1324
- return constructor.prototype;
1325
- } return object instanceof $Object$1 ? ObjectPrototype : null;
1326
- };
1327
-
1328
- var fails$2 = fails$d;
1329
- var isCallable$8 = isCallable$k;
1330
- var isObject$2 = isObject$8;
1331
- var getPrototypeOf$1 = objectGetPrototypeOf;
1332
- var defineBuiltIn$3 = defineBuiltIn$5;
1333
- var wellKnownSymbol$b = wellKnownSymbol$e;
1334
-
1335
- var ITERATOR$5 = wellKnownSymbol$b('iterator');
1336
- var BUGGY_SAFARI_ITERATORS$1 = false;
1337
-
1338
- // `%IteratorPrototype%` object
1339
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1340
- var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1341
-
1342
- /* eslint-disable es/no-array-prototype-keys -- safe */
1343
- if ([].keys) {
1344
- arrayIterator = [].keys();
1345
- // Safari 8 has buggy iterators w/o `next`
1346
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1347
- else {
1348
- PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1349
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1350
- }
1351
- }
1352
-
1353
- var NEW_ITERATOR_PROTOTYPE = !isObject$2(IteratorPrototype$2) || fails$2(function () {
1354
- var test = {};
1355
- // FF44- legacy iterators case
1356
- return IteratorPrototype$2[ITERATOR$5].call(test) !== test;
1357
- });
1358
-
1359
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1360
-
1361
- // `%IteratorPrototype%[@@iterator]()` method
1362
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1363
- if (!isCallable$8(IteratorPrototype$2[ITERATOR$5])) {
1364
- defineBuiltIn$3(IteratorPrototype$2, ITERATOR$5, function () {
1365
- return this;
1366
- });
1367
- }
1368
-
1369
- var iteratorsCore = {
1370
- IteratorPrototype: IteratorPrototype$2,
1371
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1372
- };
1373
-
1374
- var defineProperty$1 = objectDefineProperty.f;
1375
- var hasOwn$1 = hasOwnProperty_1;
1376
- var wellKnownSymbol$a = wellKnownSymbol$e;
1377
-
1378
- var TO_STRING_TAG$3 = wellKnownSymbol$a('toStringTag');
1379
-
1380
- var setToStringTag$3 = function (target, TAG, STATIC) {
1381
- if (target && !STATIC) target = target.prototype;
1382
- if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
1383
- defineProperty$1(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1384
- }
1385
- };
1386
-
1387
- var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1388
- var create = objectCreate;
1389
- var createPropertyDescriptor$1 = createPropertyDescriptor$4;
1390
- var setToStringTag$2 = setToStringTag$3;
1391
- var Iterators$4 = iterators;
1392
-
1393
- var returnThis$1 = function () { return this; };
1394
-
1395
- var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1396
- var TO_STRING_TAG = NAME + ' Iterator';
1397
- IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor$1(+!ENUMERABLE_NEXT, next) });
1398
- setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
1399
- Iterators$4[TO_STRING_TAG] = returnThis$1;
1400
- return IteratorConstructor;
1401
- };
1402
-
1403
- var isCallable$7 = isCallable$k;
1404
-
1405
- var $String = String;
1406
- var $TypeError$6 = TypeError;
1407
-
1408
- var aPossiblePrototype$1 = function (argument) {
1409
- if (typeof argument == 'object' || isCallable$7(argument)) return argument;
1410
- throw $TypeError$6("Can't set " + $String(argument) + ' as a prototype');
1411
- };
1412
-
1413
- /* eslint-disable no-proto -- safe */
1414
-
1415
- var uncurryThis$4 = functionUncurryThis;
1416
- var anObject$5 = anObject$a;
1417
- var aPossiblePrototype = aPossiblePrototype$1;
1418
-
1419
- // `Object.setPrototypeOf` method
1420
- // https://tc39.es/ecma262/#sec-object.setprototypeof
1421
- // Works with __proto__ only. Old v8 can't work with null proto objects.
1422
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
1423
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1424
- var CORRECT_SETTER = false;
1425
- var test = {};
1426
- var setter;
1427
- try {
1428
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1429
- setter = uncurryThis$4(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1430
- setter(test, []);
1431
- CORRECT_SETTER = test instanceof Array;
1432
- } catch (error) { /* empty */ }
1433
- return function setPrototypeOf(O, proto) {
1434
- anObject$5(O);
1435
- aPossiblePrototype(proto);
1436
- if (CORRECT_SETTER) setter(O, proto);
1437
- else O.__proto__ = proto;
1438
- return O;
1439
- };
1440
- }() : undefined);
1441
-
1442
- var $$7 = _export;
1443
- var call$8 = functionCall;
1444
- var FunctionName = functionName;
1445
- var isCallable$6 = isCallable$k;
1446
- var createIteratorConstructor = iteratorCreateConstructor;
1447
- var getPrototypeOf = objectGetPrototypeOf;
1448
- var setPrototypeOf$1 = objectSetPrototypeOf;
1449
- var setToStringTag$1 = setToStringTag$3;
1450
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
1451
- var defineBuiltIn$2 = defineBuiltIn$5;
1452
- var wellKnownSymbol$9 = wellKnownSymbol$e;
1453
- var Iterators$3 = iterators;
1454
- var IteratorsCore = iteratorsCore;
1455
-
1456
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1457
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1458
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
1459
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1460
- var ITERATOR$4 = wellKnownSymbol$9('iterator');
1461
- var KEYS = 'keys';
1462
- var VALUES = 'values';
1463
- var ENTRIES = 'entries';
1464
-
1465
- var returnThis = function () { return this; };
1466
-
1467
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1468
- createIteratorConstructor(IteratorConstructor, NAME, next);
1469
-
1470
- var getIterationMethod = function (KIND) {
1471
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1472
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
1473
- switch (KIND) {
1474
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1475
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1476
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1477
- } return function () { return new IteratorConstructor(this); };
1478
- };
1479
-
1480
- var TO_STRING_TAG = NAME + ' Iterator';
1481
- var INCORRECT_VALUES_NAME = false;
1482
- var IterablePrototype = Iterable.prototype;
1483
- var nativeIterator = IterablePrototype[ITERATOR$4]
1484
- || IterablePrototype['@@iterator']
1485
- || DEFAULT && IterablePrototype[DEFAULT];
1486
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1487
- var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1488
- var CurrentIteratorPrototype, methods, KEY;
1489
-
1490
- // fix native
1491
- if (anyNativeIterator) {
1492
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1493
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1494
- if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1495
- if (setPrototypeOf$1) {
1496
- setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
1497
- } else if (!isCallable$6(CurrentIteratorPrototype[ITERATOR$4])) {
1498
- defineBuiltIn$2(CurrentIteratorPrototype, ITERATOR$4, returnThis);
1499
- }
1500
- }
1501
- // Set @@toStringTag to native iterators
1502
- setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
1503
- }
1504
- }
1505
-
1506
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1507
- if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1508
- if (CONFIGURABLE_FUNCTION_NAME) {
1509
- createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
1510
- } else {
1511
- INCORRECT_VALUES_NAME = true;
1512
- defaultIterator = function values() { return call$8(nativeIterator, this); };
1513
- }
1514
- }
1515
-
1516
- // export additional methods
1517
- if (DEFAULT) {
1518
- methods = {
1519
- values: getIterationMethod(VALUES),
1520
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1521
- entries: getIterationMethod(ENTRIES)
1522
- };
1523
- if (FORCED) for (KEY in methods) {
1524
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1525
- defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
1526
- }
1527
- } else $$7({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1528
- }
1529
-
1530
- // define iterator
1531
- if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
1532
- defineBuiltIn$2(IterablePrototype, ITERATOR$4, defaultIterator, { name: DEFAULT });
1533
- }
1534
- Iterators$3[NAME] = defaultIterator;
1535
-
1536
- return methods;
1537
- };
1538
-
1539
- // `CreateIterResultObject` abstract operation
1540
- // https://tc39.es/ecma262/#sec-createiterresultobject
1541
- var createIterResultObject$1 = function (value, done) {
1542
- return { value: value, done: done };
1543
- };
1544
-
1545
- var toIndexedObject = toIndexedObject$5;
1546
- var addToUnscopables = addToUnscopables$1;
1547
- var Iterators$2 = iterators;
1548
- var InternalStateModule$1 = internalState;
1549
- var defineProperty = objectDefineProperty.f;
1550
- var defineIterator = iteratorDefine;
1551
- var createIterResultObject = createIterResultObject$1;
1552
- var DESCRIPTORS$1 = descriptors;
1553
-
1554
- var ARRAY_ITERATOR = 'Array Iterator';
1555
- var setInternalState$1 = InternalStateModule$1.set;
1556
- var getInternalState = InternalStateModule$1.getterFor(ARRAY_ITERATOR);
1557
-
1558
- // `Array.prototype.entries` method
1559
- // https://tc39.es/ecma262/#sec-array.prototype.entries
1560
- // `Array.prototype.keys` method
1561
- // https://tc39.es/ecma262/#sec-array.prototype.keys
1562
- // `Array.prototype.values` method
1563
- // https://tc39.es/ecma262/#sec-array.prototype.values
1564
- // `Array.prototype[@@iterator]` method
1565
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1566
- // `CreateArrayIterator` internal method
1567
- // https://tc39.es/ecma262/#sec-createarrayiterator
1568
- var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1569
- setInternalState$1(this, {
1570
- type: ARRAY_ITERATOR,
1571
- target: toIndexedObject(iterated), // target
1572
- index: 0, // next index
1573
- kind: kind // kind
1574
- });
1575
- // `%ArrayIteratorPrototype%.next` method
1576
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1577
- }, function () {
1578
- var state = getInternalState(this);
1579
- var target = state.target;
1580
- var kind = state.kind;
1581
- var index = state.index++;
1582
- if (!target || index >= target.length) {
1583
- state.target = undefined;
1584
- return createIterResultObject(undefined, true);
1585
- }
1586
- if (kind == 'keys') return createIterResultObject(index, false);
1587
- if (kind == 'values') return createIterResultObject(target[index], false);
1588
- return createIterResultObject([index, target[index]], false);
1589
- }, 'values');
1590
-
1591
- // argumentsList[@@iterator] is %ArrayProto_values%
1592
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1593
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1594
- var values = Iterators$2.Arguments = Iterators$2.Array;
1595
-
1596
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1597
- addToUnscopables('keys');
1598
- addToUnscopables('values');
1599
- addToUnscopables('entries');
1600
-
1601
- // V8 ~ Chrome 45- bug
1602
- if (DESCRIPTORS$1 && values.name !== 'values') try {
1603
- defineProperty(values, 'name', { value: 'values' });
1604
- } catch (error) { /* empty */ }
1605
-
1606
- // iterable DOM collections
1607
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1608
- var domIterables = {
1609
- CSSRuleList: 0,
1610
- CSSStyleDeclaration: 0,
1611
- CSSValueList: 0,
1612
- ClientRectList: 0,
1613
- DOMRectList: 0,
1614
- DOMStringList: 0,
1615
- DOMTokenList: 1,
1616
- DataTransferItemList: 0,
1617
- FileList: 0,
1618
- HTMLAllCollection: 0,
1619
- HTMLCollection: 0,
1620
- HTMLFormElement: 0,
1621
- HTMLSelectElement: 0,
1622
- MediaList: 0,
1623
- MimeTypeArray: 0,
1624
- NamedNodeMap: 0,
1625
- NodeList: 1,
1626
- PaintRequestList: 0,
1627
- Plugin: 0,
1628
- PluginArray: 0,
1629
- SVGLengthList: 0,
1630
- SVGNumberList: 0,
1631
- SVGPathSegList: 0,
1632
- SVGPointList: 0,
1633
- SVGStringList: 0,
1634
- SVGTransformList: 0,
1635
- SourceBufferList: 0,
1636
- StyleSheetList: 0,
1637
- TextTrackCueList: 0,
1638
- TextTrackList: 0,
1639
- TouchList: 0
1640
- };
1641
-
1642
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1643
- var documentCreateElement = documentCreateElement$2;
1644
-
1645
- var classList = documentCreateElement('span').classList;
1646
- var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1647
-
1648
- var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1649
-
1650
- var global$9 = global$j;
1651
- var DOMIterables = domIterables;
1652
- var DOMTokenListPrototype = domTokenListPrototype;
1653
- var ArrayIteratorMethods = es_array_iterator;
1654
- var createNonEnumerableProperty = createNonEnumerableProperty$4;
1655
- var wellKnownSymbol$8 = wellKnownSymbol$e;
1656
-
1657
- var ITERATOR$3 = wellKnownSymbol$8('iterator');
1658
- var TO_STRING_TAG$2 = wellKnownSymbol$8('toStringTag');
1659
- var ArrayValues = ArrayIteratorMethods.values;
1660
-
1661
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1662
- if (CollectionPrototype) {
1663
- // some Chrome versions have non-configurable methods on DOMTokenList
1664
- if (CollectionPrototype[ITERATOR$3] !== ArrayValues) try {
1665
- createNonEnumerableProperty(CollectionPrototype, ITERATOR$3, ArrayValues);
1666
- } catch (error) {
1667
- CollectionPrototype[ITERATOR$3] = ArrayValues;
1668
- }
1669
- if (!CollectionPrototype[TO_STRING_TAG$2]) {
1670
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
1671
- }
1672
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1673
- // some Chrome versions have non-configurable methods on DOMTokenList
1674
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1675
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1676
- } catch (error) {
1677
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1678
- }
1679
- }
1680
- }
1681
- };
1682
-
1683
- for (var COLLECTION_NAME in DOMIterables) {
1684
- handlePrototype(global$9[COLLECTION_NAME] && global$9[COLLECTION_NAME].prototype, COLLECTION_NAME);
1685
- }
1686
-
1687
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1688
-
1689
- const useWebViewVisibility = core => {
1690
- const webViewVisibilityRequestChannelRef = react.useRef(messageTransport.createRequestChannel(core.messageTransport));
1691
- const [visible, setVisible] = react.useState(false);
1692
- react.useEffect(() => webViewVisibilityRequestChannelRef.current.handle('setVisibility', setVisible), [setVisible]);
1693
- return {
1694
- visible
1695
- };
1696
- };
1697
-
1698
- const styles = reactNative.StyleSheet.create({
1699
- container: {
1700
- backgroundColor: 'transparent',
1701
- bottom: 0,
1702
- flex: 1,
1703
- left: 0,
1704
- position: 'absolute',
1705
- right: 0,
1706
- top: 0,
1707
- width: '100%'
1708
- },
1709
- hide: {
1710
- elevation: 0,
1711
- opacity: 0,
1712
- zIndex: -10000
1713
- },
1714
- show: {
1715
- elevation: 10000,
1716
- opacity: 1,
1717
- zIndex: 10000
1718
- },
1719
- webview: {
1720
- backgroundColor: 'transparent',
1721
- flex: 1
1722
- }
1723
- });
1724
-
1725
- const WebView = ({
1726
- webviewUrl,
1727
- core,
1728
- webviewDebuggingEnabled: _webviewDebuggingEnabled = false
1729
- }) => {
1730
- const webViewRef = react.useRef(null);
1731
- const {
1732
- visible
1733
- } = useWebViewVisibility(core);
1734
- const {
1735
- onMessageHandler
1736
- } = useMessageTransportWebViewBridge(core, webViewRef);
1737
- const containerStyles = [styles['container'], visible ? styles.show : styles.hide];
1738
- return /*#__PURE__*/jsxRuntime.jsx(reactNativeWebview.WebView, {
1739
- ref: webViewRef,
1740
- source: {
1741
- uri: webviewUrl
1742
- },
1743
- containerStyle: containerStyles,
1744
- style: styles['webview'],
1745
- onMessage: onMessageHandler,
1746
- hideKeyboardAccessoryView: true,
1747
- webviewDebuggingEnabled: _webviewDebuggingEnabled,
1748
- onError: () => core.initialization.error = new Error('Could not load Dynamic WebView')
1749
- }, 'webview');
1750
- };
1751
- const createWebView = props => {
1752
- const WebViewWrapper = () => /*#__PURE__*/jsxRuntime.jsx(WebView, Object.assign({}, props));
1753
- return WebViewWrapper;
1754
- };
1755
-
1756
- var classof$3 = classofRaw$2;
1757
- var global$8 = global$j;
1758
-
1759
- var engineIsNode = classof$3(global$8.process) == 'process';
1760
-
1761
- var getBuiltIn$3 = getBuiltIn$8;
1762
- var definePropertyModule$1 = objectDefineProperty;
1763
- var wellKnownSymbol$7 = wellKnownSymbol$e;
1764
- var DESCRIPTORS = descriptors;
1765
-
1766
- var SPECIES$2 = wellKnownSymbol$7('species');
1767
-
1768
- var setSpecies$1 = function (CONSTRUCTOR_NAME) {
1769
- var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
1770
- var defineProperty = definePropertyModule$1.f;
1771
-
1772
- if (DESCRIPTORS && Constructor && !Constructor[SPECIES$2]) {
1773
- defineProperty(Constructor, SPECIES$2, {
1774
- configurable: true,
1775
- get: function () { return this; }
1776
- });
1777
- }
1778
- };
1779
-
1780
- var isPrototypeOf$1 = objectIsPrototypeOf;
1781
-
1782
- var $TypeError$5 = TypeError;
1783
-
1784
- var anInstance$1 = function (it, Prototype) {
1785
- if (isPrototypeOf$1(Prototype, it)) return it;
1786
- throw $TypeError$5('Incorrect invocation');
1787
- };
1788
-
1789
- var wellKnownSymbol$6 = wellKnownSymbol$e;
1790
-
1791
- var TO_STRING_TAG$1 = wellKnownSymbol$6('toStringTag');
1792
- var test = {};
1793
-
1794
- test[TO_STRING_TAG$1] = 'z';
1795
-
1796
- var toStringTagSupport = String(test) === '[object z]';
1797
-
1798
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1799
- var isCallable$5 = isCallable$k;
1800
- var classofRaw$1 = classofRaw$2;
1801
- var wellKnownSymbol$5 = wellKnownSymbol$e;
1802
-
1803
- var TO_STRING_TAG = wellKnownSymbol$5('toStringTag');
1804
- var $Object = Object;
1805
-
1806
- // ES3 wrong here
1807
- var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) == 'Arguments';
1808
-
1809
- // fallback for IE11 Script Access Denied error
1810
- var tryGet = function (it, key) {
1811
- try {
1812
- return it[key];
1813
- } catch (error) { /* empty */ }
1814
- };
1815
-
1816
- // getting tag from ES6+ `Object.prototype.toString`
1817
- var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1818
- var O, tag, result;
1819
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1820
- // @@toStringTag case
1821
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1822
- // builtinTag case
1823
- : CORRECT_ARGUMENTS ? classofRaw$1(O)
1824
- // ES3 arguments fallback
1825
- : (result = classofRaw$1(O)) == 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
1826
- };
1827
-
1828
- var uncurryThis$3 = functionUncurryThis;
1829
- var fails$1 = fails$d;
1830
- var isCallable$4 = isCallable$k;
1831
- var classof$1 = classof$2;
1832
- var getBuiltIn$2 = getBuiltIn$8;
1833
- var inspectSource$1 = inspectSource$3;
1834
-
1835
- var noop = function () { /* empty */ };
1836
- var empty = [];
1837
- var construct = getBuiltIn$2('Reflect', 'construct');
1838
- var constructorRegExp = /^\s*(?:class|function)\b/;
1839
- var exec = uncurryThis$3(constructorRegExp.exec);
1840
- var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1841
-
1842
- var isConstructorModern = function isConstructor(argument) {
1843
- if (!isCallable$4(argument)) return false;
1844
- try {
1845
- construct(noop, empty, argument);
1846
- return true;
1847
- } catch (error) {
1848
- return false;
1849
- }
1850
- };
1851
-
1852
- var isConstructorLegacy = function isConstructor(argument) {
1853
- if (!isCallable$4(argument)) return false;
1854
- switch (classof$1(argument)) {
1855
- case 'AsyncFunction':
1856
- case 'GeneratorFunction':
1857
- case 'AsyncGeneratorFunction': return false;
1858
- }
1859
- try {
1860
- // we can't check .prototype since constructors produced by .bind haven't it
1861
- // `Function#toString` throws on some built-it function in some legacy engines
1862
- // (for example, `DOMQuad` and similar in FF41-)
1863
- return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource$1(argument));
1864
- } catch (error) {
1865
- return true;
1866
- }
1867
- };
1868
-
1869
- isConstructorLegacy.sham = true;
1870
-
1871
- // `IsConstructor` abstract operation
1872
- // https://tc39.es/ecma262/#sec-isconstructor
1873
- var isConstructor$1 = !construct || fails$1(function () {
1874
- var called;
1875
- return isConstructorModern(isConstructorModern.call)
1876
- || !isConstructorModern(Object)
1877
- || !isConstructorModern(function () { called = true; })
1878
- || called;
1879
- }) ? isConstructorLegacy : isConstructorModern;
1880
-
1881
- var isConstructor = isConstructor$1;
1882
- var tryToString$2 = tryToString$4;
1883
-
1884
- var $TypeError$4 = TypeError;
1885
-
1886
- // `Assert: IsConstructor(argument) is true`
1887
- var aConstructor$1 = function (argument) {
1888
- if (isConstructor(argument)) return argument;
1889
- throw $TypeError$4(tryToString$2(argument) + ' is not a constructor');
1890
- };
1891
-
1892
- var anObject$4 = anObject$a;
1893
- var aConstructor = aConstructor$1;
1894
- var isNullOrUndefined$1 = isNullOrUndefined$4;
1895
- var wellKnownSymbol$4 = wellKnownSymbol$e;
1896
-
1897
- var SPECIES$1 = wellKnownSymbol$4('species');
1898
-
1899
- // `SpeciesConstructor` abstract operation
1900
- // https://tc39.es/ecma262/#sec-speciesconstructor
1901
- var speciesConstructor$1 = function (O, defaultConstructor) {
1902
- var C = anObject$4(O).constructor;
1903
- var S;
1904
- return C === undefined || isNullOrUndefined$1(S = anObject$4(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
1905
- };
1906
-
1907
- var NATIVE_BIND$1 = functionBindNative;
1908
-
1909
- var FunctionPrototype = Function.prototype;
1910
- var apply$1 = FunctionPrototype.apply;
1911
- var call$7 = FunctionPrototype.call;
1912
-
1913
- // eslint-disable-next-line es/no-reflect -- safe
1914
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$7.bind(apply$1) : function () {
1915
- return call$7.apply(apply$1, arguments);
1916
- });
1917
-
1918
- var classofRaw = classofRaw$2;
1919
- var uncurryThis$2 = functionUncurryThis;
1920
-
1921
- var functionUncurryThisClause = function (fn) {
1922
- // Nashorn bug:
1923
- // https://github.com/zloirock/core-js/issues/1128
1924
- // https://github.com/zloirock/core-js/issues/1130
1925
- if (classofRaw(fn) === 'Function') return uncurryThis$2(fn);
1926
- };
1927
-
1928
- var uncurryThis$1 = functionUncurryThisClause;
1929
- var aCallable$5 = aCallable$7;
1930
- var NATIVE_BIND = functionBindNative;
1931
-
1932
- var bind$4 = uncurryThis$1(uncurryThis$1.bind);
1933
-
1934
- // optional / simple context binding
1935
- var functionBindContext = function (fn, that) {
1936
- aCallable$5(fn);
1937
- return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
1938
- return fn.apply(that, arguments);
1939
- };
1940
- };
1941
-
1942
- var uncurryThis = functionUncurryThis;
1943
-
1944
- var arraySlice$1 = uncurryThis([].slice);
1945
-
1946
- var $TypeError$3 = TypeError;
1947
-
1948
- var validateArgumentsLength$1 = function (passed, required) {
1949
- if (passed < required) throw $TypeError$3('Not enough arguments');
1950
- return passed;
1951
- };
1952
-
1953
- var userAgent$2 = engineUserAgent;
1954
-
1955
- var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
1956
-
1957
- var global$7 = global$j;
1958
- var apply = functionApply;
1959
- var bind$3 = functionBindContext;
1960
- var isCallable$3 = isCallable$k;
1961
- var hasOwn = hasOwnProperty_1;
1962
- var fails = fails$d;
1963
- var html = html$2;
1964
- var arraySlice = arraySlice$1;
1965
- var createElement = documentCreateElement$2;
1966
- var validateArgumentsLength = validateArgumentsLength$1;
1967
- var IS_IOS$1 = engineIsIos;
1968
- var IS_NODE$3 = engineIsNode;
1969
-
1970
- var set = global$7.setImmediate;
1971
- var clear = global$7.clearImmediate;
1972
- var process$2 = global$7.process;
1973
- var Dispatch = global$7.Dispatch;
1974
- var Function$1 = global$7.Function;
1975
- var MessageChannel = global$7.MessageChannel;
1976
- var String$1 = global$7.String;
1977
- var counter = 0;
1978
- var queue$1 = {};
1979
- var ONREADYSTATECHANGE = 'onreadystatechange';
1980
- var $location, defer, channel, port;
1981
-
1982
- try {
1983
- // Deno throws a ReferenceError on `location` access without `--location` flag
1984
- $location = global$7.location;
1985
- } catch (error) { /* empty */ }
1986
-
1987
- var run = function (id) {
1988
- if (hasOwn(queue$1, id)) {
1989
- var fn = queue$1[id];
1990
- delete queue$1[id];
1991
- fn();
1992
- }
1993
- };
1994
-
1995
- var runner = function (id) {
1996
- return function () {
1997
- run(id);
1998
- };
1999
- };
2000
-
2001
- var listener = function (event) {
2002
- run(event.data);
2003
- };
2004
-
2005
- var post = function (id) {
2006
- // old engines have not location.origin
2007
- global$7.postMessage(String$1(id), $location.protocol + '//' + $location.host);
2008
- };
2009
-
2010
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
2011
- if (!set || !clear) {
2012
- set = function setImmediate(handler) {
2013
- validateArgumentsLength(arguments.length, 1);
2014
- var fn = isCallable$3(handler) ? handler : Function$1(handler);
2015
- var args = arraySlice(arguments, 1);
2016
- queue$1[++counter] = function () {
2017
- apply(fn, undefined, args);
2018
- };
2019
- defer(counter);
2020
- return counter;
2021
- };
2022
- clear = function clearImmediate(id) {
2023
- delete queue$1[id];
2024
- };
2025
- // Node.js 0.8-
2026
- if (IS_NODE$3) {
2027
- defer = function (id) {
2028
- process$2.nextTick(runner(id));
2029
- };
2030
- // Sphere (JS game engine) Dispatch API
2031
- } else if (Dispatch && Dispatch.now) {
2032
- defer = function (id) {
2033
- Dispatch.now(runner(id));
2034
- };
2035
- // Browsers with MessageChannel, includes WebWorkers
2036
- // except iOS - https://github.com/zloirock/core-js/issues/624
2037
- } else if (MessageChannel && !IS_IOS$1) {
2038
- channel = new MessageChannel();
2039
- port = channel.port2;
2040
- channel.port1.onmessage = listener;
2041
- defer = bind$3(port.postMessage, port);
2042
- // Browsers with postMessage, skip WebWorkers
2043
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
2044
- } else if (
2045
- global$7.addEventListener &&
2046
- isCallable$3(global$7.postMessage) &&
2047
- !global$7.importScripts &&
2048
- $location && $location.protocol !== 'file:' &&
2049
- !fails(post)
2050
- ) {
2051
- defer = post;
2052
- global$7.addEventListener('message', listener, false);
2053
- // IE8-
2054
- } else if (ONREADYSTATECHANGE in createElement('script')) {
2055
- defer = function (id) {
2056
- html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
2057
- html.removeChild(this);
2058
- run(id);
2059
- };
2060
- };
2061
- // Rest old browsers
2062
- } else {
2063
- defer = function (id) {
2064
- setTimeout(runner(id), 0);
2065
- };
2066
- }
2067
- }
2068
-
2069
- var task$1 = {
2070
- set: set,
2071
- clear: clear
2072
- };
2073
-
2074
- var userAgent$1 = engineUserAgent;
2075
- var global$6 = global$j;
2076
-
2077
- var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$6.Pebble !== undefined;
2078
-
2079
- var userAgent = engineUserAgent;
2080
-
2081
- var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
2082
-
2083
- var global$5 = global$j;
2084
- var bind$2 = functionBindContext;
2085
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
2086
- var macrotask = task$1.set;
2087
- var IS_IOS = engineIsIos;
2088
- var IS_IOS_PEBBLE = engineIsIosPebble;
2089
- var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
2090
- var IS_NODE$2 = engineIsNode;
2091
-
2092
- var MutationObserver = global$5.MutationObserver || global$5.WebKitMutationObserver;
2093
- var document$2 = global$5.document;
2094
- var process$1 = global$5.process;
2095
- var Promise$1 = global$5.Promise;
2096
- // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
2097
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$5, 'queueMicrotask');
2098
- var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
2099
-
2100
- var flush, head, last, notify$1, toggle, node, promise, then;
2101
-
2102
- // modern engines have queueMicrotask method
2103
- if (!queueMicrotask) {
2104
- flush = function () {
2105
- var parent, fn;
2106
- if (IS_NODE$2 && (parent = process$1.domain)) parent.exit();
2107
- while (head) {
2108
- fn = head.fn;
2109
- head = head.next;
2110
- try {
2111
- fn();
2112
- } catch (error) {
2113
- if (head) notify$1();
2114
- else last = undefined;
2115
- throw error;
2116
- }
2117
- } last = undefined;
2118
- if (parent) parent.enter();
2119
- };
2120
-
2121
- // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
2122
- // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
2123
- if (!IS_IOS && !IS_NODE$2 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
2124
- toggle = true;
2125
- node = document$2.createTextNode('');
2126
- new MutationObserver(flush).observe(node, { characterData: true });
2127
- notify$1 = function () {
2128
- node.data = toggle = !toggle;
2129
- };
2130
- // environments with maybe non-completely correct, but existent Promise
2131
- } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
2132
- // Promise.resolve without an argument throws an error in LG WebOS 2
2133
- promise = Promise$1.resolve(undefined);
2134
- // workaround of WebKit ~ iOS Safari 10.1 bug
2135
- promise.constructor = Promise$1;
2136
- then = bind$2(promise.then, promise);
2137
- notify$1 = function () {
2138
- then(flush);
2139
- };
2140
- // Node.js without promises
2141
- } else if (IS_NODE$2) {
2142
- notify$1 = function () {
2143
- process$1.nextTick(flush);
2144
- };
2145
- // for other environments - macrotask based on:
2146
- // - setImmediate
2147
- // - MessageChannel
2148
- // - window.postMessage
2149
- // - onreadystatechange
2150
- // - setTimeout
2151
- } else {
2152
- // strange IE + webpack dev server bug - use .bind(global)
2153
- macrotask = bind$2(macrotask, global$5);
2154
- notify$1 = function () {
2155
- macrotask(flush);
2156
- };
2157
- }
2158
- }
2159
-
2160
- var microtask$1 = queueMicrotask || function (fn) {
2161
- var task = { fn: fn, next: undefined };
2162
- if (last) last.next = task;
2163
- if (!head) {
2164
- head = task;
2165
- notify$1();
2166
- } last = task;
2167
- };
2168
-
2169
- var global$4 = global$j;
2170
-
2171
- var hostReportErrors$1 = function (a, b) {
2172
- var console = global$4.console;
2173
- if (console && console.error) {
2174
- arguments.length == 1 ? console.error(a) : console.error(a, b);
2175
- }
2176
- };
2177
-
2178
- var perform$3 = function (exec) {
2179
- try {
2180
- return { error: false, value: exec() };
2181
- } catch (error) {
2182
- return { error: true, value: error };
2183
- }
2184
- };
2185
-
2186
- var Queue$1 = function () {
2187
- this.head = null;
2188
- this.tail = null;
2189
- };
2190
-
2191
- Queue$1.prototype = {
2192
- add: function (item) {
2193
- var entry = { item: item, next: null };
2194
- if (this.head) this.tail.next = entry;
2195
- else this.head = entry;
2196
- this.tail = entry;
2197
- },
2198
- get: function () {
2199
- var entry = this.head;
2200
- if (entry) {
2201
- this.head = entry.next;
2202
- if (this.tail === entry) this.tail = null;
2203
- return entry.item;
2204
- }
2205
- }
2206
- };
2207
-
2208
- var queue = Queue$1;
2209
-
2210
- var global$3 = global$j;
2211
-
2212
- var promiseNativeConstructor = global$3.Promise;
2213
-
2214
- /* global Deno -- Deno case */
2215
-
2216
- var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
2217
-
2218
- var IS_DENO$1 = engineIsDeno;
2219
- var IS_NODE$1 = engineIsNode;
2220
-
2221
- var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
2222
- && typeof window == 'object'
2223
- && typeof document == 'object';
2224
-
2225
- var global$2 = global$j;
2226
- var NativePromiseConstructor$3 = promiseNativeConstructor;
2227
- var isCallable$2 = isCallable$k;
2228
- var isForced = isForced_1;
2229
- var inspectSource = inspectSource$3;
2230
- var wellKnownSymbol$3 = wellKnownSymbol$e;
2231
- var IS_BROWSER = engineIsBrowser;
2232
- var IS_DENO = engineIsDeno;
2233
- var V8_VERSION = engineV8Version;
2234
-
2235
- NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
2236
- var SPECIES = wellKnownSymbol$3('species');
2237
- var SUBCLASSING = false;
2238
- var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$2(global$2.PromiseRejectionEvent);
2239
-
2240
- var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
2241
- var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
2242
- var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
2243
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
2244
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
2245
- // We can't detect it synchronously, so just check versions
2246
- if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
2247
- // We can't use @@species feature detection in V8 since it causes
2248
- // deoptimization and performance degradation
2249
- // https://github.com/zloirock/core-js/issues/679
2250
- if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
2251
- // Detect correctness of subclassing with @@species support
2252
- var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
2253
- var FakePromise = function (exec) {
2254
- exec(function () { /* empty */ }, function () { /* empty */ });
2255
- };
2256
- var constructor = promise.constructor = {};
2257
- constructor[SPECIES] = FakePromise;
2258
- SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
2259
- if (!SUBCLASSING) return true;
2260
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
2261
- } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
2262
- });
2263
-
2264
- var promiseConstructorDetection = {
2265
- CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
2266
- REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
2267
- SUBCLASSING: SUBCLASSING
2268
- };
2269
-
2270
- var newPromiseCapability$2 = {};
2271
-
2272
- var aCallable$4 = aCallable$7;
2273
-
2274
- var $TypeError$2 = TypeError;
2275
-
2276
- var PromiseCapability = function (C) {
2277
- var resolve, reject;
2278
- this.promise = new C(function ($$resolve, $$reject) {
2279
- if (resolve !== undefined || reject !== undefined) throw $TypeError$2('Bad Promise constructor');
2280
- resolve = $$resolve;
2281
- reject = $$reject;
2282
- });
2283
- this.resolve = aCallable$4(resolve);
2284
- this.reject = aCallable$4(reject);
2285
- };
2286
-
2287
- // `NewPromiseCapability` abstract operation
2288
- // https://tc39.es/ecma262/#sec-newpromisecapability
2289
- newPromiseCapability$2.f = function (C) {
2290
- return new PromiseCapability(C);
2291
- };
2292
-
2293
- var $$6 = _export;
2294
- var IS_NODE = engineIsNode;
2295
- var global$1 = global$j;
2296
- var call$6 = functionCall;
2297
- var defineBuiltIn$1 = defineBuiltIn$5;
2298
- var setPrototypeOf = objectSetPrototypeOf;
2299
- var setToStringTag = setToStringTag$3;
2300
- var setSpecies = setSpecies$1;
2301
- var aCallable$3 = aCallable$7;
2302
- var isCallable$1 = isCallable$k;
2303
- var isObject$1 = isObject$8;
2304
- var anInstance = anInstance$1;
2305
- var speciesConstructor = speciesConstructor$1;
2306
- var task = task$1.set;
2307
- var microtask = microtask$1;
2308
- var hostReportErrors = hostReportErrors$1;
2309
- var perform$2 = perform$3;
2310
- var Queue = queue;
2311
- var InternalStateModule = internalState;
2312
- var NativePromiseConstructor$2 = promiseNativeConstructor;
2313
- var PromiseConstructorDetection = promiseConstructorDetection;
2314
- var newPromiseCapabilityModule$3 = newPromiseCapability$2;
2315
-
2316
- var PROMISE = 'Promise';
2317
- var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
2318
- var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
2319
- var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
2320
- var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
2321
- var setInternalState = InternalStateModule.set;
2322
- var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
2323
- var PromiseConstructor = NativePromiseConstructor$2;
2324
- var PromisePrototype = NativePromisePrototype$1;
2325
- var TypeError$1 = global$1.TypeError;
2326
- var document$1 = global$1.document;
2327
- var process = global$1.process;
2328
- var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
2329
- var newGenericPromiseCapability = newPromiseCapability$1;
2330
-
2331
- var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$1.dispatchEvent);
2332
- var UNHANDLED_REJECTION = 'unhandledrejection';
2333
- var REJECTION_HANDLED = 'rejectionhandled';
2334
- var PENDING = 0;
2335
- var FULFILLED = 1;
2336
- var REJECTED = 2;
2337
- var HANDLED = 1;
2338
- var UNHANDLED = 2;
2339
-
2340
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
2341
-
2342
- // helpers
2343
- var isThenable = function (it) {
2344
- var then;
2345
- return isObject$1(it) && isCallable$1(then = it.then) ? then : false;
2346
- };
2347
-
2348
- var callReaction = function (reaction, state) {
2349
- var value = state.value;
2350
- var ok = state.state == FULFILLED;
2351
- var handler = ok ? reaction.ok : reaction.fail;
2352
- var resolve = reaction.resolve;
2353
- var reject = reaction.reject;
2354
- var domain = reaction.domain;
2355
- var result, then, exited;
2356
- try {
2357
- if (handler) {
2358
- if (!ok) {
2359
- if (state.rejection === UNHANDLED) onHandleUnhandled(state);
2360
- state.rejection = HANDLED;
2361
- }
2362
- if (handler === true) result = value;
2363
- else {
2364
- if (domain) domain.enter();
2365
- result = handler(value); // can throw
2366
- if (domain) {
2367
- domain.exit();
2368
- exited = true;
19
+ function _extends() {
20
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
21
+ for (var i = 1; i < arguments.length; i++) {
22
+ var source = arguments[i];
23
+ for (var key in source) {
24
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
25
+ target[key] = source[key];
2369
26
  }
2370
27
  }
2371
- if (result === reaction.promise) {
2372
- reject(TypeError$1('Promise-chain cycle'));
2373
- } else if (then = isThenable(result)) {
2374
- call$6(then, result, resolve, reject);
2375
- } else resolve(result);
2376
- } else reject(value);
2377
- } catch (error) {
2378
- if (domain && !exited) domain.exit();
2379
- reject(error);
2380
- }
2381
- };
2382
-
2383
- var notify = function (state, isReject) {
2384
- if (state.notified) return;
2385
- state.notified = true;
2386
- microtask(function () {
2387
- var reactions = state.reactions;
2388
- var reaction;
2389
- while (reaction = reactions.get()) {
2390
- callReaction(reaction, state);
2391
- }
2392
- state.notified = false;
2393
- if (isReject && !state.rejection) onUnhandled(state);
2394
- });
2395
- };
2396
-
2397
- var dispatchEvent = function (name, promise, reason) {
2398
- var event, handler;
2399
- if (DISPATCH_EVENT) {
2400
- event = document$1.createEvent('Event');
2401
- event.promise = promise;
2402
- event.reason = reason;
2403
- event.initEvent(name, false, true);
2404
- global$1.dispatchEvent(event);
2405
- } else event = { promise: promise, reason: reason };
2406
- if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$1['on' + name])) handler(event);
2407
- else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
2408
- };
2409
-
2410
- var onUnhandled = function (state) {
2411
- call$6(task, global$1, function () {
2412
- var promise = state.facade;
2413
- var value = state.value;
2414
- var IS_UNHANDLED = isUnhandled(state);
2415
- var result;
2416
- if (IS_UNHANDLED) {
2417
- result = perform$2(function () {
2418
- if (IS_NODE) {
2419
- process.emit('unhandledRejection', value, promise);
2420
- } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
2421
- });
2422
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
2423
- state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
2424
- if (result.error) throw result.value;
2425
28
  }
2426
- });
2427
- };
2428
-
2429
- var isUnhandled = function (state) {
2430
- return state.rejection !== HANDLED && !state.parent;
2431
- };
2432
-
2433
- var onHandleUnhandled = function (state) {
2434
- call$6(task, global$1, function () {
2435
- var promise = state.facade;
2436
- if (IS_NODE) {
2437
- process.emit('rejectionHandled', promise);
2438
- } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
2439
- });
2440
- };
2441
-
2442
- var bind$1 = function (fn, state, unwrap) {
2443
- return function (value) {
2444
- fn(state, value, unwrap);
29
+ return target;
2445
30
  };
2446
- };
31
+ return _extends.apply(this, arguments);
32
+ }
2447
33
 
2448
- var internalReject = function (state, value, unwrap) {
2449
- if (state.done) return;
2450
- state.done = true;
2451
- if (unwrap) state = unwrap;
2452
- state.value = value;
2453
- state.state = REJECTED;
2454
- notify(state, true);
2455
- };
34
+ const logger = new logger$1.Logger('react-native-extension');
2456
35
 
2457
- var internalResolve = function (state, value, unwrap) {
2458
- if (state.done) return;
2459
- state.done = true;
2460
- if (unwrap) state = unwrap;
2461
- try {
2462
- if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
2463
- var then = isThenable(value);
2464
- if (then) {
2465
- microtask(function () {
2466
- var wrapper = { done: false };
2467
- try {
2468
- call$6(then, value,
2469
- bind$1(internalResolve, wrapper, state),
2470
- bind$1(internalReject, wrapper, state)
2471
- );
2472
- } catch (error) {
2473
- internalReject(wrapper, error, state);
2474
- }
2475
- });
2476
- } else {
2477
- state.value = value;
2478
- state.state = FULFILLED;
2479
- notify(state, false);
2480
- }
2481
- } catch (error) {
2482
- internalReject({ done: false }, error, state);
2483
- }
36
+ const useIsMounted = () => {
37
+ const isMountedRef = react.useRef(true);
38
+ react.useEffect(() => () => {
39
+ isMountedRef.current = false;
40
+ }, []);
41
+ return react.useCallback(() => isMountedRef.current, [isMountedRef]);
2484
42
  };
2485
43
 
2486
- // constructor polyfill
2487
- if (FORCED_PROMISE_CONSTRUCTOR$4) {
2488
- // 25.4.3.1 Promise(executor)
2489
- PromiseConstructor = function Promise(executor) {
2490
- anInstance(this, PromisePrototype);
2491
- aCallable$3(executor);
2492
- call$6(Internal, this);
2493
- var state = getInternalPromiseState(this);
44
+ const useMessageTransportWebViewBridge = (core, webViewRef) => {
45
+ const canBroadcastMessages = useIsMounted();
46
+ /**
47
+ * Receive a message from the webview and forward it to the client
48
+ * message transport
49
+ */
50
+ const onMessageHandler = event => {
51
+ if (!canBroadcastMessages()) return;
52
+ let parsedData = null;
2494
53
  try {
2495
- executor(bind$1(internalResolve, state), bind$1(internalReject, state));
2496
- } catch (error) {
2497
- internalReject(state, error);
2498
- }
2499
- };
2500
-
2501
- PromisePrototype = PromiseConstructor.prototype;
2502
-
2503
- // eslint-disable-next-line no-unused-vars -- required for `.length`
2504
- Internal = function Promise(executor) {
2505
- setInternalState(this, {
2506
- type: PROMISE,
2507
- done: false,
2508
- notified: false,
2509
- parent: false,
2510
- reactions: new Queue(),
2511
- rejection: false,
2512
- state: PENDING,
2513
- value: undefined
2514
- });
2515
- };
2516
-
2517
- // `Promise.prototype.then` method
2518
- // https://tc39.es/ecma262/#sec-promise.prototype.then
2519
- Internal.prototype = defineBuiltIn$1(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
2520
- var state = getInternalPromiseState(this);
2521
- var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
2522
- state.parent = true;
2523
- reaction.ok = isCallable$1(onFulfilled) ? onFulfilled : true;
2524
- reaction.fail = isCallable$1(onRejected) && onRejected;
2525
- reaction.domain = IS_NODE ? process.domain : undefined;
2526
- if (state.state == PENDING) state.reactions.add(reaction);
2527
- else microtask(function () {
2528
- callReaction(reaction, state);
2529
- });
2530
- return reaction.promise;
2531
- });
2532
-
2533
- OwnPromiseCapability = function () {
2534
- var promise = new Internal();
2535
- var state = getInternalPromiseState(promise);
2536
- this.promise = promise;
2537
- this.resolve = bind$1(internalResolve, state);
2538
- this.reject = bind$1(internalReject, state);
2539
- };
2540
-
2541
- newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
2542
- return C === PromiseConstructor || C === PromiseWrapper
2543
- ? new OwnPromiseCapability(C)
2544
- : newGenericPromiseCapability(C);
2545
- };
2546
-
2547
- if (isCallable$1(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
2548
- nativeThen = NativePromisePrototype$1.then;
2549
-
2550
- if (!NATIVE_PROMISE_SUBCLASSING) {
2551
- // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
2552
- defineBuiltIn$1(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
2553
- var that = this;
2554
- return new PromiseConstructor(function (resolve, reject) {
2555
- call$6(nativeThen, that, resolve, reject);
2556
- }).then(onFulfilled, onRejected);
2557
- // https://github.com/zloirock/core-js/issues/640
2558
- }, { unsafe: true });
54
+ parsedData = JSON.parse(event.nativeEvent.data);
55
+ } catch (err) {
56
+ logger.debug('error parsing data', err);
57
+ return;
2559
58
  }
2560
-
2561
- // make `.constructor === Promise` work for native promise-based APIs
2562
- try {
2563
- delete NativePromisePrototype$1.constructor;
2564
- } catch (error) { /* empty */ }
2565
-
2566
- // make `instanceof Promise` work for native promise-based APIs
2567
- if (setPrototypeOf) {
2568
- setPrototypeOf(NativePromisePrototype$1, PromisePrototype);
59
+ const message = messageTransport.parseMessageTransportData(parsedData);
60
+ if (!message) {
61
+ logger.debug('invalid message', message);
62
+ return;
2569
63
  }
2570
- }
2571
- }
2572
-
2573
- $$6({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
2574
- Promise: PromiseConstructor
2575
- });
2576
-
2577
- setToStringTag(PromiseConstructor, PROMISE, false);
2578
- setSpecies(PROMISE);
2579
-
2580
- var wellKnownSymbol$2 = wellKnownSymbol$e;
2581
- var Iterators$1 = iterators;
2582
-
2583
- var ITERATOR$2 = wellKnownSymbol$2('iterator');
2584
- var ArrayPrototype = Array.prototype;
2585
-
2586
- // check on default Array iterator
2587
- var isArrayIteratorMethod$1 = function (it) {
2588
- return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
2589
- };
2590
-
2591
- var classof = classof$2;
2592
- var getMethod$1 = getMethod$3;
2593
- var isNullOrUndefined = isNullOrUndefined$4;
2594
- var Iterators = iterators;
2595
- var wellKnownSymbol$1 = wellKnownSymbol$e;
2596
-
2597
- var ITERATOR$1 = wellKnownSymbol$1('iterator');
2598
-
2599
- var getIteratorMethod$2 = function (it) {
2600
- if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR$1)
2601
- || getMethod$1(it, '@@iterator')
2602
- || Iterators[classof(it)];
2603
- };
2604
-
2605
- var call$5 = functionCall;
2606
- var aCallable$2 = aCallable$7;
2607
- var anObject$3 = anObject$a;
2608
- var tryToString$1 = tryToString$4;
2609
- var getIteratorMethod$1 = getIteratorMethod$2;
2610
-
2611
- var $TypeError$1 = TypeError;
2612
-
2613
- var getIterator$1 = function (argument, usingIterator) {
2614
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
2615
- if (aCallable$2(iteratorMethod)) return anObject$3(call$5(iteratorMethod, argument));
2616
- throw $TypeError$1(tryToString$1(argument) + ' is not iterable');
2617
- };
2618
-
2619
- var call$4 = functionCall;
2620
- var anObject$2 = anObject$a;
2621
- var getMethod = getMethod$3;
2622
-
2623
- var iteratorClose$1 = function (iterator, kind, value) {
2624
- var innerResult, innerError;
2625
- anObject$2(iterator);
2626
- try {
2627
- innerResult = getMethod(iterator, 'return');
2628
- if (!innerResult) {
2629
- if (kind === 'throw') throw value;
2630
- return value;
64
+ /**
65
+ * Only forward messages from the created by the webview
66
+ */
67
+ if (message.origin === 'webview') {
68
+ core.messageTransport.emit(message);
2631
69
  }
2632
- innerResult = call$4(innerResult, iterator);
2633
- } catch (error) {
2634
- innerError = true;
2635
- innerResult = error;
2636
- }
2637
- if (kind === 'throw') throw value;
2638
- if (innerError) throw innerResult;
2639
- anObject$2(innerResult);
2640
- return value;
2641
- };
2642
-
2643
- var bind = functionBindContext;
2644
- var call$3 = functionCall;
2645
- var anObject$1 = anObject$a;
2646
- var tryToString = tryToString$4;
2647
- var isArrayIteratorMethod = isArrayIteratorMethod$1;
2648
- var lengthOfArrayLike = lengthOfArrayLike$2;
2649
- var isPrototypeOf = objectIsPrototypeOf;
2650
- var getIterator = getIterator$1;
2651
- var getIteratorMethod = getIteratorMethod$2;
2652
- var iteratorClose = iteratorClose$1;
2653
-
2654
- var $TypeError = TypeError;
2655
-
2656
- var Result = function (stopped, result) {
2657
- this.stopped = stopped;
2658
- this.result = result;
2659
- };
2660
-
2661
- var ResultPrototype = Result.prototype;
2662
-
2663
- var iterate$3 = function (iterable, unboundFunction, options) {
2664
- var that = options && options.that;
2665
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2666
- var IS_RECORD = !!(options && options.IS_RECORD);
2667
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2668
- var INTERRUPTED = !!(options && options.INTERRUPTED);
2669
- var fn = bind(unboundFunction, that);
2670
- var iterator, iterFn, index, length, result, next, step;
2671
-
2672
- var stop = function (condition) {
2673
- if (iterator) iteratorClose(iterator, 'normal', condition);
2674
- return new Result(true, condition);
2675
70
  };
2676
-
2677
- var callFn = function (value) {
2678
- if (AS_ENTRIES) {
2679
- anObject$1(value);
2680
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2681
- } return INTERRUPTED ? fn(value, stop) : fn(value);
71
+ /**
72
+ * Send messages created by the client to the webview
73
+ */
74
+ react.useEffect(() => {
75
+ const sendMessageToWebView = message => {
76
+ if (!canBroadcastMessages()) return;
77
+ /**
78
+ * Only forward messages to the webview
79
+ * that where created by the client/host
80
+ */
81
+ if (message.origin === 'host' && webViewRef.current) {
82
+ webViewRef.current.postMessage(JSON.stringify(message));
83
+ }
84
+ };
85
+ core.messageTransport.on(sendMessageToWebView);
86
+ return () => {
87
+ core.messageTransport.off(sendMessageToWebView);
88
+ };
89
+ }, [core.messageTransport, webViewRef, canBroadcastMessages]);
90
+ return {
91
+ onMessageHandler
2682
92
  };
2683
-
2684
- if (IS_RECORD) {
2685
- iterator = iterable.iterator;
2686
- } else if (IS_ITERATOR) {
2687
- iterator = iterable;
2688
- } else {
2689
- iterFn = getIteratorMethod(iterable);
2690
- if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
2691
- // optimisation for array iterators
2692
- if (isArrayIteratorMethod(iterFn)) {
2693
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2694
- result = callFn(iterable[index]);
2695
- if (result && isPrototypeOf(ResultPrototype, result)) return result;
2696
- } return new Result(false);
2697
- }
2698
- iterator = getIterator(iterable, iterFn);
2699
- }
2700
-
2701
- next = IS_RECORD ? iterable.next : iterator.next;
2702
- while (!(step = call$3(next, iterator)).done) {
2703
- try {
2704
- result = callFn(step.value);
2705
- } catch (error) {
2706
- iteratorClose(iterator, 'throw', error);
2707
- }
2708
- if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
2709
- } return new Result(false);
2710
93
  };
2711
94
 
2712
- var wellKnownSymbol = wellKnownSymbol$e;
2713
-
2714
- var ITERATOR = wellKnownSymbol('iterator');
2715
- var SAFE_CLOSING = false;
2716
-
2717
- try {
2718
- var called = 0;
2719
- var iteratorWithReturn = {
2720
- next: function () {
2721
- return { done: !!called++ };
2722
- },
2723
- 'return': function () {
2724
- SAFE_CLOSING = true;
2725
- }
2726
- };
2727
- iteratorWithReturn[ITERATOR] = function () {
2728
- return this;
95
+ const useWebViewVisibility = core => {
96
+ const webViewVisibilityRequestChannelRef = react.useRef(messageTransport.createRequestChannel(core.messageTransport));
97
+ const [visible, setVisible] = react.useState(false);
98
+ react.useEffect(() => webViewVisibilityRequestChannelRef.current.handle('setVisibility', setVisible), [setVisible]);
99
+ return {
100
+ visible
2729
101
  };
2730
- // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
2731
- Array.from(iteratorWithReturn, function () { throw 2; });
2732
- } catch (error) { /* empty */ }
2733
-
2734
- var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
2735
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2736
- var ITERATION_SUPPORT = false;
2737
- try {
2738
- var object = {};
2739
- object[ITERATOR] = function () {
2740
- return {
2741
- next: function () {
2742
- return { done: ITERATION_SUPPORT = true };
2743
- }
2744
- };
2745
- };
2746
- exec(object);
2747
- } catch (error) { /* empty */ }
2748
- return ITERATION_SUPPORT;
2749
102
  };
2750
103
 
2751
- var NativePromiseConstructor$1 = promiseNativeConstructor;
2752
- var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
2753
- var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
2754
-
2755
- var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
2756
- NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
2757
- });
2758
-
2759
- var $$5 = _export;
2760
- var call$2 = functionCall;
2761
- var aCallable$1 = aCallable$7;
2762
- var newPromiseCapabilityModule$2 = newPromiseCapability$2;
2763
- var perform$1 = perform$3;
2764
- var iterate$2 = iterate$3;
2765
- var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
2766
-
2767
- // `Promise.all` method
2768
- // https://tc39.es/ecma262/#sec-promise.all
2769
- $$5({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2770
- all: function all(iterable) {
2771
- var C = this;
2772
- var capability = newPromiseCapabilityModule$2.f(C);
2773
- var resolve = capability.resolve;
2774
- var reject = capability.reject;
2775
- var result = perform$1(function () {
2776
- var $promiseResolve = aCallable$1(C.resolve);
2777
- var values = [];
2778
- var counter = 0;
2779
- var remaining = 1;
2780
- iterate$2(iterable, function (promise) {
2781
- var index = counter++;
2782
- var alreadyCalled = false;
2783
- remaining++;
2784
- call$2($promiseResolve, C, promise).then(function (value) {
2785
- if (alreadyCalled) return;
2786
- alreadyCalled = true;
2787
- values[index] = value;
2788
- --remaining || resolve(values);
2789
- }, reject);
2790
- });
2791
- --remaining || resolve(values);
2792
- });
2793
- if (result.error) reject(result.value);
2794
- return capability.promise;
2795
- }
2796
- });
2797
-
2798
- var $$4 = _export;
2799
- var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2800
- var NativePromiseConstructor = promiseNativeConstructor;
2801
- var getBuiltIn$1 = getBuiltIn$8;
2802
- var isCallable = isCallable$k;
2803
- var defineBuiltIn = defineBuiltIn$5;
2804
-
2805
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
2806
-
2807
- // `Promise.prototype.catch` method
2808
- // https://tc39.es/ecma262/#sec-promise.prototype.catch
2809
- $$4({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2810
- 'catch': function (onRejected) {
2811
- return this.then(undefined, onRejected);
2812
- }
2813
- });
2814
-
2815
- // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
2816
- if (isCallable(NativePromiseConstructor)) {
2817
- var method = getBuiltIn$1('Promise').prototype['catch'];
2818
- if (NativePromisePrototype['catch'] !== method) {
2819
- defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
2820
- }
2821
- }
2822
-
2823
- var $$3 = _export;
2824
- var call$1 = functionCall;
2825
- var aCallable = aCallable$7;
2826
- var newPromiseCapabilityModule$1 = newPromiseCapability$2;
2827
- var perform = perform$3;
2828
- var iterate$1 = iterate$3;
2829
- var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
2830
-
2831
- // `Promise.race` method
2832
- // https://tc39.es/ecma262/#sec-promise.race
2833
- $$3({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2834
- race: function race(iterable) {
2835
- var C = this;
2836
- var capability = newPromiseCapabilityModule$1.f(C);
2837
- var reject = capability.reject;
2838
- var result = perform(function () {
2839
- var $promiseResolve = aCallable(C.resolve);
2840
- iterate$1(iterable, function (promise) {
2841
- call$1($promiseResolve, C, promise).then(capability.resolve, reject);
2842
- });
2843
- });
2844
- if (result.error) reject(result.value);
2845
- return capability.promise;
2846
- }
2847
- });
2848
-
2849
- var $$2 = _export;
2850
- var call = functionCall;
2851
- var newPromiseCapabilityModule = newPromiseCapability$2;
2852
- var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2853
-
2854
- // `Promise.reject` method
2855
- // https://tc39.es/ecma262/#sec-promise.reject
2856
- $$2({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2857
- reject: function reject(r) {
2858
- var capability = newPromiseCapabilityModule.f(this);
2859
- call(capability.reject, undefined, r);
2860
- return capability.promise;
104
+ const styles = reactNative.StyleSheet.create({
105
+ container: {
106
+ backgroundColor: 'transparent',
107
+ bottom: 0,
108
+ flex: 1,
109
+ left: 0,
110
+ position: 'absolute',
111
+ right: 0,
112
+ top: 0,
113
+ width: '100%'
114
+ },
115
+ hide: {
116
+ elevation: 0,
117
+ opacity: 0,
118
+ zIndex: -10000
119
+ },
120
+ show: {
121
+ elevation: 10000,
122
+ opacity: 1,
123
+ zIndex: 10000
124
+ },
125
+ webview: {
126
+ backgroundColor: 'transparent',
127
+ flex: 1
2861
128
  }
2862
129
  });
2863
130
 
2864
- var anObject = anObject$a;
2865
- var isObject = isObject$8;
2866
- var newPromiseCapability = newPromiseCapability$2;
2867
-
2868
- var promiseResolve$1 = function (C, x) {
2869
- anObject(C);
2870
- if (isObject(x) && x.constructor === C) return x;
2871
- var promiseCapability = newPromiseCapability.f(C);
2872
- var resolve = promiseCapability.resolve;
2873
- resolve(x);
2874
- return promiseCapability.promise;
131
+ const WebView = ({
132
+ webviewUrl,
133
+ core,
134
+ webviewDebuggingEnabled: _webviewDebuggingEnabled = false
135
+ }) => {
136
+ const webViewRef = react.useRef(null);
137
+ const {
138
+ visible
139
+ } = useWebViewVisibility(core);
140
+ const {
141
+ onMessageHandler
142
+ } = useMessageTransportWebViewBridge(core, webViewRef);
143
+ const containerStyles = [styles['container'], visible ? styles.show : styles.hide];
144
+ return /*#__PURE__*/jsxRuntime.jsx(reactNativeWebview.WebView, {
145
+ ref: webViewRef,
146
+ source: {
147
+ uri: webviewUrl
148
+ },
149
+ containerStyle: containerStyles,
150
+ style: styles['webview'],
151
+ onMessage: onMessageHandler,
152
+ hideKeyboardAccessoryView: true,
153
+ webviewDebuggingEnabled: _webviewDebuggingEnabled,
154
+ onError: () => core.initialization.error = new Error('Could not load Dynamic WebView')
155
+ }, 'webview');
2875
156
  };
2876
-
2877
- var $$1 = _export;
2878
- var getBuiltIn = getBuiltIn$8;
2879
- var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2880
- var promiseResolve = promiseResolve$1;
2881
-
2882
- getBuiltIn('Promise');
2883
-
2884
- // `Promise.resolve` method
2885
- // https://tc39.es/ecma262/#sec-promise.resolve
2886
- $$1({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2887
- resolve: function resolve(x) {
2888
- return promiseResolve(this, x);
2889
- }
2890
- });
2891
-
2892
- var toPropertyKey = toPropertyKey$3;
2893
- var definePropertyModule = objectDefineProperty;
2894
- var createPropertyDescriptor = createPropertyDescriptor$4;
2895
-
2896
- var createProperty$1 = function (object, key, value) {
2897
- var propertyKey = toPropertyKey(key);
2898
- if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
2899
- else object[propertyKey] = value;
157
+ const createWebView = props => {
158
+ const WebViewWrapper = () => /*#__PURE__*/jsxRuntime.jsx(WebView, _extends({}, props));
159
+ return WebViewWrapper;
2900
160
  };
2901
161
 
2902
- var $ = _export;
2903
- var iterate = iterate$3;
2904
- var createProperty = createProperty$1;
2905
-
2906
- // `Object.fromEntries` method
2907
- // https://github.com/tc39/proposal-object-from-entries
2908
- $({ target: 'Object', stat: true }, {
2909
- fromEntries: function fromEntries(iterable) {
2910
- var obj = {};
2911
- iterate(iterable, function (k, v) {
2912
- createProperty(obj, k, v);
2913
- }, { AS_ENTRIES: true });
2914
- return obj;
2915
- }
2916
- });
2917
-
2918
162
  /******************************************************************************
2919
163
  Copyright (c) Microsoft Corporation.
2920
164
 
@@ -3010,7 +254,14 @@ const setupPlatformHandler = core => {
3010
254
  }));
3011
255
  };
3012
256
 
3013
- const defaultWebviewUrl = `https://webview.dynamicauth.com/${version$1}`;
257
+ const setupSecureStorageHandler = core => {
258
+ const secureStorageRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
259
+ secureStorageRequestChannel.handle('getSecureItem', expoSecureStore.getItemAsync);
260
+ secureStorageRequestChannel.handle('setSecureItem', expoSecureStore.setItemAsync);
261
+ secureStorageRequestChannel.handle('deleteSecureItem', expoSecureStore.deleteItemAsync);
262
+ };
263
+
264
+ const defaultWebviewUrl = `https://webview.dynamicauth.com/${version}`;
3014
265
  const ReactNativeExtension = ({
3015
266
  webviewUrl: _webviewUrl = defaultWebviewUrl,
3016
267
  webviewDebuggingEnabled,
@@ -3020,6 +271,7 @@ const ReactNativeExtension = ({
3020
271
  setupPasskeyHandler(core);
3021
272
  setupFetchHandler(core);
3022
273
  setupPlatformHandler(core);
274
+ setupSecureStorageHandler(core);
3023
275
  return {
3024
276
  reactNative: {
3025
277
  WebView: createWebView({
@@ -3031,4 +283,6 @@ const ReactNativeExtension = ({
3031
283
  };
3032
284
  };
3033
285
 
286
+ assertPackageVersion.assertPackageVersion('@dynamic-labs/react-native-extension', version);
287
+
3034
288
  exports.ReactNativeExtension = ReactNativeExtension;