@moodlehq/design-system 2.1.0 → 3.0.0

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