@bonniepdf/previewer 0.0.0-stage → 2026.11.13
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/LICENSE +201 -0
- package/README.md +233 -2
- package/dist/chunk-7GN6MXS6.js +663 -0
- package/dist/chunk-GCCYT6QM.cjs +663 -0
- package/dist/compliance-view.d.cts +59 -0
- package/dist/compliance-view.d.ts +59 -0
- package/dist/controller.d.cts +8 -0
- package/dist/controller.d.ts +8 -0
- package/dist/define.d.cts +74 -0
- package/dist/define.d.ts +74 -0
- package/dist/dom.d.cts +19 -0
- package/dist/dom.d.ts +19 -0
- package/dist/element.cjs +1 -0
- package/dist/element.d.cts +1 -0
- package/dist/element.d.ts +1 -0
- package/dist/element.js +1 -0
- package/dist/icons.d.cts +19 -0
- package/dist/icons.d.ts +19 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1 -0
- package/dist/selection-highlights.d.cts +29 -0
- package/dist/selection-highlights.d.ts +29 -0
- package/dist/structure-view.d.cts +14 -0
- package/dist/structure-view.d.ts +14 -0
- package/dist/styles.d.cts +1 -0
- package/dist/styles.d.ts +1 -0
- package/dist/types.d.cts +406 -0
- package/dist/types.d.ts +406 -0
- package/dist/virtual-mount.d.cts +16 -0
- package/dist/virtual-mount.d.ts +16 -0
- package/package.json +74 -3
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
'use strict';var At={width:595.28,height:841.89};function Ht(s){let n=s.match(/<svg[^>]*\bwidth="([\d.]+)"/i),o=s.match(/<svg[^>]*\bheight="([\d.]+)"/i);if(n&&o)return {width:Number(n[1]),height:Number(o[1])};let i=s.match(/<svg[^>]*\bviewBox="([\d.\s-]+)"/i);if(i){let l=i[1].trim().split(/\s+/).map(Number);if(l.length===4)return {width:l[2],height:l[3]}}return {...At}}function tn(s){return at(s)}function at(s){return s.map(n=>({svg:n,...Ht(n)}))}var It={"panel-left-close":'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18m7-6l-3-3l3-3"/></g>',"panel-left":'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/></g>',"chevron-left":'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 18l-6-6l6-6"/>',"chevron-right":'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m9 18l6-6l-6-6"/>',"zoom-out":'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21l-4.35-4.35M8 11h6"/></g>',"zoom-in":'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21l-4.35-4.35M11 8v6m-3-3h6"/></g>',maximize:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3m8 0h3a2 2 0 0 0 2-2v-3"/>',minimize:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3M3 16h3a2 2 0 0 1 2 2v3m8 0v-3a2 2 0 0 1 2-2h3"/>',download:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10l5 5l5-5"/></g>',"panel-right":'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M15 3v18"/></g>',"circle-x":'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6m0-6 6 6"/></g>',"triangle-alert":'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21.73 18 13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3ZM12 9v4m0 4h.01"/>',info:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 11v5m0-8h.01"/></g>'};function re(s,n="bpp-icon"){return `<svg class="${n}" viewBox="0 0 24 24" width="16" height="16" aria-hidden="true">${It[s]}</svg>`}var ft=`
|
|
2
|
+
:host {
|
|
3
|
+
--_divider: var(--bpdf-divider, var(--cui-divider, #e2e8f0));
|
|
4
|
+
--_bg: var(--bpdf-bg, var(--cui-bg, #ffffff));
|
|
5
|
+
--_bg-alt: var(--bpdf-bg-alt, var(--cui-bg-alt, #f1f5f9));
|
|
6
|
+
--_bg-soft: var(--bpdf-bg-soft, var(--cui-bg-soft, #f8fafc));
|
|
7
|
+
--_brand: var(--bpdf-brand-2, var(--cui-brand-1, #007acc));
|
|
8
|
+
--_brand-soft: var(--bpdf-brand-soft, var(--cui-brand-soft, rgba(0, 122, 204, 0.08)));
|
|
9
|
+
--_text-1: var(--bpdf-text-1, var(--cui-text-1, #0f172a));
|
|
10
|
+
--_text-2: var(--bpdf-text-2, var(--cui-text-2, #475569));
|
|
11
|
+
--_text-3: var(--bpdf-text-3, var(--cui-text-3, #94a3b8));
|
|
12
|
+
--_radius-md: var(--bpdf-radius, var(--cui-radius, 8px));
|
|
13
|
+
--_radius-sm: 6px;
|
|
14
|
+
|
|
15
|
+
/* Compliance severity palette (overridable via --bpdf-* tokens). */
|
|
16
|
+
--_sev-error: var(--bpdf-error, var(--cui-danger-1, #dc2626));
|
|
17
|
+
--_sev-warning: var(--bpdf-warning, var(--cui-status-warning-text, #d97706));
|
|
18
|
+
--_sev-info: var(--bpdf-info, var(--cui-palette-blue, #2563eb));
|
|
19
|
+
--_sev-ok: var(--bpdf-status-success-text, var(--bpdf-success, var(--cui-status-success-text, #047857)));
|
|
20
|
+
|
|
21
|
+
display: block;
|
|
22
|
+
height: 100%;
|
|
23
|
+
min-height: 0;
|
|
24
|
+
/* A clean default font for the chrome; the SVG pages carry their own fonts. */
|
|
25
|
+
font-family: var(--bpdf-font-family, var(--cui-font-family, system-ui, -apple-system, Segoe UI, Roboto, sans-serif));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Maximized web components enter the browser's top layer via the Popover API,
|
|
29
|
+
so host-page stacking contexts (sticky headers, transformed ancestors, etc.)
|
|
30
|
+
cannot cover the previewer. The class selector provides the same sizing for
|
|
31
|
+
createPreviewer() instances mounted directly into a light-DOM element. */
|
|
32
|
+
:host(:popover-open),
|
|
33
|
+
.bpp-popover-host:popover-open {
|
|
34
|
+
position: fixed;
|
|
35
|
+
inset: 0;
|
|
36
|
+
width: 100vw;
|
|
37
|
+
height: 100dvh;
|
|
38
|
+
max-width: none;
|
|
39
|
+
max-height: none;
|
|
40
|
+
margin: 0;
|
|
41
|
+
padding: 0;
|
|
42
|
+
border: 0;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
background: var(--_bg-alt);
|
|
45
|
+
z-index: 2147483647;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
* { box-sizing: border-box; }
|
|
49
|
+
|
|
50
|
+
.bpp {
|
|
51
|
+
position: relative;
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
height: 100%;
|
|
55
|
+
min-height: 0;
|
|
56
|
+
min-width: 0;
|
|
57
|
+
border: 1px solid var(--_divider);
|
|
58
|
+
border-radius: var(--_radius-md);
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
background: var(--_bg-alt);
|
|
61
|
+
container-type: inline-size;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.bpp-no-border {
|
|
65
|
+
border-color: transparent;
|
|
66
|
+
border-radius: 0;
|
|
67
|
+
border: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.bpp-fullscreen {
|
|
71
|
+
position: fixed;
|
|
72
|
+
inset: 0;
|
|
73
|
+
width: 100vw;
|
|
74
|
+
height: 100dvh;
|
|
75
|
+
border-radius: 0;
|
|
76
|
+
z-index: 2147483647;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* \u2500\u2500 Toolbar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
80
|
+
.bpp-toolbar {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
height: 48px;
|
|
84
|
+
padding: 0 12px;
|
|
85
|
+
gap: 4px;
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
background: var(--_bg-soft);
|
|
88
|
+
border-bottom: 1px solid var(--_divider);
|
|
89
|
+
z-index: 5;
|
|
90
|
+
}
|
|
91
|
+
.bpp-group { display: flex; align-items: center; gap: 2px; }
|
|
92
|
+
.bpp-group-end { margin-left: auto; }
|
|
93
|
+
.bpp-btn {
|
|
94
|
+
display: inline-flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
gap: 6px;
|
|
98
|
+
min-width: 32px;
|
|
99
|
+
height: 32px;
|
|
100
|
+
padding: 0 6px;
|
|
101
|
+
background: transparent;
|
|
102
|
+
border: 1px solid transparent;
|
|
103
|
+
border-radius: var(--_radius-sm);
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
color: var(--_text-2);
|
|
106
|
+
font: inherit;
|
|
107
|
+
font-size: 0.8125rem;
|
|
108
|
+
}
|
|
109
|
+
.bpp-btn:hover:not(:disabled) {
|
|
110
|
+
background: var(--_bg-alt);
|
|
111
|
+
border-color: var(--_divider);
|
|
112
|
+
color: var(--_text-1);
|
|
113
|
+
}
|
|
114
|
+
.bpp-btn:disabled { opacity: 0.35; cursor: not-allowed; }
|
|
115
|
+
.bpp-btn-active, .bpp-btn-active:hover {
|
|
116
|
+
background: var(--_brand-soft);
|
|
117
|
+
border-color: var(--_brand);
|
|
118
|
+
color: var(--_brand);
|
|
119
|
+
}
|
|
120
|
+
.bpp-btn-download { padding: 0 10px; }
|
|
121
|
+
.bpp-btn-label { white-space: nowrap; }
|
|
122
|
+
.bpp-icon { width: 16px; height: 16px; flex-shrink: 0; }
|
|
123
|
+
.bpp-btn-active .bpp-icon-thumbs-closed,
|
|
124
|
+
.bpp-btn:not(.bpp-btn-active) .bpp-icon-thumbs-open { display: none; }
|
|
125
|
+
.bpp-fullscreen .bpp-icon-fullscreen-open,
|
|
126
|
+
.bpp:not(.bpp-fullscreen) .bpp-icon-fullscreen-close { display: none; }
|
|
127
|
+
.bpp-fullscreen-label { display: none; white-space: nowrap; }
|
|
128
|
+
.bpp-fullscreen .bpp-fullscreen-label { display: inline; }
|
|
129
|
+
.bpp-sep { width: 1px; height: 20px; margin: 0 6px; background: var(--_divider); flex-shrink: 0; }
|
|
130
|
+
.bpp-pages-label {
|
|
131
|
+
display: flex; align-items: center; gap: 4px; min-width: 56px; justify-content: center;
|
|
132
|
+
font-size: 0.8125rem; color: var(--_text-2); font-variant-numeric: tabular-nums; user-select: none;
|
|
133
|
+
}
|
|
134
|
+
.bpp-page-current { font-weight: 600; color: var(--_text-1); }
|
|
135
|
+
.bpp-page-sep, .bpp-page-total { color: var(--_text-3); }
|
|
136
|
+
.bpp-zoom {
|
|
137
|
+
appearance: none; -webkit-appearance: none;
|
|
138
|
+
height: 32px; min-width: 96px; padding: 0 28px 0 8px;
|
|
139
|
+
border: 1px solid var(--_divider); border-radius: var(--_radius-sm);
|
|
140
|
+
background-color: var(--_bg);
|
|
141
|
+
background-image:
|
|
142
|
+
linear-gradient(45deg, transparent 50%, currentColor 50%),
|
|
143
|
+
linear-gradient(135deg, currentColor 50%, transparent 50%);
|
|
144
|
+
background-position: calc(100% - 17px) 50%, calc(100% - 13px) 50%;
|
|
145
|
+
background-size: 4px 4px; background-repeat: no-repeat;
|
|
146
|
+
color: var(--_text-1); font: inherit; font-size: 0.8125rem; cursor: pointer;
|
|
147
|
+
}
|
|
148
|
+
.bpp-zoom:hover { border-color: var(--_text-3); }
|
|
149
|
+
|
|
150
|
+
@container (max-width: 640px) {
|
|
151
|
+
.bpp-btn-label { display: none; }
|
|
152
|
+
.bpp-btn-download { padding: 0 6px; }
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* Narrow containers (phones): the controls no longer fit on one row, so the
|
|
156
|
+
toolbar wraps instead of clipping them. Separators are dropped because they
|
|
157
|
+
would otherwise start or end a wrapped row. */
|
|
158
|
+
@container (max-width: 560px) {
|
|
159
|
+
.bpp-toolbar {
|
|
160
|
+
flex-wrap: wrap;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
height: auto;
|
|
163
|
+
min-height: 48px;
|
|
164
|
+
padding: 6px 8px;
|
|
165
|
+
row-gap: 4px;
|
|
166
|
+
}
|
|
167
|
+
.bpp-sep { display: none; }
|
|
168
|
+
.bpp-group-end { margin-left: 0; }
|
|
169
|
+
.bpp-group-end:empty { display: none; }
|
|
170
|
+
.bpp-zoom { min-width: 0; }
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* \u2500\u2500 Body / thumbnails / pages \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
174
|
+
.bpp-body { display: flex; flex-direction: row; flex: 1; min-height: 0; overflow: hidden; }
|
|
175
|
+
.bpp-thumbs {
|
|
176
|
+
width: 168px; flex-shrink: 0; overflow-y: auto; overscroll-behavior: contain;
|
|
177
|
+
background: var(--_bg-soft); border-right: 1px solid var(--_divider);
|
|
178
|
+
}
|
|
179
|
+
.bpp-thumbs[hidden] { display: none; }
|
|
180
|
+
.bpp-thumbs-list { list-style: none; margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
|
|
181
|
+
.bpp-thumb {
|
|
182
|
+
display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%;
|
|
183
|
+
padding: 0; background: none; border: none; cursor: pointer; color: var(--_text-3); font: inherit;
|
|
184
|
+
}
|
|
185
|
+
.bpp-thumb-canvas {
|
|
186
|
+
display: block; width: 100%; background: #fff; border: 2px solid transparent; border-radius: 2px;
|
|
187
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.16); overflow: hidden;
|
|
188
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
189
|
+
}
|
|
190
|
+
.bpp-thumb-canvas svg { display: block; width: 100%; height: auto; }
|
|
191
|
+
/* Link overlays stay inert in thumbnails - a thumbnail click always navigates
|
|
192
|
+
to the page, never follows the document's links. */
|
|
193
|
+
.bpp-thumb-canvas svg a, .bpp-thumb-canvas svg [data-bp-link-page] { pointer-events: none; }
|
|
194
|
+
.bpp-thumb:hover .bpp-thumb-canvas { border-color: var(--_brand); }
|
|
195
|
+
.bpp-thumb-active .bpp-thumb-canvas { border-color: var(--_brand); box-shadow: 0 0 0 1px var(--_brand); }
|
|
196
|
+
.bpp-thumb-label { font-size: 0.75rem; font-variant-numeric: tabular-nums; }
|
|
197
|
+
.bpp-thumb-active .bpp-thumb-label { color: var(--_text-1); font-weight: 600; }
|
|
198
|
+
/* scrollbar-gutter: stable reserves the vertical scrollbar's space at all
|
|
199
|
+
times so the scroll container's clientWidth doesn't jump when the scrollbar
|
|
200
|
+
appears/disappears. Without it, fit-width sizing forms a feedback loop with
|
|
201
|
+
the ResizeObserver (width -> page scale -> content height -> scrollbar ->
|
|
202
|
+
width...), which oscillates forever for documents whose fitted height lands
|
|
203
|
+
right at the viewport boundary (e.g. the pdf-compliance example). */
|
|
204
|
+
.bpp-scroll { flex: 1; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
|
|
205
|
+
.bpp-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px; min-width: min-content; }
|
|
206
|
+
.bpp-page {
|
|
207
|
+
position: relative;
|
|
208
|
+
flex-shrink: 0; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.18);
|
|
209
|
+
/* Let the browser skip layout/paint of off-screen pages as a second layer of
|
|
210
|
+
virtualisation on top of the JS mount/unmount. */
|
|
211
|
+
content-visibility: auto;
|
|
212
|
+
}
|
|
213
|
+
.bpp-page-canvas { position: absolute; inset: 0; z-index: 0; }
|
|
214
|
+
.bpp-page svg { display: block; width: 100%; height: 100%; }
|
|
215
|
+
|
|
216
|
+
/* Chromium paints native SVG selection around glyph cells and leaves the
|
|
217
|
+
advances occupied by spaces uncoloured. A measured overlay fills those gaps;
|
|
218
|
+
the native background is made transparent while its selected foreground is
|
|
219
|
+
retained. The overlay is inert and remains below inspector highlights. */
|
|
220
|
+
.bpp-page-canvas svg text::selection {
|
|
221
|
+
background-color: transparent;
|
|
222
|
+
color: inherit;
|
|
223
|
+
fill: inherit;
|
|
224
|
+
}
|
|
225
|
+
.bpp-selection-layer {
|
|
226
|
+
position: absolute; inset: 0; overflow: hidden;
|
|
227
|
+
pointer-events: none; z-index: 1;
|
|
228
|
+
}
|
|
229
|
+
.bpp-selection-rect {
|
|
230
|
+
position: absolute; display: block;
|
|
231
|
+
background: var(--bpdf-selection, Highlight); opacity: 0.45;
|
|
232
|
+
}
|
|
233
|
+
@media (forced-colors: active) {
|
|
234
|
+
.bpp-page-canvas svg text::selection { color: HighlightText; fill: HighlightText; }
|
|
235
|
+
.bpp-selection-rect { opacity: 1; }
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* \u2500\u2500 Plugin overlays (inspector highlights) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
239
|
+
.bpp-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
|
|
240
|
+
|
|
241
|
+
/* \u2500\u2500 Shared inspector side panel (tabbed: structure / compliance / \u2026) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
242
|
+
.bpp-side {
|
|
243
|
+
width: 280px; flex-shrink: 0;
|
|
244
|
+
display: flex; flex-direction: column; min-height: 0;
|
|
245
|
+
border-left: 1px solid var(--_divider); background: var(--_bg-alt);
|
|
246
|
+
font-size: 0.8125rem; color: var(--_text-2);
|
|
247
|
+
}
|
|
248
|
+
.bpp-side[hidden] { display: none; }
|
|
249
|
+
|
|
250
|
+
/* Splitter between the document area and the inspector panel. A 7px hit area
|
|
251
|
+
that straddles the panel's left seam via negative margins, so it adds no
|
|
252
|
+
layout width. The visible accent line only appears on hover/focus/drag; at
|
|
253
|
+
rest the panel's own border-left is the divider. */
|
|
254
|
+
.bpp-side-resizer {
|
|
255
|
+
flex: 0 0 auto;
|
|
256
|
+
align-self: stretch;
|
|
257
|
+
width: 7px;
|
|
258
|
+
margin-left: -4px;
|
|
259
|
+
margin-right: -3px;
|
|
260
|
+
position: relative;
|
|
261
|
+
z-index: 3;
|
|
262
|
+
cursor: col-resize;
|
|
263
|
+
background: transparent;
|
|
264
|
+
touch-action: none;
|
|
265
|
+
}
|
|
266
|
+
.bpp-side-resizer[hidden] { display: none; }
|
|
267
|
+
.bpp-side-resizer::before {
|
|
268
|
+
content: "";
|
|
269
|
+
position: absolute;
|
|
270
|
+
top: 0; bottom: 0; left: 50%;
|
|
271
|
+
width: 2px;
|
|
272
|
+
transform: translateX(-50%);
|
|
273
|
+
background: var(--_brand);
|
|
274
|
+
opacity: 0;
|
|
275
|
+
transition: opacity 0.15s ease;
|
|
276
|
+
}
|
|
277
|
+
.bpp-side-resizer:hover::before,
|
|
278
|
+
.bpp-side-resizer:focus-visible::before,
|
|
279
|
+
.bpp-side-resizer-active::before { opacity: 1; }
|
|
280
|
+
.bpp-side-resizer:focus-visible { outline: none; }
|
|
281
|
+
|
|
282
|
+
/* Tab strip: one tab per registered panel; hidden when there's only one. */
|
|
283
|
+
.bpp-side-tabs {
|
|
284
|
+
display: flex; flex-shrink: 0; gap: 2px; padding: 6px 6px 0;
|
|
285
|
+
border-bottom: 1px solid var(--_divider);
|
|
286
|
+
}
|
|
287
|
+
.bpp-side-tabs[hidden] { display: none; }
|
|
288
|
+
.bpp-side-tab {
|
|
289
|
+
display: inline-flex; align-items: center; gap: 6px;
|
|
290
|
+
padding: 6px 10px; border: 0; border-bottom: 2px solid transparent;
|
|
291
|
+
background: none; color: var(--_text-2); font: inherit; font-size: 0.8125rem;
|
|
292
|
+
font-weight: 600; cursor: pointer; white-space: nowrap;
|
|
293
|
+
}
|
|
294
|
+
.bpp-side-tab:hover { color: var(--_text-1); }
|
|
295
|
+
.bpp-side-tab-active {
|
|
296
|
+
color: var(--_brand); border-bottom-color: var(--_brand);
|
|
297
|
+
}
|
|
298
|
+
.bpp-side-tab-badge {
|
|
299
|
+
min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
|
|
300
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
301
|
+
border-radius: 999px; font-size: 0.625rem; font-weight: 700; line-height: 1; color: #fff;
|
|
302
|
+
}
|
|
303
|
+
.bpp-side-tab-badge[hidden] { display: none; }
|
|
304
|
+
.bpp-side-tab-badge-error { background: var(--_sev-error); }
|
|
305
|
+
.bpp-side-tab-badge-warning { background: var(--_sev-warning); }
|
|
306
|
+
.bpp-side-tab-badge-info { background: var(--_sev-info); }
|
|
307
|
+
.bpp-side-tab-badge-ok { background: var(--_sev-ok); }
|
|
308
|
+
/* Body: holds every panel's element; only the active one is shown. */
|
|
309
|
+
.bpp-side-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
|
|
310
|
+
.bpp-side-body > [hidden] { display: none; }
|
|
311
|
+
.bpp-side-body > * { flex: 1 1 auto; min-height: 0; }
|
|
312
|
+
/* Toolbar toggle: a dot signals unseen issues while the panel is collapsed. */
|
|
313
|
+
.bpp-side-toggle { position: relative; }
|
|
314
|
+
.bpp-side-toggle-dot {
|
|
315
|
+
position: absolute; top: 3px; right: 3px;
|
|
316
|
+
width: 8px; height: 8px; border-radius: 50%;
|
|
317
|
+
box-shadow: 0 0 0 1.5px var(--_bg);
|
|
318
|
+
}
|
|
319
|
+
.bpp-side-toggle-dot[hidden] { display: none; }
|
|
320
|
+
.bpp-side-toggle-dot-error { background: var(--_sev-error); }
|
|
321
|
+
.bpp-side-toggle-dot-warning { background: var(--_sev-warning); }
|
|
322
|
+
.bpp-side-toggle-dot-info { background: var(--_sev-info); }
|
|
323
|
+
.bpp-tree { list-style: none; margin: 0; padding: 6px 0; }
|
|
324
|
+
.bpp-tree ul { list-style: none; margin: 0; padding-left: 14px; }
|
|
325
|
+
.bpp-tree-row {
|
|
326
|
+
display: flex; align-items: baseline; gap: 6px; width: 100%;
|
|
327
|
+
padding: 3px 10px; border: 0; background: none; text-align: left;
|
|
328
|
+
color: inherit; font: inherit; cursor: pointer;
|
|
329
|
+
}
|
|
330
|
+
.bpp-tree-row:hover { background: color-mix(in srgb, var(--_brand) 10%, transparent); }
|
|
331
|
+
.bpp-tree-row[aria-selected="true"] {
|
|
332
|
+
background: color-mix(in srgb, var(--_brand) 16%, transparent);
|
|
333
|
+
color: var(--_text-1); font-weight: 600;
|
|
334
|
+
}
|
|
335
|
+
.bpp-tree-row:focus-visible {
|
|
336
|
+
outline: 2px solid var(--_brand); outline-offset: -2px;
|
|
337
|
+
}
|
|
338
|
+
.bpp-tree-type { color: var(--_text-1); }
|
|
339
|
+
.bpp-tree-name {
|
|
340
|
+
color: var(--_text-3); font-style: italic;
|
|
341
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
342
|
+
}
|
|
343
|
+
/* Expand/collapse affordance: a CSS triangle that rotates, so no icon asset and
|
|
344
|
+
no extra DOM. Leaves keep the box for alignment but draw nothing. */
|
|
345
|
+
.bpp-tree-twisty {
|
|
346
|
+
flex: 0 0 auto; width: 10px; height: 10px; position: relative;
|
|
347
|
+
}
|
|
348
|
+
.bpp-tree-twisty::before {
|
|
349
|
+
content: ''; position: absolute; left: 2px; top: 1px;
|
|
350
|
+
border: 4px solid transparent; border-left-color: var(--_text-3);
|
|
351
|
+
transition: transform 0.12s ease;
|
|
352
|
+
}
|
|
353
|
+
.bpp-tree-row[aria-expanded="true"] > .bpp-tree-twisty::before {
|
|
354
|
+
transform: rotate(90deg); transform-origin: 2px 4px;
|
|
355
|
+
}
|
|
356
|
+
.bpp-tree-twisty-leaf::before { content: none; }
|
|
357
|
+
@media (prefers-reduced-motion: reduce) {
|
|
358
|
+
.bpp-tree-twisty::before { transition: none; }
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* \u2500\u2500 Footer \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
362
|
+
/* Slim bar under the page area: host text left, document conformance pills
|
|
363
|
+
right. Rendered only when the host opts in via the footer option. */
|
|
364
|
+
.bpp-footer {
|
|
365
|
+
display: flex;
|
|
366
|
+
align-items: center;
|
|
367
|
+
justify-content: space-between;
|
|
368
|
+
flex-wrap: wrap;
|
|
369
|
+
gap: 0.25rem 0.75rem;
|
|
370
|
+
min-height: 34px;
|
|
371
|
+
padding: 0.25rem 12px;
|
|
372
|
+
flex-shrink: 0;
|
|
373
|
+
background: var(--_bg-soft);
|
|
374
|
+
border-top: 1px solid var(--_divider);
|
|
375
|
+
font-size: 0.75rem;
|
|
376
|
+
color: var(--_text-3);
|
|
377
|
+
}
|
|
378
|
+
.bpp-footer-text {
|
|
379
|
+
min-width: 0;
|
|
380
|
+
overflow: hidden;
|
|
381
|
+
text-overflow: ellipsis;
|
|
382
|
+
white-space: nowrap;
|
|
383
|
+
}
|
|
384
|
+
.bpp-footer-tags {
|
|
385
|
+
display: flex;
|
|
386
|
+
align-items: center;
|
|
387
|
+
gap: 0.35rem;
|
|
388
|
+
flex-shrink: 0;
|
|
389
|
+
}
|
|
390
|
+
.bpp-footer-tag {
|
|
391
|
+
display: inline-flex;
|
|
392
|
+
align-items: center;
|
|
393
|
+
padding: 0.1rem 0.5rem;
|
|
394
|
+
border-radius: 999px;
|
|
395
|
+
font-size: 0.6875rem;
|
|
396
|
+
font-weight: 600;
|
|
397
|
+
letter-spacing: 0.02em;
|
|
398
|
+
color: var(--_brand);
|
|
399
|
+
background: var(--_brand-soft);
|
|
400
|
+
white-space: nowrap;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/* \u2500\u2500 Loading overlay \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
404
|
+
.bpp-loading {
|
|
405
|
+
position: absolute; inset: 0; z-index: 6;
|
|
406
|
+
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
|
|
407
|
+
background: var(--_bg-alt); color: var(--_text-3); font-size: 0.875rem;
|
|
408
|
+
}
|
|
409
|
+
.bpp-loading[hidden] { display: none; }
|
|
410
|
+
.bpp-spinner {
|
|
411
|
+
width: 34px; height: 34px; border-radius: 50%;
|
|
412
|
+
border: 3px solid var(--_divider); border-top-color: var(--_brand);
|
|
413
|
+
animation: bpp-spin 0.8s linear infinite;
|
|
414
|
+
}
|
|
415
|
+
@keyframes bpp-spin { to { transform: rotate(360deg); } }
|
|
416
|
+
|
|
417
|
+
/* \u2500\u2500 Busy and error states \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
418
|
+
.bpp-busy .bpp-pages { opacity: 0.55; transition: opacity 120ms ease; }
|
|
419
|
+
.bpp-error {
|
|
420
|
+
position: absolute; inset: 0; z-index: 7;
|
|
421
|
+
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
|
|
422
|
+
padding: 24px; text-align: center;
|
|
423
|
+
background: var(--_bg-alt); color: var(--_text-2); font-size: 0.875rem;
|
|
424
|
+
}
|
|
425
|
+
.bpp-error[hidden] { display: none; }
|
|
426
|
+
.bpp-error-title { font-weight: 600; color: var(--_text-1); }
|
|
427
|
+
.bpp-error-detail { color: var(--_text-3); overflow-wrap: anywhere; }
|
|
428
|
+
.bpp-error-detail:empty { display: none; }
|
|
429
|
+
.bpp-error.bpp-error-banner {
|
|
430
|
+
inset: auto 0 0 0; flex-direction: row; justify-content: flex-start; gap: 8px;
|
|
431
|
+
padding: 8px 12px; border-top: 1px solid var(--_divider); text-align: left;
|
|
432
|
+
}
|
|
433
|
+
@media (prefers-reduced-motion: reduce) { .bpp-spinner { animation-duration: 2s; } }
|
|
434
|
+
|
|
435
|
+
/* \u2500\u2500 Compliance view plugin \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
436
|
+
.bpp-cv-host { display: flex; flex-direction: column; height: 100%; min-height: 0; }
|
|
437
|
+
|
|
438
|
+
/* Summary block: fixed height on both tabs, so it never squeezes the tree. */
|
|
439
|
+
.bpp-cv-summary {
|
|
440
|
+
flex: 0 0 auto;
|
|
441
|
+
padding: 10px 12px; border-bottom: 1px solid var(--_divider);
|
|
442
|
+
display: flex; flex-direction: column; gap: 8px;
|
|
443
|
+
}
|
|
444
|
+
.bpp-cv-header { display: flex; flex-direction: column; gap: 8px; }
|
|
445
|
+
.bpp-cv-pills { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
446
|
+
.bpp-cv-pill {
|
|
447
|
+
padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
|
|
448
|
+
color: #fff;
|
|
449
|
+
}
|
|
450
|
+
.bpp-cv-pill-error { background: var(--_sev-error); }
|
|
451
|
+
.bpp-cv-pill-warning { background: var(--_sev-warning); }
|
|
452
|
+
.bpp-cv-pill-info { background: var(--_sev-info); }
|
|
453
|
+
.bpp-cv-pill-zero { background: var(--_bg-alt); color: var(--_text-2); border: 1px solid var(--_divider); }
|
|
454
|
+
.bpp-cv-verdict { font-size: 0.8125rem; font-weight: 600; }
|
|
455
|
+
.bpp-cv-verdict-pass { color: var(--_sev-ok); }
|
|
456
|
+
.bpp-cv-verdict-fail { color: var(--_sev-error); }
|
|
457
|
+
.bpp-cv-filter { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--_text-2); cursor: pointer; }
|
|
458
|
+
|
|
459
|
+
/* Settings row: the finding filters, then the tree's expand/collapse actions. */
|
|
460
|
+
.bpp-cv-settings { display: flex; flex-direction: column; gap: 6px; }
|
|
461
|
+
.bpp-cv-filters { display: flex; flex-direction: column; gap: 4px; }
|
|
462
|
+
.bpp-cv-tree-actions { display: flex; gap: 6px; }
|
|
463
|
+
.bpp-cv-action {
|
|
464
|
+
padding: 2px 8px; border: 1px solid var(--_divider); border-radius: 5px;
|
|
465
|
+
background: none; color: var(--_text-2); font: inherit; font-size: 0.6875rem;
|
|
466
|
+
cursor: pointer;
|
|
467
|
+
}
|
|
468
|
+
.bpp-cv-action:hover { background: var(--_brand-soft); color: var(--_text-1); }
|
|
469
|
+
.bpp-cv-action:focus-visible { outline: 2px solid var(--_brand); outline-offset: 1px; }
|
|
470
|
+
|
|
471
|
+
/* Section titles. */
|
|
472
|
+
.bpp-cv-section-title {
|
|
473
|
+
font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em;
|
|
474
|
+
color: var(--_text-3); font-weight: 700; padding: 8px 12px 4px;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/* Findings tab. The list scrolls on its own so it can be any length without
|
|
478
|
+
competing with the tree, which lives on the other tab. */
|
|
479
|
+
.bpp-cv-issues { overflow: hidden; }
|
|
480
|
+
.bpp-cv-issues-head {
|
|
481
|
+
flex: 0 0 auto; padding: 10px 12px; border-bottom: 1px solid var(--_divider);
|
|
482
|
+
display: flex; flex-direction: column; gap: 8px;
|
|
483
|
+
}
|
|
484
|
+
.bpp-cv-issues-list {
|
|
485
|
+
flex: 1 1 auto; overflow: auto; min-height: 0;
|
|
486
|
+
display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px;
|
|
487
|
+
}
|
|
488
|
+
.bpp-cv-issues-group { display: flex; flex-direction: column; gap: 6px; }
|
|
489
|
+
.bpp-cv-scope {
|
|
490
|
+
align-self: flex-start; padding: 1px 6px; border-radius: 999px;
|
|
491
|
+
border: 1px solid var(--_divider); color: var(--_text-3); font-size: 0.625rem;
|
|
492
|
+
text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
|
|
493
|
+
}
|
|
494
|
+
.bpp-cv-finding-where { margin: 0; font-size: 0.75rem; }
|
|
495
|
+
.bpp-cv-finding-el { color: var(--_text-1); font-weight: 600; }
|
|
496
|
+
.bpp-cv-finding-page { color: var(--_text-3); font-variant-numeric: tabular-nums; }
|
|
497
|
+
|
|
498
|
+
/* Tree area (scrolls). */
|
|
499
|
+
.bpp-cv-tree-host { flex: 1 1 auto; overflow: auto; min-height: 60px; }
|
|
500
|
+
.bpp-cv-tree { padding: 4px 0; }
|
|
501
|
+
.bpp-cv-row { align-items: center; }
|
|
502
|
+
|
|
503
|
+
/* Finding icons. */
|
|
504
|
+
.bpp-cv-issue-icon { display: inline-flex; flex: 0 0 auto; }
|
|
505
|
+
.bpp-cv-issue-icon .bpp-icon { width: 14px; height: 14px; }
|
|
506
|
+
.bpp-cv-issue-icon-error { color: var(--_sev-error); }
|
|
507
|
+
.bpp-cv-issue-icon-warning { color: var(--_sev-warning); }
|
|
508
|
+
.bpp-cv-issue-icon-info { color: var(--_sev-info); }
|
|
509
|
+
|
|
510
|
+
/* Role chips. */
|
|
511
|
+
.bpp-cv-role {
|
|
512
|
+
flex: 0 0 auto; padding: 0 5px; border-radius: 4px; font-size: 0.6875rem;
|
|
513
|
+
font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.5;
|
|
514
|
+
background: var(--_bg-soft); color: var(--_text-2); border: 1px solid var(--_divider);
|
|
515
|
+
}
|
|
516
|
+
.bpp-cv-role-heading { background: color-mix(in srgb, var(--_brand) 14%, transparent); color: var(--_brand); border-color: transparent; }
|
|
517
|
+
.bpp-cv-role-figure { background: color-mix(in srgb, var(--_sev-info) 14%, transparent); color: var(--_sev-info); border-color: transparent; }
|
|
518
|
+
.bpp-cv-role-table { background: color-mix(in srgb, var(--_sev-ok) 16%, transparent); color: var(--_sev-ok); border-color: transparent; }
|
|
519
|
+
.bpp-cv-role-artifact { background: transparent; color: var(--_text-3); border-style: dashed; }
|
|
520
|
+
.bpp-cv-row .bpp-cv-role { background: transparent; color: var(--_text-2); border-color: var(--_text-3); }
|
|
521
|
+
.bpp-cv-row .bpp-cv-role-tagged {
|
|
522
|
+
background: color-mix(in srgb, var(--_sev-ok) 14%, transparent);
|
|
523
|
+
color: var(--_text-1); border-color: transparent;
|
|
524
|
+
}
|
|
525
|
+
@media (forced-colors: active) {
|
|
526
|
+
.bpp-cv-row .bpp-cv-role-tagged {
|
|
527
|
+
forced-color-adjust: none;
|
|
528
|
+
background: CanvasText; color: Canvas;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/* Detail pane. */
|
|
533
|
+
.bpp-cv-detail { border-top: 1px solid var(--_divider); max-height: 42%; overflow: auto; flex: 0 0 auto; }
|
|
534
|
+
.bpp-cv-detail-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
|
|
535
|
+
.bpp-cv-detail-head { display: flex; align-items: center; gap: 6px; padding: 0 12px 6px; }
|
|
536
|
+
.bpp-cv-detail-type { font-weight: 700; color: var(--_text-1); font-size: 0.8125rem; }
|
|
537
|
+
.bpp-cv-detail-name { color: var(--_text-3); font-size: 0.8125rem; font-style: italic; }
|
|
538
|
+
.bpp-cv-geom { margin: 0 12px 4px; font-size: 0.75rem; color: var(--_text-3); font-variant-numeric: tabular-nums; }
|
|
539
|
+
.bpp-cv-attr { margin: 0 12px; font-size: 0.75rem; color: var(--_text-2); font-style: italic; }
|
|
540
|
+
.bpp-cv-empty { padding: 4px 12px; font-size: 0.75rem; color: var(--_text-3); }
|
|
541
|
+
|
|
542
|
+
/* Finding cards. */
|
|
543
|
+
.bpp-cv-finding {
|
|
544
|
+
border: 1px solid var(--_divider); border-left-width: 3px; border-radius: var(--_radius-sm);
|
|
545
|
+
padding: 8px 10px; background: var(--_bg); display: flex; flex-direction: column; gap: 5px;
|
|
546
|
+
}
|
|
547
|
+
.bpp-cv-issues-group .bpp-cv-finding { margin: 0 12px; }
|
|
548
|
+
.bpp-cv-finding-error { border-left-color: var(--_sev-error); }
|
|
549
|
+
.bpp-cv-finding-warning { border-left-color: var(--_sev-warning); }
|
|
550
|
+
.bpp-cv-finding-info { border-left-color: var(--_sev-info); }
|
|
551
|
+
.bpp-cv-finding-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
552
|
+
.bpp-cv-badge {
|
|
553
|
+
padding: 1px 6px; border-radius: 4px; font-size: 0.625rem; font-weight: 700;
|
|
554
|
+
text-transform: uppercase; letter-spacing: 0.03em; color: #fff;
|
|
555
|
+
}
|
|
556
|
+
.bpp-cv-badge-error { background: var(--_sev-error); }
|
|
557
|
+
.bpp-cv-badge-warning { background: var(--_sev-warning); }
|
|
558
|
+
.bpp-cv-badge-info { background: var(--_sev-info); }
|
|
559
|
+
.bpp-cv-clause { font-size: 0.6875rem; color: var(--_text-3); font-variant-numeric: tabular-nums; }
|
|
560
|
+
.bpp-cv-msg { margin: 0; font-size: 0.75rem; color: var(--_text-1); line-height: 1.45; }
|
|
561
|
+
.bpp-cv-fix { margin: 0; font-size: 0.75rem; color: var(--_text-2); line-height: 1.45; }
|
|
562
|
+
.bpp-cv-fix-label { font-weight: 700; color: var(--_sev-ok); }
|
|
563
|
+
.bpp-cv-jump {
|
|
564
|
+
align-self: flex-start; margin-top: 2px; padding: 3px 8px; border: 1px solid var(--_divider);
|
|
565
|
+
border-radius: var(--_radius-sm); background: var(--_bg-soft); color: var(--_brand);
|
|
566
|
+
font: inherit; font-size: 0.6875rem; font-weight: 600; cursor: pointer;
|
|
567
|
+
}
|
|
568
|
+
.bpp-cv-jump:hover { background: var(--_brand-soft); }
|
|
569
|
+
|
|
570
|
+
/* On-page markers (issues heatmap) + selection. */
|
|
571
|
+
.bpp-cv-mark { position: absolute; box-sizing: border-box; border-radius: 1px; border: 1px solid transparent; }
|
|
572
|
+
.bpp-cv-mark-error { background: color-mix(in srgb, var(--_sev-error) 12%, transparent); border-color: color-mix(in srgb, var(--_sev-error) 55%, transparent); }
|
|
573
|
+
.bpp-cv-mark-warning { background: color-mix(in srgb, var(--_sev-warning) 12%, transparent); border-color: color-mix(in srgb, var(--_sev-warning) 55%, transparent); }
|
|
574
|
+
.bpp-cv-mark-info { background: color-mix(in srgb, var(--_sev-info) 10%, transparent); border-color: color-mix(in srgb, var(--_sev-info) 45%, transparent); }
|
|
575
|
+
.bpp-cv-sel { position: absolute; box-sizing: border-box; border-radius: 1px; background: color-mix(in srgb, var(--_brand) 16%, transparent); border: 2px solid var(--_brand); }
|
|
576
|
+
.bpp-cv-sel-error { background: color-mix(in srgb, var(--_sev-error) 20%, transparent); border-color: var(--_sev-error); }
|
|
577
|
+
.bpp-cv-sel-warning { background: color-mix(in srgb, var(--_sev-warning) 20%, transparent); border-color: var(--_sev-warning); }
|
|
578
|
+
.bpp-cv-sel-info { background: color-mix(in srgb, var(--_sev-info) 18%, transparent); border-color: var(--_sev-info); }
|
|
579
|
+
|
|
580
|
+
/* \u2500\u2500 Custom Scrollbars \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
581
|
+
/* scrollbar-color is inherited. Set it on the previewer root so nested plugin
|
|
582
|
+
scrollers (such as the accessibility inspector) cannot inherit the host
|
|
583
|
+
document's scrollbar theme through the shadow host. */
|
|
584
|
+
.bpp-styled-scrollbars {
|
|
585
|
+
scrollbar-color: var(--_divider) transparent;
|
|
586
|
+
}
|
|
587
|
+
`;function gt(s,n){return s.replace(/\bid="([^"]+)"/g,(o,i)=>`id="${n}${i}"`).replace(/url\(#([^)]+)\)/g,(o,i)=>`url(#${n}${i})`).replace(/\b(xlink:href|href)="#([^"]+)"/g,(o,i,l)=>`${i}="#${n}${l}"`)}function ht(s,n){let o=n.showThumbnails,i=n.toolbar,l=[];i.thumbnails&&l.push(`<div class="bpp-group" role="group" aria-label="Page thumbnails">
|
|
588
|
+
<button type="button" class="bpp-btn${o?" bpp-btn-active":""}" data-toggle-thumbs
|
|
589
|
+
aria-label="Toggle page thumbnails" aria-pressed="${o}"
|
|
590
|
+
title="${o?"Hide":"Show"} page thumbnails">
|
|
591
|
+
${re("panel-left-close","bpp-icon bpp-icon-thumbs-open")}
|
|
592
|
+
${re("panel-left","bpp-icon bpp-icon-thumbs-closed")}
|
|
593
|
+
</button>
|
|
594
|
+
</div>`),i.pageNav&&l.push(`<div class="bpp-group" role="group" aria-label="Page navigation">
|
|
595
|
+
<button type="button" class="bpp-btn" data-prev aria-label="Previous page" title="Previous page" disabled>
|
|
596
|
+
${re("chevron-left")}
|
|
597
|
+
</button>
|
|
598
|
+
<span class="bpp-pages-label" data-page-label role="status" aria-label="Page 1">
|
|
599
|
+
<span class="bpp-page-current" aria-hidden="true" data-current-page>0</span>
|
|
600
|
+
<span class="bpp-page-sep" aria-hidden="true">/</span>
|
|
601
|
+
<span class="bpp-page-total" aria-hidden="true" data-total-pages>0</span>
|
|
602
|
+
</span>
|
|
603
|
+
<button type="button" class="bpp-btn" data-next aria-label="Next page" title="Next page" disabled>
|
|
604
|
+
${re("chevron-right")}
|
|
605
|
+
</button>
|
|
606
|
+
</div>`),i.zoom&&l.push(`<div class="bpp-group" role="group" aria-label="Zoom">
|
|
607
|
+
<button type="button" class="bpp-btn" data-zoom-out aria-label="Zoom out" title="Zoom out">
|
|
608
|
+
${re("zoom-out")}
|
|
609
|
+
</button>
|
|
610
|
+
<select class="bpp-zoom" data-zoom-select aria-label="Zoom level" title="Zoom level">
|
|
611
|
+
<option value="fit-page">Fit page</option>
|
|
612
|
+
<option value="fit-width">Fit width</option>
|
|
613
|
+
<option value="custom" data-custom-zoom hidden>100%</option>
|
|
614
|
+
<option value="0.5">50%</option>
|
|
615
|
+
<option value="0.75">75%</option>
|
|
616
|
+
<option value="1">100%</option>
|
|
617
|
+
<option value="1.25">125%</option>
|
|
618
|
+
<option value="1.5">150%</option>
|
|
619
|
+
<option value="2">200%</option>
|
|
620
|
+
<option value="3">300%</option>
|
|
621
|
+
</select>
|
|
622
|
+
<button type="button" class="bpp-btn" data-zoom-in aria-label="Zoom in" title="Zoom in">
|
|
623
|
+
${re("zoom-in")}
|
|
624
|
+
</button>
|
|
625
|
+
</div>`),i.fullscreen&&l.push(`<div class="bpp-group" role="group" aria-label="Preview display">
|
|
626
|
+
<button type="button" class="bpp-btn" data-fullscreen aria-label="Full screen" aria-pressed="false" title="Full screen">
|
|
627
|
+
${re("maximize","bpp-icon bpp-icon-fullscreen-open")}
|
|
628
|
+
${re("minimize","bpp-icon bpp-icon-fullscreen-close")}
|
|
629
|
+
<span class="bpp-fullscreen-label">Exit Fullscreen</span>
|
|
630
|
+
</button>
|
|
631
|
+
</div>`),i.download&&l.push(`<div class="bpp-group" role="group" aria-label="Download">
|
|
632
|
+
<button type="button" class="bpp-btn bpp-btn-download" data-download aria-label="Download PDF" title="Download PDF" disabled>
|
|
633
|
+
${re("download")}
|
|
634
|
+
<span class="bpp-btn-label">Download PDF</span>
|
|
635
|
+
</button>
|
|
636
|
+
</div>`);let N=l.join('<div class="bpp-sep" role="separator" aria-hidden="true"></div>');s.innerHTML=`
|
|
637
|
+
<style>${ft}</style>
|
|
638
|
+
<div class="bpp${n.hideBorder?" bpp-no-border":""}${n.styleScrollbars?" bpp-styled-scrollbars":""}" part="container" role="region" aria-label="${mt(n.title)}">
|
|
639
|
+
<div class="bpp-toolbar" role="toolbar" aria-label="Document preview controls">
|
|
640
|
+
${N}
|
|
641
|
+
<div class="bpp-group bpp-group-end" role="group" aria-label="Inspector" data-toolbar-end></div>
|
|
642
|
+
</div>
|
|
643
|
+
<div class="bpp-body">
|
|
644
|
+
<nav class="bpp-thumbs" aria-label="Page thumbnails" data-thumbs${o?"":" hidden"}>
|
|
645
|
+
<ul class="bpp-thumbs-list" data-thumbs-list></ul>
|
|
646
|
+
</nav>
|
|
647
|
+
<div class="bpp-scroll" data-scroll tabindex="0">
|
|
648
|
+
<div class="bpp-pages" data-pages></div>
|
|
649
|
+
</div>
|
|
650
|
+
</div>
|
|
651
|
+
${Nt(n.footer)}
|
|
652
|
+
<div class="bpp-loading" data-loading role="status" aria-live="polite">
|
|
653
|
+
<span class="bpp-spinner" aria-hidden="true"></span>
|
|
654
|
+
<span>Generating preview\u2026</span>
|
|
655
|
+
</div>
|
|
656
|
+
<div class="bpp-error" data-error role="alert" hidden>
|
|
657
|
+
<span class="bpp-error-title">The preview could not be generated.</span>
|
|
658
|
+
<span class="bpp-error-detail" data-error-detail></span>
|
|
659
|
+
</div>
|
|
660
|
+
</div>`;}function mt(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}function Nt(s){return s?`<footer class="bpp-footer" data-footer aria-label="Document conformance">
|
|
661
|
+
<span class="bpp-footer-text">${mt(s.text)}</span>
|
|
662
|
+
<div class="bpp-footer-tags" data-footer-tags></div>
|
|
663
|
+
</footer>`:""}function vt(s){return Number.isFinite(s.left)&&Number.isFinite(s.top)&&Number.isFinite(s.right)&&Number.isFinite(s.bottom)&&s.width>0&&s.height>0}function Rt(s,n){let o=s.top+s.height/2,i=n.top+n.height/2,l=Math.max(1,Math.min(s.height,n.height)*.35);return Math.abs(o-i)<=l}function zt(s){let n=s.filter(i=>i.width>0&&i.height>0).map(i=>({...i})).sort((i,l)=>i.top-l.top||i.left-l.left),o=[];for(let i of n){let l=o.at(-1);if(l&&Rt(l,i)){let c=l.left+l.width,N=i.left-c,L=Math.max(2,Math.max(l.height,i.height)*1.25);if(N<=L){let A=Math.min(l.left,i.left),H=Math.min(l.top,i.top),j=Math.max(c,i.left+i.width),P=Math.max(l.top+l.height,i.top+i.height);l.left=A,l.top=H,l.width=j-A,l.height=P-H;continue}}o.push(i);}return o}function $t(s,n){try{let o=s.createRange();return o.setStart(n.startContainer,n.startOffset),o.setEnd(n.endContainer,n.endOffset),o}catch{return null}}function Dt(s,n){let o=n.getSelection();if(s instanceof ShadowRoot&&o){if(typeof o.getComposedRanges=="function")try{let l=o.getComposedRanges({shadowRoots:[s]}).map(c=>$t(n,c)).filter(c=>c!==null&&!c.collapsed);if(l.length>0)return l}catch{}let i=s.getSelection?.();if(i&&!i.isCollapsed)return Array.from({length:i.rangeCount},(l,c)=>i.getRangeAt(c)).filter(l=>!l.collapsed)}return !o||o.isCollapsed?[]:Array.from({length:o.rangeCount},(i,l)=>o.getRangeAt(l)).filter(i=>!i.collapsed)}function Ot(s,n){return s.right>n.left&&s.left<n.right&&s.bottom>n.top&&s.top<n.bottom}function Ft(s,n){if(n.contains(s.commonAncestorContainer))return true;try{return s.intersectsNode(n)}catch{return false}}function Bt(s,n){let o=n.getBoundingClientRect();if(!vt(o))return [];let i=[];for(let l of s){if(!vt(l)||!Ot(l,o))continue;let c=Math.max(l.left,o.left),N=Math.max(l.top,o.top),L=Math.min(l.right,o.right),A=Math.min(l.bottom,o.bottom);L<=c||A<=N||i.push({left:c-o.left,top:N-o.top,width:L-c,height:A-N});}return zt(i)}function Vt(s){for(let n of s)n.querySelector(":scope > .bpp-selection-layer")?.remove();}function wt(s){let{root:n,ownerDocument:o,pageElements:i,signal:l}=s,c=0,N=()=>Vt(i),L=()=>{if(c=0,l.aborted)return;let H=Dt(n,o);if(H.length===0){N();return}let j=[];for(let P of H)if(!(P.toString().length===0||typeof P.getClientRects!="function"))try{j.push({range:P,rects:Array.from(P.getClientRects())});}catch{}for(let P of i){let le=j.filter(({range:B})=>Ft(B,P)).flatMap(({rects:B})=>B),ue=Bt(le,P),F=P.querySelector(":scope > .bpp-selection-layer");if(ue.length===0){F?.remove();continue}F||(F=o.createElement("div"),F.className="bpp-selection-layer",F.setAttribute("aria-hidden","true"),P.appendChild(F));let ke=ue.map(B=>{let K=o.createElement("span");return K.className="bpp-selection-rect",K.style.left=`${B.left}px`,K.style.top=`${B.top}px`,K.style.width=`${B.width}px`,K.style.height=`${B.height}px`,K});F.replaceChildren(...ke);}},A=()=>{if(l.aborted||c!==0)return;let H=o.defaultView?.requestAnimationFrame;H?c=H.call(o.defaultView,L):L();};return o.addEventListener("selectionchange",A,{signal:l}),n.addEventListener("selectionchange",A,{signal:l}),n.addEventListener("pointerup",A,{signal:l}),n.addEventListener("pointermove",H=>{H.buttons===1&&A();},{signal:l}),n.addEventListener("keyup",A,{signal:l}),l.addEventListener("abort",()=>{c!==0&&o.defaultView?.cancelAnimationFrame?.(c),c=0,N();},{once:true}),{refresh:A,clear:N}}var st=24,xt=1.25,yt=.1,Et=5,jt="1500px 0px",Wt="800px 0px",Ye=200,lt=640,Gt=320,Ne=s=>Math.min(Math.max(s,yt),Et),Je=new WeakMap;function pt(s,n){return {value:s.style.getPropertyValue(n),priority:s.style.getPropertyPriority(n)}}function dt(s,n,o){o.value?s.style.setProperty(n,o.value,o.priority):s.style.removeProperty(n);}function Ut(s,n){let o=Je.get(s);if(!o){let i=s.body;o={owners:new Set,documentElement:s.documentElement,documentElementOverflow:pt(s.documentElement,"overflow"),documentElementScrollbarGutter:pt(s.documentElement,"scrollbar-gutter"),body:i,bodyOverflow:i?pt(i,"overflow"):null},Je.set(s,o);}o.owners.has(n)||(o.owners.add(n),o.documentElement.style.setProperty("overflow","hidden"),o.documentElement.style.setProperty("scrollbar-gutter","auto"),o.body?.style.setProperty("overflow","hidden"));}function Zt(s,n){let o=Je.get(s);o&&(o.owners.delete(n),!(o.owners.size>0)&&(dt(o.documentElement,"overflow",o.documentElementOverflow),dt(o.documentElement,"scrollbar-gutter",o.documentElementScrollbarGutter),o.body&&o.bodyOverflow&&dt(o.body,"overflow",o.bodyOverflow),Je.delete(s)));}function Lt(s,n={}){let o={plugins:n.plugins??[],showThumbnails:n.showThumbnails??false,showInspector:n.showInspector,initialZoom:n.initialZoom,onViewStateChange:n.onViewStateChange??(()=>{}),fitMode:n.fitMode??"fit-page",title:n.title??"PDF preview",downloadFilename:n.downloadFilename??"document.pdf",hideBorder:n.hideBorder??false,styleScrollbars:n.styleScrollbars??false,selectionColor:n.selectionColor?.trim()||void 0,footer:n.footer?{text:n.footer.text??"Generated by @bonniepdf/previewer",conformance:n.footer.conformance??true}:void 0,toolbar:{thumbnails:n.toolbar?.thumbnails??true,pageNav:n.toolbar?.pageNav??true,zoom:n.toolbar?.zoom??true,fullscreen:n.toolbar?.fullscreen??true,download:n.toolbar?.download??true}};ht(s,o),o.selectionColor&&s.querySelector(".bpp")?.style.setProperty("--bpdf-selection",o.selectionColor);let i=s instanceof ShadowRoot?s.host:s,l=i.ownerDocument,c=a=>s.querySelector(a),N=new AbortController,L=[],A=null,H=false,j=null,P=0,le=false,ue=null,F=o.plugins,ke=[],B=[],K=[],W=()=>1,ae=()=>{},G=[],Q=null,D=false,x=null,k=null,te=null,se=null,R=null,V=null,ne=o.showThumbnails,he=o.initialZoom?.mode==="custom"?{mode:"custom",scale:Ne(o.initialZoom.scale??1)}:{mode:o.initialZoom?.mode??o.fitMode};function Me(){o.onViewStateChange({showThumbnails:ne,showInspector:D,zoom:{...he}});}let Re={error:3,warning:2,info:1,ok:0};function Qe(){if(!V)return;let a=null;for(let p of G)p.badgeTone&&(a===null||Re[p.badgeTone]>Re[a])&&(a=p.badgeTone);a&&a!=="ok"?(V.hidden=false,V.className=`bpp-side-toggle-dot bpp-side-toggle-dot-${a}`):V.hidden=true;}function ze(){te&&(te.hidden=G.length<2);}function Ge(){D=true,x&&(x.hidden=false),k&&(k.hidden=false),R?.setAttribute("aria-pressed","true"),R?.classList.add("bpp-btn-active"),Me();}function xe(){D=false,x&&(x.hidden=true),k&&(k.hidden=true),R?.setAttribute("aria-pressed","false"),R?.classList.remove("bpp-btn-active"),G.find(a=>a.id===Q)?.onVisibilityChange?.(false),Me();}function ye(a){if(!a)return;let p=G.find(v=>v.id===a);if(!p||D&&Q===a)return;let b=Q;if(D||Ge(),b&&b!==a){let v=G.find(S=>S.id===b);v&&(v.element.hidden=true,v.tabBtn.setAttribute("aria-selected","false"),v.tabBtn.classList.remove("bpp-side-tab-active"),v.onVisibilityChange?.(false));}Q=a,p.element.hidden=false,p.tabBtn.setAttribute("aria-selected","true"),p.tabBtn.classList.add("bpp-side-tab-active"),p.onVisibilityChange?.(true);}function oe(a){let p=c(".bpp-body")?.clientWidth??0,b=p>0?p-Gt:lt,v=Math.max(Ye,Math.min(lt,b));return Math.min(Math.max(a,Ye),v)}function Ce(a){if(!x)return;let p=oe(a);x.style.width=`${p}px`,k?.setAttribute("aria-valuenow",String(Math.round(p)));}function $e(a){let p=false,b=0,v=0;a.addEventListener("pointerdown",m=>{x&&(p=true,b=m.clientX,v=x.getBoundingClientRect().width,a.setPointerCapture(m.pointerId),a.classList.add("bpp-side-resizer-active"),m.preventDefault());}),a.addEventListener("pointermove",m=>{p&&Ce(v+(b-m.clientX));});let S=m=>{p&&(p=false,a.hasPointerCapture(m.pointerId)&&a.releasePointerCapture(m.pointerId),a.classList.remove("bpp-side-resizer-active"));};a.addEventListener("pointerup",S),a.addEventListener("pointercancel",S),a.addEventListener("keydown",m=>{if(!x)return;let O=m.shiftKey?48:16,T=x.getBoundingClientRect().width;m.key==="ArrowLeft"?(Ce(T+O),m.preventDefault()):m.key==="ArrowRight"&&(Ce(T-O),m.preventDefault());});}function _e(){x||(x=l.createElement("aside"),x.className="bpp-side",x.hidden=true,x.setAttribute("aria-label","Inspector"),te=l.createElement("div"),te.className="bpp-side-tabs",te.setAttribute("role","tablist"),te.hidden=true,se=l.createElement("div"),se.className="bpp-side-body",x.append(te,se),k=l.createElement("div"),k.className="bpp-side-resizer",k.hidden=true,k.setAttribute("role","separator"),k.setAttribute("aria-orientation","vertical"),k.setAttribute("aria-label","Resize inspector panel"),k.setAttribute("aria-valuemin",String(Ye)),k.setAttribute("aria-valuemax",String(lt)),k.setAttribute("aria-valuenow",String(Ye)),k.tabIndex=0,$e(k),c(".bpp-body")?.append(k,x),R=l.createElement("button"),R.type="button",R.className="bpp-btn bpp-side-toggle",R.title="Toggle inspector panel",R.setAttribute("aria-label","Toggle inspector panel"),R.setAttribute("aria-pressed","false"),R.innerHTML=re("panel-right","bpp-icon"),V=l.createElement("span"),V.className="bpp-side-toggle-dot",V.hidden=true,R.append(V),R.addEventListener("click",()=>{D?xe():ye(Q??G[0]?.id??null);}),(c("[data-toolbar-end]")??c(".bpp-toolbar"))?.append(R));}let Ue={ownerDocument:l,hostElement:i,addToolbarItem(a){(c("[data-toolbar-end]")??c(".bpp-toolbar"))?.append(a);},addSidePanel({id:a,label:p,element:b,defaultOpen:v,onVisibilityChange:S}){_e();let m=l.createElement("button");m.type="button",m.className="bpp-side-tab",m.setAttribute("role","tab"),m.setAttribute("aria-selected","false");let O=l.createElement("span");O.className="bpp-side-tab-label",O.textContent=p;let T=l.createElement("span");T.className="bpp-side-tab-badge",T.hidden=true,m.append(O,T),m.addEventListener("click",()=>ye(a)),b.dataset.sidePanel=a,b.hidden=true,se.append(b);let ie={id:a,label:p,element:b,tabBtn:m,badgeEl:T,onVisibilityChange:S,badgeTone:null};return G.push(ie),G.sort((M,X)=>M.label.localeCompare(X.label,void 0,{sensitivity:"base"})),te.replaceChildren(...G.map(M=>M.tabBtn)),ze(),(o.showInspector??v)&&!D&&Q===null&&ye(a),{setVisible(M){M?ye(a):Q===a&&D&&xe();},setBadge(M,X="info"){M==null||M===""?(T.hidden=true,T.textContent="",ie.badgeTone=null):(T.hidden=false,T.textContent=M,T.className=`bpp-side-tab-badge bpp-side-tab-badge-${X}`,ie.badgeTone=X),Qe();}}},pageElement:a=>B[a]??null,overlayFor(a){let p=B[a];if(!p)return null;let b=K[a];return b||(b=l.createElement("div"),b.className="bpp-overlay",p.append(b),K[a]=b),b},scale:()=>W(),pageCount:()=>B.length,scrollToPage:a=>ae(a)};for(let a of F)try{let p=a.setup?.(Ue);p&&ke.push(p);}catch(p){console.error(`[bonniepdf-previewer] plugin "${a.name}" setup failed`,p);}function et(a){let p=c("[data-footer-tags]");if(!p)return;let b=[];if(o.footer?.conformance){let v=a?/^PdfA(\d)([a-e])$/i.exec(a.conformance.trim()):null;v&&b.push(`PDF/A-${v[1]}${v[2]}`),a?.accessibilityMode===1&&b.push("PDF/UA-1");}p.replaceChildren(...b.map(v=>{let S=l.createElement("span");return S.className="bpp-footer-tag",S.textContent=v,S}));}let De=F.some(a=>a.needsLayout===true),Ze=n.downloadFilename;function Te(){ue&&(URL.revokeObjectURL(ue),ue=null);}function qe(){let a=c(".bpp"),p=c("[data-error]");if(p&&(p.hidden=true),le)a?.classList.add("bpp-busy"),a?.setAttribute("aria-busy","true");else {let b=c("[data-loading]");b&&(b.hidden=false);}}function Ae(){let a=c(".bpp");a?.classList.remove("bpp-busy"),a?.removeAttribute("aria-busy");let p=c("[data-loading]");p&&(p.hidden=true);let b=c("[data-error]");b&&(b.hidden=true);}function He(a){Ae();let p=c("[data-error]");if(!p)return;p.classList.toggle("bpp-error-banner",le);let b=p.querySelector("[data-error-detail]");b&&(b.textContent=a instanceof Error?a.message:String(a)),p.hidden=false;}function Ke(a,p){if(Array.isArray(a)){if(H)return;P++;let b=p??{};h(a,{fontFaceCss:b.fontFaceCss,snapshot:b.snapshot,report:b.report,filename:b.downloadFilename??o.downloadFilename,pdf:b.pdfUrl??b.pdfProvider,legacyDownload:true});return}return Oe(a,p??{})}async function Oe(a,p){if(H)return;let b=++P,v=()=>b===P&&!H;qe();try{let S=await a;if(!v())return;let m,O=p.pdf,T;if(qt(S)){if(m=await S.generateSvgDocumentAsync({captureLayout:De}),!v())return;O??=()=>S.generateBytesAsync(),T=S.metadata?.title;}else if(Kt(S))m=S;else throw new TypeError("load() expects a BonniePDF Document, an SVG document export, or a promise of either.");T??=m.snapshot?.meta?.title,h(at(m.pages),{fontFaceCss:m.fontFaceCss,snapshot:m.snapshot,report:m.report,filename:p.downloadFilename??Ze??Xt(T)??o.downloadFilename,pdf:O});}catch(S){if(!v())return;throw He(S),i.dispatchEvent(new CustomEvent("bpp-load-error",{detail:{error:S},bubbles:true,composed:true})),S}}function h(a,p){if(H)return;Te(),N.abort(),N=new AbortController;for(let u of L)u.disconnect();L=[],Fe();let b=N.signal;Ee(p.fontFaceCss);let v=c("[data-scroll]"),S=c("[data-pages]"),m=c("[data-thumbs]"),O=c("[data-thumbs-list]"),T=u=>a[u].svg,ie=[],$=[],M=a.map((u,y)=>{let I=l.createElement("li"),z=l.createElement("button");z.type="button",z.className=`bpp-thumb${y===0?" bpp-thumb-active":""}`,z.setAttribute("aria-label",`Go to page ${y+1}`),y===0&&z.setAttribute("aria-current","page"),z.dataset.thumb=String(y+1),$.push(z);let Pe=l.createElement("span");Pe.className="bpp-thumb-canvas",Pe.setAttribute("aria-hidden","true"),Pe.style.aspectRatio=`${u.width} / ${u.height}`,ie.push(Pe);let ge=l.createElement("span");return ge.className="bpp-thumb-label",ge.textContent=String(y+1),z.append(Pe,ge),I.append(z),I}),X=[],ee=a.map((u,y)=>{let I=l.createElement("div");I.className="bpp-page",I.dataset.pageIndex=String(y),I.style.width=`${u.width}px`,I.style.height=`${u.height}px`;let z=l.createElement("div");return z.className="bpp-page-canvas",I.append(z),X.push(z),I});O.replaceChildren(...M),S.replaceChildren(...ee),Be(X,T,u=>`p${u}-`,v,jt),Be(ie,T,u=>`t${u}-`,m,Wt,true);let be=wt({root:s,ownerDocument:l,pageElements:ee,signal:b}),U=he.mode,fe=he.mode==="custom"?Ne(he.scale??1):1,Z=1,Le={width:v.clientWidth,height:v.clientHeight},pe=a.length,Ve=c(".bpp"),e=c("[data-toggle-thumbs]"),t=c("[data-prev]"),r=c("[data-next]"),f=c("[data-zoom-out]"),d=c("[data-zoom-in]"),g=c("[data-zoom-select]"),C=c("[data-custom-zoom]"),w=c("[data-current-page]"),E=c("[data-total-pages]"),q=c("[data-page-label]"),Y=c("[data-fullscreen]"),de=c("[data-download]"),J=Ve?.classList.contains("bpp-fullscreen")??false,_=null,ce=()=>{if(U==="custom")return fe;let u=a[Z-1]??a[0];if(!u||Le.width===0)return 1;let y=Math.max(Le.width-st*2,1)/u.width;return U==="fit-width"?y:Math.min(y,Math.max(Le.height-st*2,1)/u.height)},ve=(u=ce())=>{e?.classList.toggle("bpp-btn-active",ne),e?.setAttribute("aria-pressed",String(ne)),e?.setAttribute("title",ne?"Hide page thumbnails":"Show page thumbnails"),w&&(w.textContent=String(Z)),q?.setAttribute("aria-label",`Page ${Z} of ${pe}`),t&&(t.disabled=Z<=1),r&&(r.disabled=Z>=pe),f&&(f.disabled=u<=yt),d&&(d.disabled=u>=Et),Y&&(Y.classList.toggle("bpp-btn-active",J),Y.setAttribute("aria-pressed",String(J)),Y.setAttribute("aria-label",J?"Exit full screen":"Full screen"),Y.setAttribute("title",J?"Exit full screen":"Full screen")),g&&(C&&(C.textContent=`${Math.round(u*100)}%`,C.hidden=U!=="custom"),g.value=U),$.forEach((y,I)=>{let z=I+1===Z;y.classList.toggle("bpp-thumb-active",z),z?y.setAttribute("aria-current","page"):y.removeAttribute("aria-current");});},Se=()=>{let u=ce();ee.forEach((y,I)=>{let z=a[I];z&&(y.style.width=`${z.width*u}px`,y.style.height=`${z.height*u}px`);}),be.refresh(),ve(u);for(let y of F)try{y.sync?.({scale:u,currentPage:Z});}catch(I){console.error(`[bonniepdf-previewer] plugin "${y.name}" sync failed`,I);}},nt=()=>{he=U==="custom"?{mode:U,scale:fe}:{mode:U},J&&(_=null),Me();},kt=()=>{try{return i.matches(":popover-open")}catch{return false}},we=l.fullscreenElement===i?"native":kt()?"popover":null,ot=u=>{if(u===J)return;u?(_=U==="custom"?{mode:U,scale:fe}:{mode:U},U="fit-page"):_&&(U=_.mode,_.mode==="custom"&&(fe=Ne(_.scale??1)),_=null),J=u,J?Ut(l,i):Zt(l,i),Ve?.classList.toggle("bpp-fullscreen",J),Le={width:v.clientWidth,height:v.clientHeight},ve();let y=l.defaultView;typeof y?.requestAnimationFrame=="function"?y.requestAnimationFrame(()=>{Le={width:v.clientWidth,height:v.clientHeight},Se();}):Se();},Tt=()=>{if(we==="popover"){try{i.hidePopover?.();}catch{}i.removeAttribute("popover"),i.classList.remove("bpp-popover-host"),we=null;}else we==="native"&&l.fullscreenElement===i&&l.exitFullscreen?.().catch(()=>{});},Mt=()=>{let u=i;if(typeof u.showPopover=="function")try{i.classList.add("bpp-popover-host"),i.setAttribute("popover","manual"),u.showPopover(),we="popover";return}catch{i.removeAttribute("popover"),i.classList.remove("bpp-popover-host");}typeof i.requestFullscreen=="function"&&(we="native",i.requestFullscreen().catch(()=>{we=null;}));},rt=u=>{ot(u),u?Mt():Tt();};j=()=>{J&&rt(false);};let bt=u=>{Z=Math.min(Math.max(u,1),pe),ve();},je=u=>{let y=Math.min(Math.max(u,1),pe),I=ee[y-1];if(!I||(bt(y),typeof v.scrollTo!="function"))return;let z=I.getBoundingClientRect().top-v.getBoundingClientRect().top;v.scrollTo({top:Math.max(v.scrollTop+z-st,0),behavior:"smooth"});};if(typeof ResizeObserver<"u"){let u=new ResizeObserver(()=>{Le={width:v.clientWidth,height:v.clientHeight},Se();});u.observe(v),L.push(u);}if(typeof IntersectionObserver<"u"){let u=new Map,y=new IntersectionObserver(I=>{for(let ge of I){let it=Number(ge.target.dataset.pageIndex);u.set(it,ge.isIntersecting?ge.intersectionRatio:0);}let z=-1,Pe=0;u.forEach((ge,it)=>{ge>Pe&&(z=it,Pe=ge);}),z>=0&&bt(z+1);},{root:v,threshold:[.1,.25,.5,.75,1]});ee.forEach(I=>y.observe(I)),L.push(y);}e?.addEventListener("click",()=>{ne=!ne,m&&(m.hidden=!ne),Se(),Me();},{signal:b}),t?.addEventListener("click",()=>je(Z-1),{signal:b}),r?.addEventListener("click",()=>je(Z+1),{signal:b}),$.forEach(u=>u.addEventListener("click",()=>je(Number(u.dataset.thumb)),{signal:b})),v.addEventListener("click",u=>{let y=u.target?.closest?.("[data-bp-link-page]");if(!y)return;let I=Number(y.getAttribute("data-bp-link-page"));Number.isFinite(I)&&I>=1&&je(I);},{signal:b}),f?.addEventListener("click",()=>{fe=Ne(ce()/xt),U="custom",Se(),nt();},{signal:b}),d?.addEventListener("click",()=>{fe=Ne(ce()*xt),U="custom",Se(),nt();},{signal:b}),g?.addEventListener("change",()=>{let u=g.value;u==="fit-page"||u==="fit-width"?U=u:u!=="custom"&&(fe=Ne(Number(u)),U="custom"),Se(),nt();},{signal:b}),Y?.addEventListener("click",()=>rt(!J),{signal:b}),l.addEventListener("fullscreenchange",()=>{l.fullscreenElement===i?(we="native",J||ot(true)):we==="native"&&(we=null,J&&ot(false));},{signal:b}),l.addEventListener("keydown",u=>{u.key==="Escape"&&J&&rt(false);},{signal:b});let Ct=p.filename,Ie=p.pdf,_t=P,We;if(de&&(de.disabled=Ie===void 0,p.legacyDownload||Yt(de,Ie!==void 0)),de?.addEventListener("click",async()=>{if(!We&&Ie!==void 0){de.disabled=true;try{let u=typeof Ie=="function"?await Ie():Ie;if(typeof u=="string")We=u;else {let y=URL.createObjectURL(u instanceof Blob?u:new Blob([u],{type:"application/pdf"}));if(_t!==P||H){URL.revokeObjectURL(y);return}ue=y,We=y;}}catch{}finally{de.disabled=false;}}We&&Jt(l,We,Ct);},{signal:b}),E&&(E.textContent=String(pe)),w&&(w.textContent=pe>0?"1":"0"),m&&(m.hidden=!ne),Ae(),le=true,et(p.snapshot?.meta),B=ee,K=new Array(a.length).fill(null),W=ce,ae=je,F.length>0){let u={...Ue,pages:a,snapshot:p.snapshot,report:p.report};for(let y of F)try{y.load?.(u);}catch(I){console.error(`[bonniepdf-previewer] plugin "${y.name}" load failed`,I);}}Se();}function Fe(){for(let a of F)try{a.teardown?.();}catch(p){console.error(`[bonniepdf-previewer] plugin "${a.name}" teardown failed`,p);}K=[];}function Xe(a){if(H)return false;let p=false;for(let b of F)try{b.selectSnapshotNode?.(a)&&(p=!0);}catch(v){console.error(`[bonniepdf-previewer] plugin "${b.name}" selection failed`,v);}return p}function Be(a,p,b,v,S,m=false){let O=new Map,T=($,M)=>{if($.dataset.mounted==="true")return;let X=O.get(M);if(X===void 0&&(X=gt(p(M),b(M)),O.set(M,X)),$.innerHTML=X,m){let ee=$.querySelector("svg");ee&&ee.setAttribute("aria-hidden","true");for(let be of $.querySelectorAll("a"))be.removeAttribute("href"),be.removeAttribute("xlink:href"),be.removeAttribute("target"),be.setAttribute("tabindex","-1");}$.dataset.mounted="true";},ie=$=>{$.dataset.mounted==="true"&&($.replaceChildren(),$.dataset.mounted="false");};if(a.forEach(($,M)=>{$.dataset.lazyIndex=String(M);}),a[0]&&T(a[0],0),v&&typeof IntersectionObserver<"u"){let $=new IntersectionObserver(M=>{for(let X of M){let ee=X.target,be=Number(ee.dataset.lazyIndex);X.isIntersecting?T(ee,be):ie(ee);}},{root:v,rootMargin:S});a.forEach(M=>$.observe(M)),L.push($);}else a.forEach(($,M)=>T($,M));}function Ee(a){a&&(A||(A=l.createElement("style"),A.setAttribute("data-bpp-fonts",""),l.head.appendChild(A)),A.textContent!==a&&(A.textContent=a));}function me(){if(H)return;P++,Te(),N.abort(),N=new AbortController;for(let ie of L)ie.disconnect();L=[],Fe(),le=false,c("[data-pages]")?.replaceChildren(),c("[data-thumbs-list]")?.replaceChildren();let a=c(".bpp");a?.classList.remove("bpp-busy"),a?.removeAttribute("aria-busy");let p=c("[data-error]");p&&(p.hidden=true);let b=c("[data-loading]");b&&(b.hidden=false);let v=c("[data-current-page]");v&&(v.textContent="0");let S=c("[data-total-pages]");S&&(S.textContent="0");let m=c("[data-prev]");m&&(m.disabled=true);let O=c("[data-next]");O&&(O.disabled=true);let T=c("[data-download]");T&&(T.disabled=true);}function tt(){if(!H){j?.(),j=null,H=true,Fe();for(let a of ke.splice(0))try{a();}catch{}N.abort();for(let a of L)a.disconnect();L=[],A&&(A.remove(),A=null),Te();}}return {load:Ke,selectSnapshotNode:Xe,clear:me,dispose:tt}}function qt(s){let n=s;return typeof n=="object"&&n!==null&&typeof n.generateSvgDocumentAsync=="function"&&typeof n.generateBytesAsync=="function"}function Kt(s){let n=s?.pages;return Array.isArray(n)&&n.every(o=>typeof o=="string")}function Xt(s){let n=(s??"").normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,80).replace(/-+$/,"");return n?`${n}.pdf`:void 0}function Yt(s,n){let o=s.closest(".bpp-group");if(!o)return;o.hidden=!n;let i=o.previousElementSibling;i instanceof HTMLElement&&i.classList.contains("bpp-sep")&&(i.hidden=!n);}function Jt(s,n,o){let i=s.createElement("a");i.href=n,i.download=o,i.rel="noopener",s.body.appendChild(i),i.click(),i.remove();}var St={error:3,warning:2,info:1},ct={error:"Error",warning:"Warning",info:"Info"},Qt={error:"circle-x",warning:"triangle-alert",info:"info"},en="WCAG";function Pt(s={}){let n=s.label??"Accessibility",o=s.issuesLabel??"Issues",i=s.openByDefault??false,l=s.markIssuesOnPage??true,c=Math.max(0,s.defaultExpandDepth??1/0),N=s.preferenceKey,L=null,A=null,H=null,j=null,P=null,le=false,ue=false,F=()=>le||ue,ke=Me(N),B=ke?.onlyIssues??s.onlyIssues??false,K=ke?.showWcag??s.showWcagChecks??true,W=new Map,ae=new Map,G=new Map,Q=new Map,D=new Set,x=null,k=null,te=null,se=[],R=[],V=null,ne=null;function he(e){return x?e.id===x.id?true:e.type==="Page"&&x.children.includes(e)&&x.sourceId!==void 0&&e.sourceId===x.sourceId:false}function Me(e){if(e)try{let t=globalThis.localStorage?.getItem(e);if(!t)return;let r=JSON.parse(t);return {onlyIssues:r.onlyIssues===!0,showWcag:r.showWcag!==!1}}catch{return}}function Re(){if(N)try{globalThis.localStorage?.setItem(N,JSON.stringify({onlyIssues:B,showWcag:K}));}catch{}}function Qe(e){return e.standard.toUpperCase().startsWith(en)}function ze(){return k?K?[...k.findings]:k.findings.filter(e=>!Qe(e)):[]}function Ge(){Q.clear();for(let e of ze()){if(!e.nodeId)continue;let t=Q.get(e.nodeId);t?t.push(e):Q.set(e.nodeId,[e]);}}function xe(e){let t=Q.get(e);if(!t||t.length===0)return null;let r="info";for(let f of t)St[f.severity]>St[r]&&(r=f.severity);return r}function ye(e,t,r){e.style.left=`${t.x*r}px`,e.style.top=`${t.y*r}px`,e.style.width=`${t.width*r}px`,e.style.height=`${t.height*r}px`;}function oe(e){for(let t of e)t.element.remove();e.length=0;}function Ce(e,t,r){if(L)for(let f of t.rects){let d=L.overlayFor(f.page);if(!d)continue;let g=L.ownerDocument.createElement("div");g.className=r,ye(g,f,L.scale()),d.append(g),e.push({element:g,rect:f});}}function $e(){if(oe(se),!l||!x)return;let e=t=>{let r=xe(t.id);r&&Ce(se,t,`bpp-cv-mark bpp-cv-mark-${r}`);for(let f of t.children)e(f);};e(x);}function _e(e){oe(R);let t=xe(e.id),r=t?`bpp-cv-sel bpp-cv-sel-${t}`:"bpp-cv-sel";Ce(R,e,r);}function Ue(e,t,r){if(!x)return null;let f=null,d=-1,g=1/0,C=(w,E)=>{for(let q of w.rects){if(q.page!==e||t<q.x||t>q.x+q.width||r<q.y||r>q.y+q.height)continue;let Y=q.width*q.height;(E>d||E===d&&Y<g)&&(f=w,d=E,g=Y);}for(let q of w.children)C(q,E+1);};return C(x,0),f}function et(){if(D.clear(),!x)return;let e=(t,r)=>{let f=xe(t.id)==="error";for(let d of t.children)e(d,r+1)&&(f=true);return t.children.length>0&&(r<c||f)&&D.add(t.id),f};e(x,0),B&&De();}function De(){for(let e of Q.keys())Ze(e);}function Ze(e){let t=G.get(e);for(;t;)D.add(t.id),t=G.get(t.id);}function Te(e,t){e.children.length!==0&&(t?D.add(e.id):D.delete(e.id),qe(e.id));}function qe(e){let t=W.get(e);if(!t)return;let r=t.parentElement?.querySelector(":scope > ul");if(!r)return;let f=D.has(e);t.setAttribute("aria-expanded",String(f)),r.hidden=!f;}function Ae(e){if(x){if(D.clear(),e){let t=r=>{r.children.length>0&&D.add(r.id);for(let f of r.children)t(f);};t(x);}else x.children.length>0&&D.add(x.id);pe();}}function He(e,t=false){if(!L)return;if(he(e)){V=null;for(let f of W.values())f.setAttribute("aria-selected","false");oe(R),O(null),t&&Ke(e.id);return}V=e.id;for(let[f,d]of W)d.setAttribute("aria-selected",String(f===e.id));_e(e),O(e),t&&Ke(e.id);let r=e.rects[0];r&&L.scrollToPage(r.page+1);}function Ke(e){Ze(e);let t=G.get(e);for(;t;)qe(t.id),t=G.get(t.id);let r=W.get(e);r&&(Ee(e),typeof r.scrollIntoView=="function"&&r.scrollIntoView({block:"nearest"}));}function Oe(e,t,r){L&&L.hostElement.dispatchEvent(new CustomEvent("bonniepdf-node-select",{bubbles:true,composed:true,detail:{nodeId:e.id,sourceId:e.sourceId,sourceNavigation:t,origin:r}}));}function h(e,t,r){let d=L.ownerDocument.createElement(e);return t&&(d.className=t),r!=null&&(d.textContent=r),d}function Fe(e){let t=e.rects[0];if(!t)return "";let r=[...new Set(e.rects.map(w=>w.page))].sort((w,E)=>w-E),f=r.length===1?`Page ${r[0]+1}`:`Pages ${r[0]+1}\u2013${r[r.length-1]+1}`,d=`${Math.round(t.width)}\xD7${Math.round(t.height)} pt`,g=`at ${Math.round(t.x)}, ${Math.round(t.y)}`,C=e.rects.length>1?` \xB7 ${e.rects.length} fragments`:"";return `${f} \xB7 ${d} ${g}${C}`}function Xe(e,t,r){let f=h("ul");f.setAttribute("role",t);for(let d of e){let g=xe(d.id),C=g!=null||p(d);if(B&&!C)continue;let w=h("li");w.setAttribute("role","none");let E=h("button","bpp-tree-row bpp-cv-row");E.type="button",E.setAttribute("role","treeitem"),E.setAttribute("aria-selected","false"),E.setAttribute("aria-level",String(r)),E.dataset.nodeId=d.id,E.tabIndex=-1;let q=d.children.length>0,Y=h("span",q?"bpp-tree-twisty":"bpp-tree-twisty bpp-tree-twisty-leaf");Y.setAttribute("aria-hidden","true"),E.append(Y);let de=d.a11y,J=de?.artifact?"Artifact":de?.role||(de?.tagged?"Tagged":"");if(J){let _=h("span","bpp-cv-role",J);J==="Artifact"?(_.classList.add("bpp-cv-role-artifact"),_.title="Artifact (outside the reading order)"):de?.tagged&&(_.classList.add("bpp-cv-role-tagged"),_.title="Tagged content",E.setAttribute("aria-description","Tagged content")),E.append(_);}if(E.append(h("span","bpp-tree-type",d.type)),g){let _=Q.get(d.id).length,ce=`${ct[g]}: ${_} ${_===1?"finding":"findings"}`,ve=h("span",`bpp-cv-issue-icon bpp-cv-issue-icon-${g}`);ve.setAttribute("role","img"),ve.setAttribute("aria-label",ce),ve.title=ce,ve.innerHTML=re(Qt[g]),E.append(ve);}if(d.name&&E.append(h("span","bpp-tree-name",d.name)),E.addEventListener("click",_=>{if(q&&_.target?.closest(".bpp-tree-twisty")){Te(d,!D.has(d.id)),Ee(d.id);return}Ee(d.id),He(d),Oe(d,he(d)||_.ctrlKey||_.metaKey,"tree");}),E.addEventListener("keydown",_=>tt(_,d)),E.addEventListener("focus",()=>Ee(d.id)),E.addEventListener("mouseenter",()=>{V!==d.id&&_e(d);}),E.addEventListener("mouseleave",()=>{if(V){let _=ae.get(V);_&&_e(_);}else oe(R);}),W.set(d.id,E),w.append(E),q){let _=Xe(d.children,"group",r+1);if(_.childElementCount>0){let ce=D.has(d.id);E.setAttribute("aria-expanded",String(ce)),_.hidden=!ce,w.append(_);}else Y.classList.add("bpp-tree-twisty-leaf");}f.append(w);}return f}function Be(){return Z?Array.from(Z.querySelectorAll(".bpp-tree-row")).filter(t=>{let r=t.parentElement;for(;r&&r!==Z;){if(r.tagName==="UL"&&r.hidden)return false;r=r.parentElement;}return true}):[]}function Ee(e){te=e;for(let[t,r]of W)r.tabIndex=t===e?0:-1;}function me(e){if(!e)return;let t=e.dataset.nodeId;t&&Ee(t),e.focus();}function tt(e,t){let r=Be(),f=W.get(t.id),d=f?r.indexOf(f):-1,g=t.children.length>0&&W.get(t.id)?.hasAttribute("aria-expanded")===true,C=D.has(t.id);switch(e.key){case "ArrowDown":e.preventDefault(),me(r[d+1]);break;case "ArrowUp":e.preventDefault(),me(r[d-1]);break;case "ArrowRight":e.preventDefault(),g&&!C?Te(t,true):g&&me(r[d+1]);break;case "ArrowLeft":{if(e.preventDefault(),g&&C){Te(t,false);break}let w=G.get(t.id);w&&me(W.get(w.id));break}case "Home":e.preventDefault(),me(r[0]);break;case "End":e.preventDefault(),me(r[r.length-1]);break;case "*":e.preventDefault(),Ae(true),me(W.get(t.id));break;}}function a(e){return /^H[1-6]$/.test(e)?"heading":e==="Figure"?"figure":e==="Artifact"?"artifact":e==="Table"||e==="TH"||e==="TD"||e==="TR"?"table":"default"}function p(e){for(let t of e.children)if(xe(t.id)||p(t))return true;return false}function b(e){for(let t of ae.values())if(e(t))return t;return null}function v(e){ae.clear(),G.clear();let t=r=>{ae.set(r.id,r);for(let f of r.children)G.set(f.id,r),t(f);};t(e);}function S(e,t){let r=h("div",`bpp-cv-finding bpp-cv-finding-${e.severity}`),f=h("div","bpp-cv-finding-head");f.append(h("span",`bpp-cv-badge bpp-cv-badge-${e.severity}`,ct[e.severity])),f.append(h("span","bpp-cv-clause",e.clause)),r.append(f);let d=e.nodeId?ae.get(e.nodeId):void 0;if(t&&d){let g=h("p","bpp-cv-finding-where");g.append(h("span","bpp-cv-finding-el",d.name?`${d.type} \u201C${d.name}\u201D`:d.type)),e.page!=null&&g.append(h("span","bpp-cv-finding-page",` \xB7 page ${e.page+1}`)),r.append(g);}if(r.append(h("p","bpp-cv-msg",e.message)),e.fixHint){let g=h("p","bpp-cv-fix");g.append(h("span","bpp-cv-fix-label","Fix: ")),g.append(L.ownerDocument.createTextNode(e.fixHint)),r.append(g);}if(t&&e.nodeId){let g=h("button","bpp-cv-jump","Go to element");g.type="button",g.addEventListener("click",C=>{let w=d??b(E=>E.id===e.nodeId);w&&(A?.setVisible(true),He(w,true),W.get(w.id)?.focus(),Oe(w,C.ctrlKey||C.metaKey,"finding"));}),r.append(g);}return r}let m=null;function O(e){if(!m)return;m.replaceChildren();let t=e?Q.get(e.id):void 0;if(!e){m.append(h("p","bpp-cv-empty","Select an element to see its accessibility details."));return}let r=h("div","bpp-cv-detail-head");r.append(h("span","bpp-cv-detail-type",e.type)),e.name&&r.append(h("span","bpp-cv-detail-name",e.name)),e.a11y?.role&&r.append(h("span",`bpp-cv-role bpp-cv-role-${a(e.a11y.role)}`,e.a11y.role)),m.append(r);let f=Fe(e);if(f&&m.append(h("p","bpp-cv-geom",f)),e.a11y?.alt&&m.append(h("p","bpp-cv-attr",`Alt: \u201C${e.a11y.alt}\u201D`)),!t||t.length===0){m.append(h("p","bpp-cv-empty",e.a11y?"No accessibility issues on this element.":"This element carries no structure role."));return}for(let d of t)m.append(S(d,false));}function T(){let e={error:0,warning:0,info:0};for(let t of ze())e[t.severity]++;return e}function ie(){if(!H)return;if(!k){H.setBadge(null);return}let{error:e,warning:t}=T();e===0&&t===0?H.setBadge("\u2713","ok"):H.setBadge(String(e+t),e>0?"error":"warning");}function $(e,t,r,f){let d=h("label","bpp-cv-filter");d.title=r;let g=L.ownerDocument.createElement("input");return g.type="checkbox",g.checked=t,g.addEventListener("change",()=>f(g.checked)),d.append(g,L.ownerDocument.createTextNode(` ${e}`)),d}let M=null;function X(){let e=h("div","bpp-cv-header");if(!k)return e.append(h("span","bpp-cv-empty","No compliance report; showing structure roles only.")),e;let t=T(),r=h("div","bpp-cv-pills"),f=(g,C,w)=>{r.append(h("span",`bpp-cv-pill bpp-cv-pill-${g}${C===0?" bpp-cv-pill-zero":""}`,`${C} ${w}`));};f("error",t.error,t.error===1?"error":"errors"),f("warning",t.warning,t.warning===1?"warning":"warnings"),f("info",t.info,"info"),e.append(r);let d=k.findings.find(g=>g.standard.startsWith("PDF/UA"))?.standard??"PDF/UA-1";return e.append(h("div",`bpp-cv-verdict ${k.passed?"bpp-cv-verdict-pass":"bpp-cv-verdict-fail"}`,k.passed?`Passes ${d} checks`:`Does not meet ${d}`)),e}function ee(){M&&M.replaceChildren(X(),be());}function be(){let e=h("div","bpp-cv-settings"),t=h("div","bpp-cv-filters");k&&(t.append($("Show only elements with issues",B,"Hide every branch of the tree with no findings in it",d=>{B=d,B&&De(),Re(),pe();})),t.append(U())),e.append(t);let r=h("div","bpp-cv-tree-actions"),f=(d,g,C)=>{let w=h("button","bpp-cv-action",d);w.type="button",w.title=g,w.addEventListener("click",C),r.append(w);};return f("Expand all","Expand every branch of the tree",()=>Ae(true)),f("Collapse all","Collapse the tree back to the document",()=>Ae(false)),e.append(r),e}function U(){return $("Include WCAG contrast checks",K,"WCAG 2.2 SC 1.4.3 text-contrast findings. PDF/UA-1 sets no numeric contrast requirement, so these are a separate standard you may be tracking separately.",e=>{K=e,Re(),Le();})}function fe(){if(!P)return;if(P.replaceChildren(),!k){P.append(h("p","bpp-cv-empty","No compliance report was supplied, so there are no findings to list."));return}let e=h("div","bpp-cv-issues-head");e.append(X()),e.append(U()),P.append(e);let t=h("div","bpp-cv-issues-list"),r=ze(),f=["error","warning","info"];for(let d of f){let g=r.filter(w=>w.severity===d);if(g.length===0)continue;let C=h("section","bpp-cv-issues-group");C.append(h("div","bpp-cv-section-title",`${ct[d]}${g.length===1?"":"s"} (${g.length})`));for(let w of g){let E=S(w,w.nodeId!=null);w.nodeId||E.prepend(h("span","bpp-cv-scope","Document")),C.append(E);}t.append(C);}t.childElementCount===0&&t.append(h("p","bpp-cv-empty",K?"No findings. This document passes every check the preflight runs.":"No findings, with contrast checks excluded. Include them to check text contrast too.")),P.append(t);}let Z=null;function Le(){Ge(),B&&De(),ee(),fe(),pe();let e=V?ae.get(V):null;O(e??null),ie(),F()&&$e(),e?_e(e):oe(R);}function pe(){if(!Z||!x)return;W.clear();let e=Xe([x],"tree",1);if(e.classList.add("bpp-tree","bpp-cv-tree"),e.setAttribute("aria-label",n),Z.replaceChildren(e),e.childElementCount===0&&Z.append(h("p","bpp-cv-empty",K?"No elements with issues. Clear the filter to see the whole document.":"No elements with issues. Contrast checks are hidden \u2014 include them, or clear the filter to see the whole document.")),V){let r=W.get(V);r&&r.setAttribute("aria-selected","true");}let t=te&&W.has(te)?te:Be()[0]?.dataset.nodeId;t&&Ee(t);}function Ve(e,t){let r=F();e==="tree"?le=t:ue=t;let f=F();f!==r&&(f?$e():(oe(se),oe(R)));}return {name:"compliance-view",needsLayout:true,setup(e){L=e;let t=e.ownerDocument;return j=t.createElement("div"),j.className="bpp-cv-host",A=e.addSidePanel({id:"compliance",label:n,element:j,defaultOpen:i,onVisibilityChange:r=>Ve("tree",r)}),P=t.createElement("div"),P.className="bpp-cv-host bpp-cv-issues",H=e.addSidePanel({id:"compliance-issues",label:o,element:P,onVisibilityChange:r=>Ve("issues",r)}),()=>{L=null,A=null,H=null,j=null,P=null;}},load(e){if(L=e,W.clear(),ae.clear(),G.clear(),Q.clear(),D.clear(),oe(se),oe(R),V=null,te=null,x=null,k=e.report??null,ne?.abort(),ne=null,!j)return;if(!e.snapshot){j.textContent="No structure data for this document.",P&&(P.textContent="No structure data for this document."),H?.setBadge(null),oe(se),oe(R);return}x=e.snapshot.root,v(x),Ge(),et(),j.replaceChildren(),M=h("div","bpp-cv-summary"),j.append(M),Z=h("div","bpp-cv-tree-host"),j.append(Z);let t=h("div","bpp-cv-detail");t.append(h("div","bpp-cv-section-title","Element")),m=h("div","bpp-cv-detail-body"),t.append(m),j.append(t),ee(),fe(),pe(),O(null),ie(),ne=new AbortController;for(let r=0;r<e.pageCount();r++){let f=e.pageElement(r);if(!f)continue;let d=r;f.addEventListener("click",g=>{if(!F()&&!g.ctrlKey&&!g.metaKey||!L)return;let C=L.scale();if(C<=0)return;let w=f.getBoundingClientRect(),E=(g.clientX-w.left)/C,q=(g.clientY-w.top)/C,Y=Ue(d,E,q);Y&&(le||A?.setVisible(true),He(Y,true),Oe(Y,he(Y)||g.ctrlKey||g.metaKey,"page"));},{signal:ne.signal});}F()&&$e();},sync({scale:e}){for(let t of se)ye(t.element,t.rect,e);for(let t of R)ye(t.element,t.rect,e);},selectSnapshotNode(e){let t=ae.get(e);return t?(le||A?.setVisible(true),He(t,true),true):false},teardown(){oe(se),oe(R),W.clear(),ae.clear(),G.clear(),Q.clear(),D.clear(),V=null,te=null,x=null,k=null,ne?.abort(),ne=null;}}}var ut=class extends HTMLElement{handle=null;pending=null;connectedCallback(){let n=this.shadowRoot??this.attachShadow({mode:"open"});if(!this.handle){this.handle=Lt(n,this.readOptions());let o=this.pending;this.pending=null,o?.run(this.handle);}}disconnectedCallback(){this.handle?.dispose(),this.handle=null;}load(n,o){if(this.handle)return Array.isArray(n)?this.handle.load(n,o):this.handle.load(n,o);if(this.pending?.settle(),Array.isArray(n)){this.pending={run:i=>i.load(n,o),settle:()=>{}};return}return new Promise((i,l)=>{this.pending={run:c=>{c.load(n,o).then(i,l);},settle:i};})}selectSnapshotNode(n){return this.handle?.selectSnapshotNode(n)??false}clear(){this.pending?.settle(),this.pending=null,this.handle?.clear();}readOptions(){let n=this.getAttribute("show-thumbnails"),o=this.getAttribute("show-inspector"),i=this.getAttribute("preference-key"),l=i?this.readPreferences(i):void 0,c=[];if(this.hasAttribute("compliance-view")||this.hasAttribute("structure-view")){let N=this.getAttribute("wcag-checks");c.push(Pt({showWcagChecks:N===null?void 0:N!=="false",preferenceKey:i?`${i}:a11y`:void 0}));}return {plugins:c.length>0?c:void 0,toolbar:this.readToolbarConfig(),showThumbnails:l?.showThumbnails??(n===null?void 0:n!=="false"),showInspector:l?.showInspector??(o===null?void 0:o!=="false"),initialZoom:l?.zoom,onViewStateChange:i?N=>this.writePreferences(i,N):void 0,fitMode:this.getAttribute("fit-mode")==="fit-width"?"fit-width":"fit-page",title:this.getAttribute("label")??void 0,downloadFilename:this.getAttribute("download-filename")??void 0,hideBorder:this.getAttribute("hide-border")==="true"||this.hasAttribute("hide-border")&&this.getAttribute("hide-border")!=="false",styleScrollbars:this.getAttribute("style-scrollbars")==="true",selectionColor:this.getAttribute("selection-color")??void 0,footer:this.hasAttribute("footer")&&this.getAttribute("footer")!=="false"?{text:this.getAttribute("footer-label")??void 0}:void 0}}readToolbarConfig(){let n=i=>{let l=this.getAttribute(i);return l===null?void 0:l!=="false"},o={thumbnails:n("show-thumbnails-toggle"),pageNav:n("show-page-nav"),zoom:n("show-zoom"),fullscreen:n("show-fullscreen"),download:n("show-download")};return Object.values(o).some(i=>i!==void 0)?o:void 0}readPreferences(n){try{let o=this.ownerDocument.defaultView?.localStorage.getItem(n);if(!o)return;let i=JSON.parse(o);return {showThumbnails:typeof i.showThumbnails=="boolean"?i.showThumbnails:void 0,showInspector:typeof i.showInspector=="boolean"?i.showInspector:void 0,zoom:this.readZoomPreference(i.zoom)}}catch{return}}readZoomPreference(n){if(!n||typeof n!="object")return;let o=n;if(o.mode==="fit-page"||o.mode==="fit-width")return {mode:o.mode};if(o.mode==="custom"&&typeof o.scale=="number"&&Number.isFinite(o.scale)&&o.scale>0)return {mode:"custom",scale:o.scale}}writePreferences(n,o){try{this.ownerDocument.defaultView?.localStorage.setItem(n,JSON.stringify(o));}catch{}}};function wn(s="bonnie-pdf-previewer"){typeof customElements<"u"&&!customElements.get(s)&&customElements.define(s,ut);}exports.a=tn;exports.b=Lt;exports.c=Pt;exports.d=ut;exports.e=wn;
|