@william-xu-web/c-a11y 1.0.0
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 +25 -0
- package/README.en.md +152 -0
- package/README.md +152 -0
- package/dist/c-a11y.esm.js +826 -0
- package/dist/c-a11y.esm.js.map +7 -0
- package/dist/c-a11y.min.js +827 -0
- package/dist/c-a11y.min.js.map +7 -0
- package/package.json +41 -0
|
@@ -0,0 +1,827 @@
|
|
|
1
|
+
/*! A11y v1.1.4 | MIT License | by William | https://gitee.com/WilliamHao/npm-c-a11y */
|
|
2
|
+
var A11y=(()=>{var Z=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Bt=Object.getOwnPropertyNames;var Dt=Object.prototype.hasOwnProperty;var Ot=(s,t)=>{for(var e in t)Z(s,e,{get:t[e],enumerable:!0})},Nt=(s,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Bt(t))!Dt.call(s,o)&&o!==e&&Z(s,o,{get:()=>t[o],enumerable:!(i=It(t,o))||i.enumerable});return s};var jt=s=>Nt(Z({},"__esModule",{value:!0}),s);var se={};Ot(se,{init:()=>ht});function ut(){return`
|
|
3
|
+
:host {
|
|
4
|
+
all: initial;
|
|
5
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
|
6
|
+
font-size: 16px;
|
|
7
|
+
line-height: 1.5;
|
|
8
|
+
color: #1a1a2e;
|
|
9
|
+
}
|
|
10
|
+
*, *::before, *::after {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.anid-trigger {
|
|
17
|
+
position: fixed;
|
|
18
|
+
z-index: 2147483647;
|
|
19
|
+
width: 56px;
|
|
20
|
+
height: 56px;
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
background: #1565c0;
|
|
23
|
+
border: 3px solid #fff;
|
|
24
|
+
box-shadow: 0 4px 16px rgba(0,0,0,0.3);
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
transition: transform 0.2s, box-shadow 0.2s;
|
|
30
|
+
touch-action: none;
|
|
31
|
+
}
|
|
32
|
+
.anid-trigger:hover, .anid-trigger:focus-visible {
|
|
33
|
+
transform: scale(1.1);
|
|
34
|
+
box-shadow: 0 6px 24px rgba(0,0,0,0.4);
|
|
35
|
+
}
|
|
36
|
+
.anid-trigger:focus-visible {
|
|
37
|
+
outline: 3px solid #ffab00;
|
|
38
|
+
outline-offset: 2px;
|
|
39
|
+
}
|
|
40
|
+
.anid-trigger svg {
|
|
41
|
+
width: 28px;
|
|
42
|
+
height: 28px;
|
|
43
|
+
fill: #fff;
|
|
44
|
+
}
|
|
45
|
+
.anid-trigger[aria-expanded="true"] {
|
|
46
|
+
background: #c62828;
|
|
47
|
+
}
|
|
48
|
+
.anid-trigger[aria-expanded="true"] svg {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
.anid-trigger[aria-expanded="true"]::after {
|
|
52
|
+
content: '\u2715';
|
|
53
|
+
color: #fff;
|
|
54
|
+
font-size: 22px;
|
|
55
|
+
font-weight: bold;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.anid-panel {
|
|
59
|
+
position: fixed;
|
|
60
|
+
z-index: 2147483646;
|
|
61
|
+
width: 380px;
|
|
62
|
+
max-width: calc(100vw - 24px);
|
|
63
|
+
max-height: calc(100vh - 100px);
|
|
64
|
+
background: #ffffff;
|
|
65
|
+
border-radius: 16px;
|
|
66
|
+
box-shadow: 0 8px 40px rgba(0,0,0,0.25);
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
opacity: 0;
|
|
71
|
+
visibility: hidden;
|
|
72
|
+
transform: translateY(20px) scale(0.95);
|
|
73
|
+
transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
|
|
74
|
+
}
|
|
75
|
+
.anid-panel.anid-open {
|
|
76
|
+
opacity: 1;
|
|
77
|
+
visibility: visible;
|
|
78
|
+
transform: translateY(0) scale(1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.anid-panel-header {
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: space-between;
|
|
85
|
+
padding: 16px 20px;
|
|
86
|
+
background: #1565c0;
|
|
87
|
+
color: #fff;
|
|
88
|
+
gap: 8px;
|
|
89
|
+
flex-shrink: 0;
|
|
90
|
+
}
|
|
91
|
+
.anid-panel-title {
|
|
92
|
+
font-size: 18px;
|
|
93
|
+
font-weight: 700;
|
|
94
|
+
flex: 1;
|
|
95
|
+
}
|
|
96
|
+
.anid-lang-select {
|
|
97
|
+
background: rgba(255,255,255,0.2);
|
|
98
|
+
border: 1px solid rgba(255,255,255,0.4);
|
|
99
|
+
color: #fff;
|
|
100
|
+
padding: 4px 8px;
|
|
101
|
+
border-radius: 6px;
|
|
102
|
+
font-size: 13px;
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
}
|
|
105
|
+
.anid-lang-select option {
|
|
106
|
+
color: #1a1a2e;
|
|
107
|
+
background: #fff;
|
|
108
|
+
}
|
|
109
|
+
.anid-close-btn {
|
|
110
|
+
background: none;
|
|
111
|
+
border: none;
|
|
112
|
+
color: #fff;
|
|
113
|
+
font-size: 22px;
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
width: 36px;
|
|
116
|
+
height: 36px;
|
|
117
|
+
border-radius: 50%;
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
transition: background 0.15s;
|
|
122
|
+
}
|
|
123
|
+
.anid-close-btn:hover, .anid-close-btn:focus-visible {
|
|
124
|
+
background: rgba(255,255,255,0.2);
|
|
125
|
+
}
|
|
126
|
+
.anid-close-btn:focus-visible {
|
|
127
|
+
outline: 2px solid #ffab00;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.anid-panel-body {
|
|
131
|
+
overflow-y: auto;
|
|
132
|
+
flex: 1;
|
|
133
|
+
padding: 8px 0;
|
|
134
|
+
scrollbar-width: thin;
|
|
135
|
+
scrollbar-color: #ccc transparent;
|
|
136
|
+
}
|
|
137
|
+
.anid-panel-body::-webkit-scrollbar {
|
|
138
|
+
width: 6px;
|
|
139
|
+
}
|
|
140
|
+
.anid-panel-body::-webkit-scrollbar-track {
|
|
141
|
+
background: transparent;
|
|
142
|
+
}
|
|
143
|
+
.anid-panel-body::-webkit-scrollbar-thumb {
|
|
144
|
+
background: #ccc;
|
|
145
|
+
border-radius: 3px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.anid-category {
|
|
149
|
+
border-bottom: 1px solid #eee;
|
|
150
|
+
}
|
|
151
|
+
.anid-category:last-child {
|
|
152
|
+
border-bottom: none;
|
|
153
|
+
}
|
|
154
|
+
.anid-category-header {
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
gap: 10px;
|
|
158
|
+
padding: 12px 20px;
|
|
159
|
+
background: none;
|
|
160
|
+
border: none;
|
|
161
|
+
width: 100%;
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
font-size: 15px;
|
|
164
|
+
font-weight: 600;
|
|
165
|
+
color: #1a1a2e;
|
|
166
|
+
text-align: inherit;
|
|
167
|
+
transition: background 0.15s;
|
|
168
|
+
}
|
|
169
|
+
.anid-category-header:hover {
|
|
170
|
+
background: #f5f5f5;
|
|
171
|
+
}
|
|
172
|
+
.anid-category-header:focus-visible {
|
|
173
|
+
outline: 2px solid #1565c0;
|
|
174
|
+
outline-offset: -2px;
|
|
175
|
+
}
|
|
176
|
+
.anid-category-icon {
|
|
177
|
+
font-size: 20px;
|
|
178
|
+
width: 28px;
|
|
179
|
+
text-align: center;
|
|
180
|
+
flex-shrink: 0;
|
|
181
|
+
}
|
|
182
|
+
.anid-category-chevron {
|
|
183
|
+
margin-inline-start: auto;
|
|
184
|
+
transition: transform 0.2s;
|
|
185
|
+
font-size: 12px;
|
|
186
|
+
}
|
|
187
|
+
.anid-category[data-expanded="true"] .anid-category-chevron {
|
|
188
|
+
transform: rotate(180deg);
|
|
189
|
+
}
|
|
190
|
+
.anid-category-content {
|
|
191
|
+
max-height: 0;
|
|
192
|
+
overflow: hidden;
|
|
193
|
+
transition: max-height 0.3s ease;
|
|
194
|
+
}
|
|
195
|
+
.anid-category[data-expanded="true"] .anid-category-content {
|
|
196
|
+
max-height: 2000px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.anid-feature {
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
padding: 10px 20px 10px 48px;
|
|
203
|
+
gap: 12px;
|
|
204
|
+
min-height: 44px;
|
|
205
|
+
}
|
|
206
|
+
[dir="rtl"] .anid-feature {
|
|
207
|
+
padding: 10px 48px 10px 20px;
|
|
208
|
+
}
|
|
209
|
+
.anid-feature-label {
|
|
210
|
+
flex: 1;
|
|
211
|
+
font-size: 14px;
|
|
212
|
+
color: #333;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.anid-toggle {
|
|
216
|
+
position: relative;
|
|
217
|
+
width: 44px;
|
|
218
|
+
height: 24px;
|
|
219
|
+
flex-shrink: 0;
|
|
220
|
+
}
|
|
221
|
+
.anid-toggle input {
|
|
222
|
+
opacity: 0;
|
|
223
|
+
width: 0;
|
|
224
|
+
height: 0;
|
|
225
|
+
position: absolute;
|
|
226
|
+
}
|
|
227
|
+
.anid-toggle-slider {
|
|
228
|
+
position: absolute;
|
|
229
|
+
inset: 0;
|
|
230
|
+
background: #ccc;
|
|
231
|
+
border-radius: 12px;
|
|
232
|
+
cursor: pointer;
|
|
233
|
+
transition: background 0.2s;
|
|
234
|
+
}
|
|
235
|
+
.anid-toggle-slider::before {
|
|
236
|
+
content: '';
|
|
237
|
+
position: absolute;
|
|
238
|
+
width: 20px;
|
|
239
|
+
height: 20px;
|
|
240
|
+
border-radius: 50%;
|
|
241
|
+
background: #fff;
|
|
242
|
+
top: 2px;
|
|
243
|
+
left: 2px;
|
|
244
|
+
transition: transform 0.2s;
|
|
245
|
+
}
|
|
246
|
+
[dir="rtl"] .anid-toggle-slider::before {
|
|
247
|
+
left: auto;
|
|
248
|
+
right: 2px;
|
|
249
|
+
}
|
|
250
|
+
.anid-toggle input:checked + .anid-toggle-slider {
|
|
251
|
+
background: #1565c0;
|
|
252
|
+
}
|
|
253
|
+
.anid-toggle input:checked + .anid-toggle-slider::before {
|
|
254
|
+
transform: translateX(20px);
|
|
255
|
+
}
|
|
256
|
+
[dir="rtl"] .anid-toggle input:checked + .anid-toggle-slider::before {
|
|
257
|
+
transform: translateX(-20px);
|
|
258
|
+
}
|
|
259
|
+
.anid-toggle input:focus-visible + .anid-toggle-slider {
|
|
260
|
+
outline: 2px solid #ffab00;
|
|
261
|
+
outline-offset: 2px;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.anid-btn-group {
|
|
265
|
+
display: flex;
|
|
266
|
+
flex-wrap: wrap;
|
|
267
|
+
gap: 6px;
|
|
268
|
+
}
|
|
269
|
+
.anid-btn {
|
|
270
|
+
padding: 6px 12px;
|
|
271
|
+
border: 1px solid #ccc;
|
|
272
|
+
border-radius: 6px;
|
|
273
|
+
background: #f5f5f5;
|
|
274
|
+
color: #333;
|
|
275
|
+
cursor: pointer;
|
|
276
|
+
font-size: 13px;
|
|
277
|
+
min-width: 44px;
|
|
278
|
+
min-height: 32px;
|
|
279
|
+
overflow: hidden;
|
|
280
|
+
text-overflow: ellipsis;
|
|
281
|
+
white-space: nowrap;
|
|
282
|
+
transition: background 0.15s, border-color 0.15s;
|
|
283
|
+
}
|
|
284
|
+
.anid-btn:hover {
|
|
285
|
+
background: #e0e0e0;
|
|
286
|
+
}
|
|
287
|
+
.anid-btn:focus-visible {
|
|
288
|
+
outline: 2px solid #1565c0;
|
|
289
|
+
outline-offset: 1px;
|
|
290
|
+
}
|
|
291
|
+
.anid-btn.anid-active {
|
|
292
|
+
background: #1565c0;
|
|
293
|
+
color: #fff;
|
|
294
|
+
border-color: #1565c0;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.anid-slider-wrap {
|
|
298
|
+
display: flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
gap: 8px;
|
|
301
|
+
width: 120px;
|
|
302
|
+
}
|
|
303
|
+
.anid-slider {
|
|
304
|
+
width: 100%;
|
|
305
|
+
height: 4px;
|
|
306
|
+
-webkit-appearance: none;
|
|
307
|
+
appearance: none;
|
|
308
|
+
background: #ddd;
|
|
309
|
+
border-radius: 2px;
|
|
310
|
+
outline: none;
|
|
311
|
+
}
|
|
312
|
+
.anid-slider::-webkit-slider-thumb {
|
|
313
|
+
-webkit-appearance: none;
|
|
314
|
+
width: 18px;
|
|
315
|
+
height: 18px;
|
|
316
|
+
border-radius: 50%;
|
|
317
|
+
background: #1565c0;
|
|
318
|
+
cursor: pointer;
|
|
319
|
+
}
|
|
320
|
+
.anid-slider::-moz-range-thumb {
|
|
321
|
+
width: 18px;
|
|
322
|
+
height: 18px;
|
|
323
|
+
border: none;
|
|
324
|
+
border-radius: 50%;
|
|
325
|
+
background: #1565c0;
|
|
326
|
+
cursor: pointer;
|
|
327
|
+
}
|
|
328
|
+
.anid-slider:focus-visible {
|
|
329
|
+
outline: 2px solid #ffab00;
|
|
330
|
+
outline-offset: 2px;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.anid-panel-footer {
|
|
334
|
+
padding: 12px 20px;
|
|
335
|
+
border-top: 1px solid #eee;
|
|
336
|
+
display: flex;
|
|
337
|
+
justify-content: center;
|
|
338
|
+
flex-shrink: 0;
|
|
339
|
+
}
|
|
340
|
+
.anid-reset-btn {
|
|
341
|
+
padding: 8px 24px;
|
|
342
|
+
border: 2px solid #c62828;
|
|
343
|
+
border-radius: 8px;
|
|
344
|
+
background: transparent;
|
|
345
|
+
color: #c62828;
|
|
346
|
+
font-size: 14px;
|
|
347
|
+
font-weight: 600;
|
|
348
|
+
cursor: pointer;
|
|
349
|
+
min-height: 44px;
|
|
350
|
+
transition: background 0.15s, color 0.15s;
|
|
351
|
+
}
|
|
352
|
+
.anid-reset-btn:hover {
|
|
353
|
+
background: #c62828;
|
|
354
|
+
color: #fff;
|
|
355
|
+
}
|
|
356
|
+
.anid-reset-btn:focus-visible {
|
|
357
|
+
outline: 2px solid #ffab00;
|
|
358
|
+
outline-offset: 2px;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.anid-sub-options {
|
|
362
|
+
padding: 4px 20px 8px 64px;
|
|
363
|
+
}
|
|
364
|
+
[dir="rtl"] .anid-sub-options {
|
|
365
|
+
padding: 4px 64px 8px 20px;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.anid-heading-list, .anid-landmark-list {
|
|
369
|
+
list-style: none;
|
|
370
|
+
padding: 4px 20px 8px 48px;
|
|
371
|
+
max-height: 200px;
|
|
372
|
+
overflow-y: auto;
|
|
373
|
+
}
|
|
374
|
+
[dir="rtl"] .anid-heading-list, [dir="rtl"] .anid-landmark-list {
|
|
375
|
+
padding: 4px 48px 8px 20px;
|
|
376
|
+
}
|
|
377
|
+
.anid-heading-list li, .anid-landmark-list li {
|
|
378
|
+
margin: 2px 0;
|
|
379
|
+
}
|
|
380
|
+
.anid-heading-list button, .anid-landmark-list button {
|
|
381
|
+
background: none;
|
|
382
|
+
border: none;
|
|
383
|
+
color: #1565c0;
|
|
384
|
+
cursor: pointer;
|
|
385
|
+
font-size: 13px;
|
|
386
|
+
padding: 4px 8px;
|
|
387
|
+
border-radius: 4px;
|
|
388
|
+
text-align: inherit;
|
|
389
|
+
width: 100%;
|
|
390
|
+
min-height: 32px;
|
|
391
|
+
transition: background 0.15s;
|
|
392
|
+
}
|
|
393
|
+
.anid-heading-list button:hover, .anid-landmark-list button:hover {
|
|
394
|
+
background: #e3f2fd;
|
|
395
|
+
}
|
|
396
|
+
.anid-heading-list button:focus-visible, .anid-landmark-list button:focus-visible {
|
|
397
|
+
outline: 2px solid #1565c0;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.anid-overlay {
|
|
401
|
+
position: fixed;
|
|
402
|
+
z-index: 2147483645;
|
|
403
|
+
top: 0; left: 0; right: 0; bottom: 0;
|
|
404
|
+
background: rgba(0,0,0,0.85);
|
|
405
|
+
color: #eee;
|
|
406
|
+
overflow-y: auto;
|
|
407
|
+
padding: 40px 20px;
|
|
408
|
+
font-family: monospace;
|
|
409
|
+
font-size: 14px;
|
|
410
|
+
line-height: 1.8;
|
|
411
|
+
white-space: pre-wrap;
|
|
412
|
+
}
|
|
413
|
+
.anid-overlay-close {
|
|
414
|
+
position: fixed;
|
|
415
|
+
top: 16px;
|
|
416
|
+
right: 16px;
|
|
417
|
+
z-index: 2147483646;
|
|
418
|
+
background: #c62828;
|
|
419
|
+
color: #fff;
|
|
420
|
+
border: none;
|
|
421
|
+
width: 44px;
|
|
422
|
+
height: 44px;
|
|
423
|
+
border-radius: 50%;
|
|
424
|
+
font-size: 20px;
|
|
425
|
+
cursor: pointer;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.anid-statement-modal {
|
|
429
|
+
position: fixed;
|
|
430
|
+
z-index: 2147483645;
|
|
431
|
+
top: 50%; left: 50%;
|
|
432
|
+
transform: translate(-50%, -50%);
|
|
433
|
+
width: 600px;
|
|
434
|
+
max-width: calc(100vw - 40px);
|
|
435
|
+
max-height: calc(100vh - 80px);
|
|
436
|
+
background: #fff;
|
|
437
|
+
border-radius: 12px;
|
|
438
|
+
box-shadow: 0 16px 48px rgba(0,0,0,0.3);
|
|
439
|
+
overflow-y: auto;
|
|
440
|
+
padding: 32px;
|
|
441
|
+
}
|
|
442
|
+
.anid-statement-modal h2 {
|
|
443
|
+
font-size: 22px;
|
|
444
|
+
margin-bottom: 16px;
|
|
445
|
+
color: #1a1a2e;
|
|
446
|
+
}
|
|
447
|
+
.anid-statement-modal p {
|
|
448
|
+
margin-bottom: 12px;
|
|
449
|
+
color: #333;
|
|
450
|
+
line-height: 1.7;
|
|
451
|
+
}
|
|
452
|
+
.anid-statement-backdrop {
|
|
453
|
+
position: fixed;
|
|
454
|
+
z-index: 2147483644;
|
|
455
|
+
inset: 0;
|
|
456
|
+
background: rgba(0,0,0,0.5);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.anid-shortcut {
|
|
460
|
+
display: inline-block;
|
|
461
|
+
font-size: 10px;
|
|
462
|
+
font-family: inherit;
|
|
463
|
+
padding: 1px 5px;
|
|
464
|
+
margin-inline-start: 6px;
|
|
465
|
+
background: #eee;
|
|
466
|
+
color: #666;
|
|
467
|
+
border: 1px solid #ddd;
|
|
468
|
+
border-radius: 3px;
|
|
469
|
+
vertical-align: middle;
|
|
470
|
+
line-height: 1.4;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.anid-live-region {
|
|
474
|
+
position: absolute;
|
|
475
|
+
width: 1px;
|
|
476
|
+
height: 1px;
|
|
477
|
+
overflow: hidden;
|
|
478
|
+
clip: rect(0,0,0,0);
|
|
479
|
+
white-space: nowrap;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
@media (max-width: 768px) {
|
|
483
|
+
.anid-panel {
|
|
484
|
+
width: 100vw !important;
|
|
485
|
+
max-width: 100vw !important;
|
|
486
|
+
height: 100vh !important;
|
|
487
|
+
max-height: 100vh !important;
|
|
488
|
+
border-radius: 0 !important;
|
|
489
|
+
top: 0 !important;
|
|
490
|
+
left: 0 !important;
|
|
491
|
+
right: 0 !important;
|
|
492
|
+
bottom: 0 !important;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
`}var v={en:{dir:"ltr",panelTitle:"Accessibility",close:"Close",resetAll:"Reset All",categoryVision:"Vision & Display",categoryNavigation:"Navigation & Reading",categoryMedia:"Media & Content",categoryCompliance:"Compliance & Info",fontSize:"Font Size",fontSizeIncrease:"Increase",fontSizeDecrease:"Decrease",fontSizeReset:"Reset",highContrast:"High Contrast",contrastDark:"Dark",contrastLight:"Light",contrastInvert:"Invert",darkMode:"Dark Mode",monochrome:"Grayscale",saturation:"Color Saturation",textSpacing:"Text Spacing",dyslexiaFont:"Dyslexia Font",hideImages:"Hide Images",colorBlindSim:"Color Blind Simulation",protanopia:"Protanopia (Red)",deuteranopia:"Deuteranopia (Green)",tritanopia:"Tritanopia (Blue)",keyboardNav:"Keyboard Navigation",focusIndicators:"Focus Indicators",headingStructure:"Heading Map",pageStructure:"Page Structure",readingGuide:"Reading Guide",lineMask:"Line Focus",bigCursor:"Big Cursor",screenReaderPreview:"Screen Reader Preview",linkHighlight:"Highlight Links",imageAltText:"Image Alt Text",stopAnimations:"Stop Animations",muteSounds:"Mute Sounds",accessibilityStatement:"Accessibility Statement",complianceBadge:"Compliance Badge",generateStatement:"Generate Statement",generateBadge:"Generate Badge",language:"Language",on:"On",off:"Off",openPanel:"Open accessibility menu",closePanel:"Close accessibility menu",jumpTo:"Jump to",level:"Level",noHeadings:"No headings found",noLandmarks:"No landmarks found",main:"Main",header:"Header",footer:"Footer",nav:"Navigation",aside:"Aside",form:"Form",search:"Search",statementTitle:"Accessibility Statement",statementIntro:"We strive to make this website accessible to all users, including people with disabilities, in accordance with WCAG 2.1 Level AA guidelines.",statementCoordinator:"Accessibility Coordinator",statementPhone:"Phone",statementEmail:"Email",statementLastAudit:"Last accessibility audit date",statementAccommodations:"Accessibility accommodations performed",copied:"Copied to clipboard",embedCode:"Embed code",copyCode:"Copy",badgeCompliant:"Compliant",poweredBy:"Powered by",contrastAndColors:"Contrast and color adjustments",fontSizeAdjustment:"Font size adjustment",keyboardNavigation:"Keyboard navigation",screenReaderCompat:"Screen reader compatibility",linkHighlighting:"Link highlighting",animationControl:"Animation control",noAltText:"(no alt text)",ttsHover:"Read on Hover",ttsSelection:"Read Selection",ttsReadPage:"Read Page Aloud",ttsStop:"Stop Reading",ttsReading:"Reading...",shortcutPanelToggle:"Toggle accessibility menu",keyboardShortcuts:"Keyboard Shortcuts"},zh:{dir:"ltr",panelTitle:"\u65E0\u969C\u788D",close:"\u5173\u95ED",resetAll:"\u91CD\u7F6E\u5168\u90E8",categoryVision:"\u89C6\u89C9\u4E0E\u663E\u793A",categoryNavigation:"\u5BFC\u822A\u4E0E\u9605\u8BFB",categoryMedia:"\u5A92\u4F53\u4E0E\u5185\u5BB9",categoryCompliance:"\u5408\u89C4\u4E0E\u4FE1\u606F",fontSize:"\u5B57\u4F53\u5927\u5C0F",fontSizeIncrease:"\u589E\u5927",fontSizeDecrease:"\u51CF\u5C0F",fontSizeReset:"\u91CD\u7F6E",highContrast:"\u9AD8\u5BF9\u6BD4\u5EA6",contrastDark:"\u6DF1\u8272",contrastLight:"\u6D45\u8272",contrastInvert:"\u53CD\u8F6C",darkMode:"\u6DF1\u8272\u6A21\u5F0F",monochrome:"\u7070\u5EA6",saturation:"\u8272\u5F69\u9971\u548C\u5EA6",textSpacing:"\u6587\u672C\u95F4\u8DDD",dyslexiaFont:"\u9605\u8BFB\u969C\u788D\u5B57\u4F53",hideImages:"\u9690\u85CF\u56FE\u7247",colorBlindSim:"\u8272\u76F2\u6A21\u62DF",protanopia:"\u7EA2\u8272\u76F2",deuteranopia:"\u7EFF\u8272\u76F2",tritanopia:"\u84DD\u8272\u76F2",keyboardNav:"\u952E\u76D8\u5BFC\u822A",focusIndicators:"\u7126\u70B9\u6307\u793A\u5668",headingStructure:"\u6807\u9898\u5730\u56FE",pageStructure:"\u9875\u9762\u7ED3\u6784",readingGuide:"\u9605\u8BFB\u5F15\u5BFC\u7EBF",lineMask:"\u884C\u805A\u7126",bigCursor:"\u5927\u5149\u6807",screenReaderPreview:"\u5C4F\u5E55\u9605\u8BFB\u5668\u9884\u89C8",linkHighlight:"\u9AD8\u4EAE\u94FE\u63A5",imageAltText:"\u56FE\u7247\u66FF\u4EE3\u6587\u672C",stopAnimations:"\u505C\u6B62\u52A8\u753B",muteSounds:"\u9759\u97F3",accessibilityStatement:"\u65E0\u969C\u788D\u58F0\u660E",complianceBadge:"\u5408\u89C4\u5FBD\u7AE0",generateStatement:"\u751F\u6210\u58F0\u660E",generateBadge:"\u751F\u6210\u5FBD\u7AE0",language:"\u8BED\u8A00",on:"\u5F00\u542F",off:"\u5173\u95ED",openPanel:"\u6253\u5F00\u65E0\u969C\u788D\u83DC\u5355",closePanel:"\u5173\u95ED\u65E0\u969C\u788D\u83DC\u5355",jumpTo:"\u8DF3\u8F6C\u5230",level:"\u7EA7\u522B",noHeadings:"\u672A\u627E\u5230\u6807\u9898",noLandmarks:"\u672A\u627E\u5230\u5730\u6807",main:"\u4E3B\u8981\u5185\u5BB9",header:"\u9875\u7709",footer:"\u9875\u811A",nav:"\u5BFC\u822A",aside:"\u4FA7\u8FB9\u680F",form:"\u8868\u5355",search:"\u641C\u7D22",statementTitle:"\u65E0\u969C\u788D\u58F0\u660E",statementIntro:"\u6211\u4EEC\u81F4\u529B\u4E8E\u4F7F\u672C\u7F51\u7AD9\u5BF9\u6240\u6709\u7528\u6237\uFF08\u5305\u62EC\u6B8B\u969C\u4EBA\u58EB\uFF09\u65E0\u969C\u788D\uFF0C\u7B26\u5408WCAG 2.1 AA \u7EA7\u6307\u5357\u3002",statementCoordinator:"\u65E0\u969C\u788D\u534F\u8C03\u5458",statementPhone:"\u7535\u8BDD",statementEmail:"\u7535\u5B50\u90AE\u4EF6",statementLastAudit:"\u4E0A\u6B21\u65E0\u969C\u788D\u5BA1\u6838\u65E5\u671F",statementAccommodations:"\u5DF2\u6267\u884C\u7684\u65E0\u969C\u788D\u8C03\u6574",copied:"\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F",embedCode:"\u5D4C\u5165\u4EE3\u7801",copyCode:"\u590D\u5236",badgeCompliant:"\u5408\u89C4",poweredBy:"\u6280\u672F\u652F\u6301",contrastAndColors:"\u5BF9\u6BD4\u5EA6\u548C\u989C\u8272\u8C03\u6574",fontSizeAdjustment:"\u5B57\u4F53\u5927\u5C0F\u8C03\u6574",keyboardNavigation:"\u952E\u76D8\u5BFC\u822A",screenReaderCompat:"\u5C4F\u5E55\u9605\u8BFB\u5668\u517C\u5BB9\u6027",linkHighlighting:"\u94FE\u63A5\u9AD8\u4EAE",animationControl:"\u52A8\u753B\u63A7\u5236",noAltText:"(\u65E0\u66FF\u4EE3\u6587\u672C)",ttsHover:"\u60AC\u505C\u6717\u8BFB",ttsSelection:"\u6717\u8BFB\u9009\u4E2D\u5185\u5BB9",ttsReadPage:"\u6717\u8BFB\u9875\u9762",ttsStop:"\u505C\u6B62\u6717\u8BFB",ttsReading:"\u6B63\u5728\u6717\u8BFB...",shortcutPanelToggle:"\u5207\u6362\u65E0\u969C\u788D\u83DC\u5355",keyboardShortcuts:"\u952E\u76D8\u5FEB\u6377\u952E"}},T="zh";function gt(s){var e;if(s&&s!=="auto"&&v[s])return s;let t=(e=document.documentElement.lang)==null?void 0:e.split("-")[0].toLowerCase();return t&&v[t]?t:"zh"}function tt(s){v[s]&&(T=s)}function b(){return T}function n(s){var t;return((t=v[T])==null?void 0:t[s])||v.en[s]||s}function et(){var s;return((s=v[T])==null?void 0:s.dir)||"ltr"}function mt(){return Object.keys(v)}var it="opennagish_prefs",x=null;function _(){if(x)return x;try{let s=localStorage.getItem(it);x=s?JSON.parse(s):{}}catch(s){x={}}return x}function ft(){try{localStorage.setItem(it,JSON.stringify(x))}catch(s){}}function ot(s,t){let e=_();return e[s]!==void 0?e[s]:t}function f(s,t){_(),x[s]=t,ft()}function L(s){_(),delete x[s],ft()}function bt(){x={};try{localStorage.removeItem(it)}catch(s){}}function xt(){return{..._()}}var qt={"&":"&","<":"<",">":">",'"':""","'":"'"};function g(s){return typeof s!="string"?"":s.replace(/[&<>"']/g,t=>qt[t])}function C(s,t={},e=[]){let i=document.createElement(s);for(let[o,a]of Object.entries(t))o==="className"?i.className=a:o==="textContent"?i.textContent=a:o==="innerHTML"?i.innerHTML=a:o.startsWith("on")&&typeof a=="function"?i.addEventListener(o.slice(2).toLowerCase(),a):i.setAttribute(o,a);for(let o of e)typeof o=="string"?i.appendChild(document.createTextNode(o)):o&&i.appendChild(o);return i}function u(s,t){let e=document.getElementById(s);if(e)return e.textContent=t,e;let i=document.createElement("style");return i.id=s,i.textContent=t,document.head.appendChild(i),i}function c(s){let t=document.getElementById(s);t&&t.remove()}function y(s,t){let e=t.querySelector(".anid-live-region");e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=s}))}var at="anid-font-size",Gt=-3,Kt=5,Yt=2,E=class{constructor(t){this.ctx=t,this.level=0}setLevel(t){this.level=Math.max(Gt,Math.min(Kt,t)),this.apply(),f("fontSize",this.level)}increase(){this.setLevel(this.level+1)}decrease(){this.setLevel(this.level-1)}reset(){this.setLevel(0)}apply(){if(this.level===0){c(at);return}let e=`
|
|
496
|
+
html { font-size: calc(1em + ${this.level*Yt}px) !important; }
|
|
497
|
+
body, body *:not(#opennagish-widget) {
|
|
498
|
+
font-size: inherit !important;
|
|
499
|
+
}
|
|
500
|
+
`;u(at,e)}enable(){this.apply()}disable(){this.level=0,c(at),L("fontSize")}};var st="anid-contrast",yt={dark:`
|
|
501
|
+
html { filter: invert(1) hue-rotate(180deg) !important; }
|
|
502
|
+
html img, html video, html canvas, html svg image,
|
|
503
|
+
html [style*="background-image"] {
|
|
504
|
+
filter: invert(1) hue-rotate(180deg) !important;
|
|
505
|
+
}
|
|
506
|
+
`,light:`
|
|
507
|
+
html body { background: #fff !important; color: #000 !important; }
|
|
508
|
+
html body *:not(#opennagish-widget) {
|
|
509
|
+
background-color: #fff !important;
|
|
510
|
+
color: #000 !important;
|
|
511
|
+
border-color: #000 !important;
|
|
512
|
+
box-shadow: none !important;
|
|
513
|
+
}
|
|
514
|
+
html body a { color: #0000EE !important; }
|
|
515
|
+
html body img { opacity: 0.9; }
|
|
516
|
+
`,invert:`
|
|
517
|
+
html { filter: invert(1) !important; }
|
|
518
|
+
html img, html video, html canvas, html svg image {
|
|
519
|
+
filter: invert(1) !important;
|
|
520
|
+
}
|
|
521
|
+
`},$=class{constructor(t){this.ctx=t,this.mode="none"}setMode(t){this.mode=t,t==="none"||!yt[t]?c(st):u(st,yt[t])}enable(){}disable(){this.mode="none",c(st)}};var vt="anid-dark-mode",Vt=`
|
|
522
|
+
html body {
|
|
523
|
+
background-color: #1a1a2e !important;
|
|
524
|
+
color: #e0e0e0 !important;
|
|
525
|
+
}
|
|
526
|
+
html body *:not(#opennagish-widget) {
|
|
527
|
+
background-color: transparent !important;
|
|
528
|
+
color: #e0e0e0 !important;
|
|
529
|
+
border-color: #444 !important;
|
|
530
|
+
}
|
|
531
|
+
html body a { color: #90caf9 !important; }
|
|
532
|
+
html body input, html body textarea, html body select {
|
|
533
|
+
background-color: #2d2d44 !important;
|
|
534
|
+
color: #e0e0e0 !important;
|
|
535
|
+
border-color: #555 !important;
|
|
536
|
+
}
|
|
537
|
+
html body button {
|
|
538
|
+
background-color: #2d2d44 !important;
|
|
539
|
+
color: #e0e0e0 !important;
|
|
540
|
+
}
|
|
541
|
+
html body img { opacity: 0.85; }
|
|
542
|
+
`,H=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(vt,Vt))}disable(){this.active=!1,c(vt)}toggle(){this.active?this.disable():this.enable()}};var wt="anid-monochrome",Ft="html { filter: grayscale(100%) !important; }",M=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(wt,Ft))}disable(){this.active=!1,c(wt)}toggle(){this.active?this.disable():this.enable()}};var rt="anid-saturation",P=class{constructor(t){this.ctx=t,this.value=100}setValue(t){this.value=t,t===100?c(rt):u(rt,`html { filter: saturate(${t}%) !important; }`)}enable(){this.apply()}apply(){this.value!==100&&this.setValue(this.value)}disable(){this.value=100,c(rt)}};var kt="anid-spacing",Ut=`
|
|
543
|
+
html body *:not(#opennagish-widget) {
|
|
544
|
+
line-height: 1.8 !important;
|
|
545
|
+
letter-spacing: 0.12em !important;
|
|
546
|
+
word-spacing: 0.16em !important;
|
|
547
|
+
}
|
|
548
|
+
html body p, html body li, html body dd {
|
|
549
|
+
margin-bottom: 1em !important;
|
|
550
|
+
}
|
|
551
|
+
`,z=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(kt,Ut))}disable(){this.active=!1,c(kt)}toggle(){this.active?this.disable():this.enable()}};var St="anid-dyslexia-font",Wt=`
|
|
552
|
+
@font-face {
|
|
553
|
+
font-family: 'OpenDyslexic';
|
|
554
|
+
src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/woff/OpenDyslexic-Regular.woff') format('woff');
|
|
555
|
+
font-weight: normal;
|
|
556
|
+
font-style: normal;
|
|
557
|
+
font-display: swap;
|
|
558
|
+
}
|
|
559
|
+
@font-face {
|
|
560
|
+
font-family: 'OpenDyslexic';
|
|
561
|
+
src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/woff/OpenDyslexic-Bold.woff') format('woff');
|
|
562
|
+
font-weight: bold;
|
|
563
|
+
font-style: normal;
|
|
564
|
+
font-display: swap;
|
|
565
|
+
}
|
|
566
|
+
html body, html body *:not(#opennagish-widget) {
|
|
567
|
+
font-family: 'OpenDyslexic', sans-serif !important;
|
|
568
|
+
}
|
|
569
|
+
`,R=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(St,Wt))}disable(){this.active=!1,c(St)}toggle(){this.active?this.disable():this.enable()}};var At="anid-hide-images",Xt=`
|
|
570
|
+
html body img,
|
|
571
|
+
html body svg,
|
|
572
|
+
html body video,
|
|
573
|
+
html body [role="img"],
|
|
574
|
+
html body [style*="background-image"] {
|
|
575
|
+
opacity: 0.05 !important;
|
|
576
|
+
visibility: hidden !important;
|
|
577
|
+
}
|
|
578
|
+
`,I=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(At,Xt))}disable(){this.active=!1,c(At)}toggle(){this.active?this.disable():this.enable()}};var Tt="anid-color-blind",lt="anid-color-blind-svg",Jt={protanopia:"0.567,0.433,0,0,0 0.558,0.442,0,0,0 0,0.242,0.758,0,0 0,0,0,1,0",deuteranopia:"0.625,0.375,0,0,0 0.7,0.3,0,0,0 0,0.3,0.7,0,0 0,0,0,1,0",tritanopia:"0.95,0.05,0,0,0 0,0.433,0.567,0,0 0,0.475,0.525,0,0 0,0,0,1,0"},B=class{constructor(t){this.ctx=t,this.mode=null}setMode(t){this.mode=t;let e=Jt[t];if(!e){this.disable();return}let i=document.getElementById(lt);i||(i=document.createElementNS("http://www.w3.org/2000/svg","svg"),i.id=lt,i.setAttribute("style","position:absolute;width:0;height:0;"),i.innerHTML='<defs><filter id="anid-cb-filter"><feColorMatrix type="matrix" values=""/></filter></defs>',document.body.appendChild(i)),i.querySelector("feColorMatrix").setAttribute("values",e),u(Tt,"html { filter: url(#anid-cb-filter) !important; }"),f("colorBlindMode",t)}enable(){this.mode&&this.setMode(this.mode)}disable(){this.mode=null,c(Tt);let t=document.getElementById(lt);t&&t.remove(),L("colorBlindMode")}toggle(){this.mode?this.disable():this.setMode("protanopia")}};var _t="anid-keyboard-nav",Qt=`
|
|
579
|
+
html body *:focus {
|
|
580
|
+
outline: 3px solid #1565c0 !important;
|
|
581
|
+
outline-offset: 2px !important;
|
|
582
|
+
box-shadow: 0 0 0 4px rgba(21,101,192,0.3) !important;
|
|
583
|
+
}
|
|
584
|
+
`,D=class{constructor(t){this.ctx=t,this.active=!1,this._onTab=null}enable(){this.active||(this.active=!0,document.body.dataset.anidKeyboardNav="true",u(_t,Qt),this._onTab=t=>{t.key==="Tab"&&document.body.classList.add("anid-using-keyboard")},document.addEventListener("keydown",this._onTab))}disable(){this.active=!1,delete document.body.dataset.anidKeyboardNav,document.body.classList.remove("anid-using-keyboard"),c(_t),this._onTab&&(document.removeEventListener("keydown",this._onTab),this._onTab=null)}toggle(){this.active?this.disable():this.enable()}};var Lt="anid-focus",Zt=`
|
|
585
|
+
html body a:focus-visible,
|
|
586
|
+
html body button:focus-visible,
|
|
587
|
+
html body input:focus-visible,
|
|
588
|
+
html body select:focus-visible,
|
|
589
|
+
html body textarea:focus-visible,
|
|
590
|
+
html body [tabindex]:focus-visible {
|
|
591
|
+
outline: 4px solid #ff6f00 !important;
|
|
592
|
+
outline-offset: 3px !important;
|
|
593
|
+
box-shadow: 0 0 0 6px rgba(255,111,0,0.3) !important;
|
|
594
|
+
transition: outline 0.1s ease !important;
|
|
595
|
+
}
|
|
596
|
+
`,O=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(Lt,Zt))}disable(){this.active=!1,c(Lt)}toggle(){this.active?this.disable():this.enable()}};var N=class{constructor(t){this.ctx=t}populateList(t){t.innerHTML="";let e=document.querySelectorAll("h1, h2, h3, h4, h5, h6");if(e.length===0){t.innerHTML=`<li style="padding:8px;color:#888;font-size:13px;">${n("noHeadings")}</li>`;return}e.forEach((i,o)=>{let a=i.tagName[1],r=i.textContent.trim().slice(0,60),h=document.createElement("li"),d=(parseInt(a)-1)*12,l=document.createElement("button");l.style.paddingInlineStart=`${d}px`,l.textContent=`H${a}: ${r}`,l.addEventListener("click",()=>{i.scrollIntoView({behavior:"smooth",block:"center"}),i.focus({preventScroll:!0}),i.style.outline="3px solid #1565c0",i.style.outlineOffset="4px",setTimeout(()=>{i.style.outline="",i.style.outlineOffset=""},2e3)}),h.appendChild(l),t.appendChild(h)})}enable(){}disable(){}};var Ct={banner:"header",navigation:"nav",main:"main",contentinfo:"footer",complementary:"aside",form:"form",search:"search"},j=class{constructor(t){this.ctx=t}populateList(t){t.innerHTML="";let e=[];if(document.querySelectorAll("[role]").forEach(i=>{let o=i.getAttribute("role");Ct[o]&&e.push({el:i,label:i.getAttribute("aria-label")||n(Ct[o]),role:o})}),["header","nav","main","footer","aside","form","search"].forEach(i=>{document.querySelectorAll(i).forEach(o=>{o.getAttribute("role")||e.push({el:o,label:o.getAttribute("aria-label")||n(i),role:i})})}),e.length===0){t.innerHTML=`<li style="padding:8px;color:#888;font-size:13px;">${n("noLandmarks")}</li>`;return}e.forEach(({el:i,label:o,role:a})=>{let r=document.createElement("li"),h=document.createElement("button");h.textContent=`${a}: ${o}`,h.addEventListener("click",()=>{i.scrollIntoView({behavior:"smooth",block:"start"}),i.setAttribute("tabindex","-1"),i.focus({preventScroll:!0})}),r.appendChild(h),t.appendChild(r)})}enable(){}disable(){}};var q=class{constructor(t){this.ctx=t,this.active=!1,this.guide=null,this._onMove=null}enable(){this.active||(this.active=!0,this.guide||(this.guide=document.createElement("div"),this.guide.id="anid-reading-guide",this.guide.style.cssText=`
|
|
597
|
+
position: fixed;
|
|
598
|
+
left: 0;
|
|
599
|
+
width: 100%;
|
|
600
|
+
height: 12px;
|
|
601
|
+
background: rgba(21, 101, 192, 0.15);
|
|
602
|
+
border-top: 2px solid rgba(21, 101, 192, 0.5);
|
|
603
|
+
border-bottom: 2px solid rgba(21, 101, 192, 0.5);
|
|
604
|
+
pointer-events: none;
|
|
605
|
+
z-index: 2147483640;
|
|
606
|
+
transition: top 0.05s linear;
|
|
607
|
+
`,document.body.appendChild(this.guide)),this.guide.style.display="",this._onMove=t=>{this.guide.style.top=`${t.clientY-6}px`},document.addEventListener("mousemove",this._onMove))}disable(){this.active=!1,this._onMove&&(document.removeEventListener("mousemove",this._onMove),this._onMove=null),this.guide&&(this.guide.remove(),this.guide=null)}toggle(){this.active?this.disable():this.enable()}};var G=class{constructor(t){this.ctx=t,this.active=!1,this.maskTop=null,this.maskBottom=null,this._onMove=null}enable(){this.active||(this.active=!0,this.maskTop||(this.maskTop=this._createOverlay("top"),this.maskBottom=this._createOverlay("bottom"),document.body.appendChild(this.maskTop),document.body.appendChild(this.maskBottom)),this.maskTop.style.display="",this.maskBottom.style.display="",this._onMove=t=>{let i=t.clientY;this.maskTop.style.height=`${Math.max(0,i-80/2)}px`,this.maskBottom.style.top=`${i+80/2}px`,this.maskBottom.style.height=`${Math.max(0,window.innerHeight-i-80/2)}px`},document.addEventListener("mousemove",this._onMove))}_createOverlay(t){let e=document.createElement("div");return e.className=`anid-line-mask-${t}`,e.style.cssText=`
|
|
608
|
+
position: fixed;
|
|
609
|
+
left: 0;
|
|
610
|
+
width: 100%;
|
|
611
|
+
background: rgba(0, 0, 0, 0.6);
|
|
612
|
+
pointer-events: none;
|
|
613
|
+
z-index: 2147483640;
|
|
614
|
+
transition: height 0.05s linear, top 0.05s linear;
|
|
615
|
+
`,t==="top"?(e.style.top="0",e.style.height="0"):(e.style.bottom="0",e.style.height="0"),e}disable(){this.active=!1,this._onMove&&(document.removeEventListener("mousemove",this._onMove),this._onMove=null),this.maskTop&&(this.maskTop.remove(),this.maskTop=null),this.maskBottom&&(this.maskBottom.remove(),this.maskBottom=null)}toggle(){this.active?this.disable():this.enable()}};var Et="anid-big-cursor",te=`
|
|
616
|
+
html body, html body *:not(#opennagish-widget) {
|
|
617
|
+
cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 4l28 20H20l-1 1 9 17-5 2-9-17-6 6z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 4 4, auto !important;
|
|
618
|
+
}
|
|
619
|
+
html body a, html body a *, html body button, html body button *,
|
|
620
|
+
html body [role="button"], html body input[type="submit"],
|
|
621
|
+
html body input[type="button"], html body label, html body select {
|
|
622
|
+
cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M20 4v28h5l-1-1 8-13h8L12 42V4z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 14 4, pointer !important;
|
|
623
|
+
}
|
|
624
|
+
`,K=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(Et,te))}disable(){this.active=!1,c(Et)}toggle(){this.active?this.disable():this.enable()}};var Y=class{constructor(t){this.ctx=t,this.overlay=null,this._escHandler=null}toggle(){this.overlay?this.close():this.show()}show(){let t=this.extractContent();this.overlay=document.createElement("div"),this.overlay.setAttribute("role","dialog"),this.overlay.setAttribute("aria-modal","true"),this.overlay.setAttribute("aria-label",n("screenReaderPreview")),this.overlay.style.cssText=`
|
|
625
|
+
position: fixed;
|
|
626
|
+
z-index: 2147483645;
|
|
627
|
+
top: 0; left: 0; right: 0; bottom: 0;
|
|
628
|
+
background: rgba(0,0,0,0.92);
|
|
629
|
+
color: #e0e0e0;
|
|
630
|
+
overflow-y: auto;
|
|
631
|
+
padding: 60px 40px 40px;
|
|
632
|
+
font-family: 'Courier New', monospace;
|
|
633
|
+
font-size: 15px;
|
|
634
|
+
line-height: 2;
|
|
635
|
+
white-space: pre-wrap;
|
|
636
|
+
`,this.overlay.textContent=t;let e=document.createElement("button");e.textContent=`\u2715 ${n("close")}`,e.setAttribute("aria-label",n("close")),e.style.cssText=`
|
|
637
|
+
position: fixed;
|
|
638
|
+
top: 12px; inset-inline-end: 12px;
|
|
639
|
+
z-index: 2147483646;
|
|
640
|
+
background: #c62828;
|
|
641
|
+
color: #fff;
|
|
642
|
+
border: none;
|
|
643
|
+
padding: 10px 20px;
|
|
644
|
+
border-radius: 8px;
|
|
645
|
+
font-size: 16px;
|
|
646
|
+
cursor: pointer;
|
|
647
|
+
min-width: 44px;
|
|
648
|
+
min-height: 44px;
|
|
649
|
+
`,e.addEventListener("click",()=>this.close()),this.overlay.appendChild(e),document.body.appendChild(this.overlay),e.focus(),this._escHandler=i=>{i.key==="Escape"&&this.close()},document.addEventListener("keydown",this._escHandler)}close(){this.overlay&&(this.overlay.remove(),this.overlay=null),this._escHandler&&(document.removeEventListener("keydown",this._escHandler),this._escHandler=null)}extractContent(){let t=[],e=document.title;e&&t.push(`[Page Title] ${e}
|
|
650
|
+
`);let i=document.documentElement.lang;i&&t.push(`[Language] ${i}
|
|
651
|
+
`);let o=a=>{if(a.nodeType===Node.TEXT_NODE){let d=a.textContent.trim();d&&t.push(d);return}if(a.nodeType!==Node.ELEMENT_NODE)return;let r=a.tagName.toLowerCase(),h=a.getAttribute("role");if(!["script","style","noscript","template"].includes(r)&&!(a.hidden||a.getAttribute("aria-hidden")==="true")&&a.id!=="opennagish-widget"){if(/^h[1-6]$/.test(r)){t.push(`
|
|
652
|
+
[${"#".repeat(parseInt(r[1]))} Heading ${r[1]}] ${a.textContent.trim()}`);return}if(r==="img"){let d=a.alt||n("noAltText");t.push(`[Image: ${d}]`);return}if(r==="a"&&a.href){t.push(`[Link: ${a.textContent.trim()} -> ${a.href}]`);return}if(["nav","header","footer","main","aside"].includes(r)||h){let d=a.getAttribute("aria-label");t.push(`
|
|
653
|
+
--- [${h||r}${d?": "+d:""}] ---`)}r==="li"&&t.push(" \u2022 ");for(let d of a.childNodes)o(d)}};return o(document.body),t.join(`
|
|
654
|
+
`)}enable(){}disable(){this.close()}};var $t="anid-links",ee=`
|
|
655
|
+
html body a {
|
|
656
|
+
text-decoration: underline !important;
|
|
657
|
+
text-decoration-thickness: 2px !important;
|
|
658
|
+
text-underline-offset: 3px !important;
|
|
659
|
+
outline: 2px solid transparent !important;
|
|
660
|
+
border-bottom: 2px solid #1565c0 !important;
|
|
661
|
+
background-color: rgba(21, 101, 192, 0.08) !important;
|
|
662
|
+
padding: 1px 3px !important;
|
|
663
|
+
border-radius: 2px !important;
|
|
664
|
+
}
|
|
665
|
+
html body a:hover {
|
|
666
|
+
background-color: rgba(21, 101, 192, 0.18) !important;
|
|
667
|
+
}
|
|
668
|
+
`,V=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u($t,ee))}disable(){this.active=!1,c($t)}toggle(){this.active?this.disable():this.enable()}};var dt="data-anid-alt-shown",F=class{constructor(t){this.ctx=t,this.active=!1,this.overlays=[]}enable(){this.active||(this.active=!0,document.querySelectorAll("img").forEach(t=>{if(t.getAttribute(dt))return;let e=t.alt||t.getAttribute("aria-label")||"",i=e||`\u26A0 ${n("noAltText")}`,o=document.createElement("span");o.className="anid-alt-overlay",o.style.cssText=`
|
|
669
|
+
position: absolute;
|
|
670
|
+
bottom: 4px;
|
|
671
|
+
left: 4px;
|
|
672
|
+
right: 4px;
|
|
673
|
+
background: ${e?"rgba(21,101,192,0.9)":"rgba(198,40,40,0.9)"};
|
|
674
|
+
color: #fff;
|
|
675
|
+
font-size: 12px;
|
|
676
|
+
padding: 4px 8px;
|
|
677
|
+
border-radius: 4px;
|
|
678
|
+
z-index: 2147483630;
|
|
679
|
+
pointer-events: none;
|
|
680
|
+
word-break: break-word;
|
|
681
|
+
max-height: 60px;
|
|
682
|
+
overflow: hidden;
|
|
683
|
+
font-family: sans-serif;
|
|
684
|
+
line-height: 1.4;
|
|
685
|
+
`,o.textContent=i;let a=t.parentElement;if(a){let r=getComputedStyle(a).position;r==="static"&&(a.style.position="relative"),a.appendChild(o),t.setAttribute(dt,"true"),this.overlays.push({overlay:o,img:t,wrapper:a,hadPosition:r})}}))}disable(){this.active=!1,this.overlays.forEach(({overlay:t,img:e,wrapper:i,hadPosition:o})=>{t.remove(),e.removeAttribute(dt),o==="static"&&(i.style.position="")}),this.overlays=[]}toggle(){this.active?this.disable():this.enable()}};var Ht="anid-animations",k="data-anid-orig-src",ie=`
|
|
686
|
+
html body *:not(#opennagish-widget),
|
|
687
|
+
html body *:not(#opennagish-widget)::before,
|
|
688
|
+
html body *:not(#opennagish-widget)::after {
|
|
689
|
+
animation-duration: 0.001ms !important;
|
|
690
|
+
animation-iteration-count: 1 !important;
|
|
691
|
+
transition-duration: 0.001ms !important;
|
|
692
|
+
scroll-behavior: auto !important;
|
|
693
|
+
}
|
|
694
|
+
`,U=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(Ht,ie),document.querySelectorAll('img[src$=".gif"], img[src*=".gif?"]').forEach(t=>{if(!t.getAttribute(k))try{let e=document.createElement("canvas");e.width=t.naturalWidth||t.width||100,e.height=t.naturalHeight||t.height||100,e.getContext("2d").drawImage(t,0,0,e.width,e.height),t.setAttribute(k,t.src),t.src=e.toDataURL()}catch(e){}}))}disable(){this.active=!1,c(Ht),document.querySelectorAll(`[${k}]`).forEach(t=>{t.src=t.getAttribute(k),t.removeAttribute(k)})}toggle(){this.active?this.disable():this.enable()}};var S="data-anid-orig-src",W=class{constructor(t){this.ctx=t,this.active=!1,this.mutedElements=[]}enable(){this.active||(this.active=!0,document.querySelectorAll("audio, video").forEach(t=>{t.muted||(t.muted=!0,t.pause(),this.mutedElements.push(t))}),document.querySelectorAll("iframe").forEach(t=>{try{let e=t.src||"";if(!e||t.getAttribute(S))return;if((e.includes("youtube")||e.includes("vimeo")||e.includes("dailymotion"))&&!e.includes("mute=1")&&!e.includes("muted=1")){t.setAttribute(S,e);let i=e.includes("?")?"&":"?";t.src=e+i+"mute=1"}}catch(e){}}))}disable(){this.active=!1,this.mutedElements.forEach(t=>{t.muted=!1}),this.mutedElements=[],document.querySelectorAll(`iframe[${S}]`).forEach(t=>{t.src=t.getAttribute(S),t.removeAttribute(S)})}toggle(){this.active?this.disable():this.enable()}};var X=class{constructor(t){this.ctx=t,this.modal=null,this.backdrop=null,this._escHandler=null}show(){let t=this.ctx.config;if(t.statementUrl){window.open(t.statementUrl,"_blank","noopener,noreferrer");return}this.close();let e=t.statementData||{};this.backdrop=document.createElement("div"),this.backdrop.style.cssText="position:fixed;z-index:2147483644;inset:0;background:rgba(0,0,0,0.5);",this.backdrop.addEventListener("click",()=>this.close()),this.modal=document.createElement("div");let i=b()==="he"||b()==="ar"?"rtl":"ltr";this.modal.setAttribute("dir",i),this.modal.setAttribute("role","dialog"),this.modal.setAttribute("aria-modal","true"),this.modal.setAttribute("aria-label",n("statementTitle")),this.modal.style.cssText=`
|
|
695
|
+
position: fixed; z-index: 2147483645;
|
|
696
|
+
top: 50%; left: 50%; transform: translate(-50%, -50%);
|
|
697
|
+
width: 600px; max-width: calc(100vw - 40px); max-height: calc(100vh - 80px);
|
|
698
|
+
background: #fff; border-radius: 12px;
|
|
699
|
+
box-shadow: 0 16px 48px rgba(0,0,0,0.3);
|
|
700
|
+
overflow-y: auto; padding: 32px;
|
|
701
|
+
font-family: sans-serif; color: #1a1a2e; line-height: 1.7;
|
|
702
|
+
`;let a=(e.accommodations||[n("contrastAndColors"),n("fontSizeAdjustment"),n("keyboardNavigation"),n("screenReaderCompat"),n("linkHighlighting"),n("animationControl")]).map(p=>`<li>${g(p)}</li>`).join(""),r=e.coordinatorName?`<p><strong>${g(n("statementCoordinator"))}:</strong> ${g(e.coordinatorName)}</p>`:"",h=e.orgPhone?`<p><strong>${g(n("statementPhone"))}:</strong> <a href="tel:${g(e.orgPhone)}">${g(e.orgPhone)}</a></p>`:"",d=e.orgEmail?`<p><strong>${g(n("statementEmail"))}:</strong> <a href="mailto:${g(e.orgEmail)}">${g(e.orgEmail)}</a></p>`:"",l=e.lastAuditDate?`<p><strong>${g(n("statementLastAudit"))}:</strong> ${g(e.lastAuditDate)}</p>`:"";this.modal.innerHTML=`
|
|
703
|
+
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;">
|
|
704
|
+
<h2 style="font-size:22px;margin:0;">${g(n("statementTitle"))}</h2>
|
|
705
|
+
<button id="anid-stmt-close" style="background:none;border:none;font-size:24px;cursor:pointer;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;" aria-label="${g(n("close"))}">✕</button>
|
|
706
|
+
</div>
|
|
707
|
+
<p>${g(n("statementIntro"))}</p>
|
|
708
|
+
${r}
|
|
709
|
+
${h}
|
|
710
|
+
${d}
|
|
711
|
+
${l}
|
|
712
|
+
<p><strong>${g(n("statementAccommodations"))}:</strong></p>
|
|
713
|
+
<ul style="padding-inline-start:20px;margin-bottom:16px;">${a}</ul>
|
|
714
|
+
<p style="font-size:12px;color:#888;">${g(n("poweredBy"))} <a href="https://gitee.com/WilliamHao/npm-c-a11y" target="_blank" rel="noopener noreferrer" style="color:#888;text-decoration:underline;">A11y</a> | WCAG 2.1 AA</p>
|
|
715
|
+
`,document.body.appendChild(this.backdrop),document.body.appendChild(this.modal),this.modal.querySelector("#anid-stmt-close").addEventListener("click",()=>this.close()),this.modal.querySelector("#anid-stmt-close").focus(),this._escHandler=p=>{p.key==="Escape"&&this.close()},document.addEventListener("keydown",this._escHandler)}close(){this.modal&&(this.modal.remove(),this.modal=null),this.backdrop&&(this.backdrop.remove(),this.backdrop=null),this._escHandler&&(document.removeEventListener("keydown",this._escHandler),this._escHandler=null)}enable(){}disable(){this.close()}};var J=class{constructor(t){this.ctx=t,this.modal=null,this.backdrop=null,this._escHandler=null}_buildSvg(){let t="WCAG 2.1 AA",e=`A11y ${n("badgeCompliant")}`;return`<svg xmlns="http://www.w3.org/2000/svg" width="240" height="40" viewBox="0 0 240 40">
|
|
716
|
+
<defs>
|
|
717
|
+
<linearGradient id="abg" x1="0" y1="0" x2="0" y2="1">
|
|
718
|
+
<stop offset="0%" stop-color="#1976d2"/>
|
|
719
|
+
<stop offset="100%" stop-color="#0d47a1"/>
|
|
720
|
+
</linearGradient>
|
|
721
|
+
</defs>
|
|
722
|
+
<rect width="240" height="40" rx="8" fill="url(#abg)"/>
|
|
723
|
+
<rect x="1" y="1" width="238" height="38" rx="7" fill="none" stroke="#fff" stroke-opacity="0.25"/>
|
|
724
|
+
<circle cx="20" cy="20" r="12" fill="#fff" fill-opacity="0.2"/>
|
|
725
|
+
<text x="20" y="25" text-anchor="middle" fill="#fff" font-size="16" font-family="sans-serif">♿</text>
|
|
726
|
+
<text x="40" y="16" fill="#fff" font-size="11" font-family="sans-serif" font-weight="bold">${g(t)}</text>
|
|
727
|
+
<text x="40" y="31" fill="#fff" font-size="10" font-family="sans-serif" opacity="0.85">${g(e)}</text>
|
|
728
|
+
</svg>`}show(){this.close();let t=this._buildSvg(),e=`<a href="#" title="Accessibility"><img src="data:image/svg+xml,${encodeURIComponent(t.trim())}" alt="WCAG 2.1 AA Accessible" width="240" height="40"></a>`,i=b()==="he"||b()==="ar"?"rtl":"ltr";this.backdrop=document.createElement("div"),this.backdrop.style.cssText="position:fixed;z-index:2147483644;inset:0;background:rgba(0,0,0,0.5);",this.backdrop.addEventListener("click",()=>this.close()),this.modal=document.createElement("div"),this.modal.setAttribute("role","dialog"),this.modal.setAttribute("aria-modal","true"),this.modal.setAttribute("dir",i),this.modal.setAttribute("aria-label",n("complianceBadge")),this.modal.style.cssText=`
|
|
729
|
+
position:fixed;z-index:2147483645;
|
|
730
|
+
top:50%;left:50%;transform:translate(-50%,-50%);
|
|
731
|
+
width:520px;max-width:calc(100vw - 40px);
|
|
732
|
+
background:#fff;border-radius:12px;
|
|
733
|
+
box-shadow:0 16px 48px rgba(0,0,0,0.3);
|
|
734
|
+
padding:32px;font-family:sans-serif;color:#1a1a2e;
|
|
735
|
+
`,this.modal.innerHTML=`
|
|
736
|
+
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;">
|
|
737
|
+
<h2 style="font-size:20px;margin:0;">${g(n("complianceBadge"))}</h2>
|
|
738
|
+
<button id="anid-badge-close" style="background:none;border:none;font-size:24px;cursor:pointer;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;" aria-label="${g(n("close"))}">✕</button>
|
|
739
|
+
</div>
|
|
740
|
+
<div style="text-align:center;padding:24px;background:#f5f5f5;border-radius:8px;margin-bottom:20px;">${t}</div>
|
|
741
|
+
<label style="display:block;font-size:13px;color:#666;margin-bottom:6px;font-weight:600;">${g(n("embedCode"))}</label>
|
|
742
|
+
<textarea readonly style="width:100%;height:80px;padding:10px;border:1px solid #ddd;border-radius:8px;font-size:12px;font-family:monospace;resize:none;background:#fafafa;direction:ltr;text-align:left;">${g(e)}</textarea>
|
|
743
|
+
<button id="anid-badge-copy" style="display:block;margin-top:14px;padding:10px 24px;background:#1565c0;color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:14px;min-height:44px;font-weight:600;margin-inline-start:auto;">${g(n("copyCode"))}</button>
|
|
744
|
+
`,document.body.appendChild(this.backdrop),document.body.appendChild(this.modal);let o=this.modal.querySelector("#anid-badge-copy");this.modal.querySelector("#anid-badge-close").addEventListener("click",()=>this.close()),o.addEventListener("click",()=>{this._copyToClipboard(e).then(()=>{o.textContent=n("copied"),o.style.background="#2e7d32",setTimeout(()=>{o.textContent=n("copyCode"),o.style.background="#1565c0"},2e3),this.ctx.announce(n("copied"))}).catch(()=>{})}),this._escHandler=a=>{a.key==="Escape"&&this.close()},document.addEventListener("keydown",this._escHandler),this.modal.querySelector("#anid-badge-close").focus()}_copyToClipboard(t){var e;return(e=navigator.clipboard)!=null&&e.writeText?navigator.clipboard.writeText(t):new Promise((i,o)=>{try{let a=document.createElement("textarea");a.value=t,a.style.cssText="position:fixed;left:-9999px;top:-9999px;opacity:0;",document.body.appendChild(a),a.select();let r=document.execCommand("copy");a.remove(),r?i():o(new Error("execCommand failed"))}catch(a){o(a)}})}close(){this.modal&&(this.modal.remove(),this.modal=null),this.backdrop&&(this.backdrop.remove(),this.backdrop=null),this._escHandler&&(document.removeEventListener("keydown",this._escHandler),this._escHandler=null)}enable(){}disable(){this.close()}};var oe={he:"he-IL",en:"en-US",ar:"ar-SA",ru:"ru-RU"},Mt="data-anid-tts-hl",Q=class{constructor(t){this.ctx=t,this.hoverActive=!1,this.selectionActive=!1,this.reading=!1,this._onMouseOver=this._onMouseOver.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._highlighted=null,this._savedStyles=null,this._hoverDebounce=null,this._warmUpVoices()}_warmUpVoices(){this.supported&&(this.synth.getVoices().length||this.synth.addEventListener("voiceschanged",()=>{},{once:!0}))}_unlockAudio(){if(!this._audioUnlocked)try{let t=new(window.AudioContext||window.webkitAudioContext),e=t.createBuffer(1,1,22050),i=t.createBufferSource();i.buffer=e,i.connect(t.destination),i.start(),t.resume().then(()=>t.close()),this._audioUnlocked=!0}catch(t){}}get synth(){return window.speechSynthesis}get supported(){return"speechSynthesis"in window}_getLang(){let e=document.documentElement.lang||b()||"en";return oe[e]||e}_findVoice(t){let e=this.synth.getVoices();if(!e.length)return null;let i=t.split("-")[0].toLowerCase();return e.find(o=>o.lang.toLowerCase().startsWith(i))||e.find(o=>o.default)||e[0]}_speak(t){if(!this.supported||!t.trim())return;this._unlockAudio(),this._clearResumeTimer();let e=()=>{let i=new SpeechSynthesisUtterance(t),o=this._getLang(),a=this._findVoice(o);a?(i.voice=a,i.lang=a.lang):i.lang=o,i.rate=1,i.pitch=1,i.onend=()=>{this.reading=!1,this._clearResumeTimer()},i.onerror=()=>{this.reading=!1,this._clearResumeTimer()},this.reading=!0,this.synth.speak(i),this._startResumeTimer()};this.synth.speaking||this.synth.pending?(this.synth.cancel(),setTimeout(e,80)):e()}_startResumeTimer(){this._resumeTimer=setInterval(()=>{this.synth.speaking&&!this.synth.paused&&(this.synth.pause(),this.synth.resume())},1e4)}_clearResumeTimer(){this._resumeTimer&&(clearInterval(this._resumeTimer),this._resumeTimer=null)}stop(){this.supported&&(this.synth.cancel(),this.reading=!1,this._clearResumeTimer(),this._clearHighlight())}enableHover(){this.hoverActive||(this.hoverActive=!0,document.addEventListener("mouseover",this._onMouseOver,!0))}disableHover(){this.hoverActive=!1,document.removeEventListener("mouseover",this._onMouseOver,!0),this._clearHighlight(),clearTimeout(this._hoverDebounce),!this.selectionActive&&!this.reading&&this.stop()}_onMouseOver(t){let e=t.target;!e||e.nodeType!==1||e.closest("#opennagish-widget")||(clearTimeout(this._hoverDebounce),this._hoverDebounce=setTimeout(()=>{let i=this._getElementText(e);i&&(this._clearHighlight(),this._savedStyles={outline:e.style.outline,outlineOffset:e.style.outlineOffset,background:e.style.background},e.setAttribute(Mt,""),e.style.outline="3px solid #1565c0",e.style.outlineOffset="2px",e.style.background="rgba(21,101,192,0.08)",this._highlighted=e,this._speak(i))},300))}_getElementText(t){return t.tagName==="IMG"?t.alt||"":t.tagName==="INPUT"||t.tagName==="TEXTAREA"?t.value||t.placeholder||"":(t.innerText||t.textContent||"").trim().substring(0,500)}_clearHighlight(){this._highlighted&&(this._highlighted.removeAttribute(Mt),this._savedStyles&&(this._highlighted.style.outline=this._savedStyles.outline,this._highlighted.style.outlineOffset=this._savedStyles.outlineOffset,this._highlighted.style.background=this._savedStyles.background),this._highlighted=null,this._savedStyles=null)}enableSelection(){this.selectionActive||(this.selectionActive=!0,document.addEventListener("mouseup",this._onMouseUp,!0))}disableSelection(){this.selectionActive=!1,document.removeEventListener("mouseup",this._onMouseUp,!0),!this.hoverActive&&!this.reading&&this.stop()}_onMouseUp(){let t=window.getSelection(),e=t?t.toString().trim():"";e.length>0&&this._speak(e)}readPage(){let t=this._extractPageText();t&&(this.ctx.announce(n("ttsReading")),this._speak(t))}_extractPageText(){let t=[],e=i=>{if(i.nodeType===Node.TEXT_NODE){let a=i.textContent.trim();a&&t.push(a);return}if(i.nodeType!==Node.ELEMENT_NODE)return;let o=i.tagName.toLowerCase();if(!["script","style","noscript","template"].includes(o)&&!(i.hidden||i.getAttribute("aria-hidden")==="true")&&i.id!=="opennagish-widget")for(let a of i.childNodes)e(a)};return e(document.body),t.join(" ").substring(0,5e3)}enable(){}disable(){this.disableHover(),this.disableSelection(),this.stop()}};var ne='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm9 7h-6l-1.41-1.41A2 2 0 0 0 12.17 7H12a2 2 0 0 0-1.42.59L9 9H3a1 1 0 0 0 0 2h5l1 1v3l-2 5a1 1 0 0 0 1.8.8L11 16h2l2.2 4.8a1 1 0 0 0 1.8-.8l-2-5v-3l1-1h5a1 1 0 0 0 0-2z"/></svg>',Pt={darkMode:"darkMode",monochrome:"monochrome",textSpacing:"spacing",dyslexiaFont:"dyslexiaFont",hideImages:"hideImages",colorBlindSim:"colorBlind",keyboardNav:"keyboardNav",focusIndicators:"focus",readingGuide:"readingGuide",lineMask:"lineMask",bigCursor:"cursor",linkHighlight:"links",imageAltText:"images",stopAnimations:"animations",muteSounds:"muteSounds"},ae=["bottom-left","bottom-right","top-left","top-right"],A=null,ct=class{constructor(){this.isOpen=!1,this.modules={},this.shadowHost=null,this.shadowRoot=null,this.panel=null,this.trigger=null,this.config=window.OpenA11yConfig||{},this._keydownHandler=null,this._resizeHandler=null,this._destroyed=!1}init(){let t=ot("lang")||gt(this.config.lang);tt(t),this.shadowHost=document.createElement("div"),this.shadowHost.id="opennagish-widget",this.shadowHost.style.cssText="all:initial;",document.body.appendChild(this.shadowHost),this.shadowRoot=this.shadowHost.attachShadow({mode:"open"});let e=document.createElement("style");e.textContent=ut(),this.shadowRoot.appendChild(e);let i=C("div",{className:"anid-live-region",role:"status","aria-live":"polite","aria-atomic":"true"});this.shadowRoot.appendChild(i),this.createTrigger(),this.createPanel(),this.initModules(),this.restoreState(),this.bindGlobalKeys(),this.bindViewportListeners()}createTrigger(){let t=this._getPosition();this.trigger=C("button",{className:"anid-trigger","aria-label":n("openPanel"),"aria-expanded":"false","aria-controls":"anid-panel",innerHTML:ne}),this.positionElement(this.trigger,t),this.makeDraggable(this.trigger),this.shadowRoot.appendChild(this.trigger)}createPanel(){let t=this._getPosition();this.panel=C("div",{className:"anid-panel",id:"anid-panel",role:"dialog","aria-label":n("panelTitle"),"aria-modal":"false"}),this.panel.setAttribute("dir",et()),this.positionPanel(t),this.panel.innerHTML=this.buildPanelHTML(),this.shadowRoot.appendChild(this.panel),this.bindPanelEvents()}_getPosition(){let t=this.config.position||"bottom-left";return ae.includes(t)?t:"bottom-left"}buildPanelHTML(){let e=mt().map(i=>{let o={en:"English",zh:"\u4E2D\u6587"};return`<option value="${i}" ${i===b()?"selected":""}>${o[i]||i}</option>`}).join("");return`
|
|
745
|
+
<div class="anid-panel-header">
|
|
746
|
+
<span class="anid-panel-title">${n("panelTitle")}</span>
|
|
747
|
+
<select class="anid-lang-select" aria-label="${n("language")}">${e}</select>
|
|
748
|
+
<button class="anid-close-btn" aria-label="${n("closePanel")}">✕</button>
|
|
749
|
+
</div>
|
|
750
|
+
<div class="anid-panel-body">
|
|
751
|
+
${this.buildCategory("vision",n("categoryVision"),"\u{1F441}",[{id:"fontSize",type:"buttons",shortcut:"Alt+F"},{id:"highContrast",type:"contrast",shortcut:"Alt+C"},{id:"darkMode",type:"toggle",shortcut:"Alt+D"},{id:"monochrome",type:"toggle"},{id:"saturation",type:"slider"},{id:"textSpacing",type:"toggle"},{id:"dyslexiaFont",type:"toggle"},{id:"hideImages",type:"toggle"},{id:"colorBlindSim",type:"colorblind"}])}
|
|
752
|
+
${this.buildCategory("navigation",n("categoryNavigation"),"\u{1F9ED}",[{id:"keyboardNav",type:"toggle",shortcut:"Alt+K"},{id:"focusIndicators",type:"toggle"},{id:"headingStructure",type:"headings"},{id:"pageStructure",type:"landmarks"},{id:"readingGuide",type:"toggle",shortcut:"Alt+G"},{id:"lineMask",type:"toggle"},{id:"bigCursor",type:"toggle"},{id:"screenReaderPreview",type:"action"}])}
|
|
753
|
+
${this.buildCategory("media",n("categoryMedia"),"\u{1F50A}",[{id:"ttsHover",type:"toggle"},{id:"ttsSelection",type:"toggle"},{id:"ttsReadPage",type:"action",shortcut:"Alt+T"},{id:"linkHighlight",type:"toggle",shortcut:"Alt+L"},{id:"imageAltText",type:"toggle"},{id:"stopAnimations",type:"toggle"},{id:"muteSounds",type:"toggle",shortcut:"Alt+M"}])}
|
|
754
|
+
${this.buildCategory("compliance",n("categoryCompliance"),"\u2705",[{id:"accessibilityStatement",type:"action"},{id:"complianceBadge",type:"action"}])}
|
|
755
|
+
</div>
|
|
756
|
+
<div class="anid-panel-footer">
|
|
757
|
+
<button class="anid-reset-btn">${n("resetAll")}</button>
|
|
758
|
+
</div>
|
|
759
|
+
`}buildCategory(t,e,i,o){let a=t==="vision"?"true":"false",r="";for(let h of o)r+=this.buildFeature(h);return`
|
|
760
|
+
<div class="anid-category" data-category="${t}" data-expanded="${a}">
|
|
761
|
+
<button class="anid-category-header" aria-expanded="${a}">
|
|
762
|
+
<span class="anid-category-icon">${i}</span>
|
|
763
|
+
<span>${e}</span>
|
|
764
|
+
<span class="anid-category-chevron">▼</span>
|
|
765
|
+
</button>
|
|
766
|
+
<div class="anid-category-content" role="region">
|
|
767
|
+
${r}
|
|
768
|
+
</div>
|
|
769
|
+
</div>
|
|
770
|
+
`}buildFeature(t){let e=n(t.id),i=t.shortcut?` <kbd class="anid-shortcut">${t.shortcut}</kbd>`:"",o=`${e}${i}`;switch(t.type){case"toggle":return`
|
|
771
|
+
<div class="anid-feature" data-feature="${t.id}">
|
|
772
|
+
<span class="anid-feature-label">${o}</span>
|
|
773
|
+
<label class="anid-toggle">
|
|
774
|
+
<input type="checkbox" data-toggle="${t.id}" aria-label="${e}">
|
|
775
|
+
<span class="anid-toggle-slider"></span>
|
|
776
|
+
</label>
|
|
777
|
+
</div>`;case"buttons":return`
|
|
778
|
+
<div class="anid-feature" data-feature="${t.id}">
|
|
779
|
+
<span class="anid-feature-label">${o}</span>
|
|
780
|
+
<div class="anid-btn-group">
|
|
781
|
+
<button class="anid-btn" data-action="fontDecrease" aria-label="${n("fontSizeDecrease")}">A-</button>
|
|
782
|
+
<button class="anid-btn" data-action="fontReset" aria-label="${n("fontSizeReset")}">A</button>
|
|
783
|
+
<button class="anid-btn" data-action="fontIncrease" aria-label="${n("fontSizeIncrease")}">A+</button>
|
|
784
|
+
</div>
|
|
785
|
+
</div>`;case"contrast":return`
|
|
786
|
+
<div class="anid-feature" data-feature="${t.id}">
|
|
787
|
+
<span class="anid-feature-label">${o}</span>
|
|
788
|
+
<div class="anid-btn-group">
|
|
789
|
+
<button class="anid-btn" data-action="contrastDark" aria-label="${n("contrastDark")}">${n("contrastDark")}</button>
|
|
790
|
+
<button class="anid-btn" data-action="contrastLight" aria-label="${n("contrastLight")}">${n("contrastLight")}</button>
|
|
791
|
+
<button class="anid-btn" data-action="contrastInvert" aria-label="${n("contrastInvert")}">${n("contrastInvert")}</button>
|
|
792
|
+
</div>
|
|
793
|
+
</div>`;case"slider":return`
|
|
794
|
+
<div class="anid-feature" data-feature="${t.id}">
|
|
795
|
+
<span class="anid-feature-label">${o}</span>
|
|
796
|
+
<div class="anid-slider-wrap">
|
|
797
|
+
<input type="range" class="anid-slider" data-slider="${t.id}" min="0" max="200" value="100" aria-label="${e}">
|
|
798
|
+
</div>
|
|
799
|
+
</div>`;case"colorblind":return`
|
|
800
|
+
<div class="anid-feature" data-feature="${t.id}">
|
|
801
|
+
<span class="anid-feature-label">${o}</span>
|
|
802
|
+
<label class="anid-toggle">
|
|
803
|
+
<input type="checkbox" data-toggle="${t.id}" aria-label="${e}">
|
|
804
|
+
<span class="anid-toggle-slider"></span>
|
|
805
|
+
</label>
|
|
806
|
+
</div>
|
|
807
|
+
<div class="anid-sub-options" data-sub="${t.id}" style="display:none">
|
|
808
|
+
<div class="anid-btn-group">
|
|
809
|
+
<button class="anid-btn" data-action="cbProtanopia">${n("protanopia")}</button>
|
|
810
|
+
<button class="anid-btn" data-action="cbDeuteranopia">${n("deuteranopia")}</button>
|
|
811
|
+
<button class="anid-btn" data-action="cbTritanopia">${n("tritanopia")}</button>
|
|
812
|
+
</div>
|
|
813
|
+
</div>`;case"headings":return`
|
|
814
|
+
<div class="anid-feature" data-feature="${t.id}">
|
|
815
|
+
<span class="anid-feature-label">${o}</span>
|
|
816
|
+
<button class="anid-btn" data-action="toggleHeadings">${n("jumpTo")}</button>
|
|
817
|
+
</div>
|
|
818
|
+
<ul class="anid-heading-list" data-list="headings" style="display:none"></ul>`;case"landmarks":return`
|
|
819
|
+
<div class="anid-feature" data-feature="${t.id}">
|
|
820
|
+
<span class="anid-feature-label">${o}</span>
|
|
821
|
+
<button class="anid-btn" data-action="toggleLandmarks">${n("jumpTo")}</button>
|
|
822
|
+
</div>
|
|
823
|
+
<ul class="anid-landmark-list" data-list="landmarks" style="display:none"></ul>`;case"action":return`
|
|
824
|
+
<div class="anid-feature" data-feature="${t.id}">
|
|
825
|
+
<span class="anid-feature-label">${o}</span>
|
|
826
|
+
<button class="anid-btn" data-action="${t.id}">${e}</button>
|
|
827
|
+
</div>`;default:return""}}bindPanelEvents(){let t=this.shadowRoot;t.querySelector(".anid-close-btn").addEventListener("click",()=>this.close()),t.querySelector(".anid-lang-select").addEventListener("change",e=>{let i=e.target.value;tt(i),f("lang",i),this.rebuildPanel(),y(n("panelTitle"),t)}),t.querySelector(".anid-reset-btn").addEventListener("click",()=>{this.resetAll(),y(n("resetAll"),t)}),t.querySelectorAll(".anid-category-header").forEach(e=>{e.addEventListener("click",()=>{let i=e.closest(".anid-category"),o=i.dataset.expanded==="true";i.dataset.expanded=o?"false":"true",e.setAttribute("aria-expanded",String(!o))})}),t.querySelectorAll("[data-toggle]").forEach(e=>{e.addEventListener("change",()=>{this.handleToggle(e.dataset.toggle,e.checked)})}),t.querySelectorAll("[data-action]").forEach(e=>{e.addEventListener("click",()=>{this.handleAction(e.dataset.action)})}),t.querySelectorAll("[data-slider]").forEach(e=>{e.addEventListener("input",()=>{this.handleSlider(e.dataset.slider,parseInt(e.value,10))})})}handleToggle(t,e){var a,r,h,d,l;if(t==="ttsHover"){e?(a=this.modules.tts)==null||a.enableHover():(r=this.modules.tts)==null||r.disableHover(),f(t,e),y(`${n(t)} ${e?n("on"):n("off")}`,this.shadowRoot);return}if(t==="ttsSelection"){e?(h=this.modules.tts)==null||h.enableSelection():(d=this.modules.tts)==null||d.disableSelection(),f(t,e),y(`${n(t)} ${e?n("on"):n("off")}`,this.shadowRoot);return}let i=Pt[t],o=i?this.modules[i]:null;if(o&&(e?o.enable():o.disable(),f(t,e)),t==="colorBlindSim"){let p=this.shadowRoot.querySelector('[data-sub="colorBlindSim"]');p&&(p.style.display=e?"":"none"),e||(l=this.modules.colorBlind)==null||l.disable()}y(`${n(t)} ${e?n("on"):n("off")}`,this.shadowRoot)}handleAction(t){var e,i,o,a,r,h,d,l,p,m;switch(t){case"fontIncrease":(e=this.modules.fontSize)==null||e.increase();break;case"fontDecrease":(i=this.modules.fontSize)==null||i.decrease();break;case"fontReset":(o=this.modules.fontSize)==null||o.reset();break;case"contrastDark":this.toggleContrast("dark");break;case"contrastLight":this.toggleContrast("light");break;case"contrastInvert":this.toggleContrast("invert");break;case"cbProtanopia":(a=this.modules.colorBlind)==null||a.setMode("protanopia");break;case"cbDeuteranopia":(r=this.modules.colorBlind)==null||r.setMode("deuteranopia");break;case"cbTritanopia":(h=this.modules.colorBlind)==null||h.setMode("tritanopia");break;case"toggleHeadings":this.toggleList("headings");break;case"toggleLandmarks":this.toggleList("landmarks");break;case"screenReaderPreview":(d=this.modules.screenReader)==null||d.toggle();break;case"ttsReadPage":(l=this.modules.tts)==null||l.readPage();break;case"accessibilityStatement":(p=this.modules.statement)==null||p.show();break;case"complianceBadge":(m=this.modules.badge)==null||m.show();break}}handleSlider(t,e){var i;t==="saturation"&&((i=this.modules.saturation)==null||i.setValue(e),f("saturation",e))}toggleContrast(t){var a;let i=ot("contrast","none")===t?"none":t;(a=this.modules.contrast)==null||a.setMode(i),f("contrast",i),this.updateContrastButtons(i);let o=i==="none"?`${n("highContrast")} ${n("off")}`:`${n("highContrast")} ${n(i==="dark"?"contrastDark":i==="light"?"contrastLight":"contrastInvert")}`;y(o,this.shadowRoot)}updateContrastButtons(t){this.shadowRoot.querySelectorAll('[data-action^="contrast"]').forEach(e=>{let i=e.dataset.action.replace("contrast","").toLowerCase();e.classList.toggle("anid-active",i===t)})}toggleList(t){var o,a;let e=this.shadowRoot.querySelector(`[data-list="${t}"]`);if(!e)return;let i=e.style.display!=="none";e.style.display=i?"none":"",i||(t==="headings"?(o=this.modules.headings)==null||o.populateList(e):(a=this.modules.pageStructure)==null||a.populateList(e))}initModules(){let t={shadowRoot:this.shadowRoot,config:this.config,announce:e=>y(e,this.shadowRoot)};this.modules={fontSize:new E(t),contrast:new $(t),darkMode:new H(t),monochrome:new M(t),saturation:new P(t),spacing:new z(t),dyslexiaFont:new R(t),hideImages:new I(t),colorBlind:new B(t),keyboardNav:new D(t),focus:new O(t),headings:new N(t),pageStructure:new j(t),readingGuide:new q(t),lineMask:new G(t),cursor:new K(t),screenReader:new Y(t),links:new V(t),images:new F(t),animations:new U(t),muteSounds:new W(t),tts:new Q(t),statement:new X(t),badge:new J(t)}}restoreState(){var e,i,o,a,r,h,d;let t=xt();for(let[l,p]of Object.entries(Pt))if(l!=="colorBlindSim"&&t[l]){(e=this.modules[p])==null||e.enable();let m=this.shadowRoot.querySelector(`[data-toggle="${l}"]`);m&&(m.checked=!0)}if(t.ttsHover){(i=this.modules.tts)==null||i.enableHover();let l=this.shadowRoot.querySelector('[data-toggle="ttsHover"]');l&&(l.checked=!0)}if(t.ttsSelection){(o=this.modules.tts)==null||o.enableSelection();let l=this.shadowRoot.querySelector('[data-toggle="ttsSelection"]');l&&(l.checked=!0)}if(t.fontSize&&((a=this.modules.fontSize)==null||a.setLevel(t.fontSize)),t.contrast&&t.contrast!=="none"&&((r=this.modules.contrast)==null||r.setMode(t.contrast),this.updateContrastButtons(t.contrast)),t.saturation!==void 0&&t.saturation!==100){(h=this.modules.saturation)==null||h.setValue(t.saturation);let l=this.shadowRoot.querySelector('[data-slider="saturation"]');l&&(l.value=t.saturation)}if(t.colorBlindMode){(d=this.modules.colorBlind)==null||d.setMode(t.colorBlindMode);let l=this.shadowRoot.querySelector('[data-toggle="colorBlindSim"]');l&&(l.checked=!0);let p=this.shadowRoot.querySelector('[data-sub="colorBlindSim"]');p&&(p.style.display="")}}resetAll(){var t;for(let e of Object.values(this.modules))(t=e.disable)==null||t.call(e);bt(),f("lang",b()),this.rebuildPanel()}rebuildPanel(){this.panel.setAttribute("dir",et()),this.panel.innerHTML=this.buildPanelHTML(),this.bindPanelEvents(),this.restoreState(),this.isOpen&&(this.updatePanelPosition(),this.panel.classList.add("anid-open")),this.trigger.setAttribute("aria-expanded",String(this.isOpen)),this.trigger.setAttribute("aria-label",this.isOpen?n("closePanel"):n("openPanel"))}toggle(){this.isOpen?this.close():this.open()}open(){var t;this.isOpen=!0,this.updatePanelPosition(),this.panel.classList.add("anid-open"),this.trigger.setAttribute("aria-expanded","true"),this.trigger.setAttribute("aria-label",n("closePanel")),(t=this.panel.querySelector(".anid-close-btn"))==null||t.focus()}close(){this.isOpen=!1,this.panel.classList.remove("anid-open"),this.trigger.setAttribute("aria-expanded","false"),this.trigger.setAttribute("aria-label",n("openPanel")),this.trigger.focus()}bindGlobalKeys(){let t={KeyD:()=>this._flipToggle("darkMode"),KeyF:e=>{var i,o;e.shiftKey?(i=this.modules.fontSize)==null||i.decrease():(o=this.modules.fontSize)==null||o.increase()},KeyK:()=>this._flipToggle("keyboardNav"),KeyG:()=>this._flipToggle("readingGuide"),KeyL:()=>this._flipToggle("linkHighlight"),KeyC:()=>this.toggleContrast("dark"),KeyM:()=>this._flipToggle("muteSounds"),KeyT:()=>{var e;return(e=this.modules.tts)==null?void 0:e.readPage()},KeyR:()=>this.resetAll()};this._keydownHandler=e=>{if(e.key==="Escape"&&this.isOpen){this.close();return}if(e.altKey&&e.code==="KeyA"){e.preventDefault(),this.toggle();return}if(e.altKey&&this.isOpen){let i=t[e.code];i&&(e.preventDefault(),i(e))}},document.addEventListener("keydown",this._keydownHandler)}_flipToggle(t){let e=this.shadowRoot.querySelector(`[data-toggle="${t}"]`);e&&(e.checked=!e.checked,this.handleToggle(t,e.checked))}_getBottomOffset(){let e=window.innerWidth<=768?this.config.mobileBottomOffset:this.config.bottomOffset,i=parseInt(e,10);return i>0?i:0}positionElement(t,e){let i=this._getBottomOffset(),o={"bottom-left":{bottom:`${20+i}px`,left:"20px"},"bottom-right":{bottom:`${20+i}px`,right:"20px"},"top-left":{top:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"}};Object.assign(t.style,o[e]||o["bottom-left"])}positionPanel(t){let e=this._getBottomOffset(),i={"bottom-left":{bottom:`${88+e}px`,left:"20px"},"bottom-right":{bottom:`${88+e}px`,right:"20px"},"top-left":{top:"88px",left:"20px"},"top-right":{top:"88px",right:"20px"}};Object.assign(this.panel.style,i[t]||i["bottom-left"])}updatePanelPosition(){if(window.innerWidth<=768)return;let t=this.trigger.getBoundingClientRect(),e=window.innerHeight,i=window.innerWidth,o=12,a=Math.min(380,i-2*o),r=t.top,h=e-t.bottom,d=t.left;if(d+a>i-o&&(d=i-a-o),d<o&&(d=o),this.panel.style.left=`${d}px`,this.panel.style.right="auto",r>h){let l=e-t.top+o;this.panel.style.bottom=`${l}px`,this.panel.style.top="auto",this.panel.style.maxHeight=`${Math.max(200,r-2*o)}px`}else{let l=t.bottom+o;this.panel.style.top=`${l}px`,this.panel.style.bottom="auto",this.panel.style.maxHeight=`${Math.max(200,e-l-o)}px`}}clampTrigger(){let t=this.trigger.getBoundingClientRect(),e=window.innerWidth,i=window.innerHeight,o=this.trigger.offsetWidth,a=this.trigger.offsetHeight,r=this.trigger.style.top!==""&&this.trigger.style.top!=="auto",h=this.trigger.style.left!==""&&this.trigger.style.left!=="auto";if(r&&h){let d=t.left,l=t.top,p=Math.max(0,Math.min(d,e-o)),m=Math.max(0,Math.min(l,i-a));d!==p&&(this.trigger.style.left=`${p}px`),l!==m&&(this.trigger.style.top=`${m}px`)}else(t.right>e||t.left<0||t.bottom>i||t.top<0)&&(this.trigger.style.left=`${Math.max(0,Math.min(t.left,e-o))}px`,this.trigger.style.top=`${Math.max(0,Math.min(t.top,i-a))}px`,this.trigger.style.right="auto",this.trigger.style.bottom="auto")}bindViewportListeners(){let t;this._resizeHandler=()=>{clearTimeout(t),t=setTimeout(()=>{this.clampTrigger(),this.isOpen&&this.updatePanelPosition()},100)},window.addEventListener("resize",this._resizeHandler),window.addEventListener("orientationchange",this._resizeHandler)}makeDraggable(t){let e=!1,i,o,a,r,h=p=>{let m=p.touches?p.touches[0]:p;i=m.clientX,o=m.clientY;let w=t.getBoundingClientRect();a=w.left,r=w.top,e=!1,document.addEventListener("mousemove",d),document.addEventListener("mouseup",l),document.addEventListener("touchmove",d,{passive:!1}),document.addEventListener("touchend",l)},d=p=>{let m=p.touches?p.touches[0]:p,w=m.clientX-i,pt=m.clientY-o;if((Math.abs(w)>5||Math.abs(pt)>5)&&(e=!0),e){p.preventDefault();let zt=window.innerWidth-t.offsetWidth,Rt=window.innerHeight-t.offsetHeight;t.style.left=`${Math.max(0,Math.min(a+w,zt))}px`,t.style.top=`${Math.max(0,Math.min(r+pt,Rt))}px`,t.style.right="auto",t.style.bottom="auto"}},l=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",l),document.removeEventListener("touchmove",d),document.removeEventListener("touchend",l),e&&this.updatePanelPosition()};t.addEventListener("mousedown",h),t.addEventListener("touchstart",h,{passive:!0}),t.addEventListener("click",p=>{if(e){e=!1,p.stopPropagation();return}this.toggle()})}destroy(){var t,e;if(!this._destroyed){this._destroyed=!0;for(let i of Object.values(this.modules))(t=i.disable)==null||t.call(i);this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),window.removeEventListener("orientationchange",this._resizeHandler)),(e=this.shadowHost)!=null&&e.parentNode&&this.shadowHost.parentNode.removeChild(this.shadowHost),this.modules={},this.shadowRoot=null,this.shadowHost=null,this.panel=null,this.trigger=null,A===this&&(A=null)}}};function ht(s){A&&A.destroy(),s&&(window.OpenA11yConfig={...window.OpenA11yConfig,...s});let t=new ct;return t.init(),A=t,t}typeof document!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>ht()):ht());return jt(se);})();
|