triiiceratops 0.10.3 → 0.10.5

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