@trackunit/custom-field-components 0.0.1-alpha-59a0a75488.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js ADDED
@@ -0,0 +1,2704 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { CustomFieldType } from '@trackunit/iris-app-runtime-core-api';
3
+ import { FormGroup, Checkbox, DateField, Select, BaseInput, TextField, ActionButton } from '@trackunit/react-components';
4
+ import * as React from 'react';
5
+ import { useCallback, useEffect } from 'react';
6
+ import { isValidPhoneNumber } from 'libphonenumber-js';
7
+
8
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
9
+
10
+ var check = function (it) {
11
+ return it && it.Math == Math && it;
12
+ };
13
+
14
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
15
+ var global$g =
16
+ // eslint-disable-next-line es/no-global-this -- safe
17
+ check(typeof globalThis == 'object' && globalThis) ||
18
+ check(typeof window == 'object' && window) ||
19
+ // eslint-disable-next-line no-restricted-globals -- safe
20
+ check(typeof self == 'object' && self) ||
21
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
22
+ // eslint-disable-next-line no-new-func -- fallback
23
+ (function () { return this; })() || Function('return this')();
24
+
25
+ var objectGetOwnPropertyDescriptor = {};
26
+
27
+ var fails$g = function (exec) {
28
+ try {
29
+ return !!exec();
30
+ } catch (error) {
31
+ return true;
32
+ }
33
+ };
34
+
35
+ var fails$f = fails$g;
36
+
37
+ // Detect IE8's incomplete defineProperty implementation
38
+ var descriptors = !fails$f(function () {
39
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
40
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
41
+ });
42
+
43
+ var fails$e = fails$g;
44
+
45
+ var functionBindNative = !fails$e(function () {
46
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
47
+ var test = (function () { /* empty */ }).bind();
48
+ // eslint-disable-next-line no-prototype-builtins -- safe
49
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
50
+ });
51
+
52
+ var NATIVE_BIND$1 = functionBindNative;
53
+
54
+ var call$8 = Function.prototype.call;
55
+
56
+ var functionCall = NATIVE_BIND$1 ? call$8.bind(call$8) : function () {
57
+ return call$8.apply(call$8, arguments);
58
+ };
59
+
60
+ var objectPropertyIsEnumerable = {};
61
+
62
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
63
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
64
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
65
+
66
+ // Nashorn ~ JDK8 bug
67
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
68
+
69
+ // `Object.prototype.propertyIsEnumerable` method implementation
70
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
71
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
72
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
73
+ return !!descriptor && descriptor.enumerable;
74
+ } : $propertyIsEnumerable;
75
+
76
+ var createPropertyDescriptor$3 = function (bitmap, value) {
77
+ return {
78
+ enumerable: !(bitmap & 1),
79
+ configurable: !(bitmap & 2),
80
+ writable: !(bitmap & 4),
81
+ value: value
82
+ };
83
+ };
84
+
85
+ var NATIVE_BIND = functionBindNative;
86
+
87
+ var FunctionPrototype$1 = Function.prototype;
88
+ var call$7 = FunctionPrototype$1.call;
89
+ var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype$1.bind.bind(call$7, call$7);
90
+
91
+ var functionUncurryThisRaw = function (fn) {
92
+ return NATIVE_BIND ? uncurryThisWithBind(fn) : function () {
93
+ return call$7.apply(fn, arguments);
94
+ };
95
+ };
96
+
97
+ var uncurryThisRaw$1 = functionUncurryThisRaw;
98
+
99
+ var toString$5 = uncurryThisRaw$1({}.toString);
100
+ var stringSlice$3 = uncurryThisRaw$1(''.slice);
101
+
102
+ var classofRaw$2 = function (it) {
103
+ return stringSlice$3(toString$5(it), 8, -1);
104
+ };
105
+
106
+ var classofRaw$1 = classofRaw$2;
107
+ var uncurryThisRaw = functionUncurryThisRaw;
108
+
109
+ var functionUncurryThis = function (fn) {
110
+ // Nashorn bug:
111
+ // https://github.com/zloirock/core-js/issues/1128
112
+ // https://github.com/zloirock/core-js/issues/1130
113
+ if (classofRaw$1(fn) === 'Function') return uncurryThisRaw(fn);
114
+ };
115
+
116
+ var uncurryThis$b = functionUncurryThis;
117
+ var fails$d = fails$g;
118
+ var classof$3 = classofRaw$2;
119
+
120
+ var $Object$4 = Object;
121
+ var split = uncurryThis$b(''.split);
122
+
123
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
124
+ var indexedObject = fails$d(function () {
125
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
126
+ // eslint-disable-next-line no-prototype-builtins -- safe
127
+ return !$Object$4('z').propertyIsEnumerable(0);
128
+ }) ? function (it) {
129
+ return classof$3(it) == 'String' ? split(it, '') : $Object$4(it);
130
+ } : $Object$4;
131
+
132
+ // we can't use just `it == null` since of `document.all` special case
133
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
134
+ var isNullOrUndefined$2 = function (it) {
135
+ return it === null || it === undefined;
136
+ };
137
+
138
+ var isNullOrUndefined$1 = isNullOrUndefined$2;
139
+
140
+ var $TypeError$6 = TypeError;
141
+
142
+ // `RequireObjectCoercible` abstract operation
143
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
144
+ var requireObjectCoercible$2 = function (it) {
145
+ if (isNullOrUndefined$1(it)) throw $TypeError$6("Can't call method on " + it);
146
+ return it;
147
+ };
148
+
149
+ // toObject with fallback for non-array-like ES3 strings
150
+ var IndexedObject$1 = indexedObject;
151
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
152
+
153
+ var toIndexedObject$5 = function (it) {
154
+ return IndexedObject$1(requireObjectCoercible$1(it));
155
+ };
156
+
157
+ var documentAll$2 = typeof document == 'object' && document.all;
158
+
159
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
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$h = $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$g = isCallable$h;
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$g(it) || it === documentAll;
186
+ } : function (it) {
187
+ return typeof it == 'object' ? it !== null : isCallable$g(it);
188
+ };
189
+
190
+ var global$f = global$g;
191
+ var isCallable$f = isCallable$h;
192
+
193
+ var aFunction = function (argument) {
194
+ return isCallable$f(argument) ? argument : undefined;
195
+ };
196
+
197
+ var getBuiltIn$5 = function (namespace, method) {
198
+ return arguments.length < 2 ? aFunction(global$f[namespace]) : global$f[namespace] && global$f[namespace][method];
199
+ };
200
+
201
+ var uncurryThis$a = functionUncurryThis;
202
+
203
+ var objectIsPrototypeOf = uncurryThis$a({}.isPrototypeOf);
204
+
205
+ var getBuiltIn$4 = getBuiltIn$5;
206
+
207
+ var engineUserAgent = getBuiltIn$4('navigator', 'userAgent') || '';
208
+
209
+ var global$e = global$g;
210
+ var userAgent = engineUserAgent;
211
+
212
+ var process = global$e.process;
213
+ var Deno = global$e.Deno;
214
+ var versions = process && process.versions || Deno && Deno.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) {
228
+ match = userAgent.match(/Edge\/(\d+)/);
229
+ if (!match || match[1] >= 74) {
230
+ match = userAgent.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 = engineV8Version;
240
+ var fails$c = fails$g;
241
+
242
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
243
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$c(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 && V8_VERSION < 41;
250
+ });
251
+
252
+ /* eslint-disable es/no-symbol -- required for testing */
253
+
254
+ var NATIVE_SYMBOL$2 = symbolConstructorDetection;
255
+
256
+ var useSymbolAsUid = NATIVE_SYMBOL$2
257
+ && !Symbol.sham
258
+ && typeof Symbol.iterator == 'symbol';
259
+
260
+ var getBuiltIn$3 = getBuiltIn$5;
261
+ var isCallable$e = isCallable$h;
262
+ var isPrototypeOf$3 = 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$3('Symbol');
271
+ return isCallable$e($Symbol) && isPrototypeOf$3($Symbol.prototype, $Object$3(it));
272
+ };
273
+
274
+ var $String$3 = String;
275
+
276
+ var tryToString$1 = function (argument) {
277
+ try {
278
+ return $String$3(argument);
279
+ } catch (error) {
280
+ return 'Object';
281
+ }
282
+ };
283
+
284
+ var isCallable$d = isCallable$h;
285
+ var tryToString = tryToString$1;
286
+
287
+ var $TypeError$5 = TypeError;
288
+
289
+ // `Assert: IsCallable(argument) is true`
290
+ var aCallable$1 = function (argument) {
291
+ if (isCallable$d(argument)) return argument;
292
+ throw $TypeError$5(tryToString(argument) + ' is not a function');
293
+ };
294
+
295
+ var aCallable = aCallable$1;
296
+ var isNullOrUndefined = isNullOrUndefined$2;
297
+
298
+ // `GetMethod` abstract operation
299
+ // https://tc39.es/ecma262/#sec-getmethod
300
+ var getMethod$1 = function (V, P) {
301
+ var func = V[P];
302
+ return isNullOrUndefined(func) ? undefined : aCallable(func);
303
+ };
304
+
305
+ var call$6 = functionCall;
306
+ var isCallable$c = isCallable$h;
307
+ var isObject$7 = isObject$8;
308
+
309
+ var $TypeError$4 = 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$c(fn = input.toString) && !isObject$7(val = call$6(fn, input))) return val;
316
+ if (isCallable$c(fn = input.valueOf) && !isObject$7(val = call$6(fn, input))) return val;
317
+ if (pref !== 'string' && isCallable$c(fn = input.toString) && !isObject$7(val = call$6(fn, input))) return val;
318
+ throw $TypeError$4("Can't convert object to primitive value");
319
+ };
320
+
321
+ var shared$4 = {exports: {}};
322
+
323
+ var global$d = global$g;
324
+
325
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
326
+ var defineProperty$7 = Object.defineProperty;
327
+
328
+ var defineGlobalProperty$3 = function (key, value) {
329
+ try {
330
+ defineProperty$7(global$d, key, { value: value, configurable: true, writable: true });
331
+ } catch (error) {
332
+ global$d[key] = value;
333
+ } return value;
334
+ };
335
+
336
+ var global$c = global$g;
337
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
338
+
339
+ var SHARED = '__core-js_shared__';
340
+ var store$3 = global$c[SHARED] || defineGlobalProperty$2(SHARED, {});
341
+
342
+ var sharedStore = store$3;
343
+
344
+ var store$2 = sharedStore;
345
+
346
+ (shared$4.exports = function (key, value) {
347
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
348
+ })('versions', []).push({
349
+ version: '3.25.5',
350
+ mode: 'global',
351
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
352
+ license: 'https://github.com/zloirock/core-js/blob/v3.25.5/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$9 = functionUncurryThis;
367
+ var toObject$2 = toObject$3;
368
+
369
+ var hasOwnProperty = uncurryThis$9({}.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$8 = functionUncurryThis;
379
+
380
+ var id = 0;
381
+ var postfix = Math.random();
382
+ var toString$4 = uncurryThis$8(1.0.toString);
383
+
384
+ var uid$2 = function (key) {
385
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$4(++id + postfix, 36);
386
+ };
387
+
388
+ var global$b = global$g;
389
+ var shared$3 = shared$4.exports;
390
+ var hasOwn$b = hasOwnProperty_1;
391
+ var uid$1 = uid$2;
392
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
393
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
394
+
395
+ var WellKnownSymbolsStore = shared$3('wks');
396
+ var Symbol$1 = global$b.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$b = function (name) {
401
+ if (!hasOwn$b(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
402
+ var description = 'Symbol.' + name;
403
+ if (NATIVE_SYMBOL$1 && hasOwn$b(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$5 = functionCall;
414
+ var isObject$6 = isObject$8;
415
+ var isSymbol$1 = isSymbol$2;
416
+ var getMethod = getMethod$1;
417
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
418
+ var wellKnownSymbol$a = wellKnownSymbol$b;
419
+
420
+ var $TypeError$3 = TypeError;
421
+ var TO_PRIMITIVE = wellKnownSymbol$a('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(input, TO_PRIMITIVE);
428
+ var result;
429
+ if (exoticToPrim) {
430
+ if (pref === undefined) pref = 'default';
431
+ result = call$5(exoticToPrim, input, pref);
432
+ if (!isObject$6(result) || isSymbol$1(result)) return result;
433
+ throw $TypeError$3("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$2 = function (argument) {
445
+ var key = toPrimitive(argument, 'string');
446
+ return isSymbol(key) ? key : key + '';
447
+ };
448
+
449
+ var global$a = global$g;
450
+ var isObject$5 = isObject$8;
451
+
452
+ var document$1 = global$a.document;
453
+ // typeof document.createElement is 'object' in old IE
454
+ var EXISTS$1 = isObject$5(document$1) && isObject$5(document$1.createElement);
455
+
456
+ var documentCreateElement$2 = function (it) {
457
+ return EXISTS$1 ? document$1.createElement(it) : {};
458
+ };
459
+
460
+ var DESCRIPTORS$c = descriptors;
461
+ var fails$b = fails$g;
462
+ var createElement = documentCreateElement$2;
463
+
464
+ // Thanks to IE8 for its funny defineProperty
465
+ var ie8DomDefine = !DESCRIPTORS$c && !fails$b(function () {
466
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
467
+ return Object.defineProperty(createElement('div'), 'a', {
468
+ get: function () { return 7; }
469
+ }).a != 7;
470
+ });
471
+
472
+ var DESCRIPTORS$b = descriptors;
473
+ var call$4 = functionCall;
474
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
475
+ var createPropertyDescriptor$2 = createPropertyDescriptor$3;
476
+ var toIndexedObject$4 = toIndexedObject$5;
477
+ var toPropertyKey$1 = toPropertyKey$2;
478
+ var hasOwn$a = 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$b ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
487
+ O = toIndexedObject$4(O);
488
+ P = toPropertyKey$1(P);
489
+ if (IE8_DOM_DEFINE$1) try {
490
+ return $getOwnPropertyDescriptor$1(O, P);
491
+ } catch (error) { /* empty */ }
492
+ if (hasOwn$a(O, P)) return createPropertyDescriptor$2(!call$4(propertyIsEnumerableModule$1.f, O, P), O[P]);
493
+ };
494
+
495
+ var objectDefineProperty = {};
496
+
497
+ var DESCRIPTORS$a = descriptors;
498
+ var fails$a = fails$g;
499
+
500
+ // V8 ~ Chrome 36-
501
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
502
+ var v8PrototypeDefineBug = DESCRIPTORS$a && fails$a(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$2 = String;
513
+ var $TypeError$2 = TypeError;
514
+
515
+ // `Assert: Type(argument) is Object`
516
+ var anObject$7 = function (argument) {
517
+ if (isObject$4(argument)) return argument;
518
+ throw $TypeError$2($String$2(argument) + ' is not an object');
519
+ };
520
+
521
+ var DESCRIPTORS$9 = descriptors;
522
+ var IE8_DOM_DEFINE = ie8DomDefine;
523
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
524
+ var anObject$6 = anObject$7;
525
+ var toPropertyKey = toPropertyKey$2;
526
+
527
+ var $TypeError$1 = 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$9 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
539
+ anObject$6(O);
540
+ P = toPropertyKey(P);
541
+ anObject$6(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$6(O);
555
+ P = toPropertyKey(P);
556
+ anObject$6(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$1('Accessors not supported');
561
+ if ('value' in Attributes) O[P] = Attributes.value;
562
+ return O;
563
+ };
564
+
565
+ var DESCRIPTORS$8 = descriptors;
566
+ var definePropertyModule$4 = objectDefineProperty;
567
+ var createPropertyDescriptor$1 = createPropertyDescriptor$3;
568
+
569
+ var createNonEnumerableProperty$5 = DESCRIPTORS$8 ? function (object, key, value) {
570
+ return definePropertyModule$4.f(object, key, createPropertyDescriptor$1(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$7 = descriptors;
579
+ var hasOwn$9 = hasOwnProperty_1;
580
+
581
+ var FunctionPrototype = Function.prototype;
582
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
583
+ var getDescriptor = DESCRIPTORS$7 && Object.getOwnPropertyDescriptor;
584
+
585
+ var EXISTS = hasOwn$9(FunctionPrototype, 'name');
586
+ // additional protection from minified / mangled / dropped function names
587
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
588
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$7 || (DESCRIPTORS$7 && getDescriptor(FunctionPrototype, 'name').configurable));
589
+
590
+ var functionName = {
591
+ EXISTS: EXISTS,
592
+ PROPER: PROPER,
593
+ CONFIGURABLE: CONFIGURABLE
594
+ };
595
+
596
+ var uncurryThis$7 = functionUncurryThis;
597
+ var isCallable$b = isCallable$h;
598
+ var store$1 = sharedStore;
599
+
600
+ var functionToString = uncurryThis$7(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$b(store$1.inspectSource)) {
604
+ store$1.inspectSource = function (it) {
605
+ return functionToString(it);
606
+ };
607
+ }
608
+
609
+ var inspectSource$1 = store$1.inspectSource;
610
+
611
+ var global$9 = global$g;
612
+ var isCallable$a = isCallable$h;
613
+
614
+ var WeakMap$1 = global$9.WeakMap;
615
+
616
+ var weakMapBasicDetection = isCallable$a(WeakMap$1) && /native code/.test(String(WeakMap$1));
617
+
618
+ var shared$2 = shared$4.exports;
619
+ var uid = uid$2;
620
+
621
+ var keys$1 = shared$2('keys');
622
+
623
+ var sharedKey$3 = function (key) {
624
+ return keys$1[key] || (keys$1[key] = uid(key));
625
+ };
626
+
627
+ var hiddenKeys$4 = {};
628
+
629
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
630
+ var global$8 = global$g;
631
+ var isObject$3 = isObject$8;
632
+ var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
633
+ var hasOwn$8 = hasOwnProperty_1;
634
+ var shared$1 = 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$1 = global$8.TypeError;
640
+ var WeakMap = global$8.WeakMap;
641
+ var set, get, has;
642
+
643
+ var enforce = function (it) {
644
+ return has(it) ? get(it) : set(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$1('Incompatible receiver, ' + TYPE + ' required');
652
+ } return state;
653
+ };
654
+ };
655
+
656
+ if (NATIVE_WEAK_MAP || shared$1.state) {
657
+ var store = shared$1.state || (shared$1.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 = function (it, metadata) {
664
+ if (store.has(it)) throw TypeError$1(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 = function (it, metadata) {
679
+ if (hasOwn$8(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
680
+ metadata.facade = it;
681
+ createNonEnumerableProperty$4(it, STATE, metadata);
682
+ return metadata;
683
+ };
684
+ get = function (it) {
685
+ return hasOwn$8(it, STATE) ? it[STATE] : {};
686
+ };
687
+ has = function (it) {
688
+ return hasOwn$8(it, STATE);
689
+ };
690
+ }
691
+
692
+ var internalState = {
693
+ set: set,
694
+ get: get,
695
+ has: has,
696
+ enforce: enforce,
697
+ getterFor: getterFor
698
+ };
699
+
700
+ var fails$9 = fails$g;
701
+ var isCallable$9 = isCallable$h;
702
+ var hasOwn$7 = hasOwnProperty_1;
703
+ var DESCRIPTORS$6 = descriptors;
704
+ var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
705
+ var inspectSource = inspectSource$1;
706
+ var InternalStateModule$1 = internalState;
707
+
708
+ var enforceInternalState$1 = InternalStateModule$1.enforce;
709
+ var getInternalState$2 = InternalStateModule$1.get;
710
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
711
+ var defineProperty$6 = Object.defineProperty;
712
+
713
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$6 && !fails$9(function () {
714
+ return defineProperty$6(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$7(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
726
+ if (DESCRIPTORS$6) defineProperty$6(value, 'name', { value: name, configurable: true });
727
+ else value.name = name;
728
+ }
729
+ if (CONFIGURABLE_LENGTH && options && hasOwn$7(options, 'arity') && value.length !== options.arity) {
730
+ defineProperty$6(value, 'length', { value: options.arity });
731
+ }
732
+ try {
733
+ if (options && hasOwn$7(options, 'constructor') && options.constructor) {
734
+ if (DESCRIPTORS$6) defineProperty$6(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$1(value);
739
+ if (!hasOwn$7(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$9(this) && getInternalState$2(this).source || inspectSource(this);
748
+ }, 'toString');
749
+
750
+ var isCallable$8 = isCallable$h;
751
+ var definePropertyModule$3 = 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$8(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$3.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$1 = function (obj) {
829
+ return toLength(obj.length);
830
+ };
831
+
832
+ var toIndexedObject$3 = toIndexedObject$5;
833
+ var toAbsoluteIndex = toAbsoluteIndex$1;
834
+ var lengthOfArrayLike = lengthOfArrayLike$1;
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(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$6 = functionUncurryThis;
866
+ var hasOwn$6 = hasOwnProperty_1;
867
+ var toIndexedObject$2 = toIndexedObject$5;
868
+ var indexOf$1 = arrayIncludes.indexOf;
869
+ var hiddenKeys$2 = hiddenKeys$4;
870
+
871
+ var push = uncurryThis$6([].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$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push(result, key);
879
+ // Don't enum bug & hidden keys
880
+ while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
881
+ ~indexOf$1(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$2 = getBuiltIn$5;
915
+ var uncurryThis$5 = functionUncurryThis;
916
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
917
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
918
+ var anObject$5 = anObject$7;
919
+
920
+ var concat$1 = uncurryThis$5([].concat);
921
+
922
+ // all object keys, includes non-enumerable and symbols
923
+ var ownKeys$1 = getBuiltIn$2('Reflect', 'ownKeys') || function ownKeys(it) {
924
+ var keys = getOwnPropertyNamesModule.f(anObject$5(it));
925
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
926
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
927
+ };
928
+
929
+ var hasOwn$5 = hasOwnProperty_1;
930
+ var ownKeys = ownKeys$1;
931
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
932
+ var definePropertyModule$2 = objectDefineProperty;
933
+
934
+ var copyConstructorProperties$2 = function (target, source, exceptions) {
935
+ var keys = ownKeys(source);
936
+ var defineProperty = definePropertyModule$2.f;
937
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
938
+ for (var i = 0; i < keys.length; i++) {
939
+ var key = keys[i];
940
+ if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
941
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
942
+ }
943
+ }
944
+ };
945
+
946
+ var fails$8 = fails$g;
947
+ var isCallable$7 = isCallable$h;
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$7(detection) ? fails$8(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$7 = global$g;
970
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
971
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
972
+ var defineBuiltIn$4 = defineBuiltIn$5;
973
+ var defineGlobalProperty = defineGlobalProperty$3;
974
+ var copyConstructorProperties$1 = copyConstructorProperties$2;
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$7;
999
+ } else if (STATIC) {
1000
+ target = global$7[TARGET] || defineGlobalProperty(TARGET, {});
1001
+ } else {
1002
+ target = (global$7[TARGET] || {}).prototype;
1003
+ }
1004
+ if (target) for (key in source) {
1005
+ sourceProperty = source[key];
1006
+ if (options.dontCallGetSet) {
1007
+ descriptor = getOwnPropertyDescriptor(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$1(sourceProperty, targetProperty);
1015
+ }
1016
+ // add a flag to not completely full polyfills
1017
+ if (options.sham || (targetProperty && targetProperty.sham)) {
1018
+ createNonEnumerableProperty$3(sourceProperty, 'sham', true);
1019
+ }
1020
+ defineBuiltIn$4(target, key, sourceProperty, options);
1021
+ }
1022
+ };
1023
+
1024
+ var wellKnownSymbol$9 = wellKnownSymbol$b;
1025
+
1026
+ var TO_STRING_TAG$3 = wellKnownSymbol$9('toStringTag');
1027
+ var test = {};
1028
+
1029
+ test[TO_STRING_TAG$3] = 'z';
1030
+
1031
+ var toStringTagSupport = String(test) === '[object z]';
1032
+
1033
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1034
+ var isCallable$6 = isCallable$h;
1035
+ var classofRaw = classofRaw$2;
1036
+ var wellKnownSymbol$8 = wellKnownSymbol$b;
1037
+
1038
+ var TO_STRING_TAG$2 = wellKnownSymbol$8('toStringTag');
1039
+ var $Object$1 = Object;
1040
+
1041
+ // ES3 wrong here
1042
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1043
+
1044
+ // fallback for IE11 Script Access Denied error
1045
+ var tryGet = function (it, key) {
1046
+ try {
1047
+ return it[key];
1048
+ } catch (error) { /* empty */ }
1049
+ };
1050
+
1051
+ // getting tag from ES6+ `Object.prototype.toString`
1052
+ var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1053
+ var O, tag, result;
1054
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1055
+ // @@toStringTag case
1056
+ : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$2)) == 'string' ? tag
1057
+ // builtinTag case
1058
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1059
+ // ES3 arguments fallback
1060
+ : (result = classofRaw(O)) == 'Object' && isCallable$6(O.callee) ? 'Arguments' : result;
1061
+ };
1062
+
1063
+ var classof$1 = classof$2;
1064
+
1065
+ var $String$1 = String;
1066
+
1067
+ var toString$3 = function (argument) {
1068
+ if (classof$1(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1069
+ return $String$1(argument);
1070
+ };
1071
+
1072
+ var $$3 = _export;
1073
+ var DESCRIPTORS$5 = descriptors;
1074
+ var global$6 = global$g;
1075
+ var uncurryThis$4 = functionUncurryThis;
1076
+ var hasOwn$4 = hasOwnProperty_1;
1077
+ var isCallable$5 = isCallable$h;
1078
+ var isPrototypeOf$2 = objectIsPrototypeOf;
1079
+ var toString$2 = toString$3;
1080
+ var defineProperty$5 = objectDefineProperty.f;
1081
+ var copyConstructorProperties = copyConstructorProperties$2;
1082
+
1083
+ var NativeSymbol = global$6.Symbol;
1084
+ var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
1085
+
1086
+ if (DESCRIPTORS$5 && isCallable$5(NativeSymbol) && (!('description' in SymbolPrototype) ||
1087
+ // Safari 12 bug
1088
+ NativeSymbol().description !== undefined
1089
+ )) {
1090
+ var EmptyStringDescriptionStore = {};
1091
+ // wrap Symbol constructor for correct work with undefined description
1092
+ var SymbolWrapper = function Symbol() {
1093
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$2(arguments[0]);
1094
+ var result = isPrototypeOf$2(SymbolPrototype, this)
1095
+ ? new NativeSymbol(description)
1096
+ // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
1097
+ : description === undefined ? NativeSymbol() : NativeSymbol(description);
1098
+ if (description === '') EmptyStringDescriptionStore[result] = true;
1099
+ return result;
1100
+ };
1101
+
1102
+ copyConstructorProperties(SymbolWrapper, NativeSymbol);
1103
+ SymbolWrapper.prototype = SymbolPrototype;
1104
+ SymbolPrototype.constructor = SymbolWrapper;
1105
+
1106
+ var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
1107
+ var thisSymbolValue = uncurryThis$4(SymbolPrototype.valueOf);
1108
+ var symbolDescriptiveString = uncurryThis$4(SymbolPrototype.toString);
1109
+ var regexp = /^Symbol\((.*)\)[^)]+$/;
1110
+ var replace$2 = uncurryThis$4(''.replace);
1111
+ var stringSlice$2 = uncurryThis$4(''.slice);
1112
+
1113
+ defineProperty$5(SymbolPrototype, 'description', {
1114
+ configurable: true,
1115
+ get: function description() {
1116
+ var symbol = thisSymbolValue(this);
1117
+ if (hasOwn$4(EmptyStringDescriptionStore, symbol)) return '';
1118
+ var string = symbolDescriptiveString(symbol);
1119
+ var desc = NATIVE_SYMBOL ? stringSlice$2(string, 7, -1) : replace$2(string, regexp, '$1');
1120
+ return desc === '' ? undefined : desc;
1121
+ }
1122
+ });
1123
+
1124
+ $$3({ global: true, constructor: true, forced: true }, {
1125
+ Symbol: SymbolWrapper
1126
+ });
1127
+ }
1128
+
1129
+ var internalObjectKeys = objectKeysInternal;
1130
+ var enumBugKeys$1 = enumBugKeys$3;
1131
+
1132
+ // `Object.keys` method
1133
+ // https://tc39.es/ecma262/#sec-object.keys
1134
+ // eslint-disable-next-line es/no-object-keys -- safe
1135
+ var objectKeys$2 = Object.keys || function keys(O) {
1136
+ return internalObjectKeys(O, enumBugKeys$1);
1137
+ };
1138
+
1139
+ var DESCRIPTORS$4 = descriptors;
1140
+ var uncurryThis$3 = functionUncurryThis;
1141
+ var call$3 = functionCall;
1142
+ var fails$7 = fails$g;
1143
+ var objectKeys$1 = objectKeys$2;
1144
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1145
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1146
+ var toObject$1 = toObject$3;
1147
+ var IndexedObject = indexedObject;
1148
+
1149
+ // eslint-disable-next-line es/no-object-assign -- safe
1150
+ var $assign = Object.assign;
1151
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1152
+ var defineProperty$4 = Object.defineProperty;
1153
+ var concat = uncurryThis$3([].concat);
1154
+
1155
+ // `Object.assign` method
1156
+ // https://tc39.es/ecma262/#sec-object.assign
1157
+ var objectAssign = !$assign || fails$7(function () {
1158
+ // should have correct order of operations (Edge bug)
1159
+ if (DESCRIPTORS$4 && $assign({ b: 1 }, $assign(defineProperty$4({}, 'a', {
1160
+ enumerable: true,
1161
+ get: function () {
1162
+ defineProperty$4(this, 'b', {
1163
+ value: 3,
1164
+ enumerable: false
1165
+ });
1166
+ }
1167
+ }), { b: 2 })).b !== 1) return true;
1168
+ // should work with symbols and should have deterministic property order (V8 bug)
1169
+ var A = {};
1170
+ var B = {};
1171
+ // eslint-disable-next-line es/no-symbol -- safe
1172
+ var symbol = Symbol();
1173
+ var alphabet = 'abcdefghijklmnopqrst';
1174
+ A[symbol] = 7;
1175
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1176
+ return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
1177
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1178
+ var T = toObject$1(target);
1179
+ var argumentsLength = arguments.length;
1180
+ var index = 1;
1181
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1182
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1183
+ while (argumentsLength > index) {
1184
+ var S = IndexedObject(arguments[index++]);
1185
+ var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1186
+ var length = keys.length;
1187
+ var j = 0;
1188
+ var key;
1189
+ while (length > j) {
1190
+ key = keys[j++];
1191
+ if (!DESCRIPTORS$4 || call$3(propertyIsEnumerable, S, key)) T[key] = S[key];
1192
+ }
1193
+ } return T;
1194
+ } : $assign;
1195
+
1196
+ var $$2 = _export;
1197
+ var assign = objectAssign;
1198
+
1199
+ // `Object.assign` method
1200
+ // https://tc39.es/ecma262/#sec-object.assign
1201
+ // eslint-disable-next-line es/no-object-assign -- required for testing
1202
+ $$2({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1203
+ assign: assign
1204
+ });
1205
+
1206
+ var objectDefineProperties = {};
1207
+
1208
+ var DESCRIPTORS$3 = descriptors;
1209
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1210
+ var definePropertyModule$1 = objectDefineProperty;
1211
+ var anObject$4 = anObject$7;
1212
+ var toIndexedObject$1 = toIndexedObject$5;
1213
+ var objectKeys = objectKeys$2;
1214
+
1215
+ // `Object.defineProperties` method
1216
+ // https://tc39.es/ecma262/#sec-object.defineproperties
1217
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
1218
+ objectDefineProperties.f = DESCRIPTORS$3 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1219
+ anObject$4(O);
1220
+ var props = toIndexedObject$1(Properties);
1221
+ var keys = objectKeys(Properties);
1222
+ var length = keys.length;
1223
+ var index = 0;
1224
+ var key;
1225
+ while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
1226
+ return O;
1227
+ };
1228
+
1229
+ var getBuiltIn$1 = getBuiltIn$5;
1230
+
1231
+ var html$1 = getBuiltIn$1('document', 'documentElement');
1232
+
1233
+ /* global ActiveXObject -- old IE, WSH */
1234
+
1235
+ var anObject$3 = anObject$7;
1236
+ var definePropertiesModule = objectDefineProperties;
1237
+ var enumBugKeys = enumBugKeys$3;
1238
+ var hiddenKeys = hiddenKeys$4;
1239
+ var html = html$1;
1240
+ var documentCreateElement$1 = documentCreateElement$2;
1241
+ var sharedKey$1 = sharedKey$3;
1242
+
1243
+ var GT = '>';
1244
+ var LT = '<';
1245
+ var PROTOTYPE = 'prototype';
1246
+ var SCRIPT = 'script';
1247
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1248
+
1249
+ var EmptyConstructor = function () { /* empty */ };
1250
+
1251
+ var scriptTag = function (content) {
1252
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1253
+ };
1254
+
1255
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1256
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
1257
+ activeXDocument.write(scriptTag(''));
1258
+ activeXDocument.close();
1259
+ var temp = activeXDocument.parentWindow.Object;
1260
+ activeXDocument = null; // avoid memory leak
1261
+ return temp;
1262
+ };
1263
+
1264
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
1265
+ var NullProtoObjectViaIFrame = function () {
1266
+ // Thrash, waste and sodomy: IE GC bug
1267
+ var iframe = documentCreateElement$1('iframe');
1268
+ var JS = 'java' + SCRIPT + ':';
1269
+ var iframeDocument;
1270
+ iframe.style.display = 'none';
1271
+ html.appendChild(iframe);
1272
+ // https://github.com/zloirock/core-js/issues/475
1273
+ iframe.src = String(JS);
1274
+ iframeDocument = iframe.contentWindow.document;
1275
+ iframeDocument.open();
1276
+ iframeDocument.write(scriptTag('document.F=Object'));
1277
+ iframeDocument.close();
1278
+ return iframeDocument.F;
1279
+ };
1280
+
1281
+ // Check for document.domain and active x support
1282
+ // No need to use active x approach when document.domain is not set
1283
+ // see https://github.com/es-shims/es5-shim/issues/150
1284
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1285
+ // avoid IE GC bug
1286
+ var activeXDocument;
1287
+ var NullProtoObject = function () {
1288
+ try {
1289
+ activeXDocument = new ActiveXObject('htmlfile');
1290
+ } catch (error) { /* ignore */ }
1291
+ NullProtoObject = typeof document != 'undefined'
1292
+ ? document.domain && activeXDocument
1293
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1294
+ : NullProtoObjectViaIFrame()
1295
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
1296
+ var length = enumBugKeys.length;
1297
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1298
+ return NullProtoObject();
1299
+ };
1300
+
1301
+ hiddenKeys[IE_PROTO$1] = true;
1302
+
1303
+ // `Object.create` method
1304
+ // https://tc39.es/ecma262/#sec-object.create
1305
+ // eslint-disable-next-line es/no-object-create -- safe
1306
+ var objectCreate = Object.create || function create(O, Properties) {
1307
+ var result;
1308
+ if (O !== null) {
1309
+ EmptyConstructor[PROTOTYPE] = anObject$3(O);
1310
+ result = new EmptyConstructor();
1311
+ EmptyConstructor[PROTOTYPE] = null;
1312
+ // add "__proto__" for Object.getPrototypeOf polyfill
1313
+ result[IE_PROTO$1] = O;
1314
+ } else result = NullProtoObject();
1315
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1316
+ };
1317
+
1318
+ var wellKnownSymbol$7 = wellKnownSymbol$b;
1319
+ var create$2 = objectCreate;
1320
+ var defineProperty$3 = objectDefineProperty.f;
1321
+
1322
+ var UNSCOPABLES = wellKnownSymbol$7('unscopables');
1323
+ var ArrayPrototype = Array.prototype;
1324
+
1325
+ // Array.prototype[@@unscopables]
1326
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1327
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
1328
+ defineProperty$3(ArrayPrototype, UNSCOPABLES, {
1329
+ configurable: true,
1330
+ value: create$2(null)
1331
+ });
1332
+ }
1333
+
1334
+ // add a key to Array.prototype[@@unscopables]
1335
+ var addToUnscopables$1 = function (key) {
1336
+ ArrayPrototype[UNSCOPABLES][key] = true;
1337
+ };
1338
+
1339
+ var iterators = {};
1340
+
1341
+ var fails$6 = fails$g;
1342
+
1343
+ var correctPrototypeGetter = !fails$6(function () {
1344
+ function F() { /* empty */ }
1345
+ F.prototype.constructor = null;
1346
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1347
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1348
+ });
1349
+
1350
+ var hasOwn$3 = hasOwnProperty_1;
1351
+ var isCallable$4 = isCallable$h;
1352
+ var toObject = toObject$3;
1353
+ var sharedKey = sharedKey$3;
1354
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1355
+
1356
+ var IE_PROTO = sharedKey('IE_PROTO');
1357
+ var $Object = Object;
1358
+ var ObjectPrototype = $Object.prototype;
1359
+
1360
+ // `Object.getPrototypeOf` method
1361
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1362
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
1363
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
1364
+ var object = toObject(O);
1365
+ if (hasOwn$3(object, IE_PROTO)) return object[IE_PROTO];
1366
+ var constructor = object.constructor;
1367
+ if (isCallable$4(constructor) && object instanceof constructor) {
1368
+ return constructor.prototype;
1369
+ } return object instanceof $Object ? ObjectPrototype : null;
1370
+ };
1371
+
1372
+ var fails$5 = fails$g;
1373
+ var isCallable$3 = isCallable$h;
1374
+ var isObject$2 = isObject$8;
1375
+ var getPrototypeOf$1 = objectGetPrototypeOf;
1376
+ var defineBuiltIn$3 = defineBuiltIn$5;
1377
+ var wellKnownSymbol$6 = wellKnownSymbol$b;
1378
+
1379
+ var ITERATOR$2 = wellKnownSymbol$6('iterator');
1380
+ var BUGGY_SAFARI_ITERATORS$1 = false;
1381
+
1382
+ // `%IteratorPrototype%` object
1383
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1384
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1385
+
1386
+ /* eslint-disable es/no-array-prototype-keys -- safe */
1387
+ if ([].keys) {
1388
+ arrayIterator = [].keys();
1389
+ // Safari 8 has buggy iterators w/o `next`
1390
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1391
+ else {
1392
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1393
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1394
+ }
1395
+ }
1396
+
1397
+ var NEW_ITERATOR_PROTOTYPE = !isObject$2(IteratorPrototype$2) || fails$5(function () {
1398
+ var test = {};
1399
+ // FF44- legacy iterators case
1400
+ return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1401
+ });
1402
+
1403
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1404
+
1405
+ // `%IteratorPrototype%[@@iterator]()` method
1406
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1407
+ if (!isCallable$3(IteratorPrototype$2[ITERATOR$2])) {
1408
+ defineBuiltIn$3(IteratorPrototype$2, ITERATOR$2, function () {
1409
+ return this;
1410
+ });
1411
+ }
1412
+
1413
+ var iteratorsCore = {
1414
+ IteratorPrototype: IteratorPrototype$2,
1415
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1416
+ };
1417
+
1418
+ var defineProperty$2 = objectDefineProperty.f;
1419
+ var hasOwn$2 = hasOwnProperty_1;
1420
+ var wellKnownSymbol$5 = wellKnownSymbol$b;
1421
+
1422
+ var TO_STRING_TAG$1 = wellKnownSymbol$5('toStringTag');
1423
+
1424
+ var setToStringTag$2 = function (target, TAG, STATIC) {
1425
+ if (target && !STATIC) target = target.prototype;
1426
+ if (target && !hasOwn$2(target, TO_STRING_TAG$1)) {
1427
+ defineProperty$2(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
1428
+ }
1429
+ };
1430
+
1431
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1432
+ var create$1 = objectCreate;
1433
+ var createPropertyDescriptor = createPropertyDescriptor$3;
1434
+ var setToStringTag$1 = setToStringTag$2;
1435
+ var Iterators$2 = iterators;
1436
+
1437
+ var returnThis$1 = function () { return this; };
1438
+
1439
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1440
+ var TO_STRING_TAG = NAME + ' Iterator';
1441
+ IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1442
+ setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
1443
+ Iterators$2[TO_STRING_TAG] = returnThis$1;
1444
+ return IteratorConstructor;
1445
+ };
1446
+
1447
+ var isCallable$2 = isCallable$h;
1448
+
1449
+ var $String = String;
1450
+ var $TypeError = TypeError;
1451
+
1452
+ var aPossiblePrototype$1 = function (argument) {
1453
+ if (typeof argument == 'object' || isCallable$2(argument)) return argument;
1454
+ throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
1455
+ };
1456
+
1457
+ /* eslint-disable no-proto -- safe */
1458
+
1459
+ var uncurryThis$2 = functionUncurryThis;
1460
+ var anObject$2 = anObject$7;
1461
+ var aPossiblePrototype = aPossiblePrototype$1;
1462
+
1463
+ // `Object.setPrototypeOf` method
1464
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1465
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1466
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
1467
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1468
+ var CORRECT_SETTER = false;
1469
+ var test = {};
1470
+ var setter;
1471
+ try {
1472
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1473
+ setter = uncurryThis$2(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1474
+ setter(test, []);
1475
+ CORRECT_SETTER = test instanceof Array;
1476
+ } catch (error) { /* empty */ }
1477
+ return function setPrototypeOf(O, proto) {
1478
+ anObject$2(O);
1479
+ aPossiblePrototype(proto);
1480
+ if (CORRECT_SETTER) setter(O, proto);
1481
+ else O.__proto__ = proto;
1482
+ return O;
1483
+ };
1484
+ }() : undefined);
1485
+
1486
+ var $$1 = _export;
1487
+ var call$2 = functionCall;
1488
+ var FunctionName = functionName;
1489
+ var isCallable$1 = isCallable$h;
1490
+ var createIteratorConstructor = iteratorCreateConstructor;
1491
+ var getPrototypeOf = objectGetPrototypeOf;
1492
+ var setPrototypeOf$1 = objectSetPrototypeOf;
1493
+ var setToStringTag = setToStringTag$2;
1494
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
1495
+ var defineBuiltIn$2 = defineBuiltIn$5;
1496
+ var wellKnownSymbol$4 = wellKnownSymbol$b;
1497
+ var Iterators$1 = iterators;
1498
+ var IteratorsCore = iteratorsCore;
1499
+
1500
+ var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
1501
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1502
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
1503
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1504
+ var ITERATOR$1 = wellKnownSymbol$4('iterator');
1505
+ var KEYS = 'keys';
1506
+ var VALUES = 'values';
1507
+ var ENTRIES = 'entries';
1508
+
1509
+ var returnThis = function () { return this; };
1510
+
1511
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1512
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1513
+
1514
+ var getIterationMethod = function (KIND) {
1515
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1516
+ if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
1517
+ switch (KIND) {
1518
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1519
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1520
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1521
+ } return function () { return new IteratorConstructor(this); };
1522
+ };
1523
+
1524
+ var TO_STRING_TAG = NAME + ' Iterator';
1525
+ var INCORRECT_VALUES_NAME = false;
1526
+ var IterablePrototype = Iterable.prototype;
1527
+ var nativeIterator = IterablePrototype[ITERATOR$1]
1528
+ || IterablePrototype['@@iterator']
1529
+ || DEFAULT && IterablePrototype[DEFAULT];
1530
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1531
+ var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1532
+ var CurrentIteratorPrototype, methods, KEY;
1533
+
1534
+ // fix native
1535
+ if (anyNativeIterator) {
1536
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1537
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1538
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1539
+ if (setPrototypeOf$1) {
1540
+ setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
1541
+ } else if (!isCallable$1(CurrentIteratorPrototype[ITERATOR$1])) {
1542
+ defineBuiltIn$2(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1543
+ }
1544
+ }
1545
+ // Set @@toStringTag to native iterators
1546
+ setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
1547
+ }
1548
+ }
1549
+
1550
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1551
+ if (PROPER_FUNCTION_NAME$1 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1552
+ if (CONFIGURABLE_FUNCTION_NAME) {
1553
+ createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
1554
+ } else {
1555
+ INCORRECT_VALUES_NAME = true;
1556
+ defaultIterator = function values() { return call$2(nativeIterator, this); };
1557
+ }
1558
+ }
1559
+
1560
+ // export additional methods
1561
+ if (DEFAULT) {
1562
+ methods = {
1563
+ values: getIterationMethod(VALUES),
1564
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1565
+ entries: getIterationMethod(ENTRIES)
1566
+ };
1567
+ if (FORCED) for (KEY in methods) {
1568
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1569
+ defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
1570
+ }
1571
+ } else $$1({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1572
+ }
1573
+
1574
+ // define iterator
1575
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1576
+ defineBuiltIn$2(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1577
+ }
1578
+ Iterators$1[NAME] = defaultIterator;
1579
+
1580
+ return methods;
1581
+ };
1582
+
1583
+ // `CreateIterResultObject` abstract operation
1584
+ // https://tc39.es/ecma262/#sec-createiterresultobject
1585
+ var createIterResultObject$1 = function (value, done) {
1586
+ return { value: value, done: done };
1587
+ };
1588
+
1589
+ var toIndexedObject = toIndexedObject$5;
1590
+ var addToUnscopables = addToUnscopables$1;
1591
+ var Iterators = iterators;
1592
+ var InternalStateModule = internalState;
1593
+ var defineProperty$1 = objectDefineProperty.f;
1594
+ var defineIterator = iteratorDefine;
1595
+ var createIterResultObject = createIterResultObject$1;
1596
+ var DESCRIPTORS$2 = descriptors;
1597
+
1598
+ var ARRAY_ITERATOR = 'Array Iterator';
1599
+ var setInternalState = InternalStateModule.set;
1600
+ var getInternalState$1 = InternalStateModule.getterFor(ARRAY_ITERATOR);
1601
+
1602
+ // `Array.prototype.entries` method
1603
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
1604
+ // `Array.prototype.keys` method
1605
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
1606
+ // `Array.prototype.values` method
1607
+ // https://tc39.es/ecma262/#sec-array.prototype.values
1608
+ // `Array.prototype[@@iterator]` method
1609
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1610
+ // `CreateArrayIterator` internal method
1611
+ // https://tc39.es/ecma262/#sec-createarrayiterator
1612
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1613
+ setInternalState(this, {
1614
+ type: ARRAY_ITERATOR,
1615
+ target: toIndexedObject(iterated), // target
1616
+ index: 0, // next index
1617
+ kind: kind // kind
1618
+ });
1619
+ // `%ArrayIteratorPrototype%.next` method
1620
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1621
+ }, function () {
1622
+ var state = getInternalState$1(this);
1623
+ var target = state.target;
1624
+ var kind = state.kind;
1625
+ var index = state.index++;
1626
+ if (!target || index >= target.length) {
1627
+ state.target = undefined;
1628
+ return createIterResultObject(undefined, true);
1629
+ }
1630
+ if (kind == 'keys') return createIterResultObject(index, false);
1631
+ if (kind == 'values') return createIterResultObject(target[index], false);
1632
+ return createIterResultObject([index, target[index]], false);
1633
+ }, 'values');
1634
+
1635
+ // argumentsList[@@iterator] is %ArrayProto_values%
1636
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1637
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1638
+ var values = Iterators.Arguments = Iterators.Array;
1639
+
1640
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1641
+ addToUnscopables('keys');
1642
+ addToUnscopables('values');
1643
+ addToUnscopables('entries');
1644
+
1645
+ // V8 ~ Chrome 45- bug
1646
+ if (DESCRIPTORS$2 && values.name !== 'values') try {
1647
+ defineProperty$1(values, 'name', { value: 'values' });
1648
+ } catch (error) { /* empty */ }
1649
+
1650
+ // iterable DOM collections
1651
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1652
+ var domIterables = {
1653
+ CSSRuleList: 0,
1654
+ CSSStyleDeclaration: 0,
1655
+ CSSValueList: 0,
1656
+ ClientRectList: 0,
1657
+ DOMRectList: 0,
1658
+ DOMStringList: 0,
1659
+ DOMTokenList: 1,
1660
+ DataTransferItemList: 0,
1661
+ FileList: 0,
1662
+ HTMLAllCollection: 0,
1663
+ HTMLCollection: 0,
1664
+ HTMLFormElement: 0,
1665
+ HTMLSelectElement: 0,
1666
+ MediaList: 0,
1667
+ MimeTypeArray: 0,
1668
+ NamedNodeMap: 0,
1669
+ NodeList: 1,
1670
+ PaintRequestList: 0,
1671
+ Plugin: 0,
1672
+ PluginArray: 0,
1673
+ SVGLengthList: 0,
1674
+ SVGNumberList: 0,
1675
+ SVGPathSegList: 0,
1676
+ SVGPointList: 0,
1677
+ SVGStringList: 0,
1678
+ SVGTransformList: 0,
1679
+ SourceBufferList: 0,
1680
+ StyleSheetList: 0,
1681
+ TextTrackCueList: 0,
1682
+ TextTrackList: 0,
1683
+ TouchList: 0
1684
+ };
1685
+
1686
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1687
+ var documentCreateElement = documentCreateElement$2;
1688
+
1689
+ var classList = documentCreateElement('span').classList;
1690
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1691
+
1692
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1693
+
1694
+ var global$5 = global$g;
1695
+ var DOMIterables = domIterables;
1696
+ var DOMTokenListPrototype = domTokenListPrototype;
1697
+ var ArrayIteratorMethods = es_array_iterator;
1698
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
1699
+ var wellKnownSymbol$3 = wellKnownSymbol$b;
1700
+
1701
+ var ITERATOR = wellKnownSymbol$3('iterator');
1702
+ var TO_STRING_TAG = wellKnownSymbol$3('toStringTag');
1703
+ var ArrayValues = ArrayIteratorMethods.values;
1704
+
1705
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1706
+ if (CollectionPrototype) {
1707
+ // some Chrome versions have non-configurable methods on DOMTokenList
1708
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
1709
+ createNonEnumerableProperty$1(CollectionPrototype, ITERATOR, ArrayValues);
1710
+ } catch (error) {
1711
+ CollectionPrototype[ITERATOR] = ArrayValues;
1712
+ }
1713
+ if (!CollectionPrototype[TO_STRING_TAG]) {
1714
+ createNonEnumerableProperty$1(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
1715
+ }
1716
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1717
+ // some Chrome versions have non-configurable methods on DOMTokenList
1718
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1719
+ createNonEnumerableProperty$1(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1720
+ } catch (error) {
1721
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1722
+ }
1723
+ }
1724
+ }
1725
+ };
1726
+
1727
+ for (var COLLECTION_NAME in DOMIterables) {
1728
+ handlePrototype(global$5[COLLECTION_NAME] && global$5[COLLECTION_NAME].prototype, COLLECTION_NAME);
1729
+ }
1730
+
1731
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1732
+
1733
+ var anObject$1 = anObject$7;
1734
+
1735
+ // `RegExp.prototype.flags` getter implementation
1736
+ // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1737
+ var regexpFlags$1 = function () {
1738
+ var that = anObject$1(this);
1739
+ var result = '';
1740
+ if (that.hasIndices) result += 'd';
1741
+ if (that.global) result += 'g';
1742
+ if (that.ignoreCase) result += 'i';
1743
+ if (that.multiline) result += 'm';
1744
+ if (that.dotAll) result += 's';
1745
+ if (that.unicode) result += 'u';
1746
+ if (that.unicodeSets) result += 'v';
1747
+ if (that.sticky) result += 'y';
1748
+ return result;
1749
+ };
1750
+
1751
+ var call$1 = functionCall;
1752
+ var hasOwn$1 = hasOwnProperty_1;
1753
+ var isPrototypeOf$1 = objectIsPrototypeOf;
1754
+ var regExpFlags = regexpFlags$1;
1755
+
1756
+ var RegExpPrototype$2 = RegExp.prototype;
1757
+
1758
+ var regexpGetFlags = function (R) {
1759
+ var flags = R.flags;
1760
+ return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwn$1(R, 'flags') && isPrototypeOf$1(RegExpPrototype$2, R)
1761
+ ? call$1(regExpFlags, R) : flags;
1762
+ };
1763
+
1764
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
1765
+ var defineBuiltIn$1 = defineBuiltIn$5;
1766
+ var anObject = anObject$7;
1767
+ var $toString = toString$3;
1768
+ var fails$4 = fails$g;
1769
+ var getRegExpFlags$1 = regexpGetFlags;
1770
+
1771
+ var TO_STRING = 'toString';
1772
+ var RegExpPrototype$1 = RegExp.prototype;
1773
+ var nativeToString = RegExpPrototype$1[TO_STRING];
1774
+
1775
+ var NOT_GENERIC = fails$4(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
1776
+ // FF44- RegExp#toString has a wrong name
1777
+ var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name != TO_STRING;
1778
+
1779
+ // `RegExp.prototype.toString` method
1780
+ // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
1781
+ if (NOT_GENERIC || INCORRECT_NAME) {
1782
+ defineBuiltIn$1(RegExp.prototype, TO_STRING, function toString() {
1783
+ var R = anObject(this);
1784
+ var pattern = $toString(R.source);
1785
+ var flags = $toString(getRegExpFlags$1(R));
1786
+ return '/' + pattern + '/' + flags;
1787
+ }, { unsafe: true });
1788
+ }
1789
+
1790
+ /******************************************************************************
1791
+ Copyright (c) Microsoft Corporation.
1792
+
1793
+ Permission to use, copy, modify, and/or distribute this software for any
1794
+ purpose with or without fee is hereby granted.
1795
+
1796
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1797
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1798
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1799
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1800
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1801
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1802
+ PERFORMANCE OF THIS SOFTWARE.
1803
+ ***************************************************************************** */
1804
+
1805
+ function __rest(s, e) {
1806
+ var t = {};
1807
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1808
+ t[p] = s[p];
1809
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1810
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1811
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1812
+ t[p[i]] = s[p[i]];
1813
+ }
1814
+ return t;
1815
+ }
1816
+
1817
+ const BooleanCustomField = _a => {
1818
+ var {
1819
+ defaultValue,
1820
+ dataTestId = "booleanField",
1821
+ onChange,
1822
+ value,
1823
+ id,
1824
+ setValue,
1825
+ register,
1826
+ validationRules,
1827
+ disabled = false,
1828
+ label,
1829
+ tip,
1830
+ isInvalid,
1831
+ errorMessage,
1832
+ helpAddon,
1833
+ maxLength,
1834
+ helpText
1835
+ } = _a,
1836
+ rest = __rest(_a, ["defaultValue", "dataTestId", "onChange", "value", "id", "setValue", "register", "validationRules", "disabled", "label", "tip", "isInvalid", "errorMessage", "helpAddon", "maxLength", "helpText"]);
1837
+
1838
+ const initialValue = value !== undefined ? value : defaultValue ? defaultValue : false;
1839
+ const renderAsInvalid = isInvalid || Boolean(errorMessage);
1840
+ const [internalValue, setInternalValue] = React.useState(initialValue);
1841
+ React.useEffect(() => {
1842
+ setInternalValue((value === undefined ? defaultValue : value) || false);
1843
+ }, [value, setInternalValue, defaultValue]);
1844
+ const onChangeHandler = React.useCallback(event => {
1845
+ onChange && onChange(event);
1846
+ const isChecked = event.target.checked;
1847
+
1848
+ if (setValue) {
1849
+ setValue(id, isChecked);
1850
+ }
1851
+
1852
+ setInternalValue(isChecked);
1853
+ }, [setInternalValue, onChange, id, setValue]);
1854
+ React.useEffect(() => {
1855
+ register && register(id, Object.assign(Object.assign({}, validationRules), {
1856
+ value: internalValue.toString()
1857
+ })); // eslint-disable-next-line react-hooks/exhaustive-deps
1858
+ }, []); // register only once
1859
+
1860
+ return jsx(FormGroup, Object.assign({
1861
+ label: label,
1862
+ tip: tip,
1863
+ isInvalid: renderAsInvalid,
1864
+ helpText: errorMessage || helpText,
1865
+ helpAddon: helpAddon || null,
1866
+ dataTestId: `${dataTestId}-FormGroup`
1867
+ }, {
1868
+ children: jsx(Checkbox, Object.assign({
1869
+ checked: internalValue,
1870
+ dataTestId: dataTestId,
1871
+ id: id,
1872
+ disabled: disabled,
1873
+ name: id,
1874
+ onChange: onChangeHandler,
1875
+ isInvalid: renderAsInvalid
1876
+ }, rest))
1877
+ }));
1878
+ };
1879
+
1880
+ const DateCustomField = props => {
1881
+ const {
1882
+ setValue,
1883
+ defaultValue,
1884
+ register,
1885
+ id,
1886
+ validationRules
1887
+ } = props,
1888
+ rest = __rest(props, ["setValue", "defaultValue", "register", "id", "validationRules"]);
1889
+
1890
+ const onChangeHandler = useCallback(e => {
1891
+ var _a;
1892
+
1893
+ setValue && setValue(id, (_a = e.target.valueAsDate) === null || _a === void 0 ? void 0 : _a.toISOString());
1894
+ }, [setValue, id]);
1895
+ useEffect(() => {
1896
+ const value = defaultValue && new Date(defaultValue);
1897
+ register && register(id, Object.assign(Object.assign({}, validationRules), {
1898
+ value
1899
+ }));
1900
+ }, [register, validationRules, defaultValue, id]);
1901
+ return jsx(DateField, Object.assign({}, rest, {
1902
+ helpAddon: props.helpAddon || null,
1903
+ helpText: props.errorMessage || props.helpText,
1904
+ onChange: onChangeHandler,
1905
+ label: undefined,
1906
+ defaultValue: defaultValue
1907
+ }));
1908
+ };
1909
+
1910
+ const convertToValueFormat = value => {
1911
+ return {
1912
+ label: value,
1913
+ value
1914
+ };
1915
+ };
1916
+
1917
+ const DropdownCustomField = ({
1918
+ defaultValue,
1919
+ dataTestId,
1920
+ onChange,
1921
+ onBlur,
1922
+ id,
1923
+ disabled: _disabled = false,
1924
+ allValues,
1925
+ multiSelect: _multiSelect = false,
1926
+ register,
1927
+ validationRules,
1928
+ setValue,
1929
+ label,
1930
+ tip,
1931
+ errorMessage,
1932
+ helpText,
1933
+ isInvalid,
1934
+ helpAddon
1935
+ }) => {
1936
+ const renderAsInvalid = isInvalid || Boolean(errorMessage);
1937
+ const [selectedValue, setSelectedValue] = React.useState(defaultValue ? defaultValue.map(convertToValueFormat) : []);
1938
+ const onChangeHandler = React.useCallback(selected => {
1939
+ if (selected) {
1940
+ const values = Array.isArray(selected) ? selected : [selected];
1941
+ setSelectedValue(values);
1942
+ setValue && setValue(id, values);
1943
+ } else {
1944
+ setSelectedValue([]);
1945
+ setValue && setValue(id, []);
1946
+ }
1947
+ }, [onChange]);
1948
+ const options = React.useMemo(() => {
1949
+ return allValues ? allValues.map(convertToValueFormat) : [];
1950
+ }, [allValues]);
1951
+ React.useEffect(() => {
1952
+ register && register(id, Object.assign(Object.assign({}, validationRules), {
1953
+ value: selectedValue
1954
+ }));
1955
+ }, [register, validationRules, selectedValue, id]);
1956
+ return jsx(FormGroup, Object.assign({
1957
+ label: label,
1958
+ tip: tip,
1959
+ isInvalid: renderAsInvalid,
1960
+ helpText: errorMessage || helpText,
1961
+ helpAddon: helpAddon || null,
1962
+ dataTestId: `${dataTestId}-FormGroup`
1963
+ }, {
1964
+ children: jsx(Select, {
1965
+ disabled: _disabled,
1966
+ dataTestId: dataTestId,
1967
+ onChange: onChangeHandler,
1968
+ hasError: renderAsInvalid,
1969
+ options: options,
1970
+ value: selectedValue,
1971
+ isMulti: _multiSelect,
1972
+ isClearable: true
1973
+ })
1974
+ }));
1975
+ };
1976
+
1977
+ var isCallable = isCallable$h;
1978
+ var isObject$1 = isObject$8;
1979
+ var setPrototypeOf = objectSetPrototypeOf;
1980
+
1981
+ // makes subclassing work correct for wrapped built-ins
1982
+ var inheritIfRequired$1 = function ($this, dummy, Wrapper) {
1983
+ var NewTarget, NewTargetPrototype;
1984
+ if (
1985
+ // it can work only with native `setPrototypeOf`
1986
+ setPrototypeOf &&
1987
+ // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
1988
+ isCallable(NewTarget = dummy.constructor) &&
1989
+ NewTarget !== Wrapper &&
1990
+ isObject$1(NewTargetPrototype = NewTarget.prototype) &&
1991
+ NewTargetPrototype !== Wrapper.prototype
1992
+ ) setPrototypeOf($this, NewTargetPrototype);
1993
+ return $this;
1994
+ };
1995
+
1996
+ var isObject = isObject$8;
1997
+ var classof = classofRaw$2;
1998
+ var wellKnownSymbol$2 = wellKnownSymbol$b;
1999
+
2000
+ var MATCH$1 = wellKnownSymbol$2('match');
2001
+
2002
+ // `IsRegExp` abstract operation
2003
+ // https://tc39.es/ecma262/#sec-isregexp
2004
+ var isRegexp = function (it) {
2005
+ var isRegExp;
2006
+ return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
2007
+ };
2008
+
2009
+ var fails$3 = fails$g;
2010
+ var global$4 = global$g;
2011
+
2012
+ // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
2013
+ var $RegExp$2 = global$4.RegExp;
2014
+
2015
+ var UNSUPPORTED_Y$2 = fails$3(function () {
2016
+ var re = $RegExp$2('a', 'y');
2017
+ re.lastIndex = 2;
2018
+ return re.exec('abcd') != null;
2019
+ });
2020
+
2021
+ // UC Browser bug
2022
+ // https://github.com/zloirock/core-js/issues/1008
2023
+ var MISSED_STICKY$1 = UNSUPPORTED_Y$2 || fails$3(function () {
2024
+ return !$RegExp$2('a', 'y').sticky;
2025
+ });
2026
+
2027
+ var BROKEN_CARET = UNSUPPORTED_Y$2 || fails$3(function () {
2028
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
2029
+ var re = $RegExp$2('^r', 'gy');
2030
+ re.lastIndex = 2;
2031
+ return re.exec('str') != null;
2032
+ });
2033
+
2034
+ var regexpStickyHelpers = {
2035
+ BROKEN_CARET: BROKEN_CARET,
2036
+ MISSED_STICKY: MISSED_STICKY$1,
2037
+ UNSUPPORTED_Y: UNSUPPORTED_Y$2
2038
+ };
2039
+
2040
+ var defineProperty = objectDefineProperty.f;
2041
+
2042
+ var proxyAccessor$1 = function (Target, Source, key) {
2043
+ key in Target || defineProperty(Target, key, {
2044
+ configurable: true,
2045
+ get: function () { return Source[key]; },
2046
+ set: function (it) { Source[key] = it; }
2047
+ });
2048
+ };
2049
+
2050
+ var getBuiltIn = getBuiltIn$5;
2051
+ var definePropertyModule = objectDefineProperty;
2052
+ var wellKnownSymbol$1 = wellKnownSymbol$b;
2053
+ var DESCRIPTORS$1 = descriptors;
2054
+
2055
+ var SPECIES = wellKnownSymbol$1('species');
2056
+
2057
+ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
2058
+ var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
2059
+ var defineProperty = definePropertyModule.f;
2060
+
2061
+ if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES]) {
2062
+ defineProperty(Constructor, SPECIES, {
2063
+ configurable: true,
2064
+ get: function () { return this; }
2065
+ });
2066
+ }
2067
+ };
2068
+
2069
+ var fails$2 = fails$g;
2070
+ var global$3 = global$g;
2071
+
2072
+ // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
2073
+ var $RegExp$1 = global$3.RegExp;
2074
+
2075
+ var regexpUnsupportedDotAll = fails$2(function () {
2076
+ var re = $RegExp$1('.', 's');
2077
+ return !(re.dotAll && re.exec('\n') && re.flags === 's');
2078
+ });
2079
+
2080
+ var fails$1 = fails$g;
2081
+ var global$2 = global$g;
2082
+
2083
+ // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
2084
+ var $RegExp = global$2.RegExp;
2085
+
2086
+ var regexpUnsupportedNcg = fails$1(function () {
2087
+ var re = $RegExp('(?<a>b)', 'g');
2088
+ return re.exec('b').groups.a !== 'b' ||
2089
+ 'b'.replace(re, '$<a>c') !== 'bc';
2090
+ });
2091
+
2092
+ var DESCRIPTORS = descriptors;
2093
+ var global$1 = global$g;
2094
+ var uncurryThis$1 = functionUncurryThis;
2095
+ var isForced = isForced_1;
2096
+ var inheritIfRequired = inheritIfRequired$1;
2097
+ var createNonEnumerableProperty = createNonEnumerableProperty$5;
2098
+ var getOwnPropertyNames = objectGetOwnPropertyNames.f;
2099
+ var isPrototypeOf = objectIsPrototypeOf;
2100
+ var isRegExp = isRegexp;
2101
+ var toString$1 = toString$3;
2102
+ var getRegExpFlags = regexpGetFlags;
2103
+ var stickyHelpers$1 = regexpStickyHelpers;
2104
+ var proxyAccessor = proxyAccessor$1;
2105
+ var defineBuiltIn = defineBuiltIn$5;
2106
+ var fails = fails$g;
2107
+ var hasOwn = hasOwnProperty_1;
2108
+ var enforceInternalState = internalState.enforce;
2109
+ var setSpecies = setSpecies$1;
2110
+ var wellKnownSymbol = wellKnownSymbol$b;
2111
+ var UNSUPPORTED_DOT_ALL$1 = regexpUnsupportedDotAll;
2112
+ var UNSUPPORTED_NCG$1 = regexpUnsupportedNcg;
2113
+
2114
+ var MATCH = wellKnownSymbol('match');
2115
+ var NativeRegExp = global$1.RegExp;
2116
+ var RegExpPrototype = NativeRegExp.prototype;
2117
+ var SyntaxError = global$1.SyntaxError;
2118
+ var exec$1 = uncurryThis$1(RegExpPrototype.exec);
2119
+ var charAt$1 = uncurryThis$1(''.charAt);
2120
+ var replace$1 = uncurryThis$1(''.replace);
2121
+ var stringIndexOf = uncurryThis$1(''.indexOf);
2122
+ var stringSlice$1 = uncurryThis$1(''.slice);
2123
+ // TODO: Use only proper RegExpIdentifierName
2124
+ var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
2125
+ var re1 = /a/g;
2126
+ var re2 = /a/g;
2127
+
2128
+ // "new" should create a new object, old webkit bug
2129
+ var CORRECT_NEW = new NativeRegExp(re1) !== re1;
2130
+
2131
+ var MISSED_STICKY = stickyHelpers$1.MISSED_STICKY;
2132
+ var UNSUPPORTED_Y$1 = stickyHelpers$1.UNSUPPORTED_Y;
2133
+
2134
+ var BASE_FORCED = DESCRIPTORS &&
2135
+ (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL$1 || UNSUPPORTED_NCG$1 || fails(function () {
2136
+ re2[MATCH] = false;
2137
+ // RegExp constructor can alter flags and IsRegExp works correct with @@match
2138
+ return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
2139
+ }));
2140
+
2141
+ var handleDotAll = function (string) {
2142
+ var length = string.length;
2143
+ var index = 0;
2144
+ var result = '';
2145
+ var brackets = false;
2146
+ var chr;
2147
+ for (; index <= length; index++) {
2148
+ chr = charAt$1(string, index);
2149
+ if (chr === '\\') {
2150
+ result += chr + charAt$1(string, ++index);
2151
+ continue;
2152
+ }
2153
+ if (!brackets && chr === '.') {
2154
+ result += '[\\s\\S]';
2155
+ } else {
2156
+ if (chr === '[') {
2157
+ brackets = true;
2158
+ } else if (chr === ']') {
2159
+ brackets = false;
2160
+ } result += chr;
2161
+ }
2162
+ } return result;
2163
+ };
2164
+
2165
+ var handleNCG = function (string) {
2166
+ var length = string.length;
2167
+ var index = 0;
2168
+ var result = '';
2169
+ var named = [];
2170
+ var names = {};
2171
+ var brackets = false;
2172
+ var ncg = false;
2173
+ var groupid = 0;
2174
+ var groupname = '';
2175
+ var chr;
2176
+ for (; index <= length; index++) {
2177
+ chr = charAt$1(string, index);
2178
+ if (chr === '\\') {
2179
+ chr = chr + charAt$1(string, ++index);
2180
+ } else if (chr === ']') {
2181
+ brackets = false;
2182
+ } else if (!brackets) switch (true) {
2183
+ case chr === '[':
2184
+ brackets = true;
2185
+ break;
2186
+ case chr === '(':
2187
+ if (exec$1(IS_NCG, stringSlice$1(string, index + 1))) {
2188
+ index += 2;
2189
+ ncg = true;
2190
+ }
2191
+ result += chr;
2192
+ groupid++;
2193
+ continue;
2194
+ case chr === '>' && ncg:
2195
+ if (groupname === '' || hasOwn(names, groupname)) {
2196
+ throw new SyntaxError('Invalid capture group name');
2197
+ }
2198
+ names[groupname] = true;
2199
+ named[named.length] = [groupname, groupid];
2200
+ ncg = false;
2201
+ groupname = '';
2202
+ continue;
2203
+ }
2204
+ if (ncg) groupname += chr;
2205
+ else result += chr;
2206
+ } return [result, named];
2207
+ };
2208
+
2209
+ // `RegExp` constructor
2210
+ // https://tc39.es/ecma262/#sec-regexp-constructor
2211
+ if (isForced('RegExp', BASE_FORCED)) {
2212
+ var RegExpWrapper = function RegExp(pattern, flags) {
2213
+ var thisIsRegExp = isPrototypeOf(RegExpPrototype, this);
2214
+ var patternIsRegExp = isRegExp(pattern);
2215
+ var flagsAreUndefined = flags === undefined;
2216
+ var groups = [];
2217
+ var rawPattern = pattern;
2218
+ var rawFlags, dotAll, sticky, handled, result, state;
2219
+
2220
+ if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
2221
+ return pattern;
2222
+ }
2223
+
2224
+ if (patternIsRegExp || isPrototypeOf(RegExpPrototype, pattern)) {
2225
+ pattern = pattern.source;
2226
+ if (flagsAreUndefined) flags = getRegExpFlags(rawPattern);
2227
+ }
2228
+
2229
+ pattern = pattern === undefined ? '' : toString$1(pattern);
2230
+ flags = flags === undefined ? '' : toString$1(flags);
2231
+ rawPattern = pattern;
2232
+
2233
+ if (UNSUPPORTED_DOT_ALL$1 && 'dotAll' in re1) {
2234
+ dotAll = !!flags && stringIndexOf(flags, 's') > -1;
2235
+ if (dotAll) flags = replace$1(flags, /s/g, '');
2236
+ }
2237
+
2238
+ rawFlags = flags;
2239
+
2240
+ if (MISSED_STICKY && 'sticky' in re1) {
2241
+ sticky = !!flags && stringIndexOf(flags, 'y') > -1;
2242
+ if (sticky && UNSUPPORTED_Y$1) flags = replace$1(flags, /y/g, '');
2243
+ }
2244
+
2245
+ if (UNSUPPORTED_NCG$1) {
2246
+ handled = handleNCG(pattern);
2247
+ pattern = handled[0];
2248
+ groups = handled[1];
2249
+ }
2250
+
2251
+ result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);
2252
+
2253
+ if (dotAll || sticky || groups.length) {
2254
+ state = enforceInternalState(result);
2255
+ if (dotAll) {
2256
+ state.dotAll = true;
2257
+ state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
2258
+ }
2259
+ if (sticky) state.sticky = true;
2260
+ if (groups.length) state.groups = groups;
2261
+ }
2262
+
2263
+ if (pattern !== rawPattern) try {
2264
+ // fails in old engines, but we have no alternatives for unsupported regex syntax
2265
+ createNonEnumerableProperty(result, 'source', rawPattern === '' ? '(?:)' : rawPattern);
2266
+ } catch (error) { /* empty */ }
2267
+
2268
+ return result;
2269
+ };
2270
+
2271
+ for (var keys = getOwnPropertyNames(NativeRegExp), index = 0; keys.length > index;) {
2272
+ proxyAccessor(RegExpWrapper, NativeRegExp, keys[index++]);
2273
+ }
2274
+
2275
+ RegExpPrototype.constructor = RegExpWrapper;
2276
+ RegExpWrapper.prototype = RegExpPrototype;
2277
+ defineBuiltIn(global$1, 'RegExp', RegExpWrapper, { constructor: true });
2278
+ }
2279
+
2280
+ // https://tc39.es/ecma262/#sec-get-regexp-@@species
2281
+ setSpecies('RegExp');
2282
+
2283
+ /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
2284
+ /* eslint-disable regexp/no-useless-quantifier -- testing */
2285
+ var call = functionCall;
2286
+ var uncurryThis = functionUncurryThis;
2287
+ var toString = toString$3;
2288
+ var regexpFlags = regexpFlags$1;
2289
+ var stickyHelpers = regexpStickyHelpers;
2290
+ var shared = shared$4.exports;
2291
+ var create = objectCreate;
2292
+ var getInternalState = internalState.get;
2293
+ var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
2294
+ var UNSUPPORTED_NCG = regexpUnsupportedNcg;
2295
+
2296
+ var nativeReplace = shared('native-string-replace', String.prototype.replace);
2297
+ var nativeExec = RegExp.prototype.exec;
2298
+ var patchedExec = nativeExec;
2299
+ var charAt = uncurryThis(''.charAt);
2300
+ var indexOf = uncurryThis(''.indexOf);
2301
+ var replace = uncurryThis(''.replace);
2302
+ var stringSlice = uncurryThis(''.slice);
2303
+
2304
+ var UPDATES_LAST_INDEX_WRONG = (function () {
2305
+ var re1 = /a/;
2306
+ var re2 = /b*/g;
2307
+ call(nativeExec, re1, 'a');
2308
+ call(nativeExec, re2, 'a');
2309
+ return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2310
+ })();
2311
+
2312
+ var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
2313
+
2314
+ // nonparticipating capturing group, copied from es5-shim's String#split patch.
2315
+ var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
2316
+
2317
+ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
2318
+
2319
+ if (PATCH) {
2320
+ patchedExec = function exec(string) {
2321
+ var re = this;
2322
+ var state = getInternalState(re);
2323
+ var str = toString(string);
2324
+ var raw = state.raw;
2325
+ var result, reCopy, lastIndex, match, i, object, group;
2326
+
2327
+ if (raw) {
2328
+ raw.lastIndex = re.lastIndex;
2329
+ result = call(patchedExec, raw, str);
2330
+ re.lastIndex = raw.lastIndex;
2331
+ return result;
2332
+ }
2333
+
2334
+ var groups = state.groups;
2335
+ var sticky = UNSUPPORTED_Y && re.sticky;
2336
+ var flags = call(regexpFlags, re);
2337
+ var source = re.source;
2338
+ var charsAdded = 0;
2339
+ var strCopy = str;
2340
+
2341
+ if (sticky) {
2342
+ flags = replace(flags, 'y', '');
2343
+ if (indexOf(flags, 'g') === -1) {
2344
+ flags += 'g';
2345
+ }
2346
+
2347
+ strCopy = stringSlice(str, re.lastIndex);
2348
+ // Support anchored sticky behavior.
2349
+ if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
2350
+ source = '(?: ' + source + ')';
2351
+ strCopy = ' ' + strCopy;
2352
+ charsAdded++;
2353
+ }
2354
+ // ^(? + rx + ) is needed, in combination with some str slicing, to
2355
+ // simulate the 'y' flag.
2356
+ reCopy = new RegExp('^(?:' + source + ')', flags);
2357
+ }
2358
+
2359
+ if (NPCG_INCLUDED) {
2360
+ reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
2361
+ }
2362
+ if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2363
+
2364
+ match = call(nativeExec, sticky ? reCopy : re, strCopy);
2365
+
2366
+ if (sticky) {
2367
+ if (match) {
2368
+ match.input = stringSlice(match.input, charsAdded);
2369
+ match[0] = stringSlice(match[0], charsAdded);
2370
+ match.index = re.lastIndex;
2371
+ re.lastIndex += match[0].length;
2372
+ } else re.lastIndex = 0;
2373
+ } else if (UPDATES_LAST_INDEX_WRONG && match) {
2374
+ re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
2375
+ }
2376
+ if (NPCG_INCLUDED && match && match.length > 1) {
2377
+ // Fix browsers whose `exec` methods don't consistently return `undefined`
2378
+ // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
2379
+ call(nativeReplace, match[0], reCopy, function () {
2380
+ for (i = 1; i < arguments.length - 2; i++) {
2381
+ if (arguments[i] === undefined) match[i] = undefined;
2382
+ }
2383
+ });
2384
+ }
2385
+
2386
+ if (match && groups) {
2387
+ match.groups = object = create(null);
2388
+ for (i = 0; i < groups.length; i++) {
2389
+ group = groups[i];
2390
+ object[group[0]] = match[group[1]];
2391
+ }
2392
+ }
2393
+
2394
+ return match;
2395
+ };
2396
+ }
2397
+
2398
+ var regexpExec = patchedExec;
2399
+
2400
+ var $ = _export;
2401
+ var exec = regexpExec;
2402
+
2403
+ // `RegExp.prototype.exec` method
2404
+ // https://tc39.es/ecma262/#sec-regexp.prototype.exec
2405
+ $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
2406
+ exec: exec
2407
+ });
2408
+
2409
+ const getWebAddressValidationRules = definition => {
2410
+ const defaultRules = {};
2411
+ const pattern = {
2412
+ pattern: {
2413
+ value: RegExp("^(((https?|ftps?)://)(%[0-9A-Fa-f]{2}|[-()_.!~*';/?:@&=+$,A-Za-z0-9])+)([).!';/?:,][[:blank:|:blank:]])?$"),
2414
+ message: `Must match url pattern`
2415
+ }
2416
+ };
2417
+ return definition.uiEditable ? Object.assign(Object.assign({}, pattern), defaultRules) : defaultRules;
2418
+ };
2419
+ const getNumberValidationRules = definition => {
2420
+ const defaultRules = {
2421
+ valueAsNumber: true
2422
+ };
2423
+ const minimum = definition.minimumNumber && {
2424
+ min: {
2425
+ value: definition.minimumNumber,
2426
+ message: `minimum value is ${definition.minimumNumber}`
2427
+ }
2428
+ };
2429
+ const maximum = definition.maximumNumber && {
2430
+ max: {
2431
+ value: definition.maximumNumber,
2432
+ message: `maximum value is ${definition.maximumNumber}`
2433
+ }
2434
+ }; // TODO: Validate if integer if definition requires integer
2435
+
2436
+ return definition.uiEditable ? Object.assign(Object.assign(Object.assign({}, maximum), minimum), defaultRules) : defaultRules;
2437
+ };
2438
+ const getStringValidationRules = definition => {
2439
+ const defaultRules = {};
2440
+ const minLength = definition.minimumLength ? {
2441
+ minLength: {
2442
+ value: definition.minimumLength,
2443
+ message: `minimum length is ${definition.minimumLength}`
2444
+ },
2445
+ required: {
2446
+ value: true,
2447
+ message: `minimum length is ${definition.minimumLength}`
2448
+ }
2449
+ } : undefined;
2450
+ const maxLength = definition.maximumLength ? {
2451
+ maxLength: {
2452
+ value: definition.maximumLength,
2453
+ message: `maximum length is ${definition.maximumLength}`
2454
+ }
2455
+ } : undefined;
2456
+ const pattern = definition.pattern ? {
2457
+ pattern: {
2458
+ value: RegExp(definition.pattern),
2459
+ message: `Must match pattern: ${definition.pattern}`
2460
+ }
2461
+ } : undefined;
2462
+ return definition.uiEditable ? Object.assign(Object.assign(Object.assign(Object.assign({}, maxLength), minLength), pattern), defaultRules) : defaultRules;
2463
+ };
2464
+ const getBooleanValidationRules = definition => {
2465
+ const defaultRules = {};
2466
+ return defaultRules;
2467
+ };
2468
+ const getDropdownValidationRules = definition => {
2469
+ const defaultRules = {};
2470
+ return defaultRules;
2471
+ };
2472
+ const getDateValidationRules = definition => {
2473
+ const defaultRules = {};
2474
+ return defaultRules;
2475
+ };
2476
+ const getEmailValidationRules = definition => {
2477
+ const defaultRules = {};
2478
+ const pattern = {
2479
+ pattern: {
2480
+ value: RegExp("^[a-zA-Z0-9_+&*-]+(?:.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+.)+[a-zA-Z]{2,7}$"),
2481
+ message: `Must match email pattern`
2482
+ }
2483
+ };
2484
+ return definition.uiEditable ? Object.assign(Object.assign({}, pattern), defaultRules) : defaultRules;
2485
+ };
2486
+ const getPhoneNumberValidationRules = definition => {
2487
+ const defaultRules = {};
2488
+ const pattern = {
2489
+ validate: value => isValidPhoneNumber(value) || value === ""
2490
+ };
2491
+ return definition.uiEditable ? Object.assign(Object.assign({}, pattern), defaultRules) : defaultRules;
2492
+ };
2493
+
2494
+ const useCustomFieldResolver = (field, validation, unitPreference = "SI", fieldId) => {
2495
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
2496
+
2497
+ if ((field === null || field === void 0 ? void 0 : field.definition) === undefined || ((_a = field === null || field === void 0 ? void 0 : field.definition) === null || _a === void 0 ? void 0 : _a.type) === undefined) {
2498
+ return null;
2499
+ }
2500
+
2501
+ const key = (_b = fieldId !== null && fieldId !== void 0 ? fieldId : field.definition.key) !== null && _b !== void 0 ? _b : "";
2502
+ const fieldError = key ? validation.formState.errors[key] : undefined;
2503
+ const errorMessage = fieldError ? fieldError.message + "" : undefined;
2504
+ const {
2505
+ type,
2506
+ description,
2507
+ title
2508
+ } = field.definition;
2509
+
2510
+ switch (type) {
2511
+ case CustomFieldType.WEB_ADDRESS:
2512
+ {
2513
+ const typedDefinition = field.definition;
2514
+ const typedValue = field.value;
2515
+ const rules = getWebAddressValidationRules(typedDefinition);
2516
+ return jsx(TextField, Object.assign({
2517
+ id: key,
2518
+ label: title,
2519
+ placeholder: (_c = typedDefinition.title) !== null && _c !== void 0 ? _c : "",
2520
+ defaultValue: (_e = (_d = typedValue.stringValue) !== null && _d !== void 0 ? _d : typedDefinition.defaultStringValue) !== null && _e !== void 0 ? _e : "",
2521
+ dataTestId: "webAddressField",
2522
+ actions: !typedDefinition.uiEditable && (typedValue.stringValue || typedDefinition.defaultStringValue) && jsx(ActionButton, {
2523
+ value: (_f = typedValue.stringValue) !== null && _f !== void 0 ? _f : typedDefinition.defaultStringValue,
2524
+ type: "WEB_ADDRESS"
2525
+ }),
2526
+ readOnly: !typedDefinition.uiEditable,
2527
+ helpText: description,
2528
+ errorMessage: errorMessage
2529
+ }, validation.register(key, rules)));
2530
+ }
2531
+
2532
+ case CustomFieldType.EMAIL:
2533
+ {
2534
+ const typedDefinition = field.definition;
2535
+ const typedValue = field.value;
2536
+ const rules = getEmailValidationRules(typedDefinition);
2537
+ return jsx(TextField, Object.assign({
2538
+ id: key,
2539
+ label: title,
2540
+ placeholder: (_g = typedDefinition.title) !== null && _g !== void 0 ? _g : "",
2541
+ defaultValue: (_j = (_h = typedValue.stringValue) !== null && _h !== void 0 ? _h : typedDefinition.defaultStringValue) !== null && _j !== void 0 ? _j : "",
2542
+ actions: !typedDefinition.uiEditable && (typedValue.stringValue || typedDefinition.defaultStringValue) && jsx(ActionButton, {
2543
+ value: (_k = typedValue.stringValue) !== null && _k !== void 0 ? _k : typedDefinition.defaultStringValue,
2544
+ type: "EMAIL"
2545
+ }),
2546
+ readOnly: !typedDefinition.uiEditable,
2547
+ helpText: description,
2548
+ errorMessage: errorMessage
2549
+ }, validation.register(key, rules)));
2550
+ }
2551
+
2552
+ case CustomFieldType.PHONE_NUMBER:
2553
+ {
2554
+ const typedDefinition = field.definition;
2555
+ const typedValue = field.value;
2556
+ const rules = getPhoneNumberValidationRules(typedDefinition);
2557
+ return jsx(TextField, Object.assign({
2558
+ label: title,
2559
+ id: key,
2560
+ placeholder: (_l = typedDefinition.title) !== null && _l !== void 0 ? _l : "",
2561
+ defaultValue: (_o = (_m = typedValue.stringValue) !== null && _m !== void 0 ? _m : typedDefinition.defaultStringValue) !== null && _o !== void 0 ? _o : "",
2562
+ actions: !typedDefinition.uiEditable && (typedValue.stringValue || typedDefinition.defaultStringValue) && jsx(ActionButton, {
2563
+ value: (_p = typedValue.stringValue) !== null && _p !== void 0 ? _p : typedDefinition.defaultStringValue,
2564
+ type: "PHONE_NUMBER"
2565
+ }),
2566
+ readOnly: !typedDefinition.uiEditable,
2567
+ helpText: description,
2568
+ errorMessage: errorMessage === "" ? "Must be a phone number" : undefined
2569
+ }, validation.register(key, rules)));
2570
+ }
2571
+
2572
+ case CustomFieldType.STRING:
2573
+ {
2574
+ const typedDefinition = field.definition;
2575
+ const typedValue = field.value;
2576
+ const rules = getStringValidationRules(typedDefinition);
2577
+ return jsx(TextField, Object.assign({
2578
+ label: title,
2579
+ id: key || "string-field",
2580
+ placeholder: (_q = typedDefinition.title) !== null && _q !== void 0 ? _q : "",
2581
+ defaultValue: (_s = (_r = typedValue.stringValue) !== null && _r !== void 0 ? _r : typedDefinition.defaultStringValue) !== null && _s !== void 0 ? _s : "",
2582
+ readOnly: !typedDefinition.uiEditable,
2583
+ helpText: description,
2584
+ errorMessage: errorMessage,
2585
+ dataTestId: `stringField`
2586
+ }, validation.register(key, rules)));
2587
+ }
2588
+
2589
+ case CustomFieldType.NUMBER:
2590
+ {
2591
+ const typedDefinition = field.definition;
2592
+ const typedValue = field.value;
2593
+ const rules = getNumberValidationRules(typedDefinition);
2594
+ const unit = unitPreference === "US_CUSTOMARY" ? typedDefinition.unitUs : typedDefinition.unitSi;
2595
+ return jsx(FormGroup, Object.assign({
2596
+ label: title,
2597
+ isInvalid: errorMessage ? true : false,
2598
+ helpText: errorMessage || description,
2599
+ dataTestId: `numberField-FormGroup`,
2600
+ disabled: !typedDefinition.uiEditable
2601
+ }, {
2602
+ children: jsx(BaseInput, Object.assign({
2603
+ type: "number",
2604
+ id: key || "number-field",
2605
+ dataTestId: "numberField",
2606
+ placeholder: (_t = typedDefinition.title) !== null && _t !== void 0 ? _t : "",
2607
+ defaultValue: (_v = (_u = typedValue.numberValue) !== null && _u !== void 0 ? _u : typedDefinition.defaultNumberValue) !== null && _v !== void 0 ? _v : "",
2608
+ addonAfter: unit,
2609
+ readOnly: !typedDefinition.uiEditable,
2610
+ step: typedDefinition.isInteger ? 1 : "any",
2611
+ min: (_w = typedDefinition.minimumNumber) !== null && _w !== void 0 ? _w : undefined,
2612
+ max: (_x = typedDefinition.maximumNumber) !== null && _x !== void 0 ? _x : undefined
2613
+ }, validation.register(key, rules)))
2614
+ }));
2615
+ }
2616
+
2617
+ case CustomFieldType.BOOLEAN:
2618
+ {
2619
+ const typedDefinition = field.definition;
2620
+ const typedValue = field.value;
2621
+ const rules = getBooleanValidationRules();
2622
+ return jsx(BooleanCustomField, {
2623
+ label: (_y = typedDefinition.title) !== null && _y !== void 0 ? _y : "",
2624
+ id: key || "boolean-field",
2625
+ defaultValue: (_0 = (_z = typedValue.booleanValue) !== null && _z !== void 0 ? _z : typedDefinition.defaultBooleanValue) !== null && _0 !== void 0 ? _0 : undefined,
2626
+ readOnly: !typedDefinition.uiEditable,
2627
+ register: validation.register,
2628
+ validationRules: rules,
2629
+ helpText: description,
2630
+ setValue: validation.setValue,
2631
+ errorMessage: errorMessage,
2632
+ dataTestId: "booleanField"
2633
+ }, key);
2634
+ }
2635
+
2636
+ case CustomFieldType.DROPDOWN:
2637
+ {
2638
+ const typedDefinition = field.definition;
2639
+ const typedValue = field.value;
2640
+ const rules = getDropdownValidationRules();
2641
+ return jsx(DropdownCustomField, {
2642
+ label: typedDefinition.title || "",
2643
+ id: key || "dropdown-field",
2644
+ defaultValue: (_2 = (_1 = typedValue.stringArrayValue) !== null && _1 !== void 0 ? _1 : typedDefinition.defaultStringArrayValue) !== null && _2 !== void 0 ? _2 : undefined,
2645
+ disabled: !typedDefinition.uiEditable,
2646
+ allValues: (_3 = typedDefinition.allValues) !== null && _3 !== void 0 ? _3 : undefined,
2647
+ multiSelect: (_4 = typedDefinition.multiSelect) !== null && _4 !== void 0 ? _4 : false,
2648
+ register: validation.register,
2649
+ validationRules: rules,
2650
+ helpText: description,
2651
+ setValue: validation.setValue,
2652
+ errorMessage: errorMessage,
2653
+ dataTestId: "dropdownField"
2654
+ }, key);
2655
+ }
2656
+
2657
+ case CustomFieldType.DATE:
2658
+ {
2659
+ const typedDefinition = field.definition;
2660
+ const typedValue = field.value;
2661
+ const rules = getDateValidationRules();
2662
+ let defaultValue;
2663
+
2664
+ if (typedValue.dateValue !== undefined && typedValue.dateValue !== null) {
2665
+ defaultValue = new Date(typedValue.dateValue);
2666
+ } else if (typedDefinition.defaultDateValue !== undefined && typedDefinition.defaultDateValue !== null) {
2667
+ defaultValue = new Date(typedDefinition.defaultDateValue);
2668
+ }
2669
+
2670
+ return jsx(DateCustomField, {
2671
+ dataTestId: "dateField",
2672
+ id: key || "date-field",
2673
+ defaultValue: defaultValue,
2674
+ readOnly: !typedDefinition.uiEditable,
2675
+ register: validation.register,
2676
+ label: typedDefinition.title || "",
2677
+ validationRules: rules,
2678
+ helpText: description,
2679
+ errorMessage: errorMessage,
2680
+ setValue: validation.setValue
2681
+ }, key);
2682
+ }
2683
+
2684
+ default:
2685
+ throw new Error(`Type not supported: ${type}`);
2686
+ }
2687
+ };
2688
+ const CustomField = ({
2689
+ field,
2690
+ register,
2691
+ formState,
2692
+ setValue,
2693
+ unitPreference,
2694
+ fieldId
2695
+ }) => {
2696
+ const fieldComponent = useCustomFieldResolver(field, {
2697
+ register,
2698
+ setValue,
2699
+ formState
2700
+ }, unitPreference, fieldId);
2701
+ return fieldComponent;
2702
+ };
2703
+
2704
+ export { CustomField, useCustomFieldResolver };