opencommit 3.1.1 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +24 -38
  2. package/out/cli.cjs +2414 -195
  3. package/package.json +5 -5
package/out/cli.cjs CHANGED
@@ -144,7 +144,7 @@ var require_windows = __commonJS({
144
144
  "node_modules/isexe/windows.js"(exports, module2) {
145
145
  module2.exports = isexe;
146
146
  isexe.sync = sync;
147
- var fs6 = require("fs");
147
+ var fs7 = require("fs");
148
148
  function checkPathExt(path5, options) {
149
149
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
150
150
  if (!pathext) {
@@ -169,12 +169,12 @@ var require_windows = __commonJS({
169
169
  return checkPathExt(path5, options);
170
170
  }
171
171
  function isexe(path5, options, cb) {
172
- fs6.stat(path5, function(er2, stat) {
172
+ fs7.stat(path5, function(er2, stat) {
173
173
  cb(er2, er2 ? false : checkStat(stat, path5, options));
174
174
  });
175
175
  }
176
176
  function sync(path5, options) {
177
- return checkStat(fs6.statSync(path5), path5, options);
177
+ return checkStat(fs7.statSync(path5), path5, options);
178
178
  }
179
179
  }
180
180
  });
@@ -184,14 +184,14 @@ var require_mode = __commonJS({
184
184
  "node_modules/isexe/mode.js"(exports, module2) {
185
185
  module2.exports = isexe;
186
186
  isexe.sync = sync;
187
- var fs6 = require("fs");
187
+ var fs7 = require("fs");
188
188
  function isexe(path5, options, cb) {
189
- fs6.stat(path5, function(er2, stat) {
189
+ fs7.stat(path5, function(er2, stat) {
190
190
  cb(er2, er2 ? false : checkStat(stat, options));
191
191
  });
192
192
  }
193
193
  function sync(path5, options) {
194
- return checkStat(fs6.statSync(path5), options);
194
+ return checkStat(fs7.statSync(path5), options);
195
195
  }
196
196
  function checkStat(stat, options) {
197
197
  return stat.isFile() && checkMode(stat, options);
@@ -215,7 +215,7 @@ var require_mode = __commonJS({
215
215
  // node_modules/isexe/index.js
216
216
  var require_isexe = __commonJS({
217
217
  "node_modules/isexe/index.js"(exports, module2) {
218
- var fs6 = require("fs");
218
+ var fs7 = require("fs");
219
219
  var core;
220
220
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
221
221
  core = require_windows();
@@ -477,16 +477,16 @@ var require_shebang_command = __commonJS({
477
477
  var require_readShebang = __commonJS({
478
478
  "node_modules/cross-spawn/lib/util/readShebang.js"(exports, module2) {
479
479
  "use strict";
480
- var fs6 = require("fs");
480
+ var fs7 = require("fs");
481
481
  var shebangCommand = require_shebang_command();
482
482
  function readShebang(command) {
483
483
  const size = 150;
484
484
  const buffer = Buffer.alloc(size);
485
485
  let fd;
486
486
  try {
487
- fd = fs6.openSync(command, "r");
488
- fs6.readSync(fd, buffer, 0, size, 0);
489
- fs6.closeSync(fd);
487
+ fd = fs7.openSync(command, "r");
488
+ fs7.readSync(fd, buffer, 0, size, 0);
489
+ fs7.closeSync(fd);
490
490
  } catch (e3) {
491
491
  }
492
492
  return shebangCommand(buffer.toString());
@@ -501,7 +501,7 @@ var require_parse = __commonJS({
501
501
  "use strict";
502
502
  var path5 = require("path");
503
503
  var resolveCommand = require_resolveCommand();
504
- var escape = require_escape();
504
+ var escape2 = require_escape();
505
505
  var readShebang = require_readShebang();
506
506
  var isWin = process.platform === "win32";
507
507
  var isExecutableRegExp = /\.(?:com|exe)$/i;
@@ -525,8 +525,8 @@ var require_parse = __commonJS({
525
525
  if (parsed.options.forceShell || needsShell) {
526
526
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
527
527
  parsed.command = path5.normalize(parsed.command);
528
- parsed.command = escape.command(parsed.command);
529
- parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
528
+ parsed.command = escape2.command(parsed.command);
529
+ parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
530
530
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
531
531
  parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
532
532
  parsed.command = process.env.comspec || "cmd.exe";
@@ -1040,7 +1040,7 @@ var require_package = __commonJS({
1040
1040
  // node_modules/dotenv/lib/main.js
1041
1041
  var require_main = __commonJS({
1042
1042
  "node_modules/dotenv/lib/main.js"(exports, module2) {
1043
- var fs6 = require("fs");
1043
+ var fs7 = require("fs");
1044
1044
  var path5 = require("path");
1045
1045
  var os4 = require("os");
1046
1046
  var crypto2 = require("crypto");
@@ -1147,7 +1147,7 @@ var require_main = __commonJS({
1147
1147
  if (options && options.path && options.path.length > 0) {
1148
1148
  if (Array.isArray(options.path)) {
1149
1149
  for (const filepath of options.path) {
1150
- if (fs6.existsSync(filepath)) {
1150
+ if (fs7.existsSync(filepath)) {
1151
1151
  possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
1152
1152
  }
1153
1153
  }
@@ -1157,7 +1157,7 @@ var require_main = __commonJS({
1157
1157
  } else {
1158
1158
  possibleVaultPath = path5.resolve(process.cwd(), ".env.vault");
1159
1159
  }
1160
- if (fs6.existsSync(possibleVaultPath)) {
1160
+ if (fs7.existsSync(possibleVaultPath)) {
1161
1161
  return possibleVaultPath;
1162
1162
  }
1163
1163
  return null;
@@ -1201,7 +1201,7 @@ var require_main = __commonJS({
1201
1201
  const parsedAll = {};
1202
1202
  for (const path6 of optionPaths) {
1203
1203
  try {
1204
- const parsed = DotenvModule.parse(fs6.readFileSync(path6, { encoding }));
1204
+ const parsed = DotenvModule.parse(fs7.readFileSync(path6, { encoding }));
1205
1205
  DotenvModule.populate(parsedAll, parsed, options);
1206
1206
  } catch (e3) {
1207
1207
  if (debug3) {
@@ -21024,7 +21024,7 @@ var require_form_data = __commonJS({
21024
21024
  var http3 = require("http");
21025
21025
  var https3 = require("https");
21026
21026
  var parseUrl = require("url").parse;
21027
- var fs6 = require("fs");
21027
+ var fs7 = require("fs");
21028
21028
  var Stream3 = require("stream").Stream;
21029
21029
  var mime = require_mime_types();
21030
21030
  var asynckit = require_asynckit();
@@ -21089,7 +21089,7 @@ var require_form_data = __commonJS({
21089
21089
  if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
21090
21090
  callback(null, value.end + 1 - (value.start ? value.start : 0));
21091
21091
  } else {
21092
- fs6.stat(value.path, function(err, stat) {
21092
+ fs7.stat(value.path, function(err, stat) {
21093
21093
  var fileSize;
21094
21094
  if (err) {
21095
21095
  callback(err);
@@ -22849,7 +22849,7 @@ var require_tiktoken = __commonJS({
22849
22849
  var imports = {};
22850
22850
  imports["./tiktoken_bg.js"] = wasm;
22851
22851
  var path5 = require("path");
22852
- var fs6 = require("fs");
22852
+ var fs7 = require("fs");
22853
22853
  var candidates = __dirname.split(path5.sep).reduce((memo, _7, index, array) => {
22854
22854
  const prefix = array.slice(0, index + 1).join(path5.sep) + path5.sep;
22855
22855
  if (!prefix.includes("node_modules" + path5.sep)) {
@@ -22869,7 +22869,7 @@ var require_tiktoken = __commonJS({
22869
22869
  var bytes = null;
22870
22870
  for (const candidate of candidates) {
22871
22871
  try {
22872
- bytes = fs6.readFileSync(candidate);
22872
+ bytes = fs7.readFileSync(candidate);
22873
22873
  break;
22874
22874
  } catch {
22875
22875
  }
@@ -24058,6 +24058,2144 @@ var require_state2 = __commonJS({
24058
24058
  }
24059
24059
  });
24060
24060
 
24061
+ // node_modules/es-errors/index.js
24062
+ var require_es_errors = __commonJS({
24063
+ "node_modules/es-errors/index.js"(exports, module2) {
24064
+ "use strict";
24065
+ module2.exports = Error;
24066
+ }
24067
+ });
24068
+
24069
+ // node_modules/es-errors/eval.js
24070
+ var require_eval = __commonJS({
24071
+ "node_modules/es-errors/eval.js"(exports, module2) {
24072
+ "use strict";
24073
+ module2.exports = EvalError;
24074
+ }
24075
+ });
24076
+
24077
+ // node_modules/es-errors/range.js
24078
+ var require_range = __commonJS({
24079
+ "node_modules/es-errors/range.js"(exports, module2) {
24080
+ "use strict";
24081
+ module2.exports = RangeError;
24082
+ }
24083
+ });
24084
+
24085
+ // node_modules/es-errors/ref.js
24086
+ var require_ref = __commonJS({
24087
+ "node_modules/es-errors/ref.js"(exports, module2) {
24088
+ "use strict";
24089
+ module2.exports = ReferenceError;
24090
+ }
24091
+ });
24092
+
24093
+ // node_modules/es-errors/syntax.js
24094
+ var require_syntax = __commonJS({
24095
+ "node_modules/es-errors/syntax.js"(exports, module2) {
24096
+ "use strict";
24097
+ module2.exports = SyntaxError;
24098
+ }
24099
+ });
24100
+
24101
+ // node_modules/es-errors/type.js
24102
+ var require_type = __commonJS({
24103
+ "node_modules/es-errors/type.js"(exports, module2) {
24104
+ "use strict";
24105
+ module2.exports = TypeError;
24106
+ }
24107
+ });
24108
+
24109
+ // node_modules/es-errors/uri.js
24110
+ var require_uri = __commonJS({
24111
+ "node_modules/es-errors/uri.js"(exports, module2) {
24112
+ "use strict";
24113
+ module2.exports = URIError;
24114
+ }
24115
+ });
24116
+
24117
+ // node_modules/has-symbols/shams.js
24118
+ var require_shams = __commonJS({
24119
+ "node_modules/has-symbols/shams.js"(exports, module2) {
24120
+ "use strict";
24121
+ module2.exports = function hasSymbols() {
24122
+ if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") {
24123
+ return false;
24124
+ }
24125
+ if (typeof Symbol.iterator === "symbol") {
24126
+ return true;
24127
+ }
24128
+ var obj = {};
24129
+ var sym = Symbol("test");
24130
+ var symObj = Object(sym);
24131
+ if (typeof sym === "string") {
24132
+ return false;
24133
+ }
24134
+ if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
24135
+ return false;
24136
+ }
24137
+ if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
24138
+ return false;
24139
+ }
24140
+ var symVal = 42;
24141
+ obj[sym] = symVal;
24142
+ for (sym in obj) {
24143
+ return false;
24144
+ }
24145
+ if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) {
24146
+ return false;
24147
+ }
24148
+ if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) {
24149
+ return false;
24150
+ }
24151
+ var syms = Object.getOwnPropertySymbols(obj);
24152
+ if (syms.length !== 1 || syms[0] !== sym) {
24153
+ return false;
24154
+ }
24155
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
24156
+ return false;
24157
+ }
24158
+ if (typeof Object.getOwnPropertyDescriptor === "function") {
24159
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
24160
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) {
24161
+ return false;
24162
+ }
24163
+ }
24164
+ return true;
24165
+ };
24166
+ }
24167
+ });
24168
+
24169
+ // node_modules/has-symbols/index.js
24170
+ var require_has_symbols = __commonJS({
24171
+ "node_modules/has-symbols/index.js"(exports, module2) {
24172
+ "use strict";
24173
+ var origSymbol = typeof Symbol !== "undefined" && Symbol;
24174
+ var hasSymbolSham = require_shams();
24175
+ module2.exports = function hasNativeSymbols() {
24176
+ if (typeof origSymbol !== "function") {
24177
+ return false;
24178
+ }
24179
+ if (typeof Symbol !== "function") {
24180
+ return false;
24181
+ }
24182
+ if (typeof origSymbol("foo") !== "symbol") {
24183
+ return false;
24184
+ }
24185
+ if (typeof Symbol("bar") !== "symbol") {
24186
+ return false;
24187
+ }
24188
+ return hasSymbolSham();
24189
+ };
24190
+ }
24191
+ });
24192
+
24193
+ // node_modules/has-proto/index.js
24194
+ var require_has_proto = __commonJS({
24195
+ "node_modules/has-proto/index.js"(exports, module2) {
24196
+ "use strict";
24197
+ var test2 = {
24198
+ __proto__: null,
24199
+ foo: {}
24200
+ };
24201
+ var $Object = Object;
24202
+ module2.exports = function hasProto() {
24203
+ return { __proto__: test2 }.foo === test2.foo && !(test2 instanceof $Object);
24204
+ };
24205
+ }
24206
+ });
24207
+
24208
+ // node_modules/function-bind/implementation.js
24209
+ var require_implementation = __commonJS({
24210
+ "node_modules/function-bind/implementation.js"(exports, module2) {
24211
+ "use strict";
24212
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
24213
+ var toStr = Object.prototype.toString;
24214
+ var max = Math.max;
24215
+ var funcType = "[object Function]";
24216
+ var concatty = function concatty2(a4, b7) {
24217
+ var arr = [];
24218
+ for (var i3 = 0; i3 < a4.length; i3 += 1) {
24219
+ arr[i3] = a4[i3];
24220
+ }
24221
+ for (var j4 = 0; j4 < b7.length; j4 += 1) {
24222
+ arr[j4 + a4.length] = b7[j4];
24223
+ }
24224
+ return arr;
24225
+ };
24226
+ var slicy = function slicy2(arrLike, offset) {
24227
+ var arr = [];
24228
+ for (var i3 = offset || 0, j4 = 0; i3 < arrLike.length; i3 += 1, j4 += 1) {
24229
+ arr[j4] = arrLike[i3];
24230
+ }
24231
+ return arr;
24232
+ };
24233
+ var joiny = function(arr, joiner) {
24234
+ var str2 = "";
24235
+ for (var i3 = 0; i3 < arr.length; i3 += 1) {
24236
+ str2 += arr[i3];
24237
+ if (i3 + 1 < arr.length) {
24238
+ str2 += joiner;
24239
+ }
24240
+ }
24241
+ return str2;
24242
+ };
24243
+ module2.exports = function bind2(that) {
24244
+ var target = this;
24245
+ if (typeof target !== "function" || toStr.apply(target) !== funcType) {
24246
+ throw new TypeError(ERROR_MESSAGE + target);
24247
+ }
24248
+ var args = slicy(arguments, 1);
24249
+ var bound;
24250
+ var binder = function() {
24251
+ if (this instanceof bound) {
24252
+ var result = target.apply(
24253
+ this,
24254
+ concatty(args, arguments)
24255
+ );
24256
+ if (Object(result) === result) {
24257
+ return result;
24258
+ }
24259
+ return this;
24260
+ }
24261
+ return target.apply(
24262
+ that,
24263
+ concatty(args, arguments)
24264
+ );
24265
+ };
24266
+ var boundLength = max(0, target.length - args.length);
24267
+ var boundArgs = [];
24268
+ for (var i3 = 0; i3 < boundLength; i3++) {
24269
+ boundArgs[i3] = "$" + i3;
24270
+ }
24271
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
24272
+ if (target.prototype) {
24273
+ var Empty = function Empty2() {
24274
+ };
24275
+ Empty.prototype = target.prototype;
24276
+ bound.prototype = new Empty();
24277
+ Empty.prototype = null;
24278
+ }
24279
+ return bound;
24280
+ };
24281
+ }
24282
+ });
24283
+
24284
+ // node_modules/function-bind/index.js
24285
+ var require_function_bind = __commonJS({
24286
+ "node_modules/function-bind/index.js"(exports, module2) {
24287
+ "use strict";
24288
+ var implementation = require_implementation();
24289
+ module2.exports = Function.prototype.bind || implementation;
24290
+ }
24291
+ });
24292
+
24293
+ // node_modules/hasown/index.js
24294
+ var require_hasown = __commonJS({
24295
+ "node_modules/hasown/index.js"(exports, module2) {
24296
+ "use strict";
24297
+ var call = Function.prototype.call;
24298
+ var $hasOwn = Object.prototype.hasOwnProperty;
24299
+ var bind2 = require_function_bind();
24300
+ module2.exports = bind2.call(call, $hasOwn);
24301
+ }
24302
+ });
24303
+
24304
+ // node_modules/get-intrinsic/index.js
24305
+ var require_get_intrinsic = __commonJS({
24306
+ "node_modules/get-intrinsic/index.js"(exports, module2) {
24307
+ "use strict";
24308
+ var undefined2;
24309
+ var $Error = require_es_errors();
24310
+ var $EvalError = require_eval();
24311
+ var $RangeError = require_range();
24312
+ var $ReferenceError = require_ref();
24313
+ var $SyntaxError = require_syntax();
24314
+ var $TypeError = require_type();
24315
+ var $URIError = require_uri();
24316
+ var $Function = Function;
24317
+ var getEvalledConstructor = function(expressionSyntax) {
24318
+ try {
24319
+ return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
24320
+ } catch (e3) {
24321
+ }
24322
+ };
24323
+ var $gOPD = Object.getOwnPropertyDescriptor;
24324
+ if ($gOPD) {
24325
+ try {
24326
+ $gOPD({}, "");
24327
+ } catch (e3) {
24328
+ $gOPD = null;
24329
+ }
24330
+ }
24331
+ var throwTypeError = function() {
24332
+ throw new $TypeError();
24333
+ };
24334
+ var ThrowTypeError = $gOPD ? function() {
24335
+ try {
24336
+ arguments.callee;
24337
+ return throwTypeError;
24338
+ } catch (calleeThrows) {
24339
+ try {
24340
+ return $gOPD(arguments, "callee").get;
24341
+ } catch (gOPDthrows) {
24342
+ return throwTypeError;
24343
+ }
24344
+ }
24345
+ }() : throwTypeError;
24346
+ var hasSymbols = require_has_symbols()();
24347
+ var hasProto = require_has_proto()();
24348
+ var getProto = Object.getPrototypeOf || (hasProto ? function(x5) {
24349
+ return x5.__proto__;
24350
+ } : null);
24351
+ var needsEval = {};
24352
+ var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array);
24353
+ var INTRINSICS = {
24354
+ __proto__: null,
24355
+ "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError,
24356
+ "%Array%": Array,
24357
+ "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer,
24358
+ "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2,
24359
+ "%AsyncFromSyncIteratorPrototype%": undefined2,
24360
+ "%AsyncFunction%": needsEval,
24361
+ "%AsyncGenerator%": needsEval,
24362
+ "%AsyncGeneratorFunction%": needsEval,
24363
+ "%AsyncIteratorPrototype%": needsEval,
24364
+ "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics,
24365
+ "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt,
24366
+ "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array,
24367
+ "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array,
24368
+ "%Boolean%": Boolean,
24369
+ "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView,
24370
+ "%Date%": Date,
24371
+ "%decodeURI%": decodeURI,
24372
+ "%decodeURIComponent%": decodeURIComponent,
24373
+ "%encodeURI%": encodeURI,
24374
+ "%encodeURIComponent%": encodeURIComponent,
24375
+ "%Error%": $Error,
24376
+ "%eval%": eval,
24377
+ "%EvalError%": $EvalError,
24378
+ "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array,
24379
+ "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array,
24380
+ "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry,
24381
+ "%Function%": $Function,
24382
+ "%GeneratorFunction%": needsEval,
24383
+ "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array,
24384
+ "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array,
24385
+ "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array,
24386
+ "%isFinite%": isFinite,
24387
+ "%isNaN%": isNaN,
24388
+ "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2,
24389
+ "%JSON%": typeof JSON === "object" ? JSON : undefined2,
24390
+ "%Map%": typeof Map === "undefined" ? undefined2 : Map,
24391
+ "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
24392
+ "%Math%": Math,
24393
+ "%Number%": Number,
24394
+ "%Object%": Object,
24395
+ "%parseFloat%": parseFloat,
24396
+ "%parseInt%": parseInt,
24397
+ "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise,
24398
+ "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy,
24399
+ "%RangeError%": $RangeError,
24400
+ "%ReferenceError%": $ReferenceError,
24401
+ "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect,
24402
+ "%RegExp%": RegExp,
24403
+ "%Set%": typeof Set === "undefined" ? undefined2 : Set,
24404
+ "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
24405
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer,
24406
+ "%String%": String,
24407
+ "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2,
24408
+ "%Symbol%": hasSymbols ? Symbol : undefined2,
24409
+ "%SyntaxError%": $SyntaxError,
24410
+ "%ThrowTypeError%": ThrowTypeError,
24411
+ "%TypedArray%": TypedArray,
24412
+ "%TypeError%": $TypeError,
24413
+ "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array,
24414
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray,
24415
+ "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array,
24416
+ "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array,
24417
+ "%URIError%": $URIError,
24418
+ "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap,
24419
+ "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef,
24420
+ "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet
24421
+ };
24422
+ if (getProto) {
24423
+ try {
24424
+ null.error;
24425
+ } catch (e3) {
24426
+ errorProto = getProto(getProto(e3));
24427
+ INTRINSICS["%Error.prototype%"] = errorProto;
24428
+ }
24429
+ }
24430
+ var errorProto;
24431
+ var doEval = function doEval2(name) {
24432
+ var value;
24433
+ if (name === "%AsyncFunction%") {
24434
+ value = getEvalledConstructor("async function () {}");
24435
+ } else if (name === "%GeneratorFunction%") {
24436
+ value = getEvalledConstructor("function* () {}");
24437
+ } else if (name === "%AsyncGeneratorFunction%") {
24438
+ value = getEvalledConstructor("async function* () {}");
24439
+ } else if (name === "%AsyncGenerator%") {
24440
+ var fn = doEval2("%AsyncGeneratorFunction%");
24441
+ if (fn) {
24442
+ value = fn.prototype;
24443
+ }
24444
+ } else if (name === "%AsyncIteratorPrototype%") {
24445
+ var gen = doEval2("%AsyncGenerator%");
24446
+ if (gen && getProto) {
24447
+ value = getProto(gen.prototype);
24448
+ }
24449
+ }
24450
+ INTRINSICS[name] = value;
24451
+ return value;
24452
+ };
24453
+ var LEGACY_ALIASES = {
24454
+ __proto__: null,
24455
+ "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
24456
+ "%ArrayPrototype%": ["Array", "prototype"],
24457
+ "%ArrayProto_entries%": ["Array", "prototype", "entries"],
24458
+ "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
24459
+ "%ArrayProto_keys%": ["Array", "prototype", "keys"],
24460
+ "%ArrayProto_values%": ["Array", "prototype", "values"],
24461
+ "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
24462
+ "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
24463
+ "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
24464
+ "%BooleanPrototype%": ["Boolean", "prototype"],
24465
+ "%DataViewPrototype%": ["DataView", "prototype"],
24466
+ "%DatePrototype%": ["Date", "prototype"],
24467
+ "%ErrorPrototype%": ["Error", "prototype"],
24468
+ "%EvalErrorPrototype%": ["EvalError", "prototype"],
24469
+ "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
24470
+ "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
24471
+ "%FunctionPrototype%": ["Function", "prototype"],
24472
+ "%Generator%": ["GeneratorFunction", "prototype"],
24473
+ "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
24474
+ "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
24475
+ "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
24476
+ "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
24477
+ "%JSONParse%": ["JSON", "parse"],
24478
+ "%JSONStringify%": ["JSON", "stringify"],
24479
+ "%MapPrototype%": ["Map", "prototype"],
24480
+ "%NumberPrototype%": ["Number", "prototype"],
24481
+ "%ObjectPrototype%": ["Object", "prototype"],
24482
+ "%ObjProto_toString%": ["Object", "prototype", "toString"],
24483
+ "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
24484
+ "%PromisePrototype%": ["Promise", "prototype"],
24485
+ "%PromiseProto_then%": ["Promise", "prototype", "then"],
24486
+ "%Promise_all%": ["Promise", "all"],
24487
+ "%Promise_reject%": ["Promise", "reject"],
24488
+ "%Promise_resolve%": ["Promise", "resolve"],
24489
+ "%RangeErrorPrototype%": ["RangeError", "prototype"],
24490
+ "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
24491
+ "%RegExpPrototype%": ["RegExp", "prototype"],
24492
+ "%SetPrototype%": ["Set", "prototype"],
24493
+ "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
24494
+ "%StringPrototype%": ["String", "prototype"],
24495
+ "%SymbolPrototype%": ["Symbol", "prototype"],
24496
+ "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
24497
+ "%TypedArrayPrototype%": ["TypedArray", "prototype"],
24498
+ "%TypeErrorPrototype%": ["TypeError", "prototype"],
24499
+ "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
24500
+ "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
24501
+ "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
24502
+ "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
24503
+ "%URIErrorPrototype%": ["URIError", "prototype"],
24504
+ "%WeakMapPrototype%": ["WeakMap", "prototype"],
24505
+ "%WeakSetPrototype%": ["WeakSet", "prototype"]
24506
+ };
24507
+ var bind2 = require_function_bind();
24508
+ var hasOwn3 = require_hasown();
24509
+ var $concat = bind2.call(Function.call, Array.prototype.concat);
24510
+ var $spliceApply = bind2.call(Function.apply, Array.prototype.splice);
24511
+ var $replace = bind2.call(Function.call, String.prototype.replace);
24512
+ var $strSlice = bind2.call(Function.call, String.prototype.slice);
24513
+ var $exec = bind2.call(Function.call, RegExp.prototype.exec);
24514
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
24515
+ var reEscapeChar = /\\(\\)?/g;
24516
+ var stringToPath = function stringToPath2(string) {
24517
+ var first = $strSlice(string, 0, 1);
24518
+ var last = $strSlice(string, -1);
24519
+ if (first === "%" && last !== "%") {
24520
+ throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
24521
+ } else if (last === "%" && first !== "%") {
24522
+ throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
24523
+ }
24524
+ var result = [];
24525
+ $replace(string, rePropName, function(match, number, quote, subString) {
24526
+ result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match;
24527
+ });
24528
+ return result;
24529
+ };
24530
+ var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
24531
+ var intrinsicName = name;
24532
+ var alias;
24533
+ if (hasOwn3(LEGACY_ALIASES, intrinsicName)) {
24534
+ alias = LEGACY_ALIASES[intrinsicName];
24535
+ intrinsicName = "%" + alias[0] + "%";
24536
+ }
24537
+ if (hasOwn3(INTRINSICS, intrinsicName)) {
24538
+ var value = INTRINSICS[intrinsicName];
24539
+ if (value === needsEval) {
24540
+ value = doEval(intrinsicName);
24541
+ }
24542
+ if (typeof value === "undefined" && !allowMissing) {
24543
+ throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
24544
+ }
24545
+ return {
24546
+ alias,
24547
+ name: intrinsicName,
24548
+ value
24549
+ };
24550
+ }
24551
+ throw new $SyntaxError("intrinsic " + name + " does not exist!");
24552
+ };
24553
+ module2.exports = function GetIntrinsic(name, allowMissing) {
24554
+ if (typeof name !== "string" || name.length === 0) {
24555
+ throw new $TypeError("intrinsic name must be a non-empty string");
24556
+ }
24557
+ if (arguments.length > 1 && typeof allowMissing !== "boolean") {
24558
+ throw new $TypeError('"allowMissing" argument must be a boolean');
24559
+ }
24560
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
24561
+ throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
24562
+ }
24563
+ var parts = stringToPath(name);
24564
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
24565
+ var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
24566
+ var intrinsicRealName = intrinsic.name;
24567
+ var value = intrinsic.value;
24568
+ var skipFurtherCaching = false;
24569
+ var alias = intrinsic.alias;
24570
+ if (alias) {
24571
+ intrinsicBaseName = alias[0];
24572
+ $spliceApply(parts, $concat([0, 1], alias));
24573
+ }
24574
+ for (var i3 = 1, isOwn = true; i3 < parts.length; i3 += 1) {
24575
+ var part = parts[i3];
24576
+ var first = $strSlice(part, 0, 1);
24577
+ var last = $strSlice(part, -1);
24578
+ if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
24579
+ throw new $SyntaxError("property names with quotes must have matching quotes");
24580
+ }
24581
+ if (part === "constructor" || !isOwn) {
24582
+ skipFurtherCaching = true;
24583
+ }
24584
+ intrinsicBaseName += "." + part;
24585
+ intrinsicRealName = "%" + intrinsicBaseName + "%";
24586
+ if (hasOwn3(INTRINSICS, intrinsicRealName)) {
24587
+ value = INTRINSICS[intrinsicRealName];
24588
+ } else if (value != null) {
24589
+ if (!(part in value)) {
24590
+ if (!allowMissing) {
24591
+ throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
24592
+ }
24593
+ return void 0;
24594
+ }
24595
+ if ($gOPD && i3 + 1 >= parts.length) {
24596
+ var desc = $gOPD(value, part);
24597
+ isOwn = !!desc;
24598
+ if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
24599
+ value = desc.get;
24600
+ } else {
24601
+ value = value[part];
24602
+ }
24603
+ } else {
24604
+ isOwn = hasOwn3(value, part);
24605
+ value = value[part];
24606
+ }
24607
+ if (isOwn && !skipFurtherCaching) {
24608
+ INTRINSICS[intrinsicRealName] = value;
24609
+ }
24610
+ }
24611
+ }
24612
+ return value;
24613
+ };
24614
+ }
24615
+ });
24616
+
24617
+ // node_modules/es-define-property/index.js
24618
+ var require_es_define_property = __commonJS({
24619
+ "node_modules/es-define-property/index.js"(exports, module2) {
24620
+ "use strict";
24621
+ var GetIntrinsic = require_get_intrinsic();
24622
+ var $defineProperty = GetIntrinsic("%Object.defineProperty%", true) || false;
24623
+ if ($defineProperty) {
24624
+ try {
24625
+ $defineProperty({}, "a", { value: 1 });
24626
+ } catch (e3) {
24627
+ $defineProperty = false;
24628
+ }
24629
+ }
24630
+ module2.exports = $defineProperty;
24631
+ }
24632
+ });
24633
+
24634
+ // node_modules/gopd/index.js
24635
+ var require_gopd = __commonJS({
24636
+ "node_modules/gopd/index.js"(exports, module2) {
24637
+ "use strict";
24638
+ var GetIntrinsic = require_get_intrinsic();
24639
+ var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
24640
+ if ($gOPD) {
24641
+ try {
24642
+ $gOPD([], "length");
24643
+ } catch (e3) {
24644
+ $gOPD = null;
24645
+ }
24646
+ }
24647
+ module2.exports = $gOPD;
24648
+ }
24649
+ });
24650
+
24651
+ // node_modules/define-data-property/index.js
24652
+ var require_define_data_property = __commonJS({
24653
+ "node_modules/define-data-property/index.js"(exports, module2) {
24654
+ "use strict";
24655
+ var $defineProperty = require_es_define_property();
24656
+ var $SyntaxError = require_syntax();
24657
+ var $TypeError = require_type();
24658
+ var gopd = require_gopd();
24659
+ module2.exports = function defineDataProperty(obj, property, value) {
24660
+ if (!obj || typeof obj !== "object" && typeof obj !== "function") {
24661
+ throw new $TypeError("`obj` must be an object or a function`");
24662
+ }
24663
+ if (typeof property !== "string" && typeof property !== "symbol") {
24664
+ throw new $TypeError("`property` must be a string or a symbol`");
24665
+ }
24666
+ if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) {
24667
+ throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null");
24668
+ }
24669
+ if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) {
24670
+ throw new $TypeError("`nonWritable`, if provided, must be a boolean or null");
24671
+ }
24672
+ if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) {
24673
+ throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null");
24674
+ }
24675
+ if (arguments.length > 6 && typeof arguments[6] !== "boolean") {
24676
+ throw new $TypeError("`loose`, if provided, must be a boolean");
24677
+ }
24678
+ var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
24679
+ var nonWritable = arguments.length > 4 ? arguments[4] : null;
24680
+ var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
24681
+ var loose = arguments.length > 6 ? arguments[6] : false;
24682
+ var desc = !!gopd && gopd(obj, property);
24683
+ if ($defineProperty) {
24684
+ $defineProperty(obj, property, {
24685
+ configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
24686
+ enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
24687
+ value,
24688
+ writable: nonWritable === null && desc ? desc.writable : !nonWritable
24689
+ });
24690
+ } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) {
24691
+ obj[property] = value;
24692
+ } else {
24693
+ throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
24694
+ }
24695
+ };
24696
+ }
24697
+ });
24698
+
24699
+ // node_modules/has-property-descriptors/index.js
24700
+ var require_has_property_descriptors = __commonJS({
24701
+ "node_modules/has-property-descriptors/index.js"(exports, module2) {
24702
+ "use strict";
24703
+ var $defineProperty = require_es_define_property();
24704
+ var hasPropertyDescriptors = function hasPropertyDescriptors2() {
24705
+ return !!$defineProperty;
24706
+ };
24707
+ hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
24708
+ if (!$defineProperty) {
24709
+ return null;
24710
+ }
24711
+ try {
24712
+ return $defineProperty([], "length", { value: 1 }).length !== 1;
24713
+ } catch (e3) {
24714
+ return true;
24715
+ }
24716
+ };
24717
+ module2.exports = hasPropertyDescriptors;
24718
+ }
24719
+ });
24720
+
24721
+ // node_modules/set-function-length/index.js
24722
+ var require_set_function_length = __commonJS({
24723
+ "node_modules/set-function-length/index.js"(exports, module2) {
24724
+ "use strict";
24725
+ var GetIntrinsic = require_get_intrinsic();
24726
+ var define2 = require_define_data_property();
24727
+ var hasDescriptors = require_has_property_descriptors()();
24728
+ var gOPD = require_gopd();
24729
+ var $TypeError = require_type();
24730
+ var $floor = GetIntrinsic("%Math.floor%");
24731
+ module2.exports = function setFunctionLength(fn, length) {
24732
+ if (typeof fn !== "function") {
24733
+ throw new $TypeError("`fn` is not a function");
24734
+ }
24735
+ if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) {
24736
+ throw new $TypeError("`length` must be a positive 32-bit integer");
24737
+ }
24738
+ var loose = arguments.length > 2 && !!arguments[2];
24739
+ var functionLengthIsConfigurable = true;
24740
+ var functionLengthIsWritable = true;
24741
+ if ("length" in fn && gOPD) {
24742
+ var desc = gOPD(fn, "length");
24743
+ if (desc && !desc.configurable) {
24744
+ functionLengthIsConfigurable = false;
24745
+ }
24746
+ if (desc && !desc.writable) {
24747
+ functionLengthIsWritable = false;
24748
+ }
24749
+ }
24750
+ if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
24751
+ if (hasDescriptors) {
24752
+ define2(fn, "length", length, true, true);
24753
+ } else {
24754
+ define2(fn, "length", length);
24755
+ }
24756
+ }
24757
+ return fn;
24758
+ };
24759
+ }
24760
+ });
24761
+
24762
+ // node_modules/call-bind/index.js
24763
+ var require_call_bind = __commonJS({
24764
+ "node_modules/call-bind/index.js"(exports, module2) {
24765
+ "use strict";
24766
+ var bind2 = require_function_bind();
24767
+ var GetIntrinsic = require_get_intrinsic();
24768
+ var setFunctionLength = require_set_function_length();
24769
+ var $TypeError = require_type();
24770
+ var $apply = GetIntrinsic("%Function.prototype.apply%");
24771
+ var $call = GetIntrinsic("%Function.prototype.call%");
24772
+ var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind2.call($call, $apply);
24773
+ var $defineProperty = require_es_define_property();
24774
+ var $max = GetIntrinsic("%Math.max%");
24775
+ module2.exports = function callBind(originalFunction) {
24776
+ if (typeof originalFunction !== "function") {
24777
+ throw new $TypeError("a function is required");
24778
+ }
24779
+ var func = $reflectApply(bind2, $call, arguments);
24780
+ return setFunctionLength(
24781
+ func,
24782
+ 1 + $max(0, originalFunction.length - (arguments.length - 1)),
24783
+ true
24784
+ );
24785
+ };
24786
+ var applyBind = function applyBind2() {
24787
+ return $reflectApply(bind2, $apply, arguments);
24788
+ };
24789
+ if ($defineProperty) {
24790
+ $defineProperty(module2.exports, "apply", { value: applyBind });
24791
+ } else {
24792
+ module2.exports.apply = applyBind;
24793
+ }
24794
+ }
24795
+ });
24796
+
24797
+ // node_modules/call-bind/callBound.js
24798
+ var require_callBound = __commonJS({
24799
+ "node_modules/call-bind/callBound.js"(exports, module2) {
24800
+ "use strict";
24801
+ var GetIntrinsic = require_get_intrinsic();
24802
+ var callBind = require_call_bind();
24803
+ var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf"));
24804
+ module2.exports = function callBoundIntrinsic(name, allowMissing) {
24805
+ var intrinsic = GetIntrinsic(name, !!allowMissing);
24806
+ if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
24807
+ return callBind(intrinsic);
24808
+ }
24809
+ return intrinsic;
24810
+ };
24811
+ }
24812
+ });
24813
+
24814
+ // node_modules/object-inspect/util.inspect.js
24815
+ var require_util_inspect = __commonJS({
24816
+ "node_modules/object-inspect/util.inspect.js"(exports, module2) {
24817
+ module2.exports = require("util").inspect;
24818
+ }
24819
+ });
24820
+
24821
+ // node_modules/object-inspect/index.js
24822
+ var require_object_inspect = __commonJS({
24823
+ "node_modules/object-inspect/index.js"(exports, module2) {
24824
+ var hasMap = typeof Map === "function" && Map.prototype;
24825
+ var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null;
24826
+ var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null;
24827
+ var mapForEach = hasMap && Map.prototype.forEach;
24828
+ var hasSet = typeof Set === "function" && Set.prototype;
24829
+ var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null;
24830
+ var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null;
24831
+ var setForEach = hasSet && Set.prototype.forEach;
24832
+ var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype;
24833
+ var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
24834
+ var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype;
24835
+ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
24836
+ var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype;
24837
+ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
24838
+ var booleanValueOf = Boolean.prototype.valueOf;
24839
+ var objectToString = Object.prototype.toString;
24840
+ var functionToString = Function.prototype.toString;
24841
+ var $match = String.prototype.match;
24842
+ var $slice = String.prototype.slice;
24843
+ var $replace = String.prototype.replace;
24844
+ var $toUpperCase = String.prototype.toUpperCase;
24845
+ var $toLowerCase = String.prototype.toLowerCase;
24846
+ var $test = RegExp.prototype.test;
24847
+ var $concat = Array.prototype.concat;
24848
+ var $join = Array.prototype.join;
24849
+ var $arrSlice = Array.prototype.slice;
24850
+ var $floor = Math.floor;
24851
+ var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null;
24852
+ var gOPS = Object.getOwnPropertySymbols;
24853
+ var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null;
24854
+ var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object";
24855
+ var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null;
24856
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
24857
+ var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O5) {
24858
+ return O5.__proto__;
24859
+ } : null);
24860
+ function addNumericSeparator(num, str2) {
24861
+ if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str2)) {
24862
+ return str2;
24863
+ }
24864
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
24865
+ if (typeof num === "number") {
24866
+ var int = num < 0 ? -$floor(-num) : $floor(num);
24867
+ if (int !== num) {
24868
+ var intStr = String(int);
24869
+ var dec = $slice.call(str2, intStr.length + 1);
24870
+ return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, "");
24871
+ }
24872
+ }
24873
+ return $replace.call(str2, sepRegex, "$&_");
24874
+ }
24875
+ var utilInspect = require_util_inspect();
24876
+ var inspectCustom = utilInspect.custom;
24877
+ var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
24878
+ module2.exports = function inspect_(obj, options, depth, seen) {
24879
+ var opts = options || {};
24880
+ if (has(opts, "quoteStyle") && (opts.quoteStyle !== "single" && opts.quoteStyle !== "double")) {
24881
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
24882
+ }
24883
+ if (has(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) {
24884
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
24885
+ }
24886
+ var customInspect = has(opts, "customInspect") ? opts.customInspect : true;
24887
+ if (typeof customInspect !== "boolean" && customInspect !== "symbol") {
24888
+ throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
24889
+ }
24890
+ if (has(opts, "indent") && opts.indent !== null && opts.indent !== " " && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) {
24891
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
24892
+ }
24893
+ if (has(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") {
24894
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
24895
+ }
24896
+ var numericSeparator = opts.numericSeparator;
24897
+ if (typeof obj === "undefined") {
24898
+ return "undefined";
24899
+ }
24900
+ if (obj === null) {
24901
+ return "null";
24902
+ }
24903
+ if (typeof obj === "boolean") {
24904
+ return obj ? "true" : "false";
24905
+ }
24906
+ if (typeof obj === "string") {
24907
+ return inspectString(obj, opts);
24908
+ }
24909
+ if (typeof obj === "number") {
24910
+ if (obj === 0) {
24911
+ return Infinity / obj > 0 ? "0" : "-0";
24912
+ }
24913
+ var str2 = String(obj);
24914
+ return numericSeparator ? addNumericSeparator(obj, str2) : str2;
24915
+ }
24916
+ if (typeof obj === "bigint") {
24917
+ var bigIntStr = String(obj) + "n";
24918
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
24919
+ }
24920
+ var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth;
24921
+ if (typeof depth === "undefined") {
24922
+ depth = 0;
24923
+ }
24924
+ if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") {
24925
+ return isArray2(obj) ? "[Array]" : "[Object]";
24926
+ }
24927
+ var indent = getIndent(opts, depth);
24928
+ if (typeof seen === "undefined") {
24929
+ seen = [];
24930
+ } else if (indexOf(seen, obj) >= 0) {
24931
+ return "[Circular]";
24932
+ }
24933
+ function inspect3(value, from, noIndent) {
24934
+ if (from) {
24935
+ seen = $arrSlice.call(seen);
24936
+ seen.push(from);
24937
+ }
24938
+ if (noIndent) {
24939
+ var newOpts = {
24940
+ depth: opts.depth
24941
+ };
24942
+ if (has(opts, "quoteStyle")) {
24943
+ newOpts.quoteStyle = opts.quoteStyle;
24944
+ }
24945
+ return inspect_(value, newOpts, depth + 1, seen);
24946
+ }
24947
+ return inspect_(value, opts, depth + 1, seen);
24948
+ }
24949
+ if (typeof obj === "function" && !isRegExp2(obj)) {
24950
+ var name = nameOf(obj);
24951
+ var keys = arrObjKeys(obj, inspect3);
24952
+ return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
24953
+ }
24954
+ if (isSymbol(obj)) {
24955
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj);
24956
+ return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString;
24957
+ }
24958
+ if (isElement(obj)) {
24959
+ var s2 = "<" + $toLowerCase.call(String(obj.nodeName));
24960
+ var attrs = obj.attributes || [];
24961
+ for (var i3 = 0; i3 < attrs.length; i3++) {
24962
+ s2 += " " + attrs[i3].name + "=" + wrapQuotes(quote(attrs[i3].value), "double", opts);
24963
+ }
24964
+ s2 += ">";
24965
+ if (obj.childNodes && obj.childNodes.length) {
24966
+ s2 += "...";
24967
+ }
24968
+ s2 += "</" + $toLowerCase.call(String(obj.nodeName)) + ">";
24969
+ return s2;
24970
+ }
24971
+ if (isArray2(obj)) {
24972
+ if (obj.length === 0) {
24973
+ return "[]";
24974
+ }
24975
+ var xs = arrObjKeys(obj, inspect3);
24976
+ if (indent && !singleLineValues(xs)) {
24977
+ return "[" + indentedJoin(xs, indent) + "]";
24978
+ }
24979
+ return "[ " + $join.call(xs, ", ") + " ]";
24980
+ }
24981
+ if (isError2(obj)) {
24982
+ var parts = arrObjKeys(obj, inspect3);
24983
+ if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) {
24984
+ return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect3(obj.cause), parts), ", ") + " }";
24985
+ }
24986
+ if (parts.length === 0) {
24987
+ return "[" + String(obj) + "]";
24988
+ }
24989
+ return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }";
24990
+ }
24991
+ if (typeof obj === "object" && customInspect) {
24992
+ if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) {
24993
+ return utilInspect(obj, { depth: maxDepth - depth });
24994
+ } else if (customInspect !== "symbol" && typeof obj.inspect === "function") {
24995
+ return obj.inspect();
24996
+ }
24997
+ }
24998
+ if (isMap(obj)) {
24999
+ var mapParts = [];
25000
+ if (mapForEach) {
25001
+ mapForEach.call(obj, function(value, key) {
25002
+ mapParts.push(inspect3(key, obj, true) + " => " + inspect3(value, obj));
25003
+ });
25004
+ }
25005
+ return collectionOf("Map", mapSize.call(obj), mapParts, indent);
25006
+ }
25007
+ if (isSet(obj)) {
25008
+ var setParts = [];
25009
+ if (setForEach) {
25010
+ setForEach.call(obj, function(value) {
25011
+ setParts.push(inspect3(value, obj));
25012
+ });
25013
+ }
25014
+ return collectionOf("Set", setSize.call(obj), setParts, indent);
25015
+ }
25016
+ if (isWeakMap(obj)) {
25017
+ return weakCollectionOf("WeakMap");
25018
+ }
25019
+ if (isWeakSet(obj)) {
25020
+ return weakCollectionOf("WeakSet");
25021
+ }
25022
+ if (isWeakRef(obj)) {
25023
+ return weakCollectionOf("WeakRef");
25024
+ }
25025
+ if (isNumber2(obj)) {
25026
+ return markBoxed(inspect3(Number(obj)));
25027
+ }
25028
+ if (isBigInt(obj)) {
25029
+ return markBoxed(inspect3(bigIntValueOf.call(obj)));
25030
+ }
25031
+ if (isBoolean2(obj)) {
25032
+ return markBoxed(booleanValueOf.call(obj));
25033
+ }
25034
+ if (isString2(obj)) {
25035
+ return markBoxed(inspect3(String(obj)));
25036
+ }
25037
+ if (typeof window !== "undefined" && obj === window) {
25038
+ return "{ [object Window] }";
25039
+ }
25040
+ if (typeof globalThis !== "undefined" && obj === globalThis || typeof global !== "undefined" && obj === global) {
25041
+ return "{ [object globalThis] }";
25042
+ }
25043
+ if (!isDate2(obj) && !isRegExp2(obj)) {
25044
+ var ys = arrObjKeys(obj, inspect3);
25045
+ var isPlainObject4 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
25046
+ var protoTag = obj instanceof Object ? "" : "null prototype";
25047
+ var stringTag = !isPlainObject4 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
25048
+ var constructorTag = isPlainObject4 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
25049
+ var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
25050
+ if (ys.length === 0) {
25051
+ return tag + "{}";
25052
+ }
25053
+ if (indent) {
25054
+ return tag + "{" + indentedJoin(ys, indent) + "}";
25055
+ }
25056
+ return tag + "{ " + $join.call(ys, ", ") + " }";
25057
+ }
25058
+ return String(obj);
25059
+ };
25060
+ function wrapQuotes(s2, defaultStyle, opts) {
25061
+ var quoteChar = (opts.quoteStyle || defaultStyle) === "double" ? '"' : "'";
25062
+ return quoteChar + s2 + quoteChar;
25063
+ }
25064
+ function quote(s2) {
25065
+ return $replace.call(String(s2), /"/g, "&quot;");
25066
+ }
25067
+ function isArray2(obj) {
25068
+ return toStr(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
25069
+ }
25070
+ function isDate2(obj) {
25071
+ return toStr(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
25072
+ }
25073
+ function isRegExp2(obj) {
25074
+ return toStr(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
25075
+ }
25076
+ function isError2(obj) {
25077
+ return toStr(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
25078
+ }
25079
+ function isString2(obj) {
25080
+ return toStr(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
25081
+ }
25082
+ function isNumber2(obj) {
25083
+ return toStr(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
25084
+ }
25085
+ function isBoolean2(obj) {
25086
+ return toStr(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
25087
+ }
25088
+ function isSymbol(obj) {
25089
+ if (hasShammedSymbols) {
25090
+ return obj && typeof obj === "object" && obj instanceof Symbol;
25091
+ }
25092
+ if (typeof obj === "symbol") {
25093
+ return true;
25094
+ }
25095
+ if (!obj || typeof obj !== "object" || !symToString) {
25096
+ return false;
25097
+ }
25098
+ try {
25099
+ symToString.call(obj);
25100
+ return true;
25101
+ } catch (e3) {
25102
+ }
25103
+ return false;
25104
+ }
25105
+ function isBigInt(obj) {
25106
+ if (!obj || typeof obj !== "object" || !bigIntValueOf) {
25107
+ return false;
25108
+ }
25109
+ try {
25110
+ bigIntValueOf.call(obj);
25111
+ return true;
25112
+ } catch (e3) {
25113
+ }
25114
+ return false;
25115
+ }
25116
+ var hasOwn3 = Object.prototype.hasOwnProperty || function(key) {
25117
+ return key in this;
25118
+ };
25119
+ function has(obj, key) {
25120
+ return hasOwn3.call(obj, key);
25121
+ }
25122
+ function toStr(obj) {
25123
+ return objectToString.call(obj);
25124
+ }
25125
+ function nameOf(f4) {
25126
+ if (f4.name) {
25127
+ return f4.name;
25128
+ }
25129
+ var m5 = $match.call(functionToString.call(f4), /^function\s*([\w$]+)/);
25130
+ if (m5) {
25131
+ return m5[1];
25132
+ }
25133
+ return null;
25134
+ }
25135
+ function indexOf(xs, x5) {
25136
+ if (xs.indexOf) {
25137
+ return xs.indexOf(x5);
25138
+ }
25139
+ for (var i3 = 0, l3 = xs.length; i3 < l3; i3++) {
25140
+ if (xs[i3] === x5) {
25141
+ return i3;
25142
+ }
25143
+ }
25144
+ return -1;
25145
+ }
25146
+ function isMap(x5) {
25147
+ if (!mapSize || !x5 || typeof x5 !== "object") {
25148
+ return false;
25149
+ }
25150
+ try {
25151
+ mapSize.call(x5);
25152
+ try {
25153
+ setSize.call(x5);
25154
+ } catch (s2) {
25155
+ return true;
25156
+ }
25157
+ return x5 instanceof Map;
25158
+ } catch (e3) {
25159
+ }
25160
+ return false;
25161
+ }
25162
+ function isWeakMap(x5) {
25163
+ if (!weakMapHas || !x5 || typeof x5 !== "object") {
25164
+ return false;
25165
+ }
25166
+ try {
25167
+ weakMapHas.call(x5, weakMapHas);
25168
+ try {
25169
+ weakSetHas.call(x5, weakSetHas);
25170
+ } catch (s2) {
25171
+ return true;
25172
+ }
25173
+ return x5 instanceof WeakMap;
25174
+ } catch (e3) {
25175
+ }
25176
+ return false;
25177
+ }
25178
+ function isWeakRef(x5) {
25179
+ if (!weakRefDeref || !x5 || typeof x5 !== "object") {
25180
+ return false;
25181
+ }
25182
+ try {
25183
+ weakRefDeref.call(x5);
25184
+ return true;
25185
+ } catch (e3) {
25186
+ }
25187
+ return false;
25188
+ }
25189
+ function isSet(x5) {
25190
+ if (!setSize || !x5 || typeof x5 !== "object") {
25191
+ return false;
25192
+ }
25193
+ try {
25194
+ setSize.call(x5);
25195
+ try {
25196
+ mapSize.call(x5);
25197
+ } catch (m5) {
25198
+ return true;
25199
+ }
25200
+ return x5 instanceof Set;
25201
+ } catch (e3) {
25202
+ }
25203
+ return false;
25204
+ }
25205
+ function isWeakSet(x5) {
25206
+ if (!weakSetHas || !x5 || typeof x5 !== "object") {
25207
+ return false;
25208
+ }
25209
+ try {
25210
+ weakSetHas.call(x5, weakSetHas);
25211
+ try {
25212
+ weakMapHas.call(x5, weakMapHas);
25213
+ } catch (s2) {
25214
+ return true;
25215
+ }
25216
+ return x5 instanceof WeakSet;
25217
+ } catch (e3) {
25218
+ }
25219
+ return false;
25220
+ }
25221
+ function isElement(x5) {
25222
+ if (!x5 || typeof x5 !== "object") {
25223
+ return false;
25224
+ }
25225
+ if (typeof HTMLElement !== "undefined" && x5 instanceof HTMLElement) {
25226
+ return true;
25227
+ }
25228
+ return typeof x5.nodeName === "string" && typeof x5.getAttribute === "function";
25229
+ }
25230
+ function inspectString(str2, opts) {
25231
+ if (str2.length > opts.maxStringLength) {
25232
+ var remaining = str2.length - opts.maxStringLength;
25233
+ var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : "");
25234
+ return inspectString($slice.call(str2, 0, opts.maxStringLength), opts) + trailer;
25235
+ }
25236
+ var s2 = $replace.call($replace.call(str2, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, lowbyte);
25237
+ return wrapQuotes(s2, "single", opts);
25238
+ }
25239
+ function lowbyte(c3) {
25240
+ var n2 = c3.charCodeAt(0);
25241
+ var x5 = {
25242
+ 8: "b",
25243
+ 9: "t",
25244
+ 10: "n",
25245
+ 12: "f",
25246
+ 13: "r"
25247
+ }[n2];
25248
+ if (x5) {
25249
+ return "\\" + x5;
25250
+ }
25251
+ return "\\x" + (n2 < 16 ? "0" : "") + $toUpperCase.call(n2.toString(16));
25252
+ }
25253
+ function markBoxed(str2) {
25254
+ return "Object(" + str2 + ")";
25255
+ }
25256
+ function weakCollectionOf(type2) {
25257
+ return type2 + " { ? }";
25258
+ }
25259
+ function collectionOf(type2, size, entries, indent) {
25260
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", ");
25261
+ return type2 + " (" + size + ") {" + joinedEntries + "}";
25262
+ }
25263
+ function singleLineValues(xs) {
25264
+ for (var i3 = 0; i3 < xs.length; i3++) {
25265
+ if (indexOf(xs[i3], "\n") >= 0) {
25266
+ return false;
25267
+ }
25268
+ }
25269
+ return true;
25270
+ }
25271
+ function getIndent(opts, depth) {
25272
+ var baseIndent;
25273
+ if (opts.indent === " ") {
25274
+ baseIndent = " ";
25275
+ } else if (typeof opts.indent === "number" && opts.indent > 0) {
25276
+ baseIndent = $join.call(Array(opts.indent + 1), " ");
25277
+ } else {
25278
+ return null;
25279
+ }
25280
+ return {
25281
+ base: baseIndent,
25282
+ prev: $join.call(Array(depth + 1), baseIndent)
25283
+ };
25284
+ }
25285
+ function indentedJoin(xs, indent) {
25286
+ if (xs.length === 0) {
25287
+ return "";
25288
+ }
25289
+ var lineJoiner = "\n" + indent.prev + indent.base;
25290
+ return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
25291
+ }
25292
+ function arrObjKeys(obj, inspect3) {
25293
+ var isArr = isArray2(obj);
25294
+ var xs = [];
25295
+ if (isArr) {
25296
+ xs.length = obj.length;
25297
+ for (var i3 = 0; i3 < obj.length; i3++) {
25298
+ xs[i3] = has(obj, i3) ? inspect3(obj[i3], obj) : "";
25299
+ }
25300
+ }
25301
+ var syms = typeof gOPS === "function" ? gOPS(obj) : [];
25302
+ var symMap;
25303
+ if (hasShammedSymbols) {
25304
+ symMap = {};
25305
+ for (var k7 = 0; k7 < syms.length; k7++) {
25306
+ symMap["$" + syms[k7]] = syms[k7];
25307
+ }
25308
+ }
25309
+ for (var key in obj) {
25310
+ if (!has(obj, key)) {
25311
+ continue;
25312
+ }
25313
+ if (isArr && String(Number(key)) === key && key < obj.length) {
25314
+ continue;
25315
+ }
25316
+ if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) {
25317
+ continue;
25318
+ } else if ($test.call(/[^\w$]/, key)) {
25319
+ xs.push(inspect3(key, obj) + ": " + inspect3(obj[key], obj));
25320
+ } else {
25321
+ xs.push(key + ": " + inspect3(obj[key], obj));
25322
+ }
25323
+ }
25324
+ if (typeof gOPS === "function") {
25325
+ for (var j4 = 0; j4 < syms.length; j4++) {
25326
+ if (isEnumerable.call(obj, syms[j4])) {
25327
+ xs.push("[" + inspect3(syms[j4]) + "]: " + inspect3(obj[syms[j4]], obj));
25328
+ }
25329
+ }
25330
+ }
25331
+ return xs;
25332
+ }
25333
+ }
25334
+ });
25335
+
25336
+ // node_modules/side-channel/index.js
25337
+ var require_side_channel = __commonJS({
25338
+ "node_modules/side-channel/index.js"(exports, module2) {
25339
+ "use strict";
25340
+ var GetIntrinsic = require_get_intrinsic();
25341
+ var callBound = require_callBound();
25342
+ var inspect3 = require_object_inspect();
25343
+ var $TypeError = require_type();
25344
+ var $WeakMap = GetIntrinsic("%WeakMap%", true);
25345
+ var $Map = GetIntrinsic("%Map%", true);
25346
+ var $weakMapGet = callBound("WeakMap.prototype.get", true);
25347
+ var $weakMapSet = callBound("WeakMap.prototype.set", true);
25348
+ var $weakMapHas = callBound("WeakMap.prototype.has", true);
25349
+ var $mapGet = callBound("Map.prototype.get", true);
25350
+ var $mapSet = callBound("Map.prototype.set", true);
25351
+ var $mapHas = callBound("Map.prototype.has", true);
25352
+ var listGetNode = function(list, key) {
25353
+ var prev = list;
25354
+ var curr;
25355
+ for (; (curr = prev.next) !== null; prev = curr) {
25356
+ if (curr.key === key) {
25357
+ prev.next = curr.next;
25358
+ curr.next = list.next;
25359
+ list.next = curr;
25360
+ return curr;
25361
+ }
25362
+ }
25363
+ };
25364
+ var listGet = function(objects, key) {
25365
+ var node = listGetNode(objects, key);
25366
+ return node && node.value;
25367
+ };
25368
+ var listSet = function(objects, key, value) {
25369
+ var node = listGetNode(objects, key);
25370
+ if (node) {
25371
+ node.value = value;
25372
+ } else {
25373
+ objects.next = {
25374
+ key,
25375
+ next: objects.next,
25376
+ value
25377
+ };
25378
+ }
25379
+ };
25380
+ var listHas = function(objects, key) {
25381
+ return !!listGetNode(objects, key);
25382
+ };
25383
+ module2.exports = function getSideChannel() {
25384
+ var $wm;
25385
+ var $m;
25386
+ var $o;
25387
+ var channel = {
25388
+ assert: function(key) {
25389
+ if (!channel.has(key)) {
25390
+ throw new $TypeError("Side channel does not contain " + inspect3(key));
25391
+ }
25392
+ },
25393
+ get: function(key) {
25394
+ if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
25395
+ if ($wm) {
25396
+ return $weakMapGet($wm, key);
25397
+ }
25398
+ } else if ($Map) {
25399
+ if ($m) {
25400
+ return $mapGet($m, key);
25401
+ }
25402
+ } else {
25403
+ if ($o) {
25404
+ return listGet($o, key);
25405
+ }
25406
+ }
25407
+ },
25408
+ has: function(key) {
25409
+ if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
25410
+ if ($wm) {
25411
+ return $weakMapHas($wm, key);
25412
+ }
25413
+ } else if ($Map) {
25414
+ if ($m) {
25415
+ return $mapHas($m, key);
25416
+ }
25417
+ } else {
25418
+ if ($o) {
25419
+ return listHas($o, key);
25420
+ }
25421
+ }
25422
+ return false;
25423
+ },
25424
+ set: function(key, value) {
25425
+ if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
25426
+ if (!$wm) {
25427
+ $wm = new $WeakMap();
25428
+ }
25429
+ $weakMapSet($wm, key, value);
25430
+ } else if ($Map) {
25431
+ if (!$m) {
25432
+ $m = new $Map();
25433
+ }
25434
+ $mapSet($m, key, value);
25435
+ } else {
25436
+ if (!$o) {
25437
+ $o = { key: {}, next: null };
25438
+ }
25439
+ listSet($o, key, value);
25440
+ }
25441
+ }
25442
+ };
25443
+ return channel;
25444
+ };
25445
+ }
25446
+ });
25447
+
25448
+ // node_modules/qs/lib/formats.js
25449
+ var require_formats = __commonJS({
25450
+ "node_modules/qs/lib/formats.js"(exports, module2) {
25451
+ "use strict";
25452
+ var replace = String.prototype.replace;
25453
+ var percentTwenties = /%20/g;
25454
+ var Format = {
25455
+ RFC1738: "RFC1738",
25456
+ RFC3986: "RFC3986"
25457
+ };
25458
+ module2.exports = {
25459
+ "default": Format.RFC3986,
25460
+ formatters: {
25461
+ RFC1738: function(value) {
25462
+ return replace.call(value, percentTwenties, "+");
25463
+ },
25464
+ RFC3986: function(value) {
25465
+ return String(value);
25466
+ }
25467
+ },
25468
+ RFC1738: Format.RFC1738,
25469
+ RFC3986: Format.RFC3986
25470
+ };
25471
+ }
25472
+ });
25473
+
25474
+ // node_modules/qs/lib/utils.js
25475
+ var require_utils2 = __commonJS({
25476
+ "node_modules/qs/lib/utils.js"(exports, module2) {
25477
+ "use strict";
25478
+ var formats = require_formats();
25479
+ var has = Object.prototype.hasOwnProperty;
25480
+ var isArray2 = Array.isArray;
25481
+ var hexTable = function() {
25482
+ var array = [];
25483
+ for (var i3 = 0; i3 < 256; ++i3) {
25484
+ array.push("%" + ((i3 < 16 ? "0" : "") + i3.toString(16)).toUpperCase());
25485
+ }
25486
+ return array;
25487
+ }();
25488
+ var compactQueue = function compactQueue2(queue) {
25489
+ while (queue.length > 1) {
25490
+ var item = queue.pop();
25491
+ var obj = item.obj[item.prop];
25492
+ if (isArray2(obj)) {
25493
+ var compacted = [];
25494
+ for (var j4 = 0; j4 < obj.length; ++j4) {
25495
+ if (typeof obj[j4] !== "undefined") {
25496
+ compacted.push(obj[j4]);
25497
+ }
25498
+ }
25499
+ item.obj[item.prop] = compacted;
25500
+ }
25501
+ }
25502
+ };
25503
+ var arrayToObject2 = function arrayToObject3(source, options) {
25504
+ var obj = options && options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
25505
+ for (var i3 = 0; i3 < source.length; ++i3) {
25506
+ if (typeof source[i3] !== "undefined") {
25507
+ obj[i3] = source[i3];
25508
+ }
25509
+ }
25510
+ return obj;
25511
+ };
25512
+ var merge2 = function merge3(target, source, options) {
25513
+ if (!source) {
25514
+ return target;
25515
+ }
25516
+ if (typeof source !== "object") {
25517
+ if (isArray2(target)) {
25518
+ target.push(source);
25519
+ } else if (target && typeof target === "object") {
25520
+ if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) {
25521
+ target[source] = true;
25522
+ }
25523
+ } else {
25524
+ return [target, source];
25525
+ }
25526
+ return target;
25527
+ }
25528
+ if (!target || typeof target !== "object") {
25529
+ return [target].concat(source);
25530
+ }
25531
+ var mergeTarget = target;
25532
+ if (isArray2(target) && !isArray2(source)) {
25533
+ mergeTarget = arrayToObject2(target, options);
25534
+ }
25535
+ if (isArray2(target) && isArray2(source)) {
25536
+ source.forEach(function(item, i3) {
25537
+ if (has.call(target, i3)) {
25538
+ var targetItem = target[i3];
25539
+ if (targetItem && typeof targetItem === "object" && item && typeof item === "object") {
25540
+ target[i3] = merge3(targetItem, item, options);
25541
+ } else {
25542
+ target.push(item);
25543
+ }
25544
+ } else {
25545
+ target[i3] = item;
25546
+ }
25547
+ });
25548
+ return target;
25549
+ }
25550
+ return Object.keys(source).reduce(function(acc, key) {
25551
+ var value = source[key];
25552
+ if (has.call(acc, key)) {
25553
+ acc[key] = merge3(acc[key], value, options);
25554
+ } else {
25555
+ acc[key] = value;
25556
+ }
25557
+ return acc;
25558
+ }, mergeTarget);
25559
+ };
25560
+ var assign = function assignSingleSource(target, source) {
25561
+ return Object.keys(source).reduce(function(acc, key) {
25562
+ acc[key] = source[key];
25563
+ return acc;
25564
+ }, target);
25565
+ };
25566
+ var decode = function(str2, decoder, charset) {
25567
+ var strWithoutPlus = str2.replace(/\+/g, " ");
25568
+ if (charset === "iso-8859-1") {
25569
+ return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
25570
+ }
25571
+ try {
25572
+ return decodeURIComponent(strWithoutPlus);
25573
+ } catch (e3) {
25574
+ return strWithoutPlus;
25575
+ }
25576
+ };
25577
+ var limit = 1024;
25578
+ var encode3 = function encode4(str2, defaultEncoder, charset, kind3, format) {
25579
+ if (str2.length === 0) {
25580
+ return str2;
25581
+ }
25582
+ var string = str2;
25583
+ if (typeof str2 === "symbol") {
25584
+ string = Symbol.prototype.toString.call(str2);
25585
+ } else if (typeof str2 !== "string") {
25586
+ string = String(str2);
25587
+ }
25588
+ if (charset === "iso-8859-1") {
25589
+ return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
25590
+ return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
25591
+ });
25592
+ }
25593
+ var out = "";
25594
+ for (var j4 = 0; j4 < string.length; j4 += limit) {
25595
+ var segment = string.length >= limit ? string.slice(j4, j4 + limit) : string;
25596
+ var arr = [];
25597
+ for (var i3 = 0; i3 < segment.length; ++i3) {
25598
+ var c3 = segment.charCodeAt(i3);
25599
+ if (c3 === 45 || c3 === 46 || c3 === 95 || c3 === 126 || c3 >= 48 && c3 <= 57 || c3 >= 65 && c3 <= 90 || c3 >= 97 && c3 <= 122 || format === formats.RFC1738 && (c3 === 40 || c3 === 41)) {
25600
+ arr[arr.length] = segment.charAt(i3);
25601
+ continue;
25602
+ }
25603
+ if (c3 < 128) {
25604
+ arr[arr.length] = hexTable[c3];
25605
+ continue;
25606
+ }
25607
+ if (c3 < 2048) {
25608
+ arr[arr.length] = hexTable[192 | c3 >> 6] + hexTable[128 | c3 & 63];
25609
+ continue;
25610
+ }
25611
+ if (c3 < 55296 || c3 >= 57344) {
25612
+ arr[arr.length] = hexTable[224 | c3 >> 12] + hexTable[128 | c3 >> 6 & 63] + hexTable[128 | c3 & 63];
25613
+ continue;
25614
+ }
25615
+ i3 += 1;
25616
+ c3 = 65536 + ((c3 & 1023) << 10 | segment.charCodeAt(i3) & 1023);
25617
+ arr[arr.length] = hexTable[240 | c3 >> 18] + hexTable[128 | c3 >> 12 & 63] + hexTable[128 | c3 >> 6 & 63] + hexTable[128 | c3 & 63];
25618
+ }
25619
+ out += arr.join("");
25620
+ }
25621
+ return out;
25622
+ };
25623
+ var compact = function compact2(value) {
25624
+ var queue = [{ obj: { o: value }, prop: "o" }];
25625
+ var refs = [];
25626
+ for (var i3 = 0; i3 < queue.length; ++i3) {
25627
+ var item = queue[i3];
25628
+ var obj = item.obj[item.prop];
25629
+ var keys = Object.keys(obj);
25630
+ for (var j4 = 0; j4 < keys.length; ++j4) {
25631
+ var key = keys[j4];
25632
+ var val = obj[key];
25633
+ if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
25634
+ queue.push({ obj, prop: key });
25635
+ refs.push(val);
25636
+ }
25637
+ }
25638
+ }
25639
+ compactQueue(queue);
25640
+ return value;
25641
+ };
25642
+ var isRegExp2 = function isRegExp3(obj) {
25643
+ return Object.prototype.toString.call(obj) === "[object RegExp]";
25644
+ };
25645
+ var isBuffer2 = function isBuffer3(obj) {
25646
+ if (!obj || typeof obj !== "object") {
25647
+ return false;
25648
+ }
25649
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
25650
+ };
25651
+ var combine = function combine2(a4, b7) {
25652
+ return [].concat(a4, b7);
25653
+ };
25654
+ var maybeMap = function maybeMap2(val, fn) {
25655
+ if (isArray2(val)) {
25656
+ var mapped = [];
25657
+ for (var i3 = 0; i3 < val.length; i3 += 1) {
25658
+ mapped.push(fn(val[i3]));
25659
+ }
25660
+ return mapped;
25661
+ }
25662
+ return fn(val);
25663
+ };
25664
+ module2.exports = {
25665
+ arrayToObject: arrayToObject2,
25666
+ assign,
25667
+ combine,
25668
+ compact,
25669
+ decode,
25670
+ encode: encode3,
25671
+ isBuffer: isBuffer2,
25672
+ isRegExp: isRegExp2,
25673
+ maybeMap,
25674
+ merge: merge2
25675
+ };
25676
+ }
25677
+ });
25678
+
25679
+ // node_modules/qs/lib/stringify.js
25680
+ var require_stringify = __commonJS({
25681
+ "node_modules/qs/lib/stringify.js"(exports, module2) {
25682
+ "use strict";
25683
+ var getSideChannel = require_side_channel();
25684
+ var utils = require_utils2();
25685
+ var formats = require_formats();
25686
+ var has = Object.prototype.hasOwnProperty;
25687
+ var arrayPrefixGenerators = {
25688
+ brackets: function brackets(prefix) {
25689
+ return prefix + "[]";
25690
+ },
25691
+ comma: "comma",
25692
+ indices: function indices(prefix, key) {
25693
+ return prefix + "[" + key + "]";
25694
+ },
25695
+ repeat: function repeat(prefix) {
25696
+ return prefix;
25697
+ }
25698
+ };
25699
+ var isArray2 = Array.isArray;
25700
+ var push = Array.prototype.push;
25701
+ var pushToArray = function(arr, valueOrArray) {
25702
+ push.apply(arr, isArray2(valueOrArray) ? valueOrArray : [valueOrArray]);
25703
+ };
25704
+ var toISO = Date.prototype.toISOString;
25705
+ var defaultFormat = formats["default"];
25706
+ var defaults2 = {
25707
+ addQueryPrefix: false,
25708
+ allowDots: false,
25709
+ allowEmptyArrays: false,
25710
+ arrayFormat: "indices",
25711
+ charset: "utf-8",
25712
+ charsetSentinel: false,
25713
+ delimiter: "&",
25714
+ encode: true,
25715
+ encodeDotInKeys: false,
25716
+ encoder: utils.encode,
25717
+ encodeValuesOnly: false,
25718
+ format: defaultFormat,
25719
+ formatter: formats.formatters[defaultFormat],
25720
+ indices: false,
25721
+ serializeDate: function serializeDate(date) {
25722
+ return toISO.call(date);
25723
+ },
25724
+ skipNulls: false,
25725
+ strictNullHandling: false
25726
+ };
25727
+ var isNonNullishPrimitive = function isNonNullishPrimitive2(v5) {
25728
+ return typeof v5 === "string" || typeof v5 === "number" || typeof v5 === "boolean" || typeof v5 === "symbol" || typeof v5 === "bigint";
25729
+ };
25730
+ var sentinel = {};
25731
+ var stringify2 = function stringify3(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter2, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) {
25732
+ var obj = object;
25733
+ var tmpSc = sideChannel;
25734
+ var step = 0;
25735
+ var findFlag = false;
25736
+ while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
25737
+ var pos = tmpSc.get(object);
25738
+ step += 1;
25739
+ if (typeof pos !== "undefined") {
25740
+ if (pos === step) {
25741
+ throw new RangeError("Cyclic object value");
25742
+ } else {
25743
+ findFlag = true;
25744
+ }
25745
+ }
25746
+ if (typeof tmpSc.get(sentinel) === "undefined") {
25747
+ step = 0;
25748
+ }
25749
+ }
25750
+ if (typeof filter2 === "function") {
25751
+ obj = filter2(prefix, obj);
25752
+ } else if (obj instanceof Date) {
25753
+ obj = serializeDate(obj);
25754
+ } else if (generateArrayPrefix === "comma" && isArray2(obj)) {
25755
+ obj = utils.maybeMap(obj, function(value2) {
25756
+ if (value2 instanceof Date) {
25757
+ return serializeDate(value2);
25758
+ }
25759
+ return value2;
25760
+ });
25761
+ }
25762
+ if (obj === null) {
25763
+ if (strictNullHandling) {
25764
+ return encoder && !encodeValuesOnly ? encoder(prefix, defaults2.encoder, charset, "key", format) : prefix;
25765
+ }
25766
+ obj = "";
25767
+ }
25768
+ if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
25769
+ if (encoder) {
25770
+ var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults2.encoder, charset, "key", format);
25771
+ return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults2.encoder, charset, "value", format))];
25772
+ }
25773
+ return [formatter(prefix) + "=" + formatter(String(obj))];
25774
+ }
25775
+ var values = [];
25776
+ if (typeof obj === "undefined") {
25777
+ return values;
25778
+ }
25779
+ var objKeys;
25780
+ if (generateArrayPrefix === "comma" && isArray2(obj)) {
25781
+ if (encodeValuesOnly && encoder) {
25782
+ obj = utils.maybeMap(obj, encoder);
25783
+ }
25784
+ objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }];
25785
+ } else if (isArray2(filter2)) {
25786
+ objKeys = filter2;
25787
+ } else {
25788
+ var keys = Object.keys(obj);
25789
+ objKeys = sort ? keys.sort(sort) : keys;
25790
+ }
25791
+ var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, "%2E") : prefix;
25792
+ var adjustedPrefix = commaRoundTrip && isArray2(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
25793
+ if (allowEmptyArrays && isArray2(obj) && obj.length === 0) {
25794
+ return adjustedPrefix + "[]";
25795
+ }
25796
+ for (var j4 = 0; j4 < objKeys.length; ++j4) {
25797
+ var key = objKeys[j4];
25798
+ var value = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key];
25799
+ if (skipNulls && value === null) {
25800
+ continue;
25801
+ }
25802
+ var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key;
25803
+ var keyPrefix = isArray2(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
25804
+ sideChannel.set(object, step);
25805
+ var valueSideChannel = getSideChannel();
25806
+ valueSideChannel.set(sentinel, sideChannel);
25807
+ pushToArray(values, stringify3(
25808
+ value,
25809
+ keyPrefix,
25810
+ generateArrayPrefix,
25811
+ commaRoundTrip,
25812
+ allowEmptyArrays,
25813
+ strictNullHandling,
25814
+ skipNulls,
25815
+ encodeDotInKeys,
25816
+ generateArrayPrefix === "comma" && encodeValuesOnly && isArray2(obj) ? null : encoder,
25817
+ filter2,
25818
+ sort,
25819
+ allowDots,
25820
+ serializeDate,
25821
+ format,
25822
+ formatter,
25823
+ encodeValuesOnly,
25824
+ charset,
25825
+ valueSideChannel
25826
+ ));
25827
+ }
25828
+ return values;
25829
+ };
25830
+ var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) {
25831
+ if (!opts) {
25832
+ return defaults2;
25833
+ }
25834
+ if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
25835
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
25836
+ }
25837
+ if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") {
25838
+ throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
25839
+ }
25840
+ if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") {
25841
+ throw new TypeError("Encoder has to be a function.");
25842
+ }
25843
+ var charset = opts.charset || defaults2.charset;
25844
+ if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
25845
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
25846
+ }
25847
+ var format = formats["default"];
25848
+ if (typeof opts.format !== "undefined") {
25849
+ if (!has.call(formats.formatters, opts.format)) {
25850
+ throw new TypeError("Unknown format option provided.");
25851
+ }
25852
+ format = opts.format;
25853
+ }
25854
+ var formatter = formats.formatters[format];
25855
+ var filter2 = defaults2.filter;
25856
+ if (typeof opts.filter === "function" || isArray2(opts.filter)) {
25857
+ filter2 = opts.filter;
25858
+ }
25859
+ var arrayFormat;
25860
+ if (opts.arrayFormat in arrayPrefixGenerators) {
25861
+ arrayFormat = opts.arrayFormat;
25862
+ } else if ("indices" in opts) {
25863
+ arrayFormat = opts.indices ? "indices" : "repeat";
25864
+ } else {
25865
+ arrayFormat = defaults2.arrayFormat;
25866
+ }
25867
+ if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") {
25868
+ throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
25869
+ }
25870
+ var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots;
25871
+ return {
25872
+ addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults2.addQueryPrefix,
25873
+ allowDots,
25874
+ allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays,
25875
+ arrayFormat,
25876
+ charset,
25877
+ charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel,
25878
+ commaRoundTrip: opts.commaRoundTrip,
25879
+ delimiter: typeof opts.delimiter === "undefined" ? defaults2.delimiter : opts.delimiter,
25880
+ encode: typeof opts.encode === "boolean" ? opts.encode : defaults2.encode,
25881
+ encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults2.encodeDotInKeys,
25882
+ encoder: typeof opts.encoder === "function" ? opts.encoder : defaults2.encoder,
25883
+ encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults2.encodeValuesOnly,
25884
+ filter: filter2,
25885
+ format,
25886
+ formatter,
25887
+ serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults2.serializeDate,
25888
+ skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults2.skipNulls,
25889
+ sort: typeof opts.sort === "function" ? opts.sort : null,
25890
+ strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling
25891
+ };
25892
+ };
25893
+ module2.exports = function(object, opts) {
25894
+ var obj = object;
25895
+ var options = normalizeStringifyOptions(opts);
25896
+ var objKeys;
25897
+ var filter2;
25898
+ if (typeof options.filter === "function") {
25899
+ filter2 = options.filter;
25900
+ obj = filter2("", obj);
25901
+ } else if (isArray2(options.filter)) {
25902
+ filter2 = options.filter;
25903
+ objKeys = filter2;
25904
+ }
25905
+ var keys = [];
25906
+ if (typeof obj !== "object" || obj === null) {
25907
+ return "";
25908
+ }
25909
+ var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
25910
+ var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip;
25911
+ if (!objKeys) {
25912
+ objKeys = Object.keys(obj);
25913
+ }
25914
+ if (options.sort) {
25915
+ objKeys.sort(options.sort);
25916
+ }
25917
+ var sideChannel = getSideChannel();
25918
+ for (var i3 = 0; i3 < objKeys.length; ++i3) {
25919
+ var key = objKeys[i3];
25920
+ if (options.skipNulls && obj[key] === null) {
25921
+ continue;
25922
+ }
25923
+ pushToArray(keys, stringify2(
25924
+ obj[key],
25925
+ key,
25926
+ generateArrayPrefix,
25927
+ commaRoundTrip,
25928
+ options.allowEmptyArrays,
25929
+ options.strictNullHandling,
25930
+ options.skipNulls,
25931
+ options.encodeDotInKeys,
25932
+ options.encode ? options.encoder : null,
25933
+ options.filter,
25934
+ options.sort,
25935
+ options.allowDots,
25936
+ options.serializeDate,
25937
+ options.format,
25938
+ options.formatter,
25939
+ options.encodeValuesOnly,
25940
+ options.charset,
25941
+ sideChannel
25942
+ ));
25943
+ }
25944
+ var joined = keys.join(options.delimiter);
25945
+ var prefix = options.addQueryPrefix === true ? "?" : "";
25946
+ if (options.charsetSentinel) {
25947
+ if (options.charset === "iso-8859-1") {
25948
+ prefix += "utf8=%26%2310003%3B&";
25949
+ } else {
25950
+ prefix += "utf8=%E2%9C%93&";
25951
+ }
25952
+ }
25953
+ return joined.length > 0 ? prefix + joined : "";
25954
+ };
25955
+ }
25956
+ });
25957
+
25958
+ // node_modules/qs/lib/parse.js
25959
+ var require_parse2 = __commonJS({
25960
+ "node_modules/qs/lib/parse.js"(exports, module2) {
25961
+ "use strict";
25962
+ var utils = require_utils2();
25963
+ var has = Object.prototype.hasOwnProperty;
25964
+ var isArray2 = Array.isArray;
25965
+ var defaults2 = {
25966
+ allowDots: false,
25967
+ allowEmptyArrays: false,
25968
+ allowPrototypes: false,
25969
+ allowSparse: false,
25970
+ arrayLimit: 20,
25971
+ charset: "utf-8",
25972
+ charsetSentinel: false,
25973
+ comma: false,
25974
+ decodeDotInKeys: false,
25975
+ decoder: utils.decode,
25976
+ delimiter: "&",
25977
+ depth: 5,
25978
+ duplicates: "combine",
25979
+ ignoreQueryPrefix: false,
25980
+ interpretNumericEntities: false,
25981
+ parameterLimit: 1e3,
25982
+ parseArrays: true,
25983
+ plainObjects: false,
25984
+ strictDepth: false,
25985
+ strictNullHandling: false
25986
+ };
25987
+ var interpretNumericEntities = function(str2) {
25988
+ return str2.replace(/&#(\d+);/g, function($0, numberStr) {
25989
+ return String.fromCharCode(parseInt(numberStr, 10));
25990
+ });
25991
+ };
25992
+ var parseArrayValue = function(val, options) {
25993
+ if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) {
25994
+ return val.split(",");
25995
+ }
25996
+ return val;
25997
+ };
25998
+ var isoSentinel = "utf8=%26%2310003%3B";
25999
+ var charsetSentinel = "utf8=%E2%9C%93";
26000
+ var parseValues = function parseQueryStringValues(str2, options) {
26001
+ var obj = { __proto__: null };
26002
+ var cleanStr = options.ignoreQueryPrefix ? str2.replace(/^\?/, "") : str2;
26003
+ cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
26004
+ var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
26005
+ var parts = cleanStr.split(options.delimiter, limit);
26006
+ var skipIndex = -1;
26007
+ var i3;
26008
+ var charset = options.charset;
26009
+ if (options.charsetSentinel) {
26010
+ for (i3 = 0; i3 < parts.length; ++i3) {
26011
+ if (parts[i3].indexOf("utf8=") === 0) {
26012
+ if (parts[i3] === charsetSentinel) {
26013
+ charset = "utf-8";
26014
+ } else if (parts[i3] === isoSentinel) {
26015
+ charset = "iso-8859-1";
26016
+ }
26017
+ skipIndex = i3;
26018
+ i3 = parts.length;
26019
+ }
26020
+ }
26021
+ }
26022
+ for (i3 = 0; i3 < parts.length; ++i3) {
26023
+ if (i3 === skipIndex) {
26024
+ continue;
26025
+ }
26026
+ var part = parts[i3];
26027
+ var bracketEqualsPos = part.indexOf("]=");
26028
+ var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
26029
+ var key, val;
26030
+ if (pos === -1) {
26031
+ key = options.decoder(part, defaults2.decoder, charset, "key");
26032
+ val = options.strictNullHandling ? null : "";
26033
+ } else {
26034
+ key = options.decoder(part.slice(0, pos), defaults2.decoder, charset, "key");
26035
+ val = utils.maybeMap(
26036
+ parseArrayValue(part.slice(pos + 1), options),
26037
+ function(encodedVal) {
26038
+ return options.decoder(encodedVal, defaults2.decoder, charset, "value");
26039
+ }
26040
+ );
26041
+ }
26042
+ if (val && options.interpretNumericEntities && charset === "iso-8859-1") {
26043
+ val = interpretNumericEntities(val);
26044
+ }
26045
+ if (part.indexOf("[]=") > -1) {
26046
+ val = isArray2(val) ? [val] : val;
26047
+ }
26048
+ var existing = has.call(obj, key);
26049
+ if (existing && options.duplicates === "combine") {
26050
+ obj[key] = utils.combine(obj[key], val);
26051
+ } else if (!existing || options.duplicates === "last") {
26052
+ obj[key] = val;
26053
+ }
26054
+ }
26055
+ return obj;
26056
+ };
26057
+ var parseObject = function(chain, val, options, valuesParsed) {
26058
+ var leaf = valuesParsed ? val : parseArrayValue(val, options);
26059
+ for (var i3 = chain.length - 1; i3 >= 0; --i3) {
26060
+ var obj;
26061
+ var root = chain[i3];
26062
+ if (root === "[]" && options.parseArrays) {
26063
+ obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf);
26064
+ } else {
26065
+ obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
26066
+ var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
26067
+ var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
26068
+ var index = parseInt(decodedRoot, 10);
26069
+ if (!options.parseArrays && decodedRoot === "") {
26070
+ obj = { 0: leaf };
26071
+ } else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) {
26072
+ obj = [];
26073
+ obj[index] = leaf;
26074
+ } else if (decodedRoot !== "__proto__") {
26075
+ obj[decodedRoot] = leaf;
26076
+ }
26077
+ }
26078
+ leaf = obj;
26079
+ }
26080
+ return leaf;
26081
+ };
26082
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
26083
+ if (!givenKey) {
26084
+ return;
26085
+ }
26086
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
26087
+ var brackets = /(\[[^[\]]*])/;
26088
+ var child = /(\[[^[\]]*])/g;
26089
+ var segment = options.depth > 0 && brackets.exec(key);
26090
+ var parent = segment ? key.slice(0, segment.index) : key;
26091
+ var keys = [];
26092
+ if (parent) {
26093
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
26094
+ if (!options.allowPrototypes) {
26095
+ return;
26096
+ }
26097
+ }
26098
+ keys.push(parent);
26099
+ }
26100
+ var i3 = 0;
26101
+ while (options.depth > 0 && (segment = child.exec(key)) !== null && i3 < options.depth) {
26102
+ i3 += 1;
26103
+ if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
26104
+ if (!options.allowPrototypes) {
26105
+ return;
26106
+ }
26107
+ }
26108
+ keys.push(segment[1]);
26109
+ }
26110
+ if (segment) {
26111
+ if (options.strictDepth === true) {
26112
+ throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
26113
+ }
26114
+ keys.push("[" + key.slice(segment.index) + "]");
26115
+ }
26116
+ return parseObject(keys, val, options, valuesParsed);
26117
+ };
26118
+ var normalizeParseOptions = function normalizeParseOptions2(opts) {
26119
+ if (!opts) {
26120
+ return defaults2;
26121
+ }
26122
+ if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
26123
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
26124
+ }
26125
+ if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") {
26126
+ throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
26127
+ }
26128
+ if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") {
26129
+ throw new TypeError("Decoder has to be a function.");
26130
+ }
26131
+ if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
26132
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
26133
+ }
26134
+ var charset = typeof opts.charset === "undefined" ? defaults2.charset : opts.charset;
26135
+ var duplicates = typeof opts.duplicates === "undefined" ? defaults2.duplicates : opts.duplicates;
26136
+ if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") {
26137
+ throw new TypeError("The duplicates option must be either combine, first, or last");
26138
+ }
26139
+ var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots;
26140
+ return {
26141
+ allowDots,
26142
+ allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays,
26143
+ allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults2.allowPrototypes,
26144
+ allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults2.allowSparse,
26145
+ arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults2.arrayLimit,
26146
+ charset,
26147
+ charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel,
26148
+ comma: typeof opts.comma === "boolean" ? opts.comma : defaults2.comma,
26149
+ decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults2.decodeDotInKeys,
26150
+ decoder: typeof opts.decoder === "function" ? opts.decoder : defaults2.decoder,
26151
+ delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults2.delimiter,
26152
+ depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults2.depth,
26153
+ duplicates,
26154
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
26155
+ interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults2.interpretNumericEntities,
26156
+ parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults2.parameterLimit,
26157
+ parseArrays: opts.parseArrays !== false,
26158
+ plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults2.plainObjects,
26159
+ strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults2.strictDepth,
26160
+ strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling
26161
+ };
26162
+ };
26163
+ module2.exports = function(str2, opts) {
26164
+ var options = normalizeParseOptions(opts);
26165
+ if (str2 === "" || str2 === null || typeof str2 === "undefined") {
26166
+ return options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
26167
+ }
26168
+ var tempObj = typeof str2 === "string" ? parseValues(str2, options) : str2;
26169
+ var obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
26170
+ var keys = Object.keys(tempObj);
26171
+ for (var i3 = 0; i3 < keys.length; ++i3) {
26172
+ var key = keys[i3];
26173
+ var newObj = parseKeys(key, tempObj[key], options, typeof str2 === "string");
26174
+ obj = utils.merge(obj, newObj, options);
26175
+ }
26176
+ if (options.allowSparse === true) {
26177
+ return obj;
26178
+ }
26179
+ return utils.compact(obj);
26180
+ };
26181
+ }
26182
+ });
26183
+
26184
+ // node_modules/qs/lib/index.js
26185
+ var require_lib3 = __commonJS({
26186
+ "node_modules/qs/lib/index.js"(exports, module2) {
26187
+ "use strict";
26188
+ var stringify2 = require_stringify();
26189
+ var parse = require_parse2();
26190
+ var formats = require_formats();
26191
+ module2.exports = {
26192
+ formats,
26193
+ parse,
26194
+ stringify: stringify2
26195
+ };
26196
+ }
26197
+ });
26198
+
24061
26199
  // node_modules/@commitlint/types/lib/ensure.js
24062
26200
  var require_ensure = __commonJS({
24063
26201
  "node_modules/@commitlint/types/lib/ensure.js"(exports) {
@@ -24099,7 +26237,7 @@ var require_load = __commonJS({
24099
26237
  });
24100
26238
 
24101
26239
  // node_modules/@commitlint/types/lib/parse.js
24102
- var require_parse2 = __commonJS({
26240
+ var require_parse3 = __commonJS({
24103
26241
  "node_modules/@commitlint/types/lib/parse.js"(exports) {
24104
26242
  "use strict";
24105
26243
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -24135,7 +26273,7 @@ var require_rules = __commonJS({
24135
26273
  });
24136
26274
 
24137
26275
  // node_modules/@commitlint/types/lib/index.js
24138
- var require_lib3 = __commonJS({
26276
+ var require_lib4 = __commonJS({
24139
26277
  "node_modules/@commitlint/types/lib/index.js"(exports) {
24140
26278
  "use strict";
24141
26279
  var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o3, m5, k7, k22) {
@@ -24164,7 +26302,7 @@ var require_lib3 = __commonJS({
24164
26302
  __exportStar2(require_is_ignored(), exports);
24165
26303
  __exportStar2(require_lint(), exports);
24166
26304
  __exportStar2(require_load(), exports);
24167
- __exportStar2(require_parse2(), exports);
26305
+ __exportStar2(require_parse3(), exports);
24168
26306
  __exportStar2(require_prompt(), exports);
24169
26307
  __exportStar2(require_rules(), exports);
24170
26308
  }
@@ -25193,7 +27331,7 @@ function G3(t2, e3) {
25193
27331
  // package.json
25194
27332
  var package_default = {
25195
27333
  name: "opencommit",
25196
- version: "3.1.1",
27334
+ version: "3.2.1",
25197
27335
  description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
25198
27336
  keywords: [
25199
27337
  "git",
@@ -25239,8 +27377,9 @@ var package_default = {
25239
27377
  "dev:gemini": "OCO_AI_PROVIDER='gemini' ts-node ./src/cli.ts",
25240
27378
  build: "rimraf out && node esbuild.config.js",
25241
27379
  "build:push": "npm run build && git add . && git commit -m 'build' && git push",
25242
- deploy: "npm run build:push && git push --tags && npm publish --tag latest",
25243
- "deploy:patch": "npm version patch && npm run deploy",
27380
+ deploy: "npm publish --tag latest",
27381
+ "deploy:build": "npm run build:push && git push --tags && npm run deploy",
27382
+ "deploy:patch": "npm version patch && npm run deploy:build",
25244
27383
  lint: "eslint src --ext ts && tsc --noEmit",
25245
27384
  format: "prettier --write src",
25246
27385
  test: "node --no-warnings --experimental-vm-modules $( [ -f ./node_modules/.bin/jest ] && echo ./node_modules/.bin/jest || which jest ) test/unit",
@@ -25281,7 +27420,6 @@ var package_default = {
25281
27420
  "@google/generative-ai": "^0.11.4",
25282
27421
  "@octokit/webhooks-schemas": "^6.11.0",
25283
27422
  "@octokit/webhooks-types": "^6.11.0",
25284
- ai: "^2.2.14",
25285
27423
  axios: "^1.3.4",
25286
27424
  chalk: "^5.2.0",
25287
27425
  cleye: "^1.3.2",
@@ -25290,7 +27428,7 @@ var package_default = {
25290
27428
  ignore: "^5.2.4",
25291
27429
  ini: "^3.0.1",
25292
27430
  inquirer: "^9.1.4",
25293
- openai: "^4.56.0"
27431
+ openai: "^4.57.0"
25294
27432
  }
25295
27433
  };
25296
27434
 
@@ -27739,33 +29877,6 @@ function getI18nLocal(value) {
27739
29877
  }
27740
29878
 
27741
29879
  // src/commands/config.ts
27742
- var CONFIG_KEYS = /* @__PURE__ */ ((CONFIG_KEYS2) => {
27743
- CONFIG_KEYS2["OCO_OPENAI_API_KEY"] = "OCO_OPENAI_API_KEY";
27744
- CONFIG_KEYS2["OCO_ANTHROPIC_API_KEY"] = "OCO_ANTHROPIC_API_KEY";
27745
- CONFIG_KEYS2["OCO_AZURE_API_KEY"] = "OCO_AZURE_API_KEY";
27746
- CONFIG_KEYS2["OCO_GEMINI_API_KEY"] = "OCO_GEMINI_API_KEY";
27747
- CONFIG_KEYS2["OCO_GEMINI_BASE_PATH"] = "OCO_GEMINI_BASE_PATH";
27748
- CONFIG_KEYS2["OCO_TOKENS_MAX_INPUT"] = "OCO_TOKENS_MAX_INPUT";
27749
- CONFIG_KEYS2["OCO_TOKENS_MAX_OUTPUT"] = "OCO_TOKENS_MAX_OUTPUT";
27750
- CONFIG_KEYS2["OCO_OPENAI_BASE_PATH"] = "OCO_OPENAI_BASE_PATH";
27751
- CONFIG_KEYS2["OCO_DESCRIPTION"] = "OCO_DESCRIPTION";
27752
- CONFIG_KEYS2["OCO_EMOJI"] = "OCO_EMOJI";
27753
- CONFIG_KEYS2["OCO_MODEL"] = "OCO_MODEL";
27754
- CONFIG_KEYS2["OCO_LANGUAGE"] = "OCO_LANGUAGE";
27755
- CONFIG_KEYS2["OCO_WHY"] = "OCO_WHY";
27756
- CONFIG_KEYS2["OCO_MESSAGE_TEMPLATE_PLACEHOLDER"] = "OCO_MESSAGE_TEMPLATE_PLACEHOLDER";
27757
- CONFIG_KEYS2["OCO_PROMPT_MODULE"] = "OCO_PROMPT_MODULE";
27758
- CONFIG_KEYS2["OCO_AI_PROVIDER"] = "OCO_AI_PROVIDER";
27759
- CONFIG_KEYS2["OCO_GITPUSH"] = "OCO_GITPUSH";
27760
- CONFIG_KEYS2["OCO_ONE_LINE_COMMIT"] = "OCO_ONE_LINE_COMMIT";
27761
- CONFIG_KEYS2["OCO_AZURE_ENDPOINT"] = "OCO_AZURE_ENDPOINT";
27762
- CONFIG_KEYS2["OCO_TEST_MOCK_TYPE"] = "OCO_TEST_MOCK_TYPE";
27763
- CONFIG_KEYS2["OCO_API_URL"] = "OCO_API_URL";
27764
- CONFIG_KEYS2["OCO_OLLAMA_API_URL"] = "OCO_OLLAMA_API_URL";
27765
- CONFIG_KEYS2["OCO_FLOWISE_ENDPOINT"] = "OCO_FLOWISE_ENDPOINT";
27766
- CONFIG_KEYS2["OCO_FLOWISE_API_KEY"] = "OCO_FLOWISE_API_KEY";
27767
- return CONFIG_KEYS2;
27768
- })(CONFIG_KEYS || {});
27769
29880
  var MODEL_LIST = {
27770
29881
  openai: [
27771
29882
  "gpt-4o-mini",
@@ -27831,56 +29942,18 @@ var validateConfig = (key, condition, validationMessage) => {
27831
29942
  }
27832
29943
  };
27833
29944
  var configValidators = {
27834
- ["OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */](value, config7 = {}) {
29945
+ ["OCO_API_KEY" /* OCO_API_KEY */](value, config7 = {}) {
27835
29946
  if (config7.OCO_AI_PROVIDER !== "openai")
27836
29947
  return value;
27837
29948
  validateConfig(
27838
- "OCO_OPENAI_API_KEY",
29949
+ "OCO_API_KEY",
27839
29950
  typeof value === "string" && value.length > 0,
27840
29951
  "Empty value is not allowed"
27841
29952
  );
27842
29953
  validateConfig(
27843
- "OCO_OPENAI_API_KEY",
29954
+ "OCO_API_KEY",
27844
29955
  value,
27845
- 'You need to provide the OCO_OPENAI_API_KEY when OCO_AI_PROVIDER is set to "openai" (default). Run `oco config set OCO_OPENAI_API_KEY=your_key`'
27846
- );
27847
- return value;
27848
- },
27849
- ["OCO_AZURE_API_KEY" /* OCO_AZURE_API_KEY */](value, config7 = {}) {
27850
- if (config7.OCO_AI_PROVIDER !== "azure")
27851
- return value;
27852
- validateConfig(
27853
- "OCO_AZURE_API_KEY",
27854
- !!value,
27855
- 'You need to provide the OCO_AZURE_API_KEY when OCO_AI_PROVIDER is set to "azure". Run: `oco config set OCO_AZURE_API_KEY=your_key`'
27856
- );
27857
- return value;
27858
- },
27859
- ["OCO_GEMINI_API_KEY" /* OCO_GEMINI_API_KEY */](value, config7 = {}) {
27860
- if (config7.OCO_AI_PROVIDER !== "gemini")
27861
- return value;
27862
- validateConfig(
27863
- "OCO_GEMINI_API_KEY",
27864
- value || config7.OCO_GEMINI_API_KEY || config7.OCO_AI_PROVIDER === "test",
27865
- 'You need to provide the OCO_GEMINI_API_KEY when OCO_AI_PROVIDER is set to "gemini". Run: `oco config set OCO_GEMINI_API_KEY=your_key`'
27866
- );
27867
- return value;
27868
- },
27869
- ["OCO_ANTHROPIC_API_KEY" /* OCO_ANTHROPIC_API_KEY */](value, config7 = {}) {
27870
- if (config7.OCO_AI_PROVIDER !== "anthropic")
27871
- return value;
27872
- validateConfig(
27873
- "ANTHROPIC_API_KEY",
27874
- !!value,
27875
- 'You need to provide the OCO_ANTHROPIC_API_KEY key when OCO_AI_PROVIDER is set to "anthropic". Run: `oco config set OCO_ANTHROPIC_API_KEY=your_key`'
27876
- );
27877
- return value;
27878
- },
27879
- ["OCO_FLOWISE_API_KEY" /* OCO_FLOWISE_API_KEY */](value, config7 = {}) {
27880
- validateConfig(
27881
- "OCO_FLOWISE_API_KEY" /* OCO_FLOWISE_API_KEY */,
27882
- value || config7.OCO_AI_PROVIDER !== "flowise",
27883
- 'You need to provide the OCO_FLOWISE_API_KEY when OCO_AI_PROVIDER is set to "flowise". Run: `oco config set OCO_FLOWISE_API_KEY=your_key`'
29956
+ 'You need to provide the OCO_API_KEY when OCO_AI_PROVIDER set to "openai" (default) or "ollama" or "azure" or "gemini" or "flowise" or "anthropic". Run `oco config set OCO_API_KEY=your_key OCO_AI_PROVIDER=openai`'
27884
29957
  );
27885
29958
  return value;
27886
29959
  },
@@ -27927,11 +30000,11 @@ var configValidators = {
27927
30000
  );
27928
30001
  return getI18nLocal(value);
27929
30002
  },
27930
- ["OCO_OPENAI_BASE_PATH" /* OCO_OPENAI_BASE_PATH */](value) {
30003
+ ["OCO_API_URL" /* OCO_API_URL */](value) {
27931
30004
  validateConfig(
27932
- "OCO_OPENAI_BASE_PATH" /* OCO_OPENAI_BASE_PATH */,
30005
+ "OCO_API_URL" /* OCO_API_URL */,
27933
30006
  typeof value === "string",
27934
- "Must be string"
30007
+ `${value} is not a valid URL. It should start with 'http://' or 'https://'.`
27935
30008
  );
27936
30009
  return value;
27937
30010
  },
@@ -27993,22 +30066,6 @@ var configValidators = {
27993
30066
  );
27994
30067
  return value;
27995
30068
  },
27996
- ["OCO_AZURE_ENDPOINT" /* OCO_AZURE_ENDPOINT */](value) {
27997
- validateConfig(
27998
- "OCO_AZURE_ENDPOINT" /* OCO_AZURE_ENDPOINT */,
27999
- value.includes("openai.azure.com"),
28000
- 'Must be in format "https://<resource name>.openai.azure.com/"'
28001
- );
28002
- return value;
28003
- },
28004
- ["OCO_FLOWISE_ENDPOINT" /* OCO_FLOWISE_ENDPOINT */](value) {
28005
- validateConfig(
28006
- "OCO_FLOWISE_ENDPOINT" /* OCO_FLOWISE_ENDPOINT */,
28007
- typeof value === "string" && value.includes(":"),
28008
- "Value must be string and should include both I.P. and port number"
28009
- );
28010
- return value;
28011
- },
28012
30069
  ["OCO_TEST_MOCK_TYPE" /* OCO_TEST_MOCK_TYPE */](value) {
28013
30070
  validateConfig(
28014
30071
  "OCO_TEST_MOCK_TYPE" /* OCO_TEST_MOCK_TYPE */,
@@ -28019,15 +30076,25 @@ var configValidators = {
28019
30076
  );
28020
30077
  return value;
28021
30078
  },
28022
- ["OCO_OLLAMA_API_URL" /* OCO_OLLAMA_API_URL */](value) {
30079
+ ["OCO_WHY" /* OCO_WHY */](value) {
28023
30080
  validateConfig(
28024
- "OCO_OLLAMA_API_URL" /* OCO_OLLAMA_API_URL */,
28025
- typeof value === "string" && value.startsWith("http"),
28026
- `${value} is not a valid URL. It should start with 'http://' or 'https://'.`
30081
+ "OCO_WHY" /* OCO_WHY */,
30082
+ typeof value === "boolean",
30083
+ "Must be true or false"
28027
30084
  );
28028
30085
  return value;
28029
30086
  }
28030
30087
  };
30088
+ var OCO_AI_PROVIDER_ENUM = /* @__PURE__ */ ((OCO_AI_PROVIDER_ENUM2) => {
30089
+ OCO_AI_PROVIDER_ENUM2["OLLAMA"] = "ollama";
30090
+ OCO_AI_PROVIDER_ENUM2["OPENAI"] = "openai";
30091
+ OCO_AI_PROVIDER_ENUM2["ANTHROPIC"] = "anthropic";
30092
+ OCO_AI_PROVIDER_ENUM2["GEMINI"] = "gemini";
30093
+ OCO_AI_PROVIDER_ENUM2["AZURE"] = "azure";
30094
+ OCO_AI_PROVIDER_ENUM2["TEST"] = "test";
30095
+ OCO_AI_PROVIDER_ENUM2["FLOWISE"] = "flowise";
30096
+ return OCO_AI_PROVIDER_ENUM2;
30097
+ })(OCO_AI_PROVIDER_ENUM || {});
28031
30098
  var defaultConfigPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
28032
30099
  var defaultEnvPath = (0, import_path.resolve)(process.cwd(), ".env");
28033
30100
  var DEFAULT_CONFIG = {
@@ -28050,7 +30117,7 @@ var initGlobalConfig = (configPath = defaultConfigPath) => {
28050
30117
  (0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(DEFAULT_CONFIG), "utf8");
28051
30118
  return DEFAULT_CONFIG;
28052
30119
  };
28053
- var parseEnvVarValue = (value) => {
30120
+ var parseConfigVarValue = (value) => {
28054
30121
  try {
28055
30122
  return JSON.parse(value);
28056
30123
  } catch (error) {
@@ -28061,32 +30128,32 @@ var getEnvConfig = (envPath) => {
28061
30128
  dotenv.config({ path: envPath });
28062
30129
  return {
28063
30130
  OCO_MODEL: process.env.OCO_MODEL,
28064
- OCO_OPENAI_API_KEY: process.env.OCO_OPENAI_API_KEY,
28065
- OCO_ANTHROPIC_API_KEY: process.env.OCO_ANTHROPIC_API_KEY,
28066
- OCO_AZURE_API_KEY: process.env.OCO_AZURE_API_KEY,
28067
- OCO_GEMINI_API_KEY: process.env.OCO_GEMINI_API_KEY,
28068
- OCO_FLOWISE_API_KEY: process.env.OCO_FLOWISE_API_KEY,
28069
- OCO_TOKENS_MAX_INPUT: parseEnvVarValue(process.env.OCO_TOKENS_MAX_INPUT),
28070
- OCO_TOKENS_MAX_OUTPUT: parseEnvVarValue(process.env.OCO_TOKENS_MAX_OUTPUT),
28071
- OCO_OPENAI_BASE_PATH: process.env.OCO_OPENAI_BASE_PATH,
28072
- OCO_GEMINI_BASE_PATH: process.env.OCO_GEMINI_BASE_PATH,
28073
- OCO_AZURE_ENDPOINT: process.env.OCO_AZURE_ENDPOINT,
28074
- OCO_FLOWISE_ENDPOINT: process.env.OCO_FLOWISE_ENDPOINT,
28075
- OCO_OLLAMA_API_URL: process.env.OCO_OLLAMA_API_URL,
28076
- OCO_DESCRIPTION: parseEnvVarValue(process.env.OCO_DESCRIPTION),
28077
- OCO_EMOJI: parseEnvVarValue(process.env.OCO_EMOJI),
30131
+ OCO_API_URL: process.env.OCO_API_URL,
30132
+ OCO_API_KEY: process.env.OCO_API_KEY,
30133
+ OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER,
30134
+ OCO_TOKENS_MAX_INPUT: parseConfigVarValue(process.env.OCO_TOKENS_MAX_INPUT),
30135
+ OCO_TOKENS_MAX_OUTPUT: parseConfigVarValue(
30136
+ process.env.OCO_TOKENS_MAX_OUTPUT
30137
+ ),
30138
+ OCO_DESCRIPTION: parseConfigVarValue(process.env.OCO_DESCRIPTION),
30139
+ OCO_EMOJI: parseConfigVarValue(process.env.OCO_EMOJI),
28078
30140
  OCO_LANGUAGE: process.env.OCO_LANGUAGE,
28079
30141
  OCO_MESSAGE_TEMPLATE_PLACEHOLDER: process.env.OCO_MESSAGE_TEMPLATE_PLACEHOLDER,
28080
30142
  OCO_PROMPT_MODULE: process.env.OCO_PROMPT_MODULE,
28081
- OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER,
28082
- OCO_ONE_LINE_COMMIT: parseEnvVarValue(process.env.OCO_ONE_LINE_COMMIT),
30143
+ OCO_ONE_LINE_COMMIT: parseConfigVarValue(process.env.OCO_ONE_LINE_COMMIT),
28083
30144
  OCO_TEST_MOCK_TYPE: process.env.OCO_TEST_MOCK_TYPE,
28084
- OCO_GITPUSH: parseEnvVarValue(process.env.OCO_GITPUSH)
30145
+ OCO_GITPUSH: parseConfigVarValue(process.env.OCO_GITPUSH)
28085
30146
  };
28086
30147
  };
28087
- var getGlobalConfig = (configPath) => {
30148
+ var setGlobalConfig = (config7, configPath = defaultConfigPath) => {
30149
+ (0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(config7), "utf8");
30150
+ };
30151
+ var getIsGlobalConfigFileExist = (configPath = defaultConfigPath) => {
30152
+ return (0, import_fs.existsSync)(configPath);
30153
+ };
30154
+ var getGlobalConfig = (configPath = defaultConfigPath) => {
28088
30155
  let globalConfig;
28089
- const isGlobalConfigFileExist = (0, import_fs.existsSync)(configPath);
30156
+ const isGlobalConfigFileExist = getIsGlobalConfigFileExist(configPath);
28090
30157
  if (!isGlobalConfigFileExist)
28091
30158
  globalConfig = initGlobalConfig(configPath);
28092
30159
  else {
@@ -28095,10 +30162,13 @@ var getGlobalConfig = (configPath) => {
28095
30162
  }
28096
30163
  return globalConfig;
28097
30164
  };
28098
- var mergeConfigs = (main, fallback) => Object.keys(CONFIG_KEYS).reduce((acc, key) => {
28099
- acc[key] = parseEnvVarValue(main[key] ?? fallback[key]);
28100
- return acc;
28101
- }, {});
30165
+ var mergeConfigs = (main, fallback) => {
30166
+ const allKeys = /* @__PURE__ */ new Set([...Object.keys(main), ...Object.keys(fallback)]);
30167
+ return Array.from(allKeys).reduce((acc, key) => {
30168
+ acc[key] = parseConfigVarValue(main[key] ?? fallback[key]);
30169
+ return acc;
30170
+ }, {});
30171
+ };
28102
30172
  var getConfig = ({
28103
30173
  envPath = defaultEnvPath,
28104
30174
  globalPath = defaultConfigPath
@@ -28112,6 +30182,7 @@ var setConfig = (keyValues, globalConfigPath = defaultConfigPath) => {
28112
30182
  const config7 = getConfig({
28113
30183
  globalPath: globalConfigPath
28114
30184
  });
30185
+ const configToSet = {};
28115
30186
  for (let [key, value] of keyValues) {
28116
30187
  if (!configValidators.hasOwnProperty(key)) {
28117
30188
  const supportedKeys = Object.keys(configValidators).join("\n");
@@ -28125,7 +30196,10 @@ For more help refer to our docs: https://github.com/di-sukharev/opencommit`
28125
30196
  }
28126
30197
  let parsedConfigValue;
28127
30198
  try {
28128
- parsedConfigValue = JSON.parse(value);
30199
+ if (typeof value === "string")
30200
+ parsedConfigValue = JSON.parse(value);
30201
+ else
30202
+ parsedConfigValue = value;
28129
30203
  } catch (error) {
28130
30204
  parsedConfigValue = value;
28131
30205
  }
@@ -28133,9 +30207,9 @@ For more help refer to our docs: https://github.com/di-sukharev/opencommit`
28133
30207
  parsedConfigValue,
28134
30208
  config7
28135
30209
  );
28136
- config7[key] = validValue;
30210
+ configToSet[key] = validValue;
28137
30211
  }
28138
- (0, import_fs.writeFileSync)(globalConfigPath, (0, import_ini.stringify)(config7), "utf8");
30212
+ setGlobalConfig(mergeConfigs(configToSet, config7), globalConfigPath);
28139
30213
  ce(`${source_default.green("\u2714")} config successfully set`);
28140
30214
  };
28141
30215
  var configCommand = G3(
@@ -37221,7 +39295,7 @@ var AzureEngine = class {
37221
39295
  };
37222
39296
 
37223
39297
  // src/engine/flowise.ts
37224
- var FlowiseAi = class {
39298
+ var FlowiseEngine = class {
37225
39299
  constructor(config7) {
37226
39300
  this.config = config7;
37227
39301
  this.client = axios_default.create({
@@ -38016,7 +40090,7 @@ var GoogleGenerativeAI = class {
38016
40090
  };
38017
40091
 
38018
40092
  // src/engine/gemini.ts
38019
- var Gemini = class {
40093
+ var GeminiEngine = class {
38020
40094
  constructor(config7) {
38021
40095
  this.client = new GoogleGenerativeAI(config7.apiKey);
38022
40096
  this.config = config7;
@@ -38074,7 +40148,7 @@ var Gemini = class {
38074
40148
  };
38075
40149
 
38076
40150
  // src/engine/ollama.ts
38077
- var OllamaAi = class {
40151
+ var OllamaEngine = class {
38078
40152
  constructor(config7) {
38079
40153
  this.config = config7;
38080
40154
  this.client = axios_default.create({
@@ -38090,7 +40164,10 @@ var OllamaAi = class {
38090
40164
  stream: false
38091
40165
  };
38092
40166
  try {
38093
- const response = await this.client.post("", params);
40167
+ const response = await this.client.post(
40168
+ this.client.getUri(this.config),
40169
+ params
40170
+ );
38094
40171
  const message = response.data.message;
38095
40172
  return message?.content;
38096
40173
  } catch (err) {
@@ -38121,7 +40198,7 @@ __export(error_exports2, {
38121
40198
  });
38122
40199
 
38123
40200
  // node_modules/openai/version.mjs
38124
- var VERSION4 = "4.56.0";
40201
+ var VERSION4 = "4.57.0";
38125
40202
 
38126
40203
  // node_modules/openai/_shims/registry.mjs
38127
40204
  var auto2 = false;
@@ -39414,6 +41491,9 @@ var ContentFilterFinishReasonError = class extends OpenAIError {
39414
41491
  }
39415
41492
  };
39416
41493
 
41494
+ // node_modules/openai/index.mjs
41495
+ var qs = __toESM(require_lib3(), 1);
41496
+
39417
41497
  // node_modules/openai/pagination.mjs
39418
41498
  var Page = class extends AbstractPage2 {
39419
41499
  constructor(client, response, body, options) {
@@ -41591,8 +43671,12 @@ var MessagesPage = class extends CursorPage {
41591
43671
 
41592
43672
  // node_modules/openai/resources/beta/threads/runs/steps.mjs
41593
43673
  var Steps = class extends APIResource2 {
41594
- retrieve(threadId, runId, stepId, options) {
43674
+ retrieve(threadId, runId, stepId, query = {}, options) {
43675
+ if (isRequestOptions(query)) {
43676
+ return this.retrieve(threadId, runId, stepId, {}, query);
43677
+ }
41595
43678
  return this._client.get(`/threads/${threadId}/runs/${runId}/steps/${stepId}`, {
43679
+ query,
41596
43680
  ...options,
41597
43681
  headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers }
41598
43682
  });
@@ -41620,12 +43704,14 @@ var Runs = class extends APIResource2 {
41620
43704
  super(...arguments);
41621
43705
  this.steps = new Steps(this._client);
41622
43706
  }
41623
- create(threadId, body, options) {
43707
+ create(threadId, params, options) {
43708
+ const { include, ...body } = params;
41624
43709
  return this._client.post(`/threads/${threadId}/runs`, {
43710
+ query: { include },
41625
43711
  body,
41626
43712
  ...options,
41627
43713
  headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers },
41628
- stream: body.stream ?? false
43714
+ stream: params.stream ?? false
41629
43715
  });
41630
43716
  }
41631
43717
  retrieve(threadId, runId, options) {
@@ -42313,6 +44399,9 @@ var OpenAI = class extends APIClient2 {
42313
44399
  authHeaders(opts) {
42314
44400
  return { Authorization: `Bearer ${this.apiKey}` };
42315
44401
  }
44402
+ stringifyQuery(query) {
44403
+ return qs.stringify(query, { arrayFormat: "brackets" });
44404
+ }
42316
44405
  };
42317
44406
  _a4 = OpenAI;
42318
44407
  OpenAI.OpenAI = _a4;
@@ -42394,44 +44483,24 @@ function getEngine() {
42394
44483
  model: config7.OCO_MODEL,
42395
44484
  maxTokensOutput: config7.OCO_TOKENS_MAX_OUTPUT,
42396
44485
  maxTokensInput: config7.OCO_TOKENS_MAX_INPUT,
42397
- baseURL: config7.OCO_OPENAI_BASE_PATH
44486
+ baseURL: config7.OCO_API_URL,
44487
+ apiKey: config7.OCO_API_KEY
42398
44488
  };
42399
44489
  switch (provider) {
42400
44490
  case "ollama" /* OLLAMA */:
42401
- return new OllamaAi({
42402
- ...DEFAULT_CONFIG2,
42403
- apiKey: "",
42404
- baseURL: config7.OCO_OLLAMA_API_URL
42405
- });
44491
+ return new OllamaEngine(DEFAULT_CONFIG2);
42406
44492
  case "anthropic" /* ANTHROPIC */:
42407
- return new AnthropicEngine({
42408
- ...DEFAULT_CONFIG2,
42409
- apiKey: config7.OCO_ANTHROPIC_API_KEY
42410
- });
44493
+ return new AnthropicEngine(DEFAULT_CONFIG2);
42411
44494
  case "test" /* TEST */:
42412
44495
  return new TestAi(config7.OCO_TEST_MOCK_TYPE);
42413
44496
  case "gemini" /* GEMINI */:
42414
- return new Gemini({
42415
- ...DEFAULT_CONFIG2,
42416
- apiKey: config7.OCO_GEMINI_API_KEY,
42417
- baseURL: config7.OCO_GEMINI_BASE_PATH
42418
- });
44497
+ return new GeminiEngine(DEFAULT_CONFIG2);
42419
44498
  case "azure" /* AZURE */:
42420
- return new AzureEngine({
42421
- ...DEFAULT_CONFIG2,
42422
- apiKey: config7.OCO_AZURE_API_KEY
42423
- });
44499
+ return new AzureEngine(DEFAULT_CONFIG2);
42424
44500
  case "flowise" /* FLOWISE */:
42425
- return new FlowiseAi({
42426
- ...DEFAULT_CONFIG2,
42427
- baseURL: config7.OCO_FLOWISE_ENDPOINT || DEFAULT_CONFIG2.baseURL,
42428
- apiKey: config7.OCO_FLOWISE_API_KEY
42429
- });
44501
+ return new FlowiseEngine(DEFAULT_CONFIG2);
42430
44502
  default:
42431
- return new OpenAiEngine({
42432
- ...DEFAULT_CONFIG2,
42433
- apiKey: config7.OCO_OPENAI_API_KEY
42434
- });
44503
+ return new OpenAiEngine(DEFAULT_CONFIG2);
42435
44504
  }
42436
44505
  }
42437
44506
 
@@ -42452,7 +44521,7 @@ var computeHash = async (content, algorithm = "sha256") => {
42452
44521
  };
42453
44522
 
42454
44523
  // src/modules/commitlint/prompts.ts
42455
- var import_types = __toESM(require_lib3(), 1);
44524
+ var import_types = __toESM(require_lib4(), 1);
42456
44525
  var config2 = getConfig();
42457
44526
  var translation = i18n[config2.OCO_LANGUAGE || "en"];
42458
44527
  var getTypeRuleExtraDescription = (type2, prompt) => prompt?.questions?.type?.enum?.[type2]?.description;
@@ -42915,8 +44984,8 @@ function mergeDiffs(arr, maxStringLength) {
42915
44984
 
42916
44985
  // src/generateCommitMessageFromGitDiff.ts
42917
44986
  var config5 = getConfig();
42918
- var MAX_TOKENS_INPUT = config5.OCO_TOKENS_MAX_INPUT || 40960 /* DEFAULT_MAX_TOKENS_INPUT */;
42919
- var MAX_TOKENS_OUTPUT = config5.OCO_TOKENS_MAX_OUTPUT || 4096 /* DEFAULT_MAX_TOKENS_OUTPUT */;
44987
+ var MAX_TOKENS_INPUT = config5.OCO_TOKENS_MAX_INPUT;
44988
+ var MAX_TOKENS_OUTPUT = config5.OCO_TOKENS_MAX_OUTPUT;
42920
44989
  var generateCommitMessageChatCompletionPrompt = async (diff, fullGitMojiSpec) => {
42921
44990
  const INIT_MESSAGES_PROMPT = await getMainCommitPrompt(fullGitMojiSpec);
42922
44991
  const chatContextAsCompletionRequest = [...INIT_MESSAGES_PROMPT];
@@ -43209,13 +45278,15 @@ ${source_default.grey("\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2
43209
45278
  );
43210
45279
  ce(stdout);
43211
45280
  const remotes = await getGitRemotes();
45281
+ if (config6.OCO_GITPUSH === false)
45282
+ return;
43212
45283
  if (!remotes.length) {
43213
45284
  const { stdout: stdout2 } = await execa("git", ["push"]);
43214
45285
  if (stdout2)
43215
45286
  ce(stdout2);
43216
45287
  process.exit(0);
43217
45288
  }
43218
- if (remotes.length === 1 && config6.OCO_GITPUSH !== true) {
45289
+ if (remotes.length === 1) {
43219
45290
  const isPushConfirmedByUser = await Q3({
43220
45291
  message: "Do you want to run `git push`?"
43221
45292
  });
@@ -43248,13 +45319,13 @@ ${source_default.grey("\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2
43248
45319
  const pushSpinner = le();
43249
45320
  pushSpinner.start(`Running 'git push ${selectedRemote}'`);
43250
45321
  const { stdout: stdout2 } = await execa("git", ["push", selectedRemote]);
45322
+ if (stdout2)
45323
+ ce(stdout2);
43251
45324
  pushSpinner.stop(
43252
45325
  `${source_default.green(
43253
45326
  "\u2714"
43254
- )} Successfully pushed all commits to ${selectedRemote}`
45327
+ )} successfully pushed all commits to ${selectedRemote}`
43255
45328
  );
43256
- if (stdout2)
43257
- ce(stdout2);
43258
45329
  }
43259
45330
  } else {
43260
45331
  const regenerateMessage = await Q3({
@@ -43482,10 +45553,11 @@ var prepareCommitMessageHook = async (isStageAllFlag = false) => {
43482
45553
  return;
43483
45554
  ae("opencommit");
43484
45555
  const config7 = getConfig();
43485
- if (!config7.OCO_OPENAI_API_KEY && !config7.OCO_ANTHROPIC_API_KEY && !config7.OCO_AZURE_API_KEY) {
43486
- throw new Error(
43487
- "No OPEN_AI_API or OCO_ANTHROPIC_API_KEY or OCO_AZURE_API_KEY exists. Set your key in ~/.opencommit"
45556
+ if (!config7.OCO_API_KEY) {
45557
+ ce(
45558
+ "No OCO_API_KEY is set. Set your key via `oco config set OCO_API_KEY=<value>. For more info see https://github.com/di-sukharev/opencommit"
43488
45559
  );
45560
+ return;
43489
45561
  }
43490
45562
  const spin = le();
43491
45563
  spin.start("Generating commit message");
@@ -43534,6 +45606,152 @@ Current version: ${currentVersion}. Latest version: ${latestVersion}.
43534
45606
  }
43535
45607
  };
43536
45608
 
45609
+ // src/migrations/_run.ts
45610
+ var import_fs5 = __toESM(require("fs"), 1);
45611
+ var import_os2 = require("os");
45612
+ var import_path5 = require("path");
45613
+
45614
+ // src/migrations/00_use_single_api_key_and_url.ts
45615
+ function use_single_api_key_and_url_default() {
45616
+ const config7 = getConfig({ setDefaultValues: false });
45617
+ const aiProvider = config7.OCO_AI_PROVIDER;
45618
+ let apiKey;
45619
+ let apiUrl;
45620
+ if (aiProvider === "ollama" /* OLLAMA */) {
45621
+ apiKey = config7["OCO_OLLAMA_API_KEY"];
45622
+ apiUrl = config7["OCO_OLLAMA_API_URL"];
45623
+ } else if (aiProvider === "anthropic" /* ANTHROPIC */) {
45624
+ apiKey = config7["OCO_ANTHROPIC_API_KEY"];
45625
+ apiUrl = config7["OCO_ANTHROPIC_BASE_PATH"];
45626
+ } else if (aiProvider === "openai" /* OPENAI */) {
45627
+ apiKey = config7["OCO_OPENAI_API_KEY"];
45628
+ apiUrl = config7["OCO_OPENAI_BASE_PATH"];
45629
+ } else if (aiProvider === "azure" /* AZURE */) {
45630
+ apiKey = config7["OCO_AZURE_API_KEY"];
45631
+ apiUrl = config7["OCO_AZURE_ENDPOINT"];
45632
+ } else if (aiProvider === "gemini" /* GEMINI */) {
45633
+ apiKey = config7["OCO_GEMINI_API_KEY"];
45634
+ apiUrl = config7["OCO_GEMINI_BASE_PATH"];
45635
+ } else if (aiProvider === "flowise" /* FLOWISE */) {
45636
+ apiKey = config7["OCO_FLOWISE_API_KEY"];
45637
+ apiUrl = config7["OCO_FLOWISE_ENDPOINT"];
45638
+ } else {
45639
+ throw new Error(
45640
+ `Migration failed, set AI provider first. Run "oco config set OCO_AI_PROVIDER=<provider>", where <provider> is one of: ${Object.values(
45641
+ OCO_AI_PROVIDER_ENUM
45642
+ ).join(", ")}`
45643
+ );
45644
+ }
45645
+ if (apiKey)
45646
+ setConfig([["OCO_API_KEY" /* OCO_API_KEY */, apiKey]]);
45647
+ if (apiUrl)
45648
+ setConfig([["OCO_API_URL" /* OCO_API_URL */, apiUrl]]);
45649
+ }
45650
+
45651
+ // src/migrations/01_remove_obsolete_config_keys_from_global_file.ts
45652
+ function remove_obsolete_config_keys_from_global_file_default() {
45653
+ const obsoleteKeys = [
45654
+ "OCO_OLLAMA_API_KEY",
45655
+ "OCO_OLLAMA_API_URL",
45656
+ "OCO_ANTHROPIC_API_KEY",
45657
+ "OCO_ANTHROPIC_BASE_PATH",
45658
+ "OCO_OPENAI_API_KEY",
45659
+ "OCO_OPENAI_BASE_PATH",
45660
+ "OCO_AZURE_API_KEY",
45661
+ "OCO_AZURE_ENDPOINT",
45662
+ "OCO_GEMINI_API_KEY",
45663
+ "OCO_GEMINI_BASE_PATH",
45664
+ "OCO_FLOWISE_API_KEY",
45665
+ "OCO_FLOWISE_ENDPOINT"
45666
+ ];
45667
+ const globalConfig = getGlobalConfig();
45668
+ const configToOverride = { ...globalConfig };
45669
+ for (const key of obsoleteKeys)
45670
+ delete configToOverride[key];
45671
+ setGlobalConfig(configToOverride);
45672
+ }
45673
+
45674
+ // src/migrations/02_set_missing_default_values.ts
45675
+ function set_missing_default_values_default() {
45676
+ const setDefaultConfigValues = (config7) => {
45677
+ const entriesToSet = [];
45678
+ for (const entry of Object.entries(DEFAULT_CONFIG)) {
45679
+ const [key, _value] = entry;
45680
+ if (config7[key] === "undefined")
45681
+ entriesToSet.push(entry);
45682
+ }
45683
+ if (entriesToSet.length > 0)
45684
+ setConfig(entriesToSet);
45685
+ };
45686
+ setDefaultConfigValues(getGlobalConfig());
45687
+ }
45688
+
45689
+ // src/migrations/_migrations.ts
45690
+ var migrations = [
45691
+ {
45692
+ name: "00_use_single_api_key_and_url",
45693
+ run: use_single_api_key_and_url_default
45694
+ },
45695
+ {
45696
+ name: "01_remove_obsolete_config_keys_from_global_file",
45697
+ run: remove_obsolete_config_keys_from_global_file_default
45698
+ },
45699
+ {
45700
+ name: "02_set_missing_default_values",
45701
+ run: set_missing_default_values_default
45702
+ }
45703
+ ];
45704
+
45705
+ // src/migrations/_run.ts
45706
+ var migrationsFile = (0, import_path5.join)((0, import_os2.homedir)(), ".opencommit_migrations");
45707
+ var getCompletedMigrations = () => {
45708
+ if (!import_fs5.default.existsSync(migrationsFile)) {
45709
+ return [];
45710
+ }
45711
+ const data = import_fs5.default.readFileSync(migrationsFile, "utf-8");
45712
+ return data ? JSON.parse(data) : [];
45713
+ };
45714
+ var saveCompletedMigration = (migrationName) => {
45715
+ const completedMigrations = getCompletedMigrations();
45716
+ completedMigrations.push(migrationName);
45717
+ import_fs5.default.writeFileSync(
45718
+ migrationsFile,
45719
+ JSON.stringify(completedMigrations, null, 2)
45720
+ );
45721
+ };
45722
+ var runMigrations = async () => {
45723
+ if (!getIsGlobalConfigFileExist())
45724
+ return;
45725
+ const config7 = getConfig();
45726
+ if (config7.OCO_AI_PROVIDER === "test" /* TEST */)
45727
+ return;
45728
+ const completedMigrations = getCompletedMigrations();
45729
+ let isMigrated = false;
45730
+ for (const migration of migrations) {
45731
+ if (!completedMigrations.includes(migration.name)) {
45732
+ try {
45733
+ console.log("Applying migration", migration.name);
45734
+ migration.run();
45735
+ console.log("Migration applied successfully", migration.name);
45736
+ saveCompletedMigration(migration.name);
45737
+ } catch (error) {
45738
+ ce(
45739
+ `${source_default.red("Failed to apply migration")} ${migration.name}: ${error}`
45740
+ );
45741
+ }
45742
+ isMigrated = true;
45743
+ }
45744
+ }
45745
+ if (isMigrated) {
45746
+ ce(
45747
+ `${source_default.green(
45748
+ "\u2714"
45749
+ )} Migrations to your config were applied successfully. Please rerun.`
45750
+ );
45751
+ process.exit(0);
45752
+ }
45753
+ };
45754
+
43537
45755
  // src/cli.ts
43538
45756
  var extraArgs = process.argv.slice(2);
43539
45757
  Z2(
@@ -43554,6 +45772,7 @@ Z2(
43554
45772
  help: { description: package_default.description }
43555
45773
  },
43556
45774
  async ({ flags }) => {
45775
+ await runMigrations();
43557
45776
  await checkIsLatestVersion();
43558
45777
  if (await isHookCalled()) {
43559
45778
  prepareCommitMessageHook();