@thehammer/template-verification 0.2.2 → 0.2.3

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.
@@ -1,8 +1,8 @@
1
- import { ref as U, watch as ce, defineComponent as K, computed as d, openBlock as l, createElementBlock as o, normalizeClass as A, createElementVNode as r, toDisplayString as y, createCommentVNode as _, createBlock as N, unref as i, withCtx as I, createTextVNode as T, createVNode as V, Fragment as L, renderList as M, withKeys as Te, withModifiers as Ue, renderSlot as Ne, withDirectives as Ae, isRef as ge, vModelCheckbox as Re } from "vue";
2
- import { DanxChip as J, CodeViewer as xe, useToast as _e, DanxDialog as re, DanxProgressBar as we, DanxAlert as ye, DanxTabs as Le, MarkdownEditor as je, DanxFileViewer as be, DanxButton as se, DanxInput as Ee, DanxSkeleton as ze, DanxTooltip as Pe, DanxIcon as Me, gearIcon as Be, DanxBadge as Fe, DanxToastContainer as qe } from "@thehammer/danx-ui";
3
- const P = "tv-chrome", ke = "template-verification:enabled";
1
+ import { ref as U, watch as ce, defineComponent as H, computed as d, openBlock as l, createElementBlock as o, normalizeClass as R, createElementVNode as i, toDisplayString as m, createCommentVNode as b, createBlock as N, unref as r, withCtx as I, createTextVNode as T, createVNode as D, Fragment as L, renderList as P, withKeys as Ue, withModifiers as Ne, renderSlot as Re, withDirectives as Ae, isRef as ge, vModelCheckbox as Le } from "vue";
2
+ import { DanxChip as J, CodeViewer as xe, useToast as _e, DanxDialog as re, DanxProgressBar as we, DanxAlert as ye, DanxTabs as je, MarkdownEditor as Ee, DanxFileViewer as be, DanxButton as se, DanxInput as ze, DanxSkeleton as Pe, DanxTooltip as Me, DanxIcon as Be, gearIcon as Fe, DanxBadge as qe, DanxToastContainer as Ye } from "@thehammer/danx-ui";
3
+ const z = "tv-chrome", ke = "template-verification:enabled";
4
4
  let te = null;
5
- function Ye(e) {
5
+ function Je(e) {
6
6
  var t;
7
7
  try {
8
8
  return ((t = globalThis.localStorage) == null ? void 0 : t.getItem(e)) ?? null;
@@ -10,22 +10,22 @@ function Ye(e) {
10
10
  return null;
11
11
  }
12
12
  }
13
- function Je(e, t) {
13
+ function Ke(e, t) {
14
14
  var a;
15
15
  try {
16
16
  (a = globalThis.localStorage) == null || a.setItem(e, t);
17
17
  } catch {
18
18
  }
19
19
  }
20
- function Ke(e) {
21
- const t = Ye(ke);
20
+ function He(e) {
21
+ const t = Je(ke);
22
22
  return t === null ? e : t === "true";
23
23
  }
24
24
  function $e(e) {
25
- const t = U(Ke((e == null ? void 0 : e.defaultEnabled) ?? !1));
25
+ const t = U(He((e == null ? void 0 : e.defaultEnabled) ?? !1));
26
26
  return ce(
27
27
  t,
28
- (a) => Je(ke, a ? "true" : "false")
28
+ (a) => Ke(ke, a ? "true" : "false")
29
29
  ), {
30
30
  enabled: t,
31
31
  data: (e == null ? void 0 : e.data) ?? {},
@@ -54,13 +54,13 @@ function le() {
54
54
  }
55
55
  };
56
56
  }
57
- function He() {
57
+ function Ge() {
58
58
  return Se().comparisonOpen;
59
59
  }
60
60
  function ve(e) {
61
61
  return typeof e != "number" || Number.isNaN(e) ? "unverifiable" : e <= 2 ? "low" : e === 3 ? "medium" : "high";
62
62
  }
63
- const Ge = {
63
+ const Qe = {
64
64
  high: "bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20",
65
65
  medium: "bg-yellow-50 text-yellow-700 ring-1 ring-inset ring-yellow-600/20",
66
66
  low: "bg-red-50 text-red-700 ring-1 ring-inset ring-red-600/20",
@@ -72,9 +72,9 @@ const Ge = {
72
72
  unverifiable: "Unverifiable"
73
73
  }, Ce = ["override", "extracted", "claim"];
74
74
  function fe(e) {
75
- return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved : Qe(e.candidates) : { value: null, source: "none" };
75
+ return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved : We(e.candidates) : { value: null, source: "none" };
76
76
  }
77
- function Qe(e) {
77
+ function We(e) {
78
78
  if (e)
79
79
  for (const t of Ce) {
80
80
  const a = e[t];
@@ -84,54 +84,111 @@ function Qe(e) {
84
84
  return { value: null, source: "none" };
85
85
  }
86
86
  function ie(e) {
87
- var g, m;
88
- const t = (m = (g = e == null ? void 0 : e.candidates) == null ? void 0 : g.extracted) == null ? void 0 : m.reasoning;
87
+ var g, p;
88
+ const t = (p = (g = e == null ? void 0 : e.candidates) == null ? void 0 : g.extracted) == null ? void 0 : p.reasoning;
89
89
  if (t == null) return null;
90
90
  const a = String(t).trim();
91
91
  return a === "" ? null : a;
92
92
  }
93
93
  function oe(e) {
94
- var g, m;
95
- const t = (m = (g = e == null ? void 0 : e.candidates) == null ? void 0 : g.extracted) == null ? void 0 : m.cited_text;
94
+ var g, p;
95
+ const t = (p = (g = e == null ? void 0 : e.candidates) == null ? void 0 : g.extracted) == null ? void 0 : p.cited_text;
96
96
  if (t == null) return null;
97
97
  const a = String(t).trim();
98
98
  return a === "" ? null : a;
99
99
  }
100
100
  function Ve(e) {
101
- return e ? typeof e.discrepancy == "boolean" ? e.discrepancy : We(e.candidates) : !1;
101
+ return e ? typeof e.discrepancy == "boolean" ? e.discrepancy : Xe(e.candidates) : !1;
102
102
  }
103
- function We(e) {
103
+ function Xe(e) {
104
104
  if (!e) return !1;
105
- const t = Ce.map((a) => e[a]).filter((a) => a != null).map((a) => Xe(a.value));
105
+ const t = Ce.map((a) => e[a]).filter((a) => a != null).map((a) => Ze(a.value));
106
106
  return t.length < 2 ? !1 : new Set(t).size > 1;
107
107
  }
108
- function Xe(e) {
108
+ function Ze(e) {
109
109
  return JSON.stringify(e ?? null);
110
110
  }
111
- function Ze(e, t, a) {
112
- var s;
113
- const g = (s = t.value) == null ? void 0 : s.anchor;
111
+ const et = /* @__PURE__ */ new Set(["name", "type"]);
112
+ function De(e, t = "") {
113
+ const a = [];
114
+ return ue(e, t, a), a;
115
+ }
116
+ function ue(e, t, a) {
117
+ if (Array.isArray(e)) {
118
+ e.forEach((n, y) => ue(n, `${t}[${y}]`, a));
119
+ return;
120
+ }
121
+ if (!he(e)) return;
122
+ const p = e.__meta ?? {};
123
+ for (const [n, y] of Object.entries(e)) {
124
+ if (n === "__meta") continue;
125
+ const s = t ? `${t}.${n}` : n;
126
+ if (Array.isArray(y) || he(y)) {
127
+ ue(y, s, a);
128
+ continue;
129
+ }
130
+ const h = p[n];
131
+ !h && et.has(n) || a.push({
132
+ path: s,
133
+ label: n,
134
+ meta: h ?? null,
135
+ value: y,
136
+ unanchored: !h
137
+ });
138
+ }
139
+ }
140
+ function he(e) {
141
+ return typeof e == "object" && e !== null && !Array.isArray(e);
142
+ }
143
+ function Oe(e) {
144
+ var a;
145
+ if (e.candidates.override) return !1;
146
+ const t = (a = e.candidates.extracted) == null ? void 0 : a.confidence;
147
+ return e.discrepancy || t == null || t <= 2;
148
+ }
149
+ function tt(e) {
150
+ const t = De(e).filter(
151
+ (n) => n.meta !== null
152
+ ), a = t.length;
153
+ let g = 0, p = 0;
154
+ for (const n of t) {
155
+ if (n.meta.candidates.override) {
156
+ g++;
157
+ continue;
158
+ }
159
+ Oe(n.meta) && p++;
160
+ }
161
+ return {
162
+ total: a,
163
+ verified: g,
164
+ needsReview: p,
165
+ percent: a === 0 ? 100 : Math.round(g / a * 100)
166
+ };
167
+ }
168
+ function at(e, t, a) {
169
+ var n;
170
+ const g = (n = t.value) == null ? void 0 : n.anchor;
114
171
  if (!e.saveOverride || !g) return null;
115
- const m = e.saveOverride;
116
- return async (f, n) => {
117
- const b = await m({
172
+ const p = e.saveOverride;
173
+ return async (y, s) => {
174
+ const h = await p({
118
175
  workflow_input_id: e.workflowInputId,
119
176
  object_ids: g.object_ids,
120
177
  field: g.field,
121
178
  field_path: g.field_path,
122
- value: f,
123
- source_choice: n
179
+ value: y,
180
+ source_choice: s
124
181
  });
125
- return a(b), b;
182
+ return a(h), h;
126
183
  };
127
184
  }
128
- const et = ["data-status", "title"], tt = {
185
+ const lt = ["data-status", "title"], nt = {
129
186
  class: "tv-confidence-glyph",
130
187
  "aria-hidden": "true"
131
- }, at = {
188
+ }, st = {
132
189
  key: 0,
133
190
  class: "tv-confidence-label"
134
- }, ue = /* @__PURE__ */ K({
191
+ }, de = /* @__PURE__ */ H({
135
192
  __name: "ConfidenceIcon",
136
193
  props: {
137
194
  confidence: {},
@@ -149,139 +206,150 @@ const et = ["data-status", "title"], tt = {
149
206
  low: "✕",
150
207
  // x
151
208
  unverifiable: "?"
152
- }, m = d(() => g[a.value]), s = d(() => Ge[a.value]), f = d(() => ae[a.value]);
153
- return (n, b) => (l(), o("span", {
154
- class: A(["tv-confidence-icon inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-none", s.value]),
209
+ }, p = d(() => g[a.value]), n = d(() => Qe[a.value]), y = d(() => ae[a.value]);
210
+ return (s, h) => (l(), o("span", {
211
+ class: R(["tv-confidence-icon inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-none", n.value]),
155
212
  "data-status": a.value,
156
- title: f.value
213
+ title: y.value
157
214
  }, [
158
- r("span", tt, y(m.value), 1),
159
- e.showLabel ? (l(), o("span", at, y(f.value), 1)) : _("", !0)
160
- ], 10, et));
215
+ i("span", nt, m(p.value), 1),
216
+ e.showLabel ? (l(), o("span", st, m(y.value), 1)) : b("", !0)
217
+ ], 10, lt));
161
218
  }
162
219
  });
163
- async function lt(e, t) {
220
+ async function rt(e, t) {
164
221
  const a = t.object_ids.at(-1), g = new URLSearchParams({
165
222
  object_id: String(a),
166
223
  field: t.field
167
- }), m = e.includes("?") ? "&" : "?", s = await fetch(`${e}${m}${g}`);
168
- if (!s.ok)
224
+ }), p = e.includes("?") ? "&" : "?", n = await fetch(`${e}${p}${g}`);
225
+ if (!n.ok)
169
226
  throw new Error(
170
- `data-point-audit ${s.status}: ${await s.text()}`
227
+ `data-point-audit ${n.status}: ${await n.text()}`
171
228
  );
172
- return (await s.json()).data ?? [];
229
+ return (await n.json()).data ?? [];
173
230
  }
174
- function De(e) {
175
- var a, g, m;
231
+ function Ie(e) {
232
+ var a, g, p;
176
233
  if (!e || e.length === 0) return [];
177
234
  const t = /* @__PURE__ */ new Map();
178
- for (const s of e) {
179
- const f = nt(s);
180
- let n = t.get(f);
181
- n || (n = {
182
- fileLabel: st(s),
183
- fileUrl: s.file_url ?? ((a = s.file) == null ? void 0 : a.url),
184
- file: s.file,
235
+ for (const n of e) {
236
+ const y = it(n);
237
+ let s = t.get(y);
238
+ s || (s = {
239
+ fileLabel: ot(n),
240
+ fileUrl: n.file_url ?? ((a = n.file) == null ? void 0 : a.url),
241
+ file: n.file,
185
242
  sources: []
186
- }, t.set(f, n)), !n.fileUrl && (s.file_url ?? ((g = s.file) == null ? void 0 : g.url)) && (n.fileUrl = s.file_url ?? ((m = s.file) == null ? void 0 : m.url)), !n.file && s.file && (n.file = s.file), n.sources.push(s);
243
+ }, t.set(y, s)), !s.fileUrl && (n.file_url ?? ((g = n.file) == null ? void 0 : g.url)) && (s.fileUrl = n.file_url ?? ((p = n.file) == null ? void 0 : p.url)), !s.file && n.file && (s.file = n.file), s.sources.push(n);
187
244
  }
188
245
  return [...t.values()];
189
246
  }
190
- function nt(e) {
247
+ function it(e) {
191
248
  const t = e.file_name ?? e.file_id ?? e.stored_file_id ?? e.source_id ?? e.id;
192
249
  return t != null ? String(t) : "__unknown__";
193
250
  }
194
- function st(e) {
251
+ function ot(e) {
195
252
  var t;
196
253
  return (t = e.file) != null && t.name ? e.file.name : e.file_name ? e.file_name : e.file_id !== void 0 && e.file_id !== null ? `File ${e.file_id}` : e.stored_file_id !== void 0 && e.stored_file_id !== null ? `File ${e.stored_file_id}` : e.source_type ? e.source_type : "Source";
197
254
  }
198
- function rt(e) {
255
+ function ut(e) {
199
256
  const t = e.page ?? e.page_number;
200
257
  return t != null ? `Page ${t}` : e.explanation ? String(e.explanation) : e.source_type ? String(e.source_type) : "Citation";
201
258
  }
202
- const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm" }, ot = { class: "tv-audit-call-header flex flex-wrap items-center gap-2 border-b border-gray-100 bg-gray-50 px-3 py-2" }, ut = {
203
- key: 2,
204
- class: "font-mono text-[11px] text-gray-400"
205
- }, dt = {
259
+ const dt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm" }, ct = { class: "tv-audit-call-header flex flex-wrap items-center gap-2 border-b border-gray-100 bg-gray-50 px-3 py-2" }, vt = {
206
260
  key: 3,
207
- class: "text-[11px] font-medium text-gray-500"
208
- }, ct = {
261
+ class: "font-mono text-[11px] text-gray-400"
262
+ }, ft = {
209
263
  key: 4,
264
+ class: "text-[11px] font-medium text-gray-500"
265
+ }, pt = {
266
+ key: 5,
210
267
  class: "text-[11px] text-gray-400"
211
- }, vt = { class: "tv-audit-call-body flex flex-col gap-2 p-3" }, ft = /* @__PURE__ */ K({
268
+ }, mt = { class: "tv-audit-call-body flex flex-col gap-2 p-3" }, gt = /* @__PURE__ */ H({
212
269
  __name: "AuditCallCard",
213
270
  props: {
214
271
  call: {}
215
272
  },
216
273
  setup(e) {
217
274
  const t = e, a = d(() => {
218
- const n = t.call.status_code;
219
- return n == null ? "muted" : n >= 200 && n < 300 ? "success" : n >= 400 ? "danger" : "warning";
275
+ const s = t.call.status_code;
276
+ return s == null ? "muted" : s >= 200 && s < 300 ? "success" : s >= 400 ? "danger" : "warning";
220
277
  }), g = d(() => {
221
- const n = t.call.run_time_ms;
222
- return n == null ? null : n >= 1e3 ? `${(n / 1e3).toFixed(1)}s` : `${n}ms`;
223
- }), m = d(() => {
278
+ const s = t.call.run_time_ms;
279
+ return s == null ? null : s >= 1e3 ? `${(s / 1e3).toFixed(1)}s` : `${s}ms`;
280
+ }), p = d(() => {
224
281
  if (!t.call.started_at) return null;
225
- const n = new Date(t.call.started_at);
226
- return Number.isNaN(n.getTime()) ? t.call.started_at : n.toLocaleString();
227
- }), s = d(
282
+ const s = new Date(t.call.started_at);
283
+ return Number.isNaN(s.getTime()) ? t.call.started_at : s.toLocaleString();
284
+ }), n = d(
228
285
  () => JSON.stringify(t.call.request ?? null, null, 2)
229
- ), f = d(
286
+ ), y = d(
230
287
  () => JSON.stringify(t.call.response ?? null, null, 2)
231
288
  );
232
- return (n, b) => (l(), o("div", it, [
233
- r("div", ot, [
234
- e.call.model ? (l(), N(i(J), {
289
+ return (s, h) => (l(), o("div", dt, [
290
+ i("div", ct, [
291
+ e.call.stage ? (l(), N(r(J), {
235
292
  key: 0,
293
+ variant: "muted",
294
+ size: "xxs",
295
+ class: "tv-audit-stage"
296
+ }, {
297
+ default: I(() => [
298
+ T(m(e.call.stage), 1)
299
+ ]),
300
+ _: 1
301
+ })) : b("", !0),
302
+ e.call.model ? (l(), N(r(J), {
303
+ key: 1,
236
304
  variant: "info",
237
305
  size: "xs",
238
306
  class: "tv-audit-model"
239
307
  }, {
240
308
  default: I(() => [
241
- T(y(e.call.model), 1)
309
+ T(m(e.call.model), 1)
242
310
  ]),
243
311
  _: 1
244
- })) : _("", !0),
245
- e.call.service ? (l(), N(i(J), {
246
- key: 1,
312
+ })) : b("", !0),
313
+ e.call.service ? (l(), N(r(J), {
314
+ key: 2,
247
315
  variant: "muted",
248
316
  size: "xxs"
249
317
  }, {
250
318
  default: I(() => [
251
- T(y(e.call.service), 1)
319
+ T(m(e.call.service), 1)
252
320
  ]),
253
321
  _: 1
254
- })) : _("", !0),
255
- e.call.endpoint ? (l(), o("span", ut, y(e.call.endpoint), 1)) : _("", !0),
256
- b[0] || (b[0] = r("span", { class: "flex-1" }, null, -1)),
257
- V(i(J), {
322
+ })) : b("", !0),
323
+ e.call.endpoint ? (l(), o("span", vt, m(e.call.endpoint), 1)) : b("", !0),
324
+ h[0] || (h[0] = i("span", { class: "flex-1" }, null, -1)),
325
+ D(r(J), {
258
326
  variant: a.value,
259
327
  size: "xxs",
260
328
  class: "tv-audit-status"
261
329
  }, {
262
330
  default: I(() => [
263
- T(y(e.call.status_code ?? "…"), 1)
331
+ T(m(e.call.status_code ?? "…"), 1)
264
332
  ]),
265
333
  _: 1
266
334
  }, 8, ["variant"]),
267
- g.value ? (l(), o("span", dt, y(g.value), 1)) : _("", !0),
268
- m.value ? (l(), o("span", ct, y(m.value), 1)) : _("", !0)
335
+ g.value ? (l(), o("span", ft, m(g.value), 1)) : b("", !0),
336
+ p.value ? (l(), o("span", pt, m(p.value), 1)) : b("", !0)
269
337
  ]),
270
- r("div", vt, [
271
- r("div", null, [
272
- b[1] || (b[1] = r("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Request ", -1)),
273
- V(i(xe), {
274
- "model-value": s.value,
338
+ i("div", mt, [
339
+ i("div", null, [
340
+ h[1] || (h[1] = i("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Request ", -1)),
341
+ D(r(xe), {
342
+ "model-value": n.value,
275
343
  format: "json",
276
344
  collapsible: "",
277
345
  "default-collapsed": "",
278
346
  class: "tv-audit-request"
279
347
  }, null, 8, ["model-value"])
280
348
  ]),
281
- r("div", null, [
282
- b[2] || (b[2] = r("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Response ", -1)),
283
- V(i(xe), {
284
- "model-value": f.value,
349
+ i("div", null, [
350
+ h[2] || (h[2] = i("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Response ", -1)),
351
+ D(r(xe), {
352
+ "model-value": y.value,
285
353
  format: "json",
286
354
  collapsible: "",
287
355
  "default-collapsed": "",
@@ -291,46 +359,46 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
291
359
  ])
292
360
  ]));
293
361
  }
294
- }), pt = { class: "tv-modal flex h-full flex-col gap-4 overflow-y-auto p-1" }, mt = { class: "tv-modal-resolved flex flex-col gap-3 rounded-xl border border-gray-200 bg-gradient-to-br from-gray-50 to-white p-4 shadow-sm" }, gt = { class: "flex flex-wrap items-start justify-between gap-4" }, xt = { class: "min-w-0 flex-1" }, yt = { class: "tv-resolved-value mt-1 break-words font-mono text-xl font-semibold leading-snug text-gray-900" }, bt = { class: "mt-1 text-[11px] text-gray-400" }, ht = { class: "tv-resolved-source font-medium text-gray-500" }, _t = { class: "tv-confidence-meter w-56 shrink-0" }, wt = { class: "mt-2" }, kt = {
362
+ }), xt = { class: "tv-modal flex h-full flex-col gap-4 overflow-y-auto p-1" }, yt = { class: "tv-modal-resolved flex flex-col gap-3 rounded-xl border border-gray-200 bg-gradient-to-br from-gray-50 to-white p-4 shadow-sm" }, bt = { class: "flex flex-wrap items-start justify-between gap-4" }, ht = { class: "min-w-0 flex-1" }, _t = { class: "tv-resolved-value mt-1 break-words font-mono text-xl font-semibold leading-snug text-gray-900" }, wt = { class: "mt-1 text-[11px] text-gray-400" }, kt = { class: "tv-resolved-source font-medium text-gray-500" }, $t = { class: "tv-confidence-meter w-56 shrink-0" }, St = { class: "mt-2" }, Ct = {
295
363
  key: 1,
296
364
  class: "tv-confidence-value text-sm text-gray-400"
297
- }, $t = {
365
+ }, Vt = {
298
366
  key: 0,
299
367
  class: "tv-tab-evidence flex min-h-0 flex-1 flex-col gap-4"
300
- }, St = {
368
+ }, Dt = {
301
369
  key: 0,
302
370
  class: "tv-reasoning-card rounded-lg border border-gray-200 p-3"
303
- }, Ct = {
371
+ }, Ot = {
304
372
  key: 1,
305
373
  class: "tv-cited-text rounded-lg border-l-4 border-blue-200 bg-blue-50/50 px-4 py-3 text-sm italic leading-relaxed text-gray-700"
306
- }, Vt = {
374
+ }, It = {
307
375
  key: 2,
308
376
  class: "tv-evidence-viewer flex min-h-[24rem] flex-1 flex-col overflow-hidden rounded-lg border border-gray-200"
309
- }, Dt = {
377
+ }, Tt = {
310
378
  key: 0,
311
379
  class: "tv-page-context border-t border-gray-100 bg-gray-50 px-3 py-2 text-xs text-gray-500"
312
- }, Ot = {
380
+ }, Ut = {
313
381
  key: 3,
314
382
  class: "tv-no-source rounded-lg border border-dashed border-gray-200 p-6 text-center text-sm text-gray-400"
315
- }, It = {
383
+ }, Nt = {
316
384
  key: 4,
317
385
  class: "tv-full-documents flex flex-wrap items-center gap-2"
318
- }, Tt = {
386
+ }, Rt = {
319
387
  key: 1,
320
388
  class: "tv-tab-candidates flex flex-col gap-3"
321
- }, Ut = { class: "flex flex-wrap items-center justify-between gap-3" }, Nt = { class: "min-w-0 flex-1" }, At = { class: "flex items-center gap-2" }, Rt = { class: "mt-2 break-words font-mono text-base text-gray-900" }, Lt = { class: "mt-1 text-xs text-gray-400" }, jt = {
389
+ }, At = { class: "flex flex-wrap items-center justify-between gap-3" }, Lt = { class: "min-w-0 flex-1" }, jt = { class: "flex items-center gap-2" }, Et = { class: "mt-2 break-words font-mono text-base text-gray-900" }, zt = { class: "mt-1 text-xs text-gray-400" }, Pt = {
322
390
  key: 0,
323
391
  class: "tv-custom-entry flex items-center gap-2 rounded-lg border border-dashed border-gray-300 p-4"
324
- }, Et = {
392
+ }, Mt = {
325
393
  key: 1,
326
394
  class: "tv-read-only text-center text-xs text-gray-400"
327
- }, zt = {
395
+ }, Bt = {
328
396
  key: 2,
329
397
  class: "tv-tab-audit flex flex-col gap-3"
330
- }, Pt = {
398
+ }, Ft = {
331
399
  key: 2,
332
400
  class: "tv-audit-empty rounded-lg border border-dashed border-gray-200 p-6 text-center text-sm text-gray-400"
333
- }, Mt = /* @__PURE__ */ K({
401
+ }, qt = /* @__PURE__ */ H({
334
402
  __name: "VerificationModal",
335
403
  props: {
336
404
  modelValue: { type: Boolean },
@@ -340,23 +408,23 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
340
408
  },
341
409
  emits: ["update:modelValue", "saved"],
342
410
  setup(e, { emit: t }) {
343
- const a = e, g = t, m = le(), s = _e(), f = d({
411
+ const a = e, g = t, p = le(), n = _e(), y = d({
344
412
  get: () => a.modelValue,
345
413
  set: (v) => g("update:modelValue", v)
346
- }), n = d(() => fe(a.meta)), b = d(() => a.meta.candidates.extracted), $ = d(() => a.meta.candidates.claim), h = d(() => a.meta.candidates.override), x = d(() => {
414
+ }), s = d(() => fe(a.meta)), h = d(() => a.meta.candidates.extracted), $ = d(() => a.meta.candidates.claim), _ = d(() => a.meta.candidates.override), x = d(() => {
347
415
  var v;
348
- return ((v = b.value) == null ? void 0 : v.confidence) ?? null;
349
- }), k = d(() => ve(x.value)), S = d(() => ie(a.meta)), R = d(() => oe(a.meta)), O = d(() => {
416
+ return ((v = h.value) == null ? void 0 : v.confidence) ?? null;
417
+ }), k = d(() => ve(x.value)), S = d(() => ie(a.meta)), A = d(() => oe(a.meta)), O = d(() => {
350
418
  var v;
351
- return De((v = b.value) == null ? void 0 : v.sources);
352
- }), j = d(() => (a.meta.anchor.field_path || a.label || "Data point").split(".").map(
419
+ return Ie((v = h.value) == null ? void 0 : v.sources);
420
+ }), M = d(() => (a.meta.anchor.field_path || a.label || "Data point").split(".").map(
353
421
  (u) => u.replace(/\[\d+\]/g, "").replace(/_/g, " ").replace(/^\w/, (C) => C.toUpperCase())
354
- ).join(" › ")), H = {
422
+ ).join(" › ")), B = {
355
423
  high: "success",
356
424
  medium: "warning",
357
425
  low: "danger",
358
426
  unverifiable: "muted"
359
- }, E = U("evidence"), W = d(() => !!m.auditUrl), X = d(() => {
427
+ }, j = U("evidence"), G = d(() => !!p.auditUrl), X = d(() => {
360
428
  var u;
361
429
  const v = [
362
430
  {
@@ -367,18 +435,18 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
367
435
  {
368
436
  value: "candidates",
369
437
  label: "Candidates",
370
- count: Q.value.length
438
+ count: W.value.length
371
439
  }
372
440
  ];
373
- return W.value && v.push({
441
+ return G.value && v.push({
374
442
  value: "audit",
375
443
  label: "Audit trail",
376
- count: ((u = F.value) == null ? void 0 : u.length) ?? void 0
444
+ count: ((u = Y.value) == null ? void 0 : u.length) ?? void 0
377
445
  }), v;
378
- }), q = d(
446
+ }), F = d(
379
447
  () => O.value.map((v) => v.file).filter((v) => !!v)
380
- ), p = U(null), w = d(() => {
381
- const v = p.value ?? q.value[0];
448
+ ), Q = U(null), f = d(() => {
449
+ const v = Q.value ?? F.value[0];
382
450
  if (!v) return null;
383
451
  const u = O.value.find(
384
452
  (c) => c.file && String(c.file.id) === String(v.id)
@@ -386,7 +454,7 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
386
454
  if (!u) return null;
387
455
  const C = u.sources.find((c) => c.explanation);
388
456
  return (C == null ? void 0 : C.explanation) ?? null;
389
- }), D = d(() => {
457
+ }), w = d(() => {
390
458
  const v = /* @__PURE__ */ new Map();
391
459
  for (const u of O.value)
392
460
  for (const C of u.sources) {
@@ -394,34 +462,34 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
394
462
  c && !v.has(String(c.id)) && v.set(String(c.id), c);
395
463
  }
396
464
  return [...v.values()];
397
- }), z = U(null), G = d({
398
- get: () => z.value !== null,
465
+ }), V = U(null), K = d({
466
+ get: () => V.value !== null,
399
467
  set: (v) => {
400
- v || (z.value = null);
468
+ v || (V.value = null);
401
469
  }
402
- }), Q = d(() => {
470
+ }), W = d(() => {
403
471
  const v = [];
404
- return h.value && v.push({
472
+ return _.value && v.push({
405
473
  key: "override",
406
474
  title: "Human override",
407
475
  variant: "success",
408
- value: h.value.value,
476
+ value: _.value.value,
409
477
  detail: [
410
- h.value.source_choice ? `basis: ${h.value.source_choice}` : null,
411
- h.value.set_at ? new Date(h.value.set_at).toLocaleString() : null
478
+ _.value.source_choice ? `basis: ${_.value.source_choice}` : null,
479
+ _.value.set_at ? new Date(_.value.set_at).toLocaleString() : null
412
480
  ].filter(Boolean).join(" · "),
413
- winner: n.value.source === "override"
414
- }), b.value && v.push({
481
+ winner: s.value.source === "override"
482
+ }), h.value && v.push({
415
483
  key: "extracted",
416
484
  title: "Extracted",
417
- variant: H[k.value],
418
- value: b.value.value,
485
+ variant: B[k.value],
486
+ value: h.value.value,
419
487
  detail: x.value != null ? `Confidence ${x.value}/5 · ${ae[k.value]}` : "No confidence recorded",
420
488
  accept: a.save ? () => {
421
489
  var u;
422
- return ne(pe((u = b.value) == null ? void 0 : u.value), "extracted");
490
+ return ne(pe((u = h.value) == null ? void 0 : u.value), "extracted");
423
491
  } : void 0,
424
- winner: n.value.source === "extracted"
492
+ winner: s.value.source === "extracted"
425
493
  }), $.value && v.push({
426
494
  key: "claim",
427
495
  title: "Claim",
@@ -432,38 +500,38 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
432
500
  var u;
433
501
  return ne(pe((u = $.value) == null ? void 0 : u.value), "claim");
434
502
  } : void 0,
435
- winner: n.value.source === "claim"
503
+ winner: s.value.source === "claim"
436
504
  }), v;
437
- }), B = U(""), Y = U(!1);
505
+ }), q = U(""), E = U(!1);
438
506
  async function ne(v, u) {
439
- if (!(!a.save || Y.value)) {
440
- Y.value = !0;
507
+ if (!(!a.save || E.value)) {
508
+ E.value = !0;
441
509
  try {
442
510
  const C = await a.save(v, u);
443
- g("saved", C), s.success(`Verified — ${j.value} locked in`);
444
- } catch {
445
- s.danger(`Could not save ${j.value} — try again`);
511
+ g("saved", C), n.success(`Verified — ${M.value} locked in`);
512
+ } catch (C) {
513
+ console.error("template-verification: save failed", C), n.danger(`Could not save ${M.value} — try again`);
446
514
  } finally {
447
- Y.value = !1;
515
+ E.value = !1;
448
516
  }
449
517
  }
450
518
  }
451
- const Ie = () => ne(B.value, "custom");
519
+ const Te = () => ne(q.value, "custom");
452
520
  function pe(v) {
453
521
  return v == null ? null : String(v);
454
522
  }
455
523
  function me(v) {
456
524
  return v == null ? "—" : String(v);
457
525
  }
458
- const F = U(null), Z = U(!1), ee = U(null);
526
+ const Y = U(null), Z = U(!1), ee = U(null);
459
527
  return ce(
460
- [E, f],
528
+ [j, y],
461
529
  async ([v, u]) => {
462
- if (!(v !== "audit" || !u || F.value !== null || Z.value) && m.auditUrl) {
530
+ if (!(v !== "audit" || !u || Y.value !== null || Z.value) && p.auditUrl) {
463
531
  Z.value = !0, ee.value = null;
464
532
  try {
465
- F.value = await lt(
466
- m.auditUrl,
533
+ Y.value = await rt(
534
+ p.auditUrl,
467
535
  a.meta.anchor
468
536
  );
469
537
  } catch (C) {
@@ -475,56 +543,56 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
475
543
  },
476
544
  { immediate: !0 }
477
545
  ), (v, u) => (l(), o(L, null, [
478
- V(i(re), {
479
- modelValue: f.value,
480
- "onUpdate:modelValue": u[3] || (u[3] = (C) => f.value = C),
481
- title: j.value,
546
+ D(r(re), {
547
+ modelValue: y.value,
548
+ "onUpdate:modelValue": u[3] || (u[3] = (C) => y.value = C),
549
+ title: M.value,
482
550
  width: 90,
483
551
  height: 90,
484
552
  "close-x": "",
485
- class: A(i(P))
553
+ class: R(r(z))
486
554
  }, {
487
555
  default: I(() => {
488
556
  var C;
489
557
  return [
490
- r("div", pt, [
491
- r("section", mt, [
492
- r("div", gt, [
493
- r("div", xt, [
494
- u[6] || (u[6] = r("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Resolved value ", -1)),
495
- r("div", yt, y(me(n.value.value)), 1),
496
- r("div", bt, [
558
+ i("div", xt, [
559
+ i("section", yt, [
560
+ i("div", bt, [
561
+ i("div", ht, [
562
+ u[6] || (u[6] = i("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Resolved value ", -1)),
563
+ i("div", _t, m(me(s.value.value)), 1),
564
+ i("div", wt, [
497
565
  u[5] || (u[5] = T(" source of truth: ", -1)),
498
- r("span", ht, y(n.value.source), 1)
566
+ i("span", kt, m(s.value.source), 1)
499
567
  ])
500
568
  ]),
501
- r("div", _t, [
502
- u[7] || (u[7] = r("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Extraction confidence ", -1)),
503
- r("div", wt, [
504
- x.value != null ? (l(), N(i(we), {
569
+ i("div", $t, [
570
+ u[7] || (u[7] = i("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Extraction confidence ", -1)),
571
+ i("div", St, [
572
+ x.value != null ? (l(), N(r(we), {
505
573
  key: 0,
506
574
  value: x.value,
507
575
  max: 5,
508
576
  size: "md",
509
- variant: H[k.value],
577
+ variant: B[k.value],
510
578
  gradient: "",
511
579
  shimmer: "",
512
580
  "show-text": "",
513
581
  "text-position": "beside",
514
582
  label: `${x.value}/5`
515
- }, null, 8, ["value", "variant", "label"])) : (l(), o("div", kt, " No confidence recorded "))
583
+ }, null, 8, ["value", "variant", "label"])) : (l(), o("div", Ct, " No confidence recorded "))
516
584
  ]),
517
- r("div", {
518
- class: A(["tv-confidence-label mt-1 text-right text-xs font-medium", {
585
+ i("div", {
586
+ class: R(["tv-confidence-label mt-1 text-right text-xs font-medium", {
519
587
  "text-green-600": k.value === "high",
520
588
  "text-yellow-600": k.value === "medium",
521
589
  "text-red-600": k.value === "low",
522
590
  "text-gray-400": k.value === "unverifiable"
523
591
  }])
524
- }, y(i(ae)[k.value]), 3)
592
+ }, m(r(ae)[k.value]), 3)
525
593
  ])
526
594
  ]),
527
- e.meta.discrepancy ? (l(), N(i(ye), {
595
+ e.meta.discrepancy ? (l(), N(r(ye), {
528
596
  key: 0,
529
597
  variant: "warning",
530
598
  class: "tv-discrepancy"
@@ -533,90 +601,90 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
533
601
  T(" Sources disagree on this value — review the candidates and pick a winner. ", -1)
534
602
  ])]),
535
603
  _: 1
536
- })) : _("", !0)
604
+ })) : b("", !0)
537
605
  ]),
538
- V(i(Le), {
539
- modelValue: E.value,
540
- "onUpdate:modelValue": u[0] || (u[0] = (c) => E.value = c),
606
+ D(r(je), {
607
+ modelValue: j.value,
608
+ "onUpdate:modelValue": u[0] || (u[0] = (c) => j.value = c),
541
609
  tabs: X.value,
542
610
  class: "tv-modal-tabs"
543
611
  }, null, 8, ["modelValue", "tabs"]),
544
- E.value === "evidence" ? (l(), o("section", $t, [
545
- S.value ? (l(), o("div", St, [
546
- u[9] || (u[9] = r("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Reasoning ", -1)),
547
- V(i(je), {
612
+ j.value === "evidence" ? (l(), o("section", Vt, [
613
+ S.value ? (l(), o("div", Dt, [
614
+ u[9] || (u[9] = i("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Reasoning ", -1)),
615
+ D(r(Ee), {
548
616
  "model-value": S.value,
549
617
  readonly: "",
550
618
  class: "tv-reasoning"
551
619
  }, null, 8, ["model-value"])
552
- ])) : _("", !0),
553
- R.value ? (l(), o("blockquote", Ct, [
554
- T(" “" + y(R.value) + "” ", 1),
555
- V(i(J), {
556
- variant: (C = b.value) != null && C.cited_text_verified ? "success" : "muted",
620
+ ])) : b("", !0),
621
+ A.value ? (l(), o("blockquote", Ot, [
622
+ T(" “" + m(A.value) + "” ", 1),
623
+ D(r(J), {
624
+ variant: (C = h.value) != null && C.cited_text_verified ? "success" : "muted",
557
625
  size: "xxs",
558
626
  class: "tv-cited-verified ml-2 not-italic"
559
627
  }, {
560
628
  default: I(() => {
561
629
  var c;
562
630
  return [
563
- T(y((c = b.value) != null && c.cited_text_verified ? "✔ verified in source" : "unverified"), 1)
631
+ T(m((c = h.value) != null && c.cited_text_verified ? "✔ verified in source" : "unverified"), 1)
564
632
  ];
565
633
  }),
566
634
  _: 1
567
635
  }, 8, ["variant"])
568
- ])) : _("", !0),
569
- q.value.length ? (l(), o("div", Vt, [
570
- V(i(be), {
571
- file: q.value[0],
572
- "file-in-preview": p.value,
573
- "onUpdate:fileInPreview": u[1] || (u[1] = (c) => p.value = c),
574
- "related-files": q.value,
636
+ ])) : b("", !0),
637
+ F.value.length ? (l(), o("div", It, [
638
+ D(r(be), {
639
+ file: F.value[0],
640
+ "file-in-preview": Q.value,
641
+ "onUpdate:fileInPreview": u[1] || (u[1] = (c) => Q.value = c),
642
+ "related-files": F.value,
575
643
  "layout-toggles": ["sidebar", "continuous"],
576
644
  "default-sidebar": "",
577
645
  zoomable: "",
578
646
  "storage-key": "tv-evidence-viewer",
579
647
  class: "h-full min-h-0 flex-1"
580
648
  }, null, 8, ["file", "file-in-preview", "related-files"]),
581
- w.value ? (l(), o("div", Dt, y(w.value), 1)) : _("", !0)
582
- ])) : (l(), o("div", Ot, " No source pages recorded for this data point ")),
583
- D.value.length ? (l(), o("div", It, [
584
- u[10] || (u[10] = r("span", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, "Full documents:", -1)),
585
- (l(!0), o(L, null, M(D.value, (c) => (l(), N(i(se), {
649
+ f.value ? (l(), o("div", Tt, m(f.value), 1)) : b("", !0)
650
+ ])) : (l(), o("div", Ut, " No source pages recorded for this data point ")),
651
+ w.value.length ? (l(), o("div", Nt, [
652
+ u[10] || (u[10] = i("span", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, "Full documents:", -1)),
653
+ (l(!0), o(L, null, P(w.value, (c) => (l(), N(r(se), {
586
654
  key: String(c.id),
587
655
  size: "sm",
588
656
  variant: "info",
589
657
  class: "tv-open-document",
590
- onClick: (xa) => z.value = c
658
+ onClick: (xa) => V.value = c
591
659
  }, {
592
660
  default: I(() => [
593
- T(y(c.name), 1)
661
+ T(m(c.name), 1)
594
662
  ]),
595
663
  _: 2
596
664
  }, 1032, ["onClick"]))), 128))
597
- ])) : _("", !0)
598
- ])) : _("", !0),
599
- E.value === "candidates" ? (l(), o("section", Tt, [
600
- (l(!0), o(L, null, M(Q.value, (c) => (l(), o("div", {
665
+ ])) : b("", !0)
666
+ ])) : b("", !0),
667
+ j.value === "candidates" ? (l(), o("section", Rt, [
668
+ (l(!0), o(L, null, P(W.value, (c) => (l(), o("div", {
601
669
  key: c.key,
602
- class: A(["tv-candidate-row rounded-lg border p-4 transition-shadow", [
670
+ class: R(["tv-candidate-row rounded-lg border p-4 transition-shadow", [
603
671
  c.winner ? "border-gray-300 bg-gray-50 shadow-sm" : "border-gray-200",
604
672
  e.meta.discrepancy && !c.winner ? "tv-candidate-disagrees border-amber-200" : ""
605
673
  ]])
606
674
  }, [
607
- r("div", Ut, [
608
- r("div", Nt, [
609
- r("div", At, [
610
- V(i(J), {
675
+ i("div", At, [
676
+ i("div", Lt, [
677
+ i("div", jt, [
678
+ D(r(J), {
611
679
  variant: c.variant,
612
680
  size: "xs"
613
681
  }, {
614
682
  default: I(() => [
615
- T(y(c.title), 1)
683
+ T(m(c.title), 1)
616
684
  ]),
617
685
  _: 2
618
686
  }, 1032, ["variant"]),
619
- c.winner ? (l(), N(i(J), {
687
+ c.winner ? (l(), N(r(J), {
620
688
  key: 0,
621
689
  variant: "success",
622
690
  size: "xxs",
@@ -626,105 +694,105 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
626
694
  T("current value", -1)
627
695
  ])]),
628
696
  _: 1
629
- })) : _("", !0)
697
+ })) : b("", !0)
630
698
  ]),
631
- r("div", Rt, y(me(c.value)), 1),
632
- r("div", Lt, y(c.detail), 1)
699
+ i("div", Et, m(me(c.value)), 1),
700
+ i("div", zt, m(c.detail), 1)
633
701
  ]),
634
- c.accept && !c.winner ? (l(), N(i(se), {
702
+ c.accept && !c.winner ? (l(), N(r(se), {
635
703
  key: 0,
636
704
  size: "sm",
637
705
  variant: c.variant,
638
- loading: Y.value,
639
- class: A(`tv-accept-${c.key}`),
706
+ loading: E.value,
707
+ class: R(`tv-accept-${c.key}`),
640
708
  onClick: c.accept
641
709
  }, {
642
710
  default: I(() => [...u[12] || (u[12] = [
643
711
  T("Accept this value", -1)
644
712
  ])]),
645
713
  _: 1
646
- }, 8, ["variant", "loading", "class", "onClick"])) : _("", !0)
714
+ }, 8, ["variant", "loading", "class", "onClick"])) : b("", !0)
647
715
  ])
648
716
  ], 2))), 128)),
649
- e.save ? (l(), o("div", jt, [
650
- V(i(Ee), {
651
- modelValue: B.value,
652
- "onUpdate:modelValue": u[2] || (u[2] = (c) => B.value = c),
717
+ e.save ? (l(), o("div", Pt, [
718
+ D(r(ze), {
719
+ modelValue: q.value,
720
+ "onUpdate:modelValue": u[2] || (u[2] = (c) => q.value = c),
653
721
  size: "sm",
654
722
  class: "tv-custom-input flex-1",
655
723
  placeholder: "Type the correct value…",
656
- disabled: Y.value
724
+ disabled: E.value
657
725
  }, null, 8, ["modelValue", "disabled"]),
658
- V(i(se), {
726
+ D(r(se), {
659
727
  variant: "success",
660
728
  size: "sm",
661
729
  class: "tv-accept-custom",
662
- loading: Y.value,
663
- disabled: !B.value,
664
- onClick: Ie
730
+ loading: E.value,
731
+ disabled: !q.value,
732
+ onClick: Te
665
733
  }, {
666
734
  default: I(() => [...u[13] || (u[13] = [
667
735
  T("Save custom value", -1)
668
736
  ])]),
669
737
  _: 1
670
738
  }, 8, ["loading", "disabled"])
671
- ])) : (l(), o("div", Et, " Read-only render — corrections are disabled here "))
672
- ])) : _("", !0),
673
- E.value === "audit" ? (l(), o("section", zt, [
674
- Z.value ? (l(), o(L, { key: 0 }, M(2, (c) => V(i(ze), {
739
+ ])) : (l(), o("div", Mt, " Read-only render — corrections are disabled here "))
740
+ ])) : b("", !0),
741
+ j.value === "audit" ? (l(), o("section", Bt, [
742
+ Z.value ? (l(), o(L, { key: 0 }, P(2, (c) => D(r(Pe), {
675
743
  key: c,
676
744
  shape: "rounded",
677
745
  class: "tv-audit-skeleton h-24 w-full"
678
- })), 64)) : ee.value ? (l(), N(i(ye), {
746
+ })), 64)) : ee.value ? (l(), N(r(ye), {
679
747
  key: 1,
680
748
  variant: "danger",
681
749
  class: "tv-audit-error"
682
750
  }, {
683
751
  default: I(() => [
684
- T(" Could not load the audit trail: " + y(ee.value), 1)
752
+ T(" Could not load the audit trail: " + m(ee.value), 1)
685
753
  ]),
686
754
  _: 1
687
- })) : F.value && F.value.length === 0 ? (l(), o("div", Pt, " No LLM calls recorded for this data point ")) : F.value ? (l(!0), o(L, { key: 3 }, M(F.value, (c) => (l(), N(ft, {
755
+ })) : Y.value && Y.value.length === 0 ? (l(), o("div", Ft, " No LLM calls recorded for this data point ")) : Y.value ? (l(!0), o(L, { key: 3 }, P(Y.value, (c) => (l(), N(gt, {
688
756
  key: String(c.id),
689
757
  call: c
690
- }, null, 8, ["call"]))), 128)) : _("", !0)
691
- ])) : _("", !0)
758
+ }, null, 8, ["call"]))), 128)) : b("", !0)
759
+ ])) : b("", !0)
692
760
  ])
693
761
  ];
694
762
  }),
695
763
  _: 1
696
764
  }, 8, ["modelValue", "title", "class"]),
697
- z.value ? (l(), N(i(re), {
765
+ V.value ? (l(), N(r(re), {
698
766
  key: 0,
699
- modelValue: G.value,
700
- "onUpdate:modelValue": u[4] || (u[4] = (C) => G.value = C),
701
- title: z.value.name,
767
+ modelValue: K.value,
768
+ "onUpdate:modelValue": u[4] || (u[4] = (C) => K.value = C),
769
+ title: V.value.name,
702
770
  width: 90,
703
771
  height: 90,
704
772
  "close-x": "",
705
- class: A(i(P))
773
+ class: R(r(z))
706
774
  }, {
707
775
  default: I(() => [
708
- V(i(be), {
709
- file: z.value,
776
+ D(r(be), {
777
+ file: V.value,
710
778
  downloadable: "",
711
779
  zoomable: "",
712
780
  class: "tv-document-viewer h-full"
713
781
  }, null, 8, ["file"])
714
782
  ]),
715
783
  _: 1
716
- }, 8, ["modelValue", "title", "class"])) : _("", !0)
784
+ }, 8, ["modelValue", "title", "class"])) : b("", !0)
717
785
  ], 64));
718
786
  }
719
- }), Bt = { class: "tv-field inline-flex items-baseline gap-1" }, Ft = ["contenteditable", "data-editable"], qt = {
787
+ }), Yt = ["contenteditable", "data-editable"], Jt = {
720
788
  key: 1,
721
789
  class: "tv-verified-chip inline-flex items-center gap-1 rounded-full bg-green-600 px-2 py-0.5 text-[11px] font-semibold leading-none text-white",
722
790
  "data-status": "verified"
723
- }, Yt = {
791
+ }, Kt = {
724
792
  key: 2,
725
793
  class: "tv-discrepancy-indicator ml-0.5 text-amber-500",
726
794
  "aria-label": "discrepancy"
727
- }, _a = /* @__PURE__ */ K({
795
+ }, _a = /* @__PURE__ */ H({
728
796
  __name: "VerifiedField",
729
797
  props: {
730
798
  source: {},
@@ -733,158 +801,109 @@ const it = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
733
801
  format: { type: Function }
734
802
  },
735
803
  setup(e) {
736
- const t = e, a = le(), g = d(() => a.enabled.value), m = U(null), s = d(() => {
737
- var p;
738
- return m.value ? m.value : t.source && t.field ? ((p = t.source.__meta) == null ? void 0 : p[t.field]) ?? null : null;
739
- }), f = d(() => fe(s.value)), n = d(() => {
804
+ const t = e, a = le(), g = d(() => a.enabled.value), p = U(null), n = d(() => {
805
+ var f;
806
+ return p.value ? p.value : t.source && t.field ? ((f = t.source.__meta) == null ? void 0 : f[t.field]) ?? null : null;
807
+ }), y = d(() => fe(n.value)), s = d(() => {
740
808
  if (t.original !== void 0 && t.original !== null)
741
809
  return t.original;
742
- if (s.value && f.value.value !== null && f.value.value !== void 0)
743
- return f.value.value;
810
+ if (n.value && y.value.value !== null && y.value.value !== void 0)
811
+ return y.value.value;
744
812
  if (t.source && t.field) return t.source[t.field];
745
- }), b = d(() => {
746
- const p = n.value;
747
- return p == null ? "" : typeof t.format == "function" ? t.format(p) : String(p);
813
+ }), h = d(() => {
814
+ const f = s.value;
815
+ return f == null ? "" : typeof t.format == "function" ? t.format(f) : String(f);
748
816
  }), $ = d(
749
817
  () => {
750
- var p, w, D;
751
- return ve((D = (w = (p = s.value) == null ? void 0 : p.candidates) == null ? void 0 : w.extracted) == null ? void 0 : D.confidence);
818
+ var f, w, V;
819
+ return ve((V = (w = (f = n.value) == null ? void 0 : f.candidates) == null ? void 0 : w.extracted) == null ? void 0 : V.confidence);
752
820
  }
753
- ), h = d(() => Ve(s.value)), x = d(() => {
754
- var p, w;
755
- return !!((w = (p = s.value) == null ? void 0 : p.candidates) != null && w.override);
821
+ ), _ = d(() => Ve(n.value)), x = d(() => {
822
+ var f, w;
823
+ return !!((w = (f = n.value) == null ? void 0 : f.candidates) != null && w.override);
756
824
  }), k = d(() => {
757
825
  var w;
758
- const p = (w = s.value) == null ? void 0 : w.candidates;
759
- return !!(p != null && p.override || p != null && p.extracted || p != null && p.claim);
760
- }), S = d(() => g.value && !!s.value), R = d(() => {
761
- var G, Q, B;
762
- const p = (Q = (G = s.value) == null ? void 0 : G.candidates) == null ? void 0 : Q.extracted;
763
- if (!p) return "No verification data";
764
- const w = [], D = ae[$.value];
826
+ const f = (w = n.value) == null ? void 0 : w.candidates;
827
+ return !!(f != null && f.override || f != null && f.extracted || f != null && f.claim);
828
+ }), S = d(() => g.value && !!n.value), A = d(
829
+ () => S.value && !!n.value && Oe(n.value)
830
+ ), O = d(() => {
831
+ var W, q, E;
832
+ const f = (q = (W = n.value) == null ? void 0 : W.candidates) == null ? void 0 : q.extracted;
833
+ if (!f) return "No verification data";
834
+ const w = [], V = ae[$.value];
765
835
  w.push(
766
- p.confidence != null ? `${D} (${p.confidence}/5)` : D
836
+ f.confidence != null ? `${V} (${f.confidence}/5)` : V
767
837
  );
768
- const z = ((B = p.sources) == null ? void 0 : B.length) ?? 0;
769
- return z > 0 && w.push(`${z} source ${z === 1 ? "page" : "pages"}`), h.value && w.push("sources disagree"), w.join(" · ");
838
+ const K = ((E = f.sources) == null ? void 0 : E.length) ?? 0;
839
+ return K > 0 && w.push(`${K} source ${K === 1 ? "page" : "pages"}`), _.value && w.push("sources disagree"), w.join(" · ");
770
840
  });
771
- function O(p) {
841
+ function M(f) {
772
842
  var w;
773
- m.value = p, (w = t.source) != null && w.__meta && t.field && (t.source.__meta[t.field] = p);
843
+ p.value = f, (w = t.source) != null && w.__meta && t.field && (t.source.__meta[t.field] = f);
774
844
  }
775
- const j = d(() => Ze(a, s, O)), H = d(() => !!j.value), E = U(!1), W = U(!1);
776
- function X() {
777
- s.value && (E.value = !0);
845
+ const B = d(() => at(a, n, M)), j = d(() => !!B.value), G = U(!1), X = U(!1);
846
+ function F() {
847
+ n.value && (G.value = !0);
778
848
  }
779
- async function q(p) {
780
- W.value = !1;
781
- const D = (p.target.textContent ?? "").trim();
782
- !j.value || D === b.value || await j.value(D, "custom");
849
+ async function Q(f) {
850
+ X.value = !1;
851
+ const V = (f.target.textContent ?? "").trim();
852
+ !B.value || V === h.value || await B.value(V, "custom");
783
853
  }
784
- return (p, w) => (l(), o("span", Bt, [
785
- r("span", {
786
- class: A([
854
+ return (f, w) => (l(), o("span", {
855
+ class: R(["tv-field inline-flex items-baseline gap-1", A.value ? "tv-needs-review" : ""])
856
+ }, [
857
+ i("span", {
858
+ class: R([
787
859
  "tv-field-value",
788
860
  S.value && !k.value ? "tv-field-unverified cursor-pointer border-b border-dotted border-gray-300" : ""
789
861
  ]),
790
- contenteditable: H.value,
791
- "data-editable": H.value ? "true" : "false",
792
- onFocus: w[0] || (w[0] = (D) => W.value = !0),
793
- onBlur: q,
794
- onKeydown: w[1] || (w[1] = Te(Ue((D) => D.target.blur(), ["prevent"]), ["enter"])),
795
- onClick: w[2] || (w[2] = (D) => S.value && !k.value ? X() : void 0)
862
+ contenteditable: j.value,
863
+ "data-editable": j.value ? "true" : "false",
864
+ onFocus: w[0] || (w[0] = (V) => X.value = !0),
865
+ onBlur: Q,
866
+ onKeydown: w[1] || (w[1] = Ue(Ne((V) => V.target.blur(), ["prevent"]), ["enter"])),
867
+ onClick: w[2] || (w[2] = (V) => S.value && !k.value ? F() : void 0)
796
868
  }, [
797
- Ne(p.$slots, "default", {
798
- value: n.value,
799
- formatted: b.value
869
+ Re(f.$slots, "default", {
870
+ value: s.value,
871
+ formatted: h.value
800
872
  }, () => [
801
- T(y(b.value), 1)
873
+ T(m(h.value), 1)
802
874
  ])
803
- ], 42, Ft),
804
- S.value && k.value ? (l(), N(i(Pe), {
875
+ ], 42, Yt),
876
+ S.value && k.value ? (l(), N(r(Me), {
805
877
  key: 0,
806
- tooltip: R.value,
878
+ tooltip: O.value,
807
879
  placement: "top"
808
880
  }, {
809
881
  trigger: I(() => [
810
- r("button", {
882
+ i("button", {
811
883
  type: "button",
812
- class: A(["tv-overlay inline-flex cursor-pointer items-center align-middle transition-transform duration-150 hover:scale-110", i(P)]),
813
- onClick: X
884
+ class: R(["tv-overlay inline-flex cursor-pointer items-center align-middle transition-transform duration-150 hover:scale-110", r(z)]),
885
+ onClick: F
814
886
  }, [
815
- x.value ? (l(), o("span", qt, "✔")) : (l(), N(ue, {
887
+ x.value ? (l(), o("span", Jt, "✔")) : (l(), N(de, {
816
888
  key: 0,
817
889
  status: $.value
818
890
  }, null, 8, ["status"])),
819
- h.value && !x.value ? (l(), o("span", Yt, "⚠")) : _("", !0)
891
+ _.value && !x.value ? (l(), o("span", Kt, "⚠")) : b("", !0)
820
892
  ], 2)
821
893
  ]),
822
894
  _: 1
823
- }, 8, ["tooltip"])) : _("", !0),
824
- s.value ? (l(), N(Mt, {
895
+ }, 8, ["tooltip"])) : b("", !0),
896
+ n.value ? (l(), N(qt, {
825
897
  key: 1,
826
- modelValue: E.value,
827
- "onUpdate:modelValue": w[3] || (w[3] = (D) => E.value = D),
828
- meta: s.value,
898
+ modelValue: G.value,
899
+ "onUpdate:modelValue": w[3] || (w[3] = (V) => G.value = V),
900
+ meta: n.value,
829
901
  label: e.field,
830
- save: j.value
831
- }, null, 8, ["modelValue", "meta", "label", "save"])) : _("", !0)
832
- ]));
902
+ save: B.value
903
+ }, null, 8, ["modelValue", "meta", "label", "save"])) : b("", !0)
904
+ ], 2));
833
905
  }
834
- }), Jt = /* @__PURE__ */ new Set(["name", "type"]);
835
- function Oe(e, t = "") {
836
- const a = [];
837
- return de(e, t, a), a;
838
- }
839
- function de(e, t, a) {
840
- if (Array.isArray(e)) {
841
- e.forEach((s, f) => de(s, `${t}[${f}]`, a));
842
- return;
843
- }
844
- if (!he(e)) return;
845
- const m = e.__meta ?? {};
846
- for (const [s, f] of Object.entries(e)) {
847
- if (s === "__meta") continue;
848
- const n = t ? `${t}.${s}` : s;
849
- if (Array.isArray(f) || he(f)) {
850
- de(f, n, a);
851
- continue;
852
- }
853
- const b = m[s];
854
- !b && Jt.has(s) || a.push({
855
- path: n,
856
- label: s,
857
- meta: b ?? null,
858
- value: f,
859
- unanchored: !b
860
- });
861
- }
862
- }
863
- function he(e) {
864
- return typeof e == "object" && e !== null && !Array.isArray(e);
865
- }
866
- function Kt(e) {
867
- var s;
868
- const t = Oe(e).filter(
869
- (f) => f.meta !== null
870
- ), a = t.length;
871
- let g = 0, m = 0;
872
- for (const f of t) {
873
- if (f.meta.candidates.override) {
874
- g++;
875
- continue;
876
- }
877
- const n = (s = f.meta.candidates.extracted) == null ? void 0 : s.confidence;
878
- (f.meta.discrepancy || n == null || n <= 2) && m++;
879
- }
880
- return {
881
- total: a,
882
- verified: g,
883
- needsReview: m,
884
- percent: a === 0 ? 100 : Math.round(g / a * 100)
885
- };
886
- }
887
- const Ht = { class: "tv-comparison-page flex flex-col gap-4" }, Gt = {
906
+ }), Ht = { class: "tv-comparison-page flex flex-col gap-4" }, Gt = {
888
907
  key: 0,
889
908
  class: "tv-comparison-empty text-gray-400"
890
909
  }, Qt = {
@@ -902,61 +921,61 @@ const Ht = { class: "tv-comparison-page flex flex-col gap-4" }, Gt = {
902
921
  }, sa = { class: "tv-datapoint-sources ml-4 text-xs text-gray-500" }, ra = ["href"], ia = { key: 1 }, oa = { class: "ml-1" }, ua = {
903
922
  key: 2,
904
923
  class: "tv-unanchored-group flex flex-col gap-1"
905
- }, da = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, ca = { class: "tv-datapoint-value" }, va = /* @__PURE__ */ K({
924
+ }, da = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, ca = { class: "tv-datapoint-value" }, va = /* @__PURE__ */ H({
906
925
  __name: "ComparisonPage",
907
926
  setup(e) {
908
- const t = le(), a = d(() => Oe(t.data)), g = d(() => a.value.filter(($) => !$.unanchored)), m = d(() => a.value.filter(($) => $.unanchored));
909
- function s($) {
910
- const h = fe($).value;
911
- return h == null ? "" : String(h);
927
+ const t = le(), a = d(() => De(t.data)), g = d(() => a.value.filter(($) => !$.unanchored)), p = d(() => a.value.filter(($) => $.unanchored));
928
+ function n($) {
929
+ const _ = fe($).value;
930
+ return _ == null ? "" : String(_);
912
931
  }
913
- function f($) {
932
+ function y($) {
914
933
  return $ == null ? "" : String($);
915
934
  }
916
- function n($) {
917
- var h, x, k;
918
- return (k = (x = (h = $.meta) == null ? void 0 : h.candidates) == null ? void 0 : x.extracted) == null ? void 0 : k.confidence;
935
+ function s($) {
936
+ var _, x, k;
937
+ return (k = (x = (_ = $.meta) == null ? void 0 : _.candidates) == null ? void 0 : x.extracted) == null ? void 0 : k.confidence;
919
938
  }
920
- function b($) {
939
+ function h($) {
921
940
  var k;
922
- const h = (k = $.meta) == null ? void 0 : k.candidates;
923
- if (!h) return [];
941
+ const _ = (k = $.meta) == null ? void 0 : k.candidates;
942
+ if (!_) return [];
924
943
  const x = [];
925
- return h.override && x.push({ source: "override", value: h.override.value }), h.extracted && x.push({ source: "extracted", value: h.extracted.value }), h.claim && x.push({ source: "claim", value: h.claim.value }), x;
944
+ return _.override && x.push({ source: "override", value: _.override.value }), _.extracted && x.push({ source: "extracted", value: _.extracted.value }), _.claim && x.push({ source: "claim", value: _.claim.value }), x;
926
945
  }
927
- return ($, h) => (l(), o("div", Ht, [
928
- h[1] || (h[1] = r("h2", { class: "tv-comparison-title text-lg font-semibold" }, "Verification comparison", -1)),
929
- a.value.length === 0 ? (l(), o("p", Gt, " No data points to compare. ")) : _("", !0),
946
+ return ($, _) => (l(), o("div", Ht, [
947
+ _[1] || (_[1] = i("h2", { class: "tv-comparison-title text-lg font-semibold" }, "Verification comparison", -1)),
948
+ a.value.length === 0 ? (l(), o("p", Gt, " No data points to compare. ")) : b("", !0),
930
949
  g.value.length ? (l(), o("section", Qt, [
931
- (l(!0), o(L, null, M(g.value, (x) => {
932
- var k, S, R;
950
+ (l(!0), o(L, null, P(g.value, (x) => {
951
+ var k, S, A;
933
952
  return l(), o("div", {
934
953
  key: x.path,
935
954
  class: "tv-datapoint border-t border-gray-100 pt-2"
936
955
  }, [
937
- r("div", Wt, [
938
- r("span", Xt, y(x.path), 1),
939
- r("span", Zt, y(s(x.meta)), 1),
940
- V(ue, {
941
- confidence: n(x),
956
+ i("div", Wt, [
957
+ i("span", Xt, m(x.path), 1),
958
+ i("span", Zt, m(n(x.meta)), 1),
959
+ D(de, {
960
+ confidence: s(x),
942
961
  "show-label": ""
943
962
  }, null, 8, ["confidence"]),
944
- i(Ve)(x.meta) ? (l(), o("span", ea, "⚠ discrepancy")) : _("", !0)
963
+ r(Ve)(x.meta) ? (l(), o("span", ea, "⚠ discrepancy")) : b("", !0)
945
964
  ]),
946
- r("ul", ta, [
947
- (l(!0), o(L, null, M(b(x), (O) => (l(), o("li", {
965
+ i("ul", ta, [
966
+ (l(!0), o(L, null, P(h(x), (O) => (l(), o("li", {
948
967
  key: O.source,
949
968
  class: "tv-candidate"
950
969
  }, [
951
- r("span", aa, y(O.source) + ":", 1),
952
- T(" " + y(f(O.value)), 1)
970
+ i("span", aa, m(O.source) + ":", 1),
971
+ T(" " + m(y(O.value)), 1)
953
972
  ]))), 128))
954
973
  ]),
955
- i(ie)(x.meta) ? (l(), o("p", la, y(i(ie)(x.meta)), 1)) : _("", !0),
956
- i(oe)(x.meta) ? (l(), o("p", na, " “" + y(i(oe)(x.meta)) + "” ", 1)) : _("", !0),
957
- r("ul", sa, [
958
- (l(!0), o(L, null, M(i(De)((R = (S = (k = x.meta) == null ? void 0 : k.candidates) == null ? void 0 : S.extracted) == null ? void 0 : R.sources), (O, j) => (l(), o("li", {
959
- key: j,
974
+ r(ie)(x.meta) ? (l(), o("p", la, m(r(ie)(x.meta)), 1)) : b("", !0),
975
+ r(oe)(x.meta) ? (l(), o("p", na, " “" + m(r(oe)(x.meta)) + "” ", 1)) : b("", !0),
976
+ i("ul", sa, [
977
+ (l(!0), o(L, null, P(r(Ie)((A = (S = (k = x.meta) == null ? void 0 : k.candidates) == null ? void 0 : S.extracted) == null ? void 0 : A.sources), (O, M) => (l(), o("li", {
978
+ key: M,
960
979
  class: "tv-source-group"
961
980
  }, [
962
981
  O.fileUrl ? (l(), o("a", {
@@ -965,41 +984,39 @@ const Ht = { class: "tv-comparison-page flex flex-col gap-4" }, Gt = {
965
984
  class: "tv-source-link text-blue-600 underline",
966
985
  target: "_blank",
967
986
  rel: "noopener"
968
- }, y(O.fileLabel), 9, ra)) : (l(), o("span", ia, y(O.fileLabel), 1)),
969
- r("span", oa, "(" + y(O.sources.map(i(rt)).join(", ")) + ")", 1)
987
+ }, m(O.fileLabel), 9, ra)) : (l(), o("span", ia, m(O.fileLabel), 1)),
988
+ i("span", oa, "(" + m(O.sources.map(r(ut)).join(", ")) + ")", 1)
970
989
  ]))), 128))
971
990
  ])
972
991
  ]);
973
992
  }), 128))
974
- ])) : _("", !0),
975
- m.value.length ? (l(), o("section", ua, [
976
- h[0] || (h[0] = r("h3", { class: "tv-unanchored-title text-sm font-semibold text-gray-500" }, " Unanchored / not from source ", -1)),
977
- (l(!0), o(L, null, M(m.value, (x) => (l(), o("div", {
993
+ ])) : b("", !0),
994
+ p.value.length ? (l(), o("section", ua, [
995
+ _[0] || (_[0] = i("h3", { class: "tv-unanchored-title text-sm font-semibold text-gray-500" }, " Unanchored / not from source ", -1)),
996
+ (l(!0), o(L, null, P(p.value, (x) => (l(), o("div", {
978
997
  key: x.path,
979
998
  class: "tv-unanchored-datapoint flex items-center gap-2 text-sm"
980
999
  }, [
981
- r("span", da, y(x.path), 1),
982
- r("span", ca, y(f(x.value)), 1),
983
- V(ue, { status: "unverifiable" })
1000
+ i("span", da, m(x.path), 1),
1001
+ i("span", ca, m(y(x.value)), 1),
1002
+ D(de, { status: "unverifiable" })
984
1003
  ]))), 128))
985
- ])) : _("", !0)
1004
+ ])) : b("", !0)
986
1005
  ]));
987
1006
  }
988
- }), fa = { class: "tv-enable-toggle flex items-center justify-between text-sm font-medium text-gray-700" }, pa = { class: "tv-progress-block" }, ma = { class: "mb-1 flex items-baseline justify-between" }, ga = { class: "tv-progress-count text-xs font-semibold text-gray-600" }, wa = /* @__PURE__ */ K({
1007
+ }), fa = { class: "tv-enable-toggle flex items-center justify-between text-sm font-medium text-gray-700" }, pa = { class: "tv-progress-block" }, ma = { class: "mb-1 flex items-baseline justify-between" }, ga = { class: "tv-progress-count text-xs font-semibold text-gray-600" }, wa = /* @__PURE__ */ H({
989
1008
  __name: "VerificationChrome",
990
1009
  setup(e) {
991
- const t = le(), { enabled: a, openComparison: g } = t, m = He(), s = _e(), f = U(!1), n = d(() => Kt(t.data)), b = U(!1);
1010
+ const t = le(), { enabled: a, openComparison: g } = t, p = Ge(), n = _e(), y = U(!1), s = d(() => tt(t.data)), h = U(!1);
992
1011
  ce(
993
- () => n.value.percent,
1012
+ () => s.value.percent,
994
1013
  (k) => {
995
- k === 100 && n.value.total > 0 && !b.value && (b.value = !0, s.success("All data points verified 🎯"));
1014
+ k === 100 && s.value.total > 0 && !h.value && (h.value = !0, n.success("All data points verified 🎯"));
996
1015
  }
997
1016
  );
998
1017
  let $ = 0;
999
- function h() {
1000
- const k = document.querySelectorAll(
1001
- ".tv-discrepancy-indicator, .tv-confidence-icon[data-status='low'], .tv-confidence-icon[data-status='unverifiable']"
1002
- );
1018
+ function _() {
1019
+ const k = document.querySelectorAll(".tv-needs-review");
1003
1020
  if (!k.length) return;
1004
1021
  $ = $ % k.length;
1005
1022
  const S = k[$];
@@ -1012,115 +1029,115 @@ const Ht = { class: "tv-comparison-page flex flex-col gap-4" }, Gt = {
1012
1029
  );
1013
1030
  }
1014
1031
  function x() {
1015
- g(), f.value = !1;
1032
+ g(), y.value = !1;
1016
1033
  }
1017
1034
  return (k, S) => (l(), o(L, null, [
1018
- r("button", {
1035
+ i("button", {
1019
1036
  type: "button",
1020
- class: A(["tv-settings-button fixed bottom-4 right-4 z-50 flex h-11 w-11 items-center justify-center rounded-full bg-gray-900 text-white shadow-lg transition-transform hover:scale-105", i(P)]),
1037
+ class: R(["tv-settings-button fixed bottom-4 right-4 z-50 flex h-11 w-11 items-center justify-center rounded-full bg-gray-900 text-white shadow-lg transition-transform hover:scale-105", r(z)]),
1021
1038
  title: "Verification",
1022
- onClick: S[0] || (S[0] = (R) => f.value = !f.value)
1039
+ onClick: S[0] || (S[0] = (A) => y.value = !y.value)
1023
1040
  }, [
1024
- V(i(Me), {
1025
- icon: i(Be),
1041
+ D(r(Be), {
1042
+ icon: r(Fe),
1026
1043
  class: "h-5 w-5"
1027
1044
  }, null, 8, ["icon"]),
1028
- i(a) && n.value.needsReview > 0 ? (l(), N(i(Fe), {
1045
+ r(a) && s.value.needsReview > 0 ? (l(), N(r(qe), {
1029
1046
  key: 0,
1030
- value: n.value.needsReview,
1047
+ value: s.value.needsReview,
1031
1048
  variant: "warning",
1032
1049
  class: "tv-needs-review-badge absolute -right-1 -top-1"
1033
- }, null, 8, ["value"])) : _("", !0)
1050
+ }, null, 8, ["value"])) : b("", !0)
1034
1051
  ], 2),
1035
- f.value ? (l(), o("div", {
1052
+ y.value ? (l(), o("div", {
1036
1053
  key: 0,
1037
- class: A(["tv-settings-panel fixed bottom-20 right-4 z-50 flex w-72 flex-col gap-4 rounded-xl bg-white p-4 shadow-2xl ring-1 ring-gray-200", i(P)])
1054
+ class: R(["tv-settings-panel fixed bottom-20 right-4 z-50 flex w-72 flex-col gap-4 rounded-xl bg-white p-4 shadow-2xl ring-1 ring-gray-200", r(z)])
1038
1055
  }, [
1039
- r("label", fa, [
1040
- S[3] || (S[3] = r("span", null, "Verification overlay", -1)),
1041
- Ae(r("input", {
1042
- "onUpdate:modelValue": S[1] || (S[1] = (R) => ge(a) ? a.value = R : null),
1056
+ i("label", fa, [
1057
+ S[3] || (S[3] = i("span", null, "Verification overlay", -1)),
1058
+ Ae(i("input", {
1059
+ "onUpdate:modelValue": S[1] || (S[1] = (A) => ge(a) ? a.value = A : null),
1043
1060
  type: "checkbox",
1044
1061
  class: "tv-enable-checkbox h-4 w-4 accent-gray-900"
1045
1062
  }, null, 512), [
1046
- [Re, i(a)]
1063
+ [Le, r(a)]
1047
1064
  ])
1048
1065
  ]),
1049
- i(a) && n.value.total > 0 ? (l(), o(L, { key: 0 }, [
1050
- r("div", pa, [
1051
- r("div", ma, [
1052
- S[4] || (S[4] = r("span", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, "Review progress", -1)),
1053
- r("span", ga, y(n.value.verified) + " / " + y(n.value.total), 1)
1066
+ r(a) && s.value.total > 0 ? (l(), o(L, { key: 0 }, [
1067
+ i("div", pa, [
1068
+ i("div", ma, [
1069
+ S[4] || (S[4] = i("span", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, "Review progress", -1)),
1070
+ i("span", ga, m(s.value.verified) + " / " + m(s.value.total), 1)
1054
1071
  ]),
1055
- V(i(we), {
1056
- value: n.value.verified,
1057
- max: n.value.total,
1072
+ D(r(we), {
1073
+ value: s.value.verified,
1074
+ max: s.value.total,
1058
1075
  size: "md",
1059
- variant: n.value.percent === 100 ? "success" : "info",
1060
- striped: n.value.percent < 100,
1061
- "animate-stripes": n.value.percent < 100,
1062
- glow: n.value.percent === 100,
1076
+ variant: s.value.percent === 100 ? "success" : "info",
1077
+ striped: s.value.percent < 100,
1078
+ "animate-stripes": s.value.percent < 100,
1079
+ glow: s.value.percent === 100,
1063
1080
  gradient: ""
1064
1081
  }, null, 8, ["value", "max", "variant", "striped", "animate-stripes", "glow"])
1065
1082
  ]),
1066
- n.value.needsReview > 0 ? (l(), o("button", {
1083
+ s.value.needsReview > 0 ? (l(), o("button", {
1067
1084
  key: 0,
1068
1085
  type: "button",
1069
- class: A(["tv-next-flagged flex items-center justify-between rounded-lg bg-amber-50 px-3 py-2 text-left text-xs font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20 transition hover:bg-amber-100", i(P)]),
1070
- onClick: h
1086
+ class: R(["tv-next-flagged flex items-center justify-between rounded-lg bg-amber-50 px-3 py-2 text-left text-xs font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20 transition hover:bg-amber-100", r(z)]),
1087
+ onClick: _
1071
1088
  }, [
1072
- r("span", null, y(n.value.needsReview) + " need" + y(n.value.needsReview === 1 ? "s" : "") + " review", 1),
1073
- S[5] || (S[5] = r("span", { "aria-hidden": "true" }, "→", -1))
1074
- ], 2)) : _("", !0)
1075
- ], 64)) : _("", !0),
1076
- r("button", {
1089
+ i("span", null, m(s.value.needsReview) + " need" + m(s.value.needsReview === 1 ? "s" : "") + " review", 1),
1090
+ S[5] || (S[5] = i("span", { "aria-hidden": "true" }, "→", -1))
1091
+ ], 2)) : b("", !0)
1092
+ ], 64)) : b("", !0),
1093
+ i("button", {
1077
1094
  type: "button",
1078
- class: A(["tv-open-comparison rounded-lg border border-gray-200 px-3 py-2 text-sm font-medium text-gray-600 transition hover:bg-gray-50", i(P)]),
1095
+ class: R(["tv-open-comparison rounded-lg border border-gray-200 px-3 py-2 text-sm font-medium text-gray-600 transition hover:bg-gray-50", r(z)]),
1079
1096
  onClick: x
1080
1097
  }, " Open comparison page ", 2)
1081
- ], 2)) : _("", !0),
1082
- V(i(re), {
1083
- modelValue: i(m),
1084
- "onUpdate:modelValue": S[2] || (S[2] = (R) => ge(m) ? m.value = R : null),
1098
+ ], 2)) : b("", !0),
1099
+ D(r(re), {
1100
+ modelValue: r(p),
1101
+ "onUpdate:modelValue": S[2] || (S[2] = (A) => ge(p) ? p.value = A : null),
1085
1102
  title: "Verification comparison",
1086
1103
  width: 80,
1087
1104
  "close-x": "",
1088
- class: A(i(P))
1105
+ class: R(r(z))
1089
1106
  }, {
1090
1107
  default: I(() => [
1091
- V(va)
1108
+ D(va)
1092
1109
  ]),
1093
1110
  _: 1
1094
1111
  }, 8, ["modelValue", "class"]),
1095
- V(i(qe), {
1096
- class: A(i(P))
1112
+ D(r(Ye), {
1113
+ class: R(r(z))
1097
1114
  }, null, 8, ["class"])
1098
1115
  ], 64));
1099
1116
  }
1100
1117
  });
1101
1118
  export {
1102
- P as CHROME_CLASS,
1119
+ z as CHROME_CLASS,
1103
1120
  va as ComparisonPage,
1104
- ue as ConfidenceIcon,
1121
+ de as ConfidenceIcon,
1105
1122
  ke as ENABLED_STORAGE_KEY,
1106
1123
  Ce as RESOLUTION_PRIORITY,
1107
- Ge as STATUS_COLORS,
1124
+ Qe as STATUS_COLORS,
1108
1125
  ae as STATUS_LABELS,
1109
1126
  wa as VerificationChrome,
1110
- Mt as VerificationModal,
1127
+ qt as VerificationModal,
1111
1128
  _a as VerifiedField,
1112
1129
  ve as bucketConfidence,
1113
- We as candidatesDisagree,
1130
+ Xe as candidatesDisagree,
1114
1131
  oe as citedTextOf,
1115
- Kt as computeProgress,
1116
- lt as fetchDataPointAudit,
1117
- De as groupSources,
1132
+ tt as computeProgress,
1133
+ rt as fetchDataPointAudit,
1134
+ Ie as groupSources,
1118
1135
  Ve as hasDiscrepancy,
1119
1136
  ha as initVerification,
1120
1137
  ie as reasoningOf,
1121
- Qe as resolveCandidates,
1138
+ We as resolveCandidates,
1122
1139
  fe as resolveDataPoint,
1123
- rt as sourceRowLabel,
1140
+ ut as sourceRowLabel,
1124
1141
  le as useVerification,
1125
- Oe as walkDataPoints
1142
+ De as walkDataPoints
1126
1143
  };