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