@annotorious/react 3.7.20 → 3.7.21

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,273 +1,273 @@
1
- import { evaluate as Y, rectToClientRect as $, getPaddingObject as I, getSide as M, getSideAxis as j, getOppositePlacement as N, getExpandedPlacements as Q, getOppositeAxisPlacements as U, getAlignmentSides as Z, clamp as z, min as X, max as H, getAlignment as W, getOppositeAxis as tt, getAlignmentAxis as q, getAxisLength as G } from "./annotorious-react.es24.js";
2
- function _(i, c, l) {
1
+ import { evaluate as X, rectToClientRect as _, getPaddingObject as z, getSide as F, getSideAxis as V, getOppositePlacement as J, getExpandedPlacements as K, getOppositeAxisPlacements as Q, getAlignmentSides as Z, clamp as $, getAlignmentAxis as N, getAlignment as H, min as Y, max as W, getOppositeAxis as tt, getAxisLength as U } from "./annotorious-react.es24.js";
2
+ function I(n, c, l) {
3
3
  let {
4
4
  reference: e,
5
- floating: o
6
- } = i;
7
- const t = j(c), a = q(c), r = G(a), d = M(c), u = t === "y", x = e.x + e.width / 2 - o.width / 2, s = e.y + e.height / 2 - o.height / 2, m = e[r] / 2 - o[r] / 2;
8
- let n;
5
+ floating: i
6
+ } = n;
7
+ const t = V(c), r = N(c), f = U(r), d = F(c), u = t === "y", x = e.x + e.width / 2 - i.width / 2, o = e.y + e.height / 2 - i.height / 2, m = e[f] / 2 - i[f] / 2;
8
+ let s;
9
9
  switch (d) {
10
10
  case "top":
11
- n = {
11
+ s = {
12
12
  x,
13
- y: e.y - o.height
13
+ y: e.y - i.height
14
14
  };
15
15
  break;
16
16
  case "bottom":
17
- n = {
17
+ s = {
18
18
  x,
19
19
  y: e.y + e.height
20
20
  };
21
21
  break;
22
22
  case "right":
23
- n = {
23
+ s = {
24
24
  x: e.x + e.width,
25
- y: s
25
+ y: o
26
26
  };
27
27
  break;
28
28
  case "left":
29
- n = {
30
- x: e.x - o.width,
31
- y: s
29
+ s = {
30
+ x: e.x - i.width,
31
+ y: o
32
32
  };
33
33
  break;
34
34
  default:
35
- n = {
35
+ s = {
36
36
  x: e.x,
37
37
  y: e.y
38
38
  };
39
39
  }
40
- switch (W(c)) {
40
+ switch (H(c)) {
41
41
  case "start":
42
- n[a] -= m * (l && u ? -1 : 1);
42
+ s[r] -= m * (l && u ? -1 : 1);
43
43
  break;
44
44
  case "end":
45
- n[a] += m * (l && u ? -1 : 1);
45
+ s[r] += m * (l && u ? -1 : 1);
46
46
  break;
47
47
  }
48
- return n;
48
+ return s;
49
49
  }
50
- async function et(i, c) {
50
+ async function et(n, c) {
51
51
  var l;
52
52
  c === void 0 && (c = {});
53
53
  const {
54
54
  x: e,
55
- y: o,
55
+ y: i,
56
56
  platform: t,
57
- rects: a,
58
- elements: r,
57
+ rects: r,
58
+ elements: f,
59
59
  strategy: d
60
- } = i, {
60
+ } = n, {
61
61
  boundary: u = "clippingAncestors",
62
62
  rootBoundary: x = "viewport",
63
- elementContext: s = "floating",
63
+ elementContext: o = "floating",
64
64
  altBoundary: m = !1,
65
- padding: n = 0
66
- } = Y(c, i), f = I(n), g = r[m ? s === "floating" ? "reference" : "floating" : s], w = $(await t.getClippingRect({
67
- element: (l = await (t.isElement == null ? void 0 : t.isElement(g))) == null || l ? g : g.contextElement || await (t.getDocumentElement == null ? void 0 : t.getDocumentElement(r.floating)),
65
+ padding: s = 0
66
+ } = X(c, n), a = z(s), p = f[m ? o === "floating" ? "reference" : "floating" : o], w = _(await t.getClippingRect({
67
+ element: (l = await (t.isElement == null ? void 0 : t.isElement(p))) == null || l ? p : p.contextElement || await (t.getDocumentElement == null ? void 0 : t.getDocumentElement(f.floating)),
68
68
  boundary: u,
69
69
  rootBoundary: x,
70
70
  strategy: d
71
- })), A = s === "floating" ? {
71
+ })), A = o === "floating" ? {
72
72
  x: e,
73
- y: o,
74
- width: a.floating.width,
75
- height: a.floating.height
76
- } : a.reference, h = await (t.getOffsetParent == null ? void 0 : t.getOffsetParent(r.floating)), y = await (t.isElement == null ? void 0 : t.isElement(h)) ? await (t.getScale == null ? void 0 : t.getScale(h)) || {
73
+ y: i,
74
+ width: r.floating.width,
75
+ height: r.floating.height
76
+ } : r.reference, h = await (t.getOffsetParent == null ? void 0 : t.getOffsetParent(f.floating)), y = await (t.isElement == null ? void 0 : t.isElement(h)) ? await (t.getScale == null ? void 0 : t.getScale(h)) || {
77
77
  x: 1,
78
78
  y: 1
79
79
  } : {
80
80
  x: 1,
81
81
  y: 1
82
- }, P = $(t.convertOffsetParentRelativeRectToViewportRelativeRect ? await t.convertOffsetParentRelativeRectToViewportRelativeRect({
83
- elements: r,
82
+ }, O = _(t.convertOffsetParentRelativeRectToViewportRelativeRect ? await t.convertOffsetParentRelativeRectToViewportRelativeRect({
83
+ elements: f,
84
84
  rect: A,
85
85
  offsetParent: h,
86
86
  strategy: d
87
87
  }) : A);
88
88
  return {
89
- top: (w.top - P.top + f.top) / y.y,
90
- bottom: (P.bottom - w.bottom + f.bottom) / y.y,
91
- left: (w.left - P.left + f.left) / y.x,
92
- right: (P.right - w.right + f.right) / y.x
89
+ top: (w.top - O.top + a.top) / y.y,
90
+ bottom: (O.bottom - w.bottom + a.bottom) / y.y,
91
+ left: (w.left - O.left + a.left) / y.x,
92
+ right: (O.right - w.right + a.right) / y.x
93
93
  };
94
94
  }
95
- const ct = async (i, c, l) => {
95
+ const nt = 50, lt = async (n, c, l) => {
96
96
  const {
97
97
  placement: e = "bottom",
98
- strategy: o = "absolute",
98
+ strategy: i = "absolute",
99
99
  middleware: t = [],
100
- platform: a
101
- } = l, r = t.filter(Boolean), d = await (a.isRTL == null ? void 0 : a.isRTL(c));
102
- let u = await a.getElementRects({
103
- reference: i,
100
+ platform: r
101
+ } = l, f = r.detectOverflow ? r : {
102
+ ...r,
103
+ detectOverflow: et
104
+ }, d = await (r.isRTL == null ? void 0 : r.isRTL(c));
105
+ let u = await r.getElementRects({
106
+ reference: n,
104
107
  floating: c,
105
- strategy: o
108
+ strategy: i
106
109
  }), {
107
110
  x,
108
- y: s
109
- } = _(u, e, d), m = e, n = {}, f = 0;
110
- for (let g = 0; g < r.length; g++) {
111
- var p;
111
+ y: o
112
+ } = I(u, e, d), m = e, s = 0;
113
+ const a = {};
114
+ for (let g = 0; g < t.length; g++) {
115
+ const p = t[g];
116
+ if (!p)
117
+ continue;
112
118
  const {
113
119
  name: w,
114
120
  fn: A
115
- } = r[g], {
121
+ } = p, {
116
122
  x: h,
117
123
  y,
118
- data: P,
124
+ data: O,
119
125
  reset: b
120
126
  } = await A({
121
127
  x,
122
- y: s,
128
+ y: o,
123
129
  initialPlacement: e,
124
130
  placement: m,
125
- strategy: o,
126
- middlewareData: n,
131
+ strategy: i,
132
+ middlewareData: a,
127
133
  rects: u,
128
- platform: {
129
- ...a,
130
- detectOverflow: (p = a.detectOverflow) != null ? p : et
131
- },
134
+ platform: f,
132
135
  elements: {
133
- reference: i,
136
+ reference: n,
134
137
  floating: c
135
138
  }
136
139
  });
137
- x = h ?? x, s = y ?? s, n = {
138
- ...n,
139
- [w]: {
140
- ...n[w],
141
- ...P
142
- }
143
- }, b && f <= 50 && (f++, typeof b == "object" && (b.placement && (m = b.placement), b.rects && (u = b.rects === !0 ? await a.getElementRects({
144
- reference: i,
140
+ x = h ?? x, o = y ?? o, a[w] = {
141
+ ...a[w],
142
+ ...O
143
+ }, b && s < nt && (s++, typeof b == "object" && (b.placement && (m = b.placement), b.rects && (u = b.rects === !0 ? await r.getElementRects({
144
+ reference: n,
145
145
  floating: c,
146
- strategy: o
146
+ strategy: i
147
147
  }) : b.rects), {
148
148
  x,
149
- y: s
150
- } = _(u, m, d)), g = -1);
149
+ y: o
150
+ } = I(u, m, d)), g = -1);
151
151
  }
152
152
  return {
153
153
  x,
154
- y: s,
154
+ y: o,
155
155
  placement: m,
156
- strategy: o,
157
- middlewareData: n
156
+ strategy: i,
157
+ middlewareData: a
158
158
  };
159
- }, lt = (i) => ({
159
+ }, rt = (n) => ({
160
160
  name: "arrow",
161
- options: i,
161
+ options: n,
162
162
  async fn(c) {
163
163
  const {
164
164
  x: l,
165
165
  y: e,
166
- placement: o,
166
+ placement: i,
167
167
  rects: t,
168
- platform: a,
169
- elements: r,
168
+ platform: r,
169
+ elements: f,
170
170
  middlewareData: d
171
171
  } = c, {
172
172
  element: u,
173
173
  padding: x = 0
174
- } = Y(i, c) || {};
174
+ } = X(n, c) || {};
175
175
  if (u == null)
176
176
  return {};
177
- const s = I(x), m = {
177
+ const o = z(x), m = {
178
178
  x: l,
179
179
  y: e
180
- }, n = q(o), f = G(n), p = await a.getDimensions(u), g = n === "y", w = g ? "top" : "left", A = g ? "bottom" : "right", h = g ? "clientHeight" : "clientWidth", y = t.reference[f] + t.reference[n] - m[n] - t.floating[f], P = m[n] - t.reference[n], b = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(u));
181
- let D = b ? b[h] : 0;
182
- (!D || !await (a.isElement == null ? void 0 : a.isElement(b))) && (D = r.floating[h] || t.floating[f]);
183
- const F = y / 2 - P / 2, T = D / 2 - p[f] / 2 - 1, v = X(s[w], T), L = X(s[A], T), E = v, B = D - p[f] - L, R = D / 2 - p[f] / 2 + F, S = z(E, R, B), k = !d.arrow && W(o) != null && R !== S && t.reference[f] / 2 - (R < E ? v : L) - p[f] / 2 < 0, O = k ? R < E ? R - E : R - B : 0;
180
+ }, s = N(i), a = U(s), g = await r.getDimensions(u), p = s === "y", w = p ? "top" : "left", A = p ? "bottom" : "right", h = p ? "clientHeight" : "clientWidth", y = t.reference[a] + t.reference[s] - m[s] - t.floating[a], O = m[s] - t.reference[s], b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(u));
181
+ let E = b ? b[h] : 0;
182
+ (!E || !await (r.isElement == null ? void 0 : r.isElement(b))) && (E = f.floating[h] || t.floating[a]);
183
+ const j = y / 2 - O / 2, T = E / 2 - g[a] / 2 - 1, v = Y(o[w], T), L = Y(o[A], T), D = v, B = E - g[a] - L, R = E / 2 - g[a] / 2 + j, k = $(D, R, B), S = !d.arrow && H(i) != null && R !== k && t.reference[a] / 2 - (R < D ? v : L) - g[a] / 2 < 0, P = S ? R < D ? R - D : R - B : 0;
184
184
  return {
185
- [n]: m[n] + O,
185
+ [s]: m[s] + P,
186
186
  data: {
187
- [n]: S,
188
- centerOffset: R - S - O,
189
- ...k && {
190
- alignmentOffset: O
187
+ [s]: k,
188
+ centerOffset: R - k - P,
189
+ ...S && {
190
+ alignmentOffset: P
191
191
  }
192
192
  },
193
- reset: k
193
+ reset: S
194
194
  };
195
195
  }
196
- }), at = function(i) {
197
- return i === void 0 && (i = {}), {
196
+ }), at = function(n) {
197
+ return n === void 0 && (n = {}), {
198
198
  name: "flip",
199
- options: i,
199
+ options: n,
200
200
  async fn(c) {
201
201
  var l, e;
202
202
  const {
203
- placement: o,
203
+ placement: i,
204
204
  middlewareData: t,
205
- rects: a,
206
- initialPlacement: r,
205
+ rects: r,
206
+ initialPlacement: f,
207
207
  platform: d,
208
208
  elements: u
209
209
  } = c, {
210
210
  mainAxis: x = !0,
211
- crossAxis: s = !0,
211
+ crossAxis: o = !0,
212
212
  fallbackPlacements: m,
213
- fallbackStrategy: n = "bestFit",
214
- fallbackAxisSideDirection: f = "none",
215
- flipAlignment: p = !0,
216
- ...g
217
- } = Y(i, c);
213
+ fallbackStrategy: s = "bestFit",
214
+ fallbackAxisSideDirection: a = "none",
215
+ flipAlignment: g = !0,
216
+ ...p
217
+ } = X(n, c);
218
218
  if ((l = t.arrow) != null && l.alignmentOffset)
219
219
  return {};
220
- const w = M(o), A = j(r), h = M(r) === r, y = await (d.isRTL == null ? void 0 : d.isRTL(u.floating)), P = m || (h || !p ? [N(r)] : Q(r)), b = f !== "none";
221
- !m && b && P.push(...U(r, p, f, y));
222
- const D = [r, ...P], F = await d.detectOverflow(c, g), T = [];
220
+ const w = F(i), A = V(f), h = F(f) === f, y = await (d.isRTL == null ? void 0 : d.isRTL(u.floating)), O = m || (h || !g ? [J(f)] : K(f)), b = a !== "none";
221
+ !m && b && O.push(...Q(f, g, a, y));
222
+ const E = [f, ...O], j = await d.detectOverflow(c, p), T = [];
223
223
  let v = ((e = t.flip) == null ? void 0 : e.overflows) || [];
224
- if (x && T.push(F[w]), s) {
225
- const R = Z(o, a, y);
226
- T.push(F[R[0]], F[R[1]]);
224
+ if (x && T.push(j[w]), o) {
225
+ const R = Z(i, r, y);
226
+ T.push(j[R[0]], j[R[1]]);
227
227
  }
228
228
  if (v = [...v, {
229
- placement: o,
229
+ placement: i,
230
230
  overflows: T
231
231
  }], !T.every((R) => R <= 0)) {
232
- var L, E;
233
- const R = (((L = t.flip) == null ? void 0 : L.index) || 0) + 1, S = D[R];
234
- if (S && (!(s === "alignment" ? A !== j(S) : !1) || // We leave the current main axis only if every placement on that axis
232
+ var L, D;
233
+ const R = (((L = t.flip) == null ? void 0 : L.index) || 0) + 1, k = E[R];
234
+ if (k && (!(o === "alignment" ? A !== V(k) : !1) || // We leave the current main axis only if every placement on that axis
235
235
  // overflows the main axis.
236
- v.every((C) => j(C.placement) === A ? C.overflows[0] > 0 : !0)))
236
+ v.every((C) => V(C.placement) === A ? C.overflows[0] > 0 : !0)))
237
237
  return {
238
238
  data: {
239
239
  index: R,
240
240
  overflows: v
241
241
  },
242
242
  reset: {
243
- placement: S
243
+ placement: k
244
244
  }
245
245
  };
246
- let k = (E = v.filter((O) => O.overflows[0] <= 0).sort((O, C) => O.overflows[1] - C.overflows[1])[0]) == null ? void 0 : E.placement;
247
- if (!k)
248
- switch (n) {
246
+ let S = (D = v.filter((P) => P.overflows[0] <= 0).sort((P, C) => P.overflows[1] - C.overflows[1])[0]) == null ? void 0 : D.placement;
247
+ if (!S)
248
+ switch (s) {
249
249
  case "bestFit": {
250
250
  var B;
251
- const O = (B = v.filter((C) => {
251
+ const P = (B = v.filter((C) => {
252
252
  if (b) {
253
- const V = j(C.placement);
254
- return V === A || // Create a bias to the `y` side axis due to horizontal
253
+ const M = V(C.placement);
254
+ return M === A || // Create a bias to the `y` side axis due to horizontal
255
255
  // reading directions favoring greater width.
256
- V === "y";
256
+ M === "y";
257
257
  }
258
258
  return !0;
259
- }).map((C) => [C.placement, C.overflows.filter((V) => V > 0).reduce((V, K) => V + K, 0)]).sort((C, V) => C[1] - V[1])[0]) == null ? void 0 : B[0];
260
- O && (k = O);
259
+ }).map((C) => [C.placement, C.overflows.filter((M) => M > 0).reduce((M, G) => M + G, 0)]).sort((C, M) => C[1] - M[1])[0]) == null ? void 0 : B[0];
260
+ P && (S = P);
261
261
  break;
262
262
  }
263
263
  case "initialPlacement":
264
- k = r;
264
+ S = f;
265
265
  break;
266
266
  }
267
- if (o !== k)
267
+ if (i !== S)
268
268
  return {
269
269
  reset: {
270
- placement: k
270
+ placement: S
271
271
  }
272
272
  };
273
273
  }
@@ -275,64 +275,64 @@ const ct = async (i, c, l) => {
275
275
  }
276
276
  };
277
277
  };
278
- function J(i) {
279
- const c = X(...i.map((t) => t.left)), l = X(...i.map((t) => t.top)), e = H(...i.map((t) => t.right)), o = H(...i.map((t) => t.bottom));
278
+ function q(n) {
279
+ const c = Y(...n.map((t) => t.left)), l = Y(...n.map((t) => t.top)), e = W(...n.map((t) => t.right)), i = W(...n.map((t) => t.bottom));
280
280
  return {
281
281
  x: c,
282
282
  y: l,
283
283
  width: e - c,
284
- height: o - l
284
+ height: i - l
285
285
  };
286
286
  }
287
- function nt(i) {
288
- const c = i.slice().sort((o, t) => o.y - t.y), l = [];
287
+ function it(n) {
288
+ const c = n.slice().sort((i, t) => i.y - t.y), l = [];
289
289
  let e = null;
290
- for (let o = 0; o < c.length; o++) {
291
- const t = c[o];
290
+ for (let i = 0; i < c.length; i++) {
291
+ const t = c[i];
292
292
  !e || t.y - e.y > e.height / 2 ? l.push([t]) : l[l.length - 1].push(t), e = t;
293
293
  }
294
- return l.map((o) => $(J(o)));
294
+ return l.map((i) => _(q(i)));
295
295
  }
296
- const rt = function(i) {
297
- return i === void 0 && (i = {}), {
296
+ const ft = function(n) {
297
+ return n === void 0 && (n = {}), {
298
298
  name: "inline",
299
- options: i,
299
+ options: n,
300
300
  async fn(c) {
301
301
  const {
302
302
  placement: l,
303
303
  elements: e,
304
- rects: o,
304
+ rects: i,
305
305
  platform: t,
306
- strategy: a
306
+ strategy: r
307
307
  } = c, {
308
- padding: r = 2,
308
+ padding: f = 2,
309
309
  x: d,
310
310
  y: u
311
- } = Y(i, c), x = Array.from(await (t.getClientRects == null ? void 0 : t.getClientRects(e.reference)) || []), s = nt(x), m = $(J(x)), n = I(r);
312
- function f() {
313
- if (s.length === 2 && s[0].left > s[1].right && d != null && u != null)
314
- return s.find((g) => d > g.left - n.left && d < g.right + n.right && u > g.top - n.top && u < g.bottom + n.bottom) || m;
315
- if (s.length >= 2) {
316
- if (j(l) === "y") {
317
- const v = s[0], L = s[s.length - 1], E = M(l) === "top", B = v.top, R = L.bottom, S = E ? v.left : L.left, k = E ? v.right : L.right, O = k - S, C = R - B;
311
+ } = X(n, c), x = Array.from(await (t.getClientRects == null ? void 0 : t.getClientRects(e.reference)) || []), o = it(x), m = _(q(x)), s = z(f);
312
+ function a() {
313
+ if (o.length === 2 && o[0].left > o[1].right && d != null && u != null)
314
+ return o.find((p) => d > p.left - s.left && d < p.right + s.right && u > p.top - s.top && u < p.bottom + s.bottom) || m;
315
+ if (o.length >= 2) {
316
+ if (V(l) === "y") {
317
+ const v = o[0], L = o[o.length - 1], D = F(l) === "top", B = v.top, R = L.bottom, k = D ? v.left : L.left, S = D ? v.right : L.right, P = S - k, C = R - B;
318
318
  return {
319
319
  top: B,
320
320
  bottom: R,
321
- left: S,
322
- right: k,
323
- width: O,
321
+ left: k,
322
+ right: S,
323
+ width: P,
324
324
  height: C,
325
- x: S,
325
+ x: k,
326
326
  y: B
327
327
  };
328
328
  }
329
- const g = M(l) === "left", w = H(...s.map((v) => v.right)), A = X(...s.map((v) => v.left)), h = s.filter((v) => g ? v.left === A : v.right === w), y = h[0].top, P = h[h.length - 1].bottom, b = A, D = w, F = D - b, T = P - y;
329
+ const p = F(l) === "left", w = W(...o.map((v) => v.right)), A = Y(...o.map((v) => v.left)), h = o.filter((v) => p ? v.left === A : v.right === w), y = h[0].top, O = h[h.length - 1].bottom, b = A, E = w, j = E - b, T = O - y;
330
330
  return {
331
331
  top: y,
332
- bottom: P,
332
+ bottom: O,
333
333
  left: b,
334
- right: D,
335
- width: F,
334
+ right: E,
335
+ width: j,
336
336
  height: T,
337
337
  x: b,
338
338
  y
@@ -340,83 +340,83 @@ const rt = function(i) {
340
340
  }
341
341
  return m;
342
342
  }
343
- const p = await t.getElementRects({
343
+ const g = await t.getElementRects({
344
344
  reference: {
345
- getBoundingClientRect: f
345
+ getBoundingClientRect: a
346
346
  },
347
347
  floating: e.floating,
348
- strategy: a
348
+ strategy: r
349
349
  });
350
- return o.reference.x !== p.reference.x || o.reference.y !== p.reference.y || o.reference.width !== p.reference.width || o.reference.height !== p.reference.height ? {
350
+ return i.reference.x !== g.reference.x || i.reference.y !== g.reference.y || i.reference.width !== g.reference.width || i.reference.height !== g.reference.height ? {
351
351
  reset: {
352
- rects: p
352
+ rects: g
353
353
  }
354
354
  } : {};
355
355
  }
356
356
  };
357
- }, it = /* @__PURE__ */ new Set(["left", "top"]);
358
- async function ot(i, c) {
357
+ }, ot = /* @__PURE__ */ new Set(["left", "top"]);
358
+ async function st(n, c) {
359
359
  const {
360
360
  placement: l,
361
361
  platform: e,
362
- elements: o
363
- } = i, t = await (e.isRTL == null ? void 0 : e.isRTL(o.floating)), a = M(l), r = W(l), d = j(l) === "y", u = it.has(a) ? -1 : 1, x = t && d ? -1 : 1, s = Y(c, i);
362
+ elements: i
363
+ } = n, t = await (e.isRTL == null ? void 0 : e.isRTL(i.floating)), r = F(l), f = H(l), d = V(l) === "y", u = ot.has(r) ? -1 : 1, x = t && d ? -1 : 1, o = X(c, n);
364
364
  let {
365
365
  mainAxis: m,
366
- crossAxis: n,
367
- alignmentAxis: f
368
- } = typeof s == "number" ? {
369
- mainAxis: s,
366
+ crossAxis: s,
367
+ alignmentAxis: a
368
+ } = typeof o == "number" ? {
369
+ mainAxis: o,
370
370
  crossAxis: 0,
371
371
  alignmentAxis: null
372
372
  } : {
373
- mainAxis: s.mainAxis || 0,
374
- crossAxis: s.crossAxis || 0,
375
- alignmentAxis: s.alignmentAxis
373
+ mainAxis: o.mainAxis || 0,
374
+ crossAxis: o.crossAxis || 0,
375
+ alignmentAxis: o.alignmentAxis
376
376
  };
377
- return r && typeof f == "number" && (n = r === "end" ? f * -1 : f), d ? {
378
- x: n * x,
377
+ return f && typeof a == "number" && (s = f === "end" ? a * -1 : a), d ? {
378
+ x: s * x,
379
379
  y: m * u
380
380
  } : {
381
381
  x: m * u,
382
- y: n * x
382
+ y: s * x
383
383
  };
384
384
  }
385
- const ft = function(i) {
386
- return i === void 0 && (i = 0), {
385
+ const mt = function(n) {
386
+ return n === void 0 && (n = 0), {
387
387
  name: "offset",
388
- options: i,
388
+ options: n,
389
389
  async fn(c) {
390
390
  var l, e;
391
391
  const {
392
- x: o,
392
+ x: i,
393
393
  y: t,
394
- placement: a,
395
- middlewareData: r
396
- } = c, d = await ot(c, i);
397
- return a === ((l = r.offset) == null ? void 0 : l.placement) && (e = r.arrow) != null && e.alignmentOffset ? {} : {
398
- x: o + d.x,
394
+ placement: r,
395
+ middlewareData: f
396
+ } = c, d = await st(c, n);
397
+ return r === ((l = f.offset) == null ? void 0 : l.placement) && (e = f.arrow) != null && e.alignmentOffset ? {} : {
398
+ x: i + d.x,
399
399
  y: t + d.y,
400
400
  data: {
401
401
  ...d,
402
- placement: a
402
+ placement: r
403
403
  }
404
404
  };
405
405
  }
406
406
  };
407
- }, mt = function(i) {
408
- return i === void 0 && (i = {}), {
407
+ }, dt = function(n) {
408
+ return n === void 0 && (n = {}), {
409
409
  name: "shift",
410
- options: i,
410
+ options: n,
411
411
  async fn(c) {
412
412
  const {
413
413
  x: l,
414
414
  y: e,
415
- placement: o,
415
+ placement: i,
416
416
  platform: t
417
417
  } = c, {
418
- mainAxis: a = !0,
419
- crossAxis: r = !1,
418
+ mainAxis: r = !0,
419
+ crossAxis: f = !1,
420
420
  limiter: d = {
421
421
  fn: (w) => {
422
422
  let {
@@ -430,32 +430,32 @@ const ft = function(i) {
430
430
  }
431
431
  },
432
432
  ...u
433
- } = Y(i, c), x = {
433
+ } = X(n, c), x = {
434
434
  x: l,
435
435
  y: e
436
- }, s = await t.detectOverflow(c, u), m = j(M(o)), n = tt(m);
437
- let f = x[n], p = x[m];
438
- if (a) {
439
- const w = n === "y" ? "top" : "left", A = n === "y" ? "bottom" : "right", h = f + s[w], y = f - s[A];
440
- f = z(h, f, y);
441
- }
436
+ }, o = await t.detectOverflow(c, u), m = V(F(i)), s = tt(m);
437
+ let a = x[s], g = x[m];
442
438
  if (r) {
443
- const w = m === "y" ? "top" : "left", A = m === "y" ? "bottom" : "right", h = p + s[w], y = p - s[A];
444
- p = z(h, p, y);
439
+ const w = s === "y" ? "top" : "left", A = s === "y" ? "bottom" : "right", h = a + o[w], y = a - o[A];
440
+ a = $(h, a, y);
441
+ }
442
+ if (f) {
443
+ const w = m === "y" ? "top" : "left", A = m === "y" ? "bottom" : "right", h = g + o[w], y = g - o[A];
444
+ g = $(h, g, y);
445
445
  }
446
- const g = d.fn({
446
+ const p = d.fn({
447
447
  ...c,
448
- [n]: f,
449
- [m]: p
448
+ [s]: a,
449
+ [m]: g
450
450
  });
451
451
  return {
452
- ...g,
452
+ ...p,
453
453
  data: {
454
- x: g.x - l,
455
- y: g.y - e,
454
+ x: p.x - l,
455
+ y: p.y - e,
456
456
  enabled: {
457
- [n]: a,
458
- [m]: r
457
+ [s]: r,
458
+ [m]: f
459
459
  }
460
460
  }
461
461
  };
@@ -463,13 +463,13 @@ const ft = function(i) {
463
463
  };
464
464
  };
465
465
  export {
466
- lt as arrow,
467
- ct as computePosition,
466
+ rt as arrow,
467
+ lt as computePosition,
468
468
  et as detectOverflow,
469
469
  at as flip,
470
- rt as inline,
471
- ft as offset,
472
- $ as rectToClientRect,
473
- mt as shift
470
+ ft as inline,
471
+ mt as offset,
472
+ _ as rectToClientRect,
473
+ dt as shift
474
474
  };
475
475
  //# sourceMappingURL=annotorious-react.es25.js.map