@sebgroup/green-react 1.2.1 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/{index.esm.js → index.js} +181 -91
  2. package/package.json +7 -6
  3. package/{index.d.ts → src/index.d.ts} +2 -1
  4. package/{lib → src/lib}/dropdown/hooks.d.ts +1 -1
  5. package/src/lib/form/input/input.d.ts +10 -0
  6. package/{lib → src/lib}/form/types.d.ts +5 -1
  7. package/src/lib/layout/flexbox/types.d.ts +5 -0
  8. package/{lib → src/lib}/modal/modal.d.ts +1 -1
  9. package/src/lib/slider/index.d.ts +1 -0
  10. package/src/lib/slider/slider.d.ts +3 -0
  11. package/src/types/props/index.d.ts +28 -0
  12. package/index.umd.js +0 -3654
  13. package/lib/form/input/input.d.ts +0 -10
  14. package/lib/layout/flexbox/types.d.ts +0 -5
  15. package/types/props/index.d.ts +0 -15
  16. /package/{lib → src/lib}/accordion/accordion-item.d.ts +0 -0
  17. /package/{lib → src/lib}/accordion/accordion.d.ts +0 -0
  18. /package/{lib → src/lib}/alert-ribbon/alert-ribbon.d.ts +0 -0
  19. /package/{lib → src/lib}/badge/badge.d.ts +0 -0
  20. /package/{lib → src/lib}/card/card.d.ts +0 -0
  21. /package/{lib → src/lib}/datepicker/datepicker.d.ts +0 -0
  22. /package/{lib → src/lib}/datepicker/hook.d.ts +0 -0
  23. /package/{lib → src/lib}/dropdown/dropdown.d.ts +0 -0
  24. /package/{lib → src/lib}/form/button/button.d.ts +0 -0
  25. /package/{lib → src/lib}/form/buttonGroup/buttonGroup.d.ts +0 -0
  26. /package/{lib → src/lib}/form/form.d.ts +0 -0
  27. /package/{lib → src/lib}/form/formContext.d.ts +0 -0
  28. /package/{lib → src/lib}/form/formItems.d.ts +0 -0
  29. /package/{lib → src/lib}/form/group/group.d.ts +0 -0
  30. /package/{lib → src/lib}/form/iconButton/iconButton.d.ts +0 -0
  31. /package/{lib → src/lib}/form/index.d.ts +0 -0
  32. /package/{lib → src/lib}/form/radioButton/radioGroup.d.ts +0 -0
  33. /package/{lib → src/lib}/form/text/text.d.ts +0 -0
  34. /package/{lib → src/lib}/form/useInput.d.ts +0 -0
  35. /package/{lib → src/lib}/form/validateInput.d.ts +0 -0
  36. /package/{lib → src/lib}/formItem/formItem.d.ts +0 -0
  37. /package/{lib → src/lib}/formItem/index.d.ts +0 -0
  38. /package/{lib → src/lib}/icons/bankId.d.ts +0 -0
  39. /package/{lib → src/lib}/icons/check.d.ts +0 -0
  40. /package/{lib → src/lib}/icons/chevronDown.d.ts +0 -0
  41. /package/{lib → src/lib}/icons/index.d.ts +0 -0
  42. /package/{lib → src/lib}/icons/infoCircle.d.ts +0 -0
  43. /package/{lib → src/lib}/icons/square-exclamation.d.ts +0 -0
  44. /package/{lib → src/lib}/icons/square-info.d.ts +0 -0
  45. /package/{lib → src/lib}/icons/times.d.ts +0 -0
  46. /package/{lib → src/lib}/layout/flexbox/flexbox.d.ts +0 -0
  47. /package/{lib → src/lib}/layout/index.d.ts +0 -0
  48. /package/{lib → src/lib}/link/link.d.ts +0 -0
  49. /package/{lib → src/lib}/list/index.d.ts +0 -0
  50. /package/{lib → src/lib}/list/list.d.ts +0 -0
  51. /package/{lib → src/lib}/list/listItem.d.ts +0 -0
  52. /package/{lib → src/lib}/list/valueList.d.ts +0 -0
  53. /package/{lib → src/lib}/navbar/navbar.d.ts +0 -0
  54. /package/{lib → src/lib}/select/index.d.ts +0 -0
  55. /package/{lib → src/lib}/select/select.d.ts +0 -0
  56. /package/{lib → src/lib}/stepper/hook.d.ts +0 -0
  57. /package/{lib → src/lib}/stepper/stepper.d.ts +0 -0
  58. /package/{lib → src/lib}/tabs/tabs.d.ts +0 -0
  59. /package/{types → src/types}/index.d.ts +0 -0
package/index.umd.js DELETED
@@ -1,3654 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('@sebgroup/extract'), require('classnames')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', '@sebgroup/extract', 'classnames'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.React = {}, global.jsxRuntime, global.React, global.extract, global.classNames));
5
- })(this, (function (exports, jsxRuntime, React, extract, classNames) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
- var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
11
-
12
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
13
-
14
- var check = function (it) {
15
- return it && it.Math == Math && it;
16
- };
17
-
18
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
19
- var global$c =
20
- // eslint-disable-next-line es/no-global-this -- safe
21
- check(typeof globalThis == 'object' && globalThis) ||
22
- check(typeof window == 'object' && window) ||
23
- // eslint-disable-next-line no-restricted-globals -- safe
24
- check(typeof self == 'object' && self) ||
25
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
26
- // eslint-disable-next-line no-new-func -- fallback
27
- (function () { return this; })() || Function('return this')();
28
-
29
- var objectGetOwnPropertyDescriptor = {};
30
-
31
- var fails$b = function (exec) {
32
- try {
33
- return !!exec();
34
- } catch (error) {
35
- return true;
36
- }
37
- };
38
-
39
- var fails$a = fails$b;
40
-
41
- // Detect IE8's incomplete defineProperty implementation
42
- var descriptors = !fails$a(function () {
43
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
44
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
45
- });
46
-
47
- var fails$9 = fails$b;
48
-
49
- var functionBindNative = !fails$9(function () {
50
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
51
- var test = (function () { /* empty */ }).bind();
52
- // eslint-disable-next-line no-prototype-builtins -- safe
53
- return typeof test != 'function' || test.hasOwnProperty('prototype');
54
- });
55
-
56
- var NATIVE_BIND$1 = functionBindNative;
57
-
58
- var call$6 = Function.prototype.call;
59
-
60
- var functionCall = NATIVE_BIND$1 ? call$6.bind(call$6) : function () {
61
- return call$6.apply(call$6, arguments);
62
- };
63
-
64
- var objectPropertyIsEnumerable = {};
65
-
66
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
67
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
68
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
69
-
70
- // Nashorn ~ JDK8 bug
71
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
72
-
73
- // `Object.prototype.propertyIsEnumerable` method implementation
74
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
75
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
76
- var descriptor = getOwnPropertyDescriptor$1(this, V);
77
- return !!descriptor && descriptor.enumerable;
78
- } : $propertyIsEnumerable;
79
-
80
- var createPropertyDescriptor$3 = function (bitmap, value) {
81
- return {
82
- enumerable: !(bitmap & 1),
83
- configurable: !(bitmap & 2),
84
- writable: !(bitmap & 4),
85
- value: value
86
- };
87
- };
88
-
89
- var NATIVE_BIND = functionBindNative;
90
-
91
- var FunctionPrototype$1 = Function.prototype;
92
- var call$5 = FunctionPrototype$1.call;
93
- var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype$1.bind.bind(call$5, call$5);
94
-
95
- var functionUncurryThis = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
96
- return function () {
97
- return call$5.apply(fn, arguments);
98
- };
99
- };
100
-
101
- var uncurryThis$b = functionUncurryThis;
102
-
103
- var toString$3 = uncurryThis$b({}.toString);
104
- var stringSlice$2 = uncurryThis$b(''.slice);
105
-
106
- var classofRaw$1 = function (it) {
107
- return stringSlice$2(toString$3(it), 8, -1);
108
- };
109
-
110
- var uncurryThis$a = functionUncurryThis;
111
- var fails$8 = fails$b;
112
- var classof$2 = classofRaw$1;
113
-
114
- var $Object$4 = Object;
115
- var split = uncurryThis$a(''.split);
116
-
117
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
118
- var indexedObject = fails$8(function () {
119
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
120
- // eslint-disable-next-line no-prototype-builtins -- safe
121
- return !$Object$4('z').propertyIsEnumerable(0);
122
- }) ? function (it) {
123
- return classof$2(it) == 'String' ? split(it, '') : $Object$4(it);
124
- } : $Object$4;
125
-
126
- // we can't use just `it == null` since of `document.all` special case
127
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
128
- var isNullOrUndefined$2 = function (it) {
129
- return it === null || it === undefined;
130
- };
131
-
132
- var isNullOrUndefined$1 = isNullOrUndefined$2;
133
-
134
- var $TypeError$6 = TypeError;
135
-
136
- // `RequireObjectCoercible` abstract operation
137
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
138
- var requireObjectCoercible$2 = function (it) {
139
- if (isNullOrUndefined$1(it)) throw $TypeError$6("Can't call method on " + it);
140
- return it;
141
- };
142
-
143
- // toObject with fallback for non-array-like ES3 strings
144
- var IndexedObject$1 = indexedObject;
145
- var requireObjectCoercible$1 = requireObjectCoercible$2;
146
-
147
- var toIndexedObject$5 = function (it) {
148
- return IndexedObject$1(requireObjectCoercible$1(it));
149
- };
150
-
151
- var documentAll$2 = typeof document == 'object' && document.all;
152
-
153
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
154
- // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
155
- var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
156
-
157
- var documentAll_1 = {
158
- all: documentAll$2,
159
- IS_HTMLDDA: IS_HTMLDDA
160
- };
161
-
162
- var $documentAll$1 = documentAll_1;
163
-
164
- var documentAll$1 = $documentAll$1.all;
165
-
166
- // `IsCallable` abstract operation
167
- // https://tc39.es/ecma262/#sec-iscallable
168
- var isCallable$g = $documentAll$1.IS_HTMLDDA ? function (argument) {
169
- return typeof argument == 'function' || argument === documentAll$1;
170
- } : function (argument) {
171
- return typeof argument == 'function';
172
- };
173
-
174
- var isCallable$f = isCallable$g;
175
- var $documentAll = documentAll_1;
176
-
177
- var documentAll = $documentAll.all;
178
-
179
- var isObject$6 = $documentAll.IS_HTMLDDA ? function (it) {
180
- return typeof it == 'object' ? it !== null : isCallable$f(it) || it === documentAll;
181
- } : function (it) {
182
- return typeof it == 'object' ? it !== null : isCallable$f(it);
183
- };
184
-
185
- var global$b = global$c;
186
- var isCallable$e = isCallable$g;
187
-
188
- var aFunction = function (argument) {
189
- return isCallable$e(argument) ? argument : undefined;
190
- };
191
-
192
- var getBuiltIn$3 = function (namespace, method) {
193
- return arguments.length < 2 ? aFunction(global$b[namespace]) : global$b[namespace] && global$b[namespace][method];
194
- };
195
-
196
- var uncurryThis$9 = functionUncurryThis;
197
-
198
- var objectIsPrototypeOf = uncurryThis$9({}.isPrototypeOf);
199
-
200
- var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
201
-
202
- var global$a = global$c;
203
- var userAgent = engineUserAgent;
204
-
205
- var process = global$a.process;
206
- var Deno = global$a.Deno;
207
- var versions = process && process.versions || Deno && Deno.version;
208
- var v8 = versions && versions.v8;
209
- var match, version;
210
-
211
- if (v8) {
212
- match = v8.split('.');
213
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
214
- // but their correct versions are not interesting for us
215
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
216
- }
217
-
218
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
219
- // so check `userAgent` even if `.v8` exists, but 0
220
- if (!version && userAgent) {
221
- match = userAgent.match(/Edge\/(\d+)/);
222
- if (!match || match[1] >= 74) {
223
- match = userAgent.match(/Chrome\/(\d+)/);
224
- if (match) version = +match[1];
225
- }
226
- }
227
-
228
- var engineV8Version = version;
229
-
230
- /* eslint-disable es/no-symbol -- required for testing */
231
-
232
- var V8_VERSION = engineV8Version;
233
- var fails$7 = fails$b;
234
-
235
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
236
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$7(function () {
237
- var symbol = Symbol();
238
- // Chrome 38 Symbol has incorrect toString conversion
239
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
240
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
241
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
242
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
243
- });
244
-
245
- /* eslint-disable es/no-symbol -- required for testing */
246
-
247
- var NATIVE_SYMBOL$2 = symbolConstructorDetection;
248
-
249
- var useSymbolAsUid = NATIVE_SYMBOL$2
250
- && !Symbol.sham
251
- && typeof Symbol.iterator == 'symbol';
252
-
253
- var getBuiltIn$2 = getBuiltIn$3;
254
- var isCallable$d = isCallable$g;
255
- var isPrototypeOf$1 = objectIsPrototypeOf;
256
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
257
-
258
- var $Object$3 = Object;
259
-
260
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
261
- return typeof it == 'symbol';
262
- } : function (it) {
263
- var $Symbol = getBuiltIn$2('Symbol');
264
- return isCallable$d($Symbol) && isPrototypeOf$1($Symbol.prototype, $Object$3(it));
265
- };
266
-
267
- var $String$4 = String;
268
-
269
- var tryToString$1 = function (argument) {
270
- try {
271
- return $String$4(argument);
272
- } catch (error) {
273
- return 'Object';
274
- }
275
- };
276
-
277
- var isCallable$c = isCallable$g;
278
- var tryToString = tryToString$1;
279
-
280
- var $TypeError$5 = TypeError;
281
-
282
- // `Assert: IsCallable(argument) is true`
283
- var aCallable$2 = function (argument) {
284
- if (isCallable$c(argument)) return argument;
285
- throw $TypeError$5(tryToString(argument) + ' is not a function');
286
- };
287
-
288
- var aCallable$1 = aCallable$2;
289
- var isNullOrUndefined = isNullOrUndefined$2;
290
-
291
- // `GetMethod` abstract operation
292
- // https://tc39.es/ecma262/#sec-getmethod
293
- var getMethod$1 = function (V, P) {
294
- var func = V[P];
295
- return isNullOrUndefined(func) ? undefined : aCallable$1(func);
296
- };
297
-
298
- var call$4 = functionCall;
299
- var isCallable$b = isCallable$g;
300
- var isObject$5 = isObject$6;
301
-
302
- var $TypeError$4 = TypeError;
303
-
304
- // `OrdinaryToPrimitive` abstract operation
305
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
306
- var ordinaryToPrimitive$1 = function (input, pref) {
307
- var fn, val;
308
- if (pref === 'string' && isCallable$b(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
309
- if (isCallable$b(fn = input.valueOf) && !isObject$5(val = call$4(fn, input))) return val;
310
- if (pref !== 'string' && isCallable$b(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
311
- throw $TypeError$4("Can't convert object to primitive value");
312
- };
313
-
314
- var shared$3 = {exports: {}};
315
-
316
- var global$9 = global$c;
317
-
318
- // eslint-disable-next-line es/no-object-defineproperty -- safe
319
- var defineProperty$6 = Object.defineProperty;
320
-
321
- var defineGlobalProperty$3 = function (key, value) {
322
- try {
323
- defineProperty$6(global$9, key, { value: value, configurable: true, writable: true });
324
- } catch (error) {
325
- global$9[key] = value;
326
- } return value;
327
- };
328
-
329
- var global$8 = global$c;
330
- var defineGlobalProperty$2 = defineGlobalProperty$3;
331
-
332
- var SHARED = '__core-js_shared__';
333
- var store$3 = global$8[SHARED] || defineGlobalProperty$2(SHARED, {});
334
-
335
- var sharedStore = store$3;
336
-
337
- var store$2 = sharedStore;
338
-
339
- (shared$3.exports = function (key, value) {
340
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
341
- })('versions', []).push({
342
- version: '3.29.0',
343
- mode: 'global',
344
- copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
345
- license: 'https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE',
346
- source: 'https://github.com/zloirock/core-js'
347
- });
348
-
349
- var requireObjectCoercible = requireObjectCoercible$2;
350
-
351
- var $Object$2 = Object;
352
-
353
- // `ToObject` abstract operation
354
- // https://tc39.es/ecma262/#sec-toobject
355
- var toObject$3 = function (argument) {
356
- return $Object$2(requireObjectCoercible(argument));
357
- };
358
-
359
- var uncurryThis$8 = functionUncurryThis;
360
- var toObject$2 = toObject$3;
361
-
362
- var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
363
-
364
- // `HasOwnProperty` abstract operation
365
- // https://tc39.es/ecma262/#sec-hasownproperty
366
- // eslint-disable-next-line es/no-object-hasown -- safe
367
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
368
- return hasOwnProperty(toObject$2(it), key);
369
- };
370
-
371
- var uncurryThis$7 = functionUncurryThis;
372
-
373
- var id = 0;
374
- var postfix = Math.random();
375
- var toString$2 = uncurryThis$7(1.0.toString);
376
-
377
- var uid$2 = function (key) {
378
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
379
- };
380
-
381
- var global$7 = global$c;
382
- var shared$2 = shared$3.exports;
383
- var hasOwn$9 = hasOwnProperty_1;
384
- var uid$1 = uid$2;
385
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
386
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
387
-
388
- var Symbol$1 = global$7.Symbol;
389
- var WellKnownSymbolsStore = shared$2('wks');
390
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
391
-
392
- var wellKnownSymbol$8 = function (name) {
393
- if (!hasOwn$9(WellKnownSymbolsStore, name)) {
394
- WellKnownSymbolsStore[name] = NATIVE_SYMBOL$1 && hasOwn$9(Symbol$1, name)
395
- ? Symbol$1[name]
396
- : createWellKnownSymbol('Symbol.' + name);
397
- } return WellKnownSymbolsStore[name];
398
- };
399
-
400
- var call$3 = functionCall;
401
- var isObject$4 = isObject$6;
402
- var isSymbol$1 = isSymbol$2;
403
- var getMethod = getMethod$1;
404
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
405
- var wellKnownSymbol$7 = wellKnownSymbol$8;
406
-
407
- var $TypeError$3 = TypeError;
408
- var TO_PRIMITIVE = wellKnownSymbol$7('toPrimitive');
409
-
410
- // `ToPrimitive` abstract operation
411
- // https://tc39.es/ecma262/#sec-toprimitive
412
- var toPrimitive$1 = function (input, pref) {
413
- if (!isObject$4(input) || isSymbol$1(input)) return input;
414
- var exoticToPrim = getMethod(input, TO_PRIMITIVE);
415
- var result;
416
- if (exoticToPrim) {
417
- if (pref === undefined) pref = 'default';
418
- result = call$3(exoticToPrim, input, pref);
419
- if (!isObject$4(result) || isSymbol$1(result)) return result;
420
- throw $TypeError$3("Can't convert object to primitive value");
421
- }
422
- if (pref === undefined) pref = 'number';
423
- return ordinaryToPrimitive(input, pref);
424
- };
425
-
426
- var toPrimitive = toPrimitive$1;
427
- var isSymbol = isSymbol$2;
428
-
429
- // `ToPropertyKey` abstract operation
430
- // https://tc39.es/ecma262/#sec-topropertykey
431
- var toPropertyKey$2 = function (argument) {
432
- var key = toPrimitive(argument, 'string');
433
- return isSymbol(key) ? key : key + '';
434
- };
435
-
436
- var global$6 = global$c;
437
- var isObject$3 = isObject$6;
438
-
439
- var document$1 = global$6.document;
440
- // typeof document.createElement is 'object' in old IE
441
- var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
442
-
443
- var documentCreateElement$2 = function (it) {
444
- return EXISTS$1 ? document$1.createElement(it) : {};
445
- };
446
-
447
- var DESCRIPTORS$a = descriptors;
448
- var fails$6 = fails$b;
449
- var createElement = documentCreateElement$2;
450
-
451
- // Thanks to IE8 for its funny defineProperty
452
- var ie8DomDefine = !DESCRIPTORS$a && !fails$6(function () {
453
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
454
- return Object.defineProperty(createElement('div'), 'a', {
455
- get: function () { return 7; }
456
- }).a != 7;
457
- });
458
-
459
- var DESCRIPTORS$9 = descriptors;
460
- var call$2 = functionCall;
461
- var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
462
- var createPropertyDescriptor$2 = createPropertyDescriptor$3;
463
- var toIndexedObject$4 = toIndexedObject$5;
464
- var toPropertyKey$1 = toPropertyKey$2;
465
- var hasOwn$8 = hasOwnProperty_1;
466
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
467
-
468
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
469
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
470
-
471
- // `Object.getOwnPropertyDescriptor` method
472
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
473
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$9 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
474
- O = toIndexedObject$4(O);
475
- P = toPropertyKey$1(P);
476
- if (IE8_DOM_DEFINE$1) try {
477
- return $getOwnPropertyDescriptor$1(O, P);
478
- } catch (error) { /* empty */ }
479
- if (hasOwn$8(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
480
- };
481
-
482
- var objectDefineProperty = {};
483
-
484
- var DESCRIPTORS$8 = descriptors;
485
- var fails$5 = fails$b;
486
-
487
- // V8 ~ Chrome 36-
488
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
489
- var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$5(function () {
490
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
491
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
492
- value: 42,
493
- writable: false
494
- }).prototype != 42;
495
- });
496
-
497
- var isObject$2 = isObject$6;
498
-
499
- var $String$3 = String;
500
- var $TypeError$2 = TypeError;
501
-
502
- // `Assert: Type(argument) is Object`
503
- var anObject$5 = function (argument) {
504
- if (isObject$2(argument)) return argument;
505
- throw $TypeError$2($String$3(argument) + ' is not an object');
506
- };
507
-
508
- var DESCRIPTORS$7 = descriptors;
509
- var IE8_DOM_DEFINE = ie8DomDefine;
510
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
511
- var anObject$4 = anObject$5;
512
- var toPropertyKey = toPropertyKey$2;
513
-
514
- var $TypeError$1 = TypeError;
515
- // eslint-disable-next-line es/no-object-defineproperty -- safe
516
- var $defineProperty = Object.defineProperty;
517
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
518
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
519
- var ENUMERABLE = 'enumerable';
520
- var CONFIGURABLE$1 = 'configurable';
521
- var WRITABLE = 'writable';
522
-
523
- // `Object.defineProperty` method
524
- // https://tc39.es/ecma262/#sec-object.defineproperty
525
- objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
526
- anObject$4(O);
527
- P = toPropertyKey(P);
528
- anObject$4(Attributes);
529
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
530
- var current = $getOwnPropertyDescriptor(O, P);
531
- if (current && current[WRITABLE]) {
532
- O[P] = Attributes.value;
533
- Attributes = {
534
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
535
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
536
- writable: false
537
- };
538
- }
539
- } return $defineProperty(O, P, Attributes);
540
- } : $defineProperty : function defineProperty(O, P, Attributes) {
541
- anObject$4(O);
542
- P = toPropertyKey(P);
543
- anObject$4(Attributes);
544
- if (IE8_DOM_DEFINE) try {
545
- return $defineProperty(O, P, Attributes);
546
- } catch (error) { /* empty */ }
547
- if ('get' in Attributes || 'set' in Attributes) throw $TypeError$1('Accessors not supported');
548
- if ('value' in Attributes) O[P] = Attributes.value;
549
- return O;
550
- };
551
-
552
- var DESCRIPTORS$6 = descriptors;
553
- var definePropertyModule$3 = objectDefineProperty;
554
- var createPropertyDescriptor$1 = createPropertyDescriptor$3;
555
-
556
- var createNonEnumerableProperty$4 = DESCRIPTORS$6 ? function (object, key, value) {
557
- return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
558
- } : function (object, key, value) {
559
- object[key] = value;
560
- return object;
561
- };
562
-
563
- var makeBuiltIn$3 = {exports: {}};
564
-
565
- var DESCRIPTORS$5 = descriptors;
566
- var hasOwn$7 = hasOwnProperty_1;
567
-
568
- var FunctionPrototype = Function.prototype;
569
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
570
- var getDescriptor = DESCRIPTORS$5 && Object.getOwnPropertyDescriptor;
571
-
572
- var EXISTS = hasOwn$7(FunctionPrototype, 'name');
573
- // additional protection from minified / mangled / dropped function names
574
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
575
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$5 || (DESCRIPTORS$5 && getDescriptor(FunctionPrototype, 'name').configurable));
576
-
577
- var functionName = {
578
- EXISTS: EXISTS,
579
- PROPER: PROPER,
580
- CONFIGURABLE: CONFIGURABLE
581
- };
582
-
583
- var uncurryThis$6 = functionUncurryThis;
584
- var isCallable$a = isCallable$g;
585
- var store$1 = sharedStore;
586
-
587
- var functionToString = uncurryThis$6(Function.toString);
588
-
589
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
590
- if (!isCallable$a(store$1.inspectSource)) {
591
- store$1.inspectSource = function (it) {
592
- return functionToString(it);
593
- };
594
- }
595
-
596
- var inspectSource$1 = store$1.inspectSource;
597
-
598
- var global$5 = global$c;
599
- var isCallable$9 = isCallable$g;
600
-
601
- var WeakMap$1 = global$5.WeakMap;
602
-
603
- var weakMapBasicDetection = isCallable$9(WeakMap$1) && /native code/.test(String(WeakMap$1));
604
-
605
- var shared$1 = shared$3.exports;
606
- var uid = uid$2;
607
-
608
- var keys = shared$1('keys');
609
-
610
- var sharedKey$3 = function (key) {
611
- return keys[key] || (keys[key] = uid(key));
612
- };
613
-
614
- var hiddenKeys$4 = {};
615
-
616
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
617
- var global$4 = global$c;
618
- var isObject$1 = isObject$6;
619
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
620
- var hasOwn$6 = hasOwnProperty_1;
621
- var shared = sharedStore;
622
- var sharedKey$2 = sharedKey$3;
623
- var hiddenKeys$3 = hiddenKeys$4;
624
-
625
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
626
- var TypeError$1 = global$4.TypeError;
627
- var WeakMap = global$4.WeakMap;
628
- var set, get, has;
629
-
630
- var enforce = function (it) {
631
- return has(it) ? get(it) : set(it, {});
632
- };
633
-
634
- var getterFor = function (TYPE) {
635
- return function (it) {
636
- var state;
637
- if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
638
- throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
639
- } return state;
640
- };
641
- };
642
-
643
- if (NATIVE_WEAK_MAP || shared.state) {
644
- var store = shared.state || (shared.state = new WeakMap());
645
- /* eslint-disable no-self-assign -- prototype methods protection */
646
- store.get = store.get;
647
- store.has = store.has;
648
- store.set = store.set;
649
- /* eslint-enable no-self-assign -- prototype methods protection */
650
- set = function (it, metadata) {
651
- if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
652
- metadata.facade = it;
653
- store.set(it, metadata);
654
- return metadata;
655
- };
656
- get = function (it) {
657
- return store.get(it) || {};
658
- };
659
- has = function (it) {
660
- return store.has(it);
661
- };
662
- } else {
663
- var STATE = sharedKey$2('state');
664
- hiddenKeys$3[STATE] = true;
665
- set = function (it, metadata) {
666
- if (hasOwn$6(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
667
- metadata.facade = it;
668
- createNonEnumerableProperty$3(it, STATE, metadata);
669
- return metadata;
670
- };
671
- get = function (it) {
672
- return hasOwn$6(it, STATE) ? it[STATE] : {};
673
- };
674
- has = function (it) {
675
- return hasOwn$6(it, STATE);
676
- };
677
- }
678
-
679
- var internalState = {
680
- set: set,
681
- get: get,
682
- has: has,
683
- enforce: enforce,
684
- getterFor: getterFor
685
- };
686
-
687
- var uncurryThis$5 = functionUncurryThis;
688
- var fails$4 = fails$b;
689
- var isCallable$8 = isCallable$g;
690
- var hasOwn$5 = hasOwnProperty_1;
691
- var DESCRIPTORS$4 = descriptors;
692
- var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
693
- var inspectSource = inspectSource$1;
694
- var InternalStateModule$1 = internalState;
695
-
696
- var enforceInternalState = InternalStateModule$1.enforce;
697
- var getInternalState$1 = InternalStateModule$1.get;
698
- var $String$2 = String;
699
- // eslint-disable-next-line es/no-object-defineproperty -- safe
700
- var defineProperty$5 = Object.defineProperty;
701
- var stringSlice$1 = uncurryThis$5(''.slice);
702
- var replace$1 = uncurryThis$5(''.replace);
703
- var join = uncurryThis$5([].join);
704
-
705
- var CONFIGURABLE_LENGTH = DESCRIPTORS$4 && !fails$4(function () {
706
- return defineProperty$5(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
707
- });
708
-
709
- var TEMPLATE = String(String).split('String');
710
-
711
- var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
712
- if (stringSlice$1($String$2(name), 0, 7) === 'Symbol(') {
713
- name = '[' + replace$1($String$2(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
714
- }
715
- if (options && options.getter) name = 'get ' + name;
716
- if (options && options.setter) name = 'set ' + name;
717
- if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
718
- if (DESCRIPTORS$4) defineProperty$5(value, 'name', { value: name, configurable: true });
719
- else value.name = name;
720
- }
721
- if (CONFIGURABLE_LENGTH && options && hasOwn$5(options, 'arity') && value.length !== options.arity) {
722
- defineProperty$5(value, 'length', { value: options.arity });
723
- }
724
- try {
725
- if (options && hasOwn$5(options, 'constructor') && options.constructor) {
726
- if (DESCRIPTORS$4) defineProperty$5(value, 'prototype', { writable: false });
727
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
728
- } else if (value.prototype) value.prototype = undefined;
729
- } catch (error) { /* empty */ }
730
- var state = enforceInternalState(value);
731
- if (!hasOwn$5(state, 'source')) {
732
- state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
733
- } return value;
734
- };
735
-
736
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
737
- // eslint-disable-next-line no-extend-native -- required
738
- Function.prototype.toString = makeBuiltIn$2(function toString() {
739
- return isCallable$8(this) && getInternalState$1(this).source || inspectSource(this);
740
- }, 'toString');
741
-
742
- var isCallable$7 = isCallable$g;
743
- var definePropertyModule$2 = objectDefineProperty;
744
- var makeBuiltIn$1 = makeBuiltIn$3.exports;
745
- var defineGlobalProperty$1 = defineGlobalProperty$3;
746
-
747
- var defineBuiltIn$3 = function (O, key, value, options) {
748
- if (!options) options = {};
749
- var simple = options.enumerable;
750
- var name = options.name !== undefined ? options.name : key;
751
- if (isCallable$7(value)) makeBuiltIn$1(value, name, options);
752
- if (options.global) {
753
- if (simple) O[key] = value;
754
- else defineGlobalProperty$1(key, value);
755
- } else {
756
- try {
757
- if (!options.unsafe) delete O[key];
758
- else if (O[key]) simple = true;
759
- } catch (error) { /* empty */ }
760
- if (simple) O[key] = value;
761
- else definePropertyModule$2.f(O, key, {
762
- value: value,
763
- enumerable: false,
764
- configurable: !options.nonConfigurable,
765
- writable: !options.nonWritable
766
- });
767
- } return O;
768
- };
769
-
770
- var objectGetOwnPropertyNames = {};
771
-
772
- var ceil = Math.ceil;
773
- var floor = Math.floor;
774
-
775
- // `Math.trunc` method
776
- // https://tc39.es/ecma262/#sec-math.trunc
777
- // eslint-disable-next-line es/no-math-trunc -- safe
778
- var mathTrunc = Math.trunc || function trunc(x) {
779
- var n = +x;
780
- return (n > 0 ? floor : ceil)(n);
781
- };
782
-
783
- var trunc = mathTrunc;
784
-
785
- // `ToIntegerOrInfinity` abstract operation
786
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
787
- var toIntegerOrInfinity$2 = function (argument) {
788
- var number = +argument;
789
- // eslint-disable-next-line no-self-compare -- NaN check
790
- return number !== number || number === 0 ? 0 : trunc(number);
791
- };
792
-
793
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
794
-
795
- var max = Math.max;
796
- var min$1 = Math.min;
797
-
798
- // Helper for a popular repeating case of the spec:
799
- // Let integer be ? ToInteger(index).
800
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
801
- var toAbsoluteIndex$1 = function (index, length) {
802
- var integer = toIntegerOrInfinity$1(index);
803
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
804
- };
805
-
806
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
807
-
808
- var min = Math.min;
809
-
810
- // `ToLength` abstract operation
811
- // https://tc39.es/ecma262/#sec-tolength
812
- var toLength$1 = function (argument) {
813
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
814
- };
815
-
816
- var toLength = toLength$1;
817
-
818
- // `LengthOfArrayLike` abstract operation
819
- // https://tc39.es/ecma262/#sec-lengthofarraylike
820
- var lengthOfArrayLike$1 = function (obj) {
821
- return toLength(obj.length);
822
- };
823
-
824
- var toIndexedObject$3 = toIndexedObject$5;
825
- var toAbsoluteIndex = toAbsoluteIndex$1;
826
- var lengthOfArrayLike = lengthOfArrayLike$1;
827
-
828
- // `Array.prototype.{ indexOf, includes }` methods implementation
829
- var createMethod = function (IS_INCLUDES) {
830
- return function ($this, el, fromIndex) {
831
- var O = toIndexedObject$3($this);
832
- var length = lengthOfArrayLike(O);
833
- var index = toAbsoluteIndex(fromIndex, length);
834
- var value;
835
- // Array#includes uses SameValueZero equality algorithm
836
- // eslint-disable-next-line no-self-compare -- NaN check
837
- if (IS_INCLUDES && el != el) while (length > index) {
838
- value = O[index++];
839
- // eslint-disable-next-line no-self-compare -- NaN check
840
- if (value != value) return true;
841
- // Array#indexOf ignores holes, Array#includes - not
842
- } else for (;length > index; index++) {
843
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
844
- } return !IS_INCLUDES && -1;
845
- };
846
- };
847
-
848
- var arrayIncludes = {
849
- // `Array.prototype.includes` method
850
- // https://tc39.es/ecma262/#sec-array.prototype.includes
851
- includes: createMethod(true),
852
- // `Array.prototype.indexOf` method
853
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
854
- indexOf: createMethod(false)
855
- };
856
-
857
- var uncurryThis$4 = functionUncurryThis;
858
- var hasOwn$4 = hasOwnProperty_1;
859
- var toIndexedObject$2 = toIndexedObject$5;
860
- var indexOf = arrayIncludes.indexOf;
861
- var hiddenKeys$2 = hiddenKeys$4;
862
-
863
- var push = uncurryThis$4([].push);
864
-
865
- var objectKeysInternal = function (object, names) {
866
- var O = toIndexedObject$2(object);
867
- var i = 0;
868
- var result = [];
869
- var key;
870
- for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
871
- // Don't enum bug & hidden keys
872
- while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
873
- ~indexOf(result, key) || push(result, key);
874
- }
875
- return result;
876
- };
877
-
878
- // IE8- don't enum bug keys
879
- var enumBugKeys$3 = [
880
- 'constructor',
881
- 'hasOwnProperty',
882
- 'isPrototypeOf',
883
- 'propertyIsEnumerable',
884
- 'toLocaleString',
885
- 'toString',
886
- 'valueOf'
887
- ];
888
-
889
- var internalObjectKeys$1 = objectKeysInternal;
890
- var enumBugKeys$2 = enumBugKeys$3;
891
-
892
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
893
-
894
- // `Object.getOwnPropertyNames` method
895
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
896
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
897
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
898
- return internalObjectKeys$1(O, hiddenKeys$1);
899
- };
900
-
901
- var objectGetOwnPropertySymbols = {};
902
-
903
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
904
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
905
-
906
- var getBuiltIn$1 = getBuiltIn$3;
907
- var uncurryThis$3 = functionUncurryThis;
908
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
909
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
910
- var anObject$3 = anObject$5;
911
-
912
- var concat$1 = uncurryThis$3([].concat);
913
-
914
- // all object keys, includes non-enumerable and symbols
915
- var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
916
- var keys = getOwnPropertyNamesModule.f(anObject$3(it));
917
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
918
- return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
919
- };
920
-
921
- var hasOwn$3 = hasOwnProperty_1;
922
- var ownKeys = ownKeys$1;
923
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
924
- var definePropertyModule$1 = objectDefineProperty;
925
-
926
- var copyConstructorProperties$2 = function (target, source, exceptions) {
927
- var keys = ownKeys(source);
928
- var defineProperty = definePropertyModule$1.f;
929
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
930
- for (var i = 0; i < keys.length; i++) {
931
- var key = keys[i];
932
- if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
933
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
934
- }
935
- }
936
- };
937
-
938
- var fails$3 = fails$b;
939
- var isCallable$6 = isCallable$g;
940
-
941
- var replacement = /#|\.prototype\./;
942
-
943
- var isForced$1 = function (feature, detection) {
944
- var value = data[normalize(feature)];
945
- return value == POLYFILL ? true
946
- : value == NATIVE ? false
947
- : isCallable$6(detection) ? fails$3(detection)
948
- : !!detection;
949
- };
950
-
951
- var normalize = isForced$1.normalize = function (string) {
952
- return String(string).replace(replacement, '.').toLowerCase();
953
- };
954
-
955
- var data = isForced$1.data = {};
956
- var NATIVE = isForced$1.NATIVE = 'N';
957
- var POLYFILL = isForced$1.POLYFILL = 'P';
958
-
959
- var isForced_1 = isForced$1;
960
-
961
- var global$3 = global$c;
962
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
963
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
964
- var defineBuiltIn$2 = defineBuiltIn$3;
965
- var defineGlobalProperty = defineGlobalProperty$3;
966
- var copyConstructorProperties$1 = copyConstructorProperties$2;
967
- var isForced = isForced_1;
968
-
969
- /*
970
- options.target - name of the target object
971
- options.global - target is the global object
972
- options.stat - export as static methods of target
973
- options.proto - export as prototype methods of target
974
- options.real - real prototype method for the `pure` version
975
- options.forced - export even if the native feature is available
976
- options.bind - bind methods to the target, required for the `pure` version
977
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
978
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
979
- options.sham - add a flag to not completely full polyfills
980
- options.enumerable - export as enumerable property
981
- options.dontCallGetSet - prevent calling a getter on target
982
- options.name - the .name of the function if it does not match the key
983
- */
984
- var _export = function (options, source) {
985
- var TARGET = options.target;
986
- var GLOBAL = options.global;
987
- var STATIC = options.stat;
988
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
989
- if (GLOBAL) {
990
- target = global$3;
991
- } else if (STATIC) {
992
- target = global$3[TARGET] || defineGlobalProperty(TARGET, {});
993
- } else {
994
- target = (global$3[TARGET] || {}).prototype;
995
- }
996
- if (target) for (key in source) {
997
- sourceProperty = source[key];
998
- if (options.dontCallGetSet) {
999
- descriptor = getOwnPropertyDescriptor(target, key);
1000
- targetProperty = descriptor && descriptor.value;
1001
- } else targetProperty = target[key];
1002
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1003
- // contained in target
1004
- if (!FORCED && targetProperty !== undefined) {
1005
- if (typeof sourceProperty == typeof targetProperty) continue;
1006
- copyConstructorProperties$1(sourceProperty, targetProperty);
1007
- }
1008
- // add a flag to not completely full polyfills
1009
- if (options.sham || (targetProperty && targetProperty.sham)) {
1010
- createNonEnumerableProperty$2(sourceProperty, 'sham', true);
1011
- }
1012
- defineBuiltIn$2(target, key, sourceProperty, options);
1013
- }
1014
- };
1015
-
1016
- var internalObjectKeys = objectKeysInternal;
1017
- var enumBugKeys$1 = enumBugKeys$3;
1018
-
1019
- // `Object.keys` method
1020
- // https://tc39.es/ecma262/#sec-object.keys
1021
- // eslint-disable-next-line es/no-object-keys -- safe
1022
- var objectKeys$2 = Object.keys || function keys(O) {
1023
- return internalObjectKeys(O, enumBugKeys$1);
1024
- };
1025
-
1026
- var DESCRIPTORS$3 = descriptors;
1027
- var uncurryThis$2 = functionUncurryThis;
1028
- var call$1 = functionCall;
1029
- var fails$2 = fails$b;
1030
- var objectKeys$1 = objectKeys$2;
1031
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1032
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1033
- var toObject$1 = toObject$3;
1034
- var IndexedObject = indexedObject;
1035
-
1036
- // eslint-disable-next-line es/no-object-assign -- safe
1037
- var $assign = Object.assign;
1038
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1039
- var defineProperty$4 = Object.defineProperty;
1040
- var concat = uncurryThis$2([].concat);
1041
-
1042
- // `Object.assign` method
1043
- // https://tc39.es/ecma262/#sec-object.assign
1044
- var objectAssign = !$assign || fails$2(function () {
1045
- // should have correct order of operations (Edge bug)
1046
- if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$4({}, 'a', {
1047
- enumerable: true,
1048
- get: function () {
1049
- defineProperty$4(this, 'b', {
1050
- value: 3,
1051
- enumerable: false
1052
- });
1053
- }
1054
- }), { b: 2 })).b !== 1) return true;
1055
- // should work with symbols and should have deterministic property order (V8 bug)
1056
- var A = {};
1057
- var B = {};
1058
- // eslint-disable-next-line es/no-symbol -- safe
1059
- var symbol = Symbol();
1060
- var alphabet = 'abcdefghijklmnopqrst';
1061
- A[symbol] = 7;
1062
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1063
- return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
1064
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1065
- var T = toObject$1(target);
1066
- var argumentsLength = arguments.length;
1067
- var index = 1;
1068
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1069
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
1070
- while (argumentsLength > index) {
1071
- var S = IndexedObject(arguments[index++]);
1072
- var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1073
- var length = keys.length;
1074
- var j = 0;
1075
- var key;
1076
- while (length > j) {
1077
- key = keys[j++];
1078
- if (!DESCRIPTORS$3 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
1079
- }
1080
- } return T;
1081
- } : $assign;
1082
-
1083
- var $$2 = _export;
1084
- var assign = objectAssign;
1085
-
1086
- // `Object.assign` method
1087
- // https://tc39.es/ecma262/#sec-object.assign
1088
- // eslint-disable-next-line es/no-object-assign -- required for testing
1089
- $$2({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1090
- assign: assign
1091
- });
1092
-
1093
- /******************************************************************************
1094
- Copyright (c) Microsoft Corporation.
1095
-
1096
- Permission to use, copy, modify, and/or distribute this software for any
1097
- purpose with or without fee is hereby granted.
1098
-
1099
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1100
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1101
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1102
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1103
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1104
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1105
- PERFORMANCE OF THIS SOFTWARE.
1106
- ***************************************************************************** */
1107
-
1108
- function __rest(s, e) {
1109
- var t = {};
1110
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1111
- t[p] = s[p];
1112
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1113
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1114
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1115
- t[p[i]] = s[p[i]];
1116
- }
1117
- return t;
1118
- }
1119
-
1120
- function __awaiter(thisArg, _arguments, P, generator) {
1121
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1122
- return new (P || (P = Promise))(function (resolve, reject) {
1123
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1124
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1125
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1126
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1127
- });
1128
- }
1129
-
1130
- function Button({
1131
- children,
1132
- variant,
1133
- onClick,
1134
- disabled,
1135
- active = false,
1136
- type = 'button',
1137
- size
1138
- }) {
1139
- const props = {
1140
- type,
1141
- disabled
1142
- };
1143
- const classNames = [];
1144
- if (variant) classNames.push(variant);
1145
- if (active) classNames.push('active');
1146
- if (size) classNames.push(size);
1147
- if (classNames.length) props.className = classNames.join(' ');
1148
- if (onClick) props.onClick = onClick;
1149
- return jsxRuntime.jsx("button", Object.assign({}, props, {
1150
- children: children
1151
- }));
1152
- }
1153
-
1154
- const ModalHeader = ({
1155
- header: _header = '',
1156
- onClose
1157
- }) => {
1158
- const handleClose = event => {
1159
- if (onClose) onClose(event);
1160
- };
1161
- return jsxRuntime.jsxs("div", Object.assign({
1162
- className: "header"
1163
- }, {
1164
- children: [jsxRuntime.jsx("h3", {
1165
- children: _header
1166
- }), jsxRuntime.jsxs("button", Object.assign({
1167
- className: "close",
1168
- onClick: handleClose
1169
- }, {
1170
- children: [jsxRuntime.jsx("span", Object.assign({
1171
- className: "sr-only"
1172
- }, {
1173
- children: "Close"
1174
- })), jsxRuntime.jsx("i", {})]
1175
- }))]
1176
- }));
1177
- };
1178
- const ModalBody = ({
1179
- children
1180
- }) => {
1181
- return jsxRuntime.jsx("div", Object.assign({
1182
- className: "body"
1183
- }, {
1184
- children: children
1185
- }));
1186
- };
1187
- const ModalFooter = ({
1188
- confirm,
1189
- dismiss,
1190
- onClose,
1191
- onConfirm,
1192
- onDismiss
1193
- }) => {
1194
- const handleConfirm = event => {
1195
- if (onConfirm) onConfirm(event);
1196
- if (onClose) onClose(event);
1197
- };
1198
- const handleDismiss = event => {
1199
- if (onDismiss) onDismiss(event);
1200
- if (onClose) onClose(event);
1201
- };
1202
- return jsxRuntime.jsxs("div", Object.assign({
1203
- className: "footer"
1204
- }, {
1205
- children: [dismiss && jsxRuntime.jsx(Button, Object.assign({
1206
- variant: "secondary",
1207
- onClick: handleDismiss
1208
- }, {
1209
- children: dismiss
1210
- })), confirm && jsxRuntime.jsx(Button, Object.assign({
1211
- variant: "primary",
1212
- onClick: handleConfirm
1213
- }, {
1214
- children: confirm
1215
- }))]
1216
- }));
1217
- };
1218
- const Modal = _a => {
1219
- var {
1220
- type = 'default',
1221
- isOpen
1222
- } = _a,
1223
- props = __rest(_a, ["type", "isOpen"]);
1224
- const modalContent = () => {
1225
- switch (type) {
1226
- case 'slideout':
1227
- {
1228
- return jsxRuntime.jsxs("aside", Object.assign({
1229
- role: "dialog"
1230
- }, {
1231
- children: [jsxRuntime.jsx(ModalHeader, Object.assign({}, props)), jsxRuntime.jsx(ModalBody, Object.assign({}, props)), jsxRuntime.jsx(ModalFooter, Object.assign({}, props))]
1232
- }));
1233
- }
1234
- case 'takeover':
1235
- {
1236
- return jsxRuntime.jsxs("main", Object.assign({
1237
- role: "dialog"
1238
- }, {
1239
- children: [jsxRuntime.jsx(ModalHeader, Object.assign({}, props)), jsxRuntime.jsx(ModalBody, Object.assign({}, props)), jsxRuntime.jsx(ModalFooter, Object.assign({}, props))]
1240
- }));
1241
- }
1242
- default:
1243
- {
1244
- return jsxRuntime.jsxs("section", Object.assign({
1245
- role: "dialog"
1246
- }, {
1247
- children: [jsxRuntime.jsx(ModalHeader, Object.assign({}, props)), jsxRuntime.jsx(ModalBody, Object.assign({}, props)), jsxRuntime.jsx(ModalFooter, Object.assign({}, props))]
1248
- }));
1249
- }
1250
- }
1251
- };
1252
- return isOpen ? modalContent() : null;
1253
- };
1254
-
1255
- var objectDefineProperties = {};
1256
-
1257
- var DESCRIPTORS$2 = descriptors;
1258
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1259
- var definePropertyModule = objectDefineProperty;
1260
- var anObject$2 = anObject$5;
1261
- var toIndexedObject$1 = toIndexedObject$5;
1262
- var objectKeys = objectKeys$2;
1263
-
1264
- // `Object.defineProperties` method
1265
- // https://tc39.es/ecma262/#sec-object.defineproperties
1266
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1267
- objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1268
- anObject$2(O);
1269
- var props = toIndexedObject$1(Properties);
1270
- var keys = objectKeys(Properties);
1271
- var length = keys.length;
1272
- var index = 0;
1273
- var key;
1274
- while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1275
- return O;
1276
- };
1277
-
1278
- var getBuiltIn = getBuiltIn$3;
1279
-
1280
- var html$1 = getBuiltIn('document', 'documentElement');
1281
-
1282
- /* global ActiveXObject -- old IE, WSH */
1283
-
1284
- var anObject$1 = anObject$5;
1285
- var definePropertiesModule = objectDefineProperties;
1286
- var enumBugKeys = enumBugKeys$3;
1287
- var hiddenKeys = hiddenKeys$4;
1288
- var html = html$1;
1289
- var documentCreateElement$1 = documentCreateElement$2;
1290
- var sharedKey$1 = sharedKey$3;
1291
-
1292
- var GT = '>';
1293
- var LT = '<';
1294
- var PROTOTYPE = 'prototype';
1295
- var SCRIPT = 'script';
1296
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1297
-
1298
- var EmptyConstructor = function () { /* empty */ };
1299
-
1300
- var scriptTag = function (content) {
1301
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1302
- };
1303
-
1304
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1305
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1306
- activeXDocument.write(scriptTag(''));
1307
- activeXDocument.close();
1308
- var temp = activeXDocument.parentWindow.Object;
1309
- activeXDocument = null; // avoid memory leak
1310
- return temp;
1311
- };
1312
-
1313
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1314
- var NullProtoObjectViaIFrame = function () {
1315
- // Thrash, waste and sodomy: IE GC bug
1316
- var iframe = documentCreateElement$1('iframe');
1317
- var JS = 'java' + SCRIPT + ':';
1318
- var iframeDocument;
1319
- iframe.style.display = 'none';
1320
- html.appendChild(iframe);
1321
- // https://github.com/zloirock/core-js/issues/475
1322
- iframe.src = String(JS);
1323
- iframeDocument = iframe.contentWindow.document;
1324
- iframeDocument.open();
1325
- iframeDocument.write(scriptTag('document.F=Object'));
1326
- iframeDocument.close();
1327
- return iframeDocument.F;
1328
- };
1329
-
1330
- // Check for document.domain and active x support
1331
- // No need to use active x approach when document.domain is not set
1332
- // see https://github.com/es-shims/es5-shim/issues/150
1333
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1334
- // avoid IE GC bug
1335
- var activeXDocument;
1336
- var NullProtoObject = function () {
1337
- try {
1338
- activeXDocument = new ActiveXObject('htmlfile');
1339
- } catch (error) { /* ignore */ }
1340
- NullProtoObject = typeof document != 'undefined'
1341
- ? document.domain && activeXDocument
1342
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1343
- : NullProtoObjectViaIFrame()
1344
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1345
- var length = enumBugKeys.length;
1346
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1347
- return NullProtoObject();
1348
- };
1349
-
1350
- hiddenKeys[IE_PROTO$1] = true;
1351
-
1352
- // `Object.create` method
1353
- // https://tc39.es/ecma262/#sec-object.create
1354
- // eslint-disable-next-line es/no-object-create -- safe
1355
- var objectCreate = Object.create || function create(O, Properties) {
1356
- var result;
1357
- if (O !== null) {
1358
- EmptyConstructor[PROTOTYPE] = anObject$1(O);
1359
- result = new EmptyConstructor();
1360
- EmptyConstructor[PROTOTYPE] = null;
1361
- // add "__proto__" for Object.getPrototypeOf polyfill
1362
- result[IE_PROTO$1] = O;
1363
- } else result = NullProtoObject();
1364
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1365
- };
1366
-
1367
- var wellKnownSymbol$6 = wellKnownSymbol$8;
1368
- var create$1 = objectCreate;
1369
- var defineProperty$3 = objectDefineProperty.f;
1370
-
1371
- var UNSCOPABLES = wellKnownSymbol$6('unscopables');
1372
- var ArrayPrototype = Array.prototype;
1373
-
1374
- // Array.prototype[@@unscopables]
1375
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1376
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
1377
- defineProperty$3(ArrayPrototype, UNSCOPABLES, {
1378
- configurable: true,
1379
- value: create$1(null)
1380
- });
1381
- }
1382
-
1383
- // add a key to Array.prototype[@@unscopables]
1384
- var addToUnscopables$1 = function (key) {
1385
- ArrayPrototype[UNSCOPABLES][key] = true;
1386
- };
1387
-
1388
- var iterators = {};
1389
-
1390
- var fails$1 = fails$b;
1391
-
1392
- var correctPrototypeGetter = !fails$1(function () {
1393
- function F() { /* empty */ }
1394
- F.prototype.constructor = null;
1395
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1396
- return Object.getPrototypeOf(new F()) !== F.prototype;
1397
- });
1398
-
1399
- var hasOwn$2 = hasOwnProperty_1;
1400
- var isCallable$5 = isCallable$g;
1401
- var toObject = toObject$3;
1402
- var sharedKey = sharedKey$3;
1403
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1404
-
1405
- var IE_PROTO = sharedKey('IE_PROTO');
1406
- var $Object$1 = Object;
1407
- var ObjectPrototype = $Object$1.prototype;
1408
-
1409
- // `Object.getPrototypeOf` method
1410
- // https://tc39.es/ecma262/#sec-object.getprototypeof
1411
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
1412
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1413
- var object = toObject(O);
1414
- if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1415
- var constructor = object.constructor;
1416
- if (isCallable$5(constructor) && object instanceof constructor) {
1417
- return constructor.prototype;
1418
- } return object instanceof $Object$1 ? ObjectPrototype : null;
1419
- };
1420
-
1421
- var fails = fails$b;
1422
- var isCallable$4 = isCallable$g;
1423
- var isObject = isObject$6;
1424
- var getPrototypeOf$1 = objectGetPrototypeOf;
1425
- var defineBuiltIn$1 = defineBuiltIn$3;
1426
- var wellKnownSymbol$5 = wellKnownSymbol$8;
1427
-
1428
- var ITERATOR$2 = wellKnownSymbol$5('iterator');
1429
- var BUGGY_SAFARI_ITERATORS$1 = false;
1430
-
1431
- // `%IteratorPrototype%` object
1432
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1433
- var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1434
-
1435
- /* eslint-disable es/no-array-prototype-keys -- safe */
1436
- if ([].keys) {
1437
- arrayIterator = [].keys();
1438
- // Safari 8 has buggy iterators w/o `next`
1439
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1440
- else {
1441
- PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1442
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1443
- }
1444
- }
1445
-
1446
- var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails(function () {
1447
- var test = {};
1448
- // FF44- legacy iterators case
1449
- return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1450
- });
1451
-
1452
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1453
-
1454
- // `%IteratorPrototype%[@@iterator]()` method
1455
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1456
- if (!isCallable$4(IteratorPrototype$2[ITERATOR$2])) {
1457
- defineBuiltIn$1(IteratorPrototype$2, ITERATOR$2, function () {
1458
- return this;
1459
- });
1460
- }
1461
-
1462
- var iteratorsCore = {
1463
- IteratorPrototype: IteratorPrototype$2,
1464
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1465
- };
1466
-
1467
- var defineProperty$2 = objectDefineProperty.f;
1468
- var hasOwn$1 = hasOwnProperty_1;
1469
- var wellKnownSymbol$4 = wellKnownSymbol$8;
1470
-
1471
- var TO_STRING_TAG$3 = wellKnownSymbol$4('toStringTag');
1472
-
1473
- var setToStringTag$2 = function (target, TAG, STATIC) {
1474
- if (target && !STATIC) target = target.prototype;
1475
- if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
1476
- defineProperty$2(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1477
- }
1478
- };
1479
-
1480
- var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1481
- var create = objectCreate;
1482
- var createPropertyDescriptor = createPropertyDescriptor$3;
1483
- var setToStringTag$1 = setToStringTag$2;
1484
- var Iterators$2 = iterators;
1485
-
1486
- var returnThis$1 = function () { return this; };
1487
-
1488
- var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1489
- var TO_STRING_TAG = NAME + ' Iterator';
1490
- IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1491
- setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
1492
- Iterators$2[TO_STRING_TAG] = returnThis$1;
1493
- return IteratorConstructor;
1494
- };
1495
-
1496
- var uncurryThis$1 = functionUncurryThis;
1497
- var aCallable = aCallable$2;
1498
-
1499
- var functionUncurryThisAccessor = function (object, key, method) {
1500
- try {
1501
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1502
- return uncurryThis$1(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
1503
- } catch (error) { /* empty */ }
1504
- };
1505
-
1506
- var isCallable$3 = isCallable$g;
1507
-
1508
- var $String$1 = String;
1509
- var $TypeError = TypeError;
1510
-
1511
- var aPossiblePrototype$1 = function (argument) {
1512
- if (typeof argument == 'object' || isCallable$3(argument)) return argument;
1513
- throw $TypeError("Can't set " + $String$1(argument) + ' as a prototype');
1514
- };
1515
-
1516
- /* eslint-disable no-proto -- safe */
1517
-
1518
- var uncurryThisAccessor = functionUncurryThisAccessor;
1519
- var anObject = anObject$5;
1520
- var aPossiblePrototype = aPossiblePrototype$1;
1521
-
1522
- // `Object.setPrototypeOf` method
1523
- // https://tc39.es/ecma262/#sec-object.setprototypeof
1524
- // Works with __proto__ only. Old v8 can't work with null proto objects.
1525
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
1526
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1527
- var CORRECT_SETTER = false;
1528
- var test = {};
1529
- var setter;
1530
- try {
1531
- setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
1532
- setter(test, []);
1533
- CORRECT_SETTER = test instanceof Array;
1534
- } catch (error) { /* empty */ }
1535
- return function setPrototypeOf(O, proto) {
1536
- anObject(O);
1537
- aPossiblePrototype(proto);
1538
- if (CORRECT_SETTER) setter(O, proto);
1539
- else O.__proto__ = proto;
1540
- return O;
1541
- };
1542
- }() : undefined);
1543
-
1544
- var $$1 = _export;
1545
- var call = functionCall;
1546
- var FunctionName = functionName;
1547
- var isCallable$2 = isCallable$g;
1548
- var createIteratorConstructor = iteratorCreateConstructor;
1549
- var getPrototypeOf = objectGetPrototypeOf;
1550
- var setPrototypeOf = objectSetPrototypeOf;
1551
- var setToStringTag = setToStringTag$2;
1552
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
1553
- var defineBuiltIn = defineBuiltIn$3;
1554
- var wellKnownSymbol$3 = wellKnownSymbol$8;
1555
- var Iterators$1 = iterators;
1556
- var IteratorsCore = iteratorsCore;
1557
-
1558
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1559
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1560
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
1561
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1562
- var ITERATOR$1 = wellKnownSymbol$3('iterator');
1563
- var KEYS = 'keys';
1564
- var VALUES = 'values';
1565
- var ENTRIES = 'entries';
1566
-
1567
- var returnThis = function () { return this; };
1568
-
1569
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1570
- createIteratorConstructor(IteratorConstructor, NAME, next);
1571
-
1572
- var getIterationMethod = function (KIND) {
1573
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1574
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
1575
- switch (KIND) {
1576
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1577
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1578
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1579
- } return function () { return new IteratorConstructor(this); };
1580
- };
1581
-
1582
- var TO_STRING_TAG = NAME + ' Iterator';
1583
- var INCORRECT_VALUES_NAME = false;
1584
- var IterablePrototype = Iterable.prototype;
1585
- var nativeIterator = IterablePrototype[ITERATOR$1]
1586
- || IterablePrototype['@@iterator']
1587
- || DEFAULT && IterablePrototype[DEFAULT];
1588
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1589
- var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1590
- var CurrentIteratorPrototype, methods, KEY;
1591
-
1592
- // fix native
1593
- if (anyNativeIterator) {
1594
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1595
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1596
- if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1597
- if (setPrototypeOf) {
1598
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1599
- } else if (!isCallable$2(CurrentIteratorPrototype[ITERATOR$1])) {
1600
- defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1601
- }
1602
- }
1603
- // Set @@toStringTag to native iterators
1604
- setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
1605
- }
1606
- }
1607
-
1608
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1609
- if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1610
- if (CONFIGURABLE_FUNCTION_NAME) {
1611
- createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
1612
- } else {
1613
- INCORRECT_VALUES_NAME = true;
1614
- defaultIterator = function values() { return call(nativeIterator, this); };
1615
- }
1616
- }
1617
-
1618
- // export additional methods
1619
- if (DEFAULT) {
1620
- methods = {
1621
- values: getIterationMethod(VALUES),
1622
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1623
- entries: getIterationMethod(ENTRIES)
1624
- };
1625
- if (FORCED) for (KEY in methods) {
1626
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1627
- defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
1628
- }
1629
- } else $$1({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1630
- }
1631
-
1632
- // define iterator
1633
- if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1634
- defineBuiltIn(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1635
- }
1636
- Iterators$1[NAME] = defaultIterator;
1637
-
1638
- return methods;
1639
- };
1640
-
1641
- // `CreateIterResultObject` abstract operation
1642
- // https://tc39.es/ecma262/#sec-createiterresultobject
1643
- var createIterResultObject$1 = function (value, done) {
1644
- return { value: value, done: done };
1645
- };
1646
-
1647
- var toIndexedObject = toIndexedObject$5;
1648
- var addToUnscopables = addToUnscopables$1;
1649
- var Iterators = iterators;
1650
- var InternalStateModule = internalState;
1651
- var defineProperty$1 = objectDefineProperty.f;
1652
- var defineIterator = iteratorDefine;
1653
- var createIterResultObject = createIterResultObject$1;
1654
- var DESCRIPTORS$1 = descriptors;
1655
-
1656
- var ARRAY_ITERATOR = 'Array Iterator';
1657
- var setInternalState = InternalStateModule.set;
1658
- var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
1659
-
1660
- // `Array.prototype.entries` method
1661
- // https://tc39.es/ecma262/#sec-array.prototype.entries
1662
- // `Array.prototype.keys` method
1663
- // https://tc39.es/ecma262/#sec-array.prototype.keys
1664
- // `Array.prototype.values` method
1665
- // https://tc39.es/ecma262/#sec-array.prototype.values
1666
- // `Array.prototype[@@iterator]` method
1667
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1668
- // `CreateArrayIterator` internal method
1669
- // https://tc39.es/ecma262/#sec-createarrayiterator
1670
- var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1671
- setInternalState(this, {
1672
- type: ARRAY_ITERATOR,
1673
- target: toIndexedObject(iterated), // target
1674
- index: 0, // next index
1675
- kind: kind // kind
1676
- });
1677
- // `%ArrayIteratorPrototype%.next` method
1678
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1679
- }, function () {
1680
- var state = getInternalState(this);
1681
- var target = state.target;
1682
- var kind = state.kind;
1683
- var index = state.index++;
1684
- if (!target || index >= target.length) {
1685
- state.target = undefined;
1686
- return createIterResultObject(undefined, true);
1687
- }
1688
- if (kind == 'keys') return createIterResultObject(index, false);
1689
- if (kind == 'values') return createIterResultObject(target[index], false);
1690
- return createIterResultObject([index, target[index]], false);
1691
- }, 'values');
1692
-
1693
- // argumentsList[@@iterator] is %ArrayProto_values%
1694
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1695
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1696
- var values = Iterators.Arguments = Iterators.Array;
1697
-
1698
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1699
- addToUnscopables('keys');
1700
- addToUnscopables('values');
1701
- addToUnscopables('entries');
1702
-
1703
- // V8 ~ Chrome 45- bug
1704
- if (DESCRIPTORS$1 && values.name !== 'values') try {
1705
- defineProperty$1(values, 'name', { value: 'values' });
1706
- } catch (error) { /* empty */ }
1707
-
1708
- // iterable DOM collections
1709
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1710
- var domIterables = {
1711
- CSSRuleList: 0,
1712
- CSSStyleDeclaration: 0,
1713
- CSSValueList: 0,
1714
- ClientRectList: 0,
1715
- DOMRectList: 0,
1716
- DOMStringList: 0,
1717
- DOMTokenList: 1,
1718
- DataTransferItemList: 0,
1719
- FileList: 0,
1720
- HTMLAllCollection: 0,
1721
- HTMLCollection: 0,
1722
- HTMLFormElement: 0,
1723
- HTMLSelectElement: 0,
1724
- MediaList: 0,
1725
- MimeTypeArray: 0,
1726
- NamedNodeMap: 0,
1727
- NodeList: 1,
1728
- PaintRequestList: 0,
1729
- Plugin: 0,
1730
- PluginArray: 0,
1731
- SVGLengthList: 0,
1732
- SVGNumberList: 0,
1733
- SVGPathSegList: 0,
1734
- SVGPointList: 0,
1735
- SVGStringList: 0,
1736
- SVGTransformList: 0,
1737
- SourceBufferList: 0,
1738
- StyleSheetList: 0,
1739
- TextTrackCueList: 0,
1740
- TextTrackList: 0,
1741
- TouchList: 0
1742
- };
1743
-
1744
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1745
- var documentCreateElement = documentCreateElement$2;
1746
-
1747
- var classList = documentCreateElement('span').classList;
1748
- var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1749
-
1750
- var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1751
-
1752
- var global$2 = global$c;
1753
- var DOMIterables = domIterables;
1754
- var DOMTokenListPrototype = domTokenListPrototype;
1755
- var ArrayIteratorMethods = es_array_iterator;
1756
- var createNonEnumerableProperty = createNonEnumerableProperty$4;
1757
- var wellKnownSymbol$2 = wellKnownSymbol$8;
1758
-
1759
- var ITERATOR = wellKnownSymbol$2('iterator');
1760
- var TO_STRING_TAG$2 = wellKnownSymbol$2('toStringTag');
1761
- var ArrayValues = ArrayIteratorMethods.values;
1762
-
1763
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1764
- if (CollectionPrototype) {
1765
- // some Chrome versions have non-configurable methods on DOMTokenList
1766
- if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
1767
- createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
1768
- } catch (error) {
1769
- CollectionPrototype[ITERATOR] = ArrayValues;
1770
- }
1771
- if (!CollectionPrototype[TO_STRING_TAG$2]) {
1772
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
1773
- }
1774
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1775
- // some Chrome versions have non-configurable methods on DOMTokenList
1776
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1777
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1778
- } catch (error) {
1779
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1780
- }
1781
- }
1782
- }
1783
- };
1784
-
1785
- for (var COLLECTION_NAME in DOMIterables) {
1786
- handlePrototype(global$2[COLLECTION_NAME] && global$2[COLLECTION_NAME].prototype, COLLECTION_NAME);
1787
- }
1788
-
1789
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1790
-
1791
- const Flexbox = _a => {
1792
- var {
1793
- alignContent,
1794
- alignItems,
1795
- alignSelf,
1796
- children,
1797
- justifyContent,
1798
- flexDirection,
1799
- flexWrap,
1800
- className
1801
- } = _a,
1802
- props = __rest(_a, ["alignContent", "alignItems", "alignSelf", "children", "justifyContent", "flexDirection", "flexWrap", "className"]);
1803
- const [classes, setClasses] = React.useState(['d-flex']);
1804
- const [flexClassName, setFlexClassName] = React.useState('d-flex');
1805
- // // update className when classes change
1806
- React.useLayoutEffect(() => {
1807
- const newClassName = classes.join(' ');
1808
- if (newClassName !== flexClassName) setFlexClassName(newClassName);
1809
- }, [classes, flexClassName]);
1810
- // // update classes when props change
1811
- React.useLayoutEffect(() => {
1812
- const newClasses = ['d-flex'];
1813
- alignItems && newClasses.push(`align-items-${alignItems}`);
1814
- alignContent && newClasses.push(`align-content-${alignContent}`);
1815
- alignSelf && newClasses.push(`align-self-${alignSelf}`);
1816
- justifyContent && newClasses.push(`justify-content-${justifyContent}`);
1817
- flexDirection && newClasses.push(`flex-${flexDirection}`);
1818
- flexWrap && newClasses.push(`flex-${flexWrap}`);
1819
- className && newClasses.push(className);
1820
- setClasses(newClasses);
1821
- }, [alignContent, alignItems, alignSelf, justifyContent, flexDirection, flexWrap, className]);
1822
- return jsxRuntime.jsx("div", Object.assign({
1823
- className: flexClassName
1824
- }, props, {
1825
- children: children
1826
- }));
1827
- };
1828
-
1829
- function Card({
1830
- children,
1831
- header,
1832
- footer
1833
- }) {
1834
- return jsxRuntime.jsxs("section", Object.assign({
1835
- className: "card"
1836
- }, {
1837
- children: [jsxRuntime.jsx("header", {
1838
- children: header
1839
- }), children, jsxRuntime.jsx("footer", {
1840
- children: footer
1841
- })]
1842
- }));
1843
- }
1844
-
1845
- const Check = ({
1846
- focusable: _focusable = false,
1847
- title
1848
- }) => {
1849
- let id;
1850
- if (title) id = extract.randomId();
1851
- return jsxRuntime.jsxs("svg", Object.assign({
1852
- width: "24",
1853
- height: "24",
1854
- viewBox: "0 0 24 24",
1855
- xmlns: "http://www.w3.org/2000/svg",
1856
- focusable: _focusable,
1857
- "aria-labelledby": id
1858
- }, {
1859
- children: ["title && ", jsxRuntime.jsx("title", Object.assign({
1860
- id: id
1861
- }, {
1862
- children: title
1863
- })), jsxRuntime.jsx("path", {
1864
- d: "M17.6203 6.60836L9.40014 14.8285L6.37976 11.8081C6.23332 11.6617 5.99588 11.6617 5.84942 11.8081L4.96554 12.692C4.8191 12.8384 4.8191 13.0759 4.96554 13.2223L9.13495 17.3917C9.28138 17.5382 9.51882 17.5382 9.66529 17.3917L19.0344 8.02258C19.1809 7.87614 19.1809 7.63871 19.0344 7.49224L18.1506 6.60836C18.0041 6.46193 17.7667 6.46193 17.6203 6.60836Z",
1865
- fill: "white"
1866
- })]
1867
- }));
1868
- };
1869
-
1870
- const ChevronDown = ({
1871
- focusable: _focusable = false,
1872
- title
1873
- }) => {
1874
- let id;
1875
- if (title) id = extract.randomId();
1876
- return jsxRuntime.jsxs("svg", Object.assign({
1877
- xmlns: "http://www.w3.org/2000/svg",
1878
- width: "24",
1879
- height: "24",
1880
- viewBox: "0 0 448 512",
1881
- focusable: _focusable,
1882
- "aria-labelledby": id
1883
- }, {
1884
- children: ["title && ", jsxRuntime.jsx("title", Object.assign({
1885
- id: id
1886
- }, {
1887
- children: title
1888
- })), jsxRuntime.jsx("path", {
1889
- d: "M441.9 167.3l-19.8-19.8c-4.7-4.7-12.3-4.7-17 0L224 328.2 42.9 147.5c-4.7-4.7-12.3-4.7-17 0L6.1 167.3c-4.7 4.7-4.7 12.3 0 17l209.4 209.4c4.7 4.7 12.3 4.7 17 0l209.4-209.4c4.7-4.7 4.7-12.3 0-17z"
1890
- })]
1891
- }));
1892
- };
1893
-
1894
- const SquareExclamation = _a => {
1895
- var {
1896
- focusable = false,
1897
- title
1898
- } = _a,
1899
- props = __rest(_a, ["focusable", "title"]);
1900
- let id;
1901
- if (title) id = extract.randomId();
1902
- return jsxRuntime.jsxs("svg", Object.assign({
1903
- viewBox: "0 0 24 24",
1904
- fill: "none",
1905
- xmlns: "http://www.w3.org/2000/svg",
1906
- "aria-hidden": props['aria-hidden'],
1907
- focusable: focusable,
1908
- "aria-labelledby": id
1909
- }, {
1910
- children: [title && jsxRuntime.jsx("title", Object.assign({
1911
- id: id
1912
- }, {
1913
- children: title
1914
- })), jsxRuntime.jsx("path", {
1915
- fillRule: "evenodd",
1916
- clipRule: "evenodd",
1917
- d: "M18.2857 4H5.71429C4.7675 4 4 4.7675 4 5.71429V18.2857C4 19.2325 4.7675 20 5.71429 20H18.2857C19.2325 20 20 19.2325 20 18.2857V5.71429C20 4.7675 19.2325 4 18.2857 4ZM10.8682 7.42857H13.1318C13.3777 7.42857 13.5731 7.635 13.5597 7.8805L13.2948 12.7376C13.2824 12.9649 13.0945 13.1429 12.8669 13.1429H11.1331C10.9055 13.1429 10.7176 12.9649 10.7052 12.7376L10.4402 7.8805C10.4269 7.635 10.6223 7.42857 10.8682 7.42857ZM12 17.0714C11.0927 17.0714 10.3571 16.3359 10.3571 15.4286C10.3571 14.5213 11.0927 13.7857 12 13.7857C12.9073 13.7857 13.6429 14.5213 13.6429 15.4286C13.6429 16.3359 12.9073 17.0714 12 17.0714Z",
1918
- fill: "#333333"
1919
- })]
1920
- }));
1921
- };
1922
-
1923
- const SquareInfo = _a => {
1924
- var {
1925
- focusable = false,
1926
- title
1927
- } = _a,
1928
- props = __rest(_a, ["focusable", "title"]);
1929
- let id;
1930
- if (title) id = extract.randomId();
1931
- return jsxRuntime.jsx("svg", Object.assign({
1932
- viewBox: "0 0 24 24",
1933
- fill: "none",
1934
- xmlns: "http://www.w3.org/2000/svg",
1935
- "aria-labelledby": id,
1936
- "aria-hidden": props['aria-hidden'],
1937
- focusable: focusable
1938
- }, {
1939
- children: jsxRuntime.jsx("path", {
1940
- d: "M18.2857 4H5.71429C4.7675 4 4 4.7675 4 5.71429V18.2857C4 19.2325 4.7675 20 5.71429 20H18.2857C19.2325 20 20 19.2325 20 18.2857V5.71429C20 4.7675 19.2325 4 18.2857 4ZM12 7.07143C12.8284 7.07143 13.5 7.743 13.5 8.57143C13.5 9.39986 12.8284 10.0714 12 10.0714C11.1716 10.0714 10.5 9.39986 10.5 8.57143C10.5 7.743 11.1716 7.07143 12 7.07143ZM14 16.1429C14 16.3795 13.8081 16.5714 13.5714 16.5714H10.4286C10.1919 16.5714 10 16.3795 10 16.1429V15.2857C10 15.049 10.1919 14.8571 10.4286 14.8571H10.8571V12.5714H10.4286C10.1919 12.5714 10 12.3795 10 12.1429V11.2857C10 11.049 10.1919 10.8571 10.4286 10.8571H12.7143C12.951 10.8571 13.1429 11.049 13.1429 11.2857V14.8571H13.5714C13.8081 14.8571 14 15.049 14 15.2857V16.1429Z",
1941
- fill: "#333333"
1942
- })
1943
- }));
1944
- };
1945
-
1946
- const Times = ({
1947
- focusable: _focusable = false,
1948
- title
1949
- }) => {
1950
- let id;
1951
- if (title) id = extract.randomId();
1952
- return jsxRuntime.jsxs("svg", Object.assign({
1953
- xmlns: "http://www.w3.org/2000/svg",
1954
- viewBox: "0 0 320 512",
1955
- focusable: _focusable,
1956
- "aria-labelledby": id
1957
- }, {
1958
- children: [title && jsxRuntime.jsx("title", Object.assign({
1959
- id: id
1960
- }, {
1961
- children: title
1962
- })), jsxRuntime.jsx("path", {
1963
- d: "M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"
1964
- })]
1965
- }));
1966
- };
1967
-
1968
- const InfoCircle = _a => {
1969
- var {
1970
- focusable = false,
1971
- title
1972
- } = _a,
1973
- props = __rest(_a, ["focusable", "title"]);
1974
- let id;
1975
- if (title) id = extract.randomId();
1976
- return jsxRuntime.jsxs("svg", Object.assign({
1977
- xmlns: "http://www.w3.org/2000/svg",
1978
- viewBox: "0 0 512 512",
1979
- "aria-labelledby": id,
1980
- "aria-hidden": props['aria-hidden'],
1981
- focusable: focusable
1982
- }, {
1983
- children: [title && jsxRuntime.jsx("title", Object.assign({
1984
- id: id
1985
- }, {
1986
- children: title
1987
- })), jsxRuntime.jsx("path", {
1988
- d: "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm0-338c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"
1989
- })]
1990
- }));
1991
- };
1992
-
1993
- function AlertRibbon({
1994
- type,
1995
- header,
1996
- footer,
1997
- children,
1998
- closeText,
1999
- isCloseable = true,
2000
- onClose,
2001
- role,
2002
- 'aria-live': ariaLive,
2003
- closeAriaLabel
2004
- }) {
2005
- const [closeButton, setCloseButton] = React.useState();
2006
- React.useEffect(() => {
2007
- if (!isCloseable) {
2008
- setCloseButton(null);
2009
- } else {
2010
- if (closeText) setCloseButton(jsxRuntime.jsxs("button", Object.assign({
2011
- className: "close"
2012
- }, {
2013
- children: [jsxRuntime.jsx("span", Object.assign({
2014
- className: "sr-only"
2015
- }, {
2016
- children: closeText
2017
- })), jsxRuntime.jsx("i", {})]
2018
- })));else setCloseButton(jsxRuntime.jsxs("button", Object.assign({
2019
- className: "close"
2020
- }, {
2021
- children: [jsxRuntime.jsx("span", Object.assign({
2022
- className: "sr-only"
2023
- }, {
2024
- children: "Close"
2025
- })), jsxRuntime.jsx("i", {})]
2026
- })));
2027
- }
2028
- }, [isCloseable, closeText]);
2029
- const renderIcon = () => {
2030
- switch (type) {
2031
- case 'danger':
2032
- case 'warning':
2033
- return jsxRuntime.jsx(SquareExclamation, {
2034
- "aria-hidden": true
2035
- });
2036
- case 'success':
2037
- return jsxRuntime.jsx(Check, {
2038
- "aria-hidden": true
2039
- });
2040
- default:
2041
- return jsxRuntime.jsx(SquareInfo, {
2042
- "aria-hidden": true
2043
- });
2044
- }
2045
- };
2046
- return jsxRuntime.jsxs("div", Object.assign({
2047
- className: `alert-ribbon ${type}`,
2048
- role: role,
2049
- "aria-live": ariaLive
2050
- }, {
2051
- children: [jsxRuntime.jsx("i", Object.assign({
2052
- "aria-hidden": "true"
2053
- }, {
2054
- children: renderIcon()
2055
- })), jsxRuntime.jsxs("div", Object.assign({
2056
- className: "alert-ribbon__content"
2057
- }, {
2058
- children: [header && /*#__PURE__*/React__default["default"].isValidElement(header) ? header : jsxRuntime.jsx("span", Object.assign({
2059
- className: "header"
2060
- }, {
2061
- children: header
2062
- })), jsxRuntime.jsx("p", {
2063
- children: children
2064
- })]
2065
- })), closeButton && jsxRuntime.jsx("button", Object.assign({
2066
- className: "close",
2067
- type: "button",
2068
- "aria-label": closeAriaLabel !== null && closeAriaLabel !== void 0 ? closeAriaLabel : 'Close alert',
2069
- onClick: event => {
2070
- onClose && onClose(event);
2071
- }
2072
- }, {
2073
- children: jsxRuntime.jsx("i", {})
2074
- })), footer && jsxRuntime.jsxs("div", Object.assign({
2075
- className: "alert-ribbon__footer"
2076
- }, {
2077
- children: [" ", footer, " "]
2078
- }))]
2079
- }));
2080
- }
2081
-
2082
- const IconButton = _a => {
2083
- var {
2084
- children,
2085
- onClick
2086
- } = _a,
2087
- props = __rest(_a, ["children", "onClick"]);
2088
- return jsxRuntime.jsx("button", Object.assign({
2089
- className: "icon",
2090
- onClick: onClick,
2091
- "aria-controls": props['aria-controls'],
2092
- "aria-expanded": props['aria-expanded']
2093
- }, {
2094
- children: children
2095
- }));
2096
- };
2097
-
2098
- const ButtonGroup = ({
2099
- children,
2100
- selectedIndex,
2101
- variant
2102
- }) => {
2103
- const [selected, setSelected] = React.useState(selectedIndex);
2104
- const [buttons, setButtons] = React.useState([]);
2105
- React.useEffect(() => {
2106
- const buttonProps = (children instanceof Array ? children : [children]).filter(b => b && b.props).map((b, ix) => {
2107
- const bp = b.props;
2108
- const props = Object.assign(Object.assign({}, bp), {
2109
- variant,
2110
- key: bp.key || `btn_${ix}`,
2111
- active: ix === selected,
2112
- onClick: e => {
2113
- setSelected(ix);
2114
- if (bp.onClick) bp.onClick(e);
2115
- }
2116
- });
2117
- return props;
2118
- });
2119
- setButtons(buttonProps);
2120
- }, [children, selected, variant]);
2121
- return jsxRuntime.jsx(Group, {
2122
- children: buttons.map(props => jsxRuntime.jsx(Button, Object.assign({}, props), props.key))
2123
- });
2124
- };
2125
-
2126
- /* eslint-disable-next-line */
2127
- const validateInputValue = (target, rules, setError) => {
2128
- const errorMessage = validateInputValueErrors(rules, target);
2129
- errorMessage ? setErrorInsert(setError, target.name) : setErrorRemove(setError, target.name);
2130
- return errorMessage;
2131
- };
2132
- const validateInputValueErrors = (rules, target) => {
2133
- const {
2134
- value
2135
- } = target;
2136
- if ((rules === null || rules === void 0 ? void 0 : rules.custom) instanceof Function) {
2137
- return rules === null || rules === void 0 ? void 0 : rules.custom();
2138
- }
2139
- return validateTextInputValues(value, rules);
2140
- };
2141
- /* eslint-disable-next-line */
2142
- const setErrorInsert = (setError, name) => {
2143
- /* eslint-disable-next-line */
2144
- setError(errors => {
2145
- return Object.assign(Object.assign({}, errors), {
2146
- [name]: true
2147
- });
2148
- });
2149
- };
2150
- /* eslint-disable-next-line */
2151
- const setErrorRemove = (setError, name) => {
2152
- /* eslint-disable-next-line */
2153
- setError(errors => {
2154
- /* eslint-disable-next-line */
2155
- const newError = Object.assign({}, errors);
2156
- delete newError[name];
2157
- return newError;
2158
- });
2159
- };
2160
- const validateTextInputValues = (value, rules) => {
2161
- switch (rules === null || rules === void 0 ? void 0 : rules.type) {
2162
- case 'Required':
2163
- {
2164
- return value === '' || value === undefined || value === null ? 'error' : null;
2165
- }
2166
- default:
2167
- {
2168
- return;
2169
- }
2170
- }
2171
- };
2172
-
2173
- const FormContext = /*#__PURE__*/React__default["default"].createContext({});
2174
- const useFormContext = () => {
2175
- return React__default["default"].useContext(FormContext);
2176
- };
2177
- const FormProvider = _a => {
2178
- var {
2179
- children,
2180
- direction = 'vertical',
2181
- formSize = 'md',
2182
- onSubmit,
2183
- onFormSubmit
2184
- } = _a,
2185
- props = __rest(_a, ["children", "direction", "formSize", "onSubmit", "onFormSubmit"]);
2186
- /* eslint-disable-next-line */
2187
- const [values, setValues] = React__default["default"].useState();
2188
- /* eslint-disable-next-line */
2189
- const [errors, setErrors] = React__default["default"].useState();
2190
- /* eslint-disable-next-line */
2191
- const [fields, setFields] = React__default["default"].useState({});
2192
- const formSubmit = event => {
2193
- let hasError = false;
2194
- event.preventDefault();
2195
- Object.keys(fields).forEach(key => {
2196
- const errorMessage = validateInputValue({
2197
- name: key,
2198
- value: values === null || values === void 0 ? void 0 : values[key]
2199
- }, fields[key], setErrors);
2200
- hasError = hasError || !!errorMessage;
2201
- });
2202
- if (!hasError) {
2203
- onFormSubmit && onFormSubmit(values);
2204
- }
2205
- };
2206
- const resetForm = () => {
2207
- setValues({});
2208
- setErrors({});
2209
- };
2210
- return jsxRuntime.jsx(FormContext.Provider, Object.assign({
2211
- value: {
2212
- setValues,
2213
- setErrors,
2214
- setFields,
2215
- errors,
2216
- values
2217
- }
2218
- }, {
2219
- children: jsxRuntime.jsx("form", Object.assign({
2220
- className: [direction, `size-${formSize}`].join(' '),
2221
- onSubmit: formSubmit
2222
- }, props, {
2223
- onReset: resetForm
2224
- }, {
2225
- children: children
2226
- }))
2227
- }));
2228
- };
2229
-
2230
- const Form = props => {
2231
- return jsxRuntime.jsx(FormProvider, Object.assign({}, props));
2232
- };
2233
-
2234
- const FormItems = ({
2235
- children,
2236
- validate,
2237
- name
2238
- }) => {
2239
- const {
2240
- setValues,
2241
- setErrors,
2242
- setFields,
2243
- errors
2244
- } = useFormContext();
2245
- React__default["default"].useEffect(() => {
2246
- /* eslint-disable-next-line */
2247
- setFields(fields => Object.assign(Object.assign({}, fields), {
2248
- [name]: validate === null || validate === void 0 ? void 0 : validate.rules
2249
- }));
2250
- /* eslint-disable-next-line */
2251
- const removeValues = values => {
2252
- /* eslint-disable-next-line */
2253
- const newValues = Object.assign({}, values);
2254
- delete newValues[name];
2255
- return newValues;
2256
- };
2257
- return () => {
2258
- /* eslint-disable-next-line */
2259
- setFields(fields => removeValues(fields));
2260
- /* eslint-disable-next-line */
2261
- setValues(values => removeValues(values));
2262
- /* eslint-disable-next-line */
2263
- setErrors(errors => removeValues(errors));
2264
- };
2265
- // eslint-disable-next-line react-hooks/exhaustive-deps
2266
- }, []);
2267
- const onChange = event => {
2268
- if (!event.target) return;
2269
- const {
2270
- value,
2271
- name,
2272
- type,
2273
- checked
2274
- } = event.target;
2275
- let inputValue;
2276
- if (type === 'checkbox') {
2277
- inputValue = checked ? value : null;
2278
- /* eslint-disable-next-line */
2279
- checked ? setValues(values => Object.assign(Object.assign({}, values), {
2280
- [name]: value
2281
- })) : setValues(values => Object.assign(Object.assign({}, values), {
2282
- [name]: null
2283
- }));
2284
- } else {
2285
- inputValue = value;
2286
- /* eslint-disable-next-line */
2287
- setValues(values => Object.assign(Object.assign({}, values), {
2288
- [name]: value
2289
- }));
2290
- }
2291
- validateInputValue({
2292
- value: inputValue,
2293
- name,
2294
- type,
2295
- checked
2296
- }, validate === null || validate === void 0 ? void 0 : validate.rules, setErrors);
2297
- };
2298
- /* eslint-disable-next-line */
2299
- return /*#__PURE__*/React__default["default"].cloneElement(children, {
2300
- validator: (errors === null || errors === void 0 ? void 0 : errors[name]) && validate,
2301
- name,
2302
- onChange
2303
- });
2304
- };
2305
-
2306
- function Group({
2307
- children,
2308
- error,
2309
- groupBorder = false
2310
- }) {
2311
- const groupClassName = `group ${groupBorder ? 'group-border' : ''} ${error ? 'is-invalid' : ''}`;
2312
- const errorMessage = error ? error.message || error : '';
2313
- return jsxRuntime.jsxs("div", Object.assign({
2314
- className: "form-group"
2315
- }, {
2316
- children: [jsxRuntime.jsx("div", Object.assign({
2317
- className: groupClassName
2318
- }, {
2319
- children: children
2320
- })), error && jsxRuntime.jsx("span", Object.assign({
2321
- className: "form-info"
2322
- }, {
2323
- children: errorMessage
2324
- }))]
2325
- }));
2326
- }
2327
-
2328
- const FormItem = ({
2329
- expandableInfo,
2330
- label,
2331
- labelInformation,
2332
- validator,
2333
- inputId,
2334
- children,
2335
- expandableInfoButtonLabel,
2336
- role
2337
- }) => {
2338
- const expandableInnerRef = React.useRef(null);
2339
- const expandableRef = React.useRef(null);
2340
- const [expandableHeight, setExpandableHeight] = React.useState(0);
2341
- const [isExpanded, setIsExpanded] = React.useState(false);
2342
- const [isHidden, setIsHidden] = React.useState(false);
2343
- React.useLayoutEffect(() => {
2344
- expandableInnerRef.current && setExpandableHeight(expandableInnerRef.current['clientHeight']);
2345
- setIsHidden(true);
2346
- }, []);
2347
- React.useEffect(() => {
2348
- const handleResize = extract.debounce(function setExpandableHeightAfterResize() {
2349
- isExpanded && expandableInnerRef.current && setExpandableHeight(expandableInnerRef.current['clientHeight']);
2350
- }, 300);
2351
- if (expandableRef.current) {
2352
- window.addEventListener('resize', handleResize);
2353
- }
2354
- return () => {
2355
- window.removeEventListener('resize', handleResize);
2356
- };
2357
- }, [isExpanded, expandableInnerRef]);
2358
- if (!inputId) inputId = extract.randomId();
2359
- const formItemClassNames = classNames__default["default"]('gds-form-item', validator && extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator));
2360
- return jsxRuntime.jsxs("div", Object.assign({
2361
- className: formItemClassNames,
2362
- role: role ? role : undefined,
2363
- "aria-labelledby": role ? `${inputId}-label` : undefined
2364
- }, {
2365
- children: [expandableInfo && jsxRuntime.jsx("div", {
2366
- className: "gds-form-item__backdrop"
2367
- }), jsxRuntime.jsxs("div", Object.assign({
2368
- className: "gds-form-item__header"
2369
- }, {
2370
- children: [jsxRuntime.jsxs("div", Object.assign({
2371
- className: "gds-form-item__labels"
2372
- }, {
2373
- children: [label && jsxRuntime.jsx("label", Object.assign({
2374
- id: role ? `${inputId}-label` : undefined,
2375
- htmlFor: role ? undefined : inputId
2376
- }, {
2377
- children: label
2378
- })), labelInformation && jsxRuntime.jsx("div", Object.assign({
2379
- className: "form-info",
2380
- id: `${inputId}_info`
2381
- }, {
2382
- children: labelInformation
2383
- }))]
2384
- })), expandableInfo && jsxRuntime.jsx(IconButton, Object.assign({
2385
- "aria-expanded": isExpanded,
2386
- "aria-controls": `${inputId}-expandable-info`,
2387
- onClick: event => __awaiter(void 0, void 0, void 0, function* () {
2388
- if (!isExpanded) {
2389
- setIsHidden(false);
2390
- yield extract.delay(10);
2391
- expandableInnerRef.current && setExpandableHeight(expandableInnerRef.current['clientHeight']);
2392
- setIsExpanded(true);
2393
- } else {
2394
- setIsExpanded(false);
2395
- yield extract.delay(300);
2396
- setIsHidden(true);
2397
- }
2398
- })
2399
- }, {
2400
- children: isExpanded ? jsxRuntime.jsx(Times, {
2401
- title: expandableInfoButtonLabel
2402
- }) : jsxRuntime.jsx(InfoCircle, {
2403
- title: expandableInfoButtonLabel
2404
- })
2405
- }))]
2406
- })), expandableInfo && jsxRuntime.jsx("div", Object.assign({
2407
- ref: expandableRef,
2408
- id: `gds-expandable-info-${inputId}`,
2409
- className: "gds-form-item__expandable-info",
2410
- hidden: isHidden,
2411
- style: {
2412
- height: isExpanded ? expandableHeight : 0
2413
- }
2414
- }, {
2415
- children: jsxRuntime.jsxs("div", Object.assign({
2416
- ref: expandableInnerRef
2417
- }, {
2418
- children: [" ", expandableInfo, " "]
2419
- }))
2420
- })), children, jsxRuntime.jsx("div", Object.assign({
2421
- className: "gds-form-item__footer"
2422
- }, {
2423
- children: validator && jsxRuntime.jsx("span", Object.assign({
2424
- className: "form-info"
2425
- }, {
2426
- children: validator.message
2427
- }))
2428
- }))]
2429
- }));
2430
- };
2431
-
2432
- const useInput = (props, onChanges, onChangeInput) => {
2433
- const id = React.useMemo(() => props.id || extract.randomId(), [props.id]);
2434
- const ref = React.useRef(null);
2435
- const [value, setValue] = React.useState(props.value ? props.value : '');
2436
- const [checked, setChecked] = React.useState(props.checked ? props.checked : false);
2437
- React.useEffect(() => {
2438
- if (ref.current && ref.current.form) {
2439
- const resetListener = () => {
2440
- setValue(props.value ? props.value : '');
2441
- setChecked(props.checked ? props.checked : false);
2442
- };
2443
- const form = ref.current.form;
2444
- form.addEventListener('reset', resetListener);
2445
- return () => form.removeEventListener('reset', resetListener);
2446
- } else {
2447
- // eslint-disable-next-line @typescript-eslint/no-empty-function
2448
- return () => {};
2449
- }
2450
- }, [props]);
2451
- const onChange = event => {
2452
- setValue(event.target.value);
2453
- setChecked(event.currentTarget.checked);
2454
- onChanges && onChanges(event);
2455
- onChangeInput && onChangeInput(event.target.value);
2456
- };
2457
- return Object.assign(Object.assign({}, props), {
2458
- id,
2459
- ref,
2460
- value,
2461
- checked,
2462
- onChange
2463
- });
2464
- };
2465
-
2466
- const RenderInput = (type, props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel) => {
2467
- const _a = useInput(props, onChange, onChangeInput),
2468
- {
2469
- value
2470
- } = _a,
2471
- inputProps = __rest(_a, ["value"]);
2472
- const propsWithDescription = info ? Object.assign(Object.assign({}, inputProps), {
2473
- 'aria-describedby': `${inputProps.id}_info`
2474
- }) : inputProps;
2475
- // Render naked
2476
- if (!label && !info && !expandableInfo) return jsxRuntime.jsx("input", Object.assign({
2477
- type: type,
2478
- value: value
2479
- }, propsWithDescription));
2480
- return jsxRuntime.jsx(FormItem, Object.assign({
2481
- validator: validator,
2482
- labelInformation: info,
2483
- label: label,
2484
- expandableInfo: expandableInfo,
2485
- expandableInfoButtonLabel: expandableInfoButtonLabel,
2486
- inputId: inputProps.id
2487
- }, {
2488
- children: jsxRuntime.jsx("div", Object.assign({
2489
- className: "gds-input-wrapper"
2490
- }, {
2491
- children: jsxRuntime.jsx("input", Object.assign({
2492
- type: type,
2493
- value: value
2494
- }, propsWithDescription, {
2495
- className: validator && extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)
2496
- }))
2497
- }))
2498
- }));
2499
- };
2500
- const TextInput = _a => {
2501
- var {
2502
- label,
2503
- info,
2504
- onChange,
2505
- onChangeInput,
2506
- validator,
2507
- expandableInfo,
2508
- expandableInfoButtonLabel
2509
- } = _a,
2510
- props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator", "expandableInfo", "expandableInfoButtonLabel"]);
2511
- return RenderInput('text', props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel);
2512
- };
2513
- const EmailInput = _a => {
2514
- var {
2515
- label,
2516
- info,
2517
- onChange,
2518
- onChangeInput,
2519
- validator
2520
- } = _a,
2521
- props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
2522
- return RenderInput('email', props, onChange, onChangeInput, label, info, validator);
2523
- };
2524
- const NumberInput = _a => {
2525
- var {
2526
- label,
2527
- info,
2528
- onChange,
2529
- onChangeInput,
2530
- validator,
2531
- expandableInfo,
2532
- expandableInfoButtonLabel
2533
- } = _a,
2534
- props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator", "expandableInfo", "expandableInfoButtonLabel"]);
2535
- return RenderInput('number', props, onChange, onChangeInput, label, info, validator, expandableInfo, expandableInfoButtonLabel);
2536
- };
2537
- const Checkbox = _a => {
2538
- var {
2539
- label,
2540
- onChange,
2541
- validator
2542
- } = _a,
2543
- props = __rest(_a, ["label", "onChange", "validator"]);
2544
- const inputProps = useInput(props, onChange);
2545
- const labelClassNames = classNames__default["default"]('form-control', validator && extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator));
2546
- const inputClassNames = classNames__default["default"](validator && extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator));
2547
- return jsxRuntime.jsxs("div", Object.assign({
2548
- className: "form-group"
2549
- }, {
2550
- children: [jsxRuntime.jsxs("label", Object.assign({
2551
- htmlFor: inputProps.id,
2552
- className: labelClassNames
2553
- }, {
2554
- children: [label, jsxRuntime.jsx("input", Object.assign({
2555
- type: "checkbox"
2556
- }, inputProps, {
2557
- className: inputClassNames
2558
- })), jsxRuntime.jsx("i", {})]
2559
- })), validator && jsxRuntime.jsx("span", Object.assign({
2560
- className: "form-info"
2561
- }, {
2562
- children: validator.message
2563
- }))]
2564
- }));
2565
- };
2566
- const RadioButton = /*#__PURE__*/React__default["default"].forwardRef((_a, ref) => {
2567
- var {
2568
- label,
2569
- validator
2570
- } = _a,
2571
- props = __rest(_a, ["label", "validator"]);
2572
- const {
2573
- id
2574
- } = useInput(props);
2575
- const inputClassNames = classNames__default["default"](validator);
2576
- return jsxRuntime.jsxs("label", Object.assign({
2577
- htmlFor: id,
2578
- className: "form-control"
2579
- }, {
2580
- children: [jsxRuntime.jsx("input", Object.assign({
2581
- id: id,
2582
- type: "radio"
2583
- }, props, {
2584
- className: inputClassNames,
2585
- ref: ref
2586
- })), jsxRuntime.jsx("span", {
2587
- children: label
2588
- }), jsxRuntime.jsx("i", {})]
2589
- }));
2590
- });
2591
-
2592
- const Text = ({
2593
- children
2594
- }) => jsxRuntime.jsx("span", Object.assign({
2595
- className: "form-text"
2596
- }, {
2597
- children: children
2598
- }));
2599
-
2600
- var wellKnownSymbol$1 = wellKnownSymbol$8;
2601
-
2602
- var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
2603
- var test = {};
2604
-
2605
- test[TO_STRING_TAG$1] = 'z';
2606
-
2607
- var toStringTagSupport = String(test) === '[object z]';
2608
-
2609
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2610
- var isCallable$1 = isCallable$g;
2611
- var classofRaw = classofRaw$1;
2612
- var wellKnownSymbol = wellKnownSymbol$8;
2613
-
2614
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2615
- var $Object = Object;
2616
-
2617
- // ES3 wrong here
2618
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
2619
-
2620
- // fallback for IE11 Script Access Denied error
2621
- var tryGet = function (it, key) {
2622
- try {
2623
- return it[key];
2624
- } catch (error) { /* empty */ }
2625
- };
2626
-
2627
- // getting tag from ES6+ `Object.prototype.toString`
2628
- var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2629
- var O, tag, result;
2630
- return it === undefined ? 'Undefined' : it === null ? 'Null'
2631
- // @@toStringTag case
2632
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
2633
- // builtinTag case
2634
- : CORRECT_ARGUMENTS ? classofRaw(O)
2635
- // ES3 arguments fallback
2636
- : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
2637
- };
2638
-
2639
- var classof = classof$1;
2640
-
2641
- var $String = String;
2642
-
2643
- var toString$1 = function (argument) {
2644
- if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
2645
- return $String(argument);
2646
- };
2647
-
2648
- var makeBuiltIn = makeBuiltIn$3.exports;
2649
- var defineProperty = objectDefineProperty;
2650
-
2651
- var defineBuiltInAccessor$1 = function (target, name, descriptor) {
2652
- if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
2653
- if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
2654
- return defineProperty.f(target, name, descriptor);
2655
- };
2656
-
2657
- var $ = _export;
2658
- var DESCRIPTORS = descriptors;
2659
- var global$1 = global$c;
2660
- var uncurryThis = functionUncurryThis;
2661
- var hasOwn = hasOwnProperty_1;
2662
- var isCallable = isCallable$g;
2663
- var isPrototypeOf = objectIsPrototypeOf;
2664
- var toString = toString$1;
2665
- var defineBuiltInAccessor = defineBuiltInAccessor$1;
2666
- var copyConstructorProperties = copyConstructorProperties$2;
2667
-
2668
- var NativeSymbol = global$1.Symbol;
2669
- var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
2670
-
2671
- if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
2672
- // Safari 12 bug
2673
- NativeSymbol().description !== undefined
2674
- )) {
2675
- var EmptyStringDescriptionStore = {};
2676
- // wrap Symbol constructor for correct work with undefined description
2677
- var SymbolWrapper = function Symbol() {
2678
- var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
2679
- var result = isPrototypeOf(SymbolPrototype, this)
2680
- ? new NativeSymbol(description)
2681
- // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
2682
- : description === undefined ? NativeSymbol() : NativeSymbol(description);
2683
- if (description === '') EmptyStringDescriptionStore[result] = true;
2684
- return result;
2685
- };
2686
-
2687
- copyConstructorProperties(SymbolWrapper, NativeSymbol);
2688
- SymbolWrapper.prototype = SymbolPrototype;
2689
- SymbolPrototype.constructor = SymbolWrapper;
2690
-
2691
- var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
2692
- var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);
2693
- var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);
2694
- var regexp = /^Symbol\((.*)\)[^)]+$/;
2695
- var replace = uncurryThis(''.replace);
2696
- var stringSlice = uncurryThis(''.slice);
2697
-
2698
- defineBuiltInAccessor(SymbolPrototype, 'description', {
2699
- configurable: true,
2700
- get: function description() {
2701
- var symbol = thisSymbolValue(this);
2702
- if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
2703
- var string = symbolDescriptiveString(symbol);
2704
- var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
2705
- return desc === '' ? undefined : desc;
2706
- }
2707
- });
2708
-
2709
- $({ global: true, constructor: true, forced: true }, {
2710
- Symbol: SymbolWrapper
2711
- });
2712
- }
2713
-
2714
- const RadioGroup = ({
2715
- defaultSelected,
2716
- valueSelected,
2717
- label,
2718
- title,
2719
- labelInformation,
2720
- description,
2721
- expandableInfo,
2722
- expandableInfoButtonLabel,
2723
- validator,
2724
- onChangeRadio,
2725
- onChange,
2726
- name,
2727
- horizontal,
2728
- children
2729
- }) => {
2730
- if (title) console.warn('"title" prop is deprecated. Please use "label" instead.');
2731
- if (description) console.warn('"description" prop is deprecated. Please use "labelInformation" instead.');
2732
- const [selected, setSelected] = React.useState(valueSelected !== null && valueSelected !== void 0 ? valueSelected : defaultSelected);
2733
- const [prevValueSelected, setPrevValueSelected] = React.useState(valueSelected);
2734
- if (valueSelected !== prevValueSelected) {
2735
- setSelected(valueSelected);
2736
- setPrevValueSelected(valueSelected);
2737
- }
2738
- extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
2739
- const handleOnChange = event => {
2740
- if (event.target.value !== selected) {
2741
- setSelected(event.target.value);
2742
- onChangeRadio && onChangeRadio(event.target.value);
2743
- onChange && onChange(event);
2744
- }
2745
- };
2746
- const radioBtnRef = React.useRef(null);
2747
- React__default["default"].useEffect(() => {
2748
- var _a;
2749
- if (radioBtnRef && radioBtnRef.current) {
2750
- const form = (_a = radioBtnRef === null || radioBtnRef === void 0 ? void 0 : radioBtnRef.current) === null || _a === void 0 ? void 0 : _a.form;
2751
- const resetListner = () => {
2752
- setSelected(undefined);
2753
- };
2754
- form === null || form === void 0 ? void 0 : form.addEventListener('reset', resetListner);
2755
- return () => form === null || form === void 0 ? void 0 : form.removeEventListener('reset', resetListner);
2756
- } else {
2757
- // eslint-disable-next-line @typescript-eslint/no-empty-function
2758
- return () => {};
2759
- }
2760
- // eslint-disable-next-line react-hooks/exhaustive-deps
2761
- }, []);
2762
- const labelFromTitle = label || title;
2763
- const labelInformationFromDescription = labelInformation || description;
2764
- const formItemProps = {
2765
- validator,
2766
- labelInformation: labelInformationFromDescription,
2767
- label: labelFromTitle,
2768
- expandableInfo,
2769
- expandableInfoButtonLabel,
2770
- role: 'radiogroup'
2771
- };
2772
- if (!name) name = extract.randomId();
2773
- const radioGroupWrapperClassNames = classNames__default["default"]('gds-radio-group-wrapper', {
2774
- 'gds-radio-group-wrapper--horizontal': horizontal
2775
- });
2776
- return jsxRuntime.jsx(FormItem, Object.assign({}, formItemProps, {
2777
- children: jsxRuntime.jsx("div", Object.assign({
2778
- className: radioGroupWrapperClassNames
2779
- }, {
2780
- children: React__default["default"].Children.map(children, radioButton => {
2781
- return /*#__PURE__*/React__default["default"].isValidElement(radioButton) ? /*#__PURE__*/React__default["default"].cloneElement(radioButton, {
2782
- validator: validator && extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator),
2783
- onChange: handleOnChange,
2784
- checked: selected === radioButton.props.value,
2785
- name,
2786
- ref: radioBtnRef
2787
- }) : radioButton;
2788
- })
2789
- }))
2790
- }));
2791
- };
2792
-
2793
- const ListItem = _a => {
2794
- var {
2795
- listType,
2796
- tableRowData,
2797
- children
2798
- } = _a,
2799
- props = __rest(_a, ["listType", "tableRowData", "children"]);
2800
- if (listType === 'table') {
2801
- return jsxRuntime.jsx("dl", {
2802
- children: jsxRuntime.jsxs("div", {
2803
- children: [jsxRuntime.jsx("dt", {
2804
- children: tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.title
2805
- }), tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.definition.map((item, index) => jsxRuntime.jsx("dd", {
2806
- children: item
2807
- }, index))]
2808
- })
2809
- });
2810
- } else {
2811
- return jsxRuntime.jsx("li", Object.assign({}, props, {
2812
- children: children
2813
- }));
2814
- }
2815
- };
2816
-
2817
- const List$1 = _a => {
2818
- var {
2819
- listType,
2820
- tableCaption,
2821
- tableData,
2822
- children
2823
- } = _a,
2824
- props = __rest(_a, ["listType", "tableCaption", "tableData", "children"]);
2825
- if (listType === 'ordered') {
2826
- return jsxRuntime.jsx("ol", Object.assign({}, props, {
2827
- children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsxRuntime.jsx(ListItem, {
2828
- children: child
2829
- }, index))
2830
- }));
2831
- } else if (listType !== 'table') {
2832
- return jsxRuntime.jsx("ul", Object.assign({}, props, {
2833
- className: listType
2834
- }, {
2835
- children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsxRuntime.jsx(ListItem, {
2836
- children: child
2837
- }, index))
2838
- }));
2839
- } else {
2840
- return jsxRuntime.jsxs("figure", {
2841
- children: [jsxRuntime.jsx("figcaption", Object.assign({
2842
- className: "table-list-caption"
2843
- }, {
2844
- children: tableCaption
2845
- })), jsxRuntime.jsx("dl", {
2846
- children: tableData === null || tableData === void 0 ? void 0 : tableData.map((data, index) => jsxRuntime.jsx(ListItem, {
2847
- listType: listType,
2848
- tableRowData: data
2849
- }, index))
2850
- })]
2851
- });
2852
- }
2853
- };
2854
-
2855
- const Label = ({
2856
- children
2857
- }) => {
2858
- return jsxRuntime.jsx("dt", {
2859
- children: children
2860
- });
2861
- };
2862
- const Value = ({
2863
- children
2864
- }) => {
2865
- return jsxRuntime.jsx("dd", {
2866
- children: children
2867
- });
2868
- };
2869
- const List = ({
2870
- children,
2871
- inverted
2872
- }) => {
2873
- let classNames = 'gds-list';
2874
- if (inverted) classNames += ' gds-list--inverted';
2875
- return jsxRuntime.jsx("dl", Object.assign({
2876
- className: classNames
2877
- }, {
2878
- children: children
2879
- }));
2880
- };
2881
- var valueList = {
2882
- List,
2883
- Label,
2884
- Value
2885
- };
2886
-
2887
- var valueList$1 = /*#__PURE__*/Object.freeze({
2888
- __proto__: null,
2889
- Label: Label,
2890
- Value: Value,
2891
- List: List,
2892
- 'default': valueList
2893
- });
2894
-
2895
- const Link = _a => {
2896
- var {
2897
- button,
2898
- children
2899
- } = _a,
2900
- props = __rest(_a, ["button", "children"]);
2901
- const [anchorProps, setAnchorProps] = React.useState({});
2902
- React.useEffect(() => {
2903
- const className = button ? typeof button === 'string' ? `button ${button}` : 'button' : undefined;
2904
- const newProps = Object.assign({
2905
- role: button ? 'button' : undefined,
2906
- className: className
2907
- }, props);
2908
- setAnchorProps(newProps);
2909
- // eslint-disable-next-line react-hooks/exhaustive-deps
2910
- }, [button]);
2911
- return jsxRuntime.jsx("a", Object.assign({}, anchorProps, {
2912
- children: children
2913
- }));
2914
- };
2915
-
2916
- //TODO: Add variants
2917
- const Navbar = ({
2918
- children,
2919
- variant,
2920
- title,
2921
- titleLink,
2922
- brandLink: _brandLink = 'https://www.seb.se',
2923
- brandAriaLabel: _brandAriaLabel = 'Open seb.se in new tab'
2924
- }) => {
2925
- const [props, setProps] = React.useState({});
2926
- React.useEffect(() => {
2927
- const classNames = [];
2928
- if (variant) classNames.push(variant);
2929
- setProps(Object.assign(Object.assign({}, props), {
2930
- className: classNames.join(' ')
2931
- }));
2932
- // eslint-disable-next-line react-hooks/exhaustive-deps
2933
- }, [variant]);
2934
- return jsxRuntime.jsxs("nav", Object.assign({
2935
- role: "navigation"
2936
- }, props, {
2937
- children: [jsxRuntime.jsx(Link, {
2938
- "aria-label": _brandAriaLabel,
2939
- href: _brandLink,
2940
- target: "_blank",
2941
- className: "brand"
2942
- }), jsxRuntime.jsx("div", Object.assign({
2943
- className: "container-fluid"
2944
- }, {
2945
- children: jsxRuntime.jsxs("div", Object.assign({
2946
- className: "row justify-content-between align-items-center"
2947
- }, {
2948
- children: [jsxRuntime.jsx("div", Object.assign({
2949
- className: "col-auto"
2950
- }, {
2951
- children: titleLink ? jsxRuntime.jsx(Link, Object.assign({
2952
- className: "mx-4",
2953
- href: titleLink
2954
- }, {
2955
- children: jsxRuntime.jsx("h1", {
2956
- children: title
2957
- })
2958
- })) : jsxRuntime.jsx("h1", {
2959
- children: title
2960
- })
2961
- })), jsxRuntime.jsx("div", Object.assign({
2962
- className: "col-auto"
2963
- }, {
2964
- children: jsxRuntime.jsx("div", Object.assign({
2965
- className: "group size-sm"
2966
- }, {
2967
- children: children
2968
- }))
2969
- }))]
2970
- }))
2971
- }))]
2972
- }));
2973
- };
2974
-
2975
- function Badge(_a) {
2976
- var {
2977
- children,
2978
- badgeType,
2979
- isCloseable,
2980
- closeText,
2981
- customColor,
2982
- customBackgroundColor
2983
- } = _a,
2984
- props = __rest(_a, ["children", "badgeType", "isCloseable", "closeText", "customColor", "customBackgroundColor"]);
2985
- const [isClosed, setIsClosed] = React__default["default"].useState(false);
2986
- const [type, setType] = React__default["default"].useState('');
2987
- React__default["default"].useEffect(() => {
2988
- if (badgeType) {
2989
- setType(badgeType);
2990
- }
2991
- if (!!customColor || !!customBackgroundColor) {
2992
- setType('');
2993
- }
2994
- }, [badgeType, customColor, customBackgroundColor]);
2995
- return !isClosed ? jsxRuntime.jsxs("span", Object.assign({}, props, {
2996
- className: `badge ${type}`,
2997
- style: {
2998
- color: customColor,
2999
- backgroundColor: customBackgroundColor
3000
- }
3001
- }, {
3002
- children: [jsxRuntime.jsx("strong", {
3003
- children: children
3004
- }), isCloseable && jsxRuntime.jsxs("button", Object.assign({
3005
- type: "button",
3006
- className: "close",
3007
- onClick: () => setIsClosed(true)
3008
- }, {
3009
- children: [closeText, jsxRuntime.jsx("i", {})]
3010
- }))]
3011
- })) : null;
3012
- }
3013
-
3014
- // eslint-disable-next-line @typescript-eslint/no-empty-function
3015
- const noop = () => {};
3016
- const useStepper = ({
3017
- min,
3018
- max,
3019
- value: _value = 0,
3020
- step: _step = 1,
3021
- id: _id = extract.randomId(),
3022
- onChange
3023
- }) => {
3024
- const pStepper = {
3025
- down: noop,
3026
- setMax: noop,
3027
- setMin: noop,
3028
- setStep: noop,
3029
- setValue: noop,
3030
- up: noop
3031
- };
3032
- const [stepper, setStepper] = React.useState(pStepper);
3033
- const [data, setData] = React.useState({
3034
- id: _id,
3035
- value: _value,
3036
- min,
3037
- max,
3038
- step: _step
3039
- });
3040
- // eslint-disable-next-line react-hooks/exhaustive-deps
3041
- React.useEffect(() => {
3042
- if (max !== data.max) stepper.setMax(max);
3043
- }, [stepper, max]);
3044
- // eslint-disable-next-line react-hooks/exhaustive-deps
3045
- React.useEffect(() => {
3046
- if (min !== data.min) stepper.setMin(min);
3047
- }, [stepper, min]);
3048
- // eslint-disable-next-line react-hooks/exhaustive-deps
3049
- React.useEffect(() => {
3050
- if (_step !== data.step) stepper.setStep(_step || 1);
3051
- }, [stepper, _step]);
3052
- // eslint-disable-next-line react-hooks/exhaustive-deps
3053
- React.useEffect(() => {
3054
- if (_value !== data.value) stepper.setValue(_value || 0, false);
3055
- }, [stepper, _value]);
3056
- React.useEffect(() => {
3057
- setStepper(extract.createStepper({
3058
- id: _id,
3059
- value: _value,
3060
- min,
3061
- max,
3062
- step: _step,
3063
- onChange
3064
- }, setData));
3065
- // eslint-disable-next-line react-hooks/exhaustive-deps
3066
- }, []);
3067
- return [stepper, data];
3068
- };
3069
-
3070
- // TODO: Should be named "Numeric input" instead of stepper?
3071
- function Stepper(_a) {
3072
- var {
3073
- label,
3074
- description,
3075
- statusMessage,
3076
- validator
3077
- } = _a,
3078
- stepperArgs = __rest(_a, ["label", "description", "statusMessage", "validator"]);
3079
- const [stepper, data] = useStepper(stepperArgs);
3080
- const onChangeEvent = e => {
3081
- stepper.setValue(e.target.valueAsNumber);
3082
- };
3083
- const PrimitiveStepper = jsxRuntime.jsxs("div", Object.assign({
3084
- className: `group group-border group-stepper ${validator && extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)}`
3085
- }, {
3086
- children: [jsxRuntime.jsx("button", Object.assign({
3087
- onClick: () => stepper.down()
3088
- }, {
3089
- children: "-"
3090
- })), jsxRuntime.jsx("input", {
3091
- id: data.id,
3092
- type: "number",
3093
- onChange: onChangeEvent,
3094
- onFocus: ({
3095
- target
3096
- }) => target.select(),
3097
- placeholder: "0",
3098
- value: data.value
3099
- }), jsxRuntime.jsx("button", Object.assign({
3100
- onClick: () => stepper.up()
3101
- }, {
3102
- children: "+"
3103
- }))]
3104
- }));
3105
- if (!label && !description && !statusMessage && !validator) return PrimitiveStepper;
3106
- return jsxRuntime.jsxs("div", Object.assign({
3107
- className: "form-group"
3108
- }, {
3109
- children: [label && jsxRuntime.jsx("label", Object.assign({
3110
- htmlFor: data.id
3111
- }, {
3112
- children: label
3113
- })), description && jsxRuntime.jsx("span", Object.assign({
3114
- className: "form-info"
3115
- }, {
3116
- children: description
3117
- })), jsxRuntime.jsxs("div", Object.assign({
3118
- className: "stepper-wrapper"
3119
- }, {
3120
- children: [PrimitiveStepper, validator && jsxRuntime.jsx("span", Object.assign({
3121
- className: "form-info"
3122
- }, {
3123
- children: validator.message
3124
- }))]
3125
- }))]
3126
- }));
3127
- }
3128
-
3129
- const Select = /*#__PURE__*/React__default["default"].forwardRef(({
3130
- id,
3131
- className,
3132
- children,
3133
- validator,
3134
- label,
3135
- labelInformation,
3136
- defaultValue,
3137
- value,
3138
- testId,
3139
- onChange,
3140
- onSelect,
3141
- expandableInfo,
3142
- expandableInfoButtonLabel
3143
- }, ref) => {
3144
- const selectId = id !== null && id !== void 0 ? id : extract.randomId();
3145
- const validatorClassName = extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
3146
- return jsxRuntime.jsx(FormItem, Object.assign({
3147
- label: label,
3148
- labelInformation: labelInformation,
3149
- expandableInfo: expandableInfo,
3150
- expandableInfoButtonLabel: expandableInfoButtonLabel,
3151
- inputId: selectId,
3152
- validator: validator
3153
- }, {
3154
- children: jsxRuntime.jsxs("div", Object.assign({
3155
- className: `gds-select ${validatorClassName}`
3156
- }, {
3157
- children: [jsxRuntime.jsx("select", Object.assign({
3158
- id: selectId,
3159
- "data-testid": testId,
3160
- className: className,
3161
- defaultValue: defaultValue,
3162
- value: value,
3163
- ref: ref,
3164
- onChange: event => {
3165
- onChange && onChange(event);
3166
- }
3167
- }, {
3168
- children: children
3169
- })), jsxRuntime.jsx(ChevronDown, {})]
3170
- }))
3171
- }));
3172
- });
3173
- const Option = _a => {
3174
- var {
3175
- value,
3176
- children
3177
- } = _a,
3178
- rest = __rest(_a, ["value", "children"]);
3179
- return jsxRuntime.jsx("option", Object.assign({
3180
- value: value
3181
- }, rest, {
3182
- children: children
3183
- }));
3184
- };
3185
- const OptionGroup = ({
3186
- label,
3187
- disabled,
3188
- children
3189
- }) => {
3190
- return jsxRuntime.jsx("optgroup", Object.assign({
3191
- label: label,
3192
- disabled: disabled
3193
- }, {
3194
- children: children
3195
- }));
3196
- };
3197
-
3198
- const useDropdown = ({
3199
- id,
3200
- value,
3201
- texts,
3202
- options,
3203
- loop,
3204
- multiSelect,
3205
- searchable,
3206
- searchFilter,
3207
- compareWith,
3208
- useValue,
3209
- display,
3210
- togglerRef,
3211
- listboxRef,
3212
- onChange,
3213
- validator
3214
- }) => {
3215
- const [handler, setHandler] = React.useState();
3216
- const [dropdown, setDropdown] = React.useState();
3217
- const [togglerProps, setTogglerProps] = React.useState({});
3218
- const [listboxProps, setListboxProps] = React.useState({});
3219
- const [listItems, setListItems] = React.useState([]);
3220
- const [multiSelectProps, setMultiSelectProps] = React.useState({});
3221
- // When dropdown data changes
3222
- React.useEffect(() => {
3223
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
3224
- if (!dropdown) return;
3225
- const {
3226
- elements: {
3227
- toggler,
3228
- listbox
3229
- }
3230
- } = dropdown;
3231
- const newToggleProps = Object.assign(Object.assign({}, toggler === null || toggler === void 0 ? void 0 : toggler.attributes), {
3232
- className: (_a = toggler === null || toggler === void 0 ? void 0 : toggler.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
3233
- children: (_b = dropdown === null || dropdown === void 0 ? void 0 : dropdown.texts) === null || _b === void 0 ? void 0 : _b.select,
3234
- onClick: () => handler === null || handler === void 0 ? void 0 : handler.toggle()
3235
- });
3236
- setTogglerProps(newToggleProps);
3237
- const newListboxProps = Object.assign(Object.assign({}, listbox === null || listbox === void 0 ? void 0 : listbox.attributes), {
3238
- className: (_c = listbox === null || listbox === void 0 ? void 0 : listbox.classes) === null || _c === void 0 ? void 0 : _c.join(' ')
3239
- });
3240
- setListboxProps(newListboxProps);
3241
- if (!dropdown.isMultiSelect) {
3242
- const newListItems = dropdown.options.map(o => {
3243
- var _a;
3244
- return Object.assign(Object.assign({}, o.attributes), {
3245
- className: (_a = o.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
3246
- children: o[dropdown.display],
3247
- selected: o.selected,
3248
- onClick: () => handler === null || handler === void 0 ? void 0 : handler.select(o)
3249
- });
3250
- });
3251
- setListItems(newListItems);
3252
- } else {
3253
- const checkboxes = dropdown.options.map(o => ({
3254
- labelProps: Object.assign(Object.assign({}, o.attributes), {
3255
- className: ['form-control', ...o.classes].join(' ')
3256
- }),
3257
- inputProps: {
3258
- defaultChecked: o.selected,
3259
- type: 'checkbox',
3260
- onClick: () => handler === null || handler === void 0 ? void 0 : handler.select(o, false)
3261
- },
3262
- spanProps: {
3263
- children: o[dropdown.display]
3264
- }
3265
- }));
3266
- const newMultiselect = {
3267
- fieldsetProps: {
3268
- 'aria-describedby': (_f = (_e = (_d = dropdown === null || dropdown === void 0 ? void 0 : dropdown.elements) === null || _d === void 0 ? void 0 : _d.fieldset) === null || _e === void 0 ? void 0 : _e.attributes) === null || _f === void 0 ? void 0 : _f.id,
3269
- 'aria-multiselectable': true,
3270
- role: 'listbox',
3271
- tabIndex: -1
3272
- },
3273
- legendProps: {
3274
- className: 'sr-only',
3275
- id: (_j = (_h = (_g = dropdown === null || dropdown === void 0 ? void 0 : dropdown.elements) === null || _g === void 0 ? void 0 : _g.fieldset) === null || _h === void 0 ? void 0 : _h.attributes) === null || _j === void 0 ? void 0 : _j.id,
3276
- children: dropdown.texts.optionsDescription
3277
- },
3278
- checkboxes
3279
- };
3280
- setMultiSelectProps(newMultiselect);
3281
- }
3282
- // eslint-disable-next-line react-hooks/exhaustive-deps
3283
- }, [dropdown]);
3284
- // When dropdown properties change
3285
- React.useEffect(() => {
3286
- if (!dropdown) return;
3287
- handler === null || handler === void 0 ? void 0 : handler.update({
3288
- id,
3289
- value,
3290
- texts,
3291
- options,
3292
- loop,
3293
- multiSelect,
3294
- searchable,
3295
- searchFilter,
3296
- compareWith,
3297
- useValue,
3298
- display,
3299
- validator
3300
- });
3301
- // eslint-disable-next-line react-hooks/exhaustive-deps
3302
- }, [id, texts, options, loop, multiSelect, searchable, searchFilter, compareWith, useValue, display]);
3303
- React.useEffect(() => {
3304
- if (!dropdown) return;
3305
- handler === null || handler === void 0 ? void 0 : handler.selectByValue(value);
3306
- console.log('new value');
3307
- // eslint-disable-next-line react-hooks/exhaustive-deps
3308
- }, [value]);
3309
- // When validator changes
3310
- React.useEffect(() => {
3311
- if (!dropdown) return;
3312
- if (validator) handler === null || handler === void 0 ? void 0 : handler.validate(validator);
3313
- // eslint-disable-next-line react-hooks/exhaustive-deps
3314
- }, [validator]);
3315
- // Create dropdown handler
3316
- React.useEffect(() => {
3317
- if (!handler && togglerRef.current && listboxRef.current) {
3318
- setHandler(extract.createDropdown({
3319
- id,
3320
- value,
3321
- texts,
3322
- options,
3323
- loop,
3324
- multiSelect,
3325
- searchable,
3326
- searchFilter,
3327
- compareWith,
3328
- useValue,
3329
- display,
3330
- validator
3331
- }, togglerRef.current, listboxRef.current, listboxRef.current, dd => setDropdown(dd), value => onChange === null || onChange === void 0 ? void 0 : onChange(value)));
3332
- }
3333
- return () => handler === null || handler === void 0 ? void 0 : handler.destroy();
3334
- // eslint-disable-next-line react-hooks/exhaustive-deps
3335
- }, [togglerRef, listboxRef]);
3336
- return {
3337
- dropdown: handler,
3338
- togglerProps,
3339
- listboxProps,
3340
- listItems,
3341
- multiSelectProps
3342
- };
3343
- };
3344
-
3345
- const Dropdown = ({
3346
- compareWith,
3347
- display,
3348
- id,
3349
- informationLabel,
3350
- label,
3351
- loop,
3352
- multiSelect,
3353
- onChange,
3354
- options,
3355
- searchFilter,
3356
- searchable,
3357
- texts,
3358
- useValue,
3359
- validator,
3360
- value
3361
- }) => {
3362
- var _a;
3363
- const togglerRef = React.useRef(null);
3364
- const listboxRef = React.useRef(null);
3365
- const {
3366
- dropdown,
3367
- listboxProps,
3368
- togglerProps,
3369
- listItems,
3370
- multiSelectProps
3371
- } = useDropdown({
3372
- id,
3373
- value,
3374
- options,
3375
- loop,
3376
- multiSelect,
3377
- searchable,
3378
- searchFilter,
3379
- compareWith,
3380
- useValue,
3381
- display,
3382
- togglerRef,
3383
- listboxRef,
3384
- texts,
3385
- onChange,
3386
- validator
3387
- });
3388
- const getListBoxProps = props => {
3389
- var _a, _b, _c;
3390
- if (Object.keys(props).length === 0) return {
3391
- role: 'listbox',
3392
- tabIndex: -1,
3393
- className: (_c = (_b = (_a = extract.dropdownValues().elements) === null || _a === void 0 ? void 0 : _a.listbox) === null || _b === void 0 ? void 0 : _b.classes) === null || _c === void 0 ? void 0 : _c.join(' ')
3394
- };
3395
- return props;
3396
- };
3397
- return jsxRuntime.jsxs("div", Object.assign({
3398
- className: "form-group"
3399
- }, {
3400
- children: [label && jsxRuntime.jsx("label", Object.assign({
3401
- htmlFor: togglerProps.id
3402
- }, {
3403
- children: label
3404
- })), informationLabel && jsxRuntime.jsx("div", Object.assign({
3405
- className: "form-info"
3406
- }, {
3407
- children: informationLabel
3408
- })), jsxRuntime.jsx("button", Object.assign({
3409
- type: "button"
3410
- }, togglerProps, {
3411
- ref: togglerRef
3412
- }, {
3413
- children: jsxRuntime.jsx("span", {
3414
- children: togglerProps.children
3415
- })
3416
- })), jsxRuntime.jsxs("div", Object.assign({}, getListBoxProps(listboxProps), {
3417
- ref: listboxRef
3418
- }, {
3419
- children: [jsxRuntime.jsxs("button", Object.assign({
3420
- type: "button",
3421
- className: "close m-4 m-sm-2 d-block d-sm-none",
3422
- onClick: dropdown === null || dropdown === void 0 ? void 0 : dropdown.close
3423
- }, {
3424
- children: [jsxRuntime.jsx("span", Object.assign({
3425
- className: "sr-only"
3426
- }, {
3427
- children: dropdown === null || dropdown === void 0 ? void 0 : dropdown.dropdown.texts.close
3428
- })), jsxRuntime.jsx("i", {})]
3429
- })), (dropdown === null || dropdown === void 0 ? void 0 : dropdown.dropdown.isMultiSelect) ? jsxRuntime.jsx("div", Object.assign({
3430
- className: "sg-fieldset-container"
3431
- }, {
3432
- children: jsxRuntime.jsxs("fieldset", Object.assign({}, multiSelectProps.fieldsetProps, {
3433
- children: [jsxRuntime.jsx("legend", Object.assign({}, multiSelectProps.legendProps)), (_a = multiSelectProps.checkboxes) === null || _a === void 0 ? void 0 : _a.map(checkboxItem => jsxRuntime.jsxs("label", Object.assign({}, checkboxItem.labelProps, {
3434
- children: [jsxRuntime.jsx("input", Object.assign({}, checkboxItem.inputProps)), jsxRuntime.jsx("span", Object.assign({}, checkboxItem.spanProps)), jsxRuntime.jsx("i", {})]
3435
- }), checkboxItem.labelProps.id))]
3436
- }))
3437
- })) : jsxRuntime.jsx("ul", Object.assign({
3438
- role: "listbox"
3439
- }, {
3440
- children: listItems.map(liProps => jsxRuntime.jsx("li", Object.assign({}, liProps), liProps.id))
3441
- }))]
3442
- })), validator && jsxRuntime.jsx("span", Object.assign({
3443
- className: "form-info"
3444
- }, {
3445
- children: validator === null || validator === void 0 ? void 0 : validator.message
3446
- }))]
3447
- }));
3448
- };
3449
-
3450
- const useDatepicker = (datepickerRef, datepickerDialogRef, dateInputRef, datepickerTriggerRef, options = {}) => {
3451
- const dataStub = {
3452
- formattedSelectedDate: '',
3453
- calendar: {
3454
- headers: [],
3455
- calendarGrid: []
3456
- }
3457
- };
3458
- const [data, setData] = React.useState(dataStub);
3459
- const [state, setState] = React.useState({
3460
- isActive: false
3461
- });
3462
- const datepickerStub = {};
3463
- const [datepicker, setDatepicker] = React.useState(datepickerStub);
3464
- React.useEffect(() => {
3465
- if (!datepicker.open && datepickerRef.current && datepickerDialogRef.current && dateInputRef.current && datepickerTriggerRef.current) {
3466
- setDatepicker(extract.createDatepicker((data, state) => {
3467
- if (data) setData(data);
3468
- if (state) setState(state);
3469
- }, options, datepickerRef.current, datepickerDialogRef.current, dateInputRef.current, datepickerTriggerRef.current));
3470
- }
3471
- }, [datepicker, datepickerRef, datepickerDialogRef, dateInputRef, datepickerTriggerRef, options]);
3472
- return {
3473
- datepicker,
3474
- data,
3475
- state
3476
- };
3477
- };
3478
-
3479
- const Datepicker = (options = {}) => {
3480
- const [uuid] = React.useState(extract.randomId());
3481
- const id = `sgr-datepicker-${uuid}`;
3482
- const datepickerRef = React.useRef(null);
3483
- const datepickerTriggerRef = React.useRef(null);
3484
- const datepickerDialogRef = React.useRef(null);
3485
- const dateInputRef = React.useRef(null);
3486
- const {
3487
- datepicker,
3488
- data,
3489
- state
3490
- } = useDatepicker(datepickerRef, datepickerDialogRef, dateInputRef, datepickerTriggerRef, options);
3491
- React.useEffect(() => {
3492
- var _a;
3493
- const selDateSub = (_a = datepicker.selectedDate$) === null || _a === void 0 ? void 0 : _a.subscribe(newDate => options.onChange && options.onChange(newDate));
3494
- return () => selDateSub === null || selDateSub === void 0 ? void 0 : selDateSub.unsubscribe();
3495
- }, [datepicker, options]);
3496
- const classNames = day => Object.entries({
3497
- disabled: !day.currentMonth,
3498
- 'sg-date-today': day.today
3499
- // 'sg-date-holiday': day.holiday,
3500
- }).map(([className, add]) => add ? className : '').join(' ');
3501
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
3502
- children: [jsxRuntime.jsxs("div", Object.assign({
3503
- className: "form-group"
3504
- }, {
3505
- children: [jsxRuntime.jsx("label", Object.assign({
3506
- htmlFor: id
3507
- }, {
3508
- children: "Date"
3509
- })), jsxRuntime.jsxs("div", Object.assign({
3510
- className: "group",
3511
- ref: datepickerRef
3512
- }, {
3513
- children: [jsxRuntime.jsx("input", {
3514
- ref: dateInputRef,
3515
- id: id,
3516
- type: "text",
3517
- placeholder: "yyyy-mm-dd",
3518
- value: data.formattedSelectedDate,
3519
- onChange: e => datepicker.select(e.target.value)
3520
- }), jsxRuntime.jsx("button", Object.assign({
3521
- ref: datepickerTriggerRef,
3522
- type: "button",
3523
- className: "primary",
3524
- onClick: () => datepicker.toggle()
3525
- }, {
3526
- children: jsxRuntime.jsx("i", Object.assign({
3527
- className: "sg-icon sg-icon-calendar"
3528
- }, {
3529
- children: "Select date"
3530
- }))
3531
- }))]
3532
- })), jsxRuntime.jsx("span", Object.assign({
3533
- className: "form-info"
3534
- }, {
3535
- children: "Select a date"
3536
- }))]
3537
- })), jsxRuntime.jsx("div", Object.assign({
3538
- ref: datepickerDialogRef,
3539
- className: `popover popover-datepicker ${state.isActive ? 'active' : ''}`,
3540
- role: "dialog",
3541
- "aria-modal": "true",
3542
- "aria-label": "Choose Date"
3543
- }, {
3544
- children: state.isActive && jsxRuntime.jsxs("div", Object.assign({
3545
- className: "sg-date"
3546
- }, {
3547
- children: [jsxRuntime.jsxs("header", {
3548
- children: [jsxRuntime.jsx("button", Object.assign({
3549
- className: "link",
3550
- onClick: () => datepicker.sub(1, 'months')
3551
- }, {
3552
- children: jsxRuntime.jsx("i", Object.assign({
3553
- className: "sg-icon sg-icon-previous"
3554
- }, {
3555
- children: "Previous month"
3556
- }))
3557
- })), jsxRuntime.jsx(Dropdown, {
3558
- options: extract.months({}),
3559
- display: "key",
3560
- texts: {
3561
- placeholder: data.monthName
3562
- }
3563
- }), jsxRuntime.jsx(Dropdown, {
3564
- options: extract.years({}),
3565
- display: "key",
3566
- texts: {
3567
- placeholder: data.year + ''
3568
- }
3569
- }), jsxRuntime.jsx("button", Object.assign({
3570
- className: "link",
3571
- onClick: () => datepicker.add(1, 'months')
3572
- }, {
3573
- children: jsxRuntime.jsx("i", Object.assign({
3574
- className: "sg-icon sg-icon-next"
3575
- }, {
3576
- children: "Next month"
3577
- }))
3578
- }))]
3579
- }), jsxRuntime.jsx("main", {
3580
- children: jsxRuntime.jsxs("table", Object.assign({
3581
- role: "grid"
3582
- }, {
3583
- children: [jsxRuntime.jsx("thead", {
3584
- children: jsxRuntime.jsx("tr", {
3585
- children: data.calendar.headers.map((header, ix) => jsxRuntime.jsx("th", Object.assign({
3586
- scope: "col",
3587
- abbr: header.abbr,
3588
- className: header.type === 'week' ? 'sg-week-header' : 'sg-day-header'
3589
- }, {
3590
- children: header.displayText
3591
- }), `week_${ix}`))
3592
- })
3593
- }), jsxRuntime.jsx("tbody", {
3594
- children: data.calendar.calendarGrid.map((week, ix) => jsxRuntime.jsxs("tr", {
3595
- children: [data.calendar.weekNumbers ? jsxRuntime.jsx("th", Object.assign({
3596
- className: "sg-week-number"
3597
- }, {
3598
- children: data.calendar.weekNumbers[ix]
3599
- })) : '', week.map(day => jsxRuntime.jsx("td", Object.assign({
3600
- "data-date": day.formattedDate,
3601
- className: classNames(day),
3602
- title: day.today ? 'Today' : '',
3603
- tabIndex: day.highlighted || day.selected && !(data === null || data === void 0 ? void 0 : data.highlightedDate) || day.today && !(data === null || data === void 0 ? void 0 : data.highlightedDate) && !(data === null || data === void 0 ? void 0 : data.selectedDate) ? 0 : -1,
3604
- role: day.selected ? 'gridcell' : undefined,
3605
- "aria-selected": day.selected && !(data === null || data === void 0 ? void 0 : data.highlightedDate) ? true : undefined,
3606
- onClick: () => {
3607
- day.currentMonth && datepicker.select(day.date);
3608
- }
3609
- }, {
3610
- children: day.day
3611
- }), day.day))]
3612
- }, `week_${ix}`))
3613
- })]
3614
- }))
3615
- })]
3616
- }))
3617
- }))]
3618
- });
3619
- };
3620
-
3621
- exports.Alert = AlertRibbon;
3622
- exports.AlertRibbon = AlertRibbon;
3623
- exports.Badge = Badge;
3624
- exports.Button = Button;
3625
- exports.ButtonGroup = ButtonGroup;
3626
- exports.Card = Card;
3627
- exports.Checkbox = Checkbox;
3628
- exports.Datepicker = Datepicker;
3629
- exports.Dropdown = Dropdown;
3630
- exports.EmailInput = EmailInput;
3631
- exports.Flexbox = Flexbox;
3632
- exports.Form = Form;
3633
- exports.FormItem = FormItem;
3634
- exports.FormItems = FormItems;
3635
- exports.Group = Group;
3636
- exports.Link = Link;
3637
- exports.List = List$1;
3638
- exports.Modal = Modal;
3639
- exports.Navbar = Navbar;
3640
- exports.NumberInput = NumberInput;
3641
- exports.Option = Option;
3642
- exports.OptionGroup = OptionGroup;
3643
- exports.RadioButton = RadioButton;
3644
- exports.RadioGroup = RadioGroup;
3645
- exports.RenderInput = RenderInput;
3646
- exports.Select = Select;
3647
- exports.Stepper = Stepper;
3648
- exports.Text = Text;
3649
- exports.TextInput = TextInput;
3650
- exports.ValueList = valueList$1;
3651
-
3652
- Object.defineProperty(exports, '__esModule', { value: true });
3653
-
3654
- }));