@phillips/seldon 1.69.0 → 1.70.0

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.
@@ -0,0 +1,902 @@
1
+ import k, { useRef as R, useImperativeHandle as qi, useEffect as ti, useContext as yi } from "react";
2
+ var y = function(i, n) {
3
+ return Number(i.toFixed(n));
4
+ }, Ui = function(i, n) {
5
+ return n;
6
+ }, S = function(i, n, e) {
7
+ e && typeof e == "function" && e(i, n);
8
+ }, Gi = function(i) {
9
+ return -Math.cos(i * Math.PI) / 2 + 0.5;
10
+ }, Ji = function(i) {
11
+ return i;
12
+ }, $i = function(i) {
13
+ return i * i;
14
+ }, xi = function(i) {
15
+ return i * (2 - i);
16
+ }, Ii = function(i) {
17
+ return i < 0.5 ? 2 * i * i : -1 + (4 - 2 * i) * i;
18
+ }, ie = function(i) {
19
+ return i * i * i;
20
+ }, ee = function(i) {
21
+ return --i * i * i + 1;
22
+ }, re = function(i) {
23
+ return i < 0.5 ? 4 * i * i * i : (i - 1) * (2 * i - 2) * (2 * i - 2) + 1;
24
+ }, ne = function(i) {
25
+ return i * i * i * i;
26
+ }, ae = function(i) {
27
+ return 1 - --i * i * i * i;
28
+ }, oe = function(i) {
29
+ return i < 0.5 ? 8 * i * i * i * i : 1 - 8 * --i * i * i * i;
30
+ }, te = function(i) {
31
+ return i * i * i * i * i;
32
+ }, le = function(i) {
33
+ return 1 + --i * i * i * i * i;
34
+ }, se = function(i) {
35
+ return i < 0.5 ? 16 * i * i * i * i * i : 1 + 16 * --i * i * i * i * i;
36
+ }, Yi = {
37
+ easeOut: Gi,
38
+ linear: Ji,
39
+ easeInQuad: $i,
40
+ easeOutQuad: xi,
41
+ easeInOutQuad: Ii,
42
+ easeInCubic: ie,
43
+ easeOutCubic: ee,
44
+ easeInOutCubic: re,
45
+ easeInQuart: ne,
46
+ easeOutQuart: ae,
47
+ easeInOutQuart: oe,
48
+ easeInQuint: te,
49
+ easeOutQuint: le,
50
+ easeInOutQuint: se
51
+ }, Ti = function(i) {
52
+ typeof i == "number" && cancelAnimationFrame(i);
53
+ }, Y = function(i) {
54
+ i.mounted && (Ti(i.animation), i.animate = !1, i.animation = null, i.velocity = null);
55
+ };
56
+ function Xi(i, n, e, r) {
57
+ if (i.mounted) {
58
+ var a = (/* @__PURE__ */ new Date()).getTime(), o = 1;
59
+ Y(i), i.animation = function() {
60
+ if (!i.mounted)
61
+ return Ti(i.animation);
62
+ var t = (/* @__PURE__ */ new Date()).getTime() - a, l = t / e, s = Yi[n], d = s(l);
63
+ t >= e ? (r(o), i.animation = null) : i.animation && (r(d), requestAnimationFrame(i.animation));
64
+ }, requestAnimationFrame(i.animation);
65
+ }
66
+ }
67
+ function ue(i) {
68
+ var n = i.scale, e = i.positionX, r = i.positionY;
69
+ return !(Number.isNaN(n) || Number.isNaN(e) || Number.isNaN(r));
70
+ }
71
+ function D(i, n, e, r) {
72
+ var a = ue(n);
73
+ if (!(!i.mounted || !a)) {
74
+ var o = i.setTransformState, t = i.transformState, l = t.scale, s = t.positionX, d = t.positionY, u = n.scale - l, v = n.positionX - s, f = n.positionY - d;
75
+ e === 0 ? o(n.scale, n.positionX, n.positionY) : Xi(i, r, e, function(p) {
76
+ var m = l + u * p, h = s + v * p, c = d + f * p;
77
+ o(m, h, c);
78
+ });
79
+ }
80
+ }
81
+ function de(i, n, e) {
82
+ var r = i.offsetWidth, a = i.offsetHeight, o = n.offsetWidth, t = n.offsetHeight, l = o * e, s = t * e, d = r - l, u = a - s;
83
+ return {
84
+ wrapperWidth: r,
85
+ wrapperHeight: a,
86
+ newContentWidth: l,
87
+ newDiffWidth: d,
88
+ newContentHeight: s,
89
+ newDiffHeight: u
90
+ };
91
+ }
92
+ var ve = function(i, n, e, r, a, o, t) {
93
+ var l = i > n ? e * (t ? 1 : 0.5) : 0, s = r > a ? o * (t ? 1 : 0.5) : 0, d = i - n - l, u = l, v = r - a - s, f = s;
94
+ return { minPositionX: d, maxPositionX: u, minPositionY: v, maxPositionY: f };
95
+ }, li = function(i, n) {
96
+ var e = i.wrapperComponent, r = i.contentComponent, a = i.setup.centerZoomedOut;
97
+ if (!e || !r)
98
+ throw new Error("Components are not mounted");
99
+ var o = de(e, r, n), t = o.wrapperWidth, l = o.wrapperHeight, s = o.newContentWidth, d = o.newDiffWidth, u = o.newContentHeight, v = o.newDiffHeight, f = ve(t, s, d, l, u, v, !!a);
100
+ return f;
101
+ }, ri = function(i, n, e, r) {
102
+ return r ? i < n ? y(n, 2) : i > e ? y(e, 2) : y(i, 2) : y(i, 2);
103
+ }, Z = function(i, n) {
104
+ var e = li(i, n);
105
+ return i.bounds = e, e;
106
+ };
107
+ function L(i, n, e, r, a, o, t) {
108
+ var l = e.minPositionX, s = e.minPositionY, d = e.maxPositionX, u = e.maxPositionY, v = 0, f = 0;
109
+ t && (v = a, f = o);
110
+ var p = ri(i, l - v, d + v, r), m = ri(n, s - f, u + f, r);
111
+ return { x: p, y: m };
112
+ }
113
+ function j(i, n, e, r, a, o) {
114
+ var t = i.transformState, l = t.scale, s = t.positionX, d = t.positionY, u = r - l;
115
+ if (typeof n != "number" || typeof e != "number")
116
+ return console.error("Mouse X and Y position were not provided!"), { x: s, y: d };
117
+ var v = s - n * u, f = d - e * u, p = L(v, f, a, o, 0, 0, null);
118
+ return p;
119
+ }
120
+ function H(i, n, e, r, a) {
121
+ var o = a ? r : 0, t = n - o;
122
+ return !Number.isNaN(e) && i >= e ? e : !Number.isNaN(n) && i <= t ? t : i;
123
+ }
124
+ var hi = function(i, n) {
125
+ var e = i.setup.panning.excluded, r = i.isInitialized, a = i.wrapperComponent, o = n.target, t = "shadowRoot" in o && "composedPath" in n, l = t ? n.composedPath().some(function(u) {
126
+ return u instanceof Element ? a == null ? void 0 : a.contains(u) : !1;
127
+ }) : a == null ? void 0 : a.contains(o), s = r && o && l;
128
+ if (!s)
129
+ return !1;
130
+ var d = q(o, e);
131
+ return !d;
132
+ }, ci = function(i) {
133
+ var n = i.isInitialized, e = i.isPanning, r = i.setup, a = r.panning.disabled, o = n && e && !a;
134
+ return !!o;
135
+ }, fe = function(i, n) {
136
+ var e = i.transformState, r = e.positionX, a = e.positionY;
137
+ i.isPanning = !0;
138
+ var o = n.clientX, t = n.clientY;
139
+ i.startCoords = { x: o - r, y: t - a };
140
+ }, pe = function(i, n) {
141
+ var e = n.touches, r = i.transformState, a = r.positionX, o = r.positionY;
142
+ i.isPanning = !0;
143
+ var t = e.length === 1;
144
+ if (t) {
145
+ var l = e[0].clientX, s = e[0].clientY;
146
+ i.startCoords = { x: l - a, y: s - o };
147
+ }
148
+ };
149
+ function me(i) {
150
+ var n = i.transformState, e = n.positionX, r = n.positionY, a = n.scale, o = i.setup, t = o.disabled, l = o.limitToBounds, s = o.centerZoomedOut, d = i.wrapperComponent;
151
+ if (!(t || !d || !i.bounds)) {
152
+ var u = i.bounds, v = u.maxPositionX, f = u.minPositionX, p = u.maxPositionY, m = u.minPositionY, h = e > v || e < f, c = r > p || r < m, P = e > v ? d.offsetWidth : i.setup.minPositionX || 0, b = r > p ? d.offsetHeight : i.setup.minPositionY || 0, w = j(i, P, b, a, i.bounds, l || s), T = w.x, C = w.y;
153
+ return {
154
+ scale: a,
155
+ positionX: h ? T : e,
156
+ positionY: c ? C : r
157
+ };
158
+ }
159
+ }
160
+ function Ai(i, n, e, r, a) {
161
+ var o = i.setup.limitToBounds, t = i.wrapperComponent, l = i.bounds, s = i.transformState, d = s.scale, u = s.positionX, v = s.positionY;
162
+ if (!(t === null || l === null || n === u && e === v)) {
163
+ var f = L(n, e, l, o, r, a, t), p = f.x, m = f.y;
164
+ i.setTransformState(d, p, m);
165
+ }
166
+ }
167
+ var he = function(i, n, e) {
168
+ var r = i.startCoords, a = i.transformState, o = i.setup.panning, t = o.lockAxisX, l = o.lockAxisY, s = a.positionX, d = a.positionY;
169
+ if (!r)
170
+ return { x: s, y: d };
171
+ var u = n - r.x, v = e - r.y, f = t ? s : u, p = l ? d : v;
172
+ return { x: f, y: p };
173
+ }, W = function(i, n) {
174
+ var e = i.setup, r = i.transformState, a = r.scale, o = e.minScale, t = e.disablePadding;
175
+ return n > 0 && a >= o && !t ? n : 0;
176
+ }, ce = function(i) {
177
+ var n = i.mounted, e = i.setup, r = e.disabled, a = e.velocityAnimation, o = i.transformState.scale, t = a.disabled, l = !t || o > 1 || !r || n;
178
+ return !!l;
179
+ }, ge = function(i) {
180
+ var n = i.mounted, e = i.velocity, r = i.bounds, a = i.setup, o = a.disabled, t = a.velocityAnimation, l = i.transformState.scale, s = t.disabled, d = !s || l > 1 || !o || n;
181
+ return !(!d || !e || !r);
182
+ };
183
+ function Se(i, n) {
184
+ var e = i.setup.velocityAnimation, r = e.equalToMove, a = e.animationTime, o = e.sensitivity;
185
+ return r ? a * n * o : a;
186
+ }
187
+ function gi(i, n, e, r, a, o, t, l, s, d) {
188
+ if (a) {
189
+ if (n > t && e > t) {
190
+ var u = t + (i - t) * d;
191
+ return u > s ? s : u < t ? t : u;
192
+ }
193
+ if (n < o && e < o) {
194
+ var u = o + (i - o) * d;
195
+ return u < l ? l : u > o ? o : u;
196
+ }
197
+ }
198
+ return r ? n : ri(i, o, t, a);
199
+ }
200
+ function we(i, n) {
201
+ var e = 1;
202
+ return n ? Math.min(e, i.offsetWidth / window.innerWidth) : e;
203
+ }
204
+ function Pe(i, n) {
205
+ var e = ce(i);
206
+ if (e) {
207
+ var r = i.lastMousePosition, a = i.velocityTime, o = i.setup, t = i.wrapperComponent, l = o.velocityAnimation.equalToMove, s = Date.now();
208
+ if (r && a && t) {
209
+ var d = we(t, l), u = n.x - r.x, v = n.y - r.y, f = u / d, p = v / d, m = s - a, h = u * u + v * v, c = Math.sqrt(h) / m;
210
+ i.velocity = { velocityX: f, velocityY: p, total: c };
211
+ }
212
+ i.lastMousePosition = n, i.velocityTime = s;
213
+ }
214
+ }
215
+ function be(i) {
216
+ var n = i.velocity, e = i.bounds, r = i.setup, a = i.wrapperComponent, o = ge(i);
217
+ if (!(!o || !n || !e || !a)) {
218
+ var t = n.velocityX, l = n.velocityY, s = n.total, d = e.maxPositionX, u = e.minPositionX, v = e.maxPositionY, f = e.minPositionY, p = r.limitToBounds, m = r.alignmentAnimation, h = r.zoomAnimation, c = r.panning, P = c.lockAxisY, b = c.lockAxisX, w = h.animationType, T = m.sizeX, C = m.sizeY, A = m.velocityAlignmentTime, X = A, O = Se(i, s), z = Math.max(O, X), E = W(i, T), N = W(i, C), B = E * a.offsetWidth / 100, V = N * a.offsetHeight / 100, U = d + B, K = u - B, G = v + V, J = f - V, di = i.transformState, Li = (/* @__PURE__ */ new Date()).getTime();
219
+ Xi(i, w, z, function(Hi) {
220
+ var $ = i.transformState, Vi = $.scale, x = $.positionX, I = $.positionY, Ki = (/* @__PURE__ */ new Date()).getTime() - Li, Qi = Ki / X, Fi = Yi[m.animationType], vi = 1 - Fi(Math.min(1, Qi)), fi = 1 - Hi, pi = x + t * fi, mi = I + l * fi, Ri = gi(pi, di.positionX, x, b, p, u, d, K, U, vi), ji = gi(mi, di.positionY, I, P, p, f, v, J, G, vi);
221
+ (x !== pi || I !== mi) && i.setTransformState(Vi, Ri, ji);
222
+ });
223
+ }
224
+ }
225
+ function Si(i, n) {
226
+ var e = i.transformState.scale;
227
+ Y(i), Z(i, e), window.TouchEvent !== void 0 && n instanceof TouchEvent ? pe(i, n) : fe(i, n);
228
+ }
229
+ function zi(i) {
230
+ var n = i.transformState.scale, e = i.setup, r = e.minScale, a = e.alignmentAnimation, o = a.disabled, t = a.sizeX, l = a.sizeY, s = a.animationTime, d = a.animationType, u = o || n < r || !t && !l;
231
+ if (!u) {
232
+ var v = me(i);
233
+ v && D(i, v, s, d);
234
+ }
235
+ }
236
+ function wi(i, n, e) {
237
+ var r = i.startCoords, a = i.setup, o = a.alignmentAnimation, t = o.sizeX, l = o.sizeY;
238
+ if (r) {
239
+ var s = he(i, n, e), d = s.x, u = s.y, v = W(i, t), f = W(i, l);
240
+ Pe(i, { x: d, y: u }), Ai(i, d, u, v, f);
241
+ }
242
+ }
243
+ function Ce(i) {
244
+ if (i.isPanning) {
245
+ var n = i.setup.panning.velocityDisabled, e = i.velocity, r = i.wrapperComponent, a = i.contentComponent;
246
+ i.isPanning = !1, i.animate = !1, i.animation = null;
247
+ var o = r == null ? void 0 : r.getBoundingClientRect(), t = a == null ? void 0 : a.getBoundingClientRect(), l = (o == null ? void 0 : o.width) || 0, s = (o == null ? void 0 : o.height) || 0, d = (t == null ? void 0 : t.width) || 0, u = (t == null ? void 0 : t.height) || 0, v = l < d || s < u, f = !n && e && (e == null ? void 0 : e.total) > 0.1 && v;
248
+ f ? be(i) : zi(i);
249
+ }
250
+ }
251
+ function si(i, n, e, r) {
252
+ var a = i.setup, o = a.minScale, t = a.maxScale, l = a.limitToBounds, s = H(y(n, 2), o, t, 0, !1), d = Z(i, s), u = j(i, e, r, s, d, l), v = u.x, f = u.y;
253
+ return { scale: s, positionX: v, positionY: f };
254
+ }
255
+ function Ei(i, n, e) {
256
+ var r = i.transformState.scale, a = i.wrapperComponent, o = i.setup, t = o.minScale, l = o.limitToBounds, s = o.zoomAnimation, d = s.disabled, u = s.animationTime, v = s.animationType, f = d || r >= t;
257
+ if ((r >= 1 || l) && zi(i), !(f || !a || !i.mounted)) {
258
+ var p = n || a.offsetWidth / 2, m = e || a.offsetHeight / 2, h = si(i, t, p, m);
259
+ h && D(i, h, u, v);
260
+ }
261
+ }
262
+ var _ = function() {
263
+ return _ = Object.assign || function(n) {
264
+ for (var e, r = 1, a = arguments.length; r < a; r++) {
265
+ e = arguments[r];
266
+ for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (n[o] = e[o]);
267
+ }
268
+ return n;
269
+ }, _.apply(this, arguments);
270
+ };
271
+ function Pi(i, n, e) {
272
+ for (var r = 0, a = n.length, o; r < a; r++)
273
+ (o || !(r in n)) && (o || (o = Array.prototype.slice.call(n, 0, r)), o[r] = n[r]);
274
+ return i.concat(o || Array.prototype.slice.call(n));
275
+ }
276
+ var Q = {
277
+ previousScale: 1,
278
+ scale: 1,
279
+ positionX: 0,
280
+ positionY: 0
281
+ }, M = {
282
+ disabled: !1,
283
+ minPositionX: null,
284
+ maxPositionX: null,
285
+ minPositionY: null,
286
+ maxPositionY: null,
287
+ minScale: 1,
288
+ maxScale: 8,
289
+ limitToBounds: !0,
290
+ centerZoomedOut: !1,
291
+ centerOnInit: !1,
292
+ disablePadding: !1,
293
+ smooth: !0,
294
+ wheel: {
295
+ step: 0.2,
296
+ disabled: !1,
297
+ smoothStep: 1e-3,
298
+ wheelDisabled: !1,
299
+ touchPadDisabled: !1,
300
+ activationKeys: [],
301
+ excluded: []
302
+ },
303
+ panning: {
304
+ disabled: !1,
305
+ velocityDisabled: !1,
306
+ lockAxisX: !1,
307
+ lockAxisY: !1,
308
+ allowLeftClickPan: !0,
309
+ allowMiddleClickPan: !0,
310
+ allowRightClickPan: !0,
311
+ wheelPanning: !1,
312
+ activationKeys: [],
313
+ excluded: []
314
+ },
315
+ pinch: {
316
+ step: 5,
317
+ disabled: !1,
318
+ excluded: []
319
+ },
320
+ doubleClick: {
321
+ disabled: !1,
322
+ step: 0.7,
323
+ mode: "zoomIn",
324
+ animationType: "easeOut",
325
+ animationTime: 200,
326
+ excluded: []
327
+ },
328
+ zoomAnimation: {
329
+ disabled: !1,
330
+ size: 0.4,
331
+ animationTime: 200,
332
+ animationType: "easeOut"
333
+ },
334
+ alignmentAnimation: {
335
+ disabled: !1,
336
+ sizeX: 100,
337
+ sizeY: 100,
338
+ animationTime: 200,
339
+ velocityAlignmentTime: 400,
340
+ animationType: "easeOut"
341
+ },
342
+ velocityAnimation: {
343
+ disabled: !1,
344
+ sensitivity: 1,
345
+ animationTime: 400,
346
+ animationType: "easeOut",
347
+ equalToMove: !0
348
+ }
349
+ }, ni = {
350
+ wrapperClass: "react-transform-wrapper",
351
+ contentClass: "react-transform-component"
352
+ }, _i = function(i) {
353
+ var n, e, r, a;
354
+ return {
355
+ previousScale: (n = i.initialScale) !== null && n !== void 0 ? n : Q.scale,
356
+ scale: (e = i.initialScale) !== null && e !== void 0 ? e : Q.scale,
357
+ positionX: (r = i.initialPositionX) !== null && r !== void 0 ? r : Q.positionX,
358
+ positionY: (a = i.initialPositionY) !== null && a !== void 0 ? a : Q.positionY
359
+ };
360
+ }, bi = function(i) {
361
+ var n = _({}, M);
362
+ return Object.keys(i).forEach(function(e) {
363
+ var r = typeof i[e] != "undefined", a = typeof M[e] != "undefined";
364
+ if (a && r) {
365
+ var o = Object.prototype.toString.call(M[e]), t = o === "[object Object]", l = o === "[object Array]";
366
+ t ? n[e] = _(_({}, M[e]), i[e]) : l ? n[e] = Pi(Pi([], M[e], !0), i[e]) : n[e] = i[e];
367
+ }
368
+ }), n;
369
+ }, Wi = function(i, n, e) {
370
+ var r = i.transformState.scale, a = i.wrapperComponent, o = i.setup, t = o.maxScale, l = o.minScale, s = o.zoomAnimation, d = o.smooth, u = s.size;
371
+ if (!a)
372
+ throw new Error("Wrapper is not mounted");
373
+ var v = d ? r * Math.exp(n * e) : r + n * e, f = H(y(v, 3), l, t, u, !1);
374
+ return f;
375
+ };
376
+ function Di(i, n, e, r, a) {
377
+ var o = i.wrapperComponent, t = i.transformState, l = t.scale, s = t.positionX, d = t.positionY;
378
+ if (!o)
379
+ return console.error("No WrapperComponent found");
380
+ var u = o.offsetWidth, v = o.offsetHeight, f = (u / 2 - s) / l, p = (v / 2 - d) / l, m = Wi(i, n, e), h = si(i, m, f, p);
381
+ if (!h)
382
+ return console.error("Error during zoom event. New transformation state was not calculated.");
383
+ D(i, h, r, a);
384
+ }
385
+ function Oi(i, n, e, r) {
386
+ var a = i.setup, o = i.wrapperComponent, t = a.limitToBounds, l = _i(i.props), s = i.transformState, d = s.scale, u = s.positionX, v = s.positionY;
387
+ if (o) {
388
+ var f = li(i, l.scale), p = L(l.positionX, l.positionY, f, t, 0, 0, o), m = {
389
+ scale: l.scale,
390
+ positionX: p.x,
391
+ positionY: p.y
392
+ };
393
+ d === l.scale && u === l.positionX && v === l.positionY || (r == null || r(), D(i, m, n, e));
394
+ }
395
+ }
396
+ function ye(i, n, e, r) {
397
+ var a = i.getBoundingClientRect(), o = n.getBoundingClientRect(), t = e.getBoundingClientRect(), l = o.x * r.scale, s = o.y * r.scale;
398
+ return {
399
+ x: (a.x - t.x + l) / r.scale,
400
+ y: (a.y - t.y + s) / r.scale
401
+ };
402
+ }
403
+ function Ye(i, n, e) {
404
+ var r = i.wrapperComponent, a = i.contentComponent, o = i.transformState, t = i.setup, l = t.limitToBounds, s = t.minScale, d = t.maxScale;
405
+ if (!r || !a)
406
+ return o;
407
+ var u = r.getBoundingClientRect(), v = n.getBoundingClientRect(), f = ye(n, r, a, o), p = f.x, m = f.y, h = v.width / o.scale, c = v.height / o.scale, P = r.offsetWidth / h, b = r.offsetHeight / c, w = H(e || Math.min(P, b), s, d, 0, !1), T = (u.width - h * w) / 2, C = (u.height - c * w) / 2, A = (u.left - p) * w + T, X = (u.top - m) * w + C, O = li(i, w), z = L(A, X, O, l, 0, 0, r), E = z.x, N = z.y;
408
+ return { positionX: E, positionY: N, scale: w };
409
+ }
410
+ var Te = function(i) {
411
+ return function(n, e, r) {
412
+ n === void 0 && (n = 0.5), e === void 0 && (e = 300), r === void 0 && (r = "easeOut"), Di(i, 1, n, e, r);
413
+ };
414
+ }, Xe = function(i) {
415
+ return function(n, e, r) {
416
+ n === void 0 && (n = 0.5), e === void 0 && (e = 300), r === void 0 && (r = "easeOut"), Di(i, -1, n, e, r);
417
+ };
418
+ }, Ae = function(i) {
419
+ return function(n, e, r, a, o) {
420
+ a === void 0 && (a = 300), o === void 0 && (o = "easeOut");
421
+ var t = i.transformState, l = t.positionX, s = t.positionY, d = t.scale, u = i.wrapperComponent, v = i.contentComponent, f = i.setup.disabled;
422
+ if (!(f || !u || !v)) {
423
+ var p = {
424
+ positionX: Number.isNaN(n) ? l : n,
425
+ positionY: Number.isNaN(e) ? s : e,
426
+ scale: Number.isNaN(r) ? d : r
427
+ };
428
+ D(i, p, a, o);
429
+ }
430
+ };
431
+ }, ze = function(i) {
432
+ return function(n, e) {
433
+ n === void 0 && (n = 200), e === void 0 && (e = "easeOut"), Oi(i, n, e);
434
+ };
435
+ }, Ee = function(i) {
436
+ return function(n, e, r) {
437
+ e === void 0 && (e = 200), r === void 0 && (r = "easeOut");
438
+ var a = i.transformState, o = i.wrapperComponent, t = i.contentComponent;
439
+ if (o && t) {
440
+ var l = Ni(n || a.scale, o, t);
441
+ D(i, l, e, r);
442
+ }
443
+ };
444
+ }, _e = function(i) {
445
+ return function(n, e, r, a) {
446
+ r === void 0 && (r = 600), a === void 0 && (a = "easeOut"), Y(i);
447
+ var o = i.wrapperComponent, t = typeof n == "string" ? document.getElementById(n) : n;
448
+ if (o && t && o.contains(t)) {
449
+ var l = Ye(i, t, e);
450
+ D(i, l, r, a);
451
+ }
452
+ };
453
+ }, ai = function(i) {
454
+ return {
455
+ instance: i,
456
+ zoomIn: Te(i),
457
+ zoomOut: Xe(i),
458
+ setTransform: Ae(i),
459
+ resetTransform: ze(i),
460
+ centerView: Ee(i),
461
+ zoomToElement: _e(i)
462
+ };
463
+ }, We = function(i) {
464
+ return {
465
+ instance: i,
466
+ state: i.transformState
467
+ };
468
+ }, g = function(i) {
469
+ var n = {};
470
+ return Object.assign(n, We(i)), Object.assign(n, ai(i)), n;
471
+ }, ii = !1;
472
+ function ei() {
473
+ try {
474
+ var i = {
475
+ get passive() {
476
+ return ii = !0, !1;
477
+ }
478
+ };
479
+ return i;
480
+ } catch {
481
+ return ii = !1, ii;
482
+ }
483
+ }
484
+ var F = ".".concat(ni.wrapperClass), q = function(i, n) {
485
+ return n.some(function(e) {
486
+ return i.matches("".concat(F, " ").concat(e, ", ").concat(F, " .").concat(e, ", ").concat(F, " ").concat(e, " *, ").concat(F, " .").concat(e, " *"));
487
+ });
488
+ }, oi = function(i) {
489
+ i && clearTimeout(i);
490
+ }, De = function(i, n, e) {
491
+ return "translate(".concat(i, "px, ").concat(n, "px) scale(").concat(e, ")");
492
+ }, Ni = function(i, n, e) {
493
+ var r = e.offsetWidth * i, a = e.offsetHeight * i, o = (n.offsetWidth - r) / 2, t = (n.offsetHeight - a) / 2;
494
+ return {
495
+ scale: i,
496
+ positionX: o,
497
+ positionY: t
498
+ };
499
+ };
500
+ function Oe(i) {
501
+ return function(n) {
502
+ i.forEach(function(e) {
503
+ typeof e == "function" ? e(n) : e != null && (e.current = n);
504
+ });
505
+ };
506
+ }
507
+ var Ne = function(i, n) {
508
+ var e = i.setup.wheel, r = e.disabled, a = e.wheelDisabled, o = e.touchPadDisabled, t = e.excluded, l = i.isInitialized, s = i.isPanning, d = n.target, u = l && !s && !r && d;
509
+ if (!u || a && !n.ctrlKey || o && n.ctrlKey)
510
+ return !1;
511
+ var v = q(d, t);
512
+ return !v;
513
+ }, ke = function(i) {
514
+ return i ? i.deltaY < 0 ? 1 : -1 : 0;
515
+ };
516
+ function Be(i, n) {
517
+ var e = ke(i), r = Ui(n, e);
518
+ return r;
519
+ }
520
+ function ki(i, n, e) {
521
+ var r = n.getBoundingClientRect(), a = 0, o = 0;
522
+ if ("clientX" in i)
523
+ a = (i.clientX - r.left) / e, o = (i.clientY - r.top) / e;
524
+ else {
525
+ var t = i.touches[0];
526
+ a = (t.clientX - r.left) / e, o = (t.clientY - r.top) / e;
527
+ }
528
+ return (Number.isNaN(a) || Number.isNaN(o)) && console.error("No mouse or touch offset found"), {
529
+ x: a,
530
+ y: o
531
+ };
532
+ }
533
+ var Ze = function(i, n, e, r, a) {
534
+ var o = i.transformState.scale, t = i.wrapperComponent, l = i.setup, s = l.maxScale, d = l.minScale, u = l.zoomAnimation, v = l.disablePadding, f = u.size, p = u.disabled;
535
+ if (!t)
536
+ throw new Error("Wrapper is not mounted");
537
+ var m = o + n * e, h = r ? !1 : !p, c = H(y(m, 3), d, s, f, h && !v);
538
+ return c;
539
+ }, Me = function(i, n) {
540
+ var e = i.previousWheelEvent, r = i.transformState.scale, a = i.setup, o = a.maxScale, t = a.minScale;
541
+ return e ? r < o || r > t || Math.sign(e.deltaY) !== Math.sign(n.deltaY) || e.deltaY > 0 && e.deltaY < n.deltaY || e.deltaY < 0 && e.deltaY > n.deltaY || Math.sign(e.deltaY) !== Math.sign(n.deltaY) : !1;
542
+ }, Le = function(i, n) {
543
+ var e = i.setup.pinch, r = e.disabled, a = e.excluded, o = i.isInitialized, t = n.target, l = o && !r && t;
544
+ if (!l)
545
+ return !1;
546
+ var s = q(t, a);
547
+ return !s;
548
+ }, He = function(i) {
549
+ var n = i.setup.pinch.disabled, e = i.isInitialized, r = i.pinchStartDistance, a = e && !n && r;
550
+ return !!a;
551
+ }, Ve = function(i, n, e) {
552
+ var r = e.getBoundingClientRect(), a = i.touches, o = y(a[0].clientX - r.left, 5), t = y(a[0].clientY - r.top, 5), l = y(a[1].clientX - r.left, 5), s = y(a[1].clientY - r.top, 5);
553
+ return {
554
+ x: (o + l) / 2 / n,
555
+ y: (t + s) / 2 / n
556
+ };
557
+ }, Bi = function(i) {
558
+ return Math.sqrt(Math.pow(i.touches[0].pageX - i.touches[1].pageX, 2) + Math.pow(i.touches[0].pageY - i.touches[1].pageY, 2));
559
+ }, Ke = function(i, n) {
560
+ var e = i.pinchStartScale, r = i.pinchStartDistance, a = i.setup, o = a.maxScale, t = a.minScale, l = a.zoomAnimation, s = a.disablePadding, d = l.size, u = l.disabled;
561
+ if (!e || r === null || !n)
562
+ throw new Error("Pinch touches distance was not provided");
563
+ if (n < 0)
564
+ return i.transformState.scale;
565
+ var v = n / r, f = v * e;
566
+ return H(y(f, 2), t, o, d, !u && !s);
567
+ }, Qe = 160, Fe = 100, Re = function(i, n) {
568
+ var e = i.props, r = e.onWheelStart, a = e.onZoomStart;
569
+ i.wheelStopEventTimer || (Y(i), S(g(i), n, r), S(g(i), n, a));
570
+ }, je = function(i, n) {
571
+ var e = i.props, r = e.onWheel, a = e.onZoom, o = i.contentComponent, t = i.setup, l = i.transformState, s = l.scale, d = t.limitToBounds, u = t.centerZoomedOut, v = t.zoomAnimation, f = t.wheel, p = t.disablePadding, m = t.smooth, h = v.size, c = v.disabled, P = f.step, b = f.smoothStep;
572
+ if (!o)
573
+ throw new Error("Component not mounted");
574
+ n.preventDefault(), n.stopPropagation();
575
+ var w = Be(n, null), T = m ? b * Math.abs(n.deltaY) : P, C = Ze(i, w, T, !n.ctrlKey);
576
+ if (s !== C) {
577
+ var A = Z(i, C), X = ki(n, o, s), O = c || h === 0 || u || p, z = d && O, E = j(i, X.x, X.y, C, A, z), N = E.x, B = E.y;
578
+ i.previousWheelEvent = n, i.setTransformState(C, N, B), S(g(i), n, r), S(g(i), n, a);
579
+ }
580
+ }, qe = function(i, n) {
581
+ var e = i.props, r = e.onWheelStop, a = e.onZoomStop;
582
+ oi(i.wheelAnimationTimer), i.wheelAnimationTimer = setTimeout(function() {
583
+ i.mounted && (Ei(i, n.x, n.y), i.wheelAnimationTimer = null);
584
+ }, Fe);
585
+ var o = Me(i, n);
586
+ o && (oi(i.wheelStopEventTimer), i.wheelStopEventTimer = setTimeout(function() {
587
+ i.mounted && (i.wheelStopEventTimer = null, S(g(i), n, r), S(g(i), n, a));
588
+ }, Qe));
589
+ }, Zi = function(i) {
590
+ for (var n = 0, e = 0, r = 0; r < 2; r += 1)
591
+ n += i.touches[r].clientX, e += i.touches[r].clientY;
592
+ var a = n / 2, o = e / 2;
593
+ return { x: a, y: o };
594
+ }, Ue = function(i, n) {
595
+ var e = Bi(n);
596
+ i.pinchStartDistance = e, i.lastDistance = e, i.pinchStartScale = i.transformState.scale, i.isPanning = !1;
597
+ var r = Zi(n);
598
+ i.pinchLastCenterX = r.x, i.pinchLastCenterY = r.y, Y(i);
599
+ }, Ge = function(i, n) {
600
+ var e = i.contentComponent, r = i.pinchStartDistance, a = i.wrapperComponent, o = i.transformState.scale, t = i.setup, l = t.limitToBounds, s = t.centerZoomedOut, d = t.zoomAnimation, u = t.alignmentAnimation, v = d.disabled, f = d.size;
601
+ if (!(r === null || !e)) {
602
+ var p = Ve(n, o, e);
603
+ if (!(!Number.isFinite(p.x) || !Number.isFinite(p.y))) {
604
+ var m = Bi(n), h = Ke(i, m), c = Zi(n), P = c.x - (i.pinchLastCenterX || 0), b = c.y - (i.pinchLastCenterY || 0);
605
+ if (!(h === o && P === 0 && b === 0)) {
606
+ i.pinchLastCenterX = c.x, i.pinchLastCenterY = c.y;
607
+ var w = Z(i, h), T = v || f === 0 || s, C = l && T, A = j(i, p.x, p.y, h, w, C), X = A.x, O = A.y;
608
+ i.pinchMidpoint = p, i.lastDistance = m;
609
+ var z = u.sizeX, E = u.sizeY, N = W(i, z), B = W(i, E), V = X + P, U = O + b, K = L(V, U, w, l, N, B, a), G = K.x, J = K.y;
610
+ i.setTransformState(h, G, J);
611
+ }
612
+ }
613
+ }
614
+ }, Je = function(i) {
615
+ var n = i.pinchMidpoint;
616
+ i.velocity = null, i.lastDistance = null, i.pinchMidpoint = null, i.pinchStartScale = null, i.pinchStartDistance = null, Ei(i, n == null ? void 0 : n.x, n == null ? void 0 : n.y);
617
+ }, Mi = function(i, n) {
618
+ var e = i.props.onZoomStop, r = i.setup.doubleClick.animationTime;
619
+ oi(i.doubleClickStopEventTimer), i.doubleClickStopEventTimer = setTimeout(function() {
620
+ i.doubleClickStopEventTimer = null, S(g(i), n, e);
621
+ }, r);
622
+ }, $e = function(i, n) {
623
+ var e = i.props, r = e.onZoomStart, a = e.onZoom, o = i.setup.doubleClick, t = o.animationTime, l = o.animationType;
624
+ S(g(i), n, r), Oi(i, t, l, function() {
625
+ return S(g(i), n, a);
626
+ }), Mi(i, n);
627
+ };
628
+ function xe(i, n) {
629
+ return i === "toggle" ? n === 1 ? 1 : -1 : i === "zoomOut" ? -1 : 1;
630
+ }
631
+ function Ie(i, n) {
632
+ var e = i.setup, r = i.doubleClickStopEventTimer, a = i.transformState, o = i.contentComponent, t = a.scale, l = i.props, s = l.onZoomStart, d = l.onZoom, u = e.doubleClick, v = u.disabled, f = u.mode, p = u.step, m = u.animationTime, h = u.animationType;
633
+ if (!v && !r) {
634
+ if (f === "reset")
635
+ return $e(i, n);
636
+ if (!o)
637
+ return console.error("No ContentComponent found");
638
+ var c = xe(f, i.transformState.scale), P = Wi(i, c, p);
639
+ if (t !== P) {
640
+ S(g(i), n, s);
641
+ var b = ki(n, o, t), w = si(i, P, b.x, b.y);
642
+ if (!w)
643
+ return console.error("Error during zoom event. New transformation state was not calculated.");
644
+ S(g(i), n, d), D(i, w, m, h), Mi(i, n);
645
+ }
646
+ }
647
+ }
648
+ var ir = function(i, n) {
649
+ var e = i.isInitialized, r = i.setup, a = i.wrapperComponent, o = r.doubleClick, t = o.disabled, l = o.excluded, s = n.target, d = a == null ? void 0 : a.contains(s), u = e && s && d && !t;
650
+ if (!u)
651
+ return !1;
652
+ var v = q(s, l);
653
+ return !v;
654
+ }, er = (
655
+ /** @class */
656
+ /* @__PURE__ */ function() {
657
+ function i(n) {
658
+ var e = this;
659
+ this.mounted = !0, this.pinchLastCenterX = null, this.pinchLastCenterY = null, this.onChangeCallbacks = /* @__PURE__ */ new Set(), this.onInitCallbacks = /* @__PURE__ */ new Set(), this.wrapperComponent = null, this.contentComponent = null, this.isInitialized = !1, this.bounds = null, this.previousWheelEvent = null, this.wheelStopEventTimer = null, this.wheelAnimationTimer = null, this.isPanning = !1, this.isWheelPanning = !1, this.startCoords = null, this.lastTouch = null, this.distance = null, this.lastDistance = null, this.pinchStartDistance = null, this.pinchStartScale = null, this.pinchMidpoint = null, this.doubleClickStopEventTimer = null, this.velocity = null, this.velocityTime = null, this.lastMousePosition = null, this.animate = !1, this.animation = null, this.maxBounds = null, this.pressedKeys = {}, this.mount = function() {
660
+ e.initializeWindowEvents();
661
+ }, this.unmount = function() {
662
+ e.cleanupWindowEvents();
663
+ }, this.update = function(r) {
664
+ e.props = r, Z(e, e.transformState.scale), e.setup = bi(r);
665
+ }, this.initializeWindowEvents = function() {
666
+ var r, a, o = ei(), t = (r = e.wrapperComponent) === null || r === void 0 ? void 0 : r.ownerDocument, l = t == null ? void 0 : t.defaultView;
667
+ (a = e.wrapperComponent) === null || a === void 0 || a.addEventListener("wheel", e.onWheelPanning, o), l == null || l.addEventListener("mousedown", e.onPanningStart, o), l == null || l.addEventListener("mousemove", e.onPanning, o), l == null || l.addEventListener("mouseup", e.onPanningStop, o), t == null || t.addEventListener("mouseleave", e.clearPanning, o), l == null || l.addEventListener("keyup", e.setKeyUnPressed, o), l == null || l.addEventListener("keydown", e.setKeyPressed, o);
668
+ }, this.cleanupWindowEvents = function() {
669
+ var r, a, o = ei(), t = (r = e.wrapperComponent) === null || r === void 0 ? void 0 : r.ownerDocument, l = t == null ? void 0 : t.defaultView;
670
+ l == null || l.removeEventListener("mousedown", e.onPanningStart, o), l == null || l.removeEventListener("mousemove", e.onPanning, o), l == null || l.removeEventListener("mouseup", e.onPanningStop, o), t == null || t.removeEventListener("mouseleave", e.clearPanning, o), l == null || l.removeEventListener("keyup", e.setKeyUnPressed, o), l == null || l.removeEventListener("keydown", e.setKeyPressed, o), document.removeEventListener("mouseleave", e.clearPanning, o), Y(e), (a = e.observer) === null || a === void 0 || a.disconnect();
671
+ }, this.handleInitializeWrapperEvents = function(r) {
672
+ var a = ei();
673
+ r.addEventListener("wheel", e.onWheelZoom, a), r.addEventListener("dblclick", e.onDoubleClick, a), r.addEventListener("touchstart", e.onTouchPanningStart, a), r.addEventListener("touchmove", e.onTouchPanning, a), r.addEventListener("touchend", e.onTouchPanningStop, a);
674
+ }, this.handleInitialize = function(r) {
675
+ var a = e.setup.centerOnInit;
676
+ e.applyTransformation(), e.onInitCallbacks.forEach(function(o) {
677
+ return o(g(e));
678
+ }), a && (e.setCenter(), e.observer = new ResizeObserver(function() {
679
+ var o, t = r.offsetWidth, l = r.offsetHeight;
680
+ (t > 0 || l > 0) && (e.onInitCallbacks.forEach(function(s) {
681
+ return s(g(e));
682
+ }), e.setCenter(), (o = e.observer) === null || o === void 0 || o.disconnect());
683
+ }), setTimeout(function() {
684
+ var o;
685
+ (o = e.observer) === null || o === void 0 || o.disconnect();
686
+ }, 5e3), e.observer.observe(r));
687
+ }, this.onWheelZoom = function(r) {
688
+ var a = e.setup.disabled;
689
+ if (!a) {
690
+ var o = Ne(e, r);
691
+ if (o) {
692
+ var t = e.isPressingKeys(e.setup.wheel.activationKeys);
693
+ t && (Re(e, r), je(e, r), qe(e, r));
694
+ }
695
+ }
696
+ }, this.onWheelPanning = function(r) {
697
+ var a = e.setup, o = a.disabled, t = a.wheel, l = a.panning;
698
+ if (!(!e.wrapperComponent || !e.contentComponent || o || !t.wheelDisabled || l.disabled || !l.wheelPanning || r.ctrlKey)) {
699
+ r.preventDefault(), r.stopPropagation();
700
+ var s = e.transformState, d = s.positionX, u = s.positionY, v = d - r.deltaX, f = u - r.deltaY, p = l.lockAxisX ? d : v, m = l.lockAxisY ? u : f, h = e.setup.alignmentAnimation, c = h.sizeX, P = h.sizeY, b = W(e, c), w = W(e, P);
701
+ p === d && m === u || Ai(e, p, m, b, w);
702
+ }
703
+ }, this.onPanningStart = function(r) {
704
+ var a = e.setup.disabled, o = e.props.onPanningStart;
705
+ if (!a) {
706
+ var t = hi(e, r);
707
+ if (t) {
708
+ var l = e.isPressingKeys(e.setup.panning.activationKeys);
709
+ l && (r.button === 0 && !e.setup.panning.allowLeftClickPan || r.button === 1 && !e.setup.panning.allowMiddleClickPan || r.button === 2 && !e.setup.panning.allowRightClickPan || (r.preventDefault(), r.stopPropagation(), Y(e), Si(e, r), S(g(e), r, o)));
710
+ }
711
+ }
712
+ }, this.onPanning = function(r) {
713
+ var a = e.setup.disabled, o = e.props.onPanning;
714
+ if (!a) {
715
+ var t = ci(e);
716
+ if (t) {
717
+ var l = e.isPressingKeys(e.setup.panning.activationKeys);
718
+ l && (r.preventDefault(), r.stopPropagation(), wi(e, r.clientX, r.clientY), S(g(e), r, o));
719
+ }
720
+ }
721
+ }, this.onPanningStop = function(r) {
722
+ var a = e.props.onPanningStop;
723
+ e.isPanning && (Ce(e), S(g(e), r, a));
724
+ }, this.onPinchStart = function(r) {
725
+ var a = e.setup.disabled, o = e.props, t = o.onPinchingStart, l = o.onZoomStart;
726
+ if (!a) {
727
+ var s = Le(e, r);
728
+ s && (Ue(e, r), Y(e), S(g(e), r, t), S(g(e), r, l));
729
+ }
730
+ }, this.onPinch = function(r) {
731
+ var a = e.setup.disabled, o = e.props, t = o.onPinching, l = o.onZoom;
732
+ if (!a) {
733
+ var s = He(e);
734
+ s && (r.preventDefault(), r.stopPropagation(), Ge(e, r), S(g(e), r, t), S(g(e), r, l));
735
+ }
736
+ }, this.onPinchStop = function(r) {
737
+ var a = e.props, o = a.onPinchingStop, t = a.onZoomStop;
738
+ e.pinchStartScale && (Je(e), S(g(e), r, o), S(g(e), r, t));
739
+ }, this.onTouchPanningStart = function(r) {
740
+ var a = e.setup.disabled, o = e.props.onPanningStart;
741
+ if (!a) {
742
+ var t = hi(e, r);
743
+ if (t) {
744
+ var l = e.lastTouch && +/* @__PURE__ */ new Date() - e.lastTouch < 200;
745
+ if (!l) {
746
+ e.lastTouch = +/* @__PURE__ */ new Date(), Y(e);
747
+ var s = r.touches, d = s.length === 1, u = s.length === 2;
748
+ d && (Y(e), Si(e, r), S(g(e), r, o)), u && e.onPinchStart(r);
749
+ }
750
+ }
751
+ }
752
+ }, this.onTouchPanning = function(r) {
753
+ var a = e.setup.disabled, o = e.props.onPanning;
754
+ if (e.isPanning && r.touches.length === 1) {
755
+ if (a)
756
+ return;
757
+ var t = ci(e);
758
+ if (!t)
759
+ return;
760
+ r.preventDefault(), r.stopPropagation();
761
+ var l = r.touches[0];
762
+ wi(e, l.clientX, l.clientY), S(g(e), r, o);
763
+ } else r.touches.length > 1 && e.onPinch(r);
764
+ }, this.onTouchPanningStop = function(r) {
765
+ e.onPanningStop(r), e.onPinchStop(r);
766
+ }, this.onDoubleClick = function(r) {
767
+ var a = e.setup.disabled;
768
+ if (!a) {
769
+ var o = ir(e, r);
770
+ o && Ie(e, r);
771
+ }
772
+ }, this.clearPanning = function(r) {
773
+ e.isPanning && e.onPanningStop(r);
774
+ }, this.setKeyPressed = function(r) {
775
+ e.pressedKeys[r.key] = !0;
776
+ }, this.setKeyUnPressed = function(r) {
777
+ e.pressedKeys[r.key] = !1;
778
+ }, this.isPressingKeys = function(r) {
779
+ return r.length ? !!r.find(function(a) {
780
+ return e.pressedKeys[a];
781
+ }) : !0;
782
+ }, this.setTransformState = function(r, a, o) {
783
+ var t = e.props.onTransformed;
784
+ if (!Number.isNaN(r) && !Number.isNaN(a) && !Number.isNaN(o)) {
785
+ r !== e.transformState.scale && (e.transformState.previousScale = e.transformState.scale, e.transformState.scale = r), e.transformState.positionX = a, e.transformState.positionY = o, e.applyTransformation();
786
+ var l = g(e);
787
+ e.onChangeCallbacks.forEach(function(s) {
788
+ return s(l);
789
+ }), S(l, { scale: r, positionX: a, positionY: o }, t);
790
+ } else
791
+ console.error("Detected NaN set state values");
792
+ }, this.setCenter = function() {
793
+ if (e.wrapperComponent && e.contentComponent) {
794
+ var r = Ni(e.transformState.scale, e.wrapperComponent, e.contentComponent);
795
+ e.setTransformState(r.scale, r.positionX, r.positionY);
796
+ }
797
+ }, this.handleTransformStyles = function(r, a, o) {
798
+ return e.props.customTransform ? e.props.customTransform(r, a, o) : De(r, a, o);
799
+ }, this.applyTransformation = function() {
800
+ if (!(!e.mounted || !e.contentComponent)) {
801
+ var r = e.transformState, a = r.scale, o = r.positionX, t = r.positionY, l = e.handleTransformStyles(o, t, a);
802
+ e.contentComponent.style.transform = l;
803
+ }
804
+ }, this.getContext = function() {
805
+ return g(e);
806
+ }, this.onChange = function(r) {
807
+ return e.onChangeCallbacks.has(r) || e.onChangeCallbacks.add(r), function() {
808
+ e.onChangeCallbacks.delete(r);
809
+ };
810
+ }, this.onInit = function(r) {
811
+ return e.onInitCallbacks.has(r) || e.onInitCallbacks.add(r), function() {
812
+ e.onInitCallbacks.delete(r);
813
+ };
814
+ }, this.init = function(r, a) {
815
+ e.cleanupWindowEvents(), e.wrapperComponent = r, e.contentComponent = a, Z(e, e.transformState.scale), e.handleInitializeWrapperEvents(r), e.handleInitialize(a), e.initializeWindowEvents(), e.isInitialized = !0;
816
+ var o = g(e);
817
+ S(o, void 0, e.props.onInit);
818
+ }, this.props = n, this.setup = bi(this.props), this.transformState = _i(this.props);
819
+ }
820
+ return i;
821
+ }()
822
+ ), ui = k.createContext(null), rr = function(i, n) {
823
+ return typeof i == "function" ? i(n) : i;
824
+ }, tr = k.forwardRef(function(i, n) {
825
+ var e = R(new er(i)).current, r = rr(i.children, ai(e));
826
+ return qi(n, function() {
827
+ return ai(e);
828
+ }, [e]), ti(function() {
829
+ e.update(i);
830
+ }, [e, i]), k.createElement(ui.Provider, { value: e }, r);
831
+ });
832
+ k.forwardRef(function(i, n) {
833
+ var e = R(null), r = yi(ui);
834
+ return ti(function() {
835
+ return r.onChange(function(a) {
836
+ if (e.current) {
837
+ var o = 0, t = 0;
838
+ e.current.style.transform = r.handleTransformStyles(o, t, 1 / a.instance.transformState.scale);
839
+ }
840
+ });
841
+ }, [r]), k.createElement("div", _({}, i, { ref: Oe([e, n]) }));
842
+ });
843
+ function nr(i, n) {
844
+ n === void 0 && (n = {});
845
+ var e = n.insertAt;
846
+ if (typeof document != "undefined") {
847
+ var r = document.head || document.getElementsByTagName("head")[0], a = document.createElement("style");
848
+ a.type = "text/css", e === "top" && r.firstChild ? r.insertBefore(a, r.firstChild) : r.appendChild(a), a.styleSheet ? a.styleSheet.cssText = i : a.appendChild(document.createTextNode(i));
849
+ }
850
+ }
851
+ var ar = `.transform-component-module_wrapper__SPB86 {
852
+ position: relative;
853
+ width: -moz-fit-content;
854
+ width: fit-content;
855
+ height: -moz-fit-content;
856
+ height: fit-content;
857
+ overflow: hidden;
858
+ -webkit-touch-callout: none; /* iOS Safari */
859
+ -webkit-user-select: none; /* Safari */
860
+ -khtml-user-select: none; /* Konqueror HTML */
861
+ -moz-user-select: none; /* Firefox */
862
+ -ms-user-select: none; /* Internet Explorer/Edge */
863
+ user-select: none;
864
+ margin: 0;
865
+ padding: 0;
866
+ }
867
+ .transform-component-module_content__FBWxo {
868
+ display: flex;
869
+ flex-wrap: wrap;
870
+ width: -moz-fit-content;
871
+ width: fit-content;
872
+ height: -moz-fit-content;
873
+ height: fit-content;
874
+ margin: 0;
875
+ padding: 0;
876
+ transform-origin: 0% 0%;
877
+ }
878
+ .transform-component-module_content__FBWxo img {
879
+ pointer-events: none;
880
+ }
881
+ `, Ci = { wrapper: "transform-component-module_wrapper__SPB86", content: "transform-component-module_content__FBWxo" };
882
+ nr(ar);
883
+ var lr = function(i) {
884
+ var n = i.children, e = i.wrapperClass, r = e === void 0 ? "" : e, a = i.contentClass, o = a === void 0 ? "" : a, t = i.wrapperStyle, l = i.contentStyle, s = i.wrapperProps, d = s === void 0 ? {} : s, u = i.contentProps, v = u === void 0 ? {} : u, f = yi(ui), p = f.init, m = f.cleanupWindowEvents, h = R(null), c = R(null);
885
+ return ti(function() {
886
+ var P = h.current, b = c.current;
887
+ return P !== null && b !== null && p && (p == null || p(P, b)), function() {
888
+ m == null || m();
889
+ };
890
+ }, []), k.createElement(
891
+ "div",
892
+ _({}, d, { ref: h, className: "".concat(ni.wrapperClass, " ").concat(Ci.wrapper, " ").concat(r), style: t }),
893
+ k.createElement("div", _({}, v, { ref: c, className: "".concat(ni.contentClass, " ").concat(Ci.content, " ").concat(o), style: l }), n)
894
+ );
895
+ };
896
+ export {
897
+ ui as Context,
898
+ lr as TransformComponent,
899
+ tr as TransformWrapper,
900
+ Ni as getCenterPosition,
901
+ De as getTransformStyles
902
+ };