@annotorious/react 3.0.11 → 3.0.12

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.
Files changed (39) hide show
  1. package/dist/Annotorious.d.ts +1 -0
  2. package/dist/Annotorious.d.ts.map +1 -1
  3. package/dist/PopupProps.d.ts +1 -1
  4. package/dist/PopupProps.d.ts.map +1 -1
  5. package/dist/annotorious-react.es.js +29 -27
  6. package/dist/annotorious-react.es10.js.map +1 -1
  7. package/dist/annotorious-react.es11.js.map +1 -1
  8. package/dist/annotorious-react.es12.js.map +1 -1
  9. package/dist/annotorious-react.es13.js +1 -1
  10. package/dist/annotorious-react.es13.js.map +1 -1
  11. package/dist/annotorious-react.es14.js.map +1 -1
  12. package/dist/annotorious-react.es15.js.map +1 -1
  13. package/dist/annotorious-react.es16.js +248 -241
  14. package/dist/annotorious-react.es16.js.map +1 -1
  15. package/dist/annotorious-react.es17.js +9 -9
  16. package/dist/annotorious-react.es17.js.map +1 -1
  17. package/dist/annotorious-react.es2.js +98 -82
  18. package/dist/annotorious-react.es2.js.map +1 -1
  19. package/dist/annotorious-react.es20.js.map +1 -1
  20. package/dist/annotorious-react.es21.js.map +1 -1
  21. package/dist/annotorious-react.es24.js +5 -5
  22. package/dist/annotorious-react.es24.js.map +1 -1
  23. package/dist/annotorious-react.es25.js +2 -5
  24. package/dist/annotorious-react.es25.js.map +1 -1
  25. package/dist/annotorious-react.es26.js +9 -5
  26. package/dist/annotorious-react.es26.js.map +1 -1
  27. package/dist/annotorious-react.es27.js.map +1 -1
  28. package/dist/annotorious-react.es28.js.map +1 -1
  29. package/dist/annotorious-react.es3.js.map +1 -1
  30. package/dist/annotorious-react.es4.js.map +1 -1
  31. package/dist/annotorious-react.es5.js.map +1 -1
  32. package/dist/annotorious-react.es8.js.map +1 -1
  33. package/dist/annotorious-react.es9.js.map +1 -1
  34. package/dist/openseadragon/OpenSeadragonAnnotator.d.ts.map +1 -1
  35. package/dist/openseadragon/index.d.ts +1 -1
  36. package/dist/openseadragon/index.d.ts.map +1 -1
  37. package/dist/state/AnnotoriousZustand.d.ts +23 -0
  38. package/dist/state/AnnotoriousZustand.d.ts.map +1 -0
  39. package/package.json +15 -13
@@ -1,384 +1,391 @@
1
- import { offset as et, shift as nt, flip as it, inline as ot, arrow as st, computePosition as rt } from "./annotorious-react.es28.js";
2
- import { createCoords as R, rectToClientRect as Y, round as A, floor as D, max as E, min as z } from "./annotorious-react.es27.js";
3
- import { getOverflowAncestors as $, isElement as y, getWindow as L, getFrameElement as U, getComputedStyle as x, getDocumentElement as b, isHTMLElement as C, isWebKit as j, isTopLayer as M, getNodeName as _, isOverflowElement as k, getNodeScroll as H, getParentNode as W, isLastTraversableNode as N, isTableElement as ct, isContainingBlock as G, getContainingBlock as lt } from "./annotorious-react.es21.js";
4
- function J(t) {
5
- const e = x(t);
6
- let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
7
- const o = C(t), c = o ? t.offsetWidth : n, s = o ? t.offsetHeight : i, r = A(n) !== c || A(i) !== s;
8
- return r && (n = c, i = s), {
9
- width: n,
10
- height: i,
11
- $: r
1
+ import { offset as it, shift as nt, flip as ot, inline as st, arrow as rt, computePosition as ct } from "./annotorious-react.es28.js";
2
+ import { createCoords as y, rectToClientRect as G, round as H, floor as D, max as E, min as z } from "./annotorious-react.es27.js";
3
+ import { getOverflowAncestors as $, isElement as v, getWindow as L, getFrameElement as U, getComputedStyle as b, getDocumentElement as R, isHTMLElement as O, isWebKit as J, isTopLayer as M, getNodeName as S, isOverflowElement as _, getNodeScroll as A, getParentNode as W, isLastTraversableNode as N, isTableElement as lt, isContainingBlock as Q, getContainingBlock as ft } from "./annotorious-react.es21.js";
4
+ function Y(t) {
5
+ const e = b(t);
6
+ let i = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
7
+ const o = O(t), r = o ? t.offsetWidth : i, s = o ? t.offsetHeight : n, c = H(i) !== r || H(n) !== s;
8
+ return c && (i = r, n = s), {
9
+ width: i,
10
+ height: n,
11
+ $: c
12
12
  };
13
13
  }
14
- function q(t) {
15
- return y(t) ? t : t.contextElement;
14
+ function k(t) {
15
+ return v(t) ? t : t.contextElement;
16
16
  }
17
17
  function F(t) {
18
- const e = q(t);
19
- if (!C(e))
20
- return R(1);
21
- const n = e.getBoundingClientRect(), {
22
- width: i,
18
+ const e = k(t);
19
+ if (!O(e))
20
+ return y(1);
21
+ const i = e.getBoundingClientRect(), {
22
+ width: n,
23
23
  height: o,
24
- $: c
25
- } = J(e);
26
- let s = (c ? A(n.width) : n.width) / i, r = (c ? A(n.height) : n.height) / o;
27
- return (!s || !Number.isFinite(s)) && (s = 1), (!r || !Number.isFinite(r)) && (r = 1), {
24
+ $: r
25
+ } = Y(e);
26
+ let s = (r ? H(i.width) : i.width) / n, c = (r ? H(i.height) : i.height) / o;
27
+ return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
28
28
  x: s,
29
- y: r
29
+ y: c
30
30
  };
31
31
  }
32
- const ft = /* @__PURE__ */ R(0);
33
- function Q(t) {
32
+ const ut = /* @__PURE__ */ y(0);
33
+ function Z(t) {
34
34
  const e = L(t);
35
- return !j() || !e.visualViewport ? ft : {
35
+ return !J() || !e.visualViewport ? ut : {
36
36
  x: e.visualViewport.offsetLeft,
37
37
  y: e.visualViewport.offsetTop
38
38
  };
39
39
  }
40
- function ut(t, e, n) {
41
- return e === void 0 && (e = !1), !n || e && n !== L(t) ? !1 : e;
40
+ function ht(t, e, i) {
41
+ return e === void 0 && (e = !1), !i || e && i !== L(t) ? !1 : e;
42
42
  }
43
- function T(t, e, n, i) {
44
- e === void 0 && (e = !1), n === void 0 && (n = !1);
45
- const o = t.getBoundingClientRect(), c = q(t);
46
- let s = R(1);
47
- e && (i ? y(i) && (s = F(i)) : s = F(t));
48
- const r = ut(c, n, i) ? Q(c) : R(0);
49
- let f = (o.left + r.x) / s.x, l = (o.top + r.y) / s.y, u = o.width / s.x, a = o.height / s.y;
50
- if (c) {
51
- const p = L(c), h = i && y(i) ? L(i) : i;
52
- let v = p, d = U(v);
53
- for (; d && i && h !== v; ) {
54
- const w = F(d), g = d.getBoundingClientRect(), m = x(d), O = g.left + (d.clientLeft + parseFloat(m.paddingLeft)) * w.x, B = g.top + (d.clientTop + parseFloat(m.paddingTop)) * w.y;
55
- f *= w.x, l *= w.y, u *= w.x, a *= w.y, f += O, l += B, v = L(d), d = U(v);
43
+ function T(t, e, i, n) {
44
+ e === void 0 && (e = !1), i === void 0 && (i = !1);
45
+ const o = t.getBoundingClientRect(), r = k(t);
46
+ let s = y(1);
47
+ e && (n ? v(n) && (s = F(n)) : s = F(t));
48
+ const c = ht(r, i, n) ? Z(r) : y(0);
49
+ let l = (o.left + c.x) / s.x, f = (o.top + c.y) / s.y, u = o.width / s.x, h = o.height / s.y;
50
+ if (r) {
51
+ const p = L(r), g = n && v(n) ? L(n) : n;
52
+ let x = p, a = U(x);
53
+ for (; a && n && g !== x; ) {
54
+ const w = F(a), d = a.getBoundingClientRect(), m = b(a), C = d.left + (a.clientLeft + parseFloat(m.paddingLeft)) * w.x, B = d.top + (a.clientTop + parseFloat(m.paddingTop)) * w.y;
55
+ l *= w.x, f *= w.y, u *= w.x, h *= w.y, l += C, f += B, x = L(a), a = U(x);
56
56
  }
57
57
  }
58
- return Y({
58
+ return G({
59
59
  width: u,
60
- height: a,
61
- x: f,
62
- y: l
60
+ height: h,
61
+ x: l,
62
+ y: f
63
63
  });
64
64
  }
65
- function ht(t) {
65
+ function q(t, e) {
66
+ const i = A(t).scrollLeft;
67
+ return e ? e.left + i : T(R(t)).left + i;
68
+ }
69
+ function X(t, e, i) {
70
+ i === void 0 && (i = !1);
71
+ const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - (i ? 0 : (
72
+ // RTL <body> scrollbar.
73
+ q(t, n)
74
+ )), r = n.top + e.scrollTop;
75
+ return {
76
+ x: o,
77
+ y: r
78
+ };
79
+ }
80
+ function at(t) {
66
81
  let {
67
82
  elements: e,
68
- rect: n,
69
- offsetParent: i,
83
+ rect: i,
84
+ offsetParent: n,
70
85
  strategy: o
71
86
  } = t;
72
- const c = o === "fixed", s = b(i), r = e ? M(e.floating) : !1;
73
- if (i === s || r && c)
74
- return n;
75
- let f = {
87
+ const r = o === "fixed", s = R(n), c = e ? M(e.floating) : !1;
88
+ if (n === s || c && r)
89
+ return i;
90
+ let l = {
76
91
  scrollLeft: 0,
77
92
  scrollTop: 0
78
- }, l = R(1);
79
- const u = R(0), a = C(i);
80
- if ((a || !a && !c) && ((_(i) !== "body" || k(s)) && (f = H(i)), C(i))) {
81
- const p = T(i);
82
- l = F(i), u.x = p.x + i.clientLeft, u.y = p.y + i.clientTop;
93
+ }, f = y(1);
94
+ const u = y(0), h = O(n);
95
+ if ((h || !h && !r) && ((S(n) !== "body" || _(s)) && (l = A(n)), O(n))) {
96
+ const g = T(n);
97
+ f = F(n), u.x = g.x + n.clientLeft, u.y = g.y + n.clientTop;
83
98
  }
99
+ const p = s && !h && !r ? X(s, l, !0) : y(0);
84
100
  return {
85
- width: n.width * l.x,
86
- height: n.height * l.y,
87
- x: n.x * l.x - f.scrollLeft * l.x + u.x,
88
- y: n.y * l.y - f.scrollTop * l.y + u.y
101
+ width: i.width * f.x,
102
+ height: i.height * f.y,
103
+ x: i.x * f.x - l.scrollLeft * f.x + u.x + p.x,
104
+ y: i.y * f.y - l.scrollTop * f.y + u.y + p.y
89
105
  };
90
106
  }
91
- function at(t) {
107
+ function dt(t) {
92
108
  return Array.from(t.getClientRects());
93
109
  }
94
- function S(t, e) {
95
- const n = H(t).scrollLeft;
96
- return e ? e.left + n : T(b(t)).left + n;
97
- }
98
- function dt(t) {
99
- const e = b(t), n = H(t), i = t.ownerDocument.body, o = E(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), c = E(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
100
- let s = -n.scrollLeft + S(t);
101
- const r = -n.scrollTop;
102
- return x(i).direction === "rtl" && (s += E(e.clientWidth, i.clientWidth) - o), {
110
+ function gt(t) {
111
+ const e = R(t), i = A(t), n = t.ownerDocument.body, o = E(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = E(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
112
+ let s = -i.scrollLeft + q(t);
113
+ const c = -i.scrollTop;
114
+ return b(n).direction === "rtl" && (s += E(e.clientWidth, n.clientWidth) - o), {
103
115
  width: o,
104
- height: c,
116
+ height: r,
105
117
  x: s,
106
- y: r
118
+ y: c
107
119
  };
108
120
  }
109
- function gt(t, e) {
110
- const n = L(t), i = b(t), o = n.visualViewport;
111
- let c = i.clientWidth, s = i.clientHeight, r = 0, f = 0;
121
+ function pt(t, e) {
122
+ const i = L(t), n = R(t), o = i.visualViewport;
123
+ let r = n.clientWidth, s = n.clientHeight, c = 0, l = 0;
112
124
  if (o) {
113
- c = o.width, s = o.height;
114
- const l = j();
115
- (!l || l && e === "fixed") && (r = o.offsetLeft, f = o.offsetTop);
125
+ r = o.width, s = o.height;
126
+ const f = J();
127
+ (!f || f && e === "fixed") && (c = o.offsetLeft, l = o.offsetTop);
116
128
  }
117
129
  return {
118
- width: c,
130
+ width: r,
119
131
  height: s,
120
- x: r,
121
- y: f
132
+ x: c,
133
+ y: l
122
134
  };
123
135
  }
124
- function pt(t, e) {
125
- const n = T(t, !0, e === "fixed"), i = n.top + t.clientTop, o = n.left + t.clientLeft, c = C(t) ? F(t) : R(1), s = t.clientWidth * c.x, r = t.clientHeight * c.y, f = o * c.x, l = i * c.y;
136
+ function wt(t, e) {
137
+ const i = T(t, !0, e === "fixed"), n = i.top + t.clientTop, o = i.left + t.clientLeft, r = O(t) ? F(t) : y(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, l = o * r.x, f = n * r.y;
126
138
  return {
127
139
  width: s,
128
- height: r,
129
- x: f,
130
- y: l
140
+ height: c,
141
+ x: l,
142
+ y: f
131
143
  };
132
144
  }
133
- function X(t, e, n) {
134
- let i;
145
+ function K(t, e, i) {
146
+ let n;
135
147
  if (e === "viewport")
136
- i = gt(t, n);
148
+ n = pt(t, i);
137
149
  else if (e === "document")
138
- i = dt(b(t));
139
- else if (y(e))
140
- i = pt(e, n);
150
+ n = gt(R(t));
151
+ else if (v(e))
152
+ n = wt(e, i);
141
153
  else {
142
- const o = Q(t);
143
- i = {
144
- ...e,
154
+ const o = Z(t);
155
+ n = {
145
156
  x: e.x - o.x,
146
- y: e.y - o.y
157
+ y: e.y - o.y,
158
+ width: e.width,
159
+ height: e.height
147
160
  };
148
161
  }
149
- return Y(i);
162
+ return G(n);
150
163
  }
151
- function Z(t, e) {
152
- const n = W(t);
153
- return n === e || !y(n) || N(n) ? !1 : x(n).position === "fixed" || Z(n, e);
164
+ function tt(t, e) {
165
+ const i = W(t);
166
+ return i === e || !v(i) || N(i) ? !1 : b(i).position === "fixed" || tt(i, e);
154
167
  }
155
- function wt(t, e) {
156
- const n = e.get(t);
157
- if (n)
158
- return n;
159
- let i = $(t, [], !1).filter((r) => y(r) && _(r) !== "body"), o = null;
160
- const c = x(t).position === "fixed";
161
- let s = c ? W(t) : t;
162
- for (; y(s) && !N(s); ) {
163
- const r = x(s), f = G(s);
164
- !f && r.position === "fixed" && (o = null), (c ? !f && !o : !f && r.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || k(s) && !f && Z(t, s)) ? i = i.filter((u) => u !== s) : o = r, s = W(s);
168
+ function mt(t, e) {
169
+ const i = e.get(t);
170
+ if (i)
171
+ return i;
172
+ let n = $(t, [], !1).filter((c) => v(c) && S(c) !== "body"), o = null;
173
+ const r = b(t).position === "fixed";
174
+ let s = r ? W(t) : t;
175
+ for (; v(s) && !N(s); ) {
176
+ const c = b(s), l = Q(s);
177
+ !l && c.position === "fixed" && (o = null), (r ? !l && !o : !l && c.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || _(s) && !l && tt(t, s)) ? n = n.filter((u) => u !== s) : o = c, s = W(s);
165
178
  }
166
- return e.set(t, i), i;
179
+ return e.set(t, n), n;
167
180
  }
168
- function mt(t) {
181
+ function yt(t) {
169
182
  let {
170
183
  element: e,
171
- boundary: n,
172
- rootBoundary: i,
184
+ boundary: i,
185
+ rootBoundary: n,
173
186
  strategy: o
174
187
  } = t;
175
- const s = [...n === "clippingAncestors" ? M(e) ? [] : wt(e, this._c) : [].concat(n), i], r = s[0], f = s.reduce((l, u) => {
176
- const a = X(e, u, o);
177
- return l.top = E(a.top, l.top), l.right = z(a.right, l.right), l.bottom = z(a.bottom, l.bottom), l.left = E(a.left, l.left), l;
178
- }, X(e, r, o));
188
+ const s = [...i === "clippingAncestors" ? M(e) ? [] : mt(e, this._c) : [].concat(i), n], c = s[0], l = s.reduce((f, u) => {
189
+ const h = K(e, u, o);
190
+ return f.top = E(h.top, f.top), f.right = z(h.right, f.right), f.bottom = z(h.bottom, f.bottom), f.left = E(h.left, f.left), f;
191
+ }, K(e, c, o));
179
192
  return {
180
- width: f.right - f.left,
181
- height: f.bottom - f.top,
182
- x: f.left,
183
- y: f.top
193
+ width: l.right - l.left,
194
+ height: l.bottom - l.top,
195
+ x: l.left,
196
+ y: l.top
184
197
  };
185
198
  }
186
- function vt(t) {
199
+ function xt(t) {
187
200
  const {
188
201
  width: e,
189
- height: n
190
- } = J(t);
202
+ height: i
203
+ } = Y(t);
191
204
  return {
192
205
  width: e,
193
- height: n
206
+ height: i
194
207
  };
195
208
  }
196
- function yt(t, e, n) {
197
- const i = C(e), o = b(e), c = n === "fixed", s = T(t, !0, c, e);
198
- let r = {
209
+ function vt(t, e, i) {
210
+ const n = O(e), o = R(e), r = i === "fixed", s = T(t, !0, r, e);
211
+ let c = {
199
212
  scrollLeft: 0,
200
213
  scrollTop: 0
201
214
  };
202
- const f = R(0);
203
- if (i || !i && !c)
204
- if ((_(e) !== "body" || k(o)) && (r = H(e)), i) {
205
- const h = T(e, !0, c, e);
206
- f.x = h.x + e.clientLeft, f.y = h.y + e.clientTop;
207
- } else o && (f.x = S(o));
208
- let l = 0, u = 0;
209
- if (o && !i && !c) {
210
- const h = o.getBoundingClientRect();
211
- u = h.top + r.scrollTop, l = h.left + r.scrollLeft - // RTL <body> scrollbar.
212
- S(o, h);
213
- }
214
- const a = s.left + r.scrollLeft - f.x - l, p = s.top + r.scrollTop - f.y - u;
215
+ const l = y(0);
216
+ if (n || !n && !r)
217
+ if ((S(e) !== "body" || _(o)) && (c = A(e)), n) {
218
+ const p = T(e, !0, r, e);
219
+ l.x = p.x + e.clientLeft, l.y = p.y + e.clientTop;
220
+ } else o && (l.x = q(o));
221
+ const f = o && !n && !r ? X(o, c) : y(0), u = s.left + c.scrollLeft - l.x - f.x, h = s.top + c.scrollTop - l.y - f.y;
215
222
  return {
216
- x: a,
217
- y: p,
223
+ x: u,
224
+ y: h,
218
225
  width: s.width,
219
226
  height: s.height
220
227
  };
221
228
  }
222
229
  function V(t) {
223
- return x(t).position === "static";
230
+ return b(t).position === "static";
224
231
  }
225
- function K(t, e) {
226
- if (!C(t) || x(t).position === "fixed")
232
+ function j(t, e) {
233
+ if (!O(t) || b(t).position === "fixed")
227
234
  return null;
228
235
  if (e)
229
236
  return e(t);
230
- let n = t.offsetParent;
231
- return b(t) === n && (n = n.ownerDocument.body), n;
237
+ let i = t.offsetParent;
238
+ return R(t) === i && (i = i.ownerDocument.body), i;
232
239
  }
233
- function tt(t, e) {
234
- const n = L(t);
240
+ function et(t, e) {
241
+ const i = L(t);
235
242
  if (M(t))
236
- return n;
237
- if (!C(t)) {
243
+ return i;
244
+ if (!O(t)) {
238
245
  let o = W(t);
239
246
  for (; o && !N(o); ) {
240
- if (y(o) && !V(o))
247
+ if (v(o) && !V(o))
241
248
  return o;
242
249
  o = W(o);
243
250
  }
244
- return n;
251
+ return i;
245
252
  }
246
- let i = K(t, e);
247
- for (; i && ct(i) && V(i); )
248
- i = K(i, e);
249
- return i && N(i) && V(i) && !G(i) ? n : i || lt(t) || n;
253
+ let n = j(t, e);
254
+ for (; n && lt(n) && V(n); )
255
+ n = j(n, e);
256
+ return n && N(n) && V(n) && !Q(n) ? i : n || ft(t) || i;
250
257
  }
251
- const xt = async function(t) {
252
- const e = this.getOffsetParent || tt, n = this.getDimensions, i = await n(t.floating);
258
+ const bt = async function(t) {
259
+ const e = this.getOffsetParent || et, i = this.getDimensions, n = await i(t.floating);
253
260
  return {
254
- reference: yt(t.reference, await e(t.floating), t.strategy),
261
+ reference: vt(t.reference, await e(t.floating), t.strategy),
255
262
  floating: {
256
263
  x: 0,
257
264
  y: 0,
258
- width: i.width,
259
- height: i.height
265
+ width: n.width,
266
+ height: n.height
260
267
  }
261
268
  };
262
269
  };
263
- function bt(t) {
264
- return x(t).direction === "rtl";
270
+ function Rt(t) {
271
+ return b(t).direction === "rtl";
265
272
  }
266
- const Rt = {
267
- convertOffsetParentRelativeRectToViewportRelativeRect: ht,
268
- getDocumentElement: b,
269
- getClippingRect: mt,
270
- getOffsetParent: tt,
271
- getElementRects: xt,
272
- getClientRects: at,
273
- getDimensions: vt,
273
+ const Ot = {
274
+ convertOffsetParentRelativeRectToViewportRelativeRect: at,
275
+ getDocumentElement: R,
276
+ getClippingRect: yt,
277
+ getOffsetParent: et,
278
+ getElementRects: bt,
279
+ getClientRects: dt,
280
+ getDimensions: xt,
274
281
  getScale: F,
275
- isElement: y,
276
- isRTL: bt
282
+ isElement: v,
283
+ isRTL: Rt
277
284
  };
278
285
  function Ct(t, e) {
279
- let n = null, i;
280
- const o = b(t);
281
- function c() {
282
- var r;
283
- clearTimeout(i), (r = n) == null || r.disconnect(), n = null;
286
+ let i = null, n;
287
+ const o = R(t);
288
+ function r() {
289
+ var c;
290
+ clearTimeout(n), (c = i) == null || c.disconnect(), i = null;
284
291
  }
285
- function s(r, f) {
286
- r === void 0 && (r = !1), f === void 0 && (f = 1), c();
292
+ function s(c, l) {
293
+ c === void 0 && (c = !1), l === void 0 && (l = 1), r();
287
294
  const {
288
- left: l,
295
+ left: f,
289
296
  top: u,
290
- width: a,
297
+ width: h,
291
298
  height: p
292
299
  } = t.getBoundingClientRect();
293
- if (r || e(), !a || !p)
300
+ if (c || e(), !h || !p)
294
301
  return;
295
- const h = D(u), v = D(o.clientWidth - (l + a)), d = D(o.clientHeight - (u + p)), w = D(l), m = {
296
- rootMargin: -h + "px " + -v + "px " + -d + "px " + -w + "px",
297
- threshold: E(0, z(1, f)) || 1
302
+ const g = D(u), x = D(o.clientWidth - (f + h)), a = D(o.clientHeight - (u + p)), w = D(f), m = {
303
+ rootMargin: -g + "px " + -x + "px " + -a + "px " + -w + "px",
304
+ threshold: E(0, z(1, l)) || 1
298
305
  };
299
- let O = !0;
306
+ let C = !0;
300
307
  function B(P) {
301
308
  const I = P[0].intersectionRatio;
302
- if (I !== f) {
303
- if (!O)
309
+ if (I !== l) {
310
+ if (!C)
304
311
  return s();
305
- I ? s(!1, I) : i = setTimeout(() => {
312
+ I ? s(!1, I) : n = setTimeout(() => {
306
313
  s(!1, 1e-7);
307
314
  }, 1e3);
308
315
  }
309
- O = !1;
316
+ C = !1;
310
317
  }
311
318
  try {
312
- n = new IntersectionObserver(B, {
319
+ i = new IntersectionObserver(B, {
313
320
  ...m,
314
321
  // Handle <iframe>s
315
322
  root: o.ownerDocument
316
323
  });
317
324
  } catch {
318
- n = new IntersectionObserver(B, m);
325
+ i = new IntersectionObserver(B, m);
319
326
  }
320
- n.observe(t);
327
+ i.observe(t);
321
328
  }
322
- return s(!0), c;
329
+ return s(!0), r;
323
330
  }
324
- function Et(t, e, n, i) {
325
- i === void 0 && (i = {});
331
+ function Ft(t, e, i, n) {
332
+ n === void 0 && (n = {});
326
333
  const {
327
334
  ancestorScroll: o = !0,
328
- ancestorResize: c = !0,
335
+ ancestorResize: r = !0,
329
336
  elementResize: s = typeof ResizeObserver == "function",
330
- layoutShift: r = typeof IntersectionObserver == "function",
331
- animationFrame: f = !1
332
- } = i, l = q(t), u = o || c ? [...l ? $(l) : [], ...$(e)] : [];
333
- u.forEach((g) => {
334
- o && g.addEventListener("scroll", n, {
337
+ layoutShift: c = typeof IntersectionObserver == "function",
338
+ animationFrame: l = !1
339
+ } = n, f = k(t), u = o || r ? [...f ? $(f) : [], ...$(e)] : [];
340
+ u.forEach((d) => {
341
+ o && d.addEventListener("scroll", i, {
335
342
  passive: !0
336
- }), c && g.addEventListener("resize", n);
343
+ }), r && d.addEventListener("resize", i);
337
344
  });
338
- const a = l && r ? Ct(l, n) : null;
339
- let p = -1, h = null;
340
- s && (h = new ResizeObserver((g) => {
341
- let [m] = g;
342
- m && m.target === l && h && (h.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
343
- var O;
344
- (O = h) == null || O.observe(e);
345
- })), n();
346
- }), l && !f && h.observe(l), h.observe(e));
347
- let v, d = f ? T(t) : null;
348
- f && w();
345
+ const h = f && c ? Ct(f, i) : null;
346
+ let p = -1, g = null;
347
+ s && (g = new ResizeObserver((d) => {
348
+ let [m] = d;
349
+ m && m.target === f && g && (g.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
350
+ var C;
351
+ (C = g) == null || C.observe(e);
352
+ })), i();
353
+ }), f && !l && g.observe(f), g.observe(e));
354
+ let x, a = l ? T(t) : null;
355
+ l && w();
349
356
  function w() {
350
- const g = T(t);
351
- d && (g.x !== d.x || g.y !== d.y || g.width !== d.width || g.height !== d.height) && n(), d = g, v = requestAnimationFrame(w);
357
+ const d = T(t);
358
+ a && (d.x !== a.x || d.y !== a.y || d.width !== a.width || d.height !== a.height) && i(), a = d, x = requestAnimationFrame(w);
352
359
  }
353
- return n(), () => {
354
- var g;
360
+ return i(), () => {
361
+ var d;
355
362
  u.forEach((m) => {
356
- o && m.removeEventListener("scroll", n), c && m.removeEventListener("resize", n);
357
- }), a == null || a(), (g = h) == null || g.disconnect(), h = null, f && cancelAnimationFrame(v);
363
+ o && m.removeEventListener("scroll", i), r && m.removeEventListener("resize", i);
364
+ }), h == null || h(), (d = g) == null || d.disconnect(), g = null, l && cancelAnimationFrame(x);
358
365
  };
359
366
  }
360
- const Ft = et, Wt = nt, Bt = it, Dt = st, At = ot, Nt = (t, e, n) => {
361
- const i = /* @__PURE__ */ new Map(), o = {
362
- platform: Rt,
363
- ...n
364
- }, c = {
367
+ const Wt = it, Bt = nt, Dt = ot, Ht = rt, Nt = st, At = (t, e, i) => {
368
+ const n = /* @__PURE__ */ new Map(), o = {
369
+ platform: Ot,
370
+ ...i
371
+ }, r = {
365
372
  ...o.platform,
366
- _c: i
373
+ _c: n
367
374
  };
368
- return rt(t, e, {
375
+ return ct(t, e, {
369
376
  ...o,
370
- platform: c
377
+ platform: r
371
378
  });
372
379
  };
373
380
  export {
374
- Dt as arrow,
375
- Et as autoUpdate,
376
- Nt as computePosition,
377
- Bt as flip,
381
+ Ht as arrow,
382
+ Ft as autoUpdate,
383
+ At as computePosition,
384
+ Dt as flip,
378
385
  $ as getOverflowAncestors,
379
- At as inline,
380
- Ft as offset,
381
- Rt as platform,
382
- Wt as shift
386
+ Nt as inline,
387
+ Wt as offset,
388
+ Ot as platform,
389
+ Bt as shift
383
390
  };
384
391
  //# sourceMappingURL=annotorious-react.es16.js.map