@sheetxl/react 0.4.13 → 0.4.15

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,3905 @@
1
+ import * as On from "react";
2
+ import { forwardRef as ua, useRef as ca, useImperativeHandle as la, useEffect as fa, createElement as yr } from "react";
3
+ /**
4
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.4.15
5
+ *
6
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
7
+ * License: The license can be found at https://www.sheetxl.com/license.
8
+ */
9
+ function Hr(n, t) {
10
+ for (var e = n.length, r = 0; r < e; ++r) if (t(n[r], r)) return !0;
11
+ return !1;
12
+ }
13
+ function Ji(n, t) {
14
+ for (var e = n.length, r = 0; r < e; ++r) if (t(n[r], r)) return n[r];
15
+ return null;
16
+ }
17
+ function di(n) {
18
+ var t = n;
19
+ if (t === void 0) {
20
+ if (typeof navigator > "u" || !navigator) return "";
21
+ t = navigator.userAgent || "";
22
+ }
23
+ return t.toLowerCase();
24
+ }
25
+ function Er(n, t) {
26
+ try {
27
+ return new RegExp(n, "g").exec(t);
28
+ } catch {
29
+ return null;
30
+ }
31
+ }
32
+ function Sr(n) {
33
+ return n.replace(/_/g, ".");
34
+ }
35
+ function ge(n, t) {
36
+ var e = null, r = "-1";
37
+ return Hr(n, function(i) {
38
+ var o = Er("(" + i.test + ")((?:\\/|\\s|:)([0-9|\\.|_]+))?", t);
39
+ return !(!o || i.brand) && (e = i, r = o[3] || "-1", i.versionAlias ? r = i.versionAlias : i.versionTest && (r = function(a, s) {
40
+ var u = Er("(" + a + ")((?:\\/|\\s|:)([0-9|\\.|_]+))", s);
41
+ return u ? u[3] : "";
42
+ }(i.versionTest.toLowerCase(), t) || r), r = Sr(r), !0);
43
+ }), { preset: e, version: r };
44
+ }
45
+ function Ae(n, t) {
46
+ var e = { brand: "", version: "-1" };
47
+ return Hr(n, function(r) {
48
+ var i = Qi(t, r);
49
+ return !!i && (e.brand = r.id, e.version = r.versionAlias || i.version, e.version !== "-1");
50
+ }), e;
51
+ }
52
+ function Qi(n, t) {
53
+ return Ji(n, function(e) {
54
+ var r = e.brand;
55
+ return Er("" + t.test, r.toLowerCase());
56
+ });
57
+ }
58
+ var hi = [{ test: "phantomjs", id: "phantomjs" }, { test: "whale", id: "whale" }, { test: "edgios|edge|edg", id: "edge" }, { test: "msie|trident|windows phone", id: "ie", versionTest: "iemobile|msie|rv" }, { test: "miuibrowser", id: "miui browser" }, { test: "samsungbrowser", id: "samsung internet" }, { test: "samsung", id: "samsung internet", versionTest: "version" }, { test: "chrome|crios", id: "chrome" }, { test: "firefox|fxios", id: "firefox" }, { test: "android", id: "android browser", versionTest: "version" }, { test: "safari|iphone|ipad|ipod", id: "safari", versionTest: "version" }], gi = [{ test: "(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)", id: "chrome", versionTest: "chrome" }, { test: "chromium", id: "chrome" }, { test: "whale", id: "chrome", versionAlias: "-1", brand: !0 }], sr = [{ test: "applewebkit", id: "webkit", versionTest: "applewebkit|safari" }], to = [{ test: "(?=(iphone|ipad))(?!(.*version))", id: "webview" }, { test: "(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))", id: "webview" }, { test: "webview", id: "webview" }], vi = [{ test: "windows phone", id: "windows phone" }, { test: "windows 2000", id: "window", versionAlias: "5.0" }, { test: "windows nt", id: "window" }, { test: "win32|windows", id: "window" }, { test: "iphone|ipad|ipod", id: "ios", versionTest: "iphone os|cpu os" }, { test: "macos|macintel|mac os x", id: "mac" }, { test: "android|linux armv81", id: "android" }, { test: "tizen", id: "tizen" }, { test: "webos|web0s", id: "webos" }];
59
+ function mi(n) {
60
+ return !!ge(to, n).preset;
61
+ }
62
+ function pa(n) {
63
+ for (var t = [], e = 1; e < arguments.length; e++) t[e - 1] = arguments[e];
64
+ return t.map(function(r) {
65
+ return r.split(" ").map(function(i) {
66
+ return i ? "" + n + i : "";
67
+ }).join(" ");
68
+ }).join(" ");
69
+ }
70
+ function An(n, t) {
71
+ return function(e) {
72
+ e && (n[t] = e);
73
+ };
74
+ }
75
+ function no(n, t, e) {
76
+ return function(r) {
77
+ r && (n[t][e] = r);
78
+ };
79
+ }
80
+ var qr = "undefined", eo = typeof window !== qr, da = typeof document !== qr && document, ha = [{ open: "(", close: ")" }, { open: '"', close: '"' }, { open: "'", close: "'" }, { open: '\\"', close: '\\"' }, { open: "\\'", close: "\\'" }], Tt = 1e-7, Ge = { cm: function(n) {
81
+ return 96 * n / 2.54;
82
+ }, mm: function(n) {
83
+ return 96 * n / 254;
84
+ }, in: function(n) {
85
+ return 96 * n;
86
+ }, pt: function(n) {
87
+ return 96 * n / 72;
88
+ }, pc: function(n) {
89
+ return 96 * n / 6;
90
+ }, "%": function(n, t) {
91
+ return n * t / 100;
92
+ }, vw: function(n, t) {
93
+ return t === void 0 && (t = window.innerWidth), n / 100 * t;
94
+ }, vh: function(n, t) {
95
+ return t === void 0 && (t = window.innerHeight), n / 100 * t;
96
+ }, vmax: function(n, t) {
97
+ return t === void 0 && (t = Math.max(window.innerWidth, window.innerHeight)), n / 100 * t;
98
+ }, vmin: function(n, t) {
99
+ return t === void 0 && (t = Math.min(window.innerWidth, window.innerHeight)), n / 100 * t;
100
+ } };
101
+ function bi(n, t, e, r) {
102
+ return (n * r + t * e) / (e + r);
103
+ }
104
+ function Lr(n) {
105
+ return typeof n === qr;
106
+ }
107
+ function wn(n) {
108
+ return n && typeof n == "object";
109
+ }
110
+ function Ht(n) {
111
+ return Array.isArray(n);
112
+ }
113
+ function oe(n) {
114
+ return typeof n == "string";
115
+ }
116
+ function Ve(n) {
117
+ return typeof n == "number";
118
+ }
119
+ function ro(n) {
120
+ return typeof n == "function";
121
+ }
122
+ function io(n, t, e, r, i) {
123
+ return wr(n, t, e) ? e : function(o, a, s, u, c) {
124
+ for (var p, f = function(h) {
125
+ var g = a[h].trim();
126
+ if (g === o.close && !wr(o, a, h)) return { value: h };
127
+ var v = h, m = un(c, function(x) {
128
+ return x.open === g;
129
+ });
130
+ if (m && (v = io(m, a, h, u, c)), v === -1) return p = h, "break";
131
+ p = h = v;
132
+ }, l = s; l < u; ++l) {
133
+ var d = f(l);
134
+ if (l = p, typeof d == "object") return d.value;
135
+ if (d === "break") break;
136
+ }
137
+ return -1;
138
+ }(n, t, e + 1, r, i);
139
+ }
140
+ function wr(n, t, e) {
141
+ if (!n.ignore) return null;
142
+ var r = t.slice(Math.max(e - 3, 0), e + 3).join("");
143
+ return new RegExp(n.ignore).exec(r);
144
+ }
145
+ function jr(n, t) {
146
+ var e = oe(t) ? { separator: t } : t, r = e.separator, i = r === void 0 ? "," : r, o = e.isSeparateFirst, a = e.isSeparateOnlyOpenClose, s = e.isSeparateOpenClose, u = s === void 0 ? a : s, c = e.openCloseCharacters, p = c === void 0 ? ha : c, f = p.map(function(b) {
147
+ var w = b.open, _ = b.close;
148
+ return w === _ ? w : w + "|" + _;
149
+ }).join("|"), l = new RegExp("(\\s*" + i + "\\s*|" + f + "|\\s+)", "g"), d = n.split(l).filter(function(b) {
150
+ return b && b !== "undefined";
151
+ }), h = d.length, g = [], v = [];
152
+ function m() {
153
+ return !!v.length && (g.push(v.join("")), v = [], !0);
154
+ }
155
+ for (var x, y = function(b) {
156
+ var w = d[b].trim(), _ = b, D = un(p, function(T) {
157
+ return T.open === w;
158
+ }), P = un(p, function(T) {
159
+ return T.close === w;
160
+ });
161
+ if (D) {
162
+ if ((_ = io(D, d, b, h, p)) !== -1 && u) return m() && o ? (x = b, "break") : (g.push(d.slice(b, _ + 1).join("")), b = _, o ? (x = b, "break") : (x = b, "continue"));
163
+ } else {
164
+ if (P && !wr(P, d, b)) {
165
+ var M = function() {
166
+ for (var T = 0, R = 0, F = arguments.length; R < F; R++) T += arguments[R].length;
167
+ var z = Array(T), B = 0;
168
+ for (R = 0; R < F; R++) for (var G = arguments[R], k = 0, I = G.length; k < I; k++, B++) z[B] = G[k];
169
+ return z;
170
+ }(p);
171
+ return M.splice(p.indexOf(P), 1), { value: jr(n, { separator: i, isSeparateFirst: o, isSeparateOnlyOpenClose: a, isSeparateOpenClose: u, openCloseCharacters: M }) };
172
+ }
173
+ if (function(T, R) {
174
+ return (R === "" || R == " ") && (T === "" || T == " ") || T === R;
175
+ }(w, i) && !a) return m(), o ? (x = b, "break") : (x = b, "continue");
176
+ }
177
+ _ === -1 && (_ = h - 1), v.push(d.slice(b, _ + 1).join("")), x = b = _;
178
+ }, E = 0; E < h; ++E) {
179
+ var S = y(E);
180
+ if (E = x, typeof S == "object") return S.value;
181
+ if (S === "break") break;
182
+ }
183
+ return v.length && g.push(v.join("")), g;
184
+ }
185
+ function Me(n) {
186
+ return jr(n, "");
187
+ }
188
+ function ve(n) {
189
+ return jr(n, ",");
190
+ }
191
+ function er(n) {
192
+ var t = /^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(n);
193
+ if (!t) return { prefix: "", unit: "", value: NaN };
194
+ var e = t[1], r = t[2];
195
+ return { prefix: e, unit: t[3], value: parseFloat(r) };
196
+ }
197
+ function Ze() {
198
+ return Date.now ? Date.now() : (/* @__PURE__ */ new Date()).getTime();
199
+ }
200
+ function te(n, t, e) {
201
+ e === void 0 && (e = -1);
202
+ for (var r = n.length, i = 0; i < r; ++i) if (t(n[i], i, n)) return i;
203
+ return e;
204
+ }
205
+ function un(n, t, e) {
206
+ var r = te(n, t);
207
+ return r > -1 ? n[r] : e;
208
+ }
209
+ var oo = function() {
210
+ var n = Ze(), t = eo && (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame);
211
+ return t ? t.bind(window) : function(e) {
212
+ var r = Ze();
213
+ return setTimeout(function() {
214
+ e(r - n);
215
+ }, 1e3 / 60);
216
+ };
217
+ }(), ga = function() {
218
+ var n = eo && (window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame);
219
+ return n ? n.bind(window) : function(t) {
220
+ clearTimeout(t);
221
+ };
222
+ }();
223
+ function De(n) {
224
+ return Object.keys(n);
225
+ }
226
+ function Ut(n, t) {
227
+ var e = er(n), r = e.value, i = e.unit;
228
+ if (wn(t)) {
229
+ var o = t[i];
230
+ if (o) {
231
+ if (ro(o)) return o(r);
232
+ if (Ge[i]) return Ge[i](r, o);
233
+ }
234
+ } else if (i === "%") return r * t / 100;
235
+ return Ge[i] ? Ge[i](r) : r;
236
+ }
237
+ function Mr(n, t, e) {
238
+ return Math.max(t, Math.min(n, e));
239
+ }
240
+ function xi(n, t, e, r) {
241
+ return r === void 0 && (r = n[0] / n[1]), [[ft(t[0], Tt), ft(t[0] / r, Tt)], [ft(t[1] * r, Tt), ft(t[1], Tt)]].filter(function(i) {
242
+ return i.every(function(o, a) {
243
+ var s = t[a], u = ft(s, Tt);
244
+ return e ? o <= s || o <= u : o >= s || o >= u;
245
+ });
246
+ })[0] || n;
247
+ }
248
+ function Dr(n) {
249
+ for (var t = n.length, e = 0, r = t - 1; r >= 0; --r) e += n[r];
250
+ return t ? e / t : 0;
251
+ }
252
+ function sn(n, t) {
253
+ var e = t[0] - n[0], r = t[1] - n[1], i = Math.atan2(r, e);
254
+ return i >= 0 ? i : i + 2 * Math.PI;
255
+ }
256
+ function yi(n) {
257
+ var t = function(i) {
258
+ return [0, 1].map(function(o) {
259
+ return Dr(i.map(function(a) {
260
+ return a[o];
261
+ }));
262
+ });
263
+ }(n), e = sn(t, n[0]), r = sn(t, n[1]);
264
+ return e < r && r - e < Math.PI || e > r && r - e < -Math.PI ? 1 : -1;
265
+ }
266
+ function me(n, t) {
267
+ return Math.sqrt(Math.pow((t ? t[0] : 0) - n[0], 2) + Math.pow((t ? t[1] : 0) - n[1], 2));
268
+ }
269
+ function ft(n, t) {
270
+ if (!t) return n;
271
+ var e = 1 / t;
272
+ return Math.round(n / t) / e;
273
+ }
274
+ function Ei(n, t) {
275
+ return n.forEach(function(e, r) {
276
+ n[r] = ft(n[r], t);
277
+ }), n;
278
+ }
279
+ function xn(n, t) {
280
+ return n.classList ? n.classList.contains(t) : !!n.className.match(new RegExp("(\\s|^)" + t + "(\\s|$)"));
281
+ }
282
+ function ao(n, t) {
283
+ n.classList ? n.classList.add(t) : n.className += " " + t;
284
+ }
285
+ function so(n, t) {
286
+ if (n.classList) n.classList.remove(t);
287
+ else {
288
+ var e = new RegExp("(\\s|^)" + t + "(\\s|$)");
289
+ n.className = n.className.replace(e, " ");
290
+ }
291
+ }
292
+ function It(n, t, e, r) {
293
+ n.addEventListener(t, e, r);
294
+ }
295
+ function Ft(n, t, e, r) {
296
+ n.removeEventListener(t, e, r);
297
+ }
298
+ function Vr(n) {
299
+ return n?.ownerDocument || da;
300
+ }
301
+ function Zr(n) {
302
+ return Vr(n).documentElement;
303
+ }
304
+ function kn(n) {
305
+ return Vr(n).body;
306
+ }
307
+ function Pn(n) {
308
+ var t;
309
+ return ((t = n?.ownerDocument) === null || t === void 0 ? void 0 : t.defaultView) || window;
310
+ }
311
+ function uo(n) {
312
+ return n && "postMessage" in n && "blur" in n && "self" in n;
313
+ }
314
+ function Kr(n) {
315
+ return wn(n) && n.nodeName && n.nodeType && "ownerDocument" in n;
316
+ }
317
+ function va(n, t, e, r, i, o) {
318
+ for (var a = 0; a < i; ++a) {
319
+ var s = e + a * i, u = r + a * i;
320
+ n[s] += n[u] * o, t[s] += t[u] * o;
321
+ }
322
+ }
323
+ function ma(n, t, e, r, i) {
324
+ for (var o = 0; o < i; ++o) {
325
+ var a = e + o * i, s = r + o * i, u = n[a], c = t[a];
326
+ n[a] = n[s], n[s] = u, t[a] = t[s], t[s] = c;
327
+ }
328
+ }
329
+ function ba(n, t, e, r, i) {
330
+ for (var o = 0; o < r; ++o) {
331
+ var a = e + o * r;
332
+ n[a] /= i, t[a] /= i;
333
+ }
334
+ }
335
+ function Gn(n, t) {
336
+ t === void 0 && (t = Math.sqrt(n.length));
337
+ for (var e = n.slice(), r = bt(t), i = 0; i < t; ++i) {
338
+ var o = t * i + i;
339
+ if (!ft(e[o], Tt)) {
340
+ for (var a = i + 1; a < t; ++a) if (e[t * i + a]) {
341
+ ma(e, r, i, a, t);
342
+ break;
343
+ }
344
+ }
345
+ if (!ft(e[o], Tt)) return [];
346
+ for (ba(e, r, i, t, e[o]), a = 0; a < t; ++a) {
347
+ var s = a, u = e[a + i * t];
348
+ ft(u, Tt) && i !== a && va(e, r, s, i, t, -u);
349
+ }
350
+ }
351
+ return r;
352
+ }
353
+ function Pe(n, t) {
354
+ for (var e = n.slice(), r = n.length; r < t - 1; ++r) e[r] = 0;
355
+ return e[t - 1] = 1, e;
356
+ }
357
+ function In(n, t, e) {
358
+ if (t === void 0 && (t = Math.sqrt(n.length)), t === e) return n;
359
+ for (var r = bt(e), i = Math.min(t, e), o = 0; o < i - 1; ++o) {
360
+ for (var a = 0; a < i - 1; ++a) r[o * e + a] = n[o * t + a];
361
+ r[(o + 1) * e - 1] = n[(o + 1) * t - 1], r[(e - 1) * e + o] = n[(t - 1) * t + o];
362
+ }
363
+ return r[e * e - 1] = n[t * t - 1], r;
364
+ }
365
+ function Ke(n) {
366
+ for (var t = [], e = 1; e < arguments.length; e++) t[e - 1] = arguments[e];
367
+ var r = bt(n);
368
+ return t.forEach(function(i) {
369
+ r = Ot(r, i, n);
370
+ }), r;
371
+ }
372
+ function Ot(n, t, e) {
373
+ e === void 0 && (e = Math.sqrt(n.length));
374
+ var r = [], i = n.length / e, o = t.length / i;
375
+ if (!i) return t;
376
+ if (!o) return n;
377
+ for (var a = 0; a < e; ++a) for (var s = 0; s < o; ++s) {
378
+ r[s * e + a] = 0;
379
+ for (var u = 0; u < i; ++u) r[s * e + a] += n[u * e + a] * t[s * i + u];
380
+ }
381
+ return r;
382
+ }
383
+ function St(n, t) {
384
+ for (var e = Math.min(n.length, t.length), r = n.slice(), i = 0; i < e; ++i) r[i] = r[i] + t[i];
385
+ return r;
386
+ }
387
+ function nt(n, t) {
388
+ for (var e = Math.min(n.length, t.length), r = n.slice(), i = 0; i < e; ++i) r[i] = r[i] - t[i];
389
+ return r;
390
+ }
391
+ function xa(n, t) {
392
+ return t === void 0 && (t = n.length === 6), t ? [n[0], n[1], 0, n[2], n[3], 0, n[4], n[5], 1] : n;
393
+ }
394
+ function co(n, t) {
395
+ return t === void 0 && (t = n.length === 9), t ? [n[0], n[1], n[3], n[4], n[6], n[7]] : n;
396
+ }
397
+ function gn(n, t, e) {
398
+ e === void 0 && (e = t.length);
399
+ var r = Ot(n, t, e), i = r[e - 1];
400
+ return r.map(function(o) {
401
+ return o / i;
402
+ });
403
+ }
404
+ function ya(n, t) {
405
+ return Ot(n, [1, 0, 0, 0, 0, Math.cos(t), Math.sin(t), 0, 0, -Math.sin(t), Math.cos(t), 0, 0, 0, 0, 1], 4);
406
+ }
407
+ function Ea(n, t) {
408
+ return Ot(n, [Math.cos(t), 0, -Math.sin(t), 0, 0, 1, 0, 0, Math.sin(t), 0, Math.cos(t), 0, 0, 0, 0, 1], 4);
409
+ }
410
+ function Sa(n, t) {
411
+ return Ot(n, rr(t, 4));
412
+ }
413
+ function Ie(n, t) {
414
+ var e = t[0], r = e === void 0 ? 1 : e, i = t[1], o = i === void 0 ? 1 : i, a = t[2];
415
+ return Ot(n, [r, 0, 0, 0, 0, o, 0, 0, 0, 0, a === void 0 ? 1 : a, 0, 0, 0, 0, 1], 4);
416
+ }
417
+ function ur(n, t) {
418
+ var e = t[0], r = e === void 0 ? 0 : e, i = t[1], o = i === void 0 ? 0 : i, a = t[2];
419
+ return Ot(n, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, r, o, a === void 0 ? 0 : a, 1], 4);
420
+ }
421
+ function Si(n, t) {
422
+ return Ot(n, t, 4);
423
+ }
424
+ function rr(n, t) {
425
+ var e = Math.cos(n), r = Math.sin(n), i = bt(t);
426
+ return i[0] = e, i[1] = r, i[t] = -r, i[t + 1] = e, i;
427
+ }
428
+ function bt(n) {
429
+ for (var t = n * n, e = [], r = 0; r < t; ++r) e[r] = r % (n + 1) ? 0 : 1;
430
+ return e;
431
+ }
432
+ function lo(n, t) {
433
+ for (var e = bt(t), r = Math.min(n.length, t - 1), i = 0; i < r; ++i) e[(t + 1) * i] = n[i];
434
+ return e;
435
+ }
436
+ function Yn(n, t) {
437
+ for (var e = bt(t), r = Math.min(n.length, t - 1), i = 0; i < r; ++i) e[t * (t - 1) + i] = n[i];
438
+ return e;
439
+ }
440
+ function fo(n, t, e, r, i, o, a, s) {
441
+ var u = n[0], c = n[1], p = t[0], f = t[1], l = e[0], d = e[1], h = r[0], g = r[1], v = i[0], m = i[1], x = o[0], y = o[1], E = a[0], S = a[1], b = s[0], w = s[1], _ = Gn([u, 0, p, 0, l, 0, h, 0, c, 0, f, 0, d, 0, g, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, u, 0, p, 0, l, 0, h, 0, c, 0, f, 0, d, 0, g, 0, 1, 0, 1, 0, 1, 0, 1, -v * u, -m * u, -x * p, -y * p, -E * l, -S * l, -b * h, -w * h, -v * c, -m * c, -x * f, -y * f, -E * d, -S * d, -b * g, -w * g], 8);
442
+ if (!_.length) return [];
443
+ var D = Ot(_, [v, m, x, y, E, S, b, w], 8);
444
+ return D[8] = 1, In(function(P, M) {
445
+ M === void 0 && (M = Math.sqrt(P.length));
446
+ for (var T = [], R = 0; R < M; ++R) for (var F = 0; F < M; ++F) T[F * M + R] = P[M * R + F];
447
+ return T;
448
+ }(D), 3, 4);
449
+ }
450
+ var be = function() {
451
+ return be = Object.assign || function(n) {
452
+ for (var t, e = 1, r = arguments.length; e < r; e++) for (var i in t = arguments[e]) Object.prototype.hasOwnProperty.call(t, i) && (n[i] = t[i]);
453
+ return n;
454
+ }, be.apply(this, arguments);
455
+ };
456
+ function Ur(n, t) {
457
+ return t === void 0 && (t = 0), Hn(ne(n, t));
458
+ }
459
+ function Hn(n) {
460
+ var t = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
461
+ return n.forEach(function(e) {
462
+ var r = e.matrixFunction, i = e.functionValue;
463
+ r && (t = r(t, i));
464
+ }), t;
465
+ }
466
+ function ne(n, t) {
467
+ return t === void 0 && (t = 0), (Ht(n) ? n : Me(n)).map(function(e) {
468
+ var r, i = !(r = /([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(e)) || r.length < 4 ? {} : { prefix: r[1], value: r[2], suffix: r[3] }, o = i.prefix, a = i.value, s = null, u = o, c = "";
469
+ if (o === "translate" || o === "translateX" || o === "translate3d") {
470
+ var p = wn(t) ? be(be({}, t), { "o%": t["%"] }) : { "%": t, "o%": t }, f = ve(a).map(function(D, P) {
471
+ return p["%"] = P === 0 && "x%" in p ? t["x%"] : P === 1 && "y%" in p ? t["y%"] : t["o%"], Ut(D, p);
472
+ }), l = f[0], d = f[1], h = d === void 0 ? 0 : d, g = f[2];
473
+ s = ur, c = [l, h, g === void 0 ? 0 : g];
474
+ } else if (o === "translateY")
475
+ s = ur, c = [0, h = Ut(a, wn(t) ? be({ "%": t["y%"] }, t) : { "%": t }), 0];
476
+ else if (o === "translateZ")
477
+ s = ur, c = [0, 0, parseFloat(a)];
478
+ else if (o === "scale" || o === "scale3d") {
479
+ var v = ve(a).map(function(D) {
480
+ return parseFloat(D);
481
+ }), m = v[0], x = v[1], y = x === void 0 ? m : x, E = v[2];
482
+ s = Ie, c = [m, y, E === void 0 ? 1 : E];
483
+ } else if (o === "scaleX")
484
+ s = Ie, c = [m = parseFloat(a), 1, 1];
485
+ else if (o === "scaleY")
486
+ s = Ie, c = [1, y = parseFloat(a), 1];
487
+ else if (o === "scaleZ")
488
+ s = Ie, c = [1, 1, parseFloat(a)];
489
+ else if (o === "rotate" || o === "rotateZ" || o === "rotateX" || o === "rotateY") {
490
+ var S = er(a), b = S.unit, w = S.value;
491
+ o === "rotate" || o === "rotateZ" ? (u = "rotateZ", s = Sa) : o === "rotateX" ? s = ya : o === "rotateY" && (s = Ea), c = b === "rad" ? w : w * Math.PI / 180;
492
+ } else if (o === "matrix3d") s = Si, c = ve(a).map(function(D) {
493
+ return parseFloat(D);
494
+ });
495
+ else if (o === "matrix") {
496
+ var _ = ve(a).map(function(D) {
497
+ return parseFloat(D);
498
+ });
499
+ s = Si, c = [_[0], _[1], 0, 0, _[2], _[3], 0, 0, 0, 0, 1, 0, _[4], _[5], 0, 1];
500
+ } else u = "";
501
+ return { name: o, functionName: u, value: a, matrixFunction: s, functionValue: c };
502
+ });
503
+ }
504
+ var wa = function() {
505
+ function n() {
506
+ this.keys = [], this.values = [];
507
+ }
508
+ var t = n.prototype;
509
+ return t.get = function(e) {
510
+ return this.values[this.keys.indexOf(e)];
511
+ }, t.set = function(e, r) {
512
+ var i = this.keys, o = this.values, a = i.indexOf(e), s = a === -1 ? i.length : a;
513
+ i[s] = e, o[s] = r;
514
+ }, n;
515
+ }(), Ma = function() {
516
+ function n() {
517
+ this.object = {};
518
+ }
519
+ var t = n.prototype;
520
+ return t.get = function(e) {
521
+ return this.object[e];
522
+ }, t.set = function(e, r) {
523
+ this.object[e] = r;
524
+ }, n;
525
+ }(), Da = typeof Map == "function", Ca = function() {
526
+ function n() {
527
+ }
528
+ var t = n.prototype;
529
+ return t.connect = function(e, r) {
530
+ this.prev = e, this.next = r, e && (e.next = this), r && (r.prev = this);
531
+ }, t.disconnect = function() {
532
+ var e = this.prev, r = this.next;
533
+ e && (e.next = r), r && (r.prev = e);
534
+ }, t.getIndex = function() {
535
+ for (var e = this, r = -1; e; ) e = e.prev, ++r;
536
+ return r;
537
+ }, n;
538
+ }(), _a = function() {
539
+ function n(e, r, i, o, a, s, u, c) {
540
+ this.prevList = e, this.list = r, this.added = i, this.removed = o, this.changed = a, this.maintained = s, this.changedBeforeAdded = u, this.fixed = c;
541
+ }
542
+ var t = n.prototype;
543
+ return Object.defineProperty(t, "ordered", { get: function() {
544
+ return this.cacheOrdered || this.caculateOrdered(), this.cacheOrdered;
545
+ }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "pureChanged", { get: function() {
546
+ return this.cachePureChanged || this.caculateOrdered(), this.cachePureChanged;
547
+ }, enumerable: !0, configurable: !0 }), t.caculateOrdered = function() {
548
+ var e = function(o, a) {
549
+ var s = [], u = [];
550
+ return o.forEach(function(c) {
551
+ var p = c[0], f = c[1], l = new Ca();
552
+ s[p] = l, u[f] = l;
553
+ }), s.forEach(function(c, p) {
554
+ c.connect(s[p - 1]);
555
+ }), o.filter(function(c, p) {
556
+ return !a[p];
557
+ }).map(function(c, p) {
558
+ var f = c[0], l = c[1];
559
+ if (f === l) return [0, 0];
560
+ var d = s[f], h = u[l - 1], g = d.getIndex();
561
+ return d.disconnect(), h ? d.connect(h, h.next) : d.connect(void 0, s[0]), [g, d.getIndex()];
562
+ });
563
+ }(this.changedBeforeAdded, this.fixed), r = this.changed, i = [];
564
+ this.cacheOrdered = e.filter(function(o, a) {
565
+ var s = o[0], u = o[1], c = r[a], p = c[0], f = c[1];
566
+ if (s !== u) return i.push([p, f]), !0;
567
+ }), this.cachePureChanged = i;
568
+ }, n;
569
+ }();
570
+ function po(n, t, e) {
571
+ var r = Da ? Map : e ? Ma : wa, i = e || function(x) {
572
+ return x;
573
+ }, o = [], a = [], s = [], u = n.map(i), c = t.map(i), p = new r(), f = new r(), l = [], d = [], h = {}, g = [], v = 0, m = 0;
574
+ return u.forEach(function(x, y) {
575
+ p.set(x, y);
576
+ }), c.forEach(function(x, y) {
577
+ f.set(x, y);
578
+ }), u.forEach(function(x, y) {
579
+ var E = f.get(x);
580
+ E === void 0 ? (++m, a.push(y)) : h[E] = m;
581
+ }), c.forEach(function(x, y) {
582
+ var E = p.get(x);
583
+ E === void 0 ? (o.push(y), ++v) : (s.push([E, y]), m = h[y] || 0, l.push([E - m, y - v]), d.push(y === E), E !== y && g.push([E, y]));
584
+ }), a.reverse(), new _a(n, t, o, a, g, s, l, d);
585
+ }
586
+ var Ta = function() {
587
+ function n(t, e) {
588
+ t === void 0 && (t = []), this.findKeyCallback = e, this.list = [].slice.call(t);
589
+ }
590
+ return n.prototype.update = function(t) {
591
+ var e = [].slice.call(t), r = po(this.list, e, this.findKeyCallback);
592
+ return this.list = e, r;
593
+ }, n;
594
+ }(), Cr = function(n, t) {
595
+ return Cr = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
596
+ e.__proto__ = r;
597
+ } || function(e, r) {
598
+ for (var i in r) r.hasOwnProperty(i) && (e[i] = r[i]);
599
+ }, Cr(n, t);
600
+ }, wi, Oa = typeof Map == "function" ? void 0 : (wi = 0, function(n) {
601
+ return n.__DIFF_KEY__ || (n.__DIFF_KEY__ = ++wi);
602
+ }), ho = function(n) {
603
+ function t(e) {
604
+ return e === void 0 && (e = []), n.call(this, e, Oa) || this;
605
+ }
606
+ return function(e, r) {
607
+ function i() {
608
+ this.constructor = e;
609
+ }
610
+ Cr(e, r), e.prototype = r === null ? Object.create(r) : (i.prototype = r.prototype, new i());
611
+ }(t, n), t;
612
+ }(Ta), _r = function() {
613
+ return _r = Object.assign || function(n) {
614
+ for (var t, e = 1, r = arguments.length; e < r; e++) for (var i in t = arguments[e]) Object.prototype.hasOwnProperty.call(t, i) && (n[i] = t[i]);
615
+ return n;
616
+ }, _r.apply(this, arguments);
617
+ }, go = function() {
618
+ function n() {
619
+ this._events = {};
620
+ }
621
+ var t = n.prototype;
622
+ return t.on = function(e, r) {
623
+ if (wn(e)) for (var i in e) this.on(i, e[i]);
624
+ else this._addEvent(e, r, {});
625
+ return this;
626
+ }, t.off = function(e, r) {
627
+ if (e) if (wn(e)) for (var i in e) this.off(i);
628
+ else if (r) {
629
+ var o = this._events[e];
630
+ if (o) {
631
+ var a = te(o, function(s) {
632
+ return s.listener === r;
633
+ });
634
+ a > -1 && o.splice(a, 1);
635
+ }
636
+ } else this._events[e] = [];
637
+ else this._events = {};
638
+ return this;
639
+ }, t.once = function(e, r) {
640
+ var i = this;
641
+ return r && this._addEvent(e, r, { once: !0 }), new Promise(function(o) {
642
+ i._addEvent(e, o, { once: !0 });
643
+ });
644
+ }, t.emit = function(e, r) {
645
+ var i = this;
646
+ r === void 0 && (r = {});
647
+ var o = this._events[e];
648
+ if (!e || !o) return !0;
649
+ var a = !1;
650
+ return r.eventType = e, r.stop = function() {
651
+ a = !0;
652
+ }, r.currentTarget = this, function() {
653
+ for (var s = 0, u = 0, c = arguments.length; u < c; u++) s += arguments[u].length;
654
+ var p = Array(s), f = 0;
655
+ for (u = 0; u < c; u++) for (var l = arguments[u], d = 0, h = l.length; d < h; d++, f++) p[f] = l[d];
656
+ return p;
657
+ }(o).forEach(function(s) {
658
+ s.listener(r), s.once && i.off(e, s.listener);
659
+ }), !a;
660
+ }, t.trigger = function(e, r) {
661
+ return r === void 0 && (r = {}), this.emit(e, r);
662
+ }, t._addEvent = function(e, r, i) {
663
+ var o = this._events;
664
+ o[e] = o[e] || [], o[e].push(_r({ listener: r }, i));
665
+ }, n;
666
+ }();
667
+ function Kt(n) {
668
+ return ft(n, Tt);
669
+ }
670
+ function Mi(n) {
671
+ return n.length < 3 ? 0 : Math.abs(function(t) {
672
+ for (var e = 0, r = t.length - 1; r >= 0; --r) e += t[r];
673
+ return e;
674
+ }(n.map(function(t, e) {
675
+ var r = n[e + 1] || n[0];
676
+ return t[0] * r[1] - r[0] * t[1];
677
+ }))) / 2;
678
+ }
679
+ function Di(n, t) {
680
+ var e = t.width, r = t.height, i = t.left, o = t.top, a = Un(n), s = a.minX, u = a.minY, c = a.maxX, p = a.maxY, f = e / (c - s), l = r / (p - u);
681
+ return n.map(function(d) {
682
+ return [i + (d[0] - s) * f, o + (d[1] - u) * l];
683
+ });
684
+ }
685
+ function Un(n) {
686
+ var t = n.map(function(r) {
687
+ return r[0];
688
+ }), e = n.map(function(r) {
689
+ return r[1];
690
+ });
691
+ return { minX: Math.min.apply(Math, t), minY: Math.min.apply(Math, e), maxX: Math.max.apply(Math, t), maxY: Math.max.apply(Math, e) };
692
+ }
693
+ function Tr(n, t, e) {
694
+ var r = n[0], i = n[1], o = Un(t), a = o.minX, s = o.maxX, u = [[a, i], [s, i]], c = Ue(u[0], u[1]), p = Or(t), f = [];
695
+ if (p.forEach(function(h) {
696
+ var g, v = Ue(h[0], h[1]), m = h[0];
697
+ g = v, c.every(function(x, y) {
698
+ return Kt(x - g[y]) === 0;
699
+ }) ? f.push({ pos: n, line: h, type: "line" }) : vo($r(c, v), [u, h]).forEach(function(x) {
700
+ h.some(function(y) {
701
+ return S = x, !Kt((E = y)[0] - S[0]) && !Kt(E[1] - S[1]);
702
+ var E, S;
703
+ }) ? f.push({ pos: x, line: h, type: "point" }) : Kt(m[1] - i) !== 0 && f.push({ pos: x, line: h, type: "intersection" });
704
+ });
705
+ }), un(f, function(h) {
706
+ return h[0] === r;
707
+ })) return !0;
708
+ var l = 0, d = {};
709
+ return f.forEach(function(h) {
710
+ var g = h.pos, v = h.type, m = h.line;
711
+ if (!(g[0] > r)) if (v === "intersection") ++l;
712
+ else {
713
+ if (v === "line") return;
714
+ if (v === "point") {
715
+ var x = un(m, function(S) {
716
+ return S[1] !== i;
717
+ }), y = d[g[0]], E = x[1] > i ? 1 : -1;
718
+ y ? y !== E && ++l : d[g[0]] = E;
719
+ }
720
+ }
721
+ }), l % 2 == 1;
722
+ }
723
+ function Ue(n, t) {
724
+ var e = n[0], r = n[1], i = t[0] - e, o = t[1] - r;
725
+ Math.abs(i) < Tt && (i = 0), Math.abs(o) < Tt && (o = 0);
726
+ var a = 0, s = 0, u = 0;
727
+ return i ? o ? (s = 1, u = -(a = -o / i) * e - r) : (s = 1, u = -r) : o && (a = -1, u = e), [a, s, u];
728
+ }
729
+ function $r(n, t) {
730
+ var e = n[0], r = n[1], i = n[2], o = t[0], a = t[1], s = t[2], u = e === 0 && o === 0, c = r === 0 && a === 0, p = [];
731
+ if (u && c) return [];
732
+ if (u) {
733
+ var f = -i / r;
734
+ return f !== -s / a ? [] : [[-1 / 0, f], [1 / 0, f]];
735
+ }
736
+ if (c) {
737
+ var l = -i / e;
738
+ return l !== -s / o ? [] : [[l, -1 / 0], [l, 1 / 0]];
739
+ }
740
+ if (e === 0) p = [[d = -(a * (h = -i / r) + s) / o, h]];
741
+ else if (o === 0)
742
+ p = [[d = -(r * (h = -s / a) + i) / e, h]];
743
+ else if (r === 0)
744
+ p = [[d = -i / e, h = -(o * d + s) / a]];
745
+ else if (a === 0)
746
+ p = [[d = -s / o, h = -(e * d + i) / r]];
747
+ else {
748
+ var d, h;
749
+ p = [[d = (r * s - a * i) / (a * e - r * o), h = -(e * d + i) / r]];
750
+ }
751
+ return p.map(function(g) {
752
+ return [g[0], g[1]];
753
+ });
754
+ }
755
+ function vo(n, t) {
756
+ var e = t.map(function(f) {
757
+ return [0, 1].map(function(l) {
758
+ return [Math.min(f[0][l], f[1][l]), Math.max(f[0][l], f[1][l])];
759
+ });
760
+ }), r = [];
761
+ if (n.length === 2) {
762
+ var i = n[0], o = i[0], a = i[1];
763
+ if (Kt(o - n[1][0])) {
764
+ if (!Kt(a - n[1][1])) {
765
+ var s = Math.max.apply(Math, e.map(function(f) {
766
+ return f[0][0];
767
+ })), u = Math.min.apply(Math, e.map(function(f) {
768
+ return f[0][1];
769
+ }));
770
+ if (Kt(s - u) > 0) return [];
771
+ r = [[s, a], [u, a]];
772
+ }
773
+ } else {
774
+ var c = Math.max.apply(Math, e.map(function(f) {
775
+ return f[1][0];
776
+ })), p = Math.min.apply(Math, e.map(function(f) {
777
+ return f[1][1];
778
+ }));
779
+ if (Kt(c - p) > 0) return [];
780
+ r = [[o, c], [o, p]];
781
+ }
782
+ }
783
+ return r.length || (r = n.filter(function(f) {
784
+ var l = f[0], d = f[1];
785
+ return e.every(function(h) {
786
+ return 0 <= Kt(l - h[0][0]) && 0 <= Kt(h[0][1] - l) && 0 <= Kt(d - h[1][0]) && 0 <= Kt(h[1][1] - d);
787
+ });
788
+ })), r.map(function(f) {
789
+ return [Kt(f[0]), Kt(f[1])];
790
+ });
791
+ }
792
+ function Or(n) {
793
+ return function() {
794
+ for (var t = 0, e = 0, r = arguments.length; e < r; e++) t += arguments[e].length;
795
+ var i = Array(t), o = 0;
796
+ for (e = 0; e < r; e++) for (var a = arguments[e], s = 0, u = a.length; s < u; s++, o++) i[o] = a[s];
797
+ return i;
798
+ }(n.slice(1), [n[0]]).map(function(t, e) {
799
+ return [n[e], t];
800
+ });
801
+ }
802
+ function Pa(n, t) {
803
+ var e = function(r, i) {
804
+ var o = r.slice(), a = i.slice();
805
+ yi(o) === -1 && o.reverse(), yi(a) === -1 && a.reverse();
806
+ var s = Or(o), u = Or(a), c = s.map(function(d) {
807
+ return Ue(d[0], d[1]);
808
+ }), p = u.map(function(d) {
809
+ return Ue(d[0], d[1]);
810
+ }), f = [];
811
+ c.forEach(function(d, h) {
812
+ var g = s[h], v = [];
813
+ p.forEach(function(m, x) {
814
+ var y = vo($r(d, m), [g, u[x]]);
815
+ v.push.apply(v, y.map(function(E) {
816
+ return { index1: h, index2: x, pos: E, type: "intersection" };
817
+ }));
818
+ }), v.sort(function(m, x) {
819
+ return me(g[0], m.pos) - me(g[0], x.pos);
820
+ }), f.push.apply(f, v), Tr(g[1], a) && f.push({ index1: h, index2: -1, pos: g[1], type: "inside" });
821
+ }), u.forEach(function(d, h) {
822
+ if (Tr(d[1], o)) {
823
+ var g = !1, v = te(f, function(m) {
824
+ return m.index2 === h ? (g = !0, !1) : !!g;
825
+ });
826
+ v === -1 && (g = !1, v = te(f, function(m) {
827
+ var x = m.index1, y = m.index2;
828
+ return x === -1 && y + 1 === h ? (g = !0, !1) : !!g;
829
+ })), v === -1 ? f.push({ index1: -1, index2: h, pos: d[1], type: "inside" }) : f.splice(v, 0, { index1: -1, index2: h, pos: d[1], type: "inside" });
830
+ }
831
+ });
832
+ var l = {};
833
+ return f.filter(function(d) {
834
+ var h = d.pos, g = h[0] + "x" + h[1];
835
+ return !l[g] && (l[g] = !0, !0);
836
+ });
837
+ }(n, t);
838
+ return e.map(function(r) {
839
+ return r.pos;
840
+ });
841
+ }
842
+ var Pr = function(n, t) {
843
+ return Pr = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
844
+ e.__proto__ = r;
845
+ } || function(e, r) {
846
+ for (var i in r) r.hasOwnProperty(i) && (e[i] = r[i]);
847
+ }, Pr(n, t);
848
+ }, _t = function() {
849
+ return _t = Object.assign || function(n) {
850
+ for (var t, e = 1, r = arguments.length; e < r; e++) for (var i in t = arguments[e]) Object.prototype.hasOwnProperty.call(t, i) && (n[i] = t[i]);
851
+ return n;
852
+ }, _t.apply(this, arguments);
853
+ };
854
+ function cr(n) {
855
+ return 180 * (t = [n[0].clientX, n[0].clientY], e = [n[1].clientX, n[1].clientY], r = e[0] - t[0], i = e[1] - t[1], ((o = Math.atan2(i, r)) >= 0 ? o : o + 2 * Math.PI) / Math.PI);
856
+ var t, e, r, i, o;
857
+ }
858
+ function Ye(n) {
859
+ return n ? n.touches ? function(t) {
860
+ for (var e = Math.min(t.length, 2), r = [], i = 0; i < e; ++i) r.push(_i(t[i]));
861
+ return r;
862
+ }(n.touches) : [_i(n)] : [];
863
+ }
864
+ function Ci(n, t, e) {
865
+ var r = e.length, i = xe(n, r), o = i.clientX, a = i.clientY, s = i.originalClientX, u = i.originalClientY, c = xe(t, r), p = c.clientX, f = c.clientY, l = xe(e, r);
866
+ return { clientX: s, clientY: u, deltaX: o - p, deltaY: a - f, distX: o - l.clientX, distY: a - l.clientY };
867
+ }
868
+ function lr(n) {
869
+ return Math.sqrt(Math.pow(n[0].clientX - n[1].clientX, 2) + Math.pow(n[0].clientY - n[1].clientY, 2));
870
+ }
871
+ function _i(n) {
872
+ return { clientX: n.clientX, clientY: n.clientY };
873
+ }
874
+ function xe(n, t) {
875
+ t === void 0 && (t = n.length);
876
+ for (var e = { clientX: 0, clientY: 0, originalClientX: 0, originalClientY: 0 }, r = Math.min(n.length, t), i = 0; i < r; ++i) {
877
+ var o = n[i];
878
+ e.originalClientX += "originalClientX" in o ? o.originalClientX : o.clientX, e.originalClientY += "originalClientY" in o ? o.originalClientY : o.clientY, e.clientX += o.clientX, e.clientY += o.clientY;
879
+ }
880
+ return t ? { clientX: e.clientX / t, clientY: e.clientY / t, originalClientX: e.originalClientX / t, originalClientY: e.originalClientY / t } : e;
881
+ }
882
+ var fr = function() {
883
+ function n(t) {
884
+ this.prevClients = [], this.startClients = [], this.movement = 0, this.length = 0, this.startClients = t, this.prevClients = t, this.length = t.length;
885
+ }
886
+ return n.prototype.getAngle = function(t) {
887
+ return t === void 0 && (t = this.prevClients), cr(t);
888
+ }, n.prototype.getRotation = function(t) {
889
+ return t === void 0 && (t = this.prevClients), cr(t) - cr(this.startClients);
890
+ }, n.prototype.getPosition = function(t, e) {
891
+ t === void 0 && (t = this.prevClients);
892
+ var r = Ci(t || this.prevClients, this.prevClients, this.startClients), i = r.deltaX, o = r.deltaY;
893
+ return this.movement += Math.sqrt(i * i + o * o), this.prevClients = t, r;
894
+ }, n.prototype.getPositions = function(t) {
895
+ t === void 0 && (t = this.prevClients);
896
+ for (var e = this.prevClients, r = this.startClients, i = Math.min(this.length, e.length), o = [], a = 0; a < i; ++a) o[a] = Ci([t[a]], [e[a]], [r[a]]);
897
+ return o;
898
+ }, n.prototype.getMovement = function(t) {
899
+ var e = this.movement;
900
+ if (!t) return e;
901
+ var r = xe(t, this.length), i = xe(this.prevClients, this.length), o = r.clientX - i.clientX, a = r.clientY - i.clientY;
902
+ return Math.sqrt(o * o + a * a) + e;
903
+ }, n.prototype.getDistance = function(t) {
904
+ return t === void 0 && (t = this.prevClients), lr(t);
905
+ }, n.prototype.getScale = function(t) {
906
+ return t === void 0 && (t = this.prevClients), lr(t) / lr(this.startClients);
907
+ }, n.prototype.move = function(t, e) {
908
+ this.startClients.forEach(function(r) {
909
+ r.clientX -= t, r.clientY -= e;
910
+ }), this.prevClients.forEach(function(r) {
911
+ r.clientX -= t, r.clientY -= e;
912
+ });
913
+ }, n;
914
+ }(), Ti = ["textarea", "input"], Ra = function(n) {
915
+ function t(e, r) {
916
+ r === void 0 && (r = {});
917
+ var i = n.call(this) || this;
918
+ i.options = {}, i.flag = !1, i.pinchFlag = !1, i.data = {}, i.isDrag = !1, i.isPinch = !1, i.clientStores = [], i.targets = [], i.prevTime = 0, i.doubleFlag = !1, i._useMouse = !1, i._useTouch = !1, i._useDrag = !1, i._dragFlag = !1, i._isTrusted = !1, i._isMouseEvent = !1, i._isSecondaryButton = !1, i._preventMouseEvent = !1, i._prevInputEvent = null, i._isDragAPI = !1, i._isIdle = !0, i._preventMouseEventId = 0, i._window = window, i.onDragStart = function(l, d) {
919
+ if (d === void 0 && (d = !0), i.flag || l.cancelable !== !1) {
920
+ var h = l.type.indexOf("drag") >= -1;
921
+ if (!i.flag || !h) {
922
+ i._isDragAPI = !0;
923
+ var g = i.options, v = g.container, m = g.pinchOutside, x = g.preventWheelClick, y = g.preventRightClick, E = g.preventDefault, S = g.checkInput, b = g.dragFocusedInput, w = g.preventClickEventOnDragStart, _ = g.preventClickEventOnDrag, D = g.preventClickEventByCondition, P = i._useTouch, M = !i.flag;
924
+ if (i._isSecondaryButton = l.which === 3 || l.button === 2, x && (l.which === 2 || l.button === 1) || y && (l.which === 3 || l.button === 2)) return i.stop(), !1;
925
+ if (M) {
926
+ var T = i._window.document.activeElement, R = l.target;
927
+ if (R) {
928
+ var F = R.tagName.toLowerCase(), z = Ti.indexOf(F) > -1, B = R.isContentEditable;
929
+ if (z || B) {
930
+ if (S || !b && T === R) return !1;
931
+ if (T && (T === R || B && T.isContentEditable && T.contains(R))) {
932
+ if (!b) return !1;
933
+ R.blur();
934
+ }
935
+ } else if ((E || l.type === "touchstart") && T) {
936
+ var G = T.tagName.toLowerCase();
937
+ (T.isContentEditable || Ti.indexOf(G) > -1) && T.blur();
938
+ }
939
+ (w || _ || D) && It(i._window, "click", i._onClick, !0);
940
+ }
941
+ i.clientStores = [new fr(Ye(l))], i._isIdle = !1, i.flag = !0, i.isDrag = !1, i._isTrusted = d, i._dragFlag = !0, i._prevInputEvent = l, i.data = {}, i.doubleFlag = Ze() - i.prevTime < 200, i._isMouseEvent = function(I) {
942
+ return I && (I.type.indexOf("mouse") > -1 || "button" in I);
943
+ }(l), !i._isMouseEvent && i._preventMouseEvent && i._allowMouseEvent(), (i._preventMouseEvent || i.emit("dragStart", _t(_t({ data: i.data, datas: i.data, inputEvent: l, isMouseEvent: i._isMouseEvent, isSecondaryButton: i._isSecondaryButton, isTrusted: d, isDouble: i.doubleFlag }, i.getCurrentStore().getPosition()), { preventDefault: function() {
944
+ l.preventDefault();
945
+ }, preventDrag: function() {
946
+ i._dragFlag = !1;
947
+ } }))) === !1 && i.stop(), i._isMouseEvent && i.flag && E && l.preventDefault();
948
+ }
949
+ if (!i.flag) return !1;
950
+ var k = 0;
951
+ if (M ? (i._attchDragEvent(), P && m && (k = setTimeout(function() {
952
+ It(v, "touchstart", i.onDragStart, { passive: !1 });
953
+ }))) : P && m && Ft(v, "touchstart", i.onDragStart), i.flag && function(I) {
954
+ return I.touches && I.touches.length >= 2;
955
+ }(l)) {
956
+ if (clearTimeout(k), M && l.touches.length !== l.changedTouches.length) return;
957
+ i.pinchFlag || i.onPinchStart(l);
958
+ }
959
+ }
960
+ }
961
+ }, i.onDrag = function(l, d) {
962
+ if (i.flag) {
963
+ var h = i.options.preventDefault;
964
+ !i._isMouseEvent && h && l.preventDefault(), i._prevInputEvent = l;
965
+ var g = Ye(l), v = i.moveClients(g, l, !1);
966
+ if (i._dragFlag) {
967
+ if ((i.pinchFlag || v.deltaX || v.deltaY) && (i._preventMouseEvent || i.emit("drag", _t(_t({}, v), { isScroll: !!d, inputEvent: l }))) === !1) return void i.stop();
968
+ i.pinchFlag && i.onPinch(l, g);
969
+ }
970
+ i.getCurrentStore().getPosition(g, !0);
971
+ }
972
+ }, i.onDragEnd = function(l) {
973
+ if (i.flag) {
974
+ var d = i.options, h = d.pinchOutside, g = d.container, v = d.preventClickEventOnDrag, m = d.preventClickEventOnDragStart, x = d.preventClickEventByCondition, y = i.isDrag;
975
+ (v || m || x) && requestAnimationFrame(function() {
976
+ i._allowClickEvent();
977
+ }), x || m || !v || y || i._allowClickEvent(), i._useTouch && h && Ft(g, "touchstart", i.onDragStart), i.pinchFlag && i.onPinchEnd(l);
978
+ var E = l?.touches ? Ye(l) : [];
979
+ E.length !== 0 && i.options.keepDragging ? i._addStore(new fr(E)) : i.flag = !1;
980
+ var S = i._getPosition(), b = Ze(), w = !y && i.doubleFlag;
981
+ i._prevInputEvent = null, i.prevTime = y || w ? 0 : b, i.flag || (i._dettachDragEvent(), i._preventMouseEvent || i.emit("dragEnd", _t({ data: i.data, datas: i.data, isDouble: w, isDrag: y, isClick: !y, isMouseEvent: i._isMouseEvent, isSecondaryButton: i._isSecondaryButton, inputEvent: l, isTrusted: i._isTrusted }, S)), i.clientStores = [], i._isMouseEvent || (i._preventMouseEvent = !0, clearTimeout(i._preventMouseEventId), i._preventMouseEventId = setTimeout(function() {
982
+ i._preventMouseEvent = !1;
983
+ }, 200)), i._isIdle = !0);
984
+ }
985
+ }, i.onBlur = function() {
986
+ i.onDragEnd();
987
+ }, i._allowClickEvent = function() {
988
+ Ft(i._window, "click", i._onClick, !0);
989
+ }, i._onClick = function(l) {
990
+ i._allowClickEvent(), i._allowMouseEvent();
991
+ var d = i.options.preventClickEventByCondition;
992
+ d?.(l) || (l.stopPropagation(), l.preventDefault());
993
+ }, i._onContextMenu = function(l) {
994
+ i.options.preventRightClick ? i.onDragEnd(l) : l.preventDefault();
995
+ }, i._passCallback = function() {
996
+ };
997
+ var o = [].concat(e), a = o[0];
998
+ i._window = uo(a) ? a : Pn(a), i.options = _t({ checkInput: !1, container: a && !("document" in a) ? Pn(a) : a, preventRightClick: !0, preventWheelClick: !0, preventClickEventOnDragStart: !1, preventClickEventOnDrag: !1, preventClickEventByCondition: null, preventDefault: !0, checkWindowBlur: !1, keepDragging: !1, pinchThreshold: 0, events: ["touch", "mouse"] }, r);
999
+ var s = i.options, u = s.container, c = s.events, p = s.checkWindowBlur;
1000
+ if (i._useDrag = c.indexOf("drag") > -1, i._useTouch = c.indexOf("touch") > -1, i._useMouse = c.indexOf("mouse") > -1, i.targets = o, i._useDrag && o.forEach(function(l) {
1001
+ It(l, "dragstart", i.onDragStart);
1002
+ }), i._useMouse && (o.forEach(function(l) {
1003
+ It(l, "mousedown", i.onDragStart), It(l, "mousemove", i._passCallback);
1004
+ }), It(u, "contextmenu", i._onContextMenu)), p && It(Pn(), "blur", i.onBlur), i._useTouch) {
1005
+ var f = { passive: !1 };
1006
+ o.forEach(function(l) {
1007
+ It(l, "touchstart", i.onDragStart, f), It(l, "touchmove", i._passCallback, f);
1008
+ });
1009
+ }
1010
+ return i;
1011
+ }
1012
+ return function(e, r) {
1013
+ function i() {
1014
+ this.constructor = e;
1015
+ }
1016
+ Pr(e, r), e.prototype = r === null ? Object.create(r) : (i.prototype = r.prototype, new i());
1017
+ }(t, n), t.prototype.stop = function() {
1018
+ this.isDrag = !1, this.data = {}, this.clientStores = [], this.pinchFlag = !1, this.doubleFlag = !1, this.prevTime = 0, this.flag = !1, this._isIdle = !0, this._allowClickEvent(), this._dettachDragEvent(), this._isDragAPI = !1;
1019
+ }, t.prototype.getMovement = function(e) {
1020
+ return this.getCurrentStore().getMovement(e) + this.clientStores.slice(1).reduce(function(r, i) {
1021
+ return r + i.movement;
1022
+ }, 0);
1023
+ }, t.prototype.isDragging = function() {
1024
+ return this.isDrag;
1025
+ }, t.prototype.isIdle = function() {
1026
+ return this._isIdle;
1027
+ }, t.prototype.isFlag = function() {
1028
+ return this.flag;
1029
+ }, t.prototype.isPinchFlag = function() {
1030
+ return this.pinchFlag;
1031
+ }, t.prototype.isDoubleFlag = function() {
1032
+ return this.doubleFlag;
1033
+ }, t.prototype.isPinching = function() {
1034
+ return this.isPinch;
1035
+ }, t.prototype.scrollBy = function(e, r, i, o) {
1036
+ o === void 0 && (o = !0), this.flag && (this.clientStores[0].move(e, r), o && this.onDrag(i, !0));
1037
+ }, t.prototype.move = function(e, r) {
1038
+ var i = e[0], o = e[1], a = this.getCurrentStore().prevClients;
1039
+ return this.moveClients(a.map(function(s) {
1040
+ var u = s.clientX, c = s.clientY;
1041
+ return { clientX: u + i, clientY: c + o, originalClientX: u, originalClientY: c };
1042
+ }), r, !0);
1043
+ }, t.prototype.triggerDragStart = function(e) {
1044
+ this.onDragStart(e, !1);
1045
+ }, t.prototype.setEventData = function(e) {
1046
+ var r = this.data;
1047
+ for (var i in e) r[i] = e[i];
1048
+ return this;
1049
+ }, t.prototype.setEventDatas = function(e) {
1050
+ return this.setEventData(e);
1051
+ }, t.prototype.getCurrentEvent = function(e) {
1052
+ return e === void 0 && (e = this._prevInputEvent), _t(_t({ data: this.data, datas: this.data }, this._getPosition()), { movement: this.getMovement(), isDrag: this.isDrag, isPinch: this.isPinch, isScroll: !1, inputEvent: e });
1053
+ }, t.prototype.getEventData = function() {
1054
+ return this.data;
1055
+ }, t.prototype.getEventDatas = function() {
1056
+ return this.data;
1057
+ }, t.prototype.unset = function() {
1058
+ var e = this, r = this.targets, i = this.options.container;
1059
+ this.off(), Ft(this._window, "blur", this.onBlur), this._useDrag && r.forEach(function(o) {
1060
+ Ft(o, "dragstart", e.onDragStart);
1061
+ }), this._useMouse && (r.forEach(function(o) {
1062
+ Ft(o, "mousedown", e.onDragStart);
1063
+ }), Ft(i, "contextmenu", this._onContextMenu)), this._useTouch && (r.forEach(function(o) {
1064
+ Ft(o, "touchstart", e.onDragStart);
1065
+ }), Ft(i, "touchstart", this.onDragStart)), this._prevInputEvent = null, this._allowClickEvent(), this._dettachDragEvent();
1066
+ }, t.prototype.onPinchStart = function(e) {
1067
+ var r = this, i = this.options.pinchThreshold;
1068
+ if (!(this.isDrag && this.getMovement() > i)) {
1069
+ var o = new fr(Ye(e));
1070
+ this.pinchFlag = !0, this._addStore(o), this.emit("pinchStart", _t(_t({ data: this.data, datas: this.data, angle: o.getAngle(), touches: this.getCurrentStore().getPositions() }, o.getPosition()), { inputEvent: e, isTrusted: this._isTrusted, preventDefault: function() {
1071
+ e.preventDefault();
1072
+ }, preventDrag: function() {
1073
+ r._dragFlag = !1;
1074
+ } })) === !1 && (this.pinchFlag = !1);
1075
+ }
1076
+ }, t.prototype.onPinch = function(e, r) {
1077
+ if (this.flag && this.pinchFlag && !(r.length < 2)) {
1078
+ var i = this.getCurrentStore();
1079
+ this.isPinch = !0, this.emit("pinch", _t(_t({ data: this.data, datas: this.data, movement: this.getMovement(r), angle: i.getAngle(r), rotation: i.getRotation(r), touches: i.getPositions(r), scale: i.getScale(r), distance: i.getDistance(r) }, i.getPosition(r)), { inputEvent: e, isTrusted: this._isTrusted }));
1080
+ }
1081
+ }, t.prototype.onPinchEnd = function(e) {
1082
+ if (this.pinchFlag) {
1083
+ var r = this.isPinch;
1084
+ this.isPinch = !1, this.pinchFlag = !1;
1085
+ var i = this.getCurrentStore();
1086
+ this.emit("pinchEnd", _t(_t({ data: this.data, datas: this.data, isPinch: r, touches: i.getPositions() }, i.getPosition()), { inputEvent: e }));
1087
+ }
1088
+ }, t.prototype.getCurrentStore = function() {
1089
+ return this.clientStores[0];
1090
+ }, t.prototype.moveClients = function(e, r, i) {
1091
+ var o = this._getPosition(e, i), a = this.isDrag;
1092
+ (o.deltaX || o.deltaY) && (this.isDrag = !0);
1093
+ var s = !1;
1094
+ return !a && this.isDrag && (s = !0), _t(_t({ data: this.data, datas: this.data }, o), { movement: this.getMovement(e), isDrag: this.isDrag, isPinch: this.isPinch, isScroll: !1, isMouseEvent: this._isMouseEvent, isSecondaryButton: this._isSecondaryButton, inputEvent: r, isTrusted: this._isTrusted, isFirstDrag: s });
1095
+ }, t.prototype._addStore = function(e) {
1096
+ this.clientStores.splice(0, 0, e);
1097
+ }, t.prototype._getPosition = function(e, r) {
1098
+ var i = this.getCurrentStore().getPosition(e, r), o = this.clientStores.slice(1).reduce(function(u, c) {
1099
+ var p = c.getPosition();
1100
+ return u.distX += p.distX, u.distY += p.distY, u;
1101
+ }, i), a = o.distX, s = o.distY;
1102
+ return _t(_t({}, i), { distX: a, distY: s });
1103
+ }, t.prototype._attchDragEvent = function() {
1104
+ var e = this._window, r = this.options.container, i = { passive: !1 };
1105
+ this._isDragAPI && (It(r, "dragover", this.onDrag, i), It(e, "dragend", this.onDragEnd)), this._useMouse && (It(r, "mousemove", this.onDrag), It(e, "mouseup", this.onDragEnd)), this._useTouch && (It(r, "touchmove", this.onDrag, i), It(e, "touchend", this.onDragEnd, i), It(e, "touchcancel", this.onDragEnd, i));
1106
+ }, t.prototype._dettachDragEvent = function() {
1107
+ var e = this._window, r = this.options.container;
1108
+ this._isDragAPI && (Ft(r, "dragover", this.onDrag), Ft(e, "dragend", this.onDragEnd)), this._useMouse && (Ft(r, "mousemove", this.onDrag), Ft(e, "mouseup", this.onDragEnd)), this._useTouch && (Ft(r, "touchstart", this.onDragStart), Ft(r, "touchmove", this.onDrag), Ft(e, "touchend", this.onDragEnd), Ft(e, "touchcancel", this.onDragEnd));
1109
+ }, t.prototype._allowMouseEvent = function() {
1110
+ this._preventMouseEvent = !1, clearTimeout(this._preventMouseEventId);
1111
+ }, t;
1112
+ }(go), ka = function(n) {
1113
+ for (var t = 5381, e = n.length; e; ) t = 33 * t ^ n.charCodeAt(--e);
1114
+ return t >>> 0;
1115
+ };
1116
+ function Ba(n, t, e, r, i) {
1117
+ var o = Vr(r), a = o.createElement("style");
1118
+ return a.setAttribute("type", "text/css"), a.setAttribute("data-styled-id", n), a.setAttribute("data-styled-count", "1"), e.nonce && a.setAttribute("nonce", e.nonce), a.innerHTML = function(s, u, c) {
1119
+ return c.original ? u : u.replace(/([^};{\s}][^};{]*|^\s*){/gm, function(p, f) {
1120
+ var l = f.trim();
1121
+ return (l ? ve(l) : [""]).map(function(d) {
1122
+ var h = d.trim();
1123
+ return h.indexOf("@") === 0 ? h : h.indexOf(":global") > -1 ? h.replace(/\:global/g, "") : h.indexOf(":host") > -1 ? "".concat(h.replace(/\:host/g, ".".concat(s))) : h ? ".".concat(s, " ").concat(h) : ".".concat(s);
1124
+ }).join(", ") + " {";
1125
+ });
1126
+ }(n, t, e), (i || o.head || o.body).appendChild(a), a;
1127
+ }
1128
+ function Fa(n) {
1129
+ var t = "rCS" + ka(n).toString(36);
1130
+ return { className: t, inject: function(e, r) {
1131
+ r === void 0 && (r = {});
1132
+ var i = function(s) {
1133
+ if (s && s.getRootNode) {
1134
+ var u = s.getRootNode();
1135
+ if (u.nodeType === 11) return u;
1136
+ }
1137
+ }(e), o = (i || e.ownerDocument || document).querySelector('style[data-styled-id="'.concat(t, '"]'));
1138
+ if (o) {
1139
+ var a = parseFloat(o.getAttribute("data-styled-count")) || 0;
1140
+ o.setAttribute("data-styled-count", "".concat(a + 1));
1141
+ } else o = Ba(t, n, r, e, i);
1142
+ return { destroy: function() {
1143
+ var s, u = parseFloat(o.getAttribute("data-styled-count")) || 0;
1144
+ u <= 1 ? (o.remove ? o.remove() : (s = o.parentNode) === null || s === void 0 || s.removeChild(o), o = null) : o.setAttribute("data-styled-count", "".concat(u - 1));
1145
+ } };
1146
+ } };
1147
+ }
1148
+ var Rr = function() {
1149
+ return Rr = Object.assign || function(n) {
1150
+ for (var t, e = 1, r = arguments.length; e < r; e++) for (var i in t = arguments[e]) Object.prototype.hasOwnProperty.call(t, i) && (n[i] = t[i]);
1151
+ return n;
1152
+ }, Rr.apply(this, arguments);
1153
+ };
1154
+ function mo(n, t) {
1155
+ var e = Fa(t), r = e.className;
1156
+ return ua(function(i, o) {
1157
+ var a = i.className, s = a === void 0 ? "" : a;
1158
+ i.cspNonce;
1159
+ var u = function(p, f) {
1160
+ var l = {};
1161
+ for (var d in p) Object.prototype.hasOwnProperty.call(p, d) && f.indexOf(d) < 0 && (l[d] = p[d]);
1162
+ if (p != null && typeof Object.getOwnPropertySymbols == "function") {
1163
+ var h = 0;
1164
+ for (d = Object.getOwnPropertySymbols(p); h < d.length; h++) f.indexOf(d[h]) < 0 && Object.prototype.propertyIsEnumerable.call(p, d[h]) && (l[d[h]] = p[d[h]]);
1165
+ }
1166
+ return l;
1167
+ }(i, ["className", "cspNonce"]), c = ca();
1168
+ return la(o, function() {
1169
+ return c.current;
1170
+ }, []), fa(function() {
1171
+ var p = e.inject(c.current, { nonce: i.cspNonce });
1172
+ return function() {
1173
+ p.destroy();
1174
+ };
1175
+ }, []), yr(n, Rr({ ref: c, "data-styled-id": r, className: "".concat(s, " ").concat(r) }, u));
1176
+ });
1177
+ }
1178
+ var kr = function(n, t) {
1179
+ return kr = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
1180
+ e.__proto__ = r;
1181
+ } || function(e, r) {
1182
+ for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
1183
+ }, kr(n, t);
1184
+ };
1185
+ function Re(n, t) {
1186
+ if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
1187
+ function e() {
1188
+ this.constructor = n;
1189
+ }
1190
+ kr(n, t), n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
1191
+ }
1192
+ var C = function() {
1193
+ return C = Object.assign || function(n) {
1194
+ for (var t, e = 1, r = arguments.length; e < r; e++) for (var i in t = arguments[e]) Object.prototype.hasOwnProperty.call(t, i) && (n[i] = t[i]);
1195
+ return n;
1196
+ }, C.apply(this, arguments);
1197
+ };
1198
+ function O(n, t) {
1199
+ var e = typeof Symbol == "function" && n[Symbol.iterator];
1200
+ if (!e) return n;
1201
+ var r, i, o = e.call(n), a = [];
1202
+ try {
1203
+ for (; (t === void 0 || t-- > 0) && !(r = o.next()).done; ) a.push(r.value);
1204
+ } catch (s) {
1205
+ i = { error: s };
1206
+ } finally {
1207
+ try {
1208
+ r && !r.done && (e = o.return) && e.call(o);
1209
+ } finally {
1210
+ if (i) throw i.error;
1211
+ }
1212
+ }
1213
+ return a;
1214
+ }
1215
+ function q(n, t, e) {
1216
+ if (arguments.length === 2) for (var r, i = 0, o = t.length; i < o; i++) !r && i in t || (r || (r = Array.prototype.slice.call(t, 0, i)), r[i] = t[i]);
1217
+ return n.concat(r || Array.prototype.slice.call(t));
1218
+ }
1219
+ function Ce(n, t) {
1220
+ return C({ events: [], props: [], name: n }, t);
1221
+ }
1222
+ var za = ["n", "w", "s", "e"], Jr = ["n", "w", "s", "e", "nw", "ne", "sw", "se"], Aa, Oi, Pi, ae = function() {
1223
+ if (typeof navigator > "u" || !navigator || !navigator.userAgentData) return !1;
1224
+ var n = navigator.userAgentData, t = n.brands || n.uaList;
1225
+ return !(!t || !t.length);
1226
+ }() ? function(n) {
1227
+ var t = navigator.userAgentData, e = (t.uaList || t.brands).slice(), r = t.mobile || !1, i = e[0], o = (t.platform || navigator.platform).toLowerCase(), a = { name: i.brand, version: i.version, majorVersion: -1, webkit: !1, webkitVersion: "-1", chromium: !1, chromiumVersion: "-1", webview: !!Ae(to, e).brand || mi(di()) }, s = { name: "unknown", version: "-1", majorVersion: -1 };
1228
+ a.webkit = !a.chromium && Hr(sr, function(l) {
1229
+ return Qi(e, l);
1230
+ });
1231
+ var u = Ae(gi, e);
1232
+ if (a.chromium = !!u.brand, a.chromiumVersion = u.version || "-1", !a.chromium) {
1233
+ var c = Ae(sr, e);
1234
+ a.webkit = !!c.brand, a.webkitVersion = c.version || "-1";
1235
+ }
1236
+ var p = Ji(vi, function(l) {
1237
+ return new RegExp("" + l.test, "g").exec(o);
1238
+ });
1239
+ s.name = p ? p.id : "";
1240
+ var f = Ae(hi, e);
1241
+ return a.name = f.brand || a.name, a.version = f.brand && n ? n.uaFullVersion : f.version, a.webkit && (s.name = r ? "ios" : "mac"), s.name === "ios" && a.webview && (a.version = "-1"), s.version = Sr(s.version), a.version = Sr(a.version), s.majorVersion = parseInt(s.version, 10), a.majorVersion = parseInt(a.version, 10), { browser: a, os: s, isMobile: r, isHints: !0 };
1242
+ }() : function(n) {
1243
+ var t = di(n), e = !!/mobi/g.exec(t), r = { name: "unknown", version: "-1", majorVersion: -1, webview: mi(t), chromium: !1, chromiumVersion: "-1", webkit: !1, webkitVersion: "-1" }, i = { name: "unknown", version: "-1", majorVersion: -1 }, o = ge(hi, t), a = o.preset, s = o.version, u = ge(vi, t), c = u.preset, p = u.version, f = ge(gi, t);
1244
+ if (r.chromium = !!f.preset, r.chromiumVersion = f.version, !r.chromium) {
1245
+ var l = ge(sr, t);
1246
+ r.webkit = !!l.preset, r.webkitVersion = l.version;
1247
+ }
1248
+ return c && (i.name = c.id, i.version = p, i.majorVersion = parseInt(p, 10)), a && (r.name = a.id, r.version = s, r.webview && i.name === "ios" && r.name !== "safari" && (r.webview = !1)), r.majorVersion = parseInt(r.version, 10), { browser: r, os: i, isMobile: e, isHints: !1 };
1249
+ }(Aa), bo = ae.browser.webkit, xo = bo && (Oi = typeof window > "u" ? { userAgent: "" } : window.navigator, !!(Pi = /applewebkit\/([^\s]+)/g.exec(Oi.userAgent.toLowerCase())) && parseFloat(Pi[1]) < 605), yo = ae.browser.name, Eo = parseInt(ae.browser.version, 10), Ga = yo === "chrome", Ia = ae.browser.chromium, Ya = parseInt(ae.browser.chromiumVersion, 10) || 0, Xa = Ga && Eo >= 109 || Ia && Ya >= 109, Na = yo === "firefox", Wa = parseInt(ae.browser.webkitVersion, 10) >= 612 || Eo >= 15, Qr = "moveable-", Ha = Jr.map(function(n) {
1250
+ var t = "", e = "", r = "center", i = "center", o = "calc(var(--moveable-control-padding, 20) * -1px)";
1251
+ return n.indexOf("n") > -1 && (t = "top: ".concat(o, ";"), i = "bottom"), n.indexOf("s") > -1 && (t = "top: 0px;", i = "top"), n.indexOf("w") > -1 && (e = "left: ".concat(o, ";"), r = "right"), n.indexOf("e") > -1 && (e = "left: 0px;", r = "left"), '.around-control[data-direction*="'.concat(n, `"] {
1252
+ `).concat(e).concat(t, `
1253
+ transform-origin: `).concat(r, " ").concat(i, `;
1254
+ }`);
1255
+ }).join(`
1256
+ `), qa = `
1257
+ {
1258
+ position: absolute;
1259
+ width: 1px;
1260
+ height: 1px;
1261
+ left: 0;
1262
+ top: 0;
1263
+ z-index: 3000;
1264
+ --moveable-color: #4af;
1265
+ --zoom: 1;
1266
+ --zoompx: 1px;
1267
+ --moveable-line-padding: 0;
1268
+ --moveable-control-padding: 0;
1269
+ will-change: transform;
1270
+ outline: 1px solid transparent;
1271
+ }
1272
+ .control-box {
1273
+ z-index: 0;
1274
+ }
1275
+ .line, .control {
1276
+ position: absolute;
1277
+ left: 0;
1278
+ top: 0;
1279
+ will-change: transform;
1280
+ }
1281
+ .control {
1282
+ width: 14px;
1283
+ height: 14px;
1284
+ border-radius: 50%;
1285
+ border: 2px solid #fff;
1286
+ box-sizing: border-box;
1287
+ background: #4af;
1288
+ background: var(--moveable-color);
1289
+ margin-top: -7px;
1290
+ margin-left: -7px;
1291
+ border: 2px solid #fff;
1292
+ z-index: 10;
1293
+ }
1294
+ .around-control {
1295
+ position: absolute;
1296
+ will-change: transform;
1297
+ width: calc(var(--moveable-control-padding, 20) * 1px);
1298
+ height: calc(var(--moveable-control-padding, 20) * 1px);
1299
+ left: calc(var(--moveable-control-padding, 20) * -0.5px);
1300
+ top: calc(var(--moveable-control-padding, 20) * -0.5px);
1301
+ box-sizing: border-box;
1302
+ background: transparent;
1303
+ z-index: 8;
1304
+ cursor: alias;
1305
+ transform-origin: center center;
1306
+ }
1307
+ `.concat(Ha, `
1308
+ .padding {
1309
+ position: absolute;
1310
+ top: 0px;
1311
+ left: 0px;
1312
+ width: 100px;
1313
+ height: 100px;
1314
+ transform-origin: 0 0;
1315
+ }
1316
+ .line {
1317
+ width: 1px;
1318
+ height: 1px;
1319
+ background: #4af;
1320
+ background: var(--moveable-color);
1321
+ transform-origin: 0px 50%;
1322
+ }
1323
+ .line.edge {
1324
+ z-index: 1;
1325
+ background: transparent;
1326
+ }
1327
+ .line.dashed {
1328
+ box-sizing: border-box;
1329
+ background: transparent;
1330
+ }
1331
+ .line.dashed.horizontal {
1332
+ border-top: 1px dashed #4af;
1333
+ border-top-color: #4af;
1334
+ border-top-color: var(--moveable-color);
1335
+ }
1336
+ .line.dashed.vertical {
1337
+ border-left: 1px dashed #4af;
1338
+ border-left-color: #4af;
1339
+ border-left-color: var(--moveable-color);
1340
+ }
1341
+ .line.vertical {
1342
+ transform: translateX(-50%);
1343
+ }
1344
+ .line.horizontal {
1345
+ transform: translateY(-50%);
1346
+ }
1347
+ .line.vertical.bold {
1348
+ width: 2px;
1349
+ }
1350
+ .line.horizontal.bold {
1351
+ height: 2px;
1352
+ }
1353
+
1354
+ .control.origin {
1355
+ border-color: #f55;
1356
+ background: #fff;
1357
+ width: 12px;
1358
+ height: 12px;
1359
+ margin-top: -6px;
1360
+ margin-left: -6px;
1361
+ pointer-events: none;
1362
+ }
1363
+ `).concat([0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165].map(function(n) {
1364
+ return `
1365
+ .direction[data-rotation="`.concat(n, '"], :global .view-control-rotation').concat(n, ` {
1366
+ `).concat(function(t) {
1367
+ var e = function(o, a) {
1368
+ return 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(32 * o, 'px" height="').concat(32 * o, 'px" viewBox="0 0 32 32" ><path d="M 16,5 L 12,10 L 14.5,10 L 14.5,22 L 12,22 L 16,27 L 20,22 L 17.5,22 L 17.5,10 L 20, 10 L 16,5 Z" stroke-linejoin="round" stroke-width="1.2" fill="black" stroke="white" style="transform:rotate(').concat(a, 'deg);transform-origin: 16px 16px"></path></svg>');
1369
+ }(1, t), r = 45 * Math.round(t / 45) % 180, i = "ns-resize";
1370
+ return r === 135 ? i = "nwse-resize" : r === 45 ? i = "nesw-resize" : r === 90 && (i = "ew-resize"), "cursor:".concat(i, ";cursor: url('").concat(e, "') 16 16, ").concat(i, ";");
1371
+ }(n), `
1372
+ }
1373
+ `);
1374
+ }).join(`
1375
+ `), `
1376
+
1377
+ .line.direction:before {
1378
+ content: "";
1379
+ position: absolute;
1380
+ width: 100%;
1381
+ height: calc(var(--moveable-line-padding, 0) * 1px);
1382
+ bottom: 0;
1383
+ left: 0;
1384
+ }
1385
+ .group {
1386
+ z-index: -1;
1387
+ }
1388
+ .area {
1389
+ position: absolute;
1390
+ }
1391
+ .area-pieces {
1392
+ position: absolute;
1393
+ top: 0;
1394
+ left: 0;
1395
+ display: none;
1396
+ }
1397
+ .area.avoid, .area.pass {
1398
+ pointer-events: none;
1399
+ }
1400
+ .area.avoid+.area-pieces {
1401
+ display: block;
1402
+ }
1403
+ .area-piece {
1404
+ position: absolute;
1405
+ }
1406
+
1407
+ `).concat(xo ? `:global svg *:before {
1408
+ content:"";
1409
+ transform-origin: inherit;
1410
+ }` : "", `
1411
+ `), pr = 1e-4, tn = 1e-7, Br = Math.pow(10, 10), Ri = -Br, Fr = { n: [0, 1], e: [1, 3], s: [3, 2], w: [2, 0], nw: [0], ne: [1], sw: [2], se: [3] }, ki = { n: 0, s: 180, w: 270, e: 90, nw: 315, ne: 45, sw: 225, se: 135 }, La = ["isMoveableElement", "updateRect", "updateTarget", "destroy", "dragStart", "isInside", "hitTest", "setState", "getRect", "request", "isDragging", "getManager", "forceUpdate", "waitToChangeTarget", "updateSelectors", "getTargets", "stopDrag", "getControlBoxElement", "getMoveables", "getDragElement"];
1412
+ function So(n, t, e, r, i, o) {
1413
+ var a, s, u = (s = (a = t.gestos[o]) === null || a === void 0 ? void 0 : a.move(e, n.inputEvent)) !== null && s !== void 0 ? s : {}, c = u.originalDatas || u.datas, p = c[o] || (c[o] = {});
1414
+ return C(C({}, u), { isPinch: !!r, parentEvent: !0, datas: p, originalDatas: n.originalDatas });
1415
+ }
1416
+ var wo = function() {
1417
+ function n(t) {
1418
+ var e;
1419
+ t === void 0 && (t = "draggable"), this.ableName = t, this.prevX = 0, this.prevY = 0, this.startX = 0, this.startY = 0, this.isDrag = !1, this.isFlag = !1, this.datas = { draggable: {} }, this.datas = ((e = {})[t] = {}, e);
1420
+ }
1421
+ return n.prototype.dragStart = function(t, e) {
1422
+ this.isDrag = !1, this.isFlag = !1;
1423
+ var r = e.originalDatas;
1424
+ return this.datas = r, r[this.ableName] || (r[this.ableName] = {}), C(C({}, this.move(t, e.inputEvent)), { type: "dragstart" });
1425
+ }, n.prototype.drag = function(t, e) {
1426
+ return this.move([t[0] - this.prevX, t[1] - this.prevY], e);
1427
+ }, n.prototype.move = function(t, e) {
1428
+ var r, i, o = !1;
1429
+ if (this.isFlag) {
1430
+ var a = this.isDrag;
1431
+ r = this.prevX + t[0], i = this.prevY + t[1], (t[0] || t[1]) && (this.isDrag = !0), !a && this.isDrag && (o = !0);
1432
+ } else this.prevX = t[0], this.prevY = t[1], this.startX = t[0], this.startY = t[1], r = t[0], i = t[1], this.isFlag = !0;
1433
+ return this.prevX = r, this.prevY = i, { type: "drag", clientX: r, clientY: i, inputEvent: e, isFirstDrag: o, isDrag: this.isDrag, distX: r - this.startX, distY: i - this.startY, deltaX: t[0], deltaY: t[1], datas: this.datas[this.ableName], originalDatas: this.datas, parentEvent: !0, parentGesto: this };
1434
+ }, n;
1435
+ }();
1436
+ function ye(n, t, e, r) {
1437
+ var i = n.length === 16 ? 4 : 3, o = O(re(n, e, r, i), 4), a = O(o[0], 2), s = a[0], u = a[1], c = O(o[1], 2), p = c[0], f = c[1], l = O(o[2], 2), d = l[0], h = l[1], g = O(o[3], 2), v = g[0], m = g[1], x = O(yn(n, t, i), 2), y = x[0], E = x[1], S = Math.min(s, p, d, v), b = Math.min(u, f, h, m), w = Math.max(s, p, d, v);
1438
+ return s = s - S || 0, { left: S, top: b, right: w, bottom: Math.max(u, f, h, m), origin: [y = y - S || 0, E = E - b || 0], pos1: [s, u = u - b || 0], pos2: [p = p - S || 0, f = f - b || 0], pos3: [d = d - S || 0, h = h - b || 0], pos4: [v = v - S || 0, m = m - b || 0], direction: Qn(n[0] * n[i + 1]) };
1439
+ }
1440
+ function Mo(n, t) {
1441
+ var e = t.datas, r = n.state, i = r.allMatrix, o = r.beforeMatrix, a = r.is3d, s = r.left, u = r.top, c = r.origin, p = r.offsetMatrix, f = r.targetMatrix, l = r.transformOrigin, d = a ? 4 : 3;
1442
+ e.is3d = a, e.matrix = i, e.targetMatrix = f, e.beforeMatrix = o, e.offsetMatrix = p, e.transformOrigin = l, e.inverseMatrix = Gn(i, d), e.inverseBeforeMatrix = Gn(o, d), e.absoluteOrigin = Pe(St([s, u], c), d), e.startDragBeforeDist = gn(e.inverseBeforeMatrix, e.absoluteOrigin, d), e.startDragDist = gn(e.inverseMatrix, e.absoluteOrigin, d);
1443
+ }
1444
+ function ja(n, t, e) {
1445
+ var r = t.datas, i = t.originalDatas.beforeRenderable, o = r.transformIndex, a = i.nextTransforms, s = a.length, u = i.nextTransformAppendedIndexes, c = -1;
1446
+ o === -1 ? ((c = 0) == -1 && (c = a.length), r.transformIndex = c) : c = un(u, function(d) {
1447
+ return d.index === o && d.functionName === e;
1448
+ }) ? o : o + u.filter(function(d) {
1449
+ return d.index < o;
1450
+ }).length;
1451
+ var p = function(d, h, g) {
1452
+ var v, m = ne(d, { "x%": function(k) {
1453
+ return k / 100 * h.offsetWidth;
1454
+ }, "y%": function(k) {
1455
+ return k / 100 * h.offsetHeight;
1456
+ } }), x = d.slice(0, g < 0 ? void 0 : g), y = d.slice(0, g < 0 ? void 0 : g + 1), E = d[g] || "", S = g < 0 ? [] : d.slice(g), b = g < 0 ? [] : d.slice(g + 1), w = m.slice(0, g < 0 ? void 0 : g), _ = m.slice(0, g < 0 ? void 0 : g + 1), D = (v = m[g]) !== null && v !== void 0 ? v : ne([""])[0], P = g < 0 ? [] : m.slice(g), M = g < 0 ? [] : m.slice(g + 1), T = D ? [D] : [], R = Hn(w), F = Hn(_), z = Hn(P), B = Hn(M), G = Ot(R, z, 4);
1457
+ return { transforms: d, beforeFunctionMatrix: R, beforeFunctionMatrix2: F, targetFunctionMatrix: Hn(T), afterFunctionMatrix: z, afterFunctionMatrix2: B, allFunctionMatrix: G, beforeFunctions: w, beforeFunctions2: _, targetFunction: T[0], afterFunctions: P, afterFunctions2: M, beforeFunctionTexts: x, beforeFunctionTexts2: y, targetFunctionText: E, afterFunctionTexts: S, afterFunctionTexts2: b };
1458
+ }(a, n.state, c), f = p.targetFunction, l = e;
1459
+ r.beforeFunctionTexts = p.beforeFunctionTexts, r.afterFunctionTexts = p.afterFunctionTexts, r.beforeTransform = p.beforeFunctionMatrix, r.beforeTransform2 = p.beforeFunctionMatrix2, r.targetTansform = p.targetFunctionMatrix, r.afterTransform = p.afterFunctionMatrix, r.afterTransform2 = p.afterFunctionMatrix2, r.targetAllTransform = p.allFunctionMatrix, f.functionName === l ? (r.afterFunctionTexts.splice(0, 1), r.isAppendTransform = !1) : s > c && (r.isAppendTransform = !0, i.nextTransformAppendedIndexes = q(q([], O(u), !1), [{ functionName: e, index: c, isAppend: !0 }], !1));
1460
+ }
1461
+ function Va(n) {
1462
+ var t = n.datas, e = O(Do({ datas: t, distX: n.distX, distY: n.distY }), 2), r = function(i, o) {
1463
+ var a = i.beforeTransform, s = i.afterTransform;
1464
+ i.beforeTransform2, i.afterTransform2;
1465
+ var u = i.targetAllTransform, c = Ot(o, u, 4), p = Ot(Gn(a, 4), c, 4);
1466
+ return Ot(p, Gn(s, 4), 4);
1467
+ }(t, function(i, o) {
1468
+ for (var a = bt(o), s = 0; s < o - 1; ++s) a[o * (o - 1) + s] = i[s] || 0;
1469
+ return a;
1470
+ }([e[0], e[1]], 4));
1471
+ return gn(r, Pe([0, 0, 0], 4), 4);
1472
+ }
1473
+ function Do(n) {
1474
+ var t = n.datas, e = n.distX, r = n.distY, i = t.inverseBeforeMatrix, o = t.is3d, a = t.startDragBeforeDist, s = o ? 4 : 3;
1475
+ return nt(gn(i, St(t.absoluteOrigin, [e, r]), s), a);
1476
+ }
1477
+ function _e(n, t) {
1478
+ var e = n.datas, r = n.distX, i = n.distY;
1479
+ e.inverseBeforeMatrix;
1480
+ var o = e.inverseMatrix, a = e.is3d;
1481
+ e.startDragBeforeDist;
1482
+ var s = e.startDragDist, u = a ? 4 : 3;
1483
+ return nt(gn(o, St(e.absoluteOrigin, [r, i]), u), s);
1484
+ }
1485
+ function dr(n, t) {
1486
+ var e = (t + 1) / 2;
1487
+ return [bi(n[0][0], n[1][0], e, 1 - e), bi(n[0][1], n[1][1], e, 1 - e)];
1488
+ }
1489
+ function $t(n, t) {
1490
+ var e = dr([n[0], n[1]], t[0]), r = dr([n[2], n[3]], t[0]);
1491
+ return dr([e, r], t[1]);
1492
+ }
1493
+ function Co(n, t, e, r) {
1494
+ return Ot(n, Ee(t, r, e), r);
1495
+ }
1496
+ function hr(n, t, e) {
1497
+ var r = $n(t), i = t.datas;
1498
+ if (i.transformIndex = e, e !== -1) {
1499
+ var o = r.startTransforms[e];
1500
+ if (o) {
1501
+ var a = n.state, s = ne([o], { "x%": function(u) {
1502
+ return u / 100 * a.offsetWidth;
1503
+ }, "y%": function(u) {
1504
+ return u / 100 * a.offsetHeight;
1505
+ } });
1506
+ i.startValue = s[0].functionValue;
1507
+ }
1508
+ }
1509
+ }
1510
+ function $n(n) {
1511
+ return n.originalDatas.beforeRenderable;
1512
+ }
1513
+ function $e(n) {
1514
+ return n.originalDatas.beforeRenderable.nextTransforms;
1515
+ }
1516
+ function Xe(n) {
1517
+ return ($e(n) || []).join(" ");
1518
+ }
1519
+ function Ne(n) {
1520
+ return $n(n).nextStyle;
1521
+ }
1522
+ function Za(n, t, e, r, i, o) {
1523
+ var a = n.props.groupable, s = n.state, u = s.transformOrigin, c = s.offsetMatrix, p = s.is3d, f = s.width, l = s.height, d = s.left, h = s.top, g = o.fixedDirection, v = o.nextTargetMatrix || s.targetMatrix, m = p ? 4 : 3, x = function(b, w, _, D, P, M) {
1524
+ return D === void 0 && (D = w), P === void 0 && (P = _), M === void 0 && (M = [0, 0]), b ? b.map(function(T, R) {
1525
+ var F = er(T), z = F.value, B = F.unit, G = R ? P : D, k = R ? _ : w;
1526
+ return T === "%" || isNaN(z) ? k * (G ? M[R] / G : 0) : B !== "%" ? z : k * z / 100;
1527
+ }) : M;
1528
+ }(i, t, e, f, l, u), y = a ? d : 0, E = a ? h : 0, S = function(b, w, _, D, P, M) {
1529
+ var T = $t(re(w, _, D, P), M);
1530
+ return [b[0] - T[0], b[1] - T[1]];
1531
+ }(r, Co(c, v, x, m), t, e, m, g);
1532
+ return nt(S, [y, E]);
1533
+ }
1534
+ function Ka(n) {
1535
+ if (n && n.getRootNode) {
1536
+ var t = n.getRootNode();
1537
+ if (t.nodeType === 11) return t;
1538
+ }
1539
+ }
1540
+ function Ua(n) {
1541
+ var t = n("scale"), e = n("rotate"), r = n("translate"), i = [];
1542
+ return r && r !== "0px" && r !== "none" && i.push("translate(".concat(r.split(/\s+/).join(","), ")")), e && e !== "1" && e !== "none" && i.push("rotate(".concat(e, ")")), t && t !== "1" && t !== "none" && i.push("scale(".concat(t.split(/\s+/).join(","), ")")), i;
1543
+ }
1544
+ function Bi(n, t, e) {
1545
+ for (var r, i, o, a = n, s = [], u = Zr(n) || kn(n), c = !e && n === t || n === u, p = c, f = !1, l = 3, d = !1, h = Te(t, t, !0).offsetParent, g = 1; a && !p; ) {
1546
+ p = c;
1547
+ var v = nn(a), m = v("position"), x = Ao(a), y = m === "fixed", E = Ua(v), S = xa(as(x)), b = void 0, w = !1, _ = !1, D = 0, P = 0, M = 0, T = 0, R = { hasTransform: !1, fixedContainer: null };
1548
+ y && (d = !0, h = (R = cs(a)).fixedContainer);
1549
+ var F = S.length;
1550
+ f || F !== 16 && !E.length || (f = !0, l = 4, Gr(s), o && (o = In(o, 3, 4))), f && F === 9 && (S = In(S, 3, 4));
1551
+ var z = us(a, n), B = z.tagName, G = z.hasOffset, k = z.isSVG, I = z.origin, V = z.targetOrigin, Z = O(z.offset, 2), et = Z[0], U = Z[1];
1552
+ B === "svg" && !a.ownerSVGElement && o && (s.push({ type: "target", target: a, matrix: ls(a, l) }), s.push({ type: "offset", target: a, matrix: bt(l) }));
1553
+ var X = parseFloat(v("zoom")) || 1;
1554
+ if (y) b = R.fixedContainer, w = !0;
1555
+ else {
1556
+ var N = Te(a, t, !1, !0, v), H = N.offsetZoom;
1557
+ if (b = N.offsetParent, w = N.isEnd, _ = N.isStatic, g *= H, (N.isCustomElement || H !== 1) && _) et -= b.offsetLeft, U -= b.offsetTop;
1558
+ else if ((Na || Xa) && N.parentSlotElement) {
1559
+ for (var L = b, Q = 0, pt = 0; L && Ka(L); ) Q += L.offsetLeft, pt += L.offsetTop, L = L.offsetParent;
1560
+ et -= Q, U -= pt;
1561
+ }
1562
+ }
1563
+ if (!bo || Wa || !G || k || !_ || m !== "relative" && m !== "static" || (et -= b.offsetLeft, U -= b.offsetTop, c = c || w), y) G && R.hasTransform && (M = b.clientLeft, T = b.clientTop);
1564
+ else if (G && h !== b && (D = b.clientLeft, P = b.clientTop), G && b === u) {
1565
+ var Y = Go(a, !1);
1566
+ et += Y[0], U += Y[1];
1567
+ }
1568
+ if (s.push({ type: "target", target: a, matrix: Ee(S, l, I) }), E.length && (s.push({ type: "offset", target: a, matrix: bt(l) }), s.push({ type: "target", target: a, matrix: Ee(Ur(E), l, I) })), G) {
1569
+ var j = a === n, J = j ? 0 : a.scrollLeft, W = j ? 0 : a.scrollTop;
1570
+ s.push({ type: "offset", target: a, matrix: Yn([et - J + D - M, U - W + P - T], l) });
1571
+ } else s.push({ type: "offset", target: a, origin: I });
1572
+ if (X !== 1 && s.push({ type: "zoom", target: a, matrix: Ee(lo([X, X], l), l, [0, 0]) }), o || (o = S), r || (r = I), i || (i = V), p || y) break;
1573
+ a = b, c = w, e && a !== u || (p = c);
1574
+ }
1575
+ return o || (o = bt(l)), r || (r = [0, 0]), i || (i = [0, 0]), { zoom: g, offsetContainer: h, matrixes: s, targetMatrix: o, transformOrigin: r, targetOrigin: i, is3d: f, hasFixed: d };
1576
+ }
1577
+ var qn = null, Ln = null, jn = null;
1578
+ function ee(n) {
1579
+ n ? (window.Map && (qn = /* @__PURE__ */ new Map(), Ln = /* @__PURE__ */ new Map()), jn = []) : (qn = null, jn = null, Ln = null);
1580
+ }
1581
+ function nn(n) {
1582
+ var t = qn?.get(n);
1583
+ if (!t) {
1584
+ var e = Pn(n).getComputedStyle(n);
1585
+ if (!qn) return function(o) {
1586
+ return e[o];
1587
+ };
1588
+ t = { style: e, cached: {} }, qn.set(n, t);
1589
+ }
1590
+ var r = t.cached, i = t.style;
1591
+ return function(o) {
1592
+ return o in r || (r[o] = i[o]), r[o];
1593
+ };
1594
+ }
1595
+ function Xn(n, t, e) {
1596
+ var r = e.originalDatas;
1597
+ r.groupable = r.groupable || {};
1598
+ var i = r.groupable;
1599
+ i.childDatas = i.childDatas || [];
1600
+ var o = i.childDatas;
1601
+ return n.moveables.map(function(a, s) {
1602
+ return o[s] = o[s] || {}, o[s][t] = o[s][t] || {}, C(C({}, e), { isRequestChild: !0, datas: o[s][t], originalDatas: o[s] });
1603
+ });
1604
+ }
1605
+ function gr(n, t, e, r, i, o, a) {
1606
+ var s = !!e.match(/Start$/g), u = !!e.match(/End$/g), c = i.isPinch, p = i.datas, f = Xn(n, t.name, i), l = n.moveables, d = [], h = f.map(function(g, v) {
1607
+ var m = l[v], x = m.state, y = x.gestos, E = g;
1608
+ if (s) E = new wo(a).dragStart(r, g), d.push(E);
1609
+ else {
1610
+ if (y[a] || (y[a] = p.childGestos[v]), !y[a]) return;
1611
+ E = So(g, x, r, c, 0, a), d.push(E);
1612
+ }
1613
+ var S = t[e](m, C(C({}, E), { parentFlag: !0 }));
1614
+ return u && (y[a] = null), S;
1615
+ });
1616
+ return s && (p.childGestos = l.map(function(g) {
1617
+ return g.state.gestos[a];
1618
+ })), { eventParams: h, childEvents: d };
1619
+ }
1620
+ function vr(n, t, e, r, i, o) {
1621
+ i === void 0 && (i = function(c, p) {
1622
+ return p;
1623
+ });
1624
+ var a = !!e.match(/End$/g), s = Xn(n, t.name, r), u = n.moveables;
1625
+ return s.map(function(c, p) {
1626
+ var f, l = u[p];
1627
+ f = i(l, c);
1628
+ var d = t[e](l, C(C({}, f), { parentFlag: !0 }));
1629
+ return a && (l.state.gestos = {}), d;
1630
+ });
1631
+ }
1632
+ function Fi(n, t, e, r) {
1633
+ var i = e.fixedDirection, o = e.fixedPosition, a = $t(r.datas.startPositions || Rn(t.state), i), s = O(gn(rr(-n.rotation / 180 * Math.PI, 3), [a[0] - o[0], a[1] - o[1], 1], 3), 2), u = s[0], c = s[1];
1634
+ return r.datas.originalX = u, r.datas.originalY = c, r;
1635
+ }
1636
+ function zi(n, t, e, r) {
1637
+ var i = Se(n.props, e), o = i.renderDirections, a = o === void 0 ? t : o, s = i.displayAroundControls;
1638
+ if (!a) return [];
1639
+ var u = a === !0 ? Jr : a;
1640
+ return q(q([], O(s ? function(c, p, f, l) {
1641
+ var d = c.renderState;
1642
+ d.renderDirectionMap || (d.renderDirectionMap = {});
1643
+ var h = c.getState(), g = h.renderPoses, v = h.rotation, m = h.direction, x = d.renderDirectionMap, y = c.props.zoom, E = Qn(m), S = v / Math.PI * 180;
1644
+ return (l || De(x)).map(function(b) {
1645
+ var w = Fr[b];
1646
+ if (!w) return null;
1647
+ var _ = (ft(S, 15) + E * ki[b] + 720) % 180, D = ["around-control"];
1648
+ return f && D.push("direction", f), p.createElement("div", { className: xt.apply(void 0, q([], O(D), !1)), "data-rotation": _, "data-direction": b, key: "direction-around-".concat(b), style: tr.apply(void 0, q([v, y], O(w.map(function(P) {
1649
+ return g[P];
1650
+ })), !1)) });
1651
+ });
1652
+ }(n, r, e, u) : []), !1), O(function(c, p, f, l) {
1653
+ var d = c.getState(), h = d.renderPoses, g = d.rotation, v = d.direction, m = Se(c.props, p).zoom, x = (S = g / Math.PI * 180, S < 0 && (S = S % 360 + 360), S % 360), y = {}, E = c.renderState, S;
1654
+ E.renderDirectionMap || (E.renderDirectionMap = {});
1655
+ var b = E.renderDirectionMap;
1656
+ f.forEach(function(_) {
1657
+ var D = _.dir;
1658
+ y[D] = !0;
1659
+ });
1660
+ var w = Qn(v);
1661
+ return f.map(function(_) {
1662
+ var D = _.data, P = _.classNames, M = _.dir, T = Fr[M];
1663
+ if (!T || !y[M]) return null;
1664
+ b[M] = !0;
1665
+ var R = (ft(x, 15) + w * ki[M] + 720) % 180, F = {};
1666
+ return De(D).forEach(function(z) {
1667
+ F["data-".concat(z)] = D[z];
1668
+ }), l.createElement("div", C({ className: xt.apply(void 0, q(["control", "direction", M, p], O(P), !1)), "data-rotation": R, "data-direction": M }, F, { key: "direction-".concat(M), style: tr.apply(void 0, q([g, m], O(T.map(function(z) {
1669
+ return h[z];
1670
+ })), !1)) }));
1671
+ });
1672
+ }(n, e, u.map(function(c) {
1673
+ return { data: {}, classNames: [], dir: c };
1674
+ }), r)), !1);
1675
+ }
1676
+ function ti(n, t, e, r, i, o) {
1677
+ for (var a = [], s = 6; s < arguments.length; s++) a[s - 6] = arguments[s];
1678
+ var u = sn(e, r), c = t ? ft(u / Math.PI * 180, 15) % 180 : -1;
1679
+ return n.createElement("div", { key: "line-".concat(o), className: xt.apply(void 0, q(["line", "direction", t ? "edge" : "", t], O(a), !1)), "data-rotation": c, "data-line-key": o, "data-direction": t, style: fs(e, r, i, u) });
1680
+ }
1681
+ function _o(n, t, e, r, i) {
1682
+ return (e === !0 ? za : e).map(function(o, a) {
1683
+ var s = O(Fr[o], 2), u = s[0], c = s[1];
1684
+ if (c != null) return ti(n, o, r[u], r[c], i, "".concat(t, "Edge").concat(a), t);
1685
+ }).filter(Boolean);
1686
+ }
1687
+ function To(n, t) {
1688
+ var e = n.state, r = e.containerClientRect, i = r.clientHeight, o = r.clientWidth, a = r.clientLeft, s = r.clientTop, u = e.snapOffset, c = u.left, p = u.top, f = u.right, l = u.bottom, d = n.props.bounds || {}, h = (d.position || "client") === "css", g = d.left, v = g === void 0 ? -1 / 0 : g, m = d.top, x = m === void 0 ? -1 / 0 : m, y = d.right, E = y === void 0 ? h ? -1 / 0 : 1 / 0 : y, S = d.bottom, b = S === void 0 ? h ? -1 / 0 : 1 / 0 : S;
1689
+ return h && (E = o + f - c - E, b = i + l - p - b), { left: v + c - a, right: E + c - a, top: x + p - s, bottom: b + p - s };
1690
+ }
1691
+ function Ai(n, t, e) {
1692
+ var r = n[e ? "left" : "top"], i = n[e ? "right" : "bottom"], o = Math.min.apply(Math, q([], O(t), !1)), a = Math.max.apply(Math, q([], O(t), !1)), s = [];
1693
+ return r + 1 > o && s.push({ direction: "start", isBound: !0, offset: o - r, pos: r }), i - 1 < a && s.push({ direction: "end", isBound: !0, offset: a - i, pos: i }), s.length || s.push({ isBound: !1, offset: 0, pos: 0 }), s.sort(function(u, c) {
1694
+ return A(c.offset) - A(u.offset);
1695
+ });
1696
+ }
1697
+ var $a = ["left", "right", "center"], Ja = ["top", "bottom", "middle"];
1698
+ function Oo(n, t) {
1699
+ var e = n.props, r = e.snappable, i = e.bounds, o = e.innerBounds, a = e.verticalGuidelines, s = e.horizontalGuidelines, u = e.snapGridWidth, c = e.snapGridHeight, p = n.state, f = p.guidelines, l = p.enableSnap;
1700
+ return !(!r || !l || t && r !== !0 && r.indexOf(t) < 0) && !!(u || c || i || o || f && f.length || a && a.length || s && s.length);
1701
+ }
1702
+ function Po(n) {
1703
+ return n === !1 ? {} : n !== !0 && n ? n : { left: !0, right: !0, top: !0, bottom: !0 };
1704
+ }
1705
+ function Qa(n, t) {
1706
+ var e = function(o, a) {
1707
+ var s = Po(o), u = {};
1708
+ for (var c in s) c in a && s[c] && (u[c] = a[c]);
1709
+ return u;
1710
+ }(n, t), r = Ja.filter(function(o) {
1711
+ return o in e;
1712
+ }), i = $a.filter(function(o) {
1713
+ return o in e;
1714
+ });
1715
+ return { horizontalNames: r, verticalNames: i, horizontal: r.map(function(o) {
1716
+ return e[o];
1717
+ }), vertical: i.map(function(o) {
1718
+ return e[o];
1719
+ }) };
1720
+ }
1721
+ function Ro(n, t, e, r, i, o, a) {
1722
+ var s;
1723
+ r === void 0 && (r = []), i === void 0 && (i = []);
1724
+ var u = n.props, c = ((s = n.state.snapThresholdInfo) === null || s === void 0 ? void 0 : s.multiples) || [1, 1], p = qi(a, u.snapHorizontalThreshold, 5), f = qi(o, u.snapVerticalThreshold, 5);
1725
+ return function(l, d, h, g, v, m, x, y) {
1726
+ return { vertical: Gi(l, "vertical", d, x * y[0], g), horizontal: Gi(l, "horizontal", h, m * y[1], v) };
1727
+ }(n.state.guidelines, t, e, r, i, p, f, c);
1728
+ }
1729
+ function zr(n) {
1730
+ var t = n.isSnap;
1731
+ if (!t) return { isSnap: !1, offset: 0, dist: -1, pos: 0, guideline: null };
1732
+ var e = n.posInfos[0], r = e.guidelineInfos[0], i = r.offset, o = r.dist, a = r.guideline;
1733
+ return { isSnap: t, offset: i, dist: o, pos: e.pos, guideline: a };
1734
+ }
1735
+ function Gi(n, t, e, r, i) {
1736
+ var o, a;
1737
+ if (i === void 0 && (i = []), !n || !n.length) return { isSnap: !1, index: -1, direction: "", posInfos: [] };
1738
+ var s = t === "vertical" ? 0 : 1, u = e.map(function(p, f) {
1739
+ var l = i[f] || "", d = n.map(function(h) {
1740
+ var g = h.pos, v = p - g[s];
1741
+ return { offset: v, dist: A(v), guideline: h, direction: l };
1742
+ }).filter(function(h) {
1743
+ var g = h.guideline, v = h.dist;
1744
+ return !(g.type !== t || v > r);
1745
+ }).sort(function(h, g) {
1746
+ return h.dist - g.dist;
1747
+ });
1748
+ return { pos: p, index: f, guidelineInfos: d, direction: l };
1749
+ }).filter(function(p) {
1750
+ return p.guidelineInfos.length > 0;
1751
+ }).sort(function(p, f) {
1752
+ return p.guidelineInfos[0].dist - f.guidelineInfos[0].dist;
1753
+ }), c = u.length > 0;
1754
+ return { isSnap: c, index: c ? u[0].index : -1, direction: (a = (o = u[0]) === null || o === void 0 ? void 0 : o.direction) !== null && a !== void 0 ? a : "", posInfos: u };
1755
+ }
1756
+ function Je(n, t) {
1757
+ return n.slice().sort(function(e, r) {
1758
+ var i = e.sign[t], o = r.sign[t], a = e.offset[t], s = r.offset[t];
1759
+ return i ? o ? function(u, c) {
1760
+ var p = A(u.offset), f = A(c.offset);
1761
+ return u.isBound && c.isBound ? f - p : u.isBound ? -1 : c.isBound ? 1 : u.isSnap && c.isSnap ? f - p : u.isSnap ? -1 : c.isSnap || p < tn ? 1 : f < tn ? -1 : p - f;
1762
+ }({ isBound: e.isBound, isSnap: e.isSnap, offset: a }, { isBound: r.isBound, isSnap: r.isSnap, offset: s }) : -1 : 1;
1763
+ })[0];
1764
+ }
1765
+ function ko(n, t) {
1766
+ var e, r, i = O(t, 2), o = i[0], a = i[1], s = a[0] - o[0], u = a[1] - o[1];
1767
+ return A(s) < tn && (s = 0), A(u) < tn && (u = 0), s ? u ? (e = u / s * (n[0] - o[0]) + o[1], r = n[1]) : (e = o[1], r = n[1]) : (e = o[0], r = n[0]), e - r;
1768
+ }
1769
+ function Ii(n, t, e, r, i) {
1770
+ return i === void 0 && (i = 0), r && t - i <= n || !r && n <= e + i ? { isBound: !0, offset: r ? t - n : e - n } : { isBound: !1, offset: 0 };
1771
+ }
1772
+ function ts(n, t) {
1773
+ var e = t.line, r = t.centerSign, i = t.verticalSign, o = t.horizontalSign, a = t.lineConstants, s = n.props.innerBounds;
1774
+ if (!s) return { isAllBound: !1, isBound: !1, isVerticalBound: !1, isHorizontalBound: !1, offset: [0, 0] };
1775
+ var u = s.left, c = s.top, p = s.width, f = s.height, l = [[u, c], [u, c + f]], d = [[u, c], [u + p, c]], h = [[u + p, c], [u + p, c + f]], g = [[u, c + f], [u + p, c + f]];
1776
+ if (function(R, F, z, B) {
1777
+ return B === void 0 && (B = tn), R.every(function(G) {
1778
+ var k = ko(G, F);
1779
+ return k <= 0 === z || A(k) <= B;
1780
+ });
1781
+ }([[u, c], [u + p, c], [u, c + f], [u + p, c + f]], e, r)) return { isAllBound: !1, isBound: !1, isVerticalBound: !1, isHorizontalBound: !1, offset: [0, 0] };
1782
+ var v = We(e, a, d, i), m = We(e, a, g, i), x = We(e, a, l, o), y = We(e, a, h, o), E = v.isBound && m.isBound, S = v.isBound || m.isBound, b = x.isBound && y.isBound, w = x.isBound || y.isBound, _ = Kn(v.offset, m.offset), D = Kn(x.offset, y.offset), P = [0, 0], M = !1, T = !1;
1783
+ return A(D) < A(_) ? (P = [_, 0], M = S, T = E) : (P = [0, D], M = w, T = b), { isAllBound: T, isVerticalBound: S, isHorizontalBound: w, isBound: M, offset: P };
1784
+ }
1785
+ function We(n, t, e, r, i, o) {
1786
+ var a, s, u = O(t, 2), c = u[0], p = u[1], f = n[0], l = e[0], d = e[1], h = nr(d[1] - l[1]), g = p, v = -c / p;
1787
+ return nr(d[0] - l[0]) ? h ? { isBound: !1, offset: 0 } : c ? Ii((l[1] - f[1]) / v + f[0], l[0], d[0], r, i) : { isBound: s = A(a = l[1] - f[1]) <= 0, offset: s ? a : 0 } : g ? Ii(v * (l[0] - f[0]) + f[1], l[1], d[1], r, i) : { isBound: s = A(a = l[0] - f[0]) <= 0, offset: s ? a : 0 };
1788
+ }
1789
+ function Bo(n, t, e) {
1790
+ return t.map(function(r) {
1791
+ var i = ts(n, r), o = i.isBound, a = i.offset, s = i.isVerticalBound, u = i.isHorizontalBound, c = r.multiple, p = _e({ datas: e, distX: a[0], distY: a[1] }).map(function(f, l) {
1792
+ return f * (c[l] ? 2 / c[l] : 0);
1793
+ });
1794
+ return { sign: c, isBound: o, isVerticalBound: s, isHorizontalBound: u, isSnap: !1, offset: p };
1795
+ });
1796
+ }
1797
+ function ns(n, t, e) {
1798
+ var r, i = Bo(n, Fo(n, t, [0, 0], !1).map(function(f) {
1799
+ return C(C({}, f), { multiple: f.multiple.map(function(l) {
1800
+ return 2 * A(l);
1801
+ }) });
1802
+ }), e), o = Je(i, 0), a = Je(i, 1), s = 0, u = 0, c = o.isVerticalBound || a.isVerticalBound, p = o.isHorizontalBound || a.isHorizontalBound;
1803
+ return (c || p) && (r = O(function(f) {
1804
+ var l = f.datas, d = f.distX, h = f.distY;
1805
+ l.beforeMatrix;
1806
+ var g = l.matrix, v = l.is3d;
1807
+ l.startDragBeforeDist;
1808
+ var m = l.startDragDist, x = l.absoluteOrigin, y = v ? 4 : 3;
1809
+ return nt(gn(g, St(m, [d, h]), y), x);
1810
+ }({ datas: e, distX: -o.offset[0], distY: -a.offset[1] }), 2), s = r[0], u = r[1]), { vertical: { isBound: c, offset: s }, horizontal: { isBound: p, offset: u } };
1811
+ }
1812
+ function Fo(n, t, e, r) {
1813
+ var i = n.state, o = re(i.allMatrix, 100, 100, i.is3d ? 4 : 3), a = $t(o, [0, 0]);
1814
+ return function(s, u) {
1815
+ var c = [], p = s[0], f = s[1];
1816
+ return p && f ? c.push([[0, 2 * f], s, [-p, f]], [[2 * p, 0], s, [p, -f]]) : p ? (c.push([[2 * p, 0], [p, 1], [p, -1]]), u && c.push([[0, -1], [p, -1], [-p, -1]], [[0, 1], [p, 1], [-p, 1]])) : f ? (c.push([[0, 2 * f], [1, f], [-1, f]]), u && c.push([[-1, 0], [-1, f], [-1, -f]], [[1, 0], [1, f], [1, -f]])) : c.push([[-1, 0], [-1, -1], [-1, 1]], [[1, 0], [1, -1], [1, 1]], [[0, -1], [-1, -1], [1, -1]], [[0, 1], [-1, 1], [1, 1]]), c;
1817
+ }(e, r).map(function(s) {
1818
+ var u = O(s, 3), c = u[0], p = u[1], f = u[2], l = [$t(o, p), $t(o, f)], d = function(m) {
1819
+ var x = O(m, 2), y = x[0], E = x[1], S = E[0] - y[0], b = E[1] - y[1];
1820
+ Math.abs(S) < Tt && (S = 0), Math.abs(b) < Tt && (b = 0);
1821
+ var w = 0, _ = 0, D = 0;
1822
+ return S ? b ? (_ = 1, D = (w = -b / S) * y[0] - y[1]) : (_ = 1, D = -y[1]) : (w = -1, D = y[0]), [w, _, D].map(function(P) {
1823
+ return ft(P, Tt);
1824
+ });
1825
+ }(l), h = function(m, x) {
1826
+ var y = Dr([x[0][0], x[1][0]]), E = Dr([x[0][1], x[1][1]]);
1827
+ return { vertical: y <= m[0], horizontal: E <= m[1] };
1828
+ }(a, l), g = h.vertical, v = h.horizontal;
1829
+ return { multiple: c, centerSign: ko(a, l) <= 0, verticalSign: g, horizontalSign: v, lineConstants: d, line: [$t(t, p), $t(t, f)] };
1830
+ });
1831
+ }
1832
+ function Ar(n, t, e, r, i) {
1833
+ var o = function(f, l, d, h) {
1834
+ var g = l[0] - f[0], v = l[1] - f[1];
1835
+ if (A(g) < Tt && (g = 0), A(v) < Tt && (v = 0), !g) return h ? [0, 0] : [0, d];
1836
+ if (!v) return h ? [d, 0] : [0, 0];
1837
+ var m = v / g, x = f[1] - m * f[0];
1838
+ return h ? [d, m * (l[0] + d) + x - l[1]] : [(l[1] + d - x) / m - l[0], d];
1839
+ }(n, t, e, r);
1840
+ if (!o) return { isOutside: !1, offset: [0, 0] };
1841
+ var a = me(n, t), s = me(o, n), u = me(o, t), c = s > a || u > a, p = O(_e({ datas: i, distX: o[0], distY: o[1] }), 2);
1842
+ return { offset: [p[0], p[1]], isOutside: c };
1843
+ }
1844
+ function Yi(n, t) {
1845
+ return n.isBound ? n.offset : t.isSnap ? zr(t).offset : 0;
1846
+ }
1847
+ function es(n, t, e, r, i, o) {
1848
+ if (!Oo(n, "draggable")) return [{ isSnap: !1, isBound: !1, offset: 0 }, { isSnap: !1, isBound: !1, offset: 0 }];
1849
+ var a = ii(o.absolutePoses, [t, e]), s = ir(a), u = s.left, c = s.right, p = s.top, f = s.bottom, l = { horizontal: a.map(function(_) {
1850
+ return _[1];
1851
+ }), vertical: a.map(function(_) {
1852
+ return _[0];
1853
+ }) }, d = ni(n, i, Qa(Po(n.props.snapDirections), { left: u, right: c, top: p, bottom: f, center: (u + c) / 2, middle: (p + f) / 2 }), l), h = d.vertical, g = d.horizontal, v = ns(n, a, o), m = v.vertical, x = v.horizontal, y = h.isSnap, E = g.isSnap, S = h.isBound || m.isBound, b = g.isBound || x.isBound, w = O(function(_, D, P, M, T) {
1854
+ var R = O(D, 2), F = R[0], z = R[1], B = O(P, 2), G = B[0], k = B[1], I = O(M, 2), V = I[0], Z = I[1], et = O(T, 2), U = et[0], X = et[1], N = -U, H = -X;
1855
+ if (_ && F && z) {
1856
+ N = 0, H = 0;
1857
+ var L = [];
1858
+ if (G && k ? L.push([0, X], [U, 0]) : G ? L.push([U, 0]) : k ? L.push([0, X]) : V && Z ? L.push([0, X], [U, 0]) : V ? L.push([U, 0]) : Z && L.push([0, X]), L.length) {
1859
+ L.sort(function(j, J) {
1860
+ return En(nt([F, z], j)) - En(nt([F, z], J));
1861
+ });
1862
+ var Q = L[0];
1863
+ if (Q[0] && A(F) > Tt) N = -Q[0], H = z * A(F + N) / A(F) - z;
1864
+ else if (Q[1] && A(z) > Tt) {
1865
+ var pt = z;
1866
+ H = -Q[1], N = F * A(z + H) / A(pt) - F;
1867
+ }
1868
+ if (_ && k && G) if (A(N) > Tt && A(N) < A(U)) N *= Y = A(U) / A(N), H *= Y;
1869
+ else if (A(H) > Tt && A(H) < A(X)) {
1870
+ var Y;
1871
+ N *= Y = A(X) / A(H), H *= Y;
1872
+ } else N = Kn(-U, N), H = Kn(-X, H);
1873
+ }
1874
+ } else N = F || G ? -U : 0, H = z || k ? -X : 0;
1875
+ return [N, H];
1876
+ }(r, [t, e], [S, b], [y, E], [Kn(h.offset, m.offset), Kn(g.offset, x.offset)]), 2);
1877
+ return [{ isBound: S, isSnap: y, offset: w[0] }, { isBound: b, isSnap: E, offset: w[1] }];
1878
+ }
1879
+ function ni(n, t, e, r) {
1880
+ r === void 0 && (r = e);
1881
+ var i = function(h, g, v) {
1882
+ var m = h || {}, x = m.position, y = x === void 0 ? "client" : x, E = m.left, S = E === void 0 ? -1 / 0 : E, b = m.top, w = b === void 0 ? -1 / 0 : b, _ = m.right, D = _ === void 0 ? 1 / 0 : _, P = m.bottom, M = { position: y, left: S, top: w, right: D, bottom: P === void 0 ? 1 / 0 : P };
1883
+ return { vertical: Ai(M, g, !0), horizontal: Ai(M, v, !1) };
1884
+ }(To(n), r.vertical, r.horizontal), o = i.horizontal, a = i.vertical, s = t ? { horizontal: { isSnap: !1, index: -1 }, vertical: { isSnap: !1, index: -1 } } : Ro(n, e.vertical, e.horizontal, void 0, void 0, void 0, void 0), u = s.horizontal, c = s.vertical, p = Yi(o[0], u), f = Yi(a[0], c), l = A(p), d = A(f);
1885
+ return { horizontal: { isBound: o[0].isBound, isSnap: u.isSnap, snapIndex: u.index, offset: p, dist: l, bounds: o, snap: u }, vertical: { isBound: a[0].isBound, isSnap: c.isSnap, snapIndex: c.index, offset: f, dist: d, bounds: a, snap: c } };
1886
+ }
1887
+ function rs(n, t, e, r, i, o) {
1888
+ return e.map(function(a) {
1889
+ var s = O(a, 2), u = s[0], c = s[1], p = $t(t, u), f = $t(t, c), l = r ? function(D, P, M, T) {
1890
+ var R = function(U, X, N) {
1891
+ var H = To(U), L = H.left, Q = H.top, pt = H.right, Y = H.bottom, j = O(N, 2), J = j[0], W = j[1], ht = O(nt(N, X), 2), Pt = ht[0], zt = ht[1];
1892
+ A(Pt) < tn && (Pt = 0), A(zt) < tn && (zt = 0);
1893
+ var $ = zt > 0, it = Pt > 0, lt = { isBound: !1, offset: 0, pos: 0 }, st = { isBound: !1, offset: 0, pos: 0 };
1894
+ if (Pt === 0 && zt === 0) return { vertical: lt, horizontal: st };
1895
+ if (Pt === 0) $ ? Y < W && (st.pos = Y, st.offset = W - Y) : Q > W && (st.pos = Q, st.offset = W - Q);
1896
+ else if (zt === 0) it ? pt < J && (lt.pos = pt, lt.offset = J - pt) : L > J && (lt.pos = L, lt.offset = J - L);
1897
+ else {
1898
+ var dt = zt / Pt, wt = N[1] - dt * J, ot = 0, gt = 0, ut = !1;
1899
+ it && pt <= J ? (ot = dt * pt + wt, gt = pt, ut = !0) : !it && J <= L && (ot = dt * L + wt, gt = L, ut = !0), ut && (ot < Q || ot > Y) && (ut = !1), ut || ($ && Y <= W ? (gt = ((ot = Y) - wt) / dt, ut = !0) : !$ && W <= Q && (gt = ((ot = Q) - wt) / dt, ut = !0)), ut && (lt.isBound = !0, lt.pos = gt, lt.offset = J - gt, st.isBound = !0, st.pos = ot, st.offset = W - ot);
1900
+ }
1901
+ return { vertical: lt, horizontal: st };
1902
+ }(D, P, M), F = R.horizontal, z = R.vertical, B = T ? { horizontal: { isSnap: !1 }, vertical: { isSnap: !1 } } : function(U, X, N) {
1903
+ var H = O(N, 2), L = H[0], Q = H[1], pt = O(X, 2), Y = pt[0], j = pt[1], J = O(nt(N, X), 2), W = J[0], ht = J[1], Pt = ht > 0, zt = W > 0;
1904
+ W = nr(W), ht = nr(ht);
1905
+ var $ = { isSnap: !1, offset: 0, pos: 0 }, it = { isSnap: !1, offset: 0, pos: 0 };
1906
+ if (W === 0 && ht === 0) return { vertical: $, horizontal: it };
1907
+ var lt = Ro(U, W ? [L] : [], ht ? [Q] : [], [], [], void 0, void 0), st = lt.vertical, dt = lt.horizontal;
1908
+ st.posInfos.filter(function(Dt) {
1909
+ var kt = Dt.pos;
1910
+ return zt ? kt >= Y : kt <= Y;
1911
+ }), dt.posInfos.filter(function(Dt) {
1912
+ var kt = Dt.pos;
1913
+ return Pt ? kt >= j : kt <= j;
1914
+ }), st.isSnap = st.posInfos.length > 0, dt.isSnap = dt.posInfos.length > 0;
1915
+ var wt = zr(st), ot = wt.isSnap, gt = wt.guideline, ut = zr(dt), At = ut.isSnap, qt = ut.guideline, K = At ? qt.pos[1] : 0, tt = ot ? gt.pos[0] : 0;
1916
+ if (W === 0) At && (it.isSnap = !0, it.pos = qt.pos[1], it.offset = Q - it.pos);
1917
+ else if (ht === 0) ot && ($.isSnap = !0, $.pos = tt, $.offset = L - tt);
1918
+ else {
1919
+ var yt = ht / W, Mt = N[1] - yt * L, at = 0, vt = 0, ct = !1;
1920
+ ot ? (at = yt * (vt = tt) + Mt, ct = !0) : At && (vt = ((at = K) - Mt) / yt, ct = !0), ct && ($.isSnap = !0, $.pos = vt, $.offset = L - vt, it.isSnap = !0, it.pos = at, it.offset = Q - at);
1921
+ }
1922
+ return { vertical: $, horizontal: it };
1923
+ }(D, P, M), G = B.horizontal, k = B.vertical, I = Xi(F, G), V = Xi(z, k), Z = A(I), et = A(V);
1924
+ return { horizontal: { isBound: F.isBound, isSnap: G.isSnap, offset: I, dist: Z }, vertical: { isBound: z.isBound, isSnap: k.isSnap, offset: V, dist: et } };
1925
+ }(n, p, f, i) : ni(n, i, { vertical: [f[0]], horizontal: [f[1]] }), d = l.horizontal, h = d.offset, g = d.isBound, v = d.isSnap, m = l.vertical, x = m.offset, y = m.isBound, E = m.isSnap, S = nt(c, u);
1926
+ if (!x && !h) return { isBound: y || g, isSnap: E || v, sign: S, offset: [0, 0] };
1927
+ var b = function(D, P, M, T) {
1928
+ var R = sn(D, P) / Math.PI * 180, F = M.vertical, z = F.isBound, B = F.isSnap, G = F.dist, k = M.horizontal, I = k.isBound, V = k.isSnap, Z = R % 180, et = Z < 3 || Z > 177, U = Z > 87 && Z < 93;
1929
+ return k.dist < G && (z || B && !U && (!T || !et)) ? "vertical" : !I && (!V || et || T && U) ? "" : "horizontal";
1930
+ }(p, f, l, r);
1931
+ if (!b) return { sign: S, isBound: !1, isSnap: !1, offset: [0, 0] };
1932
+ var w = b === "vertical", _ = [0, 0];
1933
+ return _ = (_ = r || A(c[0]) !== 1 || A(c[1]) !== 1 || u[0] === c[0] || u[1] === c[1] ? Ar(p, f, -(w ? x : h), w, o).offset : _e({ datas: o, distX: -x, distY: -h })).map(function(D, P) {
1934
+ return D * (S[P] ? 2 / S[P] : 0);
1935
+ }), { sign: S, isBound: w ? y : g, isSnap: w ? E : v, offset: _ };
1936
+ });
1937
+ }
1938
+ function Xi(n, t) {
1939
+ return n.isBound ? n.offset : t.isSnap ? t.offset : 0;
1940
+ }
1941
+ var bn = { name: "draggable", props: ["draggable", "throttleDrag", "throttleDragRotate", "hideThrottleDragRotateLine", "startDragRotate", "edgeDraggable"], events: ["dragStart", "drag", "dragEnd", "dragGroupStart", "dragGroup", "dragGroupEnd"], requestStyle: function() {
1942
+ return ["left", "top", "right", "bottom"];
1943
+ }, requestChildStyle: function() {
1944
+ return ["left", "top", "right", "bottom"];
1945
+ }, render: function(n, t) {
1946
+ var e = n.props, r = e.hideThrottleDragRotateLine, i = e.throttleDragRotate, o = e.zoom, a = n.getState(), s = a.dragInfo, u = a.beforeOrigin;
1947
+ if (r || !i || !s) return [];
1948
+ var c = s.dist;
1949
+ if (!c[0] && !c[1]) return [];
1950
+ var p = En(c), f = sn(c, [0, 0]);
1951
+ return [t.createElement("div", { className: xt("line", "horizontal", "dragline", "dashed"), key: "dragRotateGuideline", style: { width: "".concat(p, "px"), transform: "translate(".concat(u[0], "px, ").concat(u[1], "px) rotate(").concat(f, "rad) scaleY(").concat(o, ")") } })];
1952
+ }, dragStart: function(n, t) {
1953
+ var e = t.datas, r = t.parentEvent, i = t.parentGesto, o = n.state, a = o.gestos, s = o.style;
1954
+ if (a.draggable) return !1;
1955
+ a.draggable = i || n.targetGesto, e.datas = {}, e.left = parseFloat(s.left || "") || 0, e.top = parseFloat(s.top || "") || 0, e.bottom = parseFloat(s.bottom || "") || 0, e.right = parseFloat(s.right || "") || 0, e.startValue = [0, 0], Mo(n, t), function(c, p, f) {
1956
+ hr(c, p, te($n(p).startTransforms, function(l) {
1957
+ return l.indexOf("".concat(f, "(")) === 0;
1958
+ }));
1959
+ }(n, t, "translate"), function(c, p) {
1960
+ p.absolutePoses = Rn(c.state);
1961
+ }(n, e), e.prevDist = [0, 0], e.prevBeforeDist = [0, 0], e.isDrag = !1, e.deltaOffset = [0, 0];
1962
+ var u = mt(n, t, C({ set: function(c) {
1963
+ e.startValue = c;
1964
+ } }, function(c, p) {
1965
+ var f = $n(p);
1966
+ return { setTransform: function(l, d) {
1967
+ d === void 0 && (d = -1), f.startTransforms = Ht(l) ? l : Me(l), hr(c, p, d);
1968
+ }, setTransformIndex: function(l) {
1969
+ hr(c, p, l);
1970
+ } };
1971
+ }(n, t)));
1972
+ return (r || rt(n, "onDragStart", u)) !== !1 ? (e.isDrag = !0, n.state.dragInfo = { startRect: n.getRect(), dist: [0, 0] }) : (a.draggable = null, e.isPinch = !1), !!e.isDrag && u;
1973
+ }, drag: function(n, t) {
1974
+ if (t) {
1975
+ ja(n, t, "translate");
1976
+ var e = t.datas, r = t.parentEvent, i = t.parentFlag, o = t.isPinch, a = t.deltaOffset, s = t.useSnap, u = t.isRequest, c = t.isGroup, p = t.parentThrottleDrag, f = t.distX, l = t.distY, d = e.isDrag, h = e.prevDist, g = e.prevBeforeDist, v = e.startValue;
1977
+ if (d) {
1978
+ a && (f += a[0], l += a[1]);
1979
+ var m = n.props, x = m.parentMoveable, y = c ? 0 : m.throttleDrag || p || 0, E = r ? 0 : m.throttleDragRotate || 0, S = 0, b = !1, w = !1, _ = !1, D = !1;
1980
+ if (!r && E > 0 && (f || l)) {
1981
+ var P = m.startDragRotate || 0, M = ft(P + 180 * sn([0, 0], [f, l]) / Math.PI, E) - P, T = l * Math.abs(Math.cos((M - 90) / 180 * Math.PI)), R = En([f * Math.abs(Math.cos(M / 180 * Math.PI)), T]);
1982
+ S = M * Math.PI / 180, f = R * Math.cos(S), l = R * Math.sin(S);
1983
+ }
1984
+ if (!o && !r && !i) {
1985
+ var F = O(es(n, f, l, E, !s && u || a, e), 2), z = F[0], B = F[1];
1986
+ b = z.isSnap, w = z.isBound, _ = B.isSnap, D = B.isBound, f += z.offset, l += B.offset;
1987
+ }
1988
+ var G = St(Do({ datas: e, distX: f, distY: l }), v), k = St(Va({ datas: e, distX: f, distY: l }), v);
1989
+ Ei(k, tn), Ei(G, tn), E || (b || w || (k[0] = ft(k[0], y), G[0] = ft(G[0], y)), _ || D || (k[1] = ft(k[1], y), G[1] = ft(G[1], y)));
1990
+ var I = nt(G, v), V = nt(k, v), Z = nt(V, h), et = nt(I, g);
1991
+ e.prevDist = V, e.prevBeforeDist = I, e.passDelta = Z, e.passDist = V;
1992
+ var U = e.left + I[0], X = e.top + I[1], N = e.right - I[0], H = e.bottom - I[1], L = function(J, W, ht) {
1993
+ return "".concat(J.beforeFunctionTexts.join(" "), " ").concat(J.isAppendTransform ? ht : W, " ").concat(J.afterFunctionTexts.join(" "));
1994
+ }(e, "translate(".concat(k[0], "px, ").concat(k[1], "px)"), "translate(".concat(V[0], "px, ").concat(V[1], "px)"));
1995
+ if (function(J, W) {
1996
+ $n(J).nextTransforms = Me(W);
1997
+ }(t, L), n.state.dragInfo.dist = r ? [0, 0] : V, r || x || !Z.every(function(J) {
1998
+ return !J;
1999
+ }) || !et.some(function(J) {
2000
+ return !J;
2001
+ })) {
2002
+ var Q = n.state, pt = Q.width, Y = Q.height, j = mt(n, t, C({ transform: L, dist: V, delta: Z, translate: k, beforeDist: I, beforeDelta: et, beforeTranslate: G, left: U, top: X, right: N, bottom: H, width: pt, height: Y, isPinch: o }, Zn({ transform: L }, t)));
2003
+ return !r && rt(n, "onDrag", j), j;
2004
+ }
2005
+ }
2006
+ }
2007
+ }, dragAfter: function(n, t) {
2008
+ var e = t.datas, r = e.deltaOffset;
2009
+ return !(!r[0] && !r[1]) && (e.deltaOffset = [0, 0], this.drag(n, C(C({}, t), { deltaOffset: r })));
2010
+ }, dragEnd: function(n, t) {
2011
+ var e = t.parentEvent, r = t.datas;
2012
+ if (n.state.dragInfo = null, r.isDrag) {
2013
+ r.isDrag = !1;
2014
+ var i = Oe(n, t, {});
2015
+ return !e && rt(n, "onDragEnd", i), i;
2016
+ }
2017
+ }, dragGroupStart: function(n, t) {
2018
+ var e, r, i = t.datas, o = t.clientX, a = t.clientY, s = this.dragStart(n, t);
2019
+ if (!s) return !1;
2020
+ var u = gr(n, this, "dragStart", [o || 0, a || 0], t, 0, "draggable"), c = u.childEvents, p = u.eventParams, f = rt(n, "onDragGroupStart", C(C({}, s), { targets: n.props.targets, events: p }));
2021
+ i.isDrag = f !== !1;
2022
+ var l = (r = (e = c[0]) === null || e === void 0 ? void 0 : e.datas.startValue) !== null && r !== void 0 ? r : [0, 0];
2023
+ return i.throttleOffset = [l[0] % 1, l[1] % 1], !!i.isDrag && s;
2024
+ }, dragGroup: function(n, t) {
2025
+ if (t.datas.isDrag) {
2026
+ var e = this.drag(n, C(C({}, t), { parentThrottleDrag: n.props.throttleDrag })), r = gr(n, this, "drag", t.datas.passDelta, t, 0, "draggable").eventParams;
2027
+ if (e) {
2028
+ var i = C({ targets: n.props.targets, events: r }, e);
2029
+ return rt(n, "onDragGroup", i), i;
2030
+ }
2031
+ }
2032
+ }, dragGroupEnd: function(n, t) {
2033
+ var e = t.isDrag;
2034
+ if (t.datas.isDrag) {
2035
+ this.dragEnd(n, t);
2036
+ var r = gr(n, this, "dragEnd", [0, 0], t, 0, "draggable").eventParams;
2037
+ return rt(n, "onDragGroupEnd", Oe(n, t, { targets: n.props.targets, events: r })), e;
2038
+ }
2039
+ }, request: function(n) {
2040
+ var t = {}, e = n.getRect(), r = 0, i = 0, o = !1;
2041
+ return { isControl: !1, requestStart: function(a) {
2042
+ return o = a.useSnap, { datas: t, useSnap: o };
2043
+ }, request: function(a) {
2044
+ return "x" in a ? r = a.x - e.left : "deltaX" in a && (r += a.deltaX), "y" in a ? i = a.y - e.top : "deltaY" in a && (i += a.deltaY), { datas: t, distX: r, distY: i, useSnap: o };
2045
+ }, requestEnd: function() {
2046
+ return { datas: t, isDrag: !0, useSnap: o };
2047
+ } };
2048
+ }, unset: function(n) {
2049
+ n.state.gestos.draggable = null, n.state.dragInfo = null;
2050
+ } }, he, Ni = Xr("resizable"), is = { name: "resizable", ableGroup: "size", canPinch: !0, props: ["resizable", "throttleResize", "renderDirections", "displayAroundControls", "keepRatio", "resizeFormat", "keepRatioFinally", "edge", "checkResizableError"], events: ["resizeStart", "beforeResize", "resize", "resizeEnd", "resizeGroupStart", "beforeResizeGroup", "resizeGroup", "resizeGroupEnd"], render: (he = "resizable", function(n, t) {
2051
+ var e = Se(n.props, he).edge;
2052
+ return e && (e === !0 || e.length) ? q(q([], O(_o(t, he, e, n.getState().renderPoses, n.props.zoom)), !1), O(function(r, i, o) {
2053
+ return zi(r, ["nw", "ne", "sw", "se"], i, o);
2054
+ }(n, he, t)), !1) : function(r, i, o) {
2055
+ return zi(r, Jr, i, o);
2056
+ }(n, he, t);
2057
+ }), dragControlCondition: Ni, viewClassName: /* @__PURE__ */ function(n) {
2058
+ return function(t) {
2059
+ if (!t.isDragging(n)) return "";
2060
+ var e = function(i, o) {
2061
+ var a, s = i.targetGesto, u = i.controlGesto;
2062
+ return s?.isFlag() && (a = s.getEventData()[o]), !a && u?.isFlag() && (a = u.getEventData()[o]), a || {};
2063
+ }(t, n), r = e.deg;
2064
+ return r ? xt("view-control-rotation".concat(r)) : "";
2065
+ };
2066
+ }("resizable"), dragControlStart: function(n, t) {
2067
+ var e, r = t.inputEvent, i = t.isPinch, o = t.isGroup, a = t.parentDirection, s = t.parentGesto, u = t.datas, c = t.parentFixedDirection, p = t.parentEvent, f = function(D, P, M, T) {
2068
+ var R;
2069
+ return D ? R = D : P ? R = [0, 0] : R = function(F, z) {
2070
+ if (F) {
2071
+ var B = F.getAttribute("data-rotation") || "", G = F.getAttribute("data-direction");
2072
+ if (z.deg = B, !!G) {
2073
+ var k = [0, 0];
2074
+ return G.indexOf("w") > -1 && (k[0] = -1), G.indexOf("e") > -1 && (k[0] = 1), G.indexOf("n") > -1 && (k[1] = -1), G.indexOf("s") > -1 && (k[1] = 1), k;
2075
+ }
2076
+ }
2077
+ }(M.target, T), R;
2078
+ }(a, i, r, u), l = n.state, d = l.target, h = l.width, g = l.height, v = l.gestos;
2079
+ if (!f || !d || v.resizable) return !1;
2080
+ v.resizable = s || n.controlGesto, !i && Mo(n, t), u.datas = {}, u.direction = f, u.startOffsetWidth = h, u.startOffsetHeight = g, u.prevWidth = 0, u.prevHeight = 0, u.minSize = [0, 0], u.startWidth = l.inlineCSSWidth || l.cssWidth, u.startHeight = l.inlineCSSHeight || l.cssHeight, u.maxSize = [1 / 0, 1 / 0], o || (u.minSize = [l.minOffsetWidth, l.minOffsetHeight], u.maxSize = [l.maxOffsetWidth, l.maxOffsetHeight]);
2081
+ var m = n.props.transformOrigin || "% %";
2082
+ function x(D) {
2083
+ u.ratio = D && isFinite(D) ? D : 0;
2084
+ }
2085
+ function y(D) {
2086
+ var P = function(M, T) {
2087
+ return { fixedPosition: $t(M, T), fixedDirection: T, fixedOffset: [0, 0] };
2088
+ }(u.startPositions, D);
2089
+ u.fixedDirection = P.fixedDirection, u.fixedPosition = P.fixedPosition, u.fixedOffset = P.fixedOffset;
2090
+ }
2091
+ function E(D) {
2092
+ var P = function(M, T) {
2093
+ var R = M.allMatrix, F = M.is3d, z = M.width, B = M.height, G = F ? 4 : 3, k = function(I, V, Z) {
2094
+ return [V ? I[0] / (V / 2) - 1 : 0, Z ? I[1] / (Z / 2) - 1 : 0];
2095
+ }(T, z, B);
2096
+ return { fixedPosition: yn(R, T, G), fixedDirection: k, fixedOffset: [z ? 0 : T[0], B ? 0 : T[1]] };
2097
+ }(n.state, D);
2098
+ u.fixedDirection = P.fixedDirection, u.fixedPosition = P.fixedPosition, u.fixedOffset = P.fixedOffset;
2099
+ }
2100
+ function S(D) {
2101
+ u.minSize = [Ut("".concat(D[0]), 0) || 0, Ut("".concat(D[1]), 0) || 0];
2102
+ }
2103
+ function b(D) {
2104
+ var P = [D[0] || 1 / 0, D[1] || 1 / 0];
2105
+ Ve(P[0]) && !isFinite(P[0]) || (P[0] = Ut("".concat(P[0]), 0) || 1 / 0), Ve(P[1]) && !isFinite(P[1]) || (P[1] = Ut("".concat(P[1]), 0) || 1 / 0), u.maxSize = P;
2106
+ }
2107
+ u.transformOrigin = oe(m) ? m.split(" ") : m, u.startOffsetMatrix = l.offsetMatrix, u.startTransformOrigin = l.transformOrigin, u.isWidth = (e = t?.parentIsWidth) !== null && e !== void 0 ? e : !f[0] && !f[1] || f[0] || !f[1], u.startPositions = Rn(n.state), x(h / g), y(c || [-f[0], -f[1]]), u.setFixedDirection = y, u.setFixedPosition = E, u.setMin = S, u.setMax = b;
2108
+ var w = mt(n, t, { direction: f, startRatio: u.ratio, set: function(D) {
2109
+ var P = O(D, 2), M = P[0], T = P[1];
2110
+ u.startWidth = M, u.startHeight = T;
2111
+ }, setMin: S, setMax: b, setRatio: x, setFixedDirection: y, setFixedPosition: E, setOrigin: function(D) {
2112
+ u.transformOrigin = D;
2113
+ }, dragStart: bn.dragStart(n, new wo().dragStart([0, 0], t)) }), _ = p || rt(n, "onResizeStart", w);
2114
+ return u.startFixedDirection = u.fixedDirection, u.startFixedPosition = u.fixedPosition, _ !== !1 && (u.isResize = !0, n.state.snapRenderInfo = { request: t.isRequest, direction: f }), !!u.isResize && w;
2115
+ }, dragControl: function(n, t) {
2116
+ var e, r = t.datas, i = t.parentFlag, o = t.isPinch, a = t.parentKeepRatio, s = t.dragClient, u = t.parentDist, c = t.useSnap, p = t.isRequest, f = t.isGroup, l = t.parentEvent, d = t.resolveMatrix, h = r.isResize, g = r.transformOrigin, v = r.startWidth, m = r.startHeight, x = r.prevWidth, y = r.prevHeight, E = r.minSize, S = r.maxSize, b = r.ratio, w = r.startOffsetWidth, _ = r.startOffsetHeight, D = r.isWidth;
2117
+ if (h) {
2118
+ if (d) {
2119
+ var P = n.state.is3d, M = r.startOffsetMatrix, T = r.startTransformOrigin, R = P ? 4 : 3, F = Ur($e(t)), z = Math.sqrt(F.length);
2120
+ R !== z && (F = In(F, z, R));
2121
+ var B = Co(M, F, T, R), G = re(B, w, _, R);
2122
+ r.startPositions = G, r.nextTargetMatrix = F, r.nextAllMatrix = B;
2123
+ }
2124
+ var k = Se(n.props, "resizable"), I = k.resizeFormat, V = k.throttleResize, Z = V === void 0 ? i ? 0 : 1 : V, et = k.parentMoveable, U = k.keepRatioFinally, X = r.direction, N = X, H = 0, L = 0;
2125
+ X[0] || X[1] || (N = [1, 1]);
2126
+ var Q = b && (a ?? k.keepRatio) || !1, pt = O(At(), 2), Y = pt[0], j = pt[1];
2127
+ l || (r.setFixedDirection(r.fixedDirection), rt(n, "onBeforeResize", mt(n, t, { startFixedDirection: r.startFixedDirection, startFixedPosition: r.startFixedPosition, setFixedDirection: function(K) {
2128
+ var tt;
2129
+ return r.setFixedDirection(K), tt = O(At(), 2), Y = tt[0], j = tt[1], [Y, j];
2130
+ }, setFixedPosition: function(K) {
2131
+ var tt;
2132
+ return r.setFixedPosition(K), tt = O(At(), 2), Y = tt[0], j = tt[1], [Y, j];
2133
+ }, boundingWidth: Y, boundingHeight: j, setSize: function(K) {
2134
+ var tt;
2135
+ tt = O(K, 2), Y = tt[0], j = tt[1];
2136
+ } }, !0)));
2137
+ var J = s;
2138
+ s || (J = !i && o ? function(K, tt) {
2139
+ return $t(Rn(K.state), tt);
2140
+ }(n, [0, 0]) : r.fixedPosition);
2141
+ var W = [0, 0];
2142
+ if (o || (W = function(K, tt, yt, Mt, at, vt, ct) {
2143
+ if (!Oo(K, "resizable")) return [0, 0];
2144
+ var Dt = ct.fixedDirection, kt = ct.nextAllMatrix, cn = K.state, ln = cn.allMatrix, en = cn.is3d;
2145
+ return function(Et, Rt, Yt, rn, Lt, vn, jt, Vt) {
2146
+ for (var fn = Rn(Et.state), Zt = Et.props.keepRatio, Xt = 0, Jt = 0, Bt = 0; Bt < 2; ++Bt) {
2147
+ var mn = os(Et, Rt(Xt, Jt), Lt, Zt, jt, Vt), pn = mn.width, dn = mn.height, Ct = pn.isBound, Bn = dn.isBound, Gt = pn.offset, Mn = dn.offset;
2148
+ if (Bt === 1 && (Ct || (Gt = 0), Bn || (Mn = 0)), Bt === 0 && jt && !Ct && !Bn) return [0, 0];
2149
+ if (Zt) {
2150
+ var se = A(Gt) * (Yt ? 1 / Yt : 1), ue = A(Mn) * (rn ? 1 / rn : 1);
2151
+ (Ct && Bn ? se < ue : Bn || !Ct && se < ue) ? Gt = Yt * Mn / rn : Mn = rn * Gt / Yt;
2152
+ }
2153
+ Xt += Gt, Jt += Mn;
2154
+ }
2155
+ if (!Zt && Lt[0] && Lt[1]) {
2156
+ var ce = function(_n, Fn, on, Nt, Sn) {
2157
+ var hn = [-on[0], -on[1]], Wt = _n.state, Qt = Wt.width, Nn = Wt.height, Tn = _n.props.bounds, le = 1 / 0, fe = 1 / 0;
2158
+ if (Tn) {
2159
+ var Be = [[on[0], -on[1]], [-on[0], on[1]]], pe = Tn.left, or = pe === void 0 ? -1 / 0 : pe, Fe = Tn.top, na = Fe === void 0 ? -1 / 0 : Fe, si = Tn.right, ea = si === void 0 ? 1 / 0 : si, ui = Tn.bottom, ra = ui === void 0 ? 1 / 0 : ui;
2160
+ Be.forEach(function(ar) {
2161
+ var ia = ar[0] !== hn[0], oa = ar[1] !== hn[1], zn = $t(Fn, ar), ze = 360 * sn(Nt, zn) / Math.PI;
2162
+ if (oa) {
2163
+ var de = zn.slice();
2164
+ (A(ze - 360) < 2 || A(ze - 180) < 2) && (de[1] = Nt[1]);
2165
+ var ci = Ar(Nt, de, (Nt[1] < zn[1] ? ra : na) - zn[1], !1, Sn), li = O(ci.offset, 2)[1], aa = ci.isOutside;
2166
+ isNaN(li) || (fe = Nn + (aa ? 1 : -1) * A(li));
2167
+ }
2168
+ if (ia) {
2169
+ de = zn.slice(), (A(ze - 90) < 2 || A(ze - 270) < 2) && (de[0] = Nt[0]);
2170
+ var fi = Ar(Nt, de, (Nt[0] < zn[0] ? ea : or) - zn[0], !0, Sn), pi = O(fi.offset, 1)[0], sa = fi.isOutside;
2171
+ isNaN(pi) || (le = Qt + (sa ? 1 : -1) * A(pi));
2172
+ }
2173
+ });
2174
+ }
2175
+ return { maxWidth: le, maxHeight: fe };
2176
+ }(Et, fn, Lt, vn, Vt), Dn = ce.maxWidth, Cn = ce.maxHeight, ke = O(function(_n, Fn, on, Nt, Sn, hn, Wt, Qt, Nn) {
2177
+ var Tn = $t(Fn, Wt), le = ni(_n, Qt, { vertical: [Tn[0]], horizontal: [Tn[1]] }), fe = le.horizontal.offset, Be = le.vertical.offset;
2178
+ if (ft(Be, pr) || ft(fe, pr)) {
2179
+ var pe = O(_e({ datas: Nn, distX: -Be, distY: -fe }), 2), or = pe[0], Fe = pe[1];
2180
+ return [Math.min(Sn || 1 / 0, on + Wt[0] * or) - on, Math.min(hn || 1 / 0, Nt + Wt[1] * Fe) - Nt];
2181
+ }
2182
+ return [0, 0];
2183
+ }(Et, Rt(Xt, Jt).map(function(_n) {
2184
+ return _n.map(function(Fn) {
2185
+ return ft(Fn, pr);
2186
+ });
2187
+ }), Yt + Xt, rn + Jt, Dn, Cn, Lt, jt, Vt), 2);
2188
+ Xt += Gt = ke[0], Jt += Mn = ke[1];
2189
+ }
2190
+ return [Xt, Jt];
2191
+ }(K, function(Et, Rt) {
2192
+ return function(Yt, rn, Lt, vn, jt, Vt) {
2193
+ var fn = re(Yt, rn, Lt, Vt ? 4 : 3), Zt = $t(fn, vn);
2194
+ return ii(fn, nt(jt, Zt));
2195
+ }(kt || ln, tt + Et, yt + Rt, Dt, at, en);
2196
+ }, tt, yt, Mt, at, vt, ct);
2197
+ }(n, Y, j, X, J, !c && p, r)), u && (!u[0] && (W[0] = 0), !u[1] && (W[1] = 0)), Q) {
2198
+ N[0] && N[1] && W[0] && W[1] && (A(W[0]) > A(W[1]) ? W[1] = 0 : W[0] = 0);
2199
+ var ht = !W[0] && !W[1];
2200
+ ht && qt(), N[0] && !N[1] || W[0] && !W[1] || ht && D ? (Y += W[0], j = Y / b) : (!N[0] && N[1] || !W[0] && W[1] || ht && !D) && (j += W[1], Y = j * b);
2201
+ } else Y += W[0], j += W[1], Y = Math.max(0, Y), j = Math.max(0, j);
2202
+ e = O(function(K, tt, yt, Mt) {
2203
+ if (!Mt) return K.map(function(Rt, Yt) {
2204
+ return Mr(Rt, tt[Yt], yt[Yt]);
2205
+ });
2206
+ var at = K[0], vt = K[1], ct = Mt === !0 ? at / vt : Mt, Dt = xi(K, tt, !1, ct), kt = Dt[0], cn = Dt[1], ln = xi(K, yt, !0, ct), en = ln[0], Et = ln[1];
2207
+ return at < kt || vt < cn ? (at = kt, vt = cn) : (at > en || vt > Et) && (at = en, vt = Et), [at, vt];
2208
+ }([Y, j], E, S, !!Q && b), 2), Y = e[0], j = e[1], qt(), Q && (f || U) && (D ? j = Y / b : Y = j * b);
2209
+ var Pt = [(H = Y - w) - x, (L = j - _) - y];
2210
+ r.prevWidth = H, r.prevHeight = L;
2211
+ var zt = Za(n, Y, j, J, g, r);
2212
+ if (et || !Pt.every(function(K) {
2213
+ return !K;
2214
+ }) || !zt.every(function(K) {
2215
+ return !K;
2216
+ })) {
2217
+ var $, it, lt, st, dt = bn.drag(n, So(t, n.state, zt, !!o, 0, "draggable")), wt = dt.transform, ot = v + H, gt = m + L, ut = mt(n, t, C({ width: ot, height: gt, offsetWidth: Math.round(Y), offsetHeight: Math.round(j), startRatio: b, boundingWidth: Y, boundingHeight: j, direction: X, dist: [H, L], delta: Pt, isPinch: !!o, drag: dt }, ($ = { style: { width: "".concat(ot, "px"), height: "".concat(gt, "px") }, transform: wt }, lt = t, st = (it = dt).afterTransform || it.transform, C(C({}, Zn(C(C(C({}, $.style), it.style), { transform: st }), lt)), { afterTransform: st, transform: $.transform }))));
2218
+ return !l && rt(n, "onResize", ut), ut;
2219
+ }
2220
+ }
2221
+ function At() {
2222
+ var K = r.fixedDirection, tt = function(at, vt, ct, Dt) {
2223
+ var kt, cn = ct.ratio, ln = ct.startOffsetWidth, en = ct.startOffsetHeight, Et = 0, Rt = 0, Yt = Dt.distX, rn = Dt.distY, Lt = Dt.pinchScale, vn = Dt.parentDistance, jt = Dt.parentDist, Vt = Dt.parentScale, fn = ct.fixedDirection, Zt = [0, 1].map(function(dn) {
2224
+ return A(at[dn] - fn[dn]);
2225
+ }), Xt = [0, 1].map(function(dn) {
2226
+ var Ct = Zt[dn];
2227
+ return Ct !== 0 && (Ct = 2 / Ct), Ct;
2228
+ });
2229
+ if (jt) Et = jt[0], Rt = jt[1], vt && (Et ? Rt || (Rt = Et / cn) : Et = Rt * cn);
2230
+ else if (Ve(Lt)) Et = (Lt - 1) * ln, Rt = (Lt - 1) * en;
2231
+ else if (Vt) Et = (Vt[0] - 1) * ln, Rt = (Vt[1] - 1) * en;
2232
+ else if (vn) {
2233
+ var Jt = ln * Zt[0], Bt = en * Zt[1], mn = En([Jt, Bt]);
2234
+ Et = vn / mn * Jt * Xt[0], Rt = vn / mn * Bt * Xt[1];
2235
+ } else {
2236
+ var pn = _e({ datas: ct, distX: Yt, distY: rn });
2237
+ pn = Xt.map(function(dn, Ct) {
2238
+ return pn[Ct] * dn;
2239
+ }), kt = O(function(dn, Ct, Bn, Gt, Mn) {
2240
+ var se = O(dn, 2), ue = se[0], ce = se[1], Dn = 0, Cn = 0;
2241
+ if (Mn && ue && ce) {
2242
+ var ke = sn([0, 0], Ct), _n = sn([0, 0], Gt), Fn = En(Ct), on = Math.cos(ke - _n) * Fn;
2243
+ if (Gt[0]) if (Gt[1]) {
2244
+ var Nt = Gt[0] * ue, Sn = Gt[1] * ce, hn = Math.atan2(Nt + Ct[0], Sn + Ct[1]), Wt = Math.atan2(Nt, Sn);
2245
+ hn < 0 && (hn += 2 * Math.PI), Wt < 0 && (Wt += 2 * Math.PI);
2246
+ var Qt = 0;
2247
+ (Qt = A(hn - Wt) < Math.PI / 2 || A(hn - Wt) > Math.PI / 2 * 3 ? hn - Wt : hn - (Wt += Math.PI)) > 2 * Math.PI ? Qt -= 2 * Math.PI : Qt > Math.PI ? Qt = 2 * Math.PI - Qt : Qt < -Math.PI && (Qt = -2 * Math.PI - Qt);
2248
+ var Nn = En([Nt + Ct[0], Sn + Ct[1]]) * Math.cos(Qt);
2249
+ Dn = Nn * Math.sin(Wt) - Nt, Cn = Nn * Math.cos(Wt) - Sn, Gt[0] < 0 && (Dn *= -1), Gt[1] < 0 && (Cn *= -1);
2250
+ } else Cn = (Dn = on) / Bn;
2251
+ else Dn = (Cn = on) * Bn;
2252
+ } else Dn = Gt[0] * Ct[0], Cn = Gt[1] * Ct[1];
2253
+ return [Dn, Cn];
2254
+ }([ln, en], pn, cn, at, vt), 2), Et = kt[0], Rt = kt[1];
2255
+ }
2256
+ return { distWidth: Et, distHeight: Rt };
2257
+ }(N, Q, r, t);
2258
+ H = tt.distWidth, L = tt.distHeight;
2259
+ var yt = N[0] - K[0] || Q ? Math.max(w + H, tn) : w, Mt = N[1] - K[1] || Q ? Math.max(_ + L, tn) : _;
2260
+ return Q && w && _ && (D ? Mt = yt / b : yt = Mt * b), [yt, Mt];
2261
+ }
2262
+ function qt() {
2263
+ var K;
2264
+ I && (K = O(I([Y, j]), 2), Y = K[0], j = K[1]), Y = ft(Y, Z), j = ft(j, Z);
2265
+ }
2266
+ }, dragControlAfter: function(n, t) {
2267
+ var e = t.datas, r = e.isResize, i = e.startOffsetWidth, o = e.startOffsetHeight, a = e.prevWidth, s = e.prevHeight;
2268
+ if (r && n.props.checkResizableError !== !1) {
2269
+ var u = n.state, c = u.width - (i + a), p = u.height - (o + s), f = A(c) > 3, l = A(p) > 3;
2270
+ return f && (e.startWidth += c, e.startOffsetWidth += c, e.prevWidth += c), l && (e.startHeight += p, e.startOffsetHeight += p, e.prevHeight += p), f || l ? this.dragControl(n, t) : void 0;
2271
+ }
2272
+ }, dragControlEnd: function(n, t) {
2273
+ var e = t.datas, r = t.parentEvent;
2274
+ if (e.isResize) {
2275
+ e.isResize = !1;
2276
+ var i = Oe(n, t, {});
2277
+ return !r && rt(n, "onResizeEnd", i), i;
2278
+ }
2279
+ }, dragGroupControlCondition: Ni, dragGroupControlStart: function(n, t) {
2280
+ var e = t.datas, r = this.dragControlStart(n, C(C({}, t), { isGroup: !0 }));
2281
+ if (!r) return !1;
2282
+ var i = Xn(n, "resizable", t), o = e.startOffsetWidth, a = e.startOffsetHeight;
2283
+ function s() {
2284
+ var d = e.minSize;
2285
+ i.forEach(function(h) {
2286
+ var g = h.datas, v = g.minSize, m = g.startOffsetWidth, x = g.startOffsetHeight, y = o * (m ? v[0] / m : 0), E = a * (x ? v[1] / x : 0);
2287
+ d[0] = Math.max(d[0], y), d[1] = Math.max(d[1], E);
2288
+ });
2289
+ }
2290
+ function u() {
2291
+ var d = e.maxSize;
2292
+ i.forEach(function(h) {
2293
+ var g = h.datas, v = g.maxSize, m = g.startOffsetWidth, x = g.startOffsetHeight, y = o * (m ? v[0] / m : 0), E = a * (x ? v[1] / x : 0);
2294
+ d[0] = Math.min(d[0], y), d[1] = Math.min(d[1], E);
2295
+ });
2296
+ }
2297
+ var c = vr(n, this, "dragControlStart", t, function(d, h) {
2298
+ return Fi(n, d, e, h);
2299
+ });
2300
+ s(), u();
2301
+ var p = function(d) {
2302
+ r.setFixedDirection(d), c.forEach(function(h, g) {
2303
+ h.setFixedDirection(d), Fi(n, h.moveable, e, i[g]);
2304
+ });
2305
+ };
2306
+ e.setFixedDirection = p;
2307
+ var f = C(C({}, r), { targets: n.props.targets, events: c.map(function(d) {
2308
+ return C(C({}, d), { setMin: function(h) {
2309
+ d.setMin(h), s();
2310
+ }, setMax: function(h) {
2311
+ d.setMax(h), u();
2312
+ } });
2313
+ }), setFixedDirection: p, setMin: function(d) {
2314
+ r.setMin(d), s();
2315
+ }, setMax: function(d) {
2316
+ r.setMax(d), u();
2317
+ } }), l = rt(n, "onResizeGroupStart", f);
2318
+ return e.isResize = l !== !1, !!e.isResize && r;
2319
+ }, dragGroupControl: function(n, t) {
2320
+ var e = t.datas;
2321
+ if (e.isResize) {
2322
+ var r = Se(n.props, "resizable");
2323
+ (function(d, h, g) {
2324
+ d._emitter.on(h, g);
2325
+ })(n, "onBeforeResize", function(d) {
2326
+ rt(n, "onBeforeResizeGroup", mt(n, t, C(C({}, d), { targets: r.targets }), !0));
2327
+ });
2328
+ var i = this.dragControl(n, C(C({}, t), { isGroup: !0 }));
2329
+ if (i) {
2330
+ var o = i.boundingWidth, a = i.boundingHeight, s = i.dist, u = r.keepRatio, c = [o / (o - s[0]), a / (a - s[1])], p = e.fixedPosition, f = vr(n, this, "dragControl", t, function(d, h) {
2331
+ var g = O(gn(rr(n.rotation / 180 * Math.PI, 3), [h.datas.originalX * c[0], h.datas.originalY * c[1], 1], 3), 2), v = g[0], m = g[1];
2332
+ return C(C({}, h), { parentDist: null, parentScale: c, dragClient: St(p, [v, m]), parentKeepRatio: u });
2333
+ }), l = C({ targets: r.targets, events: f }, i);
2334
+ return rt(n, "onResizeGroup", l), l;
2335
+ }
2336
+ }
2337
+ }, dragGroupControlEnd: function(n, t) {
2338
+ var e = t.isDrag;
2339
+ if (t.datas.isResize) {
2340
+ this.dragControlEnd(n, t);
2341
+ var r = vr(n, this, "dragControlEnd", t);
2342
+ return rt(n, "onResizeGroupEnd", Oe(n, t, { targets: n.props.targets, events: r })), e;
2343
+ }
2344
+ }, request: function(n) {
2345
+ var t = {}, e = 0, r = 0, i = !1, o = n.getRect();
2346
+ return { isControl: !0, requestStart: function(a) {
2347
+ var s;
2348
+ return i = a.useSnap, { datas: t, parentDirection: a.direction || [1, 1], parentIsWidth: (s = a?.horizontal) === null || s === void 0 || s, useSnap: i };
2349
+ }, request: function(a) {
2350
+ return "offsetWidth" in a ? e = a.offsetWidth - o.offsetWidth : "deltaWidth" in a && (e += a.deltaWidth), "offsetHeight" in a ? r = a.offsetHeight - o.offsetHeight : "deltaHeight" in a && (r += a.deltaHeight), { datas: t, parentDist: [e, r], parentKeepRatio: a.keepRatio, useSnap: i };
2351
+ }, requestEnd: function() {
2352
+ return { datas: t, isDrag: !0, useSnap: i };
2353
+ } };
2354
+ }, unset: function(n) {
2355
+ n.state.gestos.resizable = null;
2356
+ } };
2357
+ function Wi(n) {
2358
+ return n ? n / A(n) : 0;
2359
+ }
2360
+ function os(n, t, e, r, i, o) {
2361
+ var a = function(f, l, d) {
2362
+ var h = [];
2363
+ if (d) A(l[0]) !== 1 || A(l[1]) !== 1 ? h.push([l, [-1, -1]], [l, [-1, 1]], [l, [1, -1]], [l, [1, 1]]) : h.push([l, [f[0], -f[1]]], [l, [-f[0], f[1]]]), h.push([l, f]);
2364
+ else if (f[0] && f[1] || !f[0] && !f[1]) {
2365
+ var g = f[0] ? f : [1, 1];
2366
+ [1, -1].forEach(function(v) {
2367
+ [1, -1].forEach(function(m) {
2368
+ var x = [v * g[0], m * g[1]];
2369
+ l[0] === x[0] && l[1] === x[1] || h.push([l, x]);
2370
+ });
2371
+ });
2372
+ } else f[0] ? (A(l[0]) === 1 ? [1] : [1, -1]).forEach(function(v) {
2373
+ h.push([[l[0], -1], [v * f[0], -1]], [[l[0], 0], [v * f[0], 0]], [[l[0], 1], [v * f[0], 1]]);
2374
+ }) : f[1] && (A(l[1]) === 1 ? [1] : [1, -1]).forEach(function(v) {
2375
+ h.push([[-1, l[1]], [-1, v * f[1]]], [[0, l[1]], [0, v * f[1]]], [[1, l[1]], [1, v * f[1]]]);
2376
+ });
2377
+ return h;
2378
+ }(e, o.fixedDirection, r), s = Fo(n, t, e, r), u = q(q([], O(rs(n, t, a, r, i, o)), !1), O(Bo(n, s, o)), !1), c = Je(u, 0), p = Je(u, 1);
2379
+ return { width: { isBound: c.isBound, offset: c.offset[0] }, height: { isBound: p.isBound, offset: p.offset[1] } };
2380
+ }
2381
+ function xt() {
2382
+ for (var n = [], t = 0; t < arguments.length; t++) n[t] = arguments[t];
2383
+ return pa.apply(void 0, q([Qr], O(n), !1));
2384
+ }
2385
+ function zo(n) {
2386
+ n();
2387
+ }
2388
+ function as(n) {
2389
+ return n && n !== "none" ? wn(n) ? n : Ur(n) : [1, 0, 0, 1, 0, 0];
2390
+ }
2391
+ function Ee(n, t, e) {
2392
+ return Ke(t, Yn(e, t), n, Yn(e.map(function(r) {
2393
+ return -r;
2394
+ }), t));
2395
+ }
2396
+ function ss(n) {
2397
+ return Qe(Xo(n, ":before").transformOrigin).map(function(t, e) {
2398
+ var r = er(t), i = r.value, o = r.unit;
2399
+ return i * function(a, s, u) {
2400
+ return s === "%" ? ri(a.ownerSVGElement)[u ? "width" : "height"] / 100 : 1;
2401
+ }(n, o, e === 0);
2402
+ });
2403
+ }
2404
+ function Qe(n) {
2405
+ return n ? n.split(" ") : ["0", "0"];
2406
+ }
2407
+ function Ao(n) {
2408
+ var t = nn(n)("transform");
2409
+ if (t && t !== "none") return t;
2410
+ if ("transform" in n) {
2411
+ var e = n.transform.baseVal;
2412
+ if (!e) return "";
2413
+ var r = e.length;
2414
+ if (!r) return "";
2415
+ for (var i = [], o = function(s) {
2416
+ var u = e[s].matrix;
2417
+ i.push("matrix(".concat(["a", "b", "c", "d", "e", "f"].map(function(c) {
2418
+ return u[c];
2419
+ }).join(", "), ")"));
2420
+ }, a = 0; a < r; ++a) o(a);
2421
+ return i.join(" ");
2422
+ }
2423
+ return "";
2424
+ }
2425
+ function Te(n, t, e, r, i) {
2426
+ var o, a, s, u, c = Zr(n) || kn(n), p = !1;
2427
+ if (!n || e) s = n;
2428
+ else {
2429
+ var f = (o = n?.assignedSlot) === null || o === void 0 ? void 0 : o.parentElement, l = n.parentElement;
2430
+ f ? (p = !0, u = l, s = f) : s = l;
2431
+ }
2432
+ for (var d = !1, h = n === t || s === t, g = "relative", v = 1, m = parseFloat(i?.("zoom")) || 1, x = i?.("position"); s && s !== c; ) {
2433
+ t === s && (h = !0);
2434
+ var y = nn(s), E = s.tagName.toLowerCase(), S = Ao(s), b = y("willChange"), w = parseFloat(y("zoom")) || 1;
2435
+ if (g = y("position"), r && w !== 1) {
2436
+ v = w;
2437
+ break;
2438
+ }
2439
+ if (!e && r && m !== 1 && x && x !== "absolute" || E === "svg" || E === "foreignobject" || g !== "static" || S && S !== "none" || b === "transform") break;
2440
+ var _ = (a = n?.assignedSlot) === null || a === void 0 ? void 0 : a.parentNode, D = s.parentNode;
2441
+ _ && (p = !0, u = D);
2442
+ var P = D;
2443
+ if (P && P.nodeType === 11) {
2444
+ d = !0, g = nn(s = P.host)("position");
2445
+ break;
2446
+ }
2447
+ s = P, g = "relative";
2448
+ }
2449
+ return { offsetZoom: v, hasSlot: p, parentSlotElement: u, isCustomElement: d, isStatic: g === "static", isEnd: h || !s || s === c, offsetParent: s || c };
2450
+ }
2451
+ function us(n, t) {
2452
+ var e, r, i, o = n.tagName.toLowerCase(), a = n.offsetLeft, s = n.offsetTop, u = nn(n), c = Lr(a), p = !c;
2453
+ return p || o === "svg" && !n.ownerSVGElement ? i = (r = Qe(u("transformOrigin")).map(function(f) {
2454
+ return parseFloat(f);
2455
+ })).slice() : (i = (r = xo ? ss(n) : Qe(u("transformOrigin")).map(function(f) {
2456
+ return parseFloat(f);
2457
+ })).slice(), p = !0, o === "svg" ? (a = 0, s = 0) : (e = O(function(f, l, d) {
2458
+ var h = f.tagName.toLowerCase();
2459
+ if (!f.getBBox || !d && h === "g") return [0, 0, 0, 0];
2460
+ var g = nn(f), v = g("transform-box") === "fill-box", m = f.getBBox(), x = ri(f.ownerSVGElement), y = m.x, E = m.y;
2461
+ h !== "foreignobject" || y || E || (y = parseFloat(f.getAttribute("x")) || 0, E = parseFloat(f.getAttribute("y")) || 0);
2462
+ var S = y - x.x, b = E - x.y, w = v ? l[0] : l[0] - S, _ = v ? l[1] : l[1] - b;
2463
+ return [S, b, w, _];
2464
+ }(n, r, n === t && t.tagName.toLowerCase() === "g"), 4), a = e[0], s = e[1], r[0] = e[2], r[1] = e[3])), { tagName: o, isSVG: c, hasOffset: p, offset: [a || 0, s || 0], origin: r, targetOrigin: i };
2465
+ }
2466
+ function Go(n, t) {
2467
+ var e = nn(n), r = nn(kn(n)), i = r("position");
2468
+ if (!(t || i && i !== "static")) return [0, 0];
2469
+ var o = parseInt(r("marginLeft"), 10), a = parseInt(r("marginTop"), 10);
2470
+ return e("position") === "absolute" && (e("top") === "auto" && e("bottom") === "auto" || (a = 0), e("left") === "auto" && e("right") === "auto" || (o = 0)), [o, a];
2471
+ }
2472
+ function Gr(n) {
2473
+ n.forEach(function(t) {
2474
+ var e = t.matrix;
2475
+ e && (t.matrix = In(e, 3, 4));
2476
+ });
2477
+ }
2478
+ function cs(n) {
2479
+ for (var t = n.parentElement, e = !1, r = kn(n); t; ) {
2480
+ var i = Xo(t).transform;
2481
+ if (i && i !== "none") {
2482
+ e = !0;
2483
+ break;
2484
+ }
2485
+ if (t === r) break;
2486
+ t = t.parentElement;
2487
+ }
2488
+ return { fixedContainer: t || r, hasTransform: e };
2489
+ }
2490
+ function ei(n, t) {
2491
+ return t === void 0 && (t = n.length > 9), "".concat(t ? "matrix3d" : "matrix", "(").concat(co(n, !t).join(","), ")");
2492
+ }
2493
+ function ri(n) {
2494
+ var t = n.clientWidth, e = n.clientHeight;
2495
+ if (!n) return { x: 0, y: 0, width: 0, height: 0, clientWidth: t, clientHeight: e };
2496
+ var r = n.viewBox, i = r && r.baseVal || { x: 0, y: 0, width: 0, height: 0 };
2497
+ return { x: i.x, y: i.y, width: i.width || t, height: i.height || e, clientWidth: t, clientHeight: e };
2498
+ }
2499
+ function ls(n, t) {
2500
+ var e, r = ri(n), i = r.width, o = r.height, a = r.clientWidth, s = r.clientHeight, u = a / i, c = s / o, p = n.preserveAspectRatio.baseVal, f = p.align, l = p.meetOrSlice, d = [0, 0], h = [u, c], g = [0, 0];
2501
+ if (f !== 1) {
2502
+ var v = (f - 2) % 3, m = Math.floor((f - 2) / 3);
2503
+ d[0] = i * v / 2, d[1] = o * m / 2;
2504
+ var x = l === 2 ? Math.max(c, u) : Math.min(u, c);
2505
+ h[0] = x, h[1] = x, g[0] = (a - i) / 2 * v, g[1] = (s - o) / 2 * m;
2506
+ }
2507
+ var y = lo(h, t);
2508
+ return e = O(g, 2), y[t * (t - 1)] = e[0], y[t * (t - 1) + 1] = e[1], Ee(y, t, d);
2509
+ }
2510
+ function yn(n, t, e) {
2511
+ return gn(n, Pe(t, e), e);
2512
+ }
2513
+ function re(n, t, e, r) {
2514
+ return [[0, 0], [t, 0], [0, e], [t, e]].map(function(i) {
2515
+ return yn(n, i, r);
2516
+ });
2517
+ }
2518
+ function ir(n) {
2519
+ var t = n.map(function(s) {
2520
+ return s[0];
2521
+ }), e = n.map(function(s) {
2522
+ return s[1];
2523
+ }), r = Math.min.apply(Math, q([], O(t), !1)), i = Math.min.apply(Math, q([], O(e), !1)), o = Math.max.apply(Math, q([], O(t), !1)), a = Math.max.apply(Math, q([], O(e), !1));
2524
+ return { left: r, top: i, right: o, bottom: a, width: o - r, height: a - i };
2525
+ }
2526
+ function Hi(n, t, e, r) {
2527
+ return ir(re(n, t, e, r));
2528
+ }
2529
+ function En(n) {
2530
+ return Math.sqrt(n[0] * n[0] + n[1] * n[1]);
2531
+ }
2532
+ function fs(n, t, e, r) {
2533
+ e === void 0 && (e = 1), r === void 0 && (r = sn(n, t));
2534
+ var i = function(o, a) {
2535
+ return En([a[0] - o[0], a[1] - o[1]]);
2536
+ }(n, t);
2537
+ return { transform: "translateY(-50%) translate(".concat(n[0], "px, ").concat(n[1], "px) rotate(").concat(r, "rad) scaleY(").concat(e, ")"), width: "".concat(i, "px") };
2538
+ }
2539
+ function tr(n, t) {
2540
+ for (var e = [], r = 2; r < arguments.length; r++) e[r - 2] = arguments[r];
2541
+ var i = e.length, o = e.reduce(function(s, u) {
2542
+ return s + u[0];
2543
+ }, 0) / i, a = e.reduce(function(s, u) {
2544
+ return s + u[1];
2545
+ }, 0) / i;
2546
+ return { transform: "translateZ(0px) translate(".concat(o, "px, ").concat(a, "px) rotate(").concat(n, "rad) scale(").concat(t, ")") };
2547
+ }
2548
+ function Se(n, t) {
2549
+ var e = n[t];
2550
+ return wn(e) ? C(C({}, n), e) : n;
2551
+ }
2552
+ function Io(n) {
2553
+ var t = n && !Lr(n.offsetWidth), e = 0, r = 0, i = 0, o = 0, a = 0, s = 0, u = 0, c = 0, p = 0, f = 0, l = 0, d = 0, h = 1 / 0, g = 1 / 0, v = 1 / 0, m = 1 / 0, x = 0, y = 0, E = !1;
2554
+ if (n) if (!t && n.ownerSVGElement) {
2555
+ var S = n.getBBox();
2556
+ E = !0, a = e = S.width, s = r = S.height, u = e, c = r, i = e, o = r;
2557
+ } else {
2558
+ var b = nn(n), w = n.style, _ = b("boxSizing") === "border-box", D = parseFloat(b("borderLeftWidth")) || 0, P = parseFloat(b("borderRightWidth")) || 0, M = parseFloat(b("borderTopWidth")) || 0, T = parseFloat(b("borderBottomWidth")) || 0, R = (parseFloat(b("paddingLeft")) || 0) + (parseFloat(b("paddingRight")) || 0), F = (parseFloat(b("paddingTop")) || 0) + (parseFloat(b("paddingBottom")) || 0), z = R + (D + P), B = F + (M + T), G = b("position"), k = 0, I = 0;
2559
+ if ("clientLeft" in n) {
2560
+ var V = null;
2561
+ if (G === "absolute" ? V = Te(n, kn(n)).offsetParent : V = n.parentElement, V) {
2562
+ var Z = nn(V);
2563
+ k = parseFloat(Z("width")), I = parseFloat(Z("height"));
2564
+ }
2565
+ }
2566
+ p = Math.max(R, Ut(b("minWidth"), k) || 0), f = Math.max(F, Ut(b("minHeight"), I) || 0), h = Ut(b("maxWidth"), k), g = Ut(b("maxHeight"), I), isNaN(h) && (h = 1 / 0), isNaN(g) && (g = 1 / 0), x = Ut(w.width, 0) || 0, y = Ut(w.height, 0) || 0, a = parseFloat(b("width")) || 0, s = parseFloat(b("height")) || 0, e = u = A(a - x) < 1 ? Mr(p, x || a, h) : a, r = c = A(s - y) < 1 ? Mr(f, y || s, g) : s, i = u, o = c, _ ? (v = h, m = g, l = p, d = f, u = e - z, c = r - B) : (v = h + z, m = g + B, l = p + z, d = f + B, e = u + z, r = c + B), i = u + R, o = c + F;
2567
+ }
2568
+ return { svg: E, offsetWidth: e, offsetHeight: r, clientWidth: i, clientHeight: o, contentWidth: u, contentHeight: c, inlineCSSWidth: x, inlineCSSHeight: y, cssWidth: a, cssHeight: s, minWidth: p, minHeight: f, maxWidth: h, maxHeight: g, minOffsetWidth: l, minOffsetHeight: d, maxOffsetWidth: v, maxOffsetHeight: m };
2569
+ }
2570
+ function Yo(n, t) {
2571
+ var e = n === kn(n) || n === Zr(n), r = { clientLeft: n.clientLeft, clientTop: n.clientTop, clientWidth: n.clientWidth, clientHeight: n.clientHeight, scrollWidth: n.scrollWidth, scrollHeight: n.scrollHeight, overflow: !1 };
2572
+ return e && (r.clientHeight = Math.max(t.height, r.clientHeight), r.scrollHeight = Math.max(t.height, r.scrollHeight)), r.overflow = nn(n)("overflow") !== "visible", C(C({}, t), r);
2573
+ }
2574
+ function mr(n, t, e, r) {
2575
+ var i = n.left, o = n.right, a = n.top, s = n.bottom, u = t.top, c = t.left, p = { left: c + i, top: u + a, right: c + o, bottom: u + s, width: o - i, height: s - a };
2576
+ return e && r ? Yo(e, p) : p;
2577
+ }
2578
+ function He(n, t) {
2579
+ var e = 0, r = 0, i = 0, o = 0;
2580
+ if (n) {
2581
+ var a = n.getBoundingClientRect();
2582
+ e = a.left, r = a.top, i = a.width, o = a.height;
2583
+ }
2584
+ var s = { left: e, top: r, width: i, height: o, right: e + i, bottom: r + o };
2585
+ return n && t ? Yo(n, s) : s;
2586
+ }
2587
+ function ii(n, t) {
2588
+ return [St(t, n[0]), St(t, n[1]), St(t, n[2]), St(t, n[3])];
2589
+ }
2590
+ function Rn(n) {
2591
+ var t = n.left, e = n.top;
2592
+ return ii([n.pos1, n.pos2, n.pos3, n.pos4], [t, e]);
2593
+ }
2594
+ function Ir(n, t) {
2595
+ n[t ? "controlAbles" : "targetAbles"].forEach(function(e) {
2596
+ e.unset && e.unset(n);
2597
+ });
2598
+ }
2599
+ function Vn(n, t) {
2600
+ var e = t ? "controlGesto" : "targetGesto", r = n[e];
2601
+ r?.isIdle() === !1 && Ir(n, t), r?.unset(), n[e] = null;
2602
+ }
2603
+ function Zn(n, t) {
2604
+ if (t) {
2605
+ var e = $n(t);
2606
+ e.nextStyle = C(C({}, e.nextStyle), n);
2607
+ }
2608
+ return { style: n, cssText: De(n).map(function(r) {
2609
+ return "".concat((i = r, o = "-", i.replace(/([a-z])([A-Z])/g, function(a, s, u) {
2610
+ return "" + s + o + u.toLowerCase();
2611
+ })), ": ").concat(n[r], ";");
2612
+ var i, o;
2613
+ }).join("") };
2614
+ }
2615
+ function mt(n, t, e, r) {
2616
+ var i = t.datas;
2617
+ i.datas || (i.datas = {});
2618
+ var o = C(C({}, e), { target: n.state.target, clientX: t.clientX, clientY: t.clientY, inputEvent: t.inputEvent, currentTarget: n, moveable: n, datas: i.datas, isRequest: t.isRequest, isRequestChild: t.isRequestChild, isFirstDrag: !!t.isFirstDrag, isTrusted: t.isTrusted !== !1, stopAble: function() {
2619
+ i.isEventStart = !1;
2620
+ }, stopDrag: function() {
2621
+ var a;
2622
+ (a = t.stop) === null || a === void 0 || a.call(t);
2623
+ } });
2624
+ return i.isStartEvent ? r || (i.lastEvent = o) : i.isStartEvent = !0, o;
2625
+ }
2626
+ function Oe(n, t, e) {
2627
+ var r = t.datas, i = "isDrag" in e ? e.isDrag : t.isDrag;
2628
+ return r.datas || (r.datas = {}), C(C({ isDrag: i }, e), { moveable: n, target: n.state.target, clientX: t.clientX, clientY: t.clientY, inputEvent: t.inputEvent, currentTarget: n, lastEvent: r.lastEvent, isDouble: t.isDouble, datas: r.datas, isFirstDrag: !!t.isFirstDrag });
2629
+ }
2630
+ function rt(n, t, e, r, i) {
2631
+ return n.triggerEvent(t, e, r, i);
2632
+ }
2633
+ function Xo(n, t) {
2634
+ return Pn(n).getComputedStyle(n, t);
2635
+ }
2636
+ function qe(n, t, e) {
2637
+ var r = {}, i = {};
2638
+ return n.filter(function(o) {
2639
+ var a = o.name;
2640
+ if (r[a] || !t.some(function(s) {
2641
+ return o[s];
2642
+ })) return !1;
2643
+ if (!e && o.ableGroup) {
2644
+ if (i[o.ableGroup]) return !1;
2645
+ i[o.ableGroup] = !0;
2646
+ }
2647
+ return r[a] = !0, !0;
2648
+ });
2649
+ }
2650
+ function Yr(n, t) {
2651
+ return n === t || n == null && t == null;
2652
+ }
2653
+ function qi() {
2654
+ for (var n = [], t = 0; t < arguments.length; t++) n[t] = arguments[t];
2655
+ for (var e = n.length - 1, r = 0; r < e; ++r) {
2656
+ var i = n[r];
2657
+ if (!Lr(i)) return i;
2658
+ }
2659
+ return n[e];
2660
+ }
2661
+ function No(n) {
2662
+ return n.reduce(function(t, e) {
2663
+ return t.concat(e);
2664
+ }, []);
2665
+ }
2666
+ function Kn() {
2667
+ for (var n = [], t = 0; t < arguments.length; t++) n[t] = arguments[t];
2668
+ return n.sort(function(e, r) {
2669
+ return A(r) - A(e);
2670
+ }), n[0];
2671
+ }
2672
+ function oi(n, t, e) {
2673
+ return gn(Gn(n, e), Pe(t, e), e);
2674
+ }
2675
+ function an(n, t, e, r) {
2676
+ if (!e[0] && !e[1]) return t;
2677
+ var i = yn(n, [Wi(e[0] || 1), 0], r), o = yn(n, [0, Wi(e[1] || 1)], r);
2678
+ return St(t, yn(n, [e[0] / En(i), e[1] / En(o)], r));
2679
+ }
2680
+ function nr(n) {
2681
+ return A(n) <= tn ? 0 : n;
2682
+ }
2683
+ function Xr(n, t) {
2684
+ return t === void 0 && (t = [n]), function(e, r) {
2685
+ if (r.isRequest) return !!t.some(function(o) {
2686
+ return r.requestAble === o;
2687
+ }) && r.parentDirection;
2688
+ var i = r.inputEvent.target;
2689
+ return xn(i, xt("direction")) && (!n || xn(i, xt(n)));
2690
+ };
2691
+ }
2692
+ function Jn(n, t) {
2693
+ return n ? Kr(n) ? n : oe(n) ? t ? document.querySelector(n) : n : ro(n) ? n() : uo(n) ? n : "current" in n ? n.current : n : null;
2694
+ }
2695
+ function Wo(n, t) {
2696
+ return n ? ((e = n) && wn(e) && !Kr(e) && (Ht(e) || "length" in e) ? [].slice.call(n) : [n]).reduce(function(r, i) {
2697
+ return Ht(i) ? r.push(Wo(i, t)) : r.push(Jn(i, t)), r;
2698
+ }, []) : [];
2699
+ var e;
2700
+ }
2701
+ function Nr(n, t) {
2702
+ if (t) {
2703
+ if (n === "left") return { x: "0%", y: "50%" };
2704
+ if (n === "top") return { x: "50%", y: "50%" };
2705
+ if (n === "center") return { x: "50%", y: "50%" };
2706
+ if (n === "right") return { x: "100%", y: "50%" };
2707
+ if (n === "bottom") return { x: "50%", y: "100%" };
2708
+ var e = O(n.split(" "), 2), r = e[0], i = e[1], o = Nr(r || ""), a = Nr(i || ""), s = C(C({}, o), a), u = { x: "50%", y: "50%" };
2709
+ return s.x && (u.x = s.x), s.y && (u.y = s.y), s.value && (s.x && !s.y && (u.y = s.value), !s.x && s.y && (u.x = s.value)), u;
2710
+ }
2711
+ return n === "left" ? { x: "0%" } : n === "right" ? { x: "100%" } : n === "top" ? { y: "0%" } : n === "bottom" ? { y: "100%" } : n ? n === "center" ? { value: "50%" } : { value: n } : {};
2712
+ }
2713
+ function Ho(n, t, e) {
2714
+ var r = Nr(n, !0), i = r.x, o = r.y;
2715
+ return [Ut(i, t) || 0, Ut(o, e) || 0];
2716
+ }
2717
+ function ps(n, t, e) {
2718
+ var r = n.map(function(o) {
2719
+ return nt(o, t);
2720
+ }), i = r.map(function(o) {
2721
+ return function(a, s) {
2722
+ return gn(rr(s, 3), Pe(a, 3));
2723
+ }(o, e);
2724
+ });
2725
+ return { prev: r, next: i, result: i.map(function(o) {
2726
+ return St(o, t);
2727
+ }) };
2728
+ }
2729
+ function qo(n, t) {
2730
+ return n.length === t.length && n.every(function(e, r) {
2731
+ var i = t[r], o = Ht(e), a = Ht(i);
2732
+ return o && a ? qo(e, i) : !o && !a && e === i;
2733
+ });
2734
+ }
2735
+ function Li(n, t, e, r, i) {
2736
+ var o = n._store, a = o[t];
2737
+ return t in o && (a === e || r(a) === r(e)) ? a : (o[t] = e, e);
2738
+ }
2739
+ function Qn(n) {
2740
+ return n >= 0 ? 1 : -1;
2741
+ }
2742
+ function A(n) {
2743
+ return Math.abs(n);
2744
+ }
2745
+ function Lo(n) {
2746
+ return Ve(n) ? { top: n, left: n, right: n, bottom: n } : { left: n.left || 0, top: n.top || 0, right: n.right || 0, bottom: n.bottom || 0 };
2747
+ }
2748
+ Xr("", ["resizable", "scalable"]), Ce("pinchable", { props: ["pinchable"], events: ["pinchStart", "pinch", "pinchEnd", "pinchGroupStart", "pinchGroup", "pinchGroupEnd"], dragStart: function() {
2749
+ return !0;
2750
+ }, pinchStart: function(n, t) {
2751
+ var e = t.datas, r = t.targets, i = t.angle, o = t.originalDatas, a = n.props, s = a.pinchable, u = a.ables;
2752
+ if (!s) return !1;
2753
+ var c = "onPinch".concat(r ? "Group" : "", "Start"), p = "drag".concat(r ? "Group" : "", "ControlStart"), f = (s === !0 ? n.controlAbles : u.filter(function(g) {
2754
+ return s.indexOf(g.name) > -1;
2755
+ })).filter(function(g) {
2756
+ return g.canPinch && g[p];
2757
+ }), l = mt(n, t, {});
2758
+ r && (l.targets = r);
2759
+ var d = rt(n, c, l);
2760
+ e.isPinch = d !== !1, e.ables = f;
2761
+ var h = e.isPinch;
2762
+ return !!h && (f.forEach(function(g) {
2763
+ if (o[g.name] = o[g.name] || {}, g[p]) {
2764
+ var v = C(C({}, t), { datas: o[g.name], parentRotate: i, isPinch: !0 });
2765
+ g[p](n, v);
2766
+ }
2767
+ }), n.state.snapRenderInfo = { request: t.isRequest, direction: [0, 0] }, h);
2768
+ }, pinch: function(n, t) {
2769
+ var e = t.datas, r = t.scale, i = t.distance, o = t.originalDatas, a = t.inputEvent, s = t.targets, u = t.angle;
2770
+ if (e.isPinch) {
2771
+ var c = i * (1 - 1 / r), p = mt(n, t, {});
2772
+ s && (p.targets = s);
2773
+ var f = "onPinch".concat(s ? "Group" : "");
2774
+ rt(n, f, p);
2775
+ var l = e.ables, d = "drag".concat(s ? "Group" : "", "Control");
2776
+ return l.forEach(function(h) {
2777
+ h[d] && h[d](n, C(C({}, t), { datas: o[h.name], inputEvent: a, resolveMatrix: !0, pinchScale: r, parentDistance: c, parentRotate: u, isPinch: !0 }));
2778
+ }), p;
2779
+ }
2780
+ }, pinchEnd: function(n, t) {
2781
+ var e = t.datas, r = t.isPinch, i = t.inputEvent, o = t.targets, a = t.originalDatas;
2782
+ if (e.isPinch) {
2783
+ var s = "onPinch".concat(o ? "Group" : "", "End"), u = Oe(n, t, { isDrag: r });
2784
+ o && (u.targets = o), rt(n, s, u);
2785
+ var c = e.ables, p = "drag".concat(o ? "Group" : "", "ControlEnd");
2786
+ return c.forEach(function(f) {
2787
+ f[p] && f[p](n, C(C({}, t), { isDrag: r, datas: a[f.name], inputEvent: i, isPinch: !0 }));
2788
+ }), r;
2789
+ }
2790
+ }, pinchGroupStart: function(n, t) {
2791
+ return this.pinchStart(n, C(C({}, t), { targets: n.props.targets }));
2792
+ }, pinchGroup: function(n, t) {
2793
+ return this.pinch(n, C(C({}, t), { targets: n.props.targets }));
2794
+ }, pinchGroupEnd: function(n, t) {
2795
+ return this.pinchEnd(n, C(C({}, t), { targets: n.props.targets }));
2796
+ } }), Xr("scalable");
2797
+ var ds = xt("area-pieces"), Le = xt("area-piece"), jo = xt("avoid"), hs = xt("view-dragging");
2798
+ function br(n) {
2799
+ var t = n.areaElement;
2800
+ if (t) {
2801
+ var e = n.state, r = e.width, i = e.height;
2802
+ so(t, jo), t.style.cssText += "left: 0px; top: 0px; width: ".concat(r, "px; height: ").concat(i, "px");
2803
+ }
2804
+ }
2805
+ function ji(n) {
2806
+ return n.createElement("div", { key: "area_pieces", className: ds }, n.createElement("div", { className: Le }), n.createElement("div", { className: Le }), n.createElement("div", { className: Le }), n.createElement("div", { className: Le }));
2807
+ }
2808
+ var gs = { name: "dragArea", props: ["dragArea", "passDragArea"], events: ["click", "clickGroup"], render: function(n, t) {
2809
+ var e = n.props, r = e.target, i = e.dragArea, o = e.groupable, a = e.passDragArea, s = n.getState(), u = s.width, c = s.height, p = s.renderPoses, f = a ? xt("area", "pass") : xt("area");
2810
+ if (o) return [t.createElement("div", { key: "area", ref: An(n, "areaElement"), className: f }), ji(t)];
2811
+ if (!r || !i) return [];
2812
+ var l = fo([0, 0], [u, 0], [0, c], [u, c], p[0], p[1], p[2], p[3]), d = l.length ? ei(l, !0) : "none";
2813
+ return [t.createElement("div", { key: "area", ref: An(n, "areaElement"), className: f, style: { top: "0px", left: "0px", width: "".concat(u, "px"), height: "".concat(c, "px"), transformOrigin: "0 0", transform: d } }), ji(t)];
2814
+ }, dragStart: function(n, t) {
2815
+ var e = t.datas, r = t.clientX, i = t.clientY;
2816
+ if (!t.inputEvent) return !1;
2817
+ e.isDragArea = !1;
2818
+ var o = n.areaElement, a = n.state, s = a.moveableClientRect, u = a.renderPoses, c = a.rootMatrix, p = a.is3d, f = s.left, l = s.top, d = ir(u), h = d.left, g = d.top, v = d.width, m = d.height, x = O(oi(c, [r - f, i - l], p ? 4 : 3), 2), y = x[0], E = x[1], S = [{ left: h, top: g, width: v, height: (E -= g) - 10 }, { left: h, top: g, width: (y -= h) - 10, height: m }, { left: h, top: g + E + 10, width: v, height: m - E - 10 }, { left: h + y + 10, top: g, width: v - y - 10, height: m }], b = [].slice.call(o.nextElementSibling.children);
2819
+ S.forEach(function(w, _) {
2820
+ b[_].style.cssText = "left: ".concat(w.left, "px;top: ").concat(w.top, "px; width: ").concat(w.width, "px; height: ").concat(w.height, "px;");
2821
+ }), ao(o, jo), a.disableNativeEvent = !0;
2822
+ }, drag: function(n, t) {
2823
+ var e = t.datas, r = t.inputEvent;
2824
+ if (this.enableNativeEvent(n), !r) return !1;
2825
+ e.isDragArea || (e.isDragArea = !0, br(n));
2826
+ }, dragEnd: function(n, t) {
2827
+ this.enableNativeEvent(n);
2828
+ var e = t.inputEvent, r = t.datas;
2829
+ if (!e) return !1;
2830
+ r.isDragArea || br(n);
2831
+ }, dragGroupStart: function(n, t) {
2832
+ return this.dragStart(n, t);
2833
+ }, dragGroup: function(n, t) {
2834
+ return this.drag(n, t);
2835
+ }, dragGroupEnd: function(n, t) {
2836
+ return this.dragEnd(n, t);
2837
+ }, unset: function(n) {
2838
+ br(n), n.state.disableNativeEvent = !1;
2839
+ }, enableNativeEvent: function(n) {
2840
+ var t = n.state;
2841
+ t.disableNativeEvent && oo(function() {
2842
+ t.disableNativeEvent = !1;
2843
+ });
2844
+ } };
2845
+ Ce("origin", { props: ["origin", "svgOrigin"], render: function(n, t) {
2846
+ var e, r = n.props, i = r.zoom, o = r.svgOrigin, a = r.groupable, s = n.getState(), u = s.beforeOrigin, c = s.rotation, p = s.svg, f = s.allMatrix, l = s.is3d, d = s.left, h = s.top, g = s.offsetWidth, v = s.offsetHeight;
2847
+ if (!a && p && o) {
2848
+ var m = O(Ho(o, g, v), 2);
2849
+ e = tr(c, i, nt(yn(f, [m[0], m[1]], l ? 4 : 3), [d, h]));
2850
+ } else e = tr(c, i, u);
2851
+ return [t.createElement("div", { className: xt("control", "origin"), style: e, key: "beforeOrigin" })];
2852
+ } });
2853
+ var vs = { name: "", props: ["target", "dragTargetSelf", "dragTarget", "dragContainer", "container", "warpSelf", "rootContainer", "useResizeObserver", "useMutationObserver", "zoom", "dragFocusedInput", "transformOrigin", "ables", "className", "pinchThreshold", "pinchOutside", "triggerAblesSimultaneously", "checkInput", "cspNonce", "translateZ", "hideDefaultLines", "props", "flushSync", "stopPropagation", "preventClickEventOnDrag", "preventClickDefault", "viewContainer", "persistData", "useAccuratePosition", "firstRenderState", "linePadding", "controlPadding", "preventDefault", "preventRightClick", "preventWheelClick", "requestStyles"], events: ["changeTargets"] };
2854
+ Ce("padding", { props: ["padding"], render: function(n, t) {
2855
+ var e = n.props;
2856
+ if (e.dragArea) return [];
2857
+ var r = Lo(e.padding || {}), i = r.left, o = r.top, a = r.right, s = r.bottom, u = n.getState(), c = u.renderPoses, p = [u.pos1, u.pos2, u.pos3, u.pos4], f = [];
2858
+ return i > 0 && f.push([0, 2]), o > 0 && f.push([0, 1]), a > 0 && f.push([1, 3]), s > 0 && f.push([2, 3]), f.map(function(l, d) {
2859
+ var h = O(l, 2), g = h[0], v = h[1], m = fo([0, 0], [100, 0], [0, 100], [100, 100], p[g], p[v], c[g], c[v]);
2860
+ if (m.length) return t.createElement("div", { key: "padding".concat(d), className: xt("padding"), style: { transform: ei(m, !0) } });
2861
+ });
2862
+ } });
2863
+ var ms = { isPinch: !0, name: "beforeRenderable", props: [], events: ["beforeRenderStart", "beforeRender", "beforeRenderEnd", "beforeRenderGroupStart", "beforeRenderGroup", "beforeRenderGroupEnd"], dragRelation: "weak", setTransform: function(n, t) {
2864
+ var e = n.state, r = e.is3d, i = e.targetMatrix, o = e.inlineTransform, a = r ? "matrix3d(".concat(i.join(","), ")") : "matrix(".concat(co(i, !0), ")"), s = o && o !== "none" ? o : a;
2865
+ t.datas.startTransforms = function(u, c) {
2866
+ var p = bt(c ? 4 : 3);
2867
+ return u === "matrix".concat(c ? "3d" : "", "(").concat(p.join(","), ")") || u === "matrix(1,0,0,1,0,0)";
2868
+ }(s, r) ? [] : Me(s);
2869
+ }, resetStyle: function(n) {
2870
+ var t = n.datas;
2871
+ t.nextStyle = {}, t.nextTransforms = n.datas.startTransforms, t.nextTransformAppendedIndexes = [];
2872
+ }, fillDragStartParams: function(n, t) {
2873
+ return mt(n, t, { setTransform: function(e) {
2874
+ t.datas.startTransforms = Ht(e) ? e : Me(e);
2875
+ }, isPinch: !!t.isPinch });
2876
+ }, fillDragParams: function(n, t) {
2877
+ return mt(n, t, { isPinch: !!t.isPinch });
2878
+ }, dragStart: function(n, t) {
2879
+ this.setTransform(n, t), this.resetStyle(t), rt(n, "onBeforeRenderStart", this.fillDragStartParams(n, t));
2880
+ }, drag: function(n, t) {
2881
+ t.datas.startTransforms || this.setTransform(n, t), this.resetStyle(t), rt(n, "onBeforeRender", mt(n, t, { isPinch: !!t.isPinch }));
2882
+ }, dragEnd: function(n, t) {
2883
+ t.datas.startTransforms || (this.setTransform(n, t), this.resetStyle(t)), rt(n, "onBeforeRenderEnd", mt(n, t, { isPinch: !!t.isPinch, isDrag: t.isDrag }));
2884
+ }, dragGroupStart: function(n, t) {
2885
+ var e = this;
2886
+ this.dragStart(n, t);
2887
+ var r = Xn(n, "beforeRenderable", t), i = n.moveables, o = r.map(function(a, s) {
2888
+ var u = i[s];
2889
+ return e.setTransform(u, a), e.resetStyle(a), e.fillDragStartParams(u, a);
2890
+ });
2891
+ rt(n, "onBeforeRenderGroupStart", mt(n, t, { isPinch: !!t.isPinch, targets: n.props.targets, setTransform: function() {
2892
+ }, events: o }));
2893
+ }, dragGroup: function(n, t) {
2894
+ var e = this;
2895
+ this.drag(n, t);
2896
+ var r = Xn(n, "beforeRenderable", t), i = n.moveables, o = r.map(function(a, s) {
2897
+ var u = i[s];
2898
+ return e.resetStyle(a), e.fillDragParams(u, a);
2899
+ });
2900
+ rt(n, "onBeforeRenderGroup", mt(n, t, { isPinch: !!t.isPinch, targets: n.props.targets, events: o }));
2901
+ }, dragGroupEnd: function(n, t) {
2902
+ this.dragEnd(n, t), rt(n, "onBeforeRenderGroupEnd", mt(n, t, { isPinch: !!t.isPinch, isDrag: t.isDrag, targets: n.props.targets }));
2903
+ }, dragControlStart: function(n, t) {
2904
+ return this.dragStart(n, t);
2905
+ }, dragControl: function(n, t) {
2906
+ return this.drag(n, t);
2907
+ }, dragControlEnd: function(n, t) {
2908
+ return this.dragEnd(n, t);
2909
+ }, dragGroupControlStart: function(n, t) {
2910
+ return this.dragGroupStart(n, t);
2911
+ }, dragGroupControl: function(n, t) {
2912
+ return this.dragGroup(n, t);
2913
+ }, dragGroupControlEnd: function(n, t) {
2914
+ return this.dragGroupEnd(n, t);
2915
+ } }, bs = { name: "renderable", props: [], events: ["renderStart", "render", "renderEnd", "renderGroupStart", "renderGroup", "renderGroupEnd"], dragRelation: "weak", dragStart: function(n, t) {
2916
+ rt(n, "onRenderStart", mt(n, t, { isPinch: !!t.isPinch }));
2917
+ }, drag: function(n, t) {
2918
+ rt(n, "onRender", this.fillDragParams(n, t));
2919
+ }, dragAfter: function(n, t) {
2920
+ return this.drag(n, t);
2921
+ }, dragEnd: function(n, t) {
2922
+ rt(n, "onRenderEnd", this.fillDragEndParams(n, t));
2923
+ }, dragGroupStart: function(n, t) {
2924
+ rt(n, "onRenderGroupStart", mt(n, t, { isPinch: !!t.isPinch, targets: n.props.targets }));
2925
+ }, dragGroup: function(n, t) {
2926
+ var e = this, r = Xn(n, "beforeRenderable", t), i = n.moveables, o = r.map(function(a, s) {
2927
+ var u = i[s];
2928
+ return e.fillDragParams(u, a);
2929
+ });
2930
+ rt(n, "onRenderGroup", mt(n, t, C(C({ isPinch: !!t.isPinch, targets: n.props.targets, transform: Xe(t), transformObject: {} }, Zn(Ne(t))), { events: o })));
2931
+ }, dragGroupEnd: function(n, t) {
2932
+ var e = this, r = Xn(n, "beforeRenderable", t), i = n.moveables, o = r.map(function(a, s) {
2933
+ var u = i[s];
2934
+ return e.fillDragEndParams(u, a);
2935
+ });
2936
+ rt(n, "onRenderGroupEnd", mt(n, t, C({ isPinch: !!t.isPinch, isDrag: t.isDrag, targets: n.props.targets, events: o, transformObject: {}, transform: Xe(t) }, Zn(Ne(t)))));
2937
+ }, dragControlStart: function(n, t) {
2938
+ return this.dragStart(n, t);
2939
+ }, dragControl: function(n, t) {
2940
+ return this.drag(n, t);
2941
+ }, dragControlAfter: function(n, t) {
2942
+ return this.dragAfter(n, t);
2943
+ }, dragControlEnd: function(n, t) {
2944
+ return this.dragEnd(n, t);
2945
+ }, dragGroupControlStart: function(n, t) {
2946
+ return this.dragGroupStart(n, t);
2947
+ }, dragGroupControl: function(n, t) {
2948
+ return this.dragGroup(n, t);
2949
+ }, dragGroupControlEnd: function(n, t) {
2950
+ return this.dragGroupEnd(n, t);
2951
+ }, fillDragParams: function(n, t) {
2952
+ var e = {};
2953
+ return ne($e(t) || []).forEach(function(r) {
2954
+ e[r.name] = r.functionValue;
2955
+ }), mt(n, t, C({ isPinch: !!t.isPinch, transformObject: e, transform: Xe(t) }, Zn(Ne(t))));
2956
+ }, fillDragEndParams: function(n, t) {
2957
+ var e = {};
2958
+ return ne($e(t) || []).forEach(function(r) {
2959
+ e[r.name] = r.functionValue;
2960
+ }), mt(n, t, C({ isPinch: !!t.isPinch, isDrag: t.isDrag, transformObject: e, transform: Xe(t) }, Zn(Ne(t))));
2961
+ } };
2962
+ function we(n, t, e, r, i, o, a) {
2963
+ o.clientDistX = o.distX, o.clientDistY = o.distY;
2964
+ var s = i === "Start", u = i === "End", c = i === "After", p = n.state.target, f = o.isRequest, l = r.indexOf("Control") > -1;
2965
+ if (!p || s && l && !f && n.areaElement === o.inputEvent.target) return !1;
2966
+ var d = q([], O(t), !1);
2967
+ if (f) {
2968
+ var h = o.requestAble;
2969
+ d.some(function(M) {
2970
+ return M.name === h;
2971
+ }) || d.push.apply(d, q([], O(n.props.ables.filter(function(M) {
2972
+ return M.name === h;
2973
+ })), !1));
2974
+ }
2975
+ if (!d.length || d.every(function(M) {
2976
+ return M.dragRelation;
2977
+ })) return !1;
2978
+ var g, v = o.inputEvent;
2979
+ u && v && (g = document.elementFromPoint(o.clientX, o.clientY) || v.target);
2980
+ var m = !1, x = function() {
2981
+ var M;
2982
+ m = !0, (M = o.stop) === null || M === void 0 || M.call(o);
2983
+ }, y = s && (!n.targetGesto || !n.controlGesto || !n.targetGesto.isFlag() || !n.controlGesto.isFlag());
2984
+ y && n.updateRect(i, !0, !1);
2985
+ var E = o.datas, S = l ? "controlGesto" : "targetGesto", b = n[S], w = function(M, T, R) {
2986
+ if (!(T in M) || b !== n[S]) return !1;
2987
+ var F = M.name, z = E[F] || (E[F] = {});
2988
+ if (s && (z.isEventStart = !R || !M[R] || M[R](n, o)), !z.isEventStart) return !1;
2989
+ var B = M[T](n, C(C({}, o), { stop: x, datas: z, originalDatas: E, inputTarget: g }));
2990
+ return n._emitter.off(), s && B === !1 && (z.isEventStart = !1), B;
2991
+ };
2992
+ y && d.forEach(function(M) {
2993
+ M.unset && M.unset(n);
2994
+ }), w(ms, "drag".concat(r).concat(i));
2995
+ var _ = 0, D = 0;
2996
+ e.forEach(function(M) {
2997
+ if (m) return !1;
2998
+ var T = "".concat(M).concat(r).concat(i), R = "".concat(M).concat(r, "Condition");
2999
+ i !== "" || f || function(B, G) {
3000
+ var k, I = B.is3d ? 4 : 3;
3001
+ k = O(oi(B.rootMatrix, [G.distX, G.distY], I), 2), G.distX = k[0], G.distY = k[1];
3002
+ }(n.state, o);
3003
+ var F = d.filter(function(B) {
3004
+ return B[T];
3005
+ }), z = (F = F.filter(function(B, G) {
3006
+ return B.name && F.indexOf(B) === G;
3007
+ })).filter(function(B) {
3008
+ return w(B, T, R);
3009
+ }).length;
3010
+ m && ++_, z && ++D, !m && s && F.length && !z && (_ += F.filter(function(B) {
3011
+ var G = B.name;
3012
+ return !!E[G].isEventStart && B.dragRelation !== "strong";
3013
+ }).length ? 1 : 0);
3014
+ }), c && !D || w(bs, "drag".concat(r).concat(i));
3015
+ var P = b !== n[S] || _ === e.length;
3016
+ return (u || m || P) && (n.state.gestos = {}, n.moveables && n.moveables.forEach(function(M) {
3017
+ M.state.gestos = {};
3018
+ }), d.forEach(function(M) {
3019
+ M.unset && M.unset(n);
3020
+ })), s && !P && !f && D && n.props.preventDefault && o?.preventDefault(), n.isUnmounted || P ? !1 : ((!s && D && !a || u) && (n.props.flushSync || zo)(function() {
3021
+ n.updateRect(u ? i : "", !0, !1), n.forceUpdate();
3022
+ }), s || u || c || !D || a || we(n, t, e, r, i + "After", o), !0);
3023
+ }
3024
+ function ai(n, t) {
3025
+ return function(e, r) {
3026
+ var i;
3027
+ r === void 0 && (r = e.inputEvent.target);
3028
+ var o = r, a = n.areaElement, s = n._dragTarget;
3029
+ return !(!s || !t && (!((i = n.controlGesto) === null || i === void 0) && i.isFlag())) && (o === s || s.contains(o) || o === a || !n.isMoveableElement(o) && !n.controlBox.contains(o) || xn(o, "moveable-area") || xn(o, "moveable-padding") || xn(o, "moveable-edgeDraggable"));
3030
+ };
3031
+ }
3032
+ function Vo(n, t, e) {
3033
+ var r = n.controlBox, i = [], o = n.props, a = o.dragArea, s = n.state.target, u = o.dragTarget;
3034
+ i.push(r), a && !u || i.push(t), !a && u && s && t !== s && o.dragTargetSelf && i.push(s);
3035
+ var c = ai(n);
3036
+ return Ko(n, i, "targetAbles", e, { dragStart: c, pinchStart: c });
3037
+ }
3038
+ function Zo(n, t) {
3039
+ var e = n.controlBox, r = [];
3040
+ r.push(e);
3041
+ var i = ai(n, !0), o = function(a, s) {
3042
+ return s === void 0 && (s = a.inputEvent.target), s === e || !i(a, s);
3043
+ };
3044
+ return Ko(n, r, "controlAbles", t, { dragStart: o, pinchStart: o });
3045
+ }
3046
+ function Ko(n, t, e, r, i) {
3047
+ i === void 0 && (i = {});
3048
+ var o = e === "targetAbles", a = n.props, s = a.pinchOutside, u = a.pinchThreshold, c = a.preventClickEventOnDrag, p = a.preventClickDefault, f = a.checkInput, l = a.dragFocusedInput, d = a.preventDefault, h = d === void 0 || d, g = a.preventRightClick, v = g === void 0 || g, m = a.preventWheelClick, x = { preventDefault: h, preventRightClick: v, preventWheelClick: m === void 0 || m, container: Jn(a.dragContainer, !0) || Pn(n.getControlBoxElement()), pinchThreshold: u, pinchOutside: s, preventClickEventOnDrag: !!o && c, preventClickEventOnDragStart: !!o && p, preventClickEventByCondition: o ? null : function(S) {
3049
+ return n.controlBox.contains(S.target);
3050
+ }, checkInput: !!o && f, dragFocusedInput: l }, y = new Ra(t, x), E = r === "Control";
3051
+ return ["drag", "pinch"].forEach(function(S) {
3052
+ ["Start", "", "End"].forEach(function(b) {
3053
+ y.on("".concat(S).concat(b), function(w) {
3054
+ var _, D = w.eventType, P = S === "drag" && w.isPinch;
3055
+ if (!i[D] || i[D](w)) {
3056
+ if (!P) {
3057
+ var M = S === "drag" ? [S] : ["drag", S], T = q([], O(n[e]), !1);
3058
+ we(n, T, M, r, b, w) ? (n.props.stopPropagation || b === "Start" && E) && ((_ = w?.inputEvent) === null || _ === void 0 || _.stopPropagation()) : w.stop();
3059
+ }
3060
+ } else w.stop();
3061
+ });
3062
+ });
3063
+ }), y;
3064
+ }
3065
+ var xs = function() {
3066
+ function n(t, e, r) {
3067
+ var i = this;
3068
+ this.target = t, this.moveable = e, this.eventName = r, this.ables = [], this._onEvent = function(o) {
3069
+ var a = i.eventName, s = i.moveable;
3070
+ s.state.disableNativeEvent || i.ables.forEach(function(u) {
3071
+ u[a](s, { inputEvent: o });
3072
+ });
3073
+ }, t.addEventListener(r.toLowerCase(), this._onEvent);
3074
+ }
3075
+ return n.prototype.setAbles = function(t) {
3076
+ this.ables = t;
3077
+ }, n.prototype.destroy = function() {
3078
+ this.target.removeEventListener(this.eventName.toLowerCase(), this._onEvent), this.target = null, this.moveable = null;
3079
+ }, n;
3080
+ }();
3081
+ function ys(n, t, e, r) {
3082
+ var i;
3083
+ e === void 0 && (e = t);
3084
+ var o = Bi(n, t), a = o.matrixes, s = o.is3d, u = o.targetMatrix, c = o.transformOrigin, p = o.targetOrigin, f = o.offsetContainer, l = o.hasFixed, d = o.zoom, h = function(k, I) {
3085
+ if (jn) {
3086
+ var V = un(jn, function(et) {
3087
+ return et[0][0] == k && et[0][1] == I;
3088
+ });
3089
+ if (V) return V[1];
3090
+ }
3091
+ var Z = Bi(k, I, !0);
3092
+ return jn && jn.push([[k, I], Z]), Z;
3093
+ }(f, e), g = h.matrixes, v = h.is3d, m = h.offsetContainer, x = h.zoom, y = r, E = n.tagName.toLowerCase() !== "svg" && "ownerSVGElement" in n, S = u, b = bt(4), w = bt(4), _ = bt(4), D = bt(4), P = a.length, M = g.map(function(k) {
3094
+ return C(C({}, k), { matrix: k.matrix ? q([], O(k.matrix), !1) : void 0 });
3095
+ }).reverse();
3096
+ a.reverse(), !s && y && (S = In(S, 3, 4), Gr(a)), !v && y && Gr(M), M.forEach(function(k) {
3097
+ w = Ot(w, k.matrix, 4);
3098
+ });
3099
+ var T = e || kn(n), R = ((i = M[0]) === null || i === void 0 ? void 0 : i.target) || Te(T, T, !0).offsetParent, F = M.slice(1).reduce(function(k, I) {
3100
+ return Ot(k, I.matrix, 4);
3101
+ }, bt(4));
3102
+ a.forEach(function(k, I) {
3103
+ if (P - 2 === I && (_ = b.slice()), P - 1 === I && (D = b.slice()), !k.matrix) {
3104
+ var V = function(Z, et, U, X, N) {
3105
+ var H, L = Z.target, Q = Z.origin, pt = et.matrix, Y = Io(L), j = Y.offsetWidth, J = Y.offsetHeight, W = U.getBoundingClientRect(), ht = [0, 0];
3106
+ U === kn(U) && (ht = Go(L, !0));
3107
+ for (var Pt = L.getBoundingClientRect(), zt = Pt.left - W.left + U.scrollLeft - (U.clientLeft || 0) + ht[0], $ = Pt.top - W.top + U.scrollTop - (U.clientTop || 0) + ht[1], it = Pt.width, lt = Pt.height, st = Ke(X, N, pt), dt = Hi(st, j, J, X), wt = dt.left, ot = dt.top, gt = dt.width, ut = dt.height, At = yn(st, Q, X), qt = nt(At, [wt, ot]), K = [zt + qt[0] * it / gt, $ + qt[1] * lt / ut], tt = [0, 0], yt = 0; ++yt < 10; ) {
3108
+ var Mt = Gn(N, X);
3109
+ H = O(nt(yn(Mt, K, X), yn(Mt, At, X)), 2), tt[0] = H[0], tt[1] = H[1];
3110
+ var at = Hi(Ke(X, N, Yn(tt, X), pt), j, J, X), vt = at.left - zt, ct = at.top - $;
3111
+ if (A(vt) < 2 && A(ct) < 2) break;
3112
+ K[0] -= vt, K[1] -= ct;
3113
+ }
3114
+ return tt.map(function(Dt) {
3115
+ return Math.round(Dt);
3116
+ });
3117
+ }(k, a[I + 1], R, 4, Ot(F, b, 4));
3118
+ k.matrix = Yn(V, 4);
3119
+ }
3120
+ b = Ot(b, k.matrix, 4);
3121
+ });
3122
+ var z = !E && s;
3123
+ S || (S = bt(z ? 4 : 3));
3124
+ var B = ei(E && S.length === 16 ? In(S, 4, 3) : S, z), G = w;
3125
+ return w = function(k, I, V) {
3126
+ for (var Z = k.slice(), et = 0; et < V; ++et) Z[et * V + I - 1] = 0, Z[(I - 1) * V + et] = 0;
3127
+ return Z[(I - 1) * (V + 1)] = 1, Z;
3128
+ }(w, 4, 4), { hasZoom: d !== 1 || x !== 1, hasFixed: l, matrixes: a, rootMatrix: w, originalRootMatrix: G, beforeMatrix: _, offsetMatrix: D, allMatrix: b, targetMatrix: S, targetTransform: B, inlineTransform: n.style.transform, transformOrigin: c, targetOrigin: p, is3d: y, offsetContainer: f, offsetRootContainer: m };
3129
+ }
3130
+ function Es(n, t, e, r) {
3131
+ e === void 0 && (e = t);
3132
+ var i, o, a = 0, s = 0, u = 0, c = {}, p = Io(n);
3133
+ if (n && (a = p.offsetWidth, s = p.offsetHeight), n) {
3134
+ var f = ys(n, t, e, r), l = ye(f.allMatrix, f.transformOrigin, a, s);
3135
+ c = C(C({}, f), l);
3136
+ var d = ye(f.allMatrix, [50, 50], 100, 100);
3137
+ i = [d.pos1, d.pos2], u = sn((o = d.direction) > 0 ? i[0] : i[1], o > 0 ? i[1] : i[0]);
3138
+ }
3139
+ return C(C(C({ hasZoom: !1, width: a, height: s, rotation: u }, p), { originalRootMatrix: bt(4), rootMatrix: bt(4), beforeMatrix: bt(4), offsetMatrix: bt(4), allMatrix: bt(4), targetMatrix: bt(4), targetTransform: "", inlineTransform: "", transformOrigin: [0, 0], targetOrigin: [0, 0], is3d: !0, left: 0, top: 0, right: 0, bottom: 0, origin: [0, 0], pos1: [0, 0], pos2: [0, 0], pos3: [0, 0], pos4: [0, 0], direction: 1, hasFixed: !1, offsetContainer: null, offsetRootContainer: null, matrixes: [] }), c);
3140
+ }
3141
+ function Wr(n, t, e, r, i, o) {
3142
+ o === void 0 && (o = []);
3143
+ var a = 1, s = [0, 0], u = { left: 0, top: 0, width: 0, height: 0, right: 0, bottom: 0, clientLeft: 0, clientTop: 0, clientWidth: 0, clientHeight: 0, scrollWidth: 0, scrollHeight: 0 }, c = { left: 0, top: 0, width: 0, height: 0, right: 0, bottom: 0, clientLeft: 0, clientTop: 0, clientWidth: 0, clientHeight: 0, scrollWidth: 0, scrollHeight: 0 }, p = { left: 0, top: 0, width: 0, height: 0, right: 0, bottom: 0, clientLeft: 0, clientTop: 0, clientWidth: 0, clientHeight: 0, scrollWidth: 0, scrollHeight: 0 }, f = { left: 0, top: 0, width: 0, height: 0, right: 0, bottom: 0, clientLeft: 0, clientTop: 0, clientWidth: 0, clientHeight: 0, scrollWidth: 0, scrollHeight: 0 }, l = [0, 0], d = {}, h = Es(t, e, i, !0);
3144
+ if (t) {
3145
+ var g = nn(t);
3146
+ o.forEach(function(T) {
3147
+ d[T] = g(T);
3148
+ });
3149
+ var v = h.is3d ? 4 : 3, m = ye(h.offsetMatrix, St(h.transformOrigin, function(T, R) {
3150
+ R === void 0 && (R = Math.sqrt(T.length));
3151
+ for (var F = [], z = T[R * R - 1], B = 0; B < R - 1; ++B) F[B] = T[R * (R - 1) + B] / z;
3152
+ return F[R - 1] = 0, F;
3153
+ }(h.targetMatrix, v)), h.width, h.height);
3154
+ a = m.direction, s = St(m.origin, [m.left - h.left, m.top - h.top]), f = He(h.offsetRootContainer);
3155
+ var x = Te(r, r, !0).offsetParent || h.offsetRootContainer;
3156
+ if (h.hasZoom) {
3157
+ var y = ye(Ot(h.originalRootMatrix, h.allMatrix), h.transformOrigin, h.width, h.height), E = ye(h.originalRootMatrix, Qe(nn(x)("transformOrigin")).map(function(T) {
3158
+ return parseFloat(T);
3159
+ }), x.offsetWidth, x.offsetHeight);
3160
+ if (u = mr(y, f), p = mr(E, f, x, !0), n) {
3161
+ var S = y.left, b = y.top;
3162
+ c = mr({ left: S, top: b, bottom: b, right: b }, f);
3163
+ }
3164
+ } else {
3165
+ u = He(t), p = function(T) {
3166
+ var R = Ln?.get(T);
3167
+ if (R) return R;
3168
+ var F = He(T, !0);
3169
+ return Ln && Ln.set(T, F), F;
3170
+ }(x), n && (c = He(n));
3171
+ var w = p.left, _ = p.top, D = p.clientLeft, P = p.clientTop, M = [u.left - w, u.top - _];
3172
+ l = nt(oi(h.rootMatrix, M, 4), [D + h.left, P + h.top]);
3173
+ }
3174
+ }
3175
+ return C({ targetClientRect: u, containerClientRect: p, moveableClientRect: c, rootContainerClientRect: f, beforeDirection: a, beforeOrigin: s, originalBeforeOrigin: s, target: t, style: d, offsetDelta: l }, h);
3176
+ }
3177
+ function Vi(n) {
3178
+ var t = n.pos1, e = n.pos2, r = n.pos3, i = n.pos4;
3179
+ if (!(t && e && r && i)) return null;
3180
+ var o = Un([t, e, r, i]), a = [o.minX, o.minY], s = nt(n.origin, a);
3181
+ return t = nt(t, a), e = nt(e, a), r = nt(r, a), i = nt(i, a), C(C({}, n), { left: n.left, top: n.top, posDelta: a, pos1: t, pos2: e, pos3: r, pos4: i, origin: s, beforeOrigin: s, isPersisted: !0 });
3182
+ }
3183
+ var ie = function(n) {
3184
+ function t() {
3185
+ var e = n !== null && n.apply(this, arguments) || this;
3186
+ return e.state = C({ container: null, gestos: {}, renderLines: [[[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]], renderPoses: [[0, 0], [0, 0], [0, 0], [0, 0]], disableNativeEvent: !1, posDelta: [0, 0] }, Wr(null)), e.renderState = {}, e.enabledAbles = [], e.targetAbles = [], e.controlAbles = [], e.rotation = 0, e.scale = [1, 1], e.isMoveableMounted = !1, e.isUnmounted = !1, e.events = { mouseEnter: null, mouseLeave: null }, e._emitter = new go(), e._prevOriginalDragTarget = null, e._originalDragTarget = null, e._prevDragTarget = null, e._dragTarget = null, e._prevPropTarget = null, e._propTarget = null, e._prevDragArea = !1, e._isPropTargetChanged = !1, e._hasFirstTarget = !1, e._reiszeObserver = null, e._observerId = 0, e._mutationObserver = null, e._rootContainer = null, e._viewContainer = null, e._viewClassNames = [], e._store = {}, e.checkUpdateRect = function() {
3187
+ if (!e.isDragging()) {
3188
+ var r = e.props.parentMoveable;
3189
+ r ? r.checkUpdateRect() : (ga(e._observerId), e._observerId = oo(function() {
3190
+ e.isDragging() || e.updateRect();
3191
+ }));
3192
+ }
3193
+ }, e._onPreventClick = function(r) {
3194
+ r.stopPropagation(), r.preventDefault();
3195
+ }, e;
3196
+ }
3197
+ return Re(t, n), t.prototype.render = function() {
3198
+ var e = this.props, r = this.getState(), i = e.parentPosition, o = e.className, a = e.target, s = e.zoom, u = e.cspNonce, c = e.translateZ, p = e.cssStyled, f = e.groupable, l = e.linePadding, d = e.controlPadding;
3199
+ this._checkUpdateRootContainer(), this.checkUpdate(), this.updateRenderPoses();
3200
+ var h = O(i || [0, 0], 2), g = h[0], v = h[1], m = r.left, x = r.top, y = r.target, E = r.direction, S = r.hasFixed, b = r.offsetDelta, w = e.targets, _ = this.isDragging(), D = {};
3201
+ this.getEnabledAbles().forEach(function(z) {
3202
+ D["data-able-".concat(z.name.toLowerCase())] = !0;
3203
+ });
3204
+ var P = this._getAbleClassName(), M = w && w.length && (y || f) || a || !this._hasFirstTarget && this.state.isPersisted, T = this.controlBox || this.props.firstRenderState || this.props.persistData, R = [m - g, x - v];
3205
+ !f && e.useAccuratePosition && (R[0] += b[0], R[1] += b[1]);
3206
+ var F = { position: S ? "fixed" : "absolute", display: M ? "block" : "none", visibility: T ? "visible" : "hidden", transform: "translate3d(".concat(R[0], "px, ").concat(R[1], "px, ").concat(c, ")"), "--zoom": s, "--zoompx": "".concat(s, "px") };
3207
+ return l && (F["--moveable-line-padding"] = l), d && (F["--moveable-control-padding"] = d), On.createElement(p, C({ cspNonce: u, ref: An(this, "controlBox"), className: "".concat(xt("control-box", E === -1 ? "reverse" : "", _ ? "dragging" : ""), " ").concat(P, " ").concat(o) }, D, { onClick: this._onPreventClick, style: F }), this.renderAbles(), this._renderLines());
3208
+ }, t.prototype.componentDidMount = function() {
3209
+ this.isMoveableMounted = !0, this.isUnmounted = !1;
3210
+ var e = this.props, r = e.parentMoveable, i = e.container;
3211
+ this._checkUpdateRootContainer(), this._checkUpdateViewContainer(), this._updateTargets(), this._updateNativeEvents(), this._updateEvents(), this.updateCheckInput(), this._updateObserver(this.props), i || r || this.state.isPersisted || (this.updateRect("", !1, !1), this.forceUpdate());
3212
+ }, t.prototype.componentDidUpdate = function(e) {
3213
+ this._checkUpdateRootContainer(), this._checkUpdateViewContainer(), this._updateNativeEvents(), this._updateTargets(), this._updateEvents(), this.updateCheckInput(), this._updateObserver(e);
3214
+ }, t.prototype.componentWillUnmount = function() {
3215
+ var e, r;
3216
+ this.isMoveableMounted = !1, this.isUnmounted = !0, this._emitter.off(), (e = this._reiszeObserver) === null || e === void 0 || e.disconnect(), (r = this._mutationObserver) === null || r === void 0 || r.disconnect(), this._viewContainer && this._changeAbleViewClassNames([]), Vn(this, !1), Vn(this, !0);
3217
+ var i = this.events;
3218
+ for (var o in i) {
3219
+ var a = i[o];
3220
+ a && a.destroy();
3221
+ }
3222
+ }, t.prototype.getTargets = function() {
3223
+ var e = this.props.target;
3224
+ return e ? [e] : [];
3225
+ }, t.prototype.getAble = function(e) {
3226
+ return un(this.props.ables || [], function(r) {
3227
+ return r.name === e;
3228
+ });
3229
+ }, t.prototype.getContainer = function() {
3230
+ var e = this.props, r = e.parentMoveable, i = e.wrapperMoveable;
3231
+ return e.container || i && i.getContainer() || r && r.getContainer() || this.controlBox.parentElement;
3232
+ }, t.prototype.getControlBoxElement = function() {
3233
+ return this.controlBox;
3234
+ }, t.prototype.getDragElement = function() {
3235
+ return this._dragTarget;
3236
+ }, t.prototype.isMoveableElement = function(e) {
3237
+ var r;
3238
+ return e && (((r = e.getAttribute) === null || r === void 0 ? void 0 : r.call(e, "class")) || "").indexOf(Qr) > -1;
3239
+ }, t.prototype.dragStart = function(e, r) {
3240
+ r === void 0 && (r = e.target);
3241
+ var i = this.targetGesto, o = this.controlGesto;
3242
+ return i && ai(this)({ inputEvent: e }, r) ? i.isFlag() || i.triggerDragStart(e) : o && this.isMoveableElement(r) && (o.isFlag() || o.triggerDragStart(e)), this;
3243
+ }, t.prototype.hitTest = function(e) {
3244
+ var r, i = this.state, o = i.target, a = i.pos1, s = i.pos2, u = i.pos3, c = i.pos4, p = i.targetClientRect;
3245
+ if (!o) return 0;
3246
+ if (Kr(e)) {
3247
+ var f = e.getBoundingClientRect();
3248
+ r = { left: f.left, top: f.top, width: f.width, height: f.height };
3249
+ } else r = C({ width: 0, height: 0 }, e);
3250
+ var l = r.left, d = r.top, h = r.width, g = r.height, v = Di([a, s, c, u], p), m = Mi(Pa(v, [[l, d], [l + h, d], [l + h, d + g], [l, d + g]])), x = Mi(v);
3251
+ return m && x ? Math.min(100, m / x * 100) : 0;
3252
+ }, t.prototype.isInside = function(e, r) {
3253
+ var i = this.state, o = i.target, a = i.pos1, s = i.pos2, u = i.pos3, c = i.pos4, p = i.targetClientRect;
3254
+ return !!o && Tr([e, r], Di([a, s, c, u], p));
3255
+ }, t.prototype.updateRect = function(e, r, i) {
3256
+ i === void 0 && (i = !0);
3257
+ var o = this.props, a = !o.parentPosition && !o.wrapperMoveable;
3258
+ a && ee(!0);
3259
+ var s = o.parentMoveable, u = this.state.target || o.target, c = this.getContainer(), p = s ? s._rootContainer : this._rootContainer, f = Wr(this.controlBox, u, c, c, p || c, this._getRequestStyles());
3260
+ if (!u && this._hasFirstTarget && o.persistData) {
3261
+ var l = Vi(o.persistData);
3262
+ for (var d in l) f[d] = l[d];
3263
+ }
3264
+ a && ee(), this.updateState(f, !s && i);
3265
+ }, t.prototype.isDragging = function(e) {
3266
+ var r, i, o = this.targetGesto, a = this.controlGesto;
3267
+ return o?.isFlag() ? !e || !!(!((r = o.getEventData()[e]) === null || r === void 0) && r.isEventStart) : !!a?.isFlag() && (!e || !!(!((i = a.getEventData()[e]) === null || i === void 0) && i.isEventStart));
3268
+ }, t.prototype.updateTarget = function(e) {
3269
+ this.updateRect(e, !0);
3270
+ }, t.prototype.getRect = function() {
3271
+ var e = this.state, r = Rn(this.state), i = O(r, 4), o = i[0], a = i[1], s = i[2], u = i[3], c = ir(r), p = e.width, f = e.height, l = c.width, d = c.height, h = c.left, g = c.top, v = [e.left, e.top], m = St(v, e.origin);
3272
+ return { width: l, height: d, left: h, top: g, pos1: o, pos2: a, pos3: s, pos4: u, offsetWidth: p, offsetHeight: f, beforeOrigin: St(v, e.beforeOrigin), origin: m, transformOrigin: e.transformOrigin, rotation: this.getRotation() };
3273
+ }, t.prototype.getManager = function() {
3274
+ return this;
3275
+ }, t.prototype.stopDrag = function(e) {
3276
+ var r;
3277
+ e && e !== "target" || (((r = this.targetGesto) == null ? void 0 : r.isIdle()) === !1 && Ir(this, !1), r?.stop()), e && e !== "control" || (((r = this.controlGesto) == null ? void 0 : r.isIdle()) === !1 && Ir(this, !0), r?.stop());
3278
+ }, t.prototype.getRotation = function() {
3279
+ var e = this.state;
3280
+ return function(r, i, o) {
3281
+ var a = sn(r, i) / Math.PI * 180;
3282
+ return (a = o >= 0 ? a : 180 - a) >= 0 ? a : 360 + a;
3283
+ }(e.pos1, e.pos2, e.direction);
3284
+ }, t.prototype.request = function(e, r, i) {
3285
+ r === void 0 && (r = {});
3286
+ var o = this, a = o.props, s = a.parentMoveable || a.wrapperMoveable || o, u = s.props.ables, c = a.groupable, p = un(u, function(m) {
3287
+ return m.name === e;
3288
+ });
3289
+ if (this.isDragging() || !p || !p.request) return { request: function() {
3290
+ return this;
3291
+ }, requestEnd: function() {
3292
+ return this;
3293
+ } };
3294
+ var f = p.request(o), l = i || r.isInstant, d = f.isControl ? "controlAbles" : "targetAbles", h = "".concat(c ? "Group" : "").concat(f.isControl ? "Control" : ""), g = q([], O(s[d]), !1), v = { request: function(m) {
3295
+ return we(o, g, ["drag"], h, "", C(C({}, f.request(m)), { requestAble: e, isRequest: !0 }), l), v;
3296
+ }, requestEnd: function() {
3297
+ return we(o, g, ["drag"], h, "End", C(C({}, f.requestEnd()), { requestAble: e, isRequest: !0 }), l), v;
3298
+ } };
3299
+ return we(o, g, ["drag"], h, "Start", C(C({}, f.requestStart(r)), { requestAble: e, isRequest: !0 }), l), l ? v.request(r).requestEnd() : v;
3300
+ }, t.prototype.getMoveables = function() {
3301
+ return [this];
3302
+ }, t.prototype.destroy = function() {
3303
+ this.componentWillUnmount();
3304
+ }, t.prototype.updateRenderPoses = function() {
3305
+ var e = this.getState(), r = this.props, i = r.padding, o = e.originalBeforeOrigin, a = e.transformOrigin, s = e.allMatrix, u = e.is3d, c = e.pos1, p = e.pos2, f = e.pos3, l = e.pos4, d = e.left, h = e.top, g = e.isPersisted, v = r.zoom || 1;
3306
+ if (!i && v <= 1) return e.renderPoses = [c, p, f, l], void (e.renderLines = [[c, p], [p, l], [l, f], [f, c]]);
3307
+ var m = Lo(i || {}), x = m.left, y = m.top, E = m.bottom, S = m.right, b = u ? 4 : 3, w = Ke(b, Yn((g ? a : this.controlBox && r.groupable ? o : St(o, [d, h])).map(function(R) {
3308
+ return -R;
3309
+ }), b), s, Yn(a, b)), _ = an(w, c, [-x, -y], b), D = an(w, p, [S, -y], b), P = an(w, f, [-x, E], b), M = an(w, l, [S, E], b);
3310
+ e.renderPoses = [_, D, P, M], e.renderLines = [[_, D], [D, M], [M, P], [P, _]];
3311
+ var T = v / 2;
3312
+ e.renderLines = [[an(w, c, [-x - T, -y], b), an(w, p, [S + T, -y], b)], [an(w, p, [S, -y - T], b), an(w, l, [S, E + T], b)], [an(w, l, [S + T, E], b), an(w, f, [-x - T, E], b)], [an(w, f, [-x, E + T], b), an(w, c, [-x, -y - T], b)]];
3313
+ }, t.prototype.checkUpdate = function() {
3314
+ this._isPropTargetChanged = !1;
3315
+ var e = this.props, r = e.target, i = e.container, o = e.parentMoveable, a = this.state, s = a.target, u = a.container;
3316
+ if (s || r) {
3317
+ this.updateAbles();
3318
+ var c = !Yr(s, r);
3319
+ if (c || !Yr(u, i)) {
3320
+ var p = i || this.controlBox;
3321
+ p && this.unsetAbles(), this.updateState({ target: r, container: i }), !o && p && this.updateRect("End", !1, !1), this._isPropTargetChanged = c;
3322
+ }
3323
+ }
3324
+ }, t.prototype.waitToChangeTarget = function() {
3325
+ return new Promise(function() {
3326
+ });
3327
+ }, t.prototype.triggerEvent = function(e, r) {
3328
+ var i = this.props;
3329
+ if (this._emitter.trigger(e, r), i.parentMoveable && r.isRequest && !r.isRequestChild) return i.parentMoveable.triggerEvent(e, r, !0);
3330
+ var o = i[e];
3331
+ return o && o(r);
3332
+ }, t.prototype.useCSS = function(e, r) {
3333
+ var i = this.props.customStyledMap, o = e + r;
3334
+ return i[o] || (i[o] = mo(e, r)), i[o];
3335
+ }, t.prototype.getState = function() {
3336
+ var e, r = this.props;
3337
+ (r.target || !((e = r.targets) === null || e === void 0) && e.length) && (this._hasFirstTarget = !0);
3338
+ var i = this.controlBox, o = r.persistData, a = r.firstRenderState;
3339
+ if (a && !i) return a;
3340
+ if (!this._hasFirstTarget && o) {
3341
+ var s = Vi(o);
3342
+ if (s) return this.updateState(s, !1), this.state;
3343
+ }
3344
+ return this.state.isPersisted = !1, this.state;
3345
+ }, t.prototype.updateSelectors = function() {
3346
+ }, t.prototype.unsetAbles = function() {
3347
+ var e = this;
3348
+ this.targetAbles.forEach(function(r) {
3349
+ r.unset && r.unset(e);
3350
+ });
3351
+ }, t.prototype.updateAbles = function(e, r) {
3352
+ e === void 0 && (e = this.props.ables), r === void 0 && (r = "");
3353
+ var i = this.props.triggerAblesSimultaneously, o = this.getEnabledAbles(e), a = "drag".concat(r, "Start"), s = "pinch".concat(r, "Start"), u = "drag".concat(r, "ControlStart"), c = qe(o, [a, s], i), p = qe(o, [u], i);
3354
+ this.enabledAbles = o, this.targetAbles = c, this.controlAbles = p;
3355
+ }, t.prototype.updateState = function(e, r) {
3356
+ if (r) {
3357
+ if (this.isUnmounted) return;
3358
+ this.setState(e);
3359
+ } else {
3360
+ var i = this.state;
3361
+ for (var o in e) i[o] = e[o];
3362
+ }
3363
+ }, t.prototype.getEnabledAbles = function(e) {
3364
+ e === void 0 && (e = this.props.ables);
3365
+ var r = this.props;
3366
+ return e.filter(function(i) {
3367
+ return i && (i.always && r[i.name] !== !1 || r[i.name]);
3368
+ });
3369
+ }, t.prototype.renderAbles = function() {
3370
+ var e, r, i, o, a = this, s = this.props.triggerAblesSimultaneously, u = { createElement: yr };
3371
+ return this.renderState = {}, (e = No(qe(this.getEnabledAbles(), ["render"], s).map(function(c) {
3372
+ return (0, c.render)(a, u) || [];
3373
+ })).filter(function(c) {
3374
+ return c;
3375
+ }), r = function(c) {
3376
+ return c.key;
3377
+ }, i = [], o = {}, e.forEach(function(c, p) {
3378
+ var f = r(c, p, e), l = o[f];
3379
+ l || (l = [], o[f] = l, i.push(l)), l.push(c);
3380
+ }), i).map(function(c) {
3381
+ return c[0];
3382
+ });
3383
+ }, t.prototype.updateCheckInput = function() {
3384
+ this.targetGesto && (this.targetGesto.options.checkInput = this.props.checkInput);
3385
+ }, t.prototype._getRequestStyles = function() {
3386
+ return this.getEnabledAbles().reduce(function(e, r) {
3387
+ var i, o, a = (o = (i = r.requestStyle) === null || i === void 0 ? void 0 : i.call(r)) !== null && o !== void 0 ? o : [];
3388
+ return q(q([], O(e), !1), O(a), !1);
3389
+ }, q([], O(this.props.requestStyles || []), !1));
3390
+ }, t.prototype._updateObserver = function(e) {
3391
+ this._updateResizeObserver(e), this._updateMutationObserver(e);
3392
+ }, t.prototype._updateEvents = function() {
3393
+ var e = this.targetAbles.length, r = this.controlAbles.length, i = this._dragTarget;
3394
+ (!e && this.targetGesto || this._isTargetChanged(!0)) && (Vn(this, !1), this.updateState({ gestos: {} })), r || Vn(this, !0), i && e && !this.targetGesto && (this.targetGesto = Vo(this, i, "")), !this.controlGesto && r && (this.controlGesto = Zo(this, "Control"));
3395
+ }, t.prototype._updateTargets = function() {
3396
+ var e = this.props;
3397
+ this._prevPropTarget = this._propTarget, this._prevDragTarget = this._dragTarget, this._prevOriginalDragTarget = this._originalDragTarget, this._prevDragArea = e.dragArea, this._propTarget = e.target, this._originalDragTarget = e.dragTarget || e.target, this._dragTarget = Jn(this._originalDragTarget, !0);
3398
+ }, t.prototype._renderLines = function() {
3399
+ var e = this.props, r = e.zoom, i = e.hideDefaultLines, o = e.hideChildMoveableDefaultLines, a = e.parentMoveable;
3400
+ if (i || a && o) return [];
3401
+ var s = this.getState(), u = { createElement: yr };
3402
+ return s.renderLines.map(function(c, p) {
3403
+ return ti(u, "", c[0], c[1], r, "render-line-".concat(p));
3404
+ });
3405
+ }, t.prototype._isTargetChanged = function(e) {
3406
+ var r = this.props, i = r.dragTarget || r.target, o = this._prevOriginalDragTarget, a = this._prevDragArea, s = r.dragArea;
3407
+ return !s && o !== i || (e || s) && a !== s || this._prevPropTarget != this._propTarget;
3408
+ }, t.prototype._updateNativeEvents = function() {
3409
+ var e = this, r = this.props.dragArea ? this.areaElement : this.state.target, i = this.events, o = De(i);
3410
+ if (this._isTargetChanged()) for (var a in i) {
3411
+ var s = i[a];
3412
+ s && s.destroy(), i[a] = null;
3413
+ }
3414
+ if (r) {
3415
+ var u = this.enabledAbles;
3416
+ o.forEach(function(c) {
3417
+ var p = qe(u, [c]), f = p.length > 0, l = i[c];
3418
+ f ? (l || (l = new xs(r, e, c), i[c] = l), l.setAbles(p)) : l && (l.destroy(), i[c] = null);
3419
+ });
3420
+ }
3421
+ }, t.prototype._checkUpdateRootContainer = function() {
3422
+ var e = this.props.rootContainer;
3423
+ !this._rootContainer && e && (this._rootContainer = Jn(e, !0));
3424
+ }, t.prototype._checkUpdateViewContainer = function() {
3425
+ var e = this.props.viewContainer;
3426
+ !this._viewContainer && e && (this._viewContainer = Jn(e, !0)), this._viewContainer && this._changeAbleViewClassNames(q(q([], O(this._getAbleViewClassNames()), !1), [this.isDragging() ? hs : ""], !1));
3427
+ }, t.prototype._changeAbleViewClassNames = function(e) {
3428
+ var r, i, o, a, s = this._viewContainer, u = (r = e.filter(Boolean), i = function(d) {
3429
+ return d;
3430
+ }, o = [], a = [], r.forEach(function(d, h) {
3431
+ var g = i(d, h, r), v = a.indexOf(g), m = o[v] || [];
3432
+ v === -1 && (a.push(g), o.push(m)), m.push(d);
3433
+ }), o).map(function(d) {
3434
+ return O(d, 1)[0];
3435
+ }), c = this._viewClassNames, p = po(c, u), f = p.removed, l = p.added;
3436
+ f.forEach(function(d) {
3437
+ so(s, c[d]);
3438
+ }), l.forEach(function(d) {
3439
+ ao(s, u[d]);
3440
+ }), this._viewClassNames = u;
3441
+ }, t.prototype._getAbleViewClassNames = function() {
3442
+ var e = this;
3443
+ return (this.getEnabledAbles().map(function(r) {
3444
+ var i;
3445
+ return ((i = r.viewClassName) === null || i === void 0 ? void 0 : i.call(r, e)) || "";
3446
+ }).join(" ") + " ".concat(this._getAbleClassName("-view"))).split(/\s+/g);
3447
+ }, t.prototype._getAbleClassName = function(e) {
3448
+ var r = this;
3449
+ e === void 0 && (e = "");
3450
+ var i = this.getEnabledAbles(), o = this.targetGesto, a = this.controlGesto, s = o?.isFlag() ? o.getEventData() : {}, u = a?.isFlag() ? a.getEventData() : {};
3451
+ return i.map(function(c) {
3452
+ var p, f, l, d = c.name, h = ((p = c.className) === null || p === void 0 ? void 0 : p.call(c, r)) || "";
3453
+ return (!((f = s[d]) === null || f === void 0) && f.isEventStart || !((l = u[d]) === null || l === void 0) && l.isEventStart) && (h += " ".concat(xt("".concat(d).concat(e, "-dragging")))), h.trim();
3454
+ }).filter(Boolean).join(" ");
3455
+ }, t.prototype._updateResizeObserver = function(e) {
3456
+ var r, i = this.props, o = i.target, a = Pn(this.getControlBoxElement());
3457
+ if (a.ResizeObserver && o && i.useResizeObserver) {
3458
+ if (e.target !== o || !this._reiszeObserver) {
3459
+ var s = new a.ResizeObserver(this.checkUpdateRect);
3460
+ s.observe(o, { box: "border-box" }), this._reiszeObserver = s;
3461
+ }
3462
+ } else (r = this._reiszeObserver) === null || r === void 0 || r.disconnect();
3463
+ }, t.prototype._updateMutationObserver = function(e) {
3464
+ var r, i = this, o = this.props, a = o.target, s = Pn(this.getControlBoxElement());
3465
+ if (s.MutationObserver && a && o.useMutationObserver) {
3466
+ if (e.target !== a || !this._mutationObserver) {
3467
+ var u = new s.MutationObserver(function(c) {
3468
+ var p, f;
3469
+ try {
3470
+ for (var l = function(g) {
3471
+ var v = typeof Symbol == "function" && Symbol.iterator, m = v && g[v], x = 0;
3472
+ if (m) return m.call(g);
3473
+ if (g && typeof g.length == "number") return { next: function() {
3474
+ return g && x >= g.length && (g = void 0), { value: g && g[x++], done: !g };
3475
+ } };
3476
+ throw new TypeError(v ? "Object is not iterable." : "Symbol.iterator is not defined.");
3477
+ }(c), d = l.next(); !d.done; d = l.next()) {
3478
+ var h = d.value;
3479
+ h.type === "attributes" && h.attributeName === "style" && i.checkUpdateRect();
3480
+ }
3481
+ } catch (g) {
3482
+ p = { error: g };
3483
+ } finally {
3484
+ try {
3485
+ d && !d.done && (f = l.return) && f.call(l);
3486
+ } finally {
3487
+ if (p) throw p.error;
3488
+ }
3489
+ }
3490
+ });
3491
+ u.observe(a, { attributes: !0 }), this._mutationObserver = u;
3492
+ }
3493
+ } else (r = this._mutationObserver) === null || r === void 0 || r.disconnect();
3494
+ }, t.defaultProps = { dragTargetSelf: !1, target: null, dragTarget: null, container: null, rootContainer: null, origin: !0, parentMoveable: null, wrapperMoveable: null, isWrapperMounted: !1, parentPosition: null, warpSelf: !1, svgOrigin: "", dragContainer: null, useResizeObserver: !1, useMutationObserver: !1, preventDefault: !0, preventRightClick: !0, preventWheelClick: !0, linePadding: 0, controlPadding: 0, ables: [], pinchThreshold: 20, dragArea: !1, passDragArea: !1, transformOrigin: "", className: "", zoom: 1, triggerAblesSimultaneously: !1, padding: {}, pinchOutside: !0, checkInput: !1, dragFocusedInput: !1, groupable: !1, hideDefaultLines: !1, cspNonce: "", translateZ: 0, cssStyled: null, customStyledMap: {}, props: {}, stopPropagation: !1, preventClickDefault: !1, preventClickEventOnDrag: !0, flushSync: zo, firstRenderState: null, persistData: null, viewContainer: null, requestStyles: [], useAccuratePosition: !1 }, t;
3495
+ }(On.PureComponent), Uo = { name: "groupable", props: ["defaultGroupRotate", "useDefaultGroupRotate", "defaultGroupOrigin", "groupable", "groupableProps", "targetGroups", "hideChildMoveableDefaultLines"], events: [], render: function(n, t) {
3496
+ var e, r = n.props, i = r.targets || [], o = n.getState(), a = o.left, s = o.top, u = o.isPersisted, c = r.zoom || 1, p = n.renderGroupRects, f = ((e = r.persistData) === null || e === void 0 ? void 0 : e.children) || [];
3497
+ u ? i = f.map(function() {
3498
+ return null;
3499
+ }) : f = [];
3500
+ var l = Li(n, "parentPosition", [a, s], function(h) {
3501
+ return h.join(",");
3502
+ }), d = Li(n, "requestStyles", n.getRequestChildStyles(), function(h) {
3503
+ return h.join(",");
3504
+ });
3505
+ return n.moveables = n.moveables.slice(0, i.length), q(q([], O(i.map(function(h, g) {
3506
+ return t.createElement(ie, { key: "moveable" + g, ref: no(n, "moveables", g), target: h, origin: !1, requestStyles: d, cssStyled: r.cssStyled, customStyledMap: r.customStyledMap, useResizeObserver: r.useResizeObserver, useMutationObserver: r.useMutationObserver, hideChildMoveableDefaultLines: r.hideChildMoveableDefaultLines, parentMoveable: n, parentPosition: [a, s], persistData: f[g], zoom: c });
3507
+ })), !1), O(No(p.map(function(h, g) {
3508
+ var v = [h.pos1, h.pos2, h.pos3, h.pos4];
3509
+ return [[0, 1], [1, 3], [3, 2], [2, 0]].map(function(m, x) {
3510
+ var y = O(m, 2), E = y[0], S = y[1];
3511
+ return ti(t, "", nt(v[E], l), nt(v[S], l), c, "group-rect-".concat(g, "-").concat(x));
3512
+ });
3513
+ }))), !1);
3514
+ } };
3515
+ function Wn(n) {
3516
+ var t = n.originalDatas.draggable;
3517
+ return t || (n.originalDatas.draggable = {}, t = n.originalDatas.draggable), C(C({}, n), { datas: t });
3518
+ }
3519
+ Ce("clickable", { props: ["clickable"], events: ["click", "clickGroup"], always: !0, dragRelation: "weak", dragStart: function() {
3520
+ }, dragControlStart: function() {
3521
+ }, dragGroupStart: function(n, t) {
3522
+ t.datas.inputTarget = t.inputEvent && t.inputEvent.target;
3523
+ }, dragEnd: function(n, t) {
3524
+ var e = n.props.target, r = t.inputEvent, i = t.inputTarget, o = !n.isMoveableElement(i) && n.controlBox.contains(i);
3525
+ if (r && i && !t.isDrag && !n.isMoveableElement(i) && !o) {
3526
+ var a = e.contains(i);
3527
+ rt(n, "onClick", mt(n, t, { isDouble: t.isDouble, inputTarget: i, isTarget: e === i, moveableTarget: n.props.target, containsTarget: a }));
3528
+ }
3529
+ }, dragGroupEnd: function(n, t) {
3530
+ var e = t.inputEvent, r = t.inputTarget;
3531
+ if (e && r && !t.isDrag && !n.isMoveableElement(r) && t.datas.inputTarget !== r) {
3532
+ var i = n.props.targets, o = i.indexOf(r), a = o > -1, s = !1;
3533
+ o === -1 && (s = (o = te(i, function(u) {
3534
+ return u.contains(r);
3535
+ })) > -1), rt(n, "onClickGroup", mt(n, t, { isDouble: t.isDouble, targets: i, inputTarget: r, targetIndex: o, isTarget: a, containsTarget: s, moveableTarget: i[o] }));
3536
+ }
3537
+ }, dragControlEnd: function(n, t) {
3538
+ this.dragEnd(n, t);
3539
+ }, dragGroupControlEnd: function(n, t) {
3540
+ this.dragEnd(n, t);
3541
+ } }), Ce("edgeDraggable", { css: [`.edge.edgeDraggable.line {
3542
+ cursor: move;
3543
+ }`], render: function(n, t) {
3544
+ var e = n.props, r = e.edgeDraggable;
3545
+ return r ? _o(t, "edgeDraggable", r, n.getState().renderPoses, e.zoom) : [];
3546
+ }, dragCondition: function(n, t) {
3547
+ var e, r = n.props, i = (e = t.inputEvent) === null || e === void 0 ? void 0 : e.target;
3548
+ return !(!r.edgeDraggable || !i) && !r.draggable && xn(i, xt("direction")) && xn(i, xt("edge")) && xn(i, xt("edgeDraggable"));
3549
+ }, dragStart: function(n, t) {
3550
+ return bn.dragStart(n, Wn(t));
3551
+ }, drag: function(n, t) {
3552
+ return bn.drag(n, Wn(t));
3553
+ }, dragEnd: function(n, t) {
3554
+ return bn.dragEnd(n, Wn(t));
3555
+ }, dragGroupCondition: function(n, t) {
3556
+ var e, r = n.props, i = (e = t.inputEvent) === null || e === void 0 ? void 0 : e.target;
3557
+ return !(!r.edgeDraggable || !i) && !r.draggable && xn(i, xt("direction")) && xn(i, xt("line"));
3558
+ }, dragGroupStart: function(n, t) {
3559
+ return bn.dragGroupStart(n, Wn(t));
3560
+ }, dragGroup: function(n, t) {
3561
+ return bn.dragGroup(n, Wn(t));
3562
+ }, dragGroupEnd: function(n, t) {
3563
+ return bn.dragGroupEnd(n, Wn(t));
3564
+ }, unset: function(n) {
3565
+ return bn.unset(n);
3566
+ } });
3567
+ var Ss = { name: "individualGroupable", props: ["individualGroupable", "individualGroupableProps"], events: [] };
3568
+ function Zi(n, t) {
3569
+ var e = O(n, 3), r = e[0], i = e[1], o = e[2];
3570
+ return (r * t[0] + i * t[1] + o) / Math.sqrt(r * r + i * i);
3571
+ }
3572
+ function je(n, t) {
3573
+ var e = O(n, 2), r = e[0], i = e[1];
3574
+ return -r * t[0] - i * t[1];
3575
+ }
3576
+ function Ki(n, t) {
3577
+ return Math.max.apply(Math, q([], O(n.map(function(e) {
3578
+ var r = O(e, 4), i = r[0], o = r[1], a = r[2], s = r[3];
3579
+ return Math.max(i[t], o[t], a[t], s[t]);
3580
+ })), !1));
3581
+ }
3582
+ function Ui(n, t) {
3583
+ return Math.min.apply(Math, q([], O(n.map(function(e) {
3584
+ var r = O(e, 4), i = r[0], o = r[1], a = r[2], s = r[3];
3585
+ return Math.min(i[t], o[t], a[t], s[t]);
3586
+ })), !1));
3587
+ }
3588
+ function $o(n, t) {
3589
+ var e = t.map(function(r) {
3590
+ if (Ht(r)) {
3591
+ var i = $o(n, r), o = i.length;
3592
+ return o > 1 ? i : o === 1 ? i[0] : null;
3593
+ }
3594
+ var a = un(n, function(s) {
3595
+ return s.manager.props.target === r;
3596
+ });
3597
+ return a ? (a.finded = !0, a.manager) : null;
3598
+ }).filter(Boolean);
3599
+ return e.length === 1 && Ht(e[0]) ? e[0] : e;
3600
+ }
3601
+ var ws = function(n) {
3602
+ function t() {
3603
+ var e = n !== null && n.apply(this, arguments) || this;
3604
+ return e.differ = new ho(), e.moveables = [], e.transformOrigin = "50% 50%", e.renderGroupRects = [], e._targetGroups = [], e._hasFirstTargets = !1, e;
3605
+ }
3606
+ return Re(t, n), t.prototype.componentDidMount = function() {
3607
+ n.prototype.componentDidMount.call(this);
3608
+ }, t.prototype.checkUpdate = function() {
3609
+ this._isPropTargetChanged = !1, this.updateAbles();
3610
+ }, t.prototype.getTargets = function() {
3611
+ return this.props.targets;
3612
+ }, t.prototype.updateRect = function(e, r, i) {
3613
+ var o;
3614
+ i === void 0 && (i = !0);
3615
+ var a = this.state;
3616
+ if (this.controlBox && !a.isPersisted) {
3617
+ ee(!0), this.moveables.forEach(function(H) {
3618
+ H.updateRect(e, !1, !1);
3619
+ });
3620
+ var s = this.props, u = this.moveables, c = a.target || s.target, p = u.map(function(H) {
3621
+ return { finded: !1, manager: H };
3622
+ }), f = this.props.targetGroups || [], l = $o(p, f), d = s.useDefaultGroupRotate;
3623
+ l.push.apply(l, q([], O(p.filter(function(H) {
3624
+ return !H.finded;
3625
+ }).map(function(H) {
3626
+ return H.manager;
3627
+ })), !1));
3628
+ var h = [], g = !r || e !== "" && s.updateGroup, v = s.defaultGroupRotate || 0;
3629
+ if (!this._hasFirstTargets) {
3630
+ var m = (o = s.persistData) === null || o === void 0 ? void 0 : o.rotation;
3631
+ m != null && (v = m);
3632
+ }
3633
+ var x = function H(L, Q, pt) {
3634
+ var Y = L.map(function($) {
3635
+ if (Ht($)) {
3636
+ var it = H($, Q), lt = [it.pos1, it.pos2, it.pos3, it.pos4];
3637
+ return h.push(it), { poses: lt, rotation: it.rotation };
3638
+ }
3639
+ return { poses: Rn($.state), rotation: $.getRotation() };
3640
+ }), j = Y.map(function($) {
3641
+ return $.rotation;
3642
+ }), J = 0, W = j[0], ht = j.every(function($) {
3643
+ return Math.abs(W - $) < 0.1;
3644
+ });
3645
+ J = g ? !d && ht ? W : v : d || pt || !ht ? Q : W;
3646
+ var Pt = Y.map(function($) {
3647
+ return $.poses;
3648
+ }), zt = function($, it) {
3649
+ var lt, st, dt, wt = [0, 0], ot = [0, 0], gt = [0, 0], ut = [0, 0], At = 0, qt = 0;
3650
+ if (!$.length) return { pos1: wt, pos2: ot, pos3: gt, pos4: ut, minX: 0, minY: 0, maxX: 0, maxY: 0, width: At, height: qt, rotation: it };
3651
+ var K = ft(it, tn);
3652
+ if (K % 90) {
3653
+ var tt = K / 180 * Math.PI, yt = Math.tan(tt), Mt = -1 / yt, at = [Br, Ri], vt = [[0, 0], [0, 0]], ct = [Br, Ri], Dt = [[0, 0], [0, 0]];
3654
+ $.forEach(function(Jt) {
3655
+ Jt.forEach(function(Bt) {
3656
+ var mn = Zi([-yt, 1, 0], Bt), pn = Zi([-Mt, 1, 0], Bt);
3657
+ at[0] > mn && (vt[0] = Bt, at[0] = mn), at[1] < mn && (vt[1] = Bt, at[1] = mn), ct[0] > pn && (Dt[0] = Bt, ct[0] = pn), ct[1] < pn && (Dt[1] = Bt, ct[1] = pn);
3658
+ });
3659
+ });
3660
+ var kt = O(vt, 2), cn = kt[0], ln = kt[1], en = O(Dt, 2), Et = en[0], Rt = en[1], Yt = [-yt, 1, je([-yt, 1], cn)], rn = [-yt, 1, je([-yt, 1], ln)], Lt = [-Mt, 1, je([-Mt, 1], Et)], vn = [-Mt, 1, je([-Mt, 1], Rt)];
3661
+ lt = O([[Yt, Lt], [Yt, vn], [rn, Lt], [rn, vn]].map(function(Jt) {
3662
+ var Bt = O(Jt, 2);
3663
+ return $r(Bt[0], Bt[1])[0];
3664
+ }), 4), wt = lt[0], ot = lt[1], gt = lt[2], ut = lt[3], At = ct[1] - ct[0], qt = at[1] - at[0];
3665
+ } else {
3666
+ var jt = Ui($, 0), Vt = Ui($, 1), fn = Ki($, 0), Zt = Ki($, 1);
3667
+ wt = [jt, Vt], ot = [fn, Vt], gt = [jt, Zt], ut = [fn, Zt], At = fn - jt, qt = Zt - Vt, K % 180 && (wt = (st = O([gt, wt, ut, ot], 4))[0], ot = st[1], gt = st[2], ut = st[3], At = Zt - Vt, qt = fn - jt);
3668
+ }
3669
+ K % 360 > 180 && (wt = (dt = O([ut, gt, ot, wt], 4))[0], ot = dt[1], gt = dt[2], ut = dt[3]);
3670
+ var Xt = Un([wt, ot, gt, ut]);
3671
+ return { pos1: wt, pos2: ot, pos3: gt, pos4: ut, width: At, height: qt, minX: Xt.minX, minY: Xt.minY, maxX: Xt.maxX, maxY: Xt.maxY, rotation: it };
3672
+ }(Pt, J);
3673
+ return zt;
3674
+ }(l, this.rotation, !0);
3675
+ g && (this.rotation = x.rotation, this.transformOrigin = s.defaultGroupOrigin || "50% 50%", this.scale = [1, 1]), this._targetGroups = f, this.renderGroupRects = h;
3676
+ var y = this.transformOrigin, E = this.rotation, S = this.scale, b = x.width, w = x.height, _ = x.minX, D = x.minY, P = Un(ps([[0, 0], [b, 0], [0, w], [b, w]], Ho(y, b, w), this.rotation / 180 * Math.PI).result), M = P.minX, T = P.minY, R = " rotate(".concat(E, "deg)") + " scale(".concat(Qn(S[0]), ", ").concat(Qn(S[1]), ")"), F = "translate(".concat(-M, "px, ").concat(-T, "px)").concat(R);
3677
+ this.controlBox.style.transform = "translate3d(".concat(_, "px, ").concat(D, "px, ").concat(this.props.translateZ || 0, ")"), c.style.cssText += "left:0px;top:0px;" + "transform-origin:".concat(y, ";") + "width:".concat(b, "px;height:").concat(w, "px;") + "transform: ".concat(F), a.width = b, a.height = w;
3678
+ var z = this.getContainer(), B = Wr(this.controlBox, c, this.controlBox, this.getContainer(), this._rootContainer || z, []), G = [B.left, B.top], k = O(Rn(B), 4), I = k[0], V = k[1], Z = k[2], et = k[3], U = Un([I, V, Z, et]), X = [U.minX, U.minY], N = Qn(S[0] * S[1]);
3679
+ B.pos1 = nt(I, X), B.pos2 = nt(V, X), B.pos3 = nt(Z, X), B.pos4 = nt(et, X), B.left = _ - B.left + X[0], B.top = D - B.top + X[1], B.origin = nt(St(G, B.origin), X), B.beforeOrigin = nt(St(G, B.beforeOrigin), X), B.originalBeforeOrigin = St(G, B.originalBeforeOrigin), B.transformOrigin = nt(St(G, B.transformOrigin), X), c.style.transform = "translate(".concat(-M - X[0], "px, ").concat(-T - X[1], "px)") + R, ee(), this.updateState(C(C({}, B), { posDelta: X, direction: N, beforeDirection: N }), i);
3680
+ }
3681
+ }, t.prototype.getRect = function() {
3682
+ return C(C({}, n.prototype.getRect.call(this)), { children: this.moveables.map(function(e) {
3683
+ return e.getRect();
3684
+ }) });
3685
+ }, t.prototype.triggerEvent = function(e, r, i) {
3686
+ if (i || e.indexOf("Group") > -1) return n.prototype.triggerEvent.call(this, e, r);
3687
+ this._emitter.trigger(e, r);
3688
+ }, t.prototype.getRequestChildStyles = function() {
3689
+ return this.getEnabledAbles().reduce(function(e, r) {
3690
+ var i, o, a = (o = (i = r.requestChildStyle) === null || i === void 0 ? void 0 : i.call(r)) !== null && o !== void 0 ? o : [];
3691
+ return q(q([], O(e), !1), O(a), !1);
3692
+ }, []);
3693
+ }, t.prototype.getMoveables = function() {
3694
+ return q([], O(this.moveables), !1);
3695
+ }, t.prototype.updateAbles = function() {
3696
+ n.prototype.updateAbles.call(this, q(q([], O(this.props.ables), !1), [Uo], !1), "Group");
3697
+ }, t.prototype._updateTargets = function() {
3698
+ n.prototype._updateTargets.call(this), this._originalDragTarget = this.props.dragTarget || this.areaElement, this._dragTarget = Jn(this._originalDragTarget, !0);
3699
+ }, t.prototype._updateEvents = function() {
3700
+ var e = this.state, r = this.props, i = this._prevDragTarget, o = r.dragTarget || this.areaElement, a = r.targets, s = this.differ.update(a), u = s.added, c = s.changed, p = s.removed, f = u.length || p.length;
3701
+ (f || this._prevOriginalDragTarget !== this._originalDragTarget) && (Vn(this, !1), Vn(this, !0), this.updateState({ gestos: {} })), i !== o && (e.target = null), e.target || (e.target = this.areaElement, this.controlBox.style.display = "block"), e.target && (this.targetGesto || (this.targetGesto = Vo(this, this._dragTarget, "Group")), this.controlGesto || (this.controlGesto = Zo(this, "GroupControl")));
3702
+ var l = !Yr(e.container, r.container);
3703
+ l && (e.container = r.container), (l || f || this.transformOrigin !== (r.defaultGroupOrigin || "50% 50%") || c.length || a.length && !qo(this._targetGroups, r.targetGroups || [])) && (this.updateRect(), this._hasFirstTargets = !0), this._isPropTargetChanged = !!f;
3704
+ }, t.prototype._updateObserver = function() {
3705
+ }, t.defaultProps = C(C({}, ie.defaultProps), { transformOrigin: ["50%", "50%"], groupable: !0, dragArea: !0, keepRatio: !0, targets: [], defaultGroupRotate: 0, defaultGroupOrigin: "50% 50%" }), t;
3706
+ }(ie), Ms = function(n) {
3707
+ function t() {
3708
+ var e = n !== null && n.apply(this, arguments) || this;
3709
+ return e.moveables = [], e;
3710
+ }
3711
+ return Re(t, n), t.prototype.render = function() {
3712
+ var e, r = this, i = this.props, o = i.cspNonce, a = i.cssStyled, s = i.persistData, u = i.targets || [], c = u.length, p = this.isUnmounted || !c, f = (e = s?.children) !== null && e !== void 0 ? e : [];
3713
+ return p && !c && f.length ? u = f.map(function() {
3714
+ return null;
3715
+ }) : p || (f = []), On.createElement(a, { cspNonce: o, ref: An(this, "controlBox"), className: xt("control-box") }, u.map(function(l, d) {
3716
+ var h, g, v = (g = (h = i.individualGroupableProps) === null || h === void 0 ? void 0 : h.call(i, l, d)) !== null && g !== void 0 ? g : {};
3717
+ return On.createElement(ie, C({ key: "moveable" + d, ref: no(r, "moveables", d) }, i, v, { target: l, wrapperMoveable: r, isWrapperMounted: r.isMoveableMounted, persistData: f[d] }));
3718
+ }));
3719
+ }, t.prototype.componentDidMount = function() {
3720
+ }, t.prototype.componentDidUpdate = function() {
3721
+ }, t.prototype.getTargets = function() {
3722
+ return this.props.targets;
3723
+ }, t.prototype.updateRect = function(e, r, i) {
3724
+ i === void 0 && (i = !0), ee(!0), this.moveables.forEach(function(o) {
3725
+ o.updateRect(e, r, i);
3726
+ }), ee();
3727
+ }, t.prototype.getRect = function() {
3728
+ return C(C({}, n.prototype.getRect.call(this)), { children: this.moveables.map(function(e) {
3729
+ return e.getRect();
3730
+ }) });
3731
+ }, t.prototype.request = function(e, r, i) {
3732
+ r === void 0 && (r = {});
3733
+ var o = this.moveables.map(function(s) {
3734
+ return s.request(e, C(C({}, r), { isInstant: !1 }), !1);
3735
+ }), a = { request: function(s) {
3736
+ return o.forEach(function(u) {
3737
+ return u.request(s);
3738
+ }), this;
3739
+ }, requestEnd: function() {
3740
+ return o.forEach(function(s) {
3741
+ return s.requestEnd();
3742
+ }), this;
3743
+ } };
3744
+ return i || r.isInstant ? a.request(r).requestEnd() : a;
3745
+ }, t.prototype.dragStart = function(e, r) {
3746
+ r === void 0 && (r = e.target);
3747
+ var i = r, o = un(this.moveables, function(a) {
3748
+ var s = a.getTargets()[0], u = a.getControlBoxElement(), c = a.getDragElement();
3749
+ return !(!s || !c) && (c === i || c.contains(i) || c !== s && s === i || s.contains(i) || u === i || u.contains(i));
3750
+ });
3751
+ return o && o.dragStart(e, r), this;
3752
+ }, t.prototype.hitTest = function() {
3753
+ return 0;
3754
+ }, t.prototype.isInside = function() {
3755
+ return !1;
3756
+ }, t.prototype.isDragging = function() {
3757
+ return !1;
3758
+ }, t.prototype.getDragElement = function() {
3759
+ return null;
3760
+ }, t.prototype.getMoveables = function() {
3761
+ return q([], O(this.moveables), !1);
3762
+ }, t.prototype.updateRenderPoses = function() {
3763
+ }, t.prototype.checkUpdate = function() {
3764
+ }, t.prototype.triggerEvent = function() {
3765
+ }, t.prototype.updateAbles = function() {
3766
+ }, t.prototype._updateEvents = function() {
3767
+ }, t.prototype._updateObserver = function() {
3768
+ }, t;
3769
+ }(ie);
3770
+ function Jo(n, t) {
3771
+ var e = [];
3772
+ return n.forEach(function(r) {
3773
+ r && (oe(r) ? t[r] && e.push.apply(e, q([], O(t[r]), !1)) : Ht(r) ? e.push.apply(e, q([], O(Jo(r, t)), !1)) : e.push(r));
3774
+ }), e;
3775
+ }
3776
+ function Qo(n, t) {
3777
+ var e = [];
3778
+ return n.forEach(function(r) {
3779
+ r && (oe(r) ? t[r] && e.push.apply(e, q([], O(t[r]), !1)) : Ht(r) ? e.push(Qo(r, t)) : e.push(r));
3780
+ }), e;
3781
+ }
3782
+ function ta(n, t) {
3783
+ return n.length !== t.length || n.some(function(e, r) {
3784
+ var i = t[r];
3785
+ return !(!e && !i) && e != i && (!Ht(e) || !Ht(i) || ta(e, i));
3786
+ });
3787
+ }
3788
+ var Ds = function(n) {
3789
+ function t() {
3790
+ var i = n !== null && n.apply(this, arguments) || this;
3791
+ return i.refTargets = [], i.selectorMap = {}, i._differ = new ho(), i._elementTargets = [], i._tmpRefTargets = [], i._tmpSelectorMap = {}, i._onChangeTargets = null, i;
3792
+ }
3793
+ var e, r;
3794
+ return Re(t, n), t.makeStyled = function() {
3795
+ var i = {};
3796
+ this.getTotalAbles().forEach(function(a) {
3797
+ var s = a.css;
3798
+ s && s.forEach(function(u) {
3799
+ i[u] = !0;
3800
+ });
3801
+ });
3802
+ var o = De(i).join(`
3803
+ `);
3804
+ this.defaultStyled = mo("div", function(a, s) {
3805
+ return s.replace(/([^}{]*){/gm, function(u, c) {
3806
+ return c.replace(/\.([^{,\s\d.]+)/g, "." + a + "$1") + "{";
3807
+ });
3808
+ }(Qr, qa + o));
3809
+ }, t.getTotalAbles = function() {
3810
+ return q([vs, Uo, Ss, gs], O(this.defaultAbles), !1);
3811
+ }, t.prototype.render = function() {
3812
+ var i, o = this.constructor;
3813
+ o.defaultStyled || o.makeStyled();
3814
+ var a = this.props, s = a.ables, u = a.props, c = function(_, D) {
3815
+ var P = {};
3816
+ for (var M in _) Object.prototype.hasOwnProperty.call(_, M) && D.indexOf(M) < 0 && (P[M] = _[M]);
3817
+ if (_ != null && typeof Object.getOwnPropertySymbols == "function") {
3818
+ var T = 0;
3819
+ for (M = Object.getOwnPropertySymbols(_); T < M.length; T++) D.indexOf(M[T]) < 0 && Object.prototype.propertyIsEnumerable.call(_, M[T]) && (P[M[T]] = _[M[T]]);
3820
+ }
3821
+ return P;
3822
+ }(a, ["ables", "props"]), p = O(this._updateRefs(!0), 2), f = p[0], l = p[1], d = Jo(f, l), h = d.length > 1, g = q(q([], O(o.getTotalAbles()), !1), O(s || []), !1), v = C(C(C({}, c), u || {}), { ables: g, cssStyled: o.defaultStyled, customStyledMap: o.customStyledMap });
3823
+ this._elementTargets = d;
3824
+ var m = null, x = this.moveable, y = c.persistData;
3825
+ if (y?.children && (h = !0), c.individualGroupable) return On.createElement(Ms, C({ key: "individual-group", ref: An(this, "moveable") }, v, { target: null, targets: d }));
3826
+ if (h) {
3827
+ var E = Qo(f, l);
3828
+ if (x && !x.props.groupable && !x.props.individualGroupable) {
3829
+ var S = x.props.target;
3830
+ S && d.indexOf(S) > -1 && (m = C({}, x.state));
3831
+ }
3832
+ return On.createElement(ws, C({ key: "group", ref: An(this, "moveable") }, v, (i = c.groupableProps) !== null && i !== void 0 ? i : {}, { target: null, targets: d, targetGroups: E, firstRenderState: m }));
3833
+ }
3834
+ var b = d[0];
3835
+ if (x && (x.props.groupable || x.props.individualGroupable)) {
3836
+ var w = un(x.moveables || [], function(_) {
3837
+ return _.props.target === b;
3838
+ });
3839
+ w && (m = C({}, w.state));
3840
+ }
3841
+ return On.createElement(ie, C({ key: "single", ref: An(this, "moveable") }, v, { target: b, firstRenderState: m }));
3842
+ }, t.prototype.componentDidMount = function() {
3843
+ this._checkChangeTargets();
3844
+ }, t.prototype.componentDidUpdate = function() {
3845
+ this._checkChangeTargets();
3846
+ }, t.prototype.componentWillUnmount = function() {
3847
+ this.selectorMap = {}, this.refTargets = [];
3848
+ }, t.prototype.getTargets = function() {
3849
+ var i, o;
3850
+ return (o = (i = this.moveable) === null || i === void 0 ? void 0 : i.getTargets()) !== null && o !== void 0 ? o : [];
3851
+ }, t.prototype.updateSelectors = function() {
3852
+ this.selectorMap = {}, this._updateRefs(), this.forceUpdate();
3853
+ }, t.prototype.waitToChangeTarget = function() {
3854
+ var i, o = this;
3855
+ return this._onChangeTargets = function() {
3856
+ o._onChangeTargets = null, i();
3857
+ }, new Promise(function(a) {
3858
+ i = a;
3859
+ });
3860
+ }, t.prototype.waitToChangeTargets = function() {
3861
+ return this.waitToChangeTarget();
3862
+ }, t.prototype.getManager = function() {
3863
+ return this.moveable;
3864
+ }, t.prototype.getMoveables = function() {
3865
+ return this.moveable.getMoveables();
3866
+ }, t.prototype.getDragElement = function() {
3867
+ return this.moveable.getDragElement();
3868
+ }, t.prototype._updateRefs = function(i) {
3869
+ var o = this.refTargets, a = Wo(this.props.target || this.props.targets), s = typeof document < "u", u = ta(o, a), c = this.selectorMap, p = {};
3870
+ return this.refTargets.forEach(function f(l) {
3871
+ oe(l) ? c[l] ? p[l] = c[l] : s && (u = !0, p[l] = [].slice.call(document.querySelectorAll(l))) : Ht(l) && l.forEach(f);
3872
+ }), this._tmpRefTargets = a, this._tmpSelectorMap = p, [a, p, !i && u];
3873
+ }, t.prototype._checkChangeTargets = function() {
3874
+ var i, o, a;
3875
+ this.refTargets = this._tmpRefTargets, this.selectorMap = this._tmpSelectorMap;
3876
+ var s = this._differ.update(this._elementTargets), u = s.added, c = s.removed;
3877
+ (u.length || c.length) && ((o = (i = this.props).onChangeTargets) === null || o === void 0 || o.call(i, { moveable: this.moveable, targets: this._elementTargets }), (a = this._onChangeTargets) === null || a === void 0 || a.call(this));
3878
+ var p = O(this._updateRefs(), 3), f = p[0], l = p[1], d = p[2];
3879
+ this.refTargets = f, this.selectorMap = l, d && this.forceUpdate();
3880
+ }, t.defaultAbles = [], t.customStyledMap = {}, t.defaultStyled = null, function(i, o, a, s) {
3881
+ var u, c = arguments.length, p = c < 3 ? o : s;
3882
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") p = Reflect.decorate(i, o, a, s);
3883
+ else for (var f = i.length - 1; f >= 0; f--) (u = i[f]) && (p = (c < 3 ? u(p) : c > 3 ? u(o, a, p) : u(o, a)) || p);
3884
+ c > 3 && p && Object.defineProperty(o, a, p);
3885
+ }([(e = La, r === void 0 && (r = {}), function(i, o) {
3886
+ e.forEach(function(a) {
3887
+ var s = r[a] || a;
3888
+ s in i || (i[s] = function() {
3889
+ for (var u, c = [], p = 0; p < arguments.length; p++) c[p] = arguments[p];
3890
+ var f = (u = this[o])[a].apply(u, c);
3891
+ return f === this[o] ? this : f;
3892
+ });
3893
+ });
3894
+ })], t.prototype, "moveable", void 0), t;
3895
+ }(On.PureComponent);
3896
+ const _s = ($i = [bn, is], xr = function(n) {
3897
+ function t() {
3898
+ return n !== null && n.apply(this, arguments) || this;
3899
+ }
3900
+ return Re(t, n), t;
3901
+ }(Ds), xr.defaultAbles = $i, xr);
3902
+ var $i, xr;
3903
+ export {
3904
+ _s as default
3905
+ };