solive-core
Version:
Solidity Monaco Editor Core Library
1,363 lines (1,352 loc) • 1.54 MB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var jsxRuntime = require('react/jsx-runtime');
var require$$0$3 = require('react');
var require$$0$5 = require('buffer');
var require$$0$4 = require('crypto');
var require$$0$6 = require('events');
var reactDom = require('react-dom');
var ethers = require('ethers');
var VmProvider = require('solive-provider');
var semver = require('semver');
var soliveSolc = require('solive-solc');
var require$$1$4 = require('http');
var require$$2$2 = require('https');
var require$$0$8 = require('url');
var require$$3$3 = require('stream');
var require$$4$3 = require('assert');
var require$$1$2 = require('tty');
var require$$1$3 = require('util');
var require$$0$7 = require('os');
var require$$8$2 = require('zlib');
var require$$1$5 = require('path');
var require$$6$3 = require('fs');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0$3);
var require$$0__namespace = /*#__PURE__*/_interopNamespace(require$$0$3);
var require$$0__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$0$5);
var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$4);
var require$$0__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$0$6);
var VmProvider__default = /*#__PURE__*/_interopDefaultLegacy(VmProvider);
var semver__default = /*#__PURE__*/_interopDefaultLegacy(semver);
var require$$1__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$1$4);
var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2$2);
var require$$0__default$5 = /*#__PURE__*/_interopDefaultLegacy(require$$0$8);
var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3$3);
var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4$3);
var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1$2);
var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$3);
var require$$0__default$4 = /*#__PURE__*/_interopDefaultLegacy(require$$0$7);
var require$$8__default = /*#__PURE__*/_interopDefaultLegacy(require$$8$2);
var require$$1__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$1$5);
var require$$6__default = /*#__PURE__*/_interopDefaultLegacy(require$$6$3);
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __awaiter$1(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
var c$5,
h$7 = {};
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
c$5 = {
get exports() {
return h$7;
},
set exports(e) {
h$7 = e;
}
}, function () {
var e = {}.hasOwnProperty;
function t() {
for (var i = [], n = 0; n < arguments.length; n++) {
var r = arguments[n];
if (r) {
var s = typeof r;
if ("string" === s || "number" === s) i.push(r);else if (Array.isArray(r)) {
if (r.length) {
var o = t.apply(null, r);
o && i.push(o);
}
} else if ("object" === s) if (r.toString === Object.prototype.toString) for (var a in r) e.call(r, a) && r[a] && i.push(a);else i.push(r.toString());
}
}
return i.join(" ");
}
c$5.exports ? (t.default = t, c$5.exports = t) : window.classNames = t;
}();
var l$5 = h$7,
f$7 = /^\s+|\s+$/g,
m$3 = /^[-+]0x[0-9a-f]+$/i,
d$8 = /^0b[01]+$/i,
p$7 = /^0o[0-7]+$/i,
v$4 = parseInt,
y$4 = Object.prototype.toString;
function b$3(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t);
}
function g$2(e) {
if ("number" == typeof e) return e;
if (function (e) {
return "symbol" == typeof e || function (e) {
return !!e && "object" == typeof e;
}(e) && "[object Symbol]" == y$4.call(e);
}(e)) return NaN;
if (b$3(e)) {
var t = "function" == typeof e.valueOf ? e.valueOf() : e;
e = b$3(t) ? t + "" : t;
}
if ("string" != typeof e) return 0 === e ? e : +e;
e = e.replace(f$7, "");
var i = d$8.test(e);
return i || p$7.test(e) ? v$4(e.slice(2), i ? 2 : 8) : m$3.test(e) ? NaN : +e;
}
var z$3 = function z(e, t, i) {
return void 0 === i && (i = t, t = void 0), void 0 !== i && (i = (i = g$2(i)) == i ? i : 0), void 0 !== t && (t = (t = g$2(t)) == t ? t : 0), function (e, t, i) {
return e == e && (void 0 !== i && (e = e <= i ? e : i), void 0 !== t && (e = e >= t ? e : t)), e;
}(g$2(e), t, i);
},
w$4 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {},
S$7 = {};
!function (e, t) {
var i = "__lodash_hash_undefined__",
n = 9007199254740991,
r = "[object Arguments]",
s = "[object Array]",
o = "[object Boolean]",
a = "[object Date]",
u = "[object Error]",
c = "[object Function]",
h = "[object Map]",
l = "[object Number]",
f = "[object Object]",
m = "[object Promise]",
d = "[object RegExp]",
p = "[object Set]",
v = "[object String]",
y = "[object Symbol]",
b = "[object WeakMap]",
g = "[object ArrayBuffer]",
z = "[object DataView]",
S = /^\[object .+?Constructor\]$/,
_ = /^(?:0|[1-9]\d*)$/,
I = {};
I["[object Float32Array]"] = I["[object Float64Array]"] = I["[object Int8Array]"] = I["[object Int16Array]"] = I["[object Int32Array]"] = I["[object Uint8Array]"] = I["[object Uint8ClampedArray]"] = I["[object Uint16Array]"] = I["[object Uint32Array]"] = !0, I[r] = I[s] = I[g] = I[o] = I[z] = I[a] = I[u] = I[c] = I[h] = I[l] = I[f] = I[d] = I[p] = I[v] = I[b] = !1;
var x = "object" == typeof w$4 && w$4 && w$4.Object === Object && w$4,
V = "object" == typeof self && self && self.Object === Object && self,
E = x || V || Function("return this")(),
j = t && !t.nodeType && t,
N = j && e && !e.nodeType && e,
L = N && N.exports === j,
O = L && x.process,
M = function () {
try {
return O && O.binding && O.binding("util");
} catch (e) {}
}(),
P = M && M.isTypedArray;
function D(e, t) {
for (var i = -1, n = null == e ? 0 : e.length; ++i < n;) if (t(e[i], i, e)) return !0;
return !1;
}
function A(e) {
var t = -1,
i = Array(e.size);
return e.forEach(function (e, n) {
i[++t] = [n, e];
}), i;
}
function T(e) {
var t = -1,
i = Array(e.size);
return e.forEach(function (e) {
i[++t] = e;
}), i;
}
var C,
F,
k,
$ = Array.prototype,
H = Function.prototype,
Y = Object.prototype,
B = E["__core-js_shared__"],
R = H.toString,
W = Y.hasOwnProperty,
G = (C = /[^.]+$/.exec(B && B.keys && B.keys.IE_PROTO || "")) ? "Symbol(src)_1." + C : "",
U = Y.toString,
X = RegExp("^" + R.call(W).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
J = L ? E.Buffer : void 0,
K = E.Symbol,
Z = E.Uint8Array,
Q = Y.propertyIsEnumerable,
q = $.splice,
ee = K ? K.toStringTag : void 0,
te = Object.getOwnPropertySymbols,
ie = J ? J.isBuffer : void 0,
ne = (F = Object.keys, k = Object, function (e) {
return F(k(e));
}),
re = Me(E, "DataView"),
se = Me(E, "Map"),
oe = Me(E, "Promise"),
ae = Me(E, "Set"),
ue = Me(E, "WeakMap"),
ce = Me(Object, "create"),
he = Te(re),
le = Te(se),
fe = Te(oe),
me = Te(ae),
de = Te(ue),
pe = K ? K.prototype : void 0,
ve = pe ? pe.valueOf : void 0;
function ye(e) {
var t = -1,
i = null == e ? 0 : e.length;
for (this.clear(); ++t < i;) {
var n = e[t];
this.set(n[0], n[1]);
}
}
function be(e) {
var t = -1,
i = null == e ? 0 : e.length;
for (this.clear(); ++t < i;) {
var n = e[t];
this.set(n[0], n[1]);
}
}
function ge(e) {
var t = -1,
i = null == e ? 0 : e.length;
for (this.clear(); ++t < i;) {
var n = e[t];
this.set(n[0], n[1]);
}
}
function ze(e) {
var t = -1,
i = null == e ? 0 : e.length;
for (this.__data__ = new ge(); ++t < i;) this.add(e[t]);
}
function we(e) {
var t = this.__data__ = new be(e);
this.size = t.size;
}
function Se(e, t) {
var i = ke(e),
n = !i && Fe(e),
r = !i && !n && $e(e),
s = !i && !n && !r && We(e),
o = i || n || r || s,
a = o ? function (e, t) {
for (var i = -1, n = Array(e); ++i < e;) n[i] = t(i);
return n;
}(e.length, String) : [],
u = a.length;
for (var c in e) !t && !W.call(e, c) || o && ("length" == c || r && ("offset" == c || "parent" == c) || s && ("buffer" == c || "byteLength" == c || "byteOffset" == c) || Ae(c, u)) || a.push(c);
return a;
}
function _e(e, t) {
for (var i = e.length; i--;) if (Ce(e[i][0], t)) return i;
return -1;
}
function Ie(e) {
return null == e ? void 0 === e ? "[object Undefined]" : "[object Null]" : ee && ee in Object(e) ? function (e) {
var t = W.call(e, ee),
i = e[ee];
try {
e[ee] = void 0;
var n = !0;
} catch (e) {}
var r = U.call(e);
n && (t ? e[ee] = i : delete e[ee]);
return r;
}(e) : function (e) {
return U.call(e);
}(e);
}
function xe(e) {
return Re(e) && Ie(e) == r;
}
function Ve(e, t, i, n, c) {
return e === t || (null == e || null == t || !Re(e) && !Re(t) ? e != e && t != t : function (e, t, i, n, c, m) {
var b = ke(e),
w = ke(t),
S = b ? s : De(e),
_ = w ? s : De(t),
I = (S = S == r ? f : S) == f,
x = (_ = _ == r ? f : _) == f,
V = S == _;
if (V && $e(e)) {
if (!$e(t)) return !1;
b = !0, I = !1;
}
if (V && !I) return m || (m = new we()), b || We(e) ? Ne(e, t, i, n, c, m) : function (e, t, i, n, r, s, c) {
switch (i) {
case z:
if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1;
e = e.buffer, t = t.buffer;
case g:
return !(e.byteLength != t.byteLength || !s(new Z(e), new Z(t)));
case o:
case a:
case l:
return Ce(+e, +t);
case u:
return e.name == t.name && e.message == t.message;
case d:
case v:
return e == t + "";
case h:
var f = A;
case p:
var m = 1 & n;
if (f || (f = T), e.size != t.size && !m) return !1;
var b = c.get(e);
if (b) return b == t;
n |= 2, c.set(e, t);
var w = Ne(f(e), f(t), n, r, s, c);
return c.delete(e), w;
case y:
if (ve) return ve.call(e) == ve.call(t);
}
return !1;
}(e, t, S, i, n, c, m);
if (!(1 & i)) {
var E = I && W.call(e, "__wrapped__"),
j = x && W.call(t, "__wrapped__");
if (E || j) {
var N = E ? e.value() : e,
L = j ? t.value() : t;
return m || (m = new we()), c(N, L, i, n, m);
}
}
if (!V) return !1;
return m || (m = new we()), function (e, t, i, n, r, s) {
var o = 1 & i,
a = Le(e),
u = a.length,
c = Le(t).length;
if (u != c && !o) return !1;
var h = u;
for (; h--;) {
var l = a[h];
if (!(o ? l in t : W.call(t, l))) return !1;
}
var f = s.get(e);
if (f && s.get(t)) return f == t;
var m = !0;
s.set(e, t), s.set(t, e);
var d = o;
for (; ++h < u;) {
var p = e[l = a[h]],
v = t[l];
if (n) var y = o ? n(v, p, l, t, e, s) : n(p, v, l, e, t, s);
if (!(void 0 === y ? p === v || r(p, v, i, n, s) : y)) {
m = !1;
break;
}
d || (d = "constructor" == l);
}
if (m && !d) {
var b = e.constructor,
g = t.constructor;
b == g || !("constructor" in e) || !("constructor" in t) || "function" == typeof b && b instanceof b && "function" == typeof g && g instanceof g || (m = !1);
}
return s.delete(e), s.delete(t), m;
}(e, t, i, n, c, m);
}(e, t, i, n, Ve, c));
}
function Ee(e) {
return !(!Be(e) || function (e) {
return !!G && G in e;
}(e)) && (He(e) ? X : S).test(Te(e));
}
function je(e) {
if (i = (t = e) && t.constructor, n = "function" == typeof i && i.prototype || Y, t !== n) return ne(e);
var t,
i,
n,
r = [];
for (var s in Object(e)) W.call(e, s) && "constructor" != s && r.push(s);
return r;
}
function Ne(e, t, i, n, r, s) {
var o = 1 & i,
a = e.length,
u = t.length;
if (a != u && !(o && u > a)) return !1;
var c = s.get(e);
if (c && s.get(t)) return c == t;
var h = -1,
l = !0,
f = 2 & i ? new ze() : void 0;
for (s.set(e, t), s.set(t, e); ++h < a;) {
var m = e[h],
d = t[h];
if (n) var p = o ? n(d, m, h, t, e, s) : n(m, d, h, e, t, s);
if (void 0 !== p) {
if (p) continue;
l = !1;
break;
}
if (f) {
if (!D(t, function (e, t) {
if (o = t, !f.has(o) && (m === e || r(m, e, i, n, s))) return f.push(t);
var o;
})) {
l = !1;
break;
}
} else if (m !== d && !r(m, d, i, n, s)) {
l = !1;
break;
}
}
return s.delete(e), s.delete(t), l;
}
function Le(e) {
return function (e, t, i) {
var n = t(e);
return ke(e) ? n : function (e, t) {
for (var i = -1, n = t.length, r = e.length; ++i < n;) e[r + i] = t[i];
return e;
}(n, i(e));
}(e, Ge, Pe);
}
function Oe(e, t) {
var i,
n,
r = e.__data__;
return ("string" == (n = typeof (i = t)) || "number" == n || "symbol" == n || "boolean" == n ? "__proto__" !== i : null === i) ? r["string" == typeof t ? "string" : "hash"] : r.map;
}
function Me(e, t) {
var i = function (e, t) {
return null == e ? void 0 : e[t];
}(e, t);
return Ee(i) ? i : void 0;
}
ye.prototype.clear = function () {
this.__data__ = ce ? ce(null) : {}, this.size = 0;
}, ye.prototype.delete = function (e) {
var t = this.has(e) && delete this.__data__[e];
return this.size -= t ? 1 : 0, t;
}, ye.prototype.get = function (e) {
var t = this.__data__;
if (ce) {
var n = t[e];
return n === i ? void 0 : n;
}
return W.call(t, e) ? t[e] : void 0;
}, ye.prototype.has = function (e) {
var t = this.__data__;
return ce ? void 0 !== t[e] : W.call(t, e);
}, ye.prototype.set = function (e, t) {
var n = this.__data__;
return this.size += this.has(e) ? 0 : 1, n[e] = ce && void 0 === t ? i : t, this;
}, be.prototype.clear = function () {
this.__data__ = [], this.size = 0;
}, be.prototype.delete = function (e) {
var t = this.__data__,
i = _e(t, e);
return !(i < 0) && (i == t.length - 1 ? t.pop() : q.call(t, i, 1), --this.size, !0);
}, be.prototype.get = function (e) {
var t = this.__data__,
i = _e(t, e);
return i < 0 ? void 0 : t[i][1];
}, be.prototype.has = function (e) {
return _e(this.__data__, e) > -1;
}, be.prototype.set = function (e, t) {
var i = this.__data__,
n = _e(i, e);
return n < 0 ? (++this.size, i.push([e, t])) : i[n][1] = t, this;
}, ge.prototype.clear = function () {
this.size = 0, this.__data__ = {
hash: new ye(),
map: new (se || be)(),
string: new ye()
};
}, ge.prototype.delete = function (e) {
var t = Oe(this, e).delete(e);
return this.size -= t ? 1 : 0, t;
}, ge.prototype.get = function (e) {
return Oe(this, e).get(e);
}, ge.prototype.has = function (e) {
return Oe(this, e).has(e);
}, ge.prototype.set = function (e, t) {
var i = Oe(this, e),
n = i.size;
return i.set(e, t), this.size += i.size == n ? 0 : 1, this;
}, ze.prototype.add = ze.prototype.push = function (e) {
return this.__data__.set(e, i), this;
}, ze.prototype.has = function (e) {
return this.__data__.has(e);
}, we.prototype.clear = function () {
this.__data__ = new be(), this.size = 0;
}, we.prototype.delete = function (e) {
var t = this.__data__,
i = t.delete(e);
return this.size = t.size, i;
}, we.prototype.get = function (e) {
return this.__data__.get(e);
}, we.prototype.has = function (e) {
return this.__data__.has(e);
}, we.prototype.set = function (e, t) {
var i = this.__data__;
if (i instanceof be) {
var n = i.__data__;
if (!se || n.length < 199) return n.push([e, t]), this.size = ++i.size, this;
i = this.__data__ = new ge(n);
}
return i.set(e, t), this.size = i.size, this;
};
var Pe = te ? function (e) {
return null == e ? [] : (e = Object(e), function (e, t) {
for (var i = -1, n = null == e ? 0 : e.length, r = 0, s = []; ++i < n;) {
var o = e[i];
t(o, i, e) && (s[r++] = o);
}
return s;
}(te(e), function (t) {
return Q.call(e, t);
}));
} : function () {
return [];
},
De = Ie;
function Ae(e, t) {
return !!(t = null == t ? n : t) && ("number" == typeof e || _.test(e)) && e > -1 && e % 1 == 0 && e < t;
}
function Te(e) {
if (null != e) {
try {
return R.call(e);
} catch (e) {}
try {
return e + "";
} catch (e) {}
}
return "";
}
function Ce(e, t) {
return e === t || e != e && t != t;
}
(re && De(new re(new ArrayBuffer(1))) != z || se && De(new se()) != h || oe && De(oe.resolve()) != m || ae && De(new ae()) != p || ue && De(new ue()) != b) && (De = function (e) {
var t = Ie(e),
i = t == f ? e.constructor : void 0,
n = i ? Te(i) : "";
if (n) switch (n) {
case he:
return z;
case le:
return h;
case fe:
return m;
case me:
return p;
case de:
return b;
}
return t;
});
var Fe = xe(function () {
return arguments;
}()) ? xe : function (e) {
return Re(e) && W.call(e, "callee") && !Q.call(e, "callee");
},
ke = Array.isArray;
var $e = ie || function () {
return !1;
};
function He(e) {
if (!Be(e)) return !1;
var t = Ie(e);
return t == c || "[object GeneratorFunction]" == t || "[object AsyncFunction]" == t || "[object Proxy]" == t;
}
function Ye(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && e <= n;
}
function Be(e) {
var t = typeof e;
return null != e && ("object" == t || "function" == t);
}
function Re(e) {
return null != e && "object" == typeof e;
}
var We = P ? function (e) {
return function (t) {
return e(t);
};
}(P) : function (e) {
return Re(e) && Ye(e.length) && !!I[Ie(e)];
};
function Ge(e) {
return null != (t = e) && Ye(t.length) && !He(t) ? Se(e) : je(e);
var t;
}
e.exports = function (e, t) {
return Ve(e, t);
};
}({
get exports() {
return S$7;
},
set exports(e) {
S$7 = e;
}
}, S$7);
var _$2 = S$7;
function I$3(e, t, i) {
return e[t] ? e[t][0] ? e[t][0][i] : e[t][i] : "contentBoxSize" === t ? e.contentRect["inlineSize" === i ? "width" : "height"] : void 0;
}
function x$2(e) {
void 0 === e && (e = {});
var o = e.onResize,
a = require$$0$3.useRef(void 0);
a.current = o;
var u = e.round || Math.round,
c = require$$0$3.useRef(),
h = require$$0$3.useState({
width: void 0,
height: void 0
}),
l = h[0],
f = h[1],
m = require$$0$3.useRef(!1);
require$$0$3.useEffect(function () {
return m.current = !1, function () {
m.current = !0;
};
}, []);
var d = require$$0$3.useRef({
width: void 0,
height: void 0
}),
p = function (e, i) {
var s = require$$0$3.useRef(null),
o = require$$0$3.useRef(null);
o.current = i;
var a = require$$0$3.useRef(null);
require$$0$3.useEffect(function () {
u();
});
var u = require$$0$3.useCallback(function () {
var t = a.current,
i = o.current,
n = t || (i ? i instanceof Element ? i : i.current : null);
s.current && s.current.element === n && s.current.subscriber === e || (s.current && s.current.cleanup && s.current.cleanup(), s.current = {
element: n,
subscriber: e,
cleanup: n ? e(n) : void 0
});
}, [e]);
return require$$0$3.useEffect(function () {
return function () {
s.current && s.current.cleanup && (s.current.cleanup(), s.current = null);
};
}, []), require$$0$3.useCallback(function (e) {
a.current = e, u();
}, [u]);
}(require$$0$3.useCallback(function (t) {
return c.current && c.current.box === e.box && c.current.round === u || (c.current = {
box: e.box,
round: u,
instance: new ResizeObserver(function (t) {
var i = t[0],
n = "border-box" === e.box ? "borderBoxSize" : "device-pixel-content-box" === e.box ? "devicePixelContentBoxSize" : "contentBoxSize",
r = I$3(i, n, "inlineSize"),
s = I$3(i, n, "blockSize"),
o = r ? u(r) : void 0,
c = s ? u(s) : void 0;
if (d.current.width !== o || d.current.height !== c) {
var h = {
width: o,
height: c
};
d.current.width = o, d.current.height = c, a.current ? a.current(h) : m.current || f(h);
}
})
}), c.current.instance.observe(t, {
box: e.box
}), function () {
c.current && c.current.instance.unobserve(t);
};
}, [e.box, u]), e.ref);
return require$$0$3.useMemo(function () {
return {
ref: p,
width: l.width,
height: l.height
};
}, [p, l.width, l.height]);
}
var V$2 = "allotment-module_splitView__L-yRc",
E$2 = "allotment-module_sashContainer__fzwJF",
j$2 = "allotment-module_splitViewContainer__rQnVa",
N$1 = "allotment-module_splitViewView__MGZ6O",
L$3 = "allotment-module_vertical__WSwwa",
O$2 = "allotment-module_horizontal__7doS8",
M$6 = "allotment-module_separatorBorder__x-rDS";
let P$3,
D$3 = !1,
A$3 = !1;
"object" == typeof navigator && (P$3 = navigator.userAgent, A$3 = P$3.indexOf("Macintosh") >= 0, D$3 = (P$3.indexOf("Macintosh") >= 0 || P$3.indexOf("iPad") >= 0 || P$3.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0);
const T$3 = D$3,
C$2 = A$3,
F$5 = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement ? require$$0$3.useLayoutEffect : require$$0$3.useEffect;
class k$1 {
constructor() {
this._size = void 0;
}
getSize() {
return this._size;
}
setSize(e) {
this._size = e;
}
}
function $$4(e, t) {
const i = e.length,
n = i - t.length;
return n >= 0 && e.slice(n, i) === t;
}
var H$5 = {};
!function (e) {
var t = Object.prototype.hasOwnProperty,
i = "~";
function n() {}
function r(e, t, i) {
this.fn = e, this.context = t, this.once = i || !1;
}
function s(e, t, n, s, o) {
if ("function" != typeof n) throw new TypeError("The listener must be a function");
var a = new r(n, s || e, o),
u = i ? i + t : t;
return e._events[u] ? e._events[u].fn ? e._events[u] = [e._events[u], a] : e._events[u].push(a) : (e._events[u] = a, e._eventsCount++), e;
}
function o(e, t) {
0 == --e._eventsCount ? e._events = new n() : delete e._events[t];
}
function a() {
this._events = new n(), this._eventsCount = 0;
}
Object.create && (n.prototype = Object.create(null), new n().__proto__ || (i = !1)), a.prototype.eventNames = function () {
var e,
n,
r = [];
if (0 === this._eventsCount) return r;
for (n in e = this._events) t.call(e, n) && r.push(i ? n.slice(1) : n);
return Object.getOwnPropertySymbols ? r.concat(Object.getOwnPropertySymbols(e)) : r;
}, a.prototype.listeners = function (e) {
var t = i ? i + e : e,
n = this._events[t];
if (!n) return [];
if (n.fn) return [n.fn];
for (var r = 0, s = n.length, o = new Array(s); r < s; r++) o[r] = n[r].fn;
return o;
}, a.prototype.listenerCount = function (e) {
var t = i ? i + e : e,
n = this._events[t];
return n ? n.fn ? 1 : n.length : 0;
}, a.prototype.emit = function (e, t, n, r, s, o) {
var a = i ? i + e : e;
if (!this._events[a]) return !1;
var u,
c,
h = this._events[a],
l = arguments.length;
if (h.fn) {
switch (h.once && this.removeListener(e, h.fn, void 0, !0), l) {
case 1:
return h.fn.call(h.context), !0;
case 2:
return h.fn.call(h.context, t), !0;
case 3:
return h.fn.call(h.context, t, n), !0;
case 4:
return h.fn.call(h.context, t, n, r), !0;
case 5:
return h.fn.call(h.context, t, n, r, s), !0;
case 6:
return h.fn.call(h.context, t, n, r, s, o), !0;
}
for (c = 1, u = new Array(l - 1); c < l; c++) u[c - 1] = arguments[c];
h.fn.apply(h.context, u);
} else {
var f,
m = h.length;
for (c = 0; c < m; c++) switch (h[c].once && this.removeListener(e, h[c].fn, void 0, !0), l) {
case 1:
h[c].fn.call(h[c].context);
break;
case 2:
h[c].fn.call(h[c].context, t);
break;
case 3:
h[c].fn.call(h[c].context, t, n);
break;
case 4:
h[c].fn.call(h[c].context, t, n, r);
break;
default:
if (!u) for (f = 1, u = new Array(l - 1); f < l; f++) u[f - 1] = arguments[f];
h[c].fn.apply(h[c].context, u);
}
}
return !0;
}, a.prototype.on = function (e, t, i) {
return s(this, e, t, i, !1);
}, a.prototype.once = function (e, t, i) {
return s(this, e, t, i, !0);
}, a.prototype.removeListener = function (e, t, n, r) {
var s = i ? i + e : e;
if (!this._events[s]) return this;
if (!t) return o(this, s), this;
var a = this._events[s];
if (a.fn) a.fn !== t || r && !a.once || n && a.context !== n || o(this, s);else {
for (var u = 0, c = [], h = a.length; u < h; u++) (a[u].fn !== t || r && !a[u].once || n && a[u].context !== n) && c.push(a[u]);
c.length ? this._events[s] = 1 === c.length ? c[0] : c : o(this, s);
}
return this;
}, a.prototype.removeAllListeners = function (e) {
var t;
return e ? (t = i ? i + e : e, this._events[t] && o(this, t)) : (this._events = new n(), this._eventsCount = 0), this;
}, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = i, a.EventEmitter = a, e.exports = a;
}({
get exports() {
return H$5;
},
set exports(e) {
H$5 = e;
}
});
function Y$3(e, t) {
const i = e.indexOf(t);
i > -1 && (e.splice(i, 1), e.unshift(t));
}
function B$2(e, t) {
const i = e.indexOf(t);
i > -1 && (e.splice(i, 1), e.push(t));
}
function R(e, t, i = 1) {
const n = Math.max(0, Math.ceil((t - e) / i)),
r = new Array(n);
let s = -1;
for (; ++s < n;) r[s] = e + s * i;
return r;
}
var W = /^\s+|\s+$/g,
G = /^[-+]0x[0-9a-f]+$/i,
U$3 = /^0b[01]+$/i,
X$2 = /^0o[0-7]+$/i,
J$2 = parseInt,
K = "object" == typeof w$4 && w$4 && w$4.Object === Object && w$4,
Z$4 = "object" == typeof self && self && self.Object === Object && self,
Q$3 = K || Z$4 || Function("return this")(),
q$3 = Object.prototype.toString,
ee$2 = Math.max,
te$3 = Math.min,
ie$2 = function ie() {
return Q$3.Date.now();
};
function ne$4(e) {
var t = typeof e;
return !!e && ("object" == t || "function" == t);
}
function re$3(e) {
if ("number" == typeof e) return e;
if (function (e) {
return "symbol" == typeof e || function (e) {
return !!e && "object" == typeof e;
}(e) && "[object Symbol]" == q$3.call(e);
}(e)) return NaN;
if (ne$4(e)) {
var t = "function" == typeof e.valueOf ? e.valueOf() : e;
e = ne$4(t) ? t + "" : t;
}
if ("string" != typeof e) return 0 === e ? e : +e;
e = e.replace(W, "");
var i = U$3.test(e);
return i || X$2.test(e) ? J$2(e.slice(2), i ? 2 : 8) : G.test(e) ? NaN : +e;
}
var se$2 = function se(e, t, i) {
var n,
r,
s,
o,
a,
u,
c = 0,
h = !1,
l = !1,
f = !0;
if ("function" != typeof e) throw new TypeError("Expected a function");
function m(t) {
var i = n,
s = r;
return n = r = void 0, c = t, o = e.apply(s, i);
}
function d(e) {
return c = e, a = setTimeout(v, t), h ? m(e) : o;
}
function p(e) {
var i = e - u;
return void 0 === u || i >= t || i < 0 || l && e - c >= s;
}
function v() {
var e = ie$2();
if (p(e)) return y(e);
a = setTimeout(v, function (e) {
var i = t - (e - u);
return l ? te$3(i, s - (e - c)) : i;
}(e));
}
function y(e) {
return a = void 0, f && n ? m(e) : (n = r = void 0, o);
}
function b() {
var e = ie$2(),
i = p(e);
if (n = arguments, r = this, u = e, i) {
if (void 0 === a) return d(u);
if (l) return a = setTimeout(v, t), m(u);
}
return void 0 === a && (a = setTimeout(v, t)), o;
}
return t = re$3(t) || 0, ne$4(i) && (h = !!i.leading, s = (l = "maxWait" in i) ? ee$2(re$3(i.maxWait) || 0, t) : s, f = "trailing" in i ? !!i.trailing : f), b.cancel = function () {
void 0 !== a && clearTimeout(a), c = 0, n = u = r = a = void 0;
}, b.flush = function () {
return void 0 === a ? o : y(ie$2());
}, b;
},
oe$3 = "sash-module_sash__K-9lB",
ae$2 = "sash-module_disabled__Hm-wx",
ue$2 = "sash-module_mac__Jf6OJ",
ce$2 = "sash-module_vertical__pB-rs",
he$3 = "sash-module_minimum__-UKxp",
le$3 = "sash-module_maximum__TCWxD",
fe$2 = "sash-module_horizontal__kFbiw",
me$2 = "sash-module_hover__80W6I",
de$2 = "sash-module_active__bJspD";
let pe$2, ve$3;
!function (e) {
e.Vertical = "VERTICAL", e.Horizontal = "HORIZONTAL";
}(pe$2 || (pe$2 = {})), function (e) {
e.Disabled = "DISABLED", e.Minimum = "MINIMUM", e.Maximum = "MAXIMUM", e.Enabled = "ENABLED";
}(ve$3 || (ve$3 = {}));
let ye$4 = T$3 ? 20 : 8;
const be$3 = new H$5();
class ge$2 extends H$5 {
get state() {
return this._state;
}
set state(e) {
this._state !== e && (this.el.classList.toggle(ae$2, e === ve$3.Disabled), this.el.classList.toggle("dash-disabled", e === ve$3.Disabled), this.el.classList.toggle(he$3, e === ve$3.Minimum), this.el.classList.toggle("sash-minimum", e === ve$3.Minimum), this.el.classList.toggle(le$3, e === ve$3.Maximum), this.el.classList.toggle("sash-maximum", e === ve$3.Maximum), this._state = e, this.emit("enablementChange", e));
}
constructor(e, t, i) {
var _i$orientation;
super(), this.el = void 0, this.layoutProvider = void 0, this.orientation = void 0, this.size = void 0, this.hoverDelay = 300, this.hoverDelayer = se$2(e => e.classList.add("sash-hover", me$2), this.hoverDelay), this._state = ve$3.Enabled, this.onPointerStart = e => {
const t = e.pageX,
i = e.pageY,
n = {
startX: t,
currentX: t,
startY: i,
currentY: i
};
this.el.classList.add("sash-active", de$2), this.emit("start", n), this.el.setPointerCapture(e.pointerId);
const r = e => {
e.preventDefault();
const n = {
startX: t,
currentX: e.pageX,
startY: i,
currentY: e.pageY
};
this.emit("change", n);
},
s = e => {
e.preventDefault(), this.el.classList.remove("sash-active", de$2), this.hoverDelayer.cancel(), this.emit("end"), this.el.releasePointerCapture(e.pointerId), window.removeEventListener("pointermove", r), window.removeEventListener("pointerup", s);
};
window.addEventListener("pointermove", r), window.addEventListener("pointerup", s);
}, this.onPointerDoublePress = () => {
this.emit("reset");
}, this.onMouseEnter = () => {
this.el.classList.contains(de$2) ? (this.hoverDelayer.cancel(), this.el.classList.add("sash-hover", me$2)) : this.hoverDelayer(this.el);
}, this.onMouseLeave = () => {
this.hoverDelayer.cancel(), this.el.classList.remove("sash-hover", me$2);
}, this.el = document.createElement("div"), this.el.classList.add("sash", oe$3), this.el.dataset.testid = "sash", e.append(this.el), C$2 && this.el.classList.add("sash-mac", ue$2), this.el.addEventListener("pointerdown", this.onPointerStart), this.el.addEventListener("dblclick", this.onPointerDoublePress), this.el.addEventListener("mouseenter", this.onMouseEnter), this.el.addEventListener("mouseleave", this.onMouseLeave), "number" == typeof i.size ? (this.size = i.size, i.orientation === pe$2.Vertical ? this.el.style.width = `${this.size}px` : this.el.style.height = `${this.size}px`) : (this.size = ye$4, be$3.on("onDidChangeGlobalSize", e => {
this.size = e, this.layout();
})), this.layoutProvider = t, this.orientation = (_i$orientation = i.orientation) != null ? _i$orientation : pe$2.Vertical, this.orientation === pe$2.Horizontal ? (this.el.classList.add("sash-horizontal", fe$2), this.el.classList.remove("sash-vertical", ce$2)) : (this.el.classList.remove("sash-horizontal", fe$2), this.el.classList.add("sash-vertical", ce$2)), this.layout();
}
layout() {
if (this.orientation === pe$2.Vertical) {
const e = this.layoutProvider;
this.el.style.left = e.getVerticalSashLeft(this) - this.size / 2 + "px", e.getVerticalSashTop && (this.el.style.top = e.getVerticalSashTop(this) + "px"), e.getVerticalSashHeight && (this.el.style.height = e.getVerticalSashHeight(this) + "px");
} else {
const e = this.layoutProvider;
this.el.style.top = e.getHorizontalSashTop(this) - this.size / 2 + "px", e.getHorizontalSashLeft && (this.el.style.left = e.getHorizontalSashLeft(this) + "px"), e.getHorizontalSashWidth && (this.el.style.width = e.getHorizontalSashWidth(this) + "px");
}
}
dispose() {
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();
}
}
let ze$2;
var we$4;
let Se$4;
(we$4 = ze$2 || (ze$2 = {})).Distribute = {
type: "distribute"
}, we$4.Split = function (e) {
return {
type: "split",
index: e
};
}, we$4.Invisible = function (e) {
return {
type: "invisible",
cachedVisibleSize: e
};
}, function (e) {
e.Normal = "NORMAL", e.Low = "LOW", e.High = "HIGH";
}(Se$4 || (Se$4 = {}));
class _e$4 {
constructor(e, t, i) {
this.container = void 0, this.view = void 0, this._size = void 0, this._cachedVisibleSize = void 0, this.container = e, this.view = t, this.container.classList.add("split-view-view", N$1), this.container.dataset.testid = "split-view-view", "number" == typeof i ? (this._size = i, this._cachedVisibleSize = void 0, e.classList.add("split-view-view-visible")) : (this._size = 0, this._cachedVisibleSize = i.cachedVisibleSize);
}
set size(e) {
this._size = e;
}
get size() {
return this._size;
}
get priority() {
return this.view.priority;
}
get snap() {
return !!this.view.snap;
}
get cachedVisibleSize() {
return this._cachedVisibleSize;
}
get visible() {
return void 0 === this._cachedVisibleSize;
}
setVisible(e, t) {
e !== this.visible && (e ? (this.size = z$3(this._cachedVisibleSize, this.viewMinimumSize, this.viewMaximumSize), this._cachedVisibleSize = void 0) : (this._cachedVisibleSize = "number" == typeof t ? t : this.size, this.size = 0), this.container.classList.toggle("split-view-view-visible", e), this.view.setVisible && this.view.setVisible(e));
}
get minimumSize() {
return this.visible ? this.view.minimumSize : 0;
}
get viewMinimumSize() {
return this.view.minimumSize;
}
get maximumSize() {
return this.visible ? this.view.maximumSize : 0;
}
get viewMaximumSize() {
return this.view.maximumSize;
}
set enabled(e) {
this.container.style.pointerEvents = e ? "" : "none";
}
layout(e) {
this.layoutContainer(e), this.view.layout(this.size, e);
}
}
class Ie$5 extends _e$4 {
layoutContainer(e) {
this.container.style.left = `${e}px`, this.container.style.width = `${this.size}px`;
}
}
class xe$6 extends _e$4 {
layoutContainer(e) {
this.container.style.top = `${e}px`, this.container.style.height = `${this.size}px`;
}
}
class Ve$3 extends H$5 {
get startSnappingEnabled() {
return this._startSnappingEnabled;
}
set startSnappingEnabled(e) {
this._startSnappingEnabled !== e && (this._startSnappingEnabled = e, this.updateSashEnablement());
}
get endSnappingEnabled() {
return this._endSnappingEnabled;
}
set endSnappingEnabled(e) {
this._endSnappingEnabled !== e && (this._endSnappingEnabled = e, this.updateSashEnablement());
}
constructor(e, t = {}, i) {
var _t$orientation, _t$proportionalLayout;
if (super(), this.onDidChange = 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 = e => {
this.emit("sashchange", e), this.saveProportions();
for (const _e2 of this.viewItems) _e2.enabled = !0;
}, this.orientation = (_t$orientation = t.orientation) != null ? _t$orientation : pe$2.Vertical, this.proportionalLayout = (_t$proportionalLayout = t.proportionalLayout) != null ? _t$proportionalLayout : !0, this.getSashOrthogonalSize = t.getSashOrthogonalSize, i && (this.onDidChange = i), this.sashContainer = document.createElement("div"), this.sashContainer.classList.add("sash-container", E$2), e.prepend(this.sashContainer), t.descriptor) {
this.size = t.descriptor.size;
for (const [_e3, _i] of t.descriptor.views.entries()) {
const _t = _i.size,
n = _i.container,
r = _i.view;
this.addView(n, r, _t, _e3, !0);
}
this.contentSize = this.viewItems.reduce((e, t) => e + t.size, 0), this.saveProportions();
}
}
addView(e, t, i, n = this.viewItems.length, r) {
let s;
s = "number" == typeof i ? i : "split" === i.type ? this.getViewSize(i.index) / 2 : "invisible" === i.type ? {
cachedVisibleSize: i.cachedVisibleSize
} : t.minimumSize;
const o = this.orientation === pe$2.Vertical ? new xe$6(e, t, s) : new Ie$5(e, t, s);
if (this.viewItems.splice(n, 0, o), this.viewItems.length > 1) {
const _e4 = this.orientation === pe$2.Vertical ? new ge$2(this.sashContainer, {
getHorizontalSashTop: e => this.getSashPosition(e),
getHorizontalSashWidth: this.getSashOrthogonalSize
}, {
orientation: pe$2.Horizontal
}) : new ge$2(this.sashContainer, {
getVerticalSashLeft: e => this.getSashPosition(e),
getVerticalSashHeight: this.getSashOrthogonalSize
}, {
orientation: pe$2.Vertical
}),
_t2 = this.orientation === pe$2.Vertical ? t => ({
sash: _e4,
start: t.startY,
current: t.currentY
}) : t => ({
sash: _e4,
start: t.startX,
current: t.currentX
});
_e4.on("start", e => {
this.emit("sashDragStart"), this.onSashStart(_t2(e));
}), _e4.on("change", e => this.onSashChange(_t2(e))), _e4.on("end", () => {
this.emit("sashDragEnd"), this.onSashEnd(this.sashItems.findIndex(t => t.sash === _e4));
}), _e4.on("reset", () => {
const t = this.sashItems.findIndex(t => t.sash === _e4),
i = R(t, -1, -1),
n = R(t + 1, this.viewItems.length),
r = this.findFirstSnapIndex(i),
s = this.findFirstSnapIndex(n);
("number" != typeof r || this.viewItems[r].visible) && ("number" != typeof s || this.viewItems[s].visible) && this.emit("sashreset", t);
});
const _i2 = {
sash: _e4
};
this.sashItems.splice(n - 1, 0, _i2);
}
r || this.relayout(), r || "number" == typeof i || "distribute" !== i.type || this.distributeViewSizes();
}
removeView(e, t) {
if (e < 0 || e >= this.viewItems.length) throw new Error("Index out of bounds");
const i = this.viewItems.splice(e, 1)[0].view;
if (this.viewItems.length >= 1) {
const _t3 = Math.max(e - 1, 0);
this.sashItems.splice(_t3, 1)[0].sash.dispose();
}
return this.relayout(), t && "distribute" === t.type && this.distributeViewSizes(), i;
}
moveView(e, t, i) {
const n = this.getViewCachedVisibleSize(t),
r = void 0 === n ? this.getViewSize(t) : ze$2.Invisible(n),
s = this.removeView(t);
this.addView(e, s, r, i);
}
getViewCachedVisibleSize(e) {
if (e < 0 || e >= this.viewItems.length) throw new Error("Index out of bounds");
return this.viewItems[e].cachedVisibleSize;
}
layout(e = this.size) {
const t = Math.max(this.size, this.contentSize);
if (this.size = e, this.proportions) for (let _t4 = 0; _t4 < this.viewItems.length; _t4++) {
const i = this.viewItems[_t4];
i.size = z$3(Math.round(this.proportions[_t4] * e), i.minimumSize, i.maximumSize);
} else {
const i = R(0, this.viewItems.length),
n = i.filter(e => this.viewItems[e].priority === Se$4.Low),
r = i.filter(e => this.viewItems[e].priority === Se$4.High);
this.resize(this.viewItems.length - 1, e - t, void 0, n, r);
}
this.distributeEmptySpace(), this.layoutViews();
}
resizeView(e, t) {
if (e < 0 || e >= this.viewItems.length) return;
const i = R(0, this.viewItems.length).filter(t => t !== e),
n = [...i.filter(e => this.viewItems[e].priority === Se$4.Low), e],
r = i.filter(e => this.viewItems[e].priority === Se$4.High),
s = this.viewItems[e];
t = Math.round(t), t = z$3(t, s.minimumSize, Math.min(s.maximumSize, this.size)), s.size = t, this.relayout(n, r);
}
resizeViews(e) {
for (let t = 0; t < e.length; t++) {
const i = this.viewItems[t];
let n = e[t];
n = Math.round(n), n = z$3(n, i.minimumSize, Math.min(i.maximumSize, this.size)), i.size = n;
}
this.contentSize = this.viewItems.reduce((e, t) => e + t.size, 0), this.saveProportions(), this.layout(this.size);
}
getViewSize(e) {
return e < 0 || e >= this.viewItems.length ? -1 : this.viewItems[e].size;
}
isViewVisible(e) {
if (e < 0 || e >= this.viewItems.length) throw new Error("Index out of bounds");
return this.viewItems[e].visible;
}
setViewVisible(e, t) {
if (e < 0 || e >= this.viewItems.length) throw new Error("Index out of bounds");
this.viewItems[e].setVisible(t), this.distributeEmptySpace(e), this.layoutViews(), this.saveProportions();
}
distributeViewSizes() {
const e = [];
let t = 0;
for (const _i3 of this.viewItems) _i3.maximumSize - _i3.minimumSize > 0 && (e.push(_i3), t += _i3.size);
const i = Math.floor(t / e.length);
for (const _t5 of e) _t5.size = z$3(i, _t5.minimumSize, _t5.maximumSize);
const n = R(0, this.viewItems.length),
r = n.filter(e => this.viewItems[e].priority === Se$4.Low),
s = n.filter(e => this.viewItems[e].priority === Se$4.High);
this.relayout(r, s);
}
dispose() {
this.sashItems.forEach(e => e.sash.dispose()), this.sashItems = [], this.sashContainer.remove();
}
relayout(e, t) {
const i = this.viewItems.reduce((e, t) => e + t.size, 0);
this.resize(this.viewItems.length - 1, this.size - i, void 0, e, t), this.distributeEmptySpace(), this.layoutViews(), this.saveProportions();
}
onSashStart({
sash: e,
start: t
}) {
const i = this.sashItems.findIndex(t => t.sash === e);
(e => {
const t = this.viewItems.map(e => e.size);
let n,
r,
s = Number.NEGATIVE_INFINITY,
o = Number.POSITIVE_INFINITY;
const a = R(i, -1, -1),
u = R(i + 1, this.viewItems.length),
c = a.reduce((e, i) => e + (this.viewItems[i].minimumSize - t[i]), 0),
h = a.reduce((e, i) => e + (this.viewItems[i].viewMaximumSize - t[i]), 0),
l = 0 === u.length ? Number.POSITIVE_INFINITY : u.reduce((e, i) => e + (t[i] - this.viewItems[i].minimumSize), 0),
f = 0 === u.length ? Number.NEGATIVE_INFINITY : u.reduce((e, i) => e + (t[i] - this.viewItems[i].viewMaximumSize), 0);
s = Math.max(c, f), o = Math.min(l, h);
const m = this.findFirstSnapIndex(a),
d = this.findFirstSnapIndex(u);
if ("number" == typeof m) {
const _e5 = this.viewItems[m],
_t6 = Math.floor(_e5.viewMinimumSize / 2);
n = {
index: m,
limitDelta: _e5.visible ? s - _t6 : s + _t6,
size: _e5.size
};
}
if ("number" == typeof d) {
const _e6 = this.viewItems[d],
_t7 = Math.floor(_e6.viewMinimumSize / 2);
r = {
index: d,
limitDelta: _e6.visible ? o + _t7 : o - _t7,
size: _e6.size
};
}
this.sashDragState = {
start: e,
current: e,
index: i,
sizes: t,
minDelta: s,
maxDelta: o,
snapBefore: n,
snapAfter: r
};
})(t);
}
onSashChange({
current: e
}) {
const {
index: t,
start: i,
sizes: n,
minDelta: r,
maxDelta: s,
snapBefore: o,
snapAfter: a
} = this.sashDragState;
this.sashDragState.current = e;
const u = e - i;
this.resize(t, u, n, void 0, void 0, r, s, o, a), this.distributeEmptySpace(), this.layoutViews();
}
getSashPosition(e) {
let t = 0;
for (let i = 0; i < this.sashItems.length; i++) if (t += this.viewItems[i].size, this.sashItems[i].sash === e) return t;
return 0;
}
resize(e, t, i = this.viewItems.map(e => e.size), n, r, s = Number.NEGATIVE_INFINITY, o = Number.POSITIVE_INFINITY, a, u) {
if (e < 0 || e >= this.viewItems.length) return 0;
const c = R(e, -1, -1),
h = R(e + 1, this.viewItems.length);
if (r) for (const _e7 of r) Y$3(c, _e7), Y$3(h, _e7);
if (n) for (const _e8 of n) B$2(c, _e8), B$2(h, _e8);
const l = c.map(e => this.viewItems[e]),
f = c.map(e => i[e]),
m = h.map(e => this.viewItems[e]),
d = h.map(e => i[e]),
p = c.reduce((e, t) => e + (this.viewItems[t].minimumSize - i[t]), 0),
v = c.reduce((e, t) => e + (this.viewItems[t].maximumSize - i[t]), 0),
y = 0 === h.length ? Number.POSITIVE_INFINITY : h.reduce((e, t) => e + (i[t] - this.viewItems[t].minimumSize), 0),
b = 0 === h.length ? Number.NEGATI