webfont 12.3.0 → 12.4.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.
package/dist/cli.mjs CHANGED
@@ -14,20 +14,21 @@ import { globby as te } from "globby";
14
14
  import { cosmiconfig as ne } from "cosmiconfig";
15
15
  import re from "deepmerge";
16
16
  import * as ie from "fs/promises";
17
- import ae from "ttf2woff";
18
- import oe from "wawoff2";
19
- import se from "ttf2eot";
20
- import ce from "fontverter";
21
- import le from "xml2js";
22
- import ue from "p-limit";
23
- import { SVGIcons2SVGFontStream as de, fileSorter as fe, getMetadataService as pe } from "svgicons2svgfont";
24
- import me from "crypto";
25
- import { optimize as he } from "svgo";
26
- import { Readable as ge } from "stream";
27
- import _e from "svg2ttf";
17
+ import { createFont as ae } from "fonteditor-core";
18
+ import oe from "ttf2woff";
19
+ import se from "wawoff2";
20
+ import ce from "ttf2eot";
21
+ import le from "fontverter";
22
+ import ue from "xml2js";
23
+ import de from "p-limit";
24
+ import { SVGIcons2SVGFontStream as fe, fileSorter as pe, getMetadataService as me } from "svgicons2svgfont";
25
+ import he from "crypto";
26
+ import { optimize as ge } from "svgo";
27
+ import { Readable as _e } from "stream";
28
+ import ve from "svg2ttf";
28
29
  //#region package.json
29
- var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w, T, E, Oe, ke, Ae = r((() => {
30
- ve = "webfont", ye = "12.3.0", be = "Generator of fonts from SVG icons; decompress WOFF/WOFF2 to embedded TTF/OTF (not TTF↔OTF transcoding)", xe = {
30
+ var p, ye, be, xe, Se, Ce, we, Te, Ee, De, m, h, g, _, v, y, b, x, S, C, w, T, E, Oe, ke, Ae, je = r((() => {
31
+ p = "webfont", ye = "12.4.0", be = "Generator of fonts from SVG icons; decompress WOFF/WOFF2 to embedded TTF/OTF (not TTF↔OTF transcoding)", xe = {
31
32
  lib: "dist",
32
33
  source: "src"
33
34
  }, Se = [
@@ -38,7 +39,7 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
38
39
  "!**/__mocks__",
39
40
  "README.md",
40
41
  "NOTICE.md"
41
- ], Ce = "commonjs", we = "dist/index.js", Te = "dist/index.mjs", Ee = "dist/browser.js", De = "dist/cli.mjs", p = "src/index.ts", m = "dist/src/index.d.ts", h = "dist/src/index.d.ts", g = {
42
+ ], Ce = "commonjs", we = "dist/index.js", Te = "dist/index.mjs", Ee = "dist/browser.js", De = "dist/cli.mjs", m = "src/index.ts", h = "dist/src/index.d.ts", g = "dist/src/index.d.ts", _ = {
42
43
  ".": {
43
44
  browser: {
44
45
  types: "./dist/src/index.d.ts",
@@ -60,7 +61,7 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
60
61
  }
61
62
  },
62
63
  "./package.json": "./package.json"
63
- }, _ = {
64
+ }, v = {
64
65
  build: "vite build --mode library && vite build --mode library-esm && vite build --mode browser && vite build --mode cli && node scripts/emit-mts-types.mjs",
65
66
  clean: "rm -rf dist/ temp/",
66
67
  demo: "node dist/cli.mjs './src/fixtures/svg-icons/*.svg' -d demo -t html --normalize --center-horizontally",
@@ -83,9 +84,10 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
83
84
  "test-debug": "vitest run src --no-file-parallelism",
84
85
  testu: "vitest run src -u",
85
86
  "deprecate-pre-12": "npm deprecate 'webfont@>=10.0.0 <12.0.0' 'Deprecated: upgrade to webfont@12. v10–11 enabled ligatures by default (browser hangs on large fonts, #558). 12.x: ligatures off, Node 24.14+, named import, unicode-range off, template fixes. See MIGRATION.md'"
86
- }, v = {
87
+ }, y = {
87
88
  cosmiconfig: "9.0.2",
88
89
  deepmerge: "^4.2.2",
90
+ "fonteditor-core": "2.6.3",
89
91
  fontverter: "2.0.0",
90
92
  globby: "16.2.0",
91
93
  meow: "14.1.0",
@@ -99,7 +101,7 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
99
101
  ttf2woff: "^3.0.0",
100
102
  wawoff2: "2.0.1",
101
103
  xml2js: "0.6.2"
102
- }, y = {
104
+ }, b = {
103
105
  "@arethetypeswrong/cli": "0.18.4",
104
106
  "@biomejs/biome": "2.5.2",
105
107
  "@types/node": "26.1.0",
@@ -123,14 +125,14 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
123
125
  "vite-plugin-checker": "0.14.4",
124
126
  "vite-plugin-dts": "5.0.3",
125
127
  vitest: "4.1.9"
126
- }, b = {
128
+ }, x = {
127
129
  minimatch: "10.2.5",
128
130
  "test-exclude": "7.0.2",
129
131
  "woff2sfnt-sfnt2woff": "1.0.0"
130
- }, x = {
132
+ }, S = {
131
133
  type: "git",
132
134
  url: "git+https://github.com/itgalaxy/webfont.git"
133
- }, S = "itgalaxy <development@itgalaxy.company>", C = [{
135
+ }, C = "itgalaxy <development@itgalaxy.company>", w = [{
134
136
  name: "Alexander Krasnoyarov",
135
137
  email: "alexander.krasnoyarov@itgalaxy.company",
136
138
  url: "https://vk.com/sterling_archer"
@@ -138,7 +140,7 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
138
140
  name: "Jimmy Andrade",
139
141
  email: "webfont@jimmyandrade.com",
140
142
  url: "https://github.com/jimmyandrade"
141
- }], w = { url: "https://github.com/itgalaxy/webfont/issues" }, T = "https://github.com/itgalaxy/webfont#readme", E = { node: ">=24.14.0" }, Oe = [
143
+ }], T = { url: "https://github.com/itgalaxy/webfont/issues" }, E = "https://github.com/itgalaxy/webfont#readme", Oe = { node: ">=24.14.0" }, ke = [
142
144
  "cli",
143
145
  "standalone",
144
146
  "font",
@@ -158,8 +160,8 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
158
160
  "scss",
159
161
  "builder",
160
162
  "generator"
161
- ], ke = {
162
- name: ve,
163
+ ], Ae = {
164
+ name: p,
163
165
  version: ye,
164
166
  description: be,
165
167
  directories: xe,
@@ -170,25 +172,25 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
170
172
  module: Te,
171
173
  browser: Ee,
172
174
  bin: De,
173
- source: p,
174
- types: m,
175
- typings: h,
176
- exports: g,
177
- scripts: _,
178
- dependencies: v,
179
- devDependencies: y,
180
- overrides: b,
181
- repository: x,
182
- author: S,
175
+ source: m,
176
+ types: h,
177
+ typings: g,
178
+ exports: _,
179
+ scripts: v,
180
+ dependencies: y,
181
+ devDependencies: b,
182
+ overrides: x,
183
+ repository: S,
184
+ author: C,
183
185
  license: "MIT",
184
- contributors: C,
185
- bugs: w,
186
- homepage: T,
187
- engines: E,
188
- keywords: Oe
186
+ contributors: w,
187
+ bugs: T,
188
+ homepage: E,
189
+ engines: Oe,
190
+ keywords: ke
189
191
  };
190
- })), je, Me, Ne = r((() => {
191
- je = "\n Usage: webfont [input] [options]\n\n Input: File(s) or glob(s).\n\n SVG icons: one or more `.svg` files (default pipeline).\n Webfont decompression: one or more `.woff` / `.woff2` paths, globs, or http(s) URLs.\n You must have rights to any font file you process (see NOTICE.md).\n\n If an input argument is wrapped in quotation marks, it will be passed to \"fast-glob\"\n for cross-platform glob support.\n\n Options:\n\n --config\n\n Path to a specific configuration file (JSON, YAML, or CommonJS)\n or the name of a module in `node_modules` that points to one.\n If no `--config` argument is provided, webfont will search for\n configuration files in the following places, in this order:\n - a `webfont` property in `package.json`\n - a `.webfontrc` file (with or without filename extension:\n `.json`, `.yaml`, and `.js` are available)\n - a `webfont.config.js` file exporting a JS object\n The search will begin in the working directory and move up the\n directory tree until a configuration file is found.\n\n -u, --fontName\n\n The font family name you want, default: \"webfont\".\n\n -h, --help\n\n Output usage information.\n\n -v, --version\n\n Output the version number.\n\n -f, --formats\n\n Font formats to generate. Pass a JSON array (e.g. '[\"woff2\"]') or a\n comma-separated list (e.g. woff2 or svg, ttf, woff2).\n SVG input: svg, ttf, eot, woff, woff2 (not otf).\n WOFF/WOFF2 input: ttf and/or otf matching the embedded SFNT flavor.\n\n -d, --dest\n\n Destination for generated fonts.\n\n -m, --dest-create\n\n Create destination directory if it does not exist.\n\n -t, --template\n\n Built-in template name(s) ('css', 'scss', 'styl', 'html', 'json') or path to a custom template.\n Pass a JSON array (e.g. '[\"html\",\"scss\"]') or comma-separated list for multiple outputs.\n\n -s, --destTemplate\n\n Destination for generated template. If not passed used `dest` argument value.\n\n -c, --templateClassName\n\n Class name in css template.\n\n -p, --templateFontPath\n\n Font path in css template.\n\n -n, --templateFontName\n\n Font name in css template.\n\n --templateCacheString\n\n Specify cache string in scss/css template.\n\n --no-sort\n\n Keeps the files in the same order of entry\n\n --ligatures\n\n Add OpenType ligature glyphs (icon names as text). Off by default — large\n icon sets can hang Firefox on Windows (#558). Prefer class + codepoint CSS.\n\n --unicode-range\n\n Emit unicode-range in built-in @font-face rules (computed from glyph code points).\n Off by default — enabling may prevent ligature names from rendering; see README.\n\n --no-template-font-ligatures\n\n Omit font-feature-settings: \"liga\" from the built-in HTML preview template\n\n --optimize-svg\n\n Run a conservative SVGO pass on each SVG before font generation\n (does not convert strokes to fills; use glyphContentTransformFn for that)\n\n --verbose\n\n Tell me everything!.\n\n --svg-diagnose\n\n (Alpha) Scan SVG icons for icon-font incompatibilities (stroke-only paths,\n fill-rule: evenodd, unsupported elements) and log warnings.\n\n For \"svgicons2svgfont\":\n\n --fontId\n\n The font id you want, default as \"--fontName\".\n\n --fontStyle\n\n The font style you want.\n\n --fontWeight\n\n The font weight you want.\n\n --fixedWidth\n\n Creates a monospace font of the width of the largest input icon.\n\n --centerHorizontally\n\n Calculate the bounds of a glyph and center it horizontally.\n\n --centerVertically\n\n Center the glyphs vertically in the generated font.\n\n --normalize\n\n Normalize icons by scaling them to the height of the highest icon.\n\n --fontHeight\n\n The outputted font height [MAX(icons.height)].\n\n --round\n\n Setup the SVG path rounding [10e12].\n\n --descent\n\n The font descent [0].\n\n --ascent\n\n The font ascent [height - descent].\n\n --startUnicode\n\n The start unicode codepoint for files without prefix [0xEA01].\n\n --prependUnicode\n\n Prefix files with their automatically allocated unicode codepoint.\n\n --metadata\n\n Content of the metadata tag.\n\n --addHashInFontUrl\n\n Append an MD5 content hash to font URLs in built-in templates\n (?v=[hash]) while keeping output filenames stable (fontName.woff2, etc.).\n Use with a fixed fontName — do not randomize fontName for cache busting.\n", Me = {
192
+ })), Me, Ne, Pe = r((() => {
193
+ Me = "\n Usage: webfont [input] [options]\n\n Input: File(s) or glob(s).\n\n SVG icons: one or more `.svg` files (default pipeline).\n Webfont decompression: one or more `.woff` / `.woff2` paths, globs, or http(s) URLs.\n You must have rights to any font file you process (see NOTICE.md).\n\n If an input argument is wrapped in quotation marks, it will be passed to \"fast-glob\"\n for cross-platform glob support.\n\n Options:\n\n --config\n\n Path to a specific configuration file (JSON, YAML, or CommonJS)\n or the name of a module in `node_modules` that points to one.\n If no `--config` argument is provided, webfont will search for\n configuration files in the following places, in this order:\n - a `webfont` property in `package.json`\n - a `.webfontrc` file (with or without filename extension:\n `.json`, `.yaml`, and `.js` are available)\n - a `webfont.config.js` file exporting a JS object\n The search will begin in the working directory and move up the\n directory tree until a configuration file is found.\n\n -u, --fontName\n\n The font family name you want, default: \"webfont\".\n\n -h, --help\n\n Output usage information.\n\n -v, --version\n\n Output the version number.\n\n -f, --formats\n\n Font formats to generate. Pass a JSON array (e.g. '[\"woff2\"]') or a\n comma-separated list (e.g. woff2 or svg, ttf, woff2).\n SVG input: svg, ttf, eot, woff, woff2 (not otf).\n WOFF/WOFF2 input: ttf and/or otf matching the embedded SFNT flavor.\n\n -d, --dest\n\n Destination for generated fonts.\n\n -m, --dest-create\n\n Create destination directory if it does not exist.\n\n -t, --template\n\n Built-in template name(s) ('css', 'scss', 'styl', 'html', 'json') or path to a custom template.\n Pass a JSON array (e.g. '[\"html\",\"scss\"]') or comma-separated list for multiple outputs.\n\n -s, --destTemplate\n\n Destination for generated template. If not passed used `dest` argument value.\n\n -c, --templateClassName\n\n Class name in css template.\n\n -p, --templateFontPath\n\n Font path in css template.\n\n -n, --templateFontName\n\n Font name in css template.\n\n --templateCacheString\n\n Specify cache string in scss/css template.\n\n --no-sort\n\n Keeps the files in the same order of entry\n\n --ligatures\n\n Add OpenType ligature glyphs (icon names as text). Off by default — large\n icon sets can hang Firefox on Windows (#558). Prefer class + codepoint CSS.\n\n --unicode-range\n\n Emit unicode-range in built-in @font-face rules (computed from glyph code points).\n Off by default — enabling may prevent ligature names from rendering; see README.\n\n --no-template-font-ligatures\n\n Omit font-feature-settings: \"liga\" from the built-in HTML preview template\n\n --optimize-svg\n\n Run a conservative SVGO pass on each SVG before font generation\n (does not convert strokes to fills; use glyphContentTransformFn for that)\n\n --verbose\n\n Tell me everything!.\n\n --svg-diagnose\n\n (Alpha) Scan SVG icons for icon-font incompatibilities (stroke-only paths,\n fill-rule: evenodd, unsupported elements) and log warnings.\n\n For \"svgicons2svgfont\":\n\n --fontId\n\n The font id you want, default as \"--fontName\".\n\n --fontStyle\n\n The font style you want.\n\n --fontWeight\n\n The font weight you want.\n\n --fixedWidth\n\n Creates a monospace font of the width of the largest input icon.\n\n --centerHorizontally\n\n Calculate the bounds of a glyph and center it horizontally.\n\n --centerVertically\n\n Center the glyphs vertically in the generated font.\n\n --normalize\n\n Normalize icons by scaling them to the height of the highest icon.\n\n --fontHeight\n\n The outputted font height [MAX(icons.height)].\n\n --round\n\n Setup the SVG path rounding [10e12].\n\n --descent\n\n The font descent [0].\n\n --ascent\n\n The font ascent [height - descent].\n\n --startUnicode\n\n The start unicode codepoint for files without prefix [0xEA01].\n\n --prependUnicode\n\n Prefix files with their automatically allocated unicode codepoint.\n\n --metadata\n\n Content of the metadata tag.\n\n --addHashInFontUrl\n\n Append an MD5 content hash to font URLs in built-in templates\n (?v=[hash]) while keeping output filenames stable (fontName.woff2, etc.).\n Use with a fixed fontName — do not randomize fontName for cache busting.\n", Ne = {
192
194
  ascent: { type: "string" },
193
195
  centerHorizontally: { type: "boolean" },
194
196
  centerVertically: { type: "boolean" },
@@ -287,98 +289,102 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
287
289
  type: "boolean"
288
290
  }
289
291
  };
290
- })), Pe, Fe, Ie = r((() => {
291
- Ae(), Ne(), Pe = { url: s(t).href }, Fe = (e = process.argv.slice(2)) => c(je, {
292
+ })), Fe, Ie, Le = r((() => {
293
+ je(), Pe(), Fe = { url: s(t).href }, Ie = (e = process.argv.slice(2)) => c(Me, {
292
294
  argv: [...e],
293
295
  autoHelp: !1,
294
296
  autoVersion: !1,
295
- flags: Me,
296
- importMeta: Pe,
297
- pkg: ke
297
+ flags: Ne,
298
+ importMeta: Fe,
299
+ pkg: Ae
298
300
  });
299
- })), Le, Re = r((() => {
300
- Ie(), Ne(), Le = Fe();
301
- })), ze, D, O, Be, Ve, He, k = r((() => {
302
- ze = /^https?:\/\//iu, D = (e) => ze.test(e), O = (e) => {
301
+ })), Re, ze = r((() => {
302
+ Le(), Pe(), Re = Ie();
303
+ })), Be, D, O, Ve, He, Ue, k = r((() => {
304
+ Be = /^https?:\/\//iu, D = (e) => Be.test(e), O = (e) => {
303
305
  if (D(e)) try {
304
306
  return f.extname(new URL(e).pathname).toLowerCase();
305
307
  } catch {
306
308
  return "";
307
309
  }
308
310
  return f.extname(e).toLowerCase();
309
- }, Be = (e) => {
311
+ }, Ve = (e) => {
310
312
  let t = e;
311
313
  D(e) && (t = new URL(e).pathname);
312
314
  let n = f.basename(t), r = O(e);
313
315
  return r === ".woff2" ? n.slice(0, -6) : r === ".woff" ? n.slice(0, -5) : n.replace(/\.[^.]+$/u, "");
314
- }, Ve = {
316
+ }, He = {
315
317
  ".woff": "-woff",
316
318
  ".woff2": "-woff2"
317
- }, He = (e) => {
318
- let t = e.map((e) => Be(e)), n = /* @__PURE__ */ new Map();
319
+ }, Ue = (e) => {
320
+ let t = e.map((e) => Ve(e)), n = /* @__PURE__ */ new Map();
319
321
  for (let e of t) n.set(e, (n.get(e) ?? 0) + 1);
320
322
  return e.map((e, r) => {
321
323
  let i = t[r], a = (n.get(i) ?? 0) > 1, o = O(e);
322
- return a ? `${i}${Ve[o] ?? `-${r + 1}`}` : i;
324
+ return a ? `${i}${He[o] ?? `-${r + 1}`}` : i;
323
325
  });
324
326
  };
325
- })), Ue, We = r((() => {
326
- k(), Ue = async (e) => (await Promise.all(e.map((e) => D(e) ? Promise.resolve([e]) : te(e)))).flat();
327
- })), Ge, Ke, qe, A, Je = r((() => {
328
- Ge = 1330926671, Ke = 1953658213, qe = 65536, A = (e) => {
327
+ })), We, Ge = r((() => {
328
+ k(), We = async (e) => (await Promise.all(e.map((e) => D(e) ? Promise.resolve([e]) : te(e)))).flat();
329
+ })), Ke, qe, Je, A, Ye = r((() => {
330
+ Ke = 1330926671, qe = 1953658213, Je = 65536, A = (e) => {
329
331
  if (e.length < 4) throw Error("SFNT buffer is too short to read flavor");
330
332
  let t = e.readUInt32BE(0);
331
- if (t === Ge) return "otf";
332
- if (t === Ke || t === qe) return "ttf";
333
+ if (t === Ke) return "otf";
334
+ if (t === qe || t === Je) return "ttf";
333
335
  throw Error(`Unsupported SFNT flavor 0x${t.toString(16)}`);
334
336
  };
335
- })), Ye, Xe = r((() => {
336
- Ye = (e) => Buffer.from(se(e));
337
- })), j, M, N, Ze = r((() => {
338
- Xe(), j = (e) => Ye(e), M = (e, t = {}) => Buffer.from(ae(e, t).buffer), N = async (e) => Buffer.from(await oe.compress(e));
339
- })), P, F, I, L, R, z, B, Qe, $e, et, V, tt, nt, rt, H = r((() => {
337
+ })), Xe, Ze = r((() => {
338
+ Xe = (e) => Buffer.from(ce(e));
339
+ })), j, Qe, M, N, $e = r((() => {
340
+ Ze(), j = (e) => Xe(e), Qe = (e, t = {}) => ae(e, { type: "ttf" }).write({
341
+ type: "svg",
342
+ metadata: t.metadata
343
+ }), M = (e, t = {}) => Buffer.from(oe(e, t).buffer), N = async (e) => Buffer.from(await se.compress(e));
344
+ })), P, F, I, L, R, z, B, et, tt, nt, V, rt, it, at, H = r((() => {
340
345
  k(), P = /* @__PURE__ */ new Set([".woff", ".woff2"]), F = ".svg", I = ".ttf", L = [
341
346
  "svg",
342
347
  "ttf",
343
348
  "eot",
344
349
  "woff",
345
350
  "woff2"
346
- ], R = (e) => e === F, z = (e) => e === I, B = (e) => P.has(e), Qe = (e) => R(e) || B(e) || z(e), $e = (e) => {
351
+ ], R = (e) => e === F, z = (e) => e === I, B = (e) => P.has(e), et = (e) => R(e) || B(e) || z(e), tt = (e) => {
347
352
  if (e.length === 0) return "empty";
348
353
  let t = e.map((e) => O(e));
349
- if (!t.every(Qe)) return "empty";
354
+ if (!t.every(et)) return "empty";
350
355
  let n = t.some(R), r = t.some(B), i = t.some(z);
351
356
  return [
352
357
  n,
353
358
  r,
354
359
  i
355
360
  ].filter(Boolean).length > 1 ? "mixed" : r ? "webfont" : i ? "ttf" : n ? "svg" : "empty";
356
- }, et = (e) => {
361
+ }, nt = (e) => {
357
362
  if (e.includes("otf")) throw Error("OTF output is only supported when converting WOFF/WOFF2 input. Request \"ttf\" for SVG icons, or pass a .woff/.woff2 file.");
358
- }, V = (e, t) => t === "svg" ? e.filter((e) => O(e) === F) : t === "webfont" ? e.filter((e) => P.has(O(e))) : t === "ttf" ? e.filter((e) => O(e) === I) : [], tt = /* @__PURE__ */ new Set([
363
+ }, V = (e, t) => t === "svg" ? e.filter((e) => O(e) === F) : t === "webfont" ? e.filter((e) => P.has(O(e))) : t === "ttf" ? e.filter((e) => O(e) === I) : [], rt = /* @__PURE__ */ new Set([
359
364
  "ttf",
365
+ "svg",
360
366
  "eot",
361
367
  "woff",
362
368
  "woff2"
363
- ]), nt = (e) => {
364
- let t = e.filter((e) => tt.has(e));
369
+ ]), it = (e) => {
370
+ let t = e.filter((e) => rt.has(e));
365
371
  if (e.length === L.length && L.every((t) => e.includes(t))) return ["woff", "woff2"];
366
- if (t.length === 0) throw Error("formats must include at least one of \"ttf\", \"eot\", \"woff\", or \"woff2\" when converting TTF input");
372
+ if (t.length === 0) throw Error("formats must include at least one of \"svg\", \"ttf\", \"eot\", \"woff\", or \"woff2\" when converting TTF input");
367
373
  return [...new Set(t)];
368
- }, rt = (e) => {
374
+ }, at = (e) => {
369
375
  let t = e.filter((e) => e === "ttf" || e === "otf");
370
376
  if (e.length === L.length && L.every((t) => e.includes(t))) return ["ttf"];
371
377
  if (t.length === 0) throw Error("formats must include \"ttf\" and/or \"otf\" when converting WOFF/WOFF2 input");
372
378
  return [...new Set(t)];
373
379
  };
374
- })), it, at, ot, st, ct, lt, ut = r((() => {
375
- k(), Je(), Ze(), H(), it = (e) => {
380
+ })), ot, st, ct, U, lt, ut, dt, ft = r((() => {
381
+ k(), Ye(), $e(), H(), ot = (e) => {
376
382
  if (e.length === 0) throw Error("No TTF files matched");
377
- }, at = (e) => {
383
+ }, st = (e) => {
378
384
  if (e.template) throw Error("Templates are not supported when converting TTF input");
379
385
  if (e.glyphTransformFn) throw Error("glyphTransformFn is not supported when converting TTF input");
380
386
  if (e.glyphContentTransformFn) throw Error("glyphContentTransformFn is not supported when converting TTF input");
381
- }, ot = (e, t) => {
387
+ }, ct = (e, t) => {
382
388
  let n;
383
389
  try {
384
390
  n = A(e);
@@ -386,55 +392,60 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
386
392
  throw Error(`Input is not a valid TrueType font: ${t}`);
387
393
  }
388
394
  if (n !== "ttf") throw Error(`OpenType (OTF) input is not supported for webfont encoding. Use a .ttf file for ${t}.`);
389
- }, st = async (e, t, n, r) => {
395
+ }, U = (e) => {
396
+ if (typeof e.metadata == "string") return e.metadata;
397
+ }, lt = async (e, t, n, r) => {
390
398
  if (n === "ttf") {
391
399
  e.ttf = t;
392
400
  return;
393
401
  }
402
+ if (n === "svg") {
403
+ e.svg = Qe(t, { metadata: U(r) });
404
+ return;
405
+ }
394
406
  if (n === "eot") {
395
407
  e.eot = j(t);
396
408
  return;
397
409
  }
398
410
  if (n === "woff") {
399
- let n;
400
- typeof r.metadata == "string" && (n = r.metadata), e.woff = M(t, { metadata: n });
411
+ e.woff = M(t, { metadata: U(r) });
401
412
  return;
402
413
  }
403
414
  e.woff2 = await N(t);
404
- }, ct = async (e, t, n, r) => {
415
+ }, ut = async (e, t, n, r) => {
405
416
  if (D(e)) throw Error(`Remote TTF URLs are not supported. Download the file first: ${e}`);
406
417
  r && console.log(`Encoding ${e}...`);
407
418
  let i = await ie.readFile(e);
408
- ot(i, e);
419
+ ct(i, e);
409
420
  let a = { source: e };
410
- return await Promise.all(t.map((e) => st(a, i, e, n))), a;
411
- }, lt = async (e, t) => {
412
- at(t), it(e);
413
- let n = nt(t.formats), r = await Promise.all(e.map((e) => ct(e, n, t, t.verbose))), i = {
421
+ return await Promise.all(t.map((e) => lt(a, i, e, n))), a;
422
+ }, dt = async (e, t) => {
423
+ st(t), ot(e);
424
+ let n = it(t.formats), r = await Promise.all(e.map((e) => ut(e, n, t, t.verbose))), i = {
414
425
  config: { ...t },
415
426
  transcodedFonts: r
416
427
  };
417
428
  if (r.length === 1) {
418
429
  let [e] = r;
419
- i.ttf = e.ttf, i.eot = e.eot, i.woff = e.woff, i.woff2 = e.woff2;
430
+ i.svg = e.svg, i.ttf = e.ttf, i.eot = e.eot, i.woff = e.woff, i.woff2 = e.woff2;
420
431
  }
421
432
  return i;
422
433
  };
423
- })), dt = /* @__PURE__ */ a(((e, t) => {
434
+ })), pt = /* @__PURE__ */ a(((e, t) => {
424
435
  t.exports = function(e) {
425
436
  return !e || e.length < 8 ? !1 : e[0] === 119 && e[1] === 79 && e[2] === 70 && e[3] === 70 && e[4] === 0 && e[5] === 1 && e[6] === 0 && e[7] === 0 || e[4] === 79 && e[5] === 84 && e[6] === 84 && e[7] === 79;
426
437
  };
427
- })), ft = /* @__PURE__ */ a(((e, t) => {
438
+ })), mt = /* @__PURE__ */ a(((e, t) => {
428
439
  t.exports = function(e) {
429
440
  return !e || e.length < 8 ? !1 : e[0] === 119 && e[1] === 79 && e[2] === 70 && e[3] === 50 && e[4] === 0 && e[5] === 1 && e[6] === 0 && e[7] === 0;
430
441
  };
431
- })), pt, mt, ht, gt, _t = r((() => {
432
- pt = /* @__PURE__ */ n(dt()), mt = /* @__PURE__ */ n(ft()), k(), ht = (e, t) => {
442
+ })), ht, gt, _t, vt, yt = r((() => {
443
+ ht = /* @__PURE__ */ n(pt()), gt = /* @__PURE__ */ n(mt()), k(), _t = (e, t) => {
433
444
  let n = O(t);
434
- if (n === ".woff2" && !(0, mt.default)(e)) throw Error(`URL did not return a valid WOFF2 font: ${t}`);
435
- if (n === ".woff" && !(0, pt.default)(e)) throw Error(`URL did not return a valid WOFF font: ${t}`);
445
+ if (n === ".woff2" && !(0, gt.default)(e)) throw Error(`URL did not return a valid WOFF2 font: ${t}`);
446
+ if (n === ".woff" && !(0, ht.default)(e)) throw Error(`URL did not return a valid WOFF font: ${t}`);
436
447
  if (e.length === 0) throw Error(`URL returned an empty response: ${t}`);
437
- }, gt = async (e) => {
448
+ }, vt = async (e) => {
438
449
  let t;
439
450
  try {
440
451
  t = await fetch(e);
@@ -444,16 +455,16 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
444
455
  }
445
456
  if (!t.ok) throw Error(`Failed to fetch font URL ${e}: HTTP ${t.status} ${t.statusText}`);
446
457
  let n = await t.arrayBuffer(), r = Buffer.from(n);
447
- return ht(r, e), r;
458
+ return _t(r, e), r;
448
459
  };
449
- })), vt, yt, bt, xt, St, Ct, wt = r((() => {
450
- k(), Je(), _t(), H(), vt = (e) => {
460
+ })), bt, xt, St, Ct, wt, Tt, Et = r((() => {
461
+ k(), Ye(), yt(), H(), bt = (e) => {
451
462
  if (e.length === 0) throw Error("No WOFF or WOFF2 files matched");
452
- }, yt = (e) => {
463
+ }, xt = (e) => {
453
464
  if (e.template) throw Error("Templates are not supported when converting WOFF/WOFF2 input");
454
465
  if (e.glyphTransformFn) throw Error("glyphTransformFn is not supported when converting WOFF/WOFF2 input");
455
466
  if (e.glyphContentTransformFn) throw Error("glyphContentTransformFn is not supported when converting WOFF/WOFF2 input");
456
- }, bt = (e) => {
467
+ }, St = (e) => {
457
468
  let { decompressed: t, sfnt: n, format: r, flavor: i, source: a } = e;
458
469
  if (r === "ttf" && i !== "ttf") throw Error(`Input decompresses to OpenType (OTF). Request "otf" format instead of "ttf" for ${a}.`);
459
470
  if (r === "otf" && i !== "otf") throw Error(`Input decompresses to TrueType (TTF). Request "ttf" format instead of "otf" for ${a}.`);
@@ -462,10 +473,10 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
462
473
  return;
463
474
  }
464
475
  t.otf = n;
465
- }, xt = (e) => D(e) ? gt(e) : ie.readFile(e), St = async (e, t, n) => {
476
+ }, Ct = (e) => D(e) ? vt(e) : ie.readFile(e), wt = async (e, t, n) => {
466
477
  n && console.log(`Decompressing ${e}...`);
467
- let r = await xt(e), i = Buffer.from(await ce.convert(r, "sfnt")), a = A(i), o = { source: e };
468
- for (let n of t) bt({
478
+ let r = await Ct(e), i = Buffer.from(await le.convert(r, "sfnt")), a = A(i), o = { source: e };
479
+ for (let n of t) St({
469
480
  decompressed: o,
470
481
  sfnt: i,
471
482
  format: n,
@@ -473,28 +484,28 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
473
484
  source: e
474
485
  });
475
486
  return o;
476
- }, Ct = async (e, t) => {
477
- yt(t), vt(e);
478
- let n = rt(t.formats), r = await Promise.all(e.map((e) => St(e, n, t.verbose))), i = {
487
+ }, Tt = async (e, t) => {
488
+ xt(t), bt(e);
489
+ let n = at(t.formats), r = await Promise.all(e.map((e) => wt(e, n, t.verbose))), i = {
479
490
  config: { ...t },
480
491
  decompressedFonts: r
481
492
  };
482
493
  return r.length === 1 && (i.ttf = r[0].ttf, i.otf = r[0].otf), i;
483
494
  };
484
- })), Tt, Et = r((() => {
485
- Tt = ue;
486
- })), Dt, Ot, kt, At = r((() => {
487
- Dt = (e) => ({
495
+ })), Dt, Ot = r((() => {
496
+ Dt = de;
497
+ })), kt, At, jt, Mt = r((() => {
498
+ kt = (e) => ({
488
499
  prependUnicode: !!e.prependUnicode,
489
500
  startUnicode: Number(e.startUnicode)
490
- }), Ot = (e) => {
501
+ }), At = (e) => {
491
502
  if (e == null) return;
492
503
  if (typeof e == "number") return Number.isFinite(e) ? e : void 0;
493
504
  let t = e.trim();
494
505
  if (t.length === 0) return;
495
506
  let n = Number(t);
496
507
  if (Number.isFinite(n)) return n;
497
- }, kt = (e) => ({
508
+ }, jt = (e) => ({
498
509
  ascent: e.ascent,
499
510
  centerHorizontally: e.centerHorizontally,
500
511
  centerVertically: e.centerVertically,
@@ -507,14 +518,14 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
507
518
  fontWeight: e.fontWeight,
508
519
  metadata: e.metadata,
509
520
  normalize: e.normalize,
510
- round: Ot(e.round)
521
+ round: At(e.round)
511
522
  });
512
- })), jt, Mt, Nt, Pt = r((() => {
513
- Et(), At(), jt = (e) => e === void 0 ? [] : Array.isArray(e) ? e : [e], Mt = (e) => ({
523
+ })), Nt, Pt, Ft, It = r((() => {
524
+ Ot(), Mt(), Nt = (e) => e === void 0 ? [] : Array.isArray(e) ? e : [e], Pt = (e) => ({
514
525
  name: e.name,
515
- unicode: jt(e.unicode)
516
- }), Nt = (e, t) => {
517
- let n = t.metadataProvider || pe(Dt(t)), r = new le.Parser(), i = Tt(t.maxConcurrency);
526
+ unicode: Nt(e.unicode)
527
+ }), Ft = (e, t) => {
528
+ let n = t.metadataProvider || me(kt(t)), r = new ue.Parser(), i = Dt(t.maxConcurrency);
518
529
  return Promise.all(e.map((e) => i(() => new Promise((t, n) => {
519
530
  let i = u(e), a = "";
520
531
  i.on("error", (e) => n(e)).on("data", (e) => {
@@ -525,20 +536,20 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
525
536
  })));
526
537
  })))).then((e) => {
527
538
  let r = e;
528
- t.sort && (r = e.sort((e, t) => fe(e.srcPath, t.srcPath)));
539
+ t.sort && (r = e.sort((e, t) => pe(e.srcPath, t.srcPath)));
529
540
  let { ligatures: i } = t;
530
541
  return Promise.all(r.map((e) => new Promise((t, r) => {
531
542
  n(e.srcPath, (n, a) => {
532
543
  if (n) return r(n);
533
544
  if (!a) return r(/* @__PURE__ */ Error(`Missing metadata for ${e.srcPath}`));
534
- let o = Mt(a);
545
+ let o = Pt(a);
535
546
  return i && o.unicode.push(a.name.replace(/-/gu, "_")), e.metadata = o, t(e);
536
547
  });
537
548
  })));
538
549
  });
539
550
  };
540
- })), Ft, It = r((() => {
541
- Ft = () => ({
551
+ })), Lt, Rt = r((() => {
552
+ Lt = () => ({
542
553
  centerHorizontally: !1,
543
554
  centerVertically: !1,
544
555
  descent: 0,
@@ -572,16 +583,16 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
572
583
  unicodeRange: !1,
573
584
  verbose: !1
574
585
  });
575
- })), Lt, Rt = r((() => {
576
- It(), Lt = (e) => {
586
+ })), zt, Bt = r((() => {
587
+ Rt(), zt = (e) => {
577
588
  if (!e?.files) throw Error("You must pass webfont a `files` glob");
578
589
  return {
579
- ...Ft(),
590
+ ...Lt(),
580
591
  ...e
581
592
  };
582
593
  };
583
- })), zt, Bt, Vt, Ht = r((() => {
584
- zt = () => ({
594
+ })), Vt, Ht, Ut, Wt = r((() => {
595
+ Vt = () => ({
585
596
  multipass: !1,
586
597
  plugins: [
587
598
  "removeDoctype",
@@ -593,54 +604,54 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
593
604
  "cleanupAttrs",
594
605
  "removeUnusedNS"
595
606
  ]
596
- }), Bt = (e) => {
597
- let t = zt();
607
+ }), Ht = (e) => {
608
+ let t = Vt();
598
609
  return e ? {
599
610
  ...t,
600
611
  ...e,
601
612
  plugins: e.plugins ?? t.plugins
602
613
  } : t;
603
- }, Vt = (e, t, n) => he(e, {
604
- ...Bt(n),
614
+ }, Ut = (e, t, n) => ge(e, {
615
+ ...Ht(n),
605
616
  path: t
606
617
  }).data;
607
- })), Ut, Wt = r((() => {
608
- Ht(), Ut = (e, t) => e.map((e) => ({
618
+ })), Gt, Kt = r((() => {
619
+ Wt(), Gt = (e, t) => e.map((e) => ({
609
620
  ...e,
610
- contents: Vt(e.contents, e.srcPath, t)
621
+ contents: Ut(e.contents, e.srcPath, t)
611
622
  }));
612
- })), Gt, Kt, qt = r((() => {
613
- Gt = (e, t) => t && e > 2e3, Kt = (e) => `Warning: ${e} glyphs with ligatures enabled may cause severe browser slowdown or hangs (especially Firefox on Windows). Ligatures are off by default; enable only if needed: --ligatures or ligatures: true. See TROUBLESHOOTING.md and https://github.com/itgalaxy/webfont/issues/558`;
614
- })), Jt, Yt, Xt, Zt, Qt, $t, en, tn = r((() => {
615
- Jt = /<glyph\b([^>/]*)(?:\/>|>)/giu, Yt = /\bglyph-name=["']([^"']+)["']/iu, Xt = /\bd=["']([^"']*)["']/iu, Zt = (e) => {
623
+ })), qt, Jt, Yt = r((() => {
624
+ qt = (e, t) => t && e > 2e3, Jt = (e) => `Warning: ${e} glyphs with ligatures enabled may cause severe browser slowdown or hangs (especially Firefox on Windows). Ligatures are off by default; enable only if needed: --ligatures or ligatures: true. See TROUBLESHOOTING.md and https://github.com/itgalaxy/webfont/issues/558`;
625
+ })), Xt, Zt, Qt, $t, en, tn, nn, rn = r((() => {
626
+ Xt = /<glyph\b([^>/]*)(?:\/>|>)/giu, Zt = /\bglyph-name=["']([^"']+)["']/iu, Qt = /\bd=["']([^"']*)["']/iu, $t = (e) => {
616
627
  let t = [];
617
- for (let n of e.matchAll(Jt)) {
618
- let e = n[1] ?? "", r = Yt.exec(e);
619
- r && (Xt.exec(e)?.[1] ?? "").trim().length === 0 && t.push(r[1]);
628
+ for (let n of e.matchAll(Xt)) {
629
+ let e = n[1] ?? "", r = Zt.exec(e);
630
+ r && (Qt.exec(e)?.[1] ?? "").trim().length === 0 && t.push(r[1]);
620
631
  }
621
632
  return t;
622
- }, Qt = (e, t) => {
633
+ }, en = (e, t) => {
623
634
  for (let n of t) {
624
635
  let t = n.metadata?.name;
625
636
  if (t && (e === t || e.startsWith(`${t}-`))) return n.srcPath;
626
637
  }
627
- }, $t = (e, t) => {
638
+ }, tn = (e, t) => {
628
639
  let n = /* @__PURE__ */ new Set(), r = [];
629
640
  for (let i of e) {
630
- let e = Qt(i, t), a = e ?? i;
641
+ let e = en(i, t), a = e ?? i;
631
642
  n.has(a) || (n.add(a), e ? r.push(`${i} (${e})`) : r.push(i));
632
643
  }
633
644
  return r.join("; ");
634
- }, en = (e, t) => {
635
- let n = Zt(e);
645
+ }, nn = (e, t) => {
646
+ let n = $t(e);
636
647
  if (n.length === 0) return;
637
- let r = $t(n, t);
648
+ let r = tn(n, t);
638
649
  throw Error(`Empty glyph path(s) in SVG font output for: ${r}. Stroke-only SVGs (fill="none" with stroke) often produce empty glyphs because svgicons2svgfont does not convert strokes. Convert strokes to filled paths in your design tool, preprocess with glyphContentTransformFn (for example svg-outline-stroke), or run with --svg-diagnose for compatibility warnings. See TROUBLESHOOTING.md ("Stroke-only SVGs produce blank icons").`);
639
650
  };
640
- })), nn, rn, an = r((() => {
641
- nn = /fill-rule\s*:\s*evenodd|fill-rule\s*=\s*["']evenodd["']/iu, rn = (e) => nn.test(e);
642
- })), on, sn, cn, ln, un, dn, fn, U, pn, mn, hn, gn = r((() => {
643
- an(), on = /\bstroke\s*=|\bstroke\s*:/iu, sn = /fill\s*=\s*["']none["']|fill\s*:\s*none/iu, cn = /<(line|polyline|clipPath)\b/iu, ln = /<use\b/iu, un = (e) => on.test(e) ? sn.test(e) : !1, dn = (e) => cn.test(e), fn = (e) => ln.test(e), U = (e, t) => {
651
+ })), an, on, sn = r((() => {
652
+ an = /fill-rule\s*:\s*evenodd|fill-rule\s*=\s*["']evenodd["']/iu, on = (e) => an.test(e);
653
+ })), cn, ln, un, dn, fn, pn, mn, W, hn, gn, _n, vn = r((() => {
654
+ sn(), cn = /\bstroke\s*=|\bstroke\s*:/iu, ln = /fill\s*=\s*["']none["']|fill\s*:\s*none/iu, un = /<(line|polyline|clipPath)\b/iu, dn = /<use\b/iu, fn = (e) => cn.test(e) ? ln.test(e) : !1, pn = (e) => un.test(e), mn = (e) => dn.test(e), W = (e, t) => {
644
655
  switch (e) {
645
656
  case "evenodd-fill-rule": return `[webfont:diagnose] ${t} uses fill-rule: evenodd. Icon fonts render glyphs with the nonzero fill rule, so holes and counter-shapes can disappear. See TROUBLESHOOTING.md ("Icon details missing after export").`;
646
657
  case "stroke-only": return `[webfont:diagnose] ${t} uses stroke-based paths (fill="none"). svgicons2svgfont ignores stroke; outlines may render as solid shapes or lose detail. Preprocess with glyphContentTransformFn (for example svg-outline-stroke) before conversion. See TROUBLESHOOTING.md ("Icon details missing after export").`;
@@ -648,36 +659,36 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
648
659
  case "use-reference": return `[webfont:diagnose] ${t} contains <use> (symbol/instance references). svgicons2svgfont does not resolve <use> or apply transform on references — the glyph may be empty or wrong. Flatten to paths in your editor, or preprocess with SVGO / glyphContentTransformFn before conversion. See TROUBLESHOOTING.md ("SVG transform and <use> references", #612).`;
649
660
  default: return e;
650
661
  }
651
- }, pn = (e, t) => {
662
+ }, hn = (e, t) => {
652
663
  let n = [];
653
- return rn(t) && n.push({
664
+ return on(t) && n.push({
654
665
  code: "evenodd-fill-rule",
655
- message: U("evenodd-fill-rule", e),
666
+ message: W("evenodd-fill-rule", e),
656
667
  srcPath: e
657
- }), un(t) && n.push({
668
+ }), fn(t) && n.push({
658
669
  code: "stroke-only",
659
- message: U("stroke-only", e),
670
+ message: W("stroke-only", e),
660
671
  srcPath: e
661
- }), dn(t) && n.push({
672
+ }), pn(t) && n.push({
662
673
  code: "unsupported-element",
663
- message: U("unsupported-element", e),
674
+ message: W("unsupported-element", e),
664
675
  srcPath: e
665
- }), fn(t) && n.push({
676
+ }), mn(t) && n.push({
666
677
  code: "use-reference",
667
- message: U("use-reference", e),
678
+ message: W("use-reference", e),
668
679
  srcPath: e
669
680
  }), n;
670
- }, mn = (e) => e.flatMap((e) => pn(e.srcPath, e.contents)), hn = (e, t) => t.diagnose ? !0 : !!(t.verbose && e.code === "evenodd-fill-rule");
671
- })), _n, vn = r((() => {
672
- _n = (e) => {
681
+ }, gn = (e) => e.flatMap((e) => hn(e.srcPath, e.contents)), _n = (e, t) => t.diagnose ? !0 : !!(t.verbose && e.code === "evenodd-fill-rule");
682
+ })), yn, bn = r((() => {
683
+ yn = (e) => {
673
684
  if (!e || !e.diagnose) return;
674
685
  let t = { diagnose: !0 };
675
686
  return e.onMessage && (t.onMessage = e.onMessage), t;
676
687
  };
677
- })), yn, bn = r((() => {
678
- gn(), vn(), yn = (e, t, n = {}) => {
679
- let r = _n(t), i = mn(e), { reporter: a, verbose: o = !1 } = n;
680
- for (let e of i) hn(e, {
688
+ })), xn, Sn = r((() => {
689
+ vn(), bn(), xn = (e, t, n = {}) => {
690
+ let r = yn(t), i = gn(e), { reporter: a, verbose: o = !1 } = n;
691
+ for (let e of i) _n(e, {
681
692
  diagnose: r?.diagnose,
682
693
  verbose: o
683
694
  }) && a?.(e.message);
@@ -687,24 +698,24 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
687
698
  glyphs: e
688
699
  };
689
700
  };
690
- })), xn, Sn = r((() => {
691
- bn(), xn = (e, t, n = {}) => {
692
- let { diagnostics: r, glyphs: i } = yn(e, t, n);
701
+ })), Cn, wn = r((() => {
702
+ Sn(), Cn = (e, t, n = {}) => {
703
+ let { diagnostics: r, glyphs: i } = xn(e, t, n);
693
704
  return {
694
705
  diagnostics: r,
695
706
  glyphs: i
696
707
  };
697
708
  };
698
- })), Cn, wn = r((() => {
699
- At(), Cn = (e, t) => {
709
+ })), Tn, En = r((() => {
710
+ Mt(), Tn = (e, t) => {
700
711
  let n = "";
701
712
  return new Promise((r, i) => {
702
713
  t.verbose && console.log("Generating SVG font...");
703
- let a = new de(kt(t)).on("finish", () => r(n)).on("data", (e) => {
714
+ let a = new fe(jt(t)).on("finish", () => r(n)).on("data", (e) => {
704
715
  n += e;
705
716
  }).on("error", (e) => i(e));
706
717
  e.forEach((e) => {
707
- let t = new ge();
718
+ let t = new _e();
708
719
  t.push(e.contents), t.push(null), t.metadata = e.metadata ?? {
709
720
  name: "",
710
721
  unicode: []
@@ -712,10 +723,10 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
712
723
  }), a.end();
713
724
  });
714
725
  };
715
- })), Tn, En = r((() => {
716
- Tn = (e, t = {}) => Buffer.from(_e(e, t).buffer);
717
- })), Dn, On, kn, An, jn = r((() => {
718
- Wt(), qt(), tn(), Sn(), Ze(), wn(), En(), Dn = (e) => j(e), On = (e, t) => M(e, t), kn = (e) => N(e), An = async (e, t) => {
726
+ })), Dn, On = r((() => {
727
+ Dn = (e, t = {}) => Buffer.from(ve(e, t).buffer);
728
+ })), kn, An, jn, Mn, Nn = r((() => {
729
+ Kt(), Yt(), rn(), wn(), $e(), En(), On(), kn = (e) => j(e), An = (e, t) => M(e, t), jn = (e) => N(e), Mn = async (e, t) => {
719
730
  let n = (e) => {
720
731
  if (t.svgTools?.onMessage) {
721
732
  t.svgTools.onMessage(e);
@@ -724,11 +735,11 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
724
735
  (t.svgTools?.diagnose || t.verbose) && console.log(e);
725
736
  }, r = !!(t.svgTools?.onMessage || t.svgTools?.diagnose || t.verbose), i;
726
737
  r && (i = n);
727
- let { diagnostics: a, glyphs: o } = xn(e, t.svgTools, {
738
+ let { diagnostics: a, glyphs: o } = Cn(e, t.svgTools, {
728
739
  reporter: i,
729
740
  verbose: t.verbose
730
741
  }), s = o;
731
- if (t.optimizeSvg && (s = Ut(s, t.svgoConfig)), t.glyphContentTransformFn) {
742
+ if (t.optimizeSvg && (s = Gt(s, t.svgoConfig)), t.glyphContentTransformFn) {
732
743
  let e = t.glyphContentTransformFn;
733
744
  s = await Promise.all(s.map(async (t) => {
734
745
  let n = await e(t);
@@ -751,12 +762,12 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
751
762
  };
752
763
  }));
753
764
  }
754
- Gt(s.length, t.ligatures) && console.log(Kt(s.length));
765
+ qt(s.length, t.ligatures) && console.log(Jt(s.length));
755
766
  let c = {};
756
767
  t.formatsOptions?.ttf && (c = t.formatsOptions.ttf);
757
- let l = await Cn(s, t);
758
- en(l, s);
759
- let u = Tn(l, c);
768
+ let l = await Tn(s, t);
769
+ nn(l, s);
770
+ let u = Dn(l, c);
760
771
  if (t.ttfPostProcess) {
761
772
  let e = await t.ttfPostProcess(u, {
762
773
  fontName: t.fontName,
@@ -767,50 +778,50 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
767
778
  let d = {
768
779
  config: t,
769
780
  glyphsData: s,
770
- hash: me.createHash("md5").update(l).digest("hex"),
781
+ hash: he.createHash("md5").update(l).digest("hex"),
771
782
  svg: l,
772
783
  ttf: u
773
784
  };
774
785
  a.length > 0 && (d.svgDiagnostics = a);
775
786
  let { formats: f } = t;
776
- if (f.includes("eot") && (d.eot = Dn(u)), f.includes("woff")) {
787
+ if (f.includes("eot") && (d.eot = kn(u)), f.includes("woff")) {
777
788
  let e;
778
- typeof t.metadata == "string" && (e = t.metadata), d.woff = On(u, { metadata: e });
789
+ typeof t.metadata == "string" && (e = t.metadata), d.woff = An(u, { metadata: e });
779
790
  }
780
- if (f.includes("woff2") && (d.woff2 = Buffer.from(await kn(u))), t.template) {
791
+ if (f.includes("woff2") && (d.woff2 = Buffer.from(await jn(u))), t.template) {
781
792
  let { renderTemplates: e } = await import("./renderTemplates-CXVKq3Op.mjs"), { templates: n, usedBuildInTemplate: r } = e(t, d, f);
782
793
  n.length > 0 && (d.templates = n, d.template = n[0]?.content, d.usedBuildInTemplate = r);
783
794
  }
784
795
  return f.includes("svg") || delete d.svg, f.includes("ttf") || delete d.ttf, f.includes("otf") || delete d.otf, d;
785
796
  };
786
- })), W, Mn, G, K, Nn, Pn = r((() => {
787
- W = /* @__PURE__ */ new Set([
797
+ })), G, Pn, K, q, Fn, In = r((() => {
798
+ G = /* @__PURE__ */ new Set([
788
799
  "eot",
789
800
  "otf",
790
801
  "svg",
791
802
  "ttf",
792
803
  "woff",
793
804
  "woff2"
794
- ]), Mn = [...W].join(", "), G = (e) => {
795
- if (typeof e != "string" || !W.has(e)) throw Error(`Invalid format "${String(e)}". Expected one of: ${Mn}`);
805
+ ]), Pn = [...G].join(", "), K = (e) => {
806
+ if (typeof e != "string" || !G.has(e)) throw Error(`Invalid format "${String(e)}". Expected one of: ${Pn}`);
796
807
  return e;
797
- }, K = (e) => {
808
+ }, q = (e) => {
798
809
  if (e.length === 0) throw Error("formats must not be empty");
799
- return e.map(G);
800
- }, Nn = (e) => {
810
+ return e.map(K);
811
+ }, Fn = (e) => {
801
812
  if (!Array.isArray(e)) throw Error("formats must be an array of format names (e.g. [\"woff2\", \"svg\"])");
802
- return K(e);
813
+ return q(e);
803
814
  };
804
- })), q, Fn, J, In, Ln, Rn, zn = r((() => {
805
- Pn(), o(), q = (e, t) => {
815
+ })), J, Ln, Y, Rn, zn, Bn, Vn = r((() => {
816
+ In(), o(), J = (e, t) => {
806
817
  if (t !== void 0 && typeof t != "string") throw Error(`${e} must be a string`);
807
- }, Fn = (e, t) => {
818
+ }, Ln = (e, t) => {
808
819
  if (t !== void 0 && typeof t != "boolean" && typeof t != "string") throw Error(`${e} must be a boolean or string`);
809
- }, J = (e, t) => {
820
+ }, Y = (e, t) => {
810
821
  if (t !== void 0 && typeof t != "boolean") throw Error(`${e} must be a boolean`);
811
- }, In = (e, t) => {
822
+ }, Rn = (e, t) => {
812
823
  if (t !== void 0 && (typeof t != "object" || !t || Array.isArray(t))) throw Error(`${e} must be an object`);
813
- }, Ln = (e) => {
824
+ }, zn = (e) => {
814
825
  if (typeof e == "string") {
815
826
  if (e.length === 0) throw Error("files must not be empty");
816
827
  return;
@@ -821,52 +832,52 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
821
832
  return;
822
833
  }
823
834
  throw Error("files must be a string or an array of strings");
824
- }, Rn = (e) => (Ln(e.files), e.formats = Nn(e.formats), q("fontName", e.fontName), Fn("unicodeRange", e.unicodeRange), J("optimizeSvg", e.optimizeSvg), In("svgoConfig", e.svgoConfig), J("templateFontLigatures", e.templateFontLigatures), e.template !== void 0 && i(e.template), q("templateFontPath", e.templateFontPath), e);
825
- })), Bn, Y, Vn, Hn, Un = r((() => {
826
- We(), ut(), wt(), Pt(), H(), Rt(), jn(), zn(), Bn = (e) => "filepath" in e, Y = async (e) => {
835
+ }, Bn = (e) => (zn(e.files), e.formats = Fn(e.formats), J("fontName", e.fontName), Ln("unicodeRange", e.unicodeRange), Y("optimizeSvg", e.optimizeSvg), Rn("svgoConfig", e.svgoConfig), Y("templateFontLigatures", e.templateFontLigatures), e.template !== void 0 && i(e.template), J("templateFontPath", e.templateFontPath), e);
836
+ })), Hn, X, Un, Wn, Gn = r((() => {
837
+ Ge(), ft(), Et(), It(), H(), Bt(), Nn(), Vn(), Hn = (e) => "filepath" in e, X = async (e) => {
827
838
  let t = ne("webfont", { searchStrategy: "global" });
828
839
  if (e.configFile) {
829
840
  let n = f.resolve(process.cwd(), e.configFile);
830
841
  return await t.load(n) ?? {};
831
842
  }
832
843
  return await t.search(process.cwd()) ?? {};
833
- }, Vn = Y, Hn = async (e) => {
834
- let t = Lt(e);
844
+ }, Un = X, Wn = async (e) => {
845
+ let t = zt(e);
835
846
  delete t.filePath;
836
- let n = await Y({ configFile: t.configFile }), r;
837
- Bn(n) && (t = re(t, n.config, { arrayMerge: (e, t) => t }), r = n.filepath), t = Rn(t);
847
+ let n = await X({ configFile: t.configFile }), r;
848
+ Hn(n) && (t = re(t, n.config, { arrayMerge: (e, t) => t }), r = n.filepath), t = Bn(t);
838
849
  let i;
839
850
  i = Array.isArray(t.files) ? t.files : [t.files];
840
- let a = await Ue(i), o = $e(a);
851
+ let a = await We(i), o = tt(a);
841
852
  if (o === "mixed") throw Error("Cannot mix SVG icons, TTF fonts, and WOFF/WOFF2 files in the same run");
842
853
  if (o === "empty") throw Error("Files glob patterns specified did not match any supported files");
843
854
  if (o === "webfont") {
844
- let e = await Ct(V(a, o), t);
855
+ let e = await Tt(V(a, o), t);
845
856
  return r && (e.config = {
846
857
  ...t,
847
858
  filePath: r
848
859
  }), e;
849
860
  }
850
861
  if (o === "ttf") {
851
- let e = await lt(V(a, o), t);
862
+ let e = await dt(V(a, o), t);
852
863
  return r && (e.config = {
853
864
  ...t,
854
865
  filePath: r
855
866
  }), e;
856
867
  }
857
- et(t.formats);
858
- let s = await An(await Nt(V(a, "svg"), t), t);
868
+ nt(t.formats);
869
+ let s = await Mn(await Ft(V(a, "svg"), t), t);
859
870
  return r ? s.config = {
860
871
  ...t,
861
872
  filePath: r
862
873
  } : s.config = t, s;
863
874
  };
864
- })), Wn, Gn = r((() => {
865
- Wn = (e) => {
875
+ })), Kn, qn = r((() => {
876
+ Kn = (e) => {
866
877
  if (e.svgDiagnose) return { diagnose: !0 };
867
878
  };
868
- })), Kn, qn = r((() => {
869
- Pn(), Kn = (e) => {
879
+ })), Jn, Yn = r((() => {
880
+ In(), Jn = (e) => {
870
881
  if (e === void 0) return;
871
882
  let t = e.trim();
872
883
  if (t.length === 0) throw Error("formats must not be empty");
@@ -878,12 +889,12 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
878
889
  throw Error("formats must be a JSON array (e.g. [\"woff2\",\"svg\"]) or comma-separated list");
879
890
  }
880
891
  if (!Array.isArray(e)) throw Error("formats must be a JSON array (e.g. [\"woff2\",\"svg\"]) or comma-separated list");
881
- return K(e);
892
+ return q(e);
882
893
  }
883
- return t.split(",").map((e) => e.trim()).filter((e) => e.length > 0).map(G);
894
+ return t.split(",").map((e) => e.trim()).filter((e) => e.length > 0).map(K);
884
895
  };
885
- })), Jn, Yn = r((() => {
886
- o(), Jn = (e) => {
896
+ })), Xn, Zn = r((() => {
897
+ o(), Xn = (e) => {
887
898
  if (e === void 0) return;
888
899
  let t = e.trim();
889
900
  if (t.length === 0) throw Error("template must not be empty");
@@ -899,16 +910,16 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
899
910
  }
900
911
  return t.includes(",") ? i(t.split(",").map((e) => e.trim()).filter((e) => e.length > 0)) : t;
901
912
  };
902
- })), Xn, X, Zn = r((() => {
903
- Un(), Xn = (e) => {
913
+ })), Qn, $n, er = r((() => {
914
+ Gn(), Qn = (e) => {
904
915
  if (!(!("config" in e) || e.config?.files === void 0)) return Array.isArray(e.config.files) ? e.config.files : [e.config.files];
905
- }, X = async (e, t) => {
906
- let n = await Vn({ configFile: t.configFile }), r = Xn(n);
916
+ }, $n = async (e, t) => {
917
+ let n = await Un({ configFile: t.configFile }), r = Qn(n);
907
918
  if (e.input.length > 0 && r !== void 0) throw Error("Cannot specify input files on the command line when `files` is set in the config file");
908
919
  return e.input.length > 0 ? e.input : r === void 0 ? [] : r;
909
920
  };
910
- })), Qn, $n, Z, er, Q, tr, nr, rr, ir, ar, or, $, sr, cr, lr, ur, dr, fr, pr, mr = r((() => {
911
- We(), Un(), Gn(), qn(), Yn(), Zn(), Qn = [
921
+ })), tr, nr, Z, rr, Q, ir, ar, or, sr, cr, lr, $, ur, dr, fr, pr, mr, hr, gr, _r = r((() => {
922
+ Ge(), Gn(), qn(), Yn(), Zn(), er(), tr = [
912
923
  "svg",
913
924
  "ttf",
914
925
  "otf",
@@ -917,37 +928,37 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
917
928
  "woff2",
918
929
  "hash",
919
930
  "template"
920
- ], $n = (e) => {
931
+ ], nr = (e) => {
921
932
  let t = {};
922
- typeof e.flags.config == "string" && (t.configFile = ee.silent(process.cwd(), e.flags.config) || d.join(process.cwd(), e.flags.config)), e.flags.fontName && (t.fontName = e.flags.fontName), e.flags.formats && (t.formats = Kn(e.flags.formats)), e.flags.dest && (t.dest = e.flags.dest), e.flags.destCreate && (t.destCreate = e.flags.destCreate), e.flags.template && (t.template = Jn(e.flags.template)), e.flags.templateClassName && (t.templateClassName = e.flags.templateClassName), e.flags.templateFontPath && (t.templateFontPath = e.flags.templateFontPath), e.flags.templateFontName && (t.templateFontName = e.flags.templateFontName), e.flags.templateCacheString && (t.templateCacheString = e.flags.templateCacheString), e.flags.destTemplate && (t.destTemplate = e.flags.destTemplate), e.flags.verbose && (t.verbose = e.flags.verbose), e.flags.fontId && (t.fontId = e.flags.fontId), e.flags.fontStyle && (t.fontStyle = e.flags.fontStyle), e.flags.fontWeight && (t.fontWeight = e.flags.fontWeight), e.flags.fixedWidth && (t.fixedWidth = e.flags.fixedWidth), e.flags.centerHorizontally && (t.centerHorizontally = e.flags.centerHorizontally), e.flags.centerVertically && (t.centerVertically = e.flags.centerVertically), e.flags.normalize && (t.normalize = e.flags.normalize), e.flags.optimizeSvg && (t.optimizeSvg = e.flags.optimizeSvg), e.flags.fontHeight && (t.fontHeight = e.flags.fontHeight), e.flags.round && (t.round = e.flags.round), e.flags.descent && (t.descent = e.flags.descent), e.flags.ascent && (t.ascent = e.flags.ascent), e.flags.startUnicode && (t.startUnicode = e.flags.startUnicode), e.flags.prependUnicode && (t.prependUnicode = e.flags.prependUnicode), e.flags.metadata && (t.metadata = e.flags.metadata), e.flags.sort === !1 && (t.sort = e.flags.sort), e.flags.ligatures && (t.ligatures = e.flags.ligatures), e.flags.unicodeRange && (t.unicodeRange = e.flags.unicodeRange), e.flags.templateFontLigatures === !1 && (t.templateFontLigatures = e.flags.templateFontLigatures), e.flags.addHashInFontUrl && (t.addHashInFontUrl = e.flags.addHashInFontUrl);
923
- let n = Wn(e.flags);
933
+ typeof e.flags.config == "string" && (t.configFile = ee.silent(process.cwd(), e.flags.config) || d.join(process.cwd(), e.flags.config)), e.flags.fontName && (t.fontName = e.flags.fontName), e.flags.formats && (t.formats = Jn(e.flags.formats)), e.flags.dest && (t.dest = e.flags.dest), e.flags.destCreate && (t.destCreate = e.flags.destCreate), e.flags.template && (t.template = Xn(e.flags.template)), e.flags.templateClassName && (t.templateClassName = e.flags.templateClassName), e.flags.templateFontPath && (t.templateFontPath = e.flags.templateFontPath), e.flags.templateFontName && (t.templateFontName = e.flags.templateFontName), e.flags.templateCacheString && (t.templateCacheString = e.flags.templateCacheString), e.flags.destTemplate && (t.destTemplate = e.flags.destTemplate), e.flags.verbose && (t.verbose = e.flags.verbose), e.flags.fontId && (t.fontId = e.flags.fontId), e.flags.fontStyle && (t.fontStyle = e.flags.fontStyle), e.flags.fontWeight && (t.fontWeight = e.flags.fontWeight), e.flags.fixedWidth && (t.fixedWidth = e.flags.fixedWidth), e.flags.centerHorizontally && (t.centerHorizontally = e.flags.centerHorizontally), e.flags.centerVertically && (t.centerVertically = e.flags.centerVertically), e.flags.normalize && (t.normalize = e.flags.normalize), e.flags.optimizeSvg && (t.optimizeSvg = e.flags.optimizeSvg), e.flags.fontHeight && (t.fontHeight = e.flags.fontHeight), e.flags.round && (t.round = e.flags.round), e.flags.descent && (t.descent = e.flags.descent), e.flags.ascent && (t.ascent = e.flags.ascent), e.flags.startUnicode && (t.startUnicode = e.flags.startUnicode), e.flags.prependUnicode && (t.prependUnicode = e.flags.prependUnicode), e.flags.metadata && (t.metadata = e.flags.metadata), e.flags.sort === !1 && (t.sort = e.flags.sort), e.flags.ligatures && (t.ligatures = e.flags.ligatures), e.flags.unicodeRange && (t.unicodeRange = e.flags.unicodeRange), e.flags.templateFontLigatures === !1 && (t.templateFontLigatures = e.flags.templateFontLigatures), e.flags.addHashInFontUrl && (t.addHashInFontUrl = e.flags.addHashInFontUrl);
934
+ let n = Kn(e.flags);
924
935
  return n && (t.svgTools = n), t;
925
936
  }, Z = (e) => {
926
937
  if (!e.config) throw Error("Missing config in webfont result");
927
938
  return e.config;
928
- }, er = (e, t) => (e.config = {
939
+ }, rr = (e, t) => (e.config = {
929
940
  ...Z(e),
930
941
  dest: t.dest,
931
942
  destTemplate: t.destTemplate
932
943
  }, e), Q = (e, t, n) => {
933
944
  let r = t.dest ?? process.cwd();
934
945
  return typeof t.destTemplate == "string" && (r = t.destTemplate), n ? d.join(r, `${t.fontName}.${e}`) : d.join(r, d.basename(e).replace(".njk", ""));
935
- }, tr = (e) => Array.isArray(e) ? e[0] : e, nr = (e, t) => {
946
+ }, ir = (e) => Array.isArray(e) ? e[0] : e, ar = (e, t) => {
936
947
  if (!e.template) return;
937
- let n = tr(t.template);
948
+ let n = ir(t.template);
938
949
  if (e.usedBuildInTemplate && n) return Q(n, t, !0);
939
950
  if (n) return Q(n, t, !1);
940
951
  let r = t.dest ?? process.cwd();
941
952
  return typeof t.destTemplate == "string" ? t.destTemplate : r;
942
- }, rr = async (e, t) => {
953
+ }, or = async (e, t) => {
943
954
  await Promise.all(e.map(async (e) => {
944
955
  let n = d.resolve(Q(e.template, t, !!e.builtIn));
945
956
  await l.promises.mkdir(d.dirname(n), { recursive: !0 }), await l.promises.writeFile(n, e.content);
946
957
  }));
947
- }, ir = (e, t, n, r) => {
958
+ }, sr = (e, t, n, r) => {
948
959
  let i = n.fontName, a = n.dest ?? process.cwd();
949
960
  return e === "template" ? d.resolve(r ?? a) : e === "hash" ? d.resolve(d.join(a, `${i}.hash`)) : d.resolve(d.join(a, `${i}.${e}`));
950
- }, ar = (e) => /* @__PURE__ */ Error(`Destination directory "${e}" does not exist. Use --dest-create (-m) to create it.`), or = async (e, t) => {
961
+ }, cr = (e) => /* @__PURE__ */ Error(`Destination directory "${e}" does not exist. Use --dest-create (-m) to create it.`), lr = async (e, t) => {
951
962
  try {
952
963
  await l.promises.access(e, l.constants.F_OK);
953
964
  } catch {
@@ -955,42 +966,42 @@ var ve, ye, be, xe, Se, Ce, we, Te, Ee, De, p, m, h, g, _, v, y, b, x, S, C, w,
955
966
  await l.promises.mkdir(e, { recursive: !0 });
956
967
  return;
957
968
  }
958
- throw ar(e);
969
+ throw cr(e);
959
970
  }
960
- }, $ = (e, t, n) => e.length === 1 && n.fontName ? n.fontName : He(e.map((e) => e.source))[e.indexOf(t)] ?? n.fontName, sr = async (e, t, n) => {
971
+ }, $ = (e, t, n) => e.length === 1 && n.fontName ? n.fontName : Ue(e.map((e) => e.source))[e.indexOf(t)] ?? n.fontName, ur = async (e, t, n) => {
961
972
  await Promise.all(e.flatMap((r) => {
962
973
  let i = $(e, r, t), a = [];
963
974
  return r.ttf && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.ttf`)), r.ttf)), r.otf && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.otf`)), r.otf)), a;
964
975
  }));
965
- }, cr = (e, t, n) => $(e, t, n), lr = async (e, t, n) => {
976
+ }, dr = (e, t, n) => $(e, t, n), fr = async (e, t, n) => {
966
977
  await Promise.all(e.flatMap((r) => {
967
- let i = cr(e, r, t), a = [];
968
- return r.ttf && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.ttf`)), r.ttf)), r.eot && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.eot`)), r.eot)), r.woff && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.woff`)), r.woff)), r.woff2 && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.woff2`)), r.woff2)), a;
978
+ let i = dr(e, r, t), a = [];
979
+ return r.svg && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.svg`)), r.svg)), r.ttf && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.ttf`)), r.ttf)), r.eot && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.eot`)), r.eot)), r.woff && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.woff`)), r.woff)), r.woff2 && a.push(l.promises.writeFile(d.resolve(d.join(n, `${i}.woff2`)), r.woff2)), a;
969
980
  }));
970
- }, ur = async (e) => {
971
- let t = Z(e), n = t.dest ?? process.cwd(), r = nr(e, t);
972
- return e.template && delete e.hash, await or(n, t.destCreate), e.templates && e.templates.length > 0 && await rr(e.templates, t), e.transcodedFonts && e.transcodedFonts.length > 1 ? (await lr(e.transcodedFonts, t, n), e) : e.decompressedFonts && e.decompressedFonts.length > 1 ? (await sr(e.decompressedFonts, t, n), e) : (await Promise.all(Qn.filter((t) => t === "template" && e.templates && e.templates.length > 0 ? !1 : e[t] !== void 0).map(async (n) => {
981
+ }, pr = async (e) => {
982
+ let t = Z(e), n = t.dest ?? process.cwd(), r = ar(e, t);
983
+ return e.template && delete e.hash, await lr(n, t.destCreate), e.templates && e.templates.length > 0 && await or(e.templates, t), e.transcodedFonts && e.transcodedFonts.length > 1 ? (await fr(e.transcodedFonts, t, n), e) : e.decompressedFonts && e.decompressedFonts.length > 1 ? (await ur(e.decompressedFonts, t, n), e) : (await Promise.all(tr.filter((t) => t === "template" && e.templates && e.templates.length > 0 ? !1 : e[t] !== void 0).map(async (n) => {
973
984
  let i = e[n];
974
985
  if (i === void 0) return;
975
- let a = ir(n, e, t, r);
986
+ let a = sr(n, e, t, r);
976
987
  await l.promises.writeFile(a, i);
977
988
  })), e);
978
- }, dr = (e) => typeof e == "object" && e && "code" in e && typeof e.code == "number" ? e.code : 1, fr = (e) => {
979
- pr(e).catch((e) => {
980
- console.log(e.stack), process.exit(dr(e));
989
+ }, mr = (e) => typeof e == "object" && e && "code" in e && typeof e.code == "number" ? e.code : 1, hr = (e) => {
990
+ gr(e).catch((e) => {
991
+ console.log(e.stack), process.exit(mr(e));
981
992
  });
982
- }, pr = async (e) => {
993
+ }, gr = async (e) => {
983
994
  e.flags.help && e.showHelp(), e.flags.version && e.showVersion();
984
- let t = $n(e), n = await X(e, t);
995
+ let t = nr(e), n = await $n(e, t);
985
996
  n.length === 0 && e.showHelp();
986
997
  let r = {
987
998
  ...t,
988
999
  files: n
989
- }, i = await Hn(r);
990
- return er(i, r), ur(i);
1000
+ }, i = await Wn(r);
1001
+ return rr(i, r), pr(i);
991
1002
  };
992
- })), hr = /* @__PURE__ */ a((() => {
993
- Re(), mr(), fr(Le);
1003
+ })), vr = /* @__PURE__ */ a((() => {
1004
+ ze(), _r(), hr(Re);
994
1005
  }));
995
1006
  //#endregion
996
- export default hr();
1007
+ export default vr();