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