xcstrings-cli 1.6.1 → 2.1.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 +90 -27
  2. package/dist/index.js +1793 -1368
  3. package/package.json +5 -3
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 Tr from "yargs";
3
+ import { hideBin as Lr } from "yargs/helpers";
4
+ import { resolve as Fe, relative as be } from "node:path";
5
+ import { cosmiconfig as jr } from "cosmiconfig";
6
+ import Be from "json5";
7
+ import { select as Ir, checkbox as ln, confirm as Nr } from "@inquirer/prompts";
8
+ import C from "chalk";
9
+ import { readFile as Rr, writeFile as jn, readdir as In } from "node:fs/promises";
10
+ import { XcodeProject as Mr } from "@bacons/xcode";
11
+ const je = "xcstrings-cli", an = jr(je, {
45
12
  searchPlaces: [
46
- `${Ce}.json`,
47
- `${Ce}.json5`
13
+ `${je}.json`,
14
+ `${je}.json5`
48
15
  ],
49
16
  loaders: {
50
- ".json5": async (e, n) => Le.parse(n)
17
+ ".json5": async (e, n) => Be.parse(n)
51
18
  },
52
19
  cache: !1
53
20
  });
54
- async function Re(e) {
21
+ async function Ke(e) {
55
22
  if (e) {
56
- const i = await Qe.load(e);
57
- return i ? i.config : null;
23
+ const r = await an.load(e);
24
+ return r ? r.config : null;
58
25
  }
59
- const n = await Qe.search();
26
+ const n = await an.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();
29
+ function cn(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;
65
35
  }
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();
93
- }
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 Pr(e, n, r) {
37
+ const i = n?.xcstringsPaths, t = i?.some((c) => typeof c != "string") ?? !1, l = e.startsWith("alias:") ? e.slice(6) : null;
38
+ if (l) {
39
+ const c = cn(i, l);
40
+ if (!c)
41
+ throw new Error(`Unknown alias: ${l}`);
42
+ return c;
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 o = cn(i, e);
45
+ if (o)
46
+ return o;
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 s = i[0];
53
+ return typeof s == "string" ? s : s.path;
134
54
  }
55
+ const c = i.map((s) => typeof s == "string" ? { name: s, value: s } : { name: `${s.alias} (${s.path})`, value: s.path });
56
+ return await Ir({
57
+ message: "Select xcstrings file:",
58
+ choices: c
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 Rr(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 = Dr(r);
69
+ await jn(e, i + `
70
+ `, "utf-8");
71
+ }
72
+ function Dr(e) {
73
+ let n = "", r = !1, i = !1;
74
+ for (let t = 0; t < e.length; t++) {
75
+ const l = e[t];
76
+ if (r && l === "\\" && !i) {
77
+ i = !0, n += l;
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 += l;
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 (l === '"') {
85
+ r = !r, n += l;
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 && l === ":") {
89
+ n += " :";
90
+ continue;
91
+ }
92
+ n += l;
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 Br(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 ue = { exports: {} }, Ie, un;
100
+ function Ur() {
101
+ if (un) return Ie;
102
+ un = 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;
110
+ Ie = n;
111
+ function n(r, i, t) {
112
+ var l = t && t.stringify || e, o = 1;
113
+ if (typeof r == "object" && r !== null) {
114
+ var a = i.length + o;
115
+ if (a === 1) return r;
271
116
  var c = new Array(a);
272
- c[0] = t(i);
117
+ c[0] = l(r);
273
118
  for (var u = 1; u < a; u++)
274
- c[u] = t(r[u]);
119
+ c[u] = l(i[u]);
275
120
  return c.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 s = i.length;
125
+ if (s === 0) return r;
126
+ for (var f = "", g = 1 - o, h = -1, x = r && r.length || 0, d = 0; d < x; ) {
127
+ if (r.charCodeAt(d) === 37 && d + 1 < x) {
128
+ switch (h = h > -1 ? h : 0, r.charCodeAt(d + 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 (g >= s || i[g] == null) break;
133
+ h < d && (f += r.slice(h, d)), f += Number(i[g]), h = d + 2, d++;
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 (g >= s || i[g] == null) break;
137
+ h < d && (f += r.slice(h, d)), f += Math.floor(Number(i[g])), h = d + 2, d++;
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 (g >= s || i[g] === void 0) break;
145
+ h < d && (f += r.slice(h, d));
146
+ var A = typeof i[g];
147
+ if (A === "string") {
148
+ f += "'" + i[g] + "'", h = d + 2, d++;
304
149
  break;
305
150
  }
306
- if (C === "function") {
307
- p += r[h].name || "<anonymous>", d = g + 2, g++;
151
+ if (A === "function") {
152
+ f += i[g].name || "<anonymous>", h = d + 2, d++;
308
153
  break;
309
154
  }
310
- p += t(r[h]), d = g + 2, g++;
155
+ f += l(i[g]), h = d + 2, d++;
311
156
  break;
312
157
  case 115:
313
- if (h >= s)
158
+ if (g >= s)
314
159
  break;
315
- d < g && (p += i.slice(d, g)), p += String(r[h]), d = g + 2, g++;
160
+ h < d && (f += r.slice(h, d)), f += String(i[g]), h = d + 2, d++;
316
161
  break;
317
162
  case 37:
318
- d < g && (p += i.slice(d, g)), p += "%", d = g + 2, g++, h--;
163
+ h < d && (f += r.slice(h, d)), f += "%", h = d + 2, d++, g--;
319
164
  break;
320
165
  }
321
- ++h;
166
+ ++g;
322
167
  }
323
- ++g;
168
+ ++d;
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 h === -1 ? r : (h < x && (f += r.slice(h)), f);
171
+ }
172
+ return Ie;
173
+ }
174
+ var sn;
175
+ function Yr() {
176
+ if (sn) return ue.exports;
177
+ sn = 1;
178
+ const e = Ur();
179
+ ue.exports = s;
180
+ const n = kr().console || {}, r = {
181
+ mapHttpRequest: X,
182
+ mapHttpResponse: X,
183
+ wrapRequestSerializer: B,
184
+ wrapResponseSerializer: B,
185
+ wrapErrorSerializer: B,
186
+ req: X,
187
+ res: X,
188
+ err: Y,
189
+ errWithCause: Y
345
190
  };
346
- function r(f, m) {
347
- return f === "silent" ? 1 / 0 : m.levels.values[f];
191
+ function i(p, m) {
192
+ return p === "silent" ? 1 / 0 : m.levels.values[p];
348
193
  }
349
- const o = Symbol("pino.logFuncs"), t = Symbol("pino.hierarchy"), l = {
194
+ const t = Symbol("pino.logFuncs"), l = Symbol("pino.hierarchy"), o = {
350
195
  error: "log",
351
196
  fatal: "error",
352
197
  warn: "error",
@@ -354,98 +199,98 @@ function Mi() {
354
199
  debug: "log",
355
200
  trace: "log"
356
201
  };
357
- function a(f, m) {
202
+ function a(p, m) {
358
203
  const w = {
359
204
  logger: m,
360
- parent: f[t]
205
+ parent: p[l]
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;
207
+ m[l] = w;
208
+ }
209
+ function c(p, m, w) {
210
+ const S = {};
211
+ m.forEach((_) => {
212
+ S[_] = w[_] ? w[_] : n[_] || n[o[_] || "log"] || ce;
213
+ }), p[t] = S;
214
+ }
215
+ function u(p, m) {
216
+ return Array.isArray(p) ? p.filter(function(S) {
217
+ return S !== "!stdSerializers.err";
218
+ }) : p === !0 ? Object.keys(m) : !1;
219
+ }
220
+ function s(p) {
221
+ p = p || {}, p.browser = p.browser || {};
222
+ const m = p.browser.transmit;
378
223
  if (m && typeof m.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 w = p.browser.write || n;
226
+ p.browser.write && (p.browser.asObject = !0);
227
+ const S = p.serializers || {}, _ = u(p.browser.serialize, S);
228
+ let M = p.browser.serialize;
229
+ Array.isArray(p.browser.serialize) && p.browser.serialize.indexOf("!stdSerializers.err") > -1 && (M = !1);
230
+ const $ = Object.keys(p.customLevels || {}), k = ["error", "fatal", "warn", "info", "debug", "trace"].concat($);
231
+ typeof w == "function" && k.forEach(function(P) {
232
+ w[P] = w;
233
+ }), (p.enabled === !1 || p.browser.disabled) && (p.level = "silent");
234
+ const j = p.level || "info", b = Object.create(w);
235
+ b.log || (b.log = ce), c(b, k, w), a({}, b), Object.defineProperty(b, "levelVal", {
236
+ get: xe
237
+ }), Object.defineProperty(b, "level", {
238
+ get: Q,
239
+ set: Or
395
240
  });
396
- const D = {
241
+ const U = {
397
242
  transmit: m,
398
- serialize: S,
399
- asObject: f.browser.asObject,
400
- formatters: f.browser.formatters,
401
- levels: E,
402
- timestamp: pi(f)
243
+ serialize: _,
244
+ asObject: p.browser.asObject,
245
+ formatters: p.browser.formatters,
246
+ levels: k,
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
+ b.levels = f(p), b.level = j, b.setMaxListeners = b.getMaxListeners = b.emit = b.addListener = b.on = b.prependListener = b.once = b.prependOnceListener = b.removeListener = b.removeAllListeners = b.listeners = b.listenerCount = b.eventNames = b.write = b.flush = ce, b.serializers = S, b._serialize = _, b._stdErrSerialize = M, b.child = Fr, m && (b._logEvent = W());
250
+ function xe() {
251
+ return i(this.level, this);
407
252
  }
408
- function $() {
253
+ function Q() {
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 Or(P) {
257
+ if (P !== "silent" && !this.levels.values[P])
258
+ throw Error("unknown level " + P);
259
+ this._level = P, x(this, U, b, "error"), x(this, U, b, "fatal"), x(this, U, b, "warn"), x(this, U, b, "info"), x(this, U, b, "debug"), x(this, U, b, "trace"), $.forEach((J) => {
260
+ x(this, U, b, J);
416
261
  });
417
262
  }
418
- function xi(R, K) {
419
- if (!R)
263
+ function Fr(P, J) {
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
+ J = J || {}, _ && P.serializers && (J.serializers = P.serializers);
267
+ const nn = J.serializers;
268
+ if (_ && nn) {
269
+ var ve = Object.assign({}, S, nn), rn = p.browser.serialize === !0 ? Object.keys(ve) : _;
270
+ delete P.serializers, v([P], rn, ve, 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 tn(on) {
273
+ this._childLevel = (on._childLevel | 0) + 1, this.bindings = P, ve && (this.serializers = ve, this._serialize = rn), m && (this._logEvent = W(
274
+ [].concat(on._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
+ tn.prototype = this;
278
+ const Le = new tn(this);
279
+ return a(this, Le), Le.level = this.level, Le;
435
280
  }
436
- return v;
281
+ return b;
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 m = p.customLevels || {}, w = Object.assign({}, s.levels.values, m), S = Object.assign({}, s.levels.labels, g(m));
440
285
  return {
441
286
  values: w,
442
- labels: _
287
+ labels: S
443
288
  };
444
289
  }
445
- function h(f) {
290
+ function g(p) {
446
291
  const m = {};
447
- return Object.keys(f).forEach(function(w) {
448
- m[f[w]] = w;
292
+ return Object.keys(p).forEach(function(w) {
293
+ m[p[w]] = w;
449
294
  }), m;
450
295
  }
451
296
  s.levels = {
@@ -465,132 +310,132 @@ 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) {
313
+ }, s.stdSerializers = r, s.stdTimeFunctions = Object.assign({}, { nullTime: Ze, epochTime: en, unixTime: Sr, isoTime: _r });
314
+ function h(p) {
470
315
  const m = [];
471
- f.bindings && m.push(f.bindings);
472
- let w = f[t];
316
+ p.bindings && m.push(p.bindings);
317
+ let w = p[l];
473
318
  for (; w.parent; )
474
319
  w = w.parent, w.logger.bindings && m.push(w.logger.bindings);
475
320
  return m.reverse();
476
321
  }
477
- function y(f, m, w, _) {
478
- if (Object.defineProperty(f, _, {
479
- value: r(f.level, w) > r(_, w) ? J : w[o][_],
322
+ function x(p, m, w, S) {
323
+ if (Object.defineProperty(p, S, {
324
+ value: i(p.level, w) > i(S, w) ? ce : w[t][S],
480
325
  writable: !0,
481
326
  enumerable: !0,
482
327
  configurable: !0
483
- }), !m.transmit && f[_] === J)
328
+ }), !m.transmit && p[S] === ce)
484
329
  return;
485
- f[_] = C(f, m, w, _);
486
- const S = d(f);
487
- S.length !== 0 && (f[_] = g(S, f[_]));
330
+ p[S] = A(p, m, w, S);
331
+ const _ = h(p);
332
+ _.length !== 0 && (p[S] = d(_, p[S]));
488
333
  }
489
- function g(f, m) {
334
+ function d(p, m) {
490
335
  return function() {
491
- return m.apply(this, [...f, ...arguments]);
336
+ return m.apply(this, [...p, ...arguments]);
492
337
  };
493
338
  }
494
- function C(f, m, w, _) {
495
- return /* @__PURE__ */ (function(S) {
339
+ function A(p, m, w, S) {
340
+ return /* @__PURE__ */ (function(_) {
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],
342
+ const $ = m.timestamp(), k = new Array(arguments.length), j = Object.getPrototypeOf && Object.getPrototypeOf(this) === n ? n : this;
343
+ for (var b = 0; b < k.length; b++) k[b] = arguments[b];
344
+ if (m.serialize && !m.asObject && v(k, this._serialize, this.serializers, this._stdErrSerialize), m.asObject || m.formatters ? _.call(j, E(this, S, k, $, m.formatters)) : _.apply(j, k), m.transmit) {
345
+ const U = m.transmit.level || p._level, xe = w.levels.values[U], Q = w.levels.values[S];
346
+ if (Q < xe) return;
347
+ K(this, {
348
+ ts: $,
349
+ methodLevel: S,
350
+ methodValue: Q,
351
+ transmitValue: w.levels.values[m.transmit.level || p._level],
507
352
  send: m.transmit.send,
508
- val: r(f._level, w)
509
- }, E);
353
+ val: i(p._level, w)
354
+ }, k);
510
355
  }
511
356
  };
512
- })(f[o][_]);
357
+ })(p[t][S]);
513
358
  }
514
- function L(f, m, w, _, S = {}) {
359
+ function E(p, m, w, S, _ = {}) {
515
360
  const {
516
- level: N = () => f.levels.values[m],
517
- log: B = ($) => $
518
- } = 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(
361
+ level: M = () => p.levels.values[m],
362
+ log: $ = (Q) => Q
363
+ } = _;
364
+ p._serialize && v(w, p._serialize, p.serializers, p._stdErrSerialize);
365
+ const k = w.slice();
366
+ let j = k[0];
367
+ const b = {};
368
+ S && (b.time = S), b.level = M(m, p.levels.values[m]);
369
+ let U = (p._childLevel | 0) + 1;
370
+ if (U < 1 && (U = 1), j !== null && typeof j == "object") {
371
+ for (; U-- && typeof k[0] == "object"; )
372
+ Object.assign(b, k.shift());
373
+ j = k.length ? e(k.shift(), k) : void 0;
374
+ } else typeof j == "string" && (j = e(k.shift(), k));
375
+ return j !== void 0 && (b.msg = j), $(b);
376
+ }
377
+ function v(p, m, w, S) {
378
+ for (const _ in p)
379
+ if (S && p[_] instanceof Error)
380
+ p[_] = s.stdSerializers.err(p[_]);
381
+ else if (typeof p[_] == "object" && !Array.isArray(p[_]))
382
+ for (const M in p[_])
383
+ m && m.indexOf(M) > -1 && M in w && (p[_][M] = w[M](p[_][M]));
384
+ }
385
+ function K(p, m, w) {
386
+ const S = m.send, _ = m.ts, M = m.methodLevel, $ = m.methodValue, k = m.val, j = p._logEvent.bindings;
387
+ v(
543
388
  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) {
389
+ p._serialize || Object.keys(p.serializers),
390
+ p.serializers,
391
+ p._stdErrSerialize === void 0 ? !0 : p._stdErrSerialize
392
+ ), p._logEvent.ts = _, p._logEvent.messages = w.filter(function(b) {
393
+ return j.indexOf(b) === -1;
394
+ }), p._logEvent.level.label = M, p._logEvent.level.value = $, S(M, p._logEvent, k), p._logEvent = W(j);
395
+ }
396
+ function W(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) {
404
+ function Y(p) {
560
405
  const m = {
561
- type: f.constructor.name,
562
- msg: f.message,
563
- stack: f.stack
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]);
410
+ for (const w in p)
411
+ m[w] === void 0 && (m[w] = p[w]);
567
412
  return m;
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 ? Ze : en;
571
416
  }
572
- function le() {
417
+ function X() {
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 ce() {
579
424
  }
580
- function $e() {
425
+ function Ze() {
581
426
  return !1;
582
427
  }
583
- function Ke() {
428
+ function en() {
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) {
437
+ function kr() {
438
+ function p(m) {
594
439
  return typeof m < "u" && m;
595
440
  }
596
441
  try {
@@ -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 ue.exports.default = s, ue.exports.pino = s, ue.exports;
608
453
  }
609
- var Di = Mi();
610
- const Pi = /* @__PURE__ */ Ni(Di), W = Pi({
454
+ var zr = Yr();
455
+ const $r = /* @__PURE__ */ Br(zr), ne = $r({
611
456
  level: process.env.LOG_LEVEL || "info"
612
457
  });
613
- function Cn(e) {
458
+ function Hr() {
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
+ ne.info(n.join(" "));
465
+ }
466
+ };
467
+ }
468
+ function Kr(e) {
469
+ const n = Fe(e, "project.pbxproj");
470
+ return (Mr.open(n).rootObject.props.knownRegions ?? []).filter((l) => l !== "Base").sort();
471
+ }
472
+ async function Wr(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 l of Object.keys(t.localizations))
481
+ r.add(l);
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 Ke(n);
490
+ if (i?.xcodeprojPaths && i.xcodeprojPaths.length > 0) {
491
+ const o = /* @__PURE__ */ new Set();
492
+ o.add(r);
493
+ for (const a of i.xcodeprojPaths)
494
+ Kr(a).forEach((u) => o.add(u));
495
+ return Array.from(o).sort();
496
+ }
497
+ const t = await Wr(e), l = new Set(t);
498
+ return l.add(r), Array.from(l).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 qr(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 Vr(e, n) {
510
+ var r, i, t, l;
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 (l = Object.keys(n), r = 0, i = l.length; r < i; r += 1)
513
+ t = l[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 Xr(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 Qr(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 Jr = Mn, Zr = Gr, ei = qr, ni = Xr, ri = Qr, ii = Vr, F = {
526
+ isNothing: Jr,
527
+ isObject: Zr,
528
+ toArray: ei,
529
+ repeat: ni,
530
+ isNegativeZero: ri,
531
+ extend: ii
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 Ne(e, n, r, i, t) {
549
+ var l = "", o = "", a = Math.floor(t / 2) - 1;
550
+ return i - n > a && (l = " ... ", n = i - a + l.length), r - i > a && (o = " ...", r = i + a - o.length), {
551
+ str: l + e.slice(n, r).replace(/\t/g, "→") + o,
552
+ pos: i - n + l.length
666
553
  // relative position
667
554
  };
668
555
  }
669
- function Oe(e, n) {
556
+ function Re(e, n) {
670
557
  return F.repeat(" ", n - e.length) + e;
671
558
  }
672
- function Xi(e, n) {
559
+ function ti(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 = [], l, o = -1; l = r.exec(e.buffer); )
563
+ t.push(l.index), i.push(l.index + l[0].length), e.position <= l.index && o < 0 && (o = i.length - 2);
564
+ o < 0 && (o = i.length - 1);
565
+ var a = "", c, u, s = Math.min(e.line + n.linesAfter, t.length).toString().length, f = n.maxLength - (n.indent + s + 3);
566
+ for (c = 1; c <= n.linesBefore && !(o - c < 0); c++)
567
+ u = Ne(
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[o - c],
570
+ t[o - c],
571
+ e.position - (i[o] - i[o - c]),
572
+ f
573
+ ), a = F.repeat(" ", n.indent) + Re((e.line - c + 1).toString(), s) + " | " + u.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 + `
575
+ for (u = Ne(e.buffer, i[o], t[o], e.position, f), a += F.repeat(" ", n.indent) + Re((e.line + 1).toString(), s) + " | " + u.str + `
689
576
  `, a += F.repeat("-", n.indent + s + 3 + u.pos) + `^
690
- `, c = 1; c <= n.linesAfter && !(l + c >= o.length); c++)
691
- u = Ee(
577
+ `, c = 1; c <= n.linesAfter && !(o + c >= t.length); c++)
578
+ u = Ne(
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[o + c],
581
+ t[o + c],
582
+ e.position - (i[o] - i[o + c]),
583
+ f
584
+ ), a += F.repeat(" ", n.indent) + Re((e.line + c + 1).toString(), s) + " | " + u.str + `
698
585
  `;
699
586
  return a.replace(/\n$/, "");
700
587
  }
701
- var Qi = Xi, Ji = [
588
+ var oi = ti, li = [
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
+ ], ai = [
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 (li.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), ai.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 fn(e, n) {
625
+ var r = [];
626
+ return e[n].forEach(function(i) {
627
+ var t = r.length;
628
+ r.forEach(function(l, o) {
629
+ l.tag === i.tag && l.kind === i.kind && l.multi === i.multi && (t = o);
630
+ }), r[t] = i;
631
+ }), r;
632
+ }
633
+ function si() {
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 Ue(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
+ Ue.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(l) {
667
+ if (!(l 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 (l.loadKind && l.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 (l.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(l) {
674
+ if (!(l 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(Ue.prototype);
678
+ return t.implicit = (this.implicit || []).concat(r), t.explicit = (this.explicit || []).concat(i), t.compiledImplicit = fn(t, "implicit"), t.compiledExplicit = fn(t, "explicit"), t.compiledTypeMap = si(t.compiledImplicit, t.compiledExplicit), t;
792
679
  };
793
- var Sn = ke, En = new k("tag:yaml.org,2002:str", {
680
+ var Dn = Ue, 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
+ }), Un = 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
+ }), Yn = 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
+ Un,
699
+ Yn
813
700
  ]
814
701
  });
815
- function rr(e) {
702
+ function fi(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 pi() {
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 $n = new T("tag:yaml.org,2002:null", {
827
714
  kind: "scalar",
828
- resolve: rr,
829
- construct: or,
830
- predicate: lr,
715
+ resolve: fi,
716
+ construct: pi,
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 di(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 gi(e) {
856
743
  return e === "true" || e === "True" || e === "TRUE";
857
744
  }
858
- function cr(e) {
745
+ function mi(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: di,
751
+ construct: gi,
752
+ predicate: mi,
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 yi(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 vi(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 (!yi(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 (!vi(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 wi(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 Ai(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: wi,
832
+ predicate: Ai,
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
+ }), Ci = 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 || !Ci.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 ki(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 Oi(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: Oi,
910
+ represent: ki,
1024
911
  defaultStyle: "lowercase"
1025
- }), Nn = Ln.extend({
912
+ }), Gn = zn.extend({
1026
913
  implicit: [
1027
- kn,
1028
- Tn,
1029
- jn,
1030
- In
914
+ $n,
915
+ Hn,
916
+ Kn,
917
+ Wn
1031
918
  ]
1032
- }), Rn = Nn, Mn = new RegExp(
919
+ }), qn = Gn, 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]) {
924
+ function Fi(e) {
925
+ return e === null ? !1 : Vn.exec(e) !== null || Xn.exec(e) !== null;
926
+ }
927
+ function Ti(e) {
928
+ var n, r, i, t, l, o, a, c = 0, u = null, s, f, g;
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 (l = +n[4], o = +n[5], a = +n[6], n[7]) {
1046
933
  for (c = n[7].slice(0, 3); c.length < 3; )
1047
934
  c += "0";
1048
935
  c = +c;
1049
936
  }
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;
937
+ return n[9] && (s = +n[10], f = +(n[11] || 0), u = (s * 60 + f) * 6e4, n[9] === "-" && (u = -u)), g = new Date(Date.UTC(r, i, t, l, o, a, c)), u && g.setTime(g.getTime() - u), g;
1051
938
  }
1052
- function Cr(e) {
939
+ function Li(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: Fi,
945
+ construct: Ti,
1059
946
  instanceOf: Date,
1060
- represent: Cr
947
+ represent: Li
1061
948
  });
1062
- function _r(e) {
949
+ function ji(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: ji
955
+ }), We = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
1069
956
  \r`;
1070
- function Sr(e) {
957
+ function Ii(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, l = We;
960
+ for (r = 0; r < t; r++)
961
+ if (n = l.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;
1079
- }
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);
1085
- }
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;
965
+ return i % 8 === 0;
1091
966
  }
1092
- function Fr(e) {
967
+ function Ni(e) {
968
+ var n, r, i = e.replace(/[\r\n=]/g, ""), t = i.length, l = We, o = 0, a = [];
969
+ for (n = 0; n < t; n++)
970
+ n % 4 === 0 && n && (a.push(o >> 16 & 255), a.push(o >> 8 & 255), a.push(o & 255)), o = o << 6 | l.indexOf(i.charAt(n));
971
+ return r = t % 4 * 6, r === 0 ? (a.push(o >> 16 & 255), a.push(o >> 8 & 255), a.push(o & 255)) : r === 18 ? (a.push(o >> 10 & 255), a.push(o >> 2 & 255)) : r === 12 && a.push(o >> 4 & 255), new Uint8Array(a);
972
+ }
973
+ function Ri(e) {
974
+ var n = "", r = 0, i, t, l = e.length, o = We;
975
+ for (i = 0; i < l; i++)
976
+ i % 3 === 0 && i && (n += o[r >> 18 & 63], n += o[r >> 12 & 63], n += o[r >> 6 & 63], n += o[r & 63]), r = (r << 8) + e[i];
977
+ return t = l % 3, t === 0 ? (n += o[r >> 18 & 63], n += o[r >> 12 & 63], n += o[r >> 6 & 63], n += o[r & 63]) : t === 2 ? (n += o[r >> 10 & 63], n += o[r >> 4 & 63], n += o[r << 2 & 63], n += o[64]) : t === 1 && (n += o[r >> 2 & 63], n += o[r << 4 & 63], n += o[64], n += o[64]), n;
978
+ }
979
+ function Mi(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: Ii,
985
+ construct: Ni,
986
+ predicate: Mi,
987
+ represent: Ri
988
+ }), Pi = Object.prototype.hasOwnProperty, Di = Object.prototype.toString;
989
+ function Bi(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))
1109
- if (!l) l = !0;
991
+ var n = [], r, i, t, l, o, a = e;
992
+ for (r = 0, i = a.length; r < i; r += 1) {
993
+ if (t = a[r], o = !1, Di.call(t) !== "[object Object]") return !1;
994
+ for (l in t)
995
+ if (Pi.call(t, l))
996
+ if (!o) o = !0;
1110
997
  else return !1;
1111
- if (!l) return !1;
1112
- if (n.indexOf(t) === -1) n.push(t);
998
+ if (!o) return !1;
999
+ if (n.indexOf(l) === -1) n.push(l);
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: Bi,
1010
+ construct: Ui
1011
+ }), Yi = Object.prototype.toString;
1012
+ function zi(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, l, o = e;
1015
+ for (l = new Array(o.length), n = 0, r = o.length; n < r; n += 1) {
1016
+ if (i = o[n], Yi.call(i) !== "[object Object]" || (t = Object.keys(i), t.length !== 1)) return !1;
1017
+ l[n] = [t[0], i[t[0]]];
1131
1018
  }
1132
1019
  return !0;
1133
1020
  }
1134
- function Rr(e) {
1021
+ function $i(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, l, o = e;
1024
+ for (l = new Array(o.length), n = 0, r = o.length; n < r; n += 1)
1025
+ i = o[n], t = Object.keys(i), l[n] = [t[0], i[t[0]]];
1026
+ return l;
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: zi,
1031
+ construct: $i
1032
+ }), Hi = Object.prototype.hasOwnProperty;
1033
+ function Ki(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 (Hi.call(r, n) && r[n] !== null)
1151
1038
  return !1;
1152
1039
  return !0;
1153
1040
  }
1154
- function Pr(e) {
1041
+ function Wi(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: Ki,
1047
+ construct: Wi
1048
+ }), Ge = qn.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
+ }), q = Object.prototype.hasOwnProperty, Ee = 1, ir = 2, tr = 3, Se = 4, Me = 1, Gi = 2, pn = 3, qi = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Vi = /[\x85\u2028\u2029]/, Xi = /[,\[\]\{\}]/, or = /^(?:!|!!|![a-z\-]+!)$/i, lr = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
1060
+ function hn(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 V(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 Qi(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 Ji(e) {
1193
1080
  return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
1194
1081
  }
1195
- function Kr(e) {
1082
+ function Zi(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 et(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 cr = new Array(256), ur = new Array(256);
1104
+ for (var Z = 0; Z < 256; Z++)
1105
+ cr[Z] = dn(Z) ? 1 : 0, ur[Z] = dn(Z);
1106
+ function nt(e, n) {
1107
+ this.input = e, this.filename = n.filename || null, this.schema = n.schema || Ge, 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 sr(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 = oi(r), new I(n, r);
1232
1119
  }
1233
- function x(e, n) {
1234
- throw Qn(e, n);
1120
+ function y(e, n) {
1121
+ throw sr(e, n);
1235
1122
  }
1236
- function he(e, n) {
1237
- e.onWarning && e.onWarning.call(null, Qn(e, n));
1123
+ function _e(e, n) {
1124
+ e.onWarning && e.onWarning.call(null, sr(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 gn = {
1127
+ YAML: function(n, r, i) {
1128
+ var t, l, o;
1129
+ n.version !== null && y(n, "duplication of %YAML directive"), i.length !== 1 && y(n, "YAML directive accepts exactly one argument"), t = /^([0-9]+)\.([0-9]+)$/.exec(i[0]), t === null && y(n, "ill-formed argument of the YAML directive"), l = parseInt(t[1], 10), o = parseInt(t[2], 10), l !== 1 && y(n, "unacceptable YAML version of the document"), n.version = i[0], n.checkLineBreaks = o < 2, o !== 1 && o !== 2 && _e(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, l;
1133
+ i.length !== 2 && y(n, "TAG directive accepts exactly two arguments"), t = i[0], l = i[1], or.test(t) || y(n, "ill-formed tag handle (first argument) of the TAG directive"), q.call(n.tagMap, t) && y(n, 'there is a previously declared suffix for "' + t + '" tag handle'), lr.test(l) || y(n, "ill-formed tag prefix (second argument) of the TAG directive");
1247
1134
  try {
1248
- t = decodeURIComponent(t);
1135
+ l = decodeURIComponent(l);
1249
1136
  } catch {
1250
- x(n, "tag prefix is malformed: " + t);
1137
+ y(n, "tag prefix is malformed: " + l);
1251
1138
  }
1252
- n.tagMap[o] = t;
1139
+ n.tagMap[t] = l;
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 G(e, n, r, i) {
1143
+ var t, l, o, a;
1144
+ if (n < r) {
1145
+ if (a = e.input.slice(n, r), i)
1146
+ for (t = 0, l = a.length; t < l; t += 1)
1147
+ o = a.charCodeAt(t), o === 9 || 32 <= o && o <= 1114111 || y(e, "expected valid JSON character");
1148
+ else qi.test(a) && y(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);
1152
+ function mn(e, n, r, i) {
1153
+ var t, l, o, a;
1154
+ for (F.isObject(r) || y(e, "cannot merge mappings; the provided source object is unacceptable"), t = Object.keys(r), o = 0, a = t.length; o < a; o += 1)
1155
+ l = t[o], q.call(n, l) || (ar(n, l, r[l]), i[l] = !0);
1269
1156
  }
1270
- function X(e, n, i, r, o, t, l, a, c) {
1157
+ function ie(e, n, r, i, t, l, o, a, c) {
1271
1158
  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);
1159
+ if (Array.isArray(t))
1160
+ for (t = Array.prototype.slice.call(t), u = 0, s = t.length; u < s; u += 1)
1161
+ Array.isArray(t[u]) && y(e, "nested arrays are not supported inside keys"), typeof t == "object" && hn(t[u]) === "[object Object]" && (t[u] = "[object Object]");
1162
+ if (typeof t == "object" && hn(t) === "[object Object]" && (t = "[object Object]"), t = String(t), n === null && (n = {}), i === "tag:yaml.org,2002:merge")
1163
+ if (Array.isArray(l))
1164
+ for (u = 0, s = l.length; u < s; u += 1)
1165
+ mn(e, n, l[u], r);
1279
1166
  else
1280
- tn(e, n, t, i);
1167
+ mn(e, n, l, 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 && !q.call(r, t) && q.call(n, t) && (e.line = o || e.line, e.lineStart = a || e.lineStart, e.position = c || e.position, y(e, "duplicated mapping key")), ar(n, t, l), 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++) : y(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 (; V(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 && _e(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 Te(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 Ve(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 rt(e, n, r) {
1201
+ var i, t, l, o, a, c, u, s, f = e.kind, g = e.result, h;
1202
+ if (h = e.input.charCodeAt(e.position), D(h) || re(h) || h === 35 || h === 38 || h === 42 || h === 33 || h === 124 || h === 62 || h === 39 || h === 34 || h === 37 || h === 64 || h === 96 || (h === 63 || h === 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; ) {
1318
- if (d === 58) {
1319
- if (o = e.input.charCodeAt(e.position + 1), M(o) || i && V(o))
1204
+ for (e.kind = "scalar", e.result = "", l = o = e.position, a = !1; h !== 0; ) {
1205
+ if (h === 58) {
1206
+ if (t = e.input.charCodeAt(e.position + 1), D(t) || r && re(t))
1320
1207
  break;
1321
- } else if (d === 35) {
1322
- if (r = e.input.charCodeAt(e.position - 1), M(r))
1208
+ } else if (h === 35) {
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 && Te(e) || r && re(h))
1326
1213
  break;
1327
- if (P(d))
1214
+ if (z(h))
1328
1215
  if (c = e.line, u = e.lineStart, s = e.lineIndent, O(e, !1, -1), e.lineIndent >= n) {
1329
- a = !0, d = e.input.charCodeAt(e.position);
1216
+ a = !0, h = 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 = o, e.line = c, e.lineStart = u, e.lineIndent = s;
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 && (G(e, l, o, !1), Ve(e, e.line - c), l = o = e.position, a = !1), V(h) || (o = e.position + 1), h = 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 G(e, l, o, !1), e.result ? !0 : (e.kind = f, e.result = g, !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 it(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 (G(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) ? (G(e, i, t, !0), Ve(e, O(e, !1, n)), i = t = e.position) : e.position === e.lineStart && Te(e) ? y(e, "unexpected end of the document within a single quoted scalar") : (e.position++, t = e.position);
1238
+ y(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 tt(e, n) {
1241
+ var r, i, t, l, o, 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 G(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 (G(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 && cr[a])
1251
+ e.result += ur[a], e.position++;
1252
+ else if ((o = Ji(a)) > 0) {
1253
+ for (t = o, l = 0; t > 0; t--)
1254
+ a = e.input.charCodeAt(++e.position), (o = Qi(a)) >= 0 ? l = (l << 4) + o : y(e, "expected hexadecimal character");
1255
+ e.result += et(l), 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
+ y(e, "unknown escape sequence");
1258
+ r = i = e.position;
1259
+ } else z(a) ? (G(e, r, i, !0), Ve(e, O(e, !1, n)), r = i = e.position) : e.position === e.lineStart && Te(e) ? y(e, "unexpected end of the document within a double quoted scalar") : (e.position++, i = e.position);
1260
+ }
1261
+ y(e, "unexpected end of the stream within a double quoted scalar");
1262
+ }
1263
+ function ot(e, n) {
1264
+ var r = !0, i, t, l, o = e.tag, a, c = e.anchor, u, s, f, g, h, x = /* @__PURE__ */ Object.create(null), d, A, E, v;
1265
+ if (v = e.input.charCodeAt(e.position), v === 91)
1266
+ s = 93, h = !1, a = [];
1267
+ else if (v === 123)
1268
+ s = 125, h = !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), v = e.input.charCodeAt(++e.position); v !== 0; ) {
1272
+ if (O(e, !0, n), v = e.input.charCodeAt(e.position), v === s)
1273
+ return e.position++, e.tag = o, e.anchor = c, e.kind = h ? "mapping" : "sequence", e.result = a, !0;
1274
+ r ? v === 44 && y(e, "expected the node content, but found ','") : y(e, "missed comma between flow collection entries"), A = d = E = null, f = g = !1, v === 63 && (u = e.input.charCodeAt(e.position + 1), D(u) && (f = g = !0, e.position++, O(e, !0, n))), i = e.line, t = e.lineStart, l = e.position, te(e, n, Ee, !1, !0), A = e.tag, d = e.result, O(e, !0, n), v = e.input.charCodeAt(e.position), (g || e.line === i) && v === 58 && (f = !0, v = e.input.charCodeAt(++e.position), O(e, !0, n), te(e, n, Ee, !1, !0), E = e.result), h ? ie(e, a, x, A, d, E, i, t, l) : f ? a.push(ie(e, null, x, A, d, E, i, t, l)) : a.push(d), O(e, !0, n), v = e.input.charCodeAt(e.position), v === 44 ? (r = !0, v = e.input.charCodeAt(++e.position)) : r = !1;
1275
+ }
1276
+ y(e, "unexpected end of the stream within a flow collection");
1277
+ }
1278
+ function lt(e, n) {
1279
+ var r, i, t = Me, l = !1, o = !1, a = n, c = 0, u = !1, s, 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
+ Me === t ? t = f === 43 ? pn : Gi : y(e, "repeat of a chomping mode identifier");
1289
+ else if ((s = Zi(f)) >= 0)
1290
+ s === 0 ? y(e, "bad explicit indentation width of a block scalar; it cannot be less than one") : o ? y(e, "repeat of an indentation width identifier") : (a = n + s - 1, o = !0);
1404
1291
  else
1405
1292
  break;
1406
- if (U(p)) {
1293
+ if (V(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 (V(f));
1297
+ if (f === 35)
1411
1298
  do
1412
- p = e.input.charCodeAt(++e.position);
1413
- while (!P(p) && p !== 0);
1299
+ f = e.input.charCodeAt(++e.position);
1300
+ while (!z(f) && f !== 0);
1414
1301
  }
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)) {
1302
+ for (; f !== 0; ) {
1303
+ for (qe(e), e.lineIndent = 0, f = e.input.charCodeAt(e.position); (!o || e.lineIndent < a) && f === 32; )
1304
+ e.lineIndent++, f = e.input.charCodeAt(++e.position);
1305
+ if (!o && e.lineIndent > a && (a = e.lineIndent), z(f)) {
1419
1306
  c++;
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 === pn ? e.result += F.repeat(`
1311
+ `, l ? 1 + c : c) : t === Me && l && (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(`
1315
+ for (i ? V(f) ? (u = !0, e.result += F.repeat(`
1316
+ `, l ? 1 + c : c)) : u ? (u = !1, e.result += F.repeat(`
1317
+ `, c + 1)) : c === 0 ? l && (e.result += " ") : e.result += F.repeat(`
1431
1318
  `, 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);
1319
+ `, l ? 1 + c : c), l = !0, o = !0, c = 0, r = e.position; !z(f) && f !== 0; )
1320
+ f = e.input.charCodeAt(++e.position);
1321
+ G(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 yn(e, n) {
1326
+ var r, i = e.tag, t = e.anchor, l = [], o, a = !1, c;
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] = l), c = e.input.charCodeAt(e.position); c !== 0 && (e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, y(e, "tab characters must not be used in indentation")), !(c !== 45 || (o = e.input.charCodeAt(e.position + 1), !D(o)))); ) {
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
+ l.push(null), c = 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), l.push(e.result), O(e, !0, -1), c = e.input.charCodeAt(e.position), (e.line === r || e.lineIndent > n) && c !== 0)
1334
+ y(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 = l, !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 at(e, n, r) {
1341
+ var i, t, l, o, a, c, u = e.tag, s = e.anchor, f = {}, g = /* @__PURE__ */ Object.create(null), h = null, x = null, d = null, A = !1, E = !1, v;
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), v = e.input.charCodeAt(e.position); v !== 0; ) {
1344
+ if (!A && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, y(e, "tab characters must not be used in indentation")), i = e.input.charCodeAt(e.position + 1), l = e.line, (v === 63 || v === 58) && D(i))
1345
+ v === 63 ? (A && (ie(e, f, g, h, x, null, o, a, c), h = x = d = null), E = !0, A = !0, t = !0) : A ? (A = !1, t = !0) : y(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, v = i;
1459
1346
  else {
1460
- if (l = e.line, a = e.lineStart, c = e.position, !Q(e, i, $n, !1, !0))
1347
+ if (o = e.line, a = e.lineStart, c = 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 === l) {
1350
+ for (v = e.input.charCodeAt(e.position); V(v); )
1351
+ v = e.input.charCodeAt(++e.position);
1352
+ if (v === 58)
1353
+ v = e.input.charCodeAt(++e.position), D(v) || y(e, "a whitespace character is expected after the key-value separator within a block mapping"), A && (ie(e, f, g, h, x, null, o, a, c), h = x = d = null), E = !0, A = !1, t = !1, h = e.tag, x = e.result;
1354
+ else if (E)
1355
+ y(e, "can not read an implicit mapping pair; a colon is missed");
1469
1356
  else
1470
1357
  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");
1358
+ } else if (E)
1359
+ y(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
1473
1360
  else
1474
1361
  return e.tag = u, e.anchor = s, !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 === l || e.lineIndent > n) && (A && (o = e.line, a = e.lineStart, c = e.position), te(e, n, Se, !0, t) && (A ? x = e.result : d = e.result), A || (ie(e, f, g, h, x, d, o, a, c), h = x = d = null), O(e, !0, -1), v = e.input.charCodeAt(e.position)), (e.line === l || e.lineIndent > n) && v !== 0)
1364
+ y(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 A && ie(e, f, g, h, x, null, o, a, c), E && (e.tag = u, e.anchor = s, e.kind = "mapping", e.result = f), E;
1482
1369
  }
1483
- function eo(e) {
1484
- var n, i = !1, r = !1, o, t, l;
1485
- 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) {
1370
+ function ct(e) {
1371
+ var n, r = !1, i = !1, t, l, o;
1372
+ if (o = e.input.charCodeAt(e.position), o !== 33) return !1;
1373
+ if (e.tag !== null && y(e, "duplication of a tag property"), o = e.input.charCodeAt(++e.position), o === 60 ? (r = !0, o = e.input.charCodeAt(++e.position)) : o === 33 ? (i = !0, t = "!!", o = e.input.charCodeAt(++e.position)) : t = "!", n = e.position, r) {
1487
1374
  do
1488
- l = e.input.charCodeAt(++e.position);
1489
- 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");
1375
+ o = e.input.charCodeAt(++e.position);
1376
+ while (o !== 0 && o !== 62);
1377
+ e.position < e.length ? (l = e.input.slice(n, e.position), o = e.input.charCodeAt(++e.position)) : y(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 (; o !== 0 && !D(o); )
1380
+ o === 33 && (i ? y(e, "tag suffix cannot contain exclamation marks") : (t = e.input.slice(n - 1, e.position + 1), or.test(t) || y(e, "named tag handle cannot contain such characters"), i = !0, n = e.position + 1)), o = e.input.charCodeAt(++e.position);
1381
+ l = e.input.slice(n, e.position), Xi.test(l) && y(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
+ l && !lr.test(l) && y(e, "tag name cannot contain such characters: " + l);
1497
1384
  try {
1498
- t = decodeURIComponent(t);
1385
+ l = decodeURIComponent(l);
1499
1386
  } catch {
1500
- x(e, "tag name is malformed: " + t);
1387
+ y(e, "tag name is malformed: " + l);
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;
1389
+ return r ? e.tag = l : q.call(e.tagMap, t) ? e.tag = e.tagMap[t] + l : t === "!" ? e.tag = "!" + l : t === "!!" ? e.tag = "tag:yaml.org,2002:" + l : y(e, 'undeclared tag handle "' + t + '"'), !0;
1503
1390
  }
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;
1510
- }
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 && y(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 && y(e, "name of an anchor node must contain at least one character"), e.anchor = e.input.slice(n, e.position), !0;
1397
+ }
1398
+ function st(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 && y(e, "name of an alias node must contain at least one character"), r = e.input.slice(n, e.position), q.call(e.anchorMap, r) || y(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 l, o, a, c = 1, u = !1, s = !1, f, g, h, x, d, A;
1407
+ if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, l = o = a = Se === r || tr === r, i && O(e, !0, -1) && (u = !0, e.lineIndent > n ? c = 1 : e.lineIndent === n ? c = 0 : e.lineIndent < n && (c = -1)), c === 1)
1408
+ for (; ct(e) || ut(e); )
1409
+ O(e, !0, -1) ? (u = !0, a = l, e.lineIndent > n ? c = 1 : e.lineIndent === n ? c = 0 : e.lineIndent < n && (c = -1)) : a = !1;
1410
+ if (a && (a = u || t), (c === 1 || Se === r) && (Ee === r || ir === r ? d = n : d = n + 1, A = e.position - e.lineStart, c === 1 ? a && (yn(e, A) || at(e, A, d)) || ot(e, d) ? s = !0 : (o && lt(e, d) || it(e, d) || tt(e, d) ? s = !0 : st(e) ? (s = !0, (e.tag !== null || e.anchor !== null) && y(e, "alias node should not have any properties")) : rt(e, d, Ee === r) && (s = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : c === 0 && (s = a && yn(e, A))), 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" && y(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), f = 0, g = e.implicitTypes.length; f < g; f += 1)
1414
+ if (x = e.implicitTypes[f], x.resolve(e.result)) {
1415
+ e.result = x.construct(e.result), e.tag = x.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 (q.call(e.typeMap[e.kind || "fallback"], e.tag))
1420
+ x = 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 (x = null, h = e.typeMap.multi[e.kind || "fallback"], f = 0, g = h.length; f < g; f += 1)
1423
+ if (e.tag.slice(0, h[f].tag.length) === h[f].tag) {
1424
+ x = h[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
+ x || y(e, "unknown tag !<" + e.tag + ">"), e.result !== null && x.kind !== e.kind && y(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + x.kind + '", not "' + e.kind + '"'), x.resolve(e.result, e.tag) ? (e.result = x.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : y(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
1541
1428
  }
1542
1429
  return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || s;
1543
1430
  }
1544
- function ro(e) {
1545
- var n = e.position, i, r, o, t = !1, l;
1546
- 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); )
1548
- 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); )
1551
- l = e.input.charCodeAt(++e.position);
1552
- if (l === 35) {
1431
+ function ft(e) {
1432
+ var n = e.position, r, i, t, l = !1, o;
1433
+ for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = /* @__PURE__ */ Object.create(null), e.anchorMap = /* @__PURE__ */ Object.create(null); (o = e.input.charCodeAt(e.position)) !== 0 && (O(e, !0, -1), o = e.input.charCodeAt(e.position), !(e.lineIndent > 0 || o !== 37)); ) {
1434
+ for (l = !0, o = e.input.charCodeAt(++e.position), r = e.position; o !== 0 && !D(o); )
1435
+ o = e.input.charCodeAt(++e.position);
1436
+ for (i = e.input.slice(r, e.position), t = [], i.length < 1 && y(e, "directive name must not be less than one character in length"); o !== 0; ) {
1437
+ for (; V(o); )
1438
+ o = e.input.charCodeAt(++e.position);
1439
+ if (o === 35) {
1553
1440
  do
1554
- l = e.input.charCodeAt(++e.position);
1555
- while (l !== 0 && !P(l));
1441
+ o = e.input.charCodeAt(++e.position);
1442
+ while (o !== 0 && !z(o));
1556
1443
  break;
1557
1444
  }
1558
- if (P(l)) break;
1559
- for (i = e.position; l !== 0 && !M(l); )
1560
- l = e.input.charCodeAt(++e.position);
1561
- o.push(e.input.slice(i, e.position));
1445
+ if (z(o)) break;
1446
+ for (r = e.position; o !== 0 && !D(o); )
1447
+ o = e.input.charCodeAt(++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
+ o !== 0 && qe(e), q.call(gn, i) ? gn[i](e, i, t) : _e(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)) : l && y(e, "directives end mark is expected"), te(e, e.lineIndent - 1, Se, !1, !0), O(e, !0, -1), e.checkLineBreaks && Vi.test(e.input.slice(n, e.position)) && _e(e, "non-ASCII line breaks are interpreted as content"), e.documents.push(e.result), e.position === e.lineStart && Te(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
+ y(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 nt(e, n), i = e.indexOf("\0");
1465
+ for (i !== -1 && (r.position = i, y(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
+ ft(r);
1469
+ return r.documents;
1470
+ }
1471
+ function pt(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, l = i.length; t < l; 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 dt = pt, gt = ht, pr = {
1488
+ loadAll: dt,
1489
+ load: gt
1490
+ }, hr = Object.prototype.toString, dr = Object.prototype.hasOwnProperty, Xe = 65279, mt = 9, pe = 10, yt = 13, xt = 32, vt = 33, bt = 34, Ye = 35, wt = 37, At = 38, Ct = 39, Et = 42, gr = 44, St = 45, ke = 58, _t = 61, kt = 62, Ot = 63, Ft = 64, mr = 91, yr = 93, Tt = 96, xr = 123, Lt = 124, vr = 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 jt = [
1620
1507
  "y",
1621
1508
  "Y",
1622
1509
  "yes",
@@ -1633,238 +1520,238 @@ 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
+ ], It = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
1524
+ function Nt(e, n) {
1525
+ var r, i, t, l, o, a, c;
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, l = i.length; t < l; t += 1)
1528
+ o = i[t], a = String(n[o]), o.slice(0, 2) === "!!" && (o = "tag:yaml.org,2002:" + o.slice(2)), c = e.compiledTypeMap.fallback[o], c && dr.call(c.styleAliases, a) && (a = c.styleAliases[a]), r[o] = a;
1529
+ return r;
1643
1530
  }
1644
- function Fo(e) {
1645
- var n, i, r;
1531
+ function Rt(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 Mt = 1, he = 2;
1544
+ function Pt(e) {
1545
+ this.schema = e.schema || Ge, 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 = Nt(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 === '"' ? he : Mt, 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 xn(e, n) {
1548
+ for (var r = F.repeat(" ", n), i = 0, t = -1, l = "", o, a = e.length; i < a; )
1549
+ t = e.indexOf(`
1550
+ `, i), t === -1 ? (o = e.slice(i), i = a) : (o = e.slice(i, t + 1), i = t + 1), o.length && o !== `
1551
+ ` && (l += r), l += o;
1552
+ return l;
1666
1553
  }
1667
- function je(e, n) {
1554
+ function ze(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 Dt(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 Oe(e) {
1566
+ return e === xt || e === mt;
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 de(e) {
1569
+ return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== Xe || 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 de(e) && e !== Xe && e !== yt && e !== pe;
1686
1573
  }
1687
- function fn(e, n, i) {
1688
- var r = un(e), o = r && !me(e);
1574
+ function bn(e, n, r) {
1575
+ var i = vn(e), t = i && !Oe(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 !== xr && e !== vr) && e !== Ye && !(n === ke && !t) || vn(n) && !Oe(n) && e === Ye || n === ke && 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 Bt(e) {
1585
+ return de(e) && e !== Xe && !Oe(e) && e !== St && e !== Ot && e !== ke && e !== gr && e !== mr && e !== yr && e !== xr && e !== vr && e !== Ye && e !== At && e !== Et && e !== vt && e !== Lt && e !== _t && e !== kt && e !== Ct && e !== bt && e !== wt && e !== Ft && e !== Tt;
1699
1586
  }
1700
- function Io(e) {
1701
- return !me(e) && e !== ge;
1587
+ function Ut(e) {
1588
+ return !Oe(e) && e !== ke;
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 se(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 br(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));
1714
- if (n || l)
1598
+ var wr = 1, $e = 2, Ar = 3, Cr = 4, ee = 5;
1599
+ function Yt(e, n, r, i, t, l, o, a) {
1600
+ var c, u = 0, s = null, f = !1, g = !1, h = i !== -1, x = -1, d = Bt(se(e, 0)) && Ut(se(e, e.length - 1));
1601
+ if (n || o)
1715
1602
  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;
1603
+ if (u = se(e, c), !de(u))
1604
+ return ee;
1605
+ d = d && bn(u, s, a), s = u;
1719
1606
  }
1720
1607
  else {
1721
1608
  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;
1609
+ if (u = se(e, c), u === pe)
1610
+ f = !0, h && (g = g || // Foldable line = too long, and not more-indented.
1611
+ c - x - 1 > i && e[x + 1] !== " ", x = c);
1612
+ else if (!de(u))
1613
+ return ee;
1614
+ d = d && bn(u, s, a), s = u;
1728
1615
  }
1729
- h = h || d && c - y - 1 > r && e[y + 1] !== " ";
1616
+ g = g || h && c - x - 1 > i && e[x + 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 && !g ? d && !o && !t(e) ? wr : l === he ? ee : $e : r > 9 && br(e) ? ee : o ? l === he ? ee : $e : g ? Cr : Ar;
1732
1619
  }
1733
- function Ro(e, n, i, r, o) {
1620
+ function zt(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;
1623
+ return e.quotingType === he ? '""' : "''";
1624
+ if (!e.noCompatMode && (jt.indexOf(n) !== -1 || It.test(n)))
1625
+ return e.quotingType === he ? '"' + n + '"' : "'" + n + "'";
1626
+ var l = e.indent * Math.max(1, r), o = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - l), a = i || e.flowLevel > -1 && r >= e.flowLevel;
1740
1627
  function c(u) {
1741
- return To(e, u);
1628
+ return Dt(e, u);
1742
1629
  }
1743
- switch (No(
1630
+ switch (Yt(
1744
1631
  n,
1745
1632
  a,
1746
1633
  e.indent,
1747
- l,
1634
+ o,
1748
1635
  c,
1749
1636
  e.quotingType,
1750
- e.forceQuotes && !r,
1751
- o
1637
+ e.forceQuotes && !i,
1638
+ t
1752
1639
  )) {
1753
- case ci:
1640
+ case wr:
1754
1641
  return n;
1755
- case Ie:
1642
+ case $e:
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) + An(xn(n, l));
1646
+ case Cr:
1647
+ return ">" + wn(n, e.indent) + An(xn($t(n, o), l));
1648
+ case ee:
1649
+ return '"' + Ht(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 = br(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
+ `), l = t ? "+" : i ? "" : "-";
1660
+ return r + l + `
1774
1661
  `;
1775
1662
  }
1776
- function pn(e) {
1663
+ function An(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() {
1667
+ function $t(e, n) {
1668
+ for (var r = /(\n+)([^\n]*)/g, i = (function() {
1782
1669
  var u = 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 u = u !== -1 ? u : e.length, r.lastIndex = u, Cn(e.slice(0, u), n);
1672
+ })(), t = e[0] === `
1673
+ ` || e[0] === " ", l, o; o = r.exec(e); ) {
1674
+ var a = o[1], c = o[2];
1675
+ l = c[0] === " ", i += a + (!t && !l && c !== "" ? `
1676
+ ` : "") + Cn(c, n), t = l;
1790
1677
  }
1791
- return r;
1678
+ return i;
1792
1679
  }
1793
- function dn(e, n) {
1680
+ function Cn(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;
1682
+ for (var r = / [^ ]/g, i, t = 0, l, o = 0, a = 0, c = ""; i = r.exec(e); )
1683
+ a = i.index, a - t > n && (l = o > t ? o : a, c += `
1684
+ ` + e.slice(t, l), t = l + 1), o = a;
1798
1685
  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);
1686
+ `, e.length - t > n && o > t ? c += e.slice(t, o) + `
1687
+ ` + e.slice(o + 1) : c += e.slice(t), c.slice(1);
1801
1688
  }
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);
1689
+ function Ht(e) {
1690
+ for (var n = "", r = 0, i, t = 0; t < e.length; r >= 65536 ? t += 2 : t++)
1691
+ r = se(e, t), i = L[r], !i && de(r) ? (n += e[t], r >= 65536 && (n += e[t + 1])) : n += i || Rt(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 Kt(e, n, r) {
1695
+ var i = "", t = e.tag, l, o, a;
1696
+ for (l = 0, o = r.length; l < o; l += 1)
1697
+ a = r[l], e.replacer && (a = e.replacer.call(r, String(l), a)), (H(e, n, a, !1, !1) || typeof a > "u" && H(e, n, null, !1, !1)) && (i !== "" && (i += "," + (e.condenseFlow ? "" : " ")), i += e.dump);
1698
+ e.tag = t, e.dump = "[" + i + "]";
1699
+ }
1700
+ function En(e, n, r, i) {
1701
+ var t = "", l = e.tag, o, a, c;
1702
+ for (o = 0, a = r.length; o < a; o += 1)
1703
+ c = r[o], e.replacer && (c = e.replacer.call(r, String(o), c)), (H(e, n + 1, c, !0, !0, !1, !0) || typeof c > "u" && H(e, n + 1, null, !0, !0, !1, !0)) && ((!i || t !== "") && (t += ze(e, n)), e.dump && pe === e.dump.charCodeAt(0) ? t += "-" : t += "- ", t += e.dump);
1704
+ e.tag = l, e.dump = t || "[]";
1705
+ }
1706
+ function Wt(e, n, r) {
1707
+ var i = "", t = e.tag, l = Object.keys(r), o, a, c, u, s;
1708
+ for (o = 0, a = l.length; o < a; o += 1)
1709
+ s = "", i !== "" && (s += ", "), e.condenseFlow && (s += '"'), c = l[o], u = r[c], e.replacer && (u = e.replacer.call(r, c, u)), H(e, n, c, !1, !1) && (e.dump.length > 1024 && (s += "? "), s += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), H(e, n, u, !1, !1) && (s += e.dump, i += s));
1710
+ e.tag = t, e.dump = "{" + i + "}";
1711
+ }
1712
+ function Gt(e, n, r, i) {
1713
+ var t = "", l = e.tag, o = Object.keys(r), a, c, u, s, f, g;
1827
1714
  if (e.sortKeys === !0)
1828
- l.sort();
1715
+ o.sort();
1829
1716
  else if (typeof e.sortKeys == "function")
1830
- l.sort(e.sortKeys);
1717
+ o.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, c = o.length; a < c; a += 1)
1721
+ g = "", (!i || t !== "") && (g += ze(e, n)), u = o[a], s = r[u], e.replacer && (s = e.replacer.call(r, u, s)), H(e, n + 1, u, !0, !0, !0) && (f = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, f && (e.dump && pe === e.dump.charCodeAt(0) ? g += "?" : g += "? "), g += e.dump, f && (g += ze(e, n)), H(e, n + 1, s, !0, f) && (e.dump && pe === e.dump.charCodeAt(0) ? g += ":" : g += ": ", g += e.dump, t += g));
1722
+ e.tag = l, e.dump = t || "{}";
1723
+ }
1724
+ function Sn(e, n, r) {
1725
+ var i, t, l, o, a, c;
1726
+ for (t = r ? e.explicitTypes : e.implicitTypes, l = 0, o = t.length; l < o; l += 1)
1727
+ if (a = t[l], (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 (c = e.styleMap[a.tag] || a.defaultStyle, hr.call(a.represent) === "[object Function]")
1730
+ i = a.represent(n, c);
1731
+ else if (dr.call(a.represent, c))
1732
+ i = a.represent[c](n, c);
1846
1733
  else
1847
1734
  throw new I("!<" + a.tag + '> tag resolver accepts not "' + c + '" style');
1848
- e.dump = r;
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 H(e, n, r, i, t, l, o) {
1742
+ e.tag = null, e.dump = r, Sn(e, r, !1) || Sn(e, r, !0);
1743
+ var a = hr.call(e.dump), c = i, u;
1744
+ i && (i = e.flowLevel < 0 || e.flowLevel > n);
1745
+ var s = a === "[object Object]" || a === "[object Array]", f, g;
1746
+ if (s && (f = e.duplicates.indexOf(r), g = f !== -1), (e.tag !== null && e.tag !== "?" || g || e.indent !== 2 && n > 0) && (t = !1), g && 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 (s && g && !e.usedDuplicates[f] && (e.usedDuplicates[f] = !0), a === "[object Object]")
1750
+ i && Object.keys(e.dump).length !== 0 ? (Gt(e, n, e.dump, t), g && (e.dump = "&ref_" + f + e.dump)) : (Wt(e, n, e.dump), g && (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 && !o && n > 0 ? En(e, n - 1, e.dump, t) : En(e, n, e.dump, t), g && (e.dump = "&ref_" + f + e.dump)) : (Kt(e, n, e.dump), g && (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 !== "?" && zt(e, e.dump, n, l, c);
1868
1755
  else {
1869
1756
  if (a === "[object Undefined]")
1870
1757
  return !1;
@@ -1877,285 +1764,823 @@ function Y(e, n, i, r, o, t, l) {
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 qt(e, n) {
1768
+ var r = [], i = [], t, l;
1769
+ for (He(e, r, i), t = 0, l = i.length; t < l; t += 1)
1770
+ n.duplicates.push(r[i[t]]);
1771
+ n.usedDuplicates = new Array(l);
1885
1772
  }
1886
- function Ne(e, n, i) {
1887
- var r, o, t;
1773
+ function He(e, n, r) {
1774
+ var i, t, l;
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, l = e.length; t < l; t += 1)
1780
+ He(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, l = i.length; t < l; t += 1)
1783
+ He(e[i[t]], n, r);
1897
1784
  }
1898
- function Ho(e, n) {
1785
+ function Vt(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 Pt(n);
1788
+ r.noRefs || qt(e, r);
1789
+ var i = e;
1790
+ return r.replacer && (i = r.replacer.call({ "": i }, "", i)), H(r, 0, i, !0, !0) ? r.dump + `
1904
1791
  ` : "";
1905
1792
  }
1906
- var Uo = Ho, $o = {
1907
- dump: Uo
1793
+ var Xt = Vt, Qt = {
1794
+ dump: Xt
1908
1795
  };
1909
- function ze(e, n) {
1796
+ function Qe(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 Jt = T, Zt = Dn, eo = zn, no = Gn, ro = qn, io = Ge, to = pr.load, oo = pr.loadAll, lo = Qt.dump, ao = I, co = {
1802
+ binary: Zn,
1803
+ float: Wn,
1804
+ map: Yn,
1805
+ null: $n,
1806
+ pairs: nr,
1807
+ set: rr,
1808
+ timestamp: Qn,
1809
+ bool: Hn,
1810
+ int: Kn,
1811
+ merge: Jn,
1812
+ omap: er,
1813
+ seq: Un,
1814
+ str: Bn
1815
+ }, uo = Qe("safeLoad", "load"), so = Qe("safeLoadAll", "loadAll"), fo = Qe("safeDump", "dump"), _n = {
1816
+ Type: Jt,
1817
+ Schema: Zt,
1818
+ FAILSAFE_SCHEMA: eo,
1819
+ JSON_SCHEMA: no,
1820
+ CORE_SCHEMA: ro,
1821
+ DEFAULT_SCHEMA: io,
1822
+ load: to,
1823
+ loadAll: oo,
1824
+ dump: lo,
1825
+ YAMLException: ao,
1826
+ types: co,
1827
+ safeLoad: uo,
1828
+ safeLoadAll: so,
1829
+ safeDump: fo
1943
1830
  };
1944
- const ue = (e, n) => {
1831
+ const we = (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
+ }, Ae = (e) => e instanceof Error ? e.message : String(e), Ce = (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 we(Be.parse(r), "json");
1842
+ } catch (t) {
1843
+ throw new Error(`Failed to parse --strings as JSON. Hint: check --strings-format=json. ${Ae(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 we(_n.load(r), "yaml");
1848
+ } catch (t) {
1849
+ throw new Error(`Failed to parse --strings as YAML. Hint: check --strings-format=yaml. ${Ae(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 we(_n.load(r), "yaml");
1854
+ } catch (t) {
1855
+ i.push(`yaml error: ${Ae(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 we(Be.parse(r), "json");
1859
+ } catch (t) {
1860
+ i.push(`json error: ${Ae(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 Er() {
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") {
1874
+ async function po(e, n = Er, r = "auto") {
1988
1875
  if (e !== void 0) {
1989
1876
  if (e === "") {
1990
- const r = await n();
1991
- return r.trim() ? se(r, i) : void 0;
1877
+ const i = await n();
1878
+ return i.trim() ? Ce(i, r) : void 0;
1992
1879
  }
1993
1880
  if (typeof e == "string")
1994
- return se(e, i);
1881
+ return Ce(e, r);
1995
1882
  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;
1883
+ const i = {};
1884
+ for (const t of e)
1885
+ typeof t == "string" && Object.assign(i, Ce(t, r));
1886
+ return i;
2000
1887
  }
2001
1888
  if (typeof e == "boolean" && e === !0) {
2002
- const r = await n();
2003
- return r.trim() ? se(r, i) : void 0;
1889
+ const i = await n();
1890
+ return i.trim() ? Ce(i, r) : void 0;
2004
1891
  }
2005
1892
  }
2006
1893
  }
2007
- async function tl({
1894
+ async function ho({
2008
1895
  path: e,
2009
1896
  key: n,
2010
- comment: i,
2011
- stringsArg: r,
2012
- stringsFormat: o,
2013
- defaultString: t,
2014
- language: l,
2015
- stdinReader: a = si,
1897
+ comment: r,
1898
+ stringsArg: i,
1899
+ stringsFormat: t,
1900
+ defaultString: l,
1901
+ language: o,
1902
+ stdinReader: a = Er,
2016
1903
  configPath: c
2017
1904
  }) {
2018
- const u = await ll(r, a, o);
2019
- await Fi(e, n, i, u, c, t, l);
1905
+ const u = await po(i, a, t);
1906
+ await mo(e, n, r, u, c, l, o);
1907
+ }
1908
+ function go() {
1909
+ return {
1910
+ command: "add",
1911
+ describe: "Add a string",
1912
+ builder: (e) => e.option("key", {
1913
+ type: "string",
1914
+ describe: "The key of the string",
1915
+ demandOption: !0
1916
+ }).option("comment", {
1917
+ type: "string",
1918
+ describe: "The comment for the string"
1919
+ }).option("language", {
1920
+ type: "string",
1921
+ alias: "l",
1922
+ describe: "The language of the string provided with --text"
1923
+ }).option("text", {
1924
+ type: "string",
1925
+ describe: "The string value for the default language"
1926
+ }).option("strings", {
1927
+ type: "string",
1928
+ describe: "The strings JSON or YAML"
1929
+ }).option("strings-format", {
1930
+ type: "string",
1931
+ choices: ["auto", "json", "yaml"],
1932
+ default: "auto",
1933
+ describe: "Format for the data provided with --strings"
1934
+ }),
1935
+ handler: async (e) => {
1936
+ await ho({
1937
+ path: e.path,
1938
+ key: e.key,
1939
+ comment: e.comment,
1940
+ stringsArg: e.strings,
1941
+ stringsFormat: e["strings-format"],
1942
+ defaultString: e.text,
1943
+ language: e.language,
1944
+ stdinReader: void 0,
1945
+ configPath: e.config
1946
+ }), ne.info(C.green(`✓ Added key "${e.key}"`));
1947
+ }
1948
+ };
2020
1949
  }
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;
1950
+ async function mo(e, n, r, i, t, l, o) {
1951
+ const a = await me(e);
1952
+ if (!a.sourceLanguage)
1953
+ throw new Error('The xcstrings file is missing "sourceLanguage".');
1954
+ const c = a.sourceLanguage;
1955
+ a.strings || (a.strings = {});
1956
+ const s = (await Ke(t))?.missingLanguagePolicy || "skip";
1957
+ let f;
1958
+ const g = async (d) => s === "include" ? !0 : (f || (f = await Rn(e, t)), f.includes(d)), h = {
1959
+ ...a.strings[n],
1960
+ extractionState: "manual"
1961
+ };
1962
+ if (r && (h.comment = r), l !== void 0) {
1963
+ const d = o ?? c;
1964
+ if (!await g(d))
1965
+ throw new Error(`Language "${d}" is not supported.`);
1966
+ h.localizations = h.localizations || {}, h.localizations[d] = {
1967
+ stringUnit: {
1968
+ state: "translated",
1969
+ value: l
1970
+ }
1971
+ };
1972
+ }
1973
+ const x = i ? { ...i } : void 0;
1974
+ if (x) {
1975
+ const d = [];
1976
+ for (const [A, E] of Object.entries(x)) {
1977
+ if (l !== void 0 && A === (o ?? c))
1978
+ continue;
1979
+ (s === "include" ? !0 : A === c || await g(A)) && d.push([A, E]);
1980
+ }
1981
+ if (d.length > 0) {
1982
+ h.localizations = h.localizations || {};
1983
+ for (const [A, E] of d)
1984
+ h.localizations[A] = {
1985
+ stringUnit: {
1986
+ state: "translated",
1987
+ value: E
1988
+ }
1989
+ };
1990
+ }
1991
+ }
1992
+ a.strings[n] = h, await Nn(e, a);
1993
+ }
1994
+ function yo() {
1995
+ return {
1996
+ command: "remove",
1997
+ describe: "Remove a string",
1998
+ builder: (e) => e.option("key", {
1999
+ type: "string",
2000
+ describe: "The key to remove",
2001
+ alias: "k"
2002
+ }).option("languages", {
2003
+ type: "string",
2004
+ array: !0,
2005
+ describe: "Languages to remove",
2006
+ alias: "l"
2007
+ }).option("dry-run", {
2008
+ type: "boolean",
2009
+ default: !1,
2010
+ describe: "Show what would be removed without writing changes",
2011
+ alias: "n"
2012
+ }).check((n) => {
2013
+ if (n.key || n.languages && n.languages.length > 0)
2014
+ return !0;
2015
+ throw new Error("Either --key or --languages must be provided");
2016
+ }),
2017
+ handler: async (e) => {
2018
+ const n = await vo(
2019
+ e.path,
2020
+ e.key,
2021
+ e.languages,
2022
+ e.dryRun === !0
2023
+ ), r = Object.entries(n).map(([i, t]) => `- [${t.join(" ")}] ${i}`).join(`
2024
+ `);
2025
+ if (e.dryRun) {
2026
+ r.length === 0 ? ne.info(C.yellow("No matching strings found.")) : ne.info(C.blue(`Would remove:
2027
+ ${r}`));
2028
+ return;
2029
+ }
2030
+ r.length === 0 ? ne.info(C.yellow("No matching strings found.")) : ne.info(C.green(`✓ Removed
2031
+ ${r}`));
2032
+ }
2033
+ };
2027
2034
  }
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;
2035
+ function xo(e, n, r, i, t) {
2036
+ if (e.localizations) {
2037
+ for (const l of n)
2038
+ e.localizations[l] && (t[i] ??= [], t[i].push(l), r || delete e.localizations[l]);
2039
+ !r && e.localizations && Object.keys(e.localizations).length === 0 && delete e.localizations;
2035
2040
  }
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;
2041
+ }
2042
+ async function vo(e, n, r, i = !1) {
2043
+ const t = await me(e), l = {}, o = t.strings || {};
2044
+ t.strings = o;
2045
+ const a = n ? [n] : Object.keys(o);
2046
+ let c = !1;
2047
+ for (const u of a) {
2048
+ const s = o[u];
2049
+ if (!s)
2050
+ continue;
2051
+ if (!r || r.length === 0) {
2052
+ const h = Object.keys(s.localizations ?? {});
2053
+ l[u] = h, i || delete o[u], c = !0;
2054
+ continue;
2046
2055
  }
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:",
2050
- choices: c
2056
+ xo(s, r, i, u, l);
2057
+ const f = l[u]?.length ?? 0;
2058
+ !(s.localizations && Object.keys(s.localizations).length > 0) && f > 0 && (i || delete o[u]), f > 0 && (c = !0);
2059
+ }
2060
+ return !i && c && await Nn(e, t), l;
2061
+ }
2062
+ const Pe = "xcstrings-cli.json5";
2063
+ function bo() {
2064
+ return {
2065
+ command: "init",
2066
+ describe: "Initialize configuration file",
2067
+ handler: async () => {
2068
+ await Co();
2069
+ }
2070
+ };
2071
+ }
2072
+ async function wo(e) {
2073
+ const n = [];
2074
+ async function r(i) {
2075
+ try {
2076
+ const t = await In(i, { withFileTypes: !0 });
2077
+ for (const l of t) {
2078
+ const o = Fe(i, l.name);
2079
+ l.isDirectory() ? !l.name.startsWith(".") && l.name !== "node_modules" && await r(o) : l.name.endsWith(".xcstrings") && n.push(o);
2080
+ }
2081
+ } catch {
2082
+ }
2083
+ }
2084
+ return await r(e), n;
2085
+ }
2086
+ async function Ao(e) {
2087
+ const n = [];
2088
+ let r = e;
2089
+ try {
2090
+ const i = await In(r, { withFileTypes: !0 });
2091
+ for (const t of i)
2092
+ t.isDirectory() && t.name.endsWith(".xcodeproj") && n.push(Fe(r, t.name));
2093
+ } catch {
2094
+ }
2095
+ return n;
2096
+ }
2097
+ async function Co() {
2098
+ const e = process.cwd();
2099
+ console.log(), console.log(C.bold.cyan("🚀 xcstrings-cli Configuration Setup")), console.log(C.dim("─".repeat(40))), console.log(), console.log(C.yellow("🔍 Searching for .xcstrings files..."));
2100
+ const n = await wo(e);
2101
+ console.log(C.yellow("🔍 Searching for .xcodeproj directories..."));
2102
+ const r = await Ao(e);
2103
+ console.log();
2104
+ let i = [];
2105
+ if (n.length > 0) {
2106
+ console.log(C.green(`✓ Found ${n.length} .xcstrings file(s)`)), console.log();
2107
+ const u = n.map((s) => ({
2108
+ name: C.white(be(e, s)) + C.dim(` (${s})`),
2109
+ value: be(e, s),
2110
+ checked: !0
2111
+ }));
2112
+ i = await ln({
2113
+ message: C.bold("Select .xcstrings files to manage:"),
2114
+ choices: u
2051
2115
  });
2116
+ } else
2117
+ console.log(C.dim(" No .xcstrings files found in current directory"));
2118
+ console.log();
2119
+ let t = [];
2120
+ if (r.length > 0) {
2121
+ console.log(C.green(`✓ Found ${r.length} .xcodeproj director${r.length === 1 ? "y" : "ies"}`)), console.log();
2122
+ const u = r.map((s) => ({
2123
+ name: C.white(be(e, s) || s) + C.dim(` (${s})`),
2124
+ value: be(e, s) || s,
2125
+ checked: !0
2126
+ }));
2127
+ t = await ln({
2128
+ message: C.bold("Select .xcodeproj directories for language detection:"),
2129
+ choices: u
2130
+ });
2131
+ } else
2132
+ console.log(C.dim(" No .xcodeproj directories found"));
2133
+ if (console.log(), console.log(C.dim("─".repeat(40))), console.log(), console.log(C.bold("📋 Configuration Summary:")), console.log(), console.log(C.cyan(" xcstringsPaths:")), i.length > 0 ? i.forEach((u) => console.log(C.white(` • ${u}`))) : console.log(C.dim(" (none)")), console.log(), console.log(C.cyan(" xcodeprojPaths:")), t.length > 0 ? t.forEach((u) => console.log(C.white(` • ${u}`))) : console.log(C.dim(" (none)")), console.log(), !await Nr({
2134
+ message: C.bold(`Create ${C.yellow(Pe)}?`),
2135
+ default: !0
2136
+ })) {
2137
+ console.log(C.dim(" Configuration cancelled."));
2138
+ return;
2052
2139
  }
2053
- return e;
2140
+ const o = i.map((u) => ` "${u}"`).join(`,
2141
+ `), a = t.map((u) => ` "${u}"`).join(`,
2142
+ `), c = `{
2143
+ // Paths to .xcstrings files to manage. Specify relative or absolute paths.
2144
+ xcstringsPaths: [
2145
+ ${o}
2146
+ ],
2147
+ // Paths to .xcodeproj directories. Used for discovering supported languages.
2148
+ xcodeprojPaths: [
2149
+ ${a}
2150
+ ],
2151
+ // Behavior for handling missing languages when adding strings.
2152
+ missingLanguagePolicy: "skip",
2054
2153
  }
2055
- const vn = xe(process.cwd(), "Localizable.xcstrings");
2056
- vi(yi(process.argv)).scriptName("xcstrings").usage("$0 <cmd> [args]").option("config", {
2154
+ `;
2155
+ await jn(Pe, c, "utf-8"), console.log(), console.log(C.bold.green(`✓ Created ${Pe}`)), console.log(C.dim(` Run ${C.cyan("xcstrings --help")} to see available commands.`)), console.log();
2156
+ }
2157
+ var Eo = Object.prototype.toString, le = Array.isArray || function(n) {
2158
+ return Eo.call(n) === "[object Array]";
2159
+ };
2160
+ function Je(e) {
2161
+ return typeof e == "function";
2162
+ }
2163
+ function So(e) {
2164
+ return le(e) ? "array" : typeof e;
2165
+ }
2166
+ function De(e) {
2167
+ return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
2168
+ }
2169
+ function kn(e, n) {
2170
+ return e != null && typeof e == "object" && n in e;
2171
+ }
2172
+ function _o(e, n) {
2173
+ return e != null && typeof e != "object" && e.hasOwnProperty && e.hasOwnProperty(n);
2174
+ }
2175
+ var ko = RegExp.prototype.test;
2176
+ function Oo(e, n) {
2177
+ return ko.call(e, n);
2178
+ }
2179
+ var Fo = /\S/;
2180
+ function To(e) {
2181
+ return !Oo(Fo, e);
2182
+ }
2183
+ var Lo = {
2184
+ "&": "&amp;",
2185
+ "<": "&lt;",
2186
+ ">": "&gt;",
2187
+ '"': "&quot;",
2188
+ "'": "&#39;",
2189
+ "/": "&#x2F;",
2190
+ "`": "&#x60;",
2191
+ "=": "&#x3D;"
2192
+ };
2193
+ function jo(e) {
2194
+ return String(e).replace(/[&<>"'`=\/]/g, function(r) {
2195
+ return Lo[r];
2196
+ });
2197
+ }
2198
+ var Io = /\s*/, No = /\s+/, On = /\s*=/, Ro = /\s*\}/, Mo = /#|\^|\/|>|\{|&|=|!/;
2199
+ function Po(e, n) {
2200
+ if (!e)
2201
+ return [];
2202
+ var r = !1, i = [], t = [], l = [], o = !1, a = !1, c = "", u = 0;
2203
+ function s() {
2204
+ if (o && !a)
2205
+ for (; l.length; )
2206
+ delete t[l.pop()];
2207
+ else
2208
+ l = [];
2209
+ o = !1, a = !1;
2210
+ }
2211
+ var f, g, h;
2212
+ function x(B) {
2213
+ if (typeof B == "string" && (B = B.split(No, 2)), !le(B) || B.length !== 2)
2214
+ throw new Error("Invalid tags: " + B);
2215
+ f = new RegExp(De(B[0]) + "\\s*"), g = new RegExp("\\s*" + De(B[1])), h = new RegExp("\\s*" + De("}" + B[1]));
2216
+ }
2217
+ x(n || N.tags);
2218
+ for (var d = new ye(e), A, E, v, K, W, Y; !d.eos(); ) {
2219
+ if (A = d.pos, v = d.scanUntil(f), v)
2220
+ for (var ae = 0, X = v.length; ae < X; ++ae)
2221
+ K = v.charAt(ae), To(K) ? (l.push(t.length), c += K) : (a = !0, r = !0, c += " "), t.push(["text", K, A, A + 1]), A += 1, K === `
2222
+ ` && (s(), c = "", u = 0, r = !1);
2223
+ if (!d.scan(f))
2224
+ break;
2225
+ if (o = !0, E = d.scan(Mo) || "name", d.scan(Io), E === "=" ? (v = d.scanUntil(On), d.scan(On), d.scanUntil(g)) : E === "{" ? (v = d.scanUntil(h), d.scan(Ro), d.scanUntil(g), E = "&") : v = d.scanUntil(g), !d.scan(g))
2226
+ throw new Error("Unclosed tag at " + d.pos);
2227
+ if (E == ">" ? W = [E, v, A, d.pos, c, u, r] : W = [E, v, A, d.pos], u++, t.push(W), E === "#" || E === "^")
2228
+ i.push(W);
2229
+ else if (E === "/") {
2230
+ if (Y = i.pop(), !Y)
2231
+ throw new Error('Unopened section "' + v + '" at ' + A);
2232
+ if (Y[1] !== v)
2233
+ throw new Error('Unclosed section "' + Y[1] + '" at ' + A);
2234
+ } else E === "name" || E === "{" || E === "&" ? a = !0 : E === "=" && x(v);
2235
+ }
2236
+ if (s(), Y = i.pop(), Y)
2237
+ throw new Error('Unclosed section "' + Y[1] + '" at ' + d.pos);
2238
+ return Bo(Do(t));
2239
+ }
2240
+ function Do(e) {
2241
+ for (var n = [], r, i, t = 0, l = e.length; t < l; ++t)
2242
+ r = e[t], r && (r[0] === "text" && i && i[0] === "text" ? (i[1] += r[1], i[3] = r[3]) : (n.push(r), i = r));
2243
+ return n;
2244
+ }
2245
+ function Bo(e) {
2246
+ for (var n = [], r = n, i = [], t, l, o = 0, a = e.length; o < a; ++o)
2247
+ switch (t = e[o], t[0]) {
2248
+ case "#":
2249
+ case "^":
2250
+ r.push(t), i.push(t), r = t[4] = [];
2251
+ break;
2252
+ case "/":
2253
+ l = i.pop(), l[5] = t[2], r = i.length > 0 ? i[i.length - 1][4] : n;
2254
+ break;
2255
+ default:
2256
+ r.push(t);
2257
+ }
2258
+ return n;
2259
+ }
2260
+ function ye(e) {
2261
+ this.string = e, this.tail = e, this.pos = 0;
2262
+ }
2263
+ ye.prototype.eos = function() {
2264
+ return this.tail === "";
2265
+ };
2266
+ ye.prototype.scan = function(n) {
2267
+ var r = this.tail.match(n);
2268
+ if (!r || r.index !== 0)
2269
+ return "";
2270
+ var i = r[0];
2271
+ return this.tail = this.tail.substring(i.length), this.pos += i.length, i;
2272
+ };
2273
+ ye.prototype.scanUntil = function(n) {
2274
+ var r = this.tail.search(n), i;
2275
+ switch (r) {
2276
+ case -1:
2277
+ i = this.tail, this.tail = "";
2278
+ break;
2279
+ case 0:
2280
+ i = "";
2281
+ break;
2282
+ default:
2283
+ i = this.tail.substring(0, r), this.tail = this.tail.substring(r);
2284
+ }
2285
+ return this.pos += i.length, i;
2286
+ };
2287
+ function oe(e, n) {
2288
+ this.view = e, this.cache = { ".": this.view }, this.parent = n;
2289
+ }
2290
+ oe.prototype.push = function(n) {
2291
+ return new oe(n, this);
2292
+ };
2293
+ oe.prototype.lookup = function(n) {
2294
+ var r = this.cache, i;
2295
+ if (r.hasOwnProperty(n))
2296
+ i = r[n];
2297
+ else {
2298
+ for (var t = this, l, o, a, c = !1; t; ) {
2299
+ if (n.indexOf(".") > 0)
2300
+ for (l = t.view, o = n.split("."), a = 0; l != null && a < o.length; )
2301
+ a === o.length - 1 && (c = kn(l, o[a]) || _o(l, o[a])), l = l[o[a++]];
2302
+ else
2303
+ l = t.view[n], c = kn(t.view, n);
2304
+ if (c) {
2305
+ i = l;
2306
+ break;
2307
+ }
2308
+ t = t.parent;
2309
+ }
2310
+ r[n] = i;
2311
+ }
2312
+ return Je(i) && (i = i.call(this.view)), i;
2313
+ };
2314
+ function R() {
2315
+ this.templateCache = {
2316
+ _cache: {},
2317
+ set: function(n, r) {
2318
+ this._cache[n] = r;
2319
+ },
2320
+ get: function(n) {
2321
+ return this._cache[n];
2322
+ },
2323
+ clear: function() {
2324
+ this._cache = {};
2325
+ }
2326
+ };
2327
+ }
2328
+ R.prototype.clearCache = function() {
2329
+ typeof this.templateCache < "u" && this.templateCache.clear();
2330
+ };
2331
+ R.prototype.parse = function(n, r) {
2332
+ var i = this.templateCache, t = n + ":" + (r || N.tags).join(":"), l = typeof i < "u", o = l ? i.get(t) : void 0;
2333
+ return o == null && (o = Po(n, r), l && i.set(t, o)), o;
2334
+ };
2335
+ R.prototype.render = function(n, r, i, t) {
2336
+ var l = this.getConfigTags(t), o = this.parse(n, l), a = r instanceof oe ? r : new oe(r, void 0);
2337
+ return this.renderTokens(o, a, i, n, t);
2338
+ };
2339
+ R.prototype.renderTokens = function(n, r, i, t, l) {
2340
+ for (var o = "", a, c, u, s = 0, f = n.length; s < f; ++s)
2341
+ u = void 0, a = n[s], c = a[0], c === "#" ? u = this.renderSection(a, r, i, t, l) : c === "^" ? u = this.renderInverted(a, r, i, t, l) : c === ">" ? u = this.renderPartial(a, r, i, l) : c === "&" ? u = this.unescapedValue(a, r) : c === "name" ? u = this.escapedValue(a, r, l) : c === "text" && (u = this.rawValue(a)), u !== void 0 && (o += u);
2342
+ return o;
2343
+ };
2344
+ R.prototype.renderSection = function(n, r, i, t, l) {
2345
+ var o = this, a = "", c = r.lookup(n[1]);
2346
+ function u(g) {
2347
+ return o.render(g, r, i, l);
2348
+ }
2349
+ if (c) {
2350
+ if (le(c))
2351
+ for (var s = 0, f = c.length; s < f; ++s)
2352
+ a += this.renderTokens(n[4], r.push(c[s]), i, t, l);
2353
+ else if (typeof c == "object" || typeof c == "string" || typeof c == "number")
2354
+ a += this.renderTokens(n[4], r.push(c), i, t, l);
2355
+ else if (Je(c)) {
2356
+ if (typeof t != "string")
2357
+ throw new Error("Cannot use higher-order sections without the original template");
2358
+ c = c.call(r.view, t.slice(n[3], n[5]), u), c != null && (a += c);
2359
+ } else
2360
+ a += this.renderTokens(n[4], r, i, t, l);
2361
+ return a;
2362
+ }
2363
+ };
2364
+ R.prototype.renderInverted = function(n, r, i, t, l) {
2365
+ var o = r.lookup(n[1]);
2366
+ if (!o || le(o) && o.length === 0)
2367
+ return this.renderTokens(n[4], r, i, t, l);
2368
+ };
2369
+ R.prototype.indentPartial = function(n, r, i) {
2370
+ for (var t = r.replace(/[^ \t]/g, ""), l = n.split(`
2371
+ `), o = 0; o < l.length; o++)
2372
+ l[o].length && (o > 0 || !i) && (l[o] = t + l[o]);
2373
+ return l.join(`
2374
+ `);
2375
+ };
2376
+ R.prototype.renderPartial = function(n, r, i, t) {
2377
+ if (i) {
2378
+ var l = this.getConfigTags(t), o = Je(i) ? i(n[1]) : i[n[1]];
2379
+ if (o != null) {
2380
+ var a = n[6], c = n[5], u = n[4], s = o;
2381
+ c == 0 && u && (s = this.indentPartial(o, u, a));
2382
+ var f = this.parse(s, l);
2383
+ return this.renderTokens(f, r, i, s, t);
2384
+ }
2385
+ }
2386
+ };
2387
+ R.prototype.unescapedValue = function(n, r) {
2388
+ var i = r.lookup(n[1]);
2389
+ if (i != null)
2390
+ return i;
2391
+ };
2392
+ R.prototype.escapedValue = function(n, r, i) {
2393
+ var t = this.getConfigEscape(i) || N.escape, l = r.lookup(n[1]);
2394
+ if (l != null)
2395
+ return typeof l == "number" && t === N.escape ? String(l) : t(l);
2396
+ };
2397
+ R.prototype.rawValue = function(n) {
2398
+ return n[1];
2399
+ };
2400
+ R.prototype.getConfigTags = function(n) {
2401
+ return le(n) ? n : n && typeof n == "object" ? n.tags : void 0;
2402
+ };
2403
+ R.prototype.getConfigEscape = function(n) {
2404
+ if (n && typeof n == "object" && !le(n))
2405
+ return n.escape;
2406
+ };
2407
+ var N = {
2408
+ name: "mustache.js",
2409
+ version: "4.2.0",
2410
+ tags: ["{{", "}}"],
2411
+ clearCache: void 0,
2412
+ escape: void 0,
2413
+ parse: void 0,
2414
+ render: void 0,
2415
+ Scanner: void 0,
2416
+ Context: void 0,
2417
+ Writer: void 0,
2418
+ /**
2419
+ * Allows a user to override the default caching strategy, by providing an
2420
+ * object with set, get and clear methods. This can also be used to disable
2421
+ * the cache by setting it to the literal `undefined`.
2422
+ */
2423
+ set templateCache(e) {
2424
+ ge.templateCache = e;
2425
+ },
2426
+ /**
2427
+ * Gets the default or overridden caching object from the default writer.
2428
+ */
2429
+ get templateCache() {
2430
+ return ge.templateCache;
2431
+ }
2432
+ }, ge = new R();
2433
+ N.clearCache = function() {
2434
+ return ge.clearCache();
2435
+ };
2436
+ N.parse = function(n, r) {
2437
+ return ge.parse(n, r);
2438
+ };
2439
+ N.render = function(n, r, i, t) {
2440
+ if (typeof n != "string")
2441
+ throw new TypeError('Invalid template! Template should be a "string" but "' + So(n) + '" was given as the first argument for mustache#render(template, view, partials)');
2442
+ return ge.render(n, r, i, t);
2443
+ };
2444
+ N.escape = jo;
2445
+ N.Scanner = ye;
2446
+ N.Context = oe;
2447
+ N.Writer = R;
2448
+ function Fn(e, {
2449
+ glob: n,
2450
+ regex: r,
2451
+ substring: i
2452
+ }) {
2453
+ const t = [n, r, i].filter((l) => l !== void 0);
2454
+ if (t.length !== 0) {
2455
+ if (t.length > 1)
2456
+ throw new Error(`Specify only one of --${e}, --${e}-glob, --${e}-regex, --${e}-substring`);
2457
+ return r !== void 0 ? { pattern: r, mode: "regex" } : i !== void 0 ? { pattern: i, mode: "substring" } : { pattern: n, mode: "glob" };
2458
+ }
2459
+ }
2460
+ function Uo() {
2461
+ return {
2462
+ command: "list",
2463
+ describe: "List strings in the xcstrings file",
2464
+ builder: (e) => e.option("key", {
2465
+ type: "string",
2466
+ describe: "Filter keys by glob (default)"
2467
+ }).option("key-glob", {
2468
+ type: "string",
2469
+ describe: "Filter keys by glob (explicit)"
2470
+ }).option("key-regex", {
2471
+ type: "string",
2472
+ describe: "Filter keys by regex"
2473
+ }).option("key-substring", {
2474
+ type: "string",
2475
+ describe: "Filter keys by substring match"
2476
+ }).option("text", {
2477
+ type: "string",
2478
+ describe: "Filter translations by glob (default)"
2479
+ }).option("text-glob", {
2480
+ type: "string",
2481
+ describe: "Filter translations by glob (explicit)"
2482
+ }).option("text-regex", {
2483
+ type: "string",
2484
+ describe: "Filter translations by regex"
2485
+ }).option("text-substring", {
2486
+ type: "string",
2487
+ describe: "Filter translations by substring match"
2488
+ }).option("languages", {
2489
+ type: "string",
2490
+ array: !0,
2491
+ alias: "l",
2492
+ describe: "Include only these languages"
2493
+ }).option("format", {
2494
+ type: "string",
2495
+ describe: "Mustache template. Available variables: {{language}}, {{key}}, {{text}}"
2496
+ }).check((n) => {
2497
+ const r = [n.key, n["key-glob"]].filter((c) => c !== void 0).length, i = n["key-regex"] ? 1 : 0, t = n["key-substring"] ? 1 : 0;
2498
+ if (r + i + t > 1)
2499
+ throw new Error("Specify only one of --key/--key-glob, --key-regex, or --key-substring");
2500
+ const l = [n.text, n["text-glob"]].filter((c) => c !== void 0).length, o = n["text-regex"] ? 1 : 0, a = n["text-substring"] ? 1 : 0;
2501
+ if (l + o + a > 1)
2502
+ throw new Error("Specify only one of --text/--text-glob, --text-regex, or --text-substring");
2503
+ return !0;
2504
+ }),
2505
+ handler: async (e) => {
2506
+ const n = [e.key, e["key-glob"]].filter((o) => o !== void 0), r = [e.text, e["text-glob"]].filter((o) => o !== void 0), i = Fn("key", {
2507
+ glob: n[0],
2508
+ regex: e["key-regex"],
2509
+ substring: e["key-substring"]
2510
+ }), t = Fn("text", {
2511
+ glob: r[0],
2512
+ regex: e["text-regex"],
2513
+ substring: e["text-substring"]
2514
+ }), l = await $o({
2515
+ path: e.path,
2516
+ languages: e.languages,
2517
+ keyFilter: i,
2518
+ textFilter: t,
2519
+ format: e.format
2520
+ });
2521
+ l && console.log(l);
2522
+ }
2523
+ };
2524
+ }
2525
+ function Yo(e) {
2526
+ const n = e.replace(/[.+^${}()|\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
2527
+ return new RegExp(`^${n}$`);
2528
+ }
2529
+ function Tn(e) {
2530
+ if (!e) return () => !0;
2531
+ if (e.mode === "regex") {
2532
+ const r = new RegExp(e.pattern);
2533
+ return (i) => r.test(i);
2534
+ }
2535
+ if (e.mode === "substring") {
2536
+ const r = e.pattern;
2537
+ return (i) => i.includes(r);
2538
+ }
2539
+ const n = Yo(e.pattern);
2540
+ return (r) => n.test(r);
2541
+ }
2542
+ function zo(e, n) {
2543
+ const r = N.escape;
2544
+ N.escape = (i) => i;
2545
+ try {
2546
+ return N.render(e, n);
2547
+ } finally {
2548
+ N.escape = r;
2549
+ }
2550
+ }
2551
+ async function $o(e) {
2552
+ const r = (await me(e.path)).strings ?? {}, i = Tn(e.keyFilter), t = Tn(e.textFilter), l = e.languages ? new Set(e.languages) : null, o = !!e.format, a = [];
2553
+ for (const c of Object.keys(r)) {
2554
+ if (!i(c)) continue;
2555
+ const s = r[c]?.localizations ?? {}, f = Object.keys(s), g = [];
2556
+ for (const h of f) {
2557
+ if (l && !l.has(h)) continue;
2558
+ const x = s[h]?.stringUnit?.value ?? "";
2559
+ t(x) && (o && e.format ? g.push(zo(e.format, { language: h, key: c, text: x })) : g.push(` ${h}: ${JSON.stringify(x)}`));
2560
+ }
2561
+ g.length !== 0 && (o ? a.push(...g) : a.push(`${c}:`, ...g));
2562
+ }
2563
+ return a.join(`
2564
+ `);
2565
+ }
2566
+ const Ln = Fe(process.cwd(), "Localizable.xcstrings");
2567
+ Tr(Lr(process.argv)).scriptName("xcstrings").usage("$0 <cmd> [args]").option("config", {
2057
2568
  type: "string",
2058
2569
  describe: "Path to config file"
2059
2570
  }).option("path", {
2060
2571
  type: "string",
2061
2572
  describe: "Path to xcstrings file",
2062
- default: vn
2573
+ default: Ln
2063
2574
  }).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);
2575
+ const n = await Ke(e.config);
2576
+ e.path = await Pr(e.path, n, Ln);
2577
+ }).command([
2578
+ go(),
2579
+ yo(),
2580
+ bo(),
2581
+ Hr(),
2582
+ Uo()
2583
+ ]).demandCommand(1, "").strictCommands().recommendCommands().showHelpOnFail(!0).fail((e, n, r) => {
2584
+ const i = e || n?.message;
2585
+ i && (console.error(C.red(i)), console.log(), r.showHelp(), process.exit(1)), n && (console.error(n), process.exit(1)), r.showHelp(), process.exit(1);
2161
2586
  }).help().argv;