triiiceratops 0.10.1 → 0.10.3
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/dist/{ArrowCounterClockwise-C6n_F9YZ.js → ArrowCounterClockwise-CvTUOlYp.js} +1 -1
- package/dist/{X-BUzsFa3u.js → X-Dgb3I7Ob.js} +227 -232
- package/dist/{annotation_tool_point-CCJi2I8J.js → annotation_tool_point-CKkqbVDq.js} +1 -1
- package/dist/components/DemoHeader.svelte +27 -0
- package/dist/components/SearchPanel.svelte +39 -24
- package/dist/components/ThumbnailGallery.svelte +23 -1
- package/dist/components/TriiiceratopsViewer.svelte +12 -2
- package/dist/{image_filters_reset-CWe7vTJU.js → image_filters_reset-DZrbHhqM.js} +1 -1
- package/dist/plugins/annotation-editor.js +3 -3
- package/dist/plugins/image-manipulation.js +3 -3
- package/dist/state/viewer.svelte.js +102 -82
- package/dist/triiiceratops-bundle.js +2264 -2231
- package/dist/triiiceratops-element.iife.js +26 -25
- package/dist/triiiceratops.css +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ var pt = (a) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Rt = (a, t, s) => t in a ? Dt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[t] = s;
|
|
6
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)),
|
|
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
8
|
import * as e from "svelte/internal/client";
|
|
9
9
|
import * as Bt from "manifesto.js";
|
|
10
10
|
import "svelte/internal/disclose-version";
|
|
@@ -12,8 +12,8 @@ import { hasContext as Tt, getContext as jt } from "svelte";
|
|
|
12
12
|
var E, D;
|
|
13
13
|
class Vt {
|
|
14
14
|
constructor() {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
h(this, E, e.state(e.proxy({})));
|
|
16
|
+
h(this, D, e.state(e.proxy(/* @__PURE__ */ new Map())));
|
|
17
17
|
}
|
|
18
18
|
get manifests() {
|
|
19
19
|
return e.get(n(this, E));
|
|
@@ -32,8 +32,8 @@ class Vt {
|
|
|
32
32
|
return `${t}::${s}`;
|
|
33
33
|
}
|
|
34
34
|
setUserAnnotations(t, s, i) {
|
|
35
|
-
const r = this.userAnnotationKey(t, s),
|
|
36
|
-
|
|
35
|
+
const r = this.userAnnotationKey(t, s), d = new Map(this.userAnnotations);
|
|
36
|
+
d.set(r, i), this.userAnnotations = d;
|
|
37
37
|
}
|
|
38
38
|
clearUserAnnotations(t, s) {
|
|
39
39
|
const i = this.userAnnotationKey(t, s);
|
|
@@ -98,81 +98,81 @@ class Vt {
|
|
|
98
98
|
if (!i) return [];
|
|
99
99
|
const r = i.getSequences()[0].getCanvasById(s);
|
|
100
100
|
if (!r) return [];
|
|
101
|
-
const
|
|
102
|
-
let
|
|
103
|
-
const
|
|
104
|
-
return
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
const w = this.manifests[
|
|
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
108
|
if (w) {
|
|
109
109
|
if (w.json) {
|
|
110
|
-
const
|
|
111
|
-
|
|
110
|
+
const A = I(w.json);
|
|
111
|
+
m.push(...A);
|
|
112
112
|
}
|
|
113
113
|
} else
|
|
114
|
-
this.fetchAnnotationList(
|
|
115
|
-
} else
|
|
116
|
-
}),
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
const w = this.manifests[
|
|
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
120
|
if (w) {
|
|
121
121
|
if (w.json) {
|
|
122
|
-
const
|
|
123
|
-
|
|
122
|
+
const A = I(w.json);
|
|
123
|
+
m.push(...A);
|
|
124
124
|
}
|
|
125
125
|
} else
|
|
126
|
-
this.fetchAnnotationList(
|
|
127
|
-
} else
|
|
128
|
-
}),
|
|
126
|
+
this.fetchAnnotationList(v);
|
|
127
|
+
} else g.items && m.push(...g.items);
|
|
128
|
+
}), m;
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
E = new WeakMap(), D = new WeakMap();
|
|
132
|
-
const
|
|
132
|
+
const P = new Vt();
|
|
133
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
134
|
class ae {
|
|
135
135
|
constructor(t = null, s = null, i = []) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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({})));
|
|
147
|
+
h(
|
|
148
148
|
this,
|
|
149
149
|
H,
|
|
150
150
|
// Gallery State (Lifted for persistence during re-docking)
|
|
151
151
|
e.state(e.proxy({ x: 20, y: 100 }))
|
|
152
152
|
);
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
158
|
ft(this, "eventTarget", null);
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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([])));
|
|
165
|
+
h(
|
|
166
166
|
this,
|
|
167
167
|
st,
|
|
168
168
|
// ==================== PLUGIN STATE ====================
|
|
169
169
|
/** Plugin-registered menu buttons */
|
|
170
170
|
e.state(e.proxy([]))
|
|
171
171
|
);
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
h(this, nt, e.state(e.proxy([])));
|
|
173
|
+
h(this, at, e.state(null));
|
|
174
174
|
ft(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
|
|
175
|
-
this.manifestId = t || null, this.canvasId = s || null, this.manifestId &&
|
|
175
|
+
this.manifestId = t || null, this.canvasId = s || null, this.manifestId && P.fetchManifest(this.manifestId);
|
|
176
176
|
for (const r of i)
|
|
177
177
|
this.registerPlugin(r);
|
|
178
178
|
}
|
|
@@ -298,7 +298,7 @@ class ae {
|
|
|
298
298
|
*/
|
|
299
299
|
getSnapshot() {
|
|
300
300
|
let t = -1;
|
|
301
|
-
return this.manifestId && this.canvasId && (t =
|
|
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)), {
|
|
302
302
|
manifestId: this.manifestId,
|
|
303
303
|
canvasId: this.canvasId,
|
|
304
304
|
currentCanvasIndex: t,
|
|
@@ -324,13 +324,13 @@ class ae {
|
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
326
|
get manifest() {
|
|
327
|
-
return this.manifestId ?
|
|
327
|
+
return this.manifestId ? P.getManifest(this.manifestId) : null;
|
|
328
328
|
}
|
|
329
329
|
get manifestEntry() {
|
|
330
|
-
return this.manifestId ?
|
|
330
|
+
return this.manifestId ? P.getManifestEntry(this.manifestId) : null;
|
|
331
331
|
}
|
|
332
332
|
get canvases() {
|
|
333
|
-
return this.manifestId ?
|
|
333
|
+
return this.manifestId ? P.getCanvases(this.manifestId) : [];
|
|
334
334
|
}
|
|
335
335
|
get currentCanvasIndex() {
|
|
336
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;
|
|
@@ -354,7 +354,7 @@ class ae {
|
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
setManifest(t) {
|
|
357
|
-
this.manifestId = t, this.canvasId = null,
|
|
357
|
+
this.manifestId = t, this.canvasId = null, P.fetchManifest(t), this.dispatchStateChange("manifestchange");
|
|
358
358
|
}
|
|
359
359
|
setCanvas(t) {
|
|
360
360
|
this.canvasId = t, this.dispatchStateChange("canvaschange");
|
|
@@ -364,8 +364,8 @@ class ae {
|
|
|
364
364
|
const s = this.config;
|
|
365
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
366
|
t.search.open !== void 0 && (this.showSearchPanel = t.search.open);
|
|
367
|
-
const r = t.search.query,
|
|
368
|
-
r !== void 0 && r !==
|
|
367
|
+
const r = t.search.query, d = (i = s.search) == null ? void 0 : i.query;
|
|
368
|
+
r !== void 0 && r !== d && r !== this.searchQuery && this._performSearch(r);
|
|
369
369
|
}
|
|
370
370
|
t.annotations && t.annotations.open !== void 0 && (this.showAnnotations = t.annotations.open);
|
|
371
371
|
}
|
|
@@ -443,99 +443,94 @@ class ae {
|
|
|
443
443
|
console.log("[ViewerState] Manifest not loaded, deferring search:", t), this.pendingSearchQuery = t;
|
|
444
444
|
return;
|
|
445
445
|
}
|
|
446
|
-
let
|
|
447
|
-
if (
|
|
446
|
+
let d = r.getService("http://iiif.io/api/search/1/search") || r.getService("http://iiif.io/api/search/0/search");
|
|
447
|
+
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) {
|
|
448
448
|
console.warn("No IIIF search service found in manifest"), this.isSearching = !1;
|
|
449
449
|
return;
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
if (!
|
|
453
|
-
const
|
|
454
|
-
const
|
|
455
|
-
if (!
|
|
456
|
-
const
|
|
457
|
-
if (
|
|
458
|
-
const
|
|
459
|
-
return
|
|
460
|
-
};
|
|
461
|
-
if (
|
|
462
|
-
for (const o of
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
|
|
451
|
+
const I = `${d.id || d["@id"]}?q=${encodeURIComponent(t)}`, g = await fetch(I);
|
|
452
|
+
if (!g.ok) throw new Error("Search request failed");
|
|
453
|
+
const v = await g.json(), w = v.resources || [], A = /* @__PURE__ */ new Map(), it = (o) => {
|
|
454
|
+
const c = typeof o == "string" ? o : o["@id"] || o.id;
|
|
455
|
+
if (!c) return null;
|
|
456
|
+
const u = c.split("#xywh=");
|
|
457
|
+
if (u.length < 2) return null;
|
|
458
|
+
const S = u[1].split(",").map(Number);
|
|
459
|
+
return S.length === 4 ? S : null;
|
|
460
|
+
}, _ = (o) => o ? o.replace(/<mark>/g, "<mark>").replace(/<\/mark>/g, "</mark>") : "";
|
|
461
|
+
if (v.hits)
|
|
462
|
+
for (const o of v.hits) {
|
|
463
|
+
const c = o.annotations || [];
|
|
464
|
+
let u = -1, S = null, y = [];
|
|
465
|
+
for (const l of c) {
|
|
466
|
+
const f = w.find((p) => p["@id"] === l || p.id === l);
|
|
466
467
|
if (f && f.on) {
|
|
467
|
-
const p = typeof f.on == "string" ? f.on : f.on["@id"] || f.on.id,
|
|
468
|
-
|
|
469
|
-
if (!g.has(L)) {
|
|
470
|
-
const I = this.canvases[L];
|
|
471
|
-
let x = "Canvas " + (L + 1);
|
|
472
|
-
try {
|
|
473
|
-
if (I.getLabel) {
|
|
474
|
-
const b = I.getLabel();
|
|
475
|
-
Array.isArray(b) && b.length > 0 ? x = b[0].value : typeof b == "string" && (x = b);
|
|
476
|
-
} else I.label && (typeof I.label == "string" ? x = I.label : Array.isArray(I.label) && (x = (s = I.label[0]) == null ? void 0 : s.value));
|
|
477
|
-
} catch {
|
|
478
|
-
}
|
|
479
|
-
g.set(L, { label: String(x), bounds: [] });
|
|
480
|
-
}
|
|
481
|
-
S && g.get(L).bounds.push(S);
|
|
482
|
-
}
|
|
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);
|
|
469
|
+
b >= 0 && (u === -1 && (u = b), k && (y.push(k), S || (S = k)));
|
|
483
470
|
}
|
|
484
471
|
}
|
|
485
|
-
|
|
486
|
-
|
|
472
|
+
if (u >= 0) {
|
|
473
|
+
if (!A.has(u)) {
|
|
474
|
+
const l = this.canvases[u];
|
|
475
|
+
let f = "Canvas " + (u + 1);
|
|
476
|
+
try {
|
|
477
|
+
if (l.getLabel) {
|
|
478
|
+
const p = l.getLabel();
|
|
479
|
+
Array.isArray(p) && p.length > 0 ? f = p[0].value : typeof p == "string" && (f = p);
|
|
480
|
+
} else l.label && (typeof l.label == "string" ? f = l.label : Array.isArray(l.label) && (f = (s = l.label[0]) == null ? void 0 : s.value));
|
|
481
|
+
} catch {
|
|
482
|
+
}
|
|
483
|
+
A.set(u, { canvasIndex: u, canvasLabel: String(f), hits: [] });
|
|
484
|
+
}
|
|
485
|
+
A.get(u).hits.push({
|
|
487
486
|
type: "hit",
|
|
488
|
-
before: o.before,
|
|
489
|
-
match: o.match,
|
|
490
|
-
after: o.after,
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
// Store all bounds for this hit on this canvas
|
|
494
|
-
allBounds: f.bounds,
|
|
495
|
-
// Keep first bounds for backwards compatibility
|
|
496
|
-
bounds: f.bounds.length > 0 ? f.bounds[0] : null
|
|
487
|
+
before: _(o.before),
|
|
488
|
+
match: _(o.match),
|
|
489
|
+
after: _(o.after),
|
|
490
|
+
bounds: S,
|
|
491
|
+
allBounds: y
|
|
497
492
|
});
|
|
493
|
+
}
|
|
498
494
|
}
|
|
499
495
|
else if (w.length > 0)
|
|
500
496
|
for (const o of w) {
|
|
501
|
-
const
|
|
502
|
-
if (
|
|
503
|
-
const
|
|
504
|
-
let
|
|
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);
|
|
498
|
+
if (y >= 0) {
|
|
499
|
+
const l = this.canvases[y];
|
|
500
|
+
let f = "Canvas " + (y + 1);
|
|
505
501
|
try {
|
|
506
|
-
if (
|
|
507
|
-
const
|
|
508
|
-
Array.isArray(
|
|
509
|
-
} else
|
|
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 = (i = l.label[0]) == null ? void 0 : i.value));
|
|
510
506
|
} catch {
|
|
511
507
|
}
|
|
512
|
-
|
|
508
|
+
A.has(y) || A.set(y, { canvasIndex: y, canvasLabel: String(f), hits: [] }), A.get(y).hits.push({
|
|
513
509
|
type: "resource",
|
|
514
|
-
match: o.resource && o.resource.chars ? o.resource.chars : o.chars || "",
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
bounds: m
|
|
510
|
+
match: _(o.resource && o.resource.chars ? o.resource.chars : o.chars || ""),
|
|
511
|
+
bounds: S,
|
|
512
|
+
allBounds: S ? [S] : []
|
|
518
513
|
});
|
|
519
514
|
}
|
|
520
515
|
}
|
|
521
|
-
this.searchResults =
|
|
522
|
-
let
|
|
523
|
-
this.searchAnnotations =
|
|
524
|
-
const
|
|
525
|
-
return
|
|
526
|
-
const
|
|
516
|
+
this.searchResults = Array.from(A.values()).sort((o, c) => o.canvasIndex - c.canvasIndex);
|
|
517
|
+
let ut = 0;
|
|
518
|
+
this.searchAnnotations = this.searchResults.flatMap((o) => {
|
|
519
|
+
const c = this.canvases[o.canvasIndex];
|
|
520
|
+
return o.hits.flatMap((u) => (u.allBounds && u.allBounds.length > 0 ? u.allBounds : u.bounds ? [u.bounds] : []).map((y) => {
|
|
521
|
+
const l = `${c.id}#xywh=${y.join(",")}`;
|
|
527
522
|
return {
|
|
528
|
-
"@id": `urn:search-hit:${
|
|
523
|
+
"@id": `urn:search-hit:${ut++}`,
|
|
529
524
|
"@type": "oa:Annotation",
|
|
530
525
|
motivation: "sc:painting",
|
|
531
|
-
on:
|
|
532
|
-
canvasId:
|
|
533
|
-
resource: { "@type": "cnt:ContentAsText", chars:
|
|
526
|
+
on: l,
|
|
527
|
+
canvasId: c.id,
|
|
528
|
+
resource: { "@type": "cnt:ContentAsText", chars: u.match },
|
|
534
529
|
// Flag to identify styling in Overlay?
|
|
535
530
|
// Or just standard rendering.
|
|
536
531
|
isSearchHit: !0
|
|
537
532
|
};
|
|
538
|
-
});
|
|
533
|
+
}));
|
|
539
534
|
});
|
|
540
535
|
} catch (r) {
|
|
541
536
|
console.error("Search error:", r);
|
|
@@ -575,7 +570,7 @@ class ae {
|
|
|
575
570
|
isActive: () => e.get(i),
|
|
576
571
|
order: 200
|
|
577
572
|
// Default order for simple plugins
|
|
578
|
-
},
|
|
573
|
+
}, d = {
|
|
579
574
|
id: `${s}:panel`,
|
|
580
575
|
component: t.panel,
|
|
581
576
|
position: t.position || "left",
|
|
@@ -589,7 +584,7 @@ class ae {
|
|
|
589
584
|
}
|
|
590
585
|
}
|
|
591
586
|
};
|
|
592
|
-
this.pluginMenuButtons = [...this.pluginMenuButtons, r], this.pluginPanels = [...this.pluginPanels,
|
|
587
|
+
this.pluginMenuButtons = [...this.pluginMenuButtons, r], this.pluginPanels = [...this.pluginPanels, d], t.onInit && t.onInit(this);
|
|
593
588
|
}
|
|
594
589
|
/**
|
|
595
590
|
* Unregister a plugin's UI components by ID prefix.
|
|
@@ -631,17 +626,17 @@ const Ft = "en", dt = (
|
|
|
631
626
|
"baseLocale"
|
|
632
627
|
];
|
|
633
628
|
globalThis.__paraglide = {};
|
|
634
|
-
let
|
|
629
|
+
let ht, mt = !1, St = () => {
|
|
635
630
|
let a;
|
|
636
631
|
for (const t of wt) {
|
|
637
632
|
if (t === "cookie")
|
|
638
633
|
a = Nt();
|
|
639
634
|
else if (t === "baseLocale")
|
|
640
635
|
a = Ft;
|
|
641
|
-
else if (t === "globalVariable" &&
|
|
642
|
-
a =
|
|
643
|
-
else if (
|
|
644
|
-
const s =
|
|
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);
|
|
645
640
|
if (s) {
|
|
646
641
|
const i = s.getLocale();
|
|
647
642
|
if (i instanceof Promise)
|
|
@@ -651,7 +646,7 @@ let ct, mt = !1, St = () => {
|
|
|
651
646
|
}
|
|
652
647
|
if (a !== void 0) {
|
|
653
648
|
const s = Ht(a);
|
|
654
|
-
return mt || (
|
|
649
|
+
return mt || (ht = s, mt = !0, At(s, { reload: !1 })), s;
|
|
655
650
|
}
|
|
656
651
|
}
|
|
657
652
|
throw new Error("No locale found. Read the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found");
|
|
@@ -659,7 +654,7 @@ let ct, mt = !1, St = () => {
|
|
|
659
654
|
const Zt = (a) => {
|
|
660
655
|
window.location.reload();
|
|
661
656
|
};
|
|
662
|
-
let
|
|
657
|
+
let At = (a, t) => {
|
|
663
658
|
const s = {
|
|
664
659
|
reload: !0,
|
|
665
660
|
...t
|
|
@@ -670,40 +665,40 @@ let bt = (a, t) => {
|
|
|
670
665
|
} catch {
|
|
671
666
|
}
|
|
672
667
|
const r = [];
|
|
673
|
-
for (const
|
|
674
|
-
if (
|
|
675
|
-
|
|
676
|
-
else if (
|
|
668
|
+
for (const m of wt)
|
|
669
|
+
if (m === "globalVariable")
|
|
670
|
+
ht = a;
|
|
671
|
+
else if (m === "cookie") {
|
|
677
672
|
if (typeof document > "u" || typeof window > "u")
|
|
678
673
|
continue;
|
|
679
|
-
const
|
|
680
|
-
document.cookie =
|
|
674
|
+
const I = `${yt}=${a}; path=/; max-age=${Qt}`;
|
|
675
|
+
document.cookie = I;
|
|
681
676
|
} else {
|
|
682
|
-
if (
|
|
677
|
+
if (m === "baseLocale")
|
|
683
678
|
continue;
|
|
684
|
-
if (
|
|
685
|
-
const
|
|
686
|
-
if (
|
|
687
|
-
let
|
|
688
|
-
|
|
689
|
-
throw new Error(`Custom strategy "${
|
|
690
|
-
cause:
|
|
679
|
+
if (It(m) && ct.has(m)) {
|
|
680
|
+
const I = ct.get(m);
|
|
681
|
+
if (I) {
|
|
682
|
+
let g = I.setLocale(a);
|
|
683
|
+
g instanceof Promise && (g = g.catch((v) => {
|
|
684
|
+
throw new Error(`Custom strategy "${m}" setLocale failed.`, {
|
|
685
|
+
cause: v
|
|
691
686
|
});
|
|
692
|
-
}), r.push(
|
|
687
|
+
}), r.push(g));
|
|
693
688
|
}
|
|
694
689
|
}
|
|
695
690
|
}
|
|
696
|
-
const
|
|
691
|
+
const d = () => {
|
|
697
692
|
s.reload && window.location && a !== i && Zt();
|
|
698
693
|
};
|
|
699
694
|
if (r.length)
|
|
700
695
|
return Promise.all(r).then(() => {
|
|
701
|
-
|
|
696
|
+
d();
|
|
702
697
|
});
|
|
703
|
-
|
|
698
|
+
d();
|
|
704
699
|
};
|
|
705
700
|
const re = (a) => {
|
|
706
|
-
|
|
701
|
+
At = /** @type {SetLocaleFn} */
|
|
707
702
|
a;
|
|
708
703
|
};
|
|
709
704
|
function zt(a) {
|
|
@@ -724,8 +719,8 @@ function Nt() {
|
|
|
724
719
|
if (zt(t))
|
|
725
720
|
return t;
|
|
726
721
|
}
|
|
727
|
-
const
|
|
728
|
-
function
|
|
722
|
+
const ct = /* @__PURE__ */ new Map();
|
|
723
|
+
function It(a) {
|
|
729
724
|
return typeof a == "string" && /^custom-[A-Za-z0-9_-]+$/.test(a);
|
|
730
725
|
}
|
|
731
726
|
const Ut = (
|
|
@@ -745,131 +740,131 @@ var Kt = e.from_svg('<path d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208
|
|
|
745
740
|
function le(a, t) {
|
|
746
741
|
e.push(t, !0);
|
|
747
742
|
const s = Ot();
|
|
748
|
-
let i = e.rest_props(t, ["$$slots", "$$events", "$$legacy", "children"]), r = e.derived(() => t.weight ?? s.weight ?? "regular"),
|
|
749
|
-
function
|
|
750
|
-
let { weight:
|
|
751
|
-
return
|
|
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);
|
|
744
|
+
function g(o) {
|
|
745
|
+
let { weight: c, color: u, size: S, mirrored: y, ...l } = o;
|
|
746
|
+
return l;
|
|
752
747
|
}
|
|
753
|
-
var
|
|
748
|
+
var v = te();
|
|
754
749
|
e.attribute_effect(
|
|
755
|
-
|
|
756
|
-
(
|
|
750
|
+
v,
|
|
751
|
+
(o, c) => ({
|
|
757
752
|
xmlns: "http://www.w3.org/2000/svg",
|
|
758
753
|
role: "img",
|
|
759
|
-
width: e.get(
|
|
760
|
-
height: e.get(
|
|
761
|
-
fill: e.get(
|
|
762
|
-
transform: e.get(
|
|
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,
|
|
763
758
|
viewBox: "0 0 256 256",
|
|
764
|
-
...
|
|
765
|
-
...
|
|
759
|
+
...o,
|
|
760
|
+
...c
|
|
766
761
|
}),
|
|
767
|
-
[() =>
|
|
762
|
+
[() => g(s), () => g(i)]
|
|
768
763
|
);
|
|
769
|
-
var w = e.child(
|
|
764
|
+
var w = e.child(v);
|
|
770
765
|
{
|
|
771
|
-
var
|
|
772
|
-
var
|
|
773
|
-
e.snippet(
|
|
766
|
+
var A = (o) => {
|
|
767
|
+
var c = e.comment(), u = e.first_child(c);
|
|
768
|
+
e.snippet(u, () => t.children), e.append(o, c);
|
|
774
769
|
};
|
|
775
|
-
e.if(w, (
|
|
776
|
-
t.children &&
|
|
770
|
+
e.if(w, (o) => {
|
|
771
|
+
t.children && o(A);
|
|
777
772
|
});
|
|
778
773
|
}
|
|
779
774
|
var it = e.sibling(w, 2);
|
|
780
775
|
{
|
|
781
|
-
var
|
|
782
|
-
var
|
|
783
|
-
e.append(
|
|
784
|
-
},
|
|
785
|
-
var
|
|
776
|
+
var _ = (o) => {
|
|
777
|
+
var c = Kt();
|
|
778
|
+
e.append(o, c);
|
|
779
|
+
}, ut = (o) => {
|
|
780
|
+
var c = e.comment(), u = e.first_child(c);
|
|
786
781
|
{
|
|
787
|
-
var
|
|
788
|
-
var
|
|
789
|
-
e.next(), e.append(
|
|
790
|
-
},
|
|
791
|
-
var
|
|
782
|
+
var S = (l) => {
|
|
783
|
+
var f = $t();
|
|
784
|
+
e.next(), e.append(l, f);
|
|
785
|
+
}, y = (l) => {
|
|
786
|
+
var f = e.comment(), p = e.first_child(f);
|
|
792
787
|
{
|
|
793
|
-
var
|
|
794
|
-
var
|
|
795
|
-
e.append(b,
|
|
796
|
-
},
|
|
797
|
-
var
|
|
788
|
+
var gt = (b) => {
|
|
789
|
+
var x = Wt();
|
|
790
|
+
e.append(b, x);
|
|
791
|
+
}, k = (b) => {
|
|
792
|
+
var x = e.comment(), bt = e.first_child(x);
|
|
798
793
|
{
|
|
799
|
-
var _t = (
|
|
800
|
-
var
|
|
801
|
-
e.append(
|
|
802
|
-
},
|
|
803
|
-
var
|
|
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);
|
|
804
799
|
{
|
|
805
|
-
var Mt = (
|
|
806
|
-
var
|
|
807
|
-
e.append(
|
|
808
|
-
}, Ct = (
|
|
809
|
-
var
|
|
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);
|
|
810
805
|
{
|
|
811
|
-
var kt = (
|
|
812
|
-
var
|
|
813
|
-
e.append(
|
|
814
|
-
}, Et = (
|
|
815
|
-
var
|
|
816
|
-
|
|
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);
|
|
817
812
|
};
|
|
818
813
|
e.if(
|
|
819
814
|
Pt,
|
|
820
|
-
(
|
|
821
|
-
e.get(r) === "thin" ?
|
|
815
|
+
(C) => {
|
|
816
|
+
e.get(r) === "thin" ? C(kt) : C(Et, !1);
|
|
822
817
|
},
|
|
823
818
|
!0
|
|
824
819
|
);
|
|
825
820
|
}
|
|
826
|
-
e.append(
|
|
821
|
+
e.append(M, ot);
|
|
827
822
|
};
|
|
828
823
|
e.if(
|
|
829
|
-
|
|
830
|
-
(
|
|
831
|
-
e.get(r) === "regular" ?
|
|
824
|
+
Lt,
|
|
825
|
+
(M) => {
|
|
826
|
+
e.get(r) === "regular" ? M(Mt) : M(Ct, !1);
|
|
832
827
|
},
|
|
833
828
|
!0
|
|
834
829
|
);
|
|
835
830
|
}
|
|
836
|
-
e.append(
|
|
831
|
+
e.append(L, rt);
|
|
837
832
|
};
|
|
838
833
|
e.if(
|
|
839
|
-
|
|
840
|
-
(
|
|
841
|
-
e.get(r) === "light" ?
|
|
834
|
+
bt,
|
|
835
|
+
(L) => {
|
|
836
|
+
e.get(r) === "light" ? L(_t) : L(xt, !1);
|
|
842
837
|
},
|
|
843
838
|
!0
|
|
844
839
|
);
|
|
845
840
|
}
|
|
846
|
-
e.append(b,
|
|
841
|
+
e.append(b, x);
|
|
847
842
|
};
|
|
848
843
|
e.if(
|
|
849
|
-
|
|
844
|
+
p,
|
|
850
845
|
(b) => {
|
|
851
|
-
e.get(r) === "fill" ? b(
|
|
846
|
+
e.get(r) === "fill" ? b(gt) : b(k, !1);
|
|
852
847
|
},
|
|
853
848
|
!0
|
|
854
849
|
);
|
|
855
850
|
}
|
|
856
|
-
e.append(
|
|
851
|
+
e.append(l, f);
|
|
857
852
|
};
|
|
858
853
|
e.if(
|
|
859
|
-
|
|
860
|
-
(
|
|
861
|
-
e.get(r) === "duotone" ?
|
|
854
|
+
u,
|
|
855
|
+
(l) => {
|
|
856
|
+
e.get(r) === "duotone" ? l(S) : l(y, !1);
|
|
862
857
|
},
|
|
863
858
|
!0
|
|
864
859
|
);
|
|
865
860
|
}
|
|
866
|
-
e.append(
|
|
861
|
+
e.append(o, c);
|
|
867
862
|
};
|
|
868
|
-
e.if(it, (
|
|
869
|
-
e.get(r) === "bold" ?
|
|
863
|
+
e.if(it, (o) => {
|
|
864
|
+
e.get(r) === "bold" ? o(_) : o(ut, !1);
|
|
870
865
|
});
|
|
871
866
|
}
|
|
872
|
-
e.reset(
|
|
867
|
+
e.reset(v), e.append(a, v), e.pop();
|
|
873
868
|
}
|
|
874
869
|
export {
|
|
875
870
|
Vt as M,
|
|
@@ -880,7 +875,7 @@ export {
|
|
|
880
875
|
oe as c,
|
|
881
876
|
Ot as g,
|
|
882
877
|
dt as l,
|
|
883
|
-
|
|
878
|
+
P as m,
|
|
884
879
|
re as o,
|
|
885
|
-
|
|
880
|
+
At as s
|
|
886
881
|
};
|