norc-cli 0.2.1 → 0.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 (2) hide show
  1. package/dist/index.js +905 -347
  2. package/package.json +3 -1
package/dist/index.js CHANGED
@@ -1260,11 +1260,11 @@ var require_serializer = __commonJS({
1260
1260
  var _a;
1261
1261
  return buffer instanceof ArrayBuffer || ((_a = buffer === null || buffer === void 0 ? void 0 : buffer.constructor) === null || _a === void 0 ? void 0 : _a.name) === "ArrayBuffer";
1262
1262
  }
1263
- _pick(obj, keys) {
1264
- if (!obj || typeof obj !== "object") {
1263
+ _pick(obj2, keys) {
1264
+ if (!obj2 || typeof obj2 !== "object") {
1265
1265
  return {};
1266
1266
  }
1267
- return Object.fromEntries(Object.entries(obj).filter(([key]) => keys.includes(key)));
1267
+ return Object.fromEntries(Object.entries(obj2).filter(([key]) => keys.includes(key)));
1268
1268
  }
1269
1269
  };
1270
1270
  exports2.default = Serializer;
@@ -1416,14 +1416,14 @@ var require_transformers = __commonJS({
1416
1416
  const closeBrace = value[lastIdx];
1417
1417
  const openBrace = value[0];
1418
1418
  if (openBrace === "{" && closeBrace === "}") {
1419
- let arr;
1419
+ let arr2;
1420
1420
  const valTrim = value.slice(1, lastIdx);
1421
1421
  try {
1422
- arr = JSON.parse("[" + valTrim + "]");
1422
+ arr2 = JSON.parse("[" + valTrim + "]");
1423
1423
  } catch (_) {
1424
- arr = valTrim ? valTrim.split(",") : [];
1424
+ arr2 = valTrim ? valTrim.split(",") : [];
1425
1425
  }
1426
- return arr.map((val) => (0, exports2.convertCell)(type, val));
1426
+ return arr2.map((val) => (0, exports2.convertCell)(type, val));
1427
1427
  }
1428
1428
  return value;
1429
1429
  };
@@ -2079,14 +2079,14 @@ var require_phoenix_cjs = __commonJS({
2079
2079
  return null;
2080
2080
  }
2081
2081
  }
2082
- static serialize(obj, parentKey) {
2082
+ static serialize(obj2, parentKey) {
2083
2083
  let queryStr = [];
2084
- for (var key in obj) {
2085
- if (!Object.prototype.hasOwnProperty.call(obj, key)) {
2084
+ for (var key in obj2) {
2085
+ if (!Object.prototype.hasOwnProperty.call(obj2, key)) {
2086
2086
  continue;
2087
2087
  }
2088
2088
  let paramKey = parentKey ? `${parentKey}[${key}]` : key;
2089
- let paramVal = obj[key];
2089
+ let paramVal = obj2[key];
2090
2090
  if (typeof paramVal === "object") {
2091
2091
  queryStr.push(this.serialize(paramVal, paramKey));
2092
2092
  } else {
@@ -2454,16 +2454,16 @@ var require_phoenix_cjs = __commonJS({
2454
2454
  * @param {Record<string, PresenceState>} obj
2455
2455
  * @param {(key: string, obj: PresenceState) => T} func
2456
2456
  */
2457
- static map(obj, func) {
2458
- return Object.getOwnPropertyNames(obj).map((key) => func(key, obj[key]));
2457
+ static map(obj2, func) {
2458
+ return Object.getOwnPropertyNames(obj2).map((key) => func(key, obj2[key]));
2459
2459
  }
2460
2460
  /**
2461
2461
  * @template T
2462
2462
  * @param {T} obj
2463
2463
  * @returns {T}
2464
2464
  */
2465
- static clone(obj) {
2466
- return JSON.parse(JSON.stringify(obj));
2465
+ static clone(obj2) {
2466
+ return JSON.parse(JSON.stringify(obj2));
2467
2467
  }
2468
2468
  };
2469
2469
  var serializer_default = {
@@ -3414,10 +3414,10 @@ var require_normalizeChannelError = __commonJS({
3414
3414
  return new Error(reason);
3415
3415
  }
3416
3416
  if (reason && typeof reason === "object") {
3417
- const obj = reason;
3418
- if (typeof obj.code === "number") {
3419
- const detail = typeof obj.reason === "string" && obj.reason ? ` (${obj.reason})` : "";
3420
- return new Error(`socket closed: ${obj.code}${detail}`, { cause: reason });
3417
+ const obj2 = reason;
3418
+ if (typeof obj2.code === "number") {
3419
+ const detail = typeof obj2.reason === "string" && obj2.reason ? ` (${obj2.reason})` : "";
3420
+ return new Error(`socket closed: ${obj2.code}${detail}`, { cause: reason });
3421
3421
  }
3422
3422
  return new Error("channel error: transport failure", { cause: reason });
3423
3423
  }
@@ -5331,19 +5331,19 @@ var require_base64url = __commonJS({
5331
5331
  throw new Error(`Invalid Base64-URL character "${String.fromCharCode(charCode)}"`);
5332
5332
  }
5333
5333
  }
5334
- function stringToBase64URL(str) {
5334
+ function stringToBase64URL(str2) {
5335
5335
  const base64 = [];
5336
5336
  const emitter = (char) => {
5337
5337
  base64.push(char);
5338
5338
  };
5339
5339
  const state = { queue: 0, queuedBits: 0 };
5340
- stringToUTF8(str, (byte) => {
5340
+ stringToUTF8(str2, (byte) => {
5341
5341
  byteToBase64URL(byte, state, emitter);
5342
5342
  });
5343
5343
  byteToBase64URL(null, state, emitter);
5344
5344
  return base64.join("");
5345
5345
  }
5346
- function stringFromBase64URL(str) {
5346
+ function stringFromBase64URL(str2) {
5347
5347
  const conv = [];
5348
5348
  const utf8Emit = (codepoint) => {
5349
5349
  conv.push(String.fromCodePoint(codepoint));
@@ -5356,8 +5356,8 @@ var require_base64url = __commonJS({
5356
5356
  const byteEmit = (byte) => {
5357
5357
  stringFromUTF8(byte, utf8State, utf8Emit);
5358
5358
  };
5359
- for (let i = 0; i < str.length; i += 1) {
5360
- byteFromBase64URL(str.charCodeAt(i), b64State, byteEmit);
5359
+ for (let i = 0; i < str2.length; i += 1) {
5360
+ byteFromBase64URL(str2.charCodeAt(i), b64State, byteEmit);
5361
5361
  }
5362
5362
  return conv.join("");
5363
5363
  }
@@ -5383,12 +5383,12 @@ var require_base64url = __commonJS({
5383
5383
  }
5384
5384
  throw new Error(`Unrecognized Unicode codepoint: ${codepoint.toString(16)}`);
5385
5385
  }
5386
- function stringToUTF8(str, emit) {
5387
- for (let i = 0; i < str.length; i += 1) {
5388
- let codepoint = str.charCodeAt(i);
5386
+ function stringToUTF8(str2, emit) {
5387
+ for (let i = 0; i < str2.length; i += 1) {
5388
+ let codepoint = str2.charCodeAt(i);
5389
5389
  if (codepoint > 55295 && codepoint <= 56319) {
5390
5390
  const highSurrogate = (codepoint - 55296) * 1024 & 65535;
5391
- const lowSurrogate = str.charCodeAt(i + 1) - 56320 & 65535;
5391
+ const lowSurrogate = str2.charCodeAt(i + 1) - 56320 & 65535;
5392
5392
  codepoint = (lowSurrogate | highSurrogate) + 65536;
5393
5393
  i += 1;
5394
5394
  }
@@ -5428,20 +5428,20 @@ var require_base64url = __commonJS({
5428
5428
  }
5429
5429
  }
5430
5430
  }
5431
- function base64UrlToUint8Array(str) {
5431
+ function base64UrlToUint8Array(str2) {
5432
5432
  const result = [];
5433
5433
  const state = { queue: 0, queuedBits: 0 };
5434
5434
  const onByte = (byte) => {
5435
5435
  result.push(byte);
5436
5436
  };
5437
- for (let i = 0; i < str.length; i += 1) {
5438
- byteFromBase64URL(str.charCodeAt(i), state, onByte);
5437
+ for (let i = 0; i < str2.length; i += 1) {
5438
+ byteFromBase64URL(str2.charCodeAt(i), state, onByte);
5439
5439
  }
5440
5440
  return new Uint8Array(result);
5441
5441
  }
5442
- function stringToUint8Array(str) {
5442
+ function stringToUint8Array(str2) {
5443
5443
  const result = [];
5444
- stringToUTF8(str, (byte) => result.push(byte));
5444
+ stringToUTF8(str2, (byte) => result.push(byte));
5445
5445
  return new Uint8Array(result);
5446
5446
  }
5447
5447
  function bytesToBase64URL(bytes) {
@@ -5720,8 +5720,8 @@ var require_helpers = __commonJS({
5720
5720
  }
5721
5721
  }
5722
5722
  var UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
5723
- function validateUUID(str) {
5724
- if (!UUID_REGEX.test(str)) {
5723
+ function validateUUID(str2) {
5724
+ if (!UUID_REGEX.test(str2)) {
5725
5725
  throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not");
5726
5726
  }
5727
5727
  }
@@ -5773,8 +5773,8 @@ var require_helpers = __commonJS({
5773
5773
  }
5774
5774
  });
5775
5775
  }
5776
- function deepClone(obj) {
5777
- return JSON.parse(JSON.stringify(obj));
5776
+ function deepClone(obj2) {
5777
+ return JSON.parse(JSON.stringify(obj2));
5778
5778
  }
5779
5779
  }
5780
5780
  });
@@ -13438,9 +13438,9 @@ var require_bit_buffer = __commonJS({
13438
13438
  const bufIndex = Math.floor(index / 8);
13439
13439
  return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) === 1;
13440
13440
  },
13441
- put: function(num, length) {
13441
+ put: function(num2, length) {
13442
13442
  for (let i = 0; i < length; i++) {
13443
- this.putBit((num >>> length - i - 1 & 1) === 1);
13443
+ this.putBit((num2 >>> length - i - 1 & 1) === 1);
13444
13444
  }
13445
13445
  },
13446
13446
  getLengthInBits: function() {
@@ -14173,14 +14173,14 @@ var require_regex = __commonJS({
14173
14173
  var TEST_KANJI = new RegExp("^" + kanji + "$");
14174
14174
  var TEST_NUMERIC = new RegExp("^" + numeric + "$");
14175
14175
  var TEST_ALPHANUMERIC = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
14176
- exports2.testKanji = function testKanji(str) {
14177
- return TEST_KANJI.test(str);
14176
+ exports2.testKanji = function testKanji(str2) {
14177
+ return TEST_KANJI.test(str2);
14178
14178
  };
14179
- exports2.testNumeric = function testNumeric(str) {
14180
- return TEST_NUMERIC.test(str);
14179
+ exports2.testNumeric = function testNumeric(str2) {
14180
+ return TEST_NUMERIC.test(str2);
14181
14181
  };
14182
- exports2.testAlphanumeric = function testAlphanumeric(str) {
14183
- return TEST_ALPHANUMERIC.test(str);
14182
+ exports2.testAlphanumeric = function testAlphanumeric(str2) {
14183
+ return TEST_ALPHANUMERIC.test(str2);
14184
14184
  };
14185
14185
  }
14186
14186
  });
@@ -14674,13 +14674,13 @@ var require_segments = __commonJS({
14674
14674
  var Regex = require_regex();
14675
14675
  var Utils = require_utils();
14676
14676
  var dijkstra = require_dijkstra();
14677
- function getStringByteLength(str) {
14678
- return unescape(encodeURIComponent(str)).length;
14677
+ function getStringByteLength(str2) {
14678
+ return unescape(encodeURIComponent(str2)).length;
14679
14679
  }
14680
- function getSegments(regex, mode, str) {
14680
+ function getSegments(regex, mode, str2) {
14681
14681
  const segments = [];
14682
14682
  let result;
14683
- while ((result = regex.exec(str)) !== null) {
14683
+ while ((result = regex.exec(str2)) !== null) {
14684
14684
  segments.push({
14685
14685
  data: result[0],
14686
14686
  index: result.index,
@@ -14705,11 +14705,11 @@ var require_segments = __commonJS({
14705
14705
  const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs);
14706
14706
  return segs.sort(function(s1, s2) {
14707
14707
  return s1.index - s2.index;
14708
- }).map(function(obj) {
14708
+ }).map(function(obj2) {
14709
14709
  return {
14710
- data: obj.data,
14711
- mode: obj.mode,
14712
- length: obj.length
14710
+ data: obj2.data,
14711
+ mode: obj2.mode,
14712
+ length: obj2.length
14713
14713
  };
14714
14714
  });
14715
14715
  }
@@ -15209,19 +15209,19 @@ var require_chunkstream = __commonJS({
15209
15209
  ChunkStream.prototype._processRead = function(read) {
15210
15210
  this._reads.shift();
15211
15211
  let pos = 0;
15212
- let count = 0;
15212
+ let count2 = 0;
15213
15213
  let data = Buffer.alloc(read.length);
15214
15214
  while (pos < read.length) {
15215
- let buf = this._buffers[count++];
15215
+ let buf = this._buffers[count2++];
15216
15216
  let len = Math.min(buf.length, read.length - pos);
15217
15217
  buf.copy(data, pos, 0, len);
15218
15218
  pos += len;
15219
15219
  if (len !== buf.length) {
15220
- this._buffers[--count] = buf.slice(len);
15220
+ this._buffers[--count2] = buf.slice(len);
15221
15221
  }
15222
15222
  }
15223
- if (count > 0) {
15224
- this._buffers.splice(0, count);
15223
+ if (count2 > 0) {
15224
+ this._buffers.splice(0, count2);
15225
15225
  }
15226
15226
  this._buffered -= read.length;
15227
15227
  read.func.call(this, data);
@@ -15953,12 +15953,12 @@ var require_bitmapper = __commonJS({
15953
15953
  }
15954
15954
  }
15955
15955
  return {
15956
- get: function(count) {
15957
- while (leftOver.length < count) {
15956
+ get: function(count2) {
15957
+ while (leftOver.length < count2) {
15958
15958
  split();
15959
15959
  }
15960
- let returner = leftOver.slice(0, count);
15961
- leftOver = leftOver.slice(count);
15960
+ let returner = leftOver.slice(0, count2);
15961
+ leftOver = leftOver.slice(count2);
15962
15962
  return returner;
15963
15963
  },
15964
15964
  resetAfterLine: function() {
@@ -17506,13 +17506,13 @@ var require_svg_tag = __commonJS({
17506
17506
  var Utils = require_utils2();
17507
17507
  function getColorAttrib(color, attrib) {
17508
17508
  const alpha = color.a / 255;
17509
- const str = attrib + '="' + color.hex + '"';
17510
- return alpha < 1 ? str + " " + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' : str;
17509
+ const str2 = attrib + '="' + color.hex + '"';
17510
+ return alpha < 1 ? str2 + " " + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' : str2;
17511
17511
  }
17512
17512
  function svgCmd(cmd, x, y) {
17513
- let str = cmd + x;
17514
- if (typeof y !== "undefined") str += " " + y;
17515
- return str;
17513
+ let str2 = cmd + x;
17514
+ if (typeof y !== "undefined") str2 += " " + y;
17515
+ return str2;
17516
17516
  }
17517
17517
  function qrToPath(data, size, margin) {
17518
17518
  let path = "";
@@ -18611,16 +18611,16 @@ var require_luxon = __commonJS({
18611
18611
  this.rtf = getCachedRTF(intl, opts);
18612
18612
  }
18613
18613
  }
18614
- format(count, unit) {
18614
+ format(count2, unit) {
18615
18615
  if (this.rtf) {
18616
- return this.rtf.format(count, unit);
18616
+ return this.rtf.format(count2, unit);
18617
18617
  } else {
18618
- return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long");
18618
+ return formatRelativeTime(unit, count2, this.opts.numeric, this.opts.style !== "long");
18619
18619
  }
18620
18620
  }
18621
- formatToParts(count, unit) {
18621
+ formatToParts(count2, unit) {
18622
18622
  if (this.rtf) {
18623
- return this.rtf.formatToParts(count, unit);
18623
+ return this.rtf.formatToParts(count2, unit);
18624
18624
  } else {
18625
18625
  return [];
18626
18626
  }
@@ -19040,14 +19040,14 @@ var require_luxon = __commonJS({
19040
19040
  tibt: [3872, 3881]
19041
19041
  };
19042
19042
  var hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split("");
19043
- function parseDigits(str) {
19044
- let value = parseInt(str, 10);
19043
+ function parseDigits(str2) {
19044
+ let value = parseInt(str2, 10);
19045
19045
  if (isNaN(value)) {
19046
19046
  value = "";
19047
- for (let i = 0; i < str.length; i++) {
19048
- const code = str.charCodeAt(i);
19049
- if (str[i].search(numberingSystems.hanidec) !== -1) {
19050
- value += hanidecChars.indexOf(str[i]);
19047
+ for (let i = 0; i < str2.length; i++) {
19048
+ const code = str2.charCodeAt(i);
19049
+ if (str2[i].search(numberingSystems.hanidec) !== -1) {
19050
+ value += hanidecChars.indexOf(str2[i]);
19051
19051
  } else {
19052
19052
  for (const key in numberingSystemsUTF16) {
19053
19053
  const [min, max] = numberingSystemsUTF16[key];
@@ -19350,19 +19350,19 @@ var require_luxon = __commonJS({
19350
19350
  ...timeObject(ordinalData)
19351
19351
  };
19352
19352
  }
19353
- function usesLocalWeekValues(obj, loc) {
19354
- const hasLocaleWeekData = !isUndefined(obj.localWeekday) || !isUndefined(obj.localWeekNumber) || !isUndefined(obj.localWeekYear);
19353
+ function usesLocalWeekValues(obj2, loc) {
19354
+ const hasLocaleWeekData = !isUndefined(obj2.localWeekday) || !isUndefined(obj2.localWeekNumber) || !isUndefined(obj2.localWeekYear);
19355
19355
  if (hasLocaleWeekData) {
19356
- const hasIsoWeekData = !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);
19356
+ const hasIsoWeekData = !isUndefined(obj2.weekday) || !isUndefined(obj2.weekNumber) || !isUndefined(obj2.weekYear);
19357
19357
  if (hasIsoWeekData) {
19358
19358
  throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields");
19359
19359
  }
19360
- if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;
19361
- if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;
19362
- if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;
19363
- delete obj.localWeekday;
19364
- delete obj.localWeekNumber;
19365
- delete obj.localWeekYear;
19360
+ if (!isUndefined(obj2.localWeekday)) obj2.weekday = obj2.localWeekday;
19361
+ if (!isUndefined(obj2.localWeekNumber)) obj2.weekNumber = obj2.localWeekNumber;
19362
+ if (!isUndefined(obj2.localWeekYear)) obj2.weekYear = obj2.localWeekYear;
19363
+ delete obj2.localWeekday;
19364
+ delete obj2.localWeekNumber;
19365
+ delete obj2.localWeekYear;
19366
19366
  return {
19367
19367
  minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),
19368
19368
  startOfWeek: loc.getStartOfWeek()
@@ -19374,41 +19374,41 @@ var require_luxon = __commonJS({
19374
19374
  };
19375
19375
  }
19376
19376
  }
19377
- function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {
19378
- const validYear = isInteger(obj.weekYear), validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)), validWeekday = integerBetween(obj.weekday, 1, 7);
19377
+ function hasInvalidWeekData(obj2, minDaysInFirstWeek = 4, startOfWeek = 1) {
19378
+ const validYear = isInteger(obj2.weekYear), validWeek = integerBetween(obj2.weekNumber, 1, weeksInWeekYear(obj2.weekYear, minDaysInFirstWeek, startOfWeek)), validWeekday = integerBetween(obj2.weekday, 1, 7);
19379
19379
  if (!validYear) {
19380
- return unitOutOfRange("weekYear", obj.weekYear);
19380
+ return unitOutOfRange("weekYear", obj2.weekYear);
19381
19381
  } else if (!validWeek) {
19382
- return unitOutOfRange("week", obj.weekNumber);
19382
+ return unitOutOfRange("week", obj2.weekNumber);
19383
19383
  } else if (!validWeekday) {
19384
- return unitOutOfRange("weekday", obj.weekday);
19384
+ return unitOutOfRange("weekday", obj2.weekday);
19385
19385
  } else return false;
19386
19386
  }
19387
- function hasInvalidOrdinalData(obj) {
19388
- const validYear = isInteger(obj.year), validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));
19387
+ function hasInvalidOrdinalData(obj2) {
19388
+ const validYear = isInteger(obj2.year), validOrdinal = integerBetween(obj2.ordinal, 1, daysInYear(obj2.year));
19389
19389
  if (!validYear) {
19390
- return unitOutOfRange("year", obj.year);
19390
+ return unitOutOfRange("year", obj2.year);
19391
19391
  } else if (!validOrdinal) {
19392
- return unitOutOfRange("ordinal", obj.ordinal);
19392
+ return unitOutOfRange("ordinal", obj2.ordinal);
19393
19393
  } else return false;
19394
19394
  }
19395
- function hasInvalidGregorianData(obj) {
19396
- const validYear = isInteger(obj.year), validMonth = integerBetween(obj.month, 1, 12), validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));
19395
+ function hasInvalidGregorianData(obj2) {
19396
+ const validYear = isInteger(obj2.year), validMonth = integerBetween(obj2.month, 1, 12), validDay = integerBetween(obj2.day, 1, daysInMonth(obj2.year, obj2.month));
19397
19397
  if (!validYear) {
19398
- return unitOutOfRange("year", obj.year);
19398
+ return unitOutOfRange("year", obj2.year);
19399
19399
  } else if (!validMonth) {
19400
- return unitOutOfRange("month", obj.month);
19400
+ return unitOutOfRange("month", obj2.month);
19401
19401
  } else if (!validDay) {
19402
- return unitOutOfRange("day", obj.day);
19402
+ return unitOutOfRange("day", obj2.day);
19403
19403
  } else return false;
19404
19404
  }
19405
- function hasInvalidTimeData(obj) {
19405
+ function hasInvalidTimeData(obj2) {
19406
19406
  const {
19407
19407
  hour,
19408
19408
  minute,
19409
19409
  second,
19410
19410
  millisecond
19411
- } = obj;
19411
+ } = obj2;
19412
19412
  const validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, validMinute = integerBetween(minute, 0, 59), validSecond = integerBetween(second, 0, 59), validMillisecond = integerBetween(millisecond, 0, 999);
19413
19413
  if (!validHour) {
19414
19414
  return unitOutOfRange("hour", hour);
@@ -19452,11 +19452,11 @@ var require_luxon = __commonJS({
19452
19452
  function maybeArray(thing) {
19453
19453
  return Array.isArray(thing) ? thing : [thing];
19454
19454
  }
19455
- function bestBy(arr, by, compare) {
19456
- if (arr.length === 0) {
19455
+ function bestBy(arr2, by, compare) {
19456
+ if (arr2.length === 0) {
19457
19457
  return void 0;
19458
19458
  }
19459
- return arr.reduce((best, next) => {
19459
+ return arr2.reduce((best, next) => {
19460
19460
  const pair = [by(next), next];
19461
19461
  if (!best) {
19462
19462
  return pair;
@@ -19467,14 +19467,14 @@ var require_luxon = __commonJS({
19467
19467
  }
19468
19468
  }, null)[1];
19469
19469
  }
19470
- function pick(obj, keys) {
19470
+ function pick(obj2, keys) {
19471
19471
  return keys.reduce((a, k) => {
19472
- a[k] = obj[k];
19472
+ a[k] = obj2[k];
19473
19473
  return a;
19474
19474
  }, {});
19475
19475
  }
19476
- function hasOwnProperty(obj, prop) {
19477
- return Object.prototype.hasOwnProperty.call(obj, prop);
19476
+ function hasOwnProperty(obj2, prop) {
19477
+ return Object.prototype.hasOwnProperty.call(obj2, prop);
19478
19478
  }
19479
19479
  function validateWeekSettings(settings) {
19480
19480
  if (settings == null) {
@@ -19561,11 +19561,11 @@ var require_luxon = __commonJS({
19561
19561
  return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];
19562
19562
  }
19563
19563
  }
19564
- function objToLocalTS(obj) {
19565
- let d = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond);
19566
- if (obj.year < 100 && obj.year >= 0) {
19564
+ function objToLocalTS(obj2) {
19565
+ let d = Date.UTC(obj2.year, obj2.month - 1, obj2.day, obj2.hour, obj2.minute, obj2.second, obj2.millisecond);
19566
+ if (obj2.year < 100 && obj2.year >= 0) {
19567
19567
  d = new Date(d);
19568
- d.setUTCFullYear(obj.year, obj.month - 1, obj.day);
19568
+ d.setUTCFullYear(obj2.year, obj2.month - 1, obj2.day);
19569
19569
  }
19570
19570
  return +d;
19571
19571
  }
@@ -19615,11 +19615,11 @@ var require_luxon = __commonJS({
19615
19615
  if (typeof value === "boolean" || value === "" || !Number.isFinite(numericValue)) throw new InvalidArgumentError(`Invalid unit value ${value}`);
19616
19616
  return numericValue;
19617
19617
  }
19618
- function normalizeObject(obj, normalizer) {
19618
+ function normalizeObject(obj2, normalizer) {
19619
19619
  const normalized = {};
19620
- for (const u in obj) {
19621
- if (hasOwnProperty(obj, u)) {
19622
- const v = obj[u];
19620
+ for (const u in obj2) {
19621
+ if (hasOwnProperty(obj2, u)) {
19622
+ const v = obj2[u];
19623
19623
  if (v === void 0 || v === null) continue;
19624
19624
  normalized[normalizer(u)] = asNumber(v);
19625
19625
  }
@@ -19639,8 +19639,8 @@ var require_luxon = __commonJS({
19639
19639
  throw new RangeError(`Value format ${format} is out of range for property format`);
19640
19640
  }
19641
19641
  }
19642
- function timeObject(obj) {
19643
- return pick(obj, ["hour", "minute", "second", "millisecond"]);
19642
+ function timeObject(obj2) {
19643
+ return pick(obj2, ["hour", "minute", "second", "millisecond"]);
19644
19644
  }
19645
19645
  var monthsLong = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
19646
19646
  var monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
@@ -19706,7 +19706,7 @@ var require_luxon = __commonJS({
19706
19706
  function eraForDateTime(dt, length) {
19707
19707
  return eras(length)[dt.year < 0 ? 0 : 1];
19708
19708
  }
19709
- function formatRelativeTime(unit, count, numeric = "always", narrow = false) {
19709
+ function formatRelativeTime(unit, count2, numeric = "always", narrow = false) {
19710
19710
  const units = {
19711
19711
  years: ["year", "yr."],
19712
19712
  quarters: ["quarter", "qtr."],
@@ -19720,7 +19720,7 @@ var require_luxon = __commonJS({
19720
19720
  const lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1;
19721
19721
  if (numeric === "auto" && lastable) {
19722
19722
  const isDay = unit === "days";
19723
- switch (count) {
19723
+ switch (count2) {
19724
19724
  case 1:
19725
19725
  return isDay ? "tomorrow" : `next ${units[unit][0]}`;
19726
19726
  case -1:
@@ -19729,7 +19729,7 @@ var require_luxon = __commonJS({
19729
19729
  return isDay ? "today" : `this ${units[unit][0]}`;
19730
19730
  }
19731
19731
  }
19732
- const isInPast = Object.is(count, -0) || count < 0, fmtValue = Math.abs(count), singular = fmtValue === 1, lilUnits = units[unit], fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit;
19732
+ const isInPast = Object.is(count2, -0) || count2 < 0, fmtValue = Math.abs(count2), singular = fmtValue === 1, lilUnits = units[unit], fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit;
19733
19733
  return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;
19734
19734
  }
19735
19735
  function stringifyTokens(splits, tokenToString) {
@@ -20205,7 +20205,7 @@ var require_luxon = __commonJS({
20205
20205
  const [s2, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = match2;
20206
20206
  const hasNegativePrefix = s2[0] === "-";
20207
20207
  const negativeSeconds = secondStr && secondStr[0] === "-";
20208
- const maybeNegate = (num, force = false) => num !== void 0 && (force || num && hasNegativePrefix) ? -num : num;
20208
+ const maybeNegate = (num2, force = false) => num2 !== void 0 && (force || num2 && hasNegativePrefix) ? -num2 : num2;
20209
20209
  return [{
20210
20210
  years: maybeNegate(parseFloating(yearStr)),
20211
20211
  months: maybeNegate(parseFloating(monthStr)),
@@ -20477,9 +20477,9 @@ var require_luxon = __commonJS({
20477
20477
  * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use
20478
20478
  * @return {Duration}
20479
20479
  */
20480
- static fromMillis(count, opts) {
20480
+ static fromMillis(count2, opts) {
20481
20481
  return _Duration.fromObject({
20482
- milliseconds: count
20482
+ milliseconds: count2
20483
20483
  }, opts);
20484
20484
  }
20485
20485
  /**
@@ -20502,12 +20502,12 @@ var require_luxon = __commonJS({
20502
20502
  * @param {string} [opts.matrix=Object] - the custom conversion system to use
20503
20503
  * @return {Duration}
20504
20504
  */
20505
- static fromObject(obj, opts = {}) {
20506
- if (obj == null || typeof obj !== "object") {
20507
- throw new InvalidArgumentError(`Duration.fromObject: argument expected to be an object, got ${obj === null ? "null" : typeof obj}`);
20505
+ static fromObject(obj2, opts = {}) {
20506
+ if (obj2 == null || typeof obj2 !== "object") {
20507
+ throw new InvalidArgumentError(`Duration.fromObject: argument expected to be an object, got ${obj2 === null ? "null" : typeof obj2}`);
20508
20508
  }
20509
20509
  return new _Duration({
20510
- values: normalizeObject(obj, _Duration.normalizeUnit),
20510
+ values: normalizeObject(obj2, _Duration.normalizeUnit),
20511
20511
  loc: Locale.fromObject(opts),
20512
20512
  conversionAccuracy: opts.conversionAccuracy,
20513
20513
  matrix: opts.matrix
@@ -21576,8 +21576,8 @@ var require_luxon = __commonJS({
21576
21576
  }, {
21577
21577
  time: i.e,
21578
21578
  type: "e"
21579
- }]), flattened = Array.prototype.concat(...ends), arr = flattened.sort((a, b) => a.time - b.time);
21580
- for (const i of arr) {
21579
+ }]), flattened = Array.prototype.concat(...ends), arr2 = flattened.sort((a, b) => a.time - b.time);
21580
+ for (const i of arr2) {
21581
21581
  currentCount += i.type === "s" ? 1 : -1;
21582
21582
  if (currentCount === 1) {
21583
21583
  start = i.time;
@@ -22474,8 +22474,8 @@ var require_luxon = __commonJS({
22474
22474
  millisecond: d.getUTCMilliseconds()
22475
22475
  };
22476
22476
  }
22477
- function objToTS(obj, offset2, zone) {
22478
- return fixOffset(objToLocalTS(obj), offset2, zone);
22477
+ function objToTS(obj2, offset2, zone) {
22478
+ return fixOffset(objToLocalTS(obj2), offset2, zone);
22479
22479
  }
22480
22480
  function adjustTime(inst, dur) {
22481
22481
  const oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c = {
@@ -22681,25 +22681,25 @@ var require_luxon = __commonJS({
22681
22681
  }
22682
22682
  return offsetGuess;
22683
22683
  }
22684
- function quickDT(obj, opts) {
22684
+ function quickDT(obj2, opts) {
22685
22685
  const zone = normalizeZone(opts.zone, Settings.defaultZone);
22686
22686
  if (!zone.isValid) {
22687
22687
  return DateTime.invalid(unsupportedZone(zone));
22688
22688
  }
22689
22689
  const loc = Locale.fromObject(opts);
22690
22690
  let ts, o;
22691
- if (!isUndefined(obj.year)) {
22691
+ if (!isUndefined(obj2.year)) {
22692
22692
  for (const u of orderedUnits) {
22693
- if (isUndefined(obj[u])) {
22694
- obj[u] = defaultUnitValues[u];
22693
+ if (isUndefined(obj2[u])) {
22694
+ obj2[u] = defaultUnitValues[u];
22695
22695
  }
22696
22696
  }
22697
- const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);
22697
+ const invalid = hasInvalidGregorianData(obj2) || hasInvalidTimeData(obj2);
22698
22698
  if (invalid) {
22699
22699
  return DateTime.invalid(invalid);
22700
22700
  }
22701
22701
  const offsetProvis = guessOffsetForZone(zone);
22702
- [ts, o] = objToTS(obj, offsetProvis, zone);
22702
+ [ts, o] = objToTS(obj2, offsetProvis, zone);
22703
22703
  } else {
22704
22704
  ts = Settings.now();
22705
22705
  }
@@ -22728,9 +22728,9 @@ var require_luxon = __commonJS({
22728
22728
  return format(differ(opts.unit), opts.unit);
22729
22729
  }
22730
22730
  for (const unit of opts.units) {
22731
- const count = differ(unit);
22732
- if (Math.abs(count) >= 1) {
22733
- return format(count, unit);
22731
+ const count2 = differ(unit);
22732
+ if (Math.abs(count2) >= 1) {
22733
+ return format(count2, unit);
22734
22734
  }
22735
22735
  }
22736
22736
  return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);
@@ -22960,14 +22960,14 @@ var require_luxon = __commonJS({
22960
22960
  * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: "en-US" }).toISODate() //=> '2021-12-26'
22961
22961
  * @return {DateTime}
22962
22962
  */
22963
- static fromObject(obj, opts = {}) {
22964
- obj = obj || {};
22963
+ static fromObject(obj2, opts = {}) {
22964
+ obj2 = obj2 || {};
22965
22965
  const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);
22966
22966
  if (!zoneToUse.isValid) {
22967
22967
  return _DateTime.invalid(unsupportedZone(zoneToUse));
22968
22968
  }
22969
22969
  const loc = Locale.fromObject(opts);
22970
- const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);
22970
+ const normalized = normalizeObject(obj2, normalizeUnitWithLocalWeeks);
22971
22971
  const {
22972
22972
  minDaysInFirstWeek,
22973
22973
  startOfWeek
@@ -23014,7 +23014,7 @@ var require_luxon = __commonJS({
23014
23014
  o: offsetFinal,
23015
23015
  loc
23016
23016
  });
23017
- if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {
23017
+ if (normalized.weekday && containsGregor && obj2.weekday !== inst.weekday) {
23018
23018
  return _DateTime.invalid("mismatched weekday", `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`);
23019
23019
  }
23020
23020
  if (!inst.isValid) {
@@ -24804,11 +24804,11 @@ var require_field_compactor = __commonJS({
24804
24804
  results.push(currentItemRange);
24805
24805
  }
24806
24806
  }
24807
- function compactField(arr) {
24807
+ function compactField(arr2) {
24808
24808
  var results = [];
24809
24809
  var currentRange = void 0;
24810
- for (var i = 0; i < arr.length; i++) {
24811
- var currentItem = arr[i];
24810
+ for (var i = 0; i < arr2.length; i++) {
24811
+ var currentItem = arr2[i];
24812
24812
  if (typeof currentItem !== "number") {
24813
24813
  finalizeCurrentRange(results, currentRange, buildRange(currentItem));
24814
24814
  currentRange = void 0;
@@ -24842,8 +24842,8 @@ var require_field_stringify = __commonJS({
24842
24842
  "../../node_modules/.pnpm/cron-parser@4.9.0/node_modules/cron-parser/lib/field_stringify.js"(exports2, module2) {
24843
24843
  "use strict";
24844
24844
  var compactField = require_field_compactor();
24845
- function stringifyField(arr, min, max) {
24846
- var ranges = compactField(arr);
24845
+ function stringifyField(arr2, min, max) {
24846
+ var ranges = compactField(arr2);
24847
24847
  if (ranges.length === 1) {
24848
24848
  var singleRange = ranges[0];
24849
24849
  var step = singleRange.step;
@@ -25107,7 +25107,7 @@ var require_expression = __commonJS({
25107
25107
  if (field === "dayOfWeek" && max % 7 === 0) {
25108
25108
  stack.push(0);
25109
25109
  }
25110
- for (var index = min, count = max; index <= count; index++) {
25110
+ for (var index = min, count2 = max; index <= count2; index++) {
25111
25111
  var exists = stack.indexOf(index) !== -1;
25112
25112
  if (!exists && repeatIndex > 0 && repeatIndex % repeatInterval === 0) {
25113
25113
  repeatIndex = 1;
@@ -26062,7 +26062,7 @@ var require_anchors = __commonJS({
26062
26062
  var require_applyReviver = __commonJS({
26063
26063
  "../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/applyReviver.js"(exports2) {
26064
26064
  "use strict";
26065
- function applyReviver(reviver, obj, key, val) {
26065
+ function applyReviver(reviver, obj2, key, val) {
26066
26066
  if (val && typeof val === "object") {
26067
26067
  if (Array.isArray(val)) {
26068
26068
  for (let i = 0, len = val.length; i < len; ++i) {
@@ -26102,7 +26102,7 @@ var require_applyReviver = __commonJS({
26102
26102
  }
26103
26103
  }
26104
26104
  }
26105
- return reviver.call(obj, key, val);
26105
+ return reviver.call(obj2, key, val);
26106
26106
  }
26107
26107
  exports2.applyReviver = applyReviver;
26108
26108
  }
@@ -26170,8 +26170,8 @@ var require_Node = __commonJS({
26170
26170
  };
26171
26171
  const res = toJS.toJS(this, "", ctx);
26172
26172
  if (typeof onAnchor === "function")
26173
- for (const { count, res: res2 } of ctx.anchors.values())
26174
- onAnchor(res2, count);
26173
+ for (const { count: count2, res: res2 } of ctx.anchors.values())
26174
+ onAnchor(res2, count2);
26175
26175
  return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
26176
26176
  }
26177
26177
  };
@@ -26279,13 +26279,13 @@ var require_Alias = __commonJS({
26279
26279
  const anchor = anchors2 && source && anchors2.get(source);
26280
26280
  return anchor ? anchor.count * anchor.aliasCount : 0;
26281
26281
  } else if (identity.isCollection(node)) {
26282
- let count = 0;
26282
+ let count2 = 0;
26283
26283
  for (const item of node.items) {
26284
26284
  const c = getAliasCount(doc, item, anchors2);
26285
- if (c > count)
26286
- count = c;
26285
+ if (c > count2)
26286
+ count2 = c;
26287
26287
  }
26288
- return count;
26288
+ return count2;
26289
26289
  } else if (identity.isPair(node)) {
26290
26290
  const kc = getAliasCount(doc, node.key, anchors2);
26291
26291
  const vc = getAliasCount(doc, node.value, anchors2);
@@ -26549,13 +26549,13 @@ var require_Collection = __commonJS({
26549
26549
  var require_stringifyComment = __commonJS({
26550
26550
  "../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyComment.js"(exports2) {
26551
26551
  "use strict";
26552
- var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
26552
+ var stringifyComment = (str2) => str2.replace(/^(?!$)(?: $)?/gm, "#");
26553
26553
  function indentComment(comment, indent) {
26554
26554
  if (/^\n+$/.test(comment))
26555
26555
  return comment.substring(1);
26556
26556
  return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;
26557
26557
  }
26558
- var lineComment = (str, indent, comment) => str.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str.endsWith(" ") ? "" : " ") + comment;
26558
+ var lineComment = (str2, indent, comment) => str2.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str2.endsWith(" ") ? "" : " ") + comment;
26559
26559
  exports2.indentComment = indentComment;
26560
26560
  exports2.lineComment = lineComment;
26561
26561
  exports2.stringifyComment = stringifyComment;
@@ -26709,16 +26709,16 @@ var require_stringifyString = __commonJS({
26709
26709
  lineWidth: ctx.options.lineWidth,
26710
26710
  minContentWidth: ctx.options.minContentWidth
26711
26711
  });
26712
- var containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str);
26713
- function lineLengthOverLimit(str, lineWidth, indentLength) {
26712
+ var containsDocumentMarker = (str2) => /^(%|---|\.\.\.)/m.test(str2);
26713
+ function lineLengthOverLimit(str2, lineWidth, indentLength) {
26714
26714
  if (!lineWidth || lineWidth < 0)
26715
26715
  return false;
26716
26716
  const limit = lineWidth - indentLength;
26717
- const strLen = str.length;
26717
+ const strLen = str2.length;
26718
26718
  if (strLen <= limit)
26719
26719
  return false;
26720
26720
  for (let i = 0, start = 0; i < strLen; ++i) {
26721
- if (str[i] === "\n") {
26721
+ if (str2[i] === "\n") {
26722
26722
  if (i - start > limit)
26723
26723
  return true;
26724
26724
  start = i + 1;
@@ -26735,11 +26735,11 @@ var require_stringifyString = __commonJS({
26735
26735
  const { implicitKey } = ctx;
26736
26736
  const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
26737
26737
  const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
26738
- let str = "";
26738
+ let str2 = "";
26739
26739
  let start = 0;
26740
26740
  for (let i = 0, ch = json[i]; ch; ch = json[++i]) {
26741
26741
  if (ch === " " && json[i + 1] === "\\" && json[i + 2] === "n") {
26742
- str += json.slice(start, i) + "\\ ";
26742
+ str2 += json.slice(start, i) + "\\ ";
26743
26743
  i += 1;
26744
26744
  start = i;
26745
26745
  ch = "\\";
@@ -26748,38 +26748,38 @@ var require_stringifyString = __commonJS({
26748
26748
  switch (json[i + 1]) {
26749
26749
  case "u":
26750
26750
  {
26751
- str += json.slice(start, i);
26751
+ str2 += json.slice(start, i);
26752
26752
  const code = json.substr(i + 2, 4);
26753
26753
  switch (code) {
26754
26754
  case "0000":
26755
- str += "\\0";
26755
+ str2 += "\\0";
26756
26756
  break;
26757
26757
  case "0007":
26758
- str += "\\a";
26758
+ str2 += "\\a";
26759
26759
  break;
26760
26760
  case "000b":
26761
- str += "\\v";
26761
+ str2 += "\\v";
26762
26762
  break;
26763
26763
  case "001b":
26764
- str += "\\e";
26764
+ str2 += "\\e";
26765
26765
  break;
26766
26766
  case "0085":
26767
- str += "\\N";
26767
+ str2 += "\\N";
26768
26768
  break;
26769
26769
  case "00a0":
26770
- str += "\\_";
26770
+ str2 += "\\_";
26771
26771
  break;
26772
26772
  case "2028":
26773
- str += "\\L";
26773
+ str2 += "\\L";
26774
26774
  break;
26775
26775
  case "2029":
26776
- str += "\\P";
26776
+ str2 += "\\P";
26777
26777
  break;
26778
26778
  default:
26779
26779
  if (code.substr(0, 2) === "00")
26780
- str += "\\x" + code.substr(2);
26780
+ str2 += "\\x" + code.substr(2);
26781
26781
  else
26782
- str += json.substr(i, 6);
26782
+ str2 += json.substr(i, 6);
26783
26783
  }
26784
26784
  i += 5;
26785
26785
  start = i + 1;
@@ -26789,14 +26789,14 @@ var require_stringifyString = __commonJS({
26789
26789
  if (implicitKey || json[i + 2] === '"' || json.length < minMultiLineLength) {
26790
26790
  i += 1;
26791
26791
  } else {
26792
- str += json.slice(start, i) + "\n\n";
26792
+ str2 += json.slice(start, i) + "\n\n";
26793
26793
  while (json[i + 2] === "\\" && json[i + 3] === "n" && json[i + 4] !== '"') {
26794
- str += "\n";
26794
+ str2 += "\n";
26795
26795
  i += 2;
26796
26796
  }
26797
- str += indent;
26797
+ str2 += indent;
26798
26798
  if (json[i + 2] === " ")
26799
- str += "\\";
26799
+ str2 += "\\";
26800
26800
  i += 1;
26801
26801
  start = i + 1;
26802
26802
  }
@@ -26805,8 +26805,8 @@ var require_stringifyString = __commonJS({
26805
26805
  i += 1;
26806
26806
  }
26807
26807
  }
26808
- str = start ? str + json.slice(start) : json;
26809
- return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
26808
+ str2 = start ? str2 + json.slice(start) : json;
26809
+ return implicitKey ? str2 : foldFlowLines.foldFlowLines(str2, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
26810
26810
  }
26811
26811
  function singleQuotedString(value, ctx) {
26812
26812
  if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value))
@@ -26934,15 +26934,15 @@ ${indent}${start}${value}${end}`;
26934
26934
  return quotedString(value, ctx);
26935
26935
  }
26936
26936
  }
26937
- const str = value.replace(/\n+/g, `$&
26937
+ const str2 = value.replace(/\n+/g, `$&
26938
26938
  ${indent}`);
26939
26939
  if (actualString) {
26940
- const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str);
26940
+ const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str2);
26941
26941
  const { compat, tags } = ctx.doc.schema;
26942
26942
  if (tags.some(test) || compat?.some(test))
26943
26943
  return quotedString(value, ctx);
26944
26944
  }
26945
- return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
26945
+ return implicitKey ? str2 : foldFlowLines.foldFlowLines(str2, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
26946
26946
  }
26947
26947
  function stringifyString(item, ctx, onComment, onChompKeep) {
26948
26948
  const { implicitKey, inFlow } = ctx;
@@ -27038,10 +27038,10 @@ var require_stringify = __commonJS({
27038
27038
  return match.find((t) => t.format === item.format) ?? match[0];
27039
27039
  }
27040
27040
  let tagObj = void 0;
27041
- let obj;
27041
+ let obj2;
27042
27042
  if (identity.isScalar(item)) {
27043
- obj = item.value;
27044
- let match = tags.filter((t) => t.identify?.(obj));
27043
+ obj2 = item.value;
27044
+ let match = tags.filter((t) => t.identify?.(obj2));
27045
27045
  if (match.length > 1) {
27046
27046
  const testMatch = match.filter((t) => t.test);
27047
27047
  if (testMatch.length > 0)
@@ -27049,11 +27049,11 @@ var require_stringify = __commonJS({
27049
27049
  }
27050
27050
  tagObj = match.find((t) => t.format === item.format) ?? match.find((t) => !t.format);
27051
27051
  } else {
27052
- obj = item;
27053
- tagObj = tags.find((t) => t.nodeClass && obj instanceof t.nodeClass);
27052
+ obj2 = item;
27053
+ tagObj = tags.find((t) => t.nodeClass && obj2 instanceof t.nodeClass);
27054
27054
  }
27055
27055
  if (!tagObj) {
27056
- const name = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj);
27056
+ const name = obj2?.constructor?.name ?? (obj2 === null ? "null" : typeof obj2);
27057
27057
  throw new Error(`Tag not resolved for ${name} value`);
27058
27058
  }
27059
27059
  return tagObj;
@@ -27094,11 +27094,11 @@ var require_stringify = __commonJS({
27094
27094
  const props = stringifyProps(node, tagObj, ctx);
27095
27095
  if (props.length > 0)
27096
27096
  ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
27097
- const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);
27097
+ const str2 = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);
27098
27098
  if (!props)
27099
- return str;
27100
- return identity.isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props}
27101
- ${ctx.indent}${str}`;
27099
+ return str2;
27100
+ return identity.isScalar(node) || str2[0] === "{" || str2[0] === "[" ? `${props} ${str2}` : `${props}
27101
+ ${ctx.indent}${str2}`;
27102
27102
  }
27103
27103
  exports2.createStringifyContext = createStringifyContext;
27104
27104
  exports2.stringify = stringify;
@@ -27133,8 +27133,8 @@ var require_stringifyPair = __commonJS({
27133
27133
  });
27134
27134
  let keyCommentDone = false;
27135
27135
  let chompKeep = false;
27136
- let str = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
27137
- if (!explicitKey && !ctx.inFlow && str.length > 1024) {
27136
+ let str2 = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
27137
+ if (!explicitKey && !ctx.inFlow && str2.length > 1024) {
27138
27138
  if (simpleKeys)
27139
27139
  throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
27140
27140
  explicitKey = true;
@@ -27143,27 +27143,27 @@ var require_stringifyPair = __commonJS({
27143
27143
  if (allNullValues || value == null) {
27144
27144
  if (keyCommentDone && onComment)
27145
27145
  onComment();
27146
- return str === "" ? "?" : explicitKey ? `? ${str}` : str;
27146
+ return str2 === "" ? "?" : explicitKey ? `? ${str2}` : str2;
27147
27147
  }
27148
27148
  } else if (allNullValues && !simpleKeys || value == null && explicitKey) {
27149
- str = `? ${str}`;
27149
+ str2 = `? ${str2}`;
27150
27150
  if (keyComment && !keyCommentDone) {
27151
- str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
27151
+ str2 += stringifyComment.lineComment(str2, ctx.indent, commentString(keyComment));
27152
27152
  } else if (chompKeep && onChompKeep)
27153
27153
  onChompKeep();
27154
- return str;
27154
+ return str2;
27155
27155
  }
27156
27156
  if (keyCommentDone)
27157
27157
  keyComment = null;
27158
27158
  if (explicitKey) {
27159
27159
  if (keyComment)
27160
- str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
27161
- str = `? ${str}
27160
+ str2 += stringifyComment.lineComment(str2, ctx.indent, commentString(keyComment));
27161
+ str2 = `? ${str2}
27162
27162
  ${indent}:`;
27163
27163
  } else {
27164
- str = `${str}:`;
27164
+ str2 = `${str2}:`;
27165
27165
  if (keyComment)
27166
- str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
27166
+ str2 += stringifyComment.lineComment(str2, ctx.indent, commentString(keyComment));
27167
27167
  }
27168
27168
  let vsb, vcb, valueComment;
27169
27169
  if (identity.isNode(value)) {
@@ -27179,7 +27179,7 @@ ${indent}:`;
27179
27179
  }
27180
27180
  ctx.implicitKey = false;
27181
27181
  if (!explicitKey && !keyComment && identity.isScalar(value))
27182
- ctx.indentAtStart = str.length + 1;
27182
+ ctx.indentAtStart = str2.length + 1;
27183
27183
  chompKeep = false;
27184
27184
  if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity.isSeq(value) && !value.flow && !value.tag && !value.anchor) {
27185
27185
  ctx.indent = ctx.indent.substring(2);
@@ -27223,16 +27223,16 @@ ${ctx.indent}`;
27223
27223
  } else if (valueStr === "" || valueStr[0] === "\n") {
27224
27224
  ws = "";
27225
27225
  }
27226
- str += ws + valueStr;
27226
+ str2 += ws + valueStr;
27227
27227
  if (ctx.inFlow) {
27228
27228
  if (valueCommentDone && onComment)
27229
27229
  onComment();
27230
27230
  } else if (valueComment && !valueCommentDone) {
27231
- str += stringifyComment.lineComment(str, ctx.indent, commentString(valueComment));
27231
+ str2 += stringifyComment.lineComment(str2, ctx.indent, commentString(valueComment));
27232
27232
  } else if (chompKeep && onChompKeep) {
27233
27233
  onChompKeep();
27234
27234
  }
27235
- return str;
27235
+ return str2;
27236
27236
  }
27237
27237
  exports2.stringifyPair = stringifyPair;
27238
27238
  }
@@ -27459,31 +27459,31 @@ var require_stringifyCollection = __commonJS({
27459
27459
  }
27460
27460
  }
27461
27461
  chompKeep = false;
27462
- let str2 = stringify.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
27462
+ let str3 = stringify.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
27463
27463
  if (comment2)
27464
- str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2));
27464
+ str3 += stringifyComment.lineComment(str3, itemIndent, commentString(comment2));
27465
27465
  if (chompKeep && comment2)
27466
27466
  chompKeep = false;
27467
- lines.push(blockItemPrefix + str2);
27467
+ lines.push(blockItemPrefix + str3);
27468
27468
  }
27469
- let str;
27469
+ let str2;
27470
27470
  if (lines.length === 0) {
27471
- str = flowChars.start + flowChars.end;
27471
+ str2 = flowChars.start + flowChars.end;
27472
27472
  } else {
27473
- str = lines[0];
27473
+ str2 = lines[0];
27474
27474
  for (let i = 1; i < lines.length; ++i) {
27475
27475
  const line = lines[i];
27476
- str += line ? `
27476
+ str2 += line ? `
27477
27477
  ${indent}${line}` : "\n";
27478
27478
  }
27479
27479
  }
27480
27480
  if (comment) {
27481
- str += "\n" + stringifyComment.indentComment(commentString(comment), indent);
27481
+ str2 += "\n" + stringifyComment.indentComment(commentString(comment), indent);
27482
27482
  if (onComment)
27483
27483
  onComment();
27484
27484
  } else if (chompKeep && onChompKeep)
27485
27485
  onChompKeep();
27486
- return str;
27486
+ return str2;
27487
27487
  }
27488
27488
  function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
27489
27489
  const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
@@ -27526,21 +27526,21 @@ ${indent}${line}` : "\n";
27526
27526
  }
27527
27527
  if (comment)
27528
27528
  reqNewline = true;
27529
- let str = stringify.stringify(item, itemCtx, () => comment = null);
27530
- reqNewline || (reqNewline = lines.length > linesAtValue || str.includes("\n"));
27529
+ let str2 = stringify.stringify(item, itemCtx, () => comment = null);
27530
+ reqNewline || (reqNewline = lines.length > linesAtValue || str2.includes("\n"));
27531
27531
  if (i < items.length - 1) {
27532
- str += ",";
27532
+ str2 += ",";
27533
27533
  } else if (ctx.options.trailingComma) {
27534
27534
  if (ctx.options.lineWidth > 0) {
27535
- reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str.length + 2) > ctx.options.lineWidth);
27535
+ reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str2.length + 2) > ctx.options.lineWidth);
27536
27536
  }
27537
27537
  if (reqNewline) {
27538
- str += ",";
27538
+ str2 += ",";
27539
27539
  }
27540
27540
  }
27541
27541
  if (comment)
27542
- str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
27543
- lines.push(str);
27542
+ str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment));
27543
+ lines.push(str2);
27544
27544
  linesAtValue = lines.length;
27545
27545
  }
27546
27546
  const { start, end } = flowChars;
@@ -27552,11 +27552,11 @@ ${indent}${line}` : "\n";
27552
27552
  reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
27553
27553
  }
27554
27554
  if (reqNewline) {
27555
- let str = start;
27555
+ let str2 = start;
27556
27556
  for (const line of lines)
27557
- str += line ? `
27557
+ str2 += line ? `
27558
27558
  ${indentStep}${indent}${line}` : "\n";
27559
- return `${str}
27559
+ return `${str2}
27560
27560
  ${indent}${end}`;
27561
27561
  } else {
27562
27562
  return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`;
@@ -27609,23 +27609,23 @@ var require_YAMLMap = __commonJS({
27609
27609
  * A generic collection parsing method that can be extended
27610
27610
  * to other node classes that inherit from YAMLMap
27611
27611
  */
27612
- static from(schema, obj, ctx) {
27612
+ static from(schema, obj2, ctx) {
27613
27613
  const { keepUndefined, replacer } = ctx;
27614
27614
  const map = new this(schema);
27615
27615
  const add = (key, value) => {
27616
27616
  if (typeof replacer === "function")
27617
- value = replacer.call(obj, key, value);
27617
+ value = replacer.call(obj2, key, value);
27618
27618
  else if (Array.isArray(replacer) && !replacer.includes(key))
27619
27619
  return;
27620
27620
  if (value !== void 0 || keepUndefined)
27621
27621
  map.items.push(Pair.createPair(key, value, ctx));
27622
27622
  };
27623
- if (obj instanceof Map) {
27624
- for (const [key, value] of obj)
27623
+ if (obj2 instanceof Map) {
27624
+ for (const [key, value] of obj2)
27625
27625
  add(key, value);
27626
- } else if (obj && typeof obj === "object") {
27627
- for (const key of Object.keys(obj))
27628
- add(key, obj[key]);
27626
+ } else if (obj2 && typeof obj2 === "object") {
27627
+ for (const key of Object.keys(obj2))
27628
+ add(key, obj2[key]);
27629
27629
  }
27630
27630
  if (typeof schema.sortMapEntries === "function") {
27631
27631
  map.items.sort(schema.sortMapEntries);
@@ -27735,7 +27735,7 @@ var require_map = __commonJS({
27735
27735
  onError("Expected a mapping for this tag");
27736
27736
  return map2;
27737
27737
  },
27738
- createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx)
27738
+ createNode: (schema, obj2, ctx) => YAMLMap.YAMLMap.from(schema, obj2, ctx)
27739
27739
  };
27740
27740
  exports2.map = map;
27741
27741
  }
@@ -27831,15 +27831,15 @@ var require_YAMLSeq = __commonJS({
27831
27831
  onComment
27832
27832
  });
27833
27833
  }
27834
- static from(schema, obj, ctx) {
27834
+ static from(schema, obj2, ctx) {
27835
27835
  const { replacer } = ctx;
27836
27836
  const seq = new this(schema);
27837
- if (obj && Symbol.iterator in Object(obj)) {
27837
+ if (obj2 && Symbol.iterator in Object(obj2)) {
27838
27838
  let i = 0;
27839
- for (let it of obj) {
27839
+ for (let it of obj2) {
27840
27840
  if (typeof replacer === "function") {
27841
- const key = obj instanceof Set ? it : String(i++);
27842
- it = replacer.call(obj, key, it);
27841
+ const key = obj2 instanceof Set ? it : String(i++);
27842
+ it = replacer.call(obj2, key, it);
27843
27843
  }
27844
27844
  seq.items.push(createNode.createNode(it, void 0, ctx));
27845
27845
  }
@@ -27873,7 +27873,7 @@ var require_seq = __commonJS({
27873
27873
  onError("Expected a sequence for this tag");
27874
27874
  return seq2;
27875
27875
  },
27876
- createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx)
27876
+ createNode: (schema, obj2, ctx) => YAMLSeq.YAMLSeq.from(schema, obj2, ctx)
27877
27877
  };
27878
27878
  exports2.seq = seq;
27879
27879
  }
@@ -27888,7 +27888,7 @@ var require_string = __commonJS({
27888
27888
  identify: (value) => typeof value === "string",
27889
27889
  default: true,
27890
27890
  tag: "tag:yaml.org,2002:str",
27891
- resolve: (str) => str,
27891
+ resolve: (str2) => str2,
27892
27892
  stringify(item, ctx, onComment, onChompKeep) {
27893
27893
  ctx = Object.assign({ actualString: true }, ctx);
27894
27894
  return stringifyString.stringifyString(item, ctx, onComment, onChompKeep);
@@ -27926,7 +27926,7 @@ var require_bool = __commonJS({
27926
27926
  default: true,
27927
27927
  tag: "tag:yaml.org,2002:bool",
27928
27928
  test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
27929
- resolve: (str) => new Scalar.Scalar(str[0] === "t" || str[0] === "T"),
27929
+ resolve: (str2) => new Scalar.Scalar(str2[0] === "t" || str2[0] === "T"),
27930
27930
  stringify({ source, value }, ctx) {
27931
27931
  if (source && boolTag.test.test(source)) {
27932
27932
  const sv = source[0] === "t" || source[0] === "T";
@@ -27947,9 +27947,9 @@ var require_stringifyNumber = __commonJS({
27947
27947
  function stringifyNumber({ format, minFractionDigits, tag, value }) {
27948
27948
  if (typeof value === "bigint")
27949
27949
  return String(value);
27950
- const num = typeof value === "number" ? value : Number(value);
27951
- if (!isFinite(num))
27952
- return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
27950
+ const num2 = typeof value === "number" ? value : Number(value);
27951
+ if (!isFinite(num2))
27952
+ return isNaN(num2) ? ".nan" : num2 < 0 ? "-.inf" : ".inf";
27953
27953
  let n = Object.is(value, -0) ? "-0" : JSON.stringify(value);
27954
27954
  if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^-?\d/.test(n) && !n.includes("e")) {
27955
27955
  let i = n.indexOf(".");
@@ -27978,7 +27978,7 @@ var require_float = __commonJS({
27978
27978
  default: true,
27979
27979
  tag: "tag:yaml.org,2002:float",
27980
27980
  test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
27981
- resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
27981
+ resolve: (str2) => str2.slice(-3).toLowerCase() === "nan" ? NaN : str2[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
27982
27982
  stringify: stringifyNumber.stringifyNumber
27983
27983
  };
27984
27984
  var floatExp = {
@@ -27987,10 +27987,10 @@ var require_float = __commonJS({
27987
27987
  tag: "tag:yaml.org,2002:float",
27988
27988
  format: "EXP",
27989
27989
  test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
27990
- resolve: (str) => parseFloat(str),
27990
+ resolve: (str2) => parseFloat(str2),
27991
27991
  stringify(node) {
27992
- const num = Number(node.value);
27993
- return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);
27992
+ const num2 = Number(node.value);
27993
+ return isFinite(num2) ? num2.toExponential() : stringifyNumber.stringifyNumber(node);
27994
27994
  }
27995
27995
  };
27996
27996
  var float = {
@@ -27998,11 +27998,11 @@ var require_float = __commonJS({
27998
27998
  default: true,
27999
27999
  tag: "tag:yaml.org,2002:float",
28000
28000
  test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
28001
- resolve(str) {
28002
- const node = new Scalar.Scalar(parseFloat(str));
28003
- const dot = str.indexOf(".");
28004
- if (dot !== -1 && str[str.length - 1] === "0")
28005
- node.minFractionDigits = str.length - dot - 1;
28001
+ resolve(str2) {
28002
+ const node = new Scalar.Scalar(parseFloat(str2));
28003
+ const dot = str2.indexOf(".");
28004
+ if (dot !== -1 && str2[str2.length - 1] === "0")
28005
+ node.minFractionDigits = str2.length - dot - 1;
28006
28006
  return node;
28007
28007
  },
28008
28008
  stringify: stringifyNumber.stringifyNumber
@@ -28019,7 +28019,7 @@ var require_int = __commonJS({
28019
28019
  "use strict";
28020
28020
  var stringifyNumber = require_stringifyNumber();
28021
28021
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
28022
- var intResolve = (str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix);
28022
+ var intResolve = (str2, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str2) : parseInt(str2.substring(offset), radix);
28023
28023
  function intStringify(node, radix, prefix) {
28024
28024
  const { value } = node;
28025
28025
  if (intIdentify(value) && value >= 0)
@@ -28032,7 +28032,7 @@ var require_int = __commonJS({
28032
28032
  tag: "tag:yaml.org,2002:int",
28033
28033
  format: "OCT",
28034
28034
  test: /^0o[0-7]+$/,
28035
- resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt),
28035
+ resolve: (str2, _onError, opt) => intResolve(str2, 2, 8, opt),
28036
28036
  stringify: (node) => intStringify(node, 8, "0o")
28037
28037
  };
28038
28038
  var int = {
@@ -28040,7 +28040,7 @@ var require_int = __commonJS({
28040
28040
  default: true,
28041
28041
  tag: "tag:yaml.org,2002:int",
28042
28042
  test: /^[-+]?[0-9]+$/,
28043
- resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),
28043
+ resolve: (str2, _onError, opt) => intResolve(str2, 0, 10, opt),
28044
28044
  stringify: stringifyNumber.stringifyNumber
28045
28045
  };
28046
28046
  var intHex = {
@@ -28049,7 +28049,7 @@ var require_int = __commonJS({
28049
28049
  tag: "tag:yaml.org,2002:int",
28050
28050
  format: "HEX",
28051
28051
  test: /^0x[0-9a-fA-F]+$/,
28052
- resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),
28052
+ resolve: (str2, _onError, opt) => intResolve(str2, 2, 16, opt),
28053
28053
  stringify: (node) => intStringify(node, 16, "0x")
28054
28054
  };
28055
28055
  exports2.int = int;
@@ -28102,7 +28102,7 @@ var require_schema2 = __commonJS({
28102
28102
  identify: (value) => typeof value === "string",
28103
28103
  default: true,
28104
28104
  tag: "tag:yaml.org,2002:str",
28105
- resolve: (str) => str,
28105
+ resolve: (str2) => str2,
28106
28106
  stringify: stringifyJSON
28107
28107
  },
28108
28108
  {
@@ -28119,7 +28119,7 @@ var require_schema2 = __commonJS({
28119
28119
  default: true,
28120
28120
  tag: "tag:yaml.org,2002:bool",
28121
28121
  test: /^true$|^false$/,
28122
- resolve: (str) => str === "true",
28122
+ resolve: (str2) => str2 === "true",
28123
28123
  stringify: stringifyJSON
28124
28124
  },
28125
28125
  {
@@ -28127,7 +28127,7 @@ var require_schema2 = __commonJS({
28127
28127
  default: true,
28128
28128
  tag: "tag:yaml.org,2002:int",
28129
28129
  test: /^-?(?:0|[1-9][0-9]*)$/,
28130
- resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),
28130
+ resolve: (str2, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str2) : parseInt(str2, 10),
28131
28131
  stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)
28132
28132
  },
28133
28133
  {
@@ -28135,7 +28135,7 @@ var require_schema2 = __commonJS({
28135
28135
  default: true,
28136
28136
  tag: "tag:yaml.org,2002:float",
28137
28137
  test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
28138
- resolve: (str) => parseFloat(str),
28138
+ resolve: (str2) => parseFloat(str2),
28139
28139
  stringify: stringifyJSON
28140
28140
  }
28141
28141
  ];
@@ -28143,9 +28143,9 @@ var require_schema2 = __commonJS({
28143
28143
  default: true,
28144
28144
  tag: "",
28145
28145
  test: /^/,
28146
- resolve(str, onError) {
28147
- onError(`Unresolved plain scalar ${JSON.stringify(str)}`);
28148
- return str;
28146
+ resolve(str2, onError) {
28147
+ onError(`Unresolved plain scalar ${JSON.stringify(str2)}`);
28148
+ return str2;
28149
28149
  }
28150
28150
  };
28151
28151
  var schema = [map.map, seq.seq].concat(jsonScalars, jsonError);
@@ -28177,10 +28177,10 @@ var require_binary = __commonJS({
28177
28177
  if (typeof node_buffer.Buffer === "function") {
28178
28178
  return node_buffer.Buffer.from(src, "base64");
28179
28179
  } else if (typeof atob === "function") {
28180
- const str = atob(src.replace(/[\n\r]/g, ""));
28181
- const buffer = new Uint8Array(str.length);
28182
- for (let i = 0; i < str.length; ++i)
28183
- buffer[i] = str.charCodeAt(i);
28180
+ const str2 = atob(src.replace(/[\n\r]/g, ""));
28181
+ const buffer = new Uint8Array(str2.length);
28182
+ for (let i = 0; i < str2.length; ++i)
28183
+ buffer[i] = str2.charCodeAt(i);
28184
28184
  return buffer;
28185
28185
  } else {
28186
28186
  onError("This environment does not support reading binary tags; either Buffer or atob is required");
@@ -28191,28 +28191,28 @@ var require_binary = __commonJS({
28191
28191
  if (!value)
28192
28192
  return "";
28193
28193
  const buf = value;
28194
- let str;
28194
+ let str2;
28195
28195
  if (typeof node_buffer.Buffer === "function") {
28196
- str = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64");
28196
+ str2 = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64");
28197
28197
  } else if (typeof btoa === "function") {
28198
28198
  let s = "";
28199
28199
  for (let i = 0; i < buf.length; ++i)
28200
28200
  s += String.fromCharCode(buf[i]);
28201
- str = btoa(s);
28201
+ str2 = btoa(s);
28202
28202
  } else {
28203
28203
  throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
28204
28204
  }
28205
28205
  type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
28206
28206
  if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
28207
28207
  const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
28208
- const n = Math.ceil(str.length / lineWidth);
28208
+ const n = Math.ceil(str2.length / lineWidth);
28209
28209
  const lines = new Array(n);
28210
28210
  for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {
28211
- lines[i] = str.substr(o, lineWidth);
28211
+ lines[i] = str2.substr(o, lineWidth);
28212
28212
  }
28213
- str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " ");
28213
+ str2 = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " ");
28214
28214
  }
28215
- return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
28215
+ return stringifyString.stringifyString({ comment, type, value: str2 }, ctx, onComment, onChompKeep);
28216
28216
  }
28217
28217
  };
28218
28218
  exports2.binary = binary;
@@ -28418,7 +28418,7 @@ var require_float2 = __commonJS({
28418
28418
  default: true,
28419
28419
  tag: "tag:yaml.org,2002:float",
28420
28420
  test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
28421
- resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
28421
+ resolve: (str2) => str2.slice(-3).toLowerCase() === "nan" ? NaN : str2[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
28422
28422
  stringify: stringifyNumber.stringifyNumber
28423
28423
  };
28424
28424
  var floatExp = {
@@ -28427,10 +28427,10 @@ var require_float2 = __commonJS({
28427
28427
  tag: "tag:yaml.org,2002:float",
28428
28428
  format: "EXP",
28429
28429
  test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
28430
- resolve: (str) => parseFloat(str.replace(/_/g, "")),
28430
+ resolve: (str2) => parseFloat(str2.replace(/_/g, "")),
28431
28431
  stringify(node) {
28432
- const num = Number(node.value);
28433
- return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);
28432
+ const num2 = Number(node.value);
28433
+ return isFinite(num2) ? num2.toExponential() : stringifyNumber.stringifyNumber(node);
28434
28434
  }
28435
28435
  };
28436
28436
  var float = {
@@ -28438,11 +28438,11 @@ var require_float2 = __commonJS({
28438
28438
  default: true,
28439
28439
  tag: "tag:yaml.org,2002:float",
28440
28440
  test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
28441
- resolve(str) {
28442
- const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, "")));
28443
- const dot = str.indexOf(".");
28441
+ resolve(str2) {
28442
+ const node = new Scalar.Scalar(parseFloat(str2.replace(/_/g, "")));
28443
+ const dot = str2.indexOf(".");
28444
28444
  if (dot !== -1) {
28445
- const f = str.substring(dot + 1).replace(/_/g, "");
28445
+ const f = str2.substring(dot + 1).replace(/_/g, "");
28446
28446
  if (f[f.length - 1] === "0")
28447
28447
  node.minFractionDigits = f.length;
28448
28448
  }
@@ -28462,34 +28462,34 @@ var require_int2 = __commonJS({
28462
28462
  "use strict";
28463
28463
  var stringifyNumber = require_stringifyNumber();
28464
28464
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
28465
- function intResolve(str, offset, radix, { intAsBigInt }) {
28466
- const sign = str[0];
28465
+ function intResolve(str2, offset, radix, { intAsBigInt }) {
28466
+ const sign = str2[0];
28467
28467
  if (sign === "-" || sign === "+")
28468
28468
  offset += 1;
28469
- str = str.substring(offset).replace(/_/g, "");
28469
+ str2 = str2.substring(offset).replace(/_/g, "");
28470
28470
  if (intAsBigInt) {
28471
28471
  switch (radix) {
28472
28472
  case 2:
28473
- str = `0b${str}`;
28473
+ str2 = `0b${str2}`;
28474
28474
  break;
28475
28475
  case 8:
28476
- str = `0o${str}`;
28476
+ str2 = `0o${str2}`;
28477
28477
  break;
28478
28478
  case 16:
28479
- str = `0x${str}`;
28479
+ str2 = `0x${str2}`;
28480
28480
  break;
28481
28481
  }
28482
- const n2 = BigInt(str);
28482
+ const n2 = BigInt(str2);
28483
28483
  return sign === "-" ? BigInt(-1) * n2 : n2;
28484
28484
  }
28485
- const n = parseInt(str, radix);
28485
+ const n = parseInt(str2, radix);
28486
28486
  return sign === "-" ? -1 * n : n;
28487
28487
  }
28488
28488
  function intStringify(node, radix, prefix) {
28489
28489
  const { value } = node;
28490
28490
  if (intIdentify(value)) {
28491
- const str = value.toString(radix);
28492
- return value < 0 ? "-" + prefix + str.substr(1) : prefix + str;
28491
+ const str2 = value.toString(radix);
28492
+ return value < 0 ? "-" + prefix + str2.substr(1) : prefix + str2;
28493
28493
  }
28494
28494
  return stringifyNumber.stringifyNumber(node);
28495
28495
  }
@@ -28499,7 +28499,7 @@ var require_int2 = __commonJS({
28499
28499
  tag: "tag:yaml.org,2002:int",
28500
28500
  format: "BIN",
28501
28501
  test: /^[-+]?0b[0-1_]+$/,
28502
- resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt),
28502
+ resolve: (str2, _onError, opt) => intResolve(str2, 2, 2, opt),
28503
28503
  stringify: (node) => intStringify(node, 2, "0b")
28504
28504
  };
28505
28505
  var intOct = {
@@ -28508,7 +28508,7 @@ var require_int2 = __commonJS({
28508
28508
  tag: "tag:yaml.org,2002:int",
28509
28509
  format: "OCT",
28510
28510
  test: /^[-+]?0[0-7_]+$/,
28511
- resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt),
28511
+ resolve: (str2, _onError, opt) => intResolve(str2, 1, 8, opt),
28512
28512
  stringify: (node) => intStringify(node, 8, "0")
28513
28513
  };
28514
28514
  var int = {
@@ -28516,7 +28516,7 @@ var require_int2 = __commonJS({
28516
28516
  default: true,
28517
28517
  tag: "tag:yaml.org,2002:int",
28518
28518
  test: /^[-+]?[0-9][0-9_]*$/,
28519
- resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),
28519
+ resolve: (str2, _onError, opt) => intResolve(str2, 0, 10, opt),
28520
28520
  stringify: stringifyNumber.stringifyNumber
28521
28521
  };
28522
28522
  var intHex = {
@@ -28525,7 +28525,7 @@ var require_int2 = __commonJS({
28525
28525
  tag: "tag:yaml.org,2002:int",
28526
28526
  format: "HEX",
28527
28527
  test: /^[-+]?0x[0-9a-fA-F_]+$/,
28528
- resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),
28528
+ resolve: (str2, _onError, opt) => intResolve(str2, 2, 16, opt),
28529
28529
  stringify: (node) => intStringify(node, 16, "0x")
28530
28530
  };
28531
28531
  exports2.int = int;
@@ -28629,26 +28629,26 @@ var require_timestamp = __commonJS({
28629
28629
  "../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports2) {
28630
28630
  "use strict";
28631
28631
  var stringifyNumber = require_stringifyNumber();
28632
- function parseSexagesimal(str, asBigInt) {
28633
- const sign = str[0];
28634
- const parts = sign === "-" || sign === "+" ? str.substring(1) : str;
28635
- const num = (n) => asBigInt ? BigInt(n) : Number(n);
28636
- const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0));
28637
- return sign === "-" ? num(-1) * res : res;
28632
+ function parseSexagesimal(str2, asBigInt) {
28633
+ const sign = str2[0];
28634
+ const parts = sign === "-" || sign === "+" ? str2.substring(1) : str2;
28635
+ const num2 = (n) => asBigInt ? BigInt(n) : Number(n);
28636
+ const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num2(60) + num2(p), num2(0));
28637
+ return sign === "-" ? num2(-1) * res : res;
28638
28638
  }
28639
28639
  function stringifySexagesimal(node) {
28640
28640
  let { value } = node;
28641
- let num = (n) => n;
28641
+ let num2 = (n) => n;
28642
28642
  if (typeof value === "bigint")
28643
- num = (n) => BigInt(n);
28643
+ num2 = (n) => BigInt(n);
28644
28644
  else if (isNaN(value) || !isFinite(value))
28645
28645
  return stringifyNumber.stringifyNumber(node);
28646
28646
  let sign = "";
28647
28647
  if (value < 0) {
28648
28648
  sign = "-";
28649
- value *= num(-1);
28649
+ value *= num2(-1);
28650
28650
  }
28651
- const _60 = num(60);
28651
+ const _60 = num2(60);
28652
28652
  const parts = [value % _60];
28653
28653
  if (value < 60) {
28654
28654
  parts.unshift(0);
@@ -28668,7 +28668,7 @@ var require_timestamp = __commonJS({
28668
28668
  tag: "tag:yaml.org,2002:int",
28669
28669
  format: "TIME",
28670
28670
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
28671
- resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt),
28671
+ resolve: (str2, _onError, { intAsBigInt }) => parseSexagesimal(str2, intAsBigInt),
28672
28672
  stringify: stringifySexagesimal
28673
28673
  };
28674
28674
  var floatTime = {
@@ -28677,7 +28677,7 @@ var require_timestamp = __commonJS({
28677
28677
  tag: "tag:yaml.org,2002:float",
28678
28678
  format: "TIME",
28679
28679
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
28680
- resolve: (str) => parseSexagesimal(str, false),
28680
+ resolve: (str2) => parseSexagesimal(str2, false),
28681
28681
  stringify: stringifySexagesimal
28682
28682
  };
28683
28683
  var timestamp = {
@@ -28688,8 +28688,8 @@ var require_timestamp = __commonJS({
28688
28688
  // may be omitted altogether, resulting in a date format. In such a case, the time part is
28689
28689
  // assumed to be 00:00:00Z (start of day, UTC).
28690
28690
  test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
28691
- resolve(str) {
28692
- const match = str.match(timestamp.test);
28691
+ resolve(str2) {
28692
+ const match = str2.match(timestamp.test);
28693
28693
  if (!match)
28694
28694
  throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
28695
28695
  const [, year, month, day, hour, minute, second] = match.map(Number);
@@ -29238,8 +29238,8 @@ var require_Document = __commonJS({
29238
29238
  };
29239
29239
  const res = toJS.toJS(this.contents, jsonArg ?? "", ctx);
29240
29240
  if (typeof onAnchor === "function")
29241
- for (const { count, res: res2 } of ctx.anchors.values())
29242
- onAnchor(res2, count);
29241
+ for (const { count: count2, res: res2 } of ctx.anchors.values())
29242
+ onAnchor(res2, count2);
29243
29243
  return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
29244
29244
  }
29245
29245
  /**
@@ -29316,12 +29316,12 @@ var require_errors2 = __commonJS({
29316
29316
  lineStr = prev + lineStr;
29317
29317
  }
29318
29318
  if (/[^ ]/.test(lineStr)) {
29319
- let count = 1;
29319
+ let count2 = 1;
29320
29320
  const end = error.linePos[1];
29321
29321
  if (end?.line === line && end.col > col) {
29322
- count = Math.max(1, Math.min(end.col - col, 80 - ci));
29322
+ count2 = Math.max(1, Math.min(end.col - col, 80 - ci));
29323
29323
  }
29324
- const pointer = " ".repeat(ci) + "^".repeat(count);
29324
+ const pointer = " ".repeat(ci) + "^".repeat(count2);
29325
29325
  error.message += `:
29326
29326
 
29327
29327
  ${lineStr}
@@ -33277,7 +33277,7 @@ ${cause.stack}`;
33277
33277
  var _this2 = this;
33278
33278
  let error = null;
33279
33279
  let data = null;
33280
- let count = null;
33280
+ let count2 = null;
33281
33281
  let status = res.status;
33282
33282
  let statusText = res.statusText;
33283
33283
  if (res.ok) {
@@ -33303,7 +33303,7 @@ ${cause.stack}`;
33303
33303
  }
33304
33304
  const countHeader = (_this$headers$get2 = _this2.headers.get("Prefer")) === null || _this$headers$get2 === void 0 ? void 0 : _this$headers$get2.match(/count=(exact|planned|estimated)/);
33305
33305
  const contentRange = (_res$headers$get2 = res.headers.get("content-range")) === null || _res$headers$get2 === void 0 ? void 0 : _res$headers$get2.split("/");
33306
- if (countHeader && contentRange && contentRange.length > 1) count = parseInt(contentRange[1]);
33306
+ if (countHeader && contentRange && contentRange.length > 1) count2 = parseInt(contentRange[1]);
33307
33307
  if (_this2.isMaybeSingle && Array.isArray(data)) if (data.length > 1) {
33308
33308
  error = {
33309
33309
  code: "PGRST116",
@@ -33312,7 +33312,7 @@ ${cause.stack}`;
33312
33312
  message: "JSON object requested, multiple (or no) rows returned"
33313
33313
  };
33314
33314
  data = null;
33315
- count = null;
33315
+ count2 = null;
33316
33316
  status = 406;
33317
33317
  statusText = "Not Acceptable";
33318
33318
  } else if (data.length === 1) data = data[0];
@@ -33339,7 +33339,7 @@ ${cause.stack}`;
33339
33339
  success: error === null,
33340
33340
  error,
33341
33341
  data,
33342
- count,
33342
+ count: count2,
33343
33343
  status,
33344
33344
  statusText
33345
33345
  };
@@ -36939,7 +36939,7 @@ var PostgrestQueryBuilder = class {
36939
36939
  * ```
36940
36940
  */
36941
36941
  select(columns, options) {
36942
- const { head: head2 = false, count } = options !== null && options !== void 0 ? options : {};
36942
+ const { head: head2 = false, count: count2 } = options !== null && options !== void 0 ? options : {};
36943
36943
  const method = head2 ? "HEAD" : "GET";
36944
36944
  let quoted = false;
36945
36945
  const cleanedColumns = (columns !== null && columns !== void 0 ? columns : "*").split("").map((c) => {
@@ -36949,7 +36949,7 @@ var PostgrestQueryBuilder = class {
36949
36949
  }).join("");
36950
36950
  const { url, headers } = this.cloneRequestState();
36951
36951
  url.searchParams.set("select", cleanedColumns);
36952
- if (count) headers.append("Prefer", `count=${count}`);
36952
+ if (count2) headers.append("Prefer", `count=${count2}`);
36953
36953
  return new PostgrestFilterBuilder({
36954
36954
  method,
36955
36955
  url,
@@ -37080,11 +37080,11 @@ var PostgrestQueryBuilder = class {
37080
37080
  * }
37081
37081
  * ```
37082
37082
  */
37083
- insert(values, { count, defaultToNull = true } = {}) {
37083
+ insert(values, { count: count2, defaultToNull = true } = {}) {
37084
37084
  var _this$fetch;
37085
37085
  const method = "POST";
37086
37086
  const { url, headers } = this.cloneRequestState();
37087
- if (count) headers.append("Prefer", `count=${count}`);
37087
+ if (count2) headers.append("Prefer", `count=${count2}`);
37088
37088
  if (!defaultToNull) headers.append("Prefer", `missing=default`);
37089
37089
  if (Array.isArray(values)) {
37090
37090
  const columns = values.reduce((acc, x) => acc.concat(Object.keys(x)), []);
@@ -37321,13 +37321,13 @@ var PostgrestQueryBuilder = class {
37321
37321
  * }
37322
37322
  * ```
37323
37323
  */
37324
- upsert(values, { onConflict, ignoreDuplicates = false, count, defaultToNull = true } = {}) {
37324
+ upsert(values, { onConflict, ignoreDuplicates = false, count: count2, defaultToNull = true } = {}) {
37325
37325
  var _this$fetch2;
37326
37326
  const method = "POST";
37327
37327
  const { url, headers } = this.cloneRequestState();
37328
37328
  headers.append("Prefer", `resolution=${ignoreDuplicates ? "ignore" : "merge"}-duplicates`);
37329
37329
  if (onConflict !== void 0) url.searchParams.set("on_conflict", onConflict);
37330
- if (count) headers.append("Prefer", `count=${count}`);
37330
+ if (count2) headers.append("Prefer", `count=${count2}`);
37331
37331
  if (!defaultToNull) headers.append("Prefer", "missing=default");
37332
37332
  if (Array.isArray(values)) {
37333
37333
  const columns = values.reduce((acc, x) => acc.concat(Object.keys(x)), []);
@@ -37495,11 +37495,11 @@ var PostgrestQueryBuilder = class {
37495
37495
  * }
37496
37496
  * ```
37497
37497
  */
37498
- update(values, { count } = {}) {
37498
+ update(values, { count: count2 } = {}) {
37499
37499
  var _this$fetch3;
37500
37500
  const method = "PATCH";
37501
37501
  const { url, headers } = this.cloneRequestState();
37502
- if (count) headers.append("Prefer", `count=${count}`);
37502
+ if (count2) headers.append("Prefer", `count=${count2}`);
37503
37503
  return new PostgrestFilterBuilder({
37504
37504
  method,
37505
37505
  url,
@@ -37638,11 +37638,11 @@ var PostgrestQueryBuilder = class {
37638
37638
  * }
37639
37639
  * ```
37640
37640
  */
37641
- delete({ count } = {}) {
37641
+ delete({ count: count2 } = {}) {
37642
37642
  var _this$fetch4;
37643
37643
  const method = "DELETE";
37644
37644
  const { url, headers } = this.cloneRequestState();
37645
- if (count) headers.append("Prefer", `count=${count}`);
37645
+ if (count2) headers.append("Prefer", `count=${count2}`);
37646
37646
  return new PostgrestFilterBuilder({
37647
37647
  method,
37648
37648
  url,
@@ -37975,7 +37975,7 @@ var PostgrestClient = class PostgrestClient2 {
37975
37975
  * }
37976
37976
  * ```
37977
37977
  */
37978
- rpc(fn, args = {}, { head: head2 = false, get: get2 = false, count } = {}) {
37978
+ rpc(fn, args = {}, { head: head2 = false, get: get2 = false, count: count2 } = {}) {
37979
37979
  var _this$fetch;
37980
37980
  let method;
37981
37981
  const url = new URL(`${this.url}/rpc/${fn}`);
@@ -37995,8 +37995,8 @@ var PostgrestClient = class PostgrestClient2 {
37995
37995
  body = args;
37996
37996
  }
37997
37997
  const headers = new Headers(this.headers);
37998
- if (_hasObjectArg) headers.set("Prefer", count ? `count=${count},return=minimal` : "return=minimal");
37999
- else if (count) headers.set("Prefer", `count=${count}`);
37998
+ if (_hasObjectArg) headers.set("Prefer", count2 ? `count=${count2},return=minimal` : "return=minimal");
37999
+ else if (count2) headers.set("Prefer", `count=${count2}`);
38000
38000
  return new PostgrestFilterBuilder({
38001
38001
  method,
38002
38002
  url,
@@ -42405,6 +42405,20 @@ var FREE = ["byok_ai"];
42405
42405
  var PRO = [...FREE, "remote_ssh", "cross_device_sync", "alerts"];
42406
42406
  var POWER = [...PRO, "bulk_ops"];
42407
42407
  var TEAM = [...POWER, "workspaces", "rbac", "audit_log"];
42408
+ var PLANS = {
42409
+ free: { machineLimit: 2, jobLimit: 15, capabilities: FREE },
42410
+ pro: { machineLimit: 5, jobLimit: 30, capabilities: PRO },
42411
+ power: { machineLimit: 25, jobLimit: 150, capabilities: POWER },
42412
+ team: { machineLimit: "custom", jobLimit: "custom", capabilities: TEAM }
42413
+ };
42414
+
42415
+ // ../../packages/entitlements/src/can.ts
42416
+ function machineLimit(plan) {
42417
+ return PLANS[plan].machineLimit;
42418
+ }
42419
+ function jobLimit(plan) {
42420
+ return PLANS[plan].jobLimit;
42421
+ }
42408
42422
 
42409
42423
  // ../../packages/bridge/src/pairing.ts
42410
42424
  function formatPairingCode(raw) {
@@ -42453,8 +42467,8 @@ function backoffDelay(attempt, baseMs = 500, capMs = 3e4) {
42453
42467
 
42454
42468
  // ../../packages/bridge/src/jwt.ts
42455
42469
  function b64urlToBytes(s) {
42456
- const pad = s.length % 4 ? "=".repeat(4 - s.length % 4) : "";
42457
- const bin = atob(s.replace(/-/g, "+").replace(/_/g, "/") + pad);
42470
+ const pad2 = s.length % 4 ? "=".repeat(4 - s.length % 4) : "";
42471
+ const bin = atob(s.replace(/-/g, "+").replace(/_/g, "/") + pad2);
42458
42472
  const buf = new ArrayBuffer(bin.length);
42459
42473
  const out = new Uint8Array(buf);
42460
42474
  for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i);
@@ -42629,8 +42643,8 @@ function b64url(bytes) {
42629
42643
  return btoa(bin).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
42630
42644
  }
42631
42645
  function unb64url(s) {
42632
- const pad = s.length % 4 === 0 ? "" : "=".repeat(4 - s.length % 4);
42633
- const bin = atob(s.replace(/-/g, "+").replace(/_/g, "/") + pad);
42646
+ const pad2 = s.length % 4 === 0 ? "" : "=".repeat(4 - s.length % 4);
42647
+ const bin = atob(s.replace(/-/g, "+").replace(/_/g, "/") + pad2);
42634
42648
  const out = new Uint8Array(bin.length);
42635
42649
  for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i);
42636
42650
  return out;
@@ -43330,6 +43344,8 @@ async function applySync(fetchImpl, vaultUrl, apiKey, diff, machineNameToId) {
43330
43344
  }
43331
43345
 
43332
43346
  // src/commands/gitops-cmd.ts
43347
+ var MORE_HINT = "Need more? Email hello@norc.app";
43348
+ var isJobLimit = (m) => /job limit/i.test(m ?? "");
43333
43349
  async function cmdGitops(args, deps, log = console.log) {
43334
43350
  const [sub, ...rest] = args;
43335
43351
  if (sub !== "plan" && sub !== "apply") {
@@ -43366,7 +43382,7 @@ async function cmdGitops(args, deps, log = console.log) {
43366
43382
  }
43367
43383
  const machineNameCounts = /* @__PURE__ */ new Map();
43368
43384
  for (const m of liveResult.machines) machineNameCounts.set(m.name, (machineNameCounts.get(m.name) ?? 0) + 1);
43369
- const dupMachines = [...machineNameCounts.entries()].filter(([, count]) => count > 1).map(([name]) => name);
43385
+ const dupMachines = [...machineNameCounts.entries()].filter(([, count2]) => count2 > 1).map(([name]) => name);
43370
43386
  if (dupMachines.length > 0) {
43371
43387
  for (const name of dupMachines) log(`error: duplicate machine name "${name}" \u2014 norc gitops requires unique machine names per account`);
43372
43388
  return 2;
@@ -43378,7 +43394,7 @@ async function cmdGitops(args, deps, log = console.log) {
43378
43394
  jobKeyCounts.set(key, [j.machineName, j.jobName]);
43379
43395
  jobKeyDupCount.set(key, (jobKeyDupCount.get(key) ?? 0) + 1);
43380
43396
  }
43381
- const dupJobs = [...jobKeyDupCount.entries()].filter(([, count]) => count > 1).map(([key]) => jobKeyCounts.get(key));
43397
+ const dupJobs = [...jobKeyDupCount.entries()].filter(([, count2]) => count2 > 1).map(([key]) => jobKeyCounts.get(key));
43382
43398
  if (dupJobs.length > 0) {
43383
43399
  for (const [machineName, jobName] of dupJobs) log(`error: duplicate job "${machineName}/${jobName}" \u2014 norc gitops requires unique job names per machine`);
43384
43400
  return 2;
@@ -43398,11 +43414,13 @@ async function cmdGitops(args, deps, log = console.log) {
43398
43414
  const applyResult = await applySync(deps.fetchImpl, deps.vaultUrl, deps.apiKey, diff, machineNameToId);
43399
43415
  if (!applyResult.ok) {
43400
43416
  log(`error: ${applyResult.message}`);
43417
+ if (isJobLimit(applyResult.message)) log(MORE_HINT);
43401
43418
  return 2;
43402
43419
  }
43403
43420
  for (const r of applyResult.results) {
43404
43421
  log(r.ok ? `${r.op} ${r.key}: ok` : `${r.op} ${r.key}: FAILED \u2014 ${r.error}`);
43405
43422
  }
43423
+ if (applyResult.results.some((r) => !r.ok && isJobLimit(r.error))) log(MORE_HINT);
43406
43424
  return applyResult.results.some((r) => !r.ok) ? 1 : 0;
43407
43425
  }
43408
43426
 
@@ -43427,7 +43445,7 @@ var import_node_os3 = require("node:os");
43427
43445
  var import_node_path2 = require("node:path");
43428
43446
 
43429
43447
  // src/version.ts
43430
- var VERSION2 = "0.2.1";
43448
+ var VERSION2 = "0.3.0";
43431
43449
 
43432
43450
  // src/host-details.ts
43433
43451
  var ARCH = { x64: "x86_64", arm64: "arm64", ia32: "x86", arm: "arm" };
@@ -43791,6 +43809,529 @@ async function cmdRun(args) {
43791
43809
  );
43792
43810
  }
43793
43811
 
43812
+ // ../../packages/usage/src/parse.ts
43813
+ var UsageParseError = class extends Error {
43814
+ constructor(path, what) {
43815
+ super(`invalid usage payload at ${path}: ${what}`);
43816
+ this.name = "UsageParseError";
43817
+ }
43818
+ };
43819
+ var PLANS2 = ["free", "pro", "power", "team"];
43820
+ var obj = (v, p) => {
43821
+ if (typeof v !== "object" || v === null || Array.isArray(v)) throw new UsageParseError(p, "expected object");
43822
+ return v;
43823
+ };
43824
+ var arr = (v, p) => {
43825
+ if (!Array.isArray(v)) throw new UsageParseError(p, "expected array");
43826
+ return v;
43827
+ };
43828
+ var num = (v, p) => {
43829
+ const n = typeof v === "string" && v.trim() !== "" ? Number(v) : v;
43830
+ if (typeof n !== "number" || !Number.isFinite(n)) throw new UsageParseError(p, "expected number");
43831
+ return n;
43832
+ };
43833
+ var count = (v, p) => {
43834
+ const n = num(v, p);
43835
+ if (!Number.isInteger(n) || n < 0) throw new UsageParseError(p, "expected non-negative integer");
43836
+ return n;
43837
+ };
43838
+ var str = (v, p) => {
43839
+ if (typeof v !== "string") throw new UsageParseError(p, "expected string");
43840
+ return v;
43841
+ };
43842
+ var counts = (v, p) => {
43843
+ const o = obj(v, p);
43844
+ return { ok: count(o.ok, `${p}.ok`), failed: count(o.failed, `${p}.failed`), missed: count(o.missed, `${p}.missed`) };
43845
+ };
43846
+ function parseUsageSummary(raw) {
43847
+ const o = obj(raw, "$");
43848
+ const days = count(o.days, "days");
43849
+ if (days !== 7 && days !== 30) throw new UsageParseError("days", "expected 7 or 30");
43850
+ const plan = str(o.plan, "plan");
43851
+ if (!PLANS2.includes(plan)) throw new UsageParseError("plan", `unknown plan "${plan}"`);
43852
+ const daily = arr(o.daily, "daily").map((d, i) => {
43853
+ const e = obj(d, `daily[${i}]`);
43854
+ const date = str(e.date, `daily[${i}].date`);
43855
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(date)) throw new UsageParseError(`daily[${i}].date`, "expected YYYY-MM-DD");
43856
+ return { date, ...counts(e, `daily[${i}]`) };
43857
+ });
43858
+ if (daily.length !== days) throw new UsageParseError("daily", `expected ${days} entries, got ${daily.length}`);
43859
+ const heatmap = arr(o.heatmap, "heatmap").map((r, i) => arr(r, `heatmap[${i}]`).map((c, h) => count(c, `heatmap[${i}][${h}]`)));
43860
+ if (heatmap.length !== 7 || heatmap.some((r) => r.length !== 24)) throw new UsageParseError("heatmap", "expected 7 rows of 24");
43861
+ const med = o.medianDurationSeconds;
43862
+ const lp = o.lastProblem;
43863
+ let lastProblem = null;
43864
+ if (lp != null) {
43865
+ const e = obj(lp, "lastProblem");
43866
+ const status = str(e.status, "lastProblem.status");
43867
+ if (status !== "failed" && status !== "missed") throw new UsageParseError("lastProblem.status", "expected failed|missed");
43868
+ lastProblem = { at: str(e.at, "lastProblem.at"), jobId: str(e.jobId, "lastProblem.jobId"), jobName: str(e.jobName, "lastProblem.jobName"), status };
43869
+ }
43870
+ return {
43871
+ generatedAt: str(o.generatedAt, "generatedAt"),
43872
+ days,
43873
+ plan,
43874
+ usedJobs: count(o.usedJobs, "usedJobs"),
43875
+ usedMachines: count(o.usedMachines, "usedMachines"),
43876
+ totals: counts(o.totals, "totals"),
43877
+ medianDurationSeconds: med == null ? null : num(med, "medianDurationSeconds"),
43878
+ daily,
43879
+ heatmap,
43880
+ topFailingJobs: arr(o.topFailingJobs, "topFailingJobs").map((j, i) => {
43881
+ const e = obj(j, `topFailingJobs[${i}]`);
43882
+ const p = `topFailingJobs[${i}]`;
43883
+ return {
43884
+ jobId: str(e.jobId, `${p}.jobId`),
43885
+ jobName: str(e.jobName, `${p}.jobName`),
43886
+ machineId: str(e.machineId, `${p}.machineId`),
43887
+ machineName: str(e.machineName, `${p}.machineName`),
43888
+ failed: count(e.failed, `${p}.failed`),
43889
+ missed: count(e.missed, `${p}.missed`)
43890
+ };
43891
+ }),
43892
+ machines: arr(o.machines, "machines").map((m, i) => {
43893
+ const e = obj(m, `machines[${i}]`);
43894
+ const p = `machines[${i}]`;
43895
+ const md = arr(e.daily, `${p}.daily`).map((d, k) => counts(d, `${p}.daily[${k}]`));
43896
+ if (md.length !== days) throw new UsageParseError(`${p}.daily`, `expected ${days} entries`);
43897
+ return {
43898
+ id: str(e.id, `${p}.id`),
43899
+ name: str(e.name, `${p}.name`),
43900
+ env: e.env == null ? null : str(e.env, `${p}.env`),
43901
+ ...counts(e, p),
43902
+ daily: md
43903
+ };
43904
+ }),
43905
+ lastProblem,
43906
+ cleanDays: count(o.cleanDays, "cleanDays")
43907
+ };
43908
+ }
43909
+
43910
+ // ../../packages/usage/src/fetch.ts
43911
+ async function fetchUsageDevice(opts) {
43912
+ const f = opts.fetchImpl ?? fetch;
43913
+ const res = await f(`${opts.functionsUrl.replace(/\/$/, "")}/device-usage`, {
43914
+ method: "POST",
43915
+ headers: { Authorization: `Bearer ${opts.deviceJwt}`, "Content-Type": "application/json" },
43916
+ body: JSON.stringify({ days: opts.days ?? 30 })
43917
+ });
43918
+ if (!res.ok) throw new Error(`device-usage failed: HTTP ${res.status}`);
43919
+ return parseUsageSummary(await res.json());
43920
+ }
43921
+
43922
+ // ../../packages/status/src/health.ts
43923
+ var HEARTBEAT_STALE_MS = 10 * 60 * 1e3;
43924
+ function relativeTimeAgo(iso, now = /* @__PURE__ */ new Date()) {
43925
+ if (!iso) return "never";
43926
+ const ms = now.getTime() - new Date(iso).getTime();
43927
+ if (ms < 0) return "just now";
43928
+ const s = Math.floor(ms / 1e3);
43929
+ if (s < 60) return "just now";
43930
+ const m = Math.floor(s / 60);
43931
+ if (m < 60) return `${m}m ago`;
43932
+ const h = Math.floor(m / 60);
43933
+ if (h < 24) return `${h}h ago`;
43934
+ const d = Math.floor(h / 24);
43935
+ return `${d}d ago`;
43936
+ }
43937
+
43938
+ // ../../packages/status/src/display.ts
43939
+ var MACHINE_STATUS_DISPLAY = {
43940
+ online: { tone: "success", label: "Online", glyph: "\u25CF" },
43941
+ warning: { tone: "warning", label: "Warning", glyph: "\u25B2" },
43942
+ offline: { tone: "failed", label: "Offline", glyph: "\u2715" },
43943
+ unknown: { tone: "disabled", label: "Unknown", glyph: "?" }
43944
+ };
43945
+ var UPDATE_REQUIRED_DISPLAY = { ...MACHINE_STATUS_DISPLAY.offline, label: "Update required" };
43946
+
43947
+ // ../../packages/usage/src/view.ts
43948
+ var PLAN_NAMES = { free: "Free", pro: "Pro", power: "Power", team: "Team" };
43949
+ function headroomTone(used, cap) {
43950
+ const p = used / cap;
43951
+ return p >= 0.9 ? "failed" : p >= 0.7 ? "warning" : "calm";
43952
+ }
43953
+ function headroom(kind, used, plan) {
43954
+ const c = kind === "jobs" ? jobLimit(plan) : machineLimit(plan);
43955
+ if (c === "custom") {
43956
+ return { used, cap: null, left: null, tone: "calm", pct: 0, text: kind === "jobs" ? "Unlimited" : "Custom limit", showChip: false };
43957
+ }
43958
+ const tone = headroomTone(used, c);
43959
+ const left = c - used;
43960
+ return { used, cap: c, left, tone, pct: Math.min(100, used / c * 100), text: left <= 0 ? "At limit" : `${left} left`, showChip: tone !== "calm" };
43961
+ }
43962
+ function headroomFooter(usedJobs, usedMachines, plan) {
43963
+ const n = PLAN_NAMES[plan];
43964
+ const jobs = headroom("jobs", usedJobs, plan);
43965
+ const mach = headroom("machines", usedMachines, plan);
43966
+ const messages = [];
43967
+ if (jobs.tone !== "calm" && jobs.left != null) {
43968
+ messages.push(jobs.left <= 0 ? `Job limit reached on ${n}.` : `${jobs.left} job${jobs.left === 1 ? "" : "s"} left on ${n}.`);
43969
+ }
43970
+ if (mach.tone !== "calm" && mach.left != null) {
43971
+ messages.push(mach.left <= 0 ? `Machine limit reached on ${n}.` : `${mach.left} machine${mach.left === 1 ? "" : "s"} left on ${n}.`);
43972
+ }
43973
+ return messages.length ? { messages, note: "Plans scale jobs and machines together.", showUpgrade: plan !== "power" && plan !== "team" } : { messages, note: `Plenty of room on ${n}. You'll see a note here when you pass 70%.`, showUpgrade: false };
43974
+ }
43975
+ var formatCount = (n) => Math.round(n).toLocaleString("en-US");
43976
+ var formatPercent = (v) => `${v.toFixed(1)}%`;
43977
+ var formatSeconds = (v) => `${v.toFixed(1)}s`;
43978
+ var DOW = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
43979
+ var MON = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
43980
+ var pad = (n) => String(n).padStart(2, "0");
43981
+ function dayLabel(date) {
43982
+ const d = /* @__PURE__ */ new Date(`${date}T00:00:00Z`);
43983
+ return `${DOW[d.getUTCDay()]} ${d.getUTCDate()} ${MON[d.getUTCMonth()]}`;
43984
+ }
43985
+ var totalRuns = (c) => c.ok + c.failed + c.missed;
43986
+ function successRate(c) {
43987
+ const t = totalRuns(c);
43988
+ return t ? c.ok / t * 100 : 100;
43989
+ }
43990
+ var dailyRates = (daily) => daily.map(successRate);
43991
+ function lowestDay(daily) {
43992
+ const rates = dailyRates(daily);
43993
+ if (!rates.length) return null;
43994
+ const rate = Math.min(...rates);
43995
+ const index = rates.indexOf(rate);
43996
+ return { rate, index, date: daily[index]?.date ?? null };
43997
+ }
43998
+ function rateCaption(daily) {
43999
+ const low = lowestDay(daily);
44000
+ if (!low || !low.date) return "";
44001
+ const now = successRate(daily[daily.length - 1]);
44002
+ return `Low ${formatPercent(low.rate)} on ${dayLabel(low.date)} \xB7 now ${formatPercent(now)}`;
44003
+ }
44004
+ function streakChip(s, now = /* @__PURE__ */ new Date()) {
44005
+ if (s.cleanDays >= 3) return { kind: "streak", text: `${s.cleanDays} clean days` };
44006
+ if (s.lastProblem) return { kind: "problem", text: `Last problem ${relativeTimeAgo(s.lastProblem.at, now)}: ${s.lastProblem.jobName}` };
44007
+ return { kind: "none" };
44008
+ }
44009
+ var medianText = (s) => s == null ? "\u2014" : formatSeconds(s);
44010
+ var isUsageEmpty = (s) => totalRuns(s.totals) === 0;
44011
+ var sparklineFloor = (vals) => Math.floor(Math.min(...vals)) - 1;
44012
+ function runsSummarySentence(daily, days = daily.length) {
44013
+ const t = daily.reduce((a, d) => ({ ok: a.ok + d.ok, failed: a.failed + d.failed, missed: a.missed + d.missed }), { ok: 0, failed: 0, missed: 0 });
44014
+ const tot = totalRuns(t);
44015
+ if (!daily.length || tot === 0) return `No runs in ${days} days.`;
44016
+ const busy = daily.reduce((a, d) => totalRuns(d) > totalRuns(a) ? d : a);
44017
+ const worst = daily.reduce((a, d) => d.failed + d.missed > a.failed + a.missed ? d : a);
44018
+ const wn = worst.failed + worst.missed;
44019
+ return `${formatCount(tot)} runs in ${days} days: ${formatCount(t.ok)} ok, ${t.failed} failed, ${t.missed} missed. Busiest ${dayLabel(busy.date)} (${totalRuns(busy)}).${wn ? ` Most problems ${dayLabel(worst.date)} (${wn}).` : " No failed or missed runs."}`;
44020
+ }
44021
+ function heatLevel(v, max) {
44022
+ if (v <= 0 || max <= 0) return 0;
44023
+ const r = v / max;
44024
+ return r <= 0.25 ? 1 : r <= 0.5 ? 2 : r <= 0.75 ? 3 : 4;
44025
+ }
44026
+ var HEAT_DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
44027
+ var heatHourLabel = (h) => `${pad(h)}:00`;
44028
+ var heatCellLabel = (row, hour) => `${HEAT_DAYS[row]} ${heatHourLabel(hour)}`;
44029
+ function heatCells(heatmap) {
44030
+ const flat = [];
44031
+ heatmap.forEach((r, row) => r.forEach((value, hour) => flat.push({ row, hour, value })));
44032
+ let max = 0;
44033
+ let best = 0;
44034
+ flat.forEach((c, i) => {
44035
+ if (c.value > max) {
44036
+ max = c.value;
44037
+ best = i;
44038
+ }
44039
+ });
44040
+ return { cells: flat.map((c) => ({ ...c, level: heatLevel(c.value, max), label: heatCellLabel(c.row, c.hour) })), max, best };
44041
+ }
44042
+ function quietestHour(heatmap) {
44043
+ let hour = 0;
44044
+ let runs = Infinity;
44045
+ for (let h = 0; h < 24; h++) {
44046
+ const t = heatmap.reduce((a, r) => a + (r[h] ?? 0), 0);
44047
+ if (t < runs) {
44048
+ runs = t;
44049
+ hour = h;
44050
+ }
44051
+ }
44052
+ return { hour, runs: runs === Infinity ? 0 : runs };
44053
+ }
44054
+ function heatSummary(heatmap) {
44055
+ const { cells, max, best } = heatCells(heatmap);
44056
+ if (max === 0) return "No runs yet.";
44057
+ const b = cells[best];
44058
+ const q = quietestHour(heatmap);
44059
+ return `Busiest hour: ${b.label} with ${b.value} runs. Quietest hour: ${heatHourLabel(q.hour)} (${q.runs} runs).`;
44060
+ }
44061
+ function topFailingRows(jobs) {
44062
+ const sorted = jobs.map((j) => ({ ...j, total: j.failed + j.missed })).filter((j) => j.total > 0).sort((a, b) => b.total - a.total);
44063
+ const max = sorted[0]?.total ?? 1;
44064
+ return sorted.map((j, i) => ({
44065
+ ...j,
44066
+ rank: i + 1,
44067
+ pct: j.total / max * 100,
44068
+ counts: [j.failed ? `${j.failed} failed` : "", j.missed ? `${j.missed} missed` : ""].filter(Boolean).join(" \xB7 ")
44069
+ }));
44070
+ }
44071
+ function machineRows(machines) {
44072
+ return machines.map((m) => {
44073
+ const rates = dailyRates(m.daily);
44074
+ const rate = successRate(m);
44075
+ const low = rates.length ? Math.min(...rates) : 100;
44076
+ return {
44077
+ id: m.id,
44078
+ name: m.name,
44079
+ env: m.env,
44080
+ rate,
44081
+ rateText: formatPercent(rate),
44082
+ rates,
44083
+ counts: `${m.failed} failed \xB7 ${m.missed} missed`,
44084
+ ariaLabel: `${m.name} daily success rate over ${m.daily.length} days, low ${formatPercent(low)}, now ${formatPercent(rates[rates.length - 1] ?? 100)}`
44085
+ };
44086
+ });
44087
+ }
44088
+
44089
+ // src/commands/usage-render.ts
44090
+ var ANSI = /\x1b\[[0-9;]*m/g;
44091
+ var vlen = (s) => s.replace(ANSI, "").length;
44092
+ var cleanLabel = (s) => s.replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)?/g, "").replace(/\x1b\[[0-?]*[ -/]*[@-~]/g, "").replace(/[\x00-\x1f\x7f-\x9f]/g, "");
44093
+ var padR = (s, w) => s + " ".repeat(Math.max(0, w - vlen(s)));
44094
+ var padL = (s, w) => " ".repeat(Math.max(0, w - vlen(s))) + s;
44095
+ var trunc = (s, w, u) => s.length <= w ? s : s.slice(0, Math.max(0, w - 1)) + (u ? "\u2026" : "~");
44096
+ function wrap(text, w) {
44097
+ const out = [];
44098
+ let line = "";
44099
+ for (const word of text.split(" ")) {
44100
+ if (line && line.length + 1 + word.length > w) {
44101
+ out.push(line);
44102
+ line = word;
44103
+ } else line = line ? `${line} ${word}` : word;
44104
+ }
44105
+ if (line) out.push(line);
44106
+ return out;
44107
+ }
44108
+ var GLYPH = {
44109
+ u: { full: "\u2588", empty: "\u2591", cap: "\u2502", ok: "\u2588", failed: "\u2592", missed: "\u2591", heat: ["\xB7", "\u2591", "\u2592", "\u2593", "\u2588"], spark: "\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588", rule: "\u2500", dot: "\xB7" },
44110
+ a: { full: "#", empty: "-", cap: "|", ok: "#", failed: "=", missed: ".", heat: [" ", ".", ":", "+", "#"], spark: "._-~=+*#", rule: "-", dot: "." }
44111
+ };
44112
+ var BIG = {
44113
+ "0": ["\u250C\u2500\u2510", "\u2502 \u2502", "\u2514\u2500\u2518"],
44114
+ "1": [" \u2577 ", " \u2502 ", " \u2575 "],
44115
+ "2": ["\u2576\u2500\u2510", "\u250C\u2500\u2518", "\u2514\u2500\u2574"],
44116
+ "3": ["\u2576\u2500\u2510", " \u2500\u2524", "\u2576\u2500\u2518"],
44117
+ "4": ["\u2577 \u2577", "\u2514\u2500\u2524", " \u2575"],
44118
+ "5": ["\u250C\u2500\u2574", "\u2514\u2500\u2510", "\u2576\u2500\u2518"],
44119
+ "6": ["\u250C\u2500\u2574", "\u251C\u2500\u2510", "\u2514\u2500\u2518"],
44120
+ "7": ["\u2576\u2500\u2510", " \u2502", " \u2575"],
44121
+ "8": ["\u250C\u2500\u2510", "\u251C\u2500\u2524", "\u2514\u2500\u2518"],
44122
+ "9": ["\u250C\u2500\u2510", "\u2514\u2500\u2524", "\u2576\u2500\u2518"],
44123
+ ".": [" ", " ", "\u25AA "],
44124
+ "%": ["o \u2571", " \u2571 ", "\u2571 o"]
44125
+ };
44126
+ var ASCII_MAP = { "\u250C": "+", "\u2510": "+", "\u2514": "+", "\u2518": "+", "\u251C": "+", "\u2524": "+", "\u2500": "-", "\u2502": "|", "\u2577": ".", "\u2575": "'", "\u2576": "-", "\u2574": "-", "\u25AA": ".", "\u2571": "/" };
44127
+ function renderUsage(s, opts) {
44128
+ const W = Math.max(80, Math.min(120, Math.floor(opts.width)));
44129
+ const g = opts.unicode ? GLYPH.u : GLYPH.a;
44130
+ const now = opts.now ?? new Date(s.generatedAt);
44131
+ const sgr = (code) => (t) => opts.color ? `\x1B[${code}m${t}\x1B[0m` : t;
44132
+ const bold = sgr("1"), dim = sgr("2"), green = sgr("32"), amber = sgr("33"), red = sgr("31"), cyan = sgr("36");
44133
+ const toneColor = { calm: green, warning: amber, failed: red };
44134
+ const wide = W >= 100;
44135
+ const colW = wide ? Math.floor((W - 3) / 2) : W;
44136
+ const empty = isUsageEmpty(s);
44137
+ const title = (t, w) => `${bold(t)} ${dim(g.rule.repeat(Math.max(2, w - t.length - 1)))}`;
44138
+ const spark = (rates, lo = sparklineFloor(rates)) => rates.map((v) => g.spark[Math.max(0, Math.min(7, Math.round((v - lo) / (100 - lo || 1) * 7)))]).join("");
44139
+ const headroomPanel = () => {
44140
+ const barW = Math.max(10, Math.min(24, colW - 42));
44141
+ const row = (label, h) => {
44142
+ if (h.cap == null) return `${padR(label, 9)} ${padR(`${h.used}`, barW + 1)} ${padR(`${h.used} used`, 9)} ${dim(h.text)}`;
44143
+ const fill = Math.min(barW, Math.round(h.pct / 100 * barW));
44144
+ const c = toneColor[h.tone];
44145
+ const bar = c(g.full.repeat(fill)) + dim(g.empty.repeat(barW - fill)) + dim(g.cap);
44146
+ return `${padR(label, 9)} ${bar} ${padL(`${h.used} / ${h.cap}`, 7)} ${padR(h.text, 8)} ${c(h.tone === "calm" ? "calm" : h.tone === "warning" ? "warning" : (h.left ?? 0) <= 0 ? "" : "near limit")}`;
44147
+ };
44148
+ const f = headroomFooter(s.usedJobs, s.usedMachines, s.plan);
44149
+ const lines = [
44150
+ title(`Headroom \xB7 ${PLAN_NAMES[s.plan]} plan`, colW),
44151
+ row("Jobs", headroom("jobs", s.usedJobs, s.plan)),
44152
+ row("Machines", headroom("machines", s.usedMachines, s.plan)),
44153
+ ""
44154
+ ];
44155
+ for (const m of f.messages) lines.push(amber(m));
44156
+ lines.push(...wrap(f.note, colW).map(dim));
44157
+ if (f.showUpgrade) lines.push(`Upgrade: ${cyan(`${opts.vaultUrl ?? "https://vault.norc.app"}/settings/billing`)}`);
44158
+ if (f.messages.length) lines.push("Need more? Email hello@norc.app");
44159
+ return lines;
44160
+ };
44161
+ const healthPanel = () => {
44162
+ const rate = successRate(s.totals);
44163
+ const big = formatPercent(rate).split("").map((ch) => (BIG[ch] ?? [" ", " ", " "]).map((r) => opts.unicode ? r : [...r].map((c) => ASCII_MAP[c] ?? c).join("")));
44164
+ const rows = [0, 1, 2].map((i) => big.map((b) => b[i]).join(" "));
44165
+ const rc = rate >= 99 ? green : rate >= 95 ? amber : red;
44166
+ const chip = streakChip(s, now);
44167
+ const out2 = [title(`Health \xB7 ${s.days} days`, colW)];
44168
+ rows.forEach((r, i) => out2.push(`${rc(padR(r, 20))} ${i === 1 ? dim("success rate") : ""}`));
44169
+ out2.push("");
44170
+ out2.push(`${cyan(spark(dailyRates(s.daily)))} ${dim("daily success")}`);
44171
+ const cap = rateCaption(s.daily);
44172
+ if (cap) out2.push(dim(cap));
44173
+ if (chip.kind !== "none") out2.push((chip.kind === "streak" ? green : amber)(trunc(cleanLabel(chip.text), colW, opts.unicode)));
44174
+ out2.push(`${formatCount(totalRuns(s.totals))} runs \xB7 ${red(`${s.totals.failed} failed`)} \xB7 ${amber(`${s.totals.missed} missed`)} \xB7 median ${medianText(s.medianDurationSeconds)}`);
44175
+ return out2;
44176
+ };
44177
+ const runsPanel = () => {
44178
+ const H = 8;
44179
+ const days = s.daily;
44180
+ const plotW = W - 6;
44181
+ const colWd = Math.max(1, Math.min(6, Math.floor(plotW / days.length)));
44182
+ const barW = colWd >= 3 ? colWd - 1 : 1;
44183
+ const max = Math.max(1, ...days.map(totalRuns));
44184
+ const segs = days.map((d) => {
44185
+ const t = totalRuns(d);
44186
+ const h = t ? Math.max(1, Math.round(t / max * H)) : 0;
44187
+ const f = d.failed ? 1 : 0, m = d.missed ? 1 : 0;
44188
+ const f2 = d.failed ? Math.max(f, Math.round(d.failed / t * h)) : 0;
44189
+ const m2 = d.missed ? Math.max(m, Math.round(d.missed / t * h)) : 0;
44190
+ return { ok: Math.max(0, h - f2 - m2), failed: f2, missed: m2 };
44191
+ });
44192
+ const cell = (sg, r) => {
44193
+ const fromBottom = H - 1 - r;
44194
+ if (fromBottom < sg.ok) return green(g.ok.repeat(barW));
44195
+ if (fromBottom < sg.ok + sg.failed) return red(g.failed.repeat(barW));
44196
+ if (fromBottom < sg.ok + sg.failed + sg.missed) return amber(g.missed.repeat(barW));
44197
+ return " ".repeat(barW);
44198
+ };
44199
+ const lines = [title(`Runs per day \xB7 ${s.days} days`, W)];
44200
+ for (let r = 0; r < H; r++) {
44201
+ const label = r === 0 ? String(max) : r === H - 1 ? "0" : "";
44202
+ const body = segs.map((sg) => cell(sg, r) + " ".repeat(colWd - barW)).join("");
44203
+ lines.push(`${dim(padL(label, 4))} ${dim(g.cap)}${body}`);
44204
+ }
44205
+ const axis = Array.from({ length: days.length * colWd }, () => " ");
44206
+ const step = Math.ceil(6 / colWd);
44207
+ for (let i = 0; i < days.length; i += step) {
44208
+ const lab = days[i].date.slice(5);
44209
+ if (i * colWd + lab.length > axis.length) break;
44210
+ lab.split("").forEach((c, k) => {
44211
+ axis[i * colWd + k] = c;
44212
+ });
44213
+ }
44214
+ lines.push(`${" ".repeat(5)}${dim(opts.unicode ? "\u2514" : "+")}${dim(axis.join(""))}`);
44215
+ lines.push(` ${green(g.ok)} ok ${red(g.failed)} failed ${amber(g.missed)} missed`);
44216
+ lines.push(...wrap(runsSummarySentence(s.daily, s.days), W).map(dim));
44217
+ return lines;
44218
+ };
44219
+ const heatPanel = () => {
44220
+ const { cells } = heatCells(s.heatmap);
44221
+ const names = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
44222
+ const lines = [title("Activity \xB7 hour of day (UTC)", colW)];
44223
+ const ramp = [dim, cyan, cyan, cyan, bold];
44224
+ const cw = colW >= 54 ? 2 : 1;
44225
+ for (let r = 0; r < 7; r++) {
44226
+ const row = cells.slice(r * 24, r * 24 + 24).map((c) => ramp[c.level](g.heat[c.level].repeat(cw))).join("");
44227
+ lines.push(`${dim(names[r])} ${row}`);
44228
+ }
44229
+ const hours = Array.from({ length: 24 * cw + 2 }, () => " ");
44230
+ for (let h = 0; h < 24; h += cw === 2 ? 3 : 4) String(h).padStart(2, "0").split("").forEach((c, k) => {
44231
+ hours[h * cw + k] = c;
44232
+ });
44233
+ lines.push(` ${dim(hours.join(""))}`);
44234
+ lines.push(...wrap(empty ? "No runs yet." : heatSummary(s.heatmap), colW).map(dim));
44235
+ lines.push(dim(`less ${g.heat.join(" ")} more`));
44236
+ return lines;
44237
+ };
44238
+ const topPanel = () => {
44239
+ const rows = topFailingRows(s.topFailingJobs);
44240
+ const lines = [title("Top failing jobs", colW)];
44241
+ if (!rows.length) return [...lines, green("No failing jobs. Nice.")];
44242
+ const cw = Math.max(...rows.map((r) => r.counts.length));
44243
+ const nameW = Math.max(10, colW - 3 - 9 - cw - 2);
44244
+ for (const r of rows.slice(0, 6)) {
44245
+ const fill = Math.max(1, Math.round(r.pct / 100 * 8));
44246
+ const mn = trunc(cleanLabel(r.machineName), Math.max(4, Math.floor(nameW / 2)), opts.unicode);
44247
+ const label = trunc(cleanLabel(r.jobName), nameW - mn.length - 3, opts.unicode);
44248
+ lines.push(`${padL(String(r.rank), 2)} ${padR(`${label} ${dim(`(${mn})`)}`, nameW)} ${red(g.full.repeat(fill))}${dim(g.empty.repeat(8 - fill))} ${r.counts}`);
44249
+ }
44250
+ return lines;
44251
+ };
44252
+ const machinePanel = () => {
44253
+ const lines = [title("Machines", W)];
44254
+ const rows = machineRows(s.machines);
44255
+ if (!rows.length) return [...lines, dim("No machines yet. Run `norc pair` to add this one.")];
44256
+ for (const m of rows) {
44257
+ const nm = trunc(cleanLabel(m.env ? `${m.name} ${m.env}` : m.name), 18, opts.unicode);
44258
+ lines.push(`${padR(nm, 18)} ${cyan(spark(m.rates))} ${padL(m.rateText, 6)} ${dim(m.counts)}`);
44259
+ }
44260
+ return lines;
44261
+ };
44262
+ const ghostRuns = () => {
44263
+ const lines = [title(`Runs per day \xB7 ${s.days} days`, W)];
44264
+ const pat = [2, 4, 3, 6, 5, 7, 4, 6, 3, 5];
44265
+ for (let r = 0; r < 4; r++) lines.push(` ${dim(g.cap)}${dim(Array.from({ length: s.days }, (_, i) => (pat[i % pat.length] > 3 - r + 3 ? g.empty : " ").repeat(2)).join(""))}`);
44266
+ return lines;
44267
+ };
44268
+ const side = (l, r) => {
44269
+ const n = Math.max(l.length, r.length);
44270
+ return Array.from({ length: n }, (_, i) => `${padR(l[i] ?? "", colW)} ${r[i] ?? ""}`.trimEnd());
44271
+ };
44272
+ const pair = (l, r) => wide ? side(l, r) : [...l, "", ...r];
44273
+ const head2 = `${bold("norc usage")} ${dim(`${g.dot} last ${s.days} days ${g.dot} ${PLAN_NAMES[s.plan]} plan ${g.dot} ${s.generatedAt.slice(0, 16).replace("T", " ")}Z`)}`;
44274
+ const out = [head2, dim(g.rule.repeat(W)), ""];
44275
+ if (empty) {
44276
+ out.push(...headroomPanel(), "", ...ghostRuns(), "", ...heatPanel(), "", ...machinePanel(), "", bold("Your first run will show up here."));
44277
+ } else {
44278
+ out.push(...pair(headroomPanel(), healthPanel()), "", ...runsPanel(), "", ...pair(heatPanel(), topPanel()), "", ...machinePanel());
44279
+ }
44280
+ const text = out.map((l) => l.trimEnd()).join("\n") + "\n";
44281
+ return opts.unicode ? text : text.replace(/·/g, ".").replace(/—/g, "-").replace(/…/g, "~");
44282
+ }
44283
+
44284
+ // src/commands/usage.ts
44285
+ var USAGE = "usage: norc usage [--days 7|30] [--json] [--no-color] [--plain]";
44286
+ function utf8Locale(env, platform) {
44287
+ const loc = env.LC_ALL || env.LC_CTYPE || env.LANG || "";
44288
+ return /utf-?8/i.test(loc) || platform === "win32" && Boolean(env.WT_SESSION);
44289
+ }
44290
+ async function cmdUsage(args, deps, log = console.log, err = console.error) {
44291
+ const known = /* @__PURE__ */ new Set(["--days", "--json", "--no-color", "--plain"]);
44292
+ let days = 30;
44293
+ for (let i = 0; i < args.length; i++) {
44294
+ const a = args[i];
44295
+ if (a === "--days") {
44296
+ const v = Number(args[++i]);
44297
+ if (v !== 7 && v !== 30) {
44298
+ err(`error: --days must be 7 or 30
44299
+ ${USAGE}`);
44300
+ return 2;
44301
+ }
44302
+ days = v;
44303
+ } else if (!known.has(a)) {
44304
+ err(`error: unknown option ${a}
44305
+ ${USAGE}`);
44306
+ return 2;
44307
+ }
44308
+ }
44309
+ const jwt = await deps.getJwt();
44310
+ if (!jwt) {
44311
+ err("error: this machine is not paired. Run `norc login`, then `norc pair`.");
44312
+ return 1;
44313
+ }
44314
+ let summary;
44315
+ try {
44316
+ summary = await fetchUsageDevice({ functionsUrl: deps.functionsUrl, deviceJwt: jwt, days, fetchImpl: deps.fetchImpl });
44317
+ } catch (e) {
44318
+ const m = e instanceof Error ? e.message : String(e);
44319
+ if (/HTTP 404/.test(m)) err("error: the usage service is not available yet (device-usage is not deployed on this backend).");
44320
+ else if (/HTTP 401|HTTP 403/.test(m)) err("error: this machine is not authorised. Run `norc login`, then `norc pair`.");
44321
+ else if (/HTTP \d+/.test(m)) err(`error: ${m}`);
44322
+ else err(`error: could not reach norc (${m}). Check your connection and try again.`);
44323
+ return 1;
44324
+ }
44325
+ if (args.includes("--json")) {
44326
+ log(JSON.stringify(parseUsageSummary(summary), null, 2));
44327
+ return 0;
44328
+ }
44329
+ const color = deps.isTTY && !args.includes("--no-color") && !deps.env.NO_COLOR;
44330
+ const unicode = !args.includes("--plain") && utf8Locale(deps.env, deps.platform);
44331
+ log(renderUsage(summary, { width: deps.columns, color, unicode, vaultUrl: deps.vaultUrl }).trimEnd());
44332
+ return 0;
44333
+ }
44334
+
43794
44335
  // src/commands/bridge.ts
43795
44336
  var import_node_child_process5 = require("node:child_process");
43796
44337
 
@@ -44349,6 +44890,8 @@ Usage:
44349
44890
  norc gitops apply --file <path> apply the diff (create/update/delete to match the file)
44350
44891
  norc run --job-id <id> -- <cmd> exec <cmd> and report its result (used internally by wrapped crontab entries)
44351
44892
  norc runs --tail tail run history (not yet available)
44893
+ norc usage [--days 7|30] [--json] [--no-color] [--plain]
44894
+ usage dashboard in the terminal: headroom, health, runs, activity
44352
44895
  norc bridge run the bridge daemon (stay online, admin from norc web)
44353
44896
  norc service install register+start the per-user background service
44354
44897
  norc service uninstall stop+remove the per-user background service
@@ -44519,6 +45062,21 @@ async function main() {
44519
45062
  case "runs":
44520
45063
  console.log(tailRunsMessage());
44521
45064
  return;
45065
+ case "usage": {
45066
+ const anonKey = process.env.NORC_SUPABASE_ANON_KEY ?? DEFAULT_SUPABASE_ANON_KEY;
45067
+ const base = supabaseUrl();
45068
+ process.exitCode = await cmdUsage(args, {
45069
+ fetchImpl: fetch,
45070
+ getJwt: async () => (await deviceSession(base, anonKey))?.token ?? null,
45071
+ functionsUrl: `${base}/functions/v1`,
45072
+ vaultUrl: process.env.NORC_VAULT_URL ?? DEFAULT_VAULT_URL,
45073
+ columns: process.stdout.columns ?? 80,
45074
+ isTTY: Boolean(process.stdout.isTTY),
45075
+ env: process.env,
45076
+ platform: process.platform
45077
+ });
45078
+ return;
45079
+ }
44522
45080
  case "bridge":
44523
45081
  return cmdBridge();
44524
45082
  case "service": {