@arbidocs/react 0.4.54 → 0.4.56
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/PdfViewer-bQH9yxFg.d.cts +55 -0
- package/dist/PdfViewer-bQH9yxFg.d.ts +55 -0
- package/dist/annotations/freeze/index.cjs +748 -0
- package/dist/annotations/freeze/index.cjs.map +1 -0
- package/dist/annotations/freeze/index.d.cts +199 -0
- package/dist/annotations/freeze/index.d.ts +199 -0
- package/dist/annotations/freeze/index.js +738 -0
- package/dist/annotations/freeze/index.js.map +1 -0
- package/dist/annotations/index.cjs +1737 -0
- package/dist/annotations/index.cjs.map +1 -0
- package/dist/annotations/index.d.cts +291 -0
- package/dist/annotations/index.d.ts +291 -0
- package/dist/annotations/index.js +1671 -0
- package/dist/annotations/index.js.map +1 -0
- package/dist/artifacts/index.cjs +14 -14
- package/dist/artifacts/index.js +2 -2
- package/dist/chunk-BGDE4DP5.cjs +192 -0
- package/dist/chunk-BGDE4DP5.cjs.map +1 -0
- package/dist/{chunk-EDTJLZUZ.js → chunk-CVN7MAGQ.js} +5 -145
- package/dist/chunk-CVN7MAGQ.js.map +1 -0
- package/dist/chunk-JWXIRUWN.js +183 -0
- package/dist/chunk-JWXIRUWN.js.map +1 -0
- package/dist/chunk-QS3Q5542.js +151 -0
- package/dist/chunk-QS3Q5542.js.map +1 -0
- package/dist/{chunk-TLZVR72J.cjs → chunk-R6V6YHPD.cjs} +2 -2
- package/dist/chunk-R6V6YHPD.cjs.map +1 -0
- package/dist/{chunk-2NSB2EKN.cjs → chunk-X3F5ABY2.cjs} +4 -157
- package/dist/chunk-X3F5ABY2.cjs.map +1 -0
- package/dist/chunk-XDCRWZF2.cjs +185 -0
- package/dist/chunk-XDCRWZF2.cjs.map +1 -0
- package/dist/{chunk-QRZC3EBD.js → chunk-XKGTZ3H6.js} +2 -2
- package/dist/chunk-XKGTZ3H6.js.map +1 -0
- package/dist/index.cjs +345 -369
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -118
- package/dist/index.d.ts +8 -118
- package/dist/index.js +8 -29
- package/dist/index.js.map +1 -1
- package/dist/model-DzQxhMMz.d.cts +102 -0
- package/dist/model-DzQxhMMz.d.ts +102 -0
- package/dist/ui/index.cjs +161 -160
- package/dist/ui/index.js +2 -1
- package/dist/viewers/index.cjs +61 -52
- package/dist/viewers/index.cjs.map +1 -1
- package/dist/viewers/index.d.cts +3 -43
- package/dist/viewers/index.d.ts +3 -43
- package/dist/viewers/index.js +61 -52
- package/dist/viewers/index.js.map +1 -1
- package/package.json +31 -9
- package/dist/chunk-2NSB2EKN.cjs.map +0 -1
- package/dist/chunk-EDTJLZUZ.js.map +0 -1
- package/dist/chunk-QRZC3EBD.js.map +0 -1
- package/dist/chunk-TLZVR72J.cjs.map +0 -1
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/annotations/model.ts
|
|
4
|
+
var LAYER_SCHEMA_VERSION = 1;
|
|
5
|
+
var MAX_TEXT_LENGTH = 2e4;
|
|
6
|
+
var MAX_ANNOTATIONS = 2e4;
|
|
7
|
+
var MAX_RECTS_PER_MARK = 2e3;
|
|
8
|
+
var HEX_COLOR = /^#[0-9a-fA-F]{6}$/;
|
|
9
|
+
var KINDS = ["highlight", "box", "comment", "stamp", "redaction"];
|
|
10
|
+
var REDACTION_STATUSES = ["pending", "approved", "rejected"];
|
|
11
|
+
var EDGE_EPSILON = 1e-6;
|
|
12
|
+
var AnnotationLayerError = class extends Error {
|
|
13
|
+
constructor(message) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = "AnnotationLayerError";
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function emptyLayer(documentId, now) {
|
|
19
|
+
return { schema: LAYER_SCHEMA_VERSION, documentId, annotations: [], updatedAt: now };
|
|
20
|
+
}
|
|
21
|
+
var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
22
|
+
function fail(path, problem) {
|
|
23
|
+
throw new AnnotationLayerError(`${path}: ${problem}`);
|
|
24
|
+
}
|
|
25
|
+
function str(v, path, max = MAX_TEXT_LENGTH) {
|
|
26
|
+
if (typeof v !== "string") fail(path, "expected a string");
|
|
27
|
+
if (v.length > max) fail(path, `longer than ${max} characters`);
|
|
28
|
+
return v;
|
|
29
|
+
}
|
|
30
|
+
function optStr(v, path) {
|
|
31
|
+
return v === void 0 ? void 0 : str(v, path);
|
|
32
|
+
}
|
|
33
|
+
function iso(v, path) {
|
|
34
|
+
const s = str(v, path, 64);
|
|
35
|
+
if (Number.isNaN(Date.parse(s))) fail(path, "expected an ISO date");
|
|
36
|
+
return s;
|
|
37
|
+
}
|
|
38
|
+
function color(v, path) {
|
|
39
|
+
const s = str(v, path, 16);
|
|
40
|
+
if (!HEX_COLOR.test(s)) fail(path, "expected a #rrggbb colour");
|
|
41
|
+
return s;
|
|
42
|
+
}
|
|
43
|
+
function bool(v, path) {
|
|
44
|
+
if (typeof v !== "boolean") fail(path, "expected a boolean");
|
|
45
|
+
return v;
|
|
46
|
+
}
|
|
47
|
+
function rect(v, path) {
|
|
48
|
+
if (!isRecord(v)) fail(path, "expected a rectangle");
|
|
49
|
+
const out = { x: v.x, y: v.y, w: v.w, h: v.h };
|
|
50
|
+
for (const [key, n] of Object.entries(out)) {
|
|
51
|
+
if (typeof n !== "number" || !Number.isFinite(n)) fail(`${path}.${key}`, "expected a number");
|
|
52
|
+
}
|
|
53
|
+
const r = out;
|
|
54
|
+
if (r.w < 0 || r.h < 0) fail(path, "negative size");
|
|
55
|
+
if (r.x < -EDGE_EPSILON || r.y < -EDGE_EPSILON) fail(path, "outside the page");
|
|
56
|
+
if (r.x + r.w > 1 + EDGE_EPSILON || r.y + r.h > 1 + EDGE_EPSILON) fail(path, "outside the page");
|
|
57
|
+
return clampRect(r);
|
|
58
|
+
}
|
|
59
|
+
function rects(v, path) {
|
|
60
|
+
if (!Array.isArray(v)) fail(path, "expected a list of rectangles");
|
|
61
|
+
if (v.length === 0) fail(path, "needs at least one rectangle");
|
|
62
|
+
if (v.length > MAX_RECTS_PER_MARK) fail(path, `more than ${MAX_RECTS_PER_MARK} rectangles`);
|
|
63
|
+
return v.map((r, i) => rect(r, `${path}[${i}]`));
|
|
64
|
+
}
|
|
65
|
+
function reply(v, path) {
|
|
66
|
+
if (!isRecord(v)) fail(path, "expected a reply");
|
|
67
|
+
return {
|
|
68
|
+
id: str(v.id, `${path}.id`, 128),
|
|
69
|
+
author: str(v.author, `${path}.author`, 256),
|
|
70
|
+
createdAt: iso(v.createdAt, `${path}.createdAt`),
|
|
71
|
+
body: str(v.body, `${path}.body`)
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function clampRect(r) {
|
|
75
|
+
const x = Math.min(1, Math.max(0, r.x));
|
|
76
|
+
const y = Math.min(1, Math.max(0, r.y));
|
|
77
|
+
return { x, y, w: Math.min(r.w, 1 - x), h: Math.min(r.h, 1 - y) };
|
|
78
|
+
}
|
|
79
|
+
function parseAnnotation(v, path = "annotation") {
|
|
80
|
+
if (!isRecord(v)) fail(path, "expected an object");
|
|
81
|
+
const kind = v.kind;
|
|
82
|
+
if (typeof kind !== "string" || !KINDS.includes(kind)) {
|
|
83
|
+
fail(`${path}.kind`, "unknown annotation kind");
|
|
84
|
+
}
|
|
85
|
+
const page = v.page;
|
|
86
|
+
if (typeof page !== "number" || !Number.isInteger(page) || page < 1) {
|
|
87
|
+
fail(`${path}.page`, "expected a page number of 1 or more");
|
|
88
|
+
}
|
|
89
|
+
const base = {
|
|
90
|
+
id: str(v.id, `${path}.id`, 128),
|
|
91
|
+
page,
|
|
92
|
+
author: str(v.author, `${path}.author`, 256),
|
|
93
|
+
createdAt: iso(v.createdAt, `${path}.createdAt`),
|
|
94
|
+
updatedAt: iso(v.updatedAt, `${path}.updatedAt`)
|
|
95
|
+
};
|
|
96
|
+
if (!base.id) fail(`${path}.id`, "empty id");
|
|
97
|
+
switch (kind) {
|
|
98
|
+
case "highlight":
|
|
99
|
+
return {
|
|
100
|
+
...base,
|
|
101
|
+
kind: "highlight",
|
|
102
|
+
rects: rects(v.rects, `${path}.rects`),
|
|
103
|
+
color: color(v.color, `${path}.color`),
|
|
104
|
+
text: optStr(v.text, `${path}.text`)
|
|
105
|
+
};
|
|
106
|
+
case "box": {
|
|
107
|
+
const strokeWidth = v.strokeWidth;
|
|
108
|
+
if (typeof strokeWidth !== "number" || !(strokeWidth > 0) || strokeWidth > 50) {
|
|
109
|
+
fail(`${path}.strokeWidth`, "expected a width between 0 and 50");
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
...base,
|
|
113
|
+
kind: "box",
|
|
114
|
+
rect: rect(v.rect, `${path}.rect`),
|
|
115
|
+
color: color(v.color, `${path}.color`),
|
|
116
|
+
strokeWidth
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
case "comment": {
|
|
120
|
+
if (!Array.isArray(v.replies)) fail(`${path}.replies`, "expected a list");
|
|
121
|
+
return {
|
|
122
|
+
...base,
|
|
123
|
+
kind: "comment",
|
|
124
|
+
rect: rect(v.rect, `${path}.rect`),
|
|
125
|
+
body: str(v.body, `${path}.body`),
|
|
126
|
+
replies: v.replies.map((r, i) => reply(r, `${path}.replies[${i}]`)),
|
|
127
|
+
resolved: bool(v.resolved, `${path}.resolved`)
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
case "stamp":
|
|
131
|
+
return {
|
|
132
|
+
...base,
|
|
133
|
+
kind: "stamp",
|
|
134
|
+
rect: rect(v.rect, `${path}.rect`),
|
|
135
|
+
label: str(v.label, `${path}.label`, 200),
|
|
136
|
+
color: color(v.color, `${path}.color`)
|
|
137
|
+
};
|
|
138
|
+
case "redaction": {
|
|
139
|
+
const status = v.status;
|
|
140
|
+
if (typeof status !== "string" || !REDACTION_STATUSES.includes(status)) {
|
|
141
|
+
fail(`${path}.status`, "unknown redaction status");
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
...base,
|
|
145
|
+
kind: "redaction",
|
|
146
|
+
rects: rects(v.rects, `${path}.rects`),
|
|
147
|
+
reason: str(v.reason, `${path}.reason`, 200),
|
|
148
|
+
text: optStr(v.text, `${path}.text`),
|
|
149
|
+
status
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function parseLayer(v) {
|
|
155
|
+
if (!isRecord(v)) fail("layer", "expected an object");
|
|
156
|
+
if (v.schema !== LAYER_SCHEMA_VERSION)
|
|
157
|
+
fail("layer.schema", `expected schema ${LAYER_SCHEMA_VERSION}`);
|
|
158
|
+
if (!Array.isArray(v.annotations)) fail("layer.annotations", "expected a list");
|
|
159
|
+
if (v.annotations.length > MAX_ANNOTATIONS) {
|
|
160
|
+
fail("layer.annotations", `more than ${MAX_ANNOTATIONS} annotations`);
|
|
161
|
+
}
|
|
162
|
+
const annotations = v.annotations.map((a, i) => parseAnnotation(a, `layer.annotations[${i}]`));
|
|
163
|
+
const seen = /* @__PURE__ */ new Set();
|
|
164
|
+
for (const a of annotations) {
|
|
165
|
+
if (seen.has(a.id)) fail("layer.annotations", `duplicate id ${a.id}`);
|
|
166
|
+
seen.add(a.id);
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
schema: LAYER_SCHEMA_VERSION,
|
|
170
|
+
documentId: str(v.documentId, "layer.documentId", 256),
|
|
171
|
+
documentHash: optStr(v.documentHash, "layer.documentHash"),
|
|
172
|
+
annotations,
|
|
173
|
+
updatedAt: iso(v.updatedAt, "layer.updatedAt")
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function annotationRects(a) {
|
|
177
|
+
return a.kind === "highlight" || a.kind === "redaction" ? a.rects : [a.rect];
|
|
178
|
+
}
|
|
179
|
+
function isEffectiveRedaction(a) {
|
|
180
|
+
return a.kind === "redaction" && a.status !== "rejected";
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
exports.AnnotationLayerError = AnnotationLayerError;
|
|
184
|
+
exports.LAYER_SCHEMA_VERSION = LAYER_SCHEMA_VERSION;
|
|
185
|
+
exports.annotationRects = annotationRects;
|
|
186
|
+
exports.clampRect = clampRect;
|
|
187
|
+
exports.emptyLayer = emptyLayer;
|
|
188
|
+
exports.isEffectiveRedaction = isEffectiveRedaction;
|
|
189
|
+
exports.parseAnnotation = parseAnnotation;
|
|
190
|
+
exports.parseLayer = parseLayer;
|
|
191
|
+
//# sourceMappingURL=chunk-BGDE4DP5.cjs.map
|
|
192
|
+
//# sourceMappingURL=chunk-BGDE4DP5.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/annotations/model.ts"],"names":[],"mappings":";;;AAcO,IAAM,oBAAA,GAAuB;AAoF7B,IAAM,eAAA,GAAkB,GAAA;AACxB,IAAM,eAAA,GAAkB,GAAA;AACxB,IAAM,kBAAA,GAAqB,GAAA;AAElC,IAAM,SAAA,GAAY,mBAAA;AAClB,IAAM,QAAmC,CAAC,WAAA,EAAa,KAAA,EAAO,SAAA,EAAW,SAAS,WAAW,CAAA;AAC7F,IAAM,kBAAA,GAAiD,CAAC,SAAA,EAAW,UAAA,EAAY,UAAU,CAAA;AAEzF,IAAM,YAAA,GAAe,IAAA;AAEd,IAAM,oBAAA,GAAN,cAAmC,KAAA,CAAM;AAAA,EAC9C,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,sBAAA;AAAA,EACd;AACF;AAEO,SAAS,UAAA,CAAW,YAAoB,GAAA,EAA8B;AAC3E,EAAA,OAAO,EAAE,QAAQ,oBAAA,EAAsB,UAAA,EAAY,aAAa,EAAC,EAAG,WAAW,GAAA,EAAI;AACrF;AAEA,IAAM,QAAA,GAAW,CAAC,CAAA,KAChB,OAAO,CAAA,KAAM,QAAA,IAAY,CAAA,KAAM,IAAA,IAAQ,CAAC,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA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,aAAA,EAAgB,CAAA,CAAE,EAAE,CAAA,CAAE,CAAA;AACpE,IAAA,IAAA,CAAK,GAAA,CAAI,EAAE,EAAE,CAAA;AAAA,EACf;AACA,EAAA,OAAO;AAAA,IACL,MAAA,EAAQ,oBAAA;AAAA,IACR,UAAA,EAAY,GAAA,CAAI,CAAA,CAAE,UAAA,EAAY,oBAAoB,GAAG,CAAA;AAAA,IACrD,YAAA,EAAc,MAAA,CAAO,CAAA,CAAE,YAAA,EAAc,oBAAoB,CAAA;AAAA,IACzD,WAAA;AAAA,IACA,SAAA,EAAW,GAAA,CAAI,CAAA,CAAE,SAAA,EAAW,iBAAiB;AAAA,GAC/C;AACF;AAGO,SAAS,gBAAgB,CAAA,EAA2B;AACzD,EAAA,OAAO,CAAA,CAAE,IAAA,KAAS,WAAA,IAAe,CAAA,CAAE,IAAA,KAAS,cAAc,CAAA,CAAE,KAAA,GAAQ,CAAC,CAAA,CAAE,IAAI,CAAA;AAC7E;AAMO,SAAS,qBAAqB,CAAA,EAAyC;AAC5E,EAAA,OAAO,CAAA,CAAE,IAAA,KAAS,WAAA,IAAe,CAAA,CAAE,MAAA,KAAW,UAAA;AAChD","file":"chunk-BGDE4DP5.cjs","sourcesContent":["/**\n * Annotation layer data model.\n *\n * A layer is plain JSON that sits NEXT TO an immutable document: the original file is never\n * touched, marks are drawn over it, and \"freezing\" (see `freeze.ts`) derives a new document.\n *\n * Geometry is stored as fractions (0..1) of the page as DISPLAYED (after rotation and crop),\n * origin top-left. That makes a mark independent of zoom, device pixel ratio and PDF units, and\n * because the original never changes the coordinates never drift.\n *\n * A redaction mark carries the matched text so a reviewer (or an agent) can see what it hides.\n * That text is sensitive: the layer must never travel with a frozen copy.\n */\n\nexport const LAYER_SCHEMA_VERSION = 1\n\nexport type AnnotationKind = 'highlight' | 'box' | 'comment' | 'stamp' | 'redaction'\nexport type RedactionStatus = 'pending' | 'approved' | 'rejected'\n\n/** Fractions of the displayed page, origin top-left. */\nexport interface NormRect {\n x: number\n y: number\n w: number\n h: number\n}\n\nexport interface CommentReply {\n id: string\n author: string\n createdAt: string\n body: string\n}\n\ninterface AnnotationBase {\n id: string\n /** 1-based page number. */\n page: number\n author: string\n createdAt: string\n updatedAt: string\n}\n\nexport interface HighlightAnnotation extends AnnotationBase {\n kind: 'highlight'\n rects: NormRect[]\n color: string\n /** The highlighted text, when it came from a text selection. */\n text?: string\n}\n\nexport interface BoxAnnotation extends AnnotationBase {\n kind: 'box'\n rect: NormRect\n color: string\n /** Outline width in PDF points at 100%. */\n strokeWidth: number\n}\n\nexport interface CommentAnnotation extends AnnotationBase {\n kind: 'comment'\n /** Anchor box; the note icon is drawn at its top-left corner. */\n rect: NormRect\n body: string\n replies: CommentReply[]\n resolved: boolean\n}\n\nexport interface StampAnnotation extends AnnotationBase {\n kind: 'stamp'\n rect: NormRect\n label: string\n color: string\n}\n\nexport interface RedactionAnnotation extends AnnotationBase {\n kind: 'redaction'\n rects: NormRect[]\n /** Why it is redacted (e.g. \"Privileged\"). Printed on the frozen copy, never the text itself. */\n reason: string\n /** The text under the mark. Sensitive: stays in the layer, never in a frozen document. */\n text?: string\n status: RedactionStatus\n}\n\nexport type Annotation =\n HighlightAnnotation | BoxAnnotation | CommentAnnotation | StampAnnotation | RedactionAnnotation\n\nexport interface AnnotationLayer {\n schema: typeof LAYER_SCHEMA_VERSION\n /** External id of the immutable document the layer annotates. */\n documentId: string\n /** Optional content hash of the original, so a layer can be checked against the file it marks. */\n documentHash?: string\n annotations: Annotation[]\n updatedAt: string\n}\n\nexport const MAX_TEXT_LENGTH = 20_000\nexport const MAX_ANNOTATIONS = 20_000\nexport const MAX_RECTS_PER_MARK = 2_000\n\nconst HEX_COLOR = /^#[0-9a-fA-F]{6}$/\nconst KINDS: readonly AnnotationKind[] = ['highlight', 'box', 'comment', 'stamp', 'redaction']\nconst REDACTION_STATUSES: readonly RedactionStatus[] = ['pending', 'approved', 'rejected']\n/** Tolerance for rects that overshoot the page edge by floating-point noise. */\nconst EDGE_EPSILON = 1e-6\n\nexport class AnnotationLayerError extends Error {\n constructor(message: string) {\n super(message)\n this.name = 'AnnotationLayerError'\n }\n}\n\nexport function emptyLayer(documentId: string, now: string): AnnotationLayer {\n return { schema: LAYER_SCHEMA_VERSION, documentId, annotations: [], updatedAt: now }\n}\n\nconst isRecord = (v: unknown): v is Record<string, unknown> =>\n typeof v === 'object' && v !== null && !Array.isArray(v)\n\nfunction fail(path: string, problem: string): never {\n throw new AnnotationLayerError(`${path}: ${problem}`)\n}\n\nfunction str(v: unknown, path: string, max = MAX_TEXT_LENGTH): string {\n if (typeof v !== 'string') fail(path, 'expected a string')\n if (v.length > max) fail(path, `longer than ${max} characters`)\n return v\n}\n\nfunction optStr(v: unknown, path: string): string | undefined {\n return v === undefined ? undefined : str(v, path)\n}\n\nfunction iso(v: unknown, path: string): string {\n const s = str(v, path, 64)\n if (Number.isNaN(Date.parse(s))) fail(path, 'expected an ISO date')\n return s\n}\n\nfunction color(v: unknown, path: string): string {\n const s = str(v, path, 16)\n if (!HEX_COLOR.test(s)) fail(path, 'expected a #rrggbb colour')\n return s\n}\n\nfunction bool(v: unknown, path: string): boolean {\n if (typeof v !== 'boolean') fail(path, 'expected a boolean')\n return v\n}\n\nfunction rect(v: unknown, path: string): NormRect {\n if (!isRecord(v)) fail(path, 'expected a rectangle')\n const out = { x: v.x, y: v.y, w: v.w, h: v.h }\n for (const [key, n] of Object.entries(out)) {\n if (typeof n !== 'number' || !Number.isFinite(n)) fail(`${path}.${key}`, 'expected a number')\n }\n const r = out as NormRect\n if (r.w < 0 || r.h < 0) fail(path, 'negative size')\n if (r.x < -EDGE_EPSILON || r.y < -EDGE_EPSILON) fail(path, 'outside the page')\n if (r.x + r.w > 1 + EDGE_EPSILON || r.y + r.h > 1 + EDGE_EPSILON) fail(path, 'outside the page')\n return clampRect(r)\n}\n\nfunction rects(v: unknown, path: string): NormRect[] {\n if (!Array.isArray(v)) fail(path, 'expected a list of rectangles')\n if (v.length === 0) fail(path, 'needs at least one rectangle')\n if (v.length > MAX_RECTS_PER_MARK) fail(path, `more than ${MAX_RECTS_PER_MARK} rectangles`)\n return v.map((r, i) => rect(r, `${path}[${i}]`))\n}\n\nfunction reply(v: unknown, path: string): CommentReply {\n if (!isRecord(v)) fail(path, 'expected a reply')\n return {\n id: str(v.id, `${path}.id`, 128),\n author: str(v.author, `${path}.author`, 256),\n createdAt: iso(v.createdAt, `${path}.createdAt`),\n body: str(v.body, `${path}.body`),\n }\n}\n\nexport function clampRect(r: NormRect): NormRect {\n const x = Math.min(1, Math.max(0, r.x))\n const y = Math.min(1, Math.max(0, r.y))\n return { x, y, w: Math.min(r.w, 1 - x), h: Math.min(r.h, 1 - y) }\n}\n\n/** Validate one annotation from untrusted JSON. Throws `AnnotationLayerError`. */\nexport function parseAnnotation(v: unknown, path = 'annotation'): Annotation {\n if (!isRecord(v)) fail(path, 'expected an object')\n const kind = v.kind\n if (typeof kind !== 'string' || !KINDS.includes(kind as AnnotationKind)) {\n fail(`${path}.kind`, 'unknown annotation kind')\n }\n const page = v.page\n if (typeof page !== 'number' || !Number.isInteger(page) || page < 1) {\n fail(`${path}.page`, 'expected a page number of 1 or more')\n }\n const base: AnnotationBase = {\n id: str(v.id, `${path}.id`, 128),\n page,\n author: str(v.author, `${path}.author`, 256),\n createdAt: iso(v.createdAt, `${path}.createdAt`),\n updatedAt: iso(v.updatedAt, `${path}.updatedAt`),\n }\n if (!base.id) fail(`${path}.id`, 'empty id')\n\n switch (kind as AnnotationKind) {\n case 'highlight':\n return {\n ...base,\n kind: 'highlight',\n rects: rects(v.rects, `${path}.rects`),\n color: color(v.color, `${path}.color`),\n text: optStr(v.text, `${path}.text`),\n }\n case 'box': {\n const strokeWidth = v.strokeWidth\n if (typeof strokeWidth !== 'number' || !(strokeWidth > 0) || strokeWidth > 50) {\n fail(`${path}.strokeWidth`, 'expected a width between 0 and 50')\n }\n return {\n ...base,\n kind: 'box',\n rect: rect(v.rect, `${path}.rect`),\n color: color(v.color, `${path}.color`),\n strokeWidth,\n }\n }\n case 'comment': {\n if (!Array.isArray(v.replies)) fail(`${path}.replies`, 'expected a list')\n return {\n ...base,\n kind: 'comment',\n rect: rect(v.rect, `${path}.rect`),\n body: str(v.body, `${path}.body`),\n replies: v.replies.map((r, i) => reply(r, `${path}.replies[${i}]`)),\n resolved: bool(v.resolved, `${path}.resolved`),\n }\n }\n case 'stamp':\n return {\n ...base,\n kind: 'stamp',\n rect: rect(v.rect, `${path}.rect`),\n label: str(v.label, `${path}.label`, 200),\n color: color(v.color, `${path}.color`),\n }\n case 'redaction': {\n const status = v.status\n if (typeof status !== 'string' || !REDACTION_STATUSES.includes(status as RedactionStatus)) {\n fail(`${path}.status`, 'unknown redaction status')\n }\n return {\n ...base,\n kind: 'redaction',\n rects: rects(v.rects, `${path}.rects`),\n reason: str(v.reason, `${path}.reason`, 200),\n text: optStr(v.text, `${path}.text`),\n status: status as RedactionStatus,\n }\n }\n }\n}\n\n/** Validate a whole layer from untrusted JSON (storage, network, an agent). */\nexport function parseLayer(v: unknown): AnnotationLayer {\n if (!isRecord(v)) fail('layer', 'expected an object')\n if (v.schema !== LAYER_SCHEMA_VERSION)\n fail('layer.schema', `expected schema ${LAYER_SCHEMA_VERSION}`)\n if (!Array.isArray(v.annotations)) fail('layer.annotations', 'expected a list')\n if (v.annotations.length > MAX_ANNOTATIONS) {\n fail('layer.annotations', `more than ${MAX_ANNOTATIONS} annotations`)\n }\n const annotations = v.annotations.map((a, i) => parseAnnotation(a, `layer.annotations[${i}]`))\n const seen = new Set<string>()\n for (const a of annotations) {\n if (seen.has(a.id)) fail('layer.annotations', `duplicate id ${a.id}`)\n seen.add(a.id)\n }\n return {\n schema: LAYER_SCHEMA_VERSION,\n documentId: str(v.documentId, 'layer.documentId', 256),\n documentHash: optStr(v.documentHash, 'layer.documentHash'),\n annotations,\n updatedAt: iso(v.updatedAt, 'layer.updatedAt'),\n }\n}\n\n/** The rectangles a mark covers, whatever its kind. */\nexport function annotationRects(a: Annotation): NormRect[] {\n return a.kind === 'highlight' || a.kind === 'redaction' ? a.rects : [a.rect]\n}\n\n/**\n * True when a redaction mark will be burned into a frozen copy. Fails closed: only an explicit\n * rejection leaves content visible, so a mark nobody reviewed is never silently skipped.\n */\nexport function isEffectiveRedaction(a: Annotation): a is RedactionAnnotation {\n return a.kind === 'redaction' && a.status !== 'rejected'\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Dialog, DialogContent } from './chunk-QS3Q5542.js';
|
|
1
2
|
import { MarkdownRenderer } from './chunk-JPGV7NMY.js';
|
|
2
3
|
import { getCollisionPadding, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuItem, DropdownMenuSeparator } from './chunk-N5SVBDLC.js';
|
|
3
4
|
import { cn } from './chunk-SN5YV6FF.js';
|
|
@@ -5,11 +6,10 @@ import * as React from 'react';
|
|
|
5
6
|
import React__default, { createContext, forwardRef, memo, useContext, useState, useRef, useEffect, useCallback, useId, useMemo, Fragment as Fragment$1 } from 'react';
|
|
6
7
|
import { createPortal } from 'react-dom';
|
|
7
8
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
|
-
import { ChevronDown, ChevronUp, Check, Circle,
|
|
9
|
+
import { ChevronDown, ChevronUp, Check, Circle, Search, MessageCircleMore, Loader2, Square, Mic, MoreVertical, MessageSquareLock, Info, FileQuestion, BookOpen, Upload, LogOut, LayoutGrid, Bell, MessageSquare, CircleUserRound, Wrench, CreditCard, ClipboardList, UserPlus, UserStar, Settings2, Users, User, NotebookPen, NotebookText, StickyNote, FolderPlus, Hash, EyeOff, Eye, CaptionsOff, FolderOpen, MessageSquareMore, MessageSquarePlus, MessageSquareText, MessageSquareOff, MessagesSquare, Columns3Cog, SquarePlus, SquareM, ChevronsDown, Bot, Calendar, Folder, List, SquareCheckBig, Minus, Plus, Share2, MessageSquareShare, ChevronsUpDown, X, AlertTriangle, FileX, SkipForward, XCircle, CheckCircle } from 'lucide-react';
|
|
9
10
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
10
11
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
11
12
|
import { cva } from 'class-variance-authority';
|
|
12
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
13
13
|
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
14
14
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
15
15
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
@@ -21,7 +21,6 @@ import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
|
21
21
|
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
22
22
|
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
23
23
|
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
24
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
25
24
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
26
25
|
import { Command as Command$1 } from 'cmdk';
|
|
27
26
|
|
|
@@ -552,44 +551,6 @@ var badgeVariants = cva(
|
|
|
552
551
|
function Badge({ className, variant, ...props }) {
|
|
553
552
|
return /* @__PURE__ */ jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
554
553
|
}
|
|
555
|
-
var buttonVariants = cva(
|
|
556
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
557
|
-
{
|
|
558
|
-
variants: {
|
|
559
|
-
// One filled primary per view; everything else is tonal, hairline or ghost. No
|
|
560
|
-
// static shadows: separation is tone, and shadows are reserved for floating layers.
|
|
561
|
-
variant: {
|
|
562
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
563
|
-
accent: "bg-ai-accent text-ai-accent-foreground hover:bg-ai-accent/90",
|
|
564
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
565
|
-
outline: "border border-border bg-background hover:bg-muted",
|
|
566
|
-
secondary: "bg-muted text-foreground hover:bg-muted/70",
|
|
567
|
-
ghost: "hover:bg-muted",
|
|
568
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
569
|
-
},
|
|
570
|
-
// Touch screens get a 44px target (coarse pointers only), mouse keeps the compact 36px.
|
|
571
|
-
// `!` so the floor also wins over a caller's compact `h-7` or a container's
|
|
572
|
-
// `[&_button]:h-7` rule: a compact toolbar on a phone must still be tappable.
|
|
573
|
-
size: {
|
|
574
|
-
default: "h-9 px-4 py-2 pointer-coarse:h-11!",
|
|
575
|
-
sm: "h-8 rounded-md px-3 pointer-coarse:h-11! pointer-coarse:min-w-11",
|
|
576
|
-
lg: "h-10 rounded-md px-8 pointer-coarse:h-12!",
|
|
577
|
-
icon: "h-9 w-9 pointer-coarse:h-11! pointer-coarse:w-11!"
|
|
578
|
-
}
|
|
579
|
-
},
|
|
580
|
-
defaultVariants: {
|
|
581
|
-
variant: "default",
|
|
582
|
-
size: "default"
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
);
|
|
586
|
-
var Button = React.forwardRef(
|
|
587
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
588
|
-
const Comp = asChild ? Slot : "button";
|
|
589
|
-
return /* @__PURE__ */ jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref, ...props });
|
|
590
|
-
}
|
|
591
|
-
);
|
|
592
|
-
Button.displayName = "Button";
|
|
593
554
|
var HoverCard = HoverCardPrimitive.Root;
|
|
594
555
|
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
595
556
|
var HoverCardContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(HoverCardPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
@@ -1388,107 +1349,6 @@ var ToggleGroupItem = React.forwardRef(({ className, children, variant, size, ..
|
|
|
1388
1349
|
);
|
|
1389
1350
|
});
|
|
1390
1351
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
1391
|
-
|
|
1392
|
-
// src/lib/toast-interaction.ts
|
|
1393
|
-
function isToastInteraction(event) {
|
|
1394
|
-
const original = event.detail?.originalEvent;
|
|
1395
|
-
const target = original?.target ?? event.target;
|
|
1396
|
-
return target instanceof Element && target.closest("[data-sonner-toaster]") !== null;
|
|
1397
|
-
}
|
|
1398
|
-
var Dialog = DialogPrimitive.Root;
|
|
1399
|
-
var DialogTrigger = DialogPrimitive.Trigger;
|
|
1400
|
-
var DialogPortal = DialogPrimitive.Portal;
|
|
1401
|
-
var DialogClose = DialogPrimitive.Close;
|
|
1402
|
-
var DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1403
|
-
DialogPrimitive.Overlay,
|
|
1404
|
-
{
|
|
1405
|
-
ref,
|
|
1406
|
-
className: cn(
|
|
1407
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
1408
|
-
className
|
|
1409
|
-
),
|
|
1410
|
-
...props
|
|
1411
|
-
}
|
|
1412
|
-
));
|
|
1413
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1414
|
-
var PHONE_PRESENTATION = {
|
|
1415
|
-
right: "inset-y-0 left-auto right-0 h-dvh max-h-dvh w-full max-w-[28rem] translate-x-0 translate-y-0 rounded-none border-y-0 border-r-0 data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right data-[state=open]:zoom-in-100 data-[state=closed]:zoom-out-100",
|
|
1416
|
-
center: "",
|
|
1417
|
-
sheet: "max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:w-full max-sm:max-w-full max-sm:border-x-0 max-sm:border-b-0 max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none max-sm:rounded-t-xl max-sm:pb-[max(1.5rem,env(safe-area-inset-bottom))] max-sm:max-h-[calc(100dvh-env(safe-area-inset-top,0px)-2.5rem)] max-sm:data-[state=open]:slide-in-from-bottom-10 max-sm:data-[state=open]:zoom-in-100 max-sm:data-[state=closed]:zoom-out-100",
|
|
1418
|
-
full: "max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:border-x-0 max-sm:border-b-0 max-sm:h-[calc(100dvh-env(safe-area-inset-top,0px)-1rem)] max-sm:w-full max-sm:max-w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none max-sm:rounded-t-xl max-sm:pb-[max(1.5rem,env(safe-area-inset-bottom))] max-sm:max-h-none max-sm:data-[state=open]:slide-in-from-bottom-10 max-sm:data-[state=open]:zoom-in-100 max-sm:data-[state=closed]:zoom-out-100"
|
|
1419
|
-
};
|
|
1420
|
-
var DialogContent = React.forwardRef(
|
|
1421
|
-
({ className, children, hideCloseButton, presentation = "center", onInteractOutside, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
1422
|
-
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
1423
|
-
/* @__PURE__ */ jsxs(
|
|
1424
|
-
DialogPrimitive.Content,
|
|
1425
|
-
{
|
|
1426
|
-
ref,
|
|
1427
|
-
"data-slot": "dialog-content",
|
|
1428
|
-
"data-presentation": presentation,
|
|
1429
|
-
onInteractOutside: (event) => {
|
|
1430
|
-
if (isToastInteraction(event)) event.preventDefault();
|
|
1431
|
-
onInteractOutside?.(event);
|
|
1432
|
-
},
|
|
1433
|
-
className: cn(
|
|
1434
|
-
// Always inside the viewport: width and height are capped by the DYNAMIC viewport (mobile
|
|
1435
|
-
// browser chrome) and the notch / home-indicator insets; the content scrolls inside.
|
|
1436
|
-
"fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem-env(safe-area-inset-left,0px)-env(safe-area-inset-right,0px))] max-w-lg max-h-[calc(min(100dvh,100svh,100vh)-2rem-env(safe-area-inset-top,0px)-env(safe-area-inset-bottom,0px))] translate-x-[-50%] translate-y-[-50%] will-change-transform grid-cols-[minmax(0,1fr)] gap-4 overflow-x-hidden overflow-y-auto overscroll-contain scrollbar-themed border bg-background p-6 shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 rounded-md",
|
|
1437
|
-
PHONE_PRESENTATION[presentation],
|
|
1438
|
-
className
|
|
1439
|
-
),
|
|
1440
|
-
...props,
|
|
1441
|
-
children: [
|
|
1442
|
-
children,
|
|
1443
|
-
!hideCloseButton && /* @__PURE__ */ jsxs(
|
|
1444
|
-
DialogPrimitive.Close,
|
|
1445
|
-
{
|
|
1446
|
-
className: "fixed right-4 top-4 z-20 inline-flex items-center justify-center rounded-sm pointer-coarse:right-2 pointer-coarse:top-2 pointer-coarse:size-11 opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
1447
|
-
"data-testid": "dialog-close-button",
|
|
1448
|
-
children: [
|
|
1449
|
-
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
1450
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close dialog" })
|
|
1451
|
-
]
|
|
1452
|
-
}
|
|
1453
|
-
)
|
|
1454
|
-
]
|
|
1455
|
-
}
|
|
1456
|
-
)
|
|
1457
|
-
] })
|
|
1458
|
-
);
|
|
1459
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
1460
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex min-w-0 flex-col space-y-1.5 pr-8 text-left", className), ...props });
|
|
1461
|
-
DialogHeader.displayName = "DialogHeader";
|
|
1462
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
1463
|
-
"div",
|
|
1464
|
-
{
|
|
1465
|
-
className: cn(
|
|
1466
|
-
// Sticks to the bottom of a scrolling dialog so the actions stay reachable.
|
|
1467
|
-
"sticky bottom-0 z-10 -mx-6 -mb-6 flex flex-col-reverse gap-2 bg-background px-6 pb-6 pt-3 sm:flex-row sm:justify-end",
|
|
1468
|
-
className
|
|
1469
|
-
),
|
|
1470
|
-
...props
|
|
1471
|
-
}
|
|
1472
|
-
);
|
|
1473
|
-
DialogFooter.displayName = "DialogFooter";
|
|
1474
|
-
var DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1475
|
-
DialogPrimitive.Title,
|
|
1476
|
-
{
|
|
1477
|
-
ref,
|
|
1478
|
-
className: cn("break-words text-lg font-semibold leading-tight tracking-tight", className),
|
|
1479
|
-
...props
|
|
1480
|
-
}
|
|
1481
|
-
));
|
|
1482
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
1483
|
-
var DialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1484
|
-
DialogPrimitive.Description,
|
|
1485
|
-
{
|
|
1486
|
-
ref,
|
|
1487
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
1488
|
-
...props
|
|
1489
|
-
}
|
|
1490
|
-
));
|
|
1491
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
1492
1352
|
var Popover = PopoverPrimitive.Root;
|
|
1493
1353
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1494
1354
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
@@ -4025,6 +3885,6 @@ function DocumentCard({
|
|
|
4025
3885
|
);
|
|
4026
3886
|
}
|
|
4027
3887
|
|
|
4028
|
-
export { AgentBadge, AiMarkdown, ArbiBotHeadIcon, AudIcon, Avatar, AvatarFallback, AvatarImage, BASE_COLORS2 as BASE_COLORS, Badge,
|
|
4029
|
-
//# sourceMappingURL=chunk-
|
|
4030
|
-
//# sourceMappingURL=chunk-
|
|
3888
|
+
export { AgentBadge, AiMarkdown, ArbiBotHeadIcon, AudIcon, Avatar, AvatarFallback, AvatarImage, BASE_COLORS2 as BASE_COLORS, Badge, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DictateProvider, DocIcon, DocumentCard, DocumentEntity, ENTITY_MAPPINGS, EmlIcon, EntityIcon, EntityPill, FILE_TYPE_COLORS, HoverCard, HoverCardContent, HoverCardTrigger, HtmlIcon, IconToggle, ImgIcon, InlineMicButton, Input, Label2 as Label, MarkMenu, MicRecordingOverlay, MicWaveformIndicator, NEUTRAL_GRAY2 as NEUTRAL_GRAY, PLACEHOLDER_COLOR, PassageCard, PdfIcon, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PresenceLabel, Progress, ProjectEntity, RadioGroup, RadioGroupItem, RagDot, RelevanceDot, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, Slider, StatusPill, Switch, TAG_TYPE_ICONS, TAG_TYPE_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagEntity, Textarea, ThreadVisibilityIcon, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TxtIcon, UserEntity, UserMenu, VISIBILITY_ICONS, VidIcon, VisibilityIcon, VisibilityToggle, XlsIcon, badgeVariants, cardVariants, classifyMediaError, configureEntityRegistry, configureRagLabels, configureStatusRegistry, formatElapsed, getDocIcon, getEntityColor2 as getEntityColor, getEntityColorStyles, getEntityIcon, getEntityLabel, getStatusVariant, getTagTypeIcon, getTagTypeLabel, getWorkspaceColor, returnFocusToMark, toggleVariants, useAudioRecorder };
|
|
3889
|
+
//# sourceMappingURL=chunk-CVN7MAGQ.js.map
|
|
3890
|
+
//# sourceMappingURL=chunk-CVN7MAGQ.js.map
|