@annotorious/annotorious 3.0.0-rc.28 → 3.0.0-rc.29

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,11 +1,10 @@
1
1
  var rn = Object.defineProperty;
2
2
  var ln = (e, t, n) => t in e ? rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var Ke = (e, t, n) => (ln(e, typeof t != "symbol" ? t + "" : t, n), n);
3
+ var Ke = (e, t, n) => ln(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  function F() {
5
5
  }
6
6
  function it(e, t) {
7
- for (const n in t)
8
- e[n] = t[n];
7
+ for (const n in t) e[n] = t[n];
9
8
  return (
10
9
  /** @type {T & S} */
11
10
  e
@@ -82,8 +81,7 @@ function dn(e) {
82
81
  }
83
82
  function pt(e) {
84
83
  const t = {};
85
- for (const n in e)
86
- n[0] !== "$" && (t[n] = e[n]);
84
+ for (const n in e) n[0] !== "$" && (t[n] = e[n]);
87
85
  return t;
88
86
  }
89
87
  function ze(e) {
@@ -138,8 +136,7 @@ function Ie(e) {
138
136
  Pe = e;
139
137
  }
140
138
  function qt() {
141
- if (!Pe)
142
- throw new Error("Function called outside component initialization");
139
+ if (!Pe) throw new Error("Function called outside component initialization");
143
140
  return Pe;
144
141
  }
145
142
  function Ye(e) {
@@ -192,8 +189,7 @@ function Kt() {
192
189
  } catch (t) {
193
190
  throw we.length = 0, me = 0, t;
194
191
  }
195
- for (Ie(null), we.length = 0, me = 0; He.length; )
196
- He.pop()();
192
+ for (Ie(null), we.length = 0, me = 0; He.length; ) He.pop()();
197
193
  for (let t = 0; t < Ae.length; t += 1) {
198
194
  const n = Ae[t];
199
195
  We.has(n) || (We.add(n), n());
@@ -233,13 +229,11 @@ function I(e, t) {
233
229
  }
234
230
  function C(e, t, n, o) {
235
231
  if (e && e.o) {
236
- if (Ge.has(e))
237
- return;
232
+ if (Ge.has(e)) return;
238
233
  Ge.add(e), he.c.push(() => {
239
234
  Ge.delete(e), o && (n && e.d(1), o());
240
235
  }), e.o(t);
241
- } else
242
- o && o();
236
+ } else o && o();
243
237
  }
244
238
  function Se(e) {
245
239
  return (e == null ? void 0 : e.length) !== void 0 ? e : Array.from(e);
@@ -388,10 +382,8 @@ const vn = {
388
382
  ft(q.RECTANGLE, vn);
389
383
  const Mn = (e, t = !1) => {
390
384
  const n = typeof e == "string" ? e : e.value, o = /^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g, i = [...n.matchAll(o)][0], [s, r, l, a, c, u, f] = i;
391
- if (r !== "xywh")
392
- throw new Error("Unsupported MediaFragment: " + n);
393
- if (l && l !== "pixel")
394
- throw new Error(`Unsupported MediaFragment unit: ${l}`);
385
+ if (r !== "xywh") throw new Error("Unsupported MediaFragment: " + n);
386
+ if (l && l !== "pixel") throw new Error(`Unsupported MediaFragment unit: ${l}`);
395
387
  const [d, g, m, y] = [a, c, u, f].map(parseFloat);
396
388
  return {
397
389
  type: q.RECTANGLE,
@@ -500,24 +492,19 @@ function Jt(e, t, n) {
500
492
  var bt = Object.prototype.hasOwnProperty;
501
493
  function ge(e, t) {
502
494
  var n, o;
503
- if (e === t)
504
- return !0;
495
+ if (e === t) return !0;
505
496
  if (e && t && (n = e.constructor) === t.constructor) {
506
- if (n === Date)
507
- return e.getTime() === t.getTime();
508
- if (n === RegExp)
509
- return e.toString() === t.toString();
497
+ if (n === Date) return e.getTime() === t.getTime();
498
+ if (n === RegExp) return e.toString() === t.toString();
510
499
  if (n === Array) {
511
500
  if ((o = e.length) === t.length)
512
- for (; o-- && ge(e[o], t[o]); )
513
- ;
501
+ for (; o-- && ge(e[o], t[o]); ) ;
514
502
  return o === -1;
515
503
  }
516
504
  if (!n || typeof e == "object") {
517
505
  o = 0;
518
506
  for (n in e)
519
- if (bt.call(e, n) && ++o && !bt.call(t, n) || !(n in t) || !ge(e[n], t[n]))
520
- return !1;
507
+ if (bt.call(e, n) && ++o && !bt.call(t, n) || !(n in t) || !ge(e[n], t[n])) return !1;
521
508
  return Object.keys(t).length === o;
522
509
  }
523
510
  }
@@ -951,7 +938,10 @@ const xn = 250, $n = (e) => {
951
938
  a.has(p) ? a.get(p).push(A) : a.set(p, [A]);
952
939
  }, g = (p, A) => {
953
940
  const _ = a.get(p);
954
- _ && _.indexOf(A) > 0 && _.splice(_.indexOf(A), 1);
941
+ if (_) {
942
+ const E = _.indexOf(A);
943
+ E !== -1 && _.splice(E, 1);
944
+ }
955
945
  }, m = (p, A, _) => {
956
946
  a.has(p) && setTimeout(() => {
957
947
  a.get(p).forEach((E) => {
@@ -1093,8 +1083,7 @@ let so = (e) => crypto.getRandomValues(new Uint8Array(e)), ro = (e, t, n) => {
1093
1083
  for (; ; ) {
1094
1084
  let l = n(i), a = i;
1095
1085
  for (; a--; )
1096
- if (r += e[l[a] & o] || "", r.length === s)
1097
- return r;
1086
+ if (r += e[l[a] & o] || "", r.length === s) return r;
1098
1087
  }
1099
1088
  };
1100
1089
  }, lo = (e, t = 21) => ro(e, t, so), ao = (e = 21) => {
@@ -2477,11 +2466,9 @@ function zo(e, t, n) {
2477
2466
  }, w = (A) => {
2478
2467
  const _ = A, E = performance.now() - l;
2479
2468
  if (s === "click") {
2480
- if (E > 300)
2481
- return;
2469
+ if (E > 300) return;
2482
2470
  _.stopPropagation(), a ? p() : (n(0, a = r.elementToImage(_.offsetX, _.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, d = 1), n(4, g = 1));
2483
- } else
2484
- a && (E > 300 || d * g > 100 ? (_.stopPropagation(), p()) : (n(0, a = void 0), c = void 0));
2471
+ } else a && (E > 300 || d * g > 100 ? (_.stopPropagation(), p()) : (n(0, a = void 0), c = void 0));
2485
2472
  }, p = () => {
2486
2473
  if (d * g > 15) {
2487
2474
  const A = {
@@ -2661,8 +2648,7 @@ function Ko(e, t, n) {
2661
2648
  const E = _;
2662
2649
  if (d && clearTimeout(d), r === "click") {
2663
2650
  const B = E.timeStamp - c.timeStamp, V = $e([c.offsetX, c.offsetY], [E.offsetX, E.offsetY]);
2664
- if (B > 300 || V > 15)
2665
- return;
2651
+ if (B > 300 || V > 15) return;
2666
2652
  if (g)
2667
2653
  A();
2668
2654
  else if (u.length === 0) {
@@ -2678,8 +2664,7 @@ function Ko(e, t, n) {
2678
2664
  E.stopImmediatePropagation(), g ? A() : u.push(f);
2679
2665
  }
2680
2666
  }, p = () => {
2681
- if (!f)
2682
- return;
2667
+ if (!f) return;
2683
2668
  const _ = [...u, f], E = {
2684
2669
  type: q.POLYGON,
2685
2670
  geometry: { bounds: Fe(_), points: _ }
@@ -3802,10 +3787,8 @@ function sn(e, t, n, o, i) {
3802
3787
  }
3803
3788
  var d = e[t], g = n, m = o;
3804
3789
  for (Le(e, n, t), i(e[o], d) > 0 && Le(e, n, o); g < m; ) {
3805
- for (Le(e, g, m), g++, m--; i(e[g], d) < 0; )
3806
- g++;
3807
- for (; i(e[m], d) > 0; )
3808
- m--;
3790
+ for (Le(e, g, m), g++, m--; i(e[g], d) < 0; ) g++;
3791
+ for (; i(e[m], d) > 0; ) m--;
3809
3792
  }
3810
3793
  i(e[n], d) === 0 ? Le(e, n, m) : (m++, Le(e, m, o)), m <= t && (n = m + 1), t <= m && (o = m - 1);
3811
3794
  }
@@ -3827,8 +3810,7 @@ class Ei {
3827
3810
  search(t) {
3828
3811
  let n = this.data;
3829
3812
  const o = [];
3830
- if (!Ve(t, n))
3831
- return o;
3813
+ if (!Ve(t, n)) return o;
3832
3814
  const i = this.toBBox, s = [];
3833
3815
  for (; n; ) {
3834
3816
  for (let r = 0; r < n.children.length; r++) {
@@ -3841,15 +3823,13 @@ class Ei {
3841
3823
  }
3842
3824
  collides(t) {
3843
3825
  let n = this.data;
3844
- if (!Ve(t, n))
3845
- return !1;
3826
+ if (!Ve(t, n)) return !1;
3846
3827
  const o = [];
3847
3828
  for (; n; ) {
3848
3829
  for (let i = 0; i < n.children.length; i++) {
3849
3830
  const s = n.children[i], r = n.leaf ? this.toBBox(s) : s;
3850
3831
  if (Ve(t, r)) {
3851
- if (n.leaf || ot(t, r))
3852
- return !0;
3832
+ if (n.leaf || ot(t, r)) return !0;
3853
3833
  o.push(s);
3854
3834
  }
3855
3835
  }
@@ -3858,8 +3838,7 @@ class Ei {
3858
3838
  return !1;
3859
3839
  }
3860
3840
  load(t) {
3861
- if (!(t && t.length))
3862
- return this;
3841
+ if (!(t && t.length)) return this;
3863
3842
  if (t.length < this._minEntries) {
3864
3843
  for (let o = 0; o < t.length; o++)
3865
3844
  this.insert(t[o]);
@@ -3886,8 +3865,7 @@ class Ei {
3886
3865
  return this.data = be([]), this;
3887
3866
  }
3888
3867
  remove(t, n) {
3889
- if (!t)
3890
- return this;
3868
+ if (!t) return this;
3891
3869
  let o = this.data;
3892
3870
  const i = this.toBBox(t), s = [], r = [];
3893
3871
  let l, a, c;
@@ -4005,11 +3983,9 @@ class Ei {
4005
3983
  }
4006
3984
  }
4007
3985
  function Ai(e, t, n) {
4008
- if (!n)
4009
- return t.indexOf(e);
3986
+ if (!n) return t.indexOf(e);
4010
3987
  for (let o = 0; o < t.length; o++)
4011
- if (n(e, t[o]))
4012
- return o;
3988
+ if (n(e, t[o])) return o;
4013
3989
  return -1;
4014
3990
  }
4015
3991
  function _e(e, t) {
@@ -4065,8 +4041,7 @@ function be(e) {
4065
4041
  function Ut(e, t, n, o, i) {
4066
4042
  const s = [t, n];
4067
4043
  for (; s.length; ) {
4068
- if (n = s.pop(), t = s.pop(), n - t <= o)
4069
- continue;
4044
+ if (n = s.pop(), t = s.pop(), n - t <= o) continue;
4070
4045
  const r = t + Math.ceil((n - t) / o / 2) * o;
4071
4046
  wi(e, r, t, n, i), s.push(t, r, r, n);
4072
4047
  }