8
function _typeof(obj) {
9
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
10
_typeof = function (obj) {
14
_typeof = function (obj) {
15
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
22
function _classCallCheck(instance, Constructor) {
23
if (!(instance instanceof Constructor)) {
24
throw new TypeError("Cannot call a class as a function");
28
function _defineProperties(target, props) {
29
for (var i = 0; i < props.length; i++) {
30
var descriptor = props[i];
31
descriptor.enumerable = descriptor.enumerable || false;
32
descriptor.configurable = true;
33
if ("value" in descriptor) descriptor.writable = true;
34
Object.defineProperty(target, descriptor.key, descriptor);
38
function _createClass(Constructor, protoProps, staticProps) {
39
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
40
if (staticProps) _defineProperties(Constructor, staticProps);
44
function _defineProperty(obj, key, value) {
46
Object.defineProperty(obj, key, {
59
function _objectSpread(target) {
60
for (var i = 1; i < arguments.length; i++) {
61
var source = arguments[i] != null ? arguments[i] : {};
62
var ownKeys = Object.keys(source);
64
if (typeof Object.getOwnPropertySymbols === 'function') {
65
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
66
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
70
ownKeys.forEach(function (key) {
71
_defineProperty(target, key, source[key]);
78
function _slicedToArray(arr, i) {
79
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
82
function _toConsumableArray(arr) {
83
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
86
function _arrayWithoutHoles(arr) {
87
if (Array.isArray(arr)) {
88
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
94
function _arrayWithHoles(arr) {
95
if (Array.isArray(arr)) return arr;
98
function _iterableToArray(iter) {
99
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
102
function _iterableToArrayLimit(arr, i) {
109
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
112
if (i && _arr.length === i) break;
119
if (!_n && _i["return"] != null) _i["return"]();
128
function _nonIterableSpread() {
129
throw new TypeError("Invalid attempt to spread non-iterable instance");
132
function _nonIterableRest() {
133
throw new TypeError("Invalid attempt to destructure non-iterable instance");
136
var noop = function noop() {};
140
var _MUTATION_OBSERVER = null;
147
if (typeof window !== 'undefined') _WINDOW = window;
148
if (typeof document !== 'undefined') _DOCUMENT = document;
149
if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;
150
if (typeof performance !== 'undefined') _PERFORMANCE = performance;
153
var _ref = _WINDOW.navigator || {},
154
_ref$userAgent = _ref.userAgent,
155
userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;
157
var WINDOW = _WINDOW;
158
var DOCUMENT = _DOCUMENT;
159
var MUTATION_OBSERVER = _MUTATION_OBSERVER;
160
var PERFORMANCE = _PERFORMANCE;
161
var IS_BROWSER = !!WINDOW.document;
162
var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
163
var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
165
var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
166
var UNITS_IN_GRID = 16;
167
var DEFAULT_FAMILY_PREFIX = 'fa';
168
var DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
169
var DATA_FA_I2SVG = 'data-fa-i2svg';
170
var DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';
171
var DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';
172
var DATA_PREFIX = 'data-prefix';
173
var DATA_ICON = 'data-icon';
174
var HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';
175
var MUTATION_APPROACH_ASYNC = 'async';
176
var TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];
177
var PRODUCTION = function () {
179
return undefined === 'production';
184
var PREFIX_TO_STYLE = {
193
var STYLE_TO_PREFIX = {
201
var LAYERS_TEXT_CLASSNAME = 'fa-layers-text';
202
var FONT_FAMILY_PATTERN = /Font Awesome ([5 ]*)(Solid|Regular|Light|Duotone|Brands|Free|Pro|Kit).*/i;
204
var FONT_WEIGHT_TO_PREFIX = {
210
var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
211
var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
212
var ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];
213
var DUOTONE_CLASSES = {
215
SWAP_OPACITY: 'swap-opacity',
217
SECONDARY: 'secondary'
219
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', 'flip-both', 'stack', 'stack-1x', 'stack-2x', 'inverse', 'layers', 'layers-text', 'layers-counter', DUOTONE_CLASSES.GROUP, DUOTONE_CLASSES.SWAP_OPACITY, DUOTONE_CLASSES.PRIMARY, DUOTONE_CLASSES.SECONDARY].concat(oneToTen.map(function (n) {
220
return "".concat(n, "x");
221
})).concat(oneToTwenty.map(function (n) {
222
return "w-".concat(n);
225
var initial = WINDOW.FontAwesomeConfig || {};
227
function getAttrConfig(attr) {
228
var element = DOCUMENT.querySelector('script[' + attr + ']');
231
return element.getAttribute(attr);
235
function coerce(val) {
239
if (val === '') return true;
240
if (val === 'false') return false;
241
if (val === 'true') return true;
245
if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {
246
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']];
247
attrs.forEach(function (_ref) {
248
var _ref2 = _slicedToArray(_ref, 2),
252
var val = coerce(getAttrConfig(attr));
254
if (val !== undefined && val !== null) {
261
familyPrefix: DEFAULT_FAMILY_PREFIX,
262
replacementClass: DEFAULT_REPLACEMENT_CLASS,
263
autoReplaceSvg: true,
266
searchPseudoElements: false,
267
observeMutations: true,
268
mutateApproach: 'async',
269
keepOriginalSource: true,
270
measurePerformance: false,
271
showMissingIcons: true
274
var _config = _objectSpread({}, _default, initial);
276
if (!_config.autoReplaceSvg) _config.observeMutations = false;
278
var config = _objectSpread({}, _config);
280
WINDOW.FontAwesomeConfig = config;
282
var w = WINDOW || {};
283
if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};
284
if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};
285
if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};
286
if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];
287
var namespace = w[NAMESPACE_IDENTIFIER];
291
var listener = function listener() {
292
DOCUMENT.removeEventListener('DOMContentLoaded', listener);
294
functions.map(function (fn) {
302
loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
303
if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
306
function domready (fn) {
308
loaded ? setTimeout(fn, 0) : functions.push(fn);
311
var PENDING = 'pending';
312
var SETTLED = 'settled';
313
var FULFILLED = 'fulfilled';
314
var REJECTED = 'rejected';
316
var NOOP = function NOOP() {};
318
var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';
319
var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
323
function asyncFlush() {
325
for (var i = 0; i < asyncQueue.length; i++) {
326
asyncQueue[i][0](asyncQueue[i][1]);
334
function asyncCall(callback, arg) {
335
asyncQueue.push([callback, arg]);
339
asyncSetTimer(asyncFlush, 0);
343
function invokeResolver(resolver, promise) {
344
function resolvePromise(value) {
345
resolve(promise, value);
348
function rejectPromise(reason) {
349
reject(promise, reason);
353
resolver(resolvePromise, rejectPromise);
359
function invokeCallback(subscriber) {
360
var owner = subscriber.owner;
361
var settled = owner._state;
362
var value = owner._data;
363
var callback = subscriber[settled];
364
var promise = subscriber.then;
366
if (typeof callback === 'function') {
370
value = callback(value);
376
if (!handleThenable(promise, value)) {
377
if (settled === FULFILLED) {
378
resolve(promise, value);
381
if (settled === REJECTED) {
382
reject(promise, value);
387
function handleThenable(promise, value) {
391
if (promise === value) {
392
throw new TypeError('A promises callback cannot return that same promise.');
395
if (value && (typeof value === 'function' || _typeof(value) === 'object')) {
397
var then = value.then;
399
if (typeof then === 'function') {
400
then.call(value, function (val) {
405
fulfill(promise, val);
407
resolve(promise, val);
410
}, function (reason) {
413
reject(promise, reason);
430
function resolve(promise, value) {
431
if (promise === value || !handleThenable(promise, value)) {
432
fulfill(promise, value);
436
function fulfill(promise, value) {
437
if (promise._state === PENDING) {
438
promise._state = SETTLED;
439
promise._data = value;
440
asyncCall(publishFulfillment, promise);
444
function reject(promise, reason) {
445
if (promise._state === PENDING) {
446
promise._state = SETTLED;
447
promise._data = reason;
448
asyncCall(publishRejection, promise);
452
function publish(promise) {
453
promise._then = promise._then.forEach(invokeCallback);
456
function publishFulfillment(promise) {
457
promise._state = FULFILLED;
461
function publishRejection(promise) {
462
promise._state = REJECTED;
465
if (!promise._handled && isNode) {
466
global.process.emit('unhandledRejection', promise._data, promise);
470
function notifyRejectionHandled(promise) {
471
global.process.emit('rejectionHandled', promise);
478
function P(resolver) {
479
if (typeof resolver !== 'function') {
480
throw new TypeError('Promise resolver ' + resolver + ' is not a function');
483
if (this instanceof P === false) {
484
throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');
488
invokeResolver(resolver, this);
497
then: function then(onFulfillment, onRejection) {
500
then: new this.constructor(NOOP),
501
fulfilled: onFulfillment,
502
rejected: onRejection
505
if ((onRejection || onFulfillment) && !this._handled) {
506
this._handled = true;
508
if (this._state === REJECTED && isNode) {
509
asyncCall(notifyRejectionHandled, this);
513
if (this._state === FULFILLED || this._state === REJECTED) {
515
asyncCall(invokeCallback, subscriber);
518
this._then.push(subscriber);
521
return subscriber.then;
523
catch: function _catch(onRejection) {
524
return this.then(null, onRejection);
528
P.all = function (promises) {
529
if (!Array.isArray(promises)) {
530
throw new TypeError('You must pass an array to Promise.all().');
533
return new P(function (resolve, reject) {
537
function resolver(index) {
539
return function (value) {
540
results[index] = value;
548
for (var i = 0, promise; i < promises.length; i++) {
549
promise = promises[i];
551
if (promise && typeof promise.then === 'function') {
552
promise.then(resolver(i), reject);
554
results[i] = promise;
564
P.race = function (promises) {
565
if (!Array.isArray(promises)) {
566
throw new TypeError('You must pass an array to Promise.race().');
569
return new P(function (resolve, reject) {
570
for (var i = 0, promise; i < promises.length; i++) {
571
promise = promises[i];
573
if (promise && typeof promise.then === 'function') {
574
promise.then(resolve, reject);
582
P.resolve = function (value) {
583
if (value && _typeof(value) === 'object' && value.constructor === P) {
587
return new P(function (resolve) {
592
P.reject = function (reason) {
593
return new P(function (resolve, reject) {
598
var picked = typeof Promise === 'function' ? Promise : P;
600
var d = UNITS_IN_GRID;
601
var meaninglessTransform = {
610
function isReserved(name) {
611
return ~RESERVED_CLASSES.indexOf(name);
614
function bunker(fn) {
623
function insertCss(css) {
624
if (!css || !IS_DOM) {
628
var style = DOCUMENT.createElement('style');
629
style.setAttribute('type', 'text/css');
630
style.innerHTML = css;
631
var headChildren = DOCUMENT.head.childNodes;
632
var beforeChild = null;
634
for (var i = headChildren.length - 1; i > -1; i--) {
635
var child = headChildren[i];
636
var tagName = (child.tagName || '').toUpperCase();
638
if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
643
DOCUMENT.head.insertBefore(style, beforeChild);
646
var idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
647
function nextUniqueId() {
652
id += idPool[Math.random() * 62 | 0];
657
function toArray(obj) {
660
for (var i = (obj || []).length >>> 0; i--;) {
666
function classArray(node) {
667
if (node.classList) {
668
return toArray(node.classList);
670
return (node.getAttribute('class') || '').split(' ').filter(function (i) {
675
function getIconName(familyPrefix, cls) {
676
var parts = cls.split('-');
677
var prefix = parts[0];
678
var iconName = parts.slice(1).join('-');
680
if (prefix === familyPrefix && iconName !== '' && !isReserved(iconName)) {
686
function htmlEscape(str) {
687
return "".concat(str).replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>');
689
function joinAttributes(attributes) {
690
return Object.keys(attributes || {}).reduce(function (acc, attributeName) {
691
return acc + "".concat(attributeName, "=\"").concat(htmlEscape(attributes[attributeName]), "\" ");
694
function joinStyles(styles) {
695
return Object.keys(styles || {}).reduce(function (acc, styleName) {
696
return acc + "".concat(styleName, ": ").concat(styles[styleName], ";");
699
function transformIsMeaningful(transform) {
700
return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
702
function transformForSvg(_ref) {
703
var transform = _ref.transform,
704
containerWidth = _ref.containerWidth,
705
iconWidth = _ref.iconWidth;
707
transform: "translate(".concat(containerWidth / 2, " 256)")
709
var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
710
var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
711
var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
713
transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
716
transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
724
function transformForCss(_ref2) {
725
var transform = _ref2.transform,
726
_ref2$width = _ref2.width,
727
width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width,
728
_ref2$height = _ref2.height,
729
height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height,
730
_ref2$startCentered = _ref2.startCentered,
731
startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;
734
if (startCentered && IS_IE) {
735
val += "translate(".concat(transform.x / d - width / 2, "em, ").concat(transform.y / d - height / 2, "em) ");
736
} else if (startCentered) {
737
val += "translate(calc(-50% + ".concat(transform.x / d, "em), calc(-50% + ").concat(transform.y / d, "em)) ");
739
val += "translate(".concat(transform.x / d, "em, ").concat(transform.y / d, "em) ");
742
val += "scale(".concat(transform.size / d * (transform.flipX ? -1 : 1), ", ").concat(transform.size / d * (transform.flipY ? -1 : 1), ") ");
743
val += "rotate(".concat(transform.rotate, "deg) ");
754
function fillBlack(abstract) {
755
var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
757
if (abstract.attributes && (abstract.attributes.fill || force)) {
758
abstract.attributes.fill = 'black';
764
function deGroup(abstract) {
765
if (abstract.tag === 'g') {
766
return abstract.children;
772
function makeIconMasking (_ref) {
773
var children = _ref.children,
774
attributes = _ref.attributes,
777
explicitMaskId = _ref.maskId,
778
transform = _ref.transform;
779
var mainWidth = main.width,
780
mainPath = main.icon;
781
var maskWidth = mask.width,
782
maskPath = mask.icon;
783
var trans = transformForSvg({
784
transform: transform,
785
containerWidth: maskWidth,
790
attributes: _objectSpread({}, ALL_SPACE, {
794
var maskInnerGroupChildrenMixin = mainPath.children ? {
795
children: mainPath.children.map(fillBlack)
797
var maskInnerGroup = {
799
attributes: _objectSpread({}, trans.inner),
800
children: [fillBlack(_objectSpread({
802
attributes: _objectSpread({}, mainPath.attributes, trans.path)
803
}, maskInnerGroupChildrenMixin))]
805
var maskOuterGroup = {
807
attributes: _objectSpread({}, trans.outer),
808
children: [maskInnerGroup]
810
var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
811
var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
814
attributes: _objectSpread({}, ALL_SPACE, {
816
maskUnits: 'userSpaceOnUse',
817
maskContentUnits: 'userSpaceOnUse'
819
children: [maskRect, maskOuterGroup]
828
children: deGroup(maskPath)
831
children.push(defs, {
833
attributes: _objectSpread({
834
fill: 'currentColor',
835
'clip-path': "url(#".concat(clipId, ")"),
836
mask: "url(#".concat(maskId, ")")
841
attributes: attributes
845
function makeIconStandard (_ref) {
846
var children = _ref.children,
847
attributes = _ref.attributes,
849
transform = _ref.transform,
850
styles = _ref.styles;
851
var styleString = joinStyles(styles);
853
if (styleString.length > 0) {
854
attributes['style'] = styleString;
857
if (transformIsMeaningful(transform)) {
858
var trans = transformForSvg({
859
transform: transform,
860
containerWidth: main.width,
861
iconWidth: main.width
865
attributes: _objectSpread({}, trans.outer),
868
attributes: _objectSpread({}, trans.inner),
871
children: main.icon.children,
872
attributes: _objectSpread({}, main.icon.attributes, trans.path)
877
children.push(main.icon);
882
attributes: attributes
886
function asIcon (_ref) {
887
var children = _ref.children,
890
attributes = _ref.attributes,
891
styles = _ref.styles,
892
transform = _ref.transform;
894
if (transformIsMeaningful(transform) && main.found && !mask.found) {
895
var width = main.width,
896
height = main.height;
898
x: width / height / 2,
901
attributes['style'] = joinStyles(_objectSpread({}, styles, {
902
'transform-origin': "".concat(offset.x + transform.x / 16, "em ").concat(offset.y + transform.y / 16, "em")
908
attributes: attributes,
913
function asSymbol (_ref) {
914
var prefix = _ref.prefix,
915
iconName = _ref.iconName,
916
children = _ref.children,
917
attributes = _ref.attributes,
918
symbol = _ref.symbol;
919
var id = symbol === true ? "".concat(prefix, "-").concat(config.familyPrefix, "-").concat(iconName) : symbol;
923
style: 'display: none;'
927
attributes: _objectSpread({}, attributes, {
935
function makeInlineSvgAbstract(params) {
936
var _params$icons = params.icons,
937
main = _params$icons.main,
938
mask = _params$icons.mask,
939
prefix = params.prefix,
940
iconName = params.iconName,
941
transform = params.transform,
942
symbol = params.symbol,
943
title = params.title,
944
maskId = params.maskId,
945
titleId = params.titleId,
946
extra = params.extra,
947
_params$watchable = params.watchable,
948
watchable = _params$watchable === void 0 ? false : _params$watchable;
950
var _ref = mask.found ? mask : main,
952
height = _ref.height;
954
var isUploadedIcon = prefix === 'fak';
955
var widthClass = isUploadedIcon ? '' : "fa-w-".concat(Math.ceil(width / height * 16));
956
var attrClass = [config.replacementClass, iconName ? "".concat(config.familyPrefix, "-").concat(iconName) : '', widthClass].filter(function (c) {
957
return extra.classes.indexOf(c) === -1;
958
}).filter(function (c) {
959
return c !== '' || !!c;
960
}).concat(extra.classes).join(' ');
963
attributes: _objectSpread({}, extra.attributes, {
964
'data-prefix': prefix,
965
'data-icon': iconName,
967
'role': extra.attributes.role || 'img',
968
'xmlns': 'http://www.w3.org/2000/svg',
969
'viewBox': "0 0 ".concat(width, " ").concat(height)
972
var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {
973
width: "".concat(width / height * 16 * 0.0625, "em")
977
content.attributes[DATA_FA_I2SVG] = '';
980
if (title) content.children.push({
983
id: content.attributes['aria-labelledby'] || "title-".concat(titleId || nextUniqueId())
988
var args = _objectSpread({}, content, {
994
transform: transform,
996
styles: _objectSpread({}, uploadedIconWidthStyle, extra.styles)
999
var _ref2 = mask.found && main.found ? makeIconMasking(args) : makeIconStandard(args),
1000
children = _ref2.children,
1001
attributes = _ref2.attributes;
1003
args.children = children;
1004
args.attributes = attributes;
1007
return asSymbol(args);
1009
return asIcon(args);
1012
function makeLayersTextAbstract(params) {
1013
var content = params.content,
1014
width = params.width,
1015
height = params.height,
1016
transform = params.transform,
1017
title = params.title,
1018
extra = params.extra,
1019
_params$watchable2 = params.watchable,
1020
watchable = _params$watchable2 === void 0 ? false : _params$watchable2;
1022
var attributes = _objectSpread({}, extra.attributes, title ? {
1025
'class': extra.classes.join(' ')
1029
attributes[DATA_FA_I2SVG] = '';
1032
var styles = _objectSpread({}, extra.styles);
1034
if (transformIsMeaningful(transform)) {
1035
styles['transform'] = transformForCss({
1036
transform: transform,
1037
startCentered: true,
1041
styles['-webkit-transform'] = styles['transform'];
1044
var styleString = joinStyles(styles);
1046
if (styleString.length > 0) {
1047
attributes['style'] = styleString;
1053
attributes: attributes,
1069
function makeLayersCounterAbstract(params) {
1070
var content = params.content,
1071
title = params.title,
1072
extra = params.extra;
1074
var attributes = _objectSpread({}, extra.attributes, title ? {
1077
'class': extra.classes.join(' ')
1080
var styleString = joinStyles(extra.styles);
1082
if (styleString.length > 0) {
1083
attributes['style'] = styleString;
1089
attributes: attributes,
1106
var noop$1 = function noop() {};
1108
var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
1112
var preamble = "FA \"5.15.4\"";
1114
var begin = function begin(name) {
1115
p.mark("".concat(preamble, " ").concat(name, " begins"));
1116
return function () {
1121
var end = function end(name) {
1122
p.mark("".concat(preamble, " ").concat(name, " ends"));
1123
p.measure("".concat(preamble, " ").concat(name), "".concat(preamble, " ").concat(name, " begins"), "".concat(preamble, " ").concat(name, " ends"));
1136
var bindInternal4 = function bindInternal4(func, thisContext) {
1137
return function (a, b, c, d) {
1138
return func.call(thisContext, a, b, c, d);
1155
var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
1156
var keys = Object.keys(subject),
1157
length = keys.length,
1158
iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
1163
if (initialValue === undefined) {
1165
result = subject[keys[0]];
1168
result = initialValue;
1171
for (; i < length; i++) {
1173
result = iterator(result, subject[key], key, subject);
1179
function toHex(unicode) {
1182
for (var i = 0; i < unicode.length; i++) {
1183
var hex = unicode.charCodeAt(i).toString(16);
1184
result += ('000' + hex).slice(-4);
1190
function defineIcons(prefix, icons) {
1191
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1192
var _params$skipHooks = params.skipHooks,
1193
skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;
1194
var normalized = Object.keys(icons).reduce(function (acc, iconName) {
1195
var icon = icons[iconName];
1196
var expanded = !!icon.icon;
1199
acc[icon.iconName] = icon.icon;
1201
acc[iconName] = icon;
1207
if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {
1208
namespace.hooks.addPack(prefix, normalized);
1210
namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, normalized);
1220
if (prefix === 'fas') {
1221
defineIcons('fa', icons);
1225
var styles = namespace.styles,
1226
shims = namespace.shims;
1227
var _byUnicode = {};
1228
var _byLigature = {};
1229
var _byOldName = {};
1230
var build = function build() {
1231
var lookup = function lookup(reducer) {
1232
return reduce(styles, function (o, style, prefix) {
1233
o[prefix] = reduce(style, reducer, {});
1238
_byUnicode = lookup(function (acc, icon, iconName) {
1240
acc[icon[3]] = iconName;
1245
_byLigature = lookup(function (acc, icon, iconName) {
1246
var ligatures = icon[2];
1247
acc[iconName] = iconName;
1248
ligatures.forEach(function (ligature) {
1249
acc[ligature] = iconName;
1253
var hasRegular = 'far' in styles;
1254
_byOldName = reduce(shims, function (acc, shim) {
1255
var oldName = shim[0];
1256
var prefix = shim[1];
1257
var iconName = shim[2];
1259
if (prefix === 'far' && !hasRegular) {
1271
function byUnicode(prefix, unicode) {
1272
return (_byUnicode[prefix] || {})[unicode];
1274
function byLigature(prefix, ligature) {
1275
return (_byLigature[prefix] || {})[ligature];
1277
function byOldName(name) {
1278
return _byOldName[name] || {
1284
var styles$1 = namespace.styles;
1285
var emptyCanonicalIcon = function emptyCanonicalIcon() {
1292
function getCanonicalIcon(values) {
1293
return values.reduce(function (acc, cls) {
1294
var iconName = getIconName(config.familyPrefix, cls);
1296
if (styles$1[cls]) {
1298
} else if (config.autoFetchSvg && Object.keys(PREFIX_TO_STYLE).indexOf(cls) > -1) {
1300
} else if (iconName) {
1301
var shim = acc.prefix === 'fa' ? byOldName(iconName) : {};
1302
acc.iconName = shim.iconName || iconName;
1303
acc.prefix = shim.prefix || acc.prefix;
1304
} else if (cls !== config.replacementClass && cls.indexOf('fa-w-') !== 0) {
1309
}, emptyCanonicalIcon());
1311
function iconFromMapping(mapping, prefix, iconName) {
1312
if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
1316
icon: mapping[prefix][iconName]
1321
function toHtml(abstractNodes) {
1322
var tag = abstractNodes.tag,
1323
_abstractNodes$attrib = abstractNodes.attributes,
1324
attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,
1325
_abstractNodes$childr = abstractNodes.children,
1326
children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;
1328
if (typeof abstractNodes === 'string') {
1329
return htmlEscape(abstractNodes);
1331
return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(''), "</").concat(tag, ">");
1335
var noop$2 = function noop() {};
1337
function isWatched(node) {
1338
var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;
1339
return typeof i2svg === 'string';
1342
function getMutator() {
1343
if (config.autoReplaceSvg === true) {
1344
return mutators.replace;
1347
var mutator = mutators[config.autoReplaceSvg];
1348
return mutator || mutators.replace;
1352
replace: function replace(mutation) {
1353
var node = mutation[0];
1354
var abstract = mutation[1];
1355
var newOuterHTML = abstract.map(function (a) {
1359
if (node.parentNode && node.outerHTML) {
1360
node.outerHTML = newOuterHTML + (config.keepOriginalSource && node.tagName.toLowerCase() !== 'svg' ? "<!-- ".concat(node.outerHTML, " Font Awesome fontawesome.com -->") : '');
1361
} else if (node.parentNode) {
1362
var newNode = document.createElement('span');
1363
node.parentNode.replaceChild(newNode, node);
1364
newNode.outerHTML = newOuterHTML;
1367
nest: function nest(mutation) {
1368
var node = mutation[0];
1369
var abstract = mutation[1];
1372
if (~classArray(node).indexOf(config.replacementClass)) {
1373
return mutators.replace(mutation);
1376
var forSvg = new RegExp("".concat(config.familyPrefix, "-.*"));
1377
delete abstract[0].attributes.style;
1378
delete abstract[0].attributes.id;
1379
var splitClasses = abstract[0].attributes.class.split(' ').reduce(function (acc, cls) {
1380
if (cls === config.replacementClass || cls.match(forSvg)) {
1381
acc.toSvg.push(cls);
1383
acc.toNode.push(cls);
1391
abstract[0].attributes.class = splitClasses.toSvg.join(' ');
1392
var newInnerHTML = abstract.map(function (a) {
1395
node.setAttribute('class', splitClasses.toNode.join(' '));
1396
node.setAttribute(DATA_FA_I2SVG, '');
1397
node.innerHTML = newInnerHTML;
1401
function performOperationSync(op) {
1405
function perform(mutations, callback) {
1406
var callbackFunction = typeof callback === 'function' ? callback : noop$2;
1408
if (mutations.length === 0) {
1411
var frame = performOperationSync;
1413
if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {
1414
frame = WINDOW.requestAnimationFrame || performOperationSync;
1418
var mutator = getMutator();
1419
var mark = perf.begin('mutate');
1420
mutations.map(mutator);
1426
var disabled = false;
1427
function disableObservation() {
1430
function enableObservation() {
1434
function observe(options) {
1435
if (!MUTATION_OBSERVER) {
1439
if (!config.observeMutations) {
1443
var treeCallback = options.treeCallback,
1444
nodeCallback = options.nodeCallback,
1445
pseudoElementsCallback = options.pseudoElementsCallback,
1446
_options$observeMutat = options.observeMutationsRoot,
1447
observeMutationsRoot = _options$observeMutat === void 0 ? DOCUMENT : _options$observeMutat;
1448
mo = new MUTATION_OBSERVER(function (objects) {
1449
if (disabled) return;
1450
toArray(objects).forEach(function (mutationRecord) {
1451
if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {
1452
if (config.searchPseudoElements) {
1453
pseudoElementsCallback(mutationRecord.target);
1456
treeCallback(mutationRecord.target);
1459
if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {
1460
pseudoElementsCallback(mutationRecord.target.parentNode);
1463
if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {
1464
if (mutationRecord.attributeName === 'class') {
1465
var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)),
1466
prefix = _getCanonicalIcon.prefix,
1467
iconName = _getCanonicalIcon.iconName;
1469
if (prefix) mutationRecord.target.setAttribute('data-prefix', prefix);
1470
if (iconName) mutationRecord.target.setAttribute('data-icon', iconName);
1472
nodeCallback(mutationRecord.target);
1477
if (!IS_DOM) return;
1478
mo.observe(observeMutationsRoot, {
1481
characterData: true,
1485
function disconnect() {
1490
function styleParser (node) {
1491
var style = node.getAttribute('style');
1495
val = style.split(';').reduce(function (acc, style) {
1496
var styles = style.split(':');
1497
var prop = styles[0];
1498
var value = styles.slice(1);
1500
if (prop && value.length > 0) {
1501
acc[prop] = value.join(':').trim();
1511
function classParser (node) {
1512
var existingPrefix = node.getAttribute('data-prefix');
1513
var existingIconName = node.getAttribute('data-icon');
1514
var innerText = node.innerText !== undefined ? node.innerText.trim() : '';
1515
var val = getCanonicalIcon(classArray(node));
1517
if (existingPrefix && existingIconName) {
1518
val.prefix = existingPrefix;
1519
val.iconName = existingIconName;
1522
if (val.prefix && innerText.length > 1) {
1523
val.iconName = byLigature(val.prefix, node.innerText);
1524
} else if (val.prefix && innerText.length === 1) {
1525
val.iconName = byUnicode(val.prefix, toHex(node.innerText));
1531
var parseTransformString = function parseTransformString(transformString) {
1541
if (!transformString) {
1544
return transformString.toLowerCase().split(' ').reduce(function (acc, n) {
1545
var parts = n.toLowerCase().split('-');
1546
var first = parts[0];
1547
var rest = parts.slice(1).join('-');
1549
if (first && rest === 'h') {
1554
if (first && rest === 'v') {
1559
rest = parseFloat(rest);
1567
acc.size = acc.size + rest;
1571
acc.size = acc.size - rest;
1575
acc.x = acc.x - rest;
1579
acc.x = acc.x + rest;
1583
acc.y = acc.y - rest;
1587
acc.y = acc.y + rest;
1591
acc.rotate = acc.rotate + rest;
1599
function transformParser (node) {
1600
return parseTransformString(node.getAttribute('data-fa-transform'));
1603
function symbolParser (node) {
1604
var symbol = node.getAttribute('data-fa-symbol');
1605
return symbol === null ? false : symbol === '' ? true : symbol;
1608
function attributesParser (node) {
1609
var extraAttributes = toArray(node.attributes).reduce(function (acc, attr) {
1610
if (acc.name !== 'class' && acc.name !== 'style') {
1611
acc[attr.name] = attr.value;
1616
var title = node.getAttribute('title');
1617
var titleId = node.getAttribute('data-fa-title-id');
1619
if (config.autoA11y) {
1621
extraAttributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
1623
extraAttributes['aria-hidden'] = 'true';
1624
extraAttributes['focusable'] = 'false';
1628
return extraAttributes;
1631
function maskParser (node) {
1632
var mask = node.getAttribute('data-fa-mask');
1635
return emptyCanonicalIcon();
1637
return getCanonicalIcon(mask.split(' ').map(function (i) {
1643
function blankMeta() {
1649
transform: meaninglessTransform,
1660
function parseMeta(node) {
1661
var _classParser = classParser(node),
1662
iconName = _classParser.iconName,
1663
prefix = _classParser.prefix,
1664
extraClasses = _classParser.rest;
1666
var extraStyles = styleParser(node);
1667
var transform = transformParser(node);
1668
var symbol = symbolParser(node);
1669
var extraAttributes = attributesParser(node);
1670
var mask = maskParser(node);
1673
title: node.getAttribute('title'),
1674
titleId: node.getAttribute('data-fa-title-id'),
1676
transform: transform,
1679
maskId: node.getAttribute('data-fa-mask-id'),
1681
classes: extraClasses,
1682
styles: extraStyles,
1683
attributes: extraAttributes
1688
function MissingIcon(error) {
1689
this.name = 'MissingIcon';
1690
this.message = error || 'Icon unavailable';
1691
this.stack = new Error().stack;
1693
MissingIcon.prototype = Object.create(Error.prototype);
1694
MissingIcon.prototype.constructor = MissingIcon;
1697
fill: 'currentColor'
1699
var ANIMATION_BASE = {
1700
attributeType: 'XML',
1701
repeatCount: 'indefinite',
1706
attributes: _objectSpread({}, FILL, {
1707
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'
1711
var OPACITY_ANIMATE = _objectSpread({}, ANIMATION_BASE, {
1712
attributeName: 'opacity'
1717
attributes: _objectSpread({}, FILL, {
1724
attributes: _objectSpread({}, ANIMATION_BASE, {
1726
values: '28;14;28;28;14;28;'
1730
attributes: _objectSpread({}, OPACITY_ANIMATE, {
1731
values: '1;0;1;1;0;1;'
1737
attributes: _objectSpread({}, FILL, {
1739
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'
1743
attributes: _objectSpread({}, OPACITY_ANIMATE, {
1744
values: '1;0;0;0;0;1;'
1750
attributes: _objectSpread({}, FILL, {
1752
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'
1756
attributes: _objectSpread({}, OPACITY_ANIMATE, {
1757
values: '0;0;1;1;0;0;'
1763
children: [RING, DOT, QUESTION, EXCLAMATION]
1766
var styles$2 = namespace.styles;
1767
function asFoundIcon(icon) {
1768
var width = icon[0];
1769
var height = icon[1];
1771
var _icon$slice = icon.slice(4),
1772
_icon$slice2 = _slicedToArray(_icon$slice, 1),
1773
vectorData = _icon$slice2[0];
1777
if (Array.isArray(vectorData)) {
1781
class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.GROUP)
1786
class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.SECONDARY),
1787
fill: 'currentColor',
1793
class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.PRIMARY),
1794
fill: 'currentColor',
1803
fill: 'currentColor',
1816
function findIcon(iconName, prefix) {
1817
return new picked(function (resolve, reject) {
1825
if (iconName && prefix && styles$2[prefix] && styles$2[prefix][iconName]) {
1826
var icon = styles$2[prefix][iconName];
1827
return resolve(asFoundIcon(icon));
1830
if (iconName && prefix && !config.showMissingIcons) {
1831
reject(new MissingIcon("Icon is missing for prefix ".concat(prefix, " with icon name ").concat(iconName)));
1838
var styles$3 = namespace.styles;
1840
function generateSvgReplacementMutation(node, nodeMeta) {
1841
var iconName = nodeMeta.iconName,
1842
title = nodeMeta.title,
1843
titleId = nodeMeta.titleId,
1844
prefix = nodeMeta.prefix,
1845
transform = nodeMeta.transform,
1846
symbol = nodeMeta.symbol,
1847
mask = nodeMeta.mask,
1848
maskId = nodeMeta.maskId,
1849
extra = nodeMeta.extra;
1850
return new picked(function (resolve, reject) {
1851
picked.all([findIcon(iconName, prefix), findIcon(mask.iconName, mask.prefix)]).then(function (_ref) {
1852
var _ref2 = _slicedToArray(_ref, 2),
1856
resolve([node, makeInlineSvgAbstract({
1863
transform: transform,
1876
function generateLayersText(node, nodeMeta) {
1877
var title = nodeMeta.title,
1878
transform = nodeMeta.transform,
1879
extra = nodeMeta.extra;
1884
var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
1885
var boundingClientRect = node.getBoundingClientRect();
1886
width = boundingClientRect.width / computedFontSize;
1887
height = boundingClientRect.height / computedFontSize;
1890
if (config.autoA11y && !title) {
1891
extra.attributes['aria-hidden'] = 'true';
1894
return picked.resolve([node, makeLayersTextAbstract({
1895
content: node.innerHTML,
1898
transform: transform,
1905
function generateMutation(node) {
1906
var nodeMeta = parseMeta(node);
1908
if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {
1909
return generateLayersText(node, nodeMeta);
1911
return generateSvgReplacementMutation(node, nodeMeta);
1915
function onTree(root) {
1916
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1917
if (!IS_DOM) return;
1918
var htmlClassList = DOCUMENT.documentElement.classList;
1920
var hclAdd = function hclAdd(suffix) {
1921
return htmlClassList.add("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
1924
var hclRemove = function hclRemove(suffix) {
1925
return htmlClassList.remove("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
1928
var prefixes = config.autoFetchSvg ? Object.keys(PREFIX_TO_STYLE) : Object.keys(styles$3);
1929
var prefixesDomQuery = [".".concat(LAYERS_TEXT_CLASSNAME, ":not([").concat(DATA_FA_I2SVG, "])")].concat(prefixes.map(function (p) {
1930
return ".".concat(p, ":not([").concat(DATA_FA_I2SVG, "])");
1933
if (prefixesDomQuery.length === 0) {
1937
var candidates = [];
1940
candidates = toArray(root.querySelectorAll(prefixesDomQuery));
1944
if (candidates.length > 0) {
1946
hclRemove('complete');
1951
var mark = perf.begin('onTree');
1952
var mutations = candidates.reduce(function (acc, node) {
1954
var mutation = generateMutation(node);
1961
if (e instanceof MissingIcon) {
1969
return new picked(function (resolve, reject) {
1970
picked.all(mutations).then(function (resolvedMutations) {
1971
perform(resolvedMutations, function () {
1974
hclRemove('pending');
1975
if (typeof callback === 'function') callback();
1979
}).catch(function () {
1985
function onNode(node) {
1986
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1987
generateMutation(node).then(function (mutation) {
1989
perform([mutation], callback);
1994
function replaceForPosition(node, position) {
1995
var pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));
1996
return new picked(function (resolve, reject) {
1997
if (node.getAttribute(pendingAttribute) !== null) {
2002
var children = toArray(node.children);
2003
var alreadyProcessedPseudoElement = children.filter(function (c) {
2004
return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;
2006
var styles = WINDOW.getComputedStyle(node, position);
2007
var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);
2008
var fontWeight = styles.getPropertyValue('font-weight');
2009
var content = styles.getPropertyValue('content');
2011
if (alreadyProcessedPseudoElement && !fontFamily) {
2015
node.removeChild(alreadyProcessedPseudoElement);
2017
} else if (fontFamily && content !== 'none' && content !== '') {
2018
var _content = styles.getPropertyValue('content');
2020
var prefix = ~['Solid', 'Regular', 'Light', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[fontWeight];
2021
var hexValue = toHex(_content.length === 3 ? _content.substr(1, 1) : _content);
2022
var iconName = byUnicode(prefix, hexValue);
2023
var iconIdentifier = iconName;
2026
if (iconName && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
2027
node.setAttribute(pendingAttribute, iconIdentifier);
2029
if (alreadyProcessedPseudoElement) {
2031
node.removeChild(alreadyProcessedPseudoElement);
2034
var meta = blankMeta();
2035
var extra = meta.extra;
2036
extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
2037
findIcon(iconName, prefix).then(function (main) {
2038
var abstract = makeInlineSvgAbstract(_objectSpread({}, meta, {
2041
mask: emptyCanonicalIcon()
2044
iconName: iconIdentifier,
2048
var element = DOCUMENT.createElement('svg');
2050
if (position === ':before') {
2051
node.insertBefore(element, node.firstChild);
2053
node.appendChild(element);
2056
element.outerHTML = abstract.map(function (a) {
2059
node.removeAttribute(pendingAttribute);
2071
function replace(node) {
2072
return picked.all([replaceForPosition(node, ':before'), replaceForPosition(node, ':after')]);
2075
function processable(node) {
2076
return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');
2079
function searchPseudoElements (root) {
2080
if (!IS_DOM) return;
2081
return new picked(function (resolve, reject) {
2082
var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);
2083
var end = perf.begin('searchPseudoElements');
2084
disableObservation();
2085
picked.all(operations).then(function () {
2087
enableObservation();
2089
}).catch(function () {
2091
enableObservation();
2097
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}";
2100
var dfp = DEFAULT_FAMILY_PREFIX;
2101
var drc = DEFAULT_REPLACEMENT_CLASS;
2102
var fp = config.familyPrefix;
2103
var rc = config.replacementClass;
2106
if (fp !== dfp || rc !== drc) {
2107
var dPatt = new RegExp("\\.".concat(dfp, "\\-"), 'g');
2108
var customPropPatt = new RegExp("\\--".concat(dfp, "\\-"), 'g');
2109
var rPatt = new RegExp("\\.".concat(drc), 'g');
2110
s = s.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));
2119
function Library() {
2120
_classCallCheck(this, Library);
2122
this.definitions = {};
2125
_createClass(Library, [{
2127
value: function add() {
2130
for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {
2131
definitions[_key] = arguments[_key];
2134
var additions = definitions.reduce(this._pullDefinitions, {});
2135
Object.keys(additions).forEach(function (key) {
2136
_this.definitions[key] = _objectSpread({}, _this.definitions[key] || {}, additions[key]);
2137
defineIcons(key, additions[key]);
2143
value: function reset() {
2144
this.definitions = {};
2147
key: "_pullDefinitions",
2148
value: function _pullDefinitions(additions, definition) {
2149
var normalized = definition.prefix && definition.iconName && definition.icon ? {
2152
Object.keys(normalized).map(function (key) {
2153
var _normalized$key = normalized[key],
2154
prefix = _normalized$key.prefix,
2155
iconName = _normalized$key.iconName,
2156
icon = _normalized$key.icon;
2157
if (!additions[prefix]) additions[prefix] = {};
2158
additions[prefix][iconName] = icon;
2167
function ensureCss() {
2168
if (config.autoAddCss && !_cssInserted) {
2171
_cssInserted = true;
2175
function apiObject(val, abstractCreator) {
2176
Object.defineProperty(val, 'abstract', {
2177
get: abstractCreator
2179
Object.defineProperty(val, 'html', {
2180
get: function get() {
2181
return val.abstract.map(function (a) {
2186
Object.defineProperty(val, 'node', {
2187
get: function get() {
2188
if (!IS_DOM) return;
2189
var container = DOCUMENT.createElement('div');
2190
container.innerHTML = val.html;
2191
return container.children;
2197
function findIconDefinition(iconLookup) {
2198
var _iconLookup$prefix = iconLookup.prefix,
2199
prefix = _iconLookup$prefix === void 0 ? 'fa' : _iconLookup$prefix,
2200
iconName = iconLookup.iconName;
2201
if (!iconName) return;
2202
return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);
2205
function resolveIcons(next) {
2206
return function (maybeIconDefinition) {
2207
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2208
var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});
2209
var mask = params.mask;
2212
mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
2215
return next(iconDefinition, _objectSpread({}, params, {
2221
var library = new Library();
2222
var noAuto = function noAuto() {
2223
config.autoReplaceSvg = false;
2224
config.observeMutations = false;
2227
var _cssInserted = false;
2229
i2svg: function i2svg() {
2230
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2234
var _params$node = params.node,
2235
node = _params$node === void 0 ? DOCUMENT : _params$node,
2236
_params$callback = params.callback,
2237
callback = _params$callback === void 0 ? function () {} : _params$callback;
2239
if (config.searchPseudoElements) {
2240
searchPseudoElements(node);
2243
return onTree(node, callback);
2245
return picked.reject('Operation requires a DOM of some kind.');
2249
insertCss: function insertCss$$1() {
2250
if (!_cssInserted) {
2253
_cssInserted = true;
2256
watch: function watch() {
2257
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2258
var autoReplaceSvgRoot = params.autoReplaceSvgRoot,
2259
observeMutationsRoot = params.observeMutationsRoot;
2261
if (config.autoReplaceSvg === false) {
2262
config.autoReplaceSvg = true;
2265
config.observeMutations = true;
2266
domready(function () {
2268
autoReplaceSvgRoot: autoReplaceSvgRoot
2271
treeCallback: onTree,
2272
nodeCallback: onNode,
2273
pseudoElementsCallback: searchPseudoElements,
2274
observeMutationsRoot: observeMutationsRoot
2280
transform: function transform(transformString) {
2281
return parseTransformString(transformString);
2284
var icon = resolveIcons(function (iconDefinition) {
2285
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2286
var _params$transform = params.transform,
2287
transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
2288
_params$symbol = params.symbol,
2289
symbol = _params$symbol === void 0 ? false : _params$symbol,
2290
_params$mask = params.mask,
2291
mask = _params$mask === void 0 ? null : _params$mask,
2292
_params$maskId = params.maskId,
2293
maskId = _params$maskId === void 0 ? null : _params$maskId,
2294
_params$title = params.title,
2295
title = _params$title === void 0 ? null : _params$title,
2296
_params$titleId = params.titleId,
2297
titleId = _params$titleId === void 0 ? null : _params$titleId,
2298
_params$classes = params.classes,
2299
classes = _params$classes === void 0 ? [] : _params$classes,
2300
_params$attributes = params.attributes,
2301
attributes = _params$attributes === void 0 ? {} : _params$attributes,
2302
_params$styles = params.styles,
2303
styles = _params$styles === void 0 ? {} : _params$styles;
2304
if (!iconDefinition) return;
2305
var prefix = iconDefinition.prefix,
2306
iconName = iconDefinition.iconName,
2307
icon = iconDefinition.icon;
2308
return apiObject(_objectSpread({
2310
}, iconDefinition), function () {
2313
if (config.autoA11y) {
2315
attributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
2317
attributes['aria-hidden'] = 'true';
2318
attributes['focusable'] = 'false';
2322
return makeInlineSvgAbstract({
2324
main: asFoundIcon(icon),
2325
mask: mask ? asFoundIcon(mask.icon) : {
2334
transform: _objectSpread({}, meaninglessTransform, transform),
2340
attributes: attributes,
2347
var text = function text(content) {
2348
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2349
var _params$transform2 = params.transform,
2350
transform = _params$transform2 === void 0 ? meaninglessTransform : _params$transform2,
2351
_params$title2 = params.title,
2352
title = _params$title2 === void 0 ? null : _params$title2,
2353
_params$classes2 = params.classes,
2354
classes = _params$classes2 === void 0 ? [] : _params$classes2,
2355
_params$attributes2 = params.attributes,
2356
attributes = _params$attributes2 === void 0 ? {} : _params$attributes2,
2357
_params$styles2 = params.styles,
2358
styles = _params$styles2 === void 0 ? {} : _params$styles2;
2364
return makeLayersTextAbstract({
2366
transform: _objectSpread({}, meaninglessTransform, transform),
2369
attributes: attributes,
2371
classes: ["".concat(config.familyPrefix, "-layers-text")].concat(_toConsumableArray(classes))
2376
var counter = function counter(content) {
2377
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2378
var _params$title3 = params.title,
2379
title = _params$title3 === void 0 ? null : _params$title3,
2380
_params$classes3 = params.classes,
2381
classes = _params$classes3 === void 0 ? [] : _params$classes3,
2382
_params$attributes3 = params.attributes,
2383
attributes = _params$attributes3 === void 0 ? {} : _params$attributes3,
2384
_params$styles3 = params.styles,
2385
styles = _params$styles3 === void 0 ? {} : _params$styles3;
2391
return makeLayersCounterAbstract({
2392
content: content.toString(),
2395
attributes: attributes,
2397
classes: ["".concat(config.familyPrefix, "-layers-counter")].concat(_toConsumableArray(classes))
2402
var layer = function layer(assembler) {
2403
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2404
var _params$classes4 = params.classes,
2405
classes = _params$classes4 === void 0 ? [] : _params$classes4;
2411
assembler(function (args) {
2412
Array.isArray(args) ? args.map(function (a) {
2413
children = children.concat(a.abstract);
2414
}) : children = children.concat(args.abstract);
2419
class: ["".concat(config.familyPrefix, "-layers")].concat(_toConsumableArray(classes)).join(' ')
2431
findIconDefinition: findIconDefinition,
2439
var autoReplace = function autoReplace() {
2440
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2441
var _params$autoReplaceSv = params.autoReplaceSvgRoot,
2442
autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv;
2443
if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({
2444
node: autoReplaceSvgRoot
2448
function bootstrap() {
2450
if (!WINDOW.FontAwesome) {
2451
WINDOW.FontAwesome = api;
2454
domready(function () {
2457
treeCallback: onTree,
2458
nodeCallback: onNode,
2459
pseudoElementsCallback: searchPseudoElements
2464
namespace.hooks = _objectSpread({}, namespace.hooks, {
2465
addPack: function addPack(prefix, icons) {
2466
namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, icons);
2470
addShims: function addShims(shims) {
2471
var _namespace$shims;
2473
(_namespace$shims = namespace.shims).push.apply(_namespace$shims, _toConsumableArray(shims));