xcstrings-cli 2.0.0 → 2.2.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 (3) hide show
  1. package/README.md +86 -1
  2. package/dist/index.js +1901 -1395
  3. package/package.json +4 -2
package/dist/index.js CHANGED
@@ -1,352 +1,197 @@
1
1
  #!/usr/bin/env node
2
- import vi from "yargs";
3
- import { hideBin as yi } from "yargs/helpers";
4
- import { readFile as wi, writeFile as yn, readdir as wn } from "node:fs/promises";
5
- import { cosmiconfig as Ai } from "cosmiconfig";
6
- import Le from "json5";
7
- import { XcodeProject as bi } from "@bacons/xcode";
8
- import { resolve as xe, relative as ce } from "node:path";
9
- import b from "chalk";
10
- import { checkbox as Xe, confirm as Ci, select as _i } from "@inquirer/prompts";
11
- async function ve(e) {
12
- const n = await wi(e, "utf-8");
13
- return JSON.parse(n);
14
- }
15
- async function An(e, n) {
16
- const i = JSON.stringify(n, null, 2), r = Si(i);
17
- await yn(e, r + `
18
- `, "utf-8");
19
- }
20
- function Si(e) {
21
- let n = "", i = !1, r = !1;
22
- for (let o = 0; o < e.length; o++) {
23
- const t = e[o];
24
- if (i && t === "\\" && !r) {
25
- r = !0, n += t;
26
- continue;
27
- }
28
- if (r) {
29
- r = !1, n += t;
30
- continue;
31
- }
32
- if (t === '"') {
33
- i = !i, n += t;
34
- continue;
35
- }
36
- if (!i && t === ":") {
37
- n += " :";
38
- continue;
39
- }
40
- n += t;
41
- }
42
- return n;
43
- }
44
- const Ce = "xcstrings-cli", Qe = Ai(Ce, {
2
+ import Lr from "yargs";
3
+ import { hideBin as jr } from "yargs/helpers";
4
+ import { resolve as Oe, relative as we } from "node:path";
5
+ import { cosmiconfig as Ir } from "cosmiconfig";
6
+ import De from "json5";
7
+ import { select as Nr, checkbox as on, confirm as Rr } from "@inquirer/prompts";
8
+ import k from "chalk";
9
+ import { readFile as Mr, writeFile as jn, readdir as In } from "node:fs/promises";
10
+ import { XcodeProject as Pr } from "@bacons/xcode";
11
+ const Le = "xcstrings-cli", ln = Ir(Le, {
45
12
  searchPlaces: [
46
- `${Ce}.json`,
47
- `${Ce}.json5`
13
+ `${Le}.json`,
14
+ `${Le}.json5`
48
15
  ],
49
16
  loaders: {
50
- ".json5": async (e, n) => Le.parse(n)
17
+ ".json5": async (e, n) => De.parse(n)
51
18
  },
52
19
  cache: !1
53
20
  });
54
- async function Re(e) {
21
+ async function He(e) {
55
22
  if (e) {
56
- const i = await Qe.load(e);
57
- return i ? i.config : null;
23
+ const r = await ln.load(e);
24
+ return r ? r.config : null;
58
25
  }
59
- const n = await Qe.search();
26
+ const n = await ln.search();
60
27
  return n ? n.config : null;
61
28
  }
62
- function Ei(e) {
63
- const n = xe(e, "project.pbxproj");
64
- return (bi.open(n).rootObject.props.knownRegions ?? []).filter((t) => t !== "Base").sort();
65
- }
66
- async function Oi(e) {
67
- const n = await ve(e), i = /* @__PURE__ */ new Set();
68
- if (!n.sourceLanguage)
69
- throw new Error('The xcstrings file is missing "sourceLanguage".');
70
- i.add(n.sourceLanguage);
71
- for (const r of Object.keys(n.strings)) {
72
- const o = n.strings[r];
73
- if (o.localizations)
74
- for (const t of Object.keys(o.localizations))
75
- i.add(t);
76
- }
77
- return Array.from(i).sort();
78
- }
79
- async function bn(e, n) {
80
- const { sourceLanguage: i } = await ve(e);
81
- if (!i)
82
- throw new Error('The xcstrings file is missing "sourceLanguage".');
83
- const r = await Re(n);
84
- if (r?.xcodeprojPaths && r.xcodeprojPaths.length > 0) {
85
- const l = /* @__PURE__ */ new Set();
86
- l.add(i);
87
- for (const a of r.xcodeprojPaths)
88
- Ei(a).forEach((u) => l.add(u));
89
- return Array.from(l).sort();
90
- }
91
- const o = await Oi(e), t = new Set(o);
92
- return t.add(i), Array.from(t).sort();
29
+ function an(e, n) {
30
+ if (!e || e.length === 0) return null;
31
+ for (const r of e)
32
+ if (typeof r != "string" && r.alias === n)
33
+ return r.path;
34
+ return null;
93
35
  }
94
- async function Fi(e, n, i, r, o, t, l) {
95
- const a = await ve(e);
96
- if (!a.sourceLanguage)
97
- throw new Error('The xcstrings file is missing "sourceLanguage".');
98
- const c = a.sourceLanguage;
99
- a.strings || (a.strings = {});
100
- const s = (await Re(o))?.missingLanguagePolicy || "skip";
101
- let p;
102
- const h = async (g) => s === "include" ? !0 : (p || (p = await bn(e, o)), p.includes(g)), d = {
103
- ...a.strings[n],
104
- extractionState: "manual"
105
- };
106
- if (i && (d.comment = i), t !== void 0) {
107
- const g = l ?? c;
108
- if (!await h(g))
109
- throw new Error(`Language "${g}" is not supported.`);
110
- d.localizations = d.localizations || {}, d.localizations[g] = {
111
- stringUnit: {
112
- state: "translated",
113
- value: t
114
- }
115
- };
36
+ async function Dr(e, n, r) {
37
+ const i = n?.xcstringsPaths, t = i?.some((s) => typeof s != "string") ?? !1, o = e.startsWith("alias:") ? e.slice(6) : null;
38
+ if (o) {
39
+ const s = an(i, o);
40
+ if (!s)
41
+ throw new Error(`Unknown alias: ${o}`);
42
+ return s;
116
43
  }
117
- const y = r ? { ...r } : void 0;
118
- if (y) {
119
- const g = [];
120
- for (const [C, L] of Object.entries(y)) {
121
- if (t !== void 0 && C === (l ?? c))
122
- continue;
123
- (s === "include" ? !0 : C === c || await h(C)) && g.push([C, L]);
124
- }
125
- if (g.length > 0) {
126
- d.localizations = d.localizations || {};
127
- for (const [C, L] of g)
128
- d.localizations[C] = {
129
- stringUnit: {
130
- state: "translated",
131
- value: L
132
- }
133
- };
44
+ const l = an(i, e);
45
+ if (l)
46
+ return l;
47
+ const a = !e.includes("/") && !e.endsWith(".xcstrings");
48
+ if (t && a)
49
+ throw new Error(`Unknown alias: ${e}`);
50
+ if (e === r && i && i.length > 0) {
51
+ if (i.length === 1) {
52
+ const u = i[0];
53
+ return typeof u == "string" ? u : u.path;
134
54
  }
55
+ const s = i.map((u) => typeof u == "string" ? { name: u, value: u } : { name: `${u.alias} (${u.path})`, value: u.path });
56
+ return await Nr({
57
+ message: "Select xcstrings file:",
58
+ choices: s
59
+ });
135
60
  }
136
- a.strings[n] = d, await An(e, a);
61
+ return e;
137
62
  }
138
- function Li(e, n, i, r, o) {
139
- if (e.localizations) {
140
- for (const t of n)
141
- e.localizations[t] && (o[r] ??= [], o[r].push(t), i || delete e.localizations[t]);
142
- !i && e.localizations && Object.keys(e.localizations).length === 0 && delete e.localizations;
143
- }
63
+ async function me(e) {
64
+ const n = await Mr(e, "utf-8");
65
+ return JSON.parse(n);
144
66
  }
145
- async function ki(e, n, i, r = !1) {
146
- const o = await ve(e), t = {}, l = o.strings || {};
147
- o.strings = l;
148
- const a = n ? [n] : Object.keys(l);
149
- let c = !1;
150
- for (const u of a) {
151
- const s = l[u];
152
- if (!s)
67
+ async function Nn(e, n) {
68
+ const r = JSON.stringify(n, null, 2), i = Br(r);
69
+ await jn(e, i + `
70
+ `, "utf-8");
71
+ }
72
+ function Br(e) {
73
+ let n = "", r = !1, i = !1;
74
+ for (let t = 0; t < e.length; t++) {
75
+ const o = e[t];
76
+ if (r && o === "\\" && !i) {
77
+ i = !0, n += o;
153
78
  continue;
154
- if (!i || i.length === 0) {
155
- const d = Object.keys(s.localizations ?? {});
156
- t[u] = d, r || delete l[u], c = !0;
79
+ }
80
+ if (i) {
81
+ i = !1, n += o;
157
82
  continue;
158
83
  }
159
- Li(s, i, r, u, t);
160
- const p = t[u]?.length ?? 0;
161
- !(s.localizations && Object.keys(s.localizations).length > 0) && p > 0 && (r || delete l[u]), p > 0 && (c = !0);
162
- }
163
- return !r && c && await An(e, o), t;
164
- }
165
- const _e = "xcstrings-cli.json5";
166
- async function Ti(e) {
167
- const n = [];
168
- async function i(r) {
169
- try {
170
- const o = await wn(r, { withFileTypes: !0 });
171
- for (const t of o) {
172
- const l = xe(r, t.name);
173
- t.isDirectory() ? !t.name.startsWith(".") && t.name !== "node_modules" && await i(l) : t.name.endsWith(".xcstrings") && n.push(l);
174
- }
175
- } catch {
84
+ if (o === '"') {
85
+ r = !r, n += o;
86
+ continue;
176
87
  }
177
- }
178
- return await i(e), n;
179
- }
180
- async function ji(e) {
181
- const n = [];
182
- let i = e;
183
- try {
184
- const r = await wn(i, { withFileTypes: !0 });
185
- for (const o of r)
186
- o.isDirectory() && o.name.endsWith(".xcodeproj") && n.push(xe(i, o.name));
187
- } catch {
88
+ if (!r && o === ":") {
89
+ n += " :";
90
+ continue;
91
+ }
92
+ n += o;
188
93
  }
189
94
  return n;
190
95
  }
191
- async function Ii() {
192
- const e = process.cwd();
193
- console.log(), console.log(b.bold.cyan("🚀 xcstrings-cli Configuration Setup")), console.log(b.dim("─".repeat(40))), console.log(), console.log(b.yellow("🔍 Searching for .xcstrings files..."));
194
- const n = await Ti(e);
195
- console.log(b.yellow("🔍 Searching for .xcodeproj directories..."));
196
- const i = await ji(e);
197
- console.log();
198
- let r = [];
199
- if (n.length > 0) {
200
- console.log(b.green(`✓ Found ${n.length} .xcstrings file(s)`)), console.log();
201
- const u = n.map((s) => ({
202
- name: b.white(ce(e, s)) + b.dim(` (${s})`),
203
- value: ce(e, s),
204
- checked: !0
205
- }));
206
- r = await Xe({
207
- message: b.bold("Select .xcstrings files to manage:"),
208
- choices: u
209
- });
210
- } else
211
- console.log(b.dim(" No .xcstrings files found in current directory"));
212
- console.log();
213
- let o = [];
214
- if (i.length > 0) {
215
- console.log(b.green(`✓ Found ${i.length} .xcodeproj director${i.length === 1 ? "y" : "ies"}`)), console.log();
216
- const u = i.map((s) => ({
217
- name: b.white(ce(e, s) || s) + b.dim(` (${s})`),
218
- value: ce(e, s) || s,
219
- checked: !0
220
- }));
221
- o = await Xe({
222
- message: b.bold("Select .xcodeproj directories for language detection:"),
223
- choices: u
224
- });
225
- } else
226
- console.log(b.dim(" No .xcodeproj directories found"));
227
- if (console.log(), console.log(b.dim("─".repeat(40))), console.log(), console.log(b.bold("📋 Configuration Summary:")), console.log(), console.log(b.cyan(" xcstringsPaths:")), r.length > 0 ? r.forEach((u) => console.log(b.white(` • ${u}`))) : console.log(b.dim(" (none)")), console.log(), console.log(b.cyan(" xcodeprojPaths:")), o.length > 0 ? o.forEach((u) => console.log(b.white(` • ${u}`))) : console.log(b.dim(" (none)")), console.log(), !await Ci({
228
- message: b.bold(`Create ${b.yellow(_e)}?`),
229
- default: !0
230
- })) {
231
- console.log(b.dim(" Configuration cancelled."));
232
- return;
233
- }
234
- const l = r.map((u) => ` "${u}"`).join(`,
235
- `), a = o.map((u) => ` "${u}"`).join(`,
236
- `), c = `{
237
- // Paths to .xcstrings files to manage. Specify relative or absolute paths.
238
- xcstringsPaths: [
239
- ${l}
240
- ],
241
- // Paths to .xcodeproj directories. Used for discovering supported languages.
242
- xcodeprojPaths: [
243
- ${a}
244
- ],
245
- // Behavior for handling missing languages when adding strings.
246
- missingLanguagePolicy: "skip",
247
- }
248
- `;
249
- await yn(_e, c, "utf-8"), console.log(), console.log(b.bold.green(`✓ Created ${_e}`)), console.log(b.dim(` Run ${b.cyan("xcstrings --help")} to see available commands.`)), console.log();
250
- }
251
- function Ni(e) {
96
+ function $r(e) {
252
97
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
253
98
  }
254
- var Z = { exports: {} }, Se, Je;
255
- function Ri() {
256
- if (Je) return Se;
257
- Je = 1;
258
- function e(i) {
99
+ var ce = { exports: {} }, je, sn;
100
+ function Ur() {
101
+ if (sn) return je;
102
+ sn = 1;
103
+ function e(r) {
259
104
  try {
260
- return JSON.stringify(i);
105
+ return JSON.stringify(r);
261
106
  } catch {
262
107
  return '"[Circular]"';
263
108
  }
264
109
  }
265
- Se = n;
266
- function n(i, r, o) {
267
- var t = o && o.stringify || e, l = 1;
268
- if (typeof i == "object" && i !== null) {
269
- var a = r.length + l;
270
- if (a === 1) return i;
271
- var c = new Array(a);
272
- c[0] = t(i);
273
- for (var u = 1; u < a; u++)
274
- c[u] = t(r[u]);
275
- return c.join(" ");
110
+ je = n;
111
+ function n(r, i, t) {
112
+ var o = t && t.stringify || e, l = 1;
113
+ if (typeof r == "object" && r !== null) {
114
+ var a = i.length + l;
115
+ if (a === 1) return r;
116
+ var s = new Array(a);
117
+ s[0] = o(r);
118
+ for (var c = 1; c < a; c++)
119
+ s[c] = o(i[c]);
120
+ return s.join(" ");
276
121
  }
277
- if (typeof i != "string")
278
- return i;
279
- var s = r.length;
280
- if (s === 0) return i;
281
- for (var p = "", h = 1 - l, d = -1, y = i && i.length || 0, g = 0; g < y; ) {
282
- if (i.charCodeAt(g) === 37 && g + 1 < y) {
283
- switch (d = d > -1 ? d : 0, i.charCodeAt(g + 1)) {
122
+ if (typeof r != "string")
123
+ return r;
124
+ var u = i.length;
125
+ if (u === 0) return r;
126
+ for (var f = "", h = 1 - l, d = -1, m = r && r.length || 0, g = 0; g < m; ) {
127
+ if (r.charCodeAt(g) === 37 && g + 1 < m) {
128
+ switch (d = d > -1 ? d : 0, r.charCodeAt(g + 1)) {
284
129
  case 100:
285
130
  // 'd'
286
131
  case 102:
287
- if (h >= s || r[h] == null) break;
288
- d < g && (p += i.slice(d, g)), p += Number(r[h]), d = g + 2, g++;
132
+ if (h >= u || i[h] == null) break;
133
+ d < g && (f += r.slice(d, g)), f += Number(i[h]), d = g + 2, g++;
289
134
  break;
290
135
  case 105:
291
- if (h >= s || r[h] == null) break;
292
- d < g && (p += i.slice(d, g)), p += Math.floor(Number(r[h])), d = g + 2, g++;
136
+ if (h >= u || i[h] == null) break;
137
+ d < g && (f += r.slice(d, g)), f += Math.floor(Number(i[h])), d = g + 2, g++;
293
138
  break;
294
139
  case 79:
295
140
  // 'O'
296
141
  case 111:
297
142
  // 'o'
298
143
  case 106:
299
- if (h >= s || r[h] === void 0) break;
300
- d < g && (p += i.slice(d, g));
301
- var C = typeof r[h];
302
- if (C === "string") {
303
- p += "'" + r[h] + "'", d = g + 2, g++;
144
+ if (h >= u || i[h] === void 0) break;
145
+ d < g && (f += r.slice(d, g));
146
+ var b = typeof i[h];
147
+ if (b === "string") {
148
+ f += "'" + i[h] + "'", d = g + 2, g++;
304
149
  break;
305
150
  }
306
- if (C === "function") {
307
- p += r[h].name || "<anonymous>", d = g + 2, g++;
151
+ if (b === "function") {
152
+ f += i[h].name || "<anonymous>", d = g + 2, g++;
308
153
  break;
309
154
  }
310
- p += t(r[h]), d = g + 2, g++;
155
+ f += o(i[h]), d = g + 2, g++;
311
156
  break;
312
157
  case 115:
313
- if (h >= s)
158
+ if (h >= u)
314
159
  break;
315
- d < g && (p += i.slice(d, g)), p += String(r[h]), d = g + 2, g++;
160
+ d < g && (f += r.slice(d, g)), f += String(i[h]), d = g + 2, g++;
316
161
  break;
317
162
  case 37:
318
- d < g && (p += i.slice(d, g)), p += "%", d = g + 2, g++, h--;
163
+ d < g && (f += r.slice(d, g)), f += "%", d = g + 2, g++, h--;
319
164
  break;
320
165
  }
321
166
  ++h;
322
167
  }
323
168
  ++g;
324
169
  }
325
- return d === -1 ? i : (d < y && (p += i.slice(d)), p);
326
- }
327
- return Se;
328
- }
329
- var Ze;
330
- function Mi() {
331
- if (Ze) return Z.exports;
332
- Ze = 1;
333
- const e = Ri();
334
- Z.exports = s;
335
- const n = gi().console || {}, i = {
336
- mapHttpRequest: le,
337
- mapHttpResponse: le,
338
- wrapRequestSerializer: Ae,
339
- wrapResponseSerializer: Ae,
340
- wrapErrorSerializer: Ae,
341
- req: le,
342
- res: le,
343
- err: Ue,
344
- errWithCause: Ue
170
+ return d === -1 ? r : (d < m && (f += r.slice(d)), f);
171
+ }
172
+ return je;
173
+ }
174
+ var cn;
175
+ function zr() {
176
+ if (cn) return ce.exports;
177
+ cn = 1;
178
+ const e = Ur();
179
+ ce.exports = u;
180
+ const n = Or().console || {}, r = {
181
+ mapHttpRequest: Q,
182
+ mapHttpResponse: Q,
183
+ wrapRequestSerializer: B,
184
+ wrapResponseSerializer: B,
185
+ wrapErrorSerializer: B,
186
+ req: Q,
187
+ res: Q,
188
+ err: U,
189
+ errWithCause: U
345
190
  };
346
- function r(f, m) {
347
- return f === "silent" ? 1 / 0 : m.levels.values[f];
191
+ function i(p, y) {
192
+ return p === "silent" ? 1 / 0 : y.levels.values[p];
348
193
  }
349
- const o = Symbol("pino.logFuncs"), t = Symbol("pino.hierarchy"), l = {
194
+ const t = Symbol("pino.logFuncs"), o = Symbol("pino.hierarchy"), l = {
350
195
  error: "log",
351
196
  fatal: "error",
352
197
  warn: "error",
@@ -354,101 +199,101 @@ function Mi() {
354
199
  debug: "log",
355
200
  trace: "log"
356
201
  };
357
- function a(f, m) {
358
- const w = {
359
- logger: m,
360
- parent: f[t]
202
+ function a(p, y) {
203
+ const A = {
204
+ logger: y,
205
+ parent: p[o]
361
206
  };
362
- m[t] = w;
363
- }
364
- function c(f, m, w) {
365
- const _ = {};
366
- m.forEach((S) => {
367
- _[S] = w[S] ? w[S] : n[S] || n[l[S] || "log"] || J;
368
- }), f[o] = _;
369
- }
370
- function u(f, m) {
371
- return Array.isArray(f) ? f.filter(function(_) {
372
- return _ !== "!stdSerializers.err";
373
- }) : f === !0 ? Object.keys(m) : !1;
374
- }
375
- function s(f) {
376
- f = f || {}, f.browser = f.browser || {};
377
- const m = f.browser.transmit;
378
- if (m && typeof m.send != "function")
207
+ y[o] = A;
208
+ }
209
+ function s(p, y, A) {
210
+ const E = {};
211
+ y.forEach((S) => {
212
+ E[S] = A[S] ? A[S] : n[S] || n[l[S] || "log"] || se;
213
+ }), p[t] = E;
214
+ }
215
+ function c(p, y) {
216
+ return Array.isArray(p) ? p.filter(function(E) {
217
+ return E !== "!stdSerializers.err";
218
+ }) : p === !0 ? Object.keys(y) : !1;
219
+ }
220
+ function u(p) {
221
+ p = p || {}, p.browser = p.browser || {};
222
+ const y = p.browser.transmit;
223
+ if (y && typeof y.send != "function")
379
224
  throw Error("pino: transmit option must have a send function");
380
- const w = f.browser.write || n;
381
- f.browser.write && (f.browser.asObject = !0);
382
- const _ = f.serializers || {}, S = u(f.browser.serialize, _);
383
- let N = f.browser.serialize;
384
- Array.isArray(f.browser.serialize) && f.browser.serialize.indexOf("!stdSerializers.err") > -1 && (N = !1);
385
- const B = Object.keys(f.customLevels || {}), E = ["error", "fatal", "warn", "info", "debug", "trace"].concat(B);
386
- typeof w == "function" && E.forEach(function(R) {
387
- w[R] = w;
388
- }), (f.enabled === !1 || f.browser.disabled) && (f.level = "silent");
389
- const j = f.level || "info", v = Object.create(w);
390
- v.log || (v.log = J), c(v, E, w), a({}, v), Object.defineProperty(v, "levelVal", {
391
- get: te
392
- }), Object.defineProperty(v, "level", {
393
- get: $,
394
- set: mi
225
+ const A = p.browser.write || n;
226
+ p.browser.write && (p.browser.asObject = !0);
227
+ const E = p.serializers || {}, S = c(p.browser.serialize, E);
228
+ let M = p.browser.serialize;
229
+ Array.isArray(p.browser.serialize) && p.browser.serialize.indexOf("!stdSerializers.err") > -1 && (M = !1);
230
+ const H = Object.keys(p.customLevels || {}), _ = ["error", "fatal", "warn", "info", "debug", "trace"].concat(H);
231
+ typeof A == "function" && _.forEach(function(P) {
232
+ A[P] = A;
233
+ }), (p.enabled === !1 || p.browser.disabled) && (p.level = "silent");
234
+ const j = p.level || "info", w = Object.create(A);
235
+ w.log || (w.log = se), s(w, _, A), a({}, w), Object.defineProperty(w, "levelVal", {
236
+ get: ve
237
+ }), Object.defineProperty(w, "level", {
238
+ get: J,
239
+ set: Fr
395
240
  });
396
- const D = {
397
- transmit: m,
241
+ const $ = {
242
+ transmit: y,
398
243
  serialize: S,
399
- asObject: f.browser.asObject,
400
- formatters: f.browser.formatters,
401
- levels: E,
402
- timestamp: pi(f)
244
+ asObject: p.browser.asObject,
245
+ formatters: p.browser.formatters,
246
+ levels: _,
247
+ timestamp: ae(p)
403
248
  };
404
- v.levels = p(f), v.level = j, v.setMaxListeners = v.getMaxListeners = v.emit = v.addListener = v.on = v.prependListener = v.once = v.prependOnceListener = v.removeListener = v.removeAllListeners = v.listeners = v.listenerCount = v.eventNames = v.write = v.flush = J, v.serializers = _, v._serialize = S, v._stdErrSerialize = N, v.child = xi, m && (v._logEvent = we());
405
- function te() {
406
- return r(this.level, this);
249
+ w.levels = f(p), w.level = j, w.setMaxListeners = w.getMaxListeners = w.emit = w.addListener = w.on = w.prependListener = w.once = w.prependOnceListener = w.removeListener = w.removeAllListeners = w.listeners = w.listenerCount = w.eventNames = w.write = w.flush = se, w.serializers = E, w._serialize = S, w._stdErrSerialize = M, w.child = Tr, y && (w._logEvent = Y());
250
+ function ve() {
251
+ return i(this.level, this);
407
252
  }
408
- function $() {
253
+ function J() {
409
254
  return this._level;
410
255
  }
411
- function mi(R) {
412
- if (R !== "silent" && !this.levels.values[R])
413
- throw Error("unknown level " + R);
414
- this._level = R, y(this, D, v, "error"), y(this, D, v, "fatal"), y(this, D, v, "warn"), y(this, D, v, "info"), y(this, D, v, "debug"), y(this, D, v, "trace"), B.forEach((K) => {
415
- y(this, D, v, K);
256
+ function Fr(P) {
257
+ if (P !== "silent" && !this.levels.values[P])
258
+ throw Error("unknown level " + P);
259
+ this._level = P, m(this, $, w, "error"), m(this, $, w, "fatal"), m(this, $, w, "warn"), m(this, $, w, "info"), m(this, $, w, "debug"), m(this, $, w, "trace"), H.forEach((Z) => {
260
+ m(this, $, w, Z);
416
261
  });
417
262
  }
418
- function xi(R, K) {
419
- if (!R)
263
+ function Tr(P, Z) {
264
+ if (!P)
420
265
  throw new Error("missing bindings for child Pino");
421
- K = K || {}, S && R.serializers && (K.serializers = R.serializers);
422
- const We = K.serializers;
423
- if (S && We) {
424
- var ae = Object.assign({}, _, We), Ge = f.browser.serialize === !0 ? Object.keys(ae) : S;
425
- delete R.serializers, A([R], Ge, ae, this._stdErrSerialize);
266
+ Z = Z || {}, S && P.serializers && (Z.serializers = P.serializers);
267
+ const en = Z.serializers;
268
+ if (S && en) {
269
+ var xe = Object.assign({}, E, en), nn = p.browser.serialize === !0 ? Object.keys(xe) : S;
270
+ delete P.serializers, x([P], nn, xe, this._stdErrSerialize);
426
271
  }
427
- function qe(Ve) {
428
- this._childLevel = (Ve._childLevel | 0) + 1, this.bindings = R, ae && (this.serializers = ae, this._serialize = Ge), m && (this._logEvent = we(
429
- [].concat(Ve._logEvent.bindings, R)
272
+ function rn(tn) {
273
+ this._childLevel = (tn._childLevel | 0) + 1, this.bindings = P, xe && (this.serializers = xe, this._serialize = nn), y && (this._logEvent = Y(
274
+ [].concat(tn._logEvent.bindings, P)
430
275
  ));
431
276
  }
432
- qe.prototype = this;
433
- const be = new qe(this);
434
- return a(this, be), be.level = this.level, be;
277
+ rn.prototype = this;
278
+ const Te = new rn(this);
279
+ return a(this, Te), Te.level = this.level, Te;
435
280
  }
436
- return v;
281
+ return w;
437
282
  }
438
- function p(f) {
439
- const m = f.customLevels || {}, w = Object.assign({}, s.levels.values, m), _ = Object.assign({}, s.levels.labels, h(m));
283
+ function f(p) {
284
+ const y = p.customLevels || {}, A = Object.assign({}, u.levels.values, y), E = Object.assign({}, u.levels.labels, h(y));
440
285
  return {
441
- values: w,
442
- labels: _
286
+ values: A,
287
+ labels: E
443
288
  };
444
289
  }
445
- function h(f) {
446
- const m = {};
447
- return Object.keys(f).forEach(function(w) {
448
- m[f[w]] = w;
449
- }), m;
290
+ function h(p) {
291
+ const y = {};
292
+ return Object.keys(p).forEach(function(A) {
293
+ y[p[A]] = A;
294
+ }), y;
450
295
  }
451
- s.levels = {
296
+ u.levels = {
452
297
  values: {
453
298
  fatal: 60,
454
299
  error: 50,
@@ -465,133 +310,133 @@ function Mi() {
465
310
  50: "error",
466
311
  60: "fatal"
467
312
  }
468
- }, s.stdSerializers = i, s.stdTimeFunctions = Object.assign({}, { nullTime: $e, epochTime: Ke, unixTime: di, isoTime: hi });
469
- function d(f) {
470
- const m = [];
471
- f.bindings && m.push(f.bindings);
472
- let w = f[t];
473
- for (; w.parent; )
474
- w = w.parent, w.logger.bindings && m.push(w.logger.bindings);
475
- return m.reverse();
476
- }
477
- function y(f, m, w, _) {
478
- if (Object.defineProperty(f, _, {
479
- value: r(f.level, w) > r(_, w) ? J : w[o][_],
313
+ }, u.stdSerializers = r, u.stdTimeFunctions = Object.assign({}, { nullTime: Je, epochTime: Ze, unixTime: Sr, isoTime: _r });
314
+ function d(p) {
315
+ const y = [];
316
+ p.bindings && y.push(p.bindings);
317
+ let A = p[o];
318
+ for (; A.parent; )
319
+ A = A.parent, A.logger.bindings && y.push(A.logger.bindings);
320
+ return y.reverse();
321
+ }
322
+ function m(p, y, A, E) {
323
+ if (Object.defineProperty(p, E, {
324
+ value: i(p.level, A) > i(E, A) ? se : A[t][E],
480
325
  writable: !0,
481
326
  enumerable: !0,
482
327
  configurable: !0
483
- }), !m.transmit && f[_] === J)
328
+ }), !y.transmit && p[E] === se)
484
329
  return;
485
- f[_] = C(f, m, w, _);
486
- const S = d(f);
487
- S.length !== 0 && (f[_] = g(S, f[_]));
330
+ p[E] = b(p, y, A, E);
331
+ const S = d(p);
332
+ S.length !== 0 && (p[E] = g(S, p[E]));
488
333
  }
489
- function g(f, m) {
334
+ function g(p, y) {
490
335
  return function() {
491
- return m.apply(this, [...f, ...arguments]);
336
+ return y.apply(this, [...p, ...arguments]);
492
337
  };
493
338
  }
494
- function C(f, m, w, _) {
339
+ function b(p, y, A, E) {
495
340
  return /* @__PURE__ */ (function(S) {
496
341
  return function() {
497
- const B = m.timestamp(), E = new Array(arguments.length), j = Object.getPrototypeOf && Object.getPrototypeOf(this) === n ? n : this;
498
- for (var v = 0; v < E.length; v++) E[v] = arguments[v];
499
- if (m.serialize && !m.asObject && A(E, this._serialize, this.serializers, this._stdErrSerialize), m.asObject || m.formatters ? S.call(j, L(this, _, E, B, m.formatters)) : S.apply(j, E), m.transmit) {
500
- const D = m.transmit.level || f._level, te = w.levels.values[D], $ = w.levels.values[_];
501
- if ($ < te) return;
502
- He(this, {
503
- ts: B,
504
- methodLevel: _,
505
- methodValue: $,
506
- transmitValue: w.levels.values[m.transmit.level || f._level],
507
- send: m.transmit.send,
508
- val: r(f._level, w)
509
- }, E);
342
+ const H = y.timestamp(), _ = new Array(arguments.length), j = Object.getPrototypeOf && Object.getPrototypeOf(this) === n ? n : this;
343
+ for (var w = 0; w < _.length; w++) _[w] = arguments[w];
344
+ if (y.serialize && !y.asObject && x(_, this._serialize, this.serializers, this._stdErrSerialize), y.asObject || y.formatters ? S.call(j, C(this, E, _, H, y.formatters)) : S.apply(j, _), y.transmit) {
345
+ const $ = y.transmit.level || p._level, ve = A.levels.values[$], J = A.levels.values[E];
346
+ if (J < ve) return;
347
+ W(this, {
348
+ ts: H,
349
+ methodLevel: E,
350
+ methodValue: J,
351
+ transmitValue: A.levels.values[y.transmit.level || p._level],
352
+ send: y.transmit.send,
353
+ val: i(p._level, A)
354
+ }, _);
510
355
  }
511
356
  };
512
- })(f[o][_]);
357
+ })(p[t][E]);
513
358
  }
514
- function L(f, m, w, _, S = {}) {
359
+ function C(p, y, A, E, S = {}) {
515
360
  const {
516
- level: N = () => f.levels.values[m],
517
- log: B = ($) => $
361
+ level: M = () => p.levels.values[y],
362
+ log: H = (J) => J
518
363
  } = S;
519
- f._serialize && A(w, f._serialize, f.serializers, f._stdErrSerialize);
520
- const E = w.slice();
521
- let j = E[0];
522
- const v = {};
523
- _ && (v.time = _), v.level = N(m, f.levels.values[m]);
524
- let D = (f._childLevel | 0) + 1;
525
- if (D < 1 && (D = 1), j !== null && typeof j == "object") {
526
- for (; D-- && typeof E[0] == "object"; )
527
- Object.assign(v, E.shift());
528
- j = E.length ? e(E.shift(), E) : void 0;
529
- } else typeof j == "string" && (j = e(E.shift(), E));
530
- return j !== void 0 && (v.msg = j), B(v);
531
- }
532
- function A(f, m, w, _) {
533
- for (const S in f)
534
- if (_ && f[S] instanceof Error)
535
- f[S] = s.stdSerializers.err(f[S]);
536
- else if (typeof f[S] == "object" && !Array.isArray(f[S]))
537
- for (const N in f[S])
538
- m && m.indexOf(N) > -1 && N in w && (f[S][N] = w[N](f[S][N]));
539
- }
540
- function He(f, m, w) {
541
- const _ = m.send, S = m.ts, N = m.methodLevel, B = m.methodValue, E = m.val, j = f._logEvent.bindings;
542
- A(
543
- w,
544
- f._serialize || Object.keys(f.serializers),
545
- f.serializers,
546
- f._stdErrSerialize === void 0 ? !0 : f._stdErrSerialize
547
- ), f._logEvent.ts = S, f._logEvent.messages = w.filter(function(v) {
548
- return j.indexOf(v) === -1;
549
- }), f._logEvent.level.label = N, f._logEvent.level.value = B, _(N, f._logEvent, E), f._logEvent = we(j);
550
- }
551
- function we(f) {
364
+ p._serialize && x(A, p._serialize, p.serializers, p._stdErrSerialize);
365
+ const _ = A.slice();
366
+ let j = _[0];
367
+ const w = {};
368
+ E && (w.time = E), w.level = M(y, p.levels.values[y]);
369
+ let $ = (p._childLevel | 0) + 1;
370
+ if ($ < 1 && ($ = 1), j !== null && typeof j == "object") {
371
+ for (; $-- && typeof _[0] == "object"; )
372
+ Object.assign(w, _.shift());
373
+ j = _.length ? e(_.shift(), _) : void 0;
374
+ } else typeof j == "string" && (j = e(_.shift(), _));
375
+ return j !== void 0 && (w.msg = j), H(w);
376
+ }
377
+ function x(p, y, A, E) {
378
+ for (const S in p)
379
+ if (E && p[S] instanceof Error)
380
+ p[S] = u.stdSerializers.err(p[S]);
381
+ else if (typeof p[S] == "object" && !Array.isArray(p[S]))
382
+ for (const M in p[S])
383
+ y && y.indexOf(M) > -1 && M in A && (p[S][M] = A[M](p[S][M]));
384
+ }
385
+ function W(p, y, A) {
386
+ const E = y.send, S = y.ts, M = y.methodLevel, H = y.methodValue, _ = y.val, j = p._logEvent.bindings;
387
+ x(
388
+ A,
389
+ p._serialize || Object.keys(p.serializers),
390
+ p.serializers,
391
+ p._stdErrSerialize === void 0 ? !0 : p._stdErrSerialize
392
+ ), p._logEvent.ts = S, p._logEvent.messages = A.filter(function(w) {
393
+ return j.indexOf(w) === -1;
394
+ }), p._logEvent.level.label = M, p._logEvent.level.value = H, E(M, p._logEvent, _), p._logEvent = Y(j);
395
+ }
396
+ function Y(p) {
552
397
  return {
553
398
  ts: 0,
554
399
  messages: [],
555
- bindings: f || [],
400
+ bindings: p || [],
556
401
  level: { label: "", value: 0 }
557
402
  };
558
403
  }
559
- function Ue(f) {
560
- const m = {
561
- type: f.constructor.name,
562
- msg: f.message,
563
- stack: f.stack
404
+ function U(p) {
405
+ const y = {
406
+ type: p.constructor.name,
407
+ msg: p.message,
408
+ stack: p.stack
564
409
  };
565
- for (const w in f)
566
- m[w] === void 0 && (m[w] = f[w]);
567
- return m;
410
+ for (const A in p)
411
+ y[A] === void 0 && (y[A] = p[A]);
412
+ return y;
568
413
  }
569
- function pi(f) {
570
- return typeof f.timestamp == "function" ? f.timestamp : f.timestamp === !1 ? $e : Ke;
414
+ function ae(p) {
415
+ return typeof p.timestamp == "function" ? p.timestamp : p.timestamp === !1 ? Je : Ze;
571
416
  }
572
- function le() {
417
+ function Q() {
573
418
  return {};
574
419
  }
575
- function Ae(f) {
576
- return f;
420
+ function B(p) {
421
+ return p;
577
422
  }
578
- function J() {
423
+ function se() {
579
424
  }
580
- function $e() {
425
+ function Je() {
581
426
  return !1;
582
427
  }
583
- function Ke() {
428
+ function Ze() {
584
429
  return Date.now();
585
430
  }
586
- function di() {
431
+ function Sr() {
587
432
  return Math.round(Date.now() / 1e3);
588
433
  }
589
- function hi() {
434
+ function _r() {
590
435
  return new Date(Date.now()).toISOString();
591
436
  }
592
- function gi() {
593
- function f(m) {
594
- return typeof m < "u" && m;
437
+ function Or() {
438
+ function p(y) {
439
+ return typeof y < "u" && y;
595
440
  }
596
441
  try {
597
442
  return typeof globalThis < "u" || Object.defineProperty(Object.prototype, "globalThis", {
@@ -601,104 +446,146 @@ function Mi() {
601
446
  configurable: !0
602
447
  }), globalThis;
603
448
  } catch {
604
- return f(self) || f(window) || f(this) || {};
449
+ return p(self) || p(window) || p(this) || {};
605
450
  }
606
451
  }
607
- return Z.exports.default = s, Z.exports.pino = s, Z.exports;
452
+ return ce.exports.default = u, ce.exports.pino = u, ce.exports;
608
453
  }
609
- var Di = Mi();
610
- const Pi = /* @__PURE__ */ Ni(Di), W = Pi({
454
+ var Yr = zr();
455
+ const Hr = /* @__PURE__ */ $r(Yr), V = Hr({
611
456
  level: process.env.LOG_LEVEL || "info"
612
457
  });
613
- function Cn(e) {
458
+ function Kr() {
459
+ return {
460
+ command: "languages",
461
+ describe: "List supported languages from xcodeproj or xcstrings",
462
+ handler: async (e) => {
463
+ const n = await Rn(e.path, e.config);
464
+ V.info(n.join(" "));
465
+ }
466
+ };
467
+ }
468
+ function Wr(e) {
469
+ const n = Oe(e, "project.pbxproj");
470
+ return (Pr.open(n).rootObject.props.knownRegions ?? []).filter((o) => o !== "Base").sort();
471
+ }
472
+ async function qr(e) {
473
+ const n = await me(e), r = /* @__PURE__ */ new Set();
474
+ if (!n.sourceLanguage)
475
+ throw new Error('The xcstrings file is missing "sourceLanguage".');
476
+ r.add(n.sourceLanguage);
477
+ for (const i of Object.keys(n.strings)) {
478
+ const t = n.strings[i];
479
+ if (t.localizations)
480
+ for (const o of Object.keys(t.localizations))
481
+ r.add(o);
482
+ }
483
+ return Array.from(r).sort();
484
+ }
485
+ async function Rn(e, n) {
486
+ const { sourceLanguage: r } = await me(e);
487
+ if (!r)
488
+ throw new Error('The xcstrings file is missing "sourceLanguage".');
489
+ const i = await He(n);
490
+ if (i?.xcodeprojPaths && i.xcodeprojPaths.length > 0) {
491
+ const l = /* @__PURE__ */ new Set();
492
+ l.add(r);
493
+ for (const a of i.xcodeprojPaths)
494
+ Wr(a).forEach((c) => l.add(c));
495
+ return Array.from(l).sort();
496
+ }
497
+ const t = await qr(e), o = new Set(t);
498
+ return o.add(r), Array.from(o).sort();
499
+ }
500
+ function Mn(e) {
614
501
  return typeof e > "u" || e === null;
615
502
  }
616
- function Bi(e) {
503
+ function Gr(e) {
617
504
  return typeof e == "object" && e !== null;
618
505
  }
619
- function Yi(e) {
620
- return Array.isArray(e) ? e : Cn(e) ? [] : [e];
506
+ function Vr(e) {
507
+ return Array.isArray(e) ? e : Mn(e) ? [] : [e];
621
508
  }
622
- function zi(e, n) {
623
- var i, r, o, t;
509
+ function Xr(e, n) {
510
+ var r, i, t, o;
624
511
  if (n)
625
- for (t = Object.keys(n), i = 0, r = t.length; i < r; i += 1)
626
- o = t[i], e[o] = n[o];
512
+ for (o = Object.keys(n), r = 0, i = o.length; r < i; r += 1)
513
+ t = o[r], e[t] = n[t];
627
514
  return e;
628
515
  }
629
- function Hi(e, n) {
630
- var i = "", r;
631
- for (r = 0; r < n; r += 1)
632
- i += e;
633
- return i;
516
+ function Qr(e, n) {
517
+ var r = "", i;
518
+ for (i = 0; i < n; i += 1)
519
+ r += e;
520
+ return r;
634
521
  }
635
- function Ui(e) {
522
+ function Jr(e) {
636
523
  return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
637
524
  }
638
- var $i = Cn, Ki = Bi, Wi = Yi, Gi = Hi, qi = Ui, Vi = zi, F = {
639
- isNothing: $i,
640
- isObject: Ki,
641
- toArray: Wi,
642
- repeat: Gi,
643
- isNegativeZero: qi,
644
- extend: Vi
525
+ var Zr = Mn, ei = Gr, ni = Vr, ri = Qr, ii = Jr, ti = Xr, F = {
526
+ isNothing: Zr,
527
+ isObject: ei,
528
+ toArray: ni,
529
+ repeat: ri,
530
+ isNegativeZero: ii,
531
+ extend: ti
645
532
  };
646
- function _n(e, n) {
647
- var i = "", r = e.reason || "(unknown reason)";
648
- return e.mark ? (e.mark.name && (i += 'in "' + e.mark.name + '" '), i += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !n && e.mark.snippet && (i += `
533
+ function Pn(e, n) {
534
+ var r = "", i = e.reason || "(unknown reason)";
535
+ return e.mark ? (e.mark.name && (r += 'in "' + e.mark.name + '" '), r += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !n && e.mark.snippet && (r += `
649
536
 
650
- ` + e.mark.snippet), r + " " + i) : r;
537
+ ` + e.mark.snippet), i + " " + r) : i;
651
538
  }
652
- function ne(e, n) {
653
- Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = n, this.message = _n(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
539
+ function fe(e, n) {
540
+ Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = n, this.message = Pn(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
654
541
  }
655
- ne.prototype = Object.create(Error.prototype);
656
- ne.prototype.constructor = ne;
657
- ne.prototype.toString = function(n) {
658
- return this.name + ": " + _n(this, n);
542
+ fe.prototype = Object.create(Error.prototype);
543
+ fe.prototype.constructor = fe;
544
+ fe.prototype.toString = function(n) {
545
+ return this.name + ": " + Pn(this, n);
659
546
  };
660
- var I = ne;
661
- function Ee(e, n, i, r, o) {
662
- var t = "", l = "", a = Math.floor(o / 2) - 1;
663
- return r - n > a && (t = " ... ", n = r - a + t.length), i - r > a && (l = " ...", i = r + a - l.length), {
664
- str: t + e.slice(n, i).replace(/\t/g, "→") + l,
665
- pos: r - n + t.length
547
+ var I = fe;
548
+ function Ie(e, n, r, i, t) {
549
+ var o = "", l = "", a = Math.floor(t / 2) - 1;
550
+ return i - n > a && (o = " ... ", n = i - a + o.length), r - i > a && (l = " ...", r = i + a - l.length), {
551
+ str: o + e.slice(n, r).replace(/\t/g, "→") + l,
552
+ pos: i - n + o.length
666
553
  // relative position
667
554
  };
668
555
  }
669
- function Oe(e, n) {
556
+ function Ne(e, n) {
670
557
  return F.repeat(" ", n - e.length) + e;
671
558
  }
672
- function Xi(e, n) {
559
+ function oi(e, n) {
673
560
  if (n = Object.create(n || null), !e.buffer) return null;
674
561
  n.maxLength || (n.maxLength = 79), typeof n.indent != "number" && (n.indent = 1), typeof n.linesBefore != "number" && (n.linesBefore = 3), typeof n.linesAfter != "number" && (n.linesAfter = 2);
675
- for (var i = /\r?\n|\r|\0/g, r = [0], o = [], t, l = -1; t = i.exec(e.buffer); )
676
- o.push(t.index), r.push(t.index + t[0].length), e.position <= t.index && l < 0 && (l = r.length - 2);
677
- l < 0 && (l = r.length - 1);
678
- var a = "", c, u, s = Math.min(e.line + n.linesAfter, o.length).toString().length, p = n.maxLength - (n.indent + s + 3);
679
- for (c = 1; c <= n.linesBefore && !(l - c < 0); c++)
680
- u = Ee(
562
+ for (var r = /\r?\n|\r|\0/g, i = [0], t = [], o, l = -1; o = r.exec(e.buffer); )
563
+ t.push(o.index), i.push(o.index + o[0].length), e.position <= o.index && l < 0 && (l = i.length - 2);
564
+ l < 0 && (l = i.length - 1);
565
+ var a = "", s, c, u = Math.min(e.line + n.linesAfter, t.length).toString().length, f = n.maxLength - (n.indent + u + 3);
566
+ for (s = 1; s <= n.linesBefore && !(l - s < 0); s++)
567
+ c = Ie(
681
568
  e.buffer,
682
- r[l - c],
683
- o[l - c],
684
- e.position - (r[l] - r[l - c]),
685
- p
686
- ), a = F.repeat(" ", n.indent) + Oe((e.line - c + 1).toString(), s) + " | " + u.str + `
569
+ i[l - s],
570
+ t[l - s],
571
+ e.position - (i[l] - i[l - s]),
572
+ f
573
+ ), a = F.repeat(" ", n.indent) + Ne((e.line - s + 1).toString(), u) + " | " + c.str + `
687
574
  ` + a;
688
- for (u = Ee(e.buffer, r[l], o[l], e.position, p), a += F.repeat(" ", n.indent) + Oe((e.line + 1).toString(), s) + " | " + u.str + `
689
- `, a += F.repeat("-", n.indent + s + 3 + u.pos) + `^
690
- `, c = 1; c <= n.linesAfter && !(l + c >= o.length); c++)
691
- u = Ee(
575
+ for (c = Ie(e.buffer, i[l], t[l], e.position, f), a += F.repeat(" ", n.indent) + Ne((e.line + 1).toString(), u) + " | " + c.str + `
576
+ `, a += F.repeat("-", n.indent + u + 3 + c.pos) + `^
577
+ `, s = 1; s <= n.linesAfter && !(l + s >= t.length); s++)
578
+ c = Ie(
692
579
  e.buffer,
693
- r[l + c],
694
- o[l + c],
695
- e.position - (r[l] - r[l + c]),
696
- p
697
- ), a += F.repeat(" ", n.indent) + Oe((e.line + c + 1).toString(), s) + " | " + u.str + `
580
+ i[l + s],
581
+ t[l + s],
582
+ e.position - (i[l] - i[l + s]),
583
+ f
584
+ ), a += F.repeat(" ", n.indent) + Ne((e.line + s + 1).toString(), u) + " | " + c.str + `
698
585
  `;
699
586
  return a.replace(/\n$/, "");
700
587
  }
701
- var Qi = Xi, Ji = [
588
+ var li = oi, ai = [
702
589
  "kind",
703
590
  "multi",
704
591
  "resolve",
@@ -709,41 +596,41 @@ var Qi = Xi, Ji = [
709
596
  "representName",
710
597
  "defaultStyle",
711
598
  "styleAliases"
712
- ], Zi = [
599
+ ], si = [
713
600
  "scalar",
714
601
  "sequence",
715
602
  "mapping"
716
603
  ];
717
- function er(e) {
604
+ function ci(e) {
718
605
  var n = {};
719
- return e !== null && Object.keys(e).forEach(function(i) {
720
- e[i].forEach(function(r) {
721
- n[String(r)] = i;
606
+ return e !== null && Object.keys(e).forEach(function(r) {
607
+ e[r].forEach(function(i) {
608
+ n[String(i)] = r;
722
609
  });
723
610
  }), n;
724
611
  }
725
- function nr(e, n) {
726
- if (n = n || {}, Object.keys(n).forEach(function(i) {
727
- if (Ji.indexOf(i) === -1)
728
- throw new I('Unknown option "' + i + '" is met in definition of "' + e + '" YAML type.');
612
+ function ui(e, n) {
613
+ if (n = n || {}, Object.keys(n).forEach(function(r) {
614
+ if (ai.indexOf(r) === -1)
615
+ throw new I('Unknown option "' + r + '" is met in definition of "' + e + '" YAML type.');
729
616
  }), this.options = n, this.tag = e, this.kind = n.kind || null, this.resolve = n.resolve || function() {
730
617
  return !0;
731
- }, this.construct = n.construct || function(i) {
732
- return i;
733
- }, this.instanceOf = n.instanceOf || null, this.predicate = n.predicate || null, this.represent = n.represent || null, this.representName = n.representName || null, this.defaultStyle = n.defaultStyle || null, this.multi = n.multi || !1, this.styleAliases = er(n.styleAliases || null), Zi.indexOf(this.kind) === -1)
618
+ }, this.construct = n.construct || function(r) {
619
+ return r;
620
+ }, this.instanceOf = n.instanceOf || null, this.predicate = n.predicate || null, this.represent = n.represent || null, this.representName = n.representName || null, this.defaultStyle = n.defaultStyle || null, this.multi = n.multi || !1, this.styleAliases = ci(n.styleAliases || null), si.indexOf(this.kind) === -1)
734
621
  throw new I('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
735
622
  }
736
- var k = nr;
737
- function en(e, n) {
738
- var i = [];
739
- return e[n].forEach(function(r) {
740
- var o = i.length;
741
- i.forEach(function(t, l) {
742
- t.tag === r.tag && t.kind === r.kind && t.multi === r.multi && (o = l);
743
- }), i[o] = r;
744
- }), i;
745
- }
746
- function ir() {
623
+ var T = ui;
624
+ function un(e, n) {
625
+ var r = [];
626
+ return e[n].forEach(function(i) {
627
+ var t = r.length;
628
+ r.forEach(function(o, l) {
629
+ o.tag === i.tag && o.kind === i.kind && o.multi === i.multi && (t = l);
630
+ }), r[t] = i;
631
+ }), r;
632
+ }
633
+ function fi() {
747
634
  var e = {
748
635
  scalar: {},
749
636
  sequence: {},
@@ -755,79 +642,79 @@ function ir() {
755
642
  mapping: [],
756
643
  fallback: []
757
644
  }
758
- }, n, i;
759
- function r(o) {
760
- o.multi ? (e.multi[o.kind].push(o), e.multi.fallback.push(o)) : e[o.kind][o.tag] = e.fallback[o.tag] = o;
645
+ }, n, r;
646
+ function i(t) {
647
+ t.multi ? (e.multi[t.kind].push(t), e.multi.fallback.push(t)) : e[t.kind][t.tag] = e.fallback[t.tag] = t;
761
648
  }
762
- for (n = 0, i = arguments.length; n < i; n += 1)
763
- arguments[n].forEach(r);
649
+ for (n = 0, r = arguments.length; n < r; n += 1)
650
+ arguments[n].forEach(i);
764
651
  return e;
765
652
  }
766
- function ke(e) {
653
+ function Be(e) {
767
654
  return this.extend(e);
768
655
  }
769
- ke.prototype.extend = function(n) {
770
- var i = [], r = [];
771
- if (n instanceof k)
772
- r.push(n);
656
+ Be.prototype.extend = function(n) {
657
+ var r = [], i = [];
658
+ if (n instanceof T)
659
+ i.push(n);
773
660
  else if (Array.isArray(n))
774
- r = r.concat(n);
661
+ i = i.concat(n);
775
662
  else if (n && (Array.isArray(n.implicit) || Array.isArray(n.explicit)))
776
- n.implicit && (i = i.concat(n.implicit)), n.explicit && (r = r.concat(n.explicit));
663
+ n.implicit && (r = r.concat(n.implicit)), n.explicit && (i = i.concat(n.explicit));
777
664
  else
778
665
  throw new I("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
779
- i.forEach(function(t) {
780
- if (!(t instanceof k))
666
+ r.forEach(function(o) {
667
+ if (!(o instanceof T))
781
668
  throw new I("Specified list of YAML types (or a single Type object) contains a non-Type object.");
782
- if (t.loadKind && t.loadKind !== "scalar")
669
+ if (o.loadKind && o.loadKind !== "scalar")
783
670
  throw new I("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
784
- if (t.multi)
671
+ if (o.multi)
785
672
  throw new I("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
786
- }), r.forEach(function(t) {
787
- if (!(t instanceof k))
673
+ }), i.forEach(function(o) {
674
+ if (!(o instanceof T))
788
675
  throw new I("Specified list of YAML types (or a single Type object) contains a non-Type object.");
789
676
  });
790
- var o = Object.create(ke.prototype);
791
- return o.implicit = (this.implicit || []).concat(i), o.explicit = (this.explicit || []).concat(r), o.compiledImplicit = en(o, "implicit"), o.compiledExplicit = en(o, "explicit"), o.compiledTypeMap = ir(o.compiledImplicit, o.compiledExplicit), o;
677
+ var t = Object.create(Be.prototype);
678
+ return t.implicit = (this.implicit || []).concat(r), t.explicit = (this.explicit || []).concat(i), t.compiledImplicit = un(t, "implicit"), t.compiledExplicit = un(t, "explicit"), t.compiledTypeMap = fi(t.compiledImplicit, t.compiledExplicit), t;
792
679
  };
793
- var Sn = ke, En = new k("tag:yaml.org,2002:str", {
680
+ var Dn = Be, Bn = new T("tag:yaml.org,2002:str", {
794
681
  kind: "scalar",
795
682
  construct: function(e) {
796
683
  return e !== null ? e : "";
797
684
  }
798
- }), On = new k("tag:yaml.org,2002:seq", {
685
+ }), $n = new T("tag:yaml.org,2002:seq", {
799
686
  kind: "sequence",
800
687
  construct: function(e) {
801
688
  return e !== null ? e : [];
802
689
  }
803
- }), Fn = new k("tag:yaml.org,2002:map", {
690
+ }), Un = new T("tag:yaml.org,2002:map", {
804
691
  kind: "mapping",
805
692
  construct: function(e) {
806
693
  return e !== null ? e : {};
807
694
  }
808
- }), Ln = new Sn({
695
+ }), zn = new Dn({
809
696
  explicit: [
810
- En,
811
- On,
812
- Fn
697
+ Bn,
698
+ $n,
699
+ Un
813
700
  ]
814
701
  });
815
- function rr(e) {
702
+ function pi(e) {
816
703
  if (e === null) return !0;
817
704
  var n = e.length;
818
705
  return n === 1 && e === "~" || n === 4 && (e === "null" || e === "Null" || e === "NULL");
819
706
  }
820
- function or() {
707
+ function di() {
821
708
  return null;
822
709
  }
823
- function lr(e) {
710
+ function hi(e) {
824
711
  return e === null;
825
712
  }
826
- var kn = new k("tag:yaml.org,2002:null", {
713
+ var Yn = new T("tag:yaml.org,2002:null", {
827
714
  kind: "scalar",
828
- resolve: rr,
829
- construct: or,
830
- predicate: lr,
715
+ resolve: pi,
716
+ construct: di,
717
+ predicate: hi,
831
718
  represent: {
832
719
  canonical: function() {
833
720
  return "~";
@@ -847,22 +734,22 @@ var kn = new k("tag:yaml.org,2002:null", {
847
734
  },
848
735
  defaultStyle: "lowercase"
849
736
  });
850
- function tr(e) {
737
+ function gi(e) {
851
738
  if (e === null) return !1;
852
739
  var n = e.length;
853
740
  return n === 4 && (e === "true" || e === "True" || e === "TRUE") || n === 5 && (e === "false" || e === "False" || e === "FALSE");
854
741
  }
855
- function ar(e) {
742
+ function mi(e) {
856
743
  return e === "true" || e === "True" || e === "TRUE";
857
744
  }
858
- function cr(e) {
745
+ function yi(e) {
859
746
  return Object.prototype.toString.call(e) === "[object Boolean]";
860
747
  }
861
- var Tn = new k("tag:yaml.org,2002:bool", {
748
+ var Hn = new T("tag:yaml.org,2002:bool", {
862
749
  kind: "scalar",
863
- resolve: tr,
864
- construct: ar,
865
- predicate: cr,
750
+ resolve: gi,
751
+ construct: mi,
752
+ predicate: yi,
866
753
  represent: {
867
754
  lowercase: function(e) {
868
755
  return e ? "true" : "false";
@@ -876,73 +763,73 @@ var Tn = new k("tag:yaml.org,2002:bool", {
876
763
  },
877
764
  defaultStyle: "lowercase"
878
765
  });
879
- function ur(e) {
766
+ function vi(e) {
880
767
  return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
881
768
  }
882
- function fr(e) {
769
+ function xi(e) {
883
770
  return 48 <= e && e <= 55;
884
771
  }
885
- function sr(e) {
772
+ function wi(e) {
886
773
  return 48 <= e && e <= 57;
887
774
  }
888
- function pr(e) {
775
+ function bi(e) {
889
776
  if (e === null) return !1;
890
- var n = e.length, i = 0, r = !1, o;
777
+ var n = e.length, r = 0, i = !1, t;
891
778
  if (!n) return !1;
892
- if (o = e[i], (o === "-" || o === "+") && (o = e[++i]), o === "0") {
893
- if (i + 1 === n) return !0;
894
- if (o = e[++i], o === "b") {
895
- for (i++; i < n; i++)
896
- if (o = e[i], o !== "_") {
897
- if (o !== "0" && o !== "1") return !1;
898
- r = !0;
779
+ if (t = e[r], (t === "-" || t === "+") && (t = e[++r]), t === "0") {
780
+ if (r + 1 === n) return !0;
781
+ if (t = e[++r], t === "b") {
782
+ for (r++; r < n; r++)
783
+ if (t = e[r], t !== "_") {
784
+ if (t !== "0" && t !== "1") return !1;
785
+ i = !0;
899
786
  }
900
- return r && o !== "_";
787
+ return i && t !== "_";
901
788
  }
902
- if (o === "x") {
903
- for (i++; i < n; i++)
904
- if (o = e[i], o !== "_") {
905
- if (!ur(e.charCodeAt(i))) return !1;
906
- r = !0;
789
+ if (t === "x") {
790
+ for (r++; r < n; r++)
791
+ if (t = e[r], t !== "_") {
792
+ if (!vi(e.charCodeAt(r))) return !1;
793
+ i = !0;
907
794
  }
908
- return r && o !== "_";
795
+ return i && t !== "_";
909
796
  }
910
- if (o === "o") {
911
- for (i++; i < n; i++)
912
- if (o = e[i], o !== "_") {
913
- if (!fr(e.charCodeAt(i))) return !1;
914
- r = !0;
797
+ if (t === "o") {
798
+ for (r++; r < n; r++)
799
+ if (t = e[r], t !== "_") {
800
+ if (!xi(e.charCodeAt(r))) return !1;
801
+ i = !0;
915
802
  }
916
- return r && o !== "_";
803
+ return i && t !== "_";
917
804
  }
918
805
  }
919
- if (o === "_") return !1;
920
- for (; i < n; i++)
921
- if (o = e[i], o !== "_") {
922
- if (!sr(e.charCodeAt(i)))
806
+ if (t === "_") return !1;
807
+ for (; r < n; r++)
808
+ if (t = e[r], t !== "_") {
809
+ if (!wi(e.charCodeAt(r)))
923
810
  return !1;
924
- r = !0;
811
+ i = !0;
925
812
  }
926
- return !(!r || o === "_");
813
+ return !(!i || t === "_");
927
814
  }
928
- function dr(e) {
929
- var n = e, i = 1, r;
930
- if (n.indexOf("_") !== -1 && (n = n.replace(/_/g, "")), r = n[0], (r === "-" || r === "+") && (r === "-" && (i = -1), n = n.slice(1), r = n[0]), n === "0") return 0;
931
- if (r === "0") {
932
- if (n[1] === "b") return i * parseInt(n.slice(2), 2);
933
- if (n[1] === "x") return i * parseInt(n.slice(2), 16);
934
- if (n[1] === "o") return i * parseInt(n.slice(2), 8);
815
+ function Ai(e) {
816
+ var n = e, r = 1, i;
817
+ if (n.indexOf("_") !== -1 && (n = n.replace(/_/g, "")), i = n[0], (i === "-" || i === "+") && (i === "-" && (r = -1), n = n.slice(1), i = n[0]), n === "0") return 0;
818
+ if (i === "0") {
819
+ if (n[1] === "b") return r * parseInt(n.slice(2), 2);
820
+ if (n[1] === "x") return r * parseInt(n.slice(2), 16);
821
+ if (n[1] === "o") return r * parseInt(n.slice(2), 8);
935
822
  }
936
- return i * parseInt(n, 10);
823
+ return r * parseInt(n, 10);
937
824
  }
938
- function hr(e) {
825
+ function Ci(e) {
939
826
  return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !F.isNegativeZero(e);
940
827
  }
941
- var jn = new k("tag:yaml.org,2002:int", {
828
+ var Kn = new T("tag:yaml.org,2002:int", {
942
829
  kind: "scalar",
943
- resolve: pr,
944
- construct: dr,
945
- predicate: hr,
830
+ resolve: bi,
831
+ construct: Ai,
832
+ predicate: Ci,
946
833
  represent: {
947
834
  binary: function(e) {
948
835
  return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
@@ -965,22 +852,22 @@ var jn = new k("tag:yaml.org,2002:int", {
965
852
  decimal: [10, "dec"],
966
853
  hexadecimal: [16, "hex"]
967
854
  }
968
- }), gr = new RegExp(
855
+ }), ki = new RegExp(
969
856
  // 2.5e4, 2.5 and integers
970
857
  "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
971
858
  );
972
- function mr(e) {
973
- return !(e === null || !gr.test(e) || // Quick hack to not allow integers end with `_`
859
+ function Ei(e) {
860
+ return !(e === null || !ki.test(e) || // Quick hack to not allow integers end with `_`
974
861
  // Probably should update regexp & check speed
975
862
  e[e.length - 1] === "_");
976
863
  }
977
- function xr(e) {
978
- var n, i;
979
- return n = e.replace(/_/g, "").toLowerCase(), i = n[0] === "-" ? -1 : 1, "+-".indexOf(n[0]) >= 0 && (n = n.slice(1)), n === ".inf" ? i === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : n === ".nan" ? NaN : i * parseFloat(n, 10);
864
+ function Si(e) {
865
+ var n, r;
866
+ return n = e.replace(/_/g, "").toLowerCase(), r = n[0] === "-" ? -1 : 1, "+-".indexOf(n[0]) >= 0 && (n = n.slice(1)), n === ".inf" ? r === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : n === ".nan" ? NaN : r * parseFloat(n, 10);
980
867
  }
981
- var vr = /^[-+]?[0-9]+e/;
982
- function yr(e, n) {
983
- var i;
868
+ var _i = /^[-+]?[0-9]+e/;
869
+ function Oi(e, n) {
870
+ var r;
984
871
  if (isNaN(e))
985
872
  switch (n) {
986
873
  case "lowercase":
@@ -1010,217 +897,217 @@ function yr(e, n) {
1010
897
  }
1011
898
  else if (F.isNegativeZero(e))
1012
899
  return "-0.0";
1013
- return i = e.toString(10), vr.test(i) ? i.replace("e", ".e") : i;
900
+ return r = e.toString(10), _i.test(r) ? r.replace("e", ".e") : r;
1014
901
  }
1015
- function wr(e) {
902
+ function Fi(e) {
1016
903
  return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || F.isNegativeZero(e));
1017
904
  }
1018
- var In = new k("tag:yaml.org,2002:float", {
905
+ var Wn = new T("tag:yaml.org,2002:float", {
1019
906
  kind: "scalar",
1020
- resolve: mr,
1021
- construct: xr,
1022
- predicate: wr,
1023
- represent: yr,
907
+ resolve: Ei,
908
+ construct: Si,
909
+ predicate: Fi,
910
+ represent: Oi,
1024
911
  defaultStyle: "lowercase"
1025
- }), Nn = Ln.extend({
912
+ }), qn = zn.extend({
1026
913
  implicit: [
1027
- kn,
1028
- Tn,
1029
- jn,
1030
- In
914
+ Yn,
915
+ Hn,
916
+ Kn,
917
+ Wn
1031
918
  ]
1032
- }), Rn = Nn, Mn = new RegExp(
919
+ }), Gn = qn, Vn = new RegExp(
1033
920
  "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
1034
- ), Dn = new RegExp(
921
+ ), Xn = new RegExp(
1035
922
  "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
1036
923
  );
1037
- function Ar(e) {
1038
- return e === null ? !1 : Mn.exec(e) !== null || Dn.exec(e) !== null;
1039
- }
1040
- function br(e) {
1041
- var n, i, r, o, t, l, a, c = 0, u = null, s, p, h;
1042
- if (n = Mn.exec(e), n === null && (n = Dn.exec(e)), n === null) throw new Error("Date resolve error");
1043
- if (i = +n[1], r = +n[2] - 1, o = +n[3], !n[4])
1044
- return new Date(Date.UTC(i, r, o));
1045
- if (t = +n[4], l = +n[5], a = +n[6], n[7]) {
1046
- for (c = n[7].slice(0, 3); c.length < 3; )
1047
- c += "0";
1048
- c = +c;
1049
- }
1050
- return n[9] && (s = +n[10], p = +(n[11] || 0), u = (s * 60 + p) * 6e4, n[9] === "-" && (u = -u)), h = new Date(Date.UTC(i, r, o, t, l, a, c)), u && h.setTime(h.getTime() - u), h;
1051
- }
1052
- function Cr(e) {
924
+ function Ti(e) {
925
+ return e === null ? !1 : Vn.exec(e) !== null || Xn.exec(e) !== null;
926
+ }
927
+ function Li(e) {
928
+ var n, r, i, t, o, l, a, s = 0, c = null, u, f, h;
929
+ if (n = Vn.exec(e), n === null && (n = Xn.exec(e)), n === null) throw new Error("Date resolve error");
930
+ if (r = +n[1], i = +n[2] - 1, t = +n[3], !n[4])
931
+ return new Date(Date.UTC(r, i, t));
932
+ if (o = +n[4], l = +n[5], a = +n[6], n[7]) {
933
+ for (s = n[7].slice(0, 3); s.length < 3; )
934
+ s += "0";
935
+ s = +s;
936
+ }
937
+ return n[9] && (u = +n[10], f = +(n[11] || 0), c = (u * 60 + f) * 6e4, n[9] === "-" && (c = -c)), h = new Date(Date.UTC(r, i, t, o, l, a, s)), c && h.setTime(h.getTime() - c), h;
938
+ }
939
+ function ji(e) {
1053
940
  return e.toISOString();
1054
941
  }
1055
- var Pn = new k("tag:yaml.org,2002:timestamp", {
942
+ var Qn = new T("tag:yaml.org,2002:timestamp", {
1056
943
  kind: "scalar",
1057
- resolve: Ar,
1058
- construct: br,
944
+ resolve: Ti,
945
+ construct: Li,
1059
946
  instanceOf: Date,
1060
- represent: Cr
947
+ represent: ji
1061
948
  });
1062
- function _r(e) {
949
+ function Ii(e) {
1063
950
  return e === "<<" || e === null;
1064
951
  }
1065
- var Bn = new k("tag:yaml.org,2002:merge", {
952
+ var Jn = new T("tag:yaml.org,2002:merge", {
1066
953
  kind: "scalar",
1067
- resolve: _r
1068
- }), Me = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
954
+ resolve: Ii
955
+ }), Ke = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
1069
956
  \r`;
1070
- function Sr(e) {
957
+ function Ni(e) {
1071
958
  if (e === null) return !1;
1072
- var n, i, r = 0, o = e.length, t = Me;
1073
- for (i = 0; i < o; i++)
1074
- if (n = t.indexOf(e.charAt(i)), !(n > 64)) {
959
+ var n, r, i = 0, t = e.length, o = Ke;
960
+ for (r = 0; r < t; r++)
961
+ if (n = o.indexOf(e.charAt(r)), !(n > 64)) {
1075
962
  if (n < 0) return !1;
1076
- r += 6;
963
+ i += 6;
1077
964
  }
1078
- return r % 8 === 0;
965
+ return i % 8 === 0;
1079
966
  }
1080
- function Er(e) {
1081
- var n, i, r = e.replace(/[\r\n=]/g, ""), o = r.length, t = Me, l = 0, a = [];
1082
- for (n = 0; n < o; n++)
1083
- n % 4 === 0 && n && (a.push(l >> 16 & 255), a.push(l >> 8 & 255), a.push(l & 255)), l = l << 6 | t.indexOf(r.charAt(n));
1084
- return i = o % 4 * 6, i === 0 ? (a.push(l >> 16 & 255), a.push(l >> 8 & 255), a.push(l & 255)) : i === 18 ? (a.push(l >> 10 & 255), a.push(l >> 2 & 255)) : i === 12 && a.push(l >> 4 & 255), new Uint8Array(a);
967
+ function Ri(e) {
968
+ var n, r, i = e.replace(/[\r\n=]/g, ""), t = i.length, o = Ke, l = 0, a = [];
969
+ for (n = 0; n < t; n++)
970
+ n % 4 === 0 && n && (a.push(l >> 16 & 255), a.push(l >> 8 & 255), a.push(l & 255)), l = l << 6 | o.indexOf(i.charAt(n));
971
+ return r = t % 4 * 6, r === 0 ? (a.push(l >> 16 & 255), a.push(l >> 8 & 255), a.push(l & 255)) : r === 18 ? (a.push(l >> 10 & 255), a.push(l >> 2 & 255)) : r === 12 && a.push(l >> 4 & 255), new Uint8Array(a);
1085
972
  }
1086
- function Or(e) {
1087
- var n = "", i = 0, r, o, t = e.length, l = Me;
1088
- for (r = 0; r < t; r++)
1089
- r % 3 === 0 && r && (n += l[i >> 18 & 63], n += l[i >> 12 & 63], n += l[i >> 6 & 63], n += l[i & 63]), i = (i << 8) + e[r];
1090
- return o = t % 3, o === 0 ? (n += l[i >> 18 & 63], n += l[i >> 12 & 63], n += l[i >> 6 & 63], n += l[i & 63]) : o === 2 ? (n += l[i >> 10 & 63], n += l[i >> 4 & 63], n += l[i << 2 & 63], n += l[64]) : o === 1 && (n += l[i >> 2 & 63], n += l[i << 4 & 63], n += l[64], n += l[64]), n;
973
+ function Mi(e) {
974
+ var n = "", r = 0, i, t, o = e.length, l = Ke;
975
+ for (i = 0; i < o; i++)
976
+ i % 3 === 0 && i && (n += l[r >> 18 & 63], n += l[r >> 12 & 63], n += l[r >> 6 & 63], n += l[r & 63]), r = (r << 8) + e[i];
977
+ return t = o % 3, t === 0 ? (n += l[r >> 18 & 63], n += l[r >> 12 & 63], n += l[r >> 6 & 63], n += l[r & 63]) : t === 2 ? (n += l[r >> 10 & 63], n += l[r >> 4 & 63], n += l[r << 2 & 63], n += l[64]) : t === 1 && (n += l[r >> 2 & 63], n += l[r << 4 & 63], n += l[64], n += l[64]), n;
1091
978
  }
1092
- function Fr(e) {
979
+ function Pi(e) {
1093
980
  return Object.prototype.toString.call(e) === "[object Uint8Array]";
1094
981
  }
1095
- var Yn = new k("tag:yaml.org,2002:binary", {
982
+ var Zn = new T("tag:yaml.org,2002:binary", {
1096
983
  kind: "scalar",
1097
- resolve: Sr,
1098
- construct: Er,
1099
- predicate: Fr,
1100
- represent: Or
1101
- }), Lr = Object.prototype.hasOwnProperty, kr = Object.prototype.toString;
1102
- function Tr(e) {
984
+ resolve: Ni,
985
+ construct: Ri,
986
+ predicate: Pi,
987
+ represent: Mi
988
+ }), Di = Object.prototype.hasOwnProperty, Bi = Object.prototype.toString;
989
+ function $i(e) {
1103
990
  if (e === null) return !0;
1104
- var n = [], i, r, o, t, l, a = e;
1105
- for (i = 0, r = a.length; i < r; i += 1) {
1106
- if (o = a[i], l = !1, kr.call(o) !== "[object Object]") return !1;
1107
- for (t in o)
1108
- if (Lr.call(o, t))
991
+ var n = [], r, i, t, o, l, a = e;
992
+ for (r = 0, i = a.length; r < i; r += 1) {
993
+ if (t = a[r], l = !1, Bi.call(t) !== "[object Object]") return !1;
994
+ for (o in t)
995
+ if (Di.call(t, o))
1109
996
  if (!l) l = !0;
1110
997
  else return !1;
1111
998
  if (!l) return !1;
1112
- if (n.indexOf(t) === -1) n.push(t);
999
+ if (n.indexOf(o) === -1) n.push(o);
1113
1000
  else return !1;
1114
1001
  }
1115
1002
  return !0;
1116
1003
  }
1117
- function jr(e) {
1004
+ function Ui(e) {
1118
1005
  return e !== null ? e : [];
1119
1006
  }
1120
- var zn = new k("tag:yaml.org,2002:omap", {
1007
+ var er = new T("tag:yaml.org,2002:omap", {
1121
1008
  kind: "sequence",
1122
- resolve: Tr,
1123
- construct: jr
1124
- }), Ir = Object.prototype.toString;
1125
- function Nr(e) {
1009
+ resolve: $i,
1010
+ construct: Ui
1011
+ }), zi = Object.prototype.toString;
1012
+ function Yi(e) {
1126
1013
  if (e === null) return !0;
1127
- var n, i, r, o, t, l = e;
1128
- for (t = new Array(l.length), n = 0, i = l.length; n < i; n += 1) {
1129
- if (r = l[n], Ir.call(r) !== "[object Object]" || (o = Object.keys(r), o.length !== 1)) return !1;
1130
- t[n] = [o[0], r[o[0]]];
1014
+ var n, r, i, t, o, l = e;
1015
+ for (o = new Array(l.length), n = 0, r = l.length; n < r; n += 1) {
1016
+ if (i = l[n], zi.call(i) !== "[object Object]" || (t = Object.keys(i), t.length !== 1)) return !1;
1017
+ o[n] = [t[0], i[t[0]]];
1131
1018
  }
1132
1019
  return !0;
1133
1020
  }
1134
- function Rr(e) {
1021
+ function Hi(e) {
1135
1022
  if (e === null) return [];
1136
- var n, i, r, o, t, l = e;
1137
- for (t = new Array(l.length), n = 0, i = l.length; n < i; n += 1)
1138
- r = l[n], o = Object.keys(r), t[n] = [o[0], r[o[0]]];
1139
- return t;
1023
+ var n, r, i, t, o, l = e;
1024
+ for (o = new Array(l.length), n = 0, r = l.length; n < r; n += 1)
1025
+ i = l[n], t = Object.keys(i), o[n] = [t[0], i[t[0]]];
1026
+ return o;
1140
1027
  }
1141
- var Hn = new k("tag:yaml.org,2002:pairs", {
1028
+ var nr = new T("tag:yaml.org,2002:pairs", {
1142
1029
  kind: "sequence",
1143
- resolve: Nr,
1144
- construct: Rr
1145
- }), Mr = Object.prototype.hasOwnProperty;
1146
- function Dr(e) {
1030
+ resolve: Yi,
1031
+ construct: Hi
1032
+ }), Ki = Object.prototype.hasOwnProperty;
1033
+ function Wi(e) {
1147
1034
  if (e === null) return !0;
1148
- var n, i = e;
1149
- for (n in i)
1150
- if (Mr.call(i, n) && i[n] !== null)
1035
+ var n, r = e;
1036
+ for (n in r)
1037
+ if (Ki.call(r, n) && r[n] !== null)
1151
1038
  return !1;
1152
1039
  return !0;
1153
1040
  }
1154
- function Pr(e) {
1041
+ function qi(e) {
1155
1042
  return e !== null ? e : {};
1156
1043
  }
1157
- var Un = new k("tag:yaml.org,2002:set", {
1044
+ var rr = new T("tag:yaml.org,2002:set", {
1158
1045
  kind: "mapping",
1159
- resolve: Dr,
1160
- construct: Pr
1161
- }), De = Rn.extend({
1046
+ resolve: Wi,
1047
+ construct: qi
1048
+ }), We = Gn.extend({
1162
1049
  implicit: [
1163
- Pn,
1164
- Bn
1050
+ Qn,
1051
+ Jn
1165
1052
  ],
1166
1053
  explicit: [
1167
- Yn,
1168
- zn,
1169
- Hn,
1170
- Un
1054
+ Zn,
1055
+ er,
1056
+ nr,
1057
+ rr
1171
1058
  ]
1172
- }), H = Object.prototype.hasOwnProperty, pe = 1, $n = 2, Kn = 3, de = 4, Fe = 1, Br = 2, nn = 3, Yr = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, zr = /[\x85\u2028\u2029]/, Hr = /[,\[\]\{\}]/, Wn = /^(?:!|!!|![a-z\-]+!)$/i, Gn = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
1173
- function rn(e) {
1059
+ }), G = Object.prototype.hasOwnProperty, Ce = 1, ir = 2, tr = 3, ke = 4, Re = 1, Gi = 2, fn = 3, Vi = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Xi = /[\x85\u2028\u2029]/, Qi = /[,\[\]\{\}]/, or = /^(?:!|!!|![a-z\-]+!)$/i, lr = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
1060
+ function pn(e) {
1174
1061
  return Object.prototype.toString.call(e);
1175
1062
  }
1176
- function P(e) {
1063
+ function z(e) {
1177
1064
  return e === 10 || e === 13;
1178
1065
  }
1179
- function U(e) {
1066
+ function X(e) {
1180
1067
  return e === 9 || e === 32;
1181
1068
  }
1182
- function M(e) {
1069
+ function D(e) {
1183
1070
  return e === 9 || e === 32 || e === 10 || e === 13;
1184
1071
  }
1185
- function V(e) {
1072
+ function re(e) {
1186
1073
  return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
1187
1074
  }
1188
- function Ur(e) {
1075
+ function Ji(e) {
1189
1076
  var n;
1190
1077
  return 48 <= e && e <= 57 ? e - 48 : (n = e | 32, 97 <= n && n <= 102 ? n - 97 + 10 : -1);
1191
1078
  }
1192
- function $r(e) {
1079
+ function Zi(e) {
1193
1080
  return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
1194
1081
  }
1195
- function Kr(e) {
1082
+ function et(e) {
1196
1083
  return 48 <= e && e <= 57 ? e - 48 : -1;
1197
1084
  }
1198
- function on(e) {
1085
+ function dn(e) {
1199
1086
  return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
1200
1087
  ` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "…" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
1201
1088
  }
1202
- function Wr(e) {
1089
+ function nt(e) {
1203
1090
  return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode(
1204
1091
  (e - 65536 >> 10) + 55296,
1205
1092
  (e - 65536 & 1023) + 56320
1206
1093
  );
1207
1094
  }
1208
- function qn(e, n, i) {
1095
+ function ar(e, n, r) {
1209
1096
  n === "__proto__" ? Object.defineProperty(e, n, {
1210
1097
  configurable: !0,
1211
1098
  enumerable: !0,
1212
1099
  writable: !0,
1213
- value: i
1214
- }) : e[n] = i;
1100
+ value: r
1101
+ }) : e[n] = r;
1215
1102
  }
1216
- var Vn = new Array(256), Xn = new Array(256);
1217
- for (var G = 0; G < 256; G++)
1218
- Vn[G] = on(G) ? 1 : 0, Xn[G] = on(G);
1219
- function Gr(e, n) {
1220
- this.input = e, this.filename = n.filename || null, this.schema = n.schema || De, this.onWarning = n.onWarning || null, this.legacy = n.legacy || !1, this.json = n.json || !1, this.listener = n.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = [];
1103
+ var sr = new Array(256), cr = new Array(256);
1104
+ for (var ee = 0; ee < 256; ee++)
1105
+ sr[ee] = dn(ee) ? 1 : 0, cr[ee] = dn(ee);
1106
+ function rt(e, n) {
1107
+ this.input = e, this.filename = n.filename || null, this.schema = n.schema || We, this.onWarning = n.onWarning || null, this.legacy = n.legacy || !1, this.json = n.json || !1, this.listener = n.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = [];
1221
1108
  }
1222
- function Qn(e, n) {
1223
- var i = {
1109
+ function ur(e, n) {
1110
+ var r = {
1224
1111
  name: e.filename,
1225
1112
  buffer: e.input.slice(0, -1),
1226
1113
  // omit trailing \0
@@ -1228,395 +1115,395 @@ function Qn(e, n) {
1228
1115
  line: e.line,
1229
1116
  column: e.position - e.lineStart
1230
1117
  };
1231
- return i.snippet = Qi(i), new I(n, i);
1118
+ return r.snippet = li(r), new I(n, r);
1232
1119
  }
1233
- function x(e, n) {
1234
- throw Qn(e, n);
1120
+ function v(e, n) {
1121
+ throw ur(e, n);
1235
1122
  }
1236
- function he(e, n) {
1237
- e.onWarning && e.onWarning.call(null, Qn(e, n));
1123
+ function Ee(e, n) {
1124
+ e.onWarning && e.onWarning.call(null, ur(e, n));
1238
1125
  }
1239
- var ln = {
1240
- YAML: function(n, i, r) {
1241
- var o, t, l;
1242
- n.version !== null && x(n, "duplication of %YAML directive"), r.length !== 1 && x(n, "YAML directive accepts exactly one argument"), o = /^([0-9]+)\.([0-9]+)$/.exec(r[0]), o === null && x(n, "ill-formed argument of the YAML directive"), t = parseInt(o[1], 10), l = parseInt(o[2], 10), t !== 1 && x(n, "unacceptable YAML version of the document"), n.version = r[0], n.checkLineBreaks = l < 2, l !== 1 && l !== 2 && he(n, "unsupported YAML version of the document");
1126
+ var hn = {
1127
+ YAML: function(n, r, i) {
1128
+ var t, o, l;
1129
+ n.version !== null && v(n, "duplication of %YAML directive"), i.length !== 1 && v(n, "YAML directive accepts exactly one argument"), t = /^([0-9]+)\.([0-9]+)$/.exec(i[0]), t === null && v(n, "ill-formed argument of the YAML directive"), o = parseInt(t[1], 10), l = parseInt(t[2], 10), o !== 1 && v(n, "unacceptable YAML version of the document"), n.version = i[0], n.checkLineBreaks = l < 2, l !== 1 && l !== 2 && Ee(n, "unsupported YAML version of the document");
1243
1130
  },
1244
- TAG: function(n, i, r) {
1245
- var o, t;
1246
- r.length !== 2 && x(n, "TAG directive accepts exactly two arguments"), o = r[0], t = r[1], Wn.test(o) || x(n, "ill-formed tag handle (first argument) of the TAG directive"), H.call(n.tagMap, o) && x(n, 'there is a previously declared suffix for "' + o + '" tag handle'), Gn.test(t) || x(n, "ill-formed tag prefix (second argument) of the TAG directive");
1131
+ TAG: function(n, r, i) {
1132
+ var t, o;
1133
+ i.length !== 2 && v(n, "TAG directive accepts exactly two arguments"), t = i[0], o = i[1], or.test(t) || v(n, "ill-formed tag handle (first argument) of the TAG directive"), G.call(n.tagMap, t) && v(n, 'there is a previously declared suffix for "' + t + '" tag handle'), lr.test(o) || v(n, "ill-formed tag prefix (second argument) of the TAG directive");
1247
1134
  try {
1248
- t = decodeURIComponent(t);
1135
+ o = decodeURIComponent(o);
1249
1136
  } catch {
1250
- x(n, "tag prefix is malformed: " + t);
1137
+ v(n, "tag prefix is malformed: " + o);
1251
1138
  }
1252
- n.tagMap[o] = t;
1139
+ n.tagMap[t] = o;
1253
1140
  }
1254
1141
  };
1255
- function z(e, n, i, r) {
1256
- var o, t, l, a;
1257
- if (n < i) {
1258
- if (a = e.input.slice(n, i), r)
1259
- for (o = 0, t = a.length; o < t; o += 1)
1260
- l = a.charCodeAt(o), l === 9 || 32 <= l && l <= 1114111 || x(e, "expected valid JSON character");
1261
- else Yr.test(a) && x(e, "the stream contains non-printable characters");
1142
+ function q(e, n, r, i) {
1143
+ var t, o, l, a;
1144
+ if (n < r) {
1145
+ if (a = e.input.slice(n, r), i)
1146
+ for (t = 0, o = a.length; t < o; t += 1)
1147
+ l = a.charCodeAt(t), l === 9 || 32 <= l && l <= 1114111 || v(e, "expected valid JSON character");
1148
+ else Vi.test(a) && v(e, "the stream contains non-printable characters");
1262
1149
  e.result += a;
1263
1150
  }
1264
1151
  }
1265
- function tn(e, n, i, r) {
1266
- var o, t, l, a;
1267
- for (F.isObject(i) || x(e, "cannot merge mappings; the provided source object is unacceptable"), o = Object.keys(i), l = 0, a = o.length; l < a; l += 1)
1268
- t = o[l], H.call(n, t) || (qn(n, t, i[t]), r[t] = !0);
1269
- }
1270
- function X(e, n, i, r, o, t, l, a, c) {
1271
- var u, s;
1272
- if (Array.isArray(o))
1273
- for (o = Array.prototype.slice.call(o), u = 0, s = o.length; u < s; u += 1)
1274
- Array.isArray(o[u]) && x(e, "nested arrays are not supported inside keys"), typeof o == "object" && rn(o[u]) === "[object Object]" && (o[u] = "[object Object]");
1275
- if (typeof o == "object" && rn(o) === "[object Object]" && (o = "[object Object]"), o = String(o), n === null && (n = {}), r === "tag:yaml.org,2002:merge")
1276
- if (Array.isArray(t))
1277
- for (u = 0, s = t.length; u < s; u += 1)
1278
- tn(e, n, t[u], i);
1152
+ function gn(e, n, r, i) {
1153
+ var t, o, l, a;
1154
+ for (F.isObject(r) || v(e, "cannot merge mappings; the provided source object is unacceptable"), t = Object.keys(r), l = 0, a = t.length; l < a; l += 1)
1155
+ o = t[l], G.call(n, o) || (ar(n, o, r[o]), i[o] = !0);
1156
+ }
1157
+ function ie(e, n, r, i, t, o, l, a, s) {
1158
+ var c, u;
1159
+ if (Array.isArray(t))
1160
+ for (t = Array.prototype.slice.call(t), c = 0, u = t.length; c < u; c += 1)
1161
+ Array.isArray(t[c]) && v(e, "nested arrays are not supported inside keys"), typeof t == "object" && pn(t[c]) === "[object Object]" && (t[c] = "[object Object]");
1162
+ if (typeof t == "object" && pn(t) === "[object Object]" && (t = "[object Object]"), t = String(t), n === null && (n = {}), i === "tag:yaml.org,2002:merge")
1163
+ if (Array.isArray(o))
1164
+ for (c = 0, u = o.length; c < u; c += 1)
1165
+ gn(e, n, o[c], r);
1279
1166
  else
1280
- tn(e, n, t, i);
1167
+ gn(e, n, o, r);
1281
1168
  else
1282
- !e.json && !H.call(i, o) && H.call(n, o) && (e.line = l || e.line, e.lineStart = a || e.lineStart, e.position = c || e.position, x(e, "duplicated mapping key")), qn(n, o, t), delete i[o];
1169
+ !e.json && !G.call(r, t) && G.call(n, t) && (e.line = l || e.line, e.lineStart = a || e.lineStart, e.position = s || e.position, v(e, "duplicated mapping key")), ar(n, t, o), delete r[t];
1283
1170
  return n;
1284
1171
  }
1285
- function Pe(e) {
1172
+ function qe(e) {
1286
1173
  var n;
1287
- n = e.input.charCodeAt(e.position), n === 10 ? e.position++ : n === 13 ? (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++) : x(e, "a line break is expected"), e.line += 1, e.lineStart = e.position, e.firstTabInLine = -1;
1174
+ n = e.input.charCodeAt(e.position), n === 10 ? e.position++ : n === 13 ? (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++) : v(e, "a line break is expected"), e.line += 1, e.lineStart = e.position, e.firstTabInLine = -1;
1288
1175
  }
1289
- function O(e, n, i) {
1290
- for (var r = 0, o = e.input.charCodeAt(e.position); o !== 0; ) {
1291
- for (; U(o); )
1292
- o === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), o = e.input.charCodeAt(++e.position);
1293
- if (n && o === 35)
1176
+ function O(e, n, r) {
1177
+ for (var i = 0, t = e.input.charCodeAt(e.position); t !== 0; ) {
1178
+ for (; X(t); )
1179
+ t === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), t = e.input.charCodeAt(++e.position);
1180
+ if (n && t === 35)
1294
1181
  do
1295
- o = e.input.charCodeAt(++e.position);
1296
- while (o !== 10 && o !== 13 && o !== 0);
1297
- if (P(o))
1298
- for (Pe(e), o = e.input.charCodeAt(e.position), r++, e.lineIndent = 0; o === 32; )
1299
- e.lineIndent++, o = e.input.charCodeAt(++e.position);
1182
+ t = e.input.charCodeAt(++e.position);
1183
+ while (t !== 10 && t !== 13 && t !== 0);
1184
+ if (z(t))
1185
+ for (qe(e), t = e.input.charCodeAt(e.position), i++, e.lineIndent = 0; t === 32; )
1186
+ e.lineIndent++, t = e.input.charCodeAt(++e.position);
1300
1187
  else
1301
1188
  break;
1302
1189
  }
1303
- return i !== -1 && r !== 0 && e.lineIndent < i && he(e, "deficient indentation"), r;
1190
+ return r !== -1 && i !== 0 && e.lineIndent < r && Ee(e, "deficient indentation"), i;
1304
1191
  }
1305
- function ye(e) {
1306
- var n = e.position, i;
1307
- return i = e.input.charCodeAt(n), !!((i === 45 || i === 46) && i === e.input.charCodeAt(n + 1) && i === e.input.charCodeAt(n + 2) && (n += 3, i = e.input.charCodeAt(n), i === 0 || M(i)));
1192
+ function Fe(e) {
1193
+ var n = e.position, r;
1194
+ return r = e.input.charCodeAt(n), !!((r === 45 || r === 46) && r === e.input.charCodeAt(n + 1) && r === e.input.charCodeAt(n + 2) && (n += 3, r = e.input.charCodeAt(n), r === 0 || D(r)));
1308
1195
  }
1309
- function Be(e, n) {
1196
+ function Ge(e, n) {
1310
1197
  n === 1 ? e.result += " " : n > 1 && (e.result += F.repeat(`
1311
1198
  `, n - 1));
1312
1199
  }
1313
- function qr(e, n, i) {
1314
- var r, o, t, l, a, c, u, s, p = e.kind, h = e.result, d;
1315
- if (d = e.input.charCodeAt(e.position), M(d) || V(d) || d === 35 || d === 38 || d === 42 || d === 33 || d === 124 || d === 62 || d === 39 || d === 34 || d === 37 || d === 64 || d === 96 || (d === 63 || d === 45) && (o = e.input.charCodeAt(e.position + 1), M(o) || i && V(o)))
1200
+ function it(e, n, r) {
1201
+ var i, t, o, l, a, s, c, u, f = e.kind, h = e.result, d;
1202
+ if (d = e.input.charCodeAt(e.position), D(d) || re(d) || d === 35 || d === 38 || d === 42 || d === 33 || d === 124 || d === 62 || d === 39 || d === 34 || d === 37 || d === 64 || d === 96 || (d === 63 || d === 45) && (t = e.input.charCodeAt(e.position + 1), D(t) || r && re(t)))
1316
1203
  return !1;
1317
- for (e.kind = "scalar", e.result = "", t = l = e.position, a = !1; d !== 0; ) {
1204
+ for (e.kind = "scalar", e.result = "", o = l = e.position, a = !1; d !== 0; ) {
1318
1205
  if (d === 58) {
1319
- if (o = e.input.charCodeAt(e.position + 1), M(o) || i && V(o))
1206
+ if (t = e.input.charCodeAt(e.position + 1), D(t) || r && re(t))
1320
1207
  break;
1321
1208
  } else if (d === 35) {
1322
- if (r = e.input.charCodeAt(e.position - 1), M(r))
1209
+ if (i = e.input.charCodeAt(e.position - 1), D(i))
1323
1210
  break;
1324
1211
  } else {
1325
- if (e.position === e.lineStart && ye(e) || i && V(d))
1212
+ if (e.position === e.lineStart && Fe(e) || r && re(d))
1326
1213
  break;
1327
- if (P(d))
1328
- if (c = e.line, u = e.lineStart, s = e.lineIndent, O(e, !1, -1), e.lineIndent >= n) {
1214
+ if (z(d))
1215
+ if (s = e.line, c = e.lineStart, u = e.lineIndent, O(e, !1, -1), e.lineIndent >= n) {
1329
1216
  a = !0, d = e.input.charCodeAt(e.position);
1330
1217
  continue;
1331
1218
  } else {
1332
- e.position = l, e.line = c, e.lineStart = u, e.lineIndent = s;
1219
+ e.position = l, e.line = s, e.lineStart = c, e.lineIndent = u;
1333
1220
  break;
1334
1221
  }
1335
1222
  }
1336
- a && (z(e, t, l, !1), Be(e, e.line - c), t = l = e.position, a = !1), U(d) || (l = e.position + 1), d = e.input.charCodeAt(++e.position);
1223
+ a && (q(e, o, l, !1), Ge(e, e.line - s), o = l = e.position, a = !1), X(d) || (l = e.position + 1), d = e.input.charCodeAt(++e.position);
1337
1224
  }
1338
- return z(e, t, l, !1), e.result ? !0 : (e.kind = p, e.result = h, !1);
1225
+ return q(e, o, l, !1), e.result ? !0 : (e.kind = f, e.result = h, !1);
1339
1226
  }
1340
- function Vr(e, n) {
1341
- var i, r, o;
1342
- if (i = e.input.charCodeAt(e.position), i !== 39)
1227
+ function tt(e, n) {
1228
+ var r, i, t;
1229
+ if (r = e.input.charCodeAt(e.position), r !== 39)
1343
1230
  return !1;
1344
- for (e.kind = "scalar", e.result = "", e.position++, r = o = e.position; (i = e.input.charCodeAt(e.position)) !== 0; )
1345
- if (i === 39)
1346
- if (z(e, r, e.position, !0), i = e.input.charCodeAt(++e.position), i === 39)
1347
- r = e.position, e.position++, o = e.position;
1231
+ for (e.kind = "scalar", e.result = "", e.position++, i = t = e.position; (r = e.input.charCodeAt(e.position)) !== 0; )
1232
+ if (r === 39)
1233
+ if (q(e, i, e.position, !0), r = e.input.charCodeAt(++e.position), r === 39)
1234
+ i = e.position, e.position++, t = e.position;
1348
1235
  else
1349
1236
  return !0;
1350
- else P(i) ? (z(e, r, o, !0), Be(e, O(e, !1, n)), r = o = e.position) : e.position === e.lineStart && ye(e) ? x(e, "unexpected end of the document within a single quoted scalar") : (e.position++, o = e.position);
1351
- x(e, "unexpected end of the stream within a single quoted scalar");
1237
+ else z(r) ? (q(e, i, t, !0), Ge(e, O(e, !1, n)), i = t = e.position) : e.position === e.lineStart && Fe(e) ? v(e, "unexpected end of the document within a single quoted scalar") : (e.position++, t = e.position);
1238
+ v(e, "unexpected end of the stream within a single quoted scalar");
1352
1239
  }
1353
- function Xr(e, n) {
1354
- var i, r, o, t, l, a;
1240
+ function ot(e, n) {
1241
+ var r, i, t, o, l, a;
1355
1242
  if (a = e.input.charCodeAt(e.position), a !== 34)
1356
1243
  return !1;
1357
- for (e.kind = "scalar", e.result = "", e.position++, i = r = e.position; (a = e.input.charCodeAt(e.position)) !== 0; ) {
1244
+ for (e.kind = "scalar", e.result = "", e.position++, r = i = e.position; (a = e.input.charCodeAt(e.position)) !== 0; ) {
1358
1245
  if (a === 34)
1359
- return z(e, i, e.position, !0), e.position++, !0;
1246
+ return q(e, r, e.position, !0), e.position++, !0;
1360
1247
  if (a === 92) {
1361
- if (z(e, i, e.position, !0), a = e.input.charCodeAt(++e.position), P(a))
1248
+ if (q(e, r, e.position, !0), a = e.input.charCodeAt(++e.position), z(a))
1362
1249
  O(e, !1, n);
1363
- else if (a < 256 && Vn[a])
1364
- e.result += Xn[a], e.position++;
1365
- else if ((l = $r(a)) > 0) {
1366
- for (o = l, t = 0; o > 0; o--)
1367
- a = e.input.charCodeAt(++e.position), (l = Ur(a)) >= 0 ? t = (t << 4) + l : x(e, "expected hexadecimal character");
1368
- e.result += Wr(t), e.position++;
1250
+ else if (a < 256 && sr[a])
1251
+ e.result += cr[a], e.position++;
1252
+ else if ((l = Zi(a)) > 0) {
1253
+ for (t = l, o = 0; t > 0; t--)
1254
+ a = e.input.charCodeAt(++e.position), (l = Ji(a)) >= 0 ? o = (o << 4) + l : v(e, "expected hexadecimal character");
1255
+ e.result += nt(o), e.position++;
1369
1256
  } else
1370
- x(e, "unknown escape sequence");
1371
- i = r = e.position;
1372
- } else P(a) ? (z(e, i, r, !0), Be(e, O(e, !1, n)), i = r = e.position) : e.position === e.lineStart && ye(e) ? x(e, "unexpected end of the document within a double quoted scalar") : (e.position++, r = e.position);
1373
- }
1374
- x(e, "unexpected end of the stream within a double quoted scalar");
1375
- }
1376
- function Qr(e, n) {
1377
- var i = !0, r, o, t, l = e.tag, a, c = e.anchor, u, s, p, h, d, y = /* @__PURE__ */ Object.create(null), g, C, L, A;
1378
- if (A = e.input.charCodeAt(e.position), A === 91)
1379
- s = 93, d = !1, a = [];
1380
- else if (A === 123)
1381
- s = 125, d = !0, a = {};
1257
+ v(e, "unknown escape sequence");
1258
+ r = i = e.position;
1259
+ } else z(a) ? (q(e, r, i, !0), Ge(e, O(e, !1, n)), r = i = e.position) : e.position === e.lineStart && Fe(e) ? v(e, "unexpected end of the document within a double quoted scalar") : (e.position++, i = e.position);
1260
+ }
1261
+ v(e, "unexpected end of the stream within a double quoted scalar");
1262
+ }
1263
+ function lt(e, n) {
1264
+ var r = !0, i, t, o, l = e.tag, a, s = e.anchor, c, u, f, h, d, m = /* @__PURE__ */ Object.create(null), g, b, C, x;
1265
+ if (x = e.input.charCodeAt(e.position), x === 91)
1266
+ u = 93, d = !1, a = [];
1267
+ else if (x === 123)
1268
+ u = 125, d = !0, a = {};
1382
1269
  else
1383
1270
  return !1;
1384
- for (e.anchor !== null && (e.anchorMap[e.anchor] = a), A = e.input.charCodeAt(++e.position); A !== 0; ) {
1385
- if (O(e, !0, n), A = e.input.charCodeAt(e.position), A === s)
1386
- return e.position++, e.tag = l, e.anchor = c, e.kind = d ? "mapping" : "sequence", e.result = a, !0;
1387
- i ? A === 44 && x(e, "expected the node content, but found ','") : x(e, "missed comma between flow collection entries"), C = g = L = null, p = h = !1, A === 63 && (u = e.input.charCodeAt(e.position + 1), M(u) && (p = h = !0, e.position++, O(e, !0, n))), r = e.line, o = e.lineStart, t = e.position, Q(e, n, pe, !1, !0), C = e.tag, g = e.result, O(e, !0, n), A = e.input.charCodeAt(e.position), (h || e.line === r) && A === 58 && (p = !0, A = e.input.charCodeAt(++e.position), O(e, !0, n), Q(e, n, pe, !1, !0), L = e.result), d ? X(e, a, y, C, g, L, r, o, t) : p ? a.push(X(e, null, y, C, g, L, r, o, t)) : a.push(g), O(e, !0, n), A = e.input.charCodeAt(e.position), A === 44 ? (i = !0, A = e.input.charCodeAt(++e.position)) : i = !1;
1388
- }
1389
- x(e, "unexpected end of the stream within a flow collection");
1390
- }
1391
- function Jr(e, n) {
1392
- var i, r, o = Fe, t = !1, l = !1, a = n, c = 0, u = !1, s, p;
1393
- if (p = e.input.charCodeAt(e.position), p === 124)
1394
- r = !1;
1395
- else if (p === 62)
1396
- r = !0;
1271
+ for (e.anchor !== null && (e.anchorMap[e.anchor] = a), x = e.input.charCodeAt(++e.position); x !== 0; ) {
1272
+ if (O(e, !0, n), x = e.input.charCodeAt(e.position), x === u)
1273
+ return e.position++, e.tag = l, e.anchor = s, e.kind = d ? "mapping" : "sequence", e.result = a, !0;
1274
+ r ? x === 44 && v(e, "expected the node content, but found ','") : v(e, "missed comma between flow collection entries"), b = g = C = null, f = h = !1, x === 63 && (c = e.input.charCodeAt(e.position + 1), D(c) && (f = h = !0, e.position++, O(e, !0, n))), i = e.line, t = e.lineStart, o = e.position, te(e, n, Ce, !1, !0), b = e.tag, g = e.result, O(e, !0, n), x = e.input.charCodeAt(e.position), (h || e.line === i) && x === 58 && (f = !0, x = e.input.charCodeAt(++e.position), O(e, !0, n), te(e, n, Ce, !1, !0), C = e.result), d ? ie(e, a, m, b, g, C, i, t, o) : f ? a.push(ie(e, null, m, b, g, C, i, t, o)) : a.push(g), O(e, !0, n), x = e.input.charCodeAt(e.position), x === 44 ? (r = !0, x = e.input.charCodeAt(++e.position)) : r = !1;
1275
+ }
1276
+ v(e, "unexpected end of the stream within a flow collection");
1277
+ }
1278
+ function at(e, n) {
1279
+ var r, i, t = Re, o = !1, l = !1, a = n, s = 0, c = !1, u, f;
1280
+ if (f = e.input.charCodeAt(e.position), f === 124)
1281
+ i = !1;
1282
+ else if (f === 62)
1283
+ i = !0;
1397
1284
  else
1398
1285
  return !1;
1399
- for (e.kind = "scalar", e.result = ""; p !== 0; )
1400
- if (p = e.input.charCodeAt(++e.position), p === 43 || p === 45)
1401
- Fe === o ? o = p === 43 ? nn : Br : x(e, "repeat of a chomping mode identifier");
1402
- else if ((s = Kr(p)) >= 0)
1403
- s === 0 ? x(e, "bad explicit indentation width of a block scalar; it cannot be less than one") : l ? x(e, "repeat of an indentation width identifier") : (a = n + s - 1, l = !0);
1286
+ for (e.kind = "scalar", e.result = ""; f !== 0; )
1287
+ if (f = e.input.charCodeAt(++e.position), f === 43 || f === 45)
1288
+ Re === t ? t = f === 43 ? fn : Gi : v(e, "repeat of a chomping mode identifier");
1289
+ else if ((u = et(f)) >= 0)
1290
+ u === 0 ? v(e, "bad explicit indentation width of a block scalar; it cannot be less than one") : l ? v(e, "repeat of an indentation width identifier") : (a = n + u - 1, l = !0);
1404
1291
  else
1405
1292
  break;
1406
- if (U(p)) {
1293
+ if (X(f)) {
1407
1294
  do
1408
- p = e.input.charCodeAt(++e.position);
1409
- while (U(p));
1410
- if (p === 35)
1295
+ f = e.input.charCodeAt(++e.position);
1296
+ while (X(f));
1297
+ if (f === 35)
1411
1298
  do
1412
- p = e.input.charCodeAt(++e.position);
1413
- while (!P(p) && p !== 0);
1414
- }
1415
- for (; p !== 0; ) {
1416
- for (Pe(e), e.lineIndent = 0, p = e.input.charCodeAt(e.position); (!l || e.lineIndent < a) && p === 32; )
1417
- e.lineIndent++, p = e.input.charCodeAt(++e.position);
1418
- if (!l && e.lineIndent > a && (a = e.lineIndent), P(p)) {
1419
- c++;
1299
+ f = e.input.charCodeAt(++e.position);
1300
+ while (!z(f) && f !== 0);
1301
+ }
1302
+ for (; f !== 0; ) {
1303
+ for (qe(e), e.lineIndent = 0, f = e.input.charCodeAt(e.position); (!l || e.lineIndent < a) && f === 32; )
1304
+ e.lineIndent++, f = e.input.charCodeAt(++e.position);
1305
+ if (!l && e.lineIndent > a && (a = e.lineIndent), z(f)) {
1306
+ s++;
1420
1307
  continue;
1421
1308
  }
1422
1309
  if (e.lineIndent < a) {
1423
- o === nn ? e.result += F.repeat(`
1424
- `, t ? 1 + c : c) : o === Fe && t && (e.result += `
1310
+ t === fn ? e.result += F.repeat(`
1311
+ `, o ? 1 + s : s) : t === Re && o && (e.result += `
1425
1312
  `);
1426
1313
  break;
1427
1314
  }
1428
- for (r ? U(p) ? (u = !0, e.result += F.repeat(`
1429
- `, t ? 1 + c : c)) : u ? (u = !1, e.result += F.repeat(`
1430
- `, c + 1)) : c === 0 ? t && (e.result += " ") : e.result += F.repeat(`
1431
- `, c) : e.result += F.repeat(`
1432
- `, t ? 1 + c : c), t = !0, l = !0, c = 0, i = e.position; !P(p) && p !== 0; )
1433
- p = e.input.charCodeAt(++e.position);
1434
- z(e, i, e.position, !1);
1315
+ for (i ? X(f) ? (c = !0, e.result += F.repeat(`
1316
+ `, o ? 1 + s : s)) : c ? (c = !1, e.result += F.repeat(`
1317
+ `, s + 1)) : s === 0 ? o && (e.result += " ") : e.result += F.repeat(`
1318
+ `, s) : e.result += F.repeat(`
1319
+ `, o ? 1 + s : s), o = !0, l = !0, s = 0, r = e.position; !z(f) && f !== 0; )
1320
+ f = e.input.charCodeAt(++e.position);
1321
+ q(e, r, e.position, !1);
1435
1322
  }
1436
1323
  return !0;
1437
1324
  }
1438
- function an(e, n) {
1439
- var i, r = e.tag, o = e.anchor, t = [], l, a = !1, c;
1325
+ function mn(e, n) {
1326
+ var r, i = e.tag, t = e.anchor, o = [], l, a = !1, s;
1440
1327
  if (e.firstTabInLine !== -1) return !1;
1441
- for (e.anchor !== null && (e.anchorMap[e.anchor] = t), c = e.input.charCodeAt(e.position); c !== 0 && (e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, x(e, "tab characters must not be used in indentation")), !(c !== 45 || (l = e.input.charCodeAt(e.position + 1), !M(l)))); ) {
1328
+ for (e.anchor !== null && (e.anchorMap[e.anchor] = o), s = e.input.charCodeAt(e.position); s !== 0 && (e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, v(e, "tab characters must not be used in indentation")), !(s !== 45 || (l = e.input.charCodeAt(e.position + 1), !D(l)))); ) {
1442
1329
  if (a = !0, e.position++, O(e, !0, -1) && e.lineIndent <= n) {
1443
- t.push(null), c = e.input.charCodeAt(e.position);
1330
+ o.push(null), s = e.input.charCodeAt(e.position);
1444
1331
  continue;
1445
1332
  }
1446
- if (i = e.line, Q(e, n, Kn, !1, !0), t.push(e.result), O(e, !0, -1), c = e.input.charCodeAt(e.position), (e.line === i || e.lineIndent > n) && c !== 0)
1447
- x(e, "bad indentation of a sequence entry");
1333
+ if (r = e.line, te(e, n, tr, !1, !0), o.push(e.result), O(e, !0, -1), s = e.input.charCodeAt(e.position), (e.line === r || e.lineIndent > n) && s !== 0)
1334
+ v(e, "bad indentation of a sequence entry");
1448
1335
  else if (e.lineIndent < n)
1449
1336
  break;
1450
1337
  }
1451
- return a ? (e.tag = r, e.anchor = o, e.kind = "sequence", e.result = t, !0) : !1;
1338
+ return a ? (e.tag = i, e.anchor = t, e.kind = "sequence", e.result = o, !0) : !1;
1452
1339
  }
1453
- function Zr(e, n, i) {
1454
- var r, o, t, l, a, c, u = e.tag, s = e.anchor, p = {}, h = /* @__PURE__ */ Object.create(null), d = null, y = null, g = null, C = !1, L = !1, A;
1340
+ function st(e, n, r) {
1341
+ var i, t, o, l, a, s, c = e.tag, u = e.anchor, f = {}, h = /* @__PURE__ */ Object.create(null), d = null, m = null, g = null, b = !1, C = !1, x;
1455
1342
  if (e.firstTabInLine !== -1) return !1;
1456
- for (e.anchor !== null && (e.anchorMap[e.anchor] = p), A = e.input.charCodeAt(e.position); A !== 0; ) {
1457
- if (!C && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, x(e, "tab characters must not be used in indentation")), r = e.input.charCodeAt(e.position + 1), t = e.line, (A === 63 || A === 58) && M(r))
1458
- A === 63 ? (C && (X(e, p, h, d, y, null, l, a, c), d = y = g = null), L = !0, C = !0, o = !0) : C ? (C = !1, o = !0) : x(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, A = r;
1343
+ for (e.anchor !== null && (e.anchorMap[e.anchor] = f), x = e.input.charCodeAt(e.position); x !== 0; ) {
1344
+ if (!b && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, v(e, "tab characters must not be used in indentation")), i = e.input.charCodeAt(e.position + 1), o = e.line, (x === 63 || x === 58) && D(i))
1345
+ x === 63 ? (b && (ie(e, f, h, d, m, null, l, a, s), d = m = g = null), C = !0, b = !0, t = !0) : b ? (b = !1, t = !0) : v(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, x = i;
1459
1346
  else {
1460
- if (l = e.line, a = e.lineStart, c = e.position, !Q(e, i, $n, !1, !0))
1347
+ if (l = e.line, a = e.lineStart, s = e.position, !te(e, r, ir, !1, !0))
1461
1348
  break;
1462
- if (e.line === t) {
1463
- for (A = e.input.charCodeAt(e.position); U(A); )
1464
- A = e.input.charCodeAt(++e.position);
1465
- if (A === 58)
1466
- A = e.input.charCodeAt(++e.position), M(A) || x(e, "a whitespace character is expected after the key-value separator within a block mapping"), C && (X(e, p, h, d, y, null, l, a, c), d = y = g = null), L = !0, C = !1, o = !1, d = e.tag, y = e.result;
1467
- else if (L)
1468
- x(e, "can not read an implicit mapping pair; a colon is missed");
1349
+ if (e.line === o) {
1350
+ for (x = e.input.charCodeAt(e.position); X(x); )
1351
+ x = e.input.charCodeAt(++e.position);
1352
+ if (x === 58)
1353
+ x = e.input.charCodeAt(++e.position), D(x) || v(e, "a whitespace character is expected after the key-value separator within a block mapping"), b && (ie(e, f, h, d, m, null, l, a, s), d = m = g = null), C = !0, b = !1, t = !1, d = e.tag, m = e.result;
1354
+ else if (C)
1355
+ v(e, "can not read an implicit mapping pair; a colon is missed");
1469
1356
  else
1470
- return e.tag = u, e.anchor = s, !0;
1471
- } else if (L)
1472
- x(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
1357
+ return e.tag = c, e.anchor = u, !0;
1358
+ } else if (C)
1359
+ v(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
1473
1360
  else
1474
- return e.tag = u, e.anchor = s, !0;
1361
+ return e.tag = c, e.anchor = u, !0;
1475
1362
  }
1476
- if ((e.line === t || e.lineIndent > n) && (C && (l = e.line, a = e.lineStart, c = e.position), Q(e, n, de, !0, o) && (C ? y = e.result : g = e.result), C || (X(e, p, h, d, y, g, l, a, c), d = y = g = null), O(e, !0, -1), A = e.input.charCodeAt(e.position)), (e.line === t || e.lineIndent > n) && A !== 0)
1477
- x(e, "bad indentation of a mapping entry");
1363
+ if ((e.line === o || e.lineIndent > n) && (b && (l = e.line, a = e.lineStart, s = e.position), te(e, n, ke, !0, t) && (b ? m = e.result : g = e.result), b || (ie(e, f, h, d, m, g, l, a, s), d = m = g = null), O(e, !0, -1), x = e.input.charCodeAt(e.position)), (e.line === o || e.lineIndent > n) && x !== 0)
1364
+ v(e, "bad indentation of a mapping entry");
1478
1365
  else if (e.lineIndent < n)
1479
1366
  break;
1480
1367
  }
1481
- return C && X(e, p, h, d, y, null, l, a, c), L && (e.tag = u, e.anchor = s, e.kind = "mapping", e.result = p), L;
1368
+ return b && ie(e, f, h, d, m, null, l, a, s), C && (e.tag = c, e.anchor = u, e.kind = "mapping", e.result = f), C;
1482
1369
  }
1483
- function eo(e) {
1484
- var n, i = !1, r = !1, o, t, l;
1370
+ function ct(e) {
1371
+ var n, r = !1, i = !1, t, o, l;
1485
1372
  if (l = e.input.charCodeAt(e.position), l !== 33) return !1;
1486
- if (e.tag !== null && x(e, "duplication of a tag property"), l = e.input.charCodeAt(++e.position), l === 60 ? (i = !0, l = e.input.charCodeAt(++e.position)) : l === 33 ? (r = !0, o = "!!", l = e.input.charCodeAt(++e.position)) : o = "!", n = e.position, i) {
1373
+ if (e.tag !== null && v(e, "duplication of a tag property"), l = e.input.charCodeAt(++e.position), l === 60 ? (r = !0, l = e.input.charCodeAt(++e.position)) : l === 33 ? (i = !0, t = "!!", l = e.input.charCodeAt(++e.position)) : t = "!", n = e.position, r) {
1487
1374
  do
1488
1375
  l = e.input.charCodeAt(++e.position);
1489
1376
  while (l !== 0 && l !== 62);
1490
- e.position < e.length ? (t = e.input.slice(n, e.position), l = e.input.charCodeAt(++e.position)) : x(e, "unexpected end of the stream within a verbatim tag");
1377
+ e.position < e.length ? (o = e.input.slice(n, e.position), l = e.input.charCodeAt(++e.position)) : v(e, "unexpected end of the stream within a verbatim tag");
1491
1378
  } else {
1492
- for (; l !== 0 && !M(l); )
1493
- l === 33 && (r ? x(e, "tag suffix cannot contain exclamation marks") : (o = e.input.slice(n - 1, e.position + 1), Wn.test(o) || x(e, "named tag handle cannot contain such characters"), r = !0, n = e.position + 1)), l = e.input.charCodeAt(++e.position);
1494
- t = e.input.slice(n, e.position), Hr.test(t) && x(e, "tag suffix cannot contain flow indicator characters");
1379
+ for (; l !== 0 && !D(l); )
1380
+ l === 33 && (i ? v(e, "tag suffix cannot contain exclamation marks") : (t = e.input.slice(n - 1, e.position + 1), or.test(t) || v(e, "named tag handle cannot contain such characters"), i = !0, n = e.position + 1)), l = e.input.charCodeAt(++e.position);
1381
+ o = e.input.slice(n, e.position), Qi.test(o) && v(e, "tag suffix cannot contain flow indicator characters");
1495
1382
  }
1496
- t && !Gn.test(t) && x(e, "tag name cannot contain such characters: " + t);
1383
+ o && !lr.test(o) && v(e, "tag name cannot contain such characters: " + o);
1497
1384
  try {
1498
- t = decodeURIComponent(t);
1385
+ o = decodeURIComponent(o);
1499
1386
  } catch {
1500
- x(e, "tag name is malformed: " + t);
1387
+ v(e, "tag name is malformed: " + o);
1501
1388
  }
1502
- return i ? e.tag = t : H.call(e.tagMap, o) ? e.tag = e.tagMap[o] + t : o === "!" ? e.tag = "!" + t : o === "!!" ? e.tag = "tag:yaml.org,2002:" + t : x(e, 'undeclared tag handle "' + o + '"'), !0;
1503
- }
1504
- function no(e) {
1505
- var n, i;
1506
- if (i = e.input.charCodeAt(e.position), i !== 38) return !1;
1507
- for (e.anchor !== null && x(e, "duplication of an anchor property"), i = e.input.charCodeAt(++e.position), n = e.position; i !== 0 && !M(i) && !V(i); )
1508
- i = e.input.charCodeAt(++e.position);
1509
- return e.position === n && x(e, "name of an anchor node must contain at least one character"), e.anchor = e.input.slice(n, e.position), !0;
1389
+ return r ? e.tag = o : G.call(e.tagMap, t) ? e.tag = e.tagMap[t] + o : t === "!" ? e.tag = "!" + o : t === "!!" ? e.tag = "tag:yaml.org,2002:" + o : v(e, 'undeclared tag handle "' + t + '"'), !0;
1510
1390
  }
1511
- function io(e) {
1512
- var n, i, r;
1513
- if (r = e.input.charCodeAt(e.position), r !== 42) return !1;
1514
- for (r = e.input.charCodeAt(++e.position), n = e.position; r !== 0 && !M(r) && !V(r); )
1391
+ function ut(e) {
1392
+ var n, r;
1393
+ if (r = e.input.charCodeAt(e.position), r !== 38) return !1;
1394
+ for (e.anchor !== null && v(e, "duplication of an anchor property"), r = e.input.charCodeAt(++e.position), n = e.position; r !== 0 && !D(r) && !re(r); )
1515
1395
  r = e.input.charCodeAt(++e.position);
1516
- return e.position === n && x(e, "name of an alias node must contain at least one character"), i = e.input.slice(n, e.position), H.call(e.anchorMap, i) || x(e, 'unidentified alias "' + i + '"'), e.result = e.anchorMap[i], O(e, !0, -1), !0;
1517
- }
1518
- function Q(e, n, i, r, o) {
1519
- var t, l, a, c = 1, u = !1, s = !1, p, h, d, y, g, C;
1520
- if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, t = l = a = de === i || Kn === i, r && O(e, !0, -1) && (u = !0, e.lineIndent > n ? c = 1 : e.lineIndent === n ? c = 0 : e.lineIndent < n && (c = -1)), c === 1)
1521
- for (; eo(e) || no(e); )
1522
- O(e, !0, -1) ? (u = !0, a = t, e.lineIndent > n ? c = 1 : e.lineIndent === n ? c = 0 : e.lineIndent < n && (c = -1)) : a = !1;
1523
- if (a && (a = u || o), (c === 1 || de === i) && (pe === i || $n === i ? g = n : g = n + 1, C = e.position - e.lineStart, c === 1 ? a && (an(e, C) || Zr(e, C, g)) || Qr(e, g) ? s = !0 : (l && Jr(e, g) || Vr(e, g) || Xr(e, g) ? s = !0 : io(e) ? (s = !0, (e.tag !== null || e.anchor !== null) && x(e, "alias node should not have any properties")) : qr(e, g, pe === i) && (s = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : c === 0 && (s = a && an(e, C))), e.tag === null)
1396
+ return e.position === n && v(e, "name of an anchor node must contain at least one character"), e.anchor = e.input.slice(n, e.position), !0;
1397
+ }
1398
+ function ft(e) {
1399
+ var n, r, i;
1400
+ if (i = e.input.charCodeAt(e.position), i !== 42) return !1;
1401
+ for (i = e.input.charCodeAt(++e.position), n = e.position; i !== 0 && !D(i) && !re(i); )
1402
+ i = e.input.charCodeAt(++e.position);
1403
+ return e.position === n && v(e, "name of an alias node must contain at least one character"), r = e.input.slice(n, e.position), G.call(e.anchorMap, r) || v(e, 'unidentified alias "' + r + '"'), e.result = e.anchorMap[r], O(e, !0, -1), !0;
1404
+ }
1405
+ function te(e, n, r, i, t) {
1406
+ var o, l, a, s = 1, c = !1, u = !1, f, h, d, m, g, b;
1407
+ if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, o = l = a = ke === r || tr === r, i && O(e, !0, -1) && (c = !0, e.lineIndent > n ? s = 1 : e.lineIndent === n ? s = 0 : e.lineIndent < n && (s = -1)), s === 1)
1408
+ for (; ct(e) || ut(e); )
1409
+ O(e, !0, -1) ? (c = !0, a = o, e.lineIndent > n ? s = 1 : e.lineIndent === n ? s = 0 : e.lineIndent < n && (s = -1)) : a = !1;
1410
+ if (a && (a = c || t), (s === 1 || ke === r) && (Ce === r || ir === r ? g = n : g = n + 1, b = e.position - e.lineStart, s === 1 ? a && (mn(e, b) || st(e, b, g)) || lt(e, g) ? u = !0 : (l && at(e, g) || tt(e, g) || ot(e, g) ? u = !0 : ft(e) ? (u = !0, (e.tag !== null || e.anchor !== null) && v(e, "alias node should not have any properties")) : it(e, g, Ce === r) && (u = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : s === 0 && (u = a && mn(e, b))), e.tag === null)
1524
1411
  e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
1525
1412
  else if (e.tag === "?") {
1526
- for (e.result !== null && e.kind !== "scalar" && x(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), p = 0, h = e.implicitTypes.length; p < h; p += 1)
1527
- if (y = e.implicitTypes[p], y.resolve(e.result)) {
1528
- e.result = y.construct(e.result), e.tag = y.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
1413
+ for (e.result !== null && e.kind !== "scalar" && v(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), f = 0, h = e.implicitTypes.length; f < h; f += 1)
1414
+ if (m = e.implicitTypes[f], m.resolve(e.result)) {
1415
+ e.result = m.construct(e.result), e.tag = m.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
1529
1416
  break;
1530
1417
  }
1531
1418
  } else if (e.tag !== "!") {
1532
- if (H.call(e.typeMap[e.kind || "fallback"], e.tag))
1533
- y = e.typeMap[e.kind || "fallback"][e.tag];
1419
+ if (G.call(e.typeMap[e.kind || "fallback"], e.tag))
1420
+ m = e.typeMap[e.kind || "fallback"][e.tag];
1534
1421
  else
1535
- for (y = null, d = e.typeMap.multi[e.kind || "fallback"], p = 0, h = d.length; p < h; p += 1)
1536
- if (e.tag.slice(0, d[p].tag.length) === d[p].tag) {
1537
- y = d[p];
1422
+ for (m = null, d = e.typeMap.multi[e.kind || "fallback"], f = 0, h = d.length; f < h; f += 1)
1423
+ if (e.tag.slice(0, d[f].tag.length) === d[f].tag) {
1424
+ m = d[f];
1538
1425
  break;
1539
1426
  }
1540
- y || x(e, "unknown tag !<" + e.tag + ">"), e.result !== null && y.kind !== e.kind && x(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + y.kind + '", not "' + e.kind + '"'), y.resolve(e.result, e.tag) ? (e.result = y.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : x(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
1427
+ m || v(e, "unknown tag !<" + e.tag + ">"), e.result !== null && m.kind !== e.kind && v(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + m.kind + '", not "' + e.kind + '"'), m.resolve(e.result, e.tag) ? (e.result = m.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : v(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
1541
1428
  }
1542
- return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || s;
1429
+ return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || u;
1543
1430
  }
1544
- function ro(e) {
1545
- var n = e.position, i, r, o, t = !1, l;
1431
+ function pt(e) {
1432
+ var n = e.position, r, i, t, o = !1, l;
1546
1433
  for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = /* @__PURE__ */ Object.create(null), e.anchorMap = /* @__PURE__ */ Object.create(null); (l = e.input.charCodeAt(e.position)) !== 0 && (O(e, !0, -1), l = e.input.charCodeAt(e.position), !(e.lineIndent > 0 || l !== 37)); ) {
1547
- for (t = !0, l = e.input.charCodeAt(++e.position), i = e.position; l !== 0 && !M(l); )
1434
+ for (o = !0, l = e.input.charCodeAt(++e.position), r = e.position; l !== 0 && !D(l); )
1548
1435
  l = e.input.charCodeAt(++e.position);
1549
- for (r = e.input.slice(i, e.position), o = [], r.length < 1 && x(e, "directive name must not be less than one character in length"); l !== 0; ) {
1550
- for (; U(l); )
1436
+ for (i = e.input.slice(r, e.position), t = [], i.length < 1 && v(e, "directive name must not be less than one character in length"); l !== 0; ) {
1437
+ for (; X(l); )
1551
1438
  l = e.input.charCodeAt(++e.position);
1552
1439
  if (l === 35) {
1553
1440
  do
1554
1441
  l = e.input.charCodeAt(++e.position);
1555
- while (l !== 0 && !P(l));
1442
+ while (l !== 0 && !z(l));
1556
1443
  break;
1557
1444
  }
1558
- if (P(l)) break;
1559
- for (i = e.position; l !== 0 && !M(l); )
1445
+ if (z(l)) break;
1446
+ for (r = e.position; l !== 0 && !D(l); )
1560
1447
  l = e.input.charCodeAt(++e.position);
1561
- o.push(e.input.slice(i, e.position));
1448
+ t.push(e.input.slice(r, e.position));
1562
1449
  }
1563
- l !== 0 && Pe(e), H.call(ln, r) ? ln[r](e, r, o) : he(e, 'unknown document directive "' + r + '"');
1450
+ l !== 0 && qe(e), G.call(hn, i) ? hn[i](e, i, t) : Ee(e, 'unknown document directive "' + i + '"');
1564
1451
  }
1565
- if (O(e, !0, -1), e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 ? (e.position += 3, O(e, !0, -1)) : t && x(e, "directives end mark is expected"), Q(e, e.lineIndent - 1, de, !1, !0), O(e, !0, -1), e.checkLineBreaks && zr.test(e.input.slice(n, e.position)) && he(e, "non-ASCII line breaks are interpreted as content"), e.documents.push(e.result), e.position === e.lineStart && ye(e)) {
1452
+ if (O(e, !0, -1), e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 ? (e.position += 3, O(e, !0, -1)) : o && v(e, "directives end mark is expected"), te(e, e.lineIndent - 1, ke, !1, !0), O(e, !0, -1), e.checkLineBreaks && Xi.test(e.input.slice(n, e.position)) && Ee(e, "non-ASCII line breaks are interpreted as content"), e.documents.push(e.result), e.position === e.lineStart && Fe(e)) {
1566
1453
  e.input.charCodeAt(e.position) === 46 && (e.position += 3, O(e, !0, -1));
1567
1454
  return;
1568
1455
  }
1569
1456
  if (e.position < e.length - 1)
1570
- x(e, "end of the stream or a document separator is expected");
1457
+ v(e, "end of the stream or a document separator is expected");
1571
1458
  else
1572
1459
  return;
1573
1460
  }
1574
- function Jn(e, n) {
1461
+ function fr(e, n) {
1575
1462
  e = String(e), n = n || {}, e.length !== 0 && (e.charCodeAt(e.length - 1) !== 10 && e.charCodeAt(e.length - 1) !== 13 && (e += `
1576
1463
  `), e.charCodeAt(0) === 65279 && (e = e.slice(1)));
1577
- var i = new Gr(e, n), r = e.indexOf("\0");
1578
- for (r !== -1 && (i.position = r, x(i, "null byte is not allowed in input")), i.input += "\0"; i.input.charCodeAt(i.position) === 32; )
1579
- i.lineIndent += 1, i.position += 1;
1580
- for (; i.position < i.length - 1; )
1581
- ro(i);
1582
- return i.documents;
1583
- }
1584
- function oo(e, n, i) {
1585
- n !== null && typeof n == "object" && typeof i > "u" && (i = n, n = null);
1586
- var r = Jn(e, i);
1464
+ var r = new rt(e, n), i = e.indexOf("\0");
1465
+ for (i !== -1 && (r.position = i, v(r, "null byte is not allowed in input")), r.input += "\0"; r.input.charCodeAt(r.position) === 32; )
1466
+ r.lineIndent += 1, r.position += 1;
1467
+ for (; r.position < r.length - 1; )
1468
+ pt(r);
1469
+ return r.documents;
1470
+ }
1471
+ function dt(e, n, r) {
1472
+ n !== null && typeof n == "object" && typeof r > "u" && (r = n, n = null);
1473
+ var i = fr(e, r);
1587
1474
  if (typeof n != "function")
1588
- return r;
1589
- for (var o = 0, t = r.length; o < t; o += 1)
1590
- n(r[o]);
1591
- }
1592
- function lo(e, n) {
1593
- var i = Jn(e, n);
1594
- if (i.length !== 0) {
1595
- if (i.length === 1)
1596
- return i[0];
1475
+ return i;
1476
+ for (var t = 0, o = i.length; t < o; t += 1)
1477
+ n(i[t]);
1478
+ }
1479
+ function ht(e, n) {
1480
+ var r = fr(e, n);
1481
+ if (r.length !== 0) {
1482
+ if (r.length === 1)
1483
+ return r[0];
1597
1484
  throw new I("expected a single document in the stream, but found more");
1598
1485
  }
1599
1486
  }
1600
- var to = oo, ao = lo, Zn = {
1601
- loadAll: to,
1602
- load: ao
1603
- }, ei = Object.prototype.toString, ni = Object.prototype.hasOwnProperty, Ye = 65279, co = 9, ie = 10, uo = 13, fo = 32, so = 33, po = 34, Te = 35, ho = 37, go = 38, mo = 39, xo = 42, ii = 44, vo = 45, ge = 58, yo = 61, wo = 62, Ao = 63, bo = 64, ri = 91, oi = 93, Co = 96, li = 123, _o = 124, ti = 125, T = {};
1604
- T[0] = "\\0";
1605
- T[7] = "\\a";
1606
- T[8] = "\\b";
1607
- T[9] = "\\t";
1608
- T[10] = "\\n";
1609
- T[11] = "\\v";
1610
- T[12] = "\\f";
1611
- T[13] = "\\r";
1612
- T[27] = "\\e";
1613
- T[34] = '\\"';
1614
- T[92] = "\\\\";
1615
- T[133] = "\\N";
1616
- T[160] = "\\_";
1617
- T[8232] = "\\L";
1618
- T[8233] = "\\P";
1619
- var So = [
1487
+ var gt = dt, mt = ht, pr = {
1488
+ loadAll: gt,
1489
+ load: mt
1490
+ }, dr = Object.prototype.toString, hr = Object.prototype.hasOwnProperty, Ve = 65279, yt = 9, pe = 10, vt = 13, xt = 32, wt = 33, bt = 34, $e = 35, At = 37, Ct = 38, kt = 39, Et = 42, gr = 44, St = 45, Se = 58, _t = 61, Ot = 62, Ft = 63, Tt = 64, mr = 91, yr = 93, Lt = 96, vr = 123, jt = 124, xr = 125, L = {};
1491
+ L[0] = "\\0";
1492
+ L[7] = "\\a";
1493
+ L[8] = "\\b";
1494
+ L[9] = "\\t";
1495
+ L[10] = "\\n";
1496
+ L[11] = "\\v";
1497
+ L[12] = "\\f";
1498
+ L[13] = "\\r";
1499
+ L[27] = "\\e";
1500
+ L[34] = '\\"';
1501
+ L[92] = "\\\\";
1502
+ L[133] = "\\N";
1503
+ L[160] = "\\_";
1504
+ L[8232] = "\\L";
1505
+ L[8233] = "\\P";
1506
+ var It = [
1620
1507
  "y",
1621
1508
  "Y",
1622
1509
  "yes",
@@ -1633,529 +1520,1148 @@ var So = [
1633
1520
  "off",
1634
1521
  "Off",
1635
1522
  "OFF"
1636
- ], Eo = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
1637
- function Oo(e, n) {
1638
- var i, r, o, t, l, a, c;
1523
+ ], Nt = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
1524
+ function Rt(e, n) {
1525
+ var r, i, t, o, l, a, s;
1639
1526
  if (n === null) return {};
1640
- for (i = {}, r = Object.keys(n), o = 0, t = r.length; o < t; o += 1)
1641
- l = r[o], a = String(n[l]), l.slice(0, 2) === "!!" && (l = "tag:yaml.org,2002:" + l.slice(2)), c = e.compiledTypeMap.fallback[l], c && ni.call(c.styleAliases, a) && (a = c.styleAliases[a]), i[l] = a;
1642
- return i;
1527
+ for (r = {}, i = Object.keys(n), t = 0, o = i.length; t < o; t += 1)
1528
+ l = i[t], a = String(n[l]), l.slice(0, 2) === "!!" && (l = "tag:yaml.org,2002:" + l.slice(2)), s = e.compiledTypeMap.fallback[l], s && hr.call(s.styleAliases, a) && (a = s.styleAliases[a]), r[l] = a;
1529
+ return r;
1643
1530
  }
1644
- function Fo(e) {
1645
- var n, i, r;
1531
+ function Mt(e) {
1532
+ var n, r, i;
1646
1533
  if (n = e.toString(16).toUpperCase(), e <= 255)
1647
- i = "x", r = 2;
1534
+ r = "x", i = 2;
1648
1535
  else if (e <= 65535)
1649
- i = "u", r = 4;
1536
+ r = "u", i = 4;
1650
1537
  else if (e <= 4294967295)
1651
- i = "U", r = 8;
1538
+ r = "U", i = 8;
1652
1539
  else
1653
1540
  throw new I("code point within a string may not be greater than 0xFFFFFFFF");
1654
- return "\\" + i + F.repeat("0", r - n.length) + n;
1541
+ return "\\" + r + F.repeat("0", i - n.length) + n;
1655
1542
  }
1656
- var Lo = 1, re = 2;
1657
- function ko(e) {
1658
- this.schema = e.schema || De, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = F.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = Oo(this.schema, e.styles || null), this.sortKeys = e.sortKeys || !1, this.lineWidth = e.lineWidth || 80, this.noRefs = e.noRefs || !1, this.noCompatMode = e.noCompatMode || !1, this.condenseFlow = e.condenseFlow || !1, this.quotingType = e.quotingType === '"' ? re : Lo, this.forceQuotes = e.forceQuotes || !1, this.replacer = typeof e.replacer == "function" ? e.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
1543
+ var Pt = 1, de = 2;
1544
+ function Dt(e) {
1545
+ this.schema = e.schema || We, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = F.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = Rt(this.schema, e.styles || null), this.sortKeys = e.sortKeys || !1, this.lineWidth = e.lineWidth || 80, this.noRefs = e.noRefs || !1, this.noCompatMode = e.noCompatMode || !1, this.condenseFlow = e.condenseFlow || !1, this.quotingType = e.quotingType === '"' ? de : Pt, this.forceQuotes = e.forceQuotes || !1, this.replacer = typeof e.replacer == "function" ? e.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
1659
1546
  }
1660
- function cn(e, n) {
1661
- for (var i = F.repeat(" ", n), r = 0, o = -1, t = "", l, a = e.length; r < a; )
1662
- o = e.indexOf(`
1663
- `, r), o === -1 ? (l = e.slice(r), r = a) : (l = e.slice(r, o + 1), r = o + 1), l.length && l !== `
1664
- ` && (t += i), t += l;
1665
- return t;
1547
+ function yn(e, n) {
1548
+ for (var r = F.repeat(" ", n), i = 0, t = -1, o = "", l, a = e.length; i < a; )
1549
+ t = e.indexOf(`
1550
+ `, i), t === -1 ? (l = e.slice(i), i = a) : (l = e.slice(i, t + 1), i = t + 1), l.length && l !== `
1551
+ ` && (o += r), o += l;
1552
+ return o;
1666
1553
  }
1667
- function je(e, n) {
1554
+ function Ue(e, n) {
1668
1555
  return `
1669
1556
  ` + F.repeat(" ", e.indent * n);
1670
1557
  }
1671
- function To(e, n) {
1672
- var i, r, o;
1673
- for (i = 0, r = e.implicitTypes.length; i < r; i += 1)
1674
- if (o = e.implicitTypes[i], o.resolve(n))
1558
+ function Bt(e, n) {
1559
+ var r, i, t;
1560
+ for (r = 0, i = e.implicitTypes.length; r < i; r += 1)
1561
+ if (t = e.implicitTypes[r], t.resolve(n))
1675
1562
  return !0;
1676
1563
  return !1;
1677
1564
  }
1678
- function me(e) {
1679
- return e === fo || e === co;
1565
+ function _e(e) {
1566
+ return e === xt || e === yt;
1680
1567
  }
1681
- function oe(e) {
1682
- return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== Ye || 65536 <= e && e <= 1114111;
1568
+ function he(e) {
1569
+ return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== Ve || 65536 <= e && e <= 1114111;
1683
1570
  }
1684
- function un(e) {
1685
- return oe(e) && e !== Ye && e !== uo && e !== ie;
1571
+ function vn(e) {
1572
+ return he(e) && e !== Ve && e !== vt && e !== pe;
1686
1573
  }
1687
- function fn(e, n, i) {
1688
- var r = un(e), o = r && !me(e);
1574
+ function xn(e, n, r) {
1575
+ var i = vn(e), t = i && !_e(e);
1689
1576
  return (
1690
1577
  // ns-plain-safe
1691
- (i ? (
1578
+ (r ? (
1692
1579
  // c = flow-in
1693
- r
1694
- ) : r && e !== ii && e !== ri && e !== oi && e !== li && e !== ti) && e !== Te && !(n === ge && !o) || un(n) && !me(n) && e === Te || n === ge && o
1580
+ i
1581
+ ) : i && e !== gr && e !== mr && e !== yr && e !== vr && e !== xr) && e !== $e && !(n === Se && !t) || vn(n) && !_e(n) && e === $e || n === Se && t
1695
1582
  );
1696
1583
  }
1697
- function jo(e) {
1698
- return oe(e) && e !== Ye && !me(e) && e !== vo && e !== Ao && e !== ge && e !== ii && e !== ri && e !== oi && e !== li && e !== ti && e !== Te && e !== go && e !== xo && e !== so && e !== _o && e !== yo && e !== wo && e !== mo && e !== po && e !== ho && e !== bo && e !== Co;
1584
+ function $t(e) {
1585
+ return he(e) && e !== Ve && !_e(e) && e !== St && e !== Ft && e !== Se && e !== gr && e !== mr && e !== yr && e !== vr && e !== xr && e !== $e && e !== Ct && e !== Et && e !== wt && e !== jt && e !== _t && e !== Ot && e !== kt && e !== bt && e !== At && e !== Tt && e !== Lt;
1699
1586
  }
1700
- function Io(e) {
1701
- return !me(e) && e !== ge;
1587
+ function Ut(e) {
1588
+ return !_e(e) && e !== Se;
1702
1589
  }
1703
- function ee(e, n) {
1704
- var i = e.charCodeAt(n), r;
1705
- return i >= 55296 && i <= 56319 && n + 1 < e.length && (r = e.charCodeAt(n + 1), r >= 56320 && r <= 57343) ? (i - 55296) * 1024 + r - 56320 + 65536 : i;
1590
+ function ue(e, n) {
1591
+ var r = e.charCodeAt(n), i;
1592
+ return r >= 55296 && r <= 56319 && n + 1 < e.length && (i = e.charCodeAt(n + 1), i >= 56320 && i <= 57343) ? (r - 55296) * 1024 + i - 56320 + 65536 : r;
1706
1593
  }
1707
- function ai(e) {
1594
+ function wr(e) {
1708
1595
  var n = /^\n* /;
1709
1596
  return n.test(e);
1710
1597
  }
1711
- var ci = 1, Ie = 2, ui = 3, fi = 4, q = 5;
1712
- function No(e, n, i, r, o, t, l, a) {
1713
- var c, u = 0, s = null, p = !1, h = !1, d = r !== -1, y = -1, g = jo(ee(e, 0)) && Io(ee(e, e.length - 1));
1598
+ var br = 1, ze = 2, Ar = 3, Cr = 4, ne = 5;
1599
+ function zt(e, n, r, i, t, o, l, a) {
1600
+ var s, c = 0, u = null, f = !1, h = !1, d = i !== -1, m = -1, g = $t(ue(e, 0)) && Ut(ue(e, e.length - 1));
1714
1601
  if (n || l)
1715
- for (c = 0; c < e.length; u >= 65536 ? c += 2 : c++) {
1716
- if (u = ee(e, c), !oe(u))
1717
- return q;
1718
- g = g && fn(u, s, a), s = u;
1602
+ for (s = 0; s < e.length; c >= 65536 ? s += 2 : s++) {
1603
+ if (c = ue(e, s), !he(c))
1604
+ return ne;
1605
+ g = g && xn(c, u, a), u = c;
1719
1606
  }
1720
1607
  else {
1721
- for (c = 0; c < e.length; u >= 65536 ? c += 2 : c++) {
1722
- if (u = ee(e, c), u === ie)
1723
- p = !0, d && (h = h || // Foldable line = too long, and not more-indented.
1724
- c - y - 1 > r && e[y + 1] !== " ", y = c);
1725
- else if (!oe(u))
1726
- return q;
1727
- g = g && fn(u, s, a), s = u;
1608
+ for (s = 0; s < e.length; c >= 65536 ? s += 2 : s++) {
1609
+ if (c = ue(e, s), c === pe)
1610
+ f = !0, d && (h = h || // Foldable line = too long, and not more-indented.
1611
+ s - m - 1 > i && e[m + 1] !== " ", m = s);
1612
+ else if (!he(c))
1613
+ return ne;
1614
+ g = g && xn(c, u, a), u = c;
1728
1615
  }
1729
- h = h || d && c - y - 1 > r && e[y + 1] !== " ";
1616
+ h = h || d && s - m - 1 > i && e[m + 1] !== " ";
1730
1617
  }
1731
- return !p && !h ? g && !l && !o(e) ? ci : t === re ? q : Ie : i > 9 && ai(e) ? q : l ? t === re ? q : Ie : h ? fi : ui;
1618
+ return !f && !h ? g && !l && !t(e) ? br : o === de ? ne : ze : r > 9 && wr(e) ? ne : l ? o === de ? ne : ze : h ? Cr : Ar;
1732
1619
  }
1733
- function Ro(e, n, i, r, o) {
1620
+ function Yt(e, n, r, i, t) {
1734
1621
  e.dump = (function() {
1735
1622
  if (n.length === 0)
1736
- return e.quotingType === re ? '""' : "''";
1737
- if (!e.noCompatMode && (So.indexOf(n) !== -1 || Eo.test(n)))
1738
- return e.quotingType === re ? '"' + n + '"' : "'" + n + "'";
1739
- var t = e.indent * Math.max(1, i), l = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - t), a = r || e.flowLevel > -1 && i >= e.flowLevel;
1740
- function c(u) {
1741
- return To(e, u);
1623
+ return e.quotingType === de ? '""' : "''";
1624
+ if (!e.noCompatMode && (It.indexOf(n) !== -1 || Nt.test(n)))
1625
+ return e.quotingType === de ? '"' + n + '"' : "'" + n + "'";
1626
+ var o = e.indent * Math.max(1, r), l = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - o), a = i || e.flowLevel > -1 && r >= e.flowLevel;
1627
+ function s(c) {
1628
+ return Bt(e, c);
1742
1629
  }
1743
- switch (No(
1630
+ switch (zt(
1744
1631
  n,
1745
1632
  a,
1746
1633
  e.indent,
1747
1634
  l,
1748
- c,
1635
+ s,
1749
1636
  e.quotingType,
1750
- e.forceQuotes && !r,
1751
- o
1637
+ e.forceQuotes && !i,
1638
+ t
1752
1639
  )) {
1753
- case ci:
1640
+ case br:
1754
1641
  return n;
1755
- case Ie:
1642
+ case ze:
1756
1643
  return "'" + n.replace(/'/g, "''") + "'";
1757
- case ui:
1758
- return "|" + sn(n, e.indent) + pn(cn(n, t));
1759
- case fi:
1760
- return ">" + sn(n, e.indent) + pn(cn(Mo(n, l), t));
1761
- case q:
1762
- return '"' + Do(n) + '"';
1644
+ case Ar:
1645
+ return "|" + wn(n, e.indent) + bn(yn(n, o));
1646
+ case Cr:
1647
+ return ">" + wn(n, e.indent) + bn(yn(Ht(n, l), o));
1648
+ case ne:
1649
+ return '"' + Kt(n) + '"';
1763
1650
  default:
1764
1651
  throw new I("impossible error: invalid scalar style");
1765
1652
  }
1766
1653
  })();
1767
1654
  }
1768
- function sn(e, n) {
1769
- var i = ai(e) ? String(n) : "", r = e[e.length - 1] === `
1770
- `, o = r && (e[e.length - 2] === `
1655
+ function wn(e, n) {
1656
+ var r = wr(e) ? String(n) : "", i = e[e.length - 1] === `
1657
+ `, t = i && (e[e.length - 2] === `
1771
1658
  ` || e === `
1772
- `), t = o ? "+" : r ? "" : "-";
1773
- return i + t + `
1659
+ `), o = t ? "+" : i ? "" : "-";
1660
+ return r + o + `
1774
1661
  `;
1775
1662
  }
1776
- function pn(e) {
1663
+ function bn(e) {
1777
1664
  return e[e.length - 1] === `
1778
1665
  ` ? e.slice(0, -1) : e;
1779
1666
  }
1780
- function Mo(e, n) {
1781
- for (var i = /(\n+)([^\n]*)/g, r = (function() {
1782
- var u = e.indexOf(`
1667
+ function Ht(e, n) {
1668
+ for (var r = /(\n+)([^\n]*)/g, i = (function() {
1669
+ var c = e.indexOf(`
1783
1670
  `);
1784
- return u = u !== -1 ? u : e.length, i.lastIndex = u, dn(e.slice(0, u), n);
1785
- })(), o = e[0] === `
1786
- ` || e[0] === " ", t, l; l = i.exec(e); ) {
1787
- var a = l[1], c = l[2];
1788
- t = c[0] === " ", r += a + (!o && !t && c !== "" ? `
1789
- ` : "") + dn(c, n), o = t;
1671
+ return c = c !== -1 ? c : e.length, r.lastIndex = c, An(e.slice(0, c), n);
1672
+ })(), t = e[0] === `
1673
+ ` || e[0] === " ", o, l; l = r.exec(e); ) {
1674
+ var a = l[1], s = l[2];
1675
+ o = s[0] === " ", i += a + (!t && !o && s !== "" ? `
1676
+ ` : "") + An(s, n), t = o;
1790
1677
  }
1791
- return r;
1678
+ return i;
1792
1679
  }
1793
- function dn(e, n) {
1680
+ function An(e, n) {
1794
1681
  if (e === "" || e[0] === " ") return e;
1795
- for (var i = / [^ ]/g, r, o = 0, t, l = 0, a = 0, c = ""; r = i.exec(e); )
1796
- a = r.index, a - o > n && (t = l > o ? l : a, c += `
1797
- ` + e.slice(o, t), o = t + 1), l = a;
1798
- return c += `
1799
- `, e.length - o > n && l > o ? c += e.slice(o, l) + `
1800
- ` + e.slice(l + 1) : c += e.slice(o), c.slice(1);
1801
- }
1802
- function Do(e) {
1803
- for (var n = "", i = 0, r, o = 0; o < e.length; i >= 65536 ? o += 2 : o++)
1804
- i = ee(e, o), r = T[i], !r && oe(i) ? (n += e[o], i >= 65536 && (n += e[o + 1])) : n += r || Fo(i);
1682
+ for (var r = / [^ ]/g, i, t = 0, o, l = 0, a = 0, s = ""; i = r.exec(e); )
1683
+ a = i.index, a - t > n && (o = l > t ? l : a, s += `
1684
+ ` + e.slice(t, o), t = o + 1), l = a;
1685
+ return s += `
1686
+ `, e.length - t > n && l > t ? s += e.slice(t, l) + `
1687
+ ` + e.slice(l + 1) : s += e.slice(t), s.slice(1);
1688
+ }
1689
+ function Kt(e) {
1690
+ for (var n = "", r = 0, i, t = 0; t < e.length; r >= 65536 ? t += 2 : t++)
1691
+ r = ue(e, t), i = L[r], !i && he(r) ? (n += e[t], r >= 65536 && (n += e[t + 1])) : n += i || Mt(r);
1805
1692
  return n;
1806
1693
  }
1807
- function Po(e, n, i) {
1808
- var r = "", o = e.tag, t, l, a;
1809
- for (t = 0, l = i.length; t < l; t += 1)
1810
- a = i[t], e.replacer && (a = e.replacer.call(i, String(t), a)), (Y(e, n, a, !1, !1) || typeof a > "u" && Y(e, n, null, !1, !1)) && (r !== "" && (r += "," + (e.condenseFlow ? "" : " ")), r += e.dump);
1811
- e.tag = o, e.dump = "[" + r + "]";
1812
- }
1813
- function hn(e, n, i, r) {
1814
- var o = "", t = e.tag, l, a, c;
1815
- for (l = 0, a = i.length; l < a; l += 1)
1816
- c = i[l], e.replacer && (c = e.replacer.call(i, String(l), c)), (Y(e, n + 1, c, !0, !0, !1, !0) || typeof c > "u" && Y(e, n + 1, null, !0, !0, !1, !0)) && ((!r || o !== "") && (o += je(e, n)), e.dump && ie === e.dump.charCodeAt(0) ? o += "-" : o += "- ", o += e.dump);
1817
- e.tag = t, e.dump = o || "[]";
1818
- }
1819
- function Bo(e, n, i) {
1820
- var r = "", o = e.tag, t = Object.keys(i), l, a, c, u, s;
1821
- for (l = 0, a = t.length; l < a; l += 1)
1822
- s = "", r !== "" && (s += ", "), e.condenseFlow && (s += '"'), c = t[l], u = i[c], e.replacer && (u = e.replacer.call(i, c, u)), Y(e, n, c, !1, !1) && (e.dump.length > 1024 && (s += "? "), s += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), Y(e, n, u, !1, !1) && (s += e.dump, r += s));
1823
- e.tag = o, e.dump = "{" + r + "}";
1824
- }
1825
- function Yo(e, n, i, r) {
1826
- var o = "", t = e.tag, l = Object.keys(i), a, c, u, s, p, h;
1694
+ function Wt(e, n, r) {
1695
+ var i = "", t = e.tag, o, l, a;
1696
+ for (o = 0, l = r.length; o < l; o += 1)
1697
+ a = r[o], e.replacer && (a = e.replacer.call(r, String(o), a)), (K(e, n, a, !1, !1) || typeof a > "u" && K(e, n, null, !1, !1)) && (i !== "" && (i += "," + (e.condenseFlow ? "" : " ")), i += e.dump);
1698
+ e.tag = t, e.dump = "[" + i + "]";
1699
+ }
1700
+ function Cn(e, n, r, i) {
1701
+ var t = "", o = e.tag, l, a, s;
1702
+ for (l = 0, a = r.length; l < a; l += 1)
1703
+ s = r[l], e.replacer && (s = e.replacer.call(r, String(l), s)), (K(e, n + 1, s, !0, !0, !1, !0) || typeof s > "u" && K(e, n + 1, null, !0, !0, !1, !0)) && ((!i || t !== "") && (t += Ue(e, n)), e.dump && pe === e.dump.charCodeAt(0) ? t += "-" : t += "- ", t += e.dump);
1704
+ e.tag = o, e.dump = t || "[]";
1705
+ }
1706
+ function qt(e, n, r) {
1707
+ var i = "", t = e.tag, o = Object.keys(r), l, a, s, c, u;
1708
+ for (l = 0, a = o.length; l < a; l += 1)
1709
+ u = "", i !== "" && (u += ", "), e.condenseFlow && (u += '"'), s = o[l], c = r[s], e.replacer && (c = e.replacer.call(r, s, c)), K(e, n, s, !1, !1) && (e.dump.length > 1024 && (u += "? "), u += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), K(e, n, c, !1, !1) && (u += e.dump, i += u));
1710
+ e.tag = t, e.dump = "{" + i + "}";
1711
+ }
1712
+ function Gt(e, n, r, i) {
1713
+ var t = "", o = e.tag, l = Object.keys(r), a, s, c, u, f, h;
1827
1714
  if (e.sortKeys === !0)
1828
1715
  l.sort();
1829
1716
  else if (typeof e.sortKeys == "function")
1830
1717
  l.sort(e.sortKeys);
1831
1718
  else if (e.sortKeys)
1832
1719
  throw new I("sortKeys must be a boolean or a function");
1833
- for (a = 0, c = l.length; a < c; a += 1)
1834
- h = "", (!r || o !== "") && (h += je(e, n)), u = l[a], s = i[u], e.replacer && (s = e.replacer.call(i, u, s)), Y(e, n + 1, u, !0, !0, !0) && (p = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, p && (e.dump && ie === e.dump.charCodeAt(0) ? h += "?" : h += "? "), h += e.dump, p && (h += je(e, n)), Y(e, n + 1, s, !0, p) && (e.dump && ie === e.dump.charCodeAt(0) ? h += ":" : h += ": ", h += e.dump, o += h));
1835
- e.tag = t, e.dump = o || "{}";
1836
- }
1837
- function gn(e, n, i) {
1838
- var r, o, t, l, a, c;
1839
- for (o = i ? e.explicitTypes : e.implicitTypes, t = 0, l = o.length; t < l; t += 1)
1840
- if (a = o[t], (a.instanceOf || a.predicate) && (!a.instanceOf || typeof n == "object" && n instanceof a.instanceOf) && (!a.predicate || a.predicate(n))) {
1841
- if (i ? a.multi && a.representName ? e.tag = a.representName(n) : e.tag = a.tag : e.tag = "?", a.represent) {
1842
- if (c = e.styleMap[a.tag] || a.defaultStyle, ei.call(a.represent) === "[object Function]")
1843
- r = a.represent(n, c);
1844
- else if (ni.call(a.represent, c))
1845
- r = a.represent[c](n, c);
1720
+ for (a = 0, s = l.length; a < s; a += 1)
1721
+ h = "", (!i || t !== "") && (h += Ue(e, n)), c = l[a], u = r[c], e.replacer && (u = e.replacer.call(r, c, u)), K(e, n + 1, c, !0, !0, !0) && (f = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, f && (e.dump && pe === e.dump.charCodeAt(0) ? h += "?" : h += "? "), h += e.dump, f && (h += Ue(e, n)), K(e, n + 1, u, !0, f) && (e.dump && pe === e.dump.charCodeAt(0) ? h += ":" : h += ": ", h += e.dump, t += h));
1722
+ e.tag = o, e.dump = t || "{}";
1723
+ }
1724
+ function kn(e, n, r) {
1725
+ var i, t, o, l, a, s;
1726
+ for (t = r ? e.explicitTypes : e.implicitTypes, o = 0, l = t.length; o < l; o += 1)
1727
+ if (a = t[o], (a.instanceOf || a.predicate) && (!a.instanceOf || typeof n == "object" && n instanceof a.instanceOf) && (!a.predicate || a.predicate(n))) {
1728
+ if (r ? a.multi && a.representName ? e.tag = a.representName(n) : e.tag = a.tag : e.tag = "?", a.represent) {
1729
+ if (s = e.styleMap[a.tag] || a.defaultStyle, dr.call(a.represent) === "[object Function]")
1730
+ i = a.represent(n, s);
1731
+ else if (hr.call(a.represent, s))
1732
+ i = a.represent[s](n, s);
1846
1733
  else
1847
- throw new I("!<" + a.tag + '> tag resolver accepts not "' + c + '" style');
1848
- e.dump = r;
1734
+ throw new I("!<" + a.tag + '> tag resolver accepts not "' + s + '" style');
1735
+ e.dump = i;
1849
1736
  }
1850
1737
  return !0;
1851
1738
  }
1852
1739
  return !1;
1853
1740
  }
1854
- function Y(e, n, i, r, o, t, l) {
1855
- e.tag = null, e.dump = i, gn(e, i, !1) || gn(e, i, !0);
1856
- var a = ei.call(e.dump), c = r, u;
1857
- r && (r = e.flowLevel < 0 || e.flowLevel > n);
1858
- var s = a === "[object Object]" || a === "[object Array]", p, h;
1859
- if (s && (p = e.duplicates.indexOf(i), h = p !== -1), (e.tag !== null && e.tag !== "?" || h || e.indent !== 2 && n > 0) && (o = !1), h && e.usedDuplicates[p])
1860
- e.dump = "*ref_" + p;
1741
+ function K(e, n, r, i, t, o, l) {
1742
+ e.tag = null, e.dump = r, kn(e, r, !1) || kn(e, r, !0);
1743
+ var a = dr.call(e.dump), s = i, c;
1744
+ i && (i = e.flowLevel < 0 || e.flowLevel > n);
1745
+ var u = a === "[object Object]" || a === "[object Array]", f, h;
1746
+ if (u && (f = e.duplicates.indexOf(r), h = f !== -1), (e.tag !== null && e.tag !== "?" || h || e.indent !== 2 && n > 0) && (t = !1), h && e.usedDuplicates[f])
1747
+ e.dump = "*ref_" + f;
1861
1748
  else {
1862
- if (s && h && !e.usedDuplicates[p] && (e.usedDuplicates[p] = !0), a === "[object Object]")
1863
- r && Object.keys(e.dump).length !== 0 ? (Yo(e, n, e.dump, o), h && (e.dump = "&ref_" + p + e.dump)) : (Bo(e, n, e.dump), h && (e.dump = "&ref_" + p + " " + e.dump));
1749
+ if (u && h && !e.usedDuplicates[f] && (e.usedDuplicates[f] = !0), a === "[object Object]")
1750
+ i && Object.keys(e.dump).length !== 0 ? (Gt(e, n, e.dump, t), h && (e.dump = "&ref_" + f + e.dump)) : (qt(e, n, e.dump), h && (e.dump = "&ref_" + f + " " + e.dump));
1864
1751
  else if (a === "[object Array]")
1865
- r && e.dump.length !== 0 ? (e.noArrayIndent && !l && n > 0 ? hn(e, n - 1, e.dump, o) : hn(e, n, e.dump, o), h && (e.dump = "&ref_" + p + e.dump)) : (Po(e, n, e.dump), h && (e.dump = "&ref_" + p + " " + e.dump));
1752
+ i && e.dump.length !== 0 ? (e.noArrayIndent && !l && n > 0 ? Cn(e, n - 1, e.dump, t) : Cn(e, n, e.dump, t), h && (e.dump = "&ref_" + f + e.dump)) : (Wt(e, n, e.dump), h && (e.dump = "&ref_" + f + " " + e.dump));
1866
1753
  else if (a === "[object String]")
1867
- e.tag !== "?" && Ro(e, e.dump, n, t, c);
1754
+ e.tag !== "?" && Yt(e, e.dump, n, o, s);
1868
1755
  else {
1869
1756
  if (a === "[object Undefined]")
1870
1757
  return !1;
1871
1758
  if (e.skipInvalid) return !1;
1872
1759
  throw new I("unacceptable kind of an object to dump " + a);
1873
1760
  }
1874
- e.tag !== null && e.tag !== "?" && (u = encodeURI(
1761
+ e.tag !== null && e.tag !== "?" && (c = encodeURI(
1875
1762
  e.tag[0] === "!" ? e.tag.slice(1) : e.tag
1876
- ).replace(/!/g, "%21"), e.tag[0] === "!" ? u = "!" + u : u.slice(0, 18) === "tag:yaml.org,2002:" ? u = "!!" + u.slice(18) : u = "!<" + u + ">", e.dump = u + " " + e.dump);
1763
+ ).replace(/!/g, "%21"), e.tag[0] === "!" ? c = "!" + c : c.slice(0, 18) === "tag:yaml.org,2002:" ? c = "!!" + c.slice(18) : c = "!<" + c + ">", e.dump = c + " " + e.dump);
1877
1764
  }
1878
1765
  return !0;
1879
1766
  }
1880
- function zo(e, n) {
1881
- var i = [], r = [], o, t;
1882
- for (Ne(e, i, r), o = 0, t = r.length; o < t; o += 1)
1883
- n.duplicates.push(i[r[o]]);
1884
- n.usedDuplicates = new Array(t);
1767
+ function Vt(e, n) {
1768
+ var r = [], i = [], t, o;
1769
+ for (Ye(e, r, i), t = 0, o = i.length; t < o; t += 1)
1770
+ n.duplicates.push(r[i[t]]);
1771
+ n.usedDuplicates = new Array(o);
1885
1772
  }
1886
- function Ne(e, n, i) {
1887
- var r, o, t;
1773
+ function Ye(e, n, r) {
1774
+ var i, t, o;
1888
1775
  if (e !== null && typeof e == "object")
1889
- if (o = n.indexOf(e), o !== -1)
1890
- i.indexOf(o) === -1 && i.push(o);
1776
+ if (t = n.indexOf(e), t !== -1)
1777
+ r.indexOf(t) === -1 && r.push(t);
1891
1778
  else if (n.push(e), Array.isArray(e))
1892
- for (o = 0, t = e.length; o < t; o += 1)
1893
- Ne(e[o], n, i);
1779
+ for (t = 0, o = e.length; t < o; t += 1)
1780
+ Ye(e[t], n, r);
1894
1781
  else
1895
- for (r = Object.keys(e), o = 0, t = r.length; o < t; o += 1)
1896
- Ne(e[r[o]], n, i);
1782
+ for (i = Object.keys(e), t = 0, o = i.length; t < o; t += 1)
1783
+ Ye(e[i[t]], n, r);
1897
1784
  }
1898
- function Ho(e, n) {
1785
+ function Xt(e, n) {
1899
1786
  n = n || {};
1900
- var i = new ko(n);
1901
- i.noRefs || zo(e, i);
1902
- var r = e;
1903
- return i.replacer && (r = i.replacer.call({ "": r }, "", r)), Y(i, 0, r, !0, !0) ? i.dump + `
1787
+ var r = new Dt(n);
1788
+ r.noRefs || Vt(e, r);
1789
+ var i = e;
1790
+ return r.replacer && (i = r.replacer.call({ "": i }, "", i)), K(r, 0, i, !0, !0) ? r.dump + `
1904
1791
  ` : "";
1905
1792
  }
1906
- var Uo = Ho, $o = {
1907
- dump: Uo
1793
+ var Qt = Xt, Jt = {
1794
+ dump: Qt
1908
1795
  };
1909
- function ze(e, n) {
1796
+ function Xe(e, n) {
1910
1797
  return function() {
1911
1798
  throw new Error("Function yaml." + e + " is removed in js-yaml 4. Use yaml." + n + " instead, which is now safe by default.");
1912
1799
  };
1913
1800
  }
1914
- var Ko = k, Wo = Sn, Go = Ln, qo = Nn, Vo = Rn, Xo = De, Qo = Zn.load, Jo = Zn.loadAll, Zo = $o.dump, el = I, nl = {
1915
- binary: Yn,
1916
- float: In,
1917
- map: Fn,
1918
- null: kn,
1919
- pairs: Hn,
1920
- set: Un,
1921
- timestamp: Pn,
1922
- bool: Tn,
1923
- int: jn,
1924
- merge: Bn,
1925
- omap: zn,
1926
- seq: On,
1927
- str: En
1928
- }, il = ze("safeLoad", "load"), rl = ze("safeLoadAll", "loadAll"), ol = ze("safeDump", "dump"), mn = {
1929
- Type: Ko,
1930
- Schema: Wo,
1931
- FAILSAFE_SCHEMA: Go,
1932
- JSON_SCHEMA: qo,
1933
- CORE_SCHEMA: Vo,
1934
- DEFAULT_SCHEMA: Xo,
1935
- load: Qo,
1936
- loadAll: Jo,
1937
- dump: Zo,
1938
- YAMLException: el,
1939
- types: nl,
1940
- safeLoad: il,
1941
- safeLoadAll: rl,
1942
- safeDump: ol
1801
+ var Zt = T, eo = Dn, no = zn, ro = qn, io = Gn, to = We, oo = pr.load, lo = pr.loadAll, ao = Jt.dump, so = I, co = {
1802
+ binary: Zn,
1803
+ float: Wn,
1804
+ map: Un,
1805
+ null: Yn,
1806
+ pairs: nr,
1807
+ set: rr,
1808
+ timestamp: Qn,
1809
+ bool: Hn,
1810
+ int: Kn,
1811
+ merge: Jn,
1812
+ omap: er,
1813
+ seq: $n,
1814
+ str: Bn
1815
+ }, uo = Xe("safeLoad", "load"), fo = Xe("safeLoadAll", "loadAll"), po = Xe("safeDump", "dump"), En = {
1816
+ Type: Zt,
1817
+ Schema: eo,
1818
+ FAILSAFE_SCHEMA: no,
1819
+ JSON_SCHEMA: ro,
1820
+ CORE_SCHEMA: io,
1821
+ DEFAULT_SCHEMA: to,
1822
+ load: oo,
1823
+ loadAll: lo,
1824
+ dump: ao,
1825
+ YAMLException: so,
1826
+ types: co,
1827
+ safeLoad: uo,
1828
+ safeLoadAll: fo,
1829
+ safeDump: po
1943
1830
  };
1944
- const ue = (e, n) => {
1831
+ const be = (e) => e instanceof Error ? e.message : String(e), Ae = (e, n) => {
1945
1832
  if (e && typeof e == "object" && !Array.isArray(e))
1946
1833
  return e;
1947
1834
  throw new Error(`Parsed --strings as ${n}, but it was not an object.`);
1948
- }, fe = (e) => e instanceof Error ? e.message : String(e), se = (e, n) => {
1949
- const i = e.trim();
1950
- if (!i)
1835
+ }, ho = (e, n) => {
1836
+ const r = e.trim();
1837
+ if (!r)
1951
1838
  return {};
1952
1839
  if (n === "json")
1953
1840
  try {
1954
- return ue(Le.parse(i), "json");
1955
- } catch (o) {
1956
- throw new Error(`Failed to parse --strings as JSON. Hint: check --strings-format=json. ${fe(o)}`);
1841
+ return Ae(De.parse(r), "json");
1842
+ } catch (t) {
1843
+ throw new Error(`Failed to parse --strings as JSON. Hint: check --strings-format=json. ${be(t)}`);
1957
1844
  }
1958
1845
  if (n === "yaml")
1959
1846
  try {
1960
- return ue(mn.load(i), "yaml");
1961
- } catch (o) {
1962
- throw new Error(`Failed to parse --strings as YAML. Hint: check --strings-format=yaml. ${fe(o)}`);
1847
+ return Ae(En.load(r), "yaml");
1848
+ } catch (t) {
1849
+ throw new Error(`Failed to parse --strings as YAML. Hint: check --strings-format=yaml. ${be(t)}`);
1963
1850
  }
1964
- const r = [];
1851
+ const i = [];
1965
1852
  try {
1966
- return ue(mn.load(i), "yaml");
1967
- } catch (o) {
1968
- r.push(`yaml error: ${fe(o)}`);
1853
+ return Ae(En.load(r), "yaml");
1854
+ } catch (t) {
1855
+ i.push(`yaml error: ${be(t)}`);
1969
1856
  }
1970
1857
  try {
1971
- return ue(Le.parse(i), "json");
1972
- } catch (o) {
1973
- r.push(`json error: ${fe(o)}`);
1858
+ return Ae(De.parse(r), "json");
1859
+ } catch (t) {
1860
+ i.push(`json error: ${be(t)}`);
1974
1861
  }
1975
- throw new Error(`Failed to parse --strings input. Provide valid YAML or JSON, or specify --strings-format. ${r.join(" | ")}`);
1862
+ throw new Error(`Failed to parse --strings input. Provide valid YAML or JSON, or specify --strings-format. ${i.join(" | ")}`);
1976
1863
  };
1977
- async function si() {
1864
+ async function kr() {
1978
1865
  return new Promise((e) => {
1979
1866
  let n = "";
1980
- process.stdin.setEncoding("utf8"), process.stdin.on("data", (i) => {
1981
- n += i;
1867
+ process.stdin.setEncoding("utf8"), process.stdin.on("data", (r) => {
1868
+ n += r;
1982
1869
  }), process.stdin.on("end", () => {
1983
1870
  e(n);
1984
1871
  }), process.stdin.readableEnded && e("");
1985
1872
  });
1986
1873
  }
1987
- async function ll(e, n = si, i = "auto") {
1988
- if (e !== void 0) {
1989
- if (e === "") {
1990
- const r = await n();
1991
- return r.trim() ? se(r, i) : void 0;
1992
- }
1993
- if (typeof e == "string")
1994
- return se(e, i);
1995
- if (Array.isArray(e)) {
1996
- const r = {};
1997
- for (const o of e)
1998
- typeof o == "string" && Object.assign(r, se(o, i));
1999
- return r;
2000
- }
2001
- if (typeof e == "boolean" && e === !0) {
2002
- const r = await n();
2003
- return r.trim() ? se(r, i) : void 0;
1874
+ const Er = (e, n) => {
1875
+ if (e === void 0) return;
1876
+ if (!e || typeof e != "object" || Array.isArray(e))
1877
+ throw new Error(`${n} must be an object of language -> text.`);
1878
+ const r = {};
1879
+ for (const [i, t] of Object.entries(e)) {
1880
+ if (typeof t != "string")
1881
+ throw new Error(`${n} for "${i}" must be a string.`);
1882
+ r[i] = t;
1883
+ }
1884
+ return r;
1885
+ }, go = (e, n) => {
1886
+ if (e == null)
1887
+ return {};
1888
+ if (typeof e == "string")
1889
+ return { comment: e };
1890
+ if (typeof e != "object" || Array.isArray(e))
1891
+ throw new Error(`Value for "${n}" must be an object.`);
1892
+ const r = e, i = {};
1893
+ typeof r.comment == "string" && (i.comment = r.comment);
1894
+ const t = Er(r.translations, `translations for "${n}"`) || {}, o = {};
1895
+ for (const [a, s] of Object.entries(r))
1896
+ a === "comment" || a === "translations" || typeof s == "string" && (o[a] = s);
1897
+ const l = { ...t, ...o };
1898
+ return Object.keys(l).length > 0 && (i.translations = l), i;
1899
+ }, mo = (e) => Object.values(e).every((n) => typeof n == "string"), yo = (e) => {
1900
+ if (mo(e))
1901
+ return { kind: "single", translations: e };
1902
+ if (Object.keys(e).every((i) => i === "translations" || i === "comment") && "translations" in e) {
1903
+ const i = Er(e.translations, "translations") || {}, t = typeof e.comment == "string" ? e.comment : void 0;
1904
+ return { kind: "single", translations: i, comment: t };
1905
+ }
1906
+ const r = {};
1907
+ for (const [i, t] of Object.entries(e))
1908
+ r[i] = go(t, i);
1909
+ return { kind: "multi", entries: r };
1910
+ }, vo = (e, n) => {
1911
+ if (!e) return n;
1912
+ if (e.kind !== n.kind)
1913
+ throw new Error("Cannot merge single and multi --strings payloads. Provide one consistent shape.");
1914
+ if (e.kind === "single" && n.kind === "single")
1915
+ return {
1916
+ kind: "single",
1917
+ translations: { ...e.translations, ...n.translations },
1918
+ comment: e.comment ?? n.comment
1919
+ };
1920
+ if (e.kind === "multi" && n.kind === "multi") {
1921
+ const r = { ...e.entries };
1922
+ for (const [i, t] of Object.entries(n.entries)) {
1923
+ const o = r[i] || {};
1924
+ r[i] = {
1925
+ comment: t.comment ?? o.comment,
1926
+ translations: { ...o.translations || {}, ...t.translations || {} }
1927
+ };
2004
1928
  }
1929
+ return { kind: "multi", entries: r };
1930
+ }
1931
+ return e;
1932
+ };
1933
+ async function xo(e, n = kr, r = "auto") {
1934
+ if (e === void 0)
1935
+ return;
1936
+ const i = async (t) => {
1937
+ if (t.trim())
1938
+ return yo(ho(t, r));
1939
+ };
1940
+ if (e === "") {
1941
+ const t = await n();
1942
+ return i(t);
1943
+ }
1944
+ if (typeof e == "string")
1945
+ return i(e);
1946
+ if (Array.isArray(e)) {
1947
+ let t;
1948
+ for (const o of e)
1949
+ if (typeof o == "string") {
1950
+ const l = await i(o);
1951
+ l && (t = vo(t, l));
1952
+ }
1953
+ return t;
1954
+ }
1955
+ if (typeof e == "boolean" && e === !0) {
1956
+ const t = await n();
1957
+ return i(t);
2005
1958
  }
2006
1959
  }
2007
- async function tl({
1960
+ async function wo({
2008
1961
  path: e,
2009
1962
  key: n,
2010
- comment: i,
2011
- stringsArg: r,
2012
- stringsFormat: o,
2013
- defaultString: t,
1963
+ comment: r,
1964
+ stringsArg: i,
1965
+ stringsFormat: t,
1966
+ defaultString: o,
2014
1967
  language: l,
2015
- stdinReader: a = si,
2016
- configPath: c
1968
+ stdinReader: a = kr,
1969
+ configPath: s
2017
1970
  }) {
2018
- const u = await ll(r, a, o);
2019
- await Fi(e, n, i, u, c, t, l);
1971
+ const c = await xo(i, a, t);
1972
+ if (c?.kind === "multi") {
1973
+ if (n || r || o !== void 0 || l)
1974
+ throw new Error("When adding multiple strings via --strings payload, omit --key, --comment, --text, and --language.");
1975
+ const d = [];
1976
+ for (const [m, g] of Object.entries(c.entries))
1977
+ await Sn(e, m, g.comment, g.translations, s, void 0, void 0), d.push(m);
1978
+ return { kind: "multi", keys: d };
1979
+ }
1980
+ const u = n;
1981
+ if (!u)
1982
+ throw new Error("--key is required unless the --strings payload contains multiple keys.");
1983
+ const f = c?.kind === "single" ? c.translations : void 0, h = c?.kind === "single" ? c.comment : void 0;
1984
+ return await Sn(e, u, r ?? h, f, s, o, l), { kind: "single", keys: [u] };
1985
+ }
1986
+ function bo() {
1987
+ return {
1988
+ command: "add",
1989
+ describe: "Add a string",
1990
+ builder: (e) => e.option("key", {
1991
+ type: "string",
1992
+ describe: "The key of the string (omit when adding multiple keys via --strings)",
1993
+ demandOption: !1
1994
+ }).option("comment", {
1995
+ type: "string",
1996
+ describe: "The comment for the string"
1997
+ }).option("language", {
1998
+ type: "string",
1999
+ alias: "l",
2000
+ describe: "The language of the string provided with --text"
2001
+ }).option("text", {
2002
+ type: "string",
2003
+ describe: "The string value for the default language"
2004
+ }).option("strings", {
2005
+ type: "string",
2006
+ describe: "The strings JSON or YAML"
2007
+ }).option("strings-format", {
2008
+ type: "string",
2009
+ choices: ["auto", "json", "yaml"],
2010
+ default: "auto",
2011
+ describe: "Format for the data provided with --strings"
2012
+ }),
2013
+ handler: async (e) => {
2014
+ const n = await wo({
2015
+ path: e.path,
2016
+ key: e.key,
2017
+ comment: e.comment,
2018
+ stringsArg: e.strings,
2019
+ stringsFormat: e["strings-format"],
2020
+ defaultString: e.text,
2021
+ language: e.language,
2022
+ stdinReader: void 0,
2023
+ configPath: e.config
2024
+ });
2025
+ V.info(k.green(`✓ Added keys:
2026
+ ${n.keys.map((r) => `- ${r}`).join(`
2027
+ `)}`));
2028
+ }
2029
+ };
2020
2030
  }
2021
- function xn(e, n) {
2022
- if (!e || e.length === 0) return null;
2023
- for (const i of e)
2024
- if (typeof i != "string" && i.alias === n)
2025
- return i.path;
2026
- return null;
2031
+ async function Sn(e, n, r, i, t, o, l) {
2032
+ const a = await me(e);
2033
+ if (!a.sourceLanguage)
2034
+ throw new Error('The xcstrings file is missing "sourceLanguage".');
2035
+ const s = a.sourceLanguage;
2036
+ a.strings || (a.strings = {});
2037
+ const u = (await He(t))?.missingLanguagePolicy || "skip";
2038
+ let f;
2039
+ const h = async (b) => u === "include" ? !0 : (f || (f = await Rn(e, t)), f.includes(b)), d = (b) => {
2040
+ V.warn(`Language "${b}" is not supported. Skipped adding its translation (missingLanguagePolicy=skip).`);
2041
+ }, m = {
2042
+ ...a.strings[n],
2043
+ extractionState: "manual"
2044
+ };
2045
+ if (r && (m.comment = r), o !== void 0) {
2046
+ const b = l ?? s;
2047
+ await h(b) ? (m.localizations = m.localizations || {}, m.localizations[b] = {
2048
+ stringUnit: {
2049
+ state: "translated",
2050
+ value: o
2051
+ }
2052
+ }) : d(b);
2053
+ }
2054
+ const g = i ? { ...i } : void 0;
2055
+ if (g) {
2056
+ const b = [];
2057
+ for (const [C, x] of Object.entries(g)) {
2058
+ if (o !== void 0 && C === (l ?? s))
2059
+ continue;
2060
+ (u === "include" ? !0 : C === s || await h(C)) ? b.push([C, x]) : d(C);
2061
+ }
2062
+ if (b.length > 0) {
2063
+ m.localizations = m.localizations || {};
2064
+ for (const [C, x] of b)
2065
+ m.localizations[C] = {
2066
+ stringUnit: {
2067
+ state: "translated",
2068
+ value: x
2069
+ }
2070
+ };
2071
+ }
2072
+ }
2073
+ a.strings[n] = m, await Nn(e, a);
2074
+ }
2075
+ function Ao() {
2076
+ return {
2077
+ command: "remove",
2078
+ describe: "Remove a string",
2079
+ builder: (e) => e.option("key", {
2080
+ type: "string",
2081
+ describe: "The key to remove",
2082
+ alias: "k"
2083
+ }).option("languages", {
2084
+ type: "string",
2085
+ array: !0,
2086
+ describe: "Languages to remove",
2087
+ alias: "l"
2088
+ }).option("dry-run", {
2089
+ type: "boolean",
2090
+ default: !1,
2091
+ describe: "Show what would be removed without writing changes",
2092
+ alias: "n"
2093
+ }).check((n) => {
2094
+ if (n.key || n.languages && n.languages.length > 0)
2095
+ return !0;
2096
+ throw new Error("Either --key or --languages must be provided");
2097
+ }),
2098
+ handler: async (e) => {
2099
+ const n = await ko(
2100
+ e.path,
2101
+ e.key,
2102
+ e.languages,
2103
+ e.dryRun === !0
2104
+ ), r = Object.entries(n).map(([i, t]) => `- [${t.join(" ")}] ${i}`).join(`
2105
+ `);
2106
+ if (e.dryRun) {
2107
+ r.length === 0 ? V.info(k.yellow("No matching strings found.")) : V.info(k.blue(`Would remove:
2108
+ ${r}`));
2109
+ return;
2110
+ }
2111
+ r.length === 0 ? V.info(k.yellow("No matching strings found.")) : V.info(k.green(`✓ Removed
2112
+ ${r}`));
2113
+ }
2114
+ };
2027
2115
  }
2028
- async function al(e, n, i) {
2029
- const r = n?.xcstringsPaths, o = r?.some((c) => typeof c != "string") ?? !1, t = e.startsWith("alias:") ? e.slice(6) : null;
2030
- if (t) {
2031
- const c = xn(r, t);
2032
- if (!c)
2033
- throw new Error(`Unknown alias: ${t}`);
2034
- return c;
2116
+ function Co(e, n, r, i, t) {
2117
+ if (e.localizations) {
2118
+ for (const o of n)
2119
+ e.localizations[o] && (t[i] ??= [], t[i].push(o), r || delete e.localizations[o]);
2120
+ !r && e.localizations && Object.keys(e.localizations).length === 0 && delete e.localizations;
2035
2121
  }
2036
- const l = xn(r, e);
2037
- if (l)
2038
- return l;
2039
- const a = !e.includes("/") && !e.endsWith(".xcstrings");
2040
- if (o && a)
2041
- throw new Error(`Unknown alias: ${e}`);
2042
- if (e === i && r && r.length > 0) {
2043
- if (r.length === 1) {
2044
- const s = r[0];
2045
- return typeof s == "string" ? s : s.path;
2122
+ }
2123
+ async function ko(e, n, r, i = !1) {
2124
+ const t = await me(e), o = {}, l = t.strings || {};
2125
+ t.strings = l;
2126
+ const a = n ? [n] : Object.keys(l);
2127
+ let s = !1;
2128
+ for (const c of a) {
2129
+ const u = l[c];
2130
+ if (!u)
2131
+ continue;
2132
+ if (!r || r.length === 0) {
2133
+ const d = Object.keys(u.localizations ?? {});
2134
+ o[c] = d, i || delete l[c], s = !0;
2135
+ continue;
2046
2136
  }
2047
- const c = r.map((s) => typeof s == "string" ? { name: s, value: s } : { name: `${s.alias} (${s.path})`, value: s.path });
2048
- return await _i({
2049
- message: "Select xcstrings file:",
2137
+ Co(u, r, i, c, o);
2138
+ const f = o[c]?.length ?? 0;
2139
+ !(u.localizations && Object.keys(u.localizations).length > 0) && f > 0 && (i || delete l[c]), f > 0 && (s = !0);
2140
+ }
2141
+ return !i && s && await Nn(e, t), o;
2142
+ }
2143
+ const Me = "xcstrings-cli.json5";
2144
+ function Eo() {
2145
+ return {
2146
+ command: "init",
2147
+ describe: "Initialize configuration file",
2148
+ handler: async () => {
2149
+ await Oo();
2150
+ }
2151
+ };
2152
+ }
2153
+ async function So(e) {
2154
+ const n = [];
2155
+ async function r(i) {
2156
+ try {
2157
+ const t = await In(i, { withFileTypes: !0 });
2158
+ for (const o of t) {
2159
+ const l = Oe(i, o.name);
2160
+ o.isDirectory() ? !o.name.startsWith(".") && o.name !== "node_modules" && await r(l) : o.name.endsWith(".xcstrings") && n.push(l);
2161
+ }
2162
+ } catch {
2163
+ }
2164
+ }
2165
+ return await r(e), n;
2166
+ }
2167
+ async function _o(e) {
2168
+ const n = [];
2169
+ let r = e;
2170
+ try {
2171
+ const i = await In(r, { withFileTypes: !0 });
2172
+ for (const t of i)
2173
+ t.isDirectory() && t.name.endsWith(".xcodeproj") && n.push(Oe(r, t.name));
2174
+ } catch {
2175
+ }
2176
+ return n;
2177
+ }
2178
+ async function Oo() {
2179
+ const e = process.cwd();
2180
+ console.log(), console.log(k.bold.cyan("🚀 xcstrings-cli Configuration Setup")), console.log(k.dim("─".repeat(40))), console.log(), console.log(k.yellow("🔍 Searching for .xcstrings files..."));
2181
+ const n = await So(e);
2182
+ console.log(k.yellow("🔍 Searching for .xcodeproj directories..."));
2183
+ const r = await _o(e);
2184
+ console.log();
2185
+ let i = [];
2186
+ if (n.length > 0) {
2187
+ console.log(k.green(`✓ Found ${n.length} .xcstrings file(s)`)), console.log();
2188
+ const c = n.map((u) => ({
2189
+ name: k.white(we(e, u)) + k.dim(` (${u})`),
2190
+ value: we(e, u),
2191
+ checked: !0
2192
+ }));
2193
+ i = await on({
2194
+ message: k.bold("Select .xcstrings files to manage:"),
2050
2195
  choices: c
2051
2196
  });
2197
+ } else
2198
+ console.log(k.dim(" No .xcstrings files found in current directory"));
2199
+ console.log();
2200
+ let t = [];
2201
+ if (r.length > 0) {
2202
+ console.log(k.green(`✓ Found ${r.length} .xcodeproj director${r.length === 1 ? "y" : "ies"}`)), console.log();
2203
+ const c = r.map((u) => ({
2204
+ name: k.white(we(e, u) || u) + k.dim(` (${u})`),
2205
+ value: we(e, u) || u,
2206
+ checked: !0
2207
+ }));
2208
+ t = await on({
2209
+ message: k.bold("Select .xcodeproj directories for language detection:"),
2210
+ choices: c
2211
+ });
2212
+ } else
2213
+ console.log(k.dim(" No .xcodeproj directories found"));
2214
+ if (console.log(), console.log(k.dim("─".repeat(40))), console.log(), console.log(k.bold("📋 Configuration Summary:")), console.log(), console.log(k.cyan(" xcstringsPaths:")), i.length > 0 ? i.forEach((c) => console.log(k.white(` • ${c}`))) : console.log(k.dim(" (none)")), console.log(), console.log(k.cyan(" xcodeprojPaths:")), t.length > 0 ? t.forEach((c) => console.log(k.white(` • ${c}`))) : console.log(k.dim(" (none)")), console.log(), !await Rr({
2215
+ message: k.bold(`Create ${k.yellow(Me)}?`),
2216
+ default: !0
2217
+ })) {
2218
+ console.log(k.dim(" Configuration cancelled."));
2219
+ return;
2052
2220
  }
2053
- return e;
2221
+ const l = i.map((c) => ` "${c}"`).join(`,
2222
+ `), a = t.map((c) => ` "${c}"`).join(`,
2223
+ `), s = `{
2224
+ // Paths to .xcstrings files to manage. Specify relative or absolute paths.
2225
+ xcstringsPaths: [
2226
+ ${l}
2227
+ ],
2228
+ // Paths to .xcodeproj directories. Used for discovering supported languages.
2229
+ xcodeprojPaths: [
2230
+ ${a}
2231
+ ],
2232
+ // Behavior for handling missing languages when adding strings.
2233
+ missingLanguagePolicy: "skip",
2234
+ }
2235
+ `;
2236
+ await jn(Me, s, "utf-8"), console.log(), console.log(k.bold.green(`✓ Created ${Me}`)), console.log(k.dim(` Run ${k.cyan("xcstrings --help")} to see available commands.`)), console.log();
2237
+ }
2238
+ var Fo = Object.prototype.toString, le = Array.isArray || function(n) {
2239
+ return Fo.call(n) === "[object Array]";
2240
+ };
2241
+ function Qe(e) {
2242
+ return typeof e == "function";
2243
+ }
2244
+ function To(e) {
2245
+ return le(e) ? "array" : typeof e;
2246
+ }
2247
+ function Pe(e) {
2248
+ return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
2249
+ }
2250
+ function _n(e, n) {
2251
+ return e != null && typeof e == "object" && n in e;
2252
+ }
2253
+ function Lo(e, n) {
2254
+ return e != null && typeof e != "object" && e.hasOwnProperty && e.hasOwnProperty(n);
2255
+ }
2256
+ var jo = RegExp.prototype.test;
2257
+ function Io(e, n) {
2258
+ return jo.call(e, n);
2259
+ }
2260
+ var No = /\S/;
2261
+ function Ro(e) {
2262
+ return !Io(No, e);
2263
+ }
2264
+ var Mo = {
2265
+ "&": "&amp;",
2266
+ "<": "&lt;",
2267
+ ">": "&gt;",
2268
+ '"': "&quot;",
2269
+ "'": "&#39;",
2270
+ "/": "&#x2F;",
2271
+ "`": "&#x60;",
2272
+ "=": "&#x3D;"
2273
+ };
2274
+ function Po(e) {
2275
+ return String(e).replace(/[&<>"'`=\/]/g, function(r) {
2276
+ return Mo[r];
2277
+ });
2278
+ }
2279
+ var Do = /\s*/, Bo = /\s+/, On = /\s*=/, $o = /\s*\}/, Uo = /#|\^|\/|>|\{|&|=|!/;
2280
+ function zo(e, n) {
2281
+ if (!e)
2282
+ return [];
2283
+ var r = !1, i = [], t = [], o = [], l = !1, a = !1, s = "", c = 0;
2284
+ function u() {
2285
+ if (l && !a)
2286
+ for (; o.length; )
2287
+ delete t[o.pop()];
2288
+ else
2289
+ o = [];
2290
+ l = !1, a = !1;
2291
+ }
2292
+ var f, h, d;
2293
+ function m(B) {
2294
+ if (typeof B == "string" && (B = B.split(Bo, 2)), !le(B) || B.length !== 2)
2295
+ throw new Error("Invalid tags: " + B);
2296
+ f = new RegExp(Pe(B[0]) + "\\s*"), h = new RegExp("\\s*" + Pe(B[1])), d = new RegExp("\\s*" + Pe("}" + B[1]));
2297
+ }
2298
+ m(n || N.tags);
2299
+ for (var g = new ye(e), b, C, x, W, Y, U; !g.eos(); ) {
2300
+ if (b = g.pos, x = g.scanUntil(f), x)
2301
+ for (var ae = 0, Q = x.length; ae < Q; ++ae)
2302
+ W = x.charAt(ae), Ro(W) ? (o.push(t.length), s += W) : (a = !0, r = !0, s += " "), t.push(["text", W, b, b + 1]), b += 1, W === `
2303
+ ` && (u(), s = "", c = 0, r = !1);
2304
+ if (!g.scan(f))
2305
+ break;
2306
+ if (l = !0, C = g.scan(Uo) || "name", g.scan(Do), C === "=" ? (x = g.scanUntil(On), g.scan(On), g.scanUntil(h)) : C === "{" ? (x = g.scanUntil(d), g.scan($o), g.scanUntil(h), C = "&") : x = g.scanUntil(h), !g.scan(h))
2307
+ throw new Error("Unclosed tag at " + g.pos);
2308
+ if (C == ">" ? Y = [C, x, b, g.pos, s, c, r] : Y = [C, x, b, g.pos], c++, t.push(Y), C === "#" || C === "^")
2309
+ i.push(Y);
2310
+ else if (C === "/") {
2311
+ if (U = i.pop(), !U)
2312
+ throw new Error('Unopened section "' + x + '" at ' + b);
2313
+ if (U[1] !== x)
2314
+ throw new Error('Unclosed section "' + U[1] + '" at ' + b);
2315
+ } else C === "name" || C === "{" || C === "&" ? a = !0 : C === "=" && m(x);
2316
+ }
2317
+ if (u(), U = i.pop(), U)
2318
+ throw new Error('Unclosed section "' + U[1] + '" at ' + g.pos);
2319
+ return Ho(Yo(t));
2320
+ }
2321
+ function Yo(e) {
2322
+ for (var n = [], r, i, t = 0, o = e.length; t < o; ++t)
2323
+ r = e[t], r && (r[0] === "text" && i && i[0] === "text" ? (i[1] += r[1], i[3] = r[3]) : (n.push(r), i = r));
2324
+ return n;
2325
+ }
2326
+ function Ho(e) {
2327
+ for (var n = [], r = n, i = [], t, o, l = 0, a = e.length; l < a; ++l)
2328
+ switch (t = e[l], t[0]) {
2329
+ case "#":
2330
+ case "^":
2331
+ r.push(t), i.push(t), r = t[4] = [];
2332
+ break;
2333
+ case "/":
2334
+ o = i.pop(), o[5] = t[2], r = i.length > 0 ? i[i.length - 1][4] : n;
2335
+ break;
2336
+ default:
2337
+ r.push(t);
2338
+ }
2339
+ return n;
2340
+ }
2341
+ function ye(e) {
2342
+ this.string = e, this.tail = e, this.pos = 0;
2343
+ }
2344
+ ye.prototype.eos = function() {
2345
+ return this.tail === "";
2346
+ };
2347
+ ye.prototype.scan = function(n) {
2348
+ var r = this.tail.match(n);
2349
+ if (!r || r.index !== 0)
2350
+ return "";
2351
+ var i = r[0];
2352
+ return this.tail = this.tail.substring(i.length), this.pos += i.length, i;
2353
+ };
2354
+ ye.prototype.scanUntil = function(n) {
2355
+ var r = this.tail.search(n), i;
2356
+ switch (r) {
2357
+ case -1:
2358
+ i = this.tail, this.tail = "";
2359
+ break;
2360
+ case 0:
2361
+ i = "";
2362
+ break;
2363
+ default:
2364
+ i = this.tail.substring(0, r), this.tail = this.tail.substring(r);
2365
+ }
2366
+ return this.pos += i.length, i;
2367
+ };
2368
+ function oe(e, n) {
2369
+ this.view = e, this.cache = { ".": this.view }, this.parent = n;
2054
2370
  }
2055
- const vn = xe(process.cwd(), "Localizable.xcstrings");
2056
- vi(yi(process.argv)).scriptName("xcstrings").usage("$0 <cmd> [args]").option("config", {
2371
+ oe.prototype.push = function(n) {
2372
+ return new oe(n, this);
2373
+ };
2374
+ oe.prototype.lookup = function(n) {
2375
+ var r = this.cache, i;
2376
+ if (r.hasOwnProperty(n))
2377
+ i = r[n];
2378
+ else {
2379
+ for (var t = this, o, l, a, s = !1; t; ) {
2380
+ if (n.indexOf(".") > 0)
2381
+ for (o = t.view, l = n.split("."), a = 0; o != null && a < l.length; )
2382
+ a === l.length - 1 && (s = _n(o, l[a]) || Lo(o, l[a])), o = o[l[a++]];
2383
+ else
2384
+ o = t.view[n], s = _n(t.view, n);
2385
+ if (s) {
2386
+ i = o;
2387
+ break;
2388
+ }
2389
+ t = t.parent;
2390
+ }
2391
+ r[n] = i;
2392
+ }
2393
+ return Qe(i) && (i = i.call(this.view)), i;
2394
+ };
2395
+ function R() {
2396
+ this.templateCache = {
2397
+ _cache: {},
2398
+ set: function(n, r) {
2399
+ this._cache[n] = r;
2400
+ },
2401
+ get: function(n) {
2402
+ return this._cache[n];
2403
+ },
2404
+ clear: function() {
2405
+ this._cache = {};
2406
+ }
2407
+ };
2408
+ }
2409
+ R.prototype.clearCache = function() {
2410
+ typeof this.templateCache < "u" && this.templateCache.clear();
2411
+ };
2412
+ R.prototype.parse = function(n, r) {
2413
+ var i = this.templateCache, t = n + ":" + (r || N.tags).join(":"), o = typeof i < "u", l = o ? i.get(t) : void 0;
2414
+ return l == null && (l = zo(n, r), o && i.set(t, l)), l;
2415
+ };
2416
+ R.prototype.render = function(n, r, i, t) {
2417
+ var o = this.getConfigTags(t), l = this.parse(n, o), a = r instanceof oe ? r : new oe(r, void 0);
2418
+ return this.renderTokens(l, a, i, n, t);
2419
+ };
2420
+ R.prototype.renderTokens = function(n, r, i, t, o) {
2421
+ for (var l = "", a, s, c, u = 0, f = n.length; u < f; ++u)
2422
+ c = void 0, a = n[u], s = a[0], s === "#" ? c = this.renderSection(a, r, i, t, o) : s === "^" ? c = this.renderInverted(a, r, i, t, o) : s === ">" ? c = this.renderPartial(a, r, i, o) : s === "&" ? c = this.unescapedValue(a, r) : s === "name" ? c = this.escapedValue(a, r, o) : s === "text" && (c = this.rawValue(a)), c !== void 0 && (l += c);
2423
+ return l;
2424
+ };
2425
+ R.prototype.renderSection = function(n, r, i, t, o) {
2426
+ var l = this, a = "", s = r.lookup(n[1]);
2427
+ function c(h) {
2428
+ return l.render(h, r, i, o);
2429
+ }
2430
+ if (s) {
2431
+ if (le(s))
2432
+ for (var u = 0, f = s.length; u < f; ++u)
2433
+ a += this.renderTokens(n[4], r.push(s[u]), i, t, o);
2434
+ else if (typeof s == "object" || typeof s == "string" || typeof s == "number")
2435
+ a += this.renderTokens(n[4], r.push(s), i, t, o);
2436
+ else if (Qe(s)) {
2437
+ if (typeof t != "string")
2438
+ throw new Error("Cannot use higher-order sections without the original template");
2439
+ s = s.call(r.view, t.slice(n[3], n[5]), c), s != null && (a += s);
2440
+ } else
2441
+ a += this.renderTokens(n[4], r, i, t, o);
2442
+ return a;
2443
+ }
2444
+ };
2445
+ R.prototype.renderInverted = function(n, r, i, t, o) {
2446
+ var l = r.lookup(n[1]);
2447
+ if (!l || le(l) && l.length === 0)
2448
+ return this.renderTokens(n[4], r, i, t, o);
2449
+ };
2450
+ R.prototype.indentPartial = function(n, r, i) {
2451
+ for (var t = r.replace(/[^ \t]/g, ""), o = n.split(`
2452
+ `), l = 0; l < o.length; l++)
2453
+ o[l].length && (l > 0 || !i) && (o[l] = t + o[l]);
2454
+ return o.join(`
2455
+ `);
2456
+ };
2457
+ R.prototype.renderPartial = function(n, r, i, t) {
2458
+ if (i) {
2459
+ var o = this.getConfigTags(t), l = Qe(i) ? i(n[1]) : i[n[1]];
2460
+ if (l != null) {
2461
+ var a = n[6], s = n[5], c = n[4], u = l;
2462
+ s == 0 && c && (u = this.indentPartial(l, c, a));
2463
+ var f = this.parse(u, o);
2464
+ return this.renderTokens(f, r, i, u, t);
2465
+ }
2466
+ }
2467
+ };
2468
+ R.prototype.unescapedValue = function(n, r) {
2469
+ var i = r.lookup(n[1]);
2470
+ if (i != null)
2471
+ return i;
2472
+ };
2473
+ R.prototype.escapedValue = function(n, r, i) {
2474
+ var t = this.getConfigEscape(i) || N.escape, o = r.lookup(n[1]);
2475
+ if (o != null)
2476
+ return typeof o == "number" && t === N.escape ? String(o) : t(o);
2477
+ };
2478
+ R.prototype.rawValue = function(n) {
2479
+ return n[1];
2480
+ };
2481
+ R.prototype.getConfigTags = function(n) {
2482
+ return le(n) ? n : n && typeof n == "object" ? n.tags : void 0;
2483
+ };
2484
+ R.prototype.getConfigEscape = function(n) {
2485
+ if (n && typeof n == "object" && !le(n))
2486
+ return n.escape;
2487
+ };
2488
+ var N = {
2489
+ name: "mustache.js",
2490
+ version: "4.2.0",
2491
+ tags: ["{{", "}}"],
2492
+ clearCache: void 0,
2493
+ escape: void 0,
2494
+ parse: void 0,
2495
+ render: void 0,
2496
+ Scanner: void 0,
2497
+ Context: void 0,
2498
+ Writer: void 0,
2499
+ /**
2500
+ * Allows a user to override the default caching strategy, by providing an
2501
+ * object with set, get and clear methods. This can also be used to disable
2502
+ * the cache by setting it to the literal `undefined`.
2503
+ */
2504
+ set templateCache(e) {
2505
+ ge.templateCache = e;
2506
+ },
2507
+ /**
2508
+ * Gets the default or overridden caching object from the default writer.
2509
+ */
2510
+ get templateCache() {
2511
+ return ge.templateCache;
2512
+ }
2513
+ }, ge = new R();
2514
+ N.clearCache = function() {
2515
+ return ge.clearCache();
2516
+ };
2517
+ N.parse = function(n, r) {
2518
+ return ge.parse(n, r);
2519
+ };
2520
+ N.render = function(n, r, i, t) {
2521
+ if (typeof n != "string")
2522
+ throw new TypeError('Invalid template! Template should be a "string" but "' + To(n) + '" was given as the first argument for mustache#render(template, view, partials)');
2523
+ return ge.render(n, r, i, t);
2524
+ };
2525
+ N.escape = Po;
2526
+ N.Scanner = ye;
2527
+ N.Context = oe;
2528
+ N.Writer = R;
2529
+ function Fn(e, {
2530
+ glob: n,
2531
+ regex: r,
2532
+ substring: i
2533
+ }) {
2534
+ const t = [n, r, i].filter((o) => o !== void 0);
2535
+ if (t.length !== 0) {
2536
+ if (t.length > 1)
2537
+ throw new Error(`Specify only one of --${e}, --${e}-glob, --${e}-regex, --${e}-substring`);
2538
+ return r !== void 0 ? { pattern: r, mode: "regex" } : i !== void 0 ? { pattern: i, mode: "substring" } : { pattern: n, mode: "glob" };
2539
+ }
2540
+ }
2541
+ function Ko() {
2542
+ return {
2543
+ command: "list",
2544
+ describe: "List strings in the xcstrings file",
2545
+ builder: (e) => e.option("key", {
2546
+ type: "string",
2547
+ describe: "Filter keys by glob (default)"
2548
+ }).option("key-glob", {
2549
+ type: "string",
2550
+ describe: "Filter keys by glob (explicit)"
2551
+ }).option("key-regex", {
2552
+ type: "string",
2553
+ describe: "Filter keys by regex"
2554
+ }).option("key-substring", {
2555
+ type: "string",
2556
+ describe: "Filter keys by substring match"
2557
+ }).option("text", {
2558
+ type: "string",
2559
+ describe: "Filter translations by glob (default)"
2560
+ }).option("text-glob", {
2561
+ type: "string",
2562
+ describe: "Filter translations by glob (explicit)"
2563
+ }).option("text-regex", {
2564
+ type: "string",
2565
+ describe: "Filter translations by regex"
2566
+ }).option("text-substring", {
2567
+ type: "string",
2568
+ describe: "Filter translations by substring match"
2569
+ }).option("languages", {
2570
+ type: "string",
2571
+ array: !0,
2572
+ alias: "l",
2573
+ describe: "Include only these languages"
2574
+ }).option("format", {
2575
+ type: "string",
2576
+ describe: "Mustache template. Available variables: {{language}}, {{key}}, {{text}}"
2577
+ }).check((n) => {
2578
+ const r = [n.key, n["key-glob"]].filter((s) => s !== void 0).length, i = n["key-regex"] ? 1 : 0, t = n["key-substring"] ? 1 : 0;
2579
+ if (r + i + t > 1)
2580
+ throw new Error("Specify only one of --key/--key-glob, --key-regex, or --key-substring");
2581
+ const o = [n.text, n["text-glob"]].filter((s) => s !== void 0).length, l = n["text-regex"] ? 1 : 0, a = n["text-substring"] ? 1 : 0;
2582
+ if (o + l + a > 1)
2583
+ throw new Error("Specify only one of --text/--text-glob, --text-regex, or --text-substring");
2584
+ return !0;
2585
+ }),
2586
+ handler: async (e) => {
2587
+ const n = [e.key, e["key-glob"]].filter((l) => l !== void 0), r = [e.text, e["text-glob"]].filter((l) => l !== void 0), i = Fn("key", {
2588
+ glob: n[0],
2589
+ regex: e["key-regex"],
2590
+ substring: e["key-substring"]
2591
+ }), t = Fn("text", {
2592
+ glob: r[0],
2593
+ regex: e["text-regex"],
2594
+ substring: e["text-substring"]
2595
+ }), o = await Go({
2596
+ path: e.path,
2597
+ languages: e.languages,
2598
+ keyFilter: i,
2599
+ textFilter: t,
2600
+ format: e.format
2601
+ });
2602
+ o && console.log(o);
2603
+ }
2604
+ };
2605
+ }
2606
+ function Wo(e) {
2607
+ const n = e.replace(/[.+^${}()|\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
2608
+ return new RegExp(`^${n}$`);
2609
+ }
2610
+ function Tn(e) {
2611
+ if (!e) return () => !0;
2612
+ if (e.mode === "regex") {
2613
+ const r = new RegExp(e.pattern);
2614
+ return (i) => r.test(i);
2615
+ }
2616
+ if (e.mode === "substring") {
2617
+ const r = e.pattern;
2618
+ return (i) => i.includes(r);
2619
+ }
2620
+ const n = Wo(e.pattern);
2621
+ return (r) => n.test(r);
2622
+ }
2623
+ function qo(e, n) {
2624
+ const r = N.escape;
2625
+ N.escape = (i) => i;
2626
+ try {
2627
+ return N.render(e, n);
2628
+ } finally {
2629
+ N.escape = r;
2630
+ }
2631
+ }
2632
+ async function Go(e) {
2633
+ const r = (await me(e.path)).strings ?? {}, i = Tn(e.keyFilter), t = Tn(e.textFilter), o = e.languages ? new Set(e.languages) : null, l = !!e.format, a = [];
2634
+ for (const s of Object.keys(r)) {
2635
+ if (!i(s)) continue;
2636
+ const u = r[s]?.localizations ?? {}, f = Object.keys(u), h = [];
2637
+ for (const d of f) {
2638
+ if (o && !o.has(d)) continue;
2639
+ const m = u[d]?.stringUnit?.value ?? "";
2640
+ t(m) && (l && e.format ? h.push(qo(e.format, { language: d, key: s, text: m })) : h.push(` ${d}: ${JSON.stringify(m)}`));
2641
+ }
2642
+ h.length !== 0 && (l ? a.push(...h) : a.push(`${s}:`, ...h));
2643
+ }
2644
+ return a.join(`
2645
+ `);
2646
+ }
2647
+ const Ln = Oe(process.cwd(), "Localizable.xcstrings");
2648
+ Lr(jr(process.argv)).scriptName("xcstrings").usage("$0 <cmd> [args]").option("config", {
2057
2649
  type: "string",
2058
2650
  describe: "Path to config file"
2059
2651
  }).option("path", {
2060
2652
  type: "string",
2061
2653
  describe: "Path to xcstrings file",
2062
- default: vn
2654
+ default: Ln
2063
2655
  }).middleware(async (e) => {
2064
- const n = await Re(e.config);
2065
- e.path = await al(e.path, n, vn);
2066
- }).command(
2067
- "add",
2068
- "Add a string",
2069
- (e) => e.option("key", {
2070
- type: "string",
2071
- describe: "The key of the string",
2072
- demandOption: !0
2073
- }).option("comment", {
2074
- type: "string",
2075
- describe: "The comment for the string"
2076
- }).option("language", {
2077
- type: "string",
2078
- alias: "l",
2079
- describe: "The language of the string provided with --text"
2080
- }).option("text", {
2081
- type: "string",
2082
- describe: "The string value for the default language"
2083
- }).option("strings", {
2084
- type: "string",
2085
- describe: "The strings JSON or YAML"
2086
- }).option("strings-format", {
2087
- type: "string",
2088
- choices: ["auto", "json", "yaml"],
2089
- default: "auto",
2090
- describe: "Format for the data provided with --strings"
2091
- }),
2092
- async (e) => {
2093
- await tl({
2094
- path: e.path,
2095
- key: e.key,
2096
- comment: e.comment,
2097
- stringsArg: e.strings,
2098
- stringsFormat: e["strings-format"],
2099
- defaultString: e.text,
2100
- language: e.language,
2101
- stdinReader: void 0,
2102
- configPath: e.config
2103
- }), W.info(b.green(`✓ Added key "${e.key}"`));
2104
- }
2105
- ).command(
2106
- "remove",
2107
- "Remove a string",
2108
- (e) => e.option("key", {
2109
- type: "string",
2110
- describe: "The key to remove",
2111
- alias: "k"
2112
- }).option("languages", {
2113
- type: "string",
2114
- array: !0,
2115
- describe: "Languages to remove",
2116
- alias: "l"
2117
- }).option("dry-run", {
2118
- type: "boolean",
2119
- default: !1,
2120
- describe: "Show what would be removed without writing changes",
2121
- alias: "n"
2122
- }).check((n) => {
2123
- if (n.key || n.languages && n.languages.length > 0)
2124
- return !0;
2125
- throw new Error("Either --key or --languages must be provided");
2126
- }),
2127
- async (e) => {
2128
- const n = await ki(
2129
- e.path,
2130
- e.key,
2131
- e.languages,
2132
- e.dryRun === !0
2133
- ), i = Object.entries(n).map(([r, o]) => `- [${o.join(" ")}] ${r}`).join(`
2134
- `);
2135
- if (e.dryRun) {
2136
- i.length === 0 ? W.info(b.yellow("No matching strings found.")) : W.info(b.blue(`Would remove:
2137
- ${i}`));
2138
- return;
2139
- }
2140
- i.length === 0 ? W.info(b.yellow("No matching strings found.")) : W.info(b.green(`✓ Removed
2141
- ${i}`));
2142
- }
2143
- ).command(
2144
- "init",
2145
- "Initialize configuration file",
2146
- (e) => e,
2147
- async () => {
2148
- await Ii();
2149
- }
2150
- ).command(
2151
- "languages",
2152
- "List supported languages from xcodeproj or xcstrings",
2153
- (e) => e,
2154
- async (e) => {
2155
- const n = await bn(e.path, e.config);
2156
- W.info(n.join(" "));
2157
- }
2158
- ).demandCommand(1, "").strictCommands().recommendCommands().showHelpOnFail(!0).fail((e, n, i) => {
2159
- const r = e || n?.message;
2160
- r && (console.error(b.red(r)), console.log(), i.showHelp(), process.exit(1)), n && (console.error(n), process.exit(1)), i.showHelp(), process.exit(1);
2656
+ const n = await He(e.config);
2657
+ e.path = await Dr(e.path, n, Ln);
2658
+ }).command([
2659
+ bo(),
2660
+ Ao(),
2661
+ Eo(),
2662
+ Kr(),
2663
+ Ko()
2664
+ ]).demandCommand(1, "").strictCommands().recommendCommands().showHelpOnFail(!0).fail((e, n, r) => {
2665
+ const i = e || n?.message;
2666
+ i && (console.error(k.red(i)), console.log(), r.showHelp(), process.exit(1)), n && (console.error(n), process.exit(1)), r.showHelp(), process.exit(1);
2161
2667
  }).help().argv;