triiiceratops 0.11.0 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -9
- package/dist/{ArrowCounterClockwise-CN8KGaI0.js → ArrowCounterClockwise-B_hB6fl1.js} +1 -1
- package/dist/X-Boj9jj2h.js +890 -0
- package/dist/{annotation_tool_point-BpZXtX5D.js → annotation_tool_point-rZvdAtGa.js} +1 -1
- package/dist/annotorious-openseadragon.es-tb5X-LtF.js +33045 -0
- package/dist/components/AnnotationOverlay.svelte +10 -17
- package/dist/components/DemoHeader.svelte +4 -5
- package/dist/components/MetadataDialog.svelte +4 -1
- package/dist/components/OSDViewer.svelte +8 -2
- package/dist/components/SearchPanel.svelte +8 -5
- package/dist/components/ThemeToggle.svelte +1 -1
- package/dist/components/ThumbnailGallery.svelte +4 -4
- package/dist/components/Toolbar.svelte +5 -4
- package/dist/components/TriiiceratopsViewerElement.svelte +3 -1
- package/dist/custom-element.js +1 -0
- package/dist/{image_filters_reset-CyWg622b.js → image_filters_reset-CAUhlDWt.js} +1 -1
- package/dist/plugins/annotation-editor/AnnotationEditorController.svelte +5 -3
- package/dist/plugins/annotation-editor/AnnotationEditorPanel.svelte +3 -3
- package/dist/plugins/annotation-editor/AnnotationManager.svelte.d.ts +3 -0
- package/dist/plugins/annotation-editor/AnnotationManager.svelte.js +19 -14
- package/dist/plugins/annotation-editor/loader.svelte.js +2 -2
- package/dist/plugins/annotation-editor.js +1228 -32159
- package/dist/plugins/image-manipulation/ImageManipulationController.svelte +1 -1
- package/dist/plugins/image-manipulation.js +3 -3
- package/dist/state/manifests.svelte.d.ts +2 -1
- package/dist/state/manifests.svelte.js +5 -9
- package/dist/state/manifests.test.js +52 -50
- package/dist/state/viewer.svelte.d.ts +2 -1
- package/dist/state/viewer.svelte.js +8 -8
- package/dist/triiiceratops-bundle.js +1167 -1179
- package/dist/triiiceratops-element.iife.js +26 -26
- package/dist/triiiceratops.css +1 -1
- package/dist/utils/annotationAdapter.js +2 -2
- package/dist/utils/annotationAdapter.test.js +0 -1
- package/package.json +12 -2
- package/dist/X-i_EmjXwW.js +0 -906
package/dist/X-i_EmjXwW.js
DELETED
|
@@ -1,906 +0,0 @@
|
|
|
1
|
-
var Vt = Object.defineProperty;
|
|
2
|
-
var vt = (a) => {
|
|
3
|
-
throw TypeError(a);
|
|
4
|
-
};
|
|
5
|
-
var Tt = (a, t, s) => t in a ? Vt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s;
|
|
6
|
-
var ct = (a, t, s) => Tt(a, typeof t != "symbol" ? t + "" : t, s), Bt = (a, t, s) => t.has(a) || vt("Cannot " + s);
|
|
7
|
-
var n = (a, t, s) => (Bt(a, t, "read from private field"), s ? s.call(a) : t.get(a)), h = (a, t, s) => t.has(a) ? vt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(a) : t.set(a, s);
|
|
8
|
-
import * as e from "svelte/internal/client";
|
|
9
|
-
import * as Dt from "manifesto.js";
|
|
10
|
-
import "svelte/internal/disclose-version";
|
|
11
|
-
import { hasContext as Gt, getContext as Rt } from "svelte";
|
|
12
|
-
var E, O;
|
|
13
|
-
class jt {
|
|
14
|
-
constructor() {
|
|
15
|
-
h(this, E, e.state(e.proxy({})));
|
|
16
|
-
h(this, O, e.state(e.proxy(/* @__PURE__ */ new Map())));
|
|
17
|
-
}
|
|
18
|
-
get manifests() {
|
|
19
|
-
return e.get(n(this, E));
|
|
20
|
-
}
|
|
21
|
-
set manifests(t) {
|
|
22
|
-
e.set(n(this, E), t, !0);
|
|
23
|
-
}
|
|
24
|
-
get userAnnotations() {
|
|
25
|
-
return e.get(n(this, O));
|
|
26
|
-
}
|
|
27
|
-
set userAnnotations(t) {
|
|
28
|
-
e.set(n(this, O), t, !0);
|
|
29
|
-
}
|
|
30
|
-
// === User Annotations API ===
|
|
31
|
-
userAnnotationKey(t, s) {
|
|
32
|
-
return `${t}::${s}`;
|
|
33
|
-
}
|
|
34
|
-
setUserAnnotations(t, s, i) {
|
|
35
|
-
const r = this.userAnnotationKey(t, s), d = new Map(this.userAnnotations);
|
|
36
|
-
d.set(r, i), this.userAnnotations = d;
|
|
37
|
-
}
|
|
38
|
-
clearUserAnnotations(t, s) {
|
|
39
|
-
const i = this.userAnnotationKey(t, s);
|
|
40
|
-
if (this.userAnnotations.has(i)) {
|
|
41
|
-
const r = new Map(this.userAnnotations);
|
|
42
|
-
r.delete(i), this.userAnnotations = r;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
getUserAnnotations(t, s) {
|
|
46
|
-
const i = this.userAnnotationKey(t, s);
|
|
47
|
-
return this.userAnnotations.get(i) ?? [];
|
|
48
|
-
}
|
|
49
|
-
// === Manifest Fetching ===
|
|
50
|
-
async fetchManifest(t) {
|
|
51
|
-
if (!this.manifests[t]) {
|
|
52
|
-
this.manifests[t] = { isFetching: !0 };
|
|
53
|
-
try {
|
|
54
|
-
const s = await fetch(t);
|
|
55
|
-
if (!s.ok)
|
|
56
|
-
throw new Error(`HTTP error! status: ${s.status}`);
|
|
57
|
-
const i = await s.json(), r = Dt.parseManifest(i);
|
|
58
|
-
this.manifests[t] = { json: i, manifesto: r, isFetching: !1 };
|
|
59
|
-
} catch (s) {
|
|
60
|
-
this.manifests[t] = { error: s.message, isFetching: !1 };
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
getManifest(t) {
|
|
65
|
-
const s = this.manifests[t];
|
|
66
|
-
return s == null ? void 0 : s.manifesto;
|
|
67
|
-
}
|
|
68
|
-
getManifestEntry(t) {
|
|
69
|
-
return this.manifests[t];
|
|
70
|
-
}
|
|
71
|
-
async fetchAnnotationList(t) {
|
|
72
|
-
if (!this.manifests[t])
|
|
73
|
-
try {
|
|
74
|
-
const s = await fetch(t);
|
|
75
|
-
if (s.ok) {
|
|
76
|
-
const i = await s.json();
|
|
77
|
-
this.manifests[t] = { json: i };
|
|
78
|
-
} else
|
|
79
|
-
console.error(`Failed to fetch annotation list: ${t}`);
|
|
80
|
-
} catch (s) {
|
|
81
|
-
console.error(`Error fetching annotation list: ${t}`, s);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
getCanvases(t) {
|
|
85
|
-
const s = this.getManifest(t);
|
|
86
|
-
if (!s)
|
|
87
|
-
return [];
|
|
88
|
-
const i = s.getSequences();
|
|
89
|
-
return !i || !i.length ? [] : i[0].getCanvases();
|
|
90
|
-
}
|
|
91
|
-
getAnnotations(t, s) {
|
|
92
|
-
const i = this.manualGetAnnotations(t, s), r = this.getUserAnnotations(t, s);
|
|
93
|
-
return [...i, ...r];
|
|
94
|
-
}
|
|
95
|
-
// We can refactor this to use Manifesto's resource handling later if needed.
|
|
96
|
-
manualGetAnnotations(t, s) {
|
|
97
|
-
const i = this.getManifest(t);
|
|
98
|
-
if (!i) return [];
|
|
99
|
-
const r = i.getSequences()[0].getCanvasById(s);
|
|
100
|
-
if (!r) return [];
|
|
101
|
-
const d = r.__jsonld;
|
|
102
|
-
let m = [];
|
|
103
|
-
const I = (g) => g.resources || g.items || [];
|
|
104
|
-
return d.otherContent && d.otherContent.forEach((g) => {
|
|
105
|
-
const v = g["@id"] || g.id;
|
|
106
|
-
if (v && !g.resources) {
|
|
107
|
-
const w = this.manifests[v];
|
|
108
|
-
if (w) {
|
|
109
|
-
if (w.json) {
|
|
110
|
-
const b = I(w.json);
|
|
111
|
-
m.push(...b);
|
|
112
|
-
}
|
|
113
|
-
} else
|
|
114
|
-
this.fetchAnnotationList(v);
|
|
115
|
-
} else g.resources && m.push(...g.resources);
|
|
116
|
-
}), d.annotations && d.annotations.forEach((g) => {
|
|
117
|
-
const v = g.id || g["@id"];
|
|
118
|
-
if (v && !g.items) {
|
|
119
|
-
const w = this.manifests[v];
|
|
120
|
-
if (w) {
|
|
121
|
-
if (w.json) {
|
|
122
|
-
const b = I(w.json);
|
|
123
|
-
m.push(...b);
|
|
124
|
-
}
|
|
125
|
-
} else
|
|
126
|
-
this.fetchAnnotationList(v);
|
|
127
|
-
} else g.items && m.push(...g.items);
|
|
128
|
-
}), m;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
E = new WeakMap(), O = new WeakMap();
|
|
132
|
-
const P = new jt();
|
|
133
|
-
var V, T, B, D, G, R, j, F, Q, z, Z, H, N, U, q, K, $, W, J, X, Y, tt, et, st, nt, at, it;
|
|
134
|
-
class ie {
|
|
135
|
-
constructor(t = null, s = null, i = []) {
|
|
136
|
-
h(this, V, e.state(null));
|
|
137
|
-
h(this, T, e.state(null));
|
|
138
|
-
h(this, B, e.state(!1));
|
|
139
|
-
h(this, D, e.state(!1));
|
|
140
|
-
h(this, G, e.state(!1));
|
|
141
|
-
h(this, R, e.state(!1));
|
|
142
|
-
h(this, j, e.state(!1));
|
|
143
|
-
h(this, F, e.state(!1));
|
|
144
|
-
h(this, Q, e.state(!1));
|
|
145
|
-
h(this, z, e.state("bottom"));
|
|
146
|
-
h(this, Z, e.state(e.proxy(/* @__PURE__ */ new Set())));
|
|
147
|
-
h(this, H, e.state(e.proxy({})));
|
|
148
|
-
h(
|
|
149
|
-
this,
|
|
150
|
-
N,
|
|
151
|
-
// Gallery State (Lifted for persistence during re-docking)
|
|
152
|
-
e.state(e.proxy({ x: 20, y: 100 }))
|
|
153
|
-
);
|
|
154
|
-
h(this, U, e.state(e.proxy({ width: 300, height: 400 })));
|
|
155
|
-
h(this, q, e.state(!1));
|
|
156
|
-
h(this, K, e.state(e.proxy({ x: 0, y: 0 })));
|
|
157
|
-
h(this, $, e.state(null));
|
|
158
|
-
h(this, W, e.state(null));
|
|
159
|
-
ct(this, "eventTarget", null);
|
|
160
|
-
/**
|
|
161
|
-
* Reference to the main viewer DOM element.
|
|
162
|
-
* Used for fullscreen toggling.
|
|
163
|
-
*/
|
|
164
|
-
ct(this, "viewerElement", null);
|
|
165
|
-
h(this, J, e.state(""));
|
|
166
|
-
h(this, X, e.state(null));
|
|
167
|
-
h(this, Y, e.state(e.proxy([])));
|
|
168
|
-
h(this, tt, e.state(!1));
|
|
169
|
-
h(this, et, e.state(!1));
|
|
170
|
-
h(this, st, e.state(e.proxy([])));
|
|
171
|
-
h(
|
|
172
|
-
this,
|
|
173
|
-
nt,
|
|
174
|
-
// ==================== PLUGIN STATE ====================
|
|
175
|
-
/** Plugin-registered menu buttons */
|
|
176
|
-
e.state(e.proxy([]))
|
|
177
|
-
);
|
|
178
|
-
h(this, at, e.state(e.proxy([])));
|
|
179
|
-
h(this, it, e.state(null));
|
|
180
|
-
ct(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
|
|
181
|
-
this.manifestId = t || null, this.canvasId = s || null, this.manifestId && P.fetchManifest(this.manifestId);
|
|
182
|
-
for (const r of i)
|
|
183
|
-
this.registerPlugin(r);
|
|
184
|
-
}
|
|
185
|
-
get manifestId() {
|
|
186
|
-
return e.get(n(this, V));
|
|
187
|
-
}
|
|
188
|
-
set manifestId(t) {
|
|
189
|
-
e.set(n(this, V), t, !0);
|
|
190
|
-
}
|
|
191
|
-
get canvasId() {
|
|
192
|
-
return e.get(n(this, T));
|
|
193
|
-
}
|
|
194
|
-
set canvasId(t) {
|
|
195
|
-
e.set(n(this, T), t, !0);
|
|
196
|
-
}
|
|
197
|
-
get showAnnotations() {
|
|
198
|
-
return e.get(n(this, B));
|
|
199
|
-
}
|
|
200
|
-
set showAnnotations(t) {
|
|
201
|
-
e.set(n(this, B), t, !0);
|
|
202
|
-
}
|
|
203
|
-
get showThumbnailGallery() {
|
|
204
|
-
return e.get(n(this, D));
|
|
205
|
-
}
|
|
206
|
-
set showThumbnailGallery(t) {
|
|
207
|
-
e.set(n(this, D), t, !0);
|
|
208
|
-
}
|
|
209
|
-
get toolbarOpen() {
|
|
210
|
-
return e.get(n(this, G));
|
|
211
|
-
}
|
|
212
|
-
set toolbarOpen(t) {
|
|
213
|
-
e.set(n(this, G), t, !0);
|
|
214
|
-
}
|
|
215
|
-
get isGalleryDockedBottom() {
|
|
216
|
-
return e.get(n(this, R));
|
|
217
|
-
}
|
|
218
|
-
set isGalleryDockedBottom(t) {
|
|
219
|
-
e.set(n(this, R), t, !0);
|
|
220
|
-
}
|
|
221
|
-
get isGalleryDockedRight() {
|
|
222
|
-
return e.get(n(this, j));
|
|
223
|
-
}
|
|
224
|
-
set isGalleryDockedRight(t) {
|
|
225
|
-
e.set(n(this, j), t, !0);
|
|
226
|
-
}
|
|
227
|
-
get isFullScreen() {
|
|
228
|
-
return e.get(n(this, F));
|
|
229
|
-
}
|
|
230
|
-
set isFullScreen(t) {
|
|
231
|
-
e.set(n(this, F), t, !0);
|
|
232
|
-
}
|
|
233
|
-
get showMetadataDialog() {
|
|
234
|
-
return e.get(n(this, Q));
|
|
235
|
-
}
|
|
236
|
-
set showMetadataDialog(t) {
|
|
237
|
-
e.set(n(this, Q), t, !0);
|
|
238
|
-
}
|
|
239
|
-
get dockSide() {
|
|
240
|
-
return e.get(n(this, z));
|
|
241
|
-
}
|
|
242
|
-
set dockSide(t) {
|
|
243
|
-
e.set(n(this, z), t, !0);
|
|
244
|
-
}
|
|
245
|
-
get visibleAnnotationIds() {
|
|
246
|
-
return e.get(n(this, Z));
|
|
247
|
-
}
|
|
248
|
-
set visibleAnnotationIds(t) {
|
|
249
|
-
e.set(n(this, Z), t, !0);
|
|
250
|
-
}
|
|
251
|
-
get config() {
|
|
252
|
-
return e.get(n(this, H));
|
|
253
|
-
}
|
|
254
|
-
set config(t) {
|
|
255
|
-
e.set(n(this, H), t, !0);
|
|
256
|
-
}
|
|
257
|
-
get showToggle() {
|
|
258
|
-
return this.config.showToggle ?? !0;
|
|
259
|
-
}
|
|
260
|
-
get showCanvasNav() {
|
|
261
|
-
return this.config.showCanvasNav ?? !0;
|
|
262
|
-
}
|
|
263
|
-
get showZoomControls() {
|
|
264
|
-
return this.config.showZoomControls ?? !0;
|
|
265
|
-
}
|
|
266
|
-
get galleryPosition() {
|
|
267
|
-
return e.get(n(this, N));
|
|
268
|
-
}
|
|
269
|
-
set galleryPosition(t) {
|
|
270
|
-
e.set(n(this, N), t, !0);
|
|
271
|
-
}
|
|
272
|
-
get gallerySize() {
|
|
273
|
-
return e.get(n(this, U));
|
|
274
|
-
}
|
|
275
|
-
set gallerySize(t) {
|
|
276
|
-
e.set(n(this, U), t, !0);
|
|
277
|
-
}
|
|
278
|
-
get isGalleryDragging() {
|
|
279
|
-
return e.get(n(this, q));
|
|
280
|
-
}
|
|
281
|
-
set isGalleryDragging(t) {
|
|
282
|
-
e.set(n(this, q), t, !0);
|
|
283
|
-
}
|
|
284
|
-
get galleryDragOffset() {
|
|
285
|
-
return e.get(n(this, K));
|
|
286
|
-
}
|
|
287
|
-
set galleryDragOffset(t) {
|
|
288
|
-
e.set(n(this, K), t, !0);
|
|
289
|
-
}
|
|
290
|
-
get dragOverSide() {
|
|
291
|
-
return e.get(n(this, $));
|
|
292
|
-
}
|
|
293
|
-
set dragOverSide(t) {
|
|
294
|
-
e.set(n(this, $), t, !0);
|
|
295
|
-
}
|
|
296
|
-
get galleryCenterPanelRect() {
|
|
297
|
-
return e.get(n(this, W));
|
|
298
|
-
}
|
|
299
|
-
set galleryCenterPanelRect(t) {
|
|
300
|
-
e.set(n(this, W), t, !0);
|
|
301
|
-
}
|
|
302
|
-
setEventTarget(t) {
|
|
303
|
-
this.eventTarget = t;
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Get current state as a plain object snapshot.
|
|
307
|
-
* Safe to use outside Svelte's reactive system.
|
|
308
|
-
* NOTE: We calculate currentCanvasIndex inline to avoid triggering the canvases getter
|
|
309
|
-
* which can cause infinite loops when it auto-sets canvasId.
|
|
310
|
-
*/
|
|
311
|
-
getSnapshot() {
|
|
312
|
-
let t = -1;
|
|
313
|
-
return this.manifestId && this.canvasId && (t = P.getCanvases(this.manifestId).findIndex((i) => (i.id || i["@id"] || (i.getCanvasId ? i.getCanvasId() : null) || (i.getId ? i.getId() : null)) === this.canvasId)), {
|
|
314
|
-
manifestId: this.manifestId,
|
|
315
|
-
canvasId: this.canvasId,
|
|
316
|
-
currentCanvasIndex: t,
|
|
317
|
-
showAnnotations: this.showAnnotations,
|
|
318
|
-
showThumbnailGallery: this.showThumbnailGallery,
|
|
319
|
-
showSearchPanel: this.showSearchPanel,
|
|
320
|
-
toolbarOpen: this.toolbarOpen,
|
|
321
|
-
searchQuery: this.searchQuery,
|
|
322
|
-
isFullScreen: this.isFullScreen,
|
|
323
|
-
dockSide: this.dockSide
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* Dispatch a state change event to the web component.
|
|
328
|
-
* No-op if eventTarget is null (Svelte component usage).
|
|
329
|
-
*
|
|
330
|
-
* Uses queueMicrotask to dispatch asynchronously AFTER the current
|
|
331
|
-
* reactive cycle completes, preventing infinite update loops.
|
|
332
|
-
*/
|
|
333
|
-
dispatchStateChange(t = "statechange") {
|
|
334
|
-
console.log(`[ViewerState] Dispatching ${t}`, JSON.stringify(this.getSnapshot())), this.eventTarget && queueMicrotask(() => {
|
|
335
|
-
var s;
|
|
336
|
-
(s = this.eventTarget) == null || s.dispatchEvent(new CustomEvent(t, { detail: this.getSnapshot(), bubbles: !0, composed: !0 }));
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
get manifest() {
|
|
340
|
-
return this.manifestId ? P.getManifest(this.manifestId) : null;
|
|
341
|
-
}
|
|
342
|
-
get manifestEntry() {
|
|
343
|
-
return this.manifestId ? P.getManifestEntry(this.manifestId) : null;
|
|
344
|
-
}
|
|
345
|
-
get canvases() {
|
|
346
|
-
return this.manifestId ? P.getCanvases(this.manifestId) : [];
|
|
347
|
-
}
|
|
348
|
-
get currentCanvasIndex() {
|
|
349
|
-
return this.canvasId ? this.canvases.findIndex((t) => (t.id || t["@id"] || (t.getCanvasId ? t.getCanvasId() : null) || (t.getId ? t.getId() : null)) === this.canvasId) : this.canvases.length > 0 ? 0 : -1;
|
|
350
|
-
}
|
|
351
|
-
get hasNext() {
|
|
352
|
-
return this.currentCanvasIndex < this.canvases.length - 1;
|
|
353
|
-
}
|
|
354
|
-
get hasPrevious() {
|
|
355
|
-
return this.currentCanvasIndex > 0;
|
|
356
|
-
}
|
|
357
|
-
nextCanvas() {
|
|
358
|
-
if (this.hasNext) {
|
|
359
|
-
const t = this.currentCanvasIndex + 1, s = this.canvases[t];
|
|
360
|
-
this.setCanvas(s.id);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
previousCanvas() {
|
|
364
|
-
if (this.hasPrevious) {
|
|
365
|
-
const t = this.currentCanvasIndex - 1, s = this.canvases[t];
|
|
366
|
-
this.setCanvas(s.id);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
zoomIn() {
|
|
370
|
-
this.osdViewer && this.osdViewer.viewport && (this.osdViewer.viewport.zoomBy(1.2), this.osdViewer.viewport.applyConstraints());
|
|
371
|
-
}
|
|
372
|
-
zoomOut() {
|
|
373
|
-
this.osdViewer && this.osdViewer.viewport && (this.osdViewer.viewport.zoomBy(0.8), this.osdViewer.viewport.applyConstraints());
|
|
374
|
-
}
|
|
375
|
-
setManifest(t) {
|
|
376
|
-
this.manifestId = t, this.canvasId = null, P.fetchManifest(t), this.dispatchStateChange("manifestchange");
|
|
377
|
-
}
|
|
378
|
-
setCanvas(t) {
|
|
379
|
-
this.canvasId = t, this.dispatchStateChange("canvaschange");
|
|
380
|
-
}
|
|
381
|
-
updateConfig(t) {
|
|
382
|
-
var i;
|
|
383
|
-
const s = this.config;
|
|
384
|
-
if (this.config = t, t.toolbarOpen !== void 0 && (this.toolbarOpen = t.toolbarOpen), t.gallery && (t.gallery.open !== void 0 && (this.showThumbnailGallery = t.gallery.open), t.gallery.dockPosition !== void 0 && (this.dockSide = t.gallery.dockPosition)), t.search) {
|
|
385
|
-
t.search.open !== void 0 && (this.showSearchPanel = t.search.open);
|
|
386
|
-
const r = t.search.query, d = (i = s.search) == null ? void 0 : i.query;
|
|
387
|
-
r !== void 0 && r !== d && r !== this.searchQuery && this._performSearch(r);
|
|
388
|
-
}
|
|
389
|
-
t.annotations && t.annotations.open !== void 0 && (this.showAnnotations = t.annotations.open);
|
|
390
|
-
}
|
|
391
|
-
toggleAnnotations() {
|
|
392
|
-
this.showAnnotations = !this.showAnnotations, this.dispatchStateChange();
|
|
393
|
-
}
|
|
394
|
-
toggleToolbar() {
|
|
395
|
-
this.toolbarOpen = !this.toolbarOpen, this.dispatchStateChange();
|
|
396
|
-
}
|
|
397
|
-
toggleThumbnailGallery() {
|
|
398
|
-
this.showThumbnailGallery = !this.showThumbnailGallery, this.dispatchStateChange();
|
|
399
|
-
}
|
|
400
|
-
setViewerElement(t) {
|
|
401
|
-
this.viewerElement = t;
|
|
402
|
-
}
|
|
403
|
-
toggleFullScreen() {
|
|
404
|
-
if (document.fullscreenElement)
|
|
405
|
-
document.exitFullscreen();
|
|
406
|
-
else {
|
|
407
|
-
const t = this.viewerElement || document.getElementById("triiiceratops-viewer");
|
|
408
|
-
t ? t.requestFullscreen().catch((s) => {
|
|
409
|
-
console.warn("Fullscreen request failed", s);
|
|
410
|
-
}) : console.warn("Cannot toggle fullscreen: Viewer element not found");
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
toggleMetadataDialog() {
|
|
414
|
-
this.showMetadataDialog = !this.showMetadataDialog;
|
|
415
|
-
}
|
|
416
|
-
get searchQuery() {
|
|
417
|
-
return e.get(n(this, J));
|
|
418
|
-
}
|
|
419
|
-
set searchQuery(t) {
|
|
420
|
-
e.set(n(this, J), t, !0);
|
|
421
|
-
}
|
|
422
|
-
get pendingSearchQuery() {
|
|
423
|
-
return e.get(n(this, X));
|
|
424
|
-
}
|
|
425
|
-
set pendingSearchQuery(t) {
|
|
426
|
-
e.set(n(this, X), t, !0);
|
|
427
|
-
}
|
|
428
|
-
get searchResults() {
|
|
429
|
-
return e.get(n(this, Y));
|
|
430
|
-
}
|
|
431
|
-
set searchResults(t) {
|
|
432
|
-
e.set(n(this, Y), t, !0);
|
|
433
|
-
}
|
|
434
|
-
get isSearching() {
|
|
435
|
-
return e.get(n(this, tt));
|
|
436
|
-
}
|
|
437
|
-
set isSearching(t) {
|
|
438
|
-
e.set(n(this, tt), t, !0);
|
|
439
|
-
}
|
|
440
|
-
get showSearchPanel() {
|
|
441
|
-
return e.get(n(this, et));
|
|
442
|
-
}
|
|
443
|
-
set showSearchPanel(t) {
|
|
444
|
-
e.set(n(this, et), t, !0);
|
|
445
|
-
}
|
|
446
|
-
toggleSearchPanel() {
|
|
447
|
-
this.showSearchPanel = !this.showSearchPanel, this.showSearchPanel || (this.searchAnnotations = []), this.dispatchStateChange();
|
|
448
|
-
}
|
|
449
|
-
get searchAnnotations() {
|
|
450
|
-
return e.get(n(this, st));
|
|
451
|
-
}
|
|
452
|
-
set searchAnnotations(t) {
|
|
453
|
-
e.set(n(this, st), t, !0);
|
|
454
|
-
}
|
|
455
|
-
get currentCanvasSearchAnnotations() {
|
|
456
|
-
return this.canvasId ? this.searchAnnotations.filter((t) => t.canvasId === this.canvasId) : [];
|
|
457
|
-
}
|
|
458
|
-
async search(t) {
|
|
459
|
-
this.dispatchStateChange(), await this._performSearch(t), this.dispatchStateChange();
|
|
460
|
-
}
|
|
461
|
-
async _performSearch(t) {
|
|
462
|
-
var s, i;
|
|
463
|
-
if (t.trim()) {
|
|
464
|
-
this.isSearching = !0, this.searchQuery = t, this.searchResults = [];
|
|
465
|
-
try {
|
|
466
|
-
const r = this.manifest;
|
|
467
|
-
if (!r) {
|
|
468
|
-
console.log("[ViewerState] Manifest not loaded, deferring search:", t), this.pendingSearchQuery = t;
|
|
469
|
-
return;
|
|
470
|
-
}
|
|
471
|
-
let d = r.getService("http://iiif.io/api/search/1/search") || r.getService("http://iiif.io/api/search/0/search");
|
|
472
|
-
if (d || r.__jsonld && r.__jsonld.service && (d = (Array.isArray(r.__jsonld.service) ? r.__jsonld.service : [r.__jsonld.service]).find((c) => c.profile === "http://iiif.io/api/search/1/search" || c.profile === "http://iiif.io/api/search/0/search")), !d) {
|
|
473
|
-
console.warn("No IIIF search service found in manifest"), this.isSearching = !1;
|
|
474
|
-
return;
|
|
475
|
-
}
|
|
476
|
-
const I = `${d.id || d["@id"]}?q=${encodeURIComponent(t)}`, g = await fetch(I);
|
|
477
|
-
if (!g.ok) throw new Error("Search request failed");
|
|
478
|
-
const v = await g.json(), w = v.resources || [], b = /* @__PURE__ */ new Map(), rt = (o) => {
|
|
479
|
-
const c = typeof o == "string" ? o : o["@id"] || o.id;
|
|
480
|
-
if (!c) return null;
|
|
481
|
-
const u = c.split("#xywh=");
|
|
482
|
-
if (u.length < 2) return null;
|
|
483
|
-
const S = u[1].split(",").map(Number);
|
|
484
|
-
return S.length === 4 ? S : null;
|
|
485
|
-
}, _ = (o) => o ? o.replace(/<mark>/g, "<mark>").replace(/<\/mark>/g, "</mark>") : "";
|
|
486
|
-
if (v.hits)
|
|
487
|
-
for (const o of v.hits) {
|
|
488
|
-
const c = o.annotations || [];
|
|
489
|
-
let u = -1, S = null, y = [];
|
|
490
|
-
for (const l of c) {
|
|
491
|
-
const f = w.find((p) => p["@id"] === l || p.id === l);
|
|
492
|
-
if (f && f.on) {
|
|
493
|
-
const p = typeof f.on == "string" ? f.on : f.on["@id"] || f.on.id, dt = p.split("#")[0], k = rt(p), A = this.canvases.findIndex((x) => x.id === dt);
|
|
494
|
-
A >= 0 && (u === -1 && (u = A), k && (y.push(k), S || (S = k)));
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
if (u >= 0) {
|
|
498
|
-
if (!b.has(u)) {
|
|
499
|
-
const l = this.canvases[u];
|
|
500
|
-
let f = "Canvas " + (u + 1);
|
|
501
|
-
try {
|
|
502
|
-
if (l.getLabel) {
|
|
503
|
-
const p = l.getLabel();
|
|
504
|
-
Array.isArray(p) && p.length > 0 ? f = p[0].value : typeof p == "string" && (f = p);
|
|
505
|
-
} else l.label && (typeof l.label == "string" ? f = l.label : Array.isArray(l.label) && (f = (s = l.label[0]) == null ? void 0 : s.value));
|
|
506
|
-
} catch {
|
|
507
|
-
}
|
|
508
|
-
b.set(u, { canvasIndex: u, canvasLabel: String(f), hits: [] });
|
|
509
|
-
}
|
|
510
|
-
b.get(u).hits.push({
|
|
511
|
-
type: "hit",
|
|
512
|
-
before: _(o.before),
|
|
513
|
-
match: _(o.match),
|
|
514
|
-
after: _(o.after),
|
|
515
|
-
bounds: S,
|
|
516
|
-
allBounds: y
|
|
517
|
-
});
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
else if (w.length > 0)
|
|
521
|
-
for (const o of w) {
|
|
522
|
-
const c = typeof o.on == "string" ? o.on : o.on["@id"] || o.on.id, u = c.split("#")[0], S = rt(c), y = this.canvases.findIndex((l) => l.id === u);
|
|
523
|
-
if (y >= 0) {
|
|
524
|
-
const l = this.canvases[y];
|
|
525
|
-
let f = "Canvas " + (y + 1);
|
|
526
|
-
try {
|
|
527
|
-
if (l.getLabel) {
|
|
528
|
-
const p = l.getLabel();
|
|
529
|
-
Array.isArray(p) && p.length > 0 ? f = p[0].value : typeof p == "string" && (f = p);
|
|
530
|
-
} else l.label && (typeof l.label == "string" ? f = l.label : Array.isArray(l.label) && (f = (i = l.label[0]) == null ? void 0 : i.value));
|
|
531
|
-
} catch {
|
|
532
|
-
}
|
|
533
|
-
b.has(y) || b.set(y, { canvasIndex: y, canvasLabel: String(f), hits: [] }), b.get(y).hits.push({
|
|
534
|
-
type: "resource",
|
|
535
|
-
match: _(o.resource && o.resource.chars ? o.resource.chars : o.chars || ""),
|
|
536
|
-
bounds: S,
|
|
537
|
-
allBounds: S ? [S] : []
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
this.searchResults = Array.from(b.values()).sort((o, c) => o.canvasIndex - c.canvasIndex);
|
|
542
|
-
let ft = 0;
|
|
543
|
-
this.searchAnnotations = this.searchResults.flatMap((o) => {
|
|
544
|
-
const c = this.canvases[o.canvasIndex];
|
|
545
|
-
return o.hits.flatMap((u) => (u.allBounds && u.allBounds.length > 0 ? u.allBounds : u.bounds ? [u.bounds] : []).map((y) => {
|
|
546
|
-
const l = `${c.id}#xywh=${y.join(",")}`;
|
|
547
|
-
return {
|
|
548
|
-
"@id": `urn:search-hit:${ft++}`,
|
|
549
|
-
"@type": "oa:Annotation",
|
|
550
|
-
motivation: "sc:painting",
|
|
551
|
-
on: l,
|
|
552
|
-
canvasId: c.id,
|
|
553
|
-
resource: { "@type": "cnt:ContentAsText", chars: u.match },
|
|
554
|
-
// Flag to identify styling in Overlay?
|
|
555
|
-
// Or just standard rendering.
|
|
556
|
-
isSearchHit: !0
|
|
557
|
-
};
|
|
558
|
-
}));
|
|
559
|
-
});
|
|
560
|
-
} catch (r) {
|
|
561
|
-
console.error("Search error:", r), this.isSearching = !1;
|
|
562
|
-
} finally {
|
|
563
|
-
this.pendingSearchQuery || (this.isSearching = !1);
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
get pluginMenuButtons() {
|
|
568
|
-
return e.get(n(this, nt));
|
|
569
|
-
}
|
|
570
|
-
set pluginMenuButtons(t) {
|
|
571
|
-
e.set(n(this, nt), t, !0);
|
|
572
|
-
}
|
|
573
|
-
get pluginPanels() {
|
|
574
|
-
return e.get(n(this, at));
|
|
575
|
-
}
|
|
576
|
-
set pluginPanels(t) {
|
|
577
|
-
e.set(n(this, at), t, !0);
|
|
578
|
-
}
|
|
579
|
-
get osdViewer() {
|
|
580
|
-
return e.get(n(this, it));
|
|
581
|
-
}
|
|
582
|
-
set osdViewer(t) {
|
|
583
|
-
e.set(n(this, it), t);
|
|
584
|
-
}
|
|
585
|
-
registerPlugin(t) {
|
|
586
|
-
const s = t.id || `plugin-${Math.random().toString(36).substr(2, 9)}`;
|
|
587
|
-
let i = e.state(!1);
|
|
588
|
-
const r = {
|
|
589
|
-
id: `${s}:toggle`,
|
|
590
|
-
icon: t.icon,
|
|
591
|
-
tooltip: t.name,
|
|
592
|
-
onClick: () => {
|
|
593
|
-
e.set(i, !e.get(i));
|
|
594
|
-
},
|
|
595
|
-
isActive: () => e.get(i),
|
|
596
|
-
order: 200
|
|
597
|
-
// Default order for simple plugins
|
|
598
|
-
}, d = {
|
|
599
|
-
id: `${s}:panel`,
|
|
600
|
-
component: t.panel,
|
|
601
|
-
position: t.position || "left",
|
|
602
|
-
isVisible: () => e.get(i),
|
|
603
|
-
props: {
|
|
604
|
-
...t.props,
|
|
605
|
-
// Pass isOpen state and closer to component
|
|
606
|
-
isOpen: e.get(i),
|
|
607
|
-
close: () => {
|
|
608
|
-
e.set(i, !1);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
};
|
|
612
|
-
this.pluginMenuButtons = [...this.pluginMenuButtons, r], this.pluginPanels = [...this.pluginPanels, d], t.onInit && t.onInit(this);
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
|
-
* Unregister a plugin's UI components by ID prefix.
|
|
616
|
-
* Note: This cleans up the menu button and panel, but doesn't remove listeners attached by the plugin itself
|
|
617
|
-
* since we don't have a handle on the plugin instance or its cleanup function anymore.
|
|
618
|
-
* Plugins should manage their own cleanup via component lifecycle (onDestroy) if possible.
|
|
619
|
-
*/
|
|
620
|
-
unregisterPlugin(t) {
|
|
621
|
-
this.pluginMenuButtons = this.pluginMenuButtons.filter((s) => !s.id.startsWith(`${t}:`)), this.pluginPanels = this.pluginPanels.filter((s) => !s.id.startsWith(`${t}:`));
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* Notify that OSD viewer is ready.
|
|
625
|
-
* With the component-based system, we don't notify plugins individually.
|
|
626
|
-
* Instead, plugins should use the OSDViewer instance from context or listen for 'osd-ready' event (if we emitted one).
|
|
627
|
-
* But since we have direct access to osdViewer in this state, components can just react to it.
|
|
628
|
-
*/
|
|
629
|
-
notifyOSDReady(t) {
|
|
630
|
-
this.osdViewer = t;
|
|
631
|
-
}
|
|
632
|
-
/**
|
|
633
|
-
* Cleanup everything.
|
|
634
|
-
*/
|
|
635
|
-
destroyAllPlugins() {
|
|
636
|
-
this.pluginMenuButtons = [], this.pluginPanels = [], this.pluginEventHandlers.clear();
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
V = new WeakMap(), T = new WeakMap(), B = new WeakMap(), D = new WeakMap(), G = new WeakMap(), R = new WeakMap(), j = new WeakMap(), F = new WeakMap(), Q = new WeakMap(), z = new WeakMap(), Z = new WeakMap(), H = new WeakMap(), N = new WeakMap(), U = new WeakMap(), q = new WeakMap(), K = new WeakMap(), $ = new WeakMap(), W = new WeakMap(), J = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), nt = new WeakMap(), at = new WeakMap(), it = new WeakMap();
|
|
640
|
-
const re = "triiiceratops:viewerState";
|
|
641
|
-
let mt = Symbol("phosphor-svelte");
|
|
642
|
-
function Ft() {
|
|
643
|
-
return Gt(mt) ? Rt(mt) : {};
|
|
644
|
-
}
|
|
645
|
-
const Qt = "en", pt = (
|
|
646
|
-
/** @type {const} */
|
|
647
|
-
["en", "de"]
|
|
648
|
-
), wt = "PARAGLIDE_LOCALE", zt = 3456e4, St = [
|
|
649
|
-
"cookie",
|
|
650
|
-
"globalVariable",
|
|
651
|
-
"baseLocale"
|
|
652
|
-
];
|
|
653
|
-
globalThis.__paraglide = {};
|
|
654
|
-
let ut, yt = !1, bt = () => {
|
|
655
|
-
let a;
|
|
656
|
-
for (const t of St) {
|
|
657
|
-
if (t === "cookie")
|
|
658
|
-
a = Ut();
|
|
659
|
-
else if (t === "baseLocale")
|
|
660
|
-
a = Qt;
|
|
661
|
-
else if (t === "globalVariable" && ut !== void 0)
|
|
662
|
-
a = ut;
|
|
663
|
-
else if (At(t) && gt.has(t)) {
|
|
664
|
-
const s = gt.get(t);
|
|
665
|
-
if (s) {
|
|
666
|
-
const i = s.getLocale();
|
|
667
|
-
if (i instanceof Promise)
|
|
668
|
-
continue;
|
|
669
|
-
a = i;
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
if (a !== void 0) {
|
|
673
|
-
const s = Nt(a);
|
|
674
|
-
return yt || (ut = s, yt = !0, It(s, { reload: !1 })), s;
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
throw new Error("No locale found. Read the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found");
|
|
678
|
-
};
|
|
679
|
-
const Zt = (a) => {
|
|
680
|
-
window.location.reload();
|
|
681
|
-
};
|
|
682
|
-
let It = (a, t) => {
|
|
683
|
-
const s = {
|
|
684
|
-
reload: !0,
|
|
685
|
-
...t
|
|
686
|
-
};
|
|
687
|
-
let i;
|
|
688
|
-
try {
|
|
689
|
-
i = bt();
|
|
690
|
-
} catch {
|
|
691
|
-
}
|
|
692
|
-
const r = [];
|
|
693
|
-
for (const m of St)
|
|
694
|
-
if (m === "globalVariable")
|
|
695
|
-
ut = a;
|
|
696
|
-
else if (m === "cookie") {
|
|
697
|
-
if (typeof document > "u" || typeof window > "u")
|
|
698
|
-
continue;
|
|
699
|
-
const I = `${wt}=${a}; path=/; max-age=${zt}`;
|
|
700
|
-
document.cookie = I;
|
|
701
|
-
} else {
|
|
702
|
-
if (m === "baseLocale")
|
|
703
|
-
continue;
|
|
704
|
-
if (At(m) && gt.has(m)) {
|
|
705
|
-
const I = gt.get(m);
|
|
706
|
-
if (I) {
|
|
707
|
-
let g = I.setLocale(a);
|
|
708
|
-
g instanceof Promise && (g = g.catch((v) => {
|
|
709
|
-
throw new Error(`Custom strategy "${m}" setLocale failed.`, {
|
|
710
|
-
cause: v
|
|
711
|
-
});
|
|
712
|
-
}), r.push(g));
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
const d = () => {
|
|
717
|
-
s.reload && window.location && a !== i && Zt();
|
|
718
|
-
};
|
|
719
|
-
if (r.length)
|
|
720
|
-
return Promise.all(r).then(() => {
|
|
721
|
-
d();
|
|
722
|
-
});
|
|
723
|
-
d();
|
|
724
|
-
};
|
|
725
|
-
const oe = (a) => {
|
|
726
|
-
It = /** @type {SetLocaleFn} */
|
|
727
|
-
a;
|
|
728
|
-
};
|
|
729
|
-
function Ht(a) {
|
|
730
|
-
return typeof a != "string" ? !1 : a ? pt.some((t) => t.toLowerCase() === a.toLowerCase()) : !1;
|
|
731
|
-
}
|
|
732
|
-
function Nt(a) {
|
|
733
|
-
if (typeof a != "string")
|
|
734
|
-
throw new Error(`Invalid locale: ${a}. Expected a string.`);
|
|
735
|
-
const t = a.toLowerCase(), s = pt.find((i) => i.toLowerCase() === t);
|
|
736
|
-
if (!s)
|
|
737
|
-
throw new Error(`Invalid locale: ${a}. Expected one of: ${pt.join(", ")}`);
|
|
738
|
-
return s;
|
|
739
|
-
}
|
|
740
|
-
function Ut() {
|
|
741
|
-
if (typeof document > "u" || !document.cookie)
|
|
742
|
-
return;
|
|
743
|
-
const a = document.cookie.match(new RegExp(`(^| )${wt}=([^;]+)`)), t = a == null ? void 0 : a[2];
|
|
744
|
-
if (Ht(t))
|
|
745
|
-
return t;
|
|
746
|
-
}
|
|
747
|
-
const gt = /* @__PURE__ */ new Map();
|
|
748
|
-
function At(a) {
|
|
749
|
-
return typeof a == "string" && /^custom-[A-Za-z0-9_-]+$/.test(a);
|
|
750
|
-
}
|
|
751
|
-
const qt = (
|
|
752
|
-
/** @type {(inputs: {}) => LocalizedString} */
|
|
753
|
-
() => (
|
|
754
|
-
/** @type {LocalizedString} */
|
|
755
|
-
"Close"
|
|
756
|
-
)
|
|
757
|
-
), Kt = (
|
|
758
|
-
/** @type {(inputs: {}) => LocalizedString} */
|
|
759
|
-
() => (
|
|
760
|
-
/** @type {LocalizedString} */
|
|
761
|
-
"Schließen"
|
|
762
|
-
)
|
|
763
|
-
), le = /* @__NO_SIDE_EFFECTS__ */ (a = {}, t = {}) => (t.locale ?? bt()) === "en" ? qt() : Kt();
|
|
764
|
-
var $t = e.from_svg('<path d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"></path>'), Wt = e.from_svg('<path d="M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z" opacity="0.2"></path><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>', 1), Jt = e.from_svg('<path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>'), Xt = e.from_svg('<path d="M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"></path>'), Yt = e.from_svg('<path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>'), te = e.from_svg('<path d="M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"></path>'), ee = e.from_svg('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
|
|
765
|
-
function he(a, t) {
|
|
766
|
-
e.push(t, !0);
|
|
767
|
-
const s = Ft();
|
|
768
|
-
let i = e.rest_props(t, ["$$slots", "$$events", "$$legacy", "children"]), r = e.derived(() => t.weight ?? s.weight ?? "regular"), d = e.derived(() => t.color ?? s.color ?? "currentColor"), m = e.derived(() => t.size ?? s.size ?? "1em"), I = e.derived(() => t.mirrored ?? s.mirrored ?? !1);
|
|
769
|
-
function g(o) {
|
|
770
|
-
let { weight: c, color: u, size: S, mirrored: y, ...l } = o;
|
|
771
|
-
return l;
|
|
772
|
-
}
|
|
773
|
-
var v = ee();
|
|
774
|
-
e.attribute_effect(
|
|
775
|
-
v,
|
|
776
|
-
(o, c) => ({
|
|
777
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
778
|
-
role: "img",
|
|
779
|
-
width: e.get(m),
|
|
780
|
-
height: e.get(m),
|
|
781
|
-
fill: e.get(d),
|
|
782
|
-
transform: e.get(I) ? "scale(-1, 1)" : void 0,
|
|
783
|
-
viewBox: "0 0 256 256",
|
|
784
|
-
...o,
|
|
785
|
-
...c
|
|
786
|
-
}),
|
|
787
|
-
[() => g(s), () => g(i)]
|
|
788
|
-
);
|
|
789
|
-
var w = e.child(v);
|
|
790
|
-
{
|
|
791
|
-
var b = (o) => {
|
|
792
|
-
var c = e.comment(), u = e.first_child(c);
|
|
793
|
-
e.snippet(u, () => t.children), e.append(o, c);
|
|
794
|
-
};
|
|
795
|
-
e.if(w, (o) => {
|
|
796
|
-
t.children && o(b);
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
var rt = e.sibling(w, 2);
|
|
800
|
-
{
|
|
801
|
-
var _ = (o) => {
|
|
802
|
-
var c = $t();
|
|
803
|
-
e.append(o, c);
|
|
804
|
-
}, ft = (o) => {
|
|
805
|
-
var c = e.comment(), u = e.first_child(c);
|
|
806
|
-
{
|
|
807
|
-
var S = (l) => {
|
|
808
|
-
var f = Wt();
|
|
809
|
-
e.next(), e.append(l, f);
|
|
810
|
-
}, y = (l) => {
|
|
811
|
-
var f = e.comment(), p = e.first_child(f);
|
|
812
|
-
{
|
|
813
|
-
var dt = (A) => {
|
|
814
|
-
var x = Jt();
|
|
815
|
-
e.append(A, x);
|
|
816
|
-
}, k = (A) => {
|
|
817
|
-
var x = e.comment(), _t = e.first_child(x);
|
|
818
|
-
{
|
|
819
|
-
var xt = (L) => {
|
|
820
|
-
var ot = Xt();
|
|
821
|
-
e.append(L, ot);
|
|
822
|
-
}, Lt = (L) => {
|
|
823
|
-
var ot = e.comment(), Ct = e.first_child(ot);
|
|
824
|
-
{
|
|
825
|
-
var Mt = (C) => {
|
|
826
|
-
var lt = Yt();
|
|
827
|
-
e.append(C, lt);
|
|
828
|
-
}, Pt = (C) => {
|
|
829
|
-
var lt = e.comment(), kt = e.first_child(lt);
|
|
830
|
-
{
|
|
831
|
-
var Et = (M) => {
|
|
832
|
-
var ht = te();
|
|
833
|
-
e.append(M, ht);
|
|
834
|
-
}, Ot = (M) => {
|
|
835
|
-
var ht = e.text();
|
|
836
|
-
ht.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), e.append(M, ht);
|
|
837
|
-
};
|
|
838
|
-
e.if(
|
|
839
|
-
kt,
|
|
840
|
-
(M) => {
|
|
841
|
-
e.get(r) === "thin" ? M(Et) : M(Ot, !1);
|
|
842
|
-
},
|
|
843
|
-
!0
|
|
844
|
-
);
|
|
845
|
-
}
|
|
846
|
-
e.append(C, lt);
|
|
847
|
-
};
|
|
848
|
-
e.if(
|
|
849
|
-
Ct,
|
|
850
|
-
(C) => {
|
|
851
|
-
e.get(r) === "regular" ? C(Mt) : C(Pt, !1);
|
|
852
|
-
},
|
|
853
|
-
!0
|
|
854
|
-
);
|
|
855
|
-
}
|
|
856
|
-
e.append(L, ot);
|
|
857
|
-
};
|
|
858
|
-
e.if(
|
|
859
|
-
_t,
|
|
860
|
-
(L) => {
|
|
861
|
-
e.get(r) === "light" ? L(xt) : L(Lt, !1);
|
|
862
|
-
},
|
|
863
|
-
!0
|
|
864
|
-
);
|
|
865
|
-
}
|
|
866
|
-
e.append(A, x);
|
|
867
|
-
};
|
|
868
|
-
e.if(
|
|
869
|
-
p,
|
|
870
|
-
(A) => {
|
|
871
|
-
e.get(r) === "fill" ? A(dt) : A(k, !1);
|
|
872
|
-
},
|
|
873
|
-
!0
|
|
874
|
-
);
|
|
875
|
-
}
|
|
876
|
-
e.append(l, f);
|
|
877
|
-
};
|
|
878
|
-
e.if(
|
|
879
|
-
u,
|
|
880
|
-
(l) => {
|
|
881
|
-
e.get(r) === "duotone" ? l(S) : l(y, !1);
|
|
882
|
-
},
|
|
883
|
-
!0
|
|
884
|
-
);
|
|
885
|
-
}
|
|
886
|
-
e.append(o, c);
|
|
887
|
-
};
|
|
888
|
-
e.if(rt, (o) => {
|
|
889
|
-
e.get(r) === "bold" ? o(_) : o(ft, !1);
|
|
890
|
-
});
|
|
891
|
-
}
|
|
892
|
-
e.reset(v), e.append(a, v), e.pop();
|
|
893
|
-
}
|
|
894
|
-
export {
|
|
895
|
-
jt as M,
|
|
896
|
-
re as V,
|
|
897
|
-
he as X,
|
|
898
|
-
bt as a,
|
|
899
|
-
ie as b,
|
|
900
|
-
le as c,
|
|
901
|
-
Ft as g,
|
|
902
|
-
pt as l,
|
|
903
|
-
P as m,
|
|
904
|
-
oe as o,
|
|
905
|
-
It as s
|
|
906
|
-
};
|