1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | (function () {
|
7 | 'use strict';
|
8 |
|
9 | function ownKeys(object, enumerableOnly) {
|
10 | var keys = Object.keys(object);
|
11 |
|
12 | if (Object.getOwnPropertySymbols) {
|
13 | var symbols = Object.getOwnPropertySymbols(object);
|
14 | enumerableOnly && (symbols = symbols.filter(function (sym) {
|
15 | return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
16 | })), keys.push.apply(keys, symbols);
|
17 | }
|
18 |
|
19 | return keys;
|
20 | }
|
21 |
|
22 | function _objectSpread2(target) {
|
23 | for (var i = 1; i < arguments.length; i++) {
|
24 | var source = null != arguments[i] ? arguments[i] : {};
|
25 | i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
26 | _defineProperty(target, key, source[key]);
|
27 | }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
28 | Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
29 | });
|
30 | }
|
31 |
|
32 | return target;
|
33 | }
|
34 |
|
35 | function _typeof(obj) {
|
36 | "@babel/helpers - typeof";
|
37 |
|
38 | return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
39 | return typeof obj;
|
40 | } : function (obj) {
|
41 | return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
42 | }, _typeof(obj);
|
43 | }
|
44 |
|
45 | function _wrapRegExp() {
|
46 | _wrapRegExp = function (re, groups) {
|
47 | return new BabelRegExp(re, void 0, groups);
|
48 | };
|
49 |
|
50 | var _super = RegExp.prototype,
|
51 | _groups = new WeakMap();
|
52 |
|
53 | function BabelRegExp(re, flags, groups) {
|
54 | var _this = new RegExp(re, flags);
|
55 |
|
56 | return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype);
|
57 | }
|
58 |
|
59 | function buildGroups(result, re) {
|
60 | var g = _groups.get(re);
|
61 |
|
62 | return Object.keys(g).reduce(function (groups, name) {
|
63 | return groups[name] = result[g[name]], groups;
|
64 | }, Object.create(null));
|
65 | }
|
66 |
|
67 | return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) {
|
68 | var result = _super.exec.call(this, str);
|
69 |
|
70 | return result && (result.groups = buildGroups(result, this)), result;
|
71 | }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
|
72 | if ("string" == typeof substitution) {
|
73 | var groups = _groups.get(this);
|
74 |
|
75 | return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
|
76 | return "$" + groups[name];
|
77 | }));
|
78 | }
|
79 |
|
80 | if ("function" == typeof substitution) {
|
81 | var _this = this;
|
82 |
|
83 | return _super[Symbol.replace].call(this, str, function () {
|
84 | var args = arguments;
|
85 | return "object" != typeof args[args.length - 1] && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args);
|
86 | });
|
87 | }
|
88 |
|
89 | return _super[Symbol.replace].call(this, str, substitution);
|
90 | }, _wrapRegExp.apply(this, arguments);
|
91 | }
|
92 |
|
93 | function _classCallCheck(instance, Constructor) {
|
94 | if (!(instance instanceof Constructor)) {
|
95 | throw new TypeError("Cannot call a class as a function");
|
96 | }
|
97 | }
|
98 |
|
99 | function _defineProperties(target, props) {
|
100 | for (var i = 0; i < props.length; i++) {
|
101 | var descriptor = props[i];
|
102 | descriptor.enumerable = descriptor.enumerable || false;
|
103 | descriptor.configurable = true;
|
104 | if ("value" in descriptor) descriptor.writable = true;
|
105 | Object.defineProperty(target, descriptor.key, descriptor);
|
106 | }
|
107 | }
|
108 |
|
109 | function _createClass(Constructor, protoProps, staticProps) {
|
110 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
111 | if (staticProps) _defineProperties(Constructor, staticProps);
|
112 | Object.defineProperty(Constructor, "prototype", {
|
113 | writable: false
|
114 | });
|
115 | return Constructor;
|
116 | }
|
117 |
|
118 | function _defineProperty(obj, key, value) {
|
119 | if (key in obj) {
|
120 | Object.defineProperty(obj, key, {
|
121 | value: value,
|
122 | enumerable: true,
|
123 | configurable: true,
|
124 | writable: true
|
125 | });
|
126 | } else {
|
127 | obj[key] = value;
|
128 | }
|
129 |
|
130 | return obj;
|
131 | }
|
132 |
|
133 | function _inherits(subClass, superClass) {
|
134 | if (typeof superClass !== "function" && superClass !== null) {
|
135 | throw new TypeError("Super expression must either be null or a function");
|
136 | }
|
137 |
|
138 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
139 | constructor: {
|
140 | value: subClass,
|
141 | writable: true,
|
142 | configurable: true
|
143 | }
|
144 | });
|
145 | Object.defineProperty(subClass, "prototype", {
|
146 | writable: false
|
147 | });
|
148 | if (superClass) _setPrototypeOf(subClass, superClass);
|
149 | }
|
150 |
|
151 | function _setPrototypeOf(o, p) {
|
152 | _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
153 | o.__proto__ = p;
|
154 | return o;
|
155 | };
|
156 |
|
157 | return _setPrototypeOf(o, p);
|
158 | }
|
159 |
|
160 | function _slicedToArray(arr, i) {
|
161 | return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
162 | }
|
163 |
|
164 | function _toConsumableArray(arr) {
|
165 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
166 | }
|
167 |
|
168 | function _arrayWithoutHoles(arr) {
|
169 | if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
170 | }
|
171 |
|
172 | function _arrayWithHoles(arr) {
|
173 | if (Array.isArray(arr)) return arr;
|
174 | }
|
175 |
|
176 | function _iterableToArray(iter) {
|
177 | if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
178 | }
|
179 |
|
180 | function _iterableToArrayLimit(arr, i) {
|
181 | var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
182 |
|
183 | if (_i == null) return;
|
184 | var _arr = [];
|
185 | var _n = true;
|
186 | var _d = false;
|
187 |
|
188 | var _s, _e;
|
189 |
|
190 | try {
|
191 | for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
192 | _arr.push(_s.value);
|
193 |
|
194 | if (i && _arr.length === i) break;
|
195 | }
|
196 | } catch (err) {
|
197 | _d = true;
|
198 | _e = err;
|
199 | } finally {
|
200 | try {
|
201 | if (!_n && _i["return"] != null) _i["return"]();
|
202 | } finally {
|
203 | if (_d) throw _e;
|
204 | }
|
205 | }
|
206 |
|
207 | return _arr;
|
208 | }
|
209 |
|
210 | function _unsupportedIterableToArray(o, minLen) {
|
211 | if (!o) return;
|
212 | if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
213 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
214 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
215 | if (n === "Map" || n === "Set") return Array.from(o);
|
216 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
217 | }
|
218 |
|
219 | function _arrayLikeToArray(arr, len) {
|
220 | if (len == null || len > arr.length) len = arr.length;
|
221 |
|
222 | for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
223 |
|
224 | return arr2;
|
225 | }
|
226 |
|
227 | function _nonIterableSpread() {
|
228 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
229 | }
|
230 |
|
231 | function _nonIterableRest() {
|
232 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
233 | }
|
234 |
|
235 | var noop = function noop() {};
|
236 |
|
237 | var _WINDOW = {};
|
238 | var _DOCUMENT = {};
|
239 | var _MUTATION_OBSERVER = null;
|
240 | var _PERFORMANCE = {
|
241 | mark: noop,
|
242 | measure: noop
|
243 | };
|
244 |
|
245 | try {
|
246 | if (typeof window !== 'undefined') _WINDOW = window;
|
247 | if (typeof document !== 'undefined') _DOCUMENT = document;
|
248 | if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;
|
249 | if (typeof performance !== 'undefined') _PERFORMANCE = performance;
|
250 | } catch (e) {}
|
251 |
|
252 | var _ref = _WINDOW.navigator || {},
|
253 | _ref$userAgent = _ref.userAgent,
|
254 | userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;
|
255 | var WINDOW = _WINDOW;
|
256 | var DOCUMENT = _DOCUMENT;
|
257 | var MUTATION_OBSERVER = _MUTATION_OBSERVER;
|
258 | var PERFORMANCE = _PERFORMANCE;
|
259 | var IS_BROWSER = !!WINDOW.document;
|
260 | var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
|
261 | var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
|
262 |
|
263 | var _familyProxy, _familyProxy2, _familyProxy3, _familyProxy4, _familyProxy5;
|
264 |
|
265 | var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
|
266 | var UNITS_IN_GRID = 16;
|
267 | var DEFAULT_CSS_PREFIX = 'fa';
|
268 | var DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
|
269 | var DATA_FA_I2SVG = 'data-fa-i2svg';
|
270 | var DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';
|
271 | var DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';
|
272 | var DATA_PREFIX = 'data-prefix';
|
273 | var DATA_ICON = 'data-icon';
|
274 | var HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';
|
275 | var MUTATION_APPROACH_ASYNC = 'async';
|
276 | var TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];
|
277 | var PRODUCTION = function () {
|
278 | try {
|
279 | return "production" === 'production';
|
280 | } catch (e) {
|
281 | return false;
|
282 | }
|
283 | }();
|
284 | var FAMILY_CLASSIC = 'classic';
|
285 | var FAMILY_SHARP = 'sharp';
|
286 | var FAMILIES = [FAMILY_CLASSIC, FAMILY_SHARP];
|
287 |
|
288 | function familyProxy(obj) {
|
289 |
|
290 | return new Proxy(obj, {
|
291 | get: function get(target, prop) {
|
292 | return prop in target ? target[prop] : target[FAMILY_CLASSIC];
|
293 | }
|
294 | });
|
295 | }
|
296 | var PREFIX_TO_STYLE = familyProxy((_familyProxy = {}, _defineProperty(_familyProxy, FAMILY_CLASSIC, {
|
297 | 'fa': 'solid',
|
298 | 'fas': 'solid',
|
299 | 'fa-solid': 'solid',
|
300 | 'far': 'regular',
|
301 | 'fa-regular': 'regular',
|
302 | 'fal': 'light',
|
303 | 'fa-light': 'light',
|
304 | 'fat': 'thin',
|
305 | 'fa-thin': 'thin',
|
306 | 'fad': 'duotone',
|
307 | 'fa-duotone': 'duotone',
|
308 | 'fab': 'brands',
|
309 | 'fa-brands': 'brands',
|
310 | 'fak': 'kit',
|
311 | 'fa-kit': 'kit'
|
312 | }), _defineProperty(_familyProxy, FAMILY_SHARP, {
|
313 | 'fa': 'solid',
|
314 | 'fass': 'solid',
|
315 | 'fa-solid': 'solid'
|
316 | }), _familyProxy));
|
317 | var STYLE_TO_PREFIX = familyProxy((_familyProxy2 = {}, _defineProperty(_familyProxy2, FAMILY_CLASSIC, {
|
318 | 'solid': 'fas',
|
319 | 'regular': 'far',
|
320 | 'light': 'fal',
|
321 | 'thin': 'fat',
|
322 | 'duotone': 'fad',
|
323 | 'brands': 'fab',
|
324 | 'kit': 'fak'
|
325 | }), _defineProperty(_familyProxy2, FAMILY_SHARP, {
|
326 | 'solid': 'fass'
|
327 | }), _familyProxy2));
|
328 | var PREFIX_TO_LONG_STYLE = familyProxy((_familyProxy3 = {}, _defineProperty(_familyProxy3, FAMILY_CLASSIC, {
|
329 | 'fab': 'fa-brands',
|
330 | 'fad': 'fa-duotone',
|
331 | 'fak': 'fa-kit',
|
332 | 'fal': 'fa-light',
|
333 | 'far': 'fa-regular',
|
334 | 'fas': 'fa-solid',
|
335 | 'fat': 'fa-thin'
|
336 | }), _defineProperty(_familyProxy3, FAMILY_SHARP, {
|
337 | 'fass': 'fa-solid'
|
338 | }), _familyProxy3));
|
339 | var LONG_STYLE_TO_PREFIX = familyProxy((_familyProxy4 = {}, _defineProperty(_familyProxy4, FAMILY_CLASSIC, {
|
340 | 'fa-brands': 'fab',
|
341 | 'fa-duotone': 'fad',
|
342 | 'fa-kit': 'fak',
|
343 | 'fa-light': 'fal',
|
344 | 'fa-regular': 'far',
|
345 | 'fa-solid': 'fas',
|
346 | 'fa-thin': 'fat'
|
347 | }), _defineProperty(_familyProxy4, FAMILY_SHARP, {
|
348 | 'fa-solid': 'fass'
|
349 | }), _familyProxy4));
|
350 | var ICON_SELECTION_SYNTAX_PATTERN = /fa(s|r|l|t|d|b|k|ss)?[\-\ ]/;
|
351 |
|
352 | var LAYERS_TEXT_CLASSNAME = 'fa-layers-text';
|
353 | var FONT_FAMILY_PATTERN = /Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i;
|
354 |
|
355 |
|
356 | var FONT_WEIGHT_TO_PREFIX = familyProxy((_familyProxy5 = {}, _defineProperty(_familyProxy5, FAMILY_CLASSIC, {
|
357 | '900': 'fas',
|
358 | '400': 'far',
|
359 | 'normal': 'far',
|
360 | '300': 'fal',
|
361 | '100': 'fat'
|
362 | }), _defineProperty(_familyProxy5, FAMILY_SHARP, {
|
363 | '900': 'fass'
|
364 | }), _familyProxy5));
|
365 | var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
366 | var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
|
367 | var ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];
|
368 | var DUOTONE_CLASSES = {
|
369 | GROUP: 'duotone-group',
|
370 | SWAP_OPACITY: 'swap-opacity',
|
371 | PRIMARY: 'primary',
|
372 | SECONDARY: 'secondary'
|
373 | };
|
374 | var prefixes = new Set();
|
375 | Object.keys(STYLE_TO_PREFIX[FAMILY_CLASSIC]).map(prefixes.add.bind(prefixes));
|
376 | Object.keys(STYLE_TO_PREFIX[FAMILY_SHARP]).map(prefixes.add.bind(prefixes));
|
377 | var RESERVED_CLASSES = [].concat(FAMILIES, _toConsumableArray(prefixes), ['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', 'beat', 'border', 'fade', 'beat-fade', 'bounce', 'flip-both', 'flip-horizontal', 'flip-vertical', 'flip', 'fw', 'inverse', 'layers-counter', 'layers-text', 'layers', 'li', 'pull-left', 'pull-right', 'pulse', 'rotate-180', 'rotate-270', 'rotate-90', 'rotate-by', 'shake', 'spin-pulse', 'spin-reverse', 'spin', 'stack-1x', 'stack-2x', 'stack', 'ul', DUOTONE_CLASSES.GROUP, DUOTONE_CLASSES.SWAP_OPACITY, DUOTONE_CLASSES.PRIMARY, DUOTONE_CLASSES.SECONDARY]).concat(oneToTen.map(function (n) {
|
378 | return "".concat(n, "x");
|
379 | })).concat(oneToTwenty.map(function (n) {
|
380 | return "w-".concat(n);
|
381 | }));
|
382 |
|
383 | var initial = WINDOW.FontAwesomeConfig || {};
|
384 |
|
385 | function getAttrConfig(attr) {
|
386 | var element = DOCUMENT.querySelector('script[' + attr + ']');
|
387 |
|
388 | if (element) {
|
389 | return element.getAttribute(attr);
|
390 | }
|
391 | }
|
392 |
|
393 | function coerce(val) {
|
394 |
|
395 |
|
396 | if (val === '') return true;
|
397 | if (val === 'false') return false;
|
398 | if (val === 'true') return true;
|
399 | return val;
|
400 | }
|
401 |
|
402 | if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {
|
403 | var attrs = [['data-family-prefix', 'familyPrefix'], ['data-css-prefix', 'cssPrefix'], ['data-family-default', 'familyDefault'], ['data-style-default', 'styleDefault'], ['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']];
|
404 | attrs.forEach(function (_ref) {
|
405 | var _ref2 = _slicedToArray(_ref, 2),
|
406 | attr = _ref2[0],
|
407 | key = _ref2[1];
|
408 |
|
409 | var val = coerce(getAttrConfig(attr));
|
410 |
|
411 | if (val !== undefined && val !== null) {
|
412 | initial[key] = val;
|
413 | }
|
414 | });
|
415 | }
|
416 |
|
417 | var _default = {
|
418 | styleDefault: 'solid',
|
419 | familyDefault: 'classic',
|
420 | cssPrefix: DEFAULT_CSS_PREFIX,
|
421 | replacementClass: DEFAULT_REPLACEMENT_CLASS,
|
422 | autoReplaceSvg: true,
|
423 | autoAddCss: true,
|
424 | autoA11y: true,
|
425 | searchPseudoElements: false,
|
426 | observeMutations: true,
|
427 | mutateApproach: 'async',
|
428 | keepOriginalSource: true,
|
429 | measurePerformance: false,
|
430 | showMissingIcons: true
|
431 | };
|
432 |
|
433 | if (initial.familyPrefix) {
|
434 | initial.cssPrefix = initial.familyPrefix;
|
435 | }
|
436 |
|
437 | var _config = _objectSpread2(_objectSpread2({}, _default), initial);
|
438 |
|
439 | if (!_config.autoReplaceSvg) _config.observeMutations = false;
|
440 | var config = {};
|
441 | Object.keys(_default).forEach(function (key) {
|
442 | Object.defineProperty(config, key, {
|
443 | enumerable: true,
|
444 | set: function set(val) {
|
445 | _config[key] = val;
|
446 |
|
447 | _onChangeCb.forEach(function (cb) {
|
448 | return cb(config);
|
449 | });
|
450 | },
|
451 | get: function get() {
|
452 | return _config[key];
|
453 | }
|
454 | });
|
455 | });
|
456 |
|
457 | Object.defineProperty(config, 'familyPrefix', {
|
458 | enumerable: true,
|
459 | set: function set(val) {
|
460 | _config.cssPrefix = val;
|
461 |
|
462 | _onChangeCb.forEach(function (cb) {
|
463 | return cb(config);
|
464 | });
|
465 | },
|
466 | get: function get() {
|
467 | return _config.cssPrefix;
|
468 | }
|
469 | });
|
470 | WINDOW.FontAwesomeConfig = config;
|
471 | var _onChangeCb = [];
|
472 | function onChange(cb) {
|
473 | _onChangeCb.push(cb);
|
474 |
|
475 | return function () {
|
476 | _onChangeCb.splice(_onChangeCb.indexOf(cb), 1);
|
477 | };
|
478 | }
|
479 |
|
480 | var d = UNITS_IN_GRID;
|
481 | var meaninglessTransform = {
|
482 | size: 16,
|
483 | x: 0,
|
484 | y: 0,
|
485 | rotate: 0,
|
486 | flipX: false,
|
487 | flipY: false
|
488 | };
|
489 | function bunker(fn) {
|
490 | try {
|
491 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
492 | args[_key - 1] = arguments[_key];
|
493 | }
|
494 |
|
495 | fn.apply(void 0, args);
|
496 | } catch (e) {
|
497 | if (!PRODUCTION) {
|
498 | throw e;
|
499 | }
|
500 | }
|
501 | }
|
502 | function insertCss(css) {
|
503 | if (!css || !IS_DOM) {
|
504 | return;
|
505 | }
|
506 |
|
507 | var style = DOCUMENT.createElement('style');
|
508 | style.setAttribute('type', 'text/css');
|
509 | style.innerHTML = css;
|
510 | var headChildren = DOCUMENT.head.childNodes;
|
511 | var beforeChild = null;
|
512 |
|
513 | for (var i = headChildren.length - 1; i > -1; i--) {
|
514 | var child = headChildren[i];
|
515 | var tagName = (child.tagName || '').toUpperCase();
|
516 |
|
517 | if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
|
518 | beforeChild = child;
|
519 | }
|
520 | }
|
521 |
|
522 | DOCUMENT.head.insertBefore(style, beforeChild);
|
523 | return css;
|
524 | }
|
525 | var idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
526 | function nextUniqueId() {
|
527 | var size = 12;
|
528 | var id = '';
|
529 |
|
530 | while (size-- > 0) {
|
531 | id += idPool[Math.random() * 62 | 0];
|
532 | }
|
533 |
|
534 | return id;
|
535 | }
|
536 | function toArray(obj) {
|
537 | var array = [];
|
538 |
|
539 | for (var i = (obj || []).length >>> 0; i--;) {
|
540 | array[i] = obj[i];
|
541 | }
|
542 |
|
543 | return array;
|
544 | }
|
545 | function classArray(node) {
|
546 | if (node.classList) {
|
547 | return toArray(node.classList);
|
548 | } else {
|
549 | return (node.getAttribute('class') || '').split(' ').filter(function (i) {
|
550 | return i;
|
551 | });
|
552 | }
|
553 | }
|
554 | function htmlEscape(str) {
|
555 | return "".concat(str).replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>');
|
556 | }
|
557 | function joinAttributes(attributes) {
|
558 | return Object.keys(attributes || {}).reduce(function (acc, attributeName) {
|
559 | return acc + "".concat(attributeName, "=\"").concat(htmlEscape(attributes[attributeName]), "\" ");
|
560 | }, '').trim();
|
561 | }
|
562 | function joinStyles(styles) {
|
563 | return Object.keys(styles || {}).reduce(function (acc, styleName) {
|
564 | return acc + "".concat(styleName, ": ").concat(styles[styleName].trim(), ";");
|
565 | }, '');
|
566 | }
|
567 | function transformIsMeaningful(transform) {
|
568 | return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
|
569 | }
|
570 | function transformForSvg(_ref) {
|
571 | var transform = _ref.transform,
|
572 | containerWidth = _ref.containerWidth,
|
573 | iconWidth = _ref.iconWidth;
|
574 | var outer = {
|
575 | transform: "translate(".concat(containerWidth / 2, " 256)")
|
576 | };
|
577 | var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
|
578 | var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
|
579 | var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
|
580 | var inner = {
|
581 | transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
|
582 | };
|
583 | var path = {
|
584 | transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
|
585 | };
|
586 | return {
|
587 | outer: outer,
|
588 | inner: inner,
|
589 | path: path
|
590 | };
|
591 | }
|
592 | function transformForCss(_ref2) {
|
593 | var transform = _ref2.transform,
|
594 | _ref2$width = _ref2.width,
|
595 | width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width,
|
596 | _ref2$height = _ref2.height,
|
597 | height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height,
|
598 | _ref2$startCentered = _ref2.startCentered,
|
599 | startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;
|
600 | var val = '';
|
601 |
|
602 | if (startCentered && IS_IE) {
|
603 | val += "translate(".concat(transform.x / d - width / 2, "em, ").concat(transform.y / d - height / 2, "em) ");
|
604 | } else if (startCentered) {
|
605 | val += "translate(calc(-50% + ".concat(transform.x / d, "em), calc(-50% + ").concat(transform.y / d, "em)) ");
|
606 | } else {
|
607 | val += "translate(".concat(transform.x / d, "em, ").concat(transform.y / d, "em) ");
|
608 | }
|
609 |
|
610 | val += "scale(".concat(transform.size / d * (transform.flipX ? -1 : 1), ", ").concat(transform.size / d * (transform.flipY ? -1 : 1), ") ");
|
611 | val += "rotate(".concat(transform.rotate, "deg) ");
|
612 | return val;
|
613 | }
|
614 |
|
615 | var baseStyles = ":host,:root{--fa-font-solid:normal 900 1em/1 \"Font Awesome 6 Solid\";--fa-font-regular:normal 400 1em/1 \"Font Awesome 6 Regular\";--fa-font-light:normal 300 1em/1 \"Font Awesome 6 Light\";--fa-font-thin:normal 100 1em/1 \"Font Awesome 6 Thin\";--fa-font-duotone:normal 900 1em/1 \"Font Awesome 6 Duotone\";--fa-font-sharp-solid:normal 900 1em/1 \"Font Awesome 6 Sharp\";--fa-font-brands:normal 400 1em/1 \"Font Awesome 6 Brands\"}svg:not(:host).svg-inline--fa,svg:not(:root).svg-inline--fa{overflow:visible;box-sizing:content-box}.svg-inline--fa{display:var(--fa-display,inline-block);height:1em;overflow:visible;vertical-align:-.125em}.svg-inline--fa.fa-2xs{vertical-align:.1em}.svg-inline--fa.fa-xs{vertical-align:0}.svg-inline--fa.fa-sm{vertical-align:-.0714285705em}.svg-inline--fa.fa-lg{vertical-align:-.2em}.svg-inline--fa.fa-xl{vertical-align:-.25em}.svg-inline--fa.fa-2xl{vertical-align:-.3125em}.svg-inline--fa.fa-pull-left{margin-right:var(--fa-pull-margin,.3em);width:auto}.svg-inline--fa.fa-pull-right{margin-left:var(--fa-pull-margin,.3em);width:auto}.svg-inline--fa.fa-li{width:var(--fa-li-width,2em);top:.25em}.svg-inline--fa.fa-fw{width:var(--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-counter,.fa-layers-text{display:inline-block;position:absolute;text-align:center}.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-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:var(--fa-counter-background-color,#ff253a);border-radius:var(--fa-counter-border-radius,1em);box-sizing:border-box;color:var(--fa-inverse,#fff);line-height:var(--fa-counter-line-height,1);max-width:var(--fa-counter-max-width,5em);min-width:var(--fa-counter-min-width,1.5em);overflow:hidden;padding:var(--fa-counter-padding,.25em .5em);right:var(--fa-right,0);text-overflow:ellipsis;top:var(--fa-top,0);-webkit-transform:scale(var(--fa-counter-scale,.25));transform:scale(var(--fa-counter-scale,.25));-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-bottom-right{bottom:var(--fa-bottom,0);right:var(--fa-right,0);top:auto;-webkit-transform:scale(var(--fa-layers-scale,.25));transform:scale(var(--fa-layers-scale,.25));-webkit-transform-origin:bottom right;transform-origin:bottom right}.fa-layers-bottom-left{bottom:var(--fa-bottom,0);left:var(--fa-left,0);right:auto;top:auto;-webkit-transform:scale(var(--fa-layers-scale,.25));transform:scale(var(--fa-layers-scale,.25));-webkit-transform-origin:bottom left;transform-origin:bottom left}.fa-layers-top-right{top:var(--fa-top,0);right:var(--fa-right,0);-webkit-transform:scale(var(--fa-layers-scale,.25));transform:scale(var(--fa-layers-scale,.25));-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-top-left{left:var(--fa-left,0);right:auto;top:var(--fa-top,0);-webkit-transform:scale(var(--fa-layers-scale,.25));transform:scale(var(--fa-layers-scale,.25));-webkit-transform-origin:top left;transform-origin:top left}.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-2xs{font-size:.625em;line-height:.1em;vertical-align:.225em}.fa-xs{font-size:.75em;line-height:.0833333337em;vertical-align:.125em}.fa-sm{font-size:.875em;line-height:.0714285718em;vertical-align:.0535714295em}.fa-lg{font-size:1.25em;line-height:.05em;vertical-align:-.075em}.fa-xl{font-size:1.5em;line-height:.0416666682em;vertical-align:-.125em}.fa-2xl{font-size:2em;line-height:.03125em;vertical-align:-.1875em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:var(--fa-li-margin,2.5em);padding-left:0}.fa-ul>li{position:relative}.fa-li{left:calc(var(--fa-li-width,2em) * -1);position:absolute;text-align:center;width:var(--fa-li-width,2em);line-height:inherit}.fa-border{border-color:var(--fa-border-color,#eee);border-radius:var(--fa-border-radius,.1em);border-style:var(--fa-border-style,solid);border-width:var(--fa-border-width,.08em);padding:var(--fa-border-padding,.2em .25em .15em)}.fa-pull-left{float:left;margin-right:var(--fa-pull-margin,.3em)}.fa-pull-right{float:right;margin-left:var(--fa-pull-margin,.3em)}.fa-beat{-webkit-animation-name:fa-beat;animation-name:fa-beat;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-bounce{-webkit-animation-name:fa-bounce;animation-name:fa-bounce;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1))}.fa-fade{-webkit-animation-name:fa-fade;animation-name:fa-fade;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-beat-fade{-webkit-animation-name:fa-beat-fade;animation-name:fa-beat-fade;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-flip{-webkit-animation-name:fa-flip;animation-name:fa-flip;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-shake{-webkit-animation-name:fa-shake;animation-name:fa-shake;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-spin{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,2s);animation-duration:var(--fa-animation-duration,2s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-spin-reverse{--fa-animation-direction:reverse}.fa-pulse,.fa-spin-pulse{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,steps(8));animation-timing-function:var(--fa-animation-timing,steps(8))}@media (prefers-reduced-motion:reduce){.fa-beat,.fa-beat-fade,.fa-bounce,.fa-fade,.fa-flip,.fa-pulse,.fa-shake,.fa-spin,.fa-spin-pulse{-webkit-animation-delay:-1ms;animation-delay:-1ms;-webkit-animation-duration:1ms;animation-duration:1ms;-webkit-animation-iteration-count:1;animation-iteration-count:1;transition-delay:0s;transition-duration:0s}}@-webkit-keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@-webkit-keyframes fa-bounce{0%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1,1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1,1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0)}100%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0)}}@keyframes fa-bounce{0%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1,1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1,1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0)}100%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0)}}@-webkit-keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@-webkit-keyframes fa-beat-fade{0%,100%{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@keyframes fa-beat-fade{0%,100%{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@-webkit-keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@-webkit-keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}24%,8%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}100%,40%{-webkit-transform:rotate(0);transform:rotate(0)}}@keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}24%,8%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}100%,40%{-webkit-transform:rotate(0);transform:rotate(0)}}@-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-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}.fa-rotate-by{-webkit-transform:rotate(var(--fa-rotate-angle,none));transform:rotate(var(--fa-rotate-angle,none))}.fa-stack{display:inline-block;vertical-align:middle;height:2em;position:relative;width:2.5em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;z-index:var(--fa-stack-z-index,auto)}.svg-inline--fa.fa-stack-1x{height:1em;width:1.25em}.svg-inline--fa.fa-stack-2x{height:2em;width:2.5em}.fa-inverse{color:var(--fa-inverse,#fff)}.fa-sr-only,.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.fa-sr-only-focusable:not(:focus),.sr-only-focusable:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.svg-inline--fa .fa-primary{fill:var(--fa-primary-color,currentColor);opacity:var(--fa-primary-opacity,1)}.svg-inline--fa .fa-secondary{fill:var(--fa-secondary-color,currentColor);opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-primary{opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-secondary{opacity:var(--fa-primary-opacity,1)}.svg-inline--fa mask .fa-primary,.svg-inline--fa mask .fa-secondary{fill:#000}.fa-duotone.fa-inverse,.fad.fa-inverse{color:var(--fa-inverse,#fff)}";
|
616 |
|
617 | function css() {
|
618 | var dcp = DEFAULT_CSS_PREFIX;
|
619 | var drc = DEFAULT_REPLACEMENT_CLASS;
|
620 | var fp = config.cssPrefix;
|
621 | var rc = config.replacementClass;
|
622 | var s = baseStyles;
|
623 |
|
624 | if (fp !== dcp || rc !== drc) {
|
625 | var dPatt = new RegExp("\\.".concat(dcp, "\\-"), 'g');
|
626 | var customPropPatt = new RegExp("\\--".concat(dcp, "\\-"), 'g');
|
627 | var rPatt = new RegExp("\\.".concat(drc), 'g');
|
628 | s = s.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));
|
629 | }
|
630 |
|
631 | return s;
|
632 | }
|
633 |
|
634 | var _cssInserted = false;
|
635 |
|
636 | function ensureCss() {
|
637 | if (config.autoAddCss && !_cssInserted) {
|
638 | insertCss(css());
|
639 | _cssInserted = true;
|
640 | }
|
641 | }
|
642 |
|
643 | var InjectCSS = {
|
644 | mixout: function mixout() {
|
645 | return {
|
646 | dom: {
|
647 | css: css,
|
648 | insertCss: ensureCss
|
649 | }
|
650 | };
|
651 | },
|
652 | hooks: function hooks() {
|
653 | return {
|
654 | beforeDOMElementCreation: function beforeDOMElementCreation() {
|
655 | ensureCss();
|
656 | },
|
657 | beforeI2svg: function beforeI2svg() {
|
658 | ensureCss();
|
659 | }
|
660 | };
|
661 | }
|
662 | };
|
663 |
|
664 | var w = WINDOW || {};
|
665 | if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};
|
666 | if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};
|
667 | if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};
|
668 | if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];
|
669 | var namespace = w[NAMESPACE_IDENTIFIER];
|
670 |
|
671 | var functions = [];
|
672 |
|
673 | var listener = function listener() {
|
674 | DOCUMENT.removeEventListener('DOMContentLoaded', listener);
|
675 | loaded = 1;
|
676 | functions.map(function (fn) {
|
677 | return fn();
|
678 | });
|
679 | };
|
680 |
|
681 | var loaded = false;
|
682 |
|
683 | if (IS_DOM) {
|
684 | loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
|
685 | if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
|
686 | }
|
687 |
|
688 | function domready (fn) {
|
689 | if (!IS_DOM) return;
|
690 | loaded ? setTimeout(fn, 0) : functions.push(fn);
|
691 | }
|
692 |
|
693 | function toHtml(abstractNodes) {
|
694 | var tag = abstractNodes.tag,
|
695 | _abstractNodes$attrib = abstractNodes.attributes,
|
696 | attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,
|
697 | _abstractNodes$childr = abstractNodes.children,
|
698 | children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;
|
699 |
|
700 | if (typeof abstractNodes === 'string') {
|
701 | return htmlEscape(abstractNodes);
|
702 | } else {
|
703 | return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(''), "</").concat(tag, ">");
|
704 | }
|
705 | }
|
706 |
|
707 | function iconFromMapping(mapping, prefix, iconName) {
|
708 | if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
|
709 | return {
|
710 | prefix: prefix,
|
711 | iconName: iconName,
|
712 | icon: mapping[prefix][iconName]
|
713 | };
|
714 | }
|
715 | }
|
716 |
|
717 | |
718 |
|
719 |
|
720 |
|
721 |
|
722 | var bindInternal4 = function bindInternal4(func, thisContext) {
|
723 | return function (a, b, c, d) {
|
724 | return func.call(thisContext, a, b, c, d);
|
725 | };
|
726 | };
|
727 |
|
728 | |
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 |
|
739 |
|
740 |
|
741 | var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
|
742 | var keys = Object.keys(subject),
|
743 | length = keys.length,
|
744 | iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
|
745 | i,
|
746 | key,
|
747 | result;
|
748 |
|
749 | if (initialValue === undefined) {
|
750 | i = 1;
|
751 | result = subject[keys[0]];
|
752 | } else {
|
753 | i = 0;
|
754 | result = initialValue;
|
755 | }
|
756 |
|
757 | for (; i < length; i++) {
|
758 | key = keys[i];
|
759 | result = iterator(result, subject[key], key, subject);
|
760 | }
|
761 |
|
762 | return result;
|
763 | };
|
764 |
|
765 | |
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 |
|
784 |
|
785 |
|
786 |
|
787 |
|
788 |
|
789 | function ucs2decode(string) {
|
790 | var output = [];
|
791 | var counter = 0;
|
792 | var length = string.length;
|
793 |
|
794 | while (counter < length) {
|
795 | var value = string.charCodeAt(counter++);
|
796 |
|
797 | if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
798 | var extra = string.charCodeAt(counter++);
|
799 |
|
800 | if ((extra & 0xFC00) == 0xDC00) {
|
801 |
|
802 | output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
803 | } else {
|
804 | output.push(value);
|
805 | counter--;
|
806 | }
|
807 | } else {
|
808 | output.push(value);
|
809 | }
|
810 | }
|
811 |
|
812 | return output;
|
813 | }
|
814 |
|
815 | function toHex(unicode) {
|
816 | var decoded = ucs2decode(unicode);
|
817 | return decoded.length === 1 ? decoded[0].toString(16) : null;
|
818 | }
|
819 | function codePointAt(string, index) {
|
820 | var size = string.length;
|
821 | var first = string.charCodeAt(index);
|
822 | var second;
|
823 |
|
824 | if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) {
|
825 | second = string.charCodeAt(index + 1);
|
826 |
|
827 | if (second >= 0xDC00 && second <= 0xDFFF) {
|
828 | return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
|
829 | }
|
830 | }
|
831 |
|
832 | return first;
|
833 | }
|
834 |
|
835 | function normalizeIcons(icons) {
|
836 | return Object.keys(icons).reduce(function (acc, iconName) {
|
837 | var icon = icons[iconName];
|
838 | var expanded = !!icon.icon;
|
839 |
|
840 | if (expanded) {
|
841 | acc[icon.iconName] = icon.icon;
|
842 | } else {
|
843 | acc[iconName] = icon;
|
844 | }
|
845 |
|
846 | return acc;
|
847 | }, {});
|
848 | }
|
849 |
|
850 | function defineIcons(prefix, icons) {
|
851 | var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
852 | var _params$skipHooks = params.skipHooks,
|
853 | skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;
|
854 | var normalized = normalizeIcons(icons);
|
855 |
|
856 | if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {
|
857 | namespace.hooks.addPack(prefix, normalizeIcons(icons));
|
858 | } else {
|
859 | namespace.styles[prefix] = _objectSpread2(_objectSpread2({}, namespace.styles[prefix] || {}), normalized);
|
860 | }
|
861 | |
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 | if (prefix === 'fas') {
|
870 | defineIcons('fa', icons);
|
871 | }
|
872 | }
|
873 |
|
874 | var duotonePathRe = [_wrapRegExp(/path d="((?:(?!")[\s\S])+)".*path d="((?:(?!")[\s\S])+)"/, {
|
875 | d1: 1,
|
876 | d2: 2
|
877 | }), _wrapRegExp(/path class="((?:(?!")[\s\S])+)".*d="((?:(?!")[\s\S])+)".*path class="((?:(?!")[\s\S])+)".*d="((?:(?!")[\s\S])+)"/, {
|
878 | cls1: 1,
|
879 | d1: 2,
|
880 | cls2: 3,
|
881 | d2: 4
|
882 | }), _wrapRegExp(/path class="((?:(?!")[\s\S])+)".*d="((?:(?!")[\s\S])+)"/, {
|
883 | cls1: 1,
|
884 | d1: 2
|
885 | })];
|
886 |
|
887 | var _LONG_STYLE, _PREFIXES, _PREFIXES_FOR_FAMILY;
|
888 | var styles = namespace.styles,
|
889 | shims = namespace.shims;
|
890 | var LONG_STYLE = (_LONG_STYLE = {}, _defineProperty(_LONG_STYLE, FAMILY_CLASSIC, Object.values(PREFIX_TO_LONG_STYLE[FAMILY_CLASSIC])), _defineProperty(_LONG_STYLE, FAMILY_SHARP, Object.values(PREFIX_TO_LONG_STYLE[FAMILY_SHARP])), _LONG_STYLE);
|
891 | var _defaultUsablePrefix = null;
|
892 | var _byUnicode = {};
|
893 | var _byLigature = {};
|
894 | var _byOldName = {};
|
895 | var _byOldUnicode = {};
|
896 | var _byAlias = {};
|
897 | var PREFIXES = (_PREFIXES = {}, _defineProperty(_PREFIXES, FAMILY_CLASSIC, Object.keys(PREFIX_TO_STYLE[FAMILY_CLASSIC])), _defineProperty(_PREFIXES, FAMILY_SHARP, Object.keys(PREFIX_TO_STYLE[FAMILY_SHARP])), _PREFIXES);
|
898 |
|
899 | function isReserved(name) {
|
900 | return ~RESERVED_CLASSES.indexOf(name);
|
901 | }
|
902 |
|
903 | function getIconName(cssPrefix, cls) {
|
904 | var parts = cls.split('-');
|
905 | var prefix = parts[0];
|
906 | var iconName = parts.slice(1).join('-');
|
907 |
|
908 | if (prefix === cssPrefix && iconName !== '' && !isReserved(iconName)) {
|
909 | return iconName;
|
910 | } else {
|
911 | return null;
|
912 | }
|
913 | }
|
914 | var build = function build() {
|
915 | var lookup = function lookup(reducer) {
|
916 | return reduce(styles, function (o, style, prefix) {
|
917 | o[prefix] = reduce(style, reducer, {});
|
918 | return o;
|
919 | }, {});
|
920 | };
|
921 |
|
922 | _byUnicode = lookup(function (acc, icon, iconName) {
|
923 | if (icon[3]) {
|
924 | acc[icon[3]] = iconName;
|
925 | }
|
926 |
|
927 | if (icon[2]) {
|
928 | var aliases = icon[2].filter(function (a) {
|
929 | return typeof a === 'number';
|
930 | });
|
931 | aliases.forEach(function (alias) {
|
932 | acc[alias.toString(16)] = iconName;
|
933 | });
|
934 | }
|
935 |
|
936 | return acc;
|
937 | });
|
938 | _byLigature = lookup(function (acc, icon, iconName) {
|
939 | acc[iconName] = iconName;
|
940 |
|
941 | if (icon[2]) {
|
942 | var aliases = icon[2].filter(function (a) {
|
943 | return typeof a === 'string';
|
944 | });
|
945 | aliases.forEach(function (alias) {
|
946 | acc[alias] = iconName;
|
947 | });
|
948 | }
|
949 |
|
950 | return acc;
|
951 | });
|
952 | _byAlias = lookup(function (acc, icon, iconName) {
|
953 | var aliases = icon[2];
|
954 | acc[iconName] = iconName;
|
955 | aliases.forEach(function (alias) {
|
956 | acc[alias] = iconName;
|
957 | });
|
958 | return acc;
|
959 | });
|
960 |
|
961 |
|
962 | var hasRegular = 'far' in styles || config.autoFetchSvg;
|
963 | var shimLookups = reduce(shims, function (acc, shim) {
|
964 | var maybeNameMaybeUnicode = shim[0];
|
965 | var prefix = shim[1];
|
966 | var iconName = shim[2];
|
967 |
|
968 | if (prefix === 'far' && !hasRegular) {
|
969 | prefix = 'fas';
|
970 | }
|
971 |
|
972 | if (typeof maybeNameMaybeUnicode === 'string') {
|
973 | acc.names[maybeNameMaybeUnicode] = {
|
974 | prefix: prefix,
|
975 | iconName: iconName
|
976 | };
|
977 | }
|
978 |
|
979 | if (typeof maybeNameMaybeUnicode === 'number') {
|
980 | acc.unicodes[maybeNameMaybeUnicode.toString(16)] = {
|
981 | prefix: prefix,
|
982 | iconName: iconName
|
983 | };
|
984 | }
|
985 |
|
986 | return acc;
|
987 | }, {
|
988 | names: {},
|
989 | unicodes: {}
|
990 | });
|
991 | _byOldName = shimLookups.names;
|
992 | _byOldUnicode = shimLookups.unicodes;
|
993 | _defaultUsablePrefix = getCanonicalPrefix(config.styleDefault, {
|
994 | family: config.familyDefault
|
995 | });
|
996 | };
|
997 | onChange(function (c) {
|
998 | _defaultUsablePrefix = getCanonicalPrefix(c.styleDefault, {
|
999 | family: config.familyDefault
|
1000 | });
|
1001 | });
|
1002 | build();
|
1003 | function byUnicode(prefix, unicode) {
|
1004 | return (_byUnicode[prefix] || {})[unicode];
|
1005 | }
|
1006 | function byLigature(prefix, ligature) {
|
1007 | return (_byLigature[prefix] || {})[ligature];
|
1008 | }
|
1009 | function byAlias(prefix, alias) {
|
1010 | return (_byAlias[prefix] || {})[alias];
|
1011 | }
|
1012 | function byOldName(name) {
|
1013 | return _byOldName[name] || {
|
1014 | prefix: null,
|
1015 | iconName: null
|
1016 | };
|
1017 | }
|
1018 | function byOldUnicode(unicode) {
|
1019 | var oldUnicode = _byOldUnicode[unicode];
|
1020 | var newUnicode = byUnicode('fas', unicode);
|
1021 | return oldUnicode || (newUnicode ? {
|
1022 | prefix: 'fas',
|
1023 | iconName: newUnicode
|
1024 | } : null) || {
|
1025 | prefix: null,
|
1026 | iconName: null
|
1027 | };
|
1028 | }
|
1029 | function getDefaultUsablePrefix() {
|
1030 | return _defaultUsablePrefix;
|
1031 | }
|
1032 | var emptyCanonicalIcon = function emptyCanonicalIcon() {
|
1033 | return {
|
1034 | prefix: null,
|
1035 | iconName: null,
|
1036 | rest: []
|
1037 | };
|
1038 | };
|
1039 | function getCanonicalPrefix(styleOrPrefix) {
|
1040 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1041 | var _params$family = params.family,
|
1042 | family = _params$family === void 0 ? FAMILY_CLASSIC : _params$family;
|
1043 | var style = PREFIX_TO_STYLE[family][styleOrPrefix];
|
1044 | var prefix = STYLE_TO_PREFIX[family][styleOrPrefix] || STYLE_TO_PREFIX[family][style];
|
1045 | var defined = styleOrPrefix in namespace.styles ? styleOrPrefix : null;
|
1046 | return prefix || defined || null;
|
1047 | }
|
1048 | var PREFIXES_FOR_FAMILY = (_PREFIXES_FOR_FAMILY = {}, _defineProperty(_PREFIXES_FOR_FAMILY, FAMILY_CLASSIC, Object.keys(PREFIX_TO_LONG_STYLE[FAMILY_CLASSIC])), _defineProperty(_PREFIXES_FOR_FAMILY, FAMILY_SHARP, Object.keys(PREFIX_TO_LONG_STYLE[FAMILY_SHARP])), _PREFIXES_FOR_FAMILY);
|
1049 | function getCanonicalIcon(values) {
|
1050 | var _famProps;
|
1051 |
|
1052 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1053 | var _params$skipLookups = params.skipLookups,
|
1054 | skipLookups = _params$skipLookups === void 0 ? false : _params$skipLookups;
|
1055 | var famProps = (_famProps = {}, _defineProperty(_famProps, FAMILY_CLASSIC, "".concat(config.cssPrefix, "-").concat(FAMILY_CLASSIC)), _defineProperty(_famProps, FAMILY_SHARP, "".concat(config.cssPrefix, "-").concat(FAMILY_SHARP)), _famProps);
|
1056 | var givenPrefix = null;
|
1057 | var family = FAMILY_CLASSIC;
|
1058 |
|
1059 | if (values.includes(famProps[FAMILY_CLASSIC]) || values.some(function (v) {
|
1060 | return PREFIXES_FOR_FAMILY[FAMILY_CLASSIC].includes(v);
|
1061 | })) {
|
1062 | family = FAMILY_CLASSIC;
|
1063 | }
|
1064 |
|
1065 | if (values.includes(famProps[FAMILY_SHARP]) || values.some(function (v) {
|
1066 | return PREFIXES_FOR_FAMILY[FAMILY_SHARP].includes(v);
|
1067 | })) {
|
1068 | family = FAMILY_SHARP;
|
1069 | }
|
1070 |
|
1071 | var canonical = values.reduce(function (acc, cls) {
|
1072 | var iconName = getIconName(config.cssPrefix, cls);
|
1073 |
|
1074 | if (styles[cls]) {
|
1075 | cls = LONG_STYLE[family].includes(cls) ? LONG_STYLE_TO_PREFIX[family][cls] : cls;
|
1076 | givenPrefix = cls;
|
1077 | acc.prefix = cls;
|
1078 | } else if (PREFIXES[family].indexOf(cls) > -1) {
|
1079 | givenPrefix = cls;
|
1080 | acc.prefix = getCanonicalPrefix(cls, {
|
1081 | family: family
|
1082 | });
|
1083 | } else if (iconName) {
|
1084 | acc.iconName = iconName;
|
1085 | } else if (cls !== config.replacementClass && cls !== famProps[FAMILY_CLASSIC] && cls !== famProps[FAMILY_SHARP]) {
|
1086 | acc.rest.push(cls);
|
1087 | }
|
1088 |
|
1089 | if (!skipLookups && acc.prefix && acc.iconName) {
|
1090 | var shim = givenPrefix === 'fa' ? byOldName(acc.iconName) : {};
|
1091 | var aliasIconName = byAlias(acc.prefix, acc.iconName);
|
1092 |
|
1093 | if (shim.prefix) {
|
1094 | givenPrefix = null;
|
1095 | }
|
1096 |
|
1097 | acc.iconName = shim.iconName || aliasIconName || acc.iconName;
|
1098 | acc.prefix = shim.prefix || acc.prefix;
|
1099 |
|
1100 | if (acc.prefix === 'far' && !styles['far'] && styles['fas'] && !config.autoFetchSvg) {
|
1101 |
|
1102 |
|
1103 | acc.prefix = 'fas';
|
1104 | }
|
1105 | }
|
1106 |
|
1107 | return acc;
|
1108 | }, emptyCanonicalIcon());
|
1109 |
|
1110 | if (values.includes('fa-brands') || values.includes('fab')) {
|
1111 | canonical.prefix = 'fab';
|
1112 | }
|
1113 |
|
1114 | if (values.includes('fa-duotone') || values.includes('fad')) {
|
1115 | canonical.prefix = 'fad';
|
1116 | }
|
1117 |
|
1118 | if (!canonical.prefix && family === FAMILY_SHARP && (styles['fass'] || config.autoFetchSvg)) {
|
1119 | canonical.prefix = 'fass';
|
1120 | canonical.iconName = byAlias(canonical.prefix, canonical.iconName) || canonical.iconName;
|
1121 | }
|
1122 |
|
1123 | if (canonical.prefix === 'fa' || givenPrefix === 'fa') {
|
1124 |
|
1125 |
|
1126 | canonical.prefix = getDefaultUsablePrefix() || 'fas';
|
1127 | }
|
1128 |
|
1129 | return canonical;
|
1130 | }
|
1131 |
|
1132 | var Library = function () {
|
1133 | function Library() {
|
1134 | _classCallCheck(this, Library);
|
1135 |
|
1136 | this.definitions = {};
|
1137 | }
|
1138 |
|
1139 | _createClass(Library, [{
|
1140 | key: "add",
|
1141 | value: function add() {
|
1142 | var _this = this;
|
1143 |
|
1144 | for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {
|
1145 | definitions[_key] = arguments[_key];
|
1146 | }
|
1147 |
|
1148 | var additions = definitions.reduce(this._pullDefinitions, {});
|
1149 | Object.keys(additions).forEach(function (key) {
|
1150 | _this.definitions[key] = _objectSpread2(_objectSpread2({}, _this.definitions[key] || {}), additions[key]);
|
1151 | defineIcons(key, additions[key]);
|
1152 |
|
1153 | var longPrefix = PREFIX_TO_LONG_STYLE[FAMILY_CLASSIC][key];
|
1154 | if (longPrefix) defineIcons(longPrefix, additions[key]);
|
1155 | build();
|
1156 | });
|
1157 | }
|
1158 | }, {
|
1159 | key: "reset",
|
1160 | value: function reset() {
|
1161 | this.definitions = {};
|
1162 | }
|
1163 | }, {
|
1164 | key: "_pullDefinitions",
|
1165 | value: function _pullDefinitions(additions, definition) {
|
1166 | var normalized = definition.prefix && definition.iconName && definition.icon ? {
|
1167 | 0: definition
|
1168 | } : definition;
|
1169 | Object.keys(normalized).map(function (key) {
|
1170 | var _normalized$key = normalized[key],
|
1171 | prefix = _normalized$key.prefix,
|
1172 | iconName = _normalized$key.iconName,
|
1173 | icon = _normalized$key.icon;
|
1174 | var aliases = icon[2];
|
1175 | if (!additions[prefix]) additions[prefix] = {};
|
1176 |
|
1177 | if (aliases.length > 0) {
|
1178 | aliases.forEach(function (alias) {
|
1179 | if (typeof alias === 'string') {
|
1180 | additions[prefix][alias] = icon;
|
1181 | }
|
1182 | });
|
1183 | }
|
1184 |
|
1185 | additions[prefix][iconName] = icon;
|
1186 | });
|
1187 | return additions;
|
1188 | }
|
1189 | }]);
|
1190 |
|
1191 | return Library;
|
1192 | }();
|
1193 |
|
1194 | var _plugins = [];
|
1195 | var _hooks = {};
|
1196 | var providers = {};
|
1197 | var defaultProviderKeys = Object.keys(providers);
|
1198 | function registerPlugins(nextPlugins, _ref) {
|
1199 | var obj = _ref.mixoutsTo;
|
1200 | _plugins = nextPlugins;
|
1201 | _hooks = {};
|
1202 | Object.keys(providers).forEach(function (k) {
|
1203 | if (defaultProviderKeys.indexOf(k) === -1) {
|
1204 | delete providers[k];
|
1205 | }
|
1206 | });
|
1207 |
|
1208 | _plugins.forEach(function (plugin) {
|
1209 | var mixout = plugin.mixout ? plugin.mixout() : {};
|
1210 | Object.keys(mixout).forEach(function (tk) {
|
1211 | if (typeof mixout[tk] === 'function') {
|
1212 | obj[tk] = mixout[tk];
|
1213 | }
|
1214 |
|
1215 | if (_typeof(mixout[tk]) === 'object') {
|
1216 | Object.keys(mixout[tk]).forEach(function (sk) {
|
1217 | if (!obj[tk]) {
|
1218 | obj[tk] = {};
|
1219 | }
|
1220 |
|
1221 | obj[tk][sk] = mixout[tk][sk];
|
1222 | });
|
1223 | }
|
1224 | });
|
1225 |
|
1226 | if (plugin.hooks) {
|
1227 | var hooks = plugin.hooks();
|
1228 | Object.keys(hooks).forEach(function (hook) {
|
1229 | if (!_hooks[hook]) {
|
1230 | _hooks[hook] = [];
|
1231 | }
|
1232 |
|
1233 | _hooks[hook].push(hooks[hook]);
|
1234 | });
|
1235 | }
|
1236 |
|
1237 | if (plugin.provides) {
|
1238 | plugin.provides(providers);
|
1239 | }
|
1240 | });
|
1241 |
|
1242 | return obj;
|
1243 | }
|
1244 | function chainHooks(hook, accumulator) {
|
1245 | for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
1246 | args[_key - 2] = arguments[_key];
|
1247 | }
|
1248 |
|
1249 | var hookFns = _hooks[hook] || [];
|
1250 | hookFns.forEach(function (hookFn) {
|
1251 | accumulator = hookFn.apply(null, [accumulator].concat(args));
|
1252 | });
|
1253 | return accumulator;
|
1254 | }
|
1255 | function callHooks(hook) {
|
1256 | for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
1257 | args[_key2 - 1] = arguments[_key2];
|
1258 | }
|
1259 |
|
1260 | var hookFns = _hooks[hook] || [];
|
1261 | hookFns.forEach(function (hookFn) {
|
1262 | hookFn.apply(null, args);
|
1263 | });
|
1264 | return undefined;
|
1265 | }
|
1266 | function callProvided() {
|
1267 | var hook = arguments[0];
|
1268 | var args = Array.prototype.slice.call(arguments, 1);
|
1269 | return providers[hook] ? providers[hook].apply(null, args) : undefined;
|
1270 | }
|
1271 |
|
1272 | function findIconDefinition(iconLookup) {
|
1273 | if (iconLookup.prefix === 'fa') {
|
1274 | iconLookup.prefix = 'fas';
|
1275 | }
|
1276 |
|
1277 | var iconName = iconLookup.iconName;
|
1278 | var prefix = iconLookup.prefix || getDefaultUsablePrefix();
|
1279 | if (!iconName) return;
|
1280 | iconName = byAlias(prefix, iconName) || iconName;
|
1281 | return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);
|
1282 | }
|
1283 | var library = new Library();
|
1284 | var noAuto = function noAuto() {
|
1285 | config.autoReplaceSvg = false;
|
1286 | config.observeMutations = false;
|
1287 | callHooks('noAuto');
|
1288 | };
|
1289 | var dom = {
|
1290 | i2svg: function i2svg() {
|
1291 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
1292 |
|
1293 | if (IS_DOM) {
|
1294 | callHooks('beforeI2svg', params);
|
1295 | callProvided('pseudoElements2svg', params);
|
1296 | return callProvided('i2svg', params);
|
1297 | } else {
|
1298 | return Promise.reject('Operation requires a DOM of some kind.');
|
1299 | }
|
1300 | },
|
1301 | watch: function watch() {
|
1302 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
1303 | var autoReplaceSvgRoot = params.autoReplaceSvgRoot;
|
1304 |
|
1305 | if (config.autoReplaceSvg === false) {
|
1306 | config.autoReplaceSvg = true;
|
1307 | }
|
1308 |
|
1309 | config.observeMutations = true;
|
1310 | domready(function () {
|
1311 | autoReplace({
|
1312 | autoReplaceSvgRoot: autoReplaceSvgRoot
|
1313 | });
|
1314 | callHooks('watch', params);
|
1315 | });
|
1316 | }
|
1317 | };
|
1318 | var parse = {
|
1319 | icon: function icon(_icon) {
|
1320 | if (_icon === null) {
|
1321 | return null;
|
1322 | }
|
1323 |
|
1324 | if (_typeof(_icon) === 'object' && _icon.prefix && _icon.iconName) {
|
1325 | return {
|
1326 | prefix: _icon.prefix,
|
1327 | iconName: byAlias(_icon.prefix, _icon.iconName) || _icon.iconName
|
1328 | };
|
1329 | }
|
1330 |
|
1331 | if (Array.isArray(_icon) && _icon.length === 2) {
|
1332 | var iconName = _icon[1].indexOf('fa-') === 0 ? _icon[1].slice(3) : _icon[1];
|
1333 | var prefix = getCanonicalPrefix(_icon[0]);
|
1334 | return {
|
1335 | prefix: prefix,
|
1336 | iconName: byAlias(prefix, iconName) || iconName
|
1337 | };
|
1338 | }
|
1339 |
|
1340 | if (typeof _icon === 'string' && (_icon.indexOf("".concat(config.cssPrefix, "-")) > -1 || _icon.match(ICON_SELECTION_SYNTAX_PATTERN))) {
|
1341 | var canonicalIcon = getCanonicalIcon(_icon.split(' '), {
|
1342 | skipLookups: true
|
1343 | });
|
1344 | return {
|
1345 | prefix: canonicalIcon.prefix || getDefaultUsablePrefix(),
|
1346 | iconName: byAlias(canonicalIcon.prefix, canonicalIcon.iconName) || canonicalIcon.iconName
|
1347 | };
|
1348 | }
|
1349 |
|
1350 | if (typeof _icon === 'string') {
|
1351 | var _prefix = getDefaultUsablePrefix();
|
1352 |
|
1353 | return {
|
1354 | prefix: _prefix,
|
1355 | iconName: byAlias(_prefix, _icon) || _icon
|
1356 | };
|
1357 | }
|
1358 | }
|
1359 | };
|
1360 | var api = {
|
1361 | noAuto: noAuto,
|
1362 | config: config,
|
1363 | dom: dom,
|
1364 | parse: parse,
|
1365 | library: library,
|
1366 | findIconDefinition: findIconDefinition,
|
1367 | toHtml: toHtml
|
1368 | };
|
1369 |
|
1370 | var autoReplace = function autoReplace() {
|
1371 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
1372 | var _params$autoReplaceSv = params.autoReplaceSvgRoot,
|
1373 | autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv;
|
1374 | if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({
|
1375 | node: autoReplaceSvgRoot
|
1376 | });
|
1377 | };
|
1378 |
|
1379 | function bootstrap(plugins) {
|
1380 | if (IS_BROWSER) {
|
1381 | if (!WINDOW.FontAwesome) {
|
1382 | WINDOW.FontAwesome = api;
|
1383 | }
|
1384 |
|
1385 | domready(function () {
|
1386 | autoReplace();
|
1387 | callHooks('bootstrap');
|
1388 | });
|
1389 | }
|
1390 |
|
1391 | namespace.hooks = _objectSpread2(_objectSpread2({}, namespace.hooks), {}, {
|
1392 | addPack: function addPack(prefix, icons) {
|
1393 | namespace.styles[prefix] = _objectSpread2(_objectSpread2({}, namespace.styles[prefix] || {}), icons);
|
1394 | build();
|
1395 | autoReplace();
|
1396 | },
|
1397 | addPacks: function addPacks(packs) {
|
1398 | packs.forEach(function (_ref) {
|
1399 | var _ref2 = _slicedToArray(_ref, 2),
|
1400 | prefix = _ref2[0],
|
1401 | icons = _ref2[1];
|
1402 |
|
1403 | namespace.styles[prefix] = _objectSpread2(_objectSpread2({}, namespace.styles[prefix] || {}), icons);
|
1404 | });
|
1405 | build();
|
1406 | autoReplace();
|
1407 | },
|
1408 | addShims: function addShims(shims) {
|
1409 | var _namespace$shims;
|
1410 |
|
1411 | (_namespace$shims = namespace.shims).push.apply(_namespace$shims, _toConsumableArray(shims));
|
1412 |
|
1413 | build();
|
1414 | autoReplace();
|
1415 | }
|
1416 | });
|
1417 | }
|
1418 |
|
1419 | function domVariants(val, abstractCreator) {
|
1420 | Object.defineProperty(val, 'abstract', {
|
1421 | get: abstractCreator
|
1422 | });
|
1423 | Object.defineProperty(val, 'html', {
|
1424 | get: function get() {
|
1425 | return val.abstract.map(function (a) {
|
1426 | return toHtml(a);
|
1427 | });
|
1428 | }
|
1429 | });
|
1430 | Object.defineProperty(val, 'node', {
|
1431 | get: function get() {
|
1432 | if (!IS_DOM) return;
|
1433 | var container = DOCUMENT.createElement('div');
|
1434 | container.innerHTML = val.html;
|
1435 | return container.children;
|
1436 | }
|
1437 | });
|
1438 | return val;
|
1439 | }
|
1440 |
|
1441 | function asIcon (_ref) {
|
1442 | var children = _ref.children,
|
1443 | main = _ref.main,
|
1444 | mask = _ref.mask,
|
1445 | attributes = _ref.attributes,
|
1446 | styles = _ref.styles,
|
1447 | transform = _ref.transform;
|
1448 |
|
1449 | if (transformIsMeaningful(transform) && main.found && !mask.found) {
|
1450 | var width = main.width,
|
1451 | height = main.height;
|
1452 | var offset = {
|
1453 | x: width / height / 2,
|
1454 | y: 0.5
|
1455 | };
|
1456 | attributes['style'] = joinStyles(_objectSpread2(_objectSpread2({}, styles), {}, {
|
1457 | 'transform-origin': "".concat(offset.x + transform.x / 16, "em ").concat(offset.y + transform.y / 16, "em")
|
1458 | }));
|
1459 | }
|
1460 |
|
1461 | return [{
|
1462 | tag: 'svg',
|
1463 | attributes: attributes,
|
1464 | children: children
|
1465 | }];
|
1466 | }
|
1467 |
|
1468 | function asSymbol (_ref) {
|
1469 | var prefix = _ref.prefix,
|
1470 | iconName = _ref.iconName,
|
1471 | children = _ref.children,
|
1472 | attributes = _ref.attributes,
|
1473 | symbol = _ref.symbol;
|
1474 | var id = symbol === true ? "".concat(prefix, "-").concat(config.cssPrefix, "-").concat(iconName) : symbol;
|
1475 | return [{
|
1476 | tag: 'svg',
|
1477 | attributes: {
|
1478 | style: 'display: none;'
|
1479 | },
|
1480 | children: [{
|
1481 | tag: 'symbol',
|
1482 | attributes: _objectSpread2(_objectSpread2({}, attributes), {}, {
|
1483 | id: id
|
1484 | }),
|
1485 | children: children
|
1486 | }]
|
1487 | }];
|
1488 | }
|
1489 |
|
1490 | function makeInlineSvgAbstract(params) {
|
1491 | var _params$icons = params.icons,
|
1492 | main = _params$icons.main,
|
1493 | mask = _params$icons.mask,
|
1494 | prefix = params.prefix,
|
1495 | iconName = params.iconName,
|
1496 | transform = params.transform,
|
1497 | symbol = params.symbol,
|
1498 | title = params.title,
|
1499 | maskId = params.maskId,
|
1500 | titleId = params.titleId,
|
1501 | extra = params.extra,
|
1502 | _params$watchable = params.watchable,
|
1503 | watchable = _params$watchable === void 0 ? false : _params$watchable;
|
1504 |
|
1505 | var _ref = mask.found ? mask : main,
|
1506 | width = _ref.width,
|
1507 | height = _ref.height;
|
1508 |
|
1509 | var isUploadedIcon = prefix === 'fak';
|
1510 | var attrClass = [config.replacementClass, iconName ? "".concat(config.cssPrefix, "-").concat(iconName) : ''].filter(function (c) {
|
1511 | return extra.classes.indexOf(c) === -1;
|
1512 | }).filter(function (c) {
|
1513 | return c !== '' || !!c;
|
1514 | }).concat(extra.classes).join(' ');
|
1515 | var content = {
|
1516 | children: [],
|
1517 | attributes: _objectSpread2(_objectSpread2({}, extra.attributes), {}, {
|
1518 | 'data-prefix': prefix,
|
1519 | 'data-icon': iconName,
|
1520 | 'class': attrClass,
|
1521 | 'role': extra.attributes.role || 'img',
|
1522 | 'xmlns': 'http://www.w3.org/2000/svg',
|
1523 | 'viewBox': "0 0 ".concat(width, " ").concat(height)
|
1524 | })
|
1525 | };
|
1526 | var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {
|
1527 | width: "".concat(width / height * 16 * 0.0625, "em")
|
1528 | } : {};
|
1529 |
|
1530 | if (watchable) {
|
1531 | content.attributes[DATA_FA_I2SVG] = '';
|
1532 | }
|
1533 |
|
1534 | if (title) {
|
1535 | content.children.push({
|
1536 | tag: 'title',
|
1537 | attributes: {
|
1538 | id: content.attributes['aria-labelledby'] || "title-".concat(titleId || nextUniqueId())
|
1539 | },
|
1540 | children: [title]
|
1541 | });
|
1542 | delete content.attributes.title;
|
1543 | }
|
1544 |
|
1545 | var args = _objectSpread2(_objectSpread2({}, content), {}, {
|
1546 | prefix: prefix,
|
1547 | iconName: iconName,
|
1548 | main: main,
|
1549 | mask: mask,
|
1550 | maskId: maskId,
|
1551 | transform: transform,
|
1552 | symbol: symbol,
|
1553 | styles: _objectSpread2(_objectSpread2({}, uploadedIconWidthStyle), extra.styles)
|
1554 | });
|
1555 |
|
1556 | var _ref2 = mask.found && main.found ? callProvided('generateAbstractMask', args) || {
|
1557 | children: [],
|
1558 | attributes: {}
|
1559 | } : callProvided('generateAbstractIcon', args) || {
|
1560 | children: [],
|
1561 | attributes: {}
|
1562 | },
|
1563 | children = _ref2.children,
|
1564 | attributes = _ref2.attributes;
|
1565 |
|
1566 | args.children = children;
|
1567 | args.attributes = attributes;
|
1568 |
|
1569 | if (symbol) {
|
1570 | return asSymbol(args);
|
1571 | } else {
|
1572 | return asIcon(args);
|
1573 | }
|
1574 | }
|
1575 | function makeLayersTextAbstract(params) {
|
1576 | var content = params.content,
|
1577 | width = params.width,
|
1578 | height = params.height,
|
1579 | transform = params.transform,
|
1580 | title = params.title,
|
1581 | extra = params.extra,
|
1582 | _params$watchable2 = params.watchable,
|
1583 | watchable = _params$watchable2 === void 0 ? false : _params$watchable2;
|
1584 |
|
1585 | var attributes = _objectSpread2(_objectSpread2(_objectSpread2({}, extra.attributes), title ? {
|
1586 | 'title': title
|
1587 | } : {}), {}, {
|
1588 | 'class': extra.classes.join(' ')
|
1589 | });
|
1590 |
|
1591 | if (watchable) {
|
1592 | attributes[DATA_FA_I2SVG] = '';
|
1593 | }
|
1594 |
|
1595 | var styles = _objectSpread2({}, extra.styles);
|
1596 |
|
1597 | if (transformIsMeaningful(transform)) {
|
1598 | styles['transform'] = transformForCss({
|
1599 | transform: transform,
|
1600 | startCentered: true,
|
1601 | width: width,
|
1602 | height: height
|
1603 | });
|
1604 | styles['-webkit-transform'] = styles['transform'];
|
1605 | }
|
1606 |
|
1607 | var styleString = joinStyles(styles);
|
1608 |
|
1609 | if (styleString.length > 0) {
|
1610 | attributes['style'] = styleString;
|
1611 | }
|
1612 |
|
1613 | var val = [];
|
1614 | val.push({
|
1615 | tag: 'span',
|
1616 | attributes: attributes,
|
1617 | children: [content]
|
1618 | });
|
1619 |
|
1620 | if (title) {
|
1621 | val.push({
|
1622 | tag: 'span',
|
1623 | attributes: {
|
1624 | class: 'sr-only'
|
1625 | },
|
1626 | children: [title]
|
1627 | });
|
1628 | }
|
1629 |
|
1630 | return val;
|
1631 | }
|
1632 | function makeLayersCounterAbstract(params) {
|
1633 | var content = params.content,
|
1634 | title = params.title,
|
1635 | extra = params.extra;
|
1636 |
|
1637 | var attributes = _objectSpread2(_objectSpread2(_objectSpread2({}, extra.attributes), title ? {
|
1638 | 'title': title
|
1639 | } : {}), {}, {
|
1640 | 'class': extra.classes.join(' ')
|
1641 | });
|
1642 |
|
1643 | var styleString = joinStyles(extra.styles);
|
1644 |
|
1645 | if (styleString.length > 0) {
|
1646 | attributes['style'] = styleString;
|
1647 | }
|
1648 |
|
1649 | var val = [];
|
1650 | val.push({
|
1651 | tag: 'span',
|
1652 | attributes: attributes,
|
1653 | children: [content]
|
1654 | });
|
1655 |
|
1656 | if (title) {
|
1657 | val.push({
|
1658 | tag: 'span',
|
1659 | attributes: {
|
1660 | class: 'sr-only'
|
1661 | },
|
1662 | children: [title]
|
1663 | });
|
1664 | }
|
1665 |
|
1666 | return val;
|
1667 | }
|
1668 |
|
1669 | var styles$1 = namespace.styles;
|
1670 | function asFoundIcon(icon) {
|
1671 | var width = icon[0];
|
1672 | var height = icon[1];
|
1673 |
|
1674 | var _icon$slice = icon.slice(4),
|
1675 | _icon$slice2 = _slicedToArray(_icon$slice, 1),
|
1676 | vectorData = _icon$slice2[0];
|
1677 |
|
1678 | var element = null;
|
1679 |
|
1680 | if (Array.isArray(vectorData)) {
|
1681 | element = {
|
1682 | tag: 'g',
|
1683 | attributes: {
|
1684 | class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.GROUP)
|
1685 | },
|
1686 | children: [{
|
1687 | tag: 'path',
|
1688 | attributes: {
|
1689 | class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.SECONDARY),
|
1690 | fill: 'currentColor',
|
1691 | d: vectorData[0]
|
1692 | }
|
1693 | }, {
|
1694 | tag: 'path',
|
1695 | attributes: {
|
1696 | class: "".concat(config.cssPrefix, "-").concat(DUOTONE_CLASSES.PRIMARY),
|
1697 | fill: 'currentColor',
|
1698 | d: vectorData[1]
|
1699 | }
|
1700 | }]
|
1701 | };
|
1702 | } else {
|
1703 | element = {
|
1704 | tag: 'path',
|
1705 | attributes: {
|
1706 | fill: 'currentColor',
|
1707 | d: vectorData
|
1708 | }
|
1709 | };
|
1710 | }
|
1711 |
|
1712 | return {
|
1713 | found: true,
|
1714 | width: width,
|
1715 | height: height,
|
1716 | icon: element
|
1717 | };
|
1718 | }
|
1719 | var missingIconResolutionMixin = {
|
1720 | found: false,
|
1721 | width: 512,
|
1722 | height: 512
|
1723 | };
|
1724 |
|
1725 | function maybeNotifyMissing(iconName, prefix) {
|
1726 | if (!PRODUCTION && !config.showMissingIcons && iconName) {
|
1727 | console.error("Icon with name \"".concat(iconName, "\" and prefix \"").concat(prefix, "\" is missing."));
|
1728 | }
|
1729 | }
|
1730 |
|
1731 | function findIcon(iconName, prefix) {
|
1732 | var givenPrefix = prefix;
|
1733 |
|
1734 | if (prefix === 'fa' && config.styleDefault !== null) {
|
1735 | prefix = getDefaultUsablePrefix();
|
1736 | }
|
1737 |
|
1738 | return new Promise(function (resolve, reject) {
|
1739 | var val = {
|
1740 | found: false,
|
1741 | width: 512,
|
1742 | height: 512,
|
1743 | icon: callProvided('missingIconAbstract') || {}
|
1744 | };
|
1745 |
|
1746 | if (givenPrefix === 'fa') {
|
1747 | var shim = byOldName(iconName) || {};
|
1748 | iconName = shim.iconName || iconName;
|
1749 | prefix = shim.prefix || prefix;
|
1750 | }
|
1751 |
|
1752 | if (iconName && prefix && styles$1[prefix] && styles$1[prefix][iconName]) {
|
1753 | var icon = styles$1[prefix][iconName];
|
1754 | return resolve(asFoundIcon(icon));
|
1755 | }
|
1756 |
|
1757 | maybeNotifyMissing(iconName, prefix);
|
1758 | resolve(_objectSpread2(_objectSpread2({}, missingIconResolutionMixin), {}, {
|
1759 | icon: config.showMissingIcons && iconName ? callProvided('missingIconAbstract') || {} : {}
|
1760 | }));
|
1761 | });
|
1762 | }
|
1763 |
|
1764 | var noop$1 = function noop() {};
|
1765 |
|
1766 | var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
|
1767 | mark: noop$1,
|
1768 | measure: noop$1
|
1769 | };
|
1770 | var preamble = "FA \"6.2.0\"";
|
1771 |
|
1772 | var begin = function begin(name) {
|
1773 | p.mark("".concat(preamble, " ").concat(name, " begins"));
|
1774 | return function () {
|
1775 | return end(name);
|
1776 | };
|
1777 | };
|
1778 |
|
1779 | var end = function end(name) {
|
1780 | p.mark("".concat(preamble, " ").concat(name, " ends"));
|
1781 | p.measure("".concat(preamble, " ").concat(name), "".concat(preamble, " ").concat(name, " begins"), "".concat(preamble, " ").concat(name, " ends"));
|
1782 | };
|
1783 |
|
1784 | var perf = {
|
1785 | begin: begin,
|
1786 | end: end
|
1787 | };
|
1788 |
|
1789 | var noop$2 = function noop() {};
|
1790 |
|
1791 | function isWatched(node) {
|
1792 | var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;
|
1793 | return typeof i2svg === 'string';
|
1794 | }
|
1795 |
|
1796 | function hasPrefixAndIcon(node) {
|
1797 | var prefix = node.getAttribute ? node.getAttribute(DATA_PREFIX) : null;
|
1798 | var icon = node.getAttribute ? node.getAttribute(DATA_ICON) : null;
|
1799 | return prefix && icon;
|
1800 | }
|
1801 |
|
1802 | function hasBeenReplaced(node) {
|
1803 | return node && node.classList && node.classList.contains && node.classList.contains(config.replacementClass);
|
1804 | }
|
1805 |
|
1806 | function getMutator() {
|
1807 | if (config.autoReplaceSvg === true) {
|
1808 | return mutators.replace;
|
1809 | }
|
1810 |
|
1811 | var mutator = mutators[config.autoReplaceSvg];
|
1812 | return mutator || mutators.replace;
|
1813 | }
|
1814 |
|
1815 | function createElementNS(tag) {
|
1816 | return DOCUMENT.createElementNS('http://www.w3.org/2000/svg', tag);
|
1817 | }
|
1818 |
|
1819 | function createElement(tag) {
|
1820 | return DOCUMENT.createElement(tag);
|
1821 | }
|
1822 |
|
1823 | function convertSVG(abstractObj) {
|
1824 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1825 | var _params$ceFn = params.ceFn,
|
1826 | ceFn = _params$ceFn === void 0 ? abstractObj.tag === 'svg' ? createElementNS : createElement : _params$ceFn;
|
1827 |
|
1828 | if (typeof abstractObj === 'string') {
|
1829 | return DOCUMENT.createTextNode(abstractObj);
|
1830 | }
|
1831 |
|
1832 | var tag = ceFn(abstractObj.tag);
|
1833 | Object.keys(abstractObj.attributes || []).forEach(function (key) {
|
1834 | tag.setAttribute(key, abstractObj.attributes[key]);
|
1835 | });
|
1836 | var children = abstractObj.children || [];
|
1837 | children.forEach(function (child) {
|
1838 | tag.appendChild(convertSVG(child, {
|
1839 | ceFn: ceFn
|
1840 | }));
|
1841 | });
|
1842 | return tag;
|
1843 | }
|
1844 |
|
1845 | function nodeAsComment(node) {
|
1846 | var comment = " ".concat(node.outerHTML, " ");
|
1847 |
|
1848 |
|
1849 | comment = "".concat(comment, "Font Awesome fontawesome.com ");
|
1850 |
|
1851 |
|
1852 | return comment;
|
1853 | }
|
1854 |
|
1855 | var mutators = {
|
1856 | replace: function replace(mutation) {
|
1857 | var node = mutation[0];
|
1858 |
|
1859 | if (node.parentNode) {
|
1860 | mutation[1].forEach(function (abstract) {
|
1861 | node.parentNode.insertBefore(convertSVG(abstract), node);
|
1862 | });
|
1863 |
|
1864 | if (node.getAttribute(DATA_FA_I2SVG) === null && config.keepOriginalSource) {
|
1865 | var comment = DOCUMENT.createComment(nodeAsComment(node));
|
1866 | node.parentNode.replaceChild(comment, node);
|
1867 | } else {
|
1868 | node.remove();
|
1869 | }
|
1870 | }
|
1871 | },
|
1872 | nest: function nest(mutation) {
|
1873 | var node = mutation[0];
|
1874 | var abstract = mutation[1];
|
1875 |
|
1876 |
|
1877 | if (~classArray(node).indexOf(config.replacementClass)) {
|
1878 | return mutators.replace(mutation);
|
1879 | }
|
1880 |
|
1881 | var forSvg = new RegExp("".concat(config.cssPrefix, "-.*"));
|
1882 | delete abstract[0].attributes.id;
|
1883 |
|
1884 | if (abstract[0].attributes.class) {
|
1885 | var splitClasses = abstract[0].attributes.class.split(' ').reduce(function (acc, cls) {
|
1886 | if (cls === config.replacementClass || cls.match(forSvg)) {
|
1887 | acc.toSvg.push(cls);
|
1888 | } else {
|
1889 | acc.toNode.push(cls);
|
1890 | }
|
1891 |
|
1892 | return acc;
|
1893 | }, {
|
1894 | toNode: [],
|
1895 | toSvg: []
|
1896 | });
|
1897 | abstract[0].attributes.class = splitClasses.toSvg.join(' ');
|
1898 |
|
1899 | if (splitClasses.toNode.length === 0) {
|
1900 | node.removeAttribute('class');
|
1901 | } else {
|
1902 | node.setAttribute('class', splitClasses.toNode.join(' '));
|
1903 | }
|
1904 | }
|
1905 |
|
1906 | var newInnerHTML = abstract.map(function (a) {
|
1907 | return toHtml(a);
|
1908 | }).join('\n');
|
1909 | node.setAttribute(DATA_FA_I2SVG, '');
|
1910 | node.innerHTML = newInnerHTML;
|
1911 | }
|
1912 | };
|
1913 |
|
1914 | function performOperationSync(op) {
|
1915 | op();
|
1916 | }
|
1917 |
|
1918 | function perform(mutations, callback) {
|
1919 | var callbackFunction = typeof callback === 'function' ? callback : noop$2;
|
1920 |
|
1921 | if (mutations.length === 0) {
|
1922 | callbackFunction();
|
1923 | } else {
|
1924 | var frame = performOperationSync;
|
1925 |
|
1926 | if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {
|
1927 | frame = WINDOW.requestAnimationFrame || performOperationSync;
|
1928 | }
|
1929 |
|
1930 | frame(function () {
|
1931 | var mutator = getMutator();
|
1932 | var mark = perf.begin('mutate');
|
1933 | mutations.map(mutator);
|
1934 | mark();
|
1935 | callbackFunction();
|
1936 | });
|
1937 | }
|
1938 | }
|
1939 | var disabled = false;
|
1940 | function disableObservation() {
|
1941 | disabled = true;
|
1942 | }
|
1943 | function enableObservation() {
|
1944 | disabled = false;
|
1945 | }
|
1946 | var mo = null;
|
1947 | function observe(options) {
|
1948 | if (!MUTATION_OBSERVER) {
|
1949 | return;
|
1950 | }
|
1951 |
|
1952 | if (!config.observeMutations) {
|
1953 | return;
|
1954 | }
|
1955 |
|
1956 | var _options$treeCallback = options.treeCallback,
|
1957 | treeCallback = _options$treeCallback === void 0 ? noop$2 : _options$treeCallback,
|
1958 | _options$nodeCallback = options.nodeCallback,
|
1959 | nodeCallback = _options$nodeCallback === void 0 ? noop$2 : _options$nodeCallback,
|
1960 | _options$pseudoElemen = options.pseudoElementsCallback,
|
1961 | pseudoElementsCallback = _options$pseudoElemen === void 0 ? noop$2 : _options$pseudoElemen,
|
1962 | _options$observeMutat = options.observeMutationsRoot,
|
1963 | observeMutationsRoot = _options$observeMutat === void 0 ? DOCUMENT : _options$observeMutat;
|
1964 | mo = new MUTATION_OBSERVER(function (objects) {
|
1965 | if (disabled) return;
|
1966 | var defaultPrefix = getDefaultUsablePrefix();
|
1967 | toArray(objects).forEach(function (mutationRecord) {
|
1968 | if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {
|
1969 | if (config.searchPseudoElements) {
|
1970 | pseudoElementsCallback(mutationRecord.target);
|
1971 | }
|
1972 |
|
1973 | treeCallback(mutationRecord.target);
|
1974 | }
|
1975 |
|
1976 | if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {
|
1977 | pseudoElementsCallback(mutationRecord.target.parentNode);
|
1978 | }
|
1979 |
|
1980 | if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {
|
1981 | if (mutationRecord.attributeName === 'class' && hasPrefixAndIcon(mutationRecord.target)) {
|
1982 | var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)),
|
1983 | prefix = _getCanonicalIcon.prefix,
|
1984 | iconName = _getCanonicalIcon.iconName;
|
1985 |
|
1986 | mutationRecord.target.setAttribute(DATA_PREFIX, prefix || defaultPrefix);
|
1987 | if (iconName) mutationRecord.target.setAttribute(DATA_ICON, iconName);
|
1988 | } else if (hasBeenReplaced(mutationRecord.target)) {
|
1989 | nodeCallback(mutationRecord.target);
|
1990 | }
|
1991 | }
|
1992 | });
|
1993 | });
|
1994 | if (!IS_DOM) return;
|
1995 | mo.observe(observeMutationsRoot, {
|
1996 | childList: true,
|
1997 | attributes: true,
|
1998 | characterData: true,
|
1999 | subtree: true
|
2000 | });
|
2001 | }
|
2002 | function disconnect() {
|
2003 | if (!mo) return;
|
2004 | mo.disconnect();
|
2005 | }
|
2006 |
|
2007 | function styleParser (node) {
|
2008 | var style = node.getAttribute('style');
|
2009 | var val = [];
|
2010 |
|
2011 | if (style) {
|
2012 | val = style.split(';').reduce(function (acc, style) {
|
2013 | var styles = style.split(':');
|
2014 | var prop = styles[0];
|
2015 | var value = styles.slice(1);
|
2016 |
|
2017 | if (prop && value.length > 0) {
|
2018 | acc[prop] = value.join(':').trim();
|
2019 | }
|
2020 |
|
2021 | return acc;
|
2022 | }, {});
|
2023 | }
|
2024 |
|
2025 | return val;
|
2026 | }
|
2027 |
|
2028 | function classParser (node) {
|
2029 | var existingPrefix = node.getAttribute('data-prefix');
|
2030 | var existingIconName = node.getAttribute('data-icon');
|
2031 | var innerText = node.innerText !== undefined ? node.innerText.trim() : '';
|
2032 | var val = getCanonicalIcon(classArray(node));
|
2033 |
|
2034 | if (!val.prefix) {
|
2035 | val.prefix = getDefaultUsablePrefix();
|
2036 | }
|
2037 |
|
2038 | if (existingPrefix && existingIconName) {
|
2039 | val.prefix = existingPrefix;
|
2040 | val.iconName = existingIconName;
|
2041 | }
|
2042 |
|
2043 | if (val.iconName && val.prefix) {
|
2044 | return val;
|
2045 | }
|
2046 |
|
2047 | if (val.prefix && innerText.length > 0) {
|
2048 | val.iconName = byLigature(val.prefix, node.innerText) || byUnicode(val.prefix, toHex(node.innerText));
|
2049 | }
|
2050 |
|
2051 | if (!val.iconName && config.autoFetchSvg && node.firstChild && node.firstChild.nodeType === Node.TEXT_NODE) {
|
2052 | val.iconName = node.firstChild.data;
|
2053 | }
|
2054 |
|
2055 | return val;
|
2056 | }
|
2057 |
|
2058 | function attributesParser (node) {
|
2059 | var extraAttributes = toArray(node.attributes).reduce(function (acc, attr) {
|
2060 | if (acc.name !== 'class' && acc.name !== 'style') {
|
2061 | acc[attr.name] = attr.value;
|
2062 | }
|
2063 |
|
2064 | return acc;
|
2065 | }, {});
|
2066 | var title = node.getAttribute('title');
|
2067 | var titleId = node.getAttribute('data-fa-title-id');
|
2068 |
|
2069 | if (config.autoA11y) {
|
2070 | if (title) {
|
2071 | extraAttributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
|
2072 | } else {
|
2073 | extraAttributes['aria-hidden'] = 'true';
|
2074 | extraAttributes['focusable'] = 'false';
|
2075 | }
|
2076 | }
|
2077 |
|
2078 | return extraAttributes;
|
2079 | }
|
2080 |
|
2081 | function blankMeta() {
|
2082 | return {
|
2083 | iconName: null,
|
2084 | title: null,
|
2085 | titleId: null,
|
2086 | prefix: null,
|
2087 | transform: meaninglessTransform,
|
2088 | symbol: false,
|
2089 | mask: {
|
2090 | iconName: null,
|
2091 | prefix: null,
|
2092 | rest: []
|
2093 | },
|
2094 | maskId: null,
|
2095 | extra: {
|
2096 | classes: [],
|
2097 | styles: {},
|
2098 | attributes: {}
|
2099 | }
|
2100 | };
|
2101 | }
|
2102 | function parseMeta(node) {
|
2103 | var parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
2104 | styleParser: true
|
2105 | };
|
2106 |
|
2107 | var _classParser = classParser(node),
|
2108 | iconName = _classParser.iconName,
|
2109 | prefix = _classParser.prefix,
|
2110 | extraClasses = _classParser.rest;
|
2111 |
|
2112 | var extraAttributes = attributesParser(node);
|
2113 | var pluginMeta = chainHooks('parseNodeAttributes', {}, node);
|
2114 | var extraStyles = parser.styleParser ? styleParser(node) : [];
|
2115 | return _objectSpread2({
|
2116 | iconName: iconName,
|
2117 | title: node.getAttribute('title'),
|
2118 | titleId: node.getAttribute('data-fa-title-id'),
|
2119 | prefix: prefix,
|
2120 | transform: meaninglessTransform,
|
2121 | mask: {
|
2122 | iconName: null,
|
2123 | prefix: null,
|
2124 | rest: []
|
2125 | },
|
2126 | maskId: null,
|
2127 | symbol: false,
|
2128 | extra: {
|
2129 | classes: extraClasses,
|
2130 | styles: extraStyles,
|
2131 | attributes: extraAttributes
|
2132 | }
|
2133 | }, pluginMeta);
|
2134 | }
|
2135 |
|
2136 | var styles$2 = namespace.styles;
|
2137 |
|
2138 | function generateMutation(node) {
|
2139 | var nodeMeta = config.autoReplaceSvg === 'nest' ? parseMeta(node, {
|
2140 | styleParser: false
|
2141 | }) : parseMeta(node);
|
2142 |
|
2143 | if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {
|
2144 | return callProvided('generateLayersText', node, nodeMeta);
|
2145 | } else {
|
2146 | return callProvided('generateSvgReplacementMutation', node, nodeMeta);
|
2147 | }
|
2148 | }
|
2149 |
|
2150 | var knownPrefixes = new Set();
|
2151 | FAMILIES.map(function (family) {
|
2152 | knownPrefixes.add("fa-".concat(family));
|
2153 | });
|
2154 | Object.keys(PREFIX_TO_STYLE[FAMILY_CLASSIC]).map(knownPrefixes.add.bind(knownPrefixes));
|
2155 | Object.keys(PREFIX_TO_STYLE[FAMILY_SHARP]).map(knownPrefixes.add.bind(knownPrefixes));
|
2156 | knownPrefixes = _toConsumableArray(knownPrefixes);
|
2157 |
|
2158 | function onTree(root) {
|
2159 | var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
2160 | if (!IS_DOM) return Promise.resolve();
|
2161 | var htmlClassList = DOCUMENT.documentElement.classList;
|
2162 |
|
2163 | var hclAdd = function hclAdd(suffix) {
|
2164 | return htmlClassList.add("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
|
2165 | };
|
2166 |
|
2167 | var hclRemove = function hclRemove(suffix) {
|
2168 | return htmlClassList.remove("".concat(HTML_CLASS_I2SVG_BASE_CLASS, "-").concat(suffix));
|
2169 | };
|
2170 |
|
2171 | var prefixes = config.autoFetchSvg ? knownPrefixes : FAMILIES.map(function (f) {
|
2172 | return "fa-".concat(f);
|
2173 | }).concat(Object.keys(styles$2));
|
2174 |
|
2175 | if (!prefixes.includes('fa')) {
|
2176 | prefixes.push('fa');
|
2177 | }
|
2178 |
|
2179 | var prefixesDomQuery = [".".concat(LAYERS_TEXT_CLASSNAME, ":not([").concat(DATA_FA_I2SVG, "])")].concat(prefixes.map(function (p) {
|
2180 | return ".".concat(p, ":not([").concat(DATA_FA_I2SVG, "])");
|
2181 | })).join(', ');
|
2182 |
|
2183 | if (prefixesDomQuery.length === 0) {
|
2184 | return Promise.resolve();
|
2185 | }
|
2186 |
|
2187 | var candidates = [];
|
2188 |
|
2189 | try {
|
2190 | candidates = toArray(root.querySelectorAll(prefixesDomQuery));
|
2191 | } catch (e) {
|
2192 | }
|
2193 |
|
2194 | if (candidates.length > 0) {
|
2195 | hclAdd('pending');
|
2196 | hclRemove('complete');
|
2197 | } else {
|
2198 | return Promise.resolve();
|
2199 | }
|
2200 |
|
2201 | var mark = perf.begin('onTree');
|
2202 | var mutations = candidates.reduce(function (acc, node) {
|
2203 | try {
|
2204 | var mutation = generateMutation(node);
|
2205 |
|
2206 | if (mutation) {
|
2207 | acc.push(mutation);
|
2208 | }
|
2209 | } catch (e) {
|
2210 | if (!PRODUCTION) {
|
2211 | if (e.name === 'MissingIcon') {
|
2212 | console.error(e);
|
2213 | }
|
2214 | }
|
2215 | }
|
2216 |
|
2217 | return acc;
|
2218 | }, []);
|
2219 | return new Promise(function (resolve, reject) {
|
2220 | Promise.all(mutations).then(function (resolvedMutations) {
|
2221 | perform(resolvedMutations, function () {
|
2222 | hclAdd('active');
|
2223 | hclAdd('complete');
|
2224 | hclRemove('pending');
|
2225 | if (typeof callback === 'function') callback();
|
2226 | mark();
|
2227 | resolve();
|
2228 | });
|
2229 | }).catch(function (e) {
|
2230 | mark();
|
2231 | reject(e);
|
2232 | });
|
2233 | });
|
2234 | }
|
2235 |
|
2236 | function onNode(node) {
|
2237 | var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
2238 | generateMutation(node).then(function (mutation) {
|
2239 | if (mutation) {
|
2240 | perform([mutation], callback);
|
2241 | }
|
2242 | });
|
2243 | }
|
2244 |
|
2245 | function resolveIcons(next) {
|
2246 | return function (maybeIconDefinition) {
|
2247 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2248 | var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});
|
2249 | var mask = params.mask;
|
2250 |
|
2251 | if (mask) {
|
2252 | mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
|
2253 | }
|
2254 |
|
2255 | return next(iconDefinition, _objectSpread2(_objectSpread2({}, params), {}, {
|
2256 | mask: mask
|
2257 | }));
|
2258 | };
|
2259 | }
|
2260 |
|
2261 | var render = function render(iconDefinition) {
|
2262 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2263 | var _params$transform = params.transform,
|
2264 | transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
|
2265 | _params$symbol = params.symbol,
|
2266 | symbol = _params$symbol === void 0 ? false : _params$symbol,
|
2267 | _params$mask = params.mask,
|
2268 | mask = _params$mask === void 0 ? null : _params$mask,
|
2269 | _params$maskId = params.maskId,
|
2270 | maskId = _params$maskId === void 0 ? null : _params$maskId,
|
2271 | _params$title = params.title,
|
2272 | title = _params$title === void 0 ? null : _params$title,
|
2273 | _params$titleId = params.titleId,
|
2274 | titleId = _params$titleId === void 0 ? null : _params$titleId,
|
2275 | _params$classes = params.classes,
|
2276 | classes = _params$classes === void 0 ? [] : _params$classes,
|
2277 | _params$attributes = params.attributes,
|
2278 | attributes = _params$attributes === void 0 ? {} : _params$attributes,
|
2279 | _params$styles = params.styles,
|
2280 | styles = _params$styles === void 0 ? {} : _params$styles;
|
2281 | if (!iconDefinition) return;
|
2282 | var prefix = iconDefinition.prefix,
|
2283 | iconName = iconDefinition.iconName,
|
2284 | icon = iconDefinition.icon;
|
2285 | return domVariants(_objectSpread2({
|
2286 | type: 'icon'
|
2287 | }, iconDefinition), function () {
|
2288 | callHooks('beforeDOMElementCreation', {
|
2289 | iconDefinition: iconDefinition,
|
2290 | params: params
|
2291 | });
|
2292 |
|
2293 | if (config.autoA11y) {
|
2294 | if (title) {
|
2295 | attributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
|
2296 | } else {
|
2297 | attributes['aria-hidden'] = 'true';
|
2298 | attributes['focusable'] = 'false';
|
2299 | }
|
2300 | }
|
2301 |
|
2302 | return makeInlineSvgAbstract({
|
2303 | icons: {
|
2304 | main: asFoundIcon(icon),
|
2305 | mask: mask ? asFoundIcon(mask.icon) : {
|
2306 | found: false,
|
2307 | width: null,
|
2308 | height: null,
|
2309 | icon: {}
|
2310 | }
|
2311 | },
|
2312 | prefix: prefix,
|
2313 | iconName: iconName,
|
2314 | transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),
|
2315 | symbol: symbol,
|
2316 | title: title,
|
2317 | maskId: maskId,
|
2318 | titleId: titleId,
|
2319 | extra: {
|
2320 | attributes: attributes,
|
2321 | styles: styles,
|
2322 | classes: classes
|
2323 | }
|
2324 | });
|
2325 | });
|
2326 | };
|
2327 | var ReplaceElements = {
|
2328 | mixout: function mixout() {
|
2329 | return {
|
2330 | icon: resolveIcons(render)
|
2331 | };
|
2332 | },
|
2333 | hooks: function hooks() {
|
2334 | return {
|
2335 | mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {
|
2336 | accumulator.treeCallback = onTree;
|
2337 | accumulator.nodeCallback = onNode;
|
2338 | return accumulator;
|
2339 | }
|
2340 | };
|
2341 | },
|
2342 | provides: function provides(providers$$1) {
|
2343 | providers$$1.i2svg = function (params) {
|
2344 | var _params$node = params.node,
|
2345 | node = _params$node === void 0 ? DOCUMENT : _params$node,
|
2346 | _params$callback = params.callback,
|
2347 | callback = _params$callback === void 0 ? function () {} : _params$callback;
|
2348 | return onTree(node, callback);
|
2349 | };
|
2350 |
|
2351 | providers$$1.generateSvgReplacementMutation = function (node, nodeMeta) {
|
2352 | var iconName = nodeMeta.iconName,
|
2353 | title = nodeMeta.title,
|
2354 | titleId = nodeMeta.titleId,
|
2355 | prefix = nodeMeta.prefix,
|
2356 | transform = nodeMeta.transform,
|
2357 | symbol = nodeMeta.symbol,
|
2358 | mask = nodeMeta.mask,
|
2359 | maskId = nodeMeta.maskId,
|
2360 | extra = nodeMeta.extra;
|
2361 | return new Promise(function (resolve, reject) {
|
2362 | Promise.all([findIcon(iconName, prefix), mask.iconName ? findIcon(mask.iconName, mask.prefix) : Promise.resolve({
|
2363 | found: false,
|
2364 | width: 512,
|
2365 | height: 512,
|
2366 | icon: {}
|
2367 | })]).then(function (_ref) {
|
2368 | var _ref2 = _slicedToArray(_ref, 2),
|
2369 | main = _ref2[0],
|
2370 | mask = _ref2[1];
|
2371 |
|
2372 | resolve([node, makeInlineSvgAbstract({
|
2373 | icons: {
|
2374 | main: main,
|
2375 | mask: mask
|
2376 | },
|
2377 | prefix: prefix,
|
2378 | iconName: iconName,
|
2379 | transform: transform,
|
2380 | symbol: symbol,
|
2381 | maskId: maskId,
|
2382 | title: title,
|
2383 | titleId: titleId,
|
2384 | extra: extra,
|
2385 | watchable: true
|
2386 | })]);
|
2387 | }).catch(reject);
|
2388 | });
|
2389 | };
|
2390 |
|
2391 | providers$$1.generateAbstractIcon = function (_ref3) {
|
2392 | var children = _ref3.children,
|
2393 | attributes = _ref3.attributes,
|
2394 | main = _ref3.main,
|
2395 | transform = _ref3.transform,
|
2396 | styles = _ref3.styles;
|
2397 | var styleString = joinStyles(styles);
|
2398 |
|
2399 | if (styleString.length > 0) {
|
2400 | attributes['style'] = styleString;
|
2401 | }
|
2402 |
|
2403 | var nextChild;
|
2404 |
|
2405 | if (transformIsMeaningful(transform)) {
|
2406 | nextChild = callProvided('generateAbstractTransformGrouping', {
|
2407 | main: main,
|
2408 | transform: transform,
|
2409 | containerWidth: main.width,
|
2410 | iconWidth: main.width
|
2411 | });
|
2412 | }
|
2413 |
|
2414 | children.push(nextChild || main.icon);
|
2415 | return {
|
2416 | children: children,
|
2417 | attributes: attributes
|
2418 | };
|
2419 | };
|
2420 | }
|
2421 | };
|
2422 |
|
2423 | var Layers = {
|
2424 | mixout: function mixout() {
|
2425 | return {
|
2426 | layer: function layer(assembler) {
|
2427 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2428 | var _params$classes = params.classes,
|
2429 | classes = _params$classes === void 0 ? [] : _params$classes;
|
2430 | return domVariants({
|
2431 | type: 'layer'
|
2432 | }, function () {
|
2433 | callHooks('beforeDOMElementCreation', {
|
2434 | assembler: assembler,
|
2435 | params: params
|
2436 | });
|
2437 | var children = [];
|
2438 | assembler(function (args) {
|
2439 | Array.isArray(args) ? args.map(function (a) {
|
2440 | children = children.concat(a.abstract);
|
2441 | }) : children = children.concat(args.abstract);
|
2442 | });
|
2443 | return [{
|
2444 | tag: 'span',
|
2445 | attributes: {
|
2446 | class: ["".concat(config.cssPrefix, "-layers")].concat(_toConsumableArray(classes)).join(' ')
|
2447 | },
|
2448 | children: children
|
2449 | }];
|
2450 | });
|
2451 | }
|
2452 | };
|
2453 | }
|
2454 | };
|
2455 |
|
2456 | var LayersCounter = {
|
2457 | mixout: function mixout() {
|
2458 | return {
|
2459 | counter: function counter(content) {
|
2460 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2461 | var _params$title = params.title,
|
2462 | title = _params$title === void 0 ? null : _params$title,
|
2463 | _params$classes = params.classes,
|
2464 | classes = _params$classes === void 0 ? [] : _params$classes,
|
2465 | _params$attributes = params.attributes,
|
2466 | attributes = _params$attributes === void 0 ? {} : _params$attributes,
|
2467 | _params$styles = params.styles,
|
2468 | styles = _params$styles === void 0 ? {} : _params$styles;
|
2469 | return domVariants({
|
2470 | type: 'counter',
|
2471 | content: content
|
2472 | }, function () {
|
2473 | callHooks('beforeDOMElementCreation', {
|
2474 | content: content,
|
2475 | params: params
|
2476 | });
|
2477 | return makeLayersCounterAbstract({
|
2478 | content: content.toString(),
|
2479 | title: title,
|
2480 | extra: {
|
2481 | attributes: attributes,
|
2482 | styles: styles,
|
2483 | classes: ["".concat(config.cssPrefix, "-layers-counter")].concat(_toConsumableArray(classes))
|
2484 | }
|
2485 | });
|
2486 | });
|
2487 | }
|
2488 | };
|
2489 | }
|
2490 | };
|
2491 |
|
2492 | var LayersText = {
|
2493 | mixout: function mixout() {
|
2494 | return {
|
2495 | text: function text(content) {
|
2496 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2497 | var _params$transform = params.transform,
|
2498 | transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
|
2499 | _params$title = params.title,
|
2500 | title = _params$title === void 0 ? null : _params$title,
|
2501 | _params$classes = params.classes,
|
2502 | classes = _params$classes === void 0 ? [] : _params$classes,
|
2503 | _params$attributes = params.attributes,
|
2504 | attributes = _params$attributes === void 0 ? {} : _params$attributes,
|
2505 | _params$styles = params.styles,
|
2506 | styles = _params$styles === void 0 ? {} : _params$styles;
|
2507 | return domVariants({
|
2508 | type: 'text',
|
2509 | content: content
|
2510 | }, function () {
|
2511 | callHooks('beforeDOMElementCreation', {
|
2512 | content: content,
|
2513 | params: params
|
2514 | });
|
2515 | return makeLayersTextAbstract({
|
2516 | content: content,
|
2517 | transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),
|
2518 | title: title,
|
2519 | extra: {
|
2520 | attributes: attributes,
|
2521 | styles: styles,
|
2522 | classes: ["".concat(config.cssPrefix, "-layers-text")].concat(_toConsumableArray(classes))
|
2523 | }
|
2524 | });
|
2525 | });
|
2526 | }
|
2527 | };
|
2528 | },
|
2529 | provides: function provides(providers$$1) {
|
2530 | providers$$1.generateLayersText = function (node, nodeMeta) {
|
2531 | var title = nodeMeta.title,
|
2532 | transform = nodeMeta.transform,
|
2533 | extra = nodeMeta.extra;
|
2534 | var width = null;
|
2535 | var height = null;
|
2536 |
|
2537 | if (IS_IE) {
|
2538 | var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
|
2539 | var boundingClientRect = node.getBoundingClientRect();
|
2540 | width = boundingClientRect.width / computedFontSize;
|
2541 | height = boundingClientRect.height / computedFontSize;
|
2542 | }
|
2543 |
|
2544 | if (config.autoA11y && !title) {
|
2545 | extra.attributes['aria-hidden'] = 'true';
|
2546 | }
|
2547 |
|
2548 | return Promise.resolve([node, makeLayersTextAbstract({
|
2549 | content: node.innerHTML,
|
2550 | width: width,
|
2551 | height: height,
|
2552 | transform: transform,
|
2553 | title: title,
|
2554 | extra: extra,
|
2555 | watchable: true
|
2556 | })]);
|
2557 | };
|
2558 | }
|
2559 | };
|
2560 |
|
2561 | var CLEAN_CONTENT_PATTERN = new RegExp("\"", 'ug');
|
2562 | var SECONDARY_UNICODE_RANGE = [1105920, 1112319];
|
2563 | function hexValueFromContent(content) {
|
2564 | var cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');
|
2565 | var codePoint = codePointAt(cleaned, 0);
|
2566 | var isPrependTen = codePoint >= SECONDARY_UNICODE_RANGE[0] && codePoint <= SECONDARY_UNICODE_RANGE[1];
|
2567 | var isDoubled = cleaned.length === 2 ? cleaned[0] === cleaned[1] : false;
|
2568 | return {
|
2569 | value: isDoubled ? toHex(cleaned[0]) : toHex(cleaned),
|
2570 | isSecondary: isPrependTen || isDoubled
|
2571 | };
|
2572 | }
|
2573 |
|
2574 | function replaceForPosition(node, position) {
|
2575 | var pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));
|
2576 | return new Promise(function (resolve, reject) {
|
2577 | if (node.getAttribute(pendingAttribute) !== null) {
|
2578 |
|
2579 | return resolve();
|
2580 | }
|
2581 |
|
2582 | var children = toArray(node.children);
|
2583 | var alreadyProcessedPseudoElement = children.filter(function (c) {
|
2584 | return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;
|
2585 | })[0];
|
2586 | var styles = WINDOW.getComputedStyle(node, position);
|
2587 | var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);
|
2588 | var fontWeight = styles.getPropertyValue('font-weight');
|
2589 | var content = styles.getPropertyValue('content');
|
2590 |
|
2591 | if (alreadyProcessedPseudoElement && !fontFamily) {
|
2592 |
|
2593 |
|
2594 |
|
2595 | node.removeChild(alreadyProcessedPseudoElement);
|
2596 | return resolve();
|
2597 | } else if (fontFamily && content !== 'none' && content !== '') {
|
2598 | var _content = styles.getPropertyValue('content');
|
2599 |
|
2600 | var family = ~['Sharp'].indexOf(fontFamily[2]) ? FAMILY_SHARP : FAMILY_CLASSIC;
|
2601 | var prefix = ~['Solid', 'Regular', 'Light', 'Thin', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[family][fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[family][fontWeight];
|
2602 |
|
2603 | var _hexValueFromContent = hexValueFromContent(_content),
|
2604 | hexValue = _hexValueFromContent.value,
|
2605 | isSecondary = _hexValueFromContent.isSecondary;
|
2606 |
|
2607 | var isV4 = fontFamily[0].startsWith('FontAwesome');
|
2608 | var iconName = byUnicode(prefix, hexValue);
|
2609 | var iconIdentifier = iconName;
|
2610 |
|
2611 | if (isV4) {
|
2612 | var iconName4 = byOldUnicode(hexValue);
|
2613 |
|
2614 | if (iconName4.iconName && iconName4.prefix) {
|
2615 | iconName = iconName4.iconName;
|
2616 | prefix = iconName4.prefix;
|
2617 | }
|
2618 | }
|
2619 |
|
2620 |
|
2621 |
|
2622 | if (iconName && !isSecondary && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
|
2623 | node.setAttribute(pendingAttribute, iconIdentifier);
|
2624 |
|
2625 | if (alreadyProcessedPseudoElement) {
|
2626 |
|
2627 | node.removeChild(alreadyProcessedPseudoElement);
|
2628 | }
|
2629 |
|
2630 | var meta = blankMeta();
|
2631 | var extra = meta.extra;
|
2632 | extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
|
2633 | findIcon(iconName, prefix).then(function (main) {
|
2634 | var abstract = makeInlineSvgAbstract(_objectSpread2(_objectSpread2({}, meta), {}, {
|
2635 | icons: {
|
2636 | main: main,
|
2637 | mask: emptyCanonicalIcon()
|
2638 | },
|
2639 | prefix: prefix,
|
2640 | iconName: iconIdentifier,
|
2641 | extra: extra,
|
2642 | watchable: true
|
2643 | }));
|
2644 | var element = DOCUMENT.createElement('svg');
|
2645 |
|
2646 | if (position === '::before') {
|
2647 | node.insertBefore(element, node.firstChild);
|
2648 | } else {
|
2649 | node.appendChild(element);
|
2650 | }
|
2651 |
|
2652 | element.outerHTML = abstract.map(function (a) {
|
2653 | return toHtml(a);
|
2654 | }).join('\n');
|
2655 | node.removeAttribute(pendingAttribute);
|
2656 | resolve();
|
2657 | }).catch(reject);
|
2658 | } else {
|
2659 | resolve();
|
2660 | }
|
2661 | } else {
|
2662 | resolve();
|
2663 | }
|
2664 | });
|
2665 | }
|
2666 |
|
2667 | function replace(node) {
|
2668 | return Promise.all([replaceForPosition(node, '::before'), replaceForPosition(node, '::after')]);
|
2669 | }
|
2670 |
|
2671 | function processable(node) {
|
2672 | 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');
|
2673 | }
|
2674 |
|
2675 | function searchPseudoElements(root) {
|
2676 | if (!IS_DOM) return;
|
2677 | return new Promise(function (resolve, reject) {
|
2678 | var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);
|
2679 | var end = perf.begin('searchPseudoElements');
|
2680 | disableObservation();
|
2681 | Promise.all(operations).then(function () {
|
2682 | end();
|
2683 | enableObservation();
|
2684 | resolve();
|
2685 | }).catch(function () {
|
2686 | end();
|
2687 | enableObservation();
|
2688 | reject();
|
2689 | });
|
2690 | });
|
2691 | }
|
2692 |
|
2693 | var PseudoElements = {
|
2694 | hooks: function hooks() {
|
2695 | return {
|
2696 | mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {
|
2697 | accumulator.pseudoElementsCallback = searchPseudoElements;
|
2698 | return accumulator;
|
2699 | }
|
2700 | };
|
2701 | },
|
2702 | provides: function provides(providers$$1) {
|
2703 | providers$$1.pseudoElements2svg = function (params) {
|
2704 | var _params$node = params.node,
|
2705 | node = _params$node === void 0 ? DOCUMENT : _params$node;
|
2706 |
|
2707 | if (config.searchPseudoElements) {
|
2708 | searchPseudoElements(node);
|
2709 | }
|
2710 | };
|
2711 | }
|
2712 | };
|
2713 |
|
2714 | var _unwatched = false;
|
2715 | var MutationObserver$1 = {
|
2716 | mixout: function mixout() {
|
2717 | return {
|
2718 | dom: {
|
2719 | unwatch: function unwatch() {
|
2720 | disableObservation();
|
2721 | _unwatched = true;
|
2722 | }
|
2723 | }
|
2724 | };
|
2725 | },
|
2726 | hooks: function hooks() {
|
2727 | return {
|
2728 | bootstrap: function bootstrap() {
|
2729 | observe(chainHooks('mutationObserverCallbacks', {}));
|
2730 | },
|
2731 | noAuto: function noAuto() {
|
2732 | disconnect();
|
2733 | },
|
2734 | watch: function watch(params) {
|
2735 | var observeMutationsRoot = params.observeMutationsRoot;
|
2736 |
|
2737 | if (_unwatched) {
|
2738 | enableObservation();
|
2739 | } else {
|
2740 | observe(chainHooks('mutationObserverCallbacks', {
|
2741 | observeMutationsRoot: observeMutationsRoot
|
2742 | }));
|
2743 | }
|
2744 | }
|
2745 | };
|
2746 | }
|
2747 | };
|
2748 |
|
2749 | var parseTransformString = function parseTransformString(transformString) {
|
2750 | var transform = {
|
2751 | size: 16,
|
2752 | x: 0,
|
2753 | y: 0,
|
2754 | flipX: false,
|
2755 | flipY: false,
|
2756 | rotate: 0
|
2757 | };
|
2758 | return transformString.toLowerCase().split(' ').reduce(function (acc, n) {
|
2759 | var parts = n.toLowerCase().split('-');
|
2760 | var first = parts[0];
|
2761 | var rest = parts.slice(1).join('-');
|
2762 |
|
2763 | if (first && rest === 'h') {
|
2764 | acc.flipX = true;
|
2765 | return acc;
|
2766 | }
|
2767 |
|
2768 | if (first && rest === 'v') {
|
2769 | acc.flipY = true;
|
2770 | return acc;
|
2771 | }
|
2772 |
|
2773 | rest = parseFloat(rest);
|
2774 |
|
2775 | if (isNaN(rest)) {
|
2776 | return acc;
|
2777 | }
|
2778 |
|
2779 | switch (first) {
|
2780 | case 'grow':
|
2781 | acc.size = acc.size + rest;
|
2782 | break;
|
2783 |
|
2784 | case 'shrink':
|
2785 | acc.size = acc.size - rest;
|
2786 | break;
|
2787 |
|
2788 | case 'left':
|
2789 | acc.x = acc.x - rest;
|
2790 | break;
|
2791 |
|
2792 | case 'right':
|
2793 | acc.x = acc.x + rest;
|
2794 | break;
|
2795 |
|
2796 | case 'up':
|
2797 | acc.y = acc.y - rest;
|
2798 | break;
|
2799 |
|
2800 | case 'down':
|
2801 | acc.y = acc.y + rest;
|
2802 | break;
|
2803 |
|
2804 | case 'rotate':
|
2805 | acc.rotate = acc.rotate + rest;
|
2806 | break;
|
2807 | }
|
2808 |
|
2809 | return acc;
|
2810 | }, transform);
|
2811 | };
|
2812 | var PowerTransforms = {
|
2813 | mixout: function mixout() {
|
2814 | return {
|
2815 | parse: {
|
2816 | transform: function transform(transformString) {
|
2817 | return parseTransformString(transformString);
|
2818 | }
|
2819 | }
|
2820 | };
|
2821 | },
|
2822 | hooks: function hooks() {
|
2823 | return {
|
2824 | parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
|
2825 | var transformString = node.getAttribute('data-fa-transform');
|
2826 |
|
2827 | if (transformString) {
|
2828 | accumulator.transform = parseTransformString(transformString);
|
2829 | }
|
2830 |
|
2831 | return accumulator;
|
2832 | }
|
2833 | };
|
2834 | },
|
2835 | provides: function provides(providers) {
|
2836 | providers.generateAbstractTransformGrouping = function (_ref) {
|
2837 | var main = _ref.main,
|
2838 | transform = _ref.transform,
|
2839 | containerWidth = _ref.containerWidth,
|
2840 | iconWidth = _ref.iconWidth;
|
2841 | var outer = {
|
2842 | transform: "translate(".concat(containerWidth / 2, " 256)")
|
2843 | };
|
2844 | var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
|
2845 | var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
|
2846 | var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
|
2847 | var inner = {
|
2848 | transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
|
2849 | };
|
2850 | var path = {
|
2851 | transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
|
2852 | };
|
2853 | var operations = {
|
2854 | outer: outer,
|
2855 | inner: inner,
|
2856 | path: path
|
2857 | };
|
2858 | return {
|
2859 | tag: 'g',
|
2860 | attributes: _objectSpread2({}, operations.outer),
|
2861 | children: [{
|
2862 | tag: 'g',
|
2863 | attributes: _objectSpread2({}, operations.inner),
|
2864 | children: [{
|
2865 | tag: main.icon.tag,
|
2866 | children: main.icon.children,
|
2867 | attributes: _objectSpread2(_objectSpread2({}, main.icon.attributes), operations.path)
|
2868 | }]
|
2869 | }]
|
2870 | };
|
2871 | };
|
2872 | }
|
2873 | };
|
2874 |
|
2875 | var ALL_SPACE = {
|
2876 | x: 0,
|
2877 | y: 0,
|
2878 | width: '100%',
|
2879 | height: '100%'
|
2880 | };
|
2881 |
|
2882 | function fillBlack(abstract) {
|
2883 | var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
2884 |
|
2885 | if (abstract.attributes && (abstract.attributes.fill || force)) {
|
2886 | abstract.attributes.fill = 'black';
|
2887 | }
|
2888 |
|
2889 | return abstract;
|
2890 | }
|
2891 |
|
2892 | function deGroup(abstract) {
|
2893 | if (abstract.tag === 'g') {
|
2894 | return abstract.children;
|
2895 | } else {
|
2896 | return [abstract];
|
2897 | }
|
2898 | }
|
2899 |
|
2900 | var Masks = {
|
2901 | hooks: function hooks() {
|
2902 | return {
|
2903 | parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
|
2904 | var maskData = node.getAttribute('data-fa-mask');
|
2905 | var mask = !maskData ? emptyCanonicalIcon() : getCanonicalIcon(maskData.split(' ').map(function (i) {
|
2906 | return i.trim();
|
2907 | }));
|
2908 |
|
2909 | if (!mask.prefix) {
|
2910 | mask.prefix = getDefaultUsablePrefix();
|
2911 | }
|
2912 |
|
2913 | accumulator.mask = mask;
|
2914 | accumulator.maskId = node.getAttribute('data-fa-mask-id');
|
2915 | return accumulator;
|
2916 | }
|
2917 | };
|
2918 | },
|
2919 | provides: function provides(providers) {
|
2920 | providers.generateAbstractMask = function (_ref) {
|
2921 | var children = _ref.children,
|
2922 | attributes = _ref.attributes,
|
2923 | main = _ref.main,
|
2924 | mask = _ref.mask,
|
2925 | explicitMaskId = _ref.maskId,
|
2926 | transform = _ref.transform;
|
2927 | var mainWidth = main.width,
|
2928 | mainPath = main.icon;
|
2929 | var maskWidth = mask.width,
|
2930 | maskPath = mask.icon;
|
2931 | var trans = transformForSvg({
|
2932 | transform: transform,
|
2933 | containerWidth: maskWidth,
|
2934 | iconWidth: mainWidth
|
2935 | });
|
2936 | var maskRect = {
|
2937 | tag: 'rect',
|
2938 | attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {
|
2939 | fill: 'white'
|
2940 | })
|
2941 | };
|
2942 | var maskInnerGroupChildrenMixin = mainPath.children ? {
|
2943 | children: mainPath.children.map(fillBlack)
|
2944 | } : {};
|
2945 | var maskInnerGroup = {
|
2946 | tag: 'g',
|
2947 | attributes: _objectSpread2({}, trans.inner),
|
2948 | children: [fillBlack(_objectSpread2({
|
2949 | tag: mainPath.tag,
|
2950 | attributes: _objectSpread2(_objectSpread2({}, mainPath.attributes), trans.path)
|
2951 | }, maskInnerGroupChildrenMixin))]
|
2952 | };
|
2953 | var maskOuterGroup = {
|
2954 | tag: 'g',
|
2955 | attributes: _objectSpread2({}, trans.outer),
|
2956 | children: [maskInnerGroup]
|
2957 | };
|
2958 | var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
|
2959 | var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
|
2960 | var maskTag = {
|
2961 | tag: 'mask',
|
2962 | attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {
|
2963 | id: maskId,
|
2964 | maskUnits: 'userSpaceOnUse',
|
2965 | maskContentUnits: 'userSpaceOnUse'
|
2966 | }),
|
2967 | children: [maskRect, maskOuterGroup]
|
2968 | };
|
2969 | var defs = {
|
2970 | tag: 'defs',
|
2971 | children: [{
|
2972 | tag: 'clipPath',
|
2973 | attributes: {
|
2974 | id: clipId
|
2975 | },
|
2976 | children: deGroup(maskPath)
|
2977 | }, maskTag]
|
2978 | };
|
2979 | children.push(defs, {
|
2980 | tag: 'rect',
|
2981 | attributes: _objectSpread2({
|
2982 | fill: 'currentColor',
|
2983 | 'clip-path': "url(#".concat(clipId, ")"),
|
2984 | mask: "url(#".concat(maskId, ")")
|
2985 | }, ALL_SPACE)
|
2986 | });
|
2987 | return {
|
2988 | children: children,
|
2989 | attributes: attributes
|
2990 | };
|
2991 | };
|
2992 | }
|
2993 | };
|
2994 |
|
2995 | var MissingIconIndicator = {
|
2996 | provides: function provides(providers) {
|
2997 | var reduceMotion = false;
|
2998 |
|
2999 | if (WINDOW.matchMedia) {
|
3000 | reduceMotion = WINDOW.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
3001 | }
|
3002 |
|
3003 | providers.missingIconAbstract = function () {
|
3004 | var gChildren = [];
|
3005 | var FILL = {
|
3006 | fill: 'currentColor'
|
3007 | };
|
3008 | var ANIMATION_BASE = {
|
3009 | attributeType: 'XML',
|
3010 | repeatCount: 'indefinite',
|
3011 | dur: '2s'
|
3012 | };
|
3013 |
|
3014 | gChildren.push({
|
3015 | tag: 'path',
|
3016 | attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
|
3017 | 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'
|
3018 | })
|
3019 | });
|
3020 |
|
3021 | var OPACITY_ANIMATE = _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {
|
3022 | attributeName: 'opacity'
|
3023 | });
|
3024 |
|
3025 | var dot = {
|
3026 | tag: 'circle',
|
3027 | attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
|
3028 | cx: '256',
|
3029 | cy: '364',
|
3030 | r: '28'
|
3031 | }),
|
3032 | children: []
|
3033 | };
|
3034 |
|
3035 | if (!reduceMotion) {
|
3036 | dot.children.push({
|
3037 | tag: 'animate',
|
3038 | attributes: _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {
|
3039 | attributeName: 'r',
|
3040 | values: '28;14;28;28;14;28;'
|
3041 | })
|
3042 | }, {
|
3043 | tag: 'animate',
|
3044 | attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
|
3045 | values: '1;0;1;1;0;1;'
|
3046 | })
|
3047 | });
|
3048 | }
|
3049 |
|
3050 | gChildren.push(dot);
|
3051 | gChildren.push({
|
3052 | tag: 'path',
|
3053 | attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
|
3054 | opacity: '1',
|
3055 | 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'
|
3056 | }),
|
3057 | children: reduceMotion ? [] : [{
|
3058 | tag: 'animate',
|
3059 | attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
|
3060 | values: '1;0;0;0;0;1;'
|
3061 | })
|
3062 | }]
|
3063 | });
|
3064 |
|
3065 | if (!reduceMotion) {
|
3066 |
|
3067 | gChildren.push({
|
3068 | tag: 'path',
|
3069 | attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {
|
3070 | opacity: '0',
|
3071 | 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'
|
3072 | }),
|
3073 | children: [{
|
3074 | tag: 'animate',
|
3075 | attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {
|
3076 | values: '0;0;1;1;0;0;'
|
3077 | })
|
3078 | }]
|
3079 | });
|
3080 | }
|
3081 |
|
3082 | return {
|
3083 | tag: 'g',
|
3084 | attributes: {
|
3085 | 'class': 'missing'
|
3086 | },
|
3087 | children: gChildren
|
3088 | };
|
3089 | };
|
3090 | }
|
3091 | };
|
3092 |
|
3093 | var SvgSymbols = {
|
3094 | hooks: function hooks() {
|
3095 | return {
|
3096 | parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
|
3097 | var symbolData = node.getAttribute('data-fa-symbol');
|
3098 | var symbol = symbolData === null ? false : symbolData === '' ? true : symbolData;
|
3099 | accumulator['symbol'] = symbol;
|
3100 | return accumulator;
|
3101 | }
|
3102 | };
|
3103 | }
|
3104 | };
|
3105 |
|
3106 | var plugins = [InjectCSS, ReplaceElements, Layers, LayersCounter, LayersText, PseudoElements, MutationObserver$1, PowerTransforms, Masks, MissingIconIndicator, SvgSymbols];
|
3107 |
|
3108 | registerPlugins(plugins, {
|
3109 | mixoutsTo: api
|
3110 | });
|
3111 | bunker(bootstrap);
|
3112 |
|
3113 | }());
|