fontawesome.js 106 KB

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