@thehammer/template-verification 0.2.17 → 0.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import { ref as P, watch as z, defineComponent as Y, computed as i, openBlock as u, createElementBlock as v, normalizeClass as y, createElementVNode as p, toDisplayString as k, createCommentVNode as S, createBlock as B, unref as f, Fragment as F, renderSlot as oe, createVNode as D, withModifiers as Q, withDirectives as se, isRef as ue, vModelCheckbox as ce } from "vue";
1
+ import { ref as M, watch as z, defineComponent as Y, computed as i, openBlock as u, createElementBlock as v, normalizeClass as w, createElementVNode as p, toDisplayString as k, createCommentVNode as S, createBlock as B, unref as d, Fragment as F, renderSlot as oe, createVNode as L, withModifiers as W, withDirectives as se, isRef as ue, vModelCheckbox as ce } from "vue";
2
2
  import { DanxSkeleton as de, useToast as fe, DanxIcon as ve, gearIcon as pe, DanxBadge as ge, DanxProgressBar as me, DanxToastContainer as be } from "@thehammer/danx-ui";
3
3
  import { CodeViewer as he } from "@thehammer/danx-ui/components/code-viewer";
4
- const T = "tv-chrome", X = "template-verification:enabled";
5
- let L = null;
4
+ const R = "tv-chrome", we = "tv-editable", Z = "template-verification:enabled";
5
+ let N = null;
6
6
  function ye(e) {
7
7
  var t;
8
8
  try {
@@ -11,22 +11,22 @@ function ye(e) {
11
11
  return null;
12
12
  }
13
13
  }
14
- function we(e, t) {
15
- var r;
14
+ function xe(e, t) {
15
+ var n;
16
16
  try {
17
- (r = globalThis.localStorage) == null || r.setItem(e, t);
17
+ (n = globalThis.localStorage) == null || n.setItem(e, t);
18
18
  } catch {
19
19
  }
20
20
  }
21
- function xe(e) {
22
- const t = ye(X);
21
+ function _e(e) {
22
+ const t = ye(Z);
23
23
  return t === null ? e : t === "true";
24
24
  }
25
- function Z(e) {
26
- const t = P(xe((e == null ? void 0 : e.defaultEnabled) ?? !1));
25
+ function ee(e) {
26
+ const t = M(_e((e == null ? void 0 : e.defaultEnabled) ?? !1));
27
27
  return z(
28
28
  t,
29
- (r) => we(X, r ? "true" : "false")
29
+ (n) => xe(Z, n ? "true" : "false")
30
30
  ), {
31
31
  enabled: t,
32
32
  data: (e == null ? void 0 : e.data) ?? {},
@@ -34,14 +34,14 @@ function Z(e) {
34
34
  loading: (e == null ? void 0 : e.loading) ?? !1
35
35
  };
36
36
  }
37
- function _e() {
38
- return L || (L = Z()), L;
37
+ function ke() {
38
+ return N || (N = ee()), N;
39
39
  }
40
- function nt(e) {
41
- L = Z(e);
40
+ function rt(e) {
41
+ N = ee(e);
42
42
  }
43
- function ee() {
44
- const e = _e();
43
+ function te() {
44
+ const e = ke();
45
45
  return {
46
46
  enabled: e.enabled,
47
47
  data: e.data,
@@ -49,10 +49,10 @@ function ee() {
49
49
  loading: e.loading
50
50
  };
51
51
  }
52
- function te(e) {
52
+ function ne(e) {
53
53
  return typeof e != "number" || Number.isNaN(e) ? "unverifiable" : e <= 2 ? "low" : e === 3 ? "medium" : "high";
54
54
  }
55
- const ke = {
55
+ const Se = {
56
56
  high: "bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20",
57
57
  medium: "bg-yellow-50 text-yellow-700 ring-1 ring-inset ring-yellow-600/20",
58
58
  low: "bg-red-50 text-red-700 ring-1 ring-inset ring-red-600/20",
@@ -60,66 +60,66 @@ const ke = {
60
60
  // Same red family as 'low' (color-family-per-status is load-bearing, see docblock
61
61
  // above) but a visibly darker/more saturated shade so the two stay distinguishable.
62
62
  failed: "bg-red-100 text-red-800 ring-1 ring-inset ring-red-700/30"
63
- }, N = {
63
+ }, P = {
64
64
  high: "High",
65
65
  medium: "Medium",
66
66
  low: "Low",
67
67
  unverifiable: "Unverifiable",
68
68
  failed: "Failed"
69
- }, ne = ["override", "extracted", "claim"];
70
- function Se(e) {
71
- return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved : Ie(e.candidates) : { value: null, source: "none" };
72
- }
69
+ }, re = ["override", "extracted", "claim"];
73
70
  function Ie(e) {
71
+ return e ? e.resolved && e.resolved.source && e.resolved.source !== "none" ? e.resolved : Ce(e.candidates) : { value: null, source: "none" };
72
+ }
73
+ function Ce(e) {
74
74
  if (e)
75
- for (const t of ne) {
76
- const r = e[t];
77
- if (r != null)
78
- return { value: r.value, source: t };
75
+ for (const t of re) {
76
+ const n = e[t];
77
+ if (n != null)
78
+ return { value: n.value, source: t };
79
79
  }
80
80
  return { value: null, source: "none" };
81
81
  }
82
82
  function $e(e) {
83
- return e ? typeof e.discrepancy == "boolean" ? e.discrepancy : Ce(e.candidates) : !1;
83
+ return e ? typeof e.discrepancy == "boolean" ? e.discrepancy : Ae(e.candidates) : !1;
84
84
  }
85
- function Ce(e) {
85
+ function Ae(e) {
86
86
  if (!e) return !1;
87
- const t = ne.map((r) => e[r]).filter((r) => r != null).map((r) => Ae(r.value));
87
+ const t = re.map((n) => e[n]).filter((n) => n != null).map((n) => Ee(n.value));
88
88
  return t.length < 2 ? !1 : new Set(t).size > 1;
89
89
  }
90
- function Ae(e) {
90
+ function Ee(e) {
91
91
  return JSON.stringify(e ?? null);
92
92
  }
93
- function Ee(e) {
93
+ function Te(e) {
94
94
  return !!(e != null && e.source_discrepancy);
95
95
  }
96
- function Te(e) {
96
+ function Re(e) {
97
97
  return !!(e != null && e.correction);
98
98
  }
99
- const Re = "danxbot-template", Oe = 1, Ve = "data-point-activated";
100
- function De() {
99
+ const Oe = "danxbot-template", Ve = 1, De = "data-point-activated";
100
+ function Le() {
101
101
  if (typeof window > "u") return null;
102
102
  const e = window.location.ancestorOrigins, t = e && e.length > 0 ? e[0] : null;
103
103
  if (t && t !== "null") return t;
104
- const r = typeof document > "u" ? "" : document.referrer;
105
- if (!r) return null;
104
+ const n = typeof document > "u" ? "" : document.referrer;
105
+ if (!n) return null;
106
106
  try {
107
- const d = new URL(r).origin;
108
- return d === "null" ? null : d;
107
+ const f = new URL(n).origin;
108
+ return f === "null" ? null : f;
109
109
  } catch {
110
110
  return null;
111
111
  }
112
112
  }
113
- function Le(e) {
113
+ function Ne(e) {
114
114
  if (typeof window > "u") return !1;
115
115
  const t = window.parent;
116
116
  if (!t || t === window) return !1;
117
- const r = De();
118
- if (!r) return !1;
119
- const d = {
120
- source: Re,
121
- version: Oe,
122
- type: Ve,
117
+ const n = Le();
118
+ if (!n) return !1;
119
+ const f = {
120
+ source: Oe,
121
+ version: Ve,
122
+ type: De,
123
123
  anchor: {
124
124
  object_ids: [...e.anchor.object_ids],
125
125
  field: e.anchor.field,
@@ -129,72 +129,72 @@ function Le(e) {
129
129
  label: e.label ?? null,
130
130
  value: e.value ?? null
131
131
  };
132
- return t.postMessage(d, r), !0;
132
+ return t.postMessage(f, n), !0;
133
133
  }
134
- const Ne = /* @__PURE__ */ new Set(["name", "type"]);
135
- function re(e, t = "") {
136
- const r = [];
137
- return U(e, t, r), r;
134
+ const Pe = /* @__PURE__ */ new Set(["name", "type"]);
135
+ function ae(e, t = "") {
136
+ const n = [];
137
+ return U(e, t, n), n;
138
138
  }
139
- function U(e, t, r) {
139
+ function U(e, t, n) {
140
140
  if (Array.isArray(e)) {
141
- e.forEach((a, c) => U(a, `${t}[${c}]`, r));
141
+ e.forEach((r, c) => U(r, `${t}[${c}]`, n));
142
142
  return;
143
143
  }
144
- if (!W(e)) return;
144
+ if (!X(e)) return;
145
145
  const m = e.__meta ?? {};
146
- for (const [a, c] of Object.entries(e)) {
147
- if (a === "__meta") continue;
148
- const h = t ? `${t}.${a}` : a;
149
- if (Array.isArray(c) || W(c)) {
150
- U(c, h, r);
146
+ for (const [r, c] of Object.entries(e)) {
147
+ if (r === "__meta") continue;
148
+ const h = t ? `${t}.${r}` : r;
149
+ if (Array.isArray(c) || X(c)) {
150
+ U(c, h, n);
151
151
  continue;
152
152
  }
153
- const g = m[a];
154
- !g && Ne.has(a) || r.push({
153
+ const g = m[r];
154
+ !g && Pe.has(r) || n.push({
155
155
  path: h,
156
- label: a,
156
+ label: r,
157
157
  meta: g ?? null,
158
158
  value: c,
159
159
  unanchored: !g
160
160
  });
161
161
  }
162
162
  }
163
- function W(e) {
163
+ function X(e) {
164
164
  return typeof e == "object" && e !== null && !Array.isArray(e);
165
165
  }
166
- function ae(e) {
167
- var r;
166
+ function le(e) {
167
+ var n;
168
168
  if (e.candidates.override) return !1;
169
- const t = (r = e.candidates.extracted) == null ? void 0 : r.confidence;
169
+ const t = (n = e.candidates.extracted) == null ? void 0 : n.confidence;
170
170
  return e.discrepancy || t == null || t <= 2;
171
171
  }
172
- function Pe(e) {
173
- const t = re(e).filter(
174
- (a) => a.meta !== null
175
- ), r = t.length;
176
- let d = 0, m = 0;
177
- for (const a of t) {
178
- if (a.meta.candidates.override) {
179
- d++;
172
+ function Me(e) {
173
+ const t = ae(e).filter(
174
+ (r) => r.meta !== null
175
+ ), n = t.length;
176
+ let f = 0, m = 0;
177
+ for (const r of t) {
178
+ if (r.meta.candidates.override) {
179
+ f++;
180
180
  continue;
181
181
  }
182
- ae(a.meta) && m++;
182
+ le(r.meta) && m++;
183
183
  }
184
184
  return {
185
- total: r,
186
- verified: d,
185
+ total: n,
186
+ verified: f,
187
187
  needsReview: m,
188
- percent: r === 0 ? 100 : Math.round(d / r * 100)
188
+ percent: n === 0 ? 100 : Math.round(f / n * 100)
189
189
  };
190
190
  }
191
- const Me = ["data-status", "title"], je = {
191
+ const je = ["data-status", "title"], Be = {
192
192
  class: "tv-confidence-glyph",
193
193
  "aria-hidden": "true"
194
- }, Be = {
194
+ }, Fe = {
195
195
  key: 0,
196
196
  class: "tv-confidence-label"
197
- }, Fe = /* @__PURE__ */ Y({
197
+ }, Ue = /* @__PURE__ */ Y({
198
198
  __name: "ConfidenceIcon",
199
199
  props: {
200
200
  confidence: {},
@@ -202,9 +202,9 @@ const Me = ["data-status", "title"], je = {
202
202
  showLabel: { type: Boolean }
203
203
  },
204
204
  setup(e) {
205
- const t = e, r = i(
206
- () => t.status ?? te(t.confidence)
207
- ), d = {
205
+ const t = e, n = i(
206
+ () => t.status ?? ne(t.confidence)
207
+ ), f = {
208
208
  high: "✔",
209
209
  // check
210
210
  medium: "⚠",
@@ -214,36 +214,36 @@ const Me = ["data-status", "title"], je = {
214
214
  unverifiable: "?",
215
215
  failed: "⊗"
216
216
  // circled x — distinct from low's plain x
217
- }, m = i(() => d[r.value]), a = i(() => ke[r.value]), c = i(() => N[r.value]);
217
+ }, m = i(() => f[n.value]), r = i(() => Se[n.value]), c = i(() => P[n.value]);
218
218
  return (h, g) => (u(), v("span", {
219
- class: y(["tv-confidence-icon inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-none", a.value]),
220
- "data-status": r.value,
219
+ class: w(["tv-confidence-icon inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold leading-none", r.value]),
220
+ "data-status": n.value,
221
221
  title: c.value
222
222
  }, [
223
- p("span", je, k(m.value), 1),
224
- e.showLabel ? (u(), v("span", Be, k(c.value), 1)) : S("", !0)
225
- ], 10, Me));
223
+ p("span", Be, k(m.value), 1),
224
+ e.showLabel ? (u(), v("span", Fe, k(c.value), 1)) : S("", !0)
225
+ ], 10, je));
226
226
  }
227
- }), Ue = {
227
+ }), ze = {
228
228
  key: 0,
229
229
  class: "tv-mark-anchor"
230
- }, ze = ["aria-label", "title"], Ye = {
230
+ }, Ye = ["aria-label", "title"], Ge = {
231
231
  key: 1,
232
232
  class: "tv-verified-chip tv-audit-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",
233
233
  "data-status": "audited"
234
- }, Ge = {
234
+ }, He = {
235
235
  key: 2,
236
236
  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",
237
237
  "data-status": "verified"
238
- }, He = {
238
+ }, qe = {
239
239
  key: 3,
240
240
  class: "tv-verified-chip tv-verified-chip-empty inline-flex items-center gap-1 rounded-full border-2 border-dashed border-green-600 bg-transparent px-2 py-0.5 text-[11px] font-semibold leading-none text-green-600",
241
241
  "data-status": "verified-empty"
242
- }, qe = {
242
+ }, Ke = {
243
243
  key: 5,
244
244
  class: "tv-correction-indicator ml-0.5 text-blue-500",
245
245
  "aria-hidden": !0
246
- }, rt = /* @__PURE__ */ Y({
246
+ }, at = /* @__PURE__ */ Y({
247
247
  __name: "VerifiedField",
248
248
  props: {
249
249
  source: {},
@@ -252,74 +252,76 @@ const Me = ["data-status", "title"], je = {
252
252
  format: { type: Function }
253
253
  },
254
254
  setup(e) {
255
- const t = e, r = ee(), d = i(() => r.enabled.value), m = i(() => r.loading), a = i(() => {
256
- var n;
257
- return t.source && t.field ? ((n = t.source.__meta) == null ? void 0 : n[t.field]) ?? null : null;
258
- }), c = i(() => Se(a.value)), h = i(() => {
255
+ const t = e, n = te(), f = i(() => n.enabled.value), m = i(() => n.loading), r = i(() => {
256
+ var a;
257
+ return t.source && t.field ? ((a = t.source.__meta) == null ? void 0 : a[t.field]) ?? null : null;
258
+ }), c = i(() => Ie(r.value)), h = i(() => {
259
259
  if (t.original !== void 0 && t.original !== null)
260
260
  return t.original;
261
- if (a.value && c.value.value !== null && c.value.value !== void 0)
261
+ if (r.value && c.value.value !== null && c.value.value !== void 0)
262
262
  return c.value.value;
263
263
  if (t.source && t.field) return t.source[t.field];
264
264
  }), g = i(() => {
265
- const n = h.value;
266
- return n == null ? "" : typeof t.format == "function" ? t.format(n) : String(n);
267
- }), R = i(() => {
268
- var l, o;
269
- const n = (o = (l = a.value) == null ? void 0 : l.candidates) == null ? void 0 : o.extracted;
270
- return (n == null ? void 0 : n.state) === "failed" ? "failed" : te(n == null ? void 0 : n.confidence);
271
- }), b = i(() => $e(a.value)), s = i(() => Ee(a.value)), w = i(() => !b.value && Te(a.value)), x = i(() => {
272
- var n, l;
273
- return !!((l = (n = a.value) == null ? void 0 : n.candidates) != null && l.override);
265
+ const a = h.value;
266
+ return a == null ? "" : typeof t.format == "function" ? t.format(a) : String(a);
274
267
  }), O = i(() => {
275
- var n, l, o;
276
- return ((o = (l = (n = a.value) == null ? void 0 : n.candidates) == null ? void 0 : l.extracted) == null ? void 0 : o.source) ?? null;
277
- }), C = i(() => !x.value && O.value === "audit"), I = i(() => {
278
- var n, l, o;
279
- return x.value ? ((o = (l = (n = a.value) == null ? void 0 : n.candidates) == null ? void 0 : l.override) == null ? void 0 : o.value) === null ? "confirmed-empty" : "confirmed" : "unverified";
268
+ var l, o;
269
+ const a = (o = (l = r.value) == null ? void 0 : l.candidates) == null ? void 0 : o.extracted;
270
+ return (a == null ? void 0 : a.state) === "failed" ? "failed" : ne(a == null ? void 0 : a.confidence);
271
+ }), b = i(() => $e(r.value)), s = i(() => Te(r.value)), y = i(() => !b.value && Re(r.value)), x = i(() => {
272
+ var a, l;
273
+ return !!((l = (a = r.value) == null ? void 0 : a.candidates) != null && l.override);
280
274
  }), V = i(() => {
281
- var l;
282
- const n = (l = a.value) == null ? void 0 : l.candidates;
283
- return !!(n != null && n.override || n != null && n.extracted || n != null && n.claim);
284
- }), A = i(() => d.value), le = i(() => {
285
- const n = a.value;
286
- return A.value && !!n && ae(n);
287
- }), M = i(() => {
288
- var n;
289
- return !!((n = a.value) != null && n.anchor);
275
+ var a, l, o;
276
+ return ((o = (l = (a = r.value) == null ? void 0 : a.candidates) == null ? void 0 : l.extracted) == null ? void 0 : o.source) ?? null;
277
+ }), $ = i(() => !x.value && V.value === "audit"), I = i(() => {
278
+ var a, l, o;
279
+ return x.value ? ((o = (l = (a = r.value) == null ? void 0 : a.candidates) == null ? void 0 : l.override) == null ? void 0 : o.value) === null ? "confirmed-empty" : "confirmed" : "unverified";
280
+ }), A = i(() => f.value), D = i(() => {
281
+ const a = r.value;
282
+ return A.value && !!a && le(a);
283
+ }), T = i(() => {
284
+ var a;
285
+ return A.value && !!((a = r.value) != null && a.anchor);
290
286
  }), G = i(() => {
291
- var q, K, J;
292
- const n = t.field ?? "This value", l = M.value ? " — open in the review panel" : "";
287
+ var K, J, Q;
288
+ const a = t.field ?? "This value", l = T.value ? " — open in the review panel" : " — no place to record a correction";
293
289
  if (I.value === "confirmed-empty")
294
- return `${n}: a person confirmed this field is genuinely blank${l}`;
295
- if (x.value) return `${n}: verified by a person${l}`;
296
- const o = (K = (q = a.value) == null ? void 0 : q.candidates) == null ? void 0 : K.extracted, E = R.value, _ = [];
297
- let $;
298
- E === "failed" ? $ = N.failed : (o == null ? void 0 : o.confidence) != null ? $ = `${N[E]} (${o.confidence}/5)` : $ = N[E], _.push(C.value ? `Verified by audit — ${$}` : $);
299
- const j = (o == null ? void 0 : o.sources_count) ?? ((J = o == null ? void 0 : o.sources) == null ? void 0 : J.length) ?? 0;
300
- return j > 0 && _.push(`${j} cited ${j === 1 ? "page" : "pages"}`), b.value ? _.push(s.value ? "source document conflict" : "sources disagree") : w.value && _.push("value corrected"), `${n}: ${_.join(", ")}${l}`;
290
+ return `${a}: a person confirmed this field is genuinely blank${l}`;
291
+ if (x.value) return `${a}: verified by a person${l}`;
292
+ const o = (J = (K = r.value) == null ? void 0 : K.candidates) == null ? void 0 : J.extracted, E = O.value, _ = [];
293
+ let C;
294
+ E === "failed" ? C = P.failed : (o == null ? void 0 : o.confidence) != null ? C = `${P[E]} (${o.confidence}/5)` : C = P[E], _.push($.value ? `Verified by audit — ${C}` : C);
295
+ const j = (o == null ? void 0 : o.sources_count) ?? ((Q = o == null ? void 0 : o.sources) == null ? void 0 : Q.length) ?? 0;
296
+ return j > 0 && _.push(`${j} cited ${j === 1 ? "page" : "pages"}`), b.value ? _.push(s.value ? "source document conflict" : "sources disagree") : y.value && _.push("value corrected"), `${a}: ${_.join(", ")}${l}`;
301
297
  });
302
- function ie() {
298
+ function H() {
303
299
  var l;
304
- const n = (l = a.value) == null ? void 0 : l.anchor;
305
- n && Le({
306
- anchor: n,
307
- workflowInputId: r.workflowInputId,
300
+ const a = (l = r.value) == null ? void 0 : l.anchor;
301
+ a && Ne({
302
+ anchor: a,
303
+ workflowInputId: n.workflowInputId,
308
304
  label: t.field ?? null,
309
305
  value: g.value
310
306
  });
311
307
  }
312
- const H = P(null);
308
+ function ie() {
309
+ var l;
310
+ if (!T.value) return;
311
+ const a = typeof window > "u" ? null : (l = window.getSelection) == null ? void 0 : l.call(window);
312
+ a && !a.isCollapsed || H();
313
+ }
314
+ const q = M(null);
313
315
  return z(
314
- H,
315
- (n, l, o) => {
316
- if (!n || typeof MutationObserver > "u") return;
316
+ q,
317
+ (a, l, o) => {
318
+ if (!a || typeof MutationObserver > "u") return;
317
319
  const E = () => {
318
- n.querySelectorAll(".dx-language-badge-container").forEach(($) => $.remove());
320
+ a.querySelectorAll(".dx-language-badge-container").forEach((C) => C.remove());
319
321
  };
320
322
  E();
321
323
  const _ = new MutationObserver(E);
322
- _.observe(n, { childList: !0, subtree: !0 }), o(() => _.disconnect());
324
+ _.observe(a, { childList: !0, subtree: !0 }), o(() => _.disconnect());
323
325
  },
324
326
  // `flush: "sync"` — a template ref is populated by Vue's own patch process,
325
327
  // and the DEFAULT ("pre") flush timing runs a watcher reacting to that
@@ -329,30 +331,28 @@ const Me = ["data-status", "title"], je = {
329
331
  // conceivably a synchronous export/print path) must never observe the
330
332
  // badge even for one tick, so this cannot wait for the async scheduler.
331
333
  { immediate: !0, flush: "sync" }
332
- ), (n, l) => (u(), v("span", {
333
- class: y(["tv-field", le.value ? "tv-needs-review" : ""])
334
+ ), (a, l) => (u(), v("span", {
335
+ class: w(["tv-field", D.value ? "tv-needs-review" : ""])
334
336
  }, [
335
- m.value ? (u(), B(f(de), {
337
+ m.value ? (u(), B(d(de), {
336
338
  key: 0,
337
339
  shape: "rounded",
338
340
  class: "tv-field-skeleton inline-block h-[1em] w-16 align-middle"
339
341
  })) : (u(), v(F, { key: 1 }, [
340
342
  p("span", {
341
- class: y([
342
- "tv-field-value",
343
- A.value && !V.value ? "tv-field-unverified border-b border-dotted border-gray-300" : ""
344
- ])
343
+ class: w(["tv-field-value", T.value ? d(we) : ""]),
344
+ onClick: ie
345
345
  }, [
346
- oe(n.$slots, "default", {
346
+ oe(a.$slots, "default", {
347
347
  value: h.value,
348
348
  formatted: g.value
349
349
  }, () => [
350
350
  p("span", {
351
351
  ref_key: "markdownFallbackRef",
352
- ref: H,
352
+ ref: q,
353
353
  class: "tv-markdown-fallback-wrap"
354
354
  }, [
355
- D(f(he), {
355
+ L(d(he), {
356
356
  "model-value": g.value,
357
357
  format: "markdown",
358
358
  theme: "light",
@@ -364,51 +364,51 @@ const Me = ["data-status", "title"], je = {
364
364
  ], 512)
365
365
  ])
366
366
  ], 2),
367
- A.value ? (u(), v("span", Ue, [
367
+ A.value ? (u(), v("span", ze, [
368
368
  p("button", {
369
369
  type: "button",
370
- class: y(["tv-overlay", [f(T), M.value ? "cursor-pointer" : "cursor-default"]]),
370
+ class: w(["tv-overlay", [d(R), T.value ? "cursor-pointer" : "cursor-default"]]),
371
371
  "aria-label": G.value,
372
372
  title: G.value,
373
- onClick: l[0] || (l[0] = (o) => M.value ? ie() : void 0)
373
+ onClick: l[0] || (l[0] = (o) => T.value ? H() : void 0)
374
374
  }, [
375
- I.value === "unverified" && !C.value ? (u(), B(Fe, {
375
+ I.value === "unverified" && !$.value ? (u(), B(Ue, {
376
376
  key: 0,
377
- status: R.value
378
- }, null, 8, ["status"])) : I.value === "unverified" && C.value ? (u(), v("span", Ye, "A")) : I.value === "confirmed" ? (u(), v("span", Ge, "✔")) : (u(), v("span", He, "✔")),
377
+ status: O.value
378
+ }, null, 8, ["status"])) : I.value === "unverified" && $.value ? (u(), v("span", Ge, "A")) : I.value === "confirmed" ? (u(), v("span", He, "✔")) : (u(), v("span", qe, "✔")),
379
379
  b.value && !x.value ? (u(), v("span", {
380
380
  key: 4,
381
- class: y(["tv-discrepancy-indicator ml-0.5 text-amber-500", s.value ? "tv-source-discrepancy-indicator" : ""]),
381
+ class: w(["tv-discrepancy-indicator ml-0.5 text-amber-500", s.value ? "tv-source-discrepancy-indicator" : ""]),
382
382
  "aria-hidden": !0
383
- }, "⚠", 2)) : w.value && !x.value ? (u(), v("span", qe, "✎")) : S("", !0)
384
- ], 10, ze)
383
+ }, "⚠", 2)) : y.value && !x.value ? (u(), v("span", Ke, "✎")) : S("", !0)
384
+ ], 10, Ye)
385
385
  ])) : S("", !0)
386
386
  ], 64))
387
387
  ], 2));
388
388
  }
389
- }), Ke = { class: "tv-enable-toggle flex items-center justify-between text-sm font-medium text-gray-700" }, Je = { class: "tv-progress-block" }, Qe = { class: "mb-1 flex items-baseline justify-between" }, We = { class: "tv-progress-count text-xs font-semibold text-gray-600" }, Xe = {
389
+ }), Je = { class: "tv-enable-toggle flex items-center justify-between text-sm font-medium text-gray-700" }, Qe = { class: "tv-progress-block" }, We = { class: "mb-1 flex items-baseline justify-between" }, Xe = { class: "tv-progress-count text-xs font-semibold text-gray-600" }, Ze = {
390
390
  key: 0,
391
391
  class: "tv-attempts-recorded mt-1 text-[11px] text-gray-400"
392
- }, at = /* @__PURE__ */ Y({
392
+ }, lt = /* @__PURE__ */ Y({
393
393
  __name: "VerificationChrome",
394
394
  setup(e) {
395
- const t = ee(), { enabled: r } = t, d = fe(), m = P(!1), a = i(() => Pe(t.data)), c = i(
396
- () => re(t.data).reduce(
395
+ const t = te(), { enabled: n } = t, f = fe(), m = M(!1), r = i(() => Me(t.data)), c = i(
396
+ () => ae(t.data).reduce(
397
397
  (b, s) => {
398
- var w, x, O, C, I, V, A;
399
- return b + (((O = (x = (w = s.meta) == null ? void 0 : w.candidates) == null ? void 0 : x.extracted) == null ? void 0 : O.history_count) ?? ((A = (V = (I = (C = s.meta) == null ? void 0 : C.candidates) == null ? void 0 : I.extracted) == null ? void 0 : V.history) == null ? void 0 : A.length) ?? 0);
398
+ var y, x, V, $, I, A, D;
399
+ return b + (((V = (x = (y = s.meta) == null ? void 0 : y.candidates) == null ? void 0 : x.extracted) == null ? void 0 : V.history_count) ?? ((D = (A = (I = ($ = s.meta) == null ? void 0 : $.candidates) == null ? void 0 : I.extracted) == null ? void 0 : A.history) == null ? void 0 : D.length) ?? 0);
400
400
  },
401
401
  0
402
402
  )
403
- ), h = P(!1);
403
+ ), h = M(!1);
404
404
  z(
405
- () => a.value.percent,
405
+ () => r.value.percent,
406
406
  (b) => {
407
- b === 100 && a.value.total > 0 && !h.value && (h.value = !0, d.success("All data points verified 🎯"));
407
+ b === 100 && r.value.total > 0 && !h.value && (h.value = !0, f.success("All data points verified 🎯"));
408
408
  }
409
409
  );
410
410
  let g = 0;
411
- function R() {
411
+ function O() {
412
412
  const b = document.querySelectorAll(".tv-needs-review");
413
413
  if (!b.length) return;
414
414
  g = g % b.length;
@@ -424,91 +424,92 @@ const Me = ["data-status", "title"], je = {
424
424
  return (b, s) => (u(), v(F, null, [
425
425
  p("button", {
426
426
  type: "button",
427
- class: y(["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", f(T)]),
427
+ class: w(["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", d(R)]),
428
428
  title: "Verification",
429
- onClick: s[0] || (s[0] = Q((w) => m.value = !m.value, ["stop"]))
429
+ onClick: s[0] || (s[0] = W((y) => m.value = !m.value, ["stop"]))
430
430
  }, [
431
- D(f(ve), {
432
- icon: f(pe),
431
+ L(d(ve), {
432
+ icon: d(pe),
433
433
  class: "h-5 w-5"
434
434
  }, null, 8, ["icon"]),
435
- f(r) && a.value.needsReview > 0 ? (u(), B(f(ge), {
435
+ d(n) && r.value.needsReview > 0 ? (u(), B(d(ge), {
436
436
  key: 0,
437
- value: a.value.needsReview,
437
+ value: r.value.needsReview,
438
438
  variant: "warning",
439
439
  class: "tv-needs-review-badge absolute -right-1 -top-1"
440
440
  }, null, 8, ["value"])) : S("", !0)
441
441
  ], 2),
442
442
  m.value ? (u(), v("div", {
443
443
  key: 0,
444
- class: y(["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", f(T)])
444
+ class: w(["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", d(R)])
445
445
  }, [
446
- p("label", Ke, [
446
+ p("label", Je, [
447
447
  s[2] || (s[2] = p("span", null, "Verification overlay", -1)),
448
448
  se(p("input", {
449
- "onUpdate:modelValue": s[1] || (s[1] = (w) => ue(r) ? r.value = w : null),
449
+ "onUpdate:modelValue": s[1] || (s[1] = (y) => ue(n) ? n.value = y : null),
450
450
  type: "checkbox",
451
451
  class: "tv-enable-checkbox h-4 w-4 accent-gray-900"
452
452
  }, null, 512), [
453
- [ce, f(r)]
453
+ [ce, d(n)]
454
454
  ])
455
455
  ]),
456
- f(r) && a.value.total > 0 ? (u(), v(F, { key: 0 }, [
457
- p("div", Je, [
458
- p("div", Qe, [
456
+ d(n) && r.value.total > 0 ? (u(), v(F, { key: 0 }, [
457
+ p("div", Qe, [
458
+ p("div", We, [
459
459
  s[3] || (s[3] = p("span", { class: "text-[11px] font-semibold uppercase tracking-wider text-gray-400" }, "Review progress", -1)),
460
- p("span", We, k(a.value.verified) + " / " + k(a.value.total), 1)
460
+ p("span", Xe, k(r.value.verified) + " / " + k(r.value.total), 1)
461
461
  ]),
462
- D(f(me), {
463
- value: a.value.verified,
464
- max: a.value.total,
462
+ L(d(me), {
463
+ value: r.value.verified,
464
+ max: r.value.total,
465
465
  size: "md",
466
- variant: a.value.percent === 100 ? "success" : "info",
467
- striped: a.value.percent < 100,
468
- "animate-stripes": a.value.percent < 100,
469
- glow: a.value.percent === 100,
466
+ variant: r.value.percent === 100 ? "success" : "info",
467
+ striped: r.value.percent < 100,
468
+ "animate-stripes": r.value.percent < 100,
469
+ glow: r.value.percent === 100,
470
470
  gradient: ""
471
471
  }, null, 8, ["value", "max", "variant", "striped", "animate-stripes", "glow"]),
472
- c.value > 0 ? (u(), v("div", Xe, k(c.value) + " extraction attempt" + k(c.value === 1 ? "" : "s") + " recorded ", 1)) : S("", !0)
472
+ c.value > 0 ? (u(), v("div", Ze, k(c.value) + " extraction attempt" + k(c.value === 1 ? "" : "s") + " recorded ", 1)) : S("", !0)
473
473
  ]),
474
- a.value.needsReview > 0 ? (u(), v("button", {
474
+ r.value.needsReview > 0 ? (u(), v("button", {
475
475
  key: 0,
476
476
  type: "button",
477
- class: y(["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", f(T)]),
478
- onClick: Q(R, ["stop"])
477
+ class: w(["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", d(R)]),
478
+ onClick: W(O, ["stop"])
479
479
  }, [
480
- p("span", null, k(a.value.needsReview) + " need" + k(a.value.needsReview === 1 ? "s" : "") + " review", 1),
480
+ p("span", null, k(r.value.needsReview) + " need" + k(r.value.needsReview === 1 ? "s" : "") + " review", 1),
481
481
  s[4] || (s[4] = p("span", { "aria-hidden": "true" }, "→", -1))
482
482
  ], 2)) : S("", !0)
483
483
  ], 64)) : S("", !0)
484
484
  ], 2)) : S("", !0),
485
- D(f(be), {
486
- class: y(f(T))
485
+ L(d(be), {
486
+ class: w(d(R))
487
487
  }, null, 8, ["class"])
488
488
  ], 64));
489
489
  }
490
490
  });
491
491
  export {
492
- T as CHROME_CLASS,
493
- Fe as ConfidenceIcon,
494
- Ve as DATA_POINT_ACTIVATED,
495
- X as ENABLED_STORAGE_KEY,
496
- ne as RESOLUTION_PRIORITY,
497
- ke as STATUS_COLORS,
498
- N as STATUS_LABELS,
499
- Re as TEMPLATE_MESSAGE_SOURCE,
500
- Oe as TEMPLATE_PROTOCOL_VERSION,
501
- at as VerificationChrome,
502
- rt as VerifiedField,
503
- te as bucketConfidence,
504
- Ce as candidatesDisagree,
505
- Pe as computeProgress,
506
- De as embedderOrigin,
492
+ R as CHROME_CLASS,
493
+ Ue as ConfidenceIcon,
494
+ De as DATA_POINT_ACTIVATED,
495
+ we as EDITABLE_CLASS,
496
+ Z as ENABLED_STORAGE_KEY,
497
+ re as RESOLUTION_PRIORITY,
498
+ Se as STATUS_COLORS,
499
+ P as STATUS_LABELS,
500
+ Oe as TEMPLATE_MESSAGE_SOURCE,
501
+ Ve as TEMPLATE_PROTOCOL_VERSION,
502
+ lt as VerificationChrome,
503
+ at as VerifiedField,
504
+ ne as bucketConfidence,
505
+ Ae as candidatesDisagree,
506
+ Me as computeProgress,
507
+ Le as embedderOrigin,
507
508
  $e as hasDiscrepancy,
508
- nt as initVerification,
509
- Le as notifyDataPointActivated,
510
- Ie as resolveCandidates,
511
- Se as resolveDataPoint,
512
- ee as useVerification,
513
- re as walkDataPoints
509
+ rt as initVerification,
510
+ Ne as notifyDataPointActivated,
511
+ Ce as resolveCandidates,
512
+ Ie as resolveDataPoint,
513
+ te as useVerification,
514
+ ae as walkDataPoints
514
515
  };