switchroom 0.18.12 → 0.18.13

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 (49) hide show
  1. package/dist/agent-scheduler/index.js +8 -0
  2. package/dist/auth-broker/index.js +63 -65
  3. package/dist/cli/ms-365-write-pretool.mjs +31 -8
  4. package/dist/cli/notion-write-pretool.mjs +9 -1
  5. package/dist/cli/skill-validate-pretool.mjs +144 -2847
  6. package/dist/cli/switchroom.js +952 -3126
  7. package/dist/host-control/main.js +216 -2862
  8. package/dist/vault/approvals/kernel-server.js +67 -0
  9. package/dist/vault/broker/server.js +98 -44
  10. package/package.json +1 -1
  11. package/telegram-plugin/dist/bridge/bridge.js +49 -3
  12. package/telegram-plugin/dist/gateway/gateway.js +656 -2326
  13. package/telegram-plugin/dist/server.js +65 -3
  14. package/telegram-plugin/format.ts +19 -0
  15. package/telegram-plugin/gateway/approval-hold.ts +21 -2
  16. package/telegram-plugin/gateway/callback-query-handlers.ts +12 -0
  17. package/telegram-plugin/gateway/gateway.ts +221 -73
  18. package/telegram-plugin/history.ts +51 -0
  19. package/telegram-plugin/inline-keyboard-callbacks.ts +94 -0
  20. package/telegram-plugin/model-unavailable.ts +41 -11
  21. package/telegram-plugin/outbound-field-redact.ts +69 -0
  22. package/telegram-plugin/render/render.ts +32 -14
  23. package/telegram-plugin/scoped-approval.ts +11 -2
  24. package/telegram-plugin/secret-detect/chunker.ts +18 -4
  25. package/telegram-plugin/secret-detect/index.ts +12 -56
  26. package/telegram-plugin/send-gate-degraded.test.ts +131 -0
  27. package/telegram-plugin/send-gate.test.ts +25 -6
  28. package/telegram-plugin/send-gate.ts +82 -8
  29. package/telegram-plugin/session-tail.ts +82 -7
  30. package/telegram-plugin/subagent-watcher.ts +71 -16
  31. package/telegram-plugin/tests/approval-hold-outcome.test.ts +36 -5
  32. package/telegram-plugin/tests/callback-query-handlers.test.ts +65 -0
  33. package/telegram-plugin/tests/gateway-outbound-redact.test.ts +57 -0
  34. package/telegram-plugin/tests/history.test.ts +115 -0
  35. package/telegram-plugin/tests/inbound-message-types.test.ts +5 -1
  36. package/telegram-plugin/tests/inline-keyboard-callbacks.test.ts +164 -0
  37. package/telegram-plugin/tests/operator-events-session-tail.test.ts +74 -0
  38. package/telegram-plugin/tests/outbound-field-redact.test.ts +107 -0
  39. package/telegram-plugin/tests/reaction-gate-routing.test.ts +173 -0
  40. package/telegram-plugin/tests/render/render.test.ts +88 -0
  41. package/telegram-plugin/tests/scoped-approval.test.ts +27 -0
  42. package/telegram-plugin/tests/secret-detect-chunk-overlap.test.ts +65 -0
  43. package/telegram-plugin/tests/secret-detect-oauth-code.test.ts +5 -4
  44. package/telegram-plugin/tests/session-tail-sidecar-reap.test.ts +268 -0
  45. package/telegram-plugin/tests/subagent-watcher-fd-leak.test.ts +275 -0
  46. package/telegram-plugin/tests/worktree-watch-cwds.test.ts +215 -1
  47. package/telegram-plugin/worktree-watch-cwds.ts +194 -5
  48. package/telegram-plugin/secret-detect/secretlint-source.ts +0 -95
  49. package/telegram-plugin/tests/secret-detect-secretlint.test.ts +0 -105
@@ -7010,6 +7010,13 @@ var require_dist = __commonJS((exports) => {
7010
7010
  exports.visitAsync = visit.visitAsync;
7011
7011
  });
7012
7012
 
7013
+ // src/util/atomic.ts
7014
+ import { closeSync, constants, fsyncSync, openSync, renameSync as renameSync2, rmSync, writeSync } from "node:fs";
7015
+ var TMP_OPEN_FLAGS;
7016
+ var init_atomic = __esm(() => {
7017
+ TMP_OPEN_FLAGS = constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | (constants.O_NOFOLLOW ?? 0);
7018
+ });
7019
+
7013
7020
  // node_modules/.bun/handlebars@4.7.9/node_modules/handlebars/dist/cjs/handlebars/utils.js
7014
7021
  var require_utils = __commonJS((exports) => {
7015
7022
  exports.__esModule = true;
@@ -8373,7 +8380,7 @@ var require_parser2 = __commonJS((exports, module) => {
8373
8380
  throw new Error(str);
8374
8381
  },
8375
8382
  parse: function parse(input) {
8376
- var self2 = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
8383
+ var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
8377
8384
  this.lexer.setInput(input);
8378
8385
  this.lexer.yy = this.yy;
8379
8386
  this.yy.lexer = this.lexer;
@@ -8392,9 +8399,9 @@ var require_parser2 = __commonJS((exports, module) => {
8392
8399
  }
8393
8400
  function lex() {
8394
8401
  var token;
8395
- token = self2.lexer.lex() || 1;
8402
+ token = self.lexer.lex() || 1;
8396
8403
  if (typeof token !== "number") {
8397
- token = self2.symbols_[token] || token;
8404
+ token = self.symbols_[token] || token;
8398
8405
  }
8399
8406
  return token;
8400
8407
  }
@@ -12420,2864 +12427,154 @@ var require_printer = __commonJS((exports) => {
12420
12427
  var _visitor2 = _interopRequireDefault(_visitor);
12421
12428
  function print(ast) {
12422
12429
  return new PrintVisitor().accept(ast);
12423
- }
12424
- function PrintVisitor() {
12425
- this.padding = 0;
12426
- }
12427
- PrintVisitor.prototype = new _visitor2["default"];
12428
- PrintVisitor.prototype.pad = function(string) {
12429
- var out = "";
12430
- for (var i = 0, l = this.padding;i < l; i++) {
12431
- out += " ";
12432
- }
12433
- out += string + `
12434
- `;
12435
- return out;
12436
- };
12437
- PrintVisitor.prototype.Program = function(program) {
12438
- var out = "", body = program.body, i = undefined, l = undefined;
12439
- if (program.blockParams) {
12440
- var blockParams = "BLOCK PARAMS: [";
12441
- for (i = 0, l = program.blockParams.length;i < l; i++) {
12442
- blockParams += " " + program.blockParams[i];
12443
- }
12444
- blockParams += " ]";
12445
- out += this.pad(blockParams);
12446
- }
12447
- for (i = 0, l = body.length;i < l; i++) {
12448
- out += this.accept(body[i]);
12449
- }
12450
- this.padding--;
12451
- return out;
12452
- };
12453
- PrintVisitor.prototype.MustacheStatement = function(mustache) {
12454
- return this.pad("{{ " + this.SubExpression(mustache) + " }}");
12455
- };
12456
- PrintVisitor.prototype.Decorator = function(mustache) {
12457
- return this.pad("{{ DIRECTIVE " + this.SubExpression(mustache) + " }}");
12458
- };
12459
- PrintVisitor.prototype.BlockStatement = PrintVisitor.prototype.DecoratorBlock = function(block) {
12460
- var out = "";
12461
- out += this.pad((block.type === "DecoratorBlock" ? "DIRECTIVE " : "") + "BLOCK:");
12462
- this.padding++;
12463
- out += this.pad(this.SubExpression(block));
12464
- if (block.program) {
12465
- out += this.pad("PROGRAM:");
12466
- this.padding++;
12467
- out += this.accept(block.program);
12468
- this.padding--;
12469
- }
12470
- if (block.inverse) {
12471
- if (block.program) {
12472
- this.padding++;
12473
- }
12474
- out += this.pad("{{^}}");
12475
- this.padding++;
12476
- out += this.accept(block.inverse);
12477
- this.padding--;
12478
- if (block.program) {
12479
- this.padding--;
12480
- }
12481
- }
12482
- this.padding--;
12483
- return out;
12484
- };
12485
- PrintVisitor.prototype.PartialStatement = function(partial) {
12486
- var content = "PARTIAL:" + partial.name.original;
12487
- if (partial.params[0]) {
12488
- content += " " + this.accept(partial.params[0]);
12489
- }
12490
- if (partial.hash) {
12491
- content += " " + this.accept(partial.hash);
12492
- }
12493
- return this.pad("{{> " + content + " }}");
12494
- };
12495
- PrintVisitor.prototype.PartialBlockStatement = function(partial) {
12496
- var content = "PARTIAL BLOCK:" + partial.name.original;
12497
- if (partial.params[0]) {
12498
- content += " " + this.accept(partial.params[0]);
12499
- }
12500
- if (partial.hash) {
12501
- content += " " + this.accept(partial.hash);
12502
- }
12503
- content += " " + this.pad("PROGRAM:");
12504
- this.padding++;
12505
- content += this.accept(partial.program);
12506
- this.padding--;
12507
- return this.pad("{{> " + content + " }}");
12508
- };
12509
- PrintVisitor.prototype.ContentStatement = function(content) {
12510
- return this.pad("CONTENT[ '" + content.value + "' ]");
12511
- };
12512
- PrintVisitor.prototype.CommentStatement = function(comment) {
12513
- return this.pad("{{! '" + comment.value + "' }}");
12514
- };
12515
- PrintVisitor.prototype.SubExpression = function(sexpr) {
12516
- var params = sexpr.params, paramStrings = [], hash = undefined;
12517
- for (var i = 0, l = params.length;i < l; i++) {
12518
- paramStrings.push(this.accept(params[i]));
12519
- }
12520
- params = "[" + paramStrings.join(", ") + "]";
12521
- hash = sexpr.hash ? " " + this.accept(sexpr.hash) : "";
12522
- return this.accept(sexpr.path) + " " + params + hash;
12523
- };
12524
- PrintVisitor.prototype.PathExpression = function(id) {
12525
- var path = id.parts.join("/");
12526
- return (id.data ? "@" : "") + "PATH:" + path;
12527
- };
12528
- PrintVisitor.prototype.StringLiteral = function(string) {
12529
- return '"' + string.value + '"';
12530
- };
12531
- PrintVisitor.prototype.NumberLiteral = function(number) {
12532
- return "NUMBER{" + number.value + "}";
12533
- };
12534
- PrintVisitor.prototype.BooleanLiteral = function(bool) {
12535
- return "BOOLEAN{" + bool.value + "}";
12536
- };
12537
- PrintVisitor.prototype.UndefinedLiteral = function() {
12538
- return "UNDEFINED";
12539
- };
12540
- PrintVisitor.prototype.NullLiteral = function() {
12541
- return "NULL";
12542
- };
12543
- PrintVisitor.prototype.Hash = function(hash) {
12544
- var pairs = hash.pairs, joinedPairs = [];
12545
- for (var i = 0, l = pairs.length;i < l; i++) {
12546
- joinedPairs.push(this.accept(pairs[i]));
12547
- }
12548
- return "HASH{" + joinedPairs.join(", ") + "}";
12549
- };
12550
- PrintVisitor.prototype.HashPair = function(pair) {
12551
- return pair.key + "=" + this.accept(pair.value);
12552
- };
12553
- });
12554
-
12555
- // node_modules/.bun/handlebars@4.7.9/node_modules/handlebars/lib/index.js
12556
- var require_lib = __commonJS((exports, module) => {
12557
- var handlebars = require_handlebars()["default"];
12558
- var printer = require_printer();
12559
- handlebars.PrintVisitor = printer.PrintVisitor;
12560
- handlebars.print = printer.print;
12561
- module.exports = handlebars;
12562
- function extension(module2, filename) {
12563
- var fs = __require("fs");
12564
- var templateString = fs.readFileSync(filename, "utf8");
12565
- module2.exports = handlebars.compile(templateString);
12566
- }
12567
- if (__require.extensions) {
12568
- __require.extensions[".handlebars"] = extension;
12569
- __require.extensions[".hbs"] = extension;
12570
- }
12571
- });
12572
-
12573
- // telegram-plugin/secret-detect/suppressor.ts
12574
- function isSuppressed(text, start, end) {
12575
- const left = Math.max(0, start - WINDOW);
12576
- const right = Math.min(text.length, end + WINDOW);
12577
- const context = text.slice(left, start) + text.slice(end, right);
12578
- return MARKER_RE.test(context);
12579
- }
12580
- var MARKERS, WINDOW = 40, MARKER_RE;
12581
- var init_suppressor = __esm(() => {
12582
- MARKERS = ["test", "mock", "example", "fixture", "dummy"];
12583
- MARKER_RE = new RegExp(`\\b(?:${MARKERS.join("|")})\\b`, "i");
12584
- });
12585
-
12586
- // telegram-plugin/secret-detect/slug.ts
12587
- function sanitizeKeyName(raw) {
12588
- const up = raw.toUpperCase();
12589
- const cleaned = up.replace(/[^A-Z0-9_]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
12590
- return cleaned.length > 0 ? cleaned : "SECRET";
12591
- }
12592
- function datePart(now = new Date) {
12593
- const y = now.getUTCFullYear();
12594
- const m = String(now.getUTCMonth() + 1).padStart(2, "0");
12595
- const d = String(now.getUTCDate()).padStart(2, "0");
12596
- return `${y}${m}${d}`;
12597
- }
12598
- function deriveSlug(inputs, existing) {
12599
- let base;
12600
- if (inputs.key_name && inputs.key_name.trim().length > 0) {
12601
- base = sanitizeKeyName(inputs.key_name);
12602
- } else {
12603
- base = `${inputs.rule_id}_${datePart(inputs.now)}`;
12604
- }
12605
- if (!existing.has(base))
12606
- return base;
12607
- let n = 2;
12608
- while (existing.has(`${base}_${n}`))
12609
- n++;
12610
- return `${base}_${n}`;
12611
- }
12612
-
12613
- // node_modules/.bun/boundary@2.0.0/node_modules/boundary/lib/index.js
12614
- var require_lib2 = __commonJS((exports2) => {
12615
- Object.defineProperty(exports2, "__esModule", { value: true });
12616
- exports2.binarySearch = exports2.upperBound = exports2.lowerBound = exports2.compare = undefined;
12617
- function compare(v1, v2) {
12618
- return v1 < v2;
12619
- }
12620
- exports2.compare = compare;
12621
- function upperBound(array, value, comp = compare) {
12622
- let len = array.length;
12623
- let i = 0;
12624
- while (len) {
12625
- let diff = len >>> 1;
12626
- let cursor = i + diff;
12627
- if (comp(value, array[cursor])) {
12628
- len = diff;
12629
- } else {
12630
- i = cursor + 1;
12631
- len -= diff + 1;
12632
- }
12633
- }
12634
- return i;
12635
- }
12636
- exports2.upperBound = upperBound;
12637
- function lowerBound(array, value, comp = compare) {
12638
- let len = array.length;
12639
- let i = 0;
12640
- while (len) {
12641
- let diff = len >>> 1;
12642
- let cursor = i + diff;
12643
- if (comp(array[cursor], value)) {
12644
- i = cursor + 1;
12645
- len -= diff + 1;
12646
- } else {
12647
- len = diff;
12648
- }
12649
- }
12650
- return i;
12651
- }
12652
- exports2.lowerBound = lowerBound;
12653
- function binarySearch(array, value, comp = compare) {
12654
- let cursor = lowerBound(array, value, comp);
12655
- return cursor !== array.length && !comp(value, array[cursor]);
12656
- }
12657
- exports2.binarySearch = binarySearch;
12658
- });
12659
-
12660
- // node_modules/.bun/structured-source@4.0.0/node_modules/structured-source/lib/structured-source.js
12661
- var require_structured_source = __commonJS((exports2) => {
12662
- Object.defineProperty(exports2, "__esModule", { value: true });
12663
- exports2.StructuredSource = undefined;
12664
- var boundary_1 = require_lib2();
12665
-
12666
- class StructuredSource {
12667
- constructor(source) {
12668
- this.indice = [0];
12669
- let regexp = /[\r\n\u2028\u2029]/g;
12670
- const length = source.length;
12671
- regexp.lastIndex = 0;
12672
- while (true) {
12673
- let result = regexp.exec(source);
12674
- if (!result) {
12675
- break;
12676
- }
12677
- let index = result.index;
12678
- if (source.charCodeAt(index) === 13 && source.charCodeAt(index + 1) === 10) {
12679
- index += 1;
12680
- }
12681
- let nextIndex = index + 1;
12682
- if (length < nextIndex) {
12683
- break;
12684
- }
12685
- this.indice.push(nextIndex);
12686
- regexp.lastIndex = nextIndex;
12687
- }
12688
- }
12689
- get line() {
12690
- return this.indice.length;
12691
- }
12692
- locationToRange(loc) {
12693
- return [this.positionToIndex(loc.start), this.positionToIndex(loc.end)];
12694
- }
12695
- rangeToLocation(range) {
12696
- return {
12697
- start: this.indexToPosition(range[0]),
12698
- end: this.indexToPosition(range[1])
12699
- };
12700
- }
12701
- positionToIndex(pos) {
12702
- let start = this.indice[pos.line - 1];
12703
- return start + pos.column;
12704
- }
12705
- indexToPosition(index) {
12706
- const startLine = (0, boundary_1.upperBound)(this.indice, index);
12707
- return {
12708
- line: startLine,
12709
- column: index - this.indice[startLine - 1]
12710
- };
12711
- }
12712
- }
12713
- exports2.StructuredSource = StructuredSource;
12714
- });
12715
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/SecretLintSourceCodeImpl.js
12716
- var import_structured_source;
12717
- var init_SecretLintSourceCodeImpl = __esm(() => {
12718
- import_structured_source = __toESM(require_structured_source(), 1);
12719
- });
12720
-
12721
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/helper/promise-event-emitter.js
12722
- class EventEmitter {
12723
- #listeners = new Map;
12724
- on(type, listener) {
12725
- const prevSet = this.#listeners.get(type);
12726
- const listenerSet = prevSet ?? new Set;
12727
- listenerSet?.add(listener);
12728
- this.#listeners.set(type, listenerSet);
12729
- }
12730
- emit(type, ...args) {
12731
- const listenerSet = this.#listeners.get(type);
12732
- if (!listenerSet) {
12733
- return;
12734
- }
12735
- for (const listenerSetElement of listenerSet) {
12736
- listenerSetElement(...args);
12737
- }
12738
- }
12739
- off(type, listener) {
12740
- const listenerSet = this.#listeners.get(type);
12741
- if (!listenerSet) {
12742
- return;
12743
- }
12744
- for (const listenerSetElement of listenerSet) {
12745
- if (listenerSetElement === listener) {
12746
- listenerSet.delete(listener);
12747
- }
12748
- }
12749
- }
12750
- removeAllListeners() {
12751
- this.#listeners.clear();
12752
- }
12753
- listenerCount(type) {
12754
- return this.#listeners.get(type)?.size ?? 0;
12755
- }
12756
- listeners(type) {
12757
- return Array.from(this.#listeners.get(type) ?? []);
12758
- }
12759
- }
12760
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/RuleContext.js
12761
- var init_RuleContext = () => {};
12762
- // node_modules/.bun/@secretlint+profiler@12.2.0/node_modules/@secretlint/profiler/module/index.js
12763
- class SecretLintProfiler {
12764
- perf;
12765
- entries = [];
12766
- measures = [];
12767
- executionPromises = [];
12768
- constructor(options) {
12769
- this.perf = options.perf;
12770
- const pattern = /(.*?)::end(\|\|.*)?/;
12771
- const observer = new options.PerformanceObserver((items) => {
12772
- const entries = items.getEntries();
12773
- entries.forEach((entry) => {
12774
- if (entry.entryType === "mark") {
12775
- const match = entry.name.match(pattern);
12776
- const endIdentifier = match ? match[1] : undefined;
12777
- const suffix = match && match[2] ? match[2] : "";
12778
- if (endIdentifier) {
12779
- const startIdentifier = `${endIdentifier}::start`;
12780
- this.entries.find((savedEntry) => {
12781
- return savedEntry.name === startIdentifier;
12782
- });
12783
- if (startIdentifier) {
12784
- this.executionPromises.push(Promise.resolve().then(() => {
12785
- this.perf.measure(endIdentifier + suffix, `${endIdentifier}::start${suffix}`, `${endIdentifier}::end${suffix}`);
12786
- }));
12787
- }
12788
- }
12789
- this.entries.push(entry);
12790
- } else if (entry.entryType === "measure") {
12791
- this.measures.push(entry);
12792
- }
12793
- });
12794
- });
12795
- observer.observe({ entryTypes: ["mark", "measure"] });
12796
- }
12797
- mark(marker) {
12798
- if ("id" in marker) {
12799
- this.perf.mark(`${marker.type}||${marker.id}`);
12800
- } else {
12801
- this.perf.mark(marker.type);
12802
- }
12803
- }
12804
- waifForExecutionPromises = () => {
12805
- return Promise.all(this.executionPromises).finally(() => {
12806
- this.executionPromises.length = 0;
12807
- });
12808
- };
12809
- async getEntries() {
12810
- await this.waifForExecutionPromises();
12811
- return this.entries;
12812
- }
12813
- async getMeasures() {
12814
- await this.waifForExecutionPromises();
12815
- return this.measures;
12816
- }
12817
- }
12818
-
12819
- // node_modules/.bun/@secretlint+profiler@12.2.0/node_modules/@secretlint/profiler/module/node.js
12820
- import perf_hooks from "node:perf_hooks";
12821
-
12822
- class NullPerformanceObserver {
12823
- disconnect() {}
12824
- observe(_options) {}
12825
- }
12826
- var secretLintProfiler;
12827
- var init_node = __esm(() => {
12828
- secretLintProfiler = new SecretLintProfiler({
12829
- perf: perf_hooks.performance,
12830
- PerformanceObserver: perf_hooks.PerformanceObserver ? perf_hooks.PerformanceObserver : NullPerformanceObserver
12831
- });
12832
- });
12833
-
12834
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/RunningEvents.js
12835
- var init_RunningEvents = __esm(() => {
12836
- init_node();
12837
- });
12838
-
12839
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/RulePresetContext.js
12840
- var init_RulePresetContext = __esm(() => {
12841
- init_RuleContext();
12842
- });
12843
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/messages/index.js
12844
- var init_messages = () => {};
12845
-
12846
- // node_modules/.bun/ms@2.1.3/node_modules/ms/index.js
12847
- var require_ms = __commonJS((exports2, module) => {
12848
- var s = 1000;
12849
- var m = s * 60;
12850
- var h = m * 60;
12851
- var d = h * 24;
12852
- var w = d * 7;
12853
- var y = d * 365.25;
12854
- module.exports = function(val, options) {
12855
- options = options || {};
12856
- var type = typeof val;
12857
- if (type === "string" && val.length > 0) {
12858
- return parse(val);
12859
- } else if (type === "number" && isFinite(val)) {
12860
- return options.long ? fmtLong(val) : fmtShort(val);
12861
- }
12862
- throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
12863
- };
12864
- function parse(str) {
12865
- str = String(str);
12866
- if (str.length > 100) {
12867
- return;
12868
- }
12869
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
12870
- if (!match) {
12871
- return;
12872
- }
12873
- var n = parseFloat(match[1]);
12874
- var type = (match[2] || "ms").toLowerCase();
12875
- switch (type) {
12876
- case "years":
12877
- case "year":
12878
- case "yrs":
12879
- case "yr":
12880
- case "y":
12881
- return n * y;
12882
- case "weeks":
12883
- case "week":
12884
- case "w":
12885
- return n * w;
12886
- case "days":
12887
- case "day":
12888
- case "d":
12889
- return n * d;
12890
- case "hours":
12891
- case "hour":
12892
- case "hrs":
12893
- case "hr":
12894
- case "h":
12895
- return n * h;
12896
- case "minutes":
12897
- case "minute":
12898
- case "mins":
12899
- case "min":
12900
- case "m":
12901
- return n * m;
12902
- case "seconds":
12903
- case "second":
12904
- case "secs":
12905
- case "sec":
12906
- case "s":
12907
- return n * s;
12908
- case "milliseconds":
12909
- case "millisecond":
12910
- case "msecs":
12911
- case "msec":
12912
- case "ms":
12913
- return n;
12914
- default:
12915
- return;
12916
- }
12917
- }
12918
- function fmtShort(ms) {
12919
- var msAbs = Math.abs(ms);
12920
- if (msAbs >= d) {
12921
- return Math.round(ms / d) + "d";
12922
- }
12923
- if (msAbs >= h) {
12924
- return Math.round(ms / h) + "h";
12925
- }
12926
- if (msAbs >= m) {
12927
- return Math.round(ms / m) + "m";
12928
- }
12929
- if (msAbs >= s) {
12930
- return Math.round(ms / s) + "s";
12931
- }
12932
- return ms + "ms";
12933
- }
12934
- function fmtLong(ms) {
12935
- var msAbs = Math.abs(ms);
12936
- if (msAbs >= d) {
12937
- return plural(ms, msAbs, d, "day");
12938
- }
12939
- if (msAbs >= h) {
12940
- return plural(ms, msAbs, h, "hour");
12941
- }
12942
- if (msAbs >= m) {
12943
- return plural(ms, msAbs, m, "minute");
12944
- }
12945
- if (msAbs >= s) {
12946
- return plural(ms, msAbs, s, "second");
12947
- }
12948
- return ms + " ms";
12949
- }
12950
- function plural(ms, msAbs, n, name) {
12951
- var isPlural = msAbs >= n * 1.5;
12952
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
12953
- }
12954
- });
12955
-
12956
- // node_modules/.bun/debug@4.4.3/node_modules/debug/src/common.js
12957
- var require_common = __commonJS((exports2, module) => {
12958
- function setup(env) {
12959
- createDebug.debug = createDebug;
12960
- createDebug.default = createDebug;
12961
- createDebug.coerce = coerce2;
12962
- createDebug.disable = disable;
12963
- createDebug.enable = enable;
12964
- createDebug.enabled = enabled;
12965
- createDebug.humanize = require_ms();
12966
- createDebug.destroy = destroy;
12967
- Object.keys(env).forEach((key) => {
12968
- createDebug[key] = env[key];
12969
- });
12970
- createDebug.names = [];
12971
- createDebug.skips = [];
12972
- createDebug.formatters = {};
12973
- function selectColor(namespace) {
12974
- let hash = 0;
12975
- for (let i = 0;i < namespace.length; i++) {
12976
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
12977
- hash |= 0;
12978
- }
12979
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
12980
- }
12981
- createDebug.selectColor = selectColor;
12982
- function createDebug(namespace) {
12983
- let prevTime;
12984
- let enableOverride = null;
12985
- let namespacesCache;
12986
- let enabledCache;
12987
- function debug(...args) {
12988
- if (!debug.enabled) {
12989
- return;
12990
- }
12991
- const self2 = debug;
12992
- const curr = Number(new Date);
12993
- const ms = curr - (prevTime || curr);
12994
- self2.diff = ms;
12995
- self2.prev = prevTime;
12996
- self2.curr = curr;
12997
- prevTime = curr;
12998
- args[0] = createDebug.coerce(args[0]);
12999
- if (typeof args[0] !== "string") {
13000
- args.unshift("%O");
13001
- }
13002
- let index = 0;
13003
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
13004
- if (match === "%%") {
13005
- return "%";
13006
- }
13007
- index++;
13008
- const formatter = createDebug.formatters[format];
13009
- if (typeof formatter === "function") {
13010
- const val = args[index];
13011
- match = formatter.call(self2, val);
13012
- args.splice(index, 1);
13013
- index--;
13014
- }
13015
- return match;
13016
- });
13017
- createDebug.formatArgs.call(self2, args);
13018
- const logFn = self2.log || createDebug.log;
13019
- logFn.apply(self2, args);
13020
- }
13021
- debug.namespace = namespace;
13022
- debug.useColors = createDebug.useColors();
13023
- debug.color = createDebug.selectColor(namespace);
13024
- debug.extend = extend;
13025
- debug.destroy = createDebug.destroy;
13026
- Object.defineProperty(debug, "enabled", {
13027
- enumerable: true,
13028
- configurable: false,
13029
- get: () => {
13030
- if (enableOverride !== null) {
13031
- return enableOverride;
13032
- }
13033
- if (namespacesCache !== createDebug.namespaces) {
13034
- namespacesCache = createDebug.namespaces;
13035
- enabledCache = createDebug.enabled(namespace);
13036
- }
13037
- return enabledCache;
13038
- },
13039
- set: (v) => {
13040
- enableOverride = v;
13041
- }
13042
- });
13043
- if (typeof createDebug.init === "function") {
13044
- createDebug.init(debug);
13045
- }
13046
- return debug;
13047
- }
13048
- function extend(namespace, delimiter) {
13049
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
13050
- newDebug.log = this.log;
13051
- return newDebug;
13052
- }
13053
- function enable(namespaces) {
13054
- createDebug.save(namespaces);
13055
- createDebug.namespaces = namespaces;
13056
- createDebug.names = [];
13057
- createDebug.skips = [];
13058
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
13059
- for (const ns of split) {
13060
- if (ns[0] === "-") {
13061
- createDebug.skips.push(ns.slice(1));
13062
- } else {
13063
- createDebug.names.push(ns);
13064
- }
13065
- }
13066
- }
13067
- function matchesTemplate(search, template) {
13068
- let searchIndex = 0;
13069
- let templateIndex = 0;
13070
- let starIndex = -1;
13071
- let matchIndex = 0;
13072
- while (searchIndex < search.length) {
13073
- if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
13074
- if (template[templateIndex] === "*") {
13075
- starIndex = templateIndex;
13076
- matchIndex = searchIndex;
13077
- templateIndex++;
13078
- } else {
13079
- searchIndex++;
13080
- templateIndex++;
13081
- }
13082
- } else if (starIndex !== -1) {
13083
- templateIndex = starIndex + 1;
13084
- matchIndex++;
13085
- searchIndex = matchIndex;
13086
- } else {
13087
- return false;
13088
- }
13089
- }
13090
- while (templateIndex < template.length && template[templateIndex] === "*") {
13091
- templateIndex++;
13092
- }
13093
- return templateIndex === template.length;
13094
- }
13095
- function disable() {
13096
- const namespaces = [
13097
- ...createDebug.names,
13098
- ...createDebug.skips.map((namespace) => "-" + namespace)
13099
- ].join(",");
13100
- createDebug.enable("");
13101
- return namespaces;
13102
- }
13103
- function enabled(name) {
13104
- for (const skip of createDebug.skips) {
13105
- if (matchesTemplate(name, skip)) {
13106
- return false;
13107
- }
13108
- }
13109
- for (const ns of createDebug.names) {
13110
- if (matchesTemplate(name, ns)) {
13111
- return true;
13112
- }
13113
- }
13114
- return false;
13115
- }
13116
- function coerce2(val) {
13117
- if (val instanceof Error) {
13118
- return val.stack || val.message;
13119
- }
13120
- return val;
13121
- }
13122
- function destroy() {
13123
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
13124
- }
13125
- createDebug.enable(createDebug.load());
13126
- return createDebug;
13127
- }
13128
- module.exports = setup;
13129
- });
13130
-
13131
- // node_modules/.bun/debug@4.4.3/node_modules/debug/src/browser.js
13132
- var require_browser = __commonJS((exports2, module) => {
13133
- exports2.formatArgs = formatArgs;
13134
- exports2.save = save;
13135
- exports2.load = load;
13136
- exports2.useColors = useColors;
13137
- exports2.storage = localstorage();
13138
- exports2.destroy = (() => {
13139
- let warned = false;
13140
- return () => {
13141
- if (!warned) {
13142
- warned = true;
13143
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
13144
- }
13145
- };
13146
- })();
13147
- exports2.colors = [
13148
- "#0000CC",
13149
- "#0000FF",
13150
- "#0033CC",
13151
- "#0033FF",
13152
- "#0066CC",
13153
- "#0066FF",
13154
- "#0099CC",
13155
- "#0099FF",
13156
- "#00CC00",
13157
- "#00CC33",
13158
- "#00CC66",
13159
- "#00CC99",
13160
- "#00CCCC",
13161
- "#00CCFF",
13162
- "#3300CC",
13163
- "#3300FF",
13164
- "#3333CC",
13165
- "#3333FF",
13166
- "#3366CC",
13167
- "#3366FF",
13168
- "#3399CC",
13169
- "#3399FF",
13170
- "#33CC00",
13171
- "#33CC33",
13172
- "#33CC66",
13173
- "#33CC99",
13174
- "#33CCCC",
13175
- "#33CCFF",
13176
- "#6600CC",
13177
- "#6600FF",
13178
- "#6633CC",
13179
- "#6633FF",
13180
- "#66CC00",
13181
- "#66CC33",
13182
- "#9900CC",
13183
- "#9900FF",
13184
- "#9933CC",
13185
- "#9933FF",
13186
- "#99CC00",
13187
- "#99CC33",
13188
- "#CC0000",
13189
- "#CC0033",
13190
- "#CC0066",
13191
- "#CC0099",
13192
- "#CC00CC",
13193
- "#CC00FF",
13194
- "#CC3300",
13195
- "#CC3333",
13196
- "#CC3366",
13197
- "#CC3399",
13198
- "#CC33CC",
13199
- "#CC33FF",
13200
- "#CC6600",
13201
- "#CC6633",
13202
- "#CC9900",
13203
- "#CC9933",
13204
- "#CCCC00",
13205
- "#CCCC33",
13206
- "#FF0000",
13207
- "#FF0033",
13208
- "#FF0066",
13209
- "#FF0099",
13210
- "#FF00CC",
13211
- "#FF00FF",
13212
- "#FF3300",
13213
- "#FF3333",
13214
- "#FF3366",
13215
- "#FF3399",
13216
- "#FF33CC",
13217
- "#FF33FF",
13218
- "#FF6600",
13219
- "#FF6633",
13220
- "#FF9900",
13221
- "#FF9933",
13222
- "#FFCC00",
13223
- "#FFCC33"
13224
- ];
13225
- function useColors() {
13226
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
13227
- return true;
13228
- }
13229
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
13230
- return false;
13231
- }
13232
- let m;
13233
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
13234
- }
13235
- function formatArgs(args) {
13236
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
13237
- if (!this.useColors) {
13238
- return;
13239
- }
13240
- const c = "color: " + this.color;
13241
- args.splice(1, 0, c, "color: inherit");
13242
- let index = 0;
13243
- let lastC = 0;
13244
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
13245
- if (match === "%%") {
13246
- return;
13247
- }
13248
- index++;
13249
- if (match === "%c") {
13250
- lastC = index;
13251
- }
13252
- });
13253
- args.splice(lastC, 0, c);
13254
- }
13255
- exports2.log = console.debug || console.log || (() => {});
13256
- function save(namespaces) {
13257
- try {
13258
- if (namespaces) {
13259
- exports2.storage.setItem("debug", namespaces);
13260
- } else {
13261
- exports2.storage.removeItem("debug");
13262
- }
13263
- } catch (error) {}
13264
- }
13265
- function load() {
13266
- let r;
13267
- try {
13268
- r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
13269
- } catch (error) {}
13270
- if (!r && typeof process !== "undefined" && "env" in process) {
13271
- r = process.env.DEBUG;
13272
- }
13273
- return r;
13274
- }
13275
- function localstorage() {
13276
- try {
13277
- return localStorage;
13278
- } catch (error) {}
13279
- }
13280
- module.exports = require_common()(exports2);
13281
- var { formatters } = module.exports;
13282
- formatters.j = function(v) {
13283
- try {
13284
- return JSON.stringify(v);
13285
- } catch (error) {
13286
- return "[UnexpectedJSONParseError]: " + error.message;
13287
- }
13288
- };
13289
- });
13290
-
13291
- // node_modules/.bun/has-flag@4.0.0/node_modules/has-flag/index.js
13292
- var require_has_flag = __commonJS((exports2, module) => {
13293
- module.exports = (flag, argv = process.argv) => {
13294
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
13295
- const position = argv.indexOf(prefix + flag);
13296
- const terminatorPosition = argv.indexOf("--");
13297
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
13298
- };
13299
- });
13300
-
13301
- // node_modules/.bun/supports-color@7.2.0/node_modules/supports-color/index.js
13302
- var require_supports_color = __commonJS((exports2, module) => {
13303
- var os = __require("os");
13304
- var tty = __require("tty");
13305
- var hasFlag = require_has_flag();
13306
- var { env } = process;
13307
- var forceColor;
13308
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
13309
- forceColor = 0;
13310
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
13311
- forceColor = 1;
13312
- }
13313
- if ("FORCE_COLOR" in env) {
13314
- if (env.FORCE_COLOR === "true") {
13315
- forceColor = 1;
13316
- } else if (env.FORCE_COLOR === "false") {
13317
- forceColor = 0;
13318
- } else {
13319
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
13320
- }
13321
- }
13322
- function translateLevel(level) {
13323
- if (level === 0) {
13324
- return false;
13325
- }
13326
- return {
13327
- level,
13328
- hasBasic: true,
13329
- has256: level >= 2,
13330
- has16m: level >= 3
13331
- };
13332
- }
13333
- function supportsColor(haveStream, streamIsTTY) {
13334
- if (forceColor === 0) {
13335
- return 0;
13336
- }
13337
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
13338
- return 3;
13339
- }
13340
- if (hasFlag("color=256")) {
13341
- return 2;
13342
- }
13343
- if (haveStream && !streamIsTTY && forceColor === undefined) {
13344
- return 0;
13345
- }
13346
- const min = forceColor || 0;
13347
- if (env.TERM === "dumb") {
13348
- return min;
13349
- }
13350
- if (process.platform === "win32") {
13351
- const osRelease = os.release().split(".");
13352
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
13353
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
13354
- }
13355
- return 1;
13356
- }
13357
- if ("CI" in env) {
13358
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => (sign in env)) || env.CI_NAME === "codeship") {
13359
- return 1;
13360
- }
13361
- return min;
13362
- }
13363
- if ("TEAMCITY_VERSION" in env) {
13364
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
13365
- }
13366
- if (env.COLORTERM === "truecolor") {
13367
- return 3;
13368
- }
13369
- if ("TERM_PROGRAM" in env) {
13370
- const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
13371
- switch (env.TERM_PROGRAM) {
13372
- case "iTerm.app":
13373
- return version2 >= 3 ? 3 : 2;
13374
- case "Apple_Terminal":
13375
- return 2;
13376
- }
13377
- }
13378
- if (/-256(color)?$/i.test(env.TERM)) {
13379
- return 2;
13380
- }
13381
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
13382
- return 1;
13383
- }
13384
- if ("COLORTERM" in env) {
13385
- return 1;
13386
- }
13387
- return min;
13388
- }
13389
- function getSupportLevel(stream) {
13390
- const level = supportsColor(stream, stream && stream.isTTY);
13391
- return translateLevel(level);
13392
- }
13393
- module.exports = {
13394
- supportsColor: getSupportLevel,
13395
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
13396
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
13397
- };
13398
- });
13399
-
13400
- // node_modules/.bun/debug@4.4.3/node_modules/debug/src/node.js
13401
- var require_node = __commonJS((exports2, module) => {
13402
- var tty = __require("tty");
13403
- var util3 = __require("util");
13404
- exports2.init = init;
13405
- exports2.log = log;
13406
- exports2.formatArgs = formatArgs;
13407
- exports2.save = save;
13408
- exports2.load = load;
13409
- exports2.useColors = useColors;
13410
- exports2.destroy = util3.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
13411
- exports2.colors = [6, 2, 3, 4, 5, 1];
13412
- try {
13413
- const supportsColor = require_supports_color();
13414
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
13415
- exports2.colors = [
13416
- 20,
13417
- 21,
13418
- 26,
13419
- 27,
13420
- 32,
13421
- 33,
13422
- 38,
13423
- 39,
13424
- 40,
13425
- 41,
13426
- 42,
13427
- 43,
13428
- 44,
13429
- 45,
13430
- 56,
13431
- 57,
13432
- 62,
13433
- 63,
13434
- 68,
13435
- 69,
13436
- 74,
13437
- 75,
13438
- 76,
13439
- 77,
13440
- 78,
13441
- 79,
13442
- 80,
13443
- 81,
13444
- 92,
13445
- 93,
13446
- 98,
13447
- 99,
13448
- 112,
13449
- 113,
13450
- 128,
13451
- 129,
13452
- 134,
13453
- 135,
13454
- 148,
13455
- 149,
13456
- 160,
13457
- 161,
13458
- 162,
13459
- 163,
13460
- 164,
13461
- 165,
13462
- 166,
13463
- 167,
13464
- 168,
13465
- 169,
13466
- 170,
13467
- 171,
13468
- 172,
13469
- 173,
13470
- 178,
13471
- 179,
13472
- 184,
13473
- 185,
13474
- 196,
13475
- 197,
13476
- 198,
13477
- 199,
13478
- 200,
13479
- 201,
13480
- 202,
13481
- 203,
13482
- 204,
13483
- 205,
13484
- 206,
13485
- 207,
13486
- 208,
13487
- 209,
13488
- 214,
13489
- 215,
13490
- 220,
13491
- 221
13492
- ];
13493
- }
13494
- } catch (error) {}
13495
- exports2.inspectOpts = Object.keys(process.env).filter((key) => {
13496
- return /^debug_/i.test(key);
13497
- }).reduce((obj, key) => {
13498
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
13499
- return k.toUpperCase();
13500
- });
13501
- let val = process.env[key];
13502
- if (/^(yes|on|true|enabled)$/i.test(val)) {
13503
- val = true;
13504
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
13505
- val = false;
13506
- } else if (val === "null") {
13507
- val = null;
13508
- } else {
13509
- val = Number(val);
13510
- }
13511
- obj[prop] = val;
13512
- return obj;
13513
- }, {});
13514
- function useColors() {
13515
- return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
13516
- }
13517
- function formatArgs(args) {
13518
- const { namespace: name, useColors: useColors2 } = this;
13519
- if (useColors2) {
13520
- const c = this.color;
13521
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
13522
- const prefix = ` ${colorCode};1m${name} \x1B[0m`;
13523
- args[0] = prefix + args[0].split(`
13524
- `).join(`
13525
- ` + prefix);
13526
- args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
13527
- } else {
13528
- args[0] = getDate() + name + " " + args[0];
13529
- }
13530
- }
13531
- function getDate() {
13532
- if (exports2.inspectOpts.hideDate) {
13533
- return "";
13534
- }
13535
- return new Date().toISOString() + " ";
13536
- }
13537
- function log(...args) {
13538
- return process.stderr.write(util3.formatWithOptions(exports2.inspectOpts, ...args) + `
13539
- `);
13540
- }
13541
- function save(namespaces) {
13542
- if (namespaces) {
13543
- process.env.DEBUG = namespaces;
13544
- } else {
13545
- delete process.env.DEBUG;
13546
- }
13547
- }
13548
- function load() {
13549
- return process.env.DEBUG;
13550
- }
13551
- function init(debug) {
13552
- debug.inspectOpts = {};
13553
- const keys = Object.keys(exports2.inspectOpts);
13554
- for (let i = 0;i < keys.length; i++) {
13555
- debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
13556
- }
13557
- }
13558
- module.exports = require_common()(exports2);
13559
- var { formatters } = module.exports;
13560
- formatters.o = function(v) {
13561
- this.inspectOpts.colors = this.useColors;
13562
- return util3.inspect(v, this.inspectOpts).split(`
13563
- `).map((str) => str.trim()).join(" ");
13564
- };
13565
- formatters.O = function(v) {
13566
- this.inspectOpts.colors = this.useColors;
13567
- return util3.inspect(v, this.inspectOpts);
13568
- };
13569
- });
13570
-
13571
- // node_modules/.bun/debug@4.4.3/node_modules/debug/src/index.js
13572
- var require_src = __commonJS((exports2, module) => {
13573
- if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) {
13574
- module.exports = require_browser();
13575
- } else {
13576
- module.exports = require_node();
13577
- }
13578
- });
13579
-
13580
- // node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/index.js
13581
- var import_debug, debug;
13582
- var init_module = __esm(() => {
13583
- init_SecretLintSourceCodeImpl();
13584
- init_RuleContext();
13585
- init_RunningEvents();
13586
- init_node();
13587
- init_RulePresetContext();
13588
- init_messages();
13589
- import_debug = __toESM(require_src(), 1);
13590
- debug = import_debug.default("@secretlint/core");
13591
- });
13592
-
13593
- // node_modules/.bun/@secretlint+secretlint-rule-preset-recommend@12.2.0/node_modules/@secretlint/secretlint-rule-preset-recommend/module/index.js
13594
- function requireLodash_uniq() {
13595
- if (hasRequiredLodash_uniq)
13596
- return lodash_uniq;
13597
- hasRequiredLodash_uniq = 1;
13598
- var LARGE_ARRAY_SIZE = 200;
13599
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
13600
- var INFINITY = 1 / 0;
13601
- var funcTag = "[object Function]", genTag = "[object GeneratorFunction]";
13602
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
13603
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
13604
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
13605
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
13606
- var root = freeGlobal || freeSelf || Function("return this")();
13607
- function arrayIncludes(array, value) {
13608
- var length = array ? array.length : 0;
13609
- return !!length && baseIndexOf(array, value, 0) > -1;
13610
- }
13611
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
13612
- var length = array.length, index = fromIndex + -1;
13613
- while (++index < length) {
13614
- if (predicate(array[index], index, array)) {
13615
- return index;
13616
- }
13617
- }
13618
- return -1;
13619
- }
13620
- function baseIndexOf(array, value, fromIndex) {
13621
- if (value !== value) {
13622
- return baseFindIndex(array, baseIsNaN, fromIndex);
13623
- }
13624
- var index = fromIndex - 1, length = array.length;
13625
- while (++index < length) {
13626
- if (array[index] === value) {
13627
- return index;
13628
- }
13629
- }
13630
- return -1;
13631
- }
13632
- function baseIsNaN(value) {
13633
- return value !== value;
13634
- }
13635
- function cacheHas(cache, key) {
13636
- return cache.has(key);
13637
- }
13638
- function getValue(object, key) {
13639
- return object == null ? undefined : object[key];
13640
- }
13641
- function isHostObject(value) {
13642
- var result = false;
13643
- if (value != null && typeof value.toString != "function") {
13644
- try {
13645
- result = !!(value + "");
13646
- } catch (e) {}
13647
- }
13648
- return result;
13649
- }
13650
- function setToArray(set) {
13651
- var index = -1, result = Array(set.size);
13652
- set.forEach(function(value) {
13653
- result[++index] = value;
13654
- });
13655
- return result;
13656
- }
13657
- var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
13658
- var coreJsData = root["__core-js_shared__"];
13659
- var maskSrcKey = function() {
13660
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
13661
- return uid ? "Symbol(src)_1." + uid : "";
13662
- }();
13663
- var funcToString = funcProto.toString;
13664
- var hasOwnProperty = objectProto.hasOwnProperty;
13665
- var objectToString = objectProto.toString;
13666
- var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
13667
- var splice = arrayProto.splice;
13668
- var Map2 = getNative(root, "Map"), Set2 = getNative(root, "Set"), nativeCreate = getNative(Object, "create");
13669
- function Hash(entries) {
13670
- var index = -1, length = entries ? entries.length : 0;
13671
- this.clear();
13672
- while (++index < length) {
13673
- var entry = entries[index];
13674
- this.set(entry[0], entry[1]);
13675
- }
13676
- }
13677
- function hashClear() {
13678
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
13679
- }
13680
- function hashDelete(key) {
13681
- return this.has(key) && delete this.__data__[key];
13682
- }
13683
- function hashGet(key) {
13684
- var data = this.__data__;
13685
- if (nativeCreate) {
13686
- var result = data[key];
13687
- return result === HASH_UNDEFINED ? undefined : result;
13688
- }
13689
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
13690
- }
13691
- function hashHas(key) {
13692
- var data = this.__data__;
13693
- return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
13694
- }
13695
- function hashSet(key, value) {
13696
- var data = this.__data__;
13697
- data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
13698
- return this;
13699
- }
13700
- Hash.prototype.clear = hashClear;
13701
- Hash.prototype["delete"] = hashDelete;
13702
- Hash.prototype.get = hashGet;
13703
- Hash.prototype.has = hashHas;
13704
- Hash.prototype.set = hashSet;
13705
- function ListCache(entries) {
13706
- var index = -1, length = entries ? entries.length : 0;
13707
- this.clear();
13708
- while (++index < length) {
13709
- var entry = entries[index];
13710
- this.set(entry[0], entry[1]);
13711
- }
13712
- }
13713
- function listCacheClear() {
13714
- this.__data__ = [];
13715
- }
13716
- function listCacheDelete(key) {
13717
- var data = this.__data__, index = assocIndexOf(data, key);
13718
- if (index < 0) {
13719
- return false;
13720
- }
13721
- var lastIndex = data.length - 1;
13722
- if (index == lastIndex) {
13723
- data.pop();
13724
- } else {
13725
- splice.call(data, index, 1);
13726
- }
13727
- return true;
13728
- }
13729
- function listCacheGet(key) {
13730
- var data = this.__data__, index = assocIndexOf(data, key);
13731
- return index < 0 ? undefined : data[index][1];
13732
- }
13733
- function listCacheHas(key) {
13734
- return assocIndexOf(this.__data__, key) > -1;
13735
- }
13736
- function listCacheSet(key, value) {
13737
- var data = this.__data__, index = assocIndexOf(data, key);
13738
- if (index < 0) {
13739
- data.push([key, value]);
13740
- } else {
13741
- data[index][1] = value;
13742
- }
13743
- return this;
13744
- }
13745
- ListCache.prototype.clear = listCacheClear;
13746
- ListCache.prototype["delete"] = listCacheDelete;
13747
- ListCache.prototype.get = listCacheGet;
13748
- ListCache.prototype.has = listCacheHas;
13749
- ListCache.prototype.set = listCacheSet;
13750
- function MapCache(entries) {
13751
- var index = -1, length = entries ? entries.length : 0;
13752
- this.clear();
13753
- while (++index < length) {
13754
- var entry = entries[index];
13755
- this.set(entry[0], entry[1]);
13756
- }
13757
- }
13758
- function mapCacheClear() {
13759
- this.__data__ = {
13760
- hash: new Hash,
13761
- map: new (Map2 || ListCache),
13762
- string: new Hash
13763
- };
13764
- }
13765
- function mapCacheDelete(key) {
13766
- return getMapData(this, key)["delete"](key);
13767
- }
13768
- function mapCacheGet(key) {
13769
- return getMapData(this, key).get(key);
13770
- }
13771
- function mapCacheHas(key) {
13772
- return getMapData(this, key).has(key);
13773
- }
13774
- function mapCacheSet(key, value) {
13775
- getMapData(this, key).set(key, value);
13776
- return this;
13777
- }
13778
- MapCache.prototype.clear = mapCacheClear;
13779
- MapCache.prototype["delete"] = mapCacheDelete;
13780
- MapCache.prototype.get = mapCacheGet;
13781
- MapCache.prototype.has = mapCacheHas;
13782
- MapCache.prototype.set = mapCacheSet;
13783
- function SetCache(values) {
13784
- var index = -1, length = values ? values.length : 0;
13785
- this.__data__ = new MapCache;
13786
- while (++index < length) {
13787
- this.add(values[index]);
13788
- }
13789
- }
13790
- function setCacheAdd(value) {
13791
- this.__data__.set(value, HASH_UNDEFINED);
13792
- return this;
13793
- }
13794
- function setCacheHas(value) {
13795
- return this.__data__.has(value);
13796
- }
13797
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
13798
- SetCache.prototype.has = setCacheHas;
13799
- function assocIndexOf(array, key) {
13800
- var length = array.length;
13801
- while (length--) {
13802
- if (eq(array[length][0], key)) {
13803
- return length;
13804
- }
13805
- }
13806
- return -1;
13807
- }
13808
- function baseIsNative(value) {
13809
- if (!isObject2(value) || isMasked(value)) {
13810
- return false;
13811
- }
13812
- var pattern = isFunction2(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
13813
- return pattern.test(toSource(value));
13814
- }
13815
- function baseUniq(array, iteratee, comparator) {
13816
- var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
13817
- if (length >= LARGE_ARRAY_SIZE) {
13818
- var set = createSet(array);
13819
- if (set) {
13820
- return setToArray(set);
13821
- }
13822
- isCommon = false;
13823
- includes2 = cacheHas;
13824
- seen = new SetCache;
13825
- } else {
13826
- seen = result;
13827
- }
13828
- outer:
13829
- while (++index < length) {
13830
- var value = array[index], computed = value;
13831
- value = value !== 0 ? value : 0;
13832
- if (isCommon && computed === computed) {
13833
- var seenIndex = seen.length;
13834
- while (seenIndex--) {
13835
- if (seen[seenIndex] === computed) {
13836
- continue outer;
13837
- }
13838
- }
13839
- result.push(value);
13840
- } else if (!includes2(seen, computed, comparator)) {
13841
- if (seen !== result) {
13842
- seen.push(computed);
13843
- }
13844
- result.push(value);
13845
- }
13846
- }
13847
- return result;
13848
- }
13849
- var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values) {
13850
- return new Set2(values);
13851
- };
13852
- function getMapData(map, key) {
13853
- var data = map.__data__;
13854
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
13855
- }
13856
- function getNative(object, key) {
13857
- var value = getValue(object, key);
13858
- return baseIsNative(value) ? value : undefined;
13859
- }
13860
- function isKeyable(value) {
13861
- var type = typeof value;
13862
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
13863
- }
13864
- function isMasked(func) {
13865
- return !!maskSrcKey && maskSrcKey in func;
13866
- }
13867
- function toSource(func) {
13868
- if (func != null) {
13869
- try {
13870
- return funcToString.call(func);
13871
- } catch (e) {}
13872
- try {
13873
- return func + "";
13874
- } catch (e) {}
13875
- }
13876
- return "";
13877
- }
13878
- function uniq(array) {
13879
- return array && array.length ? baseUniq(array) : [];
13880
- }
13881
- function eq(value, other) {
13882
- return value === other || value !== value && other !== other;
13883
- }
13884
- function isFunction2(value) {
13885
- var tag = isObject2(value) ? objectToString.call(value) : "";
13886
- return tag == funcTag || tag == genTag;
13887
- }
13888
- function isObject2(value) {
13889
- var type = typeof value;
13890
- return !!value && (type == "object" || type == "function");
13891
- }
13892
- function noop() {}
13893
- lodash_uniq = uniq;
13894
- return lodash_uniq;
13895
- }
13896
- function requireLodash_uniqwith() {
13897
- if (hasRequiredLodash_uniqwith)
13898
- return lodash_uniqwith;
13899
- hasRequiredLodash_uniqwith = 1;
13900
- var LARGE_ARRAY_SIZE = 200;
13901
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
13902
- var INFINITY = 1 / 0;
13903
- var funcTag = "[object Function]", genTag = "[object GeneratorFunction]";
13904
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
13905
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
13906
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
13907
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
13908
- var root = freeGlobal || freeSelf || Function("return this")();
13909
- function arrayIncludes(array, value) {
13910
- var length = array ? array.length : 0;
13911
- return !!length && baseIndexOf(array, value, 0) > -1;
13912
- }
13913
- function arrayIncludesWith(array, value, comparator) {
13914
- var index = -1, length = array ? array.length : 0;
13915
- while (++index < length) {
13916
- if (comparator(value, array[index])) {
13917
- return true;
13918
- }
13919
- }
13920
- return false;
13921
- }
13922
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
13923
- var length = array.length, index = fromIndex + -1;
13924
- while (++index < length) {
13925
- if (predicate(array[index], index, array)) {
13926
- return index;
13927
- }
13928
- }
13929
- return -1;
13930
- }
13931
- function baseIndexOf(array, value, fromIndex) {
13932
- if (value !== value) {
13933
- return baseFindIndex(array, baseIsNaN, fromIndex);
13934
- }
13935
- var index = fromIndex - 1, length = array.length;
13936
- while (++index < length) {
13937
- if (array[index] === value) {
13938
- return index;
13939
- }
13940
- }
13941
- return -1;
13942
- }
13943
- function baseIsNaN(value) {
13944
- return value !== value;
13945
- }
13946
- function cacheHas(cache, key) {
13947
- return cache.has(key);
13948
- }
13949
- function getValue(object, key) {
13950
- return object == null ? undefined : object[key];
13951
- }
13952
- function isHostObject(value) {
13953
- var result = false;
13954
- if (value != null && typeof value.toString != "function") {
13955
- try {
13956
- result = !!(value + "");
13957
- } catch (e) {}
13958
- }
13959
- return result;
13960
- }
13961
- function setToArray(set) {
13962
- var index = -1, result = Array(set.size);
13963
- set.forEach(function(value) {
13964
- result[++index] = value;
13965
- });
13966
- return result;
13967
- }
13968
- var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
13969
- var coreJsData = root["__core-js_shared__"];
13970
- var maskSrcKey = function() {
13971
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
13972
- return uid ? "Symbol(src)_1." + uid : "";
13973
- }();
13974
- var funcToString = funcProto.toString;
13975
- var hasOwnProperty = objectProto.hasOwnProperty;
13976
- var objectToString = objectProto.toString;
13977
- var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
13978
- var splice = arrayProto.splice;
13979
- var Map2 = getNative(root, "Map"), Set2 = getNative(root, "Set"), nativeCreate = getNative(Object, "create");
13980
- function Hash(entries) {
13981
- var index = -1, length = entries ? entries.length : 0;
13982
- this.clear();
13983
- while (++index < length) {
13984
- var entry = entries[index];
13985
- this.set(entry[0], entry[1]);
13986
- }
13987
- }
13988
- function hashClear() {
13989
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
13990
- }
13991
- function hashDelete(key) {
13992
- return this.has(key) && delete this.__data__[key];
13993
- }
13994
- function hashGet(key) {
13995
- var data = this.__data__;
13996
- if (nativeCreate) {
13997
- var result = data[key];
13998
- return result === HASH_UNDEFINED ? undefined : result;
13999
- }
14000
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
14001
- }
14002
- function hashHas(key) {
14003
- var data = this.__data__;
14004
- return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
14005
- }
14006
- function hashSet(key, value) {
14007
- var data = this.__data__;
14008
- data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
14009
- return this;
14010
- }
14011
- Hash.prototype.clear = hashClear;
14012
- Hash.prototype["delete"] = hashDelete;
14013
- Hash.prototype.get = hashGet;
14014
- Hash.prototype.has = hashHas;
14015
- Hash.prototype.set = hashSet;
14016
- function ListCache(entries) {
14017
- var index = -1, length = entries ? entries.length : 0;
14018
- this.clear();
14019
- while (++index < length) {
14020
- var entry = entries[index];
14021
- this.set(entry[0], entry[1]);
14022
- }
14023
- }
14024
- function listCacheClear() {
14025
- this.__data__ = [];
14026
- }
14027
- function listCacheDelete(key) {
14028
- var data = this.__data__, index = assocIndexOf(data, key);
14029
- if (index < 0) {
14030
- return false;
14031
- }
14032
- var lastIndex = data.length - 1;
14033
- if (index == lastIndex) {
14034
- data.pop();
14035
- } else {
14036
- splice.call(data, index, 1);
14037
- }
14038
- return true;
14039
- }
14040
- function listCacheGet(key) {
14041
- var data = this.__data__, index = assocIndexOf(data, key);
14042
- return index < 0 ? undefined : data[index][1];
14043
- }
14044
- function listCacheHas(key) {
14045
- return assocIndexOf(this.__data__, key) > -1;
14046
- }
14047
- function listCacheSet(key, value) {
14048
- var data = this.__data__, index = assocIndexOf(data, key);
14049
- if (index < 0) {
14050
- data.push([key, value]);
14051
- } else {
14052
- data[index][1] = value;
14053
- }
14054
- return this;
14055
- }
14056
- ListCache.prototype.clear = listCacheClear;
14057
- ListCache.prototype["delete"] = listCacheDelete;
14058
- ListCache.prototype.get = listCacheGet;
14059
- ListCache.prototype.has = listCacheHas;
14060
- ListCache.prototype.set = listCacheSet;
14061
- function MapCache(entries) {
14062
- var index = -1, length = entries ? entries.length : 0;
14063
- this.clear();
14064
- while (++index < length) {
14065
- var entry = entries[index];
14066
- this.set(entry[0], entry[1]);
14067
- }
14068
- }
14069
- function mapCacheClear() {
14070
- this.__data__ = {
14071
- hash: new Hash,
14072
- map: new (Map2 || ListCache),
14073
- string: new Hash
14074
- };
14075
- }
14076
- function mapCacheDelete(key) {
14077
- return getMapData(this, key)["delete"](key);
14078
- }
14079
- function mapCacheGet(key) {
14080
- return getMapData(this, key).get(key);
14081
- }
14082
- function mapCacheHas(key) {
14083
- return getMapData(this, key).has(key);
14084
- }
14085
- function mapCacheSet(key, value) {
14086
- getMapData(this, key).set(key, value);
14087
- return this;
14088
- }
14089
- MapCache.prototype.clear = mapCacheClear;
14090
- MapCache.prototype["delete"] = mapCacheDelete;
14091
- MapCache.prototype.get = mapCacheGet;
14092
- MapCache.prototype.has = mapCacheHas;
14093
- MapCache.prototype.set = mapCacheSet;
14094
- function SetCache(values) {
14095
- var index = -1, length = values ? values.length : 0;
14096
- this.__data__ = new MapCache;
14097
- while (++index < length) {
14098
- this.add(values[index]);
14099
- }
14100
- }
14101
- function setCacheAdd(value) {
14102
- this.__data__.set(value, HASH_UNDEFINED);
14103
- return this;
14104
- }
14105
- function setCacheHas(value) {
14106
- return this.__data__.has(value);
14107
- }
14108
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
14109
- SetCache.prototype.has = setCacheHas;
14110
- function assocIndexOf(array, key) {
14111
- var length = array.length;
14112
- while (length--) {
14113
- if (eq(array[length][0], key)) {
14114
- return length;
14115
- }
14116
- }
14117
- return -1;
14118
- }
14119
- function baseIsNative(value) {
14120
- if (!isObject2(value) || isMasked(value)) {
14121
- return false;
14122
- }
14123
- var pattern = isFunction2(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
14124
- return pattern.test(toSource(value));
14125
- }
14126
- function baseUniq(array, iteratee, comparator) {
14127
- var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
14128
- if (comparator) {
14129
- isCommon = false;
14130
- includes2 = arrayIncludesWith;
14131
- } else if (length >= LARGE_ARRAY_SIZE) {
14132
- var set = createSet(array);
14133
- if (set) {
14134
- return setToArray(set);
14135
- }
14136
- isCommon = false;
14137
- includes2 = cacheHas;
14138
- seen = new SetCache;
14139
- } else {
14140
- seen = result;
14141
- }
14142
- outer:
14143
- while (++index < length) {
14144
- var value = array[index], computed = value;
14145
- value = comparator || value !== 0 ? value : 0;
14146
- if (isCommon && computed === computed) {
14147
- var seenIndex = seen.length;
14148
- while (seenIndex--) {
14149
- if (seen[seenIndex] === computed) {
14150
- continue outer;
14151
- }
14152
- }
14153
- result.push(value);
14154
- } else if (!includes2(seen, computed, comparator)) {
14155
- if (seen !== result) {
14156
- seen.push(computed);
14157
- }
14158
- result.push(value);
14159
- }
14160
- }
14161
- return result;
14162
- }
14163
- var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values) {
14164
- return new Set2(values);
14165
- };
14166
- function getMapData(map, key) {
14167
- var data = map.__data__;
14168
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
14169
- }
14170
- function getNative(object, key) {
14171
- var value = getValue(object, key);
14172
- return baseIsNative(value) ? value : undefined;
14173
- }
14174
- function isKeyable(value) {
14175
- var type = typeof value;
14176
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
14177
- }
14178
- function isMasked(func) {
14179
- return !!maskSrcKey && maskSrcKey in func;
14180
- }
14181
- function toSource(func) {
14182
- if (func != null) {
14183
- try {
14184
- return funcToString.call(func);
14185
- } catch (e) {}
14186
- try {
14187
- return func + "";
14188
- } catch (e) {}
14189
- }
14190
- return "";
14191
- }
14192
- function uniqWith(array, comparator) {
14193
- return array && array.length ? baseUniq(array, undefined, comparator) : [];
14194
- }
14195
- function eq(value, other) {
14196
- return value === other || value !== value && other !== other;
14197
- }
14198
- function isFunction2(value) {
14199
- var tag = isObject2(value) ? objectToString.call(value) : "";
14200
- return tag == funcTag || tag == genTag;
14201
- }
14202
- function isObject2(value) {
14203
- var type = typeof value;
14204
- return !!value && (type == "object" || type == "function");
14205
- }
14206
- function noop() {}
14207
- lodash_uniqwith = uniqWith;
14208
- return lodash_uniqwith;
14209
- }
14210
- function requireLodash_sortby() {
14211
- if (hasRequiredLodash_sortby)
14212
- return lodash_sortby.exports;
14213
- hasRequiredLodash_sortby = 1;
14214
- (function(module, exports$1) {
14215
- var LARGE_ARRAY_SIZE = 200;
14216
- var FUNC_ERROR_TEXT = "Expected a function";
14217
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
14218
- var UNORDERED_COMPARE_FLAG = 1, PARTIAL_COMPARE_FLAG = 2;
14219
- var MAX_SAFE_INTEGER = 9007199254740991;
14220
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", promiseTag = "[object Promise]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
14221
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
14222
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
14223
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
14224
- var reEscapeChar = /\\(\\)?/g;
14225
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
14226
- var reIsUint = /^(?:0|[1-9]\d*)$/;
14227
- var typedArrayTags = {};
14228
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
14229
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
14230
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
14231
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
14232
- var root = freeGlobal || freeSelf || Function("return this")();
14233
- var freeExports = exports$1 && !exports$1.nodeType && exports$1;
14234
- var freeModule = freeExports && true && module && !module.nodeType && module;
14235
- var moduleExports = freeModule && freeModule.exports === freeExports;
14236
- var freeProcess = moduleExports && freeGlobal.process;
14237
- var nodeUtil = function() {
14238
- try {
14239
- return freeProcess && freeProcess.binding("util");
14240
- } catch (e) {}
14241
- }();
14242
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
14243
- function apply(func, thisArg, args) {
14244
- switch (args.length) {
14245
- case 0:
14246
- return func.call(thisArg);
14247
- case 1:
14248
- return func.call(thisArg, args[0]);
14249
- case 2:
14250
- return func.call(thisArg, args[0], args[1]);
14251
- case 3:
14252
- return func.call(thisArg, args[0], args[1], args[2]);
14253
- }
14254
- return func.apply(thisArg, args);
14255
- }
14256
- function arrayMap(array, iteratee) {
14257
- var index = -1, length = array ? array.length : 0, result = Array(length);
14258
- while (++index < length) {
14259
- result[index] = iteratee(array[index], index, array);
14260
- }
14261
- return result;
14262
- }
14263
- function arrayPush(array, values) {
14264
- var index = -1, length = values.length, offset = array.length;
14265
- while (++index < length) {
14266
- array[offset + index] = values[index];
14267
- }
14268
- return array;
14269
- }
14270
- function arraySome(array, predicate) {
14271
- var index = -1, length = array ? array.length : 0;
14272
- while (++index < length) {
14273
- if (predicate(array[index], index, array)) {
14274
- return true;
14275
- }
14276
- }
14277
- return false;
14278
- }
14279
- function baseProperty(key) {
14280
- return function(object) {
14281
- return object == null ? undefined : object[key];
14282
- };
14283
- }
14284
- function baseSortBy(array, comparer) {
14285
- var length = array.length;
14286
- array.sort(comparer);
14287
- while (length--) {
14288
- array[length] = array[length].value;
14289
- }
14290
- return array;
14291
- }
14292
- function baseTimes(n, iteratee) {
14293
- var index = -1, result = Array(n);
14294
- while (++index < n) {
14295
- result[index] = iteratee(index);
14296
- }
14297
- return result;
14298
- }
14299
- function baseUnary(func) {
14300
- return function(value) {
14301
- return func(value);
14302
- };
14303
- }
14304
- function getValue(object, key) {
14305
- return object == null ? undefined : object[key];
14306
- }
14307
- function isHostObject(value) {
14308
- var result = false;
14309
- if (value != null && typeof value.toString != "function") {
14310
- try {
14311
- result = !!(value + "");
14312
- } catch (e) {}
14313
- }
14314
- return result;
14315
- }
14316
- function mapToArray(map) {
14317
- var index = -1, result = Array(map.size);
14318
- map.forEach(function(value, key) {
14319
- result[++index] = [key, value];
14320
- });
14321
- return result;
14322
- }
14323
- function overArg(func, transform) {
14324
- return function(arg) {
14325
- return func(transform(arg));
14326
- };
14327
- }
14328
- function setToArray(set) {
14329
- var index = -1, result = Array(set.size);
14330
- set.forEach(function(value) {
14331
- result[++index] = value;
14332
- });
14333
- return result;
14334
- }
14335
- var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
14336
- var coreJsData = root["__core-js_shared__"];
14337
- var maskSrcKey = function() {
14338
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
14339
- return uid ? "Symbol(src)_1." + uid : "";
14340
- }();
14341
- var funcToString = funcProto.toString;
14342
- var hasOwnProperty = objectProto.hasOwnProperty;
14343
- var objectToString = objectProto.toString;
14344
- var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
14345
- var { Symbol: Symbol2, Uint8Array: Uint8Array2 } = root, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined;
14346
- var nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max;
14347
- var DataView2 = getNative(root, "DataView"), Map2 = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set2 = getNative(root, "Set"), WeakMap2 = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
14348
- var dataViewCtorString = toSource(DataView2), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
14349
- var symbolProto = Symbol2 ? Symbol2.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined;
14350
- function Hash(entries) {
14351
- var index = -1, length = entries ? entries.length : 0;
14352
- this.clear();
14353
- while (++index < length) {
14354
- var entry = entries[index];
14355
- this.set(entry[0], entry[1]);
14356
- }
14357
- }
14358
- function hashClear() {
14359
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
14360
- }
14361
- function hashDelete(key) {
14362
- return this.has(key) && delete this.__data__[key];
14363
- }
14364
- function hashGet(key) {
14365
- var data = this.__data__;
14366
- if (nativeCreate) {
14367
- var result = data[key];
14368
- return result === HASH_UNDEFINED ? undefined : result;
14369
- }
14370
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
14371
- }
14372
- function hashHas(key) {
14373
- var data = this.__data__;
14374
- return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
14375
- }
14376
- function hashSet(key, value) {
14377
- var data = this.__data__;
14378
- data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
14379
- return this;
14380
- }
14381
- Hash.prototype.clear = hashClear;
14382
- Hash.prototype["delete"] = hashDelete;
14383
- Hash.prototype.get = hashGet;
14384
- Hash.prototype.has = hashHas;
14385
- Hash.prototype.set = hashSet;
14386
- function ListCache(entries) {
14387
- var index = -1, length = entries ? entries.length : 0;
14388
- this.clear();
14389
- while (++index < length) {
14390
- var entry = entries[index];
14391
- this.set(entry[0], entry[1]);
14392
- }
14393
- }
14394
- function listCacheClear() {
14395
- this.__data__ = [];
14396
- }
14397
- function listCacheDelete(key) {
14398
- var data = this.__data__, index = assocIndexOf(data, key);
14399
- if (index < 0) {
14400
- return false;
14401
- }
14402
- var lastIndex = data.length - 1;
14403
- if (index == lastIndex) {
14404
- data.pop();
14405
- } else {
14406
- splice.call(data, index, 1);
14407
- }
14408
- return true;
14409
- }
14410
- function listCacheGet(key) {
14411
- var data = this.__data__, index = assocIndexOf(data, key);
14412
- return index < 0 ? undefined : data[index][1];
14413
- }
14414
- function listCacheHas(key) {
14415
- return assocIndexOf(this.__data__, key) > -1;
14416
- }
14417
- function listCacheSet(key, value) {
14418
- var data = this.__data__, index = assocIndexOf(data, key);
14419
- if (index < 0) {
14420
- data.push([key, value]);
14421
- } else {
14422
- data[index][1] = value;
14423
- }
14424
- return this;
14425
- }
14426
- ListCache.prototype.clear = listCacheClear;
14427
- ListCache.prototype["delete"] = listCacheDelete;
14428
- ListCache.prototype.get = listCacheGet;
14429
- ListCache.prototype.has = listCacheHas;
14430
- ListCache.prototype.set = listCacheSet;
14431
- function MapCache(entries) {
14432
- var index = -1, length = entries ? entries.length : 0;
14433
- this.clear();
14434
- while (++index < length) {
14435
- var entry = entries[index];
14436
- this.set(entry[0], entry[1]);
14437
- }
14438
- }
14439
- function mapCacheClear() {
14440
- this.__data__ = {
14441
- hash: new Hash,
14442
- map: new (Map2 || ListCache),
14443
- string: new Hash
14444
- };
14445
- }
14446
- function mapCacheDelete(key) {
14447
- return getMapData(this, key)["delete"](key);
14448
- }
14449
- function mapCacheGet(key) {
14450
- return getMapData(this, key).get(key);
14451
- }
14452
- function mapCacheHas(key) {
14453
- return getMapData(this, key).has(key);
14454
- }
14455
- function mapCacheSet(key, value) {
14456
- getMapData(this, key).set(key, value);
14457
- return this;
14458
- }
14459
- MapCache.prototype.clear = mapCacheClear;
14460
- MapCache.prototype["delete"] = mapCacheDelete;
14461
- MapCache.prototype.get = mapCacheGet;
14462
- MapCache.prototype.has = mapCacheHas;
14463
- MapCache.prototype.set = mapCacheSet;
14464
- function SetCache(values) {
14465
- var index = -1, length = values ? values.length : 0;
14466
- this.__data__ = new MapCache;
14467
- while (++index < length) {
14468
- this.add(values[index]);
14469
- }
14470
- }
14471
- function setCacheAdd(value) {
14472
- this.__data__.set(value, HASH_UNDEFINED);
14473
- return this;
14474
- }
14475
- function setCacheHas(value) {
14476
- return this.__data__.has(value);
14477
- }
14478
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
14479
- SetCache.prototype.has = setCacheHas;
14480
- function Stack(entries) {
14481
- this.__data__ = new ListCache(entries);
14482
- }
14483
- function stackClear() {
14484
- this.__data__ = new ListCache;
14485
- }
14486
- function stackDelete(key) {
14487
- return this.__data__["delete"](key);
14488
- }
14489
- function stackGet(key) {
14490
- return this.__data__.get(key);
14491
- }
14492
- function stackHas(key) {
14493
- return this.__data__.has(key);
14494
- }
14495
- function stackSet(key, value) {
14496
- var cache = this.__data__;
14497
- if (cache instanceof ListCache) {
14498
- var pairs = cache.__data__;
14499
- if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
14500
- pairs.push([key, value]);
14501
- return this;
14502
- }
14503
- cache = this.__data__ = new MapCache(pairs);
14504
- }
14505
- cache.set(key, value);
14506
- return this;
14507
- }
14508
- Stack.prototype.clear = stackClear;
14509
- Stack.prototype["delete"] = stackDelete;
14510
- Stack.prototype.get = stackGet;
14511
- Stack.prototype.has = stackHas;
14512
- Stack.prototype.set = stackSet;
14513
- function arrayLikeKeys(value, inherited) {
14514
- var result = isArray2(value) || isArguments(value) ? baseTimes(value.length, String) : [];
14515
- var length = result.length, skipIndexes = !!length;
14516
- for (var key in value) {
14517
- if (hasOwnProperty.call(value, key) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
14518
- result.push(key);
14519
- }
14520
- }
14521
- return result;
14522
- }
14523
- function assocIndexOf(array, key) {
14524
- var length = array.length;
14525
- while (length--) {
14526
- if (eq(array[length][0], key)) {
14527
- return length;
14528
- }
14529
- }
14530
- return -1;
14531
- }
14532
- var baseEach = createBaseEach(baseForOwn);
14533
- function baseFlatten(array, depth, predicate, isStrict, result) {
14534
- var index = -1, length = array.length;
14535
- predicate || (predicate = isFlattenable);
14536
- result || (result = []);
14537
- while (++index < length) {
14538
- var value = array[index];
14539
- if (predicate(value)) {
14540
- {
14541
- arrayPush(result, value);
14542
- }
14543
- } else {
14544
- result[result.length] = value;
14545
- }
14546
- }
14547
- return result;
14548
- }
14549
- var baseFor = createBaseFor();
14550
- function baseForOwn(object, iteratee) {
14551
- return object && baseFor(object, iteratee, keys);
14552
- }
14553
- function baseGet(object, path) {
14554
- path = isKey(path, object) ? [path] : castPath(path);
14555
- var index = 0, length = path.length;
14556
- while (object != null && index < length) {
14557
- object = object[toKey(path[index++])];
14558
- }
14559
- return index && index == length ? object : undefined;
14560
- }
14561
- function baseGetTag(value) {
14562
- return objectToString.call(value);
14563
- }
14564
- function baseHasIn(object, key) {
14565
- return object != null && key in Object(object);
14566
- }
14567
- function baseIsEqual(value, other, customizer, bitmask, stack) {
14568
- if (value === other) {
14569
- return true;
14570
- }
14571
- if (value == null || other == null || !isObject2(value) && !isObjectLike(other)) {
14572
- return value !== value && other !== other;
14573
- }
14574
- return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
14575
- }
14576
- function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
14577
- var objIsArr = isArray2(object), othIsArr = isArray2(other), objTag = arrayTag, othTag = arrayTag;
14578
- if (!objIsArr) {
14579
- objTag = getTag(object);
14580
- objTag = objTag == argsTag ? objectTag : objTag;
14581
- }
14582
- if (!othIsArr) {
14583
- othTag = getTag(other);
14584
- othTag = othTag == argsTag ? objectTag : othTag;
14585
- }
14586
- var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag;
14587
- if (isSameTag && !objIsObj) {
14588
- stack || (stack = new Stack);
14589
- return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
14590
- }
14591
- if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
14592
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
14593
- if (objIsWrapped || othIsWrapped) {
14594
- var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
14595
- stack || (stack = new Stack);
14596
- return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
14597
- }
14598
- }
14599
- if (!isSameTag) {
14600
- return false;
14601
- }
14602
- stack || (stack = new Stack);
14603
- return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
14604
- }
14605
- function baseIsMatch(object, source, matchData, customizer) {
14606
- var index = matchData.length, length = index;
14607
- if (object == null) {
14608
- return !length;
14609
- }
14610
- object = Object(object);
14611
- while (index--) {
14612
- var data = matchData[index];
14613
- if (data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
14614
- return false;
14615
- }
14616
- }
14617
- while (++index < length) {
14618
- data = matchData[index];
14619
- var key = data[0], objValue = object[key], srcValue = data[1];
14620
- if (data[2]) {
14621
- if (objValue === undefined && !(key in object)) {
14622
- return false;
14623
- }
14624
- } else {
14625
- var stack = new Stack;
14626
- var result;
14627
- if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
14628
- return false;
14629
- }
14630
- }
14631
- }
14632
- return true;
14633
- }
14634
- function baseIsNative(value) {
14635
- if (!isObject2(value) || isMasked(value)) {
14636
- return false;
14637
- }
14638
- var pattern = isFunction2(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
14639
- return pattern.test(toSource(value));
14640
- }
14641
- function baseIsTypedArray(value) {
14642
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
14643
- }
14644
- function baseIteratee(value) {
14645
- if (typeof value == "function") {
14646
- return value;
14647
- }
14648
- if (value == null) {
14649
- return identity;
14650
- }
14651
- if (typeof value == "object") {
14652
- return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
14653
- }
14654
- return property(value);
14655
- }
14656
- function baseKeys(object) {
14657
- if (!isPrototype(object)) {
14658
- return nativeKeys(object);
14659
- }
14660
- var result = [];
14661
- for (var key in Object(object)) {
14662
- if (hasOwnProperty.call(object, key) && key != "constructor") {
14663
- result.push(key);
14664
- }
14665
- }
14666
- return result;
14667
- }
14668
- function baseMap(collection, iteratee) {
14669
- var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
14670
- baseEach(collection, function(value, key, collection2) {
14671
- result[++index] = iteratee(value, key, collection2);
14672
- });
14673
- return result;
14674
- }
14675
- function baseMatches(source) {
14676
- var matchData = getMatchData(source);
14677
- if (matchData.length == 1 && matchData[0][2]) {
14678
- return matchesStrictComparable(matchData[0][0], matchData[0][1]);
14679
- }
14680
- return function(object) {
14681
- return object === source || baseIsMatch(object, source, matchData);
14682
- };
14683
- }
14684
- function baseMatchesProperty(path, srcValue) {
14685
- if (isKey(path) && isStrictComparable(srcValue)) {
14686
- return matchesStrictComparable(toKey(path), srcValue);
14687
- }
14688
- return function(object) {
14689
- var objValue = get(object, path);
14690
- return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
14691
- };
14692
- }
14693
- function baseOrderBy(collection, iteratees, orders) {
14694
- var index = -1;
14695
- iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
14696
- var result = baseMap(collection, function(value, key, collection2) {
14697
- var criteria = arrayMap(iteratees, function(iteratee) {
14698
- return iteratee(value);
14699
- });
14700
- return { criteria, index: ++index, value };
14701
- });
14702
- return baseSortBy(result, function(object, other) {
14703
- return compareMultiple(object, other, orders);
14704
- });
14705
- }
14706
- function basePropertyDeep(path) {
14707
- return function(object) {
14708
- return baseGet(object, path);
14709
- };
14710
- }
14711
- function baseRest(func, start) {
14712
- start = nativeMax(start === undefined ? func.length - 1 : start, 0);
14713
- return function() {
14714
- var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
14715
- while (++index < length) {
14716
- array[index] = args[start + index];
14717
- }
14718
- index = -1;
14719
- var otherArgs = Array(start + 1);
14720
- while (++index < start) {
14721
- otherArgs[index] = args[index];
14722
- }
14723
- otherArgs[start] = array;
14724
- return apply(func, this, otherArgs);
14725
- };
14726
- }
14727
- function baseToString(value) {
14728
- if (typeof value == "string") {
14729
- return value;
14730
- }
14731
- if (isSymbol(value)) {
14732
- return symbolToString ? symbolToString.call(value) : "";
14733
- }
14734
- var result = value + "";
14735
- return result == "0" && 1 / value == -Infinity ? "-0" : result;
14736
- }
14737
- function castPath(value) {
14738
- return isArray2(value) ? value : stringToPath(value);
14739
- }
14740
- function compareAscending(value, other) {
14741
- if (value !== other) {
14742
- var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
14743
- var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
14744
- if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
14745
- return 1;
14746
- }
14747
- if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
14748
- return -1;
14749
- }
14750
- }
14751
- return 0;
14752
- }
14753
- function compareMultiple(object, other, orders) {
14754
- var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
14755
- while (++index < length) {
14756
- var result = compareAscending(objCriteria[index], othCriteria[index]);
14757
- if (result) {
14758
- if (index >= ordersLength) {
14759
- return result;
14760
- }
14761
- var order = orders[index];
14762
- return result * (order == "desc" ? -1 : 1);
14763
- }
14764
- }
14765
- return object.index - other.index;
14766
- }
14767
- function createBaseEach(eachFunc, fromRight) {
14768
- return function(collection, iteratee) {
14769
- if (collection == null) {
14770
- return collection;
14771
- }
14772
- if (!isArrayLike(collection)) {
14773
- return eachFunc(collection, iteratee);
14774
- }
14775
- var length = collection.length, index = -1, iterable = Object(collection);
14776
- while (++index < length) {
14777
- if (iteratee(iterable[index], index, iterable) === false) {
14778
- break;
14779
- }
14780
- }
14781
- return collection;
14782
- };
14783
- }
14784
- function createBaseFor(fromRight) {
14785
- return function(object, iteratee, keysFunc) {
14786
- var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
14787
- while (length--) {
14788
- var key = props[++index];
14789
- if (iteratee(iterable[key], key, iterable) === false) {
14790
- break;
14791
- }
14792
- }
14793
- return object;
14794
- };
14795
- }
14796
- function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
14797
- var isPartial = bitmask & PARTIAL_COMPARE_FLAG, arrLength = array.length, othLength = other.length;
14798
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
14799
- return false;
14800
- }
14801
- var stacked = stack.get(array);
14802
- if (stacked && stack.get(other)) {
14803
- return stacked == other;
14804
- }
14805
- var index = -1, result = true, seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache : undefined;
14806
- stack.set(array, other);
14807
- stack.set(other, array);
14808
- while (++index < arrLength) {
14809
- var arrValue = array[index], othValue = other[index];
14810
- if (customizer) {
14811
- var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
14812
- }
14813
- if (compared !== undefined) {
14814
- if (compared) {
14815
- continue;
14816
- }
14817
- result = false;
14818
- break;
14819
- }
14820
- if (seen) {
14821
- if (!arraySome(other, function(othValue2, othIndex) {
14822
- if (!seen.has(othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, customizer, bitmask, stack))) {
14823
- return seen.add(othIndex);
14824
- }
14825
- })) {
14826
- result = false;
14827
- break;
14828
- }
14829
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
14830
- result = false;
14831
- break;
14832
- }
14833
- }
14834
- stack["delete"](array);
14835
- stack["delete"](other);
14836
- return result;
14837
- }
14838
- function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
14839
- switch (tag) {
14840
- case dataViewTag:
14841
- if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
14842
- return false;
14843
- }
14844
- object = object.buffer;
14845
- other = other.buffer;
14846
- case arrayBufferTag:
14847
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
14848
- return false;
14849
- }
14850
- return true;
14851
- case boolTag:
14852
- case dateTag:
14853
- case numberTag:
14854
- return eq(+object, +other);
14855
- case errorTag:
14856
- return object.name == other.name && object.message == other.message;
14857
- case regexpTag:
14858
- case stringTag:
14859
- return object == other + "";
14860
- case mapTag:
14861
- var convert = mapToArray;
14862
- case setTag:
14863
- var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
14864
- convert || (convert = setToArray);
14865
- if (object.size != other.size && !isPartial) {
14866
- return false;
14867
- }
14868
- var stacked = stack.get(object);
14869
- if (stacked) {
14870
- return stacked == other;
14871
- }
14872
- bitmask |= UNORDERED_COMPARE_FLAG;
14873
- stack.set(object, other);
14874
- var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
14875
- stack["delete"](object);
14876
- return result;
14877
- case symbolTag:
14878
- if (symbolValueOf) {
14879
- return symbolValueOf.call(object) == symbolValueOf.call(other);
14880
- }
14881
- }
14882
- return false;
14883
- }
14884
- function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
14885
- var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length;
14886
- if (objLength != othLength && !isPartial) {
14887
- return false;
14888
- }
14889
- var index = objLength;
14890
- while (index--) {
14891
- var key = objProps[index];
14892
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
14893
- return false;
14894
- }
14895
- }
14896
- var stacked = stack.get(object);
14897
- if (stacked && stack.get(other)) {
14898
- return stacked == other;
14899
- }
14900
- var result = true;
14901
- stack.set(object, other);
14902
- stack.set(other, object);
14903
- var skipCtor = isPartial;
14904
- while (++index < objLength) {
14905
- key = objProps[index];
14906
- var objValue = object[key], othValue = other[key];
14907
- if (customizer) {
14908
- var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
14909
- }
14910
- if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) {
14911
- result = false;
14912
- break;
14913
- }
14914
- skipCtor || (skipCtor = key == "constructor");
14915
- }
14916
- if (result && !skipCtor) {
14917
- var objCtor = object.constructor, othCtor = other.constructor;
14918
- if (objCtor != othCtor && (("constructor" in object) && ("constructor" in other)) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
14919
- result = false;
14920
- }
14921
- }
14922
- stack["delete"](object);
14923
- stack["delete"](other);
14924
- return result;
14925
- }
14926
- function getMapData(map, key) {
14927
- var data = map.__data__;
14928
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
14929
- }
14930
- function getMatchData(object) {
14931
- var result = keys(object), length = result.length;
14932
- while (length--) {
14933
- var key = result[length], value = object[key];
14934
- result[length] = [key, value, isStrictComparable(value)];
14935
- }
14936
- return result;
14937
- }
14938
- function getNative(object, key) {
14939
- var value = getValue(object, key);
14940
- return baseIsNative(value) ? value : undefined;
14941
- }
14942
- var getTag = baseGetTag;
14943
- if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2) != setTag || WeakMap2 && getTag(new WeakMap2) != weakMapTag) {
14944
- getTag = function(value) {
14945
- var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : undefined;
14946
- if (ctorString) {
14947
- switch (ctorString) {
14948
- case dataViewCtorString:
14949
- return dataViewTag;
14950
- case mapCtorString:
14951
- return mapTag;
14952
- case promiseCtorString:
14953
- return promiseTag;
14954
- case setCtorString:
14955
- return setTag;
14956
- case weakMapCtorString:
14957
- return weakMapTag;
14958
- }
14959
- }
14960
- return result;
14961
- };
14962
- }
14963
- function hasPath(object, path, hasFunc) {
14964
- path = isKey(path, object) ? [path] : castPath(path);
14965
- var result, index = -1, length = path.length;
14966
- while (++index < length) {
14967
- var key = toKey(path[index]);
14968
- if (!(result = object != null && hasFunc(object, key))) {
14969
- break;
14970
- }
14971
- object = object[key];
14972
- }
14973
- if (result) {
14974
- return result;
14975
- }
14976
- var length = object ? object.length : 0;
14977
- return !!length && isLength(length) && isIndex(key, length) && (isArray2(object) || isArguments(object));
14978
- }
14979
- function isFlattenable(value) {
14980
- return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
14981
- }
14982
- function isIndex(value, length) {
14983
- length = length == null ? MAX_SAFE_INTEGER : length;
14984
- return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
14985
- }
14986
- function isIterateeCall(value, index, object) {
14987
- if (!isObject2(object)) {
14988
- return false;
14989
- }
14990
- var type = typeof index;
14991
- if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && (index in object)) {
14992
- return eq(object[index], value);
14993
- }
14994
- return false;
12430
+ }
12431
+ function PrintVisitor() {
12432
+ this.padding = 0;
12433
+ }
12434
+ PrintVisitor.prototype = new _visitor2["default"];
12435
+ PrintVisitor.prototype.pad = function(string) {
12436
+ var out = "";
12437
+ for (var i = 0, l = this.padding;i < l; i++) {
12438
+ out += " ";
14995
12439
  }
14996
- function isKey(value, object) {
14997
- if (isArray2(value)) {
14998
- return false;
14999
- }
15000
- var type = typeof value;
15001
- if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
15002
- return true;
12440
+ out += string + `
12441
+ `;
12442
+ return out;
12443
+ };
12444
+ PrintVisitor.prototype.Program = function(program) {
12445
+ var out = "", body = program.body, i = undefined, l = undefined;
12446
+ if (program.blockParams) {
12447
+ var blockParams = "BLOCK PARAMS: [";
12448
+ for (i = 0, l = program.blockParams.length;i < l; i++) {
12449
+ blockParams += " " + program.blockParams[i];
15003
12450
  }
15004
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
15005
- }
15006
- function isKeyable(value) {
15007
- var type = typeof value;
15008
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
15009
- }
15010
- function isMasked(func) {
15011
- return !!maskSrcKey && maskSrcKey in func;
15012
- }
15013
- function isPrototype(value) {
15014
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
15015
- return value === proto;
15016
- }
15017
- function isStrictComparable(value) {
15018
- return value === value && !isObject2(value);
15019
- }
15020
- function matchesStrictComparable(key, srcValue) {
15021
- return function(object) {
15022
- if (object == null) {
15023
- return false;
15024
- }
15025
- return object[key] === srcValue && (srcValue !== undefined || (key in Object(object)));
15026
- };
12451
+ blockParams += " ]";
12452
+ out += this.pad(blockParams);
15027
12453
  }
15028
- var stringToPath = memoize(function(string) {
15029
- string = toString(string);
15030
- var result = [];
15031
- if (reLeadingDot.test(string)) {
15032
- result.push("");
15033
- }
15034
- string.replace(rePropName, function(match, number, quote, string2) {
15035
- result.push(quote ? string2.replace(reEscapeChar, "$1") : number || match);
15036
- });
15037
- return result;
15038
- });
15039
- function toKey(value) {
15040
- if (typeof value == "string" || isSymbol(value)) {
15041
- return value;
15042
- }
15043
- var result = value + "";
15044
- return result == "0" && 1 / value == -Infinity ? "-0" : result;
12454
+ for (i = 0, l = body.length;i < l; i++) {
12455
+ out += this.accept(body[i]);
15045
12456
  }
15046
- function toSource(func) {
15047
- if (func != null) {
15048
- try {
15049
- return funcToString.call(func);
15050
- } catch (e) {}
15051
- try {
15052
- return func + "";
15053
- } catch (e) {}
15054
- }
15055
- return "";
12457
+ this.padding--;
12458
+ return out;
12459
+ };
12460
+ PrintVisitor.prototype.MustacheStatement = function(mustache) {
12461
+ return this.pad("{{ " + this.SubExpression(mustache) + " }}");
12462
+ };
12463
+ PrintVisitor.prototype.Decorator = function(mustache) {
12464
+ return this.pad("{{ DIRECTIVE " + this.SubExpression(mustache) + " }}");
12465
+ };
12466
+ PrintVisitor.prototype.BlockStatement = PrintVisitor.prototype.DecoratorBlock = function(block) {
12467
+ var out = "";
12468
+ out += this.pad((block.type === "DecoratorBlock" ? "DIRECTIVE " : "") + "BLOCK:");
12469
+ this.padding++;
12470
+ out += this.pad(this.SubExpression(block));
12471
+ if (block.program) {
12472
+ out += this.pad("PROGRAM:");
12473
+ this.padding++;
12474
+ out += this.accept(block.program);
12475
+ this.padding--;
15056
12476
  }
15057
- var sortBy = baseRest(function(collection, iteratees) {
15058
- if (collection == null) {
15059
- return [];
15060
- }
15061
- var length = iteratees.length;
15062
- if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
15063
- iteratees = [];
15064
- } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
15065
- iteratees = [iteratees[0]];
12477
+ if (block.inverse) {
12478
+ if (block.program) {
12479
+ this.padding++;
15066
12480
  }
15067
- return baseOrderBy(collection, baseFlatten(iteratees), []);
15068
- });
15069
- function memoize(func, resolver) {
15070
- if (typeof func != "function" || resolver && typeof resolver != "function") {
15071
- throw new TypeError(FUNC_ERROR_TEXT);
12481
+ out += this.pad("{{^}}");
12482
+ this.padding++;
12483
+ out += this.accept(block.inverse);
12484
+ this.padding--;
12485
+ if (block.program) {
12486
+ this.padding--;
15072
12487
  }
15073
- var memoized = function() {
15074
- var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
15075
- if (cache.has(key)) {
15076
- return cache.get(key);
15077
- }
15078
- var result = func.apply(this, args);
15079
- memoized.cache = cache.set(key, result);
15080
- return result;
15081
- };
15082
- memoized.cache = new (memoize.Cache || MapCache);
15083
- return memoized;
15084
- }
15085
- memoize.Cache = MapCache;
15086
- function eq(value, other) {
15087
- return value === other || value !== value && other !== other;
15088
12488
  }
15089
- function isArguments(value) {
15090
- return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
15091
- }
15092
- var isArray2 = Array.isArray;
15093
- function isArrayLike(value) {
15094
- return value != null && isLength(value.length) && !isFunction2(value);
15095
- }
15096
- function isArrayLikeObject(value) {
15097
- return isObjectLike(value) && isArrayLike(value);
15098
- }
15099
- function isFunction2(value) {
15100
- var tag = isObject2(value) ? objectToString.call(value) : "";
15101
- return tag == funcTag || tag == genTag;
15102
- }
15103
- function isLength(value) {
15104
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
15105
- }
15106
- function isObject2(value) {
15107
- var type = typeof value;
15108
- return !!value && (type == "object" || type == "function");
15109
- }
15110
- function isObjectLike(value) {
15111
- return !!value && typeof value == "object";
15112
- }
15113
- function isSymbol(value) {
15114
- return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
15115
- }
15116
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
15117
- function toString(value) {
15118
- return value == null ? "" : baseToString(value);
15119
- }
15120
- function get(object, path, defaultValue) {
15121
- var result = object == null ? undefined : baseGet(object, path);
15122
- return result === undefined ? defaultValue : result;
15123
- }
15124
- function hasIn(object, path) {
15125
- return object != null && hasPath(object, path, baseHasIn);
12489
+ this.padding--;
12490
+ return out;
12491
+ };
12492
+ PrintVisitor.prototype.PartialStatement = function(partial) {
12493
+ var content = "PARTIAL:" + partial.name.original;
12494
+ if (partial.params[0]) {
12495
+ content += " " + this.accept(partial.params[0]);
15126
12496
  }
15127
- function keys(object) {
15128
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
12497
+ if (partial.hash) {
12498
+ content += " " + this.accept(partial.hash);
15129
12499
  }
15130
- function identity(value) {
15131
- return value;
12500
+ return this.pad("{{> " + content + " }}");
12501
+ };
12502
+ PrintVisitor.prototype.PartialBlockStatement = function(partial) {
12503
+ var content = "PARTIAL BLOCK:" + partial.name.original;
12504
+ if (partial.params[0]) {
12505
+ content += " " + this.accept(partial.params[0]);
15132
12506
  }
15133
- function property(path) {
15134
- return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
12507
+ if (partial.hash) {
12508
+ content += " " + this.accept(partial.hash);
15135
12509
  }
15136
- module.exports = sortBy;
15137
- })(lodash_sortby, lodash_sortby.exports);
15138
- return lodash_sortby.exports;
15139
- }
15140
- function requireEscapeStringRegexp() {
15141
- if (hasRequiredEscapeStringRegexp)
15142
- return escapeStringRegexp;
15143
- hasRequiredEscapeStringRegexp = 1;
15144
- escapeStringRegexp = (string) => {
15145
- if (typeof string !== "string") {
15146
- throw new TypeError("Expected a string");
12510
+ content += " " + this.pad("PROGRAM:");
12511
+ this.padding++;
12512
+ content += this.accept(partial.program);
12513
+ this.padding--;
12514
+ return this.pad("{{> " + content + " }}");
12515
+ };
12516
+ PrintVisitor.prototype.ContentStatement = function(content) {
12517
+ return this.pad("CONTENT[ '" + content.value + "' ]");
12518
+ };
12519
+ PrintVisitor.prototype.CommentStatement = function(comment) {
12520
+ return this.pad("{{! '" + comment.value + "' }}");
12521
+ };
12522
+ PrintVisitor.prototype.SubExpression = function(sexpr) {
12523
+ var params = sexpr.params, paramStrings = [], hash = undefined;
12524
+ for (var i = 0, l = params.length;i < l; i++) {
12525
+ paramStrings.push(this.accept(params[i]));
15147
12526
  }
15148
- return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
12527
+ params = "[" + paramStrings.join(", ") + "]";
12528
+ hash = sexpr.hash ? " " + this.accept(sexpr.hash) : "";
12529
+ return this.accept(sexpr.path) + " " + params + hash;
15149
12530
  };
15150
- return escapeStringRegexp;
15151
- }
15152
- function requireRegexpParse() {
15153
- if (hasRequiredRegexpParse)
15154
- return regexpParse;
15155
- hasRequiredRegexpParse = 1;
15156
- Object.defineProperty(regexpParse, "__esModule", { value: true });
15157
- regexpParse.isRegExpString = regexpParse.parseRegExpString = undefined;
15158
- var REGEXP_LITERAL_PATTERN = /^\/(.+)\/([guimysd]*)$/;
15159
- var parseRegExpString = function(str) {
15160
- var result = str.match(REGEXP_LITERAL_PATTERN);
15161
- if (!result) {
15162
- return null;
12531
+ PrintVisitor.prototype.PathExpression = function(id) {
12532
+ var path = id.parts.join("/");
12533
+ return (id.data ? "@" : "") + "PATH:" + path;
12534
+ };
12535
+ PrintVisitor.prototype.StringLiteral = function(string) {
12536
+ return '"' + string.value + '"';
12537
+ };
12538
+ PrintVisitor.prototype.NumberLiteral = function(number) {
12539
+ return "NUMBER{" + number.value + "}";
12540
+ };
12541
+ PrintVisitor.prototype.BooleanLiteral = function(bool) {
12542
+ return "BOOLEAN{" + bool.value + "}";
12543
+ };
12544
+ PrintVisitor.prototype.UndefinedLiteral = function() {
12545
+ return "UNDEFINED";
12546
+ };
12547
+ PrintVisitor.prototype.NullLiteral = function() {
12548
+ return "NULL";
12549
+ };
12550
+ PrintVisitor.prototype.Hash = function(hash) {
12551
+ var pairs = hash.pairs, joinedPairs = [];
12552
+ for (var i = 0, l = pairs.length;i < l; i++) {
12553
+ joinedPairs.push(this.accept(pairs[i]));
15163
12554
  }
15164
- return {
15165
- source: result[1],
15166
- flagString: result[2]
15167
- };
12555
+ return "HASH{" + joinedPairs.join(", ") + "}";
15168
12556
  };
15169
- regexpParse.parseRegExpString = parseRegExpString;
15170
- var isRegExpString = function(str) {
15171
- return REGEXP_LITERAL_PATTERN.test(str);
12557
+ PrintVisitor.prototype.HashPair = function(pair) {
12558
+ return pair.key + "=" + this.accept(pair.value);
15172
12559
  };
15173
- regexpParse.isRegExpString = isRegExpString;
15174
- return regexpParse;
15175
- }
15176
- function requireRegexpStringMatcher() {
15177
- if (hasRequiredRegexpStringMatcher)
15178
- return regexpStringMatcher;
15179
- hasRequiredRegexpStringMatcher = 1;
15180
- (function(exports$1) {
15181
- var __importDefault = regexpStringMatcher && regexpStringMatcher.__importDefault || function(mod) {
15182
- return mod && mod.__esModule ? mod : { default: mod };
15183
- };
15184
- Object.defineProperty(exports$1, "__esModule", { value: true });
15185
- exports$1.matchPatterns = exports$1.createRegExp = undefined;
15186
- var lodash_uniq_1 = __importDefault(requireLodash_uniq());
15187
- var lodash_uniqwith_1 = __importDefault(requireLodash_uniqwith());
15188
- var lodash_sortby_1 = __importDefault(requireLodash_sortby());
15189
- var escape_string_regexp_1 = __importDefault(requireEscapeStringRegexp());
15190
- var regexp_parse_1 = requireRegexpParse();
15191
- var DEFAULT_FLAGS = "ug";
15192
- var defaultFlags = function(flagsString) {
15193
- if (flagsString.length === 0) {
15194
- return DEFAULT_FLAGS;
15195
- }
15196
- return (0, lodash_uniq_1.default)((flagsString + DEFAULT_FLAGS).split("")).join("");
15197
- };
15198
- var createRegExp = function(patternString, defaultFlag) {
15199
- if (defaultFlag === undefined) {
15200
- defaultFlag = DEFAULT_FLAGS;
15201
- }
15202
- if (patternString.length === 0) {
15203
- throw new Error("Empty string can not handled");
15204
- }
15205
- if ((0, regexp_parse_1.isRegExpString)(patternString)) {
15206
- var regExpStructure = (0, regexp_parse_1.parseRegExpString)(patternString);
15207
- if (regExpStructure) {
15208
- return new RegExp(regExpStructure.source, defaultFlags(regExpStructure.flagString));
15209
- }
15210
- throw new Error('"'.concat(patternString, '" can not parse as RegExp.'));
15211
- } else {
15212
- return new RegExp((0, escape_string_regexp_1.default)(patternString), defaultFlag);
15213
- }
15214
- };
15215
- exports$1.createRegExp = createRegExp;
15216
- var isEqualMatchPatternResult = function(a, b) {
15217
- return a.startIndex === b.startIndex && a.endIndex === b.endIndex && a.match === b.match;
15218
- };
15219
- var matchPatterns = function(text, regExpLikeStrings) {
15220
- var matchPatternResults = [];
15221
- regExpLikeStrings.map(function(patternString) {
15222
- return (0, exports$1.createRegExp)(patternString);
15223
- }).forEach(function(regExp) {
15224
- var results = text.matchAll(regExp);
15225
- Array.from(results).forEach(function(result) {
15226
- if (result.index === undefined) {
15227
- return;
15228
- }
15229
- var match = result[0];
15230
- var index = result.index;
15231
- matchPatternResults.push({
15232
- match,
15233
- captures: result.slice(1),
15234
- startIndex: index,
15235
- endIndex: index + match.length
15236
- });
15237
- });
15238
- });
15239
- var uniqResults = (0, lodash_uniqwith_1.default)(matchPatternResults, isEqualMatchPatternResult);
15240
- return (0, lodash_sortby_1.default)(uniqResults, ["startIndex", "endIndex"]);
15241
- };
15242
- exports$1.matchPatterns = matchPatterns;
15243
- })(regexpStringMatcher);
15244
- return regexpStringMatcher;
15245
- }
15246
- var commonjsGlobal, regexpStringMatcher, lodash_uniq, hasRequiredLodash_uniq, lodash_uniqwith, hasRequiredLodash_uniqwith, lodash_sortby, hasRequiredLodash_sortby, escapeStringRegexp, hasRequiredEscapeStringRegexp, regexpParse, hasRequiredRegexpParse, hasRequiredRegexpStringMatcher, regexpStringMatcherExports, OID_DATA, OID_SHA1, OID_SHA256, OID_SHA384, OID_SHA512, typeMap;
15247
- var init_module2 = __esm(() => {
15248
- commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
15249
- regexpStringMatcher = {};
15250
- lodash_sortby = { exports: {} };
15251
- lodash_sortby.exports;
15252
- regexpParse = {};
15253
- regexpStringMatcherExports = requireRegexpStringMatcher();
15254
- OID_DATA = new Uint8Array([42, 134, 72, 134, 247, 13, 1, 7, 1]);
15255
- OID_SHA1 = new Uint8Array([43, 14, 3, 2, 26]);
15256
- OID_SHA256 = new Uint8Array([96, 134, 72, 1, 101, 3, 4, 2, 1]);
15257
- OID_SHA384 = new Uint8Array([96, 134, 72, 1, 101, 3, 4, 2, 2]);
15258
- OID_SHA512 = new Uint8Array([96, 134, 72, 1, 101, 3, 4, 2, 3]);
15259
- typeMap = new Map([
15260
- ["ghp", "GitHub personal access tokens"],
15261
- ["gho", "OAuth access tokens"],
15262
- ["ghu", "GitHub user-to-server tokens"],
15263
- ["ghs", "GitHub server-to-server tokens"],
15264
- ["ghr", "refresh tokens"],
15265
- ["github_pat", "fine-grained personal access tokens"]
15266
- ]);
15267
- });
15268
-
15269
- // telegram-plugin/secret-detect/secretlint-source.ts
15270
- var init_secretlint_source = __esm(() => {
15271
- init_module();
15272
- init_module2();
15273
- init_suppressor();
15274
12560
  });
15275
12561
 
15276
- // src/util/atomic.ts
15277
- import { closeSync as closeSync2, constants, fsyncSync, openSync as openSync2, renameSync as renameSync2, rmSync, writeSync } from "node:fs";
15278
- var TMP_OPEN_FLAGS;
15279
- var init_atomic = __esm(() => {
15280
- TMP_OPEN_FLAGS = constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | (constants.O_NOFOLLOW ?? 0);
12562
+ // node_modules/.bun/handlebars@4.7.9/node_modules/handlebars/lib/index.js
12563
+ var require_lib = __commonJS((exports, module) => {
12564
+ var handlebars = require_handlebars()["default"];
12565
+ var printer = require_printer();
12566
+ handlebars.PrintVisitor = printer.PrintVisitor;
12567
+ handlebars.print = printer.print;
12568
+ module.exports = handlebars;
12569
+ function extension(module2, filename) {
12570
+ var fs = __require("fs");
12571
+ var templateString = fs.readFileSync(filename, "utf8");
12572
+ module2.exports = handlebars.compile(templateString);
12573
+ }
12574
+ if (__require.extensions) {
12575
+ __require.extensions[".handlebars"] = extension;
12576
+ __require.extensions[".hbs"] = extension;
12577
+ }
15281
12578
  });
15282
12579
 
15283
12580
  // node_modules/.bun/commander@13.1.0/node_modules/commander/lib/error.js
@@ -15986,7 +13283,7 @@ var require_suggestSimilar = __commonJS((exports2) => {
15986
13283
 
15987
13284
  // node_modules/.bun/commander@13.1.0/node_modules/commander/lib/command.js
15988
13285
  var require_command = __commonJS((exports2) => {
15989
- var EventEmitter2 = __require("node:events").EventEmitter;
13286
+ var EventEmitter = __require("node:events").EventEmitter;
15990
13287
  var childProcess = __require("node:child_process");
15991
13288
  var path2 = __require("node:path");
15992
13289
  var fs3 = __require("node:fs");
@@ -15997,7 +13294,7 @@ var require_command = __commonJS((exports2) => {
15997
13294
  var { Option, DualOptions } = require_option();
15998
13295
  var { suggestSimilar } = require_suggestSimilar();
15999
13296
 
16000
- class Command extends EventEmitter2 {
13297
+ class Command extends EventEmitter {
16001
13298
  constructor(name) {
16002
13299
  super();
16003
13300
  this.commands = [];
@@ -23205,6 +20502,7 @@ import { createHash } from "node:crypto";
23205
20502
 
23206
20503
  // src/agents/scaffold.ts
23207
20504
  import { join as join5, resolve as resolve5 } from "node:path";
20505
+ init_atomic();
23208
20506
 
23209
20507
  // src/config/timezone.ts
23210
20508
  var CONTAINER_DEFAULT_UTC_ZONES = new Set([
@@ -23484,6 +20782,13 @@ var ApprovalLookupRequestSchema = exports_external.object({
23484
20782
  action: exports_external.string().min(1),
23485
20783
  current_approver_set: exports_external.array(exports_external.string())
23486
20784
  });
20785
+ var ApprovalLookupByRequestRequestSchema = exports_external.object({
20786
+ v: exports_external.literal(1),
20787
+ op: exports_external.literal("approval_lookup_by_request"),
20788
+ agent_unit: exports_external.string().min(1),
20789
+ request_id: exports_external.string().regex(/^[0-9a-f]{32}$/),
20790
+ current_approver_set: exports_external.array(exports_external.string())
20791
+ });
23487
20792
  var ApprovalConsumeRequestSchema = exports_external.object({
23488
20793
  v: exports_external.literal(1),
23489
20794
  op: exports_external.literal("approval_consume"),
@@ -23538,6 +20843,7 @@ var RequestSchema = exports_external.discriminatedUnion("op", [
23538
20843
  RevokeGrantRequestSchema,
23539
20844
  ApprovalRequestRequestSchema,
23540
20845
  ApprovalLookupRequestSchema,
20846
+ ApprovalLookupByRequestRequestSchema,
23541
20847
  ApprovalConsumeRequestSchema,
23542
20848
  ApprovalRevokeRequestSchema,
23543
20849
  ApprovalListRequestSchema,
@@ -28743,7 +26049,7 @@ function err(code, human) {
28743
26049
 
28744
26050
  // src/util/audit-hashchain.ts
28745
26051
  import { createHash as createHash3 } from "node:crypto";
28746
- import { openSync, readSync, fstatSync, closeSync } from "node:fs";
26052
+ import { openSync as openSync2, readSync, fstatSync, closeSync as closeSync2 } from "node:fs";
28747
26053
  var CHAIN_GENESIS = "GENESIS";
28748
26054
  var SEP = "\x00";
28749
26055
  function rowHash(prev, seq, rowJsonNoChain) {
@@ -28764,7 +26070,7 @@ function chainRow(state, entry) {
28764
26070
  function readTail(path, tailBytes = 64 * 1024) {
28765
26071
  let fd;
28766
26072
  try {
28767
- fd = openSync(path, "r");
26073
+ fd = openSync2(path, "r");
28768
26074
  } catch {
28769
26075
  return null;
28770
26076
  }
@@ -28780,7 +26086,7 @@ function readTail(path, tailBytes = 64 * 1024) {
28780
26086
  return null;
28781
26087
  } finally {
28782
26088
  try {
28783
- closeSync(fd);
26089
+ closeSync2(fd);
28784
26090
  } catch {}
28785
26091
  }
28786
26092
  }
@@ -29007,7 +26313,7 @@ function scanGenericSecrets(text) {
29007
26313
  // telegram-plugin/secret-detect/chunker.ts
29008
26314
  var CHUNK_THRESHOLD = 32 * 1024;
29009
26315
  var WINDOW_SIZE = 16 * 1024;
29010
- var OVERLAP = 1024;
26316
+ var OVERLAP = 8 * 1024;
29011
26317
  function chunk(text) {
29012
26318
  if (text.length <= CHUNK_THRESHOLD) {
29013
26319
  return [{ offset: 0, text }];
@@ -29024,9 +26330,43 @@ function chunk(text) {
29024
26330
  return out;
29025
26331
  }
29026
26332
 
29027
- // telegram-plugin/secret-detect/index.ts
29028
- init_suppressor();
26333
+ // telegram-plugin/secret-detect/suppressor.ts
26334
+ var MARKERS = ["test", "mock", "example", "fixture", "dummy"];
26335
+ var WINDOW = 40;
26336
+ var MARKER_RE = new RegExp(`\\b(?:${MARKERS.join("|")})\\b`, "i");
26337
+ function isSuppressed(text, start, end) {
26338
+ const left = Math.max(0, start - WINDOW);
26339
+ const right = Math.min(text.length, end + WINDOW);
26340
+ const context = text.slice(left, start) + text.slice(end, right);
26341
+ return MARKER_RE.test(context);
26342
+ }
29029
26343
 
26344
+ // telegram-plugin/secret-detect/slug.ts
26345
+ function sanitizeKeyName(raw) {
26346
+ const up = raw.toUpperCase();
26347
+ const cleaned = up.replace(/[^A-Z0-9_]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
26348
+ return cleaned.length > 0 ? cleaned : "SECRET";
26349
+ }
26350
+ function datePart(now = new Date) {
26351
+ const y = now.getUTCFullYear();
26352
+ const m = String(now.getUTCMonth() + 1).padStart(2, "0");
26353
+ const d = String(now.getUTCDate()).padStart(2, "0");
26354
+ return `${y}${m}${d}`;
26355
+ }
26356
+ function deriveSlug(inputs, existing) {
26357
+ let base;
26358
+ if (inputs.key_name && inputs.key_name.trim().length > 0) {
26359
+ base = sanitizeKeyName(inputs.key_name);
26360
+ } else {
26361
+ base = `${inputs.rule_id}_${datePart(inputs.now)}`;
26362
+ }
26363
+ if (!existing.has(base))
26364
+ return base;
26365
+ let n = 2;
26366
+ while (existing.has(`${base}_${n}`))
26367
+ n++;
26368
+ return `${base}_${n}`;
26369
+ }
29030
26370
  // telegram-plugin/secret-detect/url-redact.ts
29031
26371
  var SENSITIVE_PARAMS = new Set([
29032
26372
  "token",
@@ -29072,7 +26412,6 @@ function redactOne(raw) {
29072
26412
  }
29073
26413
 
29074
26414
  // telegram-plugin/secret-detect/index.ts
29075
- init_secretlint_source();
29076
26415
  function detectSecrets(text) {
29077
26416
  if (!text || text.length === 0)
29078
26417
  return [];
@@ -29249,7 +26588,7 @@ import { existsSync as existsSync9, readFileSync as readFileSync7 } from "node:f
29249
26588
  import { dirname as dirname4, join as join7 } from "node:path";
29250
26589
 
29251
26590
  // src/build-info.ts
29252
- var VERSION = "0.18.12";
26591
+ var VERSION = "0.18.13";
29253
26592
 
29254
26593
  // src/cli/resolve-version.ts
29255
26594
  function readPackageVersion() {
@@ -29446,7 +26785,7 @@ function parseRolloutResultLine(stdout) {
29446
26785
  }
29447
26786
 
29448
26787
  // node_modules/.bun/commander@13.1.0/node_modules/commander/esm.mjs
29449
- var import__3 = __toESM(require_commander(), 1);
26788
+ var import__2 = __toESM(require_commander(), 1);
29450
26789
 
29451
26790
  // src/cli/update.ts
29452
26791
  import { join as join8, dirname as dirname5, resolve as resolve7 } from "node:path";
@@ -30486,6 +27825,9 @@ var CONFIG_APPROVAL_TIMEOUT_MS = 60 * 60 * 1000;
30486
27825
  function defaultApprovalId() {
30487
27826
  return randomBytes(4).toString("hex");
30488
27827
  }
27828
+ function idempotencyScope(caller) {
27829
+ return caller.kind === "agent" ? `agent:${caller.name}` : "operator";
27830
+ }
30489
27831
  function formatConfigApprovalDenyError(approval, approvalId) {
30490
27832
  if (approval.denySource === "dispatch_failure") {
30491
27833
  const detail = approval.reason ?? "card dispatch failed";
@@ -30747,9 +28089,17 @@ class HostdServer {
30747
28089
  socket.end();
30748
28090
  return;
30749
28091
  }
30750
- const idempotencyKey = req.idempotency_key ?? req.request_id;
30751
28092
  const now = Date.now();
30752
28093
  this.evictExpiredIdempotency(now);
28094
+ const denied = this.checkGate(req, caller);
28095
+ if (denied) {
28096
+ const resp2 = deniedResponse(req.request_id, denied);
28097
+ await this.writeAudit({ caller, req, resp: resp2 });
28098
+ socket.write(encodeResponse(resp2));
28099
+ socket.end();
28100
+ return;
28101
+ }
28102
+ const idempotencyKey = `${idempotencyScope(caller)} ${req.idempotency_key ?? req.request_id}`;
30753
28103
  const prior = this.idempotencyKeys.get(idempotencyKey);
30754
28104
  if (prior && now - prior.ts < IDEMPOTENCY_WINDOW_MS) {
30755
28105
  const cached = this.statusByRequestId.get(prior.request_id);
@@ -30760,14 +28110,6 @@ class HostdServer {
30760
28110
  }
30761
28111
  }
30762
28112
  this.idempotencyKeys.set(idempotencyKey, { request_id: req.request_id, ts: now });
30763
- const denied = this.checkGate(req, caller);
30764
- if (denied) {
30765
- const resp2 = deniedResponse(req.request_id, denied);
30766
- await this.writeAudit({ caller, req, resp: resp2 });
30767
- socket.write(encodeResponse(resp2));
30768
- socket.end();
30769
- return;
30770
- }
30771
28113
  const attest = await this.checkOperatorAttest(req, caller);
30772
28114
  if (attest.denied !== null) {
30773
28115
  const resp2 = deniedResponse(req.request_id, attest.denied);
@@ -31441,8 +28783,17 @@ class HostdServer {
31441
28783
  stderr_tail: tail(res.stderr)
31442
28784
  };
31443
28785
  }
28786
+ rejectUnconfiguredTarget(name, request_id, op, started) {
28787
+ if (Object.prototype.hasOwnProperty.call(this.opts.agentUids, name)) {
28788
+ return null;
28789
+ }
28790
+ return deniedResponse(request_id, `${op}: "${name}" is not a configured agent. ` + `${op} targets only peer agent containers (switchroom-<agent>); ` + `singleton service containers (vault-broker, approval-kernel, ` + `hostd, web) and unknown names are rejected. Configured agents: ` + `${Object.keys(this.opts.agentUids).sort().join(", ")}.`, Date.now() - started);
28791
+ }
31444
28792
  async handleAgentLogs(req, started) {
31445
28793
  const tailLines = req.args.tail ?? 100;
28794
+ const rejected = this.rejectUnconfiguredTarget(req.args.name, req.request_id, "agent_logs", started);
28795
+ if (rejected)
28796
+ return rejected;
31446
28797
  const container = `switchroom-${req.args.name}`;
31447
28798
  const res = await this.runDocker([
31448
28799
  "logs",
@@ -31468,6 +28819,9 @@ class HostdServer {
31468
28819
  if (!req.args.argv.every(isSafeExecArgvElement)) {
31469
28820
  return deniedResponse(req.request_id, `agent_exec: an argv element contains a control character ` + `(C0 / DEL) or exceeds ${MAX_EXEC_ARGV_ELEMENT_BYTES} bytes, ` + `which is not permitted (#1401 / #1400).`, Date.now() - started);
31470
28821
  }
28822
+ const rejected = this.rejectUnconfiguredTarget(req.args.name, req.request_id, "agent_exec", started);
28823
+ if (rejected)
28824
+ return rejected;
31471
28825
  const container = `switchroom-${req.args.name}`;
31472
28826
  const res = await this.runDocker(["exec", container, ...req.args.argv]);
31473
28827
  return {