@floless/app 0.75.0 → 0.77.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.
@@ -4415,10 +4415,10 @@ var require_redaction = __commonJS({
4415
4415
  var strict = false;
4416
4416
  function redaction(opts, serialize) {
4417
4417
  const { paths, censor, remove } = handle(opts);
4418
- const shape = paths.reduce((o, str) => {
4418
+ const shape = paths.reduce((o, str2) => {
4419
4419
  rx.lastIndex = 0;
4420
- const first = rx.exec(str);
4421
- const next = rx.exec(str);
4420
+ const first = rx.exec(str2);
4421
+ const next = rx.exec(str2);
4422
4422
  let ns = first[1] !== void 0 ? first[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/, "$1") : first[0];
4423
4423
  if (ns === "*") {
4424
4424
  ns = wildcardFirstSym;
@@ -4431,7 +4431,7 @@ var require_redaction = __commonJS({
4431
4431
  return o;
4432
4432
  }
4433
4433
  const { index } = next;
4434
- const nextPath = `${str.substr(index, str.length - 1)}`;
4434
+ const nextPath = `${str2.substr(index, str2.length - 1)}`;
4435
4435
  o[ns] = o[ns] || [];
4436
4436
  if (ns !== wildcardFirstSym && o[ns].length === 0) {
4437
4437
  o[ns].push(...o[wildcardFirstSym] || []);
@@ -4547,7 +4547,7 @@ var require_quick_format_unescaped = __commonJS({
4547
4547
  }
4548
4548
  var argLen = args.length;
4549
4549
  if (argLen === 0) return f;
4550
- var str = "";
4550
+ var str2 = "";
4551
4551
  var a = 1 - offset;
4552
4552
  var lastPos = -1;
4553
4553
  var flen = f && f.length || 0;
@@ -4562,8 +4562,8 @@ var require_quick_format_unescaped = __commonJS({
4562
4562
  break;
4563
4563
  if (args[a] == null) break;
4564
4564
  if (lastPos < i)
4565
- str += f.slice(lastPos, i);
4566
- str += Number(args[a]);
4565
+ str2 += f.slice(lastPos, i);
4566
+ str2 += Number(args[a]);
4567
4567
  lastPos = i + 2;
4568
4568
  i++;
4569
4569
  break;
@@ -4572,8 +4572,8 @@ var require_quick_format_unescaped = __commonJS({
4572
4572
  break;
4573
4573
  if (args[a] == null) break;
4574
4574
  if (lastPos < i)
4575
- str += f.slice(lastPos, i);
4576
- str += Math.floor(Number(args[a]));
4575
+ str2 += f.slice(lastPos, i);
4576
+ str2 += Math.floor(Number(args[a]));
4577
4577
  lastPos = i + 2;
4578
4578
  i++;
4579
4579
  break;
@@ -4586,21 +4586,21 @@ var require_quick_format_unescaped = __commonJS({
4586
4586
  break;
4587
4587
  if (args[a] === void 0) break;
4588
4588
  if (lastPos < i)
4589
- str += f.slice(lastPos, i);
4589
+ str2 += f.slice(lastPos, i);
4590
4590
  var type = typeof args[a];
4591
4591
  if (type === "string") {
4592
- str += "'" + args[a] + "'";
4592
+ str2 += "'" + args[a] + "'";
4593
4593
  lastPos = i + 2;
4594
4594
  i++;
4595
4595
  break;
4596
4596
  }
4597
4597
  if (type === "function") {
4598
- str += args[a].name || "<anonymous>";
4598
+ str2 += args[a].name || "<anonymous>";
4599
4599
  lastPos = i + 2;
4600
4600
  i++;
4601
4601
  break;
4602
4602
  }
4603
- str += ss(args[a]);
4603
+ str2 += ss(args[a]);
4604
4604
  lastPos = i + 2;
4605
4605
  i++;
4606
4606
  break;
@@ -4608,15 +4608,15 @@ var require_quick_format_unescaped = __commonJS({
4608
4608
  if (a >= argLen)
4609
4609
  break;
4610
4610
  if (lastPos < i)
4611
- str += f.slice(lastPos, i);
4612
- str += String(args[a]);
4611
+ str2 += f.slice(lastPos, i);
4612
+ str2 += String(args[a]);
4613
4613
  lastPos = i + 2;
4614
4614
  i++;
4615
4615
  break;
4616
4616
  case 37:
4617
4617
  if (lastPos < i)
4618
- str += f.slice(lastPos, i);
4619
- str += "%";
4618
+ str2 += f.slice(lastPos, i);
4619
+ str2 += "%";
4620
4620
  lastPos = i + 2;
4621
4621
  i++;
4622
4622
  a--;
@@ -4629,9 +4629,9 @@ var require_quick_format_unescaped = __commonJS({
4629
4629
  if (lastPos === -1)
4630
4630
  return f;
4631
4631
  else if (lastPos < flen) {
4632
- str += f.slice(lastPos);
4632
+ str2 += f.slice(lastPos);
4633
4633
  }
4634
- return str;
4634
+ return str2;
4635
4635
  }
4636
4636
  }
4637
4637
  });
@@ -5489,7 +5489,7 @@ var require_thread_stream = __commonJS({
5489
5489
  var { version } = require_package();
5490
5490
  var { EventEmitter: EventEmitter2 } = require("events");
5491
5491
  var { Worker: Worker2 } = require("worker_threads");
5492
- var { join: join33 } = require("path");
5492
+ var { join: join34 } = require("path");
5493
5493
  var { pathToFileURL } = require("url");
5494
5494
  var { wait } = require_wait();
5495
5495
  var {
@@ -5540,7 +5540,7 @@ var require_thread_stream = __commonJS({
5540
5540
  function createWorker(stream, opts) {
5541
5541
  const { filename, workerData } = opts;
5542
5542
  const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
5543
- const toExecute = bundlerOverrides["thread-stream-worker"] || join33(__dirname, "lib", "worker.js");
5543
+ const toExecute = bundlerOverrides["thread-stream-worker"] || join34(__dirname, "lib", "worker.js");
5544
5544
  const worker = new Worker2(toExecute, {
5545
5545
  ...opts.workerOpts,
5546
5546
  name: opts.workerOpts?.name || "thread-stream",
@@ -6006,9 +6006,9 @@ var require_transport = __commonJS({
6006
6006
  "node_modules/pino/lib/transport.js"(exports2, module2) {
6007
6007
  "use strict";
6008
6008
  var { createRequire: createRequire5 } = require("module");
6009
- var { existsSync: existsSync28 } = require("node:fs");
6009
+ var { existsSync: existsSync29 } = require("node:fs");
6010
6010
  var getCallers = require_caller();
6011
- var { join: join33, isAbsolute: isAbsolute2, sep: sep4 } = require("node:path");
6011
+ var { join: join34, isAbsolute: isAbsolute2, sep: sep4 } = require("node:path");
6012
6012
  var { fileURLToPath: fileURLToPath6 } = require("node:url");
6013
6013
  var sleep = require_atomic_sleep();
6014
6014
  var onExit = require_on_exit_leak_free();
@@ -6080,7 +6080,7 @@ var require_transport = __commonJS({
6080
6080
  return false;
6081
6081
  }
6082
6082
  }
6083
- return isAbsolute2(path) && !existsSync28(path);
6083
+ return isAbsolute2(path) && !existsSync29(path);
6084
6084
  }
6085
6085
  function stripQuotes(value) {
6086
6086
  const first = value[0];
@@ -6161,7 +6161,7 @@ var require_transport = __commonJS({
6161
6161
  throw new Error("only one of target or targets can be specified");
6162
6162
  }
6163
6163
  if (targets) {
6164
- target = bundlerOverrides["pino-worker"] || join33(__dirname, "worker.js");
6164
+ target = bundlerOverrides["pino-worker"] || join34(__dirname, "worker.js");
6165
6165
  options.targets = targets.filter((dest) => dest.target).map((dest) => {
6166
6166
  return {
6167
6167
  ...dest,
@@ -6179,7 +6179,7 @@ var require_transport = __commonJS({
6179
6179
  });
6180
6180
  });
6181
6181
  } else if (pipeline2) {
6182
- target = bundlerOverrides["pino-worker"] || join33(__dirname, "worker.js");
6182
+ target = bundlerOverrides["pino-worker"] || join34(__dirname, "worker.js");
6183
6183
  options.pipelines = [pipeline2.map((dest) => {
6184
6184
  return {
6185
6185
  ...dest,
@@ -6202,7 +6202,7 @@ var require_transport = __commonJS({
6202
6202
  return origin;
6203
6203
  }
6204
6204
  if (origin === "pino/file") {
6205
- return join33(__dirname, "..", "file.js");
6205
+ return join34(__dirname, "..", "file.js");
6206
6206
  }
6207
6207
  let fixTarget2;
6208
6208
  for (const filePath of callers) {
@@ -6255,7 +6255,7 @@ var require_tools = __commonJS({
6255
6255
  var transport = require_transport();
6256
6256
  var [nodeMajor] = process.versions.node.split(".").map((v) => Number(v));
6257
6257
  var asJsonChan = diagChan.tracingChannel("pino_asJson");
6258
- var asString = nodeMajor >= 25 ? (str) => JSON.stringify(str) : _asString;
6258
+ var asString = nodeMajor >= 25 ? (str2) => JSON.stringify(str2) : _asString;
6259
6259
  function noop() {
6260
6260
  }
6261
6261
  function genLog(level, hook) {
@@ -6293,38 +6293,38 @@ var require_tools = __commonJS({
6293
6293
  }
6294
6294
  }
6295
6295
  }
6296
- function _asString(str) {
6296
+ function _asString(str2) {
6297
6297
  let result = "";
6298
6298
  let last = 0;
6299
6299
  let found = false;
6300
6300
  let point = 255;
6301
- const l = str.length;
6301
+ const l = str2.length;
6302
6302
  if (l > 100) {
6303
- return JSON.stringify(str);
6303
+ return JSON.stringify(str2);
6304
6304
  }
6305
6305
  for (var i = 0; i < l && point >= 32; i++) {
6306
- point = str.charCodeAt(i);
6306
+ point = str2.charCodeAt(i);
6307
6307
  if (point === 34 || point === 92) {
6308
- result += str.slice(last, i) + "\\";
6308
+ result += str2.slice(last, i) + "\\";
6309
6309
  last = i;
6310
6310
  found = true;
6311
6311
  }
6312
6312
  }
6313
6313
  if (!found) {
6314
- result = str;
6314
+ result = str2;
6315
6315
  } else {
6316
- result += str.slice(last);
6316
+ result += str2.slice(last);
6317
6317
  }
6318
- return point < 32 ? JSON.stringify(str) : '"' + result + '"';
6318
+ return point < 32 ? JSON.stringify(str2) : '"' + result + '"';
6319
6319
  }
6320
- function asJson(obj, msg, num2, time) {
6320
+ function asJson(obj, msg, num3, time) {
6321
6321
  if (asJsonChan.hasSubscribers === false) {
6322
- return _asJson.call(this, obj, msg, num2, time);
6322
+ return _asJson.call(this, obj, msg, num3, time);
6323
6323
  }
6324
6324
  const store = { instance: this, arguments };
6325
- return asJsonChan.traceSync(_asJson, store, this, obj, msg, num2, time);
6325
+ return asJsonChan.traceSync(_asJson, store, this, obj, msg, num3, time);
6326
6326
  }
6327
- function _asJson(obj, msg, num2, time) {
6327
+ function _asJson(obj, msg, num3, time) {
6328
6328
  const stringify2 = this[stringifySym];
6329
6329
  const stringifySafe = this[stringifySafeSym];
6330
6330
  const stringifiers = this[stringifiersSym];
@@ -6334,7 +6334,7 @@ var require_tools = __commonJS({
6334
6334
  const formatters = this[formattersSym];
6335
6335
  const messageKey = this[messageKeySym];
6336
6336
  const errorKey = this[errorKeySym];
6337
- let data = this[lsCacheSym][num2] + time;
6337
+ let data = this[lsCacheSym][num3] + time;
6338
6338
  data = data + chindings;
6339
6339
  let value;
6340
6340
  if (formatters.log) {
@@ -6959,7 +6959,7 @@ var require_proto = __commonJS({
6959
6959
  function defaultMixinMergeStrategy(mergeObject, mixinObject) {
6960
6960
  return Object.assign(mixinObject, mergeObject);
6961
6961
  }
6962
- function write(_obj, msg, num2) {
6962
+ function write(_obj, msg, num3) {
6963
6963
  const t = this[timeSym]();
6964
6964
  const mixin = this[mixinSym];
6965
6965
  const errorKey = this[errorKeySym];
@@ -6981,12 +6981,12 @@ var require_proto = __commonJS({
6981
6981
  }
6982
6982
  }
6983
6983
  if (mixin) {
6984
- obj = mixinMergeStrategy(obj, mixin(obj, num2, this));
6984
+ obj = mixinMergeStrategy(obj, mixin(obj, num3, this));
6985
6985
  }
6986
- const s = this[asJsonSym](obj, msg, num2, t);
6986
+ const s = this[asJsonSym](obj, msg, num3, t);
6987
6987
  const stream = this[streamSym];
6988
6988
  if (stream[needsMetadataGsym] === true) {
6989
- stream.lastLevel = num2;
6989
+ stream.lastLevel = num3;
6990
6990
  stream.lastObj = obj;
6991
6991
  stream.lastMsg = msg;
6992
6992
  stream.lastTime = t.slice(this[timeSliceIndexSym]);
@@ -7019,11 +7019,11 @@ var require_safe_stable_stringify = __commonJS({
7019
7019
  exports2.configure = configure;
7020
7020
  module2.exports = stringify;
7021
7021
  var strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;
7022
- function strEscape(str) {
7023
- if (str.length < 5e3 && !strEscapeSequencesRegExp.test(str)) {
7024
- return `"${str}"`;
7022
+ function strEscape(str2) {
7023
+ if (str2.length < 5e3 && !strEscapeSequencesRegExp.test(str2)) {
7024
+ return `"${str2}"`;
7025
7025
  }
7026
- return JSON.stringify(str);
7026
+ return JSON.stringify(str2);
7027
7027
  }
7028
7028
  function sort(array, comparator) {
7029
7029
  if (array.length > 200 || comparator) {
@@ -7182,7 +7182,7 @@ var require_safe_stable_stringify = __commonJS({
7182
7182
  return circularValue;
7183
7183
  }
7184
7184
  let res = "";
7185
- let join33 = ",";
7185
+ let join34 = ",";
7186
7186
  const originalIndentation = indentation;
7187
7187
  if (Array.isArray(value)) {
7188
7188
  if (value.length === 0) {
@@ -7196,7 +7196,7 @@ var require_safe_stable_stringify = __commonJS({
7196
7196
  indentation += spacer;
7197
7197
  res += `
7198
7198
  ${indentation}`;
7199
- join33 = `,
7199
+ join34 = `,
7200
7200
  ${indentation}`;
7201
7201
  }
7202
7202
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -7204,13 +7204,13 @@ ${indentation}`;
7204
7204
  for (; i < maximumValuesToStringify - 1; i++) {
7205
7205
  const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
7206
7206
  res += tmp2 !== void 0 ? tmp2 : "null";
7207
- res += join33;
7207
+ res += join34;
7208
7208
  }
7209
7209
  const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
7210
7210
  res += tmp !== void 0 ? tmp : "null";
7211
7211
  if (value.length - 1 > maximumBreadth) {
7212
7212
  const removedKeys = value.length - maximumBreadth - 1;
7213
- res += `${join33}"... ${getItemCount(removedKeys)} not stringified"`;
7213
+ res += `${join34}"... ${getItemCount(removedKeys)} not stringified"`;
7214
7214
  }
7215
7215
  if (spacer !== "") {
7216
7216
  res += `
@@ -7231,7 +7231,7 @@ ${originalIndentation}`;
7231
7231
  let separator = "";
7232
7232
  if (spacer !== "") {
7233
7233
  indentation += spacer;
7234
- join33 = `,
7234
+ join34 = `,
7235
7235
  ${indentation}`;
7236
7236
  whitespace = " ";
7237
7237
  }
@@ -7245,13 +7245,13 @@ ${indentation}`;
7245
7245
  const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
7246
7246
  if (tmp !== void 0) {
7247
7247
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
7248
- separator = join33;
7248
+ separator = join34;
7249
7249
  }
7250
7250
  }
7251
7251
  if (keyLength > maximumBreadth) {
7252
7252
  const removedKeys = keyLength - maximumBreadth;
7253
7253
  res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
7254
- separator = join33;
7254
+ separator = join34;
7255
7255
  }
7256
7256
  if (spacer !== "" && separator.length > 1) {
7257
7257
  res = `
@@ -7292,7 +7292,7 @@ ${originalIndentation}`;
7292
7292
  }
7293
7293
  const originalIndentation = indentation;
7294
7294
  let res = "";
7295
- let join33 = ",";
7295
+ let join34 = ",";
7296
7296
  if (Array.isArray(value)) {
7297
7297
  if (value.length === 0) {
7298
7298
  return "[]";
@@ -7305,7 +7305,7 @@ ${originalIndentation}`;
7305
7305
  indentation += spacer;
7306
7306
  res += `
7307
7307
  ${indentation}`;
7308
- join33 = `,
7308
+ join34 = `,
7309
7309
  ${indentation}`;
7310
7310
  }
7311
7311
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -7313,13 +7313,13 @@ ${indentation}`;
7313
7313
  for (; i < maximumValuesToStringify - 1; i++) {
7314
7314
  const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
7315
7315
  res += tmp2 !== void 0 ? tmp2 : "null";
7316
- res += join33;
7316
+ res += join34;
7317
7317
  }
7318
7318
  const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
7319
7319
  res += tmp !== void 0 ? tmp : "null";
7320
7320
  if (value.length - 1 > maximumBreadth) {
7321
7321
  const removedKeys = value.length - maximumBreadth - 1;
7322
- res += `${join33}"... ${getItemCount(removedKeys)} not stringified"`;
7322
+ res += `${join34}"... ${getItemCount(removedKeys)} not stringified"`;
7323
7323
  }
7324
7324
  if (spacer !== "") {
7325
7325
  res += `
@@ -7332,7 +7332,7 @@ ${originalIndentation}`;
7332
7332
  let whitespace = "";
7333
7333
  if (spacer !== "") {
7334
7334
  indentation += spacer;
7335
- join33 = `,
7335
+ join34 = `,
7336
7336
  ${indentation}`;
7337
7337
  whitespace = " ";
7338
7338
  }
@@ -7341,7 +7341,7 @@ ${indentation}`;
7341
7341
  const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
7342
7342
  if (tmp !== void 0) {
7343
7343
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
7344
- separator = join33;
7344
+ separator = join34;
7345
7345
  }
7346
7346
  }
7347
7347
  if (spacer !== "" && separator.length > 1) {
@@ -7399,20 +7399,20 @@ ${originalIndentation}`;
7399
7399
  indentation += spacer;
7400
7400
  let res2 = `
7401
7401
  ${indentation}`;
7402
- const join34 = `,
7402
+ const join35 = `,
7403
7403
  ${indentation}`;
7404
7404
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
7405
7405
  let i = 0;
7406
7406
  for (; i < maximumValuesToStringify - 1; i++) {
7407
7407
  const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
7408
7408
  res2 += tmp2 !== void 0 ? tmp2 : "null";
7409
- res2 += join34;
7409
+ res2 += join35;
7410
7410
  }
7411
7411
  const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
7412
7412
  res2 += tmp !== void 0 ? tmp : "null";
7413
7413
  if (value.length - 1 > maximumBreadth) {
7414
7414
  const removedKeys = value.length - maximumBreadth - 1;
7415
- res2 += `${join34}"... ${getItemCount(removedKeys)} not stringified"`;
7415
+ res2 += `${join35}"... ${getItemCount(removedKeys)} not stringified"`;
7416
7416
  }
7417
7417
  res2 += `
7418
7418
  ${originalIndentation}`;
@@ -7428,16 +7428,16 @@ ${originalIndentation}`;
7428
7428
  return '"[Object]"';
7429
7429
  }
7430
7430
  indentation += spacer;
7431
- const join33 = `,
7431
+ const join34 = `,
7432
7432
  ${indentation}`;
7433
7433
  let res = "";
7434
7434
  let separator = "";
7435
7435
  let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
7436
7436
  if (isTypedArrayWithEntries(value)) {
7437
- res += stringifyTypedArray(value, join33, maximumBreadth);
7437
+ res += stringifyTypedArray(value, join34, maximumBreadth);
7438
7438
  keys = keys.slice(value.length);
7439
7439
  maximumPropertiesToStringify -= value.length;
7440
- separator = join33;
7440
+ separator = join34;
7441
7441
  }
7442
7442
  if (deterministic) {
7443
7443
  keys = sort(keys, comparator);
@@ -7448,13 +7448,13 @@ ${indentation}`;
7448
7448
  const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
7449
7449
  if (tmp !== void 0) {
7450
7450
  res += `${separator}${strEscape(key2)}: ${tmp}`;
7451
- separator = join33;
7451
+ separator = join34;
7452
7452
  }
7453
7453
  }
7454
7454
  if (keyLength > maximumBreadth) {
7455
7455
  const removedKeys = keyLength - maximumBreadth;
7456
7456
  res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
7457
- separator = join33;
7457
+ separator = join34;
7458
7458
  }
7459
7459
  if (separator !== "") {
7460
7460
  res = `
@@ -8513,13 +8513,13 @@ var require_serializer = __commonJS({
8513
8513
  return "" + integer;
8514
8514
  }
8515
8515
  asNumber(i) {
8516
- const num2 = Number(i);
8517
- if (num2 !== num2) {
8516
+ const num3 = Number(i);
8517
+ if (num3 !== num3) {
8518
8518
  throw new Error(`The value "${i}" cannot be converted to a number.`);
8519
- } else if (num2 === Infinity || num2 === -Infinity) {
8519
+ } else if (num3 === Infinity || num3 === -Infinity) {
8520
8520
  return "null";
8521
8521
  } else {
8522
- return "" + num2;
8522
+ return "" + num3;
8523
8523
  }
8524
8524
  }
8525
8525
  asBoolean(bool) {
@@ -8555,8 +8555,8 @@ var require_serializer = __commonJS({
8555
8555
  }
8556
8556
  throw new Error(`The value "${date}" cannot be converted to a time.`);
8557
8557
  }
8558
- asString(str) {
8559
- const len2 = str.length;
8558
+ asString(str2) {
8559
+ const len2 = str2.length;
8560
8560
  if (len2 === 0) {
8561
8561
  return '""';
8562
8562
  } else if (len2 < 42) {
@@ -8564,25 +8564,25 @@ var require_serializer = __commonJS({
8564
8564
  let last = -1;
8565
8565
  let point = 255;
8566
8566
  for (let i = 0; i < len2; i++) {
8567
- point = str.charCodeAt(i);
8567
+ point = str2.charCodeAt(i);
8568
8568
  if (point === 34 || // '"'
8569
8569
  point === 92) {
8570
8570
  last === -1 && (last = 0);
8571
- result += str.slice(last, i) + "\\";
8571
+ result += str2.slice(last, i) + "\\";
8572
8572
  last = i;
8573
8573
  } else if (point < 32 || point >= 55296 && point <= 57343) {
8574
- return JSON.stringify(str);
8574
+ return JSON.stringify(str2);
8575
8575
  }
8576
8576
  }
8577
- return last === -1 && '"' + str + '"' || '"' + result + str.slice(last) + '"';
8578
- } else if (len2 < 5e3 && STR_ESCAPE.test(str) === false) {
8579
- return '"' + str + '"';
8577
+ return last === -1 && '"' + str2 + '"' || '"' + result + str2.slice(last) + '"';
8578
+ } else if (len2 < 5e3 && STR_ESCAPE.test(str2) === false) {
8579
+ return '"' + str2 + '"';
8580
8580
  } else {
8581
- return JSON.stringify(str);
8581
+ return JSON.stringify(str2);
8582
8582
  }
8583
8583
  }
8584
- asUnsafeString(str) {
8585
- return '"' + str + '"';
8584
+ asUnsafeString(str2) {
8585
+ return '"' + str2 + '"';
8586
8586
  }
8587
8587
  getState() {
8588
8588
  return this._options;
@@ -10712,11 +10712,11 @@ var require_proxy_addr = __commonJS({
10712
10712
  }
10713
10713
  function parseipNotation(note) {
10714
10714
  const pos2 = note.lastIndexOf("/");
10715
- const str = pos2 !== -1 ? note.substring(0, pos2) : note;
10716
- if (!isip(str)) {
10717
- throw new TypeError("invalid IP address: " + str);
10715
+ const str2 = pos2 !== -1 ? note.substring(0, pos2) : note;
10716
+ if (!isip(str2)) {
10717
+ throw new TypeError("invalid IP address: " + str2);
10718
10718
  }
10719
- let ip = parseip(str);
10719
+ let ip = parseip(str2);
10720
10720
  if (pos2 === -1 && ip.kind() === "ipv6" && ip.isIPv4MappedAddress()) {
10721
10721
  ip = ip.toIPv4Address();
10722
10722
  }
@@ -12426,7 +12426,7 @@ var require_code = __commonJS({
12426
12426
  }
12427
12427
  exports2._ = _;
12428
12428
  var plus = new _Code("+");
12429
- function str(strs, ...args) {
12429
+ function str2(strs, ...args) {
12430
12430
  const expr = [safeStringify(strs[0])];
12431
12431
  let i = 0;
12432
12432
  while (i < args.length) {
@@ -12437,7 +12437,7 @@ var require_code = __commonJS({
12437
12437
  optimize(expr);
12438
12438
  return new _Code(expr);
12439
12439
  }
12440
- exports2.str = str;
12440
+ exports2.str = str2;
12441
12441
  function addCodeArg(code, arg) {
12442
12442
  if (arg instanceof _Code)
12443
12443
  code.push(...arg._items);
@@ -12480,7 +12480,7 @@ var require_code = __commonJS({
12480
12480
  return;
12481
12481
  }
12482
12482
  function strConcat(c1, c2) {
12483
- return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
12483
+ return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str2`${c1}${c2}`;
12484
12484
  }
12485
12485
  exports2.strConcat = strConcat;
12486
12486
  function interpolate(x) {
@@ -13442,22 +13442,22 @@ var require_util = __commonJS({
13442
13442
  return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
13443
13443
  }
13444
13444
  exports2.schemaRefOrVal = schemaRefOrVal;
13445
- function unescapeFragment(str) {
13446
- return unescapeJsonPointer(decodeURIComponent(str));
13445
+ function unescapeFragment(str2) {
13446
+ return unescapeJsonPointer(decodeURIComponent(str2));
13447
13447
  }
13448
13448
  exports2.unescapeFragment = unescapeFragment;
13449
- function escapeFragment(str) {
13450
- return encodeURIComponent(escapeJsonPointer(str));
13449
+ function escapeFragment(str2) {
13450
+ return encodeURIComponent(escapeJsonPointer(str2));
13451
13451
  }
13452
13452
  exports2.escapeFragment = escapeFragment;
13453
- function escapeJsonPointer(str) {
13454
- if (typeof str == "number")
13455
- return `${str}`;
13456
- return str.replace(/~/g, "~0").replace(/\//g, "~1");
13453
+ function escapeJsonPointer(str2) {
13454
+ if (typeof str2 == "number")
13455
+ return `${str2}`;
13456
+ return str2.replace(/~/g, "~0").replace(/\//g, "~1");
13457
13457
  }
13458
13458
  exports2.escapeJsonPointer = escapeJsonPointer;
13459
- function unescapeJsonPointer(str) {
13460
- return str.replace(/~1/g, "/").replace(/~0/g, "~");
13459
+ function unescapeJsonPointer(str2) {
13460
+ return str2.replace(/~1/g, "/").replace(/~0/g, "~");
13461
13461
  }
13462
13462
  exports2.unescapeJsonPointer = unescapeJsonPointer;
13463
13463
  function eachItem(xs, f) {
@@ -14482,8 +14482,8 @@ var require_json_schema_traverse = __commonJS({
14482
14482
  post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
14483
14483
  }
14484
14484
  }
14485
- function escapeJsonPtr(str) {
14486
- return str.replace(/~/g, "~0").replace(/\//g, "~1");
14485
+ function escapeJsonPtr(str2) {
14486
+ return str2.replace(/~/g, "~0").replace(/\//g, "~1");
14487
14487
  }
14488
14488
  }
14489
14489
  });
@@ -15547,10 +15547,10 @@ var require_utils = __commonJS({
15547
15547
  return { host, isIPV6: false };
15548
15548
  }
15549
15549
  }
15550
- function findToken(str, token) {
15550
+ function findToken(str2, token) {
15551
15551
  let ind = 0;
15552
- for (let i = 0; i < str.length; i++) {
15553
- if (str[i] === token) ind++;
15552
+ for (let i = 0; i < str2.length; i++) {
15553
+ if (str2[i] === token) ind++;
15554
15554
  }
15555
15555
  return ind;
15556
15556
  }
@@ -16287,7 +16287,7 @@ var require_core = __commonJS({
16287
16287
  var util_1 = require_util();
16288
16288
  var $dataRefSchema = require_data();
16289
16289
  var uri_1 = require_uri();
16290
- var defaultRegExp = (str, flags) => new RegExp(str, flags);
16290
+ var defaultRegExp = (str2, flags) => new RegExp(str2, flags);
16291
16291
  defaultRegExp.code = "new RegExp";
16292
16292
  var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
16293
16293
  var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([
@@ -17082,16 +17082,16 @@ var require_ucs2length = __commonJS({
17082
17082
  "node_modules/ajv/dist/runtime/ucs2length.js"(exports2) {
17083
17083
  "use strict";
17084
17084
  Object.defineProperty(exports2, "__esModule", { value: true });
17085
- function ucs2length(str) {
17086
- const len2 = str.length;
17085
+ function ucs2length(str2) {
17086
+ const len2 = str2.length;
17087
17087
  let length = 0;
17088
17088
  let pos2 = 0;
17089
17089
  let value;
17090
17090
  while (pos2 < len2) {
17091
17091
  length++;
17092
- value = str.charCodeAt(pos2++);
17092
+ value = str2.charCodeAt(pos2++);
17093
17093
  if (value >= 55296 && value <= 56319 && pos2 < len2) {
17094
- value = str.charCodeAt(pos2);
17094
+ value = str2.charCodeAt(pos2);
17095
17095
  if ((value & 64512) === 56320)
17096
17096
  pos2++;
17097
17097
  }
@@ -19007,13 +19007,13 @@ var require_timestamp = __commonJS({
19007
19007
  var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
19008
19008
  var TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i;
19009
19009
  var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
19010
- function validTimestamp(str, allowDate) {
19011
- const dt = str.split(DT_SEPARATOR);
19010
+ function validTimestamp(str2, allowDate) {
19011
+ const dt = str2.split(DT_SEPARATOR);
19012
19012
  return dt.length === 2 && validDate(dt[0]) && validTime(dt[1]) || allowDate && dt.length === 1 && validDate(dt[0]);
19013
19013
  }
19014
19014
  exports2.default = validTimestamp;
19015
- function validDate(str) {
19016
- const matches = DATE.exec(str);
19015
+ function validDate(str2) {
19016
+ const matches = DATE.exec(str2);
19017
19017
  if (!matches)
19018
19018
  return false;
19019
19019
  const y = +matches[1];
@@ -19022,8 +19022,8 @@ var require_timestamp = __commonJS({
19022
19022
  return m >= 1 && m <= 12 && d >= 1 && (d <= DAYS[m] || // leap year: https://tools.ietf.org/html/rfc3339#appendix-C
19023
19023
  m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0));
19024
19024
  }
19025
- function validTime(str) {
19026
- const matches = TIME.exec(str);
19025
+ function validTime(str2) {
19026
+ const matches = TIME.exec(str2);
19027
19027
  if (!matches)
19028
19028
  return false;
19029
19029
  const hr = +matches[1];
@@ -20086,7 +20086,7 @@ var require_parseJson = __commonJS({
20086
20086
  var CODE_A = "a".charCodeAt(0);
20087
20087
  var CODE_0 = "0".charCodeAt(0);
20088
20088
  function parseJsonString(s, pos2) {
20089
- let str = "";
20089
+ let str2 = "";
20090
20090
  let c;
20091
20091
  parseJsonString.message = void 0;
20092
20092
  while (true) {
@@ -20096,7 +20096,7 @@ var require_parseJson = __commonJS({
20096
20096
  if (c === "\\") {
20097
20097
  c = s[pos2];
20098
20098
  if (c in escapedChars) {
20099
- str += escapedChars[c];
20099
+ str2 += escapedChars[c];
20100
20100
  pos2++;
20101
20101
  } else if (c === "u") {
20102
20102
  pos2++;
@@ -20120,7 +20120,7 @@ var require_parseJson = __commonJS({
20120
20120
  }
20121
20121
  pos2++;
20122
20122
  }
20123
- str += String.fromCharCode(code);
20123
+ str2 += String.fromCharCode(code);
20124
20124
  } else {
20125
20125
  errorMessage(`unexpected token ${c}`);
20126
20126
  return void 0;
@@ -20130,7 +20130,7 @@ var require_parseJson = __commonJS({
20130
20130
  return void 0;
20131
20131
  } else {
20132
20132
  if (c.charCodeAt(0) >= 32) {
20133
- str += c;
20133
+ str2 += c;
20134
20134
  } else {
20135
20135
  errorMessage(`unexpected token ${c}`);
20136
20136
  return void 0;
@@ -20138,7 +20138,7 @@ var require_parseJson = __commonJS({
20138
20138
  }
20139
20139
  }
20140
20140
  parseJsonString.position = pos2;
20141
- return str;
20141
+ return str2;
20142
20142
  function errorMessage(msg) {
20143
20143
  parseJsonString.position = pos2;
20144
20144
  parseJsonString.message = msg;
@@ -20687,8 +20687,8 @@ var require_formats = __commonJS({
20687
20687
  }
20688
20688
  var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
20689
20689
  var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
20690
- function date(str) {
20691
- const matches = DATE.exec(str);
20690
+ function date(str2) {
20691
+ const matches = DATE.exec(str2);
20692
20692
  if (!matches)
20693
20693
  return false;
20694
20694
  const year = +matches[1];
@@ -20707,8 +20707,8 @@ var require_formats = __commonJS({
20707
20707
  }
20708
20708
  var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
20709
20709
  function getTime(strictTimeZone) {
20710
- return function time(str) {
20711
- const matches = TIME.exec(str);
20710
+ return function time(str2) {
20711
+ const matches = TIME.exec(str2);
20712
20712
  if (!matches)
20713
20713
  return false;
20714
20714
  const hr = +matches[1];
@@ -20754,8 +20754,8 @@ var require_formats = __commonJS({
20754
20754
  var DATE_TIME_SEPARATOR = /t|\s/i;
20755
20755
  function getDateTime(strictTimeZone) {
20756
20756
  const time = getTime(strictTimeZone);
20757
- return function date_time(str) {
20758
- const dateTime = str.split(DATE_TIME_SEPARATOR);
20757
+ return function date_time(str2) {
20758
+ const dateTime = str2.split(DATE_TIME_SEPARATOR);
20759
20759
  return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]);
20760
20760
  };
20761
20761
  }
@@ -20780,13 +20780,13 @@ var require_formats = __commonJS({
20780
20780
  }
20781
20781
  var NOT_URI_FRAGMENT = /\/|:/;
20782
20782
  var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
20783
- function uri(str) {
20784
- return NOT_URI_FRAGMENT.test(str) && URI.test(str);
20783
+ function uri(str2) {
20784
+ return NOT_URI_FRAGMENT.test(str2) && URI.test(str2);
20785
20785
  }
20786
20786
  var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
20787
- function byte(str) {
20787
+ function byte(str2) {
20788
20788
  BYTE.lastIndex = 0;
20789
- return BYTE.test(str);
20789
+ return BYTE.test(str2);
20790
20790
  }
20791
20791
  var MIN_INT32 = -(2 ** 31);
20792
20792
  var MAX_INT32 = 2 ** 31 - 1;
@@ -20800,11 +20800,11 @@ var require_formats = __commonJS({
20800
20800
  return true;
20801
20801
  }
20802
20802
  var Z_ANCHOR = /[^\\]\\Z/;
20803
- function regex(str) {
20804
- if (Z_ANCHOR.test(str))
20803
+ function regex(str2) {
20804
+ if (Z_ANCHOR.test(str2))
20805
20805
  return false;
20806
20806
  try {
20807
- new RegExp(str);
20807
+ new RegExp(str2);
20808
20808
  return true;
20809
20809
  } catch (e) {
20810
20810
  return false;
@@ -24673,9 +24673,9 @@ var require_semver = __commonJS({
24673
24673
  } else {
24674
24674
  this.prerelease = m[4].split(".").map((id) => {
24675
24675
  if (/^[0-9]+$/.test(id)) {
24676
- const num2 = +id;
24677
- if (num2 >= 0 && num2 < MAX_SAFE_INTEGER) {
24678
- return num2;
24676
+ const num3 = +id;
24677
+ if (num3 >= 0 && num3 < MAX_SAFE_INTEGER) {
24678
+ return num3;
24679
24679
  }
24680
24680
  }
24681
24681
  return id;
@@ -27282,24 +27282,24 @@ var require_querystring = __commonJS({
27282
27282
  0
27283
27283
  // 112 - 127
27284
27284
  ]);
27285
- function encodeString(str) {
27286
- const len2 = str.length;
27285
+ function encodeString(str2) {
27286
+ const len2 = str2.length;
27287
27287
  if (len2 === 0) return "";
27288
27288
  let out = "";
27289
27289
  let lastPos = 0;
27290
27290
  let i = 0;
27291
27291
  outer: for (; i < len2; i++) {
27292
- let c = str.charCodeAt(i);
27292
+ let c = str2.charCodeAt(i);
27293
27293
  while (c < 128) {
27294
27294
  if (noEscape[c] !== 1) {
27295
- if (lastPos < i) out += str.slice(lastPos, i);
27295
+ if (lastPos < i) out += str2.slice(lastPos, i);
27296
27296
  lastPos = i + 1;
27297
27297
  out += hexTable[c];
27298
27298
  }
27299
27299
  if (++i === len2) break outer;
27300
- c = str.charCodeAt(i);
27300
+ c = str2.charCodeAt(i);
27301
27301
  }
27302
- if (lastPos < i) out += str.slice(lastPos, i);
27302
+ if (lastPos < i) out += str2.slice(lastPos, i);
27303
27303
  if (c < 2048) {
27304
27304
  lastPos = i + 1;
27305
27305
  out += hexTable[192 | c >> 6] + hexTable[128 | c & 63];
@@ -27314,13 +27314,13 @@ var require_querystring = __commonJS({
27314
27314
  if (i >= len2) {
27315
27315
  throw new Error("URI malformed");
27316
27316
  }
27317
- const c2 = str.charCodeAt(i) & 1023;
27317
+ const c2 = str2.charCodeAt(i) & 1023;
27318
27318
  lastPos = i + 1;
27319
27319
  c = 65536 + ((c & 1023) << 10 | c2);
27320
27320
  out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
27321
27321
  }
27322
- if (lastPos === 0) return str;
27323
- if (lastPos < len2) return out + str.slice(lastPos);
27322
+ if (lastPos === 0) return str2;
27323
+ if (lastPos < len2) return out + str2.slice(lastPos);
27324
27324
  return out;
27325
27325
  }
27326
27326
  module2.exports = { encodeString };
@@ -27536,9 +27536,9 @@ var require_util2 = __commonJS({
27536
27536
  var types_1 = require_types4();
27537
27537
  var sets = __importStar(require_sets());
27538
27538
  var CTRL = "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?";
27539
- exports2.strToChars = (str) => {
27539
+ exports2.strToChars = (str2) => {
27540
27540
  const charsRegex = /(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;
27541
- return str.replace(charsRegex, (s, b, lbs, a16, b16, dctrl, eslsh) => {
27541
+ return str2.replace(charsRegex, (s, b, lbs, a16, b16, dctrl, eslsh) => {
27542
27542
  if (lbs) {
27543
27543
  return s;
27544
27544
  }
@@ -27554,11 +27554,11 @@ var require_util2 = __commonJS({
27554
27554
  return /[[\]{}^$.|?*+()]/.test(c) ? `\\${c}` : c;
27555
27555
  });
27556
27556
  };
27557
- exports2.tokenizeClass = (str, regexpStr) => {
27557
+ exports2.tokenizeClass = (str2, regexpStr) => {
27558
27558
  var _a2, _b2, _c, _d, _e, _f, _g;
27559
27559
  let tokens = [], rs, c;
27560
27560
  const regexp = /\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(((?:\\)])|(((?:\\)?([^\]])))))|(\])|(?:\\)?([^])/g;
27561
- while ((rs = regexp.exec(str)) !== null) {
27561
+ while ((rs = regexp.exec(str2)) !== null) {
27562
27562
  const p = (_g = (_f = (_e = (_d = (_c = (_b2 = (_a2 = rs[1] && sets.words()) !== null && _a2 !== void 0 ? _a2 : rs[2] && sets.ints()) !== null && _b2 !== void 0 ? _b2 : rs[3] && sets.whitespace()) !== null && _c !== void 0 ? _c : rs[4] && sets.notWords()) !== null && _d !== void 0 ? _d : rs[5] && sets.notInts()) !== null && _e !== void 0 ? _e : rs[6] && sets.notWhitespace()) !== null && _f !== void 0 ? _f : rs[7] && {
27563
27563
  type: types_1.types.RANGE,
27564
27564
  from: (rs[8] || rs[9]).charCodeAt(0),
@@ -27621,15 +27621,15 @@ var require_tokenizer = __commonJS({
27621
27621
  const repeatErr = (col) => {
27622
27622
  throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Nothing to repeat at column ${col - 1}`);
27623
27623
  };
27624
- let str = util.strToChars(regexpStr);
27625
- while (i < str.length) {
27626
- switch (c = str[i++]) {
27624
+ let str2 = util.strToChars(regexpStr);
27625
+ while (i < str2.length) {
27626
+ switch (c = str2[i++]) {
27627
27627
  // Handle escaped characters, inclues a few sets.
27628
27628
  case "\\":
27629
- if (i === str.length) {
27629
+ if (i === str2.length) {
27630
27630
  throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: \\ at end of pattern`);
27631
27631
  }
27632
- switch (c = str[i++]) {
27632
+ switch (c = str2[i++]) {
27633
27633
  case "b":
27634
27634
  last.push({ type: types_1.types.POSITION, value: "b" });
27635
27635
  break;
@@ -27657,8 +27657,8 @@ var require_tokenizer = __commonJS({
27657
27657
  default:
27658
27658
  if (digit.test(c)) {
27659
27659
  let digits = c;
27660
- while (i < str.length && digit.test(str[i])) {
27661
- digits += str[i++];
27660
+ while (i < str2.length && digit.test(str2[i])) {
27661
+ digits += str2[i++];
27662
27662
  }
27663
27663
  let value = parseInt(digits, 10);
27664
27664
  const reference = { type: types_1.types.REFERENCE, value };
@@ -27679,13 +27679,13 @@ var require_tokenizer = __commonJS({
27679
27679
  // Handle custom sets.
27680
27680
  case "[": {
27681
27681
  let not;
27682
- if (str[i] === "^") {
27682
+ if (str2[i] === "^") {
27683
27683
  not = true;
27684
27684
  i++;
27685
27685
  } else {
27686
27686
  not = false;
27687
27687
  }
27688
- let classTokens = util.tokenizeClass(str.slice(i), regexpStr);
27688
+ let classTokens = util.tokenizeClass(str2.slice(i), regexpStr);
27689
27689
  i += classTokens[1];
27690
27690
  last.push({
27691
27691
  type: types_1.types.SET,
@@ -27705,8 +27705,8 @@ var require_tokenizer = __commonJS({
27705
27705
  stack: [],
27706
27706
  remember: true
27707
27707
  };
27708
- if (str[i] === "?") {
27709
- c = str[i + 1];
27708
+ if (str2[i] === "?") {
27709
+ c = str2[i + 1];
27710
27710
  i += 2;
27711
27711
  if (c === "=") {
27712
27712
  group.followedBy = true;
@@ -27716,21 +27716,21 @@ var require_tokenizer = __commonJS({
27716
27716
  group.remember = false;
27717
27717
  } else if (c === "<") {
27718
27718
  let name = "";
27719
- if (captureGroupFirstChar.test(str[i])) {
27720
- name += str[i];
27719
+ if (captureGroupFirstChar.test(str2[i])) {
27720
+ name += str2[i];
27721
27721
  i++;
27722
27722
  } else {
27723
- throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Invalid capture group name, character '${str[i]}' after '<' at column ${i + 1}`);
27723
+ throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Invalid capture group name, character '${str2[i]}' after '<' at column ${i + 1}`);
27724
27724
  }
27725
- while (i < str.length && captureGroupChars.test(str[i])) {
27726
- name += str[i];
27725
+ while (i < str2.length && captureGroupChars.test(str2[i])) {
27726
+ name += str2[i];
27727
27727
  i++;
27728
27728
  }
27729
27729
  if (!name) {
27730
- throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Invalid capture group name, character '${str[i]}' after '<' at column ${i + 1}`);
27730
+ throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Invalid capture group name, character '${str2[i]}' after '<' at column ${i + 1}`);
27731
27731
  }
27732
- if (str[i] !== ">") {
27733
- throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Unclosed capture group name, expected '>', found '${str[i]}' at column ${i + 1}`);
27732
+ if (str2[i] !== ">") {
27733
+ throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Unclosed capture group name, expected '>', found '${str2[i]}' at column ${i + 1}`);
27734
27734
  }
27735
27735
  group.name = name;
27736
27736
  i++;
@@ -27773,7 +27773,7 @@ var require_tokenizer = __commonJS({
27773
27773
  // This design is chosen because there could be more than
27774
27774
  // one repetition symbols in a regex i.e. `a?+{2,3}`.
27775
27775
  case "{": {
27776
- let rs = /^(\d+)(,(\d+)?)?\}/.exec(str.slice(i)), min, max;
27776
+ let rs = /^(\d+)(,(\d+)?)?\}/.exec(str2.slice(i)), min, max;
27777
27777
  if (rs !== null) {
27778
27778
  if (last.length === 0) {
27779
27779
  repeatErr(i);
@@ -31737,25 +31737,25 @@ var require_dist4 = __commonJS({
31737
31737
  C.prototype = /* @__PURE__ */ Object.create(null);
31738
31738
  return C;
31739
31739
  })();
31740
- function parseCookie(str, options) {
31740
+ function parseCookie(str2, options) {
31741
31741
  const obj = new NullObject();
31742
- const len2 = str.length;
31742
+ const len2 = str2.length;
31743
31743
  if (len2 < 2)
31744
31744
  return obj;
31745
31745
  const dec = options?.decode || decode;
31746
31746
  let index = 0;
31747
31747
  do {
31748
- const eqIdx = eqIndex(str, index, len2);
31748
+ const eqIdx = eqIndex(str2, index, len2);
31749
31749
  if (eqIdx === -1)
31750
31750
  break;
31751
- const endIdx = endIndex(str, index, len2);
31751
+ const endIdx = endIndex(str2, index, len2);
31752
31752
  if (eqIdx > endIdx) {
31753
- index = str.lastIndexOf(";", eqIdx - 1) + 1;
31753
+ index = str2.lastIndexOf(";", eqIdx - 1) + 1;
31754
31754
  continue;
31755
31755
  }
31756
- const key = valueSlice(str, index, eqIdx);
31756
+ const key = valueSlice(str2, index, eqIdx);
31757
31757
  if (obj[key] === void 0) {
31758
- obj[key] = dec(valueSlice(str, eqIdx + 1, endIdx));
31758
+ obj[key] = dec(valueSlice(str2, eqIdx + 1, endIdx));
31759
31759
  }
31760
31760
  index = endIdx + 1;
31761
31761
  } while (index < len2);
@@ -31790,51 +31790,51 @@ var require_dist4 = __commonJS({
31790
31790
  if (!cookieValueRegExp.test(value)) {
31791
31791
  throw new TypeError(`argument val is invalid: ${cookie.value}`);
31792
31792
  }
31793
- let str = cookie.name + "=" + value;
31793
+ let str2 = cookie.name + "=" + value;
31794
31794
  if (cookie.maxAge !== void 0) {
31795
31795
  if (!Number.isInteger(cookie.maxAge)) {
31796
31796
  throw new TypeError(`option maxAge is invalid: ${cookie.maxAge}`);
31797
31797
  }
31798
- str += "; Max-Age=" + cookie.maxAge;
31798
+ str2 += "; Max-Age=" + cookie.maxAge;
31799
31799
  }
31800
31800
  if (cookie.domain) {
31801
31801
  if (!domainValueRegExp.test(cookie.domain)) {
31802
31802
  throw new TypeError(`option domain is invalid: ${cookie.domain}`);
31803
31803
  }
31804
- str += "; Domain=" + cookie.domain;
31804
+ str2 += "; Domain=" + cookie.domain;
31805
31805
  }
31806
31806
  if (cookie.path) {
31807
31807
  if (!pathValueRegExp.test(cookie.path)) {
31808
31808
  throw new TypeError(`option path is invalid: ${cookie.path}`);
31809
31809
  }
31810
- str += "; Path=" + cookie.path;
31810
+ str2 += "; Path=" + cookie.path;
31811
31811
  }
31812
31812
  if (cookie.expires) {
31813
31813
  if (!isDate(cookie.expires) || !Number.isFinite(cookie.expires.valueOf())) {
31814
31814
  throw new TypeError(`option expires is invalid: ${cookie.expires}`);
31815
31815
  }
31816
- str += "; Expires=" + cookie.expires.toUTCString();
31816
+ str2 += "; Expires=" + cookie.expires.toUTCString();
31817
31817
  }
31818
31818
  if (cookie.httpOnly) {
31819
- str += "; HttpOnly";
31819
+ str2 += "; HttpOnly";
31820
31820
  }
31821
31821
  if (cookie.secure) {
31822
- str += "; Secure";
31822
+ str2 += "; Secure";
31823
31823
  }
31824
31824
  if (cookie.partitioned) {
31825
- str += "; Partitioned";
31825
+ str2 += "; Partitioned";
31826
31826
  }
31827
31827
  if (cookie.priority) {
31828
31828
  const priority = typeof cookie.priority === "string" ? cookie.priority.toLowerCase() : void 0;
31829
31829
  switch (priority) {
31830
31830
  case "low":
31831
- str += "; Priority=Low";
31831
+ str2 += "; Priority=Low";
31832
31832
  break;
31833
31833
  case "medium":
31834
- str += "; Priority=Medium";
31834
+ str2 += "; Priority=Medium";
31835
31835
  break;
31836
31836
  case "high":
31837
- str += "; Priority=High";
31837
+ str2 += "; Priority=High";
31838
31838
  break;
31839
31839
  default:
31840
31840
  throw new TypeError(`option priority is invalid: ${cookie.priority}`);
@@ -31845,35 +31845,35 @@ var require_dist4 = __commonJS({
31845
31845
  switch (sameSite) {
31846
31846
  case true:
31847
31847
  case "strict":
31848
- str += "; SameSite=Strict";
31848
+ str2 += "; SameSite=Strict";
31849
31849
  break;
31850
31850
  case "lax":
31851
- str += "; SameSite=Lax";
31851
+ str2 += "; SameSite=Lax";
31852
31852
  break;
31853
31853
  case "none":
31854
- str += "; SameSite=None";
31854
+ str2 += "; SameSite=None";
31855
31855
  break;
31856
31856
  default:
31857
31857
  throw new TypeError(`option sameSite is invalid: ${cookie.sameSite}`);
31858
31858
  }
31859
31859
  }
31860
- return str;
31860
+ return str2;
31861
31861
  }
31862
- function parseSetCookie(str, options) {
31862
+ function parseSetCookie(str2, options) {
31863
31863
  const dec = options?.decode || decode;
31864
- const len2 = str.length;
31865
- const endIdx = endIndex(str, 0, len2);
31866
- const eqIdx = eqIndex(str, 0, endIdx);
31867
- const setCookie = eqIdx === -1 ? { name: "", value: dec(valueSlice(str, 0, endIdx)) } : {
31868
- name: valueSlice(str, 0, eqIdx),
31869
- value: dec(valueSlice(str, eqIdx + 1, endIdx))
31864
+ const len2 = str2.length;
31865
+ const endIdx = endIndex(str2, 0, len2);
31866
+ const eqIdx = eqIndex(str2, 0, endIdx);
31867
+ const setCookie = eqIdx === -1 ? { name: "", value: dec(valueSlice(str2, 0, endIdx)) } : {
31868
+ name: valueSlice(str2, 0, eqIdx),
31869
+ value: dec(valueSlice(str2, eqIdx + 1, endIdx))
31870
31870
  };
31871
31871
  let index = endIdx + 1;
31872
31872
  while (index < len2) {
31873
- const endIdx2 = endIndex(str, index, len2);
31874
- const eqIdx2 = eqIndex(str, index, endIdx2);
31875
- const attr = eqIdx2 === -1 ? valueSlice(str, index, endIdx2) : valueSlice(str, index, eqIdx2);
31876
- const val = eqIdx2 === -1 ? void 0 : valueSlice(str, eqIdx2 + 1, endIdx2);
31873
+ const endIdx2 = endIndex(str2, index, len2);
31874
+ const eqIdx2 = eqIndex(str2, index, endIdx2);
31875
+ const attr = eqIdx2 === -1 ? valueSlice(str2, index, endIdx2) : valueSlice(str2, index, eqIdx2);
31876
+ const val = eqIdx2 === -1 ? void 0 : valueSlice(str2, eqIdx2 + 1, endIdx2);
31877
31877
  switch (attr.toLowerCase()) {
31878
31878
  case "httponly":
31879
31879
  setCookie.httpOnly = true;
@@ -31922,37 +31922,37 @@ var require_dist4 = __commonJS({
31922
31922
  }
31923
31923
  return setCookie;
31924
31924
  }
31925
- function endIndex(str, min, len2) {
31926
- const index = str.indexOf(";", min);
31925
+ function endIndex(str2, min, len2) {
31926
+ const index = str2.indexOf(";", min);
31927
31927
  return index === -1 ? len2 : index;
31928
31928
  }
31929
- function eqIndex(str, min, max) {
31930
- const index = str.indexOf("=", min);
31929
+ function eqIndex(str2, min, max) {
31930
+ const index = str2.indexOf("=", min);
31931
31931
  return index < max ? index : -1;
31932
31932
  }
31933
- function valueSlice(str, min, max) {
31933
+ function valueSlice(str2, min, max) {
31934
31934
  let start = min;
31935
31935
  let end = max;
31936
31936
  do {
31937
- const code = str.charCodeAt(start);
31937
+ const code = str2.charCodeAt(start);
31938
31938
  if (code !== 32 && code !== 9)
31939
31939
  break;
31940
31940
  } while (++start < end);
31941
31941
  while (end > start) {
31942
- const code = str.charCodeAt(end - 1);
31942
+ const code = str2.charCodeAt(end - 1);
31943
31943
  if (code !== 32 && code !== 9)
31944
31944
  break;
31945
31945
  end--;
31946
31946
  }
31947
- return str.slice(start, end);
31947
+ return str2.slice(start, end);
31948
31948
  }
31949
- function decode(str) {
31950
- if (str.indexOf("%") === -1)
31951
- return str;
31949
+ function decode(str2) {
31950
+ if (str2.indexOf("%") === -1)
31951
+ return str2;
31952
31952
  try {
31953
- return decodeURIComponent(str);
31953
+ return decodeURIComponent(str2);
31954
31954
  } catch (e) {
31955
- return str;
31955
+ return str2;
31956
31956
  }
31957
31957
  }
31958
31958
  function isDate(val) {
@@ -32072,7 +32072,7 @@ var require_form_data = __commonJS({
32072
32072
  const boundary = `----formdata-${randomUUID5()}`;
32073
32073
  const prefix = `--${boundary}\r
32074
32074
  Content-Disposition: form-data`;
32075
- const escape2 = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22");
32075
+ const escape2 = (str2) => str2.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22");
32076
32076
  const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n");
32077
32077
  const linebreak = new Uint8Array([13, 10]);
32078
32078
  async function* asyncIterator() {
@@ -32318,8 +32318,8 @@ var require_set_cookie = __commonJS({
32318
32318
  function createNullObj() {
32319
32319
  return /* @__PURE__ */ Object.create(null);
32320
32320
  }
32321
- function isNonEmptyString(str) {
32322
- return typeof str === "string" && !!str.trim();
32321
+ function isNonEmptyString(str2) {
32322
+ return typeof str2 === "string" && !!str2.trim();
32323
32323
  }
32324
32324
  function parseString(setCookieValue, options) {
32325
32325
  var parts = setCookieValue.split(";").filter(isNonEmptyString);
@@ -32410,13 +32410,13 @@ var require_set_cookie = __commonJS({
32410
32410
  input = [input];
32411
32411
  }
32412
32412
  if (!options.map) {
32413
- return input.filter(isNonEmptyString).map(function(str) {
32414
- return parseString(str, options);
32413
+ return input.filter(isNonEmptyString).map(function(str2) {
32414
+ return parseString(str2, options);
32415
32415
  }).filter(Boolean);
32416
32416
  } else {
32417
32417
  var cookies = createNullObj();
32418
- return input.filter(isNonEmptyString).reduce(function(cookies2, str) {
32419
- var cookie = parseString(str, options);
32418
+ return input.filter(isNonEmptyString).reduce(function(cookies2, str2) {
32419
+ var cookie = parseString(str2, options);
32420
32420
  if (cookie && !isForbiddenKey(cookie.name)) {
32421
32421
  cookies2[cookie.name] = cookie;
32422
32422
  }
@@ -34476,38 +34476,38 @@ var require_commonjs = __commonJS({
34476
34476
  "use strict";
34477
34477
  Object.defineProperty(exports2, "__esModule", { value: true });
34478
34478
  exports2.range = exports2.balanced = void 0;
34479
- var balanced = (a, b, str) => {
34480
- const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
34481
- const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
34482
- const r = ma !== null && mb != null && (0, exports2.range)(ma, mb, str);
34479
+ var balanced = (a, b, str2) => {
34480
+ const ma = a instanceof RegExp ? maybeMatch(a, str2) : a;
34481
+ const mb = b instanceof RegExp ? maybeMatch(b, str2) : b;
34482
+ const r = ma !== null && mb != null && (0, exports2.range)(ma, mb, str2);
34483
34483
  return r && {
34484
34484
  start: r[0],
34485
34485
  end: r[1],
34486
- pre: str.slice(0, r[0]),
34487
- body: str.slice(r[0] + ma.length, r[1]),
34488
- post: str.slice(r[1] + mb.length)
34486
+ pre: str2.slice(0, r[0]),
34487
+ body: str2.slice(r[0] + ma.length, r[1]),
34488
+ post: str2.slice(r[1] + mb.length)
34489
34489
  };
34490
34490
  };
34491
34491
  exports2.balanced = balanced;
34492
- var maybeMatch = (reg2, str) => {
34493
- const m = str.match(reg2);
34492
+ var maybeMatch = (reg2, str2) => {
34493
+ const m = str2.match(reg2);
34494
34494
  return m ? m[0] : null;
34495
34495
  };
34496
- var range = (a, b, str) => {
34496
+ var range = (a, b, str2) => {
34497
34497
  let begs, beg, left, right = void 0, result;
34498
- let ai = str.indexOf(a);
34499
- let bi = str.indexOf(b, ai + 1);
34498
+ let ai = str2.indexOf(a);
34499
+ let bi = str2.indexOf(b, ai + 1);
34500
34500
  let i = ai;
34501
34501
  if (ai >= 0 && bi > 0) {
34502
34502
  if (a === b) {
34503
34503
  return [ai, bi];
34504
34504
  }
34505
34505
  begs = [];
34506
- left = str.length;
34506
+ left = str2.length;
34507
34507
  while (i >= 0 && !result) {
34508
34508
  if (i === ai) {
34509
34509
  begs.push(i);
34510
- ai = str.indexOf(a, i + 1);
34510
+ ai = str2.indexOf(a, i + 1);
34511
34511
  } else if (begs.length === 1) {
34512
34512
  const r = begs.pop();
34513
34513
  if (r !== void 0)
@@ -34518,7 +34518,7 @@ var require_commonjs = __commonJS({
34518
34518
  left = beg;
34519
34519
  right = bi;
34520
34520
  }
34521
- bi = str.indexOf(b, i + 1);
34521
+ bi = str2.indexOf(b, i + 1);
34522
34522
  }
34523
34523
  i = ai < bi && ai >= 0 ? ai : bi;
34524
34524
  }
@@ -34556,23 +34556,23 @@ var require_commonjs2 = __commonJS({
34556
34556
  var commaPattern = /\\,/g;
34557
34557
  var periodPattern = /\\\./g;
34558
34558
  exports2.EXPANSION_MAX = 1e5;
34559
- function numeric(str) {
34560
- return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
34559
+ function numeric(str2) {
34560
+ return !isNaN(str2) ? parseInt(str2, 10) : str2.charCodeAt(0);
34561
34561
  }
34562
- function escapeBraces(str) {
34563
- return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
34562
+ function escapeBraces(str2) {
34563
+ return str2.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
34564
34564
  }
34565
- function unescapeBraces(str) {
34566
- return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
34565
+ function unescapeBraces(str2) {
34566
+ return str2.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
34567
34567
  }
34568
- function parseCommaParts(str) {
34569
- if (!str) {
34568
+ function parseCommaParts(str2) {
34569
+ if (!str2) {
34570
34570
  return [""];
34571
34571
  }
34572
34572
  const parts = [];
34573
- const m = (0, balanced_match_1.balanced)("{", "}", str);
34573
+ const m = (0, balanced_match_1.balanced)("{", "}", str2);
34574
34574
  if (!m) {
34575
- return str.split(",");
34575
+ return str2.split(",");
34576
34576
  }
34577
34577
  const { pre, body, post } = m;
34578
34578
  const p = pre.split(",");
@@ -34586,18 +34586,18 @@ var require_commonjs2 = __commonJS({
34586
34586
  parts.push.apply(parts, p);
34587
34587
  return parts;
34588
34588
  }
34589
- function expand(str, options = {}) {
34590
- if (!str) {
34589
+ function expand(str2, options = {}) {
34590
+ if (!str2) {
34591
34591
  return [];
34592
34592
  }
34593
34593
  const { max = exports2.EXPANSION_MAX } = options;
34594
- if (str.slice(0, 2) === "{}") {
34595
- str = "\\{\\}" + str.slice(2);
34594
+ if (str2.slice(0, 2) === "{}") {
34595
+ str2 = "\\{\\}" + str2.slice(2);
34596
34596
  }
34597
- return expand_(escapeBraces(str), max, true).map(unescapeBraces);
34597
+ return expand_(escapeBraces(str2), max, true).map(unescapeBraces);
34598
34598
  }
34599
- function embrace(str) {
34600
- return "{" + str + "}";
34599
+ function embrace(str2) {
34600
+ return "{" + str2 + "}";
34601
34601
  }
34602
34602
  function isPadded(el) {
34603
34603
  return /^-?0\d/.test(el);
@@ -34608,11 +34608,11 @@ var require_commonjs2 = __commonJS({
34608
34608
  function gte(i, y) {
34609
34609
  return i >= y;
34610
34610
  }
34611
- function expand_(str, max, isTop) {
34611
+ function expand_(str2, max, isTop) {
34612
34612
  const expansions = [];
34613
- const m = (0, balanced_match_1.balanced)("{", "}", str);
34613
+ const m = (0, balanced_match_1.balanced)("{", "}", str2);
34614
34614
  if (!m)
34615
- return [str];
34615
+ return [str2];
34616
34616
  const pre = m.pre;
34617
34617
  const post = m.post.length ? expand_(m.post, max, false) : [""];
34618
34618
  if (/\$$/.test(m.pre)) {
@@ -34627,10 +34627,10 @@ var require_commonjs2 = __commonJS({
34627
34627
  const isOptions = m.body.indexOf(",") >= 0;
34628
34628
  if (!isSequence && !isOptions) {
34629
34629
  if (m.post.match(/,(?!,).*\}/)) {
34630
- str = m.pre + "{" + m.body + escClose + m.post;
34631
- return expand_(str, max, true);
34630
+ str2 = m.pre + "{" + m.body + escClose + m.post;
34631
+ return expand_(str2, max, true);
34632
34632
  }
34633
- return [str];
34633
+ return [str2];
34634
34634
  }
34635
34635
  let n;
34636
34636
  if (isSequence) {
@@ -35067,7 +35067,7 @@ var require_ast = __commonJS({
35067
35067
  }
35068
35068
  return c;
35069
35069
  }
35070
- static #parseAST(str, ast, pos2, opt, extDepth) {
35070
+ static #parseAST(str2, ast, pos2, opt, extDepth) {
35071
35071
  const maxDepth = opt.maxExtglobRecursion ?? 2;
35072
35072
  let escaping = false;
35073
35073
  let inBrace = false;
@@ -35076,8 +35076,8 @@ var require_ast = __commonJS({
35076
35076
  if (ast.type === null) {
35077
35077
  let i2 = pos2;
35078
35078
  let acc2 = "";
35079
- while (i2 < str.length) {
35080
- const c = str.charAt(i2++);
35079
+ while (i2 < str2.length) {
35080
+ const c = str2.charAt(i2++);
35081
35081
  if (escaping || c === "\\") {
35082
35082
  escaping = !escaping;
35083
35083
  acc2 += c;
@@ -35100,12 +35100,12 @@ var require_ast = __commonJS({
35100
35100
  acc2 += c;
35101
35101
  continue;
35102
35102
  }
35103
- const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth;
35103
+ const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i2) === "(" && extDepth <= maxDepth;
35104
35104
  if (doRecurse) {
35105
35105
  ast.push(acc2);
35106
35106
  acc2 = "";
35107
35107
  const ext = new _a2(c, ast);
35108
- i2 = _a2.#parseAST(str, ext, i2, opt, extDepth + 1);
35108
+ i2 = _a2.#parseAST(str2, ext, i2, opt, extDepth + 1);
35109
35109
  ast.push(ext);
35110
35110
  continue;
35111
35111
  }
@@ -35118,8 +35118,8 @@ var require_ast = __commonJS({
35118
35118
  let part = new _a2(null, ast);
35119
35119
  const parts = [];
35120
35120
  let acc = "";
35121
- while (i < str.length) {
35122
- const c = str.charAt(i++);
35121
+ while (i < str2.length) {
35122
+ const c = str2.charAt(i++);
35123
35123
  if (escaping || c === "\\") {
35124
35124
  escaping = !escaping;
35125
35125
  acc += c;
@@ -35142,7 +35142,7 @@ var require_ast = __commonJS({
35142
35142
  acc += c;
35143
35143
  continue;
35144
35144
  }
35145
- const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
35145
+ const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
35146
35146
  (extDepth <= maxDepth || ast && ast.#canAdoptType(c));
35147
35147
  if (doRecurse) {
35148
35148
  const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
@@ -35150,7 +35150,7 @@ var require_ast = __commonJS({
35150
35150
  acc = "";
35151
35151
  const ext = new _a2(c, part);
35152
35152
  part.push(ext);
35153
- i = _a2.#parseAST(str, ext, i, opt, extDepth + depthAdd);
35153
+ i = _a2.#parseAST(str2, ext, i, opt, extDepth + depthAdd);
35154
35154
  continue;
35155
35155
  }
35156
35156
  if (c === "|") {
@@ -35173,7 +35173,7 @@ var require_ast = __commonJS({
35173
35173
  }
35174
35174
  ast.type = null;
35175
35175
  ast.#hasMagic = void 0;
35176
- ast.#parts = [str.substring(pos2 - 1)];
35176
+ ast.#parts = [str2.substring(pos2 - 1)];
35177
35177
  return i;
35178
35178
  }
35179
35179
  #canAdoptWithSpace(child) {
@@ -40986,17 +40986,17 @@ var require_escape_html = __commonJS({
40986
40986
  var matchHtmlRegExp = /["'&<>]/;
40987
40987
  module2.exports = escapeHtml;
40988
40988
  function escapeHtml(string) {
40989
- var str = "" + string;
40990
- var match = matchHtmlRegExp.exec(str);
40989
+ var str2 = "" + string;
40990
+ var match = matchHtmlRegExp.exec(str2);
40991
40991
  if (!match) {
40992
- return str;
40992
+ return str2;
40993
40993
  }
40994
40994
  var escape2;
40995
40995
  var html = "";
40996
40996
  var index = 0;
40997
40997
  var lastIndex = 0;
40998
- for (index = match.index; index < str.length; index++) {
40999
- switch (str.charCodeAt(index)) {
40998
+ for (index = match.index; index < str2.length; index++) {
40999
+ switch (str2.charCodeAt(index)) {
41000
41000
  case 34:
41001
41001
  escape2 = "&quot;";
41002
41002
  break;
@@ -41016,12 +41016,12 @@ var require_escape_html = __commonJS({
41016
41016
  continue;
41017
41017
  }
41018
41018
  if (lastIndex !== index) {
41019
- html += str.substring(lastIndex, index);
41019
+ html += str2.substring(lastIndex, index);
41020
41020
  }
41021
41021
  lastIndex = index + 1;
41022
41022
  html += escape2;
41023
41023
  }
41024
- return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
41024
+ return lastIndex !== index ? html + str2.substring(lastIndex, index) : html;
41025
41025
  }
41026
41026
  }
41027
41027
  });
@@ -41036,24 +41036,24 @@ var require_dist5 = __commonJS({
41036
41036
  var DAY = HOUR * 24;
41037
41037
  var YEAR = DAY * 365.25;
41038
41038
  function parse(val) {
41039
- var num2, arr = val.toLowerCase().match(RGX);
41040
- if (arr != null && (num2 = parseFloat(arr[1]))) {
41041
- if (arr[3] != null) return num2 * SEC;
41042
- if (arr[4] != null) return num2 * MIN;
41043
- if (arr[5] != null) return num2 * HOUR;
41044
- if (arr[6] != null) return num2 * DAY;
41045
- if (arr[7] != null) return num2 * DAY * 7;
41046
- if (arr[8] != null) return num2 * YEAR;
41047
- return num2;
41048
- }
41049
- }
41050
- function fmt(val, pfx, str, long) {
41051
- var num2 = (val | 0) === val ? val : ~~(val + 0.5);
41052
- return pfx + num2 + (long ? " " + str + (num2 != 1 ? "s" : "") : str[0]);
41053
- }
41054
- function format(num2, long) {
41055
- var pfx = num2 < 0 ? "-" : "", abs = num2 < 0 ? -num2 : num2;
41056
- if (abs < SEC) return num2 + (long ? " ms" : "ms");
41039
+ var num3, arr = val.toLowerCase().match(RGX);
41040
+ if (arr != null && (num3 = parseFloat(arr[1]))) {
41041
+ if (arr[3] != null) return num3 * SEC;
41042
+ if (arr[4] != null) return num3 * MIN;
41043
+ if (arr[5] != null) return num3 * HOUR;
41044
+ if (arr[6] != null) return num3 * DAY;
41045
+ if (arr[7] != null) return num3 * DAY * 7;
41046
+ if (arr[8] != null) return num3 * YEAR;
41047
+ return num3;
41048
+ }
41049
+ }
41050
+ function fmt(val, pfx, str2, long) {
41051
+ var num3 = (val | 0) === val ? val : ~~(val + 0.5);
41052
+ return pfx + num3 + (long ? " " + str2 + (num3 != 1 ? "s" : "") : str2[0]);
41053
+ }
41054
+ function format(num3, long) {
41055
+ var pfx = num3 < 0 ? "-" : "", abs = num3 < 0 ? -num3 : num3;
41056
+ if (abs < SEC) return num3 + (long ? " ms" : "ms");
41057
41057
  if (abs < MIN) return fmt(abs / SEC, pfx, "second", long);
41058
41058
  if (abs < HOUR) return fmt(abs / MIN, pfx, "minute", long);
41059
41059
  if (abs < DAY) return fmt(abs / HOUR, pfx, "hour", long);
@@ -41069,13 +41069,13 @@ var require_dist5 = __commonJS({
41069
41069
  var require_collapseLeadingSlashes = __commonJS({
41070
41070
  "node_modules/@fastify/send/lib/collapseLeadingSlashes.js"(exports2, module2) {
41071
41071
  "use strict";
41072
- function collapseLeadingSlashes(str) {
41073
- if (str[0] !== "/" || str[1] !== "/") {
41074
- return str;
41072
+ function collapseLeadingSlashes(str2) {
41073
+ if (str2[0] !== "/" || str2[1] !== "/") {
41074
+ return str2;
41075
41075
  }
41076
- for (let i = 2, il = str.length; i < il; ++i) {
41077
- if (str[i] !== "/") {
41078
- return str.slice(i - 1);
41076
+ for (let i = 2, il = str2.length; i < il; ++i) {
41077
+ if (str2[i] !== "/") {
41078
+ return str2.slice(i - 1);
41079
41079
  }
41080
41080
  }
41081
41081
  }
@@ -41150,8 +41150,8 @@ var require_normalizeList = __commonJS({
41150
41150
  var require_parseBytesRange = __commonJS({
41151
41151
  "node_modules/@fastify/send/lib/parseBytesRange.js"(exports2, module2) {
41152
41152
  "use strict";
41153
- function parseBytesRange(size, str) {
41154
- const values = str.slice(str.indexOf("=") + 1);
41153
+ function parseBytesRange(size, str2) {
41154
+ const values = str2.slice(str2.indexOf("=") + 1);
41155
41155
  const ranges = [];
41156
41156
  const len2 = values.length;
41157
41157
  let i = 0;
@@ -41230,12 +41230,12 @@ var require_parseTokenList = __commonJS({
41230
41230
  "node_modules/@fastify/send/lib/parseTokenList.js"(exports2, module2) {
41231
41231
  "use strict";
41232
41232
  var slice = String.prototype.slice;
41233
- function parseTokenList(str, cb) {
41233
+ function parseTokenList(str2, cb) {
41234
41234
  let end = 0;
41235
41235
  let start = 0;
41236
41236
  let result;
41237
- for (let i = 0, len2 = str.length; i < len2; i++) {
41238
- switch (str.charCodeAt(i)) {
41237
+ for (let i = 0, len2 = str2.length; i < len2; i++) {
41238
+ switch (str2.charCodeAt(i)) {
41239
41239
  case 32:
41240
41240
  if (start === end) {
41241
41241
  start = end = i + 1;
@@ -41243,7 +41243,7 @@ var require_parseTokenList = __commonJS({
41243
41243
  break;
41244
41244
  case 44:
41245
41245
  if (start !== end) {
41246
- result = cb(slice.call(str, start, end));
41246
+ result = cb(slice.call(str2, start, end));
41247
41247
  if (result !== void 0) {
41248
41248
  return result;
41249
41249
  }
@@ -41256,7 +41256,7 @@ var require_parseTokenList = __commonJS({
41256
41256
  }
41257
41257
  }
41258
41258
  if (start !== end) {
41259
- return cb(slice.call(str, start, end));
41259
+ return cb(slice.call(str2, start, end));
41260
41260
  }
41261
41261
  }
41262
41262
  module2.exports.parseTokenList = parseTokenList;
@@ -41269,8 +41269,8 @@ var require_depd = __commonJS({
41269
41269
  var relative3 = require("path").relative;
41270
41270
  module2.exports = depd;
41271
41271
  var basePath = process.cwd();
41272
- function containsNamespace(str, namespace) {
41273
- var vals = str.split(/[ ,]+/);
41272
+ function containsNamespace(str2, namespace) {
41273
+ var vals = str2.split(/[ ,]+/);
41274
41274
  var ns = String(namespace).toLowerCase();
41275
41275
  for (var i = 0; i < vals.length; i++) {
41276
41276
  var val = vals[i];
@@ -41297,21 +41297,21 @@ var require_depd = __commonJS({
41297
41297
  return descriptor;
41298
41298
  }
41299
41299
  function createArgumentsString(arity) {
41300
- var str = "";
41300
+ var str2 = "";
41301
41301
  for (var i = 0; i < arity; i++) {
41302
- str += ", arg" + i;
41302
+ str2 += ", arg" + i;
41303
41303
  }
41304
- return str.substr(2);
41304
+ return str2.substr(2);
41305
41305
  }
41306
41306
  function createStackString(stack) {
41307
- var str = this.name + ": " + this.namespace;
41307
+ var str2 = this.name + ": " + this.namespace;
41308
41308
  if (this.message) {
41309
- str += " deprecated " + this.message;
41309
+ str2 += " deprecated " + this.message;
41310
41310
  }
41311
41311
  for (var i = 0; i < stack.length; i++) {
41312
- str += "\n at " + stack[i].toString();
41312
+ str2 += "\n at " + stack[i].toString();
41313
41313
  }
41314
- return str;
41314
+ return str2;
41315
41315
  }
41316
41316
  function depd(namespace) {
41317
41317
  if (!namespace) {
@@ -41340,15 +41340,15 @@ var require_depd = __commonJS({
41340
41340
  if (process.noDeprecation) {
41341
41341
  return true;
41342
41342
  }
41343
- var str = process.env.NO_DEPRECATION || "";
41344
- return containsNamespace(str, namespace);
41343
+ var str2 = process.env.NO_DEPRECATION || "";
41344
+ return containsNamespace(str2, namespace);
41345
41345
  }
41346
41346
  function istraced(namespace) {
41347
41347
  if (process.traceDeprecation) {
41348
41348
  return true;
41349
41349
  }
41350
- var str = process.env.TRACE_DEPRECATION || "";
41351
- return containsNamespace(str, namespace);
41350
+ var str2 = process.env.TRACE_DEPRECATION || "";
41351
+ return containsNamespace(str2, namespace);
41352
41352
  }
41353
41353
  function log2(message, site) {
41354
41354
  var haslisteners = eehaslisteners(process, "deprecation");
@@ -41782,8 +41782,8 @@ var require_toidentifier = __commonJS({
41782
41782
  "node_modules/toidentifier/index.js"(exports2, module2) {
41783
41783
  "use strict";
41784
41784
  module2.exports = toIdentifier;
41785
- function toIdentifier(str) {
41786
- return str.split(" ").map(function(token) {
41785
+ function toIdentifier(str2) {
41786
+ return str2.split(" ").map(function(token) {
41787
41787
  return token.slice(0, 1).toUpperCase() + token.slice(1);
41788
41788
  }).join("").replace(/[^ _0-9a-z]/gi, "");
41789
41789
  }
@@ -41991,7 +41991,7 @@ var require_send = __commonJS({
41991
41991
  var { parseTokenList } = require_parseTokenList();
41992
41992
  var { createHttpError } = require_createHttpError();
41993
41993
  var extname3 = path.extname;
41994
- var join33 = path.join;
41994
+ var join34 = path.join;
41995
41995
  var normalize2 = path.normalize;
41996
41996
  var resolve6 = path.resolve;
41997
41997
  var sep4 = path.sep;
@@ -42078,7 +42078,7 @@ var require_send = __commonJS({
42078
42078
  return { statusCode: 403 };
42079
42079
  }
42080
42080
  parts = path2.split(sep4);
42081
- path2 = normalize2(join33(root, path2));
42081
+ path2 = normalize2(join34(root, path2));
42082
42082
  } else {
42083
42083
  if (UP_PATH_REGEXP.test(path2)) {
42084
42084
  debug('malicious path "%s"', path2);
@@ -42361,7 +42361,7 @@ var require_send = __commonJS({
42361
42361
  let err2;
42362
42362
  for (let i = 0; i < options.index.length; i++) {
42363
42363
  const index = options.index[i];
42364
- const p = join33(path2, index);
42364
+ const p = join34(path2, index);
42365
42365
  const { error, stat: stat4 } = await tryStat(p);
42366
42366
  if (error) {
42367
42367
  err2 = error;
@@ -42521,7 +42521,7 @@ var require_accept_negotiator = __commonJS({
42521
42521
  var QUALITY = 2;
42522
42522
  var END = 3;
42523
42523
  function parse(header, processMatch) {
42524
- let str = "";
42524
+ let str2 = "";
42525
42525
  let quality;
42526
42526
  let state2 = BEGIN;
42527
42527
  for (let i = 0, il = header.length; i < il; ++i) {
@@ -42536,19 +42536,19 @@ var require_accept_negotiator = __commonJS({
42536
42536
  continue;
42537
42537
  } else if (char === ",") {
42538
42538
  if (state2 === TOKEN) {
42539
- if (processMatch(str, 1)) {
42539
+ if (processMatch(str2, 1)) {
42540
42540
  state2 = END;
42541
42541
  break;
42542
42542
  }
42543
42543
  state2 = BEGIN;
42544
- str = "";
42544
+ str2 = "";
42545
42545
  } else if (state2 === QUALITY) {
42546
- if (processMatch(str, parseFloat(quality) || 0)) {
42546
+ if (processMatch(str2, parseFloat(quality) || 0)) {
42547
42547
  state2 = END;
42548
42548
  break;
42549
42549
  }
42550
42550
  state2 = BEGIN;
42551
- str = "";
42551
+ str2 = "";
42552
42552
  quality = "";
42553
42553
  }
42554
42554
  continue;
@@ -42561,29 +42561,29 @@ var require_accept_negotiator = __commonJS({
42561
42561
  }
42562
42562
  } else if (state2 === BEGIN) {
42563
42563
  state2 = TOKEN;
42564
- str += char;
42564
+ str2 += char;
42565
42565
  continue;
42566
42566
  }
42567
42567
  if (state2 === TOKEN) {
42568
42568
  const prevChar = header[i - 1];
42569
42569
  if (prevChar === " " || prevChar === " ") {
42570
- str = "";
42570
+ str2 = "";
42571
42571
  }
42572
- str += char;
42572
+ str2 += char;
42573
42573
  continue;
42574
42574
  }
42575
- if (processMatch(str, parseFloat(quality) || 0)) {
42575
+ if (processMatch(str2, parseFloat(quality) || 0)) {
42576
42576
  state2 = END;
42577
42577
  break;
42578
42578
  }
42579
42579
  state2 = BEGIN;
42580
- str = char;
42580
+ str2 = char;
42581
42581
  quality = "";
42582
42582
  }
42583
42583
  if (state2 === TOKEN) {
42584
- processMatch(str, 1);
42584
+ processMatch(str2, 1);
42585
42585
  } else if (state2 === QUALITY) {
42586
- processMatch(str, parseFloat(quality) || 0);
42586
+ processMatch(str2, parseFloat(quality) || 0);
42587
42587
  }
42588
42588
  }
42589
42589
  module2.exports = negotiate;
@@ -42723,8 +42723,8 @@ var require_content_disposition = __commonJS({
42723
42723
  }
42724
42724
  return string;
42725
42725
  }
42726
- function decodefield(str) {
42727
- var match = EXT_VALUE_REGEXP.exec(str);
42726
+ function decodefield(str2) {
42727
+ var match = EXT_VALUE_REGEXP.exec(str2);
42728
42728
  if (!match) {
42729
42729
  throw new TypeError("invalid extended field value");
42730
42730
  }
@@ -42792,19 +42792,19 @@ var require_content_disposition = __commonJS({
42792
42792
  }
42793
42793
  return new ContentDisposition(type, params);
42794
42794
  }
42795
- function pdecode(str, hex) {
42795
+ function pdecode(str2, hex) {
42796
42796
  return String.fromCharCode(parseInt(hex, 16));
42797
42797
  }
42798
42798
  function pencode(char) {
42799
42799
  return "%" + String(char).charCodeAt(0).toString(16).toUpperCase();
42800
42800
  }
42801
42801
  function qstring(val) {
42802
- var str = String(val);
42803
- return '"' + str.replace(QUOTE_REGEXP, "\\$1") + '"';
42802
+ var str2 = String(val);
42803
+ return '"' + str2.replace(QUOTE_REGEXP, "\\$1") + '"';
42804
42804
  }
42805
42805
  function ustring(val) {
42806
- var str = String(val);
42807
- var encoded = encodeURIComponent(str).replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode);
42806
+ var str2 = String(val);
42807
+ var encoded = encodeURIComponent(str2).replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode);
42808
42808
  return "UTF-8''" + encoded;
42809
42809
  }
42810
42810
  function ContentDisposition(type, parameters) {
@@ -44386,13 +44386,13 @@ var require_Collection = __commonJS({
44386
44386
  var require_stringifyComment = __commonJS({
44387
44387
  "node_modules/yaml/dist/stringify/stringifyComment.js"(exports2) {
44388
44388
  "use strict";
44389
- var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
44389
+ var stringifyComment = (str2) => str2.replace(/^(?!$)(?: $)?/gm, "#");
44390
44390
  function indentComment(comment, indent) {
44391
44391
  if (/^\n+$/.test(comment))
44392
44392
  return comment.substring(1);
44393
44393
  return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;
44394
44394
  }
44395
- var lineComment = (str, indent, comment) => str.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str.endsWith(" ") ? "" : " ") + comment;
44395
+ var lineComment = (str2, indent, comment) => str2.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str2.endsWith(" ") ? "" : " ") + comment;
44396
44396
  exports2.indentComment = indentComment;
44397
44397
  exports2.lineComment = lineComment;
44398
44398
  exports2.stringifyComment = stringifyComment;
@@ -44546,16 +44546,16 @@ var require_stringifyString = __commonJS({
44546
44546
  lineWidth: ctx.options.lineWidth,
44547
44547
  minContentWidth: ctx.options.minContentWidth
44548
44548
  });
44549
- var containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str);
44550
- function lineLengthOverLimit(str, lineWidth, indentLength) {
44549
+ var containsDocumentMarker = (str2) => /^(%|---|\.\.\.)/m.test(str2);
44550
+ function lineLengthOverLimit(str2, lineWidth, indentLength) {
44551
44551
  if (!lineWidth || lineWidth < 0)
44552
44552
  return false;
44553
44553
  const limit = lineWidth - indentLength;
44554
- const strLen = str.length;
44554
+ const strLen = str2.length;
44555
44555
  if (strLen <= limit)
44556
44556
  return false;
44557
44557
  for (let i = 0, start = 0; i < strLen; ++i) {
44558
- if (str[i] === "\n") {
44558
+ if (str2[i] === "\n") {
44559
44559
  if (i - start > limit)
44560
44560
  return true;
44561
44561
  start = i + 1;
@@ -44572,11 +44572,11 @@ var require_stringifyString = __commonJS({
44572
44572
  const { implicitKey } = ctx;
44573
44573
  const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
44574
44574
  const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
44575
- let str = "";
44575
+ let str2 = "";
44576
44576
  let start = 0;
44577
44577
  for (let i = 0, ch2 = json[i]; ch2; ch2 = json[++i]) {
44578
44578
  if (ch2 === " " && json[i + 1] === "\\" && json[i + 2] === "n") {
44579
- str += json.slice(start, i) + "\\ ";
44579
+ str2 += json.slice(start, i) + "\\ ";
44580
44580
  i += 1;
44581
44581
  start = i;
44582
44582
  ch2 = "\\";
@@ -44585,38 +44585,38 @@ var require_stringifyString = __commonJS({
44585
44585
  switch (json[i + 1]) {
44586
44586
  case "u":
44587
44587
  {
44588
- str += json.slice(start, i);
44588
+ str2 += json.slice(start, i);
44589
44589
  const code = json.substr(i + 2, 4);
44590
44590
  switch (code) {
44591
44591
  case "0000":
44592
- str += "\\0";
44592
+ str2 += "\\0";
44593
44593
  break;
44594
44594
  case "0007":
44595
- str += "\\a";
44595
+ str2 += "\\a";
44596
44596
  break;
44597
44597
  case "000b":
44598
- str += "\\v";
44598
+ str2 += "\\v";
44599
44599
  break;
44600
44600
  case "001b":
44601
- str += "\\e";
44601
+ str2 += "\\e";
44602
44602
  break;
44603
44603
  case "0085":
44604
- str += "\\N";
44604
+ str2 += "\\N";
44605
44605
  break;
44606
44606
  case "00a0":
44607
- str += "\\_";
44607
+ str2 += "\\_";
44608
44608
  break;
44609
44609
  case "2028":
44610
- str += "\\L";
44610
+ str2 += "\\L";
44611
44611
  break;
44612
44612
  case "2029":
44613
- str += "\\P";
44613
+ str2 += "\\P";
44614
44614
  break;
44615
44615
  default:
44616
44616
  if (code.substr(0, 2) === "00")
44617
- str += "\\x" + code.substr(2);
44617
+ str2 += "\\x" + code.substr(2);
44618
44618
  else
44619
- str += json.substr(i, 6);
44619
+ str2 += json.substr(i, 6);
44620
44620
  }
44621
44621
  i += 5;
44622
44622
  start = i + 1;
@@ -44626,14 +44626,14 @@ var require_stringifyString = __commonJS({
44626
44626
  if (implicitKey || json[i + 2] === '"' || json.length < minMultiLineLength) {
44627
44627
  i += 1;
44628
44628
  } else {
44629
- str += json.slice(start, i) + "\n\n";
44629
+ str2 += json.slice(start, i) + "\n\n";
44630
44630
  while (json[i + 2] === "\\" && json[i + 3] === "n" && json[i + 4] !== '"') {
44631
- str += "\n";
44631
+ str2 += "\n";
44632
44632
  i += 2;
44633
44633
  }
44634
- str += indent;
44634
+ str2 += indent;
44635
44635
  if (json[i + 2] === " ")
44636
- str += "\\";
44636
+ str2 += "\\";
44637
44637
  i += 1;
44638
44638
  start = i + 1;
44639
44639
  }
@@ -44642,8 +44642,8 @@ var require_stringifyString = __commonJS({
44642
44642
  i += 1;
44643
44643
  }
44644
44644
  }
44645
- str = start ? str + json.slice(start) : json;
44646
- return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
44645
+ str2 = start ? str2 + json.slice(start) : json;
44646
+ return implicitKey ? str2 : foldFlowLines.foldFlowLines(str2, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
44647
44647
  }
44648
44648
  function singleQuotedString(value, ctx) {
44649
44649
  if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value))
@@ -44771,15 +44771,15 @@ ${indent}${start}${value}${end}`;
44771
44771
  return quotedString(value, ctx);
44772
44772
  }
44773
44773
  }
44774
- const str = value.replace(/\n+/g, `$&
44774
+ const str2 = value.replace(/\n+/g, `$&
44775
44775
  ${indent}`);
44776
44776
  if (actualString) {
44777
- const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str);
44777
+ const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str2);
44778
44778
  const { compat, tags } = ctx.doc.schema;
44779
44779
  if (tags.some(test) || compat?.some(test))
44780
44780
  return quotedString(value, ctx);
44781
44781
  }
44782
- return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
44782
+ return implicitKey ? str2 : foldFlowLines.foldFlowLines(str2, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
44783
44783
  }
44784
44784
  function stringifyString(item, ctx, onComment, onChompKeep) {
44785
44785
  const { implicitKey, inFlow } = ctx;
@@ -44931,11 +44931,11 @@ var require_stringify2 = __commonJS({
44931
44931
  const props = stringifyProps(node, tagObj, ctx);
44932
44932
  if (props.length > 0)
44933
44933
  ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
44934
- 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);
44934
+ 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);
44935
44935
  if (!props)
44936
- return str;
44937
- return identity.isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props}
44938
- ${ctx.indent}${str}`;
44936
+ return str2;
44937
+ return identity.isScalar(node) || str2[0] === "{" || str2[0] === "[" ? `${props} ${str2}` : `${props}
44938
+ ${ctx.indent}${str2}`;
44939
44939
  }
44940
44940
  exports2.createStringifyContext = createStringifyContext;
44941
44941
  exports2.stringify = stringify;
@@ -44970,8 +44970,8 @@ var require_stringifyPair = __commonJS({
44970
44970
  });
44971
44971
  let keyCommentDone = false;
44972
44972
  let chompKeep = false;
44973
- let str = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
44974
- if (!explicitKey && !ctx.inFlow && str.length > 1024) {
44973
+ let str2 = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
44974
+ if (!explicitKey && !ctx.inFlow && str2.length > 1024) {
44975
44975
  if (simpleKeys)
44976
44976
  throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
44977
44977
  explicitKey = true;
@@ -44980,27 +44980,27 @@ var require_stringifyPair = __commonJS({
44980
44980
  if (allNullValues || value == null) {
44981
44981
  if (keyCommentDone && onComment)
44982
44982
  onComment();
44983
- return str === "" ? "?" : explicitKey ? `? ${str}` : str;
44983
+ return str2 === "" ? "?" : explicitKey ? `? ${str2}` : str2;
44984
44984
  }
44985
44985
  } else if (allNullValues && !simpleKeys || value == null && explicitKey) {
44986
- str = `? ${str}`;
44986
+ str2 = `? ${str2}`;
44987
44987
  if (keyComment && !keyCommentDone) {
44988
- str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
44988
+ str2 += stringifyComment.lineComment(str2, ctx.indent, commentString(keyComment));
44989
44989
  } else if (chompKeep && onChompKeep)
44990
44990
  onChompKeep();
44991
- return str;
44991
+ return str2;
44992
44992
  }
44993
44993
  if (keyCommentDone)
44994
44994
  keyComment = null;
44995
44995
  if (explicitKey) {
44996
44996
  if (keyComment)
44997
- str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
44998
- str = `? ${str}
44997
+ str2 += stringifyComment.lineComment(str2, ctx.indent, commentString(keyComment));
44998
+ str2 = `? ${str2}
44999
44999
  ${indent}:`;
45000
45000
  } else {
45001
- str = `${str}:`;
45001
+ str2 = `${str2}:`;
45002
45002
  if (keyComment)
45003
- str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
45003
+ str2 += stringifyComment.lineComment(str2, ctx.indent, commentString(keyComment));
45004
45004
  }
45005
45005
  let vsb, vcb, valueComment;
45006
45006
  if (identity.isNode(value)) {
@@ -45016,7 +45016,7 @@ ${indent}:`;
45016
45016
  }
45017
45017
  ctx.implicitKey = false;
45018
45018
  if (!explicitKey && !keyComment && identity.isScalar(value))
45019
- ctx.indentAtStart = str.length + 1;
45019
+ ctx.indentAtStart = str2.length + 1;
45020
45020
  chompKeep = false;
45021
45021
  if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity.isSeq(value) && !value.flow && !value.tag && !value.anchor) {
45022
45022
  ctx.indent = ctx.indent.substring(2);
@@ -45060,16 +45060,16 @@ ${ctx.indent}`;
45060
45060
  } else if (valueStr === "" || valueStr[0] === "\n") {
45061
45061
  ws = "";
45062
45062
  }
45063
- str += ws + valueStr;
45063
+ str2 += ws + valueStr;
45064
45064
  if (ctx.inFlow) {
45065
45065
  if (valueCommentDone && onComment)
45066
45066
  onComment();
45067
45067
  } else if (valueComment && !valueCommentDone) {
45068
- str += stringifyComment.lineComment(str, ctx.indent, commentString(valueComment));
45068
+ str2 += stringifyComment.lineComment(str2, ctx.indent, commentString(valueComment));
45069
45069
  } else if (chompKeep && onChompKeep) {
45070
45070
  onChompKeep();
45071
45071
  }
45072
- return str;
45072
+ return str2;
45073
45073
  }
45074
45074
  exports2.stringifyPair = stringifyPair;
45075
45075
  }
@@ -45296,31 +45296,31 @@ var require_stringifyCollection = __commonJS({
45296
45296
  }
45297
45297
  }
45298
45298
  chompKeep = false;
45299
- let str2 = stringify.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
45299
+ let str3 = stringify.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
45300
45300
  if (comment2)
45301
- str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2));
45301
+ str3 += stringifyComment.lineComment(str3, itemIndent, commentString(comment2));
45302
45302
  if (chompKeep && comment2)
45303
45303
  chompKeep = false;
45304
- lines.push(blockItemPrefix + str2);
45304
+ lines.push(blockItemPrefix + str3);
45305
45305
  }
45306
- let str;
45306
+ let str2;
45307
45307
  if (lines.length === 0) {
45308
- str = flowChars.start + flowChars.end;
45308
+ str2 = flowChars.start + flowChars.end;
45309
45309
  } else {
45310
- str = lines[0];
45310
+ str2 = lines[0];
45311
45311
  for (let i = 1; i < lines.length; ++i) {
45312
45312
  const line = lines[i];
45313
- str += line ? `
45313
+ str2 += line ? `
45314
45314
  ${indent}${line}` : "\n";
45315
45315
  }
45316
45316
  }
45317
45317
  if (comment) {
45318
- str += "\n" + stringifyComment.indentComment(commentString(comment), indent);
45318
+ str2 += "\n" + stringifyComment.indentComment(commentString(comment), indent);
45319
45319
  if (onComment)
45320
45320
  onComment();
45321
45321
  } else if (chompKeep && onChompKeep)
45322
45322
  onChompKeep();
45323
- return str;
45323
+ return str2;
45324
45324
  }
45325
45325
  function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
45326
45326
  const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
@@ -45363,21 +45363,21 @@ ${indent}${line}` : "\n";
45363
45363
  }
45364
45364
  if (comment)
45365
45365
  reqNewline = true;
45366
- let str = stringify.stringify(item, itemCtx, () => comment = null);
45367
- reqNewline || (reqNewline = lines.length > linesAtValue || str.includes("\n"));
45366
+ let str2 = stringify.stringify(item, itemCtx, () => comment = null);
45367
+ reqNewline || (reqNewline = lines.length > linesAtValue || str2.includes("\n"));
45368
45368
  if (i < items.length - 1) {
45369
- str += ",";
45369
+ str2 += ",";
45370
45370
  } else if (ctx.options.trailingComma) {
45371
45371
  if (ctx.options.lineWidth > 0) {
45372
- reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str.length + 2) > ctx.options.lineWidth);
45372
+ reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str2.length + 2) > ctx.options.lineWidth);
45373
45373
  }
45374
45374
  if (reqNewline) {
45375
- str += ",";
45375
+ str2 += ",";
45376
45376
  }
45377
45377
  }
45378
45378
  if (comment)
45379
- str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
45380
- lines.push(str);
45379
+ str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment));
45380
+ lines.push(str2);
45381
45381
  linesAtValue = lines.length;
45382
45382
  }
45383
45383
  const { start, end } = flowChars;
@@ -45389,11 +45389,11 @@ ${indent}${line}` : "\n";
45389
45389
  reqNewline = ctx.options.lineWidth > 0 && len2 > ctx.options.lineWidth;
45390
45390
  }
45391
45391
  if (reqNewline) {
45392
- let str = start;
45392
+ let str2 = start;
45393
45393
  for (const line of lines)
45394
- str += line ? `
45394
+ str2 += line ? `
45395
45395
  ${indentStep}${indent}${line}` : "\n";
45396
- return `${str}
45396
+ return `${str2}
45397
45397
  ${indent}${end}`;
45398
45398
  } else {
45399
45399
  return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`;
@@ -45725,7 +45725,7 @@ var require_string = __commonJS({
45725
45725
  identify: (value) => typeof value === "string",
45726
45726
  default: true,
45727
45727
  tag: "tag:yaml.org,2002:str",
45728
- resolve: (str) => str,
45728
+ resolve: (str2) => str2,
45729
45729
  stringify(item, ctx, onComment, onChompKeep) {
45730
45730
  ctx = Object.assign({ actualString: true }, ctx);
45731
45731
  return stringifyString.stringifyString(item, ctx, onComment, onChompKeep);
@@ -45763,7 +45763,7 @@ var require_bool = __commonJS({
45763
45763
  default: true,
45764
45764
  tag: "tag:yaml.org,2002:bool",
45765
45765
  test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
45766
- resolve: (str) => new Scalar.Scalar(str[0] === "t" || str[0] === "T"),
45766
+ resolve: (str2) => new Scalar.Scalar(str2[0] === "t" || str2[0] === "T"),
45767
45767
  stringify({ source, value }, ctx) {
45768
45768
  if (source && boolTag.test.test(source)) {
45769
45769
  const sv = source[0] === "t" || source[0] === "T";
@@ -45784,9 +45784,9 @@ var require_stringifyNumber = __commonJS({
45784
45784
  function stringifyNumber({ format, minFractionDigits, tag, value }) {
45785
45785
  if (typeof value === "bigint")
45786
45786
  return String(value);
45787
- const num2 = typeof value === "number" ? value : Number(value);
45788
- if (!isFinite(num2))
45789
- return isNaN(num2) ? ".nan" : num2 < 0 ? "-.inf" : ".inf";
45787
+ const num3 = typeof value === "number" ? value : Number(value);
45788
+ if (!isFinite(num3))
45789
+ return isNaN(num3) ? ".nan" : num3 < 0 ? "-.inf" : ".inf";
45790
45790
  let n = Object.is(value, -0) ? "-0" : JSON.stringify(value);
45791
45791
  if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^-?\d/.test(n) && !n.includes("e")) {
45792
45792
  let i = n.indexOf(".");
@@ -45815,7 +45815,7 @@ var require_float = __commonJS({
45815
45815
  default: true,
45816
45816
  tag: "tag:yaml.org,2002:float",
45817
45817
  test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
45818
- resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
45818
+ resolve: (str2) => str2.slice(-3).toLowerCase() === "nan" ? NaN : str2[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
45819
45819
  stringify: stringifyNumber.stringifyNumber
45820
45820
  };
45821
45821
  var floatExp = {
@@ -45824,10 +45824,10 @@ var require_float = __commonJS({
45824
45824
  tag: "tag:yaml.org,2002:float",
45825
45825
  format: "EXP",
45826
45826
  test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
45827
- resolve: (str) => parseFloat(str),
45827
+ resolve: (str2) => parseFloat(str2),
45828
45828
  stringify(node) {
45829
- const num2 = Number(node.value);
45830
- return isFinite(num2) ? num2.toExponential() : stringifyNumber.stringifyNumber(node);
45829
+ const num3 = Number(node.value);
45830
+ return isFinite(num3) ? num3.toExponential() : stringifyNumber.stringifyNumber(node);
45831
45831
  }
45832
45832
  };
45833
45833
  var float = {
@@ -45835,11 +45835,11 @@ var require_float = __commonJS({
45835
45835
  default: true,
45836
45836
  tag: "tag:yaml.org,2002:float",
45837
45837
  test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
45838
- resolve(str) {
45839
- const node = new Scalar.Scalar(parseFloat(str));
45840
- const dot = str.indexOf(".");
45841
- if (dot !== -1 && str[str.length - 1] === "0")
45842
- node.minFractionDigits = str.length - dot - 1;
45838
+ resolve(str2) {
45839
+ const node = new Scalar.Scalar(parseFloat(str2));
45840
+ const dot = str2.indexOf(".");
45841
+ if (dot !== -1 && str2[str2.length - 1] === "0")
45842
+ node.minFractionDigits = str2.length - dot - 1;
45843
45843
  return node;
45844
45844
  },
45845
45845
  stringify: stringifyNumber.stringifyNumber
@@ -45856,7 +45856,7 @@ var require_int = __commonJS({
45856
45856
  "use strict";
45857
45857
  var stringifyNumber = require_stringifyNumber();
45858
45858
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
45859
- var intResolve = (str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix);
45859
+ var intResolve = (str2, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str2) : parseInt(str2.substring(offset), radix);
45860
45860
  function intStringify(node, radix, prefix) {
45861
45861
  const { value } = node;
45862
45862
  if (intIdentify(value) && value >= 0)
@@ -45869,7 +45869,7 @@ var require_int = __commonJS({
45869
45869
  tag: "tag:yaml.org,2002:int",
45870
45870
  format: "OCT",
45871
45871
  test: /^0o[0-7]+$/,
45872
- resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt),
45872
+ resolve: (str2, _onError, opt) => intResolve(str2, 2, 8, opt),
45873
45873
  stringify: (node) => intStringify(node, 8, "0o")
45874
45874
  };
45875
45875
  var int = {
@@ -45877,7 +45877,7 @@ var require_int = __commonJS({
45877
45877
  default: true,
45878
45878
  tag: "tag:yaml.org,2002:int",
45879
45879
  test: /^[-+]?[0-9]+$/,
45880
- resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),
45880
+ resolve: (str2, _onError, opt) => intResolve(str2, 0, 10, opt),
45881
45881
  stringify: stringifyNumber.stringifyNumber
45882
45882
  };
45883
45883
  var intHex = {
@@ -45886,7 +45886,7 @@ var require_int = __commonJS({
45886
45886
  tag: "tag:yaml.org,2002:int",
45887
45887
  format: "HEX",
45888
45888
  test: /^0x[0-9a-fA-F]+$/,
45889
- resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),
45889
+ resolve: (str2, _onError, opt) => intResolve(str2, 2, 16, opt),
45890
45890
  stringify: (node) => intStringify(node, 16, "0x")
45891
45891
  };
45892
45892
  exports2.int = int;
@@ -45939,7 +45939,7 @@ var require_schema2 = __commonJS({
45939
45939
  identify: (value) => typeof value === "string",
45940
45940
  default: true,
45941
45941
  tag: "tag:yaml.org,2002:str",
45942
- resolve: (str) => str,
45942
+ resolve: (str2) => str2,
45943
45943
  stringify: stringifyJSON
45944
45944
  },
45945
45945
  {
@@ -45956,7 +45956,7 @@ var require_schema2 = __commonJS({
45956
45956
  default: true,
45957
45957
  tag: "tag:yaml.org,2002:bool",
45958
45958
  test: /^true$|^false$/,
45959
- resolve: (str) => str === "true",
45959
+ resolve: (str2) => str2 === "true",
45960
45960
  stringify: stringifyJSON
45961
45961
  },
45962
45962
  {
@@ -45964,7 +45964,7 @@ var require_schema2 = __commonJS({
45964
45964
  default: true,
45965
45965
  tag: "tag:yaml.org,2002:int",
45966
45966
  test: /^-?(?:0|[1-9][0-9]*)$/,
45967
- resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),
45967
+ resolve: (str2, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str2) : parseInt(str2, 10),
45968
45968
  stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)
45969
45969
  },
45970
45970
  {
@@ -45972,7 +45972,7 @@ var require_schema2 = __commonJS({
45972
45972
  default: true,
45973
45973
  tag: "tag:yaml.org,2002:float",
45974
45974
  test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
45975
- resolve: (str) => parseFloat(str),
45975
+ resolve: (str2) => parseFloat(str2),
45976
45976
  stringify: stringifyJSON
45977
45977
  }
45978
45978
  ];
@@ -45980,9 +45980,9 @@ var require_schema2 = __commonJS({
45980
45980
  default: true,
45981
45981
  tag: "",
45982
45982
  test: /^/,
45983
- resolve(str, onError) {
45984
- onError(`Unresolved plain scalar ${JSON.stringify(str)}`);
45985
- return str;
45983
+ resolve(str2, onError) {
45984
+ onError(`Unresolved plain scalar ${JSON.stringify(str2)}`);
45985
+ return str2;
45986
45986
  }
45987
45987
  };
45988
45988
  var schema = [map.map, seq.seq].concat(jsonScalars, jsonError);
@@ -46014,10 +46014,10 @@ var require_binary = __commonJS({
46014
46014
  if (typeof node_buffer.Buffer === "function") {
46015
46015
  return node_buffer.Buffer.from(src, "base64");
46016
46016
  } else if (typeof atob === "function") {
46017
- const str = atob(src.replace(/[\n\r]/g, ""));
46018
- const buffer = new Uint8Array(str.length);
46019
- for (let i = 0; i < str.length; ++i)
46020
- buffer[i] = str.charCodeAt(i);
46017
+ const str2 = atob(src.replace(/[\n\r]/g, ""));
46018
+ const buffer = new Uint8Array(str2.length);
46019
+ for (let i = 0; i < str2.length; ++i)
46020
+ buffer[i] = str2.charCodeAt(i);
46021
46021
  return buffer;
46022
46022
  } else {
46023
46023
  onError("This environment does not support reading binary tags; either Buffer or atob is required");
@@ -46028,28 +46028,28 @@ var require_binary = __commonJS({
46028
46028
  if (!value)
46029
46029
  return "";
46030
46030
  const buf = value;
46031
- let str;
46031
+ let str2;
46032
46032
  if (typeof node_buffer.Buffer === "function") {
46033
- str = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64");
46033
+ str2 = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64");
46034
46034
  } else if (typeof btoa === "function") {
46035
46035
  let s = "";
46036
46036
  for (let i = 0; i < buf.length; ++i)
46037
46037
  s += String.fromCharCode(buf[i]);
46038
- str = btoa(s);
46038
+ str2 = btoa(s);
46039
46039
  } else {
46040
46040
  throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
46041
46041
  }
46042
46042
  type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
46043
46043
  if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
46044
46044
  const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
46045
- const n = Math.ceil(str.length / lineWidth);
46045
+ const n = Math.ceil(str2.length / lineWidth);
46046
46046
  const lines = new Array(n);
46047
46047
  for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {
46048
- lines[i] = str.substr(o, lineWidth);
46048
+ lines[i] = str2.substr(o, lineWidth);
46049
46049
  }
46050
- str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " ");
46050
+ str2 = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " ");
46051
46051
  }
46052
- return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
46052
+ return stringifyString.stringifyString({ comment, type, value: str2 }, ctx, onComment, onChompKeep);
46053
46053
  }
46054
46054
  };
46055
46055
  exports2.binary = binary;
@@ -46255,7 +46255,7 @@ var require_float2 = __commonJS({
46255
46255
  default: true,
46256
46256
  tag: "tag:yaml.org,2002:float",
46257
46257
  test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
46258
- resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
46258
+ resolve: (str2) => str2.slice(-3).toLowerCase() === "nan" ? NaN : str2[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
46259
46259
  stringify: stringifyNumber.stringifyNumber
46260
46260
  };
46261
46261
  var floatExp = {
@@ -46264,10 +46264,10 @@ var require_float2 = __commonJS({
46264
46264
  tag: "tag:yaml.org,2002:float",
46265
46265
  format: "EXP",
46266
46266
  test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
46267
- resolve: (str) => parseFloat(str.replace(/_/g, "")),
46267
+ resolve: (str2) => parseFloat(str2.replace(/_/g, "")),
46268
46268
  stringify(node) {
46269
- const num2 = Number(node.value);
46270
- return isFinite(num2) ? num2.toExponential() : stringifyNumber.stringifyNumber(node);
46269
+ const num3 = Number(node.value);
46270
+ return isFinite(num3) ? num3.toExponential() : stringifyNumber.stringifyNumber(node);
46271
46271
  }
46272
46272
  };
46273
46273
  var float = {
@@ -46275,11 +46275,11 @@ var require_float2 = __commonJS({
46275
46275
  default: true,
46276
46276
  tag: "tag:yaml.org,2002:float",
46277
46277
  test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
46278
- resolve(str) {
46279
- const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, "")));
46280
- const dot = str.indexOf(".");
46278
+ resolve(str2) {
46279
+ const node = new Scalar.Scalar(parseFloat(str2.replace(/_/g, "")));
46280
+ const dot = str2.indexOf(".");
46281
46281
  if (dot !== -1) {
46282
- const f = str.substring(dot + 1).replace(/_/g, "");
46282
+ const f = str2.substring(dot + 1).replace(/_/g, "");
46283
46283
  if (f[f.length - 1] === "0")
46284
46284
  node.minFractionDigits = f.length;
46285
46285
  }
@@ -46299,34 +46299,34 @@ var require_int2 = __commonJS({
46299
46299
  "use strict";
46300
46300
  var stringifyNumber = require_stringifyNumber();
46301
46301
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
46302
- function intResolve(str, offset, radix, { intAsBigInt }) {
46303
- const sign = str[0];
46302
+ function intResolve(str2, offset, radix, { intAsBigInt }) {
46303
+ const sign = str2[0];
46304
46304
  if (sign === "-" || sign === "+")
46305
46305
  offset += 1;
46306
- str = str.substring(offset).replace(/_/g, "");
46306
+ str2 = str2.substring(offset).replace(/_/g, "");
46307
46307
  if (intAsBigInt) {
46308
46308
  switch (radix) {
46309
46309
  case 2:
46310
- str = `0b${str}`;
46310
+ str2 = `0b${str2}`;
46311
46311
  break;
46312
46312
  case 8:
46313
- str = `0o${str}`;
46313
+ str2 = `0o${str2}`;
46314
46314
  break;
46315
46315
  case 16:
46316
- str = `0x${str}`;
46316
+ str2 = `0x${str2}`;
46317
46317
  break;
46318
46318
  }
46319
- const n2 = BigInt(str);
46319
+ const n2 = BigInt(str2);
46320
46320
  return sign === "-" ? BigInt(-1) * n2 : n2;
46321
46321
  }
46322
- const n = parseInt(str, radix);
46322
+ const n = parseInt(str2, radix);
46323
46323
  return sign === "-" ? -1 * n : n;
46324
46324
  }
46325
46325
  function intStringify(node, radix, prefix) {
46326
46326
  const { value } = node;
46327
46327
  if (intIdentify(value)) {
46328
- const str = value.toString(radix);
46329
- return value < 0 ? "-" + prefix + str.substr(1) : prefix + str;
46328
+ const str2 = value.toString(radix);
46329
+ return value < 0 ? "-" + prefix + str2.substr(1) : prefix + str2;
46330
46330
  }
46331
46331
  return stringifyNumber.stringifyNumber(node);
46332
46332
  }
@@ -46336,7 +46336,7 @@ var require_int2 = __commonJS({
46336
46336
  tag: "tag:yaml.org,2002:int",
46337
46337
  format: "BIN",
46338
46338
  test: /^[-+]?0b[0-1_]+$/,
46339
- resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt),
46339
+ resolve: (str2, _onError, opt) => intResolve(str2, 2, 2, opt),
46340
46340
  stringify: (node) => intStringify(node, 2, "0b")
46341
46341
  };
46342
46342
  var intOct = {
@@ -46345,7 +46345,7 @@ var require_int2 = __commonJS({
46345
46345
  tag: "tag:yaml.org,2002:int",
46346
46346
  format: "OCT",
46347
46347
  test: /^[-+]?0[0-7_]+$/,
46348
- resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt),
46348
+ resolve: (str2, _onError, opt) => intResolve(str2, 1, 8, opt),
46349
46349
  stringify: (node) => intStringify(node, 8, "0")
46350
46350
  };
46351
46351
  var int = {
@@ -46353,7 +46353,7 @@ var require_int2 = __commonJS({
46353
46353
  default: true,
46354
46354
  tag: "tag:yaml.org,2002:int",
46355
46355
  test: /^[-+]?[0-9][0-9_]*$/,
46356
- resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),
46356
+ resolve: (str2, _onError, opt) => intResolve(str2, 0, 10, opt),
46357
46357
  stringify: stringifyNumber.stringifyNumber
46358
46358
  };
46359
46359
  var intHex = {
@@ -46362,7 +46362,7 @@ var require_int2 = __commonJS({
46362
46362
  tag: "tag:yaml.org,2002:int",
46363
46363
  format: "HEX",
46364
46364
  test: /^[-+]?0x[0-9a-fA-F_]+$/,
46365
- resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),
46365
+ resolve: (str2, _onError, opt) => intResolve(str2, 2, 16, opt),
46366
46366
  stringify: (node) => intStringify(node, 16, "0x")
46367
46367
  };
46368
46368
  exports2.int = int;
@@ -46466,26 +46466,26 @@ var require_timestamp2 = __commonJS({
46466
46466
  "node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports2) {
46467
46467
  "use strict";
46468
46468
  var stringifyNumber = require_stringifyNumber();
46469
- function parseSexagesimal(str, asBigInt) {
46470
- const sign = str[0];
46471
- const parts = sign === "-" || sign === "+" ? str.substring(1) : str;
46472
- const num2 = (n) => asBigInt ? BigInt(n) : Number(n);
46473
- const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num2(60) + num2(p), num2(0));
46474
- return sign === "-" ? num2(-1) * res : res;
46469
+ function parseSexagesimal(str2, asBigInt) {
46470
+ const sign = str2[0];
46471
+ const parts = sign === "-" || sign === "+" ? str2.substring(1) : str2;
46472
+ const num3 = (n) => asBigInt ? BigInt(n) : Number(n);
46473
+ const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num3(60) + num3(p), num3(0));
46474
+ return sign === "-" ? num3(-1) * res : res;
46475
46475
  }
46476
46476
  function stringifySexagesimal(node) {
46477
46477
  let { value } = node;
46478
- let num2 = (n) => n;
46478
+ let num3 = (n) => n;
46479
46479
  if (typeof value === "bigint")
46480
- num2 = (n) => BigInt(n);
46480
+ num3 = (n) => BigInt(n);
46481
46481
  else if (isNaN(value) || !isFinite(value))
46482
46482
  return stringifyNumber.stringifyNumber(node);
46483
46483
  let sign = "";
46484
46484
  if (value < 0) {
46485
46485
  sign = "-";
46486
- value *= num2(-1);
46486
+ value *= num3(-1);
46487
46487
  }
46488
- const _60 = num2(60);
46488
+ const _60 = num3(60);
46489
46489
  const parts = [value % _60];
46490
46490
  if (value < 60) {
46491
46491
  parts.unshift(0);
@@ -46505,7 +46505,7 @@ var require_timestamp2 = __commonJS({
46505
46505
  tag: "tag:yaml.org,2002:int",
46506
46506
  format: "TIME",
46507
46507
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
46508
- resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt),
46508
+ resolve: (str2, _onError, { intAsBigInt }) => parseSexagesimal(str2, intAsBigInt),
46509
46509
  stringify: stringifySexagesimal
46510
46510
  };
46511
46511
  var floatTime = {
@@ -46514,7 +46514,7 @@ var require_timestamp2 = __commonJS({
46514
46514
  tag: "tag:yaml.org,2002:float",
46515
46515
  format: "TIME",
46516
46516
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
46517
- resolve: (str) => parseSexagesimal(str, false),
46517
+ resolve: (str2) => parseSexagesimal(str2, false),
46518
46518
  stringify: stringifySexagesimal
46519
46519
  };
46520
46520
  var timestamp = {
@@ -46525,8 +46525,8 @@ var require_timestamp2 = __commonJS({
46525
46525
  // may be omitted altogether, resulting in a date format. In such a case, the time part is
46526
46526
  // assumed to be 00:00:00Z (start of day, UTC).
46527
46527
  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})?))?)?$"),
46528
- resolve(str) {
46529
- const match = str.match(timestamp.test);
46528
+ resolve(str2) {
46529
+ const match = str2.match(timestamp.test);
46530
46530
  if (!match)
46531
46531
  throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
46532
46532
  const [, year, month, day2, hour2, minute, second] = match.map(Number);
@@ -50827,9 +50827,9 @@ var import_node_readline2 = require("node:readline");
50827
50827
 
50828
50828
  // index.ts
50829
50829
  var import_node_url5 = require("node:url");
50830
- var import_node_path32 = require("node:path");
50830
+ var import_node_path33 = require("node:path");
50831
50831
  var import_node_os21 = require("node:os");
50832
- var import_node_fs34 = require("node:fs");
50832
+ var import_node_fs35 = require("node:fs");
50833
50833
  var import_node_child_process8 = require("node:child_process");
50834
50834
 
50835
50835
  // log.mjs
@@ -53093,7 +53093,7 @@ function appVersion() {
53093
53093
  return resolveVersion({
53094
53094
  isSea: isSea2(),
53095
53095
  sqVersionXml: readSqVersionXml(),
53096
- define: true ? "0.75.0" : void 0,
53096
+ define: true ? "0.77.0" : void 0,
53097
53097
  pkgVersion: readPkgVersion()
53098
53098
  });
53099
53099
  }
@@ -53103,7 +53103,7 @@ function resolveChannel(s) {
53103
53103
  return "dev";
53104
53104
  }
53105
53105
  function appChannel() {
53106
- return resolveChannel({ isSea: isSea2(), define: true ? "0.75.0" : void 0 });
53106
+ return resolveChannel({ isSea: isSea2(), define: true ? "0.77.0" : void 0 });
53107
53107
  }
53108
53108
 
53109
53109
  // workflow-update.ts
@@ -53468,7 +53468,7 @@ function extractSavedPath(events) {
53468
53468
  var aisc_shapes_default = { "C10X15.3": 2.6, C10X20: 2.74, C10X25: 2.89, C10X30: 3.03, "C12X20.7": 2.94, C12X25: 3.05, C12X30: 3.17, "C15X33.9": 3.4, C15X40: 3.52, C15X50: 3.72, "C3X3.5": 1.37, "C3X4.1": 1.41, C3X5: 1.5, C3X6: 1.6, "C4X4.5": 1.52, "C4X5.4": 1.58, "C4X6.25": 1.65, "C4X7.25": 1.72, "C5X6.7": 1.75, C5X9: 1.89, "C6X10.5": 2.03, C6X13: 2.16, "C6X8.2": 1.92, "C7X12.25": 2.19, "C7X14.75": 2.3, "C7X9.8": 2.09, "C8X11.5": 2.26, "C8X13.75": 2.34, "C8X18.75": 2.53, "C9X13.4": 2.43, C9X15: 2.49, C9X20: 2.65, HP10X42: 10.1, HP10X57: 10.2, HP12X53: 12, HP12X63: 12.1, HP12X74: 12.2, HP12X84: 12.3, HP12X89: 12.3, HP14X102: 14.8, HP14X117: 14.9, HP14X73: 14.6, HP14X89: 14.7, HP16X101: 15.8, HP16X121: 15.9, HP16X141: 16, HP16X162: 16.1, HP16X183: 16.3, HP16X88: 15.7, HP18X135: 17.8, HP18X157: 17.9, HP18X181: 18, HP18X204: 18.1, HP8X36: 8.16, "M10X7.5": 2.69, M10X8: 2.69, M10X9: 2.69, "M12.5X11.6": 3.5, "M12.5X12.4": 3.75, M12X10: 3.25, "M12X10.8": 3.07, "M12X11.8": 3.07, "M3X2.9": 2.25, "M4X3.2": 2.25, "M4X3.45": 2.25, "M4X4.08": 2.25, M4X6: 3.8, "M5X18.9": 5, "M6X3.7": 2, "M6X4.4": 1.84, "M8X6.2": 2.28, "M8X6.5": 2.28, MC10X22: 3.32, MC10X25: 3.41, "MC10X28.5": 3.95, "MC10X33.6": 4.1, "MC10X41.1": 4.32, "MC10X6.5": 1.17, "MC10X8.4": 1.5, "MC12X10.6": 1.5, "MC12X14.3": 2.12, MC12X31: 3.67, MC12X35: 3.77, MC12X40: 3.89, MC12X45: 4.01, MC12X50: 4.14, "MC13X31.8": 4, MC13X35: 4.07, MC13X40: 4.19, MC13X50: 4.41, "MC18X42.7": 3.95, "MC18X45.8": 4, "MC18X51.9": 4.1, MC18X58: 4.2, "MC3X7.1": 1.94, "MC4X13.8": 2.5, MC6X12: 2.5, "MC6X15.1": 2.94, "MC6X15.3": 3.5, "MC6X16.3": 3, MC6X18: 3.5, "MC6X6.5": 1.85, MC6X7: 1.88, "MC7X19.1": 3.45, "MC7X22.7": 3.6, "MC8X18.7": 2.98, MC8X20: 3.03, "MC8X21.4": 3.45, "MC8X22.8": 3.5, "MC8X8.5": 1.87, "MC9X23.9": 3.45, "MC9X25.4": 3.5, "MT2.5X9.45": 5, MT2X3: 3.8, "MT3X1.85": 2, "MT3X2.2": 1.84, "MT4X3.1": 2.28, "MT4X3.25": 2.28, "MT5X3.75": 2.69, MT5X4: 2.69, "MT5X4.5": 2.69, "MT6.25X5.8": 3.5, "MT6.25X6.2": 3.75, MT6X5: 3.25, "MT6X5.4": 3.07, "MT6X5.9": 3.07, "S10X25.4": 4.66, S10X35: 4.94, "S12X31.8": 5, S12X35: 5.08, "S12X40.8": 5.25, S12X50: 5.48, "S15X42.9": 5.5, S15X50: 5.64, "S18X54.7": 6, S18X70: 6.25, S20X66: 6.26, S20X75: 6.39, S20X86: 7.06, S20X96: 7.2, S24X100: 7.25, S24X106: 7.87, S24X121: 8.05, S24X80: 7, S24X90: 7.13, "S3X5.7": 2.33, "S3X7.5": 2.51, "S4X7.7": 2.66, "S4X9.5": 2.8, S5X10: 3, "S6X12.5": 3.33, "S6X17.25": 3.57, "S8X18.4": 4, S8X23: 4.17, "ST1.5X2.85": 2.33, "ST1.5X3.75": 2.51, ST10X33: 6.26, "ST10X37.5": 6.39, ST10X43: 7.06, ST10X48: 7.2, ST12X40: 7, ST12X45: 7.13, ST12X50: 7.25, ST12X53: 7.87, "ST12X60.5": 8.05, "ST2.5X5": 3, "ST2X3.85": 2.66, "ST2X4.75": 2.8, "ST3X6.25": 3.33, "ST3X8.6": 3.57, "ST4X11.5": 4.17, "ST4X9.2": 4, "ST5X12.7": 4.66, "ST5X17.5": 4.94, "ST6X15.9": 5, "ST6X17.5": 5.08, "ST6X20.4": 5.25, ST6X25: 5.48, "ST7.5X21.45": 5.5, "ST7.5X25": 5.64, "ST9X27.35": 6, ST9X35: 6.25, W10X100: 10.3, W10X112: 10.4, W10X12: 3.96, W10X15: 4, W10X17: 4.01, W10X19: 4.02, W10X22: 5.75, W10X26: 5.77, W10X30: 5.81, W10X33: 7.96, W10X39: 7.99, W10X45: 8.02, W10X49: 10, W10X54: 10, W10X60: 10.1, W10X68: 10.1, W10X77: 10.2, W10X88: 10.3, W12X106: 12.2, W12X120: 12.3, W12X136: 12.4, W12X14: 3.97, W12X152: 12.5, W12X16: 3.99, W12X170: 12.6, W12X19: 4.01, W12X190: 12.7, W12X210: 12.8, W12X22: 4.03, W12X230: 12.9, W12X252: 13, W12X26: 6.49, W12X279: 13.1, W12X30: 6.52, W12X305: 13.2, W12X336: 13.4, W12X35: 6.56, W12X40: 8.01, W12X45: 8.05, W12X50: 8.08, W12X53: 10, W12X58: 10, W12X65: 12, W12X72: 12, W12X79: 12.1, W12X87: 12.1, W12X96: 12.2, W14X109: 14.6, W14X120: 14.7, W14X132: 14.7, W14X145: 15.5, W14X159: 15.6, W14X176: 15.7, W14X193: 15.7, W14X211: 15.8, W14X22: 5, W14X233: 15.9, W14X257: 16, W14X26: 5.03, W14X283: 16.1, W14X30: 6.73, W14X311: 16.2, W14X34: 6.75, W14X342: 16.4, W14X370: 16.5, W14X38: 6.77, W14X398: 16.6, W14X426: 16.7, W14X43: 8, W14X455: 16.8, W14X48: 8.03, W14X500: 17, W14X53: 8.06, W14X550: 17.2, W14X605: 17.4, W14X61: 10, W14X665: 17.7, W14X68: 10, W14X730: 17.9, W14X74: 10.1, W14X808: 18.6, W14X82: 10.1, W14X873: 18.8, W14X90: 14.5, W14X99: 14.6, W16X100: 10.4, W16X26: 5.5, W16X31: 5.53, W16X36: 6.99, W16X40: 7, W16X45: 7.04, W16X50: 7.07, W16X57: 7.12, W16X67: 10.2, W16X77: 10.3, W16X89: 10.4, W18X106: 11.2, W18X119: 11.3, W18X130: 11.2, W18X143: 11.2, W18X158: 11.3, W18X175: 11.4, W18X192: 11.5, W18X211: 11.6, W18X234: 11.7, W18X258: 11.8, W18X283: 11.9, W18X311: 12, W18X35: 6, W18X40: 6.02, W18X46: 6.06, W18X50: 7.5, W18X55: 7.53, W18X60: 7.56, W18X65: 7.59, W18X71: 7.64, W18X76: 11, W18X86: 11.1, W18X97: 11.1, W21X101: 12.3, W21X111: 12.3, W21X122: 12.4, W21X132: 12.4, W21X147: 12.5, W21X166: 12.4, W21X182: 12.5, W21X201: 12.6, W21X223: 12.7, W21X248: 12.8, W21X275: 12.9, W21X44: 6.5, W21X48: 8.14, W21X50: 6.53, W21X55: 8.22, W21X57: 6.56, W21X62: 8.24, W21X68: 8.27, W21X73: 8.3, W21X83: 8.36, W21X93: 8.42, W24X103: 9, W24X104: 12.8, W24X117: 12.8, W24X131: 12.9, W24X146: 12.9, W24X162: 13, W24X176: 12.9, W24X192: 13, W24X207: 13, W24X229: 13.1, W24X250: 13.2, W24X279: 13.3, W24X306: 13.4, W24X335: 13.5, W24X370: 13.7, W24X55: 7.01, W24X62: 7.04, W24X68: 8.97, W24X76: 8.99, W24X84: 9.02, W24X94: 9.07, W27X102: 10, W27X114: 10.1, W27X129: 10, W27X146: 14, W27X161: 14, W27X178: 14.1, W27X194: 14, W27X217: 14.1, W27X235: 14.2, W27X258: 14.3, W27X281: 14.4, W27X307: 14.4, W27X336: 14.6, W27X368: 14.7, W27X539: 15.3, W27X84: 10, W27X94: 10, W30X108: 10.5, W30X116: 10.5, W30X124: 10.5, W30X132: 10.5, W30X148: 10.5, W30X173: 15, W30X191: 15, W30X211: 15.1, W30X235: 15.1, W30X261: 15.2, W30X292: 15.3, W30X326: 15.4, W30X357: 15.5, W30X391: 15.6, W30X90: 10.4, W30X99: 10.5, W33X118: 11.5, W33X130: 11.5, W33X141: 11.5, W33X152: 11.6, W33X169: 11.5, W33X201: 15.7, W33X221: 15.8, W33X241: 15.9, W33X263: 15.8, W33X291: 15.9, W33X318: 16, W33X354: 16.1, W33X387: 16.2, W36X135: 12, W36X150: 12, W36X160: 12, W36X170: 12, W36X182: 12.1, W36X194: 12.1, W36X210: 12.2, W36X231: 16.5, W36X232: 12.1, W36X247: 16.5, W36X256: 12.2, W36X262: 16.6, W36X282: 16.6, W36X302: 16.7, W36X330: 16.6, W36X361: 16.7, W36X395: 16.8, W36X441: 17, W36X487: 17.1, W36X529: 17.2, W36X652: 17.6, W36X723: 17.8, W36X802: 18, W36X853: 18.2, W36X925: 18.6, W40X149: 11.8, W40X167: 11.8, W40X183: 11.8, W40X199: 15.8, W40X211: 11.8, W40X215: 15.8, W40X235: 11.9, W40X249: 15.8, W40X264: 11.9, W40X277: 15.8, W40X278: 12, W40X294: 12, W40X297: 15.8, W40X324: 15.9, W40X327: 12.1, W40X331: 12.2, W40X362: 16, W40X372: 16.1, W40X392: 12.4, W40X397: 16.1, W40X431: 16.2, W40X503: 16.4, W40X593: 16.7, W40X655: 16.9, W44X230: 15.8, W44X262: 15.8, W44X290: 15.8, W44X335: 15.9, W4X13: 4.06, W5X16: 5, W5X19: 5.03, W6X12: 4, W6X15: 5.99, W6X16: 4.03, W6X20: 6.02, W6X25: 6.08, "W6X8.5": 3.94, W6X9: 3.94, W8X10: 3.94, W8X13: 4, W8X15: 4.02, W8X18: 5.25, W8X21: 5.27, W8X24: 6.5, W8X28: 6.54, W8X31: 8, W8X35: 8.02, W8X40: 8.07, W8X48: 8.11, W8X58: 8.22, W8X67: 8.28, "WT10.5X100.5": 12.6, "WT10.5X111.5": 12.7, "WT10.5X124": 12.8, "WT10.5X137.5": 12.9, "WT10.5X22": 6.5, "WT10.5X24": 8.14, "WT10.5X25": 6.53, "WT10.5X27.5": 8.22, "WT10.5X28.5": 6.56, "WT10.5X31": 8.24, "WT10.5X34": 8.27, "WT10.5X36.5": 8.3, "WT10.5X41.5": 8.36, "WT10.5X46.5": 8.42, "WT10.5X50.5": 12.3, "WT10.5X55.5": 12.3, "WT10.5X61": 12.4, "WT10.5X66": 12.4, "WT10.5X73.5": 12.5, "WT10.5X83": 12.4, "WT10.5X91": 12.5, "WT12X103.5": 13, "WT12X114.5": 13.1, WT12X125: 13.2, "WT12X139.5": 13.3, WT12X153: 13.4, "WT12X167.5": 13.5, WT12X185: 13.7, "WT12X27.5": 7.01, WT12X31: 7.04, WT12X34: 8.97, WT12X38: 8.99, WT12X42: 9.02, WT12X47: 9.07, "WT12X51.5": 9, WT12X52: 12.8, "WT12X58.5": 12.8, "WT12X65.5": 12.9, WT12X73: 12.9, WT12X81: 13, WT12X88: 12.9, WT12X96: 13, "WT13.5X108.5": 14.1, "WT13.5X117.5": 14.2, "WT13.5X129": 14.3, "WT13.5X140.5": 14.4, "WT13.5X153.5": 14.4, "WT13.5X168": 14.6, "WT13.5X184": 14.7, "WT13.5X269.5": 15.3, "WT13.5X42": 10, "WT13.5X47": 10, "WT13.5X51": 10, "WT13.5X57": 10.1, "WT13.5X64.5": 10, "WT13.5X73": 14, "WT13.5X80.5": 14, "WT13.5X89": 14.1, "WT13.5X97": 14, "WT15X105.5": 15.1, "WT15X117.5": 15.1, "WT15X130.5": 15.2, WT15X146: 15.3, WT15X163: 15.4, "WT15X178.5": 15.5, "WT15X195.5": 15.6, WT15X45: 10.4, "WT15X49.5": 10.5, WT15X54: 10.5, WT15X58: 10.5, WT15X62: 10.5, WT15X66: 10.5, WT15X74: 10.5, "WT15X86.5": 15, "WT15X95.5": 15, "WT16.5X100.5": 15.7, "WT16.5X110.5": 15.8, "WT16.5X120.5": 15.9, "WT16.5X131.5": 15.8, "WT16.5X145.5": 15.9, "WT16.5X159": 16, "WT16.5X177": 16.1, "WT16.5X193.5": 16.2, "WT16.5X59": 11.5, "WT16.5X65": 11.5, "WT16.5X70.5": 11.5, "WT16.5X76": 11.6, "WT16.5X84.5": 11.5, WT18X105: 12.2, "WT18X115.5": 16.5, WT18X116: 12.1, "WT18X123.5": 16.5, WT18X128: 12.2, WT18X131: 16.6, WT18X141: 16.6, WT18X151: 16.7, WT18X165: 16.6, "WT18X180.5": 16.7, "WT18X197.5": 16.8, "WT18X220.5": 17, "WT18X243.5": 17.1, "WT18X264.5": 17.2, WT18X326: 17.6, "WT18X361.5": 17.8, WT18X401: 18, "WT18X426.5": 18.2, "WT18X462.5": 18.6, "WT18X67.5": 12, WT18X75: 12, WT18X80: 12, WT18X85: 12, WT18X91: 12.1, WT18X97: 12.1, "WT2.5X8": 5, "WT2.5X9.5": 5.03, "WT20X105.5": 11.8, "WT20X107.5": 15.8, "WT20X117.5": 11.9, "WT20X124.5": 15.8, WT20X132: 11.9, "WT20X138.5": 15.8, WT20X139: 12, WT20X147: 12, "WT20X148.5": 15.8, WT20X162: 15.9, "WT20X163.5": 12.1, "WT20X165.5": 12.2, WT20X181: 16, WT20X186: 16.1, WT20X196: 12.4, "WT20X198.5": 16.1, "WT20X215.5": 16.2, "WT20X251.5": 16.4, "WT20X296.5": 16.7, "WT20X327.5": 16.9, "WT20X74.5": 11.8, "WT20X83.5": 11.8, "WT20X91.5": 11.8, "WT20X99.5": 15.8, WT22X115: 15.8, WT22X131: 15.8, WT22X145: 15.8, "WT22X167.5": 15.9, "WT2X6.5": 4.06, WT3X10: 6.02, "WT3X12.5": 6.08, "WT3X4.25": 3.94, "WT3X4.5": 3.94, WT3X6: 4, "WT3X7.5": 5.99, WT3X8: 4.03, "WT4X10.5": 5.27, WT4X12: 6.5, WT4X14: 6.54, "WT4X15.5": 8, "WT4X17.5": 8.02, WT4X20: 8.07, WT4X24: 8.11, WT4X29: 8.22, "WT4X33.5": 8.28, WT4X5: 3.94, "WT4X6.5": 4, "WT4X7.5": 4.02, WT4X9: 5.25, WT5X11: 5.75, WT5X13: 5.77, WT5X15: 5.81, "WT5X16.5": 7.96, "WT5X19.5": 7.99, "WT5X22.5": 8.02, "WT5X24.5": 10, WT5X27: 10, WT5X30: 10.1, WT5X34: 10.1, "WT5X38.5": 10.2, WT5X44: 10.3, WT5X50: 10.3, WT5X56: 10.4, WT5X6: 3.96, "WT5X7.5": 4, "WT5X8.5": 4.01, "WT5X9.5": 4.02, WT6X105: 12.8, WT6X11: 4.03, WT6X115: 12.9, WT6X126: 13, WT6X13: 6.49, "WT6X139.5": 13.1, WT6X15: 6.52, "WT6X152.5": 13.2, WT6X168: 13.4, "WT6X17.5": 6.56, WT6X20: 8.01, "WT6X22.5": 8.05, WT6X25: 8.08, "WT6X26.5": 10, WT6X29: 10, "WT6X32.5": 12, WT6X36: 12, "WT6X39.5": 12.1, "WT6X43.5": 12.1, WT6X48: 12.2, WT6X53: 12.2, WT6X60: 12.3, WT6X68: 12.4, WT6X7: 3.97, WT6X76: 12.5, WT6X8: 3.99, WT6X85: 12.6, "WT6X9.5": 4.01, WT6X95: 12.7, "WT7X105.5": 15.8, WT7X11: 5, "WT7X116.5": 15.9, "WT7X128.5": 16, WT7X13: 5.03, "WT7X141.5": 16.1, WT7X15: 6.73, "WT7X155.5": 16.2, WT7X17: 6.75, WT7X171: 16.4, WT7X185: 16.5, WT7X19: 6.77, WT7X199: 16.6, "WT7X21.5": 8, WT7X213: 16.7, "WT7X227.5": 16.8, WT7X24: 8.03, WT7X250: 17, "WT7X26.5": 8.06, WT7X275: 17.2, "WT7X30.5": 10, "WT7X302.5": 17.4, "WT7X332.5": 17.7, WT7X34: 10, WT7X365: 17.9, WT7X37: 10.1, WT7X404: 18.6, WT7X41: 10.1, "WT7X436.5": 18.8, WT7X45: 14.5, "WT7X49.5": 14.6, "WT7X54.5": 14.6, WT7X60: 14.7, WT7X66: 14.7, "WT7X72.5": 15.5, "WT7X79.5": 15.6, WT7X88: 15.7, "WT7X96.5": 15.7, WT8X13: 5.5, "WT8X15.5": 5.53, WT8X18: 6.99, WT8X20: 7, "WT8X22.5": 7.04, WT8X25: 7.07, "WT8X28.5": 7.12, "WT8X33.5": 10.2, "WT8X38.5": 10.3, "WT8X44.5": 10.4, WT8X50: 10.4, "WT9X105.5": 11.6, WT9X117: 11.7, WT9X129: 11.8, "WT9X141.5": 11.9, "WT9X155.5": 12, "WT9X17.5": 6, WT9X20: 6.02, WT9X23: 6.06, WT9X25: 7.5, "WT9X27.5": 7.53, WT9X30: 7.56, "WT9X32.5": 7.59, "WT9X35.5": 7.64, WT9X38: 11, WT9X43: 11.1, "WT9X48.5": 11.1, WT9X53: 11.2, "WT9X59.5": 11.3, WT9X65: 11.2, "WT9X71.5": 11.2, WT9X79: 11.3, "WT9X87.5": 11.4, WT9X96: 11.5 };
53469
53469
 
53470
53470
  // index.ts
53471
- var import_node_crypto9 = require("node:crypto");
53471
+ var import_node_crypto10 = require("node:crypto");
53472
53472
 
53473
53473
  // graft.ts
53474
53474
  var TEKLA_MARKER = "Recipe: Tekla model plug-in";
@@ -53765,6 +53765,29 @@ function deleteRequest(id) {
53765
53765
  (0, import_node_fs16.rmSync)((0, import_node_path14.join)(REQUESTS_DIR, file));
53766
53766
  return true;
53767
53767
  }
53768
+ function getRequest(id) {
53769
+ if (!(0, import_node_fs16.existsSync)(REQUESTS_DIR)) return null;
53770
+ const file = (0, import_node_fs16.readdirSync)(REQUESTS_DIR).find((f) => f.endsWith(`__${id}.json`));
53771
+ if (!file) return null;
53772
+ try {
53773
+ return JSON.parse((0, import_node_fs16.readFileSync)((0, import_node_path14.join)(REQUESTS_DIR, file), "utf8"));
53774
+ } catch {
53775
+ return null;
53776
+ }
53777
+ }
53778
+ function patchRequest(id, patch2) {
53779
+ if (!(0, import_node_fs16.existsSync)(REQUESTS_DIR)) return null;
53780
+ const file = (0, import_node_fs16.readdirSync)(REQUESTS_DIR).find((f) => f.endsWith(`__${id}.json`));
53781
+ if (!file) return null;
53782
+ try {
53783
+ const cur = JSON.parse((0, import_node_fs16.readFileSync)((0, import_node_path14.join)(REQUESTS_DIR, file), "utf8"));
53784
+ const next = { ...cur, ...patch2, id: cur.id, createdAt: cur.createdAt };
53785
+ (0, import_node_fs16.writeFileSync)((0, import_node_path14.join)(REQUESTS_DIR, file), JSON.stringify(next, null, 2));
53786
+ return next;
53787
+ } catch {
53788
+ return null;
53789
+ }
53790
+ }
53768
53791
  function clearRequests() {
53769
53792
  if (!(0, import_node_fs16.existsSync)(REQUESTS_DIR)) return 0;
53770
53793
  const allFiles = (0, import_node_fs16.readdirSync)(REQUESTS_DIR);
@@ -53947,14 +53970,46 @@ function toCustomConnection(raw, fallbackId) {
53947
53970
  positions: shiftPositions(p.positions, anchor),
53948
53971
  indices: p.indices.slice()
53949
53972
  }));
53973
+ const recipe = sanitizeRecipe(c.recipe);
53950
53974
  return {
53951
53975
  id: typeof c.id === "string" ? c.id : fallbackId,
53952
53976
  name: typeof c.name === "string" ? c.name : "Imported connection",
53953
53977
  type: typeof c.type === "string" ? c.type : null,
53954
53978
  members: Array.isArray(c.members) ? c.members.filter((m) => typeof m === "string") : [],
53955
- geometry
53979
+ geometry,
53980
+ ...recipe ? { recipe } : {}
53956
53981
  };
53957
53982
  }
53983
+ var BASE_PLATE_PARAMS = {
53984
+ thickness: [1, 500],
53985
+ plateWidth: [1, 5e3],
53986
+ plateDepth: [1, 5e3],
53987
+ boltDia: [1, 200],
53988
+ boltCols: [1, 20],
53989
+ boltRows: [1, 20],
53990
+ edgeDist: [0, 5e3],
53991
+ weldLeg: [0, 200]
53992
+ };
53993
+ function sanitizeRecipe(raw) {
53994
+ if (!raw || typeof raw !== "object") return void 0;
53995
+ const r = raw;
53996
+ if (typeof r.kind !== "string" || !r.kind || !r.params || typeof r.params !== "object") return void 0;
53997
+ const num3 = {};
53998
+ for (const [k, v] of Object.entries(r.params)) {
53999
+ if (typeof v === "number" && isFinite(v)) num3[k] = v;
54000
+ }
54001
+ if (r.kind === "base-plate") {
54002
+ const params = {};
54003
+ for (const [k, [lo, hi]] of Object.entries(BASE_PLATE_PARAMS)) {
54004
+ if (k in num3) {
54005
+ if (!(num3[k] >= lo && num3[k] <= hi)) return void 0;
54006
+ params[k] = num3[k];
54007
+ }
54008
+ }
54009
+ return Object.keys(params).length ? { kind: r.kind, params } : void 0;
54010
+ }
54011
+ return Object.keys(num3).length ? { kind: r.kind, params: num3 } : void 0;
54012
+ }
53958
54013
  async function extractConnection(companionId, ifcPath, id) {
53959
54014
  await ensureConnectionReader();
53960
54015
  const out = await runReader(companionId, "extract", ifcPath, id);
@@ -54294,7 +54349,13 @@ function writeAtomic(path, text) {
54294
54349
  function isVersionMeta(v) {
54295
54350
  if (!v || typeof v !== "object") return false;
54296
54351
  const r = v;
54297
- return Number.isInteger(r.n) && typeof r.ts === "string" && typeof r.author === "string" && typeof r.message === "string" && (r.gate === "model" || r.gate === null) && (r.kind === "approve" || r.kind === "rollback" || r.kind === "rebake");
54352
+ return Number.isInteger(r.n) && typeof r.ts === "string" && typeof r.author === "string" && typeof r.message === "string" && (r.gate === "model" || r.gate === null) && (r.kind === "approve" || r.kind === "rollback" || r.kind === "rebake" || r.kind === "revision-read") && isValidSource(r.source);
54353
+ }
54354
+ function isValidSource(s) {
54355
+ if (s === void 0) return true;
54356
+ if (!s || typeof s !== "object") return false;
54357
+ const files2 = s.files;
54358
+ return Array.isArray(files2) && files2.every((f) => !!f && typeof f === "object" && typeof f.sha256 === "string");
54298
54359
  }
54299
54360
  function loadLog(id) {
54300
54361
  try {
@@ -54354,7 +54415,9 @@ function createVersion(id, contract, meta) {
54354
54415
  author: meta.author,
54355
54416
  message: meta.message,
54356
54417
  gate: meta.gate,
54357
- kind: meta.kind
54418
+ kind: meta.kind,
54419
+ ...meta.source ? { source: meta.source } : {}
54420
+ // revision-read provenance (small metadata; not dehydrated)
54358
54421
  };
54359
54422
  writeAtomic((0, import_node_path19.join)(versionsDir(id), `${n}.json`), JSON.stringify({ meta: row, contract: skeleton }, null, 2));
54360
54423
  log2.versions.push(row);
@@ -54374,12 +54437,344 @@ function readVersion(id, n) {
54374
54437
  return null;
54375
54438
  }
54376
54439
  }
54440
+ function readVersionSkeleton(id, n) {
54441
+ try {
54442
+ const snap = JSON.parse((0, import_node_fs21.readFileSync)((0, import_node_path19.join)(versionsDir(id), `${n}.json`), "utf8"));
54443
+ return snap.contract;
54444
+ } catch {
54445
+ return null;
54446
+ }
54447
+ }
54377
54448
 
54378
- // contract-bake.ts
54449
+ // bom-format.ts
54450
+ var round1 = (n) => Math.round(n * 10) / 10;
54451
+ function contractToBom(contractInput) {
54452
+ const c = contractInput ?? {};
54453
+ const weights = c.weights ?? {};
54454
+ const agg = /* @__PURE__ */ new Map();
54455
+ for (const plan of c.plans ?? []) {
54456
+ const ptPerFt = typeof plan.pt_per_ft === "number" && plan.pt_per_ft > 0 ? plan.pt_per_ft : 12;
54457
+ for (const m of plan.members ?? []) {
54458
+ const profile = m.profile;
54459
+ if (!profile) continue;
54460
+ const plf = weights[profile];
54461
+ if (plf == null) continue;
54462
+ let lenFt;
54463
+ if (m.role === "column") {
54464
+ const tos = m.col?.tos;
54465
+ const bos = m.col?.bos;
54466
+ if (tos == null || bos == null) continue;
54467
+ lenFt = Math.abs(tos - bos) / 12;
54468
+ } else {
54469
+ const wp = m.wp;
54470
+ if (!Array.isArray(wp) || wp.length < 2) continue;
54471
+ const a = wp[0];
54472
+ const b = wp[1];
54473
+ if (!a || !b) continue;
54474
+ lenFt = Math.hypot(a[0] - b[0], a[1] - b[1]) / ptPerFt;
54475
+ }
54476
+ const g = agg.get(profile) ?? { qty: 0, lenFt: 0, plf };
54477
+ g.qty += 1;
54478
+ g.lenFt += lenFt;
54479
+ agg.set(profile, g);
54480
+ }
54481
+ }
54482
+ const rows = [...agg.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([profile, g]) => ({
54483
+ Profile: profile,
54484
+ Qty: g.qty,
54485
+ "Length (ft)": round1(g.lenFt),
54486
+ "lb/ft": g.plf,
54487
+ "Weight (lb)": Math.round(g.lenFt * g.plf)
54488
+ }));
54489
+ const totalLb = rows.reduce((t, r) => t + r["Weight (lb)"], 0);
54490
+ const totalQty = rows.reduce((t, r) => t + r.Qty, 0);
54491
+ const totalLenFt = round1(rows.reduce((t, r) => t + r["Length (ft)"], 0));
54492
+ const totalTons = round1(totalLb / 2e3);
54493
+ rows.push({
54494
+ Profile: "TOTAL",
54495
+ Qty: totalQty,
54496
+ "Length (ft)": totalLenFt,
54497
+ "lb/ft": "",
54498
+ "Weight (lb)": totalLb
54499
+ });
54500
+ return {
54501
+ title: `Bill of Materials \u2014 ${totalTons} tons (${totalLb.toLocaleString("en-US")} lb)`,
54502
+ columns: ["Profile", "Qty", "Length (ft)", "lb/ft", "Weight (lb)"],
54503
+ rows,
54504
+ totalLb,
54505
+ totalTons
54506
+ };
54507
+ }
54508
+
54509
+ // steel-diff.ts
54510
+ var NUL = String.fromCharCode(0);
54511
+ var asArray = (v) => Array.isArray(v) ? v : [];
54512
+ var str = (v) => typeof v === "string" ? v : "";
54513
+ var normProfile = (v) => str(v).trim().toUpperCase().replace(/\s+/g, "");
54514
+ var num = (v) => typeof v === "number" && isFinite(v) ? v : null;
54515
+ var MOVE_TOL_FT = 0.5;
54516
+ function collect(contract) {
54517
+ const byKey = /* @__PURE__ */ new Map();
54518
+ const dup = /* @__PURE__ */ new Set();
54519
+ const idSheets = /* @__PURE__ */ new Map();
54520
+ const c = contract ?? {};
54521
+ for (const plan of asArray(c.plans)) {
54522
+ const sheet = str(plan?.sheet);
54523
+ const rawPpf = plan?.pt_per_ft;
54524
+ const hasScale = typeof rawPpf === "number" && rawPpf > 0;
54525
+ const ptPerFt = hasScale ? rawPpf : 12;
54526
+ for (const m of asArray(plan?.members)) {
54527
+ const id = str(m?.id);
54528
+ if (!id) continue;
54529
+ const key = sheet + NUL + id;
54530
+ (idSheets.get(id) ?? idSheets.set(id, /* @__PURE__ */ new Set()).get(id)).add(sheet);
54531
+ if (byKey.has(key)) {
54532
+ dup.add(key);
54533
+ continue;
54534
+ }
54535
+ byKey.set(key, {
54536
+ key,
54537
+ id,
54538
+ sheet,
54539
+ mark: str(m?.mark) || void 0,
54540
+ profile: str(m?.profile),
54541
+ role: str(m?.role) || "beam",
54542
+ ptPerFt,
54543
+ hasScale,
54544
+ wp: asArray(m?.wp).map((p) => asArray(p).map((x) => fin(x))),
54545
+ // finite-guarded (no NaN) — consistent with num() elsewhere
54546
+ ends: asArray(m?.ends),
54547
+ col: m?.col ?? {},
54548
+ material: str(m?.material)
54549
+ });
54550
+ }
54551
+ }
54552
+ return { byKey, dupKeys: [...dup], idSheets };
54553
+ }
54554
+ var refOf = (m) => ({ key: m.key, id: m.id, sheet: m.sheet, ...m.mark ? { mark: m.mark } : {}, profile: m.profile, role: m.role });
54555
+ var fin = (v) => {
54556
+ const n = Number(v);
54557
+ return isFinite(n) ? n : 0;
54558
+ };
54559
+ var dist = (p, q) => Math.hypot((p[0] ?? 0) - (q[0] ?? 0), (p[1] ?? 0) - (q[1] ?? 0));
54560
+ var ftPt = (p, ppf) => [fin(p?.[0]) / ppf, fin(p?.[1]) / ppf];
54561
+ function beamMoveFeet(a, b) {
54562
+ const af0 = ftPt(a.wp[0], a.ptPerFt), af1 = ftPt(a.wp[1] ?? a.wp[0], a.ptPerFt);
54563
+ const bf0 = ftPt(b.wp[0], b.ptPerFt), bf1 = ftPt(b.wp[1] ?? b.wp[0], b.ptPerFt);
54564
+ const aligned = Math.max(dist(af0, bf0), dist(af1, bf1));
54565
+ const flipped = Math.max(dist(af0, bf1), dist(af1, bf0));
54566
+ return flipped < aligned ? { feet: flipped, flipped: true } : { feet: aligned, flipped: false };
54567
+ }
54568
+ function elevMoveFeet(a, b) {
54569
+ let ft = 0;
54570
+ const at = num(a.col?.tos), bt = num(b.col?.tos);
54571
+ if (at != null && bt != null) ft = Math.max(ft, Math.abs(at - bt) / 12);
54572
+ const ab = num(a.col?.bos), bb = num(b.col?.bos);
54573
+ if (ab != null && bb != null) ft = Math.max(ft, Math.abs(ab - bb) / 12);
54574
+ for (let i = 0; i < 2; i++) {
54575
+ const ea = num(a.ends?.[i]?.tos), eb = num(b.ends?.[i]?.tos);
54576
+ if (ea != null && eb != null) ft = Math.max(ft, Math.abs(ea - eb) / 12);
54577
+ }
54578
+ return ft;
54579
+ }
54580
+ var stable = (o) => {
54581
+ if (Array.isArray(o)) return "[" + o.map(stable).join(",") + "]";
54582
+ if (o && typeof o === "object") return "{" + Object.keys(o).sort().map((k) => k + ":" + stable(o[k])).join(",") + "}";
54583
+ return JSON.stringify(o) ?? "null";
54584
+ };
54585
+ function connIdentity(ref, lib) {
54586
+ const conn = str(ref?.conn).trim();
54587
+ if (conn && lib.has(conn)) {
54588
+ const r = lib.get(conn);
54589
+ return `${str(r?.type)}/${str(r?.detail)}`;
54590
+ }
54591
+ return str(ref?.detail).trim() || str(ref?.note).trim() || "";
54592
+ }
54593
+ function jointsSummary(a, b) {
54594
+ const kind = (sig) => sig.split("@")[0] ?? "";
54595
+ const setA = new Set(a), setB = new Set(b);
54596
+ const gone = a.filter((x) => !setB.has(x));
54597
+ const got = b.filter((x) => !setA.has(x));
54598
+ const gk = gone.length ? kind(gone[0] ?? "") : "";
54599
+ const tk = got.length ? kind(got[0] ?? "") : "";
54600
+ if (gone.length && got.length && gk === tk) return `${tk || "connection"} params changed`;
54601
+ if (got.length) return `${tk || "connection"} added`;
54602
+ if (gone.length) return `${gk || "connection"} removed`;
54603
+ return "connection changed";
54604
+ }
54605
+ function indexJoints(contract, lib) {
54606
+ const idx = /* @__PURE__ */ new Map();
54607
+ for (const j of asArray(contract?.joints)) {
54608
+ const sig = `${str(j?.kind)}@${str(j?.at)}:${connIdentity(j, lib)}:${stable(j?.params)}:${stable(asArray(j?.secondaries).map(str).sort())}:${stable(j?.place)}`;
54609
+ for (const ref of [str(j?.main), ...asArray(j?.secondaries).map(str)].filter(Boolean)) {
54610
+ const arr = idx.get(ref);
54611
+ if (arr) arr.push(sig);
54612
+ else idx.set(ref, [sig]);
54613
+ }
54614
+ }
54615
+ for (const sigs of idx.values()) sigs.sort();
54616
+ return idx;
54617
+ }
54618
+ function diffContracts(from, to) {
54619
+ const A = collect(from);
54620
+ const B = collect(to);
54621
+ const dupKeys = [.../* @__PURE__ */ new Set([...A.dupKeys, ...B.dupKeys])];
54622
+ const ambiguous = new Set(dupKeys);
54623
+ const libA = new Map(asArray(from?.connections).map((r) => [str(r?.id), r]));
54624
+ const libB = new Map(asArray(to?.connections).map((r) => [str(r?.id), r]));
54625
+ const jointsA = indexJoints(from, libA);
54626
+ const jointsB = indexJoints(to, libB);
54627
+ const ambiguousJoints = /* @__PURE__ */ new Set();
54628
+ const flagAmbiguousJoints = (contract, idSheets) => {
54629
+ for (const j of asArray(contract?.joints)) {
54630
+ const refs = [str(j?.main), ...asArray(j?.secondaries).map(str)].filter(Boolean);
54631
+ if (refs.some((r) => (idSheets.get(r)?.size ?? 0) > 1)) ambiguousJoints.add(str(j?.id));
54632
+ }
54633
+ };
54634
+ flagAmbiguousJoints(from, A.idSheets);
54635
+ flagAmbiguousJoints(to, B.idSheets);
54636
+ const added = [];
54637
+ const removed = [];
54638
+ for (const [key, b] of B.byKey) if (!A.byKey.has(key)) added.push(refOf(b));
54639
+ for (const [key, a] of A.byKey) if (!B.byKey.has(key)) removed.push(refOf(a));
54640
+ const resized = [];
54641
+ const material = [];
54642
+ const moved = [];
54643
+ const connections = [];
54644
+ let unchanged = 0;
54645
+ let anyScaleUnknown = false;
54646
+ for (const [key, a] of A.byKey) {
54647
+ const b = B.byKey.get(key);
54648
+ if (!b || ambiguous.has(key)) continue;
54649
+ let changed = false;
54650
+ if (normProfile(a.profile) !== normProfile(b.profile)) {
54651
+ resized.push({ ref: refOf(b), from: a.profile, to: b.profile });
54652
+ changed = true;
54653
+ }
54654
+ if (a.material.trim().toUpperCase() !== b.material.trim().toUpperCase() && (a.material || b.material)) {
54655
+ material.push({ ref: refOf(b), from: a.material, to: b.material });
54656
+ changed = true;
54657
+ }
54658
+ const planMove = a.wp.length && b.wp.length ? beamMoveFeet(a, b) : { feet: 0, flipped: false };
54659
+ const feet = Math.max(planMove.feet, elevMoveFeet(a, b));
54660
+ if (feet > MOVE_TOL_FT) {
54661
+ const scaleUnknown = !a.hasScale || !b.hasScale;
54662
+ moved.push({ ref: refOf(b), feet: Math.round(feet * 10) / 10, ...scaleUnknown ? { scaleUnknown: true } : {} });
54663
+ if (scaleUnknown) anyScaleUnknown = true;
54664
+ changed = true;
54665
+ }
54666
+ const eA = [connIdentity(a.ends?.[0], libA), connIdentity(a.ends?.[1], libA)];
54667
+ const eB = [connIdentity(b.ends?.[0], libB), connIdentity(b.ends?.[1], libB)];
54668
+ const [eB0, eB1] = planMove.flipped ? [eB[1], eB[0]] : [eB[0], eB[1]];
54669
+ const parts = [];
54670
+ if (eA[0] !== eB0) parts.push(`end 1: ${eA[0] || "none"} \u2192 ${eB0 || "none"}`);
54671
+ if (eA[1] !== eB1) parts.push(`end 2: ${eA[1] || "none"} \u2192 ${eB1 || "none"}`);
54672
+ const cA = connIdentity(a.col, libA), cB = connIdentity(b.col, libB);
54673
+ if (cA !== cB) parts.push(`column: ${cA || "none"} \u2192 ${cB || "none"}`);
54674
+ if (!((A.idSheets.get(a.id)?.size ?? 0) > 1 || (B.idSheets.get(b.id)?.size ?? 0) > 1)) {
54675
+ const jA = jointsA.get(a.id) ?? [];
54676
+ const jB = jointsB.get(b.id) ?? [];
54677
+ if (stable(jA) !== stable(jB)) parts.push(jointsSummary(jA, jB));
54678
+ }
54679
+ if (parts.length) {
54680
+ connections.push({ ref: refOf(b), summary: parts.join("; ") });
54681
+ changed = true;
54682
+ }
54683
+ if (!changed) unchanged++;
54684
+ }
54685
+ const keysA = A.byKey.size;
54686
+ const keysB = B.byKey.size;
54687
+ let shared = 0;
54688
+ for (const k of A.byKey.keys()) if (B.byKey.has(k)) shared++;
54689
+ const smaller = Math.min(keysA, keysB);
54690
+ const identityNotPreserved = keysA >= 5 && keysB >= 5 && smaller > 0 && shared / smaller < 0.1;
54691
+ const bom = (x) => {
54692
+ try {
54693
+ return contractToBom(x);
54694
+ } catch {
54695
+ return { totalLb: 0, totalTons: 0 };
54696
+ }
54697
+ };
54698
+ const fromBom = bom(from);
54699
+ const toBom = bom(to);
54700
+ const netLb = toBom.totalLb - fromBom.totalLb;
54701
+ const warnings = {
54702
+ ...identityNotPreserved ? { identityNotPreserved: true } : {},
54703
+ ...dupKeys.length ? { duplicateKeys: dupKeys } : {},
54704
+ ...ambiguousJoints.size ? { ambiguousJoints: [...ambiguousJoints] } : {},
54705
+ ...anyScaleUnknown ? { scaleUnknown: true } : {}
54706
+ };
54707
+ return {
54708
+ from: 0,
54709
+ to: 0,
54710
+ tonnage: {
54711
+ fromLb: fromBom.totalLb,
54712
+ toLb: toBom.totalLb,
54713
+ netLb,
54714
+ fromTons: fromBom.totalTons,
54715
+ toTons: toBom.totalTons,
54716
+ netTons: Math.round(netLb / 2e3 * 10) / 10
54717
+ },
54718
+ added,
54719
+ removed,
54720
+ resized,
54721
+ moved,
54722
+ material,
54723
+ connections,
54724
+ unchanged,
54725
+ warnings
54726
+ };
54727
+ }
54728
+
54729
+ // version-diff.ts
54730
+ function computeVersionDiff(id, n, base) {
54731
+ if (!Number.isInteger(n) || n < 1) return { code: 400, body: { ok: false, error: "n must be a positive integer version number" } };
54732
+ const head = listVersions(id)[0]?.n ?? 0;
54733
+ if (head === 0) return { code: 404, body: { ok: false, error: "no versions for this project" } };
54734
+ const to = readVersionSkeleton(id, n);
54735
+ if (to == null) return { code: 404, body: { ok: false, error: `version v${n} not found` } };
54736
+ if (n === 1) {
54737
+ const empty = diffContracts({}, to);
54738
+ return {
54739
+ code: 200,
54740
+ body: { ok: true, diff: { ...empty, from: 0, to: 1, firstVersion: true, added: [], tonnage: { fromLb: 0, toLb: 0, netLb: 0, fromTons: 0, toTons: 0, netTons: 0 } } }
54741
+ };
54742
+ }
54743
+ const b = base ?? n - 1;
54744
+ if (!Number.isInteger(b) || b < 1 || b >= n) return { code: 400, body: { ok: false, error: `base must be an integer in 1..${n - 1}` } };
54745
+ const from = readVersionSkeleton(id, b);
54746
+ if (from == null) return { code: 404, body: { ok: false, error: `base version v${b} not found` } };
54747
+ const diff = diffContracts(from, to);
54748
+ diff.from = b;
54749
+ diff.to = n;
54750
+ return { code: 200, body: { ok: true, diff } };
54751
+ }
54752
+
54753
+ // project-sources-store.ts
54754
+ var import_node_crypto8 = require("node:crypto");
54379
54755
  var import_node_fs22 = require("node:fs");
54756
+ var import_node_path20 = require("node:path");
54757
+ var sourcesDir = (id) => (0, import_node_path20.join)(projectDir(id), "sources");
54758
+ var safeExt = (ext) => typeof ext === "string" && /^[a-z0-9]{1,8}$/i.test(ext) ? ext.toLowerCase() : "bin";
54759
+ function writeAtomic2(path, buf) {
54760
+ const tmp = `${path}.${process.pid}.tmp`;
54761
+ (0, import_node_fs22.writeFileSync)(tmp, buf);
54762
+ (0, import_node_fs22.renameSync)(tmp, path);
54763
+ }
54764
+ function saveSource(id, file) {
54765
+ (0, import_node_fs22.mkdirSync)(sourcesDir(id), { recursive: true });
54766
+ const sha2562 = (0, import_node_crypto8.createHash)("sha256").update(file.buf).digest("hex");
54767
+ const ext = safeExt(file.ext);
54768
+ const p = (0, import_node_path20.join)(sourcesDir(id), `${sha2562}.${ext}`);
54769
+ if (!(0, import_node_fs22.existsSync)(p)) writeAtomic2(p, file.buf);
54770
+ return { name: String(file.name), sha256: sha2562, ext, bytes: file.buf.length };
54771
+ }
54772
+
54773
+ // contract-bake.ts
54774
+ var import_node_fs23 = require("node:fs");
54380
54775
  var import_yaml5 = __toESM(require_dist6(), 1);
54381
54776
  function bakeContractIntoApp(sourcePath, contract) {
54382
- const doc = (0, import_yaml5.parseDocument)((0, import_node_fs22.readFileSync)(sourcePath, "utf8"));
54777
+ const doc = (0, import_yaml5.parseDocument)((0, import_node_fs23.readFileSync)(sourcePath, "utf8"));
54383
54778
  if (doc.errors.length > 0) {
54384
54779
  throw new Error(`contract bake: source is not valid YAML: ${doc.errors[0]?.message ?? "parse error"}`);
54385
54780
  }
@@ -54429,7 +54824,7 @@ function bakeContractIntoApp(sourcePath, contract) {
54429
54824
  );
54430
54825
  }
54431
54826
  doc.setIn(["nodes", idx, "config", "takeoff"], baked);
54432
- (0, import_node_fs22.writeFileSync)(sourcePath, doc.toString());
54827
+ (0, import_node_fs23.writeFileSync)(sourcePath, doc.toString());
54433
54828
  }
54434
54829
 
54435
54830
  // vectorize.ts
@@ -54760,16 +55155,16 @@ var GROUPS = {
54760
55155
  custom: { key: "custom", label: "Imported connections", color: "#8a97a8" }
54761
55156
  };
54762
55157
  var EMBED = 1;
54763
- function num(params, key, def) {
55158
+ function num2(params, key, def) {
54764
55159
  const v = params?.[key];
54765
55160
  return typeof v === "number" && isFinite(v) ? v : def;
54766
55161
  }
54767
55162
  function pos(params, key, def) {
54768
- const v = num(params, key, def);
55163
+ const v = num2(params, key, def);
54769
55164
  return v > 0 ? v : def;
54770
55165
  }
54771
55166
  function intMin1(params, key, def) {
54772
- return Math.max(1, Math.round(num(params, key, def)));
55167
+ return Math.max(1, Math.round(num2(params, key, def)));
54773
55168
  }
54774
55169
  function finite3(a) {
54775
55170
  return Array.isArray(a) && a.length >= 3 && a.every((n) => typeof n === "number" && isFinite(n));
@@ -54824,18 +55219,18 @@ function expandBasePlate(joint, col) {
54824
55219
  const [bx, by, bz] = base;
54825
55220
  const { w, d } = col.dims;
54826
55221
  const thickness = pos(p, "thickness", 25);
54827
- const margin = Math.max(0, num(p, "margin", 75));
55222
+ const margin = Math.max(0, num2(p, "margin", 75));
54828
55223
  const width = pos(p, "plateWidth", Math.max(w, d) + 2 * margin);
54829
55224
  const depth = pos(p, "plateDepth", Math.max(w, d) + 2 * margin);
54830
55225
  const boltDia = pos(p, "boltDia", 24);
54831
- const clearance = num(p, "holeClearance", 6);
54832
- const edge = num(p, "edgeDist", Math.max(1.5 * boltDia, 40));
55226
+ const clearance = num2(p, "holeClearance", 6);
55227
+ const edge = num2(p, "edgeDist", Math.max(1.5 * boltDia, 40));
54833
55228
  const cols = intMin1(p, "boltCols", 2);
54834
55229
  const rows = intMin1(p, "boltRows", 2);
54835
- const weldLeg = num(p, "weldLeg", 8);
54836
- const projBelow = num(p, "projBelow", 75);
54837
- const embedment = Math.max(0, num(p, "embedment", 0));
54838
- const grout = Math.max(0, num(p, "grout", 0));
55230
+ const weldLeg = num2(p, "weldLeg", 8);
55231
+ const projBelow = num2(p, "projBelow", 75);
55232
+ const embedment = Math.max(0, num2(p, "embedment", 0));
55233
+ const grout = Math.max(0, num2(p, "grout", 0));
54839
55234
  const rodBelow = embedment > 0 ? grout + embedment : projBelow;
54840
55235
  const nutH = pos(p, "nutHeight", 0.8 * boltDia);
54841
55236
  const nutAF = pos(p, "nutAcrossFlats", 1.6 * boltDia);
@@ -54945,14 +55340,14 @@ function beamCopes(beam, support, at, params) {
54945
55340
  if (!finite3(beam.from) || !finite3(beam.to) || !beam.dims || !(beam.dims.d > 0) || !(beam.dims.w > 0)) return {};
54946
55341
  if (profileKind(support.profile) !== "I") return {};
54947
55342
  const endPt = at === "end1" ? beam.to : beam.from;
54948
- const gap = Math.max(0, num(params, "clearance", 12.7));
55343
+ const gap = Math.max(0, num2(params, "clearance", 12.7));
54949
55344
  const beamMidZ = endPt[2] + (typeof beam.posOffset === "number" && isFinite(beam.posOffset) ? beam.posOffset : 0);
54950
55345
  const beamTopZ = beamMidZ + beam.dims.d / 2, beamBotZ = beamMidZ - beam.dims.d / 2;
54951
55346
  const supMidZ = supportWorkZAt(support, endPt) + (typeof support.posOffset === "number" && isFinite(support.posOffset) ? support.posOffset : 0);
54952
55347
  const supTopZ = supMidZ + support.dims.d / 2, supBotZ = supMidZ - support.dims.d / 2;
54953
55348
  const tfS = flangeThk(support.profile, support.dims.d);
54954
- const kClear = Math.max(0, num(params, "copeKClear", 12.7));
54955
- const minLen = Math.max(0, num(params, "copeMinLength", 31.75));
55349
+ const kClear = Math.max(0, num2(params, "copeKClear", 12.7));
55350
+ const minLen = Math.max(0, num2(params, "copeMinLength", 31.75));
54956
55351
  const kBand = tfS + kClear;
54957
55352
  const webLo = supBotZ + kBand, webHi = supTopZ - kBand;
54958
55353
  if (!(webLo < webHi && beamTopZ > webLo && beamBotZ < webHi)) return {};
@@ -54995,14 +55390,14 @@ function expandShearPlate(joint, beam, support) {
54995
55390
  const cols = intMin1(p, "boltCols", 1);
54996
55391
  const rows = intMin1(p, "boltRows", 3);
54997
55392
  const pitch = pos(p, "boltPitch", 70);
54998
- const holeClr = num(p, "holeClearance", 2);
54999
- const edge = Math.max(0, num(p, "edgeDist", Math.max(1.5 * boltDia, 30)));
55000
- const weldLeg = num(p, "weldLeg", 6);
55001
- const clearance = Math.max(0, num(p, "clearance", 12.7));
55393
+ const holeClr = num2(p, "holeClearance", 2);
55394
+ const edge = Math.max(0, num2(p, "edgeDist", Math.max(1.5 * boltDia, 30)));
55395
+ const weldLeg = num2(p, "weldLeg", 6);
55396
+ const clearance = Math.max(0, num2(p, "clearance", 12.7));
55002
55397
  const stiffener = p?.["stiffener"] === true;
55003
55398
  const height = pos(p, "plateHeight", (rows - 1) * pitch + 2 * edge);
55004
55399
  const twHalf = webHalfThk(beam.profile, beam.dims.w);
55005
- const webSide = num(p, "webSide", 1) >= 0 ? 1 : -1;
55400
+ const webSide = num2(p, "webSide", 1) >= 0 ? 1 : -1;
55006
55401
  const pOff = webSide * (twHalf + thickness / 2);
55007
55402
  const u0 = support ? webHalfThk(support.profile, support.dims.w) : 0;
55008
55403
  const edgeV = Math.min(edge, height * 0.4);
@@ -55333,72 +55728,12 @@ function contractToScene(contractInput) {
55333
55728
  };
55334
55729
  }
55335
55730
 
55336
- // bom-format.ts
55337
- var round1 = (n) => Math.round(n * 10) / 10;
55338
- function contractToBom(contractInput) {
55339
- const c = contractInput ?? {};
55340
- const weights = c.weights ?? {};
55341
- const agg = /* @__PURE__ */ new Map();
55342
- for (const plan of c.plans ?? []) {
55343
- const ptPerFt = typeof plan.pt_per_ft === "number" && plan.pt_per_ft > 0 ? plan.pt_per_ft : 12;
55344
- for (const m of plan.members ?? []) {
55345
- const profile = m.profile;
55346
- if (!profile) continue;
55347
- const plf = weights[profile];
55348
- if (plf == null) continue;
55349
- let lenFt;
55350
- if (m.role === "column") {
55351
- const tos = m.col?.tos;
55352
- const bos = m.col?.bos;
55353
- if (tos == null || bos == null) continue;
55354
- lenFt = Math.abs(tos - bos) / 12;
55355
- } else {
55356
- const wp = m.wp;
55357
- if (!Array.isArray(wp) || wp.length < 2) continue;
55358
- const a = wp[0];
55359
- const b = wp[1];
55360
- if (!a || !b) continue;
55361
- lenFt = Math.hypot(a[0] - b[0], a[1] - b[1]) / ptPerFt;
55362
- }
55363
- const g = agg.get(profile) ?? { qty: 0, lenFt: 0, plf };
55364
- g.qty += 1;
55365
- g.lenFt += lenFt;
55366
- agg.set(profile, g);
55367
- }
55368
- }
55369
- const rows = [...agg.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([profile, g]) => ({
55370
- Profile: profile,
55371
- Qty: g.qty,
55372
- "Length (ft)": round1(g.lenFt),
55373
- "lb/ft": g.plf,
55374
- "Weight (lb)": Math.round(g.lenFt * g.plf)
55375
- }));
55376
- const totalLb = rows.reduce((t, r) => t + r["Weight (lb)"], 0);
55377
- const totalQty = rows.reduce((t, r) => t + r.Qty, 0);
55378
- const totalLenFt = round1(rows.reduce((t, r) => t + r["Length (ft)"], 0));
55379
- const totalTons = round1(totalLb / 2e3);
55380
- rows.push({
55381
- Profile: "TOTAL",
55382
- Qty: totalQty,
55383
- "Length (ft)": totalLenFt,
55384
- "lb/ft": "",
55385
- "Weight (lb)": totalLb
55386
- });
55387
- return {
55388
- title: `Bill of Materials \u2014 ${totalTons} tons (${totalLb.toLocaleString("en-US")} lb)`,
55389
- columns: ["Profile", "Qty", "Length (ft)", "lb/ft", "Weight (lb)"],
55390
- rows,
55391
- totalLb,
55392
- totalTons
55393
- };
55394
- }
55395
-
55396
55731
  // bom-export.ts
55397
55732
  var import_node_os14 = require("node:os");
55398
- var import_node_path20 = require("node:path");
55733
+ var import_node_path21 = require("node:path");
55399
55734
 
55400
55735
  // node_modules/write-excel-file/modules/export/writeXlsxFileNode.js
55401
- var import_node_fs23 = __toESM(require("node:fs"), 1);
55736
+ var import_node_fs24 = __toESM(require("node:fs"), 1);
55402
55737
 
55403
55738
  // node_modules/write-excel-file/modules/xlsx/helpers/features/getAdditionalContent.js
55404
55739
  function _createForOfIteratorHelperLoose(r, e) {
@@ -59153,17 +59488,17 @@ try {
59153
59488
  tds = 1;
59154
59489
  } catch (e) {
59155
59490
  }
59156
- function strToU8(str, latin1) {
59491
+ function strToU8(str2, latin1) {
59157
59492
  if (latin1) {
59158
- var ar_1 = new u8(str.length);
59159
- for (var i = 0; i < str.length; ++i)
59160
- ar_1[i] = str.charCodeAt(i);
59493
+ var ar_1 = new u8(str2.length);
59494
+ for (var i = 0; i < str2.length; ++i)
59495
+ ar_1[i] = str2.charCodeAt(i);
59161
59496
  return ar_1;
59162
59497
  }
59163
59498
  if (te)
59164
- return te.encode(str);
59165
- var l = str.length;
59166
- var ar = new u8(str.length + (str.length >> 1));
59499
+ return te.encode(str2);
59500
+ var l = str2.length;
59501
+ var ar = new u8(str2.length + (str2.length >> 1));
59167
59502
  var ai = 0;
59168
59503
  var w = function(v) {
59169
59504
  ar[ai++] = v;
@@ -59174,13 +59509,13 @@ function strToU8(str, latin1) {
59174
59509
  n.set(ar);
59175
59510
  ar = n;
59176
59511
  }
59177
- var c = str.charCodeAt(i);
59512
+ var c = str2.charCodeAt(i);
59178
59513
  if (c < 128 || latin1)
59179
59514
  w(c);
59180
59515
  else if (c < 2048)
59181
59516
  w(192 | c >> 6), w(128 | c & 63);
59182
59517
  else if (c > 55295 && c < 57344)
59183
- c = 65536 + (c & 1023 << 10) | str.charCodeAt(++i) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63);
59518
+ c = 65536 + (c & 1023 << 10) | str2.charCodeAt(++i) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63);
59184
59519
  else
59185
59520
  w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63);
59186
59521
  }
@@ -59570,7 +59905,7 @@ function writeXlsxFile(arg1, arg2, arg3) {
59570
59905
  },
59571
59906
  toFile: function toFile(filePath) {
59572
59907
  return createReadableStream().then(function(readableStream) {
59573
- return pipe(readableStream, import_node_fs23.default.createWriteStream(filePath));
59908
+ return pipe(readableStream, import_node_fs24.default.createWriteStream(filePath));
59574
59909
  });
59575
59910
  }
59576
59911
  };
@@ -59595,8 +59930,8 @@ function pipe(readableStream, writableStream) {
59595
59930
 
59596
59931
  // bom-export.ts
59597
59932
  function bomExportPath(appId, format) {
59598
- const root = process.env.FLOLESS_HOME ?? (0, import_node_path20.join)((0, import_node_os14.homedir)(), ".floless");
59599
- return (0, import_node_path20.join)(root, "exports", appId, `${appId}-bom.${format}`);
59933
+ const root = process.env.FLOLESS_HOME ?? (0, import_node_path21.join)((0, import_node_os14.homedir)(), ".floless");
59934
+ return (0, import_node_path21.join)(root, "exports", appId, `${appId}-bom.${format}`);
59600
59935
  }
59601
59936
  function csvField(v) {
59602
59937
  let s = String(v);
@@ -59624,11 +59959,11 @@ async function bomToXlsx(bom) {
59624
59959
  }
59625
59960
 
59626
59961
  // scene-bake.ts
59627
- var import_node_fs24 = require("node:fs");
59628
- var import_node_path21 = require("node:path");
59962
+ var import_node_fs25 = require("node:fs");
59963
+ var import_node_path22 = require("node:path");
59629
59964
  var import_yaml6 = __toESM(require_dist6(), 1);
59630
59965
  function bakeSceneIntoApp(sourcePath, scene, agent = "viewer-3d") {
59631
- const doc = (0, import_yaml6.parseDocument)((0, import_node_fs24.readFileSync)(sourcePath, "utf8"));
59966
+ const doc = (0, import_yaml6.parseDocument)((0, import_node_fs25.readFileSync)(sourcePath, "utf8"));
59632
59967
  if (doc.errors.length > 0) {
59633
59968
  throw new Error(`scene bake: source is not valid YAML: ${doc.errors[0]?.message ?? "parse error"}`);
59634
59969
  }
@@ -59637,10 +59972,10 @@ function bakeSceneIntoApp(sourcePath, scene, agent = "viewer-3d") {
59637
59972
  const idx = items.findIndex((it) => ((0, import_yaml6.isMap)(it) ? it.toJSON() : null)?.agent === agent);
59638
59973
  if (idx < 0) throw new Error(`no ${agent} render node to bake the scene into`);
59639
59974
  doc.setIn(["nodes", idx, "config", "scene"], scene);
59640
- (0, import_node_fs24.writeFileSync)(sourcePath, doc.toString());
59975
+ (0, import_node_fs25.writeFileSync)(sourcePath, doc.toString());
59641
59976
  }
59642
59977
  function bakeNodeConfigById(sourcePath, nodeId, patch2) {
59643
- const doc = (0, import_yaml6.parseDocument)((0, import_node_fs24.readFileSync)(sourcePath, "utf8"));
59978
+ const doc = (0, import_yaml6.parseDocument)((0, import_node_fs25.readFileSync)(sourcePath, "utf8"));
59644
59979
  if (doc.errors.length > 0) {
59645
59980
  throw new Error(`node bake: source is not valid YAML: ${doc.errors[0]?.message ?? "parse error"}`);
59646
59981
  }
@@ -59649,12 +59984,12 @@ function bakeNodeConfigById(sourcePath, nodeId, patch2) {
59649
59984
  const idx = items.findIndex((it) => ((0, import_yaml6.isMap)(it) ? it.toJSON() : null)?.id === nodeId);
59650
59985
  if (idx < 0) throw new Error(`no node with id "${nodeId}"`);
59651
59986
  for (const [key, value] of Object.entries(patch2)) doc.setIn(["nodes", idx, "config", key], value);
59652
- (0, import_node_fs24.writeFileSync)(sourcePath, doc.toString());
59987
+ (0, import_node_fs25.writeFileSync)(sourcePath, doc.toString());
59653
59988
  }
59654
59989
  function writeViewer3dApp(dir, appId, scene) {
59655
- (0, import_node_fs24.mkdirSync)(dir, { recursive: true });
59656
- const flo = (0, import_node_path21.join)(dir, `${appId}.flo`);
59657
- (0, import_node_fs24.writeFileSync)(flo, [
59990
+ (0, import_node_fs25.mkdirSync)(dir, { recursive: true });
59991
+ const flo = (0, import_node_path22.join)(dir, `${appId}.flo`);
59992
+ (0, import_node_fs25.writeFileSync)(flo, [
59658
59993
  `app: ${appId}`,
59659
59994
  "version: 0.1.0",
59660
59995
  "display-name: Steel 3D",
@@ -59675,11 +60010,11 @@ function writeViewer3dApp(dir, appId, scene) {
59675
60010
  return flo;
59676
60011
  }
59677
60012
  function writeIfcApp(dir, appId, scene, outputPath, opts = {}) {
59678
- (0, import_node_fs24.mkdirSync)(dir, { recursive: true });
59679
- const flo = (0, import_node_path21.join)(dir, `${appId}.flo`);
60013
+ (0, import_node_fs25.mkdirSync)(dir, { recursive: true });
60014
+ const flo = (0, import_node_path22.join)(dir, `${appId}.flo`);
59680
60015
  const displayName = opts.displayName ?? "Steel IFC";
59681
60016
  const description = opts.description ?? "IFC file written from an approved steel.takeoff/v1 contract (a companion export; the contract is the source of truth).";
59682
- (0, import_node_fs24.writeFileSync)(flo, [
60017
+ (0, import_node_fs25.writeFileSync)(flo, [
59683
60018
  `app: ${appId}`,
59684
60019
  "version: 0.1.0",
59685
60020
  `display-name: ${displayName}`,
@@ -59702,9 +60037,9 @@ function writeIfcApp(dir, appId, scene, outputPath, opts = {}) {
59702
60037
  return flo;
59703
60038
  }
59704
60039
  function writeTeklaApp(dir, appId, scene, teklaVersion = "2026.0") {
59705
- (0, import_node_fs24.mkdirSync)(dir, { recursive: true });
59706
- const flo = (0, import_node_path21.join)(dir, `${appId}.flo`);
59707
- (0, import_node_fs24.writeFileSync)(flo, [
60040
+ (0, import_node_fs25.mkdirSync)(dir, { recursive: true });
60041
+ const flo = (0, import_node_path22.join)(dir, `${appId}.flo`);
60042
+ (0, import_node_fs25.writeFileSync)(flo, [
59708
60043
  `app: ${appId}`,
59709
60044
  "version: 0.1.0",
59710
60045
  "display-name: Steel to Tekla",
@@ -59922,16 +60257,16 @@ function memberTons(contract, m) {
59922
60257
  }
59923
60258
  function rollup(members, countWeighted = false) {
59924
60259
  const counts = emptyCounts();
59925
- let num2 = 0, den = 0, tons = 0;
60260
+ let num3 = 0, den = 0, tons = 0;
59926
60261
  for (const m of members) {
59927
60262
  counts[m.band]++;
59928
60263
  if (m.band === "rfi") continue;
59929
60264
  const w = countWeighted ? 1 : m.tons;
59930
- num2 += w * BAND_WEIGHT[m.band];
60265
+ num3 += w * BAND_WEIGHT[m.band];
59931
60266
  den += w;
59932
60267
  tons += m.tons;
59933
60268
  }
59934
- return { score: den > 0 ? Math.round(num2 / den * 100) : null, tons, counts };
60269
+ return { score: den > 0 ? Math.round(num3 / den * 100) : null, tons, counts };
59935
60270
  }
59936
60271
  function bandEnd(end, rows) {
59937
60272
  const row = end.conn ? rows.get(end.conn) : void 0;
@@ -59967,14 +60302,14 @@ function scoreConnections(contractInput) {
59967
60302
  }
59968
60303
  });
59969
60304
  const counts = emptyCounts();
59970
- let num2 = 0, den = 0;
60305
+ let num3 = 0, den = 0;
59971
60306
  for (const e of byEnd) {
59972
60307
  counts[e.band]++;
59973
60308
  if (e.band === "rfi") continue;
59974
- num2 += BAND_WEIGHT[e.band];
60309
+ num3 += BAND_WEIGHT[e.band];
59975
60310
  den += 1;
59976
60311
  }
59977
- const category = { score: den > 0 ? Math.round(num2 / den * 100) : null, tons: 0, counts };
60312
+ const category = { score: den > 0 ? Math.round(num3 / den * 100) : null, tons: 0, counts };
59978
60313
  return { byEnd, category };
59979
60314
  }
59980
60315
  function scoreContract(contractInput) {
@@ -60021,7 +60356,7 @@ function scoreContract(contractInput) {
60021
60356
  const columns = rollup(byMember.filter((m) => m.role === "column"));
60022
60357
  const details = rollupDetails(byDetail);
60023
60358
  const scored = byMember.filter((m) => m.band !== "rfi");
60024
- const num2 = scored.reduce((s, m) => s + m.tons * BAND_WEIGHT[m.band], 0);
60359
+ const num3 = scored.reduce((s, m) => s + m.tons * BAND_WEIGHT[m.band], 0);
60025
60360
  const den = scored.reduce((s, m) => s + m.tons, 0);
60026
60361
  return {
60027
60362
  byMember,
@@ -60039,7 +60374,7 @@ function scoreContract(contractInput) {
60039
60374
  note: "Approximate in v1 \u2014 precise per-segment binding is Slice 2."
60040
60375
  },
60041
60376
  overall: {
60042
- score: den > 0 ? Math.round(num2 / den * 100) : null,
60377
+ score: den > 0 ? Math.round(num3 / den * 100) : null,
60043
60378
  tons: den,
60044
60379
  rfiCount: byMember.filter((m) => m.band === "rfi").length
60045
60380
  }
@@ -60051,13 +60386,13 @@ function detailSheet(text) {
60051
60386
  }
60052
60387
  function rollupDetails(details) {
60053
60388
  const counts = emptyCounts();
60054
- let num2 = 0, den = 0;
60389
+ let num3 = 0, den = 0;
60055
60390
  for (const d of details) {
60056
60391
  counts[d.band]++;
60057
- num2 += BAND_WEIGHT[d.band];
60392
+ num3 += BAND_WEIGHT[d.band];
60058
60393
  den += 1;
60059
60394
  }
60060
- return { score: den > 0 ? Math.round(num2 / den * 100) : null, tons: 0, counts };
60395
+ return { score: den > 0 ? Math.round(num3 / den * 100) : null, tons: 0, counts };
60061
60396
  }
60062
60397
 
60063
60398
  // contract-score.ts
@@ -60112,13 +60447,13 @@ function scoreContract2(contractInput) {
60112
60447
  }
60113
60448
 
60114
60449
  // app-lifecycle.ts
60115
- var import_node_fs27 = require("node:fs");
60450
+ var import_node_fs28 = require("node:fs");
60116
60451
  var import_node_os16 = require("node:os");
60117
- var import_node_path24 = require("node:path");
60452
+ var import_node_path25 = require("node:path");
60118
60453
 
60119
60454
  // routines.ts
60120
- var import_node_fs26 = require("node:fs");
60121
- var import_node_path23 = require("node:path");
60455
+ var import_node_fs27 = require("node:fs");
60456
+ var import_node_path24 = require("node:path");
60122
60457
 
60123
60458
  // sse.ts
60124
60459
  var clients = /* @__PURE__ */ new Set();
@@ -60155,11 +60490,11 @@ function clientCount() {
60155
60490
  }
60156
60491
 
60157
60492
  // trigger-sessions.ts
60158
- var import_node_fs25 = require("node:fs");
60493
+ var import_node_fs26 = require("node:fs");
60159
60494
  var import_node_os15 = require("node:os");
60160
- var import_node_path22 = require("node:path");
60495
+ var import_node_path23 = require("node:path");
60161
60496
  var import_yaml7 = __toESM(require_dist6(), 1);
60162
- var AGENTS_DIR2 = process.env.AWARE_HOME ? (0, import_node_path22.join)(process.env.AWARE_HOME, "agents") : (0, import_node_path22.join)((0, import_node_os15.homedir)(), ".aware", "agents");
60497
+ var AGENTS_DIR2 = process.env.AWARE_HOME ? (0, import_node_path23.join)(process.env.AWARE_HOME, "agents") : (0, import_node_path23.join)((0, import_node_os15.homedir)(), ".aware", "agents");
60163
60498
  function summarizeFire(data) {
60164
60499
  if (!data) return "event";
60165
60500
  const type = typeof data.type === "string" ? data.type : "";
@@ -60176,10 +60511,10 @@ function mapTriggerState(phase) {
60176
60511
  function isHostBacked(agent, agentsDir = AGENTS_DIR2) {
60177
60512
  const safe = (n) => !n.includes("/") && !n.includes("\\") && !n.includes("..");
60178
60513
  if (!safe(agent)) return false;
60179
- const manifestPath = (0, import_node_path22.join)(agentsDir, agent, "manifest.yaml");
60180
- if (!(0, import_node_fs25.existsSync)(manifestPath)) return false;
60514
+ const manifestPath = (0, import_node_path23.join)(agentsDir, agent, "manifest.yaml");
60515
+ if (!(0, import_node_fs26.existsSync)(manifestPath)) return false;
60181
60516
  try {
60182
- const doc = (0, import_yaml7.parse)((0, import_node_fs25.readFileSync)(manifestPath, "utf8"));
60517
+ const doc = (0, import_yaml7.parse)((0, import_node_fs26.readFileSync)(manifestPath, "utf8"));
60183
60518
  const transport = doc?.transport;
60184
60519
  return !!(transport && typeof transport === "object" && "cli" in transport);
60185
60520
  } catch {
@@ -60464,7 +60799,7 @@ var RoutineError = class extends Error {
60464
60799
  }
60465
60800
  status;
60466
60801
  };
60467
- var ROUTINES_FILE = (0, import_node_path23.join)(flolessRoot, "routines.json");
60802
+ var ROUTINES_FILE = (0, import_node_path24.join)(flolessRoot, "routines.json");
60468
60803
  var routines = [];
60469
60804
  var loaded = false;
60470
60805
  function ensureLoaded() {
@@ -60500,10 +60835,10 @@ function sanitizeRoutine(raw) {
60500
60835
  };
60501
60836
  }
60502
60837
  function loadFromDisk() {
60503
- if (!(0, import_node_fs26.existsSync)(ROUTINES_FILE)) return [];
60838
+ if (!(0, import_node_fs27.existsSync)(ROUTINES_FILE)) return [];
60504
60839
  let text;
60505
60840
  try {
60506
- text = (0, import_node_fs26.readFileSync)(ROUTINES_FILE, "utf8");
60841
+ text = (0, import_node_fs27.readFileSync)(ROUTINES_FILE, "utf8");
60507
60842
  } catch {
60508
60843
  return [];
60509
60844
  }
@@ -60512,17 +60847,17 @@ function loadFromDisk() {
60512
60847
  return Array.isArray(parsed) ? parsed.map(sanitizeRoutine).filter((r) => r !== null) : [];
60513
60848
  } catch {
60514
60849
  try {
60515
- (0, import_node_fs26.renameSync)(ROUTINES_FILE, `${ROUTINES_FILE}.corrupt-${Date.now()}`);
60850
+ (0, import_node_fs27.renameSync)(ROUTINES_FILE, `${ROUTINES_FILE}.corrupt-${Date.now()}`);
60516
60851
  } catch {
60517
60852
  }
60518
60853
  return [];
60519
60854
  }
60520
60855
  }
60521
60856
  function saveRoutines() {
60522
- if (!(0, import_node_fs26.existsSync)(flolessRoot)) (0, import_node_fs26.mkdirSync)(flolessRoot, { recursive: true });
60857
+ if (!(0, import_node_fs27.existsSync)(flolessRoot)) (0, import_node_fs27.mkdirSync)(flolessRoot, { recursive: true });
60523
60858
  const tmp = `${ROUTINES_FILE}.${process.pid}.tmp`;
60524
- (0, import_node_fs26.writeFileSync)(tmp, JSON.stringify(routines, null, 2));
60525
- (0, import_node_fs26.renameSync)(tmp, ROUTINES_FILE);
60859
+ (0, import_node_fs27.writeFileSync)(tmp, JSON.stringify(routines, null, 2));
60860
+ (0, import_node_fs27.renameSync)(tmp, ROUTINES_FILE);
60526
60861
  }
60527
60862
  function listRoutines() {
60528
60863
  ensureLoaded();
@@ -60930,13 +61265,13 @@ var AppLifecycleError = class extends Error {
60930
61265
  }
60931
61266
  };
60932
61267
  function appsDir() {
60933
- return process.env.AWARE_HOME ? (0, import_node_path24.join)(process.env.AWARE_HOME, "apps") : (0, import_node_path24.join)((0, import_node_os16.homedir)(), ".aware", "apps");
61268
+ return process.env.AWARE_HOME ? (0, import_node_path25.join)(process.env.AWARE_HOME, "apps") : (0, import_node_path25.join)((0, import_node_os16.homedir)(), ".aware", "apps");
60934
61269
  }
60935
61270
  function appDirPath(id) {
60936
- return (0, import_node_path24.join)(appsDir(), id);
61271
+ return (0, import_node_path25.join)(appsDir(), id);
60937
61272
  }
60938
61273
  function appInstalled(id) {
60939
- return APP_ID3.test(id) && (0, import_node_fs27.existsSync)(appDirPath(id));
61274
+ return APP_ID3.test(id) && (0, import_node_fs28.existsSync)(appDirPath(id));
60940
61275
  }
60941
61276
  function logCascade(what, e) {
60942
61277
  console.error(`[app-lifecycle] cascade step failed (${what}):`, e instanceof Error ? e.message : e);
@@ -61052,9 +61387,9 @@ function isGatedAwareRoute(url, method) {
61052
61387
 
61053
61388
  // autostart.mjs
61054
61389
  var import_node_child_process5 = require("node:child_process");
61055
- var import_node_fs28 = require("node:fs");
61390
+ var import_node_fs29 = require("node:fs");
61056
61391
  var import_node_os17 = require("node:os");
61057
- var import_node_path25 = require("node:path");
61392
+ var import_node_path26 = require("node:path");
61058
61393
 
61059
61394
  // teardown.mjs
61060
61395
  var RUN_KEY = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run";
@@ -61166,8 +61501,8 @@ function removeLegacyRunKey() {
61166
61501
  }
61167
61502
  function logLine(msg) {
61168
61503
  try {
61169
- (0, import_node_fs28.mkdirSync)(logDir(), { recursive: true });
61170
- (0, import_node_fs28.appendFileSync)(logFilePath(), `${(/* @__PURE__ */ new Date()).toISOString()} ${msg}
61504
+ (0, import_node_fs29.mkdirSync)(logDir(), { recursive: true });
61505
+ (0, import_node_fs29.appendFileSync)(logFilePath(), `${(/* @__PURE__ */ new Date()).toISOString()} ${msg}
61171
61506
  `);
61172
61507
  } catch {
61173
61508
  }
@@ -61175,8 +61510,8 @@ function logLine(msg) {
61175
61510
  function registerAutostart(exePath) {
61176
61511
  if (!isWin) return;
61177
61512
  const xml = buildAutostartTaskXml(exePath, currentUserId());
61178
- const tmp = (0, import_node_path25.join)((0, import_node_os17.tmpdir)(), `floless-autostart-${process.pid}-${Date.now()}.xml`);
61179
- (0, import_node_fs28.writeFileSync)(tmp, "\uFEFF" + xml, { encoding: "utf16le" });
61513
+ const tmp = (0, import_node_path26.join)((0, import_node_os17.tmpdir)(), `floless-autostart-${process.pid}-${Date.now()}.xml`);
61514
+ (0, import_node_fs29.writeFileSync)(tmp, "\uFEFF" + xml, { encoding: "utf16le" });
61180
61515
  try {
61181
61516
  (0, import_node_child_process5.execFileSync)("schtasks", ["/Create", "/TN", TASK_NAME, "/XML", tmp, "/F"], {
61182
61517
  stdio: ["ignore", "ignore", "ignore"],
@@ -61187,7 +61522,7 @@ function registerAutostart(exePath) {
61187
61522
  throw err2;
61188
61523
  } finally {
61189
61524
  try {
61190
- (0, import_node_fs28.rmSync)(tmp, { force: true });
61525
+ (0, import_node_fs29.rmSync)(tmp, { force: true });
61191
61526
  } catch {
61192
61527
  }
61193
61528
  }
@@ -61221,27 +61556,27 @@ function unregisterAutostart() {
61221
61556
 
61222
61557
  // updater.ts
61223
61558
  var import_node_child_process6 = require("node:child_process");
61224
- var import_node_crypto8 = require("node:crypto");
61225
- var import_node_fs30 = require("node:fs");
61559
+ var import_node_crypto9 = require("node:crypto");
61560
+ var import_node_fs31 = require("node:fs");
61226
61561
  var import_node_stream3 = require("node:stream");
61227
61562
  var import_promises = require("node:stream/promises");
61228
- var import_node_path27 = require("node:path");
61563
+ var import_node_path28 = require("node:path");
61229
61564
 
61230
61565
  // post-update-marker.mjs
61231
- var import_node_fs29 = require("node:fs");
61566
+ var import_node_fs30 = require("node:fs");
61232
61567
  var import_node_os18 = require("node:os");
61233
- var import_node_path26 = require("node:path");
61568
+ var import_node_path27 = require("node:path");
61234
61569
  var FRESH_MS = 12e4;
61235
61570
  function markerPath() {
61236
61571
  const override = (process.env.FLOLESS_POST_UPDATE_MARKER ?? "").trim();
61237
61572
  if (override) return override;
61238
- const root = process.env.FLOLESS_HOME ?? (0, import_node_path26.join)((0, import_node_os18.homedir)(), ".floless");
61239
- return (0, import_node_path26.join)(root, ".post-update");
61573
+ const root = process.env.FLOLESS_HOME ?? (0, import_node_path27.join)((0, import_node_os18.homedir)(), ".floless");
61574
+ return (0, import_node_path27.join)(root, ".post-update");
61240
61575
  }
61241
61576
  function legacyMarkerPath() {
61242
61577
  if ((process.env.FLOLESS_POST_UPDATE_MARKER ?? "").trim()) return null;
61243
61578
  try {
61244
- return (0, import_node_path26.join)((0, import_node_path26.dirname)((0, import_node_path26.dirname)(process.execPath)), ".floless-post-update");
61579
+ return (0, import_node_path27.join)((0, import_node_path27.dirname)((0, import_node_path27.dirname)(process.execPath)), ".floless-post-update");
61245
61580
  } catch {
61246
61581
  return null;
61247
61582
  }
@@ -61251,7 +61586,7 @@ function writePostUpdateMarker() {
61251
61586
  for (const p of [markerPath(), legacyMarkerPath()]) {
61252
61587
  if (!p) continue;
61253
61588
  try {
61254
- (0, import_node_fs29.writeFileSync)(p, (/* @__PURE__ */ new Date()).toISOString());
61589
+ (0, import_node_fs30.writeFileSync)(p, (/* @__PURE__ */ new Date()).toISOString());
61255
61590
  wrote = true;
61256
61591
  } catch {
61257
61592
  }
@@ -61263,9 +61598,9 @@ function consumePostUpdateMarker() {
61263
61598
  for (const p of [markerPath(), legacyMarkerPath()]) {
61264
61599
  if (!p) continue;
61265
61600
  try {
61266
- if (!(0, import_node_fs29.existsSync)(p)) continue;
61267
- const ageMs = Date.now() - (0, import_node_fs29.statSync)(p).mtimeMs;
61268
- (0, import_node_fs29.rmSync)(p, { force: true });
61601
+ if (!(0, import_node_fs30.existsSync)(p)) continue;
61602
+ const ageMs = Date.now() - (0, import_node_fs30.statSync)(p).mtimeMs;
61603
+ (0, import_node_fs30.rmSync)(p, { force: true });
61269
61604
  if (ageMs < FRESH_MS) fresh = true;
61270
61605
  } catch {
61271
61606
  }
@@ -61282,13 +61617,13 @@ function currentVersion() {
61282
61617
  return appVersion();
61283
61618
  }
61284
61619
  function installRoot() {
61285
- return (0, import_node_path27.dirname)((0, import_node_path27.dirname)(process.execPath));
61620
+ return (0, import_node_path28.dirname)((0, import_node_path28.dirname)(process.execPath));
61286
61621
  }
61287
61622
  function updateExePath() {
61288
- return (0, import_node_path27.join)(installRoot(), "Update.exe");
61623
+ return (0, import_node_path28.join)(installRoot(), "Update.exe");
61289
61624
  }
61290
61625
  function packagesDir() {
61291
- return (0, import_node_path27.join)(installRoot(), "packages");
61626
+ return (0, import_node_path28.join)(installRoot(), "packages");
61292
61627
  }
61293
61628
  function feedUrl() {
61294
61629
  const env2 = (process.env.FLOLESS_UPDATE_URL ?? "").trim().replace(/\/+$/, "");
@@ -61380,23 +61715,23 @@ async function checkForUpdate() {
61380
61715
  return { supported: true, currentVersion: cur, updateAvailable: true, targetVersion: latest.Version, asset: latest };
61381
61716
  }
61382
61717
  async function sha1OfFile(path) {
61383
- const hash = (0, import_node_crypto8.createHash)("sha1");
61384
- await (0, import_promises.pipeline)((0, import_node_fs30.createReadStream)(path), hash);
61718
+ const hash = (0, import_node_crypto9.createHash)("sha1");
61719
+ await (0, import_promises.pipeline)((0, import_node_fs31.createReadStream)(path), hash);
61385
61720
  return hash.digest("hex").toUpperCase();
61386
61721
  }
61387
61722
  async function downloadPackage(asset) {
61388
61723
  if (!NUPKG_NAME.test(asset.FileName)) throw new Error(`refusing suspicious package name: ${asset.FileName}`);
61389
61724
  const want = asset.SHA1.toUpperCase();
61390
61725
  const dir = packagesDir();
61391
- (0, import_node_fs30.mkdirSync)(dir, { recursive: true });
61392
- const dest = (0, import_node_path27.join)(dir, asset.FileName);
61393
- if ((0, import_node_fs30.existsSync)(dest) && await sha1OfFile(dest) === want) return dest;
61726
+ (0, import_node_fs31.mkdirSync)(dir, { recursive: true });
61727
+ const dest = (0, import_node_path28.join)(dir, asset.FileName);
61728
+ if ((0, import_node_fs31.existsSync)(dest) && await sha1OfFile(dest) === want) return dest;
61394
61729
  const res = await authedFetch(`${feedUrl()}/${encodeURIComponent(asset.FileName)}`, {
61395
61730
  redirect: "follow",
61396
61731
  signal: AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS)
61397
61732
  });
61398
61733
  if (!res.ok || !res.body) throw new Error(`download failed: HTTP ${res.status} for ${asset.FileName}`);
61399
- await (0, import_promises.pipeline)(import_node_stream3.Readable.fromWeb(res.body), (0, import_node_fs30.createWriteStream)(dest));
61734
+ await (0, import_promises.pipeline)(import_node_stream3.Readable.fromWeb(res.body), (0, import_node_fs31.createWriteStream)(dest));
61400
61735
  const got = await sha1OfFile(dest);
61401
61736
  if (got !== want) throw new Error(`SHA1 mismatch for ${asset.FileName}: feed=${want} got=${got}`);
61402
61737
  return dest;
@@ -61405,7 +61740,7 @@ async function applyUpdate(check, opts) {
61405
61740
  if (!check.supported) return { applied: false, message: check.reason ?? "auto-update not supported in this runtime" };
61406
61741
  if (!check.updateAvailable || !check.asset) return { applied: false, message: check.reason ?? "no update available" };
61407
61742
  const exe = updateExePath();
61408
- if (!(0, import_node_fs30.existsSync)(exe)) {
61743
+ if (!(0, import_node_fs31.existsSync)(exe)) {
61409
61744
  return { applied: false, message: `Update.exe not found at ${exe} \u2014 is this a Velopack install?` };
61410
61745
  }
61411
61746
  const pkg = await downloadPackage(check.asset);
@@ -61645,12 +61980,12 @@ function isTraceCorrupt(events) {
61645
61980
 
61646
61981
  // launch.mjs
61647
61982
  var import_node_child_process7 = require("node:child_process");
61648
- var import_node_path28 = require("node:path");
61983
+ var import_node_path29 = require("node:path");
61649
61984
  var import_node_url3 = require("node:url");
61650
- var import_node_fs31 = require("node:fs");
61985
+ var import_node_fs32 = require("node:fs");
61651
61986
  var import_node_http = __toESM(require("node:http"), 1);
61652
61987
  var import_node_readline = require("node:readline");
61653
- var __dirname2 = (0, import_node_path28.dirname)((0, import_node_url3.fileURLToPath)(__import_meta_url));
61988
+ var __dirname2 = (0, import_node_path29.dirname)((0, import_node_url3.fileURLToPath)(__import_meta_url));
61654
61989
  var PORT = Number(process.env.PORT ?? 4317);
61655
61990
  var HEALTH_URL = `http://127.0.0.1:${PORT}/api/health`;
61656
61991
  var BROWSER_URL = `http://floless.localhost:${PORT}`;
@@ -61722,8 +62057,8 @@ async function waitHealthy(timeoutMs = 3e4) {
61722
62057
  function resolveServerStart() {
61723
62058
  const packaged = /flolessapp\.exe$/i.test(process.execPath);
61724
62059
  if (packaged) return { cmd: process.execPath, args: ["--serve"], shell: false };
61725
- const bundle = (0, import_node_path28.join)(__dirname2, "dist", "floless-server.cjs");
61726
- if ((0, import_node_fs31.existsSync)(bundle)) return { cmd: process.execPath, args: [bundle, "--serve"], shell: false };
62060
+ const bundle = (0, import_node_path29.join)(__dirname2, "dist", "floless-server.cjs");
62061
+ if ((0, import_node_fs32.existsSync)(bundle)) return { cmd: process.execPath, args: [bundle, "--serve"], shell: false };
61727
62062
  return { cmd: "npm", args: ["run", "start"], shell: isWin2 };
61728
62063
  }
61729
62064
  function startServerDetached() {
@@ -61876,8 +62211,8 @@ function taskkillArgs(pid, { tree = true } = {}) {
61876
62211
  }
61877
62212
  function killSupervisor({ tree = true } = {}) {
61878
62213
  if (!isWin2) return;
61879
- const isNpmChannel = /^node(\.exe)?$/i.test((0, import_node_path28.basename)(process.execPath));
61880
- const scriptMatch = isNpmChannel ? (0, import_node_path28.basename)((0, import_node_url3.fileURLToPath)(__import_meta_url)) : void 0;
62214
+ const isNpmChannel = /^node(\.exe)?$/i.test((0, import_node_path29.basename)(process.execPath));
62215
+ const scriptMatch = isNpmChannel ? (0, import_node_path29.basename)((0, import_node_url3.fileURLToPath)(__import_meta_url)) : void 0;
61881
62216
  const realExe = resolveRealInstallExe(process.execPath);
61882
62217
  const exeMatch = realExe === process.execPath ? process.execPath : [process.execPath, realExe];
61883
62218
  const pids = supervisorPidsToKill(enumerateProcesses(), process.pid, exeMatch, scriptMatch);
@@ -62042,7 +62377,7 @@ async function runAction(arg, flagArgv = [], selfVersion = null) {
62042
62377
  }
62043
62378
  await action(parseTeardownFlags(flagArgv));
62044
62379
  }
62045
- var entry = (0, import_node_path28.basename)(process.argv[1] ?? "").toLowerCase();
62380
+ var entry = (0, import_node_path29.basename)(process.argv[1] ?? "").toLowerCase();
62046
62381
  if (entry === "launch.mjs") {
62047
62382
  runAction(process.argv[2], process.argv.slice(3)).catch((e) => {
62048
62383
  log(`error: ${e?.message ?? e}`);
@@ -62116,9 +62451,9 @@ function awareUpgradeBlockReason(s) {
62116
62451
  }
62117
62452
 
62118
62453
  // skill-sync.ts
62119
- var import_node_fs32 = require("node:fs");
62454
+ var import_node_fs33 = require("node:fs");
62120
62455
  var import_node_os19 = require("node:os");
62121
- var import_node_path29 = require("node:path");
62456
+ var import_node_path30 = require("node:path");
62122
62457
  var import_node_url4 = require("node:url");
62123
62458
  var import_yaml8 = __toESM(require_dist6(), 1);
62124
62459
 
@@ -62161,14 +62496,14 @@ function selectShippedSkillNames(names) {
62161
62496
  }
62162
62497
 
62163
62498
  // skill-sync.ts
62164
- var __dirname3 = (0, import_node_path29.dirname)((0, import_node_url4.fileURLToPath)(__import_meta_url));
62499
+ var __dirname3 = (0, import_node_path30.dirname)((0, import_node_url4.fileURLToPath)(__import_meta_url));
62165
62500
  function bundledSkillsRoot() {
62166
62501
  const candidates = [
62167
- (0, import_node_path29.join)(__dirname3, "skills"),
62168
- (0, import_node_path29.join)((0, import_node_path29.dirname)(process.execPath), "skills"),
62169
- (0, import_node_path29.join)(__dirname3, "..", ".claude", "skills")
62502
+ (0, import_node_path30.join)(__dirname3, "skills"),
62503
+ (0, import_node_path30.join)((0, import_node_path30.dirname)(process.execPath), "skills"),
62504
+ (0, import_node_path30.join)(__dirname3, "..", ".claude", "skills")
62170
62505
  ];
62171
- return candidates.find((p) => (0, import_node_fs32.existsSync)(p)) ?? null;
62506
+ return candidates.find((p) => (0, import_node_fs33.existsSync)(p)) ?? null;
62172
62507
  }
62173
62508
  function targetConfigDirs() {
62174
62509
  const override = process.env.FLOLESS_SKILL_TARGETS;
@@ -62177,14 +62512,14 @@ function targetConfigDirs() {
62177
62512
  }
62178
62513
  const home = (0, import_node_os19.homedir)();
62179
62514
  return [
62180
- { runtime: "claude", dir: (0, import_node_path29.join)(home, ".claude") },
62181
- { runtime: "codex", dir: (0, import_node_path29.join)(home, ".codex") },
62182
- { runtime: "opencode", dir: (0, import_node_path29.join)(home, ".opencode") }
62515
+ { runtime: "claude", dir: (0, import_node_path30.join)(home, ".claude") },
62516
+ { runtime: "codex", dir: (0, import_node_path30.join)(home, ".codex") },
62517
+ { runtime: "opencode", dir: (0, import_node_path30.join)(home, ".opencode") }
62183
62518
  ];
62184
62519
  }
62185
62520
  function skillVersion(skillMdPath) {
62186
62521
  try {
62187
- const text = (0, import_node_fs32.readFileSync)(skillMdPath, "utf8");
62522
+ const text = (0, import_node_fs33.readFileSync)(skillMdPath, "utf8");
62188
62523
  const m = /^---\r?\n([\s\S]*?)\r?\n---/.exec(text);
62189
62524
  if (!m || m[1] === void 0) return null;
62190
62525
  const fm = (0, import_yaml8.parse)(m[1]);
@@ -62224,21 +62559,21 @@ function decideAction(installed, bundled) {
62224
62559
  function bundledSkills(root) {
62225
62560
  let entries = [];
62226
62561
  try {
62227
- entries = selectShippedSkillNames((0, import_node_fs32.readdirSync)(root));
62562
+ entries = selectShippedSkillNames((0, import_node_fs33.readdirSync)(root));
62228
62563
  } catch {
62229
62564
  return [];
62230
62565
  }
62231
62566
  const out = [];
62232
62567
  for (const name of entries) {
62233
- const dir = (0, import_node_path29.join)(root, name);
62568
+ const dir = (0, import_node_path30.join)(root, name);
62234
62569
  let isDir = false;
62235
62570
  try {
62236
- isDir = (0, import_node_fs32.statSync)(dir).isDirectory();
62571
+ isDir = (0, import_node_fs33.statSync)(dir).isDirectory();
62237
62572
  } catch {
62238
62573
  isDir = false;
62239
62574
  }
62240
62575
  if (!isDir) continue;
62241
- const v = skillVersion((0, import_node_path29.join)(dir, "SKILL.md"));
62576
+ const v = skillVersion((0, import_node_path30.join)(dir, "SKILL.md"));
62242
62577
  if (!v) continue;
62243
62578
  out.push({ name, dir, version: v });
62244
62579
  }
@@ -62251,17 +62586,17 @@ function syncSkills() {
62251
62586
  const skills = bundledSkills(root);
62252
62587
  if (!skills.length) return results;
62253
62588
  for (const { runtime, dir: cfg } of targetConfigDirs()) {
62254
- if (!(0, import_node_fs32.existsSync)(cfg)) continue;
62255
- const skillsDir = (0, import_node_path29.join)(cfg, "skills");
62589
+ if (!(0, import_node_fs33.existsSync)(cfg)) continue;
62590
+ const skillsDir = (0, import_node_path30.join)(cfg, "skills");
62256
62591
  for (const s of skills) {
62257
- const dest = (0, import_node_path29.join)(skillsDir, s.name);
62258
- const installedMd = (0, import_node_path29.join)(dest, "SKILL.md");
62259
- const installed = (0, import_node_fs32.existsSync)(installedMd) ? skillVersion(installedMd) : null;
62592
+ const dest = (0, import_node_path30.join)(skillsDir, s.name);
62593
+ const installedMd = (0, import_node_path30.join)(dest, "SKILL.md");
62594
+ const installed = (0, import_node_fs33.existsSync)(installedMd) ? skillVersion(installedMd) : null;
62260
62595
  const action = decideAction(installed, s.version);
62261
62596
  if (action === "installed" || action === "updated") {
62262
62597
  try {
62263
- if (action === "updated") (0, import_node_fs32.rmSync)(dest, { recursive: true, force: true });
62264
- (0, import_node_fs32.cpSync)(s.dir, dest, { recursive: true });
62598
+ if (action === "updated") (0, import_node_fs33.rmSync)(dest, { recursive: true, force: true });
62599
+ (0, import_node_fs33.cpSync)(s.dir, dest, { recursive: true });
62265
62600
  results.push({ runtime, skill: s.name, action, from: installed, to: s.version });
62266
62601
  } catch {
62267
62602
  }
@@ -62275,8 +62610,8 @@ function syncSkills() {
62275
62610
 
62276
62611
  // watch.ts
62277
62612
  var import_node_os20 = require("node:os");
62278
- var import_node_path31 = require("node:path");
62279
- var import_node_fs33 = require("node:fs");
62613
+ var import_node_path32 = require("node:path");
62614
+ var import_node_fs34 = require("node:fs");
62280
62615
 
62281
62616
  // node_modules/chokidar/esm/index.js
62282
62617
  var import_fs2 = require("fs");
@@ -62287,7 +62622,7 @@ var sysPath2 = __toESM(require("path"), 1);
62287
62622
  // node_modules/readdirp/esm/index.js
62288
62623
  var import_promises2 = require("node:fs/promises");
62289
62624
  var import_node_stream4 = require("node:stream");
62290
- var import_node_path30 = require("node:path");
62625
+ var import_node_path31 = require("node:path");
62291
62626
  var EntryTypes = {
62292
62627
  FILE_TYPE: "files",
62293
62628
  DIR_TYPE: "directories",
@@ -62362,7 +62697,7 @@ var ReaddirpStream = class extends import_node_stream4.Readable {
62362
62697
  this._wantsDir = type ? DIR_TYPES.has(type) : false;
62363
62698
  this._wantsFile = type ? FILE_TYPES.has(type) : false;
62364
62699
  this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
62365
- this._root = (0, import_node_path30.resolve)(root);
62700
+ this._root = (0, import_node_path31.resolve)(root);
62366
62701
  this._isDirent = !opts.alwaysStat;
62367
62702
  this._statsProp = this._isDirent ? "dirent" : "stats";
62368
62703
  this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
@@ -62433,8 +62768,8 @@ var ReaddirpStream = class extends import_node_stream4.Readable {
62433
62768
  let entry2;
62434
62769
  const basename5 = this._isDirent ? dirent.name : dirent;
62435
62770
  try {
62436
- const fullPath = (0, import_node_path30.resolve)((0, import_node_path30.join)(path, basename5));
62437
- entry2 = { path: (0, import_node_path30.relative)(this._root, fullPath), fullPath, basename: basename5 };
62771
+ const fullPath = (0, import_node_path31.resolve)((0, import_node_path31.join)(path, basename5));
62772
+ entry2 = { path: (0, import_node_path31.relative)(this._root, fullPath), fullPath, basename: basename5 };
62438
62773
  entry2[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
62439
62774
  } catch (err2) {
62440
62775
  this._onError(err2);
@@ -62468,7 +62803,7 @@ var ReaddirpStream = class extends import_node_stream4.Readable {
62468
62803
  }
62469
62804
  if (entryRealPathStats.isDirectory()) {
62470
62805
  const len2 = entryRealPath.length;
62471
- if (full.startsWith(entryRealPath) && full.substr(len2, 1) === import_node_path30.sep) {
62806
+ if (full.startsWith(entryRealPath) && full.substr(len2, 1) === import_node_path31.sep) {
62472
62807
  const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
62473
62808
  recursiveError.code = RECURSIVE_ERROR_CODE;
62474
62809
  return this._onError(recursiveError);
@@ -63342,18 +63677,18 @@ var unifyPaths = (paths_) => {
63342
63677
  return paths.map(normalizePathToUnix);
63343
63678
  };
63344
63679
  var toUnix = (string) => {
63345
- let str = string.replace(BACK_SLASH_RE, SLASH);
63680
+ let str2 = string.replace(BACK_SLASH_RE, SLASH);
63346
63681
  let prepend = false;
63347
- if (str.startsWith(SLASH_SLASH)) {
63682
+ if (str2.startsWith(SLASH_SLASH)) {
63348
63683
  prepend = true;
63349
63684
  }
63350
- while (str.match(DOUBLE_SLASH_RE)) {
63351
- str = str.replace(DOUBLE_SLASH_RE, SLASH);
63685
+ while (str2.match(DOUBLE_SLASH_RE)) {
63686
+ str2 = str2.replace(DOUBLE_SLASH_RE, SLASH);
63352
63687
  }
63353
63688
  if (prepend) {
63354
- str = SLASH + str;
63689
+ str2 = SLASH + str2;
63355
63690
  }
63356
- return str;
63691
+ return str2;
63357
63692
  };
63358
63693
  var normalizePathToUnix = (path) => toUnix(sysPath2.normalize(toUnix(path)));
63359
63694
  var normalizeIgnored = (cwd = "") => (path) => {
@@ -63976,33 +64311,33 @@ function appIdFromLogPath(path) {
63976
64311
  return i >= 0 && parts[i + 1] ? parts[i + 1] : null;
63977
64312
  }
63978
64313
  function samePath(a, b) {
63979
- const ra = (0, import_node_path31.resolve)(a);
63980
- const rb = (0, import_node_path31.resolve)(b);
64314
+ const ra = (0, import_node_path32.resolve)(a);
64315
+ const rb = (0, import_node_path32.resolve)(b);
63981
64316
  return process.platform === "win32" ? ra.toLowerCase() === rb.toLowerCase() : ra === rb;
63982
64317
  }
63983
64318
  function underDir(path, dir) {
63984
- const rp = (0, import_node_path31.resolve)(path);
63985
- const rd = (0, import_node_path31.resolve)(dir);
64319
+ const rp = (0, import_node_path32.resolve)(path);
64320
+ const rd = (0, import_node_path32.resolve)(dir);
63986
64321
  const [p, d] = process.platform === "win32" ? [rp.toLowerCase(), rd.toLowerCase()] : [rp, rd];
63987
- return p === d || p.startsWith(d + import_node_path31.sep);
64322
+ return p === d || p.startsWith(d + import_node_path32.sep);
63988
64323
  }
63989
64324
  function startWatcher() {
63990
- const awareDir = process.env.AWARE_HOME ?? (0, import_node_path31.join)((0, import_node_os20.homedir)(), ".aware");
63991
- const credentialsDir = (0, import_node_path31.join)(awareDir, "credentials");
63992
- if (!(0, import_node_fs33.existsSync)(credentialsDir)) {
64325
+ const awareDir = process.env.AWARE_HOME ?? (0, import_node_path32.join)((0, import_node_os20.homedir)(), ".aware");
64326
+ const credentialsDir = (0, import_node_path32.join)(awareDir, "credentials");
64327
+ if (!(0, import_node_fs34.existsSync)(credentialsDir)) {
63993
64328
  try {
63994
- (0, import_node_fs33.mkdirSync)(credentialsDir, { recursive: true });
64329
+ (0, import_node_fs34.mkdirSync)(credentialsDir, { recursive: true });
63995
64330
  } catch {
63996
64331
  }
63997
64332
  }
63998
- if (!(0, import_node_fs33.existsSync)(uiDir)) {
64333
+ if (!(0, import_node_fs34.existsSync)(uiDir)) {
63999
64334
  try {
64000
- (0, import_node_fs33.mkdirSync)(uiDir, { recursive: true });
64335
+ (0, import_node_fs34.mkdirSync)(uiDir, { recursive: true });
64001
64336
  } catch {
64002
64337
  }
64003
64338
  }
64004
- const targets = ["apps", "logs", "credentials"].map((d) => (0, import_node_path31.join)(awareDir, d)).filter((p) => (0, import_node_fs33.existsSync)(p));
64005
- if ((0, import_node_fs33.existsSync)(uiDir)) targets.push(uiDir);
64339
+ const targets = ["apps", "logs", "credentials"].map((d) => (0, import_node_path32.join)(awareDir, d)).filter((p) => (0, import_node_fs34.existsSync)(p));
64340
+ if ((0, import_node_fs34.existsSync)(uiDir)) targets.push(uiDir);
64006
64341
  if (targets.length === 0) {
64007
64342
  return null;
64008
64343
  }
@@ -64031,11 +64366,11 @@ function startWatcher() {
64031
64366
  const isCredential = path.split(/[\\/]/).includes("credentials");
64032
64367
  const kind = isCredential ? "credential" : path.endsWith(".jsonl") ? "trace" : path.endsWith(".lock") ? "lock" : path.endsWith(".flo") || path.endsWith(".app") ? "source" : "file";
64033
64368
  broadcast({ type: "fs-change", kind, event, path });
64034
- if (kind === "trace" && event !== "unlink" && (0, import_node_fs33.existsSync)(path)) {
64369
+ if (kind === "trace" && event !== "unlink" && (0, import_node_fs34.existsSync)(path)) {
64035
64370
  const id = appIdFromLogPath(path);
64036
64371
  if (!id) return;
64037
64372
  try {
64038
- broadcast({ type: "trace-file", id, runId: path.split(import_node_path31.sep).pop()?.replace(/\.jsonl$/, "") ?? null, events: parseTrace((0, import_node_fs33.readFileSync)(path, "utf8")) });
64373
+ broadcast({ type: "trace-file", id, runId: path.split(import_node_path32.sep).pop()?.replace(/\.jsonl$/, "") ?? null, events: parseTrace((0, import_node_fs34.readFileSync)(path, "utf8")) });
64039
64374
  } catch {
64040
64375
  }
64041
64376
  }
@@ -64044,10 +64379,10 @@ function startWatcher() {
64044
64379
  }
64045
64380
 
64046
64381
  // index.ts
64047
- var __dirname4 = (0, import_node_path32.dirname)((0, import_node_url5.fileURLToPath)(__import_meta_url));
64048
- var WEB_ROOT = [(0, import_node_path32.join)(__dirname4, "web"), (0, import_node_path32.join)((0, import_node_path32.dirname)(process.execPath), "web"), (0, import_node_path32.join)(__dirname4, "..", "web")].find(
64049
- (p) => (0, import_node_fs34.existsSync)(p)
64050
- ) ?? (0, import_node_path32.join)(__dirname4, "..", "web");
64382
+ var __dirname4 = (0, import_node_path33.dirname)((0, import_node_url5.fileURLToPath)(__import_meta_url));
64383
+ var WEB_ROOT = [(0, import_node_path33.join)(__dirname4, "web"), (0, import_node_path33.join)((0, import_node_path33.dirname)(process.execPath), "web"), (0, import_node_path33.join)(__dirname4, "..", "web")].find(
64384
+ (p) => (0, import_node_fs35.existsSync)(p)
64385
+ ) ?? (0, import_node_path33.join)(__dirname4, "..", "web");
64051
64386
  var PORT2 = Number(process.env.PORT ?? 4317);
64052
64387
  var HOST = "127.0.0.1";
64053
64388
  var crashHandlersInstalled = false;
@@ -64063,7 +64398,7 @@ function installCrashHandlers() {
64063
64398
  ${stack}
64064
64399
  `;
64065
64400
  try {
64066
- (0, import_node_fs34.appendFileSync)(logFilePath(), line);
64401
+ (0, import_node_fs35.appendFileSync)(logFilePath(), line);
64067
64402
  } catch {
64068
64403
  }
64069
64404
  if (process.stderr.isTTY) process.stderr.write(line);
@@ -64360,9 +64695,9 @@ async function startServer() {
64360
64695
  const { id, templateId, templatePath, srcPath, appDirPath: appDirPath2, fromVersion, contract, verb } = opts;
64361
64696
  const bdir = backupDir(id, fromVersion, Date.now());
64362
64697
  try {
64363
- (0, import_node_fs34.mkdirSync)((0, import_node_path32.dirname)(bdir), { recursive: true });
64364
- (0, import_node_fs34.cpSync)(appDirPath2, bdir, { recursive: true });
64365
- (0, import_node_fs34.cpSync)(templatePath, srcPath);
64698
+ (0, import_node_fs35.mkdirSync)((0, import_node_path33.dirname)(bdir), { recursive: true });
64699
+ (0, import_node_fs35.cpSync)(appDirPath2, bdir, { recursive: true });
64700
+ (0, import_node_fs35.cpSync)(templatePath, srcPath);
64366
64701
  if (id !== templateId) stampSourceAppId(srcPath, id);
64367
64702
  if (contract != null) {
64368
64703
  bakeContractIntoApp(srcPath, contract);
@@ -64373,8 +64708,8 @@ async function startServer() {
64373
64708
  } catch (e) {
64374
64709
  const msg = e instanceof Error ? e.message : String(e);
64375
64710
  try {
64376
- (0, import_node_fs34.rmSync)(appDirPath2, { recursive: true, force: true });
64377
- (0, import_node_fs34.cpSync)(bdir, appDirPath2, { recursive: true });
64711
+ (0, import_node_fs35.rmSync)(appDirPath2, { recursive: true, force: true });
64712
+ (0, import_node_fs35.cpSync)(bdir, appDirPath2, { recursive: true });
64378
64713
  } catch (re) {
64379
64714
  const rmsg = re instanceof Error ? re.message : String(re);
64380
64715
  throw new TemplateSwapError(`${verb} failed (${msg}) AND rollback failed (${rmsg}) \u2014 restore manually from ${bdir}`, "rollback-failed", bdir);
@@ -64405,7 +64740,7 @@ async function startServer() {
64405
64740
  return reply.status(409).send({ ok: false, error: `"${id}" is already at ${fromVersion}`, code: "up-to-date" });
64406
64741
  }
64407
64742
  const contract = readContract(id);
64408
- if (contract == null && (0, import_node_fs34.existsSync)(contractPath(id))) {
64743
+ if (contract == null && (0, import_node_fs35.existsSync)(contractPath(id))) {
64409
64744
  return reply.status(409).send({ ok: false, error: `"${id}"'s saved data is unreadable \u2014 open it in the editor and re-save before updating`, code: "contract-corrupt" });
64410
64745
  }
64411
64746
  if (contract != null) {
@@ -64592,6 +64927,17 @@ async function startServer() {
64592
64927
  if (!p) return reply.status(404).send({ ok: false, error: `unknown project: ${req.params.id}` });
64593
64928
  return { ok: true, versions: listVersions(req.params.id), approvedAt: p.approvedAt ?? null };
64594
64929
  });
64930
+ app.get(
64931
+ "/api/projects/:id/versions/:n/diff",
64932
+ async (req, reply) => {
64933
+ const project = getProject(req.params.id);
64934
+ if (!project) return reply.status(404).send({ ok: false, error: `unknown project: ${req.params.id}` });
64935
+ const n = Number(req.params.n);
64936
+ const base = req.query.base !== void 0 && req.query.base !== "" ? Number(req.query.base) : void 0;
64937
+ const { code, body } = computeVersionDiff(project.id, n, base);
64938
+ return reply.status(code).send(body);
64939
+ }
64940
+ );
64595
64941
  app.post("/api/projects/:id/versions/:n/rollback", async (req, reply) => {
64596
64942
  const project = getProject(req.params.id);
64597
64943
  if (!project) return reply.status(404).send({ ok: false, error: `unknown project: ${req.params.id}` });
@@ -64610,6 +64956,92 @@ async function startServer() {
64610
64956
  broadcast({ type: "contract-changed", appId: project.app, project: project.id });
64611
64957
  return { ok: true, version: row };
64612
64958
  });
64959
+ app.post(
64960
+ "/api/projects/:id/revision-requests",
64961
+ { bodyLimit: 96 * 1024 * 1024 },
64962
+ // a revised SET = multiple structural PDFs (matches /api/rebake)
64963
+ async (req, reply) => {
64964
+ const project = getProject(req.params.id);
64965
+ if (!project) return reply.status(404).send({ ok: false, error: `unknown project: ${req.params.id}` });
64966
+ const appId = typeof req.body?.appId === "string" ? req.body.appId : project.app;
64967
+ if (appId !== project.app) {
64968
+ return reply.status(404).send({ ok: false, error: `project "${project.id}" belongs to app "${project.app}", not "${appId}"` });
64969
+ }
64970
+ let decoded;
64971
+ try {
64972
+ decoded = decodeSnapshots(req.body?.snapshots);
64973
+ } catch (e) {
64974
+ return reply.status(400).send({ ok: false, error: e instanceof Error ? e.message : "bad snapshot" });
64975
+ }
64976
+ if (!decoded.length) return reply.status(400).send({ ok: false, error: "attach at least one drawing file" });
64977
+ const inputs = req.body?.snapshots ?? [];
64978
+ const sourceRefs = decoded.map((d, i) => {
64979
+ const nm = inputs[i]?.name;
64980
+ return saveSource(project.id, { name: typeof nm === "string" && nm || `sheet-${i + 1}.${d.ext}`, buf: d.buf, ext: d.ext });
64981
+ });
64982
+ const baseVersion = listVersions(project.id)[0]?.n ?? 0;
64983
+ const request = addRequest(
64984
+ {
64985
+ type: "revision-read",
64986
+ appId: project.app,
64987
+ project: project.id,
64988
+ baseVersion,
64989
+ sourceRefs,
64990
+ ...typeof req.body?.message === "string" && req.body.message.trim() ? { instruction: req.body.message.trim() } : {}
64991
+ },
64992
+ decoded
64993
+ );
64994
+ broadcast({ type: "request-added", request });
64995
+ return { ok: true, request };
64996
+ }
64997
+ );
64998
+ app.post(
64999
+ "/api/projects/:id/revision-read",
65000
+ { bodyLimit: 25 * 1024 * 1024 },
65001
+ // the contract embeds rasters (matches the contract PUT)
65002
+ async (req, reply) => {
65003
+ const project = getProject(req.params.id);
65004
+ if (!project) return reply.status(404).send({ ok: false, error: `unknown project: ${req.params.id}` });
65005
+ if (req.body?.contract == null) return reply.status(400).send({ ok: false, error: "contract required" });
65006
+ const requestId = typeof req.body?.requestId === "string" ? req.body.requestId : "";
65007
+ const request = requestId ? getRequest(requestId) : null;
65008
+ if (!request || request.type !== "revision-read" || request.project !== project.id) {
65009
+ return reply.status(400).send({ ok: false, error: "a valid queued revision-read requestId for this project is required" });
65010
+ }
65011
+ const head = listVersions(project.id)[0]?.n ?? 0;
65012
+ if ((request.baseVersion ?? 0) !== head) {
65013
+ return reply.status(409).send({ ok: false, error: `project changed since this read started (base v${request.baseVersion ?? 0}, now v${head}) \u2014 re-read the current version` });
65014
+ }
65015
+ try {
65016
+ writeContract(project.app, req.body.contract, project.id);
65017
+ } catch (e) {
65018
+ if (e instanceof ContractError) return reply.status(400).send({ ok: false, error: e.message });
65019
+ throw e;
65020
+ }
65021
+ clearApproval(project.id);
65022
+ const message = typeof req.body?.message === "string" && req.body.message.trim() ? req.body.message.trim() : "Re-read a revised drawing set";
65023
+ const source = request.sourceRefs && request.sourceRefs.length ? { files: request.sourceRefs, requestId: request.id } : void 0;
65024
+ const version = createVersion(project.id, req.body.contract, { author: "AI", message, gate: null, kind: "revision-read", source });
65025
+ broadcast({ type: "contract-changed", appId: project.app, project: project.id });
65026
+ deleteRequest(request.id);
65027
+ return { ok: true, version };
65028
+ }
65029
+ );
65030
+ app.post(
65031
+ "/api/projects/:id/revision-requests/:reqId/fail",
65032
+ async (req, reply) => {
65033
+ const project = getProject(req.params.id);
65034
+ if (!project) return reply.status(404).send({ ok: false, error: `unknown project: ${req.params.id}` });
65035
+ const existing = getRequest(req.params.reqId);
65036
+ if (!existing || existing.type !== "revision-read" || existing.project !== project.id) {
65037
+ return reply.status(404).send({ ok: false, error: `unknown revision request for this project: ${req.params.reqId}` });
65038
+ }
65039
+ const error = typeof req.body?.error === "string" && req.body.error.trim() ? req.body.error.trim().slice(0, 2e3) : "the read could not be completed";
65040
+ const request = patchRequest(existing.id, { status: "failed", error });
65041
+ broadcast({ type: "request-added", request });
65042
+ return { ok: true, request };
65043
+ }
65044
+ );
64613
65045
  function projectAppMismatch(appId, project) {
64614
65046
  const p = getProject(project);
64615
65047
  if (!p) return `unknown project: ${project}`;
@@ -64767,10 +65199,10 @@ async function startServer() {
64767
65199
  if (bad) return reply.status(404).send({ ok: false, error: bad });
64768
65200
  const dir = projectExportsDir(project);
64769
65201
  const exports2 = projectExportFiles(req.params.appId).map(({ kind, filename }) => {
64770
- const path = (0, import_node_path32.join)(dir, filename);
65202
+ const path = (0, import_node_path33.join)(dir, filename);
64771
65203
  let exportedAt = null;
64772
65204
  try {
64773
- const st = (0, import_node_fs34.statSync)(path);
65205
+ const st = (0, import_node_fs35.statSync)(path);
64774
65206
  if (st.isFile()) exportedAt = st.mtime.toISOString();
64775
65207
  } catch {
64776
65208
  }
@@ -64854,8 +65286,8 @@ async function startServer() {
64854
65286
  }
64855
65287
  const companionId = `${req.params.appId}-ifc`;
64856
65288
  const filename = `${req.params.appId}.ifc`;
64857
- const outPath = project ? (0, import_node_path32.join)(projectExportsDir(project), filename) : (0, import_node_path32.join)(appPath(companionId), filename);
64858
- if (project) (0, import_node_fs34.mkdirSync)((0, import_node_path32.dirname)(outPath), { recursive: true });
65289
+ const outPath = project ? (0, import_node_path33.join)(projectExportsDir(project), filename) : (0, import_node_path33.join)(appPath(companionId), filename);
65290
+ if (project) (0, import_node_fs35.mkdirSync)((0, import_node_path33.dirname)(outPath), { recursive: true });
64859
65291
  let flo;
64860
65292
  try {
64861
65293
  flo = writeIfcApp(appPath(companionId), companionId, scene, outPath, writeOpts);
@@ -64878,8 +65310,8 @@ async function startServer() {
64878
65310
  }
64879
65311
  throw e;
64880
65312
  }
64881
- if (!(0, import_node_fs34.existsSync)(outPath)) return reply.send({ ok: false, error: "the IFC export produced no file" });
64882
- const content = (0, import_node_fs34.readFileSync)(outPath, "utf8");
65313
+ if (!(0, import_node_fs35.existsSync)(outPath)) return reply.send({ ok: false, error: "the IFC export produced no file" });
65314
+ const content = (0, import_node_fs35.readFileSync)(outPath, "utf8");
64883
65315
  broadcast({ type: "apps-changed" });
64884
65316
  return { ok: true, filename, savedTo: outPath, content, bytes: Buffer.byteLength(content), skipped, ...extrusionsSkipped ? { extrusionsSkipped } : {} };
64885
65317
  });
@@ -64968,17 +65400,17 @@ async function startServer() {
64968
65400
  return reply.status(422).send({ ok: false, error: "no priced members to export \u2014 every member is an RFI (no AISC size / weight yet)" });
64969
65401
  }
64970
65402
  const filename = `${appId}-bom.${format}`;
64971
- const outPath = project ? (0, import_node_path32.join)(projectExportsDir(project), filename) : bomExportPath(appId, format);
64972
- const dir = (0, import_node_path32.dirname)(outPath);
65403
+ const outPath = project ? (0, import_node_path33.join)(projectExportsDir(project), filename) : bomExportPath(appId, format);
65404
+ const dir = (0, import_node_path33.dirname)(outPath);
64973
65405
  try {
64974
- (0, import_node_fs34.mkdirSync)(dir, { recursive: true });
65406
+ (0, import_node_fs35.mkdirSync)(dir, { recursive: true });
64975
65407
  if (format === "csv") {
64976
65408
  const text = bomToCsv(bom);
64977
- (0, import_node_fs34.writeFileSync)(outPath, text, "utf8");
65409
+ (0, import_node_fs35.writeFileSync)(outPath, text, "utf8");
64978
65410
  return { ok: true, filename, encoding: "utf8", content: text, bytes: Buffer.byteLength(text), savedTo: outPath };
64979
65411
  }
64980
65412
  const buf = await bomToXlsx(bom);
64981
- (0, import_node_fs34.writeFileSync)(outPath, buf);
65413
+ (0, import_node_fs35.writeFileSync)(outPath, buf);
64982
65414
  return { ok: true, filename, encoding: "base64", content: buf.toString("base64"), bytes: buf.length, savedTo: outPath };
64983
65415
  } catch (e) {
64984
65416
  app.log.error({ appId, format, err: e instanceof Error ? e.message : e }, "export-bom: generation failed");
@@ -65048,7 +65480,7 @@ async function startServer() {
65048
65480
  return reply.status(404).send({ ok: false, error: `"${id}" is not installed`, code: "not-installed" });
65049
65481
  }
65050
65482
  const contract = readContract(id);
65051
- if (contract == null && (0, import_node_fs34.existsSync)(contractPath(id))) {
65483
+ if (contract == null && (0, import_node_fs35.existsSync)(contractPath(id))) {
65052
65484
  return reply.status(409).send({ ok: false, error: `"${id}"'s saved data is unreadable \u2014 open it in the editor and re-save before restoring`, code: "contract-corrupt" });
65053
65485
  }
65054
65486
  if (contract != null) {
@@ -65126,11 +65558,11 @@ async function startServer() {
65126
65558
  if (appExists(id)) {
65127
65559
  return reply.status(409).send({ ok: false, error: `a workflow named "${id}" is already installed \u2014 remove it first, or rename the file's app: id`, code: "exists", id });
65128
65560
  }
65129
- const stageRoot = (0, import_node_fs34.mkdtempSync)((0, import_node_path32.join)((0, import_node_os21.tmpdir)(), "floless-import-"));
65561
+ const stageRoot = (0, import_node_fs35.mkdtempSync)((0, import_node_path33.join)((0, import_node_os21.tmpdir)(), "floless-import-"));
65130
65562
  try {
65131
- const stageDir = (0, import_node_path32.join)(stageRoot, id);
65132
- (0, import_node_fs34.mkdirSync)(stageDir);
65133
- (0, import_node_fs34.writeFileSync)((0, import_node_path32.join)(stageDir, `${id}.flo`), content);
65563
+ const stageDir = (0, import_node_path33.join)(stageRoot, id);
65564
+ (0, import_node_fs35.mkdirSync)(stageDir);
65565
+ (0, import_node_fs35.writeFileSync)((0, import_node_path33.join)(stageDir, `${id}.flo`), content);
65134
65566
  await aware.install(stageDir);
65135
65567
  } catch (err2) {
65136
65568
  try {
@@ -65140,7 +65572,7 @@ async function startServer() {
65140
65572
  const msg = err2 instanceof AwareError ? err2.message : String(err2?.message ?? err2);
65141
65573
  return reply.status(502).send({ ok: false, error: `import failed: ${msg}` });
65142
65574
  } finally {
65143
- (0, import_node_fs34.rmSync)(stageRoot, { recursive: true, force: true });
65575
+ (0, import_node_fs35.rmSync)(stageRoot, { recursive: true, force: true });
65144
65576
  }
65145
65577
  broadcast({ type: "apps-changed", id });
65146
65578
  return { ok: true, id };
@@ -65154,13 +65586,13 @@ async function startServer() {
65154
65586
  }
65155
65587
  const inputs = appData.inputs.map((i) => ({ name: i.name, type: i.type }));
65156
65588
  const baked = bakeFloSource(appData.source.text, inputs);
65157
- const tmpRoot = (0, import_node_fs34.mkdtempSync)((0, import_node_path32.join)((0, import_node_os21.tmpdir)(), "floless-bake-"));
65158
- const backupDir2 = (0, import_node_path32.join)(tmpRoot, `${id}-backup`);
65159
- const bakeDir = (0, import_node_path32.join)(tmpRoot, id);
65160
- (0, import_node_fs34.cpSync)(appDir(id), backupDir2, { recursive: true });
65161
- (0, import_node_fs34.cpSync)(appDir(id), bakeDir, { recursive: true });
65589
+ const tmpRoot = (0, import_node_fs35.mkdtempSync)((0, import_node_path33.join)((0, import_node_os21.tmpdir)(), "floless-bake-"));
65590
+ const backupDir2 = (0, import_node_path33.join)(tmpRoot, `${id}-backup`);
65591
+ const bakeDir = (0, import_node_path33.join)(tmpRoot, id);
65592
+ (0, import_node_fs35.cpSync)(appDir(id), backupDir2, { recursive: true });
65593
+ (0, import_node_fs35.cpSync)(appDir(id), bakeDir, { recursive: true });
65162
65594
  const floName = appData.source.path.split(/[\\/]/).pop();
65163
- (0, import_node_fs34.writeFileSync)((0, import_node_path32.join)(bakeDir, floName), baked);
65595
+ (0, import_node_fs35.writeFileSync)((0, import_node_path33.join)(bakeDir, floName), baked);
65164
65596
  let appInstalled2 = true;
65165
65597
  try {
65166
65598
  await aware.uninstall(id);
@@ -65182,17 +65614,17 @@ async function startServer() {
65182
65614
  throw installErr;
65183
65615
  }
65184
65616
  try {
65185
- await aware.compile((0, import_node_path32.join)(appDir(id), floName));
65617
+ await aware.compile((0, import_node_path33.join)(appDir(id), floName));
65186
65618
  } catch (compileErr) {
65187
65619
  app.log.warn({ id, compileErr: String(compileErr) }, "bake: post-install recompile failed (app baked but may need a manual Compile)");
65188
65620
  }
65189
65621
  broadcast({ type: "baked", id });
65190
65622
  return { ok: true, id, agent: id, inputs };
65191
65623
  } finally {
65192
- if (appInstalled2) (0, import_node_fs34.rmSync)(tmpRoot, { recursive: true, force: true });
65624
+ if (appInstalled2) (0, import_node_fs35.rmSync)(tmpRoot, { recursive: true, force: true });
65193
65625
  }
65194
65626
  });
65195
- const graftAgentsDir = () => (0, import_node_path32.join)((0, import_node_os21.homedir)(), ".aware", "agents");
65627
+ const graftAgentsDir = () => (0, import_node_path33.join)((0, import_node_os21.homedir)(), ".aware", "agents");
65196
65628
  app.post("/api/graft/match", async (req, reply) => {
65197
65629
  const { glob } = req.body ?? {};
65198
65630
  if (!glob) return reply.status(400).send({ ok: false, error: "glob required" });
@@ -65209,7 +65641,7 @@ async function startServer() {
65209
65641
  if (!sourceKind || !sourceRef) {
65210
65642
  return reply.status(400).send({ ok: false, error: "sourceKind and sourceRef required" });
65211
65643
  }
65212
- const tempHome = (0, import_node_fs34.mkdtempSync)((0, import_node_path32.join)((0, import_node_os21.tmpdir)(), "floless-graft-"));
65644
+ const tempHome = (0, import_node_fs35.mkdtempSync)((0, import_node_path33.join)((0, import_node_os21.tmpdir)(), "floless-graft-"));
65213
65645
  let result;
65214
65646
  try {
65215
65647
  result = await aware.build({
@@ -65222,19 +65654,19 @@ async function startServer() {
65222
65654
  awareHome: tempHome
65223
65655
  });
65224
65656
  } catch (err2) {
65225
- (0, import_node_fs34.rmSync)(tempHome, { recursive: true, force: true });
65657
+ (0, import_node_fs35.rmSync)(tempHome, { recursive: true, force: true });
65226
65658
  const msg = err2 instanceof AwareError ? err2.message : String(err2?.message ?? err2);
65227
65659
  return reply.status(422).send({ ok: false, error: msg });
65228
65660
  }
65229
65661
  const manifest = readStagedManifest(result.agentDir);
65230
65662
  if (!manifest) {
65231
- (0, import_node_fs34.rmSync)(tempHome, { recursive: true, force: true });
65663
+ (0, import_node_fs35.rmSync)(tempHome, { recursive: true, force: true });
65232
65664
  return reply.status(502).send({ ok: false, error: `build produced output at ${result.agentDir} but no manifest.yaml` });
65233
65665
  }
65234
- const token = (0, import_node_crypto9.randomUUID)();
65666
+ const token = (0, import_node_crypto10.randomUUID)();
65235
65667
  registerStage(token, tempHome, result.agentId);
65236
65668
  const preview = buildPreview(manifest, sourceKind, sourceRef, token);
65237
- if ((0, import_node_fs34.existsSync)((0, import_node_path32.join)(graftAgentsDir(), result.agentId))) {
65669
+ if ((0, import_node_fs35.existsSync)((0, import_node_path33.join)(graftAgentsDir(), result.agentId))) {
65238
65670
  preview.warnings.unshift(`An agent named "${result.agentId}" is already installed \u2014 creating it will overwrite it.`);
65239
65671
  }
65240
65672
  return { ok: true, preview };
@@ -65253,7 +65685,7 @@ async function startServer() {
65253
65685
  registerStage(stagedRef, stage.tempDir, stage.agentId);
65254
65686
  return reply.status(409).send({ ok: false, error: err2.message, agentId: stage.agentId, collision: true });
65255
65687
  }
65256
- (0, import_node_fs34.rmSync)(stage.tempDir, { recursive: true, force: true });
65688
+ (0, import_node_fs35.rmSync)(stage.tempDir, { recursive: true, force: true });
65257
65689
  throw err2;
65258
65690
  }
65259
65691
  broadcast({ type: "grafted", id: stage.agentId });
@@ -65524,11 +65956,11 @@ async function startServer() {
65524
65956
  app.get("/api/requests/:id/snapshot/:n", async (req, reply) => {
65525
65957
  const n = Number.parseInt(req.params.n, 10);
65526
65958
  const p = Number.isInteger(n) ? snapshotPathFor(req.params.id, n) : null;
65527
- if (!p || !(0, import_node_fs34.existsSync)(p)) return reply.status(404).send({ ok: false, error: "snapshot not found" });
65959
+ if (!p || !(0, import_node_fs35.existsSync)(p)) return reply.status(404).send({ ok: false, error: "snapshot not found" });
65528
65960
  const ext = p.split(".").pop().toLowerCase();
65529
65961
  reply.header("Content-Type", ext === "png" ? "image/png" : ext === "webp" ? "image/webp" : ext === "pdf" ? "application/pdf" : "image/jpeg");
65530
65962
  reply.header("Cache-Control", "no-store");
65531
- return (0, import_node_fs34.readFileSync)(p);
65963
+ return (0, import_node_fs35.readFileSync)(p);
65532
65964
  });
65533
65965
  app.post(
65534
65966
  "/api/tweak",
@@ -65754,7 +66186,7 @@ async function startServer() {
65754
66186
  warn(`last-run-status:${ref} \u2014 trace exists but couldn't be parsed (corrupt/truncated)`);
65755
66187
  let finishedAt2 = null;
65756
66188
  try {
65757
- finishedAt2 = (0, import_node_fs34.statSync)(latest.path).mtime.toISOString();
66189
+ finishedAt2 = (0, import_node_fs35.statSync)(latest.path).mtime.toISOString();
65758
66190
  } catch {
65759
66191
  finishedAt2 = null;
65760
66192
  }
@@ -65764,7 +66196,7 @@ async function startServer() {
65764
66196
  let finishedAt = typeof runEnd?.ts === "string" ? runEnd.ts : null;
65765
66197
  if (!finishedAt) {
65766
66198
  try {
65767
- finishedAt = (0, import_node_fs34.statSync)(latest.path).mtime.toISOString();
66199
+ finishedAt = (0, import_node_fs35.statSync)(latest.path).mtime.toISOString();
65768
66200
  } catch {
65769
66201
  finishedAt = null;
65770
66202
  }