@thehammer/template-verification 0.2.6 → 0.2.8
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/dist/components/CitationEvidence.vue.d.ts +33 -0
- package/dist/components/CitationPage.vue.d.ts +27 -0
- package/dist/components/CitationPageList.vue.d.ts +26 -0
- package/dist/components/TvDisclosure.vue.d.ts +61 -0
- package/dist/components/VerificationModal.vue.d.ts +10 -6
- package/dist/index.d.ts +6 -3
- package/dist/lib/citations.d.ts +84 -0
- package/dist/lib/resolveDataPoint.d.ts +0 -5
- package/dist/style.css +1 -1
- package/dist/template-verification.js +1374 -798
- package/dist/types.d.ts +47 -4
- package/package.json +4 -2
- package/dist/lib/sources.d.ts +0 -28
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { DanxChip as
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
function
|
|
1
|
+
import { ref as j, watch as ae, defineComponent as Q, computed as g, openBlock as a, createElementBlock as s, normalizeClass as A, createElementVNode as o, toDisplayString as i, createCommentVNode as p, createBlock as E, unref as u, withCtx as O, createTextVNode as I, createVNode as D, Fragment as U, renderList as F, renderSlot as me, onBeforeUnmount as Qe, withKeys as We, withModifiers as ve, withDirectives as Xe, isRef as Ie, vModelCheckbox as Ze } from "vue";
|
|
2
|
+
import { DanxChip as K, CodeViewer as De, DanxFile as et, DanxButton as ie, DanxDialog as be, DanxFileViewer as tt, DanxAlert as ge, DanxTooltip as we, useToast as Ae, DanxProgressBar as ze, DanxTabs as at, DanxInput as nt, DanxSkeleton as je, DanxIcon as lt, gearIcon as st, DanxBadge as ot, DanxToastContainer as it } from "@thehammer/danx-ui";
|
|
3
|
+
const W = "tv-chrome", Re = "template-verification:enabled";
|
|
4
|
+
let fe = null;
|
|
5
|
+
function rt(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 Qe(e) {
|
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
var
|
|
13
|
+
function ut(e, t) {
|
|
14
|
+
var n;
|
|
15
15
|
try {
|
|
16
|
-
(
|
|
16
|
+
(n = globalThis.localStorage) == null || n.setItem(e, t);
|
|
17
17
|
} catch {
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const t =
|
|
20
|
+
function dt(e) {
|
|
21
|
+
const t = rt(Re);
|
|
22
22
|
return t === null ? e : t === "true";
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const t =
|
|
26
|
-
return
|
|
24
|
+
function Ue(e) {
|
|
25
|
+
const t = j(dt((e == null ? void 0 : e.defaultEnabled) ?? !1));
|
|
26
|
+
return ae(
|
|
27
27
|
t,
|
|
28
|
-
(
|
|
28
|
+
(n) => ut(Re, n ? "true" : "false")
|
|
29
29
|
), {
|
|
30
30
|
enabled: t,
|
|
31
31
|
data: (e == null ? void 0 : e.data) ?? {},
|
|
@@ -33,17 +33,17 @@ function Te(e) {
|
|
|
33
33
|
workflowInputId: e == null ? void 0 : e.workflowInputId,
|
|
34
34
|
auditUrl: e == null ? void 0 : e.auditUrl,
|
|
35
35
|
loading: (e == null ? void 0 : e.loading) ?? !1,
|
|
36
|
-
comparisonOpen:
|
|
36
|
+
comparisonOpen: j(!1)
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
return
|
|
39
|
+
function Be() {
|
|
40
|
+
return fe || (fe = Ue()), fe;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
42
|
+
function Un(e) {
|
|
43
|
+
fe = Ue(e);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
const e =
|
|
45
|
+
function pe() {
|
|
46
|
+
const e = Be();
|
|
47
47
|
return {
|
|
48
48
|
enabled: e.enabled,
|
|
49
49
|
data: e.data,
|
|
@@ -56,141 +56,138 @@ function oe() {
|
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
59
|
+
function ct() {
|
|
60
|
+
return Be().comparisonOpen;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function _e(e) {
|
|
63
63
|
return typeof e != "number" || Number.isNaN(e) ? "unverifiable" : e <= 2 ? "low" : e === 3 ? "medium" : "high";
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const vt = {
|
|
66
66
|
high: "bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20",
|
|
67
67
|
medium: "bg-yellow-50 text-yellow-700 ring-1 ring-inset ring-yellow-600/20",
|
|
68
68
|
low: "bg-red-50 text-red-700 ring-1 ring-inset ring-red-600/20",
|
|
69
|
-
unverifiable: "bg-gray-50 text-gray-500 ring-1 ring-inset ring-gray-400/20"
|
|
70
|
-
|
|
69
|
+
unverifiable: "bg-gray-50 text-gray-500 ring-1 ring-inset ring-gray-400/20",
|
|
70
|
+
// Same red family as 'low' (color-family-per-status is load-bearing, see docblock
|
|
71
|
+
// above) but a visibly darker/more saturated shade so the two stay distinguishable.
|
|
72
|
+
failed: "bg-red-100 text-red-800 ring-1 ring-inset ring-red-700/30"
|
|
73
|
+
}, G = {
|
|
71
74
|
high: "High",
|
|
72
75
|
medium: "Medium",
|
|
73
76
|
low: "Low",
|
|
74
|
-
unverifiable: "Unverifiable"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
unverifiable: "Unverifiable",
|
|
78
|
+
failed: "Failed"
|
|
79
|
+
}, Me = ["override", "extracted", "claim"];
|
|
80
|
+
function ke(e) {
|
|
81
|
+
return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved : ft(e.candidates) : { value: null, source: "none" };
|
|
78
82
|
}
|
|
79
|
-
function
|
|
83
|
+
function ft(e) {
|
|
80
84
|
if (e)
|
|
81
|
-
for (const t of
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
return { value:
|
|
85
|
+
for (const t of Me) {
|
|
86
|
+
const n = e[t];
|
|
87
|
+
if (n != null)
|
|
88
|
+
return { value: n.value, source: t };
|
|
85
89
|
}
|
|
86
90
|
return { value: null, source: "none" };
|
|
87
91
|
}
|
|
88
|
-
function
|
|
89
|
-
var
|
|
90
|
-
const t = (
|
|
91
|
-
if (t == null) return null;
|
|
92
|
-
const a = String(t).trim();
|
|
93
|
-
return a === "" ? null : a;
|
|
94
|
-
}
|
|
95
|
-
function pe(e) {
|
|
96
|
-
var g, x;
|
|
97
|
-
const t = (x = (g = e == null ? void 0 : e.candidates) == null ? void 0 : g.extracted) == null ? void 0 : x.cited_text;
|
|
92
|
+
function xe(e) {
|
|
93
|
+
var w, b;
|
|
94
|
+
const t = (b = (w = e == null ? void 0 : e.candidates) == null ? void 0 : w.extracted) == null ? void 0 : b.reasoning;
|
|
98
95
|
if (t == null) return null;
|
|
99
|
-
const
|
|
100
|
-
return
|
|
96
|
+
const n = String(t).trim();
|
|
97
|
+
return n === "" ? null : n;
|
|
101
98
|
}
|
|
102
|
-
function
|
|
103
|
-
return e ? typeof e.discrepancy == "boolean" ? e.discrepancy :
|
|
99
|
+
function Fe(e) {
|
|
100
|
+
return e ? typeof e.discrepancy == "boolean" ? e.discrepancy : gt(e.candidates) : !1;
|
|
104
101
|
}
|
|
105
|
-
function
|
|
102
|
+
function gt(e) {
|
|
106
103
|
if (!e) return !1;
|
|
107
|
-
const t =
|
|
104
|
+
const t = Me.map((n) => e[n]).filter((n) => n != null).map((n) => pt(n.value));
|
|
108
105
|
return t.length < 2 ? !1 : new Set(t).size > 1;
|
|
109
106
|
}
|
|
110
|
-
function
|
|
107
|
+
function pt(e) {
|
|
111
108
|
return JSON.stringify(e ?? null);
|
|
112
109
|
}
|
|
113
|
-
const
|
|
114
|
-
function
|
|
115
|
-
const
|
|
116
|
-
return
|
|
110
|
+
const mt = /* @__PURE__ */ new Set(["name", "type"]);
|
|
111
|
+
function $e(e, t = "") {
|
|
112
|
+
const n = [];
|
|
113
|
+
return he(e, t, n), n;
|
|
117
114
|
}
|
|
118
|
-
function
|
|
115
|
+
function he(e, t, n) {
|
|
119
116
|
if (Array.isArray(e)) {
|
|
120
|
-
e.forEach((
|
|
117
|
+
e.forEach((c, r) => he(c, `${t}[${r}]`, n));
|
|
121
118
|
return;
|
|
122
119
|
}
|
|
123
|
-
if (!
|
|
124
|
-
const
|
|
125
|
-
for (const [
|
|
126
|
-
if (
|
|
127
|
-
const l = t ? `${t}.${
|
|
128
|
-
if (Array.isArray(
|
|
129
|
-
|
|
120
|
+
if (!Te(e)) return;
|
|
121
|
+
const b = e.__meta ?? {};
|
|
122
|
+
for (const [c, r] of Object.entries(e)) {
|
|
123
|
+
if (c === "__meta") continue;
|
|
124
|
+
const l = t ? `${t}.${c}` : c;
|
|
125
|
+
if (Array.isArray(r) || Te(r)) {
|
|
126
|
+
he(r, l, n);
|
|
130
127
|
continue;
|
|
131
128
|
}
|
|
132
|
-
const
|
|
133
|
-
!
|
|
129
|
+
const _ = b[c];
|
|
130
|
+
!_ && mt.has(c) || n.push({
|
|
134
131
|
path: l,
|
|
135
|
-
label:
|
|
136
|
-
meta:
|
|
137
|
-
value:
|
|
138
|
-
unanchored: !
|
|
132
|
+
label: c,
|
|
133
|
+
meta: _ ?? null,
|
|
134
|
+
value: r,
|
|
135
|
+
unanchored: !_
|
|
139
136
|
});
|
|
140
137
|
}
|
|
141
138
|
}
|
|
142
|
-
function
|
|
139
|
+
function Te(e) {
|
|
143
140
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
144
141
|
}
|
|
145
|
-
function
|
|
146
|
-
var
|
|
142
|
+
function Ye(e) {
|
|
143
|
+
var n;
|
|
147
144
|
if (e.candidates.override) return !1;
|
|
148
|
-
const t = (
|
|
145
|
+
const t = (n = e.candidates.extracted) == null ? void 0 : n.confidence;
|
|
149
146
|
return e.discrepancy || t == null || t <= 2;
|
|
150
147
|
}
|
|
151
|
-
function
|
|
152
|
-
const t =
|
|
153
|
-
(
|
|
154
|
-
),
|
|
155
|
-
let
|
|
156
|
-
for (const
|
|
157
|
-
if (
|
|
158
|
-
|
|
148
|
+
function xt(e) {
|
|
149
|
+
const t = $e(e).filter(
|
|
150
|
+
(c) => c.meta !== null
|
|
151
|
+
), n = t.length;
|
|
152
|
+
let w = 0, b = 0;
|
|
153
|
+
for (const c of t) {
|
|
154
|
+
if (c.meta.candidates.override) {
|
|
155
|
+
w++;
|
|
159
156
|
continue;
|
|
160
157
|
}
|
|
161
|
-
|
|
158
|
+
Ye(c.meta) && b++;
|
|
162
159
|
}
|
|
163
160
|
return {
|
|
164
|
-
total:
|
|
165
|
-
verified:
|
|
166
|
-
needsReview:
|
|
167
|
-
percent:
|
|
161
|
+
total: n,
|
|
162
|
+
verified: w,
|
|
163
|
+
needsReview: b,
|
|
164
|
+
percent: n === 0 ? 100 : Math.round(w / n * 100)
|
|
168
165
|
};
|
|
169
166
|
}
|
|
170
|
-
function
|
|
171
|
-
var
|
|
172
|
-
const
|
|
173
|
-
if (!e.saveOverride || !
|
|
174
|
-
const
|
|
175
|
-
return async (
|
|
176
|
-
const
|
|
167
|
+
function ht(e, t, n) {
|
|
168
|
+
var c;
|
|
169
|
+
const w = (c = t.value) == null ? void 0 : c.anchor;
|
|
170
|
+
if (!e.saveOverride || !w) return null;
|
|
171
|
+
const b = e.saveOverride;
|
|
172
|
+
return async (r, l) => {
|
|
173
|
+
const _ = await b({
|
|
177
174
|
workflow_input_id: e.workflowInputId,
|
|
178
|
-
object_ids:
|
|
179
|
-
field:
|
|
180
|
-
field_path:
|
|
181
|
-
value:
|
|
175
|
+
object_ids: w.object_ids,
|
|
176
|
+
field: w.field,
|
|
177
|
+
field_path: w.field_path,
|
|
178
|
+
value: r,
|
|
182
179
|
source_choice: l
|
|
183
180
|
});
|
|
184
|
-
return
|
|
181
|
+
return n(_), _;
|
|
185
182
|
};
|
|
186
183
|
}
|
|
187
|
-
const
|
|
184
|
+
const yt = ["data-status", "title"], bt = {
|
|
188
185
|
class: "tv-confidence-glyph",
|
|
189
186
|
"aria-hidden": "true"
|
|
190
|
-
},
|
|
187
|
+
}, wt = {
|
|
191
188
|
key: 0,
|
|
192
189
|
class: "tv-confidence-label"
|
|
193
|
-
},
|
|
190
|
+
}, ye = /* @__PURE__ */ Q({
|
|
194
191
|
__name: "ConfidenceIcon",
|
|
195
192
|
props: {
|
|
196
193
|
confidence: {},
|
|
@@ -198,166 +195,232 @@ const it = ["data-status", "title"], ot = {
|
|
|
198
195
|
showLabel: { type: Boolean }
|
|
199
196
|
},
|
|
200
197
|
setup(e) {
|
|
201
|
-
const t = e,
|
|
202
|
-
() => t.status ??
|
|
203
|
-
),
|
|
198
|
+
const t = e, n = g(
|
|
199
|
+
() => t.status ?? _e(t.confidence)
|
|
200
|
+
), w = {
|
|
204
201
|
high: "✔",
|
|
205
202
|
// check
|
|
206
203
|
medium: "⚠",
|
|
207
204
|
// warning triangle
|
|
208
205
|
low: "✕",
|
|
209
206
|
// x
|
|
210
|
-
unverifiable: "?"
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
207
|
+
unverifiable: "?",
|
|
208
|
+
failed: "⊗"
|
|
209
|
+
// circled x — distinct from low's plain x
|
|
210
|
+
}, b = g(() => w[n.value]), c = g(() => vt[n.value]), r = g(() => G[n.value]);
|
|
211
|
+
return (l, _) => (a(), s("span", {
|
|
212
|
+
class: A(["tv-confidence-icon inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-none", c.value]),
|
|
213
|
+
"data-status": n.value,
|
|
214
|
+
title: r.value
|
|
216
215
|
}, [
|
|
217
|
-
|
|
218
|
-
e.showLabel ? (
|
|
219
|
-
], 10,
|
|
216
|
+
o("span", bt, i(b.value), 1),
|
|
217
|
+
e.showLabel ? (a(), s("span", wt, i(r.value), 1)) : p("", !0)
|
|
218
|
+
], 10, yt));
|
|
220
219
|
}
|
|
221
220
|
});
|
|
222
|
-
async function
|
|
223
|
-
const
|
|
224
|
-
object_id: String(
|
|
221
|
+
async function _t(e, t) {
|
|
222
|
+
const n = t.object_ids.at(-1), w = new URLSearchParams({
|
|
223
|
+
object_id: String(n),
|
|
225
224
|
field: t.field
|
|
226
|
-
}),
|
|
227
|
-
if (!
|
|
225
|
+
}), b = e.includes("?") ? "&" : "?", c = await fetch(`${e}${b}${w}`);
|
|
226
|
+
if (!c.ok)
|
|
228
227
|
throw new Error(
|
|
229
|
-
`data-point-audit ${
|
|
228
|
+
`data-point-audit ${c.status}: ${await c.text()}`
|
|
230
229
|
);
|
|
231
|
-
return (await
|
|
230
|
+
return (await c.json()).data ?? [];
|
|
232
231
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
232
|
+
const kt = "api_log", $t = "user", Ct = "failed_file", St = {
|
|
233
|
+
pages: [],
|
|
234
|
+
documents: [],
|
|
235
|
+
apiLogIds: [],
|
|
236
|
+
unresolved: [],
|
|
237
|
+
pageCount: 0,
|
|
238
|
+
quoteCount: 0,
|
|
239
|
+
isEmpty: !0
|
|
240
|
+
};
|
|
241
|
+
function oe(e) {
|
|
242
|
+
var r;
|
|
243
|
+
if (!e || e.length === 0) return { ...St };
|
|
244
|
+
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), w = [], b = [];
|
|
245
|
+
for (const l of e) {
|
|
246
|
+
if (l.source_type === Ct) {
|
|
247
|
+
b.push(l);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if (l.api_log_id !== void 0 && l.api_log_id !== null && (w.includes(l.api_log_id) || w.push(l.api_log_id)), l.source_type === kt || l.source_type === $t || !Vt(l)) continue;
|
|
251
|
+
const _ = Nt(l);
|
|
252
|
+
let f = t.get(_);
|
|
253
|
+
f || (f = {
|
|
254
|
+
key: _,
|
|
255
|
+
pageNumber: re(l),
|
|
256
|
+
label: "",
|
|
257
|
+
documentName: null,
|
|
258
|
+
file: null,
|
|
259
|
+
url: null,
|
|
260
|
+
document: null,
|
|
261
|
+
quotes: [],
|
|
262
|
+
explanations: [],
|
|
263
|
+
sourceIds: []
|
|
264
|
+
}, t.set(_, f)), !f.file && l.file && (f.file = Ot(l)), f.url || (f.url = ((r = l.file) == null ? void 0 : r.url) ?? l.file_url ?? null), !f.document && l.original_file && (f.document = l.original_file), f.pageNumber === null && (f.pageNumber = re(l)), l.id !== void 0 && l.id !== null && f.sourceIds.push(l.id);
|
|
265
|
+
for (const V of l.texts ?? []) {
|
|
266
|
+
const $ = String(V).trim();
|
|
267
|
+
$ && !f.quotes.includes($) && f.quotes.push($);
|
|
268
|
+
}
|
|
269
|
+
if (l.explanation) {
|
|
270
|
+
const V = String(l.explanation).trim();
|
|
271
|
+
V && !f.explanations.includes(V) && f.explanations.push(V);
|
|
272
|
+
}
|
|
273
|
+
f.documentName || (f.documentName = qt(l)), l.original_file && n.set(String(l.original_file.id), l.original_file);
|
|
252
274
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
275
|
+
const c = [...t.values()];
|
|
276
|
+
for (const l of c) l.label = It(l);
|
|
277
|
+
return c.sort(Dt), {
|
|
278
|
+
pages: c,
|
|
279
|
+
documents: [...n.values()],
|
|
280
|
+
apiLogIds: w,
|
|
281
|
+
unresolved: b,
|
|
282
|
+
pageCount: c.length,
|
|
283
|
+
quoteCount: c.reduce((l, _) => l + _.quotes.length, 0),
|
|
284
|
+
isEmpty: c.length === 0 && b.length === 0
|
|
285
|
+
};
|
|
258
286
|
}
|
|
259
|
-
function
|
|
287
|
+
function Vt(e) {
|
|
260
288
|
var t;
|
|
261
|
-
return (
|
|
289
|
+
return !!(e.file || e.file_url || e.file_name || e.file_id !== void 0 || e.stored_file_id !== void 0 || re(e) !== null || (((t = e.texts) == null ? void 0 : t.length) ?? 0) > 0);
|
|
262
290
|
}
|
|
263
|
-
function
|
|
291
|
+
function Nt(e) {
|
|
292
|
+
var w;
|
|
293
|
+
const t = ((w = e.file) == null ? void 0 : w.id) ?? e.stored_file_id ?? e.file_id ?? e.file_name, n = re(e);
|
|
294
|
+
return t != null ? n === null ? String(t) : `${t}#${n}` : n !== null ? `page-${n}` : `source-${e.id ?? "unknown"}`;
|
|
295
|
+
}
|
|
296
|
+
function re(e) {
|
|
264
297
|
const t = e.page ?? e.page_number;
|
|
265
|
-
return t
|
|
298
|
+
return t == null ? null : Number(t);
|
|
299
|
+
}
|
|
300
|
+
function qt(e) {
|
|
301
|
+
var t;
|
|
302
|
+
return ((t = e.original_file) == null ? void 0 : t.name) ?? e.file_name ?? null;
|
|
303
|
+
}
|
|
304
|
+
function Ot(e) {
|
|
305
|
+
const t = e.file, n = re(e);
|
|
306
|
+
return n === null || t.page_number != null ? t : { ...t, page_number: n };
|
|
307
|
+
}
|
|
308
|
+
function It(e) {
|
|
309
|
+
var t;
|
|
310
|
+
return e.pageNumber !== null ? `Page ${e.pageNumber}` : (t = e.file) != null && t.name ? e.file.name : e.documentName ? e.documentName : "Cited source";
|
|
311
|
+
}
|
|
312
|
+
function Dt(e, t) {
|
|
313
|
+
return e.pageNumber === null && t.pageNumber === null ? 0 : e.pageNumber === null ? 1 : t.pageNumber === null ? -1 : e.pageNumber - t.pageNumber;
|
|
314
|
+
}
|
|
315
|
+
function Ce(e) {
|
|
316
|
+
if (e.isEmpty) return "No citations recorded";
|
|
317
|
+
const t = [
|
|
318
|
+
`${e.pageCount} ${e.pageCount === 1 ? "page" : "pages"}`
|
|
319
|
+
];
|
|
320
|
+
return e.quoteCount > 0 && t.push(
|
|
321
|
+
`${e.quoteCount} ${e.quoteCount === 1 ? "quote" : "quotes"}`
|
|
322
|
+
), e.unresolved.length > 0 && t.push(`${e.unresolved.length} unresolved`), t.join(" · ");
|
|
323
|
+
}
|
|
324
|
+
function Ee(e) {
|
|
325
|
+
typeof window > "u" || !window.top || window.top === window || window.top.postMessage(
|
|
326
|
+
{ source: "danxbot-template", type: "nested-viewer-active", active: e },
|
|
327
|
+
"*"
|
|
328
|
+
);
|
|
266
329
|
}
|
|
267
|
-
const
|
|
330
|
+
const Tt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm" }, Et = { class: "tv-audit-call-header flex flex-wrap items-center gap-2 border-b border-gray-100 bg-gray-50 px-3 py-2" }, Lt = {
|
|
268
331
|
key: 3,
|
|
269
332
|
class: "font-mono text-[11px] text-gray-400"
|
|
270
|
-
},
|
|
333
|
+
}, Pt = {
|
|
271
334
|
key: 4,
|
|
272
335
|
class: "text-[11px] font-medium text-gray-500"
|
|
273
|
-
},
|
|
336
|
+
}, At = {
|
|
274
337
|
key: 5,
|
|
275
338
|
class: "text-[11px] text-gray-400"
|
|
276
|
-
},
|
|
339
|
+
}, zt = { class: "tv-audit-call-body flex flex-col gap-2 p-3" }, jt = /* @__PURE__ */ Q({
|
|
277
340
|
__name: "AuditCallCard",
|
|
278
341
|
props: {
|
|
279
342
|
call: {}
|
|
280
343
|
},
|
|
281
344
|
setup(e) {
|
|
282
|
-
const t = e,
|
|
345
|
+
const t = e, n = g(() => {
|
|
283
346
|
const l = t.call.status_code;
|
|
284
347
|
return l == null ? "muted" : l >= 200 && l < 300 ? "success" : l >= 400 ? "danger" : "warning";
|
|
285
|
-
}),
|
|
348
|
+
}), w = g(() => {
|
|
286
349
|
const l = t.call.run_time_ms;
|
|
287
350
|
return l == null ? null : l >= 1e3 ? `${(l / 1e3).toFixed(1)}s` : `${l}ms`;
|
|
288
|
-
}),
|
|
351
|
+
}), b = g(() => {
|
|
289
352
|
if (!t.call.started_at) return null;
|
|
290
353
|
const l = new Date(t.call.started_at);
|
|
291
354
|
return Number.isNaN(l.getTime()) ? t.call.started_at : l.toLocaleString();
|
|
292
|
-
}),
|
|
355
|
+
}), c = g(
|
|
293
356
|
() => JSON.stringify(t.call.request ?? null, null, 2)
|
|
294
|
-
),
|
|
357
|
+
), r = g(
|
|
295
358
|
() => JSON.stringify(t.call.response ?? null, null, 2)
|
|
296
359
|
);
|
|
297
|
-
return (l,
|
|
298
|
-
|
|
299
|
-
e.call.stage ? (
|
|
360
|
+
return (l, _) => (a(), s("div", Tt, [
|
|
361
|
+
o("div", Et, [
|
|
362
|
+
e.call.stage ? (a(), E(u(K), {
|
|
300
363
|
key: 0,
|
|
301
364
|
variant: "muted",
|
|
302
365
|
size: "xxs",
|
|
303
366
|
class: "tv-audit-stage"
|
|
304
367
|
}, {
|
|
305
368
|
default: O(() => [
|
|
306
|
-
I(
|
|
369
|
+
I(i(e.call.stage), 1)
|
|
307
370
|
]),
|
|
308
371
|
_: 1
|
|
309
|
-
})) :
|
|
310
|
-
e.call.model ? (
|
|
372
|
+
})) : p("", !0),
|
|
373
|
+
e.call.model ? (a(), E(u(K), {
|
|
311
374
|
key: 1,
|
|
312
375
|
variant: "info",
|
|
313
376
|
size: "xs",
|
|
314
377
|
class: "tv-audit-model"
|
|
315
378
|
}, {
|
|
316
379
|
default: O(() => [
|
|
317
|
-
I(
|
|
380
|
+
I(i(e.call.model), 1)
|
|
318
381
|
]),
|
|
319
382
|
_: 1
|
|
320
|
-
})) :
|
|
321
|
-
e.call.service ? (
|
|
383
|
+
})) : p("", !0),
|
|
384
|
+
e.call.service ? (a(), E(u(K), {
|
|
322
385
|
key: 2,
|
|
323
386
|
variant: "muted",
|
|
324
387
|
size: "xxs"
|
|
325
388
|
}, {
|
|
326
389
|
default: O(() => [
|
|
327
|
-
I(
|
|
390
|
+
I(i(e.call.service), 1)
|
|
328
391
|
]),
|
|
329
392
|
_: 1
|
|
330
|
-
})) :
|
|
331
|
-
e.call.endpoint ? (
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
variant:
|
|
393
|
+
})) : p("", !0),
|
|
394
|
+
e.call.endpoint ? (a(), s("span", Lt, i(e.call.endpoint), 1)) : p("", !0),
|
|
395
|
+
_[0] || (_[0] = o("span", { class: "flex-1" }, null, -1)),
|
|
396
|
+
D(u(K), {
|
|
397
|
+
variant: n.value,
|
|
335
398
|
size: "xxs",
|
|
336
399
|
class: "tv-audit-status"
|
|
337
400
|
}, {
|
|
338
401
|
default: O(() => [
|
|
339
|
-
I(
|
|
402
|
+
I(i(e.call.status_code ?? "…"), 1)
|
|
340
403
|
]),
|
|
341
404
|
_: 1
|
|
342
405
|
}, 8, ["variant"]),
|
|
343
|
-
|
|
344
|
-
|
|
406
|
+
w.value ? (a(), s("span", Pt, i(w.value), 1)) : p("", !0),
|
|
407
|
+
b.value ? (a(), s("span", At, i(b.value), 1)) : p("", !0)
|
|
345
408
|
]),
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
"model-value":
|
|
409
|
+
o("div", zt, [
|
|
410
|
+
o("div", null, [
|
|
411
|
+
_[1] || (_[1] = o("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Request ", -1)),
|
|
412
|
+
D(u(De), {
|
|
413
|
+
"model-value": c.value,
|
|
351
414
|
format: "json",
|
|
352
415
|
collapsible: "",
|
|
353
416
|
"default-collapsed": "",
|
|
354
417
|
class: "tv-audit-request"
|
|
355
418
|
}, null, 8, ["model-value"])
|
|
356
419
|
]),
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
"model-value":
|
|
420
|
+
o("div", null, [
|
|
421
|
+
_[2] || (_[2] = o("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Response ", -1)),
|
|
422
|
+
D(u(De), {
|
|
423
|
+
"model-value": r.value,
|
|
361
424
|
format: "json",
|
|
362
425
|
collapsible: "",
|
|
363
426
|
"default-collapsed": "",
|
|
@@ -367,46 +430,472 @@ const pt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
367
430
|
])
|
|
368
431
|
]));
|
|
369
432
|
}
|
|
370
|
-
}),
|
|
433
|
+
}), Rt = {
|
|
434
|
+
key: 0,
|
|
435
|
+
class: "tv-citation-thumb shrink-0"
|
|
436
|
+
}, Ut = { class: "tv-citation-quotes flex min-w-0 flex-1 flex-col gap-2" }, Bt = {
|
|
437
|
+
key: 0,
|
|
438
|
+
class: "tv-quote-list flex flex-col gap-2"
|
|
439
|
+
}, Mt = { class: "tv-quote-index mr-1 not-italic text-[10px] font-semibold text-amber-600" }, Ft = {
|
|
371
440
|
key: 1,
|
|
372
|
-
class: "tv-
|
|
373
|
-
},
|
|
441
|
+
class: "tv-quote-empty rounded-md border border-dashed border-gray-200 px-3 py-2 text-xs text-gray-400"
|
|
442
|
+
}, Yt = { class: "tv-citation-actions mt-1 flex flex-wrap items-center gap-2" }, Le = /* @__PURE__ */ Q({
|
|
443
|
+
__name: "CitationPage",
|
|
444
|
+
props: {
|
|
445
|
+
page: {},
|
|
446
|
+
dense: { type: Boolean }
|
|
447
|
+
},
|
|
448
|
+
emits: ["view", "document"],
|
|
449
|
+
setup(e, { emit: t }) {
|
|
450
|
+
const n = t;
|
|
451
|
+
return (w, b) => (a(), s("div", {
|
|
452
|
+
class: A(["tv-citation-page flex gap-4", e.dense ? "tv-citation-page-dense" : ""])
|
|
453
|
+
}, [
|
|
454
|
+
e.page.file ? (a(), s("div", Rt, [
|
|
455
|
+
D(u(et), {
|
|
456
|
+
file: e.page.file,
|
|
457
|
+
size: e.dense ? "md" : "lg",
|
|
458
|
+
fit: "cover",
|
|
459
|
+
downloadable: "",
|
|
460
|
+
class: "cursor-zoom-in",
|
|
461
|
+
onClick: b[0] || (b[0] = (c) => n("view"))
|
|
462
|
+
}, null, 8, ["file", "size"])
|
|
463
|
+
])) : p("", !0),
|
|
464
|
+
o("div", Ut, [
|
|
465
|
+
e.page.quotes.length ? (a(), s("ol", Bt, [
|
|
466
|
+
(a(!0), s(U, null, F(e.page.quotes, (c, r) => (a(), s("li", {
|
|
467
|
+
key: r,
|
|
468
|
+
class: "tv-quote rounded-r-md border-l-[3px] border-amber-300 bg-amber-50/60 py-1.5 pl-3 pr-3 text-sm italic leading-relaxed text-gray-700"
|
|
469
|
+
}, [
|
|
470
|
+
o("span", Mt, i(r + 1), 1),
|
|
471
|
+
I("“" + i(c) + "” ", 1)
|
|
472
|
+
]))), 128))
|
|
473
|
+
])) : (a(), s("p", Ft, " This page was cited without a verbatim quote — the value was read from the page as a whole. ")),
|
|
474
|
+
(a(!0), s(U, null, F(e.page.explanations, (c, r) => (a(), s("p", {
|
|
475
|
+
key: `x${r}`,
|
|
476
|
+
class: "tv-citation-explanation text-xs text-gray-500"
|
|
477
|
+
}, i(c), 1))), 128)),
|
|
478
|
+
o("div", Yt, [
|
|
479
|
+
e.page.file ? (a(), E(u(ie), {
|
|
480
|
+
key: 0,
|
|
481
|
+
size: "xs",
|
|
482
|
+
variant: "info",
|
|
483
|
+
class: "tv-view-page",
|
|
484
|
+
onClick: b[1] || (b[1] = (c) => n("view"))
|
|
485
|
+
}, {
|
|
486
|
+
default: O(() => [...b[3] || (b[3] = [
|
|
487
|
+
I("View page full screen", -1)
|
|
488
|
+
])]),
|
|
489
|
+
_: 1
|
|
490
|
+
})) : p("", !0),
|
|
491
|
+
e.page.document ? (a(), E(u(ie), {
|
|
492
|
+
key: 1,
|
|
493
|
+
size: "xs",
|
|
494
|
+
variant: "muted",
|
|
495
|
+
class: "tv-open-document",
|
|
496
|
+
onClick: b[2] || (b[2] = (c) => n("document"))
|
|
497
|
+
}, {
|
|
498
|
+
default: O(() => [
|
|
499
|
+
I("Open " + i(e.page.document.name), 1)
|
|
500
|
+
]),
|
|
501
|
+
_: 1
|
|
502
|
+
})) : p("", !0)
|
|
503
|
+
])
|
|
504
|
+
])
|
|
505
|
+
], 2));
|
|
506
|
+
}
|
|
507
|
+
}), Kt = { class: "tv-disclosure divide-y divide-gray-200" }, Ht = ["id", "aria-expanded", "aria-controls", "onClick"], Jt = { class: "min-w-0 flex-1" }, Gt = ["id", "aria-labelledby"], Ke = /* @__PURE__ */ Q({
|
|
508
|
+
__name: "TvDisclosure",
|
|
509
|
+
props: {
|
|
510
|
+
items: {},
|
|
511
|
+
modelValue: {},
|
|
512
|
+
idPrefix: { default: "tv-disclosure" }
|
|
513
|
+
},
|
|
514
|
+
emits: ["update:modelValue"],
|
|
515
|
+
setup(e, { emit: t }) {
|
|
516
|
+
const n = e, w = t, b = g(() => new Set(n.modelValue)), c = (f) => b.value.has(f);
|
|
517
|
+
function r(f) {
|
|
518
|
+
const V = new Set(b.value);
|
|
519
|
+
V.has(f) ? V.delete(f) : V.add(f), w("update:modelValue", [...V]);
|
|
520
|
+
}
|
|
521
|
+
const l = (f) => `${n.idPrefix}-h-${f}`, _ = (f) => `${n.idPrefix}-p-${f}`;
|
|
522
|
+
return (f, V) => (a(), s("div", Kt, [
|
|
523
|
+
(a(!0), s(U, null, F(e.items, ($) => (a(), s("div", {
|
|
524
|
+
key: $.value,
|
|
525
|
+
class: A(["tv-disclosure__item", c($.value) ? "is-open" : ""])
|
|
526
|
+
}, [
|
|
527
|
+
o("button", {
|
|
528
|
+
id: l($.value),
|
|
529
|
+
type: "button",
|
|
530
|
+
class: "tv-disclosure__header flex w-full items-center gap-3 px-3 py-2.5 text-left transition-colors hover:bg-gray-50",
|
|
531
|
+
"aria-expanded": c($.value),
|
|
532
|
+
"aria-controls": _($.value),
|
|
533
|
+
onClick: (L) => r($.value)
|
|
534
|
+
}, [
|
|
535
|
+
o("span", Jt, [
|
|
536
|
+
me(f.$slots, "header", {
|
|
537
|
+
item: $,
|
|
538
|
+
isOpen: c($.value)
|
|
539
|
+
}, () => [
|
|
540
|
+
I(i($.label), 1)
|
|
541
|
+
])
|
|
542
|
+
]),
|
|
543
|
+
(a(), s("svg", {
|
|
544
|
+
class: A(["tv-disclosure__chevron h-4 w-4 shrink-0 text-gray-400 transition-transform duration-200", c($.value) ? "rotate-180" : ""]),
|
|
545
|
+
viewBox: "0 0 20 20",
|
|
546
|
+
fill: "none",
|
|
547
|
+
"aria-hidden": "true"
|
|
548
|
+
}, [...V[0] || (V[0] = [
|
|
549
|
+
o("path", {
|
|
550
|
+
d: "M5 7.5 10 12.5 15 7.5",
|
|
551
|
+
stroke: "currentColor",
|
|
552
|
+
"stroke-width": "1.75",
|
|
553
|
+
"stroke-linecap": "round",
|
|
554
|
+
"stroke-linejoin": "round"
|
|
555
|
+
}, null, -1)
|
|
556
|
+
])], 2))
|
|
557
|
+
], 8, Ht),
|
|
558
|
+
c($.value) ? (a(), s("div", {
|
|
559
|
+
key: 0,
|
|
560
|
+
id: _($.value),
|
|
561
|
+
role: "region",
|
|
562
|
+
"aria-labelledby": l($.value),
|
|
563
|
+
class: "tv-disclosure__panel border-t border-gray-100 bg-gray-50/40 px-3 py-3"
|
|
564
|
+
}, [
|
|
565
|
+
me(f.$slots, "panel", {
|
|
566
|
+
item: $,
|
|
567
|
+
isOpen: !0
|
|
568
|
+
})
|
|
569
|
+
], 8, Gt)) : p("", !0)
|
|
570
|
+
], 2))), 128))
|
|
571
|
+
]));
|
|
572
|
+
}
|
|
573
|
+
}), Qt = { class: "tv-citation-list flex flex-col gap-2" }, Wt = {
|
|
374
574
|
key: 0,
|
|
375
|
-
class: "tv-
|
|
376
|
-
},
|
|
575
|
+
class: "tv-citation-list-controls flex justify-end"
|
|
576
|
+
}, Xt = { class: "tv-citation-header flex min-w-0 flex-1 items-center gap-3 text-left" }, Zt = ["src", "alt"], ea = { class: "flex min-w-0 flex-1 flex-col" }, ta = { class: "flex flex-wrap items-center gap-2" }, aa = { class: "tv-citation-page-label text-sm font-semibold text-gray-900" }, na = {
|
|
577
|
+
key: 0,
|
|
578
|
+
class: "tv-citation-document-name truncate text-xs text-gray-400"
|
|
579
|
+
}, la = {
|
|
580
|
+
key: 0,
|
|
581
|
+
class: "tv-citation-preview truncate text-xs italic text-gray-500"
|
|
582
|
+
}, sa = { class: "tv-citation-header mb-2 flex flex-wrap items-center gap-2" }, oa = { class: "tv-citation-page-label text-sm font-semibold text-gray-900" }, ia = {
|
|
377
583
|
key: 0,
|
|
378
|
-
class: "tv-
|
|
379
|
-
},
|
|
584
|
+
class: "tv-citation-document-name text-xs text-gray-400"
|
|
585
|
+
}, ra = { class: "tv-page-dialog flex h-full min-h-0 flex-col gap-3 lg:flex-row" }, ua = {
|
|
586
|
+
key: 0,
|
|
587
|
+
class: "tv-page-dialog-quotes max-h-40 shrink-0 overflow-y-auto rounded-lg border border-gray-200 bg-gray-50 p-3 lg:max-h-none lg:w-80"
|
|
588
|
+
}, da = { class: "mb-2 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, ca = { class: "flex flex-col gap-1.5" }, va = /* @__PURE__ */ Q({
|
|
589
|
+
__name: "CitationPageList",
|
|
590
|
+
props: {
|
|
591
|
+
pages: {},
|
|
592
|
+
collapsible: { type: Boolean, default: !0 },
|
|
593
|
+
dense: { type: Boolean, default: !1 }
|
|
594
|
+
},
|
|
595
|
+
setup(e) {
|
|
596
|
+
const t = e, n = g(
|
|
597
|
+
() => t.pages.map((k) => ({ value: k.key, label: k.label }))
|
|
598
|
+
), w = j([]);
|
|
599
|
+
ae(
|
|
600
|
+
() => t.pages,
|
|
601
|
+
(k) => {
|
|
602
|
+
w.value = k.length ? [k[0].key] : [];
|
|
603
|
+
},
|
|
604
|
+
{ immediate: !0 }
|
|
605
|
+
);
|
|
606
|
+
const b = g(
|
|
607
|
+
() => t.pages.length > 0 && w.value.length === t.pages.length
|
|
608
|
+
);
|
|
609
|
+
function c() {
|
|
610
|
+
w.value = b.value ? [] : t.pages.map((k) => k.key);
|
|
611
|
+
}
|
|
612
|
+
const r = g(
|
|
613
|
+
() => new Map(t.pages.map((k) => [k.key, k]))
|
|
614
|
+
);
|
|
615
|
+
function l(k) {
|
|
616
|
+
const T = k.quotes[0];
|
|
617
|
+
return T ? T.length > 96 ? `${T.slice(0, 96)}…` : T : "";
|
|
618
|
+
}
|
|
619
|
+
const _ = g(
|
|
620
|
+
() => t.pages.map((k) => k.file).filter((k) => !!k)
|
|
621
|
+
), f = j(null), V = j(!1), $ = j(null), L = g({
|
|
622
|
+
get: () => f.value !== null,
|
|
623
|
+
set: (k) => {
|
|
624
|
+
k || (f.value = null, $.value = null, V.value = !1);
|
|
625
|
+
}
|
|
626
|
+
}), S = g(
|
|
627
|
+
() => V.value ? [] : _.value
|
|
628
|
+
), d = g(() => {
|
|
629
|
+
if (V.value) return null;
|
|
630
|
+
const k = $.value ?? f.value;
|
|
631
|
+
return k ? t.pages.find(
|
|
632
|
+
(T) => T.file && String(T.file.id) === String(k.id)
|
|
633
|
+
) ?? null : null;
|
|
634
|
+
}), m = g(() => {
|
|
635
|
+
if (!f.value) return "";
|
|
636
|
+
if (V.value) return f.value.name;
|
|
637
|
+
const k = d.value;
|
|
638
|
+
return k ? k.documentName ? `${k.label} · ${k.documentName}` : k.label : f.value.name;
|
|
639
|
+
});
|
|
640
|
+
function h(k) {
|
|
641
|
+
k.file && (V.value = !1, $.value = k.file, f.value = k.file);
|
|
642
|
+
}
|
|
643
|
+
function B(k) {
|
|
644
|
+
k.document && (V.value = !0, $.value = null, f.value = k.document);
|
|
645
|
+
}
|
|
646
|
+
return (k, T) => (a(), s("div", Qt, [
|
|
647
|
+
e.collapsible && e.pages.length > 1 ? (a(), s("div", Wt, [
|
|
648
|
+
D(u(ie), {
|
|
649
|
+
size: "xxs",
|
|
650
|
+
variant: "muted",
|
|
651
|
+
class: "tv-toggle-all-pages",
|
|
652
|
+
onClick: c
|
|
653
|
+
}, {
|
|
654
|
+
default: O(() => [
|
|
655
|
+
I(i(b.value ? "Collapse all" : "Expand all"), 1)
|
|
656
|
+
]),
|
|
657
|
+
_: 1
|
|
658
|
+
})
|
|
659
|
+
])) : p("", !0),
|
|
660
|
+
e.collapsible ? (a(), E(Ke, {
|
|
661
|
+
key: 1,
|
|
662
|
+
modelValue: w.value,
|
|
663
|
+
"onUpdate:modelValue": T[0] || (T[0] = (N) => w.value = N),
|
|
664
|
+
items: n.value,
|
|
665
|
+
"id-prefix": "tv-citation",
|
|
666
|
+
class: "tv-citation-accordion overflow-hidden rounded-lg border border-gray-200"
|
|
667
|
+
}, {
|
|
668
|
+
header: O(({ item: N, isOpen: M }) => {
|
|
669
|
+
var H, J, Y, X, y;
|
|
670
|
+
return [
|
|
671
|
+
o("span", Xt, [
|
|
672
|
+
(J = (H = r.value.get(N.value)) == null ? void 0 : H.file) != null && J.url ? (a(), s("img", {
|
|
673
|
+
key: 0,
|
|
674
|
+
src: r.value.get(N.value).file.url,
|
|
675
|
+
alt: r.value.get(N.value).label,
|
|
676
|
+
class: "tv-citation-header-thumb h-10 w-8 shrink-0 rounded border border-gray-200 object-cover",
|
|
677
|
+
loading: "lazy"
|
|
678
|
+
}, null, 8, Zt)) : p("", !0),
|
|
679
|
+
o("span", ea, [
|
|
680
|
+
o("span", ta, [
|
|
681
|
+
o("span", aa, i((Y = r.value.get(N.value)) == null ? void 0 : Y.label), 1),
|
|
682
|
+
(X = r.value.get(N.value)) != null && X.documentName ? (a(), s("span", na, i((y = r.value.get(N.value)) == null ? void 0 : y.documentName), 1)) : p("", !0),
|
|
683
|
+
D(u(K), {
|
|
684
|
+
variant: "warning",
|
|
685
|
+
size: "xxs",
|
|
686
|
+
class: "tv-citation-quote-count"
|
|
687
|
+
}, {
|
|
688
|
+
default: O(() => {
|
|
689
|
+
var q, P;
|
|
690
|
+
return [
|
|
691
|
+
I(i((q = r.value.get(N.value)) == null ? void 0 : q.quotes.length) + " " + i(((P = r.value.get(N.value)) == null ? void 0 : P.quotes.length) === 1 ? "quote" : "quotes"), 1)
|
|
692
|
+
];
|
|
693
|
+
}),
|
|
694
|
+
_: 2
|
|
695
|
+
}, 1024)
|
|
696
|
+
]),
|
|
697
|
+
!M && l(r.value.get(N.value)) ? (a(), s("span", la, "“" + i(l(r.value.get(N.value))) + "”", 1)) : p("", !0)
|
|
698
|
+
])
|
|
699
|
+
])
|
|
700
|
+
];
|
|
701
|
+
}),
|
|
702
|
+
panel: O(({ item: N }) => [
|
|
703
|
+
D(Le, {
|
|
704
|
+
page: r.value.get(N.value),
|
|
705
|
+
dense: e.dense,
|
|
706
|
+
onView: (M) => h(r.value.get(N.value)),
|
|
707
|
+
onDocument: (M) => B(r.value.get(N.value))
|
|
708
|
+
}, null, 8, ["page", "dense", "onView", "onDocument"])
|
|
709
|
+
]),
|
|
710
|
+
_: 1
|
|
711
|
+
}, 8, ["modelValue", "items"])) : (a(!0), s(U, { key: 2 }, F(e.pages, (N) => (a(), s("div", {
|
|
712
|
+
key: N.key,
|
|
713
|
+
class: "tv-citation-flat rounded-lg border border-gray-200 p-3"
|
|
714
|
+
}, [
|
|
715
|
+
o("div", sa, [
|
|
716
|
+
o("span", oa, i(N.label), 1),
|
|
717
|
+
N.documentName ? (a(), s("span", ia, i(N.documentName), 1)) : p("", !0),
|
|
718
|
+
D(u(K), {
|
|
719
|
+
variant: "warning",
|
|
720
|
+
size: "xxs",
|
|
721
|
+
class: "tv-citation-quote-count"
|
|
722
|
+
}, {
|
|
723
|
+
default: O(() => [
|
|
724
|
+
I(i(N.quotes.length) + " " + i(N.quotes.length === 1 ? "quote" : "quotes"), 1)
|
|
725
|
+
]),
|
|
726
|
+
_: 2
|
|
727
|
+
}, 1024)
|
|
728
|
+
]),
|
|
729
|
+
D(Le, {
|
|
730
|
+
page: N,
|
|
731
|
+
dense: e.dense,
|
|
732
|
+
onView: (M) => h(N),
|
|
733
|
+
onDocument: (M) => B(N)
|
|
734
|
+
}, null, 8, ["page", "dense", "onView", "onDocument"])
|
|
735
|
+
]))), 128)),
|
|
736
|
+
f.value ? (a(), E(u(be), {
|
|
737
|
+
key: 3,
|
|
738
|
+
modelValue: L.value,
|
|
739
|
+
"onUpdate:modelValue": T[2] || (T[2] = (N) => L.value = N),
|
|
740
|
+
title: m.value,
|
|
741
|
+
width: 95,
|
|
742
|
+
height: 95,
|
|
743
|
+
"close-x": "",
|
|
744
|
+
class: A(u(W))
|
|
745
|
+
}, {
|
|
746
|
+
default: O(() => {
|
|
747
|
+
var N;
|
|
748
|
+
return [
|
|
749
|
+
o("div", ra, [
|
|
750
|
+
D(u(tt), {
|
|
751
|
+
file: f.value,
|
|
752
|
+
"file-in-preview": $.value,
|
|
753
|
+
"onUpdate:fileInPreview": T[1] || (T[1] = (M) => $.value = M),
|
|
754
|
+
"related-files": S.value,
|
|
755
|
+
"layout-toggles": ["sidebar", "continuous"],
|
|
756
|
+
downloadable: "",
|
|
757
|
+
zoomable: "",
|
|
758
|
+
"zoom-controls": "",
|
|
759
|
+
"storage-key": "tv-page-viewer",
|
|
760
|
+
class: "tv-page-viewer min-h-[22rem] min-w-0 flex-1"
|
|
761
|
+
}, null, 8, ["file", "file-in-preview", "related-files"]),
|
|
762
|
+
(N = d.value) != null && N.quotes.length ? (a(), s("aside", ua, [
|
|
763
|
+
o("div", da, " Quoted from " + i(d.value.label), 1),
|
|
764
|
+
o("ol", ca, [
|
|
765
|
+
(a(!0), s(U, null, F(d.value.quotes, (M, H) => (a(), s("li", {
|
|
766
|
+
key: H,
|
|
767
|
+
class: "tv-quote rounded-r-md border-l-[3px] border-amber-300 bg-amber-50/70 py-1.5 pl-3 pr-2 text-sm italic leading-relaxed text-gray-700"
|
|
768
|
+
}, " “" + i(M) + "” ", 1))), 128))
|
|
769
|
+
])
|
|
770
|
+
])) : p("", !0)
|
|
771
|
+
])
|
|
772
|
+
];
|
|
773
|
+
}),
|
|
774
|
+
_: 1
|
|
775
|
+
}, 8, ["modelValue", "title", "class"])) : p("", !0)
|
|
776
|
+
]));
|
|
777
|
+
}
|
|
778
|
+
}), fa = { class: "tv-evidence flex flex-col gap-4" }, ga = {
|
|
380
779
|
key: 1,
|
|
381
|
-
class: "tv-
|
|
382
|
-
},
|
|
780
|
+
class: "tv-reasoning-card rounded-lg border border-gray-200 bg-white p-3"
|
|
781
|
+
}, pa = { class: "mb-1 flex flex-wrap items-center justify-between gap-2" }, ma = { class: "tv-reasoning text-sm leading-relaxed text-gray-700" }, xa = { class: "tv-cited-sources flex min-w-0 flex-col gap-2" }, ha = { class: "flex flex-wrap items-baseline justify-between gap-2" }, ya = { class: "tv-citation-summary text-xs text-gray-500" }, ba = {
|
|
782
|
+
key: 1,
|
|
783
|
+
class: "tv-no-source rounded-lg border border-dashed border-gray-200 p-6 text-center text-sm text-gray-400"
|
|
784
|
+
}, wa = {
|
|
383
785
|
key: 2,
|
|
384
|
-
class: "tv-
|
|
385
|
-
},
|
|
786
|
+
class: "tv-llm-provenance text-xs text-gray-400"
|
|
787
|
+
}, _a = { class: "tv-llm-call-ids font-medium text-gray-500" }, Pe = /* @__PURE__ */ Q({
|
|
788
|
+
__name: "CitationEvidence",
|
|
789
|
+
props: {
|
|
790
|
+
evidence: {},
|
|
791
|
+
reasoning: { default: null },
|
|
792
|
+
basis: { default: null },
|
|
793
|
+
failed: { type: Boolean, default: !1 },
|
|
794
|
+
collapsible: { type: Boolean, default: !0 },
|
|
795
|
+
dense: { type: Boolean, default: !1 }
|
|
796
|
+
},
|
|
797
|
+
setup(e) {
|
|
798
|
+
return (t, n) => (a(), s("div", fa, [
|
|
799
|
+
e.failed && e.reasoning ? (a(), E(u(ge), {
|
|
800
|
+
key: 0,
|
|
801
|
+
variant: "danger",
|
|
802
|
+
class: "tv-evidence-failed"
|
|
803
|
+
}, {
|
|
804
|
+
default: O(() => [
|
|
805
|
+
I(i(e.reasoning), 1)
|
|
806
|
+
]),
|
|
807
|
+
_: 1
|
|
808
|
+
})) : e.reasoning ? (a(), s("section", ga, [
|
|
809
|
+
o("div", pa, [
|
|
810
|
+
n[0] || (n[0] = o("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Why this value ", -1)),
|
|
811
|
+
e.basis ? (a(), E(u(we), {
|
|
812
|
+
key: 0,
|
|
813
|
+
tooltip: e.basis === "inferred" ? "The value was derived from the quotes below — computed, reformatted, or reasoned — rather than appearing as-is." : "The stored value appears word-for-word inside the quotes below, checked against the source document at store time.",
|
|
814
|
+
placement: "top"
|
|
815
|
+
}, {
|
|
816
|
+
trigger: O(() => [
|
|
817
|
+
D(u(K), {
|
|
818
|
+
variant: e.basis === "inferred" ? "muted" : "success",
|
|
819
|
+
size: "xxs",
|
|
820
|
+
class: "tv-basis-chip"
|
|
821
|
+
}, {
|
|
822
|
+
default: O(() => [
|
|
823
|
+
I(i(e.basis === "inferred" ? "inferred from quotes" : "✔ verbatim quote"), 1)
|
|
824
|
+
]),
|
|
825
|
+
_: 1
|
|
826
|
+
}, 8, ["variant"])
|
|
827
|
+
]),
|
|
828
|
+
_: 1
|
|
829
|
+
}, 8, ["tooltip"])) : p("", !0)
|
|
830
|
+
]),
|
|
831
|
+
o("p", ma, i(e.reasoning), 1)
|
|
832
|
+
])) : p("", !0),
|
|
833
|
+
o("section", xa, [
|
|
834
|
+
o("div", ha, [
|
|
835
|
+
n[1] || (n[1] = o("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Cited sources ", -1)),
|
|
836
|
+
o("div", ya, i(u(Ce)(e.evidence)), 1)
|
|
837
|
+
]),
|
|
838
|
+
e.evidence.pages.length ? (a(), E(va, {
|
|
839
|
+
key: 0,
|
|
840
|
+
pages: e.evidence.pages,
|
|
841
|
+
collapsible: e.collapsible,
|
|
842
|
+
dense: e.dense
|
|
843
|
+
}, null, 8, ["pages", "collapsible", "dense"])) : e.evidence.unresolved.length ? p("", !0) : (a(), s("p", ba, " No source pages recorded for this data point ")),
|
|
844
|
+
e.evidence.unresolved.length ? (a(), E(u(ge), {
|
|
845
|
+
key: 2,
|
|
846
|
+
variant: "warning",
|
|
847
|
+
class: "tv-unresolved-citations"
|
|
848
|
+
}, {
|
|
849
|
+
default: O(() => [
|
|
850
|
+
I(i(e.evidence.unresolved.length) + " " + i(e.evidence.unresolved.length === 1 ? "citation" : "citations") + " could not be matched to a page in the source documents. The value was kept, but this part of its provenance is unverified. ", 1)
|
|
851
|
+
]),
|
|
852
|
+
_: 1
|
|
853
|
+
})) : p("", !0)
|
|
854
|
+
]),
|
|
855
|
+
e.evidence.apiLogIds.length ? (a(), s("p", wa, [
|
|
856
|
+
I(" Produced by " + i(e.evidence.apiLogIds.length === 1 ? "LLM call" : "LLM calls") + " ", 1),
|
|
857
|
+
o("span", _a, "#" + i(e.evidence.apiLogIds.join(", #")), 1),
|
|
858
|
+
n[2] || (n[2] = I(" — open the Audit trail tab for the full request and response. ", -1))
|
|
859
|
+
])) : p("", !0)
|
|
860
|
+
]));
|
|
861
|
+
}
|
|
862
|
+
}), ka = { class: "tv-modal flex h-full flex-col gap-4 overflow-y-auto p-1" }, $a = { 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" }, Ca = { class: "flex flex-wrap items-start justify-between gap-4" }, Sa = { class: "min-w-0 flex-1" }, Va = { class: "tv-resolved-value mt-1 break-words font-mono text-xl font-semibold leading-snug text-gray-900" }, Na = { class: "mt-1 text-[11px] text-gray-400" }, qa = { class: "tv-resolved-source font-medium text-gray-500" }, Oa = { class: "tv-confidence-meter w-56 shrink-0" }, Ia = { class: "mt-2" }, Da = {
|
|
863
|
+
key: 1,
|
|
864
|
+
class: "tv-confidence-value text-sm text-gray-400"
|
|
865
|
+
}, Ta = {
|
|
386
866
|
key: 0,
|
|
387
|
-
class: "tv-
|
|
388
|
-
},
|
|
389
|
-
key: 3,
|
|
390
|
-
class: "tv-no-source rounded-lg border border-dashed border-gray-200 p-6 text-center text-sm text-gray-400"
|
|
391
|
-
}, Mt = {
|
|
392
|
-
key: 4,
|
|
393
|
-
class: "tv-full-documents flex flex-wrap items-center gap-2"
|
|
394
|
-
}, Pt = {
|
|
867
|
+
class: "tv-tab-evidence flex min-h-0 flex-1 flex-col"
|
|
868
|
+
}, Ea = {
|
|
395
869
|
key: 1,
|
|
396
870
|
class: "tv-tab-candidates flex flex-col gap-3"
|
|
397
|
-
},
|
|
871
|
+
}, La = { class: "flex flex-wrap items-center justify-between gap-3" }, Pa = { class: "min-w-0 flex-1" }, Aa = { class: "flex items-center gap-2" }, za = { class: "mt-2 break-words font-mono text-base text-gray-900" }, ja = { class: "mt-1 text-xs text-gray-400" }, Ra = {
|
|
398
872
|
key: 0,
|
|
399
873
|
class: "tv-custom-entry flex items-center gap-2 rounded-lg border border-dashed border-gray-300 p-4"
|
|
400
|
-
},
|
|
874
|
+
}, Ua = {
|
|
401
875
|
key: 1,
|
|
402
876
|
class: "tv-read-only text-center text-xs text-gray-400"
|
|
403
|
-
},
|
|
877
|
+
}, Ba = {
|
|
878
|
+
key: 2,
|
|
879
|
+
class: "tv-tab-history flex flex-col gap-4"
|
|
880
|
+
}, Ma = { class: "tv-history-current flex flex-col gap-2 rounded-xl border border-green-200 bg-green-50/40 p-4" }, Fa = { class: "flex flex-wrap items-center justify-between gap-3" }, Ya = { class: "flex flex-wrap items-center gap-2" }, Ka = { class: "tv-history-current-value break-words font-mono text-base font-semibold text-gray-900" }, Ha = {
|
|
881
|
+
key: 0,
|
|
882
|
+
class: "tv-history-current-confidence text-xs font-medium text-gray-500"
|
|
883
|
+
}, Ja = {
|
|
884
|
+
key: 1,
|
|
885
|
+
class: "tv-history-current-confidence text-xs text-gray-400"
|
|
886
|
+
}, Ga = {
|
|
887
|
+
key: 0,
|
|
888
|
+
class: "tv-history-current-reasoning text-sm italic leading-relaxed text-gray-600"
|
|
889
|
+
}, Qa = { class: "tv-history-value min-w-0 break-words font-mono text-sm font-semibold text-gray-900" }, Wa = {
|
|
404
890
|
key: 2,
|
|
891
|
+
class: "tv-history-confidence text-xs text-gray-500"
|
|
892
|
+
}, Xa = { class: "tv-history-provenance text-xs text-gray-400" }, Za = { class: "tv-history-timestamp ml-auto text-xs text-gray-400" }, en = {
|
|
893
|
+
key: 3,
|
|
405
894
|
class: "tv-tab-audit flex flex-col gap-3"
|
|
406
|
-
},
|
|
895
|
+
}, tn = {
|
|
407
896
|
key: 2,
|
|
408
897
|
class: "tv-audit-empty rounded-lg border border-dashed border-gray-200 p-6 text-center text-sm text-gray-400"
|
|
409
|
-
},
|
|
898
|
+
}, an = /* @__PURE__ */ Q({
|
|
410
899
|
__name: "VerificationModal",
|
|
411
900
|
props: {
|
|
412
901
|
modelValue: { type: Boolean },
|
|
@@ -416,428 +905,445 @@ const pt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
416
905
|
},
|
|
417
906
|
emits: ["update:modelValue", "saved"],
|
|
418
907
|
setup(e, { emit: t }) {
|
|
419
|
-
const
|
|
420
|
-
get: () =>
|
|
421
|
-
set: (v) =>
|
|
422
|
-
}), l =
|
|
908
|
+
const n = e, w = t, b = pe(), c = Ae(), r = g({
|
|
909
|
+
get: () => n.modelValue,
|
|
910
|
+
set: (v) => w("update:modelValue", v)
|
|
911
|
+
}), l = g(() => ke(n.meta)), _ = g(() => n.meta.candidates.extracted), f = g(() => n.meta.candidates.claim), V = g(() => n.meta.candidates.override), $ = g(() => {
|
|
912
|
+
var v;
|
|
913
|
+
return ((v = _.value) == null ? void 0 : v.confidence) ?? null;
|
|
914
|
+
}), L = g(() => {
|
|
423
915
|
var v;
|
|
424
|
-
return ((v =
|
|
425
|
-
}),
|
|
916
|
+
return ((v = _.value) == null ? void 0 : v.state) === "failed" ? "failed" : _e($.value);
|
|
917
|
+
}), S = g(() => xe(n.meta)), d = g(() => {
|
|
426
918
|
var v;
|
|
427
|
-
return
|
|
428
|
-
}),
|
|
429
|
-
(
|
|
430
|
-
|
|
919
|
+
return oe((v = _.value) == null ? void 0 : v.sources);
|
|
920
|
+
}), m = g(
|
|
921
|
+
() => {
|
|
922
|
+
var v;
|
|
923
|
+
return ((v = _.value) == null ? void 0 : v.history) ?? [];
|
|
924
|
+
}
|
|
925
|
+
), h = g(() => m.value.length > 0), B = g(() => (n.meta.anchor.field_path || n.label || "Data point").split(".").map(
|
|
926
|
+
(x) => x.replace(/\[\d+\]/g, "").replace(/_/g, " ").replace(/^\w/, (z) => z.toUpperCase())
|
|
927
|
+
).join(" › ")), k = {
|
|
431
928
|
high: "success",
|
|
432
929
|
medium: "warning",
|
|
433
930
|
low: "danger",
|
|
434
|
-
unverifiable: "muted"
|
|
435
|
-
|
|
436
|
-
|
|
931
|
+
unverifiable: "muted",
|
|
932
|
+
failed: "danger"
|
|
933
|
+
}, T = j("evidence"), N = g(() => !!b.auditUrl), M = g(() => {
|
|
934
|
+
var x;
|
|
437
935
|
const v = [
|
|
438
936
|
{
|
|
439
937
|
value: "evidence",
|
|
440
|
-
label: "
|
|
441
|
-
count:
|
|
938
|
+
label: "Citations",
|
|
939
|
+
count: d.value.pageCount
|
|
442
940
|
},
|
|
443
941
|
{
|
|
444
942
|
value: "candidates",
|
|
445
943
|
label: "Candidates",
|
|
446
|
-
count:
|
|
944
|
+
count: H.value.length
|
|
447
945
|
}
|
|
448
946
|
];
|
|
449
|
-
return
|
|
947
|
+
return h.value && v.push({
|
|
948
|
+
value: "history",
|
|
949
|
+
label: "History",
|
|
950
|
+
count: m.value.length
|
|
951
|
+
}), N.value && v.push({
|
|
450
952
|
value: "audit",
|
|
451
953
|
label: "Audit trail",
|
|
452
|
-
count: ((
|
|
954
|
+
count: ((x = ee.value) == null ? void 0 : x.length) ?? void 0
|
|
453
955
|
}), v;
|
|
454
|
-
})
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
if (!v) return null;
|
|
459
|
-
const i = T.value.find(
|
|
460
|
-
(f) => f.file && String(f.file.id) === String(v.id)
|
|
461
|
-
);
|
|
462
|
-
if (!i) return null;
|
|
463
|
-
const C = i.sources.find((f) => f.explanation);
|
|
464
|
-
return (C == null ? void 0 : C.explanation) ?? null;
|
|
465
|
-
}), X = d(() => {
|
|
466
|
-
const v = /* @__PURE__ */ new Map();
|
|
467
|
-
for (const i of T.value)
|
|
468
|
-
for (const C of i.sources) {
|
|
469
|
-
const f = C.original_file;
|
|
470
|
-
f && !v.has(String(f.id)) && v.set(String(f.id), f);
|
|
471
|
-
}
|
|
472
|
-
return [...v.values()];
|
|
473
|
-
}), P = N(null), p = d({
|
|
474
|
-
get: () => P.value !== null,
|
|
475
|
-
set: (v) => {
|
|
476
|
-
v || (P.value = null);
|
|
477
|
-
}
|
|
478
|
-
}), _ = d(() => c.value || p.value);
|
|
479
|
-
re(
|
|
480
|
-
_,
|
|
481
|
-
(v) => Ce(v),
|
|
956
|
+
});
|
|
957
|
+
ae(
|
|
958
|
+
r,
|
|
959
|
+
(v) => Ee(v),
|
|
482
960
|
{ immediate: !0 }
|
|
483
|
-
),
|
|
484
|
-
const
|
|
961
|
+
), Qe(() => Ee(!1));
|
|
962
|
+
const H = g(() => {
|
|
485
963
|
const v = [];
|
|
486
|
-
return
|
|
964
|
+
return V.value && v.push({
|
|
487
965
|
key: "override",
|
|
488
966
|
title: "Human override",
|
|
489
967
|
variant: "success",
|
|
490
|
-
value:
|
|
968
|
+
value: V.value.value,
|
|
491
969
|
detail: [
|
|
492
|
-
|
|
493
|
-
|
|
970
|
+
V.value.source_choice ? `basis: ${V.value.source_choice}` : null,
|
|
971
|
+
V.value.set_at ? new Date(V.value.set_at).toLocaleString() : null
|
|
494
972
|
].filter(Boolean).join(" · "),
|
|
495
973
|
winner: l.value.source === "override"
|
|
496
|
-
}),
|
|
974
|
+
}), _.value && v.push({
|
|
497
975
|
key: "extracted",
|
|
498
976
|
title: "Extracted",
|
|
499
|
-
variant:
|
|
500
|
-
value:
|
|
501
|
-
detail:
|
|
502
|
-
accept:
|
|
503
|
-
var
|
|
504
|
-
return
|
|
977
|
+
variant: k[L.value],
|
|
978
|
+
value: _.value.value,
|
|
979
|
+
detail: L.value === "failed" ? _.value.reasoning ? `${G.failed}: ${_.value.reasoning}` : G.failed : $.value != null ? `Confidence ${$.value}/5 · ${G[L.value]}` : "No confidence recorded",
|
|
980
|
+
accept: n.save ? () => {
|
|
981
|
+
var x;
|
|
982
|
+
return X(q((x = _.value) == null ? void 0 : x.value), "extracted");
|
|
505
983
|
} : void 0,
|
|
506
984
|
winner: l.value.source === "extracted"
|
|
507
|
-
}),
|
|
985
|
+
}), f.value && v.push({
|
|
508
986
|
key: "claim",
|
|
509
987
|
title: "Claim",
|
|
510
988
|
variant: "info",
|
|
511
|
-
value:
|
|
512
|
-
detail:
|
|
513
|
-
accept:
|
|
514
|
-
var
|
|
515
|
-
return
|
|
989
|
+
value: f.value.value,
|
|
990
|
+
detail: f.value.claim_set_label ?? "Reference output",
|
|
991
|
+
accept: n.save ? () => {
|
|
992
|
+
var x;
|
|
993
|
+
return X(q((x = f.value) == null ? void 0 : x.value), "claim");
|
|
516
994
|
} : void 0,
|
|
517
995
|
winner: l.value.source === "claim"
|
|
518
996
|
}), v;
|
|
519
|
-
}),
|
|
520
|
-
async function
|
|
521
|
-
if (!(!
|
|
522
|
-
|
|
997
|
+
}), J = j(""), Y = j(!1);
|
|
998
|
+
async function X(v, x) {
|
|
999
|
+
if (!(!n.save || Y.value)) {
|
|
1000
|
+
Y.value = !0;
|
|
523
1001
|
try {
|
|
524
|
-
const
|
|
525
|
-
|
|
526
|
-
} catch (
|
|
527
|
-
console.error("template-verification: save failed",
|
|
1002
|
+
const z = await n.save(v, x);
|
|
1003
|
+
w("saved", z), c.success(`Verified — ${B.value} locked in`);
|
|
1004
|
+
} catch (z) {
|
|
1005
|
+
console.error("template-verification: save failed", z), c.danger(`Could not save ${B.value} — try again`);
|
|
528
1006
|
} finally {
|
|
529
|
-
|
|
1007
|
+
Y.value = !1;
|
|
530
1008
|
}
|
|
531
1009
|
}
|
|
532
1010
|
}
|
|
533
|
-
const
|
|
534
|
-
function
|
|
1011
|
+
const y = () => X(J.value, "custom");
|
|
1012
|
+
function q(v) {
|
|
535
1013
|
return v == null ? null : String(v);
|
|
536
1014
|
}
|
|
537
|
-
function
|
|
1015
|
+
function P(v) {
|
|
538
1016
|
return v == null ? "—" : String(v);
|
|
539
1017
|
}
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
1018
|
+
const Z = (v, x) => String(v.id ?? `attempt-${x}`), ue = g(
|
|
1019
|
+
() => m.value.map((v, x) => ({
|
|
1020
|
+
value: Z(v, x),
|
|
1021
|
+
label: P(v.value)
|
|
1022
|
+
}))
|
|
1023
|
+
), te = j([]);
|
|
1024
|
+
ae(
|
|
1025
|
+
m,
|
|
1026
|
+
(v) => {
|
|
1027
|
+
const x = v.findIndex((C) => C.is_chosen), z = x === -1 ? v.length - 1 : x;
|
|
1028
|
+
te.value = z >= 0 ? [Z(v[z], z)] : [];
|
|
1029
|
+
},
|
|
1030
|
+
{ immediate: !0 }
|
|
1031
|
+
);
|
|
1032
|
+
const R = g(
|
|
1033
|
+
() => new Map(
|
|
1034
|
+
m.value.map((v, x) => [Z(v, x), v])
|
|
1035
|
+
)
|
|
1036
|
+
);
|
|
1037
|
+
function He(v) {
|
|
1038
|
+
return v.created_at ? new Date(v.created_at).toLocaleString() : "—";
|
|
1039
|
+
}
|
|
1040
|
+
function Je(v) {
|
|
1041
|
+
return Ce(oe(v.sources));
|
|
1042
|
+
}
|
|
1043
|
+
function Ge(v) {
|
|
1044
|
+
return v.is_chosen ? null : v.reasoning ?? null;
|
|
1045
|
+
}
|
|
1046
|
+
const ee = j(null), de = j(!1), ce = j(null);
|
|
1047
|
+
return ae(
|
|
1048
|
+
[T, r],
|
|
1049
|
+
async ([v, x]) => {
|
|
1050
|
+
if (!(v !== "audit" || !x || ee.value !== null || de.value) && b.auditUrl) {
|
|
1051
|
+
de.value = !0, ce.value = null;
|
|
546
1052
|
try {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
1053
|
+
ee.value = await _t(
|
|
1054
|
+
b.auditUrl,
|
|
1055
|
+
n.meta.anchor
|
|
550
1056
|
);
|
|
551
|
-
} catch (
|
|
552
|
-
|
|
1057
|
+
} catch (z) {
|
|
1058
|
+
ce.value = z instanceof Error ? z.message : String(z);
|
|
553
1059
|
} finally {
|
|
554
|
-
|
|
1060
|
+
de.value = !1;
|
|
555
1061
|
}
|
|
556
1062
|
}
|
|
557
1063
|
},
|
|
558
1064
|
{ immediate: !0 }
|
|
559
|
-
), (v,
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
s("span", Vt, m(l.value.source), 1)
|
|
581
|
-
])
|
|
582
|
-
]),
|
|
583
|
-
s("div", Dt, [
|
|
584
|
-
V(r(ve), {
|
|
585
|
-
tooltip: "How certain the AI was when it extracted this value — not whether the quote below was checked against the source (see the Evidence tab's own badge for that).",
|
|
586
|
-
placement: "top"
|
|
587
|
-
}, {
|
|
588
|
-
trigger: O(() => [...i[7] || (i[7] = [
|
|
589
|
-
s("div", { class: "w-fit text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Extraction confidence ", -1)
|
|
590
|
-
])]),
|
|
591
|
-
_: 1
|
|
592
|
-
}),
|
|
593
|
-
s("div", Ot, [
|
|
594
|
-
y.value != null ? (n(), A(r(De), {
|
|
595
|
-
key: 0,
|
|
596
|
-
value: y.value,
|
|
597
|
-
max: 5,
|
|
598
|
-
size: "md",
|
|
599
|
-
variant: Z[$.value],
|
|
600
|
-
gradient: "",
|
|
601
|
-
shimmer: "",
|
|
602
|
-
"show-text": "",
|
|
603
|
-
"text-position": "beside",
|
|
604
|
-
label: `${y.value}/5`
|
|
605
|
-
}, null, 8, ["value", "variant", "label"])) : (n(), o("div", It, " No confidence recorded "))
|
|
606
|
-
]),
|
|
607
|
-
s("div", {
|
|
608
|
-
class: R(["tv-confidence-label mt-1 text-right text-xs font-medium", {
|
|
609
|
-
"text-green-600": $.value === "high",
|
|
610
|
-
"text-yellow-600": $.value === "medium",
|
|
611
|
-
"text-red-600": $.value === "low",
|
|
612
|
-
"text-gray-400": $.value === "unverifiable"
|
|
613
|
-
}])
|
|
614
|
-
}, m(r(ie)[$.value]), 3)
|
|
1065
|
+
), (v, x) => (a(), E(u(be), {
|
|
1066
|
+
modelValue: r.value,
|
|
1067
|
+
"onUpdate:modelValue": x[3] || (x[3] = (z) => r.value = z),
|
|
1068
|
+
title: B.value,
|
|
1069
|
+
width: 90,
|
|
1070
|
+
height: 90,
|
|
1071
|
+
"close-x": "",
|
|
1072
|
+
class: A(u(W))
|
|
1073
|
+
}, {
|
|
1074
|
+
default: O(() => {
|
|
1075
|
+
var z;
|
|
1076
|
+
return [
|
|
1077
|
+
o("div", ka, [
|
|
1078
|
+
o("section", $a, [
|
|
1079
|
+
o("div", Ca, [
|
|
1080
|
+
o("div", Sa, [
|
|
1081
|
+
x[5] || (x[5] = o("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Resolved value ", -1)),
|
|
1082
|
+
o("div", Va, i(P(l.value.value)), 1),
|
|
1083
|
+
o("div", Na, [
|
|
1084
|
+
x[4] || (x[4] = I(" source of truth: ", -1)),
|
|
1085
|
+
o("span", qa, i(l.value.source), 1)
|
|
615
1086
|
])
|
|
616
1087
|
]),
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
}, {
|
|
622
|
-
default: O(() => [...i[8] || (i[8] = [
|
|
623
|
-
I(" Sources disagree on this value — review the candidates and pick a winner. ", -1)
|
|
624
|
-
])]),
|
|
625
|
-
_: 1
|
|
626
|
-
})) : b("", !0)
|
|
627
|
-
]),
|
|
628
|
-
V(r(Fe), {
|
|
629
|
-
modelValue: M.value,
|
|
630
|
-
"onUpdate:modelValue": i[0] || (i[0] = (f) => M.value = f),
|
|
631
|
-
tabs: ee.value,
|
|
632
|
-
class: "tv-modal-tabs"
|
|
633
|
-
}, null, 8, ["modelValue", "tabs"]),
|
|
634
|
-
M.value === "evidence" ? (n(), o("section", Tt, [
|
|
635
|
-
S.value ? (n(), o("div", At, [
|
|
636
|
-
i[9] || (i[9] = s("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Reasoning ", -1)),
|
|
637
|
-
V(r(qe), {
|
|
638
|
-
"model-value": S.value,
|
|
639
|
-
readonly: "",
|
|
640
|
-
class: "tv-reasoning"
|
|
641
|
-
}, null, 8, ["model-value"])
|
|
642
|
-
])) : b("", !0),
|
|
643
|
-
U.value ? (n(), o("div", Ut, [
|
|
644
|
-
i[10] || (i[10] = s("div", { class: "mb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, [
|
|
645
|
-
I(" Source quote "),
|
|
646
|
-
s("span", { class: "font-normal normal-case text-gray-400" }, "— the raw text as written in the document below, not the cleaned-up resolved value above")
|
|
647
|
-
], -1)),
|
|
648
|
-
s("blockquote", Nt, [
|
|
649
|
-
I(" “" + m(U.value) + "” ", 1),
|
|
650
|
-
V(r(ve), {
|
|
651
|
-
tooltip: (C = h.value) != null && C.cited_text_verified ? "This exact wording was mechanically found in the source document — independent of the AI's extraction confidence above." : "This quote could not be mechanically matched verbatim against the source document — it may be paraphrased or OCR-garbled.",
|
|
652
|
-
placement: "top"
|
|
653
|
-
}, {
|
|
654
|
-
trigger: O(() => {
|
|
655
|
-
var f;
|
|
656
|
-
return [
|
|
657
|
-
V(r(H), {
|
|
658
|
-
variant: (f = h.value) != null && f.cited_text_verified ? "success" : "muted",
|
|
659
|
-
size: "xxs",
|
|
660
|
-
class: "tv-cited-verified ml-2 not-italic"
|
|
661
|
-
}, {
|
|
662
|
-
default: O(() => {
|
|
663
|
-
var ue;
|
|
664
|
-
return [
|
|
665
|
-
I(m((ue = h.value) != null && ue.cited_text_verified ? "✔ quote matches source" : "quote unmatched"), 1)
|
|
666
|
-
];
|
|
667
|
-
}),
|
|
668
|
-
_: 1
|
|
669
|
-
}, 8, ["variant"])
|
|
670
|
-
];
|
|
671
|
-
}),
|
|
672
|
-
_: 1
|
|
673
|
-
}, 8, ["tooltip"])
|
|
674
|
-
])
|
|
675
|
-
])) : b("", !0),
|
|
676
|
-
E.value.length ? (n(), o("div", Rt, [
|
|
677
|
-
s("div", jt, [
|
|
678
|
-
i[11] || (i[11] = s("span", null, "Source pages", -1)),
|
|
679
|
-
s("span", Et, m(E.value.length) + " page" + m(E.value.length === 1 ? "" : "s") + " cited", 1)
|
|
680
|
-
]),
|
|
681
|
-
V(r($e), {
|
|
682
|
-
file: E.value[0],
|
|
683
|
-
"file-in-preview": K.value,
|
|
684
|
-
"onUpdate:fileInPreview": i[1] || (i[1] = (f) => K.value = f),
|
|
685
|
-
"related-files": E.value,
|
|
686
|
-
"layout-toggles": ["continuous"],
|
|
687
|
-
sidebar: "",
|
|
688
|
-
zoomable: "",
|
|
689
|
-
"storage-key": "tv-evidence-viewer",
|
|
690
|
-
class: "h-full min-h-0 flex-1"
|
|
691
|
-
}, null, 8, ["file", "file-in-preview", "related-files"]),
|
|
692
|
-
W.value ? (n(), o("div", Lt, m(W.value), 1)) : b("", !0)
|
|
693
|
-
])) : (n(), o("div", zt, " No source pages recorded for this data point ")),
|
|
694
|
-
X.value.length ? (n(), o("div", Mt, [
|
|
695
|
-
i[12] || (i[12] = s("span", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, "Full documents:", -1)),
|
|
696
|
-
(n(!0), o(j, null, F(X.value, (f) => (n(), A(r(de), {
|
|
697
|
-
key: String(f.id),
|
|
698
|
-
size: "sm",
|
|
699
|
-
variant: "info",
|
|
700
|
-
class: "tv-open-document",
|
|
701
|
-
onClick: (ue) => P.value = f
|
|
1088
|
+
o("div", Oa, [
|
|
1089
|
+
D(u(we), {
|
|
1090
|
+
tooltip: "How certain the AI was when it extracted this value — not whether the quotes in the Citations tab were checked against the source (that tab's own badge says so).",
|
|
1091
|
+
placement: "top"
|
|
702
1092
|
}, {
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
]),
|
|
706
|
-
_:
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
M.value === "candidates" ? (n(), o("section", Pt, [
|
|
711
|
-
(n(!0), o(j, null, F(D.value, (f) => (n(), o("div", {
|
|
712
|
-
key: f.key,
|
|
713
|
-
class: R(["tv-candidate-row rounded-lg border p-4 transition-shadow", [
|
|
714
|
-
f.winner ? "border-gray-300 bg-gray-50 shadow-sm" : "border-gray-200",
|
|
715
|
-
e.meta.discrepancy && !f.winner ? "tv-candidate-disagrees border-amber-200" : ""
|
|
716
|
-
]])
|
|
717
|
-
}, [
|
|
718
|
-
s("div", Bt, [
|
|
719
|
-
s("div", Ft, [
|
|
720
|
-
s("div", qt, [
|
|
721
|
-
V(r(H), {
|
|
722
|
-
variant: f.variant,
|
|
723
|
-
size: "xs"
|
|
724
|
-
}, {
|
|
725
|
-
default: O(() => [
|
|
726
|
-
I(m(f.title), 1)
|
|
727
|
-
]),
|
|
728
|
-
_: 2
|
|
729
|
-
}, 1032, ["variant"]),
|
|
730
|
-
f.winner ? (n(), A(r(H), {
|
|
731
|
-
key: 0,
|
|
732
|
-
variant: "success",
|
|
733
|
-
size: "xxs",
|
|
734
|
-
class: "tv-winner-chip"
|
|
735
|
-
}, {
|
|
736
|
-
default: O(() => [...i[13] || (i[13] = [
|
|
737
|
-
I("current value", -1)
|
|
738
|
-
])]),
|
|
739
|
-
_: 1
|
|
740
|
-
})) : b("", !0)
|
|
741
|
-
]),
|
|
742
|
-
s("div", Yt, m(he(f.value)), 1),
|
|
743
|
-
s("div", Ht, m(f.detail), 1)
|
|
744
|
-
]),
|
|
745
|
-
f.accept && !f.winner ? (n(), A(r(de), {
|
|
1093
|
+
trigger: O(() => [...x[6] || (x[6] = [
|
|
1094
|
+
o("div", { class: "w-fit text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Extraction confidence ", -1)
|
|
1095
|
+
])]),
|
|
1096
|
+
_: 1
|
|
1097
|
+
}),
|
|
1098
|
+
o("div", Ia, [
|
|
1099
|
+
$.value != null ? (a(), E(u(ze), {
|
|
746
1100
|
key: 0,
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
1101
|
+
value: $.value,
|
|
1102
|
+
max: 5,
|
|
1103
|
+
size: "md",
|
|
1104
|
+
variant: k[L.value],
|
|
1105
|
+
gradient: "",
|
|
1106
|
+
shimmer: "",
|
|
1107
|
+
"show-text": "",
|
|
1108
|
+
"text-position": "beside",
|
|
1109
|
+
label: `${$.value}/5`
|
|
1110
|
+
}, null, 8, ["value", "variant", "label"])) : (a(), s("div", Da, " No confidence recorded "))
|
|
1111
|
+
]),
|
|
1112
|
+
o("div", {
|
|
1113
|
+
class: A(["tv-confidence-label mt-1 text-right text-xs font-medium", {
|
|
1114
|
+
"text-green-600": L.value === "high",
|
|
1115
|
+
"text-yellow-600": L.value === "medium",
|
|
1116
|
+
"text-red-600": L.value === "low",
|
|
1117
|
+
"text-gray-400": L.value === "unverifiable",
|
|
1118
|
+
"text-red-800": L.value === "failed"
|
|
1119
|
+
}])
|
|
1120
|
+
}, i(u(G)[L.value]), 3)
|
|
1121
|
+
])
|
|
1122
|
+
]),
|
|
1123
|
+
e.meta.discrepancy ? (a(), E(u(ge), {
|
|
1124
|
+
key: 0,
|
|
1125
|
+
variant: "warning",
|
|
1126
|
+
class: "tv-discrepancy"
|
|
1127
|
+
}, {
|
|
1128
|
+
default: O(() => [...x[7] || (x[7] = [
|
|
1129
|
+
I(" Sources disagree on this value — review the candidates and pick a winner. ", -1)
|
|
1130
|
+
])]),
|
|
1131
|
+
_: 1
|
|
1132
|
+
})) : p("", !0)
|
|
1133
|
+
]),
|
|
1134
|
+
D(u(at), {
|
|
1135
|
+
modelValue: T.value,
|
|
1136
|
+
"onUpdate:modelValue": x[0] || (x[0] = (C) => T.value = C),
|
|
1137
|
+
tabs: M.value,
|
|
1138
|
+
class: "tv-modal-tabs"
|
|
1139
|
+
}, null, 8, ["modelValue", "tabs"]),
|
|
1140
|
+
T.value === "evidence" ? (a(), s("section", Ta, [
|
|
1141
|
+
D(Pe, {
|
|
1142
|
+
evidence: d.value,
|
|
1143
|
+
reasoning: S.value,
|
|
1144
|
+
basis: (z = _.value) == null ? void 0 : z.basis,
|
|
1145
|
+
failed: L.value === "failed"
|
|
1146
|
+
}, null, 8, ["evidence", "reasoning", "basis", "failed"])
|
|
1147
|
+
])) : p("", !0),
|
|
1148
|
+
T.value === "candidates" ? (a(), s("section", Ea, [
|
|
1149
|
+
(a(!0), s(U, null, F(H.value, (C) => (a(), s("div", {
|
|
1150
|
+
key: C.key,
|
|
1151
|
+
class: A(["tv-candidate-row rounded-lg border p-4 transition-shadow", [
|
|
1152
|
+
C.winner ? "border-gray-300 bg-gray-50 shadow-sm" : "border-gray-200",
|
|
1153
|
+
e.meta.discrepancy && !C.winner ? "tv-candidate-disagrees border-amber-200" : ""
|
|
1154
|
+
]])
|
|
1155
|
+
}, [
|
|
1156
|
+
o("div", La, [
|
|
1157
|
+
o("div", Pa, [
|
|
1158
|
+
o("div", Aa, [
|
|
1159
|
+
D(u(K), {
|
|
1160
|
+
variant: C.variant,
|
|
1161
|
+
size: "xs"
|
|
1162
|
+
}, {
|
|
1163
|
+
default: O(() => [
|
|
1164
|
+
I(i(C.title), 1)
|
|
1165
|
+
]),
|
|
1166
|
+
_: 2
|
|
1167
|
+
}, 1032, ["variant"]),
|
|
1168
|
+
C.winner ? (a(), E(u(K), {
|
|
1169
|
+
key: 0,
|
|
1170
|
+
variant: "success",
|
|
1171
|
+
size: "xxs",
|
|
1172
|
+
class: "tv-winner-chip"
|
|
1173
|
+
}, {
|
|
1174
|
+
default: O(() => [...x[8] || (x[8] = [
|
|
1175
|
+
I("current value", -1)
|
|
1176
|
+
])]),
|
|
1177
|
+
_: 1
|
|
1178
|
+
})) : p("", !0)
|
|
1179
|
+
]),
|
|
1180
|
+
o("div", za, i(P(C.value)), 1),
|
|
1181
|
+
o("div", ja, i(C.detail), 1)
|
|
1182
|
+
]),
|
|
1183
|
+
C.accept && !C.winner ? (a(), E(u(ie), {
|
|
1184
|
+
key: 0,
|
|
771
1185
|
size: "sm",
|
|
772
|
-
|
|
773
|
-
loading:
|
|
774
|
-
|
|
775
|
-
onClick:
|
|
1186
|
+
variant: C.variant,
|
|
1187
|
+
loading: Y.value,
|
|
1188
|
+
class: A(`tv-accept-${C.key}`),
|
|
1189
|
+
onClick: C.accept
|
|
776
1190
|
}, {
|
|
777
|
-
default: O(() => [...
|
|
778
|
-
I("
|
|
1191
|
+
default: O(() => [...x[9] || (x[9] = [
|
|
1192
|
+
I("Accept this value", -1)
|
|
779
1193
|
])]),
|
|
780
1194
|
_: 1
|
|
781
|
-
}, 8, ["loading", "
|
|
782
|
-
])
|
|
783
|
-
]))
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
1195
|
+
}, 8, ["variant", "loading", "class", "onClick"])) : p("", !0)
|
|
1196
|
+
])
|
|
1197
|
+
], 2))), 128)),
|
|
1198
|
+
e.save ? (a(), s("div", Ra, [
|
|
1199
|
+
D(u(nt), {
|
|
1200
|
+
modelValue: J.value,
|
|
1201
|
+
"onUpdate:modelValue": x[1] || (x[1] = (C) => J.value = C),
|
|
1202
|
+
size: "sm",
|
|
1203
|
+
class: "tv-custom-input flex-1",
|
|
1204
|
+
placeholder: "Type the correct value…",
|
|
1205
|
+
disabled: Y.value
|
|
1206
|
+
}, null, 8, ["modelValue", "disabled"]),
|
|
1207
|
+
D(u(ie), {
|
|
1208
|
+
variant: "success",
|
|
1209
|
+
size: "sm",
|
|
1210
|
+
class: "tv-accept-custom",
|
|
1211
|
+
loading: Y.value,
|
|
1212
|
+
disabled: !J.value,
|
|
1213
|
+
onClick: y
|
|
793
1214
|
}, {
|
|
794
|
-
default: O(() => [
|
|
795
|
-
I("
|
|
796
|
-
]),
|
|
1215
|
+
default: O(() => [...x[10] || (x[10] = [
|
|
1216
|
+
I("Save custom value", -1)
|
|
1217
|
+
])]),
|
|
797
1218
|
_: 1
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
1219
|
+
}, 8, ["loading", "disabled"])
|
|
1220
|
+
])) : (a(), s("div", Ua, " Read-only render — corrections are disabled here "))
|
|
1221
|
+
])) : p("", !0),
|
|
1222
|
+
T.value === "history" ? (a(), s("section", Ba, [
|
|
1223
|
+
o("section", Ma, [
|
|
1224
|
+
o("div", Fa, [
|
|
1225
|
+
o("div", Ya, [
|
|
1226
|
+
D(u(K), {
|
|
1227
|
+
variant: "success",
|
|
1228
|
+
size: "xxs"
|
|
1229
|
+
}, {
|
|
1230
|
+
default: O(() => [...x[11] || (x[11] = [
|
|
1231
|
+
I("current value", -1)
|
|
1232
|
+
])]),
|
|
1233
|
+
_: 1
|
|
1234
|
+
}),
|
|
1235
|
+
o("span", Ka, i(P(l.value.value)), 1)
|
|
1236
|
+
]),
|
|
1237
|
+
$.value != null ? (a(), s("span", Ha, "Confidence " + i($.value) + "/5 · " + i(u(G)[L.value]), 1)) : (a(), s("span", Ja, i(u(G)[L.value]), 1))
|
|
1238
|
+
]),
|
|
1239
|
+
S.value ? (a(), s("p", Ga, i(S.value), 1)) : p("", !0)
|
|
1240
|
+
]),
|
|
1241
|
+
x[13] || (x[13] = o("div", { class: "flex flex-wrap items-baseline justify-between gap-2" }, [
|
|
1242
|
+
o("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Every recorded attempt "),
|
|
1243
|
+
o("div", { class: "text-xs text-gray-400" }, "oldest first")
|
|
1244
|
+
], -1)),
|
|
1245
|
+
D(Ke, {
|
|
1246
|
+
modelValue: te.value,
|
|
1247
|
+
"onUpdate:modelValue": x[2] || (x[2] = (C) => te.value = C),
|
|
1248
|
+
items: ue.value,
|
|
1249
|
+
"id-prefix": "tv-attempt",
|
|
1250
|
+
class: "tv-history-accordion overflow-hidden rounded-lg border border-gray-200"
|
|
1251
|
+
}, {
|
|
1252
|
+
header: O(({ item: C }) => {
|
|
1253
|
+
var ne, le, se, Se, Ve, Ne, qe;
|
|
1254
|
+
return [
|
|
1255
|
+
o("span", {
|
|
1256
|
+
class: A([
|
|
1257
|
+
"tv-history-row flex min-w-0 flex-1 flex-wrap items-center gap-2 text-left",
|
|
1258
|
+
(ne = R.value.get(C.value)) != null && ne.is_chosen ? "tv-history-chosen" : ""
|
|
1259
|
+
])
|
|
1260
|
+
}, [
|
|
1261
|
+
(le = R.value.get(C.value)) != null && le.is_chosen ? (a(), E(u(K), {
|
|
1262
|
+
key: 0,
|
|
1263
|
+
variant: "success",
|
|
1264
|
+
size: "xxs",
|
|
1265
|
+
class: "tv-history-chosen-chip"
|
|
1266
|
+
}, {
|
|
1267
|
+
default: O(() => [...x[12] || (x[12] = [
|
|
1268
|
+
I("chosen", -1)
|
|
1269
|
+
])]),
|
|
1270
|
+
_: 1
|
|
1271
|
+
})) : p("", !0),
|
|
1272
|
+
o("span", Qa, i(P((se = R.value.get(C.value)) == null ? void 0 : se.value)), 1),
|
|
1273
|
+
(Se = R.value.get(C.value)) != null && Se.state ? (a(), E(u(K), {
|
|
1274
|
+
key: 1,
|
|
1275
|
+
variant: ((Ve = R.value.get(C.value)) == null ? void 0 : Ve.state) === "failed" ? "danger" : "muted",
|
|
1276
|
+
size: "xxs",
|
|
1277
|
+
class: "tv-history-state"
|
|
1278
|
+
}, {
|
|
1279
|
+
default: O(() => {
|
|
1280
|
+
var Oe;
|
|
1281
|
+
return [
|
|
1282
|
+
I(i((Oe = R.value.get(C.value)) == null ? void 0 : Oe.state), 1)
|
|
1283
|
+
];
|
|
1284
|
+
}),
|
|
1285
|
+
_: 2
|
|
1286
|
+
}, 1032, ["variant"])) : p("", !0),
|
|
1287
|
+
((Ne = R.value.get(C.value)) == null ? void 0 : Ne.confidence) != null ? (a(), s("span", Wa, i((qe = R.value.get(C.value)) == null ? void 0 : qe.confidence) + "/5", 1)) : p("", !0),
|
|
1288
|
+
o("span", Xa, i(Je(
|
|
1289
|
+
R.value.get(C.value)
|
|
1290
|
+
)), 1),
|
|
1291
|
+
o("span", Za, i(He(R.value.get(C.value))), 1)
|
|
1292
|
+
], 2)
|
|
1293
|
+
];
|
|
1294
|
+
}),
|
|
1295
|
+
panel: O(({ item: C }) => {
|
|
1296
|
+
var ne, le, se;
|
|
1297
|
+
return [
|
|
1298
|
+
D(Pe, {
|
|
1299
|
+
evidence: u(oe)(
|
|
1300
|
+
(ne = R.value.get(C.value)) == null ? void 0 : ne.sources
|
|
1301
|
+
),
|
|
1302
|
+
reasoning: Ge(R.value.get(C.value)),
|
|
1303
|
+
basis: (le = R.value.get(C.value)) == null ? void 0 : le.basis,
|
|
1304
|
+
failed: ((se = R.value.get(C.value)) == null ? void 0 : se.state) === "failed",
|
|
1305
|
+
collapsible: !1,
|
|
1306
|
+
dense: ""
|
|
1307
|
+
}, null, 8, ["evidence", "reasoning", "basis", "failed"])
|
|
1308
|
+
];
|
|
1309
|
+
}),
|
|
1310
|
+
_: 1
|
|
1311
|
+
}, 8, ["modelValue", "items"])
|
|
1312
|
+
])) : p("", !0),
|
|
1313
|
+
T.value === "audit" ? (a(), s("section", en, [
|
|
1314
|
+
de.value ? (a(), s(U, { key: 0 }, F(2, (C) => D(u(je), {
|
|
1315
|
+
key: C,
|
|
1316
|
+
shape: "rounded",
|
|
1317
|
+
class: "tv-audit-skeleton h-24 w-full"
|
|
1318
|
+
})), 64)) : ce.value ? (a(), E(u(ge), {
|
|
1319
|
+
key: 1,
|
|
1320
|
+
variant: "danger",
|
|
1321
|
+
class: "tv-audit-error"
|
|
1322
|
+
}, {
|
|
1323
|
+
default: O(() => [
|
|
1324
|
+
I(" Could not load the audit trail: " + i(ce.value), 1)
|
|
1325
|
+
]),
|
|
1326
|
+
_: 1
|
|
1327
|
+
})) : ee.value && ee.value.length === 0 ? (a(), s("div", tn, " No LLM calls recorded for this data point ")) : ee.value ? (a(!0), s(U, { key: 3 }, F(ee.value, (C) => (a(), E(jt, {
|
|
1328
|
+
key: String(C.id),
|
|
1329
|
+
call: C
|
|
1330
|
+
}, null, 8, ["call"]))), 128)) : p("", !0)
|
|
1331
|
+
])) : p("", !0)
|
|
1332
|
+
])
|
|
1333
|
+
];
|
|
1334
|
+
}),
|
|
1335
|
+
_: 1
|
|
1336
|
+
}, 8, ["modelValue", "title", "class"]));
|
|
831
1337
|
}
|
|
832
|
-
}),
|
|
1338
|
+
}), nn = ["contenteditable", "data-editable"], ln = {
|
|
833
1339
|
key: 1,
|
|
834
1340
|
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",
|
|
835
1341
|
"data-status": "verified"
|
|
836
|
-
},
|
|
1342
|
+
}, sn = {
|
|
837
1343
|
key: 2,
|
|
838
1344
|
class: "tv-discrepancy-indicator ml-0.5 text-amber-500",
|
|
839
1345
|
"aria-label": "discrepancy"
|
|
840
|
-
},
|
|
1346
|
+
}, Bn = /* @__PURE__ */ Q({
|
|
841
1347
|
__name: "VerifiedField",
|
|
842
1348
|
props: {
|
|
843
1349
|
source: {},
|
|
@@ -846,234 +1352,301 @@ const pt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
846
1352
|
format: { type: Function }
|
|
847
1353
|
},
|
|
848
1354
|
setup(e) {
|
|
849
|
-
const t = e,
|
|
850
|
-
var
|
|
851
|
-
return
|
|
852
|
-
}), l =
|
|
1355
|
+
const t = e, n = pe(), w = g(() => n.enabled.value), b = g(() => n.loading), c = j(null), r = g(() => {
|
|
1356
|
+
var y;
|
|
1357
|
+
return c.value ? c.value : t.source && t.field ? ((y = t.source.__meta) == null ? void 0 : y[t.field]) ?? null : null;
|
|
1358
|
+
}), l = g(() => ke(r.value)), _ = g(() => {
|
|
853
1359
|
if (t.original !== void 0 && t.original !== null)
|
|
854
1360
|
return t.original;
|
|
855
|
-
if (
|
|
1361
|
+
if (r.value && l.value.value !== null && l.value.value !== void 0)
|
|
856
1362
|
return l.value.value;
|
|
857
1363
|
if (t.source && t.field) return t.source[t.field];
|
|
858
|
-
}),
|
|
859
|
-
const
|
|
860
|
-
return
|
|
861
|
-
}),
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
if (
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
1364
|
+
}), f = g(() => {
|
|
1365
|
+
const y = _.value;
|
|
1366
|
+
return y == null ? "" : typeof t.format == "function" ? t.format(y) : String(y);
|
|
1367
|
+
}), V = g(() => {
|
|
1368
|
+
var q, P;
|
|
1369
|
+
const y = (P = (q = r.value) == null ? void 0 : q.candidates) == null ? void 0 : P.extracted;
|
|
1370
|
+
return (y == null ? void 0 : y.state) === "failed" ? "failed" : _e(y == null ? void 0 : y.confidence);
|
|
1371
|
+
}), $ = g(() => Fe(r.value)), L = g(() => {
|
|
1372
|
+
var y, q;
|
|
1373
|
+
return !!((q = (y = r.value) == null ? void 0 : y.candidates) != null && q.override);
|
|
1374
|
+
}), S = g(() => {
|
|
1375
|
+
var q;
|
|
1376
|
+
const y = (q = r.value) == null ? void 0 : q.candidates;
|
|
1377
|
+
return !!(y != null && y.override || y != null && y.extracted || y != null && y.claim);
|
|
1378
|
+
}), d = g(() => w.value), m = g(() => !!r.value), h = g(() => {
|
|
1379
|
+
const y = r.value;
|
|
1380
|
+
return d.value && !!y && Ye(y);
|
|
1381
|
+
}), B = g(() => {
|
|
1382
|
+
var ue, te, R;
|
|
1383
|
+
const y = (te = (ue = r.value) == null ? void 0 : ue.candidates) == null ? void 0 : te.extracted;
|
|
1384
|
+
if (!y) return "No verification data";
|
|
1385
|
+
if (V.value === "failed")
|
|
1386
|
+
return y.reasoning ? `${G.failed}: ${y.reasoning}` : G.failed;
|
|
1387
|
+
const q = [], P = G[V.value];
|
|
1388
|
+
q.push(
|
|
1389
|
+
y.confidence != null ? `${P} (${y.confidence}/5)` : P
|
|
883
1390
|
);
|
|
884
|
-
const
|
|
885
|
-
return
|
|
1391
|
+
const Z = ((R = y.sources) == null ? void 0 : R.length) ?? 0;
|
|
1392
|
+
return Z > 0 && q.push(`${Z} source ${Z === 1 ? "page" : "pages"}`), $.value && q.push("sources disagree"), q.join(" · ");
|
|
886
1393
|
});
|
|
887
|
-
function
|
|
888
|
-
var
|
|
889
|
-
|
|
1394
|
+
function k(y) {
|
|
1395
|
+
var q;
|
|
1396
|
+
c.value = y, (q = t.source) != null && q.__meta && t.field && (t.source.__meta[t.field] = y);
|
|
890
1397
|
}
|
|
891
|
-
const
|
|
892
|
-
function
|
|
893
|
-
|
|
1398
|
+
const T = g(() => ht(n, r, k)), N = g(() => !!T.value), M = j(!1), H = j(!1);
|
|
1399
|
+
function J() {
|
|
1400
|
+
r.value && (M.value = !0);
|
|
894
1401
|
}
|
|
895
|
-
const
|
|
896
|
-
async function
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
!
|
|
1402
|
+
const Y = g(() => m.value);
|
|
1403
|
+
async function X(y) {
|
|
1404
|
+
H.value = !1;
|
|
1405
|
+
const P = (y.target.textContent ?? "").trim();
|
|
1406
|
+
!T.value || P === f.value || await T.value(P, "custom");
|
|
900
1407
|
}
|
|
901
|
-
return (
|
|
902
|
-
class:
|
|
1408
|
+
return (y, q) => (a(), s("span", {
|
|
1409
|
+
class: A(["tv-field inline-flex items-baseline gap-1", h.value ? "tv-needs-review" : ""])
|
|
903
1410
|
}, [
|
|
904
|
-
|
|
1411
|
+
b.value ? (a(), E(u(je), {
|
|
905
1412
|
key: 0,
|
|
906
1413
|
shape: "rounded",
|
|
907
1414
|
class: "tv-field-skeleton inline-block h-[1em] w-16 align-middle"
|
|
908
|
-
})) : (
|
|
909
|
-
|
|
910
|
-
class:
|
|
1415
|
+
})) : (a(), s(U, { key: 1 }, [
|
|
1416
|
+
o("span", {
|
|
1417
|
+
class: A([
|
|
911
1418
|
"tv-field-value",
|
|
912
|
-
|
|
1419
|
+
d.value && !S.value ? "tv-field-unverified cursor-pointer border-b border-dotted border-gray-300" : ""
|
|
913
1420
|
]),
|
|
914
|
-
contenteditable:
|
|
915
|
-
"data-editable":
|
|
916
|
-
onFocus:
|
|
917
|
-
onBlur:
|
|
918
|
-
onKeydown:
|
|
919
|
-
onClick:
|
|
1421
|
+
contenteditable: N.value,
|
|
1422
|
+
"data-editable": N.value ? "true" : "false",
|
|
1423
|
+
onFocus: q[0] || (q[0] = (P) => H.value = !0),
|
|
1424
|
+
onBlur: X,
|
|
1425
|
+
onKeydown: q[1] || (q[1] = We(ve((P) => P.target.blur(), ["prevent"]), ["enter"])),
|
|
1426
|
+
onClick: q[2] || (q[2] = (P) => d.value && !S.value ? J() : void 0)
|
|
920
1427
|
}, [
|
|
921
|
-
|
|
922
|
-
value:
|
|
923
|
-
formatted:
|
|
1428
|
+
me(y.$slots, "default", {
|
|
1429
|
+
value: _.value,
|
|
1430
|
+
formatted: f.value
|
|
924
1431
|
}, () => [
|
|
925
|
-
I(
|
|
1432
|
+
I(i(f.value), 1)
|
|
926
1433
|
])
|
|
927
|
-
], 42,
|
|
928
|
-
|
|
1434
|
+
], 42, nn),
|
|
1435
|
+
d.value ? (a(), E(u(we), {
|
|
929
1436
|
key: 0,
|
|
930
|
-
tooltip:
|
|
1437
|
+
tooltip: B.value,
|
|
931
1438
|
placement: "top"
|
|
932
1439
|
}, {
|
|
933
1440
|
trigger: O(() => [
|
|
934
|
-
|
|
1441
|
+
o("button", {
|
|
935
1442
|
type: "button",
|
|
936
|
-
class:
|
|
937
|
-
onClick:
|
|
1443
|
+
class: A(["tv-overlay inline-flex items-center align-middle transition-transform duration-150", [u(W), Y.value ? "cursor-pointer hover:scale-110" : "cursor-default"]]),
|
|
1444
|
+
onClick: q[3] || (q[3] = (P) => Y.value ? J() : void 0)
|
|
938
1445
|
}, [
|
|
939
|
-
|
|
1446
|
+
L.value ? (a(), s("span", ln, "✔")) : (a(), E(ye, {
|
|
940
1447
|
key: 0,
|
|
941
|
-
status:
|
|
1448
|
+
status: V.value
|
|
942
1449
|
}, null, 8, ["status"])),
|
|
943
|
-
|
|
1450
|
+
$.value && !L.value ? (a(), s("span", sn, "⚠")) : p("", !0)
|
|
944
1451
|
], 2)
|
|
945
1452
|
]),
|
|
946
1453
|
_: 1
|
|
947
|
-
}, 8, ["tooltip"])) :
|
|
948
|
-
|
|
1454
|
+
}, 8, ["tooltip"])) : p("", !0),
|
|
1455
|
+
r.value ? (a(), E(an, {
|
|
949
1456
|
key: 1,
|
|
950
|
-
modelValue:
|
|
951
|
-
"onUpdate:modelValue":
|
|
952
|
-
meta:
|
|
1457
|
+
modelValue: M.value,
|
|
1458
|
+
"onUpdate:modelValue": q[4] || (q[4] = (P) => M.value = P),
|
|
1459
|
+
meta: r.value,
|
|
953
1460
|
label: e.field,
|
|
954
|
-
save:
|
|
955
|
-
}, null, 8, ["modelValue", "meta", "label", "save"])) :
|
|
1461
|
+
save: T.value
|
|
1462
|
+
}, null, 8, ["modelValue", "meta", "label", "save"])) : p("", !0)
|
|
956
1463
|
], 64))
|
|
957
1464
|
], 2));
|
|
958
1465
|
}
|
|
959
|
-
}),
|
|
1466
|
+
}), on = { class: "tv-comparison-page flex flex-col gap-4" }, rn = {
|
|
960
1467
|
key: 0,
|
|
961
1468
|
class: "tv-comparison-empty text-gray-400"
|
|
962
|
-
},
|
|
1469
|
+
}, un = {
|
|
963
1470
|
key: 1,
|
|
964
1471
|
class: "tv-anchored-group flex flex-col gap-3"
|
|
965
|
-
},
|
|
1472
|
+
}, dn = { class: "flex items-center gap-2" }, cn = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, vn = { class: "tv-datapoint-resolved font-medium" }, fn = {
|
|
966
1473
|
key: 0,
|
|
967
1474
|
class: "tv-datapoint-discrepancy text-xs font-medium text-amber-600"
|
|
968
|
-
},
|
|
1475
|
+
}, gn = { class: "tv-datapoint-candidates ml-4 text-xs text-gray-600" }, pn = { class: "font-medium" }, mn = {
|
|
969
1476
|
key: 0,
|
|
970
1477
|
class: "tv-datapoint-reasoning ml-4 text-xs italic text-gray-500"
|
|
971
|
-
},
|
|
1478
|
+
}, xn = {
|
|
1479
|
+
key: 1,
|
|
1480
|
+
class: "tv-datapoint-sources ml-4 text-xs text-gray-500"
|
|
1481
|
+
}, hn = { class: "tv-datapoint-cited text-gray-400" }, yn = ["href"], bn = {
|
|
1482
|
+
key: 1,
|
|
1483
|
+
class: "tv-source-page-label"
|
|
1484
|
+
}, wn = {
|
|
1485
|
+
key: 2,
|
|
1486
|
+
class: "ml-1 text-gray-400"
|
|
1487
|
+
}, _n = { class: "tv-source-quotes ml-4" }, kn = {
|
|
1488
|
+
key: 2,
|
|
1489
|
+
class: "tv-datapoint-history ml-4 mt-1 text-xs text-gray-500"
|
|
1490
|
+
}, $n = {
|
|
1491
|
+
key: 0,
|
|
1492
|
+
class: "tv-history-chosen-mark"
|
|
1493
|
+
}, Cn = { class: "tv-history-entry-value" }, Sn = {
|
|
972
1494
|
key: 1,
|
|
973
|
-
class: "
|
|
974
|
-
},
|
|
1495
|
+
class: "ml-1"
|
|
1496
|
+
}, Vn = {
|
|
1497
|
+
key: 2,
|
|
1498
|
+
class: "ml-1"
|
|
1499
|
+
}, Nn = {
|
|
1500
|
+
key: 3,
|
|
1501
|
+
class: "ml-1"
|
|
1502
|
+
}, qn = {
|
|
1503
|
+
key: 4,
|
|
1504
|
+
class: "ml-1 text-gray-400"
|
|
1505
|
+
}, On = {
|
|
975
1506
|
key: 2,
|
|
976
1507
|
class: "tv-unanchored-group flex flex-col gap-1"
|
|
977
|
-
},
|
|
1508
|
+
}, In = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, Dn = { class: "tv-datapoint-value" }, Tn = /* @__PURE__ */ Q({
|
|
978
1509
|
__name: "ComparisonPage",
|
|
979
1510
|
setup(e) {
|
|
980
|
-
const t =
|
|
981
|
-
function
|
|
982
|
-
const
|
|
983
|
-
return
|
|
1511
|
+
const t = pe(), n = g(() => $e(t.data)), w = g(() => n.value.filter((S) => !S.unanchored)), b = g(() => n.value.filter((S) => S.unanchored));
|
|
1512
|
+
function c(S) {
|
|
1513
|
+
const d = ke(S).value;
|
|
1514
|
+
return d == null ? "" : String(d);
|
|
984
1515
|
}
|
|
985
|
-
function
|
|
986
|
-
return
|
|
1516
|
+
function r(S) {
|
|
1517
|
+
return S == null ? "" : String(S);
|
|
987
1518
|
}
|
|
988
|
-
function l(
|
|
989
|
-
var
|
|
990
|
-
return (
|
|
1519
|
+
function l(S) {
|
|
1520
|
+
var d, m, h;
|
|
1521
|
+
return (h = (m = (d = S.meta) == null ? void 0 : d.candidates) == null ? void 0 : m.extracted) == null ? void 0 : h.confidence;
|
|
991
1522
|
}
|
|
992
|
-
function
|
|
993
|
-
var
|
|
994
|
-
const
|
|
995
|
-
if (!
|
|
996
|
-
const
|
|
997
|
-
return
|
|
1523
|
+
function _(S) {
|
|
1524
|
+
var h;
|
|
1525
|
+
const d = (h = S.meta) == null ? void 0 : h.candidates;
|
|
1526
|
+
if (!d) return [];
|
|
1527
|
+
const m = [];
|
|
1528
|
+
return d.override && m.push({ source: "override", value: d.override.value }), d.extracted && m.push({ source: "extracted", value: d.extracted.value }), d.claim && m.push({ source: "claim", value: d.claim.value }), m;
|
|
998
1529
|
}
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
s("
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1530
|
+
function f(S) {
|
|
1531
|
+
var d, m, h;
|
|
1532
|
+
return ((h = (m = (d = S.meta) == null ? void 0 : d.candidates) == null ? void 0 : m.extracted) == null ? void 0 : h.history) ?? [];
|
|
1533
|
+
}
|
|
1534
|
+
function V(S) {
|
|
1535
|
+
return S.created_at ? new Date(S.created_at).toLocaleString() : "";
|
|
1536
|
+
}
|
|
1537
|
+
function $(S) {
|
|
1538
|
+
var d, m, h;
|
|
1539
|
+
return oe((h = (m = (d = S.meta) == null ? void 0 : d.candidates) == null ? void 0 : m.extracted) == null ? void 0 : h.sources).pages;
|
|
1540
|
+
}
|
|
1541
|
+
function L(S) {
|
|
1542
|
+
var d, m, h;
|
|
1543
|
+
return Ce(oe((h = (m = (d = S.meta) == null ? void 0 : d.candidates) == null ? void 0 : m.extracted) == null ? void 0 : h.sources));
|
|
1544
|
+
}
|
|
1545
|
+
return (S, d) => (a(), s("div", on, [
|
|
1546
|
+
d[1] || (d[1] = o("h2", { class: "tv-comparison-title text-lg font-semibold" }, "Verification comparison", -1)),
|
|
1547
|
+
n.value.length === 0 ? (a(), s("p", rn, " No data points to compare. ")) : p("", !0),
|
|
1548
|
+
w.value.length ? (a(), s("section", un, [
|
|
1549
|
+
(a(!0), s(U, null, F(w.value, (m) => (a(), s("div", {
|
|
1550
|
+
key: m.path,
|
|
1551
|
+
class: "tv-datapoint border-t border-gray-100 pt-2"
|
|
1552
|
+
}, [
|
|
1553
|
+
o("div", dn, [
|
|
1554
|
+
o("span", cn, i(m.path), 1),
|
|
1555
|
+
o("span", vn, i(c(m.meta)), 1),
|
|
1556
|
+
D(ye, {
|
|
1557
|
+
confidence: l(m),
|
|
1558
|
+
"show-label": ""
|
|
1559
|
+
}, null, 8, ["confidence"]),
|
|
1560
|
+
u(Fe)(m.meta) ? (a(), s("span", fn, "⚠ discrepancy")) : p("", !0)
|
|
1561
|
+
]),
|
|
1562
|
+
o("ul", gn, [
|
|
1563
|
+
(a(!0), s(U, null, F(_(m), (h) => (a(), s("li", {
|
|
1564
|
+
key: h.source,
|
|
1565
|
+
class: "tv-candidate"
|
|
1566
|
+
}, [
|
|
1567
|
+
o("span", pn, i(h.source) + ":", 1),
|
|
1568
|
+
I(" " + i(r(h.value)), 1)
|
|
1569
|
+
]))), 128))
|
|
1570
|
+
]),
|
|
1571
|
+
u(xe)(m.meta) ? (a(), s("p", mn, i(u(xe)(m.meta)), 1)) : p("", !0),
|
|
1572
|
+
$(m).length ? (a(), s("ul", xn, [
|
|
1573
|
+
o("li", hn, i(L(m)), 1),
|
|
1574
|
+
(a(!0), s(U, null, F($(m), (h) => (a(), s("li", {
|
|
1575
|
+
key: h.key,
|
|
1576
|
+
class: "tv-source-page"
|
|
1577
|
+
}, [
|
|
1578
|
+
h.url ? (a(), s("a", {
|
|
1579
|
+
key: 0,
|
|
1580
|
+
href: h.url,
|
|
1581
|
+
class: "tv-source-link text-blue-600 underline",
|
|
1582
|
+
target: "_blank",
|
|
1583
|
+
rel: "noopener"
|
|
1584
|
+
}, i(h.label), 9, yn)) : (a(), s("span", bn, i(h.label), 1)),
|
|
1585
|
+
h.documentName ? (a(), s("span", wn, "· " + i(h.documentName), 1)) : p("", !0),
|
|
1586
|
+
o("ul", _n, [
|
|
1587
|
+
(a(!0), s(U, null, F(h.quotes, (B, k) => (a(), s("li", {
|
|
1588
|
+
key: k,
|
|
1589
|
+
class: "tv-source-quote italic"
|
|
1590
|
+
}, "“" + i(B) + "”", 1))), 128))
|
|
1591
|
+
])
|
|
1592
|
+
]))), 128))
|
|
1593
|
+
])) : p("", !0),
|
|
1594
|
+
f(m).length ? (a(), s("ul", kn, [
|
|
1595
|
+
(a(!0), s(U, null, F(f(m), (h, B) => (a(), s("li", {
|
|
1596
|
+
key: h.id ?? B,
|
|
1597
|
+
class: A(["tv-history-entry", h.is_chosen ? "tv-history-entry-chosen font-medium text-green-700" : ""])
|
|
1598
|
+
}, [
|
|
1599
|
+
h.is_chosen ? (a(), s("span", $n, "✔ chosen · ")) : p("", !0),
|
|
1600
|
+
o("span", Cn, i(r(h.value)), 1),
|
|
1601
|
+
h.state ? (a(), s("span", Sn, "[" + i(h.state) + "]", 1)) : p("", !0),
|
|
1602
|
+
h.confidence != null ? (a(), s("span", Vn, "· " + i(h.confidence) + "/5", 1)) : p("", !0),
|
|
1603
|
+
h.page != null ? (a(), s("span", Nn, "· p" + i(h.page), 1)) : p("", !0),
|
|
1604
|
+
V(h) ? (a(), s("span", qn, "· " + i(V(h)), 1)) : p("", !0)
|
|
1605
|
+
], 2))), 128))
|
|
1606
|
+
])) : p("", !0)
|
|
1607
|
+
]))), 128))
|
|
1608
|
+
])) : p("", !0),
|
|
1609
|
+
b.value.length ? (a(), s("section", On, [
|
|
1610
|
+
d[0] || (d[0] = o("h3", { class: "tv-unanchored-title text-sm font-semibold text-gray-500" }, " Unanchored / not from source ", -1)),
|
|
1611
|
+
(a(!0), s(U, null, F(b.value, (m) => (a(), s("div", {
|
|
1612
|
+
key: m.path,
|
|
1051
1613
|
class: "tv-unanchored-datapoint flex items-center gap-2 text-sm"
|
|
1052
1614
|
}, [
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1615
|
+
o("span", In, i(m.path), 1),
|
|
1616
|
+
o("span", Dn, i(r(m.value)), 1),
|
|
1617
|
+
D(ye, { status: "unverifiable" })
|
|
1056
1618
|
]))), 128))
|
|
1057
|
-
])) :
|
|
1619
|
+
])) : p("", !0)
|
|
1058
1620
|
]));
|
|
1059
1621
|
}
|
|
1060
|
-
}),
|
|
1622
|
+
}), En = { class: "tv-enable-toggle flex items-center justify-between text-sm font-medium text-gray-700" }, Ln = { class: "tv-progress-block" }, Pn = { class: "mb-1 flex items-baseline justify-between" }, An = { class: "tv-progress-count text-xs font-semibold text-gray-600" }, zn = {
|
|
1623
|
+
key: 0,
|
|
1624
|
+
class: "tv-attempts-recorded mt-1 text-[11px] text-gray-400"
|
|
1625
|
+
}, Mn = /* @__PURE__ */ Q({
|
|
1061
1626
|
__name: "VerificationChrome",
|
|
1062
1627
|
setup(e) {
|
|
1063
|
-
const t =
|
|
1064
|
-
|
|
1628
|
+
const t = pe(), { enabled: n, openComparison: w } = t, b = ct(), c = Ae(), r = j(!1), l = g(() => xt(t.data)), _ = g(
|
|
1629
|
+
() => $e(t.data).reduce(
|
|
1630
|
+
(S, d) => {
|
|
1631
|
+
var m, h, B, k;
|
|
1632
|
+
return S + (((k = (B = (h = (m = d.meta) == null ? void 0 : m.candidates) == null ? void 0 : h.extracted) == null ? void 0 : B.history) == null ? void 0 : k.length) ?? 0);
|
|
1633
|
+
},
|
|
1634
|
+
0
|
|
1635
|
+
)
|
|
1636
|
+
), f = j(!1);
|
|
1637
|
+
ae(
|
|
1065
1638
|
() => l.value.percent,
|
|
1066
|
-
(
|
|
1067
|
-
|
|
1639
|
+
(S) => {
|
|
1640
|
+
S === 100 && l.value.total > 0 && !f.value && (f.value = !0, c.success("All data points verified 🎯"));
|
|
1068
1641
|
}
|
|
1069
1642
|
);
|
|
1070
|
-
let
|
|
1071
|
-
function
|
|
1072
|
-
const
|
|
1073
|
-
if (
|
|
1074
|
-
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1643
|
+
let V = 0;
|
|
1644
|
+
function $() {
|
|
1645
|
+
const S = document.querySelectorAll(".tv-needs-review");
|
|
1646
|
+
if (!S.length) return;
|
|
1647
|
+
V = V % S.length;
|
|
1648
|
+
const d = S[V];
|
|
1649
|
+
V++, d.scrollIntoView({ behavior: "smooth", block: "center" }), d.animate(
|
|
1077
1650
|
[
|
|
1078
1651
|
{ boxShadow: "0 0 0 0 rgba(245, 158, 11, 0.8)" },
|
|
1079
1652
|
{ boxShadow: "0 0 0 12px rgba(245, 158, 11, 0)" }
|
|
@@ -1081,48 +1654,48 @@ const pt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
1081
1654
|
{ duration: 900, iterations: 2 }
|
|
1082
1655
|
);
|
|
1083
1656
|
}
|
|
1084
|
-
function
|
|
1085
|
-
|
|
1657
|
+
function L() {
|
|
1658
|
+
w(), r.value = !1;
|
|
1086
1659
|
}
|
|
1087
|
-
return (
|
|
1088
|
-
|
|
1660
|
+
return (S, d) => (a(), s(U, null, [
|
|
1661
|
+
o("button", {
|
|
1089
1662
|
type: "button",
|
|
1090
|
-
class:
|
|
1663
|
+
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", u(W)]),
|
|
1091
1664
|
title: "Verification",
|
|
1092
|
-
onClick:
|
|
1665
|
+
onClick: d[0] || (d[0] = ve((m) => r.value = !r.value, ["stop"]))
|
|
1093
1666
|
}, [
|
|
1094
|
-
|
|
1095
|
-
icon:
|
|
1667
|
+
D(u(lt), {
|
|
1668
|
+
icon: u(st),
|
|
1096
1669
|
class: "h-5 w-5"
|
|
1097
1670
|
}, null, 8, ["icon"]),
|
|
1098
|
-
|
|
1671
|
+
u(n) && l.value.needsReview > 0 ? (a(), E(u(ot), {
|
|
1099
1672
|
key: 0,
|
|
1100
1673
|
value: l.value.needsReview,
|
|
1101
1674
|
variant: "warning",
|
|
1102
1675
|
class: "tv-needs-review-badge absolute -right-1 -top-1"
|
|
1103
|
-
}, null, 8, ["value"])) :
|
|
1676
|
+
}, null, 8, ["value"])) : p("", !0)
|
|
1104
1677
|
], 2),
|
|
1105
|
-
|
|
1678
|
+
r.value ? (a(), s("div", {
|
|
1106
1679
|
key: 0,
|
|
1107
|
-
class:
|
|
1680
|
+
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", u(W)])
|
|
1108
1681
|
}, [
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
"onUpdate:modelValue":
|
|
1682
|
+
o("label", En, [
|
|
1683
|
+
d[3] || (d[3] = o("span", null, "Verification overlay", -1)),
|
|
1684
|
+
Xe(o("input", {
|
|
1685
|
+
"onUpdate:modelValue": d[1] || (d[1] = (m) => Ie(n) ? n.value = m : null),
|
|
1113
1686
|
type: "checkbox",
|
|
1114
1687
|
class: "tv-enable-checkbox h-4 w-4 accent-gray-900"
|
|
1115
1688
|
}, null, 512), [
|
|
1116
|
-
[
|
|
1689
|
+
[Ze, u(n)]
|
|
1117
1690
|
])
|
|
1118
1691
|
]),
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1692
|
+
u(n) && l.value.total > 0 ? (a(), s(U, { key: 0 }, [
|
|
1693
|
+
o("div", Ln, [
|
|
1694
|
+
o("div", Pn, [
|
|
1695
|
+
d[4] || (d[4] = o("span", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, "Review progress", -1)),
|
|
1696
|
+
o("span", An, i(l.value.verified) + " / " + i(l.value.total), 1)
|
|
1124
1697
|
]),
|
|
1125
|
-
|
|
1698
|
+
D(u(ze), {
|
|
1126
1699
|
value: l.value.verified,
|
|
1127
1700
|
max: l.value.total,
|
|
1128
1701
|
size: "md",
|
|
@@ -1131,66 +1704,69 @@ const pt = { class: "tv-audit-call rounded-lg border border-gray-200 shadow-sm"
|
|
|
1131
1704
|
"animate-stripes": l.value.percent < 100,
|
|
1132
1705
|
glow: l.value.percent === 100,
|
|
1133
1706
|
gradient: ""
|
|
1134
|
-
}, null, 8, ["value", "max", "variant", "striped", "animate-stripes", "glow"])
|
|
1707
|
+
}, null, 8, ["value", "max", "variant", "striped", "animate-stripes", "glow"]),
|
|
1708
|
+
_.value > 0 ? (a(), s("div", zn, i(_.value) + " extraction attempt" + i(_.value === 1 ? "" : "s") + " recorded ", 1)) : p("", !0)
|
|
1135
1709
|
]),
|
|
1136
|
-
l.value.needsReview > 0 ? (
|
|
1710
|
+
l.value.needsReview > 0 ? (a(), s("button", {
|
|
1137
1711
|
key: 0,
|
|
1138
1712
|
type: "button",
|
|
1139
|
-
class:
|
|
1140
|
-
onClick:
|
|
1713
|
+
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", u(W)]),
|
|
1714
|
+
onClick: ve($, ["stop"])
|
|
1141
1715
|
}, [
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
], 2)) :
|
|
1145
|
-
], 64)) :
|
|
1146
|
-
|
|
1716
|
+
o("span", null, i(l.value.needsReview) + " need" + i(l.value.needsReview === 1 ? "s" : "") + " review", 1),
|
|
1717
|
+
d[5] || (d[5] = o("span", { "aria-hidden": "true" }, "→", -1))
|
|
1718
|
+
], 2)) : p("", !0)
|
|
1719
|
+
], 64)) : p("", !0),
|
|
1720
|
+
o("button", {
|
|
1147
1721
|
type: "button",
|
|
1148
|
-
class:
|
|
1149
|
-
onClick:
|
|
1722
|
+
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", u(W)]),
|
|
1723
|
+
onClick: ve(L, ["stop"])
|
|
1150
1724
|
}, " Open comparison page ", 2)
|
|
1151
|
-
], 2)) :
|
|
1152
|
-
|
|
1153
|
-
modelValue:
|
|
1154
|
-
"onUpdate:modelValue":
|
|
1725
|
+
], 2)) : p("", !0),
|
|
1726
|
+
D(u(be), {
|
|
1727
|
+
modelValue: u(b),
|
|
1728
|
+
"onUpdate:modelValue": d[2] || (d[2] = (m) => Ie(b) ? b.value = m : null),
|
|
1155
1729
|
title: "Verification comparison",
|
|
1156
1730
|
width: 80,
|
|
1157
1731
|
"close-x": "",
|
|
1158
|
-
class:
|
|
1732
|
+
class: A(u(W))
|
|
1159
1733
|
}, {
|
|
1160
1734
|
default: O(() => [
|
|
1161
|
-
|
|
1735
|
+
D(Tn)
|
|
1162
1736
|
]),
|
|
1163
1737
|
_: 1
|
|
1164
1738
|
}, 8, ["modelValue", "class"]),
|
|
1165
|
-
|
|
1166
|
-
class:
|
|
1739
|
+
D(u(it), {
|
|
1740
|
+
class: A(u(W))
|
|
1167
1741
|
}, null, 8, ["class"])
|
|
1168
1742
|
], 64));
|
|
1169
1743
|
}
|
|
1170
1744
|
});
|
|
1171
1745
|
export {
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1746
|
+
W as CHROME_CLASS,
|
|
1747
|
+
Pe as CitationEvidence,
|
|
1748
|
+
Le as CitationPage,
|
|
1749
|
+
va as CitationPageList,
|
|
1750
|
+
Tn as ComparisonPage,
|
|
1751
|
+
ye as ConfidenceIcon,
|
|
1752
|
+
Re as ENABLED_STORAGE_KEY,
|
|
1753
|
+
Me as RESOLUTION_PRIORITY,
|
|
1754
|
+
vt as STATUS_COLORS,
|
|
1755
|
+
G as STATUS_LABELS,
|
|
1756
|
+
Mn as VerificationChrome,
|
|
1757
|
+
an as VerificationModal,
|
|
1758
|
+
Bn as VerifiedField,
|
|
1759
|
+
_e as bucketConfidence,
|
|
1760
|
+
gt as candidatesDisagree,
|
|
1761
|
+
oe as citationEvidence,
|
|
1762
|
+
Ce as citationSummary,
|
|
1763
|
+
xt as computeProgress,
|
|
1764
|
+
_t as fetchDataPointAudit,
|
|
1765
|
+
Fe as hasDiscrepancy,
|
|
1766
|
+
Un as initVerification,
|
|
1767
|
+
xe as reasoningOf,
|
|
1768
|
+
ft as resolveCandidates,
|
|
1769
|
+
ke as resolveDataPoint,
|
|
1770
|
+
pe as useVerification,
|
|
1771
|
+
$e as walkDataPoints
|
|
1196
1772
|
};
|