jekyll-theme-open-project 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1805 @@
1
+ /*!
2
+ * Font Awesome Pro 5.0.10 by @fontawesome - https://fontawesome.com
3
+ * License - https://fontawesome.com/license (Commercial License)
4
+ */
5
+ (function () {
6
+ 'use strict';
7
+
8
+ var noop = function noop() {};
9
+
10
+ var _WINDOW = {};
11
+ var _DOCUMENT = {};
12
+ var _MUTATION_OBSERVER$1 = null;
13
+ var _PERFORMANCE = { mark: noop, measure: noop };
14
+
15
+ try {
16
+ if (typeof window !== 'undefined') _WINDOW = window;
17
+ if (typeof document !== 'undefined') _DOCUMENT = document;
18
+ if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER$1 = MutationObserver;
19
+ if (typeof performance !== 'undefined') _PERFORMANCE = performance;
20
+ } catch (e) {}
21
+
22
+ var _ref = _WINDOW.navigator || {};
23
+ var _ref$userAgent = _ref.userAgent;
24
+ var userAgent = _ref$userAgent === undefined ? '' : _ref$userAgent;
25
+
26
+ var WINDOW = _WINDOW;
27
+ var DOCUMENT = _DOCUMENT;
28
+ var MUTATION_OBSERVER = _MUTATION_OBSERVER$1;
29
+ var PERFORMANCE = _PERFORMANCE;
30
+ var IS_BROWSER = !!WINDOW.document;
31
+ var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
32
+ var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
33
+
34
+ var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
35
+ var UNITS_IN_GRID = 16;
36
+ var DEFAULT_FAMILY_PREFIX = 'fa';
37
+ var DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
38
+ var DATA_FA_I2SVG = 'data-fa-i2svg';
39
+ var DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';
40
+ var HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';
41
+
42
+ var PRODUCTION = function () {
43
+ try {
44
+ return "production" === 'production';
45
+ } catch (e) {
46
+ return false;
47
+ }
48
+ }();
49
+
50
+ var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
51
+ var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
52
+
53
+ var ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];
54
+
55
+ var RESERVED_CLASSES = ['xs', 'sm', 'lg', 'fw', 'ul', 'li', 'border', 'pull-left', 'pull-right', 'spin', 'pulse', 'rotate-90', 'rotate-180', 'rotate-270', 'flip-horizontal', 'flip-vertical', 'stack', 'stack-1x', 'stack-2x', 'inverse', 'layers', 'layers-text', 'layers-counter'].concat(oneToTen.map(function (n) {
56
+ return n + 'x';
57
+ })).concat(oneToTwenty.map(function (n) {
58
+ return 'w-' + n;
59
+ }));
60
+
61
+ var classCallCheck = function (instance, Constructor) {
62
+ if (!(instance instanceof Constructor)) {
63
+ throw new TypeError("Cannot call a class as a function");
64
+ }
65
+ };
66
+
67
+ var createClass = function () {
68
+ function defineProperties(target, props) {
69
+ for (var i = 0; i < props.length; i++) {
70
+ var descriptor = props[i];
71
+ descriptor.enumerable = descriptor.enumerable || false;
72
+ descriptor.configurable = true;
73
+ if ("value" in descriptor) descriptor.writable = true;
74
+ Object.defineProperty(target, descriptor.key, descriptor);
75
+ }
76
+ }
77
+
78
+ return function (Constructor, protoProps, staticProps) {
79
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
80
+ if (staticProps) defineProperties(Constructor, staticProps);
81
+ return Constructor;
82
+ };
83
+ }();
84
+
85
+
86
+
87
+ var _extends = Object.assign || function (target) {
88
+ for (var i = 1; i < arguments.length; i++) {
89
+ var source = arguments[i];
90
+
91
+ for (var key in source) {
92
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
93
+ target[key] = source[key];
94
+ }
95
+ }
96
+ }
97
+
98
+ return target;
99
+ };
100
+
101
+
102
+
103
+ var toConsumableArray = function (arr) {
104
+ if (Array.isArray(arr)) {
105
+ for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
106
+
107
+ return arr2;
108
+ } else {
109
+ return Array.from(arr);
110
+ }
111
+ };
112
+
113
+ var initial = WINDOW.FontAwesomeConfig || {};
114
+ var initialKeys = Object.keys(initial);
115
+
116
+ var _default = _extends({
117
+ familyPrefix: DEFAULT_FAMILY_PREFIX,
118
+ replacementClass: DEFAULT_REPLACEMENT_CLASS,
119
+ autoReplaceSvg: true,
120
+ autoAddCss: true,
121
+ autoA11y: true,
122
+ searchPseudoElements: false,
123
+ observeMutations: true,
124
+ keepOriginalSource: true,
125
+ measurePerformance: false,
126
+ showMissingIcons: true
127
+ }, initial);
128
+
129
+ if (!_default.autoReplaceSvg) _default.observeMutations = false;
130
+
131
+ var config = _extends({}, _default);
132
+
133
+ WINDOW.FontAwesomeConfig = config;
134
+
135
+ function update(newConfig) {
136
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
137
+ var _params$asNewDefault = params.asNewDefault,
138
+ asNewDefault = _params$asNewDefault === undefined ? false : _params$asNewDefault;
139
+
140
+ var validKeys = Object.keys(config);
141
+ var ok = asNewDefault ? function (k) {
142
+ return ~validKeys.indexOf(k) && !~initialKeys.indexOf(k);
143
+ } : function (k) {
144
+ return ~validKeys.indexOf(k);
145
+ };
146
+
147
+ Object.keys(newConfig).forEach(function (configKey) {
148
+ if (ok(configKey)) config[configKey] = newConfig[configKey];
149
+ });
150
+ }
151
+
152
+ function auto(value) {
153
+ update({
154
+ autoReplaceSvg: value,
155
+ observeMutations: value
156
+ });
157
+ }
158
+
159
+ var w = WINDOW || {};
160
+
161
+ if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};
162
+ if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};
163
+ if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};
164
+ if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];
165
+
166
+ var namespace = w[NAMESPACE_IDENTIFIER];
167
+
168
+ var functions = [];
169
+ var listener = function listener() {
170
+ DOCUMENT.removeEventListener('DOMContentLoaded', listener);
171
+ loaded = 1;
172
+ functions.map(function (fn) {
173
+ return fn();
174
+ });
175
+ };
176
+
177
+ var loaded = false;
178
+
179
+ if (IS_DOM) {
180
+ loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
181
+
182
+ if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
183
+ }
184
+
185
+ var domready = function (fn) {
186
+ if (!IS_DOM) return;
187
+ loaded ? setTimeout(fn, 0) : functions.push(fn);
188
+ };
189
+
190
+ var d = UNITS_IN_GRID;
191
+
192
+ var meaninglessTransform = {
193
+ size: 16,
194
+ x: 0,
195
+ y: 0,
196
+ rotate: 0,
197
+ flipX: false,
198
+ flipY: false
199
+ };
200
+
201
+ function isReserved(name) {
202
+ return ~RESERVED_CLASSES.indexOf(name);
203
+ }
204
+
205
+ function bunker(fn) {
206
+ try {
207
+ fn();
208
+ } catch (e) {
209
+ if (!PRODUCTION) {
210
+ throw e;
211
+ }
212
+ }
213
+ }
214
+
215
+ function insertCss(css) {
216
+ if (!css || !IS_DOM) {
217
+ return;
218
+ }
219
+
220
+ var style = DOCUMENT.createElement('style');
221
+ style.setAttribute('type', 'text/css');
222
+ style.innerHTML = css;
223
+
224
+ var headChildren = DOCUMENT.head.childNodes;
225
+ var beforeChild = null;
226
+
227
+ for (var i = headChildren.length - 1; i > -1; i--) {
228
+ var child = headChildren[i];
229
+ var tagName = (child.tagName || '').toUpperCase();
230
+ if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
231
+ beforeChild = child;
232
+ }
233
+ }
234
+
235
+ DOCUMENT.head.insertBefore(style, beforeChild);
236
+
237
+ return css;
238
+ }
239
+
240
+ var _uniqueId = 0;
241
+
242
+ function nextUniqueId() {
243
+ _uniqueId++;
244
+
245
+ return _uniqueId;
246
+ }
247
+
248
+ function toArray(obj) {
249
+ var array = [];
250
+
251
+ for (var i = (obj || []).length >>> 0; i--;) {
252
+ array[i] = obj[i];
253
+ }
254
+
255
+ return array;
256
+ }
257
+
258
+ function classArray(node) {
259
+ if (node.classList) {
260
+ return toArray(node.classList);
261
+ } else {
262
+ return (node.getAttribute('class') || '').split(' ').filter(function (i) {
263
+ return i;
264
+ });
265
+ }
266
+ }
267
+
268
+ function getIconName(familyPrefix, cls) {
269
+ var parts = cls.split('-');
270
+ var prefix = parts[0];
271
+ var iconName = parts.slice(1).join('-');
272
+
273
+ if (prefix === familyPrefix && iconName !== '' && !isReserved(iconName)) {
274
+ return iconName;
275
+ } else {
276
+ return null;
277
+ }
278
+ }
279
+
280
+ function htmlEscape(str) {
281
+ return ('' + str).replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
282
+ }
283
+
284
+ function joinAttributes(attributes) {
285
+ return Object.keys(attributes || {}).reduce(function (acc, attributeName) {
286
+ return acc + (attributeName + '="' + htmlEscape(attributes[attributeName]) + '" ');
287
+ }, '').trim();
288
+ }
289
+
290
+ function joinStyles(styles) {
291
+ return Object.keys(styles || {}).reduce(function (acc, styleName) {
292
+ return acc + (styleName + ': ' + styles[styleName] + ';');
293
+ }, '');
294
+ }
295
+
296
+ function transformIsMeaningful(transform) {
297
+ return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
298
+ }
299
+
300
+ function transformForSvg(_ref) {
301
+ var transform = _ref.transform,
302
+ containerWidth = _ref.containerWidth,
303
+ iconWidth = _ref.iconWidth;
304
+
305
+ var outer = {
306
+ transform: 'translate(' + containerWidth / 2 + ' 256)'
307
+ };
308
+ var innerTranslate = 'translate(' + transform.x * 32 + ', ' + transform.y * 32 + ') ';
309
+ var innerScale = 'scale(' + transform.size / 16 * (transform.flipX ? -1 : 1) + ', ' + transform.size / 16 * (transform.flipY ? -1 : 1) + ') ';
310
+ var innerRotate = 'rotate(' + transform.rotate + ' 0 0)';
311
+ var inner = {
312
+ transform: innerTranslate + ' ' + innerScale + ' ' + innerRotate
313
+ };
314
+ var path = {
315
+ transform: 'translate(' + iconWidth / 2 * -1 + ' -256)'
316
+ };
317
+ return {
318
+ outer: outer,
319
+ inner: inner,
320
+ path: path
321
+ };
322
+ }
323
+
324
+ function transformForCss(_ref2) {
325
+ var transform = _ref2.transform,
326
+ _ref2$width = _ref2.width,
327
+ width = _ref2$width === undefined ? UNITS_IN_GRID : _ref2$width,
328
+ _ref2$height = _ref2.height,
329
+ height = _ref2$height === undefined ? UNITS_IN_GRID : _ref2$height,
330
+ _ref2$startCentered = _ref2.startCentered,
331
+ startCentered = _ref2$startCentered === undefined ? false : _ref2$startCentered;
332
+
333
+ var val = '';
334
+
335
+ if (startCentered && IS_IE) {
336
+ val += 'translate(' + (transform.x / d - width / 2) + 'em, ' + (transform.y / d - height / 2) + 'em) ';
337
+ } else if (startCentered) {
338
+ val += 'translate(calc(-50% + ' + transform.x / d + 'em), calc(-50% + ' + transform.y / d + 'em)) ';
339
+ } else {
340
+ val += 'translate(' + transform.x / d + 'em, ' + transform.y / d + 'em) ';
341
+ }
342
+
343
+ val += 'scale(' + transform.size / d * (transform.flipX ? -1 : 1) + ', ' + transform.size / d * (transform.flipY ? -1 : 1) + ') ';
344
+ val += 'rotate(' + transform.rotate + 'deg) ';
345
+
346
+ return val;
347
+ }
348
+
349
+ var ALL_SPACE = {
350
+ x: 0,
351
+ y: 0,
352
+ width: '100%',
353
+ height: '100%'
354
+ };
355
+
356
+ var makeIconMasking = function (_ref) {
357
+ var children = _ref.children,
358
+ attributes = _ref.attributes,
359
+ main = _ref.main,
360
+ mask = _ref.mask,
361
+ transform = _ref.transform;
362
+ var mainWidth = main.width,
363
+ mainPath = main.icon;
364
+ var maskWidth = mask.width,
365
+ maskPath = mask.icon;
366
+
367
+
368
+ var trans = transformForSvg({ transform: transform, containerWidth: maskWidth, iconWidth: mainWidth });
369
+
370
+ var maskRect = {
371
+ tag: 'rect',
372
+ attributes: _extends({}, ALL_SPACE, {
373
+ fill: 'white'
374
+ })
375
+ };
376
+ var maskInnerGroup = {
377
+ tag: 'g',
378
+ attributes: _extends({}, trans.inner),
379
+ children: [{ tag: 'path', attributes: _extends({}, mainPath.attributes, trans.path, { fill: 'black' }) }]
380
+ };
381
+ var maskOuterGroup = {
382
+ tag: 'g',
383
+ attributes: _extends({}, trans.outer),
384
+ children: [maskInnerGroup]
385
+ };
386
+ var maskId = 'mask-' + nextUniqueId();
387
+ var clipId = 'clip-' + nextUniqueId();
388
+ var maskTag = {
389
+ tag: 'mask',
390
+ attributes: _extends({}, ALL_SPACE, {
391
+ id: maskId,
392
+ maskUnits: 'userSpaceOnUse',
393
+ maskContentUnits: 'userSpaceOnUse'
394
+ }),
395
+ children: [maskRect, maskOuterGroup]
396
+ };
397
+ var defs = {
398
+ tag: 'defs',
399
+ children: [{ tag: 'clipPath', attributes: { id: clipId }, children: [maskPath] }, maskTag]
400
+ };
401
+
402
+ children.push(defs, { tag: 'rect', attributes: _extends({ fill: 'currentColor', 'clip-path': 'url(#' + clipId + ')', mask: 'url(#' + maskId + ')' }, ALL_SPACE) });
403
+
404
+ return {
405
+ children: children,
406
+ attributes: attributes
407
+ };
408
+ };
409
+
410
+ var makeIconStandard = function (_ref) {
411
+ var children = _ref.children,
412
+ attributes = _ref.attributes,
413
+ main = _ref.main,
414
+ transform = _ref.transform,
415
+ styles = _ref.styles;
416
+
417
+ var styleString = joinStyles(styles);
418
+
419
+ if (styleString.length > 0) {
420
+ attributes['style'] = styleString;
421
+ }
422
+
423
+ if (transformIsMeaningful(transform)) {
424
+ var trans = transformForSvg({ transform: transform, containerWidth: main.width, iconWidth: main.width });
425
+ children.push({
426
+ tag: 'g',
427
+ attributes: _extends({}, trans.outer),
428
+ children: [{
429
+ tag: 'g',
430
+ attributes: _extends({}, trans.inner),
431
+ children: [{
432
+ tag: main.icon.tag,
433
+ children: main.icon.children,
434
+ attributes: _extends({}, main.icon.attributes, trans.path)
435
+ }]
436
+ }]
437
+ });
438
+ } else {
439
+ children.push(main.icon);
440
+ }
441
+
442
+ return {
443
+ children: children,
444
+ attributes: attributes
445
+ };
446
+ };
447
+
448
+ var asIcon = function (_ref) {
449
+ var children = _ref.children,
450
+ main = _ref.main,
451
+ mask = _ref.mask,
452
+ attributes = _ref.attributes,
453
+ styles = _ref.styles,
454
+ transform = _ref.transform;
455
+
456
+ if (transformIsMeaningful(transform) && main.found && !mask.found) {
457
+ var width = main.width,
458
+ height = main.height;
459
+
460
+ var offset = {
461
+ x: width / height / 2,
462
+ y: 0.5
463
+ };
464
+ attributes['style'] = joinStyles(_extends({}, styles, {
465
+ 'transform-origin': offset.x + transform.x / 16 + 'em ' + (offset.y + transform.y / 16) + 'em'
466
+ }));
467
+ }
468
+
469
+ return [{
470
+ tag: 'svg',
471
+ attributes: attributes,
472
+ children: children
473
+ }];
474
+ };
475
+
476
+ var asSymbol = function (_ref) {
477
+ var prefix = _ref.prefix,
478
+ iconName = _ref.iconName,
479
+ children = _ref.children,
480
+ attributes = _ref.attributes,
481
+ symbol = _ref.symbol;
482
+
483
+ var id = symbol === true ? prefix + '-' + config.familyPrefix + '-' + iconName : symbol;
484
+
485
+ return [{
486
+ tag: 'svg',
487
+ attributes: {
488
+ style: 'display: none;'
489
+ },
490
+ children: [{
491
+ tag: 'symbol',
492
+ attributes: _extends({}, attributes, { id: id }),
493
+ children: children
494
+ }]
495
+ }];
496
+ };
497
+
498
+ function makeInlineSvgAbstract(params) {
499
+ var _params$icons = params.icons,
500
+ main = _params$icons.main,
501
+ mask = _params$icons.mask,
502
+ prefix = params.prefix,
503
+ iconName = params.iconName,
504
+ transform = params.transform,
505
+ symbol = params.symbol,
506
+ title = params.title,
507
+ extra = params.extra,
508
+ _params$watchable = params.watchable,
509
+ watchable = _params$watchable === undefined ? false : _params$watchable;
510
+
511
+ var _ref = mask.found ? mask : main,
512
+ width = _ref.width,
513
+ height = _ref.height;
514
+
515
+ var widthClass = 'fa-w-' + Math.ceil(width / height * 16);
516
+ var attrClass = [config.replacementClass, iconName ? config.familyPrefix + '-' + iconName : '', widthClass].concat(extra.classes).join(' ');
517
+
518
+ var content = {
519
+ children: [],
520
+ attributes: _extends({}, extra.attributes, {
521
+ 'data-prefix': prefix,
522
+ 'data-icon': iconName,
523
+ 'class': attrClass,
524
+ 'role': 'img',
525
+ 'xmlns': 'http://www.w3.org/2000/svg',
526
+ 'viewBox': '0 0 ' + width + ' ' + height
527
+ })
528
+ };
529
+
530
+ if (watchable) {
531
+ content.attributes[DATA_FA_I2SVG] = '';
532
+ }
533
+
534
+ if (title) content.children.push({ tag: 'title', attributes: { id: content.attributes['aria-labelledby'] || 'title-' + nextUniqueId() }, children: [title] });
535
+
536
+ var args = _extends({}, content, {
537
+ prefix: prefix,
538
+ iconName: iconName,
539
+ main: main,
540
+ mask: mask,
541
+ transform: transform,
542
+ symbol: symbol,
543
+ styles: extra.styles
544
+ });
545
+
546
+ var _ref2 = mask.found && main.found ? makeIconMasking(args) : makeIconStandard(args),
547
+ children = _ref2.children,
548
+ attributes = _ref2.attributes;
549
+
550
+ args.children = children;
551
+ args.attributes = attributes;
552
+
553
+ if (symbol) {
554
+ return asSymbol(args);
555
+ } else {
556
+ return asIcon(args);
557
+ }
558
+ }
559
+
560
+ function makeLayersTextAbstract(params) {
561
+ var content = params.content,
562
+ width = params.width,
563
+ height = params.height,
564
+ transform = params.transform,
565
+ title = params.title,
566
+ extra = params.extra,
567
+ _params$watchable2 = params.watchable,
568
+ watchable = _params$watchable2 === undefined ? false : _params$watchable2;
569
+
570
+
571
+ var attributes = _extends({}, extra.attributes, title ? { 'title': title } : {}, {
572
+ 'class': extra.classes.join(' ')
573
+ });
574
+
575
+ if (watchable) {
576
+ attributes[DATA_FA_I2SVG] = '';
577
+ }
578
+
579
+ var styles = _extends({}, extra.styles);
580
+
581
+ if (transformIsMeaningful(transform)) {
582
+ styles['transform'] = transformForCss({ transform: transform, startCentered: true, width: width, height: height });
583
+ styles['-webkit-transform'] = styles['transform'];
584
+ }
585
+
586
+ var styleString = joinStyles(styles);
587
+
588
+ if (styleString.length > 0) {
589
+ attributes['style'] = styleString;
590
+ }
591
+
592
+ var val = [];
593
+
594
+ val.push({
595
+ tag: 'span',
596
+ attributes: attributes,
597
+ children: [content]
598
+ });
599
+
600
+ if (title) {
601
+ val.push({ tag: 'span', attributes: { class: 'sr-only' }, children: [title] });
602
+ }
603
+
604
+ return val;
605
+ }
606
+
607
+ var noop$2 = function noop() {};
608
+ var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : { mark: noop$2, measure: noop$2 };
609
+ var preamble = 'FA "5.0.10"';
610
+
611
+ var begin = function begin(name) {
612
+ p.mark(preamble + ' ' + name + ' begins');
613
+ return function () {
614
+ return end(name);
615
+ };
616
+ };
617
+
618
+ var end = function end(name) {
619
+ p.mark(preamble + ' ' + name + ' ends');
620
+ p.measure(preamble + ' ' + name, preamble + ' ' + name + ' begins', preamble + ' ' + name + ' ends');
621
+ };
622
+
623
+ var perf = { begin: begin, end: end };
624
+
625
+ 'use strict';
626
+
627
+ /**
628
+ * Internal helper to bind a function known to have 4 arguments
629
+ * to a given context.
630
+ */
631
+ var bindInternal4 = function bindInternal4 (func, thisContext) {
632
+ return function (a, b, c, d) {
633
+ return func.call(thisContext, a, b, c, d);
634
+ };
635
+ };
636
+
637
+ 'use strict';
638
+
639
+
640
+
641
+ /**
642
+ * # Reduce
643
+ *
644
+ * A fast object `.reduce()` implementation.
645
+ *
646
+ * @param {Object} subject The object to reduce over.
647
+ * @param {Function} fn The reducer function.
648
+ * @param {mixed} initialValue The initial value for the reducer, defaults to subject[0].
649
+ * @param {Object} thisContext The context for the reducer.
650
+ * @return {mixed} The final result.
651
+ */
652
+ var reduce = function fastReduceObject (subject, fn, initialValue, thisContext) {
653
+ var keys = Object.keys(subject),
654
+ length = keys.length,
655
+ iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
656
+ i, key, result;
657
+
658
+ if (initialValue === undefined) {
659
+ i = 1;
660
+ result = subject[keys[0]];
661
+ }
662
+ else {
663
+ i = 0;
664
+ result = initialValue;
665
+ }
666
+
667
+ for (; i < length; i++) {
668
+ key = keys[i];
669
+ result = iterator(result, subject[key], key, subject);
670
+ }
671
+
672
+ return result;
673
+ };
674
+
675
+ var styles$2 = namespace.styles;
676
+ var shims = namespace.shims;
677
+
678
+
679
+ var _byUnicode = {};
680
+ var _byLigature = {};
681
+ var _byOldName = {};
682
+
683
+ var build = function build() {
684
+ var lookup = function lookup(reducer) {
685
+ return reduce(styles$2, function (o, style, prefix) {
686
+ o[prefix] = reduce(style, reducer, {});
687
+ return o;
688
+ }, {});
689
+ };
690
+
691
+ _byUnicode = lookup(function (acc, icon, iconName) {
692
+ acc[icon[3]] = iconName;
693
+
694
+ return acc;
695
+ });
696
+
697
+ _byLigature = lookup(function (acc, icon, iconName) {
698
+ var ligatures = icon[2];
699
+
700
+ acc[iconName] = iconName;
701
+
702
+ ligatures.forEach(function (ligature) {
703
+ acc[ligature] = iconName;
704
+ });
705
+
706
+ return acc;
707
+ });
708
+
709
+ var hasRegular = 'far' in styles$2;
710
+
711
+ _byOldName = reduce(shims, function (acc, shim) {
712
+ var oldName = shim[0];
713
+ var prefix = shim[1];
714
+ var iconName = shim[2];
715
+
716
+ if (prefix === 'far' && !hasRegular) {
717
+ prefix = 'fas';
718
+ }
719
+
720
+ acc[oldName] = { prefix: prefix, iconName: iconName };
721
+
722
+ return acc;
723
+ }, {});
724
+ };
725
+
726
+ build();
727
+
728
+ function byUnicode(prefix, unicode) {
729
+ return _byUnicode[prefix][unicode];
730
+ }
731
+
732
+ function byLigature(prefix, ligature) {
733
+ return _byLigature[prefix][ligature];
734
+ }
735
+
736
+ function byOldName(name) {
737
+ return _byOldName[name] || { prefix: null, iconName: null };
738
+ }
739
+
740
+ var styles$1 = namespace.styles;
741
+
742
+
743
+ var emptyCanonicalIcon = function emptyCanonicalIcon() {
744
+ return { prefix: null, iconName: null, rest: [] };
745
+ };
746
+
747
+ function getCanonicalIcon(values) {
748
+ return values.reduce(function (acc, cls) {
749
+ var iconName = getIconName(config.familyPrefix, cls);
750
+
751
+ if (styles$1[cls]) {
752
+ acc.prefix = cls;
753
+ } else if (iconName) {
754
+ var shim = acc.prefix === 'fa' ? byOldName(iconName) : {};
755
+
756
+ acc.iconName = shim.iconName || iconName;
757
+ acc.prefix = shim.prefix || acc.prefix;
758
+ } else if (cls !== config.replacementClass && cls.indexOf('fa-w-') !== 0) {
759
+ acc.rest.push(cls);
760
+ }
761
+
762
+ return acc;
763
+ }, emptyCanonicalIcon());
764
+ }
765
+
766
+ function iconFromMapping(mapping, prefix, iconName) {
767
+ if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
768
+ return {
769
+ prefix: prefix,
770
+ iconName: iconName,
771
+ icon: mapping[prefix][iconName]
772
+ };
773
+ }
774
+ }
775
+
776
+ function toHtml(abstractNodes) {
777
+ var tag = abstractNodes.tag,
778
+ _abstractNodes$attrib = abstractNodes.attributes,
779
+ attributes = _abstractNodes$attrib === undefined ? {} : _abstractNodes$attrib,
780
+ _abstractNodes$childr = abstractNodes.children,
781
+ children = _abstractNodes$childr === undefined ? [] : _abstractNodes$childr;
782
+
783
+
784
+ if (typeof abstractNodes === 'string') {
785
+ return htmlEscape(abstractNodes);
786
+ } else {
787
+ return '<' + tag + ' ' + joinAttributes(attributes) + '>' + children.map(toHtml).join('') + '</' + tag + '>';
788
+ }
789
+ }
790
+
791
+ var noop$1 = function noop() {};
792
+
793
+ function isWatched(node) {
794
+ var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;
795
+
796
+ return typeof i2svg === 'string';
797
+ }
798
+
799
+ function getMutator() {
800
+ if (config.autoReplaceSvg === true) {
801
+ return mutators.replace;
802
+ }
803
+
804
+ var mutator = mutators[config.autoReplaceSvg];
805
+
806
+ return mutator || mutators.replace;
807
+ }
808
+
809
+ var mutators = {
810
+ replace: function replace(mutation) {
811
+ var node = mutation[0];
812
+ var abstract = mutation[1];
813
+ var newOuterHTML = abstract.map(function (a) {
814
+ return toHtml(a);
815
+ }).join('\n');
816
+
817
+ if (node.parentNode && node.outerHTML) {
818
+ node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? '<!-- ' + node.outerHTML + ' -->' : '');
819
+ } else if (node.parentNode) {
820
+ var newNode = document.createElement('span');
821
+ node.parentNode.replaceChild(newNode, node);
822
+ newNode.outerHTML = newOuterHTML;
823
+ }
824
+ },
825
+ nest: function nest(mutation) {
826
+ var node = mutation[0];
827
+ var abstract = mutation[1];
828
+
829
+ // If we already have a replaced node we do not want to continue nesting within it.
830
+ // Short-circuit to the standard replacement
831
+ if (~classArray(node).indexOf(config.replacementClass)) {
832
+ return mutators.replace(mutation);
833
+ }
834
+
835
+ var forSvg = new RegExp(config.familyPrefix + '-.*');
836
+
837
+ delete abstract[0].attributes.style;
838
+
839
+ var splitClasses = abstract[0].attributes.class.split(' ').reduce(function (acc, cls) {
840
+ if (cls === config.replacementClass || cls.match(forSvg)) {
841
+ acc.toSvg.push(cls);
842
+ } else {
843
+ acc.toNode.push(cls);
844
+ }
845
+
846
+ return acc;
847
+ }, { toNode: [], toSvg: [] });
848
+
849
+ abstract[0].attributes.class = splitClasses.toSvg.join(' ');
850
+
851
+ var newInnerHTML = abstract.map(function (a) {
852
+ return toHtml(a);
853
+ }).join('\n');
854
+ node.setAttribute('class', splitClasses.toNode.join(' '));
855
+ node.setAttribute(DATA_FA_I2SVG, '');
856
+ node.innerHTML = newInnerHTML;
857
+ }
858
+ };
859
+
860
+ function perform(mutations, callback) {
861
+ var callbackFunction = typeof callback === 'function' ? callback : noop$1;
862
+
863
+ if (mutations.length === 0) {
864
+ callbackFunction();
865
+ } else {
866
+ var frame = WINDOW.requestAnimationFrame || function (op) {
867
+ return op();
868
+ };
869
+
870
+ frame(function () {
871
+ var mutator = getMutator();
872
+ var mark = perf.begin('mutate');
873
+
874
+ mutations.map(mutator);
875
+
876
+ mark();
877
+
878
+ callbackFunction();
879
+ });
880
+ }
881
+ }
882
+
883
+ var disabled = false;
884
+
885
+ function disableObservation(operation) {
886
+ disabled = true;
887
+ operation();
888
+ disabled = false;
889
+ }
890
+
891
+ var mo = null;
892
+
893
+ function observe(options) {
894
+ if (!MUTATION_OBSERVER) return;
895
+
896
+ var treeCallback = options.treeCallback,
897
+ nodeCallback = options.nodeCallback,
898
+ pseudoElementsCallback = options.pseudoElementsCallback;
899
+
900
+
901
+ mo = new MUTATION_OBSERVER(function (objects) {
902
+ if (disabled) return;
903
+
904
+ toArray(objects).forEach(function (mutationRecord) {
905
+ if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {
906
+ if (config.searchPseudoElements) {
907
+ pseudoElementsCallback(mutationRecord.target);
908
+ }
909
+
910
+ treeCallback(mutationRecord.target);
911
+ }
912
+
913
+ if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {
914
+ pseudoElementsCallback(mutationRecord.target.parentNode);
915
+ }
916
+
917
+ if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {
918
+ if (mutationRecord.attributeName === 'class') {
919
+ var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)),
920
+ prefix = _getCanonicalIcon.prefix,
921
+ iconName = _getCanonicalIcon.iconName;
922
+
923
+ if (prefix) mutationRecord.target.setAttribute('data-prefix', prefix);
924
+ if (iconName) mutationRecord.target.setAttribute('data-icon', iconName);
925
+ } else {
926
+ nodeCallback(mutationRecord.target);
927
+ }
928
+ }
929
+ });
930
+ });
931
+
932
+ if (!IS_DOM) return;
933
+
934
+ mo.observe(DOCUMENT.getElementsByTagName('body')[0], {
935
+ childList: true, attributes: true, characterData: true, subtree: true
936
+ });
937
+ }
938
+
939
+ function disconnect() {
940
+ if (!mo) return;
941
+
942
+ mo.disconnect();
943
+ }
944
+
945
+ var styleParser = function (node) {
946
+ var style = node.getAttribute('style');
947
+
948
+ var val = [];
949
+
950
+ if (style) {
951
+ val = style.split(';').reduce(function (acc, style) {
952
+ var styles = style.split(':');
953
+ var prop = styles[0];
954
+ var value = styles.slice(1);
955
+
956
+ if (prop && value.length > 0) {
957
+ acc[prop] = value.join(':').trim();
958
+ }
959
+
960
+ return acc;
961
+ }, {});
962
+ }
963
+
964
+ return val;
965
+ };
966
+
967
+ function toHex(unicode) {
968
+ var result = '';
969
+
970
+ for (var i = 0; i < unicode.length; i++) {
971
+ var hex = unicode.charCodeAt(i).toString(16);
972
+ result += ('000' + hex).slice(-4);
973
+ }
974
+
975
+ return result;
976
+ }
977
+
978
+ var classParser = function (node) {
979
+ var existingPrefix = node.getAttribute('data-prefix');
980
+ var existingIconName = node.getAttribute('data-icon');
981
+ var innerText = node.innerText !== undefined ? node.innerText.trim() : '';
982
+
983
+ var val = getCanonicalIcon(classArray(node));
984
+
985
+ if (existingPrefix && existingIconName) {
986
+ val.prefix = existingPrefix;
987
+ val.iconName = existingIconName;
988
+ }
989
+
990
+ if (val.prefix && innerText.length > 1) {
991
+ val.iconName = byLigature(val.prefix, node.innerText);
992
+ } else if (val.prefix && innerText.length === 1) {
993
+ val.iconName = byUnicode(val.prefix, toHex(node.innerText));
994
+ }
995
+
996
+ return val;
997
+ };
998
+
999
+ var parseTransformString = function parseTransformString(transformString) {
1000
+ var transform = {
1001
+ size: 16,
1002
+ x: 0,
1003
+ y: 0,
1004
+ flipX: false,
1005
+ flipY: false,
1006
+ rotate: 0
1007
+ };
1008
+
1009
+ if (!transformString) {
1010
+ return transform;
1011
+ } else {
1012
+ return transformString.toLowerCase().split(' ').reduce(function (acc, n) {
1013
+ var parts = n.toLowerCase().split('-');
1014
+ var first = parts[0];
1015
+ var rest = parts.slice(1).join('-');
1016
+
1017
+ if (first && rest === 'h') {
1018
+ acc.flipX = true;
1019
+ return acc;
1020
+ }
1021
+
1022
+ if (first && rest === 'v') {
1023
+ acc.flipY = true;
1024
+ return acc;
1025
+ }
1026
+
1027
+ rest = parseFloat(rest);
1028
+
1029
+ if (isNaN(rest)) {
1030
+ return acc;
1031
+ }
1032
+
1033
+ switch (first) {
1034
+ case 'grow':
1035
+ acc.size = acc.size + rest;
1036
+ break;
1037
+ case 'shrink':
1038
+ acc.size = acc.size - rest;
1039
+ break;
1040
+ case 'left':
1041
+ acc.x = acc.x - rest;
1042
+ break;
1043
+ case 'right':
1044
+ acc.x = acc.x + rest;
1045
+ break;
1046
+ case 'up':
1047
+ acc.y = acc.y - rest;
1048
+ break;
1049
+ case 'down':
1050
+ acc.y = acc.y + rest;
1051
+ break;
1052
+ case 'rotate':
1053
+ acc.rotate = acc.rotate + rest;
1054
+ break;
1055
+ }
1056
+
1057
+ return acc;
1058
+ }, transform);
1059
+ }
1060
+ };
1061
+
1062
+ var transformParser = function (node) {
1063
+ return parseTransformString(node.getAttribute('data-fa-transform'));
1064
+ };
1065
+
1066
+ var symbolParser = function (node) {
1067
+ var symbol = node.getAttribute('data-fa-symbol');
1068
+
1069
+ return symbol === null ? false : symbol === '' ? true : symbol;
1070
+ };
1071
+
1072
+ var attributesParser = function (node) {
1073
+ var extraAttributes = toArray(node.attributes).reduce(function (acc, attr) {
1074
+ if (acc.name !== 'class' && acc.name !== 'style') {
1075
+ acc[attr.name] = attr.value;
1076
+ }
1077
+ return acc;
1078
+ }, {});
1079
+
1080
+ var title = node.getAttribute('title');
1081
+
1082
+ if (config.autoA11y) {
1083
+ if (title) {
1084
+ extraAttributes['aria-labelledby'] = config.replacementClass + '-title-' + nextUniqueId();
1085
+ } else {
1086
+ extraAttributes['aria-hidden'] = 'true';
1087
+ }
1088
+ }
1089
+
1090
+ return extraAttributes;
1091
+ };
1092
+
1093
+ var maskParser = function (node) {
1094
+ var mask = node.getAttribute('data-fa-mask');
1095
+
1096
+ if (!mask) {
1097
+ return emptyCanonicalIcon();
1098
+ } else {
1099
+ return getCanonicalIcon(mask.split(' ').map(function (i) {
1100
+ return i.trim();
1101
+ }));
1102
+ }
1103
+ };
1104
+
1105
+ function parseMeta(node) {
1106
+ var _classParser = classParser(node),
1107
+ iconName = _classParser.iconName,
1108
+ prefix = _classParser.prefix,
1109
+ extraClasses = _classParser.rest;
1110
+
1111
+ var extraStyles = styleParser(node);
1112
+ var transform = transformParser(node);
1113
+ var symbol = symbolParser(node);
1114
+ var extraAttributes = attributesParser(node);
1115
+ var mask = maskParser(node);
1116
+
1117
+ return {
1118
+ iconName: iconName,
1119
+ title: node.getAttribute('title'),
1120
+ prefix: prefix,
1121
+ transform: transform,
1122
+ symbol: symbol,
1123
+ mask: mask,
1124
+ extra: {
1125
+ classes: extraClasses,
1126
+ styles: extraStyles,
1127
+ attributes: extraAttributes
1128
+ }
1129
+ };
1130
+ }
1131
+
1132
+ function MissingIcon(error) {
1133
+ this.name = 'MissingIcon';
1134
+ this.message = error || 'Icon unavailable';
1135
+ this.stack = new Error().stack;
1136
+ }
1137
+
1138
+ MissingIcon.prototype = Object.create(Error.prototype);
1139
+ MissingIcon.prototype.constructor = MissingIcon;
1140
+
1141
+ var FILL = { fill: 'currentColor' };
1142
+ var ANIMATION_BASE = {
1143
+ attributeType: 'XML',
1144
+ repeatCount: 'indefinite',
1145
+ dur: '2s'
1146
+ };
1147
+ var RING = {
1148
+ tag: 'path',
1149
+ attributes: _extends({}, FILL, {
1150
+ 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'
1151
+ })
1152
+ };
1153
+ var OPACITY_ANIMATE = _extends({}, ANIMATION_BASE, {
1154
+ attributeName: 'opacity'
1155
+ });
1156
+ var DOT = {
1157
+ tag: 'circle',
1158
+ attributes: _extends({}, FILL, {
1159
+ cx: '256',
1160
+ cy: '364',
1161
+ r: '28'
1162
+ }),
1163
+ children: [{ tag: 'animate', attributes: _extends({}, ANIMATION_BASE, { attributeName: 'r', values: '28;14;28;28;14;28;' }) }, { tag: 'animate', attributes: _extends({}, OPACITY_ANIMATE, { values: '1;0;1;1;0;1;' }) }]
1164
+ };
1165
+ var QUESTION = {
1166
+ tag: 'path',
1167
+ attributes: _extends({}, FILL, {
1168
+ opacity: '1',
1169
+ 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'
1170
+ }),
1171
+ children: [{ tag: 'animate', attributes: _extends({}, OPACITY_ANIMATE, { values: '1;0;0;0;0;1;' }) }]
1172
+ };
1173
+ var EXCLAMATION = {
1174
+ tag: 'path',
1175
+ attributes: _extends({}, FILL, {
1176
+ opacity: '0',
1177
+ 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'
1178
+ }),
1179
+ children: [{ tag: 'animate', attributes: _extends({}, OPACITY_ANIMATE, { values: '0;0;1;1;0;0;' }) }]
1180
+ };
1181
+
1182
+ var missing = { tag: 'g', children: [RING, DOT, QUESTION, EXCLAMATION] };
1183
+
1184
+ var styles = namespace.styles;
1185
+
1186
+ var LAYERS_TEXT_CLASSNAME = 'fa-layers-text';
1187
+ var FONT_FAMILY_PATTERN = /Font Awesome 5 (Solid|Regular|Light|Brands)/;
1188
+ var STYLE_TO_PREFIX = {
1189
+ 'Solid': 'fas',
1190
+ 'Regular': 'far',
1191
+ 'Light': 'fal',
1192
+ 'Brands': 'fab'
1193
+ };
1194
+
1195
+ function findIcon(iconName, prefix) {
1196
+ var val = {
1197
+ found: false,
1198
+ width: 512,
1199
+ height: 512,
1200
+ icon: missing
1201
+ };
1202
+
1203
+ if (iconName && prefix && styles[prefix] && styles[prefix][iconName]) {
1204
+ var icon = styles[prefix][iconName];
1205
+ var width = icon[0];
1206
+ var height = icon[1];
1207
+ var vectorData = icon.slice(4);
1208
+
1209
+ val = {
1210
+ found: true,
1211
+ width: width,
1212
+ height: height,
1213
+ icon: { tag: 'path', attributes: { fill: 'currentColor', d: vectorData[0] } }
1214
+ };
1215
+ } else if (iconName && prefix && !config.showMissingIcons) {
1216
+ throw new MissingIcon('Icon is missing for prefix ' + prefix + ' with icon name ' + iconName);
1217
+ }
1218
+
1219
+ return val;
1220
+ }
1221
+
1222
+ function generateSvgReplacementMutation(node, nodeMeta) {
1223
+ var iconName = nodeMeta.iconName,
1224
+ title = nodeMeta.title,
1225
+ prefix = nodeMeta.prefix,
1226
+ transform = nodeMeta.transform,
1227
+ symbol = nodeMeta.symbol,
1228
+ mask = nodeMeta.mask,
1229
+ extra = nodeMeta.extra;
1230
+
1231
+
1232
+ return [node, makeInlineSvgAbstract({
1233
+ icons: {
1234
+ main: findIcon(iconName, prefix),
1235
+ mask: findIcon(mask.iconName, mask.prefix)
1236
+ },
1237
+ prefix: prefix,
1238
+ iconName: iconName,
1239
+ transform: transform,
1240
+ symbol: symbol,
1241
+ mask: mask,
1242
+ title: title,
1243
+ extra: extra,
1244
+ watchable: true
1245
+ })];
1246
+ }
1247
+
1248
+ function generateLayersText(node, nodeMeta) {
1249
+ var title = nodeMeta.title,
1250
+ transform = nodeMeta.transform,
1251
+ extra = nodeMeta.extra;
1252
+
1253
+
1254
+ var width = null;
1255
+ var height = null;
1256
+
1257
+ if (IS_IE) {
1258
+ var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
1259
+ var boundingClientRect = node.getBoundingClientRect();
1260
+ width = boundingClientRect.width / computedFontSize;
1261
+ height = boundingClientRect.height / computedFontSize;
1262
+ }
1263
+
1264
+ if (config.autoA11y && !title) {
1265
+ extra.attributes['aria-hidden'] = 'true';
1266
+ }
1267
+
1268
+ return [node, makeLayersTextAbstract({
1269
+ content: node.innerHTML,
1270
+ width: width,
1271
+ height: height,
1272
+ transform: transform,
1273
+ title: title,
1274
+ extra: extra,
1275
+ watchable: true
1276
+ })];
1277
+ }
1278
+
1279
+ function generateMutation(node) {
1280
+ var nodeMeta = parseMeta(node);
1281
+
1282
+ if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {
1283
+ return generateLayersText(node, nodeMeta);
1284
+ } else {
1285
+ return generateSvgReplacementMutation(node, nodeMeta);
1286
+ }
1287
+ }
1288
+
1289
+ function remove(node) {
1290
+ if (typeof node.remove === 'function') {
1291
+ node.remove();
1292
+ } else if (node && node.parentNode) {
1293
+ node.parentNode.removeChild(node);
1294
+ }
1295
+ }
1296
+
1297
+ function searchPseudoElements(root) {
1298
+ if (!IS_DOM) return;
1299
+
1300
+ var end = perf.begin('searchPseudoElements');
1301
+
1302
+ disableObservation(function () {
1303
+ toArray(root.querySelectorAll('*')).forEach(function (node) {
1304
+ [':before', ':after'].forEach(function (pos) {
1305
+ var styles = WINDOW.getComputedStyle(node, pos);
1306
+ var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);
1307
+ var children = toArray(node.children);
1308
+ var pseudoElement = children.filter(function (c) {
1309
+ return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === pos;
1310
+ })[0];
1311
+
1312
+ if (pseudoElement) {
1313
+ if (pseudoElement.nextSibling && pseudoElement.nextSibling.textContent.indexOf(DATA_FA_PSEUDO_ELEMENT) > -1) {
1314
+ remove(pseudoElement.nextSibling);
1315
+ }
1316
+ remove(pseudoElement);
1317
+ pseudoElement = null;
1318
+ }
1319
+
1320
+ if (fontFamily && !pseudoElement) {
1321
+ var content = styles.getPropertyValue('content');
1322
+ var i = DOCUMENT.createElement('i');
1323
+ i.setAttribute('class', '' + STYLE_TO_PREFIX[fontFamily[1]]);
1324
+ i.setAttribute(DATA_FA_PSEUDO_ELEMENT, pos);
1325
+ i.innerText = content.length === 3 ? content.substr(1, 1) : content;
1326
+ if (pos === ':before') {
1327
+ node.insertBefore(i, node.firstChild);
1328
+ } else {
1329
+ node.appendChild(i);
1330
+ }
1331
+ }
1332
+ });
1333
+ });
1334
+ });
1335
+
1336
+ end();
1337
+ }
1338
+
1339
+ function onTree(root) {
1340
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1341
+
1342
+ if (!IS_DOM) return;
1343
+
1344
+ var htmlClassList = DOCUMENT.documentElement.classList;
1345
+ var hclAdd = function hclAdd(suffix) {
1346
+ return htmlClassList.add(HTML_CLASS_I2SVG_BASE_CLASS + '-' + suffix);
1347
+ };
1348
+ var hclRemove = function hclRemove(suffix) {
1349
+ return htmlClassList.remove(HTML_CLASS_I2SVG_BASE_CLASS + '-' + suffix);
1350
+ };
1351
+ var prefixes = Object.keys(styles);
1352
+ var prefixesDomQuery = ['.' + LAYERS_TEXT_CLASSNAME + ':not([' + DATA_FA_I2SVG + '])'].concat(prefixes.map(function (p) {
1353
+ return '.' + p + ':not([' + DATA_FA_I2SVG + '])';
1354
+ })).join(', ');
1355
+
1356
+ if (prefixesDomQuery.length === 0) {
1357
+ return;
1358
+ }
1359
+
1360
+ var candidates = toArray(root.querySelectorAll(prefixesDomQuery));
1361
+
1362
+ if (candidates.length > 0) {
1363
+ hclAdd('pending');
1364
+ hclRemove('complete');
1365
+ } else {
1366
+ return;
1367
+ }
1368
+
1369
+ var mark = perf.begin('onTree');
1370
+
1371
+ var mutations = candidates.reduce(function (acc, node) {
1372
+ try {
1373
+ var mutation = generateMutation(node);
1374
+
1375
+ if (mutation) {
1376
+ acc.push(mutation);
1377
+ }
1378
+ } catch (e) {
1379
+ if (!PRODUCTION) {
1380
+ if (e instanceof MissingIcon) {
1381
+ console.error(e);
1382
+ }
1383
+ }
1384
+ }
1385
+
1386
+ return acc;
1387
+ }, []);
1388
+
1389
+ mark();
1390
+
1391
+ perform(mutations, function () {
1392
+ hclAdd('active');
1393
+ hclAdd('complete');
1394
+ hclRemove('pending');
1395
+
1396
+ if (typeof callback === 'function') callback();
1397
+ });
1398
+ }
1399
+
1400
+ function onNode(node) {
1401
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1402
+
1403
+ var mutation = generateMutation(node);
1404
+
1405
+ if (mutation) {
1406
+ perform([mutation], callback);
1407
+ }
1408
+ }
1409
+
1410
+ var baseStyles = "svg:not(:root).svg-inline--fa{overflow:visible}.svg-inline--fa{display:inline-block;font-size:inherit;height:1em;overflow:visible;vertical-align:-.125em}.svg-inline--fa.fa-lg{vertical-align:-.225em}.svg-inline--fa.fa-w-1{width:.0625em}.svg-inline--fa.fa-w-2{width:.125em}.svg-inline--fa.fa-w-3{width:.1875em}.svg-inline--fa.fa-w-4{width:.25em}.svg-inline--fa.fa-w-5{width:.3125em}.svg-inline--fa.fa-w-6{width:.375em}.svg-inline--fa.fa-w-7{width:.4375em}.svg-inline--fa.fa-w-8{width:.5em}.svg-inline--fa.fa-w-9{width:.5625em}.svg-inline--fa.fa-w-10{width:.625em}.svg-inline--fa.fa-w-11{width:.6875em}.svg-inline--fa.fa-w-12{width:.75em}.svg-inline--fa.fa-w-13{width:.8125em}.svg-inline--fa.fa-w-14{width:.875em}.svg-inline--fa.fa-w-15{width:.9375em}.svg-inline--fa.fa-w-16{width:1em}.svg-inline--fa.fa-w-17{width:1.0625em}.svg-inline--fa.fa-w-18{width:1.125em}.svg-inline--fa.fa-w-19{width:1.1875em}.svg-inline--fa.fa-w-20{width:1.25em}.svg-inline--fa.fa-pull-left{margin-right:.3em;width:auto}.svg-inline--fa.fa-pull-right{margin-left:.3em;width:auto}.svg-inline--fa.fa-border{height:1.5em}.svg-inline--fa.fa-li{width:2em}.svg-inline--fa.fa-fw{width:1.25em}.fa-layers svg.svg-inline--fa{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.fa-layers{display:inline-block;height:1em;position:relative;text-align:center;vertical-align:-.125em;width:1em}.fa-layers svg.svg-inline--fa{-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter,.fa-layers-text{display:inline-block;position:absolute;text-align:center}.fa-layers-text{left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter{background-color:#ff253a;border-radius:1em;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;height:1.5em;line-height:1;max-width:5em;min-width:1.5em;overflow:hidden;padding:.25em;right:0;text-overflow:ellipsis;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-bottom-right{bottom:0;right:0;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom right;transform-origin:bottom right}.fa-layers-bottom-left{bottom:0;left:0;right:auto;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom left;transform-origin:bottom left}.fa-layers-top-right{right:0;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-top-left{left:0;right:auto;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top left;transform-origin:top left}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;position:relative;width:2em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.svg-inline--fa.fa-stack-1x{height:1em;width:1em}.svg-inline--fa.fa-stack-2x{height:2em;width:2em}.fa-inverse{color:#fff}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}";
1411
+
1412
+ var css = function () {
1413
+ var dfp = DEFAULT_FAMILY_PREFIX;
1414
+ var drc = DEFAULT_REPLACEMENT_CLASS;
1415
+ var fp = config.familyPrefix;
1416
+ var rc = config.replacementClass;
1417
+ var s = baseStyles;
1418
+
1419
+ if (fp !== dfp || rc !== drc) {
1420
+ var dPatt = new RegExp('\\.' + dfp + '\\-', 'g');
1421
+ var rPatt = new RegExp('\\.' + drc, 'g');
1422
+
1423
+ s = s.replace(dPatt, '.' + fp + '-').replace(rPatt, '.' + rc);
1424
+ }
1425
+
1426
+ return s;
1427
+ };
1428
+
1429
+ function define(prefix, icons) {
1430
+ var normalized = Object.keys(icons).reduce(function (acc, iconName) {
1431
+ var icon = icons[iconName];
1432
+ var expanded = !!icon.icon;
1433
+
1434
+ if (expanded) {
1435
+ acc[icon.iconName] = icon.icon;
1436
+ } else {
1437
+ acc[iconName] = icon;
1438
+ }
1439
+ return acc;
1440
+ }, {});
1441
+
1442
+ if (typeof namespace.hooks.addPack === 'function') {
1443
+ namespace.hooks.addPack(prefix, normalized);
1444
+ } else {
1445
+ namespace.styles[prefix] = _extends({}, namespace.styles[prefix] || {}, normalized);
1446
+ }
1447
+
1448
+ /**
1449
+ * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction
1450
+ * of new styles we needed to differentiate between them. Prefix `fa` is now an alias
1451
+ * for `fas` so we'll easy the upgrade process for our users by automatically defining
1452
+ * this as well.
1453
+ */
1454
+ if (prefix === 'fas') {
1455
+ define('fa', icons);
1456
+ }
1457
+ }
1458
+
1459
+ var Library = function () {
1460
+ function Library() {
1461
+ classCallCheck(this, Library);
1462
+
1463
+ this.definitions = {};
1464
+ }
1465
+
1466
+ createClass(Library, [{
1467
+ key: 'add',
1468
+ value: function add() {
1469
+ var _this = this;
1470
+
1471
+ for (var _len = arguments.length, definitions = Array(_len), _key = 0; _key < _len; _key++) {
1472
+ definitions[_key] = arguments[_key];
1473
+ }
1474
+
1475
+ var additions = definitions.reduce(this._pullDefinitions, {});
1476
+
1477
+ Object.keys(additions).forEach(function (key) {
1478
+ _this.definitions[key] = _extends({}, _this.definitions[key] || {}, additions[key]);
1479
+ define(key, additions[key]);
1480
+ });
1481
+ }
1482
+ }, {
1483
+ key: 'reset',
1484
+ value: function reset() {
1485
+ this.definitions = {};
1486
+ }
1487
+ }, {
1488
+ key: '_pullDefinitions',
1489
+ value: function _pullDefinitions(additions, definition) {
1490
+ var normalized = definition.prefix && definition.iconName && definition.icon ? { 0: definition } : definition;
1491
+
1492
+ Object.keys(normalized).map(function (key) {
1493
+ var _normalized$key = normalized[key],
1494
+ prefix = _normalized$key.prefix,
1495
+ iconName = _normalized$key.iconName,
1496
+ icon = _normalized$key.icon;
1497
+
1498
+
1499
+ if (!additions[prefix]) additions[prefix] = {};
1500
+
1501
+ additions[prefix][iconName] = icon;
1502
+ });
1503
+
1504
+ return additions;
1505
+ }
1506
+ }]);
1507
+ return Library;
1508
+ }();
1509
+
1510
+ function prepIcon(icon) {
1511
+ var width = icon[0];
1512
+ var height = icon[1];
1513
+ var vectorData = icon.slice(4);
1514
+
1515
+ return {
1516
+ found: true,
1517
+ width: width,
1518
+ height: height,
1519
+ icon: { tag: 'path', attributes: { fill: 'currentColor', d: vectorData[0] } }
1520
+ };
1521
+ }
1522
+
1523
+ var _cssInserted = false;
1524
+
1525
+ function ensureCss() {
1526
+ if (!config.autoAddCss) {
1527
+ return;
1528
+ }
1529
+
1530
+ if (!_cssInserted) {
1531
+ insertCss(css());
1532
+ }
1533
+
1534
+ _cssInserted = true;
1535
+ }
1536
+
1537
+ function apiObject(val, abstractCreator) {
1538
+ Object.defineProperty(val, 'abstract', {
1539
+ get: abstractCreator
1540
+ });
1541
+
1542
+ Object.defineProperty(val, 'html', {
1543
+ get: function get() {
1544
+ return val.abstract.map(function (a) {
1545
+ return toHtml(a);
1546
+ });
1547
+ }
1548
+ });
1549
+
1550
+ Object.defineProperty(val, 'node', {
1551
+ get: function get() {
1552
+ if (!IS_DOM) return;
1553
+
1554
+ var container = DOCUMENT.createElement('div');
1555
+ container.innerHTML = val.html;
1556
+ return container.children;
1557
+ }
1558
+ });
1559
+
1560
+ return val;
1561
+ }
1562
+
1563
+ function findIconDefinition(params) {
1564
+ var _params$prefix = params.prefix,
1565
+ prefix = _params$prefix === undefined ? 'fa' : _params$prefix,
1566
+ iconName = params.iconName;
1567
+
1568
+
1569
+ if (!iconName) return;
1570
+
1571
+ return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);
1572
+ }
1573
+
1574
+ function resolveIcons(next) {
1575
+ return function (maybeIconDefinition) {
1576
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1577
+
1578
+ var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});
1579
+
1580
+ var mask = params.mask;
1581
+
1582
+
1583
+ if (mask) {
1584
+ mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
1585
+ }
1586
+
1587
+ return next(iconDefinition, _extends({}, params, { mask: mask }));
1588
+ };
1589
+ }
1590
+
1591
+ var library = new Library();
1592
+
1593
+ var noAuto = function noAuto() {
1594
+ auto(false);
1595
+ disconnect();
1596
+ };
1597
+
1598
+ var dom = {
1599
+ i2svg: function i2svg() {
1600
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1601
+
1602
+ if (IS_DOM) {
1603
+ ensureCss();
1604
+
1605
+ var _params$node = params.node,
1606
+ node = _params$node === undefined ? DOCUMENT : _params$node,
1607
+ _params$callback = params.callback,
1608
+ callback = _params$callback === undefined ? function () {} : _params$callback;
1609
+
1610
+
1611
+ if (config.searchPseudoElements) {
1612
+ searchPseudoElements(node);
1613
+ }
1614
+
1615
+ onTree(node, callback);
1616
+ }
1617
+ },
1618
+
1619
+ css: css,
1620
+
1621
+ insertCss: function insertCss$$1() {
1622
+ insertCss(css());
1623
+ }
1624
+ };
1625
+
1626
+ var parse = {
1627
+ transform: function transform(transformString) {
1628
+ return parseTransformString(transformString);
1629
+ }
1630
+ };
1631
+
1632
+ var icon = resolveIcons(function (iconDefinition) {
1633
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1634
+ var _params$transform = params.transform,
1635
+ transform = _params$transform === undefined ? meaninglessTransform : _params$transform,
1636
+ _params$symbol = params.symbol,
1637
+ symbol = _params$symbol === undefined ? false : _params$symbol,
1638
+ _params$mask = params.mask,
1639
+ mask = _params$mask === undefined ? null : _params$mask,
1640
+ _params$title = params.title,
1641
+ title = _params$title === undefined ? null : _params$title,
1642
+ _params$classes = params.classes,
1643
+ classes = _params$classes === undefined ? [] : _params$classes,
1644
+ _params$attributes = params.attributes,
1645
+ attributes = _params$attributes === undefined ? {} : _params$attributes,
1646
+ _params$styles = params.styles,
1647
+ styles = _params$styles === undefined ? {} : _params$styles;
1648
+
1649
+
1650
+ if (!iconDefinition) return;
1651
+
1652
+ var prefix = iconDefinition.prefix,
1653
+ iconName = iconDefinition.iconName,
1654
+ icon = iconDefinition.icon;
1655
+
1656
+
1657
+ return apiObject(_extends({ type: 'icon' }, iconDefinition), function () {
1658
+ ensureCss();
1659
+
1660
+ if (config.autoA11y) {
1661
+ if (title) {
1662
+ attributes['aria-labelledby'] = config.replacementClass + '-title-' + nextUniqueId();
1663
+ } else {
1664
+ attributes['aria-hidden'] = 'true';
1665
+ }
1666
+ }
1667
+
1668
+ return makeInlineSvgAbstract({
1669
+ icons: {
1670
+ main: prepIcon(icon),
1671
+ mask: mask ? prepIcon(mask.icon) : { found: false, width: null, height: null, icon: {} }
1672
+ },
1673
+ prefix: prefix,
1674
+ iconName: iconName,
1675
+ transform: _extends({}, meaninglessTransform, transform),
1676
+ symbol: symbol,
1677
+ title: title,
1678
+ extra: {
1679
+ attributes: attributes,
1680
+ styles: styles,
1681
+ classes: classes
1682
+ }
1683
+ });
1684
+ });
1685
+ });
1686
+
1687
+ var text = function text(content) {
1688
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1689
+ var _params$transform2 = params.transform,
1690
+ transform = _params$transform2 === undefined ? meaninglessTransform : _params$transform2,
1691
+ _params$title2 = params.title,
1692
+ title = _params$title2 === undefined ? null : _params$title2,
1693
+ _params$classes2 = params.classes,
1694
+ classes = _params$classes2 === undefined ? [] : _params$classes2,
1695
+ _params$attributes2 = params.attributes,
1696
+ attributes = _params$attributes2 === undefined ? {} : _params$attributes2,
1697
+ _params$styles2 = params.styles,
1698
+ styles = _params$styles2 === undefined ? {} : _params$styles2;
1699
+
1700
+
1701
+ return apiObject({ type: 'text', content: content }, function () {
1702
+ ensureCss();
1703
+
1704
+ return makeLayersTextAbstract({
1705
+ content: content,
1706
+ transform: _extends({}, meaninglessTransform, transform),
1707
+ title: title,
1708
+ extra: {
1709
+ attributes: attributes,
1710
+ styles: styles,
1711
+ classes: [config.familyPrefix + '-layers-text'].concat(toConsumableArray(classes))
1712
+ }
1713
+ });
1714
+ });
1715
+ };
1716
+
1717
+ var layer = function layer(assembler) {
1718
+ return apiObject({ type: 'layer' }, function () {
1719
+ ensureCss();
1720
+
1721
+ var children = [];
1722
+
1723
+ assembler(function (args) {
1724
+ Array.isArray(args) ? args.map(function (a) {
1725
+ children = children.concat(a.abstract);
1726
+ }) : children = children.concat(args.abstract);
1727
+ });
1728
+
1729
+ return [{
1730
+ tag: 'span',
1731
+ attributes: { class: config.familyPrefix + '-layers' },
1732
+ children: children
1733
+ }];
1734
+ });
1735
+ };
1736
+
1737
+ var api = {
1738
+ noAuto: noAuto,
1739
+ dom: dom,
1740
+ library: library,
1741
+ parse: parse,
1742
+ findIconDefinition: findIconDefinition,
1743
+ icon: icon,
1744
+ text: text,
1745
+ layer: layer
1746
+ };
1747
+
1748
+ var autoReplace = function autoReplace() {
1749
+ if (IS_DOM && config.autoReplaceSvg) api.dom.i2svg({ node: DOCUMENT });
1750
+ };
1751
+
1752
+ function bootstrap() {
1753
+ if (IS_BROWSER) {
1754
+ if (!WINDOW.FontAwesome) {
1755
+ WINDOW.FontAwesome = api;
1756
+ }
1757
+
1758
+ domready(function () {
1759
+ if (Object.keys(namespace.styles).length > 0) {
1760
+ autoReplace();
1761
+ }
1762
+
1763
+ if (config.observeMutations && typeof MutationObserver === 'function') {
1764
+ observe({
1765
+ treeCallback: onTree,
1766
+ nodeCallback: onNode,
1767
+ pseudoElementsCallback: searchPseudoElements
1768
+ });
1769
+ }
1770
+ });
1771
+ }
1772
+
1773
+ namespace.hooks = _extends({}, namespace.hooks, {
1774
+
1775
+ addPack: function addPack(prefix, icons) {
1776
+ namespace.styles[prefix] = _extends({}, namespace.styles[prefix] || {}, icons);
1777
+
1778
+ build();
1779
+ autoReplace();
1780
+ },
1781
+
1782
+ addShims: function addShims(shims) {
1783
+ var _namespace$shims;
1784
+
1785
+ (_namespace$shims = namespace.shims).push.apply(_namespace$shims, toConsumableArray(shims));
1786
+
1787
+ build();
1788
+ autoReplace();
1789
+ }
1790
+ });
1791
+ }
1792
+
1793
+ Object.defineProperty(api, 'config', {
1794
+ get: function get() {
1795
+ return config;
1796
+ },
1797
+
1798
+ set: function set(newConfig) {
1799
+ update(newConfig);
1800
+ }
1801
+ });
1802
+
1803
+ bunker(bootstrap);
1804
+
1805
+ }());