fontawesome.js 109 KB

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