@blockbite/libraries 0.11.4

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,2632 @@
1
+ function lr() {
2
+ return lr = Object.assign ? Object.assign.bind() : function(e) {
3
+ for (var t = 1; t < arguments.length; t++) {
4
+ var n = arguments[t];
5
+ for (var s in n) ({}).hasOwnProperty.call(n, s) && (e[s] = n[s]);
6
+ }
7
+ return e;
8
+ }, lr.apply(null, arguments);
9
+ }
10
+ var Wt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
11
+ function ur(e) {
12
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
13
+ }
14
+ var xr, Er = {
15
+ exports: {}
16
+ };
17
+ /*!
18
+ Copyright (c) 2018 Jed Watson.
19
+ Licensed under the MIT License (MIT), see
20
+ http://jedwatson.github.io/classnames
21
+ */
22
+ var wr, Ir, Cr, on = (xr || (xr = 1, wr = Er, (function() {
23
+ var e = {}.hasOwnProperty;
24
+ function t() {
25
+ for (var n = [], s = 0; s < arguments.length; s++) {
26
+ var f = arguments[s];
27
+ if (f) {
28
+ var _ = typeof f;
29
+ if (_ === "string" || _ === "number") n.push(f);
30
+ else if (Array.isArray(f)) {
31
+ if (f.length) {
32
+ var E = t.apply(null, f);
33
+ E && n.push(E);
34
+ }
35
+ } else if (_ === "object") if (f.toString === Object.prototype.toString) for (var g in f) e.call(f, g) && f[g] && n.push(g);
36
+ else n.push(f.toString());
37
+ }
38
+ }
39
+ return n.join(" ");
40
+ }
41
+ wr.exports ? (t.default = t, wr.exports = t) : window.classNames = t;
42
+ })()), Er.exports), Sr = ur(on), Pr, zt = ur((function() {
43
+ if (Cr) return Ir;
44
+ Cr = 1;
45
+ var e = /^\s+|\s+$/g, t = /^[-+]0x[0-9a-f]+$/i, n = /^0b[01]+$/i, s = /^0o[0-7]+$/i, f = parseInt, _ = Object.prototype.toString;
46
+ function E(i) {
47
+ var u = typeof i;
48
+ return !!i && (u == "object" || u == "function");
49
+ }
50
+ function g(i) {
51
+ if (typeof i == "number") return i;
52
+ if ((function(p) {
53
+ return typeof p == "symbol" || /* @__PURE__ */ (function(y) {
54
+ return !!y && typeof y == "object";
55
+ })(p) && _.call(p) == "[object Symbol]";
56
+ })(i)) return NaN;
57
+ if (E(i)) {
58
+ var u = typeof i.valueOf == "function" ? i.valueOf() : i;
59
+ i = E(u) ? u + "" : u;
60
+ }
61
+ if (typeof i != "string") return i === 0 ? i : +i;
62
+ i = i.replace(e, "");
63
+ var d = n.test(i);
64
+ return d || s.test(i) ? f(i.slice(2), d ? 2 : 8) : t.test(i) ? NaN : +i;
65
+ }
66
+ return Ir = function(i, u, d) {
67
+ return d === void 0 && (d = u, u = void 0), d !== void 0 && (d = (d = g(d)) == d ? d : 0), u !== void 0 && (u = (u = g(u)) == u ? u : 0), (function(p, y, R) {
68
+ return p == p && (R !== void 0 && (p = p <= R ? p : R), y !== void 0 && (p = p >= y ? p : y)), p;
69
+ })(g(i), u, d);
70
+ };
71
+ })()), mr = {
72
+ exports: {}
73
+ }, an = (Pr || (Pr = 1, (function(e, t) {
74
+ var n = "__lodash_hash_undefined__", s = 9007199254740991, f = "[object Arguments]", _ = "[object Array]", E = "[object Boolean]", g = "[object Date]", i = "[object Error]", u = "[object Function]", d = "[object Map]", p = "[object Number]", y = "[object Object]", R = "[object Promise]", b = "[object RegExp]", j = "[object Set]", N = "[object String]", S = "[object Symbol]", P = "[object WeakMap]", l = "[object ArrayBuffer]", M = "[object DataView]", K = /^\[object .+?Constructor\]$/, ue = /^(?:0|[1-9]\d*)$/, w = {};
75
+ w["[object Float32Array]"] = w["[object Float64Array]"] = w["[object Int8Array]"] = w["[object Int16Array]"] = w["[object Int32Array]"] = w["[object Uint8Array]"] = w["[object Uint8ClampedArray]"] = w["[object Uint16Array]"] = w["[object Uint32Array]"] = !0, w[f] = w[_] = w[l] = w[E] = w[M] = w[g] = w[i] = w[u] = w[d] = w[p] = w[y] = w[b] = w[j] = w[N] = w[P] = !1;
76
+ var Z = typeof Wt == "object" && Wt && Wt.Object === Object && Wt, Me = typeof self == "object" && self && self.Object === Object && self, ie = Z || Me || Function("return this")(), Ye = t && !t.nodeType && t, I = Ye && e && !e.nodeType && e, W = I && I.exports === Ye, ne = W && Z.process, X = (function() {
77
+ try {
78
+ return ne && ne.binding && ne.binding("util");
79
+ } catch {
80
+ }
81
+ })(), q = X && X.isTypedArray;
82
+ function ee(r, a) {
83
+ for (var v = -1, C = r == null ? 0 : r.length; ++v < C; ) if (a(r[v], v, r)) return !0;
84
+ return !1;
85
+ }
86
+ function fe(r) {
87
+ var a = -1, v = Array(r.size);
88
+ return r.forEach(function(C, te) {
89
+ v[++a] = [te, C];
90
+ }), v;
91
+ }
92
+ function We(r) {
93
+ var a = -1, v = Array(r.size);
94
+ return r.forEach(function(C) {
95
+ v[++a] = C;
96
+ }), v;
97
+ }
98
+ var $e, ce, Ae, F = Array.prototype, Oe = Function.prototype, Xe = Object.prototype, et = ie["__core-js_shared__"], Se = Oe.toString, V = Xe.hasOwnProperty, A = ($e = /[^.]+$/.exec(et && et.keys && et.keys.IE_PROTO || "")) ? "Symbol(src)_1." + $e : "", se = Xe.toString, Q = RegExp("^" + Se.call(V).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), Dt = W ? ie.Buffer : void 0, De = ie.Symbol, he = ie.Uint8Array, Xt = Xe.propertyIsEnumerable, Ot = F.splice, dt = De ? De.toStringTag : void 0, pt = Object.getOwnPropertySymbols, nr = Dt ? Dt.isBuffer : void 0, kt = (ce = Object.keys, Ae = Object, function(r) {
99
+ return ce(Ae(r));
100
+ }), Ge = Ve(ie, "DataView"), rt = Ve(ie, "Map"), Vt = Ve(ie, "Promise"), Ut = Ve(ie, "Set"), ae = Ve(ie, "WeakMap"), Ke = Ve(Object, "create"), St = Pe(Ge), ve = Pe(rt), Re = Pe(Vt), Tt = Pe(Ut), It = Pe(ae), Rt = De ? De.prototype : void 0, ft = Rt ? Rt.valueOf : void 0;
101
+ function Ne(r) {
102
+ var a = -1, v = r == null ? 0 : r.length;
103
+ for (this.clear(); ++a < v; ) {
104
+ var C = r[a];
105
+ this.set(C[0], C[1]);
106
+ }
107
+ }
108
+ function Ce(r) {
109
+ var a = -1, v = r == null ? 0 : r.length;
110
+ for (this.clear(); ++a < v; ) {
111
+ var C = r[a];
112
+ this.set(C[0], C[1]);
113
+ }
114
+ }
115
+ function nt(r) {
116
+ var a = -1, v = r == null ? 0 : r.length;
117
+ for (this.clear(); ++a < v; ) {
118
+ var C = r[a];
119
+ this.set(C[0], C[1]);
120
+ }
121
+ }
122
+ function ht(r) {
123
+ var a = -1, v = r == null ? 0 : r.length;
124
+ for (this.__data__ = new nt(); ++a < v; ) this.add(r[a]);
125
+ }
126
+ function Le(r) {
127
+ var a = this.__data__ = new Ce(r);
128
+ this.size = a.size;
129
+ }
130
+ function Ct(r, a) {
131
+ var v = jt(r), C = !v && Zt(r), te = !v && !C && At(r), B = !v && !C && !te && Ft(r), le = v || C || te || B, we = le ? (function(me, Fe) {
132
+ for (var Te = -1, be = Array(me); ++Te < me; ) be[Te] = Fe(Te);
133
+ return be;
134
+ })(r.length, String) : [], Be = we.length;
135
+ for (var re in r) !V.call(r, re) || le && (re == "length" || te && (re == "offset" || re == "parent") || B && (re == "buffer" || re == "byteLength" || re == "byteOffset") || Jt(re, Be)) || we.push(re);
136
+ return we;
137
+ }
138
+ function wt(r, a) {
139
+ for (var v = r.length; v--; ) if (gt(r[v][0], a)) return v;
140
+ return -1;
141
+ }
142
+ function ke(r) {
143
+ return r == null ? r === void 0 ? "[object Undefined]" : "[object Null]" : dt && dt in Object(r) ? (function(a) {
144
+ var v = V.call(a, dt), C = a[dt];
145
+ try {
146
+ a[dt] = void 0;
147
+ var te = !0;
148
+ } catch {
149
+ }
150
+ var B = se.call(a);
151
+ return te && (v ? a[dt] = C : delete a[dt]), B;
152
+ })(r) : (function(a) {
153
+ return se.call(a);
154
+ })(r);
155
+ }
156
+ function Ht(r) {
157
+ return yt(r) && ke(r) == f;
158
+ }
159
+ function Qe(r, a, v, C, te) {
160
+ return r === a || (r == null || a == null || !yt(r) && !yt(a) ? r != r && a != a : (function(B, le, we, Be, re, me) {
161
+ var Fe = jt(B), Te = jt(le), be = Fe ? _ : Ue(B), ze = Te ? _ : Ue(le), _t = (be = be == f ? y : be) == y, bt = (ze = ze == f ? y : ze) == y, c = be == ze;
162
+ if (c && At(B)) {
163
+ if (!At(le)) return !1;
164
+ Fe = !0, _t = !1;
165
+ }
166
+ if (c && !_t) return me || (me = new Le()), Fe || Ft(B) ? $t(B, le, we, Be, re, me) : (function(U, T, _e, de, je, oe, xe) {
167
+ switch (_e) {
168
+ case M:
169
+ if (U.byteLength != T.byteLength || U.byteOffset != T.byteOffset) return !1;
170
+ U = U.buffer, T = T.buffer;
171
+ case l:
172
+ return !(U.byteLength != T.byteLength || !oe(new he(U), new he(T)));
173
+ case E:
174
+ case g:
175
+ case p:
176
+ return gt(+U, +T);
177
+ case i:
178
+ return U.name == T.name && U.message == T.message;
179
+ case b:
180
+ case N:
181
+ return U == T + "";
182
+ case d:
183
+ var xt = fe;
184
+ case j:
185
+ var at = 1 & de;
186
+ if (xt || (xt = We), U.size != T.size && !at) return !1;
187
+ var Et = xe.get(U);
188
+ if (Et) return Et == T;
189
+ de |= 2, xe.set(U, T);
190
+ var ir = $t(xt(U), xt(T), de, je, oe, xe);
191
+ return xe.delete(U), ir;
192
+ case S:
193
+ if (ft) return ft.call(U) == ft.call(T);
194
+ }
195
+ return !1;
196
+ })(B, le, be, we, Be, re, me);
197
+ if (!(1 & we)) {
198
+ var O = _t && V.call(B, "__wrapped__"), He = bt && V.call(le, "__wrapped__");
199
+ if (O || He) {
200
+ var Je = O ? B.value() : B, ot = He ? le.value() : le;
201
+ return me || (me = new Le()), re(Je, ot, we, Be, me);
202
+ }
203
+ }
204
+ return !!c && (me || (me = new Le()), (function(U, T, _e, de, je, oe) {
205
+ var xe = 1 & _e, xt = mt(U), at = xt.length, Et = mt(T), ir = Et.length;
206
+ if (at != ir && !xe) return !1;
207
+ for (var Kt = at; Kt--; ) {
208
+ var Nt = xt[Kt];
209
+ if (!(xe ? Nt in T : V.call(T, Nt))) return !1;
210
+ }
211
+ var cr = oe.get(U);
212
+ if (cr && oe.get(T)) return cr == T;
213
+ var Qt = !0;
214
+ oe.set(U, T), oe.set(T, U);
215
+ for (var Yt = xe; ++Kt < at; ) {
216
+ var qt = U[Nt = xt[Kt]], Gt = T[Nt];
217
+ if (de) var sr = xe ? de(Gt, qt, Nt, T, U, oe) : de(qt, Gt, Nt, U, T, oe);
218
+ if (!(sr === void 0 ? qt === Gt || je(qt, Gt, _e, de, oe) : sr)) {
219
+ Qt = !1;
220
+ break;
221
+ }
222
+ Yt || (Yt = Nt == "constructor");
223
+ }
224
+ if (Qt && !Yt) {
225
+ var er = U.constructor, tr = T.constructor;
226
+ er == tr || !("constructor" in U) || !("constructor" in T) || typeof er == "function" && er instanceof er && typeof tr == "function" && tr instanceof tr || (Qt = !1);
227
+ }
228
+ return oe.delete(U), oe.delete(T), Qt;
229
+ })(B, le, we, Be, re, me));
230
+ })(r, a, v, C, Qe, te));
231
+ }
232
+ function ge(r) {
233
+ return !(!ye(r) || (function(a) {
234
+ return !!A && A in a;
235
+ })(r)) && (Bt(r) ? Q : K).test(Pe(r));
236
+ }
237
+ function Pt(r) {
238
+ if (v = (a = r) && a.constructor, C = typeof v == "function" && v.prototype || Xe, a !== C) return kt(r);
239
+ var a, v, C, te = [];
240
+ for (var B in Object(r)) V.call(r, B) && B != "constructor" && te.push(B);
241
+ return te;
242
+ }
243
+ function $t(r, a, v, C, te, B) {
244
+ var le = 1 & v, we = r.length, Be = a.length;
245
+ if (we != Be && !(le && Be > we)) return !1;
246
+ var re = B.get(r);
247
+ if (re && B.get(a)) return re == a;
248
+ var me = -1, Fe = !0, Te = 2 & v ? new ht() : void 0;
249
+ for (B.set(r, a), B.set(a, r); ++me < we; ) {
250
+ var be = r[me], ze = a[me];
251
+ if (C) var _t = le ? C(ze, be, me, a, r, B) : C(be, ze, me, r, a, B);
252
+ if (_t !== void 0) {
253
+ if (_t) continue;
254
+ Fe = !1;
255
+ break;
256
+ }
257
+ if (Te) {
258
+ if (!ee(a, function(bt, c) {
259
+ if (O = c, !Te.has(O) && (be === bt || te(be, bt, v, C, B))) return Te.push(c);
260
+ var O;
261
+ })) {
262
+ Fe = !1;
263
+ break;
264
+ }
265
+ } else if (be !== ze && !te(be, ze, v, C, B)) {
266
+ Fe = !1;
267
+ break;
268
+ }
269
+ }
270
+ return B.delete(r), B.delete(a), Fe;
271
+ }
272
+ function mt(r) {
273
+ return (function(a, v, C) {
274
+ var te = v(a);
275
+ return jt(a) ? te : (function(B, le) {
276
+ for (var we = -1, Be = le.length, re = B.length; ++we < Be; ) B[re + we] = le[we];
277
+ return B;
278
+ })(te, C(a));
279
+ })(r, Mt, vt);
280
+ }
281
+ function it(r, a) {
282
+ var v, C, te = r.__data__;
283
+ return ((C = typeof (v = a)) == "string" || C == "number" || C == "symbol" || C == "boolean" ? v !== "__proto__" : v === null) ? te[typeof a == "string" ? "string" : "hash"] : te.map;
284
+ }
285
+ function Ve(r, a) {
286
+ var v = (function(C, te) {
287
+ return C == null ? void 0 : C[te];
288
+ })(r, a);
289
+ return ge(v) ? v : void 0;
290
+ }
291
+ Ne.prototype.clear = function() {
292
+ this.__data__ = Ke ? Ke(null) : {}, this.size = 0;
293
+ }, Ne.prototype.delete = function(r) {
294
+ var a = this.has(r) && delete this.__data__[r];
295
+ return this.size -= a ? 1 : 0, a;
296
+ }, Ne.prototype.get = function(r) {
297
+ var a = this.__data__;
298
+ if (Ke) {
299
+ var v = a[r];
300
+ return v === n ? void 0 : v;
301
+ }
302
+ return V.call(a, r) ? a[r] : void 0;
303
+ }, Ne.prototype.has = function(r) {
304
+ var a = this.__data__;
305
+ return Ke ? a[r] !== void 0 : V.call(a, r);
306
+ }, Ne.prototype.set = function(r, a) {
307
+ var v = this.__data__;
308
+ return this.size += this.has(r) ? 0 : 1, v[r] = Ke && a === void 0 ? n : a, this;
309
+ }, Ce.prototype.clear = function() {
310
+ this.__data__ = [], this.size = 0;
311
+ }, Ce.prototype.delete = function(r) {
312
+ var a = this.__data__, v = wt(a, r);
313
+ return !(v < 0 || (v == a.length - 1 ? a.pop() : Ot.call(a, v, 1), --this.size, 0));
314
+ }, Ce.prototype.get = function(r) {
315
+ var a = this.__data__, v = wt(a, r);
316
+ return v < 0 ? void 0 : a[v][1];
317
+ }, Ce.prototype.has = function(r) {
318
+ return wt(this.__data__, r) > -1;
319
+ }, Ce.prototype.set = function(r, a) {
320
+ var v = this.__data__, C = wt(v, r);
321
+ return C < 0 ? (++this.size, v.push([r, a])) : v[C][1] = a, this;
322
+ }, nt.prototype.clear = function() {
323
+ this.size = 0, this.__data__ = {
324
+ hash: new Ne(),
325
+ map: new (rt || Ce)(),
326
+ string: new Ne()
327
+ };
328
+ }, nt.prototype.delete = function(r) {
329
+ var a = it(this, r).delete(r);
330
+ return this.size -= a ? 1 : 0, a;
331
+ }, nt.prototype.get = function(r) {
332
+ return it(this, r).get(r);
333
+ }, nt.prototype.has = function(r) {
334
+ return it(this, r).has(r);
335
+ }, nt.prototype.set = function(r, a) {
336
+ var v = it(this, r), C = v.size;
337
+ return v.set(r, a), this.size += v.size == C ? 0 : 1, this;
338
+ }, ht.prototype.add = ht.prototype.push = function(r) {
339
+ return this.__data__.set(r, n), this;
340
+ }, ht.prototype.has = function(r) {
341
+ return this.__data__.has(r);
342
+ }, Le.prototype.clear = function() {
343
+ this.__data__ = new Ce(), this.size = 0;
344
+ }, Le.prototype.delete = function(r) {
345
+ var a = this.__data__, v = a.delete(r);
346
+ return this.size = a.size, v;
347
+ }, Le.prototype.get = function(r) {
348
+ return this.__data__.get(r);
349
+ }, Le.prototype.has = function(r) {
350
+ return this.__data__.has(r);
351
+ }, Le.prototype.set = function(r, a) {
352
+ var v = this.__data__;
353
+ if (v instanceof Ce) {
354
+ var C = v.__data__;
355
+ if (!rt || C.length < 199) return C.push([r, a]), this.size = ++v.size, this;
356
+ v = this.__data__ = new nt(C);
357
+ }
358
+ return v.set(r, a), this.size = v.size, this;
359
+ };
360
+ var vt = pt ? function(r) {
361
+ return r == null ? [] : (r = Object(r), (function(a, v) {
362
+ for (var C = -1, te = a == null ? 0 : a.length, B = 0, le = []; ++C < te; ) {
363
+ var we = a[C];
364
+ v(we, C, a) && (le[B++] = we);
365
+ }
366
+ return le;
367
+ })(pt(r), function(a) {
368
+ return Xt.call(r, a);
369
+ }));
370
+ } : function() {
371
+ return [];
372
+ }, Ue = ke;
373
+ function Jt(r, a) {
374
+ return !!(a = a ?? s) && (typeof r == "number" || ue.test(r)) && r > -1 && r % 1 == 0 && r < a;
375
+ }
376
+ function Pe(r) {
377
+ if (r != null) {
378
+ try {
379
+ return Se.call(r);
380
+ } catch {
381
+ }
382
+ try {
383
+ return r + "";
384
+ } catch {
385
+ }
386
+ }
387
+ return "";
388
+ }
389
+ function gt(r, a) {
390
+ return r === a || r != r && a != a;
391
+ }
392
+ (Ge && Ue(new Ge(new ArrayBuffer(1))) != M || rt && Ue(new rt()) != d || Vt && Ue(Vt.resolve()) != R || Ut && Ue(new Ut()) != j || ae && Ue(new ae()) != P) && (Ue = function(r) {
393
+ var a = ke(r), v = a == y ? r.constructor : void 0, C = v ? Pe(v) : "";
394
+ if (C) switch (C) {
395
+ case St:
396
+ return M;
397
+ case ve:
398
+ return d;
399
+ case Re:
400
+ return R;
401
+ case Tt:
402
+ return j;
403
+ case It:
404
+ return P;
405
+ }
406
+ return a;
407
+ });
408
+ var Zt = Ht(/* @__PURE__ */ (function() {
409
+ return arguments;
410
+ })()) ? Ht : function(r) {
411
+ return yt(r) && V.call(r, "callee") && !Xt.call(r, "callee");
412
+ }, jt = Array.isArray, At = nr || function() {
413
+ return !1;
414
+ };
415
+ function Bt(r) {
416
+ if (!ye(r)) return !1;
417
+ var a = ke(r);
418
+ return a == u || a == "[object GeneratorFunction]" || a == "[object AsyncFunction]" || a == "[object Proxy]";
419
+ }
420
+ function st(r) {
421
+ return typeof r == "number" && r > -1 && r % 1 == 0 && r <= s;
422
+ }
423
+ function ye(r) {
424
+ var a = typeof r;
425
+ return r != null && (a == "object" || a == "function");
426
+ }
427
+ function yt(r) {
428
+ return r != null && typeof r == "object";
429
+ }
430
+ var Ft = q ? /* @__PURE__ */ (function(r) {
431
+ return function(a) {
432
+ return r(a);
433
+ };
434
+ })(q) : function(r) {
435
+ return yt(r) && st(r.length) && !!w[ke(r)];
436
+ };
437
+ function Mt(r) {
438
+ return (a = r) != null && st(a.length) && !Bt(a) ? Ct(r) : Pt(r);
439
+ var a;
440
+ }
441
+ e.exports = function(r, a) {
442
+ return Qe(r, a);
443
+ };
444
+ })(mr, mr.exports)), mr.exports), ln = ur(an);
445
+ function jr(e, t, n) {
446
+ return e[t] ? e[t][0] ? e[t][0][n] : e[t][n] : t === "contentBoxSize" ? e.contentRect[n === "inlineSize" ? "width" : "height"] : void 0;
447
+ }
448
+ function un(e) {
449
+ e === void 0 && (e = {});
450
+ var t = e.onResize, n = window.React.useRef(void 0);
451
+ n.current = t;
452
+ var s = e.round || Math.round, f = window.React.useRef(), _ = window.React.useState({
453
+ width: void 0,
454
+ height: void 0
455
+ }), E = _[0], g = _[1], i = window.React.useRef(!1);
456
+ window.React.useEffect(function() {
457
+ return i.current = !1, function() {
458
+ i.current = !0;
459
+ };
460
+ }, []);
461
+ var u = window.React.useRef({
462
+ width: void 0,
463
+ height: void 0
464
+ }), d = (function(p, y) {
465
+ var R = window.React.useRef(null), b = window.React.useRef(null);
466
+ b.current = y;
467
+ var j = window.React.useRef(null);
468
+ window.React.useEffect(function() {
469
+ N();
470
+ });
471
+ var N = window.React.useCallback(function() {
472
+ var S = j.current, P = b.current, l = S || (P ? P instanceof Element ? P : P.current : null);
473
+ R.current && R.current.element === l && R.current.subscriber === p || (R.current && R.current.cleanup && R.current.cleanup(), R.current = {
474
+ element: l,
475
+ subscriber: p,
476
+ cleanup: l ? p(l) : void 0
477
+ });
478
+ }, [p]);
479
+ return window.React.useEffect(function() {
480
+ return function() {
481
+ R.current && R.current.cleanup && (R.current.cleanup(), R.current = null);
482
+ };
483
+ }, []), window.React.useCallback(function(S) {
484
+ j.current = S, N();
485
+ }, [N]);
486
+ })(window.React.useCallback(function(p) {
487
+ return f.current && f.current.box === e.box && f.current.round === s || (f.current = {
488
+ box: e.box,
489
+ round: s,
490
+ instance: new ResizeObserver(function(y) {
491
+ var R = y[0], b = e.box === "border-box" ? "borderBoxSize" : e.box === "device-pixel-content-box" ? "devicePixelContentBoxSize" : "contentBoxSize", j = jr(R, b, "inlineSize"), N = jr(R, b, "blockSize"), S = j ? s(j) : void 0, P = N ? s(N) : void 0;
492
+ if (u.current.width !== S || u.current.height !== P) {
493
+ var l = {
494
+ width: S,
495
+ height: P
496
+ };
497
+ u.current.width = S, u.current.height = P, n.current ? n.current(l) : i.current || g(l);
498
+ }
499
+ })
500
+ }), f.current.instance.observe(p, {
501
+ box: e.box
502
+ }), function() {
503
+ f.current && f.current.instance.unobserve(p);
504
+ };
505
+ }, [e.box, s]), e.ref);
506
+ return window.React.useMemo(function() {
507
+ return {
508
+ ref: d,
509
+ width: E.width,
510
+ height: E.height
511
+ };
512
+ }, [d, E.width, E.height]);
513
+ }
514
+ var cn = "allotment-module_splitView__L-yRc", dn = "allotment-module_sashContainer__fzwJF", pn = "allotment-module_splitViewContainer__rQnVa", Wr = "allotment-module_splitViewView__MGZ6O", fn = "allotment-module_vertical__WSwwa", hn = "allotment-module_horizontal__7doS8", wn = "allotment-module_separatorBorder__x-rDS";
515
+ let or, Xr = !1, Ur = !1;
516
+ typeof navigator == "object" && (or = navigator.userAgent, Ur = or.indexOf("Macintosh") >= 0, Xr = (or.indexOf("Macintosh") >= 0 || or.indexOf("iPad") >= 0 || or.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0);
517
+ const Jr = Xr, mn = Ur, Mr = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? window.React.useLayoutEffect : window.React.useEffect;
518
+ class vn {
519
+ constructor() {
520
+ this._size = void 0;
521
+ }
522
+ getSize() {
523
+ return this._size;
524
+ }
525
+ setSize(t) {
526
+ this._size = t;
527
+ }
528
+ }
529
+ function dr(e, t) {
530
+ const n = e.length, s = n - t.length;
531
+ return s >= 0 && e.slice(s, n) === t;
532
+ }
533
+ var Nr, Lr = {
534
+ exports: {}
535
+ }, Dr, Or, gn = (Nr || (Nr = 1, (function(e) {
536
+ var t = Object.prototype.hasOwnProperty, n = "~";
537
+ function s() {
538
+ }
539
+ function f(i, u, d) {
540
+ this.fn = i, this.context = u, this.once = d || !1;
541
+ }
542
+ function _(i, u, d, p, y) {
543
+ if (typeof d != "function") throw new TypeError("The listener must be a function");
544
+ var R = new f(d, p || i, y), b = n ? n + u : u;
545
+ return i._events[b] ? i._events[b].fn ? i._events[b] = [i._events[b], R] : i._events[b].push(R) : (i._events[b] = R, i._eventsCount++), i;
546
+ }
547
+ function E(i, u) {
548
+ --i._eventsCount == 0 ? i._events = new s() : delete i._events[u];
549
+ }
550
+ function g() {
551
+ this._events = new s(), this._eventsCount = 0;
552
+ }
553
+ Object.create && (s.prototype = /* @__PURE__ */ Object.create(null), new s().__proto__ || (n = !1)), g.prototype.eventNames = function() {
554
+ var i, u, d = [];
555
+ if (this._eventsCount === 0) return d;
556
+ for (u in i = this._events) t.call(i, u) && d.push(n ? u.slice(1) : u);
557
+ return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(i)) : d;
558
+ }, g.prototype.listeners = function(i) {
559
+ var u = n ? n + i : i, d = this._events[u];
560
+ if (!d) return [];
561
+ if (d.fn) return [d.fn];
562
+ for (var p = 0, y = d.length, R = new Array(y); p < y; p++) R[p] = d[p].fn;
563
+ return R;
564
+ }, g.prototype.listenerCount = function(i) {
565
+ var u = n ? n + i : i, d = this._events[u];
566
+ return d ? d.fn ? 1 : d.length : 0;
567
+ }, g.prototype.emit = function(i, u, d, p, y, R) {
568
+ var b = n ? n + i : i;
569
+ if (!this._events[b]) return !1;
570
+ var j, N, S = this._events[b], P = arguments.length;
571
+ if (S.fn) {
572
+ switch (S.once && this.removeListener(i, S.fn, void 0, !0), P) {
573
+ case 1:
574
+ return S.fn.call(S.context), !0;
575
+ case 2:
576
+ return S.fn.call(S.context, u), !0;
577
+ case 3:
578
+ return S.fn.call(S.context, u, d), !0;
579
+ case 4:
580
+ return S.fn.call(S.context, u, d, p), !0;
581
+ case 5:
582
+ return S.fn.call(S.context, u, d, p, y), !0;
583
+ case 6:
584
+ return S.fn.call(S.context, u, d, p, y, R), !0;
585
+ }
586
+ for (N = 1, j = new Array(P - 1); N < P; N++) j[N - 1] = arguments[N];
587
+ S.fn.apply(S.context, j);
588
+ } else {
589
+ var l, M = S.length;
590
+ for (N = 0; N < M; N++) switch (S[N].once && this.removeListener(i, S[N].fn, void 0, !0), P) {
591
+ case 1:
592
+ S[N].fn.call(S[N].context);
593
+ break;
594
+ case 2:
595
+ S[N].fn.call(S[N].context, u);
596
+ break;
597
+ case 3:
598
+ S[N].fn.call(S[N].context, u, d);
599
+ break;
600
+ case 4:
601
+ S[N].fn.call(S[N].context, u, d, p);
602
+ break;
603
+ default:
604
+ if (!j) for (l = 1, j = new Array(P - 1); l < P; l++) j[l - 1] = arguments[l];
605
+ S[N].fn.apply(S[N].context, j);
606
+ }
607
+ }
608
+ return !0;
609
+ }, g.prototype.on = function(i, u, d) {
610
+ return _(this, i, u, d, !1);
611
+ }, g.prototype.once = function(i, u, d) {
612
+ return _(this, i, u, d, !0);
613
+ }, g.prototype.removeListener = function(i, u, d, p) {
614
+ var y = n ? n + i : i;
615
+ if (!this._events[y]) return this;
616
+ if (!u) return E(this, y), this;
617
+ var R = this._events[y];
618
+ if (R.fn) R.fn !== u || p && !R.once || d && R.context !== d || E(this, y);
619
+ else {
620
+ for (var b = 0, j = [], N = R.length; b < N; b++) (R[b].fn !== u || p && !R[b].once || d && R[b].context !== d) && j.push(R[b]);
621
+ j.length ? this._events[y] = j.length === 1 ? j[0] : j : E(this, y);
622
+ }
623
+ return this;
624
+ }, g.prototype.removeAllListeners = function(i) {
625
+ var u;
626
+ return i ? (u = n ? n + i : i, this._events[u] && E(this, u)) : (this._events = new s(), this._eventsCount = 0), this;
627
+ }, g.prototype.off = g.prototype.removeListener, g.prototype.addListener = g.prototype.on, g.prefixed = n, g.EventEmitter = g, e.exports = g;
628
+ })(Lr)), Lr.exports), Rr = ur(gn);
629
+ function kr(e, t) {
630
+ const n = e.indexOf(t);
631
+ n > -1 && (e.splice(n, 1), e.unshift(t));
632
+ }
633
+ function vr(e, t) {
634
+ const n = e.indexOf(t);
635
+ n > -1 && (e.splice(n, 1), e.push(t));
636
+ }
637
+ function lt(e, t, n = 1) {
638
+ const s = Math.max(0, Math.ceil((t - e) / n)), f = new Array(s);
639
+ let _ = -1;
640
+ for (; ++_ < s; ) f[_] = e + _ * n;
641
+ return f;
642
+ }
643
+ var _n = ur((function() {
644
+ if (Or) return Dr;
645
+ Or = 1;
646
+ var e = /^\s+|\s+$/g, t = /^[-+]0x[0-9a-f]+$/i, n = /^0b[01]+$/i, s = /^0o[0-7]+$/i, f = parseInt, _ = typeof Wt == "object" && Wt && Wt.Object === Object && Wt, E = typeof self == "object" && self && self.Object === Object && self, g = _ || E || Function("return this")(), i = Object.prototype.toString, u = Math.max, d = Math.min, p = function() {
647
+ return g.Date.now();
648
+ };
649
+ function y(b) {
650
+ var j = typeof b;
651
+ return !!b && (j == "object" || j == "function");
652
+ }
653
+ function R(b) {
654
+ if (typeof b == "number") return b;
655
+ if ((function(S) {
656
+ return typeof S == "symbol" || /* @__PURE__ */ (function(P) {
657
+ return !!P && typeof P == "object";
658
+ })(S) && i.call(S) == "[object Symbol]";
659
+ })(b)) return NaN;
660
+ if (y(b)) {
661
+ var j = typeof b.valueOf == "function" ? b.valueOf() : b;
662
+ b = y(j) ? j + "" : j;
663
+ }
664
+ if (typeof b != "string") return b === 0 ? b : +b;
665
+ b = b.replace(e, "");
666
+ var N = n.test(b);
667
+ return N || s.test(b) ? f(b.slice(2), N ? 2 : 8) : t.test(b) ? NaN : +b;
668
+ }
669
+ return Dr = function(b, j, N) {
670
+ var S, P, l, M, K, ue, w = 0, Z = !1, Me = !1, ie = !0;
671
+ if (typeof b != "function") throw new TypeError("Expected a function");
672
+ function Ye(q) {
673
+ var ee = S, fe = P;
674
+ return S = P = void 0, w = q, M = b.apply(fe, ee);
675
+ }
676
+ function I(q) {
677
+ var ee = q - ue;
678
+ return ue === void 0 || ee >= j || ee < 0 || Me && q - w >= l;
679
+ }
680
+ function W() {
681
+ var q = p();
682
+ if (I(q)) return ne(q);
683
+ K = setTimeout(W, (function(ee) {
684
+ var fe = j - (ee - ue);
685
+ return Me ? d(fe, l - (ee - w)) : fe;
686
+ })(q));
687
+ }
688
+ function ne(q) {
689
+ return K = void 0, ie && S ? Ye(q) : (S = P = void 0, M);
690
+ }
691
+ function X() {
692
+ var q = p(), ee = I(q);
693
+ if (S = arguments, P = this, ue = q, ee) {
694
+ if (K === void 0) return (function(fe) {
695
+ return w = fe, K = setTimeout(W, j), Z ? Ye(fe) : M;
696
+ })(ue);
697
+ if (Me) return K = setTimeout(W, j), Ye(ue);
698
+ }
699
+ return K === void 0 && (K = setTimeout(W, j)), M;
700
+ }
701
+ return j = R(j) || 0, y(N) && (Z = !!N.leading, l = (Me = "maxWait" in N) ? u(R(N.maxWait) || 0, j) : l, ie = "trailing" in N ? !!N.trailing : ie), X.cancel = function() {
702
+ K !== void 0 && clearTimeout(K), w = 0, S = ue = P = K = void 0;
703
+ }, X.flush = function() {
704
+ return K === void 0 ? M : ne(p());
705
+ }, X;
706
+ };
707
+ })()), bn = "sash-module_sash__K-9lB", zn = "sash-module_disabled__Hm-wx", Sn = "sash-module_mac__Jf6OJ", Vr = "sash-module_vertical__pB-rs", Rn = "sash-module_minimum__-UKxp", yn = "sash-module_maximum__TCWxD", Tr = "sash-module_horizontal__kFbiw", gr = "sash-module_hover__80W6I", _r = "sash-module_active__bJspD";
708
+ let ct = (function(e) {
709
+ return e.Vertical = "VERTICAL", e.Horizontal = "HORIZONTAL", e;
710
+ })({}), tt = (function(e) {
711
+ return e.Disabled = "DISABLED", e.Minimum = "MINIMUM", e.Maximum = "MAXIMUM", e.Enabled = "ENABLED", e;
712
+ })({}), Zr = Jr ? 20 : 8;
713
+ const qr = new Rr();
714
+ class Hr extends Rr {
715
+ get state() {
716
+ return this._state;
717
+ }
718
+ set state(t) {
719
+ this._state !== t && (this.el.classList.toggle(zn, t === tt.Disabled), this.el.classList.toggle("sash-disabled", t === tt.Disabled), this.el.classList.toggle(Rn, t === tt.Minimum), this.el.classList.toggle("sash-minimum", t === tt.Minimum), this.el.classList.toggle(yn, t === tt.Maximum), this.el.classList.toggle("sash-maximum", t === tt.Maximum), this._state = t, this.emit("enablementChange", t));
720
+ }
721
+ constructor(t, n, s) {
722
+ var f;
723
+ super(), this.el = void 0, this.layoutProvider = void 0, this.orientation = void 0, this.size = void 0, this.hoverDelay = 300, this.hoverDelayer = _n((_) => _.classList.add("sash-hover", gr), this.hoverDelay), this._state = tt.Enabled, this.onPointerStart = (_) => {
724
+ const E = _.pageX, g = _.pageY, i = {
725
+ startX: E,
726
+ currentX: E,
727
+ startY: g,
728
+ currentY: g
729
+ };
730
+ this.el.classList.add("sash-active", _r), this.emit("start", i), this.el.setPointerCapture(_.pointerId);
731
+ const u = (p) => {
732
+ p.preventDefault();
733
+ const y = {
734
+ startX: E,
735
+ currentX: p.pageX,
736
+ startY: g,
737
+ currentY: p.pageY
738
+ };
739
+ this.emit("change", y);
740
+ }, d = (p) => {
741
+ p.preventDefault(), this.el.classList.remove("sash-active", _r), this.hoverDelayer.cancel(), this.emit("end"), this.el.releasePointerCapture(p.pointerId), window.removeEventListener("pointermove", u), window.removeEventListener("pointerup", d);
742
+ };
743
+ window.addEventListener("pointermove", u), window.addEventListener("pointerup", d);
744
+ }, this.onPointerDoublePress = () => {
745
+ this.emit("reset");
746
+ }, this.onMouseEnter = () => {
747
+ this.el.classList.contains(_r) ? (this.hoverDelayer.cancel(), this.el.classList.add("sash-hover", gr)) : this.hoverDelayer(this.el);
748
+ }, this.onMouseLeave = () => {
749
+ this.hoverDelayer.cancel(), this.el.classList.remove("sash-hover", gr);
750
+ }, this.el = document.createElement("div"), this.el.classList.add("sash", bn), this.el.dataset.testid = "sash", t.append(this.el), mn && this.el.classList.add("sash-mac", Sn), this.el.addEventListener("pointerdown", this.onPointerStart), this.el.addEventListener("dblclick", this.onPointerDoublePress), this.el.addEventListener("mouseenter", this.onMouseEnter), this.el.addEventListener("mouseleave", this.onMouseLeave), typeof s.size == "number" ? (this.size = s.size, s.orientation === ct.Vertical ? this.el.style.width = `${this.size}px` : this.el.style.height = `${this.size}px`) : (this.size = Zr, qr.on("onDidChangeGlobalSize", (_) => {
751
+ this.size = _, this.layout();
752
+ })), this.layoutProvider = n, this.orientation = (f = s.orientation) != null ? f : ct.Vertical, this.orientation === ct.Horizontal ? (this.el.classList.add("sash-horizontal", Tr), this.el.classList.remove("sash-vertical", Vr)) : (this.el.classList.remove("sash-horizontal", Tr), this.el.classList.add("sash-vertical", Vr)), this.layout();
753
+ }
754
+ layout() {
755
+ if (this.orientation === ct.Vertical) {
756
+ const t = this.layoutProvider;
757
+ this.el.style.left = t.getVerticalSashLeft(this) - this.size / 2 + "px", t.getVerticalSashTop && (this.el.style.top = t.getVerticalSashTop(this) + "px"), t.getVerticalSashHeight && (this.el.style.height = t.getVerticalSashHeight(this) + "px");
758
+ } else {
759
+ const t = this.layoutProvider;
760
+ this.el.style.top = t.getHorizontalSashTop(this) - this.size / 2 + "px", t.getHorizontalSashLeft && (this.el.style.left = t.getHorizontalSashLeft(this) + "px"), t.getHorizontalSashWidth && (this.el.style.width = t.getHorizontalSashWidth(this) + "px");
761
+ }
762
+ }
763
+ dispose() {
764
+ this.el.removeEventListener("pointerdown", this.onPointerStart), this.el.removeEventListener("dblclick", this.onPointerDoublePress), this.el.removeEventListener("mouseenter", this.onMouseEnter), this.el.removeEventListener("mouseleave", () => this.onMouseLeave), this.el.remove();
765
+ }
766
+ }
767
+ let fr;
768
+ var br;
769
+ (br = fr || (fr = {})).Distribute = {
770
+ type: "distribute"
771
+ }, br.Split = function(e) {
772
+ return {
773
+ type: "split",
774
+ index: e
775
+ };
776
+ }, br.Invisible = function(e) {
777
+ return {
778
+ type: "invisible",
779
+ cachedVisibleSize: e
780
+ };
781
+ };
782
+ let ut = (function(e) {
783
+ return e.Normal = "NORMAL", e.Low = "LOW", e.High = "HIGH", e;
784
+ })({});
785
+ class Gr {
786
+ constructor(t, n, s) {
787
+ this.container = void 0, this.view = void 0, this._size = void 0, this._cachedVisibleSize = void 0, this.container = t, this.view = n, this.container.classList.add("split-view-view", Wr), this.container.dataset.testid = "split-view-view", typeof s == "number" ? (this._size = s, this._cachedVisibleSize = void 0, t.classList.add("split-view-view-visible")) : (this._size = 0, this._cachedVisibleSize = s.cachedVisibleSize);
788
+ }
789
+ set size(t) {
790
+ this._size = t;
791
+ }
792
+ get size() {
793
+ return this._size;
794
+ }
795
+ get priority() {
796
+ return this.view.priority;
797
+ }
798
+ get snap() {
799
+ return !!this.view.snap;
800
+ }
801
+ get cachedVisibleSize() {
802
+ return this._cachedVisibleSize;
803
+ }
804
+ get visible() {
805
+ return this._cachedVisibleSize === void 0;
806
+ }
807
+ setVisible(t, n) {
808
+ t !== this.visible && (t ? (this.size = zt(this._cachedVisibleSize, this.viewMinimumSize, this.viewMaximumSize), this._cachedVisibleSize = void 0) : (this._cachedVisibleSize = typeof n == "number" ? n : this.size, this.size = 0), this.container.classList.toggle("split-view-view-visible", t), this.view.setVisible && this.view.setVisible(t));
809
+ }
810
+ get minimumSize() {
811
+ return this.visible ? this.view.minimumSize : 0;
812
+ }
813
+ get viewMinimumSize() {
814
+ return this.view.minimumSize;
815
+ }
816
+ get maximumSize() {
817
+ return this.visible ? this.view.maximumSize : 0;
818
+ }
819
+ get viewMaximumSize() {
820
+ return this.view.maximumSize;
821
+ }
822
+ set enabled(t) {
823
+ this.container.style.pointerEvents = t ? "" : "none";
824
+ }
825
+ layout(t) {
826
+ this.layoutContainer(t), this.view.layout(this.size, t);
827
+ }
828
+ }
829
+ class xn extends Gr {
830
+ layoutContainer(t) {
831
+ this.container.style.left = `${t}px`, this.container.style.width = `${this.size}px`;
832
+ }
833
+ }
834
+ class En extends Gr {
835
+ layoutContainer(t) {
836
+ this.container.style.top = `${t}px`, this.container.style.height = `${this.size}px`;
837
+ }
838
+ }
839
+ class In extends Rr {
840
+ get startSnappingEnabled() {
841
+ return this._startSnappingEnabled;
842
+ }
843
+ set startSnappingEnabled(t) {
844
+ this._startSnappingEnabled !== t && (this._startSnappingEnabled = t, this.updateSashEnablement());
845
+ }
846
+ get endSnappingEnabled() {
847
+ return this._endSnappingEnabled;
848
+ }
849
+ set endSnappingEnabled(t) {
850
+ this._endSnappingEnabled !== t && (this._endSnappingEnabled = t, this.updateSashEnablement());
851
+ }
852
+ constructor(t, n = {}, s, f, _) {
853
+ var E, g;
854
+ if (super(), this.onDidChange = void 0, this.onDidDragStart = void 0, this.onDidDragEnd = void 0, this.orientation = void 0, this.sashContainer = void 0, this.size = 0, this.contentSize = 0, this.proportions = void 0, this.viewItems = [], this.sashItems = [], this.sashDragState = void 0, this.proportionalLayout = void 0, this.getSashOrthogonalSize = void 0, this._startSnappingEnabled = !0, this._endSnappingEnabled = !0, this.onSashEnd = (i) => {
855
+ this.emit("sashchange", i), this.saveProportions();
856
+ for (const u of this.viewItems) u.enabled = !0;
857
+ }, this.orientation = (E = n.orientation) != null ? E : ct.Vertical, this.proportionalLayout = (g = n.proportionalLayout) != null ? g : !0, this.getSashOrthogonalSize = n.getSashOrthogonalSize, s && (this.onDidChange = s), f && (this.onDidDragStart = f), _ && (this.onDidDragEnd = _), this.sashContainer = document.createElement("div"), this.sashContainer.classList.add("sash-container", dn), t.prepend(this.sashContainer), n.descriptor) {
858
+ this.size = n.descriptor.size;
859
+ for (const [i, u] of n.descriptor.views.entries()) {
860
+ const d = u.size, p = u.container, y = u.view;
861
+ this.addView(p, y, d, i, !0);
862
+ }
863
+ this.contentSize = this.viewItems.reduce((i, u) => i + u.size, 0), this.saveProportions();
864
+ }
865
+ }
866
+ addView(t, n, s, f = this.viewItems.length, _) {
867
+ let E;
868
+ E = typeof s == "number" ? s : s.type === "split" ? this.getViewSize(s.index) / 2 : s.type === "invisible" ? {
869
+ cachedVisibleSize: s.cachedVisibleSize
870
+ } : n.minimumSize;
871
+ const g = this.orientation === ct.Vertical ? new En(t, n, E) : new xn(t, n, E);
872
+ if (this.viewItems.splice(f, 0, g), this.viewItems.length > 1) {
873
+ const i = this.orientation === ct.Vertical ? new Hr(this.sashContainer, {
874
+ getHorizontalSashTop: (p) => this.getSashPosition(p),
875
+ getHorizontalSashWidth: this.getSashOrthogonalSize
876
+ }, {
877
+ orientation: ct.Horizontal
878
+ }) : new Hr(this.sashContainer, {
879
+ getVerticalSashLeft: (p) => this.getSashPosition(p),
880
+ getVerticalSashHeight: this.getSashOrthogonalSize
881
+ }, {
882
+ orientation: ct.Vertical
883
+ }), u = this.orientation === ct.Vertical ? (p) => ({
884
+ sash: i,
885
+ start: p.startY,
886
+ current: p.currentY
887
+ }) : (p) => ({
888
+ sash: i,
889
+ start: p.startX,
890
+ current: p.currentX
891
+ });
892
+ i.on("start", (p) => {
893
+ var y;
894
+ this.emit("sashDragStart"), this.onSashStart(u(p));
895
+ const R = this.viewItems.map((b) => b.size);
896
+ (y = this.onDidDragStart) == null || y.call(this, R);
897
+ }), i.on("change", (p) => this.onSashChange(u(p))), i.on("end", () => {
898
+ var p;
899
+ this.emit("sashDragEnd"), this.onSashEnd(this.sashItems.findIndex((R) => R.sash === i));
900
+ const y = this.viewItems.map((R) => R.size);
901
+ (p = this.onDidDragEnd) == null || p.call(this, y);
902
+ }), i.on("reset", () => {
903
+ const p = this.sashItems.findIndex((N) => N.sash === i), y = lt(p, -1, -1), R = lt(p + 1, this.viewItems.length), b = this.findFirstSnapIndex(y), j = this.findFirstSnapIndex(R);
904
+ (typeof b != "number" || this.viewItems[b].visible) && (typeof j != "number" || this.viewItems[j].visible) && this.emit("sashreset", p);
905
+ });
906
+ const d = {
907
+ sash: i
908
+ };
909
+ this.sashItems.splice(f - 1, 0, d);
910
+ }
911
+ _ || this.relayout(), _ || typeof s == "number" || s.type !== "distribute" || this.distributeViewSizes();
912
+ }
913
+ removeView(t, n) {
914
+ if (t < 0 || t >= this.viewItems.length) throw new Error("Index out of bounds");
915
+ const s = this.viewItems.splice(t, 1)[0].view;
916
+ if (this.viewItems.length >= 1) {
917
+ const f = Math.max(t - 1, 0);
918
+ this.sashItems.splice(f, 1)[0].sash.dispose();
919
+ }
920
+ return this.relayout(), n && n.type === "distribute" && this.distributeViewSizes(), s;
921
+ }
922
+ moveView(t, n, s) {
923
+ const f = this.getViewCachedVisibleSize(n), _ = f === void 0 ? this.getViewSize(n) : fr.Invisible(f), E = this.removeView(n);
924
+ this.addView(t, E, _, s);
925
+ }
926
+ getViewCachedVisibleSize(t) {
927
+ if (t < 0 || t >= this.viewItems.length) throw new Error("Index out of bounds");
928
+ return this.viewItems[t].cachedVisibleSize;
929
+ }
930
+ layout(t = this.size) {
931
+ const n = Math.max(this.size, this.contentSize);
932
+ if (this.size = t, this.proportions) for (let s = 0; s < this.viewItems.length; s++) {
933
+ const f = this.viewItems[s];
934
+ f.size = zt(Math.round(this.proportions[s] * t), f.minimumSize, f.maximumSize);
935
+ }
936
+ else {
937
+ const s = lt(0, this.viewItems.length), f = s.filter((E) => this.viewItems[E].priority === ut.Low), _ = s.filter((E) => this.viewItems[E].priority === ut.High);
938
+ this.resize(this.viewItems.length - 1, t - n, void 0, f, _);
939
+ }
940
+ this.distributeEmptySpace(), this.layoutViews();
941
+ }
942
+ resizeView(t, n) {
943
+ if (t < 0 || t >= this.viewItems.length) return;
944
+ const s = lt(0, this.viewItems.length).filter((g) => g !== t), f = [...s.filter((g) => this.viewItems[g].priority === ut.Low), t], _ = s.filter((g) => this.viewItems[g].priority === ut.High), E = this.viewItems[t];
945
+ n = Math.round(n), n = zt(n, E.minimumSize, Math.min(E.maximumSize, this.size)), E.size = n, this.relayout(f, _);
946
+ }
947
+ resizeViews(t) {
948
+ for (let n = 0; n < t.length; n++) {
949
+ const s = this.viewItems[n];
950
+ let f = t[n];
951
+ f = Math.round(f), f = zt(f, s.minimumSize, Math.min(s.maximumSize, this.size)), s.size = f;
952
+ }
953
+ this.contentSize = this.viewItems.reduce((n, s) => n + s.size, 0), this.saveProportions(), this.layout(this.size);
954
+ }
955
+ getViewSize(t) {
956
+ return t < 0 || t >= this.viewItems.length ? -1 : this.viewItems[t].size;
957
+ }
958
+ isViewVisible(t) {
959
+ if (t < 0 || t >= this.viewItems.length) throw new Error("Index out of bounds");
960
+ return this.viewItems[t].visible;
961
+ }
962
+ setViewVisible(t, n) {
963
+ if (t < 0 || t >= this.viewItems.length) throw new Error("Index out of bounds");
964
+ this.viewItems[t].setVisible(n), this.distributeEmptySpace(t), this.layoutViews(), this.saveProportions();
965
+ }
966
+ distributeViewSizes() {
967
+ const t = [];
968
+ let n = 0;
969
+ for (const g of this.viewItems) g.maximumSize - g.minimumSize > 0 && (t.push(g), n += g.size);
970
+ const s = Math.floor(n / t.length);
971
+ for (const g of t) g.size = zt(s, g.minimumSize, g.maximumSize);
972
+ const f = lt(0, this.viewItems.length), _ = f.filter((g) => this.viewItems[g].priority === ut.Low), E = f.filter((g) => this.viewItems[g].priority === ut.High);
973
+ this.relayout(_, E);
974
+ }
975
+ dispose() {
976
+ this.sashItems.forEach((t) => t.sash.dispose()), this.sashItems = [], this.sashContainer.remove();
977
+ }
978
+ relayout(t, n) {
979
+ const s = this.viewItems.reduce((f, _) => f + _.size, 0);
980
+ this.resize(this.viewItems.length - 1, this.size - s, void 0, t, n), this.distributeEmptySpace(), this.layoutViews(), this.saveProportions();
981
+ }
982
+ onSashStart({
983
+ sash: t,
984
+ start: n
985
+ }) {
986
+ const s = this.sashItems.findIndex((f) => f.sash === t);
987
+ ((f) => {
988
+ const _ = this.viewItems.map((P) => P.size);
989
+ let E, g, i = Number.NEGATIVE_INFINITY, u = Number.POSITIVE_INFINITY;
990
+ const d = lt(s, -1, -1), p = lt(s + 1, this.viewItems.length), y = d.reduce((P, l) => P + (this.viewItems[l].minimumSize - _[l]), 0), R = d.reduce((P, l) => P + (this.viewItems[l].viewMaximumSize - _[l]), 0), b = p.length === 0 ? Number.POSITIVE_INFINITY : p.reduce((P, l) => P + (_[l] - this.viewItems[l].minimumSize), 0), j = p.length === 0 ? Number.NEGATIVE_INFINITY : p.reduce((P, l) => P + (_[l] - this.viewItems[l].viewMaximumSize), 0);
991
+ i = Math.max(y, j), u = Math.min(b, R);
992
+ const N = this.findFirstSnapIndex(d), S = this.findFirstSnapIndex(p);
993
+ if (typeof N == "number") {
994
+ const P = this.viewItems[N], l = Math.floor(P.viewMinimumSize / 2);
995
+ E = {
996
+ index: N,
997
+ limitDelta: P.visible ? i - l : i + l,
998
+ size: P.size
999
+ };
1000
+ }
1001
+ if (typeof S == "number") {
1002
+ const P = this.viewItems[S], l = Math.floor(P.viewMinimumSize / 2);
1003
+ g = {
1004
+ index: S,
1005
+ limitDelta: P.visible ? u + l : u - l,
1006
+ size: P.size
1007
+ };
1008
+ }
1009
+ this.sashDragState = {
1010
+ start: f,
1011
+ current: f,
1012
+ index: s,
1013
+ sizes: _,
1014
+ minDelta: i,
1015
+ maxDelta: u,
1016
+ snapBefore: E,
1017
+ snapAfter: g
1018
+ };
1019
+ })(n);
1020
+ }
1021
+ onSashChange({
1022
+ current: t
1023
+ }) {
1024
+ const {
1025
+ index: n,
1026
+ start: s,
1027
+ sizes: f,
1028
+ minDelta: _,
1029
+ maxDelta: E,
1030
+ snapBefore: g,
1031
+ snapAfter: i
1032
+ } = this.sashDragState;
1033
+ this.sashDragState.current = t;
1034
+ const u = t - s;
1035
+ this.resize(n, u, f, void 0, void 0, _, E, g, i), this.distributeEmptySpace(), this.layoutViews();
1036
+ }
1037
+ getSashPosition(t) {
1038
+ let n = 0;
1039
+ for (let s = 0; s < this.sashItems.length; s++) if (n += this.viewItems[s].size, this.sashItems[s].sash === t) return n;
1040
+ return 0;
1041
+ }
1042
+ resize(t, n, s = this.viewItems.map((d) => d.size), f, _, E = Number.NEGATIVE_INFINITY, g = Number.POSITIVE_INFINITY, i, u) {
1043
+ if (t < 0 || t >= this.viewItems.length) return 0;
1044
+ const d = lt(t, -1, -1), p = lt(t + 1, this.viewItems.length);
1045
+ if (_) for (const w of _) kr(d, w), kr(p, w);
1046
+ if (f) for (const w of f) vr(d, w), vr(p, w);
1047
+ const y = d.map((w) => this.viewItems[w]), R = d.map((w) => s[w]), b = p.map((w) => this.viewItems[w]), j = p.map((w) => s[w]), N = d.reduce((w, Z) => w + (this.viewItems[Z].minimumSize - s[Z]), 0), S = d.reduce((w, Z) => w + (this.viewItems[Z].maximumSize - s[Z]), 0), P = p.length === 0 ? Number.POSITIVE_INFINITY : p.reduce((w, Z) => w + (s[Z] - this.viewItems[Z].minimumSize), 0), l = p.length === 0 ? Number.NEGATIVE_INFINITY : p.reduce((w, Z) => w + (s[Z] - this.viewItems[Z].maximumSize), 0), M = Math.max(N, l, E), K = Math.min(P, S, g);
1048
+ let ue = !1;
1049
+ if (i) {
1050
+ const w = this.viewItems[i.index], Z = n >= i.limitDelta;
1051
+ ue = Z !== w.visible, w.setVisible(Z, i.size);
1052
+ }
1053
+ if (!ue && u) {
1054
+ const w = this.viewItems[u.index], Z = n < u.limitDelta;
1055
+ ue = Z !== w.visible, w.setVisible(Z, u.size);
1056
+ }
1057
+ if (ue) return this.resize(t, n, s, f, _, E, g);
1058
+ for (let w = 0, Z = n = zt(n, M, K); w < y.length; w++) {
1059
+ const Me = y[w], ie = zt(R[w] + Z, Me.minimumSize, Me.maximumSize);
1060
+ Z -= ie - R[w], Me.size = ie;
1061
+ }
1062
+ for (let w = 0, Z = n; w < b.length; w++) {
1063
+ const Me = b[w], ie = zt(j[w] - Z, Me.minimumSize, Me.maximumSize);
1064
+ Z += ie - j[w], Me.size = ie;
1065
+ }
1066
+ return n;
1067
+ }
1068
+ distributeEmptySpace(t) {
1069
+ const n = this.viewItems.reduce((u, d) => u + d.size, 0);
1070
+ let s = this.size - n;
1071
+ const f = lt(0, this.viewItems.length), _ = [], E = f.filter((u) => this.viewItems[u].priority === ut.Low), g = f.filter((u) => this.viewItems[u].priority === ut.Normal), i = f.filter((u) => this.viewItems[u].priority === ut.High);
1072
+ _.push(...i, ...g, ...E), typeof t == "number" && vr(_, t);
1073
+ for (let u = 0; s !== 0 && u < _.length; u++) {
1074
+ const d = this.viewItems[_[u]], p = zt(d.size + s, d.minimumSize, d.maximumSize);
1075
+ s -= p - d.size, d.size = p;
1076
+ }
1077
+ }
1078
+ layoutViews() {
1079
+ var t;
1080
+ this.contentSize = this.viewItems.reduce((s, f) => s + f.size, 0);
1081
+ let n = 0;
1082
+ for (const s of this.viewItems) s.layout(n), n += s.size;
1083
+ (t = this.onDidChange) != null && t.call(this, this.viewItems.map((s) => s.size)), this.sashItems.forEach((s) => s.sash.layout()), this.updateSashEnablement();
1084
+ }
1085
+ saveProportions() {
1086
+ this.proportionalLayout && this.contentSize > 0 && (this.proportions = this.viewItems.map((t) => t.size / this.contentSize));
1087
+ }
1088
+ updateSashEnablement() {
1089
+ let t = !1;
1090
+ const n = this.viewItems.map((i) => t = i.size - i.minimumSize > 0 || t);
1091
+ t = !1;
1092
+ const s = this.viewItems.map((i) => t = i.maximumSize - i.size > 0 || t), f = [...this.viewItems].reverse();
1093
+ t = !1;
1094
+ const _ = f.map((i) => t = i.size - i.minimumSize > 0 || t).reverse();
1095
+ t = !1;
1096
+ const E = f.map((i) => t = i.maximumSize - i.size > 0 || t).reverse();
1097
+ let g = 0;
1098
+ for (let i = 0; i < this.sashItems.length; i++) {
1099
+ const {
1100
+ sash: u
1101
+ } = this.sashItems[i];
1102
+ g += this.viewItems[i].size;
1103
+ const d = !(n[i] && E[i + 1]), p = !(s[i] && _[i + 1]);
1104
+ if (d && p) {
1105
+ const y = lt(i, -1, -1), R = lt(i + 1, this.viewItems.length), b = this.findFirstSnapIndex(y), j = this.findFirstSnapIndex(R), N = typeof b == "number" && !this.viewItems[b].visible, S = typeof j == "number" && !this.viewItems[j].visible;
1106
+ N && _[i] && (g > 0 || this.startSnappingEnabled) ? u.state = tt.Minimum : S && n[i] && (g < this.contentSize || this.endSnappingEnabled) ? u.state = tt.Maximum : u.state = tt.Disabled;
1107
+ } else u.state = d && !p ? tt.Minimum : !d && p ? tt.Maximum : tt.Enabled;
1108
+ }
1109
+ }
1110
+ findFirstSnapIndex(t) {
1111
+ for (const n of t) {
1112
+ const s = this.viewItems[n];
1113
+ if (s.visible && s.snap) return n;
1114
+ }
1115
+ for (const n of t) {
1116
+ const s = this.viewItems[n];
1117
+ if (s.visible && s.maximumSize - s.minimumSize > 0) return;
1118
+ if (!s.visible && s.snap) return n;
1119
+ }
1120
+ }
1121
+ }
1122
+ class rr {
1123
+ constructor(t) {
1124
+ this.size = void 0, this.size = t;
1125
+ }
1126
+ getPreferredSize() {
1127
+ return this.size;
1128
+ }
1129
+ }
1130
+ class $r {
1131
+ constructor(t, n) {
1132
+ this.proportion = void 0, this.layoutService = void 0, this.proportion = t, this.layoutService = n;
1133
+ }
1134
+ getPreferredSize() {
1135
+ return this.proportion * this.layoutService.getSize();
1136
+ }
1137
+ }
1138
+ class pr {
1139
+ getPreferredSize() {
1140
+ }
1141
+ }
1142
+ class Ar {
1143
+ get preferredSize() {
1144
+ return this.layoutStrategy.getPreferredSize();
1145
+ }
1146
+ set preferredSize(t) {
1147
+ if (typeof t == "number") this.layoutStrategy = new rr(t);
1148
+ else if (typeof t == "string") {
1149
+ const n = t.trim();
1150
+ if (dr(n, "%")) {
1151
+ const s = Number(n.slice(0, -1)) / 100;
1152
+ this.layoutStrategy = new $r(s, this.layoutService);
1153
+ } else if (dr(n, "px")) {
1154
+ const s = Number(n.slice(0, -2)) / 100;
1155
+ this.layoutStrategy = new rr(s);
1156
+ } else if (typeof Number.parseFloat(n) == "number") {
1157
+ const s = Number.parseFloat(n);
1158
+ this.layoutStrategy = new rr(s);
1159
+ } else this.layoutStrategy = new pr();
1160
+ } else this.layoutStrategy = new pr();
1161
+ }
1162
+ constructor(t, n) {
1163
+ var s;
1164
+ if (this.minimumSize = 0, this.maximumSize = Number.POSITIVE_INFINITY, this.element = void 0, this.priority = void 0, this.snap = void 0, this.layoutService = void 0, this.layoutStrategy = void 0, this.layoutService = t, this.element = n.element, this.minimumSize = typeof n.minimumSize == "number" ? n.minimumSize : 30, this.maximumSize = typeof n.maximumSize == "number" ? n.maximumSize : Number.POSITIVE_INFINITY, typeof n.preferredSize == "number") this.layoutStrategy = new rr(n.preferredSize);
1165
+ else if (typeof n.preferredSize == "string") {
1166
+ const f = n.preferredSize.trim();
1167
+ if (dr(f, "%")) {
1168
+ const _ = Number(f.slice(0, -1)) / 100;
1169
+ this.layoutStrategy = new $r(_, this.layoutService);
1170
+ } else if (dr(f, "px")) {
1171
+ const _ = Number(f.slice(0, -2));
1172
+ this.layoutStrategy = new rr(_);
1173
+ } else if (typeof Number.parseFloat(f) == "number") {
1174
+ const _ = Number.parseFloat(f);
1175
+ this.layoutStrategy = new rr(_);
1176
+ } else this.layoutStrategy = new pr();
1177
+ } else this.layoutStrategy = new pr();
1178
+ this.priority = (s = n.priority) != null ? s : ut.Normal, this.snap = typeof n.snap == "boolean" && n.snap;
1179
+ }
1180
+ layout(t) {
1181
+ }
1182
+ }
1183
+ function Br(e) {
1184
+ return e.minSize !== void 0 || e.maxSize !== void 0 || e.preferredSize !== void 0 || e.priority !== void 0 || e.visible !== void 0;
1185
+ }
1186
+ const yr = window.React.forwardRef(({
1187
+ className: e,
1188
+ children: t
1189
+ }, n) => window.React.createElement("div", {
1190
+ ref: n,
1191
+ className: Sr("split-view-view", Wr, e)
1192
+ }, t));
1193
+ yr.displayName = "Allotment.Pane";
1194
+ const Kr = window.React.forwardRef(({
1195
+ children: e,
1196
+ className: t,
1197
+ id: n,
1198
+ maxSize: s = 1 / 0,
1199
+ minSize: f = 30,
1200
+ proportionalLayout: _ = !0,
1201
+ separator: E = !0,
1202
+ sizes: g,
1203
+ defaultSizes: i = g,
1204
+ snap: u = !1,
1205
+ vertical: d = !1,
1206
+ onChange: p,
1207
+ onReset: y,
1208
+ onVisibleChange: R,
1209
+ onDragStart: b,
1210
+ onDragEnd: j
1211
+ }, N) => {
1212
+ const S = window.React.useRef(null), P = window.React.useRef([]), l = window.React.useRef(/* @__PURE__ */ new Map()), M = window.React.useRef(null), K = window.React.useRef(/* @__PURE__ */ new Map()), ue = window.React.useRef(new vn()), w = window.React.useRef([]), [Z, Me] = window.React.useState(!1), ie = window.React.useMemo(() => window.React.Children.toArray(e).filter(window.React.isValidElement), [e]), Ye = window.React.useCallback((I) => {
1213
+ var W, ne;
1214
+ const X = (W = w.current) == null ? void 0 : W[I];
1215
+ return typeof (X == null ? void 0 : X.preferredSize) == "number" && ((ne = M.current) != null && ne.resizeView(I, Math.round(X.preferredSize)), !0);
1216
+ }, []);
1217
+ return window.React.useImperativeHandle(N, () => ({
1218
+ reset: () => {
1219
+ if (y) y();
1220
+ else {
1221
+ var I;
1222
+ (I = M.current) == null || I.distributeViewSizes();
1223
+ for (let W = 0; W < w.current.length; W++) Ye(W);
1224
+ }
1225
+ },
1226
+ resize: (I) => {
1227
+ var W;
1228
+ (W = M.current) == null || W.resizeViews(I);
1229
+ }
1230
+ })), Mr(() => {
1231
+ let I = !0;
1232
+ i && K.current.size !== i.length && (I = !1, console.warn(`Expected ${i.length} children based on defaultSizes but found ${K.current.size}`)), I && i && (P.current = ie.map((X) => X.key));
1233
+ const W = lr({
1234
+ orientation: d ? ct.Vertical : ct.Horizontal,
1235
+ proportionalLayout: _
1236
+ }, I && i && {
1237
+ descriptor: {
1238
+ size: i.reduce((X, q) => X + q, 0),
1239
+ views: i.map((X, q) => {
1240
+ var ee, fe, We, $e;
1241
+ const ce = l.current.get(P.current[q]), Ae = new Ar(ue.current, lr({
1242
+ element: document.createElement("div"),
1243
+ minimumSize: (ee = ce == null ? void 0 : ce.minSize) != null ? ee : f,
1244
+ maximumSize: (fe = ce == null ? void 0 : ce.maxSize) != null ? fe : s,
1245
+ priority: (We = ce == null ? void 0 : ce.priority) != null ? We : ut.Normal
1246
+ }, (ce == null ? void 0 : ce.preferredSize) && {
1247
+ preferredSize: ce == null ? void 0 : ce.preferredSize
1248
+ }, {
1249
+ snap: ($e = ce == null ? void 0 : ce.snap) != null ? $e : u
1250
+ }));
1251
+ return w.current.push(Ae), {
1252
+ container: [...K.current.values()][q],
1253
+ size: X,
1254
+ view: Ae
1255
+ };
1256
+ })
1257
+ }
1258
+ });
1259
+ M.current = new In(S.current, W, p, b, j), M.current.on("sashDragStart", () => {
1260
+ var X;
1261
+ (X = S.current) == null || X.classList.add("split-view-sash-dragging");
1262
+ }), M.current.on("sashDragEnd", () => {
1263
+ var X;
1264
+ (X = S.current) == null || X.classList.remove("split-view-sash-dragging");
1265
+ }), M.current.on("sashchange", (X) => {
1266
+ if (R && M.current) {
1267
+ const q = ie.map((ee) => ee.key);
1268
+ for (let ee = 0; ee < q.length; ee++) {
1269
+ const fe = l.current.get(q[ee]);
1270
+ (fe == null ? void 0 : fe.visible) !== void 0 && fe.visible !== M.current.isViewVisible(ee) && R(ee, M.current.isViewVisible(ee));
1271
+ }
1272
+ }
1273
+ }), M.current.on("sashreset", (X) => {
1274
+ if (y) y();
1275
+ else {
1276
+ var q;
1277
+ if (Ye(X) || Ye(X + 1)) return;
1278
+ (q = M.current) == null || q.distributeViewSizes();
1279
+ }
1280
+ });
1281
+ const ne = M.current;
1282
+ return () => {
1283
+ ne.dispose();
1284
+ };
1285
+ }, []), Mr(() => {
1286
+ if (Z) {
1287
+ const F = ie.map((V) => V.key), Oe = [...P.current], Xe = F.filter((V) => !P.current.includes(V)), et = F.filter((V) => P.current.includes(V)), Se = P.current.map((V) => !F.includes(V));
1288
+ for (let V = Se.length - 1; V >= 0; V--) {
1289
+ var I;
1290
+ Se[V] && ((I = M.current) != null && I.removeView(V), Oe.splice(V, 1), w.current.splice(V, 1));
1291
+ }
1292
+ for (const V of Xe) {
1293
+ var W, ne, X, q, ee;
1294
+ const A = l.current.get(V), se = new Ar(ue.current, lr({
1295
+ element: document.createElement("div"),
1296
+ minimumSize: (W = A == null ? void 0 : A.minSize) != null ? W : f,
1297
+ maximumSize: (ne = A == null ? void 0 : A.maxSize) != null ? ne : s,
1298
+ priority: (X = A == null ? void 0 : A.priority) != null ? X : ut.Normal
1299
+ }, (A == null ? void 0 : A.preferredSize) && {
1300
+ preferredSize: A == null ? void 0 : A.preferredSize
1301
+ }, {
1302
+ snap: (q = A == null ? void 0 : A.snap) != null ? q : u
1303
+ }));
1304
+ (ee = M.current) != null && ee.addView(K.current.get(V), se, fr.Distribute, F.findIndex((Q) => Q === V)), Oe.splice(F.findIndex((Q) => Q === V), 0, V), w.current.splice(F.findIndex((Q) => Q === V), 0, se);
1305
+ }
1306
+ for (; !ln(F, Oe); ) for (const [V, A] of F.entries()) {
1307
+ const se = Oe.findIndex((Q) => Q === A);
1308
+ if (se !== V) {
1309
+ var fe;
1310
+ (fe = M.current) == null || fe.moveView(K.current.get(A), se, V);
1311
+ const Q = Oe[se];
1312
+ Oe.splice(se, 1), Oe.splice(V, 0, Q);
1313
+ break;
1314
+ }
1315
+ }
1316
+ for (const V of Xe) {
1317
+ var We;
1318
+ const A = F.findIndex((Q) => Q === V), se = w.current[A].preferredSize;
1319
+ se !== void 0 && ((We = M.current) == null || We.resizeView(A, se));
1320
+ }
1321
+ for (const V of [...Xe, ...et]) {
1322
+ var $e, ce;
1323
+ const A = l.current.get(V), se = F.findIndex((Q) => Q === V);
1324
+ A && Br(A) && A.visible !== void 0 && (($e = M.current) == null ? void 0 : $e.isViewVisible(se)) !== A.visible && ((ce = M.current) == null || ce.setViewVisible(se, A.visible));
1325
+ }
1326
+ for (const V of et) {
1327
+ const A = l.current.get(V), se = F.findIndex((Q) => Q === V);
1328
+ if (A && Br(A)) {
1329
+ var Ae;
1330
+ A.preferredSize !== void 0 && w.current[se].preferredSize !== A.preferredSize && (w.current[se].preferredSize = A.preferredSize);
1331
+ let Q = !1;
1332
+ A.minSize !== void 0 && w.current[se].minimumSize !== A.minSize && (w.current[se].minimumSize = A.minSize, Q = !0), A.maxSize !== void 0 && w.current[se].maximumSize !== A.maxSize && (w.current[se].maximumSize = A.maxSize, Q = !0), Q && ((Ae = M.current) == null || Ae.layout());
1333
+ }
1334
+ }
1335
+ (Xe.length > 0 || Se.length > 0) && (P.current = F);
1336
+ }
1337
+ }, [ie, Z, s, f, u]), window.React.useEffect(() => {
1338
+ M.current && (M.current.onDidChange = p);
1339
+ }, [p]), window.React.useEffect(() => {
1340
+ M.current && (M.current.onDidDragStart = b);
1341
+ }, [b]), window.React.useEffect(() => {
1342
+ M.current && (M.current.onDidDragEnd = j);
1343
+ }, [j]), un({
1344
+ ref: S,
1345
+ onResize: ({
1346
+ width: I,
1347
+ height: W
1348
+ }) => {
1349
+ var ne;
1350
+ I && W && ((ne = M.current) != null && ne.layout(d ? W : I), ue.current.setSize(d ? W : I), Me(!0));
1351
+ }
1352
+ }), window.React.useEffect(() => {
1353
+ Jr && Cn(20);
1354
+ }, []), window.React.createElement("div", {
1355
+ ref: S,
1356
+ className: Sr("split-view", d ? "split-view-vertical" : "split-view-horizontal", {
1357
+ "split-view-separator-border": E
1358
+ }, cn, d ? fn : hn, {
1359
+ [wn]: E
1360
+ }, t),
1361
+ id: n
1362
+ }, window.React.createElement("div", {
1363
+ className: Sr("split-view-container", pn)
1364
+ }, window.React.Children.toArray(e).map((I) => {
1365
+ if (!window.React.isValidElement(I)) return null;
1366
+ const W = I.key;
1367
+ return I.type.displayName === "Allotment.Pane" ? (l.current.set(W, I.props), window.React.cloneElement(I, {
1368
+ key: W,
1369
+ ref: (ne) => {
1370
+ const X = I.ref;
1371
+ X && (X.current = ne), ne ? K.current.set(W, ne) : K.current.delete(W);
1372
+ }
1373
+ })) : window.React.createElement(yr, {
1374
+ key: W,
1375
+ ref: (ne) => {
1376
+ ne ? K.current.set(W, ne) : K.current.delete(W);
1377
+ }
1378
+ }, I);
1379
+ })));
1380
+ });
1381
+ function Cn(e) {
1382
+ const t = zt(e, 4, 20), n = zt(e, 1, 8);
1383
+ document.documentElement.style.setProperty("--sash-size", t + "px"), document.documentElement.style.setProperty("--sash-hover-size", n + "px"), (function(s) {
1384
+ Zr = s, qr.emit("onDidChangeGlobalSize", s);
1385
+ })(t);
1386
+ }
1387
+ Kr.displayName = "Allotment";
1388
+ var Dn = Object.assign(Kr, {
1389
+ Pane: yr
1390
+ });
1391
+ (function() {
1392
+ try {
1393
+ if (typeof document < "u") {
1394
+ var e = document.createElement("style");
1395
+ e.appendChild(document.createTextNode('.grid-drag-resize{display:grid}.grid-drag-resize--dropping{background-color:#d8e9f666}.grid-drag-resize__item{position:relative}.grid-drag-resize__item--draggable-full{cursor:move;-webkit-user-select:none;user-select:none}.grid-drag-resize__item--dragging{opacity:.6}.grid-drag-resize__item--shadow{background-color:#bacbd74d}.grid-drag-resize__item--resizing>.grid-drag-resize__item__adjust{display:block}.grid-drag-resize__item--resizing>.grid-drag-resize__item__remove{transform:translate(-14px)}.grid-drag-resize__item--resizing>.grid-drag-resize__item__drop{transform:translate(-16px)}.grid-drag-resize__item__group{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%}.grid-drag-resize__item__mask{position:absolute;z-index:2;top:0;left:0;width:100%;height:100%;-webkit-user-select:none;user-select:none}.grid-drag-resize__item__border{display:none;position:absolute;z-index:3;background-color:#71c4ef}.grid-drag-resize__item__border--top{top:0;width:100%;height:2px}.grid-drag-resize__item__border--right{right:0;width:2px;height:100%}.grid-drag-resize__item__border--bottom{bottom:0;width:100%;height:2px}.grid-drag-resize__item__border--left{left:0;width:2px;height:100%}.grid-drag-resize__item--selected>.grid-drag-resize__item__border{display:block}.grid-drag-resize__item__adjust{display:none;position:absolute;z-index:4;width:10px;height:10px;border:1px solid #666;background-color:#fff;box-shadow:1px 1px 2px #0003}.grid-drag-resize__item__adjust--top{left:calc(50% - 5px);cursor:ns-resize}.grid-drag-resize__item__adjust--right{top:calc(50% - 5px);cursor:ew-resize}.grid-drag-resize__item__adjust--bottom{left:calc(50% - 5px);cursor:ns-resize}.grid-drag-resize__item__adjust--left{top:calc(50% - 5px);cursor:ew-resize}.grid-drag-resize__item__adjust--top-left{cursor:nwse-resize}.grid-drag-resize__item__adjust--top-right,.grid-drag-resize__item__adjust--bottom-left{cursor:nesw-resize}.grid-drag-resize__item__adjust--bottom-right{cursor:nwse-resize}.grid-drag-resize__item__remove{position:absolute;z-index:5;top:0;right:0;width:0;height:0;overflow:hidden;transition:transform .3s ease-in-out;border:0 solid rgba(255,0,0,.6);border-radius:50%;opacity:.8;background-color:#fff;box-shadow:0 0 2px #0003;cursor:pointer}.grid-drag-resize__item__remove:hover{opacity:1}.grid-drag-resize__item__remove:before,.grid-drag-resize__item__remove:after{content:"";display:block;position:absolute;top:5px;left:1px;width:9px;height:1px;transform-origin:center;background-color:#f009}.grid-drag-resize__item__remove:before{transform:rotate(-45deg)}.grid-drag-resize__item__remove:after{transform:rotate(45deg)}.grid-drag-resize__item__drop{position:absolute;z-index:5;left:calc(50% - 9px);width:0;height:0;overflow:hidden;transition:transform .3s ease-in-out;border:0 solid #666;border-radius:50%;opacity:.8;background-color:#fff;cursor:grab}.grid-drag-resize__item__drop:hover{opacity:1}.grid-drag-resize__item--hover>.grid-drag-resize__item__remove{width:13px;height:13px;border-width:1px}.grid-drag-resize__item--hover>.grid-drag-resize__item__drop{width:18px;height:18px;border-width:1px}.grid-drag-resize--sub{min-width:100%;min-height:100%}')), document.head.appendChild(e);
1396
+ }
1397
+ } catch (t) {
1398
+ console.error("vite-plugin-css-injected-by-js", t);
1399
+ }
1400
+ })();
1401
+ var Qr = { exports: {} }, ar = {};
1402
+ /**
1403
+ * @license React
1404
+ * react-jsx-runtime.production.min.js
1405
+ *
1406
+ * Copyright (c) Facebook, Inc. and its affiliates.
1407
+ *
1408
+ * This source code is licensed under the MIT license found in the
1409
+ * LICENSE file in the root directory of this source tree.
1410
+ */
1411
+ var Fr;
1412
+ function Pn() {
1413
+ if (Fr) return ar;
1414
+ Fr = 1;
1415
+ var e = window.React, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, f = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, _ = { key: !0, ref: !0, __self: !0, __source: !0 };
1416
+ function E(g, i, u) {
1417
+ var d, p = {}, y = null, R = null;
1418
+ u !== void 0 && (y = "" + u), i.key !== void 0 && (y = "" + i.key), i.ref !== void 0 && (R = i.ref);
1419
+ for (d in i) s.call(i, d) && !_.hasOwnProperty(d) && (p[d] = i[d]);
1420
+ if (g && g.defaultProps) for (d in i = g.defaultProps, i) p[d] === void 0 && (p[d] = i[d]);
1421
+ return { $$typeof: t, type: g, key: y, ref: R, props: p, _owner: f.current };
1422
+ }
1423
+ return ar.Fragment = n, ar.jsx = E, ar.jsxs = E, ar;
1424
+ }
1425
+ Qr.exports = Pn();
1426
+ var Ie = Qr.exports;
1427
+ const hr = window.React.createContext(void 0);
1428
+ function Yr(e) {
1429
+ var t, n, s, f, _, E, g, i, u, d, p, y, R, b, j, N, S, P, l, M, K, ue, w, Z, Me, ie, Ye;
1430
+ const I = window.React.useContext(hr), W = window.React.useRef(1), ne = window.React.useRef(1), X = window.React.useRef(1), q = window.React.useRef(2), ee = window.React.useRef(1), fe = window.React.useRef(2), We = window.React.useRef(), $e = window.React.useRef(), ce = window.React.useRef(), Ae = window.React.useRef(), F = window.React.useRef(), Oe = window.React.useRef(), Xe = window.React.useRef(), et = window.React.useRef(), Se = window.React.useRef(), V = window.React.useRef(), A = window.React.useRef(), se = window.React.useRef(), Q = window.React.useRef(), Dt = window.React.useRef(), De = window.React.useRef(), he = window.React.useRef(), Xt = window.React.useRef();
1431
+ window.React.useEffect(() => {
1432
+ var c, O, He, Je, ot, U, T, _e, de, je, oe;
1433
+ W.current = e.columns || 1, ne.current = e.rows || 1, X.current = (e.columnStart ?? 0) < 1 ? 1 : e.columnStart, q.current = (e.columnEnd ?? 0) < 2 ? 2 : e.columnEnd, ee.current = (e.rowStart ?? 0) < 1 ? 1 : e.rowStart, fe.current = (e.rowEnd ?? 0) < 2 ? 2 : e.rowEnd, Se.current = e.mask ?? !1, We.current = e.dragHandler || ((c = e.parentProps) == null ? void 0 : c.dragHandler), $e.current = e.dropOutHandler || ((O = e.parentProps) == null ? void 0 : O.dropOutHandler), ce.current = e.removeHandler || ((He = e.parentProps) == null ? void 0 : He.removeHandler), Ae.current = e.overflow || ((Je = e.parentProps) == null ? void 0 : Je.overflow), F.current = e.readonly ?? ((ot = e.parentProps) == null ? void 0 : ot.readonly), Oe.current = F.current ? !1 : e.draggable ?? ((U = e.parentProps) == null ? void 0 : U.draggable), Q.current = Oe.current ?? !0, Xe.current = F.current ? !1 : e.resizable ?? ((T = e.parentProps) == null ? void 0 : T.resizable), Dt.current = Xe.current ?? !0, et.current = F.current ? !1 : e.removable ?? ((_e = e.parentProps) == null ? void 0 : _e.removable), De.current = et.current ?? !0, Se.current = e.mask ?? ((de = e.parentProps) == null ? void 0 : de.mask), he.current = Se.current ?? !1, V.current = F.current ? !1 : e.droppableOut ?? ((je = e.parentProps) == null ? void 0 : je.droppableOut), Xt.current = V.current ?? !0, A.current = e.debug ?? ((oe = e.parentProps) == null ? void 0 : oe.debug), se.current = { ...e.parentProps };
1434
+ }, [e]);
1435
+ const [Ot, dt] = window.React.useState(
1436
+ Xt.current
1437
+ ), [pt, nr] = window.React.useState($e.current), [kt, Ge] = window.React.useState(ce.current), [rt, Vt] = window.React.useState(De.current), [Ut, ae] = window.React.useState(Ae.current), [Ke, St] = window.React.useState(We.current), [ve, Re] = window.React.useState(Q.current), [Tt, It] = window.React.useState(X.current), [Rt, ft] = window.React.useState(q.current), [Ne, Ce] = window.React.useState(ee.current), [nt, ht] = window.React.useState(fe.current), [Le, Ct] = window.React.useState(ne.current), [wt, ke] = window.React.useState(W.current), [Ht, Qe] = window.React.useState(he.current);
1438
+ window.React.useEffect(() => {
1439
+ dt(V.current ?? !0);
1440
+ }, [e.droppableOut, (t = e.parentProps) == null ? void 0 : t.droppableOut]), window.React.useEffect(() => {
1441
+ nr($e.current);
1442
+ }, [e.dropOutHandler, (n = e.parentProps) == null ? void 0 : n.dropOutHandler]), window.React.useEffect(() => {
1443
+ Ge(ce.current);
1444
+ }, [e.removeHandler, (s = e.parentProps) == null ? void 0 : s.removeHandler]), window.React.useEffect(() => {
1445
+ Vt(et.current ?? !0);
1446
+ }, [e.removable, (f = e.parentProps) == null ? void 0 : f.removable]), window.React.useEffect(() => {
1447
+ Qe(Se.current ?? !1);
1448
+ }, [e.mask, (_ = e.parentProps) == null ? void 0 : _.mask]), window.React.useEffect(() => {
1449
+ ae(Ae.current);
1450
+ }, [e.overflow, (E = e.parentProps) == null ? void 0 : E.overflow]), window.React.useEffect(() => {
1451
+ St(We.current);
1452
+ }, [e.dragHandler, (g = e.parentProps) == null ? void 0 : g.dragHandler]), window.React.useEffect(() => {
1453
+ Re(Oe.current ?? !0);
1454
+ }, [e.draggable, (i = e.parentProps) == null ? void 0 : i.draggable]), window.React.useEffect(() => {
1455
+ It(X.current);
1456
+ }, [e.columnStart]), window.React.useEffect(() => {
1457
+ ft(q.current);
1458
+ }, [e.columnEnd]), window.React.useEffect(() => {
1459
+ Ce(ee.current);
1460
+ }, [e.rowStart]), window.React.useEffect(() => {
1461
+ ht(fe.current);
1462
+ }, [e.rowEnd]), window.React.useEffect(() => {
1463
+ Ct(ne.current);
1464
+ }, [e.rows]), window.React.useEffect(() => {
1465
+ ke(W.current);
1466
+ }, [e.columns]);
1467
+ const ge = window.React.useRef(null), [Pt, $t] = window.React.useState(ge.current), mt = window.React.useRef(null), [it, Ve] = window.React.useState(mt.current);
1468
+ window.React.useEffect(() => {
1469
+ $t(ge.current);
1470
+ }, []), window.React.useEffect(() => {
1471
+ Ve(mt.current);
1472
+ }, [Ht]);
1473
+ const [vt, Ue] = window.React.useState(se.current), Jt = window.React.useRef({ ...se.current });
1474
+ window.React.useEffect(() => {
1475
+ Jt.current = {
1476
+ ...se.current,
1477
+ //
1478
+ dragHandler: We.current,
1479
+ dropOutHandler: $e.current,
1480
+ removeHandler: ce.current,
1481
+ overflow: Ae.current,
1482
+ //
1483
+ readonly: F.current,
1484
+ //
1485
+ draggable: Oe.current,
1486
+ resizable: Xe.current,
1487
+ removable: et.current,
1488
+ mask: Se.current,
1489
+ droppableIn: e.droppableIn,
1490
+ droppableOut: V.current,
1491
+ //
1492
+ debug: A.current
1493
+ }, Ue(Jt.current);
1494
+ }, [
1495
+ e.dragHandler,
1496
+ (u = e.parentProps) == null ? void 0 : u.dragHandler,
1497
+ e.dropOutHandler,
1498
+ (d = e.parentProps) == null ? void 0 : d.dropOutHandler,
1499
+ e.removeHandler,
1500
+ (p = e.parentProps) == null ? void 0 : p.removeHandler,
1501
+ e.overflow,
1502
+ (y = e.parentProps) == null ? void 0 : y.overflow,
1503
+ e.readonly,
1504
+ (R = e.parentProps) == null ? void 0 : R.readonly,
1505
+ e.draggable,
1506
+ (b = e.parentProps) == null ? void 0 : b.draggable,
1507
+ e.resizable,
1508
+ (j = e.parentProps) == null ? void 0 : j.resizable,
1509
+ e.removable,
1510
+ (N = e.parentProps) == null ? void 0 : N.removable,
1511
+ e.mask,
1512
+ (S = e.parentProps) == null ? void 0 : S.mask,
1513
+ e.droppableIn,
1514
+ (P = e.parentProps) == null ? void 0 : P.droppableIn,
1515
+ e.droppableOut,
1516
+ (l = e.parentProps) == null ? void 0 : l.droppableOut,
1517
+ e.debug,
1518
+ (M = e.parentProps) == null ? void 0 : M.debug
1519
+ ]), A.current && console.log(Jt);
1520
+ const [Pe, gt] = window.React.useState(((K = e.parentProps) == null ? void 0 : K.gap) ?? 0);
1521
+ window.React.useEffect(() => {
1522
+ var c;
1523
+ const O = ((c = e.parentProps) == null ? void 0 : c.gap) ?? 0;
1524
+ gt(O < 5 ? O : 5);
1525
+ }, [(ue = e.parentProps) == null ? void 0 : ue.gap]);
1526
+ const [Zt, jt] = window.React.useState(((w = e.parentProps) == null ? void 0 : w.gap) ?? 0);
1527
+ window.React.useEffect(() => {
1528
+ var c;
1529
+ const O = ((c = e.parentProps) == null ? void 0 : c.gap) ?? 0;
1530
+ jt(O < 6.5 ? O : 6.5);
1531
+ }, [(Z = e.parentProps) == null ? void 0 : Z.gap]);
1532
+ const [At, Bt] = window.React.useState(((Me = e.parentProps) == null ? void 0 : Me.gap) ?? 0);
1533
+ window.React.useEffect(() => {
1534
+ var c;
1535
+ const O = ((c = e.parentProps) == null ? void 0 : c.gap) ?? 0;
1536
+ Bt(O < 8 ? O : 8);
1537
+ }, [(ie = e.parentProps) == null ? void 0 : ie.gap]);
1538
+ const [st, ye] = window.React.useState(I == null ? void 0 : I.state.hoverEle), [yt, Ft] = window.React.useState(st === Pt);
1539
+ window.React.useEffect(() => {
1540
+ Ft(
1541
+ st !== void 0 && (st === Pt || st === it)
1542
+ );
1543
+ }, [st, Pt, it]), window.React.useEffect(() => {
1544
+ ye(I == null ? void 0 : I.state.hoverEle);
1545
+ }, [I == null ? void 0 : I.state.hoverEle]);
1546
+ const Mt = window.React.useMemo(() => ({
1547
+ gridColumnStart: Tt ?? "",
1548
+ gridColumnEnd: Rt ?? "",
1549
+ gridRowStart: Ne ?? "",
1550
+ gridRowEnd: nt ?? ""
1551
+ }), [Tt, Rt, Ne, nt]);
1552
+ window.React.useEffect(() => {
1553
+ var c;
1554
+ e.rows !== Le && ((c = e.updateRows) == null || c.call(e, Le));
1555
+ }, [e, Le]), window.React.useEffect(() => {
1556
+ var c;
1557
+ e.columns !== wt && ((c = e.updateColumns) == null || c.call(e, wt));
1558
+ }, [e, wt]), window.React.useEffect(() => {
1559
+ var c, O, He, Je, ot, U;
1560
+ let T = e.columnStart ?? 0, _e = e.columnEnd ?? 0, de = e.columns ?? 0, je = e.rowStart ?? 0, oe = e.rowEnd ?? 0, xe = e.rows ?? 0;
1561
+ (T < 1 && _e < 1 || T > 0 && _e > 0 && _e <= T) && (T = 0, _e = 0), de < 1 && (de = 1), (je < 1 && oe < 1 || oe <= je && je > 0 && oe > 1) && (je = 0, oe = 0), xe < 1 && (xe = 1), T < 1 && _e < 1 && je < 1 && oe < 1 || (T < 1 && (T = 1), _e < T && (de < 1 ? _e = T + 1 : _e = T + de), je < 1 && (je = 1), oe < je && (xe < 1 ? oe = je + 1 : oe = je + xe), (de < 1 || de < _e - T) && T !== void 0 && _e !== void 0 && (de = _e - T), (xe < 1 || xe < oe - je) && oe !== void 0 && je !== void 0 && (xe = oe - je)), (c = e.updateColumnStart) == null || c.call(e, T), (O = e.updateColumnEnd) == null || O.call(e, _e), (He = e.updateColumns) == null || He.call(e, de), (Je = e.updateRowStart) == null || Je.call(e, je), (ot = e.updateRowEnd) == null || ot.call(e, oe), (U = e.updateRows) == null || U.call(e, xe);
1562
+ }, [e]);
1563
+ const r = window.React.useCallback(
1564
+ (c) => {
1565
+ var O, He;
1566
+ Q.current && ((He = e.startDrag) == null || He.call(e, {
1567
+ event: c,
1568
+ rect: ((O = ge == null ? void 0 : ge.current) == null ? void 0 : O.getBoundingClientRect()) ?? {
1569
+ height: 0,
1570
+ width: 0,
1571
+ x: 0,
1572
+ y: 0,
1573
+ bottom: 0,
1574
+ right: 0
1575
+ }
1576
+ }));
1577
+ },
1578
+ [e]
1579
+ ), a = window.React.useCallback(() => {
1580
+ var c;
1581
+ (c = e.dropEnd) == null || c.call(e);
1582
+ }, [e]), v = window.React.useCallback(() => {
1583
+ var c;
1584
+ (c = e.dropStart) == null || c.call(e, {
1585
+ ele: ge.current,
1586
+ remove: () => {
1587
+ var O;
1588
+ De.current && ((O = e.remove) == null || O.call(e));
1589
+ }
1590
+ });
1591
+ }, [e]), C = window.React.useCallback(
1592
+ (c) => {
1593
+ var O;
1594
+ c.stopPropagation(), (O = e.remove) == null || O.call(e);
1595
+ },
1596
+ [e]
1597
+ );
1598
+ window.React.useEffect(() => {
1599
+ if (ve && Ke && ge.current) {
1600
+ const c = ge.current.querySelector(Ke);
1601
+ c instanceof HTMLElement && (c.style.cursor = "move", c.addEventListener("mousedown", r));
1602
+ }
1603
+ return () => {
1604
+ window.removeEventListener("mousedown", r);
1605
+ };
1606
+ }, [ve, Ke, r]);
1607
+ const te = window.React.useRef(), B = window.React.useRef(), le = window.React.useRef(), we = window.React.useRef(), Be = window.React.useRef();
1608
+ window.React.useEffect(() => {
1609
+ if (Ot && pt && ge.current) {
1610
+ const c = ge.current.querySelector(pt);
1611
+ c instanceof HTMLElement && (c.style.cursor = "grab", c.setAttribute("draggable", "true"), te.current && c.removeEventListener("mousedown", te.current), B.current && c.removeEventListener("mousemove", B.current), le.current && c.removeEventListener("mouseup", le.current), we.current && c.removeEventListener("dragstart", we.current), Be.current && c.removeEventListener("dragend", Be.current), te.current = (O) => {
1612
+ O.stopPropagation(), v();
1613
+ }, c.addEventListener("mousedown", te.current), B.current = (O) => {
1614
+ O.stopPropagation();
1615
+ }, c.addEventListener("mousemove", B.current), le.current = (O) => {
1616
+ O.stopPropagation();
1617
+ }, c.addEventListener("mouseup", le.current), we.current = (O) => {
1618
+ O.stopPropagation();
1619
+ }, c.addEventListener("dragstart", we.current), Be.current = (O) => {
1620
+ O.stopPropagation(), a();
1621
+ }, c.addEventListener("dragend", Be.current));
1622
+ }
1623
+ }, [pt, Ot, a, v]);
1624
+ const re = window.React.useRef(), me = window.React.useRef(), Fe = window.React.useRef(), Te = window.React.useRef();
1625
+ window.React.useEffect(() => {
1626
+ if (rt && kt && ge.current) {
1627
+ const c = ge.current.querySelector(kt);
1628
+ c instanceof HTMLElement && (c.style.cursor = "pointer", re.current && c.removeEventListener("click", re.current), me.current && c.removeEventListener("mousedown", me.current), Fe.current && c.removeEventListener("mousemove", Fe.current), Te.current && c.removeEventListener("mouseup", Te.current), re.current = (O) => {
1629
+ C(O);
1630
+ }, c.addEventListener("click", re.current), me.current = (O) => {
1631
+ O.stopPropagation();
1632
+ }, c.addEventListener("mousedown", me.current), Fe.current = (O) => {
1633
+ O.stopPropagation();
1634
+ }, c.addEventListener("mousemove", Fe.current), Te.current = (O) => {
1635
+ O.stopPropagation();
1636
+ }, c.addEventListener("mouseup", Te.current));
1637
+ }
1638
+ }, [rt, kt, C]);
1639
+ const be = window.React.useCallback(
1640
+ (c) => {
1641
+ var O, He;
1642
+ F.current || (c.stopPropagation(), (O = e.select) == null || O.call(e)), Dt.current && (c.stopPropagation(), (He = e.selectResizing) == null || He.call(e));
1643
+ },
1644
+ [e]
1645
+ ), ze = window.React.useCallback(
1646
+ (c, O) => {
1647
+ var He, Je;
1648
+ Dt.current && (c.stopPropagation(), (Je = e.startResize) == null || Je.call(e, {
1649
+ event: c,
1650
+ rect: ((He = ge == null ? void 0 : ge.current) == null ? void 0 : He.getBoundingClientRect()) ?? {
1651
+ height: 0,
1652
+ width: 0,
1653
+ x: 0,
1654
+ y: 0,
1655
+ bottom: 0,
1656
+ right: 0
1657
+ },
1658
+ cursor: c.target instanceof HTMLElement ? getComputedStyle(c.target).cursor : "",
1659
+ direction: O
1660
+ }));
1661
+ },
1662
+ [e]
1663
+ ), _t = window.React.useCallback(
1664
+ (c) => {
1665
+ c.currentTarget instanceof HTMLElement && I && (I.state.hoverEle = c.currentTarget, I.setState({ ...I.state }));
1666
+ },
1667
+ [I]
1668
+ ), bt = window.React.useCallback(() => {
1669
+ I && (I.state.hoverEle = void 0, I.setState({ ...I.state }));
1670
+ }, [I]);
1671
+ return /* @__PURE__ */ Ie.jsxs(
1672
+ "div",
1673
+ {
1674
+ className: `grid-drag-resize__item ${[
1675
+ ...ve ? ["grid-drag-resize__item--draggable"] : [],
1676
+ ...ve && !Ke ? ["grid-drag-resize__item--draggable-full"] : [],
1677
+ ...yt && !(I != null && I.state.dragging) && !(I != null && I.state.resizing) ? ["grid-drag-resize__item--hover"] : [],
1678
+ ...e.className ? [e.className] : []
1679
+ ].join(" ")}`,
1680
+ style: { ...e.style, ...Mt },
1681
+ onMouseDown: (c) => Ke ? void 0 : r(c),
1682
+ onClick: be,
1683
+ onMouseOverCapture: _t,
1684
+ onMouseLeave: bt,
1685
+ ref: ge,
1686
+ children: [
1687
+ /* @__PURE__ */ Ie.jsx("div", { className: "grid-drag-resize__item__group", style: { overflow: Ut }, children: e.grid ? /* @__PURE__ */ Ie.jsx(
1688
+ Ln,
1689
+ {
1690
+ ...e.grid,
1691
+ droppingChild: I == null ? void 0 : I.state.droppingChild,
1692
+ parentProps: vt,
1693
+ updateCells: () => {
1694
+ var c;
1695
+ return (c = vt == null ? void 0 : vt.updateCells) == null ? void 0 : c.call(vt, [...(vt == null ? void 0 : vt.cells) ?? []]);
1696
+ }
1697
+ }
1698
+ ) : (Ye = e.render) == null ? void 0 : Ye.call(e, e) }),
1699
+ Ht && /* @__PURE__ */ Ie.jsx(
1700
+ "div",
1701
+ {
1702
+ className: "grid-drag-resize__item__mask",
1703
+ onMouseDown: (c) => Ke ? void 0 : r(c),
1704
+ onClick: be,
1705
+ onMouseOverCapture: _t,
1706
+ onMouseLeave: bt,
1707
+ ref: mt
1708
+ }
1709
+ ),
1710
+ /* @__PURE__ */ Ie.jsx("b", { className: "grid-drag-resize__item__border grid-drag-resize__item__border--top" }),
1711
+ /* @__PURE__ */ Ie.jsx("b", { className: "grid-drag-resize__item__border grid-drag-resize__item__border--bottom" }),
1712
+ /* @__PURE__ */ Ie.jsx("b", { className: "grid-drag-resize__item__border grid-drag-resize__item__border--left" }),
1713
+ /* @__PURE__ */ Ie.jsx("b", { className: "grid-drag-resize__item__border grid-drag-resize__item__border--right" }),
1714
+ /* @__PURE__ */ Ie.jsx(
1715
+ "i",
1716
+ {
1717
+ className: "grid-drag-resize__item__adjust grid-drag-resize__item__adjust--top",
1718
+ style: { top: `${-Pe}px` },
1719
+ onMouseDown: (c) => ze(c, "top")
1720
+ }
1721
+ ),
1722
+ /* @__PURE__ */ Ie.jsx(
1723
+ "i",
1724
+ {
1725
+ className: "grid-drag-resize__item__adjust grid-drag-resize__item__adjust--right",
1726
+ style: { right: `${-Pe}px` },
1727
+ onMouseDown: (c) => ze(c, "right")
1728
+ }
1729
+ ),
1730
+ /* @__PURE__ */ Ie.jsx(
1731
+ "i",
1732
+ {
1733
+ className: "grid-drag-resize__item__adjust grid-drag-resize__item__adjust--bottom",
1734
+ style: { bottom: `${-Pe}px` },
1735
+ onMouseDown: (c) => ze(c, "bottom")
1736
+ }
1737
+ ),
1738
+ /* @__PURE__ */ Ie.jsx(
1739
+ "i",
1740
+ {
1741
+ className: "grid-drag-resize__item__adjust grid-drag-resize__item__adjust--left",
1742
+ style: { left: `${-Pe}px` },
1743
+ onMouseDown: (c) => ze(c, "left")
1744
+ }
1745
+ ),
1746
+ /* @__PURE__ */ Ie.jsx(
1747
+ "i",
1748
+ {
1749
+ className: "grid-drag-resize__item__adjust grid-drag-resize__item__adjust--top-left",
1750
+ style: { top: `${-Pe}px`, left: `${-Pe}px` },
1751
+ onMouseDown: (c) => ze(c, "top-left")
1752
+ }
1753
+ ),
1754
+ /* @__PURE__ */ Ie.jsx(
1755
+ "i",
1756
+ {
1757
+ className: "grid-drag-resize__item__adjust grid-drag-resize__item__adjust--top-right",
1758
+ style: { top: `${-Pe}px`, right: `${-Pe}px` },
1759
+ onMouseDown: (c) => ze(c, "top-right")
1760
+ }
1761
+ ),
1762
+ /* @__PURE__ */ Ie.jsx(
1763
+ "i",
1764
+ {
1765
+ className: "grid-drag-resize__item__adjust grid-drag-resize__item__adjust--bottom-left",
1766
+ style: { bottom: `${-Pe}px`, left: `${-Pe}px` },
1767
+ onMouseDown: (c) => ze(c, "bottom-left")
1768
+ }
1769
+ ),
1770
+ /* @__PURE__ */ Ie.jsx(
1771
+ "i",
1772
+ {
1773
+ className: "grid-drag-resize__item__adjust grid-drag-resize__item__adjust--bottom-right",
1774
+ style: { bottom: `${-Pe}px`, right: `${-Pe}px` },
1775
+ onMouseDown: (c) => ze(c, "bottom-right")
1776
+ }
1777
+ ),
1778
+ rt && !kt && /* @__PURE__ */ Ie.jsx(
1779
+ "span",
1780
+ {
1781
+ className: "grid-drag-resize__item__remove",
1782
+ style: { top: `${-Zt}px`, right: `${-Zt}px` },
1783
+ onClick: C,
1784
+ onMouseDown: (c) => c.stopPropagation(),
1785
+ onMouseMove: (c) => c.stopPropagation(),
1786
+ onMouseUp: (c) => c.stopPropagation()
1787
+ }
1788
+ ),
1789
+ Ot && !pt && /* @__PURE__ */ Ie.jsx(
1790
+ "div",
1791
+ {
1792
+ className: "grid-drag-resize__item__drop",
1793
+ style: { top: Ot ? `${-At}px` : "" },
1794
+ draggable: "true",
1795
+ onMouseDown: (c) => {
1796
+ c.stopPropagation(), v();
1797
+ },
1798
+ onMouseMove: (c) => c.stopPropagation(),
1799
+ onMouseUp: (c) => c.stopPropagation(),
1800
+ onDragStart: (c) => c.stopPropagation(),
1801
+ onDragEnd: (c) => c.stopPropagation()
1802
+ }
1803
+ )
1804
+ ]
1805
+ }
1806
+ );
1807
+ }
1808
+ let jn = 0;
1809
+ const zr = /* @__PURE__ */ new Map();
1810
+ function Mn(e) {
1811
+ if (zr.has(e))
1812
+ return zr.get(e);
1813
+ {
1814
+ const t = ++jn;
1815
+ return zr.set(e, t), t;
1816
+ }
1817
+ }
1818
+ function Nn(e) {
1819
+ var t, n, s, f, _, E, g, i, u, d, p, y, R, b, j, N, S, P;
1820
+ const l = window.React.useContext(hr), M = window.React.useMemo(() => e.parentProps !== void 0, [e.parentProps]), K = window.React.useRef(1), ue = window.React.useRef(1), w = window.React.useRef(0), Z = window.React.useRef(), Me = window.React.useRef(), ie = window.React.useRef(), Ye = window.React.useRef(), I = window.React.useRef(), W = window.React.useRef(), ne = window.React.useRef(), X = window.React.useRef(), q = window.React.useRef(), ee = window.React.useRef(), fe = window.React.useRef(), We = window.React.useRef(), $e = window.React.useRef(), ce = window.React.useRef(), Ae = window.React.useRef("div"), F = window.React.useRef(), Oe = window.React.useRef();
1821
+ window.React.useEffect(() => {
1822
+ var o, m, h, x, H, z, D, Y, G, J, k, L, $, pe, Ee;
1823
+ K.current = e.columns || 1, ue.current = e.rows || 1, w.current = e.gap || 0, Z.current = e.overflow || ((o = e.parentProps) == null ? void 0 : o.overflow), Me.current = e.dragHandler || ((m = e.parentProps) == null ? void 0 : m.dragHandler), ie.current = e.dropOutHandler || ((h = e.parentProps) == null ? void 0 : h.dropOutHandler), Ye.current = e.removeHandler || ((x = e.parentProps) == null ? void 0 : x.removeHandler), I.current = e.readonly ?? ((H = e.parentProps) == null ? void 0 : H.readonly), W.current = I.current ? !1 : e.draggable ?? ((z = e.parentProps) == null ? void 0 : z.draggable), ne.current = I.current ? !1 : e.resizable ?? ((D = e.parentProps) == null ? void 0 : D.resizable), X.current = I.current ? !1 : e.removable ?? ((Y = e.parentProps) == null ? void 0 : Y.removable), q.current = I.current ? !1 : e.droppableOut ?? ((G = e.parentProps) == null ? void 0 : G.droppableOut), ee.current = e.mask ?? ((J = e.parentProps) == null ? void 0 : J.mask), fe.current = e.debug ?? ((k = e.parentProps) == null ? void 0 : k.debug), We.current = I.current ? !1 : e.droppableIn ?? ((L = e.parentProps) == null ? void 0 : L.droppableIn), Oe.current = We.current ?? !0, $e.current = e.beforeDrop ?? (($ = e.parentProps) == null ? void 0 : $.beforeDrop), ce.current = e.suffixClass || ((pe = e.parentProps) == null ? void 0 : pe.suffixClass), Ae.current = e.tagName || ((Ee = e.parentProps) == null ? void 0 : Ee.tagName) || "div";
1824
+ }, [e]), window.React.useEffect(() => {
1825
+ F.current = l.state.droppingChild ?? e.droppingChild;
1826
+ }, [l.state.droppingChild, e.droppingChild]);
1827
+ const [Xe, et] = window.React.useState(Ae.current), [Se, V] = window.React.useState(F.current), [A, se] = window.React.useState(ce.current), [Q, Dt] = window.React.useState(w.current);
1828
+ window.React.useEffect(() => {
1829
+ et(Ae.current);
1830
+ }, [e.tagName, (t = e.parentProps) == null ? void 0 : t.tagName]), window.React.useEffect(() => {
1831
+ V(F.current);
1832
+ }, [e.droppingChild, l.state.droppingChild]), window.React.useEffect(() => {
1833
+ se(ce.current);
1834
+ }, [e.suffixClass]), window.React.useEffect(() => {
1835
+ Dt(w.current);
1836
+ }, [e.gap]);
1837
+ const De = window.React.useRef(null), [he, Xt] = window.React.useState(De.current);
1838
+ window.React.useEffect(() => {
1839
+ Xt(De.current);
1840
+ }, []);
1841
+ const [Ot, dt] = window.React.useState(), pt = window.React.useRef();
1842
+ window.React.useEffect(() => {
1843
+ pt.current = {
1844
+ ...e,
1845
+ //
1846
+ dragHandler: Me.current,
1847
+ dropOutHandler: ie.current,
1848
+ removeHandler: Ye.current,
1849
+ overflow: Z.current,
1850
+ //
1851
+ readonly: I.current,
1852
+ //
1853
+ draggable: W.current,
1854
+ resizable: ne.current,
1855
+ removable: X.current,
1856
+ droppableOut: q.current,
1857
+ mask: ee.current,
1858
+ //
1859
+ debug: fe.current,
1860
+ //
1861
+ droppableIn: We.current,
1862
+ //
1863
+ beforeDrop: $e.current,
1864
+ //
1865
+ suffixClass: ce.current,
1866
+ tagName: Ae.current
1867
+ }, dt(pt.current);
1868
+ }, [
1869
+ e.dragHandler,
1870
+ (n = e.parentProps) == null ? void 0 : n.dragHandler,
1871
+ e.dropOutHandler,
1872
+ (s = e.parentProps) == null ? void 0 : s.dropOutHandler,
1873
+ e.removeHandler,
1874
+ (f = e.parentProps) == null ? void 0 : f.removeHandler,
1875
+ e.overflow,
1876
+ (_ = e.parentProps) == null ? void 0 : _.overflow,
1877
+ e.readonly,
1878
+ (E = e.parentProps) == null ? void 0 : E.readonly,
1879
+ e.draggable,
1880
+ (g = e.parentProps) == null ? void 0 : g.draggable,
1881
+ e.resizable,
1882
+ (i = e.parentProps) == null ? void 0 : i.resizable,
1883
+ e.removable,
1884
+ (u = e.parentProps) == null ? void 0 : u.removable,
1885
+ e.droppableOut,
1886
+ (d = e.parentProps) == null ? void 0 : d.droppableOut,
1887
+ e.mask,
1888
+ (p = e.parentProps) == null ? void 0 : p.mask,
1889
+ e.debug,
1890
+ (y = e.parentProps) == null ? void 0 : y.debug,
1891
+ e.droppableIn,
1892
+ (R = e.parentProps) == null ? void 0 : R.droppableIn,
1893
+ e.beforeDrop,
1894
+ (b = e.parentProps) == null ? void 0 : b.beforeDrop,
1895
+ e.suffixClass,
1896
+ (j = e.parentProps) == null ? void 0 : j.suffixClass,
1897
+ e.tagName,
1898
+ (N = e.parentProps) == null ? void 0 : N.tagName
1899
+ ]), fe.current && console.log(pt);
1900
+ const [nr, kt] = window.React.useState({
1901
+ columnStart: 1,
1902
+ columnEnd: 2,
1903
+ rowStart: 1,
1904
+ rowEnd: 2
1905
+ });
1906
+ window.React.useEffect(() => {
1907
+ kt({
1908
+ columnStart: (Se == null ? void 0 : Se.columnStart) ?? 1,
1909
+ columnEnd: (Se == null ? void 0 : Se.columnEnd) ?? 2,
1910
+ rowStart: (Se == null ? void 0 : Se.rowStart) ?? 1,
1911
+ rowEnd: (Se == null ? void 0 : Se.rowEnd) ?? 2
1912
+ });
1913
+ }, [Se]);
1914
+ const [Ge, rt] = window.React.useState();
1915
+ window.React.useEffect(() => {
1916
+ var o, m;
1917
+ l.state.droppingChildRaw && he ? rt(
1918
+ ((o = e.cells) == null ? void 0 : o.includes(l.state.droppingChildRaw)) || ((m = l.state.droppingChildEle) == null ? void 0 : m.contains(he))
1919
+ ) : rt(!1);
1920
+ }, [l.state.droppingChildRaw, l.state.droppingChildEle, he, e.cells]);
1921
+ const [Vt, Ut] = window.React.useState(!1);
1922
+ window.React.useEffect(() => {
1923
+ Ut(l.state.droppingEle === he && !Ge);
1924
+ }, [l.state.droppingEle, he, Ge]);
1925
+ const ae = window.React.useRef(), [Ke, St] = window.React.useState(), ve = window.React.useRef(1), Re = window.React.useRef(1), [Tt, It] = window.React.useState(ue.current), [Rt, ft] = window.React.useState(K.current);
1926
+ window.React.useEffect(() => {
1927
+ ve.current = e.rows || 1, Re.current = e.columns || 1;
1928
+ }, [e.rows, e.columns]), window.React.useEffect(() => {
1929
+ It(ve.current), ft(Re.current);
1930
+ }, [e.rows, e.columns]);
1931
+ const Ne = window.React.useMemo(
1932
+ () => e.rowExpandable && !Ge,
1933
+ [e.rowExpandable, Ge]
1934
+ ), Ce = window.React.useMemo(
1935
+ () => e.columnExpandable && !Ge,
1936
+ [e.columnExpandable, Ge]
1937
+ ), nt = window.React.useMemo(() => ({
1938
+ gridTemplateColumns: wt(
1939
+ Rt,
1940
+ e.columnExpandable ?? !1,
1941
+ e.columnSize,
1942
+ e.columnTemplate
1943
+ ),
1944
+ gridTemplateRows: wt(
1945
+ Tt,
1946
+ e.rowExpandable ?? !1,
1947
+ e.rowSize,
1948
+ e.rowTemplate
1949
+ ),
1950
+ gridGap: Q > 0 ? `${Q}px ${Q}px` : ""
1951
+ }), [
1952
+ Rt,
1953
+ e.columnSize,
1954
+ e.rowSize,
1955
+ Tt,
1956
+ Q,
1957
+ e.columnTemplate,
1958
+ e.rowTemplate,
1959
+ Ce,
1960
+ Ne
1961
+ ]);
1962
+ window.React.useEffect(() => {
1963
+ l.state.droppingChild !== e.droppingChild && (l.state.droppingChild = { ...e.droppingChild }, l.setState({ ...l.state }));
1964
+ }, [e.droppingChild]);
1965
+ const ht = window.React.useCallback(() => {
1966
+ var o;
1967
+ (o = e.updateDroppingChild) == null || o.call(e, void 0), l.state.droppingChild = void 0, l.state.droppingChildEle = void 0, l.state.droppingChildRaw = void 0, l.state.droppingEle = void 0, l.state.droppingChildRemove = void 0, l.setState({ ...l.state });
1968
+ }, [l, e]), Le = window.React.useCallback(
1969
+ (o) => {
1970
+ o ? l.state.actionEle = De.current ?? void 0 : l.state.actionEle = void 0;
1971
+ },
1972
+ [l.state]
1973
+ );
1974
+ function Ct(o, m, h) {
1975
+ const x = re(o), H = m - x.length, z = Number.isInteger(h) ? `${h}px` : "1fr";
1976
+ return o + (H > 0 ? ` repeat(${H},${z})` : "");
1977
+ }
1978
+ function wt(o, m, h, x) {
1979
+ return x ? m ? Ct(x, o, h) : x : `repeat(${o},${Number.isInteger(h) ? `${h}px` : "1fr"})`;
1980
+ }
1981
+ const ke = window.React.useCallback(
1982
+ (o, m, h = []) => {
1983
+ const x = [...e.cells ?? [], ...h].reduce((H, z) => {
1984
+ const D = { rows: z.rowEnd, columns: z.columnEnd }[o];
1985
+ D && D > 1 && D - 1 > H && (H = D - 1);
1986
+ const Y = { rows: z.rows, columns: z.columns }[o] ?? 1;
1987
+ return Math.max(H, Y);
1988
+ }, 1);
1989
+ return m === void 0 || m < x ? x : m;
1990
+ },
1991
+ [e.cells]
1992
+ );
1993
+ window.React.useEffect(() => {
1994
+ var o, m;
1995
+ const h = ke(
1996
+ "rows",
1997
+ Math.max(ue.current, re(e.rowTemplate ?? "").length)
1998
+ );
1999
+ ve.current !== h && (ve.current = h, It(ve.current), (o = e.updateRows) == null || o.call(e, ve.current));
2000
+ const x = ke(
2001
+ "columns",
2002
+ Math.max(K.current, re(e.columnTemplate ?? "").length)
2003
+ );
2004
+ Re.current !== x && (Re.current = x, ft(Re.current), (m = e.updateColumns) == null || m.call(e, Re.current));
2005
+ }, [e, ke]), window.React.useEffect(() => {
2006
+ var o, m;
2007
+ const h = (o = e.cells) == null ? void 0 : o.find(
2008
+ (x) => [x.columns, x.columnStart, x.columnEnd, x.rows, x.rowStart, x.rowEnd].every(
2009
+ (H) => H !== void 0
2010
+ ) && x.columns > 0 && x.columnStart < 1 && x.columnEnd < 1 && x.rows > 0 && x.rowStart < 1 && x.rowEnd < 1
2011
+ );
2012
+ if (h && e.cells) {
2013
+ const x = e.cells.filter(
2014
+ (J) => [J.columnStart, J.columnEnd, J.rowStart, J.rowEnd].every((k) => k !== void 0) && J.columnEnd > J.columnStart && J.rowEnd > J.rowStart
2015
+ );
2016
+ let H = !0, z = 1, D = z + h.columns, Y = 1, G = Y + h.rows;
2017
+ for (; H; Y++)
2018
+ for (G = Y + h.rows, z = 1; z + h.columns <= Re.current + 1 && H; z++) {
2019
+ D = z + h.columns;
2020
+ let J = !1;
2021
+ for (const k of x)
2022
+ if (!(!(z >= k.columnStart && z < k.columnEnd || D > k.columnStart && D <= k.columnEnd) || !(Y >= k.rowStart && Y < k.rowEnd || G > k.rowStart && G <= k.rowEnd))) {
2023
+ J = !0;
2024
+ break;
2025
+ }
2026
+ J || (H = !1);
2027
+ }
2028
+ H || (z = z - 1, Y = Y - 1, h.columnStart = z, h.columnEnd = D, h.rowStart = Y, h.rowEnd = G, (m = e.updateCells) == null || m.call(e, e.cells ? [...e.cells] : []));
2029
+ }
2030
+ }, [e, Rt]);
2031
+ function Ht(o, m, h, x) {
2032
+ const H = x.filter((D) => /\d+px/.test(D)), z = H.map((D) => parseInt(D) + h).reduce((D, Y) => D + Y, 0);
2033
+ return (o - z - h * (m - 1 - H.length)) / (m - H.length);
2034
+ }
2035
+ const Qe = window.React.useCallback(() => {
2036
+ let o = ((he == null ? void 0 : he.getBoundingClientRect()) ?? {
2037
+ width: 0
2038
+ }).width;
2039
+ return he && (o = o - [
2040
+ parseInt(window.getComputedStyle(he).paddingLeft),
2041
+ parseInt(window.getComputedStyle(he).paddingRight)
2042
+ ].filter((m) => !isNaN(m)).reduce((m, h) => m + h, 0)), e.columnSize || Ht(
2043
+ o,
2044
+ Re.current,
2045
+ Q,
2046
+ e.columnTemplate ? re(e.columnTemplate) : []
2047
+ );
2048
+ }, [Rt, Q, e.columnSize, he, e.columnTemplate]), ge = window.React.useCallback(() => {
2049
+ let o = ((he == null ? void 0 : he.getBoundingClientRect()) ?? {
2050
+ height: 0
2051
+ }).height;
2052
+ return he && (o = o - [
2053
+ parseInt(window.getComputedStyle(he).paddingTop),
2054
+ parseInt(window.getComputedStyle(he).paddingBottom)
2055
+ ].filter((m) => !isNaN(m)).reduce((m, h) => m + h, 0)), e.rowSize || Ht(
2056
+ o,
2057
+ ve.current,
2058
+ Q,
2059
+ e.rowTemplate ? re(e.rowTemplate) : []
2060
+ );
2061
+ }, [Tt, Q, e.rowSize, he, e.rowTemplate]), Pt = window.React.useRef(0), $t = window.React.useRef(0), mt = window.React.useRef(0), it = window.React.useRef(0), Ve = window.React.useRef(), vt = window.React.useRef(), Ue = window.React.useRef(""), [Jt, Pe] = window.React.useState(
2062
+ Ue.current
2063
+ ), gt = window.React.useRef(""), Zt = window.React.useRef(), jt = window.React.useRef(0), At = window.React.useRef(0), Bt = window.React.useRef(0), st = window.React.useRef(0), ye = window.React.useRef(), [yt, Ft] = window.React.useState(ye.current), Mt = window.React.useRef(), r = window.React.useRef(), a = window.React.useRef(), v = window.React.useRef(0), C = window.React.useRef(0), te = window.React.useRef(0), B = window.React.useRef(0), le = window.React.useRef(0), we = window.React.useRef(0);
2064
+ function Be(o) {
2065
+ const m = o.match(/repeat\((\d+),(\d+(fr|px))\)/);
2066
+ return m ? new Array(parseInt(m[1])).fill(m[2]) : [o];
2067
+ }
2068
+ function re(o) {
2069
+ return o.trim().replace(/ {2,}/, " ").replace(/, /, ",").split(" ").map((m) => Be(m)).reduce((m, h) => m.concat(h), []);
2070
+ }
2071
+ function me(o) {
2072
+ const { size: m, gap: h, span: x, max: H, offset: z, startBefore: D, expandable: Y, template: G } = o;
2073
+ if (G) {
2074
+ const J = re(G).map(($) => /\d+px/.test($) ? parseInt($) : m);
2075
+ let k = 0, L = 0;
2076
+ for (; L < J.length && L < D && !(L > D); L++)
2077
+ k += J[L] + h;
2078
+ if (z > 0) {
2079
+ let $ = k;
2080
+ for (; L < J.length && ($ += J[L] + h, !(k + z < $)); L++)
2081
+ ;
2082
+ if (Y && k + z > $) {
2083
+ const Ee = Math.round((k + z - $) / (m + h));
2084
+ L += Ee;
2085
+ }
2086
+ let pe = L;
2087
+ return !Y && pe + x > H + 1 && (pe = H + 1 - x), {
2088
+ start: pe,
2089
+ end: pe + x
2090
+ };
2091
+ } else {
2092
+ let $ = 0, pe = D - 2, Ee = 0;
2093
+ for (; pe >= 0 && ($ += J[pe] + h, !($ > Math.abs(z))); pe--, Ee++)
2094
+ ;
2095
+ let Lt = D - Ee;
2096
+ return Lt < 1 && (Lt = 1), {
2097
+ start: Lt,
2098
+ end: Lt + x
2099
+ };
2100
+ }
2101
+ } else {
2102
+ const J = m + h ? Math.round(z / (m + h)) : 0;
2103
+ let k = D + J;
2104
+ return k < 1 && (k = 1), Y || k + x > H && (k = H - x + 1), {
2105
+ start: k,
2106
+ end: k + x
2107
+ };
2108
+ }
2109
+ }
2110
+ function Fe(o) {
2111
+ const { size: m, gap: h, span: x, max: H, pos: z, expandable: D, template: Y } = o;
2112
+ if (Y) {
2113
+ const G = re(Y).map(($) => /\d+px/.test($) ? parseInt($) : m);
2114
+ let J = 0, k = 0;
2115
+ for (; k < G.length && (J += G[k] + h, !(z < J)); k++)
2116
+ ;
2117
+ if (D && z - J > 0) {
2118
+ const $ = Math.floor((z - J) / (m + h));
2119
+ k += $;
2120
+ }
2121
+ let L = k + 1;
2122
+ return !D && L + x > H + 1 && (L = H + 1 - x), {
2123
+ start: L,
2124
+ end: L + x
2125
+ };
2126
+ } else {
2127
+ let G = m + h ? Math.ceil((z + h / 2) / (m + h)) : 0;
2128
+ return G < 1 && (G = 1), D || G + x > H && (G = H - x + 1), {
2129
+ start: G,
2130
+ end: G + x
2131
+ };
2132
+ }
2133
+ }
2134
+ function Te(o) {
2135
+ const { size: m, gap: h, max: x, offset: H, startBefore: z, endBefore: D, target: Y, expandable: G, template: J } = o;
2136
+ if (J) {
2137
+ const k = re(J).map((L) => /\d+px/.test(L) ? parseInt(L) : m);
2138
+ if (Y === "start")
2139
+ if (H > 0) {
2140
+ let L = 0, $ = 0;
2141
+ for (; $ < k.length && $ < z - 1 && !($ > z - 1); $++)
2142
+ L += k[$] + h;
2143
+ let pe = L;
2144
+ for (; $ < k.length && (pe += k[$] + h, !(L + H < pe)); $++)
2145
+ ;
2146
+ let Ee = $ + 1;
2147
+ return Ee + 1 > D && (Ee = D - 1), {
2148
+ start: Ee,
2149
+ end: D
2150
+ };
2151
+ } else {
2152
+ let L = 0, $ = z - 2, pe = 0;
2153
+ for (; $ >= 0 && (L += k[$] + h, !(L > Math.abs(H))); $--, pe++)
2154
+ ;
2155
+ let Ee = z - pe;
2156
+ return Ee + 1 > D && (Ee = D - 1), {
2157
+ start: Ee,
2158
+ end: D
2159
+ };
2160
+ }
2161
+ else if (H > 0) {
2162
+ let L = 0, $ = 0;
2163
+ for (; $ < k.length && $ < D - 1 && !($ > D - 1); $++)
2164
+ L += k[$] + h;
2165
+ let pe = L;
2166
+ for (; $ < k.length && (pe += k[$] + h, !(L + H < pe)); $++)
2167
+ ;
2168
+ if (G && L + H > pe) {
2169
+ const Lt = Math.round((L + H - pe) / (m + h));
2170
+ $ += Lt;
2171
+ }
2172
+ const Ee = $ + 1;
2173
+ return {
2174
+ start: z,
2175
+ end: Ee
2176
+ };
2177
+ } else {
2178
+ let L = 0, $ = D - 2, pe = 0;
2179
+ for (; $ >= 0 && (L += k[$] + h, !(L > Math.abs(H))); $--, pe++)
2180
+ ;
2181
+ let Ee = D - pe;
2182
+ return Ee < z && (Ee = z), {
2183
+ start: z,
2184
+ end: Ee
2185
+ };
2186
+ }
2187
+ } else {
2188
+ const k = m + h ? Math.round(H / (m + h)) : 0;
2189
+ if (Y === "start") {
2190
+ let L = z + k;
2191
+ return L < 1 && (L = 1), L >= D && (L = D - 1), {
2192
+ start: L,
2193
+ end: D
2194
+ };
2195
+ } else {
2196
+ let L = D + k;
2197
+ return G || L > x && (L = x + 1), L <= z && (L = z + 1), {
2198
+ start: z,
2199
+ end: L
2200
+ };
2201
+ }
2202
+ }
2203
+ }
2204
+ const be = window.React.useCallback(() => {
2205
+ l.state.resizing = !1, l.setState({ ...l.state }), Le(!1), Ve.current = void 0, vt.current = void 0, Ue.current = "", Pe(Ue.current), gt.current = "", document.body.style.cursor = "";
2206
+ }, [l, Le]), ze = window.React.useCallback(() => {
2207
+ l.state.dragging = !1, l.setState({ ...l.state }), Le(!1), ye.current = void 0, Ft(ye.current), Mt.current = void 0, r.current = void 0, a.current = void 0;
2208
+ }, [l, Le]);
2209
+ function _t(o) {
2210
+ const m = o.getBoundingClientRect();
2211
+ return m.top >= 0 && m.left >= 0 && m.bottom <= (window.innerHeight || document.documentElement.clientHeight) && m.right <= (window.innerWidth || document.documentElement.clientWidth);
2212
+ }
2213
+ const bt = window.React.useCallback((o) => {
2214
+ o && (_t(o) || o.scrollIntoView());
2215
+ }, []), c = (o, m) => {
2216
+ const { event: h, rect: x } = o;
2217
+ h && h.currentTarget instanceof HTMLElement && He(m, x, h.currentTarget);
2218
+ }, O = window.React.useCallback(
2219
+ (...o) => {
2220
+ const m = o[0], { event: h, rect: x, cursor: H, direction: z } = m;
2221
+ h && h.currentTarget instanceof HTMLElement && h.currentTarget.parentElement instanceof HTMLElement && (Zt.current = h.currentTarget.parentElement), Pt.current = h.clientX, $t.current = h.clientY, jt.current = h.clientX, At.current = h.clientY, ze(), l.state.resizing = !0, l.setState({ ...l.state }), Le(!0), vt.current = x, Ue.current = H, Pe(Ue.current), gt.current = z, document.body.style.cursor = H, Ve.current = { ...ae.current };
2222
+ },
2223
+ [l, ze, Le]
2224
+ );
2225
+ function He(o, m, h) {
2226
+ ye.current = o, Ft(ye.current), Mt.current = { ...o }, r.current = m, a.current = h;
2227
+ }
2228
+ const Je = window.React.useRef(e.rowTemplate), ot = window.React.useRef(e.columnTemplate), U = window.React.useCallback(
2229
+ (o) => {
2230
+ Pt.current = o.clientX, $t.current = o.clientY, I.current || ye.current && r.current && (be(), l.state.dragging = !0, l.setState({ ...l.state }), Le(!0), v.current = o.clientX, C.current = o.clientY, Je.current = e.rowTemplate ? Ct(e.rowTemplate, ve.current, ge()) : "", ot.current = e.columnTemplate ? Ct(e.columnTemplate, Re.current, Qe()) : "");
2231
+ },
2232
+ [l, be, Le]
2233
+ ), T = window.React.useCallback(
2234
+ (o) => {
2235
+ var m, h, x, H, z, D, Y, G, J, k, L, $, pe, Ee, Lt;
2236
+ if (l.state.dragging && ye.current) {
2237
+ B.current = o.clientX - v.current, te.current = o.clientY - C.current;
2238
+ let Ze = (ye.current.rowEnd ?? ye.current.rowStart ?? 1) - (ye.current.rowStart ?? 1), qe = (ye.current.columnEnd ?? ye.current.columnStart ?? 1) - (ye.current.columnStart ?? 1);
2239
+ Ze <= 0 && (Ze = 1), qe <= 0 && (qe = 1);
2240
+ const { start: tn, end: rn } = me({
2241
+ size: ge(),
2242
+ gap: w.current,
2243
+ span: Ze,
2244
+ max: ve.current ?? 1,
2245
+ offset: te.current,
2246
+ startBefore: ((m = Mt.current) == null ? void 0 : m.rowStart) ?? 1,
2247
+ direction: le.current,
2248
+ expandable: Ne ?? !1,
2249
+ template: Je.current
2250
+ });
2251
+ Ne && (ve.current = ke("rows", ue.current), It(ve.current));
2252
+ const { start: nn, end: sn } = me({
2253
+ size: Qe(),
2254
+ gap: w.current,
2255
+ span: qe,
2256
+ max: Re.current ?? 1,
2257
+ offset: B.current,
2258
+ startBefore: ((h = Mt.current) == null ? void 0 : h.columnStart) ?? 1,
2259
+ direction: we.current,
2260
+ expandable: Ce ?? !1,
2261
+ template: ot.current
2262
+ });
2263
+ Ce && (Re.current = ke("columns", K.current), ft(Re.current)), ye.current.columnStart = nn, ye.current.columnEnd = sn, ye.current.rowStart = tn, ye.current.rowEnd = rn, (x = e.updateCells) == null || x.call(e, e.cells ? [...e.cells] : []), bt(a.current);
2264
+ }
2265
+ if (l.state.resizing && ae.current) {
2266
+ if (st.current = o.clientX - jt.current, Bt.current = o.clientY - At.current, ae.current) {
2267
+ if (gt.current.startsWith("top")) {
2268
+ const { start: Ze, end: qe } = Te({
2269
+ size: ge(),
2270
+ gap: w.current,
2271
+ max: ve.current ?? 1,
2272
+ offset: Bt.current,
2273
+ startBefore: ((H = Ve.current) == null ? void 0 : H.rowStart) ?? 1,
2274
+ endBefore: ((z = Ve.current) == null ? void 0 : z.rowEnd) ?? 1,
2275
+ target: "start",
2276
+ expandable: Ne ?? !1,
2277
+ template: Je.current
2278
+ });
2279
+ ae.current.rows = qe - Ze, ae.current.rowStart = Ze, ae.current.rowEnd = qe, St(ae.current), (D = e.updateCells) == null || D.call(e, e.cells ? [...e.cells] : []);
2280
+ } else if (gt.current.startsWith("bottom")) {
2281
+ const { start: Ze, end: qe } = Te({
2282
+ size: ge(),
2283
+ gap: w.current,
2284
+ max: ve.current ?? 1,
2285
+ offset: Bt.current,
2286
+ startBefore: ((Y = Ve.current) == null ? void 0 : Y.rowStart) ?? 1,
2287
+ endBefore: ((G = Ve.current) == null ? void 0 : G.rowEnd) ?? 1,
2288
+ target: "end",
2289
+ expandable: Ne ?? !1,
2290
+ template: Je.current
2291
+ });
2292
+ ae.current.rows = qe - Ze, ae.current.rowStart = Ze, ae.current.rowEnd = qe, St(ae.current), (J = e.updateCells) == null || J.call(e, e.cells ? [...e.cells] : []), Ne && (ve.current = ke("rows", ue.current), It(ve.current));
2293
+ }
2294
+ if (gt.current.endsWith("left")) {
2295
+ const { start: Ze, end: qe } = Te({
2296
+ size: Qe(),
2297
+ gap: w.current,
2298
+ max: Re.current ?? 1,
2299
+ offset: st.current,
2300
+ startBefore: ((k = Ve.current) == null ? void 0 : k.columnStart) ?? 1,
2301
+ endBefore: ((L = Ve.current) == null ? void 0 : L.columnEnd) ?? 1,
2302
+ target: "start",
2303
+ expandable: Ce ?? !1,
2304
+ template: ot.current
2305
+ });
2306
+ ae.current.columns = qe - Ze, ae.current.columnStart = Ze, ae.current.columnEnd = qe, St(ae.current), ($ = e.updateCells) == null || $.call(e, e.cells ? [...e.cells] : []);
2307
+ } else if (gt.current.endsWith("right")) {
2308
+ const { start: Ze, end: qe } = Te({
2309
+ size: Qe(),
2310
+ gap: w.current,
2311
+ max: Re.current ?? 1,
2312
+ offset: st.current,
2313
+ startBefore: ((pe = Ve.current) == null ? void 0 : pe.columnStart) ?? 1,
2314
+ endBefore: ((Ee = Ve.current) == null ? void 0 : Ee.columnEnd) ?? 1,
2315
+ target: "end",
2316
+ expandable: Ce ?? !1,
2317
+ template: ot.current
2318
+ });
2319
+ ae.current.columns = qe - Ze, ae.current.columnStart = Ze, ae.current.columnEnd = qe, St(ae.current), (Lt = e.updateCells) == null || Lt.call(e, e.cells ? [...e.cells] : []), Ce && (Re.current = ke("columns", K.current), ft(Re.current));
2320
+ }
2321
+ }
2322
+ bt(Zt.current);
2323
+ }
2324
+ },
2325
+ [
2326
+ ke,
2327
+ Ce,
2328
+ l.state.dragging,
2329
+ l.state.resizing,
2330
+ e,
2331
+ Ne,
2332
+ bt,
2333
+ Qe,
2334
+ ge
2335
+ ]
2336
+ ), _e = window.React.useCallback(
2337
+ (o) => {
2338
+ mt.current = o.clientX - Pt.current, it.current = o.clientY - $t.current, be(), ze();
2339
+ },
2340
+ [ze, be]
2341
+ ), de = window.React.useCallback(() => {
2342
+ var o, m;
2343
+ Math.abs(mt.current) < 5 && Math.abs(it.current) < 5 && (l.state.selectedChild = void 0, l.setState({ ...l.state }), (o = e.updateSelectedChild) == null || o.call(e, void 0), (m = e.select) == null || m.call(e, void 0), ae.current = void 0, St(ae.current)), be(), ze();
2344
+ }, [l, ze, e, be]), je = window.React.useCallback(
2345
+ (o) => {
2346
+ var m, h;
2347
+ Math.abs(mt.current) < 5 && Math.abs(it.current) < 5 && (l.state.selectedChild = o, l.setState({ ...l.state }), (m = e.updateSelectedChild) == null || m.call(e, o), (h = e.select) == null || h.call(e, o));
2348
+ },
2349
+ [l, e]
2350
+ ), oe = (o) => {
2351
+ Math.abs(mt.current) < 5 && Math.abs(it.current) < 5 && (ae.current = o, St(ae.current), ye.current = void 0, Ft(ye.current), Mt.current = void 0, r.current = void 0, a.current = void 0);
2352
+ };
2353
+ window.React.useEffect(() => (window.addEventListener("mousedown", U), () => {
2354
+ window.removeEventListener("mousedown", U);
2355
+ }), [U]), window.React.useEffect(() => (window.addEventListener("mousemove", T), () => {
2356
+ window.removeEventListener("mousemove", T);
2357
+ }), [T]), window.React.useEffect(() => (window.addEventListener("mouseup", _e), () => {
2358
+ window.removeEventListener("mouseup", _e);
2359
+ }), [_e]), window.React.useEffect(() => (window.addEventListener("click", de), () => {
2360
+ window.removeEventListener("click", de);
2361
+ }), [de]);
2362
+ const xe = window.React.useCallback(
2363
+ (o) => {
2364
+ var m, h, x;
2365
+ if (Oe.current && (o.stopPropagation(), o.preventDefault(), l.state.droppingEle !== De.current && (l.state.droppingEle = De.current ?? void 0, l.setState({ ...l.state })), F.current)) {
2366
+ const H = ((m = F.current) == null ? void 0 : m.rows) ?? 1, z = ((h = F.current) == null ? void 0 : h.columns) ?? 1, D = ((x = De == null ? void 0 : De.current) == null ? void 0 : x.getBoundingClientRect()) ?? {
2367
+ height: 0,
2368
+ width: 0,
2369
+ x: 0,
2370
+ y: 0
2371
+ };
2372
+ let Y = o.clientY - D.y;
2373
+ Y < 0 ? Y = 0 : !Ne && Y > D.height && (Y = D.height);
2374
+ let G = o.clientX - D.x;
2375
+ G < 0 ? G = 0 : !Ce && G > D.width && (G = D.width);
2376
+ const { start: J, end: k } = Fe({
2377
+ size: ge(),
2378
+ gap: w.current,
2379
+ span: H,
2380
+ max: ve.current ?? 1,
2381
+ pos: Y,
2382
+ expandable: Ne ?? !1,
2383
+ template: Gt.current
2384
+ });
2385
+ F.current && (F.current.rowStart = J, F.current.rowEnd = k, V({ ...F.current })), Ne && (ve.current = ke(
2386
+ "rows",
2387
+ ue.current,
2388
+ F.current ? [F.current] : []
2389
+ ), It(ve.current));
2390
+ const { start: L, end: $ } = Fe({
2391
+ size: Qe(),
2392
+ gap: w.current,
2393
+ span: z,
2394
+ max: Re.current ?? 1,
2395
+ pos: G,
2396
+ expandable: Ce ?? !1,
2397
+ template: sr.current
2398
+ });
2399
+ F.current && (F.current.columnStart = L, F.current.columnEnd = $, V({ ...F.current })), Ce && (Re.current = ke(
2400
+ "columns",
2401
+ K.current,
2402
+ F.current ? [F.current] : []
2403
+ ), ft(Re.current));
2404
+ }
2405
+ },
2406
+ [l, ke, Ce, Ne, Qe, ge]
2407
+ ), xt = window.React.useCallback(
2408
+ (o) => {
2409
+ var m, h, x, H, z, D;
2410
+ if (Oe.current) {
2411
+ if (o.stopPropagation(), o.preventDefault(), F.current && !Ge) {
2412
+ (h = (m = l.state).droppingChildRemove) == null || h.call(m);
2413
+ let Y = { ...F.current };
2414
+ if ($e.current instanceof Function) {
2415
+ const G = $e.current(Y);
2416
+ G instanceof Promise ? G.then((J) => {
2417
+ var k, L;
2418
+ Y = J ?? Y, (k = e.cells) == null || k.push(Y), (L = e.updateCells) == null || L.call(e, e.cells ? [...e.cells] : []);
2419
+ }).catch((J) => {
2420
+ console.error(J);
2421
+ }) : (Y = G ?? Y, (x = e.cells) == null || x.push(Y), (H = e.updateCells) == null || H.call(e, e.cells ? [...e.cells] : []));
2422
+ } else
2423
+ (z = e.cells) == null || z.push(Y), (D = e.updateCells) == null || D.call(e, e.cells ? [...e.cells] : []);
2424
+ }
2425
+ ht();
2426
+ }
2427
+ },
2428
+ [l.state, ht, Ge, e]
2429
+ );
2430
+ window.React.useEffect(() => (M || window.addEventListener("dragover", xe), () => {
2431
+ M || window.removeEventListener("dragover", xe);
2432
+ }), [M, xe]);
2433
+ const at = window.React.useMemo(() => he && l.state && l.state.actionEle ? !l.state.actionEle.contains(he) || l.state.actionEle === he : !0, [l.state, he]), Et = window.React.useRef(!1), ir = window.React.useCallback(
2434
+ (o) => {
2435
+ Et.current = o.target === De.current, M && at && !Et.current && (o.stopPropagation(), U(o));
2436
+ },
2437
+ [M, U, at]
2438
+ ), Kt = window.React.useCallback(
2439
+ (o) => {
2440
+ M && at && !Et.current && (o.stopPropagation(), T(o));
2441
+ },
2442
+ [T, at, M]
2443
+ ), Nt = window.React.useCallback(
2444
+ (o) => {
2445
+ M && at && !Et.current && (o.stopPropagation(), _e(o)), Et.current = !1;
2446
+ },
2447
+ [_e, at, M]
2448
+ ), cr = window.React.useCallback(
2449
+ (o) => {
2450
+ M && o.target !== De.current && (o.stopPropagation(), de());
2451
+ },
2452
+ [M, de]
2453
+ ), Qt = window.React.useCallback(
2454
+ (o) => {
2455
+ var m;
2456
+ if (e.cells) {
2457
+ const h = e.cells.findIndex((x) => x === o);
2458
+ h > -1 && (e.cells.splice(h, 1), (m = e.updateCells) == null || m.call(e, e.cells ? [...e.cells] : []));
2459
+ }
2460
+ },
2461
+ [e]
2462
+ ), Yt = window.React.useCallback((o) => {
2463
+ const m = {};
2464
+ for (const h in o)
2465
+ Array.isArray(o[h]) ? m[h] = o[h].map((x) => Yt(x)) : o[h] instanceof Function ? m[h] = o[h] : o[h] instanceof Object ? m[h] = Yt(o[h]) : m[h] = o[h];
2466
+ return m;
2467
+ }, []), qt = window.React.useCallback(
2468
+ (o, m) => {
2469
+ var h;
2470
+ l.state.droppingChild = Yt(o), l.state.droppingChildEle = m.ele ?? void 0, l.state.droppingChildRaw = o, l.state.droppingChildRemove = m.remove, l.setState({ ...l.state }), (h = e.updateDroppingChild) == null || h.call(e, l.state.droppingChild);
2471
+ },
2472
+ [l, Yt, e]
2473
+ ), Gt = window.React.useRef(e.rowTemplate), sr = window.React.useRef(e.columnTemplate), er = window.React.useCallback(
2474
+ (o, m) => {
2475
+ qt(m, o), Gt.current = e.rowTemplate ? Ct(e.rowTemplate, ve.current, ge()) : "", sr.current = e.columnTemplate ? Ct(e.columnTemplate, Re.current, Qe()) : "";
2476
+ },
2477
+ [qt, e.rowTemplate, e.columnTemplate, ge, Qe]
2478
+ ), tr = window.React.useCallback(
2479
+ (o) => {
2480
+ M && Oe.current && (o.stopPropagation(), xe(o));
2481
+ },
2482
+ [xe, M]
2483
+ ), en = window.React.useCallback(() => {
2484
+ de(), ht();
2485
+ }, [de, ht]);
2486
+ return e.children ? window.React.createElement(
2487
+ Xe,
2488
+ {
2489
+ className: `grid-drag-resize ${[
2490
+ ...A ? [A] : [],
2491
+ ...M ? ["grid-drag-resize--sub"] : [],
2492
+ ...e.className ? [e.className] : []
2493
+ ].join(" ")}`,
2494
+ ref: De,
2495
+ style: {
2496
+ ...e.style
2497
+ }
2498
+ },
2499
+ e.children
2500
+ ) : window.React.createElement(
2501
+ Xe,
2502
+ {
2503
+ className: `grid-drag-resize ${[
2504
+ ...A ? [A] : [],
2505
+ ...M ? ["grid-drag-resize--sub"] : [],
2506
+ ...Se && Vt ? ["grid-drag-resize--dropping"] : [],
2507
+ ...e.className ? [e.className] : []
2508
+ ].join(" ")}`,
2509
+ ref: De,
2510
+ style: {
2511
+ ...e.style,
2512
+ ...nt
2513
+ },
2514
+ //
2515
+ onDragOver: tr,
2516
+ onDrop: xt,
2517
+ onMouseDown: ir,
2518
+ onMouseMove: Kt,
2519
+ onMouseUp: Nt,
2520
+ onClick: cr
2521
+ },
2522
+ /* @__PURE__ */ Ie.jsxs(Ie.Fragment, { children: [
2523
+ (S = e.cells) == null ? void 0 : S.map((o, m) => {
2524
+ var h, x;
2525
+ const H = Mn(o);
2526
+ return /* @__PURE__ */ Ie.jsx(
2527
+ Yr,
2528
+ {
2529
+ ...o,
2530
+ columnStart: o.columnStart,
2531
+ columnEnd: o.columnEnd,
2532
+ rowStart: o.rowStart,
2533
+ rowEnd: o.rowEnd,
2534
+ rows: o.rows,
2535
+ columns: o.columns,
2536
+ //
2537
+ updateColumnStart: (z) => {
2538
+ o.columnStart = z;
2539
+ },
2540
+ updateColumnEnd: (z) => {
2541
+ o.columnEnd = z;
2542
+ },
2543
+ updateRowStart: (z) => {
2544
+ o.rowStart = z;
2545
+ },
2546
+ updateRowEnd: (z) => {
2547
+ o.rowEnd = z;
2548
+ },
2549
+ updateRows: (z) => {
2550
+ o.rows = z;
2551
+ },
2552
+ updateColumns: (z) => {
2553
+ o.columns = z;
2554
+ },
2555
+ //
2556
+ startDrag: (z) => {
2557
+ c(z, o);
2558
+ },
2559
+ select: () => {
2560
+ je(o);
2561
+ },
2562
+ selectResizing: () => {
2563
+ oe(o);
2564
+ },
2565
+ startResize: (z) => {
2566
+ O(z);
2567
+ },
2568
+ remove: () => {
2569
+ Qt(o);
2570
+ },
2571
+ dropStart: (z) => {
2572
+ er(z, o);
2573
+ },
2574
+ dropEnd: () => {
2575
+ en();
2576
+ },
2577
+ className: [
2578
+ ...yt === o ? ["grid-drag-resize__item--dragging"] : [],
2579
+ ...l.state.selectedChild === o ? ["grid-drag-resize__item--selected"] : [],
2580
+ ...l.state.selectedChild === o && Ke === o ? ["grid-drag-resize__item--resizing"] : []
2581
+ ].join(" "),
2582
+ style: {
2583
+ zIndex: yt === o ? (((h = e.cells) == null ? void 0 : h.length) ?? 0) + 2 : l.state.selectedChild === o ? (((x = e.cells) == null ? void 0 : x.length) ?? 0) + 1 : m + 1,
2584
+ cursor: Jt
2585
+ },
2586
+ parentProps: Ot
2587
+ },
2588
+ H
2589
+ );
2590
+ }),
2591
+ Se && Vt && /* @__PURE__ */ Ie.jsx(
2592
+ Yr,
2593
+ {
2594
+ draggable: !1,
2595
+ resizable: !1,
2596
+ ...nr,
2597
+ className: "grid-drag-resize__item--shadow",
2598
+ style: {
2599
+ zIndex: (((P = e.cells) == null ? void 0 : P.length) ?? 0) + 3
2600
+ }
2601
+ },
2602
+ 0
2603
+ )
2604
+ ] })
2605
+ );
2606
+ }
2607
+ function Ln(e) {
2608
+ const [t, n] = window.React.useState({
2609
+ dragging: !1,
2610
+ resizing: !1,
2611
+ //
2612
+ droppingChild: e.droppingChild,
2613
+ droppingChildRaw: e.droppingChild,
2614
+ selectedChild: e.selectedChild
2615
+ }), s = window.React.useContext(hr) ?? {
2616
+ state: t,
2617
+ setState: n
2618
+ };
2619
+ return /* @__PURE__ */ Ie.jsx(hr.Provider, { value: s, children: /* @__PURE__ */ Ie.jsx(
2620
+ Nn,
2621
+ {
2622
+ ...e,
2623
+ parentProps: { ...e.parentProps, ...e }
2624
+ }
2625
+ ) });
2626
+ }
2627
+ export {
2628
+ Dn as Allotment,
2629
+ Ln as GridDragResize,
2630
+ Ln as default
2631
+ };
2632
+ //# sourceMappingURL=libraries.js.map