diff --git "a/src/backend/gradio_cofoldinginput/templates/component/index.js" "b/src/backend/gradio_cofoldinginput/templates/component/index.js"
--- "a/src/backend/gradio_cofoldinginput/templates/component/index.js"
+++ "b/src/backend/gradio_cofoldinginput/templates/component/index.js"
@@ -1,3 +1,11 @@
+var is = Object.defineProperty;
+var hn = (n) => {
+ throw TypeError(n);
+};
+var ns = (n, e, t) => e in n ? is(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
+var Dt = (n, e, t) => ns(n, typeof e != "symbol" ? e + "" : e, t), as = (n, e, t) => e.has(n) || hn("Cannot " + t);
+var cn = (n, e, t) => e.has(n) ? hn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t);
+var zr = (n, e, t) => (as(n, e, "access private method"), t);
function _mergeNamespaces(n, e) {
for (var t = 0; t < e.length; t++) {
const r = e[t];
@@ -29,7 +37,7 @@ const {
insert_hydration: insert_hydration$i,
safe_not_equal: safe_not_equal$j,
set_dynamic_element_data,
- set_style: set_style$5,
+ set_style: set_style$7,
toggle_class: toggle_class$9,
transition_in: transition_in$8,
transition_out: transition_out$8,
@@ -58,7 +66,7 @@ function create_dynamic_element(n) {
) },
{
class: t = "block " + /*elem_classes*/
- n[6].join(" ") + " svelte-dbzldu"
+ n[6].join(" ") + " svelte-1df3mrj"
}
], o = {};
for (let d = 0; d < h.length; d += 1)
@@ -81,8 +89,8 @@ function create_dynamic_element(n) {
class: !0
}
);
- var v = children$g(e);
- s && s.l(v), v.forEach(detach$i), this.h();
+ var _ = children$g(e);
+ s && s.l(_), _.forEach(detach$i), this.h();
},
h() {
set_dynamic_element_data(
@@ -120,7 +128,7 @@ function create_dynamic_element(n) {
"auto-margin",
/*scale*/
n[16] === null
- ), set_style$5(
+ ), set_style$7(
e,
"height",
/*get_dimension*/
@@ -128,7 +136,7 @@ function create_dynamic_element(n) {
/*height*/
n[1]
)
- ), set_style$5(
+ ), set_style$7(
e,
"min-height",
/*get_dimension*/
@@ -136,7 +144,7 @@ function create_dynamic_element(n) {
/*min_height*/
n[2]
)
- ), set_style$5(
+ ), set_style$7(
e,
"max-height",
/*get_dimension*/
@@ -144,7 +152,7 @@ function create_dynamic_element(n) {
/*max_height*/
n[3]
)
- ), set_style$5(e, "width", typeof /*width*/
+ ), set_style$7(e, "width", typeof /*width*/
n[4] == "number" ? `calc(min(${/*width*/
n[4]}px, 100%))` : (
/*get_dimension*/
@@ -152,12 +160,12 @@ function create_dynamic_element(n) {
/*width*/
n[4]
)
- )), set_style$5(
+ )), set_style$7(
e,
"border-style",
/*variant*/
n[7]
- ), set_style$5(
+ ), set_style$7(
e,
"overflow",
/*allow_overflow*/
@@ -165,19 +173,19 @@ function create_dynamic_element(n) {
/*overflow_behavior*/
n[15]
) : "hidden"
- ), set_style$5(
+ ), set_style$7(
e,
"flex-grow",
/*scale*/
n[16]
- ), set_style$5(e, "min-width", `calc(min(${/*min_width*/
- n[17]}px, 100%))`), set_style$5(e, "border-width", "var(--block-border-width)");
+ ), set_style$7(e, "min-width", `calc(min(${/*min_width*/
+ n[17]}px, 100%))`), set_style$7(e, "border-width", "var(--block-border-width)");
},
- m(d, v) {
- insert_hydration$i(d, e, v), s && s.m(e, null), r = !0;
+ m(d, _) {
+ insert_hydration$i(d, e, _), s && s.m(e, null), r = !0;
},
- p(d, v) {
- s && s.p && (!r || v & /*$$scope*/
+ p(d, _) {
+ s && s.p && (!r || _ & /*$$scope*/
2097152) && update_slot_base$3(
s,
a,
@@ -188,7 +196,7 @@ function create_dynamic_element(n) {
a,
/*$$scope*/
d[21],
- v,
+ _,
null
) : get_all_dirty_from_scope$3(
/*$$scope*/
@@ -199,19 +207,19 @@ function create_dynamic_element(n) {
/*tag*/
d[18]
)(e, o = get_spread_update$1(h, [
- (!r || v & /*test_id*/
+ (!r || _ & /*test_id*/
1024) && { "data-testid": (
/*test_id*/
d[10]
) },
- (!r || v & /*elem_id*/
+ (!r || _ & /*elem_id*/
32) && { id: (
/*elem_id*/
d[5]
) },
- (!r || v & /*elem_classes*/
+ (!r || _ & /*elem_classes*/
64 && t !== (t = "block " + /*elem_classes*/
- d[6].join(" ") + " svelte-dbzldu")) && { class: t }
+ d[6].join(" ") + " svelte-1df3mrj")) && { class: t }
])), toggle_class$9(
e,
"hidden",
@@ -244,8 +252,8 @@ function create_dynamic_element(n) {
"auto-margin",
/*scale*/
d[16] === null
- ), v & /*height*/
- 2 && set_style$5(
+ ), _ & /*height*/
+ 2 && set_style$7(
e,
"height",
/*get_dimension*/
@@ -253,8 +261,8 @@ function create_dynamic_element(n) {
/*height*/
d[1]
)
- ), v & /*min_height*/
- 4 && set_style$5(
+ ), _ & /*min_height*/
+ 4 && set_style$7(
e,
"min-height",
/*get_dimension*/
@@ -262,8 +270,8 @@ function create_dynamic_element(n) {
/*min_height*/
d[2]
)
- ), v & /*max_height*/
- 8 && set_style$5(
+ ), _ & /*max_height*/
+ 8 && set_style$7(
e,
"max-height",
/*get_dimension*/
@@ -271,8 +279,8 @@ function create_dynamic_element(n) {
/*max_height*/
d[3]
)
- ), v & /*width*/
- 16 && set_style$5(e, "width", typeof /*width*/
+ ), _ & /*width*/
+ 16 && set_style$7(e, "width", typeof /*width*/
d[4] == "number" ? `calc(min(${/*width*/
d[4]}px, 100%))` : (
/*get_dimension*/
@@ -280,14 +288,14 @@ function create_dynamic_element(n) {
/*width*/
d[4]
)
- )), v & /*variant*/
- 128 && set_style$5(
+ )), _ & /*variant*/
+ 128 && set_style$7(
e,
"border-style",
/*variant*/
d[7]
- ), v & /*allow_overflow, overflow_behavior*/
- 49152 && set_style$5(
+ ), _ & /*allow_overflow, overflow_behavior*/
+ 49152 && set_style$7(
e,
"overflow",
/*allow_overflow*/
@@ -295,14 +303,14 @@ function create_dynamic_element(n) {
/*overflow_behavior*/
d[15]
) : "hidden"
- ), v & /*scale*/
- 65536 && set_style$5(
+ ), _ & /*scale*/
+ 65536 && set_style$7(
e,
"flex-grow",
/*scale*/
d[16]
- ), v & /*min_width*/
- 131072 && set_style$5(e, "min-width", `calc(min(${/*min_width*/
+ ), _ & /*min_width*/
+ 131072 && set_style$7(e, "min-width", `calc(min(${/*min_width*/
d[17]}px, 100%))`);
},
i(d) {
@@ -347,7 +355,7 @@ function create_fragment$i(n) {
};
}
function instance$f(n, e, t) {
- let { $$slots: r = {}, $$scope: a } = e, { height: s = void 0 } = e, { min_height: h = void 0 } = e, { max_height: o = void 0 } = e, { width: d = void 0 } = e, { elem_id: v = "" } = e, { elem_classes: f = [] } = e, { variant: y = "solid" } = e, { border_mode: A = "base" } = e, { padding: x = !0 } = e, { type: M = "normal" } = e, { test_id: m = void 0 } = e, { explicit_call: l = !1 } = e, { container: u = !0 } = e, { visible: p = !0 } = e, { allow_overflow: g = !0 } = e, { overflow_behavior: b = "auto" } = e, { scale: c = null } = e, { min_width: _ = 0 } = e, { flex: E = !1 } = e;
+ let { $$slots: r = {}, $$scope: a } = e, { height: s = void 0 } = e, { min_height: h = void 0 } = e, { max_height: o = void 0 } = e, { width: d = void 0 } = e, { elem_id: _ = "" } = e, { elem_classes: f = [] } = e, { variant: y = "solid" } = e, { border_mode: A = "base" } = e, { padding: x = !0 } = e, { type: M = "normal" } = e, { test_id: m = void 0 } = e, { explicit_call: l = !1 } = e, { container: u = !0 } = e, { visible: p = !0 } = e, { allow_overflow: g = !0 } = e, { overflow_behavior: b = "auto" } = e, { scale: c = null } = e, { min_width: v = 0 } = e, { flex: E = !1 } = e;
p || (E = !1);
let w = M === "fieldset" ? "fieldset" : "div";
const k = ($) => {
@@ -359,14 +367,14 @@ function instance$f(n, e, t) {
}
};
return n.$$set = ($) => {
- "height" in $ && t(1, s = $.height), "min_height" in $ && t(2, h = $.min_height), "max_height" in $ && t(3, o = $.max_height), "width" in $ && t(4, d = $.width), "elem_id" in $ && t(5, v = $.elem_id), "elem_classes" in $ && t(6, f = $.elem_classes), "variant" in $ && t(7, y = $.variant), "border_mode" in $ && t(8, A = $.border_mode), "padding" in $ && t(9, x = $.padding), "type" in $ && t(20, M = $.type), "test_id" in $ && t(10, m = $.test_id), "explicit_call" in $ && t(11, l = $.explicit_call), "container" in $ && t(12, u = $.container), "visible" in $ && t(13, p = $.visible), "allow_overflow" in $ && t(14, g = $.allow_overflow), "overflow_behavior" in $ && t(15, b = $.overflow_behavior), "scale" in $ && t(16, c = $.scale), "min_width" in $ && t(17, _ = $.min_width), "flex" in $ && t(0, E = $.flex), "$$scope" in $ && t(21, a = $.$$scope);
+ "height" in $ && t(1, s = $.height), "min_height" in $ && t(2, h = $.min_height), "max_height" in $ && t(3, o = $.max_height), "width" in $ && t(4, d = $.width), "elem_id" in $ && t(5, _ = $.elem_id), "elem_classes" in $ && t(6, f = $.elem_classes), "variant" in $ && t(7, y = $.variant), "border_mode" in $ && t(8, A = $.border_mode), "padding" in $ && t(9, x = $.padding), "type" in $ && t(20, M = $.type), "test_id" in $ && t(10, m = $.test_id), "explicit_call" in $ && t(11, l = $.explicit_call), "container" in $ && t(12, u = $.container), "visible" in $ && t(13, p = $.visible), "allow_overflow" in $ && t(14, g = $.allow_overflow), "overflow_behavior" in $ && t(15, b = $.overflow_behavior), "scale" in $ && t(16, c = $.scale), "min_width" in $ && t(17, v = $.min_width), "flex" in $ && t(0, E = $.flex), "$$scope" in $ && t(21, a = $.$$scope);
}, [
E,
s,
h,
o,
d,
- v,
+ _,
f,
y,
A,
@@ -378,7 +386,7 @@ function instance$f(n, e, t) {
g,
b,
c,
- _,
+ v,
w,
k,
M,
@@ -455,10 +463,10 @@ class ParseError {
if (h && h.start <= h.end) {
var o = h.lexer.input;
a = h.start, s = h.end, a === o.length ? r += " at end of input: " : r += " at position " + (a + 1) + ": ";
- var d = o.slice(a, s).replace(/[^]/g, "$&̲"), v;
- a > 15 ? v = "…" + o.slice(a - 15, a) : v = o.slice(0, a);
+ var d = o.slice(a, s).replace(/[^]/g, "$&̲"), _;
+ a > 15 ? _ = "…" + o.slice(a - 15, a) : _ = o.slice(0, a);
var f;
- s + 15 < o.length ? f = o.slice(s, s + 15) + "…" : f = o.slice(s), r += v + d + f;
+ s + 15 < o.length ? f = o.slice(s, s + 15) + "…" : f = o.slice(s), r += _ + d + f;
}
var y = new Error(r);
return y.name = "ParseError", y.__proto__ = ParseError.prototype, y.position = a, a != null && s != null && (y.length = s - a), y.rawMessage = e, y;
@@ -3874,8 +3882,8 @@ var iCombinations = {
class SymbolNode {
constructor(e, t, r, a, s, h, o, d) {
this.text = void 0, this.height = void 0, this.depth = void 0, this.italic = void 0, this.skew = void 0, this.width = void 0, this.maxFontSize = void 0, this.classes = void 0, this.style = void 0, this.text = e, this.height = t || 0, this.depth = r || 0, this.italic = a || 0, this.skew = s || 0, this.width = h || 0, this.classes = o || [], this.style = d || {}, this.maxFontSize = 0;
- var v = scriptFromCodepoint(this.text.charCodeAt(0));
- v && this.classes.push(v + "_fallback"), /[îïíì]/.test(this.text) && (this.text = iCombinations[this.text]);
+ var _ = scriptFromCodepoint(this.text.charCodeAt(0));
+ _ && this.classes.push(_ + "_fallback"), /[îïíì]/.test(this.text) && (this.text = iCombinations[this.text]);
}
hasClass(e) {
return utils.contains(this.classes, e);
@@ -4729,8 +4737,8 @@ var wideLatinLetterData = [
e = h.value;
var d;
if (o) {
- var v = o.italic;
- (r === "text" || a && a.font === "mathit") && (v = 0), d = new SymbolNode(e, o.height, o.depth, v, o.skew, o.width, s);
+ var _ = o.italic;
+ (r === "text" || a && a.font === "mathit") && (_ = 0), d = new SymbolNode(e, o.height, o.depth, _, o.skew, o.width, s);
} else
typeof console < "u" && console.warn("No character metrics " + ("for '" + e + "' in style '" + t + "' and mode '" + r + "'")), d = new SymbolNode(e, 0, 0, 0, 0, 0, s);
if (a) {
@@ -4750,9 +4758,9 @@ var wideLatinLetterData = [
fontClass: "mathbf"
};
}, makeOrd = function(e, t, r) {
- var a = e.mode, s = e.text, h = ["mord"], o = a === "math" || a === "text" && t.font, d = o ? t.font : t.fontFamily, v = "", f = "";
- if (s.charCodeAt(0) === 55349 && ([v, f] = wideCharacterFont(s, a)), v.length > 0)
- return makeSymbol(s, v, a, t, h.concat(f));
+ var a = e.mode, s = e.text, h = ["mord"], o = a === "math" || a === "text" && t.font, d = o ? t.font : t.fontFamily, _ = "", f = "";
+ if (s.charCodeAt(0) === 55349 && ([_, f] = wideCharacterFont(s, a)), _.length > 0)
+ return makeSymbol(s, _, a, t, h.concat(f));
if (d) {
var y, A;
if (d === "boldsymbol") {
@@ -4838,29 +4846,29 @@ var wideLatinLetterData = [
depth: a
};
}
- var v;
+ var _;
if (e.positionType === "top") {
for (var f = e.positionData, y = 0; y < e.children.length; y++) {
var A = e.children[y];
f -= A.type === "kern" ? A.size : A.elem.height + A.elem.depth;
}
- v = f;
+ _ = f;
} else if (e.positionType === "bottom")
- v = -e.positionData;
+ _ = -e.positionData;
else {
var x = e.children[0];
if (x.type !== "elem")
throw new Error('First child must have type "elem".');
if (e.positionType === "shift")
- v = -x.elem.depth - e.positionData;
+ _ = -x.elem.depth - e.positionData;
else if (e.positionType === "firstBaseline")
- v = -x.elem.depth;
+ _ = -x.elem.depth;
else
throw new Error("Invalid positionType " + e.positionType + ".");
}
return {
children: e.children,
- depth: v
+ depth: _
};
}, makeVList = function(e, t) {
for (var {
@@ -4874,14 +4882,14 @@ var wideLatinLetterData = [
}
}
s += 2;
- var v = makeSpan$2(["pstrut"], []);
- v.style.height = makeEm(s);
+ var _ = makeSpan$2(["pstrut"], []);
+ _.style.height = makeEm(s);
for (var f = [], y = a, A = a, x = a, M = 0; M < r.length; M++) {
var m = r[M];
if (m.type === "kern")
x += m.size;
else {
- var l = m.elem, u = m.wrapperClasses || [], p = m.wrapperStyle || {}, g = makeSpan$2(u, [v, l], void 0, p);
+ var l = m.elem, u = m.wrapperClasses || [], p = m.wrapperStyle || {}, g = makeSpan$2(u, [_, l], void 0, p);
g.style.top = makeEm(-s - x - l.depth), m.marginLeft && (g.style.marginLeft = m.marginLeft), m.marginRight && (g.style.marginRight = m.marginRight), f.push(g), x += l.height + l.depth;
}
y = Math.min(y, x), A = Math.max(A, x);
@@ -4890,7 +4898,7 @@ var wideLatinLetterData = [
b.style.height = makeEm(A);
var c;
if (y < 0) {
- var _ = makeSpan$2([], []), E = makeSpan$2(["vlist"], [_]);
+ var v = makeSpan$2([], []), E = makeSpan$2(["vlist"], [v]);
E.style.height = makeEm(-y);
var w = makeSpan$2(["vlist-s"], [new SymbolNode("")]);
c = [makeSpan$2(["vlist-r"], [b, w]), makeSpan$2(["vlist-r"], [E])];
@@ -5156,10 +5164,10 @@ var normalizeArgument = function(e) {
}
if (buildCommon.tryCombineChars(s), !r)
return s;
- var v = t;
+ var _ = t;
if (e.length === 1) {
var f = e[0];
- f.type === "sizing" ? v = t.havingSize(f.size) : f.type === "styling" && (v = t.havingStyle(styleMap$1[f.style]));
+ f.type === "sizing" ? _ = t.havingSize(f.size) : f.type === "styling" && (_ = t.havingStyle(styleMap$1[f.style]));
}
var y = makeSpan$1([a[0] || "leftmost"], [], t), A = makeSpan$1([a[1] || "rightmost"], [], t), x = r === "root";
return traverseNonSpaceNodes(s, (M, m) => {
@@ -5170,7 +5178,7 @@ var normalizeArgument = function(e) {
}, A, x), traverseNonSpaceNodes(s, (M, m) => {
var l = getTypeOfDomTree(m), u = getTypeOfDomTree(M), p = l && u ? M.hasClass("mtight") ? tightSpacings[l][u] : spacings[l][u] : null;
if (p)
- return buildCommon.makeGlue(p, v);
+ return buildCommon.makeGlue(p, _);
}, {
node: y
}, A, x), s;
@@ -5182,12 +5190,12 @@ var normalizeArgument = function(e) {
n(d.children, t, r, null, s);
continue;
}
- var v = !o.hasClass("mspace");
- if (v) {
+ var _ = !o.hasClass("mspace");
+ if (_) {
var f = t(o, r.node);
f && (r.insertAfter ? r.insertAfter(f) : (e.unshift(f), h++));
}
- v ? r.node = o : s && o.hasClass("newline") && (r.node = makeSpan$1(["leftmost"])), r.insertAfter = /* @__PURE__ */ ((y) => (A) => {
+ _ ? r.node = o : s && o.hasClass("newline") && (r.node = makeSpan$1(["leftmost"])), r.insertAfter = /* @__PURE__ */ ((y) => (A) => {
e.splice(y + 1, 0, A), h++;
})(h);
}
@@ -5241,11 +5249,11 @@ function buildHTML(n, e) {
d || (s.push(buildHTMLUnbreakable(h, e)), h = []);
} else r[o].hasClass("newline") && (h.pop(), h.length > 0 && (s.push(buildHTMLUnbreakable(h, e)), h = []), s.push(r[o]));
h.length > 0 && s.push(buildHTMLUnbreakable(h, e));
- var v;
- t ? (v = buildHTMLUnbreakable(buildExpression$1(t, e, !0)), v.classes = ["tag"], s.push(v)) : a && s.push(a);
+ var _;
+ t ? (_ = buildHTMLUnbreakable(buildExpression$1(t, e, !0)), _.classes = ["tag"], s.push(_)) : a && s.push(a);
var f = makeSpan$1(["katex-html"], s);
- if (f.setAttribute("aria-hidden", "true"), v) {
- var y = v.children[0];
+ if (f.setAttribute("aria-hidden", "true"), _) {
+ var y = _.children[0];
y.style.height = makeEm(f.height + f.depth), f.depth && (y.style.verticalAlign = makeEm(-f.depth));
}
return f;
@@ -5416,8 +5424,8 @@ var mathMLTree = {
h.children.push(...d.children);
continue;
} else if (d.type === "mi" && d.children.length === 1 && h.type === "mn") {
- var v = d.children[0];
- if (v instanceof TextNode && v.text === ".") {
+ var _ = d.children[0];
+ if (_ instanceof TextNode && _.text === ".") {
h.children.push(...d.children);
continue;
}
@@ -5448,10 +5456,10 @@ function buildMathML(n, e, t, r, a) {
s.length === 1 && s[0] instanceof MathNode && utils.contains(["mrow", "mtable"], s[0].type) ? h = s[0] : h = new mathMLTree.MathNode("mrow", s);
var o = new mathMLTree.MathNode("annotation", [new mathMLTree.TextNode(e)]);
o.setAttribute("encoding", "application/x-tex");
- var d = new mathMLTree.MathNode("semantics", [h, o]), v = new mathMLTree.MathNode("math", [d]);
- v.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"), r && v.setAttribute("display", "block");
+ var d = new mathMLTree.MathNode("semantics", [h, o]), _ = new mathMLTree.MathNode("math", [d]);
+ _.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"), r && _.setAttribute("display", "block");
var f = a ? "katex" : "katex-mathml";
- return buildCommon.makeSpan([f], [v]);
+ return buildCommon.makeSpan([f], [_]);
}
var optionsFromSettings = function(e) {
return new Options({
@@ -5581,7 +5589,7 @@ var optionsFromSettings = function(e) {
function r() {
var o = 4e5, d = e.label.slice(1);
if (utils.contains(["widehat", "widecheck", "widetilde", "utilde"], d)) {
- var v = e, f = groupLength(v.base), y, A, x;
+ var _ = e, f = groupLength(_.base), y, A, x;
if (f > 5)
d === "widehat" || d === "widecheck" ? (y = 420, o = 2364, x = 0.42, A = d + "4") : (y = 312, o = 2340, x = 0.34, A = "tilde4");
else {
@@ -5600,7 +5608,7 @@ var optionsFromSettings = function(e) {
height: x
};
} else {
- var u = [], p = katexImagesData[d], [g, b, c] = p, _ = c / 1e3, E = g.length, w, k;
+ var u = [], p = katexImagesData[d], [g, b, c] = p, v = c / 1e3, E = g.length, w, k;
if (E === 1) {
var $ = p[3];
w = ["hide-tail"], k = [$];
@@ -5612,24 +5620,24 @@ var optionsFromSettings = function(e) {
throw new Error(`Correct katexImagesData or update code here to support
` + E + " children.");
for (var L = 0; L < E; L++) {
- var z = new PathNode(g[L]), F = new SvgNode([z], {
+ var I = new PathNode(g[L]), F = new SvgNode([I], {
width: "400em",
- height: makeEm(_),
+ height: makeEm(v),
viewBox: "0 0 " + o + " " + c,
preserveAspectRatio: k[L] + " slice"
- }), R = buildCommon.makeSvgSpan([w[L]], [F], t);
+ }), P = buildCommon.makeSvgSpan([w[L]], [F], t);
if (E === 1)
return {
- span: R,
+ span: P,
minWidth: b,
- height: _
+ height: v
};
- R.style.height = makeEm(_), u.push(R);
+ P.style.height = makeEm(v), u.push(P);
}
return {
span: buildCommon.makeSpan(["stretchy"], u, t),
minWidth: b,
- height: _
+ height: v
};
}
}
@@ -5647,21 +5655,21 @@ var optionsFromSettings = function(e) {
d && (h.style.borderColor = d);
}
} else {
- var v = [];
- /^[bx]cancel$/.test(t) && v.push(new LineNode({
+ var _ = [];
+ /^[bx]cancel$/.test(t) && _.push(new LineNode({
x1: "0",
y1: "0",
x2: "100%",
y2: "100%",
"stroke-width": "0.046em"
- })), /^x?cancel$/.test(t) && v.push(new LineNode({
+ })), /^x?cancel$/.test(t) && _.push(new LineNode({
x1: "0",
y1: "100%",
x2: "100%",
y2: "0",
"stroke-width": "0.046em"
}));
- var f = new SvgNode(v, {
+ var f = new SvgNode(_, {
width: "100%",
height: makeEm(o)
});
@@ -5692,8 +5700,8 @@ var htmlBuilder$a = (n, e) => {
n && n.type === "supsub" ? (r = assertNodeType(n.base, "accent"), t = r.base, n.base = t, a = assertSpan(buildGroup$1(n, e)), n.base = r) : (r = assertNodeType(n, "accent"), t = r.base);
var s = buildGroup$1(t, e.havingCrampedStyle()), h = r.isShifty && utils.isCharacterBox(t), o = 0;
if (h) {
- var d = utils.getBaseElem(t), v = buildGroup$1(d, e.havingCrampedStyle());
- o = assertSymbolDomNode(v).skew;
+ var d = utils.getBaseElem(t), _ = buildGroup$1(d, e.havingCrampedStyle());
+ o = assertSymbolDomNode(_).skew;
}
var f = r.label === "\\c", y = f ? s.height + s.depth : Math.min(s.height, e.fontMetrics().xHeight), A;
if (r.isStretchy)
@@ -5886,8 +5894,8 @@ defineFunction({
a.classes.push(s + "-arrow-pad");
var h;
n.below && (r = e.havingStyle(t.sub()), h = buildCommon.wrapFragment(buildGroup$1(n.below, r, e), e), h.classes.push(s + "-arrow-pad"));
- var o = stretchy.svgSpan(n, e), d = -e.fontMetrics().axisHeight + 0.5 * o.height, v = -e.fontMetrics().axisHeight - 0.5 * o.height - 0.111;
- (a.depth > 0.25 || n.label === "\\xleftequilibrium") && (v -= a.depth);
+ var o = stretchy.svgSpan(n, e), d = -e.fontMetrics().axisHeight + 0.5 * o.height, _ = -e.fontMetrics().axisHeight - 0.5 * o.height - 0.111;
+ (a.depth > 0.25 || n.label === "\\xleftequilibrium") && (_ -= a.depth);
var f;
if (h) {
var y = -e.fontMetrics().axisHeight + h.height + 0.5 * o.height + 0.111;
@@ -5896,7 +5904,7 @@ defineFunction({
children: [{
type: "elem",
elem: a,
- shift: v
+ shift: _
}, {
type: "elem",
elem: o,
@@ -5913,7 +5921,7 @@ defineFunction({
children: [{
type: "elem",
elem: a,
- shift: v
+ shift: _
}, {
type: "elem",
elem: o,
@@ -6100,12 +6108,12 @@ function cdArrow(n, e, t) {
case "\\\\cdlongequal":
return t.callFunction("\\\\cdlongequal", [], []);
case "\\Vert": {
- var v = {
+ var _ = {
type: "textord",
text: "\\Vert",
mode: "math"
};
- return t.callFunction("\\Big", [v], []);
+ return t.callFunction("\\Big", [_], []);
}
default:
return {
@@ -6134,7 +6142,7 @@ function parseCD(n) {
o.body.push(h[d]);
else {
r.push(o), d += 1;
- var v = assertSymbolNodeType(h[d]).text, f = new Array(2);
+ var _ = assertSymbolNodeType(h[d]).text, f = new Array(2);
if (f[0] = {
type: "ordgroup",
mode: "math",
@@ -6143,23 +6151,23 @@ function parseCD(n) {
type: "ordgroup",
mode: "math",
body: []
- }, !("=|.".indexOf(v) > -1)) if ("<>AV".indexOf(v) > -1)
+ }, !("=|.".indexOf(_) > -1)) if ("<>AV".indexOf(_) > -1)
for (var y = 0; y < 2; y++) {
for (var A = !0, x = d + 1; x < h.length; x++) {
- if (isLabelEnd(h[x], v)) {
+ if (isLabelEnd(h[x], _)) {
A = !1, d = x;
break;
}
if (isStartOfArrow(h[x]))
- throw new ParseError("Missing a " + v + " character to complete a CD arrow.", h[x]);
+ throw new ParseError("Missing a " + _ + " character to complete a CD arrow.", h[x]);
f[y].body.push(h[x]);
}
if (A)
- throw new ParseError("Missing a " + v + " character to complete a CD arrow.", h[d]);
+ throw new ParseError("Missing a " + _ + " character to complete a CD arrow.", h[d]);
}
else
throw new ParseError('Expected one of "<>AV=|." after @', h[d]);
- var M = cdArrow(v, f, n), m = {
+ var M = cdArrow(_, f, n), m = {
type: "styling",
body: [M],
mode: "math",
@@ -6256,15 +6264,15 @@ defineFunction({
var o = assertNodeType(a[h], "textord");
s += o.text;
}
- var d = parseInt(s), v;
+ var d = parseInt(s), _;
if (isNaN(d))
throw new ParseError("\\@char has non-numeric argument " + s);
if (d < 0 || d >= 1114111)
throw new ParseError("\\@char with invalid code point " + s);
- return d <= 65535 ? v = String.fromCharCode(d) : (d -= 65536, v = String.fromCharCode((d >> 10) + 55296, (d & 1023) + 56320)), {
+ return d <= 65535 ? _ = String.fromCharCode(d) : (d -= 65536, _ = String.fromCharCode((d >> 10) + 55296, (d & 1023) + 56320)), {
type: "textord",
mode: t.mode,
- text: v
+ text: _
};
}
});
@@ -6539,44 +6547,44 @@ var getMetrics = function(e, t, r) {
type: "kern",
size: -1 * lapInEms
}, verts = ["|", "\\lvert", "\\rvert", "\\vert"], doubleVerts = ["\\|", "\\lVert", "\\rVert", "\\Vert"], makeStackedDelim = function(e, t, r, a, s, h) {
- var o, d, v, f, y = "", A = 0;
- o = v = f = e, d = null;
+ var o, d, _, f, y = "", A = 0;
+ o = _ = f = e, d = null;
var x = "Size1-Regular";
- e === "\\uparrow" ? v = f = "⏐" : e === "\\Uparrow" ? v = f = "‖" : e === "\\downarrow" ? o = v = "⏐" : e === "\\Downarrow" ? o = v = "‖" : e === "\\updownarrow" ? (o = "\\uparrow", v = "⏐", f = "\\downarrow") : e === "\\Updownarrow" ? (o = "\\Uparrow", v = "‖", f = "\\Downarrow") : utils.contains(verts, e) ? (v = "∣", y = "vert", A = 333) : utils.contains(doubleVerts, e) ? (v = "∥", y = "doublevert", A = 556) : e === "[" || e === "\\lbrack" ? (o = "⎡", v = "⎢", f = "⎣", x = "Size4-Regular", y = "lbrack", A = 667) : e === "]" || e === "\\rbrack" ? (o = "⎤", v = "⎥", f = "⎦", x = "Size4-Regular", y = "rbrack", A = 667) : e === "\\lfloor" || e === "⌊" ? (v = o = "⎢", f = "⎣", x = "Size4-Regular", y = "lfloor", A = 667) : e === "\\lceil" || e === "⌈" ? (o = "⎡", v = f = "⎢", x = "Size4-Regular", y = "lceil", A = 667) : e === "\\rfloor" || e === "⌋" ? (v = o = "⎥", f = "⎦", x = "Size4-Regular", y = "rfloor", A = 667) : e === "\\rceil" || e === "⌉" ? (o = "⎤", v = f = "⎥", x = "Size4-Regular", y = "rceil", A = 667) : e === "(" || e === "\\lparen" ? (o = "⎛", v = "⎜", f = "⎝", x = "Size4-Regular", y = "lparen", A = 875) : e === ")" || e === "\\rparen" ? (o = "⎞", v = "⎟", f = "⎠", x = "Size4-Regular", y = "rparen", A = 875) : e === "\\{" || e === "\\lbrace" ? (o = "⎧", d = "⎨", f = "⎩", v = "⎪", x = "Size4-Regular") : e === "\\}" || e === "\\rbrace" ? (o = "⎫", d = "⎬", f = "⎭", v = "⎪", x = "Size4-Regular") : e === "\\lgroup" || e === "⟮" ? (o = "⎧", f = "⎩", v = "⎪", x = "Size4-Regular") : e === "\\rgroup" || e === "⟯" ? (o = "⎫", f = "⎭", v = "⎪", x = "Size4-Regular") : e === "\\lmoustache" || e === "⎰" ? (o = "⎧", f = "⎭", v = "⎪", x = "Size4-Regular") : (e === "\\rmoustache" || e === "⎱") && (o = "⎫", f = "⎩", v = "⎪", x = "Size4-Regular");
- var M = getMetrics(o, x, s), m = M.height + M.depth, l = getMetrics(v, x, s), u = l.height + l.depth, p = getMetrics(f, x, s), g = p.height + p.depth, b = 0, c = 1;
+ e === "\\uparrow" ? _ = f = "⏐" : e === "\\Uparrow" ? _ = f = "‖" : e === "\\downarrow" ? o = _ = "⏐" : e === "\\Downarrow" ? o = _ = "‖" : e === "\\updownarrow" ? (o = "\\uparrow", _ = "⏐", f = "\\downarrow") : e === "\\Updownarrow" ? (o = "\\Uparrow", _ = "‖", f = "\\Downarrow") : utils.contains(verts, e) ? (_ = "∣", y = "vert", A = 333) : utils.contains(doubleVerts, e) ? (_ = "∥", y = "doublevert", A = 556) : e === "[" || e === "\\lbrack" ? (o = "⎡", _ = "⎢", f = "⎣", x = "Size4-Regular", y = "lbrack", A = 667) : e === "]" || e === "\\rbrack" ? (o = "⎤", _ = "⎥", f = "⎦", x = "Size4-Regular", y = "rbrack", A = 667) : e === "\\lfloor" || e === "⌊" ? (_ = o = "⎢", f = "⎣", x = "Size4-Regular", y = "lfloor", A = 667) : e === "\\lceil" || e === "⌈" ? (o = "⎡", _ = f = "⎢", x = "Size4-Regular", y = "lceil", A = 667) : e === "\\rfloor" || e === "⌋" ? (_ = o = "⎥", f = "⎦", x = "Size4-Regular", y = "rfloor", A = 667) : e === "\\rceil" || e === "⌉" ? (o = "⎤", _ = f = "⎥", x = "Size4-Regular", y = "rceil", A = 667) : e === "(" || e === "\\lparen" ? (o = "⎛", _ = "⎜", f = "⎝", x = "Size4-Regular", y = "lparen", A = 875) : e === ")" || e === "\\rparen" ? (o = "⎞", _ = "⎟", f = "⎠", x = "Size4-Regular", y = "rparen", A = 875) : e === "\\{" || e === "\\lbrace" ? (o = "⎧", d = "⎨", f = "⎩", _ = "⎪", x = "Size4-Regular") : e === "\\}" || e === "\\rbrace" ? (o = "⎫", d = "⎬", f = "⎭", _ = "⎪", x = "Size4-Regular") : e === "\\lgroup" || e === "⟮" ? (o = "⎧", f = "⎩", _ = "⎪", x = "Size4-Regular") : e === "\\rgroup" || e === "⟯" ? (o = "⎫", f = "⎭", _ = "⎪", x = "Size4-Regular") : e === "\\lmoustache" || e === "⎰" ? (o = "⎧", f = "⎭", _ = "⎪", x = "Size4-Regular") : (e === "\\rmoustache" || e === "⎱") && (o = "⎫", f = "⎩", _ = "⎪", x = "Size4-Regular");
+ var M = getMetrics(o, x, s), m = M.height + M.depth, l = getMetrics(_, x, s), u = l.height + l.depth, p = getMetrics(f, x, s), g = p.height + p.depth, b = 0, c = 1;
if (d !== null) {
- var _ = getMetrics(d, x, s);
- b = _.height + _.depth, c = 2;
+ var v = getMetrics(d, x, s);
+ b = v.height + v.depth, c = 2;
}
var E = m + g + b, w = Math.max(0, Math.ceil((t - E) / (c * u))), k = E + w * c * u, $ = a.fontMetrics().axisHeight;
r && ($ *= a.sizeMultiplier);
- var L = k / 2 - $, z = [];
+ var L = k / 2 - $, I = [];
if (y.length > 0) {
- var F = k - m - g, R = Math.round(k * 1e3), P = tallDelim(y, Math.round(F * 1e3)), U = new PathNode(y, P), N = (A / 1e3).toFixed(3) + "em", B = (R / 1e3).toFixed(3) + "em", W = new SvgNode([U], {
- width: N,
- height: B,
- viewBox: "0 0 " + A + " " + R
- }), V = buildCommon.makeSvgSpan([], [W], a);
- V.height = R / 1e3, V.style.width = N, V.style.height = B, z.push({
+ var F = k - m - g, P = Math.round(k * 1e3), B = tallDelim(y, Math.round(F * 1e3)), G = new PathNode(y, B), U = (A / 1e3).toFixed(3) + "em", R = (P / 1e3).toFixed(3) + "em", W = new SvgNode([G], {
+ width: U,
+ height: R,
+ viewBox: "0 0 " + A + " " + P
+ }), H = buildCommon.makeSvgSpan([], [W], a);
+ H.height = P / 1e3, H.style.width = U, H.style.height = R, I.push({
type: "elem",
- elem: V
+ elem: H
});
} else {
- if (z.push(makeGlyphSpan(f, x, s)), z.push(lap), d === null) {
- var G = k - m - g + 2 * lapInEms;
- z.push(makeInner(v, G, a));
+ if (I.push(makeGlyphSpan(f, x, s)), I.push(lap), d === null) {
+ var N = k - m - g + 2 * lapInEms;
+ I.push(makeInner(_, N, a));
} else {
- var H = (k - m - g - b) / 2 + 2 * lapInEms;
- z.push(makeInner(v, H, a)), z.push(lap), z.push(makeGlyphSpan(d, x, s)), z.push(lap), z.push(makeInner(v, H, a));
+ var V = (k - m - g - b) / 2 + 2 * lapInEms;
+ I.push(makeInner(_, V, a)), I.push(lap), I.push(makeGlyphSpan(d, x, s)), I.push(lap), I.push(makeInner(_, V, a));
}
- z.push(lap), z.push(makeGlyphSpan(o, x, s));
+ I.push(lap), I.push(makeGlyphSpan(o, x, s));
}
- var Q = a.havingBaseStyle(Style$1.TEXT), te = buildCommon.makeVList({
+ var J = a.havingBaseStyle(Style$1.TEXT), re = buildCommon.makeVList({
positionType: "bottom",
positionData: L,
- children: z
- }, Q);
- return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [te], Q), Style$1.TEXT, a, h);
+ children: I
+ }, J);
+ return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [re], J), Style$1.TEXT, a, h);
}, vbPad = 80, emPad = 0.08, sqrtSvg = function(e, t, r, a, s) {
var h = sqrtPath(e, a, r), o = new PathNode(e, h), d = new SvgNode([o], {
// Note: 1000:1 ratio of viewBox to document em width.
@@ -6587,8 +6595,8 @@ var getMetrics = function(e, t, r) {
});
return buildCommon.makeSvgSpan(["hide-tail"], [d], s);
}, makeSqrtImage = function(e, t) {
- var r = t.havingBaseSizing(), a = traverseSequence("\\surd", e * r.sizeMultiplier, stackLargeDelimiterSequence, r), s = r.sizeMultiplier, h = Math.max(0, t.minRuleThickness - t.fontMetrics().sqrtRuleThickness), o, d = 0, v = 0, f = 0, y;
- return a.type === "small" ? (f = 1e3 + 1e3 * h + vbPad, e < 1 ? s = 1 : e < 1.4 && (s = 0.7), d = (1 + h + emPad) / s, v = (1 + h) / s, o = sqrtSvg("sqrtMain", d, f, h, t), o.style.minWidth = "0.853em", y = 0.833 / s) : a.type === "large" ? (f = (1e3 + vbPad) * sizeToMaxHeight[a.size], v = (sizeToMaxHeight[a.size] + h) / s, d = (sizeToMaxHeight[a.size] + h + emPad) / s, o = sqrtSvg("sqrtSize" + a.size, d, f, h, t), o.style.minWidth = "1.02em", y = 1 / s) : (d = e + h + emPad, v = e + h, f = Math.floor(1e3 * e + h) + vbPad, o = sqrtSvg("sqrtTall", d, f, h, t), o.style.minWidth = "0.742em", y = 1.056), o.height = v, o.style.height = makeEm(d), {
+ var r = t.havingBaseSizing(), a = traverseSequence("\\surd", e * r.sizeMultiplier, stackLargeDelimiterSequence, r), s = r.sizeMultiplier, h = Math.max(0, t.minRuleThickness - t.fontMetrics().sqrtRuleThickness), o, d = 0, _ = 0, f = 0, y;
+ return a.type === "small" ? (f = 1e3 + 1e3 * h + vbPad, e < 1 ? s = 1 : e < 1.4 && (s = 0.7), d = (1 + h + emPad) / s, _ = (1 + h) / s, o = sqrtSvg("sqrtMain", d, f, h, t), o.style.minWidth = "0.853em", y = 0.833 / s) : a.type === "large" ? (f = (1e3 + vbPad) * sizeToMaxHeight[a.size], _ = (sizeToMaxHeight[a.size] + h) / s, d = (sizeToMaxHeight[a.size] + h + emPad) / s, o = sqrtSvg("sqrtSize" + a.size, d, f, h, t), o.style.minWidth = "1.02em", y = 1 / s) : (d = e + h + emPad, _ = e + h, f = Math.floor(1e3 * e + h) + vbPad, o = sqrtSvg("sqrtTall", d, f, h, t), o.style.minWidth = "0.742em", y = 1.056), o.height = _, o.style.height = makeEm(d), {
span: o,
advanceWidth: y,
// Calculate the actual line width.
@@ -6670,8 +6678,8 @@ var getMetrics = function(e, t, r) {
for (var s = Math.min(2, 3 - a.style.size), h = s; h < r.length && r[h].type !== "stack"; h++) {
var o = getMetrics(e, delimTypeToFont(r[h]), "math"), d = o.height + o.depth;
if (r[h].type === "small") {
- var v = a.havingBaseStyle(r[h].style);
- d *= v.sizeMultiplier;
+ var _ = a.havingBaseStyle(r[h].style);
+ d *= _.sizeMultiplier;
}
if (d > t)
return r[h];
@@ -6684,7 +6692,7 @@ var getMetrics = function(e, t, r) {
var d = traverseSequence(e, t, o, a);
return d.type === "small" ? makeSmallDelim(e, d.style, r, a, s, h) : d.type === "large" ? makeLargeDelim(e, d.size, r, a, s, h) : makeStackedDelim(e, t, r, a, s, h);
}, makeLeftRightDelim = function(e, t, r, a, s, h) {
- var o = a.fontMetrics().axisHeight * a.sizeMultiplier, d = 901, v = 5 / a.fontMetrics().ptPerEm, f = Math.max(t - o, r + o), y = Math.max(
+ var o = a.fontMetrics().axisHeight * a.sizeMultiplier, d = 901, _ = 5 / a.fontMetrics().ptPerEm, f = Math.max(t - o, r + o), y = Math.max(
// In real TeX, calculations are done using integral values which are
// 65536 per pt, or 655360 per em. So, the division here truncates in
// TeX but doesn't here, producing different results. If we wanted to
@@ -6695,7 +6703,7 @@ var getMetrics = function(e, t, r) {
// x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
// in TeX and KaTeX)
f / 500 * d,
- 2 * f - v
+ 2 * f - _
);
return makeCustomSizedDelim(e, y, !0, a, s, h);
}, delimiter = {
@@ -6857,7 +6865,7 @@ defineFunction({
var o;
if (n.left === "." ? o = makeNullDelimiter(e, ["mopen"]) : o = delimiter.leftRightDelim(n.left, r, a, e, n.mode, ["mopen"]), t.unshift(o), s)
for (var d = 1; d < t.length; d++) {
- var v = t[d], f = v.isMiddle;
+ var _ = t[d], f = _.isMiddle;
f && (t[d] = delimiter.leftRightDelim(f.delim, r, a, f.options, n.mode, []));
}
var y;
@@ -6927,12 +6935,12 @@ var htmlBuilder$7 = (n, e) => {
var d = calculateSize({
number: 0.6,
unit: "pt"
- }, e), v = calculateSize({
+ }, e), _ = calculateSize({
number: 0.35,
unit: "ex"
}, e), f = e.havingBaseSizing();
a = a / f.sizeMultiplier;
- var y = t.height + t.depth + d + v;
+ var y = t.height + t.depth + d + _;
t.style.paddingLeft = makeEm(y / 2 + d);
var A = Math.floor(1e3 * y * a), x = phasePath(A), M = new SvgNode([new PathNode("phase", x)], {
width: "400em",
@@ -6940,7 +6948,7 @@ var htmlBuilder$7 = (n, e) => {
viewBox: "0 0 400000 " + A,
preserveAspectRatio: "xMinYMin slice"
});
- s = buildCommon.makeSvgSpan(["hide-tail"], [M], e), s.style.height = makeEm(y), h = t.depth + d + v;
+ s = buildCommon.makeSvgSpan(["hide-tail"], [M], e), s.style.height = makeEm(y), h = t.depth + d + _;
} else {
/cancel/.test(r) ? o || t.classes.push("cancel-pad") : r === "angl" ? t.classes.push("anglpad") : t.classes.push("boxpad");
var m = 0, l = 0, u = 0;
@@ -7187,12 +7195,12 @@ function parseArray(n, e, t) {
arraystretch: h,
colSeparationType: o,
autoTag: d,
- singleRow: v,
+ singleRow: _,
emptySingleRow: f,
maxNumCols: y,
leqno: A
} = e;
- if (n.gullet.beginGroup(), v || n.gullet.macros.set("\\cr", "\\\\\\relax"), !h) {
+ if (n.gullet.beginGroup(), _ || n.gullet.macros.set("\\cr", "\\\\\\relax"), !h) {
var x = n.gullet.expandMacroAsText("\\arraystretch");
if (x == null)
h = 1;
@@ -7208,7 +7216,7 @@ function parseArray(n, e, t) {
p && (n.gullet.macros.get("\\df@tag") ? (p.push(n.subparse([new Token("\\df@tag")])), n.gullet.macros.set("\\df@tag", void 0, !0)) : p.push(!!d && n.gullet.macros.get("\\@eqnsw") === "1"));
}
for (g(), u.push(getHLines(n)); ; ) {
- var c = n.parseExpression(!1, v ? "\\end" : "\\\\");
+ var c = n.parseExpression(!1, _ ? "\\end" : "\\\\");
n.gullet.endGroup(), n.gullet.beginGroup(), c = {
type: "ordgroup",
mode: n.mode,
@@ -7219,18 +7227,18 @@ function parseArray(n, e, t) {
style: t,
body: [c]
}), M.push(c);
- var _ = n.fetch().text;
- if (_ === "&") {
+ var v = n.fetch().text;
+ if (v === "&") {
if (y && M.length === y) {
- if (v || o)
+ if (_ || o)
throw new ParseError("Too many tab characters: &", n.nextToken);
n.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument.");
}
n.consume();
- } else if (_ === "\\end") {
+ } else if (v === "\\end") {
b(), M.length === 1 && c.type === "styling" && c.body[0].body.length === 0 && (m.length > 1 || !f) && m.pop(), u.length < m.length + 1 && u.push([]);
break;
- } else if (_ === "\\\\") {
+ } else if (v === "\\\\") {
n.consume();
var E = void 0;
n.gullet.future().text !== " " && (E = n.parseSizeGroup(!0)), l.push(E ? E.value : null), b(), u.push(getHLines(n)), M = [], m.push(M), g();
@@ -7256,7 +7264,7 @@ function dCellStyle(n) {
return n.slice(0, 1) === "d" ? "display" : "text";
}
var htmlBuilder$6 = function(e, t) {
- var r, a, s = e.body.length, h = e.hLinesBeforeRow, o = 0, d = new Array(s), v = [], f = Math.max(
+ var r, a, s = e.body.length, h = e.hLinesBeforeRow, o = 0, d = new Array(s), _ = [], f = Math.max(
// From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
t.fontMetrics().arrayRuleWidth,
t.minRuleThickness
@@ -7270,109 +7278,109 @@ var htmlBuilder$6 = function(e, t) {
number: 3,
unit: "ex"
}, t) : 12 * y, m = 3 * y, l = e.arraystretch * M, u = 0.7 * l, p = 0.3 * l, g = 0;
- function b(Be) {
- for (var Ue = 0; Ue < Be.length; ++Ue)
- Ue > 0 && (g += 0.25), v.push({
+ function b(Pe) {
+ for (var Ne = 0; Ne < Pe.length; ++Ne)
+ Ne > 0 && (g += 0.25), _.push({
pos: g,
- isDashed: Be[Ue]
+ isDashed: Pe[Ne]
});
}
for (b(h[0]), r = 0; r < e.body.length; ++r) {
- var c = e.body[r], _ = u, E = p;
+ var c = e.body[r], v = u, E = p;
o < c.length && (o = c.length);
var w = new Array(c.length);
for (a = 0; a < c.length; ++a) {
var k = buildGroup$1(c[a], t);
- E < k.depth && (E = k.depth), _ < k.height && (_ = k.height), w[a] = k;
+ E < k.depth && (E = k.depth), v < k.height && (v = k.height), w[a] = k;
}
var $ = e.rowGaps[r], L = 0;
- $ && (L = calculateSize($, t), L > 0 && (L += p, E < L && (E = L), L = 0)), e.addJot && (E += m), w.height = _, w.depth = E, g += _, w.pos = g, g += E + L, d[r] = w, b(h[r + 1]);
+ $ && (L = calculateSize($, t), L > 0 && (L += p, E < L && (E = L), L = 0)), e.addJot && (E += m), w.height = v, w.depth = E, g += v, w.pos = g, g += E + L, d[r] = w, b(h[r + 1]);
}
- var z = g / 2 + t.fontMetrics().axisHeight, F = e.cols || [], R = [], P, U, N = [];
- if (e.tags && e.tags.some((Be) => Be))
+ var I = g / 2 + t.fontMetrics().axisHeight, F = e.cols || [], P = [], B, G, U = [];
+ if (e.tags && e.tags.some((Pe) => Pe))
for (r = 0; r < s; ++r) {
- var B = d[r], W = B.pos - z, V = e.tags[r], G = void 0;
- V === !0 ? G = buildCommon.makeSpan(["eqn-num"], [], t) : V === !1 ? G = buildCommon.makeSpan([], [], t) : G = buildCommon.makeSpan([], buildExpression$1(V, t, !0), t), G.depth = B.depth, G.height = B.height, N.push({
+ var R = d[r], W = R.pos - I, H = e.tags[r], N = void 0;
+ H === !0 ? N = buildCommon.makeSpan(["eqn-num"], [], t) : H === !1 ? N = buildCommon.makeSpan([], [], t) : N = buildCommon.makeSpan([], buildExpression$1(H, t, !0), t), N.depth = R.depth, N.height = R.height, U.push({
type: "elem",
- elem: G,
+ elem: N,
shift: W
});
}
for (
- a = 0, U = 0;
+ a = 0, G = 0;
// Continue while either there are more columns or more column
// descriptions, so trailing separators don't get lost.
- a < o || U < F.length;
- ++a, ++U
+ a < o || G < F.length;
+ ++a, ++G
) {
- for (var H = F[U] || {}, Q = !0; H.type === "separator"; ) {
- if (Q || (P = buildCommon.makeSpan(["arraycolsep"], []), P.style.width = makeEm(t.fontMetrics().doubleRuleSep), R.push(P)), H.separator === "|" || H.separator === ":") {
- var te = H.separator === "|" ? "solid" : "dashed", ee = buildCommon.makeSpan(["vertical-separator"], [], t);
- ee.style.height = makeEm(g), ee.style.borderRightWidth = makeEm(f), ee.style.borderRightStyle = te, ee.style.margin = "0 " + makeEm(-f / 2);
- var ce = g - z;
- ce && (ee.style.verticalAlign = makeEm(-ce)), R.push(ee);
+ for (var V = F[G] || {}, J = !0; V.type === "separator"; ) {
+ if (J || (B = buildCommon.makeSpan(["arraycolsep"], []), B.style.width = makeEm(t.fontMetrics().doubleRuleSep), P.push(B)), V.separator === "|" || V.separator === ":") {
+ var re = V.separator === "|" ? "solid" : "dashed", te = buildCommon.makeSpan(["vertical-separator"], [], t);
+ te.style.height = makeEm(g), te.style.borderRightWidth = makeEm(f), te.style.borderRightStyle = re, te.style.margin = "0 " + makeEm(-f / 2);
+ var ue = g - I;
+ ue && (te.style.verticalAlign = makeEm(-ue)), P.push(te);
} else
- throw new ParseError("Invalid separator type: " + H.separator);
- U++, H = F[U] || {}, Q = !1;
+ throw new ParseError("Invalid separator type: " + V.separator);
+ G++, V = F[G] || {}, J = !1;
}
if (!(a >= o)) {
- var fe = void 0;
- (a > 0 || e.hskipBeforeAndAfter) && (fe = utils.deflt(H.pregap, A), fe !== 0 && (P = buildCommon.makeSpan(["arraycolsep"], []), P.style.width = makeEm(fe), R.push(P)));
- var oe = [];
+ var ie = void 0;
+ (a > 0 || e.hskipBeforeAndAfter) && (ie = utils.deflt(V.pregap, A), ie !== 0 && (B = buildCommon.makeSpan(["arraycolsep"], []), B.style.width = makeEm(ie), P.push(B)));
+ var ae = [];
for (r = 0; r < s; ++r) {
- var he = d[r], Ae = he[a];
- if (Ae) {
- var Se = he.pos - z;
- Ae.depth = he.depth, Ae.height = he.height, oe.push({
+ var ce = d[r], Me = ce[a];
+ if (Me) {
+ var Ae = ce.pos - I;
+ Me.depth = ce.depth, Me.height = ce.height, ae.push({
type: "elem",
- elem: Ae,
- shift: Se
+ elem: Me,
+ shift: Ae
});
}
}
- oe = buildCommon.makeVList({
+ ae = buildCommon.makeVList({
positionType: "individualShift",
- children: oe
- }, t), oe = buildCommon.makeSpan(["col-align-" + (H.align || "c")], [oe]), R.push(oe), (a < o - 1 || e.hskipBeforeAndAfter) && (fe = utils.deflt(H.postgap, A), fe !== 0 && (P = buildCommon.makeSpan(["arraycolsep"], []), P.style.width = makeEm(fe), R.push(P)));
+ children: ae
+ }, t), ae = buildCommon.makeSpan(["col-align-" + (V.align || "c")], [ae]), P.push(ae), (a < o - 1 || e.hskipBeforeAndAfter) && (ie = utils.deflt(V.postgap, A), ie !== 0 && (B = buildCommon.makeSpan(["arraycolsep"], []), B.style.width = makeEm(ie), P.push(B)));
}
}
- if (d = buildCommon.makeSpan(["mtable"], R), v.length > 0) {
- for (var Ie = buildCommon.makeLineSpan("hline", t, f), pe = buildCommon.makeLineSpan("hdashline", t, f), le = [{
+ if (d = buildCommon.makeSpan(["mtable"], P), _.length > 0) {
+ for (var Ie = buildCommon.makeLineSpan("hline", t, f), pe = buildCommon.makeLineSpan("hdashline", t, f), se = [{
type: "elem",
elem: d,
shift: 0
- }]; v.length > 0; ) {
- var ne = v.pop(), Te = ne.pos - z;
- ne.isDashed ? le.push({
+ }]; _.length > 0; ) {
+ var Q = _.pop(), ye = Q.pos - I;
+ Q.isDashed ? se.push({
type: "elem",
elem: pe,
- shift: Te
- }) : le.push({
+ shift: ye
+ }) : se.push({
type: "elem",
elem: Ie,
- shift: Te
+ shift: ye
});
}
d = buildCommon.makeVList({
positionType: "individualShift",
- children: le
+ children: se
}, t);
}
- if (N.length === 0)
+ if (U.length === 0)
return buildCommon.makeSpan(["mord"], [d], t);
- var Oe = buildCommon.makeVList({
+ var ke = buildCommon.makeVList({
positionType: "individualShift",
- children: N
+ children: U
}, t);
- return Oe = buildCommon.makeSpan(["tag"], [Oe], t), buildCommon.makeFragment([d, Oe]);
+ return ke = buildCommon.makeSpan(["tag"], [ke], t), buildCommon.makeFragment([d, ke]);
}, alignMap = {
c: "center ",
l: "left ",
r: "right "
}, mathmlBuilder$5 = function(e, t) {
for (var r = [], a = new mathMLTree.MathNode("mtd", [], ["mtr-glue"]), s = new mathMLTree.MathNode("mtd", [], ["mml-eqn-num"]), h = 0; h < e.body.length; h++) {
- for (var o = e.body[h], d = [], v = 0; v < o.length; v++)
- d.push(new mathMLTree.MathNode("mtd", [buildGroup(o[v], t)]));
+ for (var o = e.body[h], d = [], _ = 0; _ < o.length; _++)
+ d.push(new mathMLTree.MathNode("mtd", [buildGroup(o[_], t)]));
e.tags && e.tags[h] && (d.unshift(a), d.push(a), e.leqno ? d.unshift(s) : d.push(s)), r.push(new mathMLTree.MathNode("mtr", d));
}
var f = new mathMLTree.MathNode("mtable", r), y = e.arraystretch === 0.5 ? 0.1 : 0.16 + e.arraystretch - 1 + (e.addJot ? 0.09 : 0);
@@ -7386,8 +7394,8 @@ var htmlBuilder$6 = function(e, t) {
f.setAttribute("columnalign", x.trim()), /[sd]/.test(m) && f.setAttribute("columnlines", m.trim());
}
if (e.colSeparationType === "align") {
- for (var b = e.cols || [], c = "", _ = 1; _ < b.length; _++)
- c += _ % 2 ? "0em " : "1em ";
+ for (var b = e.cols || [], c = "", v = 1; v < b.length; v++)
+ c += v % 2 ? "0em " : "1em ";
f.setAttribute("columnspacing", c.trim());
} else e.colSeparationType === "alignat" || e.colSeparationType === "gather" ? f.setAttribute("columnspacing", "0em") : e.colSeparationType === "small" ? f.setAttribute("columnspacing", "0.2778em") : e.colSeparationType === "CD" ? f.setAttribute("columnspacing", "0.5em") : f.setAttribute("columnspacing", "1em");
var E = "", w = e.hLinesBeforeRow;
@@ -7405,7 +7413,7 @@ var htmlBuilder$6 = function(e, t) {
colSeparationType: a,
maxNumCols: s ? 2 : void 0,
leqno: e.parser.settings.leqno
- }, "display"), o, d = 0, v = {
+ }, "display"), o, d = 0, _ = {
type: "ordgroup",
mode: e.mode,
body: []
@@ -7421,7 +7429,7 @@ var htmlBuilder$6 = function(e, t) {
h.body.forEach(function(u) {
for (var p = 1; p < u.length; p += 2) {
var g = assertNodeType(u[p], "styling"), b = assertNodeType(g.body[0], "ordgroup");
- b.body.unshift(v);
+ b.body.unshift(_);
}
if (x)
d < u.length && (d = u.length);
@@ -7723,12 +7731,12 @@ defineFunction({
throw new ParseError("No such environment: " + s, a);
var o = environments[s], {
args: d,
- optArgs: v
+ optArgs: _
} = t.parseArguments("\\begin{" + s + "}", o), f = {
mode: t.mode,
envName: s,
parser: t
- }, y = o.handler(f, d, v);
+ }, y = o.handler(f, d, _);
t.expect("\\end", !1);
var A = t.nextToken, x = assertNodeType(t.parseFunction(), "environment");
if (x.name !== s)
@@ -7859,20 +7867,20 @@ var adjustStyle = (n, e) => {
h.height = h.height < o ? o : h.height, h.depth = h.depth < d ? d : h.depth;
}
s = e.havingStyle(a);
- var v = buildGroup$1(n.denom, s, e), f, y, A;
+ var _ = buildGroup$1(n.denom, s, e), f, y, A;
n.hasBarLine ? (n.barSize ? (y = calculateSize(n.barSize, e), f = buildCommon.makeLineSpan("frac-line", e, y)) : f = buildCommon.makeLineSpan("frac-line", e), y = f.height, A = f.height) : (f = null, y = 0, A = e.fontMetrics().defaultRuleThickness);
var x, M, m;
t.size === Style$1.DISPLAY.size || n.size === "display" ? (x = e.fontMetrics().num1, y > 0 ? M = 3 * A : M = 7 * A, m = e.fontMetrics().denom1) : (y > 0 ? (x = e.fontMetrics().num2, M = A) : (x = e.fontMetrics().num3, M = 3 * A), m = e.fontMetrics().denom2);
var l;
if (f) {
var p = e.fontMetrics().axisHeight;
- x - h.depth - (p + 0.5 * y) < M && (x += M - (x - h.depth - (p + 0.5 * y))), p - 0.5 * y - (v.height - m) < M && (m += M - (p - 0.5 * y - (v.height - m)));
+ x - h.depth - (p + 0.5 * y) < M && (x += M - (x - h.depth - (p + 0.5 * y))), p - 0.5 * y - (_.height - m) < M && (m += M - (p - 0.5 * y - (_.height - m)));
var g = -(p - 0.5 * y);
l = buildCommon.makeVList({
positionType: "individualShift",
children: [{
type: "elem",
- elem: v,
+ elem: _,
shift: m
}, {
type: "elem",
@@ -7885,12 +7893,12 @@ var adjustStyle = (n, e) => {
}]
}, e);
} else {
- var u = x - h.depth - (v.height - m);
+ var u = x - h.depth - (_.height - m);
u < M && (x += 0.5 * (M - u), m += 0.5 * (M - u)), l = buildCommon.makeVList({
positionType: "individualShift",
children: [{
type: "elem",
- elem: v,
+ elem: _,
shift: m
}, {
type: "elem",
@@ -7902,8 +7910,8 @@ var adjustStyle = (n, e) => {
s = e.havingStyle(t), l.height *= s.sizeMultiplier / e.sizeMultiplier, l.depth *= s.sizeMultiplier / e.sizeMultiplier;
var b;
t.size === Style$1.DISPLAY.size ? b = e.fontMetrics().delim1 : t.size === Style$1.SCRIPTSCRIPT.size ? b = e.havingStyle(Style$1.SCRIPT).fontMetrics().delim2 : b = e.fontMetrics().delim2;
- var c, _;
- return n.leftDelim == null ? c = makeNullDelimiter(e, ["mopen"]) : c = delimiter.customSizedDelim(n.leftDelim, b, !0, e.havingStyle(t), n.mode, ["mopen"]), n.continued ? _ = buildCommon.makeSpan([]) : n.rightDelim == null ? _ = makeNullDelimiter(e, ["mclose"]) : _ = delimiter.customSizedDelim(n.rightDelim, b, !0, e.havingStyle(t), n.mode, ["mclose"]), buildCommon.makeSpan(["mord"].concat(s.sizingClasses(e)), [c, buildCommon.makeSpan(["mfrac"], [l]), _], e);
+ var c, v;
+ return n.leftDelim == null ? c = makeNullDelimiter(e, ["mopen"]) : c = delimiter.customSizedDelim(n.leftDelim, b, !0, e.havingStyle(t), n.mode, ["mopen"]), n.continued ? v = buildCommon.makeSpan([]) : n.rightDelim == null ? v = makeNullDelimiter(e, ["mclose"]) : v = delimiter.customSizedDelim(n.rightDelim, b, !0, e.havingStyle(t), n.mode, ["mclose"]), buildCommon.makeSpan(["mord"].concat(s.sizingClasses(e)), [c, buildCommon.makeSpan(["mfrac"], [l]), v], e);
}, mathmlBuilder$3 = (n, e) => {
var t = new mathMLTree.MathNode("mfrac", [buildGroup(n.numer, e), buildGroup(n.denom, e)]);
if (!n.hasBarLine)
@@ -7955,7 +7963,7 @@ defineFunction({
var {
parser: t,
funcName: r
- } = n, a = e[0], s = e[1], h, o = null, d = null, v = "auto";
+ } = n, a = e[0], s = e[1], h, o = null, d = null, _ = "auto";
switch (r) {
case "\\dfrac":
case "\\frac":
@@ -7982,11 +7990,11 @@ defineFunction({
switch (r) {
case "\\dfrac":
case "\\dbinom":
- v = "display";
+ _ = "display";
break;
case "\\tfrac":
case "\\tbinom":
- v = "text";
+ _ = "text";
break;
}
return {
@@ -7998,7 +8006,7 @@ defineFunction({
hasBarLine: h,
leftDelim: o,
rightDelim: d,
- size: v,
+ size: _,
barSize: null
};
},
@@ -8085,8 +8093,8 @@ defineFunction({
handler(n, e) {
var {
parser: t
- } = n, r = e[4], a = e[5], s = normalizeArgument(e[0]), h = s.type === "atom" && s.family === "open" ? delimFromValue(s.text) : null, o = normalizeArgument(e[1]), d = o.type === "atom" && o.family === "close" ? delimFromValue(o.text) : null, v = assertNodeType(e[2], "size"), f, y = null;
- v.isBlank ? f = !0 : (y = v.value, f = y.number > 0);
+ } = n, r = e[4], a = e[5], s = normalizeArgument(e[0]), h = s.type === "atom" && s.family === "open" ? delimFromValue(s.text) : null, o = normalizeArgument(e[1]), d = o.type === "atom" && o.family === "close" ? delimFromValue(o.text) : null, _ = assertNodeType(e[2], "size"), f, y = null;
+ _.isBlank ? f = !0 : (y = _.value, f = y.number > 0);
var A = "auto", x = e[3];
if (x.type === "ordgroup") {
if (x.body.length > 0) {
@@ -8380,8 +8388,8 @@ defineFunction({
};
break;
case "\\htmlData": {
- for (var v = s.split(","), f = 0; f < v.length; f++) {
- var y = v[f].split("=");
+ for (var _ = s.split(","), f = 0; f < _.length; f++) {
+ var y = _[f].split("=");
if (y.length !== 2)
throw new ParseError("Error parsing key-value for \\htmlData");
d["data-" + y[0].trim()] = y[1].trim();
@@ -8477,8 +8485,8 @@ defineFunction({
unit: "em"
}, o = "";
if (t[0])
- for (var d = assertNodeType(t[0], "raw").string, v = d.split(","), f = 0; f < v.length; f++) {
- var y = v[f].split("=");
+ for (var d = assertNodeType(t[0], "raw").string, _ = d.split(","), f = 0; f < _.length; f++) {
+ var y = _[f].split("=");
if (y.length === 2) {
var A = y[1].trim();
switch (y[0].trim()) {
@@ -8683,10 +8691,10 @@ defineFunction({
});
var assembleSupSub = (n, e, t, r, a, s, h) => {
n = buildCommon.makeSpan([], [n]);
- var o = t && utils.isCharacterBox(t), d, v;
+ var o = t && utils.isCharacterBox(t), d, _;
if (e) {
var f = buildGroup$1(e, r.havingStyle(a.sup()), r);
- v = {
+ _ = {
elem: f,
kern: Math.max(r.fontMetrics().bigOpSpacing1, r.fontMetrics().bigOpSpacing3 - f.depth)
};
@@ -8699,7 +8707,7 @@ var assembleSupSub = (n, e, t, r, a, s, h) => {
};
}
var A;
- if (v && d) {
+ if (_ && d) {
var x = r.fontMetrics().bigOpSpacing5 + d.elem.height + d.elem.depth + d.kern + n.depth + h;
A = buildCommon.makeVList({
positionType: "bottom",
@@ -8719,10 +8727,10 @@ var assembleSupSub = (n, e, t, r, a, s, h) => {
elem: n
}, {
type: "kern",
- size: v.kern
+ size: _.kern
}, {
type: "elem",
- elem: v.elem,
+ elem: _.elem,
marginLeft: makeEm(s)
}, {
type: "kern",
@@ -8749,7 +8757,7 @@ var assembleSupSub = (n, e, t, r, a, s, h) => {
elem: n
}]
}, r);
- } else if (v) {
+ } else if (_) {
var m = n.depth + h;
A = buildCommon.makeVList({
positionType: "bottom",
@@ -8759,10 +8767,10 @@ var assembleSupSub = (n, e, t, r, a, s, h) => {
elem: n
}, {
type: "kern",
- size: v.kern
+ size: _.kern
}, {
type: "elem",
- elem: v.elem,
+ elem: _.elem,
marginLeft: makeEm(s)
}, {
type: "kern",
@@ -8784,8 +8792,8 @@ var assembleSupSub = (n, e, t, r, a, s, h) => {
h.size === Style$1.DISPLAY.size && s.symbol && !utils.contains(noSuccessor, s.name) && (o = !0);
var d;
if (s.symbol) {
- var v = o ? "Size2-Regular" : "Size1-Regular", f = "";
- if ((s.name === "\\oiint" || s.name === "\\oiiint") && (f = s.name.slice(1), s.name = f === "oiint" ? "\\iint" : "\\iiint"), d = buildCommon.makeSymbol(s.name, v, "math", e, ["mop", "op-symbol", o ? "large-op" : "small-op"]), f.length > 0) {
+ var _ = o ? "Size2-Regular" : "Size1-Regular", f = "";
+ if ((s.name === "\\oiint" || s.name === "\\oiiint") && (f = s.name.slice(1), s.name = f === "oiint" ? "\\iint" : "\\iiint"), d = buildCommon.makeSymbol(s.name, _, "math", e, ["mop", "op-symbol", o ? "large-op" : "small-op"]), f.length > 0) {
var y = d.italic, A = buildCommon.staticSvg(f + "Size" + (o ? "2" : "1"), e);
d = buildCommon.makeVList({
positionType: "individualShift",
@@ -8971,8 +8979,8 @@ var htmlBuilder$1 = (n, e) => {
mode: y.mode,
text: A
} : y;
- }), d = buildExpression$1(o, e.withFont("mathrm"), !0), v = 0; v < d.length; v++) {
- var f = d[v];
+ }), d = buildExpression$1(o, e.withFont("mathrm"), !0), _ = 0; _ < d.length; _++) {
+ var f = d[_];
f instanceof SymbolNode && (f.text = f.text.replace(/\u2212/, "-").replace(/\u2217/, "*"));
}
h = buildCommon.makeSpan(["mop"], d, e);
@@ -9007,8 +9015,8 @@ var htmlBuilder$1 = (n, e) => {
}
var d = new mathMLTree.MathNode("mi", t);
d.setAttribute("mathvariant", "normal");
- var v = new mathMLTree.MathNode("mo", [makeText("", "text")]);
- return n.parentIsSupSub ? new mathMLTree.MathNode("mrow", [d, v]) : mathMLTree.newDocumentFragment([d, v]);
+ var _ = new mathMLTree.MathNode("mo", [makeText("", "text")]);
+ return n.parentIsSupSub ? new mathMLTree.MathNode("mrow", [d, _]) : mathMLTree.newDocumentFragment([d, _]);
};
defineFunction({
type: "operatorname",
@@ -9307,8 +9315,8 @@ defineFunction({
} = n, a = !1, s = !1, h = t[0] && assertNodeType(t[0], "ordgroup");
if (h)
for (var o = "", d = 0; d < h.body.length; ++d) {
- var v = h.body[d];
- if (o = v.text, o === "t")
+ var _ = h.body[d];
+ if (o = _.text, o === "t")
a = !0;
else if (o === "b")
s = !0;
@@ -9377,11 +9385,11 @@ defineFunction({
e.style.id < Style$1.TEXT.id && (s = e.fontMetrics().xHeight);
var h = a + s / 4, o = t.height + t.depth + h + a, {
span: d,
- ruleWidth: v,
+ ruleWidth: _,
advanceWidth: f
- } = delimiter.sqrtImage(o, e), y = d.height - v;
+ } = delimiter.sqrtImage(o, e), y = d.height - _;
y > t.height + t.depth + h && (h = (h + y - t.height - t.depth) / 2);
- var A = d.height - t.height - h - v;
+ var A = d.height - t.height - h - _;
t.style.paddingLeft = makeEm(f);
var x = buildCommon.makeVList({
positionType: "firstBaseline",
@@ -9397,7 +9405,7 @@ defineFunction({
elem: d
}, {
type: "kern",
- size: v
+ size: _
}]
}, e);
if (n.index) {
@@ -9494,7 +9502,7 @@ defineFunctionBuilders({
base: r,
sup: a,
sub: s
- } = n, h = buildGroup$1(r, e), o, d, v = e.fontMetrics(), f = 0, y = 0, A = r && utils.isCharacterBox(r);
+ } = n, h = buildGroup$1(r, e), o, d, _ = e.fontMetrics(), f = 0, y = 0, A = r && utils.isCharacterBox(r);
if (a) {
var x = e.havingStyle(e.style.sup());
o = buildGroup$1(a, x, e), A || (f = h.height - x.fontMetrics().supDrop * x.sizeMultiplier / e.sizeMultiplier);
@@ -9504,19 +9512,19 @@ defineFunctionBuilders({
d = buildGroup$1(s, M, e), A || (y = h.depth + M.fontMetrics().subDrop * M.sizeMultiplier / e.sizeMultiplier);
}
var m;
- e.style === Style$1.DISPLAY ? m = v.sup1 : e.style.cramped ? m = v.sup3 : m = v.sup2;
- var l = e.sizeMultiplier, u = makeEm(0.5 / v.ptPerEm / l), p = null;
+ e.style === Style$1.DISPLAY ? m = _.sup1 : e.style.cramped ? m = _.sup3 : m = _.sup2;
+ var l = e.sizeMultiplier, u = makeEm(0.5 / _.ptPerEm / l), p = null;
if (d) {
var g = n.base && n.base.type === "op" && n.base.name && (n.base.name === "\\oiint" || n.base.name === "\\oiiint");
(h instanceof SymbolNode || g) && (p = makeEm(-h.italic));
}
var b;
if (o && d) {
- f = Math.max(f, m, o.depth + 0.25 * v.xHeight), y = Math.max(y, v.sub2);
- var c = v.defaultRuleThickness, _ = 4 * c;
- if (f - o.depth - (d.height - y) < _) {
- y = _ - (f - o.depth) + d.height;
- var E = 0.8 * v.xHeight - (f - o.depth);
+ f = Math.max(f, m, o.depth + 0.25 * _.xHeight), y = Math.max(y, _.sub2);
+ var c = _.defaultRuleThickness, v = 4 * c;
+ if (f - o.depth - (d.height - y) < v) {
+ y = v - (f - o.depth) + d.height;
+ var E = 0.8 * _.xHeight - (f - o.depth);
E > 0 && (f += E, y -= E);
}
var w = [{
@@ -9536,7 +9544,7 @@ defineFunctionBuilders({
children: w
}, e);
} else if (d) {
- y = Math.max(y, v.sub1, d.height - 0.8 * v.xHeight);
+ y = Math.max(y, _.sub1, d.height - 0.8 * _.xHeight);
var k = [{
type: "elem",
elem: d,
@@ -9549,7 +9557,7 @@ defineFunctionBuilders({
children: k
}, e);
} else if (o)
- f = Math.max(f, m, o.depth + 0.25 * v.xHeight), b = buildCommon.makeVList({
+ f = Math.max(f, m, o.depth + 0.25 * _.xHeight), b = buildCommon.makeVList({
positionType: "shift",
positionData: -f,
children: [{
@@ -9573,8 +9581,8 @@ defineFunctionBuilders({
h = r ? "mover" : "munder";
else if (n.sub)
if (n.sup) {
- var v = n.base;
- v && v.type === "op" && v.limits && e.style === Style$1.DISPLAY || v && v.type === "operatorname" && v.alwaysHandleSupSub && (e.style === Style$1.DISPLAY || v.limits) ? h = "munderover" : h = "msubsup";
+ var _ = n.base;
+ _ && _.type === "op" && _.limits && e.style === Style$1.DISPLAY || _ && _.type === "operatorname" && _.alwaysHandleSupSub && (e.style === Style$1.DISPLAY || _.limits) ? h = "munderover" : h = "msubsup";
} else {
var d = n.base;
d && d.type === "op" && d.limits && (e.style === Style$1.DISPLAY || d.alwaysHandleSupSub) || d && d.type === "operatorname" && d.alwaysHandleSupSub && (d.limits || e.style === Style$1.DISPLAY) ? h = "munder" : h = "msub";
@@ -10468,9 +10476,9 @@ var braketHelper = (n) => (e) => {
};
};
e.macros.set("|", d(!1)), a.length && e.macros.set("\\|", d(!0));
- var v = e.consumeArg().tokens, f = e.expandTokens([
+ var _ = e.consumeArg().tokens, f = e.expandTokens([
...s,
- ...v,
+ ..._,
...t
// reversed
]);
@@ -10817,8 +10825,8 @@ class MacroExpander {
if (a.indexOf("#") !== -1)
for (var h = a.replace(/##/g, ""); h.indexOf("#" + (s + 1)) !== -1; )
++s;
- for (var o = new Lexer(a, this.settings), d = [], v = o.lex(); v.text !== "EOF"; )
- d.push(v), v = o.lex();
+ for (var o = new Lexer(a, this.settings), d = [], _ = o.lex(); _.text !== "EOF"; )
+ d.push(_), _ = o.lex();
d.reverse();
var f = {
tokens: d,
@@ -11447,8 +11455,8 @@ class Parser {
mode: this.mode,
body: d
};
- var v;
- return r === "\\\\abovefrac" ? v = this.callFunction(r, [s, e[t], h], []) : v = this.callFunction(r, [s, h], []), [v];
+ var _;
+ return r === "\\\\abovefrac" ? _ = this.callFunction(r, [s, e[t], h], []) : _ = this.callFunction(r, [s, h], []), [_];
} else
return e;
}
@@ -11529,15 +11537,15 @@ class Parser {
body: d
};
} else if (uSubsAndSups[s.text]) {
- var v = unicodeSubRegEx.test(s.text), f = [];
+ var _ = unicodeSubRegEx.test(s.text), f = [];
for (f.push(new Token(uSubsAndSups[s.text])), this.consume(); ; ) {
var y = this.fetch().text;
- if (!uSubsAndSups[y] || unicodeSubRegEx.test(y) !== v)
+ if (!uSubsAndSups[y] || unicodeSubRegEx.test(y) !== _)
break;
f.unshift(new Token(uSubsAndSups[y])), this.consume();
}
var A = this.subparse(f);
- v ? a = {
+ _ ? a = {
type: "ordgroup",
mode: "math",
body: A
@@ -11604,11 +11612,11 @@ class Parser {
var o = t.argTypes && t.argTypes[h], d = h < t.numOptionalArgs;
(t.primitive && o == null || // \sqrt expands into primitive if optional argument doesn't exist
t.type === "sqrt" && h === 1 && s[0] == null) && (o = "primitive");
- var v = this.parseGroupOfType("argument to '" + e + "'", o, d);
+ var _ = this.parseGroupOfType("argument to '" + e + "'", o, d);
if (d)
- s.push(v);
- else if (v != null)
- a.push(v);
+ s.push(_);
+ else if (_ != null)
+ a.push(_);
else
throw new ParseError("Null argument, please report this as a bug");
}
@@ -11858,10 +11866,10 @@ class Parser {
var h;
if (symbols[this.mode][t]) {
this.settings.strict && this.mode === "math" && extraLatin.indexOf(t) >= 0 && this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + t[0] + '" used in math mode', e);
- var o = symbols[this.mode][t].group, d = SourceLocation.range(e), v;
+ var o = symbols[this.mode][t].group, d = SourceLocation.range(e), _;
if (ATOMS.hasOwnProperty(o)) {
var f = o;
- v = {
+ _ = {
type: "atom",
mode: this.mode,
family: f,
@@ -11869,13 +11877,13 @@ class Parser {
text: t
};
} else
- v = {
+ _ = {
type: o,
mode: this.mode,
loc: d,
text: t
};
- h = v;
+ h = _;
} else if (t.charCodeAt(0) >= 128)
this.settings.strict && (supportedCodepoint(t.charCodeAt(0)) ? this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Unicode text character "' + t[0] + '" used in math mode', e) : this.settings.reportNonstrict("unknownSymbol", 'Unrecognized Unicode character "' + t[0] + '"' + (" (" + t.charCodeAt(0) + ")"), e)), h = {
type: "textord",
@@ -12055,12 +12063,12 @@ var renderToString = function(e, t) {
}, escapeRegex = function(e) {
return e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
}, amsRegex = /^\\begin{/, splitAtDelimiters = function(e, t) {
- for (var r, a = [], s = new RegExp("(" + t.map((v) => escapeRegex(v.left)).join("|") + ")"); r = e.search(s), r !== -1; ) {
+ for (var r, a = [], s = new RegExp("(" + t.map((_) => escapeRegex(_.left)).join("|") + ")"); r = e.search(s), r !== -1; ) {
r > 0 && (a.push({
type: "text",
data: e.slice(0, r)
}), e = e.slice(r));
- var h = t.findIndex((v) => e.startsWith(v.left));
+ var h = t.findIndex((_) => e.startsWith(_.left));
if (r = findEndOfMath(t[h].right, e, t[h].left.length), r === -1)
break;
var o = e.slice(0, r + t[h].right.length), d = amsRegex.test(o) ? o : e.slice(t[h].left.length, r);
@@ -12104,7 +12112,7 @@ var renderToString = function(e, t) {
s += h.textContent, h = h.nextSibling, o++;
var d = renderMathInText(s, t);
if (d) {
- for (var v = 0; v < o; v++)
+ for (var _ = 0; _ < o; _++)
a.nextSibling.remove();
r += d.childNodes.length - 1, e.replaceChild(d, a);
} else
@@ -12228,8 +12236,8 @@ function cleanUrl(n) {
const noopTest = { exec: () => null };
function splitCells(n, e) {
const t = n.replace(/\|/g, (s, h, o) => {
- let d = !1, v = h;
- for (; --v >= 0 && o[v] === "\\"; )
+ let d = !1, _ = h;
+ for (; --_ >= 0 && o[_] === "\\"; )
d = !d;
return d ? "|" : " |";
}), r = t.split(/ \|/);
@@ -12311,12 +12319,12 @@ function indentCodeCompensation(n, e) {
`);
}
class _Tokenizer {
- options;
- rules;
- // set by the lexer
- lexer;
// set by the lexer
constructor(e) {
+ Dt(this, "options");
+ Dt(this, "rules");
+ // set by the lexer
+ Dt(this, "lexer");
this.options = e || _defaults;
}
space(e) {
@@ -12409,7 +12417,7 @@ class _Tokenizer {
};
r = a ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = a ? r : "[*+-]");
const h = new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);
- let o = "", d = "", v = !1;
+ let o = "", d = "", _ = !1;
for (; e; ) {
let f = !1;
if (!(t = h.exec(e)) || this.rules.block.hr.test(e))
@@ -12441,7 +12449,7 @@ class _Tokenizer {
`, e = e.substring(c.length + 1), y = A.slice(x);
}
}
- s.loose || (v ? s.loose = !0 : /\n *\n *$/.test(o) && (v = !0));
+ s.loose || (_ ? s.loose = !0 : /\n *\n *$/.test(o) && (_ = !0));
let m = null, l;
this.options.gfm && (m = /^\[[ xX]\] /.exec(d), m && (l = m[0] !== "[ ] ", d = d.replace(/^\[[ xX]\] +/, ""))), s.items.push({
type: "list_item",
@@ -12622,21 +12630,21 @@ class _Tokenizer {
return;
if (!(a[1] || a[2] || "") || !r || this.rules.inline.punctuation.exec(r)) {
const h = [...a[0]].length - 1;
- let o, d, v = h, f = 0;
+ let o, d, _ = h, f = 0;
const y = a[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
for (y.lastIndex = 0, t = t.slice(-1 * e.length + h); (a = y.exec(t)) != null; ) {
if (o = a[1] || a[2] || a[3] || a[4] || a[5] || a[6], !o)
continue;
if (d = [...o].length, a[3] || a[4]) {
- v += d;
+ _ += d;
continue;
} else if ((a[5] || a[6]) && h % 3 && !((h + d) % 3)) {
f += d;
continue;
}
- if (v -= d, v > 0)
+ if (_ -= d, _ > 0)
continue;
- d = Math.min(d, d + v + f);
+ d = Math.min(d, d + _ + f);
const A = [...a[0]][0].length, x = e.slice(0, h + a.index + A + d);
if (Math.min(h, d) % 2) {
const m = x.slice(1, -1);
@@ -12707,28 +12715,29 @@ class _Tokenizer {
}
}
url(e) {
+ var r;
let t;
if (t = this.rules.inline.url.exec(e)) {
- let r, a;
+ let a, s;
if (t[2] === "@")
- r = escape$1$1(t[0]), a = "mailto:" + r;
+ a = escape$1$1(t[0]), s = "mailto:" + a;
else {
- let s;
+ let h;
do
- s = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
- while (s !== t[0]);
- r = escape$1$1(t[0]), t[1] === "www." ? a = "http://" + t[0] : a = t[0];
+ h = t[0], t[0] = ((r = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : r[0]) ?? "";
+ while (h !== t[0]);
+ a = escape$1$1(t[0]), t[1] === "www." ? s = "http://" + t[0] : s = t[0];
}
return {
type: "link",
raw: t[0],
- text: r,
- href: a,
+ text: a,
+ href: s,
tokens: [
{
type: "text",
- raw: r,
- text: r
+ raw: a,
+ text: a
}
]
};
@@ -12821,12 +12830,12 @@ const newline = /^(?: *(?:\n|$))+/, blockCode = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))
pedantic: inlinePedantic
};
class _Lexer {
- tokens;
- options;
- state;
- tokenizer;
- inlineQueue;
constructor(e) {
+ Dt(this, "tokens");
+ Dt(this, "options");
+ Dt(this, "state");
+ Dt(this, "tokenizer");
+ Dt(this, "inlineQueue");
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || _defaults, this.options.tokenizer = this.options.tokenizer || new _Tokenizer(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
inLink: !1,
inRawBlock: !1,
@@ -12872,7 +12881,7 @@ class _Lexer {
return this.inlineQueue = [], this.tokens;
}
blockTokens(e, t = []) {
- this.options.pedantic ? e = e.replace(/\t/g, " ").replace(/^ +$/gm, "") : e = e.replace(/^( *)(\t+)/gm, (o, d, v) => d + " ".repeat(v.length));
+ this.options.pedantic ? e = e.replace(/\t/g, " ").replace(/^ +$/gm, "") : e = e.replace(/^( *)(\t+)/gm, (o, d, _) => d + " ".repeat(_.length));
let r, a, s, h;
for (; e; )
if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((o) => (r = o.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1))) {
@@ -12931,9 +12940,9 @@ class _Lexer {
if (s = e, this.options.extensions && this.options.extensions.startBlock) {
let o = 1 / 0;
const d = e.slice(1);
- let v;
+ let _;
this.options.extensions.startBlock.forEach((f) => {
- v = f.call({ lexer: this }, d), typeof v == "number" && v >= 0 && (o = Math.min(o, v));
+ _ = f.call({ lexer: this }, d), typeof _ == "number" && _ >= 0 && (o = Math.min(o, _));
}), o < 1 / 0 && o >= 0 && (s = e.substring(0, o + 1));
}
if (this.state.top && (r = this.tokenizer.paragraph(s))) {
@@ -12966,7 +12975,7 @@ class _Lexer {
* Lexing/Compiling
*/
inlineTokens(e, t = []) {
- let r, a, s, h = e, o, d, v;
+ let r, a, s, h = e, o, d, _;
if (this.tokens.links) {
const f = Object.keys(this.tokens.links);
if (f.length > 0)
@@ -12978,7 +12987,7 @@ class _Lexer {
for (; (o = this.tokenizer.rules.inline.anyPunctuation.exec(h)) != null; )
h = h.slice(0, o.index) + "++" + h.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
for (; e; )
- if (d || (v = ""), d = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((f) => (r = f.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1))) {
+ if (d || (_ = ""), d = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((f) => (r = f.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1))) {
if (r = this.tokenizer.escape(e)) {
e = e.substring(r.raw.length), t.push(r);
continue;
@@ -12995,7 +13004,7 @@ class _Lexer {
e = e.substring(r.raw.length), a = t[t.length - 1], a && r.type === "text" && a.type === "text" ? (a.raw += r.raw, a.text += r.text) : t.push(r);
continue;
}
- if (r = this.tokenizer.emStrong(e, h, v)) {
+ if (r = this.tokenizer.emStrong(e, h, _)) {
e = e.substring(r.raw.length), t.push(r);
continue;
}
@@ -13028,7 +13037,7 @@ class _Lexer {
}), f < 1 / 0 && f >= 0 && (s = e.substring(0, f + 1));
}
if (r = this.tokenizer.inlineText(s)) {
- e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (v = r.raw.slice(-1)), d = !0, a = t[t.length - 1], a && a.type === "text" ? (a.raw += r.raw, a.text += r.text) : t.push(r);
+ e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (_ = r.raw.slice(-1)), d = !0, a = t[t.length - 1], a && a.type === "text" ? (a.raw += r.raw, a.text += r.text) : t.push(r);
continue;
}
if (e) {
@@ -13044,12 +13053,13 @@ class _Lexer {
}
}
class _Renderer {
- options;
constructor(e) {
+ Dt(this, "options");
this.options = e || _defaults;
}
code(e, t, r) {
- const a = (t || "").match(/^\S*/)?.[0];
+ var s;
+ const a = (s = (t || "").match(/^\S*/)) == null ? void 0 : s[0];
return e = e.replace(/\n$/, "") + `
`, a ? '
' + (r ? e : escape$1$1(e, !0)) + `
` : "" + (r ? e : escape$1$1(e, !0)) + `
@@ -13174,10 +13184,10 @@ class _TextRenderer {
}
}
class _Parser {
- options;
- renderer;
- textRenderer;
constructor(e) {
+ Dt(this, "options");
+ Dt(this, "renderer");
+ Dt(this, "textRenderer");
this.options = e || _defaults, this.options.renderer = this.options.renderer || new _Renderer(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new _TextRenderer();
}
/**
@@ -13229,15 +13239,15 @@ class _Parser {
for (let f = 0; f < h.header.length; f++)
d += this.renderer.tablecell(this.parseInline(h.header[f].tokens), { header: !0, align: h.align[f] });
o += this.renderer.tablerow(d);
- let v = "";
+ let _ = "";
for (let f = 0; f < h.rows.length; f++) {
const y = h.rows[f];
d = "";
for (let A = 0; A < y.length; A++)
d += this.renderer.tablecell(this.parseInline(y[A].tokens), { header: !1, align: h.align[A] });
- v += this.renderer.tablerow(d);
+ _ += this.renderer.tablerow(d);
}
- r += this.renderer.table(o, v);
+ r += this.renderer.table(o, _);
continue;
}
case "blockquote": {
@@ -13246,19 +13256,19 @@ class _Parser {
continue;
}
case "list": {
- const h = s, o = h.ordered, d = h.start, v = h.loose;
+ const h = s, o = h.ordered, d = h.start, _ = h.loose;
let f = "";
for (let y = 0; y < h.items.length; y++) {
const A = h.items[y], x = A.checked, M = A.task;
let m = "";
if (A.task) {
const l = this.renderer.checkbox(!!x);
- v ? A.tokens.length > 0 && A.tokens[0].type === "paragraph" ? (A.tokens[0].text = l + " " + A.tokens[0].text, A.tokens[0].tokens && A.tokens[0].tokens.length > 0 && A.tokens[0].tokens[0].type === "text" && (A.tokens[0].tokens[0].text = l + " " + A.tokens[0].tokens[0].text)) : A.tokens.unshift({
+ _ ? A.tokens.length > 0 && A.tokens[0].type === "paragraph" ? (A.tokens[0].text = l + " " + A.tokens[0].text, A.tokens[0].tokens && A.tokens[0].tokens.length > 0 && A.tokens[0].tokens[0].type === "text" && (A.tokens[0].tokens[0].text = l + " " + A.tokens[0].tokens[0].text)) : A.tokens.unshift({
type: "text",
text: l + " "
}) : m += l + " ";
}
- m += this.parse(A.tokens, v), f += this.renderer.listitem(m, M, !!x);
+ m += this.parse(A.tokens, _), f += this.renderer.listitem(m, M, !!x);
}
r += this.renderer.list(f, o, d);
continue;
@@ -13368,15 +13378,10 @@ class _Parser {
}
}
class _Hooks {
- options;
constructor(e) {
+ Dt(this, "options");
this.options = e || _defaults;
}
- static passThroughHooks = /* @__PURE__ */ new Set([
- "preprocess",
- "postprocess",
- "processAllTokens"
- ]);
/**
* Process markdown before marked
*/
@@ -13396,47 +13401,55 @@ class _Hooks {
return e;
}
}
+Dt(_Hooks, "passThroughHooks", /* @__PURE__ */ new Set([
+ "preprocess",
+ "postprocess",
+ "processAllTokens"
+]));
+var ir, Jr, un;
class Marked {
- defaults = _getDefaults();
- options = this.setOptions;
- parse = this.#e(_Lexer.lex, _Parser.parse);
- parseInline = this.#e(_Lexer.lexInline, _Parser.parseInline);
- Parser = _Parser;
- Renderer = _Renderer;
- TextRenderer = _TextRenderer;
- Lexer = _Lexer;
- Tokenizer = _Tokenizer;
- Hooks = _Hooks;
constructor(...e) {
+ cn(this, ir);
+ Dt(this, "defaults", _getDefaults());
+ Dt(this, "options", this.setOptions);
+ Dt(this, "parse", zr(this, ir, Jr).call(this, _Lexer.lex, _Parser.parse));
+ Dt(this, "parseInline", zr(this, ir, Jr).call(this, _Lexer.lexInline, _Parser.parseInline));
+ Dt(this, "Parser", _Parser);
+ Dt(this, "Renderer", _Renderer);
+ Dt(this, "TextRenderer", _TextRenderer);
+ Dt(this, "Lexer", _Lexer);
+ Dt(this, "Tokenizer", _Tokenizer);
+ Dt(this, "Hooks", _Hooks);
this.use(...e);
}
/**
* Run callback for every token
*/
walkTokens(e, t) {
+ var a, s;
let r = [];
- for (const a of e)
- switch (r = r.concat(t.call(this, a)), a.type) {
+ for (const h of e)
+ switch (r = r.concat(t.call(this, h)), h.type) {
case "table": {
- const s = a;
- for (const h of s.header)
- r = r.concat(this.walkTokens(h.tokens, t));
- for (const h of s.rows)
- for (const o of h)
- r = r.concat(this.walkTokens(o.tokens, t));
+ const o = h;
+ for (const d of o.header)
+ r = r.concat(this.walkTokens(d.tokens, t));
+ for (const d of o.rows)
+ for (const _ of d)
+ r = r.concat(this.walkTokens(_.tokens, t));
break;
}
case "list": {
- const s = a;
- r = r.concat(this.walkTokens(s.items, t));
+ const o = h;
+ r = r.concat(this.walkTokens(o.items, t));
break;
}
default: {
- const s = a;
- this.defaults.extensions?.childTokens?.[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((h) => {
- const o = s[h].flat(1 / 0);
- r = r.concat(this.walkTokens(o, t));
- }) : s.tokens && (r = r.concat(this.walkTokens(s.tokens, t)));
+ const o = h;
+ (s = (a = this.defaults.extensions) == null ? void 0 : a.childTokens) != null && s[o.type] ? this.defaults.extensions.childTokens[o.type].forEach((d) => {
+ const _ = o[d].flat(1 / 0);
+ r = r.concat(this.walkTokens(_, t));
+ }) : o.tokens && (r = r.concat(this.walkTokens(o.tokens, t)));
}
}
return r;
@@ -13469,10 +13482,10 @@ class Marked {
throw new Error(`renderer '${h}' does not exist`);
if (h === "options")
continue;
- const o = h, d = r.renderer[o], v = s[o];
+ const o = h, d = r.renderer[o], _ = s[o];
s[o] = (...f) => {
let y = d.apply(s, f);
- return y === !1 && (y = v.apply(s, f)), y || "";
+ return y === !1 && (y = _.apply(s, f)), y || "";
};
}
a.renderer = s;
@@ -13484,10 +13497,10 @@ class Marked {
throw new Error(`tokenizer '${h}' does not exist`);
if (["options", "rules", "lexer"].includes(h))
continue;
- const o = h, d = r.tokenizer[o], v = s[o];
+ const o = h, d = r.tokenizer[o], _ = s[o];
s[o] = (...f) => {
let y = d.apply(s, f);
- return y === !1 && (y = v.apply(s, f)), y;
+ return y === !1 && (y = _.apply(s, f)), y;
};
}
a.tokenizer = s;
@@ -13499,15 +13512,15 @@ class Marked {
throw new Error(`hook '${h}' does not exist`);
if (h === "options")
continue;
- const o = h, d = r.hooks[o], v = s[o];
+ const o = h, d = r.hooks[o], _ = s[o];
_Hooks.passThroughHooks.has(h) ? s[o] = (f) => {
if (this.defaults.async)
- return Promise.resolve(d.call(s, f)).then((A) => v.call(s, A));
+ return Promise.resolve(d.call(s, f)).then((A) => _.call(s, A));
const y = d.call(s, f);
- return v.call(s, y);
+ return _.call(s, y);
} : s[o] = (...f) => {
let y = d.apply(s, f);
- return y === !1 && (y = v.apply(s, f)), y;
+ return y === !1 && (y = _.apply(s, f)), y;
};
}
a.hooks = s;
@@ -13531,41 +13544,40 @@ class Marked {
parser(e, t) {
return _Parser.parse(e, t ?? this.defaults);
}
- #e(e, t) {
- return (r, a) => {
- const s = { ...a }, h = { ...this.defaults, ...s };
- this.defaults.async === !0 && s.async === !1 && (h.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), h.async = !0);
- const o = this.#t(!!h.silent, !!h.async);
- if (typeof r > "u" || r === null)
- return o(new Error("marked(): input parameter is undefined or null"));
- if (typeof r != "string")
- return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(r) + ", string expected"));
- if (h.hooks && (h.hooks.options = h), h.async)
- return Promise.resolve(h.hooks ? h.hooks.preprocess(r) : r).then((d) => e(d, h)).then((d) => h.hooks ? h.hooks.processAllTokens(d) : d).then((d) => h.walkTokens ? Promise.all(this.walkTokens(d, h.walkTokens)).then(() => d) : d).then((d) => t(d, h)).then((d) => h.hooks ? h.hooks.postprocess(d) : d).catch(o);
- try {
- h.hooks && (r = h.hooks.preprocess(r));
- let d = e(r, h);
- h.hooks && (d = h.hooks.processAllTokens(d)), h.walkTokens && this.walkTokens(d, h.walkTokens);
- let v = t(d, h);
- return h.hooks && (v = h.hooks.postprocess(v)), v;
- } catch (d) {
- return o(d);
- }
- };
- }
- #t(e, t) {
- return (r) => {
- if (r.message += `
-Please report this to https://github.com/markedjs/marked.`, e) {
- const a = "An error occurred:
" + escape$1$1(r.message + "", !0) + "
";
- return t ? Promise.resolve(a) : a;
- }
- if (t)
- return Promise.reject(r);
- throw r;
- };
- }
}
+ir = new WeakSet(), Jr = function(e, t) {
+ return (r, a) => {
+ const s = { ...a }, h = { ...this.defaults, ...s };
+ this.defaults.async === !0 && s.async === !1 && (h.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), h.async = !0);
+ const o = zr(this, ir, un).call(this, !!h.silent, !!h.async);
+ if (typeof r > "u" || r === null)
+ return o(new Error("marked(): input parameter is undefined or null"));
+ if (typeof r != "string")
+ return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(r) + ", string expected"));
+ if (h.hooks && (h.hooks.options = h), h.async)
+ return Promise.resolve(h.hooks ? h.hooks.preprocess(r) : r).then((d) => e(d, h)).then((d) => h.hooks ? h.hooks.processAllTokens(d) : d).then((d) => h.walkTokens ? Promise.all(this.walkTokens(d, h.walkTokens)).then(() => d) : d).then((d) => t(d, h)).then((d) => h.hooks ? h.hooks.postprocess(d) : d).catch(o);
+ try {
+ h.hooks && (r = h.hooks.preprocess(r));
+ let d = e(r, h);
+ h.hooks && (d = h.hooks.processAllTokens(d)), h.walkTokens && this.walkTokens(d, h.walkTokens);
+ let _ = t(d, h);
+ return h.hooks && (_ = h.hooks.postprocess(_)), _;
+ } catch (d) {
+ return o(d);
+ }
+ };
+}, un = function(e, t) {
+ return (r) => {
+ if (r.message += `
+Please report this to https://github.com/markedjs/marked.`, e) {
+ const a = "An error occurred:
" + escape$1$1(r.message + "", !0) + "
";
+ return t ? Promise.resolve(a) : a;
+ }
+ if (t)
+ return Promise.reject(r);
+ throw r;
+ };
+};
const markedInstance = new Marked();
function marked(n, e) {
return markedInstance.parse(n, e);
@@ -13829,13 +13841,13 @@ var prism = { exports: {} };
*/
clone: function p(g, b) {
b = b || {};
- var c, _;
+ var c, v;
switch (o.util.type(g)) {
case "Object":
- if (_ = o.util.objId(g), b[_])
- return b[_];
+ if (v = o.util.objId(g), b[v])
+ return b[v];
c = /** @type {Record} */
- {}, b[_] = c;
+ {}, b[v] = c;
for (var E in g)
g.hasOwnProperty(E) && (c[E] = p(g[E], b));
return (
@@ -13843,7 +13855,7 @@ var prism = { exports: {} };
c
);
case "Array":
- return _ = o.util.objId(g), b[_] ? b[_] : (c = [], b[_] = c, /** @type {Array} */
+ return v = o.util.objId(g), b[v] ? b[v] : (c = [], b[v] = c, /** @type {Array} */
/** @type {any} */
g.forEach(function(w, k) {
c[k] = p(w, b);
@@ -13929,10 +13941,10 @@ var prism = { exports: {} };
*/
isActive: function(p, g, b) {
for (var c = "no-" + g; p; ) {
- var _ = p.classList;
- if (_.contains(g))
+ var v = p.classList;
+ if (v.contains(g))
return !0;
- if (_.contains(c))
+ if (v.contains(c))
return !1;
p = p.parentElement;
}
@@ -14066,28 +14078,28 @@ var prism = { exports: {} };
insertBefore: function(p, g, b, c) {
c = c || /** @type {any} */
o.languages;
- var _ = c[p], E = {};
- for (var w in _)
- if (_.hasOwnProperty(w)) {
+ var v = c[p], E = {};
+ for (var w in v)
+ if (v.hasOwnProperty(w)) {
if (w == g)
for (var k in b)
b.hasOwnProperty(k) && (E[k] = b[k]);
- b.hasOwnProperty(w) || (E[w] = _[w]);
+ b.hasOwnProperty(w) || (E[w] = v[w]);
}
var $ = c[p];
- return c[p] = E, o.languages.DFS(o.languages, function(L, z) {
- z === $ && L != p && (this[L] = E);
+ return c[p] = E, o.languages.DFS(o.languages, function(L, I) {
+ I === $ && L != p && (this[L] = E);
}), E;
},
// Traverse a language definition with Depth First Search
- DFS: function p(g, b, c, _) {
- _ = _ || {};
+ DFS: function p(g, b, c, v) {
+ v = v || {};
var E = o.util.objId;
for (var w in g)
if (g.hasOwnProperty(w)) {
b.call(g, w, g[w], c || w);
var k = g[w], $ = o.util.type(k);
- $ === "Object" && !_[E(k)] ? (_[E(k)] = !0, p(k, b, null, _)) : $ === "Array" && !_[E(k)] && (_[E(k)] = !0, p(k, b, w, _));
+ $ === "Object" && !v[E(k)] ? (v[E(k)] = !0, p(k, b, null, v)) : $ === "Array" && !v[E(k)] && (v[E(k)] = !0, p(k, b, w, v));
}
}
},
@@ -14129,7 +14141,7 @@ var prism = { exports: {} };
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
};
o.hooks.run("before-highlightall", c), c.elements = Array.prototype.slice.apply(c.container.querySelectorAll(c.selector)), o.hooks.run("before-all-elements-highlight", c);
- for (var _ = 0, E; E = c.elements[_++]; )
+ for (var v = 0, E; E = c.elements[v++]; )
o.highlightElement(E, g === !0, c.callback);
},
/**
@@ -14161,18 +14173,18 @@ var prism = { exports: {} };
* @public
*/
highlightElement: function(p, g, b) {
- var c = o.util.getLanguage(p), _ = o.languages[c];
+ var c = o.util.getLanguage(p), v = o.languages[c];
o.util.setLanguage(p, c);
var E = p.parentElement;
E && E.nodeName.toLowerCase() === "pre" && o.util.setLanguage(E, c);
var w = p.textContent, k = {
element: p,
language: c,
- grammar: _,
+ grammar: v,
code: w
};
- function $(z) {
- k.highlightedCode = z, o.hooks.run("before-insert", k), k.element.innerHTML = k.highlightedCode, o.hooks.run("after-highlight", k), o.hooks.run("complete", k), b && b.call(k.element);
+ function $(I) {
+ k.highlightedCode = I, o.hooks.run("before-insert", k), k.element.innerHTML = k.highlightedCode, o.hooks.run("after-highlight", k), o.hooks.run("complete", k), b && b.call(k.element);
}
if (o.hooks.run("before-sanity-check", k), E = k.element.parentElement, E && E.nodeName.toLowerCase() === "pre" && !E.hasAttribute("tabindex") && E.setAttribute("tabindex", "0"), !k.code) {
o.hooks.run("complete", k), b && b.call(k.element);
@@ -14184,8 +14196,8 @@ var prism = { exports: {} };
}
if (g && r.Worker) {
var L = new Worker(o.filename);
- L.onmessage = function(z) {
- $(z.data);
+ L.onmessage = function(I) {
+ $(I.data);
}, L.postMessage(JSON.stringify({
language: k.language,
code: k.code,
@@ -14255,8 +14267,8 @@ var prism = { exports: {} };
g[c] = b[c];
delete g.rest;
}
- var _ = new y();
- return A(_, _.head, p), f(p, _, g, _.head, 0), M(_);
+ var v = new y();
+ return A(v, v.head, p), f(p, v, g, v.head, 0), M(v);
},
/**
* @namespace
@@ -14293,8 +14305,8 @@ var prism = { exports: {} };
run: function(p, g) {
var b = o.hooks.all[p];
if (!(!b || !b.length))
- for (var c = 0, _; _ = b[c++]; )
- _(g);
+ for (var c = 0, v; v = b[c++]; )
+ v(g);
}
},
Token: d
@@ -14312,7 +14324,7 @@ var prism = { exports: {} };
c += p($, b);
}), c;
}
- var _ = {
+ var v = {
type: g.type,
content: p(g.content, b),
tag: "span",
@@ -14320,22 +14332,22 @@ var prism = { exports: {} };
attributes: {},
language: b
}, E = g.alias;
- E && (Array.isArray(E) ? Array.prototype.push.apply(_.classes, E) : _.classes.push(E)), o.hooks.run("wrap", _);
+ E && (Array.isArray(E) ? Array.prototype.push.apply(v.classes, E) : v.classes.push(E)), o.hooks.run("wrap", v);
var w = "";
- for (var k in _.attributes)
- w += " " + k + '="' + (_.attributes[k] || "").replace(/"/g, """) + '"';
- return "<" + _.tag + ' class="' + _.classes.join(" ") + '"' + w + ">" + _.content + "" + _.tag + ">";
+ for (var k in v.attributes)
+ w += " " + k + '="' + (v.attributes[k] || "").replace(/"/g, """) + '"';
+ return "<" + v.tag + ' class="' + v.classes.join(" ") + '"' + w + ">" + v.content + "" + v.tag + ">";
};
- function v(p, g, b, c) {
+ function _(p, g, b, c) {
p.lastIndex = g;
- var _ = p.exec(b);
- if (_ && c && _[1]) {
- var E = _[1].length;
- _.index += E, _[0] = _[0].slice(E);
+ var v = p.exec(b);
+ if (v && c && v[1]) {
+ var E = v[1].length;
+ v.index += E, v[0] = v[0].slice(E);
}
- return _;
+ return v;
}
- function f(p, g, b, c, _, E) {
+ function f(p, g, b, c, v, E) {
for (var w in b)
if (!(!b.hasOwnProperty(w) || !b[w])) {
var k = b[w];
@@ -14343,41 +14355,41 @@ var prism = { exports: {} };
for (var $ = 0; $ < k.length; ++$) {
if (E && E.cause == w + "," + $)
return;
- var L = k[$], z = L.inside, F = !!L.lookbehind, R = !!L.greedy, P = L.alias;
- if (R && !L.pattern.global) {
- var U = L.pattern.toString().match(/[imsuy]*$/)[0];
- L.pattern = RegExp(L.pattern.source, U + "g");
+ var L = k[$], I = L.inside, F = !!L.lookbehind, P = !!L.greedy, B = L.alias;
+ if (P && !L.pattern.global) {
+ var G = L.pattern.toString().match(/[imsuy]*$/)[0];
+ L.pattern = RegExp(L.pattern.source, G + "g");
}
- for (var N = L.pattern || L, B = c.next, W = _; B !== g.tail && !(E && W >= E.reach); W += B.value.length, B = B.next) {
- var V = B.value;
+ for (var U = L.pattern || L, R = c.next, W = v; R !== g.tail && !(E && W >= E.reach); W += R.value.length, R = R.next) {
+ var H = R.value;
if (g.length > p.length)
return;
- if (!(V instanceof d)) {
- var G = 1, H;
- if (R) {
- if (H = v(N, W, p, F), !H || H.index >= p.length)
+ if (!(H instanceof d)) {
+ var N = 1, V;
+ if (P) {
+ if (V = _(U, W, p, F), !V || V.index >= p.length)
break;
- var ce = H.index, Q = H.index + H[0].length, te = W;
- for (te += B.value.length; ce >= te; )
- B = B.next, te += B.value.length;
- if (te -= B.value.length, W = te, B.value instanceof d)
+ var ue = V.index, J = V.index + V[0].length, re = W;
+ for (re += R.value.length; ue >= re; )
+ R = R.next, re += R.value.length;
+ if (re -= R.value.length, W = re, R.value instanceof d)
continue;
- for (var ee = B; ee !== g.tail && (te < Q || typeof ee.value == "string"); ee = ee.next)
- G++, te += ee.value.length;
- G--, V = p.slice(W, te), H.index -= W;
- } else if (H = v(N, 0, V, F), !H)
+ for (var te = R; te !== g.tail && (re < J || typeof te.value == "string"); te = te.next)
+ N++, re += te.value.length;
+ N--, H = p.slice(W, re), V.index -= W;
+ } else if (V = _(U, 0, H, F), !V)
continue;
- var ce = H.index, fe = H[0], oe = V.slice(0, ce), he = V.slice(ce + fe.length), Ae = W + V.length;
- E && Ae > E.reach && (E.reach = Ae);
- var Se = B.prev;
- oe && (Se = A(g, Se, oe), W += oe.length), x(g, Se, G);
- var Ie = new d(w, z ? o.tokenize(fe, z) : fe, P, fe);
- if (B = A(g, Se, Ie), he && A(g, B, he), G > 1) {
+ var ue = V.index, ie = V[0], ae = H.slice(0, ue), ce = H.slice(ue + ie.length), Me = W + H.length;
+ E && Me > E.reach && (E.reach = Me);
+ var Ae = R.prev;
+ ae && (Ae = A(g, Ae, ae), W += ae.length), x(g, Ae, N);
+ var Ie = new d(w, I ? o.tokenize(ie, I) : ie, B, ie);
+ if (R = A(g, Ae, Ie), ce && A(g, R, ce), N > 1) {
var pe = {
cause: w + "," + $,
- reach: Ae
+ reach: Me
};
- f(p, g, b, B.prev, W, pe), E && pe.reach > E.reach && (E.reach = pe.reach);
+ f(p, g, b, R.prev, W, pe), E && pe.reach > E.reach && (E.reach = pe.reach);
}
}
}
@@ -14389,13 +14401,13 @@ var prism = { exports: {} };
p.next = g, this.head = p, this.tail = g, this.length = 0;
}
function A(p, g, b) {
- var c = g.next, _ = { value: b, prev: g, next: c };
- return g.next = _, c.prev = _, p.length++, _;
+ var c = g.next, v = { value: b, prev: g, next: c };
+ return g.next = v, c.prev = v, p.length++, v;
}
function x(p, g, b) {
- for (var c = g.next, _ = 0; _ < b && c !== p.tail; _++)
+ for (var c = g.next, v = 0; v < b && c !== p.tail; v++)
c = c.next;
- g.next = c, c.prev = g, p.length -= _;
+ g.next = c, c.prev = g, p.length -= v;
}
function M(p) {
for (var g = [], b = p.head.next; b !== p.tail; )
@@ -14404,8 +14416,8 @@ var prism = { exports: {} };
}
if (!r.document)
return r.addEventListener && (o.disableWorkerMessageHandler || r.addEventListener("message", function(p) {
- var g = JSON.parse(p.data), b = g.language, c = g.code, _ = g.immediateClose;
- r.postMessage(o.highlight(c, o.languages[b], b)), _ && r.close();
+ var g = JSON.parse(p.data), b = g.language, c = g.code, v = g.immediateClose;
+ r.postMessage(o.highlight(c, o.languages[b], b)), v && r.close();
}, !1)), o;
var m = o.util.currentScript();
m && (o.filename = m.src, m.hasAttribute("data-manual") && (o.manual = !0));
@@ -14808,7 +14820,7 @@ var prism = { exports: {} };
bat: "batch",
h: "c",
tex: "latex"
- }, o = "data-src-status", d = "loading", v = "loaded", f = "failed", y = "pre[data-src]:not([" + o + '="' + v + '"]):not([' + o + '="' + d + '"])';
+ }, o = "data-src-status", d = "loading", _ = "loaded", f = "failed", y = "pre[data-src]:not([" + o + '="' + _ + '"]):not([' + o + '="' + d + '"])';
function A(m, l, u) {
var p = new XMLHttpRequest();
p.open("GET", m, !0), p.onreadystatechange = function() {
@@ -14842,18 +14854,18 @@ var prism = { exports: {} };
var c = t.plugins.autoloader;
c && c.loadLanguages(g), A(
p,
- function(_) {
- l.setAttribute(o, v);
+ function(v) {
+ l.setAttribute(o, _);
var E = x(l.getAttribute("data-range"));
if (E) {
- var w = _.split(/\r\n?|\n/g), k = E[0], $ = E[1] == null ? w.length : E[1];
- k < 0 && (k += w.length), k = Math.max(0, Math.min(k - 1, w.length)), $ < 0 && ($ += w.length), $ = Math.max(0, Math.min($, w.length)), _ = w.slice(k, $).join(`
+ var w = v.split(/\r\n?|\n/g), k = E[0], $ = E[1] == null ? w.length : E[1];
+ k < 0 && (k += w.length), k = Math.max(0, Math.min(k - 1, w.length)), $ < 0 && ($ += w.length), $ = Math.max(0, Math.min($, w.length)), v = w.slice(k, $).join(`
`), l.hasAttribute("data-start") || l.setAttribute("data-start", String(k + 1));
}
- u.textContent = _, t.highlightElement(u);
+ u.textContent = v, t.highlightElement(u);
},
- function(_) {
- l.setAttribute(o, f), u.textContent = _;
+ function(v) {
+ l.setAttribute(o, f), u.textContent = v;
}
);
}
@@ -15281,7 +15293,8 @@ function createLatexTokenizer(n) {
}
const renderer = {
code(n, e, t) {
- const r = (e ?? "").match(/\S*/)?.[0] ?? "";
+ var a;
+ const r = ((a = (e ?? "").match(/\S*/)) == null ? void 0 : a[0]) ?? "";
return n = n.replace(/\n$/, "") + `
`, r ? '' + COPY_BUTTON_CODE + '
' + (t ? n : escape(n, !0)) + `
` : '' + COPY_BUTTON_CODE + "
" + (t ? n : escape(n, !0)) + `
@@ -15310,8 +15323,8 @@ function create_marked({
name: "heading",
level: "block",
renderer(s) {
- const h = s.raw.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, ""), o = "h" + slugger.slug(h), d = s.depth, v = this.parser.parseInline(s.tokens);
- return `${v}
+ const h = s.raw.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, ""), o = "h" + slugger.slug(h), d = s.depth, _ = this.parser.parseInline(s.tokens);
+ return `${_}
`;
}
}
@@ -16136,8 +16149,8 @@ class Amuchina {
const w = x.getAttributeNames(), k = w.length;
if (k) {
for (let $ = 0; $ < k; $++) {
- const L = w[$], z = A[L];
- (!z || !z.has(E) && !z.has(c)) && x.removeAttribute(L);
+ const L = w[$], I = A[L];
+ (!I || !I.has(E) && !I.has(c)) && x.removeAttribute(L);
}
if (isElementFunky(x))
if (isElementHyperlink(x)) {
@@ -16164,8 +16177,8 @@ class Amuchina {
if (o)
throw new Error('"dropAttributes" is not supported yet, use "allowAttributes" instead');
__classPrivateFieldSet(this, _Amuchina_configuration, cloneDeep(DEFAULTS), "f");
- const { allowElements: d, allowAttributes: v } = e;
- d && (__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowElements = e.allowElements), v && (__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowAttributes = e.allowAttributes), __classPrivateFieldSet(this, _Amuchina_allowElements, new Set(__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowElements), "f"), __classPrivateFieldSet(this, _Amuchina_allowAttributes, Object.fromEntries(Object.entries(__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowAttributes || {}).map(([f, y]) => [f, new Set(y)])), "f");
+ const { allowElements: d, allowAttributes: _ } = e;
+ d && (__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowElements = e.allowElements), _ && (__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowAttributes = e.allowAttributes), __classPrivateFieldSet(this, _Amuchina_allowElements, new Set(__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowElements), "f"), __classPrivateFieldSet(this, _Amuchina_allowAttributes, Object.fromEntries(Object.entries(__classPrivateFieldGet(this, _Amuchina_configuration, "f").allowAttributes || {}).map(([f, y]) => [f, new Set(y)])), "f");
}
}
_Amuchina_configuration = /* @__PURE__ */ new WeakMap(), _Amuchina_allowElements = /* @__PURE__ */ new WeakMap(), _Amuchina_allowAttributes = /* @__PURE__ */ new WeakMap();
@@ -16185,7 +16198,7 @@ function sanitize(n, e) {
}
function walk_nodes(n, e, t) {
n && (n.nodeName === e || typeof e == "function") && t(n);
- const r = n?.childNodes || [];
+ const r = (n == null ? void 0 : n.childNodes) || [];
for (let a = 0; a < r.length; a++)
walk_nodes(r[a], e, t);
}
@@ -16217,7 +16230,7 @@ function create_fragment$h(n) {
t = claim_html_tag(a, !1), a.forEach(detach$h), this.h();
},
h() {
- t.a = null, attr$g(e, "class", "md svelte-1m32c2s"), toggle_class$8(
+ t.a = null, attr$g(e, "class", "md svelte-n3seak"), toggle_class$8(
e,
"chatbot",
/*chatbot*/
@@ -16266,9 +16279,9 @@ function escapeRegExp(n) {
return n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function instance$e(n, e, t) {
- let { chatbot: r = !0 } = e, { message: a } = e, { sanitize_html: s = !0 } = e, { latex_delimiters: h = [] } = e, { render_markdown: o = !0 } = e, { line_breaks: d = !0 } = e, { header_links: v = !1 } = e, { root: f } = e, y, A;
+ let { chatbot: r = !0 } = e, { message: a } = e, { sanitize_html: s = !0 } = e, { latex_delimiters: h = [] } = e, { render_markdown: o = !0 } = e, { line_breaks: d = !0 } = e, { header_links: _ = !1 } = e, { root: f } = e, y, A;
const x = create_marked({
- header_links: v,
+ header_links: _,
line_breaks: d,
latex_delimiters: h
});
@@ -16277,7 +16290,7 @@ function instance$e(n, e, t) {
if (o) {
const g = [];
h.forEach((b, c) => {
- const _ = escapeRegExp(b.left), E = escapeRegExp(b.right), w = new RegExp(`${_}([\\s\\S]+?)${E}`, "g");
+ const v = escapeRegExp(b.left), E = escapeRegExp(b.right), w = new RegExp(`${v}([\\s\\S]+?)${E}`, "g");
p = p.replace(w, (k, $) => (g.push(k), `%%%LATEX_BLOCK_${g.length - 1}%%%`));
}), p = x.parse(p), p = p.replace(/%%%LATEX_BLOCK_(\d+)%%%/g, (b, c) => g[parseInt(c, 10)]);
}
@@ -16298,7 +16311,7 @@ function instance$e(n, e, t) {
});
}
return n.$$set = (u) => {
- "chatbot" in u && t(0, r = u.chatbot), "message" in u && t(4, a = u.message), "sanitize_html" in u && t(5, s = u.sanitize_html), "latex_delimiters" in u && t(6, h = u.latex_delimiters), "render_markdown" in u && t(1, o = u.render_markdown), "line_breaks" in u && t(7, d = u.line_breaks), "header_links" in u && t(8, v = u.header_links), "root" in u && t(9, f = u.root);
+ "chatbot" in u && t(0, r = u.chatbot), "message" in u && t(4, a = u.message), "sanitize_html" in u && t(5, s = u.sanitize_html), "latex_delimiters" in u && t(6, h = u.latex_delimiters), "render_markdown" in u && t(1, o = u.render_markdown), "line_breaks" in u && t(7, d = u.line_breaks), "header_links" in u && t(8, _ = u.header_links), "root" in u && t(9, f = u.root);
}, n.$$.update = () => {
n.$$.dirty & /*message*/
16 && (a && a.trim() ? t(3, A = M(a)) : t(3, A = ""));
@@ -16311,7 +16324,7 @@ function instance$e(n, e, t) {
s,
h,
d,
- v,
+ _,
f,
l
];
@@ -16371,7 +16384,7 @@ function create_fragment$g(n) {
claim_component$7(t.$$.fragment, s), s.forEach(detach$g), this.h();
},
h() {
- attr$f(e, "class", "svelte-17qq50w");
+ attr$f(e, "class", "svelte-4zcnwf");
},
m(a, s) {
insert_hydration$g(a, e, s), mount_component$7(t, e, null), r = !0;
@@ -16497,11 +16510,11 @@ function create_fragment$f(n) {
},
l(d) {
e = claim_element$b(d, "SPAN", { "data-testid": !0, class: !0 });
- var v = children$d(e);
- h && h.l(v), v.forEach(detach$f), t = claim_space$b(d), o && o.l(d), r = empty$5(), this.h();
+ var _ = children$d(e);
+ h && h.l(_), _.forEach(detach$f), t = claim_space$b(d), o && o.l(d), r = empty$5(), this.h();
},
h() {
- attr$e(e, "data-testid", "block-info"), attr$e(e, "class", "svelte-22c38v"), toggle_class$7(e, "sr-only", !/*show_label*/
+ attr$e(e, "data-testid", "block-info"), attr$e(e, "class", "svelte-1i21bw0"), toggle_class$7(e, "sr-only", !/*show_label*/
n[0]), toggle_class$7(e, "hide", !/*show_label*/
n[0]), toggle_class$7(
e,
@@ -16510,11 +16523,11 @@ function create_fragment$f(n) {
n[1] != null
);
},
- m(d, v) {
- insert_hydration$f(d, e, v), h && h.m(e, null), insert_hydration$f(d, t, v), o && o.m(d, v), insert_hydration$f(d, r, v), a = !0;
+ m(d, _) {
+ insert_hydration$f(d, e, _), h && h.m(e, null), insert_hydration$f(d, t, _), o && o.m(d, _), insert_hydration$f(d, r, _), a = !0;
},
- p(d, [v]) {
- h && h.p && (!a || v & /*$$scope*/
+ p(d, [_]) {
+ h && h.p && (!a || _ & /*$$scope*/
8) && update_slot_base$2(
h,
s,
@@ -16525,25 +16538,25 @@ function create_fragment$f(n) {
s,
/*$$scope*/
d[3],
- v,
+ _,
null
) : get_all_dirty_from_scope$2(
/*$$scope*/
d[3]
),
null
- ), (!a || v & /*show_label*/
+ ), (!a || _ & /*show_label*/
1) && toggle_class$7(e, "sr-only", !/*show_label*/
- d[0]), (!a || v & /*show_label*/
+ d[0]), (!a || _ & /*show_label*/
1) && toggle_class$7(e, "hide", !/*show_label*/
- d[0]), (!a || v & /*info*/
+ d[0]), (!a || _ & /*info*/
2) && toggle_class$7(
e,
"has-info",
/*info*/
d[1] != null
), /*info*/
- d[1] ? o ? (o.p(d, v), v & /*info*/
+ d[1] ? o ? (o.p(d, _), _ & /*info*/
2 && transition_in$6(o, 1)) : (o = create_if_block$9(d), o.c(), transition_in$6(o, 1), o.m(r.parentNode, r)) : o && (group_outros$6(), transition_out$6(o, 1, 1, () => {
o = null;
}), check_outros$6());
@@ -16595,8 +16608,8 @@ const {
listen: listen$5,
mount_component: mount_component$5,
safe_not_equal: safe_not_equal$f,
- set_data: set_data$6,
- set_style: set_style$4,
+ set_data: set_data$7,
+ set_style: set_style$6,
space: space$a,
text: text$9,
toggle_class: toggle_class$6,
@@ -16623,14 +16636,14 @@ function create_if_block$8(n) {
), a.forEach(detach$e), this.h();
},
h() {
- attr$d(e, "class", "svelte-vk34kx");
+ attr$d(e, "class", "svelte-ivutx");
},
m(r, a) {
insert_hydration$e(r, e, a), append_hydration$c(e, t);
},
p(r, a) {
a & /*label*/
- 2 && set_data$6(
+ 2 && set_data$7(
t,
/*label*/
r[1]
@@ -16642,7 +16655,7 @@ function create_if_block$8(n) {
};
}
function create_fragment$e(n) {
- let e, t, r, a, s, h, o, d, v = (
+ let e, t, r, a, s, h, o, d, _ = (
/*show_label*/
n[2] && create_if_block$8(n)
);
@@ -16666,7 +16679,7 @@ function create_fragment$e(n) {
);
return {
c() {
- e = element$a("button"), v && v.c(), t = space$a(), r = element$a("div"), a && create_component$5(a.$$.fragment), s = space$a(), x && x.c(), this.h();
+ e = element$a("button"), _ && _.c(), t = space$a(), r = element$a("div"), a && create_component$5(a.$$.fragment), s = space$a(), x && x.c(), this.h();
},
l(M) {
e = claim_element$a(M, "BUTTON", {
@@ -16676,12 +16689,12 @@ function create_fragment$e(n) {
class: !0
});
var m = children$c(e);
- v && v.l(m), t = claim_space$a(m), r = claim_element$a(m, "DIV", { class: !0 });
+ _ && _.l(m), t = claim_space$a(m), r = claim_element$a(m, "DIV", { class: !0 });
var l = children$c(r);
a && claim_component$5(a.$$.fragment, l), s = claim_space$a(l), x && x.l(l), l.forEach(detach$e), m.forEach(detach$e), this.h();
},
h() {
- attr$d(r, "class", "svelte-vk34kx"), toggle_class$6(
+ attr$d(r, "class", "svelte-ivutx"), toggle_class$6(
r,
"small",
/*size*/
@@ -16712,7 +16725,7 @@ function create_fragment$e(n) {
"title",
/*label*/
n[1]
- ), attr$d(e, "class", "svelte-vk34kx"), toggle_class$6(
+ ), attr$d(e, "class", "svelte-ivutx"), toggle_class$6(
e,
"pending",
/*pending*/
@@ -16732,19 +16745,19 @@ function create_fragment$e(n) {
"transparent",
/*transparent*/
n[9]
- ), set_style$4(e, "color", !/*disabled*/
+ ), set_style$6(e, "color", !/*disabled*/
n[7] && /*_color*/
n[11] ? (
/*_color*/
n[11]
- ) : "var(--block-label-text-color)"), set_style$4(e, "--bg-color", /*disabled*/
+ ) : "var(--block-label-text-color)"), set_style$6(e, "--bg-color", /*disabled*/
n[7] ? "auto" : (
/*background*/
n[10]
));
},
m(M, m) {
- insert_hydration$e(M, e, m), v && v.m(e, null), append_hydration$c(e, t), append_hydration$c(e, r), a && mount_component$5(a, r, null), append_hydration$c(r, s), x && x.m(r, null), h = !0, o || (d = listen$5(
+ insert_hydration$e(M, e, m), _ && _.m(e, null), append_hydration$c(e, t), append_hydration$c(e, r), a && mount_component$5(a, r, null), append_hydration$c(r, s), x && x.m(r, null), h = !0, o || (d = listen$5(
e,
"click",
/*click_handler*/
@@ -16753,7 +16766,7 @@ function create_fragment$e(n) {
},
p(M, [m]) {
if (/*show_label*/
- M[2] ? v ? v.p(M, m) : (v = create_if_block$8(M), v.c(), v.m(e, t)) : v && (v.d(1), v = null), m & /*Icon*/
+ M[2] ? _ ? _.p(M, m) : (_ = create_if_block$8(M), _.c(), _.m(e, t)) : _ && (_.d(1), _ = null), m & /*Icon*/
1 && f !== (f = /*Icon*/
M[0])) {
if (a) {
@@ -16846,13 +16859,13 @@ function create_fragment$e(n) {
/*transparent*/
M[9]
), m & /*disabled, _color*/
- 2176 && set_style$4(e, "color", !/*disabled*/
+ 2176 && set_style$6(e, "color", !/*disabled*/
M[7] && /*_color*/
M[11] ? (
/*_color*/
M[11]
) : "var(--block-label-text-color)"), m & /*disabled, background*/
- 1152 && set_style$4(e, "--bg-color", /*disabled*/
+ 1152 && set_style$6(e, "--bg-color", /*disabled*/
M[7] ? "auto" : (
/*background*/
M[10]
@@ -16865,17 +16878,17 @@ function create_fragment$e(n) {
a && transition_out$5(a.$$.fragment, M), transition_out$5(x, M), h = !1;
},
d(M) {
- M && detach$e(e), v && v.d(), a && destroy_component$5(a), x && x.d(M), o = !1, d();
+ M && detach$e(e), _ && _.d(), a && destroy_component$5(a), x && x.d(M), o = !1, d();
}
};
}
function instance$b(n, e, t) {
- let r, { $$slots: a = {}, $$scope: s } = e, { Icon: h } = e, { label: o = "" } = e, { show_label: d = !1 } = e, { pending: v = !1 } = e, { size: f = "small" } = e, { padded: y = !0 } = e, { highlight: A = !1 } = e, { disabled: x = !1 } = e, { hasPopup: M = !1 } = e, { color: m = "var(--block-label-text-color)" } = e, { transparent: l = !1 } = e, { background: u = "var(--block-background-fill)" } = e;
+ let r, { $$slots: a = {}, $$scope: s } = e, { Icon: h } = e, { label: o = "" } = e, { show_label: d = !1 } = e, { pending: _ = !1 } = e, { size: f = "small" } = e, { padded: y = !0 } = e, { highlight: A = !1 } = e, { disabled: x = !1 } = e, { hasPopup: M = !1 } = e, { color: m = "var(--block-label-text-color)" } = e, { transparent: l = !1 } = e, { background: u = "var(--block-background-fill)" } = e;
function p(g) {
bubble$1.call(this, n, g);
}
return n.$$set = (g) => {
- "Icon" in g && t(0, h = g.Icon), "label" in g && t(1, o = g.label), "show_label" in g && t(2, d = g.show_label), "pending" in g && t(3, v = g.pending), "size" in g && t(4, f = g.size), "padded" in g && t(5, y = g.padded), "highlight" in g && t(6, A = g.highlight), "disabled" in g && t(7, x = g.disabled), "hasPopup" in g && t(8, M = g.hasPopup), "color" in g && t(12, m = g.color), "transparent" in g && t(9, l = g.transparent), "background" in g && t(10, u = g.background), "$$scope" in g && t(13, s = g.$$scope);
+ "Icon" in g && t(0, h = g.Icon), "label" in g && t(1, o = g.label), "show_label" in g && t(2, d = g.show_label), "pending" in g && t(3, _ = g.pending), "size" in g && t(4, f = g.size), "padded" in g && t(5, y = g.padded), "highlight" in g && t(6, A = g.highlight), "disabled" in g && t(7, x = g.disabled), "hasPopup" in g && t(8, M = g.hasPopup), "color" in g && t(12, m = g.color), "transparent" in g && t(9, l = g.transparent), "background" in g && t(10, u = g.background), "$$scope" in g && t(13, s = g.$$scope);
}, n.$$.update = () => {
n.$$.dirty & /*highlight, color*/
4160 && t(11, r = A ? "var(--color-accent)" : m);
@@ -16883,7 +16896,7 @@ function instance$b(n, e, t) {
h,
o,
d,
- v,
+ _,
f,
y,
A,
@@ -16981,7 +16994,7 @@ const {
insert_hydration: insert_hydration$c,
noop: noop$c,
safe_not_equal: safe_not_equal$d,
- set_style: set_style$3,
+ set_style: set_style$5,
svg_element: svg_element$3
} = window.__gradio__svelte__internal;
function create_fragment$c(n) {
@@ -17008,7 +17021,7 @@ function create_fragment$c(n) {
r = claim_svg_element$3(o, "path", { d: !0, style: !0 }), children$a(r).forEach(detach$c), o.forEach(detach$c), a = claim_svg_element$3(h, "path", { d: !0, style: !0 }), children$a(a).forEach(detach$c), h.forEach(detach$c), this.h();
},
h() {
- attr$b(r, "d", "M18,6L6.087,17.913"), set_style$3(r, "fill", "none"), set_style$3(r, "fill-rule", "nonzero"), set_style$3(r, "stroke-width", "2px"), attr$b(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), attr$b(a, "d", "M4.364,4.364L19.636,19.636"), set_style$3(a, "fill", "none"), set_style$3(a, "fill-rule", "nonzero"), set_style$3(a, "stroke-width", "2px"), attr$b(e, "width", "100%"), attr$b(e, "height", "100%"), attr$b(e, "viewBox", "0 0 24 24"), attr$b(e, "version", "1.1"), attr$b(e, "xmlns", "http://www.w3.org/2000/svg"), attr$b(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), attr$b(e, "xml:space", "preserve"), attr$b(e, "stroke", "currentColor"), set_style$3(e, "fill-rule", "evenodd"), set_style$3(e, "clip-rule", "evenodd"), set_style$3(e, "stroke-linecap", "round"), set_style$3(e, "stroke-linejoin", "round");
+ attr$b(r, "d", "M18,6L6.087,17.913"), set_style$5(r, "fill", "none"), set_style$5(r, "fill-rule", "nonzero"), set_style$5(r, "stroke-width", "2px"), attr$b(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), attr$b(a, "d", "M4.364,4.364L19.636,19.636"), set_style$5(a, "fill", "none"), set_style$5(a, "fill-rule", "nonzero"), set_style$5(a, "stroke-width", "2px"), attr$b(e, "width", "100%"), attr$b(e, "height", "100%"), attr$b(e, "viewBox", "0 0 24 24"), attr$b(e, "version", "1.1"), attr$b(e, "xmlns", "http://www.w3.org/2000/svg"), attr$b(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), attr$b(e, "xml:space", "preserve"), attr$b(e, "stroke", "currentColor"), set_style$5(e, "fill-rule", "evenodd"), set_style$5(e, "clip-rule", "evenodd"), set_style$5(e, "stroke-linecap", "round"), set_style$5(e, "stroke-linejoin", "round");
},
m(s, h) {
insert_hydration$c(s, e, h), append_hydration$a(e, t), append_hydration$a(t, r), append_hydration$a(e, a);
@@ -17409,16 +17422,16 @@ const {
space: space$9
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$6 } = window.__gradio__svelte__internal;
function create_if_block$7(n) {
- let e, t = ' Covalent modifcation', r, a;
+ let e, t = ' Covalent modifcation', r, a;
return {
c() {
e = element$9("button"), e.innerHTML = t, this.h();
},
l(s) {
- e = claim_element$9(s, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(e) !== "svelte-1ffedkh" && (e.innerHTML = t), this.h();
+ e = claim_element$9(s, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(e) !== "svelte-15d988a" && (e.innerHTML = t), this.h();
},
h() {
- attr$9(e, "class", "flex items-center space-x-2 block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white svelte-8wrmgx");
+ attr$9(e, "class", "flex items-center space-x-2 block rounded-full px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white");
},
m(s, h) {
insert_hydration$a(s, e, h), r || (a = listen$4(
@@ -17435,26 +17448,26 @@ function create_if_block$7(n) {
};
}
function create_fragment$a(n) {
- let e, t, r, a = ' Protein', s, h, o = ' Nucleic acid', d, v, f = ' Small molecule', y, A, x, M = (
+ let e, t, r, a = ' Protein', s, h, o = ' Nucleic acid', d, _, f = ' Small molecule', y, A, x, M = (
/*displayCovMod*/
n[0] && create_if_block$7(n)
);
return {
c() {
- e = element$9("div"), t = element$9("div"), r = element$9("button"), r.innerHTML = a, s = space$9(), h = element$9("button"), h.innerHTML = o, d = space$9(), v = element$9("button"), v.innerHTML = f, y = space$9(), M && M.c(), this.h();
+ e = element$9("div"), t = element$9("div"), r = element$9("button"), r.innerHTML = a, s = space$9(), h = element$9("button"), h.innerHTML = o, d = space$9(), _ = element$9("button"), _.innerHTML = f, y = space$9(), M && M.c(), this.h();
},
l(m) {
- e = claim_element$9(m, "DIV", { class: !0 });
+ e = claim_element$9(m, "DIV", {});
var l = children$8(e);
t = claim_element$9(l, "DIV", { class: !0 });
var u = children$8(t);
- r = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(r) !== "svelte-1qxi4yp" && (r.innerHTML = a), s = claim_space$9(u), h = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(h) !== "svelte-z7tz1a" && (h.innerHTML = o), d = claim_space$9(u), v = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(v) !== "svelte-3ixhlr" && (v.innerHTML = f), y = claim_space$9(u), M && M.l(u), u.forEach(detach$a), l.forEach(detach$a), this.h();
+ r = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(r) !== "svelte-t3r19q" && (r.innerHTML = a), s = claim_space$9(u), h = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(h) !== "svelte-qeks3z" && (h.innerHTML = o), d = claim_space$9(u), _ = claim_element$9(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$5(_) !== "svelte-in8vmg" && (_.innerHTML = f), y = claim_space$9(u), M && M.l(u), u.forEach(detach$a), l.forEach(detach$a), this.h();
},
h() {
- attr$9(r, "class", "flex items-center space-x-2 block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white svelte-8wrmgx"), attr$9(h, "class", "flex items-center space-x-2 block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white svelte-8wrmgx"), attr$9(v, "class", "flex items-center space-x-2 block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white svelte-8wrmgx"), attr$9(t, "class", "flex justify-center mt-2 svelte-8wrmgx"), attr$9(e, "class", "svelte-8wrmgx");
+ attr$9(r, "class", "flex items-center space-x-1 px-2 py-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"), attr$9(h, "class", "flex items-center space-x-1 px-2 py-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"), attr$9(_, "class", "flex items-center space-x-1 px-2 py-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"), attr$9(t, "class", "flex justify-center mt-2 gap-2");
},
m(m, l) {
- insert_hydration$a(m, e, l), append_hydration$8(e, t), append_hydration$8(t, r), append_hydration$8(t, s), append_hydration$8(t, h), append_hydration$8(t, d), append_hydration$8(t, v), append_hydration$8(t, y), M && M.m(t, null), A || (x = [
+ insert_hydration$a(m, e, l), append_hydration$8(e, t), append_hydration$8(t, r), append_hydration$8(t, s), append_hydration$8(t, h), append_hydration$8(t, d), append_hydration$8(t, _), append_hydration$8(t, y), M && M.m(t, null), A || (x = [
listen$4(
r,
"click",
@@ -17468,7 +17481,7 @@ function create_fragment$a(n) {
n[5]
),
listen$4(
- v,
+ _,
"click",
/*click_handler_2*/
n[6]
@@ -17498,7 +17511,7 @@ function instance$a(n, e, t) {
let o = !1;
const d = () => {
s("protein");
- }, v = () => {
+ }, _ = () => {
s("DNA");
}, f = () => {
s("ligand");
@@ -17516,7 +17529,7 @@ function instance$a(n, e, t) {
h,
a,
d,
- v,
+ _,
f,
y
];
@@ -17544,6 +17557,7 @@ const {
prevent_default,
run_all: run_all$3,
safe_not_equal: safe_not_equal$a,
+ set_style: set_style$4,
space: space$8,
text: text$8
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$5 } = window.__gradio__svelte__internal;
@@ -17554,46 +17568,47 @@ function create_fragment$9(n) {
/*currentSel*/
n[3]
] + ""
- ), d, v, f, y = '
', A, x, M, m, l, u = ' Search', p, g;
+ ), d, _, f, y = '
', A, x, M, m, l, u = ' Search', p, g;
return {
c() {
- e = element$8("form"), t = element$8("div"), r = element$8("label"), r.textContent = a, s = space$8(), h = element$8("button"), d = text$8(o), v = space$8(), f = element$8("div"), f.innerHTML = y, A = space$8(), x = element$8("div"), M = element$8("input"), m = space$8(), l = element$8("button"), l.innerHTML = u, this.h();
+ e = element$8("form"), t = element$8("div"), r = element$8("label"), r.textContent = a, s = space$8(), h = element$8("button"), d = text$8(o), _ = space$8(), f = element$8("div"), f.innerHTML = y, A = space$8(), x = element$8("div"), M = element$8("input"), m = space$8(), l = element$8("button"), l.innerHTML = u, this.h();
},
l(b) {
e = claim_element$8(b, "FORM", { class: !0 });
var c = children$7(e);
t = claim_element$8(c, "DIV", { class: !0 });
- var _ = children$7(t);
- r = claim_element$8(_, "LABEL", {
+ var v = children$7(t);
+ r = claim_element$8(v, "LABEL", {
for: !0,
class: !0,
"data-svelte-h": !0
- }), get_svelte_dataset$4(r) !== "svelte-1ryblwq" && (r.textContent = a), s = claim_space$8(_), h = claim_element$8(_, "BUTTON", {
+ }), get_svelte_dataset$4(r) !== "svelte-1ryblwq" && (r.textContent = a), s = claim_space$8(v), h = claim_element$8(v, "BUTTON", {
id: !0,
"data-dropdown-toggle": !0,
class: !0,
type: !0
});
var E = children$7(h);
- d = claim_text$7(E, o), E.forEach(detach$9), v = claim_space$8(_), f = claim_element$8(_, "DIV", {
+ d = claim_text$7(E, o), E.forEach(detach$9), _ = claim_space$8(v), f = claim_element$8(v, "DIV", {
id: !0,
class: !0,
"data-svelte-h": !0
- }), get_svelte_dataset$4(f) !== "svelte-1mzhtad" && (f.innerHTML = y), A = claim_space$8(_), x = claim_element$8(_, "DIV", { class: !0 });
+ }), get_svelte_dataset$4(f) !== "svelte-1mzhtad" && (f.innerHTML = y), A = claim_space$8(v), x = claim_element$8(v, "DIV", { class: !0 });
var w = children$7(x);
M = claim_element$8(w, "INPUT", {
type: !0,
id: !0,
class: !0,
+ style: !0,
placeholder: !0
}), m = claim_space$8(w), l = claim_element$8(w, "BUTTON", {
type: !0,
class: !0,
"data-svelte-h": !0
- }), get_svelte_dataset$4(l) !== "svelte-12vvhvj" && (l.innerHTML = u), w.forEach(detach$9), _.forEach(detach$9), c.forEach(detach$9), this.h();
+ }), get_svelte_dataset$4(l) !== "svelte-12vvhvj" && (l.innerHTML = u), w.forEach(detach$9), v.forEach(detach$9), c.forEach(detach$9), this.h();
},
h() {
- attr$8(r, "for", "search-dropdown"), attr$8(r, "class", "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white svelte-8wrmgx"), attr$8(h, "id", "dropdown-button"), attr$8(h, "data-dropdown-toggle", "dropdown"), attr$8(h, "class", "flex-shrink-0 z-10 inline-flex items-center py-2.5 px-4 text-sm font-medium text-center text-gray-900 bg-gray-100 border border-gray-300 rounded-s-lg hover:bg-gray-200 focus:ring-4 focus:outline-none focus:ring-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-gray-700 dark:text-white dark:border-gray-600 svelte-8wrmgx"), attr$8(h, "type", "button"), attr$8(f, "id", "dropdown"), attr$8(f, "class", "z-10 hidden bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 svelte-8wrmgx"), attr$8(M, "type", "search"), attr$8(M, "id", "search-dropdown"), attr$8(M, "class", "block p-2.5 w-full z-20 text-sm text-gray-900 bg-gray-50 rounded-e-lg border-s-gray-50 border-s-2 border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-s-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:border-blue-500 svelte-8wrmgx"), attr$8(
+ attr$8(r, "for", "search-dropdown"), attr$8(r, "class", "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"), attr$8(h, "id", "dropdown-button"), attr$8(h, "data-dropdown-toggle", "dropdown"), attr$8(h, "class", "flex-shrink-0 z-10 inline-flex items-center py-2.5 px-4 text-sm font-medium text-center text-gray-900 bg-gray-100 border border-gray-300 rounded-s-lg hover:bg-gray-200 focus:ring-4 focus:outline-none focus:ring-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-gray-700 dark:text-white dark:border-gray-600"), attr$8(h, "type", "button"), attr$8(f, "id", "dropdown"), attr$8(f, "class", "z-10 hidden bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700"), attr$8(M, "type", "search"), attr$8(M, "id", "search-dropdown"), attr$8(M, "class", "p-2.5 w-full h-full z-20 text-sm text-gray-900 bg-gray-50 rounded-e-lg border-s-gray-50 border-s-2 border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-s-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:border-blue-500"), set_style$4(M, "display", "block"), attr$8(
M,
"placeholder",
/*placeholder*/
@@ -17601,10 +17616,10 @@ function create_fragment$9(n) {
/*currentSel*/
n[3]
]
- ), attr$8(l, "type", "submit"), attr$8(l, "class", "absolute top-0 end-0 p-2.5 text-sm font-medium h-full text-white bg-blue-700 rounded-e-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 svelte-8wrmgx"), attr$8(x, "class", "relative w-full svelte-8wrmgx"), attr$8(t, "class", "flex svelte-8wrmgx"), attr$8(e, "class", "max-w-lg mx-auto mb-2 my-2 svelte-8wrmgx");
+ ), attr$8(l, "type", "submit"), attr$8(l, "class", "absolute top-0 end-0 p-2.5 text-sm font-medium h-full text-white bg-blue-700 rounded-e-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"), attr$8(x, "class", "relative w-full"), attr$8(t, "class", "flex"), attr$8(e, "class", "max-w-lg mx-auto mb-2 my-2");
},
m(b, c) {
- insert_hydration$9(b, e, c), append_hydration$7(e, t), append_hydration$7(t, r), append_hydration$7(t, s), append_hydration$7(t, h), append_hydration$7(h, d), append_hydration$7(t, v), append_hydration$7(t, f), append_hydration$7(t, A), append_hydration$7(t, x), append_hydration$7(x, M), append_hydration$7(x, m), append_hydration$7(x, l), p || (g = [
+ insert_hydration$9(b, e, c), append_hydration$7(e, t), append_hydration$7(t, r), append_hydration$7(t, s), append_hydration$7(t, h), append_hydration$7(h, d), append_hydration$7(t, _), append_hydration$7(t, f), append_hydration$7(t, A), append_hydration$7(t, x), append_hydration$7(x, M), append_hydration$7(x, m), append_hydration$7(x, l), p || (g = [
listen$3(
M,
"input",
@@ -17628,26 +17643,26 @@ function create_fragment$9(n) {
function instance$9(n, e, t) {
const r = createEventDispatcher$5();
let { database: a = "rcsb-bioass" } = e, { index: s = 0 } = e, h = {
- "rcsb-3ligand": "RCSB 3-Letter Codes",
+ "rcsb-3ligand": "CCD",
pubchem: "Pubchem",
"rcsb-bioass": "RCSB BioAssembly"
}, o = {
"rcsb-3ligand": "e.g HEM, ZN, K, GOL ...",
pubchem: "molecule name",
"rcsb-bioass": "4 Letter PDB Code"
- }, d = a, v = "";
+ }, d = a, _ = "";
function f() {
r("triggerFetch", {
- text: v,
+ text: _,
database: d,
index: s
});
}
- const y = (A) => t(0, v = A.target.value);
+ const y = (A) => t(0, _ = A.target.value);
return n.$$set = (A) => {
"database" in A && t(5, a = A.database), "index" in A && t(6, s = A.index);
}, [
- v,
+ _,
h,
o,
d,
@@ -17678,7 +17693,8 @@ const {
insert_hydration: insert_hydration$8,
noop: noop$8,
safe_not_equal: safe_not_equal$9,
- set_style: set_style$2,
+ set_data: set_data$6,
+ set_style: set_style$3,
space: space$7,
text: text$7
} = window.__gradio__svelte__internal;
@@ -17707,19 +17723,23 @@ function create_each_block_1$2(n) {
a = claim_text$6(o, r), o.forEach(detach$8), h.forEach(detach$8), this.h();
},
h() {
- attr$7(t, "class", "inline-block p-0.5 svelte-hhspdt"), attr$7(t, "title", "residue " + /*chunk_ids*/
+ attr$7(t, "class", "inline-block p-0.5"), attr$7(t, "title", "residue " + /*chunk_ids*/
n[1][
/*i*/
n[5]
][
/*j*/
n[8]
- ]), attr$7(e, "class", "p-0.1 text-center w-full inline hover:font-bold cursor-pointer item-selectable ds-selectable svelte-hhspdt"), set_style$2(e, "font-family", "monospace");
+ ]), attr$7(e, "class", "p-0.1 text-center w-full inline hover:font-bold cursor-pointer item-selectable ds-selectable svelte-1sw8ehj"), set_style$3(e, "font-family", "monospace");
},
m(s, h) {
insert_hydration$8(s, e, h), append_hydration$6(e, t), append_hydration$6(t, a);
},
- p: noop$8,
+ p(s, h) {
+ h & /*chunked_seq*/
+ 1 && r !== (r = /*letter*/
+ s[6] + "") && set_data$6(a, r);
+ },
d(s) {
s && detach$8(e);
}
@@ -17747,7 +17767,7 @@ function create_each_block$3(n) {
t = claim_space$7(h), h.forEach(detach$8), this.h();
},
h() {
- attr$7(e, "class", "sequence__chunk svelte-hhspdt");
+ attr$7(e, "class", "sequence__chunk svelte-1sw8ehj");
},
m(s, h) {
insert_hydration$8(s, e, h);
@@ -17799,7 +17819,7 @@ function create_fragment$8(n) {
s.forEach(detach$8), this.h();
},
h() {
- attr$7(e, "class", "sequence_container text-xs svelte-hhspdt");
+ attr$7(e, "class", "sequence_container text-xs svelte-1sw8ehj");
},
m(a, s) {
insert_hydration$8(a, e, s);
@@ -17831,7 +17851,9 @@ function create_fragment$8(n) {
};
}
function instance$8(n, e, t) {
- let { seq: r = "" } = e, a = r.match(/.{1,10}/g), s = a.map((h, o) => h.split("").map((d, v) => o * 10 + v + 1));
+ let { seq: r = "" } = e, a = r.match(/.{1,10}/g);
+ a == null && (a = []);
+ let s = a.map((h, o) => h.split("").map((d, _) => o * 10 + _ + 1));
return n.$$set = (h) => {
"seq" in h && t(2, r = h.seq);
}, [a, s, r];
@@ -17874,8 +17896,8 @@ var _3Dmol$1 = { exports: {} };
"./node_modules/iobuffer/lib-esm/text.browser.js"
);
const a = 1024 * 8, s = (() => {
- const d = new Uint8Array(4), v = new Uint32Array(d.buffer);
- return !((v[0] = 1) & d[0]);
+ const d = new Uint8Array(4), _ = new Uint32Array(d.buffer);
+ return !((_[0] = 1) & d[0]);
})(), h = {
int8: globalThis.Int8Array,
uint8: globalThis.Uint8Array,
@@ -17897,12 +17919,12 @@ var _3Dmol$1 = { exports: {} };
* or a Node.js Buffer, a view will be created over the underlying ArrayBuffer.
* @param options
*/
- constructor(v = a, f = {}) {
+ constructor(_ = a, f = {}) {
let y = !1;
- typeof v == "number" ? v = new ArrayBuffer(v) : (y = !0, this.lastWrittenByte = v.byteLength);
- const A = f.offset ? f.offset >>> 0 : 0, x = v.byteLength - A;
+ typeof _ == "number" ? _ = new ArrayBuffer(_) : (y = !0, this.lastWrittenByte = _.byteLength);
+ const A = f.offset ? f.offset >>> 0 : 0, x = _.byteLength - A;
let M = A;
- (ArrayBuffer.isView(v) || v instanceof o) && (v.byteLength !== v.buffer.byteLength && (M = v.byteOffset + A), v = v.buffer), y ? this.lastWrittenByte = x : this.lastWrittenByte = 0, this.buffer = v, this.length = x, this.byteLength = x, this.byteOffset = M, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, M, x), this._mark = 0, this._marks = [];
+ (ArrayBuffer.isView(_) || _ instanceof o) && (_.byteLength !== _.buffer.byteLength && (M = _.byteOffset + A), _ = _.buffer), y ? this.lastWrittenByte = x : this.lastWrittenByte = 0, this.buffer = _, this.length = x, this.byteLength = x, this.byteOffset = M, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, M, x), this._mark = 0, this._marks = [];
}
/**
* Checks if the memory allocated to the buffer is sufficient to store more
@@ -17910,8 +17932,8 @@ var _3Dmol$1 = { exports: {} };
* @param byteLength - The needed memory in bytes.
* @returns `true` if there is sufficient space and `false` otherwise.
*/
- available(v = 1) {
- return this.offset + v <= this.length;
+ available(_ = 1) {
+ return this.offset + _ <= this.length;
}
/**
* Check if little-endian mode is used for reading and writing multi-byte
@@ -17944,22 +17966,22 @@ var _3Dmol$1 = { exports: {} };
* Move the pointer n bytes forward.
* @param n - Number of bytes to skip.
*/
- skip(v = 1) {
- return this.offset += v, this;
+ skip(_ = 1) {
+ return this.offset += _, this;
}
/**
* Move the pointer n bytes backward.
* @param n - Number of bytes to move back.
*/
- back(v = 1) {
- return this.offset -= v, this;
+ back(_ = 1) {
+ return this.offset -= _, this;
}
/**
* Move the pointer to the given offset.
* @param offset
*/
- seek(v) {
- return this.offset = v, this;
+ seek(_) {
+ return this.offset = _, this;
}
/**
* Store the current pointer offset.
@@ -17988,10 +18010,10 @@ var _3Dmol$1 = { exports: {} };
* @see {@link IOBuffer#pushMark}
*/
popMark() {
- const v = this._marks.pop();
- if (v === void 0)
+ const _ = this._marks.pop();
+ if (_ === void 0)
throw new Error("Mark stack empty");
- return this.seek(v), this;
+ return this.seek(_), this;
}
/**
* Move the pointer offset back to 0.
@@ -18006,9 +18028,9 @@ var _3Dmol$1 = { exports: {} };
* buffer (a copy) with a length that is twice (byteLength + current offset).
* @param byteLength
*/
- ensureAvailable(v = 1) {
- if (!this.available(v)) {
- const y = (this.offset + v) * 2, A = new Uint8Array(y);
+ ensureAvailable(_ = 1) {
+ if (!this.available(_)) {
+ const y = (this.offset + _) * 2, A = new Uint8Array(y);
A.set(new Uint8Array(this.buffer)), this.buffer = A.buffer, this.length = this.byteLength = y, this._data = new DataView(this.buffer);
}
return this;
@@ -18041,8 +18063,8 @@ var _3Dmol$1 = { exports: {} };
/**
* Read `n` bytes and move pointer forward by `n` bytes.
*/
- readBytes(v = 1) {
- return this.readArray(v, "uint8");
+ readBytes(_ = 1) {
+ return this.readArray(_, "uint8");
}
/**
* Creates an array of corresponding to the type `type` and size `size`.
@@ -18050,8 +18072,8 @@ var _3Dmol$1 = { exports: {} };
* @param size - size of the resulting array
* @param type - number type of elements to read
*/
- readArray(v, f) {
- const y = h[f].BYTES_PER_ELEMENT * v, A = this.byteOffset + this.offset, x = this.buffer.slice(A, A + y);
+ readArray(_, f) {
+ const y = h[f].BYTES_PER_ELEMENT * _, A = this.byteOffset + this.offset, x = this.buffer.slice(A, A + y);
if (this.littleEndian === s && f !== "uint8" && f !== "int8") {
const m = new Uint8Array(this.buffer.slice(A, A + y));
m.reverse();
@@ -18065,57 +18087,57 @@ var _3Dmol$1 = { exports: {} };
* Read a 16-bit signed integer and move pointer forward by 2 bytes.
*/
readInt16() {
- const v = this._data.getInt16(this.offset, this.littleEndian);
- return this.offset += 2, v;
+ const _ = this._data.getInt16(this.offset, this.littleEndian);
+ return this.offset += 2, _;
}
/**
* Read a 16-bit unsigned integer and move pointer forward by 2 bytes.
*/
readUint16() {
- const v = this._data.getUint16(this.offset, this.littleEndian);
- return this.offset += 2, v;
+ const _ = this._data.getUint16(this.offset, this.littleEndian);
+ return this.offset += 2, _;
}
/**
* Read a 32-bit signed integer and move pointer forward by 4 bytes.
*/
readInt32() {
- const v = this._data.getInt32(this.offset, this.littleEndian);
- return this.offset += 4, v;
+ const _ = this._data.getInt32(this.offset, this.littleEndian);
+ return this.offset += 4, _;
}
/**
* Read a 32-bit unsigned integer and move pointer forward by 4 bytes.
*/
readUint32() {
- const v = this._data.getUint32(this.offset, this.littleEndian);
- return this.offset += 4, v;
+ const _ = this._data.getUint32(this.offset, this.littleEndian);
+ return this.offset += 4, _;
}
/**
* Read a 32-bit floating number and move pointer forward by 4 bytes.
*/
readFloat32() {
- const v = this._data.getFloat32(this.offset, this.littleEndian);
- return this.offset += 4, v;
+ const _ = this._data.getFloat32(this.offset, this.littleEndian);
+ return this.offset += 4, _;
}
/**
* Read a 64-bit floating number and move pointer forward by 8 bytes.
*/
readFloat64() {
- const v = this._data.getFloat64(this.offset, this.littleEndian);
- return this.offset += 8, v;
+ const _ = this._data.getFloat64(this.offset, this.littleEndian);
+ return this.offset += 8, _;
}
/**
* Read a 64-bit signed integer number and move pointer forward by 8 bytes.
*/
readBigInt64() {
- const v = this._data.getBigInt64(this.offset, this.littleEndian);
- return this.offset += 8, v;
+ const _ = this._data.getBigInt64(this.offset, this.littleEndian);
+ return this.offset += 8, _;
}
/**
* Read a 64-bit unsigned integer number and move pointer forward by 8 bytes.
*/
readBigUint64() {
- const v = this._data.getBigUint64(this.offset, this.littleEndian);
- return this.offset += 8, v;
+ const _ = this._data.getBigUint64(this.offset, this.littleEndian);
+ return this.offset += 8, _;
}
/**
* Read a 1-byte ASCII character and move pointer forward by 1 byte.
@@ -18126,9 +18148,9 @@ var _3Dmol$1 = { exports: {} };
/**
* Read `n` 1-byte ASCII characters and move pointer forward by `n` bytes.
*/
- readChars(v = 1) {
+ readChars(_ = 1) {
let f = "";
- for (let y = 0; y < v; y++)
+ for (let y = 0; y < _; y++)
f += this.readChar();
return f;
}
@@ -18136,131 +18158,131 @@ var _3Dmol$1 = { exports: {} };
* Read the next `n` bytes, return a UTF-8 decoded string and move pointer
* forward by `n` bytes.
*/
- readUtf8(v = 1) {
- return (0, r.decode)(this.readBytes(v));
+ readUtf8(_ = 1) {
+ return (0, r.decode)(this.readBytes(_));
}
/**
* Read the next `n` bytes, return a string decoded with `encoding` and move pointer
* forward by `n` bytes.
* If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8}
*/
- decodeText(v = 1, f = "utf-8") {
- return (0, r.decode)(this.readBytes(v), f);
+ decodeText(_ = 1, f = "utf-8") {
+ return (0, r.decode)(this.readBytes(_), f);
}
/**
* Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer
* forward by 1 byte.
*/
- writeBoolean(v) {
- return this.writeUint8(v ? 255 : 0), this;
+ writeBoolean(_) {
+ return this.writeUint8(_ ? 255 : 0), this;
}
/**
* Write `value` as an 8-bit signed integer and move pointer forward by 1 byte.
*/
- writeInt8(v) {
- return this.ensureAvailable(1), this._data.setInt8(this.offset++, v), this._updateLastWrittenByte(), this;
+ writeInt8(_) {
+ return this.ensureAvailable(1), this._data.setInt8(this.offset++, _), this._updateLastWrittenByte(), this;
}
/**
* Write `value` as an 8-bit unsigned integer and move pointer forward by 1
* byte.
*/
- writeUint8(v) {
- return this.ensureAvailable(1), this._data.setUint8(this.offset++, v), this._updateLastWrittenByte(), this;
+ writeUint8(_) {
+ return this.ensureAvailable(1), this._data.setUint8(this.offset++, _), this._updateLastWrittenByte(), this;
}
/**
* An alias for {@link IOBuffer#writeUint8}.
*/
- writeByte(v) {
- return this.writeUint8(v);
+ writeByte(_) {
+ return this.writeUint8(_);
}
/**
* Write all elements of `bytes` as uint8 values and move pointer forward by
* `bytes.length` bytes.
*/
- writeBytes(v) {
- this.ensureAvailable(v.length);
- for (let f = 0; f < v.length; f++)
- this._data.setUint8(this.offset++, v[f]);
+ writeBytes(_) {
+ this.ensureAvailable(_.length);
+ for (let f = 0; f < _.length; f++)
+ this._data.setUint8(this.offset++, _[f]);
return this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 16-bit signed integer and move pointer forward by 2
* bytes.
*/
- writeInt16(v) {
- return this.ensureAvailable(2), this._data.setInt16(this.offset, v, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this;
+ writeInt16(_) {
+ return this.ensureAvailable(2), this._data.setInt16(this.offset, _, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 16-bit unsigned integer and move pointer forward by 2
* bytes.
*/
- writeUint16(v) {
- return this.ensureAvailable(2), this._data.setUint16(this.offset, v, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this;
+ writeUint16(_) {
+ return this.ensureAvailable(2), this._data.setUint16(this.offset, _, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 32-bit signed integer and move pointer forward by 4
* bytes.
*/
- writeInt32(v) {
- return this.ensureAvailable(4), this._data.setInt32(this.offset, v, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
+ writeInt32(_) {
+ return this.ensureAvailable(4), this._data.setInt32(this.offset, _, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 32-bit unsigned integer and move pointer forward by 4
* bytes.
*/
- writeUint32(v) {
- return this.ensureAvailable(4), this._data.setUint32(this.offset, v, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
+ writeUint32(_) {
+ return this.ensureAvailable(4), this._data.setUint32(this.offset, _, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 32-bit floating number and move pointer forward by 4
* bytes.
*/
- writeFloat32(v) {
- return this.ensureAvailable(4), this._data.setFloat32(this.offset, v, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
+ writeFloat32(_) {
+ return this.ensureAvailable(4), this._data.setFloat32(this.offset, _, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 64-bit floating number and move pointer forward by 8
* bytes.
*/
- writeFloat64(v) {
- return this.ensureAvailable(8), this._data.setFloat64(this.offset, v, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
+ writeFloat64(_) {
+ return this.ensureAvailable(8), this._data.setFloat64(this.offset, _, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 64-bit signed bigint and move pointer forward by 8
* bytes.
*/
- writeBigInt64(v) {
- return this.ensureAvailable(8), this._data.setBigInt64(this.offset, v, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
+ writeBigInt64(_) {
+ return this.ensureAvailable(8), this._data.setBigInt64(this.offset, _, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 64-bit unsigned bigint and move pointer forward by 8
* bytes.
*/
- writeBigUint64(v) {
- return this.ensureAvailable(8), this._data.setBigUint64(this.offset, v, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
+ writeBigUint64(_) {
+ return this.ensureAvailable(8), this._data.setBigUint64(this.offset, _, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
}
/**
* Write the charCode of `str`'s first character as an 8-bit unsigned integer
* and move pointer forward by 1 byte.
*/
- writeChar(v) {
- return this.writeUint8(v.charCodeAt(0));
+ writeChar(_) {
+ return this.writeUint8(_.charCodeAt(0));
}
/**
* Write the charCodes of all `str`'s characters as 8-bit unsigned integers
* and move pointer forward by `str.length` bytes.
*/
- writeChars(v) {
- for (let f = 0; f < v.length; f++)
- this.writeUint8(v.charCodeAt(f));
+ writeChars(_) {
+ for (let f = 0; f < _.length; f++)
+ this.writeUint8(_.charCodeAt(f));
return this;
}
/**
* UTF-8 encode and write `str` to the current pointer offset and move pointer
* forward according to the encoded length.
*/
- writeUtf8(v) {
- return this.writeBytes((0, r.encode)(v));
+ writeUtf8(_) {
+ return this.writeBytes((0, r.encode)(_));
}
/**
* Export a Uint8Array view of the internal buffer.
@@ -18301,7 +18323,7 @@ var _3Dmol$1 = { exports: {} };
throw new Error("Failed to encode: the 'stream' option is unsupported.");
let s = 0;
const h = r.length;
- let o = 0, d = Math.max(32, h + (h >> 1) + 7), v = new Uint8Array(d >> 3 << 3);
+ let o = 0, d = Math.max(32, h + (h >> 1) + 7), _ = new Uint8Array(d >> 3 << 3);
for (; s < h; ) {
let f = r.charCodeAt(s++);
if (f >= 55296 && f <= 56319) {
@@ -18312,27 +18334,27 @@ var _3Dmol$1 = { exports: {} };
if (f >= 55296 && f <= 56319)
continue;
}
- if (o + 4 > v.length) {
+ if (o + 4 > _.length) {
d += 8, d *= 1 + s / r.length * 2, d = d >> 3 << 3;
const y = new Uint8Array(d);
- y.set(v), v = y;
+ y.set(_), _ = y;
}
if (f & 4294967168)
if (!(f & 4294965248))
- v[o++] = f >> 6 & 31 | 192;
+ _[o++] = f >> 6 & 31 | 192;
else if (!(f & 4294901760))
- v[o++] = f >> 12 & 15 | 224, v[o++] = f >> 6 & 63 | 128;
+ _[o++] = f >> 12 & 15 | 224, _[o++] = f >> 6 & 63 | 128;
else if (!(f & 4292870144))
- v[o++] = f >> 18 & 7 | 240, v[o++] = f >> 12 & 63 | 128, v[o++] = f >> 6 & 63 | 128;
+ _[o++] = f >> 18 & 7 | 240, _[o++] = f >> 12 & 63 | 128, _[o++] = f >> 6 & 63 | 128;
else
continue;
else {
- v[o++] = f;
+ _[o++] = f;
continue;
}
- v[o++] = f & 63 | 128;
+ _[o++] = f & 63 | 128;
}
- return v.slice(0, o);
+ return _.slice(0, o);
};
function t(r = "utf-8", a = { fatal: !1 }) {
if (r !== "utf-8")
@@ -18351,20 +18373,20 @@ var _3Dmol$1 = { exports: {} };
let h = 0;
const o = s.length, d = [];
for (; h < o; ) {
- const v = s[h++];
- if (v === 0)
+ const _ = s[h++];
+ if (_ === 0)
break;
- if (!(v & 128))
- d.push(v);
- else if ((v & 224) === 192) {
+ if (!(_ & 128))
+ d.push(_);
+ else if ((_ & 224) === 192) {
const f = s[h++] & 63;
- d.push((v & 31) << 6 | f);
- } else if ((v & 240) === 224) {
+ d.push((_ & 31) << 6 | f);
+ } else if ((_ & 240) === 224) {
const f = s[h++] & 63, y = s[h++] & 63;
- d.push((v & 31) << 12 | f << 6 | y);
- } else if ((v & 248) === 240) {
+ d.push((_ & 31) << 12 | f << 6 | y);
+ } else if ((_ & 248) === 240) {
const f = s[h++] & 63, y = s[h++] & 63, A = s[h++] & 63;
- let x = (v & 7) << 18 | f << 12 | y << 6 | A;
+ let x = (_ & 7) << 18 | f << 12 | y << 6 | A;
x > 65535 && (x -= 65536, d.push(x >>> 10 & 1023 | 55296), x = 56320 | x & 1023), d.push(x);
}
}
@@ -18430,17 +18452,17 @@ var _3Dmol$1 = { exports: {} };
"./node_modules/netcdfjs/lib-esm/types.js"
);
function a(h, o) {
- const d = (0, r.str2num)(o.type), v = o.size / (0, r.num2bytes)(d), f = new Array(v);
- for (let y = 0; y < v; y++)
+ const d = (0, r.str2num)(o.type), _ = o.size / (0, r.num2bytes)(d), f = new Array(_);
+ for (let y = 0; y < _; y++)
f[y] = (0, r.readType)(h, d, 1);
return f;
}
function s(h, o, d) {
- const v = (0, r.str2num)(o.type), f = o.size ? o.size / (0, r.num2bytes)(v) : 1, y = d.length, A = new Array(y), x = d.recordStep;
+ const _ = (0, r.str2num)(o.type), f = o.size ? o.size / (0, r.num2bytes)(_) : 1, y = d.length, A = new Array(y), x = d.recordStep;
if (x)
for (let M = 0; M < y; M++) {
const m = h.offset;
- A[M] = (0, r.readType)(h, v, f), h.seek(m + x);
+ A[M] = (0, r.readType)(h, _, f), h.seek(m + x);
}
else
throw new Error("recordDimension.recordStep is undefined");
@@ -18470,13 +18492,13 @@ var _3Dmol$1 = { exports: {} };
/*! ./utils */
"./node_modules/netcdfjs/lib-esm/utils.js"
);
- const s = 0, h = 10, o = 11, d = 12, v = 0;
+ const s = 0, h = 10, o = 11, d = 12, _ = 0;
function f(M, m) {
const l = { version: m }, u = {
length: M.readUint32()
}, p = y(M);
Array.isArray(p) || (u.id = p.recordId, u.name = p.recordName, l.dimensions = p.dimensions), l.globalAttributes = A(M);
- const g = x(M, u?.id, m);
+ const g = x(M, u == null ? void 0 : u.id, m);
return Array.isArray(g) || (l.variables = g.variables, u.recordStep = g.recordStep), l.recordDimension = u, l;
}
function y(M) {
@@ -18491,9 +18513,9 @@ var _3Dmol$1 = { exports: {} };
const b = M.readUint32();
g = new Array(b);
for (let c = 0; c < b; c++) {
- const _ = (0, a.readName)(M), E = M.readUint32();
- E === v && (l = c, u = _), g[c] = {
- name: _,
+ const v = (0, a.readName)(M), E = M.readUint32();
+ E === _ && (l = c, u = v), g[c] = {
+ name: v,
size: E
};
}
@@ -18512,11 +18534,11 @@ var _3Dmol$1 = { exports: {} };
for (let p = 0; p < u; p++) {
const g = (0, a.readName)(M), b = M.readUint32();
(0, a.notNetcdf)(b < 1 || b > 6, `non valid type ${b}`);
- const c = M.readUint32(), _ = (0, r.readType)(M, b, c);
+ const c = M.readUint32(), v = (0, r.readType)(M, b, c);
(0, a.padding)(M), l[p] = {
name: g,
type: (0, r.num2str)(b),
- value: _
+ value: v
};
}
}
@@ -18532,22 +18554,22 @@ var _3Dmol$1 = { exports: {} };
const b = M.readUint32();
g = new Array(b);
for (let c = 0; c < b; c++) {
- const _ = (0, a.readName)(M), E = M.readUint32(), w = new Array(E);
- for (let R = 0; R < E; R++)
- w[R] = M.readUint32();
+ const v = (0, a.readName)(M), E = M.readUint32(), w = new Array(E);
+ for (let P = 0; P < E; P++)
+ w[P] = M.readUint32();
const k = A(M), $ = M.readUint32();
(0, a.notNetcdf)($ < 1 && $ > 6, `non valid type ${$}`);
const L = M.readUint32();
- let z = M.readUint32();
- l === 2 && ((0, a.notNetcdf)(z > 0, "offsets larger than 4GB not supported"), z = M.readUint32());
+ let I = M.readUint32();
+ l === 2 && ((0, a.notNetcdf)(I > 0, "offsets larger than 4GB not supported"), I = M.readUint32());
let F = !1;
typeof m < "u" && w[0] === m && (p += L, F = !0), g[c] = {
- name: _,
+ name: v,
dimensions: w,
attributes: k,
type: (0, r.num2str)($),
size: L,
- offset: z,
+ offset: I,
record: F
};
}
@@ -18844,7 +18866,7 @@ var _3Dmol$1 = { exports: {} };
case r.BYTE:
return Array.from(f.readBytes(A));
case r.CHAR:
- return v(f.readChars(A));
+ return _(f.readChars(A));
case r.SHORT:
return o(A, f.readInt16.bind(f));
case r.INT:
@@ -18857,7 +18879,7 @@ var _3Dmol$1 = { exports: {} };
throw new Error(`non valid type ${y}`);
}
}
- function v(f) {
+ function _(f) {
return f.charCodeAt(f.length - 1) === 0 ? f.substring(0, f.length - 1) : f;
}
}
@@ -20580,87 +20602,87 @@ void main() {
var s;
(function(h) {
function o(m, l, u) {
- var p = Math.hypot(m, l), g, b, c, _, E;
- p < 1e-4 ? (b = 0, c = 1) : (b = -m / p, c = l / p), l = -b * m + c * l, g = Math.hypot(l, u), g < 1e-4 ? (_ = 0, E = 1) : (_ = u / g, E = l / g);
+ var p = Math.hypot(m, l), g, b, c, v, E;
+ p < 1e-4 ? (b = 0, c = 1) : (b = -m / p, c = l / p), l = -b * m + c * l, g = Math.hypot(l, u), g < 1e-4 ? (v = 0, E = 1) : (v = u / g, E = l / g);
var w = new Float32Array(9);
- return w[0] = c, w[1] = b, w[2] = 0, w[3] = -b * E, w[4] = c * E, w[5] = _, w[6] = b * _, w[7] = -c * _, w[8] = E, w;
+ return w[0] = c, w[1] = b, w[2] = 0, w[3] = -b * E, w[4] = c * E, w[5] = v, w[6] = b * v, w[7] = -c * v, w[8] = E, w;
}
class d {
constructor() {
this.cache = {};
- let l = [], u = 4, p = Math.pow(2, u), g = 2, b = Math.pow(2, g), c = p / b, _;
+ let l = [], u = 4, p = Math.pow(2, u), g = 2, b = Math.pow(2, g), c = p / b, v;
for (l[0] = new r.Vector3(-1, 0, 0), l[c] = new r.Vector3(0, 0, 1), l[c * 2] = new r.Vector3(1, 0, 0), l[c * 3] = new r.Vector3(0, 0, -1), g = 3; g <= u; g++) {
- for (b = Math.pow(2, g - 1), c = p / b, _ = 0; _ < b - 1; _++)
- l[c / 2 + _ * c] = l[_ * c].clone().add(l[(_ + 1) * c]).normalize();
- _ = b - 1, l[c / 2 + _ * c] = l[_ * c].clone().add(l[0]).normalize();
+ for (b = Math.pow(2, g - 1), c = p / b, v = 0; v < b - 1; v++)
+ l[c / 2 + v * c] = l[v * c].clone().add(l[(v + 1) * c]).normalize();
+ v = b - 1, l[c / 2 + v * c] = l[v * c].clone().add(l[0]).normalize();
}
this.basisVectors = l;
}
getVerticesForRadius(l, u, p) {
if (typeof this.cache < "u" && this.cache[l] !== void 0 && this.cache[l][u + p] !== void 0)
return this.cache[l][u + p];
- for (var g = this.basisVectors.length, b = [], c = [], _, E = 0; E < g; E++)
- b.push(this.basisVectors[E].clone().multiplyScalar(l)), b.push(this.basisVectors[E].clone().multiplyScalar(l)), _ = this.basisVectors[E].clone().normalize(), c.push(_), c.push(_);
- var w = [], k = 10, $ = g, L = 0, z = Math.PI * 2, F = 0, R = Math.PI, P, U, N = !1, B = !1;
- for (U = 0; U <= k; U++) {
- N = U === 0 || U === k, B = U === k / 2;
- var W = [], V = [];
- for (P = 0; P <= $; P++) {
- if (B) {
- var G = P < $ ? 2 * P : 0;
- V.push(G + 1), W.push(G);
+ for (var g = this.basisVectors.length, b = [], c = [], v, E = 0; E < g; E++)
+ b.push(this.basisVectors[E].clone().multiplyScalar(l)), b.push(this.basisVectors[E].clone().multiplyScalar(l)), v = this.basisVectors[E].clone().normalize(), c.push(v), c.push(v);
+ var w = [], k = 10, $ = g, L = 0, I = Math.PI * 2, F = 0, P = Math.PI, B, G, U = !1, R = !1;
+ for (G = 0; G <= k; G++) {
+ U = G === 0 || G === k, R = G === k / 2;
+ var W = [], H = [];
+ for (B = 0; B <= $; B++) {
+ if (R) {
+ var N = B < $ ? 2 * B : 0;
+ H.push(N + 1), W.push(N);
continue;
}
- var H = P / $, Q = U / k;
- if (!N || P === 0)
- if (P < $) {
- var te = new r.Vector3();
- te.x = -l * Math.cos(L + H * z) * Math.sin(F + Q * R), u == 1 ? te.y = 0 : te.y = l * Math.cos(F + Q * R), te.z = l * Math.sin(L + H * z) * Math.sin(F + Q * R), Math.abs(te.x) < 1e-5 && (te.x = 0), Math.abs(te.y) < 1e-5 && (te.y = 0), Math.abs(te.z) < 1e-5 && (te.z = 0), u == a.FLAT ? (_ = new r.Vector3(0, Math.cos(F + Q * R), 0), _.normalize()) : (_ = new r.Vector3(te.x, te.y, te.z), _.normalize()), b.push(te), c.push(_), W.push(b.length - 1);
+ var V = B / $, J = G / k;
+ if (!U || B === 0)
+ if (B < $) {
+ var re = new r.Vector3();
+ re.x = -l * Math.cos(L + V * I) * Math.sin(F + J * P), u == 1 ? re.y = 0 : re.y = l * Math.cos(F + J * P), re.z = l * Math.sin(L + V * I) * Math.sin(F + J * P), Math.abs(re.x) < 1e-5 && (re.x = 0), Math.abs(re.y) < 1e-5 && (re.y = 0), Math.abs(re.z) < 1e-5 && (re.z = 0), u == a.FLAT ? (v = new r.Vector3(0, Math.cos(F + J * P), 0), v.normalize()) : (v = new r.Vector3(re.x, re.y, re.z), v.normalize()), b.push(re), c.push(v), W.push(b.length - 1);
} else
W.push(b.length - $);
- else N && W.push(b.length - 1);
+ else U && W.push(b.length - 1);
}
- B && w.push(V), w.push(W);
+ R && w.push(H), w.push(W);
}
- var ee = {
+ var te = {
vertices: b,
normals: c,
verticesRows: w,
w: $,
h: k
};
- return l in this.cache || (this.cache[l] = {}), this.cache[l][u + p] = ee, ee;
+ return l in this.cache || (this.cache[l] = {}), this.cache[l][u + p] = te, te;
}
}
- var v = new d();
+ var _ = new d();
function f(m, l, u, p, g, b = 0, c = 0) {
if (!l || !u)
return;
- let _ = function(Me) {
- if (typeof Me == "string") {
- let Ye = Me;
+ let v = function(De) {
+ if (typeof De == "string") {
+ let Ye = De;
return Ye.toLowerCase() == "flat" ? a.FLAT : Ye.toLowerCase() == "round" ? a.ROUND : a.NONE;
} else
- return Me;
+ return De;
};
- b = _(b), c = _(c);
+ b = v(b), c = v(c);
var E = c || b;
g = g || { r: 0, g: 0, b: 0 };
- var w = o(u.x - l.x, u.y - l.y, u.z - l.z), k = v.getVerticesForRadius(p, c, "to"), $ = k.w, L = k.h, z = E ? L * $ + 2 : 2 * $, F = m.updateGeoGroup(z), R = k.vertices, P = k.normals, U = k.verticesRows, N = U[L / 2], B = U[L / 2 + 1], W = F.vertices, V, G, H, Q, te, ee, ce = F.vertexArray, fe = F.normalArray, oe = F.colorArray, he = F.faceArray;
- for (H = 0; H < $; ++H) {
- var Ae = 2 * H;
- Q = w[0] * R[Ae].x + w[3] * R[Ae].y + w[6] * R[Ae].z, te = w[1] * R[Ae].x + w[4] * R[Ae].y + w[7] * R[Ae].z, ee = w[5] * R[Ae].y + w[8] * R[Ae].z, V = 3 * (W + Ae), G = F.faceidx, ce[V] = Q + l.x, ce[V + 1] = te + l.y, ce[V + 2] = ee + l.z, ce[V + 3] = Q + u.x, ce[V + 4] = te + u.y, ce[V + 5] = ee + u.z, fe[V] = Q, fe[V + 3] = Q, fe[V + 1] = te, fe[V + 4] = te, fe[V + 2] = ee, fe[V + 5] = ee, oe[V] = g.r, oe[V + 3] = g.r, oe[V + 1] = g.g, oe[V + 4] = g.g, oe[V + 2] = g.b, oe[V + 5] = g.b, he[G] = B[H] + W, he[G + 1] = B[H + 1] + W, he[G + 2] = N[H] + W, he[G + 3] = N[H] + W, he[G + 4] = B[H + 1] + W, he[G + 5] = N[H + 1] + W, F.faceidx += 6;
+ var w = o(u.x - l.x, u.y - l.y, u.z - l.z), k = _.getVerticesForRadius(p, c, "to"), $ = k.w, L = k.h, I = E ? L * $ + 2 : 2 * $, F = m.updateGeoGroup(I), P = k.vertices, B = k.normals, G = k.verticesRows, U = G[L / 2], R = G[L / 2 + 1], W = F.vertices, H, N, V, J, re, te, ue = F.vertexArray, ie = F.normalArray, ae = F.colorArray, ce = F.faceArray;
+ for (V = 0; V < $; ++V) {
+ var Me = 2 * V;
+ J = w[0] * P[Me].x + w[3] * P[Me].y + w[6] * P[Me].z, re = w[1] * P[Me].x + w[4] * P[Me].y + w[7] * P[Me].z, te = w[5] * P[Me].y + w[8] * P[Me].z, H = 3 * (W + Me), N = F.faceidx, ue[H] = J + l.x, ue[H + 1] = re + l.y, ue[H + 2] = te + l.z, ue[H + 3] = J + u.x, ue[H + 4] = re + u.y, ue[H + 5] = te + u.z, ie[H] = J, ie[H + 3] = J, ie[H + 1] = re, ie[H + 4] = re, ie[H + 2] = te, ie[H + 5] = te, ae[H] = g.r, ae[H + 3] = g.r, ae[H + 1] = g.g, ae[H + 4] = g.g, ae[H + 2] = g.b, ae[H + 5] = g.b, ce[N] = R[V] + W, ce[N + 1] = R[V + 1] + W, ce[N + 2] = U[V] + W, ce[N + 3] = U[V] + W, ce[N + 4] = R[V + 1] + W, ce[N + 5] = U[V + 1] + W, F.faceidx += 6;
}
if (E) {
- var Se = c ? 0 : L / 2, Ie = b ? L + 1 : L / 2 + 1, pe, le, ne, Te, Oe, Be, Ue, Pe, Ge, Ne, Re, De, je, Xe, X, q, re, ye, me, ze, ke, K, ae, ge, xe, ue, Ce, Z, Fe, We, I, we;
- for (te = Se; te < Ie; te++)
- if (te !== L / 2) {
- var ve = te <= L / 2 ? u : l, Y = v.getVerticesForRadius(p, c, "to"), de = v.getVerticesForRadius(p, b, "from");
- for (ve === u ? (R = Y.vertices, P = Y.normals, U = Y.verticesRows) : ve == l && (R = de.vertices, P = de.normals, U = de.verticesRows), Q = 0; Q < $; Q++)
- G = F.faceidx, pe = U[te][Q + 1], Fe = (pe + W) * 3, le = U[te][Q], We = (le + W) * 3, ne = U[te + 1][Q], I = (ne + W) * 3, Te = U[te + 1][Q + 1], we = (Te + W) * 3, Oe = w[0] * R[pe].x + w[3] * R[pe].y + w[6] * R[pe].z, Be = w[0] * R[le].x + w[3] * R[le].y + w[6] * R[le].z, Ue = w[0] * R[ne].x + w[3] * R[ne].y + w[6] * R[ne].z, Pe = w[0] * R[Te].x + w[3] * R[Te].y + w[6] * R[Te].z, Ge = w[1] * R[pe].x + w[4] * R[pe].y + w[7] * R[pe].z, Ne = w[1] * R[le].x + w[4] * R[le].y + w[7] * R[le].z, Re = w[1] * R[ne].x + w[4] * R[ne].y + w[7] * R[ne].z, De = w[1] * R[Te].x + w[4] * R[Te].y + w[7] * R[Te].z, je = w[5] * R[pe].y + w[8] * R[pe].z, Xe = w[5] * R[le].y + w[8] * R[le].z, X = w[5] * R[ne].y + w[8] * R[ne].z, q = w[5] * R[Te].y + w[8] * R[Te].z, ce[Fe] = Oe + ve.x, ce[We] = Be + ve.x, ce[I] = Ue + ve.x, ce[we] = Pe + ve.x, ce[Fe + 1] = Ge + ve.y, ce[We + 1] = Ne + ve.y, ce[I + 1] = Re + ve.y, ce[we + 1] = De + ve.y, ce[Fe + 2] = je + ve.z, ce[We + 2] = Xe + ve.z, ce[I + 2] = X + ve.z, ce[we + 2] = q + ve.z, oe[Fe] = g.r, oe[We] = g.r, oe[I] = g.r, oe[we] = g.r, oe[Fe + 1] = g.g, oe[We + 1] = g.g, oe[I + 1] = g.g, oe[we + 1] = g.g, oe[Fe + 2] = g.b, oe[We + 2] = g.b, oe[I + 2] = g.b, oe[we + 2] = g.b, re = w[0] * P[pe].x + w[3] * P[pe].y + w[6] * P[pe].z, ye = w[0] * P[le].x + w[3] * P[le].y + w[6] * P[le].z, me = w[0] * P[ne].x + w[3] * P[ne].y + w[6] * P[ne].z, ze = w[0] * P[Te].x + w[3] * P[Te].y + w[6] * P[Te].z, ke = w[1] * P[pe].x + w[4] * P[pe].y + w[7] * P[pe].z, K = w[1] * P[le].x + w[4] * P[le].y + w[7] * P[le].z, ae = w[1] * P[ne].x + w[4] * P[ne].y + w[7] * P[ne].z, ge = w[1] * P[Te].x + w[4] * P[Te].y + w[7] * P[Te].z, xe = w[5] * P[pe].y + w[8] * P[pe].z, ue = w[5] * P[le].y + w[8] * P[le].z, Ce = w[5] * P[ne].y + w[8] * P[ne].z, Z = w[5] * P[Te].y + w[8] * P[Te].z, te === 0 ? (fe[Fe] = re, fe[I] = me, fe[we] = ze, fe[Fe + 1] = ke, fe[I + 1] = ae, fe[we + 1] = ge, fe[Fe + 2] = xe, fe[I + 2] = Ce, fe[we + 2] = Z, he[G] = pe + W, he[G + 1] = ne + W, he[G + 2] = Te + W, F.faceidx += 3) : te === Ie - 1 ? (fe[Fe] = re, fe[We] = ye, fe[I] = me, fe[Fe + 1] = ke, fe[We + 1] = K, fe[I + 1] = ae, fe[Fe + 2] = xe, fe[We + 2] = ue, fe[I + 2] = Ce, he[G] = pe + W, he[G + 1] = le + W, he[G + 2] = ne + W, F.faceidx += 3) : (fe[Fe] = re, fe[We] = ye, fe[we] = ze, fe[Fe + 1] = ke, fe[We + 1] = K, fe[we + 1] = ge, fe[Fe + 2] = xe, fe[We + 2] = ue, fe[we + 2] = Z, fe[We] = ye, fe[I] = me, fe[we] = ze, fe[We + 1] = K, fe[I + 1] = ae, fe[we + 1] = ge, fe[We + 2] = ue, fe[I + 2] = Ce, fe[we + 2] = Z, he[G] = pe + W, he[G + 1] = le + W, he[G + 2] = Te + W, he[G + 3] = le + W, he[G + 4] = ne + W, he[G + 5] = Te + W, F.faceidx += 6);
+ var Ae = c ? 0 : L / 2, Ie = b ? L + 1 : L / 2 + 1, pe, se, Q, ye, ke, Pe, Ne, Be, Ge, Ue, Re, Ce, je, Xe, X, q, ne, xe, me, ze, $e, K, oe, ge, we, de, Te, Z, Fe, We, z, Ee;
+ for (re = Ae; re < Ie; re++)
+ if (re !== L / 2) {
+ var ve = re <= L / 2 ? u : l, Y = _.getVerticesForRadius(p, c, "to"), fe = _.getVerticesForRadius(p, b, "from");
+ for (ve === u ? (P = Y.vertices, B = Y.normals, G = Y.verticesRows) : ve == l && (P = fe.vertices, B = fe.normals, G = fe.verticesRows), J = 0; J < $; J++)
+ N = F.faceidx, pe = G[re][J + 1], Fe = (pe + W) * 3, se = G[re][J], We = (se + W) * 3, Q = G[re + 1][J], z = (Q + W) * 3, ye = G[re + 1][J + 1], Ee = (ye + W) * 3, ke = w[0] * P[pe].x + w[3] * P[pe].y + w[6] * P[pe].z, Pe = w[0] * P[se].x + w[3] * P[se].y + w[6] * P[se].z, Ne = w[0] * P[Q].x + w[3] * P[Q].y + w[6] * P[Q].z, Be = w[0] * P[ye].x + w[3] * P[ye].y + w[6] * P[ye].z, Ge = w[1] * P[pe].x + w[4] * P[pe].y + w[7] * P[pe].z, Ue = w[1] * P[se].x + w[4] * P[se].y + w[7] * P[se].z, Re = w[1] * P[Q].x + w[4] * P[Q].y + w[7] * P[Q].z, Ce = w[1] * P[ye].x + w[4] * P[ye].y + w[7] * P[ye].z, je = w[5] * P[pe].y + w[8] * P[pe].z, Xe = w[5] * P[se].y + w[8] * P[se].z, X = w[5] * P[Q].y + w[8] * P[Q].z, q = w[5] * P[ye].y + w[8] * P[ye].z, ue[Fe] = ke + ve.x, ue[We] = Pe + ve.x, ue[z] = Ne + ve.x, ue[Ee] = Be + ve.x, ue[Fe + 1] = Ge + ve.y, ue[We + 1] = Ue + ve.y, ue[z + 1] = Re + ve.y, ue[Ee + 1] = Ce + ve.y, ue[Fe + 2] = je + ve.z, ue[We + 2] = Xe + ve.z, ue[z + 2] = X + ve.z, ue[Ee + 2] = q + ve.z, ae[Fe] = g.r, ae[We] = g.r, ae[z] = g.r, ae[Ee] = g.r, ae[Fe + 1] = g.g, ae[We + 1] = g.g, ae[z + 1] = g.g, ae[Ee + 1] = g.g, ae[Fe + 2] = g.b, ae[We + 2] = g.b, ae[z + 2] = g.b, ae[Ee + 2] = g.b, ne = w[0] * B[pe].x + w[3] * B[pe].y + w[6] * B[pe].z, xe = w[0] * B[se].x + w[3] * B[se].y + w[6] * B[se].z, me = w[0] * B[Q].x + w[3] * B[Q].y + w[6] * B[Q].z, ze = w[0] * B[ye].x + w[3] * B[ye].y + w[6] * B[ye].z, $e = w[1] * B[pe].x + w[4] * B[pe].y + w[7] * B[pe].z, K = w[1] * B[se].x + w[4] * B[se].y + w[7] * B[se].z, oe = w[1] * B[Q].x + w[4] * B[Q].y + w[7] * B[Q].z, ge = w[1] * B[ye].x + w[4] * B[ye].y + w[7] * B[ye].z, we = w[5] * B[pe].y + w[8] * B[pe].z, de = w[5] * B[se].y + w[8] * B[se].z, Te = w[5] * B[Q].y + w[8] * B[Q].z, Z = w[5] * B[ye].y + w[8] * B[ye].z, re === 0 ? (ie[Fe] = ne, ie[z] = me, ie[Ee] = ze, ie[Fe + 1] = $e, ie[z + 1] = oe, ie[Ee + 1] = ge, ie[Fe + 2] = we, ie[z + 2] = Te, ie[Ee + 2] = Z, ce[N] = pe + W, ce[N + 1] = Q + W, ce[N + 2] = ye + W, F.faceidx += 3) : re === Ie - 1 ? (ie[Fe] = ne, ie[We] = xe, ie[z] = me, ie[Fe + 1] = $e, ie[We + 1] = K, ie[z + 1] = oe, ie[Fe + 2] = we, ie[We + 2] = de, ie[z + 2] = Te, ce[N] = pe + W, ce[N + 1] = se + W, ce[N + 2] = Q + W, F.faceidx += 3) : (ie[Fe] = ne, ie[We] = xe, ie[Ee] = ze, ie[Fe + 1] = $e, ie[We + 1] = K, ie[Ee + 1] = ge, ie[Fe + 2] = we, ie[We + 2] = de, ie[Ee + 2] = Z, ie[We] = xe, ie[z] = me, ie[Ee] = ze, ie[We + 1] = K, ie[z + 1] = oe, ie[Ee + 1] = ge, ie[We + 2] = de, ie[z + 2] = Te, ie[Ee + 2] = Z, ce[N] = pe + W, ce[N + 1] = se + W, ce[N + 2] = ye + W, ce[N + 3] = se + W, ce[N + 4] = Q + W, ce[N + 5] = ye + W, F.faceidx += 6);
}
}
- F.vertices += z;
+ F.vertices += I;
}
h.drawCylinder = f;
function y(m, l, u, p, g) {
@@ -20670,16 +20692,16 @@ void main() {
let b = new r.Vector3(u.x - l.x, u.y - l.y, u.z - l.z);
var c = o(b.x, b.y, b.z);
b = b.normalize();
- var _ = v.basisVectors.length, E = v.basisVectors, w = _ + 2, k = m.updateGeoGroup(w), $ = k.vertices, L, z, F, R, P, U, N = k.vertexArray, B = k.normalArray, W = k.colorArray, V = k.faceArray;
- for (L = $ * 3, N[L] = l.x, N[L + 1] = l.y, N[L + 2] = l.z, B[L] = -b.x, B[L + 1] = -b.y, B[L + 2] = -b.z, W[L] = g.r, W[L + 1] = g.g, W[L + 2] = g.b, N[L + 3] = u.x, N[L + 4] = u.y, N[L + 5] = u.z, B[L + 3] = b.x, B[L + 4] = b.y, B[L + 5] = b.z, W[L + 3] = g.r, W[L + 4] = g.g, W[L + 5] = g.b, L += 6, F = 0; F < _; ++F) {
- var G = E[F].clone();
- G.multiplyScalar(p), R = c[0] * G.x + c[3] * G.y + c[6] * G.z, P = c[1] * G.x + c[4] * G.y + c[7] * G.z, U = c[5] * G.y + c[8] * G.z, N[L] = R + l.x, N[L + 1] = P + l.y, N[L + 2] = U + l.z, B[L] = R, B[L + 1] = P, B[L + 2] = U, W[L] = g.r, W[L + 1] = g.g, W[L + 2] = g.b, L += 3;
+ var v = _.basisVectors.length, E = _.basisVectors, w = v + 2, k = m.updateGeoGroup(w), $ = k.vertices, L, I, F, P, B, G, U = k.vertexArray, R = k.normalArray, W = k.colorArray, H = k.faceArray;
+ for (L = $ * 3, U[L] = l.x, U[L + 1] = l.y, U[L + 2] = l.z, R[L] = -b.x, R[L + 1] = -b.y, R[L + 2] = -b.z, W[L] = g.r, W[L + 1] = g.g, W[L + 2] = g.b, U[L + 3] = u.x, U[L + 4] = u.y, U[L + 5] = u.z, R[L + 3] = b.x, R[L + 4] = b.y, R[L + 5] = b.z, W[L + 3] = g.r, W[L + 4] = g.g, W[L + 5] = g.b, L += 6, F = 0; F < v; ++F) {
+ var N = E[F].clone();
+ N.multiplyScalar(p), P = c[0] * N.x + c[3] * N.y + c[6] * N.z, B = c[1] * N.x + c[4] * N.y + c[7] * N.z, G = c[5] * N.y + c[8] * N.z, U[L] = P + l.x, U[L + 1] = B + l.y, U[L + 2] = G + l.z, R[L] = P, R[L + 1] = B, R[L + 2] = G, W[L] = g.r, W[L + 1] = g.g, W[L + 2] = g.b, L += 3;
}
- for (k.vertices += _ + 2, z = k.faceidx, F = 0; F < _; F++) {
- var H = $ + 2 + F, Q = $ + 2 + (F + 1) % _;
- V[z] = H, V[z + 1] = Q, V[z + 2] = $, z += 3, V[z] = H, V[z + 1] = Q, V[z + 2] = $ + 1, z += 3;
+ for (k.vertices += v + 2, I = k.faceidx, F = 0; F < v; F++) {
+ var V = $ + 2 + F, J = $ + 2 + (F + 1) % v;
+ H[I] = V, H[I + 1] = J, H[I + 2] = $, I += 3, H[I] = V, H[I + 1] = J, H[I + 2] = $ + 1, I += 3;
}
- k.faceidx += 6 * _;
+ k.faceidx += 6 * v;
}
h.drawCone = y;
class A {
@@ -20697,13 +20719,13 @@ void main() {
normals: []
}, b = 16 * u, c = 10 * u;
l < 1 && (b = 10 * u, c = 8 * u);
- var _ = 0, E = Math.PI * 2, w = 0, k = Math.PI, $, L;
+ var v = 0, E = Math.PI * 2, w = 0, k = Math.PI, $, L;
for (L = 0; L <= c; L++) {
let F = [];
for ($ = 0; $ <= b; $++) {
- let R = $ / b, P = L / c, U = -l * Math.cos(_ + R * E) * Math.sin(w + P * k), N = l * Math.cos(w + P * k), B = l * Math.sin(_ + R * E) * Math.sin(w + P * k);
- var z = new r.Vector3(U, N, B);
- z.normalize(), g.vertices.push({ x: U, y: N, z: B }), g.normals.push(z), F.push(g.vertices.length - 1);
+ let P = $ / b, B = L / c, G = -l * Math.cos(v + P * E) * Math.sin(w + B * k), U = l * Math.cos(w + B * k), R = l * Math.sin(v + P * E) * Math.sin(w + B * k);
+ var I = new r.Vector3(G, U, R);
+ I.normalize(), g.vertices.push({ x: G, y: U, z: R }), g.normals.push(I), F.push(g.vertices.length - 1);
}
g.verticesRows.push(F);
}
@@ -20712,18 +20734,18 @@ void main() {
}
var x = new A();
function M(m, l, u, p, g) {
- var b = x.getVerticesForRadius(u, g), c = b.vertices, _ = b.normals, E = m.updateGeoGroup(c.length), w = E.vertices, k = E.vertexArray, $ = E.colorArray, L = E.faceArray, z = E.lineArray, F = E.normalArray;
- for (let U = 0, N = c.length; U < N; ++U) {
- let B = 3 * (w + U), W = c[U];
- k[B] = W.x + l.x, k[B + 1] = W.y + l.y, k[B + 2] = W.z + l.z, $[B] = p.r, $[B + 1] = p.g, $[B + 2] = p.b;
+ var b = x.getVerticesForRadius(u, g), c = b.vertices, v = b.normals, E = m.updateGeoGroup(c.length), w = E.vertices, k = E.vertexArray, $ = E.colorArray, L = E.faceArray, I = E.lineArray, F = E.normalArray;
+ for (let G = 0, U = c.length; G < U; ++G) {
+ let R = 3 * (w + G), W = c[G];
+ k[R] = W.x + l.x, k[R + 1] = W.y + l.y, k[R + 2] = W.z + l.z, $[R] = p.r, $[R + 1] = p.g, $[R + 2] = p.b;
}
E.vertices += c.length;
- let R = b.verticesRows, P = R.length - 1;
- for (let U = 0; U < P; U++) {
- let N = R[U].length - 1;
- for (let B = 0; B < N; B++) {
- let W = E.faceidx, V = E.lineidx, G = R[U][B + 1] + w, H = G * 3, Q = R[U][B] + w, te = Q * 3, ee = R[U + 1][B] + w, ce = ee * 3, fe = R[U + 1][B + 1] + w, oe = fe * 3, he = _[G - w], Ae = _[Q - w], Se = _[ee - w], Ie = _[fe - w];
- Math.abs(c[G - w].y) === u ? (F[H] = he.x, F[ce] = Se.x, F[oe] = Ie.x, F[H + 1] = he.y, F[ce + 1] = Se.y, F[oe + 1] = Ie.y, F[H + 2] = he.z, F[ce + 2] = Se.z, F[oe + 2] = Ie.z, L[W] = G, L[W + 1] = ee, L[W + 2] = fe, z[V] = G, z[V + 1] = ee, z[V + 2] = G, z[V + 3] = fe, z[V + 4] = ee, z[V + 5] = fe, E.faceidx += 3, E.lineidx += 6) : Math.abs(c[ee - w].y) === u ? (F[H] = he.x, F[te] = Ae.x, F[ce] = Se.x, F[H + 1] = he.y, F[te + 1] = Ae.y, F[ce + 1] = Se.y, F[H + 2] = he.z, F[te + 2] = Ae.z, F[ce + 2] = Se.z, L[W] = G, L[W + 1] = Q, L[W + 2] = ee, z[V] = G, z[V + 1] = Q, z[V + 2] = G, z[V + 3] = ee, z[V + 4] = Q, z[V + 5] = ee, E.faceidx += 3, E.lineidx += 6) : (F[H] = he.x, F[te] = Ae.x, F[oe] = Ie.x, F[H + 1] = he.y, F[te + 1] = Ae.y, F[oe + 1] = Ie.y, F[H + 2] = he.z, F[te + 2] = Ae.z, F[oe + 2] = Ie.z, F[te] = Ae.x, F[ce] = Se.x, F[oe] = Ie.x, F[te + 1] = Ae.y, F[ce + 1] = Se.y, F[oe + 1] = Ie.y, F[te + 2] = Ae.z, F[ce + 2] = Se.z, F[oe + 2] = Ie.z, L[W] = G, L[W + 1] = Q, L[W + 2] = fe, L[W + 3] = Q, L[W + 4] = ee, L[W + 5] = fe, z[V] = G, z[V + 1] = Q, z[V + 2] = G, z[V + 3] = fe, z[V + 4] = Q, z[V + 5] = ee, z[V + 6] = ee, z[V + 7] = fe, E.faceidx += 6, E.lineidx += 8);
+ let P = b.verticesRows, B = P.length - 1;
+ for (let G = 0; G < B; G++) {
+ let U = P[G].length - 1;
+ for (let R = 0; R < U; R++) {
+ let W = E.faceidx, H = E.lineidx, N = P[G][R + 1] + w, V = N * 3, J = P[G][R] + w, re = J * 3, te = P[G + 1][R] + w, ue = te * 3, ie = P[G + 1][R + 1] + w, ae = ie * 3, ce = v[N - w], Me = v[J - w], Ae = v[te - w], Ie = v[ie - w];
+ Math.abs(c[N - w].y) === u ? (F[V] = ce.x, F[ue] = Ae.x, F[ae] = Ie.x, F[V + 1] = ce.y, F[ue + 1] = Ae.y, F[ae + 1] = Ie.y, F[V + 2] = ce.z, F[ue + 2] = Ae.z, F[ae + 2] = Ie.z, L[W] = N, L[W + 1] = te, L[W + 2] = ie, I[H] = N, I[H + 1] = te, I[H + 2] = N, I[H + 3] = ie, I[H + 4] = te, I[H + 5] = ie, E.faceidx += 3, E.lineidx += 6) : Math.abs(c[te - w].y) === u ? (F[V] = ce.x, F[re] = Me.x, F[ue] = Ae.x, F[V + 1] = ce.y, F[re + 1] = Me.y, F[ue + 1] = Ae.y, F[V + 2] = ce.z, F[re + 2] = Me.z, F[ue + 2] = Ae.z, L[W] = N, L[W + 1] = J, L[W + 2] = te, I[H] = N, I[H + 1] = J, I[H + 2] = N, I[H + 3] = te, I[H + 4] = J, I[H + 5] = te, E.faceidx += 3, E.lineidx += 6) : (F[V] = ce.x, F[re] = Me.x, F[ae] = Ie.x, F[V + 1] = ce.y, F[re + 1] = Me.y, F[ae + 1] = Ie.y, F[V + 2] = ce.z, F[re + 2] = Me.z, F[ae + 2] = Ie.z, F[re] = Me.x, F[ue] = Ae.x, F[ae] = Ie.x, F[re + 1] = Me.y, F[ue + 1] = Ae.y, F[ae + 1] = Ie.y, F[re + 2] = Me.z, F[ue + 2] = Ae.z, F[ae + 2] = Ie.z, L[W] = N, L[W + 1] = J, L[W + 2] = ie, L[W + 3] = J, L[W + 4] = te, L[W + 5] = ie, I[H] = N, I[H + 1] = J, I[H + 2] = N, I[H + 3] = ie, I[H + 4] = J, I[H + 5] = te, I[H + 6] = te, I[H + 7] = ie, E.faceidx += 6, E.lineidx += 8);
}
}
}
@@ -20764,7 +20786,7 @@ void main() {
), d = t(
/*! ./glcartoon */
"./src/glcartoon.ts"
- ), v = t(
+ ), _ = t(
/*! ./utilities */
"./src/utilities.ts"
), f = t(
@@ -20821,7 +20843,7 @@ void main() {
if (!p.hidden) {
var g = p.linewidth || M.defaultlineWidth;
u[g] || (u[g] = new r.Geometry());
- var b = u[g].updateGeoGroup(6), c = this.getRadiusFromStyle(l, p), _ = [
+ var b = u[g].updateGeoGroup(6), c = this.getRadiusFromStyle(l, p), v = [
[c, 0, 0],
[-c, 0, 0],
[0, c, 0],
@@ -20830,10 +20852,10 @@ void main() {
[0, 0, -c]
], E = l.clickable || l.hoverable;
E && l.intersectionShape === void 0 && (l.intersectionShape = { sphere: [], cylinder: [], line: [] });
- for (var w = (0, v.getColorFromStyle)(l, p), k = b.vertexArray, $ = b.colorArray, L = 0; L < 6; L++) {
- var z = b.vertices * 3;
- if (b.vertices++, k[z] = l.x + _[L][0], k[z + 1] = l.y + _[L][1], k[z + 2] = l.z + _[L][2], $[z] = w.r, $[z + 1] = w.g, $[z + 2] = w.b, E) {
- var F = new s.Vector3(_[L][0], _[L][1], _[L][2]);
+ for (var w = (0, _.getColorFromStyle)(l, p), k = b.vertexArray, $ = b.colorArray, L = 0; L < 6; L++) {
+ var I = b.vertices * 3;
+ if (b.vertices++, k[I] = l.x + v[L][0], k[I + 1] = l.y + v[L][1], k[I + 2] = l.z + v[L][2], $[I] = w.r, $[I + 1] = w.g, $[I + 2] = w.b, E) {
+ var F = new s.Vector3(v[L][0], v[L][1], v[L][2]);
F.multiplyScalar(0.1), F.set(F.x + l.x, F.y + l.y, F.z + l.z), l.intersectionShape.line.push(F);
}
}
@@ -20841,11 +20863,11 @@ void main() {
}
}
getGoodCross(l, u, p, g) {
- for (var b = null, c = -1, _ = 0, E = l.bonds.length; _ < E; _++)
- if (l.bonds[_] != u.index) {
- let k = l.bonds[_], $ = this.atoms[k], z = new s.Vector3($.x, $.y, $.z).clone();
- z.sub(p);
- let F = z.clone();
+ for (var b = null, c = -1, v = 0, E = l.bonds.length; v < E; v++)
+ if (l.bonds[v] != u.index) {
+ let k = l.bonds[v], $ = this.atoms[k], I = new s.Vector3($.x, $.y, $.z).clone();
+ I.sub(p);
+ let F = I.clone();
F.cross(g);
var w = F.lengthSq();
if (w > c && (c = w, b = F, c > 0.1))
@@ -20856,12 +20878,12 @@ void main() {
//from atom, return a normalized vector v that is orthogonal and along which
//it is appropraite to draw multiple bonds
getSideBondV(l, u, p) {
- var g, b, c, _, E, w = new s.Vector3(l.x, l.y, l.z), k = new s.Vector3(u.x, u.y, u.z), $ = k.clone(), L = null;
+ var g, b, c, v, E, w = new s.Vector3(l.x, l.y, l.z), k = new s.Vector3(u.x, u.y, u.z), $ = k.clone(), L = null;
if ($.sub(w), l.bonds.length === 1)
- u.bonds.length === 1 ? (L = $.clone(), Math.abs(L.x) > 1e-4 ? L.y += 1 : L.x += 1) : (g = (p + 1) % u.bonds.length, b = u.bonds[g], c = this.atoms[b], c.index == l.index && (g = (g + 1) % u.bonds.length, b = u.bonds[g], c = this.atoms[b]), _ = new s.Vector3(c.x, c.y, c.z), E = _.clone(), E.sub(w), L = E.clone(), L.cross($));
+ u.bonds.length === 1 ? (L = $.clone(), Math.abs(L.x) > 1e-4 ? L.y += 1 : L.x += 1) : (g = (p + 1) % u.bonds.length, b = u.bonds[g], c = this.atoms[b], c.index == l.index && (g = (g + 1) % u.bonds.length, b = u.bonds[g], c = this.atoms[b]), v = new s.Vector3(c.x, c.y, c.z), E = v.clone(), E.sub(w), L = E.clone(), L.cross($));
else if (L = this.getGoodCross(l, u, w, $), L.lengthSq() < 0.01) {
- var z = this.getGoodCross(u, l, w, $);
- z != null && (L = z);
+ var I = this.getGoodCross(u, l, w, $);
+ I != null && (L = I);
}
return L.lengthSq() < 0.01 && (L = $.clone(), Math.abs(L.x) > 1e-4 ? L.y += 1 : L.x += 1), L.cross($), L.normalize(), L;
}
@@ -20881,26 +20903,26 @@ void main() {
if (l.style.line) {
var g = l.style.line;
if (!g.hidden) {
- var b, c, _, E, w = g.linewidth || M.defaultlineWidth;
+ var b, c, v, E, w = g.linewidth || M.defaultlineWidth;
p[w] || (p[w] = new r.Geometry());
- for (var k = p[w].updateGeoGroup(6 * l.bonds.length), $ = k.vertexArray, L = k.colorArray, z = 0; z < l.bonds.length; z++) {
- var F = l.bonds[z], R = u[F];
- if (R.style.line && !(l.index >= R.index)) {
- var P = new s.Vector3(l.x, l.y, l.z), U = new s.Vector3(R.x, R.y, R.z), N = P.clone().add(U).multiplyScalar(0.5), B = !1, W = l.clickable || l.hoverable, V = R.clickable || R.hoverable;
- (W || V) && (W && (l.intersectionShape === void 0 && (l.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), l.intersectionShape.line.push(P), l.intersectionShape.line.push(N)), V && (R.intersectionShape === void 0 && (R.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), R.intersectionShape.line.push(N), R.intersectionShape.line.push(U)));
- var G = (0, v.getColorFromStyle)(l, l.style.line), H = (0, v.getColorFromStyle)(R, R.style.line);
- if (l.bondStyles && l.bondStyles[z]) {
- var Q = l.bondStyles[z];
- if (!Q.iswire)
+ for (var k = p[w].updateGeoGroup(6 * l.bonds.length), $ = k.vertexArray, L = k.colorArray, I = 0; I < l.bonds.length; I++) {
+ var F = l.bonds[I], P = u[F];
+ if (P.style.line && !(l.index >= P.index)) {
+ var B = new s.Vector3(l.x, l.y, l.z), G = new s.Vector3(P.x, P.y, P.z), U = B.clone().add(G).multiplyScalar(0.5), R = !1, W = l.clickable || l.hoverable, H = P.clickable || P.hoverable;
+ (W || H) && (W && (l.intersectionShape === void 0 && (l.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), l.intersectionShape.line.push(B), l.intersectionShape.line.push(U)), H && (P.intersectionShape === void 0 && (P.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), P.intersectionShape.line.push(U), P.intersectionShape.line.push(G)));
+ var N = (0, _.getColorFromStyle)(l, l.style.line), V = (0, _.getColorFromStyle)(P, P.style.line);
+ if (l.bondStyles && l.bondStyles[I]) {
+ var J = l.bondStyles[I];
+ if (!J.iswire)
continue;
- Q.singleBond && (B = !0), typeof Q.color1 < "u" && (G = h.CC.color(Q.color1)), typeof Q.color2 < "u" && (H = h.CC.color(Q.color2));
+ J.singleBond && (R = !0), typeof J.color1 < "u" && (N = h.CC.color(J.color1)), typeof J.color2 < "u" && (V = h.CC.color(J.color2));
}
- var te = k.vertices * 3, ee, ce;
- if (l.bondOrder[z] > 1 && l.bondOrder[z] < 4 && !B) {
- var fe = this.getSideBondV(l, R, z), oe = U.clone();
- oe.sub(P), l.bondOrder[z] == 2 ? (fe.multiplyScalar(0.1), b = P.clone(), b.add(fe), c = P.clone(), c.sub(fe), _ = b.clone(), _.add(oe), E = c.clone(), E.add(oe), G == H ? (k.vertices += 4, this.addLine($, L, te, b, _, G), this.addLine($, L, te + 6, c, E, G)) : (k.vertices += 8, oe.multiplyScalar(0.5), ee = b.clone(), ee.add(oe), ce = c.clone(), ce.add(oe), this.addLine($, L, te, b, ee, G), this.addLine($, L, te + 6, ee, _, H), this.addLine($, L, te + 12, c, ce, G), this.addLine($, L, te + 18, ce, E, H))) : l.bondOrder[z] == 3 && (fe.multiplyScalar(0.1), b = P.clone(), b.add(fe), c = P.clone(), c.sub(fe), _ = b.clone(), _.add(oe), E = c.clone(), E.add(oe), G == H ? (k.vertices += 6, this.addLine($, L, te, P, U, G), this.addLine($, L, te + 6, b, _, G), this.addLine($, L, te + 12, c, E, G)) : (k.vertices += 12, oe.multiplyScalar(0.5), ee = b.clone(), ee.add(oe), ce = c.clone(), ce.add(oe), this.addLine($, L, te, P, N, G), this.addLine($, L, te + 6, N, U, H), this.addLine($, L, te + 12, b, ee, G), this.addLine($, L, te + 18, ee, _, H), this.addLine($, L, te + 24, c, ce, G), this.addLine($, L, te + 30, ce, E, H)));
+ var re = k.vertices * 3, te, ue;
+ if (l.bondOrder[I] > 1 && l.bondOrder[I] < 4 && !R) {
+ var ie = this.getSideBondV(l, P, I), ae = G.clone();
+ ae.sub(B), l.bondOrder[I] == 2 ? (ie.multiplyScalar(0.1), b = B.clone(), b.add(ie), c = B.clone(), c.sub(ie), v = b.clone(), v.add(ae), E = c.clone(), E.add(ae), N == V ? (k.vertices += 4, this.addLine($, L, re, b, v, N), this.addLine($, L, re + 6, c, E, N)) : (k.vertices += 8, ae.multiplyScalar(0.5), te = b.clone(), te.add(ae), ue = c.clone(), ue.add(ae), this.addLine($, L, re, b, te, N), this.addLine($, L, re + 6, te, v, V), this.addLine($, L, re + 12, c, ue, N), this.addLine($, L, re + 18, ue, E, V))) : l.bondOrder[I] == 3 && (ie.multiplyScalar(0.1), b = B.clone(), b.add(ie), c = B.clone(), c.sub(ie), v = b.clone(), v.add(ae), E = c.clone(), E.add(ae), N == V ? (k.vertices += 6, this.addLine($, L, re, B, G, N), this.addLine($, L, re + 6, b, v, N), this.addLine($, L, re + 12, c, E, N)) : (k.vertices += 12, ae.multiplyScalar(0.5), te = b.clone(), te.add(ae), ue = c.clone(), ue.add(ae), this.addLine($, L, re, B, U, N), this.addLine($, L, re + 6, U, G, V), this.addLine($, L, re + 12, b, te, N), this.addLine($, L, re + 18, te, v, V), this.addLine($, L, re + 24, c, ue, N), this.addLine($, L, re + 30, ue, E, V)));
} else
- G == H ? (k.vertices += 2, this.addLine($, L, te, P, U, G)) : (k.vertices += 4, this.addLine($, L, te, P, N, G), this.addLine($, L, te + 6, N, U, H));
+ N == V ? (k.vertices += 2, this.addLine($, L, re, B, G, N)) : (k.vertices += 4, this.addLine($, L, re, B, U, N), this.addLine($, L, re + 6, U, G, V));
}
}
}
@@ -20917,7 +20939,7 @@ void main() {
if (l.style.sphere) {
var p = l.style.sphere;
if (!p.hidden) {
- var g = (0, v.getColorFromStyle)(l, p), b = this.getRadiusFromStyle(l, p);
+ var g = (0, _.getColorFromStyle)(l, p), b = this.getRadiusFromStyle(l, p);
if ((l.clickable === !0 || l.hoverable) && l.intersectionShape !== void 0) {
var c = new s.Vector3(l.x, l.y, l.z);
l.intersectionShape.sphere.push(new a.Sphere(c, b));
@@ -20943,8 +20965,8 @@ void main() {
if (l.style.sphere) {
var p = l.style.sphere;
if (!p.hidden) {
- var g = this.getRadiusFromStyle(l, p), b = (0, v.getColorFromStyle)(l, p), c = u.updateGeoGroup(1), _ = c.vertices, E = _ * 3, w = c.vertexArray, k = c.colorArray, $ = c.radiusArray;
- if (w[E] = l.x, w[E + 1] = l.y, w[E + 2] = l.z, k[E] = b.r, k[E + 1] = b.g, k[E + 2] = b.b, $[_] = g, (l.clickable === !0 || l.hoverable) && l.intersectionShape !== void 0) {
+ var g = this.getRadiusFromStyle(l, p), b = (0, _.getColorFromStyle)(l, p), c = u.updateGeoGroup(1), v = c.vertices, E = v * 3, w = c.vertexArray, k = c.colorArray, $ = c.radiusArray;
+ if (w[E] = l.x, w[E + 1] = l.y, w[E + 2] = l.z, k[E] = b.r, k[E + 1] = b.g, k[E + 2] = b.b, $[v] = g, (l.clickable === !0 || l.hoverable) && l.intersectionShape !== void 0) {
var L = new s.Vector3(l.x, l.y, l.z);
l.intersectionShape.sphere.push(new a.Sphere(L, g));
}
@@ -20953,22 +20975,22 @@ void main() {
}
}
drawSphereImposter(l, u, p, g) {
- var b = l.updateGeoGroup(4), c, _ = b.vertices, E = _ * 3, w = b.vertexArray, k = b.colorArray;
+ var b = l.updateGeoGroup(4), c, v = b.vertices, E = v * 3, w = b.vertexArray, k = b.colorArray;
for (c = 0; c < 4; c++)
w[E + 3 * c] = u.x, w[E + 3 * c + 1] = u.y, w[E + 3 * c + 2] = u.z;
var $ = b.normalArray;
for (c = 0; c < 4; c++)
k[E + 3 * c] = g.r, k[E + 3 * c + 1] = g.g, k[E + 3 * c + 2] = g.b;
$[E + 0] = -p, $[E + 1] = p, $[E + 2] = 0, $[E + 3] = -p, $[E + 4] = -p, $[E + 5] = 0, $[E + 6] = p, $[E + 7] = -p, $[E + 8] = 0, $[E + 9] = p, $[E + 10] = p, $[E + 11] = 0, b.vertices += 4;
- var L = b.faceArray, z = b.faceidx;
- L[z + 0] = _, L[z + 1] = _ + 1, L[z + 2] = _ + 2, L[z + 3] = _ + 2, L[z + 4] = _ + 3, L[z + 5] = _, b.faceidx += 6;
+ var L = b.faceArray, I = b.faceidx;
+ L[I + 0] = v, L[I + 1] = v + 1, L[I + 2] = v + 2, L[I + 3] = v + 2, L[I + 4] = v + 3, L[I + 5] = v, b.faceidx += 6;
}
//dkoes - code for sphere imposters
drawAtomImposter(l, u) {
if (l.style.sphere) {
var p = l.style.sphere;
if (!p.hidden) {
- var g = this.getRadiusFromStyle(l, p), b = (0, v.getColorFromStyle)(l, p);
+ var g = this.getRadiusFromStyle(l, p), b = (0, _.getColorFromStyle)(l, p);
if ((l.clickable === !0 || l.hoverable) && l.intersectionShape !== void 0) {
var c = new s.Vector3(l.x, l.y, l.z);
l.intersectionShape.sphere.push(new a.Sphere(c, g));
@@ -20980,21 +21002,21 @@ void main() {
calculateDashes(l, u, p, g, b) {
var c = Math.sqrt(Math.pow(l.x - u.x, 2) + Math.pow(l.y - u.y, 2) + Math.pow(l.z - u.z, 2));
p = Math.max(p, 0), b = Math.max(b, 0) + 2 * p, g = Math.max(g, 1e-3), g + b > c && (g = c, b = 0);
- var _ = Math.floor((c - g) / (g + b)) + 1, E = _ * g;
- b = (c - E) / _;
- for (var w, k = new s.Vector3(l.x, l.y, l.z), $ = new s.Vector3((u.x - l.x) / (c / b), (u.y - l.y) / (c / b), (u.z - l.z) / (c / b)), L = new s.Vector3((u.x - l.x) / (c / g), (u.y - l.y) / (c / g), (u.z - l.z) / (c / g)), z = [], F = 0; F < _; F++)
- w = new s.Vector3(k.x + L.x, k.y + L.y, k.z + L.z), z.push({ from: k, to: w }), k = new s.Vector3(w.x + $.x, w.y + $.y, w.z + $.z);
- return z;
- }
- static drawStickImposter(l, u, p, g, b, c = 0, _ = 0) {
- for (var E = l.updateGeoGroup(4), w = E.vertices, k = w * 3, $ = E.vertexArray, L = E.colorArray, z = E.radiusArray, F = E.normalArray, R = b.r, P = b.g, U = b.b, N = function(H) {
- var Q = -H;
- return Q == 0 && (Q = -1e-4), Q;
- }, B = k, W = 0; W < 4; W++)
- $[B] = u.x, F[B] = p.x, L[B] = R, B++, $[B] = u.y, F[B] = p.y, L[B] = P, B++, $[B] = u.z, F[B] = p.z, W < 2 ? L[B] = U : L[B] = N(U), B++;
- E.vertices += 4, z[w] = -g, z[w + 1] = g, z[w + 2] = -g, z[w + 3] = g;
- var V = E.faceArray, G = E.faceidx;
- V[G + 0] = w, V[G + 1] = w + 1, V[G + 2] = w + 2, V[G + 3] = w + 2, V[G + 4] = w + 3, V[G + 5] = w, E.faceidx += 6;
+ var v = Math.floor((c - g) / (g + b)) + 1, E = v * g;
+ b = (c - E) / v;
+ for (var w, k = new s.Vector3(l.x, l.y, l.z), $ = new s.Vector3((u.x - l.x) / (c / b), (u.y - l.y) / (c / b), (u.z - l.z) / (c / b)), L = new s.Vector3((u.x - l.x) / (c / g), (u.y - l.y) / (c / g), (u.z - l.z) / (c / g)), I = [], F = 0; F < v; F++)
+ w = new s.Vector3(k.x + L.x, k.y + L.y, k.z + L.z), I.push({ from: k, to: w }), k = new s.Vector3(w.x + $.x, w.y + $.y, w.z + $.z);
+ return I;
+ }
+ static drawStickImposter(l, u, p, g, b, c = 0, v = 0) {
+ for (var E = l.updateGeoGroup(4), w = E.vertices, k = w * 3, $ = E.vertexArray, L = E.colorArray, I = E.radiusArray, F = E.normalArray, P = b.r, B = b.g, G = b.b, U = function(V) {
+ var J = -V;
+ return J == 0 && (J = -1e-4), J;
+ }, R = k, W = 0; W < 4; W++)
+ $[R] = u.x, F[R] = p.x, L[R] = P, R++, $[R] = u.y, F[R] = p.y, L[R] = B, R++, $[R] = u.z, F[R] = p.z, W < 2 ? L[R] = G : L[R] = U(G), R++;
+ E.vertices += 4, I[w] = -g, I[w + 1] = g, I[w + 2] = -g, I[w + 3] = g;
+ var H = E.faceArray, N = E.faceidx;
+ H[N + 0] = w, H[N + 1] = w + 1, H[N + 2] = w + 2, H[N + 3] = w + 2, H[N + 4] = w + 3, H[N + 5] = w, E.faceidx += 6;
}
// draws cylinders and small spheres (at bond radius)
drawBondSticks(l, u, p) {
@@ -21002,55 +21024,55 @@ void main() {
if (l.style.stick) {
var c = l.style.stick;
if (!c.hidden) {
- var _ = c.radius || this.defaultStickRadius, E = c.doubleBondScaling || 0.4, w = c.tripleBondScaling || 0.25, k = ((g = c.dashedBondConfig) === null || g === void 0 ? void 0 : g.dashLength) || 0.1, $ = ((b = c.dashedBondConfig) === null || b === void 0 ? void 0 : b.gapLength) || 0.25, L = _, z = c.singleBonds || !1, F = c.dashedBonds || !1, R = 0, P = 0, U, N, B, W, V, G, H, Q, te, ee, ce, fe = (0, v.getColorFromStyle)(l, c), oe, he, Ae;
- !l.capDrawn && l.bonds.length < 4 && (R = 2);
- var Se = (ae) => {
+ var v = c.radius || this.defaultStickRadius, E = c.doubleBondScaling || 0.4, w = c.tripleBondScaling || 0.25, k = ((g = c.dashedBondConfig) === null || g === void 0 ? void 0 : g.dashLength) || 0.1, $ = ((b = c.dashedBondConfig) === null || b === void 0 ? void 0 : b.gapLength) || 0.25, L = v, I = c.singleBonds || !1, F = c.dashedBonds || !1, P = 0, B = 0, G, U, R, W, H, N, V, J, re, te, ue, ie = (0, _.getColorFromStyle)(l, c), ae, ce, Me;
+ !l.capDrawn && l.bonds.length < 4 && (P = 2);
+ var Ae = (oe) => {
var ge = p.imposter ? M.drawStickImposter : o.GLDraw.drawCylinder;
- return !F && ae >= 1 ? ge : (xe, ue, Ce, Z, Fe, We = 0, I = 0, we = 0.1, ve = 0.25) => {
- var Y = this.calculateDashes(ue, Ce, Z, we, ve);
- Y.forEach((de) => {
- ge(xe, de.from, de.to, Z, Fe, We, I);
+ return !F && oe >= 1 ? ge : (we, de, Te, Z, Fe, We = 0, z = 0, Ee = 0.1, ve = 0.25) => {
+ var Y = this.calculateDashes(de, Te, Z, Ee, ve);
+ Y.forEach((fe) => {
+ ge(we, fe.from, fe.to, Z, Fe, We, z);
});
};
};
- for (B = 0; B < l.bonds.length; B++) {
- var Ie = Se(l.bondOrder[B]), pe = l.bonds[B], le = u[pe];
- if (oe = he = Ae = null, l.index < le.index) {
- var ne = le.style;
- if (!ne.stick || ne.stick.hidden)
+ for (R = 0; R < l.bonds.length; R++) {
+ var Ie = Ae(l.bondOrder[R]), pe = l.bonds[R], se = u[pe];
+ if (ae = ce = Me = null, l.index < se.index) {
+ var Q = se.style;
+ if (!Q.stick || Q.stick.hidden)
continue;
- var Te = (0, v.getColorFromStyle)(le, ne.stick);
- if (L = _, W = z, l.bondStyles && l.bondStyles[B]) {
- if (V = l.bondStyles[B], V.iswire)
+ var ye = (0, _.getColorFromStyle)(se, Q.stick);
+ if (L = v, W = I, l.bondStyles && l.bondStyles[R]) {
+ if (H = l.bondStyles[R], H.iswire)
continue;
- V.radius && (L = V.radius), V.singleBond && (W = !0), typeof V.color1 < "u" && (fe = h.CC.color(V.color1)), typeof V.color2 < "u" && (Te = h.CC.color(V.color2));
+ H.radius && (L = H.radius), H.singleBond && (W = !0), typeof H.color1 < "u" && (ie = h.CC.color(H.color1)), typeof H.color2 < "u" && (ye = h.CC.color(H.color2));
}
- var Oe = new s.Vector3(l.x, l.y, l.z), Be = new s.Vector3(le.x, le.y, le.z);
- if (l.bondOrder[B] <= 1 || W || l.bondOrder[B] > 3) {
- if (l.bondOrder[B] < 1 && (L *= l.bondOrder[B]), !le.capDrawn && le.bonds.length < 4 && (P = 2), fe != Te ? (oe = new s.Vector3().addVectors(Oe, Be).multiplyScalar(0.5), Ie(p, Oe, oe, L, fe, R, 0, k, $), Ie(p, oe, Be, L, Te, 0, P, k, $)) : Ie(p, Oe, Be, L, fe, R, P, k, $), U = l.clickable || l.hoverable, N = le.clickable || le.hoverable, U || N) {
- if (oe || (oe = new s.Vector3().addVectors(Oe, Be).multiplyScalar(0.5)), U) {
- var Ue = new a.Cylinder(Oe, oe, L), Pe = new a.Sphere(Oe, L);
- l.intersectionShape.cylinder.push(Ue), l.intersectionShape.sphere.push(Pe);
+ var ke = new s.Vector3(l.x, l.y, l.z), Pe = new s.Vector3(se.x, se.y, se.z);
+ if (l.bondOrder[R] <= 1 || W || l.bondOrder[R] > 3) {
+ if (l.bondOrder[R] < 1 && (L *= l.bondOrder[R]), !se.capDrawn && se.bonds.length < 4 && (B = 2), ie != ye ? (ae = new s.Vector3().addVectors(ke, Pe).multiplyScalar(0.5), Ie(p, ke, ae, L, ie, P, 0, k, $), Ie(p, ae, Pe, L, ye, 0, B, k, $)) : Ie(p, ke, Pe, L, ie, P, B, k, $), G = l.clickable || l.hoverable, U = se.clickable || se.hoverable, G || U) {
+ if (ae || (ae = new s.Vector3().addVectors(ke, Pe).multiplyScalar(0.5)), G) {
+ var Ne = new a.Cylinder(ke, ae, L), Be = new a.Sphere(ke, L);
+ l.intersectionShape.cylinder.push(Ne), l.intersectionShape.sphere.push(Be);
}
- if (N) {
- var Ge = new a.Cylinder(Be, oe, L), Ne = new a.Sphere(Be, L);
- le.intersectionShape.cylinder.push(Ge), le.intersectionShape.sphere.push(Ne);
+ if (U) {
+ var Ge = new a.Cylinder(Pe, ae, L), Ue = new a.Sphere(Pe, L);
+ se.intersectionShape.cylinder.push(Ge), se.intersectionShape.sphere.push(Ue);
}
}
- } else if (l.bondOrder[B] > 1) {
- var Re = 0, De = 0;
- L != _ && (Re = 2, De = 2);
- var je = Be.clone(), Xe = null;
- je.sub(Oe);
- var X, q, re, ye, me;
- Xe = this.getSideBondV(l, le, B), l.bondOrder[B] == 2 ? (X = L * E, Xe.multiplyScalar(X * 1.5), q = Oe.clone(), q.add(Xe), re = Oe.clone(), re.sub(Xe), ye = q.clone(), ye.add(je), me = re.clone(), me.add(je), fe != Te ? (oe = new s.Vector3().addVectors(q, ye).multiplyScalar(0.5), he = new s.Vector3().addVectors(re, me).multiplyScalar(0.5), Ie(p, q, oe, X, fe, Re, 0), Ie(p, oe, ye, X, Te, 0, De), Ie(p, re, he, X, fe, Re, 0), Ie(p, he, me, X, Te, 0, De)) : (Ie(p, q, ye, X, fe, Re, De), Ie(p, re, me, X, fe, Re, De)), U = l.clickable || l.hoverable, N = le.clickable || le.hoverable, (U || N) && (oe || (oe = new s.Vector3().addVectors(q, ye).multiplyScalar(0.5)), he || (he = new s.Vector3().addVectors(re, me).multiplyScalar(0.5)), U && (G = new a.Cylinder(q, oe, X), H = new a.Cylinder(re, he, X), l.intersectionShape.cylinder.push(G), l.intersectionShape.cylinder.push(H)), N && (te = new a.Cylinder(ye, oe, X), ee = new a.Cylinder(me, he, X), le.intersectionShape.cylinder.push(te), le.intersectionShape.cylinder.push(ee)))) : l.bondOrder[B] == 3 && (X = L * w, Xe.cross(je), Xe.normalize(), Xe.multiplyScalar(X * 3), q = Oe.clone(), q.add(Xe), re = Oe.clone(), re.sub(Xe), ye = q.clone(), ye.add(je), me = re.clone(), me.add(je), fe != Te ? (oe = new s.Vector3().addVectors(q, ye).multiplyScalar(0.5), he = new s.Vector3().addVectors(re, me).multiplyScalar(0.5), Ae = new s.Vector3().addVectors(Oe, Be).multiplyScalar(0.5), Ie(p, q, oe, X, fe, Re, 0), Ie(p, oe, ye, X, Te, 0, De), Ie(p, Oe, Ae, X, fe, R, 0), Ie(p, Ae, Be, X, Te, 0, P), Ie(p, re, he, X, fe, Re, 0), Ie(p, he, me, X, Te, 0, De)) : (Ie(p, q, ye, X, fe, Re, De), Ie(p, Oe, Be, X, fe, R, P), Ie(p, re, me, X, fe, Re, De)), U = l.clickable || l.hoverable, N = le.clickable || le.hoverable, (U || N) && (oe || (oe = new s.Vector3().addVectors(q, ye).multiplyScalar(0.5)), he || (he = new s.Vector3().addVectors(re, me).multiplyScalar(0.5)), Ae || (Ae = new s.Vector3().addVectors(Oe, Be).multiplyScalar(0.5)), U && (G = new a.Cylinder(q.clone(), oe.clone(), X), H = new a.Cylinder(re.clone(), he.clone(), X), Q = new a.Cylinder(Oe.clone(), Ae.clone(), X), l.intersectionShape.cylinder.push(G), l.intersectionShape.cylinder.push(H), l.intersectionShape.cylinder.push(Q)), N && (te = new a.Cylinder(ye.clone(), oe.clone(), X), ee = new a.Cylinder(me.clone(), he.clone(), X), ce = new a.Cylinder(Be.clone(), Ae.clone(), X), le.intersectionShape.cylinder.push(te), le.intersectionShape.cylinder.push(ee), le.intersectionShape.cylinder.push(ce))));
+ } else if (l.bondOrder[R] > 1) {
+ var Re = 0, Ce = 0;
+ L != v && (Re = 2, Ce = 2);
+ var je = Pe.clone(), Xe = null;
+ je.sub(ke);
+ var X, q, ne, xe, me;
+ Xe = this.getSideBondV(l, se, R), l.bondOrder[R] == 2 ? (X = L * E, Xe.multiplyScalar(X * 1.5), q = ke.clone(), q.add(Xe), ne = ke.clone(), ne.sub(Xe), xe = q.clone(), xe.add(je), me = ne.clone(), me.add(je), ie != ye ? (ae = new s.Vector3().addVectors(q, xe).multiplyScalar(0.5), ce = new s.Vector3().addVectors(ne, me).multiplyScalar(0.5), Ie(p, q, ae, X, ie, Re, 0), Ie(p, ae, xe, X, ye, 0, Ce), Ie(p, ne, ce, X, ie, Re, 0), Ie(p, ce, me, X, ye, 0, Ce)) : (Ie(p, q, xe, X, ie, Re, Ce), Ie(p, ne, me, X, ie, Re, Ce)), G = l.clickable || l.hoverable, U = se.clickable || se.hoverable, (G || U) && (ae || (ae = new s.Vector3().addVectors(q, xe).multiplyScalar(0.5)), ce || (ce = new s.Vector3().addVectors(ne, me).multiplyScalar(0.5)), G && (N = new a.Cylinder(q, ae, X), V = new a.Cylinder(ne, ce, X), l.intersectionShape.cylinder.push(N), l.intersectionShape.cylinder.push(V)), U && (re = new a.Cylinder(xe, ae, X), te = new a.Cylinder(me, ce, X), se.intersectionShape.cylinder.push(re), se.intersectionShape.cylinder.push(te)))) : l.bondOrder[R] == 3 && (X = L * w, Xe.cross(je), Xe.normalize(), Xe.multiplyScalar(X * 3), q = ke.clone(), q.add(Xe), ne = ke.clone(), ne.sub(Xe), xe = q.clone(), xe.add(je), me = ne.clone(), me.add(je), ie != ye ? (ae = new s.Vector3().addVectors(q, xe).multiplyScalar(0.5), ce = new s.Vector3().addVectors(ne, me).multiplyScalar(0.5), Me = new s.Vector3().addVectors(ke, Pe).multiplyScalar(0.5), Ie(p, q, ae, X, ie, Re, 0), Ie(p, ae, xe, X, ye, 0, Ce), Ie(p, ke, Me, X, ie, P, 0), Ie(p, Me, Pe, X, ye, 0, B), Ie(p, ne, ce, X, ie, Re, 0), Ie(p, ce, me, X, ye, 0, Ce)) : (Ie(p, q, xe, X, ie, Re, Ce), Ie(p, ke, Pe, X, ie, P, B), Ie(p, ne, me, X, ie, Re, Ce)), G = l.clickable || l.hoverable, U = se.clickable || se.hoverable, (G || U) && (ae || (ae = new s.Vector3().addVectors(q, xe).multiplyScalar(0.5)), ce || (ce = new s.Vector3().addVectors(ne, me).multiplyScalar(0.5)), Me || (Me = new s.Vector3().addVectors(ke, Pe).multiplyScalar(0.5)), G && (N = new a.Cylinder(q.clone(), ae.clone(), X), V = new a.Cylinder(ne.clone(), ce.clone(), X), J = new a.Cylinder(ke.clone(), Me.clone(), X), l.intersectionShape.cylinder.push(N), l.intersectionShape.cylinder.push(V), l.intersectionShape.cylinder.push(J)), U && (re = new a.Cylinder(xe.clone(), ae.clone(), X), te = new a.Cylinder(me.clone(), ce.clone(), X), ue = new a.Cylinder(Pe.clone(), Me.clone(), X), se.intersectionShape.cylinder.push(re), se.intersectionShape.cylinder.push(te), se.intersectionShape.cylinder.push(ue))));
}
}
}
- var ze = !1, ke = 0, K = !1;
- for (B = 0; B < l.bonds.length; B++)
- W = z, l.bondStyles && l.bondStyles[B] && (V = l.bondStyles[B], V.singleBond && (W = !0), V.radius && V.radius != _ && (K = !0)), (W || l.bondOrder[B] == 1) && ke++;
- K ? ke > 0 && (ze = !0) : ke == 0 && (l.bonds.length > 0 || c.showNonBonded) && (ze = !0), ze && (L = _, p.imposter ? this.drawSphereImposter(p.sphereGeometry, l, L, fe) : o.GLDraw.drawSphere(p, l, L, fe));
+ var ze = !1, $e = 0, K = !1;
+ for (R = 0; R < l.bonds.length; R++)
+ W = I, l.bondStyles && l.bondStyles[R] && (H = l.bondStyles[R], H.singleBond && (W = !0), H.radius && H.radius != v && (K = !0)), (W || l.bondOrder[R] == 1) && $e++;
+ K ? $e > 0 && (ze = !0) : $e == 0 && (l.bonds.length > 0 || c.showNonBonded) && (ze = !0), ze && (L = v, p.imposter ? this.drawSphereImposter(p.sphereGeometry, l, L, ie) : o.GLDraw.drawSphere(p, l, L, ie));
}
}
}
@@ -21062,79 +21084,79 @@ void main() {
/** param {AtomSpec[]} atoms */
createMolObj(l, u) {
u = u || {};
- var p = new r.Object3D(), g = [], b = {}, c = {}, _ = this.drawAtomSphere, E = null, w = null;
- u.supportsImposters ? (_ = this.drawAtomImposter, E = new r.Geometry(!0), E.imposter = !0, w = new r.Geometry(!0, !0), w.imposter = !0, w.sphereGeometry = new r.Geometry(!0), w.sphereGeometry.imposter = !0, w.drawnCaps = {}) : u.supportsAIA ? (_ = this.drawAtomInstanced, E = new r.Geometry(!1, !0, !0), E.instanced = !0, w = new r.Geometry(!0)) : (E = new r.Geometry(!0), w = new r.Geometry(!0));
- var k, $, L, z, F = {}, R = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY];
+ var p = new r.Object3D(), g = [], b = {}, c = {}, v = this.drawAtomSphere, E = null, w = null;
+ u.supportsImposters ? (v = this.drawAtomImposter, E = new r.Geometry(!0), E.imposter = !0, w = new r.Geometry(!0, !0), w.imposter = !0, w.sphereGeometry = new r.Geometry(!0), w.sphereGeometry.imposter = !0, w.drawnCaps = {}) : u.supportsAIA ? (v = this.drawAtomInstanced, E = new r.Geometry(!1, !0, !0), E.instanced = !0, w = new r.Geometry(!0)) : (E = new r.Geometry(!0), w = new r.Geometry(!0));
+ var k, $, L, I, F = {}, P = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY];
for (k = 0, L = l.length; k < L; k++) {
- var P = l[k];
- if (P && P.style) {
- (P.clickable || P.hoverable) && P.intersectionShape === void 0 && (P.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), z = { line: void 0, cross: void 0, stick: void 0, sphere: void 0 };
- for ($ in z)
- P.style[$] ? P.style[$].opacity ? z[$] = parseFloat(P.style[$].opacity) : z[$] = 1 : z[$] = void 0, F[$] ? z[$] != null && F[$] != z[$] && (console.log("Warning: " + $ + " opacity is ambiguous"), F[$] = 1) : F[$] = z[$];
- _.call(this, P, E), this.drawAtomClickSphere(P), this.drawAtomCross(P, c), this.drawBondLines(P, l, b), this.drawBondSticks(P, l, w), typeof P.style.cartoon < "u" && !P.style.cartoon.hidden && (P.style.cartoon.color === "spectrum" && typeof P.resi == "number" && !P.hetflag && (P.resi < R[0] && (R[0] = P.resi), P.resi > R[1] && (R[1] = P.resi)), g.push(P));
+ var B = l[k];
+ if (B && B.style) {
+ (B.clickable || B.hoverable) && B.intersectionShape === void 0 && (B.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), I = { line: void 0, cross: void 0, stick: void 0, sphere: void 0 };
+ for ($ in I)
+ B.style[$] ? B.style[$].opacity ? I[$] = parseFloat(B.style[$].opacity) : I[$] = 1 : I[$] = void 0, F[$] ? I[$] != null && F[$] != I[$] && (console.log("Warning: " + $ + " opacity is ambiguous"), F[$] = 1) : F[$] = I[$];
+ v.call(this, B, E), this.drawAtomClickSphere(B), this.drawAtomCross(B, c), this.drawBondLines(B, l, b), this.drawBondSticks(B, l, w), typeof B.style.cartoon < "u" && !B.style.cartoon.hidden && (B.style.cartoon.color === "spectrum" && typeof B.resi == "number" && !B.hetflag && (B.resi < P[0] && (P[0] = B.resi), B.resi > P[1] && (P[1] = B.resi)), g.push(B));
}
}
- if (g.length > 0 && (0, d.drawCartoon)(p, g, R, this.defaultCartoonQuality), E && E.vertices > 0) {
+ if (g.length > 0 && (0, d.drawCartoon)(p, g, P, this.defaultCartoonQuality), E && E.vertices > 0) {
E.initTypedArrays();
- var U = null, N = null;
- E.imposter ? U = new r.SphereImposterMaterial({
+ var G = null, U = null;
+ E.imposter ? G = new r.SphereImposterMaterial({
ambient: 0,
vertexColors: !0,
reflectivity: 0
- }) : E.instanced ? (N = new r.Geometry(!0), o.GLDraw.drawSphere(N, { x: 0, y: 0, z: 0 }, 1, new h.Color(0.5, 0.5, 0.5)), N.initTypedArrays(), U = new r.InstancedMaterial({
+ }) : E.instanced ? (U = new r.Geometry(!0), o.GLDraw.drawSphere(U, { x: 0, y: 0, z: 0 }, 1, new h.Color(0.5, 0.5, 0.5)), U.initTypedArrays(), G = new r.InstancedMaterial({
sphereMaterial: new r.MeshLambertMaterial({
ambient: 0,
vertexColors: !0,
reflectivity: 0
}),
- sphere: N
- })) : U = new r.MeshLambertMaterial({
+ sphere: U
+ })) : G = new r.MeshLambertMaterial({
ambient: 0,
vertexColors: !0,
reflectivity: 0
- }), F.sphere < 1 && F.sphere >= 0 && (U.transparent = !0, U.opacity = F.sphere), N = new r.Mesh(E, U), p.add(N);
+ }), F.sphere < 1 && F.sphere >= 0 && (G.transparent = !0, G.opacity = F.sphere), U = new r.Mesh(E, G), p.add(U);
}
if (w.vertices > 0) {
- var B = null, W = null, V = w.sphereGeometry;
- (!V || typeof V.vertices > "u" || V.vertices == 0) && (V = null), w.initTypedArrays(), V && V.initTypedArrays();
- var G = { ambient: 0, vertexColors: !0, reflectivity: 0 };
- w.imposter ? (B = new r.StickImposterMaterial(G), W = new r.SphereImposterMaterial(G)) : (B = new r.MeshLambertMaterial(G), W = new r.MeshLambertMaterial(G), B.wireframe && (w.setUpWireframe(), V && V.setUpWireframe())), F.stick < 1 && F.stick >= 0 && (B.transparent = !0, B.opacity = F.stick, W.transparent = !0, W.opacity = F.stick);
- var H = new r.Mesh(w, B);
- if (p.add(H), V) {
- var Q = new r.Mesh(V, W);
- p.add(Q);
+ var R = null, W = null, H = w.sphereGeometry;
+ (!H || typeof H.vertices > "u" || H.vertices == 0) && (H = null), w.initTypedArrays(), H && H.initTypedArrays();
+ var N = { ambient: 0, vertexColors: !0, reflectivity: 0 };
+ w.imposter ? (R = new r.StickImposterMaterial(N), W = new r.SphereImposterMaterial(N)) : (R = new r.MeshLambertMaterial(N), W = new r.MeshLambertMaterial(N), R.wireframe && (w.setUpWireframe(), H && H.setUpWireframe())), F.stick < 1 && F.stick >= 0 && (R.transparent = !0, R.opacity = F.stick, W.transparent = !0, W.opacity = F.stick);
+ var V = new r.Mesh(w, R);
+ if (p.add(V), H) {
+ var J = new r.Mesh(H, W);
+ p.add(J);
}
}
- var te;
+ var re;
for (k in b)
if (b.hasOwnProperty(k)) {
- te = k;
- var ee = new r.LineBasicMaterial({
- linewidth: te,
+ re = k;
+ var te = new r.LineBasicMaterial({
+ linewidth: re,
vertexColors: !0
});
- F.line < 1 && F.line >= 0 && (ee.transparent = !0, ee.opacity = F.line), b[k].initTypedArrays();
- var ce = new r.Line(b[k], ee, r.LineStyle.LinePieces);
- p.add(ce);
+ F.line < 1 && F.line >= 0 && (te.transparent = !0, te.opacity = F.line), b[k].initTypedArrays();
+ var ue = new r.Line(b[k], te, r.LineStyle.LinePieces);
+ p.add(ue);
}
for (k in c)
if (c.hasOwnProperty(k)) {
- te = k;
- var fe = new r.LineBasicMaterial({
- linewidth: te,
+ re = k;
+ var ie = new r.LineBasicMaterial({
+ linewidth: re,
vertexColors: !0
});
- F.cross < 1 && F.cross >= 0 && (fe.transparent = !0, fe.opacity = F.cross), c[k].initTypedArrays();
- var oe = new r.Line(c[k], fe, r.LineStyle.LinePieces);
- p.add(oe);
+ F.cross < 1 && F.cross >= 0 && (ie.transparent = !0, ie.opacity = F.cross), c[k].initTypedArrays();
+ var ae = new r.Line(c[k], ie, r.LineStyle.LinePieces);
+ p.add(ae);
}
if (this.dontDuplicateAtoms && this.modelData.symmetries && this.modelData.symmetries.length > 0) {
- var he = new r.Object3D(), Ae;
- for (Ae = 0; Ae < this.modelData.symmetries.length; Ae++) {
- var Se = new r.Object3D();
- Se = p.clone(), Se.matrix.copy(this.modelData.symmetries[Ae]), Se.matrixAutoUpdate = !1, he.add(Se);
+ var ce = new r.Object3D(), Me;
+ for (Me = 0; Me < this.modelData.symmetries.length; Me++) {
+ var Ae = new r.Object3D();
+ Ae = p.clone(), Ae.matrix.copy(this.modelData.symmetries[Me]), Ae.matrixAutoUpdate = !1, ce.add(Ae);
}
- return he;
+ return ce;
}
return p;
}
@@ -21184,7 +21206,7 @@ void main() {
*/
setCrystData(l, u, p, g, b, c) {
l = l || 1, u = u || 1, p = p || 1, g = g || 90, b = b || 90, c = c || 90;
- const _ = (0, s.conversionMatrix3)(l, u, p, g, b, c);
+ const v = (0, s.conversionMatrix3)(l, u, p, g, b, c);
this.modelData.cryst = {
a: l,
b: u,
@@ -21192,7 +21214,7 @@ void main() {
alpha: g,
beta: b,
gamma: c,
- matrix: _
+ matrix: v
};
}
/**
@@ -21251,8 +21273,8 @@ void main() {
//attoms aren't split across the box
adjustCoordinatesToBox() {
if (this.box && this.atomdfs)
- for (var l = this.box[0], u = this.box[1], p = this.box[2], g = l * 0.9, b = u * 0.9, c = p * 0.9, _ = 0; _ < this.atomdfs.length; _++)
- for (var E = this.atomdfs[_], w = 1; w < E.length; w++) {
+ for (var l = this.box[0], u = this.box[1], p = this.box[2], g = l * 0.9, b = u * 0.9, c = p * 0.9, v = 0; v < this.atomdfs.length; v++)
+ for (var E = this.atomdfs[v], w = 1; w < E.length; w++) {
var k = this.atoms[E[w][0]], $ = this.atoms[E[w][1]];
k.x = this.adjustCoord($.x, k.x, g, l), k.y = this.adjustCoord($.y, k.y, b, u), k.z = this.adjustCoord($.z, k.z, c, p);
}
@@ -21269,8 +21291,8 @@ void main() {
let g = this;
return new Promise(function(b, c) {
if (p == 0 && b(), (l < 0 || l >= p) && (l = p - 1), g.frames.url != null) {
- var _ = g.frames.url;
- (0, v.getbin)(_ + "/traj/frame/" + l + "/" + g.frames.path, void 0, "POST", void 0).then(function(E) {
+ var v = g.frames.url;
+ (0, _.getbin)(v + "/traj/frame/" + l + "/" + g.frames.path, void 0, "POST", void 0).then(function(E) {
for (var w = new Float32Array(E, 44), k = 0, $ = 0; $ < g.atoms.length; $++)
g.atoms[$].x = w[k++], g.atoms[$].y = w[k++], g.atoms[$].z = w[k++];
g.box && g.atomdfs && g.adjustCoordinatesToBox(), b();
@@ -21309,25 +21331,25 @@ void main() {
});
*/
vibrate(l = 10, u = 1, p = !1, g, b) {
- var c = 0, _ = l;
- p && (c = -l, _ = l), this.frames !== void 0 && this.frames.origIndex !== void 0 ? this.setFrame(this.frames.origIndex) : this.setFrame(0), c < _ && (this.frames = []), p && (this.frames.origIndex = l);
- for (var E = c; E < _; E++) {
+ var c = 0, v = l;
+ p && (c = -l, v = l), this.frames !== void 0 && this.frames.origIndex !== void 0 ? this.setFrame(this.frames.origIndex) : this.setFrame(0), c < v && (this.frames = []), p && (this.frames.origIndex = l);
+ for (var E = c; E < v; E++) {
var w = [], k = this.frames.length;
if (E == 0 && !b) {
this.frames.push(this.atoms);
continue;
}
for (var $ = 0; $ < this.atoms.length; $++) {
- var L = (0, v.getAtomProperty)(this.atoms[$], "dx"), z = (0, v.getAtomProperty)(this.atoms[$], "dy"), F = (0, v.getAtomProperty)(this.atoms[$], "dz"), R = new s.Vector3(L, z, F), P = new s.Vector3(this.atoms[$].x, this.atoms[$].y, this.atoms[$].z), U = E * u / l;
- R.multiplyScalar(U), P.add(R);
- var N = {};
- for (var B in this.atoms[$])
- N[B] = this.atoms[$][B];
- if (N.x = P.x, N.y = P.y, N.z = P.z, w.push(N), g && b) {
- var W = (0, v.extend)({}, b), V = new s.Vector3(L, z, F);
- if (V.multiplyScalar(u), V.add(P), W.start = P, W.end = V, W.frame = k, !W.color) {
- var G = N.style.sphere;
- G || (G = N.style.stick), G || (G = N.style.line), W.color = (0, v.getColorFromStyle)(N, G);
+ var L = (0, _.getAtomProperty)(this.atoms[$], "dx"), I = (0, _.getAtomProperty)(this.atoms[$], "dy"), F = (0, _.getAtomProperty)(this.atoms[$], "dz"), P = new s.Vector3(L, I, F), B = new s.Vector3(this.atoms[$].x, this.atoms[$].y, this.atoms[$].z), G = E * u / l;
+ P.multiplyScalar(G), B.add(P);
+ var U = {};
+ for (var R in this.atoms[$])
+ U[R] = this.atoms[$][R];
+ if (U.x = B.x, U.y = B.y, U.z = B.z, w.push(U), g && b) {
+ var W = (0, _.extend)({}, b), H = new s.Vector3(L, I, F);
+ if (H.multiplyScalar(u), H.add(B), W.start = B, W.end = H, W.frame = k, !W.color) {
+ var N = U.style.sphere;
+ N || (N = U.style.stick), N || (N = U.style.line), W.color = (0, _.getColorFromStyle)(U, N);
}
g.addArrow(W);
}
@@ -21339,7 +21361,7 @@ void main() {
setAtomDefaults(l) {
for (let u = 0; u < l.length; u++) {
let p = l[u];
- p && (p.style = p.style || (0, v.deepCopy)(M.defaultAtomStyle), p.color = p.color || this.ElementColors[p.elem] || this.defaultColor, p.model = this.id, (p.clickable || p.hoverable) && (p.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }));
+ p && (p.style = p.style || (0, _.deepCopy)(M.defaultAtomStyle), p.color = p.color || this.ElementColors[p.elem] || this.defaultColor, p.model = this.id, (p.clickable || p.hoverable) && (p.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }));
}
}
/** add atoms to this model from molecular data string
@@ -21353,17 +21375,17 @@ void main() {
this.dontDuplicateAtoms = !p.duplicateAssemblyAtoms;
var b = g.modelData;
if (b && (Array.isArray(b) ? (this.modelData = b[0], p.frames && (this.modelDatas = b)) : this.modelData = b), g.box ? this.box = g.box : this.box = null, this.frames.length == 0) {
- for (let _ = 0; _ < g.length; _++)
- g[_].length != 0 && this.frames.push(g[_]);
+ for (let v = 0; v < g.length; v++)
+ g[v].length != 0 && this.frames.push(g[v]);
this.frames[0] && (this.atoms = this.frames[0]);
} else if (p.frames)
- for (let _ = 0; _ < g.length; _++)
- this.frames.push(g[_]);
+ for (let v = 0; v < g.length; v++)
+ this.frames.push(g[v]);
else
for (var c = 0; c < g.length; c++)
this.addAtoms(g[c]);
- for (let _ = 0; _ < this.frames.length; _++)
- this.setAtomDefaults(this.frames[_]);
+ for (let v = 0; v < this.frames.length; v++)
+ this.setAtomDefaults(this.frames[v]);
p.vibrate && p.vibrate.frames && p.vibrate.amplitude && this.vibrate(p.vibrate.frames, p.vibrate.amplitude), p.style && this.setStyle({}, p.style);
}
setDontDuplicateAtoms(l) {
@@ -21407,14 +21429,14 @@ void main() {
} else typeof b == "object" && g != "properties" && g != "model" ? p[g] = M.deepCopyAndCache(b, u) : p[g] = b;
if (g == "and" || g == "or") {
const c = [];
- for (const _ of p[g]) {
+ for (const v of p[g]) {
const E = /* @__PURE__ */ new Set();
- for (const w of u.selectedAtoms(_))
+ for (const w of u.selectedAtoms(v))
E.add(w.index);
c.push(E);
}
if (g == "and") {
- const _ = function(w, k) {
+ const v = function(w, k) {
const $ = /* @__PURE__ */ new Set();
for (const L of k)
w.has(L) && $.add(L);
@@ -21422,14 +21444,14 @@ void main() {
};
let E = new Set(c[0]);
for (const w of c.splice(1))
- E = _(E, w);
+ E = v(E, w);
p[g].__cached_results = E;
} else if (g == "or") {
- const _ = /* @__PURE__ */ new Set();
+ const v = /* @__PURE__ */ new Set();
for (const E of c)
for (const w of E)
- _.add(w);
- p[g].__cached_results = _;
+ v.add(w);
+ p[g].__cached_results = v;
}
}
}
@@ -21477,7 +21499,7 @@ void main() {
g = !1;
break;
}
- var _ = !1;
+ var v = !1;
if (b === "bonds") {
var E = u[b];
if (E != l.bonds.length) {
@@ -21488,10 +21510,10 @@ void main() {
var w = u[b], k = l[b];
for (let $ = 0; $ < w.length; $++)
if (this.propertyMatches(k, w[$])) {
- _ = !0;
+ v = !0;
break;
}
- if (!_) {
+ if (!v) {
g = !1;
break;
}
@@ -21521,12 +21543,12 @@ void main() {
expandAtomList(l, u) {
if (u <= 0)
return l;
- for (var p = (0, v.getExtent)(l, void 0), g = [[], [], []], b = 0; b < 3; b++)
+ for (var p = (0, _.getExtent)(l, void 0), g = [[], [], []], b = 0; b < 3; b++)
g[0][b] = p[0][b] - u, g[1][b] = p[1][b] + u, g[2][b] = p[2][b];
var c = [];
for (let k = 0; k < this.atoms.length; k++) {
- var _ = this.atoms[k].x, E = this.atoms[k].y, w = this.atoms[k].z;
- _ >= g[0][0] && _ <= g[1][0] && E >= g[0][1] && E <= g[1][1] && w >= g[0][2] && w <= g[1][2] && (_ >= p[0][0] && _ <= p[1][0] && E >= p[0][1] && E <= p[1][1] && w >= p[0][2] && w <= p[1][2] || c.push(this.atoms[k]));
+ var v = this.atoms[k].x, E = this.atoms[k].y, w = this.atoms[k].z;
+ v >= g[0][0] && v <= g[1][0] && E >= g[0][1] && E <= g[1][1] && w >= g[0][2] && w <= g[1][2] && (v >= p[0][0] && v <= p[1][0] && E >= p[0][1] && E <= p[1][1] && w >= p[0][2] && w <= p[1][2] || c.push(this.atoms[k]));
}
return c;
}
@@ -21555,22 +21577,22 @@ void main() {
c && this.atomIsSelected(c, l) && p.push(c);
}
if (l.hasOwnProperty("expand")) {
- const N = M.getFloat(l.expand);
- let B = this.expandAtomList(p, N), W = p.length;
- const V = N * N;
- for (let G = 0; G < B.length; G++)
- for (let H = 0; H < W; H++) {
- var _ = M.squaredDistance(B[G], p[H]);
- _ < V && _ > 0 && p.push(B[G]);
+ const U = M.getFloat(l.expand);
+ let R = this.expandAtomList(p, U), W = p.length;
+ const H = U * U;
+ for (let N = 0; N < R.length; N++)
+ for (let V = 0; V < W; V++) {
+ var v = M.squaredDistance(R[N], p[V]);
+ v < H && v > 0 && p.push(R[N]);
}
}
if (l.hasOwnProperty("within") && l.within.hasOwnProperty("sel") && l.within.hasOwnProperty("distance")) {
var E = this.selectedAtoms(l.within.sel, this.atoms), w = {};
- const N = M.getFloat(l.within.distance), B = N * N;
+ const U = M.getFloat(l.within.distance), R = U * U;
for (let W = 0; W < E.length; W++)
- for (let V = 0; V < p.length; V++) {
- let G = M.squaredDistance(E[W], p[V]);
- G < B && G > 0 && (w[V] = 1);
+ for (let H = 0; H < p.length; H++) {
+ let N = M.squaredDistance(E[W], p[H]);
+ N < R && N > 0 && (w[H] = 1);
}
var k = [];
if (l.within.invert)
@@ -21582,17 +21604,17 @@ void main() {
p = k;
}
if (l.hasOwnProperty("byres")) {
- var $ = {}, L = [], z = [];
- for (let N = 0; N < p.length; N++) {
- let B = p[N];
- var F = B.chain, R = B.resi;
- if ($[F] === void 0 && ($[F] = {}), B.hasOwnProperty("resi") && $[F][R] === void 0) {
- for ($[F][R] = !0, z.push(B); z.length > 0; )
- if (B = z.pop(), F = B.chain, R = B.resi, L[B.index] === void 0) {
- L[B.index] = !0;
- for (var P = 0; P < B.bonds.length; P++) {
- var U = this.atoms[B.bonds[P]];
- L[U.index] === void 0 && U.hasOwnProperty("resi") && U.chain == F && U.resi == R && (z.push(U), p.push(U));
+ var $ = {}, L = [], I = [];
+ for (let U = 0; U < p.length; U++) {
+ let R = p[U];
+ var F = R.chain, P = R.resi;
+ if ($[F] === void 0 && ($[F] = {}), R.hasOwnProperty("resi") && $[F][P] === void 0) {
+ for ($[F][P] = !0, I.push(R); I.length > 0; )
+ if (R = I.pop(), F = R.chain, P = R.resi, L[R.index] === void 0) {
+ L[R.index] = !0;
+ for (var B = 0; B < R.bonds.length; B++) {
+ var G = this.atoms[R.bonds[B]];
+ L[G.index] === void 0 && G.hasOwnProperty("resi") && G.chain == F && G.resi == P && (I.push(G), p.push(G));
}
}
}
@@ -21619,13 +21641,13 @@ void main() {
for (g = 0; g < l.length; g++)
typeof l[g].index > "u" && (l[g].index = g), typeof l[g].serial > "u" && (l[g].serial = g), p[l[g].index] = u + g;
for (g = 0; g < l.length; g++) {
- var b = l[g], c = p[b.index], _ = (0, v.extend)({}, b);
- _.index = c, _.bonds = [], _.bondOrder = [], _.model = this.id, _.style = _.style || (0, v.deepCopy)(M.defaultAtomStyle), typeof _.color > "u" && (_.color = this.ElementColors[_.elem] || this.defaultColor);
+ var b = l[g], c = p[b.index], v = (0, _.extend)({}, b);
+ v.index = c, v.bonds = [], v.bondOrder = [], v.model = this.id, v.style = v.style || (0, _.deepCopy)(M.defaultAtomStyle), typeof v.color > "u" && (v.color = this.ElementColors[v.elem] || this.defaultColor);
for (var E = b.bonds ? b.bonds.length : 0, w = 0; w < E; w++) {
var k = p[b.bonds[w]];
- typeof k < "u" && (_.bonds.push(k), _.bondOrder.push(b.bondOrder ? b.bondOrder[w] : 1));
+ typeof k < "u" && (v.bonds.push(k), v.bondOrder.push(b.bondOrder ? b.bondOrder[w] : 1));
}
- this.atoms.push(_);
+ this.atoms.push(v);
}
}
/** Assign bonds based on atomic coordinates.
@@ -21672,7 +21694,7 @@ void main() {
});
*/
setStyle(l, u, p) {
- typeof u > "u" && typeof p > "u" && (u = l, l = {}), l = l, typeof u == "string" && (u = (0, v.specStringToObject)(u));
+ typeof u > "u" && typeof p > "u" && (u = l, l = {}), l = l, typeof u == "string" && (u = (0, _.specStringToObject)(u));
var g = !1, b = this, c = function(E) {
var w = b.selectedAtoms(l, E);
for (let k = 0; k < E.length; k++)
@@ -21688,8 +21710,8 @@ void main() {
E < 0 && (E = this.frames.length + E), c(this.frames[E]);
} else {
c(this.atoms);
- for (var _ = 0; _ < this.frames.length; _++)
- this.frames[_] !== this.atoms && c(this.frames[_]);
+ for (var v = 0; v < this.frames.length; v++)
+ this.frames[v] !== this.atoms && c(this.frames[v]);
}
g && (this.molObj = null);
}
@@ -21701,7 +21723,7 @@ void main() {
*/
setClickable(l, u, p) {
- if (u = !!u, p = (0, v.makeFunction)(p), p === null) {
+ if (u = !!u, p = (0, _.makeFunction)(p), p === null) {
console.log("Callback is not a function");
return;
}
@@ -21718,7 +21740,7 @@ void main() {
* @param {function} unhover_callback - function called when the mouse moves out of the hover area
*/
setHoverable(l, u, p, g) {
- if (u = !!u, p = (0, v.makeFunction)(p), g = (0, v.makeFunction)(g), p === null) {
+ if (u = !!u, p = (0, _.makeFunction)(p), g = (0, _.makeFunction)(g), p === null) {
console.log("Hover_callback is not a function");
return;
}
@@ -21727,8 +21749,8 @@ void main() {
return;
}
var b = this.selectedAtoms(l, this.atoms), c = b.length;
- for (let _ = 0; _ < c; _++)
- b[_].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, b[_].hoverable = u, p && (b[_].hover_callback = p), g && (b[_].unhover_callback = g);
+ for (let v = 0; v < c; v++)
+ b[v].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, b[v].hoverable = u, p && (b[v].hover_callback = p), g && (b[v].unhover_callback = g);
c > 0 && (this.molObj = null);
}
/** enable context menu of selected atoms
@@ -21765,10 +21787,10 @@ void main() {
* @param {Gradient|string} scheme
*/
setColorByProperty(l, u, p, g) {
- var b, c, _ = this.selectedAtoms(l, _);
- for (this.lastColors = null, _.length > 0 && (this.molObj = null), typeof p == "string" && typeof f.Gradient.builtinGradients[p] < "u" && (p = new f.Gradient.builtinGradients[p]()), p = p, g || (g = p.range()), g || (g = (0, v.getPropertyRange)(_, u)), b = 0; b < _.length; b++) {
- c = _[b];
- var E = (0, v.getAtomProperty)(c, u);
+ var b, c, v = this.selectedAtoms(l, v);
+ for (this.lastColors = null, v.length > 0 && (this.molObj = null), typeof p == "string" && typeof f.Gradient.builtinGradients[p] < "u" && (p = new f.Gradient.builtinGradients[p]()), p = p, g || (g = p.range()), g || (g = (0, _.getPropertyRange)(v, u)), b = 0; b < v.length; b++) {
+ c = v[b];
+ var E = (0, _.getAtomProperty)(c, u);
E != null && (c.color = p.valueToHex(parseFloat(c.properties[u]), g));
}
}
@@ -21815,14 +21837,14 @@ void main() {
p === u.s.length && u.s.push(c.style), p !== 0 && (b.s = p);
}
u.a.push(b);
- for (let _ = 0; _ < c.bonds.length; _++) {
- let E = g, w = c.bonds[_];
+ for (let v = 0; v < c.bonds.length; v++) {
+ let E = g, w = c.bonds[v];
if (E >= w)
continue;
let k = {
b: E,
e: w
- }, $ = c.bondOrder[_];
+ }, $ = c.bondOrder[v];
$ != 1 && (k.o = $), u.b.push(k);
}
}
@@ -21889,8 +21911,8 @@ void main() {
* @param {LabelSpec} options
*/
addPropertyLabels(l, u, p, g) {
- for (var b = this.selectedAtoms(u, b), c = (0, v.deepCopy)(g), _ = 0; _ < b.length; _++) {
- var E = b[_], w = null;
+ for (var b = this.selectedAtoms(u, b), c = (0, _.deepCopy)(g), v = 0; v < b.length; v++) {
+ var E = b[v], w = null;
typeof E[l] < "u" ? w = String(E[l]) : typeof E.properties[l] < "u" && (w = String(E.properties[l])), w != null && (c.position = E, p.addLabel(w, c));
}
}
@@ -21906,30 +21928,30 @@ void main() {
addResLabels(l, u, p, g = !1) {
var b = [], c = function(E, w) {
for (var k = E.selectedAtoms(l, k), $ = {}, L = 0; L < k.length; L++) {
- var z = k[L], F = z.chain, R = z.resn, P = z.resi, U = R + "" + P;
- $[F] || ($[F] = {}), $[F][U] || ($[F][U] = []), $[F][U].push(z);
+ var I = k[L], F = I.chain, P = I.resn, B = I.resi, G = P + "" + B;
+ $[F] || ($[F] = {}), $[F][G] || ($[F][G] = []), $[F][G].push(I);
}
- var N = (0, v.deepCopy)(p);
+ var U = (0, _.deepCopy)(p);
for (let W in $)
if ($.hasOwnProperty(W)) {
- var B = $[W];
- for (let V in B)
- if (B.hasOwnProperty(V)) {
- let G = B[V], H = new s.Vector3(0, 0, 0);
- for (let te = 0; te < G.length; te++) {
- let ee = G[te];
- H.x += ee.x, H.y += ee.y, H.z += ee.z;
+ var R = $[W];
+ for (let H in R)
+ if (R.hasOwnProperty(H)) {
+ let N = R[H], V = new s.Vector3(0, 0, 0);
+ for (let re = 0; re < N.length; re++) {
+ let te = N[re];
+ V.x += te.x, V.y += te.y, V.z += te.z;
}
- H.divideScalar(G.length), N.position = H, N.frame = w;
- let Q = u.addLabel(V, N, void 0, !0);
- b.push(Q);
+ V.divideScalar(N.length), U.position = V, U.frame = w;
+ let J = u.addLabel(H, U, void 0, !0);
+ b.push(J);
}
}
};
if (g) {
- var _ = this.getNumFrames();
+ var v = this.getNumFrames();
let E = this.atoms;
- for (let w = 0; w < _; w++)
+ for (let w = 0; w < v; w++)
this.frames[w] && (this.atoms = this.frames[w], c(this, w));
this.atoms = E;
} else
@@ -21941,13 +21963,13 @@ void main() {
this.atomdfs = [];
var l = this, u = new Int8Array(this.atoms.length);
u.fill(0);
- for (var p = function(_, E, w) {
- w.push([_, E]);
- var k = l.atoms[_];
- u[_] = 1;
+ for (var p = function(v, E, w) {
+ w.push([v, E]);
+ var k = l.atoms[v];
+ u[v] = 1;
for (var $ = 0; $ < k.bonds.length; $++) {
var L = k.bonds[$];
- l.atoms[L] && !u[L] && p(L, _, w);
+ l.atoms[L] && !u[L] && p(L, v, w);
}
}, g = 0; g < this.atoms.length; g++) {
var b = this.atoms[g];
@@ -21966,7 +21988,7 @@ void main() {
setCoordinatesFromURL(l, u) {
this.frames = [];
var p = this;
- return this.box && this.setupDFS(), l.startsWith("http") || (l = "http://" + l), (0, v.get)(l + "/traj/numframes/" + u, function(g) {
+ return this.box && this.setupDFS(), l.startsWith("http") || (l = "http://" + l), (0, _.get)(l + "/traj/numframes/" + u, function(g) {
if (!isNaN(parseInt(g)))
return p.frames.push(p.atoms), p.frames.numFrames = g, p.frames.url = l, p.frames.path = u, p.setFrame(0);
});
@@ -21991,7 +22013,7 @@ void main() {
if (/\.gz$/.test(u)) {
u = u.replace(/\.gz$/, "");
try {
- l = (0, v.inflateString)(l);
+ l = (0, _.inflateString)(l);
} catch ($) {
console.log($);
}
@@ -22000,13 +22022,13 @@ void main() {
if (p.hasOwnProperty(u)) {
this.frames = [];
for (var g = this.atoms.length, b = M.parseCrd(l, u), c = 0; c < b.length; ) {
- for (var _ = [], E = 0; E < g; E++) {
+ for (var v = [], E = 0; E < g; E++) {
var w = {};
for (var k in this.atoms[E])
w[k] = this.atoms[E][k];
- _[E] = w, _[E].x = b[c++], _[E].y = b[c++], _[E].z = b[c++];
+ v[E] = w, v[E].x = b[c++], v[E].y = b[c++], v[E].z = b[c++];
}
- this.frames.push(_);
+ this.frames.push(v);
}
return this.atoms = this.frames[0], this.frames;
}
@@ -22047,10 +22069,10 @@ ATOM`, b);
if (u == "array" || Array.isArray(l))
return l.flat(2);
{
- let _ = l.indexOf(`
+ let v = l.indexOf(`
`);
- u == "inpcrd" && (_ = l.indexOf(`
-`, _ + 1)), l = l.slice(_ + 1), p = l.match(/\S+/g).map(parseFloat);
+ u == "inpcrd" && (v = l.indexOf(`
+`, v + 1)), l = l.slice(v + 1), p = l.match(/\S+/g).map(parseFloat);
}
}
return p;
@@ -22061,7 +22083,7 @@ ATOM`, b);
if (/\.gz$/.test(u)) {
u = u.replace(/\.gz$/, "");
try {
- u.match(/bcif/i) ? l = (0, v.inflateString)(l, !1) : l = (0, v.inflateString)(l);
+ u.match(/bcif/i) ? l = (0, _.inflateString)(l, !1) : l = (0, _.inflateString)(l);
} catch (c) {
console.log(c);
}
@@ -22169,7 +22191,7 @@ ATOM`, b);
), d = t(
/*! ./VolumeData */
"./src/VolumeData.ts"
- ), v = t(
+ ), _ = t(
/*! ./GLDraw */
"./src/GLDraw.ts"
), f = t(
@@ -22195,13 +22217,13 @@ ATOM`, b);
var u, p, g;
l.constructor !== Array && (u = l.r, p = l.g, g = l.b);
for (let b in m.geometryGroups) {
- let c = m.geometryGroups[b], _ = c.colorArray;
+ let c = m.geometryGroups[b], v = c.colorArray;
for (let E = 0, w = c.vertices; E < w; ++E) {
if (l.constructor === Array) {
let k = l[E];
u = k.r, p = k.g, g = k.b;
}
- _[E * 3] = u, _[E * 3 + 1] = p, _[E * 3 + 2] = g;
+ v[E * 3] = u, v[E * 3 + 1] = p, v[E * 3 + 2] = g;
}
}
}
@@ -22214,43 +22236,43 @@ ATOM`, b);
* spec
*/
static drawArrow(m, l, u) {
- var p = u.start, g = u.end, b = u.radius, c = u.radiusRatio, _ = u.mid, E = u.midpos;
+ var p = u.start, g = u.end, b = u.radius, c = u.radiusRatio, v = u.mid, E = u.midpos;
if (!(p && g))
return;
var w = l.updateGeoGroup(51), k = new s.Vector3(g.x, g.y, g.z).sub(p);
if (E) {
- let ue = k.length();
- E > 0 ? _ = E / ue : _ = (ue + E) / ue;
+ let de = k.length();
+ E > 0 ? v = E / de : v = (de + E) / de;
}
- k.multiplyScalar(_);
+ k.multiplyScalar(v);
var $ = new s.Vector3(p.x, p.y, p.z).add(k), L = k.clone().negate();
- let z = new s.Vector3(p.x, p.y, p.z);
- m.intersectionShape.cylinder.push(new a.Cylinder(z, $.clone(), b)), m.intersectionShape.sphere.push(new a.Sphere(z, b));
+ let I = new s.Vector3(p.x, p.y, p.z);
+ m.intersectionShape.cylinder.push(new a.Cylinder(I, $.clone(), b)), m.intersectionShape.sphere.push(new a.Sphere(I, b));
var F = [];
F[0] = k.clone(), Math.abs(F[0].x) > 1e-4 ? F[0].y += 1 : F[0].x += 1, F[0].cross(k), F[0].normalize(), F[4] = F[0].clone(), F[4].crossVectors(F[0], k), F[4].normalize(), F[8] = F[0].clone().negate(), F[12] = F[4].clone().negate(), F[2] = F[0].clone().add(F[4]).normalize(), F[6] = F[4].clone().add(F[8]).normalize(), F[10] = F[8].clone().add(F[12]).normalize(), F[14] = F[12].clone().add(F[0]).normalize(), F[1] = F[0].clone().add(F[2]).normalize(), F[3] = F[2].clone().add(F[4]).normalize(), F[5] = F[4].clone().add(F[6]).normalize(), F[7] = F[6].clone().add(F[8]).normalize(), F[9] = F[8].clone().add(F[10]).normalize(), F[11] = F[10].clone().add(F[12]).normalize(), F[13] = F[12].clone().add(F[14]).normalize(), F[15] = F[14].clone().add(F[0]).normalize();
- var R = w.vertices, P = w.vertexArray, U = w.faceArray, N = w.normalArray, B = w.lineArray, W, V, G;
- for (V = 0, G = F.length; V < G; ++V) {
- W = 3 * (R + 3 * V);
- var H = F[V].clone().multiplyScalar(b).add(p), Q = F[V].clone().multiplyScalar(b).add($), te = F[V].clone().multiplyScalar(b * c).add($);
- if (P[W] = H.x, P[W + 1] = H.y, P[W + 2] = H.z, P[W + 3] = Q.x, P[W + 4] = Q.y, P[W + 5] = Q.z, P[W + 6] = te.x, P[W + 7] = te.y, P[W + 8] = te.z, V > 0) {
- var ee = P[W - 3], ce = P[W - 2], fe = P[W - 1], oe = new s.Vector3(ee, ce, fe), he = new s.Vector3(g.x, g.y, g.z), Ae = $.clone(), Se = new s.Vector3(te.x, te.y, te.z);
- m.intersectionShape.triangle.push(new a.Triangle(Se, he, oe)), m.intersectionShape.triangle.push(new a.Triangle(oe.clone(), Ae, Se.clone()));
+ var P = w.vertices, B = w.vertexArray, G = w.faceArray, U = w.normalArray, R = w.lineArray, W, H, N;
+ for (H = 0, N = F.length; H < N; ++H) {
+ W = 3 * (P + 3 * H);
+ var V = F[H].clone().multiplyScalar(b).add(p), J = F[H].clone().multiplyScalar(b).add($), re = F[H].clone().multiplyScalar(b * c).add($);
+ if (B[W] = V.x, B[W + 1] = V.y, B[W + 2] = V.z, B[W + 3] = J.x, B[W + 4] = J.y, B[W + 5] = J.z, B[W + 6] = re.x, B[W + 7] = re.y, B[W + 8] = re.z, H > 0) {
+ var te = B[W - 3], ue = B[W - 2], ie = B[W - 1], ae = new s.Vector3(te, ue, ie), ce = new s.Vector3(g.x, g.y, g.z), Me = $.clone(), Ae = new s.Vector3(re.x, re.y, re.z);
+ m.intersectionShape.triangle.push(new a.Triangle(Ae, ce, ae)), m.intersectionShape.triangle.push(new a.Triangle(ae.clone(), Me, Ae.clone()));
}
}
- w.vertices += 48, W = w.vertices * 3, P[W] = p.x, P[W + 1] = p.y, P[W + 2] = p.z, P[W + 3] = $.x, P[W + 4] = $.y, P[W + 5] = $.z, P[W + 6] = g.x, P[W + 7] = g.y, P[W + 8] = g.z, w.vertices += 3;
- var Ie, pe, le, ne, Te, Oe, Be, Ue, Pe, Ge, Ne, Re, De, je, Xe, X, q, re, ye, me = w.vertices - 3, ze = w.vertices - 2, ke = w.vertices - 1, K = me * 3, ae = ze * 3, ge = ke * 3;
- for (V = 0, G = F.length - 1; V < G; ++V) {
- var xe = R + 3 * V;
- W = xe * 3, pe = w.faceidx, le = w.lineidx, ne = xe, Ge = ne * 3, Te = xe + 1, Ne = Te * 3, Oe = xe + 2, Re = Oe * 3, Be = xe + 4, De = Be * 3, Ue = xe + 5, je = Ue * 3, Pe = xe + 3, Xe = Pe * 3, X = q = F[V], re = ye = F[V + 1], N[Ge] = X.x, N[Ne] = q.x, N[Xe] = ye.x, N[Ge + 1] = X.y, N[Ne + 1] = q.y, N[Xe + 1] = ye.y, N[Ge + 2] = X.z, N[Ne + 2] = q.z, N[Xe + 2] = ye.z, N[Ne] = q.x, N[De] = re.x, N[Xe] = ye.x, N[Ne + 1] = q.y, N[De + 1] = re.y, N[Xe + 1] = ye.y, N[Ne + 2] = q.z, N[De + 2] = re.z, N[Xe + 2] = ye.z, N[Re] = q.x, N[je] = re.x, N[Re + 1] = q.y, N[je + 1] = re.y, N[Re + 2] = q.z, N[je + 2] = re.z, U[pe] = ne, U[pe + 1] = Te, U[pe + 2] = Pe, U[pe + 3] = Te, U[pe + 4] = Be, U[pe + 5] = Pe, U[pe + 6] = ne, U[pe + 7] = Pe, U[pe + 8] = me, U[pe + 9] = Oe, U[pe + 10] = ze, U[pe + 11] = Ue, U[pe + 12] = Oe, U[pe + 13] = ke, U[pe + 14] = Ue, B[le] = ne, B[le + 1] = Te, B[le + 2] = ne, B[le + 3] = Pe, B[le + 4] = Be, B[le + 5] = Pe, B[le + 6] = ne, B[le + 7] = Pe, B[le + 8] = Oe, B[le + 9] = Te, B[le + 10] = Oe, B[le + 11] = Ue, B[le + 12] = Be, B[le + 13] = Ue, B[le + 14] = Oe, B[le + 15] = ke, B[le + 16] = Oe, B[le + 17] = Ue, B[le + 18] = ke, B[le + 19] = Ue, w.faceidx += 15, w.lineidx += 20;
+ w.vertices += 48, W = w.vertices * 3, B[W] = p.x, B[W + 1] = p.y, B[W + 2] = p.z, B[W + 3] = $.x, B[W + 4] = $.y, B[W + 5] = $.z, B[W + 6] = g.x, B[W + 7] = g.y, B[W + 8] = g.z, w.vertices += 3;
+ var Ie, pe, se, Q, ye, ke, Pe, Ne, Be, Ge, Ue, Re, Ce, je, Xe, X, q, ne, xe, me = w.vertices - 3, ze = w.vertices - 2, $e = w.vertices - 1, K = me * 3, oe = ze * 3, ge = $e * 3;
+ for (H = 0, N = F.length - 1; H < N; ++H) {
+ var we = P + 3 * H;
+ W = we * 3, pe = w.faceidx, se = w.lineidx, Q = we, Ge = Q * 3, ye = we + 1, Ue = ye * 3, ke = we + 2, Re = ke * 3, Pe = we + 4, Ce = Pe * 3, Ne = we + 5, je = Ne * 3, Be = we + 3, Xe = Be * 3, X = q = F[H], ne = xe = F[H + 1], U[Ge] = X.x, U[Ue] = q.x, U[Xe] = xe.x, U[Ge + 1] = X.y, U[Ue + 1] = q.y, U[Xe + 1] = xe.y, U[Ge + 2] = X.z, U[Ue + 2] = q.z, U[Xe + 2] = xe.z, U[Ue] = q.x, U[Ce] = ne.x, U[Xe] = xe.x, U[Ue + 1] = q.y, U[Ce + 1] = ne.y, U[Xe + 1] = xe.y, U[Ue + 2] = q.z, U[Ce + 2] = ne.z, U[Xe + 2] = xe.z, U[Re] = q.x, U[je] = ne.x, U[Re + 1] = q.y, U[je + 1] = ne.y, U[Re + 2] = q.z, U[je + 2] = ne.z, G[pe] = Q, G[pe + 1] = ye, G[pe + 2] = Be, G[pe + 3] = ye, G[pe + 4] = Pe, G[pe + 5] = Be, G[pe + 6] = Q, G[pe + 7] = Be, G[pe + 8] = me, G[pe + 9] = ke, G[pe + 10] = ze, G[pe + 11] = Ne, G[pe + 12] = ke, G[pe + 13] = $e, G[pe + 14] = Ne, R[se] = Q, R[se + 1] = ye, R[se + 2] = Q, R[se + 3] = Be, R[se + 4] = Pe, R[se + 5] = Be, R[se + 6] = Q, R[se + 7] = Be, R[se + 8] = ke, R[se + 9] = ye, R[se + 10] = ke, R[se + 11] = Ne, R[se + 12] = Pe, R[se + 13] = Ne, R[se + 14] = ke, R[se + 15] = $e, R[se + 16] = ke, R[se + 17] = Ne, R[se + 18] = $e, R[se + 19] = Ne, w.faceidx += 15, w.lineidx += 20;
}
Ie = [
- R + 45,
- R + 46,
- R + 1,
- R,
- R + 47,
- R + 2
- ], pe = w.faceidx, le = w.lineidx, ne = Ie[0], Ge = ne * 3, Te = Ie[1], Ne = Te * 3, Oe = Ie[4], Re = Oe * 3, Be = Ie[2], De = Be * 3, Ue = Ie[5], je = Ue * 3, Pe = Ie[3], Xe = Pe * 3, X = q = F[15], re = ye = F[0], N[Ge] = X.x, N[Ne] = q.x, N[Xe] = ye.x, N[Ge + 1] = X.y, N[Ne + 1] = q.y, N[Xe + 1] = ye.y, N[Ge + 2] = X.z, N[Ne + 2] = q.z, N[Xe + 2] = ye.z, N[Ne] = q.x, N[De] = re.x, N[Xe] = ye.x, N[Ne + 1] = q.y, N[De + 1] = re.y, N[Xe + 1] = ye.y, N[Ne + 2] = q.z, N[De + 2] = re.z, N[Xe + 2] = ye.z, N[Re] = q.x, N[je] = re.x, N[Re + 1] = q.y, N[je + 1] = re.y, N[Re + 2] = q.z, N[je + 2] = re.z, k.normalize(), L.normalize(), N[K] = L.x, N[ae] = N[ge] = k.x, N[K + 1] = L.y, N[ae + 1] = N[ge + 1] = k.y, N[K + 2] = L.z, N[ae + 2] = N[ge + 2] = k.z, U[pe] = ne, U[pe + 1] = Te, U[pe + 2] = Pe, U[pe + 3] = Te, U[pe + 4] = Be, U[pe + 5] = Pe, U[pe + 6] = ne, U[pe + 7] = Pe, U[pe + 8] = me, U[pe + 9] = Oe, U[pe + 10] = ze, U[pe + 11] = Ue, U[pe + 12] = Oe, U[pe + 13] = ke, U[pe + 14] = Ue, B[le] = ne, B[le + 1] = Te, B[le + 2] = ne, B[le + 3] = Pe, B[le + 4] = Be, B[le + 5] = Pe, B[le + 6] = ne, B[le + 7] = Pe, B[le + 8] = Oe, B[le + 9] = Te, B[le + 10] = Oe, B[le + 11] = Ue, B[le + 12] = Be, B[le + 13] = Ue, B[le + 14] = Oe, B[le + 15] = ke, B[le + 16] = Oe, B[le + 17] = Ue, B[le + 18] = ke, B[le + 19] = Ue, w.faceidx += 15, w.lineidx += 20;
+ P + 45,
+ P + 46,
+ P + 1,
+ P,
+ P + 47,
+ P + 2
+ ], pe = w.faceidx, se = w.lineidx, Q = Ie[0], Ge = Q * 3, ye = Ie[1], Ue = ye * 3, ke = Ie[4], Re = ke * 3, Pe = Ie[2], Ce = Pe * 3, Ne = Ie[5], je = Ne * 3, Be = Ie[3], Xe = Be * 3, X = q = F[15], ne = xe = F[0], U[Ge] = X.x, U[Ue] = q.x, U[Xe] = xe.x, U[Ge + 1] = X.y, U[Ue + 1] = q.y, U[Xe + 1] = xe.y, U[Ge + 2] = X.z, U[Ue + 2] = q.z, U[Xe + 2] = xe.z, U[Ue] = q.x, U[Ce] = ne.x, U[Xe] = xe.x, U[Ue + 1] = q.y, U[Ce + 1] = ne.y, U[Xe + 1] = xe.y, U[Ue + 2] = q.z, U[Ce + 2] = ne.z, U[Xe + 2] = xe.z, U[Re] = q.x, U[je] = ne.x, U[Re + 1] = q.y, U[je + 1] = ne.y, U[Re + 2] = q.z, U[je + 2] = ne.z, k.normalize(), L.normalize(), U[K] = L.x, U[oe] = U[ge] = k.x, U[K + 1] = L.y, U[oe + 1] = U[ge + 1] = k.y, U[K + 2] = L.z, U[oe + 2] = U[ge + 2] = k.z, G[pe] = Q, G[pe + 1] = ye, G[pe + 2] = Be, G[pe + 3] = ye, G[pe + 4] = Pe, G[pe + 5] = Be, G[pe + 6] = Q, G[pe + 7] = Be, G[pe + 8] = me, G[pe + 9] = ke, G[pe + 10] = ze, G[pe + 11] = Ne, G[pe + 12] = ke, G[pe + 13] = $e, G[pe + 14] = Ne, R[se] = Q, R[se + 1] = ye, R[se + 2] = Q, R[se + 3] = Be, R[se + 4] = Pe, R[se + 5] = Be, R[se + 6] = Q, R[se + 7] = Be, R[se + 8] = ke, R[se + 9] = ye, R[se + 10] = ke, R[se + 11] = Ne, R[se + 12] = Pe, R[se + 13] = Ne, R[se + 14] = ke, R[se + 15] = $e, R[se + 16] = ke, R[se + 17] = Ne, R[se + 18] = $e, R[se + 19] = Ne, w.faceidx += 15, w.lineidx += 20;
}
// Update a bounding sphere's position and radius
// from list of centroids and new points
@@ -22265,39 +22287,39 @@ ATOM`, b);
*/
static updateBoundingFromPoints(m, l, u, p) {
m.center.set(0, 0, 0);
- let g = 1 / 0, b = 1 / 0, c = 1 / 0, _ = -1 / 0, E = -1 / 0, w = -1 / 0;
- m.box && (g = m.box.min.x, _ = m.box.max.x, b = m.box.min.y, E = m.box.max.y, c = m.box.min.z, w = m.box.max.z);
- for (let z = 0, F = p; z < F; z++) {
- var k = u[z * 3], $ = u[z * 3 + 1], L = u[z * 3 + 2];
- k < g && (g = k), $ < b && (b = $), L < c && (c = L), k > _ && (_ = k), $ > E && (E = $), L > w && (w = L);
+ let g = 1 / 0, b = 1 / 0, c = 1 / 0, v = -1 / 0, E = -1 / 0, w = -1 / 0;
+ m.box && (g = m.box.min.x, v = m.box.max.x, b = m.box.min.y, E = m.box.max.y, c = m.box.min.z, w = m.box.max.z);
+ for (let I = 0, F = p; I < F; I++) {
+ var k = u[I * 3], $ = u[I * 3 + 1], L = u[I * 3 + 2];
+ k < g && (g = k), $ < b && (b = $), L < c && (c = L), k > v && (v = k), $ > E && (E = $), L > w && (w = L);
}
- m.center.set((_ + g) / 2, (E + b) / 2, (w + c) / 2), m.radius = m.center.distanceTo({ x: _, y: E, z: w }), m.box = { min: { x: g, y: b, z: c }, max: { x: _, y: E, z: w } };
+ m.center.set((v + g) / 2, (E + b) / 2, (w + c) / 2), m.radius = m.center.distanceTo({ x: v, y: E, z: w }), m.box = { min: { x: g, y: b, z: c }, max: { x: v, y: E, z: w } };
}
//helper function for adding an appropriately sized mesh
static addCustomGeo(m, l, u, p, g) {
- var b = l.addGeoGroup(), c = u.vertexArr, _ = u.normalArr, E = u.faceArr;
+ var b = l.addGeoGroup(), c = u.vertexArr, v = u.normalArr, E = u.faceArr;
b.vertices = c.length, b.faceidx = E.length;
- var w, k, $, L, z, F, R, P, U, N = b.vertexArray, B = b.colorArray;
- for (p.constructor !== Array && (P = p.r, U = p.g, L = p.b), F = 0, R = b.vertices; F < R; ++F)
- w = F * 3, k = c[F], N[w] = k.x, N[w + 1] = k.y, N[w + 2] = k.z, p.constructor === Array && (z = p[F], P = z.r, U = z.g, L = z.b), B[w] = P, B[w + 1] = U, B[w + 2] = L;
+ var w, k, $, L, I, F, P, B, G, U = b.vertexArray, R = b.colorArray;
+ for (p.constructor !== Array && (B = p.r, G = p.g, L = p.b), F = 0, P = b.vertices; F < P; ++F)
+ w = F * 3, k = c[F], U[w] = k.x, U[w + 1] = k.y, U[w + 2] = k.z, p.constructor === Array && (I = p[F], B = I.r, G = I.g, L = I.b), R[w] = B, R[w + 1] = G, R[w + 2] = L;
if (g)
- for (F = 0, R = b.faceidx / 3; F < R; ++F) {
- w = F * 3, $ = E[w], L = E[w + 1], z = E[w + 2];
- var W = new s.Vector3(), V = new s.Vector3(), G = new s.Vector3();
- m.intersectionShape.triangle.push(new a.Triangle(W.copy(c[$]), V.copy(c[L]), G.copy(c[z])));
+ for (F = 0, P = b.faceidx / 3; F < P; ++F) {
+ w = F * 3, $ = E[w], L = E[w + 1], I = E[w + 2];
+ var W = new s.Vector3(), H = new s.Vector3(), N = new s.Vector3();
+ m.intersectionShape.triangle.push(new a.Triangle(W.copy(c[$]), H.copy(c[L]), N.copy(c[I])));
}
if (g) {
- var H = new s.Vector3(0, 0, 0), Q = 0;
- for (let ce = 0; ce < l.geometryGroups.length; ce++)
- H.add(l.geometryGroups[ce].getCentroid()), Q++;
- H.divideScalar(Q), A.updateBoundingFromPoints(m.boundingSphere, { centroid: H }, N, b.vertices);
+ var V = new s.Vector3(0, 0, 0), J = 0;
+ for (let ue = 0; ue < l.geometryGroups.length; ue++)
+ V.add(l.geometryGroups[ue].getCentroid()), J++;
+ V.divideScalar(J), A.updateBoundingFromPoints(m.boundingSphere, { centroid: V }, U, b.vertices);
}
- if (b.faceArray = new Uint16Array(E), b.truncateArrayBuffers(!0, !0), _.length < b.vertices)
+ if (b.faceArray = new Uint16Array(E), b.truncateArrayBuffers(!0, !0), v.length < b.vertices)
b.setNormals();
else {
- var te = b.normalArray = new Float32Array(b.vertices * 3), ee;
- for (F = 0, R = b.vertices; F < R; ++F)
- w = F * 3, ee = _[F], te[w] = ee.x, te[w + 1] = ee.y, te[w + 2] = ee.z;
+ var re = b.normalArray = new Float32Array(b.vertices * 3), te;
+ for (F = 0, P = b.vertices; F < P; ++F)
+ w = F * 3, te = v[F], re[w] = te.x, re[w + 1] = te.y, re[w + 2] = te.z;
}
b.setLineIndices(), b.lineidx = b.lineArray.length;
}
@@ -22340,8 +22362,8 @@ ATOM`, b);
if (A.updateFromStyle(this, this.stylespec), m.voldata && m.volscheme) {
(0, y.adjustVolumeStyle)(m);
const u = m.volscheme, p = m.voldata, g = h.CC, b = u.range() || [-1, 1];
- this.geo.setColors(function(c, _, E) {
- let w = p.getVal(c, _, E);
+ this.geo.setColors(function(c, v, E) {
+ let w = p.getVal(c, v, E);
return g.color(u.valueToHex(w, b));
}), delete this.color;
}
@@ -22362,7 +22384,7 @@ ATOM`, b);
viewer.render();
*/
addSphere(m) {
- m.center || (m.center = new s.Vector3(0, 0, 0)), m.radius = m.radius ? (0, s.clamp)(m.radius, 0, 1 / 0) : 1.5, m.color = h.CC.color(m.color), this.intersectionShape.sphere.push(new a.Sphere(m.center, m.radius)), v.GLDraw.drawSphere(this.geo, m.center, m.radius, m.color, m.quality), this.components.push({
+ m.center || (m.center = new s.Vector3(0, 0, 0)), m.radius = m.radius ? (0, s.clamp)(m.radius, 0, 1 / 0) : 1.5, m.color = h.CC.color(m.color), this.intersectionShape.sphere.push(new a.Sphere(m.center, m.radius)), _.GLDraw.drawSphere(this.geo, m.center, m.radius, m.color, m.quality), this.components.push({
centroid: new s.Vector3(m.center.x, m.center.y, m.center.z)
});
var l = this.geo.updateGeoGroup(0);
@@ -22404,12 +22426,12 @@ ATOM`, b);
{ x: b.x + u.x + g.x, y: b.y + u.y + g.y, z: b.z + u.z + g.z },
{ x: b.x + p.x + g.x, y: b.y + p.y + g.y, z: b.z + p.z + g.z },
{ x: b.x + u.x + p.x + g.x, y: b.y + u.y + p.y + g.y, z: b.z + u.z + p.z + g.z }
- ], _ = [], E = [];
- _.splice(_.length, 0, c[0], c[1], c[2], c[3]), E.splice(E.length, 0, 0, 2, 1, 1, 2, 3);
+ ], v = [], E = [];
+ v.splice(v.length, 0, c[0], c[1], c[2], c[3]), E.splice(E.length, 0, 0, 2, 1, 1, 2, 3);
var w = 4;
- _.splice(_.length, 0, c[2], c[3], c[6], c[7]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, _.splice(_.length, 0, c[4], c[5], c[0], c[1]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, _.splice(_.length, 0, c[6], c[7], c[4], c[5]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, _.splice(_.length, 0, c[3], c[1], c[7], c[5]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, _.splice(_.length, 0, c[2], c[6], c[0], c[4]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4;
+ v.splice(v.length, 0, c[2], c[3], c[6], c[7]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, v.splice(v.length, 0, c[4], c[5], c[0], c[1]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, v.splice(v.length, 0, c[6], c[7], c[4], c[5]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, v.splice(v.length, 0, c[3], c[1], c[7], c[5]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4, v.splice(v.length, 0, c[2], c[6], c[0], c[4]), E.splice(E.length, 0, w + 0, w + 2, w + 1, w + 1, w + 2, w + 3), w += 4;
var k = (0, y.extend)({}, m);
- k.vertexArr = _, k.faceArr = E, k.normalArr = [], A.drawCustom(this, this.geo, k);
+ k.vertexArr = v, k.faceArr = E, k.normalArr = [], A.drawCustom(this, this.geo, k);
var $ = new s.Vector3();
this.components.push({
centroid: $.addVectors(c[0], c[7]).multiplyScalar(0.5)
@@ -22451,7 +22473,7 @@ ATOM`, b);
var l, u;
m.start ? l = new s.Vector3(m.start.x || 0, m.start.y || 0, m.start.z || 0) : l = new s.Vector3(0, 0, 0), m.end ? (u = new s.Vector3(m.end.x, m.end.y || 0, m.end.z || 0), typeof u.x > "u" && (u.x = 3)) : u = new s.Vector3(0, 0, 0);
var p = m.radius || 0.1, g = h.CC.color(m.color);
- this.intersectionShape.cylinder.push(new a.Cylinder(l, u, p)), v.GLDraw.drawCylinder(this.geo, l, u, p, g, m.fromCap, m.toCap);
+ this.intersectionShape.cylinder.push(new a.Cylinder(l, u, p)), _.GLDraw.drawCylinder(this.geo, l, u, p, g, m.fromCap, m.toCap);
var b = new s.Vector3();
this.components.push({
centroid: b.addVectors(l, u).multiplyScalar(0.5)
@@ -22469,14 +22491,14 @@ ATOM`, b);
m.start ? l = new s.Vector3(m.start.x || 0, m.start.y || 0, m.start.z || 0) : l = new s.Vector3(0, 0, 0);
var u;
m.end ? (u = new s.Vector3(m.end.x, m.end.y || 0, m.end.z || 0), typeof u.x > "u" && (u.x = 3)) : u = new s.Vector3(3, 0, 0);
- for (var p = m.radius || 0.1, g = h.CC.color(m.color), b = Math.sqrt(Math.pow(l.x - u.x, 2) + Math.pow(l.y - u.y, 2) + Math.pow(l.z - u.z, 2)), c = b / (m.gapLength + m.dashLength), _ = new s.Vector3(m.start.x || 0, m.start.y || 0, m.start.z || 0), E = new s.Vector3(m.end.x, m.end.y || 0, m.end.z || 0), w = new s.Vector3((u.x - l.x) / (b / m.gapLength), (u.y - l.y) / (b / m.gapLength), (u.z - l.z) / (b / m.gapLength)), k = new s.Vector3((u.x - l.x) / (b / m.dashLength), (u.y - l.y) / (b / m.dashLength), (u.z - l.z) / (b / m.dashLength)), $ = 0; $ < c; $++)
- E = new s.Vector3(_.x + k.x, _.y + k.y, _.z + k.z), this.intersectionShape.cylinder.push(new a.Cylinder(_, E, p)), v.GLDraw.drawCylinder(this.geo, _, E, p, g, m.fromCap, m.toCap), _ = new s.Vector3(E.x + w.x, E.y + w.y, E.z + w.z);
+ for (var p = m.radius || 0.1, g = h.CC.color(m.color), b = Math.sqrt(Math.pow(l.x - u.x, 2) + Math.pow(l.y - u.y, 2) + Math.pow(l.z - u.z, 2)), c = b / (m.gapLength + m.dashLength), v = new s.Vector3(m.start.x || 0, m.start.y || 0, m.start.z || 0), E = new s.Vector3(m.end.x, m.end.y || 0, m.end.z || 0), w = new s.Vector3((u.x - l.x) / (b / m.gapLength), (u.y - l.y) / (b / m.gapLength), (u.z - l.z) / (b / m.gapLength)), k = new s.Vector3((u.x - l.x) / (b / m.dashLength), (u.y - l.y) / (b / m.dashLength), (u.z - l.z) / (b / m.dashLength)), $ = 0; $ < c; $++)
+ E = new s.Vector3(v.x + k.x, v.y + k.y, v.z + k.z), this.intersectionShape.cylinder.push(new a.Cylinder(v, E, p)), _.GLDraw.drawCylinder(this.geo, v, E, p, g, m.fromCap, m.toCap), v = new s.Vector3(E.x + w.x, E.y + w.y, E.z + w.z);
var L = new s.Vector3();
this.components.push({
centroid: L.addVectors(l, u).multiplyScalar(0.5)
});
- var z = this.geo.updateGeoGroup(0);
- A.updateBoundingFromPoints(this.boundingSphere, this.components, z.vertexArray, z.vertices);
+ var I = this.geo.updateGeoGroup(0);
+ A.updateBoundingFromPoints(this.boundingSphere, this.components, I.vertexArray, I.vertices);
}
/**
* Creates a curved shape
@@ -22489,9 +22511,9 @@ ATOM`, b);
console.log("Too few points in addCurve");
return;
}
- var u = m.radius || 0.1, p = h.CC.color(m.color), g = 0, b = l.length - 1, c = l[0].distanceTo(l[1]), _ = Math.ceil(2 * u / c);
+ var u = m.radius || 0.1, p = h.CC.color(m.color), g = 0, b = l.length - 1, c = l[0].distanceTo(l[1]), v = Math.ceil(2 * u / c);
if (m.toArrow) {
- b -= _;
+ b -= v;
let $ = {
start: l[b],
end: l[l.length - 1],
@@ -22502,7 +22524,7 @@ ATOM`, b);
this.addArrow($);
}
if (m.fromArrow) {
- g += _;
+ g += v;
let $ = {
start: l[g],
end: l[0],
@@ -22530,8 +22552,8 @@ ATOM`, b);
m.start ? l = new s.Vector3(m.start.x || 0, m.start.y || 0, m.start.z || 0) : l = new s.Vector3(0, 0, 0), m.end ? (u = new s.Vector3(m.end.x, m.end.y || 0, m.end.z || 0), typeof u.x > "u" && (u.x = 3)) : u = new s.Vector3(3, 0, 0);
var p = this.geo.updateGeoGroup(2), g = p.vertices, b = g * 3, c = p.vertexArray;
c[b] = l.x, c[b + 1] = l.y, c[b + 2] = l.z, c[b + 3] = u.x, c[b + 4] = u.y, c[b + 5] = u.z, p.vertices += 2;
- var _ = p.lineArray, E = p.lineidx;
- _[E] = g, _[E + 1] = g + 1, p.lineidx += 2;
+ var v = p.lineArray, E = p.lineidx;
+ v[E] = g, v[E + 1] = g + 1, p.lineidx += 2;
var w = new s.Vector3();
this.components.push({
centroid: w.addVectors(l, u).multiplyScalar(0.5)
@@ -22608,51 +22630,51 @@ ATOM`, b);
});
*/
addIsosurface(m, l, u, p) {
- var g = l.isoval !== void 0 && typeof l.isoval == "number" ? l.isoval : 0, b = !!l.voxel, c = l.smoothness === void 0 ? 1 : l.smoothness, _ = m.size.x, E = m.size.y, w = m.size.z, k = new Int16Array(_ * E * w), $ = m.data, L, z;
- for (L = 0, z = k.length; L < z; ++L)
+ var g = l.isoval !== void 0 && typeof l.isoval == "number" ? l.isoval : 0, b = !!l.voxel, c = l.smoothness === void 0 ? 1 : l.smoothness, v = m.size.x, E = m.size.y, w = m.size.z, k = new Int16Array(v * E * w), $ = m.data, L, I;
+ for (L = 0, I = k.length; L < I; ++L)
k[L] = -1;
- var F = new Uint8Array(_ * E * w);
- for (L = 0, z = $.length; L < z; ++L) {
- var R = g >= 0 ? $[L] - g : g - $[L];
- R > 0 && (F[L] |= A.ISDONE);
+ var F = new Uint8Array(v * E * w);
+ for (L = 0, I = $.length; L < I; ++L) {
+ var P = g >= 0 ? $[L] - g : g - $[L];
+ P > 0 && (F[L] |= A.ISDONE);
}
- var P = [], U = [];
- o.MarchingCube.march(F, P, U, {
+ var B = [], G = [];
+ o.MarchingCube.march(F, B, G, {
fulltable: !0,
voxel: b,
unitCube: m.unit,
origin: m.origin,
matrix: m.matrix,
- nX: _,
+ nX: v,
nY: E,
nZ: w
- }), !b && c > 0 && o.MarchingCube.laplacianSmooth(c, P, U);
- var N = [], B = [], W = [];
+ }), !b && c > 0 && o.MarchingCube.laplacianSmooth(c, B, G);
+ var U = [], R = [], W = [];
if (l.selectedRegion && l.coords === void 0 && (l.coords = l.selectedRegion), l.coords === void 0 && l.selection !== void 0 && (p ? l.coords = p.selectedAtoms(l.selection) : console.log("addIsosurface needs viewer is selection provided.")), l.coords !== void 0) {
- var V = l.coords[0].x, G = l.coords[0].y, H = l.coords[0].z, Q = l.coords[0].x, te = l.coords[0].y, ee = l.coords[0].z;
- for (let le = 0; le < l.coords.length; le++)
- l.coords[le].x > V ? V = l.coords[le].x : l.coords[le].x < Q && (Q = l.coords[le].x), l.coords[le].y > G ? G = l.coords[le].y : l.coords[le].y < te && (te = l.coords[le].y), l.coords[le].z > H ? H = l.coords[le].z : l.coords[le].z < ee && (ee = l.coords[le].z);
- var ce = 2;
- l.radius !== void 0 && (ce = l.radius), l.selectedOffset !== void 0 && (ce = l.selectedOffset), l.seldist !== void 0 && (ce = l.seldist), Q -= ce, V += ce, te -= ce, G += ce, ee -= ce, H += ce;
- for (let le = 0; le < P.length; le++)
- P[le].x > Q && P[le].x < V && P[le].y > te && P[le].y < G && P[le].z > ee && P[le].z < H && A.inSelectedRegion(P[le], l.coords, ce) ? (N.push(B.length), B.push(P[le])) : N.push(-1);
- for (let le = 0; le + 2 < U.length; le += 3)
- N[U[le]] !== -1 && N[U[le + 1]] !== -1 && N[U[le + 2]] !== -1 && (W.push(U[le] - (U[le] - N[U[le]])), W.push(U[le + 1] - (U[le + 1] - N[U[le + 1]])), W.push(U[le + 2] - (U[le + 2] - N[U[le + 2]])));
- P = B, U = W;
+ var H = l.coords[0].x, N = l.coords[0].y, V = l.coords[0].z, J = l.coords[0].x, re = l.coords[0].y, te = l.coords[0].z;
+ for (let se = 0; se < l.coords.length; se++)
+ l.coords[se].x > H ? H = l.coords[se].x : l.coords[se].x < J && (J = l.coords[se].x), l.coords[se].y > N ? N = l.coords[se].y : l.coords[se].y < re && (re = l.coords[se].y), l.coords[se].z > V ? V = l.coords[se].z : l.coords[se].z < te && (te = l.coords[se].z);
+ var ue = 2;
+ l.radius !== void 0 && (ue = l.radius), l.selectedOffset !== void 0 && (ue = l.selectedOffset), l.seldist !== void 0 && (ue = l.seldist), J -= ue, H += ue, re -= ue, N += ue, te -= ue, V += ue;
+ for (let se = 0; se < B.length; se++)
+ B[se].x > J && B[se].x < H && B[se].y > re && B[se].y < N && B[se].z > te && B[se].z < V && A.inSelectedRegion(B[se], l.coords, ue) ? (U.push(R.length), R.push(B[se])) : U.push(-1);
+ for (let se = 0; se + 2 < G.length; se += 3)
+ U[G[se]] !== -1 && U[G[se + 1]] !== -1 && U[G[se + 2]] !== -1 && (W.push(G[se] - (G[se] - U[G[se]])), W.push(G[se + 1] - (G[se + 1] - U[G[se + 1]])), W.push(G[se + 2] - (G[se + 2] - U[G[se + 2]])));
+ B = R, G = W;
}
A.drawCustom(this, this.geo, {
- vertexArr: P,
- faceArr: U,
+ vertexArr: B,
+ faceArr: G,
normalArr: [],
clickable: l.clickable,
hoverable: l.hoverable
}), this.updateStyle(l);
- var fe = new s.Vector3(m.origin.x, m.origin.y, m.origin.z), oe = new s.Vector3(m.size.x * m.unit.x, m.size.y * m.unit.y, m.size.z * m.unit.z), he = new s.Vector3(0, 0, 0), Ae = fe.clone(), Se = fe.clone().add(oe);
- for (let le = 0; le < P.length; le++)
- he.add(P[le]), Ae.max(P[le]), Se.min(P[le]);
- he.divideScalar(P.length);
- var Ie = he.distanceTo(Se), pe = he.distanceTo(Ae);
- this.boundingSphere.center = he, this.boundingSphere.radius = Math.max(Ie, pe), typeof u == "function" && u();
+ var ie = new s.Vector3(m.origin.x, m.origin.y, m.origin.z), ae = new s.Vector3(m.size.x * m.unit.x, m.size.y * m.unit.y, m.size.z * m.unit.z), ce = new s.Vector3(0, 0, 0), Me = ie.clone(), Ae = ie.clone().add(ae);
+ for (let se = 0; se < B.length; se++)
+ ce.add(B[se]), Me.max(B[se]), Ae.min(B[se]);
+ ce.divideScalar(B.length);
+ var Ie = ce.distanceTo(Ae), pe = ce.distanceTo(Me);
+ this.boundingSphere.center = ce, this.boundingSphere.radius = Math.max(Ie, pe), typeof u == "function" && u();
}
/**
* @deprecated Use addIsosurface instead
@@ -22724,8 +22746,8 @@ ATOM`, b);
(p.length === 0 || g.length === 0) && console.warn("Error adding custom shape component: No vertices and/or face indices supplied!");
var b = l.color;
typeof b > "u" && (b = M.color), b = h.CC.color(b);
- for (var c = x(u), _ = 0, E = c.length; _ < E; _++)
- A.addCustomGeo(M, m, c[_], c[_].colorArr ? c[_].colorArr : b, l.clickable);
+ for (var c = x(u), v = 0, E = c.length; v < E; v++)
+ A.addCustomGeo(M, m, c[v], c[v].colorArr ? c[v].colorArr : b, l.clickable);
};
function x(M) {
var m = 64e3;
@@ -22734,10 +22756,10 @@ ATOM`, b);
var l = [{ vertexArr: [], normalArr: [], faceArr: [] }];
M.colorArr && (l.colorArr = []);
var u = [], p = [], g = 0, b = M.faceArr;
- for (let _ = 0, E = b.length; _ < E; _ += 3) {
+ for (let v = 0, E = b.length; v < E; v += 3) {
let w = l[g];
for (let k = 0; k < 3; k++) {
- var c = b[_ + k];
+ var c = b[v + k];
u[c] !== g && (u[c] = g, p[c] = w.vertexArr.length, w.vertexArr.push(M.vertexArr[c]), M.normalArr && M.normalArr[c] && w.normalArr.push(M.normalArr[c]), M.colorArr && M.colorArr[c] && w.colorArr.push(M.colorArr[c])), w.faceArr.push(p[c]);
}
w.vertexArr.length >= m && (l.push({ vertexArr: [], normalArr: [], faceArr: [] }), M.colorArr && (l.colorArr = []), g++);
@@ -22799,7 +22821,7 @@ ATOM`, b);
), d = t(
/*! ./GLModel */
"./src/GLModel.ts"
- ), v = t(
+ ), _ = t(
/*! ./Label */
"./src/Label.ts"
), f = t(
@@ -22821,20 +22843,20 @@ ATOM`, b);
const m = 16;
class l {
getWidth() {
- let c = this.container, _ = c.offsetWidth;
- if (_ == 0 && c.style.display === "none") {
+ let c = this.container, v = c.offsetWidth;
+ if (v == 0 && c.style.display === "none") {
let E = c.style.position, w = c.style.visibility;
- c.style.display = "block", c.style.visibility = "hidden", c.style.position = "absolute", _ = c.offsetWidth, c.style.display = "none", c.style.visibility = w, c.style.position = E;
+ c.style.display = "block", c.style.visibility = "hidden", c.style.position = "absolute", v = c.offsetWidth, c.style.display = "none", c.style.visibility = w, c.style.position = E;
}
- return _;
+ return v;
}
getHeight() {
- let c = this.container, _ = c.offsetHeight;
- if (_ == 0 && c.style.display === "none") {
+ let c = this.container, v = c.offsetHeight;
+ if (v == 0 && c.style.display === "none") {
let E = c.style.position, w = c.style.visibility;
- c.style.display = "block", c.style.visibility = "hidden", c.style.position = "absolute", _ = c.offsetHeight, c.style.display = "none", c.style.visibility = w, c.style.position = E;
+ c.style.display = "block", c.style.visibility = "hidden", c.style.position = "absolute", v = c.offsetHeight, c.style.display = "none", c.style.visibility = w, c.style.position = E;
}
- return _;
+ return v;
}
setupRenderer() {
this.renderer = new r.Renderer({
@@ -22860,14 +22882,14 @@ ATOM`, b);
c.position = new a.Vector3(0.2, 0.2, 1).normalize(), c.intensity = 1, this.scene.add(c);
}
_handleLostContext(c) {
- const _ = function(E) {
+ const v = function(E) {
const w = E.getBoundingClientRect();
return !(w.right < 0 || w.bottom < 0 || w.top > (window.innerHeight || document.documentElement.clientHeight) || w.left > (window.innerWidth || document.documentElement.clientWidth));
};
- if (_(this.container)) {
+ if (v(this.container)) {
let E = 0;
for (let w of document.getElementsByTagName("canvas"))
- if (_(w) && w._3dmol_viewer != null && (w._3dmol_viewer.resize(), E += 1, E >= m))
+ if (v(w) && w._3dmol_viewer != null && (w._3dmol_viewer.resize(), E += 1, E >= m))
break;
}
}
@@ -22884,8 +22906,8 @@ ATOM`, b);
var c = 0;
for (let E in this.surfaces)
if (this.surfaces.hasOwnProperty(E)) {
- var _ = parseInt(E);
- isNaN(_) || _ > c && (c = _);
+ var v = parseInt(E);
+ isNaN(v) || v > c && (c = v);
}
return c + 1;
}
@@ -22897,16 +22919,16 @@ ATOM`, b);
//if nolink is set/true, don't propagate changes to linked viewers
show(c) {
if (this.renderer.setViewport(), !!this.scene && (this.setSlabAndFog(), this.renderer.render(this.scene, this.camera), this.viewChangeCallback && this.viewChangeCallback(this._viewer.getView()), !c && this.linkedViewers.length > 0))
- for (var _ = this._viewer.getView(), E = 0; E < this.linkedViewers.length; E++) {
+ for (var v = this._viewer.getView(), E = 0; E < this.linkedViewers.length; E++) {
var w = this.linkedViewers[E];
- w.setView(_, !0);
+ w.setView(v, !0);
}
}
//regenerate the list of clickables
//also updates hoverables
updateClickables() {
this.clickables.splice(0, this.clickables.length), this.hoverables.splice(0, this.hoverables.length), this.contextMenuEnabledObjects.splice(0, this.contextMenuEnabledObjects.length);
- for (let c = 0, _ = this.models.length; c < _; c++) {
+ for (let c = 0, v = this.models.length; c < v; c++) {
let E = this.models[c];
if (E) {
let w = E.selectedAtoms({
@@ -22922,14 +22944,14 @@ ATOM`, b);
this.contextMenuEnabledObjects.push($[L]);
}
}
- for (let c = 0, _ = this.shapes.length; c < _; c++) {
+ for (let c = 0, v = this.shapes.length; c < v; c++) {
let E = this.shapes[c];
E && E.clickable && this.clickables.push(E), E && E.hoverable && this.hoverables.push(E), E && E.contextMenuEnabled && this.contextMenuEnabledObjects.push(E);
}
}
// Checks for selection intersects on mousedown
- handleClickSelection(c, _, E) {
- let w = this.targetedObjects(c, _, this.clickables);
+ handleClickSelection(c, v, E) {
+ let w = this.targetedObjects(c, v, this.clickables);
if (w.length) {
var k = w[0].clickable;
k.callback !== void 0 && (typeof k.callback != "function" && (k.callback = (0, h.makeFunction)(k.callback)), typeof k.callback == "function" && (this.mouseButton === 3 && this.contextMenuEnabledObjects.includes(k) && this.userContextMenuHandler || k.callback(k, this._viewer, E, this.container, w)));
@@ -22937,21 +22959,21 @@ ATOM`, b);
}
//return offset of container
canvasOffset() {
- let c = this.glDOM, _ = c.getBoundingClientRect(), E = c.ownerDocument, w = E.documentElement, k = E.defaultView;
+ let c = this.glDOM, v = c.getBoundingClientRect(), E = c.ownerDocument, w = E.documentElement, k = E.defaultView;
return {
- top: _.top + k.pageYOffset - w.clientTop,
- left: _.left + k.pageXOffset - w.clientLeft
+ top: v.top + k.pageYOffset - w.clientTop,
+ left: v.left + k.pageXOffset - w.clientLeft
};
}
//set current_hover to sel (which can be null), calling appropraite callbacks
- setHover(c, _, E) {
- this.current_hover != c && (this.current_hover && (typeof this.current_hover.unhover_callback != "function" && (this.current_hover.unhover_callback = (0, h.makeFunction)(this.current_hover.unhover_callback)), this.current_hover.unhover_callback(this.current_hover, this._viewer, _, this.container, E)), this.current_hover = c, c && c.hover_callback !== void 0 && (typeof c.hover_callback != "function" && (c.hover_callback = (0, h.makeFunction)(c.hover_callback)), typeof c.hover_callback == "function" && c.hover_callback(c, this._viewer, _, this.container, E)));
+ setHover(c, v, E) {
+ this.current_hover != c && (this.current_hover && (typeof this.current_hover.unhover_callback != "function" && (this.current_hover.unhover_callback = (0, h.makeFunction)(this.current_hover.unhover_callback)), this.current_hover.unhover_callback(this.current_hover, this._viewer, v, this.container, E)), this.current_hover = c, c && c.hover_callback !== void 0 && (typeof c.hover_callback != "function" && (c.hover_callback = (0, h.makeFunction)(c.hover_callback)), typeof c.hover_callback == "function" && c.hover_callback(c, this._viewer, v, this.container, E)));
}
//checks for selection intersects on hover
- handleHoverSelection(c, _, E) {
+ handleHoverSelection(c, v, E) {
if (this.hoverables.length == 0)
return;
- let w = this.targetedObjects(c, _, this.hoverables);
+ let w = this.targetedObjects(c, v, this.hoverables);
if (w.length) {
var k = w[0].clickable;
this.setHover(k, E, w), this.current_hover = k;
@@ -22959,8 +22981,8 @@ ATOM`, b);
this.setHover(null);
}
//sees if the mouse is still on the object that invoked a hover event and if not then the unhover callback is called
- handleHoverContinue(c, _) {
- let E = this.targetedObjects(c, _, this.hoverables);
+ handleHoverContinue(c, v) {
+ let E = this.targetedObjects(c, v, this.hoverables);
(E.length == 0 || E[0] === void 0) && this.setHover(null), E[0] !== void 0 && E[0].clickable !== this.current_hover && this.setHover(null);
}
/**
@@ -22969,32 +22991,32 @@ ATOM`, b);
* @param {Event} event
* @param {{ allowTolerance, tolerance: number }} options
*/
- closeEnoughForClick(c, { allowTolerance: _ = c.targetTouches, tolerance: E = 5 } = {}) {
+ closeEnoughForClick(c, { allowTolerance: v = c.targetTouches, tolerance: E = 5 } = {}) {
const w = this.getX(c), k = this.getY(c);
- if (_) {
+ if (v) {
const $ = Math.abs(w - this.mouseStartX), L = Math.abs(k - this.mouseStartY);
return $ <= E && L <= E;
} else
return w === this.mouseStartX && k === this.mouseStartY;
}
calcTouchDistance(c) {
- var _ = c.targetTouches[0].pageX - c.targetTouches[1].pageX, E = c.targetTouches[0].pageY - c.targetTouches[1].pageY;
- return Math.hypot(_, E);
+ var v = c.targetTouches[0].pageX - c.targetTouches[1].pageX, E = c.targetTouches[0].pageY - c.targetTouches[1].pageY;
+ return Math.hypot(v, E);
}
//check targetTouches as well
getX(c) {
- var _ = c.pageX;
- return _ == null && (_ = c.pageX), c.targetTouches && c.targetTouches[0] ? _ = c.targetTouches[0].pageX : c.changedTouches && c.changedTouches[0] && (_ = c.changedTouches[0].pageX), _;
+ var v = c.pageX;
+ return v == null && (v = c.pageX), c.targetTouches && c.targetTouches[0] ? v = c.targetTouches[0].pageX : c.changedTouches && c.changedTouches[0] && (v = c.changedTouches[0].pageX), v;
}
getY(c) {
- var _ = c.pageY;
- return _ == null && (_ = c.pageY), c.targetTouches && c.targetTouches[0] ? _ = c.targetTouches[0].pageY : c.changedTouches && c.changedTouches[0] && (_ = c.changedTouches[0].pageY), _;
+ var v = c.pageY;
+ return v == null && (v = c.pageY), c.targetTouches && c.targetTouches[0] ? v = c.targetTouches[0].pageY : c.changedTouches && c.changedTouches[0] && (v = c.changedTouches[0].pageY), v;
}
//for grid viewers, return true if point is in this viewer
- isInViewer(c, _) {
+ isInViewer(c, v) {
if (this.viewers != null) {
- var E = this.WIDTH / this.cols, w = this.HEIGHT / this.rows, k = this.canvasOffset(), $ = c - k.left, L = _ - k.top, z = this.rows - Math.floor(L / w) - 1, F = Math.floor($ / E);
- if (z != this.row || F != this.col)
+ var E = this.WIDTH / this.cols, w = this.HEIGHT / this.rows, k = this.canvasOffset(), $ = c - k.left, L = v - k.top, I = this.rows - Math.floor(L / w) - 1, F = Math.floor($ / E);
+ if (I != this.row || F != this.col)
return !1;
}
return !0;
@@ -23003,38 +23025,38 @@ ATOM`, b);
//also, make sure we don't go past CAMERA_Z
adjustZoomToLimits(c) {
if (this.config.lowerZoomLimit && this.config.lowerZoomLimit > 0) {
- let _ = this.CAMERA_Z - this.config.lowerZoomLimit;
- c > _ && (c = _);
+ let v = this.CAMERA_Z - this.config.lowerZoomLimit;
+ c > v && (c = v);
}
if (this.config.upperZoomLimit && this.config.upperZoomLimit > 0) {
- let _ = this.CAMERA_Z - this.config.upperZoomLimit;
- c < _ && (c = _);
+ let v = this.CAMERA_Z - this.config.upperZoomLimit;
+ c < v && (c = v);
}
return c > this.CAMERA_Z - 1 && (c = this.CAMERA_Z - 1), c;
}
//interpolate between two normalized quaternions (t between 0 and 1)
//https://en.wikipedia.org/wiki/Slerp
- static slerp(c, _, E) {
+ static slerp(c, v, E) {
if (E == 1)
- return _.clone();
+ return v.clone();
if (E == 0)
return c.clone();
- let w = c.x * _.x + c.y * _.y + c.z * _.z + c.w * _.w;
+ let w = c.x * v.x + c.y * v.y + c.z * v.z + c.w * v.w;
if (w > 0.9995) {
- let P = new a.Quaternion(c.x + E * (_.x - c.x), c.y + E * (_.y - c.y), c.z + E * (_.z - c.z), c.w + E * (_.w - c.w));
- return P.normalize(), P;
+ let B = new a.Quaternion(c.x + E * (v.x - c.x), c.y + E * (v.y - c.y), c.z + E * (v.z - c.z), c.w + E * (v.w - c.w));
+ return B.normalize(), B;
}
- w < 0 && (_ = _.clone().multiplyScalar(-1), w = -w), w > 1 ? w = 1 : w < -1 && (w = -1);
- var k = Math.acos(w), $ = k * E, L = _.clone();
+ w < 0 && (v = v.clone().multiplyScalar(-1), w = -w), w > 1 ? w = 1 : w < -1 && (w = -1);
+ var k = Math.acos(w), $ = k * E, L = v.clone();
L.sub(c.clone().multiplyScalar(w)), L.normalize();
- var z = Math.cos($), F = Math.sin($), R = new a.Quaternion(c.x * z + L.x * F, c.y * z + L.y * F, c.z * z + L.z * F, c.w * z + L.w * F);
- return R.normalize(), R;
+ var I = Math.cos($), F = Math.sin($), P = new a.Quaternion(c.x * I + L.x * F, c.y * I + L.y * F, c.z * I + L.z * F, c.w * I + L.w * F);
+ return P.normalize(), P;
}
/* @param {Object} element HTML element within which to create viewer
* @param {ViewerSpec} config Object containing optional configuration for the viewer
*/
- constructor(c, _ = {}) {
- if (this.nomouse = !1, this.glDOM = null, this.models = [], this.surfaces = {}, this.shapes = [], this.labels = [], this.clickables = [], this.hoverables = [], this.contextMenuEnabledObjects = [], this.current_hover = null, this.hoverDuration = 500, this.longTouchDuration = 1e3, this.viewer_frame = 0, this.viewChangeCallback = null, this.stateChangeCallback = null, this.NEAR = 1, this.FAR = 800, this.CAMERA_Z = 150, this.fov = 20, this.linkedViewers = [], this.renderer = null, this.control_all = !1, this.scene = null, this.rotationGroup = null, this.modelGroup = null, this.fogStart = 0.4, this.slabNear = -50, this.slabFar = 50, this.cq = new a.Quaternion(0, 0, 0, 1), this.dq = new a.Quaternion(0, 0, 0, 1), this.animated = 0, this.animationTimers = /* @__PURE__ */ new Set(), this.isDragging = !1, this.mouseStartX = 0, this.mouseStartY = 0, this.touchDistanceStart = 0, this.touchHold = !1, this.currentModelPos = 0, this.cz = 0, this.cslabNear = 0, this.cslabFar = 0, this.userContextMenuHandler = null, this.config = _, this.callback = this.config.callback, this.defaultcolors = this.config.defaultcolors, this.defaultcolors || (this.defaultcolors = s.elementColors.defaultColors), this.nomouse = !!this.config.nomouse, this.bgColor = 0, this.config.backgroundColor = this.config.backgroundColor || "#ffffff", typeof this.config.backgroundColor < "u" && (this.bgColor = s.CC.color(this.config.backgroundColor).getHex()), this.config.backgroundAlpha = this.config.backgroundAlpha == null ? 1 : this.config.backgroundAlpha, this.camerax = 0, typeof this.config.camerax < "u" && (this.camerax = typeof this.config.camerax == "string" ? parseFloat(this.config.camerax) : this.config.camerax), this._viewer = this, this.container = c, this.config.hoverDuration != null && (this.hoverDuration = this.config.hoverDuration), this.config.antialias === void 0 && (this.config.antialias = !0), this.config.cartoonQuality === void 0 && (this.config.cartoonQuality = 10), this.WIDTH = this.getWidth(), this.HEIGHT = this.getHeight(), this.setupRenderer(), this.row = this.config.row == null ? 0 : this.config.row, this.col = this.config.col == null ? 0 : this.config.col, this.cols = this.config.cols, this.rows = this.config.rows, this.viewers = this.config.viewers, this.control_all = this.config.control_all, this.ASPECT = this.renderer.getAspect(this.WIDTH, this.HEIGHT), this.camera = new r.Camera(this.fov, this.ASPECT, this.NEAR, this.FAR, this.config.orthographic), this.camera.position = new a.Vector3(this.camerax, 0, this.CAMERA_Z), this.lookingAt = new a.Vector3(), this.camera.lookAt(this.lookingAt), this.raycaster = new r.Raycaster(new a.Vector3(0, 0, 0), new a.Vector3(0, 0, 0)), this.projector = new r.Projector(), this.initializeScene(), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), this.scene.fog.color = s.CC.color(this.bgColor), document.body.addEventListener("mouseup", this._handleMouseUp.bind(this)), document.body.addEventListener("touchend", this._handleMouseUp.bind(this)), this.initContainer(this.container), this.config.style && this.setViewStyle(this.config), window.addEventListener("resize", this.resize.bind(this)), typeof window.ResizeObserver < "u" && (this.divwatcher = new window.ResizeObserver(this.resize.bind(this)), this.divwatcher.observe(this.container)), typeof window.IntersectionObserver < "u") {
+ constructor(c, v = {}) {
+ if (this.nomouse = !1, this.glDOM = null, this.models = [], this.surfaces = {}, this.shapes = [], this.labels = [], this.clickables = [], this.hoverables = [], this.contextMenuEnabledObjects = [], this.current_hover = null, this.hoverDuration = 500, this.longTouchDuration = 1e3, this.viewer_frame = 0, this.viewChangeCallback = null, this.stateChangeCallback = null, this.NEAR = 1, this.FAR = 800, this.CAMERA_Z = 150, this.fov = 20, this.linkedViewers = [], this.renderer = null, this.control_all = !1, this.scene = null, this.rotationGroup = null, this.modelGroup = null, this.fogStart = 0.4, this.slabNear = -50, this.slabFar = 50, this.cq = new a.Quaternion(0, 0, 0, 1), this.dq = new a.Quaternion(0, 0, 0, 1), this.animated = 0, this.animationTimers = /* @__PURE__ */ new Set(), this.isDragging = !1, this.mouseStartX = 0, this.mouseStartY = 0, this.touchDistanceStart = 0, this.touchHold = !1, this.currentModelPos = 0, this.cz = 0, this.cslabNear = 0, this.cslabFar = 0, this.userContextMenuHandler = null, this.config = v, this.callback = this.config.callback, this.defaultcolors = this.config.defaultcolors, this.defaultcolors || (this.defaultcolors = s.elementColors.defaultColors), this.nomouse = !!this.config.nomouse, this.bgColor = 0, this.config.backgroundColor = this.config.backgroundColor || "#ffffff", typeof this.config.backgroundColor < "u" && (this.bgColor = s.CC.color(this.config.backgroundColor).getHex()), this.config.backgroundAlpha = this.config.backgroundAlpha == null ? 1 : this.config.backgroundAlpha, this.camerax = 0, typeof this.config.camerax < "u" && (this.camerax = typeof this.config.camerax == "string" ? parseFloat(this.config.camerax) : this.config.camerax), this._viewer = this, this.container = c, this.config.hoverDuration != null && (this.hoverDuration = this.config.hoverDuration), this.config.antialias === void 0 && (this.config.antialias = !0), this.config.cartoonQuality === void 0 && (this.config.cartoonQuality = 10), this.WIDTH = this.getWidth(), this.HEIGHT = this.getHeight(), this.setupRenderer(), this.row = this.config.row == null ? 0 : this.config.row, this.col = this.config.col == null ? 0 : this.config.col, this.cols = this.config.cols, this.rows = this.config.rows, this.viewers = this.config.viewers, this.control_all = this.config.control_all, this.ASPECT = this.renderer.getAspect(this.WIDTH, this.HEIGHT), this.camera = new r.Camera(this.fov, this.ASPECT, this.NEAR, this.FAR, this.config.orthographic), this.camera.position = new a.Vector3(this.camerax, 0, this.CAMERA_Z), this.lookingAt = new a.Vector3(), this.camera.lookAt(this.lookingAt), this.raycaster = new r.Raycaster(new a.Vector3(0, 0, 0), new a.Vector3(0, 0, 0)), this.projector = new r.Projector(), this.initializeScene(), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), this.scene.fog.color = s.CC.color(this.bgColor), document.body.addEventListener("mouseup", this._handleMouseUp.bind(this)), document.body.addEventListener("touchend", this._handleMouseUp.bind(this)), this.initContainer(this.container), this.config.style && this.setViewStyle(this.config), window.addEventListener("resize", this.resize.bind(this)), typeof window.ResizeObserver < "u" && (this.divwatcher = new window.ResizeObserver(this.resize.bind(this)), this.divwatcher.observe(this.container)), typeof window.IntersectionObserver < "u") {
let E = (w, k) => {
w.forEach(($) => {
$.isIntersecting && this.resize();
@@ -23055,10 +23077,10 @@ ATOM`, b);
* @param y - y position in screen coordinates
* @param {Object[]} - list of objects or selection object specifying what object to check for targeting
*/
- targetedObjects(c, _, E) {
+ targetedObjects(c, v, E) {
var w = {
x: c,
- y: _,
+ y: v,
z: -1
};
return Array.isArray(E) || (E = this.selectedAtoms(E)), E.length == 0 ? [] : (this.raycaster.setFromCamera(w, this.camera), this.raycaster.intersectObjects(this.modelGroup, E));
@@ -23068,15 +23090,15 @@ ATOM`, b);
* @return {object | list} - and object or list of {x: screenX, y: screenY}
*/
modelToScreen(c) {
- let _ = !1;
- Array.isArray(c) || (c = [c], _ = !0);
- let E = this.renderer.getXRatio(), w = this.renderer.getYRatio(), k = this.col, $ = this.row, L = k * (this.WIDTH / E), z = (w - $ - 1) * (this.HEIGHT / w), F = [], R = this.canvasOffset();
- return c.forEach((P) => {
- let U = new a.Vector3(P.x, P.y, P.z);
- U.applyMatrix4(this.modelGroup.matrixWorld), this.projector.projectVector(U, this.camera);
- let N = this.WIDTH / E * (U.x + 1) / 2 + R.left + L, B = -(this.HEIGHT / w) * (U.y - 1) / 2 + R.top + z;
- F.push({ x: N, y: B });
- }), _ && (F = F[0]), F;
+ let v = !1;
+ Array.isArray(c) || (c = [c], v = !0);
+ let E = this.renderer.getXRatio(), w = this.renderer.getYRatio(), k = this.col, $ = this.row, L = k * (this.WIDTH / E), I = (w - $ - 1) * (this.HEIGHT / w), F = [], P = this.canvasOffset();
+ return c.forEach((B) => {
+ let G = new a.Vector3(B.x, B.y, B.z);
+ G.applyMatrix4(this.modelGroup.matrixWorld), this.projector.projectVector(G, this.camera);
+ let U = this.WIDTH / E * (G.x + 1) / 2 + P.left + L, R = -(this.HEIGHT / w) * (G.y - 1) / 2 + P.top + I;
+ F.push({ x: U, y: R });
+ }), v && (F = F[0]), F;
}
/**
* For a given screen (x,y) displacement return model displacement
@@ -23084,9 +23106,9 @@ ATOM`, b);
* @param{y} y displacement in screen corodinates
* @param{modelz} z coordinate in model coordinates to compute offset for, default is model axis
*/
- screenOffsetToModel(c, _, E) {
- var w = c / this.WIDTH, k = _ / this.HEIGHT, $ = E === void 0 ? this.rotationGroup.position.z : E, L = this.rotationGroup.quaternion, z = new a.Vector3(0, 0, $);
- return this.projector.projectVector(z, this.camera), z.x += w * 2, z.y -= k * 2, this.projector.unprojectVector(z, this.camera), z.z = 0, z.applyQuaternion(L), z;
+ screenOffsetToModel(c, v, E) {
+ var w = c / this.WIDTH, k = v / this.HEIGHT, $ = E === void 0 ? this.rotationGroup.position.z : E, L = this.rotationGroup.quaternion, I = new a.Vector3(0, 0, $);
+ return this.projector.projectVector(I, this.camera), I.x += w * 2, I.y -= k * 2, this.projector.unprojectVector(I, this.camera), I.z = 0, I.applyQuaternion(L), I;
}
/**
* Distance from screen coordinate to model coordinate assuming screen point
@@ -23094,8 +23116,8 @@ ATOM`, b);
* @param{screen} xy screen coordinate
* @param{model} xyz model coordinate
*/
- screenToModelDistance(c, _) {
- let E = this.canvasOffset(), w = new a.Vector3(_.x, _.y, _.z);
+ screenToModelDistance(c, v) {
+ let E = this.canvasOffset(), w = new a.Vector3(v.x, v.y, v.z);
w.applyMatrix4(this.modelGroup.matrixWorld);
let k = w.clone();
this.projector.projectVector(w, this.camera);
@@ -23136,8 +23158,8 @@ ATOM`, b);
*/
getInternalState() {
var c = { models: [], surfaces: [], shapes: [], labels: [] };
- for (let _ = 0; _ < this.models.length; _++)
- this.models[_] && (c.models[_] = this.models[_].getInternalState());
+ for (let v = 0; v < this.models.length; v++)
+ this.models[v] && (c.models[v] = this.models[v].getInternalState());
return c;
}
/**
@@ -23147,9 +23169,9 @@ ATOM`, b);
*/
setInternalState(c) {
this.clear();
- var _ = c.models;
- for (let E = 0; E < _.length; E++)
- _[E] && (this.models[E] = new d.GLModel(E), this.models[E].setInternalState(_[E]));
+ var v = c.models;
+ for (let E = 0; E < v.length; E++)
+ v[E] && (this.models[E] = new d.GLModel(E), this.models[E].setInternalState(v[E]));
this.render();
}
/**
@@ -23167,8 +23189,8 @@ ATOM`, b);
viewer.render();
});
*/
- setZoomLimits(c, _) {
- typeof c < "u" && (this.config.lowerZoomLimit = c), _ && (this.config.upperZoomLimit = _), this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z), this.show();
+ setZoomLimits(c, v) {
+ typeof c < "u" && (this.config.lowerZoomLimit = c), v && (this.config.upperZoomLimit = v), this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z), this.show();
}
/**
* Set camera parameters (distance to the origin and field of view)
@@ -23192,10 +23214,10 @@ ATOM`, b);
_handleMouseDown(c) {
if (c.preventDefault(), !this.scene)
return;
- var _ = this.getX(c), E = this.getY(c);
- if (_ === void 0)
+ var v = this.getX(c), E = this.getY(c);
+ if (v === void 0)
return;
- this.isDragging = !0, this.mouseButton = c.which, this.mouseStartX = _, this.mouseStartY = E, this.touchHold = !0, this.touchDistanceStart = 0, c.targetTouches && c.targetTouches.length == 2 && (this.touchDistanceStart = this.calcTouchDistance(c)), this.cq = this.rotationGroup.quaternion.clone(), this.cz = this.rotationGroup.position.z, this.currentModelPos = this.modelGroup.position.clone(), this.cslabNear = this.slabNear, this.cslabFar = this.slabFar;
+ this.isDragging = !0, this.mouseButton = c.which, this.mouseStartX = v, this.mouseStartY = E, this.touchHold = !0, this.touchDistanceStart = 0, c.targetTouches && c.targetTouches.length == 2 && (this.touchDistanceStart = this.calcTouchDistance(c)), this.cq = this.rotationGroup.quaternion.clone(), this.cz = this.rotationGroup.position.z, this.currentModelPos = this.modelGroup.position.clone(), this.cslabNear = this.slabNear, this.cslabFar = this.slabFar;
let w = this;
c.targetTouches && c.targetTouches.length === 1 && (this.longTouchTimeout = setTimeout(function() {
if (w.touchHold == !0) {
@@ -23207,9 +23229,9 @@ ATOM`, b);
}
_handleMouseUp(c) {
if (this.touchHold = !1, this.isDragging && this.scene) {
- var _ = this.getX(c), E = this.getY(c);
- if (this.closeEnoughForClick(c) && this.isInViewer(_, E)) {
- let w = this.mouseXY(_, E);
+ var v = this.getX(c), E = this.getY(c);
+ if (this.closeEnoughForClick(c) && this.isInViewer(v, E)) {
+ let w = this.mouseXY(v, E);
this.handleClickSelection(w.x, w.y, c);
}
}
@@ -23217,8 +23239,8 @@ ATOM`, b);
}
_handleMouseScroll(c) {
if (c.preventDefault(), !!this.scene) {
- var _ = this.getX(c), E = this.getY(c);
- if (_ !== void 0 && !(!this.control_all && !this.isInViewer(_, E))) {
+ var v = this.getX(c), E = this.getY(c);
+ if (v !== void 0 && !(!this.control_all && !this.isInViewer(v, E))) {
var w = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, k = 1;
if (c.ctrlKey && (k = -1), c.detail)
this.rotationGroup.position.z += k * w * c.detail / 10;
@@ -23242,24 +23264,24 @@ ATOM`, b);
* @return {Promise}
*/
apngURI(c) {
- let _ = this;
+ let v = this;
return c = c || 1, new Promise(function(E) {
- let w = 0, k = _.viewChangeCallback, $ = [], L = [], z = Date.now();
- _.viewChangeCallback = function() {
- L.push(Date.now() - z), z = Date.now(), $.push(new Promise((F) => {
- _.getCanvas().toBlob(function(R) {
- R.arrayBuffer().then(F);
+ let w = 0, k = v.viewChangeCallback, $ = [], L = [], I = Date.now();
+ v.viewChangeCallback = function() {
+ L.push(Date.now() - I), I = Date.now(), $.push(new Promise((F) => {
+ v.getCanvas().toBlob(function(P) {
+ P.arrayBuffer().then(F);
}, "image/png");
- })), w += 1, w == c && (_.viewChangeCallback = k, Promise.all($).then((F) => {
- let R = [];
- for (let V = 0; V < F.length; V++) {
- let G = (0, M.decode)(F[V]);
- R.push((0, M.toRGBA8)(G)[0]);
+ })), w += 1, w == c && (v.viewChangeCallback = k, Promise.all($).then((F) => {
+ let P = [];
+ for (let H = 0; H < F.length; H++) {
+ let N = (0, M.decode)(F[H]);
+ P.push((0, M.toRGBA8)(N)[0]);
}
- let P = _.getCanvas().width, U = _.getCanvas().height, N = (0, M.encode)(R, P, U, 0, L), B = new Blob([N], { type: "image/png" }), W = new FileReader();
- W.onload = function(V) {
- E(V.target.result);
- }, W.readAsDataURL(B);
+ let B = v.getCanvas().width, G = v.getCanvas().height, U = (0, M.encode)(P, B, G, 0, L), R = new Blob([U], { type: "image/png" }), W = new FileReader();
+ W.onload = function(H) {
+ E(H.target.result);
+ }, W.readAsDataURL(R);
}));
};
});
@@ -23287,39 +23309,39 @@ ATOM`, b);
setHoverDuration(c) {
this.hoverDuration = c;
}
- mouseXY(c, _) {
- let E = this.canvasOffset(), w = this.renderer.getXRatio(), k = this.renderer.getYRatio(), $ = this.col, L = this.row, z = $ * (this.WIDTH / w), F = (k - L - 1) * (this.HEIGHT / k), R = (c - E.left - z) / (this.WIDTH / w) * 2 - 1, P = -((_ - E.top - F) / (this.HEIGHT / k)) * 2 + 1;
- return { x: R, y: P };
+ mouseXY(c, v) {
+ let E = this.canvasOffset(), w = this.renderer.getXRatio(), k = this.renderer.getYRatio(), $ = this.col, L = this.row, I = $ * (this.WIDTH / w), F = (k - L - 1) * (this.HEIGHT / k), P = (c - E.left - I) / (this.WIDTH / w) * 2 - 1, B = -((v - E.top - F) / (this.HEIGHT / k)) * 2 + 1;
+ return { x: P, y: B };
}
_handleMouseMove(c) {
clearTimeout(this.hoverTimeout), c.preventDefault();
- let _ = this.getX(c), E = this.getY(c);
- if (_ === void 0)
+ let v = this.getX(c), E = this.getY(c);
+ if (v === void 0)
return;
- let w = this.renderer.getXRatio(), k = this.renderer.getYRatio(), $ = this.mouseXY(_, E), L = this;
+ let w = this.renderer.getXRatio(), k = this.renderer.getYRatio(), $ = this.mouseXY(v, E), L = this;
this.current_hover !== null && this.handleHoverContinue($.x, $.y);
- var z = 0;
- if (!(!this.control_all && !this.isInViewer(_, E)) && this.scene && (this.hoverables.length > 0 && (this.hoverTimeout = setTimeout(function() {
+ var I = 0;
+ if (!(!this.control_all && !this.isInViewer(v, E)) && this.scene && (this.hoverables.length > 0 && (this.hoverTimeout = setTimeout(function() {
L.handleHoverSelection($.x, $.y, c);
}, this.hoverDuration)), !!this.isDragging)) {
c.targetTouches && (c.targetTouches.length > 1 || c.targetTouches.length === 1 && !this.closeEnoughForClick(c)) && clearTimeout(this.longTouchTimeout);
- var F = (_ - this.mouseStartX) / this.WIDTH, R = (E - this.mouseStartY) / this.HEIGHT;
+ var F = (v - this.mouseStartX) / this.WIDTH, P = (E - this.mouseStartY) / this.HEIGHT;
if (this.touchDistanceStart != 0 && c.targetTouches && c.targetTouches.length == 2) {
- var P = this.calcTouchDistance(c);
- z = 2, R = (P - this.touchDistanceStart) * 2 / (this.WIDTH + this.HEIGHT);
- } else c.targetTouches && c.targetTouches.length == 3 && (z = 1);
- F *= w, R *= k;
- var U = Math.hypot(F, R), N;
- if (z == 3 || this.mouseButton == 3 && c.ctrlKey)
- this.slabNear = this.cslabNear + F * 100, this.slabFar = this.cslabFar - R * 100;
- else if (z == 2 || this.mouseButton == 3 || c.shiftKey)
- N = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, N < 80 && (N = 80), this.rotationGroup.position.z = this.cz + R * N, this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z);
- else if (z == 1 || this.mouseButton == 2 || c.ctrlKey) {
- var B = this.screenOffsetToModel(w * (_ - this.mouseStartX), k * (E - this.mouseStartY));
- this.modelGroup.position.addVectors(this.currentModelPos, B);
- } else if ((z === 0 || this.mouseButton == 1) && U !== 0) {
- var W = Math.sin(U * Math.PI) / U;
- this.dq.x = Math.cos(U * Math.PI), this.dq.y = 0, this.dq.z = W * F, this.dq.w = -W * R, this.rotationGroup.quaternion.set(1, 0, 0, 0), this.rotationGroup.quaternion.multiply(this.dq), this.rotationGroup.quaternion.multiply(this.cq);
+ var B = this.calcTouchDistance(c);
+ I = 2, P = (B - this.touchDistanceStart) * 2 / (this.WIDTH + this.HEIGHT);
+ } else c.targetTouches && c.targetTouches.length == 3 && (I = 1);
+ F *= w, P *= k;
+ var G = Math.hypot(F, P), U;
+ if (I == 3 || this.mouseButton == 3 && c.ctrlKey)
+ this.slabNear = this.cslabNear + F * 100, this.slabFar = this.cslabFar - P * 100;
+ else if (I == 2 || this.mouseButton == 3 || c.shiftKey)
+ U = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, U < 80 && (U = 80), this.rotationGroup.position.z = this.cz + P * U, this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z);
+ else if (I == 1 || this.mouseButton == 2 || c.ctrlKey) {
+ var R = this.screenOffsetToModel(w * (v - this.mouseStartX), k * (E - this.mouseStartY));
+ this.modelGroup.position.addVectors(this.currentModelPos, R);
+ } else if ((I === 0 || this.mouseButton == 1) && G !== 0) {
+ var W = Math.sin(G * Math.PI) / G;
+ this.dq.x = Math.cos(G * Math.PI), this.dq.y = 0, this.dq.z = W * F, this.dq.w = -W * P, this.rotationGroup.quaternion.set(1, 0, 0, 0), this.rotationGroup.quaternion.multiply(this.dq), this.rotationGroup.quaternion.multiply(this.cq);
}
this.show();
}
@@ -23327,11 +23349,11 @@ ATOM`, b);
_handleContextMenu(c) {
if (c.preventDefault(), this.closeEnoughForClick(c)) {
var w = this.mouseStartX, k = this.mouseStartY, E = this.canvasOffset();
- let $ = this.mouseXY(w, k), L = $.x, z = $.y, F = this.targetedObjects(L, z, this.contextMenuEnabledObjects);
- var _ = null;
- F.length && (_ = F[0].clickable);
+ let $ = this.mouseXY(w, k), L = $.x, I = $.y, F = this.targetedObjects(L, I, this.contextMenuEnabledObjects);
+ var v = null;
+ F.length && (v = F[0].clickable);
var E = this.canvasOffset(), w = this.mouseStartX - E.left, k = this.mouseStartY - E.top;
- this.userContextMenuHandler && (this.userContextMenuHandler(_, w, k, F, c), this.isDragging = !1);
+ this.userContextMenuHandler && (this.userContextMenuHandler(v, w, k, F, c), this.isDragging = !1);
}
}
/**
@@ -23343,8 +23365,8 @@ ATOM`, b);
*/
setContainer(c) {
- let _ = (0, h.getElement)(c) || this.container;
- return this.initContainer(_), this;
+ let v = (0, h.getElement)(c) || this.container;
+ return this.initContainer(v), this;
}
/**
* Set the background color (default white)
@@ -23361,10 +23383,10 @@ ATOM`, b);
*
*/
- setBackgroundColor(c, _) {
- (typeof _ > "u" || _ < 0 || _ > 1) && (_ = 1);
+ setBackgroundColor(c, v) {
+ (typeof v > "u" || v < 0 || v > 1) && (v = 1);
var E = s.CC.color(c);
- return this.scene.fog.color = E, this.bgColor = E.getHex(), this.renderer.setClearColorHex(E.getHex(), _), this.show(), this;
+ return this.scene.fog.color = E, this.bgColor = E.getHex(), this.renderer.setClearColorHex(E.getHex(), v), this.show(), this;
}
/**
* Set view projection scheme. Either orthographic or perspective.
@@ -23406,8 +23428,8 @@ ATOM`, b);
*/
setViewStyle(c) {
if (c = c || {}, c.style = c.style || "", c.style.includes("outline") ? this.renderer.enableOutline(c) : this.renderer.disableOutline(), c.style.includes("ambientOcclusion")) {
- var _ = {};
- c.strength && (_.strength = c.strength), c.radius && (_.radius = c.radius), this.renderer.enableAmbientOcclusion(_);
+ var v = {};
+ c.strength && (v.strength = c.strength), c.radius && (v.radius = c.radius), this.renderer.enableAmbientOcclusion(v);
} else
this.renderer.disableAmbientOcclusion();
return this;
@@ -23439,16 +23461,16 @@ ATOM`, b);
this.WIDTH = this.getWidth(), this.HEIGHT = this.getHeight();
let c = !1;
if (this.renderer.isLost() && this.WIDTH > 0 && this.HEIGHT > 0) {
- let _ = !1, E = this.container.querySelector("canvas");
- E && E != this.renderer.getCanvas() ? this.config.canvas = E : (E.remove(), this.config && this.config.canvas != null && (delete this.config.canvas, _ = !0)), this.setupRenderer(), this.initContainer(this.container), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), c = !0, _ && (this.config.canvas = this.renderer.getCanvas());
+ let v = !1, E = this.container.querySelector("canvas");
+ E && E != this.renderer.getCanvas() ? this.config.canvas = E : (E.remove(), this.config && this.config.canvas != null && (delete this.config.canvas, v = !0)), this.setupRenderer(), this.initContainer(this.container), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), c = !0, v && (this.config.canvas = this.renderer.getCanvas());
}
if (this.WIDTH == 0 || this.HEIGHT == 0 ? this.animated && this._viewer.pauseAnimate() : this.animated && this._viewer.resumeAnimate(), this.updateSize(), c) {
- let _ = this.renderer.supportedExtensions();
- if (_.regen = !0, this.viewers)
+ let v = this.renderer.supportedExtensions();
+ if (v.regen = !0, this.viewers)
for (let E = 0, w = this.viewers.length; E < w; E++)
for (let k = 0, $ = this.viewers[E].length; k < $; k++)
- this.viewers[E][k].render(null, _);
- this._viewer.render(null, _);
+ this.viewers[E][k].render(null, v);
+ this._viewer.render(null, v);
} else
this.show();
return this;
@@ -23488,7 +23510,7 @@ ATOM`, b);
* value reverses the direction of the spin.
*
*/
- spin(c, _ = 1) {
+ spin(c, v = 1) {
if (clearInterval(this.spinInterval), typeof c > "u" && (c = "y"), typeof c == "boolean")
if (c)
c = "y";
@@ -23497,7 +23519,7 @@ ATOM`, b);
Array.isArray(c) && (c = { x: c[0], y: c[1], z: c[2] });
var E = this;
this.spinInterval = setInterval(function() {
- !E.getCanvas().isConnected && E.renderer.isLost() && clearInterval(E.spinInterval), E.rotate(1 * _, c);
+ !E.getCanvas().isConnected && E.renderer.isLost() && clearInterval(E.spinInterval), E.rotate(1 * v, c);
}, 25);
}
//animate motion between current position and passed position
@@ -23508,36 +23530,36 @@ ATOM`, b);
//and rotationgroup quaternion
//return array includes final position, but not current
//the returned array includes an animate method
- animateMotion(c, _, E, w, k, $) {
- var L = 20, z = Math.ceil(c / L);
- z < 1 && (z = 1), this.incAnim();
+ animateMotion(c, v, E, w, k, $) {
+ var L = 20, I = Math.ceil(c / L);
+ I < 1 && (I = 1), this.incAnim();
var F = {
mpos: this.modelGroup.position.clone(),
rz: this.rotationGroup.position.z,
rot: this.rotationGroup.quaternion.clone(),
cam: this.lookingAt.clone()
};
- if (_) {
- let U = new Array(z);
- for (let V = 0; V < z; V++) {
- let G = (V + 1) / z, H = { mpos: F.mpos, rz: F.rz, rot: F.rot };
- H.mpos = E.clone().sub(F.mpos).multiplyScalar(G).add(F.mpos), H.rz = F.rz + G * (w - F.rz), H.rot = l.slerp(F.rot, k, G), H.cam = $.clone().sub(F.cam).multiplyScalar(G).add(F.cam), U[V] = H;
+ if (v) {
+ let G = new Array(I);
+ for (let H = 0; H < I; H++) {
+ let N = (H + 1) / I, V = { mpos: F.mpos, rz: F.rz, rot: F.rot };
+ V.mpos = E.clone().sub(F.mpos).multiplyScalar(N).add(F.mpos), V.rz = F.rz + N * (w - F.rz), V.rot = l.slerp(F.rot, k, N), V.cam = $.clone().sub(F.cam).multiplyScalar(N).add(F.cam), G[H] = V;
}
- let N = 0, B = this, W = function() {
- var V = U[N];
- N += 1, B.modelGroup.position = V.mpos, B.rotationGroup.position.z = V.rz, B.rotationGroup.quaternion = V.rot, B.camera.lookAt(V.cam), N < U.length ? setTimeout(W, L) : B.decAnim(), B.show();
+ let U = 0, R = this, W = function() {
+ var H = G[U];
+ U += 1, R.modelGroup.position = H.mpos, R.rotationGroup.position.z = H.rz, R.rotationGroup.quaternion = H.rot, R.camera.lookAt(H.cam), U < G.length ? setTimeout(W, L) : R.decAnim(), R.show();
};
setTimeout(W, L);
} else {
- var R = {};
- let U = 1 / z;
- if (E && (R.mpos = E.clone().sub(F.mpos).multiplyScalar(U)), typeof w < "u" && w != null && (R.rz = U * (w - F.rz)), k) {
- var P = l.slerp(F.rot, k, U);
- R.rot = F.rot.clone().inverse().multiply(P);
+ var P = {};
+ let G = 1 / I;
+ if (E && (P.mpos = E.clone().sub(F.mpos).multiplyScalar(G)), typeof w < "u" && w != null && (P.rz = G * (w - F.rz)), k) {
+ var B = l.slerp(F.rot, k, G);
+ P.rot = F.rot.clone().inverse().multiply(B);
}
- $ && (R.cam = $.clone().sub(F.cam).multiplyScalar(U));
- let N = 0, B = this, W = function() {
- N += 1, R.mpos && B.modelGroup.position.add(R.mpos), R.rz && (B.rotationGroup.position.z += R.rz), R.rot && B.rotationGroup.quaternion.multiply(R.rot), R.cam && (B.lookingAt.add(R.cam), B.camera.lookAt(B.lookingAt)), N < z ? setTimeout(W, L) : B.decAnim(), B.show();
+ $ && (P.cam = $.clone().sub(F.cam).multiplyScalar(G));
+ let U = 0, R = this, W = function() {
+ U += 1, P.mpos && R.modelGroup.position.add(P.mpos), P.rz && (R.rotationGroup.position.z += P.rz), P.rot && R.rotationGroup.quaternion.multiply(P.rot), P.cam && (R.lookingAt.add(P.cam), R.camera.lookAt(R.lookingAt)), U < I ? setTimeout(W, L) : R.decAnim(), R.show();
};
setTimeout(W, L);
}
@@ -23565,20 +23587,20 @@ ATOM`, b);
*
*/
- rotate(c, _ = "y", E = 0, w = !1) {
- if (_ == "x" ? _ = { x: 1, y: 0, z: 0 } : _ == "y" ? _ = { x: 0, y: 1, z: 0 } : _ == "z" && (_ = { x: 0, y: 0, z: 1 }), _ == "vx" ? _ = { vx: 1, vy: 0, vz: 0 } : _ == "vy" ? _ = { vx: 0, vy: 1, vz: 0 } : _ == "vz" && (_ = { vx: 0, vy: 0, vz: 1 }), typeof _.vx < "u") {
- var k = new a.Vector3(_.vx, _.vy, _.vz);
- k.applyQuaternion(this.rotationGroup.quaternion), _ = { x: k.x, y: k.y, z: k.z };
- }
- var $ = function(R) {
- var P = Math.sin(R / 2), U = Math.cos(R / 2), N = 0, B = 0, W = 0;
- return N = _.x * P, B = _.y * P, W = _.z * P, new a.Quaternion(N, B, W, U).normalize();
- }, L = Math.PI * c / 180, z = $(L);
+ rotate(c, v = "y", E = 0, w = !1) {
+ if (v == "x" ? v = { x: 1, y: 0, z: 0 } : v == "y" ? v = { x: 0, y: 1, z: 0 } : v == "z" && (v = { x: 0, y: 0, z: 1 }), v == "vx" ? v = { vx: 1, vy: 0, vz: 0 } : v == "vy" ? v = { vx: 0, vy: 1, vz: 0 } : v == "vz" && (v = { vx: 0, vy: 0, vz: 1 }), typeof v.vx < "u") {
+ var k = new a.Vector3(v.vx, v.vy, v.vz);
+ k.applyQuaternion(this.rotationGroup.quaternion), v = { x: k.x, y: k.y, z: k.z };
+ }
+ var $ = function(P) {
+ var B = Math.sin(P / 2), G = Math.cos(P / 2), U = 0, R = 0, W = 0;
+ return U = v.x * B, R = v.y * B, W = v.z * B, new a.Quaternion(U, R, W, G).normalize();
+ }, L = Math.PI * c / 180, I = $(L);
if (E) {
- var F = new a.Quaternion().copy(this.rotationGroup.quaternion).multiply(z);
+ var F = new a.Quaternion().copy(this.rotationGroup.quaternion).multiply(I);
this.animateMotion(E, w, this.modelGroup.position, this.rotationGroup.position.z, F, this.lookingAt);
} else
- this.rotationGroup.quaternion.multiply(z), this.show();
+ this.rotationGroup.quaternion.multiply(I), this.show();
return this;
}
surfacesFinished() {
@@ -23594,23 +23616,23 @@ ATOM`, b);
getView() {
if (!this.modelGroup)
return [0, 0, 0, 0, 0, 0, 0, 1];
- var c = this.modelGroup.position, _ = this.rotationGroup.quaternion;
+ var c = this.modelGroup.position, v = this.rotationGroup.quaternion;
return [
c.x,
c.y,
c.z,
this.rotationGroup.position.z,
- _.x,
- _.y,
- _.z,
- _.w
+ v.x,
+ v.y,
+ v.z,
+ v.w
];
}
/** Sets the view to the specified translation, zoom, and rotation.
*
* @param {Array.} arg Array formatted identically to the return value of getView */
- setView(c, _) {
- return c === void 0 || !(c instanceof Array || c.length !== 8) ? this : !this.modelGroup || !this.rotationGroup ? this : (this.modelGroup.position.x = c[0], this.modelGroup.position.y = c[1], this.modelGroup.position.z = c[2], this.rotationGroup.position.z = c[3], this.rotationGroup.quaternion.x = c[4], this.rotationGroup.quaternion.y = c[5], this.rotationGroup.quaternion.z = c[6], this.rotationGroup.quaternion.w = c[7], typeof c[8] < "u" && (this.rotationGroup.position.x = c[8], this.rotationGroup.position.y = c[9]), this.show(_), this);
+ setView(c, v) {
+ return c === void 0 || !(c instanceof Array || c.length !== 8) ? this : !this.modelGroup || !this.rotationGroup ? this : (this.modelGroup.position.x = c[0], this.modelGroup.position.y = c[1], this.modelGroup.position.z = c[2], this.rotationGroup.position.z = c[3], this.rotationGroup.quaternion.x = c[4], this.rotationGroup.quaternion.y = c[5], this.rotationGroup.quaternion.z = c[6], this.rotationGroup.quaternion.w = c[7], typeof c[8] < "u" && (this.rotationGroup.position.x = c[8], this.rotationGroup.position.y = c[9]), this.show(v), this);
}
// apply styles, models, etc in viewer
/**
@@ -23618,35 +23640,35 @@ ATOM`, b);
* adding/removing models, applying styles, etc.
*
*/
- render(c, _) {
+ render(c, v) {
this.renderer.setViewport(), this.updateClickables();
var E = this.getView();
this.stateChangeCallback && this.stateChangeCallback(this.getInternalState());
var w, k;
- for (_ || (_ = this.renderer.supportedExtensions()), w = 0; w < this.models.length; w++)
- this.models[w] && this.models[w].globj(this.modelGroup, _);
+ for (v || (v = this.renderer.supportedExtensions()), w = 0; w < this.models.length; w++)
+ this.models[w] && this.models[w].globj(this.modelGroup, v);
for (w = 0; w < this.shapes.length; w++)
- this.shapes[w] && (typeof this.shapes[w].frame > "u" || this.viewer_frame < 0 || this.shapes[w].frame < 0 || this.shapes[w].frame == this.viewer_frame ? this.shapes[w].globj(this.modelGroup, _) : this.shapes[w].removegl(this.modelGroup));
+ this.shapes[w] && (typeof this.shapes[w].frame > "u" || this.viewer_frame < 0 || this.shapes[w].frame < 0 || this.shapes[w].frame == this.viewer_frame ? this.shapes[w].globj(this.modelGroup, v) : this.shapes[w].removegl(this.modelGroup));
for (w = 0; w < this.labels.length; w++)
- _.regen && (this.labels[w].dispose(), this.modelGroup.remove(this.labels[w].sprite), this.labels[w].setContext(), this.modelGroup.add(this.labels[w].sprite)), this.labels[w] && typeof this.labels[w].frame < "u" && this.labels[w].frame >= 0 && (this.modelGroup.remove(this.labels[w].sprite), (this.viewer_frame < 0 || this.labels[w].frame == this.viewer_frame) && this.modelGroup.add(this.labels[w].sprite));
+ v.regen && (this.labels[w].dispose(), this.modelGroup.remove(this.labels[w].sprite), this.labels[w].setContext(), this.modelGroup.add(this.labels[w].sprite)), this.labels[w] && typeof this.labels[w].frame < "u" && this.labels[w].frame >= 0 && (this.modelGroup.remove(this.labels[w].sprite), (this.viewer_frame < 0 || this.labels[w].frame == this.viewer_frame) && this.modelGroup.add(this.labels[w].sprite));
for (w in this.surfaces)
if (this.surfaces.hasOwnProperty(w)) {
var $ = this.surfaces[w];
for (k = 0; k < $.length; k++)
if ($.hasOwnProperty(k)) {
var L = $[k].geo;
- if (!$[k].finished || _.regen) {
+ if (!$[k].finished || v.regen) {
L.verticesNeedUpdate = !0, L.elementsNeedUpdate = !0, L.normalsNeedUpdate = !0, L.colorsNeedUpdate = !0, L.buffersNeedUpdate = !0, $[k].mat.needsUpdate = !0, $[k].done && ($[k].finished = !0), $[k].lastGL && this.modelGroup.remove($[k].lastGL);
- var z = null;
- if ($[k].mat instanceof r.LineBasicMaterial ? z = new r.Line(L, $[k].mat) : z = new r.Mesh(L, $[k].mat), $[k].mat.transparent && $[k].mat.opacity == 0 ? z.visible = !1 : z.visible = !0, $[k].symmetries.length > 1 || $[k].symmetries.length == 1 && !$[k].symmetries[k].isIdentity()) {
- var F, R = new r.Object3D();
+ var I = null;
+ if ($[k].mat instanceof r.LineBasicMaterial ? I = new r.Line(L, $[k].mat) : I = new r.Mesh(L, $[k].mat), $[k].mat.transparent && $[k].mat.opacity == 0 ? I.visible = !1 : I.visible = !0, $[k].symmetries.length > 1 || $[k].symmetries.length == 1 && !$[k].symmetries[k].isIdentity()) {
+ var F, P = new r.Object3D();
for (F = 0; F < $[k].symmetries.length; F++) {
- var P = z.clone();
- P.matrix = $[k].symmetries[F], P.matrixAutoUpdate = !1, R.add(P);
+ var B = I.clone();
+ B.matrix = $[k].symmetries[F], B.matrixAutoUpdate = !1, P.add(B);
}
- $[k].lastGL = R, this.modelGroup.add(R);
+ $[k].lastGL = P, this.modelGroup.add(P);
} else
- $[k].lastGL = z, this.modelGroup.add(z);
+ $[k].lastGL = I, this.modelGroup.add(I);
}
}
}
@@ -23656,21 +23678,21 @@ ATOM`, b);
* @return list of models specified by sel
*/
getModelList(c) {
- let _ = [];
+ let v = [];
if (typeof c > "u" || typeof c.model > "u")
for (let w = 0; w < this.models.length; w++)
- this.models[w] && _.push(this.models[w]);
+ this.models[w] && v.push(this.models[w]);
else {
let w = c.model;
Array.isArray(w) || (w = [w]);
for (let k = 0; k < w.length; k++)
if (typeof w[k] == "number") {
var E = w[k];
- E < 0 && (E += this.models.length), _.push(this.models[E]);
+ E < 0 && (E += this.models.length), v.push(this.models[E]);
} else
- _.push(w[k]);
+ v.push(w[k]);
}
- return _;
+ return v;
}
/**
*
@@ -23679,12 +23701,12 @@ ATOM`, b);
* @return {AtomSpec[]}
*/
getAtomsFromSel(c) {
- var _ = [];
+ var v = [];
typeof c > "u" && (c = {});
var E = this.getModelList(c);
for (let w = 0; w < E.length; w++)
- _ = _.concat(E[w].selectedAtoms(c));
- return _;
+ v = v.concat(E[w].selectedAtoms(c));
+ return v;
}
/**
*
@@ -23694,10 +23716,10 @@ ATOM`, b);
* sel
* @return {boolean}
*/
- atomIsSelected(c, _) {
- typeof _ > "u" && (_ = {});
- for (var E = this.getModelList(_), w = 0; w < E.length; w++)
- if (E[w].atomIsSelected(c, _))
+ atomIsSelected(c, v) {
+ typeof v > "u" && (v = {});
+ for (var E = this.getModelList(v), w = 0; w < E.length; w++)
+ if (E[w].atomIsSelected(c, v))
return !0;
return !1;
}
@@ -23716,9 +23738,9 @@ ATOM`, b);
* @return {Array.