index.js 56 KB

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