@file-viewer/vue3 2.2.7 → 2.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +2 -2
- package/README.md +2 -2
- package/dist/components/fit.js +1 -498
- package/dist/components/image.js +1 -174
- package/dist/components/messages.js +1 -1430
- package/dist/components/print-mask.js +1 -213
- package/dist/components/printMask.js +1 -66
- package/dist/index.mjs +1 -5728
- package/package.json +2 -2
package/README.en.md
CHANGED
|
@@ -244,7 +244,7 @@ The table below lists the real props, event channel, and customization entry for
|
|
|
244
244
|
| `archive` | Archive Worker/WASM URLs, timeout, cache, archive limits, nested entry preview limits, and legacy GBK/GB18030 ZIP filename decoding. |
|
|
245
245
|
| `pdf` | PDF.js worker, navigation pane, outline, thumbnails, rotation, streaming, range chunk size, and credentials. |
|
|
246
246
|
| `docx` / `spreadsheet` | DOCX is provided by @file-viewer/renderer-word and uses the self-maintained @file-viewer/docx engine with automatic worker/main-thread selection, continuous flow reading, and async rendering by default; visual pagination is opt-in. Spreadsheet is provided by @file-viewer/renderer-spreadsheet with fidelity-first parsing, automatic Worker use for large files, and opt-in header drag column resizing. |
|
|
247
|
-
| `presentation` | The presentation renderer keeps two isolated engines: binary PowerPoint 97–2003 `.ppt` uses the packaged `@file-viewer/ppt@0.3.
|
|
247
|
+
| `presentation` | The presentation renderer keeps two isolated engines: binary PowerPoint 97–2003 `.ppt` uses the packaged `@file-viewer/ppt@0.3.3` Worker/OffscreenCanvas/WASM runtime with zero-config standard asset routes; `pptModuleUrl` / `pptWorkerUrl` / `pptWasmUrl` / `pptFontUrl` are custom-path overrides, while `pptWorker` and `pptCache` control its Worker and bounded frame cache. PPTX/OpenXML uses the `@file-viewer/pptx` Worker with optional `workerUrl` / `workerType` overrides. |
|
|
248
248
|
| `typst` / `data` / `cad` | Typst, SQLite, CAD/DWG/DXF/DWF WASM, worker, encoding, and rendering strategy options. |
|
|
249
249
|
| `hooks` / `beforeOperation` | Shared lifecycle hooks and operation preflight checks for audit, permission, telemetry, and safety controls. |
|
|
250
250
|
|
|
@@ -355,7 +355,7 @@ View-state sync is designed for projection systems, remote-control displays, sid
|
|
|
355
355
|
| --- | --- |
|
|
356
356
|
| Shared viewer assets | Every `*-full` package exposes a `file-viewer-copy-assets` CLI at the package version. It copies workers, WASM, fonts, and vendor files into the application static directory and writes an integrity manifest. The complete `web-full` `dist/` also carries that payload directly. |
|
|
357
357
|
| CAD / DWG / DXF / DWF | Configure `options.cad.wasmPath`, `workerUrl`, `dwfWasmUrl`, and `dxfEncoding` for self-hosted or intranet deployment. |
|
|
358
|
-
| PDF / DOCX / Excel / PPT / PPTX | Configure `options.pdf.workerUrl`, `options.pdf.cMapUrl`, `options.pdf.wasmUrl`, `options.pdf.standardFontDataUrl`, `options.pdf.cjkFontFallbackPath`, `options.pdf.identityFontRepair`, `options.docx.workerUrl`, `options.docx.workerJsZipUrl`, `options.spreadsheet.workerUrl`, and `options.presentation.workerUrl` / `workerType`; PDF probes the real static worker first and lazy-loads the packaged handler when unavailable, unembedded CJK fonts fall back to self-hosted Noto Sans SC shards loaded per page, and malformed Identity CJK fonts without ToUnicode are repaired in memory after corrupted text is detected; DOCX chooses worker or main-thread parsing automatically, Electron `file://` and other unsafe local protocols fall back without user configuration; Excel defaults to `worker: auto`, enabling Worker automatically for files at or above `workerAutoThreshold`; CSV / TSV detects UTF-8, GBK, and GB18030 automatically and accepts `options.spreadsheet.textEncoding` as an explicit override; header drag column resizing is controlled by `options.spreadsheet.resizableColumns`; `.ppt` lazy-loads the packaged `@file-viewer/ppt@0.3.
|
|
358
|
+
| PDF / DOCX / Excel / PPT / PPTX | Configure `options.pdf.workerUrl`, `options.pdf.cMapUrl`, `options.pdf.wasmUrl`, `options.pdf.standardFontDataUrl`, `options.pdf.cjkFontFallbackPath`, `options.pdf.identityFontRepair`, `options.docx.workerUrl`, `options.docx.workerJsZipUrl`, `options.spreadsheet.workerUrl`, and `options.presentation.workerUrl` / `workerType`; PDF probes the real static worker first and lazy-loads the packaged handler when unavailable, unembedded CJK fonts fall back to self-hosted Noto Sans SC shards loaded per page, and malformed Identity CJK fonts without ToUnicode are repaired in memory after corrupted text is detected; DOCX chooses worker or main-thread parsing automatically, Electron `file://` and other unsafe local protocols fall back without user configuration; Excel defaults to `worker: auto`, enabling Worker automatically for files at or above `workerAutoThreshold`; CSV / TSV detects UTF-8, GBK, and GB18030 automatically and accepts `options.spreadsheet.textEncoding` as an explicit override; header drag column resizing is controlled by `options.spreadsheet.resizableColumns`; `.ppt` lazy-loads the packaged `@file-viewer/ppt@0.3.3` Worker/OffscreenCanvas/WASM runtime with bounded frame caching from `vendor/ppt/` without standard-layout configuration; `pptModuleUrl` / `pptWorkerUrl` / `pptWasmUrl` / `pptFontUrl` only override custom routes. PPTX creates its separate module Worker on demand. |
|
|
359
359
|
| Typst / SQLite / Archive | Configure Typst compiler/renderer WASM, `data.sqlWasmUrl`, and `archive.workerUrl` / `archive.wasmUrl` as needed; Typst renders through local WASM only and never falls back to a public CDN; Archive decodes legacy GBK/GB18030 ZIP entry names, while RAR, 7z, and encrypted archives still require the libarchive Worker/WASM assets. |
|
|
360
360
|
| Drawing | Draw.io uses the official diagrams.net offline viewer shipped with viewer assets by default; override `options.drawing.viewerScriptUrl` for custom paths, or set `preferOfficial:false` for the built-in SVG fallback. |
|
|
361
361
|
| Offline deployment | Runtime preview code does not depend on public CDN or third-party online assets. Every `*-full` package uses `file-viewer/` under the deployment base (`/file-viewer/` at the origin root). Vite publishes assets with `copyAssets:true`; other build tools run `npx --no-install file-viewer-copy-assets ./public/file-viewer`. Call `setDefaultFullAssetBaseUrl()` when assets live elsewhere. |
|
package/README.md
CHANGED
|
@@ -247,7 +247,7 @@ const options = {
|
|
|
247
247
|
| `archive` | 配置压缩包 Worker/WASM、超时、缓存、包体限制和压缩包内单文件预览大小;旧 ZIP 中文文件名会自动按 GBK/GB18030 兼容解码。 |
|
|
248
248
|
| `pdf` | 配置 PDF.js Worker、导航栏、目录、缩略图、旋转、流式读取、Range chunk 和凭据。 |
|
|
249
249
|
| `docx` / `spreadsheet` | DOCX 由 @file-viewer/renderer-word 承接并使用自研 @file-viewer/docx,默认自动选择 Worker 或主线程解析,连续流式阅读和异步分批渲染,可按需显式开启视觉分页;表格由 @file-viewer/renderer-spreadsheet 承接,默认保真解析,大文件自动启用 Worker,表头拖拽调列宽可按需显式开启。 |
|
|
250
|
-
| `presentation` | 演示文稿 renderer 保持两条隔离引擎:PowerPoint 97–2003 `.ppt` 使用包内 `@file-viewer/ppt@0.3.
|
|
250
|
+
| `presentation` | 演示文稿 renderer 保持两条隔离引擎:PowerPoint 97–2003 `.ppt` 使用包内 `@file-viewer/ppt@0.3.3` Worker/OffscreenCanvas/WASM,标准资产布局无需配置 URL;`pptModuleUrl` / `pptWorkerUrl` / `pptWasmUrl` / `pptFontUrl` 仅用于自定义路径;`pptWorker` 与 `pptCache` 控制 Worker 和有界帧缓存。PPTX/OpenXML 使用 `@file-viewer/pptx` Worker,并可通过 `workerUrl` / `workerType` 覆盖。 |
|
|
251
251
|
| `typst` / `data` / `cad` | 配置 Typst、SQLite、CAD/DWG/DXF/DWF 等 WASM、Worker、编码和渲染策略。 |
|
|
252
252
|
| `hooks` / `beforeOperation` | 统一生命周期 hooks 和操作前置校验,可用于审计、权限、埋点和安全控制。 |
|
|
253
253
|
|
|
@@ -358,7 +358,7 @@ const options = {
|
|
|
358
358
|
| --- | --- |
|
|
359
359
|
| 通用 viewer assets | 所有 `*-full` 包都提供与自身同版本的 `file-viewer-copy-assets` CLI,用于把 Worker、WASM、字体和 vendor 资源复制到业务静态目录并生成完整性清单;`web-full` 的完整 `dist/` 还会直接携带这些资源。 |
|
|
360
360
|
| CAD / DWG / DXF / DWF | 按需配置 `options.cad.wasmPath`、`workerUrl`、`dwfWasmUrl`、`dxfEncoding`,支持自托管和内网部署。 |
|
|
361
|
-
| PDF / DOCX / Excel / PPT / PPTX | 按需配置 `options.pdf.workerUrl`、`options.pdf.cMapUrl`、`options.pdf.wasmUrl`、`options.pdf.standardFontDataUrl`、`options.pdf.cjkFontFallbackPath`、`options.pdf.identityFontRepair`、`options.docx.workerUrl`、`options.docx.workerJsZipUrl`、`options.spreadsheet.workerUrl`、`options.presentation.workerUrl` / `workerType`;PDF 默认探测真实静态 Worker,不可用时懒加载包内 handler 兜底,未嵌入的中文字体默认按页加载本地 Noto Sans SC 分片回退,缺失 ToUnicode 的异常 Identity CJK 字体会在检测到乱码后尝试内存修复;DOCX 默认自动选择 Worker 或主线程解析,Electron `file://` 等本地不安全协议会自动回退;Excel 默认 `worker: auto`,大文件达到 `workerAutoThreshold` 自动启用 Worker,CSV / TSV 自动识别 UTF-8、GBK 与 GB18030,也可用 `options.spreadsheet.textEncoding` 显式覆盖,列宽拖拽可通过 `options.spreadsheet.resizableColumns` 显式开启;`.ppt` 从 `vendor/ppt/` 按需加载 `@file-viewer/ppt@0.3.
|
|
361
|
+
| PDF / DOCX / Excel / PPT / PPTX | 按需配置 `options.pdf.workerUrl`、`options.pdf.cMapUrl`、`options.pdf.wasmUrl`、`options.pdf.standardFontDataUrl`、`options.pdf.cjkFontFallbackPath`、`options.pdf.identityFontRepair`、`options.docx.workerUrl`、`options.docx.workerJsZipUrl`、`options.spreadsheet.workerUrl`、`options.presentation.workerUrl` / `workerType`;PDF 默认探测真实静态 Worker,不可用时懒加载包内 handler 兜底,未嵌入的中文字体默认按页加载本地 Noto Sans SC 分片回退,缺失 ToUnicode 的异常 Identity CJK 字体会在检测到乱码后尝试内存修复;DOCX 默认自动选择 Worker 或主线程解析,Electron `file://` 等本地不安全协议会自动回退;Excel 默认 `worker: auto`,大文件达到 `workerAutoThreshold` 自动启用 Worker,CSV / TSV 自动识别 UTF-8、GBK 与 GB18030,也可用 `options.spreadsheet.textEncoding` 显式覆盖,列宽拖拽可通过 `options.spreadsheet.resizableColumns` 显式开启;`.ppt` 从 `vendor/ppt/` 按需加载 `@file-viewer/ppt@0.3.3` Worker/OffscreenCanvas/WASM 和有界帧缓存,标准布局无需配置,`pptModuleUrl` / `pptWorkerUrl` / `pptWasmUrl` / `pptFontUrl` 仅覆盖自定义路径;PPTX 按需创建另一条模块 Worker,两条引擎严格隔离。 |
|
|
362
362
|
| Typst / SQLite / Archive | 按需配置 Typst compiler/renderer WASM、`data.sqlWasmUrl`、`archive.workerUrl` / `archive.wasmUrl`;Typst 仅使用本地 WASM 真实渲染,不访问公共 CDN;Archive 兼容 GBK/GB18030 旧 ZIP 中文文件名,RAR、7z 和加密压缩包仍需要 libarchive Worker/WASM。 |
|
|
363
363
|
| Drawing | Draw.io 默认使用随 viewer assets 分发的官方 diagrams.net 离线 viewer;路径特殊时可通过 `options.drawing.viewerScriptUrl` 覆盖,`preferOfficial:false` 才切到内置 SVG 兜底。 |
|
|
364
364
|
| 离线部署 | 运行时不依赖公共 CDN 或第三方在线资源;所有 `*-full` 包默认使用部署基址下的 `file-viewer/`(根部署即 `/file-viewer/`)。Vite 使用 `copyAssets:true` 自动发布,其他构建工具运行 `npx --no-install file-viewer-copy-assets ./public/file-viewer`;资源放在其它位置时调用 `setDefaultFullAssetBaseUrl()`。 |
|
package/dist/components/fit.js
CHANGED
|
@@ -1,498 +1 @@
|
|
|
1
|
-
import { a as e, i as t } from "./messages.js";
|
|
2
|
-
var n = (e = {}) => {
|
|
3
|
-
var t, n, r;
|
|
4
|
-
let i = Number.isFinite(e.scale) && e.scale ? Number(e.scale) : 1;
|
|
5
|
-
return {
|
|
6
|
-
scale: i,
|
|
7
|
-
label: e.label || `${Math.round(i * 100)}%`,
|
|
8
|
-
canZoomIn: (t = e.canZoomIn) == null ? !1 : t,
|
|
9
|
-
canZoomOut: (n = e.canZoomOut) == null ? !1 : n,
|
|
10
|
-
canReset: (r = e.canReset) == null ? !1 : r,
|
|
11
|
-
minScale: e.minScale,
|
|
12
|
-
maxScale: e.maxScale
|
|
13
|
-
};
|
|
14
|
-
}, r = (e) => e === !1 ? { enabled: !1 } : e === !0 || e === void 0 ? {} : e, i = (e = "") => ({
|
|
15
|
-
query: e,
|
|
16
|
-
total: 0,
|
|
17
|
-
currentIndex: -1,
|
|
18
|
-
current: null,
|
|
19
|
-
matches: []
|
|
20
|
-
}), a = (e) => e === !1 ? {
|
|
21
|
-
enabled: !1,
|
|
22
|
-
collectText: !1
|
|
23
|
-
} : e === !0 || e === void 0 ? {} : e, o = (e, t) => {
|
|
24
|
-
var n;
|
|
25
|
-
let r = a(t);
|
|
26
|
-
if (r.enabled === !1 || r.collectText === !1) return [];
|
|
27
|
-
let i = Math.max(200, r.chunkSize || 1200), o = Math.max(0, Math.min(i - 1, (n = r.chunkOverlap) == null ? 160 : n)), s = Math.max(0, r.maxTextLength || 0), c = [];
|
|
28
|
-
return e.forEach((e) => {
|
|
29
|
-
let t = s ? e.text.slice(0, s) : e.text;
|
|
30
|
-
if (!t) return;
|
|
31
|
-
if (t.length <= i) {
|
|
32
|
-
c.push({
|
|
33
|
-
id: `${e.id}-chunk-1`,
|
|
34
|
-
text: t,
|
|
35
|
-
anchor: e,
|
|
36
|
-
startLine: e.line,
|
|
37
|
-
endLine: e.line
|
|
38
|
-
});
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
let n = 0, r = 1;
|
|
42
|
-
for (; n < t.length;) {
|
|
43
|
-
let a = t.slice(n, n + i);
|
|
44
|
-
if (c.push({
|
|
45
|
-
id: `${e.id}-chunk-${r}`,
|
|
46
|
-
text: a,
|
|
47
|
-
anchor: e,
|
|
48
|
-
startLine: e.line,
|
|
49
|
-
endLine: e.line
|
|
50
|
-
}), n + i >= t.length) break;
|
|
51
|
-
n += i - o, r += 1;
|
|
52
|
-
}
|
|
53
|
-
}), c;
|
|
54
|
-
}, s = (/* @__PURE__ */ "[data-viewer-anchor-id],.pdfViewer .page,.docx-wrapper section,.docx p,.docx li,.docx table,.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6,.markdown-body p,.markdown-body li,.markdown-body pre,.markdown-body table,article h1,article h2,article h3,article h4,article h5,article h6,article p,article li,article pre,article table,pre code,p,li,tr,h1,h2,h3,h4,h5,h6,pre,table".split(",")).join(","), c = [
|
|
55
|
-
".viewer-actions",
|
|
56
|
-
".viewer-watermark",
|
|
57
|
-
".state-panel",
|
|
58
|
-
".pdf-toolbar",
|
|
59
|
-
".pdf-nav-pane",
|
|
60
|
-
".flyfish-search-match"
|
|
61
|
-
].join(","), l = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\]/g, "\\$&"), u = (e, t = 160) => {
|
|
62
|
-
let n = e.replace(/\s+/g, " ").trim();
|
|
63
|
-
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
64
|
-
}, d = (e) => {
|
|
65
|
-
let t = e.getBoundingClientRect();
|
|
66
|
-
return t.width > 0 || t.height > 0;
|
|
67
|
-
}, f = (e) => !!e.closest(c), p = (e) => {
|
|
68
|
-
let t = e.closest("[data-page-number], [data-page]"), n = (t == null ? void 0 : t.dataset.pageNumber) || (t == null ? void 0 : t.dataset.page), r = n ? Number.parseInt(n, 10) : NaN;
|
|
69
|
-
return Number.isFinite(r) ? r : void 0;
|
|
70
|
-
}, m = (e) => e.matches(".pdfViewer .page, [data-page-number], [data-page]") ? "page" : e.matches("p, li, tr, pre, code") ? "line" : "block", h = (e, t) => {
|
|
71
|
-
let n = e.parentElement;
|
|
72
|
-
for (; n;) {
|
|
73
|
-
if (t.has(n)) return !0;
|
|
74
|
-
n = n.parentElement;
|
|
75
|
-
}
|
|
76
|
-
return !1;
|
|
77
|
-
}, g = (e) => {
|
|
78
|
-
if (!e) return [];
|
|
79
|
-
let t = e.getBoundingClientRect(), n = /* @__PURE__ */ new Set(), r = [];
|
|
80
|
-
return Array.from(e.querySelectorAll(s)).forEach((i) => {
|
|
81
|
-
if (f(i) || !d(i)) return;
|
|
82
|
-
let a = u(i.textContent || "", 1e3);
|
|
83
|
-
if (!a || h(i, n) && !i.matches("p, li, tr, pre, code")) return;
|
|
84
|
-
n.add(i);
|
|
85
|
-
let o = i.dataset.viewerAnchorId || `viewer-anchor-${r.length + 1}`;
|
|
86
|
-
i.dataset.viewerAnchorId = o, i.dataset.viewerLine = String(r.length + 1);
|
|
87
|
-
let s = i.getBoundingClientRect();
|
|
88
|
-
r.push({
|
|
89
|
-
id: o,
|
|
90
|
-
index: r.length,
|
|
91
|
-
line: r.length + 1,
|
|
92
|
-
type: m(i),
|
|
93
|
-
label: u(a, 96),
|
|
94
|
-
text: a,
|
|
95
|
-
page: p(i),
|
|
96
|
-
top: s.top - t.top + e.scrollTop,
|
|
97
|
-
left: s.left - t.left + e.scrollLeft,
|
|
98
|
-
width: s.width,
|
|
99
|
-
height: s.height
|
|
100
|
-
});
|
|
101
|
-
}), r;
|
|
102
|
-
}, _ = (e, t, n) => {
|
|
103
|
-
if (!e) return null;
|
|
104
|
-
let r = e.closest("[data-viewer-anchor-id]");
|
|
105
|
-
if (r != null && r.dataset.viewerAnchorId) {
|
|
106
|
-
let e = t.find((e) => e.id === r.dataset.viewerAnchorId);
|
|
107
|
-
if (e) return e;
|
|
108
|
-
}
|
|
109
|
-
if (!n) return null;
|
|
110
|
-
let i = n.getBoundingClientRect(), a = e.getBoundingClientRect().top - i.top + n.scrollTop, o = null;
|
|
111
|
-
for (let e of t) {
|
|
112
|
-
if (e.top <= a + 1) {
|
|
113
|
-
o = e;
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
return o;
|
|
119
|
-
}, v = (e, t) => {
|
|
120
|
-
if (!e || !t.length) return null;
|
|
121
|
-
let n = e.scrollTop + e.clientHeight * .42, r = t[0];
|
|
122
|
-
for (let e of t) {
|
|
123
|
-
if (e.top <= n) {
|
|
124
|
-
r = e;
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
return r;
|
|
130
|
-
}, ee = (e, t) => {
|
|
131
|
-
if (!e || t == null) return !1;
|
|
132
|
-
let n = typeof t == "object" ? `[data-viewer-anchor-id="${l(t.id)}"]` : typeof t == "number" ? `[data-viewer-line="${t}"]` : `[data-viewer-anchor-id="${l(t)}"]`, r = e.querySelector(n);
|
|
133
|
-
return r ? (r.scrollIntoView({
|
|
134
|
-
block: "center",
|
|
135
|
-
inline: "nearest"
|
|
136
|
-
}), !0) : typeof t == "object" ? (e.scrollTo({
|
|
137
|
-
top: Math.max(0, t.top - e.clientHeight * .18),
|
|
138
|
-
left: Math.max(0, Math.min(t.left, e.scrollWidth - e.clientWidth)),
|
|
139
|
-
behavior: "smooth"
|
|
140
|
-
}), !0) : !1;
|
|
141
|
-
}, y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), S = (e) => !!e && e.nodeType === 1, C = (e, t) => {
|
|
142
|
-
if (!(e != null && e.querySelectorAll)) return [];
|
|
143
|
-
let n = Array.from(e.querySelectorAll(t));
|
|
144
|
-
S(e) && e.shadowRoot && n.push(...C(e.shadowRoot, t));
|
|
145
|
-
let r = Array.from(e.querySelectorAll("*"));
|
|
146
|
-
for (let e of r) e.shadowRoot && n.push(...C(e.shadowRoot, t));
|
|
147
|
-
return n;
|
|
148
|
-
}, w = (e) => {
|
|
149
|
-
if (!e) return null;
|
|
150
|
-
let t = S(e) ? y.get(e) || e.__flyfishViewerSearchProvider : null;
|
|
151
|
-
if (t) return t;
|
|
152
|
-
let n = C(e, "[data-viewer-search-provider]")[0];
|
|
153
|
-
return n && (y.get(n) || n.__flyfishViewerSearchProvider) || null;
|
|
154
|
-
}, T = (e, t) => {
|
|
155
|
-
b.set(e, t), e.dataset.viewerZoomProvider = e.dataset.viewerZoomProvider || "custom", e.__flyfishViewerZoomProvider = t;
|
|
156
|
-
}, E = (e) => {
|
|
157
|
-
e && (b.delete(e), delete e.dataset.viewerZoomProvider, delete e.__flyfishViewerZoomProvider);
|
|
158
|
-
}, D = (e) => {
|
|
159
|
-
if (!e) return null;
|
|
160
|
-
let t = S(e) ? b.get(e) || e.__flyfishViewerZoomProvider : null;
|
|
161
|
-
if (t) return t;
|
|
162
|
-
let n = C(e, "[data-viewer-zoom-provider]")[0];
|
|
163
|
-
return n && (b.get(n) || n.__flyfishViewerZoomProvider) || null;
|
|
164
|
-
}, O = (e, t) => {
|
|
165
|
-
x.set(e, t), e.dataset.viewerViewStateProvider = e.dataset.viewerViewStateProvider || "custom", e.__flyfishViewerViewStateProvider = t;
|
|
166
|
-
}, k = (e) => {
|
|
167
|
-
e && (x.delete(e), delete e.dataset.viewerViewStateProvider, delete e.__flyfishViewerViewStateProvider);
|
|
168
|
-
}, A = (e) => {
|
|
169
|
-
if (!e) return null;
|
|
170
|
-
let t = S(e) ? x.get(e) || e.__flyfishViewerViewStateProvider : null;
|
|
171
|
-
if (t && (!S(e) || e.dataset.viewerViewStateProvider !== "generic")) return t;
|
|
172
|
-
let n = C(e, "[data-viewer-view-state-provider]"), r = n.find((e) => e.dataset.viewerViewStateProvider !== "generic"), i = n.find((e) => e.dataset.viewerViewStateProvider === "generic"), a = r || i;
|
|
173
|
-
return a ? x.get(a) || a.__flyfishViewerViewStateProvider || null : t || null;
|
|
174
|
-
}, j = [
|
|
175
|
-
"auto",
|
|
176
|
-
"scroll",
|
|
177
|
-
"overlay"
|
|
178
|
-
], M = (e) => Math.max(0, e.scrollHeight - e.clientHeight), N = (e, t = {}) => {
|
|
179
|
-
var n, r;
|
|
180
|
-
let i = (n = t.minScrollRange) == null ? 2 : n;
|
|
181
|
-
if (M(e) <= i) return !1;
|
|
182
|
-
let a = (r = e.ownerDocument) == null ? void 0 : r.defaultView, o = a != null && a.getComputedStyle ? a : typeof window < "u" ? window : void 0;
|
|
183
|
-
if (!(o != null && o.getComputedStyle)) return !1;
|
|
184
|
-
let s = o.getComputedStyle(e), c = s.overflowY || s.overflow;
|
|
185
|
-
return (t.overflowValues || j).includes(c);
|
|
186
|
-
}, P = (e, t = {}) => {
|
|
187
|
-
if (!e) return null;
|
|
188
|
-
let n = t.preferredSelector || "[data-viewer-scroll-container], .pdf-wrapper", r = t.candidateSelector || "div, section, article, pre", i = e.querySelector(n);
|
|
189
|
-
return i && N(i, t) ? i : N(e, t) ? e : Array.from(e.querySelectorAll(r)).filter((e) => N(e, t)).sort((e, t) => M(t) - M(e))[0] || i || e;
|
|
190
|
-
}, F = (e) => ({
|
|
191
|
-
scale: e.scale,
|
|
192
|
-
label: e.label,
|
|
193
|
-
canZoomIn: e.canZoomIn,
|
|
194
|
-
canZoomOut: e.canZoomOut,
|
|
195
|
-
canReset: e.canReset,
|
|
196
|
-
minScale: e.minScale,
|
|
197
|
-
maxScale: e.maxScale
|
|
198
|
-
}), I = (e, t) => {
|
|
199
|
-
let r = n(t || {});
|
|
200
|
-
return e.scale = r.scale, e.label = r.label, e.canZoomIn = r.canZoomIn, e.canZoomOut = r.canZoomOut, e.canReset = r.canReset, e.minScale = r.minScale, e.maxScale = r.maxScale, e;
|
|
201
|
-
}, te = (e) => F(e);
|
|
202
|
-
(function() {
|
|
203
|
-
var e = t(function* (e, t) {
|
|
204
|
-
return I(e, yield t()), te(e);
|
|
205
|
-
});
|
|
206
|
-
return function(t, n) {
|
|
207
|
-
return e.apply(this, arguments);
|
|
208
|
-
};
|
|
209
|
-
})();
|
|
210
|
-
var L = () => {
|
|
211
|
-
let e = /* @__PURE__ */ new Set();
|
|
212
|
-
return {
|
|
213
|
-
emit() {
|
|
214
|
-
e.forEach((e) => e());
|
|
215
|
-
},
|
|
216
|
-
subscribe(t) {
|
|
217
|
-
return e.add(t), () => {
|
|
218
|
-
e.delete(t);
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
}, R = (e) => {
|
|
223
|
-
var t, n;
|
|
224
|
-
return ((n = (t = e == null ? void 0 : e.ownerDocument) == null ? void 0 : t.defaultView) == null ? void 0 : n.MutationObserver) || (typeof MutationObserver < "u" ? MutationObserver : void 0);
|
|
225
|
-
}, z = ({ root: e, enabled: r, beforeZoom: i, onChange: a }) => {
|
|
226
|
-
let o = null, s = null, c = null, l = !1, u = n(), d = () => {
|
|
227
|
-
a == null || a(F(u));
|
|
228
|
-
}, f = () => {
|
|
229
|
-
s == null || s(), s = null, o = null, I(u, null);
|
|
230
|
-
}, p = () => {
|
|
231
|
-
var t, n;
|
|
232
|
-
if ((r == null ? void 0 : r()) === !1) return f(), null;
|
|
233
|
-
let i = D(e());
|
|
234
|
-
return i !== o && (s == null || s(), o = i, s = ((t = i == null ? void 0 : i.subscribe) == null ? void 0 : t.call(i, () => {
|
|
235
|
-
I(u, i.getState()), l || d();
|
|
236
|
-
})) || null), I(u, ((n = i == null ? void 0 : i.getState) == null ? void 0 : n.call(i)) || null), i;
|
|
237
|
-
}, m = () => {
|
|
238
|
-
c == null || c.disconnect(), c = null;
|
|
239
|
-
}, h = function() {
|
|
240
|
-
var e = t(function* (e, t) {
|
|
241
|
-
let n = p();
|
|
242
|
-
if (!n || i && (yield i(e)) === !1) return F(u);
|
|
243
|
-
l = !0;
|
|
244
|
-
try {
|
|
245
|
-
return I(u, (yield t(n)) || n.getState()), F(u);
|
|
246
|
-
} finally {
|
|
247
|
-
l = !1;
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
return function(t, n) {
|
|
251
|
-
return e.apply(this, arguments);
|
|
252
|
-
};
|
|
253
|
-
}();
|
|
254
|
-
return {
|
|
255
|
-
get provider() {
|
|
256
|
-
return o;
|
|
257
|
-
},
|
|
258
|
-
state: u,
|
|
259
|
-
hasProvider() {
|
|
260
|
-
return !!p();
|
|
261
|
-
},
|
|
262
|
-
refreshProvider: p,
|
|
263
|
-
observe() {
|
|
264
|
-
m();
|
|
265
|
-
let t = e(), n = R(t);
|
|
266
|
-
if (!t || !n) {
|
|
267
|
-
p();
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
c = new n(() => {
|
|
271
|
-
p();
|
|
272
|
-
}), c.observe(t, {
|
|
273
|
-
childList: !0,
|
|
274
|
-
subtree: !0
|
|
275
|
-
}), p();
|
|
276
|
-
},
|
|
277
|
-
clearProvider: f,
|
|
278
|
-
getState() {
|
|
279
|
-
return F(u);
|
|
280
|
-
},
|
|
281
|
-
zoomIn: () => h("zoom-in", (e) => e.zoomIn()),
|
|
282
|
-
zoomOut: () => h("zoom-out", (e) => e.zoomOut()),
|
|
283
|
-
resetZoom: () => h("zoom-reset", (e) => e.resetZoom()),
|
|
284
|
-
destroy() {
|
|
285
|
-
m(), f();
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
}, B = [
|
|
289
|
-
"auto",
|
|
290
|
-
"contain",
|
|
291
|
-
"cover",
|
|
292
|
-
"width",
|
|
293
|
-
"height",
|
|
294
|
-
"actual",
|
|
295
|
-
"scale-down"
|
|
296
|
-
], V = [
|
|
297
|
-
"until-interaction",
|
|
298
|
-
"always",
|
|
299
|
-
"initial"
|
|
300
|
-
], H = "until-interaction", U = 0, W = 8, G = (e) => !!e && typeof e == "object" && !Array.isArray(e), K = (e) => typeof e == "string" && B.includes(e), q = (e) => typeof e == "string" && V.includes(e), J = (e) => {
|
|
301
|
-
let t = Number(e);
|
|
302
|
-
return Number.isFinite(t) && t > 0 ? t : void 0;
|
|
303
|
-
}, Y = (e) => {
|
|
304
|
-
let t = Number(e);
|
|
305
|
-
return Number.isFinite(t) && t > 0 ? t : U;
|
|
306
|
-
}, X = (e) => {
|
|
307
|
-
if (e == null || e === !1) return null;
|
|
308
|
-
if (K(e)) return {
|
|
309
|
-
mode: e,
|
|
310
|
-
resize: H,
|
|
311
|
-
padding: U
|
|
312
|
-
};
|
|
313
|
-
if (!G(e)) return null;
|
|
314
|
-
let t = J(e.minScale), n = J(e.maxScale), r = t !== void 0 && n !== void 0 && n < t ? t : n;
|
|
315
|
-
return {
|
|
316
|
-
mode: K(e.mode) ? e.mode : "auto",
|
|
317
|
-
resize: q(e.resize) ? e.resize : H,
|
|
318
|
-
padding: Y(e.padding),
|
|
319
|
-
minScale: t,
|
|
320
|
-
maxScale: r
|
|
321
|
-
};
|
|
322
|
-
}, Z = (e, t, n) => {
|
|
323
|
-
let r = e;
|
|
324
|
-
return Number.isFinite(t) && (r = Math.max(Number(t), r)), Number.isFinite(n) && (r = Math.min(Number(n), r)), r;
|
|
325
|
-
}, ne = ({ mode: e, viewportWidth: t, viewportHeight: n, contentWidth: r, contentHeight: i, minScale: a, maxScale: o }) => {
|
|
326
|
-
if (t <= 0 || n <= 0 || r <= 0 || i <= 0) return;
|
|
327
|
-
let s = t / r, c = n / i, l = Math.min(s, c), u = Math.max(s, c), d = (() => {
|
|
328
|
-
switch (e) {
|
|
329
|
-
case "cover": return u;
|
|
330
|
-
case "width": return s;
|
|
331
|
-
case "height": return c;
|
|
332
|
-
case "actual": return 1;
|
|
333
|
-
case "scale-down": return Math.min(1, l);
|
|
334
|
-
default: return l;
|
|
335
|
-
}
|
|
336
|
-
})();
|
|
337
|
-
if (!(!Number.isFinite(d) || d <= 0)) return Z(d, a, o);
|
|
338
|
-
}, re = (e) => {
|
|
339
|
-
var t, n;
|
|
340
|
-
if (!e) return !1;
|
|
341
|
-
let r = Number((t = e.scale) == null ? (n = e.zoom) == null ? void 0 : n.scale : t);
|
|
342
|
-
if (Number.isFinite(r) && r > 0 || Number.isFinite(e.page) || Number.isFinite(e.rotation) || e.navigation && Object.keys(e.navigation).length > 0 || e.extra && Object.keys(e.extra).length > 0) return !0;
|
|
343
|
-
let i = e.scroll || {};
|
|
344
|
-
return [
|
|
345
|
-
"top",
|
|
346
|
-
"left",
|
|
347
|
-
"topRatio",
|
|
348
|
-
"leftRatio"
|
|
349
|
-
].some((e) => {
|
|
350
|
-
let t = i[e];
|
|
351
|
-
return Number.isFinite(t);
|
|
352
|
-
});
|
|
353
|
-
}, Q = (e, t, n = "viewer", r = "none") => ({
|
|
354
|
-
applied: !1,
|
|
355
|
-
mode: e.mode,
|
|
356
|
-
resize: e.resize,
|
|
357
|
-
source: n,
|
|
358
|
-
reason: t,
|
|
359
|
-
provider: r
|
|
360
|
-
}), $ = (e, t, n) => ({
|
|
361
|
-
applied: !!(e != null && e.applied),
|
|
362
|
-
mode: (e == null ? void 0 : e.mode) || t.mode,
|
|
363
|
-
resize: (e == null ? void 0 : e.resize) || t.resize,
|
|
364
|
-
scale: e == null ? void 0 : e.scale,
|
|
365
|
-
source: (e == null ? void 0 : e.source) || t.source,
|
|
366
|
-
reason: e == null ? void 0 : e.reason,
|
|
367
|
-
provider: (e == null ? void 0 : e.provider) || n,
|
|
368
|
-
state: e == null ? void 0 : e.state
|
|
369
|
-
}), ie = (e) => e === "pending" || e === "retry" || e === "image-not-ready" || e === "unmeasurable", ae = (e) => {
|
|
370
|
-
var t;
|
|
371
|
-
let n = (t = e.getBoundingClientRect) == null ? void 0 : t.call(e);
|
|
372
|
-
return {
|
|
373
|
-
width: Math.max(0, (n == null ? void 0 : n.width) || e.clientWidth || 0),
|
|
374
|
-
height: Math.max(0, (n == null ? void 0 : n.height) || e.clientHeight || 0)
|
|
375
|
-
};
|
|
376
|
-
}, oe = ({ root: n, enabled: r, getFit: i = () => void 0, onFit: a }) => {
|
|
377
|
-
let o = null, s = null, c = null, l = !1, u = 0, d = () => {
|
|
378
|
-
var e;
|
|
379
|
-
let t = n();
|
|
380
|
-
return ((e = t == null ? void 0 : t.ownerDocument) == null ? void 0 : e.defaultView) || (typeof window < "u" ? window : void 0);
|
|
381
|
-
}, f = () => {
|
|
382
|
-
if (s === null) return;
|
|
383
|
-
let e = d();
|
|
384
|
-
e != null && e.cancelAnimationFrame && e.cancelAnimationFrame(s), s = null;
|
|
385
|
-
}, p = () => {
|
|
386
|
-
c && clearTimeout(c), c = null;
|
|
387
|
-
}, m = (e, t) => {
|
|
388
|
-
let n = e === void 0 ? i() : e;
|
|
389
|
-
return n == null ? t === "api" ? X("auto") : null : X(n);
|
|
390
|
-
}, h = (e, t, n) => {
|
|
391
|
-
u >= W || (p(), u += 1, c = setTimeout(() => {
|
|
392
|
-
c = null, g(e, {
|
|
393
|
-
source: t,
|
|
394
|
-
reason: n === "api" ? "api" : "retry"
|
|
395
|
-
});
|
|
396
|
-
}, 32 * u));
|
|
397
|
-
}, g = function() {
|
|
398
|
-
var i = t(function* (t, i = {}) {
|
|
399
|
-
let o = i.source || "api", s = i.reason || "api", c = m(t, s);
|
|
400
|
-
if (!c) return {
|
|
401
|
-
applied: !1,
|
|
402
|
-
mode: "auto",
|
|
403
|
-
resize: H,
|
|
404
|
-
source: o,
|
|
405
|
-
reason: "not-configured",
|
|
406
|
-
provider: "none"
|
|
407
|
-
};
|
|
408
|
-
if ((r == null ? void 0 : r()) === !1) return Q(c, "disabled", o);
|
|
409
|
-
let l = n();
|
|
410
|
-
if (!l) return h(t, o, s), Q(c, "no-root", o);
|
|
411
|
-
let d = ae(l);
|
|
412
|
-
if (d.width <= 0 || d.height <= 0) return h(t, o, s), Q(c, "zero-size", o);
|
|
413
|
-
let f = e(e({}, c), {}, {
|
|
414
|
-
source: o,
|
|
415
|
-
reason: s,
|
|
416
|
-
viewportWidth: Math.max(0, d.width - c.padding * 2),
|
|
417
|
-
viewportHeight: Math.max(0, d.height - c.padding * 2),
|
|
418
|
-
container: l
|
|
419
|
-
}), p = A(l), g = null;
|
|
420
|
-
if (p != null && p.fit) {
|
|
421
|
-
let e = $(yield p.fit(f), f, "view-state");
|
|
422
|
-
if (e.applied) return u = 0, a == null || a(e), e;
|
|
423
|
-
g = e;
|
|
424
|
-
}
|
|
425
|
-
let _ = D(l);
|
|
426
|
-
if (_ != null && _.fit) {
|
|
427
|
-
let e = $(yield _.fit(f), f, "zoom");
|
|
428
|
-
if (e.applied) return u = 0, a == null || a(e), e;
|
|
429
|
-
g = e;
|
|
430
|
-
}
|
|
431
|
-
let v = Q(c, p || _ ? "unsupported" : "no-provider", o);
|
|
432
|
-
return (v.reason === "no-provider" || ie(g == null ? void 0 : g.reason)) && h(t, o, s), v;
|
|
433
|
-
});
|
|
434
|
-
return function(e) {
|
|
435
|
-
return i.apply(this, arguments);
|
|
436
|
-
};
|
|
437
|
-
}(), _ = (e = "resize") => {
|
|
438
|
-
let t = X(i());
|
|
439
|
-
if (!t || t.resize === "initial" || t.resize === "until-interaction" && l) return;
|
|
440
|
-
f();
|
|
441
|
-
let n = d(), r = () => {
|
|
442
|
-
s = null, g(void 0, {
|
|
443
|
-
source: "viewer",
|
|
444
|
-
reason: e
|
|
445
|
-
});
|
|
446
|
-
};
|
|
447
|
-
if (n != null && n.requestAnimationFrame) {
|
|
448
|
-
s = n.requestAnimationFrame(r);
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
s = setTimeout(r, 16);
|
|
452
|
-
}, v = () => {
|
|
453
|
-
f(), o == null || o.disconnect(), o = null;
|
|
454
|
-
};
|
|
455
|
-
return {
|
|
456
|
-
normalize: X,
|
|
457
|
-
fit: function() {
|
|
458
|
-
var e = t(function* (e, t) {
|
|
459
|
-
return p(), l = !1, g(e, {
|
|
460
|
-
source: (t == null ? void 0 : t.source) || "api",
|
|
461
|
-
reason: (t == null ? void 0 : t.reason) || "api"
|
|
462
|
-
});
|
|
463
|
-
});
|
|
464
|
-
return function(t, n) {
|
|
465
|
-
return e.apply(this, arguments);
|
|
466
|
-
};
|
|
467
|
-
}(),
|
|
468
|
-
applyInitialFit: function() {
|
|
469
|
-
var e = t(function* (e = {}) {
|
|
470
|
-
return p(), u = 0, l = !1, e.skip ? Q(X(i()) || X("auto"), "initial-view-state", "initial") : g(void 0, {
|
|
471
|
-
source: "initial",
|
|
472
|
-
reason: "initial"
|
|
473
|
-
});
|
|
474
|
-
});
|
|
475
|
-
return function() {
|
|
476
|
-
return e.apply(this, arguments);
|
|
477
|
-
};
|
|
478
|
-
}(),
|
|
479
|
-
scheduleFit: _,
|
|
480
|
-
observe() {
|
|
481
|
-
var e, t;
|
|
482
|
-
v();
|
|
483
|
-
let r = n(), i = ((t = (e = r == null ? void 0 : r.ownerDocument) == null ? void 0 : e.defaultView) == null ? void 0 : t.ResizeObserver) || (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
|
|
484
|
-
!r || !i || (o = new i(() => _("resize")), o.observe(r));
|
|
485
|
-
},
|
|
486
|
-
markUserInteraction() {
|
|
487
|
-
l = !0, p();
|
|
488
|
-
},
|
|
489
|
-
resetAutoFit() {
|
|
490
|
-
l = !1, u = 0;
|
|
491
|
-
},
|
|
492
|
-
destroy() {
|
|
493
|
-
v(), p(), u = 0;
|
|
494
|
-
}
|
|
495
|
-
};
|
|
496
|
-
};
|
|
497
|
-
//#endregion
|
|
498
|
-
export { ee as _, z as a, r as b, A as c, T as d, k as f, v as g, _ as h, L as i, D as l, g as m, re as n, P as o, E as p, ne as r, w as s, oe as t, O as u, o as v, i as y };
|
|
1
|
+
const aF=a1;(function(a4,a5){const aB=a1,a6=a4();while(!![]){try{const a7=parseInt(aB(0x121))/0x1+-parseInt(aB(0xf9))/0x2*(-parseInt(aB(0xfc))/0x3)+parseInt(aB(0xff))/0x4+-parseInt(aB(0x10d))/0x5+-parseInt(aB(0x101))/0x6+-parseInt(aB(0xee))/0x7*(parseInt(aB(0x126))/0x8)+parseInt(aB(0x107))/0x9*(parseInt(aB(0x113))/0xa);if(a7===a5)break;else a6['push'](a6['shift']());}catch(a8){a6['push'](a6['shift']());}}}(a0,0x9bce7));import{a as a2,i as a3}from'./messages.js';var n=(a4={})=>{const aC=a1;var a5,a6,a7;let a8=Number['isFinite'](a4[aC(0xed)])&&a4['scale']?Number(a4['scale']):0x1;return{'scale':a8,'label':a4['label']||Math['round'](a8*0x64)+'%','canZoomIn':(a5=a4['canZoomIn'])==null?!0x1:a5,'canZoomOut':(a6=a4['canZoomOut'])==null?!0x1:a6,'canReset':(a7=a4['canReset'])==null?!0x1:a7,'minScale':a4['minScale'],'maxScale':a4['maxScale']};},r=a4=>a4===!0x1?{'enabled':!0x1}:a4===!0x0||a4===void 0x0?{}:a4,i=(a4='')=>({'query':a4,'total':0x0,'currentIndex':-0x1,'current':null,'matches':[]}),a=a4=>a4===!0x1?{'enabled':!0x1,'collectText':!0x1}:a4===!0x0||a4===void 0x0?{}:a4,o=(a4,a5)=>{const aD=a1;var a6;let a7=a(a5);if(a7[aD(0x111)]===!0x1||a7['collectText']===!0x1)return[];let a8=Math['max'](0xc8,a7['chunkSize']||0x4b0),a9=Math['max'](0x0,Math[aD(0xf0)](a8-0x1,(a6=a7['chunkOverlap'])==null?0xa0:a6)),aa=Math['max'](0x0,a7['maxTextLength']||0x0),ab=[];return a4[aD(0x10e)](ac=>{const aE=aD;let ad=aa?ac['text']['slice'](0x0,aa):ac['text'];if(!ad)return;if(ad['length']<=a8){ab['push']({'id':ac['id']+'-chunk-1','text':ad,'anchor':ac,'startLine':ac['line'],'endLine':ac['line']});return;}let af=0x0,ag=0x1;for(;af<ad['length'];){let ah=ad['slice'](af,af+a8);if(ab['push']({'id':ac['id']+'-chunk-'+ag,'text':ah,'anchor':ac,'startLine':ac[aE(0x102)],'endLine':ac['line']}),af+a8>=ad['length'])break;af+=a8-a9,ag+=0x1;}}),ab;},s='[data-viewer-anchor-id],.pdfViewer\x20.page,.docx-wrapper\x20section,.docx\x20p,.docx\x20li,.docx\x20table,.markdown-body\x20h1,.markdown-body\x20h2,.markdown-body\x20h3,.markdown-body\x20h4,.markdown-body\x20h5,.markdown-body\x20h6,.markdown-body\x20p,.markdown-body\x20li,.markdown-body\x20pre,.markdown-body\x20table,article\x20h1,article\x20h2,article\x20h3,article\x20h4,article\x20h5,article\x20h6,article\x20p,article\x20li,article\x20pre,article\x20table,pre\x20code,p,li,tr,h1,h2,h3,h4,h5,h6,pre,table'['split'](',')['join'](','),c=['.viewer-actions','.viewer-watermark','.state-panel',aF(0x110),'.pdf-nav-pane',aF(0x11d)][aF(0xfb)](','),l=a4=>typeof CSS<'u'&&typeof CSS['escape']=='function'?CSS['escape'](a4):a4['replace'](/["\\]/g,'\x5c$&'),u=(a4,a5=0xa0)=>{const aG=aF;let a6=a4[aG(0xec)](/\s+/g,'\x20')['trim']();return a6['length']>a5?a6['slice'](0x0,a5-0x1)+'…':a6;},d=a4=>{const aH=aF;let a5=a4[aH(0x109)]();return a5['width']>0x0||a5['height']>0x0;},f=a4=>!!a4['closest'](c),p=a4=>{const aI=aF;let a5=a4['closest']('[data-page-number],\x20[data-page]'),a6=(a5==null?void 0x0:a5['dataset']['pageNumber'])||(a5==null?void 0x0:a5[aI(0xfa)]['page']),a7=a6?Number[aI(0x10c)](a6,0xa):NaN;return Number[aI(0x123)](a7)?a7:void 0x0;},m=a4=>a4[aF(0xf7)]('.pdfViewer\x20.page,\x20[data-page-number],\x20[data-page]')?aF(0x108):a4[aF(0xf7)]('p,\x20li,\x20tr,\x20pre,\x20code')?'line':'block',h=(a4,a5)=>{let a6=a4['parentElement'];for(;a6;){if(a5['has'](a6))return!0x0;a6=a6['parentElement'];}return!0x1;},g=a4=>{if(!a4)return[];let a5=a4['getBoundingClientRect'](),a6=new Set(),a7=[];return Array['from'](a4['querySelectorAll'](s))['forEach'](a8=>{const aJ=a1;if(f(a8)||!d(a8))return;let a9=u(a8['textContent']||'',0x3e8);if(!a9||h(a8,a6)&&!a8['matches']('p,\x20li,\x20tr,\x20pre,\x20code'))return;a6['add'](a8);let aa=a8['dataset'][aJ(0x10a)]||'viewer-anchor-'+(a7['length']+0x1);a8['dataset']['viewerAnchorId']=aa,a8['dataset']['viewerLine']=String(a7['length']+0x1);let ab=a8[aJ(0x109)]();a7['push']({'id':aa,'index':a7['length'],'line':a7['length']+0x1,'type':m(a8),'label':u(a9,0x60),'text':a9,'page':p(a8),'top':ab[aJ(0x112)]-a5['top']+a4[aJ(0xeb)],'left':ab['left']-a5['left']+a4['scrollLeft'],'width':ab['width'],'height':ab['height']});}),a7;},_=(a4,a5,a6)=>{const aK=aF;if(!a4)return null;let a7=a4[aK(0x127)](aK(0xf1));if(a7!=null&&a7['dataset'][aK(0x10a)]){let ab=a5['find'](ac=>ac['id']===a7[aK(0xfa)]['viewerAnchorId']);if(ab)return ab;}if(!a6)return null;let a8=a6['getBoundingClientRect'](),a9=a4['getBoundingClientRect']()['top']-a8[aK(0x112)]+a6[aK(0xeb)],aa=null;for(let ac of a5){if(ac['top']<=a9+0x1){aa=ac;continue;}break;}return aa;},v=(a4,a5)=>{if(!a4||!a5['length'])return null;let a6=a4['scrollTop']+a4['clientHeight']*0.42,a7=a5[0x0];for(let a8 of a5){if(a8['top']<=a6){a7=a8;continue;}break;}return a7;},ee=(a4,a5)=>{const aL=aF;if(!a4||a5==null)return!0x1;let a6=typeof a5=='object'?'[data-viewer-anchor-id=\x22'+l(a5['id'])+'\x22]':typeof a5=='number'?'[data-viewer-line=\x22'+a5+'\x22]':'[data-viewer-anchor-id=\x22'+l(a5)+'\x22]',a7=a4['querySelector'](a6);return a7?(a7['scrollIntoView']({'block':'center','inline':'nearest'}),!0x0):typeof a5=='object'?(a4['scrollTo']({'top':Math['max'](0x0,a5['top']-a4['clientHeight']*0.18),'left':Math[aL(0x128)](0x0,Math['min'](a5['left'],a4[aL(0xfd)]-a4[aL(0x125)])),'behavior':aL(0x124)}),!0x0):!0x1;},y=new WeakMap(),b=new WeakMap(),x=new WeakMap(),S=a4=>!!a4&&a4['nodeType']===0x1,C=(a4,a5)=>{const aM=aF;if(!(a4!=null&&a4['querySelectorAll']))return[];let a6=Array[aM(0x104)](a4['querySelectorAll'](a5));S(a4)&&a4['shadowRoot']&&a6['push'](...C(a4['shadowRoot'],a5));let a7=Array['from'](a4['querySelectorAll']('*'));for(let a8 of a7)a8[aM(0xf2)]&&a6['push'](...C(a8['shadowRoot'],a5));return a6;},w=a4=>{if(!a4)return null;let a5=S(a4)?y['get'](a4)||a4['__flyfishViewerSearchProvider']:null;if(a5)return a5;let a6=C(a4,'[data-viewer-search-provider]')[0x0];return a6&&(y['get'](a6)||a6['__flyfishViewerSearchProvider'])||null;},T=(a4,a5)=>{const aN=aF;b[aN(0xea)](a4,a5),a4[aN(0xfa)]['viewerZoomProvider']=a4['dataset']['viewerZoomProvider']||'custom',a4['__flyfishViewerZoomProvider']=a5;},E=a4=>{a4&&(b['delete'](a4),delete a4['dataset']['viewerZoomProvider'],delete a4['__flyfishViewerZoomProvider']);},D=a4=>{const aO=aF;if(!a4)return null;let a5=S(a4)?b[aO(0x106)](a4)||a4[aO(0x118)]:null;if(a5)return a5;let a6=C(a4,'[data-viewer-zoom-provider]')[0x0];return a6&&(b[aO(0x106)](a6)||a6['__flyfishViewerZoomProvider'])||null;},O=(a4,a5)=>{const aP=aF;x['set'](a4,a5),a4[aP(0xfa)]['viewerViewStateProvider']=a4['dataset']['viewerViewStateProvider']||aP(0xf6),a4['__flyfishViewerViewStateProvider']=a5;},k=a4=>{a4&&(x['delete'](a4),delete a4['dataset']['viewerViewStateProvider'],delete a4['__flyfishViewerViewStateProvider']);},A=a4=>{const aQ=aF;if(!a4)return null;let a5=S(a4)?x['get'](a4)||a4['__flyfishViewerViewStateProvider']:null;if(a5&&(!S(a4)||a4['dataset']['viewerViewStateProvider']!==aQ(0x119)))return a5;let a6=C(a4,'[data-viewer-view-state-provider]'),a7=a6['find'](aa=>aa[aQ(0xfa)]['viewerViewStateProvider']!=='generic'),a8=a6['find'](aa=>aa[aQ(0xfa)]['viewerViewStateProvider']==='generic'),a9=a7||a8;return a9?x['get'](a9)||a9['__flyfishViewerViewStateProvider']||null:a5||null;},j=['auto','scroll',aF(0x11b)],M=a4=>Math[aF(0x128)](0x0,a4['scrollHeight']-a4['clientHeight']),N=(a4,a5={})=>{const aR=aF;var a6,a7;let a8=(a6=a5[aR(0xf5)])==null?0x2:a6;if(M(a4)<=a8)return!0x1;let a9=(a7=a4['ownerDocument'])==null?void 0x0:a7['defaultView'],aa=a9!=null&&a9['getComputedStyle']?a9:typeof window<'u'?window:void 0x0;if(!(aa!=null&&aa['getComputedStyle']))return!0x1;let ab=aa['getComputedStyle'](a4),ac=ab['overflowY']||ab['overflow'];return(a5['overflowValues']||j)['includes'](ac);},P=(a4,a5={})=>{const aS=aF;if(!a4)return null;let a6=a5['preferredSelector']||'[data-viewer-scroll-container],\x20.pdf-wrapper',a7=a5['candidateSelector']||'div,\x20section,\x20article,\x20pre',a8=a4['querySelector'](a6);return a8&&N(a8,a5)?a8:N(a4,a5)?a4:Array['from'](a4[aS(0x10b)](a7))['filter'](a9=>N(a9,a5))[aS(0xf4)]((a9,aa)=>M(aa)-M(a9))[0x0]||a8||a4;},F=a4=>({'scale':a4['scale'],'label':a4['label'],'canZoomIn':a4[aF(0xf3)],'canZoomOut':a4[aF(0x11a)],'canReset':a4['canReset'],'minScale':a4['minScale'],'maxScale':a4['maxScale']}),I=(a4,a5)=>{const aT=aF;let a6=n(a5||{});return a4['scale']=a6['scale'],a4[aT(0xfe)]=a6['label'],a4['canZoomIn']=a6[aT(0xf3)],a4['canZoomOut']=a6['canZoomOut'],a4['canReset']=a6['canReset'],a4['minScale']=a6['minScale'],a4['maxScale']=a6['maxScale'],a4;},te=a4=>F(a4);function a0(){const b4=['topRatio','358EpiDuP','dataset','join','17961fGnenC','scrollWidth','label','3140060PfiZxy','no-root','1850208FfyDGi','line','reason','from','until-interaction','get','5683221sOwZbO','page','getBoundingClientRect','viewerAnchorId','querySelectorAll','parseInt','2584330QkbsTq','forEach','length','.pdf-toolbar','enabled','top','10BHGgaQ','ownerDocument','zoomOut','apply','defaultView','__flyfishViewerZoomProvider','generic','canZoomOut','overlay','applied','.flyfish-search-match','retry','keys','padding','204105lCQrPu','height','isFinite','smooth','clientWidth','40aVaWpP','closest','max','mode','api','scroll','pending','set','scrollTop','replace','scale','1720383pzSLDS','viewer','min','[data-viewer-anchor-id]','shadowRoot','canZoomIn','sort','minScrollRange','custom','matches'];a0=function(){return b4;};return a0();}(function(){var a4=a3(function*(a5,a6){return I(a5,yield a6()),te(a5);});return function(a5,a6){return a4['apply'](this,arguments);};}());function a1(a,b){a=a-0xe6;const c=a0();let d=c[a];return d;}var L=()=>{let a4=new Set();return{'emit'(){a4['forEach'](a5=>a5());},'subscribe'(a5){return a4['add'](a5),()=>{a4['delete'](a5);};}};},R=a4=>{const aU=aF;var a5,a6;return((a6=(a5=a4==null?void 0x0:a4['ownerDocument'])==null?void 0x0:a5[aU(0x117)])==null?void 0x0:a6['MutationObserver'])||(typeof MutationObserver<'u'?MutationObserver:void 0x0);},z=({root:a4,enabled:a5,beforeZoom:a6,onChange:a7})=>{const aV=aF;let a8=null,a9=null,aa=null,ab=!0x1,ac=n(),ad=()=>{a7==null||a7(F(ac));},af=()=>{a9==null||a9(),a9=null,a8=null,I(ac,null);},ag=()=>{var aj,ak;if((a5==null?void 0x0:a5())===!0x1)return af(),null;let al=D(a4());return al!==a8&&(a9==null||a9(),a8=al,a9=((aj=al==null?void 0x0:al['subscribe'])==null?void 0x0:aj['call'](al,()=>{I(ac,al['getState']()),ab||ad();}))||null),I(ac,((ak=al==null?void 0x0:al['getState'])==null?void 0x0:ak['call'](al))||null),al;},ah=()=>{aa==null||aa['disconnect'](),aa=null;},ai=(function(){var aj=a3(function*(ak,al){let am=ag();if(!am||a6&&(yield a6(ak))===!0x1)return F(ac);ab=!0x0;try{return I(ac,(yield al(am))||am['getState']()),F(ac);}finally{ab=!0x1;}});return function(ak,al){return aj['apply'](this,arguments);};}());return{get 'provider'(){return a8;},'state':ac,'hasProvider'(){return!!ag();},'refreshProvider':ag,'observe'(){ah();let aj=a4(),ak=R(aj);if(!aj||!ak){ag();return;}aa=new ak(()=>{ag();}),aa['observe'](aj,{'childList':!0x0,'subtree':!0x0}),ag();},'clearProvider':af,'getState'(){return F(ac);},'zoomIn':()=>ai('zoom-in',aj=>aj['zoomIn']()),'zoomOut':()=>ai('zoom-out',aj=>aj[aV(0x115)]()),'resetZoom':()=>ai('zoom-reset',aj=>aj['resetZoom']()),'destroy'(){ah(),af();}};},B=['auto','contain','cover','width','height','actual','scale-down'],V=['until-interaction','always','initial'],H=aF(0x105),U=0x0,W=0x8,G=a4=>!!a4&&typeof a4=='object'&&!Array['isArray'](a4),K=a4=>typeof a4=='string'&&B['includes'](a4),q=a4=>typeof a4=='string'&&V['includes'](a4),J=a4=>{let a5=Number(a4);return Number['isFinite'](a5)&&a5>0x0?a5:void 0x0;},Y=a4=>{let a5=Number(a4);return Number['isFinite'](a5)&&a5>0x0?a5:U;},X=a4=>{const aW=aF;if(a4==null||a4===!0x1)return null;if(K(a4))return{'mode':a4,'resize':H,'padding':U};if(!G(a4))return null;let a5=J(a4['minScale']),a6=J(a4['maxScale']),a7=a5!==void 0x0&&a6!==void 0x0&&a6<a5?a5:a6;return{'mode':K(a4[aW(0xe6)])?a4['mode']:'auto','resize':q(a4['resize'])?a4['resize']:H,'padding':Y(a4['padding']),'minScale':a5,'maxScale':a7};},Z=(a4,a5,a6)=>{let a7=a4;return Number['isFinite'](a5)&&(a7=Math['max'](Number(a5),a7)),Number['isFinite'](a6)&&(a7=Math['min'](Number(a6),a7)),a7;},ne=({mode:a4,viewportWidth:a5,viewportHeight:a6,contentWidth:a7,contentHeight:a8,minScale:a9,maxScale:aa})=>{if(a5<=0x0||a6<=0x0||a7<=0x0||a8<=0x0)return;let ab=a5/a7,ac=a6/a8,ad=Math['min'](ab,ac),af=Math['max'](ab,ac),ag=((()=>{switch(a4){case'cover':return af;case'width':return ab;case'height':return ac;case'actual':return 0x1;case'scale-down':return Math['min'](0x1,ad);default:return ad;}})());if(!(!Number['isFinite'](ag)||ag<=0x0))return Z(ag,a9,aa);},re=a4=>{const aX=aF;var a5,a6;if(!a4)return!0x1;let a7=Number((a5=a4['scale'])==null?(a6=a4['zoom'])==null?void 0x0:a6['scale']:a5);if(Number['isFinite'](a7)&&a7>0x0||Number['isFinite'](a4['page'])||Number['isFinite'](a4['rotation'])||a4['navigation']&&Object[aX(0x11f)](a4['navigation'])[aX(0x10f)]>0x0||a4['extra']&&Object[aX(0x11f)](a4['extra'])['length']>0x0)return!0x0;let a8=a4[aX(0xe8)]||{};return['top','left',aX(0xf8),'leftRatio']['some'](a9=>{let aa=a8[a9];return Number['isFinite'](aa);});},Q=(a4,a5,a6='viewer',a7='none')=>({'applied':!0x1,'mode':a4['mode'],'resize':a4['resize'],'source':a6,'reason':a5,'provider':a7}),$=(a4,a5,a6)=>({'applied':!!(a4!=null&&a4['applied']),'mode':(a4==null?void 0x0:a4[aF(0xe6)])||a5['mode'],'resize':(a4==null?void 0x0:a4['resize'])||a5['resize'],'scale':a4==null?void 0x0:a4['scale'],'source':(a4==null?void 0x0:a4['source'])||a5['source'],'reason':a4==null?void 0x0:a4[aF(0x103)],'provider':(a4==null?void 0x0:a4['provider'])||a6,'state':a4==null?void 0x0:a4['state']}),ie=a4=>a4===aF(0xe9)||a4==='retry'||a4==='image-not-ready'||a4==='unmeasurable',ae=a4=>{const aY=aF;var a5;let a6=(a5=a4['getBoundingClientRect'])==null?void 0x0:a5['call'](a4);return{'width':Math['max'](0x0,(a6==null?void 0x0:a6['width'])||a4['clientWidth']||0x0),'height':Math['max'](0x0,(a6==null?void 0x0:a6[aY(0x122)])||a4['clientHeight']||0x0)};},oe=({root:a4,enabled:a5,getFit:a6=()=>void 0x0,onFit:a7})=>{let a8=null,a9=null,aa=null,ab=!0x1,ac=0x0,ad=()=>{var am;let an=a4();return((am=an==null?void 0x0:an['ownerDocument'])==null?void 0x0:am['defaultView'])||(typeof window<'u'?window:void 0x0);},af=()=>{if(a9===null)return;let am=ad();am!=null&&am['cancelAnimationFrame']&&am['cancelAnimationFrame'](a9),a9=null;},ag=()=>{aa&&clearTimeout(aa),aa=null;},ah=(am,an)=>{let ao=am===void 0x0?a6():am;return ao==null?an==='api'?X('auto'):null:X(ao);},ai=(am,an,ao)=>{ac>=W||(ag(),ac+=0x1,aa=setTimeout(()=>{const aZ=a1;aa=null,aj(am,{'source':an,'reason':ao===aZ(0xe7)?'api':aZ(0x11e)});},0x20*ac));},aj=(function(){var am=a3(function*(an,ao={}){const b0=a1;let ap=ao['source']||'api',aq=ao['reason']||'api',ar=ah(an,aq);if(!ar)return{'applied':!0x1,'mode':'auto','resize':H,'source':ap,'reason':'not-configured','provider':'none'};if((a5==null?void 0x0:a5())===!0x1)return Q(ar,'disabled',ap);let as=a4();if(!as)return ai(an,ap,aq),Q(ar,b0(0x100),ap);let at=ae(as);if(at['width']<=0x0||at['height']<=0x0)return ai(an,ap,aq),Q(ar,'zero-size',ap);let au=a2(a2({},ar),{},{'source':ap,'reason':aq,'viewportWidth':Math['max'](0x0,at['width']-ar['padding']*0x2),'viewportHeight':Math['max'](0x0,at['height']-ar[b0(0x120)]*0x2),'container':as}),av=A(as),aw=null;if(av!=null&&av['fit']){let az=$(yield av['fit'](au),au,'view-state');if(az['applied'])return ac=0x0,a7==null||a7(az),az;aw=az;}let ax=D(as);if(ax!=null&&ax['fit']){let aA=$(yield ax['fit'](au),au,'zoom');if(aA[b0(0x11c)])return ac=0x0,a7==null||a7(aA),aA;aw=aA;}let ay=Q(ar,av||ax?'unsupported':'no-provider',ap);return(ay[b0(0x103)]==='no-provider'||ie(aw==null?void 0x0:aw['reason']))&&ai(an,ap,aq),ay;});return function(an){return am['apply'](this,arguments);};}()),ak=(am='resize')=>{let an=X(a6());if(!an||an['resize']==='initial'||an['resize']==='until-interaction'&&ab)return;af();let ao=ad(),ap=()=>{const b1=a1;a9=null,aj(void 0x0,{'source':b1(0xef),'reason':am});};if(ao!=null&&ao['requestAnimationFrame']){a9=ao['requestAnimationFrame'](ap);return;}a9=setTimeout(ap,0x10);},al=()=>{af(),a8==null||a8['disconnect'](),a8=null;};return{'normalize':X,'fit':(function(){var am=a3(function*(an,ao){return ag(),ab=!0x1,aj(an,{'source':(ao==null?void 0x0:ao['source'])||'api','reason':(ao==null?void 0x0:ao['reason'])||'api'});});return function(an,ao){const b2=a1;return am[b2(0x116)](this,arguments);};}()),'applyInitialFit':(function(){var am=a3(function*(an={}){return ag(),ac=0x0,ab=!0x1,an['skip']?Q(X(a6())||X('auto'),'initial-view-state','initial'):aj(void 0x0,{'source':'initial','reason':'initial'});});return function(){return am['apply'](this,arguments);};}()),'scheduleFit':ak,'observe'(){const b3=a1;var am,an;al();let ao=a4(),ap=((an=(am=ao==null?void 0x0:ao[b3(0x114)])==null?void 0x0:am['defaultView'])==null?void 0x0:an['ResizeObserver'])||(typeof ResizeObserver<'u'?ResizeObserver:void 0x0);!ao||!ap||(a8=new ap(()=>ak('resize')),a8['observe'](ao));},'markUserInteraction'(){ab=!0x0,ag();},'resetAutoFit'(){ab=!0x1,ac=0x0;},'destroy'(){al(),ag(),ac=0x0;}};};export{ee as _,z as a,r as b,A as c,T as d,k as f,v as g,_ as h,L as i,D as l,g as m,re as n,P as o,E as p,ne as r,w as s,oe as t,O as u,o as v,i as y};
|