@thehammer/template-verification 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/confidence.d.ts +7 -1
- package/dist/style.css +1 -1
- package/dist/template-verification.js +442 -415
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { DanxDialog as
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
function
|
|
1
|
+
import { ref as D, watch as pe, defineComponent as M, computed as d, openBlock as l, createElementBlock as i, normalizeClass as U, createElementVNode as a, toDisplayString as p, createCommentVNode as h, Fragment as O, createVNode as I, unref as m, withCtx as j, createTextVNode as E, renderList as T, createBlock as F, withKeys as me, withModifiers as xe, renderSlot as ge, withDirectives as ye, isRef as te, vModelCheckbox as _e } from "vue";
|
|
2
|
+
import { DanxDialog as G, DanxFile as be, DanxButton as Y, DanxInput as he, DanxFileViewer as we, DanxIcon as ke, gearIcon as Se } from "@thehammer/danx-ui";
|
|
3
|
+
const A = "tv-chrome", le = "template-verification:enabled";
|
|
4
|
+
let R = null;
|
|
5
|
+
function Ve(e) {
|
|
6
6
|
var t;
|
|
7
7
|
try {
|
|
8
8
|
return ((t = globalThis.localStorage) == null ? void 0 : t.getItem(e)) ?? null;
|
|
@@ -11,33 +11,33 @@ function Se(e) {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
function $e(e, t) {
|
|
14
|
-
var
|
|
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 Ce(e) {
|
|
21
|
+
const t = Ve(le);
|
|
22
22
|
return t === null ? e : t === "true";
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const t =
|
|
26
|
-
return pe(t, (
|
|
24
|
+
function ae(e) {
|
|
25
|
+
const t = D(Ce((e == null ? void 0 : e.defaultEnabled) ?? !1));
|
|
26
|
+
return pe(t, (n) => $e(le, n ? "true" : "false")), {
|
|
27
27
|
enabled: t,
|
|
28
28
|
data: (e == null ? void 0 : e.data) ?? {},
|
|
29
29
|
saveOverride: e == null ? void 0 : e.saveOverride,
|
|
30
30
|
workflowInputId: e == null ? void 0 : e.workflowInputId,
|
|
31
|
-
comparisonOpen:
|
|
31
|
+
comparisonOpen: D(!1)
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
function se() {
|
|
35
|
-
return
|
|
35
|
+
return R || (R = ae()), R;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
37
|
+
function Bt(e) {
|
|
38
|
+
R = ae(e);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Q() {
|
|
41
41
|
const e = se();
|
|
42
42
|
return {
|
|
43
43
|
enabled: e.enabled,
|
|
@@ -49,84 +49,84 @@ function J() {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function Oe() {
|
|
53
53
|
return se().comparisonOpen;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function W(e) {
|
|
56
56
|
return typeof e != "number" || Number.isNaN(e) ? "unverifiable" : e <= 2 ? "low" : e === 3 ? "medium" : "high";
|
|
57
57
|
}
|
|
58
|
-
const
|
|
59
|
-
high: "text-green-600",
|
|
60
|
-
medium: "text-yellow-
|
|
61
|
-
low: "text-red-600",
|
|
62
|
-
unverifiable: "text-gray-400"
|
|
58
|
+
const Ie = {
|
|
59
|
+
high: "bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20",
|
|
60
|
+
medium: "bg-yellow-50 text-yellow-700 ring-1 ring-inset ring-yellow-600/20",
|
|
61
|
+
low: "bg-red-50 text-red-700 ring-1 ring-inset ring-red-600/20",
|
|
62
|
+
unverifiable: "bg-gray-50 text-gray-500 ring-1 ring-inset ring-gray-400/20"
|
|
63
63
|
}, Le = {
|
|
64
64
|
high: "High",
|
|
65
65
|
medium: "Medium",
|
|
66
66
|
low: "Low",
|
|
67
67
|
unverifiable: "Unverifiable"
|
|
68
68
|
}, ie = ["override", "extracted", "claim"];
|
|
69
|
-
function
|
|
70
|
-
return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved :
|
|
69
|
+
function X(e) {
|
|
70
|
+
return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved : Ue(e.candidates) : { value: null, source: "none" };
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Ue(e) {
|
|
73
73
|
if (e)
|
|
74
74
|
for (const t of ie) {
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
return { value:
|
|
75
|
+
const n = e[t];
|
|
76
|
+
if (n != null)
|
|
77
|
+
return { value: n.value, source: t };
|
|
78
78
|
}
|
|
79
79
|
return { value: null, source: "none" };
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
var
|
|
83
|
-
const t = (
|
|
81
|
+
function H(e) {
|
|
82
|
+
var f, r;
|
|
83
|
+
const t = (r = (f = e == null ? void 0 : e.candidates) == null ? void 0 : f.extracted) == null ? void 0 : r.reasoning;
|
|
84
84
|
if (t == null) return null;
|
|
85
|
-
const
|
|
86
|
-
return
|
|
85
|
+
const n = String(t).trim();
|
|
86
|
+
return n === "" ? null : n;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
var
|
|
90
|
-
const t = (
|
|
88
|
+
function q(e) {
|
|
89
|
+
var f, r;
|
|
90
|
+
const t = (r = (f = e == null ? void 0 : e.candidates) == null ? void 0 : f.extracted) == null ? void 0 : r.cited_text;
|
|
91
91
|
if (t == null) return null;
|
|
92
|
-
const
|
|
93
|
-
return
|
|
92
|
+
const n = String(t).trim();
|
|
93
|
+
return n === "" ? null : n;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
return e ? typeof e.discrepancy == "boolean" ? e.discrepancy :
|
|
95
|
+
function re(e) {
|
|
96
|
+
return e ? typeof e.discrepancy == "boolean" ? e.discrepancy : De(e.candidates) : !1;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function De(e) {
|
|
99
99
|
if (!e) return !1;
|
|
100
|
-
const t = ie.map((
|
|
100
|
+
const t = ie.map((n) => e[n]).filter((n) => n != null).map((n) => Ee(n.value));
|
|
101
101
|
return t.length < 2 ? !1 : new Set(t).size > 1;
|
|
102
102
|
}
|
|
103
103
|
function Ee(e) {
|
|
104
104
|
return JSON.stringify(e ?? null);
|
|
105
105
|
}
|
|
106
|
-
function Te(e, t,
|
|
107
|
-
var
|
|
108
|
-
const
|
|
109
|
-
if (!e.saveOverride || !
|
|
110
|
-
const
|
|
111
|
-
return async (
|
|
112
|
-
const
|
|
106
|
+
function Te(e, t, n) {
|
|
107
|
+
var o;
|
|
108
|
+
const f = (o = t.value) == null ? void 0 : o.anchor;
|
|
109
|
+
if (!e.saveOverride || !f) return null;
|
|
110
|
+
const r = e.saveOverride;
|
|
111
|
+
return async (c, g) => {
|
|
112
|
+
const b = await r({
|
|
113
113
|
workflow_input_id: e.workflowInputId,
|
|
114
|
-
object_ids:
|
|
115
|
-
field:
|
|
116
|
-
field_path:
|
|
117
|
-
value:
|
|
118
|
-
source_choice:
|
|
114
|
+
object_ids: f.object_ids,
|
|
115
|
+
field: f.field,
|
|
116
|
+
field_path: f.field_path,
|
|
117
|
+
value: c,
|
|
118
|
+
source_choice: g
|
|
119
119
|
});
|
|
120
|
-
return
|
|
120
|
+
return n(b), b;
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
|
-
const
|
|
123
|
+
const Ae = ["data-status", "title"], Ne = {
|
|
124
124
|
class: "tv-confidence-glyph",
|
|
125
125
|
"aria-hidden": "true"
|
|
126
|
-
},
|
|
126
|
+
}, je = {
|
|
127
127
|
key: 0,
|
|
128
|
-
class: "tv-confidence-label
|
|
129
|
-
},
|
|
128
|
+
class: "tv-confidence-label"
|
|
129
|
+
}, z = /* @__PURE__ */ M({
|
|
130
130
|
__name: "ConfidenceIcon",
|
|
131
131
|
props: {
|
|
132
132
|
confidence: {},
|
|
@@ -134,9 +134,9 @@ const De = ["data-status", "title"], Ae = {
|
|
|
134
134
|
showLabel: { type: Boolean }
|
|
135
135
|
},
|
|
136
136
|
setup(e) {
|
|
137
|
-
const t = e,
|
|
138
|
-
() => t.status ??
|
|
139
|
-
),
|
|
137
|
+
const t = e, n = d(
|
|
138
|
+
() => t.status ?? W(t.confidence)
|
|
139
|
+
), f = {
|
|
140
140
|
high: "✔",
|
|
141
141
|
// check
|
|
142
142
|
medium: "⚠",
|
|
@@ -144,29 +144,29 @@ const De = ["data-status", "title"], Ae = {
|
|
|
144
144
|
low: "✕",
|
|
145
145
|
// x
|
|
146
146
|
unverifiable: "?"
|
|
147
|
-
},
|
|
148
|
-
return (
|
|
149
|
-
class:
|
|
150
|
-
"data-status":
|
|
151
|
-
title:
|
|
147
|
+
}, r = d(() => f[n.value]), o = d(() => Ie[n.value]), c = d(() => Le[n.value]);
|
|
148
|
+
return (g, b) => (l(), i("span", {
|
|
149
|
+
class: U(["tv-confidence-icon inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-none", o.value]),
|
|
150
|
+
"data-status": n.value,
|
|
151
|
+
title: c.value
|
|
152
152
|
}, [
|
|
153
|
-
|
|
154
|
-
e.showLabel ? (
|
|
155
|
-
], 10,
|
|
153
|
+
a("span", Ne, p(r.value), 1),
|
|
154
|
+
e.showLabel ? (l(), i("span", je, p(c.value), 1)) : h("", !0)
|
|
155
|
+
], 10, Ae));
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
|
-
function
|
|
158
|
+
function oe(e) {
|
|
159
159
|
if (!e || e.length === 0) return [];
|
|
160
160
|
const t = /* @__PURE__ */ new Map();
|
|
161
|
-
for (const
|
|
162
|
-
const
|
|
163
|
-
let
|
|
164
|
-
|
|
165
|
-
fileLabel:
|
|
166
|
-
fileUrl:
|
|
167
|
-
file:
|
|
161
|
+
for (const n of e) {
|
|
162
|
+
const f = Fe(n);
|
|
163
|
+
let r = t.get(f);
|
|
164
|
+
r || (r = {
|
|
165
|
+
fileLabel: Pe(n),
|
|
166
|
+
fileUrl: n.file_url,
|
|
167
|
+
file: n.file,
|
|
168
168
|
sources: []
|
|
169
|
-
}, t.set(
|
|
169
|
+
}, t.set(f, r)), !r.fileUrl && n.file_url && (r.fileUrl = n.file_url), !r.file && n.file && (r.file = n.file), r.sources.push(n);
|
|
170
170
|
}
|
|
171
171
|
return [...t.values()];
|
|
172
172
|
}
|
|
@@ -174,35 +174,38 @@ function Fe(e) {
|
|
|
174
174
|
const t = e.file_name ?? e.file_id ?? e.stored_file_id ?? e.source_id ?? e.id;
|
|
175
175
|
return t != null ? String(t) : "__unknown__";
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function Pe(e) {
|
|
178
178
|
var t;
|
|
179
179
|
return (t = e.file) != null && t.name ? e.file.name : e.file_name ? e.file_name : e.file_id !== void 0 && e.file_id !== null ? `File ${e.file_id}` : e.stored_file_id !== void 0 && e.stored_file_id !== null ? `File ${e.stored_file_id}` : e.source_type ? e.source_type : "Source";
|
|
180
180
|
}
|
|
181
181
|
function ue(e) {
|
|
182
182
|
return e.page !== void 0 && e.page !== null ? `Page ${e.page}` : e.explanation ? String(e.explanation) : e.source_type ? String(e.source_type) : "Citation";
|
|
183
183
|
}
|
|
184
|
-
const
|
|
184
|
+
const Me = { class: "tv-modal flex flex-col gap-5 p-4 text-sm text-gray-700" }, Re = { class: "tv-modal-resolved rounded-lg border border-gray-200 bg-gray-50 p-3" }, ze = { class: "mt-1.5 flex flex-wrap items-center gap-2" }, Be = { class: "tv-resolved-value text-lg font-semibold leading-tight text-gray-900" }, Ke = { class: "mt-1 font-mono text-[11px] text-gray-400" }, Ye = { class: "tv-resolved-source" }, Ge = {
|
|
185
185
|
key: 0,
|
|
186
|
-
class: "tv-discrepancy text-
|
|
187
|
-
},
|
|
186
|
+
class: "tv-discrepancy mt-2 inline-flex items-center gap-1 rounded-full bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20"
|
|
187
|
+
}, He = { class: "tv-modal-candidates" }, qe = { class: "mt-1.5 divide-y divide-gray-100 rounded-lg border border-gray-200" }, Je = { class: "w-20 shrink-0 text-xs font-medium text-gray-500" }, Qe = { class: "flex-1 truncate font-mono text-sm text-gray-800" }, We = { class: "shrink-0 text-[11px] text-gray-400" }, Xe = {
|
|
188
188
|
key: 0,
|
|
189
|
-
class: "tv-modal-provenance flex flex-col gap-
|
|
190
|
-
},
|
|
189
|
+
class: "tv-modal-provenance flex flex-col gap-2 rounded-lg border border-gray-200 p-3"
|
|
190
|
+
}, Ze = { class: "flex items-center justify-between" }, et = { class: "tv-confidence-value font-mono text-sm font-semibold text-gray-800" }, tt = { class: "tv-reasoning whitespace-pre-line text-sm leading-relaxed text-gray-600" }, nt = { class: "tv-cited-text rounded-md border-l-2 border-gray-300 bg-gray-50 py-1.5 pl-3 pr-2 text-sm italic leading-relaxed text-gray-600" }, lt = { class: "tv-modal-sources" }, at = {
|
|
191
191
|
key: 0,
|
|
192
|
-
class: "tv-no-source text-gray-400"
|
|
193
|
-
},
|
|
192
|
+
class: "tv-no-source mt-1.5 text-sm text-gray-400"
|
|
193
|
+
}, st = {
|
|
194
194
|
key: 1,
|
|
195
|
-
class: "tv-source-grid
|
|
196
|
-
},
|
|
195
|
+
class: "tv-source-grid mt-2 grid grid-cols-[repeat(auto-fill,minmax(4.5rem,1fr))] items-start gap-3"
|
|
196
|
+
}, it = { class: "relative" }, rt = ["href"], ot = {
|
|
197
197
|
key: 2,
|
|
198
|
-
class: "tv-source-name text-
|
|
199
|
-
},
|
|
198
|
+
class: "tv-source-name flex h-16 w-16 items-center justify-center rounded-md bg-gray-50 p-1 text-center text-[11px] leading-tight text-gray-500 ring-1 ring-gray-200"
|
|
199
|
+
}, ut = {
|
|
200
200
|
key: 3,
|
|
201
|
-
class: "tv-source-
|
|
202
|
-
},
|
|
201
|
+
class: "tv-source-count pointer-events-none absolute -right-1.5 -top-1.5 flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-gray-700 px-1 text-[9px] font-semibold text-white"
|
|
202
|
+
}, ct = ["title"], dt = {
|
|
203
|
+
key: 0,
|
|
204
|
+
class: "tv-source-citations flex flex-wrap justify-center gap-1"
|
|
205
|
+
}, ft = {
|
|
203
206
|
key: 1,
|
|
204
|
-
class: "tv-modal-resolution flex flex-col gap-2 border-t border-gray-200 pt-
|
|
205
|
-
},
|
|
207
|
+
class: "tv-modal-resolution flex flex-col gap-2 border-t border-gray-200 pt-4"
|
|
208
|
+
}, vt = { class: "flex flex-wrap gap-2" }, pt = { class: "flex items-center gap-2" }, mt = /* @__PURE__ */ M({
|
|
206
209
|
__name: "VerificationModal",
|
|
207
210
|
props: {
|
|
208
211
|
modelValue: { type: Boolean },
|
|
@@ -212,211 +215,235 @@ const Pe = { class: "tv-modal flex flex-col gap-4 text-sm" }, Re = { class: "tv-
|
|
|
212
215
|
},
|
|
213
216
|
emits: ["update:modelValue", "saved"],
|
|
214
217
|
setup(e, { emit: t }) {
|
|
215
|
-
const
|
|
216
|
-
get: () =>
|
|
217
|
-
set: (
|
|
218
|
-
}),
|
|
218
|
+
const n = e, f = t, r = d({
|
|
219
|
+
get: () => n.modelValue,
|
|
220
|
+
set: (s) => f("update:modelValue", s)
|
|
221
|
+
}), o = d(() => X(n.meta)), c = d(() => n.meta.candidates.extracted), g = d(() => n.meta.candidates.claim), b = d(() => n.meta.candidates.override), w = d(
|
|
219
222
|
() => {
|
|
220
|
-
var
|
|
221
|
-
return
|
|
223
|
+
var s;
|
|
224
|
+
return W((s = c.value) == null ? void 0 : s.confidence);
|
|
222
225
|
}
|
|
223
|
-
),
|
|
224
|
-
var
|
|
225
|
-
return
|
|
226
|
-
}), L =
|
|
227
|
-
() =>
|
|
228
|
-
), C =
|
|
226
|
+
), _ = d(() => H(n.meta)), v = d(() => q(n.meta)), V = d(() => {
|
|
227
|
+
var s;
|
|
228
|
+
return oe((s = c.value) == null ? void 0 : s.sources);
|
|
229
|
+
}), L = d(
|
|
230
|
+
() => V.value.map((s) => s.file).filter((s) => !!s)
|
|
231
|
+
), C = D(null), k = d({
|
|
229
232
|
get: () => C.value !== null,
|
|
230
|
-
set: (
|
|
231
|
-
|
|
233
|
+
set: (s) => {
|
|
234
|
+
s || (C.value = null);
|
|
232
235
|
}
|
|
233
236
|
});
|
|
234
|
-
function
|
|
235
|
-
|
|
237
|
+
function N(s) {
|
|
238
|
+
s.file && (C.value = s);
|
|
236
239
|
}
|
|
237
|
-
const
|
|
238
|
-
const
|
|
239
|
-
return
|
|
240
|
+
const B = d(() => {
|
|
241
|
+
const s = [];
|
|
242
|
+
return b.value && s.push({
|
|
240
243
|
source: "Override",
|
|
241
|
-
value:
|
|
242
|
-
detail:
|
|
243
|
-
}),
|
|
244
|
+
value: b.value.value,
|
|
245
|
+
detail: b.value.source_choice ? `via ${b.value.source_choice}` : void 0
|
|
246
|
+
}), c.value && s.push({
|
|
244
247
|
source: "Extracted",
|
|
245
|
-
value:
|
|
246
|
-
detail: S(
|
|
247
|
-
}),
|
|
248
|
+
value: c.value.value,
|
|
249
|
+
detail: S(c.value.confidence)
|
|
250
|
+
}), g.value && s.push({
|
|
248
251
|
source: "Claim",
|
|
249
|
-
value:
|
|
250
|
-
detail:
|
|
251
|
-
}),
|
|
252
|
-
}),
|
|
253
|
-
function S(
|
|
254
|
-
return
|
|
252
|
+
value: g.value.value,
|
|
253
|
+
detail: g.value.claim_set_label ?? void 0
|
|
254
|
+
}), s;
|
|
255
|
+
}), P = D(""), y = D(!1);
|
|
256
|
+
function S(s) {
|
|
257
|
+
return s == null ? "Unverifiable" : `${s}/5`;
|
|
255
258
|
}
|
|
256
|
-
function
|
|
257
|
-
return
|
|
259
|
+
function $(s) {
|
|
260
|
+
return s == null ? "" : String(s);
|
|
258
261
|
}
|
|
259
|
-
async function
|
|
260
|
-
if (!(!
|
|
261
|
-
|
|
262
|
+
async function K(s, u) {
|
|
263
|
+
if (!(!n.save || y.value)) {
|
|
264
|
+
y.value = !0;
|
|
262
265
|
try {
|
|
263
|
-
const
|
|
264
|
-
|
|
266
|
+
const x = await n.save(s, u);
|
|
267
|
+
f("saved", x);
|
|
265
268
|
} finally {
|
|
266
|
-
|
|
269
|
+
y.value = !1;
|
|
267
270
|
}
|
|
268
271
|
}
|
|
269
272
|
}
|
|
270
273
|
const ce = () => {
|
|
271
|
-
var
|
|
272
|
-
return
|
|
274
|
+
var s;
|
|
275
|
+
return K(Z((s = c.value) == null ? void 0 : s.value), "extracted");
|
|
273
276
|
}, de = () => {
|
|
274
|
-
var
|
|
275
|
-
return
|
|
276
|
-
},
|
|
277
|
-
function
|
|
278
|
-
return
|
|
277
|
+
var s;
|
|
278
|
+
return K(Z((s = g.value) == null ? void 0 : s.value), "claim");
|
|
279
|
+
}, fe = () => K(P.value, "custom");
|
|
280
|
+
function Z(s) {
|
|
281
|
+
return s == null ? null : String(s);
|
|
279
282
|
}
|
|
280
|
-
return (
|
|
281
|
-
|
|
282
|
-
modelValue:
|
|
283
|
-
"onUpdate:modelValue":
|
|
283
|
+
return (s, u) => (l(), i(O, null, [
|
|
284
|
+
I(m(G), {
|
|
285
|
+
modelValue: r.value,
|
|
286
|
+
"onUpdate:modelValue": u[1] || (u[1] = (x) => r.value = x),
|
|
284
287
|
title: e.label || "Verification detail",
|
|
285
288
|
"close-x": "",
|
|
286
|
-
class:
|
|
289
|
+
class: U(m(A))
|
|
287
290
|
}, {
|
|
288
|
-
default:
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
E(R, {
|
|
291
|
+
default: j(() => [
|
|
292
|
+
a("div", Me, [
|
|
293
|
+
a("section", Re, [
|
|
294
|
+
u[4] || (u[4] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Resolved value ", -1)),
|
|
295
|
+
a("div", ze, [
|
|
296
|
+
a("span", Be, p($(o.value.value) || "—"), 1),
|
|
297
|
+
I(z, {
|
|
296
298
|
status: w.value,
|
|
297
299
|
"show-label": ""
|
|
298
300
|
}, null, 8, ["status"])
|
|
299
301
|
]),
|
|
300
|
-
|
|
302
|
+
a("div", Ke, [
|
|
303
|
+
u[3] || (u[3] = E(" source: ", -1)),
|
|
304
|
+
a("span", Ye, p(o.value.source), 1)
|
|
305
|
+
]),
|
|
306
|
+
e.meta.discrepancy ? (l(), i("div", Ge, " ⚠ Sources disagree ")) : h("", !0)
|
|
301
307
|
]),
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
]))), 128))
|
|
314
|
-
])
|
|
308
|
+
a("section", He, [
|
|
309
|
+
u[5] || (u[5] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Candidates ", -1)),
|
|
310
|
+
a("div", qe, [
|
|
311
|
+
(l(!0), i(O, null, T(B.value, (x) => (l(), i("div", {
|
|
312
|
+
key: x.source,
|
|
313
|
+
class: "tv-candidate-row flex items-center gap-3 px-3 py-2"
|
|
314
|
+
}, [
|
|
315
|
+
a("span", Je, p(x.source), 1),
|
|
316
|
+
a("span", Qe, p($(x.value)), 1),
|
|
317
|
+
a("span", We, p(x.detail), 1)
|
|
318
|
+
]))), 128))
|
|
315
319
|
])
|
|
316
320
|
]),
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
321
|
+
c.value ? (l(), i("section", Xe, [
|
|
322
|
+
a("div", Ze, [
|
|
323
|
+
u[6] || (u[6] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Confidence ", -1)),
|
|
324
|
+
a("div", et, p(S(c.value.confidence)), 1)
|
|
325
|
+
]),
|
|
326
|
+
_.value ? (l(), i(O, { key: 0 }, [
|
|
327
|
+
u[7] || (u[7] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Reasoning ", -1)),
|
|
328
|
+
a("p", tt, p(_.value), 1)
|
|
329
|
+
], 64)) : h("", !0),
|
|
330
|
+
v.value ? (l(), i(O, { key: 1 }, [
|
|
331
|
+
u[8] || (u[8] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Cited text ", -1)),
|
|
332
|
+
a("blockquote", nt, [
|
|
333
|
+
E(p(v.value) + " ", 1),
|
|
334
|
+
a("span", {
|
|
335
|
+
class: U([
|
|
336
|
+
"tv-cited-verified ml-1 not-italic text-[11px] font-medium",
|
|
337
|
+
c.value.cited_text_verified ? "text-green-600" : "text-gray-400"
|
|
332
338
|
])
|
|
333
|
-
},
|
|
339
|
+
}, p(c.value.cited_text_verified ? "✔ verified" : "unverified"), 3)
|
|
334
340
|
])
|
|
335
|
-
], 64)) :
|
|
336
|
-
])) :
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
(
|
|
341
|
-
key:
|
|
342
|
-
class: "tv-source-group flex
|
|
341
|
+
], 64)) : h("", !0)
|
|
342
|
+
])) : h("", !0),
|
|
343
|
+
a("section", lt, [
|
|
344
|
+
u[9] || (u[9] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Sources ", -1)),
|
|
345
|
+
V.value.length === 0 ? (l(), i("div", at, " No source recorded ")) : (l(), i("div", st, [
|
|
346
|
+
(l(!0), i(O, null, T(V.value, (x) => (l(), i("div", {
|
|
347
|
+
key: x.fileLabel,
|
|
348
|
+
class: "tv-source-group flex flex-col items-center gap-1"
|
|
343
349
|
}, [
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
350
|
+
a("div", it, [
|
|
351
|
+
x.file ? (l(), F(m(be), {
|
|
352
|
+
key: 0,
|
|
353
|
+
file: x.file,
|
|
354
|
+
size: "sm",
|
|
355
|
+
class: "tv-source-thumb cursor-pointer rounded-md ring-1 ring-gray-200 transition duration-150 hover:-translate-y-0.5 hover:shadow-md hover:ring-gray-300",
|
|
356
|
+
onClick: (ee) => N(x)
|
|
357
|
+
}, null, 8, ["file", "onClick"])) : x.fileUrl ? (l(), i("a", {
|
|
358
|
+
key: 1,
|
|
359
|
+
href: x.fileUrl,
|
|
360
|
+
class: "tv-source-link flex h-16 w-16 items-center justify-center rounded-md bg-gray-50 p-1 text-center text-[11px] font-medium leading-tight text-blue-600 underline ring-1 ring-gray-200",
|
|
361
|
+
target: "_blank",
|
|
362
|
+
rel: "noopener"
|
|
363
|
+
}, p(x.fileLabel), 9, rt)) : (l(), i("span", ot, p(x.fileLabel), 1)),
|
|
364
|
+
x.sources.length > 1 ? (l(), i("span", ut, "×" + p(x.sources.length), 1)) : h("", !0)
|
|
365
|
+
]),
|
|
366
|
+
a("span", {
|
|
367
|
+
class: "tv-source-file-label w-full truncate text-center text-[11px] text-gray-500",
|
|
368
|
+
title: x.fileLabel
|
|
369
|
+
}, p(x.fileLabel), 9, ct),
|
|
370
|
+
x.sources.length > 1 ? (l(), i("ul", dt, [
|
|
371
|
+
(l(!0), i(O, null, T(x.sources, (ee, ve) => (l(), i("li", {
|
|
372
|
+
key: ve,
|
|
373
|
+
class: "tv-source-row rounded bg-gray-100 px-1 py-0.5 font-mono text-[10px] text-gray-500"
|
|
374
|
+
}, p(m(ue)(ee)), 1))), 128))
|
|
375
|
+
])) : h("", !0)
|
|
367
376
|
]))), 128))
|
|
368
377
|
]))
|
|
369
378
|
]),
|
|
370
|
-
e.save ? (
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
379
|
+
e.save ? (l(), i("section", ft, [
|
|
380
|
+
u[13] || (u[13] = a("div", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, " Resolve ", -1)),
|
|
381
|
+
a("div", vt, [
|
|
382
|
+
c.value ? (l(), F(m(Y), {
|
|
374
383
|
key: 0,
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
384
|
+
variant: "info",
|
|
385
|
+
size: "sm",
|
|
386
|
+
class: "tv-accept-extracted",
|
|
387
|
+
disabled: y.value,
|
|
378
388
|
onClick: ce
|
|
379
|
-
},
|
|
380
|
-
|
|
389
|
+
}, {
|
|
390
|
+
default: j(() => [...u[10] || (u[10] = [
|
|
391
|
+
E("Accept extracted", -1)
|
|
392
|
+
])]),
|
|
393
|
+
_: 1
|
|
394
|
+
}, 8, ["disabled"])) : h("", !0),
|
|
395
|
+
g.value ? (l(), F(m(Y), {
|
|
381
396
|
key: 1,
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
397
|
+
variant: "muted",
|
|
398
|
+
size: "sm",
|
|
399
|
+
class: "tv-accept-claim",
|
|
400
|
+
disabled: y.value,
|
|
385
401
|
onClick: de
|
|
386
|
-
},
|
|
402
|
+
}, {
|
|
403
|
+
default: j(() => [...u[11] || (u[11] = [
|
|
404
|
+
E("Accept claim", -1)
|
|
405
|
+
])]),
|
|
406
|
+
_: 1
|
|
407
|
+
}, 8, ["disabled"])) : h("", !0)
|
|
387
408
|
]),
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
]),
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
409
|
+
a("div", pt, [
|
|
410
|
+
I(m(he), {
|
|
411
|
+
modelValue: P.value,
|
|
412
|
+
"onUpdate:modelValue": u[0] || (u[0] = (x) => P.value = x),
|
|
413
|
+
size: "sm",
|
|
414
|
+
class: "tv-custom-input flex-1",
|
|
415
|
+
placeholder: "Type a custom value",
|
|
416
|
+
disabled: y.value
|
|
417
|
+
}, null, 8, ["modelValue", "disabled"]),
|
|
418
|
+
I(m(Y), {
|
|
419
|
+
variant: "success",
|
|
420
|
+
size: "sm",
|
|
421
|
+
class: "tv-accept-custom",
|
|
422
|
+
disabled: y.value,
|
|
423
|
+
onClick: fe
|
|
424
|
+
}, {
|
|
425
|
+
default: j(() => [...u[12] || (u[12] = [
|
|
426
|
+
E("Type custom", -1)
|
|
427
|
+
])]),
|
|
428
|
+
_: 1
|
|
429
|
+
}, 8, ["disabled"])
|
|
403
430
|
])
|
|
404
|
-
])) :
|
|
431
|
+
])) : h("", !0)
|
|
405
432
|
])
|
|
406
433
|
]),
|
|
407
434
|
_: 1
|
|
408
435
|
}, 8, ["modelValue", "title", "class"]),
|
|
409
|
-
C.value ? (
|
|
436
|
+
C.value ? (l(), F(m(G), {
|
|
410
437
|
key: 0,
|
|
411
438
|
modelValue: k.value,
|
|
412
|
-
"onUpdate:modelValue":
|
|
439
|
+
"onUpdate:modelValue": u[2] || (u[2] = (x) => k.value = x),
|
|
413
440
|
width: 90,
|
|
414
441
|
height: 90,
|
|
415
442
|
"close-x": "",
|
|
416
|
-
class:
|
|
443
|
+
class: U(m(A))
|
|
417
444
|
}, {
|
|
418
|
-
default:
|
|
419
|
-
C.value.file ? (
|
|
445
|
+
default: j(() => [
|
|
446
|
+
C.value.file ? (l(), F(m(we), {
|
|
420
447
|
key: 0,
|
|
421
448
|
file: C.value.file,
|
|
422
449
|
"related-files": L.value,
|
|
@@ -425,18 +452,18 @@ const Pe = { class: "tv-modal flex flex-col gap-4 text-sm" }, Re = { class: "tv-
|
|
|
425
452
|
sidebar: "",
|
|
426
453
|
zoomable: "",
|
|
427
454
|
class: "h-full"
|
|
428
|
-
}, null, 8, ["file", "related-files"])) :
|
|
455
|
+
}, null, 8, ["file", "related-files"])) : h("", !0)
|
|
429
456
|
]),
|
|
430
457
|
_: 1
|
|
431
|
-
}, 8, ["modelValue", "class"])) :
|
|
458
|
+
}, 8, ["modelValue", "class"])) : h("", !0)
|
|
432
459
|
], 64));
|
|
433
460
|
}
|
|
434
|
-
}),
|
|
461
|
+
}), xt = { class: "tv-field inline-flex items-center gap-1" }, gt = ["contenteditable", "data-editable"], yt = {
|
|
435
462
|
key: 0,
|
|
436
463
|
class: "tv-discrepancy-indicator ml-0.5 text-amber-600",
|
|
437
464
|
title: "Sources disagree",
|
|
438
465
|
"aria-label": "discrepancy"
|
|
439
|
-
},
|
|
466
|
+
}, Kt = /* @__PURE__ */ M({
|
|
440
467
|
__name: "VerifiedField",
|
|
441
468
|
props: {
|
|
442
469
|
source: {},
|
|
@@ -445,251 +472,251 @@ const Pe = { class: "tv-modal flex flex-col gap-4 text-sm" }, Re = { class: "tv-
|
|
|
445
472
|
format: { type: Function }
|
|
446
473
|
},
|
|
447
474
|
setup(e) {
|
|
448
|
-
const t = e,
|
|
449
|
-
var
|
|
450
|
-
return
|
|
451
|
-
}),
|
|
475
|
+
const t = e, n = Q(), f = d(() => n.enabled.value), r = D(null), o = d(() => {
|
|
476
|
+
var y;
|
|
477
|
+
return r.value ? r.value : t.source && t.field ? ((y = t.source.__meta) == null ? void 0 : y[t.field]) ?? null : null;
|
|
478
|
+
}), c = d(() => X(o.value)), g = d(() => {
|
|
452
479
|
if (t.original !== void 0 && t.original !== null) return t.original;
|
|
453
|
-
if (
|
|
480
|
+
if (o.value) return c.value.value;
|
|
454
481
|
if (t.source && t.field) return t.source[t.field];
|
|
455
|
-
}),
|
|
456
|
-
const
|
|
457
|
-
return
|
|
458
|
-
}), w =
|
|
459
|
-
var
|
|
460
|
-
return
|
|
461
|
-
}),
|
|
462
|
-
function
|
|
482
|
+
}), b = d(() => {
|
|
483
|
+
const y = g.value;
|
|
484
|
+
return y == null ? "" : t.format ? t.format(y) : String(y);
|
|
485
|
+
}), w = d(() => {
|
|
486
|
+
var y, S, $;
|
|
487
|
+
return W(($ = (S = (y = o.value) == null ? void 0 : y.candidates) == null ? void 0 : S.extracted) == null ? void 0 : $.confidence);
|
|
488
|
+
}), _ = d(() => re(o.value)), v = d(() => f.value && !!o.value);
|
|
489
|
+
function V(y) {
|
|
463
490
|
var S;
|
|
464
|
-
|
|
491
|
+
r.value = y, (S = t.source) != null && S.__meta && t.field && (t.source.__meta[t.field] = y);
|
|
465
492
|
}
|
|
466
|
-
const L =
|
|
467
|
-
function
|
|
468
|
-
|
|
493
|
+
const L = d(() => Te(n, o, V)), C = d(() => !!L.value), k = D(!1), N = D(!1);
|
|
494
|
+
function B() {
|
|
495
|
+
o.value && (k.value = !0);
|
|
469
496
|
}
|
|
470
|
-
async function
|
|
471
|
-
|
|
472
|
-
const
|
|
473
|
-
!L.value ||
|
|
497
|
+
async function P(y) {
|
|
498
|
+
N.value = !1;
|
|
499
|
+
const $ = (y.target.textContent ?? "").trim();
|
|
500
|
+
!L.value || $ === b.value || await L.value($, "custom");
|
|
474
501
|
}
|
|
475
|
-
return (
|
|
476
|
-
|
|
502
|
+
return (y, S) => (l(), i("span", xt, [
|
|
503
|
+
a("span", {
|
|
477
504
|
class: "tv-field-value",
|
|
478
505
|
contenteditable: C.value,
|
|
479
506
|
"data-editable": C.value ? "true" : "false",
|
|
480
|
-
onFocus: S[0] || (S[0] = (
|
|
481
|
-
onBlur:
|
|
482
|
-
onKeydown: S[1] || (S[1] = xe(
|
|
507
|
+
onFocus: S[0] || (S[0] = ($) => N.value = !0),
|
|
508
|
+
onBlur: P,
|
|
509
|
+
onKeydown: S[1] || (S[1] = me(xe(($) => $.target.blur(), ["prevent"]), ["enter"]))
|
|
483
510
|
}, [
|
|
484
|
-
|
|
485
|
-
value:
|
|
486
|
-
formatted:
|
|
511
|
+
ge(y.$slots, "default", {
|
|
512
|
+
value: g.value,
|
|
513
|
+
formatted: b.value
|
|
487
514
|
}, () => [
|
|
488
|
-
|
|
515
|
+
E(p(b.value), 1)
|
|
489
516
|
])
|
|
490
|
-
], 40,
|
|
491
|
-
v.value ? (
|
|
517
|
+
], 40, gt),
|
|
518
|
+
v.value ? (l(), i("button", {
|
|
492
519
|
key: 0,
|
|
493
520
|
type: "button",
|
|
494
|
-
class:
|
|
521
|
+
class: U(["tv-overlay ml-1 inline-flex items-center", m(A)]),
|
|
495
522
|
title: "View verification detail",
|
|
496
|
-
onClick:
|
|
523
|
+
onClick: B
|
|
497
524
|
}, [
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
], 2)) :
|
|
501
|
-
|
|
525
|
+
I(z, { status: w.value }, null, 8, ["status"]),
|
|
526
|
+
_.value ? (l(), i("span", yt, "⚠")) : h("", !0)
|
|
527
|
+
], 2)) : h("", !0),
|
|
528
|
+
o.value ? (l(), F(mt, {
|
|
502
529
|
key: 1,
|
|
503
530
|
modelValue: k.value,
|
|
504
|
-
"onUpdate:modelValue": S[2] || (S[2] = (
|
|
505
|
-
meta:
|
|
531
|
+
"onUpdate:modelValue": S[2] || (S[2] = ($) => k.value = $),
|
|
532
|
+
meta: o.value,
|
|
506
533
|
label: e.field,
|
|
507
534
|
save: L.value
|
|
508
|
-
}, null, 8, ["modelValue", "meta", "label", "save"])) :
|
|
535
|
+
}, null, 8, ["modelValue", "meta", "label", "save"])) : h("", !0)
|
|
509
536
|
]));
|
|
510
537
|
}
|
|
511
538
|
}), _t = /* @__PURE__ */ new Set(["name", "type"]);
|
|
512
|
-
function
|
|
513
|
-
const
|
|
514
|
-
return
|
|
539
|
+
function bt(e, t = "") {
|
|
540
|
+
const n = [];
|
|
541
|
+
return J(e, t, n), n;
|
|
515
542
|
}
|
|
516
|
-
function
|
|
543
|
+
function J(e, t, n) {
|
|
517
544
|
if (Array.isArray(e)) {
|
|
518
|
-
e.forEach((
|
|
545
|
+
e.forEach((o, c) => J(o, `${t}[${c}]`, n));
|
|
519
546
|
return;
|
|
520
547
|
}
|
|
521
|
-
if (!
|
|
522
|
-
const
|
|
523
|
-
for (const [
|
|
524
|
-
if (
|
|
525
|
-
const
|
|
526
|
-
if (Array.isArray(
|
|
527
|
-
|
|
548
|
+
if (!ne(e)) return;
|
|
549
|
+
const r = e.__meta ?? {};
|
|
550
|
+
for (const [o, c] of Object.entries(e)) {
|
|
551
|
+
if (o === "__meta") continue;
|
|
552
|
+
const g = t ? `${t}.${o}` : o;
|
|
553
|
+
if (Array.isArray(c) || ne(c)) {
|
|
554
|
+
J(c, g, n);
|
|
528
555
|
continue;
|
|
529
556
|
}
|
|
530
|
-
const
|
|
531
|
-
!
|
|
532
|
-
path:
|
|
533
|
-
label:
|
|
534
|
-
meta:
|
|
535
|
-
value:
|
|
536
|
-
unanchored: !
|
|
557
|
+
const b = r[o];
|
|
558
|
+
!b && _t.has(o) || n.push({
|
|
559
|
+
path: g,
|
|
560
|
+
label: o,
|
|
561
|
+
meta: b ?? null,
|
|
562
|
+
value: c,
|
|
563
|
+
unanchored: !b
|
|
537
564
|
});
|
|
538
565
|
}
|
|
539
566
|
}
|
|
540
|
-
function
|
|
567
|
+
function ne(e) {
|
|
541
568
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
542
569
|
}
|
|
543
|
-
const ht = { class: "tv-comparison-page flex flex-col gap-4" },
|
|
570
|
+
const ht = { class: "tv-comparison-page flex flex-col gap-4" }, wt = {
|
|
544
571
|
key: 0,
|
|
545
572
|
class: "tv-comparison-empty text-gray-400"
|
|
546
|
-
},
|
|
573
|
+
}, kt = {
|
|
547
574
|
key: 1,
|
|
548
575
|
class: "tv-anchored-group flex flex-col gap-3"
|
|
549
|
-
},
|
|
576
|
+
}, St = { class: "flex items-center gap-2" }, Vt = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, $t = { class: "tv-datapoint-resolved font-medium" }, Ct = {
|
|
550
577
|
key: 0,
|
|
551
578
|
class: "tv-datapoint-discrepancy text-xs font-medium text-amber-600"
|
|
552
|
-
},
|
|
579
|
+
}, Ot = { class: "tv-datapoint-candidates ml-4 text-xs text-gray-600" }, It = { class: "font-medium" }, Lt = {
|
|
553
580
|
key: 0,
|
|
554
581
|
class: "tv-datapoint-reasoning ml-4 text-xs italic text-gray-500"
|
|
555
|
-
},
|
|
582
|
+
}, Ut = {
|
|
556
583
|
key: 1,
|
|
557
584
|
class: "tv-datapoint-cited ml-4 text-xs text-gray-500"
|
|
558
|
-
},
|
|
585
|
+
}, Dt = { class: "tv-datapoint-sources ml-4 text-xs text-gray-500" }, Et = ["href"], Tt = { key: 1 }, At = { class: "ml-1" }, Nt = {
|
|
559
586
|
key: 2,
|
|
560
587
|
class: "tv-unanchored-group flex flex-col gap-1"
|
|
561
|
-
},
|
|
588
|
+
}, jt = { class: "tv-datapoint-path font-mono text-xs text-gray-500" }, Ft = { class: "tv-datapoint-value" }, Pt = /* @__PURE__ */ M({
|
|
562
589
|
__name: "ComparisonPage",
|
|
563
590
|
setup(e) {
|
|
564
|
-
const t =
|
|
565
|
-
function
|
|
566
|
-
const
|
|
567
|
-
return
|
|
591
|
+
const t = Q(), n = d(() => bt(t.data)), f = d(() => n.value.filter((w) => !w.unanchored)), r = d(() => n.value.filter((w) => w.unanchored));
|
|
592
|
+
function o(w) {
|
|
593
|
+
const _ = X(w).value;
|
|
594
|
+
return _ == null ? "" : String(_);
|
|
568
595
|
}
|
|
569
|
-
function
|
|
596
|
+
function c(w) {
|
|
570
597
|
return w == null ? "" : String(w);
|
|
571
598
|
}
|
|
572
|
-
function
|
|
573
|
-
var
|
|
574
|
-
return (
|
|
599
|
+
function g(w) {
|
|
600
|
+
var _, v, V;
|
|
601
|
+
return (V = (v = (_ = w.meta) == null ? void 0 : _.candidates) == null ? void 0 : v.extracted) == null ? void 0 : V.confidence;
|
|
575
602
|
}
|
|
576
|
-
function
|
|
577
|
-
var
|
|
578
|
-
const
|
|
579
|
-
if (!
|
|
603
|
+
function b(w) {
|
|
604
|
+
var V;
|
|
605
|
+
const _ = (V = w.meta) == null ? void 0 : V.candidates;
|
|
606
|
+
if (!_) return [];
|
|
580
607
|
const v = [];
|
|
581
|
-
return
|
|
608
|
+
return _.override && v.push({ source: "override", value: _.override.value }), _.extracted && v.push({ source: "extracted", value: _.extracted.value }), _.claim && v.push({ source: "claim", value: _.claim.value }), v;
|
|
582
609
|
}
|
|
583
|
-
return (w,
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
(
|
|
588
|
-
var
|
|
589
|
-
return
|
|
610
|
+
return (w, _) => (l(), i("div", ht, [
|
|
611
|
+
_[1] || (_[1] = a("h2", { class: "tv-comparison-title text-lg font-semibold" }, "Verification comparison", -1)),
|
|
612
|
+
n.value.length === 0 ? (l(), i("p", wt, " No data points to compare. ")) : h("", !0),
|
|
613
|
+
f.value.length ? (l(), i("section", kt, [
|
|
614
|
+
(l(!0), i(O, null, T(f.value, (v) => {
|
|
615
|
+
var V, L, C;
|
|
616
|
+
return l(), i("div", {
|
|
590
617
|
key: v.path,
|
|
591
618
|
class: "tv-datapoint border-t border-gray-100 pt-2"
|
|
592
619
|
}, [
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
confidence:
|
|
620
|
+
a("div", St, [
|
|
621
|
+
a("span", Vt, p(v.path), 1),
|
|
622
|
+
a("span", $t, p(o(v.meta)), 1),
|
|
623
|
+
I(z, {
|
|
624
|
+
confidence: g(v),
|
|
598
625
|
"show-label": ""
|
|
599
626
|
}, null, 8, ["confidence"]),
|
|
600
|
-
|
|
627
|
+
m(re)(v.meta) ? (l(), i("span", Ct, "⚠ discrepancy")) : h("", !0)
|
|
601
628
|
]),
|
|
602
|
-
|
|
603
|
-
(
|
|
629
|
+
a("ul", Ot, [
|
|
630
|
+
(l(!0), i(O, null, T(b(v), (k) => (l(), i("li", {
|
|
604
631
|
key: k.source,
|
|
605
632
|
class: "tv-candidate"
|
|
606
633
|
}, [
|
|
607
|
-
|
|
608
|
-
|
|
634
|
+
a("span", It, p(k.source) + ":", 1),
|
|
635
|
+
E(" " + p(c(k.value)), 1)
|
|
609
636
|
]))), 128))
|
|
610
637
|
]),
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
(
|
|
615
|
-
key:
|
|
638
|
+
m(H)(v.meta) ? (l(), i("p", Lt, p(m(H)(v.meta)), 1)) : h("", !0),
|
|
639
|
+
m(q)(v.meta) ? (l(), i("p", Ut, " “" + p(m(q)(v.meta)) + "” ", 1)) : h("", !0),
|
|
640
|
+
a("ul", Dt, [
|
|
641
|
+
(l(!0), i(O, null, T(m(oe)((C = (L = (V = v.meta) == null ? void 0 : V.candidates) == null ? void 0 : L.extracted) == null ? void 0 : C.sources), (k, N) => (l(), i("li", {
|
|
642
|
+
key: N,
|
|
616
643
|
class: "tv-source-group"
|
|
617
644
|
}, [
|
|
618
|
-
k.fileUrl ? (
|
|
645
|
+
k.fileUrl ? (l(), i("a", {
|
|
619
646
|
key: 0,
|
|
620
647
|
href: k.fileUrl,
|
|
621
648
|
class: "tv-source-link text-blue-600 underline",
|
|
622
649
|
target: "_blank",
|
|
623
650
|
rel: "noopener"
|
|
624
|
-
},
|
|
625
|
-
|
|
651
|
+
}, p(k.fileLabel), 9, Et)) : (l(), i("span", Tt, p(k.fileLabel), 1)),
|
|
652
|
+
a("span", At, "(" + p(k.sources.map(m(ue)).join(", ")) + ")", 1)
|
|
626
653
|
]))), 128))
|
|
627
654
|
])
|
|
628
655
|
]);
|
|
629
656
|
}), 128))
|
|
630
|
-
])) :
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
(
|
|
657
|
+
])) : h("", !0),
|
|
658
|
+
r.value.length ? (l(), i("section", Nt, [
|
|
659
|
+
_[0] || (_[0] = a("h3", { class: "tv-unanchored-title text-sm font-semibold text-gray-500" }, " Unanchored / not from source ", -1)),
|
|
660
|
+
(l(!0), i(O, null, T(r.value, (v) => (l(), i("div", {
|
|
634
661
|
key: v.path,
|
|
635
662
|
class: "tv-unanchored-datapoint flex items-center gap-2 text-sm"
|
|
636
663
|
}, [
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
664
|
+
a("span", jt, p(v.path), 1),
|
|
665
|
+
a("span", Ft, p(c(v.value)), 1),
|
|
666
|
+
I(z, { status: "unverifiable" })
|
|
640
667
|
]))), 128))
|
|
641
|
-
])) :
|
|
668
|
+
])) : h("", !0)
|
|
642
669
|
]));
|
|
643
670
|
}
|
|
644
|
-
}), Mt = { class: "tv-enable-toggle flex items-center justify-between text-sm" },
|
|
671
|
+
}), Mt = { class: "tv-enable-toggle flex items-center justify-between text-sm" }, Yt = /* @__PURE__ */ M({
|
|
645
672
|
__name: "VerificationChrome",
|
|
646
673
|
setup(e) {
|
|
647
|
-
const { enabled: t, openComparison:
|
|
648
|
-
function
|
|
649
|
-
|
|
674
|
+
const { enabled: t, openComparison: n } = Q(), f = Oe(), r = D(!1);
|
|
675
|
+
function o() {
|
|
676
|
+
n(), r.value = !1;
|
|
650
677
|
}
|
|
651
|
-
return (
|
|
652
|
-
|
|
678
|
+
return (c, g) => (l(), i(O, null, [
|
|
679
|
+
a("button", {
|
|
653
680
|
type: "button",
|
|
654
|
-
class:
|
|
681
|
+
class: U(["tv-settings-button fixed bottom-4 right-4 z-50 flex h-10 w-10 items-center justify-center rounded-full bg-gray-800 text-white shadow-lg", m(A)]),
|
|
655
682
|
title: "Verification settings",
|
|
656
|
-
onClick:
|
|
683
|
+
onClick: g[0] || (g[0] = (b) => r.value = !r.value)
|
|
657
684
|
}, [
|
|
658
|
-
|
|
659
|
-
icon:
|
|
685
|
+
I(m(ke), {
|
|
686
|
+
icon: m(Se),
|
|
660
687
|
class: "h-5 w-5"
|
|
661
688
|
}, null, 8, ["icon"])
|
|
662
689
|
], 2),
|
|
663
|
-
|
|
690
|
+
r.value ? (l(), i("div", {
|
|
664
691
|
key: 0,
|
|
665
|
-
class:
|
|
692
|
+
class: U(["tv-settings-panel fixed bottom-16 right-4 z-50 flex w-56 flex-col gap-3 rounded-lg bg-white p-4 shadow-xl ring-1 ring-gray-200", m(A)])
|
|
666
693
|
}, [
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
"onUpdate:modelValue":
|
|
694
|
+
a("label", Mt, [
|
|
695
|
+
g[3] || (g[3] = a("span", null, "Verification overlay", -1)),
|
|
696
|
+
ye(a("input", {
|
|
697
|
+
"onUpdate:modelValue": g[1] || (g[1] = (b) => te(t) ? t.value = b : null),
|
|
671
698
|
type: "checkbox",
|
|
672
699
|
class: "tv-enable-checkbox"
|
|
673
700
|
}, null, 512), [
|
|
674
|
-
[
|
|
701
|
+
[_e, m(t)]
|
|
675
702
|
])
|
|
676
703
|
]),
|
|
677
|
-
|
|
704
|
+
a("button", {
|
|
678
705
|
type: "button",
|
|
679
|
-
class:
|
|
680
|
-
onClick:
|
|
706
|
+
class: U(["tv-open-comparison rounded border px-2 py-1 text-sm", m(A)]),
|
|
707
|
+
onClick: o
|
|
681
708
|
}, "Open comparison page", 2)
|
|
682
|
-
], 2)) :
|
|
683
|
-
|
|
684
|
-
modelValue:
|
|
685
|
-
"onUpdate:modelValue":
|
|
709
|
+
], 2)) : h("", !0),
|
|
710
|
+
I(m(G), {
|
|
711
|
+
modelValue: m(f),
|
|
712
|
+
"onUpdate:modelValue": g[2] || (g[2] = (b) => te(f) ? f.value = b : null),
|
|
686
713
|
title: "Verification comparison",
|
|
687
714
|
width: 80,
|
|
688
715
|
"close-x": "",
|
|
689
|
-
class:
|
|
716
|
+
class: U(m(A))
|
|
690
717
|
}, {
|
|
691
|
-
default:
|
|
692
|
-
|
|
718
|
+
default: j(() => [
|
|
719
|
+
I(Pt)
|
|
693
720
|
]),
|
|
694
721
|
_: 1
|
|
695
722
|
}, 8, ["modelValue", "class"])
|
|
@@ -697,26 +724,26 @@ const ht = { class: "tv-comparison-page flex flex-col gap-4" }, bt = {
|
|
|
697
724
|
}
|
|
698
725
|
});
|
|
699
726
|
export {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
727
|
+
A as CHROME_CLASS,
|
|
728
|
+
Pt as ComparisonPage,
|
|
729
|
+
z as ConfidenceIcon,
|
|
730
|
+
le as ENABLED_STORAGE_KEY,
|
|
704
731
|
ie as RESOLUTION_PRIORITY,
|
|
705
|
-
|
|
732
|
+
Ie as STATUS_COLORS,
|
|
706
733
|
Le as STATUS_LABELS,
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
734
|
+
Yt as VerificationChrome,
|
|
735
|
+
mt as VerificationModal,
|
|
736
|
+
Kt as VerifiedField,
|
|
737
|
+
W as bucketConfidence,
|
|
738
|
+
De as candidatesDisagree,
|
|
739
|
+
q as citedTextOf,
|
|
740
|
+
oe as groupSources,
|
|
741
|
+
re as hasDiscrepancy,
|
|
742
|
+
Bt as initVerification,
|
|
743
|
+
H as reasoningOf,
|
|
744
|
+
Ue as resolveCandidates,
|
|
745
|
+
X as resolveDataPoint,
|
|
719
746
|
ue as sourceRowLabel,
|
|
720
|
-
|
|
721
|
-
|
|
747
|
+
Q as useVerification,
|
|
748
|
+
bt as walkDataPoints
|
|
722
749
|
};
|