@pristy/pristy-libvue 2.21.0 → 2.21.1
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/{ActivityHistory-BKXIlIOQ.js → ActivityHistory-BGjkKWml.js} +2 -2
- package/dist/{ActivityHistory-BKXIlIOQ.js.map → ActivityHistory-BGjkKWml.js.map} +1 -1
- package/dist/{BookmarksComponent-CdsRbOva.js → BookmarksComponent-DHIe0ttf.js} +2 -2
- package/dist/{BookmarksComponent-CdsRbOva.js.map → BookmarksComponent-DHIe0ttf.js.map} +1 -1
- package/dist/{ChartWrapper-zI_ibAa7.js → ChartWrapper-Zs8fU_KC.js} +2 -2
- package/dist/{ChartWrapper-zI_ibAa7.js.map → ChartWrapper-Zs8fU_KC.js.map} +1 -1
- package/dist/{DisplayFileInDashboardComponent-wpVndKS1.js → DisplayFileInDashboardComponent-VTGlXPxP.js} +19 -18
- package/dist/{DisplayFileInDashboardComponent-wpVndKS1.js.map → DisplayFileInDashboardComponent-VTGlXPxP.js.map} +1 -1
- package/dist/{ExternalApps-Dei3Hn5c.js → ExternalApps-B2alflcL.js} +2 -2
- package/dist/{ExternalApps-Dei3Hn5c.js.map → ExternalApps-B2alflcL.js.map} +1 -1
- package/dist/{FavoriteList-D3Ngq7DO.js → FavoriteList-CcY7AFMX.js} +2 -2
- package/dist/{FavoriteList-D3Ngq7DO.js.map → FavoriteList-CcY7AFMX.js.map} +1 -1
- package/dist/{MarkdownComponent-BasmAVLi.js → MarkdownComponent-LDoBl43h.js} +2 -2
- package/dist/{MarkdownComponent-BasmAVLi.js.map → MarkdownComponent-LDoBl43h.js.map} +1 -1
- package/dist/PDFComponent-BXyQNUhl.js +987 -0
- package/dist/PDFComponent-BXyQNUhl.js.map +1 -0
- package/dist/PdfConfigService-BKVsjC1W.js +17 -0
- package/dist/PdfConfigService-BKVsjC1W.js.map +1 -0
- package/dist/PdfToolsComponent-BC45mg3C.js +1970 -0
- package/dist/PdfToolsComponent-BC45mg3C.js.map +1 -0
- package/dist/{SearchInput-QaOq9dC2.js → SearchInput-C3A2rG7G.js} +2 -2
- package/dist/{SearchInput-QaOq9dC2.js.map → SearchInput-C3A2rG7G.js.map} +1 -1
- package/dist/{UnknownBlockType-8WbbZPjA.js → UnknownBlockType-CK5rOiTB.js} +2 -2
- package/dist/{UnknownBlockType-8WbbZPjA.js.map → UnknownBlockType-CK5rOiTB.js.map} +1 -1
- package/dist/{index-DCSuxZbe.js → index-CPjFX5To.js} +11026 -13828
- package/dist/index-CPjFX5To.js.map +1 -0
- package/dist/pristy-libvue.css +1 -1
- package/dist/pristy-libvue.es.js +1 -1
- package/dist/pristy-libvue.umd.js +23 -23
- package/dist/pristy-libvue.umd.js.map +1 -1
- package/dist/src/components/CodeMirrorBase.vue.d.ts +1 -1
- package/dist/src/components/CodeMirrorEditor.vue.d.ts.map +1 -1
- package/dist/src/components/DiffViewerDialog.vue.d.ts +2 -2
- package/dist/src/components/breadcrumb/ComplexBreadcrumb.vue.d.ts.map +1 -1
- package/dist/src/components/classification/ClassificationPlanList.vue.d.ts.map +1 -1
- package/dist/src/components/classification/NatureSelector.vue.d.ts +4 -2
- package/dist/src/components/classification/NatureSelector.vue.d.ts.map +1 -1
- package/dist/src/components/classification/UploadPlanPopup.vue.d.ts.map +1 -1
- package/dist/src/components/config/ConfigRawEditor.vue.d.ts +1 -1
- package/dist/src/components/config/ListVersionConfig.vue.d.ts +2 -2
- package/dist/src/components/dashboard/DashboardAdminPage.vue.d.ts +2 -2
- package/dist/src/components/dashboard/editor/BlockConfigEditor.vue.d.ts +2 -2
- package/dist/src/components/dashboard/editor/DashboardEditor.vue.d.ts +2 -2
- package/dist/src/components/dashboard/editor/JsonEditorDialog.vue.d.ts +1 -1
- package/dist/src/components/dashboard/editor/MarkdownEditorDialog.vue.d.ts +1 -1
- package/dist/src/components/dashboard/editor/block-configs/ExternalAppsConfig.vue.d.ts.map +1 -1
- package/dist/src/components/dashboard/editor/grid/GridBlock.vue.d.ts.map +1 -1
- package/dist/src/components/navigation/ColumnTogglePanel.vue.d.ts.map +1 -1
- package/dist/src/components/navigation/ContentCompactTableView.vue.d.ts.map +1 -1
- package/dist/src/components/navigation/ContentTableView.vue.d.ts.map +1 -1
- package/dist/src/components/navigation/PreviewPanel.vue.d.ts +2 -2
- package/dist/src/components/navigation/SelectionBar.vue.d.ts.map +1 -1
- package/dist/src/components/search/AdvancedViewPanel.vue.d.ts.map +1 -1
- package/dist/src/components/search/ViewResultsPanel.vue.d.ts.map +1 -1
- package/dist/src/components/viewer/lazyPdfComponents.d.ts +442 -0
- package/dist/src/components/viewer/lazyPdfComponents.d.ts.map +1 -0
- package/dist/src/components/views/PredefinedViewsPanel.vue.d.ts.map +1 -1
- package/dist/src/components/views/ViewList.vue.d.ts.map +1 -1
- package/dist/src/i18n/index.d.ts +14 -0
- package/dist/src/i18n/index.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/stores/filingPlan.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index-DCSuxZbe.js.map +0 -1
|
@@ -0,0 +1,987 @@
|
|
|
1
|
+
import { VuePDF as J, usePDF as ee } from "@tato30/vue-pdf";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { b as te } from "./PdfConfigService-BKVsjC1W.js";
|
|
4
|
+
import { PDFDocument as R, PDFName as F, PDFDict as _, PDFArray as M, PDFHexString as B, PDFString as O } from "pdf-lib";
|
|
5
|
+
import { fromBER as z } from "asn1js";
|
|
6
|
+
import { ContentInfo as $, SignedData as W, TSTInfo as ie } from "pkijs";
|
|
7
|
+
import { openBlock as l, createElementBlock as u, Fragment as b, createElementVNode as s, renderList as Z, toDisplayString as p, createVNode as c, unref as y, createTextVNode as E, createCommentVNode as m, resolveComponent as D, resolveDirective as oe, normalizeClass as U, createBlock as k, withDirectives as g, withCtx as N } from "vue";
|
|
8
|
+
import { useI18n as ne } from "vue-i18n";
|
|
9
|
+
import j from "primevue/tag";
|
|
10
|
+
import { _ as G, u as ae } from "./index-CPjFX5To.js";
|
|
11
|
+
import se from "primevue/tooltip";
|
|
12
|
+
import re from "primevue/button";
|
|
13
|
+
import le from "primevue/progressspinner";
|
|
14
|
+
import de from "primevue/divider";
|
|
15
|
+
import ce from "primevue/inputnumber";
|
|
16
|
+
import fe from "primevue/dialog";
|
|
17
|
+
import ue from "primevue/datatable";
|
|
18
|
+
import pe from "primevue/column";
|
|
19
|
+
async function H(e, t) {
|
|
20
|
+
const o = await R.load(e, {
|
|
21
|
+
ignoreEncryption: !0,
|
|
22
|
+
updateMetadata: !1
|
|
23
|
+
}), a = o.getForm().getFields().filter((i) => i.isReadOnly() !== t);
|
|
24
|
+
if (a.length === 0)
|
|
25
|
+
return { bytes: null, count: 0 };
|
|
26
|
+
for (const i of a)
|
|
27
|
+
t ? i.enableReadOnly() : i.disableReadOnly();
|
|
28
|
+
return { bytes: await o.save(), count: a.length };
|
|
29
|
+
}
|
|
30
|
+
async function me(e) {
|
|
31
|
+
const { bytes: t, count: o } = await H(e, !1);
|
|
32
|
+
return { bytes: t, unlockedCount: o };
|
|
33
|
+
}
|
|
34
|
+
async function he(e) {
|
|
35
|
+
const { bytes: t, count: o } = await H(e, !0);
|
|
36
|
+
return { bytes: t, lockedCount: o };
|
|
37
|
+
}
|
|
38
|
+
const V = "2.5.4.3", ge = "2.5.4.10", ye = "1.2.840.113549.1.9.16.2.14", A = (e) => Array.from(e, (t) => t.toString(16).padStart(2, "0")).join(""), C = (e, t) => {
|
|
39
|
+
const o = e?.typesAndValues?.find((a) => a.type === t);
|
|
40
|
+
return o ? o.value.valueBlock.value : null;
|
|
41
|
+
}, be = (e) => {
|
|
42
|
+
const t = e.lookupMaybe(
|
|
43
|
+
F.of("Contents"),
|
|
44
|
+
B,
|
|
45
|
+
O
|
|
46
|
+
);
|
|
47
|
+
if (!t)
|
|
48
|
+
return null;
|
|
49
|
+
try {
|
|
50
|
+
const o = t.asBytes(), a = z(
|
|
51
|
+
o.buffer.slice(o.byteOffset, o.byteOffset + o.byteLength)
|
|
52
|
+
);
|
|
53
|
+
if (a.offset === -1)
|
|
54
|
+
return null;
|
|
55
|
+
const i = new $({ schema: a.result });
|
|
56
|
+
return new W({ schema: i.content });
|
|
57
|
+
} catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}, Fe = (e) => {
|
|
61
|
+
const t = (e?.certificates ?? []).filter(
|
|
62
|
+
(i) => i.subject
|
|
63
|
+
), o = e?.signerInfos?.[0]?.sid?.serialNumber?.valueBlock?.valueHexView;
|
|
64
|
+
if (!o)
|
|
65
|
+
return t[0] ?? null;
|
|
66
|
+
const a = A(o);
|
|
67
|
+
return t.find(
|
|
68
|
+
(i) => A(i.serialNumber.valueBlock.valueHexView) === a
|
|
69
|
+
) ?? t[0] ?? null;
|
|
70
|
+
}, De = (e) => {
|
|
71
|
+
const t = e?.signerInfos?.[0]?.unsignedAttrs?.attributes?.find(
|
|
72
|
+
(o) => o.type === ye
|
|
73
|
+
);
|
|
74
|
+
if (!t?.values?.length)
|
|
75
|
+
return null;
|
|
76
|
+
try {
|
|
77
|
+
const a = new W({
|
|
78
|
+
schema: new $({ schema: t.values[0] }).content
|
|
79
|
+
}).encapContentInfo?.eContent;
|
|
80
|
+
if (!a)
|
|
81
|
+
return null;
|
|
82
|
+
const i = a.valueBlock.valueHexView, n = z(
|
|
83
|
+
i.buffer.slice(i.byteOffset, i.byteOffset + i.byteLength)
|
|
84
|
+
);
|
|
85
|
+
return n.offset === -1 ? null : new ie({ schema: n.result }).genTime ?? null;
|
|
86
|
+
} catch {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
}, ve = (e) => e ? {
|
|
90
|
+
commonName: C(e.subject, V),
|
|
91
|
+
organization: C(e.subject, ge),
|
|
92
|
+
issuerCommonName: C(e.issuer, V),
|
|
93
|
+
serialNumber: A(e.serialNumber.valueBlock.valueHexView),
|
|
94
|
+
validFrom: e.notBefore.value,
|
|
95
|
+
validUntil: e.notAfter.value
|
|
96
|
+
} : null, P = (e, t) => {
|
|
97
|
+
const o = e.lookupMaybe(F.of(t), O, B);
|
|
98
|
+
return o ? o.decodeText() : null;
|
|
99
|
+
}, ke = {
|
|
100
|
+
"ETSI.CAdES.detached": "PADES",
|
|
101
|
+
"ETSI.RFC3161": "TIMESTAMP",
|
|
102
|
+
"adbe.pkcs7.detached": "ADOBE_PKCS7",
|
|
103
|
+
"adbe.pkcs7.sha1": "ADOBE_PKCS7",
|
|
104
|
+
"adbe.x509.rsa_sha1": "ADOBE_X509"
|
|
105
|
+
}, Pe = (e, t) => {
|
|
106
|
+
const o = e.lookupMaybe(F.of(t), O, B);
|
|
107
|
+
if (!o)
|
|
108
|
+
return null;
|
|
109
|
+
try {
|
|
110
|
+
return o.decodeDate();
|
|
111
|
+
} catch {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
}, x = (e, t = []) => {
|
|
115
|
+
for (let o = 0; o < e.size(); o += 1) {
|
|
116
|
+
const a = e.lookupMaybe(o, _);
|
|
117
|
+
if (!a)
|
|
118
|
+
continue;
|
|
119
|
+
t.push(a);
|
|
120
|
+
const i = a.lookupMaybe(F.of("Kids"), M);
|
|
121
|
+
i && x(i, t);
|
|
122
|
+
}
|
|
123
|
+
return t;
|
|
124
|
+
}, we = (e) => {
|
|
125
|
+
const t = e.lookupMaybe(F.of("ByteRange"), M);
|
|
126
|
+
return !t || t.size() < 4 ? null : t.asArray().map((o) => o.asNumber());
|
|
127
|
+
}, Se = (e, t) => {
|
|
128
|
+
const o = be(t), a = we(t), i = a ? a[2] + a[3] : null, n = t.lookupMaybe(F.of("SubFilter"), F)?.asString().replace(/^\//, "");
|
|
129
|
+
return {
|
|
130
|
+
fieldName: P(e, "T"),
|
|
131
|
+
declaredName: P(t, "Name"),
|
|
132
|
+
reason: P(t, "Reason"),
|
|
133
|
+
location: P(t, "Location"),
|
|
134
|
+
contactInfo: P(t, "ContactInfo"),
|
|
135
|
+
declaredDate: Pe(t, "M"),
|
|
136
|
+
subFilter: n ?? null,
|
|
137
|
+
standard: ke[n] ?? "UNKNOWN",
|
|
138
|
+
byteRange: a,
|
|
139
|
+
coveredUntil: i,
|
|
140
|
+
certificate: ve(Fe(o)),
|
|
141
|
+
timestampDate: De(o)
|
|
142
|
+
};
|
|
143
|
+
}, Ne = (e, t, o) => e.coveredUntil === null ? "UNKNOWN" : e.coveredUntil === o ? "COMPLETE" : e.coveredUntil < t ? "SIGNED_AGAIN" : "MODIFIED_AFTER", Ce = (e, t) => {
|
|
144
|
+
const o = Math.max(
|
|
145
|
+
...e.map((a) => a.coveredUntil ?? 0)
|
|
146
|
+
);
|
|
147
|
+
return e.map((a) => ({
|
|
148
|
+
...a,
|
|
149
|
+
coverage: Ne(a, o, t)
|
|
150
|
+
}));
|
|
151
|
+
}, Ie = async (e) => {
|
|
152
|
+
if (!e || e.length === 0)
|
|
153
|
+
return [];
|
|
154
|
+
let t;
|
|
155
|
+
try {
|
|
156
|
+
t = await R.load(e, {
|
|
157
|
+
ignoreEncryption: !0,
|
|
158
|
+
updateMetadata: !1
|
|
159
|
+
});
|
|
160
|
+
} catch (n) {
|
|
161
|
+
return console.error("Error reading PDF signatures:", n), [];
|
|
162
|
+
}
|
|
163
|
+
const a = t.catalog.lookupMaybe(
|
|
164
|
+
F.of("AcroForm"),
|
|
165
|
+
_
|
|
166
|
+
)?.lookupMaybe(F.of("Fields"), M);
|
|
167
|
+
if (!a)
|
|
168
|
+
return [];
|
|
169
|
+
const i = [];
|
|
170
|
+
for (const n of x(a)) {
|
|
171
|
+
if (n.lookupMaybe(F.of("FT"), F)?.asString() !== "/Sig")
|
|
172
|
+
continue;
|
|
173
|
+
const d = n.lookupMaybe(F.of("V"), _);
|
|
174
|
+
d && i.push(Se(n, d));
|
|
175
|
+
}
|
|
176
|
+
return Ce(i, e.length);
|
|
177
|
+
}, K = "mailto", q = "route", I = "external";
|
|
178
|
+
function _e(e, { origin: t, base: o = "", resolve: a } = {}) {
|
|
179
|
+
if (e.startsWith("mailto:"))
|
|
180
|
+
return { type: K, url: e };
|
|
181
|
+
let i;
|
|
182
|
+
try {
|
|
183
|
+
i = new URL(e, t);
|
|
184
|
+
} catch {
|
|
185
|
+
return { type: I, url: e };
|
|
186
|
+
}
|
|
187
|
+
const n = o.replace(/\/+$/, ""), { pathname: r } = i, d = n === "" || r === n || r.startsWith(`${n}/`);
|
|
188
|
+
if (!a || i.origin !== t || !d)
|
|
189
|
+
return { type: I, url: e };
|
|
190
|
+
const w = r.slice(n.length) || "/", v = a(`${w}${i.search}${i.hash}`);
|
|
191
|
+
return v?.matched?.length ? { type: q, location: v } : { type: I, url: e };
|
|
192
|
+
}
|
|
193
|
+
function Ee(e, t) {
|
|
194
|
+
const o = parseInt(e, 10);
|
|
195
|
+
return isNaN(o) ? null : Math.min(Math.max(o, 1), t);
|
|
196
|
+
}
|
|
197
|
+
const Ae = { class: "pdf-signature-list" }, Me = { class: "pdf-signature-header" }, Be = { class: "pdf-signature-name" }, Oe = {
|
|
198
|
+
key: 0,
|
|
199
|
+
class: "pdf-signature-warning"
|
|
200
|
+
}, Te = {
|
|
201
|
+
key: 1,
|
|
202
|
+
class: "pdf-signature-note"
|
|
203
|
+
}, Le = { class: "pdf-signature-details" }, Ue = { class: "pdf-signature-timestamp" }, Ve = { class: "pdf-signature-disclaimer" }, Re = {
|
|
204
|
+
__name: "PdfSignaturePanel",
|
|
205
|
+
props: {
|
|
206
|
+
signatures: {
|
|
207
|
+
type: Array,
|
|
208
|
+
default: () => []
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
setup(e) {
|
|
212
|
+
const { t } = ne(), o = (i) => i ? i.toLocaleString() : null, a = (i) => i.declaredName || i.certificate?.commonName || t("pdf.signature.unknownSigner");
|
|
213
|
+
return (i, n) => (l(), u(b, null, [
|
|
214
|
+
s("ul", Ae, [
|
|
215
|
+
(l(!0), u(b, null, Z(e.signatures, (r, d) => (l(), u("li", {
|
|
216
|
+
key: d,
|
|
217
|
+
class: "pdf-signature-entry"
|
|
218
|
+
}, [
|
|
219
|
+
s("div", Me, [
|
|
220
|
+
s("p", Be, p(a(r)), 1),
|
|
221
|
+
c(y(j), {
|
|
222
|
+
value: y(t)(`pdf.signature.standard.${r.standard}`),
|
|
223
|
+
severity: r.standard === "PADES" ? "info" : "secondary"
|
|
224
|
+
}, null, 8, ["value", "severity"])
|
|
225
|
+
]),
|
|
226
|
+
r.coverage === "MODIFIED_AFTER" ? (l(), u("p", Oe, [
|
|
227
|
+
n[0] || (n[0] = s("i", {
|
|
228
|
+
class: "ri-error-warning-line",
|
|
229
|
+
"aria-hidden": "true"
|
|
230
|
+
}, null, -1)),
|
|
231
|
+
E(" " + p(y(t)("pdf.signature.modifiedAfter")), 1)
|
|
232
|
+
])) : r.coverage === "SIGNED_AGAIN" ? (l(), u("p", Te, p(y(t)("pdf.signature.signedAgain")), 1)) : m("", !0),
|
|
233
|
+
s("dl", Le, [
|
|
234
|
+
r.declaredDate ? (l(), u(b, { key: 0 }, [
|
|
235
|
+
s("dt", null, p(y(t)("pdf.signature.declaredDate")), 1),
|
|
236
|
+
s("dd", null, p(o(r.declaredDate)), 1)
|
|
237
|
+
], 64)) : m("", !0),
|
|
238
|
+
r.timestampDate ? (l(), u(b, { key: 1 }, [
|
|
239
|
+
s("dt", Ue, p(y(t)("pdf.signature.timestampDate")), 1),
|
|
240
|
+
s("dd", null, p(o(r.timestampDate)), 1)
|
|
241
|
+
], 64)) : m("", !0),
|
|
242
|
+
r.reason ? (l(), u(b, { key: 2 }, [
|
|
243
|
+
s("dt", null, p(y(t)("pdf.signature.reason")), 1),
|
|
244
|
+
s("dd", null, p(r.reason), 1)
|
|
245
|
+
], 64)) : m("", !0),
|
|
246
|
+
r.location ? (l(), u(b, { key: 3 }, [
|
|
247
|
+
s("dt", null, p(y(t)("pdf.signature.location")), 1),
|
|
248
|
+
s("dd", null, p(r.location), 1)
|
|
249
|
+
], 64)) : m("", !0),
|
|
250
|
+
r.certificate?.organization ? (l(), u(b, { key: 4 }, [
|
|
251
|
+
s("dt", null, p(y(t)("pdf.signature.organization")), 1),
|
|
252
|
+
s("dd", null, p(r.certificate.organization), 1)
|
|
253
|
+
], 64)) : m("", !0),
|
|
254
|
+
r.certificate?.issuerCommonName ? (l(), u(b, { key: 5 }, [
|
|
255
|
+
s("dt", null, p(y(t)("pdf.signature.issuer")), 1),
|
|
256
|
+
s("dd", null, p(r.certificate.issuerCommonName), 1)
|
|
257
|
+
], 64)) : m("", !0),
|
|
258
|
+
r.certificate?.validUntil ? (l(), u(b, { key: 6 }, [
|
|
259
|
+
s("dt", null, p(y(t)("pdf.signature.certificateValidity")), 1),
|
|
260
|
+
s("dd", null, p(y(t)("pdf.signature.certificateValidityValue", {
|
|
261
|
+
from: o(r.certificate.validFrom),
|
|
262
|
+
until: o(r.certificate.validUntil)
|
|
263
|
+
})), 1)
|
|
264
|
+
], 64)) : m("", !0)
|
|
265
|
+
])
|
|
266
|
+
]))), 128))
|
|
267
|
+
]),
|
|
268
|
+
s("p", Ve, [
|
|
269
|
+
n[1] || (n[1] = s("i", {
|
|
270
|
+
class: "ri-information-line",
|
|
271
|
+
"aria-hidden": "true"
|
|
272
|
+
}, null, -1)),
|
|
273
|
+
E(" " + p(y(t)("pdf.signature.notVerified")), 1)
|
|
274
|
+
])
|
|
275
|
+
], 64));
|
|
276
|
+
}
|
|
277
|
+
}, ze = /* @__PURE__ */ G(Re, [["__scopeId", "data-v-2a4f6ae6"]]), $e = {
|
|
278
|
+
name: "PDFComponent",
|
|
279
|
+
components: {
|
|
280
|
+
VuePDF: J,
|
|
281
|
+
PdfSignaturePanel: ze,
|
|
282
|
+
PrimeButton: re,
|
|
283
|
+
PrimeProgressSpinner: le,
|
|
284
|
+
PrimeDivider: de,
|
|
285
|
+
PrimeTag: j,
|
|
286
|
+
PrimeInputNumber: ce,
|
|
287
|
+
PrimeDialog: fe,
|
|
288
|
+
PrimeDataTable: ue,
|
|
289
|
+
PrimeColumn: pe
|
|
290
|
+
},
|
|
291
|
+
directives: {
|
|
292
|
+
tooltip: se
|
|
293
|
+
},
|
|
294
|
+
emits: [
|
|
295
|
+
"formDirtyChange",
|
|
296
|
+
"saveForm",
|
|
297
|
+
"lockForm",
|
|
298
|
+
"formUnlocked",
|
|
299
|
+
"formUnlockError"
|
|
300
|
+
],
|
|
301
|
+
props: {
|
|
302
|
+
url: {
|
|
303
|
+
type: String,
|
|
304
|
+
default: null
|
|
305
|
+
},
|
|
306
|
+
textLayer: {
|
|
307
|
+
type: Boolean,
|
|
308
|
+
default: !1
|
|
309
|
+
},
|
|
310
|
+
annotationLayer: {
|
|
311
|
+
type: Boolean,
|
|
312
|
+
default: !1
|
|
313
|
+
},
|
|
314
|
+
hideForms: {
|
|
315
|
+
type: Boolean,
|
|
316
|
+
default: !1
|
|
317
|
+
},
|
|
318
|
+
canSaveForm: {
|
|
319
|
+
type: Boolean,
|
|
320
|
+
default: !1
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
data() {
|
|
324
|
+
return {
|
|
325
|
+
pdf: null,
|
|
326
|
+
pages: null,
|
|
327
|
+
page: 1,
|
|
328
|
+
rotation: 0,
|
|
329
|
+
scale: 1,
|
|
330
|
+
defaultViewport: {
|
|
331
|
+
width: 0,
|
|
332
|
+
height: 0
|
|
333
|
+
},
|
|
334
|
+
isSinglePageDisplayed: !0,
|
|
335
|
+
isFormDirty: !1,
|
|
336
|
+
isSaving: !1,
|
|
337
|
+
isUnlocking: !1,
|
|
338
|
+
isLocking: !1,
|
|
339
|
+
hasFormFields: !1,
|
|
340
|
+
hasReadOnlyFields: !1,
|
|
341
|
+
unlockedFormBytes: null,
|
|
342
|
+
showFormFieldsDialog: !1,
|
|
343
|
+
formFieldsData: [],
|
|
344
|
+
formFieldValues: {},
|
|
345
|
+
signatures: [],
|
|
346
|
+
showSignaturesDialog: !1
|
|
347
|
+
};
|
|
348
|
+
},
|
|
349
|
+
computed: {
|
|
350
|
+
getVersionNumber() {
|
|
351
|
+
return `Version ${this.$route.params.versionId}`;
|
|
352
|
+
},
|
|
353
|
+
getFileName() {
|
|
354
|
+
const e = ae();
|
|
355
|
+
return e.files.length > 0 ? e.files[0].name : "";
|
|
356
|
+
},
|
|
357
|
+
isLeftButtonDisable() {
|
|
358
|
+
return this.page === 1;
|
|
359
|
+
},
|
|
360
|
+
isRightButtonDisable() {
|
|
361
|
+
return this.page === this.pages;
|
|
362
|
+
},
|
|
363
|
+
isPdfConsultationPage() {
|
|
364
|
+
return this.$route.name.startsWith("consultation-pdf");
|
|
365
|
+
},
|
|
366
|
+
isSmallScreen() {
|
|
367
|
+
return window.innerWidth <= 920;
|
|
368
|
+
},
|
|
369
|
+
hasSignatures() {
|
|
370
|
+
return this.signatures.length > 0;
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
watch: {
|
|
374
|
+
pages(e) {
|
|
375
|
+
if (this.isPdfConsultationPage) {
|
|
376
|
+
const t = parseInt(this.$route.query.page) || 1;
|
|
377
|
+
this.page = t > e ? e : t < 1 ? 1 : t, this.changePageUrl(this.page);
|
|
378
|
+
}
|
|
379
|
+
e && (this.checkFormFields(), this.checkSignatures());
|
|
380
|
+
},
|
|
381
|
+
page(e) {
|
|
382
|
+
this.isPdfConsultationPage && this.changePageUrl(e);
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
mounted() {
|
|
386
|
+
this.focusOnPDFComponent(), this.loadPDF(), this.setDefaultViewport(), this.fitAuto();
|
|
387
|
+
},
|
|
388
|
+
unmounted() {
|
|
389
|
+
this.pdf && (this.pdf.destroy(), this.pdf && delete this.pdf);
|
|
390
|
+
},
|
|
391
|
+
methods: {
|
|
392
|
+
changePdfDisplay() {
|
|
393
|
+
if (this.loadPDF(), this.isSinglePageDisplayed = !this.isSinglePageDisplayed, this.isPdfConsultationPage) {
|
|
394
|
+
const e = new URL(window.location.href);
|
|
395
|
+
this.isSinglePageDisplayed ? this.changePageUrl(this.page) : (e.searchParams.delete("page"), window.history.replaceState(history.state, "", e.toString()));
|
|
396
|
+
}
|
|
397
|
+
this.isSinglePageDisplayed && this.focusOnPDFComponent();
|
|
398
|
+
},
|
|
399
|
+
setDefaultViewport() {
|
|
400
|
+
this.isSmallScreen ? (this.defaultViewport.width = 300, this.defaultViewport.height = 200) : this.$route.name === "consultation-pdf" ? (this.defaultViewport.width = 700, this.defaultViewport.height = 500) : (this.defaultViewport.width = 900, this.defaultViewport.height = 700);
|
|
401
|
+
},
|
|
402
|
+
menuDiff() {
|
|
403
|
+
let d;
|
|
404
|
+
return window.innerWidth <= 640 ? d = 200 : window.innerWidth <= 768 ? d = 250 : window.innerWidth <= 1024 ? d = 300 : d = 350, d;
|
|
405
|
+
},
|
|
406
|
+
pageWidthScale() {
|
|
407
|
+
return this.defaultViewport.width ? (window.innerWidth - this.menuDiff()) / this.defaultViewport.width : 1;
|
|
408
|
+
},
|
|
409
|
+
pageHeightScale() {
|
|
410
|
+
return this.defaultViewport.height ? (window.innerHeight - this.menuDiff()) / this.defaultViewport.height * 0.8 : 1;
|
|
411
|
+
},
|
|
412
|
+
zoomIn() {
|
|
413
|
+
this.scale = this.scale < 2 ? this.scale + 0.25 : this.scale;
|
|
414
|
+
},
|
|
415
|
+
zoomOut() {
|
|
416
|
+
this.scale = this.scale > 0.25 ? this.scale - 0.25 : this.scale;
|
|
417
|
+
},
|
|
418
|
+
fitAuto() {
|
|
419
|
+
const e = this.pageWidthScale(), t = this.pageHeightScale();
|
|
420
|
+
this.scale = Math.min(e, t);
|
|
421
|
+
},
|
|
422
|
+
fitWidthAuto() {
|
|
423
|
+
this.scale = this.pageWidthScale();
|
|
424
|
+
},
|
|
425
|
+
previousPage() {
|
|
426
|
+
this.isLeftButtonDisable || (this.page = this.page > 1 ? this.page - 1 : this.page);
|
|
427
|
+
},
|
|
428
|
+
nextPage() {
|
|
429
|
+
this.isRightButtonDisable || (this.page = this.page < this.pages ? this.page + 1 : this.page);
|
|
430
|
+
},
|
|
431
|
+
/**
|
|
432
|
+
* Source handed to pdf.js: the node URL, or the in-memory bytes produced by
|
|
433
|
+
* unlockForm(). pdf.js transfers the `data` buffer to its worker, which
|
|
434
|
+
* detaches it, so every load gets its own copy — otherwise a second load
|
|
435
|
+
* (cancelForm, changePdfDisplay) would fail on a detached ArrayBuffer.
|
|
436
|
+
*
|
|
437
|
+
* @returns {string|{data: Uint8Array}}
|
|
438
|
+
*/
|
|
439
|
+
currentPdfSource() {
|
|
440
|
+
return this.unlockedFormBytes ? { data: this.unlockedFormBytes.slice() } : this.url;
|
|
441
|
+
},
|
|
442
|
+
loadPDF() {
|
|
443
|
+
if (!this.url) {
|
|
444
|
+
console.error("URL is not defined");
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
this.hasFormFields = !1, this.hasReadOnlyFields = !1, this.formFieldValues = {}, this.signatures = [];
|
|
448
|
+
const e = ee(te(this.currentPdfSource()));
|
|
449
|
+
this.pdf = e.pdf, this.pages = e.pages;
|
|
450
|
+
},
|
|
451
|
+
changePageUrl(e) {
|
|
452
|
+
if (e !== 0) {
|
|
453
|
+
const t = parseInt(e, 10);
|
|
454
|
+
if (!isNaN(t)) {
|
|
455
|
+
const o = new URLSearchParams(window.location.search);
|
|
456
|
+
o.set("page", t), window.history.replaceState(
|
|
457
|
+
history.state,
|
|
458
|
+
"",
|
|
459
|
+
`${window.location.pathname}?${o.toString()}`
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
focusOnPDFComponent() {
|
|
465
|
+
this.$refs.pdfComponent && this.$refs.pdfComponent.focus();
|
|
466
|
+
},
|
|
467
|
+
async getFormBytes() {
|
|
468
|
+
if (!this.pdf)
|
|
469
|
+
return null;
|
|
470
|
+
const e = await this.pdf.promise;
|
|
471
|
+
try {
|
|
472
|
+
return await e.saveDocument();
|
|
473
|
+
} catch (t) {
|
|
474
|
+
return console.error("Error saving PDF document:", t), await e.getData();
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
resetFormDirty() {
|
|
478
|
+
this.isFormDirty = !1, this.$emit("formDirtyChange", !1);
|
|
479
|
+
},
|
|
480
|
+
setSaving(e) {
|
|
481
|
+
this.isSaving = e;
|
|
482
|
+
},
|
|
483
|
+
setLocking(e) {
|
|
484
|
+
this.isLocking = e;
|
|
485
|
+
},
|
|
486
|
+
/**
|
|
487
|
+
* Bytes of the form with the values typed in the viewer kept and every
|
|
488
|
+
* field flagged read-only, ready to be stored as a new version.
|
|
489
|
+
*
|
|
490
|
+
* @returns {Promise<Uint8Array|null>} null when the document is not loaded
|
|
491
|
+
*/
|
|
492
|
+
async getLockedFormBytes() {
|
|
493
|
+
const e = await this.getFormBytes();
|
|
494
|
+
if (!e)
|
|
495
|
+
return null;
|
|
496
|
+
const { bytes: t } = await he(e);
|
|
497
|
+
return t ?? e;
|
|
498
|
+
},
|
|
499
|
+
onAnnotation(e) {
|
|
500
|
+
if (e)
|
|
501
|
+
switch (e.type) {
|
|
502
|
+
case "link":
|
|
503
|
+
this.followLink(e.data.url);
|
|
504
|
+
break;
|
|
505
|
+
case "internal-link":
|
|
506
|
+
this.goToPage(e.data.referencedPage);
|
|
507
|
+
break;
|
|
508
|
+
case "form-text":
|
|
509
|
+
this.formFieldValues[e.data.fieldName] = e.data.value, this.isFormDirty || (this.isFormDirty = !0, this.$emit("formDirtyChange", !0));
|
|
510
|
+
break;
|
|
511
|
+
case "form-checkbox":
|
|
512
|
+
this.formFieldValues[e.data.fieldName] = e.data.checked, this.isFormDirty || (this.isFormDirty = !0, this.$emit("formDirtyChange", !0));
|
|
513
|
+
break;
|
|
514
|
+
case "form-select":
|
|
515
|
+
this.formFieldValues[e.data.fieldName] = e.data.value, this.isFormDirty || (this.isFormDirty = !0, this.$emit("formDirtyChange", !0));
|
|
516
|
+
break;
|
|
517
|
+
case "form-radio":
|
|
518
|
+
this.formFieldValues[e.data.fieldName] = e.data.value, this.isFormDirty || (this.isFormDirty = !0, this.$emit("formDirtyChange", !0));
|
|
519
|
+
break;
|
|
520
|
+
default:
|
|
521
|
+
console.log("Annotation Event ", e);
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
followLink(e) {
|
|
525
|
+
const t = _e(e, {
|
|
526
|
+
origin: window.location.origin,
|
|
527
|
+
base: this.$router?.options.history.base,
|
|
528
|
+
resolve: this.$router ? (o) => this.$router.resolve(o) : null
|
|
529
|
+
});
|
|
530
|
+
switch (t.type) {
|
|
531
|
+
case K:
|
|
532
|
+
window.location.href = t.url;
|
|
533
|
+
break;
|
|
534
|
+
case q:
|
|
535
|
+
t.location.path === this.$route.path ? this.goToPage(t.location.query.page) : this.$router.push(t.location.fullPath);
|
|
536
|
+
break;
|
|
537
|
+
default:
|
|
538
|
+
window.open(t.url, "_blank", "noreferrer");
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
goToPage(e) {
|
|
542
|
+
const t = Ee(e, this.pages);
|
|
543
|
+
t !== null && (this.page = t, this.isSinglePageDisplayed || this.$el.querySelectorAll(".pdf-page-item")[t - 1]?.scrollIntoView({ behavior: "smooth", block: "start" }));
|
|
544
|
+
},
|
|
545
|
+
async checkSignatures() {
|
|
546
|
+
if (!this.pdf) {
|
|
547
|
+
this.signatures = [];
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
try {
|
|
551
|
+
const e = await this.pdf.promise;
|
|
552
|
+
this.signatures = await Ie(await e.getData());
|
|
553
|
+
} catch (e) {
|
|
554
|
+
console.error("Error reading signatures:", e), this.signatures = [];
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
async checkFormFields() {
|
|
558
|
+
if (!this.pdf) {
|
|
559
|
+
this.hasFormFields = !1, this.hasReadOnlyFields = !1;
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
try {
|
|
563
|
+
const t = await (await this.pdf.promise).getFieldObjects();
|
|
564
|
+
this.hasFormFields = t !== null && Object.keys(t).length > 0, this.hasReadOnlyFields = Object.values(t ?? {}).flat().some((o) => o.editable === !1);
|
|
565
|
+
} catch (e) {
|
|
566
|
+
console.error("Error checking form fields:", e), this.hasFormFields = !1, this.hasReadOnlyFields = !1;
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
/**
|
|
570
|
+
* Drop the ReadOnly flags of the form so its fields become fillable.
|
|
571
|
+
*
|
|
572
|
+
* The change stays local: the viewer is reloaded from the rewritten bytes
|
|
573
|
+
* and nothing is sent to the repository. The unlocked structure reaches
|
|
574
|
+
* Alfresco only if the user then saves the filled form, through the regular
|
|
575
|
+
* save path.
|
|
576
|
+
*/
|
|
577
|
+
async unlockForm() {
|
|
578
|
+
if (!(!this.pdf || this.isUnlocking)) {
|
|
579
|
+
this.isUnlocking = !0;
|
|
580
|
+
try {
|
|
581
|
+
const e = await this.pdf.promise, { bytes: t, unlockedCount: o } = await me(
|
|
582
|
+
await e.getData()
|
|
583
|
+
);
|
|
584
|
+
if (!t) {
|
|
585
|
+
this.hasReadOnlyFields = !1;
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
this.unlockedFormBytes = t, this.loadPDF(), this.$emit("formUnlocked", o);
|
|
589
|
+
} catch (e) {
|
|
590
|
+
console.error("Error unlocking PDF form fields:", e), this.$emit("formUnlockError", e);
|
|
591
|
+
} finally {
|
|
592
|
+
this.isUnlocking = !1;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
cancelForm() {
|
|
597
|
+
this.loadPDF(), this.resetFormDirty();
|
|
598
|
+
},
|
|
599
|
+
async showFormFieldsInfo() {
|
|
600
|
+
if (this.pdf)
|
|
601
|
+
try {
|
|
602
|
+
const t = await (await this.pdf.promise).getFieldObjects();
|
|
603
|
+
if (!t)
|
|
604
|
+
this.formFieldsData = [];
|
|
605
|
+
else {
|
|
606
|
+
const o = [];
|
|
607
|
+
for (const [a, i] of Object.entries(t))
|
|
608
|
+
for (const n of i) {
|
|
609
|
+
const r = this.formFieldValues[a];
|
|
610
|
+
o.push({
|
|
611
|
+
name: a,
|
|
612
|
+
type: n.type,
|
|
613
|
+
value: r !== void 0 ? r : n.value ?? ""
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
this.formFieldsData = o;
|
|
617
|
+
}
|
|
618
|
+
this.showFormFieldsDialog = !0;
|
|
619
|
+
} catch (e) {
|
|
620
|
+
console.error("Error getting form fields info:", e);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}, We = { key: 1 }, Ze = {
|
|
625
|
+
key: 0,
|
|
626
|
+
class: "pdf-toolbar-group"
|
|
627
|
+
}, je = { class: "pdf-page-indicator" }, Ge = {
|
|
628
|
+
key: 2,
|
|
629
|
+
class: "pdf-toolbar-section"
|
|
630
|
+
}, He = { class: "pdf-toolbar-group" }, xe = { class: "pdf-toolbar-section" }, Ke = { class: "pdf-toolbar-group" }, qe = { class: "pdf-toolbar-section" }, Xe = { class: "pdf-toolbar-group" }, Qe = { class: "pdf-toolbar-section" }, Ye = { class: "pdf-toolbar-group" }, Je = { class: "pdf-toolbar-section" }, et = { class: "pdf-toolbar-group" }, tt = { class: "flex flex-column align-items-center" }, it = { class: "flex gap-1 m-2" }, ot = { class: "pdf-header" }, nt = {
|
|
631
|
+
key: 0,
|
|
632
|
+
class: "pdf-title-container"
|
|
633
|
+
}, at = { class: "consultation-title" }, st = {
|
|
634
|
+
key: 0,
|
|
635
|
+
class: "pdf-single-page"
|
|
636
|
+
}, rt = {
|
|
637
|
+
key: 1,
|
|
638
|
+
class: "pdf-all-pages"
|
|
639
|
+
}, lt = { class: "pdf-page-number" };
|
|
640
|
+
function dt(e, t, o, a, i, n) {
|
|
641
|
+
const r = D("PrimeProgressSpinner"), d = D("PrimeButton"), w = D("PrimeInputNumber"), v = D("PrimeDivider"), X = D("PrimeTag"), T = D("VuePDF"), S = D("PrimeColumn"), Q = D("PrimeDataTable"), L = D("PrimeDialog"), Y = D("PdfSignaturePanel"), h = oe("tooltip");
|
|
642
|
+
return l(), u("div", {
|
|
643
|
+
ref: "pdfComponent",
|
|
644
|
+
class: U(["pdf-component-root", {
|
|
645
|
+
"outline-none": n.isPdfConsultationPage
|
|
646
|
+
}]),
|
|
647
|
+
tabindex: "0"
|
|
648
|
+
}, [
|
|
649
|
+
i.pdf ? (l(), u("div", We, [
|
|
650
|
+
s("div", {
|
|
651
|
+
class: U(["pdf-toolbar", { "pdf-toolbar--small": n.isSmallScreen }])
|
|
652
|
+
}, [
|
|
653
|
+
i.isSinglePageDisplayed ? (l(), u("div", Ze, [
|
|
654
|
+
g(c(d, {
|
|
655
|
+
"aria-label": e.$t("pdf.previousPage"),
|
|
656
|
+
icon: "ri-arrow-left-line",
|
|
657
|
+
class: "pdf-toolbar-btn",
|
|
658
|
+
disabled: n.isLeftButtonDisable,
|
|
659
|
+
onClick: t[0] || (t[0] = (f) => n.previousPage())
|
|
660
|
+
}, null, 8, ["aria-label", "disabled"]), [
|
|
661
|
+
[h, e.$t("pdf.previousPage")]
|
|
662
|
+
]),
|
|
663
|
+
s("span", je, [
|
|
664
|
+
c(w, {
|
|
665
|
+
modelValue: i.page,
|
|
666
|
+
"onUpdate:modelValue": t[1] || (t[1] = (f) => i.page = f),
|
|
667
|
+
"aria-label": e.$t("pdf.changePage"),
|
|
668
|
+
fluid: "",
|
|
669
|
+
min: 1,
|
|
670
|
+
max: i.pages,
|
|
671
|
+
disabled: i.pages === 1,
|
|
672
|
+
class: "pageInputNumber"
|
|
673
|
+
}, null, 8, ["modelValue", "aria-label", "max", "disabled"]),
|
|
674
|
+
E(" " + p(e.$t("pdf.on")) + " " + p(i.pages), 1)
|
|
675
|
+
]),
|
|
676
|
+
g(c(d, {
|
|
677
|
+
"aria-label": e.$t("pdf.nextPage"),
|
|
678
|
+
icon: "ri-arrow-right-line",
|
|
679
|
+
class: "pdf-toolbar-btn",
|
|
680
|
+
disabled: n.isRightButtonDisable,
|
|
681
|
+
onClick: t[2] || (t[2] = (f) => n.nextPage())
|
|
682
|
+
}, null, 8, ["aria-label", "disabled"]), [
|
|
683
|
+
[h, e.$t("pdf.nextPage")]
|
|
684
|
+
])
|
|
685
|
+
])) : m("", !0),
|
|
686
|
+
i.pages > 1 ? (l(), k(v, {
|
|
687
|
+
key: 1,
|
|
688
|
+
layout: "vertical",
|
|
689
|
+
class: "pdfActionDivider"
|
|
690
|
+
})) : m("", !0),
|
|
691
|
+
i.pages > 1 ? (l(), u("div", Ge, [
|
|
692
|
+
s("div", He, [
|
|
693
|
+
s("div", null, [
|
|
694
|
+
i.isSinglePageDisplayed ? g((l(), k(d, {
|
|
695
|
+
key: 0,
|
|
696
|
+
"aria-label": e.$t("pdf.showAllPages"),
|
|
697
|
+
icon: "ri-file-copy-2-line",
|
|
698
|
+
class: "pdf-toolbar-btn",
|
|
699
|
+
onClick: t[3] || (t[3] = (f) => n.changePdfDisplay())
|
|
700
|
+
}, null, 8, ["aria-label"])), [
|
|
701
|
+
[
|
|
702
|
+
h,
|
|
703
|
+
e.$t("pdf.showAllPages"),
|
|
704
|
+
void 0,
|
|
705
|
+
{ top: !0 }
|
|
706
|
+
]
|
|
707
|
+
]) : g((l(), k(d, {
|
|
708
|
+
key: 1,
|
|
709
|
+
"aria-label": e.$t("pdf.showPageByPage"),
|
|
710
|
+
icon: "ri-file-list-line",
|
|
711
|
+
class: "pdf-toolbar-btn",
|
|
712
|
+
onClick: t[4] || (t[4] = (f) => n.changePdfDisplay())
|
|
713
|
+
}, null, 8, ["aria-label"])), [
|
|
714
|
+
[
|
|
715
|
+
h,
|
|
716
|
+
e.$t("pdf.showPageByPage"),
|
|
717
|
+
void 0,
|
|
718
|
+
{ top: !0 }
|
|
719
|
+
]
|
|
720
|
+
])
|
|
721
|
+
])
|
|
722
|
+
])
|
|
723
|
+
])) : m("", !0),
|
|
724
|
+
c(v, {
|
|
725
|
+
layout: "vertical",
|
|
726
|
+
class: "pdfActionDivider"
|
|
727
|
+
}),
|
|
728
|
+
s("div", xe, [
|
|
729
|
+
s("div", Ke, [
|
|
730
|
+
g(c(d, {
|
|
731
|
+
"aria-label": e.$t("pdf.rotationLeft"),
|
|
732
|
+
icon: "ri-arrow-go-back-line",
|
|
733
|
+
class: "pdf-toolbar-btn",
|
|
734
|
+
onClick: t[5] || (t[5] = (f) => i.rotation = i.rotation - 90)
|
|
735
|
+
}, null, 8, ["aria-label"]), [
|
|
736
|
+
[h, e.$t("pdf.rotationLeft")]
|
|
737
|
+
]),
|
|
738
|
+
g(c(d, {
|
|
739
|
+
"aria-label": e.$t("pdf.rotationRigth"),
|
|
740
|
+
icon: "ri-arrow-go-forward-line",
|
|
741
|
+
class: "pdf-toolbar-btn",
|
|
742
|
+
onClick: t[6] || (t[6] = (f) => i.rotation = i.rotation + 90)
|
|
743
|
+
}, null, 8, ["aria-label"]), [
|
|
744
|
+
[h, e.$t("pdf.rotationRigth")]
|
|
745
|
+
])
|
|
746
|
+
])
|
|
747
|
+
]),
|
|
748
|
+
c(v, {
|
|
749
|
+
layout: "vertical",
|
|
750
|
+
class: "pdfActionDivider"
|
|
751
|
+
}),
|
|
752
|
+
s("div", qe, [
|
|
753
|
+
s("div", Xe, [
|
|
754
|
+
g(c(d, {
|
|
755
|
+
"aria-label": e.$t("pdf.dezoom"),
|
|
756
|
+
icon: "ri-zoom-out-line",
|
|
757
|
+
class: "pdf-toolbar-btn",
|
|
758
|
+
onClick: n.zoomOut
|
|
759
|
+
}, null, 8, ["aria-label", "onClick"]), [
|
|
760
|
+
[h, e.$t("pdf.dezoom")]
|
|
761
|
+
]),
|
|
762
|
+
g(c(d, {
|
|
763
|
+
"aria-label": e.$t("pdf.zoom"),
|
|
764
|
+
icon: "ri-zoom-in-line",
|
|
765
|
+
class: "pdf-toolbar-btn",
|
|
766
|
+
onClick: n.zoomIn
|
|
767
|
+
}, null, 8, ["aria-label", "onClick"]), [
|
|
768
|
+
[h, e.$t("pdf.zoom")]
|
|
769
|
+
])
|
|
770
|
+
])
|
|
771
|
+
]),
|
|
772
|
+
c(v, {
|
|
773
|
+
layout: "vertical",
|
|
774
|
+
class: "pdfActionDivider"
|
|
775
|
+
}),
|
|
776
|
+
s("div", Qe, [
|
|
777
|
+
s("div", Ye, [
|
|
778
|
+
g(c(d, {
|
|
779
|
+
"aria-label": e.$t("pdf.adaptToPage"),
|
|
780
|
+
icon: "ri-expand-vertical-line",
|
|
781
|
+
class: "pdf-toolbar-btn",
|
|
782
|
+
onClick: t[7] || (t[7] = (f) => n.fitAuto())
|
|
783
|
+
}, null, 8, ["aria-label"]), [
|
|
784
|
+
[
|
|
785
|
+
h,
|
|
786
|
+
e.$t("pdf.adaptToPage"),
|
|
787
|
+
void 0,
|
|
788
|
+
{ left: !0 }
|
|
789
|
+
]
|
|
790
|
+
]),
|
|
791
|
+
g(c(d, {
|
|
792
|
+
"aria-label": e.$t("pdf.adaptToWidth"),
|
|
793
|
+
icon: "ri-expand-horizontal-line",
|
|
794
|
+
class: "pdf-toolbar-btn",
|
|
795
|
+
onClick: t[8] || (t[8] = (f) => n.fitWidthAuto())
|
|
796
|
+
}, null, 8, ["aria-label"]), [
|
|
797
|
+
[
|
|
798
|
+
h,
|
|
799
|
+
e.$t("pdf.adaptToWidth"),
|
|
800
|
+
void 0,
|
|
801
|
+
{ left: !0 }
|
|
802
|
+
]
|
|
803
|
+
])
|
|
804
|
+
])
|
|
805
|
+
]),
|
|
806
|
+
n.hasSignatures ? (l(), u(b, { key: 3 }, [
|
|
807
|
+
c(v, {
|
|
808
|
+
layout: "vertical",
|
|
809
|
+
class: "pdfActionDivider"
|
|
810
|
+
}),
|
|
811
|
+
s("div", Je, [
|
|
812
|
+
s("div", et, [
|
|
813
|
+
g(c(d, {
|
|
814
|
+
"aria-label": e.$t("pdf.showSignatures"),
|
|
815
|
+
icon: "ri-certificate-2-line",
|
|
816
|
+
class: "pdf-toolbar-btn",
|
|
817
|
+
onClick: t[9] || (t[9] = (f) => i.showSignaturesDialog = !0)
|
|
818
|
+
}, null, 8, ["aria-label"]), [
|
|
819
|
+
[h, e.$t("pdf.showSignatures")]
|
|
820
|
+
])
|
|
821
|
+
])
|
|
822
|
+
])
|
|
823
|
+
], 64)) : m("", !0),
|
|
824
|
+
i.hasFormFields && !o.hideForms ? (l(), u(b, { key: 4 }, [
|
|
825
|
+
c(v, {
|
|
826
|
+
layout: "vertical",
|
|
827
|
+
class: "pdfActionDivider"
|
|
828
|
+
}),
|
|
829
|
+
s("div", tt, [
|
|
830
|
+
s("div", it, [
|
|
831
|
+
o.canSaveForm && i.hasReadOnlyFields ? g((l(), k(d, {
|
|
832
|
+
key: 0,
|
|
833
|
+
"aria-label": e.$t("pdf.unlockForm"),
|
|
834
|
+
icon: "ri-lock-line",
|
|
835
|
+
severity: "warning",
|
|
836
|
+
class: "text-xl p-1",
|
|
837
|
+
disabled: i.isFormDirty || i.isUnlocking,
|
|
838
|
+
loading: i.isUnlocking,
|
|
839
|
+
onClick: t[10] || (t[10] = (f) => n.unlockForm())
|
|
840
|
+
}, null, 8, ["aria-label", "disabled", "loading"])), [
|
|
841
|
+
[
|
|
842
|
+
h,
|
|
843
|
+
i.isFormDirty ? e.$t("pdf.unlockFormBlocked") : e.$t("pdf.unlockForm")
|
|
844
|
+
]
|
|
845
|
+
]) : m("", !0),
|
|
846
|
+
o.canSaveForm && !i.hasReadOnlyFields ? g((l(), k(d, {
|
|
847
|
+
key: 1,
|
|
848
|
+
"aria-label": e.$t("pdf.lockForm"),
|
|
849
|
+
icon: "ri-lock-unlock-line",
|
|
850
|
+
class: "text-xl p-1",
|
|
851
|
+
disabled: i.isLocking || i.isSaving,
|
|
852
|
+
loading: i.isLocking,
|
|
853
|
+
onClick: t[11] || (t[11] = (f) => e.$emit("lockForm"))
|
|
854
|
+
}, null, 8, ["aria-label", "disabled", "loading"])), [
|
|
855
|
+
[h, e.$t("pdf.lockForm")]
|
|
856
|
+
]) : m("", !0),
|
|
857
|
+
o.canSaveForm ? g((l(), k(d, {
|
|
858
|
+
key: 2,
|
|
859
|
+
"aria-label": e.$t("pdf.saveForm"),
|
|
860
|
+
icon: "ri-save-line",
|
|
861
|
+
severity: "info",
|
|
862
|
+
class: "text-xl p-1",
|
|
863
|
+
disabled: !i.isFormDirty || i.isSaving,
|
|
864
|
+
loading: i.isSaving,
|
|
865
|
+
onClick: t[12] || (t[12] = (f) => e.$emit("saveForm"))
|
|
866
|
+
}, null, 8, ["aria-label", "disabled", "loading"])), [
|
|
867
|
+
[h, e.$t("pdf.saveForm")]
|
|
868
|
+
]) : m("", !0),
|
|
869
|
+
g(c(d, {
|
|
870
|
+
"aria-label": e.$t("pdf.cancelForm"),
|
|
871
|
+
icon: "ri-close-line",
|
|
872
|
+
class: "text-xl p-1",
|
|
873
|
+
disabled: !i.isFormDirty,
|
|
874
|
+
onClick: t[13] || (t[13] = (f) => n.cancelForm())
|
|
875
|
+
}, null, 8, ["aria-label", "disabled"]), [
|
|
876
|
+
[h, e.$t("pdf.cancelForm")]
|
|
877
|
+
]),
|
|
878
|
+
g(c(d, {
|
|
879
|
+
"aria-label": e.$t("pdf.formFieldsInfo"),
|
|
880
|
+
icon: "ri-information-line",
|
|
881
|
+
class: "text-xl p-1",
|
|
882
|
+
onClick: t[14] || (t[14] = (f) => n.showFormFieldsInfo())
|
|
883
|
+
}, null, 8, ["aria-label"]), [
|
|
884
|
+
[h, e.$t("pdf.formFieldsInfo")]
|
|
885
|
+
])
|
|
886
|
+
])
|
|
887
|
+
])
|
|
888
|
+
], 64)) : m("", !0)
|
|
889
|
+
], 2),
|
|
890
|
+
s("div", ot, [
|
|
891
|
+
n.isPdfConsultationPage ? (l(), u("div", nt, [
|
|
892
|
+
s("h3", at, p(n.getFileName), 1),
|
|
893
|
+
e.$route.params.versionId ? (l(), k(X, {
|
|
894
|
+
key: 0,
|
|
895
|
+
class: "pdf-version-tag",
|
|
896
|
+
value: n.getVersionNumber
|
|
897
|
+
}, null, 8, ["value"])) : m("", !0)
|
|
898
|
+
])) : m("", !0)
|
|
899
|
+
]),
|
|
900
|
+
i.isSinglePageDisplayed ? (l(), u("div", st, [
|
|
901
|
+
c(T, {
|
|
902
|
+
class: "pdf-canvas",
|
|
903
|
+
pdf: i.pdf,
|
|
904
|
+
page: i.page,
|
|
905
|
+
rotation: i.rotation,
|
|
906
|
+
scale: i.scale,
|
|
907
|
+
"text-layer": o.textLayer,
|
|
908
|
+
"annotation-layer": o.annotationLayer,
|
|
909
|
+
"hide-forms": o.hideForms,
|
|
910
|
+
onAnnotation: n.onAnnotation
|
|
911
|
+
}, null, 8, ["pdf", "page", "rotation", "scale", "text-layer", "annotation-layer", "hide-forms", "onAnnotation"])
|
|
912
|
+
])) : (l(), u("div", rt, [
|
|
913
|
+
(l(!0), u(b, null, Z(i.pages, (f) => (l(), u("div", {
|
|
914
|
+
key: f,
|
|
915
|
+
class: "pdf-page-item"
|
|
916
|
+
}, [
|
|
917
|
+
c(T, {
|
|
918
|
+
pdf: i.pdf,
|
|
919
|
+
page: f,
|
|
920
|
+
rotation: i.rotation,
|
|
921
|
+
scale: i.scale,
|
|
922
|
+
"text-layer": o.textLayer,
|
|
923
|
+
"annotation-layer": o.annotationLayer,
|
|
924
|
+
"hide-forms": o.hideForms,
|
|
925
|
+
onAnnotation: n.onAnnotation
|
|
926
|
+
}, null, 8, ["pdf", "page", "rotation", "scale", "text-layer", "annotation-layer", "hide-forms", "onAnnotation"]),
|
|
927
|
+
s("span", lt, p(e.$t("pdf.currentPagination", { page: f, pages: i.pages })), 1)
|
|
928
|
+
]))), 128))
|
|
929
|
+
]))
|
|
930
|
+
])) : (l(), k(r, {
|
|
931
|
+
key: 0,
|
|
932
|
+
class: "loadingRendition",
|
|
933
|
+
"aria-label": "Loading"
|
|
934
|
+
})),
|
|
935
|
+
c(L, {
|
|
936
|
+
visible: i.showFormFieldsDialog,
|
|
937
|
+
"onUpdate:visible": t[15] || (t[15] = (f) => i.showFormFieldsDialog = f),
|
|
938
|
+
header: e.$t("pdf.formFieldsInfoTitle"),
|
|
939
|
+
modal: "",
|
|
940
|
+
class: "w-8"
|
|
941
|
+
}, {
|
|
942
|
+
default: N(() => [
|
|
943
|
+
c(Q, {
|
|
944
|
+
value: i.formFieldsData,
|
|
945
|
+
"striped-rows": ""
|
|
946
|
+
}, {
|
|
947
|
+
default: N(() => [
|
|
948
|
+
c(S, {
|
|
949
|
+
field: "name",
|
|
950
|
+
header: e.$t("pdf.formFieldName"),
|
|
951
|
+
sortable: ""
|
|
952
|
+
}, null, 8, ["header"]),
|
|
953
|
+
c(S, {
|
|
954
|
+
field: "type",
|
|
955
|
+
header: e.$t("pdf.formFieldType"),
|
|
956
|
+
sortable: ""
|
|
957
|
+
}, null, 8, ["header"]),
|
|
958
|
+
c(S, {
|
|
959
|
+
field: "value",
|
|
960
|
+
header: e.$t("pdf.formFieldValue"),
|
|
961
|
+
sortable: ""
|
|
962
|
+
}, null, 8, ["header"])
|
|
963
|
+
]),
|
|
964
|
+
_: 1
|
|
965
|
+
}, 8, ["value"])
|
|
966
|
+
]),
|
|
967
|
+
_: 1
|
|
968
|
+
}, 8, ["visible", "header"]),
|
|
969
|
+
c(L, {
|
|
970
|
+
visible: i.showSignaturesDialog,
|
|
971
|
+
"onUpdate:visible": t[16] || (t[16] = (f) => i.showSignaturesDialog = f),
|
|
972
|
+
header: e.$t("pdf.signaturePanelTitle"),
|
|
973
|
+
modal: "",
|
|
974
|
+
style: { width: "95vw", maxWidth: "40rem" }
|
|
975
|
+
}, {
|
|
976
|
+
default: N(() => [
|
|
977
|
+
c(Y, { signatures: i.signatures }, null, 8, ["signatures"])
|
|
978
|
+
]),
|
|
979
|
+
_: 1
|
|
980
|
+
}, 8, ["visible", "header"])
|
|
981
|
+
], 2);
|
|
982
|
+
}
|
|
983
|
+
const It = /* @__PURE__ */ G($e, [["render", dt], ["__scopeId", "data-v-a4d88fc2"]]);
|
|
984
|
+
export {
|
|
985
|
+
It as default
|
|
986
|
+
};
|
|
987
|
+
//# sourceMappingURL=PDFComponent-BXyQNUhl.js.map
|