@validate.qa/runner 1.0.100 → 1.0.101

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.
@@ -3027,7 +3027,7 @@ function unescapeQuotedBody(raw) {
3027
3027
  return raw.replace(/\\(['"`\\])/g, "$1");
3028
3028
  }
3029
3029
  function extractRoleNameValue(line) {
3030
- const m = line.match(new RegExp(`getByRole\\s*\\([^,]+,\\s*\\{[^}]*name\\s*:\\s*(?:${QUOTED_BODY}|\\/([^/]*?)\\/)`, "i"));
3030
+ const m = line.match(new RegExp(`getByRole\\s*\\([^,]{1,200},\\s*\\{[^}]{0,200}?name\\s*:\\s*(?:${QUOTED_BODY}|\\/([^/]*?)\\/)`, "i"));
3031
3031
  if (!m)
3032
3032
  return null;
3033
3033
  const raw = m[1] ?? m[2] ?? m[3];
@@ -3735,6 +3735,8 @@ function stripCoverageComments(code) {
3735
3735
  let copyFrom = 0;
3736
3736
  let i = 0;
3737
3737
  let quote = null;
3738
+ let prev = "";
3739
+ let noRegexBefore = 0;
3738
3740
  while (i < code.length) {
3739
3741
  const ch = code[i];
3740
3742
  if (quote) {
@@ -3742,12 +3744,24 @@ function stripCoverageComments(code) {
3742
3744
  i += 2;
3743
3745
  continue;
3744
3746
  }
3745
- if (ch === quote || ch === "\n" && quote !== "`")
3747
+ if (ch === quote || ch === "\n" && quote !== "`") {
3746
3748
  quote = null;
3749
+ prev = ch === "\n" ? prev : ch;
3750
+ }
3747
3751
  i++;
3748
3752
  continue;
3749
3753
  }
3750
3754
  const next = code[i + 1];
3755
+ if (ch === "/" && next !== "*" && next !== "/" && i >= noRegexBefore && (prev === "" || REGEX_PRECEDER2.includes(prev))) {
3756
+ const end = regexLiteralEnd3(code, i);
3757
+ if (end > 0) {
3758
+ i = end;
3759
+ prev = "a";
3760
+ continue;
3761
+ }
3762
+ const eol = code.indexOf("\n", i);
3763
+ noRegexBefore = eol === -1 ? code.length : eol;
3764
+ }
3751
3765
  if (ch === "/" && next === "*") {
3752
3766
  const end = code.indexOf("*/", i + 2);
3753
3767
  const stop = end === -1 ? code.length : end + 2;
@@ -3766,11 +3780,39 @@ function stripCoverageComments(code) {
3766
3780
  }
3767
3781
  if (ch === '"' || ch === "'" || ch === "`")
3768
3782
  quote = ch;
3783
+ if (ch !== " " && ch !== " " && ch !== "\n" && ch !== "\r")
3784
+ prev = ch;
3769
3785
  i++;
3770
3786
  }
3771
3787
  out.push(code.slice(copyFrom));
3772
3788
  return out.join("");
3773
3789
  }
3790
+ function regexLiteralEnd3(code, start) {
3791
+ let inClass = false;
3792
+ for (let j = start + 1; j < code.length; j++) {
3793
+ const c = code[j];
3794
+ if (c === "\n")
3795
+ return -1;
3796
+ if (c === "\\") {
3797
+ j++;
3798
+ continue;
3799
+ }
3800
+ if (inClass) {
3801
+ if (c === "]")
3802
+ inClass = false;
3803
+ continue;
3804
+ }
3805
+ if (c === "[")
3806
+ inClass = true;
3807
+ else if (c === "/") {
3808
+ let k = j + 1;
3809
+ while (k < code.length && isIdentChar(code[k]))
3810
+ k++;
3811
+ return k;
3812
+ }
3813
+ }
3814
+ return -1;
3815
+ }
3774
3816
  function isIdentChar(ch) {
3775
3817
  if (!ch)
3776
3818
  return false;
@@ -4428,7 +4470,7 @@ function assessTitleCoverage(title, code) {
4428
4470
  const repeatedHit = [...repeated].some((term) => hay.includes(term));
4429
4471
  return { covered: hit >= needed || repeatedHit, missingTerms };
4430
4472
  }
4431
- var COVERAGE_STOP_WORDS, MAX_ASSERTION_JOIN_CHARS, MAX_COVERAGE_LINE_CHARS, BLOCK_SCAFFOLD, cachedAssertionInput, cachedAssertionSource, LOCAL_BINDING, ASSERTED_STATUS_RE, MAX_RESOLVED_NAMES_PER_LINE, WORD_CHAR_RE, NOT_CONTAIN_TEXT_RE, PLACE_PHRASE_RE, PLACE_WORD_MIN_CHARS, PLACE_FUNCTION_WORDS, HIDDEN_STATE_TERMS, HIDDEN_ELEMENT_LINE_RE, HIDDEN_LINE_RE, MAX_SHOWN_EARLIER_LINES, SHOWN_EARLIER_LITERAL_RE, SHARED_PREFIX_MIN_CHARS, MAX_SHOWN_EARLIER_LITERALS, VALUE_SHAPE_RE, VALUE_SHAPE_ALL_RE, TITLE_TERM_MIN;
4473
+ var COVERAGE_STOP_WORDS, MAX_ASSERTION_JOIN_CHARS, MAX_COVERAGE_LINE_CHARS, REGEX_PRECEDER2, BLOCK_SCAFFOLD, cachedAssertionInput, cachedAssertionSource, LOCAL_BINDING, ASSERTED_STATUS_RE, MAX_RESOLVED_NAMES_PER_LINE, WORD_CHAR_RE, NOT_CONTAIN_TEXT_RE, PLACE_PHRASE_RE, PLACE_WORD_MIN_CHARS, PLACE_FUNCTION_WORDS, HIDDEN_STATE_TERMS, HIDDEN_ELEMENT_LINE_RE, HIDDEN_LINE_RE, MAX_SHOWN_EARLIER_LINES, SHOWN_EARLIER_LITERAL_RE, SHARED_PREFIX_MIN_CHARS, MAX_SHOWN_EARLIER_LITERALS, VALUE_SHAPE_RE, VALUE_SHAPE_ALL_RE, TITLE_TERM_MIN;
4432
4474
  var init_expected_outcome_coverage = __esm({
4433
4475
  "../shared/dist/expected-outcome-coverage.js"() {
4434
4476
  "use strict";
@@ -4465,6 +4507,7 @@ var init_expected_outcome_coverage = __esm({
4465
4507
  ]);
4466
4508
  MAX_ASSERTION_JOIN_CHARS = 8e3;
4467
4509
  MAX_COVERAGE_LINE_CHARS = 2e3;
4510
+ REGEX_PRECEDER2 = "(,=:[!&|?{};+-*%<>~^";
4468
4511
  BLOCK_SCAFFOLD = /=>|\b(?:test|describe|it|beforeEach|afterEach|beforeAll|afterAll|function)\b/;
4469
4512
  cachedAssertionInput = null;
4470
4513
  cachedAssertionSource = { raw: "", normalized: "", bindings: /* @__PURE__ */ new Map(), bindingRefs: /* @__PURE__ */ new Map() };
@@ -4915,7 +4958,7 @@ function detectsErrorBannerAssertion(code) {
4915
4958
  const cleaned = stripCommentsAndLogs(stripLoginScaffolding(code));
4916
4959
  const lines = cleaned.split("\n");
4917
4960
  const candidates = [];
4918
- const positive = (stmt) => !NEGATED_ASSERT.test(stmt) && !ABSENCE_MATCHER.test(stmt);
4961
+ const positive = (stmt) => !claimsAbsence(stmt);
4919
4962
  const statements = liveExpectStatements(cleaned).map((s) => s.stmt);
4920
4963
  for (const stmt of statements) {
4921
4964
  if (positive(stmt))
@@ -5044,6 +5087,12 @@ function detectsObservedFailureAsExpected(code) {
5044
5087
  return FAILURE_STATUS_ASSERT.some((re) => re.test(stmt)) || hasFailedListener && FAILED_LIST_ASSERT.test(stmt);
5045
5088
  });
5046
5089
  }
5090
+ function claimsAbsence(stmt) {
5091
+ const negated = NEGATED_ASSERT_NOT.test(stmt);
5092
+ const bare = negated ? stmt.replace(NOT_BEFORE_MATCHER, ".") : stmt;
5093
+ const absenceMatcher = /\.toBeHidden\s*\(|\.toHaveCount\s*\(\s*0\s*\)/.test(bare) || VALUE_ABSENCE.test(bare) || OPTION_ABSENCE.test(bare);
5094
+ return negated !== absenceMatcher;
5095
+ }
5047
5096
  function isVacuousErrorAbsence(stmt, presence) {
5048
5097
  if (!ABSENCE_MATCHER.test(stmt))
5049
5098
  return false;
@@ -5059,19 +5108,53 @@ function isChromeTarget(stmt) {
5059
5108
  return CHROME_LOCATOR.test(stmt) && !CONTENT_ROLE.test(stmt) && !/getByText\s*\(/.test(stmt);
5060
5109
  }
5061
5110
  function countsAsContentText(stmt) {
5062
- if (!TEXT_CONTENT_MATCHER.test(stmt))
5111
+ if (!TEXT_CONTENT_MATCHER.test(stmt) || NEGATED_ASSERT.test(stmt))
5063
5112
  return false;
5064
5113
  if (isSymbolOnlyArgument(stmt, TEXT_CONTENT_MATCHER))
5065
5114
  return false;
5066
- if (!isChromeTarget(stmt))
5115
+ return onContentTarget(stmt);
5116
+ }
5117
+ function onContentTarget(stmt) {
5118
+ return !isChromeTarget(stmt) || /getByRole\s*\(\s*['"`]main['"`]/i.test(stmt);
5119
+ }
5120
+ function provesTextRemoved(stmt, presence) {
5121
+ const m = stmt.match(NEGATED_TEXT);
5122
+ if (!m || !onContentTarget(stmt))
5123
+ return false;
5124
+ const text = m[1] ?? m[2];
5125
+ if (text === void 0)
5067
5126
  return true;
5068
- return /getByRole\s*\(\s*['"`]main['"`]/i.test(stmt);
5127
+ if (!/[\p{L}\p{N}]/u.test(text))
5128
+ return false;
5129
+ return !ERROR_TEXT_WORDS.test(text) || presence().includes(text);
5069
5130
  }
5070
5131
  function isDataContentRole(stmt) {
5071
5132
  return CONTENT_ROLE.test(stmt) && !ANNOUNCE_ROLE.test(stmt);
5072
5133
  }
5134
+ function destructuresRequest(code) {
5135
+ let readTo = -1;
5136
+ for (const m of code.matchAll(ASYNC_DESTRUCTURE_OPEN)) {
5137
+ const start = m.index + m[0].length;
5138
+ if (start <= readTo)
5139
+ continue;
5140
+ let end = start;
5141
+ while (end < code.length && code[end] !== "}" && code[end] !== ")")
5142
+ end++;
5143
+ readTo = end;
5144
+ if (end === code.length)
5145
+ return false;
5146
+ if (code[end] !== "}" || !REQUEST_WORD.test(code.slice(start, end)))
5147
+ continue;
5148
+ let close = end + 1;
5149
+ while (close < code.length && /\s/.test(code[close]))
5150
+ close++;
5151
+ if (code[close] === ")")
5152
+ return true;
5153
+ }
5154
+ return false;
5155
+ }
5073
5156
  function isApiTest(code) {
5074
- const usesRequestFixture = /async\s*\(\s*\{[^})]*\brequest\b[^})]*\}\s*\)/.test(code) || /\brequest\.(get|post|put|patch|delete|head|fetch)\s*\(/.test(code);
5157
+ const usesRequestFixture = destructuresRequest(code) || /\brequest\.(get|post|put|patch|delete|head|fetch)\s*\(/.test(code);
5075
5158
  if (!usesRequestFixture)
5076
5159
  return false;
5077
5160
  const drivesUi = /\bpage\.(getBy\w+|locator|click|fill|goto|waitForURL|reload)\s*\(/.test(code) || /\.(click|fill|check|uncheck|selectOption|pressSequentially)\s*\(/.test(code);
@@ -5330,6 +5413,9 @@ function hasOnlyConstantAssertions(code) {
5330
5413
  const { constant, real } = constantAssertions(code);
5331
5414
  return constant.length > 0 && real === 0;
5332
5415
  }
5416
+ function envValueKey(name) {
5417
+ return `\0env:${name}`;
5418
+ }
5333
5419
  function enteredValues(stmts) {
5334
5420
  const values = /* @__PURE__ */ new Map();
5335
5421
  const navLines = [];
@@ -5338,24 +5424,55 @@ function enteredValues(stmts) {
5338
5424
  navLines.push(startLine);
5339
5425
  let m;
5340
5426
  ENTERED_VALUE.lastIndex = 0;
5341
- while (m = ENTERED_VALUE.exec(stmt)) {
5342
- const value = (m[1] ?? m[2] ?? m[3]).toLowerCase();
5343
- if (!values.has(value))
5344
- values.set(value, startLine);
5345
- }
5427
+ const add = (value) => {
5428
+ const lines = values.get(value);
5429
+ if (!lines)
5430
+ values.set(value, [startLine]);
5431
+ else if (lines[lines.length - 1] !== startLine)
5432
+ lines.push(startLine);
5433
+ };
5434
+ while (m = ENTERED_VALUE.exec(stmt))
5435
+ add((m[1] ?? m[2] ?? m[3]).toLowerCase());
5436
+ ENTERED_ENV.lastIndex = 0;
5437
+ while (m = ENTERED_ENV.exec(stmt))
5438
+ add(envValueKey(m[1] ?? m[2] ?? m[3] ?? m[4]));
5346
5439
  }
5347
5440
  return { values, navLines };
5348
5441
  }
5349
- function isEnteredValueEcho(stmt, entered, startLine) {
5442
+ function countBelow(lines, line) {
5443
+ let lo = 0;
5444
+ let hi = lines.length;
5445
+ while (lo < hi) {
5446
+ const mid = lo + hi >> 1;
5447
+ if (lines[mid] < line)
5448
+ lo = mid + 1;
5449
+ else
5450
+ hi = mid;
5451
+ }
5452
+ return lo;
5453
+ }
5454
+ function enteredLinesOf(stmt, entered) {
5350
5455
  const m = stmt.match(/\.toHaveValue\s*\(\s*(['"`])((?:(?!\1).)+)\1/);
5351
- if (!m)
5456
+ if (m)
5457
+ return entered.values.get(m[2].toLowerCase());
5458
+ const env = stmt.match(HAVE_VALUE_ENV);
5459
+ return env ? entered.values.get(envValueKey(env[1] ?? env[2])) : void 0;
5460
+ }
5461
+ function typedSinceLastNav(stmt, entered, startLine, lines = enteredLinesOf(stmt, entered)) {
5462
+ if (!lines || startLine === void 0)
5352
5463
  return false;
5353
- const enteredAt = entered.values.get(m[2].toLowerCase());
5354
- if (enteredAt === void 0)
5464
+ const before = countBelow(lines, startLine);
5465
+ if (before === 0)
5355
5466
  return false;
5356
- if (startLine === void 0)
5467
+ return countBelow(entered.navLines, startLine) === countBelow(entered.navLines, lines[before - 1] + 1);
5468
+ }
5469
+ function isEnteredValueEcho(stmt, entered, startLine) {
5470
+ const lines = enteredLinesOf(stmt, entered);
5471
+ if (!lines)
5472
+ return false;
5473
+ if (startLine === void 0 || lines[0] >= startLine)
5357
5474
  return true;
5358
- return !entered.navLines.some((n) => n > enteredAt && n < startLine);
5475
+ return typedSinceLastNav(stmt, entered, startLine, lines);
5359
5476
  }
5360
5477
  function isAnyValueMatcher(stmt) {
5361
5478
  if (/\.not\.toHaveValue\s*\(\s*(?:['"`]{2}|\/\^?\$?\/)/.test(stmt))
@@ -5445,6 +5562,43 @@ function hasAttributeTransition(stmts) {
5445
5562
  return true;
5446
5563
  return false;
5447
5564
  }
5565
+ function comparesWithItself(subject, tail) {
5566
+ const m = SELF_COMPARE_MATCHER.exec(tail);
5567
+ if (!m)
5568
+ return false;
5569
+ const args = balancedArguments(tail, m[0].length, MATCHER_ARGS_MAX);
5570
+ if (args === null)
5571
+ return false;
5572
+ const squash2 = (x) => x.replace(/^\s*await\s+/, "").replace(/\s+/g, "");
5573
+ const expected = squash2(args);
5574
+ return expected === squash2(m[1] === "toHaveCount" ? `${subject}.count()` : subject);
5575
+ }
5576
+ function asPlainAssertion(s) {
5577
+ const { stmt } = s;
5578
+ if (COUNT_AT_LEAST_ZERO.test(stmt))
5579
+ return [];
5580
+ const subject = extractExpectSubject(stmt);
5581
+ if (subject === null)
5582
+ return [s];
5583
+ const plain = subject.replace(/^await\s+/, "").trim();
5584
+ const subjectAt = stmt.indexOf(subject, stmt.search(EXPECT_CALL_RE));
5585
+ const tail = stmt.slice(subjectAt + subject.length).trimStart();
5586
+ const as = (rewritten) => [{ ...s, stmt: rewritten }];
5587
+ if (LOCATOR_EXPR.test(plain) && !LOCATOR_VALUE_READ.test(plain) && ALWAYS_TRUE_ON_OBJECT.test(tail))
5588
+ return [];
5589
+ if (DEFINED_VALUE_READ.test(plain) && ALWAYS_DEFINED.test(tail))
5590
+ return [];
5591
+ if (comparesWithItself(plain, tail))
5592
+ return [];
5593
+ const visible = /^(.+)\.\s*isVisible\s*\(\s*\)$/s.exec(plain);
5594
+ if (visible && IS_VISIBLE_TRUE.test(tail))
5595
+ return as(`await expect(${visible[1]}).toBeVisible();`);
5596
+ if (/^page\s*\.\s*(?:url|title)\s*\(\s*\)$/.test(plain) && PAGE_VALUE_MATCHER.test(tail)) {
5597
+ const matcher = plain.includes("url") ? "toHaveURL" : "toHaveTitle";
5598
+ return as(`await expect(page)${tail.replace(/^\)\s*\.\s*\w+\s*\(/, `.${matcher}(`)}`);
5599
+ }
5600
+ return [s];
5601
+ }
5448
5602
  function creditsOutcomeAlways(stmt, entered, startLine) {
5449
5603
  if (!OUTCOME_ALWAYS.some((re) => re.test(stmt)))
5450
5604
  return false;
@@ -5518,6 +5672,8 @@ function classifyOutcomeProof(stmts, mutated, reloaded, clicked, entered, firstM
5518
5672
  continue;
5519
5673
  if (isVacuousErrorAbsence(stmt, presence))
5520
5674
  continue;
5675
+ if (COUNT_ONE.test(stmt) && quotedAssertedStrings(stmt).some((t) => clicked.has(t.toLowerCase())))
5676
+ continue;
5521
5677
  if (creditsOutcomeAlways(stmt, entered, startLine))
5522
5678
  return { kind: "durable" };
5523
5679
  if (mutated && !NEGATED_ASSERT.test(stmt) && MESSAGE_SURFACE.test(stmt) && OUTCOME_TEXT.test(assertedText(stmt))) {
@@ -5527,12 +5683,15 @@ function classifyOutcomeProof(stmts, mutated, reloaded, clicked, entered, firstM
5527
5683
  else
5528
5684
  return { kind: "durable" };
5529
5685
  }
5530
- if (STATE_MATCHER.test(stmt) && (persistence && startLine !== void 0 ? reopenedAfterSave(startLine, persistence, persistence.reloadCalls) : reloaded))
5686
+ const retyped = typedSinceLastNav(stmt, entered, startLine);
5687
+ if (!retyped && STATE_MATCHER.test(stmt) && (persistence && startLine !== void 0 ? reopenedAfterSave(startLine, persistence, persistence.reloadCalls) : reloaded))
5531
5688
  return { kind: "durable" };
5532
- if (provesStoredControlValue(stmt, startLine, persistence))
5689
+ if (!retyped && provesStoredControlValue(stmt, startLine, persistence))
5533
5690
  return { kind: "durable" };
5534
5691
  if (countsAsContentText(stmt))
5535
5692
  return { kind: "durable" };
5693
+ if (provesTextRemoved(stmt, presence))
5694
+ return { kind: "durable" };
5536
5695
  if (mutated && VISIBILITY_MATCHER.test(stmt)) {
5537
5696
  const revealsText = GET_BY_TEXT.test(stmt) || HAS_TEXT_FILTER.test(stmt) || CONTENT_ROLE.test(stmt);
5538
5697
  if (revealsText && !isChromeTarget(stmt)) {
@@ -5599,7 +5758,7 @@ function detectOutcomeProof(stmts, mutated, reloaded, clicked, entered, firstMut
5599
5758
  function validateAssertionStrength(code, opts = {}) {
5600
5759
  const body = stripLoginScaffolding(code);
5601
5760
  const lines = body.split("\n");
5602
- const stmts = liveExpectStatements(stripCoverageComments(body));
5761
+ const stmts = liveExpectStatements(stripCoverageComments(body)).flatMap(asPlainAssertion);
5603
5762
  const base = (extra) => ({
5604
5763
  apiTest: false,
5605
5764
  interacted: false,
@@ -5805,7 +5964,7 @@ function validateAssertionStrength(code, opts = {}) {
5805
5964
  signals
5806
5965
  };
5807
5966
  }
5808
- var ERROR_BANNER, OUTCOME_ALWAYS, FORM_INPUT, ANY_CLICK, NAV_LOCATOR, URL_PROOF, RELOAD, EXPECT_STMT, BLOCK_SCAFFOLD2, TEST_BLOCK_OPEN, LOCATOR_BINDING, EXPECT_OPEN, STATE_MATCHER, CHROME_LOCATOR, CONTENT_ROLE, GET_BY_TEXT, BARE_CONTAINER_ROLE, HAS_TEXT_FILTER, OUTCOME_TEXT, SUCCESS_NOTICE_TEXT, NOT_A_SUCCESS_NOTICE, ANNOUNCE_ROLE, MESSAGE_SURFACE, TEXT_CONTENT_MATCHER, VISIBILITY_MATCHER, ADDITIVE_AFFORDANCE, EXCLUDE_AFFORDANCE, EMPTY_STATE_TEXT, AUTH_START, AUTH_END, LOGIN_CALL_LINE, INBOX_START, INBOX_END, NEGATED_ASSERT, CONST_CHAIN_MAX_DEPTH, TYPED_INPUT, TITLE_LINE, FAILURE_STATUS_ASSERT, FAILED_LIST_ASSERT, ENDPOINT_DOWN, NAVIGATION_RESPONSE_VAR, DIRECT_REQUEST_VAR, CATCH_ALL_PATTERN, GUARD_HANDLER, ABSENCE_MATCHER, ERROR_TEXT_WORDS, TEXT_REGEX_ARG, ROLE_NAME_RE, INTERACT_VERB, ROLE_SIG_RE, TRANSIENT_CONTROL_ROLES, POLL_CALLBACK, CONSTANT_WORD, CONSTANT_GLUE_CHARS, WORD_CHAR, MATCHER_ARGS_MAX, MATCHER_OPEN, ENTERED_VALUE, PAGE_NAV, IN_FLIGHT_TEXT, FORM_CONTROL_LOCATOR, CONTROL_VALUE_MATCHER, COPY_CONTROL, COPIED_NOTICE, SEND_CONTROL, SEND_NOTICE, MARK_READ_CONTROL, APP_DATA_FIELD;
5967
+ var ERROR_BANNER, OUTCOME_ALWAYS, FORM_INPUT, ANY_CLICK, NAV_LOCATOR, URL_PROOF, RELOAD, EXPECT_STMT, BLOCK_SCAFFOLD2, TEST_BLOCK_OPEN, LOCATOR_BINDING, EXPECT_OPEN, STATE_MATCHER, CHROME_LOCATOR, CONTENT_ROLE, GET_BY_TEXT, BARE_CONTAINER_ROLE, HAS_TEXT_FILTER, OUTCOME_TEXT, SUCCESS_NOTICE_TEXT, NOT_A_SUCCESS_NOTICE, ANNOUNCE_ROLE, MESSAGE_SURFACE, TEXT_CONTENT_MATCHER, VISIBILITY_MATCHER, ADDITIVE_AFFORDANCE, EXCLUDE_AFFORDANCE, EMPTY_STATE_TEXT, AUTH_START, AUTH_END, LOGIN_CALL_LINE, INBOX_START, INBOX_END, NEGATED_ASSERT, NEGATED_ASSERT_NOT, CONST_CHAIN_MAX_DEPTH, TYPED_INPUT, TITLE_LINE, FAILURE_STATUS_ASSERT, FAILED_LIST_ASSERT, ENDPOINT_DOWN, NAVIGATION_RESPONSE_VAR, DIRECT_REQUEST_VAR, CATCH_ALL_PATTERN, GUARD_HANDLER, ABSENCE_MATCHER, VALUE_ABSENCE, OPTION_ABSENCE, NOT_BEFORE_MATCHER, ERROR_TEXT_WORDS, TEXT_REGEX_ARG, NEGATED_TEXT, ASYNC_DESTRUCTURE_OPEN, REQUEST_WORD, ROLE_NAME_RE, INTERACT_VERB, ROLE_SIG_RE, TRANSIENT_CONTROL_ROLES, POLL_CALLBACK, CONSTANT_WORD, CONSTANT_GLUE_CHARS, WORD_CHAR, MATCHER_ARGS_MAX, MATCHER_OPEN, ENTERED_VALUE, PAGE_NAV, ENV_READ, ENTERED_ENV, HAVE_VALUE_ENV, IN_FLIGHT_TEXT, LOCATOR_VALUE_READ, LOCATOR_EXPR, ALWAYS_TRUE_ON_OBJECT, COUNT_AT_LEAST_ZERO, DEFINED_VALUE_READ, ALWAYS_DEFINED, SELF_COMPARE_MATCHER, IS_VISIBLE_TRUE, PAGE_VALUE_MATCHER, COUNT_ONE, FORM_CONTROL_LOCATOR, CONTROL_VALUE_MATCHER, COPY_CONTROL, COPIED_NOTICE, SEND_CONTROL, SEND_NOTICE, MARK_READ_CONTROL, APP_DATA_FIELD;
5809
5968
  var init_assertion_strength = __esm({
5810
5969
  "../shared/dist/assertion-strength.js"() {
5811
5970
  "use strict";
@@ -5830,8 +5989,8 @@ var init_assertion_strength = __esm({
5830
5989
  // form field value
5831
5990
  /\.toMatch\s*\(/,
5832
5991
  // string/regex content match (e.g. textContent() vs /[2-9] selected/)
5833
- /\.toBeDisabled\s*\(/,
5834
- // a control became DISABLED — a gating/validation outcome
5992
+ /(?<!\.not\s*)\.\s*toBeDisabled\s*\(/,
5993
+ // a control became DISABLED — a gating/validation outcome (not.toBeDisabled is the toBeEnabled twin)
5835
5994
  /\.not\.toBeVisible\s*\(/,
5836
5995
  /\.toBeHidden\s*\(/
5837
5996
  // something the action removed/closed (disappearance proof)
@@ -5839,7 +5998,7 @@ var init_assertion_strength = __esm({
5839
5998
  FORM_INPUT = /\.(fill|selectOption|setInputFiles|check|uncheck|setChecked|pressSequentially)\s*\(|keyboard\.type\s*\(/;
5840
5999
  ANY_CLICK = /\.click\s*\(/;
5841
6000
  NAV_LOCATOR = /getByRole\s*\(\s*['"`](?:link|menuitem)['"`]/i;
5842
- URL_PROOF = /\.toHaveURL\s*\(|\.waitForURL\s*\(/;
6001
+ URL_PROOF = /\.toHaveURL\s*\(|\.waitForURL\s*\(|\bexpect\s*\(\s*(?:await\s+)?page\s*\.\s*url\s*\(\s*\)\s*\)|\bexpect\s*\.\s*poll\s*\(\s*(?:async\s*)?\(\s*\)\s*=>\s*(?:\{\s*return\s+)?page\s*\.\s*url\s*\(\s*\)/;
5843
6002
  RELOAD = /\.reload\s*\(/;
5844
6003
  EXPECT_STMT = /\bexpect\s*[.(]/;
5845
6004
  BLOCK_SCAFFOLD2 = /=>|\b(?:test|describe|it|beforeEach|afterEach|beforeAll|afterAll|function)\b/;
@@ -5868,6 +6027,7 @@ var init_assertion_strength = __esm({
5868
6027
  INBOX_START = /^\s*\/\/\s*>>>\s*VALIDATE_QA_INBOX/;
5869
6028
  INBOX_END = /^\s*\/\/\s*<<<\s*VALIDATE_QA_INBOX/;
5870
6029
  NEGATED_ASSERT = /\.not\s*\.\s*to[A-Z]\w*|\.toBeHidden\s*\(/;
6030
+ NEGATED_ASSERT_NOT = /\.not\s*\.\s*to[A-Z]/;
5871
6031
  CONST_CHAIN_MAX_DEPTH = 5;
5872
6032
  TYPED_INPUT = /\.(fill|type|pressSequentially|setInputFiles)\s*\(/;
5873
6033
  TITLE_LINE = /^\s*(?:test|describe)(?:\.\w+)?\s*\(/;
@@ -5883,8 +6043,14 @@ var init_assertion_strength = __esm({
5883
6043
  CATCH_ALL_PATTERN = /^(['"`])\*\*(?:\/\*)?\1$|^\/\.\*\/[a-z]*$/;
5884
6044
  GUARD_HANDLER = /\bMUTATING\.has\s*\(|blockedbyclient|Read-only guard/;
5885
6045
  ABSENCE_MATCHER = /\.not\.toBeVisible\s*\(|\.toBeHidden\s*\(|\.toHaveCount\s*\(\s*0\s*\)/;
6046
+ VALUE_ABSENCE = /\.(?:count\s*\(\s*\)[\s)]{0,10}\.(?:(?:toBe|toEqual|toStrictEqual)\s*\(\s*0\s*\)|toBeLessThan\s*\(\s*1\s*\))|isVisible\s*\(\s*\)[\s)]{0,10}\.(?:(?:toBe|toEqual|toStrictEqual)\s*\(\s*false\s*\)|toBeFalsy\s*\()|isHidden\s*\(\s*\)[\s)]{0,10}\.(?:(?:toBe|toEqual|toStrictEqual)\s*\(\s*true\s*\)|toBeTruthy\s*\())/;
6047
+ OPTION_ABSENCE = /\.(?:toBeVisible\s*\(\s*\{[^{}()]{0,200}\bvisible|toBeAttached\s*\(\s*\{[^{}()]{0,200}\battached)\s*:\s*false\b/;
6048
+ NOT_BEFORE_MATCHER = /\.not\s*\.\s*(?=to[A-Z])/g;
5886
6049
  ERROR_TEXT_WORDS = /error|fail|wrong|try again|unable|could ?n.?t|can.?t|problem|invalid|unavailable/i;
5887
6050
  TEXT_REGEX_ARG = /(?:getByText|hasText|getByRole\([^)]{0,200}name)\s*[:(]\s*(\/(?:\\.|[^/\\\n])+\/[a-z]*)/;
6051
+ NEGATED_TEXT = /\.not\s*\.\s*(?:toHaveText|toContainText)\s*\(\s*(?:['"`]([^'"`]*)['"`]|\/((?:\\.|[^/\\\n])+)\/)?/;
6052
+ ASYNC_DESTRUCTURE_OPEN = /async\s*\(\s*\{/g;
6053
+ REQUEST_WORD = /\brequest\b/;
5888
6054
  ROLE_NAME_RE = /getByRole\s*\(\s*['"`][a-z]+['"`]\s*,\s*\{[^}]*?name\s*:\s*(?:['"`]([^'"`]+)['"`]|\/([^/]+)\/)/gi;
5889
6055
  INTERACT_VERB = /\.(click|fill|check|uncheck|setChecked|selectOption|pressSequentially)\s*\(/;
5890
6056
  ROLE_SIG_RE = /getByRole\s*\(\s*['"`]([a-z]+)['"`]\s*,\s*\{[^}]*?name\s*:\s*(?:['"`]([^'"`]+)['"`]|\/([^/]+)\/)/gi;
@@ -5905,7 +6071,20 @@ var init_assertion_strength = __esm({
5905
6071
  MATCHER_OPEN = /\s*(?:\.\s*(?:not|resolves|rejects)\s*)*\.\s*[A-Za-z_$][\w$]*\s*\(/y;
5906
6072
  ENTERED_VALUE = /\.(?:fill|pressSequentially)\s*\(\s*['"`]([^'"`]+)['"`]|keyboard\.type\s*\(\s*['"`]([^'"`]+)['"`]|\.selectOption\s*\(\s*(?:\[\s*)?(?:\{\s*(?:label|value)\s*:\s*)?['"`]([^'"`]+)['"`]/g;
5907
6073
  PAGE_NAV = /\.(?:goto|reload)\s*\(/;
6074
+ ENV_READ = String.raw`process\.env(?:(?:\?\.|\.)([A-Za-z_]\w*)|(?:\?\.)?\[\s*['"]([A-Za-z_]\w*)['"]\s*\])`;
6075
+ ENTERED_ENV = new RegExp(String.raw`\.(?:fill|pressSequentially)\s*\(\s*${ENV_READ}|keyboard\.type\s*\(\s*${ENV_READ}`, "g");
6076
+ HAVE_VALUE_ENV = new RegExp(String.raw`\.toHaveValue\s*\(\s*${ENV_READ}`);
5908
6077
  IN_FLIGHT_TEXT = /^(?:(?:sending|saving|loading|searching|checking|processing|submitting|preparing|updating|please wait|working|one moment)\b[^.]{0,40}\.{2,3}|\.{3}|…)$/i;
6078
+ LOCATOR_VALUE_READ = /\.(?:count|textContent|innerText|innerHTML|inputValue|getAttribute|isVisible|isHidden|isChecked|isEnabled|isDisabled|isEditable|allTextContents|allInnerTexts|evaluate|evaluateAll|boundingBox|all)\s*\(/;
6079
+ LOCATOR_EXPR = /^(?:this\.)?page\s*\.\s*(?:getBy\w+|locator)\s*\(/;
6080
+ ALWAYS_TRUE_ON_OBJECT = /^\)\s*\.\s*(?:toBeTruthy|toBeDefined|not\s*\.\s*(?:toBeNull|toBeUndefined|toBeFalsy))\s*\(/;
6081
+ COUNT_AT_LEAST_ZERO = /\.(?:count\s*\(\s*\)|length)[\s)]{0,10}\.(?:toBeGreaterThanOrEqual\s*\(\s*0\s*\)|toBeGreaterThan\s*\(\s*-\s*1\s*\))/;
6082
+ DEFINED_VALUE_READ = /\.\s*(?:count|textContent|innerText|innerHTML|inputValue|getAttribute|title|url|isVisible|isHidden|isChecked|isEnabled|isDisabled|isEditable|allTextContents|allInnerTexts)\s*\([^()]*\)$/;
6083
+ ALWAYS_DEFINED = /^\)\s*\.\s*(?:toBeDefined|not\s*\.\s*toBeUndefined)\s*\(/;
6084
+ SELF_COMPARE_MATCHER = /^\)\s*\.\s*(toBe|toEqual|toStrictEqual|toHaveCount)\s*\(/;
6085
+ IS_VISIBLE_TRUE = /^\)*\s*\.\s*(?:toBe\s*\(\s*true\s*\)|toBeTruthy\s*\(\s*\))/;
6086
+ PAGE_VALUE_MATCHER = /^\)\s*\.\s*(?:toBe|toEqual|toStrictEqual|toMatch|toContain)\s*\(/;
6087
+ COUNT_ONE = /\.\s*toHaveCount\s*\(\s*1\s*\)/;
5909
6088
  FORM_CONTROL_LOCATOR = /getByRole\s*\(\s*['"`](?:combobox|switch|checkbox|radio|textbox|searchbox|spinbutton|slider)['"`]|getByLabel\s*\(|getByPlaceholder\s*\(/;
5910
6089
  CONTROL_VALUE_MATCHER = /\.(?:toHaveValue|toHaveText|toContainText)\s*\(|\.toHaveAttribute\s*\(\s*['"`]aria-checked['"`]/;
5911
6090
  COPY_CONTROL = /\bcopy\b/i;
@@ -6114,7 +6293,7 @@ function reportedBugWhere() {
6114
6293
  function bugReviewStatus(status) {
6115
6294
  return status === "QUARANTINED" ? "confirmed" : "needs-review";
6116
6295
  }
6117
- var USER_CANCELLED_RUN_ERROR, HEAL_PATCH_HELD_RUN_ERROR_PREFIX, RUNNER_INTERRUPT_ERROR_PREFIX, SERVER_INTERRUPT_ERROR_PREFIX, RUN_LOST_ERROR_PREFIX, RUN_INTERRUPTED_ERROR_PREFIXES, RUN_INTERRUPTION_RETRIED_MARKER, RUN_INTERRUPTION_NOT_RETRIED_MARKERS, BUG_ASSERTION_TAG, UNEXPECTED_PASS_ERROR_PREFIX, BUG_TEST_BROKEN_ERROR_PREFIX, BUG_TEST_BROKEN_REASON, EMAIL_NOT_RECEIVED_PREFIXES, ENVIRONMENTAL_ERROR_PREFIXES, ENVIRONMENTAL_ERROR_STORED_PREFIXES, BUG_SURFACE_SUPPRESSING_TAGS, QUARANTINE_CLOSE_TAGS, BUG_CANDIDATE_TAG, BUG_TEST_BROKEN_TAG;
6296
+ var USER_CANCELLED_RUN_ERROR, HEAL_PATCH_HELD_RUN_ERROR_PREFIX, RUNNER_INTERRUPT_ERROR_PREFIX, SERVER_INTERRUPT_ERROR_PREFIX, RUN_LOST_ERROR_PREFIX, RUN_INTERRUPTED_ERROR_PREFIXES, RUN_INTERRUPTION_RETRIED_MARKER, RUN_INTERRUPTION_NOT_RETRIED_MARKERS, BUG_ASSERTION_TAG, UNEXPECTED_PASS_ERROR_PREFIX, BUG_TEST_BROKEN_ERROR_PREFIX, BUG_TEST_BROKEN_REASON, TEST_DID_NOT_RUN_ERROR, EMAIL_NOT_RECEIVED_PREFIXES, ENVIRONMENTAL_ERROR_PREFIXES, ENVIRONMENTAL_ERROR_STORED_PREFIXES, BUG_SURFACE_SUPPRESSING_TAGS, QUARANTINE_CLOSE_TAGS, BUG_CANDIDATE_TAG, BUG_TEST_BROKEN_TAG;
6118
6297
  var init_run_classification = __esm({
6119
6298
  "../shared/dist/run-classification.js"() {
6120
6299
  "use strict";
@@ -6134,6 +6313,7 @@ var init_run_classification = __esm({
6134
6313
  UNEXPECTED_PASS_ERROR_PREFIX = "UNEXPECTED_PASS:";
6135
6314
  BUG_TEST_BROKEN_ERROR_PREFIX = "BUG_TEST_BROKEN:";
6136
6315
  BUG_TEST_BROKEN_REASON = "bug test broken (not a bug verdict)";
6316
+ TEST_DID_NOT_RUN_ERROR = "Test did not run (a dependency failed or the run was interrupted)";
6137
6317
  EMAIL_NOT_RECEIVED_PREFIXES = [
6138
6318
  "VERIFICATION_EMAIL_NOT_RECEIVED:",
6139
6319
  "VERIFICATION_EMAIL_HAS_NO_CODE:",
@@ -8875,6 +9055,23 @@ var init_auth_block_detector = __esm({
8875
9055
  }
8876
9056
  });
8877
9057
 
9058
+ // ../shared/dist/auth-session-stamp.js
9059
+ function parseAuthSessionStamp(value) {
9060
+ if (!value || typeof value !== "object" || Array.isArray(value))
9061
+ return null;
9062
+ const { shared, role, generation } = value;
9063
+ if (shared !== true || role !== "producer" && role !== "follower")
9064
+ return null;
9065
+ return typeof generation === "string" && AUTH_SESSION_GENERATION_RE.test(generation) ? { shared: true, role, generation } : { shared: true, role };
9066
+ }
9067
+ var AUTH_SESSION_GENERATION_RE;
9068
+ var init_auth_session_stamp = __esm({
9069
+ "../shared/dist/auth-session-stamp.js"() {
9070
+ "use strict";
9071
+ AUTH_SESSION_GENERATION_RE = /^[0-9a-z]{1,16}$/;
9072
+ }
9073
+ });
9074
+
8878
9075
  // ../shared/dist/auth-state-freshness.js
8879
9076
  function isCsrfTokenName(name) {
8880
9077
  return /csrf|xsrf|forgery|authenticity|requestverification/.test(name.toLowerCase());
@@ -10103,7 +10300,7 @@ var init_agentic_cli_runtime = __esm({
10103
10300
  GROK_CLI_DEFAULT_MODEL = "grok-4.7";
10104
10301
  GROK_CLI_DEFAULT_REASONING_EFFORT = "high";
10105
10302
  CLAUDE_CLI_DEFAULT_MODEL = "claude-sonnet-5-5";
10106
- CLAUDE_CLI_DEFAULT_EFFORT = "max";
10303
+ CLAUDE_CLI_DEFAULT_EFFORT = "high";
10107
10304
  MUSE_CLI_DEFAULT_MODEL = "muse-spark-1.3-contributor";
10108
10305
  MUSE_CLI_DEFAULT_EFFORT = "high";
10109
10306
  CODEX_CLI_DEFAULT_MODEL = "gpt-6.1-sol";
@@ -10154,9 +10351,25 @@ function isOpenCodeGoModelId(id) {
10154
10351
  function hasOpenCodeGoPrefix(id) {
10155
10352
  return (id?.trim() ?? "").startsWith(OPENCODE_GO_PREFIX);
10156
10353
  }
10354
+ function hasOpenCodeGo2Prefix(id) {
10355
+ return (id?.trim() ?? "").startsWith(OPENCODE_GO_2_PREFIX);
10356
+ }
10157
10357
  function openCodeGoWireModel(id) {
10158
10358
  const trimmed = id?.trim() ?? "";
10159
- return isOpenCodeGoModelId(trimmed) ? trimmed.slice(OPENCODE_GO_PREFIX.length) : null;
10359
+ if (!isOpenCodeGoModelId(trimmed))
10360
+ return null;
10361
+ return trimmed.slice((hasOpenCodeGo2Prefix(trimmed) ? OPENCODE_GO_2_PREFIX : OPENCODE_GO_PREFIX).length);
10362
+ }
10363
+ function isZaiModelId(id) {
10364
+ const trimmed = id?.trim() ?? "";
10365
+ return ZAI_MODEL_PATTERN.test(trimmed) && !trimmed.includes("..");
10366
+ }
10367
+ function hasZaiPrefix(id) {
10368
+ return (id?.trim() ?? "").startsWith(ZAI_PREFIX);
10369
+ }
10370
+ function zaiWireModel(id) {
10371
+ const trimmed = id?.trim() ?? "";
10372
+ return isZaiModelId(trimmed) ? trimmed.slice(ZAI_PREFIX.length) : null;
10160
10373
  }
10161
10374
  function isEngineId(value) {
10162
10375
  return CLI_ENGINE_MODEL_IDS.includes(value);
@@ -10254,7 +10467,7 @@ function museCliContributorMode(env = process.env) {
10254
10467
  const raw = (env.MUSE_CLI_CONTRIBUTOR_MODE ?? "").trim().toLowerCase();
10255
10468
  return raw === "off" || raw === "false" || raw === "0" || raw === "no" ? "off" : "on";
10256
10469
  }
10257
- var CLI_ENGINE_MODEL_IDS, BROWSER_CLI_ENGINE_IDS, PIPELINE_STEPS, CLI_ENGINE_RULES, ENGINE_NAMES, OPENROUTER_PREFIX, OPENROUTER_MODEL_PATTERN, OPENCODE_GO_PREFIX, OPENCODE_GO_MODEL_PATTERN;
10470
+ var CLI_ENGINE_MODEL_IDS, BROWSER_CLI_ENGINE_IDS, PIPELINE_STEPS, CLI_ENGINE_RULES, ENGINE_NAMES, OPENROUTER_PREFIX, OPENROUTER_MODEL_PATTERN, OPENCODE_GO_PREFIX, OPENCODE_GO_2_PREFIX, OPENCODE_GO_MODEL_PATTERN, ZAI_PREFIX, ZAI_MODEL_PATTERN;
10258
10471
  var init_engine_spec = __esm({
10259
10472
  "../shared/dist/engine-spec.js"() {
10260
10473
  "use strict";
@@ -10313,7 +10526,10 @@ var init_engine_spec = __esm({
10313
10526
  OPENROUTER_PREFIX = "openrouter:";
10314
10527
  OPENROUTER_MODEL_PATTERN = /^openrouter:[a-z0-9][a-z0-9._-]{0,40}\/[A-Za-z0-9._:-]{1,100}$/;
10315
10528
  OPENCODE_GO_PREFIX = "opencode-go:";
10316
- OPENCODE_GO_MODEL_PATTERN = /^opencode-go:[a-z0-9][a-z0-9._-]{0,100}$/;
10529
+ OPENCODE_GO_2_PREFIX = "opencode-go-2:";
10530
+ OPENCODE_GO_MODEL_PATTERN = /^opencode-go(?:-2)?:[a-z0-9][a-z0-9._-]{0,100}$/;
10531
+ ZAI_PREFIX = "zai:";
10532
+ ZAI_MODEL_PATTERN = /^zai:glm-[a-z0-9][a-z0-9._-]{0,60}$/;
10317
10533
  }
10318
10534
  });
10319
10535
 
@@ -10598,6 +10814,8 @@ var init_api_model_catalog = __esm({
10598
10814
  authCaptureModel: "Login capture",
10599
10815
  plannerModel: "Scenario Planner",
10600
10816
  plannerGateModel: "Planner Gate",
10817
+ pwAgentsHealerModel: "Test Healer (Playwright agents)",
10818
+ pwAgentsReviewModel: "Plan Review (Playwright agents)",
10601
10819
  generationModel: "Code Generation",
10602
10820
  reviewModel: "Code Review",
10603
10821
  apiTestModel: "API Test Generator",
@@ -10622,11 +10840,6 @@ var init_api_model_catalog = __esm({
10622
10840
  });
10623
10841
 
10624
10842
  // ../shared/dist/provider-chains.js
10625
- function isClaudeModel(id) {
10626
- if (/claude|anthropic/i.test(id))
10627
- return true;
10628
- return API_MODEL_CATALOG.some((m) => m.provider === "anthropic" && (m.id === id || m.apiModel === id));
10629
- }
10630
10843
  function chainKey(modelId) {
10631
10844
  const id = canonicalModelId(modelId);
10632
10845
  if (!id)
@@ -10634,34 +10847,83 @@ function chainKey(modelId) {
10634
10847
  const entry = API_MODEL_CATALOG.find((m) => m.id === id || m.apiModel === id);
10635
10848
  return entry?.id ?? id;
10636
10849
  }
10850
+ function has(map, key) {
10851
+ return Object.prototype.hasOwnProperty.call(map, key);
10852
+ }
10637
10853
  function providerChainFor(modelId) {
10638
10854
  const key = chainKey(modelId);
10639
- if (!key || isClaudeModel(key))
10640
- return [];
10641
- return Object.prototype.hasOwnProperty.call(PROVIDER_CHAINS, key) ? PROVIDER_CHAINS[key] : [];
10855
+ return key && has(PROVIDER_CHAINS, key) ? PROVIDER_CHAINS[key] : [];
10856
+ }
10857
+ function providerChainLeadsFor(modelId) {
10858
+ const key = chainKey(modelId);
10859
+ return key && has(PROVIDER_CHAIN_LEADS, key) ? PROVIDER_CHAIN_LEADS[key] : [];
10860
+ }
10861
+ function allChains() {
10862
+ return [...Object.entries(PROVIDER_CHAINS), ...Object.entries(PROVIDER_CHAIN_LEADS)];
10642
10863
  }
10643
10864
  function isProviderChainHopId(modelId) {
10644
10865
  const id = modelId ?? "";
10645
- return id !== "" && Object.values(PROVIDER_CHAINS).some((hops) => hops.includes(id));
10866
+ return id !== "" && allChains().some(([, hops]) => hops.includes(id));
10646
10867
  }
10647
10868
  function providerChainPrimariesForHop(hopId) {
10648
10869
  const id = hopId ?? "";
10649
10870
  if (!id)
10650
10871
  return [];
10651
- return Object.entries(PROVIDER_CHAINS).filter(([, hops]) => hops.includes(id)).map(([primary]) => primary);
10872
+ return allChains().filter(([, hops]) => hops.includes(id)).map(([primary]) => primary);
10873
+ }
10874
+ function providerChainHostOf(value, modelValue) {
10875
+ if (value === modelValue)
10876
+ return "own";
10877
+ if (hasZaiPrefix(value))
10878
+ return "zai";
10879
+ if (hasOpenCodeGo2Prefix(value))
10880
+ return "opencode-go-2";
10881
+ if (hasOpenCodeGoPrefix(value))
10882
+ return "opencode-go";
10883
+ if (hasOpenRouterPrefix(value))
10884
+ return "openrouter";
10885
+ return "own";
10886
+ }
10887
+ function providerHostPlan(modelId) {
10888
+ const key = chainKey(modelId);
10889
+ if (!key)
10890
+ return [];
10891
+ const own = { host: hasOpenRouterPrefix(key) ? "openrouter" : "own", value: key };
10892
+ const steps = [
10893
+ ...providerChainLeadsFor(key).map((value) => ({ host: providerChainHostOf(value, key), value })),
10894
+ own,
10895
+ ...providerChainFor(key).map((value) => ({ host: providerChainHostOf(value, key), value }))
10896
+ ];
10897
+ const notOffered = Object.prototype.hasOwnProperty.call(PROVIDER_HOST_NOT_OFFERED, key) ? PROVIDER_HOST_NOT_OFFERED[key] : {};
10898
+ for (const [host, reason] of Object.entries(notOffered)) {
10899
+ const at = steps.findIndex((step) => step === own) + 1;
10900
+ steps.splice(at, 0, { host, value: null, notOffered: reason });
10901
+ }
10902
+ return steps;
10652
10903
  }
10653
- var PROVIDER_CHAINS;
10904
+ var PROVIDER_CHAINS, PROVIDER_CHAIN_LEADS, PROVIDER_HOST_NOT_OFFERED;
10654
10905
  var init_provider_chains = __esm({
10655
10906
  "../shared/dist/provider-chains.js"() {
10656
10907
  "use strict";
10657
10908
  init_api_model_catalog();
10909
+ init_engine_spec();
10658
10910
  PROVIDER_CHAINS = {
10659
- "minimax-m3": ["openrouter:minimax/minimax-m3", "opencode-go:minimax-m3"],
10660
- "minimax-m3.1-flash": ["openrouter:minimax/minimax-m3.1-flash", "opencode-go:minimax-m3.1-flash"],
10911
+ "minimax-m3": ["opencode-go:minimax-m3", "openrouter:minimax/minimax-m3"],
10912
+ "minimax-m3.1-flash": ["opencode-go:minimax-m3.1-flash", "openrouter:minimax/minimax-m3.1-flash"],
10661
10913
  "muse-spark-1.3-contributor": ["openrouter:meta/muse-spark-1.3-contributor"],
10662
- "openrouter:z-ai/glm-5.3-flash": ["opencode-go:glm-5.3-flash"],
10663
- "openrouter:z-ai/glm-5.3": ["opencode-go:glm-5.3"],
10664
- "openrouter:z-ai/glm-5.2": ["opencode-go:glm-5.2"]
10914
+ "claude-haiku-5-5": ["opencode-go:claude-haiku-5-5", "openrouter:anthropic/claude-haiku-5.5"],
10915
+ "gemini-3.1-pro-preview": ["openrouter:google/gemini-3.1-pro-preview"],
10916
+ "deepseek-flash": ["opencode-go-2:deepseek-v4.1-flash", "opencode-go:deepseek-v4.1-flash", "openrouter:deepseek/deepseek-v4.1-flash"],
10917
+ "deepseek-v4-pro": ["opencode-go-2:deepseek-v4-pro", "opencode-go:deepseek-v4-pro", "openrouter:deepseek/deepseek-v4-pro"]
10918
+ };
10919
+ PROVIDER_CHAIN_LEADS = {
10920
+ "openrouter:z-ai/glm-5.3-flash": ["zai:glm-5.3-flash", "opencode-go-2:glm-5.3-flash", "opencode-go:glm-5.3-flash"],
10921
+ "openrouter:z-ai/glm-5.3": ["zai:glm-5.3", "opencode-go-2:glm-5.3", "opencode-go:glm-5.3"],
10922
+ "openrouter:z-ai/glm-5.2": ["zai:glm-5.2", "opencode-go-2:glm-5.2", "opencode-go:glm-5.2"]
10923
+ };
10924
+ PROVIDER_HOST_NOT_OFFERED = {
10925
+ "muse-spark-1.3-contributor": { "opencode-go": "OpenCode Go serves Muse only on its Responses API" },
10926
+ "gemini-3.1-pro-preview": { "opencode-go": "OpenCode Go does not serve Gemini" }
10665
10927
  };
10666
10928
  }
10667
10929
  });
@@ -12620,7 +12882,7 @@ function stateLiteralsOf(line) {
12620
12882
  const out = [];
12621
12883
  for (const m of line.matchAll(STRING_LITERAL_RE)) {
12622
12884
  const text = m[1] ?? m[2] ?? m[3] ?? "";
12623
- if (text.includes("placeholder="))
12885
+ if (PLACEHOLDER_ATTR_RE.test(text))
12624
12886
  continue;
12625
12887
  if (PLACEHOLDER_CALL_TAIL_RE.test(line.slice(Math.max(0, m.index - 40), m.index)))
12626
12888
  continue;
@@ -12716,7 +12978,7 @@ function formatReadinessPollAdvisory(findings) {
12716
12978
  const where = findings.length === 1 ? "One place" : `${findings.length} places`;
12717
12979
  return `${where} re-check a background state once and assert the finished state at once (${short(first.line, 90)} then ${short(first.assertion, 90)}). ${first.reason}`;
12718
12980
  }
12719
- var READINESS_POLL_MAX_CODE_CHARS, MAX_LINE_CHARS, MAX_FINDINGS, ASSERTION_WINDOW_LINES, MAX_BLOCK_CHARS, MAX_HEAD_CHARS, STRING_LITERAL_RE, RECHECK_NAME_RE, RETRY_NAME_RE, PENDING_STATE_RE, LOCATOR_LINE_RE, CLICK_RE, RELOAD_RE, GOTO_RE, ACTION_RE, EXPECT_RE, NEGATED_RE, PENDING_ENDED_RE, POSITIVE_MATCHER_RE, ZERO_COUNT_RE, TEST_END_RE, TEST_START_RE, POLL_OPEN_RE, PLACEHOLDER_CALL_TAIL_RE, POLL_SHAPE;
12981
+ var READINESS_POLL_MAX_CODE_CHARS, MAX_LINE_CHARS, MAX_FINDINGS, ASSERTION_WINDOW_LINES, MAX_BLOCK_CHARS, MAX_HEAD_CHARS, STRING_LITERAL_RE, RECHECK_NAME_RE, RETRY_NAME_RE, PENDING_STATE_RE, LOCATOR_LINE_RE, CLICK_RE, RELOAD_RE, GOTO_RE, ACTION_RE, EXPECT_RE, NEGATED_RE, PENDING_ENDED_RE, POSITIVE_MATCHER_RE, ZERO_COUNT_RE, TEST_END_RE, TEST_START_RE, POLL_OPEN_RE, PLACEHOLDER_ATTR_RE, PLACEHOLDER_CALL_TAIL_RE, POLL_SHAPE;
12720
12982
  var init_readiness_poll = __esm({
12721
12983
  "../shared/dist/readiness-poll.js"() {
12722
12984
  "use strict";
@@ -12729,7 +12991,7 @@ var init_readiness_poll = __esm({
12729
12991
  STRING_LITERAL_RE = /'((?:\\.|[^'\\\n]){0,300})'|"((?:\\.|[^"\\\n]){0,300})"|`((?:\\.|[^`\\\n]){0,300})`/g;
12730
12992
  RECHECK_NAME_RE = /^\s{0,10}(?:check again|check (?:status|availability|now|for updates|progress)|re-?check(?: status)?|update status|see (?:latest|updates))\s{0,10}(?:\.\.\.|…)?\s{0,10}$/i;
12731
12993
  RETRY_NAME_RE = /^\s{0,10}(?:refresh(?: (?:status|list|page|results|now))?|reload(?: (?:page|results|list))?|try again|retry|load (?:again|latest))\s{0,10}(?:\.\.\.|…)?\s{0,10}$/i;
12732
- PENDING_STATE_RE = /\b(?:searching|checking|sending|pending|processing|queued|in progress|loading|generating|calculating|preparing|verifying|syncing|refreshing|not ready|please wait|waiting)\b|\b[a-z]{3,40}(?<!th)ing(?:\s{1,3}[a-z]{1,20}){0,2}\s{0,3}(?:\.\.\.|…)\s{0,10}$/i;
12994
+ PENDING_STATE_RE = /\b(?:searching|checking|sending|pending|processing|queued|in progress|loading|generating|calculating|preparing|verifying|syncing|refreshing|not ready|please wait|waiting)\b|\b(?:saving|uploading|downloading|signing|logging|submitting|creating|updating|deleting|importing|exporting|publishing|connecting|redirecting|authenticating|installing|retrieving|fetching|analy[sz]ing|running|rendering|restarting|building|compiling|booting|provisioning|deploying|indexing|migrating|launching|initiali[sz]ing|optimi[sz]ing|converting|processing)(?:\s{1,3}[a-z]{1,20}){0,2}\s{0,3}(?:\.\.\.|…)\s{0,10}$|^\s{0,10}(?:starting|scanning|working|applying|finishing)(?:\s{1,3}[a-z]{1,20}){0,2}\s{0,3}(?:\.\.\.|…)\s{0,10}$|^\s{0,10}[a-z]{3,40}(?<!th)ing\s{0,3}(?:\.\.\.|…)\s{0,10}$/i;
12733
12995
  LOCATOR_LINE_RE = /\.(?:getBy[A-Z]\w{0,30}|locator|toHaveText|toContainText)\s{0,20}\(/;
12734
12996
  CLICK_RE = /\.(?:click|dblclick|tap)\s{0,20}\(/;
12735
12997
  RELOAD_RE = /\bpage\.reload\s{0,20}\(/;
@@ -12743,6 +13005,7 @@ var init_readiness_poll = __esm({
12743
13005
  TEST_END_RE = /^\s{0,20}\}\s{0,20}\)\s{0,20};?\s{0,20}$/;
12744
13006
  TEST_START_RE = /\btest(?:\.\w{1,20})?\s{0,20}\(/;
12745
13007
  POLL_OPEN_RE = /\bexpect(?:\.soft)?\s{0,20}\(\s{0,20}async\b|\bexpect\.poll\s{0,20}\(|\bfor\s{0,20}\(|\bwhile\s{0,20}\(|\bdo\s{0,20}\{/g;
13008
+ PLACEHOLDER_ATTR_RE = /placeholder\s{0,4}[*^$~|]?=/;
12746
13009
  PLACEHOLDER_CALL_TAIL_RE = /getByPlaceholder\s{0,20}\(\s{0,20}$/;
12747
13010
  POLL_SHAPE = "await expect(async () => { await page.reload(); await expect(<the finished state>).toBeVisible({ timeout: 1500 }); }).toPass({ timeout: 20000 });";
12748
13011
  }
@@ -13144,6 +13407,15 @@ function computes(line) {
13144
13407
  const code = line.replace(STRING_RE, '""').replace(REGEX_LITERAL_RE, "$1RX").replace(LITERAL_ARITH_RE, "N");
13145
13408
  return COMPUTE_RE.test(code) || RELATIONAL_RE.test(line);
13146
13409
  }
13410
+ function identifiersIn(line) {
13411
+ const code = line.replace(STRING_RE, '""').replace(REGEX_LITERAL_RE, "$1RX");
13412
+ return [code, ...[...line.matchAll(TEMPLATE_EXPR_RE)].map((m) => m[1])].flatMap((part) => part.match(IDENTIFIER_RE) ?? []);
13413
+ }
13414
+ function addTyped(typed, value) {
13415
+ const d = digitsOf(value);
13416
+ if (/\d/.test(d))
13417
+ typed.add(d);
13418
+ }
13147
13419
  function reasonFor4(kind, label, value) {
13148
13420
  const what = kind === "derived-value-shape-only" ? `The ${label} is checked only for its shape, so any amount passes, including a wrongly computed one.` : `The ${label} is checked against a number written into the test (${value}). That number was read off the page, so when the page computes it wrong the check still passes.`;
13149
13421
  return `${what} Instead, ${COMPUTE_SHAPE} If the number is not computed from other values (a list price, an id, a fixed fee), leave it as it is. Keep the existing checks.`;
@@ -13155,25 +13427,32 @@ function analyzeDerivedValues(rawCode) {
13155
13427
  for (const body of testBodies(rawCode)) {
13156
13428
  if (findings.length >= MAX_FINDINGS4)
13157
13429
  break;
13158
- if (body.some(computes))
13159
- continue;
13160
13430
  const typed = /* @__PURE__ */ new Set();
13161
13431
  const definitions = /* @__PURE__ */ new Map();
13432
+ const computed = /* @__PURE__ */ new Set();
13433
+ const usesComputed = (text) => identifiersIn(text).some((id) => computed.has(id));
13162
13434
  for (const line of body) {
13163
13435
  if (FILL_RE2.test(line) && !EXPECT_RE3.test(line)) {
13164
- for (const m of line.matchAll(/['"`]([^'"`\n]{0,40})['"`]/g)) {
13165
- const d = digitsOf(m[1]);
13166
- if (/\d/.test(d))
13167
- typed.add(d);
13168
- }
13436
+ for (const m of line.matchAll(QUOTED_RE))
13437
+ addTyped(typed, m[1]);
13438
+ const arg = FILL_ARG_RE.exec(line)?.[1];
13439
+ const literal = arg === void 0 ? null : LITERAL_VALUE_RE.exec(definitions.get(arg) ?? "");
13440
+ const value = literal?.slice(1).find((v) => v !== void 0);
13441
+ if (value !== void 0)
13442
+ addTyped(typed, value);
13169
13443
  }
13170
13444
  const def = DEFINITION_RE.exec(line);
13171
- if (def)
13445
+ if (def) {
13172
13446
  definitions.set(def[1], def[2]);
13447
+ if (computes(def[2]) || usesComputed(def[2]))
13448
+ computed.add(def[1]);
13449
+ }
13173
13450
  }
13174
13451
  for (const line of body) {
13175
13452
  if (!EXPECT_RE3.test(line) || !VALUE_MATCHER_RE2.test(line) || /\.not\s{0,20}\./.test(line))
13176
13453
  continue;
13454
+ if (computes(line) || usesComputed(line))
13455
+ continue;
13177
13456
  const subject = EXPECT_SUBJECT_RE.exec(line)?.[1];
13178
13457
  const label = DERIVED_WORD_RE.exec(`${line} ${(subject && definitions.get(subject)) ?? ""}`)?.[0];
13179
13458
  if (!label)
@@ -13203,7 +13482,7 @@ function formatDerivedValueAdvisory(findings) {
13203
13482
  const where = findings.length === 1 ? "One computed value is" : `${findings.length} computed values are`;
13204
13483
  return `${where} checked against a copied number or only its shape (${short4(first.line, 90)}). ${first.reason}`;
13205
13484
  }
13206
- var MAX_FINDINGS4, EXPECT_RE3, DERIVED_WORD_RE, VALUE_MATCHER_RE2, MONEY_TOKEN_RE, SHAPE_ARG_RE, FILL_RE2, EXPECT_MESSAGE_RE, STRING_RE, REGEX_LITERAL_RE, COMPUTE_RE, RELATIONAL_RE, DEFINITION_RE, EXPECT_SUBJECT_RE, LITERAL_ARITH_RE, COMPUTE_SHAPE;
13485
+ var MAX_FINDINGS4, EXPECT_RE3, DERIVED_WORD_RE, VALUE_MATCHER_RE2, MONEY_TOKEN_RE, SHAPE_ARG_RE, FILL_RE2, EXPECT_MESSAGE_RE, STRING_RE, REGEX_LITERAL_RE, COMPUTE_RE, RELATIONAL_RE, DEFINITION_RE, EXPECT_SUBJECT_RE, LITERAL_ARITH_RE, TEMPLATE_EXPR_RE, IDENTIFIER_RE, QUOTED_RE, FILL_ARG_RE, LITERAL_VALUE_RE, COMPUTE_SHAPE;
13207
13486
  var init_derived_value_check = __esm({
13208
13487
  "../shared/dist/derived-value-check.js"() {
13209
13488
  "use strict";
@@ -13223,6 +13502,11 @@ var init_derived_value_check = __esm({
13223
13502
  DEFINITION_RE = /\b(?:const|let)\s{1,10}([\w$]{1,60})\s{0,10}=\s{0,10}([^\n]{0,300})/;
13224
13503
  EXPECT_SUBJECT_RE = /\bexpect(?:\.soft)?\s{0,20}\(\s{0,20}([\w$]{1,60})/;
13225
13504
  LITERAL_ARITH_RE = /\b\d[\d_.]{0,15}(?:\s{0,5}[*/+-]\s{0,5}\d[\d_.]{0,15}){1,8}\b/g;
13505
+ TEMPLATE_EXPR_RE = /\$\{([^{}\n]{0,200})\}/g;
13506
+ IDENTIFIER_RE = /[A-Za-z_$][\w$]{0,60}/g;
13507
+ QUOTED_RE = /['"`]([^'"`\n]{0,40})['"`]/g;
13508
+ FILL_ARG_RE = /\.(?:fill|type|pressSequentially|selectOption)\s{0,20}\(\s{0,20}([A-Za-z_$][\w$]{0,60})\s{0,20}[,)]/;
13509
+ LITERAL_VALUE_RE = /^\s{0,10}(?:'([^'\n]{0,40})'|"([^"\n]{0,40})"|`([^`$\n]{0,40})`|(\d[\d_,]{0,15}(?:\.\d{1,4})?))\s{0,10};?\s{0,10}$/;
13226
13510
  COMPUTE_SHAPE = "compute the expected value in the test from its inputs (the values the test typed, or each input read from the page) and compare: const toNumber = (s) => Number(s.replace(/[^\\d.-]/g, '')); const unit = toNumber(await <unit price locator>.innerText()); then expect(toNumber(await <shown value locator>.innerText())).toBeCloseTo(unit * quantity, 2); for several lines, read them all and sum them with reduce. For a comma-decimal price like \u20AC1.234,56, drop the dots and turn the comma into a point before Number, since the replace above would read it as 1.23456.";
13227
13511
  }
13228
13512
  });
@@ -15257,6 +15541,99 @@ function formatStaleAfterSubmitAdvisory(rawCode) {
15257
15541
  const more = described.length > 3 ? ` (+${described.length - 3} more)` : "";
15258
15542
  return `stale-after-submit: ${described.slice(0, 3).join("; ")}${more}; these pass before the request lands and still pass if the server rejects or ignores the save. Wait for the result instead: page.waitForResponse around the click, or assert something the submit creates (the new row, the confirmation message, a path with an end anchor such as /\\/orders\\/\\d+$/)`;
15259
15543
  }
15544
+ function regexLiteralEnd4(text, at) {
15545
+ let inClass = false;
15546
+ for (let i = at + 1; i < text.length; i++) {
15547
+ const ch = text[i];
15548
+ if (ch === "\n")
15549
+ return -1;
15550
+ if (ch === "\\") {
15551
+ i++;
15552
+ continue;
15553
+ }
15554
+ if (inClass) {
15555
+ if (ch === "]")
15556
+ inClass = false;
15557
+ continue;
15558
+ }
15559
+ if (ch === "[") {
15560
+ inClass = true;
15561
+ continue;
15562
+ }
15563
+ if (ch === "/")
15564
+ return i + 1;
15565
+ }
15566
+ return -1;
15567
+ }
15568
+ function startsWithRegexLiteral(text) {
15569
+ const t = text.trimStart();
15570
+ return t[0] === "/" && t[1] !== "/" && t[1] !== "*" && regexLiteralEnd4(t, 0) !== -1;
15571
+ }
15572
+ function afterFirstArg(args) {
15573
+ let depth = 0;
15574
+ let quote = null;
15575
+ for (let i = 0; i < args.length; i++) {
15576
+ const ch = args[i];
15577
+ if (quote) {
15578
+ if (ch === "\\") {
15579
+ i++;
15580
+ continue;
15581
+ }
15582
+ if (ch === quote)
15583
+ quote = null;
15584
+ continue;
15585
+ }
15586
+ if (ch === '"' || ch === "'" || ch === "`") {
15587
+ quote = ch;
15588
+ continue;
15589
+ }
15590
+ if (ch === "(" || ch === "[" || ch === "{")
15591
+ depth++;
15592
+ else if (ch === ")" || ch === "]" || ch === "}")
15593
+ depth--;
15594
+ else if (ch === "," && depth === 0)
15595
+ return args.slice(i + 1);
15596
+ }
15597
+ return "";
15598
+ }
15599
+ function analyzeRegexMatchers(rawCode) {
15600
+ if (!rawCode || typeof rawCode !== "string")
15601
+ return [];
15602
+ const code = stripComments2(rawCode.slice(0, MAX_LINT_INPUT));
15603
+ const out = [];
15604
+ const re = /\bexpect(?:\.soft)?\s{0,20}\(/g;
15605
+ let m;
15606
+ let examined = 0;
15607
+ let line = 1;
15608
+ let lineAt2 = 0;
15609
+ while ((m = re.exec(code)) !== null && examined++ < MAX_CALLS && out.length < MAX_REGEX_MATCHER_FINDINGS) {
15610
+ const subj = readBalanced(code, m.index + m[0].length);
15611
+ if (!subj)
15612
+ continue;
15613
+ const mm = /^\s{0,20}(\.\s{0,20}not)?\s{0,20}\.\s{0,20}(\w{1,40})\s{0,20}\(/.exec(code.slice(subj.end + 1, subj.end + 1 + 80));
15614
+ if (!mm || !REGEX_EQUALITY_MATCHERS.has(mm[2]))
15615
+ continue;
15616
+ const args = readBalanced(code, subj.end + 1 + mm[0].length);
15617
+ if (!args)
15618
+ continue;
15619
+ const expected = mm[2] === "toHaveJSProperty" ? afterFirstArg(args.text) : args.text;
15620
+ if (!startsWithRegexLiteral(expected))
15621
+ continue;
15622
+ if (mm[2] !== "toHaveJSProperty" && mm[2] !== "toContain" && (startsWithRegexLiteral(subj.text) || /^new\s+RegExp\b/.test(subj.text.trim())))
15623
+ continue;
15624
+ for (let i = code.indexOf("\n", lineAt2); i !== -1 && i < m.index; i = code.indexOf("\n", i + 1)) {
15625
+ line++;
15626
+ lineAt2 = i + 1;
15627
+ }
15628
+ out.push({ line, matcher: mm[2], negated: mm[1] !== void 0 });
15629
+ }
15630
+ return out;
15631
+ }
15632
+ function formatRegexMatcherNote(findings) {
15633
+ const lines = findings.map((f) => `Line ${f.line}: .${f.negated ? "not." : ""}${f.matcher}(\u2026 /regex/ \u2026) ${f.negated ? "always passes (a regex never equals the value), so it checks nothing" : "can never pass: this matcher compares by equality and a regex never equals a value"}.`);
15634
+ return `${lines.join("\n")}
15635
+ A regex only works in toMatch, toHaveText, toContainText, toHaveValue and similar text matchers. For a DOM property read it first: expect(await loc.evaluate((n) => n.<prop>)).toMatch(/re/). Or give toHaveJSProperty the exact string (or boolean) the page shows. Keep every other line as-is.`;
15636
+ }
15260
15637
  function lintTestQuality(rawCode, opts = {}) {
15261
15638
  if (!rawCode || typeof rawCode !== "string")
15262
15639
  return [];
@@ -15264,6 +15641,10 @@ function lintTestQuality(rawCode, opts = {}) {
15264
15641
  return lintTestData(rawCode, { pageContacts: opts.pageContacts });
15265
15642
  if (opts.only === "test-data-blocking")
15266
15643
  return analyzeTestData(rawCode, { pageContacts: opts.pageContacts }).blocking;
15644
+ if (opts.only === "regex-matcher") {
15645
+ const found = analyzeRegexMatchers(rawCode);
15646
+ return found.length > 0 ? [formatRegexMatcherNote(found)] : [];
15647
+ }
15267
15648
  const warnings = [];
15268
15649
  if (rawCode.length > MAX_LINT_INPUT) {
15269
15650
  warnings.push(`The code is ${Math.round(rawCode.length / 1024)} KB; the quality lint checked only the first ${MAX_LINT_INPUT / 1e3} KB. Split it into smaller tests (one behaviour per test).`);
@@ -15538,7 +15919,7 @@ function specItemsFromTestPlans(testPlans) {
15538
15919
  }
15539
15920
  return [...new Set(out)].slice(0, 200);
15540
15921
  }
15541
- var READ_ONLY_TAGS, PRODUCTION_READ_ONLY_GUARD_TEMPLATE, HOST_AGNOSTIC_URL_TEMPLATE, TEST_QUALITY_CONVENTIONS, NON_PROD_HOST_LABEL, NON_PROD_HOST_TOKEN, TRANSIENT_TEXT, STRING_LITERAL, FIRST_LITERAL, GET_BY_TEXT_LITERAL2, ROLE_NAME_LITERAL2, MAX_LINT_INPUT, MAX_BALANCED_SCAN, MAX_CALLS, MAX_SEEN_SCAN, ACTION_CALL, BY_NAME_LOCATOR, ACTION_AFTER, MAX_CONTACTS, MAX_SNAPSHOT_SCAN, PHONE_IN_TEXT, EMAIL_IN_TEXT, TEL_HREF, MAILTO_HREF, FIELD_LINE, INBOX_EMAIL_READ, MAIL_READ_CALL, RESERVED_EMAIL_TLD, PHONE_LABEL, NON_PHONE_NUMBER_LABEL, IDENTITY_LABEL, LOOKUP_LABEL, NON_NAME_SUFFIX_LABEL, DATE_LIKE, SIGNUP_ACTION_NAME, SIGNUP_SUBMIT_NAME, LOGIN_ACTION_NAME, SIGNUP_GOTO, LOGIN_GOTO, MINTED_INBOX_ALIAS, STAMP_EVAL, RECORDING_VALUE_PLACEHOLDERS, NEGATIVE_TEST_TITLE, NEGATIVE_SIGNUP_ASSERT, STORED_LOGIN_RE, CONFIRM_CLICK_RE, SAVE_UPDATE_RE, NOT_A_CONFIRM_RE, ENTITY_WORDS, CREATE_ENTITY_CLICK_RE, RESTORE_CLICK_RE, MAX_ACCOUNT_ACTIONS, MAX_TRY_BLOCKS, MAX_STATEMENT_LOOKBACK, MAX_FINDINGS5, MAX_TRY_BODY, AUTH_REGION_START, AUTH_REGION_END, INBOX_REGION_START, INBOX_REGION_END, ACCOUNT_ROUTE_RE, ENTITY_WORD_RES, PERSIST_CALL_RE, FILL_IDENT_ARG_RE, PERSIST_ARGS_RE, HOST_IN_URL_ARG, URL_WAIT_TOKEN, GLOB_ESCAPED, URL_WAIT_MAX_PATH, URL_WAIT_MAX_GLOB_STARS, UNREACHED_MAX_PATHS, UNREACHED_MATCH_BUDGET, STALE_TOKEN, RESULT_WAIT, WRITE_CALL_PRESENT, SUBMIT_CALL_PRESENT, TEST_CALL, VALUE_WRITE_CALLS, SUBMIT_CALLS, DISTINCT_PAGE_CALLS, OWN_CONTROL_MATCHERS, OUTCOME_CONTENT_MATCHERS, OUTCOME_STATE_MATCHERS, ANY_CONTENT_ARG, ROOT_SUBJECT, LITERAL_SUBJECT, MATCHER_AFTER_EXPECT, STALE_MAX_EVENTS, CHECKED, UNCHECKED, squash, NOT_JUDGED, STALE_REASON_TEXT, LIVE_WRITE_NAME, BUNDLED_CHECKS_BEFORE_WRITE, STOP, SYNONYMS, AREA_TOKENS;
15922
+ var READ_ONLY_TAGS, PRODUCTION_READ_ONLY_GUARD_TEMPLATE, HOST_AGNOSTIC_URL_TEMPLATE, TEST_QUALITY_CONVENTIONS, NON_PROD_HOST_LABEL, NON_PROD_HOST_TOKEN, TRANSIENT_TEXT, STRING_LITERAL, FIRST_LITERAL, GET_BY_TEXT_LITERAL2, ROLE_NAME_LITERAL2, MAX_LINT_INPUT, MAX_BALANCED_SCAN, MAX_CALLS, MAX_SEEN_SCAN, ACTION_CALL, BY_NAME_LOCATOR, ACTION_AFTER, MAX_CONTACTS, MAX_SNAPSHOT_SCAN, PHONE_IN_TEXT, EMAIL_IN_TEXT, TEL_HREF, MAILTO_HREF, FIELD_LINE, INBOX_EMAIL_READ, MAIL_READ_CALL, RESERVED_EMAIL_TLD, PHONE_LABEL, NON_PHONE_NUMBER_LABEL, IDENTITY_LABEL, LOOKUP_LABEL, NON_NAME_SUFFIX_LABEL, DATE_LIKE, SIGNUP_ACTION_NAME, SIGNUP_SUBMIT_NAME, LOGIN_ACTION_NAME, SIGNUP_GOTO, LOGIN_GOTO, MINTED_INBOX_ALIAS, STAMP_EVAL, RECORDING_VALUE_PLACEHOLDERS, NEGATIVE_TEST_TITLE, NEGATIVE_SIGNUP_ASSERT, STORED_LOGIN_RE, CONFIRM_CLICK_RE, SAVE_UPDATE_RE, NOT_A_CONFIRM_RE, ENTITY_WORDS, CREATE_ENTITY_CLICK_RE, RESTORE_CLICK_RE, MAX_ACCOUNT_ACTIONS, MAX_TRY_BLOCKS, MAX_STATEMENT_LOOKBACK, MAX_FINDINGS5, MAX_TRY_BODY, AUTH_REGION_START, AUTH_REGION_END, INBOX_REGION_START, INBOX_REGION_END, ACCOUNT_ROUTE_RE, ENTITY_WORD_RES, PERSIST_CALL_RE, FILL_IDENT_ARG_RE, PERSIST_ARGS_RE, HOST_IN_URL_ARG, URL_WAIT_TOKEN, GLOB_ESCAPED, URL_WAIT_MAX_PATH, URL_WAIT_MAX_GLOB_STARS, UNREACHED_MAX_PATHS, UNREACHED_MATCH_BUDGET, STALE_TOKEN, RESULT_WAIT, WRITE_CALL_PRESENT, SUBMIT_CALL_PRESENT, TEST_CALL, VALUE_WRITE_CALLS, SUBMIT_CALLS, DISTINCT_PAGE_CALLS, OWN_CONTROL_MATCHERS, OUTCOME_CONTENT_MATCHERS, OUTCOME_STATE_MATCHERS, ANY_CONTENT_ARG, ROOT_SUBJECT, LITERAL_SUBJECT, MATCHER_AFTER_EXPECT, STALE_MAX_EVENTS, CHECKED, UNCHECKED, squash, NOT_JUDGED, STALE_REASON_TEXT, LIVE_WRITE_NAME, BUNDLED_CHECKS_BEFORE_WRITE, MAX_REGEX_MATCHER_FINDINGS, REGEX_EQUALITY_MATCHERS, STOP, SYNONYMS, AREA_TOKENS;
15542
15923
  var init_test_authoring_quality = __esm({
15543
15924
  "../shared/dist/test-authoring-quality.js"() {
15544
15925
  "use strict";
@@ -15770,6 +16151,8 @@ var init_test_authoring_quality = __esm({
15770
16151
  };
15771
16152
  LIVE_WRITE_NAME = /\b(?:submit|place|book|reserve|confirm|pay|send|checkout|order|register|sign\s?up|create account)\b/i;
15772
16153
  BUNDLED_CHECKS_BEFORE_WRITE = 5;
16154
+ MAX_REGEX_MATCHER_FINDINGS = 10;
16155
+ REGEX_EQUALITY_MATCHERS = /* @__PURE__ */ new Set(["toBe", "toEqual", "toStrictEqual", "toContain", "toHaveJSProperty"]);
15773
16156
  STOP = /* @__PURE__ */ new Set([
15774
16157
  "a",
15775
16158
  "an",
@@ -15998,6 +16381,19 @@ var init_fence_runs = __esm({
15998
16381
  }
15999
16382
  });
16000
16383
 
16384
+ // ../shared/dist/trailing-slashes.js
16385
+ function stripTrailingSlashes(value) {
16386
+ let end = value.length;
16387
+ while (end > 0 && value.charCodeAt(end - 1) === 47)
16388
+ end--;
16389
+ return end === value.length ? value : value.slice(0, end);
16390
+ }
16391
+ var init_trailing_slashes = __esm({
16392
+ "../shared/dist/trailing-slashes.js"() {
16393
+ "use strict";
16394
+ }
16395
+ });
16396
+
16001
16397
  // ../shared/dist/survey-bug-signature.js
16002
16398
  function normalizeWords(text) {
16003
16399
  return text.toLowerCase().replace(UUID, " id ").replace(PREFIXED_ID, " id ").replace(HEX_RUN, (run) => /\d/.test(run) ? " id " : run).replace(NUMBER_RUN, " # ").replace(/[^\p{L}\p{N}#]+/gu, " ").replace(/\s+/g, " ").trim();
@@ -16008,7 +16404,7 @@ function normalizeBugPath(route) {
16008
16404
  if (hash >= 0 && path[hash + 1] !== "/")
16009
16405
  path = path.slice(0, hash);
16010
16406
  const segments = path.toLowerCase().split("/").map((segment) => /\d/.test(segment) ? ":id" : segment);
16011
- const joined = segments.join("/").replace(/\/+$/, "");
16407
+ const joined = stripTrailingSlashes(segments.join("/"));
16012
16408
  return joined || (path.startsWith("/") ? "/" : "");
16013
16409
  }
16014
16410
  function isGenericConsoleMessage(message) {
@@ -16142,6 +16538,7 @@ var SIGNATURE_SOURCE_MAX_CHARS, UUID, PREFIXED_ID, HEX_RUN, NUMBER_RUN, GENERIC_
16142
16538
  var init_survey_bug_signature = __esm({
16143
16539
  "../shared/dist/survey-bug-signature.js"() {
16144
16540
  "use strict";
16541
+ init_trailing_slashes();
16145
16542
  SIGNATURE_SOURCE_MAX_CHARS = 800;
16146
16543
  UUID = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/g;
16147
16544
  PREFIXED_ID = /\b[a-z]{1,8}[-_]\d+\b/g;
@@ -17422,9 +17819,9 @@ function lastLocatorLabels(chain) {
17422
17819
  if (t)
17423
17820
  labels.push(t[1]);
17424
17821
  }
17425
- const has = optionText(last.args, HAS_TEXT_OPTION_RE);
17426
- if (has !== null)
17427
- labels.push(has);
17822
+ const has2 = optionText(last.args, HAS_TEXT_OPTION_RE);
17823
+ if (has2 !== null)
17824
+ labels.push(has2);
17428
17825
  }
17429
17826
  return labels.map((l) => l.replace(/^[\s^(?:]+/, "").trim());
17430
17827
  }
@@ -18181,14 +18578,17 @@ var init_promotion_quality_gate = __esm({
18181
18578
  SOURCE_RANK = { generator: 0, classifier: 0, healer: 1, human: 2 };
18182
18579
  strengthCheck = {
18183
18580
  id: "assertion-strength",
18184
- run({ code, strengthGate, flagContradictedAdditions }) {
18581
+ run({ code, tags, strengthGate, flagContradictedAdditions }) {
18185
18582
  const verdict = validateAssertionStrength(code, { flagContradictedAdditions: flagContradictedAdditions === true });
18186
18583
  if (verdict.severity === "route-bug")
18187
18584
  return [{ check: "route-bug" }];
18188
- if (verdict.severity !== "block")
18585
+ const authDowngrade = verdict.severity === "downgrade" && tags.some((t) => t.toLowerCase() === "@auth");
18586
+ if (verdict.severity !== "block" && !authDowngrade)
18189
18587
  return [];
18190
18588
  const revealed = strengthGate?.severity === "none" && strengthGate.revealEvidence === "revealed" && strengthGate.source !== "heal";
18191
- return revealed ? [] : [{ check: "strength-block" }];
18589
+ if (revealed)
18590
+ return [];
18591
+ return [{ check: authDowngrade ? "strength-downgrade-auth" : "strength-block" }];
18192
18592
  }
18193
18593
  };
18194
18594
  STRING_CONST = /\b(?:const|let|var)\s{1,20}([A-Za-z_$][\w$]{0,60})\s{0,20}=\s{0,20}(?:'([^'\\\n]{0,300})'|"([^"\\\n]{0,300})"|`([^`\\$\n]{0,300})`)\s{0,20}[;\n]/g;
@@ -18595,6 +18995,7 @@ __export(dist_exports, {
18595
18995
  AUDIO_CHUNK_DURATION_MS: () => AUDIO_CHUNK_DURATION_MS,
18596
18996
  AUTH_PATH_SIGNATURE: () => AUTH_PATH_SIGNATURE,
18597
18997
  AUTH_PROVIDER_HOST_SIGNATURES: () => AUTH_PROVIDER_HOST_SIGNATURES,
18998
+ AUTH_SESSION_GENERATION_RE: () => AUTH_SESSION_GENERATION_RE,
18598
18999
  AUTH_STATE_EXPIRY_SKEW_MS: () => AUTH_STATE_EXPIRY_SKEW_MS,
18599
19000
  AUTH_TAG_COOKIE_STATE: () => AUTH_TAG_COOKIE_STATE,
18600
19001
  AUTH_TAG_LOGIN_BEARER: () => AUTH_TAG_LOGIN_BEARER,
@@ -18727,6 +19128,8 @@ __export(dist_exports, {
18727
19128
  LIVE_FRAME_STALE_MS: () => LIVE_FRAME_STALE_MS,
18728
19129
  LIVE_FRAME_UNFOCUSED_INTERVAL_MS: () => LIVE_FRAME_UNFOCUSED_INTERVAL_MS,
18729
19130
  LIVE_THUMBNAIL_MAX_BASE64_BYTES: () => LIVE_THUMBNAIL_MAX_BASE64_BYTES,
19131
+ MAX_BALANCED_SCAN: () => MAX_BALANCED_SCAN,
19132
+ MAX_CALLS: () => MAX_CALLS,
18730
19133
  MAX_CREDIT_TOPUP_CENTS: () => MAX_CREDIT_TOPUP_CENTS,
18731
19134
  MAX_DEEPLINK_LENGTH: () => MAX_DEEPLINK_LENGTH,
18732
19135
  MAX_EMAIL_ADDRESS_LENGTH: () => MAX_EMAIL_ADDRESS_LENGTH,
@@ -18771,6 +19174,7 @@ __export(dist_exports, {
18771
19174
  MUSE_ENGINE_DEFAULT_MODEL: () => MUSE_ENGINE_DEFAULT_MODEL,
18772
19175
  MUSE_ENGINE_MODELS: () => MUSE_ENGINE_MODELS,
18773
19176
  NOREPLY_EMAIL: () => NOREPLY_EMAIL,
19177
+ OPENCODE_GO_2_PREFIX: () => OPENCODE_GO_2_PREFIX,
18774
19178
  OPENCODE_GO_MODEL_PATTERN: () => OPENCODE_GO_MODEL_PATTERN,
18775
19179
  OPENCODE_GO_PREFIX: () => OPENCODE_GO_PREFIX,
18776
19180
  OPENROUTER_MAX_CALL_COST_USD: () => OPENROUTER_MAX_CALL_COST_USD,
@@ -18806,6 +19210,8 @@ __export(dist_exports, {
18806
19210
  PROMOTION_GATE_MAX_CODE_CHARS: () => PROMOTION_GATE_MAX_CODE_CHARS,
18807
19211
  PROMOTION_QUALITY_CHECKS: () => PROMOTION_QUALITY_CHECKS,
18808
19212
  PROVIDER_CHAINS: () => PROVIDER_CHAINS,
19213
+ PROVIDER_CHAIN_LEADS: () => PROVIDER_CHAIN_LEADS,
19214
+ PROVIDER_HOST_NOT_OFFERED: () => PROVIDER_HOST_NOT_OFFERED,
18809
19215
  PUBLIC_PLANS: () => PUBLIC_PLANS,
18810
19216
  QUARANTINE_CLOSE_TAGS: () => QUARANTINE_CLOSE_TAGS,
18811
19217
  READINESS_POLL_MAX_CODE_CHARS: () => READINESS_POLL_MAX_CODE_CHARS,
@@ -18844,6 +19250,7 @@ __export(dist_exports, {
18844
19250
  SURVEY_NOTES_RENDER_MAX_CHARS: () => SURVEY_NOTES_RENDER_MAX_CHARS,
18845
19251
  SURVEY_NOTE_KEYS: () => SURVEY_NOTE_KEYS,
18846
19252
  SUSPICIOUS_PASS_TAG: () => SUSPICIOUS_PASS_TAG,
19253
+ TEST_DID_NOT_RUN_ERROR: () => TEST_DID_NOT_RUN_ERROR,
18847
19254
  TEST_QUALITY_CONVENTIONS: () => TEST_QUALITY_CONVENTIONS,
18848
19255
  TEST_USER_ENV_KEYS: () => TEST_USER_ENV_KEYS,
18849
19256
  TEST_VARIABLE_SECRET_KEY_PATTERN: () => TEST_VARIABLE_SECRET_KEY_PATTERN,
@@ -18859,6 +19266,8 @@ __export(dist_exports, {
18859
19266
  VOICE_PREVIEW_SAMPLE: () => VOICE_PREVIEW_SAMPLE,
18860
19267
  WEB_PROXY_CHAIN_HEADER: () => WEB_PROXY_CHAIN_HEADER,
18861
19268
  WITHHELD_CREDENTIAL_TEXT: () => WITHHELD_CREDENTIAL_TEXT,
19269
+ ZAI_MODEL_PATTERN: () => ZAI_MODEL_PATTERN,
19270
+ ZAI_PREFIX: () => ZAI_PREFIX,
18862
19271
  accumulateStatements: () => accumulateStatements,
18863
19272
  adoptBrokerFailover: () => adoptBrokerFailover,
18864
19273
  aiCostToCreditCents: () => aiCostToCreditCents,
@@ -18867,6 +19276,7 @@ __export(dist_exports, {
18867
19276
  analyzeMobileSelectorQuality: () => analyzeMobileSelectorQuality,
18868
19277
  analyzePersistenceReread: () => analyzePersistenceReread,
18869
19278
  analyzeReadinessPolling: () => analyzeReadinessPolling,
19279
+ analyzeRegexMatchers: () => analyzeRegexMatchers,
18870
19280
  analyzeSharedAccountUse: () => analyzeSharedAccountUse,
18871
19281
  analyzeStaleAfterSubmit: () => analyzeStaleAfterSubmit,
18872
19282
  analyzeTestData: () => analyzeTestData,
@@ -19030,6 +19440,7 @@ __export(dist_exports, {
19030
19440
  formatPersistenceRereadAdvisory: () => formatPersistenceRereadAdvisory,
19031
19441
  formatPoolBudgetLine: () => formatPoolBudgetLine,
19032
19442
  formatReadinessPollAdvisory: () => formatReadinessPollAdvisory,
19443
+ formatRegexMatcherNote: () => formatRegexMatcherNote,
19033
19444
  formatStaleAfterSubmitAdvisory: () => formatStaleAfterSubmitAdvisory,
19034
19445
  formatSuspiciousExpectation: () => formatSuspiciousExpectation,
19035
19446
  formatUrlWaitAdvisory: () => formatUrlWaitAdvisory,
@@ -19068,12 +19479,14 @@ __export(dist_exports, {
19068
19479
  hasEncodedRequestBody: () => hasEncodedRequestBody,
19069
19480
  hasEngineSpecParts: () => hasEngineSpecParts,
19070
19481
  hasOnlyConstantAssertions: () => hasOnlyConstantAssertions,
19482
+ hasOpenCodeGo2Prefix: () => hasOpenCodeGo2Prefix,
19071
19483
  hasOpenCodeGoPrefix: () => hasOpenCodeGoPrefix,
19072
19484
  hasOpenRouterPrefix: () => hasOpenRouterPrefix,
19073
19485
  hasPlatformLocator: () => hasPlatformLocator,
19074
19486
  hasReadOnlyMarker: () => hasReadOnlyMarker,
19075
19487
  hasSurveyNotes: () => hasSurveyNotes,
19076
19488
  hasTestFailContract: () => hasTestFailContract,
19489
+ hasZaiPrefix: () => hasZaiPrefix,
19077
19490
  healMobileTestSteps: () => healMobileTestSteps,
19078
19491
  healthRunWhere: () => healthRunWhere,
19079
19492
  heldCodeRecord: () => heldCodeRecord,
@@ -19177,6 +19590,7 @@ __export(dist_exports, {
19177
19590
  isValidSttProvider: () => isValidSttProvider,
19178
19591
  isValidTtsModel: () => isValidTtsModel,
19179
19592
  isValidTtsVoiceId: () => isValidTtsVoiceId,
19593
+ isZaiModelId: () => isZaiModelId,
19180
19594
  jsEscapedForms: () => jsEscapedForms,
19181
19595
  jsonStructureRefusalOf: () => jsonStructureRefusalOf,
19182
19596
  jsonStructureVerify: () => jsonStructureVerify,
@@ -19225,6 +19639,7 @@ __export(dist_exports, {
19225
19639
  parseApiCardModelUpdate: () => parseApiCardModelUpdate,
19226
19640
  parseAppTimezone: () => parseAppTimezone,
19227
19641
  parseAuditGroupScopeId: () => parseAuditGroupScopeId,
19642
+ parseAuthSessionStamp: () => parseAuthSessionStamp,
19228
19643
  parseBoolFlag: () => parseBoolFlag,
19229
19644
  parseDbPoolSize: () => parseDbPoolSize,
19230
19645
  parseDeepgramListenResponse: () => parseDeepgramListenResponse,
@@ -19268,7 +19683,11 @@ __export(dist_exports, {
19268
19683
  profileKeyRoute: () => profileKeyRoute,
19269
19684
  projectAppHosts: () => projectAppHosts,
19270
19685
  providerChainFor: () => providerChainFor,
19686
+ providerChainHostOf: () => providerChainHostOf,
19687
+ providerChainLeadsFor: () => providerChainLeadsFor,
19271
19688
  providerChainPrimariesForHop: () => providerChainPrimariesForHop,
19689
+ providerHostPlan: () => providerHostPlan,
19690
+ readBalanced: () => readBalanced,
19272
19691
  readChatFailover: () => readChatFailover,
19273
19692
  readChatReasoningTokens: () => readChatReasoningTokens,
19274
19693
  readChatUsage: () => readChatUsage,
@@ -19351,6 +19770,7 @@ __export(dist_exports, {
19351
19770
  stripCoverageComments: () => stripCoverageComments,
19352
19771
  stripEnvironmentalPrefix: () => stripEnvironmentalPrefix,
19353
19772
  stripLoginScaffolding: () => stripLoginScaffolding,
19773
+ stripTrailingSlashes: () => stripTrailingSlashes,
19354
19774
  strongerNeedsReviewSource: () => strongerNeedsReviewSource,
19355
19775
  sttModelsForProvider: () => sttModelsForProvider,
19356
19776
  summarizeHealth: () => summarizeHealth,
@@ -19378,7 +19798,8 @@ __export(dist_exports, {
19378
19798
  withReviewSource: () => withReviewSource,
19379
19799
  withoutNotChargedClaim: () => withoutNotChargedClaim,
19380
19800
  withoutServerOnlySpendFields: () => withoutServerOnlySpendFields,
19381
- withoutSurveyNotes: () => withoutSurveyNotes
19801
+ withoutSurveyNotes: () => withoutSurveyNotes,
19802
+ zaiWireModel: () => zaiWireModel
19382
19803
  });
19383
19804
  var init_dist = __esm({
19384
19805
  "../shared/dist/index.js"() {
@@ -19420,6 +19841,7 @@ var init_dist = __esm({
19420
19841
  init_admin_view_return_to();
19421
19842
  init_auth_plan();
19422
19843
  init_auth_block_detector();
19844
+ init_auth_session_stamp();
19423
19845
  init_auth_state_freshness();
19424
19846
  init_skip_coverage_detector();
19425
19847
  init_feature_coverage();
@@ -19476,6 +19898,7 @@ var init_dist = __esm({
19476
19898
  init_promotion_quality_gate();
19477
19899
  init_regex_alternation();
19478
19900
  init_page_evidence();
19901
+ init_trailing_slashes();
19479
19902
  }
19480
19903
  });
19481
19904
 
@@ -19911,6 +20334,7 @@ var require_route_manifest = __commonJS({
19911
20334
  exports2.renderRouteManifestChecklist = renderRouteManifestChecklist;
19912
20335
  exports2.renderRepoReadsChecklist = renderRepoReadsChecklist;
19913
20336
  exports2.buildRepoReadsRouteAllowlist = buildRepoReadsRouteAllowlist;
20337
+ var shared_1 = (init_dist(), __toCommonJS(dist_exports));
19914
20338
  var promises_1 = require("fs/promises");
19915
20339
  var node_path_1 = require("path");
19916
20340
  var untrusted_knowledge_js_1 = require_untrusted_knowledge();
@@ -19965,7 +20389,7 @@ var require_route_manifest = __commonJS({
19965
20389
  }
19966
20390
  function collapsePath(path) {
19967
20391
  const collapsed = path.replace(/\/{2,}/g, "/");
19968
- return collapsed.length > 1 ? collapsed.replace(/\/+$/, "") : collapsed;
20392
+ return collapsed.length > 1 ? (0, shared_1.stripTrailingSlashes)(collapsed) : collapsed;
19969
20393
  }
19970
20394
  function normalizeManifestPath(raw) {
19971
20395
  const text = str(raw, 500);
@@ -20505,6 +20929,2285 @@ var require_route_seed = __commonJS({
20505
20929
  }
20506
20930
  });
20507
20931
 
20932
+ // ../../node_modules/source-map-support/node_modules/source-map/lib/base64.js
20933
+ var require_base64 = __commonJS({
20934
+ "../../node_modules/source-map-support/node_modules/source-map/lib/base64.js"(exports2) {
20935
+ "use strict";
20936
+ var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
20937
+ exports2.encode = function(number) {
20938
+ if (0 <= number && number < intToCharMap.length) {
20939
+ return intToCharMap[number];
20940
+ }
20941
+ throw new TypeError("Must be between 0 and 63: " + number);
20942
+ };
20943
+ exports2.decode = function(charCode) {
20944
+ var bigA = 65;
20945
+ var bigZ = 90;
20946
+ var littleA = 97;
20947
+ var littleZ = 122;
20948
+ var zero = 48;
20949
+ var nine = 57;
20950
+ var plus = 43;
20951
+ var slash = 47;
20952
+ var littleOffset = 26;
20953
+ var numberOffset = 52;
20954
+ if (bigA <= charCode && charCode <= bigZ) {
20955
+ return charCode - bigA;
20956
+ }
20957
+ if (littleA <= charCode && charCode <= littleZ) {
20958
+ return charCode - littleA + littleOffset;
20959
+ }
20960
+ if (zero <= charCode && charCode <= nine) {
20961
+ return charCode - zero + numberOffset;
20962
+ }
20963
+ if (charCode == plus) {
20964
+ return 62;
20965
+ }
20966
+ if (charCode == slash) {
20967
+ return 63;
20968
+ }
20969
+ return -1;
20970
+ };
20971
+ }
20972
+ });
20973
+
20974
+ // ../../node_modules/source-map-support/node_modules/source-map/lib/base64-vlq.js
20975
+ var require_base64_vlq = __commonJS({
20976
+ "../../node_modules/source-map-support/node_modules/source-map/lib/base64-vlq.js"(exports2) {
20977
+ "use strict";
20978
+ var base64 = require_base64();
20979
+ var VLQ_BASE_SHIFT = 5;
20980
+ var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
20981
+ var VLQ_BASE_MASK = VLQ_BASE - 1;
20982
+ var VLQ_CONTINUATION_BIT = VLQ_BASE;
20983
+ function toVLQSigned(aValue) {
20984
+ return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
20985
+ }
20986
+ function fromVLQSigned(aValue) {
20987
+ var isNegative = (aValue & 1) === 1;
20988
+ var shifted = aValue >> 1;
20989
+ return isNegative ? -shifted : shifted;
20990
+ }
20991
+ exports2.encode = function base64VLQ_encode(aValue) {
20992
+ var encoded = "";
20993
+ var digit;
20994
+ var vlq = toVLQSigned(aValue);
20995
+ do {
20996
+ digit = vlq & VLQ_BASE_MASK;
20997
+ vlq >>>= VLQ_BASE_SHIFT;
20998
+ if (vlq > 0) {
20999
+ digit |= VLQ_CONTINUATION_BIT;
21000
+ }
21001
+ encoded += base64.encode(digit);
21002
+ } while (vlq > 0);
21003
+ return encoded;
21004
+ };
21005
+ exports2.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
21006
+ var strLen = aStr.length;
21007
+ var result = 0;
21008
+ var shift = 0;
21009
+ var continuation, digit;
21010
+ do {
21011
+ if (aIndex >= strLen) {
21012
+ throw new Error("Expected more digits in base 64 VLQ value.");
21013
+ }
21014
+ digit = base64.decode(aStr.charCodeAt(aIndex++));
21015
+ if (digit === -1) {
21016
+ throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
21017
+ }
21018
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
21019
+ digit &= VLQ_BASE_MASK;
21020
+ result = result + (digit << shift);
21021
+ shift += VLQ_BASE_SHIFT;
21022
+ } while (continuation);
21023
+ aOutParam.value = fromVLQSigned(result);
21024
+ aOutParam.rest = aIndex;
21025
+ };
21026
+ }
21027
+ });
21028
+
21029
+ // ../../node_modules/source-map-support/node_modules/source-map/lib/util.js
21030
+ var require_util = __commonJS({
21031
+ "../../node_modules/source-map-support/node_modules/source-map/lib/util.js"(exports2) {
21032
+ "use strict";
21033
+ function getArg(aArgs, aName, aDefaultValue) {
21034
+ if (aName in aArgs) {
21035
+ return aArgs[aName];
21036
+ } else if (arguments.length === 3) {
21037
+ return aDefaultValue;
21038
+ } else {
21039
+ throw new Error('"' + aName + '" is a required argument.');
21040
+ }
21041
+ }
21042
+ exports2.getArg = getArg;
21043
+ var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
21044
+ var dataUrlRegexp = /^data:.+\,.+$/;
21045
+ function urlParse(aUrl) {
21046
+ var match = aUrl.match(urlRegexp);
21047
+ if (!match) {
21048
+ return null;
21049
+ }
21050
+ return {
21051
+ scheme: match[1],
21052
+ auth: match[2],
21053
+ host: match[3],
21054
+ port: match[4],
21055
+ path: match[5]
21056
+ };
21057
+ }
21058
+ exports2.urlParse = urlParse;
21059
+ function urlGenerate(aParsedUrl) {
21060
+ var url = "";
21061
+ if (aParsedUrl.scheme) {
21062
+ url += aParsedUrl.scheme + ":";
21063
+ }
21064
+ url += "//";
21065
+ if (aParsedUrl.auth) {
21066
+ url += aParsedUrl.auth + "@";
21067
+ }
21068
+ if (aParsedUrl.host) {
21069
+ url += aParsedUrl.host;
21070
+ }
21071
+ if (aParsedUrl.port) {
21072
+ url += ":" + aParsedUrl.port;
21073
+ }
21074
+ if (aParsedUrl.path) {
21075
+ url += aParsedUrl.path;
21076
+ }
21077
+ return url;
21078
+ }
21079
+ exports2.urlGenerate = urlGenerate;
21080
+ function normalize(aPath) {
21081
+ var path = aPath;
21082
+ var url = urlParse(aPath);
21083
+ if (url) {
21084
+ if (!url.path) {
21085
+ return aPath;
21086
+ }
21087
+ path = url.path;
21088
+ }
21089
+ var isAbsolute = exports2.isAbsolute(path);
21090
+ var parts = path.split(/\/+/);
21091
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
21092
+ part = parts[i];
21093
+ if (part === ".") {
21094
+ parts.splice(i, 1);
21095
+ } else if (part === "..") {
21096
+ up++;
21097
+ } else if (up > 0) {
21098
+ if (part === "") {
21099
+ parts.splice(i + 1, up);
21100
+ up = 0;
21101
+ } else {
21102
+ parts.splice(i, 2);
21103
+ up--;
21104
+ }
21105
+ }
21106
+ }
21107
+ path = parts.join("/");
21108
+ if (path === "") {
21109
+ path = isAbsolute ? "/" : ".";
21110
+ }
21111
+ if (url) {
21112
+ url.path = path;
21113
+ return urlGenerate(url);
21114
+ }
21115
+ return path;
21116
+ }
21117
+ exports2.normalize = normalize;
21118
+ function join(aRoot, aPath) {
21119
+ if (aRoot === "") {
21120
+ aRoot = ".";
21121
+ }
21122
+ if (aPath === "") {
21123
+ aPath = ".";
21124
+ }
21125
+ var aPathUrl = urlParse(aPath);
21126
+ var aRootUrl = urlParse(aRoot);
21127
+ if (aRootUrl) {
21128
+ aRoot = aRootUrl.path || "/";
21129
+ }
21130
+ if (aPathUrl && !aPathUrl.scheme) {
21131
+ if (aRootUrl) {
21132
+ aPathUrl.scheme = aRootUrl.scheme;
21133
+ }
21134
+ return urlGenerate(aPathUrl);
21135
+ }
21136
+ if (aPathUrl || aPath.match(dataUrlRegexp)) {
21137
+ return aPath;
21138
+ }
21139
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
21140
+ aRootUrl.host = aPath;
21141
+ return urlGenerate(aRootUrl);
21142
+ }
21143
+ var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
21144
+ if (aRootUrl) {
21145
+ aRootUrl.path = joined;
21146
+ return urlGenerate(aRootUrl);
21147
+ }
21148
+ return joined;
21149
+ }
21150
+ exports2.join = join;
21151
+ exports2.isAbsolute = function(aPath) {
21152
+ return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
21153
+ };
21154
+ function relative(aRoot, aPath) {
21155
+ if (aRoot === "") {
21156
+ aRoot = ".";
21157
+ }
21158
+ aRoot = aRoot.replace(/\/$/, "");
21159
+ var level = 0;
21160
+ while (aPath.indexOf(aRoot + "/") !== 0) {
21161
+ var index = aRoot.lastIndexOf("/");
21162
+ if (index < 0) {
21163
+ return aPath;
21164
+ }
21165
+ aRoot = aRoot.slice(0, index);
21166
+ if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
21167
+ return aPath;
21168
+ }
21169
+ ++level;
21170
+ }
21171
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
21172
+ }
21173
+ exports2.relative = relative;
21174
+ var supportsNullProto = (function() {
21175
+ var obj = /* @__PURE__ */ Object.create(null);
21176
+ return !("__proto__" in obj);
21177
+ })();
21178
+ function identity(s) {
21179
+ return s;
21180
+ }
21181
+ function toSetString(aStr) {
21182
+ if (isProtoString(aStr)) {
21183
+ return "$" + aStr;
21184
+ }
21185
+ return aStr;
21186
+ }
21187
+ exports2.toSetString = supportsNullProto ? identity : toSetString;
21188
+ function fromSetString(aStr) {
21189
+ if (isProtoString(aStr)) {
21190
+ return aStr.slice(1);
21191
+ }
21192
+ return aStr;
21193
+ }
21194
+ exports2.fromSetString = supportsNullProto ? identity : fromSetString;
21195
+ function isProtoString(s) {
21196
+ if (!s) {
21197
+ return false;
21198
+ }
21199
+ var length = s.length;
21200
+ if (length < 9) {
21201
+ return false;
21202
+ }
21203
+ if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) {
21204
+ return false;
21205
+ }
21206
+ for (var i = length - 10; i >= 0; i--) {
21207
+ if (s.charCodeAt(i) !== 36) {
21208
+ return false;
21209
+ }
21210
+ }
21211
+ return true;
21212
+ }
21213
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
21214
+ var cmp = strcmp(mappingA.source, mappingB.source);
21215
+ if (cmp !== 0) {
21216
+ return cmp;
21217
+ }
21218
+ cmp = mappingA.originalLine - mappingB.originalLine;
21219
+ if (cmp !== 0) {
21220
+ return cmp;
21221
+ }
21222
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
21223
+ if (cmp !== 0 || onlyCompareOriginal) {
21224
+ return cmp;
21225
+ }
21226
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
21227
+ if (cmp !== 0) {
21228
+ return cmp;
21229
+ }
21230
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
21231
+ if (cmp !== 0) {
21232
+ return cmp;
21233
+ }
21234
+ return strcmp(mappingA.name, mappingB.name);
21235
+ }
21236
+ exports2.compareByOriginalPositions = compareByOriginalPositions;
21237
+ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
21238
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
21239
+ if (cmp !== 0) {
21240
+ return cmp;
21241
+ }
21242
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
21243
+ if (cmp !== 0 || onlyCompareGenerated) {
21244
+ return cmp;
21245
+ }
21246
+ cmp = strcmp(mappingA.source, mappingB.source);
21247
+ if (cmp !== 0) {
21248
+ return cmp;
21249
+ }
21250
+ cmp = mappingA.originalLine - mappingB.originalLine;
21251
+ if (cmp !== 0) {
21252
+ return cmp;
21253
+ }
21254
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
21255
+ if (cmp !== 0) {
21256
+ return cmp;
21257
+ }
21258
+ return strcmp(mappingA.name, mappingB.name);
21259
+ }
21260
+ exports2.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
21261
+ function strcmp(aStr1, aStr2) {
21262
+ if (aStr1 === aStr2) {
21263
+ return 0;
21264
+ }
21265
+ if (aStr1 === null) {
21266
+ return 1;
21267
+ }
21268
+ if (aStr2 === null) {
21269
+ return -1;
21270
+ }
21271
+ if (aStr1 > aStr2) {
21272
+ return 1;
21273
+ }
21274
+ return -1;
21275
+ }
21276
+ function compareByGeneratedPositionsInflated(mappingA, mappingB) {
21277
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
21278
+ if (cmp !== 0) {
21279
+ return cmp;
21280
+ }
21281
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
21282
+ if (cmp !== 0) {
21283
+ return cmp;
21284
+ }
21285
+ cmp = strcmp(mappingA.source, mappingB.source);
21286
+ if (cmp !== 0) {
21287
+ return cmp;
21288
+ }
21289
+ cmp = mappingA.originalLine - mappingB.originalLine;
21290
+ if (cmp !== 0) {
21291
+ return cmp;
21292
+ }
21293
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
21294
+ if (cmp !== 0) {
21295
+ return cmp;
21296
+ }
21297
+ return strcmp(mappingA.name, mappingB.name);
21298
+ }
21299
+ exports2.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
21300
+ function parseSourceMapInput(str) {
21301
+ return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
21302
+ }
21303
+ exports2.parseSourceMapInput = parseSourceMapInput;
21304
+ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
21305
+ sourceURL = sourceURL || "";
21306
+ if (sourceRoot) {
21307
+ if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
21308
+ sourceRoot += "/";
21309
+ }
21310
+ sourceURL = sourceRoot + sourceURL;
21311
+ }
21312
+ if (sourceMapURL) {
21313
+ var parsed = urlParse(sourceMapURL);
21314
+ if (!parsed) {
21315
+ throw new Error("sourceMapURL could not be parsed");
21316
+ }
21317
+ if (parsed.path) {
21318
+ var index = parsed.path.lastIndexOf("/");
21319
+ if (index >= 0) {
21320
+ parsed.path = parsed.path.substring(0, index + 1);
21321
+ }
21322
+ }
21323
+ sourceURL = join(urlGenerate(parsed), sourceURL);
21324
+ }
21325
+ return normalize(sourceURL);
21326
+ }
21327
+ exports2.computeSourceURL = computeSourceURL;
21328
+ }
21329
+ });
21330
+
21331
+ // ../../node_modules/source-map-support/node_modules/source-map/lib/array-set.js
21332
+ var require_array_set = __commonJS({
21333
+ "../../node_modules/source-map-support/node_modules/source-map/lib/array-set.js"(exports2) {
21334
+ "use strict";
21335
+ var util = require_util();
21336
+ var has2 = Object.prototype.hasOwnProperty;
21337
+ var hasNativeMap = typeof Map !== "undefined";
21338
+ function ArraySet() {
21339
+ this._array = [];
21340
+ this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
21341
+ }
21342
+ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
21343
+ var set = new ArraySet();
21344
+ for (var i = 0, len = aArray.length; i < len; i++) {
21345
+ set.add(aArray[i], aAllowDuplicates);
21346
+ }
21347
+ return set;
21348
+ };
21349
+ ArraySet.prototype.size = function ArraySet_size() {
21350
+ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
21351
+ };
21352
+ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
21353
+ var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
21354
+ var isDuplicate = hasNativeMap ? this.has(aStr) : has2.call(this._set, sStr);
21355
+ var idx = this._array.length;
21356
+ if (!isDuplicate || aAllowDuplicates) {
21357
+ this._array.push(aStr);
21358
+ }
21359
+ if (!isDuplicate) {
21360
+ if (hasNativeMap) {
21361
+ this._set.set(aStr, idx);
21362
+ } else {
21363
+ this._set[sStr] = idx;
21364
+ }
21365
+ }
21366
+ };
21367
+ ArraySet.prototype.has = function ArraySet_has(aStr) {
21368
+ if (hasNativeMap) {
21369
+ return this._set.has(aStr);
21370
+ } else {
21371
+ var sStr = util.toSetString(aStr);
21372
+ return has2.call(this._set, sStr);
21373
+ }
21374
+ };
21375
+ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
21376
+ if (hasNativeMap) {
21377
+ var idx = this._set.get(aStr);
21378
+ if (idx >= 0) {
21379
+ return idx;
21380
+ }
21381
+ } else {
21382
+ var sStr = util.toSetString(aStr);
21383
+ if (has2.call(this._set, sStr)) {
21384
+ return this._set[sStr];
21385
+ }
21386
+ }
21387
+ throw new Error('"' + aStr + '" is not in the set.');
21388
+ };
21389
+ ArraySet.prototype.at = function ArraySet_at(aIdx) {
21390
+ if (aIdx >= 0 && aIdx < this._array.length) {
21391
+ return this._array[aIdx];
21392
+ }
21393
+ throw new Error("No element indexed by " + aIdx);
21394
+ };
21395
+ ArraySet.prototype.toArray = function ArraySet_toArray() {
21396
+ return this._array.slice();
21397
+ };
21398
+ exports2.ArraySet = ArraySet;
21399
+ }
21400
+ });
21401
+
21402
+ // ../../node_modules/source-map-support/node_modules/source-map/lib/mapping-list.js
21403
+ var require_mapping_list = __commonJS({
21404
+ "../../node_modules/source-map-support/node_modules/source-map/lib/mapping-list.js"(exports2) {
21405
+ "use strict";
21406
+ var util = require_util();
21407
+ function generatedPositionAfter(mappingA, mappingB) {
21408
+ var lineA = mappingA.generatedLine;
21409
+ var lineB = mappingB.generatedLine;
21410
+ var columnA = mappingA.generatedColumn;
21411
+ var columnB = mappingB.generatedColumn;
21412
+ return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
21413
+ }
21414
+ function MappingList() {
21415
+ this._array = [];
21416
+ this._sorted = true;
21417
+ this._last = { generatedLine: -1, generatedColumn: 0 };
21418
+ }
21419
+ MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
21420
+ this._array.forEach(aCallback, aThisArg);
21421
+ };
21422
+ MappingList.prototype.add = function MappingList_add(aMapping) {
21423
+ if (generatedPositionAfter(this._last, aMapping)) {
21424
+ this._last = aMapping;
21425
+ this._array.push(aMapping);
21426
+ } else {
21427
+ this._sorted = false;
21428
+ this._array.push(aMapping);
21429
+ }
21430
+ };
21431
+ MappingList.prototype.toArray = function MappingList_toArray() {
21432
+ if (!this._sorted) {
21433
+ this._array.sort(util.compareByGeneratedPositionsInflated);
21434
+ this._sorted = true;
21435
+ }
21436
+ return this._array;
21437
+ };
21438
+ exports2.MappingList = MappingList;
21439
+ }
21440
+ });
21441
+
21442
+ // ../../node_modules/source-map-support/node_modules/source-map/lib/source-map-generator.js
21443
+ var require_source_map_generator = __commonJS({
21444
+ "../../node_modules/source-map-support/node_modules/source-map/lib/source-map-generator.js"(exports2) {
21445
+ "use strict";
21446
+ var base64VLQ = require_base64_vlq();
21447
+ var util = require_util();
21448
+ var ArraySet = require_array_set().ArraySet;
21449
+ var MappingList = require_mapping_list().MappingList;
21450
+ function SourceMapGenerator(aArgs) {
21451
+ if (!aArgs) {
21452
+ aArgs = {};
21453
+ }
21454
+ this._file = util.getArg(aArgs, "file", null);
21455
+ this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
21456
+ this._skipValidation = util.getArg(aArgs, "skipValidation", false);
21457
+ this._sources = new ArraySet();
21458
+ this._names = new ArraySet();
21459
+ this._mappings = new MappingList();
21460
+ this._sourcesContents = null;
21461
+ }
21462
+ SourceMapGenerator.prototype._version = 3;
21463
+ SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
21464
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
21465
+ var generator = new SourceMapGenerator({
21466
+ file: aSourceMapConsumer.file,
21467
+ sourceRoot
21468
+ });
21469
+ aSourceMapConsumer.eachMapping(function(mapping) {
21470
+ var newMapping = {
21471
+ generated: {
21472
+ line: mapping.generatedLine,
21473
+ column: mapping.generatedColumn
21474
+ }
21475
+ };
21476
+ if (mapping.source != null) {
21477
+ newMapping.source = mapping.source;
21478
+ if (sourceRoot != null) {
21479
+ newMapping.source = util.relative(sourceRoot, newMapping.source);
21480
+ }
21481
+ newMapping.original = {
21482
+ line: mapping.originalLine,
21483
+ column: mapping.originalColumn
21484
+ };
21485
+ if (mapping.name != null) {
21486
+ newMapping.name = mapping.name;
21487
+ }
21488
+ }
21489
+ generator.addMapping(newMapping);
21490
+ });
21491
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
21492
+ var sourceRelative = sourceFile;
21493
+ if (sourceRoot !== null) {
21494
+ sourceRelative = util.relative(sourceRoot, sourceFile);
21495
+ }
21496
+ if (!generator._sources.has(sourceRelative)) {
21497
+ generator._sources.add(sourceRelative);
21498
+ }
21499
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
21500
+ if (content != null) {
21501
+ generator.setSourceContent(sourceFile, content);
21502
+ }
21503
+ });
21504
+ return generator;
21505
+ };
21506
+ SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
21507
+ var generated = util.getArg(aArgs, "generated");
21508
+ var original = util.getArg(aArgs, "original", null);
21509
+ var source = util.getArg(aArgs, "source", null);
21510
+ var name = util.getArg(aArgs, "name", null);
21511
+ if (!this._skipValidation) {
21512
+ this._validateMapping(generated, original, source, name);
21513
+ }
21514
+ if (source != null) {
21515
+ source = String(source);
21516
+ if (!this._sources.has(source)) {
21517
+ this._sources.add(source);
21518
+ }
21519
+ }
21520
+ if (name != null) {
21521
+ name = String(name);
21522
+ if (!this._names.has(name)) {
21523
+ this._names.add(name);
21524
+ }
21525
+ }
21526
+ this._mappings.add({
21527
+ generatedLine: generated.line,
21528
+ generatedColumn: generated.column,
21529
+ originalLine: original != null && original.line,
21530
+ originalColumn: original != null && original.column,
21531
+ source,
21532
+ name
21533
+ });
21534
+ };
21535
+ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
21536
+ var source = aSourceFile;
21537
+ if (this._sourceRoot != null) {
21538
+ source = util.relative(this._sourceRoot, source);
21539
+ }
21540
+ if (aSourceContent != null) {
21541
+ if (!this._sourcesContents) {
21542
+ this._sourcesContents = /* @__PURE__ */ Object.create(null);
21543
+ }
21544
+ this._sourcesContents[util.toSetString(source)] = aSourceContent;
21545
+ } else if (this._sourcesContents) {
21546
+ delete this._sourcesContents[util.toSetString(source)];
21547
+ if (Object.keys(this._sourcesContents).length === 0) {
21548
+ this._sourcesContents = null;
21549
+ }
21550
+ }
21551
+ };
21552
+ SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
21553
+ var sourceFile = aSourceFile;
21554
+ if (aSourceFile == null) {
21555
+ if (aSourceMapConsumer.file == null) {
21556
+ throw new Error(
21557
+ `SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
21558
+ );
21559
+ }
21560
+ sourceFile = aSourceMapConsumer.file;
21561
+ }
21562
+ var sourceRoot = this._sourceRoot;
21563
+ if (sourceRoot != null) {
21564
+ sourceFile = util.relative(sourceRoot, sourceFile);
21565
+ }
21566
+ var newSources = new ArraySet();
21567
+ var newNames = new ArraySet();
21568
+ this._mappings.unsortedForEach(function(mapping) {
21569
+ if (mapping.source === sourceFile && mapping.originalLine != null) {
21570
+ var original = aSourceMapConsumer.originalPositionFor({
21571
+ line: mapping.originalLine,
21572
+ column: mapping.originalColumn
21573
+ });
21574
+ if (original.source != null) {
21575
+ mapping.source = original.source;
21576
+ if (aSourceMapPath != null) {
21577
+ mapping.source = util.join(aSourceMapPath, mapping.source);
21578
+ }
21579
+ if (sourceRoot != null) {
21580
+ mapping.source = util.relative(sourceRoot, mapping.source);
21581
+ }
21582
+ mapping.originalLine = original.line;
21583
+ mapping.originalColumn = original.column;
21584
+ if (original.name != null) {
21585
+ mapping.name = original.name;
21586
+ }
21587
+ }
21588
+ }
21589
+ var source = mapping.source;
21590
+ if (source != null && !newSources.has(source)) {
21591
+ newSources.add(source);
21592
+ }
21593
+ var name = mapping.name;
21594
+ if (name != null && !newNames.has(name)) {
21595
+ newNames.add(name);
21596
+ }
21597
+ }, this);
21598
+ this._sources = newSources;
21599
+ this._names = newNames;
21600
+ aSourceMapConsumer.sources.forEach(function(sourceFile2) {
21601
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
21602
+ if (content != null) {
21603
+ if (aSourceMapPath != null) {
21604
+ sourceFile2 = util.join(aSourceMapPath, sourceFile2);
21605
+ }
21606
+ if (sourceRoot != null) {
21607
+ sourceFile2 = util.relative(sourceRoot, sourceFile2);
21608
+ }
21609
+ this.setSourceContent(sourceFile2, content);
21610
+ }
21611
+ }, this);
21612
+ };
21613
+ SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
21614
+ if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
21615
+ throw new Error(
21616
+ "original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."
21617
+ );
21618
+ }
21619
+ if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
21620
+ return;
21621
+ } else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
21622
+ return;
21623
+ } else {
21624
+ throw new Error("Invalid mapping: " + JSON.stringify({
21625
+ generated: aGenerated,
21626
+ source: aSource,
21627
+ original: aOriginal,
21628
+ name: aName
21629
+ }));
21630
+ }
21631
+ };
21632
+ SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
21633
+ var previousGeneratedColumn = 0;
21634
+ var previousGeneratedLine = 1;
21635
+ var previousOriginalColumn = 0;
21636
+ var previousOriginalLine = 0;
21637
+ var previousName = 0;
21638
+ var previousSource = 0;
21639
+ var result = "";
21640
+ var next;
21641
+ var mapping;
21642
+ var nameIdx;
21643
+ var sourceIdx;
21644
+ var mappings = this._mappings.toArray();
21645
+ for (var i = 0, len = mappings.length; i < len; i++) {
21646
+ mapping = mappings[i];
21647
+ next = "";
21648
+ if (mapping.generatedLine !== previousGeneratedLine) {
21649
+ previousGeneratedColumn = 0;
21650
+ while (mapping.generatedLine !== previousGeneratedLine) {
21651
+ next += ";";
21652
+ previousGeneratedLine++;
21653
+ }
21654
+ } else {
21655
+ if (i > 0) {
21656
+ if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
21657
+ continue;
21658
+ }
21659
+ next += ",";
21660
+ }
21661
+ }
21662
+ next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
21663
+ previousGeneratedColumn = mapping.generatedColumn;
21664
+ if (mapping.source != null) {
21665
+ sourceIdx = this._sources.indexOf(mapping.source);
21666
+ next += base64VLQ.encode(sourceIdx - previousSource);
21667
+ previousSource = sourceIdx;
21668
+ next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
21669
+ previousOriginalLine = mapping.originalLine - 1;
21670
+ next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
21671
+ previousOriginalColumn = mapping.originalColumn;
21672
+ if (mapping.name != null) {
21673
+ nameIdx = this._names.indexOf(mapping.name);
21674
+ next += base64VLQ.encode(nameIdx - previousName);
21675
+ previousName = nameIdx;
21676
+ }
21677
+ }
21678
+ result += next;
21679
+ }
21680
+ return result;
21681
+ };
21682
+ SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
21683
+ return aSources.map(function(source) {
21684
+ if (!this._sourcesContents) {
21685
+ return null;
21686
+ }
21687
+ if (aSourceRoot != null) {
21688
+ source = util.relative(aSourceRoot, source);
21689
+ }
21690
+ var key = util.toSetString(source);
21691
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
21692
+ }, this);
21693
+ };
21694
+ SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
21695
+ var map = {
21696
+ version: this._version,
21697
+ sources: this._sources.toArray(),
21698
+ names: this._names.toArray(),
21699
+ mappings: this._serializeMappings()
21700
+ };
21701
+ if (this._file != null) {
21702
+ map.file = this._file;
21703
+ }
21704
+ if (this._sourceRoot != null) {
21705
+ map.sourceRoot = this._sourceRoot;
21706
+ }
21707
+ if (this._sourcesContents) {
21708
+ map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
21709
+ }
21710
+ return map;
21711
+ };
21712
+ SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
21713
+ return JSON.stringify(this.toJSON());
21714
+ };
21715
+ exports2.SourceMapGenerator = SourceMapGenerator;
21716
+ }
21717
+ });
21718
+
21719
+ // ../../node_modules/source-map-support/node_modules/source-map/lib/binary-search.js
21720
+ var require_binary_search = __commonJS({
21721
+ "../../node_modules/source-map-support/node_modules/source-map/lib/binary-search.js"(exports2) {
21722
+ "use strict";
21723
+ exports2.GREATEST_LOWER_BOUND = 1;
21724
+ exports2.LEAST_UPPER_BOUND = 2;
21725
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
21726
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
21727
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
21728
+ if (cmp === 0) {
21729
+ return mid;
21730
+ } else if (cmp > 0) {
21731
+ if (aHigh - mid > 1) {
21732
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
21733
+ }
21734
+ if (aBias == exports2.LEAST_UPPER_BOUND) {
21735
+ return aHigh < aHaystack.length ? aHigh : -1;
21736
+ } else {
21737
+ return mid;
21738
+ }
21739
+ } else {
21740
+ if (mid - aLow > 1) {
21741
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
21742
+ }
21743
+ if (aBias == exports2.LEAST_UPPER_BOUND) {
21744
+ return mid;
21745
+ } else {
21746
+ return aLow < 0 ? -1 : aLow;
21747
+ }
21748
+ }
21749
+ }
21750
+ exports2.search = function search(aNeedle, aHaystack, aCompare, aBias) {
21751
+ if (aHaystack.length === 0) {
21752
+ return -1;
21753
+ }
21754
+ var index = recursiveSearch(
21755
+ -1,
21756
+ aHaystack.length,
21757
+ aNeedle,
21758
+ aHaystack,
21759
+ aCompare,
21760
+ aBias || exports2.GREATEST_LOWER_BOUND
21761
+ );
21762
+ if (index < 0) {
21763
+ return -1;
21764
+ }
21765
+ while (index - 1 >= 0) {
21766
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
21767
+ break;
21768
+ }
21769
+ --index;
21770
+ }
21771
+ return index;
21772
+ };
21773
+ }
21774
+ });
21775
+
21776
+ // ../../node_modules/source-map-support/node_modules/source-map/lib/quick-sort.js
21777
+ var require_quick_sort = __commonJS({
21778
+ "../../node_modules/source-map-support/node_modules/source-map/lib/quick-sort.js"(exports2) {
21779
+ "use strict";
21780
+ function swap(ary, x, y) {
21781
+ var temp = ary[x];
21782
+ ary[x] = ary[y];
21783
+ ary[y] = temp;
21784
+ }
21785
+ function randomIntInRange(low, high) {
21786
+ return Math.round(low + Math.random() * (high - low));
21787
+ }
21788
+ function doQuickSort(ary, comparator, p, r) {
21789
+ if (p < r) {
21790
+ var pivotIndex = randomIntInRange(p, r);
21791
+ var i = p - 1;
21792
+ swap(ary, pivotIndex, r);
21793
+ var pivot = ary[r];
21794
+ for (var j = p; j < r; j++) {
21795
+ if (comparator(ary[j], pivot) <= 0) {
21796
+ i += 1;
21797
+ swap(ary, i, j);
21798
+ }
21799
+ }
21800
+ swap(ary, i + 1, j);
21801
+ var q = i + 1;
21802
+ doQuickSort(ary, comparator, p, q - 1);
21803
+ doQuickSort(ary, comparator, q + 1, r);
21804
+ }
21805
+ }
21806
+ exports2.quickSort = function(ary, comparator) {
21807
+ doQuickSort(ary, comparator, 0, ary.length - 1);
21808
+ };
21809
+ }
21810
+ });
21811
+
21812
+ // ../../node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js
21813
+ var require_source_map_consumer = __commonJS({
21814
+ "../../node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js"(exports2) {
21815
+ "use strict";
21816
+ var util = require_util();
21817
+ var binarySearch = require_binary_search();
21818
+ var ArraySet = require_array_set().ArraySet;
21819
+ var base64VLQ = require_base64_vlq();
21820
+ var quickSort = require_quick_sort().quickSort;
21821
+ function SourceMapConsumer(aSourceMap, aSourceMapURL) {
21822
+ var sourceMap = aSourceMap;
21823
+ if (typeof aSourceMap === "string") {
21824
+ sourceMap = util.parseSourceMapInput(aSourceMap);
21825
+ }
21826
+ return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
21827
+ }
21828
+ SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
21829
+ return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
21830
+ };
21831
+ SourceMapConsumer.prototype._version = 3;
21832
+ SourceMapConsumer.prototype.__generatedMappings = null;
21833
+ Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
21834
+ configurable: true,
21835
+ enumerable: true,
21836
+ get: function() {
21837
+ if (!this.__generatedMappings) {
21838
+ this._parseMappings(this._mappings, this.sourceRoot);
21839
+ }
21840
+ return this.__generatedMappings;
21841
+ }
21842
+ });
21843
+ SourceMapConsumer.prototype.__originalMappings = null;
21844
+ Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
21845
+ configurable: true,
21846
+ enumerable: true,
21847
+ get: function() {
21848
+ if (!this.__originalMappings) {
21849
+ this._parseMappings(this._mappings, this.sourceRoot);
21850
+ }
21851
+ return this.__originalMappings;
21852
+ }
21853
+ });
21854
+ SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
21855
+ var c = aStr.charAt(index);
21856
+ return c === ";" || c === ",";
21857
+ };
21858
+ SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
21859
+ throw new Error("Subclasses must implement _parseMappings");
21860
+ };
21861
+ SourceMapConsumer.GENERATED_ORDER = 1;
21862
+ SourceMapConsumer.ORIGINAL_ORDER = 2;
21863
+ SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
21864
+ SourceMapConsumer.LEAST_UPPER_BOUND = 2;
21865
+ SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
21866
+ var context = aContext || null;
21867
+ var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
21868
+ var mappings;
21869
+ switch (order) {
21870
+ case SourceMapConsumer.GENERATED_ORDER:
21871
+ mappings = this._generatedMappings;
21872
+ break;
21873
+ case SourceMapConsumer.ORIGINAL_ORDER:
21874
+ mappings = this._originalMappings;
21875
+ break;
21876
+ default:
21877
+ throw new Error("Unknown order of iteration.");
21878
+ }
21879
+ var sourceRoot = this.sourceRoot;
21880
+ mappings.map(function(mapping) {
21881
+ var source = mapping.source === null ? null : this._sources.at(mapping.source);
21882
+ source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
21883
+ return {
21884
+ source,
21885
+ generatedLine: mapping.generatedLine,
21886
+ generatedColumn: mapping.generatedColumn,
21887
+ originalLine: mapping.originalLine,
21888
+ originalColumn: mapping.originalColumn,
21889
+ name: mapping.name === null ? null : this._names.at(mapping.name)
21890
+ };
21891
+ }, this).forEach(aCallback, context);
21892
+ };
21893
+ SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
21894
+ var line = util.getArg(aArgs, "line");
21895
+ var needle = {
21896
+ source: util.getArg(aArgs, "source"),
21897
+ originalLine: line,
21898
+ originalColumn: util.getArg(aArgs, "column", 0)
21899
+ };
21900
+ needle.source = this._findSourceIndex(needle.source);
21901
+ if (needle.source < 0) {
21902
+ return [];
21903
+ }
21904
+ var mappings = [];
21905
+ var index = this._findMapping(
21906
+ needle,
21907
+ this._originalMappings,
21908
+ "originalLine",
21909
+ "originalColumn",
21910
+ util.compareByOriginalPositions,
21911
+ binarySearch.LEAST_UPPER_BOUND
21912
+ );
21913
+ if (index >= 0) {
21914
+ var mapping = this._originalMappings[index];
21915
+ if (aArgs.column === void 0) {
21916
+ var originalLine = mapping.originalLine;
21917
+ while (mapping && mapping.originalLine === originalLine) {
21918
+ mappings.push({
21919
+ line: util.getArg(mapping, "generatedLine", null),
21920
+ column: util.getArg(mapping, "generatedColumn", null),
21921
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
21922
+ });
21923
+ mapping = this._originalMappings[++index];
21924
+ }
21925
+ } else {
21926
+ var originalColumn = mapping.originalColumn;
21927
+ while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
21928
+ mappings.push({
21929
+ line: util.getArg(mapping, "generatedLine", null),
21930
+ column: util.getArg(mapping, "generatedColumn", null),
21931
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
21932
+ });
21933
+ mapping = this._originalMappings[++index];
21934
+ }
21935
+ }
21936
+ }
21937
+ return mappings;
21938
+ };
21939
+ exports2.SourceMapConsumer = SourceMapConsumer;
21940
+ function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
21941
+ var sourceMap = aSourceMap;
21942
+ if (typeof aSourceMap === "string") {
21943
+ sourceMap = util.parseSourceMapInput(aSourceMap);
21944
+ }
21945
+ var version = util.getArg(sourceMap, "version");
21946
+ var sources = util.getArg(sourceMap, "sources");
21947
+ var names = util.getArg(sourceMap, "names", []);
21948
+ var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
21949
+ var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
21950
+ var mappings = util.getArg(sourceMap, "mappings");
21951
+ var file = util.getArg(sourceMap, "file", null);
21952
+ if (version != this._version) {
21953
+ throw new Error("Unsupported version: " + version);
21954
+ }
21955
+ if (sourceRoot) {
21956
+ sourceRoot = util.normalize(sourceRoot);
21957
+ }
21958
+ sources = sources.map(String).map(util.normalize).map(function(source) {
21959
+ return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
21960
+ });
21961
+ this._names = ArraySet.fromArray(names.map(String), true);
21962
+ this._sources = ArraySet.fromArray(sources, true);
21963
+ this._absoluteSources = this._sources.toArray().map(function(s) {
21964
+ return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
21965
+ });
21966
+ this.sourceRoot = sourceRoot;
21967
+ this.sourcesContent = sourcesContent;
21968
+ this._mappings = mappings;
21969
+ this._sourceMapURL = aSourceMapURL;
21970
+ this.file = file;
21971
+ }
21972
+ BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
21973
+ BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
21974
+ BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
21975
+ var relativeSource = aSource;
21976
+ if (this.sourceRoot != null) {
21977
+ relativeSource = util.relative(this.sourceRoot, relativeSource);
21978
+ }
21979
+ if (this._sources.has(relativeSource)) {
21980
+ return this._sources.indexOf(relativeSource);
21981
+ }
21982
+ var i;
21983
+ for (i = 0; i < this._absoluteSources.length; ++i) {
21984
+ if (this._absoluteSources[i] == aSource) {
21985
+ return i;
21986
+ }
21987
+ }
21988
+ return -1;
21989
+ };
21990
+ BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
21991
+ var smc = Object.create(BasicSourceMapConsumer.prototype);
21992
+ var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
21993
+ var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
21994
+ smc.sourceRoot = aSourceMap._sourceRoot;
21995
+ smc.sourcesContent = aSourceMap._generateSourcesContent(
21996
+ smc._sources.toArray(),
21997
+ smc.sourceRoot
21998
+ );
21999
+ smc.file = aSourceMap._file;
22000
+ smc._sourceMapURL = aSourceMapURL;
22001
+ smc._absoluteSources = smc._sources.toArray().map(function(s) {
22002
+ return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
22003
+ });
22004
+ var generatedMappings = aSourceMap._mappings.toArray().slice();
22005
+ var destGeneratedMappings = smc.__generatedMappings = [];
22006
+ var destOriginalMappings = smc.__originalMappings = [];
22007
+ for (var i = 0, length = generatedMappings.length; i < length; i++) {
22008
+ var srcMapping = generatedMappings[i];
22009
+ var destMapping = new Mapping();
22010
+ destMapping.generatedLine = srcMapping.generatedLine;
22011
+ destMapping.generatedColumn = srcMapping.generatedColumn;
22012
+ if (srcMapping.source) {
22013
+ destMapping.source = sources.indexOf(srcMapping.source);
22014
+ destMapping.originalLine = srcMapping.originalLine;
22015
+ destMapping.originalColumn = srcMapping.originalColumn;
22016
+ if (srcMapping.name) {
22017
+ destMapping.name = names.indexOf(srcMapping.name);
22018
+ }
22019
+ destOriginalMappings.push(destMapping);
22020
+ }
22021
+ destGeneratedMappings.push(destMapping);
22022
+ }
22023
+ quickSort(smc.__originalMappings, util.compareByOriginalPositions);
22024
+ return smc;
22025
+ };
22026
+ BasicSourceMapConsumer.prototype._version = 3;
22027
+ Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
22028
+ get: function() {
22029
+ return this._absoluteSources.slice();
22030
+ }
22031
+ });
22032
+ function Mapping() {
22033
+ this.generatedLine = 0;
22034
+ this.generatedColumn = 0;
22035
+ this.source = null;
22036
+ this.originalLine = null;
22037
+ this.originalColumn = null;
22038
+ this.name = null;
22039
+ }
22040
+ BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
22041
+ var generatedLine = 1;
22042
+ var previousGeneratedColumn = 0;
22043
+ var previousOriginalLine = 0;
22044
+ var previousOriginalColumn = 0;
22045
+ var previousSource = 0;
22046
+ var previousName = 0;
22047
+ var length = aStr.length;
22048
+ var index = 0;
22049
+ var cachedSegments = {};
22050
+ var temp = {};
22051
+ var originalMappings = [];
22052
+ var generatedMappings = [];
22053
+ var mapping, str, segment, end, value;
22054
+ while (index < length) {
22055
+ if (aStr.charAt(index) === ";") {
22056
+ generatedLine++;
22057
+ index++;
22058
+ previousGeneratedColumn = 0;
22059
+ } else if (aStr.charAt(index) === ",") {
22060
+ index++;
22061
+ } else {
22062
+ mapping = new Mapping();
22063
+ mapping.generatedLine = generatedLine;
22064
+ for (end = index; end < length; end++) {
22065
+ if (this._charIsMappingSeparator(aStr, end)) {
22066
+ break;
22067
+ }
22068
+ }
22069
+ str = aStr.slice(index, end);
22070
+ segment = cachedSegments[str];
22071
+ if (segment) {
22072
+ index += str.length;
22073
+ } else {
22074
+ segment = [];
22075
+ while (index < end) {
22076
+ base64VLQ.decode(aStr, index, temp);
22077
+ value = temp.value;
22078
+ index = temp.rest;
22079
+ segment.push(value);
22080
+ }
22081
+ if (segment.length === 2) {
22082
+ throw new Error("Found a source, but no line and column");
22083
+ }
22084
+ if (segment.length === 3) {
22085
+ throw new Error("Found a source and line, but no column");
22086
+ }
22087
+ cachedSegments[str] = segment;
22088
+ }
22089
+ mapping.generatedColumn = previousGeneratedColumn + segment[0];
22090
+ previousGeneratedColumn = mapping.generatedColumn;
22091
+ if (segment.length > 1) {
22092
+ mapping.source = previousSource + segment[1];
22093
+ previousSource += segment[1];
22094
+ mapping.originalLine = previousOriginalLine + segment[2];
22095
+ previousOriginalLine = mapping.originalLine;
22096
+ mapping.originalLine += 1;
22097
+ mapping.originalColumn = previousOriginalColumn + segment[3];
22098
+ previousOriginalColumn = mapping.originalColumn;
22099
+ if (segment.length > 4) {
22100
+ mapping.name = previousName + segment[4];
22101
+ previousName += segment[4];
22102
+ }
22103
+ }
22104
+ generatedMappings.push(mapping);
22105
+ if (typeof mapping.originalLine === "number") {
22106
+ originalMappings.push(mapping);
22107
+ }
22108
+ }
22109
+ }
22110
+ quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
22111
+ this.__generatedMappings = generatedMappings;
22112
+ quickSort(originalMappings, util.compareByOriginalPositions);
22113
+ this.__originalMappings = originalMappings;
22114
+ };
22115
+ BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
22116
+ if (aNeedle[aLineName] <= 0) {
22117
+ throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
22118
+ }
22119
+ if (aNeedle[aColumnName] < 0) {
22120
+ throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
22121
+ }
22122
+ return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
22123
+ };
22124
+ BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
22125
+ for (var index = 0; index < this._generatedMappings.length; ++index) {
22126
+ var mapping = this._generatedMappings[index];
22127
+ if (index + 1 < this._generatedMappings.length) {
22128
+ var nextMapping = this._generatedMappings[index + 1];
22129
+ if (mapping.generatedLine === nextMapping.generatedLine) {
22130
+ mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
22131
+ continue;
22132
+ }
22133
+ }
22134
+ mapping.lastGeneratedColumn = Infinity;
22135
+ }
22136
+ };
22137
+ BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
22138
+ var needle = {
22139
+ generatedLine: util.getArg(aArgs, "line"),
22140
+ generatedColumn: util.getArg(aArgs, "column")
22141
+ };
22142
+ var index = this._findMapping(
22143
+ needle,
22144
+ this._generatedMappings,
22145
+ "generatedLine",
22146
+ "generatedColumn",
22147
+ util.compareByGeneratedPositionsDeflated,
22148
+ util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
22149
+ );
22150
+ if (index >= 0) {
22151
+ var mapping = this._generatedMappings[index];
22152
+ if (mapping.generatedLine === needle.generatedLine) {
22153
+ var source = util.getArg(mapping, "source", null);
22154
+ if (source !== null) {
22155
+ source = this._sources.at(source);
22156
+ source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
22157
+ }
22158
+ var name = util.getArg(mapping, "name", null);
22159
+ if (name !== null) {
22160
+ name = this._names.at(name);
22161
+ }
22162
+ return {
22163
+ source,
22164
+ line: util.getArg(mapping, "originalLine", null),
22165
+ column: util.getArg(mapping, "originalColumn", null),
22166
+ name
22167
+ };
22168
+ }
22169
+ }
22170
+ return {
22171
+ source: null,
22172
+ line: null,
22173
+ column: null,
22174
+ name: null
22175
+ };
22176
+ };
22177
+ BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
22178
+ if (!this.sourcesContent) {
22179
+ return false;
22180
+ }
22181
+ return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
22182
+ return sc == null;
22183
+ });
22184
+ };
22185
+ BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
22186
+ if (!this.sourcesContent) {
22187
+ return null;
22188
+ }
22189
+ var index = this._findSourceIndex(aSource);
22190
+ if (index >= 0) {
22191
+ return this.sourcesContent[index];
22192
+ }
22193
+ var relativeSource = aSource;
22194
+ if (this.sourceRoot != null) {
22195
+ relativeSource = util.relative(this.sourceRoot, relativeSource);
22196
+ }
22197
+ var url;
22198
+ if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
22199
+ var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
22200
+ if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
22201
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
22202
+ }
22203
+ if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) {
22204
+ return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
22205
+ }
22206
+ }
22207
+ if (nullOnMissing) {
22208
+ return null;
22209
+ } else {
22210
+ throw new Error('"' + relativeSource + '" is not in the SourceMap.');
22211
+ }
22212
+ };
22213
+ BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
22214
+ var source = util.getArg(aArgs, "source");
22215
+ source = this._findSourceIndex(source);
22216
+ if (source < 0) {
22217
+ return {
22218
+ line: null,
22219
+ column: null,
22220
+ lastColumn: null
22221
+ };
22222
+ }
22223
+ var needle = {
22224
+ source,
22225
+ originalLine: util.getArg(aArgs, "line"),
22226
+ originalColumn: util.getArg(aArgs, "column")
22227
+ };
22228
+ var index = this._findMapping(
22229
+ needle,
22230
+ this._originalMappings,
22231
+ "originalLine",
22232
+ "originalColumn",
22233
+ util.compareByOriginalPositions,
22234
+ util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
22235
+ );
22236
+ if (index >= 0) {
22237
+ var mapping = this._originalMappings[index];
22238
+ if (mapping.source === needle.source) {
22239
+ return {
22240
+ line: util.getArg(mapping, "generatedLine", null),
22241
+ column: util.getArg(mapping, "generatedColumn", null),
22242
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
22243
+ };
22244
+ }
22245
+ }
22246
+ return {
22247
+ line: null,
22248
+ column: null,
22249
+ lastColumn: null
22250
+ };
22251
+ };
22252
+ exports2.BasicSourceMapConsumer = BasicSourceMapConsumer;
22253
+ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
22254
+ var sourceMap = aSourceMap;
22255
+ if (typeof aSourceMap === "string") {
22256
+ sourceMap = util.parseSourceMapInput(aSourceMap);
22257
+ }
22258
+ var version = util.getArg(sourceMap, "version");
22259
+ var sections = util.getArg(sourceMap, "sections");
22260
+ if (version != this._version) {
22261
+ throw new Error("Unsupported version: " + version);
22262
+ }
22263
+ this._sources = new ArraySet();
22264
+ this._names = new ArraySet();
22265
+ var lastOffset = {
22266
+ line: -1,
22267
+ column: 0
22268
+ };
22269
+ this._sections = sections.map(function(s) {
22270
+ if (s.url) {
22271
+ throw new Error("Support for url field in sections not implemented.");
22272
+ }
22273
+ var offset = util.getArg(s, "offset");
22274
+ var offsetLine = util.getArg(offset, "line");
22275
+ var offsetColumn = util.getArg(offset, "column");
22276
+ if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
22277
+ throw new Error("Section offsets must be ordered and non-overlapping.");
22278
+ }
22279
+ lastOffset = offset;
22280
+ return {
22281
+ generatedOffset: {
22282
+ // The offset fields are 0-based, but we use 1-based indices when
22283
+ // encoding/decoding from VLQ.
22284
+ generatedLine: offsetLine + 1,
22285
+ generatedColumn: offsetColumn + 1
22286
+ },
22287
+ consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL)
22288
+ };
22289
+ });
22290
+ }
22291
+ IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
22292
+ IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
22293
+ IndexedSourceMapConsumer.prototype._version = 3;
22294
+ Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
22295
+ get: function() {
22296
+ var sources = [];
22297
+ for (var i = 0; i < this._sections.length; i++) {
22298
+ for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
22299
+ sources.push(this._sections[i].consumer.sources[j]);
22300
+ }
22301
+ }
22302
+ return sources;
22303
+ }
22304
+ });
22305
+ IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
22306
+ var needle = {
22307
+ generatedLine: util.getArg(aArgs, "line"),
22308
+ generatedColumn: util.getArg(aArgs, "column")
22309
+ };
22310
+ var sectionIndex = binarySearch.search(
22311
+ needle,
22312
+ this._sections,
22313
+ function(needle2, section2) {
22314
+ var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
22315
+ if (cmp) {
22316
+ return cmp;
22317
+ }
22318
+ return needle2.generatedColumn - section2.generatedOffset.generatedColumn;
22319
+ }
22320
+ );
22321
+ var section = this._sections[sectionIndex];
22322
+ if (!section) {
22323
+ return {
22324
+ source: null,
22325
+ line: null,
22326
+ column: null,
22327
+ name: null
22328
+ };
22329
+ }
22330
+ return section.consumer.originalPositionFor({
22331
+ line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
22332
+ column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
22333
+ bias: aArgs.bias
22334
+ });
22335
+ };
22336
+ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
22337
+ return this._sections.every(function(s) {
22338
+ return s.consumer.hasContentsOfAllSources();
22339
+ });
22340
+ };
22341
+ IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
22342
+ for (var i = 0; i < this._sections.length; i++) {
22343
+ var section = this._sections[i];
22344
+ var content = section.consumer.sourceContentFor(aSource, true);
22345
+ if (content) {
22346
+ return content;
22347
+ }
22348
+ }
22349
+ if (nullOnMissing) {
22350
+ return null;
22351
+ } else {
22352
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
22353
+ }
22354
+ };
22355
+ IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
22356
+ for (var i = 0; i < this._sections.length; i++) {
22357
+ var section = this._sections[i];
22358
+ if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) {
22359
+ continue;
22360
+ }
22361
+ var generatedPosition = section.consumer.generatedPositionFor(aArgs);
22362
+ if (generatedPosition) {
22363
+ var ret = {
22364
+ line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
22365
+ column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
22366
+ };
22367
+ return ret;
22368
+ }
22369
+ }
22370
+ return {
22371
+ line: null,
22372
+ column: null
22373
+ };
22374
+ };
22375
+ IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
22376
+ this.__generatedMappings = [];
22377
+ this.__originalMappings = [];
22378
+ for (var i = 0; i < this._sections.length; i++) {
22379
+ var section = this._sections[i];
22380
+ var sectionMappings = section.consumer._generatedMappings;
22381
+ for (var j = 0; j < sectionMappings.length; j++) {
22382
+ var mapping = sectionMappings[j];
22383
+ var source = section.consumer._sources.at(mapping.source);
22384
+ source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
22385
+ this._sources.add(source);
22386
+ source = this._sources.indexOf(source);
22387
+ var name = null;
22388
+ if (mapping.name) {
22389
+ name = section.consumer._names.at(mapping.name);
22390
+ this._names.add(name);
22391
+ name = this._names.indexOf(name);
22392
+ }
22393
+ var adjustedMapping = {
22394
+ source,
22395
+ generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
22396
+ generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
22397
+ originalLine: mapping.originalLine,
22398
+ originalColumn: mapping.originalColumn,
22399
+ name
22400
+ };
22401
+ this.__generatedMappings.push(adjustedMapping);
22402
+ if (typeof adjustedMapping.originalLine === "number") {
22403
+ this.__originalMappings.push(adjustedMapping);
22404
+ }
22405
+ }
22406
+ }
22407
+ quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
22408
+ quickSort(this.__originalMappings, util.compareByOriginalPositions);
22409
+ };
22410
+ exports2.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
22411
+ }
22412
+ });
22413
+
22414
+ // ../../node_modules/source-map-support/node_modules/source-map/lib/source-node.js
22415
+ var require_source_node = __commonJS({
22416
+ "../../node_modules/source-map-support/node_modules/source-map/lib/source-node.js"(exports2) {
22417
+ "use strict";
22418
+ var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
22419
+ var util = require_util();
22420
+ var REGEX_NEWLINE = /(\r?\n)/;
22421
+ var NEWLINE_CODE = 10;
22422
+ var isSourceNode = "$$$isSourceNode$$$";
22423
+ function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
22424
+ this.children = [];
22425
+ this.sourceContents = {};
22426
+ this.line = aLine == null ? null : aLine;
22427
+ this.column = aColumn == null ? null : aColumn;
22428
+ this.source = aSource == null ? null : aSource;
22429
+ this.name = aName == null ? null : aName;
22430
+ this[isSourceNode] = true;
22431
+ if (aChunks != null) this.add(aChunks);
22432
+ }
22433
+ SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
22434
+ var node = new SourceNode();
22435
+ var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
22436
+ var remainingLinesIndex = 0;
22437
+ var shiftNextLine = function() {
22438
+ var lineContents = getNextLine();
22439
+ var newLine = getNextLine() || "";
22440
+ return lineContents + newLine;
22441
+ function getNextLine() {
22442
+ return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
22443
+ }
22444
+ };
22445
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
22446
+ var lastMapping = null;
22447
+ aSourceMapConsumer.eachMapping(function(mapping) {
22448
+ if (lastMapping !== null) {
22449
+ if (lastGeneratedLine < mapping.generatedLine) {
22450
+ addMappingWithCode(lastMapping, shiftNextLine());
22451
+ lastGeneratedLine++;
22452
+ lastGeneratedColumn = 0;
22453
+ } else {
22454
+ var nextLine = remainingLines[remainingLinesIndex] || "";
22455
+ var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
22456
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
22457
+ lastGeneratedColumn = mapping.generatedColumn;
22458
+ addMappingWithCode(lastMapping, code);
22459
+ lastMapping = mapping;
22460
+ return;
22461
+ }
22462
+ }
22463
+ while (lastGeneratedLine < mapping.generatedLine) {
22464
+ node.add(shiftNextLine());
22465
+ lastGeneratedLine++;
22466
+ }
22467
+ if (lastGeneratedColumn < mapping.generatedColumn) {
22468
+ var nextLine = remainingLines[remainingLinesIndex] || "";
22469
+ node.add(nextLine.substr(0, mapping.generatedColumn));
22470
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
22471
+ lastGeneratedColumn = mapping.generatedColumn;
22472
+ }
22473
+ lastMapping = mapping;
22474
+ }, this);
22475
+ if (remainingLinesIndex < remainingLines.length) {
22476
+ if (lastMapping) {
22477
+ addMappingWithCode(lastMapping, shiftNextLine());
22478
+ }
22479
+ node.add(remainingLines.splice(remainingLinesIndex).join(""));
22480
+ }
22481
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
22482
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
22483
+ if (content != null) {
22484
+ if (aRelativePath != null) {
22485
+ sourceFile = util.join(aRelativePath, sourceFile);
22486
+ }
22487
+ node.setSourceContent(sourceFile, content);
22488
+ }
22489
+ });
22490
+ return node;
22491
+ function addMappingWithCode(mapping, code) {
22492
+ if (mapping === null || mapping.source === void 0) {
22493
+ node.add(code);
22494
+ } else {
22495
+ var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
22496
+ node.add(new SourceNode(
22497
+ mapping.originalLine,
22498
+ mapping.originalColumn,
22499
+ source,
22500
+ code,
22501
+ mapping.name
22502
+ ));
22503
+ }
22504
+ }
22505
+ };
22506
+ SourceNode.prototype.add = function SourceNode_add(aChunk) {
22507
+ if (Array.isArray(aChunk)) {
22508
+ aChunk.forEach(function(chunk) {
22509
+ this.add(chunk);
22510
+ }, this);
22511
+ } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
22512
+ if (aChunk) {
22513
+ this.children.push(aChunk);
22514
+ }
22515
+ } else {
22516
+ throw new TypeError(
22517
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
22518
+ );
22519
+ }
22520
+ return this;
22521
+ };
22522
+ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
22523
+ if (Array.isArray(aChunk)) {
22524
+ for (var i = aChunk.length - 1; i >= 0; i--) {
22525
+ this.prepend(aChunk[i]);
22526
+ }
22527
+ } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
22528
+ this.children.unshift(aChunk);
22529
+ } else {
22530
+ throw new TypeError(
22531
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
22532
+ );
22533
+ }
22534
+ return this;
22535
+ };
22536
+ SourceNode.prototype.walk = function SourceNode_walk(aFn) {
22537
+ var chunk;
22538
+ for (var i = 0, len = this.children.length; i < len; i++) {
22539
+ chunk = this.children[i];
22540
+ if (chunk[isSourceNode]) {
22541
+ chunk.walk(aFn);
22542
+ } else {
22543
+ if (chunk !== "") {
22544
+ aFn(chunk, {
22545
+ source: this.source,
22546
+ line: this.line,
22547
+ column: this.column,
22548
+ name: this.name
22549
+ });
22550
+ }
22551
+ }
22552
+ }
22553
+ };
22554
+ SourceNode.prototype.join = function SourceNode_join(aSep) {
22555
+ var newChildren;
22556
+ var i;
22557
+ var len = this.children.length;
22558
+ if (len > 0) {
22559
+ newChildren = [];
22560
+ for (i = 0; i < len - 1; i++) {
22561
+ newChildren.push(this.children[i]);
22562
+ newChildren.push(aSep);
22563
+ }
22564
+ newChildren.push(this.children[i]);
22565
+ this.children = newChildren;
22566
+ }
22567
+ return this;
22568
+ };
22569
+ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
22570
+ var lastChild = this.children[this.children.length - 1];
22571
+ if (lastChild[isSourceNode]) {
22572
+ lastChild.replaceRight(aPattern, aReplacement);
22573
+ } else if (typeof lastChild === "string") {
22574
+ this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
22575
+ } else {
22576
+ this.children.push("".replace(aPattern, aReplacement));
22577
+ }
22578
+ return this;
22579
+ };
22580
+ SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
22581
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
22582
+ };
22583
+ SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
22584
+ for (var i = 0, len = this.children.length; i < len; i++) {
22585
+ if (this.children[i][isSourceNode]) {
22586
+ this.children[i].walkSourceContents(aFn);
22587
+ }
22588
+ }
22589
+ var sources = Object.keys(this.sourceContents);
22590
+ for (var i = 0, len = sources.length; i < len; i++) {
22591
+ aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
22592
+ }
22593
+ };
22594
+ SourceNode.prototype.toString = function SourceNode_toString() {
22595
+ var str = "";
22596
+ this.walk(function(chunk) {
22597
+ str += chunk;
22598
+ });
22599
+ return str;
22600
+ };
22601
+ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
22602
+ var generated = {
22603
+ code: "",
22604
+ line: 1,
22605
+ column: 0
22606
+ };
22607
+ var map = new SourceMapGenerator(aArgs);
22608
+ var sourceMappingActive = false;
22609
+ var lastOriginalSource = null;
22610
+ var lastOriginalLine = null;
22611
+ var lastOriginalColumn = null;
22612
+ var lastOriginalName = null;
22613
+ this.walk(function(chunk, original) {
22614
+ generated.code += chunk;
22615
+ if (original.source !== null && original.line !== null && original.column !== null) {
22616
+ if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
22617
+ map.addMapping({
22618
+ source: original.source,
22619
+ original: {
22620
+ line: original.line,
22621
+ column: original.column
22622
+ },
22623
+ generated: {
22624
+ line: generated.line,
22625
+ column: generated.column
22626
+ },
22627
+ name: original.name
22628
+ });
22629
+ }
22630
+ lastOriginalSource = original.source;
22631
+ lastOriginalLine = original.line;
22632
+ lastOriginalColumn = original.column;
22633
+ lastOriginalName = original.name;
22634
+ sourceMappingActive = true;
22635
+ } else if (sourceMappingActive) {
22636
+ map.addMapping({
22637
+ generated: {
22638
+ line: generated.line,
22639
+ column: generated.column
22640
+ }
22641
+ });
22642
+ lastOriginalSource = null;
22643
+ sourceMappingActive = false;
22644
+ }
22645
+ for (var idx = 0, length = chunk.length; idx < length; idx++) {
22646
+ if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
22647
+ generated.line++;
22648
+ generated.column = 0;
22649
+ if (idx + 1 === length) {
22650
+ lastOriginalSource = null;
22651
+ sourceMappingActive = false;
22652
+ } else if (sourceMappingActive) {
22653
+ map.addMapping({
22654
+ source: original.source,
22655
+ original: {
22656
+ line: original.line,
22657
+ column: original.column
22658
+ },
22659
+ generated: {
22660
+ line: generated.line,
22661
+ column: generated.column
22662
+ },
22663
+ name: original.name
22664
+ });
22665
+ }
22666
+ } else {
22667
+ generated.column++;
22668
+ }
22669
+ }
22670
+ });
22671
+ this.walkSourceContents(function(sourceFile, sourceContent) {
22672
+ map.setSourceContent(sourceFile, sourceContent);
22673
+ });
22674
+ return { code: generated.code, map };
22675
+ };
22676
+ exports2.SourceNode = SourceNode;
22677
+ }
22678
+ });
22679
+
22680
+ // ../../node_modules/source-map-support/node_modules/source-map/source-map.js
22681
+ var require_source_map = __commonJS({
22682
+ "../../node_modules/source-map-support/node_modules/source-map/source-map.js"(exports2) {
22683
+ "use strict";
22684
+ exports2.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
22685
+ exports2.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
22686
+ exports2.SourceNode = require_source_node().SourceNode;
22687
+ }
22688
+ });
22689
+
22690
+ // ../../node_modules/buffer-from/index.js
22691
+ var require_buffer_from = __commonJS({
22692
+ "../../node_modules/buffer-from/index.js"(exports2, module2) {
22693
+ "use strict";
22694
+ var toString = Object.prototype.toString;
22695
+ var isModern = typeof Buffer !== "undefined" && typeof Buffer.alloc === "function" && typeof Buffer.allocUnsafe === "function" && typeof Buffer.from === "function";
22696
+ function isArrayBuffer(input) {
22697
+ return toString.call(input).slice(8, -1) === "ArrayBuffer";
22698
+ }
22699
+ function fromArrayBuffer(obj, byteOffset, length) {
22700
+ byteOffset >>>= 0;
22701
+ var maxLength = obj.byteLength - byteOffset;
22702
+ if (maxLength < 0) {
22703
+ throw new RangeError("'offset' is out of bounds");
22704
+ }
22705
+ if (length === void 0) {
22706
+ length = maxLength;
22707
+ } else {
22708
+ length >>>= 0;
22709
+ if (length > maxLength) {
22710
+ throw new RangeError("'length' is out of bounds");
22711
+ }
22712
+ }
22713
+ return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)));
22714
+ }
22715
+ function fromString(string, encoding) {
22716
+ if (typeof encoding !== "string" || encoding === "") {
22717
+ encoding = "utf8";
22718
+ }
22719
+ if (!Buffer.isEncoding(encoding)) {
22720
+ throw new TypeError('"encoding" must be a valid string encoding');
22721
+ }
22722
+ return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding);
22723
+ }
22724
+ function bufferFrom(value, encodingOrOffset, length) {
22725
+ if (typeof value === "number") {
22726
+ throw new TypeError('"value" argument must not be a number');
22727
+ }
22728
+ if (isArrayBuffer(value)) {
22729
+ return fromArrayBuffer(value, encodingOrOffset, length);
22730
+ }
22731
+ if (typeof value === "string") {
22732
+ return fromString(value, encodingOrOffset);
22733
+ }
22734
+ return isModern ? Buffer.from(value) : new Buffer(value);
22735
+ }
22736
+ module2.exports = bufferFrom;
22737
+ }
22738
+ });
22739
+
22740
+ // ../../node_modules/source-map-support/source-map-support.js
22741
+ var require_source_map_support = __commonJS({
22742
+ "../../node_modules/source-map-support/source-map-support.js"(exports2, module2) {
22743
+ "use strict";
22744
+ var SourceMapConsumer = require_source_map().SourceMapConsumer;
22745
+ var path = require("path");
22746
+ var fs;
22747
+ try {
22748
+ fs = require("fs");
22749
+ if (!fs.existsSync || !fs.readFileSync) {
22750
+ fs = null;
22751
+ }
22752
+ } catch (err) {
22753
+ }
22754
+ var bufferFrom = require_buffer_from();
22755
+ function dynamicRequire(mod, request) {
22756
+ return mod.require(request);
22757
+ }
22758
+ var errorFormatterInstalled = false;
22759
+ var uncaughtShimInstalled = false;
22760
+ var emptyCacheBetweenOperations = false;
22761
+ var environment = "auto";
22762
+ var fileContentsCache = {};
22763
+ var sourceMapCache = {};
22764
+ var reSourceMap = /^data:application\/json[^,]+base64,/;
22765
+ var retrieveFileHandlers = [];
22766
+ var retrieveMapHandlers = [];
22767
+ function isInBrowser() {
22768
+ if (environment === "browser")
22769
+ return true;
22770
+ if (environment === "node")
22771
+ return false;
22772
+ return typeof window !== "undefined" && typeof XMLHttpRequest === "function" && !(window.require && window.module && window.process && window.process.type === "renderer");
22773
+ }
22774
+ function hasGlobalProcessEventEmitter() {
22775
+ return typeof process === "object" && process !== null && typeof process.on === "function";
22776
+ }
22777
+ function globalProcessVersion() {
22778
+ if (typeof process === "object" && process !== null) {
22779
+ return process.version;
22780
+ } else {
22781
+ return "";
22782
+ }
22783
+ }
22784
+ function globalProcessStderr() {
22785
+ if (typeof process === "object" && process !== null) {
22786
+ return process.stderr;
22787
+ }
22788
+ }
22789
+ function globalProcessExit(code) {
22790
+ if (typeof process === "object" && process !== null && typeof process.exit === "function") {
22791
+ return process.exit(code);
22792
+ }
22793
+ }
22794
+ function handlerExec(list) {
22795
+ return function(arg) {
22796
+ for (var i = 0; i < list.length; i++) {
22797
+ var ret = list[i](arg);
22798
+ if (ret) {
22799
+ return ret;
22800
+ }
22801
+ }
22802
+ return null;
22803
+ };
22804
+ }
22805
+ var retrieveFile = handlerExec(retrieveFileHandlers);
22806
+ retrieveFileHandlers.push(function(path2) {
22807
+ path2 = path2.trim();
22808
+ if (/^file:/.test(path2)) {
22809
+ path2 = path2.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
22810
+ return drive ? "" : (
22811
+ // file:///C:/dir/file -> C:/dir/file
22812
+ "/"
22813
+ );
22814
+ });
22815
+ }
22816
+ if (path2 in fileContentsCache) {
22817
+ return fileContentsCache[path2];
22818
+ }
22819
+ var contents = "";
22820
+ try {
22821
+ if (!fs) {
22822
+ var xhr = new XMLHttpRequest();
22823
+ xhr.open(
22824
+ "GET",
22825
+ path2,
22826
+ /** async */
22827
+ false
22828
+ );
22829
+ xhr.send(null);
22830
+ if (xhr.readyState === 4 && xhr.status === 200) {
22831
+ contents = xhr.responseText;
22832
+ }
22833
+ } else if (fs.existsSync(path2)) {
22834
+ contents = fs.readFileSync(path2, "utf8");
22835
+ }
22836
+ } catch (er) {
22837
+ }
22838
+ return fileContentsCache[path2] = contents;
22839
+ });
22840
+ function supportRelativeURL(file, url) {
22841
+ if (!file) return url;
22842
+ var dir = path.dirname(file);
22843
+ var match = /^\w+:\/\/[^\/]*/.exec(dir);
22844
+ var protocol = match ? match[0] : "";
22845
+ var startPath = dir.slice(protocol.length);
22846
+ if (protocol && /^\/\w\:/.test(startPath)) {
22847
+ protocol += "/";
22848
+ return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
22849
+ }
22850
+ return protocol + path.resolve(dir.slice(protocol.length), url);
22851
+ }
22852
+ function retrieveSourceMapURL(source) {
22853
+ var fileData;
22854
+ if (isInBrowser()) {
22855
+ try {
22856
+ var xhr = new XMLHttpRequest();
22857
+ xhr.open("GET", source, false);
22858
+ xhr.send(null);
22859
+ fileData = xhr.readyState === 4 ? xhr.responseText : null;
22860
+ var sourceMapHeader = xhr.getResponseHeader("SourceMap") || xhr.getResponseHeader("X-SourceMap");
22861
+ if (sourceMapHeader) {
22862
+ return sourceMapHeader;
22863
+ }
22864
+ } catch (e) {
22865
+ }
22866
+ }
22867
+ fileData = retrieveFile(source);
22868
+ var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg;
22869
+ var lastMatch, match;
22870
+ while (match = re.exec(fileData)) lastMatch = match;
22871
+ if (!lastMatch) return null;
22872
+ return lastMatch[1];
22873
+ }
22874
+ var retrieveSourceMap = handlerExec(retrieveMapHandlers);
22875
+ retrieveMapHandlers.push(function(source) {
22876
+ var sourceMappingURL = retrieveSourceMapURL(source);
22877
+ if (!sourceMappingURL) return null;
22878
+ var sourceMapData;
22879
+ if (reSourceMap.test(sourceMappingURL)) {
22880
+ var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
22881
+ sourceMapData = bufferFrom(rawData, "base64").toString();
22882
+ sourceMappingURL = source;
22883
+ } else {
22884
+ sourceMappingURL = supportRelativeURL(source, sourceMappingURL);
22885
+ sourceMapData = retrieveFile(sourceMappingURL);
22886
+ }
22887
+ if (!sourceMapData) {
22888
+ return null;
22889
+ }
22890
+ return {
22891
+ url: sourceMappingURL,
22892
+ map: sourceMapData
22893
+ };
22894
+ });
22895
+ function mapSourcePosition(position) {
22896
+ var sourceMap = sourceMapCache[position.source];
22897
+ if (!sourceMap) {
22898
+ var urlAndMap = retrieveSourceMap(position.source);
22899
+ if (urlAndMap) {
22900
+ sourceMap = sourceMapCache[position.source] = {
22901
+ url: urlAndMap.url,
22902
+ map: new SourceMapConsumer(urlAndMap.map)
22903
+ };
22904
+ if (sourceMap.map.sourcesContent) {
22905
+ sourceMap.map.sources.forEach(function(source, i) {
22906
+ var contents = sourceMap.map.sourcesContent[i];
22907
+ if (contents) {
22908
+ var url = supportRelativeURL(sourceMap.url, source);
22909
+ fileContentsCache[url] = contents;
22910
+ }
22911
+ });
22912
+ }
22913
+ } else {
22914
+ sourceMap = sourceMapCache[position.source] = {
22915
+ url: null,
22916
+ map: null
22917
+ };
22918
+ }
22919
+ }
22920
+ if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === "function") {
22921
+ var originalPosition = sourceMap.map.originalPositionFor(position);
22922
+ if (originalPosition.source !== null) {
22923
+ originalPosition.source = supportRelativeURL(
22924
+ sourceMap.url,
22925
+ originalPosition.source
22926
+ );
22927
+ return originalPosition;
22928
+ }
22929
+ }
22930
+ return position;
22931
+ }
22932
+ function mapEvalOrigin(origin) {
22933
+ var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
22934
+ if (match) {
22935
+ var position = mapSourcePosition({
22936
+ source: match[2],
22937
+ line: +match[3],
22938
+ column: match[4] - 1
22939
+ });
22940
+ return "eval at " + match[1] + " (" + position.source + ":" + position.line + ":" + (position.column + 1) + ")";
22941
+ }
22942
+ match = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
22943
+ if (match) {
22944
+ return "eval at " + match[1] + " (" + mapEvalOrigin(match[2]) + ")";
22945
+ }
22946
+ return origin;
22947
+ }
22948
+ function CallSiteToString() {
22949
+ var fileName;
22950
+ var fileLocation = "";
22951
+ if (this.isNative()) {
22952
+ fileLocation = "native";
22953
+ } else {
22954
+ fileName = this.getScriptNameOrSourceURL();
22955
+ if (!fileName && this.isEval()) {
22956
+ fileLocation = this.getEvalOrigin();
22957
+ fileLocation += ", ";
22958
+ }
22959
+ if (fileName) {
22960
+ fileLocation += fileName;
22961
+ } else {
22962
+ fileLocation += "<anonymous>";
22963
+ }
22964
+ var lineNumber = this.getLineNumber();
22965
+ if (lineNumber != null) {
22966
+ fileLocation += ":" + lineNumber;
22967
+ var columnNumber = this.getColumnNumber();
22968
+ if (columnNumber) {
22969
+ fileLocation += ":" + columnNumber;
22970
+ }
22971
+ }
22972
+ }
22973
+ var line = "";
22974
+ var functionName = this.getFunctionName();
22975
+ var addSuffix = true;
22976
+ var isConstructor = this.isConstructor();
22977
+ var isMethodCall = !(this.isToplevel() || isConstructor);
22978
+ if (isMethodCall) {
22979
+ var typeName = this.getTypeName();
22980
+ if (typeName === "[object Object]") {
22981
+ typeName = "null";
22982
+ }
22983
+ var methodName = this.getMethodName();
22984
+ if (functionName) {
22985
+ if (typeName && functionName.indexOf(typeName) != 0) {
22986
+ line += typeName + ".";
22987
+ }
22988
+ line += functionName;
22989
+ if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) {
22990
+ line += " [as " + methodName + "]";
22991
+ }
22992
+ } else {
22993
+ line += typeName + "." + (methodName || "<anonymous>");
22994
+ }
22995
+ } else if (isConstructor) {
22996
+ line += "new " + (functionName || "<anonymous>");
22997
+ } else if (functionName) {
22998
+ line += functionName;
22999
+ } else {
23000
+ line += fileLocation;
23001
+ addSuffix = false;
23002
+ }
23003
+ if (addSuffix) {
23004
+ line += " (" + fileLocation + ")";
23005
+ }
23006
+ return line;
23007
+ }
23008
+ function cloneCallSite(frame) {
23009
+ var object = {};
23010
+ Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
23011
+ object[name] = /^(?:is|get)/.test(name) ? function() {
23012
+ return frame[name].call(frame);
23013
+ } : frame[name];
23014
+ });
23015
+ object.toString = CallSiteToString;
23016
+ return object;
23017
+ }
23018
+ function wrapCallSite(frame, state) {
23019
+ if (state === void 0) {
23020
+ state = { nextPosition: null, curPosition: null };
23021
+ }
23022
+ if (frame.isNative()) {
23023
+ state.curPosition = null;
23024
+ return frame;
23025
+ }
23026
+ var source = frame.getFileName() || frame.getScriptNameOrSourceURL();
23027
+ if (source) {
23028
+ var line = frame.getLineNumber();
23029
+ var column = frame.getColumnNumber() - 1;
23030
+ var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;
23031
+ var headerLength = noHeader.test(globalProcessVersion()) ? 0 : 62;
23032
+ if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) {
23033
+ column -= headerLength;
23034
+ }
23035
+ var position = mapSourcePosition({
23036
+ source,
23037
+ line,
23038
+ column
23039
+ });
23040
+ state.curPosition = position;
23041
+ frame = cloneCallSite(frame);
23042
+ var originalFunctionName = frame.getFunctionName;
23043
+ frame.getFunctionName = function() {
23044
+ if (state.nextPosition == null) {
23045
+ return originalFunctionName();
23046
+ }
23047
+ return state.nextPosition.name || originalFunctionName();
23048
+ };
23049
+ frame.getFileName = function() {
23050
+ return position.source;
23051
+ };
23052
+ frame.getLineNumber = function() {
23053
+ return position.line;
23054
+ };
23055
+ frame.getColumnNumber = function() {
23056
+ return position.column + 1;
23057
+ };
23058
+ frame.getScriptNameOrSourceURL = function() {
23059
+ return position.source;
23060
+ };
23061
+ return frame;
23062
+ }
23063
+ var origin = frame.isEval() && frame.getEvalOrigin();
23064
+ if (origin) {
23065
+ origin = mapEvalOrigin(origin);
23066
+ frame = cloneCallSite(frame);
23067
+ frame.getEvalOrigin = function() {
23068
+ return origin;
23069
+ };
23070
+ return frame;
23071
+ }
23072
+ return frame;
23073
+ }
23074
+ function prepareStackTrace(error, stack) {
23075
+ if (emptyCacheBetweenOperations) {
23076
+ fileContentsCache = {};
23077
+ sourceMapCache = {};
23078
+ }
23079
+ var name = error.name || "Error";
23080
+ var message = error.message || "";
23081
+ var errorString = name + ": " + message;
23082
+ var state = { nextPosition: null, curPosition: null };
23083
+ var processedStack = [];
23084
+ for (var i = stack.length - 1; i >= 0; i--) {
23085
+ processedStack.push("\n at " + wrapCallSite(stack[i], state));
23086
+ state.nextPosition = state.curPosition;
23087
+ }
23088
+ state.curPosition = state.nextPosition = null;
23089
+ return errorString + processedStack.reverse().join("");
23090
+ }
23091
+ function getErrorSource(error) {
23092
+ var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
23093
+ if (match) {
23094
+ var source = match[1];
23095
+ var line = +match[2];
23096
+ var column = +match[3];
23097
+ var contents = fileContentsCache[source];
23098
+ if (!contents && fs && fs.existsSync(source)) {
23099
+ try {
23100
+ contents = fs.readFileSync(source, "utf8");
23101
+ } catch (er) {
23102
+ contents = "";
23103
+ }
23104
+ }
23105
+ if (contents) {
23106
+ var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1];
23107
+ if (code) {
23108
+ return source + ":" + line + "\n" + code + "\n" + new Array(column).join(" ") + "^";
23109
+ }
23110
+ }
23111
+ }
23112
+ return null;
23113
+ }
23114
+ function printErrorAndExit(error) {
23115
+ var source = getErrorSource(error);
23116
+ var stderr = globalProcessStderr();
23117
+ if (stderr && stderr._handle && stderr._handle.setBlocking) {
23118
+ stderr._handle.setBlocking(true);
23119
+ }
23120
+ if (source) {
23121
+ console.error();
23122
+ console.error(source);
23123
+ }
23124
+ console.error(error.stack);
23125
+ globalProcessExit(1);
23126
+ }
23127
+ function shimEmitUncaughtException() {
23128
+ var origEmit = process.emit;
23129
+ process.emit = function(type) {
23130
+ if (type === "uncaughtException") {
23131
+ var hasStack = arguments[1] && arguments[1].stack;
23132
+ var hasListeners = this.listeners(type).length > 0;
23133
+ if (hasStack && !hasListeners) {
23134
+ return printErrorAndExit(arguments[1]);
23135
+ }
23136
+ }
23137
+ return origEmit.apply(this, arguments);
23138
+ };
23139
+ }
23140
+ var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);
23141
+ var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);
23142
+ exports2.wrapCallSite = wrapCallSite;
23143
+ exports2.getErrorSource = getErrorSource;
23144
+ exports2.mapSourcePosition = mapSourcePosition;
23145
+ exports2.retrieveSourceMap = retrieveSourceMap;
23146
+ exports2.install = function(options) {
23147
+ options = options || {};
23148
+ if (options.environment) {
23149
+ environment = options.environment;
23150
+ if (["node", "browser", "auto"].indexOf(environment) === -1) {
23151
+ throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}");
23152
+ }
23153
+ }
23154
+ if (options.retrieveFile) {
23155
+ if (options.overrideRetrieveFile) {
23156
+ retrieveFileHandlers.length = 0;
23157
+ }
23158
+ retrieveFileHandlers.unshift(options.retrieveFile);
23159
+ }
23160
+ if (options.retrieveSourceMap) {
23161
+ if (options.overrideRetrieveSourceMap) {
23162
+ retrieveMapHandlers.length = 0;
23163
+ }
23164
+ retrieveMapHandlers.unshift(options.retrieveSourceMap);
23165
+ }
23166
+ if (options.hookRequire && !isInBrowser()) {
23167
+ var Module = dynamicRequire(module2, "module");
23168
+ var $compile = Module.prototype._compile;
23169
+ if (!$compile.__sourceMapSupport) {
23170
+ Module.prototype._compile = function(content, filename) {
23171
+ fileContentsCache[filename] = content;
23172
+ sourceMapCache[filename] = void 0;
23173
+ return $compile.call(this, content, filename);
23174
+ };
23175
+ Module.prototype._compile.__sourceMapSupport = true;
23176
+ }
23177
+ }
23178
+ if (!emptyCacheBetweenOperations) {
23179
+ emptyCacheBetweenOperations = "emptyCacheBetweenOperations" in options ? options.emptyCacheBetweenOperations : false;
23180
+ }
23181
+ if (!errorFormatterInstalled) {
23182
+ errorFormatterInstalled = true;
23183
+ Error.prepareStackTrace = prepareStackTrace;
23184
+ }
23185
+ if (!uncaughtShimInstalled) {
23186
+ var installHandler = "handleUncaughtExceptions" in options ? options.handleUncaughtExceptions : true;
23187
+ try {
23188
+ var worker_threads = dynamicRequire(module2, "worker_threads");
23189
+ if (worker_threads.isMainThread === false) {
23190
+ installHandler = false;
23191
+ }
23192
+ } catch (e) {
23193
+ }
23194
+ if (installHandler && hasGlobalProcessEventEmitter()) {
23195
+ uncaughtShimInstalled = true;
23196
+ shimEmitUncaughtException();
23197
+ }
23198
+ }
23199
+ };
23200
+ exports2.resetRetrieveHandlers = function() {
23201
+ retrieveFileHandlers.length = 0;
23202
+ retrieveMapHandlers.length = 0;
23203
+ retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
23204
+ retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
23205
+ retrieveSourceMap = handlerExec(retrieveMapHandlers);
23206
+ retrieveFile = handlerExec(retrieveFileHandlers);
23207
+ };
23208
+ }
23209
+ });
23210
+
20508
23211
  // ../../node_modules/typescript/lib/typescript.js
20509
23212
  var require_typescript = __commonJS({
20510
23213
  "../../node_modules/typescript/lib/typescript.js"(exports2, module2) {
@@ -29161,7 +31864,7 @@ ${lanes.join("\n")}
29161
31864
  debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || some(process.execArgv, (arg) => /^--(?:inspect|debug)(?:-brk)?(?:=\d+)?$/i.test(arg)) || !!process.recordreplay,
29162
31865
  tryEnableSourceMapsForHost() {
29163
31866
  try {
29164
- require("source-map-support").install();
31867
+ require_source_map_support().install();
29165
31868
  } catch {
29166
31869
  }
29167
31870
  },
@@ -231260,6 +233963,7 @@ var require_scan = __commonJS({
231260
233963
  exports2.joinPath = joinPath;
231261
233964
  exports2.hasModifier = hasModifier;
231262
233965
  exports2.decoratorsOf = decoratorsOf;
233966
+ var shared_1 = (init_dist(), __toCommonJS(dist_exports));
231263
233967
  var node_fs_1 = require("fs");
231264
233968
  var node_path_1 = require("path");
231265
233969
  var typescript_1 = __importDefault(require_typescript());
@@ -231329,7 +234033,7 @@ var require_scan = __commonJS({
231329
234033
  return a || "/";
231330
234034
  if (b.startsWith("/") && !a)
231331
234035
  return b;
231332
- return `${(a || "").replace(/\/+$/, "")}/${b.replace(/^\/+/, "")}`.replace(/\/{2,}/g, "/");
234036
+ return `${(0, shared_1.stripTrailingSlashes)(a || "")}/${b.replace(/^\/+/, "")}`.replace(/\/{2,}/g, "/");
231333
234037
  }
231334
234038
  function hasModifier(node, kind) {
231335
234039
  return typescript_1.default.canHaveModifiers(node) && (typescript_1.default.getModifiers(node) ?? []).some((modifier) => modifier.kind === kind);
@@ -231674,6 +234378,7 @@ var require_clients = __commonJS({
231674
234378
  exports2.runClientSurface = runClientSurface;
231675
234379
  exports2.applyAuthPrefixes = applyAuthPrefixes;
231676
234380
  exports2.noteUnsupported = noteUnsupported;
234381
+ var shared_1 = (init_dist(), __toCommonJS(dist_exports));
231677
234382
  var node_path_1 = require("path");
231678
234383
  var typescript_1 = __importDefault(require_typescript());
231679
234384
  var scan_js_1 = require_scan();
@@ -232128,7 +234833,7 @@ var require_clients = __commonJS({
232128
234833
  if (!splat.prefix)
232129
234834
  continue;
232130
234835
  for (const link of linkTargets) {
232131
- const path = link.path.split(/[?#]/)[0]?.replace(/\/+$/, "") ?? "";
234836
+ const path = (0, shared_1.stripTrailingSlashes)(link.path.split(/[?#]/)[0] ?? "");
232132
234837
  if (path.startsWith(`${splat.prefix}/`) && path.length > splat.prefix.length + 1 && !ctx.routes.some((route) => route.kind === "page" && !/\*$/.test(route.path) && segMatch(route.path, path))) {
232133
234838
  ctx.coverage.rulesApplied.add("link-under-splat");
232134
234839
  ctx.add({ path, kind: "page", rule: "link-under-splat", file: link.file, line: link.line, purpose: link.text || (0, scan_js_1.words)(path.slice(splat.prefix.length)) });
@@ -232223,7 +234928,7 @@ var require_clients = __commonJS({
232223
234928
  const serverApi = ctx.routes.filter((route) => route.kind === "api");
232224
234929
  const mountBases = [...new Set(serverApi.map((route) => route.path.split("/").slice(0, 2).join("/")).filter((base) => base && base !== "/"))];
232225
234930
  for (const call of clientCalls) {
232226
- let path = call.path.replace(/\/+$/, "") || "/";
234931
+ let path = (0, shared_1.stripTrailingSlashes)(call.path) || "/";
232227
234932
  if (/\.(png|jpe?g|svg|gif|webp|css|js|json|ico|mp3|mp4|woff2?)$/.test(path))
232228
234933
  continue;
232229
234934
  const candidates = [path, ...mountBases.map((base) => (0, scan_js_1.joinPath)(base, path))];
@@ -232724,6 +235429,7 @@ var require_seed = __commonJS({
232724
235429
  "use strict";
232725
235430
  Object.defineProperty(exports2, "__esModule", { value: true });
232726
235431
  exports2.seedRouteManifest = seedRouteManifest;
235432
+ var shared_1 = (init_dist(), __toCommonJS(dist_exports));
232727
235433
  var route_manifest_js_1 = require_route_manifest();
232728
235434
  var route_seed_js_1 = require_route_seed();
232729
235435
  var clients_js_1 = require_clients();
@@ -232749,7 +235455,7 @@ var require_seed = __commonJS({
232749
235455
  return "route-config";
232750
235456
  }
232751
235457
  function shapeManifest(ctx) {
232752
- const familyKey = (row) => `${row.kind === "api" ? "api" : "page"} ${row.path.toLowerCase().replace(/\/+$/, "") || "/"}`;
235458
+ const familyKey = (row) => `${row.kind === "api" ? "api" : "page"} ${(0, shared_1.stripTrailingSlashes)(row.path.toLowerCase()) || "/"}`;
232753
235459
  const byFamily = /* @__PURE__ */ new Map();
232754
235460
  for (const row of ctx.routes.slice().sort((a, b) => ruleRank(a.rule) - ruleRank(b.rule))) {
232755
235461
  const key = familyKey(row);