@oc-digital/react-component-library 1.0.1 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -1,2714 +1,16 @@
1
- import React from 'react';
2
- import { makeStyles, Button } from '@material-ui/core';
3
-
4
- /*! *****************************************************************************
5
- Copyright (c) Microsoft Corporation.
6
-
7
- Permission to use, copy, modify, and/or distribute this software for any
8
- purpose with or without fee is hereby granted.
9
-
10
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
- PERFORMANCE OF THIS SOFTWARE.
17
- ***************************************************************************** */
18
-
19
- var __assign = function() {
20
- __assign = Object.assign || function __assign(t) {
21
- for (var s, i = 1, n = arguments.length; i < n; i++) {
22
- s = arguments[i];
23
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
24
- }
25
- return t;
26
- };
27
- return __assign.apply(this, arguments);
28
- };
29
-
30
- function __rest(s, e) {
31
- var t = {};
32
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
33
- t[p] = s[p];
34
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
35
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
36
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
37
- t[p[i]] = s[p[i]];
38
- }
39
- return t;
40
- }
41
-
42
- /*!
43
- * Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
44
- * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
45
- */
46
-
47
- function _classCallCheck(instance, Constructor) {
48
- if (!(instance instanceof Constructor)) {
49
- throw new TypeError("Cannot call a class as a function");
50
- }
51
- }
52
-
53
- function _defineProperties(target, props) {
54
- for (var i = 0; i < props.length; i++) {
55
- var descriptor = props[i];
56
- descriptor.enumerable = descriptor.enumerable || false;
57
- descriptor.configurable = true;
58
- if ("value" in descriptor) descriptor.writable = true;
59
- Object.defineProperty(target, descriptor.key, descriptor);
60
- }
61
- }
62
-
63
- function _createClass(Constructor, protoProps, staticProps) {
64
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
65
- if (staticProps) _defineProperties(Constructor, staticProps);
66
- return Constructor;
67
- }
68
-
69
- function _defineProperty$1(obj, key, value) {
70
- if (key in obj) {
71
- Object.defineProperty(obj, key, {
72
- value: value,
73
- enumerable: true,
74
- configurable: true,
75
- writable: true
76
- });
77
- } else {
78
- obj[key] = value;
79
- }
80
-
81
- return obj;
82
- }
83
-
84
- function _objectSpread(target) {
85
- for (var i = 1; i < arguments.length; i++) {
86
- var source = arguments[i] != null ? arguments[i] : {};
87
- var ownKeys = Object.keys(source);
88
-
89
- if (typeof Object.getOwnPropertySymbols === 'function') {
90
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
91
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
92
- }));
93
- }
94
-
95
- ownKeys.forEach(function (key) {
96
- _defineProperty$1(target, key, source[key]);
97
- });
98
- }
99
-
100
- return target;
101
- }
102
-
103
- function _slicedToArray(arr, i) {
104
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
105
- }
106
-
107
- function _arrayWithHoles(arr) {
108
- if (Array.isArray(arr)) return arr;
109
- }
110
-
111
- function _iterableToArrayLimit(arr, i) {
112
- var _arr = [];
113
- var _n = true;
114
- var _d = false;
115
- var _e = undefined;
116
-
117
- try {
118
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
119
- _arr.push(_s.value);
120
-
121
- if (i && _arr.length === i) break;
122
- }
123
- } catch (err) {
124
- _d = true;
125
- _e = err;
126
- } finally {
127
- try {
128
- if (!_n && _i["return"] != null) _i["return"]();
129
- } finally {
130
- if (_d) throw _e;
131
- }
132
- }
133
-
134
- return _arr;
135
- }
136
-
137
- function _nonIterableRest() {
138
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
139
- }
140
-
141
- var noop = function noop() {};
142
-
143
- var _WINDOW = {};
144
- var _DOCUMENT = {};
145
- var _MUTATION_OBSERVER = null;
146
- var _PERFORMANCE = {
147
- mark: noop,
148
- measure: noop
149
- };
150
-
151
- try {
152
- if (typeof window !== 'undefined') _WINDOW = window;
153
- if (typeof document !== 'undefined') _DOCUMENT = document;
154
- if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;
155
- if (typeof performance !== 'undefined') _PERFORMANCE = performance;
156
- } catch (e) {}
157
-
158
- var _ref = _WINDOW.navigator || {},
159
- _ref$userAgent = _ref.userAgent,
160
- userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;
161
-
162
- var WINDOW = _WINDOW;
163
- var DOCUMENT = _DOCUMENT;
164
- var PERFORMANCE = _PERFORMANCE;
165
- !!WINDOW.document;
166
- var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
167
- ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
168
-
169
- var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
170
- var DEFAULT_FAMILY_PREFIX = 'fa';
171
- var DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
172
- var DATA_FA_I2SVG = 'data-fa-i2svg';
173
- (function () {
174
- try {
175
- return process.env.NODE_ENV === 'production';
176
- } catch (e) {
177
- return false;
178
- }
179
- })();
180
- var DUOTONE_CLASSES = {
181
- GROUP: 'group',
182
- SWAP_OPACITY: 'swap-opacity',
183
- PRIMARY: 'primary',
184
- SECONDARY: 'secondary'
185
- };
186
-
187
- var initial = WINDOW.FontAwesomeConfig || {};
188
-
189
- function getAttrConfig(attr) {
190
- var element = DOCUMENT.querySelector('script[' + attr + ']');
191
-
192
- if (element) {
193
- return element.getAttribute(attr);
194
- }
195
- }
196
-
197
- function coerce(val) {
198
- // Getting an empty string will occur if the attribute is set on the HTML tag but without a value
199
- // We'll assume that this is an indication that it should be toggled to true
200
- // For example <script data-search-pseudo-elements src="..."></script>
201
- if (val === '') return true;
202
- if (val === 'false') return false;
203
- if (val === 'true') return true;
204
- return val;
205
- }
206
-
207
- if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {
208
- var attrs = [['data-family-prefix', 'familyPrefix'], ['data-replacement-class', 'replacementClass'], ['data-auto-replace-svg', 'autoReplaceSvg'], ['data-auto-add-css', 'autoAddCss'], ['data-auto-a11y', 'autoA11y'], ['data-search-pseudo-elements', 'searchPseudoElements'], ['data-observe-mutations', 'observeMutations'], ['data-mutate-approach', 'mutateApproach'], ['data-keep-original-source', 'keepOriginalSource'], ['data-measure-performance', 'measurePerformance'], ['data-show-missing-icons', 'showMissingIcons']];
209
- attrs.forEach(function (_ref) {
210
- var _ref2 = _slicedToArray(_ref, 2),
211
- attr = _ref2[0],
212
- key = _ref2[1];
213
-
214
- var val = coerce(getAttrConfig(attr));
215
-
216
- if (val !== undefined && val !== null) {
217
- initial[key] = val;
218
- }
219
- });
220
- }
221
-
222
- var _default = {
223
- familyPrefix: DEFAULT_FAMILY_PREFIX,
224
- replacementClass: DEFAULT_REPLACEMENT_CLASS,
225
- autoReplaceSvg: true,
226
- autoAddCss: true,
227
- autoA11y: true,
228
- searchPseudoElements: false,
229
- observeMutations: true,
230
- mutateApproach: 'async',
231
- keepOriginalSource: true,
232
- measurePerformance: false,
233
- showMissingIcons: true
234
- };
235
-
236
- var _config = _objectSpread({}, _default, initial);
237
-
238
- if (!_config.autoReplaceSvg) _config.observeMutations = false;
239
-
240
- var config = _objectSpread({}, _config);
241
-
242
- WINDOW.FontAwesomeConfig = config;
243
-
244
- var w$1 = WINDOW || {};
245
- if (!w$1[NAMESPACE_IDENTIFIER]) w$1[NAMESPACE_IDENTIFIER] = {};
246
- if (!w$1[NAMESPACE_IDENTIFIER].styles) w$1[NAMESPACE_IDENTIFIER].styles = {};
247
- if (!w$1[NAMESPACE_IDENTIFIER].hooks) w$1[NAMESPACE_IDENTIFIER].hooks = {};
248
- if (!w$1[NAMESPACE_IDENTIFIER].shims) w$1[NAMESPACE_IDENTIFIER].shims = [];
249
- var namespace = w$1[NAMESPACE_IDENTIFIER];
250
-
251
- var functions = [];
252
-
253
- var listener = function listener() {
254
- DOCUMENT.removeEventListener('DOMContentLoaded', listener);
255
- loaded = 1;
256
- functions.map(function (fn) {
257
- return fn();
258
- });
259
- };
260
-
261
- var loaded = false;
262
-
263
- if (IS_DOM) {
264
- loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
265
- if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
266
- }
267
-
268
- typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';
269
- typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
270
- var meaninglessTransform = {
271
- size: 16,
272
- x: 0,
273
- y: 0,
274
- rotate: 0,
275
- flipX: false,
276
- flipY: false
277
- };
278
- function insertCss(css) {
279
- if (!css || !IS_DOM) {
280
- return;
281
- }
282
-
283
- var style = DOCUMENT.createElement('style');
284
- style.setAttribute('type', 'text/css');
285
- style.innerHTML = css;
286
- var headChildren = DOCUMENT.head.childNodes;
287
- var beforeChild = null;
288
-
289
- for (var i = headChildren.length - 1; i > -1; i--) {
290
- var child = headChildren[i];
291
- var tagName = (child.tagName || '').toUpperCase();
292
-
293
- if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
294
- beforeChild = child;
295
- }
296
- }
297
-
298
- DOCUMENT.head.insertBefore(style, beforeChild);
299
- return css;
300
- }
301
- var idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
302
- function nextUniqueId() {
303
- var size = 12;
304
- var id = '';
305
-
306
- while (size-- > 0) {
307
- id += idPool[Math.random() * 62 | 0];
308
- }
309
-
310
- return id;
311
- }
312
- function htmlEscape(str) {
313
- return "".concat(str).replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
314
- }
315
- function joinAttributes(attributes) {
316
- return Object.keys(attributes || {}).reduce(function (acc, attributeName) {
317
- return acc + "".concat(attributeName, "=\"").concat(htmlEscape(attributes[attributeName]), "\" ");
318
- }, '').trim();
319
- }
320
- function joinStyles(styles) {
321
- return Object.keys(styles || {}).reduce(function (acc, styleName) {
322
- return acc + "".concat(styleName, ": ").concat(styles[styleName], ";");
323
- }, '');
324
- }
325
- function transformIsMeaningful(transform) {
326
- return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
327
- }
328
- function transformForSvg(_ref) {
329
- var transform = _ref.transform,
330
- containerWidth = _ref.containerWidth,
331
- iconWidth = _ref.iconWidth;
332
- var outer = {
333
- transform: "translate(".concat(containerWidth / 2, " 256)")
334
- };
335
- var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
336
- var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
337
- var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
338
- var inner = {
339
- transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
340
- };
341
- var path = {
342
- transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
343
- };
344
- return {
345
- outer: outer,
346
- inner: inner,
347
- path: path
348
- };
349
- }
350
-
351
- var ALL_SPACE = {
352
- x: 0,
353
- y: 0,
354
- width: '100%',
355
- height: '100%'
356
- };
357
-
358
- function fillBlack(abstract) {
359
- var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
360
-
361
- if (abstract.attributes && (abstract.attributes.fill || force)) {
362
- abstract.attributes.fill = 'black';
363
- }
364
-
365
- return abstract;
366
- }
367
-
368
- function deGroup(abstract) {
369
- if (abstract.tag === 'g') {
370
- return abstract.children;
371
- } else {
372
- return [abstract];
373
- }
374
- }
375
-
376
- function makeIconMasking (_ref) {
377
- var children = _ref.children,
378
- attributes = _ref.attributes,
379
- main = _ref.main,
380
- mask = _ref.mask,
381
- explicitMaskId = _ref.maskId,
382
- transform = _ref.transform;
383
- var mainWidth = main.width,
384
- mainPath = main.icon;
385
- var maskWidth = mask.width,
386
- maskPath = mask.icon;
387
- var trans = transformForSvg({
388
- transform: transform,
389
- containerWidth: maskWidth,
390
- iconWidth: mainWidth
391
- });
392
- var maskRect = {
393
- tag: 'rect',
394
- attributes: _objectSpread({}, ALL_SPACE, {
395
- fill: 'white'
396
- })
397
- };
398
- var maskInnerGroupChildrenMixin = mainPath.children ? {
399
- children: mainPath.children.map(fillBlack)
400
- } : {};
401
- var maskInnerGroup = {
402
- tag: 'g',
403
- attributes: _objectSpread({}, trans.inner),
404
- children: [fillBlack(_objectSpread({
405
- tag: mainPath.tag,
406
- attributes: _objectSpread({}, mainPath.attributes, trans.path)
407
- }, maskInnerGroupChildrenMixin))]
408
- };
409
- var maskOuterGroup = {
410
- tag: 'g',
411
- attributes: _objectSpread({}, trans.outer),
412
- children: [maskInnerGroup]
413
- };
414
- var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
415
- var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
416
- var maskTag = {
417
- tag: 'mask',
418
- attributes: _objectSpread({}, ALL_SPACE, {
419
- id: maskId,
420
- maskUnits: 'userSpaceOnUse',
421
- maskContentUnits: 'userSpaceOnUse'
422
- }),
423
- children: [maskRect, maskOuterGroup]
424
- };
425
- var defs = {
426
- tag: 'defs',
427
- children: [{
428
- tag: 'clipPath',
429
- attributes: {
430
- id: clipId
431
- },
432
- children: deGroup(maskPath)
433
- }, maskTag]
434
- };
435
- children.push(defs, {
436
- tag: 'rect',
437
- attributes: _objectSpread({
438
- fill: 'currentColor',
439
- 'clip-path': "url(#".concat(clipId, ")"),
440
- mask: "url(#".concat(maskId, ")")
441
- }, ALL_SPACE)
442
- });
443
- return {
444
- children: children,
445
- attributes: attributes
446
- };
447
- }
448
-
449
- function makeIconStandard (_ref) {
450
- var children = _ref.children,
451
- attributes = _ref.attributes,
452
- main = _ref.main,
453
- transform = _ref.transform,
454
- styles = _ref.styles;
455
- var styleString = joinStyles(styles);
456
-
457
- if (styleString.length > 0) {
458
- attributes['style'] = styleString;
459
- }
460
-
461
- if (transformIsMeaningful(transform)) {
462
- var trans = transformForSvg({
463
- transform: transform,
464
- containerWidth: main.width,
465
- iconWidth: main.width
466
- });
467
- children.push({
468
- tag: 'g',
469
- attributes: _objectSpread({}, trans.outer),
470
- children: [{
471
- tag: 'g',
472
- attributes: _objectSpread({}, trans.inner),
473
- children: [{
474
- tag: main.icon.tag,
475
- children: main.icon.children,
476
- attributes: _objectSpread({}, main.icon.attributes, trans.path)
477
- }]
478
- }]
479
- });
480
- } else {
481
- children.push(main.icon);
482
- }
483
-
484
- return {
485
- children: children,
486
- attributes: attributes
487
- };
488
- }
489
-
490
- function asIcon (_ref) {
491
- var children = _ref.children,
492
- main = _ref.main,
493
- mask = _ref.mask,
494
- attributes = _ref.attributes,
495
- styles = _ref.styles,
496
- transform = _ref.transform;
497
-
498
- if (transformIsMeaningful(transform) && main.found && !mask.found) {
499
- var width = main.width,
500
- height = main.height;
501
- var offset = {
502
- x: width / height / 2,
503
- y: 0.5
504
- };
505
- attributes['style'] = joinStyles(_objectSpread({}, styles, {
506
- 'transform-origin': "".concat(offset.x + transform.x / 16, "em ").concat(offset.y + transform.y / 16, "em")
507
- }));
508
- }
509
-
510
- return [{
511
- tag: 'svg',
512
- attributes: attributes,
513
- children: children
514
- }];
515
- }
516
-
517
- function asSymbol (_ref) {
518
- var prefix = _ref.prefix,
519
- iconName = _ref.iconName,
520
- children = _ref.children,
521
- attributes = _ref.attributes,
522
- symbol = _ref.symbol;
523
- var id = symbol === true ? "".concat(prefix, "-").concat(config.familyPrefix, "-").concat(iconName) : symbol;
524
- return [{
525
- tag: 'svg',
526
- attributes: {
527
- style: 'display: none;'
528
- },
529
- children: [{
530
- tag: 'symbol',
531
- attributes: _objectSpread({}, attributes, {
532
- id: id
533
- }),
534
- children: children
535
- }]
536
- }];
537
- }
538
-
539
- function makeInlineSvgAbstract(params) {
540
- var _params$icons = params.icons,
541
- main = _params$icons.main,
542
- mask = _params$icons.mask,
543
- prefix = params.prefix,
544
- iconName = params.iconName,
545
- transform = params.transform,
546
- symbol = params.symbol,
547
- title = params.title,
548
- maskId = params.maskId,
549
- titleId = params.titleId,
550
- extra = params.extra,
551
- _params$watchable = params.watchable,
552
- watchable = _params$watchable === void 0 ? false : _params$watchable;
553
-
554
- var _ref = mask.found ? mask : main,
555
- width = _ref.width,
556
- height = _ref.height;
557
-
558
- var isUploadedIcon = prefix === 'fak';
559
- var widthClass = isUploadedIcon ? '' : "fa-w-".concat(Math.ceil(width / height * 16));
560
- var attrClass = [config.replacementClass, iconName ? "".concat(config.familyPrefix, "-").concat(iconName) : '', widthClass].filter(function (c) {
561
- return extra.classes.indexOf(c) === -1;
562
- }).filter(function (c) {
563
- return c !== '' || !!c;
564
- }).concat(extra.classes).join(' ');
565
- var content = {
566
- children: [],
567
- attributes: _objectSpread({}, extra.attributes, {
568
- 'data-prefix': prefix,
569
- 'data-icon': iconName,
570
- 'class': attrClass,
571
- 'role': extra.attributes.role || 'img',
572
- 'xmlns': 'http://www.w3.org/2000/svg',
573
- 'viewBox': "0 0 ".concat(width, " ").concat(height)
574
- })
575
- };
576
- var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {
577
- width: "".concat(width / height * 16 * 0.0625, "em")
578
- } : {};
579
-
580
- if (watchable) {
581
- content.attributes[DATA_FA_I2SVG] = '';
582
- }
583
-
584
- if (title) content.children.push({
585
- tag: 'title',
586
- attributes: {
587
- id: content.attributes['aria-labelledby'] || "title-".concat(titleId || nextUniqueId())
588
- },
589
- children: [title]
590
- });
591
-
592
- var args = _objectSpread({}, content, {
593
- prefix: prefix,
594
- iconName: iconName,
595
- main: main,
596
- mask: mask,
597
- maskId: maskId,
598
- transform: transform,
599
- symbol: symbol,
600
- styles: _objectSpread({}, uploadedIconWidthStyle, extra.styles)
601
- });
602
-
603
- var _ref2 = mask.found && main.found ? makeIconMasking(args) : makeIconStandard(args),
604
- children = _ref2.children,
605
- attributes = _ref2.attributes;
606
-
607
- args.children = children;
608
- args.attributes = attributes;
609
-
610
- if (symbol) {
611
- return asSymbol(args);
612
- } else {
613
- return asIcon(args);
614
- }
615
- }
616
-
617
- var noop$1 = function noop() {};
618
-
619
- config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
620
- mark: noop$1,
621
- measure: noop$1
622
- };
623
-
624
- /**
625
- * Internal helper to bind a function known to have 4 arguments
626
- * to a given context.
627
- */
628
-
629
- var bindInternal4 = function bindInternal4(func, thisContext) {
630
- return function (a, b, c, d) {
631
- return func.call(thisContext, a, b, c, d);
632
- };
633
- };
634
-
635
- /**
636
- * # Reduce
637
- *
638
- * A fast object `.reduce()` implementation.
639
- *
640
- * @param {Object} subject The object to reduce over.
641
- * @param {Function} fn The reducer function.
642
- * @param {mixed} initialValue The initial value for the reducer, defaults to subject[0].
643
- * @param {Object} thisContext The context for the reducer.
644
- * @return {mixed} The final result.
645
- */
646
-
647
-
648
- var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
649
- var keys = Object.keys(subject),
650
- length = keys.length,
651
- iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
652
- i,
653
- key,
654
- result;
655
-
656
- if (initialValue === undefined) {
657
- i = 1;
658
- result = subject[keys[0]];
659
- } else {
660
- i = 0;
661
- result = initialValue;
662
- }
663
-
664
- for (; i < length; i++) {
665
- key = keys[i];
666
- result = iterator(result, subject[key], key, subject);
667
- }
668
-
669
- return result;
670
- };
671
-
672
- function defineIcons(prefix, icons) {
673
- var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
674
- var _params$skipHooks = params.skipHooks,
675
- skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;
676
- var normalized = Object.keys(icons).reduce(function (acc, iconName) {
677
- var icon = icons[iconName];
678
- var expanded = !!icon.icon;
679
-
680
- if (expanded) {
681
- acc[icon.iconName] = icon.icon;
682
- } else {
683
- acc[iconName] = icon;
684
- }
685
-
686
- return acc;
687
- }, {});
688
-
689
- if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {
690
- namespace.hooks.addPack(prefix, normalized);
691
- } else {
692
- namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, normalized);
693
- }
694
- /**
695
- * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction
696
- * of new styles we needed to differentiate between them. Prefix `fa` is now an alias
697
- * for `fas` so we'll easy the upgrade process for our users by automatically defining
698
- * this as well.
699
- */
700
-
701
-
702
- if (prefix === 'fas') {
703
- defineIcons('fa', icons);
704
- }
705
- }
706
-
707
- var styles = namespace.styles,
708
- shims = namespace.shims;
709
- var build = function build() {
710
- var lookup = function lookup(reducer) {
711
- return reduce(styles, function (o, style, prefix) {
712
- o[prefix] = reduce(style, reducer, {});
713
- return o;
714
- }, {});
715
- };
716
-
717
- lookup(function (acc, icon, iconName) {
718
- if (icon[3]) {
719
- acc[icon[3]] = iconName;
720
- }
721
-
722
- return acc;
723
- });
724
- lookup(function (acc, icon, iconName) {
725
- var ligatures = icon[2];
726
- acc[iconName] = iconName;
727
- ligatures.forEach(function (ligature) {
728
- acc[ligature] = iconName;
729
- });
730
- return acc;
731
- });
732
- var hasRegular = 'far' in styles;
733
- reduce(shims, function (acc, shim) {
734
- var oldName = shim[0];
735
- var prefix = shim[1];
736
- var iconName = shim[2];
737
-
738
- if (prefix === 'far' && !hasRegular) {
739
- prefix = 'fas';
740
- }
741
-
742
- acc[oldName] = {
743
- prefix: prefix,
744
- iconName: iconName
745
- };
746
- return acc;
747
- }, {});
748
- };
749
- build();
750
-
751
- namespace.styles;
752
- function iconFromMapping(mapping, prefix, iconName) {
753
- if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
754
- return {
755
- prefix: prefix,
756
- iconName: iconName,
757
- icon: mapping[prefix][iconName]
758
- };
759
- }
760
- }
761
-
762
- function toHtml(abstractNodes) {
763
- var tag = abstractNodes.tag,
764
- _abstractNodes$attrib = abstractNodes.attributes,
765
- attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,
766
- _abstractNodes$childr = abstractNodes.children,
767
- children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;
768
-
769
- if (typeof abstractNodes === 'string') {
770
- return htmlEscape(abstractNodes);
771
- } else {
772
- return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(''), "</").concat(tag, ">");
773
- }
774
- }
775
-
776
- var parseTransformString = function parseTransformString(transformString) {
777
- var transform = {
778
- size: 16,
779
- x: 0,
780
- y: 0,
781
- flipX: false,
782
- flipY: false,
783
- rotate: 0
784
- };
785
-
786
- if (!transformString) {
787
- return transform;
788
- } else {
789
- return transformString.toLowerCase().split(' ').reduce(function (acc, n) {
790
- var parts = n.toLowerCase().split('-');
791
- var first = parts[0];
792
- var rest = parts.slice(1).join('-');
793
-
794
- if (first && rest === 'h') {
795
- acc.flipX = true;
796
- return acc;
797
- }
798
-
799
- if (first && rest === 'v') {
800
- acc.flipY = true;
801
- return acc;
802
- }
803
-
804
- rest = parseFloat(rest);
805
-
806
- if (isNaN(rest)) {
807
- return acc;
808
- }
809
-
810
- switch (first) {
811
- case 'grow':
812
- acc.size = acc.size + rest;
813
- break;
814
-
815
- case 'shrink':
816
- acc.size = acc.size - rest;
817
- break;
818
-
819
- case 'left':
820
- acc.x = acc.x - rest;
821
- break;
822
-
823
- case 'right':
824
- acc.x = acc.x + rest;
825
- break;
826
-
827
- case 'up':
828
- acc.y = acc.y - rest;
829
- break;
830
-
831
- case 'down':
832
- acc.y = acc.y + rest;
833
- break;
834
-
835
- case 'rotate':
836
- acc.rotate = acc.rotate + rest;
837
- break;
838
- }
839
-
840
- return acc;
841
- }, transform);
842
- }
843
- };
844
-
845
- function MissingIcon(error) {
846
- this.name = 'MissingIcon';
847
- this.message = error || 'Icon unavailable';
848
- this.stack = new Error().stack;
849
- }
850
- MissingIcon.prototype = Object.create(Error.prototype);
851
- MissingIcon.prototype.constructor = MissingIcon;
852
-
853
- var FILL = {
854
- fill: 'currentColor'
855
- };
856
- var ANIMATION_BASE = {
857
- attributeType: 'XML',
858
- repeatCount: 'indefinite',
859
- dur: '2s'
860
- };
861
- ({
862
- tag: 'path',
863
- attributes: _objectSpread({}, FILL, {
864
- d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'
865
- })
866
- });
867
-
868
- var OPACITY_ANIMATE = _objectSpread({}, ANIMATION_BASE, {
869
- attributeName: 'opacity'
870
- });
871
-
872
- ({
873
- tag: 'circle',
874
- attributes: _objectSpread({}, FILL, {
875
- cx: '256',
876
- cy: '364',
877
- r: '28'
878
- }),
879
- children: [{
880
- tag: 'animate',
881
- attributes: _objectSpread({}, ANIMATION_BASE, {
882
- attributeName: 'r',
883
- values: '28;14;28;28;14;28;'
884
- })
885
- }, {
886
- tag: 'animate',
887
- attributes: _objectSpread({}, OPACITY_ANIMATE, {
888
- values: '1;0;1;1;0;1;'
889
- })
890
- }]
891
- });
892
- ({
893
- tag: 'path',
894
- attributes: _objectSpread({}, FILL, {
895
- opacity: '1',
896
- d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'
897
- }),
898
- children: [{
899
- tag: 'animate',
900
- attributes: _objectSpread({}, OPACITY_ANIMATE, {
901
- values: '1;0;0;0;0;1;'
902
- })
903
- }]
904
- });
905
- ({
906
- tag: 'path',
907
- attributes: _objectSpread({}, FILL, {
908
- opacity: '0',
909
- d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'
910
- }),
911
- children: [{
912
- tag: 'animate',
913
- attributes: _objectSpread({}, OPACITY_ANIMATE, {
914
- values: '0;0;1;1;0;0;'
915
- })
916
- }]
917
- });
918
-
919
- namespace.styles;
920
- function asFoundIcon(icon) {
921
- var width = icon[0];
922
- var height = icon[1];
923
-
924
- var _icon$slice = icon.slice(4),
925
- _icon$slice2 = _slicedToArray(_icon$slice, 1),
926
- vectorData = _icon$slice2[0];
927
-
928
- var element = null;
929
-
930
- if (Array.isArray(vectorData)) {
931
- element = {
932
- tag: 'g',
933
- attributes: {
934
- class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.GROUP)
935
- },
936
- children: [{
937
- tag: 'path',
938
- attributes: {
939
- class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.SECONDARY),
940
- fill: 'currentColor',
941
- d: vectorData[0]
942
- }
943
- }, {
944
- tag: 'path',
945
- attributes: {
946
- class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.PRIMARY),
947
- fill: 'currentColor',
948
- d: vectorData[1]
949
- }
950
- }]
951
- };
952
- } else {
953
- element = {
954
- tag: 'path',
955
- attributes: {
956
- fill: 'currentColor',
957
- d: vectorData
958
- }
959
- };
960
- }
961
-
962
- return {
963
- found: true,
964
- width: width,
965
- height: height,
966
- icon: element
967
- };
968
- }
969
-
970
- namespace.styles;
971
-
972
- var baseStyles = "svg:not(:root).svg-inline--fa {\n overflow: visible;\n}\n\n.svg-inline--fa {\n display: inline-block;\n font-size: inherit;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-border {\n height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n width: 2em;\n}\n.svg-inline--fa.fa-fw {\n width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: #ff253a;\n border-radius: 1em;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: #fff;\n height: 1.5em;\n line-height: 1;\n max-width: 5em;\n min-width: 1.5em;\n overflow: hidden;\n padding: 0.25em;\n right: 0;\n text-overflow: ellipsis;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: 0;\n right: 0;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: 0;\n left: 0;\n right: auto;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n right: 0;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: 0;\n right: auto;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-lg {\n font-size: 1.3333333333em;\n line-height: 0.75em;\n vertical-align: -0.0667em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: 2.5em;\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit;\n}\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: 0.1em;\n padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n float: left;\n}\n\n.fa-pull-right {\n float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n margin-left: 0.3em;\n}\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)\";\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)\";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)\";\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)\";\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)\";\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)\";\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n -webkit-filter: none;\n filter: none;\n}\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: #fff;\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n clip: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n position: static;\n width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse {\n color: #fff;\n}";
973
-
974
- function css () {
975
- var dfp = DEFAULT_FAMILY_PREFIX;
976
- var drc = DEFAULT_REPLACEMENT_CLASS;
977
- var fp = config.familyPrefix;
978
- var rc = config.replacementClass;
979
- var s = baseStyles;
980
-
981
- if (fp !== dfp || rc !== drc) {
982
- var dPatt = new RegExp("\\.".concat(dfp, "\\-"), 'g');
983
- var customPropPatt = new RegExp("\\--".concat(dfp, "\\-"), 'g');
984
- var rPatt = new RegExp("\\.".concat(drc), 'g');
985
- s = s.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));
986
- }
987
-
988
- return s;
989
- }
990
-
991
- var Library =
992
- /*#__PURE__*/
993
- function () {
994
- function Library() {
995
- _classCallCheck(this, Library);
996
-
997
- this.definitions = {};
998
- }
999
-
1000
- _createClass(Library, [{
1001
- key: "add",
1002
- value: function add() {
1003
- var _this = this;
1004
-
1005
- for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {
1006
- definitions[_key] = arguments[_key];
1007
- }
1008
-
1009
- var additions = definitions.reduce(this._pullDefinitions, {});
1010
- Object.keys(additions).forEach(function (key) {
1011
- _this.definitions[key] = _objectSpread({}, _this.definitions[key] || {}, additions[key]);
1012
- defineIcons(key, additions[key]);
1013
- build();
1014
- });
1015
- }
1016
- }, {
1017
- key: "reset",
1018
- value: function reset() {
1019
- this.definitions = {};
1020
- }
1021
- }, {
1022
- key: "_pullDefinitions",
1023
- value: function _pullDefinitions(additions, definition) {
1024
- var normalized = definition.prefix && definition.iconName && definition.icon ? {
1025
- 0: definition
1026
- } : definition;
1027
- Object.keys(normalized).map(function (key) {
1028
- var _normalized$key = normalized[key],
1029
- prefix = _normalized$key.prefix,
1030
- iconName = _normalized$key.iconName,
1031
- icon = _normalized$key.icon;
1032
- if (!additions[prefix]) additions[prefix] = {};
1033
- additions[prefix][iconName] = icon;
1034
- });
1035
- return additions;
1036
- }
1037
- }]);
1038
-
1039
- return Library;
1040
- }();
1041
-
1042
- function ensureCss() {
1043
- if (config.autoAddCss && !_cssInserted) {
1044
- insertCss(css());
1045
-
1046
- _cssInserted = true;
1047
- }
1048
- }
1049
-
1050
- function apiObject(val, abstractCreator) {
1051
- Object.defineProperty(val, 'abstract', {
1052
- get: abstractCreator
1053
- });
1054
- Object.defineProperty(val, 'html', {
1055
- get: function get() {
1056
- return val.abstract.map(function (a) {
1057
- return toHtml(a);
1058
- });
1059
- }
1060
- });
1061
- Object.defineProperty(val, 'node', {
1062
- get: function get() {
1063
- if (!IS_DOM) return;
1064
- var container = DOCUMENT.createElement('div');
1065
- container.innerHTML = val.html;
1066
- return container.children;
1067
- }
1068
- });
1069
- return val;
1070
- }
1071
-
1072
- function findIconDefinition(iconLookup) {
1073
- var _iconLookup$prefix = iconLookup.prefix,
1074
- prefix = _iconLookup$prefix === void 0 ? 'fa' : _iconLookup$prefix,
1075
- iconName = iconLookup.iconName;
1076
- if (!iconName) return;
1077
- return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);
1078
- }
1079
-
1080
- function resolveIcons(next) {
1081
- return function (maybeIconDefinition) {
1082
- var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1083
- var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});
1084
- var mask = params.mask;
1085
-
1086
- if (mask) {
1087
- mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
1088
- }
1089
-
1090
- return next(iconDefinition, _objectSpread({}, params, {
1091
- mask: mask
1092
- }));
1093
- };
1094
- }
1095
-
1096
- var library = new Library();
1097
- var _cssInserted = false;
1098
- var parse = {
1099
- transform: function transform(transformString) {
1100
- return parseTransformString(transformString);
1101
- }
1102
- };
1103
- var icon = resolveIcons(function (iconDefinition) {
1104
- var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1105
- var _params$transform = params.transform,
1106
- transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
1107
- _params$symbol = params.symbol,
1108
- symbol = _params$symbol === void 0 ? false : _params$symbol,
1109
- _params$mask = params.mask,
1110
- mask = _params$mask === void 0 ? null : _params$mask,
1111
- _params$maskId = params.maskId,
1112
- maskId = _params$maskId === void 0 ? null : _params$maskId,
1113
- _params$title = params.title,
1114
- title = _params$title === void 0 ? null : _params$title,
1115
- _params$titleId = params.titleId,
1116
- titleId = _params$titleId === void 0 ? null : _params$titleId,
1117
- _params$classes = params.classes,
1118
- classes = _params$classes === void 0 ? [] : _params$classes,
1119
- _params$attributes = params.attributes,
1120
- attributes = _params$attributes === void 0 ? {} : _params$attributes,
1121
- _params$styles = params.styles,
1122
- styles = _params$styles === void 0 ? {} : _params$styles;
1123
- if (!iconDefinition) return;
1124
- var prefix = iconDefinition.prefix,
1125
- iconName = iconDefinition.iconName,
1126
- icon = iconDefinition.icon;
1127
- return apiObject(_objectSpread({
1128
- type: 'icon'
1129
- }, iconDefinition), function () {
1130
- ensureCss();
1131
-
1132
- if (config.autoA11y) {
1133
- if (title) {
1134
- attributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
1135
- } else {
1136
- attributes['aria-hidden'] = 'true';
1137
- attributes['focusable'] = 'false';
1138
- }
1139
- }
1140
-
1141
- return makeInlineSvgAbstract({
1142
- icons: {
1143
- main: asFoundIcon(icon),
1144
- mask: mask ? asFoundIcon(mask.icon) : {
1145
- found: false,
1146
- width: null,
1147
- height: null,
1148
- icon: {}
1149
- }
1150
- },
1151
- prefix: prefix,
1152
- iconName: iconName,
1153
- transform: _objectSpread({}, meaninglessTransform, transform),
1154
- symbol: symbol,
1155
- title: title,
1156
- maskId: maskId,
1157
- titleId: titleId,
1158
- extra: {
1159
- attributes: attributes,
1160
- styles: styles,
1161
- classes: classes
1162
- }
1163
- });
1164
- });
1165
- });
1166
-
1167
- var propTypes = {exports: {}};
1168
-
1169
- var reactIs = {exports: {}};
1170
-
1171
- var reactIs_production_min = {};
1172
-
1173
- /** @license React v16.13.1
1174
- * react-is.production.min.js
1175
- *
1176
- * Copyright (c) Facebook, Inc. and its affiliates.
1177
- *
1178
- * This source code is licensed under the MIT license found in the
1179
- * LICENSE file in the root directory of this source tree.
1180
- */
1181
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
1182
- Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
1183
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
1184
- reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
1185
- reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
1186
- reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
1187
-
1188
- var reactIs_development = {};
1189
-
1190
- /** @license React v16.13.1
1191
- * react-is.development.js
1192
- *
1193
- * Copyright (c) Facebook, Inc. and its affiliates.
1194
- *
1195
- * This source code is licensed under the MIT license found in the
1196
- * LICENSE file in the root directory of this source tree.
1197
- */
1198
-
1199
-
1200
-
1201
- if (process.env.NODE_ENV !== "production") {
1202
- (function() {
1203
-
1204
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
1205
- // nor polyfill, then a plain number is used for performance.
1206
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
1207
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
1208
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
1209
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
1210
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
1211
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
1212
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
1213
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
1214
- // (unstable) APIs that have been removed. Can we remove the symbols?
1215
-
1216
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
1217
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
1218
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
1219
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
1220
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
1221
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
1222
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
1223
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
1224
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
1225
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
1226
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
1227
-
1228
- function isValidElementType(type) {
1229
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
1230
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
1231
- }
1232
-
1233
- function typeOf(object) {
1234
- if (typeof object === 'object' && object !== null) {
1235
- var $$typeof = object.$$typeof;
1236
-
1237
- switch ($$typeof) {
1238
- case REACT_ELEMENT_TYPE:
1239
- var type = object.type;
1240
-
1241
- switch (type) {
1242
- case REACT_ASYNC_MODE_TYPE:
1243
- case REACT_CONCURRENT_MODE_TYPE:
1244
- case REACT_FRAGMENT_TYPE:
1245
- case REACT_PROFILER_TYPE:
1246
- case REACT_STRICT_MODE_TYPE:
1247
- case REACT_SUSPENSE_TYPE:
1248
- return type;
1249
-
1250
- default:
1251
- var $$typeofType = type && type.$$typeof;
1252
-
1253
- switch ($$typeofType) {
1254
- case REACT_CONTEXT_TYPE:
1255
- case REACT_FORWARD_REF_TYPE:
1256
- case REACT_LAZY_TYPE:
1257
- case REACT_MEMO_TYPE:
1258
- case REACT_PROVIDER_TYPE:
1259
- return $$typeofType;
1260
-
1261
- default:
1262
- return $$typeof;
1263
- }
1264
-
1265
- }
1266
-
1267
- case REACT_PORTAL_TYPE:
1268
- return $$typeof;
1269
- }
1270
- }
1271
-
1272
- return undefined;
1273
- } // AsyncMode is deprecated along with isAsyncMode
1274
-
1275
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
1276
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
1277
- var ContextConsumer = REACT_CONTEXT_TYPE;
1278
- var ContextProvider = REACT_PROVIDER_TYPE;
1279
- var Element = REACT_ELEMENT_TYPE;
1280
- var ForwardRef = REACT_FORWARD_REF_TYPE;
1281
- var Fragment = REACT_FRAGMENT_TYPE;
1282
- var Lazy = REACT_LAZY_TYPE;
1283
- var Memo = REACT_MEMO_TYPE;
1284
- var Portal = REACT_PORTAL_TYPE;
1285
- var Profiler = REACT_PROFILER_TYPE;
1286
- var StrictMode = REACT_STRICT_MODE_TYPE;
1287
- var Suspense = REACT_SUSPENSE_TYPE;
1288
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
1289
-
1290
- function isAsyncMode(object) {
1291
- {
1292
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
1293
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
1294
-
1295
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
1296
- }
1297
- }
1298
-
1299
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
1300
- }
1301
- function isConcurrentMode(object) {
1302
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
1303
- }
1304
- function isContextConsumer(object) {
1305
- return typeOf(object) === REACT_CONTEXT_TYPE;
1306
- }
1307
- function isContextProvider(object) {
1308
- return typeOf(object) === REACT_PROVIDER_TYPE;
1309
- }
1310
- function isElement(object) {
1311
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1312
- }
1313
- function isForwardRef(object) {
1314
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
1315
- }
1316
- function isFragment(object) {
1317
- return typeOf(object) === REACT_FRAGMENT_TYPE;
1318
- }
1319
- function isLazy(object) {
1320
- return typeOf(object) === REACT_LAZY_TYPE;
1321
- }
1322
- function isMemo(object) {
1323
- return typeOf(object) === REACT_MEMO_TYPE;
1324
- }
1325
- function isPortal(object) {
1326
- return typeOf(object) === REACT_PORTAL_TYPE;
1327
- }
1328
- function isProfiler(object) {
1329
- return typeOf(object) === REACT_PROFILER_TYPE;
1330
- }
1331
- function isStrictMode(object) {
1332
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
1333
- }
1334
- function isSuspense(object) {
1335
- return typeOf(object) === REACT_SUSPENSE_TYPE;
1336
- }
1337
-
1338
- reactIs_development.AsyncMode = AsyncMode;
1339
- reactIs_development.ConcurrentMode = ConcurrentMode;
1340
- reactIs_development.ContextConsumer = ContextConsumer;
1341
- reactIs_development.ContextProvider = ContextProvider;
1342
- reactIs_development.Element = Element;
1343
- reactIs_development.ForwardRef = ForwardRef;
1344
- reactIs_development.Fragment = Fragment;
1345
- reactIs_development.Lazy = Lazy;
1346
- reactIs_development.Memo = Memo;
1347
- reactIs_development.Portal = Portal;
1348
- reactIs_development.Profiler = Profiler;
1349
- reactIs_development.StrictMode = StrictMode;
1350
- reactIs_development.Suspense = Suspense;
1351
- reactIs_development.isAsyncMode = isAsyncMode;
1352
- reactIs_development.isConcurrentMode = isConcurrentMode;
1353
- reactIs_development.isContextConsumer = isContextConsumer;
1354
- reactIs_development.isContextProvider = isContextProvider;
1355
- reactIs_development.isElement = isElement;
1356
- reactIs_development.isForwardRef = isForwardRef;
1357
- reactIs_development.isFragment = isFragment;
1358
- reactIs_development.isLazy = isLazy;
1359
- reactIs_development.isMemo = isMemo;
1360
- reactIs_development.isPortal = isPortal;
1361
- reactIs_development.isProfiler = isProfiler;
1362
- reactIs_development.isStrictMode = isStrictMode;
1363
- reactIs_development.isSuspense = isSuspense;
1364
- reactIs_development.isValidElementType = isValidElementType;
1365
- reactIs_development.typeOf = typeOf;
1366
- })();
1367
- }
1368
-
1369
- if (process.env.NODE_ENV === 'production') {
1370
- reactIs.exports = reactIs_production_min;
1371
- } else {
1372
- reactIs.exports = reactIs_development;
1373
- }
1374
-
1375
- /*
1376
- object-assign
1377
- (c) Sindre Sorhus
1378
- @license MIT
1379
- */
1380
- /* eslint-disable no-unused-vars */
1381
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1382
- var hasOwnProperty = Object.prototype.hasOwnProperty;
1383
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
1384
-
1385
- function toObject(val) {
1386
- if (val === null || val === undefined) {
1387
- throw new TypeError('Object.assign cannot be called with null or undefined');
1388
- }
1389
-
1390
- return Object(val);
1391
- }
1392
-
1393
- function shouldUseNative() {
1394
- try {
1395
- if (!Object.assign) {
1396
- return false;
1397
- }
1398
-
1399
- // Detect buggy property enumeration order in older V8 versions.
1400
-
1401
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
1402
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
1403
- test1[5] = 'de';
1404
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
1405
- return false;
1406
- }
1407
-
1408
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1409
- var test2 = {};
1410
- for (var i = 0; i < 10; i++) {
1411
- test2['_' + String.fromCharCode(i)] = i;
1412
- }
1413
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
1414
- return test2[n];
1415
- });
1416
- if (order2.join('') !== '0123456789') {
1417
- return false;
1418
- }
1419
-
1420
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1421
- var test3 = {};
1422
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
1423
- test3[letter] = letter;
1424
- });
1425
- if (Object.keys(Object.assign({}, test3)).join('') !==
1426
- 'abcdefghijklmnopqrst') {
1427
- return false;
1428
- }
1429
-
1430
- return true;
1431
- } catch (err) {
1432
- // We don't expect any of the above to throw, but better to be safe.
1433
- return false;
1434
- }
1435
- }
1436
-
1437
- var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
1438
- var from;
1439
- var to = toObject(target);
1440
- var symbols;
1441
-
1442
- for (var s = 1; s < arguments.length; s++) {
1443
- from = Object(arguments[s]);
1444
-
1445
- for (var key in from) {
1446
- if (hasOwnProperty.call(from, key)) {
1447
- to[key] = from[key];
1448
- }
1449
- }
1450
-
1451
- if (getOwnPropertySymbols) {
1452
- symbols = getOwnPropertySymbols(from);
1453
- for (var i = 0; i < symbols.length; i++) {
1454
- if (propIsEnumerable.call(from, symbols[i])) {
1455
- to[symbols[i]] = from[symbols[i]];
1456
- }
1457
- }
1458
- }
1459
- }
1460
-
1461
- return to;
1462
- };
1463
-
1464
- /**
1465
- * Copyright (c) 2013-present, Facebook, Inc.
1466
- *
1467
- * This source code is licensed under the MIT license found in the
1468
- * LICENSE file in the root directory of this source tree.
1469
- */
1470
-
1471
- var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1472
-
1473
- var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
1474
-
1475
- /**
1476
- * Copyright (c) 2013-present, Facebook, Inc.
1477
- *
1478
- * This source code is licensed under the MIT license found in the
1479
- * LICENSE file in the root directory of this source tree.
1480
- */
1481
-
1482
- var printWarning$1 = function() {};
1483
-
1484
- if (process.env.NODE_ENV !== 'production') {
1485
- var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
1486
- var loggedTypeFailures = {};
1487
- var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
1488
-
1489
- printWarning$1 = function(text) {
1490
- var message = 'Warning: ' + text;
1491
- if (typeof console !== 'undefined') {
1492
- console.error(message);
1493
- }
1494
- try {
1495
- // --- Welcome to debugging React ---
1496
- // This error was thrown as a convenience so that you can use this stack
1497
- // to find the callsite that caused this warning to fire.
1498
- throw new Error(message);
1499
- } catch (x) {}
1500
- };
1501
- }
1502
-
1503
- /**
1504
- * Assert that the values match with the type specs.
1505
- * Error messages are memorized and will only be shown once.
1506
- *
1507
- * @param {object} typeSpecs Map of name to a ReactPropType
1508
- * @param {object} values Runtime values that need to be type-checked
1509
- * @param {string} location e.g. "prop", "context", "child context"
1510
- * @param {string} componentName Name of the component for error messages.
1511
- * @param {?Function} getStack Returns the component stack.
1512
- * @private
1513
- */
1514
- function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
1515
- if (process.env.NODE_ENV !== 'production') {
1516
- for (var typeSpecName in typeSpecs) {
1517
- if (has$1(typeSpecs, typeSpecName)) {
1518
- var error;
1519
- // Prop type validation may throw. In case they do, we don't want to
1520
- // fail the render phase where it didn't fail before. So we log it.
1521
- // After these have been cleaned up, we'll let them throw.
1522
- try {
1523
- // This is intentionally an invariant that gets caught. It's the same
1524
- // behavior as without this statement except with a better message.
1525
- if (typeof typeSpecs[typeSpecName] !== 'function') {
1526
- var err = Error(
1527
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
1528
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
1529
- );
1530
- err.name = 'Invariant Violation';
1531
- throw err;
1532
- }
1533
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
1534
- } catch (ex) {
1535
- error = ex;
1536
- }
1537
- if (error && !(error instanceof Error)) {
1538
- printWarning$1(
1539
- (componentName || 'React class') + ': type specification of ' +
1540
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
1541
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
1542
- 'You may have forgotten to pass an argument to the type checker ' +
1543
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
1544
- 'shape all require an argument).'
1545
- );
1546
- }
1547
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1548
- // Only monitor this failure once because there tends to be a lot of the
1549
- // same error.
1550
- loggedTypeFailures[error.message] = true;
1551
-
1552
- var stack = getStack ? getStack() : '';
1553
-
1554
- printWarning$1(
1555
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
1556
- );
1557
- }
1558
- }
1559
- }
1560
- }
1561
- }
1562
-
1563
- /**
1564
- * Resets warning cache when testing.
1565
- *
1566
- * @private
1567
- */
1568
- checkPropTypes$1.resetWarningCache = function() {
1569
- if (process.env.NODE_ENV !== 'production') {
1570
- loggedTypeFailures = {};
1571
- }
1572
- };
1573
-
1574
- var checkPropTypes_1 = checkPropTypes$1;
1575
-
1576
- /**
1577
- * Copyright (c) 2013-present, Facebook, Inc.
1578
- *
1579
- * This source code is licensed under the MIT license found in the
1580
- * LICENSE file in the root directory of this source tree.
1581
- */
1582
-
1583
- var ReactIs$1 = reactIs.exports;
1584
- var assign = objectAssign;
1585
-
1586
- var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
1587
- var checkPropTypes = checkPropTypes_1;
1588
-
1589
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
1590
- var printWarning = function() {};
1591
-
1592
- if (process.env.NODE_ENV !== 'production') {
1593
- printWarning = function(text) {
1594
- var message = 'Warning: ' + text;
1595
- if (typeof console !== 'undefined') {
1596
- console.error(message);
1597
- }
1598
- try {
1599
- // --- Welcome to debugging React ---
1600
- // This error was thrown as a convenience so that you can use this stack
1601
- // to find the callsite that caused this warning to fire.
1602
- throw new Error(message);
1603
- } catch (x) {}
1604
- };
1605
- }
1606
-
1607
- function emptyFunctionThatReturnsNull() {
1608
- return null;
1609
- }
1610
-
1611
- var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
1612
- /* global Symbol */
1613
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
1614
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
1615
-
1616
- /**
1617
- * Returns the iterator method function contained on the iterable object.
1618
- *
1619
- * Be sure to invoke the function with the iterable as context:
1620
- *
1621
- * var iteratorFn = getIteratorFn(myIterable);
1622
- * if (iteratorFn) {
1623
- * var iterator = iteratorFn.call(myIterable);
1624
- * ...
1625
- * }
1626
- *
1627
- * @param {?object} maybeIterable
1628
- * @return {?function}
1629
- */
1630
- function getIteratorFn(maybeIterable) {
1631
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
1632
- if (typeof iteratorFn === 'function') {
1633
- return iteratorFn;
1634
- }
1635
- }
1636
-
1637
- /**
1638
- * Collection of methods that allow declaration and validation of props that are
1639
- * supplied to React components. Example usage:
1640
- *
1641
- * var Props = require('ReactPropTypes');
1642
- * var MyArticle = React.createClass({
1643
- * propTypes: {
1644
- * // An optional string prop named "description".
1645
- * description: Props.string,
1646
- *
1647
- * // A required enum prop named "category".
1648
- * category: Props.oneOf(['News','Photos']).isRequired,
1649
- *
1650
- * // A prop named "dialog" that requires an instance of Dialog.
1651
- * dialog: Props.instanceOf(Dialog).isRequired
1652
- * },
1653
- * render: function() { ... }
1654
- * });
1655
- *
1656
- * A more formal specification of how these methods are used:
1657
- *
1658
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
1659
- * decl := ReactPropTypes.{type}(.isRequired)?
1660
- *
1661
- * Each and every declaration produces a function with the same signature. This
1662
- * allows the creation of custom validation functions. For example:
1663
- *
1664
- * var MyLink = React.createClass({
1665
- * propTypes: {
1666
- * // An optional string or URI prop named "href".
1667
- * href: function(props, propName, componentName) {
1668
- * var propValue = props[propName];
1669
- * if (propValue != null && typeof propValue !== 'string' &&
1670
- * !(propValue instanceof URI)) {
1671
- * return new Error(
1672
- * 'Expected a string or an URI for ' + propName + ' in ' +
1673
- * componentName
1674
- * );
1675
- * }
1676
- * }
1677
- * },
1678
- * render: function() {...}
1679
- * });
1680
- *
1681
- * @internal
1682
- */
1683
-
1684
- var ANONYMOUS = '<<anonymous>>';
1685
-
1686
- // Important!
1687
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
1688
- var ReactPropTypes = {
1689
- array: createPrimitiveTypeChecker('array'),
1690
- bool: createPrimitiveTypeChecker('boolean'),
1691
- func: createPrimitiveTypeChecker('function'),
1692
- number: createPrimitiveTypeChecker('number'),
1693
- object: createPrimitiveTypeChecker('object'),
1694
- string: createPrimitiveTypeChecker('string'),
1695
- symbol: createPrimitiveTypeChecker('symbol'),
1696
-
1697
- any: createAnyTypeChecker(),
1698
- arrayOf: createArrayOfTypeChecker,
1699
- element: createElementTypeChecker(),
1700
- elementType: createElementTypeTypeChecker(),
1701
- instanceOf: createInstanceTypeChecker,
1702
- node: createNodeChecker(),
1703
- objectOf: createObjectOfTypeChecker,
1704
- oneOf: createEnumTypeChecker,
1705
- oneOfType: createUnionTypeChecker,
1706
- shape: createShapeTypeChecker,
1707
- exact: createStrictShapeTypeChecker,
1708
- };
1709
-
1710
- /**
1711
- * inlined Object.is polyfill to avoid requiring consumers ship their own
1712
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
1713
- */
1714
- /*eslint-disable no-self-compare*/
1715
- function is(x, y) {
1716
- // SameValue algorithm
1717
- if (x === y) {
1718
- // Steps 1-5, 7-10
1719
- // Steps 6.b-6.e: +0 != -0
1720
- return x !== 0 || 1 / x === 1 / y;
1721
- } else {
1722
- // Step 6.a: NaN == NaN
1723
- return x !== x && y !== y;
1724
- }
1725
- }
1726
- /*eslint-enable no-self-compare*/
1727
-
1728
- /**
1729
- * We use an Error-like object for backward compatibility as people may call
1730
- * PropTypes directly and inspect their output. However, we don't use real
1731
- * Errors anymore. We don't inspect their stack anyway, and creating them
1732
- * is prohibitively expensive if they are created too often, such as what
1733
- * happens in oneOfType() for any type before the one that matched.
1734
- */
1735
- function PropTypeError(message) {
1736
- this.message = message;
1737
- this.stack = '';
1738
- }
1739
- // Make `instanceof Error` still work for returned errors.
1740
- PropTypeError.prototype = Error.prototype;
1741
-
1742
- function createChainableTypeChecker(validate) {
1743
- if (process.env.NODE_ENV !== 'production') {
1744
- var manualPropTypeCallCache = {};
1745
- var manualPropTypeWarningCount = 0;
1746
- }
1747
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
1748
- componentName = componentName || ANONYMOUS;
1749
- propFullName = propFullName || propName;
1750
-
1751
- if (secret !== ReactPropTypesSecret$1) {
1752
- if (throwOnDirectAccess) {
1753
- // New behavior only for users of `prop-types` package
1754
- var err = new Error(
1755
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1756
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
1757
- 'Read more at http://fb.me/use-check-prop-types'
1758
- );
1759
- err.name = 'Invariant Violation';
1760
- throw err;
1761
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
1762
- // Old behavior for people using React.PropTypes
1763
- var cacheKey = componentName + ':' + propName;
1764
- if (
1765
- !manualPropTypeCallCache[cacheKey] &&
1766
- // Avoid spamming the console because they are often not actionable except for lib authors
1767
- manualPropTypeWarningCount < 3
1768
- ) {
1769
- printWarning(
1770
- 'You are manually calling a React.PropTypes validation ' +
1771
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
1772
- 'and will throw in the standalone `prop-types` package. ' +
1773
- 'You may be seeing this warning due to a third-party PropTypes ' +
1774
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
1775
- );
1776
- manualPropTypeCallCache[cacheKey] = true;
1777
- manualPropTypeWarningCount++;
1778
- }
1779
- }
1780
- }
1781
- if (props[propName] == null) {
1782
- if (isRequired) {
1783
- if (props[propName] === null) {
1784
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
1785
- }
1786
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
1787
- }
1788
- return null;
1789
- } else {
1790
- return validate(props, propName, componentName, location, propFullName);
1791
- }
1792
- }
1793
-
1794
- var chainedCheckType = checkType.bind(null, false);
1795
- chainedCheckType.isRequired = checkType.bind(null, true);
1796
-
1797
- return chainedCheckType;
1798
- }
1799
-
1800
- function createPrimitiveTypeChecker(expectedType) {
1801
- function validate(props, propName, componentName, location, propFullName, secret) {
1802
- var propValue = props[propName];
1803
- var propType = getPropType(propValue);
1804
- if (propType !== expectedType) {
1805
- // `propValue` being instance of, say, date/regexp, pass the 'object'
1806
- // check, but we can offer a more precise error message here rather than
1807
- // 'of type `object`'.
1808
- var preciseType = getPreciseType(propValue);
1809
-
1810
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
1811
- }
1812
- return null;
1813
- }
1814
- return createChainableTypeChecker(validate);
1815
- }
1816
-
1817
- function createAnyTypeChecker() {
1818
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
1819
- }
1820
-
1821
- function createArrayOfTypeChecker(typeChecker) {
1822
- function validate(props, propName, componentName, location, propFullName) {
1823
- if (typeof typeChecker !== 'function') {
1824
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
1825
- }
1826
- var propValue = props[propName];
1827
- if (!Array.isArray(propValue)) {
1828
- var propType = getPropType(propValue);
1829
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
1830
- }
1831
- for (var i = 0; i < propValue.length; i++) {
1832
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
1833
- if (error instanceof Error) {
1834
- return error;
1835
- }
1836
- }
1837
- return null;
1838
- }
1839
- return createChainableTypeChecker(validate);
1840
- }
1841
-
1842
- function createElementTypeChecker() {
1843
- function validate(props, propName, componentName, location, propFullName) {
1844
- var propValue = props[propName];
1845
- if (!isValidElement(propValue)) {
1846
- var propType = getPropType(propValue);
1847
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
1848
- }
1849
- return null;
1850
- }
1851
- return createChainableTypeChecker(validate);
1852
- }
1853
-
1854
- function createElementTypeTypeChecker() {
1855
- function validate(props, propName, componentName, location, propFullName) {
1856
- var propValue = props[propName];
1857
- if (!ReactIs$1.isValidElementType(propValue)) {
1858
- var propType = getPropType(propValue);
1859
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
1860
- }
1861
- return null;
1862
- }
1863
- return createChainableTypeChecker(validate);
1864
- }
1865
-
1866
- function createInstanceTypeChecker(expectedClass) {
1867
- function validate(props, propName, componentName, location, propFullName) {
1868
- if (!(props[propName] instanceof expectedClass)) {
1869
- var expectedClassName = expectedClass.name || ANONYMOUS;
1870
- var actualClassName = getClassName(props[propName]);
1871
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
1872
- }
1873
- return null;
1874
- }
1875
- return createChainableTypeChecker(validate);
1876
- }
1877
-
1878
- function createEnumTypeChecker(expectedValues) {
1879
- if (!Array.isArray(expectedValues)) {
1880
- if (process.env.NODE_ENV !== 'production') {
1881
- if (arguments.length > 1) {
1882
- printWarning(
1883
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
1884
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
1885
- );
1886
- } else {
1887
- printWarning('Invalid argument supplied to oneOf, expected an array.');
1888
- }
1889
- }
1890
- return emptyFunctionThatReturnsNull;
1891
- }
1892
-
1893
- function validate(props, propName, componentName, location, propFullName) {
1894
- var propValue = props[propName];
1895
- for (var i = 0; i < expectedValues.length; i++) {
1896
- if (is(propValue, expectedValues[i])) {
1897
- return null;
1898
- }
1899
- }
1900
-
1901
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
1902
- var type = getPreciseType(value);
1903
- if (type === 'symbol') {
1904
- return String(value);
1905
- }
1906
- return value;
1907
- });
1908
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
1909
- }
1910
- return createChainableTypeChecker(validate);
1911
- }
1912
-
1913
- function createObjectOfTypeChecker(typeChecker) {
1914
- function validate(props, propName, componentName, location, propFullName) {
1915
- if (typeof typeChecker !== 'function') {
1916
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
1917
- }
1918
- var propValue = props[propName];
1919
- var propType = getPropType(propValue);
1920
- if (propType !== 'object') {
1921
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
1922
- }
1923
- for (var key in propValue) {
1924
- if (has(propValue, key)) {
1925
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
1926
- if (error instanceof Error) {
1927
- return error;
1928
- }
1929
- }
1930
- }
1931
- return null;
1932
- }
1933
- return createChainableTypeChecker(validate);
1934
- }
1935
-
1936
- function createUnionTypeChecker(arrayOfTypeCheckers) {
1937
- if (!Array.isArray(arrayOfTypeCheckers)) {
1938
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
1939
- return emptyFunctionThatReturnsNull;
1940
- }
1941
-
1942
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1943
- var checker = arrayOfTypeCheckers[i];
1944
- if (typeof checker !== 'function') {
1945
- printWarning(
1946
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
1947
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
1948
- );
1949
- return emptyFunctionThatReturnsNull;
1950
- }
1951
- }
1952
-
1953
- function validate(props, propName, componentName, location, propFullName) {
1954
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1955
- var checker = arrayOfTypeCheckers[i];
1956
- if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1) == null) {
1957
- return null;
1958
- }
1959
- }
1960
-
1961
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
1962
- }
1963
- return createChainableTypeChecker(validate);
1964
- }
1965
-
1966
- function createNodeChecker() {
1967
- function validate(props, propName, componentName, location, propFullName) {
1968
- if (!isNode(props[propName])) {
1969
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1970
- }
1971
- return null;
1972
- }
1973
- return createChainableTypeChecker(validate);
1974
- }
1975
-
1976
- function createShapeTypeChecker(shapeTypes) {
1977
- function validate(props, propName, componentName, location, propFullName) {
1978
- var propValue = props[propName];
1979
- var propType = getPropType(propValue);
1980
- if (propType !== 'object') {
1981
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1982
- }
1983
- for (var key in shapeTypes) {
1984
- var checker = shapeTypes[key];
1985
- if (!checker) {
1986
- continue;
1987
- }
1988
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
1989
- if (error) {
1990
- return error;
1991
- }
1992
- }
1993
- return null;
1994
- }
1995
- return createChainableTypeChecker(validate);
1996
- }
1997
-
1998
- function createStrictShapeTypeChecker(shapeTypes) {
1999
- function validate(props, propName, componentName, location, propFullName) {
2000
- var propValue = props[propName];
2001
- var propType = getPropType(propValue);
2002
- if (propType !== 'object') {
2003
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
2004
- }
2005
- // We need to check all keys in case some are required but missing from
2006
- // props.
2007
- var allKeys = assign({}, props[propName], shapeTypes);
2008
- for (var key in allKeys) {
2009
- var checker = shapeTypes[key];
2010
- if (!checker) {
2011
- return new PropTypeError(
2012
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
2013
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
2014
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
2015
- );
2016
- }
2017
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
2018
- if (error) {
2019
- return error;
2020
- }
2021
- }
2022
- return null;
2023
- }
2024
-
2025
- return createChainableTypeChecker(validate);
2026
- }
2027
-
2028
- function isNode(propValue) {
2029
- switch (typeof propValue) {
2030
- case 'number':
2031
- case 'string':
2032
- case 'undefined':
2033
- return true;
2034
- case 'boolean':
2035
- return !propValue;
2036
- case 'object':
2037
- if (Array.isArray(propValue)) {
2038
- return propValue.every(isNode);
2039
- }
2040
- if (propValue === null || isValidElement(propValue)) {
2041
- return true;
2042
- }
2043
-
2044
- var iteratorFn = getIteratorFn(propValue);
2045
- if (iteratorFn) {
2046
- var iterator = iteratorFn.call(propValue);
2047
- var step;
2048
- if (iteratorFn !== propValue.entries) {
2049
- while (!(step = iterator.next()).done) {
2050
- if (!isNode(step.value)) {
2051
- return false;
2052
- }
2053
- }
2054
- } else {
2055
- // Iterator will provide entry [k,v] tuples rather than values.
2056
- while (!(step = iterator.next()).done) {
2057
- var entry = step.value;
2058
- if (entry) {
2059
- if (!isNode(entry[1])) {
2060
- return false;
2061
- }
2062
- }
2063
- }
2064
- }
2065
- } else {
2066
- return false;
2067
- }
2068
-
2069
- return true;
2070
- default:
2071
- return false;
2072
- }
2073
- }
2074
-
2075
- function isSymbol(propType, propValue) {
2076
- // Native Symbol.
2077
- if (propType === 'symbol') {
2078
- return true;
2079
- }
2080
-
2081
- // falsy value can't be a Symbol
2082
- if (!propValue) {
2083
- return false;
2084
- }
2085
-
2086
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
2087
- if (propValue['@@toStringTag'] === 'Symbol') {
2088
- return true;
2089
- }
2090
-
2091
- // Fallback for non-spec compliant Symbols which are polyfilled.
2092
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
2093
- return true;
2094
- }
2095
-
2096
- return false;
2097
- }
2098
-
2099
- // Equivalent of `typeof` but with special handling for array and regexp.
2100
- function getPropType(propValue) {
2101
- var propType = typeof propValue;
2102
- if (Array.isArray(propValue)) {
2103
- return 'array';
2104
- }
2105
- if (propValue instanceof RegExp) {
2106
- // Old webkits (at least until Android 4.0) return 'function' rather than
2107
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
2108
- // passes PropTypes.object.
2109
- return 'object';
2110
- }
2111
- if (isSymbol(propType, propValue)) {
2112
- return 'symbol';
2113
- }
2114
- return propType;
2115
- }
2116
-
2117
- // This handles more types than `getPropType`. Only used for error messages.
2118
- // See `createPrimitiveTypeChecker`.
2119
- function getPreciseType(propValue) {
2120
- if (typeof propValue === 'undefined' || propValue === null) {
2121
- return '' + propValue;
2122
- }
2123
- var propType = getPropType(propValue);
2124
- if (propType === 'object') {
2125
- if (propValue instanceof Date) {
2126
- return 'date';
2127
- } else if (propValue instanceof RegExp) {
2128
- return 'regexp';
2129
- }
2130
- }
2131
- return propType;
2132
- }
2133
-
2134
- // Returns a string that is postfixed to a warning about an invalid type.
2135
- // For example, "undefined" or "of type array"
2136
- function getPostfixForTypeWarning(value) {
2137
- var type = getPreciseType(value);
2138
- switch (type) {
2139
- case 'array':
2140
- case 'object':
2141
- return 'an ' + type;
2142
- case 'boolean':
2143
- case 'date':
2144
- case 'regexp':
2145
- return 'a ' + type;
2146
- default:
2147
- return type;
2148
- }
2149
- }
2150
-
2151
- // Returns class name of the object, if any.
2152
- function getClassName(propValue) {
2153
- if (!propValue.constructor || !propValue.constructor.name) {
2154
- return ANONYMOUS;
2155
- }
2156
- return propValue.constructor.name;
2157
- }
2158
-
2159
- ReactPropTypes.checkPropTypes = checkPropTypes;
2160
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
2161
- ReactPropTypes.PropTypes = ReactPropTypes;
2162
-
2163
- return ReactPropTypes;
2164
- };
2165
-
2166
- /**
2167
- * Copyright (c) 2013-present, Facebook, Inc.
2168
- *
2169
- * This source code is licensed under the MIT license found in the
2170
- * LICENSE file in the root directory of this source tree.
2171
- */
2172
-
2173
- var ReactPropTypesSecret = ReactPropTypesSecret_1;
2174
-
2175
- function emptyFunction() {}
2176
- function emptyFunctionWithReset() {}
2177
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
2178
-
2179
- var factoryWithThrowingShims = function() {
2180
- function shim(props, propName, componentName, location, propFullName, secret) {
2181
- if (secret === ReactPropTypesSecret) {
2182
- // It is still safe when called from React.
2183
- return;
2184
- }
2185
- var err = new Error(
2186
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
2187
- 'Use PropTypes.checkPropTypes() to call them. ' +
2188
- 'Read more at http://fb.me/use-check-prop-types'
2189
- );
2190
- err.name = 'Invariant Violation';
2191
- throw err;
2192
- } shim.isRequired = shim;
2193
- function getShim() {
2194
- return shim;
2195
- } // Important!
2196
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
2197
- var ReactPropTypes = {
2198
- array: shim,
2199
- bool: shim,
2200
- func: shim,
2201
- number: shim,
2202
- object: shim,
2203
- string: shim,
2204
- symbol: shim,
2205
-
2206
- any: shim,
2207
- arrayOf: getShim,
2208
- element: shim,
2209
- elementType: shim,
2210
- instanceOf: getShim,
2211
- node: shim,
2212
- objectOf: getShim,
2213
- oneOf: getShim,
2214
- oneOfType: getShim,
2215
- shape: getShim,
2216
- exact: getShim,
2217
-
2218
- checkPropTypes: emptyFunctionWithReset,
2219
- resetWarningCache: emptyFunction
2220
- };
2221
-
2222
- ReactPropTypes.PropTypes = ReactPropTypes;
2223
-
2224
- return ReactPropTypes;
2225
- };
2226
-
2227
- /**
2228
- * Copyright (c) 2013-present, Facebook, Inc.
2229
- *
2230
- * This source code is licensed under the MIT license found in the
2231
- * LICENSE file in the root directory of this source tree.
2232
- */
2233
-
2234
- if (process.env.NODE_ENV !== 'production') {
2235
- var ReactIs = reactIs.exports;
2236
-
2237
- // By explicitly using `prop-types` you are opting into new development behavior.
2238
- // http://fb.me/prop-types-in-prod
2239
- var throwOnDirectAccess = true;
2240
- propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
2241
- } else {
2242
- // By explicitly using `prop-types` you are opting into new production behavior.
2243
- // http://fb.me/prop-types-in-prod
2244
- propTypes.exports = factoryWithThrowingShims();
2245
- }
2246
-
2247
- var PropTypes = propTypes.exports;
2248
-
2249
- function _typeof(obj) {
2250
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
2251
- _typeof = function (obj) {
2252
- return typeof obj;
2253
- };
2254
- } else {
2255
- _typeof = function (obj) {
2256
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2257
- };
2258
- }
2259
-
2260
- return _typeof(obj);
2261
- }
2262
-
2263
- function _defineProperty(obj, key, value) {
2264
- if (key in obj) {
2265
- Object.defineProperty(obj, key, {
2266
- value: value,
2267
- enumerable: true,
2268
- configurable: true,
2269
- writable: true
2270
- });
2271
- } else {
2272
- obj[key] = value;
2273
- }
2274
-
2275
- return obj;
2276
- }
2277
-
2278
- function ownKeys(object, enumerableOnly) {
2279
- var keys = Object.keys(object);
2280
-
2281
- if (Object.getOwnPropertySymbols) {
2282
- var symbols = Object.getOwnPropertySymbols(object);
2283
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
2284
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
2285
- });
2286
- keys.push.apply(keys, symbols);
2287
- }
2288
-
2289
- return keys;
2290
- }
2291
-
2292
- function _objectSpread2(target) {
2293
- for (var i = 1; i < arguments.length; i++) {
2294
- var source = arguments[i] != null ? arguments[i] : {};
2295
-
2296
- if (i % 2) {
2297
- ownKeys(Object(source), true).forEach(function (key) {
2298
- _defineProperty(target, key, source[key]);
2299
- });
2300
- } else if (Object.getOwnPropertyDescriptors) {
2301
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2302
- } else {
2303
- ownKeys(Object(source)).forEach(function (key) {
2304
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2305
- });
2306
- }
2307
- }
2308
-
2309
- return target;
2310
- }
2311
-
2312
- function _objectWithoutPropertiesLoose(source, excluded) {
2313
- if (source == null) return {};
2314
- var target = {};
2315
- var sourceKeys = Object.keys(source);
2316
- var key, i;
2317
-
2318
- for (i = 0; i < sourceKeys.length; i++) {
2319
- key = sourceKeys[i];
2320
- if (excluded.indexOf(key) >= 0) continue;
2321
- target[key] = source[key];
2322
- }
2323
-
2324
- return target;
2325
- }
2326
-
2327
- function _objectWithoutProperties(source, excluded) {
2328
- if (source == null) return {};
2329
-
2330
- var target = _objectWithoutPropertiesLoose(source, excluded);
2331
-
2332
- var key, i;
2333
-
2334
- if (Object.getOwnPropertySymbols) {
2335
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
2336
-
2337
- for (i = 0; i < sourceSymbolKeys.length; i++) {
2338
- key = sourceSymbolKeys[i];
2339
- if (excluded.indexOf(key) >= 0) continue;
2340
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
2341
- target[key] = source[key];
2342
- }
2343
- }
2344
-
2345
- return target;
2346
- }
2347
-
2348
- function _toConsumableArray(arr) {
2349
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
2350
- }
2351
-
2352
- function _arrayWithoutHoles(arr) {
2353
- if (Array.isArray(arr)) {
2354
- for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
2355
-
2356
- return arr2;
2357
- }
2358
- }
2359
-
2360
- function _iterableToArray(iter) {
2361
- if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
2362
- }
2363
-
2364
- function _nonIterableSpread() {
2365
- throw new TypeError("Invalid attempt to spread non-iterable instance");
2366
- }
2367
-
2368
- // Get CSS class list from a props object
2369
- function classList(props) {
2370
- var _classes;
2371
-
2372
- var spin = props.spin,
2373
- pulse = props.pulse,
2374
- fixedWidth = props.fixedWidth,
2375
- inverse = props.inverse,
2376
- border = props.border,
2377
- listItem = props.listItem,
2378
- flip = props.flip,
2379
- size = props.size,
2380
- rotation = props.rotation,
2381
- pull = props.pull; // map of CSS class names to properties
2382
-
2383
- var classes = (_classes = {
2384
- 'fa-spin': spin,
2385
- 'fa-pulse': pulse,
2386
- 'fa-fw': fixedWidth,
2387
- 'fa-inverse': inverse,
2388
- 'fa-border': border,
2389
- 'fa-li': listItem,
2390
- 'fa-flip-horizontal': flip === 'horizontal' || flip === 'both',
2391
- 'fa-flip-vertical': flip === 'vertical' || flip === 'both'
2392
- }, _defineProperty(_classes, "fa-".concat(size), typeof size !== 'undefined' && size !== null), _defineProperty(_classes, "fa-rotate-".concat(rotation), typeof rotation !== 'undefined' && rotation !== null && rotation !== 0), _defineProperty(_classes, "fa-pull-".concat(pull), typeof pull !== 'undefined' && pull !== null), _defineProperty(_classes, 'fa-swap-opacity', props.swapOpacity), _classes); // map over all the keys in the classes object
2393
- // return an array of the keys where the value for the key is not null
2394
-
2395
- return Object.keys(classes).map(function (key) {
2396
- return classes[key] ? key : null;
2397
- }).filter(function (key) {
2398
- return key;
2399
- });
2400
- }
2401
-
2402
- // Camelize taken from humps
2403
- // humps is copyright © 2012+ Dom Christie
2404
- // Released under the MIT license.
2405
- // Performant way to determine if object coerces to a number
2406
- function _isNumerical(obj) {
2407
- obj = obj - 0; // eslint-disable-next-line no-self-compare
2408
-
2409
- return obj === obj;
2410
- }
2411
-
2412
- function camelize(string) {
2413
- if (_isNumerical(string)) {
2414
- return string;
2415
- } // eslint-disable-next-line no-useless-escape
2416
-
2417
-
2418
- string = string.replace(/[\-_\s]+(.)?/g, function (match, chr) {
2419
- return chr ? chr.toUpperCase() : '';
2420
- }); // Ensure 1st char is always lowercase
2421
-
2422
- return string.substr(0, 1).toLowerCase() + string.substr(1);
2423
- }
2424
-
2425
- function capitalize(val) {
2426
- return val.charAt(0).toUpperCase() + val.slice(1);
2427
- }
2428
-
2429
- function styleToObject(style) {
2430
- return style.split(';').map(function (s) {
2431
- return s.trim();
2432
- }).filter(function (s) {
2433
- return s;
2434
- }).reduce(function (acc, pair) {
2435
- var i = pair.indexOf(':');
2436
- var prop = camelize(pair.slice(0, i));
2437
- var value = pair.slice(i + 1).trim();
2438
- prop.startsWith('webkit') ? acc[capitalize(prop)] = value : acc[prop] = value;
2439
- return acc;
2440
- }, {});
2441
- }
2442
-
2443
- function convert(createElement, element) {
2444
- var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2445
-
2446
- if (typeof element === 'string') {
2447
- return element;
2448
- }
2449
-
2450
- var children = (element.children || []).map(function (child) {
2451
- return convert(createElement, child);
2452
- });
2453
- /* eslint-disable dot-notation */
2454
-
2455
- var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) {
2456
- var val = element.attributes[key];
2457
-
2458
- switch (key) {
2459
- case 'class':
2460
- acc.attrs['className'] = val;
2461
- delete element.attributes['class'];
2462
- break;
2463
-
2464
- case 'style':
2465
- acc.attrs['style'] = styleToObject(val);
2466
- break;
2467
-
2468
- default:
2469
- if (key.indexOf('aria-') === 0 || key.indexOf('data-') === 0) {
2470
- acc.attrs[key.toLowerCase()] = val;
2471
- } else {
2472
- acc.attrs[camelize(key)] = val;
2473
- }
2474
-
2475
- }
2476
-
2477
- return acc;
2478
- }, {
2479
- attrs: {}
2480
- });
2481
-
2482
- var _extraProps$style = extraProps.style,
2483
- existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style,
2484
- remaining = _objectWithoutProperties(extraProps, ["style"]);
2485
-
2486
- mixins.attrs['style'] = _objectSpread2({}, mixins.attrs['style'], {}, existingStyle);
2487
- /* eslint-enable */
2488
-
2489
- return createElement.apply(void 0, [element.tag, _objectSpread2({}, mixins.attrs, {}, remaining)].concat(_toConsumableArray(children)));
2490
- }
2491
-
2492
- var PRODUCTION = false;
2493
-
2494
- try {
2495
- PRODUCTION = process.env.NODE_ENV === 'production';
2496
- } catch (e) {}
2497
-
2498
- function log () {
2499
- if (!PRODUCTION && console && typeof console.error === 'function') {
2500
- var _console;
2501
-
2502
- (_console = console).error.apply(_console, arguments);
2503
- }
2504
- }
2505
-
2506
- function normalizeIconArgs(icon) {
2507
- // this has everything that it needs to be rendered which means it was probably imported
2508
- // directly from an icon svg package
2509
- if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {
2510
- return icon;
2511
- }
2512
-
2513
-
2514
- if (icon === null) {
2515
- return null;
2516
- } // if the icon is an object and has a prefix and an icon name, return it
2517
-
2518
-
2519
- if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName) {
2520
- return icon;
2521
- } // if it's an array with length of two
2522
-
2523
-
2524
- if (Array.isArray(icon) && icon.length === 2) {
2525
- // use the first item as prefix, second as icon name
2526
- return {
2527
- prefix: icon[0],
2528
- iconName: icon[1]
2529
- };
2530
- } // if it's a string, use it as the icon name
2531
-
2532
-
2533
- if (typeof icon === 'string') {
2534
- return {
2535
- prefix: 'fas',
2536
- iconName: icon
2537
- };
2538
- }
2539
- }
2540
-
2541
- // creates an object with a key of key
2542
- // and a value of value
2543
- // if certain conditions are met
2544
- function objectWithKey(key, value) {
2545
- // if the value is a non-empty array
2546
- // or it's not an array but it is truthy
2547
- // then create the object with the key and the value
2548
- // if not, return an empty array
2549
- return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};
2550
- }
2551
-
2552
- function FontAwesomeIcon(_ref) {
2553
- var forwardedRef = _ref.forwardedRef,
2554
- props = _objectWithoutProperties(_ref, ["forwardedRef"]);
2555
-
2556
- var iconArgs = props.icon,
2557
- maskArgs = props.mask,
2558
- symbol = props.symbol,
2559
- className = props.className,
2560
- title = props.title,
2561
- titleId = props.titleId;
2562
- var iconLookup = normalizeIconArgs(iconArgs);
2563
- var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(props)), _toConsumableArray(className.split(' '))));
2564
- var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
2565
- var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
2566
- var renderedIcon = icon(iconLookup, _objectSpread2({}, classes, {}, transform, {}, mask, {
2567
- symbol: symbol,
2568
- title: title,
2569
- titleId: titleId
2570
- }));
2571
-
2572
- if (!renderedIcon) {
2573
- log('Could not find icon', iconLookup);
2574
- return null;
2575
- }
2576
-
2577
- var abstract = renderedIcon.abstract;
2578
- var extraProps = {
2579
- ref: forwardedRef
2580
- };
2581
- Object.keys(props).forEach(function (key) {
2582
- // eslint-disable-next-line no-prototype-builtins
2583
- if (!FontAwesomeIcon.defaultProps.hasOwnProperty(key)) {
2584
- extraProps[key] = props[key];
2585
- }
2586
- });
2587
- return convertCurry(abstract[0], extraProps);
2588
- }
2589
- FontAwesomeIcon.displayName = 'FontAwesomeIcon';
2590
- FontAwesomeIcon.propTypes = {
2591
- border: PropTypes.bool,
2592
- className: PropTypes.string,
2593
- mask: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string]),
2594
- fixedWidth: PropTypes.bool,
2595
- inverse: PropTypes.bool,
2596
- flip: PropTypes.oneOf(['horizontal', 'vertical', 'both']),
2597
- icon: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string]),
2598
- listItem: PropTypes.bool,
2599
- pull: PropTypes.oneOf(['right', 'left']),
2600
- pulse: PropTypes.bool,
2601
- rotation: PropTypes.oneOf([0, 90, 180, 270]),
2602
- size: PropTypes.oneOf(['lg', 'xs', 'sm', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
2603
- spin: PropTypes.bool,
2604
- symbol: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
2605
- title: PropTypes.string,
2606
- transform: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
2607
- swapOpacity: PropTypes.bool
2608
- };
2609
- FontAwesomeIcon.defaultProps = {
2610
- border: false,
2611
- className: '',
2612
- mask: null,
2613
- fixedWidth: false,
2614
- inverse: false,
2615
- flip: null,
2616
- icon: null,
2617
- listItem: false,
2618
- pull: null,
2619
- pulse: false,
2620
- rotation: null,
2621
- size: null,
2622
- spin: false,
2623
- symbol: false,
2624
- title: '',
2625
- transform: null,
2626
- swapOpacity: false
2627
- };
2628
- var convertCurry = convert.bind(null, React.createElement);
2629
-
2630
- /*!
2631
- * Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
2632
- * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
2633
- */
2634
- var faSpinner = {
2635
- prefix: 'fas',
2636
- iconName: 'spinner',
2637
- icon: [512, 512, [], "f110", "M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"]
2638
- };
2639
-
2640
- var HALF_REM = "0.5rem";
2641
- var ONE_REM = "1rem";
2642
- var ONE_AND_HALF_REM = "1.5rem";
2643
- var THREE_REM = "3rem";
2644
-
2645
- var useSpacingStyles = makeStyles({
2646
- labelBreak: {
2647
- marginBottom: HALF_REM,
2648
- },
2649
- contentBreak: {
2650
- marginBottom: ONE_REM,
2651
- },
2652
- sectionBreak: {
2653
- marginBottom: ONE_AND_HALF_REM,
2654
- },
2655
- doubleSectionBreak: {
2656
- marginBottom: THREE_REM,
2657
- },
2658
- rightSpacer1: {
2659
- marginRight: HALF_REM,
2660
- },
2661
- rightSpacer2: {
2662
- marginRight: ONE_REM,
2663
- },
2664
- leftSpacer1: {
2665
- marginLeft: HALF_REM,
2666
- },
2667
- leftSpacer2: {
2668
- marginLeft: ONE_REM,
2669
- },
2670
- buttonSpacing: {
2671
- marginLeft: HALF_REM,
2672
- marginRight: HALF_REM,
2673
- marginBottom: ONE_REM,
2674
- },
2675
- leftRightPadding1: {
2676
- paddingLeft: HALF_REM,
2677
- paddingRight: HALF_REM,
2678
- },
2679
- leftRightPadding2: {
2680
- paddingLeft: ONE_REM,
2681
- paddingRight: ONE_REM,
2682
- },
2683
- topBottomPadding1: {
2684
- paddingTop: HALF_REM,
2685
- paddingBottom: HALF_REM,
2686
- },
2687
- topBottomPadding2: {
2688
- paddingTop: ONE_REM,
2689
- paddingBottom: ONE_REM,
2690
- },
2691
- }, { index: 999 });
2692
-
2693
- var useButtonStyles = makeStyles(function (theme) { return ({
2694
- submitButton: {
2695
- borderRadius: ONE_AND_HALF_REM,
2696
- padding: "0.4rem 1rem",
2697
- textTransform: "capitalize",
2698
- },
2699
- containedText: {
2700
- color: "white",
2701
- },
2702
- }); });
2703
- var MaterialButton = function (_a) {
2704
- var _b = _a.loading, loading = _b === void 0 ? false : _b, children = _a.children, _c = _a.errors, errors = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? "submit" : _d, onClick = _a.onClick, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.variant, variant = _f === void 0 ? "outlined" : _f, _g = _a.styling, styling = _g === void 0 ? "" : _g, _h = _a.color, color = _h === void 0 ? "primary" : _h, rest = __rest(_a, ["loading", "children", "errors", "type", "onClick", "disabled", "variant", "styling", "color"]);
2705
- var classes = __assign(__assign({}, useSpacingStyles()), useButtonStyles());
2706
- if (!disabled && (loading || errors))
2707
- disabled = true;
2708
- return (React.createElement(Button, __assign({}, rest, { variant: variant, color: color, type: type, className: classes.submitButton + " " + (variant === "contained" && classes.containedText) + " " + styling, disabled: disabled, onClick: onClick }),
2709
- children,
2710
- loading ? (React.createElement(FontAwesomeIcon, { icon: faSpinner, className: classes.leftSpacer1, size: "lg", spin: true })) : ("")));
2711
- };
2712
-
2713
- export { MaterialButton as Button };
1
+ import e from"react";import{makeStyles as t,Button as r,Typography as o,Box as n,CircularProgress as i,withStyles as a,createStyles as l,TableRow as d,Table as m,TableHead as c,TableBody as g,TableCell as s}from"@material-ui/core";import{FontAwesomeIcon as u}from"@fortawesome/react-fontawesome";import{faSpinner as p}from"@fortawesome/free-solid-svg-icons";
2
+ /*! *****************************************************************************
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
15
+ ***************************************************************************** */var h=function(){return h=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},h.apply(this,arguments)};function f(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}var b=t({labelBreak:{marginBottom:"0.5rem"},contentBreak:{marginBottom:"1rem"},sectionBreak:{marginBottom:"1.5rem"},doubleSectionBreak:{marginBottom:"3rem"},rightSpacer1:{marginRight:"0.5rem"},rightSpacer2:{marginRight:"1rem"},leftSpacer1:{marginLeft:"0.5rem"},leftSpacer2:{marginLeft:"1rem"},buttonSpacing:{marginLeft:"0.5rem",marginRight:"0.5rem",marginBottom:"1rem"},leftRightPadding1:{paddingLeft:"0.5rem",paddingRight:"0.5rem"},leftRightPadding2:{paddingLeft:"1rem",paddingRight:"1rem"},topBottomPadding1:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},topBottomPadding2:{paddingTop:"1rem",paddingBottom:"1rem"}},{classNamePrefix:"spacing",index:2}),x=t((function(e){return{boldText:{fontWeight:700},bolderText:{fontWeight:500},smallText:{fontSize:"0.7rem"},warningColor:{color:e.palette.warning.main},centerText:{textAlign:"center"}}}),{classNamePrefix:"font"}),v=t({contentBox:{background:"white",borderRadius:"3rem",marginBottom:"1rem",padding:"3rem"},limitWidth60rem:{maxWidth:"60rem",marginLeft:"auto",marginRight:"auto"},limitWidth50rem:{maxWidth:"50rem",marginLeft:"auto",marginRight:"auto"},limitWidth45rem:{maxWidth:"45rem",marginLeft:"auto",marginRight:"auto"},limitWidth40rem:{maxWidth:"40rem",marginLeft:"auto",marginRight:"auto"},limitWidth35rem:{maxWidth:"35rem",marginLeft:"auto",marginRight:"auto"},limitWidth30rem:{maxWidth:"30rem",marginLeft:"auto",marginRight:"auto"},limitWidth25rem:{maxWidth:"25rem",marginLeft:"auto",marginRight:"auto"},centeredText:{textAlign:"center"},startAlignedText:{textAlign:"start"},width20:{width:"20%"},width49:{width:"49%"},width50:{width:"50%"},width60:{width:"60%"},width100:{width:"100%"},flexCenter:{display:"flex",alignItems:"center",justifyContent:"center"},centerJustify:{justifyContent:"center"},leftJustify:{justifyContent:"left"},rightJustify:{justifyContent:"right"}},{classNamePrefix:"layout",index:2}),y=t((function(e){return{submitButton:{borderRadius:"1.5rem",padding:"0.4rem 1rem",textTransform:"capitalize"},containedText:{color:"white"}}})),B=function(t){var o=t.loading,n=void 0!==o&&o,i=t.children,a=t.errors,l=void 0!==a&&a,d=t.type,m=void 0===d?"submit":d,c=t.onClick,g=t.disabled,s=void 0!==g&&g,x=t.variant,v=void 0===x?"outlined":x,B=t.styling,w=void 0===B?"":B,C=t.color,S=void 0===C?"primary":C,E=f(t,["loading","children","errors","type","onClick","disabled","variant","styling","color"]),R=h(h({},b()),y());return s||!n&&!l||(s=!0),e.createElement(r,h({},E,{variant:v,color:S,type:m,className:R.submitButton+" "+("contained"===v&&R.containedText)+" "+w,disabled:s,onClick:c}),i,n?e.createElement(u,{icon:p,className:R.leftSpacer1,size:"lg",spin:!0}):"")},w=function(t){var r=t.children,n=t.styling,i=void 0===n?null:n,a=x();return e.createElement(o,{variant:"h6",className:a.bolderText+" "+(i||"")},r)},C=function(t){var r=t.limitWidth,o=void 0!==r&&r,i=t.children,a=h(h({},b()),v());return e.createElement(n,{boxShadow:3,className:a.contentBox},e.createElement(n,{className:a.centeredText+" "+(o?a.limitWidth50rem:"")},i))},S=function(t){var r=t.text,a=void 0===r?"Loading data...":r,l=h(h({},b()),v());return e.createElement(n,{className:l.flexCenter},e.createElement(o,{variant:"body2",color:"textSecondary",className:l.rightSpacer1},a),e.createElement(i,{size:"1.5rem"}))},E=a(l({root:{"&:hover td":{backgroundColor:"rgba(0, 0, 0, 0.06)"}}}))(d),R=a(l({root:{"&:nth-of-type(even) td":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&:hover td":{backgroundColor:"rgba(0, 0, 0, 0.06)"}}}))(d),L=t((function(e){return{root:{borderBottom:"none",paddingTop:"8px",paddingBottom:"8px","&:first-child":{borderTopLeftRadius:"10px",borderBottomLeftRadius:"10px"},"&:last-child":{borderTopRightRadius:"10px",borderBottomRightRadius:"10px"}},head:function(t){var r=t.background,o=t.border;return{backgroundColor:r||"HSLA(204, 58.3%, 81.2%, 0.1)",borderTop:"1px solid "+(o||"HSLA(204, 58.3%, 81.2%, 0.3)"),borderBottom:"1px solid "+(o||"HSLA(204, 58.3%, 81.2%, 0.3)"),color:t.text||e.palette.text.primary,fontWeight:500,"&:first-child":{borderLeft:"1px solid "+(o||"HSLA(204, 58.3%, 81.2%, 0.3)")},"&:last-child":{borderRight:"1px solid "+(o||"HSLA(204, 58.3%, 81.2%, 0.3)")}}}}})),T=function(t){var r=t.children,o=t.align,i=void 0===o?"centerJustify":o,a=t.headerColours,l=f(t,["children","align","headerColours"]),d=h(h({},v()),L(h({},a||{})));return e.createElement(s,h({},l,{classes:{root:d.root,head:d.head}}),e.createElement(n,{className:d.flexCenter+" "+d[i]},r))},k=function(t){var r=t.rowBorderSeparation,o=void 0!==r&&r,n=t.children,i=f(t,["rowBorderSeparation","children"]);return o?e.createElement(E,h({},i),n):e.createElement(R,h({},i),n)},W=function(t){var r=t.colSpan,o=t.children,n=N();return e.createElement(k,null,e.createElement(T,{className:n.adjustedCellPadding,colSpan:r},o))},N=t({tableStyles:{borderCollapse:"separate",borderBottom:"1px solid rgb(224, 224, 224)"},pointer:{cursor:"pointer"},bottomBorder:{borderBottom:"1px solid rgba(224, 224, 224, 1)"},noShading:{backgroundColor:"transparent !important"},adjustedCellPadding:{paddingTop:"11px",paddingBottom:"11px"}}),P=function(t){var r=t.rowBorderSeparation,o=void 0!==r&&r,n=t.headers,i=t.rows,a=t.headerCellAlignment,l=void 0===a?[]:a,s=t.rowCellAlignment,u=void 0===s?[]:s,p=t.styling,h=t.headerColours,f=N();return e.createElement(m,{className:f.tableStyles+" "+(p||"")},e.createElement(c,null,e.createElement(d,null,n.map((function(t,r){return e.createElement(T,{align:l[r]||"centerJustify",key:"header-cell-"+r,headerColours:h},t)})))),e.createElement(g,null,i?i.length?i.map((function(t,r){var n=!!t.onClick;return e.createElement(k,{rowBorderSeparation:o,className:n?f.pointer:void 0,key:"row-"+r,onClick:n?t.onClick:void 0},t.row.map((function(t,n){return e.createElement(T,{align:u[n]||"centerJustify",className:o&&i.length!==r+1?f.bottomBorder:void 0,key:"row-"+r+"-cell-"+n},t)})))})):e.createElement(W,{colSpan:n.length},"Table is empty"):e.createElement(W,{colSpan:n.length},e.createElement(S,null))))};export{B as Button,C as ContentBox,w as ContentLabel,S as LoadingSpinner,P as StaticTable};
2714
16
  //# sourceMappingURL=index.js.map