react-iiif-vault 1.0.0 → 1.0.1

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,25 +1,25 @@
1
1
  import { jsx as x, jsxs as V, Fragment as Me } from "react/jsx-runtime";
2
2
  import * as ot from "react";
3
3
  import ge, { useContext as Q, useMemo as j, useState as J, useEffect as re, useCallback as D, createContext as ce, useRef as ve, useLayoutEffect as ur, Fragment as Je, useReducer as Gi, forwardRef as lr, useImperativeHandle as Ji } from "react";
4
- import { AtlasAuto as Ki, mergeStyles as Zi, RegionHighlight as Xi, TileSet as en, HTMLPortal as tn } from "@atlas-viewer/atlas";
5
- import { serialize as rn, serializeConfigPresentation2 as nn, serializeConfigPresentation3 as sn, isSpecificResource as an, HAS_PART as Ke, PART_OF as Ze, frameResource as fr, normalize as on } from "@iiif/parser";
6
- import { ImageServiceLoader as pr, getImageServices as cn, getFixedSizeFromImage as Ht } from "@atlas-viewer/iiif-image-api";
4
+ import { AtlasAuto as Ki, ModeContext as Zi, mergeStyles as Xi, RegionHighlight as en, TileSet as tn, HTMLPortal as rn } from "@atlas-viewer/atlas";
5
+ import { serialize as nn, serializeConfigPresentation2 as sn, serializeConfigPresentation3 as an, isSpecificResource as on, HAS_PART as Ke, PART_OF as Ze, frameResource as fr, normalize as cn } from "@iiif/parser";
6
+ import { ImageServiceLoader as pr, getImageServices as un, getFixedSizeFromImage as Ht } from "@atlas-viewer/iiif-image-api";
7
7
  function mt(t, e) {
8
8
  return mt = Object.setPrototypeOf || function(i, n) {
9
9
  return i.__proto__ = n, i;
10
10
  }, mt(t, e);
11
11
  }
12
- function un(t, e) {
12
+ function ln(t, e) {
13
13
  t.prototype = Object.create(e.prototype), t.prototype.constructor = t, mt(t, e);
14
14
  }
15
- var ln = function(e, r) {
15
+ var fn = function(e, r) {
16
16
  return e === void 0 && (e = []), r === void 0 && (r = []), e.length !== r.length || e.some(function(i, n) {
17
17
  return !Object.is(i, r[n]);
18
18
  });
19
19
  }, Bt = {
20
20
  error: null
21
- }, fn = /* @__PURE__ */ function(t) {
22
- un(e, t);
21
+ }, pn = /* @__PURE__ */ function(t) {
22
+ ln(e, t);
23
23
  function e() {
24
24
  for (var i, n = arguments.length, s = new Array(n), a = 0; a < n; a++)
25
25
  s[a] = arguments[a];
@@ -42,7 +42,7 @@ var ln = function(e, r) {
42
42
  (a = (o = this.props).onError) == null || a.call(o, n, s);
43
43
  }, r.componentDidUpdate = function(n, s) {
44
44
  var a = this.state.error, o = this.props.resetKeys;
45
- if (a !== null && s.error !== null && ln(n.resetKeys, o)) {
45
+ if (a !== null && s.error !== null && fn(n.resetKeys, o)) {
46
46
  var u, h;
47
47
  (u = (h = this.props).onResetKeysChange) == null || u.call(h, n.resetKeys, o), this.reset();
48
48
  }
@@ -64,14 +64,14 @@ var ln = function(e, r) {
64
64
  return this.props.children;
65
65
  }, e;
66
66
  }(ot.Component);
67
- const pn = {
67
+ const hn = {
68
68
  collection: void 0,
69
69
  manifest: void 0,
70
70
  range: void 0,
71
71
  canvas: void 0,
72
72
  annotation: void 0,
73
73
  annotationPage: void 0
74
- }, Ot = ge.createContext(pn), Ee = () => Q(Ot);
74
+ }, Ot = ge.createContext(hn), Ee = () => Q(Ot);
75
75
  function et({ value: t, children: e }) {
76
76
  const r = Ee(), i = j(() => ({
77
77
  ...r,
@@ -79,7 +79,7 @@ function et({ value: t, children: e }) {
79
79
  }), [t, r]);
80
80
  return /* @__PURE__ */ x(Ot.Provider, { value: i, children: e });
81
81
  }
82
- var hn = Object.defineProperty, dn = (t, e, r) => e in t ? hn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, ye = (t, e, r) => (dn(t, typeof e != "symbol" ? e + "" : e, r), r);
82
+ var dn = Object.defineProperty, yn = (t, e, r) => e in t ? dn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, ye = (t, e, r) => (yn(t, typeof e != "symbol" ? e + "" : e, r), r);
83
83
  const q = function(t) {
84
84
  return function() {
85
85
  const e = { type: t, getType: () => t, toString: () => t };
@@ -89,31 +89,31 @@ const q = function(t) {
89
89
  ...i !== void 0 && { meta: i }
90
90
  });
91
91
  };
92
- }, hr = "@iiif/IMPORT_ENTITIES", dr = "@iiif/MODIFY_ENTITY_FIELD", yr = "@iiif/REORDER_ENTITY_FIELD", vr = "@iiif/ADD_REFERENCE", bt = "@iiif/UPDATE_REFERENCE", gr = "@iiif/REMOVE_REFERENCE", mr = "@iiif/ADD_METADATA", br = "@iiif/REMOVE_METADATA", At = "@iiif/UPDATE_METADATA", Ar = "@iiif/REORDER_METADATA", xr = q(hr)(), yn = q(dr)(), vn = q(yr)(), gn = q(vr)(), mn = q(gr)(), bn = q(bt)(), An = q(mr)(), xn = q(At)(), wn = q(br)(), Sn = q(Ar)(), Mn = {
92
+ }, hr = "@iiif/IMPORT_ENTITIES", dr = "@iiif/MODIFY_ENTITY_FIELD", yr = "@iiif/REORDER_ENTITY_FIELD", vr = "@iiif/ADD_REFERENCE", bt = "@iiif/UPDATE_REFERENCE", gr = "@iiif/REMOVE_REFERENCE", mr = "@iiif/ADD_METADATA", br = "@iiif/REMOVE_METADATA", At = "@iiif/UPDATE_METADATA", Ar = "@iiif/REORDER_METADATA", xr = q(hr)(), vn = q(dr)(), gn = q(yr)(), mn = q(vr)(), bn = q(gr)(), An = q(bt)(), xn = q(mr)(), wn = q(At)(), Sn = q(br)(), Mn = q(Ar)(), Cn = {
93
93
  importEntities: xr,
94
- modifyEntityField: yn,
95
- reorderEntityField: vn,
96
- addReference: gn,
97
- removeReference: mn,
98
- updateReference: bn,
99
- addMetadata: An,
100
- removeMetadata: wn,
101
- updateMetadata: xn,
102
- reorderMetadata: Sn
103
- }, wr = "@iiif/ADD_MAPPING", Sr = "@iiif/ADD_MAPPINGS", Cn = q(wr)(), Rn = q(Sr)(), Mr = "@iiif/SET_META_VALUE", Cr = "@iiif/SET_META_VALUE_DYNAMIC", Rr = "@iiif/UNSET_META_VALUE", Tn = q(Mr)(), In = q(Cr)(), kn = q(Rr)(), zt = {
104
- setMetaValue: Tn,
105
- setMetaValueDynamic: In,
106
- unsetMetaValue: kn
107
- }, xt = "RESOURCE_ERROR", Tr = "RESOURCE_LOADING", wt = "RESOURCE_READY", Ir = "@iiif/REQUEST_RESOURCE", kr = "@iiif/REQUEST_ERROR", Or = "@iiif/REQUEST_MISMATCH", Er = "@iiif/REQUEST_COMPLETE", On = "@iiif/REQUEST_OFFLINE_RESOURCE", En = q(Ir)(), Pr = q(kr)(), Pn = q(Or)(), Ln = q(Er)(), Et = "@iiif/BATCH", Fn = "@iiif/BATCH_IMPORT", St = q(Et)(), jn = (t, e) => {
108
- const { entities: r, resource: i, mapping: n } = on(e);
94
+ modifyEntityField: vn,
95
+ reorderEntityField: gn,
96
+ addReference: mn,
97
+ removeReference: bn,
98
+ updateReference: An,
99
+ addMetadata: xn,
100
+ removeMetadata: Sn,
101
+ updateMetadata: wn,
102
+ reorderMetadata: Mn
103
+ }, wr = "@iiif/ADD_MAPPING", Sr = "@iiif/ADD_MAPPINGS", Rn = q(wr)(), Tn = q(Sr)(), Mr = "@iiif/SET_META_VALUE", Cr = "@iiif/SET_META_VALUE_DYNAMIC", Rr = "@iiif/UNSET_META_VALUE", In = q(Mr)(), kn = q(Cr)(), On = q(Rr)(), zt = {
104
+ setMetaValue: In,
105
+ setMetaValueDynamic: kn,
106
+ unsetMetaValue: On
107
+ }, xt = "RESOURCE_ERROR", Tr = "RESOURCE_LOADING", wt = "RESOURCE_READY", Ir = "@iiif/REQUEST_RESOURCE", kr = "@iiif/REQUEST_ERROR", Or = "@iiif/REQUEST_MISMATCH", Er = "@iiif/REQUEST_COMPLETE", En = "@iiif/REQUEST_OFFLINE_RESOURCE", Pn = q(Ir)(), Pr = q(kr)(), Ln = q(Or)(), Fn = q(Er)(), Et = "@iiif/BATCH", jn = "@iiif/BATCH_IMPORT", St = q(Et)(), $n = (t, e) => {
108
+ const { entities: r, resource: i, mapping: n } = cn(e);
109
109
  if (i.id === void 0)
110
110
  return [Pr({ id: t, message: "ID is not defined in resource." })];
111
- const s = [xr({ entities: r }), Rn({ mapping: n })];
112
- return i.id !== t && (s.push(Cn({ id: t, type: i.type })), s.push(Pn({ requestId: t, actualId: i.id }))), s.push(Ln({ id: t })), s;
111
+ const s = [xr({ entities: r }), Tn({ mapping: n })];
112
+ return i.id !== t && (s.push(Rn({ id: t, type: i.type })), s.push(Ln({ requestId: t, actualId: i.id }))), s.push(Fn({ id: t })), s;
113
113
  }, Wt = Number.isNaN || function(t) {
114
114
  return typeof t == "number" && t !== t;
115
115
  };
116
- function $n(t, e) {
116
+ function Dn(t, e) {
117
117
  return !!(t === e || Wt(t) && Wt(e));
118
118
  }
119
119
  function Qt(t, e) {
@@ -122,7 +122,7 @@ function Qt(t, e) {
122
122
  if (t.length !== e.length)
123
123
  return !1;
124
124
  for (let r = 0; r < t.length; r++)
125
- if (!$n(t[r], e[r]))
125
+ if (!Dn(t[r], e[r]))
126
126
  return !1;
127
127
  return !0;
128
128
  }
@@ -182,11 +182,11 @@ function Yt(t, e, { waitTimeout: r = 30 } = {}) {
182
182
  break;
183
183
  }
184
184
  }
185
- t.dispatch(En({ id: i }));
185
+ t.dispatch(Pn({ id: i }));
186
186
  try {
187
187
  const u = await e(i, n);
188
188
  !u.id && !u["@id"] && (u["@type"] && (u["@id"] = i), u.id = i);
189
- const h = jn(i, u);
189
+ const h = $n(i, u);
190
190
  return t.dispatch(St({ actions: h })), ct(s.getState(), i);
191
191
  } catch (u) {
192
192
  throw t.dispatch(Pr({ id: i, message: u.toString() })), u;
@@ -220,12 +220,12 @@ const Gt = (t) => {
220
220
  r.clear();
221
221
  } };
222
222
  return e = t(i, n, s), s;
223
- }, Dn = (t) => t ? Gt(t) : Gt, qn = (t, e) => (r, i, n) => (n.dispatch = (s) => (r((a) => t(a, s), !1, s), s), n.dispatchFromDevtools = !0, { dispatch: (...s) => n.dispatch(...s), ...e }), _n = qn, Mt = /* @__PURE__ */ new Map(), Ve = (t) => {
223
+ }, qn = (t) => t ? Gt(t) : Gt, _n = (t, e) => (r, i, n) => (n.dispatch = (s) => (r((a) => t(a, s), !1, s), s), n.dispatchFromDevtools = !0, { dispatch: (...s) => n.dispatch(...s), ...e }), Un = _n, Mt = /* @__PURE__ */ new Map(), Ve = (t) => {
224
224
  const e = Mt.get(t);
225
225
  return e ? Object.fromEntries(
226
226
  Object.entries(e.stores).map(([r, i]) => [r, i.getState()])
227
227
  ) : {};
228
- }, Un = (t, e, r) => {
228
+ }, Vn = (t, e, r) => {
229
229
  if (t === void 0)
230
230
  return {
231
231
  type: "untracked",
@@ -239,7 +239,7 @@ const Gt = (t) => {
239
239
  stores: {}
240
240
  };
241
241
  return Mt.set(r.name, n), { type: "tracked", store: t, ...n };
242
- }, Vn = (t, e = {}) => (r, i, n) => {
242
+ }, Nn = (t, e = {}) => (r, i, n) => {
243
243
  const { enabled: s, anonymousActionType: a, store: o, ...u } = e;
244
244
  let h;
245
245
  try {
@@ -248,7 +248,7 @@ const Gt = (t) => {
248
248
  }
249
249
  if (!h)
250
250
  return t(r, i, n);
251
- const { connection: l, ...p } = Un(o, h, u);
251
+ const { connection: l, ...p } = Vn(o, h, u);
252
252
  let v = !0;
253
253
  n.setState = (g, A, b) => {
254
254
  const w = r(g, A);
@@ -361,7 +361,7 @@ const Gt = (t) => {
361
361
  return;
362
362
  }
363
363
  }), d;
364
- }, Nn = Vn, ut = (t, e) => {
364
+ }, Hn = Nn, ut = (t, e) => {
365
365
  let r;
366
366
  try {
367
367
  r = JSON.parse(t);
@@ -372,7 +372,7 @@ const Gt = (t) => {
372
372
  );
373
373
  }
374
374
  r !== void 0 && e(r);
375
- }, Hn = (t) => (e, r, i) => {
375
+ }, Bn = (t) => (e, r, i) => {
376
376
  const n = i.subscribe;
377
377
  return i.subscribe = (s, a, o) => {
378
378
  let u = s;
@@ -389,7 +389,7 @@ const Gt = (t) => {
389
389
  }
390
390
  return n(u);
391
391
  }, t(e, r, i);
392
- }, Bn = Hn, zn = (t = {}, e) => {
392
+ }, zn = Bn, Wn = (t = {}, e) => {
393
393
  switch (e.type) {
394
394
  case wr:
395
395
  return {
@@ -408,7 +408,7 @@ const Gt = (t) => {
408
408
  function lt(t, e, r, i) {
409
409
  return !(!t[r] || !t[r][e] || !t[r][e][i] || !Array.isArray(t[r][e][i]));
410
410
  }
411
- function Wn(t, e) {
411
+ function Qn(t, e) {
412
412
  const r = {}, i = [];
413
413
  for (const [n, s] of Object.entries(t || {})) {
414
414
  i.push(n);
@@ -429,7 +429,7 @@ function C(t) {
429
429
  function ft(t, e) {
430
430
  return typeof t > "u" ? e : t;
431
431
  }
432
- const Qn = (t = Lr(), e) => {
432
+ const Yn = (t = Lr(), e) => {
433
433
  var r;
434
434
  const i = (n, s) => ({
435
435
  ...t,
@@ -465,7 +465,7 @@ const Qn = (t = Lr(), e) => {
465
465
  const l = Object.keys(o || {}) || [];
466
466
  if (o && l) {
467
467
  for (const p of l)
468
- h = !0, u[p] = t[a][p] ? Wn(t[a][p], o[p]) : o[p];
468
+ h = !0, u[p] = t[a][p] ? Qn(t[a][p], o[p]) : o[p];
469
469
  h && (s[a] = u);
470
470
  }
471
471
  }
@@ -512,10 +512,10 @@ const Qn = (t = Lr(), e) => {
512
512
  default:
513
513
  return t;
514
514
  }
515
- }, Yn = (t = {}, e) => {
515
+ }, Gn = (t = {}, e) => {
516
516
  switch (e.type) {
517
517
  case Ir:
518
- case On:
518
+ case En:
519
519
  return {
520
520
  ...t,
521
521
  [e.payload.id]: {
@@ -560,7 +560,7 @@ const Qn = (t = Lr(), e) => {
560
560
  };
561
561
  }
562
562
  return t;
563
- }, Gn = (t = {}, e) => {
563
+ }, Jn = (t = {}, e) => {
564
564
  const { id: r, updateValue: i, value: n, meta: s, key: a } = e && e.payload || {};
565
565
  switch (e.type) {
566
566
  case Mr:
@@ -612,8 +612,8 @@ function Fr(t = {}) {
612
612
  return n ? s : r;
613
613
  };
614
614
  }
615
- function Jn(t) {
616
- return (e, r) => r && r.type === Et ? r.payload.actions.reduce(t, e) : r && r.type === Fn ? {
615
+ function Kn(t) {
616
+ return (e, r) => r && r.type === Et ? r.payload.actions.reduce(t, e) : r && r.type === jn ? {
617
617
  ...e,
618
618
  iiif: {
619
619
  ...e.iiif,
@@ -621,13 +621,13 @@ function Jn(t) {
621
621
  }
622
622
  } : t(e, r);
623
623
  }
624
- const Kn = Fr({
625
- mapping: zn,
626
- entities: Qn,
627
- requests: Yn,
628
- meta: Gn
624
+ const Zn = Fr({
625
+ mapping: Wn,
626
+ entities: Yn,
627
+ requests: Gn,
628
+ meta: Jn
629
629
  });
630
- function Zn() {
630
+ function Xn() {
631
631
  return {
632
632
  iiif: {
633
633
  entities: Lr(),
@@ -637,16 +637,16 @@ function Zn() {
637
637
  }
638
638
  };
639
639
  }
640
- function Xn(t = {}) {
640
+ function es(t = {}) {
641
641
  const {
642
642
  enableDevtools: e = !1,
643
643
  iiifStoreName: r = "iiif",
644
- defaultState: i = Zn(),
644
+ defaultState: i = Xn(),
645
645
  customReducers: n = {}
646
- } = t, s = Jn(Fr({ [r]: Kn, ...n }));
647
- return Dn(Bn(Nn(_n(s, i), { enabled: e })));
646
+ } = t, s = Kn(Fr({ [r]: Zn, ...n }));
647
+ return qn(zn(Hn(Un(s, i), { enabled: e })));
648
648
  }
649
- function es(t) {
649
+ function ts(t) {
650
650
  return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, r) {
651
651
  var i = t.get(e);
652
652
  i ? i.push(r) : t.set(e, [r]);
@@ -684,7 +684,7 @@ function z(t, e, r, i = !0) {
684
684
  });
685
685
  }
686
686
  const we = Symbol.for("_refs_"), xe = Symbol.for("_reactive_"), Te = Symbol.for("_defined_"), Jt = Symbol.for("_parent_");
687
- function ts(t, e = !1, r) {
687
+ function rs(t, e = !1, r) {
688
688
  const i = {
689
689
  id: "",
690
690
  type: "unknown",
@@ -757,7 +757,7 @@ function ts(t, e = !1, r) {
757
757
  };
758
758
  return z("items", i, t), z("annotations", i, t), z("structures", i, t), z("seeAlso", i, t), z("rendering", i, t), z("partOf", i, t), z("start", i, t, !1), z("supplementary", i, t), z("homepage", i, t), z("thumbnail", i, t), z("placeholderCanvas", i, t, !1), z("accompanyingCanvas", i, t, !1), z("provider", i, t), z("body", i, t), z("logo", i, t), i;
759
759
  }
760
- function rs(t) {
760
+ function is(t) {
761
761
  return !!t[Te];
762
762
  }
763
763
  function jr(t) {
@@ -768,7 +768,7 @@ function Se(t, e, r = !1, i) {
768
768
  return t.map((o) => Se(o, e, r));
769
769
  if (!t || !t.type || !t.id)
770
770
  return t;
771
- const n = ts(e, r), s = Object.create(n), a = Object.assign(s, t);
771
+ const n = rs(e, r), s = Object.create(n), a = Object.assign(s, t);
772
772
  return r && a.reactive(), a;
773
773
  }
774
774
  function Kt(t) {
@@ -799,11 +799,11 @@ let Ct = class {
799
799
  enableDevtools: !0
800
800
  },
801
801
  e || {}
802
- ), this.store = r || Xn({
802
+ ), this.store = r || es({
803
803
  customReducers: this.options.reducers,
804
804
  defaultState: this.options.defaultState,
805
805
  enableDevtools: this.options.enableDevtools
806
- }), this.emitter = es(), this.remoteFetcher = Yt(this, this.options.customFetcher), this.staticFetcher = Yt(this, (i, n) => n);
806
+ }), this.emitter = ts(), this.remoteFetcher = Yt(this, this.options.customFetcher), this.staticFetcher = Yt(this, (i, n) => n);
807
807
  }
808
808
  batch(e) {
809
809
  this.isBatching = !0;
@@ -825,7 +825,7 @@ let Ct = class {
825
825
  }
826
826
  modifyEntityField(e, r, i) {
827
827
  this.dispatch(
828
- Mn.modifyEntityField({
828
+ Cn.modifyEntityField({
829
829
  id: e.id,
830
830
  type: e.type,
831
831
  key: r,
@@ -858,13 +858,13 @@ let Ct = class {
858
858
  };
859
859
  }
860
860
  serialize(e, r) {
861
- return rn(this.getState().iiif, e, r);
861
+ return nn(this.getState().iiif, e, r);
862
862
  }
863
863
  toPresentation2(e) {
864
- return this.serialize(e, nn);
864
+ return this.serialize(e, sn);
865
865
  }
866
866
  toPresentation3(e) {
867
- return this.serialize(e, sn);
867
+ return this.serialize(e, an);
868
868
  }
869
869
  hydrate(e, r, i = {}) {
870
870
  return this.get(e, r, { ...i, skipSelfReturn: !1 });
@@ -876,7 +876,7 @@ let Ct = class {
876
876
  if (Array.isArray(e))
877
877
  return e.map((p) => this.get(p, i));
878
878
  const a = this.getState();
879
- if (an(e) && !i.preserveSpecificResources && (e = e.source), typeof e == "string") {
879
+ if (on(e) && !i.preserveSpecificResources && (e = e.source), typeof e == "string") {
880
880
  const p = Kt(r || a.iiif.mapping[e]);
881
881
  if (!p)
882
882
  return n ? null : { id: e, type: "unknown" };
@@ -971,7 +971,7 @@ let Ct = class {
971
971
  return Se(this.get(e, { skipSelfReturn: !1 }), this);
972
972
  }
973
973
  isWrapped(e) {
974
- return rs(e);
974
+ return is(e);
975
975
  }
976
976
  setMetaValue([e, r, i], n) {
977
977
  this.dispatch(
@@ -989,11 +989,11 @@ let Ct = class {
989
989
  );
990
990
  }
991
991
  };
992
- function is() {
992
+ function ns() {
993
993
  return typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
994
994
  }
995
995
  function $r(t) {
996
- const e = is();
996
+ const e = ns();
997
997
  try {
998
998
  const i = e.IIIF_VAULT;
999
999
  if (i)
@@ -1028,7 +1028,7 @@ const W = () => {
1028
1028
  throw new Error("Vault not found. Ensure you have your provider set up correctly.");
1029
1029
  return t;
1030
1030
  };
1031
- function ns(t, { noCache: e = !1 } = {}) {
1031
+ function ss(t, { noCache: e = !1 } = {}) {
1032
1032
  const r = typeof t == "string" ? t : t.id, i = W(), [n, s] = J(r), [a, o] = J(void 0), u = j(() => i.get(r, { skipSelfReturn: !0 }) || void 0, [r, i]), [h, l] = J(u);
1033
1033
  return re(() => {
1034
1034
  (async () => {
@@ -1048,14 +1048,14 @@ function ns(t, { noCache: e = !1 } = {}) {
1048
1048
  cached: !!(h && h === u)
1049
1049
  };
1050
1050
  }
1051
- function ss(t, e) {
1052
- const { id: r, isLoaded: i, error: n, resource: s, requestId: a, cached: o } = ns(
1051
+ function as(t, e) {
1052
+ const { id: r, isLoaded: i, error: n, resource: s, requestId: a, cached: o } = ss(
1053
1053
  t,
1054
1054
  e
1055
1055
  );
1056
1056
  return { id: r, isLoaded: i, error: n, manifest: s, requestId: a, cached: o };
1057
1057
  }
1058
- function as({ manifest: t, children: e }) {
1058
+ function os({ manifest: t, children: e }) {
1059
1059
  return /* @__PURE__ */ x(et, { value: { manifest: t }, children: e });
1060
1060
  }
1061
1061
  function Pt({ canvas: t, children: e }) {
@@ -1091,7 +1091,7 @@ function Pe(t = {}, e = []) {
1091
1091
  return i ? i(a) : a;
1092
1092
  }, [a, i, ...e]);
1093
1093
  }
1094
- function os({ range: t, children: e }) {
1094
+ function cs({ range: t, children: e }) {
1095
1095
  return /* @__PURE__ */ x(et, { value: { range: t }, children: e });
1096
1096
  }
1097
1097
  function _r(t, e) {
@@ -1104,7 +1104,7 @@ function _r(t, e) {
1104
1104
  }
1105
1105
  return r;
1106
1106
  }
1107
- function cs(t, e, { disablePaging: r, skipNonPaged: i } = {}) {
1107
+ function us(t, e, { disablePaging: r, skipNonPaged: i } = {}) {
1108
1108
  const n = e.behavior, s = n.includes("paged"), a = s ? !1 : n.includes("continuous"), o = s || a ? !1 : n.includes("individuals"), u = e.type === "Manifest" ? e.items : _r(t, e);
1109
1109
  if (a)
1110
1110
  return [u, [u.map((d, g) => g)]];
@@ -1134,20 +1134,20 @@ function cs(t, e, { disablePaging: r, skipNonPaged: i } = {}) {
1134
1134
  }
1135
1135
  return l.length && p(), [u, h];
1136
1136
  }
1137
- function us(t = {}, e = []) {
1137
+ function ls(t = {}, e = []) {
1138
1138
  const { id: r, selector: i } = t, n = Ee(), s = r || n.range, a = Y((o) => s ? o.iiif.entities.Range[s] : void 0, [s]);
1139
1139
  return j(() => {
1140
1140
  if (a)
1141
1141
  return i ? i(a) : a;
1142
1142
  }, [a, i, ...e]);
1143
1143
  }
1144
- function ls({ startCanvas: t, disablePaging: e }) {
1144
+ function fs({ startCanvas: t, disablePaging: e }) {
1145
1145
  var d;
1146
- const r = W(), i = Pe(), n = us(), [s, a] = J(void 0), o = n || i;
1146
+ const r = W(), i = Pe(), n = ls(), [s, a] = J(void 0), o = n || i;
1147
1147
  if (!o)
1148
1148
  throw new Error("Nothing selected");
1149
1149
  const [u, h] = j(
1150
- () => cs(r, o, { disablePaging: e }),
1150
+ () => us(r, o, { disablePaging: e }),
1151
1151
  [r, o]
1152
1152
  ), l = D(
1153
1153
  (g) => {
@@ -1189,8 +1189,8 @@ const Le = () => {
1189
1189
  setSequenceIndex: Le,
1190
1190
  currentSequenceIndex: 0
1191
1191
  });
1192
- function fs(t) {
1193
- const e = Pe(), { cursor: r, visibleItems: i, next: n, sequence: s, items: a, setCanvasIndex: o, setCanvasId: u, previous: h, setSequenceIndex: l } = ls({
1192
+ function ps(t) {
1193
+ const e = Pe(), { cursor: r, visibleItems: i, next: n, sequence: s, items: a, setCanvasIndex: o, setCanvasId: u, previous: h, setSequenceIndex: l } = fs({
1194
1194
  startCanvas: t.startCanvas,
1195
1195
  disablePaging: t.pagingEnabled === !1
1196
1196
  }), p = j(
@@ -1210,21 +1210,21 @@ function fs(t) {
1210
1210
  );
1211
1211
  return e ? /* @__PURE__ */ x(it.Provider, { value: p, children: /* @__PURE__ */ x(rt.Provider, { value: i, children: /* @__PURE__ */ x(Pt, { canvas: i[0], children: t.children }) }) }) : (console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */ x("div", { children: "Sorry, something went wrong." }));
1212
1212
  }
1213
- function ps(t) {
1214
- const e = ss(t.manifest);
1213
+ function hs(t) {
1214
+ const e = as(t.manifest);
1215
1215
  if (!e)
1216
1216
  return console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */ x("div", { children: "Sorry, something went wrong." });
1217
1217
  if (e.error)
1218
1218
  return /* @__PURE__ */ x("div", { children: e.error.toString() });
1219
1219
  if (!e.isLoaded)
1220
1220
  return /* @__PURE__ */ x("div", { children: "Loading..." });
1221
- const r = /* @__PURE__ */ x(fs, { ...t, children: t.children });
1222
- return /* @__PURE__ */ x(as, { manifest: e.id, children: t.rangeId ? /* @__PURE__ */ x(os, { range: t.rangeId, children: r }) : r });
1221
+ const r = /* @__PURE__ */ x(ps, { ...t, children: t.children });
1222
+ return /* @__PURE__ */ x(os, { manifest: e.id, children: t.rangeId ? /* @__PURE__ */ x(cs, { range: t.rangeId, children: r }) : r });
1223
1223
  }
1224
- function hs() {
1224
+ function ds() {
1225
1225
  return Q(it);
1226
1226
  }
1227
- function ds() {
1227
+ function ys() {
1228
1228
  return {
1229
1229
  VaultContext: Q(tt),
1230
1230
  ResourceContext: Q(Ot),
@@ -1232,7 +1232,7 @@ function ds() {
1232
1232
  VisibleCanvasReactContext: Q(rt)
1233
1233
  };
1234
1234
  }
1235
- function ys(t) {
1235
+ function vs(t) {
1236
1236
  return /* @__PURE__ */ x(Dr, { vault: t.bridge.VaultContext.vault || void 0, resources: t.bridge.ResourceContext, children: /* @__PURE__ */ x(rt.Provider, { value: t.bridge.VisibleCanvasReactContext, children: /* @__PURE__ */ x(it.Provider, { value: t.bridge.SimpleViewerReactContext, children: t.children }) }) });
1237
1237
  }
1238
1238
  const se = function(t) {
@@ -1244,27 +1244,27 @@ const se = function(t) {
1244
1244
  ...i !== void 0 && { meta: i }
1245
1245
  });
1246
1246
  };
1247
- }, vs = "@iiif/IMPORT_ENTITIES", gs = "@iiif/MODIFY_ENTITY_FIELD", ms = "@iiif/REORDER_ENTITY_FIELD", bs = "@iiif/ADD_REFERENCE", As = "@iiif/UPDATE_REFERENCE", xs = "@iiif/REMOVE_REFERENCE", ws = "@iiif/ADD_METADATA", Ss = "@iiif/REMOVE_METADATA", Ms = "@iiif/UPDATE_METADATA", Cs = "@iiif/REORDER_METADATA", Rs = se(vs)(), Ts = se(gs)(), Is = se(ms)(), ks = se(bs)(), Os = se(xs)(), Es = se(As)(), Ps = se(ws)(), Ls = se(Ms)(), Fs = se(Ss)(), js = se(Cs)(), pt = {
1248
- importEntities: Rs,
1249
- modifyEntityField: Ts,
1250
- reorderEntityField: Is,
1251
- addReference: ks,
1252
- removeReference: Os,
1253
- updateReference: Es,
1254
- addMetadata: Ps,
1255
- removeMetadata: Fs,
1256
- updateMetadata: Ls,
1257
- reorderMetadata: js
1247
+ }, gs = "@iiif/IMPORT_ENTITIES", ms = "@iiif/MODIFY_ENTITY_FIELD", bs = "@iiif/REORDER_ENTITY_FIELD", As = "@iiif/ADD_REFERENCE", xs = "@iiif/UPDATE_REFERENCE", ws = "@iiif/REMOVE_REFERENCE", Ss = "@iiif/ADD_METADATA", Ms = "@iiif/REMOVE_METADATA", Cs = "@iiif/UPDATE_METADATA", Rs = "@iiif/REORDER_METADATA", Ts = se(gs)(), Is = se(ms)(), ks = se(bs)(), Os = se(As)(), Es = se(ws)(), Ps = se(xs)(), Ls = se(Ss)(), Fs = se(Cs)(), js = se(Ms)(), $s = se(Rs)(), pt = {
1248
+ importEntities: Ts,
1249
+ modifyEntityField: Is,
1250
+ reorderEntityField: ks,
1251
+ addReference: Os,
1252
+ removeReference: Es,
1253
+ updateReference: Ps,
1254
+ addMetadata: Ls,
1255
+ removeMetadata: js,
1256
+ updateMetadata: Fs,
1257
+ reorderMetadata: $s
1258
1258
  };
1259
- function $s() {
1259
+ function Ds() {
1260
1260
  const e = W().getStore();
1261
1261
  return j(() => (r) => e.dispatch(r), [e]);
1262
1262
  }
1263
1263
  function Zt(t) {
1264
1264
  return typeof t != "string" && t && t.bindToVault;
1265
1265
  }
1266
- function Ds() {
1267
- const t = W(), e = ve([]), r = $s(), i = j(() => `vault://annotation-page/${(/* @__PURE__ */ new Date()).getTime()}/${Math.round(Math.random() * 1e9).toString(16)}`, []);
1266
+ function qs() {
1267
+ const t = W(), e = ve([]), r = Ds(), i = j(() => `vault://annotation-page/${(/* @__PURE__ */ new Date()).getTime()}/${Math.round(Math.random() * 1e9).toString(16)}`, []);
1268
1268
  ur(() => {
1269
1269
  const o = {
1270
1270
  id: i,
@@ -1345,7 +1345,7 @@ function Ds() {
1345
1345
  ];
1346
1346
  }
1347
1347
  const Ur = ce(null);
1348
- function qs() {
1348
+ function _s() {
1349
1349
  const t = Q(Ur);
1350
1350
  return [
1351
1351
  t.fullPage,
@@ -1355,8 +1355,8 @@ function qs() {
1355
1355
  }
1356
1356
  ];
1357
1357
  }
1358
- function _s({ children: t }) {
1359
- const [e, { addAnnotation: r, removeAnnotation: i }] = Ds();
1358
+ function Us({ children: t }) {
1359
+ const [e, { addAnnotation: r, removeAnnotation: i }] = qs();
1360
1360
  return /* @__PURE__ */ x(
1361
1361
  Ur.Provider,
1362
1362
  {
@@ -1365,7 +1365,7 @@ function _s({ children: t }) {
1365
1365
  }
1366
1366
  );
1367
1367
  }
1368
- function Us({
1368
+ function Vs({
1369
1369
  width: t,
1370
1370
  style: e,
1371
1371
  height: r,
@@ -1379,7 +1379,7 @@ function Us({
1379
1379
  ] });
1380
1380
  }
1381
1381
  const Lt = ce(null);
1382
- function Vs() {
1382
+ function Ns() {
1383
1383
  return Q(Lt);
1384
1384
  }
1385
1385
  const Vr = ce(
@@ -1404,19 +1404,19 @@ function me(t = {}, e = []) {
1404
1404
  }
1405
1405
  const Hr = ce(() => {
1406
1406
  });
1407
- function Ns(t) {
1407
+ function Hs(t) {
1408
1408
  const e = me(), r = Q(Hr);
1409
1409
  re(() => e && e.id ? (r(e.id, t), () => r(e.id, -1)) : () => {
1410
1410
  }, [e, t]);
1411
1411
  }
1412
- function Hs({
1412
+ function Bs({
1413
1413
  children: t,
1414
1414
  errorFallback: e,
1415
1415
  outerContainerProps: r = {},
1416
1416
  worldScale: i,
1417
1417
  ...n
1418
1418
  }) {
1419
- const [s, a] = J(), o = ds(), u = e || Us, [h, l] = J({}), p = Object.entries(h), [v, m] = J({}), d = Object.entries(v), [g, A] = J({}), b = j(() => i || Math.max(...Object.values(g)), [g]), w = j(() => ({ maxOverZoom: b || 1 }), [b]), R = D((T, P) => {
1419
+ const [s, a] = J(), o = ys(), u = e || Vs, [h, l] = J({}), p = Object.entries(h), [v, m] = J({}), d = Object.entries(v), [g, A] = J({}), b = j(() => i || Math.max(...Object.values(g)), [g]), w = j(() => ({ maxOverZoom: b || 1 }), [b]), R = D((T, P) => {
1420
1420
  A((E) => {
1421
1421
  if (P === -1) {
1422
1422
  const { [T]: M, ...$ } = E;
@@ -1435,7 +1435,7 @@ function Hs({
1435
1435
  [T]: { element: P, props: E }
1436
1436
  } : $);
1437
1437
  }, []);
1438
- return /* @__PURE__ */ V(fn, { resetKeys: [], fallbackRender: (T) => /* @__PURE__ */ x(u, { ...n, ...T }), children: [
1438
+ return /* @__PURE__ */ V(pn, { resetKeys: [], fallbackRender: (T) => /* @__PURE__ */ x(u, { ...n, ...T }), children: [
1439
1439
  /* @__PURE__ */ x(
1440
1440
  Ki,
1441
1441
  {
@@ -1446,7 +1446,7 @@ function Hs({
1446
1446
  a(T), n.onCreated && n.onCreated(T);
1447
1447
  },
1448
1448
  runtimeOptions: w,
1449
- children: /* @__PURE__ */ x(Lt.Provider, { value: s, children: /* @__PURE__ */ x(Hr.Provider, { value: R, children: /* @__PURE__ */ x(Vr.Provider, { value: O, children: /* @__PURE__ */ x(Nr.Provider, { value: F, children: /* @__PURE__ */ x(ys, { bridge: o, children: /* @__PURE__ */ x(_s, { children: t }) }) }) }) }) })
1449
+ children: /* @__PURE__ */ x(Lt.Provider, { value: s, children: /* @__PURE__ */ x(Hr.Provider, { value: R, children: /* @__PURE__ */ x(Vr.Provider, { value: O, children: /* @__PURE__ */ x(Nr.Provider, { value: F, children: /* @__PURE__ */ x(vs, { bridge: o, children: /* @__PURE__ */ x(Zi.Provider, { value: n.mode || "explore", children: /* @__PURE__ */ x(Us, { children: t }) }) }) }) }) }) })
1450
1450
  }
1451
1451
  ),
1452
1452
  /* @__PURE__ */ x("div", { children: d.map(([T, { element: P, props: E }]) => /* @__PURE__ */ x(ge.Fragment, { children: /* @__PURE__ */ x(P, { ...E || {} }) }, T)) })
@@ -1472,7 +1472,7 @@ const Ne = {}, Br = {
1472
1472
  return e ? r[e] : r;
1473
1473
  }
1474
1474
  };
1475
- function Bs(t = Br) {
1475
+ function zs(t = Br) {
1476
1476
  return {
1477
1477
  addEventListener(e, r, i, n) {
1478
1478
  if (e)
@@ -1510,7 +1510,7 @@ function Bs(t = Br) {
1510
1510
  };
1511
1511
  }
1512
1512
  function zr(t, e) {
1513
- const r = W(), i = j(() => Bs(r), [r]), n = Y(() => t && t.id ? r.getResourceMeta(t.id, "eventManager") : null, [t]);
1513
+ const r = W(), i = j(() => zs(r), [r]), n = Y(() => t && t.id ? r.getResourceMeta(t.id, "eventManager") : null, [t]);
1514
1514
  return j(() => t ? i.getListenersAsProps(t, e) : {}, [n, t, r, e]);
1515
1515
  }
1516
1516
  const He = {}, Wr = {
@@ -1554,7 +1554,7 @@ function Xe(t, e) {
1554
1554
  return n ? e ? n[e] : n : void 0;
1555
1555
  }, [t, e]);
1556
1556
  }
1557
- var zs = Object.defineProperty, Ws = (t, e, r) => e in t ? zs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, We = (t, e, r) => (Ws(t, typeof e != "symbol" ? e + "" : e, r), r), Qs = /* @__PURE__ */ function() {
1557
+ var Ws = Object.defineProperty, Qs = (t, e, r) => e in t ? Ws(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, We = (t, e, r) => (Qs(t, typeof e != "symbol" ? e + "" : e, r), r), Ys = /* @__PURE__ */ function() {
1558
1558
  function t(e, r) {
1559
1559
  var i = [], n = !0, s = !1, a = void 0;
1560
1560
  try {
@@ -1587,7 +1587,7 @@ var zs = Object.defineProperty, Ws = (t, e, r) => e in t ? zs(t, e, { enumerable
1587
1587
  x: h + s,
1588
1588
  y: l + a
1589
1589
  };
1590
- }, Ys = function(t, e) {
1590
+ }, Gs = function(t, e) {
1591
1591
  var r = e === 1.5707963267948966 ? 0.551915024494 : e === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(e / 4), i = Math.cos(t), n = Math.sin(t), s = Math.cos(t + e), a = Math.sin(t + e);
1592
1592
  return [{
1593
1593
  x: i - n * r,
@@ -1602,12 +1602,12 @@ var zs = Object.defineProperty, Ws = (t, e, r) => e in t ? zs(t, e, { enumerable
1602
1602
  }, Xt = function(t, e, r, i) {
1603
1603
  var n = t * i - e * r < 0 ? -1 : 1, s = t * r + e * i;
1604
1604
  return s > 1 && (s = 1), s < -1 && (s = -1), n * Math.acos(s);
1605
- }, Gs = function(t, e, r, i, n, s, a, o, u, h, l, p) {
1605
+ }, Js = function(t, e, r, i, n, s, a, o, u, h, l, p) {
1606
1606
  var v = Math.pow(n, 2), m = Math.pow(s, 2), d = Math.pow(l, 2), g = Math.pow(p, 2), A = v * m - v * g - m * d;
1607
1607
  A < 0 && (A = 0), A /= v * g + m * d, A = Math.sqrt(A) * (a === o ? -1 : 1);
1608
1608
  var b = A * n / s * p, w = A * -s / n * l, R = h * b - u * w + (t + r) / 2, O = u * b + h * w + (e + i) / 2, F = (l - b) / n, T = (p - w) / s, P = (-l - b) / n, E = (-p - w) / s, M = Xt(1, 0, F, T), $ = Xt(F, T, P, E);
1609
1609
  return o === 0 && $ > 0 && ($ -= je), o === 1 && $ < 0 && ($ += je), [R, O, M, $];
1610
- }, Js = function(t) {
1610
+ }, Ks = function(t) {
1611
1611
  var e = t.px, r = t.py, i = t.cx, n = t.cy, s = t.rx, a = t.ry, o = t.xAxisRotation, u = o === void 0 ? 0 : o, h = t.largeArcFlag, l = h === void 0 ? 0 : h, p = t.sweepFlag, v = p === void 0 ? 0 : p, m = [];
1612
1612
  if (s === 0 || a === 0)
1613
1613
  return [];
@@ -1617,12 +1617,12 @@ var zs = Object.defineProperty, Ws = (t, e, r) => e in t ? zs(t, e, { enumerable
1617
1617
  s = Math.abs(s), a = Math.abs(a);
1618
1618
  var w = Math.pow(A, 2) / Math.pow(s, 2) + Math.pow(b, 2) / Math.pow(a, 2);
1619
1619
  w > 1 && (s *= Math.sqrt(w), a *= Math.sqrt(w));
1620
- var R = Gs(e, r, i, n, s, a, l, v, d, g, A, b), O = Qs(R, 4), F = O[0], T = O[1], P = O[2], E = O[3], M = Math.abs(E) / (je / 4);
1620
+ var R = Js(e, r, i, n, s, a, l, v, d, g, A, b), O = Ys(R, 4), F = O[0], T = O[1], P = O[2], E = O[3], M = Math.abs(E) / (je / 4);
1621
1621
  Math.abs(1 - M) < 1e-7 && (M = 1);
1622
1622
  var $ = Math.max(Math.ceil(M), 1);
1623
1623
  E /= $;
1624
1624
  for (var ie = 0; ie < $; ie++)
1625
- m.push(Ys(P, E)), P += E;
1625
+ m.push(Gs(P, E)), P += E;
1626
1626
  return m.map(function(K) {
1627
1627
  var U = ht(K[0], s, a, g, d, F, T), N = U.x, X = U.y, ne = ht(K[1], s, a, g, d, F, T), Ae = ne.x, k = ne.y, H = ht(K[2], s, a, g, d, F, T), Z = H.x, pe = H.y;
1628
1628
  return { x1: N, y1: X, x2: Ae, y2: k, x: Z, y: pe };
@@ -1631,12 +1631,12 @@ var zs = Object.defineProperty, Ws = (t, e, r) => e in t ? zs(t, e, { enumerable
1631
1631
  function Yr(t) {
1632
1632
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1633
1633
  }
1634
- var Ks = Xs, dt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, Zs = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
1635
- function Xs(t) {
1634
+ var Zs = ea, dt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, Xs = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
1635
+ function ea(t) {
1636
1636
  var e = [];
1637
- return t.replace(Zs, function(r, i, n) {
1637
+ return t.replace(Xs, function(r, i, n) {
1638
1638
  var s = i.toLowerCase();
1639
- for (n = ta(n), s == "m" && n.length > 2 && (e.push([i].concat(n.splice(0, 2))), s = "l", i = i == "m" ? "l" : "L"); ; ) {
1639
+ for (n = ra(n), s == "m" && n.length > 2 && (e.push([i].concat(n.splice(0, 2))), s = "l", i = i == "m" ? "l" : "L"); ; ) {
1640
1640
  if (n.length == dt[s])
1641
1641
  return n.unshift(i), e.push(n);
1642
1642
  if (n.length < dt[s])
@@ -1645,14 +1645,14 @@ function Xs(t) {
1645
1645
  }
1646
1646
  }), e;
1647
1647
  }
1648
- var ea = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
1649
- function ta(t) {
1650
- var e = t.match(ea);
1648
+ var ta = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
1649
+ function ra(t) {
1650
+ var e = t.match(ta);
1651
1651
  return e ? e.map(Number) : [];
1652
1652
  }
1653
- const ra = /* @__PURE__ */ Yr(Ks);
1654
- var ia = na;
1655
- function na(t) {
1653
+ const ia = /* @__PURE__ */ Yr(Zs);
1654
+ var na = sa;
1655
+ function sa(t) {
1656
1656
  var e = 0, r = 0, i = 0, n = 0;
1657
1657
  return t.map(function(s) {
1658
1658
  s = s.slice();
@@ -1691,9 +1691,9 @@ function na(t) {
1691
1691
  return s;
1692
1692
  });
1693
1693
  }
1694
- const sa = /* @__PURE__ */ Yr(ia);
1695
- function aa(t) {
1696
- const e = ra(t), r = sa(e);
1694
+ const aa = /* @__PURE__ */ Yr(na);
1695
+ function oa(t) {
1696
+ const e = ia(t), r = aa(e);
1697
1697
  let i, n = 0, s = 0, a = 0, o = 0, u, h, l = 0, p = 0;
1698
1698
  const v = [];
1699
1699
  for (let m = 0; m < r.length; m++) {
@@ -1723,7 +1723,7 @@ function aa(t) {
1723
1723
  break;
1724
1724
  case "A":
1725
1725
  {
1726
- const A = Js({
1726
+ const A = Ks({
1727
1727
  px: l,
1728
1728
  py: p,
1729
1729
  cx: d[6],
@@ -1780,15 +1780,15 @@ function aa(t) {
1780
1780
  * See the License for the specific language governing permissions and
1781
1781
  * limitations under the License.
1782
1782
  */
1783
- function oa(t, e, r, i = 1) {
1783
+ function ca(t, e, r, i = 1) {
1784
1784
  return new Gr(t, e, r).subdivide(i);
1785
1785
  }
1786
- function ca(t, e, r, i, n = 1) {
1786
+ function ua(t, e, r, i, n = 1) {
1787
1787
  return new Ft(
1788
1788
  new Float64Array([t.x, t.y, e.x, e.y, r.x, r.y, i.x, i.y])
1789
1789
  ).subdivide(n);
1790
1790
  }
1791
- function ua(t) {
1791
+ function la(t) {
1792
1792
  return t.x * t.x + t.y * t.y;
1793
1793
  }
1794
1794
  function $e(t) {
@@ -1853,7 +1853,7 @@ class Ft {
1853
1853
  }
1854
1854
  // Very fancy subdivision scheme
1855
1855
  subdivide(e) {
1856
- const r = 0.1 * e, i = e - r, n = Math.sqrt(i), s = ua(this.weightsum(1, -3, 3, -1)), a = Math.ceil(Math.pow(s / (432 * r * r), 1 / 6)), o = [];
1856
+ const r = 0.1 * e, i = e - r, n = Math.sqrt(i), s = la(this.weightsum(1, -3, 3, -1)), a = Math.ceil(Math.pow(s / (432 * r * r), 1 / 6)), o = [];
1857
1857
  let u = 0;
1858
1858
  for (let d = 0; d < a; d++) {
1859
1859
  const g = d / a, A = (d + 1) / a, b = this.subsegment(g, A).midpoint_quadbez(), w = b.mapToBasic(), R = $e(w.x0), O = $e(w.x2), F = Math.sqrt(w.scale);
@@ -1881,7 +1881,7 @@ class Ft {
1881
1881
  return p.push({ x: this.c[6], y: this.c[7] }), p;
1882
1882
  }
1883
1883
  }
1884
- const la = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/, fa = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/, er = /^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;
1884
+ const fa = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/, pa = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/, er = /^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;
1885
1885
  function Qe(t, {
1886
1886
  domParser: e,
1887
1887
  svgPreprocessor: r,
@@ -1935,7 +1935,7 @@ function Qe(t, {
1935
1935
  iiifRenderingHints: i
1936
1936
  });
1937
1937
  }
1938
- if (ya(t)) {
1938
+ if (va(t)) {
1939
1939
  const n = [];
1940
1940
  if (t.region) {
1941
1941
  const s = Qe(
@@ -1951,7 +1951,7 @@ function Qe(t, {
1951
1951
  });
1952
1952
  }
1953
1953
  if (t.type === "FragmentSelector") {
1954
- const n = la.exec(t.value);
1954
+ const n = fa.exec(t.value);
1955
1955
  if (n) {
1956
1956
  const a = {
1957
1957
  type: "BoxSelector",
@@ -1969,7 +1969,7 @@ function Qe(t, {
1969
1969
  iiifRenderingHints: i
1970
1970
  });
1971
1971
  }
1972
- const s = t.value.match(fa);
1972
+ const s = t.value.match(pa);
1973
1973
  if (s) {
1974
1974
  const a = {
1975
1975
  type: "TemporalSelector",
@@ -2013,7 +2013,7 @@ function Qe(t, {
2013
2013
  // urx
2014
2014
  Math.max(...n.map((v) => v[1]))
2015
2015
  // ury
2016
- ], { style: a, svg: o } = da(p.element) ?? { svg: o });
2016
+ ], { style: a, svg: o } = ya(p.element) ?? { svg: o });
2017
2017
  }
2018
2018
  const h = {
2019
2019
  type: "SvgSelector",
@@ -2035,7 +2035,7 @@ function Qe(t, {
2035
2035
  iiifRenderingHints: i
2036
2036
  });
2037
2037
  }
2038
- function pa(t) {
2038
+ function ha(t) {
2039
2039
  const e = t.map((i) => i[0]).reduce(
2040
2040
  (i, n) => (i[n] += 1, i),
2041
2041
  { C: 0, Q: 0, L: 0, M: 0 }
@@ -2065,8 +2065,8 @@ function Jr(t) {
2065
2065
  const i = r.getAttribute("d");
2066
2066
  if (!i)
2067
2067
  continue;
2068
- const n = aa(i);
2069
- return { element: r, points: ha(n), shapeType: pa(n) };
2068
+ const n = oa(i);
2069
+ return { element: r, points: da(n), shapeType: ha(n) };
2070
2070
  }
2071
2071
  case "circle": {
2072
2072
  const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("r") ?? "0");
@@ -2132,7 +2132,7 @@ function Jr(t) {
2132
2132
  }
2133
2133
  return null;
2134
2134
  }
2135
- function ha(t) {
2135
+ function da(t) {
2136
2136
  const e = [];
2137
2137
  for (let r = 0; r < t.length; r++) {
2138
2138
  const i = e[e.length - 1] ?? [0, 0], n = t[r];
@@ -2143,7 +2143,7 @@ function ha(t) {
2143
2143
  continue;
2144
2144
  case "C":
2145
2145
  e.push(
2146
- ...ca(
2146
+ ...ua(
2147
2147
  { x: i[0], y: i[1] },
2148
2148
  { x: n[1], y: n[2] },
2149
2149
  { x: n[3], y: n[4] },
@@ -2154,7 +2154,7 @@ function ha(t) {
2154
2154
  continue;
2155
2155
  case "Q":
2156
2156
  e.push(
2157
- ...oa(
2157
+ ...ca(
2158
2158
  { x: i[0], y: i[1] },
2159
2159
  { x: n[1], y: n[2] },
2160
2160
  { x: n[3], y: n[4] }
@@ -2166,7 +2166,7 @@ function ha(t) {
2166
2166
  }
2167
2167
  return e;
2168
2168
  }
2169
- function da(t) {
2169
+ function ya(t) {
2170
2170
  const e = {};
2171
2171
  if (t.hasAttribute("fill") ? (e.fill = t.getAttribute("fill"), t.removeAttribute("fill")) : t.style.fill && (e.fill = t.style.fill), e.fill) {
2172
2172
  const i = er.exec(e.fill);
@@ -2183,14 +2183,14 @@ function da(t) {
2183
2183
  throw new Error("Could not find root SVG element");
2184
2184
  return { svg: r.outerHTML, style: Object.keys(e).length > 0 ? e : void 0 };
2185
2185
  }
2186
- function ya(t) {
2186
+ function va(t) {
2187
2187
  return !!t && t.type === "iiif:ImageApiSelector" && t.type === "iiif:ImageApiSelector";
2188
2188
  }
2189
2189
  function ee(t) {
2190
2190
  if (t.iiifRenderingHints) {
2191
2191
  const e = t.iiifRenderingHints;
2192
2192
  if (e.rotation) {
2193
- const r = va(e.rotation);
2193
+ const r = ga(e.rotation);
2194
2194
  if (r)
2195
2195
  if (t.selectors.length)
2196
2196
  for (const i of t.selectors)
@@ -2205,7 +2205,7 @@ function ee(t) {
2205
2205
  delete t.iiifRenderingHints;
2206
2206
  return t;
2207
2207
  }
2208
- function va(t) {
2208
+ function ga(t) {
2209
2209
  let e = parseFloat(t);
2210
2210
  return e && t.startsWith("!") && (e = 360 - e), e && (e = e % 360), e !== e ? 0 : e || 0;
2211
2211
  }
@@ -2308,9 +2308,9 @@ const Zr = ({
2308
2308
  className: r,
2309
2309
  interactive: i
2310
2310
  }) => {
2311
- const n = Kr({ id: t }), s = Xe(n, "atlas"), a = Xe(n, "html"), o = zr(n, ["atlas"]), u = me(), h = j(() => Zi(e, s), [e, s]);
2311
+ const n = Kr({ id: t }), s = Xe(n, "atlas"), a = Xe(n, "html"), o = zr(n, ["atlas"]), u = me(), h = j(() => Xi(e, s), [e, s]);
2312
2312
  return u && n && n.target && n.target.selector && n.target.selector.type === "BoxSelector" && n.target.source && (n.target.source.id === u.id || n.target.source === u.id) ? /* @__PURE__ */ x(
2313
- Xi,
2313
+ en,
2314
2314
  {
2315
2315
  id: n.id,
2316
2316
  isEditing: !0,
@@ -2327,7 +2327,7 @@ const Zr = ({
2327
2327
  }
2328
2328
  ) : null;
2329
2329
  };
2330
- function ga(t = {}, e = []) {
2330
+ function ma(t = {}, e = []) {
2331
2331
  const { id: r, selector: i } = t, n = Ee(), s = r || n.annotationPage, a = Y(
2332
2332
  (o) => s ? o.iiif.entities.AnnotationPage[s] : void 0,
2333
2333
  [s]
@@ -2342,7 +2342,7 @@ const Rt = ({
2342
2342
  page: e
2343
2343
  }) => {
2344
2344
  var s;
2345
- const r = ga({ id: e.id }) || e, i = Xe(r, "atlas"), n = Xe(r, "html");
2345
+ const r = ma({ id: e.id }) || e, i = Xe(r, "atlas"), n = Xe(r, "html");
2346
2346
  return Y((a) => r.id ? a.iiif.entities.AnnotationPage[r.id] : null, []), /* @__PURE__ */ x(Je, { children: (s = r.items) == null ? void 0 : s.map((a) => /* @__PURE__ */ x(
2347
2347
  Zr,
2348
2348
  {
@@ -2380,7 +2380,7 @@ function Xr({
2380
2380
  onClick: u,
2381
2381
  children: e.service ? /* @__PURE__ */ V(Je, { children: [
2382
2382
  /* @__PURE__ */ x(
2383
- en,
2383
+ tn,
2384
2384
  {
2385
2385
  tiles: {
2386
2386
  id: e.service.id || e.service["@id"] || "unknown",
@@ -2418,7 +2418,7 @@ function Xr({
2418
2418
  t + (e.service ? "server" : "no-service")
2419
2419
  );
2420
2420
  }
2421
- var ma = Object.defineProperty, ba = (t, e, r) => e in t ? ma(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ye = (t, e, r) => (ba(t, typeof e != "symbol" ? e + "" : e, r), r), Aa = /* @__PURE__ */ function() {
2421
+ var ba = Object.defineProperty, Aa = (t, e, r) => e in t ? ba(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ye = (t, e, r) => (Aa(t, typeof e != "symbol" ? e + "" : e, r), r), xa = /* @__PURE__ */ function() {
2422
2422
  function t(e, r) {
2423
2423
  var i = [], n = !0, s = !1, a = void 0;
2424
2424
  try {
@@ -2451,7 +2451,7 @@ var ma = Object.defineProperty, ba = (t, e, r) => e in t ? ma(t, e, { enumerable
2451
2451
  x: h + s,
2452
2452
  y: l + a
2453
2453
  };
2454
- }, xa = function(t, e) {
2454
+ }, wa = function(t, e) {
2455
2455
  var r = e === 1.5707963267948966 ? 0.551915024494 : e === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(e / 4), i = Math.cos(t), n = Math.sin(t), s = Math.cos(t + e), a = Math.sin(t + e);
2456
2456
  return [{
2457
2457
  x: i - n * r,
@@ -2466,12 +2466,12 @@ var ma = Object.defineProperty, ba = (t, e, r) => e in t ? ma(t, e, { enumerable
2466
2466
  }, tr = function(t, e, r, i) {
2467
2467
  var n = t * i - e * r < 0 ? -1 : 1, s = t * r + e * i;
2468
2468
  return s > 1 && (s = 1), s < -1 && (s = -1), n * Math.acos(s);
2469
- }, wa = function(t, e, r, i, n, s, a, o, u, h, l, p) {
2469
+ }, Sa = function(t, e, r, i, n, s, a, o, u, h, l, p) {
2470
2470
  var v = Math.pow(n, 2), m = Math.pow(s, 2), d = Math.pow(l, 2), g = Math.pow(p, 2), A = v * m - v * g - m * d;
2471
2471
  A < 0 && (A = 0), A /= v * g + m * d, A = Math.sqrt(A) * (a === o ? -1 : 1);
2472
2472
  var b = A * n / s * p, w = A * -s / n * l, R = h * b - u * w + (t + r) / 2, O = u * b + h * w + (e + i) / 2, F = (l - b) / n, T = (p - w) / s, P = (-l - b) / n, E = (-p - w) / s, M = tr(1, 0, F, T), $ = tr(F, T, P, E);
2473
2473
  return o === 0 && $ > 0 && ($ -= De), o === 1 && $ < 0 && ($ += De), [R, O, M, $];
2474
- }, Sa = function(t) {
2474
+ }, Ma = function(t) {
2475
2475
  var e = t.px, r = t.py, i = t.cx, n = t.cy, s = t.rx, a = t.ry, o = t.xAxisRotation, u = o === void 0 ? 0 : o, h = t.largeArcFlag, l = h === void 0 ? 0 : h, p = t.sweepFlag, v = p === void 0 ? 0 : p, m = [];
2476
2476
  if (s === 0 || a === 0)
2477
2477
  return [];
@@ -2481,26 +2481,26 @@ var ma = Object.defineProperty, ba = (t, e, r) => e in t ? ma(t, e, { enumerable
2481
2481
  s = Math.abs(s), a = Math.abs(a);
2482
2482
  var w = Math.pow(A, 2) / Math.pow(s, 2) + Math.pow(b, 2) / Math.pow(a, 2);
2483
2483
  w > 1 && (s *= Math.sqrt(w), a *= Math.sqrt(w));
2484
- var R = wa(e, r, i, n, s, a, l, v, d, g, A, b), O = Aa(R, 4), F = O[0], T = O[1], P = O[2], E = O[3], M = Math.abs(E) / (De / 4);
2484
+ var R = Sa(e, r, i, n, s, a, l, v, d, g, A, b), O = xa(R, 4), F = O[0], T = O[1], P = O[2], E = O[3], M = Math.abs(E) / (De / 4);
2485
2485
  Math.abs(1 - M) < 1e-7 && (M = 1);
2486
2486
  var $ = Math.max(Math.ceil(M), 1);
2487
2487
  E /= $;
2488
2488
  for (var ie = 0; ie < $; ie++)
2489
- m.push(xa(P, E)), P += E;
2489
+ m.push(wa(P, E)), P += E;
2490
2490
  return m.map(function(K) {
2491
2491
  var U = yt(K[0], s, a, g, d, F, T), N = U.x, X = U.y, ne = yt(K[1], s, a, g, d, F, T), Ae = ne.x, k = ne.y, H = yt(K[2], s, a, g, d, F, T), Z = H.x, pe = H.y;
2492
2492
  return { x1: N, y1: X, x2: Ae, y2: k, x: Z, y: pe };
2493
2493
  });
2494
- }, Ma = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2494
+ }, Ca = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2495
2495
  function ei(t) {
2496
2496
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
2497
2497
  }
2498
- var Ca = Ta, vt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, Ra = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
2499
- function Ta(t) {
2498
+ var Ra = Ia, vt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, Ta = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
2499
+ function Ia(t) {
2500
2500
  var e = [];
2501
- return t.replace(Ra, function(r, i, n) {
2501
+ return t.replace(Ta, function(r, i, n) {
2502
2502
  var s = i.toLowerCase();
2503
- for (n = ka(n), s == "m" && n.length > 2 && (e.push([i].concat(n.splice(0, 2))), s = "l", i = i == "m" ? "l" : "L"); ; ) {
2503
+ for (n = Oa(n), s == "m" && n.length > 2 && (e.push([i].concat(n.splice(0, 2))), s = "l", i = i == "m" ? "l" : "L"); ; ) {
2504
2504
  if (n.length == vt[s])
2505
2505
  return n.unshift(i), e.push(n);
2506
2506
  if (n.length < vt[s])
@@ -2509,14 +2509,14 @@ function Ta(t) {
2509
2509
  }
2510
2510
  }), e;
2511
2511
  }
2512
- var Ia = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
2513
- function ka(t) {
2514
- var e = t.match(Ia);
2512
+ var ka = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
2513
+ function Oa(t) {
2514
+ var e = t.match(ka);
2515
2515
  return e ? e.map(Number) : [];
2516
2516
  }
2517
- const Oa = /* @__PURE__ */ ei(Ca);
2518
- var Ea = Pa;
2519
- function Pa(t) {
2517
+ const Ea = /* @__PURE__ */ ei(Ra);
2518
+ var Pa = La;
2519
+ function La(t) {
2520
2520
  var e = 0, r = 0, i = 0, n = 0;
2521
2521
  return t.map(function(s) {
2522
2522
  s = s.slice();
@@ -2555,9 +2555,9 @@ function Pa(t) {
2555
2555
  return s;
2556
2556
  });
2557
2557
  }
2558
- const La = /* @__PURE__ */ ei(Ea);
2559
- function Fa(t) {
2560
- const e = Oa(t), r = La(e);
2558
+ const Fa = /* @__PURE__ */ ei(Pa);
2559
+ function ja(t) {
2560
+ const e = Ea(t), r = Fa(e);
2561
2561
  let i, n = 0, s = 0, a = 0, o = 0, u, h, l = 0, p = 0;
2562
2562
  const v = [];
2563
2563
  for (let m = 0; m < r.length; m++) {
@@ -2587,7 +2587,7 @@ function Fa(t) {
2587
2587
  break;
2588
2588
  case "A":
2589
2589
  {
2590
- const A = Sa({
2590
+ const A = Ma({
2591
2591
  px: l,
2592
2592
  py: p,
2593
2593
  cx: d[6],
@@ -2644,15 +2644,15 @@ function Fa(t) {
2644
2644
  * See the License for the specific language governing permissions and
2645
2645
  * limitations under the License.
2646
2646
  */
2647
- function ja(t, e, r, i = 1) {
2647
+ function $a(t, e, r, i = 1) {
2648
2648
  return new ti(t, e, r).subdivide(i);
2649
2649
  }
2650
- function $a(t, e, r, i, n = 1) {
2650
+ function Da(t, e, r, i, n = 1) {
2651
2651
  return new jt(
2652
2652
  new Float64Array([t.x, t.y, e.x, e.y, r.x, r.y, i.x, i.y])
2653
2653
  ).subdivide(n);
2654
2654
  }
2655
- function Da(t) {
2655
+ function qa(t) {
2656
2656
  return t.x * t.x + t.y * t.y;
2657
2657
  }
2658
2658
  function qe(t) {
@@ -2717,7 +2717,7 @@ class jt {
2717
2717
  }
2718
2718
  // Very fancy subdivision scheme
2719
2719
  subdivide(e) {
2720
- const r = 0.1 * e, i = e - r, n = Math.sqrt(i), s = Da(this.weightsum(1, -3, 3, -1)), a = Math.ceil(Math.pow(s / (432 * r * r), 1 / 6)), o = [];
2720
+ const r = 0.1 * e, i = e - r, n = Math.sqrt(i), s = qa(this.weightsum(1, -3, 3, -1)), a = Math.ceil(Math.pow(s / (432 * r * r), 1 / 6)), o = [];
2721
2721
  let u = 0;
2722
2722
  for (let d = 0; d < a; d++) {
2723
2723
  const g = d / a, A = (d + 1) / a, b = this.subsegment(g, A).midpoint_quadbez(), w = b.mapToBasic(), R = qe(w.x0), O = qe(w.x2), F = Math.sqrt(w.scale);
@@ -2745,7 +2745,7 @@ class jt {
2745
2745
  return p.push({ x: this.c[6], y: this.c[7] }), p;
2746
2746
  }
2747
2747
  }
2748
- const qa = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/, _a = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/, rr = /^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;
2748
+ const _a = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/, Ua = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/, rr = /^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;
2749
2749
  function Ge(t, {
2750
2750
  domParser: e,
2751
2751
  svgPreprocessor: r,
@@ -2799,7 +2799,7 @@ function Ge(t, {
2799
2799
  iiifRenderingHints: i
2800
2800
  });
2801
2801
  }
2802
- if (Ha(t)) {
2802
+ if (Ba(t)) {
2803
2803
  const n = [];
2804
2804
  if (t.region) {
2805
2805
  const s = Ge(
@@ -2815,7 +2815,7 @@ function Ge(t, {
2815
2815
  });
2816
2816
  }
2817
2817
  if (t.type === "FragmentSelector") {
2818
- const n = qa.exec(t.value);
2818
+ const n = _a.exec(t.value);
2819
2819
  if (n) {
2820
2820
  const a = {
2821
2821
  type: "BoxSelector",
@@ -2833,7 +2833,7 @@ function Ge(t, {
2833
2833
  iiifRenderingHints: i
2834
2834
  });
2835
2835
  }
2836
- const s = t.value.match(_a);
2836
+ const s = t.value.match(Ua);
2837
2837
  if (s) {
2838
2838
  const a = {
2839
2839
  type: "TemporalSelector",
@@ -2877,7 +2877,7 @@ function Ge(t, {
2877
2877
  // urx
2878
2878
  Math.max(...n.map((v) => v[1]))
2879
2879
  // ury
2880
- ], { style: a, svg: o } = Na(p.element) ?? { svg: o });
2880
+ ], { style: a, svg: o } = Ha(p.element) ?? { svg: o });
2881
2881
  }
2882
2882
  const h = {
2883
2883
  type: "SvgSelector",
@@ -2899,7 +2899,7 @@ function Ge(t, {
2899
2899
  iiifRenderingHints: i
2900
2900
  });
2901
2901
  }
2902
- function Ua(t) {
2902
+ function Va(t) {
2903
2903
  const e = t.map((i) => i[0]).reduce(
2904
2904
  (i, n) => (i[n] += 1, i),
2905
2905
  { C: 0, Q: 0, L: 0, M: 0 }
@@ -2929,8 +2929,8 @@ function ri(t) {
2929
2929
  const i = r.getAttribute("d");
2930
2930
  if (!i)
2931
2931
  continue;
2932
- const n = Fa(i);
2933
- return { element: r, points: Va(n), shapeType: Ua(n) };
2932
+ const n = ja(i);
2933
+ return { element: r, points: Na(n), shapeType: Va(n) };
2934
2934
  }
2935
2935
  case "circle": {
2936
2936
  const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("r") ?? "0");
@@ -2996,7 +2996,7 @@ function ri(t) {
2996
2996
  }
2997
2997
  return null;
2998
2998
  }
2999
- function Va(t) {
2999
+ function Na(t) {
3000
3000
  const e = [];
3001
3001
  for (let r = 0; r < t.length; r++) {
3002
3002
  const i = e[e.length - 1] ?? [0, 0], n = t[r];
@@ -3007,7 +3007,7 @@ function Va(t) {
3007
3007
  continue;
3008
3008
  case "C":
3009
3009
  e.push(
3010
- ...$a(
3010
+ ...Da(
3011
3011
  { x: i[0], y: i[1] },
3012
3012
  { x: n[1], y: n[2] },
3013
3013
  { x: n[3], y: n[4] },
@@ -3018,7 +3018,7 @@ function Va(t) {
3018
3018
  continue;
3019
3019
  case "Q":
3020
3020
  e.push(
3021
- ...ja(
3021
+ ...$a(
3022
3022
  { x: i[0], y: i[1] },
3023
3023
  { x: n[1], y: n[2] },
3024
3024
  { x: n[3], y: n[4] }
@@ -3030,7 +3030,7 @@ function Va(t) {
3030
3030
  }
3031
3031
  return e;
3032
3032
  }
3033
- function Na(t) {
3033
+ function Ha(t) {
3034
3034
  const e = {};
3035
3035
  if (t.hasAttribute("fill") ? (e.fill = t.getAttribute("fill"), t.removeAttribute("fill")) : t.style.fill && (e.fill = t.style.fill), e.fill) {
3036
3036
  const i = rr.exec(e.fill);
@@ -3047,14 +3047,14 @@ function Na(t) {
3047
3047
  throw new Error("Could not find root SVG element");
3048
3048
  return { svg: r.outerHTML, style: Object.keys(e).length > 0 ? e : void 0 };
3049
3049
  }
3050
- function Ha(t) {
3050
+ function Ba(t) {
3051
3051
  return !!t && t.type === "iiif:ImageApiSelector" && t.type === "iiif:ImageApiSelector";
3052
3052
  }
3053
3053
  function te(t) {
3054
3054
  if (t.iiifRenderingHints) {
3055
3055
  const e = t.iiifRenderingHints;
3056
3056
  if (e.rotation) {
3057
- const r = Ba(e.rotation);
3057
+ const r = za(e.rotation);
3058
3058
  if (r)
3059
3059
  if (t.selectors.length)
3060
3060
  for (const i of t.selectors)
@@ -3069,7 +3069,7 @@ function te(t) {
3069
3069
  delete t.iiifRenderingHints;
3070
3070
  return t;
3071
3071
  }
3072
- function Ba(t) {
3072
+ function za(t) {
3073
3073
  let e = parseFloat(t);
3074
3074
  return e && t.startsWith("!") && (e = 360 - e), e && (e = e % 360), e !== e ? 0 : e || 0;
3075
3075
  }
@@ -3144,8 +3144,8 @@ function Fe(t, e = {}) {
3144
3144
  selectors: []
3145
3145
  };
3146
3146
  }
3147
- var za = Object.defineProperty, Wa = (t, e, r) => e in t ? za(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, ir = (t, e, r) => (Wa(t, typeof e != "symbol" ? e + "" : e, r), r);
3148
- function Qa(t) {
3147
+ var Wa = Object.defineProperty, Qa = (t, e, r) => e in t ? Wa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, ir = (t, e, r) => (Qa(t, typeof e != "symbol" ? e + "" : e, r), r);
3148
+ function Ya(t) {
3149
3149
  return Array.isArray(t) ? t : t ? [t] : [];
3150
3150
  }
3151
3151
  const nr = [
@@ -3161,7 +3161,7 @@ const nr = [
3161
3161
  "Service",
3162
3162
  "ContentResource"
3163
3163
  ];
3164
- function Ya(t) {
3164
+ function Ga(t) {
3165
3165
  if (typeof t > "u" || t === null)
3166
3166
  throw new Error("Null or undefined is not a valid entity.");
3167
3167
  if (Array.isArray(t))
@@ -3330,7 +3330,7 @@ class $t {
3330
3330
  traverseUnknown(e) {
3331
3331
  if (!e["@type"] || typeof e == "string")
3332
3332
  return e;
3333
- switch (Ya(e)) {
3333
+ switch (Ga(e)) {
3334
3334
  case "sc:Collection":
3335
3335
  return this.traverseCollection(e);
3336
3336
  case "sc:Manifest":
@@ -3403,7 +3403,7 @@ class $t {
3403
3403
  }, e);
3404
3404
  }
3405
3405
  }
3406
- const Ga = "http://library.stanford.edu/iiif/image-api/compliance.html#level0", ii = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", ni = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", Ja = "http://library.stanford.edu/iiif/image-api/conformance.html#level0", si = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", ai = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", Ka = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", oi = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", ci = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", Za = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", ui = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", li = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", Xa = "http://iiif.io/api/image/1/level0.json", eo = "http://iiif.io/api/image/1/profiles/level0.json", fi = "http://iiif.io/api/image/1/level1.json", pi = "http://iiif.io/api/image/1/profiles/level1.json", hi = "http://iiif.io/api/image/1/level2.json", di = "http://iiif.io/api/image/1/profiles/level2.json", to = "http://iiif.io/api/image/2/level0.json", ro = "http://iiif.io/api/image/2/profiles/level0.json", yi = "http://iiif.io/api/image/2/level1.json", vi = "http://iiif.io/api/image/2/profiles/level1.json", gi = "http://iiif.io/api/image/2/level2.json", mi = "http://iiif.io/api/image/2/profiles/level2.json", io = "level0", bi = "level1", Ai = "level2", no = "http://iiif.io/api/image/2/level0", xi = "http://iiif.io/api/image/2/level1", wi = "http://iiif.io/api/image/2/level2", so = [
3406
+ const Ja = "http://library.stanford.edu/iiif/image-api/compliance.html#level0", ii = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", ni = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", Ka = "http://library.stanford.edu/iiif/image-api/conformance.html#level0", si = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", ai = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", Za = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", oi = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", ci = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", Xa = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", ui = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", li = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", eo = "http://iiif.io/api/image/1/level0.json", to = "http://iiif.io/api/image/1/profiles/level0.json", fi = "http://iiif.io/api/image/1/level1.json", pi = "http://iiif.io/api/image/1/profiles/level1.json", hi = "http://iiif.io/api/image/1/level2.json", di = "http://iiif.io/api/image/1/profiles/level2.json", ro = "http://iiif.io/api/image/2/level0.json", io = "http://iiif.io/api/image/2/profiles/level0.json", yi = "http://iiif.io/api/image/2/level1.json", vi = "http://iiif.io/api/image/2/profiles/level1.json", gi = "http://iiif.io/api/image/2/level2.json", mi = "http://iiif.io/api/image/2/profiles/level2.json", no = "level0", bi = "level1", Ai = "level2", so = "http://iiif.io/api/image/2/level0", xi = "http://iiif.io/api/image/2/level1", wi = "http://iiif.io/api/image/2/level2", ao = [
3407
3407
  xi,
3408
3408
  wi,
3409
3409
  ii,
@@ -3424,35 +3424,35 @@ const Ga = "http://library.stanford.edu/iiif/image-api/compliance.html#level0",
3424
3424
  mi,
3425
3425
  bi,
3426
3426
  Ai
3427
- ], ao = [
3428
- no,
3427
+ ], oo = [
3428
+ so,
3429
3429
  xi,
3430
3430
  wi,
3431
- Ga,
3431
+ Ja,
3432
3432
  ii,
3433
3433
  ni,
3434
- Ja,
3434
+ Ka,
3435
3435
  si,
3436
3436
  ai,
3437
- Ka,
3437
+ Za,
3438
3438
  oi,
3439
3439
  ci,
3440
- Za,
3440
+ Xa,
3441
3441
  ui,
3442
3442
  li,
3443
- Xa,
3444
3443
  eo,
3444
+ to,
3445
3445
  fi,
3446
3446
  pi,
3447
3447
  hi,
3448
3448
  di,
3449
- to,
3450
3449
  ro,
3450
+ io,
3451
3451
  yi,
3452
3452
  vi,
3453
3453
  gi,
3454
3454
  mi,
3455
- io,
3455
+ no,
3456
3456
  bi,
3457
3457
  Ai
3458
3458
  ];
@@ -3488,14 +3488,14 @@ function Re(t, e = "none") {
3488
3488
  function Si(t) {
3489
3489
  if (Array.isArray(t))
3490
3490
  return Si(t.find((e) => typeof e == "string"));
3491
- if (ao.indexOf(t) !== -1)
3491
+ if (oo.indexOf(t) !== -1)
3492
3492
  return "level2";
3493
- if (so.indexOf(t) !== -1)
3493
+ if (ao.indexOf(t) !== -1)
3494
3494
  return "level1";
3495
3495
  if (typeof t == "string")
3496
3496
  return t;
3497
3497
  }
3498
- function oo(t) {
3498
+ function co(t) {
3499
3499
  const e = Array.isArray(t) ? t : [t];
3500
3500
  for (const r of e)
3501
3501
  switch (r) {
@@ -3509,7 +3509,7 @@ function oo(t) {
3509
3509
  return "ImageApiSelector";
3510
3510
  }
3511
3511
  }
3512
- function co(t) {
3512
+ function uo(t) {
3513
3513
  switch (t) {
3514
3514
  case "http://iiif.io/api/image/2/level0.json":
3515
3515
  case "http://iiif.io/api/image/2/level1.json":
@@ -3544,18 +3544,18 @@ function sr(t) {
3544
3544
  return t.slice(e.length + 1);
3545
3545
  return t;
3546
3546
  }
3547
- const uo = ["Collection", "Manifest", "Annotation", "AnnotationPage", "Range", "Service"];
3547
+ const lo = ["Collection", "Manifest", "Annotation", "AnnotationPage", "Range", "Service"];
3548
3548
  function Dt(t) {
3549
3549
  const e = t["@id"] || t.id;
3550
3550
  let r = t["@type"] || t.type;
3551
3551
  const i = t.profile || void 0, n = t["@context"] || void 0;
3552
3552
  if (i) {
3553
- const s = co(i);
3553
+ const s = uo(i);
3554
3554
  if (s)
3555
3555
  return s;
3556
3556
  }
3557
3557
  if (n) {
3558
- const s = oo(n);
3558
+ const s = co(n);
3559
3559
  if (s)
3560
3560
  return s;
3561
3561
  }
@@ -3581,7 +3581,7 @@ function Dt(t) {
3581
3581
  return "TextualBody";
3582
3582
  }
3583
3583
  }
3584
- if (r && uo.indexOf(r) !== -1)
3584
+ if (r && lo.indexOf(r) !== -1)
3585
3585
  return r;
3586
3586
  if (t.format) {
3587
3587
  if (t.format.startsWith("image/"))
@@ -3593,16 +3593,16 @@ function Dt(t) {
3593
3593
  }
3594
3594
  return e && (e.endsWith(".jpg") || e.endsWith(".png") || e.endsWith(".jpeg")) ? "Image" : r || "unknown";
3595
3595
  }
3596
- const lo = /http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;
3597
- function fo(t) {
3598
- const e = t.match(lo);
3596
+ const fo = /http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;
3597
+ function po(t) {
3598
+ const e = t.match(fo);
3599
3599
  return e ? e[0] : t;
3600
3600
  }
3601
- function po(t, e = "Rights/License", r = "none") {
3601
+ function ho(t, e = "Rights/License", r = "none") {
3602
3602
  let i = null;
3603
3603
  const n = [], s = Array.isArray(t) ? t : [t];
3604
3604
  for (const a of s) {
3605
- const o = a ? fo(a) : void 0;
3605
+ const o = a ? po(a) : void 0;
3606
3606
  if (o && (o.indexOf("creativecommons.org") !== -1 || o.indexOf("rightsstatements.org") !== -1)) {
3607
3607
  o.startsWith("https://") ? i = `http://${o.slice(8)}` : i = o;
3608
3608
  continue;
@@ -3614,7 +3614,7 @@ function po(t, e = "Rights/License", r = "none") {
3614
3614
  }
3615
3615
  return [i, n];
3616
3616
  }
3617
- const ho = [
3617
+ const yo = [
3618
3618
  "http://iiif.io/api/presentation/2/context.json",
3619
3619
  "http://iiif.io/api/image/2/context.json",
3620
3620
  "http://iiif.io/api/image/1/context.json",
@@ -3625,16 +3625,16 @@ const ho = [
3625
3625
  "http://iiif.io/api/auth/0/context.json",
3626
3626
  "http://iiif.io/api/annex/openannotation/context.json"
3627
3627
  ];
3628
- function yo(t) {
3628
+ function vo(t) {
3629
3629
  if (t) {
3630
3630
  const e = Array.isArray(t) ? t : [t], r = [];
3631
3631
  for (const i of e)
3632
- i === "http://iiif.io/api/presentation/2/context.json" && r.push("http://iiif.io/api/presentation/3/context.json"), ho.indexOf(i) === -1 && r.push(i);
3632
+ i === "http://iiif.io/api/presentation/2/context.json" && r.push("http://iiif.io/api/presentation/3/context.json"), yo.indexOf(i) === -1 && r.push(i);
3633
3633
  if (e.length)
3634
3634
  return r.length === 1 ? r[0] : r;
3635
3635
  }
3636
3636
  }
3637
- function vo(t) {
3637
+ function go(t) {
3638
3638
  return t ? t.map((e) => ({
3639
3639
  label: Re(e.label),
3640
3640
  value: Re(e.value)
@@ -3650,7 +3650,7 @@ function le(t) {
3650
3650
  t.viewingHint && e.push(t.viewingHint);
3651
3651
  let r;
3652
3652
  return Array.isArray(t.motivation) ? r = t.motivation.map(sr) : t.motivation && (r = sr(t.motivation)), {
3653
- "@context": t["@context"] ? yo(t["@context"]) : void 0,
3653
+ "@context": t["@context"] ? vo(t["@context"]) : void 0,
3654
3654
  id: (t["@id"] || Mi(t)).trim(),
3655
3655
  type: Dt(t),
3656
3656
  behavior: e.length ? e : void 0,
@@ -3665,7 +3665,7 @@ function le(t) {
3665
3665
  };
3666
3666
  }
3667
3667
  function fe(t) {
3668
- const [e, r] = po(t.license), i = [...t.metadata ? vo(t.metadata) : [], ...r];
3668
+ const [e, r] = ho(t.license), i = [...t.metadata ? go(t.metadata) : [], ...r];
3669
3669
  return {
3670
3670
  rights: e,
3671
3671
  metadata: i.length ? i : void 0,
@@ -3676,13 +3676,13 @@ function fe(t) {
3676
3676
  } : void 0,
3677
3677
  navDate: t.navDate,
3678
3678
  summary: t.description ? Re(t.description) : void 0,
3679
- thumbnail: go(t.thumbnail)
3679
+ thumbnail: mo(t.thumbnail)
3680
3680
  };
3681
3681
  }
3682
- function go(t) {
3682
+ function mo(t) {
3683
3683
  return t && (Array.isArray(t) ? t : [t]).map((e) => typeof e == "string" ? { id: e, type: "Image" } : (e.type === "unknown" && (e.type = "Image"), e));
3684
3684
  }
3685
- function mo(t) {
3685
+ function bo(t) {
3686
3686
  if (!t.within)
3687
3687
  return;
3688
3688
  const e = Array.isArray(t.within) ? t.within : [t.within], r = [];
@@ -3713,22 +3713,22 @@ function be(t) {
3713
3713
  label: Re(Tt.providerName)
3714
3714
  }
3715
3715
  ] : void 0,
3716
- partOf: mo(t),
3716
+ partOf: bo(t),
3717
3717
  rendering: t.rendering,
3718
3718
  seeAlso: t.seeAlso,
3719
3719
  start: t.startCanvas,
3720
- service: t.service ? Qa(t.service) : void 0,
3720
+ service: t.service ? Ya(t.service) : void 0,
3721
3721
  supplementary: r ? [r] : void 0
3722
3722
  };
3723
3723
  }
3724
- function bo(t) {
3724
+ function Ao(t) {
3725
3725
  return {
3726
3726
  chars: t.chars,
3727
3727
  format: t.format ? t.format : void 0,
3728
3728
  language: t.language
3729
3729
  };
3730
3730
  }
3731
- function Ao(t) {
3731
+ function xo(t) {
3732
3732
  return ue({
3733
3733
  ...le(t),
3734
3734
  ...fe(t),
@@ -3736,7 +3736,7 @@ function Ao(t) {
3736
3736
  items: t.members
3737
3737
  });
3738
3738
  }
3739
- function xo(t) {
3739
+ function wo(t) {
3740
3740
  const e = [], r = [];
3741
3741
  let i;
3742
3742
  for (const s of t.sequences || [])
@@ -3751,7 +3751,7 @@ function xo(t) {
3751
3751
  structures: t.structures
3752
3752
  });
3753
3753
  }
3754
- function wo(t) {
3754
+ function So(t) {
3755
3755
  return ue({
3756
3756
  ...le(t),
3757
3757
  ...fe(t),
@@ -3766,7 +3766,7 @@ function wo(t) {
3766
3766
  ] : void 0
3767
3767
  });
3768
3768
  }
3769
- function So(t) {
3769
+ function Mo(t) {
3770
3770
  return ue({
3771
3771
  ...le(t),
3772
3772
  ...fe(t),
@@ -3774,7 +3774,7 @@ function So(t) {
3774
3774
  items: t.resources && t.resources.length ? t.resources : void 0
3775
3775
  });
3776
3776
  }
3777
- function Mo(t) {
3777
+ function Co(t) {
3778
3778
  return !t.canvases || t.canvases.length === 0 ? {
3779
3779
  canvases: [],
3780
3780
  behavior: []
@@ -3784,7 +3784,7 @@ function Mo(t) {
3784
3784
  startCanvas: t.startCanvas
3785
3785
  };
3786
3786
  }
3787
- function Co(t) {
3787
+ function Ro(t) {
3788
3788
  function e(r) {
3789
3789
  if (Array.isArray(r)) {
3790
3790
  if (r.length > 1)
@@ -3825,10 +3825,10 @@ function It(t) {
3825
3825
  ...le(e),
3826
3826
  ...fe(e),
3827
3827
  ...be(e),
3828
- ...bo(e)
3828
+ ...Ao(e)
3829
3829
  });
3830
3830
  }
3831
- function Ro(t) {
3831
+ function To(t) {
3832
3832
  const e = [];
3833
3833
  return t.default && t.default !== "rdf:nil" && e.push(t.default), t.item && t.item !== "rdf:nil" && e.push(...t.item), {
3834
3834
  ...le(t),
@@ -3836,7 +3836,7 @@ function Ro(t) {
3836
3836
  items: e
3837
3837
  };
3838
3838
  }
3839
- function To(t) {
3839
+ function Io(t) {
3840
3840
  return ue({
3841
3841
  ...le(t),
3842
3842
  ...fe(t),
@@ -3844,14 +3844,14 @@ function To(t) {
3844
3844
  items: t.members
3845
3845
  });
3846
3846
  }
3847
- function Io(t) {
3847
+ function ko(t) {
3848
3848
  const { "@id": e, "@type": r, "@context": i, profile: n, ...s } = t, a = {};
3849
3849
  return e && (a["@id"] = e), a["@type"] = Dt(t), a["@type"] === "unknown" && (i && i.length && (a["@context"] = i), a["@type"] = "Service"), n && (a.profile = Si(n)), ue({
3850
3850
  ...a,
3851
3851
  ...s
3852
3852
  });
3853
3853
  }
3854
- function ko(t) {
3854
+ function Oo(t) {
3855
3855
  return ue({
3856
3856
  ...le(t),
3857
3857
  ...fe(t),
@@ -3859,17 +3859,17 @@ function ko(t) {
3859
3859
  });
3860
3860
  }
3861
3861
  new $t({
3862
- collection: [Ao],
3863
- manifest: [xo],
3864
- canvas: [wo],
3865
- annotationList: [So],
3866
- sequence: [Mo],
3867
- annotation: [Co],
3862
+ collection: [xo],
3863
+ manifest: [wo],
3864
+ canvas: [So],
3865
+ annotationList: [Mo],
3866
+ sequence: [Co],
3867
+ annotation: [Ro],
3868
3868
  contentResource: [It],
3869
- choice: [Ro],
3870
- range: [To],
3871
- service: [Io],
3872
- layer: [ko]
3869
+ choice: [To],
3870
+ range: [Io],
3871
+ service: [ko],
3872
+ layer: [Oo]
3873
3873
  });
3874
3874
  function kt(t) {
3875
3875
  if ((Array.isArray(t["@type"]) && t["@type"].includes("oa:SvgSelector") || t["@type"] == "oa:SvgSelector") && ("chars" in t || "value" in t))
@@ -3902,7 +3902,7 @@ var or = { exports: {} };
3902
3902
  var r = Object.defineProperty, i = (s, a, o) => a in s ? r(s, a, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[a] = o, n = (s, a, o) => (i(s, typeof a != "symbol" ? a + "" : a, o), o);
3903
3903
  (function(s, a) {
3904
3904
  a(e);
3905
- })(Ma, function(s) {
3905
+ })(Ca, function(s) {
3906
3906
  const a = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", o = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", u = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", h = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", l = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", p = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", v = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", m = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", d = "http://iiif.io/api/image/1/level1.json", g = "http://iiif.io/api/image/1/profiles/level1.json", A = "http://iiif.io/api/image/1/level2.json", b = "http://iiif.io/api/image/1/profiles/level2.json", w = "http://iiif.io/api/image/2/level1.json", R = "http://iiif.io/api/image/2/profiles/level1.json", O = "http://iiif.io/api/image/2/level2.json", F = "http://iiif.io/api/image/2/profiles/level2.json", T = "level1", P = "level2", E = "http://iiif.io/api/image/2/level1", M = "http://iiif.io/api/image/2/level2", $ = [E, M, a, o, u, h, l, p, v, m, d, g, A, b, w, R, O, F, T, P], ie = ["http://iiif.io/api/image/2/level0", E, M, "http://library.stanford.edu/iiif/image-api/compliance.html#level0", a, o, "http://library.stanford.edu/iiif/image-api/conformance.html#level0", u, h, "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", l, p, "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", v, m, "http://iiif.io/api/image/1/level0.json", "http://iiif.io/api/image/1/profiles/level0.json", d, g, A, b, "http://iiif.io/api/image/2/level0.json", "http://iiif.io/api/image/2/profiles/level0.json", w, R, O, F, "level0", T, P], K = ["sc:Collection", "sc:Manifest", "sc:Canvas", "sc:AnnotationList", "oa:Annotation", "sc:Range", "sc:Layer", "sc:Sequence", "oa:Choice", "Service", "ContentResource"];
3907
3907
  class U {
3908
3908
  constructor(c, y = {}) {
@@ -4330,16 +4330,16 @@ function Ci(t, e) {
4330
4330
  i
4331
4331
  ];
4332
4332
  }
4333
- const Oo = {
4333
+ const Eo = {
4334
4334
  makeChoice: () => {
4335
4335
  }
4336
- }, gt = { type: "unknown" }, _ = (t) => ({ type: "unknown", reason: t, annotations: { pages: [] } }), Eo = (t, e) => ({ type: "empty", width: t, height: e, annotations: { pages: [] }, image: null, images: [] });
4337
- function Po(t, e) {
4336
+ }, gt = { type: "unknown" }, _ = (t) => ({ type: "unknown", reason: t, annotations: { pages: [] } }), Po = (t, e) => ({ type: "empty", width: t, height: e, annotations: { pages: [] }, image: null, images: [] });
4337
+ function Lo(t, e) {
4338
4338
  var i;
4339
4339
  const r = (i = t == null ? void 0 : t.iiif) == null ? void 0 : i.meta[e];
4340
4340
  return r ? r.annotationPageManager : null;
4341
4341
  }
4342
- function Lo(t, e) {
4342
+ function Fo(t, e) {
4343
4343
  return Y(
4344
4344
  (r) => {
4345
4345
  const i = [];
@@ -4348,7 +4348,7 @@ function Lo(t, e) {
4348
4348
  const n = Object.keys(r.iiif.entities.AnnotationPage);
4349
4349
  for (const s of n)
4350
4350
  if (!e || e.indexOf(s) !== -1) {
4351
- const a = Po(r, s);
4351
+ const a = Lo(r, s);
4352
4352
  a && a.views && a.views[t] && i.push(s);
4353
4353
  }
4354
4354
  return i;
@@ -4356,7 +4356,7 @@ function Lo(t, e) {
4356
4356
  [t, e]
4357
4357
  );
4358
4358
  }
4359
- function Fo({
4359
+ function jo({
4360
4360
  canvas: t,
4361
4361
  manifest: e,
4362
4362
  all: r,
@@ -4376,18 +4376,18 @@ function Fo({
4376
4376
  n.indexOf(s.id) === -1 && n.push(s.id);
4377
4377
  return n;
4378
4378
  }
4379
- function jo(t, e) {
4379
+ function $o(t, e) {
4380
4380
  var i;
4381
4381
  const r = (i = t == null ? void 0 : t.iiif) == null ? void 0 : i.meta[e];
4382
4382
  return r ? r.annotationPageManager : null;
4383
4383
  }
4384
- function $o(t, e = {}) {
4385
- const r = W(), i = Pe(), n = me(), s = qr(), a = j(() => Fo({
4384
+ function Do(t, e = {}) {
4385
+ const r = W(), i = Pe(), n = me(), s = qr(), a = j(() => jo({
4386
4386
  all: e.all,
4387
4387
  manifest: i,
4388
4388
  canvas: n,
4389
4389
  canvases: s
4390
- }), [e.all, n, s, i]), o = Lo(t, e.all ? void 0 : a), u = D(
4390
+ }), [e.all, n, s, i]), o = Fo(t, e.all ? void 0 : a), u = D(
4391
4391
  (l) => {
4392
4392
  t && r.setMetaValue(
4393
4393
  [l, "annotationPageManager", "views"],
@@ -4406,7 +4406,7 @@ function $o(t, e = {}) {
4406
4406
  if (p != null && p.deselectOthers) {
4407
4407
  const d = Object.keys(v.iiif.entities.AnnotationPage);
4408
4408
  for (const g of d) {
4409
- const A = jo(v, g);
4409
+ const A = $o(v, g);
4410
4410
  A && A.views && A.views[t] && m.push(g);
4411
4411
  }
4412
4412
  }
@@ -4429,14 +4429,14 @@ function $o(t, e = {}) {
4429
4429
  setPageDisabled: u
4430
4430
  };
4431
4431
  }
4432
- function Do(t, e) {
4432
+ function qo(t, e) {
4433
4433
  return Y((r, i) => i.get(t.map((n) => ({ id: n, type: e }))), [t, e]);
4434
4434
  }
4435
- const qo = ge.createContext(new pr());
4435
+ const _o = ge.createContext(new pr());
4436
4436
  function Ri() {
4437
- return Q(qo);
4437
+ return Q(_o);
4438
4438
  }
4439
- function _o() {
4439
+ function Uo() {
4440
4440
  const t = Ri(), [e, r] = J({}), i = ve(!1);
4441
4441
  return re(() => () => {
4442
4442
  i.current = !0;
@@ -4468,7 +4468,7 @@ function _o() {
4468
4468
  [t, e]
4469
4469
  ), e];
4470
4470
  }
4471
- function Uo(t = {}) {
4471
+ function Vo(t = {}) {
4472
4472
  const e = Kr(), r = me(t.canvasId ? { id: t.canvasId } : void 0);
4473
4473
  return Y(
4474
4474
  (i, n) => {
@@ -4484,7 +4484,7 @@ function Uo(t = {}) {
4484
4484
  [r]
4485
4485
  );
4486
4486
  }
4487
- function Vo(t) {
4487
+ function No(t) {
4488
4488
  return t.type === "SpecificResource" ? [t.source, { selector: t.selector }] : [t, { selector: null }];
4489
4489
  }
4490
4490
  const Be = {}, Ti = {
@@ -4507,7 +4507,7 @@ const Be = {}, Ti = {
4507
4507
  return e ? r[e] : r;
4508
4508
  }
4509
4509
  };
4510
- function No(t = Ti) {
4510
+ function Ho(t = Ti) {
4511
4511
  function e(n) {
4512
4512
  const s = n ? typeof n == "string" ? t.get(n) : n : null;
4513
4513
  if (!s)
@@ -4526,7 +4526,7 @@ function No(t = Ti) {
4526
4526
  throw new Error("getPaintables() accept either a canvas or list of annotations");
4527
4527
  const p = Array.from(Array.isArray(l.body) ? l.body : [l.body]);
4528
4528
  for (const v of p) {
4529
- const [m, { selector: d }] = Vo(v), g = t.get(m), A = (g.type || "unknown").toLowerCase();
4529
+ const [m, { selector: d }] = No(v), g = t.get(m), A = (g.type || "unknown").toLowerCase();
4530
4530
  if (A === "choice") {
4531
4531
  const b = t.get(g.items, { parent: g.id }), w = s.length ? s.map((R) => b.find((O) => O.id === R)).filter(Boolean) : [b[0]];
4532
4532
  w.length === 0 && w.push(b[0]), u = {
@@ -4565,8 +4565,8 @@ function No(t = Ti) {
4565
4565
  extractChoices: i
4566
4566
  };
4567
4567
  }
4568
- function Ho(t, e = []) {
4569
- const r = W(), i = j(() => No(r), []), n = Uo({ enableSingleAnnotation: t == null ? void 0 : t.enableSingleAnnotation }), [s, a] = J((t == null ? void 0 : t.defaultChoices) || []), o = j(
4568
+ function Bo(t, e = []) {
4569
+ const r = W(), i = j(() => Ho(r), []), n = Vo({ enableSingleAnnotation: t == null ? void 0 : t.enableSingleAnnotation }), [s, a] = J((t == null ? void 0 : t.defaultChoices) || []), o = j(
4570
4570
  () => i.getPaintables(n, s),
4571
4571
  [r, n, s, ...e]
4572
4572
  ), h = { makeChoice: D(
@@ -4598,7 +4598,7 @@ function Ho(t, e = []) {
4598
4598
  ) };
4599
4599
  return [o, h];
4600
4600
  }
4601
- function Bo(t, e, r) {
4601
+ function zo(t, e, r) {
4602
4602
  const i = [];
4603
4603
  for (const n of e.items) {
4604
4604
  const s = n.resource && n.resource.type === "SpecificResource" ? n.resource.source : n.resource;
@@ -4606,7 +4606,7 @@ function Bo(t, e, r) {
4606
4606
  return _("No resource Identifier");
4607
4607
  let a;
4608
4608
  if (s.service) {
4609
- const m = cn(s);
4609
+ const m = un(s);
4610
4610
  m[0] && (a = r(m[0], t));
4611
4611
  }
4612
4612
  const o = {
@@ -4660,15 +4660,15 @@ function Bo(t, e, r) {
4660
4660
  choice: e.choice
4661
4661
  };
4662
4662
  }
4663
- const zo = ["model/gltf-binary"];
4664
- function Wo(t, e) {
4663
+ const Wo = ["model/gltf-binary"];
4664
+ function Qo(t, e) {
4665
4665
  const i = e.items[0].resource;
4666
- return i.format ? zo.indexOf(i.format) === -1 ? _(`3D format: ${i.format} is unsupported`) : {
4666
+ return i.format ? Wo.indexOf(i.format) === -1 ? _(`3D format: ${i.format} is unsupported`) : {
4667
4667
  type: "3d-model",
4668
4668
  model: i
4669
4669
  } : _("Unknown format");
4670
4670
  }
4671
- function Qo(t, e) {
4671
+ function Yo(t, e) {
4672
4672
  var i;
4673
4673
  if (!t.duration)
4674
4674
  return _("No duration on canvas");
@@ -4703,8 +4703,8 @@ function Qo(t, e) {
4703
4703
  }
4704
4704
  } : _("Audio does not have format") : _("Unknown audio");
4705
4705
  }
4706
- const Yo = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;
4707
- function Go(t, e) {
4706
+ const Go = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;
4707
+ function Jo(t, e) {
4708
4708
  var a;
4709
4709
  const r = e.items.filter((o) => o.type === "video");
4710
4710
  if (!t.duration)
@@ -4742,7 +4742,7 @@ function Go(t, e) {
4742
4742
  };
4743
4743
  if (n) {
4744
4744
  s.type = "VideoYouTube";
4745
- const o = i.id.match(Yo);
4745
+ const o = i.id.match(Go);
4746
4746
  if (!o[1])
4747
4747
  return _("Video is not known youtube video");
4748
4748
  s.youTubeId = o[1];
@@ -4769,7 +4769,7 @@ function Ii(t, e = {}, r) {
4769
4769
  }
4770
4770
  return e;
4771
4771
  }
4772
- function Jo(t, e) {
4772
+ function Ko(t, e) {
4773
4773
  const r = [];
4774
4774
  return e.items.forEach((i) => {
4775
4775
  if (i.resource) {
@@ -4781,29 +4781,29 @@ function Jo(t, e) {
4781
4781
  items: r
4782
4782
  };
4783
4783
  }
4784
- function Ko(t) {
4785
- const e = Pe(), r = me(), i = W(), [n, s] = _o(), { enabledPageIds: a } = $o((t == null ? void 0 : t.annotationPageManagerId) || (e == null ? void 0 : e.id) || (r == null ? void 0 : r.id), {
4784
+ function Zo(t) {
4785
+ const e = Pe(), r = me(), i = W(), [n, s] = Uo(), { enabledPageIds: a } = Do((t == null ? void 0 : t.annotationPageManagerId) || (e == null ? void 0 : e.id) || (r == null ? void 0 : r.id), {
4786
4786
  all: !1
4787
- }), o = Do(a, "AnnotationPage"), u = (t == null ? void 0 : t.strategies) || [
4787
+ }), o = qo(a, "AnnotationPage"), u = (t == null ? void 0 : t.strategies) || [
4788
4788
  "empty",
4789
4789
  "images",
4790
4790
  "media",
4791
4791
  "textual-content",
4792
4792
  "complex-timeline"
4793
- ], [h, l] = Ho(t, [s]), p = j(() => {
4793
+ ], [h, l] = Bo(t, [s]), p = j(() => {
4794
4794
  if (!r)
4795
4795
  return console.log("No canvas"), gt;
4796
4796
  if (h.types.length === 0)
4797
- return u.indexOf("empty") !== -1 ? Eo(r.width, r.height) : (console.log("No paintables"), gt);
4797
+ return u.indexOf("empty") !== -1 ? Po(r.width, r.height) : (console.log("No paintables"), gt);
4798
4798
  if (h.types.length !== 1)
4799
4799
  if (h.types.length === 2 && h.types.indexOf("text") !== -1)
4800
4800
  h.types = h.types.filter((m) => m !== "text");
4801
4801
  else
4802
4802
  return u.indexOf("complex-timeline") === -1 ? _("Complex timeline not supported") : _("ComplexTimelineStrategy not yet supported");
4803
4803
  const v = h.types[0];
4804
- return v === "image" ? u.indexOf("images") === -1 ? _("Image not supported") : Bo(r, h, n) : v === "Model" || v === "model" ? u.indexOf("3d-model") === -1 ? _("3D not supported") : Wo(r, h) : v === "textualbody" ? u.indexOf("textual-content") === -1 ? _("Textual content not supported") : Jo(r, h) : v === "sound" || v === "audio" ? u.indexOf("media") === -1 ? _("Media not supported") : Qo(r, h) : v === "video" ? u.indexOf("media") === -1 ? _("Media not supported") : Go(r, h) : (console.log("No idea"), gt);
4804
+ return v === "image" ? u.indexOf("images") === -1 ? _("Image not supported") : zo(r, h, n) : v === "Model" || v === "model" ? u.indexOf("3d-model") === -1 ? _("3D not supported") : Qo(r, h) : v === "textualbody" ? u.indexOf("textual-content") === -1 ? _("Textual content not supported") : Ko(r, h) : v === "sound" || v === "audio" ? u.indexOf("media") === -1 ? _("Media not supported") : Yo(r, h) : v === "video" ? u.indexOf("media") === -1 ? _("Media not supported") : Jo(r, h) : (console.log("No idea"), gt);
4805
4805
  }, [r, h, i, l.makeChoice]);
4806
- return j(() => p.type === "unknown" ? [p, Oo] : [
4806
+ return j(() => p.type === "unknown" ? [p, Eo] : [
4807
4807
  {
4808
4808
  ...p,
4809
4809
  annotations: { pages: o }
@@ -4811,7 +4811,7 @@ function Ko(t) {
4811
4811
  l
4812
4812
  ], [p, o]);
4813
4813
  }
4814
- const Zo = (t, e = []) => {
4814
+ const Xo = (t, e = []) => {
4815
4815
  const r = W();
4816
4816
  re(() => {
4817
4817
  t(r);
@@ -4835,9 +4835,9 @@ const Zo = (t, e = []) => {
4835
4835
  if (r)
4836
4836
  return e ? r[e] : r;
4837
4837
  }
4838
- }, Xo = new pr();
4839
- function ec(t = ki, e = {}) {
4840
- const r = e.imageServiceLoader || Xo;
4838
+ }, ec = new pr();
4839
+ function tc(t = ki, e = {}) {
4840
+ const r = e.imageServiceLoader || ec;
4841
4841
  async function i(n, s, a = !1, o = [], u) {
4842
4842
  const h = () => r.getThumbnailFromResource(void 0, s, a, o);
4843
4843
  if (!n)
@@ -4897,13 +4897,13 @@ function ec(t = ki, e = {}) {
4897
4897
  getBestThumbnailAtSize: i
4898
4898
  };
4899
4899
  }
4900
- function tc(t, e, { canvasId: r, manifestId: i } = {}) {
4901
- const n = W(), s = Ri(), a = j(() => ec(n, { imageServiceLoader: s }), [n, s]), [o, u] = J(), h = Pe(i ? { id: i } : void 0), l = me(r ? { id: r } : void 0), p = l || h, v = ve(!1);
4900
+ function rc(t, e, { canvasId: r, manifestId: i } = {}) {
4901
+ const n = W(), s = Ri(), a = j(() => tc(n, { imageServiceLoader: s }), [n, s]), [o, u] = J(), h = Pe(i ? { id: i } : void 0), l = me(r ? { id: r } : void 0), p = l || h, v = ve(!1);
4902
4902
  if (re(() => (v.current = !1, () => {
4903
4903
  v.current = !0;
4904
4904
  }), []), !p)
4905
4905
  throw new Error("Must be called under a manifest or canvas context.");
4906
- return Zo(
4906
+ return Xo(
4907
4907
  (m) => {
4908
4908
  a.getBestThumbnailAtSize(p, t, e).then((d) => {
4909
4909
  d.best && !v.current && u(d.best);
@@ -4912,10 +4912,10 @@ function tc(t, e, { canvasId: r, manifestId: i } = {}) {
4912
4912
  [p]
4913
4913
  ), o;
4914
4914
  }
4915
- function rc(t) {
4915
+ function ic(t) {
4916
4916
  return { isMuted: !1, playRequested: !1, isPlaying: !1, isFinished: !1, volume: 100, duration: t };
4917
4917
  }
4918
- function ic(t, e) {
4918
+ function nc(t, e) {
4919
4919
  switch (e.type) {
4920
4920
  case "FINISHED":
4921
4921
  return { ...t, isFinished: !0, isPlaying: !1, playRequested: !1 };
@@ -4938,13 +4938,13 @@ function ic(t, e) {
4938
4938
  }
4939
4939
  return t;
4940
4940
  }
4941
- function nc(t) {
4941
+ function sc(t) {
4942
4942
  const e = Math.round(t);
4943
4943
  return `${Math.floor(e / 60)}:${`${e % 60}`.padStart(2, "0")}`;
4944
4944
  }
4945
4945
  function qt(t) {
4946
- const [e, r] = Gi(ic, rc(t.duration)), i = ve(null), n = ve(null), s = ve(null), a = ve(!1), o = D(() => {
4947
- n.current && i.current && (n.current.innerHTML = nc(i.current.currentTime), s.current && (s.current.style.width = `${i.current.currentTime / t.duration * 100}%`), a.current !== i.current.muted && (a.current = i.current.muted, r(i.current.muted ? { type: "MUTE" } : { type: "UNMUTE" })));
4946
+ const [e, r] = Gi(nc, ic(t.duration)), i = ve(null), n = ve(null), s = ve(null), a = ve(!1), o = D(() => {
4947
+ n.current && i.current && (n.current.innerHTML = sc(i.current.currentTime), s.current && (s.current.style.width = `${i.current.currentTime / t.duration * 100}%`), a.current !== i.current.muted && (a.current = i.current.muted, r(i.current.muted ? { type: "MUTE" } : { type: "UNMUTE" })));
4948
4948
  }, [t.duration]), u = D(() => {
4949
4949
  i.current && (r({ type: "PLAY_REQUESTED" }), i.current.play().then(() => {
4950
4950
  r({ type: "PLAY" });
@@ -4992,7 +4992,7 @@ function qt(t) {
4992
4992
  }
4993
4993
  ];
4994
4994
  }
4995
- const sc = ce(null), ac = ce(null), oc = ce(null);
4995
+ const ac = ce(null), oc = ce(null), cc = ce(null);
4996
4996
  function Oi({
4997
4997
  actions: t,
4998
4998
  state: e,
@@ -5001,7 +5001,7 @@ function Oi({
5001
5001
  progress: n,
5002
5002
  element: s
5003
5003
  }) {
5004
- return /* @__PURE__ */ x(oc.Provider, { value: { currentTime: i, progress: n, element: s }, children: /* @__PURE__ */ x(ac.Provider, { value: t, children: /* @__PURE__ */ x(sc.Provider, { value: e, children: r }) }) });
5004
+ return /* @__PURE__ */ x(cc.Provider, { value: { currentTime: i, progress: n, element: s }, children: /* @__PURE__ */ x(oc.Provider, { value: t, children: /* @__PURE__ */ x(ac.Provider, { value: e, children: r }) }) });
5005
5005
  }
5006
5006
  function Ei({ media: t, children: e }) {
5007
5007
  const [{ element: r, currentTime: i, progress: n }, s, a] = qt({ duration: t.duration });
@@ -5117,18 +5117,18 @@ function Di({ style: t }) {
5117
5117
  }
5118
5118
  );
5119
5119
  }
5120
- const cc = ge.createContext("en");
5120
+ const uc = ge.createContext("en");
5121
5121
  function qi() {
5122
- return ge.useContext(cc);
5122
+ return ge.useContext(uc);
5123
5123
  }
5124
5124
  function cr(t) {
5125
5125
  return t.indexOf("-") !== -1 ? t.slice(0, t.indexOf("-")) : t;
5126
5126
  }
5127
- function uc({ as: t, language: e, children: r, viewingDirection: i, ...n }) {
5127
+ function lc({ as: t, language: e, children: r, viewingDirection: i, ...n }) {
5128
5128
  const s = qi();
5129
5129
  return j(() => cr(s) === cr(e), [s, e]) ? t ? /* @__PURE__ */ x(t, { ...n, children: r }) : /* @__PURE__ */ x("span", { ...n, children: r }) : t ? /* @__PURE__ */ x(t, { ...n, lang: e, dir: i, children: r }) : /* @__PURE__ */ x("span", { ...n, lang: e, dir: i, children: r });
5130
5130
  }
5131
- function lc(t, e, r) {
5131
+ function fc(t, e, r) {
5132
5132
  if (e.length === 0)
5133
5133
  return;
5134
5134
  if (e.length === 1)
@@ -5143,15 +5143,15 @@ function lc(t, e, r) {
5143
5143
  return n;
5144
5144
  return e.indexOf("none") !== -1 ? "none" : e.indexOf("@none") !== -1 ? "@none" : e[0];
5145
5145
  }
5146
- const fc = (t, e = []) => {
5146
+ const pc = (t, e = []) => {
5147
5147
  const r = qi();
5148
5148
  return j(() => {
5149
5149
  const i = t();
5150
- return lc(r, i, []);
5150
+ return fc(r, i, []);
5151
5151
  }, [r, ...e]);
5152
5152
  };
5153
- function pc(t, e) {
5154
- const r = fc(() => Object.keys(t || {}), [t]);
5153
+ function hc(t, e) {
5154
+ const r = pc(() => Object.keys(t || {}), [t]);
5155
5155
  return [
5156
5156
  j(() => {
5157
5157
  if (!t)
@@ -5165,10 +5165,10 @@ function pc(t, e) {
5165
5165
  r
5166
5166
  ];
5167
5167
  }
5168
- const hc = ({ as: t, defaultText: e, enableDangerouslySetInnerHTML: r, children: i, ...n }) => {
5169
- const [s, a] = pc(i, e);
5168
+ const dc = ({ as: t, defaultText: e, enableDangerouslySetInnerHTML: r, children: i, ...n }) => {
5169
+ const [s, a] = hc(i, e);
5170
5170
  return a ? /* @__PURE__ */ x(
5171
- uc,
5171
+ lc,
5172
5172
  {
5173
5173
  ...n,
5174
5174
  as: t,
@@ -5191,7 +5191,7 @@ const hc = ({ as: t, defaultText: e, enableDangerouslySetInnerHTML: r, children:
5191
5191
  }
5192
5192
  );
5193
5193
  };
5194
- function dc({
5194
+ function yc({
5195
5195
  element: t,
5196
5196
  media: e,
5197
5197
  playPause: r
@@ -5229,13 +5229,13 @@ function dc({
5229
5229
  )
5230
5230
  ] }) : null;
5231
5231
  }
5232
- function yc({
5232
+ function vc({
5233
5233
  media: t,
5234
5234
  mediaControlsDeps: e,
5235
5235
  children: r
5236
5236
  }) {
5237
5237
  const [{ element: i, currentTime: n, progress: s }, a, o] = qt({ duration: t.duration });
5238
- return Oe("overlay", "video-element", dc, {
5238
+ return Oe("overlay", "video-element", yc, {
5239
5239
  element: i,
5240
5240
  media: t,
5241
5241
  playPause: o.playPause
@@ -5262,7 +5262,7 @@ function _i({
5262
5262
  onClickPaintingAnnotation: b,
5263
5263
  children: w
5264
5264
  }) {
5265
- const R = me(), O = zr(R, ["deep-zoom"]), [F] = qs(), T = Vs(), P = W(), E = j(() => Qr(P), [P]), [M, $] = Ko({
5265
+ const R = me(), O = zr(R, ["deep-zoom"]), [F] = _s(), T = Ns(), P = W(), E = j(() => Qr(P), [P]), [M, $] = Zo({
5266
5266
  strategies: l || ["images"],
5267
5267
  defaultChoices: n == null ? void 0 : n.map(({ id: k }) => k)
5268
5268
  }), ie = M.type === "images" ? M.choice : void 0, K = j(() => d ? 1 : Math.max(
@@ -5272,7 +5272,7 @@ function _i({
5272
5272
  return (k.width || 0) / ((H = k.target) == null ? void 0 : H.spatial.width);
5273
5273
  }) : []
5274
5274
  ), [d, M]);
5275
- Ns(K), re(() => {
5275
+ Hs(K), re(() => {
5276
5276
  i && i($);
5277
5277
  }, [M.annotations]), re(() => {
5278
5278
  if (n)
@@ -5292,7 +5292,7 @@ function _i({
5292
5292
  } : {},
5293
5293
  [R, T, M, ...u || []]
5294
5294
  );
5295
- const U = tc({ maxWidth: 256, maxHeight: 256 });
5295
+ const U = rc({ maxWidth: 256, maxHeight: 256 });
5296
5296
  if (!R)
5297
5297
  return null;
5298
5298
  const N = R.accompanyingCanvas, X = U && U.type === "fixed" ? /* @__PURE__ */ x("world-object", { height: R.height, width: R.width, x: t, y: e, children: /* @__PURE__ */ x(
@@ -5334,13 +5334,13 @@ function _i({
5334
5334
  var Z;
5335
5335
  return /* @__PURE__ */ V(Me, { children: [
5336
5336
  /* @__PURE__ */ x(
5337
- tn,
5337
+ rn,
5338
5338
  {
5339
5339
  onClick: b ? (pe) => {
5340
5340
  pe.stopPropagation(), b(k.annotationId, k, pe);
5341
5341
  } : void 0,
5342
5342
  target: ((Z = k.target) == null ? void 0 : Z.spatial) || void 0,
5343
- children: /* @__PURE__ */ x("div", { "data-textual-content": !0, children: /* @__PURE__ */ x(hc, { enableDangerouslySetInnerHTML: !0, children: k.text }) })
5343
+ children: /* @__PURE__ */ x("div", { "data-textual-content": !0, children: /* @__PURE__ */ x(dc, { enableDangerouslySetInnerHTML: !0, children: k.text }) })
5344
5344
  },
5345
5345
  H
5346
5346
  ),
@@ -5372,7 +5372,7 @@ function _i({
5372
5372
  ] }) : M.media.type === "Video" ? /* @__PURE__ */ V(Fi, { media: M.media, mediaControlsDeps: h, children: [
5373
5373
  X,
5374
5374
  o ? o(M) : null
5375
- ] }) : M.media.type === "VideoYouTube" && A ? /* @__PURE__ */ V(yc, { media: M.media, mediaControlsDeps: h, children: [
5375
+ ] }) : M.media.type === "VideoYouTube" && A ? /* @__PURE__ */ V(vc, { media: M.media, mediaControlsDeps: h, children: [
5376
5376
  X,
5377
5377
  o ? o(M) : null
5378
5378
  ] }) : null }) : null
@@ -5383,46 +5383,55 @@ function _i({
5383
5383
  M.type === "media" && M.media.type === "Sound" && N ? /* @__PURE__ */ x(Pt, { canvas: N.id, children: /* @__PURE__ */ x(_i, { renderViewerControls: a }) }) : null
5384
5384
  ] });
5385
5385
  }
5386
- function vc() {
5386
+ function gc() {
5387
5387
  const t = Q(tt);
5388
5388
  return t && t.vault ? t.vault : $r();
5389
5389
  }
5390
- const gc = lr(function(e, r) {
5391
- const i = Pe(), n = qr(), s = hs(), { ViewerControls: a, MediaControls: o } = e.components || {};
5390
+ const mc = lr(function(e, r) {
5391
+ const i = Pe(), n = qr(), s = ds(), { ViewerControls: a, MediaControls: o } = e.components || {};
5392
5392
  if (Ji(r, () => s, [s]), !i)
5393
5393
  return /* @__PURE__ */ x("div", {});
5394
5394
  let u = 0;
5395
5395
  return /* @__PURE__ */ V(Me, { children: [
5396
5396
  e.header,
5397
- /* @__PURE__ */ x(G.Viewer, { height: e.height, children: n.map((h, l) => {
5398
- const p = u;
5399
- return u += h.width + (e.spacing || 0), /* @__PURE__ */ x(Pt, { canvas: h.id, children: /* @__PURE__ */ x(
5400
- G.RenderCanvas,
5401
- {
5402
- strategies: ["3d-model", "media", "images", "empty", "textual-content"],
5403
- renderViewerControls: l === 0 && a ? () => /* @__PURE__ */ x(a, {}) : void 0,
5404
- renderMediaControls: l === 0 && o ? () => /* @__PURE__ */ x(o, {}) : void 0,
5405
- x: p,
5406
- ...e.canvasProps || {},
5407
- children: e.annotations
5408
- },
5409
- h.id
5410
- ) }, h.id);
5411
- }) }, e.reuseAtlas ? "" : s.currentSequenceIndex),
5397
+ /* @__PURE__ */ x(
5398
+ G.Viewer,
5399
+ {
5400
+ height: e.height,
5401
+ mode: e.mode,
5402
+ children: n.map((h, l) => {
5403
+ const p = u;
5404
+ return u += h.width + (e.spacing || 0), /* @__PURE__ */ x(Pt, { canvas: h.id, children: /* @__PURE__ */ x(
5405
+ G.RenderCanvas,
5406
+ {
5407
+ strategies: ["3d-model", "media", "images", "empty", "textual-content"],
5408
+ renderViewerControls: l === 0 && a ? () => /* @__PURE__ */ x(a, {}) : void 0,
5409
+ renderMediaControls: l === 0 && o ? () => /* @__PURE__ */ x(o, {}) : void 0,
5410
+ x: p,
5411
+ ...e.canvasProps || {},
5412
+ children: e.annotations
5413
+ },
5414
+ h.id
5415
+ ) }, h.id);
5416
+ })
5417
+ },
5418
+ e.reuseAtlas ? "" : s.currentSequenceIndex
5419
+ ),
5412
5420
  e.children
5413
5421
  ] });
5414
- }), G = lr(function({ children: e, height: r, annotations: i, canvasProps: n, spacing: s, header: a, components: o, ...u }, h) {
5415
- const l = vc();
5416
- return /* @__PURE__ */ x(Dr, { vault: l, children: /* @__PURE__ */ x(ps, { ...u, children: /* @__PURE__ */ x(
5417
- gc,
5422
+ }), G = lr(function({ children: e, height: r, annotations: i, canvasProps: n, spacing: s, header: a, components: o, mode: u, ...h }, l) {
5423
+ const p = gc();
5424
+ return /* @__PURE__ */ x(Dr, { vault: p, children: /* @__PURE__ */ x(hs, { ...h, children: /* @__PURE__ */ x(
5425
+ mc,
5418
5426
  {
5419
- ref: h,
5427
+ ref: l,
5420
5428
  height: r,
5421
5429
  components: o,
5422
5430
  spacing: s,
5423
5431
  canvasProps: n,
5424
5432
  annotations: i,
5425
5433
  header: a,
5434
+ mode: u,
5426
5435
  children: e
5427
5436
  }
5428
5437
  ) }) });
@@ -5431,7 +5440,7 @@ G.RenderImage = Xr;
5431
5440
  G.RenderCanvas = _i;
5432
5441
  G.RenderAnnotationPage = Rt;
5433
5442
  G.RenderAnnotation = Zr;
5434
- G.Viewer = Hs;
5443
+ G.Viewer = Bs;
5435
5444
  G.CanvasBackground = Di;
5436
5445
  G.Audio = Pi;
5437
5446
  G.Video = Fi;