@knpkv/rly 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +11 -3
  2. package/dist/{Dialog-_t9OodCK.js → Dialog-B9Ub_gMT.js} +79 -62
  3. package/dist/Dialog-B9Ub_gMT.js.map +1 -0
  4. package/dist/components.css +2 -2
  5. package/dist/diff/bounded/index.js +317 -303
  6. package/dist/diff/bounded/index.js.map +1 -1
  7. package/dist/diff/index.js +2436 -2433
  8. package/dist/diff/index.js.map +1 -1
  9. package/dist/diff/patch/index.js +188 -186
  10. package/dist/diff/patch/index.js.map +1 -1
  11. package/dist/diff/workbench/index.js +1 -1
  12. package/dist/dts/diff/DiffCodeView.d.ts.map +1 -1
  13. package/dist/dts/diff/DiffFileTree.d.ts.map +1 -1
  14. package/dist/dts/diff/DiffFinding.d.ts.map +1 -1
  15. package/dist/dts/diff/DiffHeader.d.ts.map +1 -1
  16. package/dist/dts/diff/bounded/BoundedDiffCodeView.d.ts.map +1 -1
  17. package/dist/dts/diff/patch/PatchDiffView.d.ts.map +1 -1
  18. package/dist/dts/internal/useNarrowerThan.d.ts +10 -0
  19. package/dist/dts/internal/useNarrowerThan.d.ts.map +1 -0
  20. package/dist/dts/patterns/AgentThread.d.ts.map +1 -1
  21. package/dist/dts/patterns/FreshnessStamp.d.ts.map +1 -1
  22. package/dist/dts/patterns/ReleaseRelay.d.ts.map +1 -1
  23. package/dist/dts/patterns/Verdict.d.ts +1 -1
  24. package/dist/dts/patterns/Verdict.d.ts.map +1 -1
  25. package/dist/dts/primitives/Button.d.ts +9 -4
  26. package/dist/dts/primitives/Button.d.ts.map +1 -1
  27. package/dist/dts/primitives/Field.d.ts +8 -3
  28. package/dist/dts/primitives/Field.d.ts.map +1 -1
  29. package/dist/dts/primitives/IconButton.d.ts +9 -4
  30. package/dist/dts/primitives/IconButton.d.ts.map +1 -1
  31. package/dist/dts/primitives/Notice.d.ts +5 -5
  32. package/dist/dts/primitives/Select.d.ts +8 -3
  33. package/dist/dts/primitives/Select.d.ts.map +1 -1
  34. package/dist/dts/primitives/StateLabel.d.ts +6 -6
  35. package/dist/dts/primitives/StateLabel.d.ts.map +1 -1
  36. package/dist/dts/primitives/StatePanel.d.ts +7 -6
  37. package/dist/dts/primitives/StatePanel.d.ts.map +1 -1
  38. package/dist/dts/primitives/ThemeSelect.d.ts +3 -2
  39. package/dist/dts/primitives/ThemeSelect.d.ts.map +1 -1
  40. package/dist/dts/primitives/ToggleGroup.d.ts +9 -4
  41. package/dist/dts/primitives/ToggleGroup.d.ts.map +1 -1
  42. package/dist/dts/tokens/control.d.ts +27 -0
  43. package/dist/dts/tokens/control.d.ts.map +1 -0
  44. package/dist/dts/tokens/index.d.ts +2 -2
  45. package/dist/dts/tokens/index.d.ts.map +1 -1
  46. package/dist/dts/tokens/semantic-tokens.d.ts +2 -0
  47. package/dist/dts/tokens/semantic-tokens.d.ts.map +1 -1
  48. package/dist/generated-tokens.css +19 -6
  49. package/dist/index.js +5 -5
  50. package/dist/patterns/index.js +1 -1
  51. package/dist/{patterns-lOWLKH70.js → patterns-DTsU3pFo.js} +12 -14
  52. package/dist/patterns-DTsU3pFo.js.map +1 -0
  53. package/dist/primitives/index.js +2 -2
  54. package/dist/{primitives-Dj-qYrUZ.js → primitives-CgvvYKjR.js} +167 -161
  55. package/dist/primitives-CgvvYKjR.js.map +1 -0
  56. package/dist/tokens/index.js +2 -2
  57. package/dist/{tokens-DaF1m6rr.js → tokens-B075JP3Z.js} +7 -2
  58. package/dist/tokens-B075JP3Z.js.map +1 -0
  59. package/dist/useNarrowerThan-B1PM32sm.js +21 -0
  60. package/dist/useNarrowerThan-B1PM32sm.js.map +1 -0
  61. package/dist/{workbench-4C25n_BY.js → workbench-CHCnYW3G.js} +107 -131
  62. package/dist/workbench-CHCnYW3G.js.map +1 -0
  63. package/package.json +5 -3
  64. package/registry/components.json +68 -13
  65. package/registry/search.json +9 -0
  66. package/dist/Dialog-_t9OodCK.js.map +0 -1
  67. package/dist/patterns-lOWLKH70.js.map +0 -1
  68. package/dist/primitives-Dj-qYrUZ.js.map +0 -1
  69. package/dist/tokens-DaF1m6rr.js.map +0 -1
  70. package/dist/workbench-4C25n_BY.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { Fragment as e, createElement as t, useRef as n } from "react";
3
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { Fragment as e, createElement as t, useCallback as n, useRef as r, useState as i } from "react";
3
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
4
  (() => {
5
5
  try {
6
6
  return process.env.NODE_ENV === "development";
@@ -8,48 +8,48 @@ import { jsx as r, jsxs as i } from "react/jsx-runtime";
8
8
  return !1;
9
9
  }
10
10
  })();
11
- var a = /(?=^diff --git)/gm, o = /^(---|\+\+\+)\s+([^\t\r\n]+)/, s = /^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i;
11
+ var s = /(?=^diff --git)/gm, c = /^(---|\+\+\+)\s+([^\t\r\n]+)/, l = /^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i;
12
12
  Object.freeze({
13
13
  fromStart: 0,
14
14
  fromEnd: 0
15
15
  });
16
16
  //#endregion
17
17
  //#region ../../node_modules/.pnpm/@pierre+diffs@1.5.1_patch_hash=ce17810cfea58efa02eb4e70947801afb36c9f8a08a8bb4c810297c2_63846ff899210db6647d73492b0c4e78/node_modules/@pierre/diffs/dist/utils/getHunkSideBoundaries.js
18
- function c(e, t) {
18
+ function u(e, t) {
19
19
  return e - (t === 0 ? 0 : 1);
20
20
  }
21
- function l(e, t) {
22
- return c(e, t) + t;
21
+ function d(e, t) {
22
+ return u(e, t) + t;
23
23
  }
24
24
  //#endregion
25
25
  //#region ../../node_modules/.pnpm/@pierre+diffs@1.5.1_patch_hash=ce17810cfea58efa02eb4e70947801afb36c9f8a08a8bb4c810297c2_63846ff899210db6647d73492b0c4e78/node_modules/@pierre/diffs/dist/utils/composeCacheKey.js
26
- var u = 1;
27
- function d(e, ...t) {
28
- return `ck${u}:${JSON.stringify([e, ...t])}`;
26
+ var f = 1;
27
+ function p(e, ...t) {
28
+ return `ck${f}:${JSON.stringify([e, ...t])}`;
29
29
  }
30
30
  //#endregion
31
31
  //#region ../../node_modules/.pnpm/@pierre+diffs@1.5.1_patch_hash=ce17810cfea58efa02eb4e70947801afb36c9f8a08a8bb4c810297c2_63846ff899210db6647d73492b0c4e78/node_modules/@pierre/diffs/dist/utils/cleanLastNewline.js
32
- function f(e) {
32
+ function m(e) {
33
33
  let t = e.length;
34
34
  return e.charCodeAt(t - 1) === 10 && (t--, e.charCodeAt(t - 1) === 13 && t--), e.slice(0, t);
35
35
  }
36
36
  //#endregion
37
37
  //#region ../../node_modules/.pnpm/@pierre+diffs@1.5.1_patch_hash=ce17810cfea58efa02eb4e70947801afb36c9f8a08a8bb4c810297c2_63846ff899210db6647d73492b0c4e78/node_modules/@pierre/diffs/dist/utils/detachString.js
38
- var p = new TextEncoder(), m = new TextDecoder("utf-8", { ignoreBOM: !0 }), h = /[\uD800-\uDFFF]/, g = 1024, _ = new Uint8Array(g);
39
- function v() {
40
- _.length !== g && (_ = new Uint8Array(g));
38
+ var h = new TextEncoder(), g = new TextDecoder("utf-8", { ignoreBOM: !0 }), _ = /[\uD800-\uDFFF]/, v = 1024, y = new Uint8Array(v);
39
+ function b() {
40
+ y.length !== v && (y = new Uint8Array(v));
41
41
  }
42
- function y(e) {
42
+ function x(e) {
43
43
  if (e.length === 0) return e;
44
- if (h.test(e)) return JSON.parse(JSON.stringify(e));
44
+ if (_.test(e)) return JSON.parse(JSON.stringify(e));
45
45
  let t = e.length * 3;
46
- _.length < t && (_ = new Uint8Array(t));
47
- let { written: n } = p.encodeInto(e, _);
48
- return m.decode(_.subarray(0, n));
46
+ y.length < t && (y = new Uint8Array(t));
47
+ let { written: n } = h.encodeInto(e, y);
48
+ return g.decode(y.subarray(0, n));
49
49
  }
50
50
  //#endregion
51
51
  //#region ../../node_modules/.pnpm/@pierre+diffs@1.5.1_patch_hash=ce17810cfea58efa02eb4e70947801afb36c9f8a08a8bb4c810297c2_63846ff899210db6647d73492b0c4e78/node_modules/@pierre/diffs/dist/utils/parseQuotedDiffFileName.js
52
- var b = new TextDecoder("utf-8", { ignoreBOM: !0 }), x = {
52
+ var S = new TextDecoder("utf-8", { ignoreBOM: !0 }), C = {
53
53
  "\"": "\"",
54
54
  "\\": "\\",
55
55
  a: "\x07",
@@ -60,7 +60,7 @@ var b = new TextDecoder("utf-8", { ignoreBOM: !0 }), x = {
60
60
  f: "\f",
61
61
  r: "\r"
62
62
  };
63
- function S(e) {
63
+ function w(e) {
64
64
  if (e[0] !== "\"") return;
65
65
  let t = "", n = 1;
66
66
  for (; n < e.length;) {
@@ -73,47 +73,47 @@ function S(e) {
73
73
  t += r, n++;
74
74
  continue;
75
75
  }
76
- let i = x[e[n + 1]];
76
+ let i = C[e[n + 1]];
77
77
  if (i != null) {
78
78
  t += i, n += 2;
79
79
  continue;
80
80
  }
81
81
  let a = [];
82
82
  do {
83
- let t = C(e, n + 1);
83
+ let t = T(e, n + 1);
84
84
  if (t == null) return;
85
85
  a.push(t), n += 4;
86
86
  } while (e[n] === "\\" && e[n + 1] >= "0" && e[n + 1] <= "7");
87
- t += b.decode(new Uint8Array(a));
87
+ t += S.decode(new Uint8Array(a));
88
88
  }
89
89
  }
90
- function C(e, t) {
90
+ function T(e, t) {
91
91
  let n = e.charCodeAt(t) - 48, r = e.charCodeAt(t + 1) - 48, i = e.charCodeAt(t + 2) - 48;
92
92
  if (n >= 0 && n <= 3 && r >= 0 && r <= 7 && i >= 0 && i <= 7) return n * 64 + r * 8 + i;
93
93
  }
94
94
  //#endregion
95
95
  //#region ../../node_modules/.pnpm/@pierre+diffs@1.5.1_patch_hash=ce17810cfea58efa02eb4e70947801afb36c9f8a08a8bb4c810297c2_63846ff899210db6647d73492b0c4e78/node_modules/@pierre/diffs/dist/utils/realignChangeContent.js
96
- var w = 4096, T = .5;
97
- function E(e) {
96
+ var E = 4096, D = .5;
97
+ function O(e) {
98
98
  for (let t of e.hunks) for (let n = 0; n < t.hunkContent.length; n++) {
99
99
  let r = t.hunkContent[n];
100
100
  if (r.type !== "change") continue;
101
- let i = D(e, r);
101
+ let i = ee(e, r);
102
102
  i != null && (t.hunkContent.splice(n, 1, ...i), n += i.length - 1);
103
103
  }
104
104
  }
105
- function D(e, t) {
105
+ function ee(e, t) {
106
106
  let { deletions: n, additions: r, deletionLineIndex: i, additionLineIndex: a } = t, o = Math.min(n, r), s = Math.abs(r - n);
107
- if (o === 0 || s === 0 || o * (s + 1) > w) return null;
107
+ if (o === 0 || s === 0 || o * (s + 1) > E) return null;
108
108
  let c = [];
109
- for (let t = 0; t < n; t++) c.push(ee(e.deletionLines[i + t] ?? ""));
109
+ for (let t = 0; t < n; t++) c.push(ne(e.deletionLines[i + t] ?? ""));
110
110
  let l = [];
111
- for (let t = 0; t < r; t++) l.push(ee(e.additionLines[a + t] ?? ""));
111
+ for (let t = 0; t < r; t++) l.push(ne(e.additionLines[a + t] ?? ""));
112
112
  let u = r > n, d = 0, f = -1;
113
113
  for (let e = 0; e <= s; e++) {
114
114
  let t = 0;
115
- for (let n = 0; n < o; n++) t += te(c[n + (u ? 0 : e)], l[n + (u ? e : 0)]);
116
- e === 0 ? f = t + o * T : t > f && (f = t, d = e);
115
+ for (let n = 0; n < o; n++) t += re(c[n + (u ? 0 : e)], l[n + (u ? e : 0)]);
116
+ e === 0 ? f = t + o * D : t > f && (f = t, d = e);
117
117
  }
118
118
  if (d === 0) return null;
119
119
  let p = [], m = (e, t, n, r) => {
@@ -127,11 +127,11 @@ function D(e, t) {
127
127
  };
128
128
  return u ? (m(0, d, i, a), m(o, o, i, a + d), m(0, r - o - d, i + o, a + d + o)) : (m(d, 0, i, a), m(o, o, i + d, a), m(n - o - d, 0, i + d + o, a + o)), p;
129
129
  }
130
- var O = /\s+/g;
131
- function ee(e) {
132
- return e.replace(O, "");
130
+ var te = /\s+/g;
131
+ function ne(e) {
132
+ return e.replace(te, "");
133
133
  }
134
- function te(e, t) {
134
+ function re(e, t) {
135
135
  if (e === t) return 1;
136
136
  let n = Math.max(e.length, t.length), r = Math.min(e.length, t.length);
137
137
  if (r === 0) return 0;
@@ -143,72 +143,72 @@ function te(e, t) {
143
143
  }
144
144
  //#endregion
145
145
  //#region ../../node_modules/.pnpm/@pierre+diffs@1.5.1_patch_hash=ce17810cfea58efa02eb4e70947801afb36c9f8a08a8bb4c810297c2_63846ff899210db6647d73492b0c4e78/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js
146
- var ne = /^diff --git ("a\/(?:[^"\\]|\\.)*"|a\/.+?) ("b\/(?:[^"\\]|\\.)*"|b\/.+?)$/;
147
- function re(e, t) {
146
+ var ie = /^diff --git ("a\/(?:[^"\\]|\\.)*"|a\/.+?) ("b\/(?:[^"\\]|\\.)*"|b\/.+?)$/;
147
+ function ae(e, t) {
148
148
  try {
149
- return ie(e, t);
149
+ return oe(e, t);
150
150
  } finally {
151
- v();
151
+ b();
152
152
  }
153
153
  }
154
- function ie(e, { cacheKey: t, isGitDiff: n = a.test(e), oldFile: r, newFile: i, throwOnError: u = !1 } = {}) {
155
- let d = 0, p = de(e, "@@ "), m, h = r == null || i == null, g = 0, _ = 0;
156
- for (let e of p) {
157
- let a = oe(e), p = a[0];
158
- if (p == null) {
159
- if (u) throw Error("parsePatchContent: invalid hunk");
154
+ function oe(e, { cacheKey: t, isGitDiff: n = s.test(e), oldFile: r, newFile: i, throwOnError: a = !1 } = {}) {
155
+ let o = 0, f = pe(e, "@@ "), p, h = r == null || i == null, g = 0, _ = 0;
156
+ for (let e of f) {
157
+ let s = ce(e), f = s[0];
158
+ if (f == null) {
159
+ if (a) throw Error("parsePatchContent: invalid hunk");
160
160
  console.error("parsePatchContent: invalid hunk", e);
161
161
  continue;
162
162
  }
163
- let v = le(p), b = 0, x = 0;
164
- if (v == null || m == null) {
165
- if (m != null) {
166
- if (u) throw Error("parsePatchContent: Invalid hunk");
163
+ let v = de(f), y = 0, b = 0;
164
+ if (v == null || p == null) {
165
+ if (p != null) {
166
+ if (a) throw Error("parsePatchContent: Invalid hunk");
167
167
  console.error("parsePatchContent: Invalid hunk", e);
168
168
  continue;
169
169
  }
170
- m = {
170
+ p = {
171
171
  name: "",
172
172
  type: "change",
173
173
  hunks: [],
174
174
  splitLineCount: 0,
175
175
  unifiedLineCount: 0,
176
176
  isPartial: h,
177
- additionLines: !h && r != null && i != null ? ae(i.contents) : [],
178
- deletionLines: !h && r != null && i != null ? ae(r.contents) : [],
179
- cacheKey: j(t)
180
- }, m.additionLines.length === 1 && i?.contents === "" && (m.additionLines.length = 0), m.deletionLines.length === 1 && r?.contents === "" && (m.deletionLines.length = 0);
181
- for (let e of a) {
177
+ additionLines: !h && r != null && i != null ? se(i.contents) : [],
178
+ deletionLines: !h && r != null && i != null ? se(r.contents) : [],
179
+ cacheKey: he(t)
180
+ }, p.additionLines.length === 1 && i?.contents === "" && (p.additionLines.length = 0), p.deletionLines.length === 1 && r?.contents === "" && (p.deletionLines.length = 0);
181
+ for (let e of s) {
182
182
  if (e.startsWith("diff --git")) {
183
- let t = e.trim().match(ne);
183
+ let t = e.trim().match(ie);
184
184
  if (t == null) {
185
- if (u) throw Error("parsePatchContent: invalid git diff header");
185
+ if (a) throw Error("parsePatchContent: invalid git diff header");
186
186
  console.error("parsePatchContent: invalid git diff header", e);
187
187
  continue;
188
188
  }
189
189
  let n = k(t[1], !0), r = k(t[2], !0);
190
- m.name = y(r), n !== r && (m.prevName = y(n));
190
+ p.name = x(r), n !== r && (p.prevName = x(n));
191
191
  continue;
192
192
  }
193
- let t = e.startsWith("---") || e.startsWith("+++") ? e.match(o) : null;
193
+ let t = e.startsWith("---") || e.startsWith("+++") ? e.match(c) : null;
194
194
  if (t != null) {
195
195
  let [, e, r] = t, i = k(r, n);
196
196
  if (e === "---" && i !== "/dev/null") {
197
- let e = y(i);
198
- m.prevName = e, m.name = e;
199
- } else e === "+++" && i !== "/dev/null" && (m.name = y(i));
197
+ let e = x(i);
198
+ p.prevName = e, p.name = e;
199
+ } else e === "+++" && i !== "/dev/null" && (p.name = x(i));
200
200
  } else if (n) {
201
- if (e.startsWith("new mode ") && (m.mode = y(e.slice(8).trim())), e.startsWith("old mode ") && (m.prevMode = y(e.slice(8).trim())), e.startsWith("new file mode") && (m.type = "new", m.mode = y(e.slice(13).trim())), e.startsWith("deleted file mode") && (m.type = "deleted", m.mode = y(e.slice(17).trim())), e.startsWith("similarity index") && (e.startsWith("similarity index 100%") ? m.type = "rename-pure" : m.type = "rename-changed"), e.startsWith("index ")) {
202
- let [, t, n, r] = e.trim().match(s) ?? [];
203
- t != null && (m.prevObjectId = y(t)), n != null && (m.newObjectId = y(n)), r != null && (m.mode = y(r));
201
+ if (e.startsWith("new mode ") && (p.mode = x(e.slice(8).trim())), e.startsWith("old mode ") && (p.prevMode = x(e.slice(8).trim())), e.startsWith("new file mode") && (p.type = "new", p.mode = x(e.slice(13).trim())), e.startsWith("deleted file mode") && (p.type = "deleted", p.mode = x(e.slice(17).trim())), e.startsWith("similarity index") && (e.startsWith("similarity index 100%") ? p.type = "rename-pure" : p.type = "rename-changed"), e.startsWith("index ")) {
202
+ let [, t, n, r] = e.trim().match(l) ?? [];
203
+ t != null && (p.prevObjectId = x(t)), n != null && (p.newObjectId = x(n)), r != null && (p.mode = x(r));
204
204
  }
205
- (e.startsWith("rename from ") || e.startsWith("copy from ")) && (m.prevName = y(k(e.slice(e.startsWith("rename") ? 12 : 10)))), (e.startsWith("rename to ") || e.startsWith("copy to ")) && (m.name = y(k(e.slice(e.startsWith("rename") ? 10 : 8))));
205
+ (e.startsWith("rename from ") || e.startsWith("copy from ")) && (p.prevName = x(k(e.slice(e.startsWith("rename") ? 12 : 10)))), (e.startsWith("rename to ") || e.startsWith("copy to ")) && (p.name = x(k(e.slice(e.startsWith("rename") ? 10 : 8))));
206
206
  }
207
207
  }
208
208
  continue;
209
209
  }
210
210
  let S, C;
211
- for (; a.length > 0 && (a[a.length - 1] === "\n" || a[a.length - 1] === "\r" || a[a.length - 1] === "\r\n" || a[a.length - 1] === "");) a.pop();
211
+ for (; s.length > 0 && (s[s.length - 1] === "\n" || s[s.length - 1] === "\r" || s[s.length - 1] === "\r\n" || s[s.length - 1] === "");) s.pop();
212
212
  let { additionStart: w, deletionStart: T } = v;
213
213
  g = h ? g : T - 1, _ = h ? _ : w - 1;
214
214
  let E = {
@@ -219,58 +219,58 @@ function ie(e, { cacheKey: t, isGitDiff: n = a.test(e), oldFile: r, newFile: i,
219
219
  unifiedLineStart: 0,
220
220
  additionCount: v.additionCount,
221
221
  additionStart: w,
222
- additionLines: b,
222
+ additionLines: y,
223
223
  deletionCount: v.deletionCount,
224
224
  deletionStart: T,
225
- deletionLines: x,
225
+ deletionLines: b,
226
226
  deletionLineIndex: g,
227
227
  additionLineIndex: _,
228
228
  hunkContent: [],
229
- hunkContext: j(v.hunkContext),
230
- hunkSpecs: y(p),
229
+ hunkContext: he(v.hunkContext),
230
+ hunkSpecs: x(f),
231
231
  noEOFCRAdditions: !1,
232
232
  noEOFCRDeletions: !1
233
233
  }, D = 0, O = 0;
234
- for (let e = 1; e < a.length; e++) {
235
- let t = a[e];
234
+ for (let e = 1; e < s.length; e++) {
235
+ let t = s[e];
236
236
  if (D >= E.additionCount && O >= E.deletionCount && !t.startsWith("\\")) {
237
- if (!se(t) || ce(t)) break;
238
- if (u) throw Error("parsePatchContent: hunk has more lines than expected");
237
+ if (!le(t) || ue(t)) break;
238
+ if (a) throw Error("parsePatchContent: hunk has more lines than expected");
239
239
  }
240
240
  let n = t[0];
241
241
  if (n !== "+" && n !== "-" && n !== " " && n !== "\\") {
242
- if (u) throw Error("parsePatchContent: invalid hunk line");
242
+ if (a) throw Error("parsePatchContent: invalid hunk line");
243
243
  console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`), console.error("processFile: invalid rawLine:", t);
244
244
  continue;
245
245
  }
246
- let r = pe(n);
246
+ let r = ge(n);
247
247
  if (r === "addition") {
248
- if (u && D >= E.additionCount) throw Error("parsePatchContent: hunk has too many addition lines");
249
- let e = M(t);
250
- (S == null || S.type !== "change") && (S = N("change", g, _), E.hunkContent.push(S)), _++, D++, h && m.additionLines.push(e), S.additions++, b++, C = "addition";
248
+ if (a && D >= E.additionCount) throw Error("parsePatchContent: hunk has too many addition lines");
249
+ let e = j(t);
250
+ (S == null || S.type !== "change") && (S = M("change", g, _), E.hunkContent.push(S)), _++, D++, h && p.additionLines.push(e), S.additions++, y++, C = "addition";
251
251
  } else if (r === "deletion") {
252
- if (u && O >= E.deletionCount) throw Error("parsePatchContent: hunk has too many deletion lines");
253
- let e = M(t);
254
- (S == null || S.type !== "change") && (S = N("change", g, _), E.hunkContent.push(S)), g++, O++, h && m.deletionLines.push(e), S.deletions++, x++, C = "deletion";
252
+ if (a && O >= E.deletionCount) throw Error("parsePatchContent: hunk has too many deletion lines");
253
+ let e = j(t);
254
+ (S == null || S.type !== "change") && (S = M("change", g, _), E.hunkContent.push(S)), g++, O++, h && p.deletionLines.push(e), S.deletions++, b++, C = "deletion";
255
255
  } else if (r === "context") {
256
- if (u && (O >= E.deletionCount || D >= E.additionCount)) throw Error("parsePatchContent: hunk has too many context lines");
257
- let e = M(t);
258
- (S == null || S.type !== "context") && (S = N("context", g, _), E.hunkContent.push(S)), _++, g++, D++, O++, h && (m.deletionLines.push(e), m.additionLines.push(e)), S.lines++, C = "context";
256
+ if (a && (O >= E.deletionCount || D >= E.additionCount)) throw Error("parsePatchContent: hunk has too many context lines");
257
+ let e = j(t);
258
+ (S == null || S.type !== "context") && (S = M("context", g, _), E.hunkContent.push(S)), _++, g++, D++, O++, h && (p.deletionLines.push(e), p.additionLines.push(e)), S.lines++, C = "context";
259
259
  } else if (r === "metadata" && S != null) {
260
260
  if (S.type === "context" ? (E.noEOFCRAdditions = !0, E.noEOFCRDeletions = !0) : C === "deletion" ? E.noEOFCRDeletions = !0 : C === "addition" && (E.noEOFCRAdditions = !0), h && (C === "addition" || C === "context")) {
261
- let e = m.additionLines.length - 1;
262
- e >= 0 && (m.additionLines[e] = f(m.additionLines[e]));
261
+ let e = p.additionLines.length - 1;
262
+ e >= 0 && (p.additionLines[e] = m(p.additionLines[e]));
263
263
  }
264
264
  if (h && (C === "deletion" || C === "context")) {
265
- let e = m.deletionLines.length - 1;
266
- e >= 0 && (m.deletionLines[e] = f(m.deletionLines[e]));
265
+ let e = p.deletionLines.length - 1;
266
+ e >= 0 && (p.deletionLines[e] = m(p.deletionLines[e]));
267
267
  }
268
268
  }
269
269
  }
270
270
  if (D !== E.additionCount || O !== E.deletionCount) {
271
- if (u) throw Error("parsePatchContent: hunk line count mismatch");
272
- console.error(`parsePatchContent: hunk line count mismatch: "${p.trimEnd()}", declared old/new ${E.deletionCount}/${E.additionCount}, parsed old/new ${O}/${D}`);
273
- let e = c(E.additionStart, E.additionCount) + (D === 0 ? 0 : 1), t = c(E.deletionStart, E.deletionCount) + (O === 0 ? 0 : 1);
271
+ if (a) throw Error("parsePatchContent: hunk line count mismatch");
272
+ console.error(`parsePatchContent: hunk line count mismatch: "${f.trimEnd()}", declared old/new ${E.deletionCount}/${E.additionCount}, parsed old/new ${O}/${D}`);
273
+ let e = u(E.additionStart, E.additionCount) + (D === 0 ? 0 : 1), t = u(E.deletionStart, E.deletionCount) + (O === 0 ? 0 : 1);
274
274
  if (!h) {
275
275
  let n = e - E.additionStart, r = t - E.deletionStart;
276
276
  E.additionLineIndex += n, E.deletionLineIndex += r;
@@ -278,29 +278,29 @@ function ie(e, { cacheKey: t, isGitDiff: n = a.test(e), oldFile: r, newFile: i,
278
278
  }
279
279
  E.additionStart = e, E.deletionStart = t, E.additionCount = D, E.deletionCount = O;
280
280
  }
281
- E.additionLines = b, E.deletionLines = x, E.collapsedBefore = Math.max(c(E.additionStart, E.additionCount) - d, 0), m.hunks.push(E), d = l(E.additionStart, E.additionCount);
281
+ E.additionLines = y, E.deletionLines = b, E.collapsedBefore = Math.max(u(E.additionStart, E.additionCount) - o, 0), p.hunks.push(E), o = d(E.additionStart, E.additionCount);
282
282
  for (let e of E.hunkContent) e.type === "context" ? (E.splitLineCount += e.lines, E.unifiedLineCount += e.lines) : (E.splitLineCount += Math.max(e.additions, e.deletions), E.unifiedLineCount += e.deletions + e.additions);
283
- E.splitLineStart = m.splitLineCount + E.collapsedBefore, E.unifiedLineStart = m.unifiedLineCount + E.collapsedBefore, m.splitLineCount += E.collapsedBefore + E.splitLineCount, m.unifiedLineCount += E.collapsedBefore + E.unifiedLineCount;
283
+ E.splitLineStart = p.splitLineCount + E.collapsedBefore, E.unifiedLineStart = p.unifiedLineCount + E.collapsedBefore, p.splitLineCount += E.collapsedBefore + E.splitLineCount, p.unifiedLineCount += E.collapsedBefore + E.unifiedLineCount;
284
284
  }
285
- if (m != null) {
286
- if (u && h && !n && m.hunks.length === 0) throw Error("parsePatchContent: unified file has no hunks");
287
- if (m.hunks.length > 0 && !h && m.additionLines.length > 0 && m.deletionLines.length > 0) {
288
- let e = m.hunks[m.hunks.length - 1], t = l(e.additionStart, e.additionCount), n = m.additionLines.length, r = Math.max(n - t, 0);
289
- m.splitLineCount += r, m.unifiedLineCount += r;
285
+ if (p != null) {
286
+ if (a && h && !n && p.hunks.length === 0) throw Error("parsePatchContent: unified file has no hunks");
287
+ if (p.hunks.length > 0 && !h && p.additionLines.length > 0 && p.deletionLines.length > 0) {
288
+ let e = p.hunks[p.hunks.length - 1], t = d(e.additionStart, e.additionCount), n = p.additionLines.length, r = Math.max(n - t, 0);
289
+ p.splitLineCount += r, p.unifiedLineCount += r;
290
290
  }
291
- return n || (m.prevName != null && m.name !== m.prevName ? m.hunks.length > 0 ? m.type = "rename-changed" : m.type = "rename-pure" : (r == null || r.contents === "") && i != null && i.contents !== "" ? m.type = "new" : r != null && r.contents !== "" && (i == null || i.contents === "") && (m.type = "deleted")), m.type !== "rename-pure" && m.type !== "rename-changed" && (m.prevName = void 0), E(m), m;
291
+ return n || (p.prevName != null && p.name !== p.prevName ? p.hunks.length > 0 ? p.type = "rename-changed" : p.type = "rename-pure" : (r == null || r.contents === "") && i != null && i.contents !== "" ? p.type = "new" : r != null && r.contents !== "" && (i == null || i.contents === "") && (p.type = "deleted")), p.type !== "rename-pure" && p.type !== "rename-changed" && (p.prevName = void 0), O(p), p;
292
292
  }
293
293
  }
294
294
  function k(e, t = !1) {
295
- let n = e.trim(), r = n.startsWith("\"") ? S(n)?.fileName ?? n : n;
295
+ let n = e.trim(), r = n.startsWith("\"") ? w(n)?.fileName ?? n : n;
296
296
  return t && (r.startsWith("a/") || r.startsWith("b/")) ? r.slice(2) : r;
297
297
  }
298
- function ae(e) {
299
- let t = oe(e);
300
- for (let e = 0; e < t.length; e++) t[e] = y(t[e]);
298
+ function se(e) {
299
+ let t = ce(e);
300
+ for (let e = 0; e < t.length; e++) t[e] = x(t[e]);
301
301
  return t;
302
302
  }
303
- function oe(e) {
303
+ function ce(e) {
304
304
  if (e.length === 0) return [""];
305
305
  let t = [], n = 0;
306
306
  for (;;) {
@@ -310,11 +310,11 @@ function oe(e) {
310
310
  }
311
311
  return n < e.length && t.push(e.slice(n)), t;
312
312
  }
313
- function se(e) {
313
+ function le(e) {
314
314
  let t = e[0];
315
315
  return t === "+" || t === "-" || t === " ";
316
316
  }
317
- function ce(e) {
317
+ function ue(e) {
318
318
  if (!e.startsWith("--")) return !1;
319
319
  for (let t = 2; t < e.length; t++) {
320
320
  let n = e[t];
@@ -322,7 +322,7 @@ function ce(e) {
322
322
  }
323
323
  return !0;
324
324
  }
325
- function le(e) {
325
+ function de(e) {
326
326
  if (!e.startsWith("@@ -")) return;
327
327
  let t = 4, n = A(e, t);
328
328
  if (n == null) return;
@@ -348,7 +348,7 @@ function le(e) {
348
348
  }
349
349
  if (e[t] !== " " || e[t + 1] !== "@" || e[t + 2] !== "@") return;
350
350
  let c, l = t + 3;
351
- return e[l] === " " && (c = ue(e.slice(l + 1))), {
351
+ return e[l] === " " && (c = fe(e.slice(l + 1))), {
352
352
  additionCount: s,
353
353
  additionStart: o,
354
354
  deletionCount: i,
@@ -368,38 +368,38 @@ function A(e, t) {
368
368
  endIndex: n
369
369
  };
370
370
  }
371
- function ue(e) {
371
+ function fe(e) {
372
372
  return e.endsWith("\r\n") ? e.slice(0, -2) : e.endsWith("\n") ? e.slice(0, -1) : e;
373
373
  }
374
- function de(e, t) {
374
+ function pe(e, t) {
375
375
  if (e.length === 0) return [""];
376
- let n = `\n${t}`, r = e.startsWith(t) ? 0 : fe(e, n, 0);
376
+ let n = `\n${t}`, r = e.startsWith(t) ? 0 : me(e, n, 0);
377
377
  if (r === -1) return [e];
378
378
  let i = [];
379
379
  r > 0 && i.push(e.slice(0, r));
380
380
  let a = r;
381
381
  for (;;) {
382
- let t = fe(e, n, a + 1);
382
+ let t = me(e, n, a + 1);
383
383
  if (t === -1) break;
384
384
  i.push(e.slice(a, t)), a = t;
385
385
  }
386
386
  return i.push(e.slice(a)), i;
387
387
  }
388
- function fe(e, t, n) {
388
+ function me(e, t, n) {
389
389
  let r = e.indexOf(t, n);
390
390
  return r === -1 ? -1 : r + 1;
391
391
  }
392
- function j(e) {
393
- return e == null ? e : y(e);
392
+ function he(e) {
393
+ return e == null ? e : x(e);
394
394
  }
395
- function pe(e) {
395
+ function ge(e) {
396
396
  return e === " " ? "context" : e === "\\" ? "metadata" : e === "+" ? "addition" : "deletion";
397
397
  }
398
- function M(e) {
398
+ function j(e) {
399
399
  let t = e.slice(1);
400
- return y(t === "" ? "\n" : t);
400
+ return x(t === "" ? "\n" : t);
401
401
  }
402
- function N(e, t, n) {
402
+ function M(e, t, n) {
403
403
  return e === "change" ? {
404
404
  type: "change",
405
405
  additions: 0,
@@ -415,7 +415,7 @@ function N(e, t, n) {
415
415
  }
416
416
  //#endregion
417
417
  //#region ../../node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/diff/base.js
418
- var P = class {
418
+ var N = class {
419
419
  diff(e, t, n = {}) {
420
420
  let r;
421
421
  typeof n == "function" ? (r = n, n = {}) : "callback" in n && (r = n.callback);
@@ -548,15 +548,15 @@ var P = class {
548
548
  return r;
549
549
  }
550
550
  };
551
- new class extends P {}();
551
+ new class extends N {}();
552
552
  //#endregion
553
553
  //#region ../../node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/util/string.js
554
- function me(e, t) {
554
+ function _e(e, t) {
555
555
  let n = 0;
556
556
  for (; n < e.length && n < t.length; n++) if (e[n] != t[n]) return e.slice(0, n);
557
557
  return e.slice(0, n);
558
558
  }
559
- function he(e, t) {
559
+ function P(e, t) {
560
560
  let n;
561
561
  if (!e || !t || e[e.length - 1] != t[t.length - 1]) return "";
562
562
  for (n = 0; n < e.length && n < t.length; n++) if (e[e.length - (n + 1)] != t[t.length - (n + 1)]) return e.slice(-n);
@@ -577,10 +577,10 @@ function L(e, t) {
577
577
  function R(e, t) {
578
578
  return I(e, t, "");
579
579
  }
580
- function z(e, t) {
581
- return t.slice(0, ge(e, t));
580
+ function ve(e, t) {
581
+ return t.slice(0, ye(e, t));
582
582
  }
583
- function ge(e, t) {
583
+ function ye(e, t) {
584
584
  let n = 0;
585
585
  e.length > t.length && (n = e.length - t.length);
586
586
  let r = t.length;
@@ -598,7 +598,7 @@ function ge(e, t) {
598
598
  }
599
599
  return a;
600
600
  }
601
- function _e(e, t) {
601
+ function be(e, t) {
602
602
  let n = [];
603
603
  for (let r of Array.from(t.segment(e))) {
604
604
  let e = r.segment;
@@ -606,27 +606,27 @@ function _e(e, t) {
606
606
  }
607
607
  return n;
608
608
  }
609
- function B(e, t) {
610
- if (t) return H(e, t)[1];
609
+ function z(e, t) {
610
+ if (t) return V(e, t)[1];
611
611
  let n;
612
612
  for (n = e.length - 1; n >= 0 && e[n].match(/\s/); n--);
613
613
  return e.substring(n + 1);
614
614
  }
615
- function V(e, t) {
616
- if (t) return H(e, t)[0];
615
+ function B(e, t) {
616
+ if (t) return V(e, t)[0];
617
617
  let n = e.match(/^\s*/);
618
618
  return n ? n[0] : "";
619
619
  }
620
- function H(e, t) {
621
- if (!t) return [V(e), B(e)];
620
+ function V(e, t) {
621
+ if (!t) return [B(e), z(e)];
622
622
  if (t.resolvedOptions().granularity != "word") throw Error("The segmenter passed must have a granularity of \"word\"");
623
- let n = _e(e, t), r = n[0], i = n[n.length - 1];
623
+ let n = be(e, t), r = n[0], i = n[n.length - 1];
624
624
  return [/\s/.test(r) ? r : "", /\s/.test(i) ? i : ""];
625
625
  }
626
626
  //#endregion
627
627
  //#region ../../node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/diff/word.js
628
- var U = "a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}", ve = RegExp(`[${U}]+|\\s+|[^${U}]`, "ug");
629
- new class extends P {
628
+ var H = "a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}", xe = RegExp(`[${H}]+|\\s+|[^${H}]`, "ug");
629
+ new class extends N {
630
630
  equals(e, t, n) {
631
631
  return n.ignoreCase && (e = e.toLowerCase(), t = t.toLowerCase()), e.trim() === t.trim();
632
632
  }
@@ -635,8 +635,8 @@ new class extends P {
635
635
  if (t.intlSegmenter) {
636
636
  let r = t.intlSegmenter;
637
637
  if (r.resolvedOptions().granularity != "word") throw Error("The segmenter passed must have a granularity of \"word\"");
638
- n = _e(e, r);
639
- } else n = e.match(ve) || [];
638
+ n = be(e, r);
639
+ } else n = e.match(xe) || [];
640
640
  let r = [], i = null;
641
641
  return n.forEach((e) => {
642
642
  /\s/.test(e) ? i == null ? r.push(e) : r.push(r.pop() + e) : i != null && /\s/.test(i) ? r[r.length - 1] == i ? r.push(r.pop() + e) : r.push(i + e) : r.push(e), i = e;
@@ -649,61 +649,61 @@ new class extends P {
649
649
  if (!e || t.oneChangePerToken) return e;
650
650
  let n = null, r = null, i = null;
651
651
  return e.forEach((e) => {
652
- e.added ? r = e : e.removed ? i = e : ((r || i) && ye(n, i, r, e, t.intlSegmenter), n = e, r = null, i = null);
653
- }), (r || i) && ye(n, i, r, null, t.intlSegmenter), e;
652
+ e.added ? r = e : e.removed ? i = e : ((r || i) && Se(n, i, r, e, t.intlSegmenter), n = e, r = null, i = null);
653
+ }), (r || i) && Se(n, i, r, null, t.intlSegmenter), e;
654
654
  }
655
655
  }();
656
- function ye(e, t, n, r, i) {
656
+ function Se(e, t, n, r, i) {
657
657
  if (t && n) {
658
- let [a, o] = H(t.value, i), [s, c] = H(n.value, i);
658
+ let [a, o] = V(t.value, i), [s, c] = V(n.value, i);
659
659
  if (e) {
660
- let r = me(a, s);
660
+ let r = _e(a, s);
661
661
  e.value = I(e.value, s, r), t.value = L(t.value, r), n.value = L(n.value, r);
662
662
  }
663
663
  if (r) {
664
- let e = he(o, c);
664
+ let e = P(o, c);
665
665
  r.value = F(r.value, c, e), t.value = R(t.value, e), n.value = R(n.value, e);
666
666
  }
667
667
  } else if (n) {
668
668
  if (e) {
669
- let e = V(n.value, i);
669
+ let e = B(n.value, i);
670
670
  n.value = n.value.substring(e.length);
671
671
  }
672
672
  if (r) {
673
- let e = V(r.value, i);
673
+ let e = B(r.value, i);
674
674
  r.value = r.value.substring(e.length);
675
675
  }
676
676
  } else if (e && r) {
677
- let n = V(r.value, i), [a, o] = H(t.value, i), s = me(n, a);
677
+ let n = B(r.value, i), [a, o] = V(t.value, i), s = _e(n, a);
678
678
  t.value = L(t.value, s);
679
- let c = he(L(n, s), o);
679
+ let c = P(L(n, s), o);
680
680
  t.value = R(t.value, c), r.value = F(r.value, n, c), e.value = I(e.value, n, n.slice(0, n.length - c.length));
681
681
  } else if (r) {
682
- let e = V(r.value, i), n = z(B(t.value, i), e);
682
+ let e = B(r.value, i), n = ve(z(t.value, i), e);
683
683
  t.value = R(t.value, n);
684
684
  } else if (e) {
685
- let n = z(B(e.value, i), V(t.value, i));
685
+ let n = ve(z(e.value, i), B(t.value, i));
686
686
  t.value = L(t.value, n);
687
687
  }
688
688
  }
689
- new class extends P {
689
+ new class extends N {
690
690
  tokenize(e) {
691
- let t = RegExp(`(\\r?\\n)|[${U}]+|[^\\S\\n\\r]+|[^${U}]`, "ug");
691
+ let t = RegExp(`(\\r?\\n)|[${H}]+|[^\\S\\n\\r]+|[^${H}]`, "ug");
692
692
  return e.match(t) || [];
693
693
  }
694
694
  }();
695
- var be = new class extends P {
695
+ var Ce = new class extends N {
696
696
  constructor() {
697
- super(...arguments), this.tokenize = Se;
697
+ super(...arguments), this.tokenize = Te;
698
698
  }
699
699
  equals(e, t, n) {
700
700
  return n.ignoreWhitespace ? ((!n.newlineIsToken || !e.includes("\n")) && (e = e.trim()), (!n.newlineIsToken || !t.includes("\n")) && (t = t.trim())) : n.ignoreNewlineAtEof && !n.newlineIsToken && (e.endsWith("\n") && (e = e.slice(0, -1)), t.endsWith("\n") && (t = t.slice(0, -1))), super.equals(e, t, n);
701
701
  }
702
702
  }();
703
- function xe(e, t, n) {
704
- return be.diff(e, t, n);
703
+ function we(e, t, n) {
704
+ return Ce.diff(e, t, n);
705
705
  }
706
- function Se(e, t) {
706
+ function Te(e, t) {
707
707
  t.stripTrailingCr && (e = e.replace(/\r\n/g, "\n"));
708
708
  let n = [], r = e.split(/(\n|\r\n)/);
709
709
  r[r.length - 1] || r.pop();
@@ -715,10 +715,10 @@ function Se(e, t) {
715
715
  }
716
716
  //#endregion
717
717
  //#region ../../node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/diff/sentence.js
718
- function Ce(e) {
718
+ function Ee(e) {
719
719
  return e == "." || e == "!" || e == "?";
720
720
  }
721
- new class extends P {
721
+ new class extends N {
722
722
  tokenize(e) {
723
723
  let t = [], n = 0;
724
724
  for (let r = 0; r < e.length; r++) {
@@ -726,39 +726,39 @@ new class extends P {
726
726
  t.push(e.slice(n));
727
727
  break;
728
728
  }
729
- if (Ce(e[r]) && e[r + 1].match(/\s/)) {
729
+ if (Ee(e[r]) && e[r + 1].match(/\s/)) {
730
730
  for (t.push(e.slice(n, r + 1)), r = n = r + 1; e[r + 1]?.match(/\s/);) r++;
731
731
  t.push(e.slice(n, r + 1)), n = r + 1;
732
732
  }
733
733
  }
734
734
  return t;
735
735
  }
736
- }(), new class extends P {
736
+ }(), new class extends N {
737
737
  tokenize(e) {
738
738
  return e.split(/([{}:;,]|\s+)/);
739
739
  }
740
- }(), new class extends P {
740
+ }(), new class extends N {
741
741
  constructor() {
742
- super(...arguments), this.tokenize = Se;
742
+ super(...arguments), this.tokenize = Te;
743
743
  }
744
744
  get useLongestToken() {
745
745
  return !0;
746
746
  }
747
747
  castInput(e, t) {
748
748
  let { undefinedReplacement: n, stringifyReplacer: r = (e, t) => t === void 0 ? n : t } = t;
749
- return typeof e == "string" ? e : JSON.stringify(W(e, null, null, r), null, " ");
749
+ return typeof e == "string" ? e : JSON.stringify(U(e, null, null, r), null, " ");
750
750
  }
751
751
  equals(e, t, n) {
752
752
  return super.equals(e.replace(/,([\r\n])/g, "$1"), t.replace(/,([\r\n])/g, "$1"), n);
753
753
  }
754
754
  }();
755
- function W(e, t, n, r, i) {
755
+ function U(e, t, n, r, i) {
756
756
  t ||= [], n ||= [], r && (e = r(i === void 0 ? "" : i, e));
757
757
  let a = 0;
758
758
  for (; a < t.length; a += 1) if (t[a] === e) return n[a];
759
759
  let o;
760
760
  if (Object.prototype.toString.call(e) === "[object Array]") {
761
- for (t.push(e), o = Array(e.length), n.push(o), a = 0; a < e.length; a += 1) o[a] = W(e[a], t, n, r, String(a));
761
+ for (t.push(e), o = Array(e.length), n.push(o), a = 0; a < e.length; a += 1) o[a] = U(e[a], t, n, r, String(a));
762
762
  return t.pop(), n.pop(), o;
763
763
  }
764
764
  if (e && e.toJSON && (e = e.toJSON()), typeof e == "object" && e) {
@@ -767,12 +767,12 @@ function W(e, t, n, r, i) {
767
767
  for (s in e)
768
768
  /* istanbul ignore else */
769
769
  Object.prototype.hasOwnProperty.call(e, s) && i.push(s);
770
- for (i.sort(), a = 0; a < i.length; a += 1) s = i[a], o[s] = W(e[s], t, n, r, s);
770
+ for (i.sort(), a = 0; a < i.length; a += 1) s = i[a], o[s] = U(e[s], t, n, r, s);
771
771
  t.pop(), n.pop();
772
772
  } else o = e;
773
773
  return o;
774
774
  }
775
- new class extends P {
775
+ new class extends N {
776
776
  tokenize(e) {
777
777
  return e.slice();
778
778
  }
@@ -785,12 +785,12 @@ new class extends P {
785
785
  }();
786
786
  //#endregion
787
787
  //#region ../../node_modules/.pnpm/diff@9.0.0/node_modules/diff/libesm/patch/create.js
788
- function we(e) {
788
+ function De(e) {
789
789
  for (let t = 0; t < e.length; t++) if (e[t] < " " || e[t] > "~" || e[t] === "\"" || e[t] === "\\") return !0;
790
790
  return !1;
791
791
  }
792
- function G(e) {
793
- if (!we(e)) return e;
792
+ function W(e) {
793
+ if (!De(e)) return e;
794
794
  let t = "\"", n = new TextEncoder().encode(e), r = 0;
795
795
  for (; r < n.length;) {
796
796
  let e = n[r];
@@ -798,23 +798,23 @@ function G(e) {
798
798
  }
799
799
  return t += "\"", t;
800
800
  }
801
- var Te = {
801
+ var Oe = {
802
802
  includeIndex: !0,
803
803
  includeUnderline: !0,
804
804
  includeFileHeaders: !0
805
805
  };
806
- function Ee(e, t, n, r, i, a, o) {
806
+ function ke(e, t, n, r, i, a, o) {
807
807
  let s;
808
808
  s = o ? typeof o == "function" ? { callback: o } : o : {}, s.context === void 0 && (s.context = 4);
809
809
  let c = s.context;
810
810
  if (s.newlineIsToken) throw Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");
811
811
  if (s.callback) {
812
812
  let { callback: e } = s;
813
- xe(n, r, Object.assign(Object.assign({}, s), { callback: (t) => {
813
+ we(n, r, Object.assign(Object.assign({}, s), { callback: (t) => {
814
814
  let n = l(t);
815
815
  e(n);
816
816
  } }));
817
- } else return l(xe(n, r, s));
817
+ } else return l(we(n, r, s));
818
818
  function l(n) {
819
819
  if (!n) return;
820
820
  n.push({
@@ -828,7 +828,7 @@ function Ee(e, t, n, r, i, a, o) {
828
828
  }
829
829
  let o = [], s = 0, l = 0, u = [], d = 1, f = 1;
830
830
  for (let e = 0; e < n.length; e++) {
831
- let t = n[e], i = t.lines || Oe(t.value);
831
+ let t = n[e], i = t.lines || je(t.value);
832
832
  if (t.lines = i, t.added || t.removed) {
833
833
  if (!s) {
834
834
  let t = n[e - 1];
@@ -865,20 +865,20 @@ function Ee(e, t, n, r, i, a, o) {
865
865
  };
866
866
  }
867
867
  }
868
- function K(e, t) {
869
- if (t ||= Te, Array.isArray(e)) {
868
+ function G(e, t) {
869
+ if (t ||= Oe, Array.isArray(e)) {
870
870
  if (e.length > 1 && !t.includeFileHeaders && !e.every((e) => e.isGit)) throw Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");
871
- return e.map((e) => K(e, t)).join("\n");
871
+ return e.map((e) => G(e, t)).join("\n");
872
872
  }
873
873
  let n = [];
874
874
  if (e.isGit) {
875
- if (t = Te, !e.oldFileName) throw Error("oldFileName must be specified for Git patches");
875
+ if (t = Oe, !e.oldFileName) throw Error("oldFileName must be specified for Git patches");
876
876
  if (!e.newFileName) throw Error("newFileName must be specified for Git patches");
877
877
  let r = e.oldFileName, i = e.newFileName;
878
- e.isCreate && r === "/dev/null" ? r = i.replace(/^b\//, "a/") : e.isDelete && i === "/dev/null" && (i = r.replace(/^a\//, "b/")), n.push("diff --git " + G(r) + " " + G(i)), e.isDelete && n.push("deleted file mode " + (e.oldMode ?? "100644")), e.isCreate && n.push("new file mode " + (e.newMode ?? "100644")), e.oldMode && e.newMode && !e.isDelete && !e.isCreate && (n.push("old mode " + e.oldMode), n.push("new mode " + e.newMode)), e.isRename && (n.push("rename from " + G((e.oldFileName ?? "").replace(/^a\//, ""))), n.push("rename to " + G((e.newFileName ?? "").replace(/^b\//, "")))), e.isCopy && (n.push("copy from " + G((e.oldFileName ?? "").replace(/^a\//, ""))), n.push("copy to " + G((e.newFileName ?? "").replace(/^b\//, ""))));
878
+ e.isCreate && r === "/dev/null" ? r = i.replace(/^b\//, "a/") : e.isDelete && i === "/dev/null" && (i = r.replace(/^a\//, "b/")), n.push("diff --git " + W(r) + " " + W(i)), e.isDelete && n.push("deleted file mode " + (e.oldMode ?? "100644")), e.isCreate && n.push("new file mode " + (e.newMode ?? "100644")), e.oldMode && e.newMode && !e.isDelete && !e.isCreate && (n.push("old mode " + e.oldMode), n.push("new mode " + e.newMode)), e.isRename && (n.push("rename from " + W((e.oldFileName ?? "").replace(/^a\//, ""))), n.push("rename to " + W((e.newFileName ?? "").replace(/^b\//, "")))), e.isCopy && (n.push("copy from " + W((e.oldFileName ?? "").replace(/^a\//, ""))), n.push("copy to " + W((e.newFileName ?? "").replace(/^b\//, ""))));
879
879
  } else t.includeIndex && e.oldFileName == e.newFileName && e.oldFileName !== void 0 && n.push("Index: " + e.oldFileName), t.includeUnderline && n.push("===================================================================");
880
880
  let r = e.hunks.length > 0;
881
- t.includeFileHeaders && e.oldFileName !== void 0 && e.newFileName !== void 0 && (!e.isGit || r) && (n.push("--- " + G(e.oldFileName) + (e.oldHeader ? " " + e.oldHeader : "")), n.push("+++ " + G(e.newFileName) + (e.newHeader ? " " + e.newHeader : "")));
881
+ t.includeFileHeaders && e.oldFileName !== void 0 && e.newFileName !== void 0 && (!e.isGit || r) && (n.push("--- " + W(e.oldFileName) + (e.oldHeader ? " " + e.oldHeader : "")), n.push("+++ " + W(e.newFileName) + (e.newHeader ? " " + e.newHeader : "")));
882
882
  for (let t = 0; t < e.hunks.length; t++) {
883
883
  let r = e.hunks[t], i = r.oldLines === 0 ? r.oldStart - 1 : r.oldStart, a = r.newLines === 0 ? r.newStart - 1 : r.newStart;
884
884
  n.push("@@ -" + i + "," + r.oldLines + " +" + a + "," + r.newLines + " @@");
@@ -886,30 +886,30 @@ function K(e, t) {
886
886
  }
887
887
  return n.join("\n") + "\n";
888
888
  }
889
- function De(e, t, n, r, i, a, o) {
889
+ function Ae(e, t, n, r, i, a, o) {
890
890
  if (typeof o == "function" && (o = { callback: o }), o?.callback) {
891
891
  let { callback: s } = o;
892
- Ee(e, t, n, r, i, a, Object.assign(Object.assign({}, o), { callback: (e) => {
893
- s(e ? K(e, o.headerOptions) : void 0);
892
+ ke(e, t, n, r, i, a, Object.assign(Object.assign({}, o), { callback: (e) => {
893
+ s(e ? G(e, o.headerOptions) : void 0);
894
894
  } }));
895
895
  } else {
896
- let s = Ee(e, t, n, r, i, a, o);
897
- return s ? K(s, o?.headerOptions) : void 0;
896
+ let s = ke(e, t, n, r, i, a, o);
897
+ return s ? G(s, o?.headerOptions) : void 0;
898
898
  }
899
899
  }
900
- function Oe(e) {
900
+ function je(e) {
901
901
  let t = e.endsWith("\n"), n = e.split("\n").map((e) => e + "\n");
902
902
  return t ? n.pop() : n.push(n.pop().slice(0, -1)), n;
903
903
  }
904
904
  //#endregion
905
905
  //#region ../../node_modules/.pnpm/@pierre+diffs@1.5.1_patch_hash=ce17810cfea58efa02eb4e70947801afb36c9f8a08a8bb4c810297c2_63846ff899210db6647d73492b0c4e78/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js
906
- var ke = "/dev/null";
907
- function Ae(e, t, n, r = !1) {
906
+ var Me = "/dev/null";
907
+ function Ne(e, t, n, r = !1) {
908
908
  if (e === null && t === null) throw Error("parseDiffFromFile: You must pass oldFile, newFile, or both");
909
- let i = e ?? je(), a = t ?? je(), o = re(De(i.name, a.name, i.contents, a.contents, i.header, a.header, n), {
909
+ let i = e ?? Pe(), a = t ?? Pe(), o = ae(Ae(i.name, a.name, i.contents, a.contents, i.header, a.header, n), {
910
910
  cacheKey: (() => {
911
911
  let n = e?.cacheKey, r = t?.cacheKey;
912
- return n != null && r != null ? d("diff", n, r) : void 0;
912
+ return n != null && r != null ? p("diff", n, r) : void 0;
913
913
  })(),
914
914
  oldFile: i,
915
915
  newFile: a,
@@ -920,41 +920,55 @@ function Ae(e, t, n, r = !1) {
920
920
  let s = t?.lang ?? (t === null ? e?.lang : void 0);
921
921
  return s != null && (o.lang = s), o;
922
922
  }
923
- function je() {
923
+ function Pe() {
924
924
  return {
925
- name: ke,
925
+ name: Me,
926
926
  contents: ""
927
927
  };
928
928
  }
929
929
  //#endregion
930
930
  //#region src/internal/component.ts
931
- var q = (e, t) => {
931
+ var K = (e, t) => {
932
932
  let n = e[t];
933
933
  if (n === void 0) throw Error(`Missing CSS Module class: ${t}`);
934
934
  return n;
935
- }, Me = (e, t) => {
935
+ }, Fe = (e) => {
936
+ let [t, r] = i(!1);
937
+ return [t, n((t) => {
938
+ if (t === null) return;
939
+ let n = () => {
940
+ let n = t.getBoundingClientRect().width;
941
+ r(n > 0 && n < e);
942
+ };
943
+ n();
944
+ let i = t.ownerDocument.defaultView;
945
+ if (i === null || !("ResizeObserver" in i)) return;
946
+ let a = new i.ResizeObserver(n);
947
+ return a.observe(t), () => a.disconnect();
948
+ }, [e])];
949
+ }, Ie = (e, t) => {
936
950
  let n = e.shadowRoot;
937
951
  if (n === null) return null;
938
952
  let r = t.side === "additions" ? "data-additions" : "data-deletions", i = t.side === "additions" ? "change-addition" : "change-deletion", a = t.side === "additions" ? "data-line" : "data-alt-line";
939
953
  return n.querySelector(`[${r}] [data-line="${t.lineNumber}"]`) ?? n.querySelector(`[data-line="${t.lineNumber}"][data-line-type="${i}"]`) ?? n.querySelector(`[${a}="${t.lineNumber}"][data-line-type="context"]`) ?? n.querySelector(`[${a}="${t.lineNumber}"][data-line-type="context-expanded"]`) ?? n.querySelector(`[${r}] [data-alt-line="${t.lineNumber}"]`) ?? n.querySelector(`[${r}][data-line="${t.lineNumber}"]`) ?? n.querySelector(`[${r}][data-alt-line="${t.lineNumber}"]`);
940
- }, Ne = (e, t) => {
954
+ }, Le = (e, t) => {
941
955
  let n = e.closest("diffs-container");
942
- return n === null ? null : Me(n, t);
943
- }, Pe = (e, t) => {
944
- let n = Ne(e, t);
956
+ return n === null ? null : Ie(n, t);
957
+ }, Re = (e, t) => {
958
+ let n = Le(e, t);
945
959
  n !== null && (n.tabIndex = -1, n.focus({ preventScroll: !0 }));
946
- }, J = ({ annotation: e, className: r, returnFocus: i }) => {
947
- let a = n(null), o = () => {
960
+ }, q = ({ annotation: e, className: n, returnFocus: i }) => {
961
+ let a = r(null), o = () => {
948
962
  if (i !== void 0) {
949
963
  i();
950
964
  return;
951
965
  }
952
- a.current !== null && Pe(a.current, e.location);
966
+ a.current !== null && Re(a.current, e.location);
953
967
  };
954
968
  return t("div", {
955
969
  ref: a,
956
970
  "aria-label": e.accessibilityLabel,
957
- className: r,
971
+ className: n,
958
972
  "data-rly-diff-annotation": e.id,
959
973
  "data-rly-diff-annotation-item": e.location.itemId,
960
974
  "data-rly-diff-annotation-line": e.location.lineNumber,
@@ -969,7 +983,7 @@ var q = (e, t) => {
969
983
  location: e.location,
970
984
  returnFocus: o
971
985
  }));
972
- }, Fe = (e) => {
986
+ }, ze = (e) => {
973
987
  let t = /* @__PURE__ */ new Set();
974
988
  for (let n of e) {
975
989
  if (n.id.trim().length === 0 || n.accessibilityLabel.trim().length === 0) throw Error("Diff annotation id and accessibility label must not be blank");
@@ -978,7 +992,7 @@ var q = (e, t) => {
978
992
  if (t.has(n.id)) throw Error(`Diff annotation id ${n.id} must be unique`);
979
993
  t.add(n.id);
980
994
  }
981
- }, Y = {
995
+ }, J = {
982
996
  root: "rly_BoundedDiffCodeView-module__root",
983
997
  file: "rly_BoundedDiffCodeView-module__file",
984
998
  noChanges: "rly_BoundedDiffCodeView-module__noChanges",
@@ -999,11 +1013,11 @@ var q = (e, t) => {
999
1013
  annotationRow: "rly_BoundedDiffCodeView-module__annotationRow",
1000
1014
  annotationCell: "rly_BoundedDiffCodeView-module__annotationCell",
1001
1015
  annotation: "rly_BoundedDiffCodeView-module__annotation"
1002
- }, Ie = (e, t) => ({
1016
+ }, Be = (e, t) => ({
1003
1017
  lineNumber: e,
1004
1018
  side: t
1005
- }), X = (e, t) => e[t]?.replace(/\r?\n$/, "") ?? "", Le = (e) => e.hunkSpecs?.trim() ?? `@@ -${e.deletionStart},${e.deletionCount} +${e.additionStart},${e.additionCount} @@`, Re = (e) => {
1006
- if (e.before.contents !== e.after.contents) return Ae({
1019
+ }), Y = (e, t) => e[t]?.replace(/\r?\n$/, "") ?? "", X = (e) => e.hunkSpecs?.trim() ?? `@@ -${e.deletionStart},${e.deletionCount} +${e.additionStart},${e.additionCount} @@`, Ve = (e) => {
1020
+ if (e.before.contents !== e.after.contents) return Ne({
1007
1021
  ...e.before.cacheKey !== void 0 && { cacheKey: e.before.cacheKey },
1008
1022
  contents: e.before.contents,
1009
1023
  name: e.before.name
@@ -1012,182 +1026,182 @@ var q = (e, t) => {
1012
1026
  contents: e.after.contents,
1013
1027
  name: e.after.name
1014
1028
  }, void 0, !0);
1015
- }, ze = (e, t) => Array.from({ length: t.lines }, (n, r) => ({
1029
+ }, He = (e, t) => Array.from({ length: t.lines }, (n, r) => ({
1016
1030
  addition: {
1017
- content: X(e.additionLines, t.additionLineIndex + r),
1031
+ content: Y(e.additionLines, t.additionLineIndex + r),
1018
1032
  number: t.additionLineIndex + r + 1
1019
1033
  },
1020
1034
  deletion: {
1021
- content: X(e.deletionLines, t.deletionLineIndex + r),
1035
+ content: Y(e.deletionLines, t.deletionLineIndex + r),
1022
1036
  number: t.deletionLineIndex + r + 1
1023
1037
  },
1024
1038
  kind: "context"
1025
- })), Be = (e, t) => Array.from({ length: Math.max(t.deletions, t.additions) }, (n, r) => ({
1039
+ })), Ue = (e, t) => Array.from({ length: Math.max(t.deletions, t.additions) }, (n, r) => ({
1026
1040
  ...r < t.additions && { addition: {
1027
- content: X(e.additionLines, t.additionLineIndex + r),
1041
+ content: Y(e.additionLines, t.additionLineIndex + r),
1028
1042
  number: t.additionLineIndex + r + 1
1029
1043
  } },
1030
1044
  ...r < t.deletions && { deletion: {
1031
- content: X(e.deletionLines, t.deletionLineIndex + r),
1045
+ content: Y(e.deletionLines, t.deletionLineIndex + r),
1032
1046
  number: t.deletionLineIndex + r + 1
1033
1047
  } },
1034
1048
  kind: "change"
1035
- })), Ve = (e) => e.hunks.flatMap((t) => [{
1049
+ })), We = (e) => e.hunks.flatMap((t) => [{
1036
1050
  kind: "hunk",
1037
- label: Le(t)
1038
- }, ...t.hunkContent.flatMap((t) => t.type === "context" ? ze(e, t) : Be(e, t))]), He = (e) => e.hunks.flatMap((t) => [{
1051
+ label: X(t)
1052
+ }, ...t.hunkContent.flatMap((t) => t.type === "context" ? He(e, t) : Ue(e, t))]), Ge = (e) => e.hunks.flatMap((t) => [{
1039
1053
  kind: "hunk",
1040
- label: Le(t)
1054
+ label: X(t)
1041
1055
  }, ...t.hunkContent.flatMap((t) => t.type === "context" ? Array.from({ length: t.lines }, (n, r) => ({
1042
1056
  additionNumber: t.additionLineIndex + r + 1,
1043
- content: X(e.additionLines, t.additionLineIndex + r),
1057
+ content: Y(e.additionLines, t.additionLineIndex + r),
1044
1058
  deletionNumber: t.deletionLineIndex + r + 1,
1045
1059
  kind: "context"
1046
1060
  })) : [...Array.from({ length: t.deletions }, (n, r) => ({
1047
- content: X(e.deletionLines, t.deletionLineIndex + r),
1061
+ content: Y(e.deletionLines, t.deletionLineIndex + r),
1048
1062
  deletionNumber: t.deletionLineIndex + r + 1,
1049
1063
  kind: "deletion"
1050
1064
  })), ...Array.from({ length: t.additions }, (n, r) => ({
1051
1065
  additionNumber: t.additionLineIndex + r + 1,
1052
- content: X(e.additionLines, t.additionLineIndex + r),
1066
+ content: Y(e.additionLines, t.additionLineIndex + r),
1053
1067
  kind: "addition"
1054
- }))])]), Z = (e, t, n, i, a, o) => /* @__PURE__ */ r("code", {
1055
- className: a ? Y.wrappedCode : Y.code,
1068
+ }))])]), Z = (e, t, n, r, i, o) => /* @__PURE__ */ a("code", {
1069
+ className: i ? J.wrappedCode : J.code,
1056
1070
  "data-rly-diff-item": t,
1057
1071
  ...o === void 0 ? {} : {
1058
1072
  "data-rly-diff-line-alternate": o.lineNumber,
1059
1073
  "data-rly-diff-line-side-alternate": o.side
1060
1074
  },
1061
1075
  "data-rly-diff-line": n,
1062
- "data-rly-diff-line-side": i,
1076
+ "data-rly-diff-line-side": r,
1063
1077
  tabIndex: -1,
1064
1078
  children: e.length === 0 ? " " : e
1065
1079
  }), Q = (e, t, n, r) => {
1066
1080
  let i = `[data-rly-diff-item="${CSS.escape(t)}"]`;
1067
1081
  (e?.querySelector(`${i}[data-rly-diff-line="${n}"][data-rly-diff-line-side="${r}"]`) ?? e?.querySelector(`${i}[data-rly-diff-line-alternate="${n}"][data-rly-diff-line-side-alternate="${r}"]`))?.focus({ preventScroll: !0 });
1068
- }, $ = (e, t, n, r) => n === void 0 ? [] : e.filter((e) => e.location.itemId === t && e.location.lineNumber === n && e.location.side === r), Ue = (e, t, n, a) => [...$(e, t, n.deletion?.number, "deletions").map((e) => /* @__PURE__ */ i("tr", {
1069
- className: Y.annotationRow,
1070
- children: [/* @__PURE__ */ r("td", {
1071
- className: Y.annotationCell,
1082
+ }, $ = (e, t, n, r) => n === void 0 ? [] : e.filter((e) => e.location.itemId === t && e.location.lineNumber === n && e.location.side === r), Ke = (e, t, n, r) => [...$(e, t, n.deletion?.number, "deletions").map((e) => /* @__PURE__ */ o("tr", {
1083
+ className: J.annotationRow,
1084
+ children: [/* @__PURE__ */ a("td", {
1085
+ className: J.annotationCell,
1072
1086
  colSpan: 2,
1073
- children: /* @__PURE__ */ r(J, {
1087
+ children: /* @__PURE__ */ a(q, {
1074
1088
  annotation: e,
1075
- className: q(Y, "annotation"),
1076
- returnFocus: () => Q(a(), t, e.location.lineNumber, e.location.side)
1089
+ className: K(J, "annotation"),
1090
+ returnFocus: () => Q(r(), t, e.location.lineNumber, e.location.side)
1077
1091
  })
1078
- }), /* @__PURE__ */ r("td", { colSpan: 2 })]
1079
- }, e.id)), ...$(e, t, n.addition?.number, "additions").map((e) => /* @__PURE__ */ i("tr", {
1080
- className: Y.annotationRow,
1081
- children: [/* @__PURE__ */ r("td", { colSpan: 2 }), /* @__PURE__ */ r("td", {
1082
- className: Y.annotationCell,
1092
+ }), /* @__PURE__ */ a("td", { colSpan: 2 })]
1093
+ }, e.id)), ...$(e, t, n.addition?.number, "additions").map((e) => /* @__PURE__ */ o("tr", {
1094
+ className: J.annotationRow,
1095
+ children: [/* @__PURE__ */ a("td", { colSpan: 2 }), /* @__PURE__ */ a("td", {
1096
+ className: J.annotationCell,
1083
1097
  colSpan: 2,
1084
- children: /* @__PURE__ */ r(J, {
1098
+ children: /* @__PURE__ */ a(q, {
1085
1099
  annotation: e,
1086
- className: q(Y, "annotation"),
1087
- returnFocus: () => Q(a(), t, e.location.lineNumber, e.location.side)
1100
+ className: K(J, "annotation"),
1101
+ returnFocus: () => Q(r(), t, e.location.lineNumber, e.location.side)
1088
1102
  })
1089
1103
  })]
1090
- }, e.id))], We = (t, n, a, o, s) => /* @__PURE__ */ r("table", {
1104
+ }, e.id))], qe = (t, n, r, i, s) => /* @__PURE__ */ a("table", {
1091
1105
  "aria-label": `Changes in ${t.name}`,
1092
- className: Y.table,
1093
- children: /* @__PURE__ */ r("tbody", { children: Ve(t).map((t, c) => t.kind === "hunk" ? /* @__PURE__ */ r("tr", {
1094
- className: Y.hunk,
1095
- children: /* @__PURE__ */ r("td", {
1106
+ className: J.table,
1107
+ children: /* @__PURE__ */ a("tbody", { children: We(t).map((t, c) => t.kind === "hunk" ? /* @__PURE__ */ a("tr", {
1108
+ className: J.hunk,
1109
+ children: /* @__PURE__ */ a("td", {
1096
1110
  colSpan: 4,
1097
1111
  children: t.label
1098
1112
  })
1099
- }, `${c}:${t.label}`) : /* @__PURE__ */ i(e, { children: [/* @__PURE__ */ i("tr", {
1100
- className: Y[t.kind],
1113
+ }, `${c}:${t.label}`) : /* @__PURE__ */ o(e, { children: [/* @__PURE__ */ o("tr", {
1114
+ className: J[t.kind],
1101
1115
  children: [
1102
- /* @__PURE__ */ r("td", {
1103
- className: Y.lineNumber,
1116
+ /* @__PURE__ */ a("td", {
1117
+ className: J.lineNumber,
1104
1118
  children: t.deletion?.number
1105
1119
  }),
1106
- /* @__PURE__ */ r("td", {
1107
- className: Y.deletionCode,
1120
+ /* @__PURE__ */ a("td", {
1121
+ className: J.deletionCode,
1108
1122
  children: t.deletion === void 0 ? null : Z(t.deletion.content, n, t.deletion.number, "deletions", s)
1109
1123
  }),
1110
- /* @__PURE__ */ r("td", {
1111
- className: Y.lineNumber,
1124
+ /* @__PURE__ */ a("td", {
1125
+ className: J.lineNumber,
1112
1126
  children: t.addition?.number
1113
1127
  }),
1114
- /* @__PURE__ */ r("td", {
1115
- className: Y.additionCode,
1128
+ /* @__PURE__ */ a("td", {
1129
+ className: J.additionCode,
1116
1130
  children: t.addition === void 0 ? null : Z(t.addition.content, n, t.addition.number, "additions", s)
1117
1131
  })
1118
1132
  ]
1119
- }), Ue(a, n, t, o)] }, `${c}:${t.deletion?.number ?? ""}:${t.addition?.number ?? ""}`)) })
1120
- }), Ge = (e, t, n, i) => [...n.deletionNumber === void 0 ? [] : [Ie(n.deletionNumber, "deletions")], ...n.additionNumber === void 0 ? [] : [Ie(n.additionNumber, "additions")]].flatMap(({ lineNumber: n, side: a }) => $(e, t, n, a).map((e) => /* @__PURE__ */ r("tr", {
1121
- className: Y.annotationRow,
1122
- children: /* @__PURE__ */ r("td", {
1123
- className: Y.annotationCell,
1133
+ }), Ke(r, n, t, i)] }, `${c}:${t.deletion?.number ?? ""}:${t.addition?.number ?? ""}`)) })
1134
+ }), Je = (e, t, n, r) => [...n.deletionNumber === void 0 ? [] : [Be(n.deletionNumber, "deletions")], ...n.additionNumber === void 0 ? [] : [Be(n.additionNumber, "additions")]].flatMap(({ lineNumber: n, side: i }) => $(e, t, n, i).map((e) => /* @__PURE__ */ a("tr", {
1135
+ className: J.annotationRow,
1136
+ children: /* @__PURE__ */ a("td", {
1137
+ className: J.annotationCell,
1124
1138
  colSpan: 4,
1125
- children: /* @__PURE__ */ r(J, {
1139
+ children: /* @__PURE__ */ a(q, {
1126
1140
  annotation: e,
1127
- className: q(Y, "annotation"),
1128
- returnFocus: () => Q(i(), t, n, a)
1141
+ className: K(J, "annotation"),
1142
+ returnFocus: () => Q(r(), t, n, i)
1129
1143
  })
1130
1144
  })
1131
- }, e.id))), Ke = (t, n, a, o, s) => /* @__PURE__ */ r("table", {
1145
+ }, e.id))), Ye = (t, n, r, i, s) => /* @__PURE__ */ a("table", {
1132
1146
  "aria-label": `Changes in ${t.name}`,
1133
- className: Y.table,
1134
- children: /* @__PURE__ */ r("tbody", { children: He(t).map((t, c) => t.kind === "hunk" ? /* @__PURE__ */ r("tr", {
1135
- className: Y.hunk,
1136
- children: /* @__PURE__ */ r("td", {
1147
+ className: J.table,
1148
+ children: /* @__PURE__ */ a("tbody", { children: Ge(t).map((t, c) => t.kind === "hunk" ? /* @__PURE__ */ a("tr", {
1149
+ className: J.hunk,
1150
+ children: /* @__PURE__ */ a("td", {
1137
1151
  colSpan: 4,
1138
1152
  children: t.label
1139
1153
  })
1140
- }, `${c}:${t.label}`) : /* @__PURE__ */ i(e, { children: [/* @__PURE__ */ i("tr", {
1141
- className: Y[t.kind],
1154
+ }, `${c}:${t.label}`) : /* @__PURE__ */ o(e, { children: [/* @__PURE__ */ o("tr", {
1155
+ className: J[t.kind],
1142
1156
  children: [
1143
- /* @__PURE__ */ r("td", {
1144
- className: Y.lineNumber,
1157
+ /* @__PURE__ */ a("td", {
1158
+ className: J.lineNumber,
1145
1159
  children: t.deletionNumber
1146
1160
  }),
1147
- /* @__PURE__ */ r("td", {
1148
- className: Y.lineNumber,
1161
+ /* @__PURE__ */ a("td", {
1162
+ className: J.lineNumber,
1149
1163
  children: t.additionNumber
1150
1164
  }),
1151
- /* @__PURE__ */ r("td", {
1152
- className: Y.marker,
1165
+ /* @__PURE__ */ a("td", {
1166
+ className: J.marker,
1153
1167
  children: t.kind === "addition" ? "+" : t.kind === "deletion" ? "−" : " "
1154
1168
  }),
1155
- /* @__PURE__ */ r("td", { children: Z(t.content, n, t.kind === "deletion" ? t.deletionNumber ?? 0 : t.additionNumber ?? 0, t.kind === "deletion" ? "deletions" : "additions", s, t.kind === "context" && t.deletionNumber !== void 0 ? {
1169
+ /* @__PURE__ */ a("td", { children: Z(t.content, n, t.kind === "deletion" ? t.deletionNumber ?? 0 : t.additionNumber ?? 0, t.kind === "deletion" ? "deletions" : "additions", s, t.kind === "context" && t.deletionNumber !== void 0 ? {
1156
1170
  lineNumber: t.deletionNumber,
1157
1171
  side: "deletions"
1158
1172
  } : void 0) })
1159
1173
  ]
1160
- }), Ge(a, n, t, o)] }, `${c}:${t.deletionNumber ?? ""}:${t.additionNumber ?? ""}`)) })
1161
- }), qe = ({ annotations: e = [], className: t, empty: a = "No renderable source changes.", initialItems: o, mode: s = "split", wrap: c = !1 }) => {
1162
- Fe(e);
1163
- let l = n(null);
1164
- return o.length === 0 ? /* @__PURE__ */ r("p", {
1174
+ }), Je(r, n, t, i)] }, `${c}:${t.deletionNumber ?? ""}:${t.additionNumber ?? ""}`)) })
1175
+ }), Xe = ({ annotations: e = [], className: t, empty: i = "No renderable source changes.", initialItems: s, mode: c = "split", wrap: l = !1 }) => {
1176
+ ze(e);
1177
+ let u = r(null), [d, f] = Fe(720), p = n((e) => (u.current = e, f(e)), [f]), m = c === "split" && d ? "stacked" : c;
1178
+ return s.length === 0 ? /* @__PURE__ */ a("p", {
1165
1179
  className: t,
1166
- children: a
1167
- }) : /* @__PURE__ */ r("div", {
1168
- ref: l,
1169
- className: t === void 0 ? q(Y, "root") : `${q(Y, "root")} ${t}`,
1180
+ children: i
1181
+ }) : /* @__PURE__ */ a("div", {
1182
+ ref: p,
1183
+ className: t === void 0 ? K(J, "root") : `${K(J, "root")} ${t}`,
1170
1184
  "data-rly-diff-code-view": "",
1171
- "data-rly-diff-mode": s,
1172
- children: o.map((t) => {
1173
- let n = Re(t);
1174
- return n === void 0 ? /* @__PURE__ */ r("p", {
1175
- className: Y.noChanges,
1185
+ "data-rly-diff-mode": m,
1186
+ children: s.map((t) => {
1187
+ let n = Ve(t);
1188
+ return n === void 0 ? /* @__PURE__ */ a("p", {
1189
+ className: J.noChanges,
1176
1190
  children: "No textual changes in this file."
1177
- }, t.id) : /* @__PURE__ */ i("section", {
1178
- className: Y.file,
1179
- children: [o.length > 1 ? /* @__PURE__ */ r("h3", {
1180
- className: Y.fileName,
1191
+ }, t.id) : /* @__PURE__ */ o("section", {
1192
+ className: J.file,
1193
+ children: [s.length > 1 ? /* @__PURE__ */ a("h3", {
1194
+ className: J.fileName,
1181
1195
  children: n.name
1182
- }) : null, /* @__PURE__ */ r("div", {
1183
- className: Y.scroller,
1184
- children: s === "split" ? We(n, t.id, e, () => l.current, c) : Ke(n, t.id, e, () => l.current, c)
1196
+ }) : null, /* @__PURE__ */ a("div", {
1197
+ className: J.scroller,
1198
+ children: m === "split" ? qe(n, t.id, e, () => u.current, l) : Ye(n, t.id, e, () => u.current, l)
1185
1199
  })]
1186
1200
  }, t.id);
1187
1201
  })
1188
1202
  });
1189
1203
  };
1190
1204
  //#endregion
1191
- export { qe as BoundedDiffCodeView };
1205
+ export { Xe as BoundedDiffCodeView };
1192
1206
 
1193
1207
  //# sourceMappingURL=index.js.map