diff --git "a/src/backend/gradio_molecule3d/templates/component/index.js" "b/src/backend/gradio_molecule3d/templates/component/index.js" --- "a/src/backend/gradio_molecule3d/templates/component/index.js" +++ "b/src/backend/gradio_molecule3d/templates/component/index.js" @@ -18,18 +18,18 @@ const Block_svelte_svelte_type_style_lang = "", { update_slot_base: update_slot_base$4 } = window.__gradio__svelte__internal; function create_dynamic_element(r) { - let e, t, s; + let e, t, n; const f = ( /*#slots*/ r[17].default - ), _ = create_slot$4( + ), u = create_slot$4( f, r, /*$$scope*/ r[16], null ); - let x = [ + let y = [ { "data-testid": ( /*test_id*/ r[7] @@ -43,14 +43,14 @@ function create_dynamic_element(r) { r[3].join(" ") + " svelte-1t38q2d" } ], h = {}; - for (let u = 0; u < x.length; u += 1) - h = assign$1(h, x[u]); + for (let _ = 0; _ < y.length; _ += 1) + h = assign$1(h, y[_]); return { c() { e = element$d( /*tag*/ r[14] - ), _ && _.c(), set_dynamic_element_data( + ), u && u.c(), set_dynamic_element_data( /*tag*/ r[14] )(e, h), toggle_class$b( @@ -94,100 +94,100 @@ function create_dynamic_element(r) { ), set_style$6(e, "min-width", `calc(min(${/*min_width*/ r[13]}px, 100%))`), set_style$6(e, "border-width", "var(--block-border-width)"); }, - m(u, E) { - insert$l(u, e, E), _ && _.m(e, null), s = !0; + m(_, E) { + insert$l(_, e, E), u && u.m(e, null), n = !0; }, - p(u, E) { - _ && _.p && (!s || E & /*$$scope*/ + p(_, E) { + u && u.p && (!n || E & /*$$scope*/ 65536) && update_slot_base$4( - _, - f, u, + f, + _, /*$$scope*/ - u[16], - s ? get_slot_changes$4( + _[16], + n ? get_slot_changes$4( f, /*$$scope*/ - u[16], + _[16], E, null ) : get_all_dirty_from_scope$4( /*$$scope*/ - u[16] + _[16] ), null ), set_dynamic_element_data( /*tag*/ - u[14] - )(e, h = get_spread_update$1(x, [ - (!s || E & /*test_id*/ + _[14] + )(e, h = get_spread_update$1(y, [ + (!n || E & /*test_id*/ 128) && { "data-testid": ( /*test_id*/ - u[7] + _[7] ) }, - (!s || E & /*elem_id*/ + (!n || E & /*elem_id*/ 4) && { id: ( /*elem_id*/ - u[2] + _[2] ) }, - (!s || E & /*elem_classes*/ + (!n || E & /*elem_classes*/ 8 && t !== (t = "block " + /*elem_classes*/ - u[3].join(" ") + " svelte-1t38q2d")) && { class: t } + _[3].join(" ") + " svelte-1t38q2d")) && { class: t } ])), toggle_class$b( e, "hidden", /*visible*/ - u[10] === !1 + _[10] === !1 ), toggle_class$b( e, "padded", /*padding*/ - u[6] + _[6] ), toggle_class$b( e, "border_focus", /*border_mode*/ - u[5] === "focus" + _[5] === "focus" ), toggle_class$b(e, "hide-container", !/*explicit_call*/ - u[8] && !/*container*/ - u[9]), E & /*height*/ + _[8] && !/*container*/ + _[9]), E & /*height*/ 1 && set_style$6(e, "height", typeof /*height*/ - u[0] == "number" ? ( + _[0] == "number" ? ( /*height*/ - u[0] + "px" + _[0] + "px" ) : void 0), E & /*width*/ 2 && set_style$6(e, "width", typeof /*width*/ - u[1] == "number" ? `calc(min(${/*width*/ - u[1]}px, 100%))` : void 0), E & /*variant*/ + _[1] == "number" ? `calc(min(${/*width*/ + _[1]}px, 100%))` : void 0), E & /*variant*/ 16 && set_style$6( e, "border-style", /*variant*/ - u[4] + _[4] ), E & /*allow_overflow*/ 2048 && set_style$6( e, "overflow", /*allow_overflow*/ - u[11] ? "visible" : "hidden" + _[11] ? "visible" : "hidden" ), E & /*scale*/ 4096 && set_style$6( e, "flex-grow", /*scale*/ - u[12] + _[12] ), E & /*min_width*/ 8192 && set_style$6(e, "min-width", `calc(min(${/*min_width*/ - u[13]}px, 100%))`); + _[13]}px, 100%))`); }, - i(u) { - s || (transition_in$c(_, u), s = !0); + i(_) { + n || (transition_in$c(u, _), n = !0); }, - o(u) { - transition_out$b(_, u), s = !1; + o(_) { + transition_out$b(u, _), n = !1; }, - d(u) { - u && detach$l(e), _ && _.d(u); + d(_) { + _ && detach$l(e), u && u.d(_); } }; } @@ -200,39 +200,39 @@ function create_fragment$l(r) { c() { t && t.c(); }, - m(s, f) { - t && t.m(s, f), e = !0; + m(n, f) { + t && t.m(n, f), e = !0; }, - p(s, [f]) { + p(n, [f]) { /*tag*/ - s[14] && t.p(s, f); + n[14] && t.p(n, f); }, - i(s) { - e || (transition_in$c(t, s), e = !0); + i(n) { + e || (transition_in$c(t, n), e = !0); }, - o(s) { - transition_out$b(t, s), e = !1; + o(n) { + transition_out$b(t, n), e = !1; }, - d(s) { - t && t.d(s); + d(n) { + t && t.d(n); } }; } function instance$f(r, e, t) { - let { $$slots: s = {}, $$scope: f } = e, { height: _ = void 0 } = e, { width: x = void 0 } = e, { elem_id: h = "" } = e, { elem_classes: u = [] } = e, { variant: E = "solid" } = e, { border_mode: c = "base" } = e, { padding: C = !0 } = e, { type: b = "normal" } = e, { test_id: A = void 0 } = e, { explicit_call: S = !1 } = e, { container: n = !0 } = e, { visible: o = !0 } = e, { allow_overflow: w = !0 } = e, { scale: p = null } = e, { min_width: v = 0 } = e, a = b === "fieldset" ? "fieldset" : "div"; + let { $$slots: n = {}, $$scope: f } = e, { height: u = void 0 } = e, { width: y = void 0 } = e, { elem_id: h = "" } = e, { elem_classes: _ = [] } = e, { variant: E = "solid" } = e, { border_mode: c = "base" } = e, { padding: C = !0 } = e, { type: b = "normal" } = e, { test_id: A = void 0 } = e, { explicit_call: S = !1 } = e, { container: s = !0 } = e, { visible: o = !0 } = e, { allow_overflow: w = !0 } = e, { scale: p = null } = e, { min_width: v = 0 } = e, a = b === "fieldset" ? "fieldset" : "div"; return r.$$set = (l) => { - "height" in l && t(0, _ = l.height), "width" in l && t(1, x = l.width), "elem_id" in l && t(2, h = l.elem_id), "elem_classes" in l && t(3, u = l.elem_classes), "variant" in l && t(4, E = l.variant), "border_mode" in l && t(5, c = l.border_mode), "padding" in l && t(6, C = l.padding), "type" in l && t(15, b = l.type), "test_id" in l && t(7, A = l.test_id), "explicit_call" in l && t(8, S = l.explicit_call), "container" in l && t(9, n = l.container), "visible" in l && t(10, o = l.visible), "allow_overflow" in l && t(11, w = l.allow_overflow), "scale" in l && t(12, p = l.scale), "min_width" in l && t(13, v = l.min_width), "$$scope" in l && t(16, f = l.$$scope); + "height" in l && t(0, u = l.height), "width" in l && t(1, y = l.width), "elem_id" in l && t(2, h = l.elem_id), "elem_classes" in l && t(3, _ = l.elem_classes), "variant" in l && t(4, E = l.variant), "border_mode" in l && t(5, c = l.border_mode), "padding" in l && t(6, C = l.padding), "type" in l && t(15, b = l.type), "test_id" in l && t(7, A = l.test_id), "explicit_call" in l && t(8, S = l.explicit_call), "container" in l && t(9, s = l.container), "visible" in l && t(10, o = l.visible), "allow_overflow" in l && t(11, w = l.allow_overflow), "scale" in l && t(12, p = l.scale), "min_width" in l && t(13, v = l.min_width), "$$scope" in l && t(16, f = l.$$scope); }, [ - _, - x, - h, u, + y, + h, + _, E, c, C, A, S, - n, + s, o, w, p, @@ -240,7 +240,7 @@ function instance$f(r, e, t) { a, b, f, - s + n ]; } class Block extends SvelteComponent$l { @@ -284,11 +284,11 @@ const Info_svelte_svelte_type_style_lang = "", BlockTitle_svelte_svelte_type_sty transition_out: transition_out$a } = window.__gradio__svelte__internal; function create_fragment$k(r) { - let e, t, s, f, _, x; - return s = new /*Icon*/ + let e, t, n, f, u, y; + return n = new /*Icon*/ r[1]({}), { c() { - e = element$c("label"), t = element$c("span"), create_component$8(s.$$.fragment), f = space$b(), _ = text$7( + e = element$c("label"), t = element$c("span"), create_component$8(n.$$.fragment), f = space$b(), u = text$7( /*label*/ r[0] ), attr$i(t, "class", "svelte-9gxdi0"), attr$i(e, "for", ""), attr$i(e, "data-testid", "block-label"), attr$i(e, "class", "svelte-9gxdi0"), toggle_class$a(e, "hide", !/*show_label*/ @@ -305,26 +305,26 @@ function create_fragment$k(r) { r[3] ); }, - m(h, u) { - insert$k(h, e, u), append$i(e, t), mount_component$8(s, t, null), append$i(e, f), append$i(e, _), x = !0; + m(h, _) { + insert$k(h, e, _), append$i(e, t), mount_component$8(n, t, null), append$i(e, f), append$i(e, u), y = !0; }, - p(h, [u]) { - (!x || u & /*label*/ + p(h, [_]) { + (!y || _ & /*label*/ 1) && set_data$7( - _, + u, /*label*/ h[0] - ), (!x || u & /*show_label*/ + ), (!y || _ & /*show_label*/ 4) && toggle_class$a(e, "hide", !/*show_label*/ - h[2]), (!x || u & /*show_label*/ + h[2]), (!y || _ & /*show_label*/ 4) && toggle_class$a(e, "sr-only", !/*show_label*/ - h[2]), (!x || u & /*float*/ + h[2]), (!y || _ & /*float*/ 16) && toggle_class$a( e, "float", /*float*/ h[4] - ), (!x || u & /*disable*/ + ), (!y || _ & /*disable*/ 8) && toggle_class$a( e, "hide-label", @@ -333,21 +333,21 @@ function create_fragment$k(r) { ); }, i(h) { - x || (transition_in$b(s.$$.fragment, h), x = !0); + y || (transition_in$b(n.$$.fragment, h), y = !0); }, o(h) { - transition_out$a(s.$$.fragment, h), x = !1; + transition_out$a(n.$$.fragment, h), y = !1; }, d(h) { - h && detach$k(e), destroy_component$8(s); + h && detach$k(e), destroy_component$8(n); } }; } function instance$e(r, e, t) { - let { label: s = null } = e, { Icon: f } = e, { show_label: _ = !0 } = e, { disable: x = !1 } = e, { float: h = !0 } = e; - return r.$$set = (u) => { - "label" in u && t(0, s = u.label), "Icon" in u && t(1, f = u.Icon), "show_label" in u && t(2, _ = u.show_label), "disable" in u && t(3, x = u.disable), "float" in u && t(4, h = u.float); - }, [s, f, _, x, h]; + let { label: n = null } = e, { Icon: f } = e, { show_label: u = !0 } = e, { disable: y = !1 } = e, { float: h = !0 } = e; + return r.$$set = (_) => { + "label" in _ && t(0, n = _.label), "Icon" in _ && t(1, f = _.Icon), "show_label" in _ && t(2, u = _.show_label), "disable" in _ && t(3, y = _.disable), "float" in _ && t(4, h = _.float); + }, [n, f, u, y, h]; } class BlockLabel extends SvelteComponent$k { constructor(e) { @@ -390,37 +390,37 @@ function create_if_block$9(r) { r[1] ), attr$h(e, "class", "svelte-xtz2g8"); }, - m(s, f) { - insert$j(s, e, f), append$h(e, t); + m(n, f) { + insert$j(n, e, f), append$h(e, t); }, - p(s, f) { + p(n, f) { f & /*label*/ 2 && set_data$6( t, /*label*/ - s[1] + n[1] ); }, - d(s) { - s && detach$j(e); + d(n) { + n && detach$j(e); } }; } function create_fragment$j(r) { - let e, t, s, f, _, x, h, u = ( + let e, t, n, f, u, y, h, _ = ( /*show_label*/ r[2] && create_if_block$9(r) ); return f = new /*Icon*/ r[0]({}), { c() { - e = element$b("button"), u && u.c(), t = space$a(), s = element$b("div"), create_component$7(f.$$.fragment), attr$h(s, "class", "svelte-xtz2g8"), toggle_class$9( - s, + e = element$b("button"), _ && _.c(), t = space$a(), n = element$b("div"), create_component$7(f.$$.fragment), attr$h(n, "class", "svelte-xtz2g8"), toggle_class$9( + n, "small", /*size*/ r[4] === "small" ), toggle_class$9( - s, + n, "large", /*size*/ r[4] === "large" @@ -447,46 +447,46 @@ function create_fragment$j(r) { ); }, m(E, c) { - insert$j(E, e, c), u && u.m(e, null), append$h(e, t), append$h(e, s), mount_component$7(f, s, null), _ = !0, x || (h = listen$4( + insert$j(E, e, c), _ && _.m(e, null), append$h(e, t), append$h(e, n), mount_component$7(f, n, null), u = !0, y || (h = listen$4( e, "click", /*click_handler*/ r[6] - ), x = !0); + ), y = !0); }, p(E, [c]) { /*show_label*/ - E[2] ? u ? u.p(E, c) : (u = create_if_block$9(E), u.c(), u.m(e, t)) : u && (u.d(1), u = null), (!_ || c & /*size*/ + E[2] ? _ ? _.p(E, c) : (_ = create_if_block$9(E), _.c(), _.m(e, t)) : _ && (_.d(1), _ = null), (!u || c & /*size*/ 16) && toggle_class$9( - s, + n, "small", /*size*/ E[4] === "small" - ), (!_ || c & /*size*/ + ), (!u || c & /*size*/ 16) && toggle_class$9( - s, + n, "large", /*size*/ E[4] === "large" - ), (!_ || c & /*label*/ + ), (!u || c & /*label*/ 2) && attr$h( e, "aria-label", /*label*/ E[1] - ), (!_ || c & /*label*/ + ), (!u || c & /*label*/ 2) && attr$h( e, "title", /*label*/ E[1] - ), (!_ || c & /*pending*/ + ), (!u || c & /*pending*/ 8) && toggle_class$9( e, "pending", /*pending*/ E[3] - ), (!_ || c & /*padded*/ + ), (!u || c & /*padded*/ 32) && toggle_class$9( e, "padded", @@ -495,24 +495,24 @@ function create_fragment$j(r) { ); }, i(E) { - _ || (transition_in$a(f.$$.fragment, E), _ = !0); + u || (transition_in$a(f.$$.fragment, E), u = !0); }, o(E) { - transition_out$9(f.$$.fragment, E), _ = !1; + transition_out$9(f.$$.fragment, E), u = !1; }, d(E) { - E && detach$j(e), u && u.d(), destroy_component$7(f), x = !1, h(); + E && detach$j(e), _ && _.d(), destroy_component$7(f), y = !1, h(); } }; } function instance$d(r, e, t) { - let { Icon: s } = e, { label: f = "" } = e, { show_label: _ = !1 } = e, { pending: x = !1 } = e, { size: h = "small" } = e, { padded: u = !0 } = e; + let { Icon: n } = e, { label: f = "" } = e, { show_label: u = !1 } = e, { pending: y = !1 } = e, { size: h = "small" } = e, { padded: _ = !0 } = e; function E(c) { bubble$3.call(this, r, c); } return r.$$set = (c) => { - "Icon" in c && t(0, s = c.Icon), "label" in c && t(1, f = c.label), "show_label" in c && t(2, _ = c.show_label), "pending" in c && t(3, x = c.pending), "size" in c && t(4, h = c.size), "padded" in c && t(5, u = c.padded); - }, [s, f, _, x, h, u, E]; + "Icon" in c && t(0, n = c.Icon), "label" in c && t(1, f = c.label), "show_label" in c && t(2, u = c.show_label), "pending" in c && t(3, y = c.pending), "size" in c && t(4, h = c.size), "padded" in c && t(5, _ = c.padded); + }, [n, f, u, y, h, _, E]; } class IconButton extends SvelteComponent$j { constructor(e) { @@ -545,11 +545,11 @@ const Empty_svelte_svelte_type_style_lang = "", { update_slot_base: update_slot_base$3 } = window.__gradio__svelte__internal; function create_fragment$i(r) { - let e, t, s; + let e, t, n; const f = ( /*#slots*/ r[5].default - ), _ = create_slot$3( + ), u = create_slot$3( f, r, /*$$scope*/ @@ -558,7 +558,7 @@ function create_fragment$i(r) { ); return { c() { - e = element$a("div"), t = element$a("div"), _ && _.c(), attr$g(t, "class", "icon svelte-3w3rth"), attr$g(e, "class", "empty svelte-3w3rth"), attr$g(e, "aria-label", "Empty value"), toggle_class$8( + e = element$a("div"), t = element$a("div"), u && u.c(), attr$g(t, "class", "icon svelte-3w3rth"), attr$g(e, "class", "empty svelte-3w3rth"), attr$g(e, "aria-label", "Empty value"), toggle_class$8( e, "small", /*size*/ @@ -580,77 +580,77 @@ function create_fragment$i(r) { r[3] ); }, - m(x, h) { - insert$i(x, e, h), append$g(e, t), _ && _.m(t, null), r[6](e), s = !0; + m(y, h) { + insert$i(y, e, h), append$g(e, t), u && u.m(t, null), r[6](e), n = !0; }, - p(x, [h]) { - _ && _.p && (!s || h & /*$$scope*/ + p(y, [h]) { + u && u.p && (!n || h & /*$$scope*/ 16) && update_slot_base$3( - _, + u, f, - x, + y, /*$$scope*/ - x[4], - s ? get_slot_changes$3( + y[4], + n ? get_slot_changes$3( f, /*$$scope*/ - x[4], + y[4], h, null ) : get_all_dirty_from_scope$3( /*$$scope*/ - x[4] + y[4] ), null - ), (!s || h & /*size*/ + ), (!n || h & /*size*/ 1) && toggle_class$8( e, "small", /*size*/ - x[0] === "small" - ), (!s || h & /*size*/ + y[0] === "small" + ), (!n || h & /*size*/ 1) && toggle_class$8( e, "large", /*size*/ - x[0] === "large" - ), (!s || h & /*unpadded_box*/ + y[0] === "large" + ), (!n || h & /*unpadded_box*/ 2) && toggle_class$8( e, "unpadded_box", /*unpadded_box*/ - x[1] - ), (!s || h & /*parent_height*/ + y[1] + ), (!n || h & /*parent_height*/ 8) && toggle_class$8( e, "small_parent", /*parent_height*/ - x[3] + y[3] ); }, - i(x) { - s || (transition_in$9(_, x), s = !0); + i(y) { + n || (transition_in$9(u, y), n = !0); }, - o(x) { - transition_out$8(_, x), s = !1; + o(y) { + transition_out$8(u, y), n = !1; }, - d(x) { - x && detach$i(e), _ && _.d(x), r[6](null); + d(y) { + y && detach$i(e), u && u.d(y), r[6](null); } }; } function _optionalChain$1(r) { - let e, t = r[0], s = 1; - for (; s < r.length; ) { - const f = r[s], _ = r[s + 1]; - if (s += 2, (f === "optionalAccess" || f === "optionalCall") && t == null) + let e, t = r[0], n = 1; + for (; n < r.length; ) { + const f = r[n], u = r[n + 1]; + if (n += 2, (f === "optionalAccess" || f === "optionalCall") && t == null) return; - f === "access" || f === "optionalAccess" ? (e = t, t = _(t)) : (f === "call" || f === "optionalCall") && (t = _((...x) => t.call(e, ...x)), e = void 0); + f === "access" || f === "optionalAccess" ? (e = t, t = u(t)) : (f === "call" || f === "optionalCall") && (t = u((...y) => t.call(e, ...y)), e = void 0); } return t; } function instance$c(r, e, t) { - let s, { $$slots: f = {}, $$scope: _ } = e, { size: x = "small" } = e, { unpadded_box: h = !1 } = e, u; + let n, { $$slots: f = {}, $$scope: u } = e, { size: y = "small" } = e, { unpadded_box: h = !1 } = e, _; function E(C) { if (!C) return !1; @@ -667,15 +667,15 @@ function instance$c(r, e, t) { } function c(C) { binding_callbacks$4[C ? "unshift" : "push"](() => { - u = C, t(2, u); + _ = C, t(2, _); }); } return r.$$set = (C) => { - "size" in C && t(0, x = C.size), "unpadded_box" in C && t(1, h = C.unpadded_box), "$$scope" in C && t(4, _ = C.$$scope); + "size" in C && t(0, y = C.size), "unpadded_box" in C && t(1, h = C.unpadded_box), "$$scope" in C && t(4, u = C.$$scope); }, r.$$.update = () => { r.$$.dirty & /*el*/ - 4 && t(3, s = E(u)); - }, [x, h, u, s, _, f, c]; + 4 && t(3, n = E(_)); + }, [y, h, _, n, u, f, c]; } class Empty extends SvelteComponent$i { constructor(e) { @@ -695,19 +695,19 @@ const { svg_element: svg_element$8 } = window.__gradio__svelte__internal; function create_fragment$h(r) { - let e, t, s, f; + let e, t, n, f; return { c() { - e = svg_element$8("svg"), t = svg_element$8("g"), s = svg_element$8("path"), f = svg_element$8("path"), attr$f(s, "d", "M18,6L6.087,17.913"), set_style$5(s, "fill", "none"), set_style$5(s, "fill-rule", "nonzero"), set_style$5(s, "stroke-width", "2px"), attr$f(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), attr$f(f, "d", "M4.364,4.364L19.636,19.636"), set_style$5(f, "fill", "none"), set_style$5(f, "fill-rule", "nonzero"), set_style$5(f, "stroke-width", "2px"), attr$f(e, "width", "100%"), attr$f(e, "height", "100%"), attr$f(e, "viewBox", "0 0 24 24"), attr$f(e, "version", "1.1"), attr$f(e, "xmlns", "http://www.w3.org/2000/svg"), attr$f(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), attr$f(e, "xml:space", "preserve"), attr$f(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"); + e = svg_element$8("svg"), t = svg_element$8("g"), n = svg_element$8("path"), f = svg_element$8("path"), attr$f(n, "d", "M18,6L6.087,17.913"), set_style$5(n, "fill", "none"), set_style$5(n, "fill-rule", "nonzero"), set_style$5(n, "stroke-width", "2px"), attr$f(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), attr$f(f, "d", "M4.364,4.364L19.636,19.636"), set_style$5(f, "fill", "none"), set_style$5(f, "fill-rule", "nonzero"), set_style$5(f, "stroke-width", "2px"), attr$f(e, "width", "100%"), attr$f(e, "height", "100%"), attr$f(e, "viewBox", "0 0 24 24"), attr$f(e, "version", "1.1"), attr$f(e, "xmlns", "http://www.w3.org/2000/svg"), attr$f(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), attr$f(e, "xml:space", "preserve"), attr$f(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(_, x) { - insert$h(_, e, x), append$f(e, t), append$f(t, s), append$f(e, f); + m(u, y) { + insert$h(u, e, y), append$f(e, t), append$f(t, n), append$f(e, f); }, p: noop$c, i: noop$c, o: noop$c, - d(_) { - _ && detach$h(e); + d(u) { + u && detach$h(e); } }; } @@ -733,14 +733,14 @@ function create_fragment$g(r) { c() { e = svg_element$7("svg"), t = svg_element$7("path"), attr$e(t, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), attr$e(e, "xmlns", "http://www.w3.org/2000/svg"), attr$e(e, "width", "100%"), attr$e(e, "height", "100%"), attr$e(e, "viewBox", "0 0 24 24"), attr$e(e, "fill", "none"), attr$e(e, "stroke", "currentColor"), attr$e(e, "stroke-width", "1.5"), attr$e(e, "stroke-linecap", "round"), attr$e(e, "stroke-linejoin", "round"), attr$e(e, "class", "feather feather-edit-2"); }, - m(s, f) { - insert$g(s, e, f), append$e(e, t); + m(n, f) { + insert$g(n, e, f), append$e(e, t); }, p: noop$b, i: noop$b, o: noop$b, - d(s) { - s && detach$g(e); + d(n) { + n && detach$g(e); } }; } @@ -761,13 +761,13 @@ const { svg_element: svg_element$6 } = window.__gradio__svelte__internal; function create_fragment$f(r) { - let e, t, s; + let e, t, n; return { c() { - e = svg_element$6("svg"), t = svg_element$6("path"), s = svg_element$6("polyline"), attr$d(t, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), attr$d(s, "points", "13 2 13 9 20 9"), attr$d(e, "xmlns", "http://www.w3.org/2000/svg"), attr$d(e, "width", "100%"), attr$d(e, "height", "100%"), attr$d(e, "viewBox", "0 0 24 24"), attr$d(e, "fill", "none"), attr$d(e, "stroke", "currentColor"), attr$d(e, "stroke-width", "1.5"), attr$d(e, "stroke-linecap", "round"), attr$d(e, "stroke-linejoin", "round"), attr$d(e, "class", "feather feather-file"); + e = svg_element$6("svg"), t = svg_element$6("path"), n = svg_element$6("polyline"), attr$d(t, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), attr$d(n, "points", "13 2 13 9 20 9"), attr$d(e, "xmlns", "http://www.w3.org/2000/svg"), attr$d(e, "width", "100%"), attr$d(e, "height", "100%"), attr$d(e, "viewBox", "0 0 24 24"), attr$d(e, "fill", "none"), attr$d(e, "stroke", "currentColor"), attr$d(e, "stroke-width", "1.5"), attr$d(e, "stroke-linecap", "round"), attr$d(e, "stroke-linejoin", "round"), attr$d(e, "class", "feather feather-file"); }, - m(f, _) { - insert$f(f, e, _), append$d(e, t), append$d(e, s); + m(f, u) { + insert$f(f, e, u), append$d(e, t), append$d(e, n); }, p: noop$a, i: noop$a, @@ -794,13 +794,13 @@ const { svg_element: svg_element$5 } = window.__gradio__svelte__internal; function create_fragment$e(r) { - let e, t, s; + let e, t, n; return { c() { - e = svg_element$5("svg"), t = svg_element$5("polyline"), s = svg_element$5("path"), attr$c(t, "points", "1 4 1 10 7 10"), attr$c(s, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), attr$c(e, "xmlns", "http://www.w3.org/2000/svg"), attr$c(e, "width", "100%"), attr$c(e, "height", "100%"), attr$c(e, "viewBox", "0 0 24 24"), attr$c(e, "fill", "none"), attr$c(e, "stroke", "currentColor"), attr$c(e, "stroke-width", "2"), attr$c(e, "stroke-linecap", "round"), attr$c(e, "stroke-linejoin", "round"), attr$c(e, "class", "feather feather-rotate-ccw"); + e = svg_element$5("svg"), t = svg_element$5("polyline"), n = svg_element$5("path"), attr$c(t, "points", "1 4 1 10 7 10"), attr$c(n, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), attr$c(e, "xmlns", "http://www.w3.org/2000/svg"), attr$c(e, "width", "100%"), attr$c(e, "height", "100%"), attr$c(e, "viewBox", "0 0 24 24"), attr$c(e, "fill", "none"), attr$c(e, "stroke", "currentColor"), attr$c(e, "stroke-width", "2"), attr$c(e, "stroke-linecap", "round"), attr$c(e, "stroke-linejoin", "round"), attr$c(e, "class", "feather feather-rotate-ccw"); }, - m(f, _) { - insert$e(f, e, _), append$c(e, t), append$c(e, s); + m(f, u) { + insert$e(f, e, u), append$c(e, t), append$c(e, n); }, p: noop$9, i: noop$9, @@ -827,19 +827,19 @@ const { svg_element: svg_element$4 } = window.__gradio__svelte__internal; function create_fragment$d(r) { - let e, t, s, f; + let e, t, n, f; return { c() { - e = svg_element$4("svg"), t = svg_element$4("path"), s = svg_element$4("polyline"), f = svg_element$4("line"), attr$b(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), attr$b(s, "points", "17 8 12 3 7 8"), attr$b(f, "x1", "12"), attr$b(f, "y1", "3"), attr$b(f, "x2", "12"), attr$b(f, "y2", "15"), attr$b(e, "xmlns", "http://www.w3.org/2000/svg"), attr$b(e, "width", "90%"), attr$b(e, "height", "90%"), attr$b(e, "viewBox", "0 0 24 24"), attr$b(e, "fill", "none"), attr$b(e, "stroke", "currentColor"), attr$b(e, "stroke-width", "2"), attr$b(e, "stroke-linecap", "round"), attr$b(e, "stroke-linejoin", "round"), attr$b(e, "class", "feather feather-upload"); + e = svg_element$4("svg"), t = svg_element$4("path"), n = svg_element$4("polyline"), f = svg_element$4("line"), attr$b(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), attr$b(n, "points", "17 8 12 3 7 8"), attr$b(f, "x1", "12"), attr$b(f, "y1", "3"), attr$b(f, "x2", "12"), attr$b(f, "y2", "15"), attr$b(e, "xmlns", "http://www.w3.org/2000/svg"), attr$b(e, "width", "90%"), attr$b(e, "height", "90%"), attr$b(e, "viewBox", "0 0 24 24"), attr$b(e, "fill", "none"), attr$b(e, "stroke", "currentColor"), attr$b(e, "stroke-width", "2"), attr$b(e, "stroke-linecap", "round"), attr$b(e, "stroke-linejoin", "round"), attr$b(e, "class", "feather feather-upload"); }, - m(_, x) { - insert$d(_, e, x), append$b(e, t), append$b(e, s), append$b(e, f); + m(u, y) { + insert$d(u, e, y), append$b(e, t), append$b(e, n), append$b(e, f); }, p: noop$8, i: noop$8, o: noop$8, - d(_) { - _ && detach$d(e); + d(u) { + u && detach$d(e); } }; } @@ -1153,11 +1153,11 @@ const color_values = [ } }; color_values.reduce( - (r, { color: e, primary: t, secondary: s }) => ({ + (r, { color: e, primary: t, secondary: n }) => ({ ...r, [e]: { primary: tw_colors[e][t], - secondary: tw_colors[e][s] + secondary: tw_colors[e][n] } }), {} @@ -1182,36 +1182,36 @@ const UploadText_svelte_svelte_type_style_lang = "", { transition_out: transition_out$7 } = window.__gradio__svelte__internal; function create_if_block$8(r) { - let e, t, s = ( + let e, t, n = ( /*i18n*/ r[1]("common.or") + "" - ), f, _, x, h = ( + ), f, u, y, h = ( /*message*/ (r[2] || /*i18n*/ r[1]("upload_text.click_to_upload")) + "" - ), u; + ), _; return { c() { - e = element$9("span"), t = text$5("- "), f = text$5(s), _ = text$5(" -"), x = space$9(), u = text$5(h), attr$a(e, "class", "or svelte-kzcjhc"); + e = element$9("span"), t = text$5("- "), f = text$5(n), u = text$5(" -"), y = space$9(), _ = text$5(h), attr$a(e, "class", "or svelte-kzcjhc"); }, m(E, c) { - insert$c(E, e, c), append$a(e, t), append$a(e, f), append$a(e, _), insert$c(E, x, c), insert$c(E, u, c); + insert$c(E, e, c), append$a(e, t), append$a(e, f), append$a(e, u), insert$c(E, y, c), insert$c(E, _, c); }, p(E, c) { c & /*i18n*/ - 2 && s !== (s = /*i18n*/ - E[1]("common.or") + "") && set_data$5(f, s), c & /*message, i18n*/ + 2 && n !== (n = /*i18n*/ + E[1]("common.or") + "") && set_data$5(f, n), c & /*message, i18n*/ 6 && h !== (h = /*message*/ (E[2] || /*i18n*/ - E[1]("upload_text.click_to_upload")) + "") && set_data$5(u, h); + E[1]("upload_text.click_to_upload")) + "") && set_data$5(_, h); }, d(E) { - E && (detach$c(e), detach$c(x), detach$c(u)); + E && (detach$c(e), detach$c(y), detach$c(_)); } }; } function create_fragment$c(r) { - let e, t, s, f, _ = ( + let e, t, n, f, u = ( /*i18n*/ r[1]( /*defs*/ @@ -1221,15 +1221,15 @@ function create_fragment$c(r) { ] || /*defs*/ r[5].file ) + "" - ), x, h, u; - s = new Upload$1({}); + ), y, h, _; + n = new Upload$1({}); let E = ( /*mode*/ r[3] !== "short" && create_if_block$8(r) ); return { c() { - e = element$9("div"), t = element$9("span"), create_component$6(s.$$.fragment), f = space$9(), x = text$5(_), h = space$9(), E && E.c(), attr$a(t, "class", "icon-wrap svelte-kzcjhc"), toggle_class$7( + e = element$9("div"), t = element$9("span"), create_component$6(n.$$.fragment), f = space$9(), y = text$5(u), h = space$9(), E && E.c(), attr$a(t, "class", "icon-wrap svelte-kzcjhc"), toggle_class$7( t, "hovered", /*hovered*/ @@ -1237,17 +1237,17 @@ function create_fragment$c(r) { ), attr$a(e, "class", "wrap svelte-kzcjhc"); }, m(c, C) { - insert$c(c, e, C), append$a(e, t), mount_component$6(s, t, null), append$a(e, f), append$a(e, x), append$a(e, h), E && E.m(e, null), u = !0; + insert$c(c, e, C), append$a(e, t), mount_component$6(n, t, null), append$a(e, f), append$a(e, y), append$a(e, h), E && E.m(e, null), _ = !0; }, p(c, [C]) { - (!u || C & /*hovered*/ + (!_ || C & /*hovered*/ 16) && toggle_class$7( t, "hovered", /*hovered*/ c[4] - ), (!u || C & /*i18n, type*/ - 3) && _ !== (_ = /*i18n*/ + ), (!_ || C & /*i18n, type*/ + 3) && u !== (u = /*i18n*/ c[1]( /*defs*/ c[5][ @@ -1255,23 +1255,23 @@ function create_fragment$c(r) { c[0] ] || /*defs*/ c[5].file - ) + "") && set_data$5(x, _), /*mode*/ + ) + "") && set_data$5(y, u), /*mode*/ c[3] !== "short" ? E ? E.p(c, C) : (E = create_if_block$8(c), E.c(), E.m(e, null)) : E && (E.d(1), E = null); }, i(c) { - u || (transition_in$8(s.$$.fragment, c), u = !0); + _ || (transition_in$8(n.$$.fragment, c), _ = !0); }, o(c) { - transition_out$7(s.$$.fragment, c), u = !1; + transition_out$7(n.$$.fragment, c), _ = !1; }, d(c) { - c && detach$c(e), destroy_component$6(s), E && E.d(); + c && detach$c(e), destroy_component$6(n), E && E.d(); } }; } function instance$b(r, e, t) { - let { type: s = "file" } = e, { i18n: f } = e, { message: _ = void 0 } = e, { mode: x = "full" } = e, { hovered: h = !1 } = e; - const u = { + let { type: n = "file" } = e, { i18n: f } = e, { message: u = void 0 } = e, { mode: y = "full" } = e, { hovered: h = !1 } = e; + const _ = { image: "upload_text.drop_image", video: "upload_text.drop_video", audio: "upload_text.drop_audio", @@ -1279,8 +1279,8 @@ function instance$b(r, e, t) { csv: "upload_text.drop_csv" }; return r.$$set = (E) => { - "type" in E && t(0, s = E.type), "i18n" in E && t(1, f = E.i18n), "message" in E && t(2, _ = E.message), "mode" in E && t(3, x = E.mode), "hovered" in E && t(4, h = E.hovered); - }, [s, f, _, x, h, u]; + "type" in E && t(0, n = E.type), "i18n" in E && t(1, f = E.i18n), "message" in E && t(2, u = E.message), "mode" in E && t(3, y = E.mode), "hovered" in E && t(4, h = E.hovered); + }, [n, f, u, y, h, _]; } class UploadText extends SvelteComponent$c { constructor(e) { @@ -1297,19 +1297,19 @@ const Toolbar_svelte_svelte_type_style_lang = "", prettyBytes = (r) => { let e = ["B", "KB", "MB", "GB", "PB"], t = 0; for (; r > 1024; ) r /= 1024, t++; - let s = e[t]; - return r.toFixed(1) + " " + s; + let n = e[t]; + return r.toFixed(1) + " " + n; }, display_file_name = (r) => { var e; e = r.orig_name; const t = 30; if (e.length > t) { - const s = e.substring(0, t), f = e.lastIndexOf("."); + const n = e.substring(0, t), f = e.lastIndexOf("."); if (f !== -1) { - const _ = e.slice(f); - return `${s}..${_}`; + const u = e.slice(f); + return `${n}..${u}`; } - return s; + return n; } return e; }, display_file_size = (r) => { @@ -1341,8 +1341,8 @@ const Toolbar_svelte_svelte_type_style_lang = "", prettyBytes = (r) => { toggle_class: toggle_class$6 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$4 } = window.__gradio__svelte__internal; function get_each_context$3(r, e, t) { - const s = r.slice(); - return s[6] = e[t], s[8] = t, s; + const n = r.slice(); + return n[6] = e[t], n[8] = t, n; } function create_else_block$6(r) { let e = ( @@ -1353,47 +1353,47 @@ function create_else_block$6(r) { c() { t = text$4(e); }, - m(s, f) { - insert$b(s, t, f); + m(n, f) { + insert$b(n, t, f); }, - p(s, f) { + p(n, f) { f & /*i18n*/ 8 && e !== (e = /*i18n*/ - s[3]("file.uploading") + "") && set_data$4(t, e); + n[3]("file.uploading") + "") && set_data$4(t, e); }, - d(s) { - s && detach$b(t); + d(n) { + n && detach$b(t); } }; } function create_if_block$7(r) { - let e, t, s = display_file_size( + let e, t, n = display_file_size( /*file*/ r[6] - ) + "", f, _, x; + ) + "", f, u, y; return { c() { - e = element$8("a"), t = new HtmlTag(!1), f = text$4(" ⇣"), t.a = f, attr$9(e, "href", _ = /*file*/ - r[6].url), attr$9(e, "target", "_blank"), attr$9(e, "download", x = window.__is_colab__ ? null : ( + e = element$8("a"), t = new HtmlTag(!1), f = text$4(" ⇣"), t.a = f, attr$9(e, "href", u = /*file*/ + r[6].url), attr$9(e, "target", "_blank"), attr$9(e, "download", y = window.__is_colab__ ? null : ( /*file*/ r[6].orig_name )), attr$9(e, "class", "svelte-usqupg"); }, - m(h, u) { - insert$b(h, e, u), t.m(s, e), append$9(e, f); + m(h, _) { + insert$b(h, e, _), t.m(n, e), append$9(e, f); }, - p(h, u) { - u & /*value*/ - 1 && s !== (s = display_file_size( + p(h, _) { + _ & /*value*/ + 1 && n !== (n = display_file_size( /*file*/ h[6] - ) + "") && t.p(s), u & /*value*/ - 1 && _ !== (_ = /*file*/ - h[6].url) && attr$9(e, "href", _), u & /*value*/ - 1 && x !== (x = window.__is_colab__ ? null : ( + ) + "") && t.p(n), _ & /*value*/ + 1 && u !== (u = /*file*/ + h[6].url) && attr$9(e, "href", u), _ & /*value*/ + 1 && y !== (y = window.__is_colab__ ? null : ( /*file*/ h[6].orig_name - )) && attr$9(e, "download", x); + )) && attr$9(e, "download", y); }, d(h) { h && detach$b(e); @@ -1401,11 +1401,11 @@ function create_if_block$7(r) { }; } function create_each_block$3(r) { - let e, t, s = display_file_name( + let e, t, n = display_file_name( /*file*/ r[6] - ) + "", f, _, x, h, u, E; - function c(S, n) { + ) + "", f, u, y, h, _, E; + function c(S, s) { return ( /*file*/ S[6].url ? create_if_block$7 : create_else_block$6 @@ -1425,22 +1425,22 @@ function create_each_block$3(r) { } return { c() { - e = element$8("tr"), t = element$8("td"), f = text$4(s), _ = space$8(), x = element$8("td"), b.c(), h = space$8(), attr$9(t, "class", "svelte-usqupg"), attr$9(x, "class", "download svelte-usqupg"), attr$9(e, "class", "file svelte-usqupg"), toggle_class$6( + e = element$8("tr"), t = element$8("td"), f = text$4(n), u = space$8(), y = element$8("td"), b.c(), h = space$8(), attr$9(t, "class", "svelte-usqupg"), attr$9(y, "class", "download svelte-usqupg"), attr$9(e, "class", "file svelte-usqupg"), toggle_class$6( e, "selectable", /*selectable*/ r[1] ); }, - m(S, n) { - insert$b(S, e, n), append$9(e, t), append$9(t, f), append$9(e, _), append$9(e, x), b.m(x, null), append$9(e, h), u || (E = listen$3(e, "click", A), u = !0); + m(S, s) { + insert$b(S, e, s), append$9(e, t), append$9(t, f), append$9(e, u), append$9(e, y), b.m(y, null), append$9(e, h), _ || (E = listen$3(e, "click", A), _ = !0); }, - p(S, n) { - r = S, n & /*value*/ - 1 && s !== (s = display_file_name( + p(S, s) { + r = S, s & /*value*/ + 1 && n !== (n = display_file_name( /*file*/ r[6] - ) + "") && set_data$4(f, s), C === (C = c(r)) && b ? b.p(r, n) : (b.d(1), b = C(r), b && (b.c(), b.m(x, null))), n & /*selectable*/ + ) + "") && set_data$4(f, n), C === (C = c(r)) && b ? b.p(r, s) : (b.d(1), b = C(r), b && (b.c(), b.m(y, null))), s & /*selectable*/ 2 && toggle_class$6( e, "selectable", @@ -1449,12 +1449,12 @@ function create_each_block$3(r) { ); }, d(S) { - S && detach$b(e), b.d(), u = !1, E(); + S && detach$b(e), b.d(), _ = !1, E(); } }; } function create_fragment$b(r) { - let e, t, s, f = ensure_array_like$3(Array.isArray( + let e, t, n, f = ensure_array_like$3(Array.isArray( /*value*/ r[0] ) ? ( @@ -1463,68 +1463,68 @@ function create_fragment$b(r) { ) : [ /*value*/ r[0] - ]), _ = []; - for (let x = 0; x < f.length; x += 1) - _[x] = create_each_block$3(get_each_context$3(r, f, x)); + ]), u = []; + for (let y = 0; y < f.length; y += 1) + u[y] = create_each_block$3(get_each_context$3(r, f, y)); return { c() { - e = element$8("div"), t = element$8("table"), s = element$8("tbody"); - for (let x = 0; x < _.length; x += 1) - _[x].c(); - attr$9(s, "class", "svelte-usqupg"), attr$9(t, "class", "file-preview svelte-usqupg"), attr$9(e, "class", "file-preview-holder svelte-usqupg"), set_style$4(e, "max-height", typeof /*height*/ + e = element$8("div"), t = element$8("table"), n = element$8("tbody"); + for (let y = 0; y < u.length; y += 1) + u[y].c(); + attr$9(n, "class", "svelte-usqupg"), attr$9(t, "class", "file-preview svelte-usqupg"), attr$9(e, "class", "file-preview-holder svelte-usqupg"), set_style$4(e, "max-height", typeof /*height*/ r[2] === void 0 ? "auto" : ( /*height*/ r[2] + "px" )); }, - m(x, h) { - insert$b(x, e, h), append$9(e, t), append$9(t, s); - for (let u = 0; u < _.length; u += 1) - _[u] && _[u].m(s, null); + m(y, h) { + insert$b(y, e, h), append$9(e, t), append$9(t, n); + for (let _ = 0; _ < u.length; _ += 1) + u[_] && u[_].m(n, null); }, - p(x, [h]) { + p(y, [h]) { if (h & /*selectable, dispatch, Array, value, window, i18n*/ 27) { f = ensure_array_like$3(Array.isArray( /*value*/ - x[0] + y[0] ) ? ( /*value*/ - x[0] + y[0] ) : [ /*value*/ - x[0] + y[0] ]); - let u; - for (u = 0; u < f.length; u += 1) { - const E = get_each_context$3(x, f, u); - _[u] ? _[u].p(E, h) : (_[u] = create_each_block$3(E), _[u].c(), _[u].m(s, null)); + let _; + for (_ = 0; _ < f.length; _ += 1) { + const E = get_each_context$3(y, f, _); + u[_] ? u[_].p(E, h) : (u[_] = create_each_block$3(E), u[_].c(), u[_].m(n, null)); } - for (; u < _.length; u += 1) - _[u].d(1); - _.length = f.length; + for (; _ < u.length; _ += 1) + u[_].d(1); + u.length = f.length; } h & /*height*/ 4 && set_style$4(e, "max-height", typeof /*height*/ - x[2] === void 0 ? "auto" : ( + y[2] === void 0 ? "auto" : ( /*height*/ - x[2] + "px" + y[2] + "px" )); }, i: noop$7, o: noop$7, - d(x) { - x && detach$b(e), destroy_each$3(_, x); + d(y) { + y && detach$b(e), destroy_each$3(u, y); } }; } function instance$a(r, e, t) { - const s = createEventDispatcher$4(); - let { value: f } = e, { selectable: _ = !1 } = e, { height: x = void 0 } = e, { i18n: h } = e; - const u = (E, c) => s("select", { value: E.orig_name, index: c }); + const n = createEventDispatcher$4(); + let { value: f } = e, { selectable: u = !1 } = e, { height: y = void 0 } = e, { i18n: h } = e; + const _ = (E, c) => n("select", { value: E.orig_name, index: c }); return r.$$set = (E) => { - "value" in E && t(0, f = E.value), "selectable" in E && t(1, _ = E.selectable), "height" in E && t(2, x = E.height), "i18n" in E && t(3, h = E.i18n); - }, [f, _, x, h, s, u]; + "value" in E && t(0, f = E.value), "selectable" in E && t(1, u = E.selectable), "height" in E && t(2, y = E.height), "i18n" in E && t(3, h = E.i18n); + }, [f, u, y, h, n, _]; } class FilePreview extends SvelteComponent$b { constructor(e) { @@ -1568,14 +1568,14 @@ var _3Dmol$1 = { exports: {} }; ) /* harmony export */ }); - var s = t( + var n = t( /*! ./text */ "./node_modules/iobuffer/lib-esm/text.browser.js" ); - const f = 1024 * 8, _ = (() => { - const u = new Uint8Array(4), E = new Uint32Array(u.buffer); - return !((E[0] = 1) & u[0]); - })(), x = { + const f = 1024 * 8, u = (() => { + const _ = new Uint8Array(4), E = new Uint32Array(_.buffer); + return !((E[0] = 1) & _[0]); + })(), y = { int8: globalThis.Int8Array, uint8: globalThis.Uint8Array, int16: globalThis.Int16Array, @@ -1750,14 +1750,14 @@ var _3Dmol$1 = { exports: {} }; * @param type - number type of elements to read */ readArray(E, c) { - const C = x[c].BYTES_PER_ELEMENT * E, b = this.byteOffset + this.offset, A = this.buffer.slice(b, b + C); - if (this.littleEndian === _ && c !== "uint8" && c !== "int8") { - const n = new Uint8Array(this.buffer.slice(b, b + C)); - n.reverse(); - const o = new x[c](n.buffer); + const C = y[c].BYTES_PER_ELEMENT * E, b = this.byteOffset + this.offset, A = this.buffer.slice(b, b + C); + if (this.littleEndian === u && c !== "uint8" && c !== "int8") { + const s = new Uint8Array(this.buffer.slice(b, b + C)); + s.reverse(); + const o = new y[c](s.buffer); return this.offset += C, o.reverse(), o; } - const S = new x[c](A); + const S = new y[c](A); return this.offset += C, S; } /** @@ -1836,7 +1836,7 @@ var _3Dmol$1 = { exports: {} }; * forward by `n` bytes. */ readUtf8(E = 1) { - return (0, s.decode)(this.readBytes(E)); + return (0, n.decode)(this.readBytes(E)); } /** * Read the next `n` bytes, return a string decoded with `encoding` and move pointer @@ -1844,7 +1844,7 @@ var _3Dmol$1 = { exports: {} }; * If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8} */ decodeText(E = 1, c = "utf-8") { - return (0, s.decode)(this.readBytes(E), c); + return (0, n.decode)(this.readBytes(E), c); } /** * Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer @@ -1959,7 +1959,7 @@ var _3Dmol$1 = { exports: {} }; * forward according to the encoded length. */ writeUtf8(E) { - return this.writeBytes((0, s.encode)(E)); + return this.writeBytes((0, n.encode)(E)); } /** * Export a Uint8Array view of the internal buffer. @@ -1989,31 +1989,31 @@ var _3Dmol$1 = { exports: {} }; (function(r) { if (r.TextEncoder && r.TextDecoder) return !1; - function e(s = "utf-8") { - if (s !== "utf-8") - throw new RangeError(`Failed to construct 'TextEncoder': The encoding label provided ('${s}') is invalid.`); + function e(n = "utf-8") { + if (n !== "utf-8") + throw new RangeError(`Failed to construct 'TextEncoder': The encoding label provided ('${n}') is invalid.`); } Object.defineProperty(e.prototype, "encoding", { value: "utf-8" - }), e.prototype.encode = function(s, f = { stream: !1 }) { + }), e.prototype.encode = function(n, f = { stream: !1 }) { if (f.stream) throw new Error("Failed to encode: the 'stream' option is unsupported."); - let _ = 0; - const x = s.length; - let h = 0, u = Math.max(32, x + (x >> 1) + 7), E = new Uint8Array(u >> 3 << 3); - for (; _ < x; ) { - let c = s.charCodeAt(_++); + let u = 0; + const y = n.length; + let h = 0, _ = Math.max(32, y + (y >> 1) + 7), E = new Uint8Array(_ >> 3 << 3); + for (; u < y; ) { + let c = n.charCodeAt(u++); if (c >= 55296 && c <= 56319) { - if (_ < x) { - const C = s.charCodeAt(_); - (C & 64512) === 56320 && (++_, c = ((c & 1023) << 10) + (C & 1023) + 65536); + if (u < y) { + const C = n.charCodeAt(u); + (C & 64512) === 56320 && (++u, c = ((c & 1023) << 10) + (C & 1023) + 65536); } if (c >= 55296 && c <= 56319) continue; } if (h + 4 > E.length) { - u += 8, u *= 1 + _ / s.length * 2, u = u >> 3 << 3; - const C = new Uint8Array(u); + _ += 8, _ *= 1 + u / n.length * 2, _ = _ >> 3 << 3; + const C = new Uint8Array(_); C.set(E), E = C; } if (c & 4294967168) @@ -2033,9 +2033,9 @@ var _3Dmol$1 = { exports: {} }; } return E.slice(0, h); }; - function t(s = "utf-8", f = { fatal: !1 }) { - if (s !== "utf-8") - throw new RangeError(`Failed to construct 'TextDecoder': The encoding label provided ('${s}') is invalid.`); + function t(n = "utf-8", f = { fatal: !1 }) { + if (n !== "utf-8") + throw new RangeError(`Failed to construct 'TextDecoder': The encoding label provided ('${n}') is invalid.`); if (f.fatal) throw new Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported."); } @@ -2043,31 +2043,31 @@ var _3Dmol$1 = { exports: {} }; value: "utf-8" }), Object.defineProperty(t.prototype, "fatal", { value: !1 }), Object.defineProperty(t.prototype, "ignoreBOM", { value: !1 - }), t.prototype.decode = function(s, f = { stream: !1 }) { + }), t.prototype.decode = function(n, f = { stream: !1 }) { if (f.stream) throw new Error("Failed to decode: the 'stream' option is unsupported."); - const _ = new Uint8Array(s); - let x = 0; - const h = _.length, u = []; - for (; x < h; ) { - const E = _[x++]; + const u = new Uint8Array(n); + let y = 0; + const h = u.length, _ = []; + for (; y < h; ) { + const E = u[y++]; if (E === 0) break; if (!(E & 128)) - u.push(E); + _.push(E); else if ((E & 224) === 192) { - const c = _[x++] & 63; - u.push((E & 31) << 6 | c); + const c = u[y++] & 63; + _.push((E & 31) << 6 | c); } else if ((E & 240) === 224) { - const c = _[x++] & 63, C = _[x++] & 63; - u.push((E & 31) << 12 | c << 6 | C); + const c = u[y++] & 63, C = u[y++] & 63; + _.push((E & 31) << 12 | c << 6 | C); } else if ((E & 248) === 240) { - const c = _[x++] & 63, C = _[x++] & 63, b = _[x++] & 63; + const c = u[y++] & 63, C = u[y++] & 63, b = u[y++] & 63; let A = (E & 7) << 18 | c << 12 | C << 6 | b; - A > 65535 && (A -= 65536, u.push(A >>> 10 & 1023 | 55296), A = 56320 | A & 1023), u.push(A); + A > 65535 && (A -= 65536, _.push(A >>> 10 & 1023 | 55296), A = 56320 | A & 1023), _.push(A); } } - return String.fromCharCode.apply(null, u); + return String.fromCharCode.apply(null, _); }, r.TextEncoder = e, r.TextDecoder = t; })(typeof window < "u" ? window : typeof self < "u" ? self : this); } @@ -2083,24 +2083,24 @@ var _3Dmol$1 = { exports: {} }; /* harmony export */ decode: () => ( /* binding */ - s + n ), /* harmony export */ encode: () => ( /* binding */ - _ + u ) /* harmony export */ }), t( /*! ./text-encoding-polyfill */ "./node_modules/iobuffer/lib-esm/text-encoding-polyfill.js" ); - function s(x, h = "utf8") { - return new TextDecoder(h).decode(x); + function n(y, h = "utf8") { + return new TextDecoder(h).decode(y); } const f = new TextEncoder(); - function _(x) { - return f.encode(x); + function u(y) { + return f.encode(y); } } ), @@ -2120,26 +2120,26 @@ var _3Dmol$1 = { exports: {} }; /* harmony export */ record: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ./types */ "./node_modules/netcdfjs/lib-esm/types.js" ); - function f(x, h) { - const u = (0, s.str2num)(h.type), E = h.size / (0, s.num2bytes)(u), c = new Array(E); + function f(y, h) { + const _ = (0, n.str2num)(h.type), E = h.size / (0, n.num2bytes)(_), c = new Array(E); for (let C = 0; C < E; C++) - c[C] = (0, s.readType)(x, u, 1); + c[C] = (0, n.readType)(y, _, 1); return c; } - function _(x, h, u) { - const E = (0, s.str2num)(h.type), c = h.size ? h.size / (0, s.num2bytes)(E) : 1, C = u.length, b = new Array(C), A = u.recordStep; + function u(y, h, _) { + const E = (0, n.str2num)(h.type), c = h.size ? h.size / (0, n.num2bytes)(E) : 1, C = _.length, b = new Array(C), A = _.recordStep; if (A) for (let S = 0; S < C; S++) { - const n = x.offset; - b[S] = (0, s.readType)(x, E, c), x.seek(n + A); + const s = y.offset; + b[S] = (0, n.readType)(y, E, c), y.seek(s + A); } else throw new Error("recordDimension.recordStep is undefined"); @@ -2162,31 +2162,31 @@ var _3Dmol$1 = { exports: {} }; ) /* harmony export */ }); - var s = t( + var n = t( /*! ./types */ "./node_modules/netcdfjs/lib-esm/types.js" ), f = t( /*! ./utils */ "./node_modules/netcdfjs/lib-esm/utils.js" ); - const _ = 0, x = 10, h = 11, u = 12, E = 0; - function c(S, n) { - const o = { version: n }, w = { + const u = 0, y = 10, h = 11, _ = 12, E = 0; + function c(S, s) { + const o = { version: s }, w = { length: S.readUint32() }, p = C(S); Array.isArray(p) || (w.id = p.recordId, w.name = p.recordName, o.dimensions = p.dimensions), o.globalAttributes = b(S); - const v = A(S, w == null ? void 0 : w.id, n); + const v = A(S, w == null ? void 0 : w.id, s); return Array.isArray(v) || (o.variables = v.variables, w.recordStep = v.recordStep), o.recordDimension = w, o; } function C(S) { - const n = {}; + const s = {}; let o, w; const p = S.readUint32(); let v; - if (p === _) - return (0, f.notNetcdf)(S.readUint32() !== _, "wrong empty tag for list of dimensions"), []; + if (p === u) + return (0, f.notNetcdf)(S.readUint32() !== u, "wrong empty tag for list of dimensions"), []; { - (0, f.notNetcdf)(p !== x, "wrong tag for list of dimensions"); + (0, f.notNetcdf)(p !== y, "wrong tag for list of dimensions"); const a = S.readUint32(); v = new Array(a); for (let l = 0; l < a; l++) { @@ -2197,56 +2197,56 @@ var _3Dmol$1 = { exports: {} }; }; } } - return o !== void 0 && (n.recordId = o), w !== void 0 && (n.recordName = w), n.dimensions = v, n; + return o !== void 0 && (s.recordId = o), w !== void 0 && (s.recordName = w), s.dimensions = v, s; } function b(S) { - const n = S.readUint32(); + const s = S.readUint32(); let o; - if (n === _) - return (0, f.notNetcdf)(S.readUint32() !== _, "wrong empty tag for list of attributes"), []; + if (s === u) + return (0, f.notNetcdf)(S.readUint32() !== u, "wrong empty tag for list of attributes"), []; { - (0, f.notNetcdf)(n !== u, "wrong tag for list of attributes"); + (0, f.notNetcdf)(s !== _, "wrong tag for list of attributes"); const w = S.readUint32(); o = new Array(w); for (let p = 0; p < w; p++) { const v = (0, f.readName)(S), a = S.readUint32(); (0, f.notNetcdf)(a < 1 || a > 6, `non valid type ${a}`); - const l = S.readUint32(), g = (0, s.readType)(S, a, l); + const l = S.readUint32(), g = (0, n.readType)(S, a, l); (0, f.padding)(S), o[p] = { name: v, - type: (0, s.num2str)(a), + type: (0, n.num2str)(a), value: g }; } } return o; } - function A(S, n, o) { + function A(S, s, o) { const w = S.readUint32(); let p = 0, v; - if (w === _) - return (0, f.notNetcdf)(S.readUint32() !== _, "wrong empty tag for list of variables"), []; + if (w === u) + return (0, f.notNetcdf)(S.readUint32() !== u, "wrong empty tag for list of variables"), []; { (0, f.notNetcdf)(w !== h, "wrong tag for list of variables"); const a = S.readUint32(); v = new Array(a); for (let l = 0; l < a; l++) { const g = (0, f.readName)(S), M = S.readUint32(), L = new Array(M); - for (let z = 0; z < M; z++) - L[z] = S.readUint32(); + for (let B = 0; B < M; B++) + L[B] = S.readUint32(); const T = b(S), D = S.readUint32(); (0, f.notNetcdf)(D < 1 && D > 6, `non valid type ${D}`); - const R = S.readUint32(); - let B = S.readUint32(); - o === 2 && ((0, f.notNetcdf)(B > 0, "offsets larger than 4GB not supported"), B = S.readUint32()); + const I = S.readUint32(); + let z = S.readUint32(); + o === 2 && ((0, f.notNetcdf)(z > 0, "offsets larger than 4GB not supported"), z = S.readUint32()); let P = !1; - typeof n < "u" && L[0] === n && (p += R, P = !0), v[l] = { + typeof s < "u" && L[0] === s && (p += I, P = !0), v[l] = { name: g, dimensions: L, attributes: T, - type: (0, s.num2str)(D), - size: R, - offset: B, + type: (0, n.num2str)(D), + size: I, + offset: z, record: P }; } @@ -2269,11 +2269,11 @@ var _3Dmol$1 = { exports: {} }; /* harmony export */ NetCDFReader: () => ( /* reexport safe */ - s.NetCDFReader + n.NetCDFReader ) /* harmony export */ }); - var s = t( + var n = t( /*! ./parser */ "./node_modules/netcdfjs/lib-esm/parser.js" ); @@ -2290,33 +2290,33 @@ var _3Dmol$1 = { exports: {} }; /* harmony export */ NetCDFReader: () => ( /* binding */ - u + _ ) /* harmony export */ }); - var s = t( + var n = t( /*! iobuffer */ "./node_modules/iobuffer/lib-esm/IOBuffer.js" ), f = t( /*! ./data */ "./node_modules/netcdfjs/lib-esm/data.js" - ), _ = t( + ), u = t( /*! ./header */ "./node_modules/netcdfjs/lib-esm/header.js" - ), x = t( + ), y = t( /*! ./toString */ "./node_modules/netcdfjs/lib-esm/toString.js" ), h = t( /*! ./utils */ "./node_modules/netcdfjs/lib-esm/utils.js" ); - class u { + class _ { constructor(c) { - this.toString = x.toString; - const C = new s.IOBuffer(c); + this.toString = y.toString; + const C = new n.IOBuffer(c); C.setBigEndian(), (0, h.notNetcdf)(C.readChars(3) !== "CDF", "should start with CDF"); const b = C.readByte(); - (0, h.notNetcdf)(b > 2, "unknown version"), this.header = (0, _.header)(C, b), this.buffer = C; + (0, h.notNetcdf)(b > 2, "unknown version"), this.header = (0, u.header)(C, b), this.buffer = C; } /** * @return - Version for the NetCDF format @@ -2413,24 +2413,24 @@ var _3Dmol$1 = { exports: {} }; /* harmony export */ toString: () => ( /* binding */ - s + n ) /* harmony export */ }); - function s() { + function n() { const f = []; f.push("DIMENSIONS"); - for (const x of this.dimensions) - f.push(` ${x.name.padEnd(30)} = size: ${x.size}`); + for (const y of this.dimensions) + f.push(` ${y.name.padEnd(30)} = size: ${y.size}`); f.push(""), f.push("GLOBAL ATTRIBUTES"); - for (const x of this.globalAttributes) - f.push(` ${x.name.padEnd(30)} = ${x.value}`); - const _ = JSON.parse(JSON.stringify(this.variables)); + for (const y of this.globalAttributes) + f.push(` ${y.name.padEnd(30)} = ${y.value}`); + const u = JSON.parse(JSON.stringify(this.variables)); f.push(""), f.push("VARIABLES:"); - for (const x of _) { - x.value = this.getDataVariable(x); - let h = JSON.stringify(x.value); - h.length > 50 && (h = h.substring(0, 50)), isNaN(x.value.length) || (h += ` (length: ${x.value.length})`), f.push(` ${x.name.padEnd(30)} = ${h}`); + for (const y of u) { + y.value = this.getDataVariable(y); + let h = JSON.stringify(y.value); + h.length > 50 && (h = h.substring(0, 50)), isNaN(y.value.length) || (h += ` (length: ${y.value.length})`), f.push(` ${y.name.padEnd(30)} = ${h}`); } return f.join(` `); @@ -2448,7 +2448,7 @@ var _3Dmol$1 = { exports: {} }; /* harmony export */ num2bytes: () => ( /* binding */ - _ + u ), /* harmony export */ num2str: () => ( @@ -2458,16 +2458,16 @@ var _3Dmol$1 = { exports: {} }; /* harmony export */ readType: () => ( /* binding */ - u + _ ), /* harmony export */ str2num: () => ( /* binding */ - x + y ) /* harmony export */ }); - const s = { + const n = { BYTE: 1, CHAR: 2, SHORT: 3, @@ -2477,54 +2477,54 @@ var _3Dmol$1 = { exports: {} }; }; function f(c) { switch (Number(c)) { - case s.BYTE: + case n.BYTE: return "byte"; - case s.CHAR: + case n.CHAR: return "char"; - case s.SHORT: + case n.SHORT: return "short"; - case s.INT: + case n.INT: return "int"; - case s.FLOAT: + case n.FLOAT: return "float"; - case s.DOUBLE: + case n.DOUBLE: return "double"; default: return "undefined"; } } - function _(c) { + function u(c) { switch (Number(c)) { - case s.BYTE: + case n.BYTE: return 1; - case s.CHAR: + case n.CHAR: return 1; - case s.SHORT: + case n.SHORT: return 2; - case s.INT: + case n.INT: return 4; - case s.FLOAT: + case n.FLOAT: return 4; - case s.DOUBLE: + case n.DOUBLE: return 8; default: return -1; } } - function x(c) { + function y(c) { switch (String(c)) { case "byte": - return s.BYTE; + return n.BYTE; case "char": - return s.CHAR; + return n.CHAR; case "short": - return s.SHORT; + return n.SHORT; case "int": - return s.INT; + return n.INT; case "float": - return s.FLOAT; + return n.FLOAT; case "double": - return s.DOUBLE; + return n.DOUBLE; default: return -1; } @@ -2538,19 +2538,19 @@ var _3Dmol$1 = { exports: {} }; } else return C(); } - function u(c, C, b) { + function _(c, C, b) { switch (C) { - case s.BYTE: + case n.BYTE: return Array.from(c.readBytes(b)); - case s.CHAR: + case n.CHAR: return E(c.readChars(b)); - case s.SHORT: + case n.SHORT: return h(b, c.readInt16.bind(c)); - case s.INT: + case n.INT: return h(b, c.readInt32.bind(c)); - case s.FLOAT: + case n.FLOAT: return h(b, c.readFloat32.bind(c)); - case s.DOUBLE: + case n.DOUBLE: return h(b, c.readFloat64.bind(c)); default: throw new Error(`non valid type ${C}`); @@ -2572,7 +2572,7 @@ var _3Dmol$1 = { exports: {} }; /* harmony export */ notNetcdf: () => ( /* binding */ - s + n ), /* harmony export */ padding: () => ( @@ -2582,20 +2582,20 @@ var _3Dmol$1 = { exports: {} }; /* harmony export */ readName: () => ( /* binding */ - _ + u ) /* harmony export */ }); - function s(x, h) { - if (x) + function n(y, h) { + if (y) throw new TypeError(`Not a valid NetCDF v3.x file: ${h}`); } - function f(x) { - x.offset % 4 !== 0 && x.skip(4 - x.offset % 4); + function f(y) { + y.offset % 4 !== 0 && y.skip(4 - y.offset % 4); } - function _(x) { - const h = x.readUint32(), u = x.readChars(h); - return f(x), u; + function u(y) { + const h = y.readUint32(), _ = y.readChars(h); + return f(y), _; } } ), @@ -2608,10 +2608,10 @@ var _3Dmol$1 = { exports: {} }; (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = `uniform mat4 viewMatrix; + const n = `uniform mat4 viewMatrix; uniform float opacity; uniform vec3 fogColor; uniform float fogNear; @@ -2635,10 +2635,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = `uniform mat4 modelViewMatrix; + const n = `uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform mat4 viewMatrix; uniform mat3 normalMatrix; @@ -2666,10 +2666,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = `uniform mat4 viewMatrix; + const n = `uniform mat4 viewMatrix; uniform float opacity; uniform vec3 fogColor; @@ -2710,10 +2710,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; @@ -2765,10 +2765,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = `uniform mat4 viewMatrix; + const n = `uniform mat4 viewMatrix; uniform float opacity; uniform vec3 fogColor; @@ -2806,10 +2806,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform mat4 viewMatrix; @@ -2856,10 +2856,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform mat4 viewMatrix; uniform float opacity; @@ -2907,10 +2907,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; @@ -2964,10 +2964,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform float opacity; uniform vec3 outlineColor; @@ -2993,10 +2993,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; @@ -3030,10 +3030,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = `uniform sampler2D colormap; + const n = `uniform sampler2D colormap; varying highp vec2 vTexCoords; uniform vec2 dimensions; //DEFINEFRAGCOLOR @@ -3052,10 +3052,10 @@ void main (void) { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = `attribute vec2 vertexPosition; + const n = `attribute vec2 vertexPosition; varying highp vec2 vTexCoords; const vec2 scale = vec2(0.5, 0.5); @@ -3075,10 +3075,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = `uniform sampler2D colormap; + const n = `uniform sampler2D colormap; varying highp vec2 vTexCoords; uniform vec2 dimensions; @@ -3147,10 +3147,10 @@ void main (void) { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = `attribute vec2 vertexPosition; + const n = `attribute vec2 vertexPosition; varying highp vec2 vTexCoords; const vec2 scale = vec2(0.5, 0.5); @@ -3170,10 +3170,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform mat4 viewMatrix; uniform float opacity; uniform mat4 projectionMatrix; @@ -3225,10 +3225,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = `uniform mat4 modelViewMatrix; + const n = `uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform mat4 viewMatrix; uniform mat3 normalMatrix; @@ -3271,10 +3271,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform float opacity; uniform vec3 outlineColor; @@ -3316,10 +3316,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; @@ -3358,10 +3358,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform vec3 color; uniform sampler2D map; @@ -3417,10 +3417,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform int useScreenCoordinates; uniform vec3 screenPosition; @@ -3474,10 +3474,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` float dotProduct = dot( norm, vLight ); + const n = ` float dotProduct = dot( norm, vLight ); vec3 light = vec3( max( dotProduct, 0.0 ) ); gl_FragColor = vec4(light*color, opacity*opacity ); float fogFactor = smoothstep( fogNear, fogFar, depth ); @@ -3494,10 +3494,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; @@ -3572,10 +3572,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; @@ -3650,10 +3650,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = ` + const n = ` uniform highp sampler3D data; uniform highp sampler2D colormap; uniform highp sampler2D depthmap; @@ -3742,10 +3742,10 @@ void main(void) { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = `uniform mat4 modelViewMatrix; + const n = `uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform mat4 viewMatrix; @@ -3768,10 +3768,10 @@ void main() { (r, e, t) => { t.r(e), t.d(e, { /* harmony export */ - default: () => s + default: () => n /* harmony export */ }); - const s = `uniform float opacity; + const n = `uniform float opacity; uniform mat4 projectionMatrix; uniform vec3 fogColor; @@ -3862,30 +3862,30 @@ void main() { /* harmony export */ GLDraw: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" ), f; - (function(x) { - x[x.NONE = 0] = "NONE", x[x.FLAT = 1] = "FLAT", x[x.ROUND = 2] = "ROUND"; + (function(y) { + y[y.NONE = 0] = "NONE", y[y.FLAT = 1] = "FLAT", y[y.ROUND = 2] = "ROUND"; })(f || (f = {})); - var _; - (function(x) { - function h(n, o, w) { - var p = Math.hypot(n, o), v, a, l, g, M; - p < 1e-4 ? (a = 0, l = 1) : (a = -n / p, l = o / p), o = -a * n + l * o, v = Math.hypot(o, w), v < 1e-4 ? (g = 0, M = 1) : (g = w / v, M = o / v); + var u; + (function(y) { + function h(s, o, w) { + var p = Math.hypot(s, o), v, a, l, g, M; + p < 1e-4 ? (a = 0, l = 1) : (a = -s / p, l = o / p), o = -a * s + l * o, v = Math.hypot(o, w), v < 1e-4 ? (g = 0, M = 1) : (g = w / v, M = o / v); var L = new Float32Array(9); return L[0] = l, L[1] = a, L[2] = 0, L[3] = -a * M, L[4] = l * M, L[5] = g, L[6] = a * g, L[7] = -l * g, L[8] = M, L; } - class u { + class _ { constructor() { this.cache = {}; let o = [], w = 4, p = Math.pow(2, w), v = 2, a = Math.pow(2, v), l = p / a, g; - for (o[0] = new s.Vector3(-1, 0, 0), o[l] = new s.Vector3(0, 0, 1), o[l * 2] = new s.Vector3(1, 0, 0), o[l * 3] = new s.Vector3(0, 0, -1), v = 3; v <= w; v++) { + for (o[0] = new n.Vector3(-1, 0, 0), o[l] = new n.Vector3(0, 0, 1), o[l * 2] = new n.Vector3(1, 0, 0), o[l * 3] = new n.Vector3(0, 0, -1), v = 3; v <= w; v++) { for (a = Math.pow(2, v - 1), l = p / a, g = 0; g < a - 1; g++) o[l / 2 + g * l] = o[g * l].clone().add(o[(g + 1) * l]).normalize(); g = a - 1, o[l / 2 + g * l] = o[g * l].clone().add(o[0]).normalize(); @@ -3897,7 +3897,7 @@ void main() { return this.cache[o][w + p]; for (var v = this.basisVectors.length, a = [], l = [], g, M = 0; M < v; M++) a.push(this.basisVectors[M].clone().multiplyScalar(o)), a.push(this.basisVectors[M].clone().multiplyScalar(o)), g = this.basisVectors[M].clone().normalize(), l.push(g), l.push(g); - var L = [], T = 10, D = v, R = 0, B = Math.PI * 2, P = 0, z = Math.PI, F, N, $ = !1, k = !1; + var L = [], T = 10, D = v, I = 0, z = Math.PI * 2, P = 0, B = Math.PI, F, N, $ = !1, k = !1; for (N = 0; N <= T; N++) { $ = N === 0 || N === T, k = N === T / 2; var G = [], H = []; @@ -3910,8 +3910,8 @@ void main() { var V = F / D, Q = N / T; if (!$ || F === 0) if (F < D) { - var oe = new s.Vector3(); - oe.x = -o * Math.cos(R + V * B) * Math.sin(P + Q * z), w == 1 ? oe.y = 0 : oe.y = o * Math.cos(P + Q * z), oe.z = o * Math.sin(R + V * B) * Math.sin(P + Q * z), Math.abs(oe.x) < 1e-5 && (oe.x = 0), Math.abs(oe.y) < 1e-5 && (oe.y = 0), Math.abs(oe.z) < 1e-5 && (oe.z = 0), w == f.FLAT ? (g = new s.Vector3(0, Math.cos(P + Q * z), 0), g.normalize()) : (g = new s.Vector3(oe.x, oe.y, oe.z), g.normalize()), a.push(oe), l.push(g), G.push(a.length - 1); + var ae = new n.Vector3(); + ae.x = -o * Math.cos(I + V * z) * Math.sin(P + Q * B), w == 1 ? ae.y = 0 : ae.y = o * Math.cos(P + Q * B), ae.z = o * Math.sin(I + V * z) * Math.sin(P + Q * B), Math.abs(ae.x) < 1e-5 && (ae.x = 0), Math.abs(ae.y) < 1e-5 && (ae.y = 0), Math.abs(ae.z) < 1e-5 && (ae.z = 0), w == f.FLAT ? (g = new n.Vector3(0, Math.cos(P + Q * B), 0), g.normalize()) : (g = new n.Vector3(ae.x, ae.y, ae.z), g.normalize()), a.push(ae), l.push(g), G.push(a.length - 1); } else G.push(a.length - D); else @@ -3919,58 +3919,58 @@ void main() { } k && L.push(H), L.push(G); } - var ee = { + var oe = { vertices: a, normals: l, verticesRows: L, w: D, h: T }; - return o in this.cache || (this.cache[o] = {}), this.cache[o][w + p] = ee, ee; + return o in this.cache || (this.cache[o] = {}), this.cache[o][w + p] = oe, oe; } } - var E = new u(); - function c(n, o, w, p, v, a = 0, l = 0) { + var E = new _(); + function c(s, o, w, p, v, a = 0, l = 0) { if (!(!o || !w)) { var g = l || a; v = v || { r: 0, g: 0, b: 0 }; - var M = h(w.x - o.x, w.y - o.y, w.z - o.z), L = E.getVerticesForRadius(p, l, "to"), T = L.w, D = L.h, R = g ? D * T + 2 : 2 * T, B = n.updateGeoGroup(R), P = L.vertices, z = L.normals, F = L.verticesRows, N = F[D / 2], $ = F[D / 2 + 1], k = B.vertices, G, H, U, V, Q, oe, ee = B.vertexArray, ne = B.normalArray, me = B.colorArray, se = B.faceArray; + var M = h(w.x - o.x, w.y - o.y, w.z - o.z), L = E.getVerticesForRadius(p, l, "to"), T = L.w, D = L.h, I = g ? D * T + 2 : 2 * T, z = s.updateGeoGroup(I), P = L.vertices, B = L.normals, F = L.verticesRows, N = F[D / 2], $ = F[D / 2 + 1], k = z.vertices, G, H, U, V, Q, ae, oe = z.vertexArray, q = z.normalArray, me = z.colorArray, ne = z.faceArray; for (U = 0; U < T; ++U) { var fe = 2 * U; - V = M[0] * P[fe].x + M[3] * P[fe].y + M[6] * P[fe].z, Q = M[1] * P[fe].x + M[4] * P[fe].y + M[7] * P[fe].z, oe = M[5] * P[fe].y + M[8] * P[fe].z, G = 3 * (k + fe), H = B.faceidx, ee[G] = V + o.x, ee[G + 1] = Q + o.y, ee[G + 2] = oe + o.z, ee[G + 3] = V + w.x, ee[G + 4] = Q + w.y, ee[G + 5] = oe + w.z, ne[G] = V, ne[G + 3] = V, ne[G + 1] = Q, ne[G + 4] = Q, ne[G + 2] = oe, ne[G + 5] = oe, me[G] = v.r, me[G + 3] = v.r, me[G + 1] = v.g, me[G + 4] = v.g, me[G + 2] = v.b, me[G + 5] = v.b, se[H] = $[U] + k, se[H + 1] = $[U + 1] + k, se[H + 2] = N[U] + k, se[H + 3] = N[U] + k, se[H + 4] = $[U + 1] + k, se[H + 5] = N[U + 1] + k, B.faceidx += 6; + V = M[0] * P[fe].x + M[3] * P[fe].y + M[6] * P[fe].z, Q = M[1] * P[fe].x + M[4] * P[fe].y + M[7] * P[fe].z, ae = M[5] * P[fe].y + M[8] * P[fe].z, G = 3 * (k + fe), H = z.faceidx, oe[G] = V + o.x, oe[G + 1] = Q + o.y, oe[G + 2] = ae + o.z, oe[G + 3] = V + w.x, oe[G + 4] = Q + w.y, oe[G + 5] = ae + w.z, q[G] = V, q[G + 3] = V, q[G + 1] = Q, q[G + 4] = Q, q[G + 2] = ae, q[G + 5] = ae, me[G] = v.r, me[G + 3] = v.r, me[G + 1] = v.g, me[G + 4] = v.g, me[G + 2] = v.b, me[G + 5] = v.b, ne[H] = $[U] + k, ne[H + 1] = $[U + 1] + k, ne[H + 2] = N[U] + k, ne[H + 3] = N[U] + k, ne[H + 4] = $[U + 1] + k, ne[H + 5] = N[U + 1] + k, z.faceidx += 6; } if (g) { - var Ce = l ? 0 : D / 2, Me = a ? D + 1 : D / 2 + 1, Te, ae, pe, we, ke, Ue, Ne, Be, ue, ye, ge, Se, ze, He, We, Y, K, q, de, ve, Ie, Re, Z, ce, Ae, Fe, he, Oe, j, $e, Ve, I; + var Ce = l ? 0 : D / 2, Me = a ? D + 1 : D / 2 + 1, Te, se, pe, we, ke, Ue, Ne, Be, ue, ye, ge, Se, ze, He, We, Y, K, ee, de, ve, Ie, Re, Z, ce, Ae, Fe, he, Oe, j, $e, Ve, R; for (Q = Ce; Q < Me; Q++) if (Q !== D / 2) { var be = Q <= D / 2 ? w : o, Ee = E.getVerticesForRadius(p, l, "to"), X = E.getVerticesForRadius(p, a, "from"); - for (be === w ? (P = Ee.vertices, z = Ee.normals, F = Ee.verticesRows) : be == o && (P = X.vertices, z = X.normals, F = X.verticesRows), V = 0; V < T; V++) - H = B.faceidx, Te = F[Q][V + 1], j = (Te + k) * 3, ae = F[Q][V], $e = (ae + k) * 3, pe = F[Q + 1][V], Ve = (pe + k) * 3, we = F[Q + 1][V + 1], I = (we + k) * 3, ke = M[0] * P[Te].x + M[3] * P[Te].y + M[6] * P[Te].z, Ue = M[0] * P[ae].x + M[3] * P[ae].y + M[6] * P[ae].z, Ne = M[0] * P[pe].x + M[3] * P[pe].y + M[6] * P[pe].z, Be = M[0] * P[we].x + M[3] * P[we].y + M[6] * P[we].z, ue = M[1] * P[Te].x + M[4] * P[Te].y + M[7] * P[Te].z, ye = M[1] * P[ae].x + M[4] * P[ae].y + M[7] * P[ae].z, ge = M[1] * P[pe].x + M[4] * P[pe].y + M[7] * P[pe].z, Se = M[1] * P[we].x + M[4] * P[we].y + M[7] * P[we].z, ze = M[5] * P[Te].y + M[8] * P[Te].z, He = M[5] * P[ae].y + M[8] * P[ae].z, We = M[5] * P[pe].y + M[8] * P[pe].z, Y = M[5] * P[we].y + M[8] * P[we].z, ee[j] = ke + be.x, ee[$e] = Ue + be.x, ee[Ve] = Ne + be.x, ee[I] = Be + be.x, ee[j + 1] = ue + be.y, ee[$e + 1] = ye + be.y, ee[Ve + 1] = ge + be.y, ee[I + 1] = Se + be.y, ee[j + 2] = ze + be.z, ee[$e + 2] = He + be.z, ee[Ve + 2] = We + be.z, ee[I + 2] = Y + be.z, me[j] = v.r, me[$e] = v.r, me[Ve] = v.r, me[I] = v.r, me[j + 1] = v.g, me[$e + 1] = v.g, me[Ve + 1] = v.g, me[I + 1] = v.g, me[j + 2] = v.b, me[$e + 2] = v.b, me[Ve + 2] = v.b, me[I + 2] = v.b, K = M[0] * z[Te].x + M[3] * z[Te].y + M[6] * z[Te].z, q = M[0] * z[ae].x + M[3] * z[ae].y + M[6] * z[ae].z, de = M[0] * z[pe].x + M[3] * z[pe].y + M[6] * z[pe].z, ve = M[0] * z[we].x + M[3] * z[we].y + M[6] * z[we].z, Ie = M[1] * z[Te].x + M[4] * z[Te].y + M[7] * z[Te].z, Re = M[1] * z[ae].x + M[4] * z[ae].y + M[7] * z[ae].z, Z = M[1] * z[pe].x + M[4] * z[pe].y + M[7] * z[pe].z, ce = M[1] * z[we].x + M[4] * z[we].y + M[7] * z[we].z, Ae = M[5] * z[Te].y + M[8] * z[Te].z, Fe = M[5] * z[ae].y + M[8] * z[ae].z, he = M[5] * z[pe].y + M[8] * z[pe].z, Oe = M[5] * z[we].y + M[8] * z[we].z, Q === 0 ? (ne[j] = K, ne[Ve] = de, ne[I] = ve, ne[j + 1] = Ie, ne[Ve + 1] = Z, ne[I + 1] = ce, ne[j + 2] = Ae, ne[Ve + 2] = he, ne[I + 2] = Oe, se[H] = Te + k, se[H + 1] = pe + k, se[H + 2] = we + k, B.faceidx += 3) : Q === Me - 1 ? (ne[j] = K, ne[$e] = q, ne[Ve] = de, ne[j + 1] = Ie, ne[$e + 1] = Re, ne[Ve + 1] = Z, ne[j + 2] = Ae, ne[$e + 2] = Fe, ne[Ve + 2] = he, se[H] = Te + k, se[H + 1] = ae + k, se[H + 2] = pe + k, B.faceidx += 3) : (ne[j] = K, ne[$e] = q, ne[I] = ve, ne[j + 1] = Ie, ne[$e + 1] = Re, ne[I + 1] = ce, ne[j + 2] = Ae, ne[$e + 2] = Fe, ne[I + 2] = Oe, ne[$e] = q, ne[Ve] = de, ne[I] = ve, ne[$e + 1] = Re, ne[Ve + 1] = Z, ne[I + 1] = ce, ne[$e + 2] = Fe, ne[Ve + 2] = he, ne[I + 2] = Oe, se[H] = Te + k, se[H + 1] = ae + k, se[H + 2] = we + k, se[H + 3] = ae + k, se[H + 4] = pe + k, se[H + 5] = we + k, B.faceidx += 6); + for (be === w ? (P = Ee.vertices, B = Ee.normals, F = Ee.verticesRows) : be == o && (P = X.vertices, B = X.normals, F = X.verticesRows), V = 0; V < T; V++) + H = z.faceidx, Te = F[Q][V + 1], j = (Te + k) * 3, se = F[Q][V], $e = (se + k) * 3, pe = F[Q + 1][V], Ve = (pe + k) * 3, we = F[Q + 1][V + 1], R = (we + k) * 3, ke = M[0] * P[Te].x + M[3] * P[Te].y + M[6] * P[Te].z, Ue = M[0] * P[se].x + M[3] * P[se].y + M[6] * P[se].z, Ne = M[0] * P[pe].x + M[3] * P[pe].y + M[6] * P[pe].z, Be = M[0] * P[we].x + M[3] * P[we].y + M[6] * P[we].z, ue = M[1] * P[Te].x + M[4] * P[Te].y + M[7] * P[Te].z, ye = M[1] * P[se].x + M[4] * P[se].y + M[7] * P[se].z, ge = M[1] * P[pe].x + M[4] * P[pe].y + M[7] * P[pe].z, Se = M[1] * P[we].x + M[4] * P[we].y + M[7] * P[we].z, ze = M[5] * P[Te].y + M[8] * P[Te].z, He = M[5] * P[se].y + M[8] * P[se].z, We = M[5] * P[pe].y + M[8] * P[pe].z, Y = M[5] * P[we].y + M[8] * P[we].z, oe[j] = ke + be.x, oe[$e] = Ue + be.x, oe[Ve] = Ne + be.x, oe[R] = Be + be.x, oe[j + 1] = ue + be.y, oe[$e + 1] = ye + be.y, oe[Ve + 1] = ge + be.y, oe[R + 1] = Se + be.y, oe[j + 2] = ze + be.z, oe[$e + 2] = He + be.z, oe[Ve + 2] = We + be.z, oe[R + 2] = Y + be.z, me[j] = v.r, me[$e] = v.r, me[Ve] = v.r, me[R] = v.r, me[j + 1] = v.g, me[$e + 1] = v.g, me[Ve + 1] = v.g, me[R + 1] = v.g, me[j + 2] = v.b, me[$e + 2] = v.b, me[Ve + 2] = v.b, me[R + 2] = v.b, K = M[0] * B[Te].x + M[3] * B[Te].y + M[6] * B[Te].z, ee = M[0] * B[se].x + M[3] * B[se].y + M[6] * B[se].z, de = M[0] * B[pe].x + M[3] * B[pe].y + M[6] * B[pe].z, ve = M[0] * B[we].x + M[3] * B[we].y + M[6] * B[we].z, Ie = M[1] * B[Te].x + M[4] * B[Te].y + M[7] * B[Te].z, Re = M[1] * B[se].x + M[4] * B[se].y + M[7] * B[se].z, Z = M[1] * B[pe].x + M[4] * B[pe].y + M[7] * B[pe].z, ce = M[1] * B[we].x + M[4] * B[we].y + M[7] * B[we].z, Ae = M[5] * B[Te].y + M[8] * B[Te].z, Fe = M[5] * B[se].y + M[8] * B[se].z, he = M[5] * B[pe].y + M[8] * B[pe].z, Oe = M[5] * B[we].y + M[8] * B[we].z, Q === 0 ? (q[j] = K, q[Ve] = de, q[R] = ve, q[j + 1] = Ie, q[Ve + 1] = Z, q[R + 1] = ce, q[j + 2] = Ae, q[Ve + 2] = he, q[R + 2] = Oe, ne[H] = Te + k, ne[H + 1] = pe + k, ne[H + 2] = we + k, z.faceidx += 3) : Q === Me - 1 ? (q[j] = K, q[$e] = ee, q[Ve] = de, q[j + 1] = Ie, q[$e + 1] = Re, q[Ve + 1] = Z, q[j + 2] = Ae, q[$e + 2] = Fe, q[Ve + 2] = he, ne[H] = Te + k, ne[H + 1] = se + k, ne[H + 2] = pe + k, z.faceidx += 3) : (q[j] = K, q[$e] = ee, q[R] = ve, q[j + 1] = Ie, q[$e + 1] = Re, q[R + 1] = ce, q[j + 2] = Ae, q[$e + 2] = Fe, q[R + 2] = Oe, q[$e] = ee, q[Ve] = de, q[R] = ve, q[$e + 1] = Re, q[Ve + 1] = Z, q[R + 1] = ce, q[$e + 2] = Fe, q[Ve + 2] = he, q[R + 2] = Oe, ne[H] = Te + k, ne[H + 1] = se + k, ne[H + 2] = we + k, ne[H + 3] = se + k, ne[H + 4] = pe + k, ne[H + 5] = we + k, z.faceidx += 6); } } - B.vertices += R; + z.vertices += I; } } - x.drawCylinder = c; - function C(n, o, w, p, v) { + y.drawCylinder = c; + function C(s, o, w, p, v) { if (!o || !w) return; v = v || { r: 0, g: 0, b: 0 }; - let a = new s.Vector3(w.x - o.x, w.y - o.y, w.z - o.z); + let a = new n.Vector3(w.x - o.x, w.y - o.y, w.z - o.z); var l = h(a.x, a.y, a.z); a = a.normalize(); - var g = E.basisVectors.length, M = E.basisVectors, L = g + 2, T = n.updateGeoGroup(L), D = T.vertices, R, B, P, z, F, N, $ = T.vertexArray, k = T.normalArray, G = T.colorArray, H = T.faceArray; - for (R = D * 3, $[R] = o.x, $[R + 1] = o.y, $[R + 2] = o.z, k[R] = -a.x, k[R + 1] = -a.y, k[R + 2] = -a.z, G[R] = v.r, G[R + 1] = v.g, G[R + 2] = v.b, $[R + 3] = w.x, $[R + 4] = w.y, $[R + 5] = w.z, k[R + 3] = a.x, k[R + 4] = a.y, k[R + 5] = a.z, G[R + 3] = v.r, G[R + 4] = v.g, G[R + 5] = v.b, R += 6, P = 0; P < g; ++P) { + var g = E.basisVectors.length, M = E.basisVectors, L = g + 2, T = s.updateGeoGroup(L), D = T.vertices, I, z, P, B, F, N, $ = T.vertexArray, k = T.normalArray, G = T.colorArray, H = T.faceArray; + for (I = D * 3, $[I] = o.x, $[I + 1] = o.y, $[I + 2] = o.z, k[I] = -a.x, k[I + 1] = -a.y, k[I + 2] = -a.z, G[I] = v.r, G[I + 1] = v.g, G[I + 2] = v.b, $[I + 3] = w.x, $[I + 4] = w.y, $[I + 5] = w.z, k[I + 3] = a.x, k[I + 4] = a.y, k[I + 5] = a.z, G[I + 3] = v.r, G[I + 4] = v.g, G[I + 5] = v.b, I += 6, P = 0; P < g; ++P) { var U = M[P].clone(); - U.multiplyScalar(p), z = l[0] * U.x + l[3] * U.y + l[6] * U.z, F = l[1] * U.x + l[4] * U.y + l[7] * U.z, N = l[5] * U.y + l[8] * U.z, $[R] = z + o.x, $[R + 1] = F + o.y, $[R + 2] = N + o.z, k[R] = z, k[R + 1] = F, k[R + 2] = N, G[R] = v.r, G[R + 1] = v.g, G[R + 2] = v.b, R += 3; + U.multiplyScalar(p), B = l[0] * U.x + l[3] * U.y + l[6] * U.z, F = l[1] * U.x + l[4] * U.y + l[7] * U.z, N = l[5] * U.y + l[8] * U.z, $[I] = B + o.x, $[I + 1] = F + o.y, $[I + 2] = N + o.z, k[I] = B, k[I + 1] = F, k[I + 2] = N, G[I] = v.r, G[I + 1] = v.g, G[I + 2] = v.b, I += 3; } - for (T.vertices += g + 2, B = T.faceidx, P = 0; P < g; P++) { + for (T.vertices += g + 2, z = T.faceidx, P = 0; P < g; P++) { var V = D + 2 + P, Q = D + 2 + (P + 1) % g; - H[B] = V, H[B + 1] = Q, H[B + 2] = D, B += 3, H[B] = V, H[B + 1] = Q, H[B + 2] = D + 1, B += 3; + H[z] = V, H[z + 1] = Q, H[z + 2] = D, z += 3, H[z] = V, H[z + 1] = Q, H[z + 2] = D + 1, z += 3; } T.faceidx += 6 * g; } - x.drawCone = C; + y.drawCone = C; class b { constructor() { this.cache = /* @__PURE__ */ new Map(); @@ -3986,13 +3986,13 @@ void main() { normals: [] }, a = 16 * w, l = 10 * w; o < 1 && (a = 10 * w, l = 8 * w); - var g = 0, M = Math.PI * 2, L = 0, T = Math.PI, D, R; - for (R = 0; R <= l; R++) { + var g = 0, M = Math.PI * 2, L = 0, T = Math.PI, D, I; + for (I = 0; I <= l; I++) { let P = []; for (D = 0; D <= a; D++) { - let z = D / a, F = R / l, N = -o * Math.cos(g + z * M) * Math.sin(L + F * T), $ = o * Math.cos(L + F * T), k = o * Math.sin(g + z * M) * Math.sin(L + F * T); - var B = new s.Vector3(N, $, k); - B.normalize(), v.vertices.push({ x: N, y: $, z: k }), v.normals.push(B), P.push(v.vertices.length - 1); + let B = D / a, F = I / l, N = -o * Math.cos(g + B * M) * Math.sin(L + F * T), $ = o * Math.cos(L + F * T), k = o * Math.sin(g + B * M) * Math.sin(L + F * T); + var z = new n.Vector3(N, $, k); + z.normalize(), v.vertices.push({ x: N, y: $, z: k }), v.normals.push(z), P.push(v.vertices.length - 1); } v.verticesRows.push(P); } @@ -4000,24 +4000,24 @@ void main() { } } var A = new b(); - function S(n, o, w, p, v) { - var a = A.getVerticesForRadius(w, v), l = a.vertices, g = a.normals, M = n.updateGeoGroup(l.length), L = M.vertices, T = M.vertexArray, D = M.colorArray, R = M.faceArray, B = M.lineArray, P = M.normalArray; + function S(s, o, w, p, v) { + var a = A.getVerticesForRadius(w, v), l = a.vertices, g = a.normals, M = s.updateGeoGroup(l.length), L = M.vertices, T = M.vertexArray, D = M.colorArray, I = M.faceArray, z = M.lineArray, P = M.normalArray; for (let N = 0, $ = l.length; N < $; ++N) { let k = 3 * (L + N), G = l[N]; T[k] = G.x + o.x, T[k + 1] = G.y + o.y, T[k + 2] = G.z + o.z, D[k] = p.r, D[k + 1] = p.g, D[k + 2] = p.b; } M.vertices += l.length; - let z = a.verticesRows, F = z.length - 1; + let B = a.verticesRows, F = B.length - 1; for (let N = 0; N < F; N++) { - let $ = z[N].length - 1; + let $ = B[N].length - 1; for (let k = 0; k < $; k++) { - let G = M.faceidx, H = M.lineidx, U = z[N][k + 1] + L, V = U * 3, Q = z[N][k] + L, oe = Q * 3, ee = z[N + 1][k] + L, ne = ee * 3, me = z[N + 1][k + 1] + L, se = me * 3, fe = g[U - L], Ce = g[Q - L], Me = g[ee - L], Te = g[me - L]; - Math.abs(l[U - L].y) === w ? (P[V] = fe.x, P[ne] = Me.x, P[se] = Te.x, P[V + 1] = fe.y, P[ne + 1] = Me.y, P[se + 1] = Te.y, P[V + 2] = fe.z, P[ne + 2] = Me.z, P[se + 2] = Te.z, R[G] = U, R[G + 1] = ee, R[G + 2] = me, B[H] = U, B[H + 1] = ee, B[H + 2] = U, B[H + 3] = me, B[H + 4] = ee, B[H + 5] = me, M.faceidx += 3, M.lineidx += 6) : Math.abs(l[ee - L].y) === w ? (P[V] = fe.x, P[oe] = Ce.x, P[ne] = Me.x, P[V + 1] = fe.y, P[oe + 1] = Ce.y, P[ne + 1] = Me.y, P[V + 2] = fe.z, P[oe + 2] = Ce.z, P[ne + 2] = Me.z, R[G] = U, R[G + 1] = Q, R[G + 2] = ee, B[H] = U, B[H + 1] = Q, B[H + 2] = U, B[H + 3] = ee, B[H + 4] = Q, B[H + 5] = ee, M.faceidx += 3, M.lineidx += 6) : (P[V] = fe.x, P[oe] = Ce.x, P[se] = Te.x, P[V + 1] = fe.y, P[oe + 1] = Ce.y, P[se + 1] = Te.y, P[V + 2] = fe.z, P[oe + 2] = Ce.z, P[se + 2] = Te.z, P[oe] = Ce.x, P[ne] = Me.x, P[se] = Te.x, P[oe + 1] = Ce.y, P[ne + 1] = Me.y, P[se + 1] = Te.y, P[oe + 2] = Ce.z, P[ne + 2] = Me.z, P[se + 2] = Te.z, R[G] = U, R[G + 1] = Q, R[G + 2] = me, R[G + 3] = Q, R[G + 4] = ee, R[G + 5] = me, B[H] = U, B[H + 1] = Q, B[H + 2] = U, B[H + 3] = me, B[H + 4] = Q, B[H + 5] = ee, B[H + 6] = ee, B[H + 7] = me, M.faceidx += 6, M.lineidx += 8); + let G = M.faceidx, H = M.lineidx, U = B[N][k + 1] + L, V = U * 3, Q = B[N][k] + L, ae = Q * 3, oe = B[N + 1][k] + L, q = oe * 3, me = B[N + 1][k + 1] + L, ne = me * 3, fe = g[U - L], Ce = g[Q - L], Me = g[oe - L], Te = g[me - L]; + Math.abs(l[U - L].y) === w ? (P[V] = fe.x, P[q] = Me.x, P[ne] = Te.x, P[V + 1] = fe.y, P[q + 1] = Me.y, P[ne + 1] = Te.y, P[V + 2] = fe.z, P[q + 2] = Me.z, P[ne + 2] = Te.z, I[G] = U, I[G + 1] = oe, I[G + 2] = me, z[H] = U, z[H + 1] = oe, z[H + 2] = U, z[H + 3] = me, z[H + 4] = oe, z[H + 5] = me, M.faceidx += 3, M.lineidx += 6) : Math.abs(l[oe - L].y) === w ? (P[V] = fe.x, P[ae] = Ce.x, P[q] = Me.x, P[V + 1] = fe.y, P[ae + 1] = Ce.y, P[q + 1] = Me.y, P[V + 2] = fe.z, P[ae + 2] = Ce.z, P[q + 2] = Me.z, I[G] = U, I[G + 1] = Q, I[G + 2] = oe, z[H] = U, z[H + 1] = Q, z[H + 2] = U, z[H + 3] = oe, z[H + 4] = Q, z[H + 5] = oe, M.faceidx += 3, M.lineidx += 6) : (P[V] = fe.x, P[ae] = Ce.x, P[ne] = Te.x, P[V + 1] = fe.y, P[ae + 1] = Ce.y, P[ne + 1] = Te.y, P[V + 2] = fe.z, P[ae + 2] = Ce.z, P[ne + 2] = Te.z, P[ae] = Ce.x, P[q] = Me.x, P[ne] = Te.x, P[ae + 1] = Ce.y, P[q + 1] = Me.y, P[ne + 1] = Te.y, P[ae + 2] = Ce.z, P[q + 2] = Me.z, P[ne + 2] = Te.z, I[G] = U, I[G + 1] = Q, I[G + 2] = me, I[G + 3] = Q, I[G + 4] = oe, I[G + 5] = me, z[H] = U, z[H + 1] = Q, z[H + 2] = U, z[H + 3] = me, z[H + 4] = Q, z[H + 5] = oe, z[H + 6] = oe, z[H + 7] = me, M.faceidx += 6, M.lineidx += 8); } } } - x.drawSphere = S; - })(_ || (_ = {})); + y.drawSphere = S; + })(u || (u = {})); } ), /***/ @@ -4035,22 +4035,22 @@ void main() { ) /* harmony export */ }); - var s = t( + var n = t( /*! ./WebGL */ "./src/WebGL/index.ts" ), f = t( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" - ), _ = t( + ), u = t( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), x = t( + ), y = t( /*! ./colors */ "./src/colors.ts" ), h = t( /*! ./GLDraw */ "./src/GLDraw.ts" - ), u = t( + ), _ = t( /*! ./glcartoon */ "./src/glcartoon.ts" ), E = t( @@ -4072,7 +4072,7 @@ void main() { /*! ./parsers/utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" ); - function n(w) { + function s(w) { let p; return typeof w == "string" ? p = new TextEncoder().encode(w) : p = new Uint8Array(w), (0, A.inflate)(p, { to: "string" @@ -4085,7 +4085,7 @@ void main() { return p && v ? JSON.stringify(p) == JSON.stringify(v) : p == v; } constructor(p, v) { - this.atoms = [], this.frames = [], this.box = null, this.atomdfs = null, this.id = 0, this.hidden = !1, this.molObj = null, this.renderedMolObj = null, this.lastColors = null, this.modelData = {}, this.modelDatas = null, this.idMatrix = new _.Matrix4(), this.dontDuplicateAtoms = !0, this.defaultColor = x.elementColors.defaultColor, this.defaultStickRadius = 0.25, this.options = v || {}, this.ElementColors = this.options.defaultcolors ? this.options.defaultcolors : x.elementColors.defaultColors, this.defaultSphereRadius = this.options.defaultSphereRadius ? this.options.defaultSphereRadius : 1.5, this.defaultCartoonQuality = this.options.cartoonQuality ? this.options.cartoonQuality : 10, this.id = p; + this.atoms = [], this.frames = [], this.box = null, this.atomdfs = null, this.id = 0, this.hidden = !1, this.molObj = null, this.renderedMolObj = null, this.lastColors = null, this.modelData = {}, this.modelDatas = null, this.idMatrix = new u.Matrix4(), this.dontDuplicateAtoms = !0, this.defaultColor = y.elementColors.defaultColor, this.defaultStickRadius = 0.25, this.options = v || {}, this.ElementColors = this.options.defaultcolors ? this.options.defaultcolors : y.elementColors.defaultColors, this.defaultSphereRadius = this.options.defaultSphereRadius ? this.options.defaultSphereRadius : 1.5, this.defaultCartoonQuality = this.options.cartoonQuality ? this.options.cartoonQuality : 10, this.id = p; } // return proper radius for atom given style /** @@ -4118,7 +4118,7 @@ void main() { var a = p.style.cross; if (!a.hidden) { var l = a.linewidth || o.defaultlineWidth; - v[l] || (v[l] = new s.Geometry()); + v[l] || (v[l] = new n.Geometry()); var g = v[l].updateGeoGroup(6), M = this.getRadiusFromStyle(p, a), L = [ [M, 0, 0], [-M, 0, 0], @@ -4128,10 +4128,10 @@ void main() { [0, 0, -M] ], T = p.clickable || p.hoverable; T && p.intersectionShape === void 0 && (p.intersectionShape = { sphere: [], cylinder: [], line: [] }); - for (var D = (0, E.getColorFromStyle)(p, a), R = g.vertexArray, B = g.colorArray, P = 0; P < 6; P++) { - var z = g.vertices * 3; - if (g.vertices++, R[z] = p.x + L[P][0], R[z + 1] = p.y + L[P][1], R[z + 2] = p.z + L[P][2], B[z] = D.r, B[z + 1] = D.g, B[z + 2] = D.b, T) { - var F = new _.Vector3(L[P][0], L[P][1], L[P][2]); + for (var D = (0, E.getColorFromStyle)(p, a), I = g.vertexArray, z = g.colorArray, P = 0; P < 6; P++) { + var B = g.vertices * 3; + if (g.vertices++, I[B] = p.x + L[P][0], I[B + 1] = p.y + L[P][1], I[B + 2] = p.z + L[P][2], z[B] = D.r, z[B + 1] = D.g, z[B + 2] = D.b, T) { + var F = new u.Vector3(L[P][0], L[P][1], L[P][2]); F.multiplyScalar(0.1), F.set(F.x + p.x, F.y + p.y, F.z + p.z), p.intersectionShape.line.push(F); } } @@ -4141,9 +4141,9 @@ void main() { getGoodCross(p, v, a, l) { for (var g = null, M = -1, L = 0, T = p.bonds.length; L < T; L++) if (p.bonds[L] != v.index) { - let R = p.bonds[L], B = this.atoms[R], z = new _.Vector3(B.x, B.y, B.z).clone(); - z.sub(a); - let F = z.clone(); + let I = p.bonds[L], z = this.atoms[I], B = new u.Vector3(z.x, z.y, z.z).clone(); + B.sub(a); + let F = B.clone(); F.cross(l); var D = F.lengthSq(); if (D > M && (M = D, g = F, M > 0.1)) @@ -4154,14 +4154,14 @@ void main() { //from atom, return a normalized vector v that is orthogonal and along which //it is appropraite to draw multiple bonds getSideBondV(p, v, a) { - var l, g, M, L, T, D = new _.Vector3(p.x, p.y, p.z), R = new _.Vector3(v.x, v.y, v.z), B = R.clone(), P = null; - if (B.sub(D), p.bonds.length === 1) - v.bonds.length === 1 ? (P = B.clone(), Math.abs(P.x) > 1e-4 ? P.y += 1 : P.x += 1) : (l = (a + 1) % v.bonds.length, g = v.bonds[l], M = this.atoms[g], L = new _.Vector3(M.x, M.y, M.z), T = L.clone(), T.sub(D), P = T.clone(), P.cross(B)); - else if (P = this.getGoodCross(p, v, D, B), P.lengthSq() < 0.01) { - var z = this.getGoodCross(v, p, D, B); - z != null && (P = z); + var l, g, M, L, T, D = new u.Vector3(p.x, p.y, p.z), I = new u.Vector3(v.x, v.y, v.z), z = I.clone(), P = null; + if (z.sub(D), p.bonds.length === 1) + v.bonds.length === 1 ? (P = z.clone(), Math.abs(P.x) > 1e-4 ? P.y += 1 : P.x += 1) : (l = (a + 1) % v.bonds.length, g = v.bonds[l], M = this.atoms[g], L = new u.Vector3(M.x, M.y, M.z), T = L.clone(), T.sub(D), P = T.clone(), P.cross(z)); + else if (P = this.getGoodCross(p, v, D, z), P.lengthSq() < 0.01) { + var B = this.getGoodCross(v, p, D, z); + B != null && (P = B); } - return P.lengthSq() < 0.01 && (P = B.clone(), Math.abs(P.x) > 1e-4 ? P.y += 1 : P.x += 1), P.cross(B), P.normalize(), P; + return P.lengthSq() < 0.01 && (P = z.clone(), Math.abs(P.x) > 1e-4 ? P.y += 1 : P.x += 1), P.cross(z), P.normalize(), P; } addLine(p, v, a, l, g, M) { p[a] = l.x, p[a + 1] = l.y, p[a + 2] = l.z, v[a] = M.r, v[a + 1] = M.g, v[a + 2] = M.b, p[a + 3] = g.x, p[a + 4] = g.y, p[a + 5] = g.z, v[a + 3] = M.r, v[a + 4] = M.g, v[a + 5] = M.b; @@ -4180,25 +4180,25 @@ void main() { var l = p.style.line; if (!l.hidden) { var g, M, L, T, D = l.linewidth || o.defaultlineWidth; - a[D] || (a[D] = new s.Geometry()); - for (var R = a[D].updateGeoGroup(6 * p.bonds.length), B = R.vertexArray, P = R.colorArray, z = 0; z < p.bonds.length; z++) { - var F = p.bonds[z], N = v[F]; + a[D] || (a[D] = new n.Geometry()); + for (var I = a[D].updateGeoGroup(6 * p.bonds.length), z = I.vertexArray, P = I.colorArray, B = 0; B < p.bonds.length; B++) { + var F = p.bonds[B], N = v[F]; if (N.style.line && !(p.index >= N.index)) { - var $ = new _.Vector3(p.x, p.y, p.z), k = new _.Vector3(N.x, N.y, N.z), G = $.clone().add(k).multiplyScalar(0.5), H = !1, U = p.clickable || p.hoverable, V = N.clickable || N.hoverable; + var $ = new u.Vector3(p.x, p.y, p.z), k = new u.Vector3(N.x, N.y, N.z), G = $.clone().add(k).multiplyScalar(0.5), H = !1, U = p.clickable || p.hoverable, V = N.clickable || N.hoverable; (U || V) && (U && (p.intersectionShape === void 0 && (p.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), p.intersectionShape.line.push($), p.intersectionShape.line.push(G)), V && (N.intersectionShape === void 0 && (N.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), N.intersectionShape.line.push(G), N.intersectionShape.line.push(k))); - var Q = (0, E.getColorFromStyle)(p, p.style.line), oe = (0, E.getColorFromStyle)(N, N.style.line); - if (p.bondStyles && p.bondStyles[z]) { - var ee = p.bondStyles[z]; - if (!ee.iswire) + var Q = (0, E.getColorFromStyle)(p, p.style.line), ae = (0, E.getColorFromStyle)(N, N.style.line); + if (p.bondStyles && p.bondStyles[B]) { + var oe = p.bondStyles[B]; + if (!oe.iswire) continue; - ee.singleBond && (H = !0), typeof ee.color1 < "u" && (Q = x.CC.color(ee.color1)), typeof ee.color2 < "u" && (oe = x.CC.color(ee.color2)); + oe.singleBond && (H = !0), typeof oe.color1 < "u" && (Q = y.CC.color(oe.color1)), typeof oe.color2 < "u" && (ae = y.CC.color(oe.color2)); } - var ne = R.vertices * 3, me, se; - if (p.bondOrder[z] > 1 && p.bondOrder[z] < 4 && !H) { - var fe = this.getSideBondV(p, N, z), Ce = k.clone(); - Ce.sub($), p.bondOrder[z] == 2 ? (fe.multiplyScalar(0.1), g = $.clone(), g.add(fe), M = $.clone(), M.sub(fe), L = g.clone(), L.add(Ce), T = M.clone(), T.add(Ce), Q == oe ? (R.vertices += 4, this.addLine(B, P, ne, g, L, Q), this.addLine(B, P, ne + 6, M, T, Q)) : (R.vertices += 8, Ce.multiplyScalar(0.5), me = g.clone(), me.add(Ce), se = M.clone(), se.add(Ce), this.addLine(B, P, ne, g, me, Q), this.addLine(B, P, ne + 6, me, L, oe), this.addLine(B, P, ne + 12, M, se, Q), this.addLine(B, P, ne + 18, se, T, oe))) : p.bondOrder[z] == 3 && (fe.multiplyScalar(0.1), g = $.clone(), g.add(fe), M = $.clone(), M.sub(fe), L = g.clone(), L.add(Ce), T = M.clone(), T.add(Ce), Q == oe ? (R.vertices += 6, this.addLine(B, P, ne, $, k, Q), this.addLine(B, P, ne + 6, g, L, Q), this.addLine(B, P, ne + 12, M, T, Q)) : (R.vertices += 12, Ce.multiplyScalar(0.5), me = g.clone(), me.add(Ce), se = M.clone(), se.add(Ce), this.addLine(B, P, ne, $, G, Q), this.addLine(B, P, ne + 6, G, k, oe), this.addLine(B, P, ne + 12, g, me, Q), this.addLine(B, P, ne + 18, me, L, oe), this.addLine(B, P, ne + 24, M, se, Q), this.addLine(B, P, ne + 30, se, T, oe))); + var q = I.vertices * 3, me, ne; + if (p.bondOrder[B] > 1 && p.bondOrder[B] < 4 && !H) { + var fe = this.getSideBondV(p, N, B), Ce = k.clone(); + Ce.sub($), p.bondOrder[B] == 2 ? (fe.multiplyScalar(0.1), g = $.clone(), g.add(fe), M = $.clone(), M.sub(fe), L = g.clone(), L.add(Ce), T = M.clone(), T.add(Ce), Q == ae ? (I.vertices += 4, this.addLine(z, P, q, g, L, Q), this.addLine(z, P, q + 6, M, T, Q)) : (I.vertices += 8, Ce.multiplyScalar(0.5), me = g.clone(), me.add(Ce), ne = M.clone(), ne.add(Ce), this.addLine(z, P, q, g, me, Q), this.addLine(z, P, q + 6, me, L, ae), this.addLine(z, P, q + 12, M, ne, Q), this.addLine(z, P, q + 18, ne, T, ae))) : p.bondOrder[B] == 3 && (fe.multiplyScalar(0.1), g = $.clone(), g.add(fe), M = $.clone(), M.sub(fe), L = g.clone(), L.add(Ce), T = M.clone(), T.add(Ce), Q == ae ? (I.vertices += 6, this.addLine(z, P, q, $, k, Q), this.addLine(z, P, q + 6, g, L, Q), this.addLine(z, P, q + 12, M, T, Q)) : (I.vertices += 12, Ce.multiplyScalar(0.5), me = g.clone(), me.add(Ce), ne = M.clone(), ne.add(Ce), this.addLine(z, P, q, $, G, Q), this.addLine(z, P, q + 6, G, k, ae), this.addLine(z, P, q + 12, g, me, Q), this.addLine(z, P, q + 18, me, L, ae), this.addLine(z, P, q + 24, M, ne, Q), this.addLine(z, P, q + 30, ne, T, ae))); } else - Q == oe ? (R.vertices += 2, this.addLine(B, P, ne, $, k, Q)) : (R.vertices += 4, this.addLine(B, P, ne, $, G, Q), this.addLine(B, P, ne + 6, G, k, oe)); + Q == ae ? (I.vertices += 2, this.addLine(z, P, q, $, k, Q)) : (I.vertices += 4, this.addLine(z, P, q, $, G, Q), this.addLine(z, P, q + 6, G, k, ae)); } } } @@ -4217,7 +4217,7 @@ void main() { if (!a.hidden) { var l = (0, E.getColorFromStyle)(p, a), g = this.getRadiusFromStyle(p, a); if ((p.clickable === !0 || p.hoverable) && p.intersectionShape !== void 0) { - var M = new _.Vector3(p.x, p.y, p.z); + var M = new u.Vector3(p.x, p.y, p.z); p.intersectionShape.sphere.push(new f.Sphere(M, g)); } h.GLDraw.drawSphere(v, p, g, l); @@ -4231,7 +4231,7 @@ void main() { if (!v.hidden) { var a = this.getRadiusFromStyle(p, v); if ((p.clickable === !0 || p.hoverable) && p.intersectionShape !== void 0) { - var l = new _.Vector3(p.x, p.y, p.z); + var l = new u.Vector3(p.x, p.y, p.z); p.intersectionShape.sphere.push(new f.Sphere(l, a)); } } @@ -4241,9 +4241,9 @@ void main() { if (p.style.sphere) { var a = p.style.sphere; if (!a.hidden) { - var l = this.getRadiusFromStyle(p, a), g = (0, E.getColorFromStyle)(p, a), M = v.updateGeoGroup(1), L = M.vertices, T = L * 3, D = M.vertexArray, R = M.colorArray, B = M.radiusArray; - if (D[T] = p.x, D[T + 1] = p.y, D[T + 2] = p.z, R[T] = g.r, R[T + 1] = g.g, R[T + 2] = g.b, B[L] = l, (p.clickable === !0 || p.hoverable) && p.intersectionShape !== void 0) { - var P = new _.Vector3(p.x, p.y, p.z); + var l = this.getRadiusFromStyle(p, a), g = (0, E.getColorFromStyle)(p, a), M = v.updateGeoGroup(1), L = M.vertices, T = L * 3, D = M.vertexArray, I = M.colorArray, z = M.radiusArray; + if (D[T] = p.x, D[T + 1] = p.y, D[T + 2] = p.z, I[T] = g.r, I[T + 1] = g.g, I[T + 2] = g.b, z[L] = l, (p.clickable === !0 || p.hoverable) && p.intersectionShape !== void 0) { + var P = new u.Vector3(p.x, p.y, p.z); p.intersectionShape.sphere.push(new f.Sphere(P, l)); } M.vertices += 1; @@ -4251,15 +4251,15 @@ void main() { } } drawSphereImposter(p, v, a, l) { - var g = p.updateGeoGroup(4), M, L = g.vertices, T = L * 3, D = g.vertexArray, R = g.colorArray; + var g = p.updateGeoGroup(4), M, L = g.vertices, T = L * 3, D = g.vertexArray, I = g.colorArray; for (M = 0; M < 4; M++) D[T + 3 * M] = v.x, D[T + 3 * M + 1] = v.y, D[T + 3 * M + 2] = v.z; - var B = g.normalArray; + var z = g.normalArray; for (M = 0; M < 4; M++) - R[T + 3 * M] = l.r, R[T + 3 * M + 1] = l.g, R[T + 3 * M + 2] = l.b; - B[T + 0] = -a, B[T + 1] = a, B[T + 2] = 0, B[T + 3] = -a, B[T + 4] = -a, B[T + 5] = 0, B[T + 6] = a, B[T + 7] = -a, B[T + 8] = 0, B[T + 9] = a, B[T + 10] = a, B[T + 11] = 0, g.vertices += 4; - var P = g.faceArray, z = g.faceidx; - P[z + 0] = L, P[z + 1] = L + 1, P[z + 2] = L + 2, P[z + 3] = L + 2, P[z + 4] = L + 3, P[z + 5] = L, g.faceidx += 6; + I[T + 3 * M] = l.r, I[T + 3 * M + 1] = l.g, I[T + 3 * M + 2] = l.b; + z[T + 0] = -a, z[T + 1] = a, z[T + 2] = 0, z[T + 3] = -a, z[T + 4] = -a, z[T + 5] = 0, z[T + 6] = a, z[T + 7] = -a, z[T + 8] = 0, z[T + 9] = a, z[T + 10] = a, z[T + 11] = 0, g.vertices += 4; + var P = g.faceArray, B = g.faceidx; + P[B + 0] = L, P[B + 1] = L + 1, P[B + 2] = L + 2, P[B + 3] = L + 2, P[B + 4] = L + 3, P[B + 5] = L, g.faceidx += 6; } //dkoes - code for sphere imposters drawAtomImposter(p, v) { @@ -4268,7 +4268,7 @@ void main() { if (!a.hidden) { var l = this.getRadiusFromStyle(p, a), g = (0, E.getColorFromStyle)(p, a); if ((p.clickable === !0 || p.hoverable) && p.intersectionShape !== void 0) { - var M = new _.Vector3(p.x, p.y, p.z); + var M = new u.Vector3(p.x, p.y, p.z); p.intersectionShape.sphere.push(new f.Sphere(M, l)); } this.drawSphereImposter(v, p, l, g); @@ -4276,12 +4276,12 @@ void main() { } } static drawStickImposter(p, v, a, l, g) { - for (var M = p.updateGeoGroup(4), L = M.vertices, T = L * 3, D = M.vertexArray, R = M.colorArray, B = M.radiusArray, P = M.normalArray, z = g.r, F = g.g, N = g.b, $ = function(V) { + for (var M = p.updateGeoGroup(4), L = M.vertices, T = L * 3, D = M.vertexArray, I = M.colorArray, z = M.radiusArray, P = M.normalArray, B = g.r, F = g.g, N = g.b, $ = function(V) { var Q = -V; return Q == 0 && (Q = -1e-4), Q; }, k = T, G = 0; G < 4; G++) - D[k] = v.x, P[k] = a.x, R[k] = z, k++, D[k] = v.y, P[k] = a.y, R[k] = F, k++, D[k] = v.z, P[k] = a.z, G < 2 ? R[k] = N : R[k] = $(N), k++; - M.vertices += 4, B[L] = -l, B[L + 1] = l, B[L + 2] = -l, B[L + 3] = l; + D[k] = v.x, P[k] = a.x, I[k] = B, k++, D[k] = v.y, P[k] = a.y, I[k] = F, k++, D[k] = v.z, P[k] = a.z, G < 2 ? I[k] = N : I[k] = $(N), k++; + M.vertices += 4, z[L] = -l, z[L + 1] = l, z[L + 2] = -l, z[L + 3] = l; var H = M.faceArray, U = M.faceidx; H[U + 0] = L, H[U + 1] = L + 1, H[U + 2] = L + 2, H[U + 3] = L + 2, H[U + 4] = L + 3, H[U + 5] = L, M.faceidx += 6; } @@ -4290,12 +4290,12 @@ void main() { if (p.style.stick) { var l = p.style.stick; if (!l.hidden) { - var g = l.radius || this.defaultStickRadius, M = l.doubleBondScaling || 0.4, L = l.tripleBondScaling || 0.25, T = g, D = l.singleBonds || !1, R = 0, B = 0, P, z, F, N, $, k, G, H, U, V, Q, oe = (0, E.getColorFromStyle)(p, l), ee, ne, me; - !p.capDrawn && p.bonds.length < 4 && (R = 2); - var se = h.GLDraw.drawCylinder; - for (a.imposter && (se = o.drawStickImposter), F = 0; F < p.bonds.length; F++) { + var g = l.radius || this.defaultStickRadius, M = l.doubleBondScaling || 0.4, L = l.tripleBondScaling || 0.25, T = g, D = l.singleBonds || !1, I = 0, z = 0, P, B, F, N, $, k, G, H, U, V, Q, ae = (0, E.getColorFromStyle)(p, l), oe, q, me; + !p.capDrawn && p.bonds.length < 4 && (I = 2); + var ne = h.GLDraw.drawCylinder; + for (a.imposter && (ne = o.drawStickImposter), F = 0; F < p.bonds.length; F++) { var fe = p.bonds[F], Ce = v[fe]; - if (ee = ne = me = null, p.index < Ce.index) { + if (oe = q = me = null, p.index < Ce.index) { var Me = Ce.style; if (!Me.stick || Me.stick.hidden) continue; @@ -4303,17 +4303,17 @@ void main() { if (T = g, N = D, p.bondStyles && p.bondStyles[F]) { if ($ = p.bondStyles[F], $.iswire) continue; - $.radius && (T = $.radius), $.singleBond && (N = !0), typeof $.color1 < "u" && (oe = x.CC.color($.color1)), typeof $.color2 < "u" && (Te = x.CC.color($.color2)); + $.radius && (T = $.radius), $.singleBond && (N = !0), typeof $.color1 < "u" && (ae = y.CC.color($.color1)), typeof $.color2 < "u" && (Te = y.CC.color($.color2)); } - var ae = new _.Vector3(p.x, p.y, p.z), pe = new _.Vector3(Ce.x, Ce.y, Ce.z); + var se = new u.Vector3(p.x, p.y, p.z), pe = new u.Vector3(Ce.x, Ce.y, Ce.z); if (p.bondOrder[F] <= 1 || N || p.bondOrder[F] > 3) { - if (p.bondOrder[F] < 1 && (T *= p.bondOrder[F]), !Ce.capDrawn && Ce.bonds.length < 4 && (B = 2), oe != Te ? (ee = new _.Vector3().addVectors(ae, pe).multiplyScalar(0.5), se(a, ae, ee, T, oe, R, 0), se(a, ee, pe, T, Te, 0, B)) : se(a, ae, pe, T, oe, R, B), P = p.clickable || p.hoverable, z = Ce.clickable || Ce.hoverable, P || z) { - if (ee || (ee = new _.Vector3().addVectors(ae, pe).multiplyScalar(0.5)), P) { - var we = new f.Cylinder(ae, ee, T), ke = new f.Sphere(ae, T); + if (p.bondOrder[F] < 1 && (T *= p.bondOrder[F]), !Ce.capDrawn && Ce.bonds.length < 4 && (z = 2), ae != Te ? (oe = new u.Vector3().addVectors(se, pe).multiplyScalar(0.5), ne(a, se, oe, T, ae, I, 0), ne(a, oe, pe, T, Te, 0, z)) : ne(a, se, pe, T, ae, I, z), P = p.clickable || p.hoverable, B = Ce.clickable || Ce.hoverable, P || B) { + if (oe || (oe = new u.Vector3().addVectors(se, pe).multiplyScalar(0.5)), P) { + var we = new f.Cylinder(se, oe, T), ke = new f.Sphere(se, T); p.intersectionShape.cylinder.push(we), p.intersectionShape.sphere.push(ke); } - if (z) { - var Ue = new f.Cylinder(pe, ee, T), Ne = new f.Sphere(pe, T); + if (B) { + var Ue = new f.Cylinder(pe, oe, T), Ne = new f.Sphere(pe, T); Ce.intersectionShape.cylinder.push(Ue), Ce.intersectionShape.sphere.push(Ne); } } @@ -4321,16 +4321,16 @@ void main() { var Be = 0, ue = 0; T != g && (Be = 2, ue = 2); var ye = pe.clone(), ge = null; - ye.sub(ae); + ye.sub(se); var Se, ze, He, We, Y; - ge = this.getSideBondV(p, Ce, F), p.bondOrder[F] == 2 ? (Se = T * M, ge.multiplyScalar(Se * 1.5), ze = ae.clone(), ze.add(ge), He = ae.clone(), He.sub(ge), We = ze.clone(), We.add(ye), Y = He.clone(), Y.add(ye), oe != Te ? (ee = new _.Vector3().addVectors(ze, We).multiplyScalar(0.5), ne = new _.Vector3().addVectors(He, Y).multiplyScalar(0.5), se(a, ze, ee, Se, oe, Be, 0), se(a, ee, We, Se, Te, 0, ue), se(a, He, ne, Se, oe, Be, 0), se(a, ne, Y, Se, Te, 0, ue)) : (se(a, ze, We, Se, oe, Be, ue), se(a, He, Y, Se, oe, Be, ue)), P = p.clickable || p.hoverable, z = Ce.clickable || Ce.hoverable, (P || z) && (ee || (ee = new _.Vector3().addVectors(ze, We).multiplyScalar(0.5)), ne || (ne = new _.Vector3().addVectors(He, Y).multiplyScalar(0.5)), P && (k = new f.Cylinder(ze, ee, Se), G = new f.Cylinder(He, ne, Se), p.intersectionShape.cylinder.push(k), p.intersectionShape.cylinder.push(G)), z && (U = new f.Cylinder(We, ee, Se), V = new f.Cylinder(Y, ne, Se), Ce.intersectionShape.cylinder.push(U), Ce.intersectionShape.cylinder.push(V)))) : p.bondOrder[F] == 3 && (Se = T * L, ge.cross(ye), ge.normalize(), ge.multiplyScalar(Se * 3), ze = ae.clone(), ze.add(ge), He = ae.clone(), He.sub(ge), We = ze.clone(), We.add(ye), Y = He.clone(), Y.add(ye), oe != Te ? (ee = new _.Vector3().addVectors(ze, We).multiplyScalar(0.5), ne = new _.Vector3().addVectors(He, Y).multiplyScalar(0.5), me = new _.Vector3().addVectors(ae, pe).multiplyScalar(0.5), se(a, ze, ee, Se, oe, Be, 0), se(a, ee, We, Se, Te, 0, ue), se(a, ae, me, Se, oe, R, 0), se(a, me, pe, Se, Te, 0, B), se(a, He, ne, Se, oe, Be, 0), se(a, ne, Y, Se, Te, 0, ue)) : (se(a, ze, We, Se, oe, Be, ue), se(a, ae, pe, Se, oe, R, B), se(a, He, Y, Se, oe, Be, ue)), P = p.clickable || p.hoverable, z = Ce.clickable || Ce.hoverable, (P || z) && (ee || (ee = new _.Vector3().addVectors(ze, We).multiplyScalar(0.5)), ne || (ne = new _.Vector3().addVectors(He, Y).multiplyScalar(0.5)), me || (me = new _.Vector3().addVectors(ae, pe).multiplyScalar(0.5)), P && (k = new f.Cylinder(ze.clone(), ee.clone(), Se), G = new f.Cylinder(He.clone(), ne.clone(), Se), H = new f.Cylinder(ae.clone(), me.clone(), Se), p.intersectionShape.cylinder.push(k), p.intersectionShape.cylinder.push(G), p.intersectionShape.cylinder.push(H)), z && (U = new f.Cylinder(We.clone(), ee.clone(), Se), V = new f.Cylinder(Y.clone(), ne.clone(), Se), Q = new f.Cylinder(pe.clone(), me.clone(), Se), Ce.intersectionShape.cylinder.push(U), Ce.intersectionShape.cylinder.push(V), Ce.intersectionShape.cylinder.push(Q)))); + ge = this.getSideBondV(p, Ce, F), p.bondOrder[F] == 2 ? (Se = T * M, ge.multiplyScalar(Se * 1.5), ze = se.clone(), ze.add(ge), He = se.clone(), He.sub(ge), We = ze.clone(), We.add(ye), Y = He.clone(), Y.add(ye), ae != Te ? (oe = new u.Vector3().addVectors(ze, We).multiplyScalar(0.5), q = new u.Vector3().addVectors(He, Y).multiplyScalar(0.5), ne(a, ze, oe, Se, ae, Be, 0), ne(a, oe, We, Se, Te, 0, ue), ne(a, He, q, Se, ae, Be, 0), ne(a, q, Y, Se, Te, 0, ue)) : (ne(a, ze, We, Se, ae, Be, ue), ne(a, He, Y, Se, ae, Be, ue)), P = p.clickable || p.hoverable, B = Ce.clickable || Ce.hoverable, (P || B) && (oe || (oe = new u.Vector3().addVectors(ze, We).multiplyScalar(0.5)), q || (q = new u.Vector3().addVectors(He, Y).multiplyScalar(0.5)), P && (k = new f.Cylinder(ze, oe, Se), G = new f.Cylinder(He, q, Se), p.intersectionShape.cylinder.push(k), p.intersectionShape.cylinder.push(G)), B && (U = new f.Cylinder(We, oe, Se), V = new f.Cylinder(Y, q, Se), Ce.intersectionShape.cylinder.push(U), Ce.intersectionShape.cylinder.push(V)))) : p.bondOrder[F] == 3 && (Se = T * L, ge.cross(ye), ge.normalize(), ge.multiplyScalar(Se * 3), ze = se.clone(), ze.add(ge), He = se.clone(), He.sub(ge), We = ze.clone(), We.add(ye), Y = He.clone(), Y.add(ye), ae != Te ? (oe = new u.Vector3().addVectors(ze, We).multiplyScalar(0.5), q = new u.Vector3().addVectors(He, Y).multiplyScalar(0.5), me = new u.Vector3().addVectors(se, pe).multiplyScalar(0.5), ne(a, ze, oe, Se, ae, Be, 0), ne(a, oe, We, Se, Te, 0, ue), ne(a, se, me, Se, ae, I, 0), ne(a, me, pe, Se, Te, 0, z), ne(a, He, q, Se, ae, Be, 0), ne(a, q, Y, Se, Te, 0, ue)) : (ne(a, ze, We, Se, ae, Be, ue), ne(a, se, pe, Se, ae, I, z), ne(a, He, Y, Se, ae, Be, ue)), P = p.clickable || p.hoverable, B = Ce.clickable || Ce.hoverable, (P || B) && (oe || (oe = new u.Vector3().addVectors(ze, We).multiplyScalar(0.5)), q || (q = new u.Vector3().addVectors(He, Y).multiplyScalar(0.5)), me || (me = new u.Vector3().addVectors(se, pe).multiplyScalar(0.5)), P && (k = new f.Cylinder(ze.clone(), oe.clone(), Se), G = new f.Cylinder(He.clone(), q.clone(), Se), H = new f.Cylinder(se.clone(), me.clone(), Se), p.intersectionShape.cylinder.push(k), p.intersectionShape.cylinder.push(G), p.intersectionShape.cylinder.push(H)), B && (U = new f.Cylinder(We.clone(), oe.clone(), Se), V = new f.Cylinder(Y.clone(), q.clone(), Se), Q = new f.Cylinder(pe.clone(), me.clone(), Se), Ce.intersectionShape.cylinder.push(U), Ce.intersectionShape.cylinder.push(V), Ce.intersectionShape.cylinder.push(Q)))); } } } - var K = !1, q = 0, de = !1; + var K = !1, ee = 0, de = !1; for (F = 0; F < p.bonds.length; F++) - N = D, p.bondStyles && p.bondStyles[F] && ($ = p.bondStyles[F], $.singleBond && (N = !0), $.radius && $.radius != g && (de = !0)), (N || p.bondOrder[F] == 1) && q++; - de ? q > 0 && (K = !0) : q == 0 && (p.bonds.length > 0 || l.showNonBonded) && (K = !0), K && (T = g, a.imposter ? this.drawSphereImposter(a.sphereGeometry, p, T, oe) : h.GLDraw.drawSphere(a, p, T, oe)); + N = D, p.bondStyles && p.bondStyles[F] && ($ = p.bondStyles[F], $.singleBond && (N = !0), $.radius && $.radius != g && (de = !0)), (N || p.bondOrder[F] == 1) && ee++; + de ? ee > 0 && (K = !0) : ee == 0 && (p.bonds.length > 0 || l.showNonBonded) && (K = !0), K && (T = g, a.imposter ? this.drawSphereImposter(a.sphereGeometry, p, T, ae) : h.GLDraw.drawSphere(a, p, T, ae)); } } } @@ -4342,77 +4342,77 @@ void main() { /** param {AtomSpec[]} atoms */ createMolObj(p, v) { v = v || {}; - var a = new s.Object3D(), l = [], g = {}, M = {}, L = this.drawAtomSphere, T = null, D = null; - v.supportsImposters ? (L = this.drawAtomImposter, T = new s.Geometry(!0), T.imposter = !0, D = new s.Geometry(!0, !0), D.imposter = !0, D.sphereGeometry = new s.Geometry(!0), D.sphereGeometry.imposter = !0, D.drawnCaps = {}) : v.supportsAIA ? (L = this.drawAtomInstanced, T = new s.Geometry(!1, !0, !0), T.instanced = !0, D = new s.Geometry(!0)) : (T = new s.Geometry(!0), D = new s.Geometry(!0)); - var R, B, P, z, F = {}, N = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; - for (R = 0, P = p.length; R < P; R++) { - var $ = p[R]; + var a = new n.Object3D(), l = [], g = {}, M = {}, L = this.drawAtomSphere, T = null, D = null; + v.supportsImposters ? (L = this.drawAtomImposter, T = new n.Geometry(!0), T.imposter = !0, D = new n.Geometry(!0, !0), D.imposter = !0, D.sphereGeometry = new n.Geometry(!0), D.sphereGeometry.imposter = !0, D.drawnCaps = {}) : v.supportsAIA ? (L = this.drawAtomInstanced, T = new n.Geometry(!1, !0, !0), T.instanced = !0, D = new n.Geometry(!0)) : (T = new n.Geometry(!0), D = new n.Geometry(!0)); + var I, z, P, B, F = {}, N = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]; + for (I = 0, P = p.length; I < P; I++) { + var $ = p[I]; if ($ && $.style) { - ($.clickable || $.hoverable) && $.intersectionShape === void 0 && ($.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), z = { line: void 0, cross: void 0, stick: void 0, sphere: void 0 }; - for (B in z) - $.style[B] ? $.style[B].opacity ? z[B] = parseFloat($.style[B].opacity) : z[B] = 1 : z[B] = void 0, F[B] ? z[B] != null && F[B] != z[B] && (console.log("Warning: " + B + " opacity is ambiguous"), F[B] = 1) : F[B] = z[B]; + ($.clickable || $.hoverable) && $.intersectionShape === void 0 && ($.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), B = { line: void 0, cross: void 0, stick: void 0, sphere: void 0 }; + for (z in B) + $.style[z] ? $.style[z].opacity ? B[z] = parseFloat($.style[z].opacity) : B[z] = 1 : B[z] = void 0, F[z] ? B[z] != null && F[z] != B[z] && (console.log("Warning: " + z + " opacity is ambiguous"), F[z] = 1) : F[z] = B[z]; L.call(this, $, T), this.drawAtomClickSphere($), this.drawAtomCross($, M), this.drawBondLines($, p, g), this.drawBondSticks($, p, D), typeof $.style.cartoon < "u" && !$.style.cartoon.hidden && ($.style.cartoon.color === "spectrum" && typeof $.resi == "number" && !$.hetflag && ($.resi < N[0] && (N[0] = $.resi), $.resi > N[1] && (N[1] = $.resi)), l.push($)); } } - if (l.length > 0 && (0, u.drawCartoon)(a, l, N, this.defaultCartoonQuality), T && T.vertices > 0) { + if (l.length > 0 && (0, _.drawCartoon)(a, l, N, this.defaultCartoonQuality), T && T.vertices > 0) { T.initTypedArrays(); var k = null, G = null; - T.imposter ? k = new s.SphereImposterMaterial({ + T.imposter ? k = new n.SphereImposterMaterial({ ambient: 0, vertexColors: !0, reflectivity: 0 - }) : T.instanced ? (G = new s.Geometry(!0), h.GLDraw.drawSphere(G, { x: 0, y: 0, z: 0 }, 1, new x.Color(0.5, 0.5, 0.5)), G.initTypedArrays(), k = new s.InstancedMaterial({ - sphereMaterial: new s.MeshLambertMaterial({ + }) : T.instanced ? (G = new n.Geometry(!0), h.GLDraw.drawSphere(G, { x: 0, y: 0, z: 0 }, 1, new y.Color(0.5, 0.5, 0.5)), G.initTypedArrays(), k = new n.InstancedMaterial({ + sphereMaterial: new n.MeshLambertMaterial({ ambient: 0, vertexColors: !0, reflectivity: 0 }), sphere: G - })) : k = new s.MeshLambertMaterial({ + })) : k = new n.MeshLambertMaterial({ ambient: 0, vertexColors: !0, reflectivity: 0 - }), F.sphere < 1 && F.sphere >= 0 && (k.transparent = !0, k.opacity = F.sphere), G = new s.Mesh(T, k), a.add(G); + }), F.sphere < 1 && F.sphere >= 0 && (k.transparent = !0, k.opacity = F.sphere), G = new n.Mesh(T, k), a.add(G); } if (D.vertices > 0) { var H = null, U = null, V = D.sphereGeometry; (!V || typeof V.vertices > "u" || V.vertices == 0) && (V = null), D.initTypedArrays(), V && V.initTypedArrays(); var Q = { ambient: 0, vertexColors: !0, reflectivity: 0 }; - D.imposter ? (H = new s.StickImposterMaterial(Q), U = new s.SphereImposterMaterial(Q)) : (H = new s.MeshLambertMaterial(Q), U = new s.MeshLambertMaterial(Q), H.wireframe && (D.setUpWireframe(), V && V.setUpWireframe())), F.stick < 1 && F.stick >= 0 && (H.transparent = !0, H.opacity = F.stick, U.transparent = !0, U.opacity = F.stick); - var oe = new s.Mesh(D, H); - if (a.add(oe), V) { - var ee = new s.Mesh(V, U); - a.add(ee); + D.imposter ? (H = new n.StickImposterMaterial(Q), U = new n.SphereImposterMaterial(Q)) : (H = new n.MeshLambertMaterial(Q), U = new n.MeshLambertMaterial(Q), H.wireframe && (D.setUpWireframe(), V && V.setUpWireframe())), F.stick < 1 && F.stick >= 0 && (H.transparent = !0, H.opacity = F.stick, U.transparent = !0, U.opacity = F.stick); + var ae = new n.Mesh(D, H); + if (a.add(ae), V) { + var oe = new n.Mesh(V, U); + a.add(oe); } } - var ne; - for (R in g) - if (g.hasOwnProperty(R)) { - ne = R; - var me = new s.LineBasicMaterial({ - linewidth: ne, + var q; + for (I in g) + if (g.hasOwnProperty(I)) { + q = I; + var me = new n.LineBasicMaterial({ + linewidth: q, vertexColors: !0 }); - F.line < 1 && F.line >= 0 && (me.transparent = !0, me.opacity = F.line), g[R].initTypedArrays(); - var se = new s.Line(g[R], me, s.LineStyle.LinePieces); - a.add(se); + F.line < 1 && F.line >= 0 && (me.transparent = !0, me.opacity = F.line), g[I].initTypedArrays(); + var ne = new n.Line(g[I], me, n.LineStyle.LinePieces); + a.add(ne); } - for (R in M) - if (M.hasOwnProperty(R)) { - ne = R; - var fe = new s.LineBasicMaterial({ - linewidth: ne, + for (I in M) + if (M.hasOwnProperty(I)) { + q = I; + var fe = new n.LineBasicMaterial({ + linewidth: q, vertexColors: !0 }); - F.cross < 1 && F.cross >= 0 && (fe.transparent = !0, fe.opacity = F.cross), M[R].initTypedArrays(); - var Ce = new s.Line(M[R], fe, s.LineStyle.LinePieces); + F.cross < 1 && F.cross >= 0 && (fe.transparent = !0, fe.opacity = F.cross), M[I].initTypedArrays(); + var Ce = new n.Line(M[I], fe, n.LineStyle.LinePieces); a.add(Ce); } if (this.dontDuplicateAtoms && this.modelData.symmetries && this.modelData.symmetries.length > 0) { - var Me = new s.Object3D(), Te; + var Me = new n.Object3D(), Te; for (Te = 0; Te < this.modelData.symmetries.length; Te++) { - var ae = new s.Object3D(); - ae = a.clone(), ae.matrix.copy(this.modelData.symmetries[Te]), ae.matrixAutoUpdate = !1, Me.add(ae); + var se = new n.Object3D(); + se = a.clone(), se.matrix.copy(this.modelData.symmetries[Te]), se.matrixAutoUpdate = !1, Me.add(se); } return Me; } @@ -4445,7 +4445,7 @@ void main() { if (this.modelData.cryst) { if (!this.modelData.cryst.matrix) { const p = this.modelData.cryst; - this.modelData.cryst.matrix = (0, _.conversionMatrix3)(p.a, p.b, p.c, p.alpha, p.beta, p.gamma); + this.modelData.cryst.matrix = (0, u.conversionMatrix3)(p.a, p.b, p.c, p.alpha, p.beta, p.gamma); } return this.modelData.cryst; } else @@ -4464,7 +4464,7 @@ void main() { */ setCrystData(p, v, a, l, g, M) { p = p || 1, v = v || 1, a = a || 1, l = l || 90, g = g || 90, M = M || 90; - const L = (0, _.conversionMatrix3)(p, v, a, l, g, M); + const L = (0, u.conversionMatrix3)(p, v, a, l, g, M); this.modelData.cryst = { a: p, b: v, @@ -4484,7 +4484,7 @@ void main() { * @param {Matrix3} matrix - unit cell matrix */ setCrystMatrix(p) { - p = p || new _.Matrix3(1, 0, 0, 0, 1, 0, 0, 0, 1), this.modelData.cryst = { + p = p || new u.Matrix3(1, 0, 0, 0, 1, 0, 0, 0, 1), this.modelData.cryst = { matrix: p }; } @@ -4533,8 +4533,8 @@ void main() { if (this.box && this.atomdfs) for (var p = this.box[0], v = this.box[1], a = this.box[2], l = p * 0.9, g = v * 0.9, M = a * 0.9, L = 0; L < this.atomdfs.length; L++) for (var T = this.atomdfs[L], D = 1; D < T.length; D++) { - var R = this.atoms[T[D][0]], B = this.atoms[T[D][1]]; - R.x = this.adjustCoord(B.x, R.x, l, p), R.y = this.adjustCoord(B.y, R.y, g, v), R.z = this.adjustCoord(B.z, R.z, M, a); + var I = this.atoms[T[D][0]], z = this.atoms[T[D][1]]; + I.x = this.adjustCoord(z.x, I.x, l, p), I.y = this.adjustCoord(z.y, I.y, g, v), I.z = this.adjustCoord(z.z, I.z, M, a); } } /** @@ -4551,8 +4551,8 @@ void main() { if (a == 0 && g(), (p < 0 || p >= a) && (p = a - 1), l.frames.url != null) { var L = l.frames.url; (0, E.getbin)(L + "/traj/frame/" + p + "/" + l.frames.path, void 0, "POST", void 0).then(function(T) { - for (var D = new Float32Array(T, 44), R = 0, B = 0; B < l.atoms.length; B++) - l.atoms[B].x = D[R++], l.atoms[B].y = D[R++], l.atoms[B].z = D[R++]; + for (var D = new Float32Array(T, 44), I = 0, z = 0; z < l.atoms.length; z++) + l.atoms[z].x = D[I++], l.atoms[z].y = D[I++], l.atoms[z].z = D[I++]; l.box && l.atomdfs && l.adjustCoordinatesToBox(), g(); }).catch(M); } else @@ -4592,20 +4592,20 @@ void main() { var M = 0, L = p; a && (M = -p, L = p), this.frames !== void 0 && this.frames.origIndex !== void 0 ? this.setFrame(this.frames.origIndex) : this.setFrame(0), M < L && (this.frames = []), a && (this.frames.origIndex = p); for (var T = M; T < L; T++) { - var D = [], R = this.frames.length; + var D = [], I = this.frames.length; if (T == 0 && !g) { this.frames.push(this.atoms); continue; } - for (var B = 0; B < this.atoms.length; B++) { - var P = (0, E.getAtomProperty)(this.atoms[B], "dx"), z = (0, E.getAtomProperty)(this.atoms[B], "dy"), F = (0, E.getAtomProperty)(this.atoms[B], "dz"), N = new _.Vector3(P, z, F), $ = new _.Vector3(this.atoms[B].x, this.atoms[B].y, this.atoms[B].z), k = T * v / p; + for (var z = 0; z < this.atoms.length; z++) { + var P = (0, E.getAtomProperty)(this.atoms[z], "dx"), B = (0, E.getAtomProperty)(this.atoms[z], "dy"), F = (0, E.getAtomProperty)(this.atoms[z], "dz"), N = new u.Vector3(P, B, F), $ = new u.Vector3(this.atoms[z].x, this.atoms[z].y, this.atoms[z].z), k = T * v / p; N.multiplyScalar(k), $.add(N); var G = {}; - for (var H in this.atoms[B]) - G[H] = this.atoms[B][H]; + for (var H in this.atoms[z]) + G[H] = this.atoms[z][H]; if (G.x = $.x, G.y = $.y, G.z = $.z, D.push(G), l && g) { - var U = (0, E.extend)({}, g), V = new _.Vector3(P, z, F); - if (V.multiplyScalar(v), V.add($), U.start = $, U.end = V, U.frame = R, !U.color) { + var U = (0, E.extend)({}, g), V = new u.Vector3(P, B, F); + if (V.multiplyScalar(v), V.add($), U.start = $, U.end = V, U.frame = I, !U.color) { var Q = G.style.sphere; Q || (Q = G.style.stick), Q || (Q = G.style.line), U.color = (0, E.getColorFromStyle)(G, Q); } @@ -4695,11 +4695,11 @@ void main() { M.push(T); } if (l == "and") { - const L = function(D, R) { - const B = /* @__PURE__ */ new Set(); - for (const P of R) - D.has(P) && B.add(P); - return B; + const L = function(D, I) { + const z = /* @__PURE__ */ new Set(); + for (const P of I) + D.has(P) && z.add(P); + return z; }; let T = new Set(M[0]); for (const D of M.splice(1)) @@ -4766,9 +4766,9 @@ void main() { break; } } else if (Array.isArray(v[g])) { - var D = v[g], R = p[g]; - for (let B = 0; B < D.length; B++) - if (this.propertyMatches(R, D[B])) { + var D = v[g], I = p[g]; + for (let z = 0; z < D.length; z++) + if (this.propertyMatches(I, D[z])) { L = !0; break; } @@ -4777,8 +4777,8 @@ void main() { break; } } else { - let B = v[g]; - if (!this.propertyMatches(p[g], B)) { + let z = v[g]; + if (!this.propertyMatches(p[g], z)) { l = !1; break; } @@ -4805,9 +4805,9 @@ void main() { for (var a = (0, E.getExtent)(p, void 0), l = [[], [], []], g = 0; g < 3; g++) l[0][g] = a[0][g] - v, l[1][g] = a[1][g] + v, l[2][g] = a[2][g]; var M = []; - for (let R = 0; R < this.atoms.length; R++) { - var L = this.atoms[R].x, T = this.atoms[R].y, D = this.atoms[R].z; - L >= l[0][0] && L <= l[1][0] && T >= l[0][1] && T <= l[1][1] && D >= l[0][2] && D <= l[1][2] && (L >= a[0][0] && L <= a[1][0] && T >= a[0][1] && T <= a[1][1] && D >= a[0][2] && D <= a[1][2] || M.push(this.atoms[R])); + for (let I = 0; I < this.atoms.length; I++) { + var L = this.atoms[I].x, T = this.atoms[I].y, D = this.atoms[I].z; + L >= l[0][0] && L <= l[1][0] && T >= l[0][1] && T <= l[1][1] && D >= l[0][2] && D <= l[1][2] && (L >= a[0][0] && L <= a[1][0] && T >= a[0][1] && T <= a[1][1] && D >= a[0][2] && D <= a[1][2] || M.push(this.atoms[I])); } return M; } @@ -4840,8 +4840,8 @@ void main() { let H = this.expandAtomList(a, G), U = a.length; const V = G * G; for (let Q = 0; Q < H.length; Q++) - for (let oe = 0; oe < U; oe++) { - var L = o.squaredDistance(H[Q], a[oe]); + for (let ae = 0; ae < U; ae++) { + var L = o.squaredDistance(H[Q], a[ae]); L < V && L > 0 && a.push(H[Q]); } } @@ -4853,27 +4853,27 @@ void main() { let Q = o.squaredDistance(T[U], a[V]); Q < H && Q > 0 && (D[V] = 1); } - var R = []; + var I = []; if (p.within.invert) for (let U = 0; U < a.length; U++) - D[U] || R.push(a[U]); + D[U] || I.push(a[U]); else for (let U in D) - R.push(a[U]); - a = R; + I.push(a[U]); + a = I; } if (p.hasOwnProperty("byres")) { - var B = {}, P = [], z = []; + var z = {}, P = [], B = []; for (let G = 0; G < a.length; G++) { let H = a[G]; var F = H.chain, N = H.resi; - if (B[F] === void 0 && (B[F] = {}), H.hasOwnProperty("resi") && B[F][N] === void 0) { - for (B[F][N] = !0, z.push(H); z.length > 0; ) - if (H = z.pop(), F = H.chain, N = H.resi, P[H.index] === void 0) { + if (z[F] === void 0 && (z[F] = {}), H.hasOwnProperty("resi") && z[F][N] === void 0) { + for (z[F][N] = !0, B.push(H); B.length > 0; ) + if (H = B.pop(), F = H.chain, N = H.resi, P[H.index] === void 0) { P[H.index] = !0; for (var $ = 0; $ < H.bonds.length; $++) { var k = this.atoms[H.bonds[$]]; - P[k.index] === void 0 && k.hasOwnProperty("resi") && k.chain == F && k.resi == N && (z.push(k), a.push(k)); + P[k.index] === void 0 && k.hasOwnProperty("resi") && k.chain == F && k.resi == N && (B.push(k), a.push(k)); } } } @@ -4903,8 +4903,8 @@ void main() { var g = p[l], M = a[g.index], L = (0, E.extend)({}, g); L.index = M, L.bonds = [], L.bondOrder = [], L.model = this.id, L.style = L.style || (0, E.deepCopy)(o.defaultAtomStyle), typeof L.color > "u" && (L.color = this.ElementColors[L.elem] || this.defaultColor); for (var T = g.bonds ? g.bonds.length : 0, D = 0; D < T; D++) { - var R = a[g.bonds[D]]; - typeof R < "u" && (L.bonds.push(R), L.bondOrder.push(g.bondOrder ? g.bondOrder[D] : 1)); + var I = a[g.bonds[D]]; + typeof I < "u" && (L.bonds.push(I), L.bondOrder.push(g.bondOrder ? g.bondOrder[D] : 1)); } this.atoms.push(L); } @@ -4956,12 +4956,12 @@ void main() { typeof v > "u" && typeof a > "u" && (v = p, p = {}), p = p, typeof v == "string" && (v = (0, E.specStringToObject)(v)); var l = !1, g = this, M = function(T) { var D = g.selectedAtoms(p, T); - for (let R = 0; R < T.length; R++) - T[R] && (T[R].capDrawn = !1); - for (let R = 0; R < D.length; R++) { - l = !0, (D[R].clickable || D[R].hoverable) && (D[R].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), a || (D[R].style = {}); - for (let B in v) - v.hasOwnProperty(B) && (D[R].style[B] = D[R].style[B] || {}, Object.assign(D[R].style[B], v[B])); + for (let I = 0; I < T.length; I++) + T[I] && (T[I].capDrawn = !1); + for (let I = 0; I < D.length; I++) { + l = !0, (D[I].clickable || D[I].hoverable) && (D[I].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), a || (D[I].style = {}); + for (let z in v) + v.hasOwnProperty(z) && (D[I].style[z] = D[I].style[z] || {}, Object.assign(D[I].style[z], v[z])); } }; if (p.frame !== void 0 && p.frame < this.frames.length) { @@ -5100,11 +5100,11 @@ void main() { let T = l, D = M.bonds[L]; if (T >= D) continue; - let R = { + let I = { b: T, e: D - }, B = M.bondOrder[L]; - B != 1 && (R.o = B), v.b.push(R); + }, z = M.bondOrder[L]; + z != 1 && (I.o = z), v.b.push(I); } } return v; @@ -5186,24 +5186,24 @@ void main() { */ addResLabels(p, v, a, l = !1) { var g = [], M = function(T, D) { - for (var R = T.selectedAtoms(p, R), B = {}, P = 0; P < R.length; P++) { - var z = R[P], F = z.chain, N = z.resn, $ = z.resi, k = N + "" + $; - B[F] || (B[F] = {}), B[F][k] || (B[F][k] = []), B[F][k].push(z); + for (var I = T.selectedAtoms(p, I), z = {}, P = 0; P < I.length; P++) { + var B = I[P], F = B.chain, N = B.resn, $ = B.resi, k = N + "" + $; + z[F] || (z[F] = {}), z[F][k] || (z[F][k] = []), z[F][k].push(B); } var G = (0, E.deepCopy)(a); - for (let U in B) - if (B.hasOwnProperty(U)) { - var H = B[U]; + for (let U in z) + if (z.hasOwnProperty(U)) { + var H = z[U]; for (let V in H) if (H.hasOwnProperty(V)) { - let Q = H[V], oe = new _.Vector3(0, 0, 0); - for (let ne = 0; ne < Q.length; ne++) { - let me = Q[ne]; - oe.x += me.x, oe.y += me.y, oe.z += me.z; + let Q = H[V], ae = new u.Vector3(0, 0, 0); + for (let q = 0; q < Q.length; q++) { + let me = Q[q]; + ae.x += me.x, ae.y += me.y, ae.z += me.z; } - oe.divideScalar(Q.length), G.position = oe, G.frame = D; - let ee = v.addLabel(V, G, void 0, !0); - g.push(ee); + ae.divideScalar(Q.length), G.position = ae, G.frame = D; + let oe = v.addLabel(V, G, void 0, !0); + g.push(oe); } } }; @@ -5224,10 +5224,10 @@ void main() { v.fill(0); for (var a = function(L, T, D) { D.push([L, T]); - var R = p.atoms[L]; + var I = p.atoms[L]; v[L] = 1; - for (var B = 0; B < R.bonds.length; B++) { - var P = R.bonds[B]; + for (var z = 0; z < I.bonds.length; z++) { + var P = I.bonds[z]; p.atoms[P] && !v[P] && a(P, L, D); } }, l = 0; l < this.atoms.length; l++) { @@ -5272,9 +5272,9 @@ void main() { if (/\.gz$/.test(v)) { v = v.replace(/\.gz$/, ""); try { - p = n(p); - } catch (B) { - console.log(B); + p = s(p); + } catch (z) { + console.log(z); } } var a = { mdcrd: "", inpcrd: "", pdb: "", netcdf: "", array: "" }; @@ -5283,8 +5283,8 @@ void main() { for (var l = this.atoms.length, g = o.parseCrd(p, v), M = 0; M < g.length; ) { for (var L = [], T = 0; T < l; T++) { var D = {}; - for (var R in this.atoms[T]) - D[R] = this.atoms[T][R]; + for (var I in this.atoms[T]) + D[I] = this.atoms[T][I]; L[T] = D, L[T].x = g[M++], L[T].y = g[M++], L[T].z = g[M++]; } this.frames.push(L); @@ -5342,7 +5342,7 @@ ATOM`, g); if (/\.gz$/.test(v)) { v = v.replace(/\.gz$/, ""); try { - p = n(p); + p = s(p); } catch (M) { console.log(M); } @@ -5432,22 +5432,22 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./WebGL */ "./src/WebGL/index.ts" ), f = t( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" - ), _ = t( + ), u = t( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), x = t( + ), y = t( /*! ./colors */ "./src/colors.ts" ), h = t( /*! ./ProteinSurface4 */ "./src/ProteinSurface4.ts" - ), u = t( + ), _ = t( /*! ./VolumeData */ "./src/VolumeData.ts" ), E = t( @@ -5461,8 +5461,8 @@ ATOM`, g); "./src/utilities.ts" ); class b { - static finalizeGeo(n) { - var o = n.updateGeoGroup(0); + static finalizeGeo(s) { + var o = s.updateGeoGroup(0); o.vertices > 0 && o.truncateArrayBuffers(!0, !0); } /* @@ -5471,12 +5471,12 @@ ATOM`, g); * geo * @param {Color | colorlike} color */ - static updateColor(n, o) { - o = o || x.CC.color(o), n.colorsNeedUpdate = !0; + static updateColor(s, o) { + o = o || y.CC.color(o), s.colorsNeedUpdate = !0; var w, p, v; o.constructor !== Array && (w = o.r, p = o.g, v = o.b); - for (let a in n.geometryGroups) { - let l = n.geometryGroups[a], g = l.colorArray; + for (let a in s.geometryGroups) { + let l = s.geometryGroups[a], g = l.colorArray; for (let M = 0, L = l.vertices; M < L; ++M) { if (o.constructor === Array) { let T = o[M]; @@ -5494,44 +5494,44 @@ ATOM`, g); * @param {ArrowSpec} * spec */ - static drawArrow(n, o, w) { + static drawArrow(s, o, w) { var p = w.start, v = w.end, a = w.radius, l = w.radiusRatio, g = w.mid, M = w.midpos; if (!(p && v)) return; - var L = o.updateGeoGroup(51), T = new _.Vector3(v.x, v.y, v.z).sub(p); + var L = o.updateGeoGroup(51), T = new u.Vector3(v.x, v.y, v.z).sub(p); if (M) { let he = T.length(); M > 0 ? g = M / he : g = (he + M) / he; } T.multiplyScalar(g); - var D = new _.Vector3(p.x, p.y, p.z).add(T), R = T.clone().negate(); - let B = new _.Vector3(p.x, p.y, p.z); - n.intersectionShape.cylinder.push(new f.Cylinder(B, D.clone(), a)), n.intersectionShape.sphere.push(new f.Sphere(B, a)); + var D = new u.Vector3(p.x, p.y, p.z).add(T), I = T.clone().negate(); + let z = new u.Vector3(p.x, p.y, p.z); + s.intersectionShape.cylinder.push(new f.Cylinder(z, D.clone(), a)), s.intersectionShape.sphere.push(new f.Sphere(z, a)); var P = []; P[0] = T.clone(), Math.abs(P[0].x) > 1e-4 ? P[0].y += 1 : P[0].x += 1, P[0].cross(T), P[0].normalize(), P[4] = P[0].clone(), P[4].crossVectors(P[0], T), P[4].normalize(), P[8] = P[0].clone().negate(), P[12] = P[4].clone().negate(), P[2] = P[0].clone().add(P[4]).normalize(), P[6] = P[4].clone().add(P[8]).normalize(), P[10] = P[8].clone().add(P[12]).normalize(), P[14] = P[12].clone().add(P[0]).normalize(), P[1] = P[0].clone().add(P[2]).normalize(), P[3] = P[2].clone().add(P[4]).normalize(), P[5] = P[4].clone().add(P[6]).normalize(), P[7] = P[6].clone().add(P[8]).normalize(), P[9] = P[8].clone().add(P[10]).normalize(), P[11] = P[10].clone().add(P[12]).normalize(), P[13] = P[12].clone().add(P[14]).normalize(), P[15] = P[14].clone().add(P[0]).normalize(); - var z = L.vertices, F = L.vertexArray, N = L.faceArray, $ = L.normalArray, k = L.lineArray, G, H, U; + var B = L.vertices, F = L.vertexArray, N = L.faceArray, $ = L.normalArray, k = L.lineArray, G, H, U; for (H = 0, U = P.length; H < U; ++H) { - G = 3 * (z + 3 * H); - var V = P[H].clone().multiplyScalar(a).add(p), Q = P[H].clone().multiplyScalar(a).add(D), oe = P[H].clone().multiplyScalar(a * l).add(D); - if (F[G] = V.x, F[G + 1] = V.y, F[G + 2] = V.z, F[G + 3] = Q.x, F[G + 4] = Q.y, F[G + 5] = Q.z, F[G + 6] = oe.x, F[G + 7] = oe.y, F[G + 8] = oe.z, H > 0) { - var ee = F[G - 3], ne = F[G - 2], me = F[G - 1], se = new _.Vector3(ee, ne, me), fe = new _.Vector3(v.x, v.y, v.z), Ce = D.clone(), Me = new _.Vector3(oe.x, oe.y, oe.z); - n.intersectionShape.triangle.push(new f.Triangle(Me, fe, se)), n.intersectionShape.triangle.push(new f.Triangle(se.clone(), Ce, Me.clone())); + G = 3 * (B + 3 * H); + var V = P[H].clone().multiplyScalar(a).add(p), Q = P[H].clone().multiplyScalar(a).add(D), ae = P[H].clone().multiplyScalar(a * l).add(D); + if (F[G] = V.x, F[G + 1] = V.y, F[G + 2] = V.z, F[G + 3] = Q.x, F[G + 4] = Q.y, F[G + 5] = Q.z, F[G + 6] = ae.x, F[G + 7] = ae.y, F[G + 8] = ae.z, H > 0) { + var oe = F[G - 3], q = F[G - 2], me = F[G - 1], ne = new u.Vector3(oe, q, me), fe = new u.Vector3(v.x, v.y, v.z), Ce = D.clone(), Me = new u.Vector3(ae.x, ae.y, ae.z); + s.intersectionShape.triangle.push(new f.Triangle(Me, fe, ne)), s.intersectionShape.triangle.push(new f.Triangle(ne.clone(), Ce, Me.clone())); } } L.vertices += 48, G = L.vertices * 3, F[G] = p.x, F[G + 1] = p.y, F[G + 2] = p.z, F[G + 3] = D.x, F[G + 4] = D.y, F[G + 5] = D.z, F[G + 6] = v.x, F[G + 7] = v.y, F[G + 8] = v.z, L.vertices += 3; - var Te, ae, pe, we, ke, Ue, Ne, Be, ue, ye, ge, Se, ze, He, We, Y, K, q, de, ve = L.vertices - 3, Ie = L.vertices - 2, Re = L.vertices - 1, Z = ve * 3, ce = Ie * 3, Ae = Re * 3; + var Te, se, pe, we, ke, Ue, Ne, Be, ue, ye, ge, Se, ze, He, We, Y, K, ee, de, ve = L.vertices - 3, Ie = L.vertices - 2, Re = L.vertices - 1, Z = ve * 3, ce = Ie * 3, Ae = Re * 3; for (H = 0, U = P.length - 1; H < U; ++H) { - var Fe = z + 3 * H; - G = Fe * 3, ae = L.faceidx, pe = L.lineidx, we = Fe, ye = we * 3, ke = Fe + 1, ge = ke * 3, Ue = Fe + 2, Se = Ue * 3, Ne = Fe + 4, ze = Ne * 3, Be = Fe + 5, He = Be * 3, ue = Fe + 3, We = ue * 3, Y = K = P[H], q = de = P[H + 1], $[ye] = Y.x, $[ge] = K.x, $[We] = de.x, $[ye + 1] = Y.y, $[ge + 1] = K.y, $[We + 1] = de.y, $[ye + 2] = Y.z, $[ge + 2] = K.z, $[We + 2] = de.z, $[ge] = K.x, $[ze] = q.x, $[We] = de.x, $[ge + 1] = K.y, $[ze + 1] = q.y, $[We + 1] = de.y, $[ge + 2] = K.z, $[ze + 2] = q.z, $[We + 2] = de.z, $[Se] = K.x, $[He] = q.x, $[Se + 1] = K.y, $[He + 1] = q.y, $[Se + 2] = K.z, $[He + 2] = q.z, N[ae] = we, N[ae + 1] = ke, N[ae + 2] = ue, N[ae + 3] = ke, N[ae + 4] = Ne, N[ae + 5] = ue, N[ae + 6] = we, N[ae + 7] = ue, N[ae + 8] = ve, N[ae + 9] = Ue, N[ae + 10] = Ie, N[ae + 11] = Be, N[ae + 12] = Ue, N[ae + 13] = Re, N[ae + 14] = Be, k[pe] = we, k[pe + 1] = ke, k[pe + 2] = we, k[pe + 3] = ue, k[pe + 4] = Ne, k[pe + 5] = ue, k[pe + 6] = we, k[pe + 7] = ue, k[pe + 8] = Ue, k[pe + 9] = ke, k[pe + 10] = Ue, k[pe + 11] = Be, k[pe + 12] = Ne, k[pe + 13] = Be, k[pe + 14] = Ue, k[pe + 15] = Re, k[pe + 16] = Ue, k[pe + 17] = Be, k[pe + 18] = Re, k[pe + 19] = Be, L.faceidx += 15, L.lineidx += 20; + var Fe = B + 3 * H; + G = Fe * 3, se = L.faceidx, pe = L.lineidx, we = Fe, ye = we * 3, ke = Fe + 1, ge = ke * 3, Ue = Fe + 2, Se = Ue * 3, Ne = Fe + 4, ze = Ne * 3, Be = Fe + 5, He = Be * 3, ue = Fe + 3, We = ue * 3, Y = K = P[H], ee = de = P[H + 1], $[ye] = Y.x, $[ge] = K.x, $[We] = de.x, $[ye + 1] = Y.y, $[ge + 1] = K.y, $[We + 1] = de.y, $[ye + 2] = Y.z, $[ge + 2] = K.z, $[We + 2] = de.z, $[ge] = K.x, $[ze] = ee.x, $[We] = de.x, $[ge + 1] = K.y, $[ze + 1] = ee.y, $[We + 1] = de.y, $[ge + 2] = K.z, $[ze + 2] = ee.z, $[We + 2] = de.z, $[Se] = K.x, $[He] = ee.x, $[Se + 1] = K.y, $[He + 1] = ee.y, $[Se + 2] = K.z, $[He + 2] = ee.z, N[se] = we, N[se + 1] = ke, N[se + 2] = ue, N[se + 3] = ke, N[se + 4] = Ne, N[se + 5] = ue, N[se + 6] = we, N[se + 7] = ue, N[se + 8] = ve, N[se + 9] = Ue, N[se + 10] = Ie, N[se + 11] = Be, N[se + 12] = Ue, N[se + 13] = Re, N[se + 14] = Be, k[pe] = we, k[pe + 1] = ke, k[pe + 2] = we, k[pe + 3] = ue, k[pe + 4] = Ne, k[pe + 5] = ue, k[pe + 6] = we, k[pe + 7] = ue, k[pe + 8] = Ue, k[pe + 9] = ke, k[pe + 10] = Ue, k[pe + 11] = Be, k[pe + 12] = Ne, k[pe + 13] = Be, k[pe + 14] = Ue, k[pe + 15] = Re, k[pe + 16] = Ue, k[pe + 17] = Be, k[pe + 18] = Re, k[pe + 19] = Be, L.faceidx += 15, L.lineidx += 20; } Te = [ - z + 45, - z + 46, - z + 1, - z, - z + 47, - z + 2 - ], ae = L.faceidx, pe = L.lineidx, we = Te[0], ye = we * 3, ke = Te[1], ge = ke * 3, Ue = Te[4], Se = Ue * 3, Ne = Te[2], ze = Ne * 3, Be = Te[5], He = Be * 3, ue = Te[3], We = ue * 3, Y = K = P[15], q = de = P[0], $[ye] = Y.x, $[ge] = K.x, $[We] = de.x, $[ye + 1] = Y.y, $[ge + 1] = K.y, $[We + 1] = de.y, $[ye + 2] = Y.z, $[ge + 2] = K.z, $[We + 2] = de.z, $[ge] = K.x, $[ze] = q.x, $[We] = de.x, $[ge + 1] = K.y, $[ze + 1] = q.y, $[We + 1] = de.y, $[ge + 2] = K.z, $[ze + 2] = q.z, $[We + 2] = de.z, $[Se] = K.x, $[He] = q.x, $[Se + 1] = K.y, $[He + 1] = q.y, $[Se + 2] = K.z, $[He + 2] = q.z, T.normalize(), R.normalize(), $[Z] = R.x, $[ce] = $[Ae] = T.x, $[Z + 1] = R.y, $[ce + 1] = $[Ae + 1] = T.y, $[Z + 2] = R.z, $[ce + 2] = $[Ae + 2] = T.z, N[ae] = we, N[ae + 1] = ke, N[ae + 2] = ue, N[ae + 3] = ke, N[ae + 4] = Ne, N[ae + 5] = ue, N[ae + 6] = we, N[ae + 7] = ue, N[ae + 8] = ve, N[ae + 9] = Ue, N[ae + 10] = Ie, N[ae + 11] = Be, N[ae + 12] = Ue, N[ae + 13] = Re, N[ae + 14] = Be, k[pe] = we, k[pe + 1] = ke, k[pe + 2] = we, k[pe + 3] = ue, k[pe + 4] = Ne, k[pe + 5] = ue, k[pe + 6] = we, k[pe + 7] = ue, k[pe + 8] = Ue, k[pe + 9] = ke, k[pe + 10] = Ue, k[pe + 11] = Be, k[pe + 12] = Ne, k[pe + 13] = Be, k[pe + 14] = Ue, k[pe + 15] = Re, k[pe + 16] = Ue, k[pe + 17] = Be, k[pe + 18] = Re, k[pe + 19] = Be, L.faceidx += 15, L.lineidx += 20; + B + 45, + B + 46, + B + 1, + B, + B + 47, + B + 2 + ], se = L.faceidx, pe = L.lineidx, we = Te[0], ye = we * 3, ke = Te[1], ge = ke * 3, Ue = Te[4], Se = Ue * 3, Ne = Te[2], ze = Ne * 3, Be = Te[5], He = Be * 3, ue = Te[3], We = ue * 3, Y = K = P[15], ee = de = P[0], $[ye] = Y.x, $[ge] = K.x, $[We] = de.x, $[ye + 1] = Y.y, $[ge + 1] = K.y, $[We + 1] = de.y, $[ye + 2] = Y.z, $[ge + 2] = K.z, $[We + 2] = de.z, $[ge] = K.x, $[ze] = ee.x, $[We] = de.x, $[ge + 1] = K.y, $[ze + 1] = ee.y, $[We + 1] = de.y, $[ge + 2] = K.z, $[ze + 2] = ee.z, $[We + 2] = de.z, $[Se] = K.x, $[He] = ee.x, $[Se + 1] = K.y, $[He + 1] = ee.y, $[Se + 2] = K.z, $[He + 2] = ee.z, T.normalize(), I.normalize(), $[Z] = I.x, $[ce] = $[Ae] = T.x, $[Z + 1] = I.y, $[ce + 1] = $[Ae + 1] = T.y, $[Z + 2] = I.z, $[ce + 2] = $[Ae + 2] = T.z, N[se] = we, N[se + 1] = ke, N[se + 2] = ue, N[se + 3] = ke, N[se + 4] = Ne, N[se + 5] = ue, N[se + 6] = we, N[se + 7] = ue, N[se + 8] = ve, N[se + 9] = Ue, N[se + 10] = Ie, N[se + 11] = Be, N[se + 12] = Ue, N[se + 13] = Re, N[se + 14] = Be, k[pe] = we, k[pe + 1] = ke, k[pe + 2] = we, k[pe + 3] = ue, k[pe + 4] = Ne, k[pe + 5] = ue, k[pe + 6] = we, k[pe + 7] = ue, k[pe + 8] = Ue, k[pe + 9] = ke, k[pe + 10] = Ue, k[pe + 11] = Be, k[pe + 12] = Ne, k[pe + 13] = Be, k[pe + 14] = Ue, k[pe + 15] = Re, k[pe + 16] = Ue, k[pe + 17] = Be, k[pe + 18] = Re, k[pe + 19] = Be, L.faceidx += 15, L.lineidx += 20; } // Update a bounding sphere's position and radius // from list of centroids and new points @@ -5544,41 +5544,41 @@ ATOM`, g); * points, flat array of all points in shape * @param {int} numPoints, number of valid poitns in points */ - static updateBoundingFromPoints(n, o, w, p) { - n.center.set(0, 0, 0); + static updateBoundingFromPoints(s, o, w, p) { + s.center.set(0, 0, 0); let v = 1 / 0, a = 1 / 0, l = 1 / 0, g = -1 / 0, M = -1 / 0, L = -1 / 0; - n.box && (v = n.box.min.x, g = n.box.max.x, a = n.box.min.y, M = n.box.max.y, l = n.box.min.z, L = n.box.max.z); - for (let B = 0, P = p; B < P; B++) { - var T = w[B * 3], D = w[B * 3 + 1], R = w[B * 3 + 2]; - T < v && (v = T), D < a && (a = D), R < l && (l = R), T > g && (g = T), D > M && (M = D), R > L && (L = R); + s.box && (v = s.box.min.x, g = s.box.max.x, a = s.box.min.y, M = s.box.max.y, l = s.box.min.z, L = s.box.max.z); + for (let z = 0, P = p; z < P; z++) { + var T = w[z * 3], D = w[z * 3 + 1], I = w[z * 3 + 2]; + T < v && (v = T), D < a && (a = D), I < l && (l = I), T > g && (g = T), D > M && (M = D), I > L && (L = I); } - n.center.set((g + v) / 2, (M + a) / 2, (L + l) / 2), n.radius = n.center.distanceTo({ x: g, y: M, z: L }), n.box = { min: { x: v, y: a, z: l }, max: { x: g, y: M, z: L } }; + s.center.set((g + v) / 2, (M + a) / 2, (L + l) / 2), s.radius = s.center.distanceTo({ x: g, y: M, z: L }), s.box = { min: { x: v, y: a, z: l }, max: { x: g, y: M, z: L } }; } //helper function for adding an appropriately sized mesh - static addCustomGeo(n, o, w, p, v) { + static addCustomGeo(s, o, w, p, v) { var a = o.addGeoGroup(), l = w.vertexArr, g = w.normalArr, M = w.faceArr; a.vertices = l.length, a.faceidx = M.length; - var L, T, D, R, B, P, z, F, N, $ = a.vertexArray, k = a.colorArray; - for (p.constructor !== Array && (F = p.r, N = p.g, R = p.b), P = 0, z = a.vertices; P < z; ++P) - L = P * 3, T = l[P], $[L] = T.x, $[L + 1] = T.y, $[L + 2] = T.z, p.constructor === Array && (B = p[P], F = B.r, N = B.g, R = B.b), k[L] = F, k[L + 1] = N, k[L + 2] = R; + var L, T, D, I, z, P, B, F, N, $ = a.vertexArray, k = a.colorArray; + for (p.constructor !== Array && (F = p.r, N = p.g, I = p.b), P = 0, B = a.vertices; P < B; ++P) + L = P * 3, T = l[P], $[L] = T.x, $[L + 1] = T.y, $[L + 2] = T.z, p.constructor === Array && (z = p[P], F = z.r, N = z.g, I = z.b), k[L] = F, k[L + 1] = N, k[L + 2] = I; if (v) - for (P = 0, z = a.faceidx / 3; P < z; ++P) { - L = P * 3, D = M[L], R = M[L + 1], B = M[L + 2]; - var G = new _.Vector3(), H = new _.Vector3(), U = new _.Vector3(); - n.intersectionShape.triangle.push(new f.Triangle(G.copy(l[D]), H.copy(l[R]), U.copy(l[B]))); + for (P = 0, B = a.faceidx / 3; P < B; ++P) { + L = P * 3, D = M[L], I = M[L + 1], z = M[L + 2]; + var G = new u.Vector3(), H = new u.Vector3(), U = new u.Vector3(); + s.intersectionShape.triangle.push(new f.Triangle(G.copy(l[D]), H.copy(l[I]), U.copy(l[z]))); } if (v) { - var V = new _.Vector3(0, 0, 0), Q = 0; - for (let ne = 0; ne < o.geometryGroups.length; ne++) - V.add(o.geometryGroups[ne].getCentroid()), Q++; - V.divideScalar(Q), b.updateBoundingFromPoints(n.boundingSphere, { centroid: V }, $, a.vertices); + var V = new u.Vector3(0, 0, 0), Q = 0; + for (let q = 0; q < o.geometryGroups.length; q++) + V.add(o.geometryGroups[q].getCentroid()), Q++; + V.divideScalar(Q), b.updateBoundingFromPoints(s.boundingSphere, { centroid: V }, $, a.vertices); } if (a.faceArray = new Uint16Array(M), a.truncateArrayBuffers(!0, !0), g.length < a.vertices) a.setNormals(); else { - var oe = a.normalArray = new Float32Array(a.vertices * 3), ee; - for (P = 0, z = a.vertices; P < z; ++P) - L = P * 3, ee = g[P], oe[L] = ee.x, oe[L + 1] = ee.y, oe[L + 2] = ee.z; + var ae = a.normalArray = new Float32Array(a.vertices * 3), oe; + for (P = 0, B = a.vertices; P < B; ++P) + L = P * 3, oe = g[P], ae[L] = oe.x, ae[L + 1] = oe.y, ae[L + 2] = oe.z; } a.setLineIndices(), a.lineidx = a.lineArray.length; } @@ -5590,8 +5590,8 @@ ATOM`, g); * stylespec * @returns {undefined} */ - static updateFromStyle(n, o) { - typeof o.color < "u" ? (n.color = o.color || new x.Color(), o.color instanceof x.Color || (n.color = x.CC.color(o.color))) : n.color = x.CC.color(0), n.wireframe = !!o.wireframe, n.opacity = o.alpha ? (0, _.clamp)(o.alpha, 0, 1) : 1, typeof o.opacity < "u" && (n.opacity = (0, _.clamp)(o.opacity, 0, 1)), n.side = o.side !== void 0 ? o.side : s.DoubleSide, n.linewidth = typeof o.linewidth > "u" ? 1 : o.linewidth, n.clickable = !!o.clickable, n.callback = (0, C.makeFunction)(o.callback), n.hoverable = !!o.hoverable, n.hover_callback = (0, C.makeFunction)(o.hover_callback), n.unhover_callback = (0, C.makeFunction)(o.unhover_callback), n.hidden = o.hidden, n.frame = o.frame; + static updateFromStyle(s, o) { + typeof o.color < "u" ? (s.color = o.color || new y.Color(), o.color instanceof y.Color || (s.color = y.CC.color(o.color))) : s.color = y.CC.color(0), s.wireframe = !!o.wireframe, s.opacity = o.alpha ? (0, u.clamp)(o.alpha, 0, 1) : 1, typeof o.opacity < "u" && (s.opacity = (0, u.clamp)(o.opacity, 0, 1)), s.side = o.side !== void 0 ? o.side : n.DoubleSide, s.linewidth = typeof o.linewidth > "u" ? 1 : o.linewidth, s.clickable = !!o.clickable, s.callback = (0, C.makeFunction)(o.callback), s.hoverable = !!o.hoverable, s.hover_callback = (0, C.makeFunction)(o.hover_callback), s.unhover_callback = (0, C.makeFunction)(o.unhover_callback), s.hidden = o.hidden, s.frame = o.frame; } /** * Custom renderable shape @@ -5600,13 +5600,13 @@ ATOM`, g); * * @param {ShapeSpec} stylespec */ - constructor(n) { - this.color = 16777215, this.hidden = !1, this.wireframe = !1, this.opacity = 1, this.linewidth = 1, this.clickable = !1, this.hoverable = !1, this.side = s.DoubleSide, this.stylespec = n || {}, this.boundingSphere = new f.Sphere(), this.intersectionShape = { + constructor(s) { + this.color = 16777215, this.hidden = !1, this.wireframe = !1, this.opacity = 1, this.linewidth = 1, this.clickable = !1, this.hoverable = !1, this.side = n.DoubleSide, this.stylespec = s || {}, this.boundingSphere = new f.Sphere(), this.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] - }, b.updateFromStyle(this, this.stylespec), this.components = [], this.shapeObj = null, this.renderedShapeObj = null, this.geo = new s.Geometry(!0), this.linegeo = new s.Geometry(!0); + }, b.updateFromStyle(this, this.stylespec), this.components = [], this.shapeObj = null, this.renderedShapeObj = null, this.geo = new n.Geometry(!0), this.linegeo = new n.Geometry(!0); } /** Update shape with new style specification * @param {ShapeSpec} newspec @@ -5615,12 +5615,12 @@ ATOM`, g); sphere.updateStyle({color:'yellow',opacity:0.5}); viewer.render(); */ - updateStyle(n) { - for (var o in n) - this.stylespec[o] = n[o]; - if (b.updateFromStyle(this, this.stylespec), n.voldata && n.volscheme) { - (0, C.adjustVolumeStyle)(n); - const w = n.volscheme, p = n.voldata, v = x.CC, a = w.range() || [-1, 1]; + updateStyle(s) { + for (var o in s) + this.stylespec[o] = s[o]; + if (b.updateFromStyle(this, this.stylespec), s.voldata && s.volscheme) { + (0, C.adjustVolumeStyle)(s); + const w = s.volscheme, p = s.voldata, v = y.CC, a = w.range() || [-1, 1]; this.geo.setColors(function(l, g, M) { let L = p.getVal(l, g, M); return v.color(w.valueToHex(L, a)); @@ -5631,8 +5631,8 @@ ATOM`, g); * Creates a custom shape from supplied vertex and face arrays * @param {CustomShapeSpec} customSpec */ - addCustom(n) { - n.vertexArr = n.vertexArr || [], n.faceArr = n.faceArr || [], n.normalArr = n.normalArr || [], b.drawCustom(this, this.geo, n); + addCustom(s) { + s.vertexArr = s.vertexArr || [], s.faceArr = s.faceArr || [], s.normalArr = s.normalArr || [], b.drawCustom(this, this.geo, s); } /** * Creates a sphere shape @@ -5642,9 +5642,9 @@ ATOM`, g); viewer.render(); */ - addSphere(n) { - n.center || (n.center = new _.Vector3(0, 0, 0)), n.radius = n.radius ? (0, _.clamp)(n.radius, 0, 1 / 0) : 1.5, n.color = x.CC.color(n.color), this.intersectionShape.sphere.push(new f.Sphere(n.center, n.radius)), E.GLDraw.drawSphere(this.geo, n.center, n.radius, n.color, n.quality), this.components.push({ - centroid: new _.Vector3(n.center.x, n.center.y, n.center.z) + addSphere(s) { + s.center || (s.center = new u.Vector3(0, 0, 0)), s.radius = s.radius ? (0, u.clamp)(s.radius, 0, 1 / 0) : 1.5, s.color = y.CC.color(s.color), this.intersectionShape.sphere.push(new f.Sphere(s.center, s.radius)), E.GLDraw.drawSphere(this.geo, s.center, s.radius, s.color, s.quality), this.components.push({ + centroid: new u.Vector3(s.center.x, s.center.y, s.center.z) }); var o = this.geo.updateGeoGroup(0); b.updateBoundingFromPoints(this.boundingSphere, this.components, o.vertexArray, o.vertices); @@ -5663,18 +5663,18 @@ ATOM`, g); viewer.rotate(30); viewer.render(); */ - addBox(n) { - var o = n.dimensions || { w: 1, h: 1, d: 1 }, w; + addBox(s) { + var o = s.dimensions || { w: 1, h: 1, d: 1 }, w; typeof o.w == "number" ? w = { x: o.w, y: 0, z: 0 } : w = o.w; var p; typeof o.h == "number" ? p = { x: 0, y: o.h, z: 0 } : p = o.h; var v; typeof o.d == "number" ? v = { x: 0, y: 0, z: o.d } : v = o.d; - var a = n.corner; - a == null && (n.center !== void 0 ? a = { - x: n.center.x - 0.5 * (w.x + p.x + v.x), - y: n.center.y - 0.5 * (w.y + p.y + v.y), - z: n.center.z - 0.5 * (w.z + p.z + v.z) + var a = s.corner; + a == null && (s.center !== void 0 ? a = { + x: s.center.x - 0.5 * (w.x + p.x + v.x), + y: s.center.y - 0.5 * (w.y + p.y + v.y), + z: s.center.z - 0.5 * (w.z + p.z + v.z) } : a = { x: 0, y: 0, z: 0 }); var l = [ { x: a.x, y: a.y, z: a.z }, @@ -5689,14 +5689,14 @@ ATOM`, g); g.splice(g.length, 0, l[0], l[1], l[2], l[3]), M.splice(M.length, 0, 0, 2, 1, 1, 2, 3); var L = 4; g.splice(g.length, 0, l[2], l[3], l[6], l[7]), M.splice(M.length, 0, L + 0, L + 2, L + 1, L + 1, L + 2, L + 3), L += 4, g.splice(g.length, 0, l[4], l[5], l[0], l[1]), M.splice(M.length, 0, L + 0, L + 2, L + 1, L + 1, L + 2, L + 3), L += 4, g.splice(g.length, 0, l[6], l[7], l[4], l[5]), M.splice(M.length, 0, L + 0, L + 2, L + 1, L + 1, L + 2, L + 3), L += 4, g.splice(g.length, 0, l[3], l[1], l[7], l[5]), M.splice(M.length, 0, L + 0, L + 2, L + 1, L + 1, L + 2, L + 3), L += 4, g.splice(g.length, 0, l[2], l[6], l[0], l[4]), M.splice(M.length, 0, L + 0, L + 2, L + 1, L + 1, L + 2, L + 3), L += 4; - var T = (0, C.extend)({}, n); + var T = (0, C.extend)({}, s); T.vertexArr = g, T.faceArr = M, T.normalArr = [], b.drawCustom(this, this.geo, T); - var D = new _.Vector3(); + var D = new u.Vector3(); this.components.push({ centroid: D.addVectors(l[0], l[7]).multiplyScalar(0.5) }); - var R = this.geo.updateGeoGroup(0); - b.updateBoundingFromPoints(this.boundingSphere, this.components, R.vertexArray, R.vertices); + var I = this.geo.updateGeoGroup(0); + b.updateBoundingFromPoints(this.boundingSphere, this.components, I.vertexArray, I.vertices); } /** * Creates a cylinder shape @@ -5728,12 +5728,12 @@ ATOM`, g); toCap:false}); viewer.render(); */ - addCylinder(n) { + addCylinder(s) { var o, w; - n.start ? o = new _.Vector3(n.start.x || 0, n.start.y || 0, n.start.z || 0) : o = new _.Vector3(0, 0, 0), n.end ? (w = new _.Vector3(n.end.x, n.end.y || 0, n.end.z || 0), typeof w.x > "u" && (w.x = 3)) : w = new _.Vector3(0, 0, 0); - var p = n.radius || 0.1, v = x.CC.color(n.color); - this.intersectionShape.cylinder.push(new f.Cylinder(o, w, p)), E.GLDraw.drawCylinder(this.geo, o, w, p, v, n.fromCap, n.toCap); - var a = new _.Vector3(); + s.start ? o = new u.Vector3(s.start.x || 0, s.start.y || 0, s.start.z || 0) : o = new u.Vector3(0, 0, 0), s.end ? (w = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), typeof w.x > "u" && (w.x = 3)) : w = new u.Vector3(0, 0, 0); + var p = s.radius || 0.1, v = y.CC.color(s.color); + this.intersectionShape.cylinder.push(new f.Cylinder(o, w, p)), E.GLDraw.drawCylinder(this.geo, o, w, p, v, s.fromCap, s.toCap); + var a = new u.Vector3(); this.components.push({ centroid: a.addVectors(o, w).multiplyScalar(0.5) }); @@ -5744,34 +5744,34 @@ ATOM`, g); * Creates a dashed cylinder shape * @param {CylinderSpec} cylinderSpec */ - addDashedCylinder(n) { - n.dashLength = n.dashLength || 0.25, n.gapLength = n.gapLength || 0.25; + addDashedCylinder(s) { + s.dashLength = s.dashLength || 0.25, s.gapLength = s.gapLength || 0.25; var o; - n.start ? o = new _.Vector3(n.start.x || 0, n.start.y || 0, n.start.z || 0) : o = new _.Vector3(0, 0, 0); + s.start ? o = new u.Vector3(s.start.x || 0, s.start.y || 0, s.start.z || 0) : o = new u.Vector3(0, 0, 0); var w; - n.end ? (w = new _.Vector3(n.end.x, n.end.y || 0, n.end.z || 0), typeof w.x > "u" && (w.x = 3)) : w = new _.Vector3(3, 0, 0); - for (var p = n.radius || 0.1, v = x.CC.color(n.color), a = Math.sqrt(Math.pow(o.x - w.x, 2) + Math.pow(o.y - w.y, 2) + Math.pow(o.z - w.z, 2)), l = a / (n.gapLength + n.dashLength), g = new _.Vector3(n.start.x || 0, n.start.y || 0, n.start.z || 0), M = new _.Vector3(n.end.x, n.end.y || 0, n.end.z || 0), L = new _.Vector3((w.x - o.x) / (a / n.gapLength), (w.y - o.y) / (a / n.gapLength), (w.z - o.z) / (a / n.gapLength)), T = new _.Vector3((w.x - o.x) / (a / n.dashLength), (w.y - o.y) / (a / n.dashLength), (w.z - o.z) / (a / n.dashLength)), D = 0; D < l; D++) - M = new _.Vector3(g.x + T.x, g.y + T.y, g.z + T.z), this.intersectionShape.cylinder.push(new f.Cylinder(g, M, p)), E.GLDraw.drawCylinder(this.geo, g, M, p, v, n.fromCap, n.toCap), g = new _.Vector3(M.x + L.x, M.y + L.y, M.z + L.z); - var R = new _.Vector3(); + s.end ? (w = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), typeof w.x > "u" && (w.x = 3)) : w = new u.Vector3(3, 0, 0); + for (var p = s.radius || 0.1, v = y.CC.color(s.color), a = Math.sqrt(Math.pow(o.x - w.x, 2) + Math.pow(o.y - w.y, 2) + Math.pow(o.z - w.z, 2)), l = a / (s.gapLength + s.dashLength), g = new u.Vector3(s.start.x || 0, s.start.y || 0, s.start.z || 0), M = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), L = new u.Vector3((w.x - o.x) / (a / s.gapLength), (w.y - o.y) / (a / s.gapLength), (w.z - o.z) / (a / s.gapLength)), T = new u.Vector3((w.x - o.x) / (a / s.dashLength), (w.y - o.y) / (a / s.dashLength), (w.z - o.z) / (a / s.dashLength)), D = 0; D < l; D++) + M = new u.Vector3(g.x + T.x, g.y + T.y, g.z + T.z), this.intersectionShape.cylinder.push(new f.Cylinder(g, M, p)), E.GLDraw.drawCylinder(this.geo, g, M, p, v, s.fromCap, s.toCap), g = new u.Vector3(M.x + L.x, M.y + L.y, M.z + L.z); + var I = new u.Vector3(); this.components.push({ - centroid: R.addVectors(o, w).multiplyScalar(0.5) + centroid: I.addVectors(o, w).multiplyScalar(0.5) }); - var B = this.geo.updateGeoGroup(0); - b.updateBoundingFromPoints(this.boundingSphere, this.components, B.vertexArray, B.vertices); + var z = this.geo.updateGeoGroup(0); + b.updateBoundingFromPoints(this.boundingSphere, this.components, z.vertexArray, z.vertices); } /** * Creates a curved shape * @param {CurveSpec} curveSpec */ - addCurve(n) { - n.points = n.points || [], n.smooth = n.smooth || 10, typeof n.fromCap > "u" && (n.fromCap = 2), typeof n.toCap > "u" && (n.toCap = 2); - var o = (0, c.subdivide_spline)(n.points, n.smooth); + addCurve(s) { + s.points = s.points || [], s.smooth = s.smooth || 10, typeof s.fromCap > "u" && (s.fromCap = 2), typeof s.toCap > "u" && (s.toCap = 2); + var o = (0, c.subdivide_spline)(s.points, s.smooth); if (o.length < 3) { console.log("Too few points in addCurve"); return; } - var w = n.radius || 0.1, p = x.CC.color(n.color), v = 0, a = o.length - 1, l = o[0].distanceTo(o[1]), g = Math.ceil(2 * w / l); - if (n.toArrow) { + var w = s.radius || 0.1, p = y.CC.color(s.color), v = 0, a = o.length - 1, l = o[0].distanceTo(o[1]), g = Math.ceil(2 * w / l); + if (s.toArrow) { a -= g; let D = { start: o[a], @@ -5782,7 +5782,7 @@ ATOM`, g); }; this.addArrow(D); } - if (n.fromArrow) { + if (s.fromArrow) { v += g; let D = { start: o[v], @@ -5806,14 +5806,14 @@ ATOM`, g); }); */ - addLine(n) { + addLine(s) { var o, w; - n.start ? o = new _.Vector3(n.start.x || 0, n.start.y || 0, n.start.z || 0) : o = new _.Vector3(0, 0, 0), n.end ? (w = new _.Vector3(n.end.x, n.end.y || 0, n.end.z || 0), typeof w.x > "u" && (w.x = 3)) : w = new _.Vector3(3, 0, 0); + s.start ? o = new u.Vector3(s.start.x || 0, s.start.y || 0, s.start.z || 0) : o = new u.Vector3(0, 0, 0), s.end ? (w = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), typeof w.x > "u" && (w.x = 3)) : w = new u.Vector3(3, 0, 0); var p = this.geo.updateGeoGroup(2), v = p.vertices, a = v * 3, l = p.vertexArray; l[a] = o.x, l[a + 1] = o.y, l[a + 2] = o.z, l[a + 3] = w.x, l[a + 4] = w.y, l[a + 5] = w.z, p.vertices += 2; var g = p.lineArray, M = p.lineidx; g[M] = v, g[M + 1] = v + 1, p.lineidx += 2; - var L = new _.Vector3(); + var L = new u.Vector3(); this.components.push({ centroid: L.addVectors(o, w).multiplyScalar(0.5) }), p = this.geo.updateGeoGroup(0), b.updateBoundingFromPoints(this.boundingSphere, this.components, p.vertexArray, p.vertices); @@ -5839,26 +5839,26 @@ ATOM`, g); viewer.render(); }); */ - addArrow(n) { - if (n.start ? n.start = new _.Vector3(n.start.x || 0, n.start.y || 0, n.start.z || 0) : n.start = new _.Vector3(0, 0, 0), n.dir instanceof _.Vector3 && typeof n.length == "number") { - var o = n.dir.clone().multiplyScalar(n.length).add(n.start); - n.end = o; + addArrow(s) { + if (s.start ? s.start = new u.Vector3(s.start.x || 0, s.start.y || 0, s.start.z || 0) : s.start = new u.Vector3(0, 0, 0), s.dir instanceof u.Vector3 && typeof s.length == "number") { + var o = s.dir.clone().multiplyScalar(s.length).add(s.start); + s.end = o; } else - n.end ? (n.end = new _.Vector3(n.end.x, n.end.y || 0, n.end.z || 0), typeof n.end.x > "u" && (n.end.x = 3)) : n.end = new _.Vector3(3, 0, 0); - n.radius = n.radius || 0.1, n.radiusRatio = n.radiusRatio || 1.618034, n.mid = 0 < n.mid && n.mid < 1 ? n.mid : 0.618034, b.drawArrow(this, this.geo, n); - var w = new _.Vector3(); + s.end ? (s.end = new u.Vector3(s.end.x, s.end.y || 0, s.end.z || 0), typeof s.end.x > "u" && (s.end.x = 3)) : s.end = new u.Vector3(3, 0, 0); + s.radius = s.radius || 0.1, s.radiusRatio = s.radiusRatio || 1.618034, s.mid = 0 < s.mid && s.mid < 1 ? s.mid : 0.618034, b.drawArrow(this, this.geo, s); + var w = new u.Vector3(); this.components.push({ - centroid: w.addVectors(n.start, n.end).multiplyScalar(0.5) + centroid: w.addVectors(s.start, s.end).multiplyScalar(0.5) }); var p = this.geo.updateGeoGroup(0); b.updateBoundingFromPoints(this.boundingSphere, this.components, p.vertexArray, p.vertices); } - static distance_from(n, o) { - return Math.sqrt(Math.pow(n.x - o.x, 2) + Math.pow(n.y - o.y, 2) + Math.pow(n.z - o.z, 2)); + static distance_from(s, o) { + return Math.sqrt(Math.pow(s.x - o.x, 2) + Math.pow(s.y - o.y, 2) + Math.pow(s.z - o.z, 2)); } - static inSelectedRegion(n, o, w) { + static inSelectedRegion(s, o, w) { for (var p = 0; p < o.length; p++) - if (b.distance_from(o[p], n) <= w) + if (b.distance_from(o[p], s) <= w) return !0; return !1; } @@ -5889,52 +5889,52 @@ ATOM`, g); viewer.render(); }); */ - addIsosurface(n, o, w) { - var p = o.isoval !== void 0 && typeof o.isoval == "number" ? o.isoval : 0, v = !!o.voxel, a = o.smoothness === void 0 ? 1 : o.smoothness, l = n.size.x, g = n.size.y, M = n.size.z, L = new Int16Array(l * g * M), T = n.data, D, R; - for (D = 0, R = L.length; D < R; ++D) + addIsosurface(s, o, w) { + var p = o.isoval !== void 0 && typeof o.isoval == "number" ? o.isoval : 0, v = !!o.voxel, a = o.smoothness === void 0 ? 1 : o.smoothness, l = s.size.x, g = s.size.y, M = s.size.z, L = new Int16Array(l * g * M), T = s.data, D, I; + for (D = 0, I = L.length; D < I; ++D) L[D] = -1; - var B = new Uint8Array(l * g * M); - for (D = 0, R = T.length; D < R; ++D) { + var z = new Uint8Array(l * g * M); + for (D = 0, I = T.length; D < I; ++D) { var P = p >= 0 ? T[D] - p : p - T[D]; - P > 0 && (B[D] |= b.ISDONE); + P > 0 && (z[D] |= b.ISDONE); } - var z = [], F = []; - h.MarchingCube.march(B, z, F, { + var B = [], F = []; + h.MarchingCube.march(z, B, F, { fulltable: !0, voxel: v, - unitCube: n.unit, - origin: n.origin, - matrix: n.matrix, + unitCube: s.unit, + origin: s.origin, + matrix: s.matrix, nX: l, nY: g, nZ: M - }), !v && a > 0 && h.MarchingCube.laplacianSmooth(a, z, F); + }), !v && a > 0 && h.MarchingCube.laplacianSmooth(a, B, F); var N = [], $ = [], k = []; if (o.selectedRegion && o.coords === void 0 && (o.coords = o.selectedRegion), o.coords !== void 0) { - var G = o.coords[0].x, H = o.coords[0].y, U = o.coords[0].z, V = o.coords[0].x, Q = o.coords[0].y, oe = o.coords[0].z; - for (let ae = 0; ae < o.coords.length; ae++) - o.coords[ae].x > G ? G = o.coords[ae].x : o.coords[ae].x < V && (V = o.coords[ae].x), o.coords[ae].y > H ? H = o.coords[ae].y : o.coords[ae].y < Q && (Q = o.coords[ae].y), o.coords[ae].z > U ? U = o.coords[ae].z : o.coords[ae].z < oe && (oe = o.coords[ae].z); - var ee = 2; - o.radius !== void 0 && (ee = o.radius), o.selectedOffset !== void 0 && (ee = o.selectedOffset), o.seldist !== void 0 && (ee = o.seldist), V -= ee, G += ee, Q -= ee, H += ee, oe -= ee, U += ee; - for (let ae = 0; ae < z.length; ae++) - z[ae].x > V && z[ae].x < G && z[ae].y > Q && z[ae].y < H && z[ae].z > oe && z[ae].z < U && b.inSelectedRegion(z[ae], o.coords, ee) ? (N.push($.length), $.push(z[ae])) : N.push(-1); - for (let ae = 0; ae + 2 < F.length; ae += 3) - N[F[ae]] !== -1 && N[F[ae + 1]] !== -1 && N[F[ae + 2]] !== -1 && (k.push(F[ae] - (F[ae] - N[F[ae]])), k.push(F[ae + 1] - (F[ae + 1] - N[F[ae + 1]])), k.push(F[ae + 2] - (F[ae + 2] - N[F[ae + 2]]))); - z = $, F = k; + var G = o.coords[0].x, H = o.coords[0].y, U = o.coords[0].z, V = o.coords[0].x, Q = o.coords[0].y, ae = o.coords[0].z; + for (let se = 0; se < o.coords.length; se++) + o.coords[se].x > G ? G = o.coords[se].x : o.coords[se].x < V && (V = o.coords[se].x), o.coords[se].y > H ? H = o.coords[se].y : o.coords[se].y < Q && (Q = o.coords[se].y), o.coords[se].z > U ? U = o.coords[se].z : o.coords[se].z < ae && (ae = o.coords[se].z); + var oe = 2; + o.radius !== void 0 && (oe = o.radius), o.selectedOffset !== void 0 && (oe = o.selectedOffset), o.seldist !== void 0 && (oe = o.seldist), V -= oe, G += oe, Q -= oe, H += oe, ae -= oe, U += oe; + for (let se = 0; se < B.length; se++) + B[se].x > V && B[se].x < G && B[se].y > Q && B[se].y < H && B[se].z > ae && B[se].z < U && b.inSelectedRegion(B[se], o.coords, oe) ? (N.push($.length), $.push(B[se])) : N.push(-1); + for (let se = 0; se + 2 < F.length; se += 3) + N[F[se]] !== -1 && N[F[se + 1]] !== -1 && N[F[se + 2]] !== -1 && (k.push(F[se] - (F[se] - N[F[se]])), k.push(F[se + 1] - (F[se + 1] - N[F[se + 1]])), k.push(F[se + 2] - (F[se + 2] - N[F[se + 2]]))); + B = $, F = k; } b.drawCustom(this, this.geo, { - vertexArr: z, + vertexArr: B, faceArr: F, normalArr: [], clickable: o.clickable, hoverable: o.hoverable }), this.updateStyle(o); - var ne = new _.Vector3(n.origin.x, n.origin.y, n.origin.z), me = new _.Vector3(n.size.x * n.unit.x, n.size.y * n.unit.y, n.size.z * n.unit.z), se = new _.Vector3(0, 0, 0), fe = ne.clone(), Ce = ne.clone().add(me); - for (let ae = 0; ae < z.length; ae++) - se.add(z[ae]), fe.max(z[ae]), Ce.min(z[ae]); - se.divideScalar(z.length); - var Me = se.distanceTo(Ce), Te = se.distanceTo(fe); - this.boundingSphere.center = se, this.boundingSphere.radius = Math.max(Me, Te), typeof w == "function" && w(); + var q = new u.Vector3(s.origin.x, s.origin.y, s.origin.z), me = new u.Vector3(s.size.x * s.unit.x, s.size.y * s.unit.y, s.size.z * s.unit.z), ne = new u.Vector3(0, 0, 0), fe = q.clone(), Ce = q.clone().add(me); + for (let se = 0; se < B.length; se++) + ne.add(B[se]), fe.max(B[se]), Ce.min(B[se]); + ne.divideScalar(B.length); + var Me = ne.distanceTo(Ce), Te = ne.distanceTo(fe); + this.boundingSphere.center = ne, this.boundingSphere.radius = Math.max(Me, Te), typeof w == "function" && w(); } /** * @deprecated Use addIsosurface instead @@ -5943,8 +5943,8 @@ ATOM`, g); * @param {string} fmt - Input data format (e.g. 'cube' for cube file format) * @param {IsoSurfaceSpec} isoSpec - Volumetric data shape specification */ - addVolumetricData(n, o, w) { - n = new u.VolumeData(n, o), this.addIsosurface(n, w); + addVolumetricData(s, o, w) { + s = new _.VolumeData(s, o), this.addIsosurface(s, w); } //for internal use, truncate buffers to save memory finalize() { @@ -5955,36 +5955,36 @@ ATOM`, g); * @param {$3Dmol.Object3D} group * */ - globj(n) { - if (this.renderedShapeObj && (n.remove(this.renderedShapeObj), this.renderedShapeObj = null), !this.hidden) { - b.finalizeGeo(this.geo), this.geo.initTypedArrays(), this.wireframe && this.geo.setUpWireframe(), typeof this.color < "u" && b.updateColor(this.geo, this.color), this.shapeObj = new s.Object3D(); + globj(s) { + if (this.renderedShapeObj && (s.remove(this.renderedShapeObj), this.renderedShapeObj = null), !this.hidden) { + b.finalizeGeo(this.geo), this.geo.initTypedArrays(), this.wireframe && this.geo.setUpWireframe(), typeof this.color < "u" && b.updateColor(this.geo, this.color), this.shapeObj = new n.Object3D(); var o = null; - this.side == s.DoubleSide ? o = new s.MeshDoubleLambertMaterial({ + this.side == n.DoubleSide ? o = new n.MeshDoubleLambertMaterial({ wireframe: this.wireframe, side: this.side, transparent: this.opacity < 1, opacity: this.opacity, wireframeLinewidth: this.linewidth, - vertexColors: s.Coloring.VertexColors - }) : o = new s.MeshLambertMaterial({ + vertexColors: n.Coloring.VertexColors + }) : o = new n.MeshLambertMaterial({ wireframe: this.wireframe, side: this.side, transparent: this.opacity < 1, opacity: this.opacity, wireframeLinewidth: this.linewidth, - vertexColors: s.Coloring.VertexColors + vertexColors: n.Coloring.VertexColors }); - var w = new s.Mesh(this.geo, o); + var w = new n.Mesh(this.geo, o); this.shapeObj.add(w); - var p = new s.LineBasicMaterial({ + var p = new n.LineBasicMaterial({ linewidth: this.linewidth, color: this.color - }), v = new s.Line(this.linegeo, p, s.LineStyle.LinePieces); - this.shapeObj.add(v), this.renderedShapeObj = this.shapeObj.clone(), n.add(this.renderedShapeObj); + }), v = new n.Line(this.linegeo, p, n.LineStyle.LinePieces); + this.shapeObj.add(v), this.renderedShapeObj = this.shapeObj.clone(), s.add(this.renderedShapeObj); } } - removegl(n) { - this.renderedShapeObj && (this.renderedShapeObj.geometry !== void 0 && this.renderedShapeObj.geometry.dispose(), this.renderedShapeObj.material !== void 0 && this.renderedShapeObj.material.dispose(), n.remove(this.renderedShapeObj), this.renderedShapeObj = null), this.shapeObj = null; + removegl(s) { + this.renderedShapeObj && (this.renderedShapeObj.geometry !== void 0 && this.renderedShapeObj.geometry.dispose(), this.renderedShapeObj.material !== void 0 && this.renderedShapeObj.material.dispose(), s.remove(this.renderedShapeObj), this.renderedShapeObj = null), this.shapeObj = null; } get position() { return this.boundingSphere.center; @@ -5999,17 +5999,17 @@ ATOM`, g); return this.boundingSphere.center.z; } } - b.ISDONE = 2, b.drawCustom = function(S, n, o) { + b.ISDONE = 2, b.drawCustom = function(S, s, o) { var w = o, p = w.vertexArr, v = w.faceArr; (p.length === 0 || v.length === 0) && console.warn("Error adding custom shape component: No vertices and/or face indices supplied!"); var a = o.color; - typeof a > "u" && (a = S.color), a = x.CC.color(a); + typeof a > "u" && (a = S.color), a = y.CC.color(a); for (var l = A(w), g = 0, M = l.length; g < M; g++) - b.addCustomGeo(S, n, l[g], l[g].colorArr ? l[g].colorArr : a, o.clickable); + b.addCustomGeo(S, s, l[g], l[g].colorArr ? l[g].colorArr : a, o.clickable); }; function A(S) { - var n = 64e3; - if (S.vertexArr.length < n) + var s = 64e3; + if (S.vertexArr.length < s) return [S]; var o = [{ vertexArr: [], normalArr: [], faceArr: [] }]; S.colorArr && (o.colorArr = []); @@ -6020,7 +6020,7 @@ ATOM`, g); var l = a[g + T]; w[l] !== v && (w[l] = v, p[l] = L.vertexArr.length, L.vertexArr.push(S.vertexArr[l]), S.normalArr && S.normalArr[l] && L.normalArr.push(S.normalArr[l]), S.colorArr && S.colorArr[l] && L.colorArr.push(S.colorArr[l])), L.faceArr.push(p[l]); } - L.vertexArr.length >= n && (o.push({ vertexArr: [], normalArr: [], faceArr: [] }), S.colorArr && (o.colorArr = []), v++); + L.vertexArr.length >= s && (o.push({ vertexArr: [], normalArr: [], faceArr: [] }), S.colorArr && (o.colorArr = []), v++); } return o; } @@ -6037,7 +6037,7 @@ ATOM`, g); /* harmony export */ GLViewer: () => ( /* binding */ - n + s ), /* harmony export */ createStereoViewer: () => ( @@ -6056,22 +6056,22 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./WebGL */ "./src/WebGL/index.ts" ), f = t( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), _ = t( + ), u = t( /*! ./colors */ "./src/colors.ts" - ), x = t( + ), y = t( /*! ./utilities */ "./src/utilities.ts" ), h = t( /*! ./Gradient */ "./src/Gradient.ts" - ), u = t( + ), _ = t( /*! ./GLModel */ "./src/GLModel.ts" ), E = t( @@ -6093,7 +6093,7 @@ ATOM`, g); /*! upng-js */ "./node_modules/upng-js/UPNG.js" ); - class n { + class s { //reimplement jquery getwidth/height getRect() { let a = this.container, l = a.getBoundingClientRect(); @@ -6110,7 +6110,7 @@ ATOM`, g); return this.getRect().height; } setupRenderer() { - this.renderer = new s.Renderer({ + this.renderer = new n.Renderer({ antialias: this.config.antialias, preserveDrawingBuffer: !0, premultipliedAlpha: !1, @@ -6126,8 +6126,8 @@ ATOM`, g); }), this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%", this.renderer.domElement.style.padding = "0", this.renderer.domElement.style.position = "absolute", this.renderer.domElement.style.top = "0px", this.renderer.domElement.style.left = "0px", this.renderer.domElement.style.zIndex = "0"; } initializeScene() { - this.scene = new s.Scene(), this.scene.fog = new s.Fog(this.bgColor, 100, 200), this.modelGroup = new s.Object3D(), this.rotationGroup = new s.Object3D(), this.rotationGroup.useQuaternion = !0, this.rotationGroup.quaternion = new f.Quaternion(0, 0, 0, 1), this.rotationGroup.add(this.modelGroup), this.scene.add(this.rotationGroup); - var a = new s.Light(16777215); + this.scene = new n.Scene(), this.scene.fog = new n.Fog(this.bgColor, 100, 200), this.modelGroup = new n.Object3D(), this.rotationGroup = new n.Object3D(), this.rotationGroup.useQuaternion = !0, this.rotationGroup.quaternion = new f.Quaternion(0, 0, 0, 1), this.rotationGroup.add(this.modelGroup), this.scene.add(this.rotationGroup); + var a = new n.Light(16777215); a.position = new f.Vector3(0.2, 0.2, 1).normalize(), a.intensity = 1, this.scene.add(a); } initContainer(a) { @@ -6191,7 +6191,7 @@ ATOM`, g); let M = this.targetedObjects(a, l, this.clickables); if (M.length) { var L = M[0].clickable; - L.callback !== void 0 && (typeof L.callback != "function" && (L.callback = (0, x.makeFunction)(L.callback)), typeof L.callback == "function" && L.callback(L, this._viewer, g, this.container, M)); + L.callback !== void 0 && (typeof L.callback != "function" && (L.callback = (0, y.makeFunction)(L.callback)), typeof L.callback == "function" && L.callback(L, this._viewer, g, this.container, M)); } } //return offset of container @@ -6204,7 +6204,7 @@ ATOM`, g); } //set current_hover to sel (which can be null), calling appropraite callbacks setHover(a, l, g) { - this.current_hover != a && (this.current_hover && (typeof this.current_hover.unhover_callback != "function" && (this.current_hover.unhover_callback = (0, x.makeFunction)(this.current_hover.unhover_callback)), this.current_hover.unhover_callback(this.current_hover, this._viewer, l, this.container, g)), this.current_hover = a, a && a.hover_callback !== void 0 && (typeof a.hover_callback != "function" && (a.hover_callback = (0, x.makeFunction)(a.hover_callback)), typeof a.hover_callback == "function" && a.hover_callback(a, this._viewer, l, this.container, g))); + this.current_hover != a && (this.current_hover && (typeof this.current_hover.unhover_callback != "function" && (this.current_hover.unhover_callback = (0, y.makeFunction)(this.current_hover.unhover_callback)), this.current_hover.unhover_callback(this.current_hover, this._viewer, l, this.container, g)), this.current_hover = a, a && a.hover_callback !== void 0 && (typeof a.hover_callback != "function" && (a.hover_callback = (0, y.makeFunction)(a.hover_callback)), typeof a.hover_callback == "function" && a.hover_callback(a, this._viewer, l, this.container, g))); } //checks for selection intersects on hover handleHoverSelection(a, l, g) { @@ -6252,8 +6252,8 @@ ATOM`, g); //for grid viewers, return true if point is in this viewer isInViewer(a, l) { if (this.viewers != null) { - var g = this.WIDTH / this.cols, M = this.HEIGHT / this.rows, L = this.canvasOffset(), T = a - L.left, D = l - L.top, R = this.rows - Math.floor(D / M) - 1, B = Math.floor(T / g); - if (R != this.row || B != this.col) + var g = this.WIDTH / this.cols, M = this.HEIGHT / this.rows, L = this.canvasOffset(), T = a - L.left, D = l - L.top, I = this.rows - Math.floor(D / M) - 1, z = Math.floor(T / g); + if (I != this.row || z != this.col) return !1; } return !0; @@ -6280,20 +6280,20 @@ ATOM`, g); return a.clone(); let M = a.x * l.x + a.y * l.y + a.z * l.z + a.w * l.w; if (M > 0.9995) { - let z = new f.Quaternion(a.x + g * (l.x - a.x), a.y + g * (l.y - a.y), a.z + g * (l.z - a.z), a.w + g * (l.w - a.w)); - return z.normalize(), z; + let B = new f.Quaternion(a.x + g * (l.x - a.x), a.y + g * (l.y - a.y), a.z + g * (l.z - a.z), a.w + g * (l.w - a.w)); + return B.normalize(), B; } M < 0 && (l = l.clone().multiplyScalar(-1), M = -M), M > 1 ? M = 1 : M < -1 && (M = -1); var L = Math.acos(M), T = L * g, D = l.clone(); D.sub(a.clone().multiplyScalar(M)), D.normalize(); - var R = Math.cos(T), B = Math.sin(T), P = new f.Quaternion(a.x * R + D.x * B, a.y * R + D.y * B, a.z * R + D.z * B, a.w * R + D.w * B); + var I = Math.cos(T), z = Math.sin(T), P = new f.Quaternion(a.x * I + D.x * z, a.y * I + D.y * z, a.z * I + D.z * z, a.w * I + D.w * z); 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(a, l = {}) { - this.nomouse = !1, this.glDOM = null, this.models = [], this.surfaces = {}, this.shapes = [], this.labels = [], this.clickables = [], this.hoverables = [], this.contextMenuEnabledAtoms = [], this.current_hover = null, this.hoverDuration = 500, 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 f.Quaternion(0, 0, 0, 1), this.dq = new f.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 = l, this.callback = this.config.callback, this.defaultcolors = this.config.defaultcolors, this.defaultcolors || (this.defaultcolors = _.elementColors.defaultColors), this.nomouse = this.config.nomouse, this.bgColor = 0, this.config.backgroundColor = this.config.backgroundColor || "#ffffff", typeof this.config.backgroundColor < "u" && (this.bgColor = _.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 = parseFloat(this.config.camerax)), this._viewer = this, this.container = a, 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 s.Camera(this.fov, this.ASPECT, this.NEAR, this.FAR, this.config.orthographic), this.camera.position = new f.Vector3(this.camerax, 0, this.CAMERA_Z), this.lookingAt = new f.Vector3(), this.camera.lookAt(this.lookingAt), this.raycaster = new s.Raycaster(new f.Vector3(0, 0, 0), new f.Vector3(0, 0, 0)), this.projector = new s.Projector(), this.initializeScene(), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), this.scene.fog.color = _.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)); + this.nomouse = !1, this.glDOM = null, this.models = [], this.surfaces = {}, this.shapes = [], this.labels = [], this.clickables = [], this.hoverables = [], this.contextMenuEnabledAtoms = [], this.current_hover = null, this.hoverDuration = 500, 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 f.Quaternion(0, 0, 0, 1), this.dq = new f.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 = l, this.callback = this.config.callback, this.defaultcolors = this.config.defaultcolors, this.defaultcolors || (this.defaultcolors = u.elementColors.defaultColors), this.nomouse = this.config.nomouse, this.bgColor = 0, this.config.backgroundColor = this.config.backgroundColor || "#ffffff", typeof this.config.backgroundColor < "u" && (this.bgColor = u.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 = parseFloat(this.config.camerax)), this._viewer = this, this.container = a, 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 n.Camera(this.fov, this.ASPECT, this.NEAR, this.FAR, this.config.orthographic), this.camera.position = new f.Vector3(this.camerax, 0, this.CAMERA_Z), this.lookingAt = new f.Vector3(), this.camera.lookAt(this.lookingAt), this.raycaster = new n.Raycaster(new f.Vector3(0, 0, 0), new f.Vector3(0, 0, 0)), this.projector = new n.Projector(), this.initializeScene(), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), this.scene.fog.color = u.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)); try { typeof this.callback == "function" && this.callback(this); } catch (g) { @@ -6322,13 +6322,13 @@ ATOM`, g); modelToScreen(a) { let l = !1; Array.isArray(a) || (a = [a], l = !0); - let g = this.renderer.getXRatio(), M = this.renderer.getYRatio(), L = this.col, T = this.row, D = L * (this.WIDTH / g), R = (M - T - 1) * (this.HEIGHT / M), B = [], P = this.canvasOffset(); - return a.forEach((z) => { - let F = new f.Vector3(z.x, z.y, z.z); + let g = this.renderer.getXRatio(), M = this.renderer.getYRatio(), L = this.col, T = this.row, D = L * (this.WIDTH / g), I = (M - T - 1) * (this.HEIGHT / M), z = [], P = this.canvasOffset(); + return a.forEach((B) => { + let F = new f.Vector3(B.x, B.y, B.z); F.applyMatrix4(this.modelGroup.matrixWorld), this.projector.projectVector(F, this.camera); - let N = this.WIDTH / g * (F.x + 1) / 2 + P.left + D, $ = -(this.HEIGHT / M) * (F.y - 1) / 2 + P.top + R; - B.push({ x: N, y: $ }); - }), l && (B = B[0]), B; + let N = this.WIDTH / g * (F.x + 1) / 2 + P.left + D, $ = -(this.HEIGHT / M) * (F.y - 1) / 2 + P.top + I; + z.push({ x: N, y: $ }); + }), l && (z = z[0]), z; } /** * For a given screen (x,y) displacement return model displacement @@ -6337,8 +6337,8 @@ ATOM`, g); * @param{modelz} z coordinate in model coordinates to compute offset for, default is model axis */ screenOffsetToModel(a, l, g) { - var M = a / this.WIDTH, L = l / this.HEIGHT, T = g === void 0 ? this.rotationGroup.position.z : g, D = this.rotationGroup.quaternion, R = new f.Vector3(0, 0, T); - return this.projector.projectVector(R, this.camera), R.x += M * 2, R.y -= L * 2, this.projector.unprojectVector(R, this.camera), R.z = 0, R.applyQuaternion(D), R; + var M = a / this.WIDTH, L = l / this.HEIGHT, T = g === void 0 ? this.rotationGroup.position.z : g, D = this.rotationGroup.quaternion, I = new f.Vector3(0, 0, T); + return this.projector.projectVector(I, this.camera), I.x += M * 2, I.y -= L * 2, this.projector.unprojectVector(I, this.camera), I.z = 0, I.applyQuaternion(D), I; } /** * Distance from screen coordinate to model coordinate assuming screen point @@ -6401,7 +6401,7 @@ ATOM`, g); this.clear(); var l = a.models; for (let g = 0; g < l.length; g++) - l[g] && (this.models[g] = new u.GLModel(g), this.models[g].setInternalState(l[g])); + l[g] && (this.models[g] = new _.GLModel(g), this.models[g].setInternalState(l[g])); this.render(); } /** @@ -6492,19 +6492,19 @@ ATOM`, g); apngURI(a) { let l = this; return a = a || 1, new Promise(function(g) { - let M = 0, L = l.viewChangeCallback, T = [], D = [], R = Date.now(); + let M = 0, L = l.viewChangeCallback, T = [], D = [], I = Date.now(); l.viewChangeCallback = function() { - D.push(Date.now() - R), R = Date.now(), T.push(new Promise((B) => { + D.push(Date.now() - I), I = Date.now(), T.push(new Promise((z) => { l.getCanvas().toBlob(function(P) { - P.arrayBuffer().then(B); + P.arrayBuffer().then(z); }, "image/png"); - })), M += 1, M == a && (l.viewChangeCallback = L, Promise.all(T).then((B) => { + })), M += 1, M == a && (l.viewChangeCallback = L, Promise.all(T).then((z) => { let P = []; - for (let G = 0; G < B.length; G++) { - let H = (0, S.decode)(B[G]); + for (let G = 0; G < z.length; G++) { + let H = (0, S.decode)(z[G]); P.push((0, S.toRGBA8)(H)[0]); } - let z = l.getCanvas().width, F = l.getCanvas().height, N = (0, S.encode)(P, z, F, 0, D), $ = new Blob([N], { type: "image/png" }), k = new FileReader(); + let B = l.getCanvas().width, F = l.getCanvas().height, N = (0, S.encode)(P, B, F, 0, D), $ = new Blob([N], { type: "image/png" }), k = new FileReader(); k.onload = function(G) { g(G.target.result); }, k.readAsDataURL($); @@ -6536,8 +6536,8 @@ ATOM`, g); this.hoverDuration = a; } mouseXY(a, l) { - let g = this.canvasOffset(), M = this.renderer.getXRatio(), L = this.renderer.getYRatio(), T = this.col, D = this.row, R = T * (this.WIDTH / M), B = (L - D - 1) * (this.HEIGHT / L), P = (a - g.left - R) / (this.WIDTH / M) * 2 - 1, z = -((l - g.top - B) / (this.HEIGHT / L)) * 2 + 1; - return { x: P, y: z }; + let g = this.canvasOffset(), M = this.renderer.getXRatio(), L = this.renderer.getYRatio(), T = this.col, D = this.row, I = T * (this.WIDTH / M), z = (L - D - 1) * (this.HEIGHT / L), P = (a - g.left - I) / (this.WIDTH / M) * 2 - 1, B = -((l - g.top - z) / (this.HEIGHT / L)) * 2 + 1; + return { x: P, y: B }; } _handleMouseMove(a) { clearTimeout(this.hoverTimeout), a.preventDefault(); @@ -6546,28 +6546,28 @@ ATOM`, g); return; let M = this.renderer.getXRatio(), L = this.renderer.getYRatio(), T = this.mouseXY(l, g), D = this; this.current_hover !== null && this.handleHoverContinue(T.x, T.y); - var R = 0; + var I = 0; if (!(!this.control_all && !this.isInViewer(l, g)) && this.scene && (this.hoverables.length > 0 && (this.hoverTimeout = setTimeout(function() { D.handleHoverSelection(T.x, T.y, a); }, this.hoverDuration)), !!this.isDragging)) { - var B = (l - this.mouseStartX) / this.WIDTH, P = (g - this.mouseStartY) / this.HEIGHT; + var z = (l - this.mouseStartX) / this.WIDTH, P = (g - this.mouseStartY) / this.HEIGHT; if (this.touchDistanceStart != 0 && a.targetTouches && a.targetTouches.length == 2) { - var z = this.calcTouchDistance(a); - R = 2, P = (z - this.touchDistanceStart) * 2 / (this.WIDTH + this.HEIGHT); + var B = this.calcTouchDistance(a); + I = 2, P = (B - this.touchDistanceStart) * 2 / (this.WIDTH + this.HEIGHT); } else - a.targetTouches && a.targetTouches.length == 3 && (R = 1); - B *= M, P *= L; - var F = Math.hypot(B, P), N; - if (R == 3 || this.mouseButton == 3 && a.ctrlKey) - this.slabNear = this.cslabNear + B * 100, this.slabFar = this.cslabFar - P * 100; - else if (R == 2 || this.mouseButton == 3 || a.shiftKey) + a.targetTouches && a.targetTouches.length == 3 && (I = 1); + z *= M, P *= L; + var F = Math.hypot(z, P), N; + if (I == 3 || this.mouseButton == 3 && a.ctrlKey) + this.slabNear = this.cslabNear + z * 100, this.slabFar = this.cslabFar - P * 100; + else if (I == 2 || this.mouseButton == 3 || a.shiftKey) N = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, N < 80 && (N = 80), this.rotationGroup.position.z = this.cz + P * N, this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z); - else if (R == 1 || this.mouseButton == 2 || a.ctrlKey) { + else if (I == 1 || this.mouseButton == 2 || a.ctrlKey) { var $ = this.screenOffsetToModel(M * (l - this.mouseStartX), L * (g - this.mouseStartY)); this.modelGroup.position.addVectors(this.currentModelPos, $); - } else if ((R === 0 || this.mouseButton == 1) && F !== 0) { + } else if ((I === 0 || this.mouseButton == 1) && F !== 0) { var k = Math.sin(F * Math.PI) / F; - this.dq.x = Math.cos(F * Math.PI), this.dq.y = 0, this.dq.z = k * B, this.dq.w = -k * P, this.rotationGroup.quaternion.set(1, 0, 0, 0), this.rotationGroup.quaternion.multiply(this.dq), this.rotationGroup.quaternion.multiply(this.cq); + this.dq.x = Math.cos(F * Math.PI), this.dq.y = 0, this.dq.z = k * z, this.dq.w = -k * P, this.rotationGroup.quaternion.set(1, 0, 0, 0), this.rotationGroup.quaternion.multiply(this.dq), this.rotationGroup.quaternion.multiply(this.cq); } this.show(); } @@ -6577,11 +6577,11 @@ ATOM`, g); var l = this.getX(a), g = this.getY(a); if (!(l != this.mouseStartX || g != this.mouseStartY)) { var T = this.mouseStartX, D = this.mouseStartY, L = this.canvasOffset(); - let R = this.mouseXY(T, D), B = R.x, P = R.y, z = this.targetedObjects(B, P, this.contextMenuEnabledAtoms); + let I = this.mouseXY(T, D), z = I.x, P = I.y, B = this.targetedObjects(z, P, this.contextMenuEnabledAtoms); var M = null; - z.length && (M = z[0].clickable); + B.length && (M = B[0].clickable); var L = this.canvasOffset(), T = this.mouseStartX - L.left, D = this.mouseStartY - L.top; - this.userContextMenuHandler && this.userContextMenuHandler(M, T, D, z); + this.userContextMenuHandler && this.userContextMenuHandler(M, T, D, B); } } /** @@ -6593,7 +6593,7 @@ ATOM`, g); */ setContainer(a) { - let l = (0, x.getElement)(a) || this.container; + let l = (0, y.getElement)(a) || this.container; return this.initContainer(l), this; } /** @@ -6613,7 +6613,7 @@ ATOM`, g); */ setBackgroundColor(a, l) { (typeof l > "u" || l < 0 || l > 1) && (l = 1); - var g = _.CC.color(a); + var g = u.CC.color(a); return this.scene.fog.color = g, this.bgColor = g.getHex(), this.renderer.setClearColorHex(g.getHex(), l), this.show(), this; } /** @@ -6657,7 +6657,7 @@ ATOM`, g); setViewStyle(a) { if (a.style === "outline") { var l = {}; - a.color && (l.color = _.CC.color(a.color)), a.width && (l.width = a.width), this.renderer.enableOutline(l); + a.color && (l.color = u.CC.color(a.color)), a.width && (l.width = a.width), this.renderer.enableOutline(l); } else this.renderer.disableOutline(); return this; @@ -6715,7 +6715,7 @@ ATOM`, g); }); */ getModel(a) { - return a === void 0 ? this.models.length == 0 ? null : this.models[this.models.length - 1] : a instanceof u.GLModel ? a : a in this.models ? this.models[a] : this.models.length == 0 ? null : this.models[this.models.length - 1]; + return a === void 0 ? this.models.length == 0 ? null : this.models[this.models.length - 1] : a instanceof _.GLModel ? a : a in this.models ? this.models[a] : this.models.length == 0 ? null : this.models[this.models.length - 1]; } /** * Continuously rotate a scene around the specified axis. @@ -6751,19 +6751,19 @@ ATOM`, g); //return array includes final position, but not current //the returned array includes an animate method animateMotion(a, l, g, M, L, T) { - var D = 20, R = Math.ceil(a / D); - R < 1 && (R = 1), this.incAnim(); - var B = { + var D = 20, I = Math.ceil(a / D); + I < 1 && (I = 1), this.incAnim(); + var z = { mpos: this.modelGroup.position.clone(), rz: this.rotationGroup.position.z, rot: this.rotationGroup.quaternion.clone(), cam: this.lookingAt.clone() }; if (l) { - let F = new Array(R); - for (let G = 0; G < R; G++) { - let H = (G + 1) / R, U = { mpos: B.mpos, rz: B.rz, rot: B.rot }; - U.mpos = g.clone().sub(B.mpos).multiplyScalar(H).add(B.mpos), U.rz = B.rz + H * (M - B.rz), U.rot = n.slerp(B.rot, L, H), U.cam = T.clone().sub(B.cam).multiplyScalar(H).add(B.cam), F[G] = U; + let F = new Array(I); + for (let G = 0; G < I; G++) { + let H = (G + 1) / I, U = { mpos: z.mpos, rz: z.rz, rot: z.rot }; + U.mpos = g.clone().sub(z.mpos).multiplyScalar(H).add(z.mpos), U.rz = z.rz + H * (M - z.rz), U.rot = s.slerp(z.rot, L, H), U.cam = T.clone().sub(z.cam).multiplyScalar(H).add(z.cam), F[G] = U; } let N = 0, $ = this, k = function() { var G = F[N]; @@ -6772,14 +6772,14 @@ ATOM`, g); setTimeout(k, D); } else { var P = {}; - let F = 1 / R; - if (g && (P.mpos = g.clone().sub(B.mpos).multiplyScalar(F)), typeof M < "u" && M != null && (P.rz = F * (M - B.rz)), L) { - var z = n.slerp(B.rot, L, F); - P.rot = B.rot.clone().inverse().multiply(z); + let F = 1 / I; + if (g && (P.mpos = g.clone().sub(z.mpos).multiplyScalar(F)), typeof M < "u" && M != null && (P.rz = F * (M - z.rz)), L) { + var B = s.slerp(z.rot, L, F); + P.rot = z.rot.clone().inverse().multiply(B); } - T && (P.cam = T.clone().sub(B.cam).multiplyScalar(F)); + T && (P.cam = T.clone().sub(z.cam).multiplyScalar(F)); let N = 0, $ = this, k = function() { - N += 1, P.mpos && $.modelGroup.position.add(P.mpos), P.rz && ($.rotationGroup.position.z += P.rz), P.rot && $.rotationGroup.quaternion.multiply(P.rot), P.cam && ($.lookingAt.add(P.cam), $.camera.lookAt($.lookingAt)), N < R ? setTimeout(k, D) : $.decAnim(), $.show(); + N += 1, P.mpos && $.modelGroup.position.add(P.mpos), P.rz && ($.rotationGroup.position.z += P.rz), P.rot && $.rotationGroup.quaternion.multiply(P.rot), P.cam && ($.lookingAt.add(P.cam), $.camera.lookAt($.lookingAt)), N < I ? setTimeout(k, D) : $.decAnim(), $.show(); }; setTimeout(k, D); } @@ -6813,14 +6813,14 @@ ATOM`, g); L.applyQuaternion(this.rotationGroup.quaternion), l = { x: L.x, y: L.y, z: L.z }; } var T = function(P) { - var z = Math.sin(P / 2), F = Math.cos(P / 2), N = 0, $ = 0, k = 0; - return N = l.x * z, $ = l.y * z, k = l.z * z, new f.Quaternion(N, $, k, F).normalize(); - }, D = Math.PI * a / 180, R = T(D); + var B = Math.sin(P / 2), F = Math.cos(P / 2), N = 0, $ = 0, k = 0; + return N = l.x * B, $ = l.y * B, k = l.z * B, new f.Quaternion(N, $, k, F).normalize(); + }, D = Math.PI * a / 180, I = T(D); if (g) { - var B = new f.Quaternion().copy(this.rotationGroup.quaternion).multiply(R); - this.animateMotion(g, M, this.modelGroup.position, this.rotationGroup.position.z, B, this.lookingAt); + var z = new f.Quaternion().copy(this.rotationGroup.quaternion).multiply(I); + this.animateMotion(g, M, this.modelGroup.position, this.rotationGroup.position.z, z, this.lookingAt); } else - this.rotationGroup.quaternion.multiply(R), this.show(); + this.rotationGroup.quaternion.multiply(I), this.show(); return this; } surfacesFinished() { @@ -6879,16 +6879,16 @@ ATOM`, g); var D = T[L].geo; if (!T[L].finished || l.regen) { D.verticesNeedUpdate = !0, D.elementsNeedUpdate = !0, D.normalsNeedUpdate = !0, D.colorsNeedUpdate = !0, D.buffersNeedUpdate = !0, D.boundingSphere = null, T[L].done && (T[L].finished = !0), T[L].lastGL && this.modelGroup.remove(T[L].lastGL); - var R = null; - if (T[L].mat instanceof s.LineBasicMaterial ? R = new s.Line(D, T[L].mat) : R = new s.Mesh(D, T[L].mat), T[L].mat.transparent && T[L].mat.opacity == 0 ? R.visible = !1 : R.visible = !0, T[L].symmetries.length > 1 || T[L].symmetries.length == 1 && !T[L].symmetries[L].isIdentity()) { - var B, P = new s.Object3D(); - for (B = 0; B < T[L].symmetries.length; B++) { - var z = R.clone(); - z.matrix = T[L].symmetries[B], z.matrixAutoUpdate = !1, P.add(z); + var I = null; + if (T[L].mat instanceof n.LineBasicMaterial ? I = new n.Line(D, T[L].mat) : I = new n.Mesh(D, T[L].mat), T[L].mat.transparent && T[L].mat.opacity == 0 ? I.visible = !1 : I.visible = !0, T[L].symmetries.length > 1 || T[L].symmetries.length == 1 && !T[L].symmetries[L].isIdentity()) { + var z, P = new n.Object3D(); + for (z = 0; z < T[L].symmetries.length; z++) { + var B = I.clone(); + B.matrix = T[L].symmetries[z], B.matrixAutoUpdate = !1, P.add(B); } T[L].lastGL = P, this.modelGroup.add(P); } else - T[L].lastGL = R, this.modelGroup.add(R); + T[L].lastGL = I, this.modelGroup.add(I); } } } @@ -7028,8 +7028,8 @@ ATOM`, g); translate(a, l, g = 0, M = !1) { var L = a / this.WIDTH, T = l / this.HEIGHT, D = new f.Vector3(0, 0, -this.CAMERA_Z); this.projector.projectVector(D, this.camera), D.x -= L, D.y -= T, this.projector.unprojectVector(D, this.camera), D.z = 0; - var R = this.lookingAt.clone().add(D); - return g > 0 ? this.animateMotion(g, M, this.modelGroup.position, this.rotationGroup.position.z, this.rotationGroup.quaternion, R) : (this.lookingAt = R, this.camera.lookAt(this.lookingAt), this.show()), this; + var I = this.lookingAt.clone().add(D); + return g > 0 ? this.animateMotion(g, M, this.modelGroup.position, this.rotationGroup.position.z, this.rotationGroup.quaternion, I) : (this.lookingAt = I, this.camera.lookAt(this.lookingAt), this.show()), this; } /** * Translate current models by x,y screen coordinates @@ -7065,7 +7065,7 @@ ATOM`, g); */ fitSlab(a) { a = a || {}; - var l = this.getAtomsFromSel(a), g = (0, x.getExtent)(l), M = g[1][0] - g[0][0], L = g[1][1] - g[0][1], T = g[1][2] - g[0][2], D = Math.hypot(M, L, T); + var l = this.getAtomsFromSel(a), g = (0, y.getExtent)(l), M = g[1][0] - g[0][0], L = g[1][1] - g[0][1], T = g[1][2] - g[0][2], D = Math.hypot(M, L, T); return D < 5 && (D = 5), this.slabNear = -D / 1.9, this.slabFar = D / 2, this; } /** @@ -7093,22 +7093,22 @@ ATOM`, g); }); */ center(a = {}, l = 0, g = !1) { - var M, L, T = this.getAtomsFromSel(a), D = (0, x.getExtent)(T); - (0, x.isEmptyObject)(a) ? (this.shapes.forEach((H) => { + var M, L, T = this.getAtomsFromSel(a), D = (0, y.getExtent)(T); + (0, y.isEmptyObject)(a) ? (this.shapes.forEach((H) => { if (H && H.boundingSphere && H.boundingSphere.center) { var U = H.boundingSphere.center, V = H.boundingSphere.radius; V > 0 ? (T.push(new f.Vector3(U.x + V, U.y, U.z)), T.push(new f.Vector3(U.x - V, U.y, U.z)), T.push(new f.Vector3(U.x, U.y + V, U.z)), T.push(new f.Vector3(U.x, U.y - V, U.z)), T.push(new f.Vector3(U.x, U.y, U.z + V)), T.push(new f.Vector3(U.x, U.y, U.z - V))) : T.push(U); } - }), D = (0, x.getExtent)(T), M = T, L = D) : (M = this.getAtomsFromSel({}), L = (0, x.getExtent)(M)); - var R = new f.Vector3(D[2][0], D[2][1], D[2][2]), B = L[1][0] - L[0][0], P = L[1][1] - L[0][1], z = L[1][2] - L[0][2], F = Math.hypot(B, P, z); - F < 5 && (F = 5), this.slabNear = -F / 1.9, this.slabFar = F / 2, B = D[1][0] - D[0][0], P = D[1][1] - D[0][1], z = D[1][2] - D[0][2], F = Math.hypot(B, P, z), F < 5 && (F = 5); + }), D = (0, y.getExtent)(T), M = T, L = D) : (M = this.getAtomsFromSel({}), L = (0, y.getExtent)(M)); + var I = new f.Vector3(D[2][0], D[2][1], D[2][2]), z = L[1][0] - L[0][0], P = L[1][1] - L[0][1], B = L[1][2] - L[0][2], F = Math.hypot(z, P, B); + F < 5 && (F = 5), this.slabNear = -F / 1.9, this.slabFar = F / 2, z = D[1][0] - D[0][0], P = D[1][1] - D[0][1], B = D[1][2] - D[0][2], F = Math.hypot(z, P, B), F < 5 && (F = 5); for (var N = 25, $ = 0; $ < T.length; $++) if (T[$]) { - var k = R.distanceToSquared(T[$]); + var k = I.distanceToSquared(T[$]); k > N && (N = k); } F = Math.sqrt(N) * 2; - var G = R.clone().multiplyScalar(-1); + var G = I.clone().multiplyScalar(-1); return l > 0 ? this.animateMotion(l, g, G, this.rotationGroup.position.z, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = G, this.show()), this; } /** @@ -7141,37 +7141,37 @@ ATOM`, g); }); */ zoomTo(a = {}, l = 0, g = !1) { - let M = this.getAtomsFromSel(a), L = (0, x.getExtent)(M), T = L; - if ((0, x.isEmptyObject)(a)) { + let M = this.getAtomsFromSel(a), L = (0, y.getExtent)(M), T = L; + if ((0, y.isEmptyObject)(a)) { let U = M && M.length; if (this.shapes.forEach((V) => { if (V && V.boundingSphere) { if (V.boundingSphere.box) { - let ee = V.boundingSphere.box; - M.push(new f.Vector3(ee.min.x, ee.min.y, ee.min.z)), M.push(new f.Vector3(ee.max.x, ee.max.y, ee.max.z)); + let oe = V.boundingSphere.box; + M.push(new f.Vector3(oe.min.x, oe.min.y, oe.min.z)), M.push(new f.Vector3(oe.max.x, oe.max.y, oe.max.z)); } else if (V.boundingSphere.center) { - var Q = V.boundingSphere.center, oe = V.boundingSphere.radius; - oe > 0 ? (M.push(new f.Vector3(Q.x + oe, Q.y, Q.z)), M.push(new f.Vector3(Q.x - oe, Q.y, Q.z)), M.push(new f.Vector3(Q.x, Q.y + oe, Q.z)), M.push(new f.Vector3(Q.x, Q.y - oe, Q.z)), M.push(new f.Vector3(Q.x, Q.y, Q.z + oe)), M.push(new f.Vector3(Q.x, Q.y, Q.z - oe))) : M.push(Q); + var Q = V.boundingSphere.center, ae = V.boundingSphere.radius; + ae > 0 ? (M.push(new f.Vector3(Q.x + ae, Q.y, Q.z)), M.push(new f.Vector3(Q.x - ae, Q.y, Q.z)), M.push(new f.Vector3(Q.x, Q.y + ae, Q.z)), M.push(new f.Vector3(Q.x, Q.y - ae, Q.z)), M.push(new f.Vector3(Q.x, Q.y, Q.z + ae)), M.push(new f.Vector3(Q.x, Q.y, Q.z - ae))) : M.push(Q); } } - }), T = (0, x.getExtent)(M), !U) + }), T = (0, y.getExtent)(M), !U) for (let V = 0; V < 3; V++) L[2][V] = (T[0][V] + T[1][V]) / 2; } else { let U = this.getAtomsFromSel({}); - T = (0, x.getExtent)(U); + T = (0, y.getExtent)(U); } - var D = new f.Vector3(L[2][0], L[2][1], L[2][2]), R = T[1][0] - T[0][0], B = T[1][1] - T[0][1], P = T[1][2] - T[0][2], z = Math.hypot(R, B, P); - z < 5 && (z = 5), this.slabNear = -z / 1.9, this.slabFar = z / 2, Object.keys(a).length === 0 && (this.slabNear = Math.min(-z * 2, -50), this.slabFar = Math.max(z * 2, 50)); + var D = new f.Vector3(L[2][0], L[2][1], L[2][2]), I = T[1][0] - T[0][0], z = T[1][1] - T[0][1], P = T[1][2] - T[0][2], B = Math.hypot(I, z, P); + B < 5 && (B = 5), this.slabNear = -B / 1.9, this.slabFar = B / 2, Object.keys(a).length === 0 && (this.slabNear = Math.min(-B * 2, -50), this.slabFar = Math.max(B * 2, 50)); var F = this.config.minimumZoomToDistance || 5; - R = L[1][0] - L[0][0], B = L[1][1] - L[0][1], P = L[1][2] - L[0][2], z = Math.hypot(R, B, P), z < F && (z = F); + I = L[1][0] - L[0][0], z = L[1][1] - L[0][1], P = L[1][2] - L[0][2], B = Math.hypot(I, z, P), B < F && (B = F); for (var N = F * F, $ = 0; $ < M.length; $++) if (M[$]) { var k = D.distanceToSquared(M[$]); k > N && (N = k); } - z = Math.sqrt(N) * 2; - var G = D.clone().multiplyScalar(-1), H = -(z * 0.5 / Math.tan(Math.PI / 180 * this.camera.fov / 2) - this.CAMERA_Z); + B = Math.sqrt(N) * 2; + var G = D.clone().multiplyScalar(-1), H = -(B * 0.5 / Math.tan(Math.PI / 180 * this.camera.fov / 2) - this.CAMERA_Z); return H = this.adjustZoomToLimits(H), l > 0 ? this.animateMotion(l, g, G, H, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = G, this.rotationGroup.position.z = H, this.show()), this; } /** @@ -7234,7 +7234,7 @@ ATOM`, g); */ addLabel(a, l = {}, g, M = !1) { if (g) { - var L = (0, x.getExtent)(this.getAtomsFromSel(g)); + var L = (0, y.getExtent)(this.getAtomsFromSel(g)); l.position = { x: L[2][0], y: L[2][1], z: L[2][2] }; } var T = new E.Label(a, l); @@ -7389,7 +7389,7 @@ ATOM`, g); var l = this.getAtomsFromSel(a); if (l.length == 0) return { x: 0, y: 0, z: 0 }; - var g = (0, x.getExtent)(l); + var g = (0, y.getExtent)(l); return { x: g[0][0] + (g[1][0] - g[0][0]) / 2, y: g[0][1] + (g[1][1] - g[0][1]) / 2, z: g[0][2] + (g[1][2] - g[0][2]) / 2 }; } /** @@ -7570,10 +7570,10 @@ ATOM`, g); if (g.matrix) M = g.matrix; else { - var L = g.a, T = g.b, D = g.c, R = g.alpha, B = g.beta, P = g.gamma; - R = R * Math.PI / 180, B = B * Math.PI / 180, P = P * Math.PI / 180; - var z, F, N; - z = Math.cos(B), F = (Math.cos(R) - Math.cos(B) * Math.cos(P)) / Math.sin(P), N = Math.sqrt(Math.max(0, 1 - z * z - F * F)), M = new f.Matrix3(L, T * Math.cos(P), D * z, 0, T * Math.sin(P), D * F, 0, 0, D * N); + var L = g.a, T = g.b, D = g.c, I = g.alpha, z = g.beta, P = g.gamma; + I = I * Math.PI / 180, z = z * Math.PI / 180, P = P * Math.PI / 180; + var B, F, N; + B = Math.cos(z), F = (Math.cos(I) - Math.cos(z) * Math.cos(P)) / Math.sin(P), N = Math.sqrt(Math.max(0, 1 - B * B - F * F)), M = new f.Matrix3(L, T * Math.cos(P), D * B, 0, T * Math.sin(P), D * F, 0, 0, D * N); } var $ = [ new f.Vector3(0, 0, 0), @@ -7676,17 +7676,17 @@ ATOM`, g); M = this.getModel(M); let T = M.getCrystData(); if (T) { - const D = M.selectedAtoms({}), R = T.matrix; - let B = function(P) { + const D = M.selectedAtoms({}), I = T.matrix; + let z = function(P) { return P % 2 == 0 ? -P / 2 : Math.ceil(P / 2); }; for (let P = 0; P < a; P++) - for (let z = 0; z < l; z++) + for (let B = 0; B < l; B++) for (let F = 0; F < g; F++) { - if (P == 0 && z == 0 && F == 0) + if (P == 0 && B == 0 && F == 0) continue; - let N = new f.Vector3(B(P), B(z), B(F)); - N.applyMatrix3(R); + let N = new f.Vector3(z(P), z(B), z(F)); + N.applyMatrix3(I); let $ = []; for (let k = 0; k < D.length; k++) { let G = {}; @@ -7706,13 +7706,13 @@ ATOM`, g); a.start ? g = new f.Vector3(a.start.x || 0, a.start.y || 0, a.start.z || 0) : g = new f.Vector3(0, 0, 0); var M; a.end ? M = new f.Vector3(a.end.x, a.end.y || 0, a.end.z || 0) : M = new f.Vector3(0, 0, 0); - var L = new f.Vector3(), T = new f.Vector3(), D = new f.Vector3(), R, B, P, z = g.clone(), F = 0; - for (L.subVectors(M, g), R = L.length(), L.normalize(), T = L.clone(), D = L.clone(), T.multiplyScalar(a.dashLength), D.multiplyScalar(a.gapLength), B = T.length(), P = D.length(); F < R; ) { - if (F + B > R) { + var L = new f.Vector3(), T = new f.Vector3(), D = new f.Vector3(), I, z, P, B = g.clone(), F = 0; + for (L.subVectors(M, g), I = L.length(), L.normalize(), T = L.clone(), D = L.clone(), T.multiplyScalar(a.dashLength), D.multiplyScalar(a.gapLength), z = T.length(), P = D.length(); F < I; ) { + if (F + z > I) { a.start = g, a.end = M, l.addLine(a); break; } - z.addVectors(g, T), a.start = g, a.end = z, l.addLine(a), g = z.clone(), F += B, z.addVectors(g, D), g = z.clone(), F += P; + B.addVectors(g, T), a.start = g, a.end = B, l.addLine(a), g = B.clone(), F += z, B.addVectors(g, D), g = B.clone(), F += P; } return l.finalize(), l; } @@ -7826,7 +7826,7 @@ ATOM`, g); * @param {boolean} fog whether to enable or disable the fog */ enableFog(a) { - a ? this.scene.fog = new s.Fog(this.bgColor, 100, 200) : (this.config.disableFog = !0, this.show()); + a ? this.scene.fog = new n.Fog(this.bgColor, 100, 200) : (this.config.disableFog = !0, this.show()); } /** * Sets the atomlists of all models in the viewer to specified frame. @@ -7882,27 +7882,27 @@ ATOM`, g); a = a || {}, a.interval && (l = a.interval), a.loop && (g = a.loop), a.reps && (M = a.reps); var L = this.getNumFrames(), T = this, D = 0; a.startFrame && (D = a.startFrame % L); - var R = 1; - a.step && (R = a.step, M /= R); - var B = 0, P = L * M, z = /* @__PURE__ */ new Date(), F, N, $ = function(k) { - z = /* @__PURE__ */ new Date(), k == "forward" ? T.setFrame(D).then(function() { - D = (D + R) % L, F(); + var I = 1; + a.step && (I = a.step, M /= I); + var z = 0, P = L * M, B = /* @__PURE__ */ new Date(), F, N, $ = function(k) { + B = /* @__PURE__ */ new Date(), k == "forward" ? T.setFrame(D).then(function() { + D = (D + I) % L, F(); }) : k == "backward" ? T.setFrame(L - 1 - D).then(function() { - D = (D + R) % L, F(); + D = (D + I) % L, F(); }) : T.setFrame(D).then(function() { - D += R, R *= D % (L - 1) == 0 ? -1 : 1, F(); + D += I, I *= D % (L - 1) == 0 ? -1 : 1, F(); }); }; return F = function() { if (T.render(), !T.getCanvas().isConnected) T.stopAnimate(); - else if (++B == P || !T.isAnimated()) + else if (++z == P || !T.isAnimated()) N.cancel(), T.animationTimers.delete(N), T.decAnim(); else { - var k = l - ((/* @__PURE__ */ new Date()).getTime() - z.getTime()); - k = k > 0 ? k : 0, T.animationTimers.delete(N), N = new x.PausableTimer($, k, g), T.animationTimers.add(N); + var k = l - ((/* @__PURE__ */ new Date()).getTime() - B.getTime()); + k = k > 0 ? k : 0, T.animationTimers.delete(N), N = new y.PausableTimer($, k, g), T.animationTimers.add(N); } - }, N = new x.PausableTimer($, 0, g), this.animationTimers.add(N), this; + }, N = new y.PausableTimer($, 0, g), this.animationTimers.add(N), this; } /** * Stop animation of all models in viewer @@ -7959,7 +7959,7 @@ ATOM`, g); */ addModel(a, l = "", g) { g && !g.defaultcolors ? (g.defaultcolors = this.defaultcolors, g.cartoonQuality = g.cartoonQuality || this.config.cartoonQuality) : typeof g > "u" && (g = { defaultcolors: this.defaultcolors, cartoonQuality: this.config.cartoonQuality }); - var M = new u.GLModel(this.models.length, g); + var M = new _.GLModel(this.models.length, g); return M.addMolData(a, l, g), this.models.push(M), M; } /** @@ -7972,8 +7972,8 @@ ATOM`, g); */ addModels(a, l, g) { g = g || {}, g.multimodel = !0, g.frames = !0; - for (var M = u.GLModel.parseMolData(a, l, g), L = 0; L < M.length; L++) { - var T = new u.GLModel(this.models.length, this.defaultcolors); + for (var M = _.GLModel.parseMolData(a, l, g), L = 0; L < M.length; L++) { + var T = new _.GLModel(this.models.length, this.defaultcolors); T.setAtomDefaults(M[L]), T.addFrame(M[L]), T.setFrame(0), M.modelData && T.setModelData(M.modelData[L]), T.setDontDuplicateAtoms(!g.duplicateAssemblyAtoms), this.models.push(T); } return this.models; @@ -7998,7 +7998,7 @@ ATOM`, g); */ addModelsAsFrames(a, l, g) { g = g || {}, g.multimodel = !0, g.frames = !0; - var M = new u.GLModel(this.models.length, this.defaultcolors); + var M = new _.GLModel(this.models.length, this.defaultcolors); return M.addMolData(a, l, g), this.models.push(M), M; } /** @@ -8019,7 +8019,7 @@ ATOM`, g); */ addAsOneMolecule(a, l, g) { g = g || {}, g.multimodel = !0, g.onemol = !0; - var M = new u.GLModel(this.models.length, this.defaultcolors); + var M = new _.GLModel(this.models.length, this.defaultcolors); return M.addMolData(a, l, g), this.models.push(M), M; } /** @@ -8061,7 +8061,7 @@ ATOM`, g); */ exportVRML() { var a = this.modelGroup; - this.applyToModels("removegl", this.modelGroup), this.modelGroup = new s.Object3D(), this.render(null, { supportsImposters: !1, supportsAIA: !1, regen: !0 }); + this.applyToModels("removegl", this.modelGroup), this.modelGroup = new n.Object3D(), this.render(null, { supportsImposters: !1, supportsAIA: !1, regen: !0 }); var l = `#VRML V2.0 utf8 ` + this.modelGroup.vrml() + ` `; @@ -8076,7 +8076,7 @@ ATOM`, g); * @return {GLModel} */ createModelFrom(a, l = !1) { - for (var g = new u.GLModel(this.models.length, this.defaultcolors), M = 0; M < this.models.length; M++) + for (var g = new _.GLModel(this.models.length, this.defaultcolors), M = 0; M < this.models.length; M++) if (this.models[M]) { var L = this.models[M].selectedAtoms(a); g.addAtoms(L), l && this.models[M].removeAtoms(L); @@ -8084,8 +8084,8 @@ ATOM`, g); return this.models.push(g), g; } applyToModels(a, l, g, M, L, T, D) { - for (var R = this.getModelList(l), B = 0; B < R.length; B++) - R[B][a](l, g, M, L, T, D); + for (var I = this.getModelList(l), z = 0; z < I.length; z++) + I[z][a](l, g, M, L, T, D); } setStyle(a, l) { return typeof l > "u" && (l = a, a = {}), this.applyToModels("setStyle", a, l, !1), this; @@ -8218,32 +8218,32 @@ ATOM`, g); */ carveUpExtent(a, l, g) { let M = [], L = {}; - for (let z = 0, F = l.length; z < F; z++) - L[l[z].index] = z; - let T = function(z) { + for (let B = 0, F = l.length; B < F; B++) + L[l[B].index] = B; + let T = function(B) { let F = []; - for (let N = 0, $ = z.length; N < $; N++) - z[N].index in L && F.push(L[z[N].index]); + for (let N = 0, $ = B.length; N < $; N++) + B[N].index in L && F.push(L[B[N].index]); return F; - }, D = function(z) { + }, D = function(B) { let F = []; - return F[0] = [z[0][0], z[0][1], z[0][2]], F[1] = [z[1][0], z[1][1], z[1][2]], F; - }, R = function(z) { - if (n.volume(z) < n.maxVolume) - return [z]; - var F = z[1][0] - z[0][0], N = z[1][1] - z[0][1], $ = z[1][2] - z[0][2], k; + return F[0] = [B[0][0], B[0][1], B[0][2]], F[1] = [B[1][0], B[1][1], B[1][2]], F; + }, I = function(B) { + if (s.volume(B) < s.maxVolume) + return [B]; + var F = B[1][0] - B[0][0], N = B[1][1] - B[0][1], $ = B[1][2] - B[0][2], k; F > N && F > $ ? k = 0 : N > F && N > $ ? k = 1 : k = 2; - var G = D(z), H = D(z), U = (z[1][k] - z[0][k]) / 2 + z[0][k]; + var G = D(B), H = D(B), U = (B[1][k] - B[0][k]) / 2 + B[0][k]; G[1][k] = U, H[0][k] = U; - var V = R(G), Q = R(H); + var V = I(G), Q = I(H); return V.concat(Q); - }, B = R(a), P = 6; - for (let z = 0, F = B.length; z < F; z++) { - let N = D(B[z]); + }, z = I(a), P = 6; + for (let B = 0, F = z.length; B < F; B++) { + let N = D(z[B]); N[0][0] -= P, N[0][1] -= P, N[0][2] -= P, N[1][0] += P, N[1][1] += P, N[1][2] += P; - let $ = n.getAtomsWithin(l, N), k = n.getAtomsWithin(g, B[z]); + let $ = s.getAtomsWithin(l, N), k = s.getAtomsWithin(g, z[B]); M.push({ - extent: B[z], + extent: z[B], atoms: T($), toshow: T(k) }); @@ -8262,37 +8262,37 @@ ATOM`, g); * @return {Mesh} */ static generateSurfaceMesh(a, l, g) { - var M = new s.Geometry(!0), L = M.updateGeoGroup(0), T = []; + var M = new n.Geometry(!0), L = M.updateGeoGroup(0), T = []; for (let Me = 0, Te = a.length; Me < Te; Me++) { var D = a[Me]; - D && (typeof D.surfaceColor < "u" ? T[Me] = D.surfaceColor : D.color && (T[Me] = _.CC.color(D.color))); + D && (typeof D.surfaceColor < "u" ? T[Me] = D.surfaceColor : D.color && (T[Me] = u.CC.color(D.color))); } - var R = L.vertexArray, B = l.vertices; - for (let Me = 0, Te = B.length; Me < Te; Me++) { - let ae = L.vertices * 3; - R[ae] = B[Me].x, R[ae + 1] = B[Me].y, R[ae + 2] = B[Me].z, L.vertices++; + var I = L.vertexArray, z = l.vertices; + for (let Me = 0, Te = z.length; Me < Te; Me++) { + let se = L.vertices * 3; + I[se] = z[Me].x, I[se + 1] = z[Me].y, I[se + 2] = z[Me].z, L.vertices++; } var P = L.colorArray; if (g.voldata && g.volscheme) { - var z = g.volscheme, F = g.voldata, N = z.range() || [-1, 1]; - for (let Me = 0, Te = B.length; Me < Te; Me++) { - let ae = F.getVal(B[Me].x, B[Me].y, B[Me].z), pe = _.CC.color(z.valueToHex(ae, N)), we = Me * 3; + var B = g.volscheme, F = g.voldata, N = B.range() || [-1, 1]; + for (let Me = 0, Te = z.length; Me < Te; Me++) { + let se = F.getVal(z[Me].x, z[Me].y, z[Me].z), pe = u.CC.color(B.valueToHex(se, N)), we = Me * 3; P[we] = pe.r, P[we + 1] = pe.g, P[we + 2] = pe.b; } } else if (T.length > 0) - for (let Me = 0, Te = B.length; Me < Te; Me++) { - let ae = B[Me].atomid, pe = Me * 3; - P[pe] = T[ae].r, P[pe + 1] = T[ae].g, P[pe + 2] = T[ae].b; + for (let Me = 0, Te = z.length; Me < Te; Me++) { + let se = z[Me].atomid, pe = Me * 3; + P[pe] = T[se].r, P[pe + 1] = T[se].g, P[pe + 2] = T[se].b; } var $ = l.faces; L.faceidx = $.length, M.initTypedArrays(); var k = L.vertexArray, G = L.normalArray, H, U, V, Q; for (let Me = 0, Te = $.length; Me < Te; Me += 3) { - var oe = $[Me], ee = $[Me + 1], ne = $[Me + 2], me = oe * 3, se = ee * 3, fe = ne * 3; - H = new f.Vector3(k[me], k[me + 1], k[me + 2]), U = new f.Vector3(k[se], k[se + 1], k[se + 2]), V = new f.Vector3(k[fe], k[fe + 1], k[fe + 2]), V.subVectors(V, U), H.subVectors(H, U), V.cross(H), Q = V, Q.normalize(), G[me] += Q.x, G[se] += Q.x, G[fe] += Q.x, G[me + 1] += Q.y, G[se + 1] += Q.y, G[fe + 1] += Q.y, G[me + 2] += Q.z, G[se + 2] += Q.z, G[fe + 2] += Q.z; + var ae = $[Me], oe = $[Me + 1], q = $[Me + 2], me = ae * 3, ne = oe * 3, fe = q * 3; + H = new f.Vector3(k[me], k[me + 1], k[me + 2]), U = new f.Vector3(k[ne], k[ne + 1], k[ne + 2]), V = new f.Vector3(k[fe], k[fe + 1], k[fe + 2]), V.subVectors(V, U), H.subVectors(H, U), V.cross(H), Q = V, Q.normalize(), G[me] += Q.x, G[ne] += Q.x, G[fe] += Q.x, G[me + 1] += Q.y, G[ne + 1] += Q.y, G[fe + 1] += Q.y, G[me + 2] += Q.z, G[ne + 2] += Q.z, G[fe + 2] += Q.z; } L.faceArray = new Uint16Array($); - var Ce = new s.Mesh(M, g); + var Ce = new n.Mesh(M, g); return Ce; } // do same thing as worker in main thread @@ -8322,8 +8322,8 @@ ATOM`, g); * @return {MeshLambertMaterial} */ static getMatWithStyle(a) { - var l = new s.MeshLambertMaterial(); - l.vertexColors = s.Coloring.VertexColors; + var l = new n.MeshLambertMaterial(); + l.vertexColors = n.Coloring.VertexColors; for (var g in a) g === "color" || g === "map" || a.hasOwnProperty(g) && (l[g] = a[g]); return a.opacity !== void 0 && (a.opacity === 1 ? l.transparent = !1 : l.transparent = !0), l; @@ -8353,7 +8353,7 @@ ATOM`, g); var l = []; let g = a.length; for (let M = 0; M < g; M++) - l[M] = (0, x.extend)({}, a[M]); + l[M] = (0, y.extend)({}, a[M]); return l; } /** @@ -8367,10 +8367,10 @@ ATOM`, g); * @return {Promise} promise - Returns a promise that ultimately resovles to the surfid. Returns surfid immediately if surfacecallback is specified. Returned promise has a [surfid, GLViewer, style, atomsel, allsel, focus] fields for immediate access. */ addSurface(a, l = {}, g = {}, M, L, T) { - let D = this.nextSurfID(), R = null, B = this, P = b.SurfaceType.VDW; - typeof a == "string" ? n.surfaceTypeMap[a.toUpperCase()] !== void 0 ? P = n.surfaceTypeMap[a] : console.log("Surface type : " + a + " is not recognized") : typeof a == "number" && (P = a); - var z = null, F = null, N = n.shallowCopy(this.getAtomsFromSel(g)); - M ? z = n.shallowCopy(this.getAtomsFromSel(M)) : z = N, (0, x.adjustVolumeStyle)(l); + let D = this.nextSurfID(), I = null, z = this, P = b.SurfaceType.VDW; + typeof a == "string" ? s.surfaceTypeMap[a.toUpperCase()] !== void 0 ? P = s.surfaceTypeMap[a] : console.log("Surface type : " + a + " is not recognized") : typeof a == "number" && (P = a); + var B = null, F = null, N = s.shallowCopy(this.getAtomsFromSel(g)); + M ? B = s.shallowCopy(this.getAtomsFromSel(M)) : B = N, (0, y.adjustVolumeStyle)(l); var $ = !1, k; for (k = 0; k < this.models.length; k++) if (this.models[k]) { @@ -8380,25 +8380,25 @@ ATOM`, g); break; } } - var H = function(me, se, fe) { - L ? F = n.shallowCopy(B.getAtomsFromSel(L)) : F = fe; - var Ce, Me = (0, x.getExtent)(fe, !0); + var H = function(me, ne, fe) { + L ? F = s.shallowCopy(z.getAtomsFromSel(L)) : F = fe; + var Ce, Me = (0, y.getExtent)(fe, !0); if (l.map && l.map.prop) { var Te = l.map.prop; let Se = (0, h.getGradient)(l.map.scheme || l.map.gradient || new h.Gradient.RWB()), ze = Se.range(); - ze || (ze = (0, x.getPropertyRange)(fe, Te)), l.colorscheme = { prop: Te, gradient: Se }; + ze || (ze = (0, y.getPropertyRange)(fe, Te)), l.colorscheme = { prop: Te, gradient: Se }; } - for (let Se = 0, ze = se.length; Se < ze; Se++) - Ce = se[Se], Ce.surfaceColor = (0, x.getColorFromStyle)(Ce, l); - var ae = n.volume(Me), pe = B.carveUpExtent(Me, se, fe); + for (let Se = 0, ze = ne.length; Se < ze; Se++) + Ce = ne[Se], Ce.surfaceColor = (0, y.getColorFromStyle)(Ce, l); + var se = s.volume(Me), pe = z.carveUpExtent(Me, ne, fe); if (F && F.length && F.length > 0) { - var we = (0, x.getExtent)(F, !0), ke = function(Se, ze) { - var He = function(K, q) { - var de = K.extent, ve = de[1][0] - de[0][0], Ie = de[1][1] - de[0][1], Re = de[1][2] - de[0][2], Z = ve - q[2][0]; + var we = (0, y.getExtent)(F, !0), ke = function(Se, ze) { + var He = function(K, ee) { + var de = K.extent, ve = de[1][0] - de[0][0], Ie = de[1][1] - de[0][1], Re = de[1][2] - de[0][2], Z = ve - ee[2][0]; Z *= Z; - var ce = Ie - q[2][1]; + var ce = Ie - ee[2][1]; ce *= ce; - var Ae = Re - q[2][2]; + var Ae = Re - ee[2][2]; return Ae *= Ae, Z + ce + Ae; }, We = He(Se, we), Y = He(ze, we); return We - Y; @@ -8406,8 +8406,8 @@ ATOM`, g); pe.sort(ke); } var Ue = []; - for (let Se = 0, ze = se.length; Se < ze; Se++) - Ce = se[Se], Ue[Se] = { + for (let Se = 0, ze = ne.length; Se < ze; Se++) + Ce = ne[Se], Ue[Se] = { x: Ce.x, y: Ce.y, z: Ce.z, @@ -8418,15 +8418,15 @@ ATOM`, g); if (Ne) { var Be = function(ze) { return new Promise(function(He) { - for (var We = n.generateMeshSyncHelper(P, pe[ze].extent, pe[ze].atoms, pe[ze].toshow, Ue, ae), Y = (0, c.splitMesh)({ vertexArr: We.vertices, faceArr: We.faces }), K = 0, q = Y.length; K < q; K++) { + for (var We = s.generateMeshSyncHelper(P, pe[ze].extent, pe[ze].atoms, pe[ze].toshow, Ue, se), Y = (0, c.splitMesh)({ vertexArr: We.vertices, faceArr: We.faces }), K = 0, ee = Y.length; K < ee; K++) { We = { vertices: Y[K].vertexArr, faces: Y[K].faceArr }; - var de = n.generateSurfaceMesh(se, We, R); - (0, x.mergeGeos)(me.geo, de); + var de = s.generateSurfaceMesh(ne, We, I); + (0, y.mergeGeos)(me.geo, de); } - B.render(), He(); + z.render(), He(); }); }, ue = []; for (let Se = 0; Se < pe.length; Se++) @@ -8437,12 +8437,12 @@ ATOM`, g); } else { var ye = []; P < 0 && (P = 0); - for (let Se = 0, ze = n.numWorkers; Se < ze; Se++) { + for (let Se = 0, ze = s.numWorkers; Se < ze; Se++) { var ge = new Worker($3Dmol.SurfaceWorker); ye.push(ge), ge.postMessage({ type: -1, atoms: Ue, - volume: ae + volume: se }); } return new Promise(function(Se, ze) { @@ -8458,16 +8458,16 @@ ATOM`, g); var Z = { vertices: ve[Ie].vertexArr, faces: ve[Ie].faceArr - }, ce = n.generateSurfaceMesh(se, Z, R); - (0, x.mergeGeos)(me.geo, ce); + }, ce = s.generateSurfaceMesh(ne, Z, I); + (0, y.mergeGeos)(me.geo, ce); } - B.render(), He++, He == pe.length && (me.done = !0, We(), Se(D)); + z.render(), He++, He == pe.length && (me.done = !0, We(), Se(D)); }, K = function(de) { We(), console.log(de.message + " (" + de.filename + ":" + de.lineno + ")"), ze(de); }; for (let de = 0; de < pe.length; de++) { - var q = ye[de % ye.length]; - q.onmessage = Y, q.onerror = K, q.postMessage({ + var ee = ye[de % ye.length]; + ee.onmessage = Y, ee.onerror = K, ee.postMessage({ type: P, expandedExtent: pe[de].extent, extendedAtoms: pe[de].atoms, @@ -8477,39 +8477,39 @@ ATOM`, g); }); } }; - l = l || {}, R = n.getMatWithStyle(l); + l = l || {}, I = s.getMatWithStyle(l); var U = []; U.style = l, U.atomsel = g, U.allsel = M, U.focus = L; var V = null; if ($) { - var Q = {}, oe = {}; + var Q = {}, ae = {}; for (k = 0; k < this.models.length; k++) - Q[k] = [], oe[k] = []; - for (k = 0; k < z.length; k++) - Q[z[k].model].push(z[k]); + Q[k] = [], ae[k] = []; + for (k = 0; k < B.length; k++) + Q[B[k].model].push(B[k]); for (k = 0; k < N.length; k++) - oe[N[k].model].push(N[k]); - var ee = []; + ae[N[k].model].push(N[k]); + var oe = []; for (k = 0; k < this.models.length; k++) - oe[k].length > 0 && (U.push({ - geo: new s.Geometry(!0), - mat: R, + ae[k].length > 0 && (U.push({ + geo: new n.Geometry(!0), + mat: I, done: !1, finished: !1, symmetries: this.models[k].getSymmetries() // also webgl initialized - }), ee.push(H(U[U.length - 1], Q[k], oe[k]))); - V = Promise.all(ee); + }), oe.push(H(U[U.length - 1], Q[k], ae[k]))); + V = Promise.all(oe); } else U.push({ - geo: new s.Geometry(!0), - mat: R, + geo: new n.Geometry(!0), + mat: I, done: !1, finished: !1, symmetries: [new f.Matrix4()] - }), V = H(U[U.length - 1], z, N); - return this.surfaces[D] = U, V.surfid = D, T && typeof T == "function" ? (V.then(function(ne) { - T(ne); + }), V = H(U[U.length - 1], B, N); + return this.surfaces[D] = U, V.surfid = D, T && typeof T == "function" ? (V.then(function(q) { + T(q); }), D) : V; } /** @@ -8528,22 +8528,22 @@ ATOM`, g); }); */ setSurfaceMaterialStyle(a, l) { - if ((0, x.adjustVolumeStyle)(l), this.surfaces[a]) { + if ((0, y.adjustVolumeStyle)(l), this.surfaces[a]) { var g = this.surfaces[a]; g.style = l; for (var M = 0; M < g.length; M++) { - var L = g[M].mat = n.getMatWithStyle(l); - if (g[M].mat.side = s.FrontSide, l.color) { + var L = g[M].mat = s.getMatWithStyle(l); + if (g[M].mat.side = n.FrontSide, l.color) { g[M].mat.color = l.color, g[M].geo.colorsNeedUpdate = !0; - const T = _.CC.color(l.color); + const T = u.CC.color(l.color); g[M].geo.setColors(function() { return T; }); } else if (L.voldata && L.volscheme) { - const T = L.volscheme, D = L.voldata, R = _.CC, B = T.range() || [-1, 1]; - g[M].geo.setColors(function(P, z, F) { - let N = D.getVal(P, z, F); - return R.color(T.valueToHex(N, B)); + const T = L.volscheme, D = L.voldata, I = u.CC, z = T.range() || [-1, 1]; + g[M].geo.setColors(function(P, B, F) { + let N = D.getVal(P, B, F); + return I.color(T.valueToHex(N, z)); }); } g[M].finished = !1; @@ -8613,14 +8613,14 @@ ATOM`, g); var g = this.getAtomsFromSel(l); if (typeof a == "function") for (let T = 0, D = g.length; T < D; T++) { - let R = g[T]; - a(R); + let I = g[T]; + a(I); } else for (let T = 0, D = g.length; T < D; T++) { var M = g[T]; - for (let R = 0, B = a.length; R < B; R++) { - let P = a[R]; + for (let I = 0, z = a.length; I < z; I++) { + let P = a[I]; if (P.props) for (var L in P.props) P.props.hasOwnProperty(L) && this.atomIsSelected(M, P) && (M.properties || (M.properties = {}), M.properties[L] = P.props[L]); @@ -8668,17 +8668,17 @@ ATOM`, g); this.config.cartoonQuality = a; } } - n.numWorkers = 4, n.maxVolume = 64e3, n.surfaceTypeMap = { + s.numWorkers = 4, s.maxVolume = 64e3, s.surfaceTypeMap = { VDW: b.SurfaceType.VDW, MS: b.SurfaceType.MS, SAS: b.SurfaceType.SAS, SES: b.SurfaceType.SES }; function o(v, a) { - if (v = (0, x.getElement)(v), !!v) { + if (v = (0, y.getElement)(v), !!v) { a = a || {}; try { - var l = new n(v, a); + var l = new s(v, a); return l; } catch (g) { throw "error creating viewer: " + g; @@ -8686,27 +8686,27 @@ ATOM`, g); } } function w(v, a = {}, l = {}) { - if (v = (0, x.getElement)(v), !!v) { + if (v = (0, y.getElement)(v), !!v) { var g = [], M = document.createElement("canvas"); l.rows = a.rows, l.cols = a.cols, l.control_all = a.control_all != null ? a.control_all : !1, v.appendChild(M); try { for (var L = 0; L < a.rows; L++) { for (var T = [], D = 0; D < a.cols; D++) { l.row = L, l.col = D, l.canvas = M, l.viewers = g, l.control_all = a.control_all; - var R = o(v, (0, x.extend)({}, l)); - T.push(R); + var I = o(v, (0, y.extend)({}, l)); + T.push(I); } g.unshift(T); } - } catch (B) { - throw "error creating viewer grid: " + B; + } catch (z) { + throw "error creating viewer grid: " + z; } return g; } } function p(v) { var a = this; - if (v = (0, x.getElement)(v), !!v) { + if (v = (0, y.getElement)(v), !!v) { var l = w(v, { rows: 1, cols: 2, control_all: !0 }); this.glviewer1 = l[0][0], this.glviewer2 = l[0][1], this.glviewer1.setAutoEyeSeparation(!1), this.glviewer2.setAutoEyeSeparation(!0), this.glviewer1.linkViewer(this.glviewer2), this.glviewer2.linkViewer(this.glviewer1); for (var g = Object.getOwnPropertyNames(this.glviewer1.__proto__).filter(function(L) { @@ -8719,8 +8719,8 @@ ATOM`, g); }; }(g[M]); this.setCoordinates = function(L, T, D) { - for (var R = 0; R < L.length; R++) - L[R].setCoordinates(T, D); + for (var I = 0; I < L.length; I++) + L[I].setCoordinates(T, D); }, this.surfacesFinished = function() { return this.glviewer1.surfacesFinished() && this.glviewer2.surfacesFinished(); }, this.isAnimated = function() { @@ -8760,7 +8760,7 @@ ATOM`, g); /* harmony export */ ROYGB: () => ( /* binding */ - u + _ ), /* harmony export */ RWB: () => ( @@ -8780,64 +8780,64 @@ ATOM`, g); /* harmony export */ getGradient: () => ( /* binding */ - x + y ), /* harmony export */ normalizeValue: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ./colors */ "./src/colors.ts" ); class f { } - function _(A, S, n) { - return S >= A ? (n < A && (n = A), n > S && (n = S), { lo: A, hi: S, val: n }) : (n > A && (n = A), n < S && (n = S), n = A - n + S, { lo: S, hi: A, val: n }); + function u(A, S, s) { + return S >= A ? (s < A && (s = A), s > S && (s = S), { lo: A, hi: S, val: s }) : (s > A && (s = A), s < S && (s = S), s = A - s + S, { lo: S, hi: A, val: s }); } - function x(A) { + function y(A) { if (A instanceof f) return A; if (A.gradient !== void 0 && C[A.gradient]) { - let S = A.min === void 0 ? -1 : A.min, n = A.max === void 0 ? 1 : A.max; - return A.mid === void 0 ? A.colors === void 0 ? new C[A.gradient](S, n) : new C[A.gradient](S, n, A.colors) : new C[A.gradient](S, n, A.mid); + let S = A.min === void 0 ? -1 : A.min, s = A.max === void 0 ? 1 : A.max; + return A.mid === void 0 ? A.colors === void 0 ? new C[A.gradient](S, s) : new C[A.gradient](S, s, A.colors) : new C[A.gradient](S, s, A.mid); } return A; } class h extends f { - constructor(S, n, o) { - super(), this.gradient = "RWB", this.mult = 1, this.mid = o, this.min = S, this.max = n, typeof n > "u" && Array.isArray(S) && S.length >= 2 ? (this.max = S[1], this.min = S[0]) : S && n && !Array.isArray(S) && (this.min = S, this.max = n); + constructor(S, s, o) { + super(), this.gradient = "RWB", this.mult = 1, this.mid = o, this.min = S, this.max = s, typeof s > "u" && Array.isArray(S) && S.length >= 2 ? (this.max = S[1], this.min = S[0]) : S && s && !Array.isArray(S) && (this.min = S, this.max = s); } //return range used for color mapping, null if none set range() { return typeof this.min < "u" && typeof this.max < "u" ? [this.min, this.max] : null; } //map value to hex color, range is provided - valueToHex(S, n) { + valueToHex(S, s) { var o, w; - if (S = this.mult * S, n ? (o = n[0], w = n[1]) : (o = this.min, w = this.max), S === void 0) + if (S = this.mult * S, s ? (o = s[0], w = s[1]) : (o = this.min, w = this.max), S === void 0) return 16777215; - var p = _(o, w, S); + var p = u(o, w, S); o = p.lo, w = p.hi, S = p.val; var v = (w + o) / 2; - n && typeof n[2] < "u" ? v = n[2] : typeof this.mid < "u" ? v = this.mid : v = (o + w) / 2; + s && typeof s[2] < "u" ? v = s[2] : typeof this.mid < "u" ? v = this.mid : v = (o + w) / 2; var a, l; return S < v ? (a = Math.floor(255 * Math.sqrt((S - o) / (v - o))), l = 16711680 + 256 * a + a, l) : S > v ? (a = Math.floor(255 * Math.sqrt(1 - (S - v) / (w - v))), l = 65536 * a + 256 * a + 255, l) : 16777215; } } - class u extends f { - constructor(S, n) { - super(), this.gradient = "ROYGB", this.mult = 1, this.min = S, this.max = n, typeof n > "u" && Array.isArray(S) && S.length >= 2 ? (this.max = S[1], this.min = S[0]) : S && n && !Array.isArray(S) && (this.min = S, this.max = n); + class _ extends f { + constructor(S, s) { + super(), this.gradient = "ROYGB", this.mult = 1, this.min = S, this.max = s, typeof s > "u" && Array.isArray(S) && S.length >= 2 ? (this.max = S[1], this.min = S[0]) : S && s && !Array.isArray(S) && (this.min = S, this.max = s); } //map value to hex color, range is provided - valueToHex(S, n) { + valueToHex(S, s) { var o, w; - if (S = this.mult * S, n ? (o = n[0], w = n[1]) : (o = this.min, w = this.max), typeof S > "u") + if (S = this.mult * S, s ? (o = s[0], w = s[1]) : (o = this.min, w = this.max), typeof S > "u") return 16777215; - var p = _(o, w, S); + var p = u(o, w, S); o = p.lo, w = p.hi, S = p.val; var v = (o + w) / 2, a = (o + v) / 2, l = (v + w) / 2, g, M; return S < a ? (g = Math.floor(255 * Math.sqrt((S - o) / (a - o))), M = 16711680 + 256 * g + 0, M) : S < v ? (g = Math.floor(255 * Math.sqrt(1 - (S - a) / (v - a))), M = 65536 * g + 65280 + 0, M) : S < l ? (g = Math.floor(255 * Math.sqrt((S - v) / (l - v))), M = 65280 + 1 * g, M) : (g = Math.floor(255 * Math.sqrt(1 - (S - l) / (w - l))), M = 0 + 256 * g + 255, M); @@ -8848,13 +8848,13 @@ ATOM`, g); } } class E extends f { - constructor(S, n) { - super(), this.gradient = "Sinebow", this.mult = 1, this.min = S, this.max = n, typeof n > "u" && Array.isArray(S) && S.length >= 2 && (this.max = S[1], this.min = S[0]), n < S && (this.mult = -1, this.min *= -1, this.max *= -1); + constructor(S, s) { + super(), this.gradient = "Sinebow", this.mult = 1, this.min = S, this.max = s, typeof s > "u" && Array.isArray(S) && S.length >= 2 && (this.max = S[1], this.min = S[0]), s < S && (this.mult = -1, this.min *= -1, this.max *= -1); } //map value to hex color, range is provided - valueToHex(S, n) { + valueToHex(S, s) { var o, w; - if (S = this.mult * S, n ? (o = n[0], w = n[1]) : (o = this.min, w = this.max), typeof S > "u") + if (S = this.mult * S, s ? (o = s[0], w = s[1]) : (o = this.min, w = this.max), typeof S > "u") return 16777215; var p = b.normalizeValue(o, w, S); o = p.lo, w = p.hi, S = p.val; @@ -8871,47 +8871,47 @@ ATOM`, g); } } class c extends f { - constructor(S, n, o) { + constructor(S, s, o) { super(), this.gradient = "linear", this.colors = new Array(); var w; - if (Array.isArray(S) && S.length >= 2 ? (this.max = S[1], this.min = S[0], w = n) : (this.min = S, this.max = n, w = o), w) + if (Array.isArray(S) && S.length >= 2 ? (this.max = S[1], this.min = S[0], w = s) : (this.min = S, this.max = s, w = o), w) for (let p of w) - this.colors.push(s.CC.color(p)); + this.colors.push(n.CC.color(p)); else - this.colors.push(s.CC.color(0)); + this.colors.push(n.CC.color(0)); } //return range used for color mapping, null if none set range() { return typeof this.min < "u" && typeof this.max < "u" ? [this.min, this.max] : null; } //map value to hex color, range is provided - valueToHex(S, n) { + valueToHex(S, s) { var o, w; - if (n ? (o = n[0], w = n[1]) : (o = this.min, w = this.max), S === void 0) + if (s ? (o = s[0], w = s[1]) : (o = this.min, w = this.max), S === void 0) return 16777215; - var p = _(o, w, S); + var p = u(o, w, S); o = p.lo, w = p.hi, S = p.val; let v = this.colors.length, a = (w - o) / v, l = Math.min(Math.floor((S - o) / a), v - 1), g = Math.min(l + 1, v - 1), M = (S - o - l * a) / a, L = this.colors[l], T = this.colors[g]; - return new s.Color(L.r + M * (T.r - L.r), L.g + M * (T.g - L.g), L.b + M * (T.b - L.b)).getHex(); + return new n.Color(L.r + M * (T.r - L.r), L.g + M * (T.g - L.g), L.b + M * (T.b - L.b)).getHex(); } } const C = { rwb: h, RWB: h, - roygb: u, - ROYGB: u, + roygb: _, + ROYGB: _, sinebow: E, linear: c }; class b extends f { - valueToHex(S, n) { + valueToHex(S, s) { return 0; } range() { return null; } } - b.RWB = h, b.ROYGB = u, b.Sinebow = E, b.CustomLinear = c, b.builtinGradients = C, b.normalizeValue = _, b.getGradient = x; + b.RWB = h, b.ROYGB = _, b.Sinebow = E, b.CustomLinear = c, b.builtinGradients = C, b.normalizeValue = u, b.getGradient = y; } ), /***/ @@ -8930,31 +8930,31 @@ ATOM`, g); /* harmony export */ LabelCount: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./WebGL */ "./src/WebGL/index.ts" ), f = t( /*! ./Gradient */ "./src/Gradient.ts" - ), _ = t( + ), u = t( /*! ./colors */ "./src/colors.ts" ); - let x = 0; - function h(c, C, b, A, S, n, o) { - c.beginPath(), c.moveTo(C + n, b), c.lineTo(C + A - n, b), c.quadraticCurveTo(C + A, b, C + A, b + n), c.lineTo(C + A, b + S - n), c.quadraticCurveTo(C + A, b + S, C + A - n, b + S), c.lineTo(C + n, b + S), c.quadraticCurveTo(C, b + S, C, b + S - n), c.lineTo(C, b + n), c.quadraticCurveTo(C, b, C + n, b), c.closePath(), c.fill(), o && c.stroke(); + let y = 0; + function h(c, C, b, A, S, s, o) { + c.beginPath(), c.moveTo(C + s, b), c.lineTo(C + A - s, b), c.quadraticCurveTo(C + A, b, C + A, b + s), c.lineTo(C + A, b + S - s), c.quadraticCurveTo(C + A, b + S, C + A - s, b + S), c.lineTo(C + s, b + S), c.quadraticCurveTo(C, b + S, C, b + S - s), c.lineTo(C, b + s), c.quadraticCurveTo(C, b, C + s, b), c.closePath(), c.fill(), o && c.stroke(); } - function u(c, C, b) { + function _(c, C, b) { var A = b; - return typeof c < "u" && (c instanceof _.Color ? A = c.scaled() : (A = _.CC.color(c), typeof A.scaled < "u" && (A = A.scaled()))), typeof C < "u" && (A.a = parseFloat(C)), A; + return typeof c < "u" && (c instanceof u.Color ? A = c.scaled() : (A = u.CC.color(c), typeof A.scaled < "u" && (A = A.scaled()))), typeof C < "u" && (A.a = parseFloat(C)), A; } class E { constructor(C, b) { - this.id = x++, this.stylespec = b || {}, this.canvas = document.createElement("canvas"), this.canvas.width = 134, this.canvas.height = 35, this.context = this.canvas.getContext("2d"), this.sprite = new s.Sprite(), this.text = C, this.frame = this.stylespec.frame; + this.id = y++, this.stylespec = b || {}, this.canvas = document.createElement("canvas"), this.canvas.width = 134, this.canvas.height = 35, this.context = this.canvas.getContext("2d"), this.sprite = new n.Sprite(), this.text = C, this.frame = this.stylespec.frame; } getStyle() { return this.stylespec; @@ -8962,46 +8962,46 @@ ATOM`, g); setContext() { var C = this.stylespec, b = typeof C.useScreen > "u" ? !1 : C.useScreen, A = C.showBackground; (A === "0" || A === "false") && (A = !1), typeof A > "u" && (A = !0); - var S = C.font ? C.font : "sans-serif", n = parseInt(C.fontSize) ? parseInt(C.fontSize) : 18, o = u(C.fontColor, C.fontOpacity, { + var S = C.font ? C.font : "sans-serif", s = parseInt(C.fontSize) ? parseInt(C.fontSize) : 18, o = _(C.fontColor, C.fontOpacity, { r: 255, g: 255, b: 255, a: 1 - }), w = C.padding ? C.padding : 4, p = C.borderThickness ? C.borderThickness : 0, v = u(C.backgroundColor, C.backgroundOpacity, { + }), w = C.padding ? C.padding : 4, p = C.borderThickness ? C.borderThickness : 0, v = _(C.backgroundColor, C.backgroundOpacity, { r: 0, g: 0, b: 0, a: 1 - }), a = u(C.borderColor, C.borderOpacity, v), l = C.position ? C.position : { + }), a = _(C.borderColor, C.borderOpacity, v), l = C.position ? C.position : { x: -10, y: 1, z: 1 }, g = C.inFront !== void 0 ? C.inFront : !0; (g === "false" || g === "0") && (g = !1); - var M = C.alignment || s.SpriteAlignment.topLeft; - typeof M == "string" && M in s.SpriteAlignment && (M = s.SpriteAlignment[M]); + var M = C.alignment || n.SpriteAlignment.topLeft; + typeof M == "string" && M in n.SpriteAlignment && (M = n.SpriteAlignment[M]); var L = ""; - C.bold && (L = "bold "), this.context.font = L + n + "px " + S; + C.bold && (L = "bold "), this.context.font = L + s + "px " + S; var T = this.context.measureText(this.text), D = T.width; A || (p = 0); - var R = D + 2.5 * p + 2 * w, B = n * 1.25 + 2 * p + 2 * w; + var I = D + 2.5 * p + 2 * w, z = s * 1.25 + 2 * p + 2 * w; if (C.backgroundImage) { - var P = C.backgroundImage, z = C.backgroundWidth ? C.backgroundWidth : P.width, F = C.backgroundHeight ? C.backgroundHeight : P.height; - z > R && (R = z), F > B && (B = F); + var P = C.backgroundImage, B = C.backgroundWidth ? C.backgroundWidth : P.width, F = C.backgroundHeight ? C.backgroundHeight : P.height; + B > I && (I = B), F > z && (z = F); } - if (this.canvas.width = R, this.canvas.height = B, this.context.clearRect(0, 0, this.canvas.width, this.canvas.height), L = "", C.bold && (L = "bold "), this.context.font = L + n + "px " + S, this.context.fillStyle = "rgba(" + v.r + "," + v.g + "," + v.b + "," + v.a + ")", this.context.strokeStyle = "rgba(" + a.r + "," + a.g + "," + a.b + "," + a.a + ")", C.backgroundGradient) { - let $ = this.context.createLinearGradient(0, B / 2, R, B / 2), k = f.Gradient.getGradient(C.backgroundGradient), G = k.range(), H = -1, U = 1; + if (this.canvas.width = I, this.canvas.height = z, this.context.clearRect(0, 0, this.canvas.width, this.canvas.height), L = "", C.bold && (L = "bold "), this.context.font = L + s + "px " + S, this.context.fillStyle = "rgba(" + v.r + "," + v.g + "," + v.b + "," + v.a + ")", this.context.strokeStyle = "rgba(" + a.r + "," + a.g + "," + a.b + "," + a.a + ")", C.backgroundGradient) { + let $ = this.context.createLinearGradient(0, z / 2, I, z / 2), k = f.Gradient.getGradient(C.backgroundGradient), G = k.range(), H = -1, U = 1; G && (H = G[0], U = G[1]); let V = U - H; for (let Q = 0; Q < 1.01; Q += 0.1) { - let oe = u(k.valueToHex(H + V * Q)), ee = "rgba(" + oe.r + "," + oe.g + "," + oe.b + "," + oe.a + ")"; - $.addColorStop(Q, ee); + let ae = _(k.valueToHex(H + V * Q)), oe = "rgba(" + ae.r + "," + ae.g + "," + ae.b + "," + ae.a + ")"; + $.addColorStop(Q, oe); } this.context.fillStyle = $; } - this.context.lineWidth = p, A && h(this.context, p, p, R - 2 * p, B - 2 * p, 6, p > 0), C.backgroundImage && this.context.drawImage(P, 0, 0, R, B), this.context.fillStyle = "rgba(" + o.r + "," + o.g + "," + o.b + "," + o.a + ")", this.context.fillText(this.text, p + w, n + p + w, D); - var N = new s.Texture(this.canvas); - N.needsUpdate = !0, this.sprite.material = new s.SpriteMaterial({ + this.context.lineWidth = p, A && h(this.context, p, p, I - 2 * p, z - 2 * p, 6, p > 0), C.backgroundImage && this.context.drawImage(P, 0, 0, I, z), this.context.fillStyle = "rgba(" + o.r + "," + o.g + "," + o.b + "," + o.a + ")", this.context.fillText(this.text, p + w, s + p + w, D); + var N = new n.Texture(this.canvas); + N.needsUpdate = !0, this.sprite.material = new n.SpriteMaterial({ map: N, useScreenCoordinates: b, alignment: M, @@ -9027,7 +9027,7 @@ ATOM`, g); /* harmony export */ MarchingCube: () => ( /* binding */ - u + _ ), /* harmony export */ MarchingCubeInitializer: () => ( @@ -9052,27 +9052,27 @@ ATOM`, g); /* harmony export */ setSyncSurface: () => ( /* binding */ - x + y ), /* harmony export */ syncSurface: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" ), f; (function(C) { C[C.VDW = 1] = "VDW", C[C.MS = 2] = "MS", C[C.SAS = 3] = "SAS", C[C.SES = 4] = "SES"; })(f || (f = {})); - var _ = !1; - function x(C) { - _ = C; + var u = !1; + function y(C) { + u = C; } - (window.navigator.userAgent.indexOf("MSIE ") >= 0 || window.navigator.userAgent.indexOf("Trident/") >= 0) && (_ = !0); + (window.navigator.userAgent.indexOf("MSIE ") >= 0 || window.navigator.userAgent.indexOf("Trident/") >= 0) && (u = !0); class h { constructor() { this.ISDONE = 2, this.edgeTable = new Uint32Array([ @@ -10105,22 +10105,22 @@ ATOM`, g); [] ]; } - march(b, A, S, n) { - let o = !!n.fulltable, w = n.hasOwnProperty("origin") && n.origin.hasOwnProperty("x") ? n.origin : { x: 0, y: 0, z: 0 }, p = !!n.voxel, v = n.matrix, a = n.nX || 0, l = n.nY || 0, g = n.nZ || 0, M = n.scale || 1, L = null; - n.unitCube ? L = n.unitCube : L = { x: M, y: M, z: M }; - let T = new Int32Array(a * l * g), D, R; - for (D = 0, R = T.length; D < R; ++D) + march(b, A, S, s) { + let o = !!s.fulltable, w = s.hasOwnProperty("origin") && s.origin.hasOwnProperty("x") ? s.origin : { x: 0, y: 0, z: 0 }, p = !!s.voxel, v = s.matrix, a = s.nX || 0, l = s.nY || 0, g = s.nZ || 0, M = s.scale || 1, L = null; + s.unitCube ? L = s.unitCube : L = { x: M, y: M, z: M }; + let T = new Int32Array(a * l * g), D, I; + for (D = 0, I = T.length; D < I; ++D) T[D] = -1; - let B = function(N, $, k, G, H, U) { - let V = { x: 0, y: 0, z: 0 }, Q = !!(G & 1 << H), oe = !!(G & 1 << U), ee = H; - if (!Q && oe && (ee = U), ee & 1 && k++, ee & 2 && $++, ee & 4 && N++, v) { - let me = new s.Vector3(N, $, k); + let z = function(N, $, k, G, H, U) { + let V = { x: 0, y: 0, z: 0 }, Q = !!(G & 1 << H), ae = !!(G & 1 << U), oe = H; + if (!Q && ae && (oe = U), oe & 1 && k++, oe & 2 && $++, oe & 4 && N++, v) { + let me = new n.Vector3(N, $, k); me = me.applyMatrix4(v), V = { x: me.x, y: me.y, z: me.z }; } else V.x = w.x + L.x * N, V.y = w.y + L.y * $, V.z = w.z + L.z * k; - let ne = (l * N + $) * g + k; - return p ? (A.push(V), A.length - 1) : (T[ne] < 0 && (T[ne] = A.length, A.push(V)), T[ne]); - }, P = new Int32Array(12), z = o ? this.edgeTable2 : this.edgeTable, F = o ? this.triTable2 : this.triTable; + let q = (l * N + $) * g + k; + return p ? (A.push(V), A.length - 1) : (T[q] < 0 && (T[q] = A.length, A.push(V)), T[q]); + }, P = new Int32Array(12), B = o ? this.edgeTable2 : this.edgeTable, F = o ? this.triTable2 : this.triTable; for (D = 0; D < a - 1; ++D) for (let N = 0; N < l - 1; ++N) for (let $ = 0; $ < g - 1; ++$) { @@ -10131,21 +10131,21 @@ ATOM`, g); } if (k === 0 || k === 255) continue; - let G = z[k]; + let G = B[k]; if (G === 0) continue; let H = F[k]; - G & 1 && (P[0] = B(D, N, $, k, 0, 1)), G & 2 && (P[1] = B(D, N, $, k, 1, 3)), G & 4 && (P[2] = B(D, N, $, k, 3, 2)), G & 8 && (P[3] = B(D, N, $, k, 2, 0)), G & 16 && (P[4] = B(D, N, $, k, 4, 5)), G & 32 && (P[5] = B(D, N, $, k, 5, 7)), G & 64 && (P[6] = B(D, N, $, k, 7, 6)), G & 128 && (P[7] = B(D, N, $, k, 6, 4)), G & 256 && (P[8] = B(D, N, $, k, 0, 4)), G & 512 && (P[9] = B(D, N, $, k, 1, 5)), G & 1024 && (P[10] = B(D, N, $, k, 3, 7)), G & 2048 && (P[11] = B(D, N, $, k, 2, 6)); + G & 1 && (P[0] = z(D, N, $, k, 0, 1)), G & 2 && (P[1] = z(D, N, $, k, 1, 3)), G & 4 && (P[2] = z(D, N, $, k, 3, 2)), G & 8 && (P[3] = z(D, N, $, k, 2, 0)), G & 16 && (P[4] = z(D, N, $, k, 4, 5)), G & 32 && (P[5] = z(D, N, $, k, 5, 7)), G & 64 && (P[6] = z(D, N, $, k, 7, 6)), G & 128 && (P[7] = z(D, N, $, k, 6, 4)), G & 256 && (P[8] = z(D, N, $, k, 0, 4)), G & 512 && (P[9] = z(D, N, $, k, 1, 5)), G & 1024 && (P[10] = z(D, N, $, k, 3, 7)), G & 2048 && (P[11] = z(D, N, $, k, 2, 6)); for (let U = 0; U < H.length; U += 3) { - let V = P[H[U]], Q = P[H[U + 1]], oe = P[H[U + 2]]; - p && U >= 3 && (A.push(A[V]), V = A.length - 1, A.push(A[Q]), Q = A.length - 1, A.push(A[oe]), oe = A.length - 1), S.push(V), S.push(Q), S.push(oe); + let V = P[H[U]], Q = P[H[U + 1]], ae = P[H[U + 2]]; + p && U >= 3 && (A.push(A[V]), V = A.length - 1, A.push(A[Q]), Q = A.length - 1, A.push(A[ae]), ae = A.length - 1), S.push(V), S.push(Q), S.push(ae); } } } laplacianSmooth(b, A, S) { - let n = new Array(A.length), o, w, p, v, a; + let s = new Array(A.length), o, w, p, v, a; for (o = 0, w = A.length; o < w; o++) - n[o] = { + s[o] = { x: 0, y: 0, z: 0 @@ -10156,75 +10156,75 @@ ATOM`, g); for (o = 0, w = A.length; o < w; o++) l[0][o] = 0; for (o = 0, w = S.length / 3; o < w; o++) { - let T = o * 3, D = o * 3 + 1, R = o * 3 + 2; + let T = o * 3, D = o * 3 + 1, I = o * 3 + 2; for (g = !0, p = 0, v = l[0][S[T]]; p < v; p++) if (S[D] == l[p + 1][S[T]]) { g = !1; break; } for (g && (l[0][S[T]]++, l[l[0][S[T]]][S[T]] = S[D]), g = !0, p = 0, v = l[0][S[T]]; p < v; p++) - if (S[R] == l[p + 1][S[T]]) { + if (S[I] == l[p + 1][S[T]]) { g = !1; break; } - for (g && (l[0][S[T]]++, l[l[0][S[T]]][S[T]] = S[R]), g = !0, p = 0, v = l[0][S[D]]; p < v; p++) + for (g && (l[0][S[T]]++, l[l[0][S[T]]][S[T]] = S[I]), g = !0, p = 0, v = l[0][S[D]]; p < v; p++) if (S[T] == l[p + 1][S[D]]) { g = !1; break; } for (g && (l[0][S[D]]++, l[l[0][S[D]]][S[D]] = S[T]), g = !0, p = 0, v = l[0][S[D]]; p < v; p++) - if (S[R] == l[p + 1][S[D]]) { + if (S[I] == l[p + 1][S[D]]) { g = !1; break; } - for (g && (l[0][S[D]]++, l[l[0][S[D]]][S[D]] = S[R]), g = !0, p = 0; p < l[0][S[R]]; p++) - if (S[T] == l[p + 1][S[R]]) { + for (g && (l[0][S[D]]++, l[l[0][S[D]]][S[D]] = S[I]), g = !0, p = 0; p < l[0][S[I]]; p++) + if (S[T] == l[p + 1][S[I]]) { g = !1; break; } - for (g && (l[0][S[R]]++, l[l[0][S[R]]][S[R]] = S[T]), g = !0, p = 0, v = l[0][S[R]]; p < v; p++) - if (S[D] == l[p + 1][S[R]]) { + for (g && (l[0][S[I]]++, l[l[0][S[I]]][S[I]] = S[T]), g = !0, p = 0, v = l[0][S[I]]; p < v; p++) + if (S[D] == l[p + 1][S[I]]) { g = !1; break; } - g && (l[0][S[R]]++, l[l[0][S[R]]][S[R]] = S[D]); + g && (l[0][S[I]]++, l[l[0][S[I]]][S[I]] = S[D]); } let M = 1, L = 0.5; for (a = 0; a < b; a++) { for (o = 0, w = A.length; o < w; o++) if (l[0][o] < 3) - n[o].x = A[o].x, n[o].y = A[o].y, n[o].z = A[o].z; + s[o].x = A[o].x, s[o].y = A[o].y, s[o].z = A[o].z; else if (l[0][o] == 3 || l[0][o] == 4) { - for (n[o].x = 0, n[o].y = 0, n[o].z = 0, p = 0, v = l[0][o]; p < v; p++) - n[o].x += A[l[p + 1][o]].x, n[o].y += A[l[p + 1][o]].y, n[o].z += A[l[p + 1][o]].z; - n[o].x += L * A[o].x, n[o].y += L * A[o].y, n[o].z += L * A[o].z, n[o].x /= L + l[0][o], n[o].y /= L + l[0][o], n[o].z /= L + l[0][o]; + for (s[o].x = 0, s[o].y = 0, s[o].z = 0, p = 0, v = l[0][o]; p < v; p++) + s[o].x += A[l[p + 1][o]].x, s[o].y += A[l[p + 1][o]].y, s[o].z += A[l[p + 1][o]].z; + s[o].x += L * A[o].x, s[o].y += L * A[o].y, s[o].z += L * A[o].z, s[o].x /= L + l[0][o], s[o].y /= L + l[0][o], s[o].z /= L + l[0][o]; } else { - for (n[o].x = 0, n[o].y = 0, n[o].z = 0, p = 0, v = l[0][o]; p < v; p++) - n[o].x += A[l[p + 1][o]].x, n[o].y += A[l[p + 1][o]].y, n[o].z += A[l[p + 1][o]].z; - n[o].x += M * A[o].x, n[o].y += M * A[o].y, n[o].z += M * A[o].z, n[o].x /= M + l[0][o], n[o].y /= M + l[0][o], n[o].z /= M + l[0][o]; + for (s[o].x = 0, s[o].y = 0, s[o].z = 0, p = 0, v = l[0][o]; p < v; p++) + s[o].x += A[l[p + 1][o]].x, s[o].y += A[l[p + 1][o]].y, s[o].z += A[l[p + 1][o]].z; + s[o].x += M * A[o].x, s[o].y += M * A[o].y, s[o].z += M * A[o].z, s[o].x /= M + l[0][o], s[o].y /= M + l[0][o], s[o].z /= M + l[0][o]; } for (o = 0, w = A.length; o < w; o++) - A[o].x = n[o].x, A[o].y = n[o].y, A[o].z = n[o].z; + A[o].x = s[o].x, A[o].y = s[o].y, A[o].z = s[o].z; } } } - let u = new h(); + let _ = new h(); class E { constructor(b, A, S) { this.data = new Int32Array(b * A * S * 3), this.width = A, this.height = S; } // set position x,y,z to pt, which has ix,iy,and iz - set(b, A, S, n) { + set(b, A, S, s) { let o = ((b * this.width + A) * this.height + S) * 3; - this.data[o] = n.ix, this.data[o + 1] = n.iy, this.data[o + 2] = n.iz; + this.data[o] = s.ix, this.data[o + 1] = s.iy, this.data[o + 2] = s.iz; } // return point at x,y,z get(b, A, S) { - let n = ((b * this.width + A) * this.height + S) * 3; + let s = ((b * this.width + A) * this.height + S) * 3; return { - ix: this.data[n], - iy: this.data[n + 1], - iz: this.data[n + 2] + ix: this.data[s], + iy: this.data[s + 1], + iz: this.data[s + 2] }; } } @@ -10287,26 +10287,26 @@ ATOM`, g); let S = this.verts; for (let o = 0, w = S.length; o < w; o++) S[o].x = S[o].x / this.scaleFactor - this.ptranx, S[o].y = S[o].y / this.scaleFactor - this.ptrany, S[o].z = S[o].z / this.scaleFactor - this.ptranz; - let n = []; + let s = []; for (let o = 0, w = this.faces.length; o < w; o += 3) { let p = this.faces[o], v = this.faces[o + 1], a = this.faces[o + 2], l = S[p].atomid, g = S[v].atomid, M = S[a].atomid, L = l; - g < L && (L = g), M < L && (L = M), A[L] && p !== v && v !== a && p !== a && (n.push(p), n.push(v), n.push(a)); + g < L && (L = g), M < L && (L = M), A[L] && p !== v && v !== a && p !== a && (s.push(p), s.push(v), s.push(a)); } return this.vpBits = null, this.vpDistance = null, this.vpAtomID = null, { vertices: S, - faces: n + faces: s }; } initparm(b, A, S) { S > 1e6 && (this.scaleFactor = this.defaultScaleFactor / 2); - let n = 1 / this.scaleFactor * 5.5; - this.pminx = b[0][0], this.pmaxx = b[1][0], this.pminy = b[0][1], this.pmaxy = b[1][1], this.pminz = b[0][2], this.pmaxz = b[1][2], A ? (this.pminx -= this.probeRadius + n, this.pminy -= this.probeRadius + n, this.pminz -= this.probeRadius + n, this.pmaxx += this.probeRadius + n, this.pmaxy += this.probeRadius + n, this.pmaxz += this.probeRadius + n) : (this.pminx -= n, this.pminy -= n, this.pminz -= n, this.pmaxx += n, this.pmaxy += n, this.pmaxz += n), this.pminx = Math.floor(this.pminx * this.scaleFactor) / this.scaleFactor, this.pminy = Math.floor(this.pminy * this.scaleFactor) / this.scaleFactor, this.pminz = Math.floor(this.pminz * this.scaleFactor) / this.scaleFactor, this.pmaxx = Math.ceil(this.pmaxx * this.scaleFactor) / this.scaleFactor, this.pmaxy = Math.ceil(this.pmaxy * this.scaleFactor) / this.scaleFactor, this.pmaxz = Math.ceil(this.pmaxz * this.scaleFactor) / this.scaleFactor, this.ptranx = -this.pminx, this.ptrany = -this.pminy, this.ptranz = -this.pminz, this.pLength = Math.ceil(this.scaleFactor * (this.pmaxx - this.pminx)) + 1, this.pWidth = Math.ceil(this.scaleFactor * (this.pmaxy - this.pminy)) + 1, this.pHeight = Math.ceil(this.scaleFactor * (this.pmaxz - this.pminz)) + 1, this.boundingatom(A), this.cutRadius = this.probeRadius * this.scaleFactor, this.vpBits = new Uint8Array(this.pLength * this.pWidth * this.pHeight), this.vpDistance = new Float64Array(this.pLength * this.pWidth * this.pHeight), this.vpAtomID = new Int32Array(this.pLength * this.pWidth * this.pHeight); + let s = 1 / this.scaleFactor * 5.5; + this.pminx = b[0][0], this.pmaxx = b[1][0], this.pminy = b[0][1], this.pmaxy = b[1][1], this.pminz = b[0][2], this.pmaxz = b[1][2], A ? (this.pminx -= this.probeRadius + s, this.pminy -= this.probeRadius + s, this.pminz -= this.probeRadius + s, this.pmaxx += this.probeRadius + s, this.pmaxy += this.probeRadius + s, this.pmaxz += this.probeRadius + s) : (this.pminx -= s, this.pminy -= s, this.pminz -= s, this.pmaxx += s, this.pmaxy += s, this.pmaxz += s), this.pminx = Math.floor(this.pminx * this.scaleFactor) / this.scaleFactor, this.pminy = Math.floor(this.pminy * this.scaleFactor) / this.scaleFactor, this.pminz = Math.floor(this.pminz * this.scaleFactor) / this.scaleFactor, this.pmaxx = Math.ceil(this.pmaxx * this.scaleFactor) / this.scaleFactor, this.pmaxy = Math.ceil(this.pmaxy * this.scaleFactor) / this.scaleFactor, this.pmaxz = Math.ceil(this.pmaxz * this.scaleFactor) / this.scaleFactor, this.ptranx = -this.pminx, this.ptrany = -this.pminy, this.ptranz = -this.pminz, this.pLength = Math.ceil(this.scaleFactor * (this.pmaxx - this.pminx)) + 1, this.pWidth = Math.ceil(this.scaleFactor * (this.pmaxy - this.pminy)) + 1, this.pHeight = Math.ceil(this.scaleFactor * (this.pmaxz - this.pminz)) + 1, this.boundingatom(A), this.cutRadius = this.probeRadius * this.scaleFactor, this.vpBits = new Uint8Array(this.pLength * this.pWidth * this.pHeight), this.vpDistance = new Float64Array(this.pLength * this.pWidth * this.pHeight), this.vpAtomID = new Int32Array(this.pLength * this.pWidth * this.pHeight); } boundingatom(b) { let A = {}; for (const S in this.vdwRadii) { - let n = this.vdwRadii[S]; - b ? A[S] = (n + this.probeRadius) * this.scaleFactor + 0.5 : A[S] = n * this.scaleFactor + 0.5; + let s = this.vdwRadii[S]; + b ? A[S] = (s + this.probeRadius) * this.scaleFactor + 0.5 : A[S] = s * this.scaleFactor + 0.5; let o = A[S] * A[S]; this.widxz[S] = Math.floor(A[S]) + 1, this.depty[S] = new Int32Array(this.widxz[S] * this.widxz[S]); let w = 0; @@ -10324,17 +10324,17 @@ ATOM`, g); } } fillvoxels(b, A) { - for (let S = 0, n = this.vpBits.length; S < n; S++) + for (let S = 0, s = this.vpBits.length; S < s; S++) this.vpBits[S] = 0, this.vpDistance[S] = -1, this.vpAtomID[S] = -1; for (let S in A) { - let n = b[A[S]]; - n !== void 0 && this.fillAtom(n, b); + let s = b[A[S]]; + s !== void 0 && this.fillAtom(s, b); } - for (let S = 0, n = this.vpBits.length; S < n; S++) + for (let S = 0, s = this.vpBits.length; S < s; S++) this.vpBits[S] & this.INOUT && (this.vpBits[S] |= this.ISDONE); } fillAtom(b, A) { - let S = Math.floor(0.5 + this.scaleFactor * (b.x + this.ptranx)), n = Math.floor(0.5 + this.scaleFactor * (b.y + this.ptrany)), o = Math.floor(0.5 + this.scaleFactor * (b.z + this.ptranz)), w = this.getVDWIndex(b), p = 0, v = this.pWidth * this.pHeight; + let S = Math.floor(0.5 + this.scaleFactor * (b.x + this.ptranx)), s = Math.floor(0.5 + this.scaleFactor * (b.y + this.ptrany)), o = Math.floor(0.5 + this.scaleFactor * (b.z + this.ptranz)), w = this.getVDWIndex(b), p = 0, v = this.pWidth * this.pHeight; for (let a = 0, l = this.widxz[w]; a < l; a++) for (let g = 0; g < l; g++) { if (this.depty[w][p] != -1) { @@ -10342,19 +10342,19 @@ ATOM`, g); for (let L = -1; L < 2; L++) for (let T = -1; T < 2; T++) if (M !== 0 && L !== 0 && T !== 0) { - let D = M * a, R = T * g; - for (let B = 0; B <= this.depty[w][p]; B++) { - let P = B * L, z = S + D, F = n + P, N = o + R; - if (z < 0 || F < 0 || N < 0 || z >= this.pLength || F >= this.pWidth || N >= this.pHeight) + let D = M * a, I = T * g; + for (let z = 0; z <= this.depty[w][p]; z++) { + let P = z * L, B = S + D, F = s + P, N = o + I; + if (B < 0 || F < 0 || N < 0 || B >= this.pLength || F >= this.pWidth || N >= this.pHeight) continue; - let $ = z * v + F * this.pHeight + N; + let $ = B * v + F * this.pHeight + N; if (!(this.vpBits[$] & this.INOUT)) this.vpBits[$] |= this.INOUT, this.vpAtomID[$] = b.serial; else { let k = A[this.vpAtomID[$]]; if (k.serial != b.serial) { - let G = S + D - Math.floor(0.5 + this.scaleFactor * (k.x + this.ptranx)), H = n + P - Math.floor(0.5 + this.scaleFactor * (k.y + this.ptrany)), U = o + R - Math.floor(0.5 + this.scaleFactor * (k.z + this.ptranz)); - D * D + P * P + R * R < G * G + H * H + U * U && (this.vpAtomID[$] = b.serial); + let G = S + D - Math.floor(0.5 + this.scaleFactor * (k.x + this.ptranx)), H = s + P - Math.floor(0.5 + this.scaleFactor * (k.y + this.ptrany)), U = o + I - Math.floor(0.5 + this.scaleFactor * (k.z + this.ptranz)); + D * D + P * P + I * I < G * G + H * H + U * U && (this.vpAtomID[$] = b.serial); } } } @@ -10364,15 +10364,15 @@ ATOM`, g); } } fillvoxelswaals(b, A) { - for (let S = 0, n = this.vpBits.length; S < n; S++) + for (let S = 0, s = this.vpBits.length; S < s; S++) this.vpBits[S] &= ~this.ISDONE; for (let S in A) { - let n = b[A[S]]; - n !== void 0 && this.fillAtomWaals(n, b); + let s = b[A[S]]; + s !== void 0 && this.fillAtomWaals(s, b); } } fillAtomWaals(b, A) { - let S = 0, n = Math.floor(0.5 + this.scaleFactor * (b.x + this.ptranx)), o = Math.floor(0.5 + this.scaleFactor * (b.y + this.ptrany)), w = Math.floor(0.5 + this.scaleFactor * (b.z + this.ptranz)), p = this.getVDWIndex(b), v = this.pWidth * this.pHeight; + let S = 0, s = Math.floor(0.5 + this.scaleFactor * (b.x + this.ptranx)), o = Math.floor(0.5 + this.scaleFactor * (b.y + this.ptrany)), w = Math.floor(0.5 + this.scaleFactor * (b.z + this.ptranz)), p = this.getVDWIndex(b), v = this.pWidth * this.pHeight; for (let a = 0, l = this.widxz[p]; a < l; a++) for (let g = 0; g < l; g++) { if (this.depty[p][S] != -1) { @@ -10380,19 +10380,19 @@ ATOM`, g); for (let L = -1; L < 2; L++) for (let T = -1; T < 2; T++) if (M !== 0 && L !== 0 && T !== 0) { - let D = M * a, R = T * g; - for (let B = 0; B <= this.depty[p][S]; B++) { - let P = B * L, z = n + D, F = o + P, N = w + R; - if (z < 0 || F < 0 || N < 0 || z >= this.pLength || F >= this.pWidth || N >= this.pHeight) + let D = M * a, I = T * g; + for (let z = 0; z <= this.depty[p][S]; z++) { + let P = z * L, B = s + D, F = o + P, N = w + I; + if (B < 0 || F < 0 || N < 0 || B >= this.pLength || F >= this.pWidth || N >= this.pHeight) continue; - let $ = z * v + F * this.pHeight + N; + let $ = B * v + F * this.pHeight + N; if (!(this.vpBits[$] & this.ISDONE)) this.vpBits[$] |= this.ISDONE, this.vpAtomID[$] = b.serial; else { let k = A[this.vpAtomID[$]]; if (k.serial != b.serial) { - let G = n + D - Math.floor(0.5 + this.scaleFactor * (k.x + this.ptranx)), H = o + P - Math.floor(0.5 + this.scaleFactor * (k.y + this.ptrany)), U = w + R - Math.floor(0.5 + this.scaleFactor * (k.z + this.ptranz)); - D * D + P * P + R * R < G * G + H * H + U * U && (this.vpAtomID[$] = b.serial); + let G = s + D - Math.floor(0.5 + this.scaleFactor * (k.x + this.ptranx)), H = o + P - Math.floor(0.5 + this.scaleFactor * (k.y + this.ptrany)), U = w + I - Math.floor(0.5 + this.scaleFactor * (k.z + this.ptranz)); + D * D + P * P + I * I < G * G + H * H + U * U && (this.vpAtomID[$] = b.serial); } } } @@ -10405,12 +10405,12 @@ ATOM`, g); let b = this.pWidth * this.pHeight; for (let A = 0; A < this.pLength; A++) for (let S = 0; S < this.pHeight; S++) - for (let n = 0; n < this.pWidth; n++) { - let o = A * b + n * this.pHeight + S; + for (let s = 0; s < this.pWidth; s++) { + let o = A * b + s * this.pHeight + S; if (this.vpBits[o] & this.INOUT) { let w = 0; for (; w < 26; ) { - let p = A + this.nb[w][0], v = S + this.nb[w][2], a = n + this.nb[w][1]; + let p = A + this.nb[w][0], v = S + this.nb[w][2], a = s + this.nb[w][1]; if (p > -1 && p < this.pLength && a > -1 && a < this.pWidth && v > -1 && v < this.pHeight && !(this.vpBits[p * b + a * this.pHeight + v] & this.INOUT)) { this.vpBits[o] |= this.ISBOUND; break; @@ -10421,7 +10421,7 @@ ATOM`, g); } } fastdistancemap() { - let b = new E(this.pLength, this.pWidth, this.pHeight), A = this.pWidth * this.pHeight, S = this.cutRadius * this.cutRadius, n = [], o = [], w; + let b = new E(this.pLength, this.pWidth, this.pHeight), A = this.pWidth * this.pHeight, S = this.cutRadius * this.cutRadius, s = [], o = [], w; for (let a = 0; a < this.pLength; a++) for (let l = 0; l < this.pWidth; l++) for (let g = 0; g < this.pHeight; g++) @@ -10431,18 +10431,18 @@ ATOM`, g); iy: l, iz: g }; - b.set(a, l, g, M), n.push(M), this.vpDistance[w] = 0, this.vpBits[w] |= this.ISDONE, this.vpBits[w] &= ~this.ISBOUND; + b.set(a, l, g, M), s.push(M), this.vpDistance[w] = 0, this.vpBits[w] |= this.ISDONE, this.vpBits[w] &= ~this.ISBOUND; } do { - o = this.fastoneshell(n, b), n = []; + o = this.fastoneshell(s, b), s = []; for (let a = 0, l = o.length; a < l; a++) - w = A * o[a].ix + this.pHeight * o[a].iy + o[a].iz, this.vpBits[w] &= ~this.ISBOUND, this.vpDistance[w] <= 1.0404 * S && n.push({ + w = A * o[a].ix + this.pHeight * o[a].iy + o[a].iz, this.vpBits[w] &= ~this.ISBOUND, this.vpDistance[w] <= 1.0404 * S && s.push({ ix: o[a].ix, iy: o[a].iy, iz: o[a].iz }); - } while (n.length !== 0); - n = [], o = [], b = null; + } while (s.length !== 0); + s = [], o = [], b = null; let p = this.scaleFactor - 0.5; p < 0 && (p = 0); let v = S - 0.5 / (0.1 + p); @@ -10452,7 +10452,7 @@ ATOM`, g); w = a * A + l * this.pHeight + g, this.vpBits[w] &= ~this.ISBOUND, this.vpBits[w] & this.INOUT && (!(this.vpBits[w] & this.ISDONE) || this.vpBits[w] & this.ISDONE && this.vpDistance[w] >= v) && (this.vpBits[w] |= this.ISBOUND); } fastoneshell(b, A) { - let S, n, o, w, p, v, a, l, g, M = []; + let S, s, o, w, p, v, a, l, g, M = []; if (b.length === 0) return M; let L = { @@ -10460,10 +10460,10 @@ ATOM`, g); iy: -1, iz: -1 }, T = this.pWidth * this.pHeight; - for (let D = 0, R = b.length; D < R; D++) { - S = b[D].ix, n = b[D].iy, o = b[D].iz, l = A.get(S, n, o); - for (let B = 0; B < 6; B++) - L.ix = S + this.nb[B][0], L.iy = n + this.nb[B][1], L.iz = o + this.nb[B][2], L.ix < this.pLength && L.ix > -1 && L.iy < this.pWidth && L.iy > -1 && L.iz < this.pHeight && L.iz > -1 && (g = L.ix * T + this.pHeight * L.iy + L.iz, this.vpBits[g] & this.INOUT && !(this.vpBits[g] & this.ISDONE) ? (A.set(L.ix, L.iy, o + this.nb[B][2], l), w = L.ix - l.ix, p = L.iy - l.iy, v = L.iz - l.iz, a = w * w + p * p + v * v, this.vpDistance[g] = a, this.vpBits[g] |= this.ISDONE, this.vpBits[g] |= this.ISBOUND, M.push({ + for (let D = 0, I = b.length; D < I; D++) { + S = b[D].ix, s = b[D].iy, o = b[D].iz, l = A.get(S, s, o); + for (let z = 0; z < 6; z++) + L.ix = S + this.nb[z][0], L.iy = s + this.nb[z][1], L.iz = o + this.nb[z][2], L.ix < this.pLength && L.ix > -1 && L.iy < this.pWidth && L.iy > -1 && L.iz < this.pHeight && L.iz > -1 && (g = L.ix * T + this.pHeight * L.iy + L.iz, this.vpBits[g] & this.INOUT && !(this.vpBits[g] & this.ISDONE) ? (A.set(L.ix, L.iy, o + this.nb[z][2], l), w = L.ix - l.ix, p = L.iy - l.iy, v = L.iz - l.iz, a = w * w + p * p + v * v, this.vpDistance[g] = a, this.vpBits[g] |= this.ISDONE, this.vpBits[g] |= this.ISBOUND, M.push({ ix: L.ix, iy: L.iy, iz: L.iz @@ -10473,10 +10473,10 @@ ATOM`, g); iz: L.iz }))))); } - for (let D = 0, R = b.length; D < R; D++) { - S = b[D].ix, n = b[D].iy, o = b[D].iz, l = A.get(S, n, o); - for (let B = 6; B < 18; B++) - L.ix = S + this.nb[B][0], L.iy = n + this.nb[B][1], L.iz = o + this.nb[B][2], L.ix < this.pLength && L.ix > -1 && L.iy < this.pWidth && L.iy > -1 && L.iz < this.pHeight && L.iz > -1 && (g = L.ix * T + this.pHeight * L.iy + L.iz, this.vpBits[g] & this.INOUT && !(this.vpBits[g] & this.ISDONE) ? (A.set(L.ix, L.iy, o + this.nb[B][2], l), w = L.ix - l.ix, p = L.iy - l.iy, v = L.iz - l.iz, a = w * w + p * p + v * v, this.vpDistance[g] = a, this.vpBits[g] |= this.ISDONE, this.vpBits[g] |= this.ISBOUND, M.push({ + for (let D = 0, I = b.length; D < I; D++) { + S = b[D].ix, s = b[D].iy, o = b[D].iz, l = A.get(S, s, o); + for (let z = 6; z < 18; z++) + L.ix = S + this.nb[z][0], L.iy = s + this.nb[z][1], L.iz = o + this.nb[z][2], L.ix < this.pLength && L.ix > -1 && L.iy < this.pWidth && L.iy > -1 && L.iz < this.pHeight && L.iz > -1 && (g = L.ix * T + this.pHeight * L.iy + L.iz, this.vpBits[g] & this.INOUT && !(this.vpBits[g] & this.ISDONE) ? (A.set(L.ix, L.iy, o + this.nb[z][2], l), w = L.ix - l.ix, p = L.iy - l.iy, v = L.iz - l.iz, a = w * w + p * p + v * v, this.vpDistance[g] = a, this.vpBits[g] |= this.ISDONE, this.vpBits[g] |= this.ISBOUND, M.push({ ix: L.ix, iy: L.iy, iz: L.iz @@ -10486,10 +10486,10 @@ ATOM`, g); iz: L.iz }))))); } - for (let D = 0, R = b.length; D < R; D++) { - S = b[D].ix, n = b[D].iy, o = b[D].iz, l = A.get(S, n, o); - for (let B = 18; B < 26; B++) - L.ix = S + this.nb[B][0], L.iy = n + this.nb[B][1], L.iz = o + this.nb[B][2], L.ix < this.pLength && L.ix > -1 && L.iy < this.pWidth && L.iy > -1 && L.iz < this.pHeight && L.iz > -1 && (g = L.ix * T + this.pHeight * L.iy + L.iz, this.vpBits[g] & this.INOUT && !(this.vpBits[g] & this.ISDONE) ? (A.set(L.ix, L.iy, o + this.nb[B][2], l), w = L.ix - l.ix, p = L.iy - l.iy, v = L.iz - l.iz, a = w * w + p * p + v * v, this.vpDistance[g] = a, this.vpBits[g] |= this.ISDONE, this.vpBits[g] |= this.ISBOUND, M.push({ + for (let D = 0, I = b.length; D < I; D++) { + S = b[D].ix, s = b[D].iy, o = b[D].iz, l = A.get(S, s, o); + for (let z = 18; z < 26; z++) + L.ix = S + this.nb[z][0], L.iy = s + this.nb[z][1], L.iz = o + this.nb[z][2], L.ix < this.pLength && L.ix > -1 && L.iy < this.pWidth && L.iy > -1 && L.iz < this.pHeight && L.iz > -1 && (g = L.ix * T + this.pHeight * L.iy + L.iz, this.vpBits[g] & this.INOUT && !(this.vpBits[g] & this.ISDONE) ? (A.set(L.ix, L.iy, o + this.nb[z][2], l), w = L.ix - l.ix, p = L.iy - l.iy, v = L.iz - l.iz, a = w * w + p * p + v * v, this.vpDistance[g] = a, this.vpBits[g] |= this.ISDONE, this.vpBits[g] |= this.ISBOUND, M.push({ ix: L.ix, iy: L.iy, iz: L.iz @@ -10513,7 +10513,7 @@ ATOM`, g); nZ: this.pHeight }); let A = this.pWidth * this.pHeight; - for (let S = 0, n = this.verts.length; S < n; S++) + for (let S = 0, s = this.verts.length; S < s; S++) this.verts[S].atomid = this.vpAtomID[this.verts[S].x * A + this.pHeight * this.verts[S].y + this.verts[S].z]; c.MarchingCube.laplacianSmooth(1, this.verts, this.faces); } @@ -10532,27 +10532,27 @@ ATOM`, g); /* harmony export */ VolumeData: () => ( /* binding */ - u + _ ) /* harmony export */ }); - var s = t( + var n = t( /*! ./utilities */ "./src/utilities.ts" ), f = t( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), _ = t( + ), u = t( /*! ./parsers/VASP */ "./src/parsers/VASP.ts" - ), x = t( + ), y = t( /*! ./parsers/CUBE */ "./src/parsers/CUBE.ts" ), h = t( /*! pako */ "./node_modules/pako/dist/pako.esm.mjs" ); - class u { + class _ { constructor(c, C, b) { if (this.unit = { x: 1, @@ -10570,7 +10570,7 @@ ATOM`, g); var p = w / (this.size.y * this.size.z), v = w % (this.size.y * this.size.z), a = w % this.size.z; return p *= this.unit.x, v *= this.unit.y, a *= this.unit.z, p += this.origin.x, v += this.origin.y, a += this.origin.z, { x: p, y: v, z: a }; }, this.vasp = function(w) { - var p = w.replace(/^\s+/, "").split(/[\n\r]/), v = (0, _.VASP)(w)[0], a = v.length; + var p = w.replace(/^\s+/, "").split(/[\n\r]/), v = (0, u.VASP)(w)[0], a = v.length; if (a == 0) { console.log("No good formating of CHG or CHGCAR file, not atomic information provided in the file."), this.data = []; return; @@ -10581,12 +10581,12 @@ ATOM`, g); L = p[3].replace(/^\s+/, "").split(/\s+/); var D = new f.Vector3(parseFloat(L[0]), parseFloat(L[1]), parseFloat(L[2])).multiplyScalar(M * l); L = p[4].replace(/^\s+/, "").split(/\s+/); - var R = new f.Vector3(parseFloat(L[0]), parseFloat(L[1]), parseFloat(L[2])).multiplyScalar(M * l), B = T.x * (D.y * R.z - R.y * D.z) - D.x * (T.y * R.z - R.y * T.z) + R.x * (T.y * D.z - D.y * T.z); - B = Math.abs(B) / Math.pow(l, 3); - var P = 1 / B; + var I = new f.Vector3(parseFloat(L[0]), parseFloat(L[1]), parseFloat(L[2])).multiplyScalar(M * l), z = T.x * (D.y * I.z - I.y * D.z) - D.x * (T.y * I.z - I.y * T.z) + I.x * (T.y * D.z - D.y * T.z); + z = Math.abs(z) / Math.pow(l, 3); + var P = 1 / z; p.splice(0, 8 + a + 1); - var z = p[0].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), F = Math.abs(parseFloat(z[0])), N = Math.abs(parseFloat(z[1])), $ = Math.abs(parseFloat(z[2])), k = this.origin = new f.Vector3(0, 0, 0); - this.size = { x: F, y: N, z: $ }, this.unit = new f.Vector3(T.x, D.y, R.z), T = T.multiplyScalar(1 / (l * F)), D = D.multiplyScalar(1 / (l * N)), R = R.multiplyScalar(1 / (l * $)), (T.y != 0 || T.z != 0 || D.x != 0 || D.z != 0 || R.x != 0 || R.y != 0) && (this.matrix = new f.Matrix4(T.x, D.x, R.x, 0, T.y, D.y, R.y, 0, T.z, D.z, R.z, 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new f.Matrix4().makeTranslation(k.x, k.y, k.z)), this.origin = new f.Vector3(0, 0, 0), this.unit = new f.Vector3(1, 1, 1)), p.splice(0, 1); + var B = p[0].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), F = Math.abs(parseFloat(B[0])), N = Math.abs(parseFloat(B[1])), $ = Math.abs(parseFloat(B[2])), k = this.origin = new f.Vector3(0, 0, 0); + this.size = { x: F, y: N, z: $ }, this.unit = new f.Vector3(T.x, D.y, I.z), T = T.multiplyScalar(1 / (l * F)), D = D.multiplyScalar(1 / (l * N)), I = I.multiplyScalar(1 / (l * $)), (T.y != 0 || T.z != 0 || D.x != 0 || D.z != 0 || I.x != 0 || I.y != 0) && (this.matrix = new f.Matrix4(T.x, D.x, I.x, 0, T.y, D.y, I.y, 0, T.z, D.z, I.z, 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new f.Matrix4().makeTranslation(k.x, k.y, k.z)), this.origin = new f.Vector3(0, 0, 0), this.unit = new f.Vector3(1, 1, 1)), p.splice(0, 1); var G = p.join(" "); G = G.replace(/^\s+/, ""); var H = G.split(/[\s\r]+/); @@ -10599,21 +10599,21 @@ ATOM`, g); for (L = 0; L < p.length; L++) { var T = p[L]; if (v = a.exec(T)) { - var D = parseInt(v[1]), R = parseInt(v[2]), B = parseInt(v[3]); - this.size = { x: D, y: R, z: B }; + var D = parseInt(v[1]), I = parseInt(v[2]), z = parseInt(v[3]); + this.size = { x: D, y: I, z }; } else if (v = g.exec(T)) { var P = parseFloat(v[1]); if ((parseFloat(v[2]) != 0 || parseFloat(v[3]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), L += 1, T = p[L], v = g.exec(T), v == null) { console.log("Parse error in dx delta matrix"); return; } - var z = parseFloat(v[2]); + var B = parseFloat(v[2]); if ((parseFloat(v[1]) != 0 || parseFloat(v[3]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), L += 1, T = p[L], v = g.exec(T), v == null) { console.log("Parse error in dx delta matrix"); return; } var F = parseFloat(v[3]); - (parseFloat(v[1]) != 0 || parseFloat(v[2]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), this.unit = new f.Vector3(P, z, F); + (parseFloat(v[1]) != 0 || parseFloat(v[2]) != 0) && console.log("Non-orthogonal delta matrix not currently supported in dx format"), this.unit = new f.Vector3(P, B, F); } else if (v = l.exec(T)) { var N = parseFloat(v[1]), $ = parseFloat(v[2]), k = parseFloat(v[3]); this.origin = new f.Vector3(N, $, k); @@ -10629,12 +10629,12 @@ ATOM`, g); }, C = C.toLowerCase(), /\.gz$/.test(C)) { C = C.replace(/\.gz$/, ""); try { - this[C] && this.isbinary.has(C) ? (typeof c == "string" && (c = (0, s.base64ToArray)(c)), c = (0, h.inflate)(c)) : c = new TextDecoder("utf-8").decode((0, h.inflate)(c)); + this[C] && this.isbinary.has(C) ? (typeof c == "string" && (c = (0, n.base64ToArray)(c)), c = (0, h.inflate)(c)) : c = new TextDecoder("utf-8").decode((0, h.inflate)(c)); } catch (w) { console.log(w); } } - if (this[C] && (this.isbinary.has(C) && typeof c == "string" && (c = (0, s.base64ToArray)(c)), this[C](c)), b) { + if (this[C] && (this.isbinary.has(C) && typeof c == "string" && (c = (0, n.base64ToArray)(c)), this[C](c)), b) { if (b.negate) for (let w = 0, p = this.data.length; w < p; w++) this.data[w] = -this.data[w]; @@ -10645,8 +10645,8 @@ ATOM`, g); var S = A / this.data.length; A = 0; for (let w = 0, p = this.data.length; w < p; w++) { - var n = this.data[w] - S; - A += n * n; + var s = this.data[w] - S; + A += s * s; } var o = A / this.data.length; for (let w = 0, p = this.data.length; w < p; w++) @@ -10681,11 +10681,11 @@ ATOM`, g); cube(c) { var C = c.split(/\r?\n/); if (!(C.length < 6)) { - var b = (0, x.CUBE)(c, {}).modelData[0].cryst, A = C[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), S = parseFloat(A[0]), n = Math.abs(S); + var b = (0, y.CUBE)(c, {}).modelData[0].cryst, A = C[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), S = parseFloat(A[0]), s = Math.abs(S); this.origin = b.origin, this.size = b.size, this.unit = b.unit, this.matrix = b.matrix4; var o = 6; S < 0 && o++; - var w = C.splice(n + o).join(" "); + var w = C.splice(s + o).join(" "); w = w.replace(/^\s+/, ""); var p = w.split(/[\s\r]+/); this.data = Float32Array.from(p, parseFloat); @@ -10697,7 +10697,7 @@ ATOM`, g); c = new Int8Array(c); var b = new Int32Array(c.buffer, 0, 56), A = new Float32Array(c.buffer, 0, 56), S = new DataView(c.buffer); if (C.MAP = String.fromCharCode(S.getUint8(208), S.getUint8(209), S.getUint8(210), S.getUint8(211)), C.MACHST = [S.getUint8(212), S.getUint8(213)], C.MACHST[0] === 17 && C.MACHST[1] === 17) - for (var n = c.byteLength, o = 0; o < n; o += 4) + for (var s = c.byteLength, o = 0; o < s; o += 4) S.setFloat32(o, S.getFloat32(o), !0); C.NX = b[0], C.NY = b[1], C.NZ = b[2], C.MODE = b[3], C.NXSTART = b[4], C.NYSTART = b[5], C.NZSTART = b[6], C.MX = b[7], C.MY = b[8], C.MZ = b[9], C.xlen = A[10], C.ylen = A[11], C.zlen = A[12], C.alpha = A[13], C.beta = A[14], C.gamma = A[15], C.MAPC = b[16], C.MAPR = b[17], C.MAPS = b[18], C.DMIN = A[19], C.DMAX = A[20], C.DMEAN = A[21], C.ISPG = b[22], C.NSYMBT = b[23], C.LSKFLG = b[24], C.originX = A[49], C.originY = A[50], C.originZ = A[51], C.ARMS = A[54]; var w = C, p = [ @@ -10716,12 +10716,12 @@ ATOM`, g); a[2] = Math.sqrt(w.zlen * w.zlen * Math.sin(Math.PI / 180 * w.beta) * Math.sin(Math.PI / 180 * w.beta) - a[1] * a[1]); var l = [0, p, v, a], g = [0, w.MX, w.MY, w.MZ], M = [0, w.MAPC, w.MAPR, w.MAPS]; this.matrix = new f.Matrix4(), this.matrix.set(l[M[1]][0] / g[M[1]], l[M[2]][0] / g[M[2]], l[M[3]][0] / g[M[3]], 0, l[M[1]][1] / g[M[1]], l[M[2]][1] / g[M[2]], l[M[3]][1] / g[M[3]], 0, l[M[1]][2] / g[M[1]], l[M[2]][2] / g[M[2]], l[M[3]][2] / g[M[3]], 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new f.Matrix4().makeTranslation(w.NXSTART + w.originX, w.NYSTART + w.originY, w.NZSTART + w.originZ)), this.origin = new f.Vector3(0, 0, 0), this.unit = new f.Vector3(1, 1, 1), this.size = { x: C.NX, y: C.NY, z: C.NZ }, this.dimensionorder = [C.MAPC, C.MAPR, C.MAPS]; - var L = new Float32Array(c.buffer, 1024 + C.NSYMBT), T = C.NX, D = C.NY, R = C.NZ; - this.data = new Float32Array(T * D * R); - for (let B = 0; B < T; B++) + var L = new Float32Array(c.buffer, 1024 + C.NSYMBT), T = C.NX, D = C.NY, I = C.NZ; + this.data = new Float32Array(T * D * I); + for (let z = 0; z < T; z++) for (let P = 0; P < D; P++) - for (let z = 0; z < R; z++) - this.data[(B * D + P) * R + z] = L[(z * D + P) * T + B]; + for (let B = 0; B < I; B++) + this.data[(z * D + P) * I + B] = L[(B * D + P) * T + z]; } } } @@ -10737,41 +10737,41 @@ ATOM`, g); /* harmony export */ GLVolumetricRender: () => ( /* binding */ - u + _ ) /* harmony export */ }); - var s = t( + var n = t( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" ), f = t( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" - ), _ = t( + ), u = t( /*! ./WebGL */ "./src/WebGL/index.ts" - ), x = t( + ), y = t( /*! ./colors */ "./src/colors.ts" ), h = t( /*! ./GLShape */ "./src/GLShape.ts" ); - class u { + class _ { static interpolateArray(c, C) { function b(a, l, g) { return a + (l - a) * g; } var A = [], S = (c.length - 1) / (C - 1); A[0] = c[0]; - for (var n = 1; n < C - 1; n++) { - var o = n * S, w = Math.floor(o), p = Math.ceil(o), v = o - w; - A[n] = b(c[w], c[p], v); + for (var s = 1; s < C - 1; s++) { + var o = s * S, w = Math.floor(o), p = Math.ceil(o), v = o - w; + A[s] = b(c[w], c[p], v); } return A[C - 1] = c[c.length - 1], A; } constructor(c, C) { - this.hidden = !1, this.boundingSphere = new s.Sphere(), this.renderedShapeObj = null, this.shapeObj = null, this.subsamples = 5, this.data = null, this.transferfunctionbuffer = [], this.min = 0, this.max = 0, C = C || {}; + this.hidden = !1, this.boundingSphere = new n.Sphere(), this.renderedShapeObj = null, this.shapeObj = null, this.subsamples = 5, this.data = null, this.transferfunctionbuffer = [], this.min = 0, this.max = 0, C = C || {}; var b = Object.assign([], C.transferfn); this.subsamples = C.subsamples || 5; let A = 256; @@ -10780,27 +10780,27 @@ ATOM`, g); }), b.sort(function(T, D) { return T.value - D.value; }), this.min = b[0].value, b.length == 0 && b.push(b[0]), this.max = b[b.length - 1].value; - var S, n, o, w, p, v, a, l, g, M; + var S, s, o, w, p, v, a, l, g, M; for (let T = 0; T < b.length - 1; T++) - if (o = x.CC.color(b[T].color), w = x.CC.color(b[T + 1].color), g = b[T].opacity, M = b[T + 1].opacity, S = Math.floor((b[T].value - this.min) * A / (this.max - this.min)), n = Math.floor((b[T + 1].value - this.min) * A / (this.max - this.min)), S != n) { - p = u.interpolateArray([o.r * 255, w.r * 255], n - S), v = u.interpolateArray([o.g * 255, w.g * 255], n - S), a = u.interpolateArray([o.b * 255, w.b * 255], n - S), l = u.interpolateArray([g * 255, M * 255], n - S); + if (o = y.CC.color(b[T].color), w = y.CC.color(b[T + 1].color), g = b[T].opacity, M = b[T + 1].opacity, S = Math.floor((b[T].value - this.min) * A / (this.max - this.min)), s = Math.floor((b[T + 1].value - this.min) * A / (this.max - this.min)), S != s) { + p = _.interpolateArray([o.r * 255, w.r * 255], s - S), v = _.interpolateArray([o.g * 255, w.g * 255], s - S), a = _.interpolateArray([o.b * 255, w.b * 255], s - S), l = _.interpolateArray([g * 255, M * 255], s - S); for (let D = 0; D < p.length; D++) this.transferfunctionbuffer.push(p[D]), this.transferfunctionbuffer.push(v[D]), this.transferfunctionbuffer.push(a[D]), this.transferfunctionbuffer.push(l[D]); } if (this.transferfunctionbuffer = new Uint8ClampedArray(this.transferfunctionbuffer), c.matrix) { - let T = new f.Vector3(0, 0, 0), D = new f.Vector3(c.size.x, c.size.y, c.size.z), R = new f.Vector3(1, 1, 1); - T.applyMatrix4(c.matrix), D.applyMatrix4(c.matrix), R.applyMatrix4(c.matrix).sub(T), this.extent = [[T.x, T.y, T.z], [D.x, D.y, D.z]]; + let T = new f.Vector3(0, 0, 0), D = new f.Vector3(c.size.x, c.size.y, c.size.z), I = new f.Vector3(1, 1, 1); + T.applyMatrix4(c.matrix), D.applyMatrix4(c.matrix), I.applyMatrix4(c.matrix).sub(T), this.extent = [[T.x, T.y, T.z], [D.x, D.y, D.z]]; for (let F = 1; F < 7; F++) D.x = F & 1 ? c.size.x : 0, D.y = F & 2 ? c.size.y : 0, D.z = F & 4 ? c.size.z : 0, D.applyMatrix4(c.matrix), this.extent[0][0] = Math.min(this.extent[0][0], D.x), this.extent[0][1] = Math.min(this.extent[0][1], D.y), this.extent[0][2] = Math.min(this.extent[0][2], D.z), this.extent[1][0] = Math.max(this.extent[1][0], D.x), this.extent[1][1] = Math.max(this.extent[1][1], D.y), this.extent[1][2] = Math.max(this.extent[1][2], D.z); - let B = D.x - T.x, P = D.y - T.y, z = D.z - T.z; - this.maxdepth = Math.sqrt(B * B + P * P + z * z), this.minunit = Math.min(Math.min(R.x, R.y), R.z), this.texmatrix = new f.Matrix4().identity().scale({ x: c.size.x, y: c.size.y, z: c.size.z }), this.texmatrix = this.texmatrix.multiplyMatrices(c.matrix, this.texmatrix), this.texmatrix = this.texmatrix.getInverse(this.texmatrix); + let z = D.x - T.x, P = D.y - T.y, B = D.z - T.z; + this.maxdepth = Math.sqrt(z * z + P * P + B * B), this.minunit = Math.min(Math.min(I.x, I.y), I.z), this.texmatrix = new f.Matrix4().identity().scale({ x: c.size.x, y: c.size.y, z: c.size.z }), this.texmatrix = this.texmatrix.multiplyMatrices(c.matrix, this.texmatrix), this.texmatrix = this.texmatrix.getInverse(this.texmatrix); } else { this.texmatrix = new f.Matrix4().identity(); - let T = c.unit.x * c.size.x, D = c.unit.y * c.size.y, R = c.unit.z * c.size.z; - this.texmatrix.makeTranslation(-c.origin.x / T, -c.origin.y / D, -c.origin.z / R), this.texmatrix.scale({ x: 1 / T, y: 1 / D, z: 1 / R }), this.minunit = Math.min(Math.min(c.unit.x, c.unit.y), c.unit.z), this.extent = [ + let T = c.unit.x * c.size.x, D = c.unit.y * c.size.y, I = c.unit.z * c.size.z; + this.texmatrix.makeTranslation(-c.origin.x / T, -c.origin.y / D, -c.origin.z / I), this.texmatrix.scale({ x: 1 / T, y: 1 / D, z: 1 / I }), this.minunit = Math.min(Math.min(c.unit.x, c.unit.y), c.unit.z), this.extent = [ [c.origin.x, c.origin.y, c.origin.z], - [c.origin.x + T, c.origin.y + D, c.origin.z + R] - ], this.maxdepth = Math.sqrt(T * T + D * D + R * R); + [c.origin.x + T, c.origin.y + D, c.origin.z + I] + ], this.maxdepth = Math.sqrt(T * T + D * D + I * I); } var L = new h.GLShape({}); if (L.addBox({ @@ -10811,19 +10811,19 @@ ATOM`, g); d: this.extent[1][2] - this.extent[0][2] } }), this.geo = L.finalize(), this.boundingSphere.center = new f.Vector3((this.extent[0][0] + this.extent[1][0]) / 2, (this.extent[0][1] + this.extent[1][1]) / 2, (this.extent[0][2] + this.extent[1][2]) / 2), this.boundingSphere.radius = this.maxdepth / 2, C.coords !== void 0 && C.seldist !== void 0) { - let T = new Uint8Array(c.data.length), D = C.seldist, R = D * D; - for (let B = 0, P = C.coords.length; B < P; B++) { - let z = C.coords[B], F = z.x - D, N = z.y - D, $ = z.z - D, k = z.x + D, G = z.y + D, H = z.z + D; + let T = new Uint8Array(c.data.length), D = C.seldist, I = D * D; + for (let z = 0, P = C.coords.length; z < P; z++) { + let B = C.coords[z], F = B.x - D, N = B.y - D, $ = B.z - D, k = B.x + D, G = B.y + D, H = B.z + D; if (c.getIndex(F, N, $) >= 0 || c.getIndex(k, G, H) >= 0) for (let U = F; U < k; U += this.minunit) for (let V = N; V < G; V += this.minunit) for (let Q = $; Q < H; Q += this.minunit) { - let oe = c.getIndex(U, V, Q); - oe >= 0 && !T[oe] && (U - z.x) * (U - z.x) + (V - z.y) * (V - z.y) + (Q - z.z) * (Q - z.z) < R && (T[oe] = 1); + let ae = c.getIndex(U, V, Q); + ae >= 0 && !T[ae] && (U - B.x) * (U - B.x) + (V - B.y) * (V - B.y) + (Q - B.z) * (Q - B.z) < I && (T[ae] = 1); } } - for (let B = 0, P = c.data.length; B < P; B++) - T[B] == 0 && (c.data[B] = 1 / 0); + for (let z = 0, P = c.data.length; z < P; z++) + T[z] == 0 && (c.data[z] = 1 / 0); } this.data = c; } @@ -10834,9 +10834,9 @@ ATOM`, g); */ globj(c) { if (this.renderedShapeObj && (c.remove(this.renderedShapeObj), this.renderedShapeObj = null), !this.hidden) { - this.shapeObj = new _.Object3D(); - var C = null, b = new _.Texture(this.data, !0), A = new _.Texture(this.transferfunctionbuffer, !1); - b.needsUpdate = !0, A.needsUpdate = !0, A.flipY = !1, C = new _.VolumetricMaterial({ + this.shapeObj = new u.Object3D(); + var C = null, b = new u.Texture(this.data, !0), A = new u.Texture(this.transferfunctionbuffer, !1); + b.needsUpdate = !0, A.needsUpdate = !0, A.flipY = !1, C = new u.VolumetricMaterial({ transferfn: A, transfermin: this.min, transfermax: this.max, @@ -10847,7 +10847,7 @@ ATOM`, g); unit: this.minunit, subsamples: this.subsamples }); - var S = new _.Mesh(this.geo, C); + var S = new u.Mesh(this.geo, C); this.shapeObj.add(S), this.renderedShapeObj = this.shapeObj.clone(), c.add(this.renderedShapeObj); } } @@ -10880,20 +10880,20 @@ ATOM`, g); /* harmony export */ Camera: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ./core */ "./src/WebGL/core/index.ts" ), f = t( /*! ./math */ "./src/WebGL/math/index.ts" ); - class _ extends s.Object3D { - constructor(h = 50, u = 1, E = 0.1, c = 2e3, C = !1) { - super(), this.projectionMatrix = new f.Matrix4(), this.projectionMatrixInverse = new f.Matrix4(), this.matrixWorldInverse = new f.Matrix4(), this.fov = h, this.aspect = u, this.near = E, this.far = c; + class u extends n.Object3D { + constructor(h = 50, _ = 1, E = 0.1, c = 2e3, C = !1) { + super(), this.projectionMatrix = new f.Matrix4(), this.projectionMatrixInverse = new f.Matrix4(), this.matrixWorldInverse = new f.Matrix4(), this.fov = h, this.aspect = _, this.near = E, this.far = c; var b = this.position.z; this.right = b * Math.tan(Math.PI / 180 * h), this.left = -this.right, this.top = this.right / this.aspect, this.bottom = -this.top, this.ortho = !!C, this.updateProjectionMatrix(); } @@ -10921,13 +10921,13 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../colors */ "./src/colors.ts" ); class f { - constructor(x, h = 1, u = 1e3) { - this.name = "", this.color = new s.Color(x), this.near = h, this.far = u; + constructor(y, h = 1, _ = 1e3) { + this.name = "", this.color = new n.Color(y), this.near = h, this.far = _; } clone() { return new f(this.color.getHex(), this.near, this.far); @@ -10950,22 +10950,22 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./Camera */ "./src/WebGL/Camera.ts" ), f = t( /*! ./constants/Sides */ "./src/WebGL/constants/Sides.ts" - ), _ = t( + ), u = t( /*! ./constants/TextureConstants */ "./src/WebGL/constants/TextureConstants.ts" - ), x = t( + ), y = t( /*! ./core */ "./src/WebGL/core/index.ts" ), h = t( /*! ../colors */ "./src/colors.ts" - ), u = t( + ), _ = t( /*! ./materials */ "./src/WebGL/materials/index.ts" ), E = t( @@ -10982,7 +10982,7 @@ ATOM`, g); "./src/WebGL/SpritePlugin.ts" ); class A { - constructor(n) { + constructor(s) { this.context = null, this.devicePixelRatio = 1, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.autoUpdateObjects = !0, this.autoUpdateScene = !0, this.info = { memory: { programs: 0, @@ -11023,7 +11023,7 @@ ATOM`, g); groundColors: [], positions: [] } - }, this.sprites = new b.SpritePlugin(), this._screenshader = null, this._vertexattribpos = null, this._screenQuadVBO = null, this._fb = null, this._targetTexture = null, this._depthTexture = null, n = n || {}, this.row = n.row, this.col = n.col, this.rows = n.rows, this.cols = n.cols, this._canvas = n.canvas !== void 0 ? n.canvas : document.createElement("canvas"), this._precision = n.precision !== void 0 ? n.precision : "highp", this._alpha = n.alpha !== void 0 ? n.alpha : !0, this._premultipliedAlpha = n.premultipliedAlpha !== void 0 ? n.premultipliedAlpha : !0, this._antialias = n.antialias !== void 0 ? n.antialias : !1, this._stencil = n.stencil !== void 0 ? n.stencil : !0, this._preserveDrawingBuffer = n.preserveDrawingBuffer !== void 0 ? n.preserveDrawingBuffer : !1, this._clearColor = n.clearColor !== void 0 ? new h.Color(n.clearColor) : new h.Color(0), this._clearAlpha = n.clearAlpha !== void 0 ? n.clearAlpha : 0, this._outlineMaterial = new u.MeshOutlineMaterial(n.outline), this._outlineSphereImposterMaterial = new u.SphereImposterOutlineMaterial(n.outline), this._outlineStickImposterMaterial = new u.StickImposterOutlineMaterial(n.outline), this._outlineEnabled = !!n.outline, this.domElement = this._canvas, this._canvas.id = n.id, this.initGL(), this.setDefaultGLState(), this.context = this._gl, this.isWebGL1() ? this._extInstanced = this._gl.getExtension("ANGLE_instanced_arrays") : this._extInstanced = { + }, this.sprites = new b.SpritePlugin(), this._screenshader = null, this._vertexattribpos = null, this._screenQuadVBO = null, this._fb = null, this._targetTexture = null, this._depthTexture = null, s = s || {}, this.row = s.row, this.col = s.col, this.rows = s.rows, this.cols = s.cols, this._canvas = s.canvas !== void 0 ? s.canvas : document.createElement("canvas"), this._precision = s.precision !== void 0 ? s.precision : "highp", this._alpha = s.alpha !== void 0 ? s.alpha : !0, this._premultipliedAlpha = s.premultipliedAlpha !== void 0 ? s.premultipliedAlpha : !0, this._antialias = s.antialias !== void 0 ? s.antialias : !1, this._stencil = s.stencil !== void 0 ? s.stencil : !0, this._preserveDrawingBuffer = s.preserveDrawingBuffer !== void 0 ? s.preserveDrawingBuffer : !1, this._clearColor = s.clearColor !== void 0 ? new h.Color(s.clearColor) : new h.Color(0), this._clearAlpha = s.clearAlpha !== void 0 ? s.clearAlpha : 0, this._outlineMaterial = new _.MeshOutlineMaterial(s.outline), this._outlineSphereImposterMaterial = new _.SphereImposterOutlineMaterial(s.outline), this._outlineStickImposterMaterial = new _.StickImposterOutlineMaterial(s.outline), this._outlineEnabled = !!s.outline, this.domElement = this._canvas, this._canvas.id = s.id, this.initGL(), this.setDefaultGLState(), this.context = this._gl, this.isWebGL1() ? this._extInstanced = this._gl.getExtension("ANGLE_instanced_arrays") : this._extInstanced = { vertexAttribDivisorANGLE: this._gl.vertexAttribDivisor.bind(this._gl), drawElementsInstancedANGLE: this._gl.drawElementsInstanced.bind(this._gl) }, this._extFragDepth = this._gl.getExtension("EXT_frag_depth"), this._extFloatLinear = this._gl.getExtension("OES_texture_float_linear"), this._extColorBufferFloat = this._gl.getExtension("EXT_color_buffer_float"), this.sprites.init(this); @@ -11045,98 +11045,98 @@ ATOM`, g); getPrecision() { return this._precision; } - setClearColorHex(n, o) { - this._clearColor.setHex(n), this._clearAlpha = o, this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha); + setClearColorHex(s, o) { + this._clearColor.setHex(s), this._clearAlpha = o, this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha); } - enableOutline(n) { - this._outlineMaterial = new u.MeshOutlineMaterial(n), this._outlineSphereImposterMaterial = new u.SphereImposterOutlineMaterial(n), this._outlineStickImposterMaterial = new u.StickImposterOutlineMaterial(n), this._outlineEnabled = !0; + enableOutline(s) { + this._outlineMaterial = new _.MeshOutlineMaterial(s), this._outlineSphereImposterMaterial = new _.SphereImposterOutlineMaterial(s), this._outlineStickImposterMaterial = new _.StickImposterOutlineMaterial(s), this._outlineEnabled = !0; } disableOutline() { this._outlineEnabled = !1; } setViewport() { if (this.rows != null && this.cols != null && this.row != null && this.col != null) { - var n = this._canvas.width / this.cols, o = this._canvas.height / this.rows; - this._viewportWidth = n, this._viewportHeight = o, this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(n * this.col, o * this.row, n, o), this._gl.viewport(n * this.col, o * this.row, n, o); + var s = this._canvas.width / this.cols, o = this._canvas.height / this.rows; + this._viewportWidth = s, this._viewportHeight = o, this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(s * this.col, o * this.row, s, o), this._gl.viewport(s * this.col, o * this.row, s, o); } } - setSize(n, o) { + setSize(s, o) { if (this.devicePixelRatio = window.devicePixelRatio !== void 0 ? window.devicePixelRatio : 1, this._antialias && this.devicePixelRatio < 2 && (this.devicePixelRatio *= 2), this.rows != null && this.cols != null && this.row != null && this.col != null) { - var w = n / this.cols, p = o / this.rows; - this._canvas.width = n * this.devicePixelRatio, this._canvas.height = o * this.devicePixelRatio, this._viewportWidth = w * this.devicePixelRatio, this._viewportHeight = p * this.devicePixelRatio, this._canvas.style.width = n + "px", this._canvas.style.height = o + "px", this.setViewport(); + var w = s / this.cols, p = o / this.rows; + this._canvas.width = s * this.devicePixelRatio, this._canvas.height = o * this.devicePixelRatio, this._viewportWidth = w * this.devicePixelRatio, this._viewportHeight = p * this.devicePixelRatio, this._canvas.style.width = s + "px", this._canvas.style.height = o + "px", this.setViewport(); } else - this._viewportWidth = this._canvas.width = n * this.devicePixelRatio, this._viewportHeight = this._canvas.height = o * this.devicePixelRatio, this._canvas.style.width = n + "px", this._canvas.style.height = o + "px", this._gl.viewport(0, 0, this._gl.drawingBufferWidth, this._gl.drawingBufferHeight); + this._viewportWidth = this._canvas.width = s * this.devicePixelRatio, this._viewportHeight = this._canvas.height = o * this.devicePixelRatio, this._canvas.style.width = s + "px", this._canvas.style.height = o + "px", this._gl.viewport(0, 0, this._gl.drawingBufferWidth, this._gl.drawingBufferHeight); this.initFrameBuffer(); } - clear(n, o, w) { + clear(s, o, w) { var p = 0; - (n === void 0 || n) && (p |= this._gl.COLOR_BUFFER_BIT), (o === void 0 || o) && (p |= this._gl.DEPTH_BUFFER_BIT), (w === void 0 || w) && (p |= this._gl.STENCIL_BUFFER_BIT), this._gl.clear(p); + (s === void 0 || s) && (p |= this._gl.COLOR_BUFFER_BIT), (o === void 0 || o) && (p |= this._gl.DEPTH_BUFFER_BIT), (w === void 0 || w) && (p |= this._gl.STENCIL_BUFFER_BIT), this._gl.clear(p); } - clearTarget(n, o, w) { - this.clear(n, o, w); + clearTarget(s, o, w) { + this.clear(s, o, w); } - setMaterialFaces(n, o) { - var w = n.side === f.DoubleSide, p = n.side === f.BackSide; - n.imposter || (p = o ? !p : p), this._oldDoubleSided !== w && (w ? this._gl.disable(this._gl.CULL_FACE) : this._gl.enable(this._gl.CULL_FACE), this._oldDoubleSided = w), this._oldFlipSided !== p && (p ? this._gl.frontFace(this._gl.CW) : this._gl.frontFace(this._gl.CCW), this._oldFlipSided = p), this._gl.cullFace(this._gl.BACK); + setMaterialFaces(s, o) { + var w = s.side === f.DoubleSide, p = s.side === f.BackSide; + s.imposter || (p = o ? !p : p), this._oldDoubleSided !== w && (w ? this._gl.disable(this._gl.CULL_FACE) : this._gl.enable(this._gl.CULL_FACE), this._oldDoubleSided = w), this._oldFlipSided !== p && (p ? this._gl.frontFace(this._gl.CW) : this._gl.frontFace(this._gl.CCW), this._oldFlipSided = p), this._gl.cullFace(this._gl.BACK); } - setDepthTest(n) { - this._oldDepthTest !== n && (n ? this._gl.enable(this._gl.DEPTH_TEST) : this._gl.disable(this._gl.DEPTH_TEST), this._oldDepthTest = n); + setDepthTest(s) { + this._oldDepthTest !== s && (s ? this._gl.enable(this._gl.DEPTH_TEST) : this._gl.disable(this._gl.DEPTH_TEST), this._oldDepthTest = s); } - setDepthWrite(n) { - this._oldDepthWrite !== n && (this._gl.depthMask(n), this._oldDepthWrite = n); + setDepthWrite(s) { + this._oldDepthWrite !== s && (this._gl.depthMask(s), this._oldDepthWrite = s); } - setBlending(n) { - n ? (this._gl.enable(this._gl.BLEND), this._gl.blendEquationSeparate(this._gl.FUNC_ADD, this._gl.FUNC_ADD), this._gl.blendFuncSeparate(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA)) : this._gl.disable(this._gl.BLEND); + setBlending(s) { + s ? (this._gl.enable(this._gl.BLEND), this._gl.blendEquationSeparate(this._gl.FUNC_ADD, this._gl.FUNC_ADD), this._gl.blendFuncSeparate(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA)) : this._gl.disable(this._gl.BLEND); } // TODO: need to set up shader attributes and uniforms as attributes on // material object after attaching prgm // We need to attach appropriate uniform variables to material after shaders // have been chosen - initMaterial(n, o, w, p) { - n.addEventListener("dispose", this.onMaterialDispose.bind(this)); + initMaterial(s, o, w, p) { + s.addEventListener("dispose", this.onMaterialDispose.bind(this)); var v, a; - if (a = n.shaderID, a) { + if (a = s.shaderID, a) { var l = C.ShaderLib[a]; - n.vertexShader = l.vertexShader, n.fragmentShader = l.fragmentShader, n.uniforms = C.ShaderUtils.clone(l.uniforms); + s.vertexShader = l.vertexShader, s.fragmentShader = l.fragmentShader, s.uniforms = C.ShaderUtils.clone(l.uniforms); } v = { - wireframe: n.wireframe, - fragdepth: n.imposter, - volumetric: n.volumetric - }, n.program = this.buildProgram(n.fragmentShader, n.vertexShader, n.uniforms, v); + wireframe: s.wireframe, + fragdepth: s.imposter, + volumetric: s.volumetric + }, s.program = this.buildProgram(s.fragmentShader, s.vertexShader, s.uniforms, v); } - renderBuffer(n, o, w, p, v, a) { + renderBuffer(s, o, w, p, v, a) { if (p.visible) { var l, g; - if (l = this.setProgram(n, o, w, p, a, this), !!l) { + if (l = this.setProgram(s, o, w, p, a, this), !!l) { g = l.attributes; var M = !1, L = p.wireframe ? 1 : 0, T = v.id * 16777215 + l.id * 2 + L; T !== this._currentGeometryGroupHash && (this._currentGeometryGroupHash = T, M = !0), M && (this.disableAttributes(), g.position >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglVertexBuffer), this.enableAttribute(g.position), this._gl.vertexAttribPointer(g.position, 3, this._gl.FLOAT, !1, 0, 0)), g.color >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglColorBuffer), this.enableAttribute(g.color), this._gl.vertexAttribPointer(g.color, 3, this._gl.FLOAT, !1, 0, 0)), g.normal >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglNormalBuffer), this.enableAttribute(g.normal), this._gl.vertexAttribPointer(g.normal, 3, this._gl.FLOAT, !1, 0, 0)), g.offset >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglOffsetBuffer), this.enableAttribute(g.offset), this._gl.vertexAttribPointer(g.offset, 3, this._gl.FLOAT, !1, 0, 0)), g.radius >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglRadiusBuffer), this.enableAttribute(g.radius), this._gl.vertexAttribPointer(g.radius, 1, this._gl.FLOAT, !1, 0, 0))); - var D, R; + var D, I; if (a instanceof c.Mesh) { if (p.shaderID === "instanced") { - var B = p.sphere.geometryGroups[0]; - M && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, B.vertexArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, B.normalArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, v.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, B.faceArray, this._gl.STATIC_DRAW)), D = B.faceidx, this._extInstanced.vertexAttribDivisorANGLE(g.offset, 1), this._extInstanced.vertexAttribDivisorANGLE(g.radius, 1), this._extInstanced.vertexAttribDivisorANGLE(g.color, 1), this._extInstanced.drawElementsInstancedANGLE(this._gl.TRIANGLES, D, this._gl.UNSIGNED_SHORT, 0, v.radiusArray.length), this._extInstanced.vertexAttribDivisorANGLE(g.offset, 0), this._extInstanced.vertexAttribDivisorANGLE(g.radius, 0), this._extInstanced.vertexAttribDivisorANGLE(g.color, 0); + var z = p.sphere.geometryGroups[0]; + M && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, z.vertexArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, v.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, z.normalArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, v.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, z.faceArray, this._gl.STATIC_DRAW)), D = z.faceidx, this._extInstanced.vertexAttribDivisorANGLE(g.offset, 1), this._extInstanced.vertexAttribDivisorANGLE(g.radius, 1), this._extInstanced.vertexAttribDivisorANGLE(g.color, 1), this._extInstanced.drawElementsInstancedANGLE(this._gl.TRIANGLES, D, this._gl.UNSIGNED_SHORT, 0, v.radiusArray.length), this._extInstanced.vertexAttribDivisorANGLE(g.offset, 0), this._extInstanced.vertexAttribDivisorANGLE(g.radius, 0), this._extInstanced.vertexAttribDivisorANGLE(g.color, 0); } else - p.wireframe ? (R = v.lineidx, this.setLineWidth(p.wireframeLinewidth), M && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, v.__webglLineBuffer), this._gl.drawElements(this._gl.LINES, R, this._gl.UNSIGNED_SHORT, 0)) : (D = v.faceidx, M && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, v.__webglFaceBuffer), this._gl.drawElements(this._gl.TRIANGLES, D, this._gl.UNSIGNED_SHORT, 0)); + p.wireframe ? (I = v.lineidx, this.setLineWidth(p.wireframeLinewidth), M && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, v.__webglLineBuffer), this._gl.drawElements(this._gl.LINES, I, this._gl.UNSIGNED_SHORT, 0)) : (D = v.faceidx, M && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, v.__webglFaceBuffer), this._gl.drawElements(this._gl.TRIANGLES, D, this._gl.UNSIGNED_SHORT, 0)); this.info.render.calls++, this.info.render.vertices += D, this.info.render.faces += D / 3; } else - a instanceof c.Line && (R = v.vertices, this.setLineWidth(p.linewidth), this._gl.drawArrays(this._gl.LINES, 0, R), this.info.render.calls++); + a instanceof c.Line && (I = v.vertices, this.setLineWidth(p.linewidth), this._gl.drawArrays(this._gl.LINES, 0, I), this.info.render.calls++); } } } - render(n, o, w) { - if (!(o instanceof s.Camera)) { + render(s, o, w) { + if (!(o instanceof n.Camera)) { console.error("Renderer.render: camera is not an instance of Camera."); return; } - var p, v, a, l, g, M = n.__lights, L = n.fog; - this._currentMaterialId = -1, this._lightsNeedUpdate = !0, this.autoUpdateScene && n.updateMatrixWorld(), o.parent === void 0 && o.updateMatrixWorld(), o.matrixWorldInverse.getInverse(o.matrixWorld), this._projScreenMatrix.multiplyMatrices(o.projectionMatrix, o.matrixWorldInverse), this.autoUpdateObjects && this.initWebGLObjects(n), this.info.render.calls = 0, this.info.render.vertices = 0, this.info.render.faces = 0, this.info.render.points = 0, this._currentWidth = this._viewportWidth, this._currentHeight = this._viewportHeight, this.setViewport(), this.setFrameBuffer(), (this.autoClear || w) && (this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha), this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil)), g = n.__webglObjects; + var p, v, a, l, g, M = s.__lights, L = s.fog; + this._currentMaterialId = -1, this._lightsNeedUpdate = !0, this.autoUpdateScene && s.updateMatrixWorld(), o.parent === void 0 && o.updateMatrixWorld(), o.matrixWorldInverse.getInverse(o.matrixWorld), this._projScreenMatrix.multiplyMatrices(o.projectionMatrix, o.matrixWorldInverse), this.autoUpdateObjects && this.initWebGLObjects(s), this.info.render.calls = 0, this.info.render.vertices = 0, this.info.render.faces = 0, this.info.render.points = 0, this._currentWidth = this._viewportWidth, this._currentHeight = this._viewportHeight, this.setViewport(), this.setFrameBuffer(), (this.autoClear || w) && (this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha), this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil)), g = s.__webglObjects; var T = !1; for (p = 0, v = g.length; p < v; p++) a = g[p], l = a.object, a.render = !1, l.visible && (this.setupMatrices(l, o), this.unrollBufferMaterial(a), a.render = !0, a.volumetric && (T = !0)); var D = null; - this.setBlending(!1), this.renderObjects(n.__webglObjects, !0, "opaque", o, M, L, !1, D), this.renderSprites(n, o, !1), this.renderObjects(n.__webglObjects, !0, "blank", o, M, L, !0, D), this.renderObjects(n.__webglObjects, !1, "transparent", o, M, L, !0, D), T && this._fb && (this.reinitFrameBuffer(), this.renderObjects(n.__webglObjects, !1, "volumetric", o, M, L, !0, D)), this.renderFrameBuffertoScreen(), this.setDepthTest(!0), this.setDepthWrite(!0), this.renderSprites(n, o, !0); + this.setBlending(!1), this.renderObjects(s.__webglObjects, !0, "opaque", o, M, L, !1, D), this.renderSprites(s, o, !1), this.renderObjects(s.__webglObjects, !0, "blank", o, M, L, !0, D), this.renderObjects(s.__webglObjects, !1, "transparent", o, M, L, !0, D), T && this._fb && (this.reinitFrameBuffer(), this.renderObjects(s.__webglObjects, !1, "volumetric", o, M, L, !0, D)), this.renderFrameBuffertoScreen(), this.setDepthTest(!0), this.setDepthWrite(!0), this.renderSprites(s, o, !0); } //reinitialize framebuffer without the depth texture attached so we can read to it //do not allocate new textures @@ -11147,15 +11147,15 @@ ATOM`, g); setFrameBuffer() { if (this.isWebGL1() || !this._fb) return; - let n = this._viewportWidth, o = this._viewportHeight; - this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(0, 0, n, o), this._gl.viewport(0, 0, n, o), this._gl.bindTexture(this._gl.TEXTURE_2D, this._targetTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, n, o, 0, this._gl.RGBA, this._gl.UNSIGNED_BYTE, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.bindTexture(this._gl.TEXTURE_2D, this._depthTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.DEPTH_COMPONENT32F, n, o, 0, this._gl.DEPTH_COMPONENT, this._gl.FLOAT, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, this._fb), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.COLOR_ATTACHMENT0, this._gl.TEXTURE_2D, this._targetTexture, 0), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._depthTexture, 0); + let s = this._viewportWidth, o = this._viewportHeight; + this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(0, 0, s, o), this._gl.viewport(0, 0, s, o), this._gl.bindTexture(this._gl.TEXTURE_2D, this._targetTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, s, o, 0, this._gl.RGBA, this._gl.UNSIGNED_BYTE, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.bindTexture(this._gl.TEXTURE_2D, this._depthTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.DEPTH_COMPONENT32F, s, o, 0, this._gl.DEPTH_COMPONENT, this._gl.FLOAT, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, this._fb), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.COLOR_ATTACHMENT0, this._gl.TEXTURE_2D, this._targetTexture, 0), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._depthTexture, 0); } //allocate buffers for framebuffer, needs to be called with every resize initFrameBuffer() { if (this.isWebGL1()) return; - let n = this._viewportWidth, o = this._viewportHeight; - this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(0, 0, n, o), this._gl.viewport(0, 0, n, o), this._targetTexture = this._gl.createTexture(), this._depthTexture = this._gl.createTexture(), this._fb = this._gl.createFramebuffer(); + let s = this._viewportWidth, o = this._viewportHeight; + this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(0, 0, s, o), this._gl.viewport(0, 0, s, o), this._targetTexture = this._gl.createTexture(), this._depthTexture = this._gl.createTexture(), this._fb = this._gl.createFramebuffer(); var w = C.ShaderLib.screen; this._screenshader = this.buildProgram(w.fragmentShader, w.vertexShader, w.uniforms, {}), this._vertexattribpos = this._gl.getAttribLocation(this._screenshader, "vertexPosition"); var p = [ @@ -11179,16 +11179,16 @@ ATOM`, g); renderFrameBuffertoScreen() { this.isWebGL1() || this._fb === null || (this.setViewport(), this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, null), this._gl.clear(this._gl.COLOR_BUFFER_BIT | this._gl.DEPTH_BUFFER_BIT), this._gl.frontFace(this._gl.CCW), this._gl.cullFace(this._gl.BACK), this._gl.useProgram(this._screenshader), this._currentProgram = this._screenshader, this.setDepthTest(-1), this.setDepthWrite(-1), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, this._screenQuadVBO), this._gl.enableVertexAttribArray(this._vertexattribpos), this._gl.vertexAttribPointer(this._vertexattribpos, 2, this._gl.FLOAT, !1, 0, 0), this._gl.activeTexture(this._gl.TEXTURE0), this._gl.bindTexture(this._gl.TEXTURE_2D, this._targetTexture), this._gl.drawArrays(this._gl.TRIANGLES, 0, 6)); } - initWebGLObjects(n) { - if (n.__webglObjects || (n.__webglObjects = [], n.__webglObjectsImmediate = [], n.__webglSprites = [], n.__webglFlares = []), n.__objectsAdded.length) { - for (; n.__objectsAdded.length; ) - this.addObject(n.__objectsAdded[0], n), n.__objectsAdded.splice(0, 1); + initWebGLObjects(s) { + if (s.__webglObjects || (s.__webglObjects = [], s.__webglObjectsImmediate = [], s.__webglSprites = [], s.__webglFlares = []), s.__objectsAdded.length) { + for (; s.__objectsAdded.length; ) + this.addObject(s.__objectsAdded[0], s), s.__objectsAdded.splice(0, 1); this._currentGeometryGroupHash = -1; } - for (; n.__objectsRemoved.length; ) - this.removeObject(n.__objectsRemoved[0], n), n.__objectsRemoved.splice(0, 1); - for (var o = 0, w = n.__webglObjects.length; o < w; o++) - this.updateObject(n.__webglObjects[o].object); + for (; s.__objectsRemoved.length; ) + this.removeObject(s.__objectsRemoved[0], s), s.__objectsRemoved.splice(0, 1); + for (var o = 0, w = s.__webglObjects.length; o < w; o++) + this.updateObject(s.__webglObjects[o].object); } getYRatio() { return this.rows !== void 0 && this.row !== void 0 ? this.rows : 1; @@ -11196,58 +11196,58 @@ ATOM`, g); getXRatio() { return this.cols !== void 0 && this.col !== void 0 ? this.cols : 1; } - getAspect(n, o) { - (n == null || o == null) && (n = this._canvas.width, o = this._canvas.height); - var w = n / o; + getAspect(s, o) { + (s == null || o == null) && (s = this._canvas.width, o = this._canvas.height); + var w = s / o; if (this.rows != null && this.cols != null && this.row != null && this.col != null) { - var p = n / this.cols, v = o / this.rows; + var p = s / this.cols, v = o / this.rows; w = p / v; } return w; } - setTexture(n, o, w) { - if (n.needsUpdate) { - n.__webglInit || (n.__webglInit = !0, n.addEventListener("dispose", this.onTextureDispose.bind(this)), n.__webglTexture = this._gl.createTexture(), this.info.memory.textures++), this._gl.activeTexture(this._gl.TEXTURE0 + o); + setTexture(s, o, w) { + if (s.needsUpdate) { + s.__webglInit || (s.__webglInit = !0, s.addEventListener("dispose", this.onTextureDispose.bind(this)), s.__webglTexture = this._gl.createTexture(), this.info.memory.textures++), this._gl.activeTexture(this._gl.TEXTURE0 + o); var p = w ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D; - this._gl.bindTexture(p, n.__webglTexture), this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, n.flipY), this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, n.premultiplyAlpha), this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, n.unpackAlignment), this._gl.pixelStorei(this._gl.PACK_ALIGNMENT, n.unpackAlignment); - var v = this.paramToGL(n.format), a = this.paramToGL(n.type); + this._gl.bindTexture(p, s.__webglTexture), this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, s.flipY), this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, s.premultiplyAlpha), this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, s.unpackAlignment), this._gl.pixelStorei(this._gl.PACK_ALIGNMENT, s.unpackAlignment); + var v = this.paramToGL(s.format), a = this.paramToGL(s.type); if (w) - this.setTextureParameters(this._gl.TEXTURE_3D, n), this._gl.texImage3D(this._gl.TEXTURE_3D, 0, this._gl.R32F, n.image.size.z, n.image.size.y, n.image.size.x, 0, this._gl.RED, this._gl.FLOAT, n.image.data); + this.setTextureParameters(this._gl.TEXTURE_3D, s), this._gl.texImage3D(this._gl.TEXTURE_3D, 0, this._gl.R32F, s.image.size.z, s.image.size.y, s.image.size.x, 0, this._gl.RED, this._gl.FLOAT, s.image.data); else { - var l = n.image, g = l.width, M = l.height; - typeof g > "u" && (g = l.length, v == this._gl.RGBA && (g /= 4), M = 1), this.setTextureParameters(this._gl.TEXTURE_2D, n), this.isWebGL1() ? this._gl.texImage2D(this._gl.TEXTURE_2D, 0, v, v, a, n.image) : this._gl.texImage2D(this._gl.TEXTURE_2D, 0, v, g, M, 0, v, a, n.image); + var l = s.image, g = l.width, M = l.height; + typeof g > "u" && (g = l.length, v == this._gl.RGBA && (g /= 4), M = 1), this.setTextureParameters(this._gl.TEXTURE_2D, s), this.isWebGL1() ? this._gl.texImage2D(this._gl.TEXTURE_2D, 0, v, v, a, s.image) : this._gl.texImage2D(this._gl.TEXTURE_2D, 0, v, g, M, 0, v, a, s.image); } - n.needsUpdate = !1, n.onUpdate && n.onUpdate(); + s.needsUpdate = !1, s.onUpdate && s.onUpdate(); } else - this._gl.activeTexture(this._gl.TEXTURE0 + o), w ? this._gl.bindTexture(this._gl.TEXTURE_3D, n.__webglTexture) : this._gl.bindTexture(this._gl.TEXTURE_2D, n.__webglTexture); + this._gl.activeTexture(this._gl.TEXTURE0 + o), w ? this._gl.bindTexture(this._gl.TEXTURE_3D, s.__webglTexture) : this._gl.bindTexture(this._gl.TEXTURE_2D, s.__webglTexture); } supportsVolumetric() { return !this.isWebGL1(); } - enableAttribute(n) { - this._enabledAttributes[n] || (this._gl.enableVertexAttribArray(n), this._enabledAttributes[n] = !0); + enableAttribute(s) { + this._enabledAttributes[s] || (this._gl.enableVertexAttribArray(s), this._enabledAttributes[s] = !0); } disableAttributes() { - for (let n in this._enabledAttributes) - this._enabledAttributes[n] && (this._gl.disableVertexAttribArray(n), this._enabledAttributes[n] = !1); + for (let s in this._enabledAttributes) + this._enabledAttributes[s] && (this._gl.disableVertexAttribArray(s), this._enabledAttributes[s] = !1); } - setPolygonOffset(n, o, w) { - this._oldPolygonOffset !== n && (n ? this._gl.enable(this._gl.POLYGON_OFFSET_FILL) : this._gl.disable(this._gl.POLYGON_OFFSET_FILL)); + setPolygonOffset(s, o, w) { + this._oldPolygonOffset !== s && (s ? this._gl.enable(this._gl.POLYGON_OFFSET_FILL) : this._gl.disable(this._gl.POLYGON_OFFSET_FILL)); } - setLineWidth(n) { - n !== this._oldLineWidth && (this._gl.lineWidth(n), this._oldLineWidth = n); + setLineWidth(s) { + s !== this._oldLineWidth && (this._gl.lineWidth(s), this._oldLineWidth = s); } - deallocateGeometry(n) { - if (n.__webglInit = void 0, n.__webglVertexBuffer !== void 0 && this._gl.deleteBuffer(n.__webglVertexBuffer), n.__webglColorBuffer !== void 0 && this._gl.deleteBuffer(n.__webglColorBuffer), n.geometryGroups !== void 0) - for (var o = 0, w = n.groups; o < w; o++) { - var p = n.geometryGroups[o]; + deallocateGeometry(s) { + if (s.__webglInit = void 0, s.__webglVertexBuffer !== void 0 && this._gl.deleteBuffer(s.__webglVertexBuffer), s.__webglColorBuffer !== void 0 && this._gl.deleteBuffer(s.__webglColorBuffer), s.geometryGroups !== void 0) + for (var o = 0, w = s.groups; o < w; o++) { + var p = s.geometryGroups[o]; p.__webglVertexBuffer !== void 0 && this._gl.deleteBuffer(p.__webglVertexBuffer), p.__webglColorBuffer !== void 0 && this._gl.deleteBuffer(p.__webglColorBuffer), p.__webglNormalBuffer !== void 0 && this._gl.deleteBuffer(p.__webglNormalBuffer), p.__webglFaceBuffer !== void 0 && this._gl.deleteBuffer(p.__webglFaceBuffer), p.__webglLineBuffer !== void 0 && this._gl.deleteBuffer(p.__webglLineBuffer); } } - deallocateMaterial(n) { - var o = n.program; + deallocateMaterial(s) { + var o = s.program; if (o !== void 0) { - n.program = void 0; + s.program = void 0; var w, p, v, a = !1; for (w = 0, p = this._programs.length; w < p; w++) if (v = this._programs[w], v.program === o) { @@ -11262,38 +11262,38 @@ ATOM`, g); } } } - deallocateTexture(n) { - if (n.image && n.image.__webglTextureCube) - this._gl.deleteTexture(n.image.__webglTextureCube); + deallocateTexture(s) { + if (s.image && s.image.__webglTextureCube) + this._gl.deleteTexture(s.image.__webglTextureCube); else { - if (!n.__webglInit) + if (!s.__webglInit) return; - n.__webglInit = !1, this._gl.deleteTexture(n.__webglTexture); + s.__webglInit = !1, this._gl.deleteTexture(s.__webglTexture); } } - onGeometryDispose(n) { - var o = n.target; + onGeometryDispose(s) { + var o = s.target; o.removeEventListener("dispose", this.onGeometryDispose), this.deallocateGeometry(o), this.info.memory.geometries--; } - onTextureDispose(n) { - var o = n.target; + onTextureDispose(s) { + var o = s.target; o.removeEventListener("dispose", this.onTextureDispose), this.deallocateTexture(o), this.info.memory.textures--; } - onMaterialDispose(n) { - var o = n.target; + onMaterialDispose(s) { + var o = s.target; o.removeEventListener("dispose", this.onMaterialDispose), this.deallocateMaterial(o); } // Compile and return shader - getShader(n, o) { + getShader(s, o) { var w; - return !this.isWebGL1() && !o.startsWith("#version") && (o = o.replace(/gl_FragDepthEXT/g, "gl_FragDepth"), n == "fragment" ? o = o.replace(/varying/g, "in") : o = o.replace(/varying/g, "out"), o = o.replace(/attribute/g, "in"), o = o.replace(/texture2D/g, "texture"), o = o.replace(/\/\/DEFINEFRAGCOLOR/g, "out vec4 glFragColor;"), o = o.replace(/gl_FragColor/g, "glFragColor"), o = `#version 300 es -` + o), n === "fragment" ? w = this._gl.createShader(this._gl.FRAGMENT_SHADER) : n === "vertex" && (w = this._gl.createShader(this._gl.VERTEX_SHADER)), w == null ? null : (this._gl.shaderSource(w, o), this._gl.compileShader(w), this._gl.getShaderParameter(w, this._gl.COMPILE_STATUS) ? w : (console.error(this._gl.getShaderInfoLog(w)), console.error("could not initialize shader"), null)); + return !this.isWebGL1() && !o.startsWith("#version") && (o = o.replace(/gl_FragDepthEXT/g, "gl_FragDepth"), s == "fragment" ? o = o.replace(/varying/g, "in") : o = o.replace(/varying/g, "out"), o = o.replace(/attribute/g, "in"), o = o.replace(/texture2D/g, "texture"), o = o.replace(/\/\/DEFINEFRAGCOLOR/g, "out vec4 glFragColor;"), o = o.replace(/gl_FragColor/g, "glFragColor"), o = `#version 300 es +` + o), s === "fragment" ? w = this._gl.createShader(this._gl.FRAGMENT_SHADER) : s === "vertex" && (w = this._gl.createShader(this._gl.VERTEX_SHADER)), w == null ? null : (this._gl.shaderSource(w, o), this._gl.compileShader(w), this._gl.getShaderParameter(w, this._gl.COMPILE_STATUS) ? w : (console.error(this._gl.getShaderInfoLog(w)), console.error("could not initialize shader"), null)); } // Compile appropriate shaders (if necessary) from source code and attach to // gl program. - buildProgram(n, o, w, p) { + buildProgram(s, o, w, p) { var v, a, l, g, M = []; - M.push(n), M.push(o); + M.push(s), M.push(o); for (v in p) M.push(v), M.push(p[v]); for (g = M.join(), v = 0, a = this._programs.length; v < a; v++) { @@ -11305,18 +11305,18 @@ ATOM`, g); throw new Error("Volumetric rendering requires webgl2 which is not supported by your hardware."); if (l = this._gl.createProgram(), l == null) return null; - var T = this._precision, D = "precision " + T + " float;", R = [ + var T = this._precision, D = "precision " + T + " float;", I = [ p.volumetric ? "#version 300 es" : "", D ].join(` -`), B = [ +`), z = [ p.volumetric ? "#version 300 es" : "", p.fragdepth && this.isWebGL1() ? "#extension GL_EXT_frag_depth: enable" : "", p.wireframe ? "#define WIREFRAME 1" : "", D ].join(` -`), P = this.getShader("fragment", B + n), z = this.getShader("vertex", R + o); - z != null && this._gl.attachShader(l, z), P != null && this._gl.attachShader(l, P), this._gl.linkProgram(l), this._gl.getProgramParameter(l, this._gl.LINK_STATUS) || console.error("Could not initialize shader"), l.uniforms = {}, l.attributes = {}; +`), P = this.getShader("fragment", z + s), B = this.getShader("vertex", I + o); + B != null && this._gl.attachShader(l, B), P != null && this._gl.attachShader(l, P), this._gl.linkProgram(l), this._gl.getProgramParameter(l, this._gl.LINK_STATUS) || console.error("Could not initialize shader"), l.uniforms = {}, l.attributes = {}; var F, N, $; F = [ "viewMatrix", @@ -11347,17 +11347,17 @@ ATOM`, g); usedTimes: 1 }), this.info.memory.programs = this._programs.length, l; } - setProgram(n, o, w, p, v, a) { + setProgram(s, o, w, p, v, a) { if (p.needsUpdate && (p.program && this.deallocateMaterial(p), this.initMaterial(p, o, w, v), p.needsUpdate = !1), p.program == null) return null; var l = !1, g = p.program, M = g.uniforms, L = p.uniforms; - if (g != this._currentProgram && (this._gl.useProgram(g), this._currentProgram = g, l = !0), p.id != this._currentMaterialId && (this._currentMaterialId = p.id, l = !0), n != this._currentCamera && (this._currentCamera = n, l = !0), this._gl.uniformMatrix4fv(M.projectionMatrix, !1, n.projectionMatrix.elements), this._gl.uniformMatrix4fv(M.modelViewMatrix, !1, v._modelViewMatrix.elements), this._gl.uniformMatrix3fv(M.normalMatrix, !1, v._normalMatrix.elements), l) { + if (g != this._currentProgram && (this._gl.useProgram(g), this._currentProgram = g, l = !0), p.id != this._currentMaterialId && (this._currentMaterialId = p.id, l = !0), s != this._currentCamera && (this._currentCamera = s, l = !0), this._gl.uniformMatrix4fv(M.projectionMatrix, !1, s.projectionMatrix.elements), this._gl.uniformMatrix4fv(M.modelViewMatrix, !1, v._modelViewMatrix.elements), this._gl.uniformMatrix3fv(M.normalMatrix, !1, v._normalMatrix.elements), l) { if (L.fogColor.value = w.color, L.fogNear.value = w.near, L.fogFar.value = w.far, p.shaderID.startsWith("lambert") || p.shaderID === "instanced" || p.shaderID.endsWith("imposter")) - this._gl.uniformMatrix4fv(M.viewMatrix, !1, n.matrixWorldInverse.elements), this._lightsNeedUpdate && (this.setupLights(g, o), this._lightsNeedUpdate = !1), L.directionalLightColor.value = this._lights.directional.colors, L.directionalLightDirection.value = this._lights.directional.positions; + this._gl.uniformMatrix4fv(M.viewMatrix, !1, s.matrixWorldInverse.elements), this._lightsNeedUpdate && (this.setupLights(g, o), this._lightsNeedUpdate = !1), L.directionalLightColor.value = this._lights.directional.colors, L.directionalLightDirection.value = this._lights.directional.positions; else if (p.shaderID.endsWith("outline")) L.outlineColor.value = p.outlineColor, L.outlineWidth.value = p.outlineWidth, L.outlinePushback.value = p.outlinePushback; else if (p.shaderID === "volumetric") { - v._modelViewMatrix.getScale(this._direction), this._worldInverse.getInverse(v._modelViewMatrix), this._projInverse.getInverse(n.projectionMatrix), this._textureMatrix.multiplyMatrices(v.material.texmatrix, this._worldInverse), this._gl.uniformMatrix4fv(M.textmat, !1, this._textureMatrix.elements), this._gl.uniformMatrix4fv(M.projinv, !1, this._projInverse.elements); + v._modelViewMatrix.getScale(this._direction), this._worldInverse.getInverse(v._modelViewMatrix), this._projInverse.getInverse(s.projectionMatrix), this._textureMatrix.multiplyMatrices(v.material.texmatrix, this._worldInverse), this._gl.uniformMatrix4fv(M.textmat, !1, this._textureMatrix.elements), this._gl.uniformMatrix4fv(M.projinv, !1, this._projInverse.elements); let T = Math.min(Math.min(this._direction.x, this._direction.y), this._direction.z); L.step.value = v.material.unit * T, L.maxdepth.value = v.material.maxdepth * T, L.transfermax.value = v.material.transfermax, L.transfermin.value = v.material.transfermin, L.subsamples.value = v.material.subsamples, a.setTexture(v.material.transferfn, 4, !1), a.setTexture(v.material.map, 3, !0), this._gl.activeTexture(this._gl.TEXTURE5), this._gl.bindTexture(this._gl.TEXTURE_2D, this._depthTexture); } @@ -11365,112 +11365,112 @@ ATOM`, g); } return g; } - loadMaterialUniforms(n, o) { + loadMaterialUniforms(s, o) { var w, p, v, a; for (w in o) - n[w] && (p = o[w].type, v = o[w].value, a = n[w], p === "f" ? this._gl.uniform1f(a, v) : p === "i" ? this._gl.uniform1i(a, v) : p === "fv" ? this._gl.uniform3fv(a, v) : p === "c" ? this._gl.uniform3f(a, v.r, v.g, v.b) : p === "f4" && this._gl.uniform4f(a, v[0], v[1], v[2], v[3])); + s[w] && (p = o[w].type, v = o[w].value, a = s[w], p === "f" ? this._gl.uniform1f(a, v) : p === "i" ? this._gl.uniform1i(a, v) : p === "fv" ? this._gl.uniform3fv(a, v) : p === "c" ? this._gl.uniform3f(a, v.r, v.g, v.b) : p === "f4" && this._gl.uniform4f(a, v[0], v[1], v[2], v[3])); } // Objects adding - addObject(n, o) { + addObject(s, o) { var w, p, v, a; - if (!n.__webglInit && (n.__webglInit = !0, n._modelViewMatrix = new E.Matrix4(), n._normalMatrix = new E.Matrix3(), n.geometry !== void 0 && n.geometry.__webglInit === void 0 && (n.geometry.__webglInit = !0, n.geometry.addEventListener("dispose", this.onGeometryDispose.bind(this))), n instanceof c.Mesh || n instanceof c.Line)) - for (v = n.geometry, w = 0, p = v.geometryGroups.length; w < p; w++) - a = v.geometryGroups[w], a.id = this._geometryGroupCounter++, a.__webglVertexBuffer || (n instanceof c.Mesh ? (this.createMeshBuffers(a), v.elementsNeedUpdate = !0, v.normalsNeedUpdate = !0) : n instanceof c.Line && this.createLineBuffers(a), v.verticesNeedUpdate = !0, v.colorsNeedUpdate = !0); - if (!n.__webglActive) { - if (n instanceof c.Mesh || n instanceof c.Line) - for (v = n.geometry, w = 0, p = v.geometryGroups.length; w < p; w++) - a = v.geometryGroups[w], this.addBuffer(o.__webglObjects, a, n); + if (!s.__webglInit && (s.__webglInit = !0, s._modelViewMatrix = new E.Matrix4(), s._normalMatrix = new E.Matrix3(), s.geometry !== void 0 && s.geometry.__webglInit === void 0 && (s.geometry.__webglInit = !0, s.geometry.addEventListener("dispose", this.onGeometryDispose.bind(this))), s instanceof c.Mesh || s instanceof c.Line)) + for (v = s.geometry, w = 0, p = v.geometryGroups.length; w < p; w++) + a = v.geometryGroups[w], a.id = this._geometryGroupCounter++, a.__webglVertexBuffer || (s instanceof c.Mesh ? (this.createMeshBuffers(a), v.elementsNeedUpdate = !0, v.normalsNeedUpdate = !0) : s instanceof c.Line && this.createLineBuffers(a), v.verticesNeedUpdate = !0, v.colorsNeedUpdate = !0); + if (!s.__webglActive) { + if (s instanceof c.Mesh || s instanceof c.Line) + for (v = s.geometry, w = 0, p = v.geometryGroups.length; w < p; w++) + a = v.geometryGroups[w], this.addBuffer(o.__webglObjects, a, s); else - n instanceof c.Sprite && o.__webglSprites.push(n); - n.__webglActive = !0; + s instanceof c.Sprite && o.__webglSprites.push(s); + s.__webglActive = !0; } } - updateObject(n) { - var o = n.geometry, w; - if (n instanceof c.Mesh || n instanceof c.Line) { + updateObject(s) { + var o = s.geometry, w; + if (s instanceof c.Mesh || s instanceof c.Line) { for (var p = 0, v = o.geometryGroups.length; p < v; p++) w = o.geometryGroups[p], (o.verticesNeedUpdate || o.elementsNeedUpdate || o.colorsNeedUpdate || o.normalsNeedUpdate) && this.setBuffers(w, this._gl.STATIC_DRAW); o.verticesNeedUpdate = !1, o.elementsNeedUpdate = !1, o.normalsNeedUpdate = !1, o.colorsNeedUpdate = !1, o.buffersNeedUpdate = !1; } } - removeObject(n, o) { - n instanceof c.Mesh || n instanceof c.Line ? this.removeInstances(o.__webglObjects, n) : n instanceof c.Sprite && this.removeInstancesDirect(o.__webglSprites, n), n.__webglActive = !1; + removeObject(s, o) { + s instanceof c.Mesh || s instanceof c.Line ? this.removeInstances(o.__webglObjects, s) : s instanceof c.Sprite && this.removeInstancesDirect(o.__webglSprites, s), s.__webglActive = !1; } - removeInstances(n, o) { - for (var w = n.length - 1; w >= 0; --w) - n[w].object === o && n.splice(w, 1); + removeInstances(s, o) { + for (var w = s.length - 1; w >= 0; --w) + s[w].object === o && s.splice(w, 1); } - removeInstancesDirect(n, o) { - for (var w = n.length - 1; w >= 0; --w) - n[w] === o && n.splice(w, 1); + removeInstancesDirect(s, o) { + for (var w = s.length - 1; w >= 0; --w) + s[w] === o && s.splice(w, 1); } - unrollBufferMaterial(n) { - var o = n.object, w = o.material; + unrollBufferMaterial(s) { + var o = s.object, w = o.material; if (w.volumetric) - n.opaque = null, n.transparent = null, n.volumetric = w; + s.opaque = null, s.transparent = null, s.volumetric = w; else if (w.transparent) { - if (n.opaque = null, n.volumetric = null, n.transparent = w, !w.wireframe) { + if (s.opaque = null, s.volumetric = null, s.transparent = w, !w.wireframe) { var p = w.clone(); - p.opacity = 0, n.blank = p; + p.opacity = 0, s.blank = p; } } else - n.opaque = w, n.transparent = null, n.volumetric = null; + s.opaque = w, s.transparent = null, s.volumetric = null; } - setBuffers(n, o) { - var w = n.vertexArray, p = n.colorArray; - if (n.__webglOffsetBuffer !== void 0 ? (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, n.__webglOffsetBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, w, o)) : (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, n.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, w, o)), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, n.__webglColorBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, p, o), n.normalArray && n.__webglNormalBuffer !== void 0) { - var v = n.normalArray; - this._gl.bindBuffer(this._gl.ARRAY_BUFFER, n.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, v, o); + setBuffers(s, o) { + var w = s.vertexArray, p = s.colorArray; + if (s.__webglOffsetBuffer !== void 0 ? (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, s.__webglOffsetBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, w, o)) : (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, s.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, w, o)), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, s.__webglColorBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, p, o), s.normalArray && s.__webglNormalBuffer !== void 0) { + var v = s.normalArray; + this._gl.bindBuffer(this._gl.ARRAY_BUFFER, s.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, v, o); } - if (n.radiusArray && n.__webglRadiusBuffer !== void 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, n.__webglRadiusBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, n.radiusArray, o)), n.faceArray && n.__webglFaceBuffer !== void 0) { - var a = n.faceArray; - this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, n.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, a, o); + if (s.radiusArray && s.__webglRadiusBuffer !== void 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, s.__webglRadiusBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, s.radiusArray, o)), s.faceArray && s.__webglFaceBuffer !== void 0) { + var a = s.faceArray; + this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, s.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, a, o); } - if (n.lineArray && n.__webglLineBuffer !== void 0) { - var l = n.lineArray; - this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, n.__webglLineBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, l, o); + if (s.lineArray && s.__webglLineBuffer !== void 0) { + var l = s.lineArray; + this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, s.__webglLineBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, l, o); } } // Creates appropriate gl buffers for geometry chunk // TODO: do we need line buffer for mesh objects? // Also, can we integrate this with createLineBuffers? - createMeshBuffers(n) { - n.radiusArray && (n.__webglRadiusBuffer = this._gl.createBuffer()), n.useOffset && (n.__webglOffsetBuffer = this._gl.createBuffer()), n.__webglVertexBuffer = this._gl.createBuffer(), n.__webglNormalBuffer = this._gl.createBuffer(), n.__webglColorBuffer = this._gl.createBuffer(), n.__webglFaceBuffer = this._gl.createBuffer(), n.__webglLineBuffer = this._gl.createBuffer(), this.info.memory.geometries++; + createMeshBuffers(s) { + s.radiusArray && (s.__webglRadiusBuffer = this._gl.createBuffer()), s.useOffset && (s.__webglOffsetBuffer = this._gl.createBuffer()), s.__webglVertexBuffer = this._gl.createBuffer(), s.__webglNormalBuffer = this._gl.createBuffer(), s.__webglColorBuffer = this._gl.createBuffer(), s.__webglFaceBuffer = this._gl.createBuffer(), s.__webglLineBuffer = this._gl.createBuffer(), this.info.memory.geometries++; } - createLineBuffers(n) { - n.__webglVertexBuffer = this._gl.createBuffer(), n.__webglColorBuffer = this._gl.createBuffer(), this.info.memory.geometries++; + createLineBuffers(s) { + s.__webglVertexBuffer = this._gl.createBuffer(), s.__webglColorBuffer = this._gl.createBuffer(), this.info.memory.geometries++; } - addBuffer(n, o, w) { - n.push({ + addBuffer(s, o, w) { + s.push({ buffer: o, object: w, opaque: null, transparent: null }); } - setupMatrices(n, o) { - n._modelViewMatrix.multiplyMatrices(o.matrixWorldInverse, n.matrixWorld), n._normalMatrix.getInverse(n._modelViewMatrix), n._normalMatrix.transpose(); + setupMatrices(s, o) { + s._modelViewMatrix.multiplyMatrices(o.matrixWorldInverse, s.matrixWorld), s._normalMatrix.getInverse(s._modelViewMatrix), s._normalMatrix.transpose(); } // Fallback filters for non-power-of-2 textures - filterFallback(n) { + filterFallback(s) { return this._gl.LINEAR; } - setTextureParameters(n, o) { - n == this._gl.TEXTURE_2D ? (this._gl.texParameteri(n, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(n, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(n, this._gl.TEXTURE_MAG_FILTER, this.filterFallback(o.magFilter)), this._gl.texParameteri(n, this._gl.TEXTURE_MIN_FILTER, this.filterFallback(o.minFilter))) : (this._gl.texParameteri(n, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(n, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(n, this._gl.TEXTURE_WRAP_R, this._gl.CLAMP_TO_EDGE), this._extColorBufferFloat && this._extFloatLinear ? (this._gl.texParameteri(n, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(n, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR)) : (this._gl.texParameteri(n, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(n, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST))); + setTextureParameters(s, o) { + s == this._gl.TEXTURE_2D ? (this._gl.texParameteri(s, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(s, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(s, this._gl.TEXTURE_MAG_FILTER, this.filterFallback(o.magFilter)), this._gl.texParameteri(s, this._gl.TEXTURE_MIN_FILTER, this.filterFallback(o.minFilter))) : (this._gl.texParameteri(s, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(s, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(s, this._gl.TEXTURE_WRAP_R, this._gl.CLAMP_TO_EDGE), this._extColorBufferFloat && this._extFloatLinear ? (this._gl.texParameteri(s, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(s, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR)) : (this._gl.texParameteri(s, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(s, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST))); } // Map constants to WebGL constants - paramToGL(n) { - return n === _.UnsignedByteType ? this._gl.UNSIGNED_BYTE : n === _.RGBAFormat ? this._gl.RGBA : n === _.NearestFilter ? this._gl.NEAREST : 0; + paramToGL(s) { + return s === u.UnsignedByteType ? this._gl.UNSIGNED_BYTE : s === u.RGBAFormat ? this._gl.RGBA : s === u.NearestFilter ? this._gl.NEAREST : 0; } - setupLights(n, o) { - var w, p, v, a = 0, l = 0, g = 0, M, L, T = this._lights, D = T.directional.colors, R = T.directional.positions, B = 0, P = 0; + setupLights(s, o) { + var w, p, v, a = 0, l = 0, g = 0, M, L, T = this._lights, D = T.directional.colors, I = T.directional.positions, z = 0, P = 0; for (w = 0, p = o.length; w < p; w++) - if (v = o[w], M = v.color, L = v.intensity, v instanceof x.Light) { + if (v = o[w], M = v.color, L = v.intensity, v instanceof y.Light) { if (this._direction.getPositionFromMatrix(v.matrixWorld), this._vector3.getPositionFromMatrix(v.target.matrixWorld), this._direction.sub(this._vector3), this._direction.normalize(), this._direction.x === 0 && this._direction.y === 0 && this._direction.z === 0) continue; - R[P] = this._direction.x, R[P + 1] = this._direction.y, R[P + 2] = this._direction.z, D[P] = M.r * L, D[P + 1] = M.g * L, D[P + 2] = M.b * L, P += 3, B++; + I[P] = this._direction.x, I[P + 1] = this._direction.y, I[P + 2] = this._direction.z, D[P] = M.r * L, D[P + 1] = M.g * L, D[P + 2] = M.b * L, P += 3, z++; } - T.ambient[0] = a, T.ambient[1] = l, T.ambient[2] = g, T.directional.length = B; + T.ambient[0] = a, T.ambient[1] = l, T.ambient[2] = g, T.directional.length = z; } initGL() { try { @@ -11494,8 +11494,8 @@ ATOM`, g); preserveDrawingBuffer: this._preserveDrawingBuffer }))) throw "Error creating WebGL context."; - var n = this._gl.getParameter(this._gl.VERSION); - this._webglversion = parseInt(n[6]); + var s = this._gl.getParameter(this._gl.VERSION); + this._webglversion = parseInt(s[6]); } catch (o) { console.error(o); } @@ -11507,11 +11507,11 @@ ATOM`, g); this._gl.clearColor(0, 0, 0, 1), this._gl.clearDepth(1), this._gl.clearStencil(0), this._gl.enable(this._gl.DEPTH_TEST), this._gl.depthFunc(this._gl.LEQUAL), this._gl.frontFace(this._gl.CCW), this._gl.cullFace(this._gl.BACK), this._gl.enable(this._gl.CULL_FACE), this._gl.enable(this._gl.BLEND), this._gl.blendEquation(this._gl.FUNC_ADD), this._gl.blendFunc(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA), this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha); } // rendering - renderObjects(n, o, w, p, v, a, l, D) { - var M, L, T, D, R, B, P; - o ? (R = n.length - 1, B = -1, P = -1) : (R = 0, B = n.length, P = 1); - for (var z = R; z !== B; z += P) - if (M = n[z], M.render) { + renderObjects(s, o, w, p, v, a, l, D) { + var M, L, T, D, I, z, P; + o ? (I = s.length - 1, z = -1, P = -1) : (I = 0, z = s.length, P = 1); + for (var B = I; B !== z; B += P) + if (M = s[B], M.render) { if (L = M.object, T = M.buffer, D = M[w], !D) continue; l && this.setBlending(!0), this.setDepthTest(D.depthTest), this.setDepthWrite(D.depthWrite), this.setPolygonOffset(D.polygonOffset, D.polygonOffsetFactor, D.polygonOffsetUnits); @@ -11519,8 +11519,8 @@ ATOM`, g); this.setMaterialFaces(D, F), this.renderBuffer(p, v, a, D, T, L), (this._outlineEnabled || D.outline) && (D.shaderID == "sphereimposter" ? this.renderBuffer(p, v, a, this._outlineSphereImposterMaterial, T, L) : D.shaderID == "stickimposter" ? this.renderBuffer(p, v, a, this._outlineStickImposterMaterial, T, L) : !D.wireframe && D.shaderID !== "basic" && D.opacity !== 0 && this.renderBuffer(p, v, a, this._outlineMaterial, T, L)); } } - renderSprites(n, o, w) { - this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1, this._lightsNeedUpdate = !0, this.sprites.render(n, o, this._currentWidth, this._currentHeight, w), this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1; + renderSprites(s, o, w) { + this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1, this._lightsNeedUpdate = !0, this.sprites.render(s, o, this._currentWidth, this._currentHeight, w), this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1; } } } @@ -11540,7 +11540,7 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./shaders/index */ "./src/WebGL/shaders/index.ts" ); @@ -11558,17 +11558,17 @@ ATOM`, g); } init(h) { this.gl = h.context, this.renderer = h, this.precision = h.getPrecision(), this.sprite.vertices = new Float32Array(16), this.sprite.faces = new Uint16Array(6); - var u = 0; - this.sprite.vertices[u++] = -1, this.sprite.vertices[u++] = -1, this.sprite.vertices[u++] = 0, this.sprite.vertices[u++] = 0, this.sprite.vertices[u++] = 1, this.sprite.vertices[u++] = -1, this.sprite.vertices[u++] = 1, this.sprite.vertices[u++] = 0, this.sprite.vertices[u++] = 1, this.sprite.vertices[u++] = 1, this.sprite.vertices[u++] = 1, this.sprite.vertices[u++] = 1, this.sprite.vertices[u++] = -1, this.sprite.vertices[u++] = 1, this.sprite.vertices[u++] = 0, this.sprite.vertices[u++] = 1, u = 0, this.sprite.faces[u++] = 0, this.sprite.faces[u++] = 1, this.sprite.faces[u++] = 2, this.sprite.faces[u++] = 0, this.sprite.faces[u++] = 2, this.sprite.faces[u++] = 3, this.sprite.vertexBuffer = this.gl.createBuffer(), this.sprite.elementBuffer = this.gl.createBuffer(), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.sprite.vertexBuffer), this.gl.bufferData(this.gl.ARRAY_BUFFER, this.sprite.vertices, this.gl.STATIC_DRAW), this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.elementBuffer), this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.faces, this.gl.STATIC_DRAW), this.sprite.program = this.createProgram( - s.ShaderLib.sprite, + var _ = 0; + this.sprite.vertices[_++] = -1, this.sprite.vertices[_++] = -1, this.sprite.vertices[_++] = 0, this.sprite.vertices[_++] = 0, this.sprite.vertices[_++] = 1, this.sprite.vertices[_++] = -1, this.sprite.vertices[_++] = 1, this.sprite.vertices[_++] = 0, this.sprite.vertices[_++] = 1, this.sprite.vertices[_++] = 1, this.sprite.vertices[_++] = 1, this.sprite.vertices[_++] = 1, this.sprite.vertices[_++] = -1, this.sprite.vertices[_++] = 1, this.sprite.vertices[_++] = 0, this.sprite.vertices[_++] = 1, _ = 0, this.sprite.faces[_++] = 0, this.sprite.faces[_++] = 1, this.sprite.faces[_++] = 2, this.sprite.faces[_++] = 0, this.sprite.faces[_++] = 2, this.sprite.faces[_++] = 3, this.sprite.vertexBuffer = this.gl.createBuffer(), this.sprite.elementBuffer = this.gl.createBuffer(), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.sprite.vertexBuffer), this.gl.bufferData(this.gl.ARRAY_BUFFER, this.sprite.vertices, this.gl.STATIC_DRAW), this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.elementBuffer), this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.faces, this.gl.STATIC_DRAW), this.sprite.program = this.createProgram( + n.ShaderLib.sprite, this.precision || 1 /** added default to single precision */ ), this.sprite.attributes = {}; const E = {}; this.sprite.attributes.position = this.gl.getAttribLocation(this.sprite.program, "position"), this.sprite.attributes.uv = this.gl.getAttribLocation(this.sprite.program, "uv"), E.uvOffset = this.gl.getUniformLocation(this.sprite.program, "uvOffset"), E.uvScale = this.gl.getUniformLocation(this.sprite.program, "uvScale"), E.rotation = this.gl.getUniformLocation(this.sprite.program, "rotation"), E.scale = this.gl.getUniformLocation(this.sprite.program, "scale"), E.alignment = this.gl.getUniformLocation(this.sprite.program, "alignment"), E.color = this.gl.getUniformLocation(this.sprite.program, "color"), E.map = this.gl.getUniformLocation(this.sprite.program, "map"), E.opacity = this.gl.getUniformLocation(this.sprite.program, "opacity"), E.useScreenCoordinates = this.gl.getUniformLocation(this.sprite.program, "useScreenCoordinates"), E.screenPosition = this.gl.getUniformLocation(this.sprite.program, "screenPosition"), E.modelViewMatrix = this.gl.getUniformLocation(this.sprite.program, "modelViewMatrix"), E.projectionMatrix = this.gl.getUniformLocation(this.sprite.program, "projectionMatrix"), E.fogType = this.gl.getUniformLocation(this.sprite.program, "fogType"), E.fogDensity = this.gl.getUniformLocation(this.sprite.program, "fogDensity"), E.fogNear = this.gl.getUniformLocation(this.sprite.program, "fogNear"), E.fogFar = this.gl.getUniformLocation(this.sprite.program, "fogFar"), E.fogColor = this.gl.getUniformLocation(this.sprite.program, "fogColor"), E.alphaTest = this.gl.getUniformLocation(this.sprite.program, "alphaTest"), this.sprite.uniforms = E; } - render(h, u, E, c, C) { - var b, A, S, n, o, w, p, v, a, l; + render(h, _, E, c, C) { + var b, A, S, s, o, w, p, v, a, l; if (!this.gl) throw new Error("WebGLRenderer not initialized"); let g = []; @@ -11581,25 +11581,25 @@ ATOM`, g); const L = this.sprite.attributes, T = this.sprite.uniforms; if (!T) throw new Error("Uniforms not defined"); - var D = E * 0.5, R = c * 0.5; - this.gl.useProgram(this.sprite.program), this.gl.enableVertexAttribArray(L.position), this.gl.enableVertexAttribArray(L.uv), this.gl.disable(this.gl.CULL_FACE), this.gl.enable(this.gl.BLEND), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.sprite.vertexBuffer), this.gl.vertexAttribPointer(L.position, 2, this.gl.FLOAT, !1, 16, 0), this.gl.vertexAttribPointer(L.uv, 2, this.gl.FLOAT, !1, 16, 8), this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.elementBuffer), this.gl.uniformMatrix4fv(T.projectionMatrix, !1, u.projectionMatrix.elements), this.gl.activeTexture(this.gl.TEXTURE0), this.gl.uniform1i(T.map, 0); - var B = 0, P = 0, z = h.fog; - z ? (this.gl.uniform3f(T.fogColor, z.color.r, z.color.g, z.color.b), this.gl.uniform1f(T.fogNear, z.near), this.gl.uniform1f(T.fogFar, z.far), this.gl.uniform1i(T.fogType, 1), B = 1, P = 1) : (this.gl.uniform1i(T.fogType, 0), B = 0, P = 0); + var D = E * 0.5, I = c * 0.5; + this.gl.useProgram(this.sprite.program), this.gl.enableVertexAttribArray(L.position), this.gl.enableVertexAttribArray(L.uv), this.gl.disable(this.gl.CULL_FACE), this.gl.enable(this.gl.BLEND), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.sprite.vertexBuffer), this.gl.vertexAttribPointer(L.position, 2, this.gl.FLOAT, !1, 16, 0), this.gl.vertexAttribPointer(L.uv, 2, this.gl.FLOAT, !1, 16, 8), this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.elementBuffer), this.gl.uniformMatrix4fv(T.projectionMatrix, !1, _.projectionMatrix.elements), this.gl.activeTexture(this.gl.TEXTURE0), this.gl.uniform1i(T.map, 0); + var z = 0, P = 0, B = h.fog; + B ? (this.gl.uniform3f(T.fogColor, B.color.r, B.color.g, B.color.b), this.gl.uniform1f(T.fogNear, B.near), this.gl.uniform1f(T.fogFar, B.far), this.gl.uniform1i(T.fogType, 1), z = 1, P = 1) : (this.gl.uniform1i(T.fogType, 0), z = 0, P = 0); var F; let N, $, k, G, H = []; for (F = 0; F < M; F++) - N = g[F], $ = N.material, $ && ($.depthTest == !1 && !C || !N.visible || $.opacity === 0 || ($.useScreenCoordinates ? N.z = -N.position.z : (N._modelViewMatrix.multiplyMatrices(u.matrixWorldInverse, N.matrixWorld), N.z = -N._modelViewMatrix.elements[14]))); - for (g.sort(_), F = 0; F < M; F++) + N = g[F], $ = N.material, $ && ($.depthTest == !1 && !C || !N.visible || $.opacity === 0 || ($.useScreenCoordinates ? N.z = -N.position.z : (N._modelViewMatrix.multiplyMatrices(_.matrixWorldInverse, N.matrixWorld), N.z = -N._modelViewMatrix.elements[14]))); + for (g.sort(u), F = 0; F < M; F++) if (N = g[F], $ = N.material, !!$ && !(!N.visible || $.opacity === 0) && $.map && $.map.image && $.map.image.width) { this.gl.uniform1f((T == null ? void 0 : T.alphaTest) || null, $.alphaTest); var U = $.map.image.width, V = $.map.image.height; - H[0] = U * this.renderer.devicePixelRatio / E, H[1] = V * this.renderer.devicePixelRatio / c, $.useScreenCoordinates === !0 ? (this.gl.uniform1i(T.useScreenCoordinates, 1), this.gl.uniform3f(T.screenPosition, (N.position.x * this.renderer.devicePixelRatio - D) / D, (R - N.position.y * this.renderer.devicePixelRatio) / R, Math.max(0, Math.min(1, N.position.z)))) : (this.gl.uniform1i(T.useScreenCoordinates, 0), this.gl.uniformMatrix4fv(T.modelViewMatrix, !1, N._modelViewMatrix.elements)), h.fog && $.fog ? G = P : G = 0, B !== G && (this.gl.uniform1i(T.fogType, G), B = G), k = 1 / ($.scaleByViewport ? c : 1), H[0] *= k * N.scale.x, H[1] *= k * N.scale.y; - let Q = (A = $ == null ? void 0 : $.alignment) === null || A === void 0 ? void 0 : A.x, oe = (S = $ == null ? void 0 : $.alignment) === null || S === void 0 ? void 0 : S.y; - $.screenOffset && (Q = (Q || 0) + 2 * $.screenOffset.x / U, oe = (oe || 0) + 2 * $.screenOffset.y / V), this.gl.uniform2f(T.uvScale, ((n = $ == null ? void 0 : $.uvScale) === null || n === void 0 ? void 0 : n.x) || 1, ((o = $ == null ? void 0 : $.uvScale) === null || o === void 0 ? void 0 : o.y) || 1), this.gl.uniform2f(T.uvOffset, ((w = $ == null ? void 0 : $.uvOffset) === null || w === void 0 ? void 0 : w.x) || 0, ((p = $ == null ? void 0 : $.uvOffset) === null || p === void 0 ? void 0 : p.y) || 0), this.gl.uniform2f(T.alignment, Q || 0, oe || 0), this.gl.uniform1f(T.opacity, $.opacity), this.gl.uniform3f(T.color, ((v = $ == null ? void 0 : $.color) === null || v === void 0 ? void 0 : v.r) || 0, ((a = $ == null ? void 0 : $.color) === null || a === void 0 ? void 0 : a.g) || 0, ((l = $ == null ? void 0 : $.color) === null || l === void 0 ? void 0 : l.b) || 0), this.gl.uniform1f(T.rotation, N.rotation), this.gl.uniform2fv(T.scale, H), this.renderer.setDepthTest($.depthTest), this.renderer.setDepthWrite($.depthWrite), this.renderer.setTexture($.map, 0), this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0); + H[0] = U * this.renderer.devicePixelRatio / E, H[1] = V * this.renderer.devicePixelRatio / c, $.useScreenCoordinates === !0 ? (this.gl.uniform1i(T.useScreenCoordinates, 1), this.gl.uniform3f(T.screenPosition, (N.position.x * this.renderer.devicePixelRatio - D) / D, (I - N.position.y * this.renderer.devicePixelRatio) / I, Math.max(0, Math.min(1, N.position.z)))) : (this.gl.uniform1i(T.useScreenCoordinates, 0), this.gl.uniformMatrix4fv(T.modelViewMatrix, !1, N._modelViewMatrix.elements)), h.fog && $.fog ? G = P : G = 0, z !== G && (this.gl.uniform1i(T.fogType, G), z = G), k = 1 / ($.scaleByViewport ? c : 1), H[0] *= k * N.scale.x, H[1] *= k * N.scale.y; + let Q = (A = $ == null ? void 0 : $.alignment) === null || A === void 0 ? void 0 : A.x, ae = (S = $ == null ? void 0 : $.alignment) === null || S === void 0 ? void 0 : S.y; + $.screenOffset && (Q = (Q || 0) + 2 * $.screenOffset.x / U, ae = (ae || 0) + 2 * $.screenOffset.y / V), this.gl.uniform2f(T.uvScale, ((s = $ == null ? void 0 : $.uvScale) === null || s === void 0 ? void 0 : s.x) || 1, ((o = $ == null ? void 0 : $.uvScale) === null || o === void 0 ? void 0 : o.y) || 1), this.gl.uniform2f(T.uvOffset, ((w = $ == null ? void 0 : $.uvOffset) === null || w === void 0 ? void 0 : w.x) || 0, ((p = $ == null ? void 0 : $.uvOffset) === null || p === void 0 ? void 0 : p.y) || 0), this.gl.uniform2f(T.alignment, Q || 0, ae || 0), this.gl.uniform1f(T.opacity, $.opacity), this.gl.uniform3f(T.color, ((v = $ == null ? void 0 : $.color) === null || v === void 0 ? void 0 : v.r) || 0, ((a = $ == null ? void 0 : $.color) === null || a === void 0 ? void 0 : a.g) || 0, ((l = $ == null ? void 0 : $.color) === null || l === void 0 ? void 0 : l.b) || 0), this.gl.uniform1f(T.rotation, N.rotation), this.gl.uniform2fv(T.scale, H), this.renderer.setDepthTest($.depthTest), this.renderer.setDepthWrite($.depthWrite), this.renderer.setTexture($.map, 0), this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0); } this.gl.enable(this.gl.CULL_FACE); } - createProgram(h, u) { + createProgram(h, _) { if (!this.gl) throw new Error("WebGL Rendering context not found"); var E = this.gl.createProgram(); @@ -11610,7 +11610,7 @@ ATOM`, g); throw new Error("Unable to create fragment shader SpritePlugin.createProgram"); if (!C) throw new Error("Unable to create vertex shader SpritePlugin.createProgram"); - var b = "precision " + u + ` float; + var b = "precision " + _ + ` float; `; if (this.gl.shaderSource(c, b + h.fragmentShader), this.gl.shaderSource(C, b + h.vertexShader), this.gl.compileShader(c), this.gl.compileShader(C), !this.gl.getShaderParameter(c, this.gl.COMPILE_STATUS) || !this.gl.getShaderParameter(C, this.gl.COMPILE_STATUS)) throw new Error(`Error compiling shader: @@ -11619,8 +11619,8 @@ ATOM`, g); return this.gl.attachShader(E, c), this.gl.attachShader(E, C), this.gl.linkProgram(E), this.gl.getProgramParameter(E, this.gl.LINK_STATUS) || console.error("Could not initialize shader"), E; } } - function _(x, h) { - return x.z !== h.z ? h.z - x.z : h.id - x.id; + function u(y, h) { + return y.z !== h.z ? h.z - y.z : h.id - y.id; } } ), @@ -11635,14 +11635,14 @@ ATOM`, g); /* harmony export */ Coloring: () => ( /* binding */ - s + n ) /* harmony export */ }); - var s; + var n; (function(f) { f[f.NoColors = 0] = "NoColors", f[f.FaceColors = 1] = "FaceColors", f[f.VertexColors = 2] = "VertexColors"; - })(s || (s = {})); + })(n || (n = {})); } ), /***/ @@ -11656,14 +11656,14 @@ ATOM`, g); /* harmony export */ Shading: () => ( /* binding */ - s + n ) /* harmony export */ }); - var s; + var n; (function(f) { f[f.NoShading = 0] = "NoShading", f[f.FlatShading = 1] = "FlatShading", f[f.SmoothShading = 2] = "SmoothShading"; - })(s || (s = {})); + })(n || (n = {})); } ), /***/ @@ -11682,16 +11682,16 @@ ATOM`, g); /* harmony export */ DoubleSide: () => ( /* binding */ - _ + u ), /* harmony export */ FrontSide: () => ( /* binding */ - s + n ) /* harmony export */ }); - const s = 0, f = 1, _ = 2; + const n = 0, f = 1, u = 2; } ), /***/ @@ -11709,20 +11709,20 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../math */ "./src/WebGL/math/index.ts" ); const f = { - topLeft: new s.Vector2(1, -1), - topCenter: new s.Vector2(0, -1), - topRight: new s.Vector2(-1, -1), - centerLeft: new s.Vector2(1, 0), - center: new s.Vector2(0, 0), - centerRight: new s.Vector2(-1, 0), - bottomLeft: new s.Vector2(1, 1), - bottomCenter: new s.Vector2(0, 1), - bottomRight: new s.Vector2(-1, 1) + topLeft: new n.Vector2(1, -1), + topCenter: new n.Vector2(0, -1), + topRight: new n.Vector2(-1, -1), + centerLeft: new n.Vector2(1, 0), + center: new n.Vector2(0, 0), + centerRight: new n.Vector2(-1, 0), + bottomLeft: new n.Vector2(1, 1), + bottomCenter: new n.Vector2(0, 1), + bottomRight: new n.Vector2(-1, 1) }; } ), @@ -11737,12 +11737,12 @@ ATOM`, g); /* harmony export */ ClampToEdgeWrapping: () => ( /* binding */ - s + n ), /* harmony export */ FloatType: () => ( /* binding */ - u + _ ), /* harmony export */ LinearFilter: () => ( @@ -11752,12 +11752,12 @@ ATOM`, g); /* harmony export */ LinearMipMapLinearFilter: () => ( /* binding */ - x + y ), /* harmony export */ NearestFilter: () => ( /* binding */ - _ + u ), /* harmony export */ R32Format: () => ( @@ -11781,7 +11781,7 @@ ATOM`, g); ) /* harmony export */ }); - const s = 1001, f = 1006, _ = 1007, x = 1008, h = 1009, u = 1010, E = 1021, c = 1022, C = 1023; + const n = 1001, f = 1006, u = 1007, y = 1008, h = 1009, _ = 1010, E = 1021, c = 1022, C = 1023; } ), /***/ @@ -11795,14 +11795,14 @@ ATOM`, g); /* harmony export */ TextureOperations: () => ( /* binding */ - s + n ) /* harmony export */ }); - var s; + var n; (function(f) { f[f.MultiplyOperation = 0] = "MultiplyOperation", f[f.MixOperation = 1] = "MixOperation", f[f.AddOperation = 2] = "AddOperation"; - })(s || (s = {})); + })(n || (n = {})); } ), /***/ @@ -11826,7 +11826,7 @@ ATOM`, g); /* harmony export */ Coloring: () => ( /* reexport safe */ - s.Coloring + n.Coloring ), /* harmony export */ DoubleSide: () => ( @@ -11876,17 +11876,17 @@ ATOM`, g); /* harmony export */ Shading: () => ( /* reexport safe */ - _.Shading + u.Shading ), /* harmony export */ SpriteAlignment: () => ( /* reexport safe */ - x.SpriteAlignment + y.SpriteAlignment ), /* harmony export */ TextureOperations: () => ( /* reexport safe */ - u.TextureOperations + _.TextureOperations ), /* harmony export */ UnsignedByteType: () => ( @@ -11895,22 +11895,22 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./Coloring */ "./src/WebGL/constants/Coloring.ts" ), f = t( /*! ./Sides */ "./src/WebGL/constants/Sides.ts" - ), _ = t( + ), u = t( /*! ./Shading */ "./src/WebGL/constants/Shading.ts" - ), x = t( + ), y = t( /*! ./SpriteAlignment */ "./src/WebGL/constants/SpriteAlignment.ts" ), h = t( /*! ./TextureConstants */ "./src/WebGL/constants/TextureConstants.ts" - ), u = t( + ), _ = t( /*! ./TextureOperations */ "./src/WebGL/constants/TextureOperations.ts" ); @@ -11927,32 +11927,32 @@ ATOM`, g); /* harmony export */ EventDispatcher: () => ( /* binding */ - s + n ) /* harmony export */ }); - class s { + class n { constructor() { this.listeners = {}; } - dispatchEvent(_) { - var x = this.listeners[_.type]; - if (x !== void 0) { - _.target = this; - for (var h = 0, u = x.length; h < u; h++) - x[h].call(this, _); + dispatchEvent(u) { + var y = this.listeners[u.type]; + if (y !== void 0) { + u.target = this; + for (var h = 0, _ = y.length; h < _; h++) + y[h].call(this, u); } } - removeEventListener(_, x) { - if (!x) - this.listeners[_] = []; + removeEventListener(u, y) { + if (!y) + this.listeners[u] = []; else { - var h = this.listeners[_].indexOf(x); - h !== -1 && this.listeners[_].splice(h, 1); + var h = this.listeners[u].indexOf(y); + h !== -1 && this.listeners[u].splice(h, 1); } } - addEventListener(_, x) { - this.listeners[_] === void 0 && (this.listeners[_] = []), this.listeners[_].indexOf(x) === -1 && this.listeners[_].push(x); + addEventListener(u, y) { + this.listeners[u] === void 0 && (this.listeners[u] = []), this.listeners[u].indexOf(y) === -1 && this.listeners[u].push(y); } } } @@ -11973,7 +11973,7 @@ ATOM`, g); /* harmony export */ GeometryGroup: () => ( /* binding */ - u + _ ), /* harmony export */ GeometryIDCount: () => ( @@ -11982,21 +11982,21 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../materials/LineBasicMaterial */ "./src/WebGL/materials/LineBasicMaterial.ts" ), f = t( /*! ./EventDispatcher */ "./src/WebGL/core/EventDispatcher.ts" - ), _ = t( + ), u = t( /*! ../math */ "./src/WebGL/math/index.ts" - ), x = t( + ), y = t( /*! ../../colors */ "./src/colors.ts" ); const h = 65535; - class u { + class _ { constructor(b = 0) { this.vertexArray = null, this.colorArray = null, this.normalArray = null, this.radiusArray = null, this.faceArray = null, this.lineArray = null, this.vertices = 0, this.faceidx = 0, this.lineidx = 0, this.__inittedArrays = !1, this.id = b; } @@ -12010,9 +12010,9 @@ ATOM`, g); console.log("Cannot re-color geometry group due to mismatched lengths."); return; } - for (var n = 0; n < A.length; n += 3) { - var o = b(A[n], A[n + 1], A[n + 2]); - o instanceof x.Color || (o = x.CC.color(o)), S[n] = o.r, S[n + 1] = o.g, S[n + 2] = o.b; + for (var s = 0; s < A.length; s += 3) { + var o = b(A[s], A[s + 1], A[s + 2]); + o instanceof y.Color || (o = y.CC.color(o)), S[s] = o.r, S[s + 1] = o.g, S[s + 2] = o.b; } } getNumVertices() { @@ -12024,8 +12024,8 @@ ATOM`, g); getCentroid() { if (!this.vertexArray) throw new Error("vertex array not initialized"); - for (var b = new _.Vector3(), A, S, n, o, w = 0; w < this.vertices; ++w) - A = w * 3, S = this.vertexArray[A], n = this.vertexArray[A + 1], o = this.vertexArray[A + 2], b.x += S, b.y += n, b.z += o; + for (var b = new u.Vector3(), A, S, s, o, w = 0; w < this.vertices; ++w) + A = w * 3, S = this.vertexArray[A], s = this.vertexArray[A + 1], o = this.vertexArray[A + 2], b.x += S, b.y += s, b.z += o; return b.divideScalar(this.vertices), b; } //setup normals - vertex and face array must exist @@ -12038,8 +12038,8 @@ ATOM`, g); throw new Error("vertex array not initialized"); if (!S) throw new Error("normal array not initialized"); - for (var n, o, w, p, v, a, l, g = 0; g < b.length / 3; ++g) - n = b[g * 3] * 3, o = b[g * 3 + 1] * 3, w = b[g * 3 + 2] * 3, p = new _.Vector3(A[n], A[n + 1], A[n + 2]), v = new _.Vector3(A[o], A[o + 1], A[o + 2]), a = new _.Vector3(A[w], A[w + 1], A[w + 2]), p.subVectors(p, v), a.subVectors(a, v), a.cross(p), l = a, l.normalize(), S[n] += l.x, S[o] += l.x, S[w] += l.x, S[n + 1] += l.y, S[o + 1] += l.y, S[w + 1] += l.y, S[n + 2] += l.z, S[o + 2] += l.z, S[w + 2] += l.z; + for (var s, o, w, p, v, a, l, g = 0; g < b.length / 3; ++g) + s = b[g * 3] * 3, o = b[g * 3 + 1] * 3, w = b[g * 3 + 2] * 3, p = new u.Vector3(A[s], A[s + 1], A[s + 2]), v = new u.Vector3(A[o], A[o + 1], A[o + 2]), a = new u.Vector3(A[w], A[w + 1], A[w + 2]), p.subVectors(p, v), a.subVectors(a, v), a.cross(p), l = a, l.normalize(), S[s] += l.x, S[o] += l.x, S[w] += l.x, S[s + 1] += l.y, S[o + 1] += l.y, S[w + 1] += l.y, S[s + 2] += l.z, S[o + 2] += l.z, S[w + 2] += l.z; } } /* sets line index array from face arr @@ -12053,23 +12053,23 @@ ATOM`, g); if (this.lineidx = this.faceidx * 2, !b) throw new Error("face array not initialized"); for (var S = 0; S < this.faceidx / 3; ++S) { - var n = S * 3, o = n * 2, w = b[n], p = b[n + 1], v = b[n + 2]; + var s = S * 3, o = s * 2, w = b[s], p = b[s + 1], v = b[s + 2]; A[o] = w, A[o + 1] = p, A[o + 2] = w, A[o + 3] = v, A[o + 4] = p, A[o + 5] = v; } } } vrml(b, A) { - var S, n, o, w, p, v, a, l, g, M, L, T, D, R, B, P = ""; + var S, s, o, w, p, v, a, l, g, M, L, T, D, I, z, P = ""; P += b + `Shape { ` + b + ` appearance Appearance { ` + b + ` material Material { -` + b + " diffuseColor " + ((S = A == null ? void 0 : A.color) === null || S === void 0 ? void 0 : S.r) + " " + ((n = A == null ? void 0 : A.color) === null || n === void 0 ? void 0 : n.g) + " " + ((o = A == null ? void 0 : A.color) === null || o === void 0 ? void 0 : o.b) + ` +` + b + " diffuseColor " + ((S = A == null ? void 0 : A.color) === null || S === void 0 ? void 0 : S.r) + " " + ((s = A == null ? void 0 : A.color) === null || s === void 0 ? void 0 : s.g) + " " + ((o = A == null ? void 0 : A.color) === null || o === void 0 ? void 0 : o.b) + ` `, A != null && A.transparent && (P += b + " transparency " + (1 - A.opacity) + ` `), P += b + ` } `, P += b + ` } `; - var z = b; - if (b += " ", A instanceof s.LineBasicMaterial) { + var B = b; + if (b += " ", A instanceof n.LineBasicMaterial) { P += b + `geometry IndexedLineSet { ` + b + ` colorPerVertex TRUE ` + b + ` coord Coordinate { @@ -12146,17 +12146,17 @@ ATOM`, g); P += b + ` coordIndex [ `; for (var F = 0; F < this.faceidx; F += 3) - N = (D = this.faceArray) === null || D === void 0 ? void 0 : D[F], $ = (R = this.faceArray) === null || R === void 0 ? void 0 : R[F + 1], k = (B = this.faceArray) === null || B === void 0 ? void 0 : B[F + 2], P += b + " " + N + ", " + $ + ", " + k + `, -1, + N = (D = this.faceArray) === null || D === void 0 ? void 0 : D[F], $ = (I = this.faceArray) === null || I === void 0 ? void 0 : I[F + 1], k = (z = this.faceArray) === null || z === void 0 ? void 0 : z[F + 2], P += b + " " + N + ", " + $ + ", " + k + `, -1, `; P += b + ` ] `, P += b + `} `; } - return P += z + "}", P; + return P += B + "}", P; } truncateArrayBuffers(b = !0, A = !1) { - var S = this.vertexArray, n = this.colorArray, o = this.normalArray, w = this.faceArray, p = this.lineArray, v = this.radiusArray; - this.vertexArray = (S == null ? void 0 : S.subarray(0, this.vertices * 3)) || null, this.colorArray = (n == null ? void 0 : n.subarray(0, this.vertices * 3)) || null, b ? (this.normalArray = (o == null ? void 0 : o.subarray(0, this.vertices * 3)) || null, this.faceArray = (w == null ? void 0 : w.subarray(0, this.faceidx)) || null, this.lineidx > 0 ? this.lineArray = (p == null ? void 0 : p.subarray(0, this.lineidx)) || null : this.lineArray = new Uint16Array(0)) : (this.normalArray = new Float32Array(0), this.faceArray = new Uint16Array(0), this.lineArray = new Uint16Array(0)), v && (this.radiusArray = v.subarray(0, this.vertices)), A && (this.normalArray && (this.normalArray = new Float32Array(this.normalArray)), this.faceArray && (this.faceArray = new Uint16Array(this.faceArray)), this.lineArray && (this.lineArray = new Uint16Array(this.lineArray)), this.vertexArray && (this.vertexArray = new Float32Array(this.vertexArray)), this.colorArray && (this.colorArray = new Float32Array(this.colorArray)), this.radiusArray && (this.radiusArray = new Float32Array(this.radiusArray))), this.__inittedArrays = !0; + var S = this.vertexArray, s = this.colorArray, o = this.normalArray, w = this.faceArray, p = this.lineArray, v = this.radiusArray; + this.vertexArray = (S == null ? void 0 : S.subarray(0, this.vertices * 3)) || null, this.colorArray = (s == null ? void 0 : s.subarray(0, this.vertices * 3)) || null, b ? (this.normalArray = (o == null ? void 0 : o.subarray(0, this.vertices * 3)) || null, this.faceArray = (w == null ? void 0 : w.subarray(0, this.faceidx)) || null, this.lineidx > 0 ? this.lineArray = (p == null ? void 0 : p.subarray(0, this.lineidx)) || null : this.lineArray = new Uint16Array(0)) : (this.normalArray = new Float32Array(0), this.faceArray = new Uint16Array(0), this.lineArray = new Uint16Array(0)), v && (this.radiusArray = v.subarray(0, this.vertices)), A && (this.normalArray && (this.normalArray = new Float32Array(this.normalArray)), this.faceArray && (this.faceArray = new Uint16Array(this.faceArray)), this.lineArray && (this.lineArray = new Uint16Array(this.lineArray)), this.vertexArray && (this.vertexArray = new Float32Array(this.vertexArray)), this.colorArray && (this.colorArray = new Float32Array(this.colorArray)), this.radiusArray && (this.radiusArray = new Float32Array(this.radiusArray))), this.__inittedArrays = !0; } } class E extends f.EventDispatcher { @@ -12171,7 +12171,7 @@ ATOM`, g); } //return comma separated list of IndexedFace (or Line) sets from geometry groups vrml(b, A) { - for (var S = "", n = this.geometryGroups.length, o = 0; o < n; o++) { + for (var S = "", s = this.geometryGroups.length, o = 0; o < s; o++) { var w = this.geometryGroups[o]; S += w.vrml(b, A) + `, `; @@ -12179,7 +12179,7 @@ ATOM`, g); return S; } addGeoGroup() { - var b = new u(this.geometryGroups.length); + var b = new _(this.geometryGroups.length); return this.geometryGroups.push(b), this.groups = this.geometryGroups.length, b.vertexArray = new Float32Array(h * 3), b.colorArray = new Float32Array(h * 3), this.mesh && (b.normalArray = new Float32Array(h * 3), b.faceArray = new Uint16Array(h * 6), b.lineArray = new Uint16Array(h * 6)), this.radii && (b.radiusArray = new Float32Array(h)), b.useOffset = this.offset, b; } setUpNormals(...b) { @@ -12190,8 +12190,8 @@ ATOM`, g); } setColors(...b) { for (var A = this.geometryGroups.length, S = 0; S < A; S++) { - var n = this.geometryGroups[S]; - n.setColors(...b); + var s = this.geometryGroups[S]; + s.setColors(...b); } } setUpWireframe(...b) { @@ -12231,17 +12231,17 @@ ATOM`, g); /* harmony export */ Light: () => ( /* binding */ - u + _ ), /* harmony export */ Object3D: () => ( /* binding */ - x + y ), /* harmony export */ Object3DIDCount: () => ( /* binding */ - _ + u ), /* harmony export */ Scene: () => ( @@ -12250,20 +12250,20 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../math */ "./src/WebGL/math/index.ts" ), f = t( /*! ../../colors */ "./src/colors.ts" ); - let _ = 0; - class x { + let u = 0; + class y { constructor() { - this.id = _++, this.name = "", this.children = [], this.position = new s.Vector3(), this.rotation = new s.Vector3(), this.matrix = new s.Matrix4(), this.matrixWorld = new s.Matrix4(), this.quaternion = new s.Quaternion(), this.eulerOrder = "XYZ", this.up = new s.Vector3(0, 1, 0), this.scale = new s.Vector3(1, 1, 1), this.matrixAutoUpdate = !0, this.matrixWorldNeedsUpdate = !0, this.rotationAutoUpdate = !0, this.useQuaternion = !1, this.visible = !0; + this.id = u++, this.name = "", this.children = [], this.position = new n.Vector3(), this.rotation = new n.Vector3(), this.matrix = new n.Matrix4(), this.matrixWorld = new n.Matrix4(), this.quaternion = new n.Quaternion(), this.eulerOrder = "XYZ", this.up = new n.Vector3(0, 1, 0), this.scale = new n.Vector3(1, 1, 1), this.matrixAutoUpdate = !0, this.matrixWorldNeedsUpdate = !0, this.rotationAutoUpdate = !0, this.useQuaternion = !1, this.visible = !0; } lookAt(c) { - this.matrix.lookAt(c, this.position, this.up), this.rotationAutoUpdate && (this.useQuaternion === !0 ? console.error("Unimplemented math operation.") : this.rotation instanceof s.Vector3 && this.rotation.setEulerFromRotationMatrix(this.matrix, this.eulerOrder)); + this.matrix.lookAt(c, this.position, this.up), this.rotationAutoUpdate && (this.useQuaternion === !0 ? console.error("Unimplemented math operation.") : this.rotation instanceof n.Vector3 && this.rotation.setEulerFromRotationMatrix(this.matrix, this.eulerOrder)); } //add child object add(c) { @@ -12293,20 +12293,20 @@ ATOM`, g); let w = Math.sin(C / 2); b = this.quaternion.x / w, A = this.quaternion.y / w, S = this.quaternion.z / w; } - var n = c + `Transform { + var s = c + `Transform { ` + c + " center " + this.position.x + " " + this.position.y + " " + this.position.z + ` ` + c + " rotation " + b + " " + A + " " + S + " " + C + ` ` + c + ` children [ `; - this.geometry && (n += this.geometry.vrml(c, this.material)); + this.geometry && (s += this.geometry.vrml(c, this.material)); for (var o = 0; o < this.children.length; o++) - n += this.children[o].vrml(c + " ") + `, + s += this.children[o].vrml(c + " ") + `, `; - return n += ` ] -`, n += "}", n; + return s += ` ] +`, s += "}", s; } updateMatrix() { - this.matrix.setPosition(this.position), this.useQuaternion === !1 && this.rotation instanceof s.Vector3 ? this.matrix.setRotationFromEuler(this.rotation, this.eulerOrder) : this.matrix.setRotationFromQuaternion(this.quaternion), (this.scale.x !== 1 || this.scale.y !== 1 || this.scale.z !== 1) && this.matrix.scale(this.scale), this.matrixWorldNeedsUpdate = !0; + this.matrix.setPosition(this.position), this.useQuaternion === !1 && this.rotation instanceof n.Vector3 ? this.matrix.setRotationFromEuler(this.rotation, this.eulerOrder) : this.matrix.setRotationFromQuaternion(this.quaternion), (this.scale.x !== 1 || this.scale.y !== 1 || this.scale.z !== 1) && this.matrix.scale(this.scale), this.matrixWorldNeedsUpdate = !0; } updateMatrixWorld(c) { this.matrixAutoUpdate === !0 && this.updateMatrix(), (this.matrixWorldNeedsUpdate === !0 || c === !0) && (this.parent === void 0 ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix)), this.matrixWorldNeedsUpdate = !1; @@ -12314,7 +12314,7 @@ ATOM`, g); this.children[C].updateMatrixWorld(!0); } clone(c) { - c === void 0 && (c = new x()), c.name = this.name, c.up.copy(this.up), c.position.copy(this.position), c.rotation instanceof s.Vector3 && this.rotation instanceof s.Vector3 ? c.rotation.copy(this.rotation) : c.rotation = this.rotation, c.eulerOrder = this.eulerOrder, c.scale.copy(this.scale), c.rotationAutoUpdate = this.rotationAutoUpdate, c.matrix.copy(this.matrix), c.matrixWorld.copy(this.matrixWorld), c.quaternion.copy(this.quaternion), c.matrixAutoUpdate = this.matrixAutoUpdate, c.matrixWorldNeedsUpdate = this.matrixWorldNeedsUpdate, c.useQuaternion = this.useQuaternion, c.visible = this.visible; + c === void 0 && (c = new y()), c.name = this.name, c.up.copy(this.up), c.position.copy(this.position), c.rotation instanceof n.Vector3 && this.rotation instanceof n.Vector3 ? c.rotation.copy(this.rotation) : c.rotation = this.rotation, c.eulerOrder = this.eulerOrder, c.scale.copy(this.scale), c.rotationAutoUpdate = this.rotationAutoUpdate, c.matrix.copy(this.matrix), c.matrixWorld.copy(this.matrixWorld), c.quaternion.copy(this.quaternion), c.matrixAutoUpdate = this.matrixAutoUpdate, c.matrixWorldNeedsUpdate = this.matrixWorldNeedsUpdate, c.useQuaternion = this.useQuaternion, c.visible = this.visible; for (var C = 0; C < this.children.length; C++) { var b = this.children[C]; c.add(b.clone()); @@ -12329,12 +12329,12 @@ ATOM`, g); } } } - class h extends x { + class h extends y { constructor() { super(...arguments), this.fog = null, this.overrideMaterial = null, this.matrixAutoUpdate = !1, this.__objects = [], this.__lights = [], this.__objectsAdded = [], this.__objectsRemoved = []; } __addObject(c) { - if (c instanceof u) + if (c instanceof _) this.__lights.indexOf(c) === -1 && this.__lights.push(c), c.target && c.target.parent === void 0 && this.add(c.target); else if (this.__objects.indexOf(c) === -1) { this.__objects.push(c), this.__objectsAdded.push(c); @@ -12346,7 +12346,7 @@ ATOM`, g); } __removeObject(c) { var C; - if (c instanceof u) + if (c instanceof _) C = this.__lights.indexOf(c), C !== -1 && this.__lights.splice(C, 1); else if (C = this.__objects.indexOf(c), C !== -1) { this.__objects.splice(C, 1), this.__objectsRemoved.push(c); @@ -12357,9 +12357,9 @@ ATOM`, g); this.__removeObject(c.children[A]); } } - class u extends x { + class _ extends y { constructor(c, C = 1) { - super(), this.position = new s.Vector3(0, 1, 0), this.target = new x(), this.castShadow = !1, this.onlyShadow = !1, this.color = new f.Color(c), this.intensity = C; + super(), this.position = new n.Vector3(0, 1, 0), this.target = new y(), this.castShadow = !1, this.onlyShadow = !1, this.color = new f.Color(c), this.intensity = C; } } } @@ -12375,27 +12375,27 @@ ATOM`, g); /* harmony export */ Projector: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ../math */ "./src/WebGL/math/index.ts" ); - const f = new s.Matrix4(); - class _ { - static unprojectVector(h, u) { - return u.projectionMatrixInverse.getInverse(u.projectionMatrix), f.multiplyMatrices(u.matrixWorld, u.projectionMatrixInverse), h.applyProjection(f); + const f = new n.Matrix4(); + class u { + static unprojectVector(h, _) { + return _.projectionMatrixInverse.getInverse(_.projectionMatrix), f.multiplyMatrices(_.matrixWorld, _.projectionMatrixInverse), h.applyProjection(f); } - static projectVector(h, u) { - return u.matrixWorldInverse.getInverse(u.matrixWorld), f.multiplyMatrices(u.projectionMatrix, u.matrixWorldInverse), h.applyProjection(f); + static projectVector(h, _) { + return _.matrixWorldInverse.getInverse(_.matrixWorld), f.multiplyMatrices(_.projectionMatrix, _.matrixWorldInverse), h.applyProjection(f); } - projectVector(h, u) { - return _.projectVector(h, u); + projectVector(h, _) { + return u.projectVector(h, _); } - unprojectVector(h, u) { - return _.unprojectVector(h, u); + unprojectVector(h, _) { + return u.unprojectVector(h, _); } } } @@ -12420,32 +12420,32 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../math */ "./src/WebGL/math/index.ts" ), f = t( /*! ../shapes */ "./src/WebGL/shapes/index.ts" ); - const _ = (p, v) => p.distance - v.distance, x = new s.Matrix4(); + const u = (p, v) => p.distance - v.distance, y = new n.Matrix4(); class h { constructor(v, a, l, g) { - this.precision = 1e-4, this.linePrecision = 0.2, this.ray = new s.Ray(v, a), this.ray.direction.lengthSq() > 0 && this.ray.direction.normalize(), this.near = g || 0, this.far = l || 1 / 0; + this.precision = 1e-4, this.linePrecision = 0.2, this.ray = new n.Ray(v, a), this.ray.direction.lengthSq() > 0 && this.ray.direction.normalize(), this.near = g || 0, this.far = l || 1 / 0; } set(v, a) { this.ray.set(v, a); } setFromCamera(v, a) { - a.ortho ? (this.ray.origin.set(v.x, v.y, (a.near + a.far) / (a.near - a.far)).unproject(a), this.ray.direction.set(0, 0, -1).transformDirection(a.matrixWorld)) : (this.ray.origin.setFromMatrixPosition(a.matrixWorld), this.ray.direction.set(v.x, v.y, v.z), a.projectionMatrixInverse.getInverse(a.projectionMatrix), x.multiplyMatrices(a.matrixWorld, a.projectionMatrixInverse), this.ray.direction.applyProjection(x), this.ray.direction.sub(this.ray.origin).normalize()); + a.ortho ? (this.ray.origin.set(v.x, v.y, (a.near + a.far) / (a.near - a.far)).unproject(a), this.ray.direction.set(0, 0, -1).transformDirection(a.matrixWorld)) : (this.ray.origin.setFromMatrixPosition(a.matrixWorld), this.ray.direction.set(v.x, v.y, v.z), a.projectionMatrixInverse.getInverse(a.projectionMatrix), y.multiplyMatrices(a.matrixWorld, a.projectionMatrixInverse), this.ray.direction.applyProjection(y), this.ray.direction.sub(this.ray.origin).normalize()); } intersectObjects(v, a) { for (var l = [], g = 0, M = a.length; g < M; g++) w(v, a[g], this, l); - return l.sort(_), l; + return l.sort(u), l; } } - const u = (p) => Math.min(Math.max(p, -1), 1); - var E = new f.Sphere(), c = new f.Cylinder(), C = new f.Triangle(), b = new s.Vector3(), A = new s.Vector3(), S = new s.Vector3(), n = new s.Vector3(), o = new s.Vector3(); + const _ = (p) => Math.min(Math.max(p, -1), 1); + var E = new f.Sphere(), c = new f.Cylinder(), C = new f.Triangle(), b = new n.Vector3(), A = new n.Vector3(), S = new n.Vector3(), s = new n.Vector3(), o = new n.Vector3(); function w(p, v, a, l) { if (o.getPositionFromMatrix(p.matrixWorld), v.intersectionShape === void 0) return l; @@ -12454,35 +12454,35 @@ ATOM`, g); var L = M * M; if (v.boundingSphere !== void 0 && v.boundingSphere instanceof f.Sphere && (E.copy(v.boundingSphere), E.applyMatrix4(p.matrixWorld), !a.ray.isIntersectionSphere(E))) return l; - var T, D, R, B, P, z, F, N, $, k, G, H, U, V; + var T, D, I, z, P, B, F, N, $, k, G, H, U, V; for (T = 0, D = g.triangle.length; T < D; T++) if (g.triangle[T] instanceof f.Triangle) { - if (C.copy(g.triangle[T]), C.applyMatrix4(p.matrixWorld), R = C.getNormal(), B = a.ray.direction.dot(R), B >= 0 || (b.subVectors(C.a, a.ray.origin), F = R.dot(b) / B, F < 0)) + if (C.copy(g.triangle[T]), C.applyMatrix4(p.matrixWorld), I = C.getNormal(), z = a.ray.direction.dot(I), z >= 0 || (b.subVectors(C.a, a.ray.origin), F = I.dot(b) / z, F < 0)) continue; - A.copy(a.ray.direction).multiplyScalar(F).add(a.ray.origin), A.sub(C.a), S.copy(C.b).sub(C.a), n.copy(C.c).sub(C.a); - var Q = S.dot(n), oe = S.lengthSq(), ee = n.lengthSq(); - if (H = (oe * A.dot(n) - Q * A.dot(S)) / (oe * ee - Q * Q), H < 0 || H > 1 || (G = (A.dot(S) - H * Q) / oe, G < 0 || G > 1 || G + H > 1)) + A.copy(a.ray.direction).multiplyScalar(F).add(a.ray.origin), A.sub(C.a), S.copy(C.b).sub(C.a), s.copy(C.c).sub(C.a); + var Q = S.dot(s), ae = S.lengthSq(), oe = s.lengthSq(); + if (H = (ae * A.dot(s) - Q * A.dot(S)) / (ae * oe - Q * Q), H < 0 || H > 1 || (G = (A.dot(S) - H * Q) / ae, G < 0 || G > 1 || G + H > 1)) continue; l.push({ clickable: v, distance: F }); } for (T = 0, D = g.cylinder.length; T < D; T++) if (g.cylinder[T] instanceof f.Cylinder) { - if (c.copy(g.cylinder[T]), c.applyMatrix4(p.matrixWorld), b.subVectors(c.c1, a.ray.origin), P = b.dot(c.direction), z = b.dot(a.ray.direction), B = u(a.ray.direction.dot(c.direction)), $ = 1 - B * B, $ === 0) + if (c.copy(g.cylinder[T]), c.applyMatrix4(p.matrixWorld), b.subVectors(c.c1, a.ray.origin), P = b.dot(c.direction), B = b.dot(a.ray.direction), z = _(a.ray.direction.dot(c.direction)), $ = 1 - z * z, $ === 0) continue; - U = (B * z - P) / $, V = (z - B * P) / $, A.copy(c.direction).multiplyScalar(U).add(c.c1), S.copy(a.ray.direction).multiplyScalar(V).add(a.ray.origin), N = n.subVectors(A, S).lengthSq(); - var ne = c.radius * c.radius; - if (N <= ne) { - if (k = (B * P - z) * (B * P - z) - $ * (b.lengthSq() - P * P - ne), k <= 0 ? H = F = Math.sqrt(N) : H = F = (z - B * P - Math.sqrt(k)) / $, G = B * H - P, G < 0 || G * G > c.lengthSq() || H < 0) + U = (z * B - P) / $, V = (B - z * P) / $, A.copy(c.direction).multiplyScalar(U).add(c.c1), S.copy(a.ray.direction).multiplyScalar(V).add(a.ray.origin), N = s.subVectors(A, S).lengthSq(); + var q = c.radius * c.radius; + if (N <= q) { + if (k = (z * P - B) * (z * P - B) - $ * (b.lengthSq() - P * P - q), k <= 0 ? H = F = Math.sqrt(N) : H = F = (B - z * P - Math.sqrt(k)) / $, G = z * H - P, G < 0 || G * G > c.lengthSq() || H < 0) continue; l.push({ clickable: v, distance: F }); } } for (T = 0, D = g.line.length; T < D; T += 2) { - A.copy(g.line[T]), A.applyMatrix4(p.matrixWorld), S.copy(g.line[T + 1]), S.applyMatrix4(p.matrixWorld), n.subVectors(S, A); - var me = n.lengthSq(); - n.normalize(), b.subVectors(A, a.ray.origin); - var se = b.dot(n); - z = b.dot(a.ray.direction), B = u(a.ray.direction.dot(n)), $ = 1 - B * B, $ !== 0 && (U = (B * z - se) / $, V = (z - B * se) / $, A.add(n.multiplyScalar(U)), S.copy(a.ray.direction).multiplyScalar(V).add(a.ray.origin), N = n.subVectors(S, A).lengthSq(), N < L && U * U < me && l.push({ clickable: v, distance: V })); + A.copy(g.line[T]), A.applyMatrix4(p.matrixWorld), S.copy(g.line[T + 1]), S.applyMatrix4(p.matrixWorld), s.subVectors(S, A); + var me = s.lengthSq(); + s.normalize(), b.subVectors(A, a.ray.origin); + var ne = b.dot(s); + B = b.dot(a.ray.direction), z = _(a.ray.direction.dot(s)), $ = 1 - z * z, $ !== 0 && (U = (z * B - ne) / $, V = (B - z * ne) / $, A.add(s.multiplyScalar(U)), S.copy(a.ray.direction).multiplyScalar(V).add(a.ray.origin), N = s.subVectors(S, A).lengthSq(), N < L && U * U < me && l.push({ clickable: v, distance: V })); } for (T = 0, D = g.sphere.length; T < D; T++) if (g.sphere[T] instanceof f.Sphere && (E.copy(g.sphere[T]), E.applyMatrix4(p.matrixWorld), a.ray.isIntersectionSphere(E))) { @@ -12512,26 +12512,26 @@ ATOM`, g); /* harmony export */ TextureIdCount: () => ( /* binding */ - u + _ ) /* harmony export */ }); - var s = t( + var n = t( /*! ../constants/TextureConstants */ "./src/WebGL/constants/TextureConstants.ts" ), f = t( /*! ../math */ "./src/WebGL/math/index.ts" - ), _ = t( + ), u = t( /*! ./EventDispatcher */ "./src/WebGL/core/EventDispatcher.ts" - ), x = t( + ), y = t( /*! ./UVMapping */ "./src/WebGL/core/UVMapping.ts" ); - class h extends _.EventDispatcher { + class h extends u.EventDispatcher { constructor(c, C) { - super(), this.id = u++, this.name = "", this.image = c, this.mapping = new x.UVMapping(), this.wrapS = s.ClampToEdgeWrapping, this.wrapT = s.ClampToEdgeWrapping, this.anisotropy = 1, C ? (this.format = s.RFormat, this.type = s.FloatType, this.premultiplyAlpha = !1, this.flipY = !1, this.unpackAlignment = 1, this.magFilter = s.NearestFilter, this.minFilter = s.NearestFilter) : (this.format = s.RGBAFormat, this.type = s.UnsignedByteType, this.offset = new f.Vector2(0, 0), this.repeat = new f.Vector2(1, 1), this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.magFilter = s.LinearFilter, this.minFilter = s.LinearMipMapLinearFilter), this.needsUpdate = !1, this.onUpdate = null; + super(), this.id = _++, this.name = "", this.image = c, this.mapping = new y.UVMapping(), this.wrapS = n.ClampToEdgeWrapping, this.wrapT = n.ClampToEdgeWrapping, this.anisotropy = 1, C ? (this.format = n.RFormat, this.type = n.FloatType, this.premultiplyAlpha = !1, this.flipY = !1, this.unpackAlignment = 1, this.magFilter = n.NearestFilter, this.minFilter = n.NearestFilter) : (this.format = n.RGBAFormat, this.type = n.UnsignedByteType, this.offset = new f.Vector2(0, 0), this.repeat = new f.Vector2(1, 1), this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.magFilter = n.LinearFilter, this.minFilter = n.LinearMipMapLinearFilter), this.needsUpdate = !1, this.onUpdate = null; } clone(c = new h()) { return c.image = this.image, c.mapping = this.mapping, c.wrapS = this.wrapS, c.wrapT = this.wrapT, c.magFilter = this.magFilter, c.minFilter = this.minFilter, c.anisotropy = this.anisotropy, c.format = this.format, c.type = this.type, c.offset.copy(this.offset), c.repeat.copy(this.repeat), c.premultiplyAlpha = this.premultiplyAlpha, c.flipY = this.flipY, c.unpackAlignment = this.unpackAlignment, c; @@ -12540,7 +12540,7 @@ ATOM`, g); this.dispatchEvent({ type: "dispose" }); } } - let u = 0; + let _ = 0; } ), /***/ @@ -12554,11 +12554,11 @@ ATOM`, g); /* harmony export */ UVMapping: () => ( /* binding */ - s + n ) /* harmony export */ }); - class s { + class n { } } ), @@ -12573,7 +12573,7 @@ ATOM`, g); /* harmony export */ EventDispatcher: () => ( /* reexport safe */ - s.EventDispatcher + n.EventDispatcher ), /* harmony export */ Geometry: () => ( @@ -12593,22 +12593,22 @@ ATOM`, g); /* harmony export */ Light: () => ( /* reexport safe */ - _.Light + u.Light ), /* harmony export */ Object3D: () => ( /* reexport safe */ - _.Object3D + u.Object3D ), /* harmony export */ Object3DIDCount: () => ( /* reexport safe */ - _.Object3DIDCount + u.Object3DIDCount ), /* harmony export */ Projector: () => ( /* reexport safe */ - x.Projector + y.Projector ), /* harmony export */ Raycaster: () => ( @@ -12618,17 +12618,17 @@ ATOM`, g); /* harmony export */ Scene: () => ( /* reexport safe */ - _.Scene + u.Scene ), /* harmony export */ Texture: () => ( /* reexport safe */ - u.Texture + _.Texture ), /* harmony export */ TextureIdCount: () => ( /* reexport safe */ - u.TextureIdCount + _.TextureIdCount ), /* harmony export */ UVMapping: () => ( @@ -12642,22 +12642,22 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./EventDispatcher */ "./src/WebGL/core/EventDispatcher.ts" ), f = t( /*! ./Geometry */ "./src/WebGL/core/Geometry.ts" - ), _ = t( + ), u = t( /*! ./Object3D */ "./src/WebGL/core/Object3D.ts" - ), x = t( + ), y = t( /*! ./Projector */ "./src/WebGL/core/Projector.ts" ), h = t( /*! ./Raycaster */ "./src/WebGL/core/Raycaster.ts" - ), u = t( + ), _ = t( /*! ./Texture */ "./src/WebGL/core/Texture.ts" ), E = t( @@ -12677,7 +12677,7 @@ ATOM`, g); /* harmony export */ BackSide: () => ( /* reexport safe */ - s.BackSide + n.BackSide ), /* harmony export */ Camera: () => ( @@ -12687,12 +12687,12 @@ ATOM`, g); /* harmony export */ ClampToEdgeWrapping: () => ( /* reexport safe */ - s.ClampToEdgeWrapping + n.ClampToEdgeWrapping ), /* harmony export */ Coloring: () => ( /* reexport safe */ - s.Coloring + n.Coloring ), /* harmony export */ Cylinder: () => ( @@ -12702,7 +12702,7 @@ ATOM`, g); /* harmony export */ DoubleSide: () => ( /* reexport safe */ - s.DoubleSide + n.DoubleSide ), /* harmony export */ EventDispatcher: () => ( @@ -12712,7 +12712,7 @@ ATOM`, g); /* harmony export */ FloatType: () => ( /* reexport safe */ - s.FloatType + n.FloatType ), /* harmony export */ Fog: () => ( @@ -12722,7 +12722,7 @@ ATOM`, g); /* harmony export */ FrontSide: () => ( /* reexport safe */ - s.FrontSide + n.FrontSide ), /* harmony export */ Geometry: () => ( @@ -12742,12 +12742,12 @@ ATOM`, g); /* harmony export */ ImposterMaterial: () => ( /* reexport safe */ - _.ImposterMaterial + u.ImposterMaterial ), /* harmony export */ InstancedMaterial: () => ( /* reexport safe */ - _.InstancedMaterial + u.InstancedMaterial ), /* harmony export */ Light: () => ( @@ -12762,7 +12762,7 @@ ATOM`, g); /* harmony export */ LineBasicMaterial: () => ( /* reexport safe */ - _.LineBasicMaterial + u.LineBasicMaterial ), /* harmony export */ LineStyle: () => ( @@ -12772,32 +12772,32 @@ ATOM`, g); /* harmony export */ LinearFilter: () => ( /* reexport safe */ - s.LinearFilter + n.LinearFilter ), /* harmony export */ LinearMipMapLinearFilter: () => ( /* reexport safe */ - s.LinearMipMapLinearFilter + n.LinearMipMapLinearFilter ), /* harmony export */ Material: () => ( /* reexport safe */ - _.Material + u.Material ), /* harmony export */ MaterialIdCount: () => ( /* reexport safe */ - _.MaterialIdCount + u.MaterialIdCount ), /* harmony export */ Matrix3: () => ( /* reexport safe */ - x.Matrix3 + y.Matrix3 ), /* harmony export */ Matrix4: () => ( /* reexport safe */ - x.Matrix4 + y.Matrix4 ), /* harmony export */ Mesh: () => ( @@ -12807,22 +12807,22 @@ ATOM`, g); /* harmony export */ MeshDoubleLambertMaterial: () => ( /* reexport safe */ - _.MeshDoubleLambertMaterial + u.MeshDoubleLambertMaterial ), /* harmony export */ MeshLambertMaterial: () => ( /* reexport safe */ - _.MeshLambertMaterial + u.MeshLambertMaterial ), /* harmony export */ MeshOutlineMaterial: () => ( /* reexport safe */ - _.MeshOutlineMaterial + u.MeshOutlineMaterial ), /* harmony export */ NearestFilter: () => ( /* reexport safe */ - s.NearestFilter + n.NearestFilter ), /* harmony export */ Object3D: () => ( @@ -12842,27 +12842,27 @@ ATOM`, g); /* harmony export */ Quaternion: () => ( /* reexport safe */ - x.Quaternion + y.Quaternion ), /* harmony export */ R32Format: () => ( /* reexport safe */ - s.R32Format + n.R32Format ), /* harmony export */ RFormat: () => ( /* reexport safe */ - s.RFormat + n.RFormat ), /* harmony export */ RGBAFormat: () => ( /* reexport safe */ - s.RGBAFormat + n.RGBAFormat ), /* harmony export */ Ray: () => ( /* reexport safe */ - x.Ray + y.Ray ), /* harmony export */ Raycaster: () => ( @@ -12882,17 +12882,17 @@ ATOM`, g); /* harmony export */ ShaderLib: () => ( /* reexport safe */ - u.ShaderLib + _.ShaderLib ), /* harmony export */ ShaderUtils: () => ( /* reexport safe */ - u.ShaderUtils + _.ShaderUtils ), /* harmony export */ Shading: () => ( /* reexport safe */ - s.Shading + n.Shading ), /* harmony export */ Sphere: () => ( @@ -12902,12 +12902,12 @@ ATOM`, g); /* harmony export */ SphereImposterMaterial: () => ( /* reexport safe */ - _.SphereImposterMaterial + u.SphereImposterMaterial ), /* harmony export */ SphereImposterOutlineMaterial: () => ( /* reexport safe */ - _.SphereImposterOutlineMaterial + u.SphereImposterOutlineMaterial ), /* harmony export */ Sprite: () => ( @@ -12917,12 +12917,12 @@ ATOM`, g); /* harmony export */ SpriteAlignment: () => ( /* reexport safe */ - s.SpriteAlignment + n.SpriteAlignment ), /* harmony export */ SpriteMaterial: () => ( /* reexport safe */ - _.SpriteMaterial + u.SpriteMaterial ), /* harmony export */ SpritePlugin: () => ( @@ -12932,12 +12932,12 @@ ATOM`, g); /* harmony export */ StickImposterMaterial: () => ( /* reexport safe */ - _.StickImposterMaterial + u.StickImposterMaterial ), /* harmony export */ StickImposterOutlineMaterial: () => ( /* reexport safe */ - _.StickImposterOutlineMaterial + u.StickImposterOutlineMaterial ), /* harmony export */ Texture: () => ( @@ -12952,7 +12952,7 @@ ATOM`, g); /* harmony export */ TextureOperations: () => ( /* reexport safe */ - s.TextureOperations + n.TextureOperations ), /* harmony export */ Triangle: () => ( @@ -12967,52 +12967,52 @@ ATOM`, g); /* harmony export */ UnsignedByteType: () => ( /* reexport safe */ - s.UnsignedByteType + n.UnsignedByteType ), /* harmony export */ Vector2: () => ( /* reexport safe */ - x.Vector2 + y.Vector2 ), /* harmony export */ Vector3: () => ( /* reexport safe */ - x.Vector3 + y.Vector3 ), /* harmony export */ VolumetricMaterial: () => ( /* reexport safe */ - _.VolumetricMaterial + u.VolumetricMaterial ), /* harmony export */ basic: () => ( /* reexport safe */ - u.basic + _.basic ), /* harmony export */ clamp: () => ( /* reexport safe */ - x.clamp + y.clamp ), /* harmony export */ clone: () => ( /* reexport safe */ - u.clone + _.clone ), /* harmony export */ conversionMatrix3: () => ( /* reexport safe */ - x.conversionMatrix3 + y.conversionMatrix3 ), /* harmony export */ degToRad: () => ( /* reexport safe */ - x.degToRad + y.degToRad ), /* harmony export */ instanced: () => ( /* reexport safe */ - u.instanced + _.instanced ), /* harmony export */ intersectObject: () => ( @@ -13022,76 +13022,76 @@ ATOM`, g); /* harmony export */ lambert: () => ( /* reexport safe */ - u.lambert + _.lambert ), /* harmony export */ lambertdouble: () => ( /* reexport safe */ - u.lambertdouble + _.lambertdouble ), /* harmony export */ outline: () => ( /* reexport safe */ - u.outline + _.outline ), /* harmony export */ screen: () => ( /* reexport safe */ - u.screen + _.screen ), /* harmony export */ screenaa: () => ( /* reexport safe */ - u.screenaa + _.screenaa ), /* harmony export */ sphereimposter: () => ( /* reexport safe */ - u.sphereimposter + _.sphereimposter ), /* harmony export */ sphereimposteroutline: () => ( /* reexport safe */ - u.sphereimposteroutline + _.sphereimposteroutline ), /* harmony export */ sprite: () => ( /* reexport safe */ - u.sprite + _.sprite ), /* harmony export */ stickimposter: () => ( /* reexport safe */ - u.stickimposter + _.stickimposter ), /* harmony export */ stickimposteroutline: () => ( /* reexport safe */ - u.stickimposteroutline + _.stickimposteroutline ), /* harmony export */ volumetric: () => ( /* reexport safe */ - u.volumetric + _.volumetric ) /* harmony export */ }); - var s = t( + var n = t( /*! ./constants */ "./src/WebGL/constants/index.ts" ), f = t( /*! ./core */ "./src/WebGL/core/index.ts" - ), _ = t( + ), u = t( /*! ./materials */ "./src/WebGL/materials/index.ts" - ), x = t( + ), y = t( /*! ./math */ "./src/WebGL/math/index.ts" ), h = t( /*! ./objects */ "./src/WebGL/objects/index.ts" - ), u = t( + ), _ = t( /*! ./shaders */ "./src/WebGL/shaders/index.ts" ), E = t( @@ -13123,31 +13123,31 @@ ATOM`, g); /* harmony export */ ImposterMaterial: () => ( /* binding */ - u + _ ) /* harmony export */ }); - var s = t( + var n = t( /*! ./../constants/Coloring */ "./src/WebGL/constants/Coloring.ts" ), f = t( /*! ./../constants/Shading */ "./src/WebGL/constants/Shading.ts" - ), _ = t( + ), u = t( /*! ../../colors */ "./src/colors.ts" - ), x = t( + ), y = t( /*! ../math */ "./src/WebGL/math/index.ts" ), h = t( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); - class u extends h.Material { + class _ extends h.Material { constructor(c) { - super(), this.color = new _.Color(16777215), this.ambient = new _.Color(1048575), this.emissive = new _.Color(0), this.imposter = !0, this.wrapAround = !1, this.wrapRGB = new x.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = f.Shading.SmoothShading, this.shaderID = null, this.vertexColors = s.Coloring.NoColors, this.skinning = !1, this.setValues(c); + super(), this.color = new u.Color(16777215), this.ambient = new u.Color(1048575), this.emissive = new u.Color(0), this.imposter = !0, this.wrapAround = !1, this.wrapRGB = new y.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = f.Shading.SmoothShading, this.shaderID = null, this.vertexColors = n.Coloring.NoColors, this.skinning = !1, this.setValues(c); } - clone(c = new u()) { + clone(c = new _()) { return super.clone.call(this, c), c.color.copy(this.color), c.ambient.copy(this.ambient), c.emissive.copy(this.emissive), c.wrapAround = this.wrapAround, c.wrapRGB.copy(this.wrapRGB), c.map = this.map, c.lightMap = this.lightMap, c.specularMap = this.specularMap, c.envMap = this.envMap, c.combine = this.combine, c.reflectivity = this.reflectivity, c.refractionRatio = this.refractionRatio, c.fog = this.fog, c.shading = this.shading, c.shaderID = this.shaderID, c.vertexColors = this.vertexColors, c.skinning = this.skinning, c.morphTargets = this.morphTargets, c.morphNormals = this.morphNormals, c; } } @@ -13164,31 +13164,31 @@ ATOM`, g); /* harmony export */ InstancedMaterial: () => ( /* binding */ - u + _ ) /* harmony export */ }); - var s = t( + var n = t( /*! ../constants/Coloring */ "./src/WebGL/constants/Coloring.ts" ), f = t( /*! ../constants/Shading */ "./src/WebGL/constants/Shading.ts" - ), _ = t( + ), u = t( /*! ../../colors */ "./src/colors.ts" - ), x = t( + ), y = t( /*! ../math */ "./src/WebGL/math/index.ts" ), h = t( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); - class u extends h.Material { + class _ extends h.Material { constructor(c) { - super(), this.color = new _.Color(16777215), this.ambient = new _.Color(1048575), this.emissive = new _.Color(0), this.wrapAround = !1, this.wrapRGB = new x.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = f.Shading.SmoothShading, this.shaderID = "instanced", this.vertexColors = s.Coloring.NoColors, this.skinning = !1, this.sphere = null, this.setValues(c); + super(), this.color = new u.Color(16777215), this.ambient = new u.Color(1048575), this.emissive = new u.Color(0), this.wrapAround = !1, this.wrapRGB = new y.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = f.Shading.SmoothShading, this.shaderID = "instanced", this.vertexColors = n.Coloring.NoColors, this.skinning = !1, this.sphere = null, this.setValues(c); } - clone(c = new u()) { + clone(c = new _()) { return super.clone.call(this, c), c.color.copy(this.color), c.ambient.copy(this.ambient), c.emissive.copy(this.emissive), c.wrapAround = this.wrapAround, c.wrapRGB.copy(this.wrapRGB), c.map = this.map, c.lightMap = this.lightMap, c.specularMap = this.specularMap, c.envMap = this.envMap, c.combine = this.combine, c.reflectivity = this.reflectivity, c.refractionRatio = this.refractionRatio, c.fog = this.fog, c.shading = this.shading, c.shaderID = this.shaderID, c.vertexColors = this.vertexColors, c.skinning = this.skinning, c.morphTargets = this.morphTargets, c.morphNormals = this.morphNormals, c.sphere = this.sphere, c; } } @@ -13205,22 +13205,22 @@ ATOM`, g); /* harmony export */ LineBasicMaterial: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../colors */ "./src/colors.ts" ), f = t( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); - class _ extends f.Material { + class u extends f.Material { constructor(h) { - super(), this.color = new s.Color(16777215), this.linewidth = 1, this.linecap = "round", this.linejoin = "round", this.vertexColors = !1, this.fog = !0, this.shaderID = "basic", this.setValues(h); + super(), this.color = new n.Color(16777215), this.linewidth = 1, this.linecap = "round", this.linejoin = "round", this.vertexColors = !1, this.fog = !0, this.shaderID = "basic", this.setValues(h); } - clone(h = new _()) { + clone(h = new u()) { return super.clone.call(this, h), h.color.copy(this.color), h; } } @@ -13242,26 +13242,26 @@ ATOM`, g); /* harmony export */ MaterialIdCount: () => ( /* binding */ - u + _ ) /* harmony export */ }); - var s = t( + var n = t( /*! ../constants/Sides */ "./src/WebGL/constants/Sides.ts" ), f = t( /*! ../core */ "./src/WebGL/core/index.ts" - ), _ = t( + ), u = t( /*! ../math */ "./src/WebGL/math/index.ts" - ), x = t( + ), y = t( /*! ../../colors */ "./src/colors.ts" ); class h extends f.EventDispatcher { constructor() { - super(...arguments), this.id = u++, this.name = "", this.side = s.FrontSide, this.opacity = 1, this.transparent = !1, this.depthTest = !0, this.depthWrite = !0, this.stencilTest = !0, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.alphaTest = 0, this.visible = !0, this.needsUpdate = !0, this.outline = !1; + super(...arguments), this.id = _++, this.name = "", this.side = n.FrontSide, this.opacity = 1, this.transparent = !1, this.depthTest = !0, this.depthWrite = !0, this.stencilTest = !0, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.alphaTest = 0, this.visible = !0, this.needsUpdate = !0, this.outline = !1; } setValues(c = {}) { if (c !== void 0) @@ -13273,7 +13273,7 @@ ATOM`, g); } if (C in this) { var A = this[C]; - A instanceof x.Color && b instanceof x.Color ? A.copy(b) : A instanceof x.Color ? A.set(b) : A instanceof _.Vector3 && b instanceof _.Vector3 ? A.copy(b) : this[C] = b; + A instanceof y.Color && b instanceof y.Color ? A.copy(b) : A instanceof y.Color ? A.set(b) : A instanceof u.Vector3 && b instanceof u.Vector3 ? A.copy(b) : this[C] = b; } } } @@ -13285,7 +13285,7 @@ ATOM`, g); this.dispatchEvent({ type: "dispose" }); } } - let u = 0; + let _ = 0; } ), /***/ @@ -13299,22 +13299,22 @@ ATOM`, g); /* harmony export */ MeshDoubleLambertMaterial: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ./../constants/Sides */ "./src/WebGL/constants/Sides.ts" ), f = t( /*! ./MeshLambertMaterial */ "./src/WebGL/materials/MeshLambertMaterial.ts" ); - class _ extends f.MeshLambertMaterial { + class u extends f.MeshLambertMaterial { constructor(h) { - super(h), this.shaderID = "lambertdouble", this.side = s.DoubleSide, this.outline = !1; + super(h), this.shaderID = "lambertdouble", this.side = n.DoubleSide, this.outline = !1; } - clone(h = new _()) { + clone(h = new u()) { return super.clone.call(this, h), h; } } @@ -13331,31 +13331,31 @@ ATOM`, g); /* harmony export */ MeshLambertMaterial: () => ( /* binding */ - u + _ ) /* harmony export */ }); - var s = t( + var n = t( /*! ./../constants/Coloring */ "./src/WebGL/constants/Coloring.ts" ), f = t( /*! ./../constants/Shading */ "./src/WebGL/constants/Shading.ts" - ), _ = t( + ), u = t( /*! ./Material */ "./src/WebGL/materials/Material.ts" - ), x = t( + ), y = t( /*! ../../colors */ "./src/colors.ts" ), h = t( /*! ../math */ "./src/WebGL/math/index.ts" ); - class u extends _.Material { + class _ extends u.Material { constructor(c) { - super(), this.color = new x.Color(16777215), this.ambient = new x.Color(1048575), this.emissive = new x.Color(0), this.wrapAround = !1, this.wrapRGB = new h.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = f.Shading.SmoothShading, this.shaderID = "lambert", this.vertexColors = s.Coloring.NoColors, this.skinning = !1, this.setValues(c); + super(), this.color = new y.Color(16777215), this.ambient = new y.Color(1048575), this.emissive = new y.Color(0), this.wrapAround = !1, this.wrapRGB = new h.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = f.Shading.SmoothShading, this.shaderID = "lambert", this.vertexColors = n.Coloring.NoColors, this.skinning = !1, this.setValues(c); } - clone(c = new u()) { + clone(c = new _()) { return super.clone.call(this, c), c.color.copy(this.color), c.ambient.copy(this.ambient), c.emissive.copy(this.emissive), c.wrapAround = this.wrapAround, c.wrapRGB.copy(this.wrapRGB), c.map = this.map, c.lightMap = this.lightMap, c.specularMap = this.specularMap, c.envMap = this.envMap, c.combine = this.combine, c.reflectivity = this.reflectivity, c.refractionRatio = this.refractionRatio, c.fog = this.fog, c.shading = this.shading, c.shaderID = this.shaderID, c.vertexColors = this.vertexColors, c.skinning = this.skinning, c.morphTargets = this.morphTargets, c.morphNormals = this.morphNormals, c; } } @@ -13372,22 +13372,22 @@ ATOM`, g); /* harmony export */ MeshOutlineMaterial: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../colors */ "./src/colors.ts" ), f = t( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); - class _ extends f.Material { + class u extends f.Material { constructor(h) { - super(), h = h || {}, this.fog = !0, this.shaderID = "outline", this.wireframe = !1, this.outlineColor = h.color || new s.Color(0, 0, 0), this.outlineWidth = h.width || 0.1, this.outlinePushback = h.pushback || 1; + super(), h = h || {}, this.fog = !0, this.shaderID = "outline", this.wireframe = !1, this.outlineColor = h.color || new n.Color(0, 0, 0), this.outlineWidth = h.width || 0.1, this.outlinePushback = h.pushback || 1; } - clone(h = new _()) { + clone(h = new u()) { return super.clone.call(this, h), h.fog = this.fog, h.shaderID = this.shaderID, h.wireframe = this.wireframe, h; } } @@ -13408,16 +13408,16 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ); - class f extends s.ImposterMaterial { - constructor(x) { - super(x), this.shaderID = "sphereimposter", this.setValues(x); + class f extends n.ImposterMaterial { + constructor(y) { + super(y), this.shaderID = "sphereimposter", this.setValues(y); } - clone(x = new f()) { - return super.clone.call(this, x), x; + clone(y = new f()) { + return super.clone.call(this, y), y; } } } @@ -13433,22 +13433,22 @@ ATOM`, g); /* harmony export */ SphereImposterOutlineMaterial: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../colors */ "./src/colors.ts" ), f = t( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ); - class _ extends f.ImposterMaterial { + class u extends f.ImposterMaterial { constructor(h) { - super(h), h = h || {}, this.shaderID = "sphereimposteroutline", this.outlineColor = h.color || new s.Color(0, 0, 0), this.outlineWidth = h.width || 0.1, this.outlinePushback = h.pushback || 1, this.setValues(h); + super(h), h = h || {}, this.shaderID = "sphereimposteroutline", this.outlineColor = h.color || new n.Color(0, 0, 0), this.outlineWidth = h.width || 0.1, this.outlinePushback = h.pushback || 1, this.setValues(h); } - clone(h = new _()) { + clone(h = new u()) { return super.clone.call(this, h), h.outlineColor = this.outlineColor, h.outlineWidth = this.outlineWidth, h.outlinePushback = this.outlinePushback, h; } } @@ -13465,31 +13465,31 @@ ATOM`, g); /* harmony export */ SpriteMaterial: () => ( /* binding */ - u + _ ) /* harmony export */ }); - var s = t( + var n = t( /*! ../constants/SpriteAlignment */ "./src/WebGL/constants/SpriteAlignment.ts" ), f = t( /*! ../core/Texture */ "./src/WebGL/core/Texture.ts" - ), _ = t( + ), u = t( /*! ../../colors */ "./src/colors.ts" - ), x = t( + ), y = t( /*! ../math */ "./src/WebGL/math/index.ts" ), h = t( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); - class u extends h.Material { + class _ extends h.Material { constructor(c) { - super(), this.color = new _.Color(16777215), this.map = new f.Texture(), this.useScreenCoordinates = !0, this.fog = !1, this.uvOffset = new x.Vector2(0, 0), this.uvScale = new x.Vector2(1, 1), this.depthTest = !this.useScreenCoordinates, this.sizeAttenuation = !this.useScreenCoordinates, this.screenOffset = this.screenOffset, this.scaleByViewPort = !this.sizeAttenuation, this.alignment = s.SpriteAlignment.center.clone(), this.setValues(c), c = c || {}, c.depthTest === void 0 && (this.depthTest = !this.useScreenCoordinates), c.sizeAttenuation === void 0 && (this.sizeAttenuation = !this.useScreenCoordinates), c.scaleByViewPort === void 0 && (this.scaleByViewPort = !this.sizeAttenuation); + super(), this.color = new u.Color(16777215), this.map = new f.Texture(), this.useScreenCoordinates = !0, this.fog = !1, this.uvOffset = new y.Vector2(0, 0), this.uvScale = new y.Vector2(1, 1), this.depthTest = !this.useScreenCoordinates, this.sizeAttenuation = !this.useScreenCoordinates, this.screenOffset = this.screenOffset, this.scaleByViewPort = !this.sizeAttenuation, this.alignment = n.SpriteAlignment.center.clone(), this.setValues(c), c = c || {}, c.depthTest === void 0 && (this.depthTest = !this.useScreenCoordinates), c.sizeAttenuation === void 0 && (this.sizeAttenuation = !this.useScreenCoordinates), c.scaleByViewPort === void 0 && (this.scaleByViewPort = !this.sizeAttenuation); } - clone(c = new u()) { + clone(c = new _()) { return super.clone.call(this, c), c.color.copy(this.color), c.map = this.map, c.useScreenCoordinates = this.useScreenCoordinates, c.screenOffset = this.screenOffset, c.sizeAttenuation = this.sizeAttenuation, c.scaleByViewport = this.scaleByViewPort, c.alignment.copy(this.alignment), c.uvOffset.copy(this.uvOffset), c; } } @@ -13510,16 +13510,16 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ); - class f extends s.ImposterMaterial { - constructor(x) { - super(x), this.shaderID = "stickimposter", this.setValues(x); + class f extends n.ImposterMaterial { + constructor(y) { + super(y), this.shaderID = "stickimposter", this.setValues(y); } - clone(x = new f()) { - return super.clone.call(this, x), x; + clone(y = new f()) { + return super.clone.call(this, y), y; } } } @@ -13535,22 +13535,22 @@ ATOM`, g); /* harmony export */ StickImposterOutlineMaterial: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../colors */ "./src/colors.ts" ), f = t( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ); - class _ extends f.ImposterMaterial { + class u extends f.ImposterMaterial { constructor(h = {}) { - super(h), this.shaderID = "stickimposteroutline", this.outlineColor = new s.Color(0, 0, 0), this.outlineWidth = 0.1, this.outlinePushback = 1, h.color && (this.outlineColor = h.color), h.width && (this.outlineWidth = h.width), h.pushback && (this.outlinePushback = h.pushback), this.setValues(h); + super(h), this.shaderID = "stickimposteroutline", this.outlineColor = new n.Color(0, 0, 0), this.outlineWidth = 0.1, this.outlinePushback = 1, h.color && (this.outlineColor = h.color), h.width && (this.outlineWidth = h.width), h.pushback && (this.outlinePushback = h.pushback), this.setValues(h); } - clone(h = new _()) { + clone(h = new u()) { return super.clone.call(this, h), h.outlineColor = this.outlineColor, h.outlineWidth = this.outlineWidth, h.outlinePushback = this.outlinePushback, h; } } @@ -13567,26 +13567,26 @@ ATOM`, g); /* harmony export */ VolumetricMaterial: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ../constants/Sides */ "./src/WebGL/constants/Sides.ts" ), f = t( /*! ../../colors */ "./src/colors.ts" - ), _ = t( + ), u = t( /*! ./Material */ "./src/WebGL/materials/Material.ts" ); - class x extends _.Material { - constructor(u) { - super(), this.transparent = !1, this.volumetric = !0, this.color = new f.Color(16777215), this.transferfn = null, this.map = void 0, this.extent = [], this.maxdepth = 100, this.unit = 0, this.texmatrix = null, this.transfermin = -1, this.transfermax = 1, this.subsamples = 5, this.shaderID = "volumetric", this.side = s.FrontSide, this.setValues(u); + class y extends u.Material { + constructor(_) { + super(), this.transparent = !1, this.volumetric = !0, this.color = new f.Color(16777215), this.transferfn = null, this.map = void 0, this.extent = [], this.maxdepth = 100, this.unit = 0, this.texmatrix = null, this.transfermin = -1, this.transfermax = 1, this.subsamples = 5, this.shaderID = "volumetric", this.side = n.FrontSide, this.setValues(_); } - clone(u = new x()) { - return super.clone.call(this, u), u.transparent = this.transparent, u.volumetric = this.volumetric, u.color = this.color, u.transferfn = this.transferfn, u.map = this.map, u.extent = this.extent, u.maxdepth = this.maxdepth, u.unit = this.unit, u.texmatrix = this.texmatrix, u.transfermin = this.transfermin, u.transfermax = this.transfermax, u.subsamples = this.subsamples, u.shaderID = this.shaderID, u.side = this.side, u; + clone(_ = new y()) { + return super.clone.call(this, _), _.transparent = this.transparent, _.volumetric = this.volumetric, _.color = this.color, _.transferfn = this.transferfn, _.map = this.map, _.extent = this.extent, _.maxdepth = this.maxdepth, _.unit = this.unit, _.texmatrix = this.texmatrix, _.transfermin = this.transfermin, _.transfermax = this.transfermax, _.subsamples = this.subsamples, _.shaderID = this.shaderID, _.side = this.side, _; } } } @@ -13602,7 +13602,7 @@ ATOM`, g); /* harmony export */ ImposterMaterial: () => ( /* reexport safe */ - s.ImposterMaterial + n.ImposterMaterial ), /* harmony export */ InstancedMaterial: () => ( @@ -13612,17 +13612,17 @@ ATOM`, g); /* harmony export */ LineBasicMaterial: () => ( /* reexport safe */ - _.LineBasicMaterial + u.LineBasicMaterial ), /* harmony export */ Material: () => ( /* reexport safe */ - x.Material + y.Material ), /* harmony export */ MaterialIdCount: () => ( /* reexport safe */ - x.MaterialIdCount + y.MaterialIdCount ), /* harmony export */ MeshDoubleLambertMaterial: () => ( @@ -13632,7 +13632,7 @@ ATOM`, g); /* harmony export */ MeshLambertMaterial: () => ( /* reexport safe */ - u.MeshLambertMaterial + _.MeshLambertMaterial ), /* harmony export */ MeshOutlineMaterial: () => ( @@ -13667,26 +13667,26 @@ ATOM`, g); /* harmony export */ VolumetricMaterial: () => ( /* reexport safe */ - n.VolumetricMaterial + s.VolumetricMaterial ) /* harmony export */ }); - var s = t( + var n = t( /*! ./ImposterMaterial */ "./src/WebGL/materials/ImposterMaterial.ts" ), f = t( /*! ./InstancedMaterial */ "./src/WebGL/materials/InstancedMaterial.ts" - ), _ = t( + ), u = t( /*! ./LineBasicMaterial */ "./src/WebGL/materials/LineBasicMaterial.ts" - ), x = t( + ), y = t( /*! ./Material */ "./src/WebGL/materials/Material.ts" ), h = t( /*! ./MeshDoubleLambertMaterial */ "./src/WebGL/materials/MeshDoubleLambertMaterial.ts" - ), u = t( + ), _ = t( /*! ./MeshLambertMaterial */ "./src/WebGL/materials/MeshLambertMaterial.ts" ), E = t( @@ -13707,7 +13707,7 @@ ATOM`, g); ), S = t( /*! ./StickImposterOutlineMaterial */ "./src/WebGL/materials/StickImposterOutlineMaterial.ts" - ), n = t( + ), s = t( /*! ./VolumetricMaterial */ "./src/WebGL/materials/VolumetricMaterial.ts" ); @@ -13724,19 +13724,19 @@ ATOM`, g); /* harmony export */ Quaternion: () => ( /* binding */ - s + n ) /* harmony export */ }); - class s { - constructor(_, x, h, u) { - this.x = _ || 0, this.y = x || 0, this.z = h || 0, this.w = u !== void 0 ? u : 1; + class n { + constructor(u, y, h, _) { + this.x = u || 0, this.y = y || 0, this.z = h || 0, this.w = _ !== void 0 ? _ : 1; } - set(_, x, h, u) { - return this.x = _, this.y = x, this.z = h, this.w = u, this; + set(u, y, h, _) { + return this.x = u, this.y = y, this.z = h, this.w = _, this; } - copy(_) { - return this.x = _.x, this.y = _.y, this.z = _.z, this.w = _.w, this; + copy(u) { + return this.x = u.x, this.y = u.y, this.z = u.z, this.w = u.w, this; } conjugate() { return this.x *= -1, this.y *= -1, this.z *= -1, this; @@ -13751,28 +13751,28 @@ ATOM`, g); return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); } normalize() { - let _ = this.length(); - return _ === 0 ? (this.x = 0, this.y = 0, this.z = 0, this.w = 1) : (_ = 1 / _, this.x *= _, this.y *= _, this.z *= _, this.w *= _), this; + let u = this.length(); + return u === 0 ? (this.x = 0, this.y = 0, this.z = 0, this.w = 1) : (u = 1 / u, this.x *= u, this.y *= u, this.z *= u, this.w *= u), this; } - multiply(_) { - return this.multiplyQuaternions(this, _); + multiply(u) { + return this.multiplyQuaternions(this, u); } - multiplyScalar(_) { - return this.x *= _, this.y *= _, this.z *= _, this.w *= _, this; + multiplyScalar(u) { + return this.x *= u, this.y *= u, this.z *= u, this.w *= u, this; } - multiplyQuaternions(_, x) { - const h = _.x, u = _.y, E = _.z, c = _.w, C = x.x, b = x.y, A = x.z, S = x.w; - return this.x = h * S + c * C + u * A - E * b, this.y = u * S + c * b + E * C - h * A, this.z = E * S + c * A + h * b - u * C, this.w = c * S - h * C - u * b - E * A, this; + multiplyQuaternions(u, y) { + const h = u.x, _ = u.y, E = u.z, c = u.w, C = y.x, b = y.y, A = y.z, S = y.w; + return this.x = h * S + c * C + _ * A - E * b, this.y = _ * S + c * b + E * C - h * A, this.z = E * S + c * A + h * b - _ * C, this.w = c * S - h * C - _ * b - E * A, this; } - sub(_) { - return this.x -= _.x, this.y -= _.y, this.z -= _.z, this.w -= _.w, this; + sub(u) { + return this.x -= u.x, this.y -= u.y, this.z -= u.z, this.w -= u.w, this; } clone() { - return new s(this.x, this.y, this.z, this.w); + return new n(this.x, this.y, this.z, this.w); } - setFromEuler(_) { - const x = Math.cos(_.x / 2), h = Math.cos(_.y / 2), u = Math.cos(_.z / 2), E = Math.sin(_.x / 2), c = Math.sin(_.y / 2), C = Math.sin(_.z / 2); - return this.x = E * h * u + x * c * C, this.y = x * c * u - E * h * C, this.z = x * h * C + E * c * u, this.w = x * h * u - E * c * C, this; + setFromEuler(u) { + const y = Math.cos(u.x / 2), h = Math.cos(u.y / 2), _ = Math.cos(u.z / 2), E = Math.sin(u.x / 2), c = Math.sin(u.y / 2), C = Math.sin(u.z / 2); + return this.x = E * h * _ + y * c * C, this.y = y * c * _ - E * h * C, this.z = y * h * C + E * c * _, this.w = y * h * _ - E * c * C, this; } } } @@ -13788,25 +13788,25 @@ ATOM`, g); /* harmony export */ Vector2: () => ( /* binding */ - s + n ) /* harmony export */ }); - class s { - constructor(_, x) { - this.x = _ || 0, this.y = x || 0; + class n { + constructor(u, y) { + this.x = u || 0, this.y = y || 0; } - set(_, x) { - return this.x = _, this.y = x, this; + set(u, y) { + return this.x = u, this.y = y, this; } - subVectors(_, x) { - return this.x = _.x - x.x, this.y = _.y - x.y, this; + subVectors(u, y) { + return this.x = u.x - y.x, this.y = u.y - y.y, this; } - copy(_) { - return this.x = _.x, this.y = _.y, this; + copy(u) { + return this.x = u.x, this.y = u.y, this; } clone() { - return new s(this.x, this.y); + return new n(this.x, this.y); } } } @@ -13822,22 +13822,22 @@ ATOM`, g); /* harmony export */ Matrix3: () => ( /* reexport safe */ - u.Matrix3 + _.Matrix3 ), /* harmony export */ Matrix4: () => ( /* reexport safe */ - u.Matrix4 + _.Matrix4 ), /* harmony export */ Quaternion: () => ( /* reexport safe */ - s.Quaternion + n.Quaternion ), /* harmony export */ Ray: () => ( /* reexport safe */ - u.Ray + _.Ray ), /* harmony export */ Vector2: () => ( @@ -13847,17 +13847,17 @@ ATOM`, g); /* harmony export */ Vector3: () => ( /* reexport safe */ - u.Vector3 + _.Vector3 ), /* harmony export */ clamp: () => ( /* reexport safe */ - _.clamp + u.clamp ), /* harmony export */ conversionMatrix3: () => ( /* reexport safe */ - x.conversionMatrix3 + y.conversionMatrix3 ), /* harmony export */ degToRad: () => ( @@ -13866,22 +13866,22 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./Quaternion */ "./src/WebGL/math/Quaternion.ts" ), f = t( /*! ./Vector2 */ "./src/WebGL/math/Vector2.ts" - ), _ = t( + ), u = t( /*! ./utils/clamp */ "./src/WebGL/math/utils/clamp.ts" - ), x = t( + ), y = t( /*! ./utils/conversionMatrix3 */ "./src/WebGL/math/utils/conversionMatrix3.ts" ), h = t( /*! ./utils/degToRad */ "./src/WebGL/math/utils/degToRad.ts" - ), u = t( + ), _ = t( /*! ./math */ "./src/WebGL/math/math.ts" ); @@ -13917,63 +13917,63 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./utils/degToRad */ "./src/WebGL/math/utils/degToRad.ts" ), f = t( /*! ./utils/clamp */ "./src/WebGL/math/utils/clamp.ts" - ), _, x, h, u, E; + ), u, y, h, _, E; class c { - constructor(n = 1, o = 0, w = 0, p = 0, v = 0, a = 1, l = 0, g = 0, M = 0, L = 0, T = 1, D = 0, R = 0, B = 0, P = 0, z = 1) { - typeof n < "u" && typeof n != "number" ? this.elements = new Float32Array(n) : (this.elements = new Float32Array(16), this.elements[0] = n, this.elements[4] = o, this.elements[8] = w, this.elements[12] = p, this.elements[1] = v, this.elements[5] = a, this.elements[9] = l, this.elements[13] = g, this.elements[2] = M, this.elements[6] = L, this.elements[10] = T, this.elements[14] = D, this.elements[3] = R, this.elements[7] = B, this.elements[11] = P, this.elements[15] = z); + constructor(s = 1, o = 0, w = 0, p = 0, v = 0, a = 1, l = 0, g = 0, M = 0, L = 0, T = 1, D = 0, I = 0, z = 0, P = 0, B = 1) { + typeof s < "u" && typeof s != "number" ? this.elements = new Float32Array(s) : (this.elements = new Float32Array(16), this.elements[0] = s, this.elements[4] = o, this.elements[8] = w, this.elements[12] = p, this.elements[1] = v, this.elements[5] = a, this.elements[9] = l, this.elements[13] = g, this.elements[2] = M, this.elements[6] = L, this.elements[10] = T, this.elements[14] = D, this.elements[3] = I, this.elements[7] = z, this.elements[11] = P, this.elements[15] = B); } // eslint-disable-next-line no-unused-vars, class-methods-use-this - makeScale(n, o, w) { + makeScale(s, o, w) { throw new Error("Method not implemented."); } - set(n, o, w, p, v, a, l, g, M, L, T, D, R, B, P, z) { + set(s, o, w, p, v, a, l, g, M, L, T, D, I, z, P, B) { const F = this.elements; - return F[0] = n, F[4] = o, F[8] = w, F[12] = p, F[1] = v, F[5] = a, F[9] = l, F[13] = g, F[2] = M, F[6] = L, F[10] = T, F[14] = D, F[3] = R, F[7] = B, F[11] = P, F[15] = z, this; + return F[0] = s, F[4] = o, F[8] = w, F[12] = p, F[1] = v, F[5] = a, F[9] = l, F[13] = g, F[2] = M, F[6] = L, F[10] = T, F[14] = D, F[3] = I, F[7] = z, F[11] = P, F[15] = B, this; } identity() { return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this; } - copy(n) { - const o = n.elements; + copy(s) { + const o = s.elements; return this.set(o[0], o[4], o[8], o[12], o[1], o[5], o[9], o[13], o[2], o[6], o[10], o[14], o[3], o[7], o[11], o[15]), this; } matrix3FromTopLeft() { - const n = this.elements; - return new b(n[0], n[4], n[8], n[1], n[5], n[9], n[2], n[6], n[10]); + const s = this.elements; + return new b(s[0], s[4], s[8], s[1], s[5], s[9], s[2], s[6], s[10]); } - setRotationFromEuler(n, o) { - const w = this.elements, { x: p, y: v, z: a } = n, l = Math.cos(p), g = Math.sin(p), M = Math.cos(v), L = Math.sin(v), T = Math.cos(a), D = Math.sin(a); + setRotationFromEuler(s, o) { + const w = this.elements, { x: p, y: v, z: a } = s, l = Math.cos(p), g = Math.sin(p), M = Math.cos(v), L = Math.sin(v), T = Math.cos(a), D = Math.sin(a); if (o === void 0 || o === "XYZ") { - const R = l * T, B = l * D, P = g * T, z = g * D; - w[0] = M * T, w[4] = -M * D, w[8] = L, w[1] = B + P * L, w[5] = R - z * L, w[9] = -g * M, w[2] = z - R * L, w[6] = P + B * L, w[10] = l * M; + const I = l * T, z = l * D, P = g * T, B = g * D; + w[0] = M * T, w[4] = -M * D, w[8] = L, w[1] = z + P * L, w[5] = I - B * L, w[9] = -g * M, w[2] = B - I * L, w[6] = P + z * L, w[10] = l * M; } else console.error(`Error with matrix4 setRotationFromEuler. Order: ${o}`); return this; } - setRotationFromQuaternion(n) { - const o = this.elements, { x: w, y: p, z: v, w: a } = n, l = w + w, g = p + p, M = v + v, L = w * l, T = w * g, D = w * M, R = p * g, B = p * M, P = v * M, z = a * l, F = a * g, N = a * M; - return o[0] = 1 - (R + P), o[4] = T - N, o[8] = D + F, o[1] = T + N, o[5] = 1 - (L + P), o[9] = B - z, o[2] = D - F, o[6] = B + z, o[10] = 1 - (L + R), this; + setRotationFromQuaternion(s) { + const o = this.elements, { x: w, y: p, z: v, w: a } = s, l = w + w, g = p + p, M = v + v, L = w * l, T = w * g, D = w * M, I = p * g, z = p * M, P = v * M, B = a * l, F = a * g, N = a * M; + return o[0] = 1 - (I + P), o[4] = T - N, o[8] = D + F, o[1] = T + N, o[5] = 1 - (L + P), o[9] = z - B, o[2] = D - F, o[6] = z + B, o[10] = 1 - (L + I), this; } - multiplyMatrices(n, o) { - const w = n.elements, p = o.elements, v = this.elements, a = w[0], l = w[4], g = w[8], M = w[12], L = w[1], T = w[5], D = w[9], R = w[13], B = w[2], P = w[6], z = w[10], F = w[14], N = w[3], $ = w[7], k = w[11], G = w[15], H = p[0], U = p[4], V = p[8], Q = p[12], oe = p[1], ee = p[5], ne = p[9], me = p[13], se = p[2], fe = p[6], Ce = p[10], Me = p[14], Te = p[3], ae = p[7], pe = p[11], we = p[15]; - return v[0] = a * H + l * oe + g * se + M * Te, v[4] = a * U + l * ee + g * fe + M * ae, v[8] = a * V + l * ne + g * Ce + M * pe, v[12] = a * Q + l * me + g * Me + M * we, v[1] = L * H + T * oe + D * se + R * Te, v[5] = L * U + T * ee + D * fe + R * ae, v[9] = L * V + T * ne + D * Ce + R * pe, v[13] = L * Q + T * me + D * Me + R * we, v[2] = B * H + P * oe + z * se + F * Te, v[6] = B * U + P * ee + z * fe + F * ae, v[10] = B * V + P * ne + z * Ce + F * pe, v[14] = B * Q + P * me + z * Me + F * we, v[3] = N * H + $ * oe + k * se + G * Te, v[7] = N * U + $ * ee + k * fe + G * ae, v[11] = N * V + $ * ne + k * Ce + G * pe, v[15] = N * Q + $ * me + k * Me + G * we, this; + multiplyMatrices(s, o) { + const w = s.elements, p = o.elements, v = this.elements, a = w[0], l = w[4], g = w[8], M = w[12], L = w[1], T = w[5], D = w[9], I = w[13], z = w[2], P = w[6], B = w[10], F = w[14], N = w[3], $ = w[7], k = w[11], G = w[15], H = p[0], U = p[4], V = p[8], Q = p[12], ae = p[1], oe = p[5], q = p[9], me = p[13], ne = p[2], fe = p[6], Ce = p[10], Me = p[14], Te = p[3], se = p[7], pe = p[11], we = p[15]; + return v[0] = a * H + l * ae + g * ne + M * Te, v[4] = a * U + l * oe + g * fe + M * se, v[8] = a * V + l * q + g * Ce + M * pe, v[12] = a * Q + l * me + g * Me + M * we, v[1] = L * H + T * ae + D * ne + I * Te, v[5] = L * U + T * oe + D * fe + I * se, v[9] = L * V + T * q + D * Ce + I * pe, v[13] = L * Q + T * me + D * Me + I * we, v[2] = z * H + P * ae + B * ne + F * Te, v[6] = z * U + P * oe + B * fe + F * se, v[10] = z * V + P * q + B * Ce + F * pe, v[14] = z * Q + P * me + B * Me + F * we, v[3] = N * H + $ * ae + k * ne + G * Te, v[7] = N * U + $ * oe + k * fe + G * se, v[11] = N * V + $ * q + k * Ce + G * pe, v[15] = N * Q + $ * me + k * Me + G * we, this; } - multiplyScalar(n) { + multiplyScalar(s) { const o = this.elements; - return o[0] *= n, o[4] *= n, o[8] *= n, o[12] *= n, o[1] *= n, o[5] *= n, o[9] *= n, o[13] *= n, o[2] *= n, o[6] *= n, o[10] *= n, o[14] *= n, o[3] *= n, o[7] *= n, o[11] *= n, o[15] *= n, this; + return o[0] *= s, o[4] *= s, o[8] *= s, o[12] *= s, o[1] *= s, o[5] *= s, o[9] *= s, o[13] *= s, o[2] *= s, o[6] *= s, o[10] *= s, o[14] *= s, o[3] *= s, o[7] *= s, o[11] *= s, o[15] *= s, this; } - makeTranslation(n, o, w) { - return this.set(1, 0, 0, n, 0, 1, 0, o, 0, 0, 1, w, 0, 0, 0, 1), this; + makeTranslation(s, o, w) { + return this.set(1, 0, 0, s, 0, 1, 0, o, 0, 0, 1, w, 0, 0, 0, 1), this; } // snap values close to integers to their integer value // useful and identifying identity matrices - snap(n) { + snap(s) { const o = Math.pow(10, 4), w = this.elements; for (let p = 0; p < 16; p++) { const v = Math.round(w[p]); @@ -13982,22 +13982,22 @@ ATOM`, g); return this; } transpose() { - const n = this.elements; + const s = this.elements; let o; - return o = n[1], n[1] = n[4], n[4] = o, o = n[2], n[2] = n[8], n[8] = o, o = n[6], n[6] = n[9], n[9] = o, o = n[3], n[3] = n[12], n[12] = o, o = n[7], n[7] = n[13], n[13] = o, o = n[11], n[11] = n[14], n[14] = o, this; + return o = s[1], s[1] = s[4], s[4] = o, o = s[2], s[2] = s[8], s[8] = o, o = s[6], s[6] = s[9], s[9] = o, o = s[3], s[3] = s[12], s[12] = o, o = s[7], s[7] = s[13], s[13] = o, o = s[11], s[11] = s[14], s[14] = o, this; } - setPosition(n) { + setPosition(s) { const o = this.elements; - return o[12] = n.x, o[13] = n.y, o[14] = n.z, this; + return o[12] = s.x, o[13] = s.y, o[14] = s.z, this; } - translate(n) { + translate(s) { const o = this.elements; - return o[12] += n.x, o[13] += n.y, o[14] += n.z, this; + return o[12] += s.x, o[13] += s.y, o[14] += s.z, this; } - getInverse(n, o) { - const w = this.elements, p = n.elements, v = p[0], a = p[4], l = p[8], g = p[12], M = p[1], L = p[5], T = p[9], D = p[13], R = p[2], B = p[6], P = p[10], z = p[14], F = p[3], N = p[7], $ = p[11], k = p[15]; - w[0] = T * z * N - D * P * N + D * B * $ - L * z * $ - T * B * k + L * P * k, w[4] = g * P * N - l * z * N - g * B * $ + a * z * $ + l * B * k - a * P * k, w[8] = l * D * N - g * T * N + g * L * $ - a * D * $ - l * L * k + a * T * k, w[12] = g * T * B - l * D * B - g * L * P + a * D * P + l * L * z - a * T * z, w[1] = D * P * F - T * z * F - D * R * $ + M * z * $ + T * R * k - M * P * k, w[5] = l * z * F - g * P * F + g * R * $ - v * z * $ - l * R * k + v * P * k, w[9] = g * T * F - l * D * F - g * M * $ + v * D * $ + l * M * k - v * T * k, w[13] = l * D * R - g * T * R + g * M * P - v * D * P - l * M * z + v * T * z, w[2] = L * z * F - D * B * F + D * R * N - M * z * N - L * R * k + M * B * k, w[6] = g * B * F - a * z * F - g * R * N + v * z * N + a * R * k - v * B * k, w[10] = a * D * F - g * L * F + g * M * N - v * D * N - a * M * k + v * L * k, w[14] = g * L * R - a * D * R - g * M * B + v * D * B + a * M * z - v * L * z, w[3] = T * B * F - L * P * F - T * R * N + M * P * N + L * R * $ - M * B * $, w[7] = a * P * F - l * B * F + l * R * N - v * P * N - a * R * $ + v * B * $, w[11] = l * L * F - a * T * F - l * M * N + v * T * N + a * M * $ - v * L * $, w[15] = a * T * R - l * L * R + l * M * B - v * T * B - a * M * P + v * L * P; - const G = v * w[0] + M * w[4] + R * w[8] + F * w[12]; + getInverse(s, o) { + const w = this.elements, p = s.elements, v = p[0], a = p[4], l = p[8], g = p[12], M = p[1], L = p[5], T = p[9], D = p[13], I = p[2], z = p[6], P = p[10], B = p[14], F = p[3], N = p[7], $ = p[11], k = p[15]; + w[0] = T * B * N - D * P * N + D * z * $ - L * B * $ - T * z * k + L * P * k, w[4] = g * P * N - l * B * N - g * z * $ + a * B * $ + l * z * k - a * P * k, w[8] = l * D * N - g * T * N + g * L * $ - a * D * $ - l * L * k + a * T * k, w[12] = g * T * z - l * D * z - g * L * P + a * D * P + l * L * B - a * T * B, w[1] = D * P * F - T * B * F - D * I * $ + M * B * $ + T * I * k - M * P * k, w[5] = l * B * F - g * P * F + g * I * $ - v * B * $ - l * I * k + v * P * k, w[9] = g * T * F - l * D * F - g * M * $ + v * D * $ + l * M * k - v * T * k, w[13] = l * D * I - g * T * I + g * M * P - v * D * P - l * M * B + v * T * B, w[2] = L * B * F - D * z * F + D * I * N - M * B * N - L * I * k + M * z * k, w[6] = g * z * F - a * B * F - g * I * N + v * B * N + a * I * k - v * z * k, w[10] = a * D * F - g * L * F + g * M * N - v * D * N - a * M * k + v * L * k, w[14] = g * L * I - a * D * I - g * M * z + v * D * z + a * M * B - v * L * B, w[3] = T * z * F - L * P * F - T * I * N + M * P * N + L * I * $ - M * z * $, w[7] = a * P * F - l * z * F + l * I * N - v * P * N - a * I * $ + v * z * $, w[11] = l * L * F - a * T * F - l * M * N + v * T * N + a * M * $ - v * L * $, w[15] = a * T * I - l * L * I + l * M * z - v * T * z - a * M * P + v * L * P; + const G = v * w[0] + M * w[4] + I * w[8] + F * w[12]; if (G === 0) { const H = "Matrix4.getInverse(): can't invert matrix, determinant is 0"; if (o) @@ -14007,7 +14007,7 @@ ATOM`, g); return this.multiplyScalar(1 / G), this; } isReflected() { - const n = this.elements, o = n[0], w = n[4], p = n[8], v = n[1], a = n[5], l = n[9], g = n[2], M = n[6], L = n[10]; + const s = this.elements, o = s[0], w = s[4], p = s[8], v = s[1], a = s[5], l = s[9], g = s[2], M = s[6], L = s[10]; return o * a * L + // +aei v * M * p + // +bfg g * w * l - // +cdh @@ -14015,116 +14015,116 @@ ATOM`, g); v * w * L - // -bdi o * M * l < 0; } - scale(n) { - const o = this.elements, { x: w } = n, { y: p } = n, { z: v } = n; + scale(s) { + const o = this.elements, { x: w } = s, { y: p } = s, { z: v } = s; return o[0] *= w, o[4] *= p, o[8] *= v, o[1] *= w, o[5] *= p, o[9] *= v, o[2] *= w, o[6] *= p, o[10] *= v, o[3] *= w, o[7] *= p, o[11] *= v, this; } getMaxScaleOnAxis() { - const n = this.elements, o = n[0] * n[0] + n[1] * n[1] + n[2] * n[2], w = n[4] * n[4] + n[5] * n[5] + n[6] * n[6], p = n[8] * n[8] + n[9] * n[9] + n[10] * n[10]; + const s = this.elements, o = s[0] * s[0] + s[1] * s[1] + s[2] * s[2], w = s[4] * s[4] + s[5] * s[5] + s[6] * s[6], p = s[8] * s[8] + s[9] * s[9] + s[10] * s[10]; return Math.sqrt(Math.max(o, Math.max(w, p))); } - makeFrustum(n, o, w, p, v, a) { - const l = this.elements, g = 2 * v / (o - n), M = 2 * v / (p - w), L = (o + n) / (o - n), T = (p + w) / (p - w), D = -(a + v) / (a - v), R = -2 * a * v / (a - v); - return l[0] = g, l[4] = 0, l[8] = L, l[12] = 0, l[1] = 0, l[5] = M, l[9] = T, l[13] = 0, l[2] = 0, l[6] = 0, l[10] = D, l[14] = R, l[3] = 0, l[7] = 0, l[11] = -1, l[15] = 0, this; + makeFrustum(s, o, w, p, v, a) { + const l = this.elements, g = 2 * v / (o - s), M = 2 * v / (p - w), L = (o + s) / (o - s), T = (p + w) / (p - w), D = -(a + v) / (a - v), I = -2 * a * v / (a - v); + return l[0] = g, l[4] = 0, l[8] = L, l[12] = 0, l[1] = 0, l[5] = M, l[9] = T, l[13] = 0, l[2] = 0, l[6] = 0, l[10] = D, l[14] = I, l[3] = 0, l[7] = 0, l[11] = -1, l[15] = 0, this; } - makePerspective(n, o, w, p) { - const v = w * Math.tan((0, s.degToRad)(n * 0.5)), a = -v, l = a * o, g = v * o; + makePerspective(s, o, w, p) { + const v = w * Math.tan((0, n.degToRad)(s * 0.5)), a = -v, l = a * o, g = v * o; return this.makeFrustum(l, g, a, v, w, p); } - makeOrthographic(n, o, w, p, v, a) { - const l = this.elements, g = 1 / (o - n), M = 1 / (w - p), L = 1 / (a - v), T = (o + n) * g, D = (w + p) * M, R = (a + v) * L; - return l[0] = 2 * g, l[4] = 0, l[8] = 0, l[12] = -T, l[1] = 0, l[5] = 2 * M, l[9] = 0, l[13] = -D, l[2] = 0, l[6] = 0, l[10] = -2 * L, l[14] = -R, l[3] = 0, l[7] = 0, l[11] = 0, l[15] = 1, this; + makeOrthographic(s, o, w, p, v, a) { + const l = this.elements, g = 1 / (o - s), M = 1 / (w - p), L = 1 / (a - v), T = (o + s) * g, D = (w + p) * M, I = (a + v) * L; + return l[0] = 2 * g, l[4] = 0, l[8] = 0, l[12] = -T, l[1] = 0, l[5] = 2 * M, l[9] = 0, l[13] = -D, l[2] = 0, l[6] = 0, l[10] = -2 * L, l[14] = -I, l[3] = 0, l[7] = 0, l[11] = 0, l[15] = 1, this; } - isEqual(n) { - const o = n.elements, w = this.elements; + isEqual(s) { + const o = s.elements, w = this.elements; return w[0] === o[0] && w[4] === o[4] && w[8] === o[8] && w[12] === o[12] && w[1] === o[1] && w[5] === o[5] && w[9] === o[9] && w[13] === o[13] && w[2] === o[2] && w[6] === o[6] && w[10] === o[10] && w[14] === o[14] && w[3] === o[3] && w[7] === o[7] && w[11] === o[11] && w[15] === o[15]; } clone() { - const n = this.elements; - return new c(n[0], n[4], n[8], n[12], n[1], n[5], n[9], n[13], n[2], n[6], n[10], n[14], n[3], n[7], n[11], n[15]); + const s = this.elements; + return new c(s[0], s[4], s[8], s[12], s[1], s[5], s[9], s[13], s[2], s[6], s[10], s[14], s[3], s[7], s[11], s[15]); } isIdentity() { - const n = this.elements; - return n[0] === 1 && n[4] === 0 && n[8] === 0 && n[12] === 0 && n[1] === 0 && n[5] === 1 && n[9] === 0 && n[13] === 0 && n[2] === 0 && n[6] === 0 && n[10] === 1 && n[14] === 0 && n[3] === 0 && n[7] === 0 && n[11] === 0 && n[15] === 1; + const s = this.elements; + return s[0] === 1 && s[4] === 0 && s[8] === 0 && s[12] === 0 && s[1] === 0 && s[5] === 1 && s[9] === 0 && s[13] === 0 && s[2] === 0 && s[6] === 0 && s[10] === 1 && s[14] === 0 && s[3] === 0 && s[7] === 0 && s[11] === 0 && s[15] === 1; } // return true if elements are with digits of identity - isNearlyIdentity(n) { - return this.clone().snap(n).isIdentity(); + isNearlyIdentity(s) { + return this.clone().snap(s).isIdentity(); } - getScale(n) { + getScale(s) { const o = this.elements; - return n = n || new C(), h.set(o[0], o[1], o[2]), u.set(o[4], o[5], o[6]), E.set(o[8], o[9], o[10]), n.x = h.length(), n.y = u.length(), n.z = E.length(), n; + return s = s || new C(), h.set(o[0], o[1], o[2]), _.set(o[4], o[5], o[6]), E.set(o[8], o[9], o[10]), s.x = h.length(), s.y = _.length(), s.z = E.length(), s; } - lookAt(n, o, w) { + lookAt(s, o, w) { const p = this.elements; - return E.subVectors(n, o).normalize(), E.length() === 0 && (E.z = 1), h.crossVectors(w, E).normalize(), h.length() === 0 && (E.x += 1e-4, h.crossVectors(w, E).normalize()), u.crossVectors(E, h), p[0] = h.x, p[4] = u.x, p[8] = E.x, p[1] = h.y, p[5] = u.y, p[9] = E.y, p[2] = h.z, p[6] = u.z, p[10] = E.z, this; + return E.subVectors(s, o).normalize(), E.length() === 0 && (E.z = 1), h.crossVectors(w, E).normalize(), h.length() === 0 && (E.x += 1e-4, h.crossVectors(w, E).normalize()), _.crossVectors(E, h), p[0] = h.x, p[4] = _.x, p[8] = E.x, p[1] = h.y, p[5] = _.y, p[9] = E.y, p[2] = h.z, p[6] = _.z, p[10] = E.z, this; } - compose(n, o, w) { + compose(s, o, w) { const p = this.elements; - return _.identity(), _.setRotationFromQuaternion(o), x.makeScale(w.x, w.y, w.z), this.multiplyMatrices(_, x), p[12] = n.x, p[13] = n.y, p[14] = n.z, this; + return u.identity(), u.setRotationFromQuaternion(o), y.makeScale(w.x, w.y, w.z), this.multiplyMatrices(u, y), p[12] = s.x, p[13] = s.y, p[14] = s.z, this; } } - _ = new c(), x = new c(); + u = new c(), y = new c(); class C { - constructor(n, o, w) { - this.x = n || 0, this.y = o || 0, this.z = w || 0, this.atomid = void 0; + constructor(s, o, w) { + this.x = s || 0, this.y = o || 0, this.z = w || 0, this.atomid = void 0; } - set(n, o, w) { - return this.x = n, this.y = o, this.z = w, this; + set(s, o, w) { + return this.x = s, this.y = o, this.z = w, this; } - copy(n) { - return this.x = n.x, this.y = n.y, this.z = n.z, this; + copy(s) { + return this.x = s.x, this.y = s.y, this.z = s.z, this; } - add(n) { - return this.x += n.x, this.y += n.y, this.z += n.z, this; + add(s) { + return this.x += s.x, this.y += s.y, this.z += s.z, this; } - addVectors(n, o) { - return this.x = n.x + o.x, this.y = n.y + o.y, this.z = n.z + o.z, this; + addVectors(s, o) { + return this.x = s.x + o.x, this.y = s.y + o.y, this.z = s.z + o.z, this; } - multiplyVectors(n, o) { - return this.x = n.x * o.x, this.y = n.y * o.y, this.z = n.z * o.z, this; + multiplyVectors(s, o) { + return this.x = s.x * o.x, this.y = s.y * o.y, this.z = s.z * o.z, this; } - sub(n) { - return this.x -= n.x, this.y -= n.y, this.z -= n.z, this; + sub(s) { + return this.x -= s.x, this.y -= s.y, this.z -= s.z, this; } - subVectors(n, o) { - return this.x = n.x - o.x, this.y = n.y - o.y, this.z = n.z - o.z, this; + subVectors(s, o) { + return this.x = s.x - o.x, this.y = s.y - o.y, this.z = s.z - o.z, this; } - multiplyScalar(n) { - return this.x *= n, this.y *= n, this.z *= n, this; + multiplyScalar(s) { + return this.x *= s, this.y *= s, this.z *= s, this; } - divideScalar(n) { - return n !== 0 ? (this.x /= n, this.y /= n, this.z /= n) : (this.x = 0, this.y = 0, this.z = 0), this; + divideScalar(s) { + return s !== 0 ? (this.x /= s, this.y /= s, this.z /= s) : (this.x = 0, this.y = 0, this.z = 0), this; } // accumulate maximum - max(n) { - return this.x = Math.max(this.x, n.x), this.y = Math.max(this.y, n.y), this.z = Math.max(this.z, n.z), this; + max(s) { + return this.x = Math.max(this.x, s.x), this.y = Math.max(this.y, s.y), this.z = Math.max(this.z, s.z), this; } // accumulate min - min(n) { - return this.x = Math.min(this.x, n.x), this.y = Math.min(this.y, n.y), this.z = Math.min(this.z, n.z), this; + min(s) { + return this.x = Math.min(this.x, s.x), this.y = Math.min(this.y, s.y), this.z = Math.min(this.z, s.z), this; } - distanceTo(n) { - return Math.sqrt(this.distanceToSquared(n)); + distanceTo(s) { + return Math.sqrt(this.distanceToSquared(s)); } - distanceToSquared(n) { - const o = this.x - n.x, w = this.y - n.y, p = this.z - n.z; + distanceToSquared(s) { + const o = this.x - s.x, w = this.y - s.y, p = this.z - s.z; return o * o + w * w + p * p; } - applyMatrix3(n) { - const { x: o } = this, { y: w } = this, { z: p } = this, v = n.elements; + applyMatrix3(s) { + const { x: o } = this, { y: w } = this, { z: p } = this, v = s.elements; return this.x = v[0] * o + v[3] * w + v[6] * p, this.y = v[1] * o + v[4] * w + v[7] * p, this.z = v[2] * o + v[5] * w + v[8] * p, this; } - applyMatrix4(n) { - const { x: o } = this, { y: w } = this, { z: p } = this, v = n.elements; + applyMatrix4(s) { + const { x: o } = this, { y: w } = this, { z: p } = this, v = s.elements; return this.x = v[0] * o + v[4] * w + v[8] * p + v[12], this.y = v[1] * o + v[5] * w + v[9] * p + v[13], this.z = v[2] * o + v[6] * w + v[10] * p + v[14], this; } - applyProjection(n) { - const { x: o } = this, { y: w } = this, { z: p } = this, v = n.elements, a = v[3] * o + v[7] * w + v[11] * p + v[15]; + applyProjection(s) { + const { x: o } = this, { y: w } = this, { z: p } = this, v = s.elements, a = v[3] * o + v[7] * w + v[11] * p + v[15]; return this.x = (v[0] * o + v[4] * w + v[8] * p + v[12]) / a, this.y = (v[1] * o + v[5] * w + v[9] * p + v[13]) / a, this.z = (v[2] * o + v[6] * w + v[10] * p + v[14]) / a, this; } - applyQuaternion(n) { - const { x: o } = this, { y: w } = this, { z: p } = this, v = n.x, a = n.y, l = n.z, g = n.w, M = {}; + applyQuaternion(s) { + const { x: o } = this, { y: w } = this, { z: p } = this, v = s.x, a = s.y, l = s.z, g = s.w, M = {}; M.x = 2 * (w * l - p * a), M.y = 2 * (p * v - o * l), M.z = 2 * (o * a - w * v); const L = {}; return L.x = M.y * l - M.z * a, L.y = M.z * v - M.x * l, L.z = M.x * a - M.y * v, this.x = o + g * M.x + L.x, this.y = w + g * M.y + L.y, this.z = p + g * M.z + L.z, this; @@ -14132,8 +14132,8 @@ ATOM`, g); negate() { return this.multiplyScalar(-1); } - dot(n) { - return this.x * n.x + this.y * n.y + this.z * n.z; + dot(s) { + return this.x * s.x + this.y * s.y + this.z * s.z; } length() { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); @@ -14144,73 +14144,73 @@ ATOM`, g); normalize() { return this.divideScalar(this.length()); } - cross(n) { + cross(s) { const { x: o } = this, { y: w } = this, { z: p } = this; - return this.x = w * n.z - p * n.y, this.y = p * n.x - o * n.z, this.z = o * n.y - w * n.x, this; + return this.x = w * s.z - p * s.y, this.y = p * s.x - o * s.z, this.z = o * s.y - w * s.x, this; } - crossVectors(n, o) { - return this.x = n.y * o.z - n.z * o.y, this.y = n.z * o.x - n.x * o.z, this.z = n.x * o.y - n.y * o.x, this; + crossVectors(s, o) { + return this.x = s.y * o.z - s.z * o.y, this.y = s.z * o.x - s.x * o.z, this.z = s.x * o.y - s.y * o.x, this; } - equals(n) { - return this.x == n.x && this.y == n.y && this.z == n.z; + equals(s) { + return this.x == s.x && this.y == s.y && this.z == s.z; } - getPositionFromMatrix(n) { - return this.x = n.elements[12], this.y = n.elements[13], this.z = n.elements[14], this; + getPositionFromMatrix(s) { + return this.x = s.elements[12], this.y = s.elements[13], this.z = s.elements[14], this; } - setEulerFromRotationMatrix(n, o) { - const w = n.elements, p = w[0], v = w[4], a = w[8], l = w[5], g = w[9], M = w[6], L = w[10]; + setEulerFromRotationMatrix(s, o) { + const w = s.elements, p = w[0], v = w[4], a = w[8], l = w[5], g = w[9], M = w[6], L = w[10]; return o === void 0 || o === "XYZ" ? (this.y = Math.asin((0, f.clamp)(a, -1, 1)), Math.abs(a) < 0.99999 ? (this.x = Math.atan2(-g, L), this.z = Math.atan2(-v, p)) : (this.x = Math.atan2(M, l), this.z = 0)) : console.error(`Error with vector's setEulerFromRotationMatrix: Unknown order: ${o}`), this; } - rotateAboutVector(n, o) { - n.normalize(); - const w = Math.cos(o), p = Math.sin(o), v = this.clone().multiplyScalar(w), a = n.clone().cross(this).multiplyScalar(p), l = n.clone().multiplyScalar(n.clone().dot(this)).multiplyScalar(1 - w), g = v.add(a).add(l); + rotateAboutVector(s, o) { + s.normalize(); + const w = Math.cos(o), p = Math.sin(o), v = this.clone().multiplyScalar(w), a = s.clone().cross(this).multiplyScalar(p), l = s.clone().multiplyScalar(s.clone().dot(this)).multiplyScalar(1 - w), g = v.add(a).add(l); return this.x = g.x, this.y = g.y, this.z = g.z, this; } - setFromMatrixPosition(n) { - const o = n.elements; + setFromMatrixPosition(s) { + const o = s.elements; return this.x = o[12], this.y = o[13], this.z = o[14], this; } // unproject is defined after Matrix4 - transformDirection(n) { - const { x: o } = this, { y: w } = this, { z: p } = this, v = n.elements; + transformDirection(s) { + const { x: o } = this, { y: w } = this, { z: p } = this, v = s.elements; return this.x = v[0] * o + v[4] * w + v[8] * p, this.y = v[1] * o + v[5] * w + v[9] * p, this.z = v[2] * o + v[6] * w + v[10] * p, this.normalize(); } clone() { return new C(this.x, this.y, this.z); } - unproject(n) { - const o = _; - return o.multiplyMatrices(n.matrixWorld, o.getInverse(n.projectionMatrix)), this.applyMatrix4(o); + unproject(s) { + const o = u; + return o.multiplyMatrices(s.matrixWorld, o.getInverse(s.projectionMatrix)), this.applyMatrix4(o); } } - h = new C(), u = new C(), E = new C(); + h = new C(), _ = new C(), E = new C(); class b { - constructor(n = 1, o = 0, w = 0, p = 0, v = 1, a = 0, l = 0, g = 0, M = 1) { - this.elements = new Float32Array(9), this.set(n, o, w, p, v, a, l, g, M); + constructor(s = 1, o = 0, w = 0, p = 0, v = 1, a = 0, l = 0, g = 0, M = 1) { + this.elements = new Float32Array(9), this.set(s, o, w, p, v, a, l, g, M); } - set(n, o, w, p, v, a, l, g, M) { + set(s, o, w, p, v, a, l, g, M) { const L = this.elements; - return L[0] = n, L[3] = o, L[6] = w, L[1] = p, L[4] = v, L[7] = a, L[2] = l, L[5] = g, L[8] = M, this; + return L[0] = s, L[3] = o, L[6] = w, L[1] = p, L[4] = v, L[7] = a, L[2] = l, L[5] = g, L[8] = M, this; } identity() { return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this; } - copy(n) { - const o = n.elements; + copy(s) { + const o = s.elements; this.set(o[0], o[3], o[6], o[1], o[4], o[7], o[2], o[5], o[8]); } - multiplyScalar(n) { + multiplyScalar(s) { const o = this.elements; - return o[0] *= n, o[3] *= n, o[6] *= n, o[1] *= n, o[4] *= n, o[7] *= n, o[2] *= n, o[5] *= n, o[8] *= n, this; + return o[0] *= s, o[3] *= s, o[6] *= s, o[1] *= s, o[4] *= s, o[7] *= s, o[2] *= s, o[5] *= s, o[8] *= s, this; } - getInverse3(n) { - const o = n.elements, w = this.elements; + getInverse3(s) { + const o = s.elements, w = this.elements; w[0] = o[4] * o[8] - o[5] * o[7], w[3] = o[6] * o[5] - o[3] * o[8], w[6] = o[3] * o[7] - o[6] * o[4], w[1] = o[7] * o[2] - o[1] * o[8], w[4] = o[0] * o[8] - o[6] * o[2], w[7] = o[1] * o[6] - o[0] * o[7], w[2] = o[1] * o[5] - o[2] * o[4], w[5] = o[2] * o[3] - o[0] * o[5], w[8] = o[0] * o[4] - o[1] * o[3]; const p = o[0] * w[0] + o[3] * w[1] + o[6] * w[2]; return this.multiplyScalar(1 / p), this; } - getInverse(n, o) { - const w = n.elements, p = this.elements; + getInverse(s, o) { + const w = s.elements, p = this.elements; p[0] = w[10] * w[5] - w[6] * w[9], p[1] = -w[10] * w[1] + w[2] * w[9], p[2] = w[6] * w[1] - w[2] * w[5], p[3] = -w[10] * w[4] + w[6] * w[8], p[4] = w[10] * w[0] - w[2] * w[8], p[5] = -w[6] * w[0] + w[2] * w[4], p[6] = w[9] * w[4] - w[5] * w[8], p[7] = -w[9] * w[0] + w[1] * w[8], p[8] = w[5] * w[0] - w[1] * w[4]; const v = w[0] * p[0] + w[1] * p[3] + w[2] * p[6]; if (v === 0) { @@ -14223,75 +14223,75 @@ ATOM`, g); } // https://en.wikipedia.org/wiki/Determinant getDeterminant() { - const n = this.elements; - return n[0] * n[4] * n[8] + // +aei - n[1] * n[5] * n[6] + // +bfg - n[2] * n[3] * n[7] - // +cdh - n[2] * n[4] * n[6] - // -ceg - n[1] * n[3] * n[8] - // -bdi - n[0] * n[5] * n[7]; + const s = this.elements; + return s[0] * s[4] * s[8] + // +aei + s[1] * s[5] * s[6] + // +bfg + s[2] * s[3] * s[7] - // +cdh + s[2] * s[4] * s[6] - // -ceg + s[1] * s[3] * s[8] - // -bdi + s[0] * s[5] * s[7]; } transpose() { - let n; + let s; const o = this.elements; - return n = o[1], o[1] = o[3], o[3] = n, n = o[2], o[2] = o[6], o[6] = n, n = o[5], o[5] = o[7], o[7] = n, this; + return s = o[1], o[1] = o[3], o[3] = s, s = o[2], o[2] = o[6], o[6] = s, s = o[5], o[5] = o[7], o[7] = s, this; } clone() { - const n = this.elements; - return new b(n[0], n[3], n[6], n[1], n[4], n[7], n[2], n[5], n[8]); + const s = this.elements; + return new b(s[0], s[3], s[6], s[1], s[4], s[7], s[2], s[5], s[8]); } getMatrix4() { - const n = this.elements; - return new c(n[0], n[3], n[6], 0, n[1], n[4], n[7], 0, n[2], n[5], n[8], 0); + const s = this.elements; + return new c(s[0], s[3], s[6], 0, s[1], s[4], s[7], 0, s[2], s[5], s[8], 0); } } class A { - constructor(n, o) { - this.origin = n !== void 0 ? n : new C(), this.direction = o !== void 0 ? o : new C(); + constructor(s, o) { + this.origin = s !== void 0 ? s : new C(), this.direction = o !== void 0 ? o : new C(); } - set(n, o) { - return this.origin.copy(n), this.direction.copy(o), this; + set(s, o) { + return this.origin.copy(s), this.direction.copy(o), this; } - copy(n) { - return this.origin.copy(n.origin), this.direction.copy(n.direction), this; + copy(s) { + return this.origin.copy(s.origin), this.direction.copy(s.direction), this; } - at(n, o) { - return (o || new C()).copy(this.direction).multiplyScalar(n).add(this.origin); + at(s, o) { + return (o || new C()).copy(this.direction).multiplyScalar(s).add(this.origin); } - recast(n) { + recast(s) { const o = h; - return this.origin.copy(this.at(n, o)), this; + return this.origin.copy(this.at(s, o)), this; } - closestPointToPoint(n, o) { + closestPointToPoint(s, o) { const w = o || new C(); - w.subVectors(n, this.origin); + w.subVectors(s, this.origin); const p = w.dot(this.direction); return w.copy(this.direction).multiplyScalar(p).add(this.origin); } - distanceToPoint(n) { - const o = h, w = o.subVectors(n, this.origin).dot(this.direction); - return o.copy(this.direction).multiplyScalar(w).add(this.origin), o.distanceTo(n); + distanceToPoint(s) { + const o = h, w = o.subVectors(s, this.origin).dot(this.direction); + return o.copy(this.direction).multiplyScalar(w).add(this.origin), o.distanceTo(s); } // eslint-disable-next-line class-methods-use-this isIntersectionCylinder() { } - isIntersectionSphere(n) { - return this.distanceToPoint(n.center) <= n.radius; + isIntersectionSphere(s) { + return this.distanceToPoint(s.center) <= s.radius; } - isIntersectionPlane(n) { - return n.normal.dot(this.direction) !== 0 || n.distanceToPoint(this.origin) === 0; + isIntersectionPlane(s) { + return s.normal.dot(this.direction) !== 0 || s.distanceToPoint(this.origin) === 0; } - distanceToPlane(n) { - const o = n.normal.dot(this.direction); - return o === 0 ? n.distanceToPoint(this.origin) === 0 ? 0 : void 0 : -(this.origin.dot(n.normal) + n.constant) / o; + distanceToPlane(s) { + const o = s.normal.dot(this.direction); + return o === 0 ? s.distanceToPoint(this.origin) === 0 ? 0 : void 0 : -(this.origin.dot(s.normal) + s.constant) / o; } - intersectPlane(n, o) { - const w = this.distanceToPlane(n); + intersectPlane(s, o) { + const w = this.distanceToPlane(s); if (w !== void 0) return this.at(w, o); } - applyMatrix4(n) { - return this.direction.add(this.origin).applyMatrix4(n), this.origin.applyMatrix4(n), this.direction.sub(this.origin), this; + applyMatrix4(s) { + return this.direction.add(this.origin).applyMatrix4(s), this.origin.applyMatrix4(s), this.direction.sub(this.origin), this; } clone() { return new A().copy(this); @@ -14310,12 +14310,12 @@ ATOM`, g); /* harmony export */ clamp: () => ( /* binding */ - s + n ) /* harmony export */ }); - function s(f, _, x) { - return Math.min(Math.max(f, _), x); + function n(f, u, y) { + return Math.min(Math.max(f, u), y); } } ), @@ -14334,14 +14334,14 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../math */ "./src/WebGL/math/math.ts" ); - function f(_, x, h, u, E, c) { - u = u * Math.PI / 180, E = E * Math.PI / 180, c = c * Math.PI / 180; - const C = (w) => w * w, b = Math.cos(u), A = Math.cos(E), S = Math.cos(c), n = Math.sin(c); - return new s.Matrix3(_, x * S, h * A, 0, x * n, h * (b - A * S) / n, 0, 0, h * Math.sqrt(1 - C(b) - C(A) - C(S) + 2 * b * A * S) / n); + function f(u, y, h, _, E, c) { + _ = _ * Math.PI / 180, E = E * Math.PI / 180, c = c * Math.PI / 180; + const C = (w) => w * w, b = Math.cos(_), A = Math.cos(E), S = Math.cos(c), s = Math.sin(c); + return new n.Matrix3(u, y * S, h * A, 0, y * s, h * (b - A * S) / s, 0, 0, h * Math.sqrt(1 - C(b) - C(A) - C(S) + 2 * b * A * S) / s); } } ), @@ -14360,9 +14360,9 @@ ATOM`, g); ) /* harmony export */ }); - const s = Math.PI / 180; - function f(_) { - return _ * s; + const n = Math.PI / 180; + function f(u) { + return u * n; } } ), @@ -14377,33 +14377,33 @@ ATOM`, g); /* harmony export */ Line: () => ( /* binding */ - x + y ), /* harmony export */ LineStyle: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ../materials */ "./src/WebGL/materials/index.ts" ), f = t( /*! ../core */ "./src/WebGL/core/index.ts" - ), _; + ), u; (function(h) { h[h.LineStrip = 0] = "LineStrip", h[h.LinePieces = 1] = "LinePieces"; - })(_ || (_ = {})); - class x extends f.Object3D { - constructor(u, E = new s.LineBasicMaterial({ + })(u || (u = {})); + class y extends f.Object3D { + constructor(_, E = new n.LineBasicMaterial({ color: Math.random() * 16777215 - }), c = _.LineStrip) { - super(), this.geometry = u, this.material = E, this.type = c; + }), c = u.LineStrip) { + super(), this.geometry = _, this.material = E, this.type = c; } - clone(u = new x(this.geometry, this.material, this.type)) { - return super.clone.call(this, u), u; + clone(_ = new y(this.geometry, this.material, this.type)) { + return super.clone.call(this, _), _; } } } @@ -14423,16 +14423,16 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../core */ "./src/WebGL/core/index.ts" ); - class f extends s.Object3D { - constructor(x, h) { - super(), this.geometry = x, this.material = h; + class f extends n.Object3D { + constructor(y, h) { + super(), this.geometry = y, this.material = h; } - clone(x) { - return x === void 0 && (x = new f(this.geometry, this.material)), super.clone.call(this, x), x; + clone(y) { + return y === void 0 && (y = new f(this.geometry, this.material)), super.clone.call(this, y), y; } } } @@ -14448,25 +14448,25 @@ ATOM`, g); /* harmony export */ Sprite: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ../materials */ "./src/WebGL/materials/index.ts" ), f = t( /*! ../core */ "./src/WebGL/core/index.ts" ); - class _ extends f.Object3D { - constructor(h = new s.SpriteMaterial()) { + class u extends f.Object3D { + constructor(h = new n.SpriteMaterial()) { super(), this.material = h, this.rotation3d = this.rotation, this.rotation = 0; } updateMatrix() { this.matrix.setPosition(this.position), this.rotation3d.set(0, 0, this.rotation), this.matrix.setRotationFromEuler(this.rotation3d), (this.scale.x !== 1 || this.scale.y !== 1) && this.matrix.scale(this.scale), this.matrixWorldNeedsUpdate = !0; } - clone(h = new _(this.material)) { + clone(h = new u(this.material)) { return f.Object3D.prototype.clone.call(this, h), h; } } @@ -14483,12 +14483,12 @@ ATOM`, g); /* harmony export */ Line: () => ( /* reexport safe */ - s.Line + n.Line ), /* harmony export */ LineStyle: () => ( /* reexport safe */ - s.LineStyle + n.LineStyle ), /* harmony export */ Mesh: () => ( @@ -14498,17 +14498,17 @@ ATOM`, g); /* harmony export */ Sprite: () => ( /* reexport safe */ - _.Sprite + u.Sprite ) /* harmony export */ }); - var s = t( + var n = t( /*! ./Line */ "./src/WebGL/objects/Line.ts" ), f = t( /*! ./Mesh */ "./src/WebGL/objects/Mesh.ts" - ), _ = t( + ), u = t( /*! ./Sprite */ "./src/WebGL/objects/Sprite.ts" ); @@ -14535,7 +14535,7 @@ ATOM`, g); /* harmony export */ ShaderLib: () => ( /* reexport safe */ - s.ShaderLib + n.ShaderLib ), /* harmony export */ ShaderUtils: () => ( @@ -14545,7 +14545,7 @@ ATOM`, g); /* harmony export */ basic: () => ( /* reexport safe */ - s.basic + n.basic ), /* harmony export */ clone: () => ( @@ -14555,66 +14555,66 @@ ATOM`, g); /* harmony export */ instanced: () => ( /* reexport safe */ - s.instanced + n.instanced ), /* harmony export */ lambert: () => ( /* reexport safe */ - s.lambert + n.lambert ), /* harmony export */ lambertdouble: () => ( /* reexport safe */ - s.lambertdouble + n.lambertdouble ), /* harmony export */ outline: () => ( /* reexport safe */ - s.outline + n.outline ), /* harmony export */ screen: () => ( /* reexport safe */ - s.screen + n.screen ), /* harmony export */ screenaa: () => ( /* reexport safe */ - s.screenaa + n.screenaa ), /* harmony export */ sphereimposter: () => ( /* reexport safe */ - s.sphereimposter + n.sphereimposter ), /* harmony export */ sphereimposteroutline: () => ( /* reexport safe */ - s.sphereimposteroutline + n.sphereimposteroutline ), /* harmony export */ sprite: () => ( /* reexport safe */ - s.sprite + n.sprite ), /* harmony export */ stickimposter: () => ( /* reexport safe */ - s.stickimposter + n.stickimposter ), /* harmony export */ stickimposteroutline: () => ( /* reexport safe */ - s.stickimposteroutline + n.stickimposteroutline ), /* harmony export */ volumetric: () => ( /* reexport safe */ - s.volumetric + n.volumetric ) /* harmony export */ }); - var s = t( + var n = t( /*! ./lib */ "./src/WebGL/shaders/lib/index.ts" ), f = t( @@ -14638,24 +14638,24 @@ ATOM`, g); /* harmony export */ basic: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/basic/uniforms.ts" ), f = t( /*! ./basic.frag */ "./src/WebGL/shaders/lib/basic/basic.frag" - ), _ = t( + ), u = t( /*! ./basic.vert */ "./src/WebGL/shaders/lib/basic/basic.vert" ); - const x = { - vertexShader: _.default.replace("#define GLSLIFY 1", ""), + const y = { + vertexShader: u.default.replace("#define GLSLIFY 1", ""), fragmentShader: f.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + uniforms: n.uniforms }; } ), @@ -14674,13 +14674,13 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../../../colors */ "./src/colors.ts" ); const f = { opacity: { type: "f", value: 1 }, - fogColor: { type: "c", value: new s.Color(1, 1, 1) }, + fogColor: { type: "c", value: new n.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, fogFar: { type: "f", value: 2e3 } }; @@ -14702,7 +14702,7 @@ ATOM`, g); /* harmony export */ basic: () => ( /* reexport safe */ - s.basic + n.basic ), /* harmony export */ instanced: () => ( @@ -14712,12 +14712,12 @@ ATOM`, g); /* harmony export */ lambert: () => ( /* reexport safe */ - _.lambert + u.lambert ), /* harmony export */ lambertdouble: () => ( /* reexport safe */ - x.lambertdouble + y.lambertdouble ), /* harmony export */ outline: () => ( @@ -14727,7 +14727,7 @@ ATOM`, g); /* harmony export */ screen: () => ( /* reexport safe */ - u.screen + _.screen ), /* harmony export */ screenaa: () => ( @@ -14762,26 +14762,26 @@ ATOM`, g); /* harmony export */ volumetric: () => ( /* reexport safe */ - n.volumetric + s.volumetric ) /* harmony export */ }); - var s = t( + var n = t( /*! ./basic */ "./src/WebGL/shaders/lib/basic/index.ts" ), f = t( /*! ./instanced */ "./src/WebGL/shaders/lib/instanced/index.ts" - ), _ = t( + ), u = t( /*! ./lambert */ "./src/WebGL/shaders/lib/lambert/index.ts" - ), x = t( + ), y = t( /*! ./lambertdouble */ "./src/WebGL/shaders/lib/lambertdouble/index.ts" ), h = t( /*! ./outline */ "./src/WebGL/shaders/lib/outline/index.ts" - ), u = t( + ), _ = t( /*! ./screen */ "./src/WebGL/shaders/lib/screen/index.ts" ), E = t( @@ -14802,24 +14802,24 @@ ATOM`, g); ), S = t( /*! ./stickimposteroutline */ "./src/WebGL/shaders/lib/stickimposteroutline/index.ts" - ), n = t( + ), s = t( /*! ./volumetric */ "./src/WebGL/shaders/lib/volumetric/index.ts" ); const o = { - basic: s.basic, + basic: n.basic, instanced: f.instanced, - lambert: _.lambert, - lambertdouble: x.lambertdouble, + lambert: u.lambert, + lambertdouble: y.lambertdouble, outline: h.outline, - screen: u.screen, + screen: _.screen, screenaa: E.screenaa, sphereimposter: c.sphereimposter, sphereimposteroutline: C.sphereimposteroutline, sprite: b.sprite, stickimposter: A.stickimposter, stickimposteroutline: S.stickimposteroutline, - volumetric: n.volumetric + volumetric: s.volumetric }; } ), @@ -14834,24 +14834,24 @@ ATOM`, g); /* harmony export */ instanced: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/instanced/uniforms.ts" ), f = t( /*! ./instanced.frag */ "./src/WebGL/shaders/lib/instanced/instanced.frag" - ), _ = t( + ), u = t( /*! ./instanced.vert */ "./src/WebGL/shaders/lib/instanced/instanced.vert" ); - const x = { + const y = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), - vertexShader: _.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + vertexShader: u.default.replace("#define GLSLIFY 1", ""), + uniforms: n.uniforms }; } ), @@ -14870,13 +14870,13 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../../../colors */ "./src/colors.ts" ); const f = { opacity: { type: "f", value: 1 }, - fogColor: { type: "c", value: new s.Color(1, 1, 1) }, + fogColor: { type: "c", value: new n.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, fogFar: { type: "f", value: 2e3 }, directionalLightColor: { type: "fv", value: [] }, @@ -14895,24 +14895,24 @@ ATOM`, g); /* harmony export */ lambert: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/lambert/uniforms.ts" ), f = t( /*! ./lambert.frag */ "./src/WebGL/shaders/lib/lambert/lambert.frag" - ), _ = t( + ), u = t( /*! ./lambert.vert */ "./src/WebGL/shaders/lib/lambert/lambert.vert" ); - const x = { + const y = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), - vertexShader: _.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + vertexShader: u.default.replace("#define GLSLIFY 1", ""), + uniforms: n.uniforms }; } ), @@ -14931,13 +14931,13 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../../../colors */ "./src/colors.ts" ); const f = { opacity: { type: "f", value: 1 }, - fogColor: { type: "c", value: new s.Color(1, 1, 1) }, + fogColor: { type: "c", value: new n.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, fogFar: { type: "f", value: 2e3 }, directionalLightColor: { type: "fv", value: [] }, @@ -14956,24 +14956,24 @@ ATOM`, g); /* harmony export */ lambertdouble: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/lambertdouble/uniforms.ts" ), f = t( /*! ./lambertdouble.frag */ "./src/WebGL/shaders/lib/lambertdouble/lambertdouble.frag" - ), _ = t( + ), u = t( /*! ./lambertdouble.vert */ "./src/WebGL/shaders/lib/lambertdouble/lambertdouble.vert" ); - const x = { + const y = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), - vertexShader: _.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + vertexShader: u.default.replace("#define GLSLIFY 1", ""), + uniforms: n.uniforms }; } ), @@ -14992,13 +14992,13 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../../../colors */ "./src/colors.ts" ); const f = { opacity: { type: "f", value: 1 }, - fogColor: { type: "c", value: new s.Color(1, 1, 1) }, + fogColor: { type: "c", value: new n.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, fogFar: { type: "f", value: 2e3 }, directionalLightColor: { type: "fv", value: [] }, @@ -15017,24 +15017,24 @@ ATOM`, g); /* harmony export */ outline: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/outline/uniforms.ts" ), f = t( /*! ./outline.frag */ "./src/WebGL/shaders/lib/outline/outline.frag" - ), _ = t( + ), u = t( /*! ./outline.vert */ "./src/WebGL/shaders/lib/outline/outline.vert" ); - const x = { + const y = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), - vertexShader: _.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + vertexShader: u.default.replace("#define GLSLIFY 1", ""), + uniforms: n.uniforms }; } ), @@ -15053,14 +15053,14 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../../../colors */ "./src/colors.ts" ); const f = { opacity: { type: "f", value: 1 }, - outlineColor: { type: "c", value: new s.Color(0, 0, 0) }, - fogColor: { type: "c", value: new s.Color(1, 1, 1) }, + outlineColor: { type: "c", value: new n.Color(0, 0, 0) }, + fogColor: { type: "c", value: new n.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, fogFar: { type: "f", value: 2e3 }, outlineWidth: { type: "f", value: 0.1 }, @@ -15079,24 +15079,24 @@ ATOM`, g); /* harmony export */ screen: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/screen/uniforms.ts" ), f = t( /*! ./screen.frag */ "./src/WebGL/shaders/lib/screen/screen.frag" - ), _ = t( + ), u = t( /*! ./screen.vert */ "./src/WebGL/shaders/lib/screen/screen.vert" ); - const x = { + const y = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), - vertexShader: _.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + vertexShader: u.default.replace("#define GLSLIFY 1", ""), + uniforms: n.uniforms }; } ), @@ -15111,11 +15111,11 @@ ATOM`, g); /* harmony export */ uniforms: () => ( /* binding */ - s + n ) /* harmony export */ }); - const s = {}; + const n = {}; } ), /***/ @@ -15129,24 +15129,24 @@ ATOM`, g); /* harmony export */ screenaa: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/screenaa/uniforms.ts" ), f = t( /*! ./screenaa.frag */ "./src/WebGL/shaders/lib/screenaa/screenaa.frag" - ), _ = t( + ), u = t( /*! ./screenaa.vert */ "./src/WebGL/shaders/lib/screenaa/screenaa.vert" ); - const x = { + const y = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), - vertexShader: _.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + vertexShader: u.default.replace("#define GLSLIFY 1", ""), + uniforms: n.uniforms }; } ), @@ -15161,11 +15161,11 @@ ATOM`, g); /* harmony export */ uniforms: () => ( /* binding */ - s + n ) /* harmony export */ }); - const s = {}; + const n = {}; } ), /***/ @@ -15179,24 +15179,24 @@ ATOM`, g); /* harmony export */ sphereimposter: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/sphereimposter/uniforms.ts" ), f = t( /*! ./sphereimposter.frag */ "./src/WebGL/shaders/lib/sphereimposter/sphereimposter.frag" - ), _ = t( + ), u = t( /*! ./sphereimposter.vert */ "./src/WebGL/shaders/lib/sphereimposter/sphereimposter.vert" ); - const x = { - vertexShader: _.default.replace("#define GLSLIFY 1", ""), + const y = { + vertexShader: u.default.replace("#define GLSLIFY 1", ""), fragmentShader: f.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + uniforms: n.uniforms }; } ), @@ -15215,13 +15215,13 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../../../colors */ "./src/colors.ts" ); const f = { opacity: { type: "f", value: 1 }, - fogColor: { type: "c", value: new s.Color(1, 1, 1) }, + fogColor: { type: "c", value: new n.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, fogFar: { type: "f", value: 2e3 }, directionalLightColor: { type: "fv", value: [] }, @@ -15240,24 +15240,24 @@ ATOM`, g); /* harmony export */ sphereimposteroutline: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/sphereimposteroutline/uniforms.ts" ), f = t( /*! ./sphereimposteroutline.frag */ "./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.frag" - ), _ = t( + ), u = t( /*! ./sphereimposteroutline.vert */ "./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.vert" ); - const x = { + const y = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), - vertexShader: _.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + vertexShader: u.default.replace("#define GLSLIFY 1", ""), + uniforms: n.uniforms }; } ), @@ -15276,14 +15276,14 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../../../colors */ "./src/colors.ts" ); const f = { opacity: { type: "f", value: 1 }, - outlineColor: { type: "c", value: new s.Color(0, 0, 0) }, - fogColor: { type: "c", value: new s.Color(1, 1, 1) }, + outlineColor: { type: "c", value: new n.Color(0, 0, 0) }, + fogColor: { type: "c", value: new n.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, fogFar: { type: "f", value: 2e3 }, outlineWidth: { type: "f", value: 0.1 }, @@ -15302,24 +15302,24 @@ ATOM`, g); /* harmony export */ sprite: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/sprite/uniforms.ts" ), f = t( /*! ./sprite.frag */ "./src/WebGL/shaders/lib/sprite/sprite.frag" - ), _ = t( + ), u = t( /*! ./sprite.vert */ "./src/WebGL/shaders/lib/sprite/sprite.vert" ); - const x = { + const y = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), - vertexShader: _.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + vertexShader: u.default.replace("#define GLSLIFY 1", ""), + uniforms: n.uniforms }; } ), @@ -15334,11 +15334,11 @@ ATOM`, g); /* harmony export */ uniforms: () => ( /* binding */ - s + n ) /* harmony export */ }); - const s = {}; + const n = {}; } ), /***/ @@ -15352,28 +15352,28 @@ ATOM`, g); /* harmony export */ stickimposter: () => ( /* binding */ - u + _ ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/stickimposter/uniforms.ts" ), f = t( /*! ../../utils/stickimposterFragmentShader.partial.frag */ "./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag" - ), _ = t( + ), u = t( /*! ./stickimposter.partial.frag */ "./src/WebGL/shaders/lib/stickimposter/stickimposter.partial.frag" - ), x = t( + ), y = t( /*! ./stickimposter.vert */ "./src/WebGL/shaders/lib/stickimposter/stickimposter.vert" ); - const u = { - fragmentShader: [f.default, _.default].join(` + const _ = { + fragmentShader: [f.default, u.default].join(` `).replace("#define GLSLIFY 1", ""), - vertexShader: x.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + vertexShader: y.default.replace("#define GLSLIFY 1", ""), + uniforms: n.uniforms }; } ), @@ -15392,13 +15392,13 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../../../colors */ "./src/colors.ts" ); const f = { opacity: { type: "f", value: 1 }, - fogColor: { type: "c", value: new s.Color(1, 1, 1) }, + fogColor: { type: "c", value: new n.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, fogFar: { type: "f", value: 2e3 }, directionalLightColor: { type: "fv", value: [] }, @@ -15421,20 +15421,20 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/stickimposteroutline/uniforms.ts" ), f = t( /*! ../../utils/stickimposterFragmentShader.partial.frag */ "./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag" - ), _ = t( + ), u = t( /*! ./stickimposteroutline.vert */ "./src/WebGL/shaders/lib/stickimposteroutline/stickimposteroutline.vert" ); const h = { fragmentShader: (f.default + "gl_FragColor = vec4(color,1.0);}").replace("#define GLSLIFY 1", ""), - vertexShader: _.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + vertexShader: u.default.replace("#define GLSLIFY 1", ""), + uniforms: n.uniforms }; } ), @@ -15453,16 +15453,16 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../../../colors */ "./src/colors.ts" ); const f = { opacity: { type: "f", value: 1 }, - fogColor: { type: "c", value: new s.Color(1, 1, 1) }, + fogColor: { type: "c", value: new n.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, fogFar: { type: "f", value: 2e3 }, - outlineColor: { type: "c", value: new s.Color(0, 0, 0) }, + outlineColor: { type: "c", value: new n.Color(0, 0, 0) }, outlineWidth: { type: "f", value: 0.1 }, outlinePushback: { type: "f", value: 1 } }; @@ -15479,24 +15479,24 @@ ATOM`, g); /* harmony export */ volumetric: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./uniforms */ "./src/WebGL/shaders/lib/volumetric/uniforms.ts" ), f = t( /*! ./volumetric.frag */ "./src/WebGL/shaders/lib/volumetric/volumetric.frag" - ), _ = t( + ), u = t( /*! ./volumetric.vert */ "./src/WebGL/shaders/lib/volumetric/volumetric.vert" ); - const x = { + const y = { fragmentShader: f.default.replace("#define GLSLIFY 1", ""), - vertexShader: _.default.replace("#define GLSLIFY 1", ""), - uniforms: s.uniforms + vertexShader: u.default.replace("#define GLSLIFY 1", ""), + uniforms: n.uniforms }; } ), @@ -15515,13 +15515,13 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../../../colors */ "./src/colors.ts" ); const f = { opacity: { type: "f", value: 1 }, - fogColor: { type: "c", value: new s.Color(1, 1, 1) }, + fogColor: { type: "c", value: new n.Color(1, 1, 1) }, fogNear: { type: "f", value: 1 }, fogFar: { type: "f", value: 2e3 }, data: { type: "i", value: 3 }, @@ -15552,18 +15552,18 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../../colors */ "./src/colors.ts" ); - function f(_) { - let x = {}; - for (const u in _) { - x[u] = {}, x[u].type = _[u].type; - var h = _[u].value; - h instanceof s.Color ? x[u].value = h.clone() : typeof h == "number" ? x[u].value = h : h instanceof Array ? x[u].value = [] : console.error("Error copying shader uniforms from ShaderLib: unknown type for uniform"); + function f(u) { + let y = {}; + for (const _ in u) { + y[_] = {}, y[_].type = u[_].type; + var h = u[_].value; + h instanceof n.Color ? y[_].value = h.clone() : typeof h == "number" ? y[_].value = h : h instanceof Array ? y[_].value = [] : console.error("Error copying shader uniforms from ShaderLib: unknown type for uniform"); } - return x; + return y; } } ), @@ -15578,24 +15578,24 @@ ATOM`, g); /* harmony export */ ShaderUtils: () => ( /* binding */ - _ + u ), /* harmony export */ clone: () => ( /* reexport safe */ - s.clone + n.clone ) /* harmony export */ }); - var s = t( + var n = t( /*! ./clone */ "./src/WebGL/shaders/utils/clone.ts" ), f = t( /*! ./stickimposterFragmentShader.partial.frag */ "./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag" ); - const _ = { - clone: s.clone, + const u = { + clone: n.clone, stickimposterFragmentShader: f.default }; } @@ -15611,18 +15611,18 @@ ATOM`, g); /* harmony export */ Cylinder: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ../math */ "./src/WebGL/math/index.ts" ); - let f = new s.Vector3(); - class _ { - constructor(h = new s.Vector3(), u = new s.Vector3(), E = 0) { - this.c1 = h, this.c2 = u, this.radius = E, this.direction = new s.Vector3().subVectors(this.c2, this.c1).normalize(); + let f = new n.Vector3(); + class u { + constructor(h = new n.Vector3(), _ = new n.Vector3(), E = 0) { + this.c1 = h, this.c2 = _, this.radius = E, this.direction = new n.Vector3().subVectors(this.c2, this.c1).normalize(); } copy(h) { return this.c1.copy(h.c1), this.c2.copy(h.c2), this.direction.copy(h.direction), this.radius = h.radius, this; @@ -15651,28 +15651,28 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../math */ "./src/WebGL/math/index.ts" ); class f { - constructor(x = { x: 0, y: 0, z: 0 }, h = 0) { - this.center = new s.Vector3(x.x, x.y, x.z), this.radius = h; + constructor(y = { x: 0, y: 0, z: 0 }, h = 0) { + this.center = new n.Vector3(y.x, y.y, y.z), this.radius = h; } - set(x, h) { - return this.center.copy(x), this.radius = h, this; + set(y, h) { + return this.center.copy(y), this.radius = h, this; } - copy(x) { - return this.center.copy(x.center), this.radius = x.radius, this; + copy(y) { + return this.center.copy(y.center), this.radius = y.radius, this; } - applyMatrix4(x) { - return this.center.applyMatrix4(x), this.radius = this.radius * x.getMaxScaleOnAxis(), this; + applyMatrix4(y) { + return this.center.applyMatrix4(y), this.radius = this.radius * y.getMaxScaleOnAxis(), this; } - translate(x) { - return this.center.add(x), this; + translate(y) { + return this.center.add(y), this; } - equals(x) { - return x.center.equals(this.center) && x.radius === this.radius; + equals(y) { + return y.center.equals(this.center) && y.radius === this.radius; } clone() { return new f().copy(this); @@ -15691,18 +15691,18 @@ ATOM`, g); /* harmony export */ Triangle: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ../math */ "./src/WebGL/math/index.ts" ); - const f = new s.Vector3(); - class _ { - constructor(h = new s.Vector3(), u = new s.Vector3(), E = new s.Vector3()) { - this.a = h, this.b = u, this.c = E; + const f = new n.Vector3(); + class u { + constructor(h = new n.Vector3(), _ = new n.Vector3(), E = new n.Vector3()) { + this.a = h, this.b = _, this.c = E; } copy(h) { return this.a.copy(h.a), this.b.copy(h.b), this.c.copy(h.c), this; @@ -15733,22 +15733,22 @@ ATOM`, g); /* harmony export */ Sphere: () => ( /* reexport safe */ - s.Sphere + n.Sphere ), /* harmony export */ Triangle: () => ( /* reexport safe */ - _.Triangle + u.Triangle ) /* harmony export */ }); - var s = t( + var n = t( /*! ./Sphere */ "./src/WebGL/shapes/Sphere.ts" ), f = t( /*! ./Cylinder */ "./src/WebGL/shapes/Cylinder.ts" - ), _ = t( + ), u = t( /*! ./Triangle */ "./src/WebGL/shapes/Triangle.ts" ); @@ -15912,7 +15912,7 @@ ATOM`, g); /* harmony export */ Color: () => ( /* binding */ - s + n ), /* harmony export */ builtinColorSchemes: () => ( @@ -15927,12 +15927,12 @@ ATOM`, g); /* harmony export */ elementColors: () => ( /* binding */ - u + _ ), /* harmony export */ htmlColors: () => ( /* binding */ - _ + u ), /* harmony export */ residues: () => ( @@ -15942,26 +15942,26 @@ ATOM`, g); /* harmony export */ ssColors: () => ( /* binding */ - x + y ) /* harmony export */ }); - class s { - constructor(A, S, n) { - return this.r = 0, this.g = 0, this.b = 0, arguments.length > 1 && typeof A == "number" ? (this.r = A || 0, this.g = S || 0, this.b = n || 0, this) : this.set(A || 0); + class n { + constructor(A, S, s) { + return this.r = 0, this.g = 0, this.b = 0, arguments.length > 1 && typeof A == "number" ? (this.r = A || 0, this.g = S || 0, this.b = s || 0, this) : this.set(A || 0); } set(A) { - return A instanceof s ? A.clone() : (typeof A == "number" ? this.setHex(A) : typeof A == "object" && (this.r = (A == null ? void 0 : A.r) || 0, this.g = (A == null ? void 0 : A.g) || 0, this.b = (A == null ? void 0 : A.b) || 0), this); + return A instanceof n ? A.clone() : (typeof A == "number" ? this.setHex(A) : typeof A == "object" && (this.r = (A == null ? void 0 : A.r) || 0, this.g = (A == null ? void 0 : A.g) || 0, this.b = (A == null ? void 0 : A.b) || 0), this); } setHex(A) { return A = Math.floor(A), this.r = (A >> 16 & 255) / 255, this.g = (A >> 8 & 255) / 255, this.b = (A & 255) / 255, this; } getHex() { - var A = Math.round(this.r * 255), S = Math.round(this.g * 255), n = Math.round(this.b * 255); - return A << 16 | S << 8 | n; + var A = Math.round(this.r * 255), S = Math.round(this.g * 255), s = Math.round(this.b * 255); + return A << 16 | S << 8 | s; } clone() { - return new s(this.r, this.g, this.b); + return new n(this.r, this.g, this.b); } copy(A) { return this.r = A.r, this.g = A.g, this.b = A.b, this; @@ -15976,26 +15976,26 @@ ATOM`, g); static color(A) { if (!A) return f.cache[0]; - if (A instanceof s) + if (A instanceof n) return A; if (typeof A == "number" && typeof f.cache[A] < "u") return f.cache[A]; if (A && Array.isArray(A)) return A.map(f.color); - let S = f.getHex(A), n = new s(S); - return f.cache[S] = n, n; + let S = f.getHex(A), s = new n(S); + return f.cache[S] = s, s; } static getHex(A) { var S; if (Array.isArray(A)) return A.map(f.getHex); if (typeof A == "string") { - let n = A; - if (!isNaN(parseInt(n))) - return parseInt(n); - if (n = n.trim(), n.length == 4 && n[0] == "#" && (n = "#" + n[1] + n[1] + n[2] + n[2] + n[3] + n[3]), n.length == 7 && n[0] == "#") - return parseInt(n.substring(1), 16); - let o = f.rgbRegEx.exec(n); + let s = A; + if (!isNaN(parseInt(s))) + return parseInt(s); + if (s = s.trim(), s.length == 4 && s[0] == "#" && (s = "#" + s[1] + s[1] + s[2] + s[2] + s[3] + s[3]), s.length == 7 && s[0] == "#") + return parseInt(s.substring(1), 16); + let o = f.rgbRegEx.exec(s); if (o) { o[1] != "" && console.log("WARNING: Opacity value in rgba ignored. Specify separately as opacity attribute."); let w = 0; @@ -16011,8 +16011,8 @@ ATOM`, g); return A; } } - f.rgbRegEx = /rgb(a?)\(\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)/i, f.cache = { 0: new s(0) }; - const _ = { + f.rgbRegEx = /rgb(a?)\(\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)/i, f.cache = { 0: new n(0) }; + const u = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -16161,7 +16161,7 @@ ATOM`, g); whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 - }, x = { + }, y = { //names are in helix-sheet-coil order pyMol: { h: 16711680, s: 16776960, c: 65280 }, Jmol: { h: 16711808, s: 16762880, c: 16777215 } @@ -16213,7 +16213,7 @@ ATOM`, g); BA: 16753920, Au: 14329120, AU: 14329120 - }, u = { + }, _ = { defaultColor: 16716947, /** Jmol-like element colors*/ Jmol: { @@ -16554,24 +16554,24 @@ ATOM`, g); } }, C = { /** secondary structure pymol */ - ssPyMol: { prop: "ss", map: x.pyMol }, - ssJmol: { prop: "ss", map: x.Jmol }, - Jmol: { prop: "elem", map: u.Jmol }, + ssPyMol: { prop: "ss", map: y.pyMol }, + ssJmol: { prop: "ss", map: y.Jmol }, + Jmol: { prop: "elem", map: _.Jmol }, amino: { prop: "resn", map: E.amino }, shapely: { prop: "resn", map: E.shapely }, nucleic: { prop: "resn", map: E.nucleic }, chain: { prop: "chain", map: c.atom }, - rasmol: { prop: "elem", map: u.rasmol }, - default: { prop: "elem", map: u.defaultColors }, - greenCarbon: { prop: "elem", map: u.greenCarbon }, + rasmol: { prop: "elem", map: _.rasmol }, + default: { prop: "elem", map: _.defaultColors }, + greenCarbon: { prop: "elem", map: _.greenCarbon }, chainHetatm: { prop: "chain", map: c.hetatm }, - cyanCarbon: { prop: "elem", map: u.cyanCarbon }, - magentaCarbon: { prop: "elem", map: u.magentaCarbon }, - purpleCarbon: { prop: "elem", map: u.purpleCarbon }, - whiteCarbon: { prop: "elem", map: u.whiteCarbon }, - orangeCarbon: { prop: "elem", map: u.orangeCarbon }, - yellowCarbon: { prop: "elem", map: u.yellowCarbon }, - blueCarbon: { prop: "elem", map: u.blueCarbon } + cyanCarbon: { prop: "elem", map: _.cyanCarbon }, + magentaCarbon: { prop: "elem", map: _.magentaCarbon }, + purpleCarbon: { prop: "elem", map: _.purpleCarbon }, + whiteCarbon: { prop: "elem", map: _.whiteCarbon }, + orangeCarbon: { prop: "elem", map: _.orangeCarbon }, + yellowCarbon: { prop: "elem", map: _.yellowCarbon }, + blueCarbon: { prop: "elem", map: _.blueCarbon } }; } ), @@ -16586,7 +16586,7 @@ ATOM`, g); /* harmony export */ drawCartoon: () => ( /* binding */ - B + z ), /* harmony export */ subdivide_spline: () => ( @@ -16595,76 +16595,76 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" ), f = t( /*! ./WebGL/shapes */ "./src/WebGL/shapes/index.ts" - ), _ = t( + ), u = t( /*! ./WebGL */ "./src/WebGL/index.ts" - ), x = t( + ), y = t( /*! ./Gradient */ "./src/Gradient.ts" ), h = t( /*! ./colors */ "./src/colors.ts" - ), u = t( + ), _ = t( /*! ./GLDraw */ "./src/GLDraw.ts" ), E = t( /*! ./utilities */ "./src/utilities.ts" ); - function c(P, z) { + function c(P, B) { var F = [], N = P; N = [], N.push(P[0]); - var $, k, G, H, U, V, Q, oe, ee; + var $, k, G, H, U, V, Q, ae, oe; for ($ = 1, k = P.length - 1; $ < k; $++) if (U = P[$], V = P[$ + 1], U.smoothen) { - var ne = new s.Vector3((U.x + V.x) / 2, (U.y + V.y) / 2, (U.z + V.z) / 2); - ne.atom = U.atom, N.push(ne); + var q = new n.Vector3((U.x + V.x) / 2, (U.y + V.y) / 2, (U.z + V.z) / 2); + q.atom = U.atom, N.push(q); } else N.push(U); for (N.push(P[P.length - 1]), $ = -1, G = N.length; $ <= G - 3; $++) - if (H = N[$ === -1 ? 0 : $], U = N[$ + 1], V = N[$ + 2], Q = N[$ === G - 3 ? G - 1 : $ + 3], oe = new s.Vector3().subVectors(V, H).multiplyScalar(0.5), ee = new s.Vector3().subVectors(Q, U).multiplyScalar(0.5), !V.skip) - for (var me = 0; me < z; me++) { - var se = 1 / z * me, fe = U.x + se * oe.x + se * se * (-3 * U.x + 3 * V.x - 2 * oe.x - ee.x) + se * se * se * (2 * U.x - 2 * V.x + oe.x + ee.x), Ce = U.y + se * oe.y + se * se * (-3 * U.y + 3 * V.y - 2 * oe.y - ee.y) + se * se * se * (2 * U.y - 2 * V.y + oe.y + ee.y), Me = U.z + se * oe.z + se * se * (-3 * U.z + 3 * V.z - 2 * oe.z - ee.z) + se * se * se * (2 * U.z - 2 * V.z + oe.z + ee.z), Te = new s.Vector3(fe, Ce, Me); - me < z / 2 ? Te.atom = U.atom : Te.atom = V.atom, F.push(Te); + if (H = N[$ === -1 ? 0 : $], U = N[$ + 1], V = N[$ + 2], Q = N[$ === G - 3 ? G - 1 : $ + 3], ae = new n.Vector3().subVectors(V, H).multiplyScalar(0.5), oe = new n.Vector3().subVectors(Q, U).multiplyScalar(0.5), !V.skip) + for (var me = 0; me < B; me++) { + var ne = 1 / B * me, fe = U.x + ne * ae.x + ne * ne * (-3 * U.x + 3 * V.x - 2 * ae.x - oe.x) + ne * ne * ne * (2 * U.x - 2 * V.x + ae.x + oe.x), Ce = U.y + ne * ae.y + ne * ne * (-3 * U.y + 3 * V.y - 2 * ae.y - oe.y) + ne * ne * ne * (2 * U.y - 2 * V.y + ae.y + oe.y), Me = U.z + ne * ae.z + ne * ne * (-3 * U.z + 3 * V.z - 2 * ae.z - oe.z) + ne * ne * ne * (2 * U.z - 2 * V.z + ae.z + oe.z), Te = new n.Vector3(fe, Ce, Me); + me < B / 2 ? Te.atom = U.atom : Te.atom = V.atom, F.push(Te); } return F.push(N[N.length - 1]), F; } - const C = 0.5, b = 1.3, A = 0.8, S = 0.4, n = 0.4; - function o(P, z, F, N) { - for (var $, k, G, H, U = 0, V = z.length; U < V; U++) { + const C = 0.5, b = 1.3, A = 0.8, S = 0.4, s = 0.4; + function o(P, B, F, N) { + for (var $, k, G, H, U = 0, V = B.length; U < V; U++) { H = Math.round(U * (N.length - 1) / V), G = h.CC.color(N[H]); - var Q = P.updateGeoGroup(2), oe = Q.vertexArray, ee = Q.colorArray, ne = Q.faceArray; - $ = Q.vertices, k = $ * 3, oe[k] = z[U].x, oe[k + 1] = z[U].y, oe[k + 2] = z[U].z, oe[k + 3] = F[U].x, oe[k + 4] = F[U].y, oe[k + 5] = F[U].z; + var Q = P.updateGeoGroup(2), ae = Q.vertexArray, oe = Q.colorArray, q = Q.faceArray; + $ = Q.vertices, k = $ * 3, ae[k] = B[U].x, ae[k + 1] = B[U].y, ae[k + 2] = B[U].z, ae[k + 3] = F[U].x, ae[k + 4] = F[U].y, ae[k + 5] = F[U].z; for (var me = 0; me < 6; ++me) - ee[k + 3 * me] = G.r, ee[k + 1 + 3 * me] = G.g, ee[k + 2 + 3 * me] = G.b; + oe[k + 3 * me] = G.r, oe[k + 1 + 3 * me] = G.g, oe[k + 2 + 3 * me] = G.b; if (U > 0) { - var se = [$, $ + 1, $ - 1, $ - 2], fe = Q.faceidx; - ne[fe] = se[0], ne[fe + 1] = se[1], ne[fe + 2] = se[3], ne[fe + 3] = se[1], ne[fe + 4] = se[2], ne[fe + 5] = se[3], Q.faceidx += 6; + var ne = [$, $ + 1, $ - 1, $ - 2], fe = Q.faceidx; + q[fe] = ne[0], q[fe + 1] = ne[1], q[fe + 2] = ne[3], q[fe + 3] = ne[1], q[fe + 4] = ne[2], q[fe + 5] = ne[3], Q.faceidx += 6; } Q.vertices += 2; } } - function w(P, z, F, N, $, k, G) { + function w(P, B, F, N, $, k, G) { var H, U, V, Q; - if (V = z.length, V < 2 || z[0].length < 2) + if (V = B.length, V < 2 || B[0].length < 2) return; for (H = 0; H < V; H++) - z[H] = c(z[H], N); - if (Q = z[0].length, !$) - return o(P, z[0], z[V - 1], F); - var oe, ee, ne, me, se, fe, Ce = [], Me = [], Te = []; + B[H] = c(B[H], N); + if (Q = B[0].length, !$) + return o(P, B[0], B[V - 1], F); + var ae, oe, q, me, ne, fe, Ce = [], Me = [], Te = []; for (U = 0; U < V; U++) Ce.push(0.25 + 1.5 * Math.sqrt((V - 1) * U - Math.pow(U, 2)) / (V - 1)), Me.push(0.5), Te.push(2 * (Math.pow(U / V, 2) - U / V) + 0.6); - var ae = []; + var se = []; for (U = 0; U < V * 2 - 1; U++) - ae[U] = [U, U + 1, U + 1 - 2 * V, U - 2 * V]; - ae[V * 2 - 1] = [ + se[U] = [U, U + 1, U + 1 - 2 * V, U - 2 * V]; + se[V * 2 - 1] = [ U, U + 1 - 2 * V, U + 1 - 4 * V, @@ -16673,32 +16673,32 @@ ATOM`, g); var pe, we, ke, Ue, Ne, Be, ue, ye, ge, Se; let ze = P.updateGeoGroup(); for (H = 0; H < Q; H++) { - let K = P.groups, q = !1; - ze = P.updateGeoGroup(2 * V), K != P.groups && H > 0 && (H = H - 1, q = !0), Be = Math.round(H * (F.length - 1) / Q), Ne = h.CC.color(F[Be]), se = ne, fe = me, ne = [], me = [], oe = [], z[0][H].atom !== void 0 && (Ue = z[0][H].atom, G === "oval" ? ee = Ce : G === "rectangle" ? ee = Me : G === "parabola" && (ee = Te)), ee || (ee = Me); + let K = P.groups, ee = !1; + ze = P.updateGeoGroup(2 * V), K != P.groups && H > 0 && (H = H - 1, ee = !0), Be = Math.round(H * (F.length - 1) / Q), Ne = h.CC.color(F[Be]), ne = q, fe = me, q = [], me = [], ae = [], B[0][H].atom !== void 0 && (Ue = B[0][H].atom, G === "oval" ? oe = Ce : G === "rectangle" ? oe = Me : G === "parabola" && (oe = Te)), oe || (oe = Me); var He, We; for (U = 0; U < V; U++) - H < Q - 1 ? He = z[U][H + 1].clone().sub(z[U][H]) : He = z[U][H - 1].clone().sub(z[U][H]).negate(), U < V - 1 ? We = z[U + 1][H].clone().sub(z[U][H]) : We = z[U - 1][H].clone().sub(z[U][H]).negate(), oe[U] = We.cross(He).normalize().multiplyScalar($ * ee[U]); + H < Q - 1 ? He = B[U][H + 1].clone().sub(B[U][H]) : He = B[U][H - 1].clone().sub(B[U][H]).negate(), U < V - 1 ? We = B[U + 1][H].clone().sub(B[U][H]) : We = B[U - 1][H].clone().sub(B[U][H]).negate(), ae[U] = We.cross(He).normalize().multiplyScalar($ * oe[U]); for (U = 0; U < V; U++) - ne[U] = z[U][H].clone().add(oe[U].clone().negate()); + q[U] = B[U][H].clone().add(ae[U].clone().negate()); for (U = 0; U < V; U++) - me[U] = z[U][H].clone().add(oe[U]); + me[U] = B[U][H].clone().add(ae[U]); for (ue = ze.vertexArray, ye = ze.colorArray, ge = ze.faceArray, pe = ze.vertices, we = pe * 3, U = 0; U < V; U++) - ue[we + 3 * U + 0] = ne[U].x, ue[we + 3 * U + 1] = ne[U].y, ue[we + 3 * U + 2] = ne[U].z; + ue[we + 3 * U + 0] = q[U].x, ue[we + 3 * U + 1] = q[U].y, ue[we + 3 * U + 2] = q[U].z; for (U = 0; U < V; U++) ue[we + 3 * U + 0 + 3 * V] = me[V - 1 - U].x, ue[we + 3 * U + 1 + 3 * V] = me[V - 1 - U].y, ue[we + 3 * U + 2 + 3 * V] = me[V - 1 - U].z; for (U = 0; U < 2 * V; ++U) ye[we + 3 * U + 0] = Ne.r, ye[we + 3 * U + 1] = Ne.g, ye[we + 3 * U + 2] = Ne.b; - if (H > 0 && !q) { + if (H > 0 && !ee) { for (U = 0; U < V * 2; U++) Se = [ - pe + ae[U][0], - pe + ae[U][1], - pe + ae[U][2], - pe + ae[U][3] + pe + se[U][0], + pe + se[U][1], + pe + se[U][2], + pe + se[U][3] ], ke = ze.faceidx, ge[ke] = Se[0], ge[ke + 1] = Se[1], ge[ke + 2] = Se[3], ge[ke + 3] = Se[1], ge[ke + 4] = Se[2], ge[ke + 5] = Se[3], ze.faceidx += 6; if (Ue.clickable || Ue.hoverable) { var Y = []; - Y.push(new f.Triangle(se[0], ne[0], ne[V - 1])), Y.push(new f.Triangle(se[0], ne[V - 1], se[V - 1])), Y.push(new f.Triangle(se[V - 1], ne[V - 1], me[V - 1])), Y.push(new f.Triangle(se[V - 1], me[V - 1], fe[V - 1])), Y.push(new f.Triangle(me[0], fe[0], fe[V - 1])), Y.push(new f.Triangle(me[V - 1], me[0], fe[V - 1])), Y.push(new f.Triangle(ne[0], se[0], fe[0])), Y.push(new f.Triangle(me[0], ne[0], fe[0])); + Y.push(new f.Triangle(ne[0], q[0], q[V - 1])), Y.push(new f.Triangle(ne[0], q[V - 1], ne[V - 1])), Y.push(new f.Triangle(ne[V - 1], q[V - 1], me[V - 1])), Y.push(new f.Triangle(ne[V - 1], me[V - 1], fe[V - 1])), Y.push(new f.Triangle(me[0], fe[0], fe[V - 1])), Y.push(new f.Triangle(me[V - 1], me[0], fe[V - 1])), Y.push(new f.Triangle(q[0], ne[0], fe[0])), Y.push(new f.Triangle(me[0], q[0], fe[0])); for (U in Y) Ue.intersectionShape.triangle.push(Y[U]); } @@ -16715,103 +16715,103 @@ ATOM`, g); pe - 2 * V + H ], ke = ze.faceidx, ge[ke] = Se[0], ge[ke + 1] = Se[1], ge[ke + 2] = Se[3], ge[ke + 3] = Se[1], ge[ke + 4] = Se[2], ge[ke + 5] = Se[3], ze.faceidx += 6; } - function p(P, z, F, N, $, k) { - if (!(z.length < 2)) { + function p(P, B, F, N, $, k) { + if (!(B.length < 2)) { var G, H; - if (G = z[0], H = z[z.length - 1], G = c(G, N), H = c(H, N), !$) + if (G = B[0], H = B[B.length - 1], G = c(G, N), H = c(H, N), !$) return o(P, G, H, F); - var U = [], V, Q, oe, ee, ne, me = [ + var U = [], V, Q, ae, oe, q, me = [ [0, 2, -6, -8], [-4, -2, 6, 4], [7, -1, -5, 3], [-3, 5, 1, -7] - ], se, fe, Ce, Me, Te, ae, pe, we, ke, Ue, Ne, Be, ue, ye, ge, Se, ze; + ], ne, fe, Ce, Me, Te, se, pe, we, ke, Ue, Ne, Be, ue, ye, ge, Se, ze; for (we = 0, ke = G.length; we < ke; we++) { - if (Te = Math.round(we * (F.length - 1) / ke), Me = h.CC.color(F[Te]), U.push(Q = G[we]), U.push(Q), U.push(oe = H[we]), U.push(oe), we < ke - 1) { + if (Te = Math.round(we * (F.length - 1) / ke), Me = h.CC.color(F[Te]), U.push(Q = G[we]), U.push(Q), U.push(ae = H[we]), U.push(ae), we < ke - 1) { var He = G[we + 1].clone().sub(G[we]), We = H[we].clone().sub(G[we]); V = We.cross(He).normalize().multiplyScalar($); } - for (U.push(ee = G[we].clone().add(V)), U.push(ee), U.push(ne = H[we].clone().add(V)), U.push(ne), Q.atom !== void 0 && (ae = Q.atom), ye = P.updateGeoGroup(8), ge = ye.vertexArray, Se = ye.colorArray, ze = ye.faceArray, se = ye.vertices, fe = se * 3, ge[fe] = Q.x, ge[fe + 1] = Q.y, ge[fe + 2] = Q.z, ge[fe + 3] = Q.x, ge[fe + 4] = Q.y, ge[fe + 5] = Q.z, ge[fe + 6] = oe.x, ge[fe + 7] = oe.y, ge[fe + 8] = oe.z, ge[fe + 9] = oe.x, ge[fe + 10] = oe.y, ge[fe + 11] = oe.z, ge[fe + 12] = ee.x, ge[fe + 13] = ee.y, ge[fe + 14] = ee.z, ge[fe + 15] = ee.x, ge[fe + 16] = ee.y, ge[fe + 17] = ee.z, ge[fe + 18] = ne.x, ge[fe + 19] = ne.y, ge[fe + 20] = ne.z, ge[fe + 21] = ne.x, ge[fe + 22] = ne.y, ge[fe + 23] = ne.z, Ue = 0; Ue < 8; ++Ue) + for (U.push(oe = G[we].clone().add(V)), U.push(oe), U.push(q = H[we].clone().add(V)), U.push(q), Q.atom !== void 0 && (se = Q.atom), ye = P.updateGeoGroup(8), ge = ye.vertexArray, Se = ye.colorArray, ze = ye.faceArray, ne = ye.vertices, fe = ne * 3, ge[fe] = Q.x, ge[fe + 1] = Q.y, ge[fe + 2] = Q.z, ge[fe + 3] = Q.x, ge[fe + 4] = Q.y, ge[fe + 5] = Q.z, ge[fe + 6] = ae.x, ge[fe + 7] = ae.y, ge[fe + 8] = ae.z, ge[fe + 9] = ae.x, ge[fe + 10] = ae.y, ge[fe + 11] = ae.z, ge[fe + 12] = oe.x, ge[fe + 13] = oe.y, ge[fe + 14] = oe.z, ge[fe + 15] = oe.x, ge[fe + 16] = oe.y, ge[fe + 17] = oe.z, ge[fe + 18] = q.x, ge[fe + 19] = q.y, ge[fe + 20] = q.z, ge[fe + 21] = q.x, ge[fe + 22] = q.y, ge[fe + 23] = q.z, Ue = 0; Ue < 8; ++Ue) Se[fe + 3 * Ue] = Me.r, Se[fe + 1 + 3 * Ue] = Me.g, Se[fe + 2 + 3 * Ue] = Me.b; if (we > 0) { - var Y = pe !== void 0 && ae !== void 0 && pe.serial !== ae.serial; + var Y = pe !== void 0 && se !== void 0 && pe.serial !== se.serial; for (Ue = 0; Ue < 4; Ue++) { var K = [ - se + me[Ue][0], - se + me[Ue][1], - se + me[Ue][2], - se + me[Ue][3] + ne + me[Ue][0], + ne + me[Ue][1], + ne + me[Ue][2], + ne + me[Ue][3] ]; - if (Ce = ye.faceidx, ze[Ce] = K[0], ze[Ce + 1] = K[1], ze[Ce + 2] = K[3], ze[Ce + 3] = K[1], ze[Ce + 4] = K[2], ze[Ce + 5] = K[3], ye.faceidx += 6, ae.clickable || pe.clickable || ae.hoverable || pe.hoverable) { - var q = U[K[3]].clone(), de = U[K[0]].clone(), ve = U[K[2]].clone(), Ie = U[K[1]].clone(); - if (q.atom = U[K[3]].atom || null, ve.atom = U[K[2]].atom || null, de.atom = U[K[0]].atom || null, Ie.atom = U[K[1]].atom || null, Y) { - var Re = q.clone().add(de).multiplyScalar(0.5), Z = ve.clone().add(Ie).multiplyScalar(0.5), ce = q.clone().add(Ie).multiplyScalar(0.5); - Ue % 2 === 0 ? ((pe.clickable || pe.hoverable) && (Ne = new f.Triangle(Re, ce, q), Be = new f.Triangle(Z, ve, ce), ue = new f.Triangle(ce, ve, q), pe.intersectionShape.triangle.push(Ne), pe.intersectionShape.triangle.push(Be), pe.intersectionShape.triangle.push(ue)), (ae.clickable || ae.hoverable) && (Ne = new f.Triangle(de, Ie, ce), Be = new f.Triangle(Ie, Z, ce), ue = new f.Triangle(de, ce, Re), ae.intersectionShape.triangle.push(Ne), ae.intersectionShape.triangle.push(Be), ae.intersectionShape.triangle.push(ue))) : ((ae.clickable || ae.hoverable) && (Ne = new f.Triangle(Re, ce, q), Be = new f.Triangle(Z, ve, ce), ue = new f.Triangle(ce, ve, q), ae.intersectionShape.triangle.push(Ne), ae.intersectionShape.triangle.push(Be), ae.intersectionShape.triangle.push(ue)), (pe.clickable || pe.hoverable) && (Ne = new f.Triangle(de, Ie, ce), Be = new f.Triangle(Ie, Z, ce), ue = new f.Triangle(de, ce, Re), pe.intersectionShape.triangle.push(Ne), pe.intersectionShape.triangle.push(Be), pe.intersectionShape.triangle.push(ue))); + if (Ce = ye.faceidx, ze[Ce] = K[0], ze[Ce + 1] = K[1], ze[Ce + 2] = K[3], ze[Ce + 3] = K[1], ze[Ce + 4] = K[2], ze[Ce + 5] = K[3], ye.faceidx += 6, se.clickable || pe.clickable || se.hoverable || pe.hoverable) { + var ee = U[K[3]].clone(), de = U[K[0]].clone(), ve = U[K[2]].clone(), Ie = U[K[1]].clone(); + if (ee.atom = U[K[3]].atom || null, ve.atom = U[K[2]].atom || null, de.atom = U[K[0]].atom || null, Ie.atom = U[K[1]].atom || null, Y) { + var Re = ee.clone().add(de).multiplyScalar(0.5), Z = ve.clone().add(Ie).multiplyScalar(0.5), ce = ee.clone().add(Ie).multiplyScalar(0.5); + Ue % 2 === 0 ? ((pe.clickable || pe.hoverable) && (Ne = new f.Triangle(Re, ce, ee), Be = new f.Triangle(Z, ve, ce), ue = new f.Triangle(ce, ve, ee), pe.intersectionShape.triangle.push(Ne), pe.intersectionShape.triangle.push(Be), pe.intersectionShape.triangle.push(ue)), (se.clickable || se.hoverable) && (Ne = new f.Triangle(de, Ie, ce), Be = new f.Triangle(Ie, Z, ce), ue = new f.Triangle(de, ce, Re), se.intersectionShape.triangle.push(Ne), se.intersectionShape.triangle.push(Be), se.intersectionShape.triangle.push(ue))) : ((se.clickable || se.hoverable) && (Ne = new f.Triangle(Re, ce, ee), Be = new f.Triangle(Z, ve, ce), ue = new f.Triangle(ce, ve, ee), se.intersectionShape.triangle.push(Ne), se.intersectionShape.triangle.push(Be), se.intersectionShape.triangle.push(ue)), (pe.clickable || pe.hoverable) && (Ne = new f.Triangle(de, Ie, ce), Be = new f.Triangle(Ie, Z, ce), ue = new f.Triangle(de, ce, Re), pe.intersectionShape.triangle.push(Ne), pe.intersectionShape.triangle.push(Be), pe.intersectionShape.triangle.push(ue))); } else - (ae.clickable || ae.hoverable) && (Ne = new f.Triangle(de, Ie, q), Be = new f.Triangle(Ie, ve, q), ae.intersectionShape.triangle.push(Ne), ae.intersectionShape.triangle.push(Be)); + (se.clickable || se.hoverable) && (Ne = new f.Triangle(de, Ie, ee), Be = new f.Triangle(Ie, ve, ee), se.intersectionShape.triangle.push(Ne), se.intersectionShape.triangle.push(Be)); } } } - ye.vertices += 8, pe = ae; + ye.vertices += 8, pe = se; } var Ae = U.length - 8; - for (ye = P.updateGeoGroup(8), ge = ye.vertexArray, Se = ye.colorArray, ze = ye.faceArray, se = ye.vertices, fe = se * 3, Ce = ye.faceidx, we = 0; we < 4; we++) { + for (ye = P.updateGeoGroup(8), ge = ye.vertexArray, Se = ye.colorArray, ze = ye.faceArray, ne = ye.vertices, fe = ne * 3, Ce = ye.faceidx, we = 0; we < 4; we++) { U.push(U[we * 2]), U.push(U[Ae + we * 2]); var Fe = U[we * 2], he = U[Ae + we * 2]; ge[fe + 6 * we] = Fe.x, ge[fe + 1 + 6 * we] = Fe.y, ge[fe + 2 + 6 * we] = Fe.z, ge[fe + 3 + 6 * we] = he.x, ge[fe + 4 + 6 * we] = he.y, ge[fe + 5 + 6 * we] = he.z, Se[fe + 6 * we] = Me.r, Se[fe + 1 + 6 * we] = Me.g, Se[fe + 2 + 6 * we] = Me.b, Se[fe + 3 + 6 * we] = Me.r, Se[fe + 4 + 6 * we] = Me.g, Se[fe + 5 + 6 * we] = Me.b; } - Ae += 8, Ne = [se, se + 2, se + 6, se + 4], Be = [se + 1, se + 5, se + 7, se + 3], ze[Ce] = Ne[0], ze[Ce + 1] = Ne[1], ze[Ce + 2] = Ne[3], ze[Ce + 3] = Ne[1], ze[Ce + 4] = Ne[2], ze[Ce + 5] = Ne[3], ze[Ce + 6] = Be[0], ze[Ce + 7] = Be[1], ze[Ce + 8] = Be[3], ze[Ce + 9] = Be[1], ze[Ce + 10] = Be[2], ze[Ce + 11] = Be[3], ye.faceidx += 12, ye.vertices += 8; + Ae += 8, Ne = [ne, ne + 2, ne + 6, ne + 4], Be = [ne + 1, ne + 5, ne + 7, ne + 3], ze[Ce] = Ne[0], ze[Ce + 1] = Ne[1], ze[Ce + 2] = Ne[3], ze[Ce + 3] = Ne[1], ze[Ce + 4] = Ne[2], ze[Ce + 5] = Ne[3], ze[Ce + 6] = Be[0], ze[Ce + 7] = Be[1], ze[Ce + 8] = Be[3], ze[Ce + 9] = Be[1], ze[Ce + 10] = Be[2], ze[Ce + 11] = Be[3], ye.faceidx += 12, ye.vertices += 8; } } - function v(P, z, F, N, $, k, G) { - (!G || G === "default") && (G = "rectangle"), G === "edged" ? p(P, z, F, N, $) : (G === "rectangle" || G === "oval" || G === "parabola") && w(P, z, F, N, $, k, G); + function v(P, B, F, N, $, k, G) { + (!G || G === "default") && (G = "rectangle"), G === "edged" ? p(P, B, F, N, $) : (G === "rectangle" || G === "oval" || G === "parabola") && w(P, B, F, N, $, k, G); } function a(P) { return P && P.elem === "C" && P.atom === "CA"; } - function l(P, z) { - if (P && z && P.chain === z.chain) { - if (!P.hetflag && !z.hetflag && P.reschain === z.reschain && (P.resi === z.resi || P.resi === z.resi - 1)) + function l(P, B) { + if (P && B && P.chain === B.chain) { + if (!P.hetflag && !B.hetflag && P.reschain === B.reschain && (P.resi === B.resi || P.resi === B.resi - 1)) return !0; - if (P.resi < z.resi) { - var F = P.x - z.x, N = P.y - z.y, $ = P.z - z.z, k = F * F + N * N + $ * $; - if (P.atom == "CA" && z.atom == "CA" && k < 16) + if (P.resi < B.resi) { + var F = P.x - B.x, N = P.y - B.y, $ = P.z - B.z, k = F * F + N * N + $ * $; + if (P.atom == "CA" && B.atom == "CA" && k < 16) return !0; - if ((P.atom == "P" || z.atom == "P") && k < 64) + if ((P.atom == "P" || B.atom == "P") && k < 64) return !0; } } return !1; } - function g(P, z, F, N, $) { - if (!(z == null || z.vertices == 0)) { - $ && (z.initTypedArrays(), z.setUpNormals()); - var k = new _.MeshDoubleLambertMaterial(); - k.vertexColors = _.Coloring.FaceColors, typeof F == "number" && F >= 0 && F < 1 && (k.transparent = !0, k.opacity = F), k.outline = N; - var G = new _.Mesh(z, k); + function g(P, B, F, N, $) { + if (!(B == null || B.vertices == 0)) { + $ && (B.initTypedArrays(), B.setUpNormals()); + var k = new u.MeshDoubleLambertMaterial(); + k.vertexColors = u.Coloring.FaceColors, typeof F == "number" && F >= 0 && F < 1 && (k.transparent = !0, k.opacity = F), k.outline = N; + var G = new u.Mesh(B, k); P.add(G); } } - function M(P, z, F, N, $, k, G, H, U) { - var V, Q, oe, ee, ne, me; + function M(P, B, F, N, $, k, G, H, U) { + var V, Q, ae, oe, q, me; if (!(!N || !$ || !G)) { - var se = $.sub(N); - se.normalize(); + var ne = $.sub(N); + ne.normalize(); var fe = H[U]; for (Q = U + 1; Q < H.length && (fe = H[Q], fe.atom != G.atom); Q++) ; - if (fe = fe ? new s.Vector3(fe.x, fe.y, fe.z) : new s.Vector3(0, 0, 0), fe.sub(N), G.ss === "arrow start") { + if (fe = fe ? new n.Vector3(fe.x, fe.y, fe.z) : new n.Vector3(0, 0, 0), fe.sub(N), G.ss === "arrow start") { var Ce = fe.clone().multiplyScalar(0.3).cross($); N.add(Ce); - var Me = fe.clone().cross(se).normalize(); - se.rotateAboutVector(Me, 0.43); + var Me = fe.clone().cross(ne).normalize(); + ne.rotateAboutVector(Me, 0.43); } - for (G.style.cartoon.ribbon ? V = G.style.cartoon.thickness || S : G.style.cartoon.width ? V = G.style.cartoon.width : G.ss === "c" ? G.atom === "P" ? V = A : V = C : G.ss === "arrow start" ? (V = b, ne = !0) : G.ss === "arrow end" || G.ss === "h" && G.style.cartoon.tubes || G.ss === "tube start" ? V = C : V = b, k != null && se.dot(k) < 0 && se.negate(), se.multiplyScalar(V), Q = 0; Q < z; Q++) - oe = -1 + Q * 2 / (z - 1), ee = new s.Vector3(N.x + oe * se.x, N.y + oe * se.y, N.z + oe * se.z), ee.atom = G, F && G.ss === "s" && (ee.smoothen = !0), P[Q].push(ee); - if (ne) - for (se.multiplyScalar(2), Q = 0; Q < z; Q++) - oe = -1 + Q * 2 / (z - 1), ee = new s.Vector3(N.x + oe * se.x, N.y + oe * se.y, N.z + oe * se.z), ee.atom = G, ee.smoothen = !1, ee.skip = !0, P[Q].push(ee); - return me = G.style.cartoon.style || "default", P.style ? P.style != me && (console.log("Warning: a cartoon chain's strand-style is ambiguous"), P.style = "default") : P.style = me, (G.ss === "arrow start" || G.ss === "arrow end") && (G.ss = "s"), ne; + for (G.style.cartoon.ribbon ? V = G.style.cartoon.thickness || S : G.style.cartoon.width ? V = G.style.cartoon.width : G.ss === "c" ? G.atom === "P" ? V = A : V = C : G.ss === "arrow start" ? (V = b, q = !0) : G.ss === "arrow end" || G.ss === "h" && G.style.cartoon.tubes || G.ss === "tube start" ? V = C : V = b, k != null && ne.dot(k) < 0 && ne.negate(), ne.multiplyScalar(V), Q = 0; Q < B; Q++) + ae = -1 + Q * 2 / (B - 1), oe = new n.Vector3(N.x + ae * ne.x, N.y + ae * ne.y, N.z + ae * ne.z), oe.atom = G, F && G.ss === "s" && (oe.smoothen = !0), P[Q].push(oe); + if (q) + for (ne.multiplyScalar(2), Q = 0; Q < B; Q++) + ae = -1 + Q * 2 / (B - 1), oe = new n.Vector3(N.x + ae * ne.x, N.y + ae * ne.y, N.z + ae * ne.z), oe.atom = G, oe.smoothen = !1, oe.skip = !0, P[Q].push(oe); + return me = G.style.cartoon.style || "default", P.style ? P.style != me && (console.log("Warning: a cartoon chain's strand-style is ambiguous"), P.style = "default") : P.style = me, (G.ss === "arrow start" || G.ss === "arrow end") && (G.ss = "s"), q; } } const L = { @@ -16831,86 +16831,86 @@ ATOM`, g); "C2*": !0, N1: !0, N3: !0 - }, T = { DA: !0, DG: !0, A: !0, G: !0 }, D = { DT: !0, DC: !0, U: !0, C: !0, T: !0 }, R = { DA: !0, DG: !0, A: !0, G: !0, DT: !0, DC: !0, U: !0, C: !0, T: !0 }; - function B(P, z, F, N = 10) { + }, T = { DA: !0, DG: !0, A: !0, G: !0 }, D = { DT: !0, DC: !0, U: !0, C: !0, T: !0 }, I = { DA: !0, DG: !0, A: !0, G: !0, DT: !0, DC: !0, U: !0, C: !0, T: !0 }; + function z(P, B, F, N = 10) { let $ = N, k = N; - var G, H, U, V, Q, oe, ee, ne, me, se, fe, Ce, Me, Te, ae, pe, we, ke, Ue = new _.Geometry(!0), Ne = new _.Geometry(!0), Be = [], ue = [], ye = 1, ge = !1, Se = {}; - for (var ze in x.Gradient.builtinGradients) - x.Gradient.builtinGradients.hasOwnProperty(ze) && (Se[ze] = new x.Gradient.builtinGradients[ze](F[1], F[0])); + var G, H, U, V, Q, ae, oe, q, me, ne, fe, Ce, Me, Te, se, pe, we, ke, Ue = new u.Geometry(!0), Ne = new u.Geometry(!0), Be = [], ue = [], ye = 1, ge = !1, Se = {}; + for (var ze in y.Gradient.builtinGradients) + y.Gradient.builtinGradients.hasOwnProperty(ze) && (Se[ze] = new y.Gradient.builtinGradients[ze](F[1], F[0])); var He = function(j, $e) { return F && $e.color === "spectrum" ? $e.colorscheme in Se ? Se[$e.colorscheme].valueToHex(j.resi) : Se.sinebow.valueToHex(j.resi) : (0, E.getColorFromStyle)(j, $e).getHex(); }; - for (ne = 0; ne < $; ne++) - ue[ne] = []; + for (q = 0; q < $; q++) + ue[q] = []; var We = !1, Y = !1, K = []; - for (ne in z) { - if (V = z[ne], V.elem === "C" && V.atom === "CA") { - var q = l(U, V); - q && V.ss === "s" ? We = !0 : We && (U && H && U.style.cartoon.arrows && H.style.cartoon.arrows && (U.ss = "arrow end", H.ss = "arrow start"), We = !1), q && (U.ss === "h" || U.ss == "tube start") && U.style.cartoon.tubes ? !Y && U.ss != "tube start" && V.style.cartoon.tubes && (V.ss = "tube start", Y = !0) : Y && (U.ss === "tube start" ? U.ss = "tube end" : H && H.style.cartoon.tubes && (H.ss = "tube end"), Y = !1), H = U, U = V; + for (q in B) { + if (V = B[q], V.elem === "C" && V.atom === "CA") { + var ee = l(U, V); + ee && V.ss === "s" ? We = !0 : We && (U && H && U.style.cartoon.arrows && H.style.cartoon.arrows && (U.ss = "arrow end", H.ss = "arrow start"), We = !1), ee && (U.ss === "h" || U.ss == "tube start") && U.style.cartoon.tubes ? !Y && U.ss != "tube start" && V.style.cartoon.tubes && (V.ss = "tube start", Y = !0) : Y && (U.ss === "tube start" ? U.ss = "tube end" : H && H.style.cartoon.tubes && (H.ss = "tube end"), Y = !1), H = U, U = V; } V && V.atom in L && K.push(V); } Y && U.style.cartoon.tubes && (U.ss = "tube end", Y = !1); var de = function(j) { - ue[0].length > 0 && v(Ne, ue, Be, k, ee, ye, ue.style); + ue[0].length > 0 && v(Ne, ue, Be, k, oe, ye, ue.style); var $e = [], Ve = null; if (j) { - for (ne = 0; ne < $; ne++) - $e[ne] = ue[ne][ue[ne].length - 1]; + for (q = 0; q < $; q++) + $e[q] = ue[q][ue[q].length - 1]; Ve = Be[Be.length - 1]; } - for (ue = [], ne = 0; ne < $; ne++) - ue[ne] = []; + for (ue = [], q = 0; q < $; q++) + ue[q] = []; if (Be = [], j) { - for (ne = 0; ne < $; ne++) - ue[ne].push($e[ne]); + for (q = 0; q < $; q++) + ue[q].push($e[q]); Be.push(Ve); } - g(P, Ne, ye, ge, !0), g(P, Ue, ye, ge, !1), Ne = new _.Geometry(!0), Ue = new _.Geometry(!0); + g(P, Ne, ye, ge, !0), g(P, Ue, ye, ge, !1), Ne = new u.Geometry(!0), Ue = new u.Geometry(!0); }; U = void 0; for (var ve = 0; ve < K.length; ve++) { V = K[ve]; - var Ie = V.resn.trim(), Re = Ie in R; + var Ie = V.resn.trim(), Re = Ie in I; if (ye = 1, G = V.style.cartoon, U && U.style.cartoon && (ye = U.style.cartoon.opacity), U && U.style.cartoon && U.style.cartoon.outline && (ge = U.style.cartoon.outline), U && U.style.cartoon && (!V.style.cartoon || U.style.cartoon.opacity != V.style.cartoon.opacity) && de(U.chain == V.chain), G.style === "trace") { if (!V.hetflag) { if (V.elem === "C" && V.atom === "CA" || Re && V.atom === "P" || V.atom === "BB") { - if (oe = He(V, G), (0, E.isNumeric)(G.thickness) ? ee = G.thickness : ee = S, l(U, V)) - if (oe == Q) { - var Z = h.CC.color(oe); - u.GLDraw.drawCylinder(Ue, U, V, ee, Z, 2, 2); + if (ae = He(V, G), (0, E.isNumeric)(G.thickness) ? oe = G.thickness : oe = S, l(U, V)) + if (ae == Q) { + var Z = h.CC.color(ae); + _.GLDraw.drawCylinder(Ue, U, V, oe, Z, 2, 2); } else { - var ce = new s.Vector3().addVectors(U, V).multiplyScalar(0.5), Ae = h.CC.color(Q), Fe = h.CC.color(oe); - u.GLDraw.drawCylinder(Ue, U, ce, ee, Ae, 2, 0), u.GLDraw.drawCylinder(Ue, ce, V, ee, Fe, 0, 2); + var ce = new n.Vector3().addVectors(U, V).multiplyScalar(0.5), Ae = h.CC.color(Q), Fe = h.CC.color(ae); + _.GLDraw.drawCylinder(Ue, U, ce, oe, Ae, 2, 0), _.GLDraw.drawCylinder(Ue, ce, V, oe, Fe, 0, 2); } if ((V.clickable === !0 || V.hoverable) && V.intersectionShape !== void 0) { - var he = new s.Vector3(V.x, V.y, V.z); - V.intersectionShape.sphere.push(new f.Sphere(he, ee)); + var he = new n.Vector3(V.x, V.y, V.z); + V.intersectionShape.sphere.push(new f.Sphere(he, oe)); } - U = V, Q = oe; + U = V, Q = ae; } } } else { if (a(V) || Re && (V.atom === "P" || V.atom.indexOf("O5") == 0)) { if (ke) if (V.ss === "tube end") - ke = !1, we = new s.Vector3(V.x, V.y, V.z), u.GLDraw.drawCylinder(Ue, pe, we, 2, h.CC.color(Q), 1, 1), V.ss = "h"; + ke = !1, we = new n.Vector3(V.x, V.y, V.z), _.GLDraw.drawCylinder(Ue, pe, we, 2, h.CC.color(Q), 1, 1), V.ss = "h"; else if (U.chain != V.chain || U.ss === "tube end") - ke = !1, U.ss = "h", we = new s.Vector3(U.x, U.y, U.z), u.GLDraw.drawCylinder(Ue, pe, we, 2, h.CC.color(Q), 1, 1); + ke = !1, U.ss = "h", we = new n.Vector3(U.x, U.y, U.z), _.GLDraw.drawCylinder(Ue, pe, we, 2, h.CC.color(Q), 1, 1); else continue; if (U && (!l(U, V) || U.ss === "tube start")) { - for (U.ss === "tube start" && (ke = !0, pe = new s.Vector3(U.x, U.y, U.z), U.ss = "h"), ae && (Ce ? Te = new s.Vector3().addVectors(U, Ce).multiplyScalar(0.5) : Te = new s.Vector3(U.x, U.y, U.z), u.GLDraw.drawCylinder(Ue, Te, ae, n, h.CC.color(ae.color), 0, 2), M(ue, $, !0, Ce, Me, fe, U, K, ve), Be.push(oe), Te = null, ae = null), ue[0].length > 0 && v(Ne, ue, Be, k, ee, ye, ue.style), ue = [], ne = 0; ne < $; ne++) - ue[ne] = []; + for (U.ss === "tube start" && (ke = !0, pe = new n.Vector3(U.x, U.y, U.z), U.ss = "h"), se && (Ce ? Te = new n.Vector3().addVectors(U, Ce).multiplyScalar(0.5) : Te = new n.Vector3(U.x, U.y, U.z), _.GLDraw.drawCylinder(Ue, Te, se, s, h.CC.color(se.color), 0, 2), M(ue, $, !0, Ce, Me, fe, U, K, ve), Be.push(ae), Te = null, se = null), ue[0].length > 0 && v(Ne, ue, Be, k, oe, ye, ue.style), ue = [], q = 0; q < $; q++) + ue[q] = []; Be = []; } if (U === void 0 || U.rescode != V.rescode || U.resi != V.resi) { - if (ae) { - Te = new s.Vector3().addVectors(U, V).multiplyScalar(0.5); - var Oe = Te.clone().sub(ae).multiplyScalar(0.02); - Te.add(Oe), u.GLDraw.drawCylinder(Ue, Te, ae, n, h.CC.color(ae.color), 0, 2), Te = null, ae = null; + if (se) { + Te = new n.Vector3().addVectors(U, V).multiplyScalar(0.5); + var Oe = Te.clone().sub(se).multiplyScalar(0.02); + Te.add(Oe), _.GLDraw.drawCylinder(Ue, Te, se, s, h.CC.color(se.color), 0, 2), Te = null, se = null; } - oe = He(V, G), Be.push(oe), (0, E.isNumeric)(G.thickness) ? ee = G.thickness : ee = S, U = V, me = new s.Vector3(U.x, U.y, U.z), me.resi = U.resi, Q = oe; + ae = He(V, G), Be.push(ae), (0, E.isNumeric)(G.thickness) ? oe = G.thickness : oe = S, U = V, me = new n.Vector3(U.x, U.y, U.z), me.resi = U.resi, Q = ae; } (V.clickable === !0 || V.hoverable === !0) && (V.intersectionShape === void 0 || V.intersectionShape.triangle === void 0) && (V.intersectionShape = { sphere: null, @@ -16919,11 +16919,11 @@ ATOM`, g); triangle: [] }); } else - a(U) && V.atom === "O" || Re && U.atom === "P" && (V.atom === "OP2" || V.atom === "O2P") || Re && U.atom.indexOf("O5") == 0 && V.atom.indexOf("C5") == 0 ? (se = new s.Vector3(V.x, V.y, V.z), se.resi = V.resi, (V.atom === "OP2" || V.atom === "O2P") && (Me = new s.Vector3(V.x, V.y, V.z))) : Re && V.atom.indexOf("O3") == 0 ? Ce = new s.Vector3(V.x, V.y, V.z) : (V.atom === "N1" && Ie in T || V.atom === "N3" && Ie in D) && (ae = new s.Vector3(V.x, V.y, V.z), ae.color = (0, E.getColorFromStyle)(V, G).getHex()); - se && me && se.resi === me.resi && (M(ue, $, !0, me, se, fe, U, K, ve), fe = se, me = null, se = null, Be.push(oe)); + a(U) && V.atom === "O" || Re && U.atom === "P" && (V.atom === "OP2" || V.atom === "O2P") || Re && U.atom.indexOf("O5") == 0 && V.atom.indexOf("C5") == 0 ? (ne = new n.Vector3(V.x, V.y, V.z), ne.resi = V.resi, (V.atom === "OP2" || V.atom === "O2P") && (Me = new n.Vector3(V.x, V.y, V.z))) : Re && V.atom.indexOf("O3") == 0 ? Ce = new n.Vector3(V.x, V.y, V.z) : (V.atom === "N1" && Ie in T || V.atom === "N3" && Ie in D) && (se = new n.Vector3(V.x, V.y, V.z), se.color = (0, E.getColorFromStyle)(V, G).getHex()); + ne && me && ne.resi === me.resi && (M(ue, $, !0, me, ne, fe, U, K, ve), fe = ne, me = null, ne = null, Be.push(ae)); } } - ae && (Ce ? Te = new s.Vector3().addVectors(U, Ce).multiplyScalar(0.5) : Te = new s.Vector3(U.x, U.y, U.z), u.GLDraw.drawCylinder(Ue, Te, ae, n, h.CC.color(ae.color), 0, 2), M(ue, $, !0, Ce, Me, fe, U, K, ve), Be.push(oe)), de(!1); + se && (Ce ? Te = new n.Vector3().addVectors(U, Ce).multiplyScalar(0.5) : Te = new n.Vector3(U.x, U.y, U.z), _.GLDraw.drawCylinder(Ue, Te, se, s, h.CC.color(se.color), 0, 2), M(ue, $, !0, Ce, Me, fe, U, K, ve), Be.push(ae)), de(!1); } } ), @@ -16938,7 +16938,7 @@ ATOM`, g); /* harmony export */ CAP: () => ( /* reexport safe */ - n.CAP + s.CAP ), /* harmony export */ CC: () => ( @@ -16953,7 +16953,7 @@ ATOM`, g); /* harmony export */ CustomLinear: () => ( /* reexport safe */ - s.CustomLinear + n.CustomLinear ), /* harmony export */ Cylinder: () => ( @@ -16963,7 +16963,7 @@ ATOM`, g); /* harmony export */ GLDraw: () => ( /* reexport safe */ - n.GLDraw + s.GLDraw ), /* harmony export */ GLModel: () => ( @@ -16988,22 +16988,22 @@ ATOM`, g); /* harmony export */ Gradient: () => ( /* reexport safe */ - s.Gradient + n.Gradient ), /* harmony export */ GradientType: () => ( /* reexport safe */ - s.GradientType + n.GradientType ), /* harmony export */ Label: () => ( /* reexport safe */ - _.Label + u.Label ), /* harmony export */ LabelCount: () => ( /* reexport safe */ - _.LabelCount + u.LabelCount ), /* harmony export */ MarchingCube: () => ( @@ -17018,12 +17018,12 @@ ATOM`, g); /* harmony export */ Matrix3: () => ( /* reexport safe */ - u.Matrix3 + _.Matrix3 ), /* harmony export */ Matrix4: () => ( /* reexport safe */ - u.Matrix4 + _.Matrix4 ), /* harmony export */ Parsers: () => ( @@ -17048,27 +17048,27 @@ ATOM`, g); /* harmony export */ Quaternion: () => ( /* reexport safe */ - u.Quaternion + _.Quaternion ), /* harmony export */ ROYGB: () => ( /* reexport safe */ - s.ROYGB + n.ROYGB ), /* harmony export */ RWB: () => ( /* reexport safe */ - s.RWB + n.RWB ), /* harmony export */ Ray: () => ( /* reexport safe */ - u.Ray + _.Ray ), /* harmony export */ Sinebow: () => ( /* reexport safe */ - s.Sinebow + n.Sinebow ), /* harmony export */ Sphere: () => ( @@ -17088,12 +17088,12 @@ ATOM`, g); /* harmony export */ Vector2: () => ( /* reexport safe */ - u.Vector2 + _.Vector2 ), /* harmony export */ Vector3: () => ( /* reexport safe */ - u.Vector3 + _.Vector3 ), /* harmony export */ VolumeData: () => ( @@ -17108,7 +17108,7 @@ ATOM`, g); /* harmony export */ applyPartialCharges: () => ( /* reexport safe */ - x.applyPartialCharges + y.applyPartialCharges ), /* harmony export */ autoinit: () => ( @@ -17138,7 +17138,7 @@ ATOM`, g); /* harmony export */ builtinGradients: () => ( /* reexport safe */ - s.builtinGradients + n.builtinGradients ), /* harmony export */ chains: () => ( @@ -17148,12 +17148,12 @@ ATOM`, g); /* harmony export */ clamp: () => ( /* reexport safe */ - u.clamp + _.clamp ), /* harmony export */ conversionMatrix3: () => ( /* reexport safe */ - u.conversionMatrix3 + _.conversionMatrix3 ), /* harmony export */ createStereoViewer: () => ( @@ -17178,7 +17178,7 @@ ATOM`, g); /* harmony export */ degToRad: () => ( /* reexport safe */ - u.degToRad + _.degToRad ), /* harmony export */ download: () => ( @@ -17228,7 +17228,7 @@ ATOM`, g); /* harmony export */ getGradient: () => ( /* reexport safe */ - s.getGradient + n.getGradient ), /* harmony export */ getPropertyRange: () => ( @@ -17268,12 +17268,12 @@ ATOM`, g); /* harmony export */ normalizeValue: () => ( /* reexport safe */ - s.normalizeValue + n.normalizeValue ), /* harmony export */ partialCharges: () => ( /* reexport safe */ - x.partialCharges + y.partialCharges ), /* harmony export */ processing_autoinit: () => ( @@ -17327,22 +17327,22 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./Gradient */ "./src/Gradient.ts" ), f = t( /*! ./colors */ "./src/colors.ts" - ), _ = t( + ), u = t( /*! ./Label */ "./src/Label.ts" - ), x = t( + ), y = t( /*! ./partialCharges */ "./src/partialCharges.ts" ), h = t( /*! ./parsers */ "./src/parsers/index.ts" - ), u = t( + ), _ = t( /*! ./WebGL/math */ "./src/WebGL/math/index.ts" ), E = t( @@ -17363,7 +17363,7 @@ ATOM`, g); ), S = t( /*! ./GLShape */ "./src/GLShape.ts" - ), n = t( + ), s = t( /*! ./GLDraw */ "./src/GLDraw.ts" ), o = t( @@ -17396,24 +17396,24 @@ ATOM`, g); /* harmony export */ CDJSON: () => ( /* binding */ - s + n ) /* harmony export */ }); - function s(f, _) { - var x = [[]]; + function n(f, u) { + var y = [[]]; typeof f == "string" && (f = JSON.parse(f)); - for (var h = f.m, u = h[0].a, E = h[0].b, c = h[0].s, C = _ !== void 0 && _.parseStyle !== void 0 ? _.parseStyle : c !== void 0, b = x[x.length - 1].length, A = 0; A < u.length; A++) { - var S = u[A], n = {}; - n.id = S.i, n.x = S.x, n.y = S.y, n.z = S.z || 0, n.bonds = [], n.bondOrder = []; + for (var h = f.m, _ = h[0].a, E = h[0].b, c = h[0].s, C = u !== void 0 && u.parseStyle !== void 0 ? u.parseStyle : c !== void 0, b = y[y.length - 1].length, A = 0; A < _.length; A++) { + var S = _[A], s = {}; + s.id = S.i, s.x = S.x, s.y = S.y, s.z = S.z || 0, s.bonds = [], s.bondOrder = []; var o = S.l || "C"; - n.elem = o[0].toUpperCase() + o.substring(1).toLowerCase(), n.serial = x[x.length - 1].length, C && (n.style = c[S.s || 0]), x[x.length - 1].push(n); + s.elem = o[0].toUpperCase() + o.substring(1).toLowerCase(), s.serial = y[y.length - 1].length, C && (s.style = c[S.s || 0]), y[y.length - 1].push(s); } for (let w = 0; w < E.length; w++) { - let p = E[w], v = p.b + b, a = p.e + b, l = p.o || 1, g = x[x.length - 1][v], M = x[x.length - 1][a]; + let p = E[w], v = p.b + b, a = p.e + b, l = p.o || 1, g = y[y.length - 1][v], M = y[y.length - 1][a]; g.bonds.push(a), g.bondOrder.push(l), M.bonds.push(v), M.bondOrder.push(l); } - return x; + return y; } } ), @@ -17432,26 +17432,26 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" ), f = t( /*! ./utils/computeSecondaryStructure */ "./src/parsers/utils/computeSecondaryStructure.ts" - ), _ = t( + ), u = t( /*! ./utils/processSymmetries */ "./src/parsers/utils/processSymmetries.ts" - ), x = t( + ), y = t( /*! ../WebGL */ "./src/WebGL/index.ts" ); - function h(u, E = {}) { - var c = [], C = !E.doAssembly, b = c.modelData = [], A = E.assignBonds === void 0 ? !0 : E.assignBonds, S = function(K, q, de, ve) { - return new x.Vector3(q, de, ve).applyMatrix3(K); + function h(_, E = {}) { + var c = [], C = !E.doAssembly, b = c.modelData = [], A = E.assignBonds === void 0 ? !0 : E.assignBonds, S = function(K, ee, de, ve) { + return new y.Vector3(ee, de, ve).applyMatrix3(K); }; - function n(K, q) { + function s(K, ee) { for (var de = [], ve = 0, Ie = 0; Ie < K.length; ) { - for (; K.substring(Ie, Ie + q.length) !== q && Ie < K.length; ) { + for (; K.substring(Ie, Ie + ee.length) !== ee && Ie < K.length; ) { if (K[Ie] === "'") for (Ie++; Ie < K.length && K[Ie] !== "'"; ) Ie++; @@ -17460,19 +17460,19 @@ ATOM`, g); Ie++; Ie++; } - de.push(K.substring(ve, Ie)), ve = Ie = Ie + q.length; + de.push(K.substring(ve, Ie)), ve = Ie = Ie + ee.length; } return de; } - var o = u.split(/\r?\n|\r/), w = [], p = !1; + var o = _.split(/\r?\n|\r/), w = [], p = !1; for (let K = 0; K < o.length; K++) { var v = o[K].split("#")[0]; if (p ? v[0] === ";" && (p = !1) : v[0] === ";" && (p = !0), p || v !== "") { if (!p && (v = v.trim(), v[0] === "_")) { var a = v.split(/\s/)[0].indexOf("."); if (a > -1) { - let q = v.split(""); - q[a] = "_", v = q.join(""), v = v.substring(0, a) + "_" + v.substring(a + 1); + let ee = v.split(""); + ee[a] = "_", v = ee.join(""), v = v.substring(0, a) + "_" + v.substring(a + 1); } } w.push(v); @@ -17501,26 +17501,26 @@ ATOM`, g); l++; } else if (w[l].substring(0, 5) === "loop_") { l++; - for (var R = []; w[l] === "" || w[l][0] === "_"; ) { + for (var I = []; w[l] === "" || w[l][0] === "_"; ) { if (w[l] !== "") { - let K = w[l].split(/\s/)[0].toLowerCase(), q = g[K] = g[K] || []; - R.push(q); + let K = w[l].split(/\s/)[0].toLowerCase(), ee = g[K] = g[K] || []; + I.push(ee); } l++; } - for (var B = 0; l < w.length && w[l][0] !== "_" && !w[l].startsWith("loop_") && !w[l].startsWith("data_"); ) { - let K = n(w[l], " "); + for (var z = 0; l < w.length && w[l][0] !== "_" && !w[l].startsWith("loop_") && !w[l].startsWith("data_"); ) { + let K = s(w[l], " "); for (var P = 0; P < K.length; P++) - K[P] !== "" && (R[B].push(K[P]), B = (B + 1) % R.length); + K[P] !== "" && (I[z].push(K[P]), z = (z + 1) % I.length); l++; } } else l++; b.push({ symmetries: [] }), c.push([]); - var z = g._atom_site_id !== void 0 ? g._atom_site_id.length : g._atom_site_label.length, F; + var B = g._atom_site_id !== void 0 ? g._atom_site_id.length : g._atom_site_label.length, F; if (g._cell_length_a !== void 0) { var N = parseFloat(g._cell_length_a), $ = parseFloat(g._cell_length_b), k = parseFloat(g._cell_length_c), G = parseFloat(g._cell_angle_alpha) || 90, H = parseFloat(g._cell_angle_beta) || 90, U = parseFloat(g._cell_angle_gamma) || 90; - F = (0, x.conversionMatrix3)(N, $, k, G, H, U), b[b.length - 1].cryst = { + F = (0, y.conversionMatrix3)(N, $, k, G, H, U), b[b.length - 1].cryst = { a: N, b: $, c: k, @@ -17529,52 +17529,52 @@ ATOM`, g); gamma: U }; } - for (var V = 0; V < z; V++) + for (var V = 0; V < B; V++) if (!(g._atom_site_group_pdb !== void 0 && g._atom_site_group_pdb[V] === "TER")) { var Q = {}; if (g._atom_site_cartn_x !== void 0) Q.x = parseFloat(g._atom_site_cartn_x[V]), Q.y = parseFloat(g._atom_site_cartn_y[V]), Q.z = parseFloat(g._atom_site_cartn_z[V]); else { - var oe = S(F, parseFloat(g._atom_site_fract_x[V]), parseFloat(g._atom_site_fract_y[V]), parseFloat(g._atom_site_fract_z[V])); - Q.x = oe.x, Q.y = oe.y, Q.z = oe.z; + var ae = S(F, parseFloat(g._atom_site_fract_x[V]), parseFloat(g._atom_site_fract_y[V]), parseFloat(g._atom_site_fract_z[V])); + Q.x = ae.x, Q.y = ae.y, Q.z = ae.z; } Q.chain = g._atom_site_auth_asym_id ? g._atom_site_auth_asym_id[V] : void 0, Q.resi = g._atom_site_auth_seq_id ? parseInt(g._atom_site_auth_seq_id[V]) : void 0, Q.resn = g._atom_site_auth_comp_id ? g._atom_site_auth_comp_id[V].trim() : void 0, Q.atom = g._atom_site_auth_atom_id ? g._atom_site_auth_atom_id[V].replace(/"/gm, "") : void 0, Q.hetflag = !g._atom_site_group_pdb || g._atom_site_group_pdb[V] === "HETA" || g._atom_site_group_pdb[V] === "HETATM"; - var ee = "X"; - g._atom_site_type_symbol ? ee = g._atom_site_type_symbol[V].replace(/\(?\+?\d+.*/, "") : g._atom_site_label && (ee = g._atom_site_label[V].split("_")[0].replace(/\(?\d+.*/, "")), Q.elem = ee[0].toUpperCase() + ee.substring(1, 2).toLowerCase(), Q.bonds = [], Q.ss = "c", Q.serial = V, Q.bondOrder = [], Q.properties = {}, c[c.length - 1].push(Q); + var oe = "X"; + g._atom_site_type_symbol ? oe = g._atom_site_type_symbol[V].replace(/\(?\+?\d+.*/, "") : g._atom_site_label && (oe = g._atom_site_label[V].split("_")[0].replace(/\(?\d+.*/, "")), Q.elem = oe[0].toUpperCase() + oe.substring(1, 2).toLowerCase(), Q.bonds = [], Q.ss = "c", Q.serial = V, Q.bondOrder = [], Q.properties = {}, c[c.length - 1].push(Q); } if (g._pdbx_struct_oper_list_id !== void 0 && !C) for (let K = 0; K < g._pdbx_struct_oper_list_id.length; K++) { - var ne = parseFloat(g["_pdbx_struct_oper_list_matrix[1][1]"][K]), me = parseFloat(g["_pdbx_struct_oper_list_matrix[1][2]"][K]), se = parseFloat(g["_pdbx_struct_oper_list_matrix[1][3]"][K]), fe = parseFloat(g["_pdbx_struct_oper_list_vector[1]"][K]), Ce = parseFloat(g["_pdbx_struct_oper_list_matrix[2][1]"][K]), Me = parseFloat(g["_pdbx_struct_oper_list_matrix[2][2]"][K]), Te = parseFloat(g["_pdbx_struct_oper_list_matrix[2][3]"][K]), ae = parseFloat(g["_pdbx_struct_oper_list_vector[2]"][K]), pe = parseFloat(g["_pdbx_struct_oper_list_matrix[3][1]"][K]), we = parseFloat(g["_pdbx_struct_oper_list_matrix[3][2]"][K]), ke = parseFloat(g["_pdbx_struct_oper_list_matrix[3][3]"][K]), Ue = parseFloat(g["_pdbx_struct_oper_list_vector[3]"][K]), Ne = new x.Matrix4(ne, me, se, fe, Ce, Me, Te, ae, pe, we, ke, Ue); + var q = parseFloat(g["_pdbx_struct_oper_list_matrix[1][1]"][K]), me = parseFloat(g["_pdbx_struct_oper_list_matrix[1][2]"][K]), ne = parseFloat(g["_pdbx_struct_oper_list_matrix[1][3]"][K]), fe = parseFloat(g["_pdbx_struct_oper_list_vector[1]"][K]), Ce = parseFloat(g["_pdbx_struct_oper_list_matrix[2][1]"][K]), Me = parseFloat(g["_pdbx_struct_oper_list_matrix[2][2]"][K]), Te = parseFloat(g["_pdbx_struct_oper_list_matrix[2][3]"][K]), se = parseFloat(g["_pdbx_struct_oper_list_vector[2]"][K]), pe = parseFloat(g["_pdbx_struct_oper_list_matrix[3][1]"][K]), we = parseFloat(g["_pdbx_struct_oper_list_matrix[3][2]"][K]), ke = parseFloat(g["_pdbx_struct_oper_list_matrix[3][3]"][K]), Ue = parseFloat(g["_pdbx_struct_oper_list_vector[3]"][K]), Ne = new y.Matrix4(q, me, ne, fe, Ce, Me, Te, se, pe, we, ke, Ue); b[b.length - 1].symmetries.push(Ne); } var Be = function(K) { - var q = K.match("-"); + var ee = K.match("-"); K = K.replace(/[-xyz]/g, ""); var de = K.split("/"), ve, Ie; - return de[1] === void 0 ? Ie = 1 : Ie = parseInt(de[1]), de[0] === "" ? ve = 1 : ve = parseInt(de[0]), ve / Ie * (q ? -1 : 1); + return de[1] === void 0 ? Ie = 1 : Ie = parseInt(de[1]), de[0] === "" ? ve = 1 : ve = parseInt(de[0]), ve / Ie * (ee ? -1 : 1); }; if (g._symmetry_equiv_pos_as_xyz !== void 0 && !C) for (var ue = 0; ue < g._symmetry_equiv_pos_as_xyz.length; ue++) { - var ye = g._symmetry_equiv_pos_as_xyz[ue].replace(/["' ]/g, ""), ge = ye.split(",").map(function(q) { - return q.replace(/-/g, "+-"); + var ye = g._symmetry_equiv_pos_as_xyz[ue].replace(/["' ]/g, ""), ge = ye.split(",").map(function(ee) { + return ee.replace(/-/g, "+-"); }); - let K = new x.Matrix4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); - for (let q = 0; q < 3; q++) { - var Se = ge[q].split("+"); + let K = new y.Matrix4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); + for (let ee = 0; ee < 3; ee++) { + var Se = ge[ee].split("+"); for (let de = 0; de < Se.length; de++) { var ze = Se[de]; if (ze !== "") { var He = Be(ze); - ze.match("x") ? K.elements[q + 0] = He : ze.match("y") ? K.elements[q + 4] = He : ze.match("z") ? K.elements[q + 8] = He : K.elements[q + 12] = He; + ze.match("x") ? K.elements[ee + 0] = He : ze.match("y") ? K.elements[ee + 4] = He : ze.match("z") ? K.elements[ee + 8] = He : K.elements[ee + 12] = He; } } } - var We = F.getMatrix4(), Y = new x.Matrix4().getInverse(We, !0); - K = new x.Matrix4().multiplyMatrices(K, Y), K = new x.Matrix4().multiplyMatrices(We, K), b[b.length - 1].symmetries.push(K); + var We = F.getMatrix4(), Y = new y.Matrix4().getInverse(We, !0); + K = new y.Matrix4().multiplyMatrices(K, Y), K = new y.Matrix4().multiplyMatrices(We, K), b[b.length - 1].symmetries.push(K); } } for (let K = 0; K < c.length; K++) - A && (0, s.assignBonds)(c[K]), (0, f.computeSecondaryStructure)(c[K], E.hbondCutoff), (0, _.processSymmetries)(b[K].symmetries, c[K], E, b[K].cryst), E.duplicateAssemblyAtoms && !E.dontConnectDuplicatedAtoms && A && (0, s.assignBonds)(c[K]); + A && (0, n.assignBonds)(c[K]), (0, f.computeSecondaryStructure)(c[K], E.hbondCutoff), (0, u.processSymmetries)(b[K].symmetries, c[K], E, b[K].cryst), E.duplicateAssemblyAtoms && !E.dontConnectDuplicatedAtoms && A && (0, n.assignBonds)(c[K]); return c; } } @@ -17590,47 +17590,47 @@ ATOM`, g); /* harmony export */ CUBE: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ../WebGL */ "./src/WebGL/index.ts" ), f = t( /*! ./utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" - ), _ = t( + ), u = t( /*! ./utils/anumToSymbol */ "./src/parsers/utils/anumToSymbol.ts" ); - function x(h, u) { - u = u || {}; - var E = [[]], c = h.split(/\r?\n/), C = u.assignBonds === void 0 ? !0 : u.assignBonds; + function y(h, _) { + _ = _ || {}; + var E = [[]], c = h.split(/\r?\n/), C = _.assignBonds === void 0 ? !0 : _.assignBonds; if (c.length < 6) return E; var b = c[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), A = Math.abs(parseFloat(b[0])); let S = {}; - var n = S.origin = new s.Vector3(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])); + var s = S.origin = new n.Vector3(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])); b = c[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), b = c[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); var o = b[0] > 0 ? 0.529177 : 1; - n.multiplyScalar(o); - var w = Math.abs(b[0]), p = new s.Vector3(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])).multiplyScalar(o); + s.multiplyScalar(o); + var w = Math.abs(b[0]), p = new n.Vector3(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])).multiplyScalar(o); b = c[4].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var v = Math.abs(b[0]), a = new s.Vector3(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])).multiplyScalar(o); + var v = Math.abs(b[0]), a = new n.Vector3(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])).multiplyScalar(o); b = c[5].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var l = Math.abs(b[0]), g = new s.Vector3(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])).multiplyScalar(o); - if (S.size = { x: w, y: v, z: l }, S.unit = new s.Vector3(p.x, a.y, g.z), p.y != 0 || p.z != 0 || a.x != 0 || a.z != 0 || g.x != 0 || g.y != 0) { - S.matrix4 = new s.Matrix4(p.x, a.x, g.x, 0, p.y, a.y, g.y, 0, p.z, a.z, g.z, 0, 0, 0, 0, 1); - let P = new s.Matrix4().makeTranslation(n.x, n.y, n.z); - S.matrix4 = S.matrix4.multiplyMatrices(P, S.matrix4), S.matrix = S.matrix4.matrix3FromTopLeft(), S.origin = new s.Vector3(0, 0, 0), S.unit = new s.Vector3(1, 1, 1); + var l = Math.abs(b[0]), g = new n.Vector3(parseFloat(b[1]), parseFloat(b[2]), parseFloat(b[3])).multiplyScalar(o); + if (S.size = { x: w, y: v, z: l }, S.unit = new n.Vector3(p.x, a.y, g.z), p.y != 0 || p.z != 0 || a.x != 0 || a.z != 0 || g.x != 0 || g.y != 0) { + S.matrix4 = new n.Matrix4(p.x, a.x, g.x, 0, p.y, a.y, g.y, 0, p.z, a.z, g.z, 0, 0, 0, 0, 1); + let P = new n.Matrix4().makeTranslation(s.x, s.y, s.z); + S.matrix4 = S.matrix4.multiplyMatrices(P, S.matrix4), S.matrix = S.matrix4.matrix3FromTopLeft(), S.origin = new n.Vector3(0, 0, 0), S.unit = new n.Vector3(1, 1, 1); } E.modelData = [{ cryst: S }], c = c.splice(6, A); for (var M = E[E.length - 1].length, L = M + c.length, T = M; T < L; ++T) { var D = {}; D.serial = T; - var R = c[T - M], B = R.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - D.elem = _.anumToSymbol[B[0]], D.x = parseFloat(B[2]) * o, D.y = parseFloat(B[3]) * o, D.z = parseFloat(B[4]) * o, D.hetflag = !0, D.bonds = [], D.bondOrder = [], D.properties = {}, E[E.length - 1].push(D); + var I = c[T - M], z = I.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); + D.elem = u.anumToSymbol[z[0]], D.x = parseFloat(z[2]) * o, D.y = parseFloat(z[3]) * o, D.z = parseFloat(z[4]) * o, D.hetflag = !0, D.bonds = [], D.bondOrder = [], D.properties = {}, E[E.length - 1].push(D); } if (C) for (let P = 0; P < E.length; P++) @@ -17650,40 +17650,40 @@ ATOM`, g); /* harmony export */ GRO: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ./utils/assignPDBBonds */ "./src/parsers/utils/assignPDBBonds.ts" ), f = t( /*! ./utils/atomNameToElem */ "./src/parsers/utils/atomNameToElem.ts" ); - function _(x) { - for (var h = [], u = x.split(/\r?\n|\r/); u.length > 0 && !(u.length < 3); ) { - var E = parseInt(u[1]); - if (isNaN(E) || E <= 0 || u.length < E + 3) + function u(y) { + for (var h = [], _ = y.split(/\r?\n|\r/); _.length > 0 && !(_.length < 3); ) { + var E = parseInt(_[1]); + if (isNaN(E) || E <= 0 || _.length < E + 3) break; var c = []; h.push(c); for (var C = 2, b = c.length, A = b + E, S = b; S < A; S++) { - var n = u[C++], o = {}; - o.serial = S, o.atom = n.slice(10, 15).trim(), o.elem = (0, f.atomNameToElem)(o.atom, !0), o.x = 10 * parseFloat(n.slice(20, 28)), o.y = 10 * parseFloat(n.slice(28, 36)), o.z = 10 * parseFloat(n.slice(36, 44)), o.resi = parseInt(n.slice(0, 5)), o.resn = n.slice(5, 10).trim(), o.bonds = [], o.bondOrder = [], o.properties = {}, n.length > 44 && (o.dx = 10 * parseFloat(n.slice(44, 52)), o.dy = 10 * parseFloat(n.slice(52, 60)), o.dz = 10 * parseFloat(n.slice(60, 68))), c[S] = o; + var s = _[C++], o = {}; + o.serial = S, o.atom = s.slice(10, 15).trim(), o.elem = (0, f.atomNameToElem)(o.atom, !0), o.x = 10 * parseFloat(s.slice(20, 28)), o.y = 10 * parseFloat(s.slice(28, 36)), o.z = 10 * parseFloat(s.slice(36, 44)), o.resi = parseInt(s.slice(0, 5)), o.resn = s.slice(5, 10).trim(), o.bonds = [], o.bondOrder = [], o.properties = {}, s.length > 44 && (o.dx = 10 * parseFloat(s.slice(44, 52)), o.dy = 10 * parseFloat(s.slice(52, 60)), o.dz = 10 * parseFloat(s.slice(60, 68))), c[S] = o; } - if (u.length <= C + 3) { - var w = u[C++], p = w.trim().split(/\s+/); + if (_.length <= C + 3) { + var w = _[C++], p = w.trim().split(/\s+/); if (p.length == 3) { for (var v = 0; v < 3; v++) p[v] = parseFloat(p[v]) * 10; h.box = p; } } - u.splice(0, ++C); + _.splice(0, ++C); } for (let a = 0; a < h.length; a++) - (0, s.assignPDBBonds)(h[a]); + (0, n.assignPDBBonds)(h[a]); return h; } } @@ -17703,12 +17703,12 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" ); - function f(_, x) { - for (var h = [], u = { + function f(u, y) { + for (var h = [], _ = { id: "serial", type: "atom", element: "elem", @@ -17726,7 +17726,7 @@ ATOM`, g); zu: "z", zs: "z", zsu: "z" - }, E = _.split(/\r?\n|\r/), c = 0, C = 0, b = 0; b < E.length - 9; ) { + }, E = u.split(/\r?\n|\r/), c = 0, C = 0, b = 0; b < E.length - 9; ) { for (var A = b; A < E.length; A++) if (E[A].match(/ITEM: NUMBER OF ATOMS/) && (C = parseInt(E[A + 1])), E[A].match(/ITEM: ATOMS/)) { c = A + 1; @@ -17735,17 +17735,17 @@ ATOM`, g); var S = E[c - 1].replace("ITEM: ATOMS ", "").split(" "); h.push([]); for (let l = c; l < c + C; l++) { - for (var n = {}, o = {}, w = E[l].split(" "), p = 0; p < w.length; p++) { - var v = u[S[p]]; - v != null && (v == "serial" ? n[v] = parseInt(w[p]) : v == "x" || v == "y" || v === "z" ? n[v] = parseFloat(w[p]) : v == "charge" || v == "radius" ? o[v] = parseFloat(w[p]) : n[v] = w[p]), n.properties = o, n.bonds = [], n.bondOrder = []; + for (var s = {}, o = {}, w = E[l].split(" "), p = 0; p < w.length; p++) { + var v = _[S[p]]; + v != null && (v == "serial" ? s[v] = parseInt(w[p]) : v == "x" || v == "y" || v === "z" ? s[v] = parseFloat(w[p]) : v == "charge" || v == "radius" ? o[v] = parseFloat(w[p]) : s[v] = w[p]), s.properties = o, s.bonds = [], s.bondOrder = []; } - h[h.length - 1][l - c] = n; + h[h.length - 1][l - c] = s; } b = c + C - 1; } - if (x.assignBonds) + if (y.assignBonds) for (var a = 0; a < h.length; a++) - (0, s.assignBonds)(h[a]); + (0, n.assignBonds)(h[a]); return h; } } @@ -17765,22 +17765,22 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../utilities */ "./src/utilities.ts" ), f = t( /*! ../WebGL */ "./src/WebGL/index.ts" - ), _ = t( + ), u = t( /*! ./utils/computeSecondaryStructure */ "./src/parsers/utils/computeSecondaryStructure.ts" - ), x = t( + ), y = t( /*! ./utils/processSymmetries */ "./src/parsers/utils/processSymmetries.ts" ), h = t( /*! ./src/vendor/mmtf.js */ "./src/vendor/mmtf.js" - ), u = function(b) { + ), _ = function(b) { return String.fromCharCode.apply(null, b).replace(/\0/g, ""); }, E = function(b) { return b == 0 || b == 2 || b == 4 ? "h" : b == 3 ? "s" : "c"; @@ -17798,39 +17798,39 @@ ATOM`, g); "SACCHARIDE" ]); function C(b, A) { - var S = !A.keepH, n = A.altLoc ? A.altLoc : "A", o = !!A.noSecondaryStructure, w = !A.noComputeSecondaryStructure, p = !A.doAssembly, v = A.assemblyIndex ? A.assemblyIndex : 0; - typeof b == "string" ? b = (0, s.base64ToArray)(b) : b = new Uint8Array(b); - var a = h.decode(b), l = [[]], g = l.modelData = [], M = 0, L = 0, T = 0, D = a.secStructList, R = a.bFactorList, B = a.altLocList, P = a.occupancyList, z = a.bondAtomList, F = a.bondOrderList, N = a.numModels; + var S = !A.keepH, s = A.altLoc ? A.altLoc : "A", o = !!A.noSecondaryStructure, w = !A.noComputeSecondaryStructure, p = !A.doAssembly, v = A.assemblyIndex ? A.assemblyIndex : 0; + typeof b == "string" ? b = (0, n.base64ToArray)(b) : b = new Uint8Array(b); + var a = h.decode(b), l = [[]], g = l.modelData = [], M = 0, L = 0, T = 0, D = a.secStructList, I = a.bFactorList, z = a.altLocList, P = a.occupancyList, B = a.bondAtomList, F = a.bondOrderList, N = a.numModels; if (N == 0) return l; A.multimodel || (N = 1); var $, k, G, H, U, V, Q = []; if (!p && a.bioAssemblyList && a.bioAssemblyList.length > 0) { - var oe = a.bioAssemblyList[v].transformList; - for ($ = 0, V = oe.length; $ < V; $++) { - var ee = new f.Matrix4(oe[$].matrix); - ee.transpose(), Q.push(ee); + var ae = a.bioAssemblyList[v].transformList; + for ($ = 0, V = ae.length; $ < V; $++) { + var oe = new f.Matrix4(ae[$].matrix); + oe.transpose(), Q.push(oe); } } - var ne = null; + var q = null; if (a.unitCell) { var me = a.unitCell; - ne = { a: me[0], b: me[1], c: me[2], alpha: me[3], beta: me[4], gamma: me[5] }; + q = { a: me[0], b: me[1], c: me[2], alpha: me[3], beta: me[4], gamma: me[5] }; } - let se = []; + let ne = []; a.entityList.forEach((Ee) => { Ee.chainIndexList.forEach((X) => { - se[X] = Ee.type == "polymer"; + ne[X] = Ee.type == "polymer"; }); }); var fe = 0; for (U = 0; U < N; U++) { var Ce = a.chainsPerModel[U], Me = l[l.length - 1], Te = []; - for (g.push({ symmetries: Q, cryst: ne }), $ = 0; $ < Ce; ++$) { - var ae = a.groupsPerChain[M], pe = u(a.chainIdList.subarray(M * 4, M * 4 + 4)); - a.chainNameList && (pe = u(a.chainNameList.subarray(M * 4, M * 4 + 4))); + for (g.push({ symmetries: Q, cryst: q }), $ = 0; $ < Ce; ++$) { + var se = a.groupsPerChain[M], pe = _(a.chainIdList.subarray(M * 4, M * 4 + 4)); + a.chainNameList && (pe = _(a.chainNameList.subarray(M * 4, M * 4 + 4))); var we = L, ke = ""; - for (k = 0; k < ae; ++k) { + for (k = 0; k < se; ++k) { var Ue = a.groupList[a.groupTypeList[L]], Ne = Ue.atomNameList.length, Be = 0, ue = !1, ye = !1; if (D) { Be = D[L]; @@ -17842,7 +17842,7 @@ ATOM`, g); var ze = a.groupIdList[L], He = Ue.groupName; let Ee = Ue.chemCompType; var We = T; - let X = c.has(Ee) || !se[M]; + let X = c.has(Ee) || !ne[M]; for (G = 0; G < Ne; ++G) { var Y = Ue.elementList[G]; if (S && Y == "H") { @@ -17850,11 +17850,11 @@ ATOM`, g); continue; } var K = ""; - R && (K = R[T]); - var q = ""; - B && B[T] && (q = String.fromCharCode(B[T])); + I && (K = I[T]); + var ee = ""; + z && z[T] && (ee = String.fromCharCode(z[T])); var de = ""; - if (P && (de = P[T]), q != "" && q != n && n != "*") { + if (P && (de = P[T]), ee != "" && ee != s && s != "*") { T += 1; continue; } @@ -17870,13 +17870,13 @@ ATOM`, g); hetflag: X, chain: pe, resi: ze, - icode: q, - rescode: ze + (q != " " ? "^" + q : ""), + icode: ee, + rescode: ze + (ee != " " ? "^" + ee : ""), // resi // and // icode serial: ve, - altLoc: q, + altLoc: ee, index: T, atom: Ie, bonds: [], @@ -17890,18 +17890,18 @@ ATOM`, g); } var Fe = Ue.bondAtomList; for (G = 0, H = Ue.bondOrderList.length; G < H; ++G) { - var he = We + Fe[G * 2], Oe = We + Fe[G * 2 + 1], j = Ue.bondOrderList[G], $e = Te[he], Ve = Te[Oe], I = Me[$e], be = Me[Ve]; - I && be && (I.bonds.push(Ve), I.bondOrder.push(j), be.bonds.push($e), be.bondOrder.push(j)); + var he = We + Fe[G * 2], Oe = We + Fe[G * 2 + 1], j = Ue.bondOrderList[G], $e = Te[he], Ve = Te[Oe], R = Me[$e], be = Me[Ve]; + R && be && (R.bonds.push(Ve), R.bondOrder.push(j), be.bonds.push($e), be.bondOrder.push(j)); } L += 1; } - for (L = we, k = 0; k < ae; ++k) + for (L = we, k = 0; k < se; ++k) L += 1; M += 1; } - if (z) - for (let Ee = fe, X = z.length; Ee < X; Ee += 2) { - let le = z[Ee], Le = z[Ee + 1], Ze = F ? F[Ee / 2] : 1; + if (B) + for (let Ee = fe, X = B.length; Ee < X; Ee += 2) { + let le = B[Ee], Le = B[Ee + 1], Ze = F ? F[Ee / 2] : 1; if (le >= T) { fe = Ee; break; @@ -17913,8 +17913,8 @@ ATOM`, g); } if (!p) for (let Ee = 0; Ee < l.length; Ee++) - (0, x.processSymmetries)(g[Ee].symmetries, l[Ee], A, g[Ee].cryst); - return w && !o && (0, _.computeSecondaryStructure)(l, A.hbondCutoff), l; + (0, y.processSymmetries)(g[Ee].symmetries, l[Ee], A, g[Ee].cryst); + return w && !o && (0, u.computeSecondaryStructure)(l, A.hbondCutoff), l; } } ), @@ -17933,7 +17933,7 @@ ATOM`, g); ) /* harmony export */ }); - let s = { + let n = { "C.1": "C", C1: "C", "C.2": "C", @@ -17983,15 +17983,15 @@ ATOM`, g); "S.o2": "S", So2: "S" }; - function f(_, x) { - var h = [[]], u = !1; - typeof x.keepH < "u" && (u = !x.keepH); - var E = _.search(/@MOLECULE/), c = _.search(/@ATOM/); + function f(u, y) { + var h = [[]], _ = !1; + typeof y.keepH < "u" && (_ = !y.keepH); + var E = u.search(/@MOLECULE/), c = u.search(/@ATOM/); if (E == -1 || c == -1) return h; - for (var C = _.substring(E).split(/\r?\n|\r/); C.length > 0; ) { - var b = [], A = C[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), S = parseInt(A[0]), n = 0; - A.length > 1 && (n = parseInt(A[1])); + for (var C = u.substring(E).split(/\r?\n|\r/); C.length > 0; ) { + var b = [], A = C[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), S = parseInt(A[0]), s = 0; + A.length > 1 && (s = parseInt(A[1])); var o = 4, w; for (w = 3; w < C.length; w++) if (C[w] == "@ATOM") { @@ -18002,7 +18002,7 @@ ATOM`, g); for (w = p; w < v; w++) { a = C[o++], A = a.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); var l = {}, g = A[5]; - if (s[g] !== void 0 ? g = s[g] : (g = g.split(".")[0], g = g[0].toUpperCase() + g.substring(1).toLowerCase()), l.atom = A[1], l.elem = g, !(l.elem == "H" && u)) { + if (n[g] !== void 0 ? g = n[g] : (g = g.split(".")[0], g = g[0].toUpperCase() + g.substring(1).toLowerCase()), l.atom = A[1], l.elem = g, !(l.elem == "H" && _)) { var M = h[h.length - 1].length, L = parseInt(A[0]); l.serial = L, l.x = parseFloat(A[2]), l.y = parseFloat(A[3]), l.z = parseFloat(A[4]), l.atom = A[5]; var T = parseFloat(A[8]); @@ -18017,14 +18017,14 @@ ATOM`, g); D = !0; break; } - if (D && n) - for (w = 0; w < n; w++) { + if (D && s) + for (w = 0; w < s; w++) { a = C[o++], A = a.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "); - var R = parseInt(A[1]), B = h[h.length - 1][b[R]], P = parseInt(A[2]), z = h[h.length - 1][b[P]], F = parseInt(A[3]); - isNaN(F) && (F = 1), B !== void 0 && z !== void 0 && (B.bonds.push(b[P]), B.bondOrder.push(F), z.bonds.push(b[R]), z.bondOrder.push(F)); + var I = parseInt(A[1]), z = h[h.length - 1][b[I]], P = parseInt(A[2]), B = h[h.length - 1][b[P]], F = parseInt(A[3]); + isNaN(F) && (F = 1), z !== void 0 && B !== void 0 && (z.bonds.push(b[P]), z.bondOrder.push(F), B.bonds.push(b[I]), B.bondOrder.push(F)); } - if (x.multimodel) { - x.onemol || h.push([]), C.splice(0, o), _ = C.join(` + if (y.multimodel) { + y.onemol || h.push([]), C.splice(0, o), u = C.join(` `); continue; } else @@ -18049,28 +18049,28 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./utils/getSinglePDB */ "./src/parsers/utils/getSinglePDB.ts" ); - function f(_, x) { - x = x || {}; - var h = [], u = {}; + function f(u, y) { + y = y || {}; + var h = [], _ = {}; h.modelData = []; - for (var E = _.split(/\r?\n|\r/); E.length > 0; ) { - var c = (0, s.getSinglePDB)(E, x, u), C = c[0], b = c[1]; + for (var E = u.split(/\r?\n|\r/); E.length > 0; ) { + var c = (0, n.getSinglePDB)(E, y, _), C = c[0], b = c[1]; if (E = c[2], C.length != 0) { - if (x.multimodel && x.onemol && h.length > 0) + if (y.multimodel && y.onemol && h.length > 0) for (var A = h[0].length, S = 0; S < C.length; S++) { - var n = C[S]; - n.index = S; - for (var o = 0; o < n.bonds.length; o++) - n.bonds[o] += A; - h[0].push(n); + var s = C[S]; + s.index = S; + for (var o = 0; o < s.bonds.length; o++) + s.bonds[o] += A; + h[0].push(s); } else h.modelData.push(b), h.push(C); - if (!x.multimodel) + if (!y.multimodel) break; } } @@ -18089,45 +18089,45 @@ ATOM`, g); /* harmony export */ PQR: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ./utils/assignPDBBonds */ "./src/parsers/utils/assignPDBBonds.ts" ), f = t( /*! ./utils/computeSecondaryStructure */ "./src/parsers/utils/computeSecondaryStructure.ts" ); - function _(x, h) { - var u = [[]], E = !h.noSecondaryStructure; - u.modelData = [{ symmetries: [] }]; - var c = [], C = x.split(/\r?\n|\r/), b; + function u(y, h) { + var _ = [[]], E = !h.noSecondaryStructure; + _.modelData = [{ symmetries: [] }]; + var c = [], C = y.split(/\r?\n|\r/), b; for (let D = 0; D < C.length; D++) { b = C[D].replace(/^\s*/, ""); var A = b.substring(0, 6); if (A.indexOf("END") == 0) if (h.multimodel) { - h.onemol || u.push([]); + h.onemol || _.push([]); continue; } else break; else if (A == "ATOM " || A == "HETATM") { var S; - let R = parseInt(b.substring(6, 11)), B = b.substring(12, 16).replace(/ /g, ""), P = b.substring(17, 20).trim(), z = b.substring(21, 22), F = parseInt(b.substring(22, 26)); - var n = b.substring(30).trim().split(/\s+/), o = parseFloat(n[0]), w = parseFloat(n[1]), p = parseFloat(n[2]), v = parseFloat(n[3]), a = parseFloat(n[4]), l = B[0]; - B.length > 1 && B[1].toUpperCase() != B[1] && (l = B.substring(0, 2)), b[0] == "H" ? S = !0 : S = !1, c[R] = u[u.length - 1].length, u[u.length - 1].push({ + let I = parseInt(b.substring(6, 11)), z = b.substring(12, 16).replace(/ /g, ""), P = b.substring(17, 20).trim(), B = b.substring(21, 22), F = parseInt(b.substring(22, 26)); + var s = b.substring(30).trim().split(/\s+/), o = parseFloat(s[0]), w = parseFloat(s[1]), p = parseFloat(s[2]), v = parseFloat(s[3]), a = parseFloat(s[4]), l = z[0]; + z.length > 1 && z[1].toUpperCase() != z[1] && (l = z.substring(0, 2)), b[0] == "H" ? S = !0 : S = !1, c[I] = _[_.length - 1].length, _[_.length - 1].push({ resn: P, x: o, y: w, z: p, elem: l, hetflag: S, - chain: z, + chain: B, resi: F, - serial: R, - atom: B, + serial: I, + atom: z, bonds: [], ss: "c", bondOrder: [], @@ -18139,16 +18139,16 @@ ATOM`, g); pdbline: b }); } else if (A == "CONECT") { - var g = parseInt(b.substring(6, 11)), M = u[u.length - 1][c[g]]; - for (let R = 0; R < 4; R++) { - var L = parseInt(b.substring([11, 16, 21, 26][R], [11, 16, 21, 26][R] + 5)), T = u[u.length - 1][c[L]]; + var g = parseInt(b.substring(6, 11)), M = _[_.length - 1][c[g]]; + for (let I = 0; I < 4; I++) { + var L = parseInt(b.substring([11, 16, 21, 26][I], [11, 16, 21, 26][I] + 5)), T = _[_.length - 1][c[L]]; M !== void 0 && T !== void 0 && (M.bonds.push(c[L]), M.bondOrder.push(1)); } } } - for (let D = 0; D < u.length; D++) - (0, s.assignPDBBonds)(u[D]), E && (0, f.computeSecondaryStructure)(u[D], h.hbondCutoff); - return u; + for (let D = 0; D < _.length; D++) + (0, n.assignPDBBonds)(_[D]), E && (0, f.computeSecondaryStructure)(_[D], h.hbondCutoff); + return _; } } ), @@ -18163,83 +18163,83 @@ ATOM`, g); /* harmony export */ PRMTOP: () => ( /* binding */ - s + n ) /* harmony export */ }); - function s(f) { - var _ = [], x, h = 0, u = f.split(/\r?\n|\r/); - if (u.length > 0 && u[0].includes("VERSION")) { - var E = u.filter(function(o) { + function n(f) { + var u = [], y, h = 0, _ = f.split(/\r?\n|\r/); + if (_.length > 0 && _[0].includes("VERSION")) { + var E = _.filter(function(o) { return o.includes("POINTERS") || o.includes("ATOM_NAME") || o.includes("CHARGE") || o.includes("RADII") || o.includes("BONDS_INC_HYDROGEN") || o.includes("BONDS_WITHOUT_HYDROGEN"); }), c = S("POINTERS"); if (c == -1) return []; - var C = n(c), b = parseInt(u[c + 1].slice(0, C[1])); + var C = s(c), b = parseInt(_[c + 1].slice(0, C[1])); if (isNaN(b) || b <= 0) return []; if (c = S("ATOM_NAME"), c == -1) return []; - C = n(c); + C = s(c); var A = C[0]; for (let o = 0; o < b / C[0]; o++) { o == parseInt(b / C[0]) && (A = b % C[0]); for (let w = 0; w < A; w++) { let p = {}, v = { charge: "", radii: "" }; - p.serial = h, p.x = 0, p.y = 0, p.z = 0, p.atom = u[c + 1].slice(C[1] * w, C[1] * (w + 1)), p.elem = u[c + 1].slice(C[1] * w, C[1] * w + 1), p.properties = v, p.bonds = [], p.bondOrder = [], _.push(p), h++; + p.serial = h, p.x = 0, p.y = 0, p.z = 0, p.atom = _[c + 1].slice(C[1] * w, C[1] * (w + 1)), p.elem = _[c + 1].slice(C[1] * w, C[1] * w + 1), p.properties = v, p.bonds = [], p.bondOrder = [], u.push(p), h++; } c++; } if (c = S("CHARGE"), c != -1) { - C = n(c), h = 0, A = C[0]; + C = s(c), h = 0, A = C[0]; for (let o = 0; o < b / C[0]; o++) { o == parseInt(b / C[0]) && (A = b % C[0]); for (let w = 0; w < A; w++) - _[h].properties.charge = parseFloat(u[c + 1].slice(C[1] * w, C[1] * (w + 1))), h++; + u[h].properties.charge = parseFloat(_[c + 1].slice(C[1] * w, C[1] * (w + 1))), h++; c++; } } if (c = S("RADII"), c != -1) { - C = n(c), h = 0, A = C[0]; + C = s(c), h = 0, A = C[0]; for (let o = 0; o < b / C[0]; o++) { o == parseInt(b / C[0]) && (A = b % C[0]); for (let w = 0; w < A; w++) - _[h].properties.radii = parseFloat(u[c + 1].slice(C[1] * w, C[1] * (w + 1))), h++; + u[h].properties.radii = parseFloat(_[c + 1].slice(C[1] * w, C[1] * (w + 1))), h++; c++; } } if (c = S("BONDS_WITHOUT_HYDROGEN"), c != -1) - for (C = n(c), h = 0, A = C[0], c = c + 1; !u[c].match(/^%FLAG/); ) { - u[c + 1].match(/^%FLAG/) && (A = b % C[0]); + for (C = s(c), h = 0, A = C[0], c = c + 1; !_[c].match(/^%FLAG/); ) { + _[c + 1].match(/^%FLAG/) && (A = b % C[0]); for (let o = 0; o < A; o++) - h % 3 == 0 ? x = parseInt(u[c].slice(C[1] * o, C[1] * (o + 1)) / 3) : h % 3 == 1 && _[x].bonds.push(parseInt(u[c].slice(C[1] * o, C[1] * (o + 1)) / 3)), h++; + h % 3 == 0 ? y = parseInt(_[c].slice(C[1] * o, C[1] * (o + 1)) / 3) : h % 3 == 1 && u[y].bonds.push(parseInt(_[c].slice(C[1] * o, C[1] * (o + 1)) / 3)), h++; c++; } if (c = S("BONDS_INC_HYDROGEN"), c != -1) - for (C = n(c), h = 0, A = C[0], c = c + 1; !u[c].match(/^%FLAG/); ) { - u[c + 1].match(/^%FLAG/) && (A = b % C[0]); + for (C = s(c), h = 0, A = C[0], c = c + 1; !_[c].match(/^%FLAG/); ) { + _[c + 1].match(/^%FLAG/) && (A = b % C[0]); for (let o = 0; o < A; o++) - h % 3 == 0 ? x = parseInt(u[c].slice(C[1] * o, C[1] * (o + 1)) / 3) : h % 3 == 1 && _[x].bonds.push(parseInt(u[c].slice(C[1] * o, C[1] * (o + 1)) / 3)), h++; + h % 3 == 0 ? y = parseInt(_[c].slice(C[1] * o, C[1] * (o + 1)) / 3) : h % 3 == 1 && u[y].bonds.push(parseInt(_[c].slice(C[1] * o, C[1] * (o + 1)) / 3)), h++; c++; } } else return []; function S(o) { - var w = u.indexOf(E.filter(function(p) { + var w = _.indexOf(E.filter(function(p) { return p.includes(o); })[0]); if (Number.isInteger(w) && w > 0) { - for (; !u[w].includes("FORMAT"); ) + for (; !_[w].includes("FORMAT"); ) w++; return w; } else return -1; } - function n(o) { - var w = u[o].match(/\((\d*)\S*/), p = u[o].match(/[a-zA-Z](\d*)\)\s*/); - return p == null && (p = u[o].match(/[a-zA-Z](\d*)\.\d*\)\s*/)), [w[1], p[1]]; + function s(o) { + var w = _[o].match(/\((\d*)\S*/), p = _[o].match(/[a-zA-Z](\d*)\)\s*/); + return p == null && (p = _[o].match(/[a-zA-Z](\d*)\.\d*\)\s*/)), [w[1], p[1]]; } - return [_]; + return [u]; } } ), @@ -18254,87 +18254,87 @@ ATOM`, g); /* harmony export */ SDF: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = function(x, h) { - var u = [[]], E = !1; - for (typeof h.keepH < "u" && (E = !h.keepH); x.length > 0 && !(x.length < 4); ) { - var c = parseInt(x[3].substring(0, 3)); + var n = function(y, h) { + var _ = [[]], E = !1; + for (typeof h.keepH < "u" && (E = !h.keepH); y.length > 0 && !(y.length < 4); ) { + var c = parseInt(y[3].substring(0, 3)); if (isNaN(c) || c <= 0) break; - var C = parseInt(x[3].substring(3, 6)), b = 4; - if (x.length < 4 + c + C) + var C = parseInt(y[3].substring(3, 6)), b = 4; + if (y.length < 4 + c + C) break; - var A = [], S = u[u.length - 1].length, n = S + c, o, w; - for (o = S; o < n; o++, b++) { - w = x[b]; + var A = [], S = _[_.length - 1].length, s = S + c, o, w; + for (o = S; o < s; o++, b++) { + w = y[b]; var p = {}, v = w.substring(31, 34).replace(/ /g, ""); - p.atom = p.elem = v[0].toUpperCase() + v.substring(1).toLowerCase(), (p.elem !== "H" || !E) && (p.serial = o, A[o] = u[u.length - 1].length, p.x = parseFloat(w.substring(0, 10)), p.y = parseFloat(w.substring(10, 20)), p.z = parseFloat(w.substring(20, 30)), p.hetflag = !0, p.bonds = [], p.bondOrder = [], p.properties = {}, p.index = u[u.length - 1].length, u[u.length - 1].push(p)); + p.atom = p.elem = v[0].toUpperCase() + v.substring(1).toLowerCase(), (p.elem !== "H" || !E) && (p.serial = o, A[o] = _[_.length - 1].length, p.x = parseFloat(w.substring(0, 10)), p.y = parseFloat(w.substring(10, 20)), p.z = parseFloat(w.substring(20, 30)), p.hetflag = !0, p.bonds = [], p.bondOrder = [], p.properties = {}, p.index = _[_.length - 1].length, _[_.length - 1].push(p)); } for (o = 0; o < C; o++, b++) { - w = x[b]; + w = y[b]; var a = A[parseInt(w.substring(0, 3)) - 1 + S], l = A[parseInt(w.substring(3, 6)) - 1 + S], g = parseFloat(w.substring(6)); - typeof a < "u" && typeof l < "u" && (u[u.length - 1][a].bonds.push(l), u[u.length - 1][a].bondOrder.push(g), u[u.length - 1][l].bonds.push(a), u[u.length - 1][l].bondOrder.push(g)); + typeof a < "u" && typeof l < "u" && (_[_.length - 1][a].bonds.push(l), _[_.length - 1][a].bondOrder.push(g), _[_.length - 1][l].bonds.push(a), _[_.length - 1][l].bondOrder.push(g)); } if (h.multimodel) { - for (h.onemol || u.push([]); x[b] !== "$$$$" && b < x.length; ) + for (h.onemol || _.push([]); y[b] !== "$$$$" && b < y.length; ) b++; - x.splice(0, ++b); + y.splice(0, ++b); } else break; } - return u; - }, f = function(x, h) { - var u = [[]], E = !1; - for (typeof h.keepH < "u" && (E = !h.keepH); x.length > 0 && !(x.length < 8 || !x[4].startsWith("M V30 BEGIN CTAB") || !x[5].startsWith("M V30 COUNTS") || x[5].length < 14); ) { - var c = x[5].substring(13).match(/\S+/g); + return _; + }, f = function(y, h) { + var _ = [[]], E = !1; + for (typeof h.keepH < "u" && (E = !h.keepH); y.length > 0 && !(y.length < 8 || !y[4].startsWith("M V30 BEGIN CTAB") || !y[5].startsWith("M V30 COUNTS") || y[5].length < 14); ) { + var c = y[5].substring(13).match(/\S+/g); if (c.length < 2) break; var C = parseInt(c[0]); if (isNaN(C) || C <= 0) break; var b = parseInt(c[1]), A = 7; - if (x.length < 8 + C + b) + if (y.length < 8 + C + b) break; - var S = [], n = u[u.length - 1].length, o = n + C, w, p; - for (w = n; w < o; w++, A++) { - p = x[A]; + var S = [], s = _[_.length - 1].length, o = s + C, w, p; + for (w = s; w < o; w++, A++) { + p = y[A]; var v = p.substring(6).match(/\S+/g); if (v.length > 4) { var a = {}, l = v[1].replace(/ /g, ""); - a.atom = a.elem = l[0].toUpperCase() + l.substring(1).toLowerCase(), (a.elem !== "H" || !E) && (a.serial = w, S[w] = u[u.length - 1].length, a.x = parseFloat(v[2]), a.y = parseFloat(v[3]), a.z = parseFloat(v[4]), a.hetflag = !0, a.bonds = [], a.bondOrder = [], a.properties = {}, a.index = u[u.length - 1].length, u[u.length - 1].push(a)); + a.atom = a.elem = l[0].toUpperCase() + l.substring(1).toLowerCase(), (a.elem !== "H" || !E) && (a.serial = w, S[w] = _[_.length - 1].length, a.x = parseFloat(v[2]), a.y = parseFloat(v[3]), a.z = parseFloat(v[4]), a.hetflag = !0, a.bonds = [], a.bondOrder = [], a.properties = {}, a.index = _[_.length - 1].length, _[_.length - 1].push(a)); } } - if (x[A] === "M V30 END ATOM") + if (y[A] === "M V30 END ATOM") A++; else break; - if (b !== 0 && x[A] === "M V30 BEGIN BOND") + if (b !== 0 && y[A] === "M V30 BEGIN BOND") A++; else break; for (w = 0; w < b; w++, A++) { - p = x[A]; + p = y[A]; var g = p.substring(6).match(/\S+/g); if (g.length > 3) { - var M = S[parseInt(g[2]) - 1 + n], L = S[parseInt(g[3]) - 1 + n], T = parseFloat(g[1]); - typeof M < "u" && typeof L < "u" && (u[u.length - 1][M].bonds.push(L), u[u.length - 1][M].bondOrder.push(T), u[u.length - 1][L].bonds.push(M), u[u.length - 1][L].bondOrder.push(T)); + var M = S[parseInt(g[2]) - 1 + s], L = S[parseInt(g[3]) - 1 + s], T = parseFloat(g[1]); + typeof M < "u" && typeof L < "u" && (_[_.length - 1][M].bonds.push(L), _[_.length - 1][M].bondOrder.push(T), _[_.length - 1][L].bonds.push(M), _[_.length - 1][L].bondOrder.push(T)); } } if (h.multimodel) { - for (h.onemol || u.push([]); x[A] !== "$$$$" && A < x.length; ) + for (h.onemol || _.push([]); y[A] !== "$$$$" && A < y.length; ) A++; - x.splice(0, ++A); + y.splice(0, ++A); } else break; } - return u; + return _; }; - function _(x, h) { - var u = "V2000", E = x.split(/\r?\n|\r/); - return E.length > 3 && E[3].length > 38 && (u = E[3].substring(34, 39)), u === "V2000" ? s(E, h) : u === "V3000" ? f(E, h) : [[""]]; + function u(y, h) { + var _ = "V2000", E = y.split(/\r?\n|\r/); + return E.length > 3 && E[3].length > 38 && (_ = E[3].substring(34, 39)), _ === "V2000" ? n(E, h) : _ === "V3000" ? f(E, h) : [[""]]; } } ), @@ -18353,41 +18353,41 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../WebGL */ "./src/WebGL/index.ts" ); - function f(_) { - var x = [[]], h = {}, u = _.replace(/^\s+/, "").split(/\r?\n/); - if (u.length < 3) - return x; - if (u[1].match(/\d+/)) - h.length = parseFloat(u[1]); + function f(u) { + var y = [[]], h = {}, _ = u.replace(/^\s+/, "").split(/\r?\n/); + if (_.length < 3) + return y; + if (_[1].match(/\d+/)) + h.length = parseFloat(_[1]); else - return console.log("Warning: second line of the vasp structure file must be a number"), x; + return console.log("Warning: second line of the vasp structure file must be a number"), y; if (h.length < 0) - return console.log("Warning: Vasp implementation for negative lattice lengths is not yet available"), x; - h.xVec = new Float32Array(u[2].replace(/^\s+/, "").split(/\s+/)), h.yVec = new Float32Array(u[3].replace(/^\s+/, "").split(/\s+/)), h.zVec = new Float32Array(u[4].replace(/^\s+/, "").split(/\s+/)); - var E = new s.Matrix3(h.xVec[0], h.xVec[1], h.xVec[2], h.yVec[0], h.yVec[1], h.yVec[2], h.zVec[0], h.zVec[1], h.zVec[2]); - E.multiplyScalar(h.length), x.modelData = [{ symmetries: [], cryst: { matrix: E } }]; - var c = u[5].replace(/\s+/, "").replace(/\s+$/, "").split(/\s+/), C = new Int16Array(u[6].replace(/^\s+/, "").split(/\s+/)), b = u[7].replace(/\s+/, ""); + return console.log("Warning: Vasp implementation for negative lattice lengths is not yet available"), y; + h.xVec = new Float32Array(_[2].replace(/^\s+/, "").split(/\s+/)), h.yVec = new Float32Array(_[3].replace(/^\s+/, "").split(/\s+/)), h.zVec = new Float32Array(_[4].replace(/^\s+/, "").split(/\s+/)); + var E = new n.Matrix3(h.xVec[0], h.xVec[1], h.xVec[2], h.yVec[0], h.yVec[1], h.yVec[2], h.zVec[0], h.zVec[1], h.zVec[2]); + E.multiplyScalar(h.length), y.modelData = [{ symmetries: [], cryst: { matrix: E } }]; + var c = _[5].replace(/\s+/, "").replace(/\s+$/, "").split(/\s+/), C = new Int16Array(_[6].replace(/^\s+/, "").split(/\s+/)), b = _[7].replace(/\s+/, ""); if (b.match(/C/)) b = "cartesian"; else if (b.match(/D/)) b = "direct"; else - return console.log("Warning: Unknown vasp mode in POSCAR file: mode must be either C(artesian) or D(irect)"), x; + return console.log("Warning: Unknown vasp mode in POSCAR file: mode must be either C(artesian) or D(irect)"), y; if (c.length != C.length) - return console.log("Warning: declaration of atomary species wrong:"), console.log(c), console.log(C), x; - u.splice(0, 8); - for (var A = 0, S = 0, n = c.length; S < n; S++) { + return console.log("Warning: declaration of atomary species wrong:"), console.log(c), console.log(C), y; + _.splice(0, 8); + for (var A = 0, S = 0, s = c.length; S < s; S++) { for (var o = c[S], w = 0, p = C[S]; w < p; w++) { - var v = new Float32Array(u[A + w].replace(/^\s+/, "").split(/\s+/)), a = {}; - a.elem = o, b == "cartesian" ? (a.x = h.length * v[0], a.y = h.length * v[1], a.z = h.length * v[2]) : (a.x = h.length * (v[0] * h.xVec[0] + v[1] * h.yVec[0] + v[2] * h.zVec[0]), a.y = h.length * (v[0] * h.xVec[1] + v[1] * h.yVec[1] + v[2] * h.zVec[1]), a.z = h.length * (v[0] * h.xVec[2] + v[1] * h.yVec[2] + v[2] * h.zVec[2])), a.bonds = [], x[0].push(a); + var v = new Float32Array(_[A + w].replace(/^\s+/, "").split(/\s+/)), a = {}; + a.elem = o, b == "cartesian" ? (a.x = h.length * v[0], a.y = h.length * v[1], a.z = h.length * v[2]) : (a.x = h.length * (v[0] * h.xVec[0] + v[1] * h.yVec[0] + v[2] * h.zVec[0]), a.y = h.length * (v[0] * h.xVec[1] + v[1] * h.yVec[1] + v[2] * h.zVec[1]), a.z = h.length * (v[0] * h.xVec[2] + v[1] * h.yVec[2] + v[2] * h.zVec[2])), a.bonds = [], y[0].push(a); } A += C[S]; } - return x; + return y; } } ), @@ -18402,56 +18402,56 @@ ATOM`, g); /* harmony export */ XYZ: () => ( /* binding */ - _ + u ) /* harmony export */ }); - var s = t( + var n = t( /*! ../WebGL */ "./src/WebGL/index.ts" ), f = t( /*! ./utils/assignBonds */ "./src/parsers/utils/assignBonds.ts" ); - function _(x, h) { + function u(y, h) { h = h || {}; - for (var u = [[]], E = h.assignBonds === void 0 ? !0 : h.assignBonds, c = x.split(/\r?\n|\r/); c.length > 0 && !(c.length < 3); ) { + for (var _ = [[]], E = h.assignBonds === void 0 ? !0 : h.assignBonds, c = y.split(/\r?\n|\r/); c.length > 0 && !(c.length < 3); ) { var C = parseInt(c[0]); if (isNaN(C) || C <= 0 || c.length < C + 2) break; var b = /Lattice\s*=\s*["\{\}]([^"\{\}]+)["\{\}]\s*/gi, A = b.exec(c[1]); if (A != null && A.length > 1) { - var S = new Float32Array(A[1].split(/\s+/)), n = new s.Matrix3(S[0], S[3], S[6], S[1], S[4], S[7], S[2], S[5], S[8]); - u.modelData = [{ cryst: { matrix: n } }]; + var S = new Float32Array(A[1].split(/\s+/)), s = new n.Matrix3(S[0], S[3], S[6], S[1], S[4], S[7], S[2], S[5], S[8]); + _.modelData = [{ cryst: { matrix: s } }]; } - for (var o = 2, w = u[u.length - 1].length, p = w + C, v = w; v < p; v++) { + for (var o = 2, w = _[_.length - 1].length, p = w + C, v = w; v < p; v++) { var a = c[o++], l = a.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), g = {}; g.serial = v; var M = l[0]; - g.atom = g.elem = M[0].toUpperCase() + M.substring(1, 2).toLowerCase(), g.x = parseFloat(l[1]), g.y = parseFloat(l[2]), g.z = parseFloat(l[3]), g.hetflag = !0, g.bonds = [], g.bondOrder = [], g.properties = {}, u[u.length - 1][v] = g, l.length >= 7 && (g.dx = parseFloat(l[4]), g.dy = parseFloat(l[5]), g.dz = parseFloat(l[6])); + g.atom = g.elem = M[0].toUpperCase() + M.substring(1, 2).toLowerCase(), g.x = parseFloat(l[1]), g.y = parseFloat(l[2]), g.z = parseFloat(l[3]), g.hetflag = !0, g.bonds = [], g.bondOrder = [], g.properties = {}, _[_.length - 1][v] = g, l.length >= 7 && (g.dx = parseFloat(l[4]), g.dy = parseFloat(l[5]), g.dz = parseFloat(l[6])); } if (h.multimodel) - u.push([]), c.splice(0, o); + _.push([]), c.splice(0, o); else break; } if (E) - for (let T = 0; T < u.length; T++) - (0, f.assignBonds)(u[T]); + for (let T = 0; T < _.length; T++) + (0, f.assignBonds)(_[T]); if (h.onemol) { - var L = u; - u = [], u.push(L[0]); + var L = _; + _ = [], _.push(L[0]); for (let T = 1; T < L.length; T++) { - let D = u[0].length; - for (let R = 0; R < L[T].length; R++) { - let B = L[T][R]; - for (let P = 0; P < B.bonds.length; P++) - B.bonds[P] = B.bonds[P] + D; - B.index = u[0].length, B.serial = u[0].length, u[0].push(B); + let D = _[0].length; + for (let I = 0; I < L[T].length; I++) { + let z = L[T][I]; + for (let P = 0; P < z.bonds.length; P++) + z.bonds[P] = z.bonds[P] + D; + z.index = _[0].length, z.serial = _[0].length, _[0].push(z); } } } - return u; + return _; } } ), @@ -18480,22 +18480,22 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./VASP */ "./src/parsers/VASP.ts" ), f = t( /*! ./CUBE */ "./src/parsers/CUBE.ts" - ), _ = t( + ), u = t( /*! ./XYZ */ "./src/parsers/XYZ.ts" - ), x = t( + ), y = t( /*! ./SDF */ "./src/parsers/SDF.ts" ), h = t( /*! ./CDJSON */ "./src/parsers/CDJSON.ts" - ), u = t( + ), _ = t( /*! ./CIF */ "./src/parsers/CIF.ts" ), E = t( @@ -18516,7 +18516,7 @@ ATOM`, g); ), S = t( /*! ./GRO */ "./src/parsers/GRO.ts" - ), n = t( + ), s = t( /*! ./LAMMPSTRJ */ "./src/parsers/LAMMPSTRJ.ts" ), o = t( @@ -18524,20 +18524,20 @@ ATOM`, g); "./src/parsers/utils/bondLength.ts" ); const w = { - vasp: s.VASP, - VASP: s.VASP, + vasp: n.VASP, + VASP: n.VASP, cube: f.CUBE, CUBE: f.CUBE, - xyz: _.XYZ, - XYZ: _.XYZ, - sdf: x.SDF, - SDF: x.SDF, + xyz: u.XYZ, + XYZ: u.XYZ, + sdf: y.SDF, + SDF: y.SDF, json: h.CDJSON, cdjson: h.CDJSON, CDJSON: h.CDJSON, - mcif: u.CIF, - cif: u.CIF, - CIF: u.CIF, + mcif: _.CIF, + cif: _.CIF, + CIF: _.CIF, mol2: E.MOL2, MOL2: E.MOL2, pdb: c.PDB, @@ -18552,8 +18552,8 @@ ATOM`, g); PRMTOP: A.PRMTOP, gro: S.GRO, GRO: S.GRO, - lammpstrj: n.LAMMPSTRJ, - LAMMPSTRJ: n.LAMMPSTRJ + lammpstrj: s.LAMMPSTRJ, + LAMMPSTRJ: s.LAMMPSTRJ }; } ), @@ -18568,11 +18568,11 @@ ATOM`, g); /* harmony export */ anumToSymbol: () => ( /* binding */ - s + n ) /* harmony export */ }); - const s = { + const n = { 1: "H", 2: "He", 3: "Li", @@ -18708,24 +18708,24 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./bondLength */ "./src/parsers/utils/bondLength.ts" ); - function f(_, x) { - var h = (0, s.bondLength)(_.elem) + (0, s.bondLength)(x.elem); + function f(u, y) { + var h = (0, n.bondLength)(u.elem) + (0, n.bondLength)(y.elem); h += 0.25, h *= h; - var u = _.x - x.x; - if (u *= u, u > h) + var _ = u.x - y.x; + if (_ *= _, _ > h) return !1; - var E = _.y - x.y; + var E = u.y - y.y; if (E *= E, E > h) return !1; - var c = _.z - x.z; + var c = u.z - y.z; if (c *= c, c > h) return !1; - var C = u + E + c; - return isNaN(C) || C < 0.5 || C > h ? !1 : !(_.altLoc != x.altLoc && _.altLoc != " " && x.altLoc != " "); + var C = _ + E + c; + return isNaN(C) || C < 0.5 || C > h ? !1 : !(u.altLoc != y.altLoc && u.altLoc != " " && y.altLoc != " "); } } ), @@ -18740,33 +18740,33 @@ ATOM`, g); /* harmony export */ assignBackboneHBonds: () => ( /* binding */ - s + n ) /* harmony export */ }); - function s(f, _) { - let x = _ || 3.2, h = x * x, u = []; + function n(f, u) { + let y = u || 3.2, h = y * y, _ = []; for (let o = 0, w = f.length; o < w; o++) { f[o].index = o; var E = f[o]; - !E.hetflag && (E.atom === "N" || E.atom === "O") && (u.push(E), E.hbondOther = null, E.hbondDistanceSq = Number.POSITIVE_INFINITY); + !E.hetflag && (E.atom === "N" || E.atom === "O") && (_.push(E), E.hbondOther = null, E.hbondDistanceSq = Number.POSITIVE_INFINITY); } - u.sort(function(o, w) { + _.sort(function(o, w) { return o.z - w.z; }); - for (let o = 0, w = u.length; o < w; o++) { - var c = u[o]; + for (let o = 0, w = _.length; o < w; o++) { + var c = _[o]; for (let p = o + 1; p < w; p++) { - var C = u[p], b = C.z - c.z; - if (b > x) + var C = _[p], b = C.z - c.z; + if (b > y) break; if (C.atom != c.atom) { var A = Math.abs(C.y - c.y); - if (!(A > x)) { + if (!(A > y)) { var S = Math.abs(C.x - c.x); - if (!(S > x)) { - var n = S * S + A * A + b * b; - n > h || C.chain == c.chain && Math.abs(C.resi - c.resi) < 4 || (n < c.hbondDistanceSq && (c.hbondOther = C, c.hbondDistanceSq = n), n < C.hbondDistanceSq && (C.hbondOther = c, C.hbondDistanceSq = n)); + if (!(S > y)) { + var s = S * S + A * A + b * b; + s > h || C.chain == c.chain && Math.abs(C.resi - c.resi) < 4 || (s < c.hbondDistanceSq && (c.hbondOther = C, c.hbondDistanceSq = s), s < C.hbondDistanceSq && (C.hbondOther = c, C.hbondDistanceSq = s)); } } } @@ -18790,22 +18790,22 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./areConnected */ "./src/parsers/utils/areConnected.ts" ); - function f(_) { - for (var x = 0, h = _.length; x < h; x++) - _[x].index || (_[x].index = x); - for (var u = {}, E = 4.95, c = 0; c < _.length; c++) { - var C = _[c], b = Math.floor(C.x / E), A = Math.floor(C.y / E), S = Math.floor(C.z / E); - u[b] || (u[b] = {}), u[b][A] || (u[b][A] = {}), u[b][A][S] || (u[b][A][S] = []), u[b][A][S].push(C); - } - var n = function(w, p) { + function f(u) { + for (var y = 0, h = u.length; y < h; y++) + u[y].index || (u[y].index = y); + for (var _ = {}, E = 4.95, c = 0; c < u.length; c++) { + var C = u[c], b = Math.floor(C.x / E), A = Math.floor(C.y / E), S = Math.floor(C.z / E); + _[b] || (_[b] = {}), _[b][A] || (_[b][A] = {}), _[b][A][S] || (_[b][A][S] = []), _[b][A][S].push(C); + } + var s = function(w, p) { for (var v = 0; v < w.length; v++) for (var a = w[v], l = 0; l < p.length; l++) { var g = p[l]; - if ((0, s.areConnected)(a, g)) { + if ((0, n.areConnected)(a, g)) { var M = a.bonds.indexOf(g.index), L = g.bonds.indexOf(a.index); M == -1 && L == -1 ? (a.bonds.push(g.index), a.bondOrder.push(1), g.bonds.push(a.index), g.bondOrder.push(1)) : M == -1 ? (a.bonds.push(g.index), a.bondOrder.push(g.bondOrder[L])) : L == -1 && (g.bonds.push(a.index), g.bondOrder.push(a.bondOrder[M])); } @@ -18825,25 +18825,25 @@ ATOM`, g); { x: 1, y: 1, z: 0 }, { x: 1, y: 1, z: 1 } ]; - for (let w in u) { + for (let w in _) { let p = parseInt(w); - for (let v in u[p]) { + for (let v in _[p]) { let a = parseInt(v); - for (let l in u[p][a]) { - let g = parseInt(l), M = u[p][a][g]; + for (let l in _[p][a]) { + let g = parseInt(l), M = _[p][a][g]; for (let L = 0; L < M.length; L++) { let T = M[L]; for (let D = L + 1; D < M.length; D++) { - let R = M[D]; - (0, s.areConnected)(T, R) && T.bonds.indexOf(R.index) == -1 && (T.bonds.push(R.index), T.bondOrder.push(1), R.bonds.push(T.index), R.bondOrder.push(1)); + let I = M[D]; + (0, n.areConnected)(T, I) && T.bonds.indexOf(I.index) == -1 && (T.bonds.push(I.index), T.bondOrder.push(1), I.bonds.push(T.index), I.bondOrder.push(1)); } } for (let L = 0; L < o.length; L++) { let T = o[L]; - if (!u[p + T.x] || !u[p + T.x][a + T.y] || !u[p + T.x][a + T.y][g + T.z]) + if (!_[p + T.x] || !_[p + T.x][a + T.y] || !_[p + T.x][a + T.y][g + T.z]) continue; - let D = u[p + T.x][a + T.y][g + T.z]; - n(M, D); + let D = _[p + T.x][a + T.y][g + T.z]; + s(M, D); } } } @@ -18862,38 +18862,38 @@ ATOM`, g); /* harmony export */ assignPDBBonds: () => ( /* binding */ - x + y ) /* harmony export */ }); - var s = t( + var n = t( /*! ./areConnected */ "./src/parsers/utils/areConnected.ts" ), f = t( /*! ./assignBonds */ "./src/parsers/utils/assignBonds.ts" - ), _ = t( + ), u = t( /*! ./standardResidues */ "./src/parsers/utils/standardResidues.ts" ); - function x(h) { - var u = [], E = [], c, C; + function y(h) { + var _ = [], E = [], c, C; for (c = 0, C = h.length; c < C; c++) { var b = h[c]; - b.index = c, b.hetflag || !_.standardResidues.has(b.resn) ? E.push(b) : u.push(b); + b.index = c, b.hetflag || !u.standardResidues.has(b.resn) ? E.push(b) : _.push(b); } - (0, f.assignBonds)(E), u.sort(function(v, a) { + (0, f.assignBonds)(E), _.sort(function(v, a) { return v.chain != a.chain ? v.chain < a.chain ? -1 : 1 : v.resi - a.resi; }); - var A = -1, S = -1, n; - for (c = 0, C = u.length; c < C; c++) { - var o = u[c]; - o.resi !== A && (A = o.resi, n || S++, n = !1), o.reschain = S; - for (var w = c + 1; w < u.length; w++) { - var p = u[w]; + var A = -1, S = -1, s; + for (c = 0, C = _.length; c < C; c++) { + var o = _[c]; + o.resi !== A && (A = o.resi, s || S++, s = !1), o.reschain = S; + for (var w = c + 1; w < _.length; w++) { + var p = _[w]; if (p.chain != o.chain || p.resi - o.resi > 1) break; - (0, s.areConnected)(o, p) && (o.bonds.indexOf(p.index) === -1 && (o.bonds.push(p.index), o.bondOrder.push(1), p.bonds.push(o.index), p.bondOrder.push(1)), o.resi !== p.resi && (n = !0)); + (0, n.areConnected)(o, p) && (o.bonds.indexOf(p.index) === -1 && (o.bonds.push(p.index), o.bondOrder.push(1), p.bonds.push(o.index), p.bondOrder.push(1)), o.resi !== p.resi && (s = !0)); } } } @@ -18914,13 +18914,13 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./bondLength */ "./src/parsers/utils/bondLength.ts" ); - function f(_, x) { - var h = _.replace(/ /g, ""); - return h.length > 0 && h[0] == "H" && h != "Hg" && h != "He" && h != "Hf" && h != "Hs" && h != "Ho" && (h = "H"), h.length > 1 && (h = h[0].toUpperCase() + h.substring(1).toLowerCase(), typeof s.bondTable[h] > "u" ? h = h[0] : x && (h == "Ca" || h == "Cd") && (h = "C")), h; + function f(u, y) { + var h = u.replace(/ /g, ""); + return h.length > 0 && h[0] == "H" && h != "Hg" && h != "He" && h != "Hf" && h != "Hs" && h != "Ho" && (h = "H"), h.length > 1 && (h = h[0].toUpperCase() + h.substring(1).toLowerCase(), typeof n.bondTable[h] > "u" ? h = h[0] : y && (h == "Ca" || h == "Cd") && (h = "C")), h; } } ), @@ -18940,16 +18940,16 @@ ATOM`, g); /* harmony export */ bondTable: () => ( /* binding */ - s + n ), /* harmony export */ setBondLength: () => ( /* binding */ - _ + u ) /* harmony export */ }); - let s = { + let n = { H: 0.37, He: 0.32, Li: 1.34, @@ -19024,11 +19024,11 @@ ATOM`, g); Rn: 1.45 // None of the bottom row or any of the Lanthanides have bond lengths }; - function f(x) { - return s[x] || 1.6; + function f(y) { + return n[y] || 1.6; } - function _(x, h) { - h < 0 && (h = 0), s[x] = h; + function u(y, h) { + h < 0 && (h = 0), n[y] = h; } } ), @@ -19047,27 +19047,27 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ./assignBackboneHBonds */ "./src/parsers/utils/assignBackboneHBonds.ts" ); - function f(_, x) { - (0, s.assignBackboneHBonds)(_, x); - var h = {}, u, E, c, C, b, A; - for (u = 0, E = _.length; u < E; u++) - if (b = _[u], typeof h[b.chain] > "u" && (h[b.chain] = []), isFinite(b.hbondDistanceSq)) { + function f(u, y) { + (0, n.assignBackboneHBonds)(u, y); + var h = {}, _, E, c, C, b, A; + for (_ = 0, E = u.length; _ < E; _++) + if (b = u[_], typeof h[b.chain] > "u" && (h[b.chain] = []), isFinite(b.hbondDistanceSq)) { var S = b.hbondOther; typeof h[S.chain] > "u" && (h[S.chain] = []), Math.abs(S.resi - b.resi) === 4 && (h[b.chain][b.resi] = "h"); } for (c in h) for (C = 1; C < h[c].length - 1; C++) { - var n = h[c][C - 1], o = h[c][C + 1]; - A = h[c][C], n == "h" && n == o && A != n && (h[c][C] = n); + var s = h[c][C - 1], o = h[c][C + 1]; + A = h[c][C], s == "h" && s == o && A != s && (h[c][C] = s); } - for (u = 0, E = _.length; u < E; u++) - b = _[u], isFinite(b.hbondDistanceSq) && h[b.chain][b.resi] != "h" && b.ss != "h" && (h[b.chain][b.resi] = "maybesheet"); - for (let w = 0, p = _.length; w < p; w++) - if (b = _[w], isFinite(b.hbondDistanceSq) && h[b.chain][b.resi] == "maybesheet") { + for (_ = 0, E = u.length; _ < E; _++) + b = u[_], isFinite(b.hbondDistanceSq) && h[b.chain][b.resi] != "h" && b.ss != "h" && (h[b.chain][b.resi] = "maybesheet"); + for (let w = 0, p = u.length; w < p; w++) + if (b = u[w], isFinite(b.hbondDistanceSq) && h[b.chain][b.resi] == "maybesheet") { let v = b.hbondOther, a = h[v.chain][v.resi]; (a == "maybesheet" || a == "s") && (h[b.chain][b.resi] = "s", h[v.chain][v.resi] = "s"); } @@ -19081,8 +19081,8 @@ ATOM`, g); (v == "h" || v == "s") && h[w][p - 1] != v && h[w][p + 1] != v && delete h[w][p]; } } - for (u = 0, E = _.length; u < E; u++) - b = _[u], A = h[b.chain][b.resi], delete b.hbondOther, delete b.hbondDistanceSq, !(typeof A > "u" || A == "maybesheet") && (b.ss = A, h[b.chain][b.resi - 1] != A && (b.ssbegin = !0), h[b.chain][b.resi + 1] != A && (b.ssend = !0)); + for (_ = 0, E = u.length; _ < E; _++) + b = u[_], A = h[b.chain][b.resi], delete b.hbondOther, delete b.hbondDistanceSq, !(typeof A > "u" || A == "maybesheet") && (b.ss = A, h[b.chain][b.resi - 1] != A && (b.ssbegin = !0), h[b.chain][b.resi + 1] != A && (b.ssend = !0)); } } ), @@ -19101,22 +19101,22 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../WebGL */ "./src/WebGL/index.ts" ), f = t( /*! ./atomNameToElem */ "./src/parsers/utils/atomNameToElem.ts" - ), _ = t( + ), u = t( /*! ./bondLength */ "./src/parsers/utils/bondLength.ts" - ), x = t( + ), y = t( /*! ./computeSecondaryStructure */ "./src/parsers/utils/computeSecondaryStructure.ts" ), h = t( /*! ./isEmpty */ "./src/parsers/utils/isEmpty.ts" - ), u = t( + ), _ = t( /*! ./processSymmetries */ "./src/parsers/utils/processSymmetries.ts" ), E = t( @@ -19127,26 +19127,26 @@ ATOM`, g); "./src/parsers/utils/validateBonds.ts" ); function C(b, A, S) { - var n = [], o = A.assignBonds === void 0 ? !0 : A.assignBonds, w = !A.keepH, p = !!A.noSecondaryStructure, v = !A.noComputeSecondaryStructure, a = !A.doAssembly, l = A.altLoc ? A.altLoc : "A", g = { symmetries: [] }, M, L = [], T = [], D, R = {}; + var s = [], o = A.assignBonds === void 0 ? !0 : A.assignBonds, w = !A.keepH, p = !!A.noSecondaryStructure, v = !A.noComputeSecondaryStructure, a = !A.doAssembly, l = A.altLoc ? A.altLoc : "A", g = { symmetries: [] }, M, L = [], T = [], D, I = {}; for (let He = 0; He < b.length; He++) { D = b[He].replace(/^\s*/, ""); - var B = D.substring(0, 6), P, z, F; - if (B.indexOf("END") == 0) { - if (L = b.slice(He + 1), B == "END") + var z = D.substring(0, 6), P, B, F; + if (z.indexOf("END") == 0) { + if (L = b.slice(He + 1), z == "END") for (var N in S) S.hasOwnProperty(N) && delete S[N]; break; - } else if (B == "ATOM " || B == "HETATM") { - var $, k, G, H, U, V, Q, oe, ee, ne, me, se; - if (me = D.substring(16, 17), me != " " && me != l && l != "*" || (ne = parseInt(D.substring(6, 11)), M = D.substring(12, 16).replace(/ /g, ""), $ = D.substring(17, 20).replace(/ /g, ""), k = D.substring(21, 22), G = parseInt(D.substring(22, 26)), H = D.substring(26, 27), U = parseFloat(D.substring(30, 38)), V = parseFloat(D.substring(38, 46)), Q = parseFloat(D.substring(46, 54)), se = parseFloat(D.substring(60, 68)), ee = D.substring(76, 78).replace(/ /g, ""), ee === "" || typeof _.bondTable[ee] > "u" ? ee = (0, f.atomNameToElem)(D.substring(12, 14), D[0] == "A") : ee = ee[0].toUpperCase() + ee.substring(1).toLowerCase(), ee == "H" && w)) + } else if (z == "ATOM " || z == "HETATM") { + var $, k, G, H, U, V, Q, ae, oe, q, me, ne; + if (me = D.substring(16, 17), me != " " && me != l && l != "*" || (q = parseInt(D.substring(6, 11)), M = D.substring(12, 16).replace(/ /g, ""), $ = D.substring(17, 20).replace(/ /g, ""), k = D.substring(21, 22), G = parseInt(D.substring(22, 26)), H = D.substring(26, 27), U = parseFloat(D.substring(30, 38)), V = parseFloat(D.substring(38, 46)), Q = parseFloat(D.substring(46, 54)), ne = parseFloat(D.substring(60, 68)), oe = D.substring(76, 78).replace(/ /g, ""), oe === "" || typeof u.bondTable[oe] > "u" ? oe = (0, f.atomNameToElem)(D.substring(12, 14), D[0] == "A") : oe = oe[0].toUpperCase() + oe.substring(1).toLowerCase(), oe == "H" && w)) continue; - B[0] == "H" ? oe = !0 : oe = !1, T[ne] = n.length, n.push({ + z[0] == "H" ? ae = !0 : ae = !1, T[q] = s.length, s.push({ resn: $, x: U, y: V, z: Q, - elem: ee, - hetflag: oe, + elem: oe, + hetflag: ae, altLoc: me, chain: k, resi: G, @@ -19155,45 +19155,45 @@ ATOM`, g); // resi // and // icode - serial: ne, + serial: q, atom: M, bonds: [], ss: "c", bondOrder: [], properties: {}, - b: se, + b: ne, pdbline: D }); - } else if (B == "SHEET ") { - P = D.substring(21, 22), z = parseInt(D.substring(22, 26)), F = parseInt(D.substring(33, 37)), P in S || (S[P] = {}), S[P][z] = "s1"; - for (var fe = z + 1; fe < F; fe++) + } else if (z == "SHEET ") { + P = D.substring(21, 22), B = parseInt(D.substring(22, 26)), F = parseInt(D.substring(33, 37)), P in S || (S[P] = {}), S[P][B] = "s1"; + for (var fe = B + 1; fe < F; fe++) S[P][fe] = "s"; S[P][F] = "s2"; - } else if (B == "CONECT") { - var Ce = parseInt(D.substring(6, 11)), Me = T[Ce], Te = n[Me], ae = [11, 16, 21, 26]; + } else if (z == "CONECT") { + var Ce = parseInt(D.substring(6, 11)), Me = T[Ce], Te = s[Me], se = [11, 16, 21, 26]; for (let We = 0; We < 4; We++) { - var pe = parseInt(D.substring(ae[We], ae[We] + 5)), we = T[pe]; + var pe = parseInt(D.substring(se[We], se[We] + 5)), we = T[pe]; let Y = Me + ":" + we; - var ke = n[we]; + var ke = s[we]; if (Te !== void 0 && ke !== void 0) - if (!R[Y]) - R[Y] = 1, (Te.bonds.length == 0 || Te.bonds[Te.bonds.length - 1] != we) && (Te.bonds.push(we), Te.bondOrder.push(1)); + if (!I[Y]) + I[Y] = 1, (Te.bonds.length == 0 || Te.bonds[Te.bonds.length - 1] != we) && (Te.bonds.push(we), Te.bondOrder.push(1)); else { - R[Y] += 1; + I[Y] += 1; for (let K = 0; K < Te.bonds.length; K++) if (Te.bonds[K] == we) { - var Ue = R[Y]; + var Ue = I[Y]; Ue >= 4 ? Te.bondOrder[K] = 1 : Te.bondOrder[K] = Ue; } } } - } else if (B == "HELIX ") { - P = D.substring(19, 20), z = parseInt(D.substring(21, 25)), F = parseInt(D.substring(33, 37)), P in S || (S[P] = {}), S[P][z] = "h1"; - for (let We = z + 1; We < F; We++) + } else if (z == "HELIX ") { + P = D.substring(19, 20), B = parseInt(D.substring(21, 25)), F = parseInt(D.substring(33, 37)), P in S || (S[P] = {}), S[P][B] = "h1"; + for (let We = B + 1; We < F; We++) S[P][We] = "h"; S[P][F] = "h2"; - } else if (!a && B == "REMARK" && D.substring(13, 18) == "BIOMT") { - var Ne, Be = new s.Matrix4(); + } else if (!a && z == "REMARK" && D.substring(13, 18) == "BIOMT") { + var Ne, Be = new n.Matrix4(); for (Ne = 1; Ne <= 3; Ne++) if (D = b[He].replace(/^\s*/, ""), parseInt(D.substring(18, 19)) == Ne) Be.elements[Ne - 1] = parseFloat(D.substring(23, 33)), Be.elements[Ne - 1 + 4] = parseFloat(D.substring(33, 43)), Be.elements[Ne - 1 + 8] = parseFloat(D.substring(43, 53)), Be.elements[Ne - 1 + 12] = parseFloat(D.substring(53)), He++; @@ -19201,19 +19201,19 @@ ATOM`, g); for (; D.substring(13, 18) == "BIOMT"; ) He++, D = b[He].replace(/^\s*/, ""); Be.elements[3] = 0, Be.elements[7] = 0, Be.elements[11] = 0, Be.elements[15] = 1, g.symmetries.push(Be), He--; - } else if (B == "CRYST1") { - let We, Y, K, q, de, ve; - We = parseFloat(D.substring(7, 15)), Y = parseFloat(D.substring(16, 24)), K = parseFloat(D.substring(25, 33)), q = parseFloat(D.substring(34, 40)), de = parseFloat(D.substring(41, 47)), ve = parseFloat(D.substring(48, 54)), g.cryst = { + } else if (z == "CRYST1") { + let We, Y, K, ee, de, ve; + We = parseFloat(D.substring(7, 15)), Y = parseFloat(D.substring(16, 24)), K = parseFloat(D.substring(25, 33)), ee = parseFloat(D.substring(34, 40)), de = parseFloat(D.substring(41, 47)), ve = parseFloat(D.substring(48, 54)), g.cryst = { a: We, b: Y, c: K, - alpha: q, + alpha: ee, beta: de, gamma: ve }; - } else if (B == "ANISOU") { + } else if (z == "ANISOU") { let We = parseInt(D.substring(6, 11)); - var ue = T[We], ye = n[ue]; + var ue = T[We], ye = s[ue]; if (ye) { var ge = D.substring(30).trim().split(/\s+/), Se = { u11: parseInt(ge[0]), @@ -19227,14 +19227,14 @@ ATOM`, g); } } } - if ((0, c.validateBonds)(n, T), o && (0, E.assignPDBBonds)(n), a || (0, u.processSymmetries)(g.symmetries, n, A, g.cryst), v && !p && (0, x.computeSecondaryStructure)(n, A.hbondCutoff), !(0, h.isEmpty)(S)) { - for (let He = 0; He < n.length; He++) - if (M = n[He], M !== void 0 && M.chain in S && M.resi in S[M.chain]) { + if ((0, c.validateBonds)(s, T), o && (0, E.assignPDBBonds)(s), a || (0, _.processSymmetries)(g.symmetries, s, A, g.cryst), v && !p && (0, y.computeSecondaryStructure)(s, A.hbondCutoff), !(0, h.isEmpty)(S)) { + for (let He = 0; He < s.length; He++) + if (M = s[He], M !== void 0 && M.chain in S && M.resi in S[M.chain]) { var ze = S[M.chain][M.resi]; M.ss = ze[0], ze.length > 1 && (ze[1] == "1" ? M.ssbegin = !0 : ze[1] == "2" && (M.ssend = !0)); } } - return [n, g, L]; + return [s, g, L]; } } ), @@ -19249,13 +19249,13 @@ ATOM`, g); /* harmony export */ isEmpty: () => ( /* binding */ - s + n ) /* harmony export */ }); - function s(f) { - var _; - for (_ in f) + function n(f) { + var u; + for (u in f) return !1; return !0; } @@ -19276,71 +19276,71 @@ ATOM`, g); ) /* harmony export */ }); - var s = t( + var n = t( /*! ../../WebGL */ "./src/WebGL/index.ts" ); - function f(_, x, h, u) { - var E = !h.duplicateAssemblyAtoms, c = x.length, C = c, b, A, S; - let n = -1; - if (h.normalizeAssembly && u) { - let l = (0, s.conversionMatrix3)(u.a, u.b, u.c, u.alpha, u.beta, u.gamma), g = new s.Matrix3(); - for (g.getInverse3(l), b = 0; b < _.length; b++) { - let M = new s.Vector3(0, 0, 0); + function f(u, y, h, _) { + var E = !h.duplicateAssemblyAtoms, c = y.length, C = c, b, A, S; + let s = -1; + if (h.normalizeAssembly && _) { + let l = (0, n.conversionMatrix3)(_.a, _.b, _.c, _.alpha, _.beta, _.gamma), g = new n.Matrix3(); + for (g.getInverse3(l), b = 0; b < u.length; b++) { + let M = new n.Vector3(0, 0, 0); for (S = 0; S < c; S++) { - let R = new s.Vector3(x[S].x, x[S].y, x[S].z); - R.applyMatrix4(_[b]), R.applyMatrix3(g), M.add(R); + let I = new n.Vector3(y[S].x, y[S].y, y[S].z); + I.applyMatrix4(u[b]), I.applyMatrix3(g), M.add(I); } M.divideScalar(c); const L = [M.x, M.y, M.z]; let T = [0, 0, 0]; - for (let R = 0; R < 3; R++) { - for (; L[R] < -1e-3; ) - L[R] += 1, T[R] += 1; - for (; L[R] > 1.001; ) - L[R] -= 1, T[R] -= 1; + for (let I = 0; I < 3; I++) { + for (; L[I] < -1e-3; ) + L[I] += 1, T[I] += 1; + for (; L[I] > 1.001; ) + L[I] -= 1, T[I] -= 1; } - const D = new s.Vector3(T[0], T[1], T[2]); - D.applyMatrix3(l), _[b].isNearlyIdentity() && D.lengthSq() > 1e-3 && (n = b), _[b].translate(D); + const D = new n.Vector3(T[0], T[1], T[2]); + D.applyMatrix3(l), u[b].isNearlyIdentity() && D.lengthSq() > 1e-3 && (s = b), u[b].translate(D); } } if (E) { - if (_.length > 1) - for (b = 0; b < x.length; b++) { + if (u.length > 1) + for (b = 0; b < y.length; b++) { var v = []; - for (A = 0; A < _.length; A++) - if (!_[A].isNearlyIdentity()) { - var a = new s.Vector3(); - a.set(x[b].x, x[b].y, x[b].z), a.applyMatrix4(_[A]), v.push(a); + for (A = 0; A < u.length; A++) + if (!u[A].isNearlyIdentity()) { + var a = new n.Vector3(); + a.set(y[b].x, y[b].y, y[b].z), a.applyMatrix4(u[A]), v.push(a); } - x[b].symmetries = v; + y[b].symmetries = v; } } else { for (S = 0; S < c; S++) - x[S].sym = -1; - for (b = 0; b < _.length; b++) - if (!_[b].isNearlyIdentity() && n != b) { - let l = new s.Vector3(); + y[S].sym = -1; + for (b = 0; b < u.length; b++) + if (!u[b].isNearlyIdentity() && s != b) { + let l = new n.Vector3(); for (S = 0; S < c; S++) { var o = []; - for (A = 0; A < x[S].bonds.length; A++) - o.push(x[S].bonds[A] + C); - l.set(x[S].x, x[S].y, x[S].z), l.applyMatrix4(_[b]); + for (A = 0; A < y[S].bonds.length; A++) + o.push(y[S].bonds[A] + C); + l.set(y[S].x, y[S].y, y[S].z), l.applyMatrix4(u[b]); var w = {}; - for (var p in x[S]) - w[p] = x[S][p]; - w.x = l.x, w.y = l.y, w.z = l.z, w.bonds = o, w.sym = b, w.index = x.length, x.push(w); + for (var p in y[S]) + w[p] = y[S][p]; + w.x = l.x, w.y = l.y, w.z = l.z, w.bonds = o, w.sym = b, w.index = y.length, y.push(w); } - C = x.length; + C = y.length; } else for (S = 0; S < c; S++) - x[S].sym = b; - if (n >= 0) { - let l = new s.Vector3(); + y[S].sym = b; + if (s >= 0) { + let l = new n.Vector3(); for (S = 0; S < c; S++) - l.set(x[S].x, x[S].y, x[S].z), l.applyMatrix4(_[n]), x[S].x = l.x, x[S].y = l.y, x[S].z = l.z; + l.set(y[S].x, y[S].y, y[S].z), l.applyMatrix4(u[s]), y[S].x = l.x, y[S].y = l.y, y[S].z = l.z; } - _.length = 0; + u.length = 0; } } } @@ -19356,11 +19356,11 @@ ATOM`, g); /* harmony export */ standardResidues: () => ( /* binding */ - s + n ) /* harmony export */ }); - const s = /* @__PURE__ */ new Set([ + const n = /* @__PURE__ */ new Set([ "ABU", "ACD", "ALA", @@ -19440,17 +19440,17 @@ ATOM`, g); /* harmony export */ validateBonds: () => ( /* binding */ - s + n ) /* harmony export */ }); - function s(f, _) { - for (var x = 0, h = f.length; x < h; x++) - for (var u = f[x], E = 0; E < u.bonds.length; E++) { - var c = u.bonds[E], C = f[c], b = _[u.serial]; + function n(f, u) { + for (var y = 0, h = f.length; y < h; y++) + for (var _ = f[y], E = 0; E < _.bonds.length; E++) { + var c = _.bonds[E], C = f[c], b = u[_.serial]; if (C && b) { var A = C.bonds.indexOf(b); - A < 0 && (C.bonds.push(b), C.bondOrder.push(u.bondOrder[E])); + A < 0 && (C.bonds.push(b), C.bondOrder.push(_.bondOrder[E])); } } } @@ -19472,11 +19472,11 @@ ATOM`, g); /* harmony export */ partialCharges: () => ( /* binding */ - s + n ) /* harmony export */ }); - const s = { + const n = { "ALA:N": -0.15, "ALA:CA": 0.1, "ALA:CB": 0, @@ -19645,10 +19645,10 @@ ATOM`, g); "VAL:C": 0.6, "VAL:O": -0.55 }; - function f(_, x) { - if ((!x || typeof _.partialCharge > "u") && _.resn && _.atom) { - var h = _.resn + ":" + _.atom; - _.properties.partialCharge = s[h]; + function f(u, y) { + if ((!y || typeof u.partialCharge > "u") && u.resn && u.atom) { + var h = u.resn + ":" + u.atom; + u.properties.partialCharge = n[h]; } } } @@ -19779,14 +19779,14 @@ ATOM`, g); return r; } function deepCopy(r) { - let e, t, s; + let e, t, n; if (r == null) return {}; if (typeof r != "object" || r === null) return r; e = Array.isArray(r) ? [] : {}; - for (s in r) - t = r[s], e[s] = deepCopy(t); + for (n in r) + t = r[n], e[n] = deepCopy(t); return e; } function isNumeric(r) { @@ -19806,31 +19806,31 @@ ATOM`, g); r && (r.volformat && !(r.voldata instanceof _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData) && (r.voldata = new _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData(r.voldata, r.volformat)), r.volscheme && (r.volscheme = _Gradient__WEBPACK_IMPORTED_MODULE_0__.Gradient.getGradient(r.volscheme))); } function getExtent(r, e) { - var t, s, f, _, x, h, u, E, c, C, b = !e; - if (t = s = f = 9999, _ = x = h = -9999, u = E = c = C = 0, r.length === 0) + var t, n, f, u, y, h, _, E, c, C, b = !e; + if (t = n = f = 9999, u = y = h = -9999, _ = E = c = C = 0, r.length === 0) return [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; for (var A = 0; A < r.length; A++) { var S = r[A]; - if (!(typeof S > "u" || !isFinite(S.x) || !isFinite(S.y) || !isFinite(S.z)) && (C++, u += S.x, E += S.y, c += S.z, t = t < S.x ? t : S.x, s = s < S.y ? s : S.y, f = f < S.z ? f : S.z, _ = _ > S.x ? _ : S.x, x = x > S.y ? x : S.y, h = h > S.z ? h : S.z, S.symmetries && b)) - for (var n = 0; n < S.symmetries.length; n++) - C++, u += S.symmetries[n].x, E += S.symmetries[n].y, c += S.symmetries[n].z, t = t < S.symmetries[n].x ? t : S.symmetries[n].x, s = s < S.symmetries[n].y ? s : S.symmetries[n].y, f = f < S.symmetries[n].z ? f : S.symmetries[n].z, _ = _ > S.symmetries[n].x ? _ : S.symmetries[n].x, x = x > S.symmetries[n].y ? x : S.symmetries[n].y, h = h > S.symmetries[n].z ? h : S.symmetries[n].z; + if (!(typeof S > "u" || !isFinite(S.x) || !isFinite(S.y) || !isFinite(S.z)) && (C++, _ += S.x, E += S.y, c += S.z, t = t < S.x ? t : S.x, n = n < S.y ? n : S.y, f = f < S.z ? f : S.z, u = u > S.x ? u : S.x, y = y > S.y ? y : S.y, h = h > S.z ? h : S.z, S.symmetries && b)) + for (var s = 0; s < S.symmetries.length; s++) + C++, _ += S.symmetries[s].x, E += S.symmetries[s].y, c += S.symmetries[s].z, t = t < S.symmetries[s].x ? t : S.symmetries[s].x, n = n < S.symmetries[s].y ? n : S.symmetries[s].y, f = f < S.symmetries[s].z ? f : S.symmetries[s].z, u = u > S.symmetries[s].x ? u : S.symmetries[s].x, y = y > S.symmetries[s].y ? y : S.symmetries[s].y, h = h > S.symmetries[s].z ? h : S.symmetries[s].z; } return [ - [t, s, f], - [_, x, h], - [u / C, E / C, c / C] + [t, n, f], + [u, y, h], + [_ / C, E / C, c / C] ]; } function getPropertyRange(r, e) { - for (var t = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY, f = 0, _ = r.length; f < _; f++) { - var x = r[f], h = getAtomProperty(x, e); - h != null && (h < t && (t = h), h > s && (s = h)); + for (var t = Number.POSITIVE_INFINITY, n = Number.NEGATIVE_INFINITY, f = 0, u = r.length; f < u; f++) { + var y = r[f], h = getAtomProperty(y, e); + h != null && (h < t && (t = h), h > n && (n = h)); } - return !isFinite(t) && !isFinite(s) ? t = s = 0 : isFinite(t) ? isFinite(s) || (s = t) : t = s, [t, s]; + return !isFinite(t) && !isFinite(n) ? t = n = 0 : isFinite(t) ? isFinite(n) || (n = t) : t = n, [t, n]; } class PausableTimer { - constructor(e, t, s) { - this.total_time_run = 0, this.fn = e, this.arg = s, this.countdown = t, this.start_time = (/* @__PURE__ */ new Date()).getTime(), this.ident = setTimeout(e, t, s); + constructor(e, t, n) { + this.total_time_run = 0, this.fn = e, this.arg = n, this.countdown = t, this.start_time = (/* @__PURE__ */ new Date()).getTime(), this.ident = setTimeout(e, t, n); } cancel() { clearTimeout(this.ident); @@ -19843,9 +19843,9 @@ ATOM`, g); } } function base64ToArray(r) { - for (var e = window.atob(r), t = e.length, s = new Uint8Array(t), f = 0; f < t; f++) - s[f] = e.charCodeAt(f); - return s; + for (var e = window.atob(r), t = e.length, n = new Uint8Array(t), f = 0; f < t; f++) + n[f] = e.charCodeAt(f); + return n; } function getAtomProperty(r, e) { var t = null; @@ -19870,17 +19870,17 @@ ATOM`, g); }, t = {}; if (r === "all") return t; - for (var s = r.split(";"), f = 0; f < s.length; f++) { - var _ = s[f].split(":"), x = _[0], h = {}, u = _[1]; - if (u) - if (u = u.replace(/~/g, "="), u.indexOf("=") !== -1) - for (var E = u.split(","), c = 0; c < E.length; c++) { + for (var n = r.split(";"), f = 0; f < n.length; f++) { + var u = n[f].split(":"), y = u[0], h = {}, _ = u[1]; + if (_) + if (_ = _.replace(/~/g, "="), _.indexOf("=") !== -1) + for (var E = _.split(","), c = 0; c < E.length; c++) { var C = E[c].split("=", 2); h[C[0]] = e(C[1]); } else - u.indexOf(",") !== -1 ? h = u.split(",") : h = e(u); - t[x] = h; + _.indexOf(",") !== -1 ? h = _.split(",") : h = e(_); + t[y] = h; } return t; } @@ -19890,17 +19890,17 @@ ATOM`, g); return r; } function get(r, e) { - var t = fetch(r).then(checkStatus).then((s) => s.text()); + var t = fetch(r).then(checkStatus).then((n) => n.text()); return e ? t.then(e) : t; } - function getbin(r, e, t, s) { + function getbin(r, e, t, n) { var f; - return t == "POST" ? f = fetch(r, { method: "POST", body: s }).then((_) => checkStatus(_)).then((_) => _.arrayBuffer()) : f = fetch(r).then((_) => checkStatus(_)).then((_) => _.arrayBuffer()), e ? f.then(e) : f; + return t == "POST" ? f = fetch(r, { method: "POST", body: n }).then((u) => checkStatus(u)).then((u) => u.arrayBuffer()) : f = fetch(r).then((u) => checkStatus(u)).then((u) => u.arrayBuffer()), e ? f.then(e) : f; } - function download(r, e, t, s) { - var f = "", _ = "", x = "", h = "", u = null, E = e.addModel(); + function download(r, e, t, n) { + var f = "", u = "", y = "", h = "", _ = null, E = e.addModel(); if (r.indexOf(":") < 0 && (r.length == 4 ? r = "pdb:" + r : isNaN(r) ? r = "url:" + r : r = "cid:" + r), r.substring(0, 5) === "mmtf:") - _ = t && t.pdbUri ? t.pdbUri : "https://mmtf.rcsb.org/v1.0/full/", r = r.substring(5).toUpperCase(), h = _ + r, t && typeof t.noComputeSecondaryStructure > "u" && (t.noComputeSecondaryStructure = !0), u = new Promise(function(C) { + u = t && t.pdbUri ? t.pdbUri : "https://mmtf.rcsb.org/v1.0/full/", r = r.substring(5).toUpperCase(), h = u + r, t && typeof t.noComputeSecondaryStructure > "u" && (t.noComputeSecondaryStructure = !0), _ = new Promise(function(C) { getbin(h).then(function(b) { E.addMolData(b, "mmtf", t), e.zoomTo(), e.render(), C(E); }, function() { @@ -19913,7 +19913,7 @@ ATOM`, g); alert("Wrong PDB ID"); return; } - f == "mmtf" ? (x = t && t.mmtfUri ? t.mmtfUri : "https://mmtf.rcsb.org/v1.0/full/", h = x + r.toUpperCase()) : (_ = t && t.pdbUri ? t.pdbUri : "https://files.rcsb.org/view/", h = _ + r + "." + f); + f == "mmtf" ? (y = t && t.mmtfUri ? t.mmtfUri : "https://mmtf.rcsb.org/v1.0/full/", h = y + r.toUpperCase()) : (u = t && t.pdbUri ? t.pdbUri : "https://files.rcsb.org/view/", h = u + r + "." + f); } else if (r.substring(0, 4) == "cid:") { if (f = "sdf", r = r.substring(4), !r.match(/^[0-9]+$/)) { alert("Wrong Compound ID"); @@ -19925,11 +19925,11 @@ ATOM`, g); var c = function(C) { E.addMolData(C, f, t), e.zoomTo(), e.render(); }; - u = new Promise(function(C) { + _ = new Promise(function(C) { f == "mmtf" ? getbin(h).then(function(b) { c(b), C(E); }).catch(function() { - _ = t && t.pdbUri ? t.pdbUri : "https://files.rcsb.org/view/", h = _ + r + ".pdb", f = "pdb", console.log("falling back to pdb format"), get(h).then(function(b) { + u = t && t.pdbUri ? t.pdbUri : "https://files.rcsb.org/view/", h = u + r + ".pdb", f = "pdb", console.log("falling back to pdb format"), get(h).then(function(b) { c(b), C(E); }).catch(function(b) { c(""), C(E), console.log("fetch of " + h + " failed: " + b.statusText); @@ -19941,39 +19941,39 @@ ATOM`, g); }); }); } - return s ? (u.then(function(C) { - s(C); - }), E) : u; + return n ? (_.then(function(C) { + n(C); + }), E) : _; } function getColorFromStyle(r, e) { let t = e.colorscheme; if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t] < "u") t = _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t]; else if (typeof t == "string" && t.endsWith("Carbon")) { - let x = t.substring(0, t.lastIndexOf("Carbon")).toLowerCase(); - if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[x] < "u") { + let y = t.substring(0, t.lastIndexOf("Carbon")).toLowerCase(); + if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[y] < "u") { let h = Object.assign({}, _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors.defaultColors); - h.C = _colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[x], _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t] = { prop: "elem", map: h }, t = _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t]; + h.C = _colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[y], _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t] = { prop: "elem", map: h }, t = _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t]; } } - let s = r.color; - if (typeof e.color < "u" && e.color != "spectrum" && (s = e.color), typeof t < "u") { - let x, h; + let n = r.color; + if (typeof e.color < "u" && e.color != "spectrum" && (n = e.color), typeof t < "u") { + let y, h; if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[t] < "u") - t = _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[t], typeof t[r[t.prop]] < "u" && (s = t.map[r[t.prop]]); + t = _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[t], typeof t[r[t.prop]] < "u" && (n = t.map[r[t.prop]]); else if (typeof t[r[t.prop]] < "u") - s = t.map[r[t.prop]]; + n = t.map[r[t.prop]]; else if (typeof t.prop < "u" && typeof t.gradient < "u") { - x = t.prop; + y = t.prop; var f = t.gradient; typeof _Gradient__WEBPACK_IMPORTED_MODULE_0__.builtinGradients[f] < "u" && (f = new _Gradient__WEBPACK_IMPORTED_MODULE_0__.builtinGradients[f](t.min, t.max, t.mid ? t.mid : t.colors)); - let u = f.range() || [-1, 1]; - h = getAtomProperty(r, x), h != null && (s = f.valueToHex(h, u)); + let _ = f.range() || [-1, 1]; + h = getAtomProperty(r, y), h != null && (n = f.valueToHex(h, _)); } else - typeof t.prop < "u" && typeof t.map < "u" ? (x = t.prop, h = getAtomProperty(r, x), typeof t.map[h] < "u" && (s = t.map[h])) : typeof e.colorscheme[r.elem] < "u" ? s = e.colorscheme[r.elem] : console.log("Could not interpret colorscheme " + t); + typeof t.prop < "u" && typeof t.map < "u" ? (y = t.prop, h = getAtomProperty(r, y), typeof t.map[h] < "u" && (n = t.map[h])) : typeof e.colorscheme[r.elem] < "u" ? n = e.colorscheme[r.elem] : console.log("Could not interpret colorscheme " + t); } else - typeof e.colorfunc < "u" && (s = e.colorfunc(r)); - return _colors__WEBPACK_IMPORTED_MODULE_2__.CC.color(s); + typeof e.colorfunc < "u" && (n = e.colorfunc(r)); + return _colors__WEBPACK_IMPORTED_MODULE_2__.CC.color(n); } function getElement(r) { let e = r; @@ -19989,22 +19989,22 @@ ATOM`, g); /***/ (r, e, t) => { (function() { - var s = {}, f; - r.exports = s, f = t( + var n = {}, f; + r.exports = n, f = t( /*! pako */ "./node_modules/upng-js/node_modules/pako/index.js" - ), function(_, x) { - _.toRGBA8 = function(h) { - var u = h.width, E = h.height; + ), function(u, y) { + u.toRGBA8 = function(h) { + var _ = h.width, E = h.height; if (h.tabs.acTL == null) - return [_.toRGBA8.decodeImage(h.data, u, E, h).buffer]; + return [u.toRGBA8.decodeImage(h.data, _, E, h).buffer]; var c = []; h.frames[0].data == null && (h.frames[0].data = h.data); - for (var C, b = new Uint8Array(u * E * 4), A = 0; A < h.frames.length; A++) { - var S = h.frames[A], n = S.rect.x, o = S.rect.y, w = S.rect.width, p = S.rect.height, v = _.toRGBA8.decodeImage(S.data, w, p, h); - if (A == 0 ? C = v : S.blend == 0 ? _._copyTile(v, w, p, C, u, E, n, o, 0) : S.blend == 1 && _._copyTile(v, w, p, C, u, E, n, o, 1), c.push(C.buffer), C = C.slice(0), S.dispose != 0) { + for (var C, b = new Uint8Array(_ * E * 4), A = 0; A < h.frames.length; A++) { + var S = h.frames[A], s = S.rect.x, o = S.rect.y, w = S.rect.width, p = S.rect.height, v = u.toRGBA8.decodeImage(S.data, w, p, h); + if (A == 0 ? C = v : S.blend == 0 ? u._copyTile(v, w, p, C, _, E, s, o, 0) : S.blend == 1 && u._copyTile(v, w, p, C, _, E, s, o, 1), c.push(C.buffer), C = C.slice(0), S.dispose != 0) { if (S.dispose == 1) - _._copyTile(b, w, p, C, u, E, n, o, 0); + u._copyTile(b, w, p, C, _, E, s, o, 0); else if (S.dispose == 2) { for (var a = A - 1; h.frames[a].dispose == 2; ) a--; @@ -20013,8 +20013,8 @@ ATOM`, g); } } return c; - }, _.toRGBA8.decodeImage = function(h, u, E, c) { - var C = u * E, b = _.decode._getBPP(c), A = Math.ceil(u * b / 8), S = new Uint8Array(C * 4), n = new Uint32Array(S.buffer), o = c.ctype, w = c.depth, p = _._bin.readUshort; + }, u.toRGBA8.decodeImage = function(h, _, E, c) { + var C = _ * E, b = u.decode._getBPP(c), A = Math.ceil(_ * b / 8), S = new Uint8Array(C * 4), s = new Uint32Array(S.buffer), o = c.ctype, w = c.depth, p = u._bin.readUshort; if (o == 6) { var v = C << 2; if (w == 8) @@ -20036,29 +20036,29 @@ ATOM`, g); S[T] = h[D], S[T + 1] = h[D + 2], S[T + 2] = h[D + 4], S[T + 3] = 255, g != -1 && p(h, D) == g && p(h, D + 2) == M && p(h, D + 4) == L && (S[T + 3] = 0); } } else if (o == 3) { - var R = c.tabs.PLTE, B = c.tabs.tRNS, P = B ? B.length : 0; + var I = c.tabs.PLTE, z = c.tabs.tRNS, P = z ? z.length : 0; if (w == 1) - for (var z = 0; z < E; z++) - for (var F = z * A, N = z * u, a = 0; a < u; a++) { + for (var B = 0; B < E; B++) + for (var F = B * A, N = B * _, a = 0; a < _; a++) { var T = N + a << 2, $ = h[F + (a >> 3)] >> 7 - ((a & 7) << 0) & 1, k = 3 * $; - S[T] = R[k], S[T + 1] = R[k + 1], S[T + 2] = R[k + 2], S[T + 3] = $ < P ? B[$] : 255; + S[T] = I[k], S[T + 1] = I[k + 1], S[T + 2] = I[k + 2], S[T + 3] = $ < P ? z[$] : 255; } if (w == 2) - for (var z = 0; z < E; z++) - for (var F = z * A, N = z * u, a = 0; a < u; a++) { + for (var B = 0; B < E; B++) + for (var F = B * A, N = B * _, a = 0; a < _; a++) { var T = N + a << 2, $ = h[F + (a >> 2)] >> 6 - ((a & 3) << 1) & 3, k = 3 * $; - S[T] = R[k], S[T + 1] = R[k + 1], S[T + 2] = R[k + 2], S[T + 3] = $ < P ? B[$] : 255; + S[T] = I[k], S[T + 1] = I[k + 1], S[T + 2] = I[k + 2], S[T + 3] = $ < P ? z[$] : 255; } if (w == 4) - for (var z = 0; z < E; z++) - for (var F = z * A, N = z * u, a = 0; a < u; a++) { + for (var B = 0; B < E; B++) + for (var F = B * A, N = B * _, a = 0; a < _; a++) { var T = N + a << 2, $ = h[F + (a >> 1)] >> 4 - ((a & 1) << 2) & 15, k = 3 * $; - S[T] = R[k], S[T + 1] = R[k + 1], S[T + 2] = R[k + 2], S[T + 3] = $ < P ? B[$] : 255; + S[T] = I[k], S[T + 1] = I[k + 1], S[T + 2] = I[k + 2], S[T + 3] = $ < P ? z[$] : 255; } if (w == 8) for (var a = 0; a < C; a++) { var T = a << 2, $ = h[a], k = 3 * $; - S[T] = R[k], S[T + 1] = R[k + 1], S[T + 2] = R[k + 2], S[T + 3] = $ < P ? B[$] : 255; + S[T] = I[k], S[T + 1] = I[k + 1], S[T + 2] = I[k + 2], S[T + 3] = $ < P ? z[$] : 255; } } else if (o == 4) { if (w == 8) @@ -20076,147 +20076,147 @@ ATOM`, g); if (w == 1) for (var a = 0; a < C; a++) { var H = 255 * (h[a >> 3] >> 7 - (a & 7) & 1), U = H == g * 255 ? 0 : 255; - n[a] = U << 24 | H << 16 | H << 8 | H; + s[a] = U << 24 | H << 16 | H << 8 | H; } if (w == 2) for (var a = 0; a < C; a++) { var H = 85 * (h[a >> 2] >> 6 - ((a & 3) << 1) & 3), U = H == g * 85 ? 0 : 255; - n[a] = U << 24 | H << 16 | H << 8 | H; + s[a] = U << 24 | H << 16 | H << 8 | H; } if (w == 4) for (var a = 0; a < C; a++) { var H = 17 * (h[a >> 1] >> 4 - ((a & 1) << 2) & 15), U = H == g * 17 ? 0 : 255; - n[a] = U << 24 | H << 16 | H << 8 | H; + s[a] = U << 24 | H << 16 | H << 8 | H; } if (w == 8) for (var a = 0; a < C; a++) { var H = h[a], U = H == g ? 0 : 255; - n[a] = U << 24 | H << 16 | H << 8 | H; + s[a] = U << 24 | H << 16 | H << 8 | H; } if (w == 16) for (var a = 0; a < C; a++) { var H = h[a << 1], U = p(h, a << 1) == g ? 0 : 255; - n[a] = U << 24 | H << 16 | H << 8 | H; + s[a] = U << 24 | H << 16 | H << 8 | H; } } return S; - }, _.decode = function(h) { - for (var u = new Uint8Array(h), E = 8, c = _._bin, C = c.readUshort, b = c.readUint, A = { tabs: {}, frames: [] }, S = new Uint8Array(u.length), n = 0, o, w = 0, p = [137, 80, 78, 71, 13, 10, 26, 10], v = 0; v < 8; v++) - if (u[v] != p[v]) + }, u.decode = function(h) { + for (var _ = new Uint8Array(h), E = 8, c = u._bin, C = c.readUshort, b = c.readUint, A = { tabs: {}, frames: [] }, S = new Uint8Array(_.length), s = 0, o, w = 0, p = [137, 80, 78, 71, 13, 10, 26, 10], v = 0; v < 8; v++) + if (_[v] != p[v]) throw "The input is not a PNG file!"; - for (; E < u.length; ) { - var a = c.readUint(u, E); + for (; E < _.length; ) { + var a = c.readUint(_, E); E += 4; - var l = c.readASCII(u, E, 4); + var l = c.readASCII(_, E, 4); if (E += 4, l == "IHDR") - _.decode._IHDR(u, E, A); + u.decode._IHDR(_, E, A); else if (l == "IDAT") { for (var v = 0; v < a; v++) - S[n + v] = u[E + v]; - n += a; + S[s + v] = _[E + v]; + s += a; } else if (l == "acTL") - A.tabs[l] = { num_frames: b(u, E), num_plays: b(u, E + 4) }, o = new Uint8Array(u.length); + A.tabs[l] = { num_frames: b(_, E), num_plays: b(_, E + 4) }, o = new Uint8Array(_.length); else if (l == "fcTL") { if (w != 0) { var g = A.frames[A.frames.length - 1]; - g.data = _.decode._decompress(A, o.slice(0, w), g.rect.width, g.rect.height), w = 0; + g.data = u.decode._decompress(A, o.slice(0, w), g.rect.width, g.rect.height), w = 0; } - var M = { x: b(u, E + 12), y: b(u, E + 16), width: b(u, E + 4), height: b(u, E + 8) }, L = C(u, E + 22); - L = C(u, E + 20) / (L == 0 ? 100 : L); - var T = { rect: M, delay: Math.round(L * 1e3), dispose: u[E + 24], blend: u[E + 25] }; + var M = { x: b(_, E + 12), y: b(_, E + 16), width: b(_, E + 4), height: b(_, E + 8) }, L = C(_, E + 22); + L = C(_, E + 20) / (L == 0 ? 100 : L); + var T = { rect: M, delay: Math.round(L * 1e3), dispose: _[E + 24], blend: _[E + 25] }; A.frames.push(T); } else if (l == "fdAT") { for (var v = 0; v < a - 4; v++) - o[w + v] = u[E + v + 4]; + o[w + v] = _[E + v + 4]; w += a - 4; } else if (l == "pHYs") - A.tabs[l] = [c.readUint(u, E), c.readUint(u, E + 4), u[E + 8]]; + A.tabs[l] = [c.readUint(_, E), c.readUint(_, E + 4), _[E + 8]]; else if (l == "cHRM") { A.tabs[l] = []; for (var v = 0; v < 8; v++) - A.tabs[l].push(c.readUint(u, E + v * 4)); + A.tabs[l].push(c.readUint(_, E + v * 4)); } else if (l == "tEXt") { A.tabs[l] == null && (A.tabs[l] = {}); - var D = c.nextZero(u, E), R = c.readASCII(u, E, D - E), B = c.readASCII(u, D + 1, E + a - D - 1); - A.tabs[l][R] = B; + var D = c.nextZero(_, E), I = c.readASCII(_, E, D - E), z = c.readASCII(_, D + 1, E + a - D - 1); + A.tabs[l][I] = z; } else if (l == "iTXt") { A.tabs[l] == null && (A.tabs[l] = {}); var D = 0, P = E; - D = c.nextZero(u, P); - var R = c.readASCII(u, P, D - P); - P = D + 1, u[P], u[P + 1], P += 2, D = c.nextZero(u, P), c.readASCII(u, P, D - P), P = D + 1, D = c.nextZero(u, P), c.readUTF8(u, P, D - P), P = D + 1; - var B = c.readUTF8(u, P, a - (P - E)); - A.tabs[l][R] = B; + D = c.nextZero(_, P); + var I = c.readASCII(_, P, D - P); + P = D + 1, _[P], _[P + 1], P += 2, D = c.nextZero(_, P), c.readASCII(_, P, D - P), P = D + 1, D = c.nextZero(_, P), c.readUTF8(_, P, D - P), P = D + 1; + var z = c.readUTF8(_, P, a - (P - E)); + A.tabs[l][I] = z; } else if (l == "PLTE") - A.tabs[l] = c.readBytes(u, E, a); + A.tabs[l] = c.readBytes(_, E, a); else if (l == "hIST") { - var z = A.tabs.PLTE.length / 3; + var B = A.tabs.PLTE.length / 3; A.tabs[l] = []; - for (var v = 0; v < z; v++) - A.tabs[l].push(C(u, E + v * 2)); + for (var v = 0; v < B; v++) + A.tabs[l].push(C(_, E + v * 2)); } else if (l == "tRNS") - A.ctype == 3 ? A.tabs[l] = c.readBytes(u, E, a) : A.ctype == 0 ? A.tabs[l] = C(u, E) : A.ctype == 2 && (A.tabs[l] = [C(u, E), C(u, E + 2), C(u, E + 4)]); + A.ctype == 3 ? A.tabs[l] = c.readBytes(_, E, a) : A.ctype == 0 ? A.tabs[l] = C(_, E) : A.ctype == 2 && (A.tabs[l] = [C(_, E), C(_, E + 2), C(_, E + 4)]); else if (l == "gAMA") - A.tabs[l] = c.readUint(u, E) / 1e5; + A.tabs[l] = c.readUint(_, E) / 1e5; else if (l == "sRGB") - A.tabs[l] = u[E]; + A.tabs[l] = _[E]; else if (l == "bKGD") - A.ctype == 0 || A.ctype == 4 ? A.tabs[l] = [C(u, E)] : A.ctype == 2 || A.ctype == 6 ? A.tabs[l] = [C(u, E), C(u, E + 2), C(u, E + 4)] : A.ctype == 3 && (A.tabs[l] = u[E]); + A.ctype == 0 || A.ctype == 4 ? A.tabs[l] = [C(_, E)] : A.ctype == 2 || A.ctype == 6 ? A.tabs[l] = [C(_, E), C(_, E + 2), C(_, E + 4)] : A.ctype == 3 && (A.tabs[l] = _[E]); else if (l == "IEND") { if (w != 0) { var g = A.frames[A.frames.length - 1]; - g.data = _.decode._decompress(A, o.slice(0, w), g.rect.width, g.rect.height), w = 0; + g.data = u.decode._decompress(A, o.slice(0, w), g.rect.width, g.rect.height), w = 0; } - A.data = _.decode._decompress(A, S, A.width, A.height); + A.data = u.decode._decompress(A, S, A.width, A.height); break; } - E += a, c.readUint(u, E), E += 4; + E += a, c.readUint(_, E), E += 4; } return delete A.compress, delete A.interlace, delete A.filter, A; - }, _.decode._decompress = function(h, u, E, c) { - return h.compress == 0 && (u = _.decode._inflate(u)), h.interlace == 0 ? u = _.decode._filterZero(u, h, 0, E, c) : h.interlace == 1 && (u = _.decode._readInterlace(u, h)), u; - }, _.decode._inflate = function(h) { - return x.inflate(h); - }, _.decode._readInterlace = function(h, u) { - for (var E = u.width, c = u.height, C = _.decode._getBPP(u), b = C >> 3, A = Math.ceil(E * C / 8), S = new Uint8Array(c * A), n = 0, o = [0, 0, 4, 0, 2, 0, 1], w = [0, 4, 0, 2, 0, 1, 0], p = [8, 8, 8, 4, 4, 2, 2], v = [8, 8, 4, 4, 2, 2, 1], a = 0; a < 7; ) { + }, u.decode._decompress = function(h, _, E, c) { + return h.compress == 0 && (_ = u.decode._inflate(_)), h.interlace == 0 ? _ = u.decode._filterZero(_, h, 0, E, c) : h.interlace == 1 && (_ = u.decode._readInterlace(_, h)), _; + }, u.decode._inflate = function(h) { + return y.inflate(h); + }, u.decode._readInterlace = function(h, _) { + for (var E = _.width, c = _.height, C = u.decode._getBPP(_), b = C >> 3, A = Math.ceil(E * C / 8), S = new Uint8Array(c * A), s = 0, o = [0, 0, 4, 0, 2, 0, 1], w = [0, 4, 0, 2, 0, 1, 0], p = [8, 8, 8, 4, 4, 2, 2], v = [8, 8, 4, 4, 2, 2, 1], a = 0; a < 7; ) { for (var l = p[a], g = v[a], M = 0, L = 0, T = o[a]; T < c; ) T += l, L++; for (var D = w[a]; D < E; ) D += g, M++; - var R = Math.ceil(M * C / 8); - _.decode._filterZero(h, u, n, M, L); - for (var B = 0, P = o[a]; P < c; ) { - for (var z = w[a], F = n + B * R << 3; z < E; ) { + var I = Math.ceil(M * C / 8); + u.decode._filterZero(h, _, s, M, L); + for (var z = 0, P = o[a]; P < c; ) { + for (var B = w[a], F = s + z * I << 3; B < E; ) { if (C == 1) { var N = h[F >> 3]; - N = N >> 7 - (F & 7) & 1, S[P * A + (z >> 3)] |= N << 7 - ((z & 3) << 0); + N = N >> 7 - (F & 7) & 1, S[P * A + (B >> 3)] |= N << 7 - ((B & 3) << 0); } if (C == 2) { var N = h[F >> 3]; - N = N >> 6 - (F & 7) & 3, S[P * A + (z >> 2)] |= N << 6 - ((z & 3) << 1); + N = N >> 6 - (F & 7) & 3, S[P * A + (B >> 2)] |= N << 6 - ((B & 3) << 1); } if (C == 4) { var N = h[F >> 3]; - N = N >> 4 - (F & 7) & 15, S[P * A + (z >> 1)] |= N << 4 - ((z & 1) << 2); + N = N >> 4 - (F & 7) & 15, S[P * A + (B >> 1)] |= N << 4 - ((B & 1) << 2); } if (C >= 8) - for (var $ = P * A + z * b, k = 0; k < b; k++) + for (var $ = P * A + B * b, k = 0; k < b; k++) S[$ + k] = h[(F >> 3) + k]; - F += C, z += g; + F += C, B += g; } - B++, P += l; + z++, P += l; } - M * L != 0 && (n += L * (1 + R)), a = a + 1; + M * L != 0 && (s += L * (1 + I)), a = a + 1; } return S; - }, _.decode._getBPP = function(h) { - var u = [1, null, 3, 1, 2, null, 4][h.ctype]; - return u * h.depth; - }, _.decode._filterZero = function(h, u, E, c, C) { - var b = _.decode._getBPP(u), A = Math.ceil(c * b / 8), S = _.decode._paeth; + }, u.decode._getBPP = function(h) { + var _ = [1, null, 3, 1, 2, null, 4][h.ctype]; + return _ * h.depth; + }, u.decode._filterZero = function(h, _, E, c, C) { + var b = u.decode._getBPP(_), A = Math.ceil(c * b / 8), S = u.decode._paeth; b = Math.ceil(b / 8); - for (var n = 0; n < C; n++) { - var o = E + n * A, w = o + n + 1, p = h[w - 1]; + for (var s = 0; s < C; s++) { + var o = E + s * A, w = o + s + 1, p = h[w - 1]; if (p == 0) for (var v = 0; v < A; v++) h[o + v] = h[w + v]; @@ -20225,7 +20225,7 @@ ATOM`, g); h[o + v] = h[w + v]; for (var v = b; v < A; v++) h[o + v] = h[w + v] + h[o + v - b] & 255; - } else if (n == 0) { + } else if (s == 0) { for (var v = 0; v < b; v++) h[o + v] = h[w + v]; if (p == 2) @@ -20256,125 +20256,125 @@ ATOM`, g); } } return h; - }, _.decode._paeth = function(h, u, E) { - var c = h + u - E, C = Math.abs(c - h), b = Math.abs(c - u), A = Math.abs(c - E); - return C <= b && C <= A ? h : b <= A ? u : E; - }, _.decode._IHDR = function(h, u, E) { - var c = _._bin; - E.width = c.readUint(h, u), u += 4, E.height = c.readUint(h, u), u += 4, E.depth = h[u], u++, E.ctype = h[u], u++, E.compress = h[u], u++, E.filter = h[u], u++, E.interlace = h[u], u++; - }, _._bin = { - nextZero: function(h, u) { - for (; h[u] != 0; ) - u++; - return u; + }, u.decode._paeth = function(h, _, E) { + var c = h + _ - E, C = Math.abs(c - h), b = Math.abs(c - _), A = Math.abs(c - E); + return C <= b && C <= A ? h : b <= A ? _ : E; + }, u.decode._IHDR = function(h, _, E) { + var c = u._bin; + E.width = c.readUint(h, _), _ += 4, E.height = c.readUint(h, _), _ += 4, E.depth = h[_], _++, E.ctype = h[_], _++, E.compress = h[_], _++, E.filter = h[_], _++, E.interlace = h[_], _++; + }, u._bin = { + nextZero: function(h, _) { + for (; h[_] != 0; ) + _++; + return _; }, - readUshort: function(h, u) { - return h[u] << 8 | h[u + 1]; + readUshort: function(h, _) { + return h[_] << 8 | h[_ + 1]; }, - writeUshort: function(h, u, E) { - h[u] = E >> 8 & 255, h[u + 1] = E & 255; + writeUshort: function(h, _, E) { + h[_] = E >> 8 & 255, h[_ + 1] = E & 255; }, - readUint: function(h, u) { - return h[u] * 16777216 + (h[u + 1] << 16 | h[u + 2] << 8 | h[u + 3]); + readUint: function(h, _) { + return h[_] * 16777216 + (h[_ + 1] << 16 | h[_ + 2] << 8 | h[_ + 3]); }, - writeUint: function(h, u, E) { - h[u] = E >> 24 & 255, h[u + 1] = E >> 16 & 255, h[u + 2] = E >> 8 & 255, h[u + 3] = E & 255; + writeUint: function(h, _, E) { + h[_] = E >> 24 & 255, h[_ + 1] = E >> 16 & 255, h[_ + 2] = E >> 8 & 255, h[_ + 3] = E & 255; }, - readASCII: function(h, u, E) { + readASCII: function(h, _, E) { for (var c = "", C = 0; C < E; C++) - c += String.fromCharCode(h[u + C]); + c += String.fromCharCode(h[_ + C]); return c; }, - writeASCII: function(h, u, E) { + writeASCII: function(h, _, E) { for (var c = 0; c < E.length; c++) - h[u + c] = E.charCodeAt(c); + h[_ + c] = E.charCodeAt(c); }, - readBytes: function(h, u, E) { + readBytes: function(h, _, E) { for (var c = [], C = 0; C < E; C++) - c.push(h[u + C]); + c.push(h[_ + C]); return c; }, pad: function(h) { return h.length < 2 ? "0" + h : h; }, - readUTF8: function(h, u, E) { + readUTF8: function(h, _, E) { for (var c = "", C, b = 0; b < E; b++) - c += "%" + _._bin.pad(h[u + b].toString(16)); + c += "%" + u._bin.pad(h[_ + b].toString(16)); try { C = decodeURIComponent(c); } catch { - return _._bin.readASCII(h, u, E); + return u._bin.readASCII(h, _, E); } return C; } - }, _._copyTile = function(h, u, E, c, C, b, A, S, n) { - for (var o = Math.min(u, C), w = Math.min(E, b), p = 0, v = 0, a = 0; a < w; a++) + }, u._copyTile = function(h, _, E, c, C, b, A, S, s) { + for (var o = Math.min(_, C), w = Math.min(E, b), p = 0, v = 0, a = 0; a < w; a++) for (var l = 0; l < o; l++) - if (A >= 0 && S >= 0 ? (p = a * u + l << 2, v = (S + a) * C + A + l << 2) : (p = (-S + a) * u - A + l << 2, v = a * C + l << 2), n == 0) + if (A >= 0 && S >= 0 ? (p = a * _ + l << 2, v = (S + a) * C + A + l << 2) : (p = (-S + a) * _ - A + l << 2, v = a * C + l << 2), s == 0) c[v] = h[p], c[v + 1] = h[p + 1], c[v + 2] = h[p + 2], c[v + 3] = h[p + 3]; - else if (n == 1) { - var g = h[p + 3] * 0.00392156862745098, M = h[p] * g, L = h[p + 1] * g, T = h[p + 2] * g, D = c[v + 3] * (1 / 255), R = c[v] * D, B = c[v + 1] * D, P = c[v + 2] * D, z = 1 - g, F = g + D * z, N = F == 0 ? 0 : 1 / F; - c[v + 3] = 255 * F, c[v + 0] = (M + R * z) * N, c[v + 1] = (L + B * z) * N, c[v + 2] = (T + P * z) * N; - } else if (n == 2) { - var g = h[p + 3], M = h[p], L = h[p + 1], T = h[p + 2], D = c[v + 3], R = c[v], B = c[v + 1], P = c[v + 2]; - g == D && M == R && L == B && T == P ? (c[v] = 0, c[v + 1] = 0, c[v + 2] = 0, c[v + 3] = 0) : (c[v] = M, c[v + 1] = L, c[v + 2] = T, c[v + 3] = g); - } else if (n == 3) { - var g = h[p + 3], M = h[p], L = h[p + 1], T = h[p + 2], D = c[v + 3], R = c[v], B = c[v + 1], P = c[v + 2]; - if (g == D && M == R && L == B && T == P) + else if (s == 1) { + var g = h[p + 3] * 0.00392156862745098, M = h[p] * g, L = h[p + 1] * g, T = h[p + 2] * g, D = c[v + 3] * (1 / 255), I = c[v] * D, z = c[v + 1] * D, P = c[v + 2] * D, B = 1 - g, F = g + D * B, N = F == 0 ? 0 : 1 / F; + c[v + 3] = 255 * F, c[v + 0] = (M + I * B) * N, c[v + 1] = (L + z * B) * N, c[v + 2] = (T + P * B) * N; + } else if (s == 2) { + var g = h[p + 3], M = h[p], L = h[p + 1], T = h[p + 2], D = c[v + 3], I = c[v], z = c[v + 1], P = c[v + 2]; + g == D && M == I && L == z && T == P ? (c[v] = 0, c[v + 1] = 0, c[v + 2] = 0, c[v + 3] = 0) : (c[v] = M, c[v + 1] = L, c[v + 2] = T, c[v + 3] = g); + } else if (s == 3) { + var g = h[p + 3], M = h[p], L = h[p + 1], T = h[p + 2], D = c[v + 3], I = c[v], z = c[v + 1], P = c[v + 2]; + if (g == D && M == I && L == z && T == P) continue; if (g < 220 && D > 20) return !1; } return !0; - }, _.encode = function(h, u, E, c, C, b) { + }, u.encode = function(h, _, E, c, C, b) { c == null && (c = 0), b == null && (b = !1); - for (var A = new Uint8Array(h[0].byteLength * h.length + 100), S = [137, 80, 78, 71, 13, 10, 26, 10], n = 0; n < 8; n++) - A[n] = S[n]; - var o = 8, w = _._bin, p = _.crc.crc, v = w.writeUint, a = w.writeUshort, l = w.writeASCII, g = _.encode.compressPNG(h, u, E, c, b); - v(A, o, 13), o += 4, l(A, o, "IHDR"), o += 4, v(A, o, u), o += 4, v(A, o, E), o += 4, A[o] = g.depth, o++, A[o] = g.ctype, o++, A[o] = 0, o++, A[o] = 0, o++, A[o] = 0, o++, v(A, o, p(A, o - 17, 17)), o += 4, v(A, o, 1), o += 4, l(A, o, "sRGB"), o += 4, A[o] = 1, o++, v(A, o, p(A, o - 5, 5)), o += 4; + for (var A = new Uint8Array(h[0].byteLength * h.length + 100), S = [137, 80, 78, 71, 13, 10, 26, 10], s = 0; s < 8; s++) + A[s] = S[s]; + var o = 8, w = u._bin, p = u.crc.crc, v = w.writeUint, a = w.writeUshort, l = w.writeASCII, g = u.encode.compressPNG(h, _, E, c, b); + v(A, o, 13), o += 4, l(A, o, "IHDR"), o += 4, v(A, o, _), o += 4, v(A, o, E), o += 4, A[o] = g.depth, o++, A[o] = g.ctype, o++, A[o] = 0, o++, A[o] = 0, o++, A[o] = 0, o++, v(A, o, p(A, o - 17, 17)), o += 4, v(A, o, 1), o += 4, l(A, o, "sRGB"), o += 4, A[o] = 1, o++, v(A, o, p(A, o - 5, 5)), o += 4; var M = h.length > 1; if (M && (v(A, o, 8), o += 4, l(A, o, "acTL"), o += 4, v(A, o, h.length), o += 4, v(A, o, 0), o += 4, v(A, o, p(A, o - 12, 12)), o += 4), g.ctype == 3) { var L = g.plte.length; v(A, o, L * 3), o += 4, l(A, o, "PLTE"), o += 4; - for (var n = 0; n < L; n++) { - var T = n * 3, D = g.plte[n], R = D & 255, B = D >> 8 & 255, P = D >> 16 & 255; - A[o + T + 0] = R, A[o + T + 1] = B, A[o + T + 2] = P; + for (var s = 0; s < L; s++) { + var T = s * 3, D = g.plte[s], I = D & 255, z = D >> 8 & 255, P = D >> 16 & 255; + A[o + T + 0] = I, A[o + T + 1] = z, A[o + T + 2] = P; } if (o += L * 3, v(A, o, p(A, o - L * 3 - 4, L * 3 + 4)), o += 4, g.gotAlpha) { v(A, o, L), o += 4, l(A, o, "tRNS"), o += 4; - for (var n = 0; n < L; n++) - A[o + n] = g.plte[n] >> 24 & 255; + for (var s = 0; s < L; s++) + A[o + s] = g.plte[s] >> 24 & 255; o += L, v(A, o, p(A, o - L - 4, L + 4)), o += 4; } } - for (var z = 0, F = 0; F < g.frames.length; F++) { + for (var B = 0, F = 0; F < g.frames.length; F++) { var N = g.frames[F]; - M && (v(A, o, 26), o += 4, l(A, o, "fcTL"), o += 4, v(A, o, z++), o += 4, v(A, o, N.rect.width), o += 4, v(A, o, N.rect.height), o += 4, v(A, o, N.rect.x), o += 4, v(A, o, N.rect.y), o += 4, a(A, o, C[F]), o += 2, a(A, o, 1e3), o += 2, A[o] = N.dispose, o++, A[o] = N.blend, o++, v(A, o, p(A, o - 30, 30)), o += 4); + M && (v(A, o, 26), o += 4, l(A, o, "fcTL"), o += 4, v(A, o, B++), o += 4, v(A, o, N.rect.width), o += 4, v(A, o, N.rect.height), o += 4, v(A, o, N.rect.x), o += 4, v(A, o, N.rect.y), o += 4, a(A, o, C[F]), o += 2, a(A, o, 1e3), o += 2, A[o] = N.dispose, o++, A[o] = N.blend, o++, v(A, o, p(A, o - 30, 30)), o += 4); var $ = N.cimg, L = $.length; v(A, o, L + (F == 0 ? 0 : 4)), o += 4; var k = o; - l(A, o, F == 0 ? "IDAT" : "fdAT"), o += 4, F != 0 && (v(A, o, z++), o += 4); - for (var n = 0; n < L; n++) - A[o + n] = $[n]; + l(A, o, F == 0 ? "IDAT" : "fdAT"), o += 4, F != 0 && (v(A, o, B++), o += 4); + for (var s = 0; s < L; s++) + A[o + s] = $[s]; o += L, v(A, o, p(A, k, o - k)), o += 4; } return v(A, o, 0), o += 4, l(A, o, "IEND"), o += 4, v(A, o, p(A, o - 4, 4)), o += 4, A.buffer.slice(0, o); - }, _.encode.compressPNG = function(h, u, E, c, C) { - for (var b = _.encode.compress(h, u, E, c, !1, C), A = 0; A < h.length; A++) { + }, u.encode.compressPNG = function(h, _, E, c, C) { + for (var b = u.encode.compress(h, _, E, c, !1, C), A = 0; A < h.length; A++) { var S = b.frames[A]; S.rect.width; - var n = S.rect.height, o = S.bpl, w = S.bpp, p = new Uint8Array(n * o + n); - S.cimg = _.encode._filterZero(S.img, n, w, o, p); + var s = S.rect.height, o = S.bpl, w = S.bpp, p = new Uint8Array(s * o + s); + S.cimg = u.encode._filterZero(S.img, s, w, o, p); } return b; - }, _.encode.compress = function(h, u, E, c, C, b) { + }, u.encode.compress = function(h, _, E, c, C, b) { b == null && (b = !1); - for (var A = 6, S = 8, n = 4, o = 255, w = 0; w < h.length; w++) + for (var A = 6, S = 8, s = 4, o = 255, w = 0; w < h.length; w++) for (var p = new Uint8Array(h[w]), v = p.length, a = 0; a < v; a += 4) o &= p[a + 3]; var l = o != 255, g = {}, M = []; if (h.length != 0 && (g[0] = 0, M.push(0), c != 0 && c--), c != 0) { - var L = _.quantize(h, c, C); + var L = u.quantize(h, c, C); h = L.bufs; for (var a = 0; a < L.plte.length; a++) { var T = L.plte[a].est.rgba; @@ -20384,30 +20384,30 @@ ATOM`, g); for (var w = 0; w < h.length; w++) for (var D = new Uint32Array(h[w]), v = D.length, a = 0; a < v; a++) { var T = D[a]; - if ((a < u || T != D[a - 1] && T != D[a - u]) && g[T] == null && (g[T] = M.length, M.push(T), M.length >= 300)) + if ((a < _ || T != D[a - 1] && T != D[a - _]) && g[T] == null && (g[T] = M.length, M.push(T), M.length >= 300)) break; } - var R = l ? C : !1, B = M.length; - B <= 256 && b == !1 && (B <= 2 ? S = 1 : B <= 4 ? S = 2 : B <= 16 ? S = 4 : S = 8, C && (S = 8), l = !0); + var I = l ? C : !1, z = M.length; + z <= 256 && b == !1 && (z <= 2 ? S = 1 : z <= 4 ? S = 2 : z <= 16 ? S = 4 : S = 8, C && (S = 8), l = !0); for (var P = [], w = 0; w < h.length; w++) { - var z = new Uint8Array(h[w]), F = new Uint32Array(z.buffer), N = 0, $ = 0, k = u, G = E, H = 0; - if (w != 0 && !R) { - for (var U = C || w == 1 || P[P.length - 2].dispose == 2 ? 1 : 2, V = 0, Q = 1e9, oe = 0; oe < U; oe++) { - for (var ae = new Uint8Array(h[w - 1 - oe]), ee = new Uint32Array(h[w - 1 - oe]), ne = u, me = E, se = -1, fe = -1, Ce = 0; Ce < E; Ce++) - for (var Me = 0; Me < u; Me++) { - var a = Ce * u + Me; - F[a] != ee[a] && (Me < ne && (ne = Me), Me > se && (se = Me), Ce < me && (me = Ce), Ce > fe && (fe = Ce)); + var B = new Uint8Array(h[w]), F = new Uint32Array(B.buffer), N = 0, $ = 0, k = _, G = E, H = 0; + if (w != 0 && !I) { + for (var U = C || w == 1 || P[P.length - 2].dispose == 2 ? 1 : 2, V = 0, Q = 1e9, ae = 0; ae < U; ae++) { + for (var se = new Uint8Array(h[w - 1 - ae]), oe = new Uint32Array(h[w - 1 - ae]), q = _, me = E, ne = -1, fe = -1, Ce = 0; Ce < E; Ce++) + for (var Me = 0; Me < _; Me++) { + var a = Ce * _ + Me; + F[a] != oe[a] && (Me < q && (q = Me), Me > ne && (ne = Me), Ce < me && (me = Ce), Ce > fe && (fe = Ce)); } - var Te = se == -1 ? 1 : (se - ne + 1) * (fe - me + 1); - Te < Q && (Q = Te, V = oe, se == -1 ? (N = $ = 0, k = G = 1) : (N = ne, $ = me, k = se - ne + 1, G = fe - me + 1)); + var Te = ne == -1 ? 1 : (ne - q + 1) * (fe - me + 1); + Te < Q && (Q = Te, V = ae, ne == -1 ? (N = $ = 0, k = G = 1) : (N = q, $ = me, k = ne - q + 1, G = fe - me + 1)); } - var ae = new Uint8Array(h[w - 1 - V]); + var se = new Uint8Array(h[w - 1 - V]); V == 1 && (P[P.length - 1].dispose = 2); var pe = new Uint8Array(k * G * 4); - new Uint32Array(pe.buffer), _._copyTile(ae, u, E, pe, k, G, -N, -$, 0), _._copyTile(z, u, E, pe, k, G, -N, -$, 3) ? (_._copyTile(z, u, E, pe, k, G, -N, -$, 2), H = 1) : (_._copyTile(z, u, E, pe, k, G, -N, -$, 0), H = 0), z = pe, F = new Uint32Array(z.buffer); + new Uint32Array(pe.buffer), u._copyTile(se, _, E, pe, k, G, -N, -$, 0), u._copyTile(B, _, E, pe, k, G, -N, -$, 3) ? (u._copyTile(B, _, E, pe, k, G, -N, -$, 2), H = 1) : (u._copyTile(B, _, E, pe, k, G, -N, -$, 0), H = 0), B = pe, F = new Uint32Array(B.buffer); } var we = 4 * k; - if (B <= 256 && b == !1) { + if (z <= 256 && b == !1) { we = Math.ceil(S * k / 8); for (var pe = new Uint8Array(we * G), Ce = 0; Ce < G; Ce++) { var a = Ce * we, ke = Ce * k; @@ -20424,139 +20424,139 @@ ATOM`, g); for (var Me = 0; Me < k; Me++) pe[a + (Me >> 3)] |= g[F[ke + Me]] << 7 - (Me & 7) * 1; } - z = pe, A = 3, n = 1; + B = pe, A = 3, s = 1; } else if (l == !1 && h.length == 1) { for (var pe = new Uint8Array(k * G * 3), Ue = k * G, a = 0; a < Ue; a++) { var Ne = a * 3, Be = a * 4; - pe[Ne] = z[Be], pe[Ne + 1] = z[Be + 1], pe[Ne + 2] = z[Be + 2]; + pe[Ne] = B[Be], pe[Ne + 1] = B[Be + 1], pe[Ne + 2] = B[Be + 2]; } - z = pe, A = 2, n = 3, we = 3 * k; + B = pe, A = 2, s = 3, we = 3 * k; } - P.push({ rect: { x: N, y: $, width: k, height: G }, img: z, bpl: we, bpp: n, blend: H, dispose: R ? 1 : 0 }); + P.push({ rect: { x: N, y: $, width: k, height: G }, img: B, bpl: we, bpp: s, blend: H, dispose: I ? 1 : 0 }); } return { ctype: A, depth: S, plte: M, gotAlpha: l, frames: P }; - }, _.encode._filterZero = function(h, u, E, c, C) { + }, u.encode._filterZero = function(h, _, E, c, C) { for (var b = [], A = 0; A < 5; A++) - if (!(u * c > 5e5 && (A == 2 || A == 3 || A == 4))) { - for (var S = 0; S < u; S++) - _.encode._filterLine(C, h, S, c, E, A); - if (b.push(x.deflate(C)), E == 1) + if (!(_ * c > 5e5 && (A == 2 || A == 3 || A == 4))) { + for (var S = 0; S < _; S++) + u.encode._filterLine(C, h, S, c, E, A); + if (b.push(y.deflate(C)), E == 1) break; } - for (var n, o = 1e9, w = 0; w < b.length; w++) - b[w].length < o && (n = w, o = b[w].length); - return b[n]; - }, _.encode._filterLine = function(h, u, E, c, C, b) { - var A = E * c, S = A + E, n = _.decode._paeth; + for (var s, o = 1e9, w = 0; w < b.length; w++) + b[w].length < o && (s = w, o = b[w].length); + return b[s]; + }, u.encode._filterLine = function(h, _, E, c, C, b) { + var A = E * c, S = A + E, s = u.decode._paeth; if (h[S] = b, S++, b == 0) for (var o = 0; o < c; o++) - h[S + o] = u[A + o]; + h[S + o] = _[A + o]; else if (b == 1) { for (var o = 0; o < C; o++) - h[S + o] = u[A + o]; + h[S + o] = _[A + o]; for (var o = C; o < c; o++) - h[S + o] = u[A + o] - u[A + o - C] + 256 & 255; + h[S + o] = _[A + o] - _[A + o - C] + 256 & 255; } else if (E == 0) { for (var o = 0; o < C; o++) - h[S + o] = u[A + o]; + h[S + o] = _[A + o]; if (b == 2) for (var o = C; o < c; o++) - h[S + o] = u[A + o]; + h[S + o] = _[A + o]; if (b == 3) for (var o = C; o < c; o++) - h[S + o] = u[A + o] - (u[A + o - C] >> 1) + 256 & 255; + h[S + o] = _[A + o] - (_[A + o - C] >> 1) + 256 & 255; if (b == 4) for (var o = C; o < c; o++) - h[S + o] = u[A + o] - n(u[A + o - C], 0, 0) + 256 & 255; + h[S + o] = _[A + o] - s(_[A + o - C], 0, 0) + 256 & 255; } else { if (b == 2) for (var o = 0; o < c; o++) - h[S + o] = u[A + o] + 256 - u[A + o - c] & 255; + h[S + o] = _[A + o] + 256 - _[A + o - c] & 255; if (b == 3) { for (var o = 0; o < C; o++) - h[S + o] = u[A + o] + 256 - (u[A + o - c] >> 1) & 255; + h[S + o] = _[A + o] + 256 - (_[A + o - c] >> 1) & 255; for (var o = C; o < c; o++) - h[S + o] = u[A + o] + 256 - (u[A + o - c] + u[A + o - C] >> 1) & 255; + h[S + o] = _[A + o] + 256 - (_[A + o - c] + _[A + o - C] >> 1) & 255; } if (b == 4) { for (var o = 0; o < C; o++) - h[S + o] = u[A + o] + 256 - n(0, u[A + o - c], 0) & 255; + h[S + o] = _[A + o] + 256 - s(0, _[A + o - c], 0) & 255; for (var o = C; o < c; o++) - h[S + o] = u[A + o] + 256 - n(u[A + o - C], u[A + o - c], u[A + o - C - c]) & 255; + h[S + o] = _[A + o] + 256 - s(_[A + o - C], _[A + o - c], _[A + o - C - c]) & 255; } } - }, _.crc = { + }, u.crc = { table: function() { - for (var h = new Uint32Array(256), u = 0; u < 256; u++) { - for (var E = u, c = 0; c < 8; c++) + for (var h = new Uint32Array(256), _ = 0; _ < 256; _++) { + for (var E = _, c = 0; c < 8; c++) E & 1 ? E = 3988292384 ^ E >>> 1 : E = E >>> 1; - h[u] = E; + h[_] = E; } return h; }(), - update: function(h, u, E, c) { + update: function(h, _, E, c) { for (var C = 0; C < c; C++) - h = _.crc.table[(h ^ u[E + C]) & 255] ^ h >>> 8; + h = u.crc.table[(h ^ _[E + C]) & 255] ^ h >>> 8; return h; }, - crc: function(h, u, E) { - return _.crc.update(4294967295, h, u, E) ^ 4294967295; + crc: function(h, _, E) { + return u.crc.update(4294967295, h, _, E) ^ 4294967295; } - }, _.quantize = function(h, u, E) { + }, u.quantize = function(h, _, E) { for (var c = [], C = 0, b = 0; b < h.length; b++) - c.push(_.encode.alphaMul(new Uint8Array(h[b]), E)), C += h[b].byteLength; - for (var A = new Uint8Array(C), S = new Uint32Array(A.buffer), n = 0, b = 0; b < c.length; b++) { + c.push(u.encode.alphaMul(new Uint8Array(h[b]), E)), C += h[b].byteLength; + for (var A = new Uint8Array(C), S = new Uint32Array(A.buffer), s = 0, b = 0; b < c.length; b++) { for (var o = c[b], w = o.length, p = 0; p < w; p++) - A[n + p] = o[p]; - n += w; + A[s + p] = o[p]; + s += w; } var v = { i0: 0, i1: A.length, bst: null, est: null, tdst: 0, left: null, right: null }; - v.bst = _.quantize.stats(A, v.i0, v.i1), v.est = _.quantize.estats(v.bst); - for (var a = [v]; a.length < u; ) { + v.bst = u.quantize.stats(A, v.i0, v.i1), v.est = u.quantize.estats(v.bst); + for (var a = [v]; a.length < _; ) { for (var l = 0, g = 0, b = 0; b < a.length; b++) a[b].est.L > l && (l = a[b].est.L, g = b); if (l < 1e-3) break; - var M = a[g], L = _.quantize.splitPixels(A, S, M.i0, M.i1, M.est.e, M.est.eMq255), T = { i0: M.i0, i1: L, bst: null, est: null, tdst: 0, left: null, right: null }; - T.bst = _.quantize.stats(A, T.i0, T.i1), T.est = _.quantize.estats(T.bst); + var M = a[g], L = u.quantize.splitPixels(A, S, M.i0, M.i1, M.est.e, M.est.eMq255), T = { i0: M.i0, i1: L, bst: null, est: null, tdst: 0, left: null, right: null }; + T.bst = u.quantize.stats(A, T.i0, T.i1), T.est = u.quantize.estats(T.bst); var D = { i0: L, i1: M.i1, bst: null, est: null, tdst: 0, left: null, right: null }; D.bst = { R: [], m: [], N: M.bst.N - T.bst.N }; for (var b = 0; b < 16; b++) D.bst.R[b] = M.bst.R[b] - T.bst.R[b]; for (var b = 0; b < 4; b++) D.bst.m[b] = M.bst.m[b] - T.bst.m[b]; - D.est = _.quantize.estats(D.bst), M.left = T, M.right = D, a[g] = T, a.push(D); + D.est = u.quantize.estats(D.bst), M.left = T, M.right = D, a[g] = T, a.push(D); } a.sort(function(U, V) { return V.bst.N - U.bst.N; }); - for (var R = 0; R < c.length; R++) { - for (var B = _.quantize.planeDst, P = new Uint8Array(c[R].buffer), z = new Uint32Array(c[R].buffer), F = P.length, b = 0; b < F; b += 4) { + for (var I = 0; I < c.length; I++) { + for (var z = u.quantize.planeDst, P = new Uint8Array(c[I].buffer), B = new Uint32Array(c[I].buffer), F = P.length, b = 0; b < F; b += 4) { for (var N = P[b] * 0.00392156862745098, $ = P[b + 1] * (1 / 255), k = P[b + 2] * (1 / 255), G = P[b + 3] * (1 / 255), H = v; H.left; ) - H = B(H.est, N, $, k, G) <= 0 ? H.left : H.right; - z[b >> 2] = H.est.rgba; + H = z(H.est, N, $, k, G) <= 0 ? H.left : H.right; + B[b >> 2] = H.est.rgba; } - c[R] = z.buffer; + c[I] = B.buffer; } return { bufs: c, plte: a }; - }, _.quantize.getNearest = function(h, u, E, c, C) { + }, u.quantize.getNearest = function(h, _, E, c, C) { if (h.left == null) - return h.tdst = _.quantize.dist(h.est.q, u, E, c, C), h; - var b = _.quantize.planeDst(h.est, u, E, c, C), A = h.left, S = h.right; + return h.tdst = u.quantize.dist(h.est.q, _, E, c, C), h; + var b = u.quantize.planeDst(h.est, _, E, c, C), A = h.left, S = h.right; b > 0 && (A = h.right, S = h.left); - var n = _.quantize.getNearest(A, u, E, c, C); - if (n.tdst <= b * b) - return n; - var o = _.quantize.getNearest(S, u, E, c, C); - return o.tdst < n.tdst ? o : n; - }, _.quantize.planeDst = function(h, u, E, c, C) { + var s = u.quantize.getNearest(A, _, E, c, C); + if (s.tdst <= b * b) + return s; + var o = u.quantize.getNearest(S, _, E, c, C); + return o.tdst < s.tdst ? o : s; + }, u.quantize.planeDst = function(h, _, E, c, C) { var b = h.e; - return b[0] * u + b[1] * E + b[2] * c + b[3] * C - h.eMq; - }, _.quantize.dist = function(h, u, E, c, C) { - var b = u - h[0], A = E - h[1], S = c - h[2], n = C - h[3]; - return b * b + A * A + S * S + n * n; - }, _.quantize.splitPixels = function(h, u, E, c, C, b) { - var A = _.quantize.vecDot; + return b[0] * _ + b[1] * E + b[2] * c + b[3] * C - h.eMq; + }, u.quantize.dist = function(h, _, E, c, C) { + var b = _ - h[0], A = E - h[1], S = c - h[2], s = C - h[3]; + return b * b + A * A + S * S + s * s; + }, u.quantize.splitPixels = function(h, _, E, c, C, b) { + var A = u.quantize.vecDot; for (c -= 4; E < c; ) { for (; A(h, E, C) <= b; ) E += 4; @@ -20564,43 +20564,43 @@ ATOM`, g); c -= 4; if (E >= c) break; - var S = u[E >> 2]; - u[E >> 2] = u[c >> 2], u[c >> 2] = S, E += 4, c -= 4; + var S = _[E >> 2]; + _[E >> 2] = _[c >> 2], _[c >> 2] = S, E += 4, c -= 4; } for (; A(h, E, C) > b; ) E -= 4; return E + 4; - }, _.quantize.vecDot = function(h, u, E) { - return h[u] * E[0] + h[u + 1] * E[1] + h[u + 2] * E[2] + h[u + 3] * E[3]; - }, _.quantize.stats = function(h, u, E) { - for (var c = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], C = [0, 0, 0, 0], b = E - u >> 2, A = u; A < E; A += 4) { - var S = h[A] * 0.00392156862745098, n = h[A + 1] * (1 / 255), o = h[A + 2] * (1 / 255), w = h[A + 3] * (1 / 255); - C[0] += S, C[1] += n, C[2] += o, C[3] += w, c[0] += S * S, c[1] += S * n, c[2] += S * o, c[3] += S * w, c[5] += n * n, c[6] += n * o, c[7] += n * w, c[10] += o * o, c[11] += o * w, c[15] += w * w; + }, u.quantize.vecDot = function(h, _, E) { + return h[_] * E[0] + h[_ + 1] * E[1] + h[_ + 2] * E[2] + h[_ + 3] * E[3]; + }, u.quantize.stats = function(h, _, E) { + for (var c = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], C = [0, 0, 0, 0], b = E - _ >> 2, A = _; A < E; A += 4) { + var S = h[A] * 0.00392156862745098, s = h[A + 1] * (1 / 255), o = h[A + 2] * (1 / 255), w = h[A + 3] * (1 / 255); + C[0] += S, C[1] += s, C[2] += o, C[3] += w, c[0] += S * S, c[1] += S * s, c[2] += S * o, c[3] += S * w, c[5] += s * s, c[6] += s * o, c[7] += s * w, c[10] += o * o, c[11] += o * w, c[15] += w * w; } return c[4] = c[1], c[8] = c[2], c[12] = c[3], c[9] = c[6], c[13] = c[7], c[14] = c[11], { R: c, m: C, N: b }; - }, _.quantize.estats = function(h) { - var u = h.R, E = h.m, c = h.N, C = E[0], b = E[1], A = E[2], S = E[3], n = c == 0 ? 0 : 1 / c, o = [ - u[0] - C * C * n, - u[1] - C * b * n, - u[2] - C * A * n, - u[3] - C * S * n, - u[4] - b * C * n, - u[5] - b * b * n, - u[6] - b * A * n, - u[7] - b * S * n, - u[8] - A * C * n, - u[9] - A * b * n, - u[10] - A * A * n, - u[11] - A * S * n, - u[12] - S * C * n, - u[13] - S * b * n, - u[14] - S * A * n, - u[15] - S * S * n - ], w = o, p = _.M4, v = [0.5, 0.5, 0.5, 0.5], a = 0, l = 0; + }, u.quantize.estats = function(h) { + var _ = h.R, E = h.m, c = h.N, C = E[0], b = E[1], A = E[2], S = E[3], s = c == 0 ? 0 : 1 / c, o = [ + _[0] - C * C * s, + _[1] - C * b * s, + _[2] - C * A * s, + _[3] - C * S * s, + _[4] - b * C * s, + _[5] - b * b * s, + _[6] - b * A * s, + _[7] - b * S * s, + _[8] - A * C * s, + _[9] - A * b * s, + _[10] - A * A * s, + _[11] - A * S * s, + _[12] - S * C * s, + _[13] - S * b * s, + _[14] - S * A * s, + _[15] - S * S * s + ], w = o, p = u.M4, v = [0.5, 0.5, 0.5, 0.5], a = 0, l = 0; if (c != 0) for (var g = 0; g < 10 && (v = p.multVec(w, v), l = Math.sqrt(p.dot(v, v)), v = p.sml(1 / l, v), !(Math.abs(l - a) < 1e-9)); g++) a = l; - var M = [C * n, b * n, A * n, S * n], L = p.dot(p.sml(255, M), v), T = M[3] < 1e-3 ? 0 : 1 / M[3]; + var M = [C * s, b * s, A * s, S * s], L = p.dot(p.sml(255, M), v), T = M[3] < 1e-3 ? 0 : 1 / M[3]; return { Cov: o, q: M, @@ -20610,31 +20610,31 @@ ATOM`, g); eMq: p.dot(v, M), rgba: (Math.round(255 * M[3]) << 24 | Math.round(255 * M[2] * T) << 16 | Math.round(255 * M[1] * T) << 8 | Math.round(255 * M[0] * T) << 0) >>> 0 }; - }, _.M4 = { - multVec: function(h, u) { + }, u.M4 = { + multVec: function(h, _) { return [ - h[0] * u[0] + h[1] * u[1] + h[2] * u[2] + h[3] * u[3], - h[4] * u[0] + h[5] * u[1] + h[6] * u[2] + h[7] * u[3], - h[8] * u[0] + h[9] * u[1] + h[10] * u[2] + h[11] * u[3], - h[12] * u[0] + h[13] * u[1] + h[14] * u[2] + h[15] * u[3] + h[0] * _[0] + h[1] * _[1] + h[2] * _[2] + h[3] * _[3], + h[4] * _[0] + h[5] * _[1] + h[6] * _[2] + h[7] * _[3], + h[8] * _[0] + h[9] * _[1] + h[10] * _[2] + h[11] * _[3], + h[12] * _[0] + h[13] * _[1] + h[14] * _[2] + h[15] * _[3] ]; }, - dot: function(h, u) { - return h[0] * u[0] + h[1] * u[1] + h[2] * u[2] + h[3] * u[3]; + dot: function(h, _) { + return h[0] * _[0] + h[1] * _[1] + h[2] * _[2] + h[3] * _[3]; }, - sml: function(h, u) { - return [h * u[0], h * u[1], h * u[2], h * u[3]]; + sml: function(h, _) { + return [h * _[0], h * _[1], h * _[2], h * _[3]]; } - }, _.encode.alphaMul = function(h, u) { + }, u.encode.alphaMul = function(h, _) { for (var E = new Uint8Array(h.length), c = h.length >> 2, C = 0; C < c; C++) { var b = C << 2, A = h[b + 3]; - u && (A = A < 128 ? 0 : 255); + _ && (A = A < 128 ? 0 : 255); var S = A * (1 / 255); E[b + 0] = h[b + 0] * S, E[b + 1] = h[b + 1] * S, E[b + 2] = h[b + 2] * S, E[b + 3] = A; } return E; }; - }(s, f); + }(n, f); })(); } ), @@ -20645,20 +20645,20 @@ ATOM`, g); \*********************************************************/ /***/ (r, e, t) => { - var s = t( + var n = t( /*! ./lib/utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" ).assign, f = t( /*! ./lib/deflate */ "./node_modules/upng-js/node_modules/pako/lib/deflate.js" - ), _ = t( + ), u = t( /*! ./lib/inflate */ "./node_modules/upng-js/node_modules/pako/lib/inflate.js" - ), x = t( + ), y = t( /*! ./lib/zlib/constants */ "./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js" ), h = {}; - s(h, f, _, x), r.exports = h; + n(h, f, u, y), r.exports = h; } ), /***/ @@ -20668,22 +20668,22 @@ ATOM`, g); \***************************************************************/ /***/ (r, e, t) => { - var s = t( + var n = t( /*! ./zlib/deflate */ "./node_modules/upng-js/node_modules/pako/lib/zlib/deflate.js" ), f = t( /*! ./utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), _ = t( + ), u = t( /*! ./utils/strings */ "./node_modules/upng-js/node_modules/pako/lib/utils/strings.js" - ), x = t( + ), y = t( /*! ./zlib/messages */ "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js" ), h = t( /*! ./zlib/zstream */ "./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js" - ), u = Object.prototype.toString, E = 0, c = 4, C = 0, b = 1, A = 2, S = -1, n = 0, o = 8; + ), _ = Object.prototype.toString, E = 0, c = 4, C = 0, b = 1, A = 2, S = -1, s = 0, o = 8; function w(l) { if (!(this instanceof w)) return new w(l); @@ -20693,12 +20693,12 @@ ATOM`, g); chunkSize: 16384, windowBits: 15, memLevel: 8, - strategy: n, + strategy: s, to: "" }, l || {}); var g = this.options; g.raw && g.windowBits > 0 ? g.windowBits = -g.windowBits : g.gzip && g.windowBits > 0 && g.windowBits < 16 && (g.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new h(), this.strm.avail_out = 0; - var M = s.deflateInit2( + var M = n.deflateInit2( this.strm, g.level, g.method, @@ -20707,11 +20707,11 @@ ATOM`, g); g.strategy ); if (M !== C) - throw new Error(x[M]); - if (g.header && s.deflateSetHeader(this.strm, g.header), g.dictionary) { + throw new Error(y[M]); + if (g.header && n.deflateSetHeader(this.strm, g.header), g.dictionary) { var L; - if (typeof g.dictionary == "string" ? L = _.string2buf(g.dictionary) : u.call(g.dictionary) === "[object ArrayBuffer]" ? L = new Uint8Array(g.dictionary) : L = g.dictionary, M = s.deflateSetDictionary(this.strm, L), M !== C) - throw new Error(x[M]); + if (typeof g.dictionary == "string" ? L = u.string2buf(g.dictionary) : _.call(g.dictionary) === "[object ArrayBuffer]" ? L = new Uint8Array(g.dictionary) : L = g.dictionary, M = n.deflateSetDictionary(this.strm, L), M !== C) + throw new Error(y[M]); this._dict_set = !0; } } @@ -20719,13 +20719,13 @@ ATOM`, g); var M = this.strm, L = this.options.chunkSize, T, D; if (this.ended) return !1; - D = g === ~~g ? g : g === !0 ? c : E, typeof l == "string" ? M.input = _.string2buf(l) : u.call(l) === "[object ArrayBuffer]" ? M.input = new Uint8Array(l) : M.input = l, M.next_in = 0, M.avail_in = M.input.length; + D = g === ~~g ? g : g === !0 ? c : E, typeof l == "string" ? M.input = u.string2buf(l) : _.call(l) === "[object ArrayBuffer]" ? M.input = new Uint8Array(l) : M.input = l, M.next_in = 0, M.avail_in = M.input.length; do { - if (M.avail_out === 0 && (M.output = new f.Buf8(L), M.next_out = 0, M.avail_out = L), T = s.deflate(M, D), T !== b && T !== C) + if (M.avail_out === 0 && (M.output = new f.Buf8(L), M.next_out = 0, M.avail_out = L), T = n.deflate(M, D), T !== b && T !== C) return this.onEnd(T), this.ended = !0, !1; - (M.avail_out === 0 || M.avail_in === 0 && (D === c || D === A)) && (this.options.to === "string" ? this.onData(_.buf2binstring(f.shrinkBuf(M.output, M.next_out))) : this.onData(f.shrinkBuf(M.output, M.next_out))); + (M.avail_out === 0 || M.avail_in === 0 && (D === c || D === A)) && (this.options.to === "string" ? this.onData(u.buf2binstring(f.shrinkBuf(M.output, M.next_out))) : this.onData(f.shrinkBuf(M.output, M.next_out))); } while ((M.avail_in > 0 || M.avail_out === 0) && T !== b); - return D === c ? (T = s.deflateEnd(this.strm), this.onEnd(T), this.ended = !0, T === C) : (D === A && (this.onEnd(C), M.avail_out = 0), !0); + return D === c ? (T = n.deflateEnd(this.strm), this.onEnd(T), this.ended = !0, T === C) : (D === A && (this.onEnd(C), M.avail_out = 0), !0); }, w.prototype.onData = function(l) { this.chunks.push(l); }, w.prototype.onEnd = function(l) { @@ -20734,7 +20734,7 @@ ATOM`, g); function p(l, g) { var M = new w(g); if (M.push(l, !0), M.err) - throw M.msg || x[M.err]; + throw M.msg || y[M.err]; return M.result; } function v(l, g) { @@ -20753,22 +20753,22 @@ ATOM`, g); \***************************************************************/ /***/ (r, e, t) => { - var s = t( + var n = t( /*! ./zlib/inflate */ "./node_modules/upng-js/node_modules/pako/lib/zlib/inflate.js" ), f = t( /*! ./utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), _ = t( + ), u = t( /*! ./utils/strings */ "./node_modules/upng-js/node_modules/pako/lib/utils/strings.js" - ), x = t( + ), y = t( /*! ./zlib/constants */ "./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js" ), h = t( /*! ./zlib/messages */ "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js" - ), u = t( + ), _ = t( /*! ./zlib/zstream */ "./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js" ), E = t( @@ -20783,41 +20783,41 @@ ATOM`, g); windowBits: 0, to: "" }, S || {}); - var n = this.options; - n.raw && n.windowBits >= 0 && n.windowBits < 16 && (n.windowBits = -n.windowBits, n.windowBits === 0 && (n.windowBits = -15)), n.windowBits >= 0 && n.windowBits < 16 && !(S && S.windowBits) && (n.windowBits += 32), n.windowBits > 15 && n.windowBits < 48 && (n.windowBits & 15 || (n.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new u(), this.strm.avail_out = 0; - var o = s.inflateInit2( + var s = this.options; + s.raw && s.windowBits >= 0 && s.windowBits < 16 && (s.windowBits = -s.windowBits, s.windowBits === 0 && (s.windowBits = -15)), s.windowBits >= 0 && s.windowBits < 16 && !(S && S.windowBits) && (s.windowBits += 32), s.windowBits > 15 && s.windowBits < 48 && (s.windowBits & 15 || (s.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new _(), this.strm.avail_out = 0; + var o = n.inflateInit2( this.strm, - n.windowBits + s.windowBits ); - if (o !== x.Z_OK) + if (o !== y.Z_OK) throw new Error(h[o]); - if (this.header = new E(), s.inflateGetHeader(this.strm, this.header), n.dictionary && (typeof n.dictionary == "string" ? n.dictionary = _.string2buf(n.dictionary) : c.call(n.dictionary) === "[object ArrayBuffer]" && (n.dictionary = new Uint8Array(n.dictionary)), n.raw && (o = s.inflateSetDictionary(this.strm, n.dictionary), o !== x.Z_OK))) + if (this.header = new E(), n.inflateGetHeader(this.strm, this.header), s.dictionary && (typeof s.dictionary == "string" ? s.dictionary = u.string2buf(s.dictionary) : c.call(s.dictionary) === "[object ArrayBuffer]" && (s.dictionary = new Uint8Array(s.dictionary)), s.raw && (o = n.inflateSetDictionary(this.strm, s.dictionary), o !== y.Z_OK))) throw new Error(h[o]); } - C.prototype.push = function(S, n) { + C.prototype.push = function(S, s) { var o = this.strm, w = this.options.chunkSize, p = this.options.dictionary, v, a, l, g, M, L = !1; if (this.ended) return !1; - a = n === ~~n ? n : n === !0 ? x.Z_FINISH : x.Z_NO_FLUSH, typeof S == "string" ? o.input = _.binstring2buf(S) : c.call(S) === "[object ArrayBuffer]" ? o.input = new Uint8Array(S) : o.input = S, o.next_in = 0, o.avail_in = o.input.length; + a = s === ~~s ? s : s === !0 ? y.Z_FINISH : y.Z_NO_FLUSH, typeof S == "string" ? o.input = u.binstring2buf(S) : c.call(S) === "[object ArrayBuffer]" ? o.input = new Uint8Array(S) : o.input = S, o.next_in = 0, o.avail_in = o.input.length; do { - if (o.avail_out === 0 && (o.output = new f.Buf8(w), o.next_out = 0, o.avail_out = w), v = s.inflate(o, x.Z_NO_FLUSH), v === x.Z_NEED_DICT && p && (v = s.inflateSetDictionary(this.strm, p)), v === x.Z_BUF_ERROR && L === !0 && (v = x.Z_OK, L = !1), v !== x.Z_STREAM_END && v !== x.Z_OK) + if (o.avail_out === 0 && (o.output = new f.Buf8(w), o.next_out = 0, o.avail_out = w), v = n.inflate(o, y.Z_NO_FLUSH), v === y.Z_NEED_DICT && p && (v = n.inflateSetDictionary(this.strm, p)), v === y.Z_BUF_ERROR && L === !0 && (v = y.Z_OK, L = !1), v !== y.Z_STREAM_END && v !== y.Z_OK) return this.onEnd(v), this.ended = !0, !1; - o.next_out && (o.avail_out === 0 || v === x.Z_STREAM_END || o.avail_in === 0 && (a === x.Z_FINISH || a === x.Z_SYNC_FLUSH)) && (this.options.to === "string" ? (l = _.utf8border(o.output, o.next_out), g = o.next_out - l, M = _.buf2string(o.output, l), o.next_out = g, o.avail_out = w - g, g && f.arraySet(o.output, o.output, l, g, 0), this.onData(M)) : this.onData(f.shrinkBuf(o.output, o.next_out))), o.avail_in === 0 && o.avail_out === 0 && (L = !0); - } while ((o.avail_in > 0 || o.avail_out === 0) && v !== x.Z_STREAM_END); - return v === x.Z_STREAM_END && (a = x.Z_FINISH), a === x.Z_FINISH ? (v = s.inflateEnd(this.strm), this.onEnd(v), this.ended = !0, v === x.Z_OK) : (a === x.Z_SYNC_FLUSH && (this.onEnd(x.Z_OK), o.avail_out = 0), !0); + o.next_out && (o.avail_out === 0 || v === y.Z_STREAM_END || o.avail_in === 0 && (a === y.Z_FINISH || a === y.Z_SYNC_FLUSH)) && (this.options.to === "string" ? (l = u.utf8border(o.output, o.next_out), g = o.next_out - l, M = u.buf2string(o.output, l), o.next_out = g, o.avail_out = w - g, g && f.arraySet(o.output, o.output, l, g, 0), this.onData(M)) : this.onData(f.shrinkBuf(o.output, o.next_out))), o.avail_in === 0 && o.avail_out === 0 && (L = !0); + } while ((o.avail_in > 0 || o.avail_out === 0) && v !== y.Z_STREAM_END); + return v === y.Z_STREAM_END && (a = y.Z_FINISH), a === y.Z_FINISH ? (v = n.inflateEnd(this.strm), this.onEnd(v), this.ended = !0, v === y.Z_OK) : (a === y.Z_SYNC_FLUSH && (this.onEnd(y.Z_OK), o.avail_out = 0), !0); }, C.prototype.onData = function(S) { this.chunks.push(S); }, C.prototype.onEnd = function(S) { - S === x.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = f.flattenChunks(this.chunks)), this.chunks = [], this.err = S, this.msg = this.strm.msg; + S === y.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = f.flattenChunks(this.chunks)), this.chunks = [], this.err = S, this.msg = this.strm.msg; }; - function b(S, n) { - var o = new C(n); + function b(S, s) { + var o = new C(s); if (o.push(S, !0), o.err) throw o.msg || h[o.err]; return o.result; } - function A(S, n) { - return n = n || {}, n.raw = !0, b(S, n); + function A(S, s) { + return s = s || {}, s.raw = !0, b(S, s); } e.Inflate = C, e.inflate = b, e.inflateRaw = A, e.ungzip = b; } @@ -20830,53 +20830,53 @@ ATOM`, g); /***/ (r, e) => { var t = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Int32Array < "u"; - function s(x, h) { - return Object.prototype.hasOwnProperty.call(x, h); + function n(y, h) { + return Object.prototype.hasOwnProperty.call(y, h); } - e.assign = function(x) { + e.assign = function(y) { for (var h = Array.prototype.slice.call(arguments, 1); h.length; ) { - var u = h.shift(); - if (u) { - if (typeof u != "object") - throw new TypeError(u + "must be non-object"); - for (var E in u) - s(u, E) && (x[E] = u[E]); + var _ = h.shift(); + if (_) { + if (typeof _ != "object") + throw new TypeError(_ + "must be non-object"); + for (var E in _) + n(_, E) && (y[E] = _[E]); } } - return x; - }, e.shrinkBuf = function(x, h) { - return x.length === h ? x : x.subarray ? x.subarray(0, h) : (x.length = h, x); + return y; + }, e.shrinkBuf = function(y, h) { + return y.length === h ? y : y.subarray ? y.subarray(0, h) : (y.length = h, y); }; var f = { - arraySet: function(x, h, u, E, c) { - if (h.subarray && x.subarray) { - x.set(h.subarray(u, u + E), c); + arraySet: function(y, h, _, E, c) { + if (h.subarray && y.subarray) { + y.set(h.subarray(_, _ + E), c); return; } for (var C = 0; C < E; C++) - x[c + C] = h[u + C]; + y[c + C] = h[_ + C]; }, // Join array of chunks to single array. - flattenChunks: function(x) { - var h, u, E, c, C, b; - for (E = 0, h = 0, u = x.length; h < u; h++) - E += x[h].length; - for (b = new Uint8Array(E), c = 0, h = 0, u = x.length; h < u; h++) - C = x[h], b.set(C, c), c += C.length; + flattenChunks: function(y) { + var h, _, E, c, C, b; + for (E = 0, h = 0, _ = y.length; h < _; h++) + E += y[h].length; + for (b = new Uint8Array(E), c = 0, h = 0, _ = y.length; h < _; h++) + C = y[h], b.set(C, c), c += C.length; return b; } - }, _ = { - arraySet: function(x, h, u, E, c) { + }, u = { + arraySet: function(y, h, _, E, c) { for (var C = 0; C < E; C++) - x[c + C] = h[u + C]; + y[c + C] = h[_ + C]; }, // Join array of chunks to single array. - flattenChunks: function(x) { - return [].concat.apply([], x); + flattenChunks: function(y) { + return [].concat.apply([], y); } }; - e.setTyped = function(x) { - x ? (e.Buf8 = Uint8Array, e.Buf16 = Uint16Array, e.Buf32 = Int32Array, e.assign(e, f)) : (e.Buf8 = Array, e.Buf16 = Array, e.Buf32 = Array, e.assign(e, _)); + e.setTyped = function(y) { + y ? (e.Buf8 = Uint8Array, e.Buf16 = Uint16Array, e.Buf32 = Int32Array, e.assign(e, f)) : (e.Buf8 = Array, e.Buf16 = Array, e.Buf32 = Array, e.assign(e, u)); }, e.setTyped(t); } ), @@ -20887,10 +20887,10 @@ ATOM`, g); \*********************************************************************/ /***/ (r, e, t) => { - var s = t( + var n = t( /*! ./common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), f = !0, _ = !0; + ), f = !0, u = !0; try { String.fromCharCode.apply(null, [0]); } catch { @@ -20899,43 +20899,43 @@ ATOM`, g); try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch { - _ = !1; + u = !1; } - for (var x = new s.Buf8(256), h = 0; h < 256; h++) - x[h] = h >= 252 ? 6 : h >= 248 ? 5 : h >= 240 ? 4 : h >= 224 ? 3 : h >= 192 ? 2 : 1; - x[254] = x[254] = 1, e.string2buf = function(E) { - var c, C, b, A, S, n = E.length, o = 0; - for (A = 0; A < n; A++) - C = E.charCodeAt(A), (C & 64512) === 55296 && A + 1 < n && (b = E.charCodeAt(A + 1), (b & 64512) === 56320 && (C = 65536 + (C - 55296 << 10) + (b - 56320), A++)), o += C < 128 ? 1 : C < 2048 ? 2 : C < 65536 ? 3 : 4; - for (c = new s.Buf8(o), S = 0, A = 0; S < o; A++) - C = E.charCodeAt(A), (C & 64512) === 55296 && A + 1 < n && (b = E.charCodeAt(A + 1), (b & 64512) === 56320 && (C = 65536 + (C - 55296 << 10) + (b - 56320), A++)), C < 128 ? c[S++] = C : C < 2048 ? (c[S++] = 192 | C >>> 6, c[S++] = 128 | C & 63) : C < 65536 ? (c[S++] = 224 | C >>> 12, c[S++] = 128 | C >>> 6 & 63, c[S++] = 128 | C & 63) : (c[S++] = 240 | C >>> 18, c[S++] = 128 | C >>> 12 & 63, c[S++] = 128 | C >>> 6 & 63, c[S++] = 128 | C & 63); + for (var y = new n.Buf8(256), h = 0; h < 256; h++) + y[h] = h >= 252 ? 6 : h >= 248 ? 5 : h >= 240 ? 4 : h >= 224 ? 3 : h >= 192 ? 2 : 1; + y[254] = y[254] = 1, e.string2buf = function(E) { + var c, C, b, A, S, s = E.length, o = 0; + for (A = 0; A < s; A++) + C = E.charCodeAt(A), (C & 64512) === 55296 && A + 1 < s && (b = E.charCodeAt(A + 1), (b & 64512) === 56320 && (C = 65536 + (C - 55296 << 10) + (b - 56320), A++)), o += C < 128 ? 1 : C < 2048 ? 2 : C < 65536 ? 3 : 4; + for (c = new n.Buf8(o), S = 0, A = 0; S < o; A++) + C = E.charCodeAt(A), (C & 64512) === 55296 && A + 1 < s && (b = E.charCodeAt(A + 1), (b & 64512) === 56320 && (C = 65536 + (C - 55296 << 10) + (b - 56320), A++)), C < 128 ? c[S++] = C : C < 2048 ? (c[S++] = 192 | C >>> 6, c[S++] = 128 | C & 63) : C < 65536 ? (c[S++] = 224 | C >>> 12, c[S++] = 128 | C >>> 6 & 63, c[S++] = 128 | C & 63) : (c[S++] = 240 | C >>> 18, c[S++] = 128 | C >>> 12 & 63, c[S++] = 128 | C >>> 6 & 63, c[S++] = 128 | C & 63); return c; }; - function u(E, c) { - if (c < 65534 && (E.subarray && _ || !E.subarray && f)) - return String.fromCharCode.apply(null, s.shrinkBuf(E, c)); + function _(E, c) { + if (c < 65534 && (E.subarray && u || !E.subarray && f)) + return String.fromCharCode.apply(null, n.shrinkBuf(E, c)); for (var C = "", b = 0; b < c; b++) C += String.fromCharCode(E[b]); return C; } e.buf2binstring = function(E) { - return u(E, E.length); + return _(E, E.length); }, e.binstring2buf = function(E) { - for (var c = new s.Buf8(E.length), C = 0, b = c.length; C < b; C++) + for (var c = new n.Buf8(E.length), C = 0, b = c.length; C < b; C++) c[C] = E.charCodeAt(C); return c; }, e.buf2string = function(E, c) { - var C, b, A, S, n = c || E.length, o = new Array(n * 2); - for (b = 0, C = 0; C < n; ) { + var C, b, A, S, s = c || E.length, o = new Array(s * 2); + for (b = 0, C = 0; C < s; ) { if (A = E[C++], A < 128) { o[b++] = A; continue; } - if (S = x[A], S > 4) { + if (S = y[A], S > 4) { o[b++] = 65533, C += S - 1; continue; } - for (A &= S === 2 ? 31 : S === 3 ? 15 : 7; S > 1 && C < n; ) + for (A &= S === 2 ? 31 : S === 3 ? 15 : 7; S > 1 && C < s; ) A = A << 6 | E[C++] & 63, S--; if (S > 1) { o[b++] = 65533; @@ -20943,12 +20943,12 @@ ATOM`, g); } A < 65536 ? o[b++] = A : (A -= 65536, o[b++] = 55296 | A >> 10 & 1023, o[b++] = 56320 | A & 1023); } - return u(o, b); + return _(o, b); }, e.utf8border = function(E, c) { var C; for (c = c || E.length, c > E.length && (c = E.length), C = c - 1; C >= 0 && (E[C] & 192) === 128; ) C--; - return C < 0 || C === 0 ? c : C + x[E[C]] > c ? C : c; + return C < 0 || C === 0 ? c : C + y[E[C]] > c ? C : c; }; } ), @@ -20959,15 +20959,15 @@ ATOM`, g); \********************************************************************/ /***/ (r) => { - function e(t, s, f, _) { - for (var x = t & 65535 | 0, h = t >>> 16 & 65535 | 0, u = 0; f !== 0; ) { - u = f > 2e3 ? 2e3 : f, f -= u; + function e(t, n, f, u) { + for (var y = t & 65535 | 0, h = t >>> 16 & 65535 | 0, _ = 0; f !== 0; ) { + _ = f > 2e3 ? 2e3 : f, f -= _; do - x = x + s[_++] | 0, h = h + x | 0; - while (--u); - x %= 65521, h %= 65521; + y = y + n[u++] | 0, h = h + y | 0; + while (--_); + y %= 65521, h %= 65521; } - return x | h << 16 | 0; + return y | h << 16 | 0; } r.exports = e; } @@ -21029,23 +21029,23 @@ ATOM`, g); /***/ (r) => { function e() { - for (var f, _ = [], x = 0; x < 256; x++) { - f = x; + for (var f, u = [], y = 0; y < 256; y++) { + f = y; for (var h = 0; h < 8; h++) f = f & 1 ? 3988292384 ^ f >>> 1 : f >>> 1; - _[x] = f; + u[y] = f; } - return _; + return u; } var t = e(); - function s(f, _, x, h) { - var u = t, E = h + x; + function n(f, u, y, h) { + var _ = t, E = h + y; f ^= -1; for (var c = h; c < E; c++) - f = f >>> 8 ^ u[(f ^ _[c]) & 255]; + f = f >>> 8 ^ _[(f ^ u[c]) & 255]; return f ^ -1; } - r.exports = s; + r.exports = n; } ), /***/ @@ -21055,52 +21055,52 @@ ATOM`, g); \********************************************************************/ /***/ (r, e, t) => { - var s = t( + var n = t( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" ), f = t( /*! ./trees */ "./node_modules/upng-js/node_modules/pako/lib/zlib/trees.js" - ), _ = t( + ), u = t( /*! ./adler32 */ "./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js" - ), x = t( + ), y = t( /*! ./crc32 */ "./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js" ), h = t( /*! ./messages */ "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js" - ), u = 0, E = 1, c = 3, C = 4, b = 5, A = 0, S = 1, n = -2, o = -3, w = -5, p = -1, v = 1, a = 2, l = 3, g = 4, M = 0, L = 2, T = 8, D = 9, R = 15, B = 8, P = 29, z = 256, F = z + 1 + P, N = 30, $ = 19, k = 2 * F + 1, G = 15, H = 3, U = 258, V = U + H + 1, Q = 32, oe = 42, ee = 69, ne = 73, me = 91, se = 103, fe = 113, Ce = 666, Me = 1, Te = 2, ae = 3, pe = 4, we = 3; - function ke(I, be) { - return I.msg = h[be], be; + ), _ = 0, E = 1, c = 3, C = 4, b = 5, A = 0, S = 1, s = -2, o = -3, w = -5, p = -1, v = 1, a = 2, l = 3, g = 4, M = 0, L = 2, T = 8, D = 9, I = 15, z = 8, P = 29, B = 256, F = B + 1 + P, N = 30, $ = 19, k = 2 * F + 1, G = 15, H = 3, U = 258, V = U + H + 1, Q = 32, ae = 42, oe = 69, q = 73, me = 91, ne = 103, fe = 113, Ce = 666, Me = 1, Te = 2, se = 3, pe = 4, we = 3; + function ke(R, be) { + return R.msg = h[be], be; } - function Ue(I) { - return (I << 1) - (I > 4 ? 9 : 0); + function Ue(R) { + return (R << 1) - (R > 4 ? 9 : 0); } - function Ne(I) { - for (var be = I.length; --be >= 0; ) - I[be] = 0; + function Ne(R) { + for (var be = R.length; --be >= 0; ) + R[be] = 0; } - function Be(I) { - var be = I.state, Ee = be.pending; - Ee > I.avail_out && (Ee = I.avail_out), Ee !== 0 && (s.arraySet(I.output, be.pending_buf, be.pending_out, Ee, I.next_out), I.next_out += Ee, be.pending_out += Ee, I.total_out += Ee, I.avail_out -= Ee, be.pending -= Ee, be.pending === 0 && (be.pending_out = 0)); + function Be(R) { + var be = R.state, Ee = be.pending; + Ee > R.avail_out && (Ee = R.avail_out), Ee !== 0 && (n.arraySet(R.output, be.pending_buf, be.pending_out, Ee, R.next_out), R.next_out += Ee, be.pending_out += Ee, R.total_out += Ee, R.avail_out -= Ee, be.pending -= Ee, be.pending === 0 && (be.pending_out = 0)); } - function ue(I, be) { - f._tr_flush_block(I, I.block_start >= 0 ? I.block_start : -1, I.strstart - I.block_start, be), I.block_start = I.strstart, Be(I.strm); + function ue(R, be) { + f._tr_flush_block(R, R.block_start >= 0 ? R.block_start : -1, R.strstart - R.block_start, be), R.block_start = R.strstart, Be(R.strm); } - function ye(I, be) { - I.pending_buf[I.pending++] = be; + function ye(R, be) { + R.pending_buf[R.pending++] = be; } - function ge(I, be) { - I.pending_buf[I.pending++] = be >>> 8 & 255, I.pending_buf[I.pending++] = be & 255; + function ge(R, be) { + R.pending_buf[R.pending++] = be >>> 8 & 255, R.pending_buf[R.pending++] = be & 255; } - function Se(I, be, Ee, X) { - var le = I.avail_in; - return le > X && (le = X), le === 0 ? 0 : (I.avail_in -= le, s.arraySet(be, I.input, I.next_in, le, Ee), I.state.wrap === 1 ? I.adler = _(I.adler, be, le, Ee) : I.state.wrap === 2 && (I.adler = x(I.adler, be, le, Ee)), I.next_in += le, I.total_in += le, le); + function Se(R, be, Ee, X) { + var le = R.avail_in; + return le > X && (le = X), le === 0 ? 0 : (R.avail_in -= le, n.arraySet(be, R.input, R.next_in, le, Ee), R.state.wrap === 1 ? R.adler = u(R.adler, be, le, Ee) : R.state.wrap === 2 && (R.adler = y(R.adler, be, le, Ee)), R.next_in += le, R.total_in += le, le); } - function ze(I, be) { - var Ee = I.max_chain_length, X = I.strstart, le, Le, Ze = I.prev_length, Ke = I.nice_match, je = I.strstart > I.w_size - V ? I.strstart - (I.w_size - V) : 0, Je = I.window, Lt = I.w_mask, rt = I.prev, it = I.strstart + U, tt = Je[X + Ze - 1], Et = Je[X + Ze]; - I.prev_length >= I.good_match && (Ee >>= 2), Ke > I.lookahead && (Ke = I.lookahead); + function ze(R, be) { + var Ee = R.max_chain_length, X = R.strstart, le, Le, Ze = R.prev_length, Ke = R.nice_match, je = R.strstart > R.w_size - V ? R.strstart - (R.w_size - V) : 0, Je = R.window, Lt = R.w_mask, rt = R.prev, it = R.strstart + U, tt = Je[X + Ze - 1], Et = Je[X + Ze]; + R.prev_length >= R.good_match && (Ee >>= 2), Ke > R.lookahead && (Ke = R.lookahead); do if (le = be, !(Je[le + Ze] !== Et || Je[le + Ze - 1] !== tt || Je[le] !== Je[X] || Je[++le] !== Je[X + 1])) { X += 2, le++; @@ -21108,132 +21108,132 @@ ATOM`, g); ; while (Je[++X] === Je[++le] && Je[++X] === Je[++le] && Je[++X] === Je[++le] && Je[++X] === Je[++le] && Je[++X] === Je[++le] && Je[++X] === Je[++le] && Je[++X] === Je[++le] && Je[++X] === Je[++le] && X < it); if (Le = U - (it - X), X = it - U, Le > Ze) { - if (I.match_start = be, Ze = Le, Le >= Ke) + if (R.match_start = be, Ze = Le, Le >= Ke) break; tt = Je[X + Ze - 1], Et = Je[X + Ze]; } } while ((be = rt[be & Lt]) > je && --Ee !== 0); - return Ze <= I.lookahead ? Ze : I.lookahead; + return Ze <= R.lookahead ? Ze : R.lookahead; } - function He(I) { - var be = I.w_size, Ee, X, le, Le, Ze; + function He(R) { + var be = R.w_size, Ee, X, le, Le, Ze; do { - if (Le = I.window_size - I.lookahead - I.strstart, I.strstart >= be + (be - V)) { - s.arraySet(I.window, I.window, be, be, 0), I.match_start -= be, I.strstart -= be, I.block_start -= be, X = I.hash_size, Ee = X; + if (Le = R.window_size - R.lookahead - R.strstart, R.strstart >= be + (be - V)) { + n.arraySet(R.window, R.window, be, be, 0), R.match_start -= be, R.strstart -= be, R.block_start -= be, X = R.hash_size, Ee = X; do - le = I.head[--Ee], I.head[Ee] = le >= be ? le - be : 0; + le = R.head[--Ee], R.head[Ee] = le >= be ? le - be : 0; while (--X); X = be, Ee = X; do - le = I.prev[--Ee], I.prev[Ee] = le >= be ? le - be : 0; + le = R.prev[--Ee], R.prev[Ee] = le >= be ? le - be : 0; while (--X); Le += be; } - if (I.strm.avail_in === 0) + if (R.strm.avail_in === 0) break; - if (X = Se(I.strm, I.window, I.strstart + I.lookahead, Le), I.lookahead += X, I.lookahead + I.insert >= H) - for (Ze = I.strstart - I.insert, I.ins_h = I.window[Ze], I.ins_h = (I.ins_h << I.hash_shift ^ I.window[Ze + 1]) & I.hash_mask; I.insert && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[Ze + H - 1]) & I.hash_mask, I.prev[Ze & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = Ze, Ze++, I.insert--, !(I.lookahead + I.insert < H)); ) + if (X = Se(R.strm, R.window, R.strstart + R.lookahead, Le), R.lookahead += X, R.lookahead + R.insert >= H) + for (Ze = R.strstart - R.insert, R.ins_h = R.window[Ze], R.ins_h = (R.ins_h << R.hash_shift ^ R.window[Ze + 1]) & R.hash_mask; R.insert && (R.ins_h = (R.ins_h << R.hash_shift ^ R.window[Ze + H - 1]) & R.hash_mask, R.prev[Ze & R.w_mask] = R.head[R.ins_h], R.head[R.ins_h] = Ze, Ze++, R.insert--, !(R.lookahead + R.insert < H)); ) ; - } while (I.lookahead < V && I.strm.avail_in !== 0); + } while (R.lookahead < V && R.strm.avail_in !== 0); } - function We(I, be) { + function We(R, be) { var Ee = 65535; - for (Ee > I.pending_buf_size - 5 && (Ee = I.pending_buf_size - 5); ; ) { - if (I.lookahead <= 1) { - if (He(I), I.lookahead === 0 && be === u) + for (Ee > R.pending_buf_size - 5 && (Ee = R.pending_buf_size - 5); ; ) { + if (R.lookahead <= 1) { + if (He(R), R.lookahead === 0 && be === _) return Me; - if (I.lookahead === 0) + if (R.lookahead === 0) break; } - I.strstart += I.lookahead, I.lookahead = 0; - var X = I.block_start + Ee; - if ((I.strstart === 0 || I.strstart >= X) && (I.lookahead = I.strstart - X, I.strstart = X, ue(I, !1), I.strm.avail_out === 0) || I.strstart - I.block_start >= I.w_size - V && (ue(I, !1), I.strm.avail_out === 0)) + R.strstart += R.lookahead, R.lookahead = 0; + var X = R.block_start + Ee; + if ((R.strstart === 0 || R.strstart >= X) && (R.lookahead = R.strstart - X, R.strstart = X, ue(R, !1), R.strm.avail_out === 0) || R.strstart - R.block_start >= R.w_size - V && (ue(R, !1), R.strm.avail_out === 0)) return Me; } - return I.insert = 0, be === C ? (ue(I, !0), I.strm.avail_out === 0 ? ae : pe) : (I.strstart > I.block_start && (ue(I, !1), I.strm.avail_out === 0), Me); + return R.insert = 0, be === C ? (ue(R, !0), R.strm.avail_out === 0 ? se : pe) : (R.strstart > R.block_start && (ue(R, !1), R.strm.avail_out === 0), Me); } - function Y(I, be) { + function Y(R, be) { for (var Ee, X; ; ) { - if (I.lookahead < V) { - if (He(I), I.lookahead < V && be === u) + if (R.lookahead < V) { + if (He(R), R.lookahead < V && be === _) return Me; - if (I.lookahead === 0) + if (R.lookahead === 0) break; } - if (Ee = 0, I.lookahead >= H && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + H - 1]) & I.hash_mask, Ee = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart), Ee !== 0 && I.strstart - Ee <= I.w_size - V && (I.match_length = ze(I, Ee)), I.match_length >= H) - if (X = f._tr_tally(I, I.strstart - I.match_start, I.match_length - H), I.lookahead -= I.match_length, I.match_length <= I.max_lazy_match && I.lookahead >= H) { - I.match_length--; + if (Ee = 0, R.lookahead >= H && (R.ins_h = (R.ins_h << R.hash_shift ^ R.window[R.strstart + H - 1]) & R.hash_mask, Ee = R.prev[R.strstart & R.w_mask] = R.head[R.ins_h], R.head[R.ins_h] = R.strstart), Ee !== 0 && R.strstart - Ee <= R.w_size - V && (R.match_length = ze(R, Ee)), R.match_length >= H) + if (X = f._tr_tally(R, R.strstart - R.match_start, R.match_length - H), R.lookahead -= R.match_length, R.match_length <= R.max_lazy_match && R.lookahead >= H) { + R.match_length--; do - I.strstart++, I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + H - 1]) & I.hash_mask, Ee = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart; - while (--I.match_length !== 0); - I.strstart++; + R.strstart++, R.ins_h = (R.ins_h << R.hash_shift ^ R.window[R.strstart + H - 1]) & R.hash_mask, Ee = R.prev[R.strstart & R.w_mask] = R.head[R.ins_h], R.head[R.ins_h] = R.strstart; + while (--R.match_length !== 0); + R.strstart++; } else - I.strstart += I.match_length, I.match_length = 0, I.ins_h = I.window[I.strstart], I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + 1]) & I.hash_mask; + R.strstart += R.match_length, R.match_length = 0, R.ins_h = R.window[R.strstart], R.ins_h = (R.ins_h << R.hash_shift ^ R.window[R.strstart + 1]) & R.hash_mask; else - X = f._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++; - if (X && (ue(I, !1), I.strm.avail_out === 0)) + X = f._tr_tally(R, 0, R.window[R.strstart]), R.lookahead--, R.strstart++; + if (X && (ue(R, !1), R.strm.avail_out === 0)) return Me; } - return I.insert = I.strstart < H - 1 ? I.strstart : H - 1, be === C ? (ue(I, !0), I.strm.avail_out === 0 ? ae : pe) : I.last_lit && (ue(I, !1), I.strm.avail_out === 0) ? Me : Te; + return R.insert = R.strstart < H - 1 ? R.strstart : H - 1, be === C ? (ue(R, !0), R.strm.avail_out === 0 ? se : pe) : R.last_lit && (ue(R, !1), R.strm.avail_out === 0) ? Me : Te; } - function K(I, be) { + function K(R, be) { for (var Ee, X, le; ; ) { - if (I.lookahead < V) { - if (He(I), I.lookahead < V && be === u) + if (R.lookahead < V) { + if (He(R), R.lookahead < V && be === _) return Me; - if (I.lookahead === 0) + if (R.lookahead === 0) break; } - if (Ee = 0, I.lookahead >= H && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + H - 1]) & I.hash_mask, Ee = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart), I.prev_length = I.match_length, I.prev_match = I.match_start, I.match_length = H - 1, Ee !== 0 && I.prev_length < I.max_lazy_match && I.strstart - Ee <= I.w_size - V && (I.match_length = ze(I, Ee), I.match_length <= 5 && (I.strategy === v || I.match_length === H && I.strstart - I.match_start > 4096) && (I.match_length = H - 1)), I.prev_length >= H && I.match_length <= I.prev_length) { - le = I.strstart + I.lookahead - H, X = f._tr_tally(I, I.strstart - 1 - I.prev_match, I.prev_length - H), I.lookahead -= I.prev_length - 1, I.prev_length -= 2; + if (Ee = 0, R.lookahead >= H && (R.ins_h = (R.ins_h << R.hash_shift ^ R.window[R.strstart + H - 1]) & R.hash_mask, Ee = R.prev[R.strstart & R.w_mask] = R.head[R.ins_h], R.head[R.ins_h] = R.strstart), R.prev_length = R.match_length, R.prev_match = R.match_start, R.match_length = H - 1, Ee !== 0 && R.prev_length < R.max_lazy_match && R.strstart - Ee <= R.w_size - V && (R.match_length = ze(R, Ee), R.match_length <= 5 && (R.strategy === v || R.match_length === H && R.strstart - R.match_start > 4096) && (R.match_length = H - 1)), R.prev_length >= H && R.match_length <= R.prev_length) { + le = R.strstart + R.lookahead - H, X = f._tr_tally(R, R.strstart - 1 - R.prev_match, R.prev_length - H), R.lookahead -= R.prev_length - 1, R.prev_length -= 2; do - ++I.strstart <= le && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + H - 1]) & I.hash_mask, Ee = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart); - while (--I.prev_length !== 0); - if (I.match_available = 0, I.match_length = H - 1, I.strstart++, X && (ue(I, !1), I.strm.avail_out === 0)) + ++R.strstart <= le && (R.ins_h = (R.ins_h << R.hash_shift ^ R.window[R.strstart + H - 1]) & R.hash_mask, Ee = R.prev[R.strstart & R.w_mask] = R.head[R.ins_h], R.head[R.ins_h] = R.strstart); + while (--R.prev_length !== 0); + if (R.match_available = 0, R.match_length = H - 1, R.strstart++, X && (ue(R, !1), R.strm.avail_out === 0)) return Me; - } else if (I.match_available) { - if (X = f._tr_tally(I, 0, I.window[I.strstart - 1]), X && ue(I, !1), I.strstart++, I.lookahead--, I.strm.avail_out === 0) + } else if (R.match_available) { + if (X = f._tr_tally(R, 0, R.window[R.strstart - 1]), X && ue(R, !1), R.strstart++, R.lookahead--, R.strm.avail_out === 0) return Me; } else - I.match_available = 1, I.strstart++, I.lookahead--; + R.match_available = 1, R.strstart++, R.lookahead--; } - return I.match_available && (X = f._tr_tally(I, 0, I.window[I.strstart - 1]), I.match_available = 0), I.insert = I.strstart < H - 1 ? I.strstart : H - 1, be === C ? (ue(I, !0), I.strm.avail_out === 0 ? ae : pe) : I.last_lit && (ue(I, !1), I.strm.avail_out === 0) ? Me : Te; + return R.match_available && (X = f._tr_tally(R, 0, R.window[R.strstart - 1]), R.match_available = 0), R.insert = R.strstart < H - 1 ? R.strstart : H - 1, be === C ? (ue(R, !0), R.strm.avail_out === 0 ? se : pe) : R.last_lit && (ue(R, !1), R.strm.avail_out === 0) ? Me : Te; } - function q(I, be) { - for (var Ee, X, le, Le, Ze = I.window; ; ) { - if (I.lookahead <= U) { - if (He(I), I.lookahead <= U && be === u) + function ee(R, be) { + for (var Ee, X, le, Le, Ze = R.window; ; ) { + if (R.lookahead <= U) { + if (He(R), R.lookahead <= U && be === _) return Me; - if (I.lookahead === 0) + if (R.lookahead === 0) break; } - if (I.match_length = 0, I.lookahead >= H && I.strstart > 0 && (le = I.strstart - 1, X = Ze[le], X === Ze[++le] && X === Ze[++le] && X === Ze[++le])) { - Le = I.strstart + U; + if (R.match_length = 0, R.lookahead >= H && R.strstart > 0 && (le = R.strstart - 1, X = Ze[le], X === Ze[++le] && X === Ze[++le] && X === Ze[++le])) { + Le = R.strstart + U; do ; while (X === Ze[++le] && X === Ze[++le] && X === Ze[++le] && X === Ze[++le] && X === Ze[++le] && X === Ze[++le] && X === Ze[++le] && X === Ze[++le] && le < Le); - I.match_length = U - (Le - le), I.match_length > I.lookahead && (I.match_length = I.lookahead); + R.match_length = U - (Le - le), R.match_length > R.lookahead && (R.match_length = R.lookahead); } - if (I.match_length >= H ? (Ee = f._tr_tally(I, 1, I.match_length - H), I.lookahead -= I.match_length, I.strstart += I.match_length, I.match_length = 0) : (Ee = f._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++), Ee && (ue(I, !1), I.strm.avail_out === 0)) + if (R.match_length >= H ? (Ee = f._tr_tally(R, 1, R.match_length - H), R.lookahead -= R.match_length, R.strstart += R.match_length, R.match_length = 0) : (Ee = f._tr_tally(R, 0, R.window[R.strstart]), R.lookahead--, R.strstart++), Ee && (ue(R, !1), R.strm.avail_out === 0)) return Me; } - return I.insert = 0, be === C ? (ue(I, !0), I.strm.avail_out === 0 ? ae : pe) : I.last_lit && (ue(I, !1), I.strm.avail_out === 0) ? Me : Te; + return R.insert = 0, be === C ? (ue(R, !0), R.strm.avail_out === 0 ? se : pe) : R.last_lit && (ue(R, !1), R.strm.avail_out === 0) ? Me : Te; } - function de(I, be) { + function de(R, be) { for (var Ee; ; ) { - if (I.lookahead === 0 && (He(I), I.lookahead === 0)) { - if (be === u) + if (R.lookahead === 0 && (He(R), R.lookahead === 0)) { + if (be === _) return Me; break; } - if (I.match_length = 0, Ee = f._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++, Ee && (ue(I, !1), I.strm.avail_out === 0)) + if (R.match_length = 0, Ee = f._tr_tally(R, 0, R.window[R.strstart]), R.lookahead--, R.strstart++, Ee && (ue(R, !1), R.strm.avail_out === 0)) return Me; } - return I.insert = 0, be === C ? (ue(I, !0), I.strm.avail_out === 0 ? ae : pe) : I.last_lit && (ue(I, !1), I.strm.avail_out === 0) ? Me : Te; + return R.insert = 0, be === C ? (ue(R, !0), R.strm.avail_out === 0 ? se : pe) : R.last_lit && (ue(R, !1), R.strm.avail_out === 0) ? Me : Te; } - function ve(I, be, Ee, X, le) { - this.good_length = I, this.max_lazy = be, this.nice_length = Ee, this.max_chain = X, this.func = le; + function ve(R, be, Ee, X, le) { + this.good_length = R, this.max_lazy = be, this.nice_length = Ee, this.max_chain = X, this.func = le; } var Ie; Ie = [ @@ -21259,117 +21259,117 @@ ATOM`, g); new ve(32, 258, 258, 4096, K) /* 9 max compression */ ]; - function Re(I) { - I.window_size = 2 * I.w_size, Ne(I.head), I.max_lazy_match = Ie[I.level].max_lazy, I.good_match = Ie[I.level].good_length, I.nice_match = Ie[I.level].nice_length, I.max_chain_length = Ie[I.level].max_chain, I.strstart = 0, I.block_start = 0, I.lookahead = 0, I.insert = 0, I.match_length = I.prev_length = H - 1, I.match_available = 0, I.ins_h = 0; + function Re(R) { + R.window_size = 2 * R.w_size, Ne(R.head), R.max_lazy_match = Ie[R.level].max_lazy, R.good_match = Ie[R.level].good_length, R.nice_match = Ie[R.level].nice_length, R.max_chain_length = Ie[R.level].max_chain, R.strstart = 0, R.block_start = 0, R.lookahead = 0, R.insert = 0, R.match_length = R.prev_length = H - 1, R.match_available = 0, R.ins_h = 0; } function Z() { - this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = T, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new s.Buf16(k * 2), this.dyn_dtree = new s.Buf16((2 * N + 1) * 2), this.bl_tree = new s.Buf16((2 * $ + 1) * 2), Ne(this.dyn_ltree), Ne(this.dyn_dtree), Ne(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new s.Buf16(G + 1), this.heap = new s.Buf16(2 * F + 1), Ne(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new s.Buf16(2 * F + 1), Ne(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; + this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = T, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new n.Buf16(k * 2), this.dyn_dtree = new n.Buf16((2 * N + 1) * 2), this.bl_tree = new n.Buf16((2 * $ + 1) * 2), Ne(this.dyn_ltree), Ne(this.dyn_dtree), Ne(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new n.Buf16(G + 1), this.heap = new n.Buf16(2 * F + 1), Ne(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new n.Buf16(2 * F + 1), Ne(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; } - function ce(I) { + function ce(R) { var be; - return !I || !I.state ? ke(I, n) : (I.total_in = I.total_out = 0, I.data_type = L, be = I.state, be.pending = 0, be.pending_out = 0, be.wrap < 0 && (be.wrap = -be.wrap), be.status = be.wrap ? oe : fe, I.adler = be.wrap === 2 ? 0 : 1, be.last_flush = u, f._tr_init(be), A); + return !R || !R.state ? ke(R, s) : (R.total_in = R.total_out = 0, R.data_type = L, be = R.state, be.pending = 0, be.pending_out = 0, be.wrap < 0 && (be.wrap = -be.wrap), be.status = be.wrap ? ae : fe, R.adler = be.wrap === 2 ? 0 : 1, be.last_flush = _, f._tr_init(be), A); } - function Ae(I) { - var be = ce(I); - return be === A && Re(I.state), be; + function Ae(R) { + var be = ce(R); + return be === A && Re(R.state), be; } - function Fe(I, be) { - return !I || !I.state || I.state.wrap !== 2 ? n : (I.state.gzhead = be, A); + function Fe(R, be) { + return !R || !R.state || R.state.wrap !== 2 ? s : (R.state.gzhead = be, A); } - function he(I, be, Ee, X, le, Le) { - if (!I) - return n; + function he(R, be, Ee, X, le, Le) { + if (!R) + return s; var Ze = 1; if (be === p && (be = 6), X < 0 ? (Ze = 0, X = -X) : X > 15 && (Ze = 2, X -= 16), le < 1 || le > D || Ee !== T || X < 8 || X > 15 || be < 0 || be > 9 || Le < 0 || Le > g) - return ke(I, n); + return ke(R, s); X === 8 && (X = 9); var Ke = new Z(); - return I.state = Ke, Ke.strm = I, Ke.wrap = Ze, Ke.gzhead = null, Ke.w_bits = X, Ke.w_size = 1 << Ke.w_bits, Ke.w_mask = Ke.w_size - 1, Ke.hash_bits = le + 7, Ke.hash_size = 1 << Ke.hash_bits, Ke.hash_mask = Ke.hash_size - 1, Ke.hash_shift = ~~((Ke.hash_bits + H - 1) / H), Ke.window = new s.Buf8(Ke.w_size * 2), Ke.head = new s.Buf16(Ke.hash_size), Ke.prev = new s.Buf16(Ke.w_size), Ke.lit_bufsize = 1 << le + 6, Ke.pending_buf_size = Ke.lit_bufsize * 4, Ke.pending_buf = new s.Buf8(Ke.pending_buf_size), Ke.d_buf = 1 * Ke.lit_bufsize, Ke.l_buf = 3 * Ke.lit_bufsize, Ke.level = be, Ke.strategy = Le, Ke.method = Ee, Ae(I); + return R.state = Ke, Ke.strm = R, Ke.wrap = Ze, Ke.gzhead = null, Ke.w_bits = X, Ke.w_size = 1 << Ke.w_bits, Ke.w_mask = Ke.w_size - 1, Ke.hash_bits = le + 7, Ke.hash_size = 1 << Ke.hash_bits, Ke.hash_mask = Ke.hash_size - 1, Ke.hash_shift = ~~((Ke.hash_bits + H - 1) / H), Ke.window = new n.Buf8(Ke.w_size * 2), Ke.head = new n.Buf16(Ke.hash_size), Ke.prev = new n.Buf16(Ke.w_size), Ke.lit_bufsize = 1 << le + 6, Ke.pending_buf_size = Ke.lit_bufsize * 4, Ke.pending_buf = new n.Buf8(Ke.pending_buf_size), Ke.d_buf = 1 * Ke.lit_bufsize, Ke.l_buf = 3 * Ke.lit_bufsize, Ke.level = be, Ke.strategy = Le, Ke.method = Ee, Ae(R); } - function Oe(I, be) { - return he(I, be, T, R, B, M); + function Oe(R, be) { + return he(R, be, T, I, z, M); } - function j(I, be) { + function j(R, be) { var Ee, X, le, Le; - if (!I || !I.state || be > b || be < 0) - return I ? ke(I, n) : n; - if (X = I.state, !I.output || !I.input && I.avail_in !== 0 || X.status === Ce && be !== C) - return ke(I, I.avail_out === 0 ? w : n); - if (X.strm = I, Ee = X.last_flush, X.last_flush = be, X.status === oe) + if (!R || !R.state || be > b || be < 0) + return R ? ke(R, s) : s; + if (X = R.state, !R.output || !R.input && R.avail_in !== 0 || X.status === Ce && be !== C) + return ke(R, R.avail_out === 0 ? w : s); + if (X.strm = R, Ee = X.last_flush, X.last_flush = be, X.status === ae) if (X.wrap === 2) - I.adler = 0, ye(X, 31), ye(X, 139), ye(X, 8), X.gzhead ? (ye( + R.adler = 0, ye(X, 31), ye(X, 139), ye(X, 8), X.gzhead ? (ye( X, (X.gzhead.text ? 1 : 0) + (X.gzhead.hcrc ? 2 : 0) + (X.gzhead.extra ? 4 : 0) + (X.gzhead.name ? 8 : 0) + (X.gzhead.comment ? 16 : 0) - ), ye(X, X.gzhead.time & 255), ye(X, X.gzhead.time >> 8 & 255), ye(X, X.gzhead.time >> 16 & 255), ye(X, X.gzhead.time >> 24 & 255), ye(X, X.level === 9 ? 2 : X.strategy >= a || X.level < 2 ? 4 : 0), ye(X, X.gzhead.os & 255), X.gzhead.extra && X.gzhead.extra.length && (ye(X, X.gzhead.extra.length & 255), ye(X, X.gzhead.extra.length >> 8 & 255)), X.gzhead.hcrc && (I.adler = x(I.adler, X.pending_buf, X.pending, 0)), X.gzindex = 0, X.status = ee) : (ye(X, 0), ye(X, 0), ye(X, 0), ye(X, 0), ye(X, 0), ye(X, X.level === 9 ? 2 : X.strategy >= a || X.level < 2 ? 4 : 0), ye(X, we), X.status = fe); + ), ye(X, X.gzhead.time & 255), ye(X, X.gzhead.time >> 8 & 255), ye(X, X.gzhead.time >> 16 & 255), ye(X, X.gzhead.time >> 24 & 255), ye(X, X.level === 9 ? 2 : X.strategy >= a || X.level < 2 ? 4 : 0), ye(X, X.gzhead.os & 255), X.gzhead.extra && X.gzhead.extra.length && (ye(X, X.gzhead.extra.length & 255), ye(X, X.gzhead.extra.length >> 8 & 255)), X.gzhead.hcrc && (R.adler = y(R.adler, X.pending_buf, X.pending, 0)), X.gzindex = 0, X.status = oe) : (ye(X, 0), ye(X, 0), ye(X, 0), ye(X, 0), ye(X, 0), ye(X, X.level === 9 ? 2 : X.strategy >= a || X.level < 2 ? 4 : 0), ye(X, we), X.status = fe); else { var Ze = T + (X.w_bits - 8 << 4) << 8, Ke = -1; - X.strategy >= a || X.level < 2 ? Ke = 0 : X.level < 6 ? Ke = 1 : X.level === 6 ? Ke = 2 : Ke = 3, Ze |= Ke << 6, X.strstart !== 0 && (Ze |= Q), Ze += 31 - Ze % 31, X.status = fe, ge(X, Ze), X.strstart !== 0 && (ge(X, I.adler >>> 16), ge(X, I.adler & 65535)), I.adler = 1; + X.strategy >= a || X.level < 2 ? Ke = 0 : X.level < 6 ? Ke = 1 : X.level === 6 ? Ke = 2 : Ke = 3, Ze |= Ke << 6, X.strstart !== 0 && (Ze |= Q), Ze += 31 - Ze % 31, X.status = fe, ge(X, Ze), X.strstart !== 0 && (ge(X, R.adler >>> 16), ge(X, R.adler & 65535)), R.adler = 1; } - if (X.status === ee) + if (X.status === oe) if (X.gzhead.extra) { - for (le = X.pending; X.gzindex < (X.gzhead.extra.length & 65535) && !(X.pending === X.pending_buf_size && (X.gzhead.hcrc && X.pending > le && (I.adler = x(I.adler, X.pending_buf, X.pending - le, le)), Be(I), le = X.pending, X.pending === X.pending_buf_size)); ) + for (le = X.pending; X.gzindex < (X.gzhead.extra.length & 65535) && !(X.pending === X.pending_buf_size && (X.gzhead.hcrc && X.pending > le && (R.adler = y(R.adler, X.pending_buf, X.pending - le, le)), Be(R), le = X.pending, X.pending === X.pending_buf_size)); ) ye(X, X.gzhead.extra[X.gzindex] & 255), X.gzindex++; - X.gzhead.hcrc && X.pending > le && (I.adler = x(I.adler, X.pending_buf, X.pending - le, le)), X.gzindex === X.gzhead.extra.length && (X.gzindex = 0, X.status = ne); + X.gzhead.hcrc && X.pending > le && (R.adler = y(R.adler, X.pending_buf, X.pending - le, le)), X.gzindex === X.gzhead.extra.length && (X.gzindex = 0, X.status = q); } else - X.status = ne; - if (X.status === ne) + X.status = q; + if (X.status === q) if (X.gzhead.name) { le = X.pending; do { - if (X.pending === X.pending_buf_size && (X.gzhead.hcrc && X.pending > le && (I.adler = x(I.adler, X.pending_buf, X.pending - le, le)), Be(I), le = X.pending, X.pending === X.pending_buf_size)) { + if (X.pending === X.pending_buf_size && (X.gzhead.hcrc && X.pending > le && (R.adler = y(R.adler, X.pending_buf, X.pending - le, le)), Be(R), le = X.pending, X.pending === X.pending_buf_size)) { Le = 1; break; } X.gzindex < X.gzhead.name.length ? Le = X.gzhead.name.charCodeAt(X.gzindex++) & 255 : Le = 0, ye(X, Le); } while (Le !== 0); - X.gzhead.hcrc && X.pending > le && (I.adler = x(I.adler, X.pending_buf, X.pending - le, le)), Le === 0 && (X.gzindex = 0, X.status = me); + X.gzhead.hcrc && X.pending > le && (R.adler = y(R.adler, X.pending_buf, X.pending - le, le)), Le === 0 && (X.gzindex = 0, X.status = me); } else X.status = me; if (X.status === me) if (X.gzhead.comment) { le = X.pending; do { - if (X.pending === X.pending_buf_size && (X.gzhead.hcrc && X.pending > le && (I.adler = x(I.adler, X.pending_buf, X.pending - le, le)), Be(I), le = X.pending, X.pending === X.pending_buf_size)) { + if (X.pending === X.pending_buf_size && (X.gzhead.hcrc && X.pending > le && (R.adler = y(R.adler, X.pending_buf, X.pending - le, le)), Be(R), le = X.pending, X.pending === X.pending_buf_size)) { Le = 1; break; } X.gzindex < X.gzhead.comment.length ? Le = X.gzhead.comment.charCodeAt(X.gzindex++) & 255 : Le = 0, ye(X, Le); } while (Le !== 0); - X.gzhead.hcrc && X.pending > le && (I.adler = x(I.adler, X.pending_buf, X.pending - le, le)), Le === 0 && (X.status = se); + X.gzhead.hcrc && X.pending > le && (R.adler = y(R.adler, X.pending_buf, X.pending - le, le)), Le === 0 && (X.status = ne); } else - X.status = se; - if (X.status === se && (X.gzhead.hcrc ? (X.pending + 2 > X.pending_buf_size && Be(I), X.pending + 2 <= X.pending_buf_size && (ye(X, I.adler & 255), ye(X, I.adler >> 8 & 255), I.adler = 0, X.status = fe)) : X.status = fe), X.pending !== 0) { - if (Be(I), I.avail_out === 0) + X.status = ne; + if (X.status === ne && (X.gzhead.hcrc ? (X.pending + 2 > X.pending_buf_size && Be(R), X.pending + 2 <= X.pending_buf_size && (ye(X, R.adler & 255), ye(X, R.adler >> 8 & 255), R.adler = 0, X.status = fe)) : X.status = fe), X.pending !== 0) { + if (Be(R), R.avail_out === 0) return X.last_flush = -1, A; - } else if (I.avail_in === 0 && Ue(be) <= Ue(Ee) && be !== C) - return ke(I, w); - if (X.status === Ce && I.avail_in !== 0) - return ke(I, w); - if (I.avail_in !== 0 || X.lookahead !== 0 || be !== u && X.status !== Ce) { - var je = X.strategy === a ? de(X, be) : X.strategy === l ? q(X, be) : Ie[X.level].func(X, be); - if ((je === ae || je === pe) && (X.status = Ce), je === Me || je === ae) - return I.avail_out === 0 && (X.last_flush = -1), A; - if (je === Te && (be === E ? f._tr_align(X) : be !== b && (f._tr_stored_block(X, 0, 0, !1), be === c && (Ne(X.head), X.lookahead === 0 && (X.strstart = 0, X.block_start = 0, X.insert = 0))), Be(I), I.avail_out === 0)) + } else if (R.avail_in === 0 && Ue(be) <= Ue(Ee) && be !== C) + return ke(R, w); + if (X.status === Ce && R.avail_in !== 0) + return ke(R, w); + if (R.avail_in !== 0 || X.lookahead !== 0 || be !== _ && X.status !== Ce) { + var je = X.strategy === a ? de(X, be) : X.strategy === l ? ee(X, be) : Ie[X.level].func(X, be); + if ((je === se || je === pe) && (X.status = Ce), je === Me || je === se) + return R.avail_out === 0 && (X.last_flush = -1), A; + if (je === Te && (be === E ? f._tr_align(X) : be !== b && (f._tr_stored_block(X, 0, 0, !1), be === c && (Ne(X.head), X.lookahead === 0 && (X.strstart = 0, X.block_start = 0, X.insert = 0))), Be(R), R.avail_out === 0)) return X.last_flush = -1, A; } - return be !== C ? A : X.wrap <= 0 ? S : (X.wrap === 2 ? (ye(X, I.adler & 255), ye(X, I.adler >> 8 & 255), ye(X, I.adler >> 16 & 255), ye(X, I.adler >> 24 & 255), ye(X, I.total_in & 255), ye(X, I.total_in >> 8 & 255), ye(X, I.total_in >> 16 & 255), ye(X, I.total_in >> 24 & 255)) : (ge(X, I.adler >>> 16), ge(X, I.adler & 65535)), Be(I), X.wrap > 0 && (X.wrap = -X.wrap), X.pending !== 0 ? A : S); + return be !== C ? A : X.wrap <= 0 ? S : (X.wrap === 2 ? (ye(X, R.adler & 255), ye(X, R.adler >> 8 & 255), ye(X, R.adler >> 16 & 255), ye(X, R.adler >> 24 & 255), ye(X, R.total_in & 255), ye(X, R.total_in >> 8 & 255), ye(X, R.total_in >> 16 & 255), ye(X, R.total_in >> 24 & 255)) : (ge(X, R.adler >>> 16), ge(X, R.adler & 65535)), Be(R), X.wrap > 0 && (X.wrap = -X.wrap), X.pending !== 0 ? A : S); } - function $e(I) { + function $e(R) { var be; - return !I || !I.state ? n : (be = I.state.status, be !== oe && be !== ee && be !== ne && be !== me && be !== se && be !== fe && be !== Ce ? ke(I, n) : (I.state = null, be === fe ? ke(I, o) : A)); + return !R || !R.state ? s : (be = R.state.status, be !== ae && be !== oe && be !== q && be !== me && be !== ne && be !== fe && be !== Ce ? ke(R, s) : (R.state = null, be === fe ? ke(R, o) : A)); } - function Ve(I, be) { + function Ve(R, be) { var Ee = be.length, X, le, Le, Ze, Ke, je, Je, Lt; - if (!I || !I.state || (X = I.state, Ze = X.wrap, Ze === 2 || Ze === 1 && X.status !== oe || X.lookahead)) - return n; - for (Ze === 1 && (I.adler = _(I.adler, be, Ee, 0)), X.wrap = 0, Ee >= X.w_size && (Ze === 0 && (Ne(X.head), X.strstart = 0, X.block_start = 0, X.insert = 0), Lt = new s.Buf8(X.w_size), s.arraySet(Lt, be, Ee - X.w_size, X.w_size, 0), be = Lt, Ee = X.w_size), Ke = I.avail_in, je = I.next_in, Je = I.input, I.avail_in = Ee, I.next_in = 0, I.input = be, He(X); X.lookahead >= H; ) { + if (!R || !R.state || (X = R.state, Ze = X.wrap, Ze === 2 || Ze === 1 && X.status !== ae || X.lookahead)) + return s; + for (Ze === 1 && (R.adler = u(R.adler, be, Ee, 0)), X.wrap = 0, Ee >= X.w_size && (Ze === 0 && (Ne(X.head), X.strstart = 0, X.block_start = 0, X.insert = 0), Lt = new n.Buf8(X.w_size), n.arraySet(Lt, be, Ee - X.w_size, X.w_size, 0), be = Lt, Ee = X.w_size), Ke = R.avail_in, je = R.next_in, Je = R.input, R.avail_in = Ee, R.next_in = 0, R.input = be, He(X); X.lookahead >= H; ) { le = X.strstart, Le = X.lookahead - (H - 1); do X.ins_h = (X.ins_h << X.hash_shift ^ X.window[le + H - 1]) & X.hash_mask, X.prev[le & X.w_mask] = X.head[X.ins_h], X.head[X.ins_h] = le, le++; while (--Le); X.strstart = le, X.lookahead = H - 1, He(X); } - return X.strstart += X.lookahead, X.block_start = X.strstart, X.insert = X.lookahead, X.lookahead = 0, X.match_length = X.prev_length = H - 1, X.match_available = 0, I.next_in = je, I.input = Je, I.avail_in = Ke, X.wrap = Ze, A; + return X.strstart += X.lookahead, X.block_start = X.strstart, X.insert = X.lookahead, X.lookahead = 0, X.match_length = X.prev_length = H - 1, X.match_available = 0, R.next_in = je, R.input = Je, R.avail_in = Ke, X.wrap = Ze, A; } e.deflateInit = Oe, e.deflateInit2 = he, e.deflateReset = Ae, e.deflateResetKeep = ce, e.deflateSetHeader = Fe, e.deflate = j, e.deflateEnd = $e, e.deflateSetDictionary = Ve, e.deflateInfo = "pako deflate (from Nodeca project)"; } @@ -21395,71 +21395,71 @@ ATOM`, g); /***/ (r) => { var e = 30, t = 12; - r.exports = function(f, _) { - var x, h, u, E, c, C, b, A, S, n, o, w, p, v, a, l, g, M, L, T, D, R, B, P, z; - x = f.state, h = f.next_in, P = f.input, u = h + (f.avail_in - 5), E = f.next_out, z = f.output, c = E - (_ - f.avail_out), C = E + (f.avail_out - 257), b = x.dmax, A = x.wsize, S = x.whave, n = x.wnext, o = x.window, w = x.hold, p = x.bits, v = x.lencode, a = x.distcode, l = (1 << x.lenbits) - 1, g = (1 << x.distbits) - 1; + r.exports = function(f, u) { + var y, h, _, E, c, C, b, A, S, s, o, w, p, v, a, l, g, M, L, T, D, I, z, P, B; + y = f.state, h = f.next_in, P = f.input, _ = h + (f.avail_in - 5), E = f.next_out, B = f.output, c = E - (u - f.avail_out), C = E + (f.avail_out - 257), b = y.dmax, A = y.wsize, S = y.whave, s = y.wnext, o = y.window, w = y.hold, p = y.bits, v = y.lencode, a = y.distcode, l = (1 << y.lenbits) - 1, g = (1 << y.distbits) - 1; e: do { p < 15 && (w += P[h++] << p, p += 8, w += P[h++] << p, p += 8), M = v[w & l]; t: for (; ; ) { if (L = M >>> 24, w >>>= L, p -= L, L = M >>> 16 & 255, L === 0) - z[E++] = M & 65535; + B[E++] = M & 65535; else if (L & 16) { T = M & 65535, L &= 15, L && (p < L && (w += P[h++] << p, p += 8), T += w & (1 << L) - 1, w >>>= L, p -= L), p < 15 && (w += P[h++] << p, p += 8, w += P[h++] << p, p += 8), M = a[w & g]; r: for (; ; ) { if (L = M >>> 24, w >>>= L, p -= L, L = M >>> 16 & 255, L & 16) { if (D = M & 65535, L &= 15, p < L && (w += P[h++] << p, p += 8, p < L && (w += P[h++] << p, p += 8)), D += w & (1 << L) - 1, D > b) { - f.msg = "invalid distance too far back", x.mode = e; + f.msg = "invalid distance too far back", y.mode = e; break e; } if (w >>>= L, p -= L, L = E - c, D > L) { - if (L = D - L, L > S && x.sane) { - f.msg = "invalid distance too far back", x.mode = e; + if (L = D - L, L > S && y.sane) { + f.msg = "invalid distance too far back", y.mode = e; break e; } - if (R = 0, B = o, n === 0) { - if (R += A - L, L < T) { + if (I = 0, z = o, s === 0) { + if (I += A - L, L < T) { T -= L; do - z[E++] = o[R++]; + B[E++] = o[I++]; while (--L); - R = E - D, B = z; + I = E - D, z = B; } - } else if (n < L) { - if (R += A + n - L, L -= n, L < T) { + } else if (s < L) { + if (I += A + s - L, L -= s, L < T) { T -= L; do - z[E++] = o[R++]; + B[E++] = o[I++]; while (--L); - if (R = 0, n < T) { - L = n, T -= L; + if (I = 0, s < T) { + L = s, T -= L; do - z[E++] = o[R++]; + B[E++] = o[I++]; while (--L); - R = E - D, B = z; + I = E - D, z = B; } } - } else if (R += n - L, L < T) { + } else if (I += s - L, L < T) { T -= L; do - z[E++] = o[R++]; + B[E++] = o[I++]; while (--L); - R = E - D, B = z; + I = E - D, z = B; } for (; T > 2; ) - z[E++] = B[R++], z[E++] = B[R++], z[E++] = B[R++], T -= 3; - T && (z[E++] = B[R++], T > 1 && (z[E++] = B[R++])); + B[E++] = z[I++], B[E++] = z[I++], B[E++] = z[I++], T -= 3; + T && (B[E++] = z[I++], T > 1 && (B[E++] = z[I++])); } else { - R = E - D; + I = E - D; do - z[E++] = z[R++], z[E++] = z[R++], z[E++] = z[R++], T -= 3; + B[E++] = B[I++], B[E++] = B[I++], B[E++] = B[I++], T -= 3; while (T > 2); - T && (z[E++] = z[R++], T > 1 && (z[E++] = z[R++])); + T && (B[E++] = B[I++], T > 1 && (B[E++] = B[I++])); } } else if (L & 64) { - f.msg = "invalid distance code", x.mode = e; + f.msg = "invalid distance code", y.mode = e; break e; } else { M = a[(M & 65535) + (w & (1 << L) - 1)]; @@ -21469,10 +21469,10 @@ ATOM`, g); } } else if (L & 64) if (L & 32) { - x.mode = t; + y.mode = t; break e; } else { - f.msg = "invalid literal/length code", x.mode = e; + f.msg = "invalid literal/length code", y.mode = e; break e; } else { @@ -21481,8 +21481,8 @@ ATOM`, g); } break; } - } while (h < u && E < C); - T = p >> 3, h -= T, p -= T << 3, w &= (1 << p) - 1, f.next_in = h, f.next_out = E, f.avail_in = h < u ? 5 + (u - h) : 5 - (h - u), f.avail_out = E < C ? 257 + (C - E) : 257 - (E - C), x.hold = w, x.bits = p; + } while (h < _ && E < C); + T = p >> 3, h -= T, p -= T << 3, w &= (1 << p) - 1, f.next_in = h, f.next_out = E, f.avail_in = h < _ ? 5 + (_ - h) : 5 - (h - _), f.avail_out = E < C ? 257 + (C - E) : 257 - (E - C), y.hold = w, y.bits = p; }; } ), @@ -21493,31 +21493,31 @@ ATOM`, g); \********************************************************************/ /***/ (r, e, t) => { - var s = t( + var n = t( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" ), f = t( /*! ./adler32 */ "./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js" - ), _ = t( + ), u = t( /*! ./crc32 */ "./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js" - ), x = t( + ), y = t( /*! ./inffast */ "./node_modules/upng-js/node_modules/pako/lib/zlib/inffast.js" ), h = t( /*! ./inftrees */ "./node_modules/upng-js/node_modules/pako/lib/zlib/inftrees.js" - ), u = 0, E = 1, c = 2, C = 4, b = 5, A = 6, S = 0, n = 1, o = 2, w = -2, p = -3, v = -4, a = -5, l = 8, g = 1, M = 2, L = 3, T = 4, D = 5, R = 6, B = 7, P = 8, z = 9, F = 10, N = 11, $ = 12, k = 13, G = 14, H = 15, U = 16, V = 17, Q = 18, oe = 19, ee = 20, ne = 21, me = 22, se = 23, fe = 24, Ce = 25, Me = 26, Te = 27, ae = 28, pe = 29, we = 30, ke = 31, Ue = 32, Ne = 852, Be = 592, ue = 15, ye = ue; + ), _ = 0, E = 1, c = 2, C = 4, b = 5, A = 6, S = 0, s = 1, o = 2, w = -2, p = -3, v = -4, a = -5, l = 8, g = 1, M = 2, L = 3, T = 4, D = 5, I = 6, z = 7, P = 8, B = 9, F = 10, N = 11, $ = 12, k = 13, G = 14, H = 15, U = 16, V = 17, Q = 18, ae = 19, oe = 20, q = 21, me = 22, ne = 23, fe = 24, Ce = 25, Me = 26, Te = 27, se = 28, pe = 29, we = 30, ke = 31, Ue = 32, Ne = 852, Be = 592, ue = 15, ye = ue; function ge(he) { return (he >>> 24 & 255) + (he >>> 8 & 65280) + ((he & 65280) << 8) + ((he & 255) << 24); } function Se() { - this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new s.Buf16(320), this.work = new s.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0; + this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new n.Buf16(320), this.work = new n.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0; } function ze(he) { var Oe; - return !he || !he.state ? w : (Oe = he.state, he.total_in = he.total_out = Oe.total = 0, he.msg = "", Oe.wrap && (he.adler = Oe.wrap & 1), Oe.mode = g, Oe.last = 0, Oe.havedict = 0, Oe.dmax = 32768, Oe.head = null, Oe.hold = 0, Oe.bits = 0, Oe.lencode = Oe.lendyn = new s.Buf32(Ne), Oe.distcode = Oe.distdyn = new s.Buf32(Be), Oe.sane = 1, Oe.back = -1, S); + return !he || !he.state ? w : (Oe = he.state, he.total_in = he.total_out = Oe.total = 0, he.msg = "", Oe.wrap && (he.adler = Oe.wrap & 1), Oe.mode = g, Oe.last = 0, Oe.havedict = 0, Oe.dmax = 32768, Oe.head = null, Oe.hold = 0, Oe.bits = 0, Oe.lencode = Oe.lendyn = new n.Buf32(Ne), Oe.distcode = Oe.distdyn = new n.Buf32(Be), Oe.sane = 1, Oe.back = -1, S); } function He(he) { var Oe; @@ -21534,11 +21534,11 @@ ATOM`, g); function K(he) { return Y(he, ye); } - var q = !0, de, ve; + var ee = !0, de, ve; function Ie(he) { - if (q) { + if (ee) { var Oe; - for (de = new s.Buf32(512), ve = new s.Buf32(32), Oe = 0; Oe < 144; ) + for (de = new n.Buf32(512), ve = new n.Buf32(32), Oe = 0; Oe < 144; ) he.lens[Oe++] = 8; for (; Oe < 256; ) he.lens[Oe++] = 9; @@ -21548,22 +21548,22 @@ ATOM`, g); he.lens[Oe++] = 8; for (h(E, he.lens, 0, 288, de, 0, he.work, { bits: 9 }), Oe = 0; Oe < 32; ) he.lens[Oe++] = 5; - h(c, he.lens, 0, 32, ve, 0, he.work, { bits: 5 }), q = !1; + h(c, he.lens, 0, 32, ve, 0, he.work, { bits: 5 }), ee = !1; } he.lencode = de, he.lenbits = 9, he.distcode = ve, he.distbits = 5; } function Re(he, Oe, j, $e) { - var Ve, I = he.state; - return I.window === null && (I.wsize = 1 << I.wbits, I.wnext = 0, I.whave = 0, I.window = new s.Buf8(I.wsize)), $e >= I.wsize ? (s.arraySet(I.window, Oe, j - I.wsize, I.wsize, 0), I.wnext = 0, I.whave = I.wsize) : (Ve = I.wsize - I.wnext, Ve > $e && (Ve = $e), s.arraySet(I.window, Oe, j - $e, Ve, I.wnext), $e -= Ve, $e ? (s.arraySet(I.window, Oe, j - $e, $e, 0), I.wnext = $e, I.whave = I.wsize) : (I.wnext += Ve, I.wnext === I.wsize && (I.wnext = 0), I.whave < I.wsize && (I.whave += Ve))), 0; + var Ve, R = he.state; + return R.window === null && (R.wsize = 1 << R.wbits, R.wnext = 0, R.whave = 0, R.window = new n.Buf8(R.wsize)), $e >= R.wsize ? (n.arraySet(R.window, Oe, j - R.wsize, R.wsize, 0), R.wnext = 0, R.whave = R.wsize) : (Ve = R.wsize - R.wnext, Ve > $e && (Ve = $e), n.arraySet(R.window, Oe, j - $e, Ve, R.wnext), $e -= Ve, $e ? (n.arraySet(R.window, Oe, j - $e, $e, 0), R.wnext = $e, R.whave = R.wsize) : (R.wnext += Ve, R.wnext === R.wsize && (R.wnext = 0), R.whave < R.wsize && (R.whave += Ve))), 0; } function Z(he, Oe) { - var j, $e, Ve, I, be, Ee, X, le, Le, Ze, Ke, je, Je, Lt, rt = 0, it, tt, Et, lt, wt, Pt, vt, bt, mt = new s.Buf8(4), Tt, Ot, Ft = ( + var j, $e, Ve, R, be, Ee, X, le, Le, Ze, Ke, je, Je, Lt, rt = 0, it, tt, Et, lt, wt, Pt, vt, bt, mt = new n.Buf8(4), Tt, Ot, Ft = ( /* permutation of code lengths */ [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15] ); if (!he || !he.state || !he.output || !he.input && he.avail_in !== 0) return w; - j = he.state, j.mode === $ && (j.mode = k), be = he.next_out, Ve = he.output, X = he.avail_out, I = he.next_in, $e = he.input, Ee = he.avail_in, le = j.hold, Le = j.bits, Ze = Ee, Ke = X, bt = S; + j = he.state, j.mode === $ && (j.mode = k), be = he.next_out, Ve = he.output, X = he.avail_out, R = he.next_in, $e = he.input, Ee = he.avail_in, le = j.hold, Le = j.bits, Ze = Ee, Ke = X, bt = S; e: for (; ; ) switch (j.mode) { @@ -21575,10 +21575,10 @@ ATOM`, g); for (; Le < 16; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } if (j.wrap & 2 && le === 35615) { - j.check = 0, mt[0] = le & 255, mt[1] = le >>> 8 & 255, j.check = _(j.check, mt, 2, 0), le = 0, Le = 0, j.mode = M; + j.check = 0, mt[0] = le & 255, mt[1] = le >>> 8 & 255, j.check = u(j.check, mt, 2, 0), le = 0, Le = 0, j.mode = M; break; } if (j.flags = 0, j.head && (j.head.done = !1), !(j.wrap & 1) || /* check if zlib header allowed */ @@ -21602,7 +21602,7 @@ ATOM`, g); for (; Le < 16; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } if (j.flags = le, (j.flags & 255) !== l) { he.msg = "unknown compression method", j.mode = we; @@ -21612,54 +21612,54 @@ ATOM`, g); he.msg = "unknown header flags set", j.mode = we; break; } - j.head && (j.head.text = le >> 8 & 1), j.flags & 512 && (mt[0] = le & 255, mt[1] = le >>> 8 & 255, j.check = _(j.check, mt, 2, 0)), le = 0, Le = 0, j.mode = L; + j.head && (j.head.text = le >> 8 & 1), j.flags & 512 && (mt[0] = le & 255, mt[1] = le >>> 8 & 255, j.check = u(j.check, mt, 2, 0)), le = 0, Le = 0, j.mode = L; case L: for (; Le < 32; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } - j.head && (j.head.time = le), j.flags & 512 && (mt[0] = le & 255, mt[1] = le >>> 8 & 255, mt[2] = le >>> 16 & 255, mt[3] = le >>> 24 & 255, j.check = _(j.check, mt, 4, 0)), le = 0, Le = 0, j.mode = T; + j.head && (j.head.time = le), j.flags & 512 && (mt[0] = le & 255, mt[1] = le >>> 8 & 255, mt[2] = le >>> 16 & 255, mt[3] = le >>> 24 & 255, j.check = u(j.check, mt, 4, 0)), le = 0, Le = 0, j.mode = T; case T: for (; Le < 16; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } - j.head && (j.head.xflags = le & 255, j.head.os = le >> 8), j.flags & 512 && (mt[0] = le & 255, mt[1] = le >>> 8 & 255, j.check = _(j.check, mt, 2, 0)), le = 0, Le = 0, j.mode = D; + j.head && (j.head.xflags = le & 255, j.head.os = le >> 8), j.flags & 512 && (mt[0] = le & 255, mt[1] = le >>> 8 & 255, j.check = u(j.check, mt, 2, 0)), le = 0, Le = 0, j.mode = D; case D: if (j.flags & 1024) { for (; Le < 16; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } - j.length = le, j.head && (j.head.extra_len = le), j.flags & 512 && (mt[0] = le & 255, mt[1] = le >>> 8 & 255, j.check = _(j.check, mt, 2, 0)), le = 0, Le = 0; + j.length = le, j.head && (j.head.extra_len = le), j.flags & 512 && (mt[0] = le & 255, mt[1] = le >>> 8 & 255, j.check = u(j.check, mt, 2, 0)), le = 0, Le = 0; } else j.head && (j.head.extra = null); - j.mode = R; - case R: - if (j.flags & 1024 && (je = j.length, je > Ee && (je = Ee), je && (j.head && (vt = j.head.extra_len - j.length, j.head.extra || (j.head.extra = new Array(j.head.extra_len)), s.arraySet( + j.mode = I; + case I: + if (j.flags & 1024 && (je = j.length, je > Ee && (je = Ee), je && (j.head && (vt = j.head.extra_len - j.length, j.head.extra || (j.head.extra = new Array(j.head.extra_len)), n.arraySet( j.head.extra, $e, - I, + R, // extra field is limited to 65536 bytes // - no need for additional size check je, /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ vt - )), j.flags & 512 && (j.check = _(j.check, $e, je, I)), Ee -= je, I += je, j.length -= je), j.length)) + )), j.flags & 512 && (j.check = u(j.check, $e, je, R)), Ee -= je, R += je, j.length -= je), j.length)) break e; - j.length = 0, j.mode = B; - case B: + j.length = 0, j.mode = z; + case z: if (j.flags & 2048) { if (Ee === 0) break e; je = 0; do - vt = $e[I + je++], j.head && vt && j.length < 65536 && (j.head.name += String.fromCharCode(vt)); + vt = $e[R + je++], j.head && vt && j.length < 65536 && (j.head.name += String.fromCharCode(vt)); while (vt && je < Ee); - if (j.flags & 512 && (j.check = _(j.check, $e, je, I)), Ee -= je, I += je, vt) + if (j.flags & 512 && (j.check = u(j.check, $e, je, R)), Ee -= je, R += je, vt) break e; } else j.head && (j.head.name = null); @@ -21670,19 +21670,19 @@ ATOM`, g); break e; je = 0; do - vt = $e[I + je++], j.head && vt && j.length < 65536 && (j.head.comment += String.fromCharCode(vt)); + vt = $e[R + je++], j.head && vt && j.length < 65536 && (j.head.comment += String.fromCharCode(vt)); while (vt && je < Ee); - if (j.flags & 512 && (j.check = _(j.check, $e, je, I)), Ee -= je, I += je, vt) + if (j.flags & 512 && (j.check = u(j.check, $e, je, R)), Ee -= je, R += je, vt) break e; } else j.head && (j.head.comment = null); - j.mode = z; - case z: + j.mode = B; + case B: if (j.flags & 512) { for (; Le < 16; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } if (le !== (j.check & 65535)) { he.msg = "header crc mismatch", j.mode = we; @@ -21696,12 +21696,12 @@ ATOM`, g); for (; Le < 32; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } he.adler = j.check = ge(le), le = 0, Le = 0, j.mode = N; case N: if (j.havedict === 0) - return he.next_out = be, he.avail_out = X, he.next_in = I, he.avail_in = Ee, j.hold = le, j.bits = Le, o; + return he.next_out = be, he.avail_out = X, he.next_in = R, he.avail_in = Ee, j.hold = le, j.bits = Le, o; he.adler = j.check = 1, j.mode = $; case $: if (Oe === b || Oe === A) @@ -21714,14 +21714,14 @@ ATOM`, g); for (; Le < 3; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } switch (j.last = le & 1, le >>>= 1, Le -= 1, le & 3) { case 0: j.mode = G; break; case 1: - if (Ie(j), j.mode = ee, Oe === A) { + if (Ie(j), j.mode = oe, Oe === A) { le >>>= 2, Le -= 2; break e; } @@ -21738,7 +21738,7 @@ ATOM`, g); for (le >>>= Le & 7, Le -= Le & 7; Le < 32; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } if ((le & 65535) !== (le >>> 16 ^ 65535)) { he.msg = "invalid stored block lengths", j.mode = we; @@ -21752,7 +21752,7 @@ ATOM`, g); if (je = j.length, je) { if (je > Ee && (je = Ee), je > X && (je = X), je === 0) break e; - s.arraySet(Ve, $e, I, je, be), Ee -= je, I += je, X -= je, be += je, j.length -= je; + n.arraySet(Ve, $e, R, je, be), Ee -= je, R += je, X -= je, be += je, j.length -= je; break; } j.mode = $; @@ -21761,7 +21761,7 @@ ATOM`, g); for (; Le < 14; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } if (j.nlen = (le & 31) + 257, le >>>= 5, Le -= 5, j.ndist = (le & 31) + 1, le >>>= 5, Le -= 5, j.ncode = (le & 15) + 4, le >>>= 4, Le -= 4, j.nlen > 286 || j.ndist > 30) { he.msg = "too many length or distance symbols", j.mode = we; @@ -21773,23 +21773,23 @@ ATOM`, g); for (; Le < 3; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } j.lens[Ft[j.have++]] = le & 7, le >>>= 3, Le -= 3; } for (; j.have < 19; ) j.lens[Ft[j.have++]] = 0; - if (j.lencode = j.lendyn, j.lenbits = 7, Tt = { bits: j.lenbits }, bt = h(u, j.lens, 0, 19, j.lencode, 0, j.work, Tt), j.lenbits = Tt.bits, bt) { + if (j.lencode = j.lendyn, j.lenbits = 7, Tt = { bits: j.lenbits }, bt = h(_, j.lens, 0, 19, j.lencode, 0, j.work, Tt), j.lenbits = Tt.bits, bt) { he.msg = "invalid code lengths set", j.mode = we; break; } - j.have = 0, j.mode = oe; - case oe: + j.have = 0, j.mode = ae; + case ae: for (; j.have < j.nlen + j.ndist; ) { for (; rt = j.lencode[le & (1 << j.lenbits) - 1], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(it <= Le); ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } if (Et < 16) le >>>= it, Le -= it, j.lens[j.have++] = Et; @@ -21798,7 +21798,7 @@ ATOM`, g); for (Ot = it + 2; Le < Ot; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } if (le >>>= it, Le -= it, j.have === 0) { he.msg = "invalid bit length repeat", j.mode = we; @@ -21809,14 +21809,14 @@ ATOM`, g); for (Ot = it + 3; Le < Ot; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } le >>>= it, Le -= it, vt = 0, je = 3 + (le & 7), le >>>= 3, Le -= 3; } else { for (Ot = it + 7; Le < Ot; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } le >>>= it, Le -= it, vt = 0, je = 11 + (le & 127), le >>>= 7, Le -= 7; } @@ -21842,25 +21842,25 @@ ATOM`, g); he.msg = "invalid distances set", j.mode = we; break; } - if (j.mode = ee, Oe === A) + if (j.mode = oe, Oe === A) break e; - case ee: - j.mode = ne; - case ne: + case oe: + j.mode = q; + case q: if (Ee >= 6 && X >= 258) { - he.next_out = be, he.avail_out = X, he.next_in = I, he.avail_in = Ee, j.hold = le, j.bits = Le, x(he, Ke), be = he.next_out, Ve = he.output, X = he.avail_out, I = he.next_in, $e = he.input, Ee = he.avail_in, le = j.hold, Le = j.bits, j.mode === $ && (j.back = -1); + he.next_out = be, he.avail_out = X, he.next_in = R, he.avail_in = Ee, j.hold = le, j.bits = Le, y(he, Ke), be = he.next_out, Ve = he.output, X = he.avail_out, R = he.next_in, $e = he.input, Ee = he.avail_in, le = j.hold, Le = j.bits, j.mode === $ && (j.back = -1); break; } for (j.back = 0; rt = j.lencode[le & (1 << j.lenbits) - 1], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(it <= Le); ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } if (tt && !(tt & 240)) { for (lt = it, wt = tt, Pt = Et; rt = j.lencode[Pt + ((le & (1 << lt + wt) - 1) >> lt)], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(lt + it <= Le); ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } le >>>= lt, Le -= lt, j.back += lt; } @@ -21882,22 +21882,22 @@ ATOM`, g); for (Ot = j.extra; Le < Ot; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } j.length += le & (1 << j.extra) - 1, le >>>= j.extra, Le -= j.extra, j.back += j.extra; } - j.was = j.length, j.mode = se; - case se: + j.was = j.length, j.mode = ne; + case ne: for (; rt = j.distcode[le & (1 << j.distbits) - 1], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(it <= Le); ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } if (!(tt & 240)) { for (lt = it, wt = tt, Pt = Et; rt = j.distcode[Pt + ((le & (1 << lt + wt) - 1) >> lt)], it = rt >>> 24, tt = rt >>> 16 & 255, Et = rt & 65535, !(lt + it <= Le); ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } le >>>= lt, Le -= lt, j.back += lt; } @@ -21911,7 +21911,7 @@ ATOM`, g); for (Ot = j.extra; Le < Ot; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } j.offset += le & (1 << j.extra) - 1, le >>>= j.extra, Le -= j.extra, j.back += j.extra; } @@ -21935,34 +21935,34 @@ ATOM`, g); do Ve[be++] = Lt[Je++]; while (--je); - j.length === 0 && (j.mode = ne); + j.length === 0 && (j.mode = q); break; case Me: if (X === 0) break e; - Ve[be++] = j.length, X--, j.mode = ne; + Ve[be++] = j.length, X--, j.mode = q; break; case Te: if (j.wrap) { for (; Le < 32; ) { if (Ee === 0) break e; - Ee--, le |= $e[I++] << Le, Le += 8; + Ee--, le |= $e[R++] << Le, Le += 8; } if (Ke -= X, he.total_out += Ke, j.total += Ke, Ke && (he.adler = j.check = /*UPDATE(state.check, put - _out, _out);*/ - j.flags ? _(j.check, Ve, Ke, be - Ke) : f(j.check, Ve, Ke, be - Ke)), Ke = X, (j.flags ? le : ge(le)) !== j.check) { + j.flags ? u(j.check, Ve, Ke, be - Ke) : f(j.check, Ve, Ke, be - Ke)), Ke = X, (j.flags ? le : ge(le)) !== j.check) { he.msg = "incorrect data check", j.mode = we; break; } le = 0, Le = 0; } - j.mode = ae; - case ae: + j.mode = se; + case se: if (j.wrap && j.flags) { for (; Le < 32; ) { if (Ee === 0) break e; - Ee--, le += $e[I++] << Le, Le += 8; + Ee--, le += $e[R++] << Le, Le += 8; } if (le !== (j.total & 4294967295)) { he.msg = "incorrect length check", j.mode = we; @@ -21972,7 +21972,7 @@ ATOM`, g); } j.mode = pe; case pe: - bt = n; + bt = s; break e; case we: bt = p; @@ -21983,8 +21983,8 @@ ATOM`, g); default: return w; } - return he.next_out = be, he.avail_out = X, he.next_in = I, he.avail_in = Ee, j.hold = le, j.bits = Le, (j.wsize || Ke !== he.avail_out && j.mode < we && (j.mode < Te || Oe !== C)) && Re(he, he.output, he.next_out, Ke - he.avail_out), Ze -= he.avail_in, Ke -= he.avail_out, he.total_in += Ze, he.total_out += Ke, j.total += Ke, j.wrap && Ke && (he.adler = j.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ - j.flags ? _(j.check, Ve, Ke, he.next_out - Ke) : f(j.check, Ve, Ke, he.next_out - Ke)), he.data_type = j.bits + (j.last ? 64 : 0) + (j.mode === $ ? 128 : 0) + (j.mode === ee || j.mode === H ? 256 : 0), (Ze === 0 && Ke === 0 || Oe === C) && bt === S && (bt = a), bt; + return he.next_out = be, he.avail_out = X, he.next_in = R, he.avail_in = Ee, j.hold = le, j.bits = Le, (j.wsize || Ke !== he.avail_out && j.mode < we && (j.mode < Te || Oe !== C)) && Re(he, he.output, he.next_out, Ke - he.avail_out), Ze -= he.avail_in, Ke -= he.avail_out, he.total_in += Ze, he.total_out += Ke, j.total += Ke, j.wrap && Ke && (he.adler = j.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + j.flags ? u(j.check, Ve, Ke, he.next_out - Ke) : f(j.check, Ve, Ke, he.next_out - Ke)), he.data_type = j.bits + (j.last ? 64 : 0) + (j.mode === $ ? 128 : 0) + (j.mode === oe || j.mode === H ? 256 : 0), (Ze === 0 && Ke === 0 || Oe === C) && bt === S && (bt = a), bt; } function ce(he) { if (!he || !he.state) @@ -21997,8 +21997,8 @@ ATOM`, g); return !he || !he.state || (j = he.state, !(j.wrap & 2)) ? w : (j.head = Oe, Oe.done = !1, S); } function Fe(he, Oe) { - var j = Oe.length, $e, Ve, I; - return !he || !he.state || ($e = he.state, $e.wrap !== 0 && $e.mode !== N) ? w : $e.mode === N && (Ve = 1, Ve = f(Ve, Oe, j, 0), Ve !== $e.check) ? p : (I = Re(he, Oe, j, j), I ? ($e.mode = ke, v) : ($e.havedict = 1, S)); + var j = Oe.length, $e, Ve, R; + return !he || !he.state || ($e = he.state, $e.wrap !== 0 && $e.mode !== N) ? w : $e.mode === N && (Ve = 1, Ve = f(Ve, Oe, j, 0), Ve !== $e.check) ? p : (R = Re(he, Oe, j, j), R ? ($e.mode = ke, v) : ($e.havedict = 1, S)); } e.inflateReset = He, e.inflateReset2 = We, e.inflateResetKeep = ze, e.inflateInit = K, e.inflateInit2 = Y, e.inflate = Z, e.inflateEnd = ce, e.inflateGetHeader = Ae, e.inflateSetDictionary = Fe, e.inflateInfo = "pako inflate (from Nodeca project)"; } @@ -22010,10 +22010,10 @@ ATOM`, g); \*********************************************************************/ /***/ (r, e, t) => { - var s = t( + var n = t( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), f = 15, _ = 852, x = 592, h = 0, u = 1, E = 2, c = [ + ), f = 15, u = 852, y = 592, h = 0, _ = 1, E = 2, c = [ /* Length codes 257..285 base */ 3, 4, @@ -22148,50 +22148,50 @@ ATOM`, g); 64, 64 ]; - r.exports = function(n, o, w, p, v, a, l, g) { - var M = g.bits, L = 0, T = 0, D = 0, R = 0, B = 0, P = 0, z = 0, F = 0, N = 0, $ = 0, k, G, H, U, V, Q = null, oe = 0, ee, ne = new s.Buf16(f + 1), me = new s.Buf16(f + 1), se = null, fe = 0, Ce, Me, Te; + r.exports = function(s, o, w, p, v, a, l, g) { + var M = g.bits, L = 0, T = 0, D = 0, I = 0, z = 0, P = 0, B = 0, F = 0, N = 0, $ = 0, k, G, H, U, V, Q = null, ae = 0, oe, q = new n.Buf16(f + 1), me = new n.Buf16(f + 1), ne = null, fe = 0, Ce, Me, Te; for (L = 0; L <= f; L++) - ne[L] = 0; + q[L] = 0; for (T = 0; T < p; T++) - ne[o[w + T]]++; - for (B = M, R = f; R >= 1 && ne[R] === 0; R--) + q[o[w + T]]++; + for (z = M, I = f; I >= 1 && q[I] === 0; I--) ; - if (B > R && (B = R), R === 0) + if (z > I && (z = I), I === 0) return v[a++] = 20971520, v[a++] = 20971520, g.bits = 1, 0; - for (D = 1; D < R && ne[D] === 0; D++) + for (D = 1; D < I && q[D] === 0; D++) ; - for (B < D && (B = D), F = 1, L = 1; L <= f; L++) - if (F <<= 1, F -= ne[L], F < 0) + for (z < D && (z = D), F = 1, L = 1; L <= f; L++) + if (F <<= 1, F -= q[L], F < 0) return -1; - if (F > 0 && (n === h || R !== 1)) + if (F > 0 && (s === h || I !== 1)) return -1; for (me[1] = 0, L = 1; L < f; L++) - me[L + 1] = me[L] + ne[L]; + me[L + 1] = me[L] + q[L]; for (T = 0; T < p; T++) o[w + T] !== 0 && (l[me[o[w + T]]++] = T); - if (n === h ? (Q = se = l, ee = 19) : n === u ? (Q = c, oe -= 257, se = C, fe -= 257, ee = 256) : (Q = b, se = A, ee = -1), $ = 0, T = 0, L = D, V = a, P = B, z = 0, H = -1, N = 1 << B, U = N - 1, n === u && N > _ || n === E && N > x) + if (s === h ? (Q = ne = l, oe = 19) : s === _ ? (Q = c, ae -= 257, ne = C, fe -= 257, oe = 256) : (Q = b, ne = A, oe = -1), $ = 0, T = 0, L = D, V = a, P = z, B = 0, H = -1, N = 1 << z, U = N - 1, s === _ && N > u || s === E && N > y) return 1; for (; ; ) { - Ce = L - z, l[T] < ee ? (Me = 0, Te = l[T]) : l[T] > ee ? (Me = se[fe + l[T]], Te = Q[oe + l[T]]) : (Me = 96, Te = 0), k = 1 << L - z, G = 1 << P, D = G; + Ce = L - B, l[T] < oe ? (Me = 0, Te = l[T]) : l[T] > oe ? (Me = ne[fe + l[T]], Te = Q[ae + l[T]]) : (Me = 96, Te = 0), k = 1 << L - B, G = 1 << P, D = G; do - G -= k, v[V + ($ >> z) + G] = Ce << 24 | Me << 16 | Te | 0; + G -= k, v[V + ($ >> B) + G] = Ce << 24 | Me << 16 | Te | 0; while (G !== 0); for (k = 1 << L - 1; $ & k; ) k >>= 1; - if (k !== 0 ? ($ &= k - 1, $ += k) : $ = 0, T++, --ne[L] === 0) { - if (L === R) + if (k !== 0 ? ($ &= k - 1, $ += k) : $ = 0, T++, --q[L] === 0) { + if (L === I) break; L = o[w + l[T]]; } - if (L > B && ($ & U) !== H) { - for (z === 0 && (z = B), V += D, P = L - z, F = 1 << P; P + z < R && (F -= ne[P + z], !(F <= 0)); ) + if (L > z && ($ & U) !== H) { + for (B === 0 && (B = z), V += D, P = L - B, F = 1 << P; P + B < I && (F -= q[P + B], !(F <= 0)); ) P++, F <<= 1; - if (N += 1 << P, n === u && N > _ || n === E && N > x) + if (N += 1 << P, s === _ && N > u || s === E && N > y) return 1; - H = $ & U, v[H] = B << 24 | P << 16 | V - a | 0; + H = $ & U, v[H] = z << 24 | P << 16 | V - a | 0; } } - return $ !== 0 && (v[V + $] = L - z << 24 | 4194304 | 0), g.bits = B, 0; + return $ !== 0 && (v[V + $] = L - B << 24 | 4194304 | 0), g.bits = z, 0; }; } ), @@ -22231,50 +22231,50 @@ ATOM`, g); \******************************************************************/ /***/ (r, e, t) => { - var s = t( + var n = t( /*! ../utils/common */ "./node_modules/upng-js/node_modules/pako/lib/utils/common.js" - ), f = 4, _ = 0, x = 1, h = 2; - function u(Z) { + ), f = 4, u = 0, y = 1, h = 2; + function _(Z) { for (var ce = Z.length; --ce >= 0; ) Z[ce] = 0; } - var E = 0, c = 1, C = 2, b = 3, A = 258, S = 29, n = 256, o = n + 1 + S, w = 30, p = 19, v = 2 * o + 1, a = 15, l = 16, g = 7, M = 256, L = 16, T = 17, D = 18, R = ( + var E = 0, c = 1, C = 2, b = 3, A = 258, S = 29, s = 256, o = s + 1 + S, w = 30, p = 19, v = 2 * o + 1, a = 15, l = 16, g = 7, M = 256, L = 16, T = 17, D = 18, I = ( /* extra bits for each length code */ [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0] - ), B = ( + ), z = ( /* extra bits for each distance code */ [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13] ), P = ( /* extra bits for each bit length code */ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7] - ), z = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], F = 512, N = new Array((o + 2) * 2); - u(N); + ), B = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], F = 512, N = new Array((o + 2) * 2); + _(N); var $ = new Array(w * 2); - u($); + _($); var k = new Array(F); - u(k); + _(k); var G = new Array(A - b + 1); - u(G); + _(G); var H = new Array(S); - u(H); + _(H); var U = new Array(w); - u(U); + _(U); function V(Z, ce, Ae, Fe, he) { this.static_tree = Z, this.extra_bits = ce, this.extra_base = Ae, this.elems = Fe, this.max_length = he, this.has_stree = Z && Z.length; } - var Q, oe, ee; - function ne(Z, ce) { + var Q, ae, oe; + function q(Z, ce) { this.dyn_tree = Z, this.max_code = 0, this.stat_desc = ce; } function me(Z) { return Z < 256 ? k[Z] : k[256 + (Z >>> 7)]; } - function se(Z, ce) { + function ne(Z, ce) { Z.pending_buf[Z.pending++] = ce & 255, Z.pending_buf[Z.pending++] = ce >>> 8 & 255; } function fe(Z, ce, Ae) { - Z.bi_valid > l - Ae ? (Z.bi_buf |= ce << Z.bi_valid & 65535, se(Z, Z.bi_buf), Z.bi_buf = ce >> l - Z.bi_valid, Z.bi_valid += Ae - l) : (Z.bi_buf |= ce << Z.bi_valid & 65535, Z.bi_valid += Ae); + Z.bi_valid > l - Ae ? (Z.bi_buf |= ce << Z.bi_valid & 65535, ne(Z, Z.bi_buf), Z.bi_buf = ce >> l - Z.bi_valid, Z.bi_valid += Ae - l) : (Z.bi_buf |= ce << Z.bi_valid & 65535, Z.bi_valid += Ae); } function Ce(Z, ce, Ae) { fe( @@ -22292,14 +22292,14 @@ ATOM`, g); return Ae >>> 1; } function Te(Z) { - Z.bi_valid === 16 ? (se(Z, Z.bi_buf), Z.bi_buf = 0, Z.bi_valid = 0) : Z.bi_valid >= 8 && (Z.pending_buf[Z.pending++] = Z.bi_buf & 255, Z.bi_buf >>= 8, Z.bi_valid -= 8); + Z.bi_valid === 16 ? (ne(Z, Z.bi_buf), Z.bi_buf = 0, Z.bi_valid = 0) : Z.bi_valid >= 8 && (Z.pending_buf[Z.pending++] = Z.bi_buf & 255, Z.bi_buf >>= 8, Z.bi_valid -= 8); } - function ae(Z, ce) { - var Ae = ce.dyn_tree, Fe = ce.max_code, he = ce.stat_desc.static_tree, Oe = ce.stat_desc.has_stree, j = ce.stat_desc.extra_bits, $e = ce.stat_desc.extra_base, Ve = ce.stat_desc.max_length, I, be, Ee, X, le, Le, Ze = 0; + function se(Z, ce) { + var Ae = ce.dyn_tree, Fe = ce.max_code, he = ce.stat_desc.static_tree, Oe = ce.stat_desc.has_stree, j = ce.stat_desc.extra_bits, $e = ce.stat_desc.extra_base, Ve = ce.stat_desc.max_length, R, be, Ee, X, le, Le, Ze = 0; for (X = 0; X <= a; X++) Z.bl_count[X] = 0; - for (Ae[Z.heap[Z.heap_max] * 2 + 1] = 0, I = Z.heap_max + 1; I < v; I++) - be = Z.heap[I], X = Ae[Ae[be * 2 + 1] * 2 + 1] + 1, X > Ve && (X = Ve, Ze++), Ae[be * 2 + 1] = X, !(be > Fe) && (Z.bl_count[X]++, le = 0, be >= $e && (le = j[be - $e]), Le = Ae[be * 2], Z.opt_len += Le * (X + le), Oe && (Z.static_len += Le * (he[be * 2 + 1] + le))); + for (Ae[Z.heap[Z.heap_max] * 2 + 1] = 0, R = Z.heap_max + 1; R < v; R++) + be = Z.heap[R], X = Ae[Ae[be * 2 + 1] * 2 + 1] + 1, X > Ve && (X = Ve, Ze++), Ae[be * 2 + 1] = X, !(be > Fe) && (Z.bl_count[X]++, le = 0, be >= $e && (le = j[be - $e]), Le = Ae[be * 2], Z.opt_len += Le * (X + le), Oe && (Z.static_len += Le * (he[be * 2 + 1] + le))); if (Ze !== 0) { do { for (X = Ve - 1; Z.bl_count[X] === 0; ) @@ -22308,7 +22308,7 @@ ATOM`, g); } while (Ze > 0); for (X = Ve; X !== 0; X--) for (be = Z.bl_count[X]; be !== 0; ) - Ee = Z.heap[--I], !(Ee > Fe) && (Ae[Ee * 2 + 1] !== X && (Z.opt_len += (X - Ae[Ee * 2 + 1]) * Ae[Ee * 2], Ae[Ee * 2 + 1] = X), be--); + Ee = Z.heap[--R], !(Ee > Fe) && (Ae[Ee * 2 + 1] !== X && (Z.opt_len += (X - Ae[Ee * 2 + 1]) * Ae[Ee * 2], Ae[Ee * 2 + 1] = X), be--); } } function pe(Z, ce, Ae) { @@ -22323,13 +22323,13 @@ ATOM`, g); function we() { var Z, ce, Ae, Fe, he, Oe = new Array(a + 1); for (Ae = 0, Fe = 0; Fe < S - 1; Fe++) - for (H[Fe] = Ae, Z = 0; Z < 1 << R[Fe]; Z++) + for (H[Fe] = Ae, Z = 0; Z < 1 << I[Fe]; Z++) G[Ae++] = Fe; for (G[Ae - 1] = Fe, he = 0, Fe = 0; Fe < 16; Fe++) - for (U[Fe] = he, Z = 0; Z < 1 << B[Fe]; Z++) + for (U[Fe] = he, Z = 0; Z < 1 << z[Fe]; Z++) k[he++] = Fe; for (he >>= 7; Fe < w; Fe++) - for (U[Fe] = he << 7, Z = 0; Z < 1 << B[Fe] - 7; Z++) + for (U[Fe] = he << 7, Z = 0; Z < 1 << z[Fe] - 7; Z++) k[256 + he++] = Fe; for (ce = 0; ce <= a; ce++) Oe[ce] = 0; @@ -22343,7 +22343,7 @@ ATOM`, g); N[Z * 2 + 1] = 8, Z++, Oe[8]++; for (pe(N, o + 1, Oe), Z = 0; Z < w; Z++) $[Z * 2 + 1] = 5, $[Z * 2] = Me(Z, 5); - Q = new V(N, R, n + 1, o, a), oe = new V($, B, 0, w, a), ee = new V(new Array(0), P, 0, p, g); + Q = new V(N, I, s + 1, o, a), ae = new V($, z, 0, w, a), oe = new V(new Array(0), P, 0, p, g); } function ke(Z) { var ce; @@ -22356,10 +22356,10 @@ ATOM`, g); Z.dyn_ltree[M * 2] = 1, Z.opt_len = Z.static_len = 0, Z.last_lit = Z.matches = 0; } function Ue(Z) { - Z.bi_valid > 8 ? se(Z, Z.bi_buf) : Z.bi_valid > 0 && (Z.pending_buf[Z.pending++] = Z.bi_buf), Z.bi_buf = 0, Z.bi_valid = 0; + Z.bi_valid > 8 ? ne(Z, Z.bi_buf) : Z.bi_valid > 0 && (Z.pending_buf[Z.pending++] = Z.bi_buf), Z.bi_buf = 0, Z.bi_valid = 0; } function Ne(Z, ce, Ae, Fe) { - Ue(Z), Fe && (se(Z, Ae), se(Z, ~Ae)), s.arraySet(Z.pending_buf, Z.window, ce, Ae, Z.pending), Z.pending += Ae; + Ue(Z), Fe && (ne(Z, Ae), ne(Z, ~Ae)), n.arraySet(Z.pending_buf, Z.window, ce, Ae, Z.pending), Z.pending += Ae; } function Be(Z, ce, Ae, Fe) { var he = ce * 2, Oe = Ae * 2; @@ -22374,19 +22374,19 @@ ATOM`, g); var Fe, he, Oe = 0, j, $e; if (Z.last_lit !== 0) do - Fe = Z.pending_buf[Z.d_buf + Oe * 2] << 8 | Z.pending_buf[Z.d_buf + Oe * 2 + 1], he = Z.pending_buf[Z.l_buf + Oe], Oe++, Fe === 0 ? Ce(Z, he, ce) : (j = G[he], Ce(Z, j + n + 1, ce), $e = R[j], $e !== 0 && (he -= H[j], fe(Z, he, $e)), Fe--, j = me(Fe), Ce(Z, j, Ae), $e = B[j], $e !== 0 && (Fe -= U[j], fe(Z, Fe, $e))); + Fe = Z.pending_buf[Z.d_buf + Oe * 2] << 8 | Z.pending_buf[Z.d_buf + Oe * 2 + 1], he = Z.pending_buf[Z.l_buf + Oe], Oe++, Fe === 0 ? Ce(Z, he, ce) : (j = G[he], Ce(Z, j + s + 1, ce), $e = I[j], $e !== 0 && (he -= H[j], fe(Z, he, $e)), Fe--, j = me(Fe), Ce(Z, j, Ae), $e = z[j], $e !== 0 && (Fe -= U[j], fe(Z, Fe, $e))); while (Oe < Z.last_lit); Ce(Z, M, ce); } function ge(Z, ce) { - var Ae = ce.dyn_tree, Fe = ce.stat_desc.static_tree, he = ce.stat_desc.has_stree, Oe = ce.stat_desc.elems, j, $e, Ve = -1, I; + var Ae = ce.dyn_tree, Fe = ce.stat_desc.static_tree, he = ce.stat_desc.has_stree, Oe = ce.stat_desc.elems, j, $e, Ve = -1, R; for (Z.heap_len = 0, Z.heap_max = v, j = 0; j < Oe; j++) Ae[j * 2] !== 0 ? (Z.heap[++Z.heap_len] = Ve = j, Z.depth[j] = 0) : Ae[j * 2 + 1] = 0; for (; Z.heap_len < 2; ) - I = Z.heap[++Z.heap_len] = Ve < 2 ? ++Ve : 0, Ae[I * 2] = 1, Z.depth[I] = 0, Z.opt_len--, he && (Z.static_len -= Fe[I * 2 + 1]); + R = Z.heap[++Z.heap_len] = Ve < 2 ? ++Ve : 0, Ae[R * 2] = 1, Z.depth[R] = 0, Z.opt_len--, he && (Z.static_len -= Fe[R * 2 + 1]); for (ce.max_code = Ve, j = Z.heap_len >> 1; j >= 1; j--) ue(Z, Ae, j); - I = Oe; + R = Oe; do j = Z.heap[ 1 @@ -22402,10 +22402,10 @@ ATOM`, g); ), $e = Z.heap[ 1 /*SMALLEST*/ - ], Z.heap[--Z.heap_max] = j, Z.heap[--Z.heap_max] = $e, Ae[I * 2] = Ae[j * 2] + Ae[$e * 2], Z.depth[I] = (Z.depth[j] >= Z.depth[$e] ? Z.depth[j] : Z.depth[$e]) + 1, Ae[j * 2 + 1] = Ae[$e * 2 + 1] = I, Z.heap[ + ], Z.heap[--Z.heap_max] = j, Z.heap[--Z.heap_max] = $e, Ae[R * 2] = Ae[j * 2] + Ae[$e * 2], Z.depth[R] = (Z.depth[j] >= Z.depth[$e] ? Z.depth[j] : Z.depth[$e]) + 1, Ae[j * 2 + 1] = Ae[$e * 2 + 1] = R, Z.heap[ 1 /*SMALLEST*/ - ] = I++, ue( + ] = R++, ue( Z, Ae, 1 @@ -22415,53 +22415,53 @@ ATOM`, g); Z.heap[--Z.heap_max] = Z.heap[ 1 /*SMALLEST*/ - ], ae(Z, ce), pe(Ae, Ve, Z.bl_count); + ], se(Z, ce), pe(Ae, Ve, Z.bl_count); } function Se(Z, ce, Ae) { - var Fe, he = -1, Oe, j = ce[0 * 2 + 1], $e = 0, Ve = 7, I = 4; - for (j === 0 && (Ve = 138, I = 3), ce[(Ae + 1) * 2 + 1] = 65535, Fe = 0; Fe <= Ae; Fe++) - Oe = j, j = ce[(Fe + 1) * 2 + 1], !(++$e < Ve && Oe === j) && ($e < I ? Z.bl_tree[Oe * 2] += $e : Oe !== 0 ? (Oe !== he && Z.bl_tree[Oe * 2]++, Z.bl_tree[L * 2]++) : $e <= 10 ? Z.bl_tree[T * 2]++ : Z.bl_tree[D * 2]++, $e = 0, he = Oe, j === 0 ? (Ve = 138, I = 3) : Oe === j ? (Ve = 6, I = 3) : (Ve = 7, I = 4)); + var Fe, he = -1, Oe, j = ce[0 * 2 + 1], $e = 0, Ve = 7, R = 4; + for (j === 0 && (Ve = 138, R = 3), ce[(Ae + 1) * 2 + 1] = 65535, Fe = 0; Fe <= Ae; Fe++) + Oe = j, j = ce[(Fe + 1) * 2 + 1], !(++$e < Ve && Oe === j) && ($e < R ? Z.bl_tree[Oe * 2] += $e : Oe !== 0 ? (Oe !== he && Z.bl_tree[Oe * 2]++, Z.bl_tree[L * 2]++) : $e <= 10 ? Z.bl_tree[T * 2]++ : Z.bl_tree[D * 2]++, $e = 0, he = Oe, j === 0 ? (Ve = 138, R = 3) : Oe === j ? (Ve = 6, R = 3) : (Ve = 7, R = 4)); } function ze(Z, ce, Ae) { - var Fe, he = -1, Oe, j = ce[0 * 2 + 1], $e = 0, Ve = 7, I = 4; - for (j === 0 && (Ve = 138, I = 3), Fe = 0; Fe <= Ae; Fe++) + var Fe, he = -1, Oe, j = ce[0 * 2 + 1], $e = 0, Ve = 7, R = 4; + for (j === 0 && (Ve = 138, R = 3), Fe = 0; Fe <= Ae; Fe++) if (Oe = j, j = ce[(Fe + 1) * 2 + 1], !(++$e < Ve && Oe === j)) { - if ($e < I) + if ($e < R) do Ce(Z, Oe, Z.bl_tree); while (--$e !== 0); else Oe !== 0 ? (Oe !== he && (Ce(Z, Oe, Z.bl_tree), $e--), Ce(Z, L, Z.bl_tree), fe(Z, $e - 3, 2)) : $e <= 10 ? (Ce(Z, T, Z.bl_tree), fe(Z, $e - 3, 3)) : (Ce(Z, D, Z.bl_tree), fe(Z, $e - 11, 7)); - $e = 0, he = Oe, j === 0 ? (Ve = 138, I = 3) : Oe === j ? (Ve = 6, I = 3) : (Ve = 7, I = 4); + $e = 0, he = Oe, j === 0 ? (Ve = 138, R = 3) : Oe === j ? (Ve = 6, R = 3) : (Ve = 7, R = 4); } } function He(Z) { var ce; - for (Se(Z, Z.dyn_ltree, Z.l_desc.max_code), Se(Z, Z.dyn_dtree, Z.d_desc.max_code), ge(Z, Z.bl_desc), ce = p - 1; ce >= 3 && Z.bl_tree[z[ce] * 2 + 1] === 0; ce--) + for (Se(Z, Z.dyn_ltree, Z.l_desc.max_code), Se(Z, Z.dyn_dtree, Z.d_desc.max_code), ge(Z, Z.bl_desc), ce = p - 1; ce >= 3 && Z.bl_tree[B[ce] * 2 + 1] === 0; ce--) ; return Z.opt_len += 3 * (ce + 1) + 5 + 5 + 4, ce; } function We(Z, ce, Ae, Fe) { var he; for (fe(Z, ce - 257, 5), fe(Z, Ae - 1, 5), fe(Z, Fe - 4, 4), he = 0; he < Fe; he++) - fe(Z, Z.bl_tree[z[he] * 2 + 1], 3); + fe(Z, Z.bl_tree[B[he] * 2 + 1], 3); ze(Z, Z.dyn_ltree, ce - 1), ze(Z, Z.dyn_dtree, Ae - 1); } function Y(Z) { var ce = 4093624447, Ae; for (Ae = 0; Ae <= 31; Ae++, ce >>>= 1) if (ce & 1 && Z.dyn_ltree[Ae * 2] !== 0) - return _; + return u; if (Z.dyn_ltree[18] !== 0 || Z.dyn_ltree[20] !== 0 || Z.dyn_ltree[26] !== 0) - return x; - for (Ae = 32; Ae < n; Ae++) + return y; + for (Ae = 32; Ae < s; Ae++) if (Z.dyn_ltree[Ae * 2] !== 0) - return x; - return _; + return y; + return u; } var K = !1; - function q(Z) { - K || (we(), K = !0), Z.l_desc = new ne(Z.dyn_ltree, Q), Z.d_desc = new ne(Z.dyn_dtree, oe), Z.bl_desc = new ne(Z.bl_tree, ee), Z.bi_buf = 0, Z.bi_valid = 0, ke(Z); + function ee(Z) { + K || (we(), K = !0), Z.l_desc = new q(Z.dyn_ltree, Q), Z.d_desc = new q(Z.dyn_dtree, ae), Z.bl_desc = new q(Z.bl_tree, oe), Z.bi_buf = 0, Z.bi_valid = 0, ke(Z); } function de(Z, ce, Ae, Fe) { fe(Z, (E << 1) + (Fe ? 1 : 0), 3), Ne(Z, ce, Ae, !0); @@ -22474,9 +22474,9 @@ ATOM`, g); Z.level > 0 ? (Z.strm.data_type === h && (Z.strm.data_type = Y(Z)), ge(Z, Z.l_desc), ge(Z, Z.d_desc), j = He(Z), he = Z.opt_len + 3 + 7 >>> 3, Oe = Z.static_len + 3 + 7 >>> 3, Oe <= he && (he = Oe)) : he = Oe = Ae + 5, Ae + 4 <= he && ce !== -1 ? de(Z, ce, Ae, Fe) : Z.strategy === f || Oe === he ? (fe(Z, (c << 1) + (Fe ? 1 : 0), 3), ye(Z, N, $)) : (fe(Z, (C << 1) + (Fe ? 1 : 0), 3), We(Z, Z.l_desc.max_code + 1, Z.d_desc.max_code + 1, j + 1), ye(Z, Z.dyn_ltree, Z.dyn_dtree)), ke(Z), Fe && Ue(Z); } function Re(Z, ce, Ae) { - return Z.pending_buf[Z.d_buf + Z.last_lit * 2] = ce >>> 8 & 255, Z.pending_buf[Z.d_buf + Z.last_lit * 2 + 1] = ce & 255, Z.pending_buf[Z.l_buf + Z.last_lit] = Ae & 255, Z.last_lit++, ce === 0 ? Z.dyn_ltree[Ae * 2]++ : (Z.matches++, ce--, Z.dyn_ltree[(G[Ae] + n + 1) * 2]++, Z.dyn_dtree[me(ce) * 2]++), Z.last_lit === Z.lit_bufsize - 1; + return Z.pending_buf[Z.d_buf + Z.last_lit * 2] = ce >>> 8 & 255, Z.pending_buf[Z.d_buf + Z.last_lit * 2 + 1] = ce & 255, Z.pending_buf[Z.l_buf + Z.last_lit] = Ae & 255, Z.last_lit++, ce === 0 ? Z.dyn_ltree[Ae * 2]++ : (Z.matches++, ce--, Z.dyn_ltree[(G[Ae] + s + 1) * 2]++, Z.dyn_dtree[me(ce) * 2]++), Z.last_lit === Z.lit_bufsize - 1; } - e._tr_init = q, e._tr_stored_block = de, e._tr_flush_block = Ie, e._tr_tally = Re, e._tr_align = ve; + e._tr_init = ee, e._tr_stored_block = de, e._tr_flush_block = Ie, e._tr_tally = Re, e._tr_align = ve; } ), /***/ @@ -22505,9 +22505,9 @@ ATOM`, g); if (t < 0) self.atomData = e.atoms, self.volume = e.volume, self.ps = new ProteinSurface(); else { - var s = self.ps; - s.initparm(e.expandedExtent, t != 1, self.volume), s.fillvoxels(self.atomData, e.extendedAtoms), s.buildboundary(), (t === 4 || t === 2) && (s.fastdistancemap(), s.boundingatom(!1), s.fillvoxelswaals(self.atomData, e.extendedAtoms)), s.marchingcube(t); - var f = s.getFacesAndVertices(e.atomsToShow); + var n = self.ps; + n.initparm(e.expandedExtent, t != 1, self.volume), n.fillvoxels(self.atomData, e.extendedAtoms), n.buildboundary(), (t === 4 || t === 2) && (n.fastdistancemap(), n.boundingatom(!1), n.fillvoxelswaals(self.atomData, e.extendedAtoms)), n.marchingcube(t); + var f = n.getFacesAndVertices(e.atomsToShow); self.postMessage(f); } }; @@ -22540,12 +22540,12 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; \****************************/ /***/ function(r, e) { - (function(t, s) { - s(e); + (function(t, n) { + n(e); })(this, function(t) { - function s(Y, K, q) { - for (var de = (Y.byteLength, 0), ve = q.length; ve > de; de++) { - var Ie = q.charCodeAt(de); + function n(Y, K, ee) { + for (var de = (Y.byteLength, 0), ve = ee.length; ve > de; de++) { + var Ie = ee.charCodeAt(de); if (128 > Ie) Y.setUint8(K++, Ie >>> 0 & 127 | 0); else if (2048 > Ie) @@ -22560,8 +22560,8 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } } function f(Y) { - for (var K = 0, q = 0, de = Y.length; de > q; q++) { - var ve = Y.charCodeAt(q); + for (var K = 0, ee = 0, de = Y.length; de > ee; ee++) { + var ve = Y.charCodeAt(ee); if (128 > ve) K += 1; else if (2048 > ve) @@ -22576,58 +22576,58 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } return K; } - function _(Y, K, q) { + function u(Y, K, ee) { var de = typeof Y; if (de === "string") { var ve = f(Y); if (32 > ve) - return K.setUint8(q, 160 | ve), s(K, q + 1, Y), 1 + ve; + return K.setUint8(ee, 160 | ve), n(K, ee + 1, Y), 1 + ve; if (256 > ve) - return K.setUint8(q, 217), K.setUint8(q + 1, ve), s(K, q + 2, Y), 2 + ve; + return K.setUint8(ee, 217), K.setUint8(ee + 1, ve), n(K, ee + 2, Y), 2 + ve; if (65536 > ve) - return K.setUint8(q, 218), K.setUint16(q + 1, ve), s(K, q + 3, Y), 3 + ve; + return K.setUint8(ee, 218), K.setUint16(ee + 1, ve), n(K, ee + 3, Y), 3 + ve; if (4294967296 > ve) - return K.setUint8(q, 219), K.setUint32(q + 1, ve), s(K, q + 5, Y), 5 + ve; + return K.setUint8(ee, 219), K.setUint32(ee + 1, ve), n(K, ee + 5, Y), 5 + ve; } if (Y instanceof Uint8Array) { var ve = Y.byteLength, Ie = new Uint8Array(K.buffer); if (256 > ve) - return K.setUint8(q, 196), K.setUint8(q + 1, ve), Ie.set(Y, q + 2), 2 + ve; + return K.setUint8(ee, 196), K.setUint8(ee + 1, ve), Ie.set(Y, ee + 2), 2 + ve; if (65536 > ve) - return K.setUint8(q, 197), K.setUint16(q + 1, ve), Ie.set(Y, q + 3), 3 + ve; + return K.setUint8(ee, 197), K.setUint16(ee + 1, ve), Ie.set(Y, ee + 3), 3 + ve; if (4294967296 > ve) - return K.setUint8(q, 198), K.setUint32(q + 1, ve), Ie.set(Y, q + 5), 5 + ve; + return K.setUint8(ee, 198), K.setUint32(ee + 1, ve), Ie.set(Y, ee + 5), 5 + ve; } if (de === "number") { if (!isFinite(Y)) throw new Error("Number not finite: " + Y); if (Math.floor(Y) !== Y) - return K.setUint8(q, 203), K.setFloat64(q + 1, Y), 9; + return K.setUint8(ee, 203), K.setFloat64(ee + 1, Y), 9; if (Y >= 0) { if (128 > Y) - return K.setUint8(q, Y), 1; + return K.setUint8(ee, Y), 1; if (256 > Y) - return K.setUint8(q, 204), K.setUint8(q + 1, Y), 2; + return K.setUint8(ee, 204), K.setUint8(ee + 1, Y), 2; if (65536 > Y) - return K.setUint8(q, 205), K.setUint16(q + 1, Y), 3; + return K.setUint8(ee, 205), K.setUint16(ee + 1, Y), 3; if (4294967296 > Y) - return K.setUint8(q, 206), K.setUint32(q + 1, Y), 5; + return K.setUint8(ee, 206), K.setUint32(ee + 1, Y), 5; throw new Error("Number too big 0x" + Y.toString(16)); } if (Y >= -32) - return K.setInt8(q, Y), 1; + return K.setInt8(ee, Y), 1; if (Y >= -128) - return K.setUint8(q, 208), K.setInt8(q + 1, Y), 2; + return K.setUint8(ee, 208), K.setInt8(ee + 1, Y), 2; if (Y >= -32768) - return K.setUint8(q, 209), K.setInt16(q + 1, Y), 3; + return K.setUint8(ee, 209), K.setInt16(ee + 1, Y), 3; if (Y >= -2147483648) - return K.setUint8(q, 210), K.setInt32(q + 1, Y), 5; + return K.setUint8(ee, 210), K.setInt32(ee + 1, Y), 5; throw new Error("Number too small -0x" + (-Y).toString(16).substr(1)); } if (Y === null) - return K.setUint8(q, 192), 1; + return K.setUint8(ee, 192), 1; if (de === "boolean") - return K.setUint8(q, Y ? 195 : 194), 1; + return K.setUint8(ee, Y ? 195 : 194), 1; if (de === "object") { var ve, ce = 0, Re = Array.isArray(Y); if (Re) @@ -22637,39 +22637,39 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; ve = Z.length; } var ce; - if (16 > ve ? (K.setUint8(q, ve | (Re ? 144 : 128)), ce = 1) : 65536 > ve ? (K.setUint8(q, Re ? 220 : 222), K.setUint16(q + 1, ve), ce = 3) : 4294967296 > ve && (K.setUint8(q, Re ? 221 : 223), K.setUint32(q + 1, ve), ce = 5), Re) + if (16 > ve ? (K.setUint8(ee, ve | (Re ? 144 : 128)), ce = 1) : 65536 > ve ? (K.setUint8(ee, Re ? 220 : 222), K.setUint16(ee + 1, ve), ce = 3) : 4294967296 > ve && (K.setUint8(ee, Re ? 221 : 223), K.setUint32(ee + 1, ve), ce = 5), Re) for (var Ae = 0; ve > Ae; Ae++) - ce += _(Y[Ae], K, q + ce); + ce += u(Y[Ae], K, ee + ce); else for (var Ae = 0; ve > Ae; Ae++) { var Fe = Z[Ae]; - ce += _(Fe, K, q + ce), ce += _(Y[Fe], K, q + ce); + ce += u(Fe, K, ee + ce), ce += u(Y[Fe], K, ee + ce); } return ce; } throw new Error("Unknown type " + de); } - function x(Y) { + function y(Y) { var K = typeof Y; if (K === "string") { - var q = f(Y); - if (32 > q) - return 1 + q; - if (256 > q) - return 2 + q; - if (65536 > q) - return 3 + q; - if (4294967296 > q) - return 5 + q; + var ee = f(Y); + if (32 > ee) + return 1 + ee; + if (256 > ee) + return 2 + ee; + if (65536 > ee) + return 3 + ee; + if (4294967296 > ee) + return 5 + ee; } if (Y instanceof Uint8Array) { - var q = Y.byteLength; - if (256 > q) - return 2 + q; - if (65536 > q) - return 3 + q; - if (4294967296 > q) - return 5 + q; + var ee = Y.byteLength; + if (256 > ee) + return 2 + ee; + if (65536 > ee) + return 3 + ee; + if (4294967296 > ee) + return 5 + ee; } if (K === "number") { if (Math.floor(Y) !== Y) @@ -22698,163 +22698,163 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (K === "boolean" || Y === null) return 1; if (K === "object") { - var q, de = 0; + var ee, de = 0; if (Array.isArray(Y)) { - q = Y.length; - for (var ve = 0; q > ve; ve++) - de += x(Y[ve]); + ee = Y.length; + for (var ve = 0; ee > ve; ve++) + de += y(Y[ve]); } else { var Ie = Object.keys(Y); - q = Ie.length; - for (var ve = 0; q > ve; ve++) { + ee = Ie.length; + for (var ve = 0; ee > ve; ve++) { var Re = Ie[ve]; - de += x(Re) + x(Y[Re]); + de += y(Re) + y(Y[Re]); } } - if (16 > q) + if (16 > ee) return 1 + de; - if (65536 > q) + if (65536 > ee) return 3 + de; - if (4294967296 > q) + if (4294967296 > ee) return 5 + de; - throw new Error("Array or object too long 0x" + q.toString(16)); + throw new Error("Array or object too long 0x" + ee.toString(16)); } throw new Error("Unknown type " + K); } function h(Y) { - var K = new ArrayBuffer(x(Y)), q = new DataView(K); - return _(Y, q, 0), new Uint8Array(K); + var K = new ArrayBuffer(y(Y)), ee = new DataView(K); + return u(Y, ee, 0), new Uint8Array(K); } - function u(Y, K, q) { - return K ? new Y(K.buffer, K.byteOffset, K.byteLength / (q || 1)) : void 0; + function _(Y, K, ee) { + return K ? new Y(K.buffer, K.byteOffset, K.byteLength / (ee || 1)) : void 0; } function E(Y) { - return u(DataView, Y); + return _(DataView, Y); } function c(Y) { - return u(Uint8Array, Y); + return _(Uint8Array, Y); } function C(Y) { - return u(Int8Array, Y); + return _(Int8Array, Y); } function b(Y) { - return u(Int32Array, Y, 4); + return _(Int32Array, Y, 4); } function A(Y) { - return u(Float32Array, Y, 4); + return _(Float32Array, Y, 4); } function S(Y, K) { - var q = Y.length / 2; - K || (K = new Int16Array(q)); - for (var de = 0, ve = 0; q > de; ++de, ve += 2) + var ee = Y.length / 2; + K || (K = new Int16Array(ee)); + for (var de = 0, ve = 0; ee > de; ++de, ve += 2) K[de] = Y[ve] << 8 ^ Y[ve + 1] << 0; return K; } - function n(Y, K) { - var q = Y.length; - K || (K = new Uint8Array(2 * q)); - for (var de = E(K), ve = 0; q > ve; ++ve) + function s(Y, K) { + var ee = Y.length; + K || (K = new Uint8Array(2 * ee)); + for (var de = E(K), ve = 0; ee > ve; ++ve) de.setInt16(2 * ve, Y[ve]); return c(K); } function o(Y, K) { - var q = Y.length / 4; - K || (K = new Int32Array(q)); - for (var de = 0, ve = 0; q > de; ++de, ve += 4) + var ee = Y.length / 4; + K || (K = new Int32Array(ee)); + for (var de = 0, ve = 0; ee > de; ++de, ve += 4) K[de] = Y[ve] << 24 ^ Y[ve + 1] << 16 ^ Y[ve + 2] << 8 ^ Y[ve + 3] << 0; return K; } function w(Y, K) { - var q = Y.length; - K || (K = new Uint8Array(4 * q)); - for (var de = E(K), ve = 0; q > ve; ++ve) + var ee = Y.length; + K || (K = new Uint8Array(4 * ee)); + for (var de = E(K), ve = 0; ee > ve; ++ve) de.setInt32(4 * ve, Y[ve]); return c(K); } function p(Y, K) { - var q = Y.length; - K || (K = new Float32Array(q / 4)); - for (var de = E(K), ve = E(Y), Ie = 0, Re = 0, Z = q / 4; Z > Ie; ++Ie, Re += 4) + var ee = Y.length; + K || (K = new Float32Array(ee / 4)); + for (var de = E(K), ve = E(Y), Ie = 0, Re = 0, Z = ee / 4; Z > Ie; ++Ie, Re += 4) de.setFloat32(Re, ve.getFloat32(Re), !0); return K; } - function v(Y, K, q) { + function v(Y, K, ee) { var de = Y.length, ve = 1 / K; - q || (q = new Float32Array(de)); + ee || (ee = new Float32Array(de)); for (var Ie = 0; de > Ie; ++Ie) - q[Ie] = Y[Ie] * ve; - return q; + ee[Ie] = Y[Ie] * ve; + return ee; } - function a(Y, K, q) { + function a(Y, K, ee) { var de = Y.length; - q || (q = new Int32Array(de)); + ee || (ee = new Int32Array(de)); for (var ve = 0; de > ve; ++ve) - q[ve] = Math.round(Y[ve] * K); - return q; + ee[ve] = Math.round(Y[ve] * K); + return ee; } function l(Y, K) { - var q, de; + var ee, de; if (!K) { var ve = 0; - for (q = 0, de = Y.length; de > q; q += 2) - ve += Y[q + 1]; + for (ee = 0, de = Y.length; de > ee; ee += 2) + ve += Y[ee + 1]; K = new Y.constructor(ve); } var Ie = 0; - for (q = 0, de = Y.length; de > q; q += 2) - for (var Re = Y[q], Z = Y[q + 1], ce = 0; Z > ce; ++ce) + for (ee = 0, de = Y.length; de > ee; ee += 2) + for (var Re = Y[ee], Z = Y[ee + 1], ce = 0; Z > ce; ++ce) K[Ie] = Re, ++Ie; return K; } function g(Y) { if (Y.length === 0) return new Int32Array(); - var K, q, de = 2; - for (K = 1, q = Y.length; q > K; ++K) + var K, ee, de = 2; + for (K = 1, ee = Y.length; ee > K; ++K) Y[K - 1] !== Y[K] && (de += 2); var ve = new Int32Array(de), Ie = 0, Re = 1; - for (K = 1, q = Y.length; q > K; ++K) + for (K = 1, ee = Y.length; ee > K; ++K) Y[K - 1] !== Y[K] ? (ve[Ie] = Y[K - 1], ve[Ie + 1] = Re, Re = 1, Ie += 2) : ++Re; return ve[Ie] = Y[Y.length - 1], ve[Ie + 1] = Re, ve; } function M(Y, K) { - var q = Y.length; - K || (K = new Y.constructor(q)), q && (K[0] = Y[0]); - for (var de = 1; q > de; ++de) + var ee = Y.length; + K || (K = new Y.constructor(ee)), ee && (K[0] = Y[0]); + for (var de = 1; ee > de; ++de) K[de] = Y[de] + K[de - 1]; return K; } function L(Y, K) { - var q = Y.length; - K || (K = new Y.constructor(q)), K[0] = Y[0]; - for (var de = 1; q > de; ++de) + var ee = Y.length; + K || (K = new Y.constructor(ee)), K[0] = Y[0]; + for (var de = 1; ee > de; ++de) K[de] = Y[de] - Y[de - 1]; return K; } function T(Y, K) { - var q, de, ve = Y instanceof Int8Array ? 127 : 32767, Ie = -ve - 1, Re = Y.length; + var ee, de, ve = Y instanceof Int8Array ? 127 : 32767, Ie = -ve - 1, Re = Y.length; if (!K) { var Z = 0; - for (q = 0; Re > q; ++q) - Y[q] < ve && Y[q] > Ie && ++Z; + for (ee = 0; Re > ee; ++ee) + Y[ee] < ve && Y[ee] > Ie && ++Z; K = new Int32Array(Z); } - for (q = 0, de = 0; Re > q; ) { - for (var ce = 0; Y[q] === ve || Y[q] === Ie; ) - ce += Y[q], ++q; - ce += Y[q], ++q, K[de] = ce, ++de; + for (ee = 0, de = 0; Re > ee; ) { + for (var ce = 0; Y[ee] === ve || Y[ee] === Ie; ) + ce += Y[ee], ++ee; + ce += Y[ee], ++ee, K[de] = ce, ++de; } return K; } function D(Y, K) { - var q, de = K ? 127 : 32767, ve = -de - 1, Ie = Y.length, Re = 0; - for (q = 0; Ie > q; ++q) { - var Z = Y[q]; + var ee, de = K ? 127 : 32767, ve = -de - 1, Ie = Y.length, Re = 0; + for (ee = 0; Ie > ee; ++ee) { + var Z = Y[ee]; Z === 0 ? ++Re : Z > 0 ? (Re += Math.ceil(Z / de), Z % de === 0 && (Re += 1)) : (Re += Math.ceil(Z / ve), Z % ve === 0 && (Re += 1)); } var ce = K ? new Int8Array(Re) : new Int16Array(Re), Ae = 0; - for (q = 0; Ie > q; ++q) { - var Z = Y[q]; + for (ee = 0; Ie > ee; ++ee) { + var Z = Y[ee]; if (Z >= 0) for (; Z >= de; ) ce[Ae] = de, ++Ae, Z -= de; @@ -22865,75 +22865,75 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } return ce; } - function R(Y, K) { + function I(Y, K) { return M(l(Y), K); } - function B(Y) { + function z(Y) { return g(L(Y)); } - function P(Y, K, q) { - return v(l(Y, b(q)), K, q); + function P(Y, K, ee) { + return v(l(Y, b(ee)), K, ee); } - function z(Y, K) { + function B(Y, K) { return g(a(Y, K)); } - function F(Y, K, q) { - return v(M(Y, b(q)), K, q); + function F(Y, K, ee) { + return v(M(Y, b(ee)), K, ee); } - function N(Y, K, q) { - return L(a(Y, K), q); + function N(Y, K, ee) { + return L(a(Y, K), ee); } - function $(Y, K, q) { - return v(T(Y, b(q)), K, q); + function $(Y, K, ee) { + return v(T(Y, b(ee)), K, ee); } - function k(Y, K, q) { - var de = T(Y, b(q)); + function k(Y, K, ee) { + var de = T(Y, b(ee)); return F(de, K, A(de)); } - function G(Y, K, q) { - return D(N(Y, K), q); + function G(Y, K, ee) { + return D(N(Y, K), ee); } function H(Ie) { - var K = E(Ie), q = K.getInt32(0), de = K.getInt32(4), ve = Ie.subarray(8, 12), Ie = Ie.subarray(12); - return [q, Ie, de, ve]; + var K = E(Ie), ee = K.getInt32(0), de = K.getInt32(4), ve = Ie.subarray(8, 12), Ie = Ie.subarray(12); + return [ee, Ie, de, ve]; } - function U(Y, K, q, de) { + function U(Y, K, ee, de) { var ve = new ArrayBuffer(12 + de.byteLength), Ie = new Uint8Array(ve), Re = new DataView(ve); - return Re.setInt32(0, Y), Re.setInt32(4, K), q && Ie.set(q, 8), Ie.set(de, 12), Ie; + return Re.setInt32(0, Y), Re.setInt32(4, K), ee && Ie.set(ee, 8), Ie.set(de, 12), Ie; } function V(Y) { - var K = Y.length, q = c(Y); - return U(2, K, void 0, q); + var K = Y.length, ee = c(Y); + return U(2, K, void 0, ee); } function Q(Y) { - var K = Y.length, q = w(Y); - return U(4, K, void 0, q); + var K = Y.length, ee = w(Y); + return U(4, K, void 0, ee); } - function oe(Y, K) { - var q = Y.length / K, de = w([K]), ve = c(Y); - return U(5, q, de, ve); + function ae(Y, K) { + var ee = Y.length / K, de = w([K]), ve = c(Y); + return U(5, ee, de, ve); } - function ee(Y) { - var K = Y.length, q = w(g(Y)); - return U(6, K, void 0, q); + function oe(Y) { + var K = Y.length, ee = w(g(Y)); + return U(6, K, void 0, ee); } - function ne(Y) { - var K = Y.length, q = w(B(Y)); - return U(8, K, void 0, q); + function q(Y) { + var K = Y.length, ee = w(z(Y)); + return U(8, K, void 0, ee); } function me(Y, K) { - var q = Y.length, de = w([K]), ve = w(z(Y, K)); - return U(9, q, de, ve); + var ee = Y.length, de = w([K]), ve = w(B(Y, K)); + return U(9, ee, de, ve); } - function se(Y, K) { - var q = Y.length, de = w([K]), ve = n(G(Y, K)); - return U(10, q, de, ve); + function ne(Y, K) { + var ee = Y.length, de = w([K]), ve = s(G(Y, K)); + return U(10, ee, de, ve); } function fe(Y) { var K = {}; - return ue.forEach(function(q) { - Y[q] !== void 0 && (K[q] = Y[q]); - }), Y.bondAtomList && (K.bondAtomList = Q(Y.bondAtomList)), Y.bondOrderList && (K.bondOrderList = V(Y.bondOrderList)), K.xCoordList = se(Y.xCoordList, 1e3), K.yCoordList = se(Y.yCoordList, 1e3), K.zCoordList = se(Y.zCoordList, 1e3), Y.bFactorList && (K.bFactorList = se(Y.bFactorList, 100)), Y.atomIdList && (K.atomIdList = ne(Y.atomIdList)), Y.altLocList && (K.altLocList = ee(Y.altLocList)), Y.occupancyList && (K.occupancyList = me(Y.occupancyList, 100)), K.groupIdList = ne(Y.groupIdList), K.groupTypeList = Q(Y.groupTypeList), Y.secStructList && (K.secStructList = V(Y.secStructList)), Y.insCodeList && (K.insCodeList = ee(Y.insCodeList)), Y.sequenceIndexList && (K.sequenceIndexList = ne(Y.sequenceIndexList)), K.chainIdList = oe(Y.chainIdList, 4), Y.chainNameList && (K.chainNameList = oe(Y.chainNameList, 4)), K; + return ue.forEach(function(ee) { + Y[ee] !== void 0 && (K[ee] = Y[ee]); + }), Y.bondAtomList && (K.bondAtomList = Q(Y.bondAtomList)), Y.bondOrderList && (K.bondOrderList = V(Y.bondOrderList)), K.xCoordList = ne(Y.xCoordList, 1e3), K.yCoordList = ne(Y.yCoordList, 1e3), K.zCoordList = ne(Y.zCoordList, 1e3), Y.bFactorList && (K.bFactorList = ne(Y.bFactorList, 100)), Y.atomIdList && (K.atomIdList = q(Y.atomIdList)), Y.altLocList && (K.altLocList = oe(Y.altLocList)), Y.occupancyList && (K.occupancyList = me(Y.occupancyList, 100)), K.groupIdList = q(Y.groupIdList), K.groupTypeList = Q(Y.groupTypeList), Y.secStructList && (K.secStructList = V(Y.secStructList)), Y.insCodeList && (K.insCodeList = oe(Y.insCodeList)), Y.sequenceIndexList && (K.sequenceIndexList = q(Y.sequenceIndexList)), K.chainIdList = ae(Y.chainIdList, 4), Y.chainNameList && (K.chainNameList = ae(Y.chainNameList, 4)), K; } function Ce(Y) { function K(ce) { @@ -22943,7 +22943,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } return Ae; } - function q(ce) { + function ee(ce) { var Ae = Y.subarray(Re, Re + ce); return Re += ce, Ae; } @@ -22983,11 +22983,11 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; case 195: return Re++, !0; case 196: - return Ae = Z.getUint8(Re + 1), Re += 2, q(Ae); + return Ae = Z.getUint8(Re + 1), Re += 2, ee(Ae); case 197: - return Ae = Z.getUint16(Re + 1), Re += 3, q(Ae); + return Ae = Z.getUint16(Re + 1), Re += 3, ee(Ae); case 198: - return Ae = Z.getUint32(Re + 1), Re += 5, q(Ae); + return Ae = Z.getUint32(Re + 1), Re += 5, ee(Ae); case 202: return ce = Z.getFloat32(Re + 1), Re += 5, ce; case 203: @@ -23024,7 +23024,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; var Re = 0, Z = new DataView(Y.buffer); return Ie(); } - function Me(Y, K, q, de) { + function Me(Y, K, ee, de) { switch (Y) { case 1: return p(K); @@ -23037,11 +23037,11 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; case 5: return c(K); case 6: - return l(o(K), new Uint8Array(q)); + return l(o(K), new Uint8Array(ee)); case 7: return l(o(K)); case 8: - return R(o(K)); + return I(o(K)); case 9: return P(o(K), o(de)[0]); case 10: @@ -23060,25 +23060,25 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } function Te(Y, K) { K = K || {}; - var q = K.ignoreFields, de = {}; + var ee = K.ignoreFields, de = {}; return ge.forEach(function(ve) { - var Ie = q ? q.indexOf(ve) !== -1 : !1, Re = Y[ve]; + var Ie = ee ? ee.indexOf(ve) !== -1 : !1, Re = Y[ve]; Ie || Re === void 0 || (Re instanceof Uint8Array ? de[ve] = Me.apply(null, H(Re)) : de[ve] = Re); }), de; } - function ae(Y) { + function se(Y) { return String.fromCharCode.apply(null, Y).replace(/\0/g, ""); } - function pe(Y, K, q) { - q = q || {}; - var de, ve, Ie, Re, Z, ce, Ae = q.firstModelOnly, Fe = K.onModel, he = K.onChain, Oe = K.onGroup, j = K.onAtom, $e = K.onBond, Ve = 0, I = 0, be = 0, Ee = 0, X = 0, le = -1, Le = Y.chainNameList, Ze = Y.secStructList, Ke = Y.insCodeList, je = Y.sequenceIndexList, Je = Y.atomIdList, Lt = Y.bFactorList, rt = Y.altLocList, it = Y.occupancyList, tt = Y.bondAtomList, Et = Y.bondOrderList; + function pe(Y, K, ee) { + ee = ee || {}; + var de, ve, Ie, Re, Z, ce, Ae = ee.firstModelOnly, Fe = K.onModel, he = K.onChain, Oe = K.onGroup, j = K.onAtom, $e = K.onBond, Ve = 0, R = 0, be = 0, Ee = 0, X = 0, le = -1, Le = Y.chainNameList, Ze = Y.secStructList, Ke = Y.insCodeList, je = Y.sequenceIndexList, Je = Y.atomIdList, Lt = Y.bFactorList, rt = Y.altLocList, it = Y.occupancyList, tt = Y.bondAtomList, Et = Y.bondOrderList; for (de = 0, ve = Y.chainsPerModel.length; ve > de && !(Ae && Ve > 0); ++de) { var lt = Y.chainsPerModel[Ve]; for (Fe && Fe({ chainCount: lt, modelIndex: Ve }), Ie = 0; lt > Ie; ++Ie) { - var wt = Y.groupsPerChain[I]; + var wt = Y.groupsPerChain[R]; if (he) { - var Pt = ae(Y.chainIdList.subarray(4 * I, 4 * I + 4)), vt = null; - Le && (vt = ae(Le.subarray(4 * I, 4 * I + 4))), he({ groupCount: wt, chainIndex: I, modelIndex: Ve, chainId: Pt, chainName: vt }); + var Pt = se(Y.chainIdList.subarray(4 * R, 4 * R + 4)), vt = null; + Le && (vt = se(Le.subarray(4 * R, 4 * R + 4))), he({ groupCount: wt, chainIndex: R, modelIndex: Ve, chainId: Pt, chainName: vt }); } for (Re = 0; wt > Re; ++Re) { var bt = Y.groupList[Y.groupTypeList[be]], mt = bt.atomNameList.length; @@ -23088,7 +23088,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; var Ot = null; Y.insCodeList && (Ot = String.fromCharCode(Ke[be])); var Ft = null; - je && (Ft = je[be]), Oe({ atomCount: mt, groupIndex: be, chainIndex: I, modelIndex: Ve, groupId: Y.groupIdList[be], groupType: Y.groupTypeList[be], groupName: bt.groupName, singleLetterCode: bt.singleLetterCode, chemCompType: bt.chemCompType, secStruct: Tt, insCode: Ot, sequenceIndex: Ft }); + je && (Ft = je[be]), Oe({ atomCount: mt, groupIndex: be, chainIndex: R, modelIndex: Ve, groupId: Y.groupIdList[be], groupType: Y.groupTypeList[be], groupName: bt.groupName, singleLetterCode: bt.singleLetterCode, chemCompType: bt.chemCompType, secStruct: Tt, insCode: Ot, sequenceIndex: Ft }); } for (Z = 0; mt > Z; ++Z) { if (j) { @@ -23099,7 +23099,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; var Jt = null; rt && (Jt = String.fromCharCode(rt[Ee])); var qt = null; - it && (qt = it[Ee]), j({ atomIndex: Ee, groupIndex: be, chainIndex: I, modelIndex: Ve, atomId: Qt, element: bt.elementList[Z], atomName: bt.atomNameList[Z], formalCharge: bt.formalChargeList[Z], xCoord: Y.xCoordList[Ee], yCoord: Y.yCoordList[Ee], zCoord: Y.zCoordList[Ee], bFactor: kt, altLoc: Jt, occupancy: qt }); + it && (qt = it[Ee]), j({ atomIndex: Ee, groupIndex: be, chainIndex: R, modelIndex: Ve, atomId: Qt, element: bt.elementList[Z], atomName: bt.atomNameList[Z], formalCharge: bt.formalChargeList[Z], xCoord: Y.xCoordList[Ee], yCoord: Y.yCoordList[Ee], zCoord: Y.zCoordList[Ee], bFactor: kt, altLoc: Jt, occupancy: qt }); } Ee += 1; } @@ -23110,7 +23110,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } be += 1; } - I += 1; + R += 1; } if (X = le + 1, le = Ee - 1, $e && tt) for (Z = 0, ce = tt.length; ce > Z; Z += 2) { @@ -23125,14 +23125,14 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } function ke(Y, K) { Y instanceof ArrayBuffer && (Y = new Uint8Array(Y)); - var q; - return q = Y instanceof Uint8Array ? Ce(Y) : Y, Te(q, K); + var ee; + return ee = Y instanceof Uint8Array ? Ce(Y) : Y, Te(ee, K); } - function Ue(Y, K, q, de) { + function Ue(Y, K, ee, de) { function ve() { try { var Re = ke(Ie.response); - q(Re); + ee(Re); } catch (Z) { de(Z); } @@ -23140,11 +23140,11 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; var Ie = new XMLHttpRequest(); Ie.addEventListener("load", ve, !0), Ie.addEventListener("error", de, !0), Ie.responseType = "arraybuffer", Ie.open("GET", K + Y.toUpperCase()), Ie.send(); } - function Ne(Y, K, q) { - Ue(Y, He, K, q); + function Ne(Y, K, ee) { + Ue(Y, He, K, ee); } - function Be(Y, K, q) { - Ue(Y, We, K, q); + function Be(Y, K, ee) { + Ue(Y, We, K, ee); } var ue = ["mmtfVersion", "mmtfProducer", "unitCell", "spaceGroup", "structureId", "title", "depositionDate", "releaseDate", "experimentalMethods", "resolution", "rFree", "rWork", "bioAssemblyList", "ncsOperatorList", "entityList", "groupList", "numBonds", "numAtoms", "numGroups", "numChains", "numModels", "groupsPerChain", "chainsPerModel"], ye = ["xCoordList", "yCoordList", "zCoordList", "groupIdList", "groupTypeList", "chainIdList", "bFactorList", "atomIdList", "altLocList", "occupancyList", "secStructList", "insCodeList", "sequenceIndexList", "chainNameList", "bondAtomList", "bondOrderList"], ge = ue.concat(ye), Se = "v1.0.1", ze = "//mmtf.rcsb.org/v1.0/", He = ze + "full/", We = ze + "reduced/"; t.encode = we, t.decode = ke, t.traverse = pe, t.fetch = Ne, t.fetchReduced = Be, t.version = Se, t.fetchUrl = He, t.fetchReducedUrl = We, t.encodeMsgpack = h, t.encodeMmtf = fe, t.decodeMsgpack = Ce, t.decodeMmtf = Te; @@ -23212,26 +23212,26 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; /* harmony export */ }); /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */ - const s = 4, f = 0, _ = 1, x = 2; - function h(y) { - let W = y.length; + const n = 4, f = 0, u = 1, y = 2; + function h(x) { + let W = x.length; for (; --W >= 0; ) - y[W] = 0; + x[W] = 0; } - const u = 0, E = 1, c = 2, C = 3, b = 258, A = 29, S = 256, n = S + 1 + A, o = 30, w = 19, p = 2 * n + 1, v = 15, a = 16, l = 7, g = 256, M = 16, L = 17, T = 18, D = ( + const _ = 0, E = 1, c = 2, C = 3, b = 258, A = 29, S = 256, s = S + 1 + A, o = 30, w = 19, p = 2 * s + 1, v = 15, a = 16, l = 7, g = 256, M = 16, L = 17, T = 18, D = ( /* extra bits for each length code */ new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]) - ), R = ( + ), I = ( /* extra bits for each distance code */ new Uint8Array([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]) - ), B = ( + ), z = ( /* extra bits for each bit length code */ new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]) - ), P = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), z = 512, F = new Array((n + 2) * 2); + ), P = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), B = 512, F = new Array((s + 2) * 2); h(F); const N = new Array(o * 2); h(N); - const $ = new Array(z); + const $ = new Array(B); h($); const k = new Array(b - C + 1); h(k); @@ -23239,206 +23239,206 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; h(G); const H = new Array(o); h(H); - function U(y, W, O, J, ie) { - this.static_tree = y, this.extra_bits = W, this.extra_base = O, this.elems = J, this.max_length = ie, this.has_stree = y && y.length; + function U(x, W, O, J, ie) { + this.static_tree = x, this.extra_bits = W, this.extra_base = O, this.elems = J, this.max_length = ie, this.has_stree = x && x.length; } - let V, Q, oe; - function ee(y, W) { - this.dyn_tree = y, this.max_code = 0, this.stat_desc = W; + let V, Q, ae; + function oe(x, W) { + this.dyn_tree = x, this.max_code = 0, this.stat_desc = W; } - const ne = (y) => y < 256 ? $[y] : $[256 + (y >>> 7)], me = (y, W) => { - y.pending_buf[y.pending++] = W & 255, y.pending_buf[y.pending++] = W >>> 8 & 255; - }, se = (y, W, O) => { - y.bi_valid > a - O ? (y.bi_buf |= W << y.bi_valid & 65535, me(y, y.bi_buf), y.bi_buf = W >> a - y.bi_valid, y.bi_valid += O - a) : (y.bi_buf |= W << y.bi_valid & 65535, y.bi_valid += O); - }, fe = (y, W, O) => { - se( - y, + const q = (x) => x < 256 ? $[x] : $[256 + (x >>> 7)], me = (x, W) => { + x.pending_buf[x.pending++] = W & 255, x.pending_buf[x.pending++] = W >>> 8 & 255; + }, ne = (x, W, O) => { + x.bi_valid > a - O ? (x.bi_buf |= W << x.bi_valid & 65535, me(x, x.bi_buf), x.bi_buf = W >> a - x.bi_valid, x.bi_valid += O - a) : (x.bi_buf |= W << x.bi_valid & 65535, x.bi_valid += O); + }, fe = (x, W, O) => { + ne( + x, O[W * 2], O[W * 2 + 1] /*.Len*/ ); - }, Ce = (y, W) => { + }, Ce = (x, W) => { let O = 0; do - O |= y & 1, y >>>= 1, O <<= 1; + O |= x & 1, x >>>= 1, O <<= 1; while (--W > 0); return O >>> 1; - }, Me = (y) => { - y.bi_valid === 16 ? (me(y, y.bi_buf), y.bi_buf = 0, y.bi_valid = 0) : y.bi_valid >= 8 && (y.pending_buf[y.pending++] = y.bi_buf & 255, y.bi_buf >>= 8, y.bi_valid -= 8); - }, Te = (y, W) => { + }, Me = (x) => { + x.bi_valid === 16 ? (me(x, x.bi_buf), x.bi_buf = 0, x.bi_valid = 0) : x.bi_valid >= 8 && (x.pending_buf[x.pending++] = x.bi_buf & 255, x.bi_buf >>= 8, x.bi_valid -= 8); + }, Te = (x, W) => { const O = W.dyn_tree, J = W.max_code, ie = W.stat_desc.static_tree, te = W.stat_desc.has_stree, De = W.stat_desc.extra_bits, xe = W.stat_desc.extra_base, Qe = W.stat_desc.max_length; let _e, Pe, ut, Xe, Ge, qe, Ct = 0; for (Xe = 0; Xe <= v; Xe++) - y.bl_count[Xe] = 0; - for (O[y.heap[y.heap_max] * 2 + 1] = 0, _e = y.heap_max + 1; _e < p; _e++) - Pe = y.heap[_e], Xe = O[O[Pe * 2 + 1] * 2 + 1] + 1, Xe > Qe && (Xe = Qe, Ct++), O[Pe * 2 + 1] = Xe, !(Pe > J) && (y.bl_count[Xe]++, Ge = 0, Pe >= xe && (Ge = De[Pe - xe]), qe = O[Pe * 2], y.opt_len += qe * (Xe + Ge), te && (y.static_len += qe * (ie[Pe * 2 + 1] + Ge))); + x.bl_count[Xe] = 0; + for (O[x.heap[x.heap_max] * 2 + 1] = 0, _e = x.heap_max + 1; _e < p; _e++) + Pe = x.heap[_e], Xe = O[O[Pe * 2 + 1] * 2 + 1] + 1, Xe > Qe && (Xe = Qe, Ct++), O[Pe * 2 + 1] = Xe, !(Pe > J) && (x.bl_count[Xe]++, Ge = 0, Pe >= xe && (Ge = De[Pe - xe]), qe = O[Pe * 2], x.opt_len += qe * (Xe + Ge), te && (x.static_len += qe * (ie[Pe * 2 + 1] + Ge))); if (Ct !== 0) { do { - for (Xe = Qe - 1; y.bl_count[Xe] === 0; ) + for (Xe = Qe - 1; x.bl_count[Xe] === 0; ) Xe--; - y.bl_count[Xe]--, y.bl_count[Xe + 1] += 2, y.bl_count[Qe]--, Ct -= 2; + x.bl_count[Xe]--, x.bl_count[Xe + 1] += 2, x.bl_count[Qe]--, Ct -= 2; } while (Ct > 0); for (Xe = Qe; Xe !== 0; Xe--) - for (Pe = y.bl_count[Xe]; Pe !== 0; ) - ut = y.heap[--_e], !(ut > J) && (O[ut * 2 + 1] !== Xe && (y.opt_len += (Xe - O[ut * 2 + 1]) * O[ut * 2], O[ut * 2 + 1] = Xe), Pe--); + for (Pe = x.bl_count[Xe]; Pe !== 0; ) + ut = x.heap[--_e], !(ut > J) && (O[ut * 2 + 1] !== Xe && (x.opt_len += (Xe - O[ut * 2 + 1]) * O[ut * 2], O[ut * 2 + 1] = Xe), Pe--); } - }, ae = (y, W, O) => { + }, se = (x, W, O) => { const J = new Array(v + 1); let ie = 0, te, De; for (te = 1; te <= v; te++) ie = ie + O[te - 1] << 1, J[te] = ie; for (De = 0; De <= W; De++) { - let xe = y[De * 2 + 1]; - xe !== 0 && (y[De * 2] = Ce(J[xe]++, xe)); + let xe = x[De * 2 + 1]; + xe !== 0 && (x[De * 2] = Ce(J[xe]++, xe)); } }, pe = () => { - let y, W, O, J, ie; + let x, W, O, J, ie; const te = new Array(v + 1); for (O = 0, J = 0; J < A - 1; J++) - for (G[J] = O, y = 0; y < 1 << D[J]; y++) + for (G[J] = O, x = 0; x < 1 << D[J]; x++) k[O++] = J; for (k[O - 1] = J, ie = 0, J = 0; J < 16; J++) - for (H[J] = ie, y = 0; y < 1 << R[J]; y++) + for (H[J] = ie, x = 0; x < 1 << I[J]; x++) $[ie++] = J; for (ie >>= 7; J < o; J++) - for (H[J] = ie << 7, y = 0; y < 1 << R[J] - 7; y++) + for (H[J] = ie << 7, x = 0; x < 1 << I[J] - 7; x++) $[256 + ie++] = J; for (W = 0; W <= v; W++) te[W] = 0; - for (y = 0; y <= 143; ) - F[y * 2 + 1] = 8, y++, te[8]++; - for (; y <= 255; ) - F[y * 2 + 1] = 9, y++, te[9]++; - for (; y <= 279; ) - F[y * 2 + 1] = 7, y++, te[7]++; - for (; y <= 287; ) - F[y * 2 + 1] = 8, y++, te[8]++; - for (ae(F, n + 1, te), y = 0; y < o; y++) - N[y * 2 + 1] = 5, N[y * 2] = Ce(y, 5); - V = new U(F, D, S + 1, n, v), Q = new U(N, R, 0, o, v), oe = new U(new Array(0), B, 0, w, l); - }, we = (y) => { + for (x = 0; x <= 143; ) + F[x * 2 + 1] = 8, x++, te[8]++; + for (; x <= 255; ) + F[x * 2 + 1] = 9, x++, te[9]++; + for (; x <= 279; ) + F[x * 2 + 1] = 7, x++, te[7]++; + for (; x <= 287; ) + F[x * 2 + 1] = 8, x++, te[8]++; + for (se(F, s + 1, te), x = 0; x < o; x++) + N[x * 2 + 1] = 5, N[x * 2] = Ce(x, 5); + V = new U(F, D, S + 1, s, v), Q = new U(N, I, 0, o, v), ae = new U(new Array(0), z, 0, w, l); + }, we = (x) => { let W; - for (W = 0; W < n; W++) - y.dyn_ltree[W * 2] = 0; + for (W = 0; W < s; W++) + x.dyn_ltree[W * 2] = 0; for (W = 0; W < o; W++) - y.dyn_dtree[W * 2] = 0; + x.dyn_dtree[W * 2] = 0; for (W = 0; W < w; W++) - y.bl_tree[W * 2] = 0; - y.dyn_ltree[g * 2] = 1, y.opt_len = y.static_len = 0, y.sym_next = y.matches = 0; - }, ke = (y) => { - y.bi_valid > 8 ? me(y, y.bi_buf) : y.bi_valid > 0 && (y.pending_buf[y.pending++] = y.bi_buf), y.bi_buf = 0, y.bi_valid = 0; - }, Ue = (y, W, O, J) => { + x.bl_tree[W * 2] = 0; + x.dyn_ltree[g * 2] = 1, x.opt_len = x.static_len = 0, x.sym_next = x.matches = 0; + }, ke = (x) => { + x.bi_valid > 8 ? me(x, x.bi_buf) : x.bi_valid > 0 && (x.pending_buf[x.pending++] = x.bi_buf), x.bi_buf = 0, x.bi_valid = 0; + }, Ue = (x, W, O, J) => { const ie = W * 2, te = O * 2; - return y[ie] < y[te] || y[ie] === y[te] && J[W] <= J[O]; - }, Ne = (y, W, O) => { - const J = y.heap[O]; + return x[ie] < x[te] || x[ie] === x[te] && J[W] <= J[O]; + }, Ne = (x, W, O) => { + const J = x.heap[O]; let ie = O << 1; - for (; ie <= y.heap_len && (ie < y.heap_len && Ue(W, y.heap[ie + 1], y.heap[ie], y.depth) && ie++, !Ue(W, J, y.heap[ie], y.depth)); ) - y.heap[O] = y.heap[ie], O = ie, ie <<= 1; - y.heap[O] = J; - }, Be = (y, W, O) => { + for (; ie <= x.heap_len && (ie < x.heap_len && Ue(W, x.heap[ie + 1], x.heap[ie], x.depth) && ie++, !Ue(W, J, x.heap[ie], x.depth)); ) + x.heap[O] = x.heap[ie], O = ie, ie <<= 1; + x.heap[O] = J; + }, Be = (x, W, O) => { let J, ie, te = 0, De, xe; - if (y.sym_next !== 0) + if (x.sym_next !== 0) do - J = y.pending_buf[y.sym_buf + te++] & 255, J += (y.pending_buf[y.sym_buf + te++] & 255) << 8, ie = y.pending_buf[y.sym_buf + te++], J === 0 ? fe(y, ie, W) : (De = k[ie], fe(y, De + S + 1, W), xe = D[De], xe !== 0 && (ie -= G[De], se(y, ie, xe)), J--, De = ne(J), fe(y, De, O), xe = R[De], xe !== 0 && (J -= H[De], se(y, J, xe))); - while (te < y.sym_next); - fe(y, g, W); - }, ue = (y, W) => { + J = x.pending_buf[x.sym_buf + te++] & 255, J += (x.pending_buf[x.sym_buf + te++] & 255) << 8, ie = x.pending_buf[x.sym_buf + te++], J === 0 ? fe(x, ie, W) : (De = k[ie], fe(x, De + S + 1, W), xe = D[De], xe !== 0 && (ie -= G[De], ne(x, ie, xe)), J--, De = q(J), fe(x, De, O), xe = I[De], xe !== 0 && (J -= H[De], ne(x, J, xe))); + while (te < x.sym_next); + fe(x, g, W); + }, ue = (x, W) => { const O = W.dyn_tree, J = W.stat_desc.static_tree, ie = W.stat_desc.has_stree, te = W.stat_desc.elems; let De, xe, Qe = -1, _e; - for (y.heap_len = 0, y.heap_max = p, De = 0; De < te; De++) - O[De * 2] !== 0 ? (y.heap[++y.heap_len] = Qe = De, y.depth[De] = 0) : O[De * 2 + 1] = 0; - for (; y.heap_len < 2; ) - _e = y.heap[++y.heap_len] = Qe < 2 ? ++Qe : 0, O[_e * 2] = 1, y.depth[_e] = 0, y.opt_len--, ie && (y.static_len -= J[_e * 2 + 1]); - for (W.max_code = Qe, De = y.heap_len >> 1; De >= 1; De--) - Ne(y, O, De); + for (x.heap_len = 0, x.heap_max = p, De = 0; De < te; De++) + O[De * 2] !== 0 ? (x.heap[++x.heap_len] = Qe = De, x.depth[De] = 0) : O[De * 2 + 1] = 0; + for (; x.heap_len < 2; ) + _e = x.heap[++x.heap_len] = Qe < 2 ? ++Qe : 0, O[_e * 2] = 1, x.depth[_e] = 0, x.opt_len--, ie && (x.static_len -= J[_e * 2 + 1]); + for (W.max_code = Qe, De = x.heap_len >> 1; De >= 1; De--) + Ne(x, O, De); _e = te; do - De = y.heap[ + De = x.heap[ 1 /*SMALLEST*/ - ], y.heap[ + ], x.heap[ 1 /*SMALLEST*/ - ] = y.heap[y.heap_len--], Ne( - y, + ] = x.heap[x.heap_len--], Ne( + x, O, 1 /*SMALLEST*/ - ), xe = y.heap[ + ), xe = x.heap[ 1 /*SMALLEST*/ - ], y.heap[--y.heap_max] = De, y.heap[--y.heap_max] = xe, O[_e * 2] = O[De * 2] + O[xe * 2], y.depth[_e] = (y.depth[De] >= y.depth[xe] ? y.depth[De] : y.depth[xe]) + 1, O[De * 2 + 1] = O[xe * 2 + 1] = _e, y.heap[ + ], x.heap[--x.heap_max] = De, x.heap[--x.heap_max] = xe, O[_e * 2] = O[De * 2] + O[xe * 2], x.depth[_e] = (x.depth[De] >= x.depth[xe] ? x.depth[De] : x.depth[xe]) + 1, O[De * 2 + 1] = O[xe * 2 + 1] = _e, x.heap[ 1 /*SMALLEST*/ ] = _e++, Ne( - y, + x, O, 1 /*SMALLEST*/ ); - while (y.heap_len >= 2); - y.heap[--y.heap_max] = y.heap[ + while (x.heap_len >= 2); + x.heap[--x.heap_max] = x.heap[ 1 /*SMALLEST*/ - ], Te(y, W), ae(O, Qe, y.bl_count); - }, ye = (y, W, O) => { + ], Te(x, W), se(O, Qe, x.bl_count); + }, ye = (x, W, O) => { let J, ie = -1, te, De = W[0 * 2 + 1], xe = 0, Qe = 7, _e = 4; for (De === 0 && (Qe = 138, _e = 3), W[(O + 1) * 2 + 1] = 65535, J = 0; J <= O; J++) - te = De, De = W[(J + 1) * 2 + 1], !(++xe < Qe && te === De) && (xe < _e ? y.bl_tree[te * 2] += xe : te !== 0 ? (te !== ie && y.bl_tree[te * 2]++, y.bl_tree[M * 2]++) : xe <= 10 ? y.bl_tree[L * 2]++ : y.bl_tree[T * 2]++, xe = 0, ie = te, De === 0 ? (Qe = 138, _e = 3) : te === De ? (Qe = 6, _e = 3) : (Qe = 7, _e = 4)); - }, ge = (y, W, O) => { + te = De, De = W[(J + 1) * 2 + 1], !(++xe < Qe && te === De) && (xe < _e ? x.bl_tree[te * 2] += xe : te !== 0 ? (te !== ie && x.bl_tree[te * 2]++, x.bl_tree[M * 2]++) : xe <= 10 ? x.bl_tree[L * 2]++ : x.bl_tree[T * 2]++, xe = 0, ie = te, De === 0 ? (Qe = 138, _e = 3) : te === De ? (Qe = 6, _e = 3) : (Qe = 7, _e = 4)); + }, ge = (x, W, O) => { let J, ie = -1, te, De = W[0 * 2 + 1], xe = 0, Qe = 7, _e = 4; for (De === 0 && (Qe = 138, _e = 3), J = 0; J <= O; J++) if (te = De, De = W[(J + 1) * 2 + 1], !(++xe < Qe && te === De)) { if (xe < _e) do - fe(y, te, y.bl_tree); + fe(x, te, x.bl_tree); while (--xe !== 0); else - te !== 0 ? (te !== ie && (fe(y, te, y.bl_tree), xe--), fe(y, M, y.bl_tree), se(y, xe - 3, 2)) : xe <= 10 ? (fe(y, L, y.bl_tree), se(y, xe - 3, 3)) : (fe(y, T, y.bl_tree), se(y, xe - 11, 7)); + te !== 0 ? (te !== ie && (fe(x, te, x.bl_tree), xe--), fe(x, M, x.bl_tree), ne(x, xe - 3, 2)) : xe <= 10 ? (fe(x, L, x.bl_tree), ne(x, xe - 3, 3)) : (fe(x, T, x.bl_tree), ne(x, xe - 11, 7)); xe = 0, ie = te, De === 0 ? (Qe = 138, _e = 3) : te === De ? (Qe = 6, _e = 3) : (Qe = 7, _e = 4); } - }, Se = (y) => { + }, Se = (x) => { let W; - for (ye(y, y.dyn_ltree, y.l_desc.max_code), ye(y, y.dyn_dtree, y.d_desc.max_code), ue(y, y.bl_desc), W = w - 1; W >= 3 && y.bl_tree[P[W] * 2 + 1] === 0; W--) + for (ye(x, x.dyn_ltree, x.l_desc.max_code), ye(x, x.dyn_dtree, x.d_desc.max_code), ue(x, x.bl_desc), W = w - 1; W >= 3 && x.bl_tree[P[W] * 2 + 1] === 0; W--) ; - return y.opt_len += 3 * (W + 1) + 5 + 5 + 4, W; - }, ze = (y, W, O, J) => { + return x.opt_len += 3 * (W + 1) + 5 + 5 + 4, W; + }, ze = (x, W, O, J) => { let ie; - for (se(y, W - 257, 5), se(y, O - 1, 5), se(y, J - 4, 4), ie = 0; ie < J; ie++) - se(y, y.bl_tree[P[ie] * 2 + 1], 3); - ge(y, y.dyn_ltree, W - 1), ge(y, y.dyn_dtree, O - 1); - }, He = (y) => { + for (ne(x, W - 257, 5), ne(x, O - 1, 5), ne(x, J - 4, 4), ie = 0; ie < J; ie++) + ne(x, x.bl_tree[P[ie] * 2 + 1], 3); + ge(x, x.dyn_ltree, W - 1), ge(x, x.dyn_dtree, O - 1); + }, He = (x) => { let W = 4093624447, O; for (O = 0; O <= 31; O++, W >>>= 1) - if (W & 1 && y.dyn_ltree[O * 2] !== 0) + if (W & 1 && x.dyn_ltree[O * 2] !== 0) return f; - if (y.dyn_ltree[9 * 2] !== 0 || y.dyn_ltree[10 * 2] !== 0 || y.dyn_ltree[13 * 2] !== 0) - return _; + if (x.dyn_ltree[9 * 2] !== 0 || x.dyn_ltree[10 * 2] !== 0 || x.dyn_ltree[13 * 2] !== 0) + return u; for (O = 32; O < S; O++) - if (y.dyn_ltree[O * 2] !== 0) - return _; + if (x.dyn_ltree[O * 2] !== 0) + return u; return f; }; let We = !1; - const Y = (y) => { - We || (pe(), We = !0), y.l_desc = new ee(y.dyn_ltree, V), y.d_desc = new ee(y.dyn_dtree, Q), y.bl_desc = new ee(y.bl_tree, oe), y.bi_buf = 0, y.bi_valid = 0, we(y); - }, K = (y, W, O, J) => { - se(y, (u << 1) + (J ? 1 : 0), 3), ke(y), me(y, O), me(y, ~O), O && y.pending_buf.set(y.window.subarray(W, W + O), y.pending), y.pending += O; - }, q = (y) => { - se(y, E << 1, 3), fe(y, g, F), Me(y); - }, de = (y, W, O, J) => { + const Y = (x) => { + We || (pe(), We = !0), x.l_desc = new oe(x.dyn_ltree, V), x.d_desc = new oe(x.dyn_dtree, Q), x.bl_desc = new oe(x.bl_tree, ae), x.bi_buf = 0, x.bi_valid = 0, we(x); + }, K = (x, W, O, J) => { + ne(x, (_ << 1) + (J ? 1 : 0), 3), ke(x), me(x, O), me(x, ~O), O && x.pending_buf.set(x.window.subarray(W, W + O), x.pending), x.pending += O; + }, ee = (x) => { + ne(x, E << 1, 3), fe(x, g, F), Me(x); + }, de = (x, W, O, J) => { let ie, te, De = 0; - y.level > 0 ? (y.strm.data_type === x && (y.strm.data_type = He(y)), ue(y, y.l_desc), ue(y, y.d_desc), De = Se(y), ie = y.opt_len + 3 + 7 >>> 3, te = y.static_len + 3 + 7 >>> 3, te <= ie && (ie = te)) : ie = te = O + 5, O + 4 <= ie && W !== -1 ? K(y, W, O, J) : y.strategy === s || te === ie ? (se(y, (E << 1) + (J ? 1 : 0), 3), Be(y, F, N)) : (se(y, (c << 1) + (J ? 1 : 0), 3), ze(y, y.l_desc.max_code + 1, y.d_desc.max_code + 1, De + 1), Be(y, y.dyn_ltree, y.dyn_dtree)), we(y), J && ke(y); - }, ve = (y, W, O) => (y.pending_buf[y.sym_buf + y.sym_next++] = W, y.pending_buf[y.sym_buf + y.sym_next++] = W >> 8, y.pending_buf[y.sym_buf + y.sym_next++] = O, W === 0 ? y.dyn_ltree[O * 2]++ : (y.matches++, W--, y.dyn_ltree[(k[O] + S + 1) * 2]++, y.dyn_dtree[ne(W) * 2]++), y.sym_next === y.sym_end); - var Ie = Y, Re = K, Z = de, ce = ve, Ae = q, Fe = { + x.level > 0 ? (x.strm.data_type === y && (x.strm.data_type = He(x)), ue(x, x.l_desc), ue(x, x.d_desc), De = Se(x), ie = x.opt_len + 3 + 7 >>> 3, te = x.static_len + 3 + 7 >>> 3, te <= ie && (ie = te)) : ie = te = O + 5, O + 4 <= ie && W !== -1 ? K(x, W, O, J) : x.strategy === n || te === ie ? (ne(x, (E << 1) + (J ? 1 : 0), 3), Be(x, F, N)) : (ne(x, (c << 1) + (J ? 1 : 0), 3), ze(x, x.l_desc.max_code + 1, x.d_desc.max_code + 1, De + 1), Be(x, x.dyn_ltree, x.dyn_dtree)), we(x), J && ke(x); + }, ve = (x, W, O) => (x.pending_buf[x.sym_buf + x.sym_next++] = W, x.pending_buf[x.sym_buf + x.sym_next++] = W >> 8, x.pending_buf[x.sym_buf + x.sym_next++] = O, W === 0 ? x.dyn_ltree[O * 2]++ : (x.matches++, W--, x.dyn_ltree[(k[O] + S + 1) * 2]++, x.dyn_dtree[q(W) * 2]++), x.sym_next === x.sym_end); + var Ie = Y, Re = K, Z = de, ce = ve, Ae = ee, Fe = { _tr_init: Ie, _tr_stored_block: Re, _tr_flush_block: Z, _tr_tally: ce, _tr_align: Ae - }, Oe = (y, W, O, J) => { - let ie = y & 65535 | 0, te = y >>> 16 & 65535 | 0, De = 0; + }, Oe = (x, W, O, J) => { + let ie = x & 65535 | 0, te = x >>> 16 & 65535 | 0, De = 0; for (; O !== 0; ) { De = O > 2e3 ? 2e3 : O, O -= De; do @@ -23449,21 +23449,21 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; return ie | te << 16 | 0; }; const j = () => { - let y, W = []; + let x, W = []; for (var O = 0; O < 256; O++) { - y = O; + x = O; for (var J = 0; J < 8; J++) - y = y & 1 ? 3988292384 ^ y >>> 1 : y >>> 1; - W[O] = y; + x = x & 1 ? 3988292384 ^ x >>> 1 : x >>> 1; + W[O] = x; } return W; }, $e = new Uint32Array(j()); - var I = (y, W, O, J) => { + var R = (x, W, O, J) => { const ie = $e, te = J + O; - y ^= -1; + x ^= -1; for (let De = J; De < te; De++) - y = y >>> 8 ^ ie[(y ^ W[De]) & 255]; - return y ^ -1; + x = x >>> 8 ^ ie[(x ^ W[De]) & 255]; + return x ^ -1; }, be = { 2: "need dictionary", /* Z_NEED_DICT 2 */ @@ -23542,40 +23542,40 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_DEFAULT_STRATEGY: Ft, Z_UNKNOWN: Qt, Z_DEFLATED: kt - } = Ee, Jt = 9, qt = 15, er = 8, Ht = 29, lr = 256 + 1 + Ht, Or = 30, Dr = 19, Pr = 2 * lr + 1, Ir = 15, at = 3, Bt = 258, pt = Bt + at + 1, yt = 32, At = 42, rr = 57, Rr = 69, $r = 73, Br = 91, zr = 103, Vt = 113, hr = 666, Dt = 1, ir = 2, jt = 3, nr = 4, nn = 3, Kt = (y, W) => (y.msg = be[W], W), Xr = (y) => y * 2 - (y > 4 ? 9 : 0), Gt = (y) => { - let W = y.length; + } = Ee, Jt = 9, qt = 15, er = 8, Ht = 29, lr = 256 + 1 + Ht, Or = 30, Dr = 19, Pr = 2 * lr + 1, Ir = 15, at = 3, Bt = 258, pt = Bt + at + 1, yt = 32, At = 42, rr = 57, Rr = 69, $r = 73, Br = 91, zr = 103, Vt = 113, hr = 666, Dt = 1, ir = 2, jt = 3, nr = 4, nn = 3, Kt = (x, W) => (x.msg = be[W], W), Xr = (x) => x * 2 - (x > 4 ? 9 : 0), Gt = (x) => { + let W = x.length; for (; --W >= 0; ) - y[W] = 0; - }, sn = (y) => { - let W, O, J, ie = y.w_size; - W = y.hash_size, J = W; + x[W] = 0; + }, sn = (x) => { + let W, O, J, ie = x.w_size; + W = x.hash_size, J = W; do - O = y.head[--J], y.head[J] = O >= ie ? O - ie : 0; + O = x.head[--J], x.head[J] = O >= ie ? O - ie : 0; while (--W); W = ie, J = W; do - O = y.prev[--J], y.prev[J] = O >= ie ? O - ie : 0; + O = x.prev[--J], x.prev[J] = O >= ie ? O - ie : 0; while (--W); }; - let Wt = (y, W, O) => (W << y.hash_shift ^ O) & y.hash_mask; - const It = (y) => { - const W = y.state; + let Wt = (x, W, O) => (W << x.hash_shift ^ O) & x.hash_mask; + const It = (x) => { + const W = x.state; let O = W.pending; - O > y.avail_out && (O = y.avail_out), O !== 0 && (y.output.set(W.pending_buf.subarray(W.pending_out, W.pending_out + O), y.next_out), y.next_out += O, W.pending_out += O, y.total_out += O, y.avail_out -= O, W.pending -= O, W.pending === 0 && (W.pending_out = 0)); - }, Rt = (y, W) => { - Le(y, y.block_start >= 0 ? y.block_start : -1, y.strstart - y.block_start, W), y.block_start = y.strstart, It(y.strm); - }, dt = (y, W) => { - y.pending_buf[y.pending++] = W; - }, fr = (y, W) => { - y.pending_buf[y.pending++] = W >>> 8 & 255, y.pending_buf[y.pending++] = W & 255; - }, Fr = (y, W, O, J) => { - let ie = y.avail_in; - return ie > J && (ie = J), ie === 0 ? 0 : (y.avail_in -= ie, W.set(y.input.subarray(y.next_in, y.next_in + ie), O), y.state.wrap === 1 ? y.adler = Oe(y.adler, W, ie, O) : y.state.wrap === 2 && (y.adler = I(y.adler, W, ie, O)), y.next_in += ie, y.total_in += ie, ie); - }, Qr = (y, W) => { - let O = y.max_chain_length, J = y.strstart, ie, te, De = y.prev_length, xe = y.nice_match; - const Qe = y.strstart > y.w_size - pt ? y.strstart - (y.w_size - pt) : 0, _e = y.window, Pe = y.w_mask, ut = y.prev, Xe = y.strstart + Bt; + O > x.avail_out && (O = x.avail_out), O !== 0 && (x.output.set(W.pending_buf.subarray(W.pending_out, W.pending_out + O), x.next_out), x.next_out += O, W.pending_out += O, x.total_out += O, x.avail_out -= O, W.pending -= O, W.pending === 0 && (W.pending_out = 0)); + }, Rt = (x, W) => { + Le(x, x.block_start >= 0 ? x.block_start : -1, x.strstart - x.block_start, W), x.block_start = x.strstart, It(x.strm); + }, dt = (x, W) => { + x.pending_buf[x.pending++] = W; + }, fr = (x, W) => { + x.pending_buf[x.pending++] = W >>> 8 & 255, x.pending_buf[x.pending++] = W & 255; + }, Fr = (x, W, O, J) => { + let ie = x.avail_in; + return ie > J && (ie = J), ie === 0 ? 0 : (x.avail_in -= ie, W.set(x.input.subarray(x.next_in, x.next_in + ie), O), x.state.wrap === 1 ? x.adler = Oe(x.adler, W, ie, O) : x.state.wrap === 2 && (x.adler = R(x.adler, W, ie, O)), x.next_in += ie, x.total_in += ie, ie); + }, Qr = (x, W) => { + let O = x.max_chain_length, J = x.strstart, ie, te, De = x.prev_length, xe = x.nice_match; + const Qe = x.strstart > x.w_size - pt ? x.strstart - (x.w_size - pt) : 0, _e = x.window, Pe = x.w_mask, ut = x.prev, Xe = x.strstart + Bt; let Ge = _e[J + De - 1], qe = _e[J + De]; - y.prev_length >= y.good_match && (O >>= 2), xe > y.lookahead && (xe = y.lookahead); + x.prev_length >= x.good_match && (O >>= 2), xe > x.lookahead && (xe = x.lookahead); do if (ie = W, !(_e[ie + De] !== qe || _e[ie + De - 1] !== Ge || _e[ie] !== _e[J] || _e[++ie] !== _e[J + 1])) { J += 2, ie++; @@ -23583,114 +23583,114 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; ; while (_e[++J] === _e[++ie] && _e[++J] === _e[++ie] && _e[++J] === _e[++ie] && _e[++J] === _e[++ie] && _e[++J] === _e[++ie] && _e[++J] === _e[++ie] && _e[++J] === _e[++ie] && _e[++J] === _e[++ie] && J < Xe); if (te = Bt - (Xe - J), J = Xe - Bt, te > De) { - if (y.match_start = W, De = te, te >= xe) + if (x.match_start = W, De = te, te >= xe) break; Ge = _e[J + De - 1], qe = _e[J + De]; } } while ((W = ut[W & Pe]) > Qe && --O !== 0); - return De <= y.lookahead ? De : y.lookahead; - }, sr = (y) => { - const W = y.w_size; + return De <= x.lookahead ? De : x.lookahead; + }, sr = (x) => { + const W = x.w_size; let O, J, ie; do { - if (J = y.window_size - y.lookahead - y.strstart, y.strstart >= W + (W - pt) && (y.window.set(y.window.subarray(W, W + W - J), 0), y.match_start -= W, y.strstart -= W, y.block_start -= W, y.insert > y.strstart && (y.insert = y.strstart), sn(y), J += W), y.strm.avail_in === 0) + if (J = x.window_size - x.lookahead - x.strstart, x.strstart >= W + (W - pt) && (x.window.set(x.window.subarray(W, W + W - J), 0), x.match_start -= W, x.strstart -= W, x.block_start -= W, x.insert > x.strstart && (x.insert = x.strstart), sn(x), J += W), x.strm.avail_in === 0) break; - if (O = Fr(y.strm, y.window, y.strstart + y.lookahead, J), y.lookahead += O, y.lookahead + y.insert >= at) - for (ie = y.strstart - y.insert, y.ins_h = y.window[ie], y.ins_h = Wt(y, y.ins_h, y.window[ie + 1]); y.insert && (y.ins_h = Wt(y, y.ins_h, y.window[ie + at - 1]), y.prev[ie & y.w_mask] = y.head[y.ins_h], y.head[y.ins_h] = ie, ie++, y.insert--, !(y.lookahead + y.insert < at)); ) + if (O = Fr(x.strm, x.window, x.strstart + x.lookahead, J), x.lookahead += O, x.lookahead + x.insert >= at) + for (ie = x.strstart - x.insert, x.ins_h = x.window[ie], x.ins_h = Wt(x, x.ins_h, x.window[ie + 1]); x.insert && (x.ins_h = Wt(x, x.ins_h, x.window[ie + at - 1]), x.prev[ie & x.w_mask] = x.head[x.ins_h], x.head[x.ins_h] = ie, ie++, x.insert--, !(x.lookahead + x.insert < at)); ) ; - } while (y.lookahead < pt && y.strm.avail_in !== 0); - }, Jr = (y, W) => { - let O = y.pending_buf_size - 5 > y.w_size ? y.w_size : y.pending_buf_size - 5, J, ie, te, De = 0, xe = y.strm.avail_in; + } while (x.lookahead < pt && x.strm.avail_in !== 0); + }, Jr = (x, W) => { + let O = x.pending_buf_size - 5 > x.w_size ? x.w_size : x.pending_buf_size - 5, J, ie, te, De = 0, xe = x.strm.avail_in; do { - if (J = 65535, te = y.bi_valid + 42 >> 3, y.strm.avail_out < te || (te = y.strm.avail_out - te, ie = y.strstart - y.block_start, J > ie + y.strm.avail_in && (J = ie + y.strm.avail_in), J > te && (J = te), J < O && (J === 0 && W !== rt || W === je || J !== ie + y.strm.avail_in))) + if (J = 65535, te = x.bi_valid + 42 >> 3, x.strm.avail_out < te || (te = x.strm.avail_out - te, ie = x.strstart - x.block_start, J > ie + x.strm.avail_in && (J = ie + x.strm.avail_in), J > te && (J = te), J < O && (J === 0 && W !== rt || W === je || J !== ie + x.strm.avail_in))) break; - De = W === rt && J === ie + y.strm.avail_in ? 1 : 0, le(y, 0, 0, De), y.pending_buf[y.pending - 4] = J, y.pending_buf[y.pending - 3] = J >> 8, y.pending_buf[y.pending - 2] = ~J, y.pending_buf[y.pending - 1] = ~J >> 8, It(y.strm), ie && (ie > J && (ie = J), y.strm.output.set(y.window.subarray(y.block_start, y.block_start + ie), y.strm.next_out), y.strm.next_out += ie, y.strm.avail_out -= ie, y.strm.total_out += ie, y.block_start += ie, J -= ie), J && (Fr(y.strm, y.strm.output, y.strm.next_out, J), y.strm.next_out += J, y.strm.avail_out -= J, y.strm.total_out += J); + De = W === rt && J === ie + x.strm.avail_in ? 1 : 0, le(x, 0, 0, De), x.pending_buf[x.pending - 4] = J, x.pending_buf[x.pending - 3] = J >> 8, x.pending_buf[x.pending - 2] = ~J, x.pending_buf[x.pending - 1] = ~J >> 8, It(x.strm), ie && (ie > J && (ie = J), x.strm.output.set(x.window.subarray(x.block_start, x.block_start + ie), x.strm.next_out), x.strm.next_out += ie, x.strm.avail_out -= ie, x.strm.total_out += ie, x.block_start += ie, J -= ie), J && (Fr(x.strm, x.strm.output, x.strm.next_out, J), x.strm.next_out += J, x.strm.avail_out -= J, x.strm.total_out += J); } while (De === 0); - return xe -= y.strm.avail_in, xe && (xe >= y.w_size ? (y.matches = 2, y.window.set(y.strm.input.subarray(y.strm.next_in - y.w_size, y.strm.next_in), 0), y.strstart = y.w_size, y.insert = y.strstart) : (y.window_size - y.strstart <= xe && (y.strstart -= y.w_size, y.window.set(y.window.subarray(y.w_size, y.w_size + y.strstart), 0), y.matches < 2 && y.matches++, y.insert > y.strstart && (y.insert = y.strstart)), y.window.set(y.strm.input.subarray(y.strm.next_in - xe, y.strm.next_in), y.strstart), y.strstart += xe, y.insert += xe > y.w_size - y.insert ? y.w_size - y.insert : xe), y.block_start = y.strstart), y.high_water < y.strstart && (y.high_water = y.strstart), De ? nr : W !== je && W !== rt && y.strm.avail_in === 0 && y.strstart === y.block_start ? ir : (te = y.window_size - y.strstart, y.strm.avail_in > te && y.block_start >= y.w_size && (y.block_start -= y.w_size, y.strstart -= y.w_size, y.window.set(y.window.subarray(y.w_size, y.w_size + y.strstart), 0), y.matches < 2 && y.matches++, te += y.w_size, y.insert > y.strstart && (y.insert = y.strstart)), te > y.strm.avail_in && (te = y.strm.avail_in), te && (Fr(y.strm, y.window, y.strstart, te), y.strstart += te, y.insert += te > y.w_size - y.insert ? y.w_size - y.insert : te), y.high_water < y.strstart && (y.high_water = y.strstart), te = y.bi_valid + 42 >> 3, te = y.pending_buf_size - te > 65535 ? 65535 : y.pending_buf_size - te, O = te > y.w_size ? y.w_size : te, ie = y.strstart - y.block_start, (ie >= O || (ie || W === rt) && W !== je && y.strm.avail_in === 0 && ie <= te) && (J = ie > te ? te : ie, De = W === rt && y.strm.avail_in === 0 && J === ie ? 1 : 0, le(y, y.block_start, J, De), y.block_start += J, It(y.strm)), De ? jt : Dt); - }, kr = (y, W) => { + return xe -= x.strm.avail_in, xe && (xe >= x.w_size ? (x.matches = 2, x.window.set(x.strm.input.subarray(x.strm.next_in - x.w_size, x.strm.next_in), 0), x.strstart = x.w_size, x.insert = x.strstart) : (x.window_size - x.strstart <= xe && (x.strstart -= x.w_size, x.window.set(x.window.subarray(x.w_size, x.w_size + x.strstart), 0), x.matches < 2 && x.matches++, x.insert > x.strstart && (x.insert = x.strstart)), x.window.set(x.strm.input.subarray(x.strm.next_in - xe, x.strm.next_in), x.strstart), x.strstart += xe, x.insert += xe > x.w_size - x.insert ? x.w_size - x.insert : xe), x.block_start = x.strstart), x.high_water < x.strstart && (x.high_water = x.strstart), De ? nr : W !== je && W !== rt && x.strm.avail_in === 0 && x.strstart === x.block_start ? ir : (te = x.window_size - x.strstart, x.strm.avail_in > te && x.block_start >= x.w_size && (x.block_start -= x.w_size, x.strstart -= x.w_size, x.window.set(x.window.subarray(x.w_size, x.w_size + x.strstart), 0), x.matches < 2 && x.matches++, te += x.w_size, x.insert > x.strstart && (x.insert = x.strstart)), te > x.strm.avail_in && (te = x.strm.avail_in), te && (Fr(x.strm, x.window, x.strstart, te), x.strstart += te, x.insert += te > x.w_size - x.insert ? x.w_size - x.insert : te), x.high_water < x.strstart && (x.high_water = x.strstart), te = x.bi_valid + 42 >> 3, te = x.pending_buf_size - te > 65535 ? 65535 : x.pending_buf_size - te, O = te > x.w_size ? x.w_size : te, ie = x.strstart - x.block_start, (ie >= O || (ie || W === rt) && W !== je && x.strm.avail_in === 0 && ie <= te) && (J = ie > te ? te : ie, De = W === rt && x.strm.avail_in === 0 && J === ie ? 1 : 0, le(x, x.block_start, J, De), x.block_start += J, It(x.strm)), De ? jt : Dt); + }, kr = (x, W) => { let O, J; for (; ; ) { - if (y.lookahead < pt) { - if (sr(y), y.lookahead < pt && W === je) + if (x.lookahead < pt) { + if (sr(x), x.lookahead < pt && W === je) return Dt; - if (y.lookahead === 0) + if (x.lookahead === 0) break; } - if (O = 0, y.lookahead >= at && (y.ins_h = Wt(y, y.ins_h, y.window[y.strstart + at - 1]), O = y.prev[y.strstart & y.w_mask] = y.head[y.ins_h], y.head[y.ins_h] = y.strstart), O !== 0 && y.strstart - O <= y.w_size - pt && (y.match_length = Qr(y, O)), y.match_length >= at) - if (J = Ze(y, y.strstart - y.match_start, y.match_length - at), y.lookahead -= y.match_length, y.match_length <= y.max_lazy_match && y.lookahead >= at) { - y.match_length--; + if (O = 0, x.lookahead >= at && (x.ins_h = Wt(x, x.ins_h, x.window[x.strstart + at - 1]), O = x.prev[x.strstart & x.w_mask] = x.head[x.ins_h], x.head[x.ins_h] = x.strstart), O !== 0 && x.strstart - O <= x.w_size - pt && (x.match_length = Qr(x, O)), x.match_length >= at) + if (J = Ze(x, x.strstart - x.match_start, x.match_length - at), x.lookahead -= x.match_length, x.match_length <= x.max_lazy_match && x.lookahead >= at) { + x.match_length--; do - y.strstart++, y.ins_h = Wt(y, y.ins_h, y.window[y.strstart + at - 1]), O = y.prev[y.strstart & y.w_mask] = y.head[y.ins_h], y.head[y.ins_h] = y.strstart; - while (--y.match_length !== 0); - y.strstart++; + x.strstart++, x.ins_h = Wt(x, x.ins_h, x.window[x.strstart + at - 1]), O = x.prev[x.strstart & x.w_mask] = x.head[x.ins_h], x.head[x.ins_h] = x.strstart; + while (--x.match_length !== 0); + x.strstart++; } else - y.strstart += y.match_length, y.match_length = 0, y.ins_h = y.window[y.strstart], y.ins_h = Wt(y, y.ins_h, y.window[y.strstart + 1]); + x.strstart += x.match_length, x.match_length = 0, x.ins_h = x.window[x.strstart], x.ins_h = Wt(x, x.ins_h, x.window[x.strstart + 1]); else - J = Ze(y, 0, y.window[y.strstart]), y.lookahead--, y.strstart++; - if (J && (Rt(y, !1), y.strm.avail_out === 0)) + J = Ze(x, 0, x.window[x.strstart]), x.lookahead--, x.strstart++; + if (J && (Rt(x, !1), x.strm.avail_out === 0)) return Dt; } - return y.insert = y.strstart < at - 1 ? y.strstart : at - 1, W === rt ? (Rt(y, !0), y.strm.avail_out === 0 ? jt : nr) : y.sym_next && (Rt(y, !1), y.strm.avail_out === 0) ? Dt : ir; - }, ar = (y, W) => { + return x.insert = x.strstart < at - 1 ? x.strstart : at - 1, W === rt ? (Rt(x, !0), x.strm.avail_out === 0 ? jt : nr) : x.sym_next && (Rt(x, !1), x.strm.avail_out === 0) ? Dt : ir; + }, ar = (x, W) => { let O, J, ie; for (; ; ) { - if (y.lookahead < pt) { - if (sr(y), y.lookahead < pt && W === je) + if (x.lookahead < pt) { + if (sr(x), x.lookahead < pt && W === je) return Dt; - if (y.lookahead === 0) + if (x.lookahead === 0) break; } - if (O = 0, y.lookahead >= at && (y.ins_h = Wt(y, y.ins_h, y.window[y.strstart + at - 1]), O = y.prev[y.strstart & y.w_mask] = y.head[y.ins_h], y.head[y.ins_h] = y.strstart), y.prev_length = y.match_length, y.prev_match = y.match_start, y.match_length = at - 1, O !== 0 && y.prev_length < y.max_lazy_match && y.strstart - O <= y.w_size - pt && (y.match_length = Qr(y, O), y.match_length <= 5 && (y.strategy === bt || y.match_length === at && y.strstart - y.match_start > 4096) && (y.match_length = at - 1)), y.prev_length >= at && y.match_length <= y.prev_length) { - ie = y.strstart + y.lookahead - at, J = Ze(y, y.strstart - 1 - y.prev_match, y.prev_length - at), y.lookahead -= y.prev_length - 1, y.prev_length -= 2; + if (O = 0, x.lookahead >= at && (x.ins_h = Wt(x, x.ins_h, x.window[x.strstart + at - 1]), O = x.prev[x.strstart & x.w_mask] = x.head[x.ins_h], x.head[x.ins_h] = x.strstart), x.prev_length = x.match_length, x.prev_match = x.match_start, x.match_length = at - 1, O !== 0 && x.prev_length < x.max_lazy_match && x.strstart - O <= x.w_size - pt && (x.match_length = Qr(x, O), x.match_length <= 5 && (x.strategy === bt || x.match_length === at && x.strstart - x.match_start > 4096) && (x.match_length = at - 1)), x.prev_length >= at && x.match_length <= x.prev_length) { + ie = x.strstart + x.lookahead - at, J = Ze(x, x.strstart - 1 - x.prev_match, x.prev_length - at), x.lookahead -= x.prev_length - 1, x.prev_length -= 2; do - ++y.strstart <= ie && (y.ins_h = Wt(y, y.ins_h, y.window[y.strstart + at - 1]), O = y.prev[y.strstart & y.w_mask] = y.head[y.ins_h], y.head[y.ins_h] = y.strstart); - while (--y.prev_length !== 0); - if (y.match_available = 0, y.match_length = at - 1, y.strstart++, J && (Rt(y, !1), y.strm.avail_out === 0)) + ++x.strstart <= ie && (x.ins_h = Wt(x, x.ins_h, x.window[x.strstart + at - 1]), O = x.prev[x.strstart & x.w_mask] = x.head[x.ins_h], x.head[x.ins_h] = x.strstart); + while (--x.prev_length !== 0); + if (x.match_available = 0, x.match_length = at - 1, x.strstart++, J && (Rt(x, !1), x.strm.avail_out === 0)) return Dt; - } else if (y.match_available) { - if (J = Ze(y, 0, y.window[y.strstart - 1]), J && Rt(y, !1), y.strstart++, y.lookahead--, y.strm.avail_out === 0) + } else if (x.match_available) { + if (J = Ze(x, 0, x.window[x.strstart - 1]), J && Rt(x, !1), x.strstart++, x.lookahead--, x.strm.avail_out === 0) return Dt; } else - y.match_available = 1, y.strstart++, y.lookahead--; + x.match_available = 1, x.strstart++, x.lookahead--; } - return y.match_available && (J = Ze(y, 0, y.window[y.strstart - 1]), y.match_available = 0), y.insert = y.strstart < at - 1 ? y.strstart : at - 1, W === rt ? (Rt(y, !0), y.strm.avail_out === 0 ? jt : nr) : y.sym_next && (Rt(y, !1), y.strm.avail_out === 0) ? Dt : ir; - }, an = (y, W) => { + return x.match_available && (J = Ze(x, 0, x.window[x.strstart - 1]), x.match_available = 0), x.insert = x.strstart < at - 1 ? x.strstart : at - 1, W === rt ? (Rt(x, !0), x.strm.avail_out === 0 ? jt : nr) : x.sym_next && (Rt(x, !1), x.strm.avail_out === 0) ? Dt : ir; + }, an = (x, W) => { let O, J, ie, te; - const De = y.window; + const De = x.window; for (; ; ) { - if (y.lookahead <= Bt) { - if (sr(y), y.lookahead <= Bt && W === je) + if (x.lookahead <= Bt) { + if (sr(x), x.lookahead <= Bt && W === je) return Dt; - if (y.lookahead === 0) + if (x.lookahead === 0) break; } - if (y.match_length = 0, y.lookahead >= at && y.strstart > 0 && (ie = y.strstart - 1, J = De[ie], J === De[++ie] && J === De[++ie] && J === De[++ie])) { - te = y.strstart + Bt; + if (x.match_length = 0, x.lookahead >= at && x.strstart > 0 && (ie = x.strstart - 1, J = De[ie], J === De[++ie] && J === De[++ie] && J === De[++ie])) { + te = x.strstart + Bt; do ; while (J === De[++ie] && J === De[++ie] && J === De[++ie] && J === De[++ie] && J === De[++ie] && J === De[++ie] && J === De[++ie] && J === De[++ie] && ie < te); - y.match_length = Bt - (te - ie), y.match_length > y.lookahead && (y.match_length = y.lookahead); + x.match_length = Bt - (te - ie), x.match_length > x.lookahead && (x.match_length = x.lookahead); } - if (y.match_length >= at ? (O = Ze(y, 1, y.match_length - at), y.lookahead -= y.match_length, y.strstart += y.match_length, y.match_length = 0) : (O = Ze(y, 0, y.window[y.strstart]), y.lookahead--, y.strstart++), O && (Rt(y, !1), y.strm.avail_out === 0)) + if (x.match_length >= at ? (O = Ze(x, 1, x.match_length - at), x.lookahead -= x.match_length, x.strstart += x.match_length, x.match_length = 0) : (O = Ze(x, 0, x.window[x.strstart]), x.lookahead--, x.strstart++), O && (Rt(x, !1), x.strm.avail_out === 0)) return Dt; } - return y.insert = 0, W === rt ? (Rt(y, !0), y.strm.avail_out === 0 ? jt : nr) : y.sym_next && (Rt(y, !1), y.strm.avail_out === 0) ? Dt : ir; - }, on = (y, W) => { + return x.insert = 0, W === rt ? (Rt(x, !0), x.strm.avail_out === 0 ? jt : nr) : x.sym_next && (Rt(x, !1), x.strm.avail_out === 0) ? Dt : ir; + }, on = (x, W) => { let O; for (; ; ) { - if (y.lookahead === 0 && (sr(y), y.lookahead === 0)) { + if (x.lookahead === 0 && (sr(x), x.lookahead === 0)) { if (W === je) return Dt; break; } - if (y.match_length = 0, O = Ze(y, 0, y.window[y.strstart]), y.lookahead--, y.strstart++, O && (Rt(y, !1), y.strm.avail_out === 0)) + if (x.match_length = 0, O = Ze(x, 0, x.window[x.strstart]), x.lookahead--, x.strstart++, O && (Rt(x, !1), x.strm.avail_out === 0)) return Dt; } - return y.insert = 0, W === rt ? (Rt(y, !0), y.strm.avail_out === 0 ? jt : nr) : y.sym_next && (Rt(y, !1), y.strm.avail_out === 0) ? Dt : ir; + return x.insert = 0, W === rt ? (Rt(x, !0), x.strm.avail_out === 0 ? jt : nr) : x.sym_next && (Rt(x, !1), x.strm.avail_out === 0) ? Dt : ir; }; - function zt(y, W, O, J, ie) { - this.good_length = y, this.max_lazy = W, this.nice_length = O, this.max_chain = J, this.func = ie; + function zt(x, W, O, J, ie) { + this.good_length = x, this.max_lazy = W, this.nice_length = O, this.max_chain = J, this.func = ie; } const cr = [ /* good lazy nice chain */ @@ -23714,67 +23714,67 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; /* 8 */ new zt(32, 258, 258, 4096, ar) /* 9 max compression */ - ], ln = (y) => { - y.window_size = 2 * y.w_size, Gt(y.head), y.max_lazy_match = cr[y.level].max_lazy, y.good_match = cr[y.level].good_length, y.nice_match = cr[y.level].nice_length, y.max_chain_length = cr[y.level].max_chain, y.strstart = 0, y.block_start = 0, y.lookahead = 0, y.insert = 0, y.match_length = y.prev_length = at - 1, y.match_available = 0, y.ins_h = 0; + ], ln = (x) => { + x.window_size = 2 * x.w_size, Gt(x.head), x.max_lazy_match = cr[x.level].max_lazy, x.good_match = cr[x.level].good_length, x.nice_match = cr[x.level].nice_length, x.max_chain_length = cr[x.level].max_chain, x.strstart = 0, x.block_start = 0, x.lookahead = 0, x.insert = 0, x.match_length = x.prev_length = at - 1, x.match_available = 0, x.ins_h = 0; }; function hn() { this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = kt, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new Uint16Array(Pr * 2), this.dyn_dtree = new Uint16Array((2 * Or + 1) * 2), this.bl_tree = new Uint16Array((2 * Dr + 1) * 2), Gt(this.dyn_ltree), Gt(this.dyn_dtree), Gt(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new Uint16Array(Ir + 1), this.heap = new Uint16Array(2 * lr + 1), Gt(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new Uint16Array(2 * lr + 1), Gt(this.depth), this.sym_buf = 0, this.lit_bufsize = 0, this.sym_next = 0, this.sym_end = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; } - const ur = (y) => { - if (!y) + const ur = (x) => { + if (!x) return 1; - const W = y.state; - return !W || W.strm !== y || W.status !== At && //#ifdef GZIP + const W = x.state; + return !W || W.strm !== x || W.status !== At && //#ifdef GZIP W.status !== rr && //#endif W.status !== Rr && W.status !== $r && W.status !== Br && W.status !== zr && W.status !== Vt && W.status !== hr ? 1 : 0; - }, qr = (y) => { - if (ur(y)) - return Kt(y, lt); - y.total_in = y.total_out = 0, y.data_type = Qt; - const W = y.state; + }, qr = (x) => { + if (ur(x)) + return Kt(x, lt); + x.total_in = x.total_out = 0, x.data_type = Qt; + const W = x.state; return W.pending = 0, W.pending_out = 0, W.wrap < 0 && (W.wrap = -W.wrap), W.status = //#ifdef GZIP W.wrap === 2 ? rr : ( //#endif W.wrap ? At : Vt - ), y.adler = W.wrap === 2 ? 0 : 1, W.last_flush = -2, X(W), tt; - }, ei = (y) => { - const W = qr(y); - return W === tt && ln(y.state), W; - }, cn = (y, W) => ur(y) || y.state.wrap !== 2 ? lt : (y.state.gzhead = W, tt), ti = (y, W, O, J, ie, te) => { - if (!y) + ), x.adler = W.wrap === 2 ? 0 : 1, W.last_flush = -2, X(W), tt; + }, ei = (x) => { + const W = qr(x); + return W === tt && ln(x.state), W; + }, cn = (x, W) => ur(x) || x.state.wrap !== 2 ? lt : (x.state.gzhead = W, tt), ti = (x, W, O, J, ie, te) => { + if (!x) return lt; let De = 1; if (W === vt && (W = 6), J < 0 ? (De = 0, J = -J) : J > 15 && (De = 2, J -= 16), ie < 1 || ie > Jt || O !== kt || J < 8 || J > 15 || W < 0 || W > 9 || te < 0 || te > Ot || J === 8 && De !== 1) - return Kt(y, lt); + return Kt(x, lt); J === 8 && (J = 9); const xe = new hn(); - return y.state = xe, xe.strm = y, xe.status = At, xe.wrap = De, xe.gzhead = null, xe.w_bits = J, xe.w_size = 1 << xe.w_bits, xe.w_mask = xe.w_size - 1, xe.hash_bits = ie + 7, xe.hash_size = 1 << xe.hash_bits, xe.hash_mask = xe.hash_size - 1, xe.hash_shift = ~~((xe.hash_bits + at - 1) / at), xe.window = new Uint8Array(xe.w_size * 2), xe.head = new Uint16Array(xe.hash_size), xe.prev = new Uint16Array(xe.w_size), xe.lit_bufsize = 1 << ie + 6, xe.pending_buf_size = xe.lit_bufsize * 4, xe.pending_buf = new Uint8Array(xe.pending_buf_size), xe.sym_buf = xe.lit_bufsize, xe.sym_end = (xe.lit_bufsize - 1) * 3, xe.level = W, xe.strategy = te, xe.method = O, ei(y); - }, un = (y, W) => ti(y, W, kt, qt, er, Ft), dn = (y, W) => { - if (ur(y) || W > it || W < 0) - return y ? Kt(y, lt) : lt; - const O = y.state; - if (!y.output || y.avail_in !== 0 && !y.input || O.status === hr && W !== rt) - return Kt(y, y.avail_out === 0 ? Pt : lt); + return x.state = xe, xe.strm = x, xe.status = At, xe.wrap = De, xe.gzhead = null, xe.w_bits = J, xe.w_size = 1 << xe.w_bits, xe.w_mask = xe.w_size - 1, xe.hash_bits = ie + 7, xe.hash_size = 1 << xe.hash_bits, xe.hash_mask = xe.hash_size - 1, xe.hash_shift = ~~((xe.hash_bits + at - 1) / at), xe.window = new Uint8Array(xe.w_size * 2), xe.head = new Uint16Array(xe.hash_size), xe.prev = new Uint16Array(xe.w_size), xe.lit_bufsize = 1 << ie + 6, xe.pending_buf_size = xe.lit_bufsize * 4, xe.pending_buf = new Uint8Array(xe.pending_buf_size), xe.sym_buf = xe.lit_bufsize, xe.sym_end = (xe.lit_bufsize - 1) * 3, xe.level = W, xe.strategy = te, xe.method = O, ei(x); + }, un = (x, W) => ti(x, W, kt, qt, er, Ft), dn = (x, W) => { + if (ur(x) || W > it || W < 0) + return x ? Kt(x, lt) : lt; + const O = x.state; + if (!x.output || x.avail_in !== 0 && !x.input || O.status === hr && W !== rt) + return Kt(x, x.avail_out === 0 ? Pt : lt); const J = O.last_flush; if (O.last_flush = W, O.pending !== 0) { - if (It(y), y.avail_out === 0) + if (It(x), x.avail_out === 0) return O.last_flush = -1, tt; - } else if (y.avail_in === 0 && Xr(W) <= Xr(J) && W !== rt) - return Kt(y, Pt); - if (O.status === hr && y.avail_in !== 0) - return Kt(y, Pt); + } else if (x.avail_in === 0 && Xr(W) <= Xr(J) && W !== rt) + return Kt(x, Pt); + if (O.status === hr && x.avail_in !== 0) + return Kt(x, Pt); if (O.status === At && O.wrap === 0 && (O.status = Vt), O.status === At) { let ie = kt + (O.w_bits - 8 << 4) << 8, te = -1; - if (O.strategy >= mt || O.level < 2 ? te = 0 : O.level < 6 ? te = 1 : O.level === 6 ? te = 2 : te = 3, ie |= te << 6, O.strstart !== 0 && (ie |= yt), ie += 31 - ie % 31, fr(O, ie), O.strstart !== 0 && (fr(O, y.adler >>> 16), fr(O, y.adler & 65535)), y.adler = 1, O.status = Vt, It(y), O.pending !== 0) + if (O.strategy >= mt || O.level < 2 ? te = 0 : O.level < 6 ? te = 1 : O.level === 6 ? te = 2 : te = 3, ie |= te << 6, O.strstart !== 0 && (ie |= yt), ie += 31 - ie % 31, fr(O, ie), O.strstart !== 0 && (fr(O, x.adler >>> 16), fr(O, x.adler & 65535)), x.adler = 1, O.status = Vt, It(x), O.pending !== 0) return O.last_flush = -1, tt; } if (O.status === rr) { - if (y.adler = 0, dt(O, 31), dt(O, 139), dt(O, 8), O.gzhead) + if (x.adler = 0, dt(O, 31), dt(O, 139), dt(O, 8), O.gzhead) dt( O, (O.gzhead.text ? 1 : 0) + (O.gzhead.hcrc ? 2 : 0) + (O.gzhead.extra ? 4 : 0) + (O.gzhead.name ? 8 : 0) + (O.gzhead.comment ? 16 : 0) - ), dt(O, O.gzhead.time & 255), dt(O, O.gzhead.time >> 8 & 255), dt(O, O.gzhead.time >> 16 & 255), dt(O, O.gzhead.time >> 24 & 255), dt(O, O.level === 9 ? 2 : O.strategy >= mt || O.level < 2 ? 4 : 0), dt(O, O.gzhead.os & 255), O.gzhead.extra && O.gzhead.extra.length && (dt(O, O.gzhead.extra.length & 255), dt(O, O.gzhead.extra.length >> 8 & 255)), O.gzhead.hcrc && (y.adler = I(y.adler, O.pending_buf, O.pending, 0)), O.gzindex = 0, O.status = Rr; - else if (dt(O, 0), dt(O, 0), dt(O, 0), dt(O, 0), dt(O, 0), dt(O, O.level === 9 ? 2 : O.strategy >= mt || O.level < 2 ? 4 : 0), dt(O, nn), O.status = Vt, It(y), O.pending !== 0) + ), dt(O, O.gzhead.time & 255), dt(O, O.gzhead.time >> 8 & 255), dt(O, O.gzhead.time >> 16 & 255), dt(O, O.gzhead.time >> 24 & 255), dt(O, O.level === 9 ? 2 : O.strategy >= mt || O.level < 2 ? 4 : 0), dt(O, O.gzhead.os & 255), O.gzhead.extra && O.gzhead.extra.length && (dt(O, O.gzhead.extra.length & 255), dt(O, O.gzhead.extra.length >> 8 & 255)), O.gzhead.hcrc && (x.adler = R(x.adler, O.pending_buf, O.pending, 0)), O.gzindex = 0, O.status = Rr; + else if (dt(O, 0), dt(O, 0), dt(O, 0), dt(O, 0), dt(O, 0), dt(O, O.level === 9 ? 2 : O.strategy >= mt || O.level < 2 ? 4 : 0), dt(O, nn), O.status = Vt, It(x), O.pending !== 0) return O.last_flush = -1, tt; } if (O.status === Rr) { @@ -23782,12 +23782,12 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; let ie = O.pending, te = (O.gzhead.extra.length & 65535) - O.gzindex; for (; O.pending + te > O.pending_buf_size; ) { let xe = O.pending_buf_size - O.pending; - if (O.pending_buf.set(O.gzhead.extra.subarray(O.gzindex, O.gzindex + xe), O.pending), O.pending = O.pending_buf_size, O.gzhead.hcrc && O.pending > ie && (y.adler = I(y.adler, O.pending_buf, O.pending - ie, ie)), O.gzindex += xe, It(y), O.pending !== 0) + if (O.pending_buf.set(O.gzhead.extra.subarray(O.gzindex, O.gzindex + xe), O.pending), O.pending = O.pending_buf_size, O.gzhead.hcrc && O.pending > ie && (x.adler = R(x.adler, O.pending_buf, O.pending - ie, ie)), O.gzindex += xe, It(x), O.pending !== 0) return O.last_flush = -1, tt; ie = 0, te -= xe; } let De = new Uint8Array(O.gzhead.extra); - O.pending_buf.set(De.subarray(O.gzindex, O.gzindex + te), O.pending), O.pending += te, O.gzhead.hcrc && O.pending > ie && (y.adler = I(y.adler, O.pending_buf, O.pending - ie, ie)), O.gzindex = 0; + O.pending_buf.set(De.subarray(O.gzindex, O.gzindex + te), O.pending), O.pending += te, O.gzhead.hcrc && O.pending > ie && (x.adler = R(x.adler, O.pending_buf, O.pending - ie, ie)), O.gzindex = 0; } O.status = $r; } @@ -23796,13 +23796,13 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; let ie = O.pending, te; do { if (O.pending === O.pending_buf_size) { - if (O.gzhead.hcrc && O.pending > ie && (y.adler = I(y.adler, O.pending_buf, O.pending - ie, ie)), It(y), O.pending !== 0) + if (O.gzhead.hcrc && O.pending > ie && (x.adler = R(x.adler, O.pending_buf, O.pending - ie, ie)), It(x), O.pending !== 0) return O.last_flush = -1, tt; ie = 0; } O.gzindex < O.gzhead.name.length ? te = O.gzhead.name.charCodeAt(O.gzindex++) & 255 : te = 0, dt(O, te); } while (te !== 0); - O.gzhead.hcrc && O.pending > ie && (y.adler = I(y.adler, O.pending_buf, O.pending - ie, ie)), O.gzindex = 0; + O.gzhead.hcrc && O.pending > ie && (x.adler = R(x.adler, O.pending_buf, O.pending - ie, ie)), O.gzindex = 0; } O.status = Br; } @@ -23811,59 +23811,59 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; let ie = O.pending, te; do { if (O.pending === O.pending_buf_size) { - if (O.gzhead.hcrc && O.pending > ie && (y.adler = I(y.adler, O.pending_buf, O.pending - ie, ie)), It(y), O.pending !== 0) + if (O.gzhead.hcrc && O.pending > ie && (x.adler = R(x.adler, O.pending_buf, O.pending - ie, ie)), It(x), O.pending !== 0) return O.last_flush = -1, tt; ie = 0; } O.gzindex < O.gzhead.comment.length ? te = O.gzhead.comment.charCodeAt(O.gzindex++) & 255 : te = 0, dt(O, te); } while (te !== 0); - O.gzhead.hcrc && O.pending > ie && (y.adler = I(y.adler, O.pending_buf, O.pending - ie, ie)); + O.gzhead.hcrc && O.pending > ie && (x.adler = R(x.adler, O.pending_buf, O.pending - ie, ie)); } O.status = zr; } if (O.status === zr) { if (O.gzhead.hcrc) { - if (O.pending + 2 > O.pending_buf_size && (It(y), O.pending !== 0)) + if (O.pending + 2 > O.pending_buf_size && (It(x), O.pending !== 0)) return O.last_flush = -1, tt; - dt(O, y.adler & 255), dt(O, y.adler >> 8 & 255), y.adler = 0; + dt(O, x.adler & 255), dt(O, x.adler >> 8 & 255), x.adler = 0; } - if (O.status = Vt, It(y), O.pending !== 0) + if (O.status = Vt, It(x), O.pending !== 0) return O.last_flush = -1, tt; } - if (y.avail_in !== 0 || O.lookahead !== 0 || W !== je && O.status !== hr) { + if (x.avail_in !== 0 || O.lookahead !== 0 || W !== je && O.status !== hr) { let ie = O.level === 0 ? Jr(O, W) : O.strategy === mt ? on(O, W) : O.strategy === Tt ? an(O, W) : cr[O.level].func(O, W); if ((ie === jt || ie === nr) && (O.status = hr), ie === Dt || ie === jt) - return y.avail_out === 0 && (O.last_flush = -1), tt; - if (ie === ir && (W === Je ? Ke(O) : W !== it && (le(O, 0, 0, !1), W === Lt && (Gt(O.head), O.lookahead === 0 && (O.strstart = 0, O.block_start = 0, O.insert = 0))), It(y), y.avail_out === 0)) + return x.avail_out === 0 && (O.last_flush = -1), tt; + if (ie === ir && (W === Je ? Ke(O) : W !== it && (le(O, 0, 0, !1), W === Lt && (Gt(O.head), O.lookahead === 0 && (O.strstart = 0, O.block_start = 0, O.insert = 0))), It(x), x.avail_out === 0)) return O.last_flush = -1, tt; } - return W !== rt ? tt : O.wrap <= 0 ? Et : (O.wrap === 2 ? (dt(O, y.adler & 255), dt(O, y.adler >> 8 & 255), dt(O, y.adler >> 16 & 255), dt(O, y.adler >> 24 & 255), dt(O, y.total_in & 255), dt(O, y.total_in >> 8 & 255), dt(O, y.total_in >> 16 & 255), dt(O, y.total_in >> 24 & 255)) : (fr(O, y.adler >>> 16), fr(O, y.adler & 65535)), It(y), O.wrap > 0 && (O.wrap = -O.wrap), O.pending !== 0 ? tt : Et); - }, _n = (y) => { - if (ur(y)) + return W !== rt ? tt : O.wrap <= 0 ? Et : (O.wrap === 2 ? (dt(O, x.adler & 255), dt(O, x.adler >> 8 & 255), dt(O, x.adler >> 16 & 255), dt(O, x.adler >> 24 & 255), dt(O, x.total_in & 255), dt(O, x.total_in >> 8 & 255), dt(O, x.total_in >> 16 & 255), dt(O, x.total_in >> 24 & 255)) : (fr(O, x.adler >>> 16), fr(O, x.adler & 65535)), It(x), O.wrap > 0 && (O.wrap = -O.wrap), O.pending !== 0 ? tt : Et); + }, _n = (x) => { + if (ur(x)) return lt; - const W = y.state.status; - return y.state = null, W === Vt ? Kt(y, wt) : tt; - }, pn = (y, W) => { + const W = x.state.status; + return x.state = null, W === Vt ? Kt(x, wt) : tt; + }, pn = (x, W) => { let O = W.length; - if (ur(y)) + if (ur(x)) return lt; - const J = y.state, ie = J.wrap; + const J = x.state, ie = J.wrap; if (ie === 2 || ie === 1 && J.status !== At || J.lookahead) return lt; - if (ie === 1 && (y.adler = Oe(y.adler, W, O, 0)), J.wrap = 0, O >= J.w_size) { + if (ie === 1 && (x.adler = Oe(x.adler, W, O, 0)), J.wrap = 0, O >= J.w_size) { ie === 0 && (Gt(J.head), J.strstart = 0, J.block_start = 0, J.insert = 0); let Qe = new Uint8Array(J.w_size); Qe.set(W.subarray(O - J.w_size, O), 0), W = Qe, O = J.w_size; } - const te = y.avail_in, De = y.next_in, xe = y.input; - for (y.avail_in = O, y.next_in = 0, y.input = W, sr(J); J.lookahead >= at; ) { + const te = x.avail_in, De = x.next_in, xe = x.input; + for (x.avail_in = O, x.next_in = 0, x.input = W, sr(J); J.lookahead >= at; ) { let Qe = J.strstart, _e = J.lookahead - (at - 1); do J.ins_h = Wt(J, J.ins_h, J.window[Qe + at - 1]), J.prev[Qe & J.w_mask] = J.head[J.ins_h], J.head[J.ins_h] = Qe, Qe++; while (--_e); J.strstart = Qe, J.lookahead = at - 1, sr(J); } - return J.strstart += J.lookahead, J.block_start = J.strstart, J.insert = J.lookahead, J.lookahead = 0, J.match_length = J.prev_length = at - 1, J.match_available = 0, y.next_in = De, y.input = xe, y.avail_in = te, J.wrap = ie, tt; + return J.strstart += J.lookahead, J.block_start = J.strstart, J.insert = J.lookahead, J.lookahead = 0, J.match_length = J.prev_length = at - 1, J.match_available = 0, x.next_in = De, x.input = xe, x.avail_in = te, J.wrap = ie, tt; }; var gn = un, mn = ti, vn = ei, bn = qr, yn = cn, xn = dn, En = _n, wn = pn, An = "pako deflate (from Nodeca project)", dr = { deflateInit: gn, @@ -23876,8 +23876,8 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; deflateSetDictionary: wn, deflateInfo: An }; - const Mn = (y, W) => Object.prototype.hasOwnProperty.call(y, W); - var Cn = function(y) { + const Mn = (x, W) => Object.prototype.hasOwnProperty.call(x, W); + var Cn = function(x) { const W = Array.prototype.slice.call(arguments, 1); for (; W.length; ) { const O = W.shift(); @@ -23885,17 +23885,17 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (typeof O != "object") throw new TypeError(O + "must be non-object"); for (const J in O) - Mn(O, J) && (y[J] = O[J]); + Mn(O, J) && (x[J] = O[J]); } } - return y; - }, Ln = (y) => { + return x; + }, Ln = (x) => { let W = 0; - for (let J = 0, ie = y.length; J < ie; J++) - W += y[J].length; + for (let J = 0, ie = x.length; J < ie; J++) + W += x[J].length; const O = new Uint8Array(W); - for (let J = 0, ie = 0, te = y.length; J < te; J++) { - let De = y[J]; + for (let J = 0, ie = 0, te = x.length; J < te; J++) { + let De = x[J]; O.set(De, ie), ie += De.length; } return O; @@ -23910,35 +23910,35 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; ri = !1; } const _r = new Uint8Array(256); - for (let y = 0; y < 256; y++) - _r[y] = y >= 252 ? 6 : y >= 248 ? 5 : y >= 240 ? 4 : y >= 224 ? 3 : y >= 192 ? 2 : 1; + for (let x = 0; x < 256; x++) + _r[x] = x >= 252 ? 6 : x >= 248 ? 5 : x >= 240 ? 4 : x >= 224 ? 3 : x >= 192 ? 2 : 1; _r[254] = _r[254] = 1; - var Sn = (y) => { + var Sn = (x) => { if (typeof TextEncoder == "function" && TextEncoder.prototype.encode) - return new TextEncoder().encode(y); - let W, O, J, ie, te, De = y.length, xe = 0; + return new TextEncoder().encode(x); + let W, O, J, ie, te, De = x.length, xe = 0; for (ie = 0; ie < De; ie++) - O = y.charCodeAt(ie), (O & 64512) === 55296 && ie + 1 < De && (J = y.charCodeAt(ie + 1), (J & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (J - 56320), ie++)), xe += O < 128 ? 1 : O < 2048 ? 2 : O < 65536 ? 3 : 4; + O = x.charCodeAt(ie), (O & 64512) === 55296 && ie + 1 < De && (J = x.charCodeAt(ie + 1), (J & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (J - 56320), ie++)), xe += O < 128 ? 1 : O < 2048 ? 2 : O < 65536 ? 3 : 4; for (W = new Uint8Array(xe), te = 0, ie = 0; te < xe; ie++) - O = y.charCodeAt(ie), (O & 64512) === 55296 && ie + 1 < De && (J = y.charCodeAt(ie + 1), (J & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (J - 56320), ie++)), O < 128 ? W[te++] = O : O < 2048 ? (W[te++] = 192 | O >>> 6, W[te++] = 128 | O & 63) : O < 65536 ? (W[te++] = 224 | O >>> 12, W[te++] = 128 | O >>> 6 & 63, W[te++] = 128 | O & 63) : (W[te++] = 240 | O >>> 18, W[te++] = 128 | O >>> 12 & 63, W[te++] = 128 | O >>> 6 & 63, W[te++] = 128 | O & 63); + O = x.charCodeAt(ie), (O & 64512) === 55296 && ie + 1 < De && (J = x.charCodeAt(ie + 1), (J & 64512) === 56320 && (O = 65536 + (O - 55296 << 10) + (J - 56320), ie++)), O < 128 ? W[te++] = O : O < 2048 ? (W[te++] = 192 | O >>> 6, W[te++] = 128 | O & 63) : O < 65536 ? (W[te++] = 224 | O >>> 12, W[te++] = 128 | O >>> 6 & 63, W[te++] = 128 | O & 63) : (W[te++] = 240 | O >>> 18, W[te++] = 128 | O >>> 12 & 63, W[te++] = 128 | O >>> 6 & 63, W[te++] = 128 | O & 63); return W; }; - const Tn = (y, W) => { - if (W < 65534 && y.subarray && ri) - return String.fromCharCode.apply(null, y.length === W ? y : y.subarray(0, W)); + const Tn = (x, W) => { + if (W < 65534 && x.subarray && ri) + return String.fromCharCode.apply(null, x.length === W ? x : x.subarray(0, W)); let O = ""; for (let J = 0; J < W; J++) - O += String.fromCharCode(y[J]); + O += String.fromCharCode(x[J]); return O; }; - var On = (y, W) => { - const O = W || y.length; + var On = (x, W) => { + const O = W || x.length; if (typeof TextDecoder == "function" && TextDecoder.prototype.decode) - return new TextDecoder().decode(y.subarray(0, W)); + return new TextDecoder().decode(x.subarray(0, W)); let J, ie; const te = new Array(O * 2); for (ie = 0, J = 0; J < O; ) { - let De = y[J++]; + let De = x[J++]; if (De < 128) { te[ie++] = De; continue; @@ -23949,7 +23949,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; continue; } for (De &= xe === 2 ? 31 : xe === 3 ? 15 : 7; xe > 1 && J < O; ) - De = De << 6 | y[J++] & 63, xe--; + De = De << 6 | x[J++] & 63, xe--; if (xe > 1) { te[ie++] = 65533; continue; @@ -23957,12 +23957,12 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; De < 65536 ? te[ie++] = De : (De -= 65536, te[ie++] = 55296 | De >> 10 & 1023, te[ie++] = 56320 | De & 1023); } return Tn(te, ie); - }, Dn = (y, W) => { - W = W || y.length, W > y.length && (W = y.length); + }, Dn = (x, W) => { + W = W || x.length, W > x.length && (W = x.length); let O = W - 1; - for (; O >= 0 && (y[O] & 192) === 128; ) + for (; O >= 0 && (x[O] & 192) === 128; ) O--; - return O < 0 || O === 0 ? W : O + _r[y[O]] > W ? O : W; + return O < 0 || O === 0 ? W : O + _r[x[O]] > W ? O : W; }, pr = { string2buf: Sn, buf2string: On, @@ -23983,7 +23983,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_DEFAULT_STRATEGY: kn, Z_DEFLATED: Un } = Ee; - function gr(y) { + function gr(x) { this.options = yr.assign({ level: Fn, method: Un, @@ -23991,7 +23991,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; windowBits: 15, memLevel: 8, strategy: kn - }, y || {}); + }, x || {}); let W = this.options; W.raw && W.windowBits > 0 ? W.windowBits = -W.windowBits : W.gzip && W.windowBits > 0 && W.windowBits < 16 && (W.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new ii(), this.strm.avail_out = 0; let O = dr.deflateInit2( @@ -24011,12 +24011,12 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; this._dict_set = !0; } } - gr.prototype.push = function(y, W) { + gr.prototype.push = function(x, W) { const O = this.strm, J = this.options.chunkSize; let ie, te; if (this.ended) return !1; - for (W === ~~W ? te = W : te = W === !0 ? Bn : In, typeof y == "string" ? O.input = pr.string2buf(y) : ni.call(y) === "[object ArrayBuffer]" ? O.input = new Uint8Array(y) : O.input = y, O.next_in = 0, O.avail_in = O.input.length; ; ) { + for (W === ~~W ? te = W : te = W === !0 ? Bn : In, typeof x == "string" ? O.input = pr.string2buf(x) : ni.call(x) === "[object ArrayBuffer]" ? O.input = new Uint8Array(x) : O.input = x, O.next_in = 0, O.avail_in = O.input.length; ; ) { if (O.avail_out === 0 && (O.output = new Uint8Array(J), O.next_out = 0, O.avail_out = J), (te === Rn || te === $n) && O.avail_out <= 6) { this.onData(O.output.subarray(0, O.next_out)), O.avail_out = 0; continue; @@ -24035,22 +24035,22 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; break; } return !0; - }, gr.prototype.onData = function(y) { - this.chunks.push(y); - }, gr.prototype.onEnd = function(y) { - y === xr && (this.result = yr.flattenChunks(this.chunks)), this.chunks = [], this.err = y, this.msg = this.strm.msg; + }, gr.prototype.onData = function(x) { + this.chunks.push(x); + }, gr.prototype.onEnd = function(x) { + x === xr && (this.result = yr.flattenChunks(this.chunks)), this.chunks = [], this.err = x, this.msg = this.strm.msg; }; - function Ur(y, W) { + function Ur(x, W) { const O = new gr(W); - if (O.push(y, !0), O.err) + if (O.push(x, !0), O.err) throw O.msg || be[O.err]; return O.result; } - function Nn(y, W) { - return W = W || {}, W.raw = !0, Ur(y, W); + function Nn(x, W) { + return W = W || {}, W.raw = !0, Ur(x, W); } - function Gn(y, W) { - return W = W || {}, W.gzip = !0, Ur(y, W); + function Gn(x, W) { + return W = W || {}, W.gzip = !0, Ur(x, W); } var Wn = gr, Hn = Ur, Vn = Nn, jn = Gn, Kn = Ee, Zn = { Deflate: Wn, @@ -24285,7 +24285,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; 64, 64 ]); - var mr = (y, W, O, J, ie, te, De, xe) => { + var mr = (x, W, O, J, ie, te, De, xe) => { const Qe = xe.bits; let _e = 0, Pe = 0, ut = 0, Xe = 0, Ge = 0, qe = 0, Ct = 0, ft = 0, st = 0, gt = 0, ot, Ye, _t, St, et, xt = null, ct; const nt = new Uint16Array(or + 1), ht = new Uint16Array(or + 1); @@ -24303,13 +24303,13 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (Ge < ut && (Ge = ut), ft = 1, _e = 1; _e <= or; _e++) if (ft <<= 1, ft -= nt[_e], ft < 0) return -1; - if (ft > 0 && (y === oi || Xe !== 1)) + if (ft > 0 && (x === oi || Xe !== 1)) return -1; for (ht[1] = 0, _e = 1; _e < or; _e++) ht[_e + 1] = ht[_e] + nt[_e]; for (Pe = 0; Pe < J; Pe++) W[O + Pe] !== 0 && (De[ht[W[O + Pe]]++] = Pe); - if (y === oi ? (xt = Xt = De, ct = 20) : y === Nr ? (xt = Qn, Xt = Jn, ct = 257) : (xt = qn, Xt = es, ct = 0), gt = 0, Pe = 0, _e = ut, et = te, qe = Ge, Ct = 0, _t = -1, st = 1 << Ge, St = st - 1, y === Nr && st > si || y === li && st > ai) + if (x === oi ? (xt = Xt = De, ct = 20) : x === Nr ? (xt = Qn, Xt = Jn, ct = 257) : (xt = qn, Xt = es, ct = 0), gt = 0, Pe = 0, _e = ut, et = te, qe = Ge, Ct = 0, _t = -1, st = 1 << Ge, St = st - 1, x === Nr && st > si || x === li && st > ai) return 1; for (; ; ) { rn = _e - Ct, De[Pe] + 1 < ct ? (Sr = 0, Tr = De[Pe]) : De[Pe] >= ct ? (Sr = Xt[De[Pe] - ct], Tr = xt[De[Pe] - ct]) : (Sr = 32 + 64, Tr = 0), ot = 1 << _e - Ct, Ye = 1 << qe, ut = Ye; @@ -24326,7 +24326,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (_e > Ge && (gt & St) !== _t) { for (Ct === 0 && (Ct = Ge), et += ut, qe = _e - Ct, ft = 1 << qe; qe + Ct < Xe && (ft -= nt[qe + Ct], !(ft <= 0)); ) qe++, ft <<= 1; - if (st += 1 << qe, y === Nr && st > si || y === li && st > ai) + if (st += 1 << qe, x === Nr && st > si || x === li && st > ai) return 1; _t = gt & St, ie[_t] = Ge << 24 | qe << 16 | et - te | 0; } @@ -24345,62 +24345,62 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_MEM_ERROR: di, Z_BUF_ERROR: ss, Z_DEFLATED: _i - } = Ee, Ar = 16180, pi = 16181, gi = 16182, mi = 16183, vi = 16184, bi = 16185, yi = 16186, xi = 16187, Ei = 16188, wi = 16189, Mr = 16190, Ut = 16191, Gr = 16192, Ai = 16193, Wr = 16194, Mi = 16195, Ci = 16196, Li = 16197, Si = 16198, Cr = 16199, Lr = 16200, Ti = 16201, Oi = 16202, Di = 16203, Pi = 16204, Ii = 16205, Hr = 16206, Ri = 16207, $i = 16208, Mt = 16209, Bi = 16210, zi = 16211, as = 852, os = 592, ls = 15, Fi = (y) => (y >>> 24 & 255) + (y >>> 8 & 65280) + ((y & 65280) << 8) + ((y & 255) << 24); + } = Ee, Ar = 16180, pi = 16181, gi = 16182, mi = 16183, vi = 16184, bi = 16185, yi = 16186, xi = 16187, Ei = 16188, wi = 16189, Mr = 16190, Ut = 16191, Gr = 16192, Ai = 16193, Wr = 16194, Mi = 16195, Ci = 16196, Li = 16197, Si = 16198, Cr = 16199, Lr = 16200, Ti = 16201, Oi = 16202, Di = 16203, Pi = 16204, Ii = 16205, Hr = 16206, Ri = 16207, $i = 16208, Mt = 16209, Bi = 16210, zi = 16211, as = 852, os = 592, ls = 15, Fi = (x) => (x >>> 24 & 255) + (x >>> 8 & 65280) + ((x & 65280) << 8) + ((x & 255) << 24); function hs() { this.strm = null, this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new Uint16Array(320), this.work = new Uint16Array(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0; } - const Yt = (y) => { - if (!y) + const Yt = (x) => { + if (!x) return 1; - const W = y.state; - return !W || W.strm !== y || W.mode < Ar || W.mode > zi ? 1 : 0; - }, ki = (y) => { - if (Yt(y)) + const W = x.state; + return !W || W.strm !== x || W.mode < Ar || W.mode > zi ? 1 : 0; + }, ki = (x) => { + if (Yt(x)) return $t; - const W = y.state; - return y.total_in = y.total_out = W.total = 0, y.msg = "", W.wrap && (y.adler = W.wrap & 1), W.mode = Ar, W.last = 0, W.havedict = 0, W.flags = -1, W.dmax = 32768, W.head = null, W.hold = 0, W.bits = 0, W.lencode = W.lendyn = new Int32Array(as), W.distcode = W.distdyn = new Int32Array(os), W.sane = 1, W.back = -1, Zt; - }, Ui = (y) => { - if (Yt(y)) + const W = x.state; + return x.total_in = x.total_out = W.total = 0, x.msg = "", W.wrap && (x.adler = W.wrap & 1), W.mode = Ar, W.last = 0, W.havedict = 0, W.flags = -1, W.dmax = 32768, W.head = null, W.hold = 0, W.bits = 0, W.lencode = W.lendyn = new Int32Array(as), W.distcode = W.distdyn = new Int32Array(os), W.sane = 1, W.back = -1, Zt; + }, Ui = (x) => { + if (Yt(x)) return $t; - const W = y.state; - return W.wsize = 0, W.whave = 0, W.wnext = 0, ki(y); - }, Ni = (y, W) => { + const W = x.state; + return W.wsize = 0, W.whave = 0, W.wnext = 0, ki(x); + }, Ni = (x, W) => { let O; - if (Yt(y)) + if (Yt(x)) return $t; - const J = y.state; - return W < 0 ? (O = 0, W = -W) : (O = (W >> 4) + 5, W < 48 && (W &= 15)), W && (W < 8 || W > 15) ? $t : (J.window !== null && J.wbits !== W && (J.window = null), J.wrap = O, J.wbits = W, Ui(y)); - }, Gi = (y, W) => { - if (!y) + const J = x.state; + return W < 0 ? (O = 0, W = -W) : (O = (W >> 4) + 5, W < 48 && (W &= 15)), W && (W < 8 || W > 15) ? $t : (J.window !== null && J.wbits !== W && (J.window = null), J.wrap = O, J.wbits = W, Ui(x)); + }, Gi = (x, W) => { + if (!x) return $t; const O = new hs(); - y.state = O, O.strm = y, O.window = null, O.mode = Ar; - const J = Ni(y, W); - return J !== Zt && (y.state = null), J; - }, fs = (y) => Gi(y, ls); + x.state = O, O.strm = x, O.window = null, O.mode = Ar; + const J = Ni(x, W); + return J !== Zt && (x.state = null), J; + }, fs = (x) => Gi(x, ls); let Wi = !0, Vr, jr; - const cs = (y) => { + const cs = (x) => { if (Wi) { Vr = new Int32Array(512), jr = new Int32Array(32); let W = 0; for (; W < 144; ) - y.lens[W++] = 8; + x.lens[W++] = 8; for (; W < 256; ) - y.lens[W++] = 9; + x.lens[W++] = 9; for (; W < 280; ) - y.lens[W++] = 7; + x.lens[W++] = 7; for (; W < 288; ) - y.lens[W++] = 8; - for (mr(hi, y.lens, 0, 288, Vr, 0, y.work, { bits: 9 }), W = 0; W < 32; ) - y.lens[W++] = 5; - mr(fi, y.lens, 0, 32, jr, 0, y.work, { bits: 5 }), Wi = !1; + x.lens[W++] = 8; + for (mr(hi, x.lens, 0, 288, Vr, 0, x.work, { bits: 9 }), W = 0; W < 32; ) + x.lens[W++] = 5; + mr(fi, x.lens, 0, 32, jr, 0, x.work, { bits: 5 }), Wi = !1; } - y.lencode = Vr, y.lenbits = 9, y.distcode = jr, y.distbits = 5; - }, Hi = (y, W, O, J) => { + x.lencode = Vr, x.lenbits = 9, x.distcode = jr, x.distbits = 5; + }, Hi = (x, W, O, J) => { let ie; - const te = y.state; + const te = x.state; return te.window === null && (te.wsize = 1 << te.wbits, te.wnext = 0, te.whave = 0, te.window = new Uint8Array(te.wsize)), J >= te.wsize ? (te.window.set(W.subarray(O - te.wsize, O), 0), te.wnext = 0, te.whave = te.wsize) : (ie = te.wsize - te.wnext, ie > J && (ie = J), te.window.set(W.subarray(O - J, O - J + ie), te.wnext), J -= ie, J ? (te.window.set(W.subarray(O - J, O), 0), te.wnext = J, te.whave = te.wsize) : (te.wnext += ie, te.wnext === te.wsize && (te.wnext = 0), te.whave < te.wsize && (te.whave += ie))), 0; - }, us = (y, W) => { + }, us = (x, W) => { let O, J, ie, te, De, xe, Qe, _e, Pe, ut, Xe, Ge, qe, Ct, ft = 0, st, gt, ot, Ye, _t, St, et, xt; const ct = new Uint8Array(4); let nt, ht; @@ -24408,9 +24408,9 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; /* permutation of code lengths */ new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]) ); - if (Yt(y) || !y.output || !y.input && y.avail_in !== 0) + if (Yt(x) || !x.output || !x.input && x.avail_in !== 0) return $t; - O = y.state, O.mode === Ut && (O.mode = Gr), De = y.next_out, ie = y.output, Qe = y.avail_out, te = y.next_in, J = y.input, xe = y.avail_in, _e = O.hold, Pe = O.bits, ut = xe, Xe = Qe, xt = Zt; + O = x.state, O.mode === Ut && (O.mode = Gr), De = x.next_out, ie = x.output, Qe = x.avail_out, te = x.next_in, J = x.input, xe = x.avail_in, _e = O.hold, Pe = O.bits, ut = xe, Xe = Qe, xt = Zt; e: for (; ; ) switch (O.mode) { @@ -24425,23 +24425,23 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; xe--, _e += J[te++] << Pe, Pe += 8; } if (O.wrap & 2 && _e === 35615) { - O.wbits === 0 && (O.wbits = 15), O.check = 0, ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, O.check = I(O.check, ct, 2, 0), _e = 0, Pe = 0, O.mode = pi; + O.wbits === 0 && (O.wbits = 15), O.check = 0, ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, O.check = R(O.check, ct, 2, 0), _e = 0, Pe = 0, O.mode = pi; break; } if (O.head && (O.head.done = !1), !(O.wrap & 1) || /* check if zlib header allowed */ (((_e & 255) << 8) + (_e >> 8)) % 31) { - y.msg = "incorrect header check", O.mode = Mt; + x.msg = "incorrect header check", O.mode = Mt; break; } if ((_e & 15) !== _i) { - y.msg = "unknown compression method", O.mode = Mt; + x.msg = "unknown compression method", O.mode = Mt; break; } if (_e >>>= 4, Pe -= 4, et = (_e & 15) + 8, O.wbits === 0 && (O.wbits = et), et > 15 || et > O.wbits) { - y.msg = "invalid window size", O.mode = Mt; + x.msg = "invalid window size", O.mode = Mt; break; } - O.dmax = 1 << O.wbits, O.flags = 0, y.adler = O.check = 1, O.mode = _e & 512 ? wi : Ut, _e = 0, Pe = 0; + O.dmax = 1 << O.wbits, O.flags = 0, x.adler = O.check = 1, O.mode = _e & 512 ? wi : Ut, _e = 0, Pe = 0; break; case pi: for (; Pe < 16; ) { @@ -24450,28 +24450,28 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; xe--, _e += J[te++] << Pe, Pe += 8; } if (O.flags = _e, (O.flags & 255) !== _i) { - y.msg = "unknown compression method", O.mode = Mt; + x.msg = "unknown compression method", O.mode = Mt; break; } if (O.flags & 57344) { - y.msg = "unknown header flags set", O.mode = Mt; + x.msg = "unknown header flags set", O.mode = Mt; break; } - O.head && (O.head.text = _e >> 8 & 1), O.flags & 512 && O.wrap & 4 && (ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, O.check = I(O.check, ct, 2, 0)), _e = 0, Pe = 0, O.mode = gi; + O.head && (O.head.text = _e >> 8 & 1), O.flags & 512 && O.wrap & 4 && (ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, O.check = R(O.check, ct, 2, 0)), _e = 0, Pe = 0, O.mode = gi; case gi: for (; Pe < 32; ) { if (xe === 0) break e; xe--, _e += J[te++] << Pe, Pe += 8; } - O.head && (O.head.time = _e), O.flags & 512 && O.wrap & 4 && (ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, ct[2] = _e >>> 16 & 255, ct[3] = _e >>> 24 & 255, O.check = I(O.check, ct, 4, 0)), _e = 0, Pe = 0, O.mode = mi; + O.head && (O.head.time = _e), O.flags & 512 && O.wrap & 4 && (ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, ct[2] = _e >>> 16 & 255, ct[3] = _e >>> 24 & 255, O.check = R(O.check, ct, 4, 0)), _e = 0, Pe = 0, O.mode = mi; case mi: for (; Pe < 16; ) { if (xe === 0) break e; xe--, _e += J[te++] << Pe, Pe += 8; } - O.head && (O.head.xflags = _e & 255, O.head.os = _e >> 8), O.flags & 512 && O.wrap & 4 && (ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, O.check = I(O.check, ct, 2, 0)), _e = 0, Pe = 0, O.mode = vi; + O.head && (O.head.xflags = _e & 255, O.head.os = _e >> 8), O.flags & 512 && O.wrap & 4 && (ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, O.check = R(O.check, ct, 2, 0)), _e = 0, Pe = 0, O.mode = vi; case vi: if (O.flags & 1024) { for (; Pe < 16; ) { @@ -24479,7 +24479,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; break e; xe--, _e += J[te++] << Pe, Pe += 8; } - O.length = _e, O.head && (O.head.extra_len = _e), O.flags & 512 && O.wrap & 4 && (ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, O.check = I(O.check, ct, 2, 0)), _e = 0, Pe = 0; + O.length = _e, O.head && (O.head.extra_len = _e), O.flags & 512 && O.wrap & 4 && (ct[0] = _e & 255, ct[1] = _e >>> 8 & 255, O.check = R(O.check, ct, 2, 0)), _e = 0, Pe = 0; } else O.head && (O.head.extra = null); O.mode = bi; @@ -24493,7 +24493,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; ), /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ et - )), O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, Ge, te)), xe -= Ge, te += Ge, O.length -= Ge), O.length)) + )), O.flags & 512 && O.wrap & 4 && (O.check = R(O.check, J, Ge, te)), xe -= Ge, te += Ge, O.length -= Ge), O.length)) break e; O.length = 0, O.mode = yi; case yi: @@ -24504,7 +24504,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; do et = J[te + Ge++], O.head && et && O.length < 65536 && (O.head.name += String.fromCharCode(et)); while (et && Ge < xe); - if (O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, Ge, te)), xe -= Ge, te += Ge, et) + if (O.flags & 512 && O.wrap & 4 && (O.check = R(O.check, J, Ge, te)), xe -= Ge, te += Ge, et) break e; } else O.head && (O.head.name = null); @@ -24517,7 +24517,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; do et = J[te + Ge++], O.head && et && O.length < 65536 && (O.head.comment += String.fromCharCode(et)); while (et && Ge < xe); - if (O.flags & 512 && O.wrap & 4 && (O.check = I(O.check, J, Ge, te)), xe -= Ge, te += Ge, et) + if (O.flags & 512 && O.wrap & 4 && (O.check = R(O.check, J, Ge, te)), xe -= Ge, te += Ge, et) break e; } else O.head && (O.head.comment = null); @@ -24530,12 +24530,12 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; xe--, _e += J[te++] << Pe, Pe += 8; } if (O.wrap & 4 && _e !== (O.check & 65535)) { - y.msg = "header crc mismatch", O.mode = Mt; + x.msg = "header crc mismatch", O.mode = Mt; break; } _e = 0, Pe = 0; } - O.head && (O.head.hcrc = O.flags >> 9 & 1, O.head.done = !0), y.adler = O.check = 0, O.mode = Ut; + O.head && (O.head.hcrc = O.flags >> 9 & 1, O.head.done = !0), x.adler = O.check = 0, O.mode = Ut; break; case wi: for (; Pe < 32; ) { @@ -24543,11 +24543,11 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; break e; xe--, _e += J[te++] << Pe, Pe += 8; } - y.adler = O.check = Fi(_e), _e = 0, Pe = 0, O.mode = Mr; + x.adler = O.check = Fi(_e), _e = 0, Pe = 0, O.mode = Mr; case Mr: if (O.havedict === 0) - return y.next_out = De, y.avail_out = Qe, y.next_in = te, y.avail_in = xe, O.hold = _e, O.bits = Pe, ns; - y.adler = O.check = 1, O.mode = Ut; + return x.next_out = De, x.avail_out = Qe, x.next_in = te, x.avail_in = xe, O.hold = _e, O.bits = Pe, ns; + x.adler = O.check = 1, O.mode = Ut; case Ut: if (W === rs || W === wr) break e; @@ -24575,7 +24575,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; O.mode = Ci; break; case 3: - y.msg = "invalid block type", O.mode = Mt; + x.msg = "invalid block type", O.mode = Mt; } _e >>>= 2, Pe -= 2; break; @@ -24586,7 +24586,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; xe--, _e += J[te++] << Pe, Pe += 8; } if ((_e & 65535) !== (_e >>> 16 ^ 65535)) { - y.msg = "invalid stored block lengths", O.mode = Mt; + x.msg = "invalid stored block lengths", O.mode = Mt; break; } if (O.length = _e & 65535, _e = 0, Pe = 0, O.mode = Wr, W === wr) @@ -24609,7 +24609,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; xe--, _e += J[te++] << Pe, Pe += 8; } if (O.nlen = (_e & 31) + 257, _e >>>= 5, Pe -= 5, O.ndist = (_e & 31) + 1, _e >>>= 5, Pe -= 5, O.ncode = (_e & 15) + 4, _e >>>= 4, Pe -= 4, O.nlen > 286 || O.ndist > 30) { - y.msg = "too many length or distance symbols", O.mode = Mt; + x.msg = "too many length or distance symbols", O.mode = Mt; break; } O.have = 0, O.mode = Li; @@ -24625,7 +24625,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; for (; O.have < 19; ) O.lens[Xt[O.have++]] = 0; if (O.lencode = O.lendyn, O.lenbits = 7, nt = { bits: O.lenbits }, xt = mr(ts, O.lens, 0, 19, O.lencode, 0, O.work, nt), O.lenbits = nt.bits, xt) { - y.msg = "invalid code lengths set", O.mode = Mt; + x.msg = "invalid code lengths set", O.mode = Mt; break; } O.have = 0, O.mode = Si; @@ -24646,7 +24646,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; xe--, _e += J[te++] << Pe, Pe += 8; } if (_e >>>= st, Pe -= st, O.have === 0) { - y.msg = "invalid bit length repeat", O.mode = Mt; + x.msg = "invalid bit length repeat", O.mode = Mt; break; } et = O.lens[O.have - 1], Ge = 3 + (_e & 3), _e >>>= 2, Pe -= 2; @@ -24666,7 +24666,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; _e >>>= st, Pe -= st, et = 0, Ge = 11 + (_e & 127), _e >>>= 7, Pe -= 7; } if (O.have + Ge > O.nlen + O.ndist) { - y.msg = "invalid bit length repeat", O.mode = Mt; + x.msg = "invalid bit length repeat", O.mode = Mt; break; } for (; Ge--; ) @@ -24676,15 +24676,15 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (O.mode === Mt) break; if (O.lens[256] === 0) { - y.msg = "invalid code -- missing end-of-block", O.mode = Mt; + x.msg = "invalid code -- missing end-of-block", O.mode = Mt; break; } if (O.lenbits = 9, nt = { bits: O.lenbits }, xt = mr(hi, O.lens, 0, O.nlen, O.lencode, 0, O.work, nt), O.lenbits = nt.bits, xt) { - y.msg = "invalid literal/lengths set", O.mode = Mt; + x.msg = "invalid literal/lengths set", O.mode = Mt; break; } if (O.distbits = 6, O.distcode = O.distdyn, nt = { bits: O.distbits }, xt = mr(fi, O.lens, O.nlen, O.ndist, O.distcode, 0, O.work, nt), O.distbits = nt.bits, xt) { - y.msg = "invalid distances set", O.mode = Mt; + x.msg = "invalid distances set", O.mode = Mt; break; } if (O.mode = Cr, W === wr) @@ -24693,7 +24693,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; O.mode = Lr; case Lr: if (xe >= 6 && Qe >= 258) { - y.next_out = De, y.avail_out = Qe, y.next_in = te, y.avail_in = xe, O.hold = _e, O.bits = Pe, Xn(y, Xe), De = y.next_out, ie = y.output, Qe = y.avail_out, te = y.next_in, J = y.input, xe = y.avail_in, _e = O.hold, Pe = O.bits, O.mode === Ut && (O.back = -1); + x.next_out = De, x.avail_out = Qe, x.next_in = te, x.avail_in = xe, O.hold = _e, O.bits = Pe, Xn(x, Xe), De = x.next_out, ie = x.output, Qe = x.avail_out, te = x.next_in, J = x.input, xe = x.avail_in, _e = O.hold, Pe = O.bits, O.mode === Ut && (O.back = -1); break; } for (O.back = 0; ft = O.lencode[_e & (1 << O.lenbits) - 1], st = ft >>> 24, gt = ft >>> 16 & 255, ot = ft & 65535, !(st <= Pe); ) { @@ -24718,7 +24718,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; break; } if (gt & 64) { - y.msg = "invalid literal/length code", O.mode = Mt; + x.msg = "invalid literal/length code", O.mode = Mt; break; } O.extra = gt & 15, O.mode = Ti; @@ -24747,7 +24747,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; _e >>>= Ye, Pe -= Ye, O.back += Ye; } if (_e >>>= st, Pe -= st, O.back += st, gt & 64) { - y.msg = "invalid distance code", O.mode = Mt; + x.msg = "invalid distance code", O.mode = Mt; break; } O.offset = ot, O.extra = gt & 15, O.mode = Di; @@ -24761,7 +24761,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; O.offset += _e & (1 << O.extra) - 1, _e >>>= O.extra, Pe -= O.extra, O.back += O.extra; } if (O.offset > O.dmax) { - y.msg = "invalid distance too far back", O.mode = Mt; + x.msg = "invalid distance too far back", O.mode = Mt; break; } O.mode = Pi; @@ -24770,7 +24770,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; break e; if (Ge = Xe - Qe, O.offset > Ge) { if (Ge = O.offset - Ge, Ge > O.whave && O.sane) { - y.msg = "invalid distance too far back", O.mode = Mt; + x.msg = "invalid distance too far back", O.mode = Mt; break; } Ge > O.wnext ? (Ge -= O.wnext, qe = O.wsize - Ge) : qe = O.wnext - Ge, Ge > O.length && (Ge = O.length), Ct = O.window; @@ -24794,9 +24794,9 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; break e; xe--, _e |= J[te++] << Pe, Pe += 8; } - if (Xe -= Qe, y.total_out += Xe, O.total += Xe, O.wrap & 4 && Xe && (y.adler = O.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/ - O.flags ? I(O.check, ie, Xe, De - Xe) : Oe(O.check, ie, Xe, De - Xe)), Xe = Qe, O.wrap & 4 && (O.flags ? _e : Fi(_e)) !== O.check) { - y.msg = "incorrect data check", O.mode = Mt; + if (Xe -= Qe, x.total_out += Xe, O.total += Xe, O.wrap & 4 && Xe && (x.adler = O.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/ + O.flags ? R(O.check, ie, Xe, De - Xe) : Oe(O.check, ie, Xe, De - Xe)), Xe = Qe, O.wrap & 4 && (O.flags ? _e : Fi(_e)) !== O.check) { + x.msg = "incorrect data check", O.mode = Mt; break; } _e = 0, Pe = 0; @@ -24810,7 +24810,7 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; xe--, _e += J[te++] << Pe, Pe += 8; } if (O.wrap & 4 && _e !== (O.total & 4294967295)) { - y.msg = "incorrect length check", O.mode = Mt; + x.msg = "incorrect length check", O.mode = Mt; break; } _e = 0, Pe = 0; @@ -24828,22 +24828,22 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; default: return $t; } - return y.next_out = De, y.avail_out = Qe, y.next_in = te, y.avail_in = xe, O.hold = _e, O.bits = Pe, (O.wsize || Xe !== y.avail_out && O.mode < Mt && (O.mode < Hr || W !== ci)) && Hi(y, y.output, y.next_out, Xe - y.avail_out), ut -= y.avail_in, Xe -= y.avail_out, y.total_in += ut, y.total_out += Xe, O.total += Xe, O.wrap & 4 && Xe && (y.adler = O.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/ - O.flags ? I(O.check, ie, Xe, y.next_out - Xe) : Oe(O.check, ie, Xe, y.next_out - Xe)), y.data_type = O.bits + (O.last ? 64 : 0) + (O.mode === Ut ? 128 : 0) + (O.mode === Cr || O.mode === Wr ? 256 : 0), (ut === 0 && Xe === 0 || W === ci) && xt === Zt && (xt = ss), xt; - }, ds = (y) => { - if (Yt(y)) + return x.next_out = De, x.avail_out = Qe, x.next_in = te, x.avail_in = xe, O.hold = _e, O.bits = Pe, (O.wsize || Xe !== x.avail_out && O.mode < Mt && (O.mode < Hr || W !== ci)) && Hi(x, x.output, x.next_out, Xe - x.avail_out), ut -= x.avail_in, Xe -= x.avail_out, x.total_in += ut, x.total_out += Xe, O.total += Xe, O.wrap & 4 && Xe && (x.adler = O.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/ + O.flags ? R(O.check, ie, Xe, x.next_out - Xe) : Oe(O.check, ie, Xe, x.next_out - Xe)), x.data_type = O.bits + (O.last ? 64 : 0) + (O.mode === Ut ? 128 : 0) + (O.mode === Cr || O.mode === Wr ? 256 : 0), (ut === 0 && Xe === 0 || W === ci) && xt === Zt && (xt = ss), xt; + }, ds = (x) => { + if (Yt(x)) return $t; - let W = y.state; - return W.window && (W.window = null), y.state = null, Zt; - }, _s = (y, W) => { - if (Yt(y)) + let W = x.state; + return W.window && (W.window = null), x.state = null, Zt; + }, _s = (x, W) => { + if (Yt(x)) return $t; - const O = y.state; + const O = x.state; return O.wrap & 2 ? (O.head = W, W.done = !1, Zt) : $t; - }, ps = (y, W) => { + }, ps = (x, W) => { const O = W.length; let J, ie, te; - return Yt(y) || (J = y.state, J.wrap !== 0 && J.mode !== Mr) ? $t : J.mode === Mr && (ie = 1, ie = Oe(ie, W, O, 0), ie !== J.check) ? ui : (te = Hi(y, W, O, O), te ? (J.mode = Bi, di) : (J.havedict = 1, Zt)); + return Yt(x) || (J = x.state, J.wrap !== 0 && J.mode !== Mr) ? $t : J.mode === Mr && (ie = 1, ie = Oe(ie, W, O, 0), ie !== J.check) ? ui : (te = Hi(x, W, O, O), te ? (J.mode = Bi, di) : (J.havedict = 1, Zt)); }; var gs = Ui, ms = Ni, vs = ki, bs = fs, ys = Gi, xs = us, Es = ds, ws = _s, As = ps, Ms = "pako inflate (from Nodeca project)", Nt = { inflateReset: gs, @@ -24871,14 +24871,14 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; Z_DATA_ERROR: ji, Z_MEM_ERROR: Ds } = Ee; - function br(y) { + function br(x) { this.options = yr.assign({ chunkSize: 65536, windowBits: 15, to: "" - }, y || {}); + }, x || {}); const W = this.options; - W.raw && W.windowBits >= 0 && W.windowBits < 16 && (W.windowBits = -W.windowBits, W.windowBits === 0 && (W.windowBits = -15)), W.windowBits >= 0 && W.windowBits < 16 && !(y && y.windowBits) && (W.windowBits += 32), W.windowBits > 15 && W.windowBits < 48 && (W.windowBits & 15 || (W.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new ii(), this.strm.avail_out = 0; + W.raw && W.windowBits >= 0 && W.windowBits < 16 && (W.windowBits = -W.windowBits, W.windowBits === 0 && (W.windowBits = -15)), W.windowBits >= 0 && W.windowBits < 16 && !(x && x.windowBits) && (W.windowBits += 32), W.windowBits > 15 && W.windowBits < 48 && (W.windowBits & 15 || (W.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new ii(), this.strm.avail_out = 0; let O = Nt.inflateInit2( this.strm, W.windowBits @@ -24888,13 +24888,13 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; if (this.header = new Ls(), Nt.inflateGetHeader(this.strm, this.header), W.dictionary && (typeof W.dictionary == "string" ? W.dictionary = pr.string2buf(W.dictionary) : Vi.call(W.dictionary) === "[object ArrayBuffer]" && (W.dictionary = new Uint8Array(W.dictionary)), W.raw && (O = Nt.inflateSetDictionary(this.strm, W.dictionary), O !== vr))) throw new Error(be[O]); } - br.prototype.push = function(y, W) { + br.prototype.push = function(x, W) { const O = this.strm, J = this.options.chunkSize, ie = this.options.dictionary; let te, De, xe; if (this.ended) return !1; - for (W === ~~W ? De = W : De = W === !0 ? Ts : Ss, Vi.call(y) === "[object ArrayBuffer]" ? O.input = new Uint8Array(y) : O.input = y, O.next_in = 0, O.avail_in = O.input.length; ; ) { - for (O.avail_out === 0 && (O.output = new Uint8Array(J), O.next_out = 0, O.avail_out = J), te = Nt.inflate(O, De), te === Zr && ie && (te = Nt.inflateSetDictionary(O, ie), te === vr ? te = Nt.inflate(O, De) : te === ji && (te = Zr)); O.avail_in > 0 && te === Kr && O.state.wrap > 0 && y[O.next_in] !== 0; ) + for (W === ~~W ? De = W : De = W === !0 ? Ts : Ss, Vi.call(x) === "[object ArrayBuffer]" ? O.input = new Uint8Array(x) : O.input = x, O.next_in = 0, O.avail_in = O.input.length; ; ) { + for (O.avail_out === 0 && (O.output = new Uint8Array(J), O.next_out = 0, O.avail_out = J), te = Nt.inflate(O, De), te === Zr && ie && (te = Nt.inflateSetDictionary(O, ie), te === vr ? te = Nt.inflate(O, De) : te === ji && (te = Zr)); O.avail_in > 0 && te === Kr && O.state.wrap > 0 && x[O.next_in] !== 0; ) Nt.inflateReset(O), te = Nt.inflate(O, De); switch (te) { case Os: @@ -24917,19 +24917,19 @@ var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `; } } return !0; - }, br.prototype.onData = function(y) { - this.chunks.push(y); - }, br.prototype.onEnd = function(y) { - y === vr && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = yr.flattenChunks(this.chunks)), this.chunks = [], this.err = y, this.msg = this.strm.msg; + }, br.prototype.onData = function(x) { + this.chunks.push(x); + }, br.prototype.onEnd = function(x) { + x === vr && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = yr.flattenChunks(this.chunks)), this.chunks = [], this.err = x, this.msg = this.strm.msg; }; - function Yr(y, W) { + function Yr(x, W) { const O = new br(W); - if (O.push(y), O.err) + if (O.push(x), O.err) throw O.msg || be[O.err]; return O.result; } - function Ps(y, W) { - return W = W || {}, W.raw = !0, Yr(y, W); + function Ps(x, W) { + return W = W || {}, W.raw = !0, Yr(x, W); } var Is = br, Rs = Yr, $s = Ps, Bs = Yr, zs = Ee, Fs = { Inflate: Is, @@ -25020,102 +25020,102 @@ const _3Dmol = /* @__PURE__ */ getDefaultExportFromCjs(_3DmolExports), Molecular transition_in: transition_in$7 } = window.__gradio__svelte__internal, { onMount: onMount$1 } = window.__gradio__svelte__internal; function get_each_context$2(r, e, t) { - const s = r.slice(); - return s[53] = e[t], s[54] = e, s[55] = t, s; + const n = r.slice(); + return n[53] = e[t], n[54] = e, n[55] = t, n; } function get_each_context_1$1(r, e, t) { - const s = r.slice(); - return s[56] = e[t], s[58] = t, s; + const n = r.slice(); + return n[56] = e[t], n[58] = t, n; } function get_each_context_2(r, e, t) { - const s = r.slice(); - return s[59] = e[t], s[60] = e, s[61] = t, s; + const n = r.slice(); + return n[59] = e[t], n[60] = e, n[61] = t, n; } function get_each_context_3(r, e, t) { - const s = r.slice(); - return s[62] = e[t], s; + const n = r.slice(); + return n[62] = e[t], n; } function create_if_block_8$1(r) { - let e, t, s, f, _, x, h, u, E, c, C, b, A, S, n, o, w, p, v, a, l, g, M, L, T, D, R, B, P; + let e, t, n, f, u, y, h, _, E, c, C, b, A, S, s, o, w, p, v, a, l, g, M, L, T, D, I, z, P; return { c() { - e = element$7("div"), t = element$7("div"), s = element$7("div"), f = element$7("span"), f.textContent = " ", _ = element$7("span"), x = text$3("Very high ("), h = text$3( + e = element$7("div"), t = element$7("div"), n = element$7("div"), f = element$7("span"), f.textContent = " ", u = element$7("span"), y = text$3("Very high ("), h = text$3( /*confidenceLabel*/ r[2] - ), u = text$3(" > 90)"), E = space$7(), c = element$7("div"), C = element$7("span"), C.textContent = " ", b = element$7("span"), A = text$3("Confident (90 > "), S = text$3( + ), _ = text$3(" > 90)"), E = space$7(), c = element$7("div"), C = element$7("span"), C.textContent = " ", b = element$7("span"), A = text$3("Confident (90 > "), S = text$3( /*confidenceLabel*/ r[2] - ), n = text$3(" > 70)"), o = space$7(), w = element$7("div"), p = element$7("span"), p.textContent = " ", v = element$7("span"), a = text$3("Low (70 > "), l = text$3( + ), s = text$3(" > 70)"), o = space$7(), w = element$7("div"), p = element$7("span"), p.textContent = " ", v = element$7("span"), a = text$3("Low (70 > "), l = text$3( /*confidenceLabel*/ r[2] - ), g = text$3(" > 50)"), M = space$7(), L = element$7("div"), T = element$7("span"), T.textContent = " ", D = element$7("span"), R = text$3("Very low ("), B = text$3( + ), g = text$3(" > 50)"), M = space$7(), L = element$7("div"), T = element$7("span"), T.textContent = " ", D = element$7("span"), I = text$3("Very low ("), z = text$3( /*confidenceLabel*/ r[2] - ), P = text$3(" < 50)"), attr$8(f, "class", "w-4 h-4 svelte-1ib1ln5"), set_style$3(f, "background-color", "rgb(0, 83, 214)"), attr$8(_, "class", "legendlabel svelte-1ib1ln5"), attr$8(s, "class", "flex space-x-1 py-1 items-center svelte-1ib1ln5"), attr$8(C, "class", "w-4 h-4 svelte-1ib1ln5"), set_style$3(C, "background-color", "rgb(101, 203, 243)"), attr$8(b, "class", "legendlabel svelte-1ib1ln5"), attr$8(c, "class", "flex space-x-1 py-1 items-center svelte-1ib1ln5"), attr$8(p, "class", "w-4 h-4 svelte-1ib1ln5"), set_style$3(p, "background-color", "rgb(255, 219, 19)"), attr$8(v, "class", "legendlabel svelte-1ib1ln5"), attr$8(w, "class", "flex space-x-1 py-1 items-center svelte-1ib1ln5"), attr$8(T, "class", "w-4 h-4 svelte-1ib1ln5"), set_style$3(T, "background-color", "rgb(255, 125, 69)"), attr$8(D, "class", "legendlabel svelte-1ib1ln5"), attr$8(L, "class", "flex space-x-1 py-1 items-center svelte-1ib1ln5"), attr$8(t, "class", "flex text-sm items-center space-x-2 justify-center svelte-1ib1ln5"), attr$8(e, "class", "absolute bottom-0 left-0 z-50 p-2 -mb-2 w-full bg-white svelte-1ib1ln5"); + ), P = text$3(" < 50)"), attr$8(f, "class", "w-4 h-4 svelte-1ib1ln5"), set_style$3(f, "background-color", "rgb(0, 83, 214)"), attr$8(u, "class", "legendlabel svelte-1ib1ln5"), attr$8(n, "class", "flex space-x-1 py-1 items-center svelte-1ib1ln5"), attr$8(C, "class", "w-4 h-4 svelte-1ib1ln5"), set_style$3(C, "background-color", "rgb(101, 203, 243)"), attr$8(b, "class", "legendlabel svelte-1ib1ln5"), attr$8(c, "class", "flex space-x-1 py-1 items-center svelte-1ib1ln5"), attr$8(p, "class", "w-4 h-4 svelte-1ib1ln5"), set_style$3(p, "background-color", "rgb(255, 219, 19)"), attr$8(v, "class", "legendlabel svelte-1ib1ln5"), attr$8(w, "class", "flex space-x-1 py-1 items-center svelte-1ib1ln5"), attr$8(T, "class", "w-4 h-4 svelte-1ib1ln5"), set_style$3(T, "background-color", "rgb(255, 125, 69)"), attr$8(D, "class", "legendlabel svelte-1ib1ln5"), attr$8(L, "class", "flex space-x-1 py-1 items-center svelte-1ib1ln5"), attr$8(t, "class", "flex text-sm items-center space-x-2 justify-center svelte-1ib1ln5"), attr$8(e, "class", "absolute bottom-0 left-0 z-50 p-2 -mb-2 w-full bg-white svelte-1ib1ln5"); }, - m(z, F) { - insert$a(z, e, F), append$8(e, t), append$8(t, s), append$8(s, f), append$8(s, _), append$8(_, x), append$8(_, h), append$8(_, u), append$8(t, E), append$8(t, c), append$8(c, C), append$8(c, b), append$8(b, A), append$8(b, S), append$8(b, n), append$8(t, o), append$8(t, w), append$8(w, p), append$8(w, v), append$8(v, a), append$8(v, l), append$8(v, g), append$8(t, M), append$8(t, L), append$8(L, T), append$8(L, D), append$8(D, R), append$8(D, B), append$8(D, P); + m(B, F) { + insert$a(B, e, F), append$8(e, t), append$8(t, n), append$8(n, f), append$8(n, u), append$8(u, y), append$8(u, h), append$8(u, _), append$8(t, E), append$8(t, c), append$8(c, C), append$8(c, b), append$8(b, A), append$8(b, S), append$8(b, s), append$8(t, o), append$8(t, w), append$8(w, p), append$8(w, v), append$8(v, a), append$8(v, l), append$8(v, g), append$8(t, M), append$8(t, L), append$8(L, T), append$8(L, D), append$8(D, I), append$8(D, z), append$8(D, P); }, - p(z, F) { + p(B, F) { F[0] & /*confidenceLabel*/ 4 && set_data$3( h, /*confidenceLabel*/ - z[2] + B[2] ), F[0] & /*confidenceLabel*/ 4 && set_data$3( S, /*confidenceLabel*/ - z[2] + B[2] ), F[0] & /*confidenceLabel*/ 4 && set_data$3( l, /*confidenceLabel*/ - z[2] + B[2] ), F[0] & /*confidenceLabel*/ 4 && set_data$3( - B, + z, /*confidenceLabel*/ - z[2] + B[2] ); }, - d(z) { - z && detach$a(e); + d(B) { + B && detach$a(e); } }; } function create_if_block_6$1(r) { let e; - function t(_, x) { + function t(u, y) { return ( /*isAnimated*/ - _[10] ? create_else_block$5 : create_if_block_7$1 + u[10] ? create_else_block$5 : create_if_block_7$1 ); } - let s = t(r), f = s(r); + let n = t(r), f = n(r); return { c() { e = element$7("div"), f.c(), attr$8(e, "class", "absolute z-50 bottom-0 right-0 mr-2 flex divide-x border border-gray-200 mb-2 rounded items-center justify-center svelte-1ib1ln5"); }, - m(_, x) { - insert$a(_, e, x), f.m(e, null); + m(u, y) { + insert$a(u, e, y), f.m(e, null); }, - p(_, x) { - s === (s = t(_)) && f ? f.p(_, x) : (f.d(1), f = s(_), f && (f.c(), f.m(e, null))); + p(u, y) { + n === (n = t(u)) && f ? f.p(u, y) : (f.d(1), f = n(u), f && (f.c(), f.m(e, null))); }, - d(_) { - _ && detach$a(e), f.d(); + d(u) { + u && detach$a(e), f.d(); } }; } function create_else_block$5(r) { - let e, t, s; + let e, t, n; return { c() { e = element$7("button"), e.innerHTML = '', attr$8(e, "class", "p-2 svelte-1ib1ln5"), attr$8(e, "title", "Pause"); }, - m(f, _) { - insert$a(f, e, _), t || (s = listen$2( + m(f, u) { + insert$a(f, e, u), t || (n = listen$2( e, "click", /*toggleAnimation*/ @@ -25124,18 +25124,18 @@ function create_else_block$5(r) { }, p: noop$6, d(f) { - f && detach$a(e), t = !1, s(); + f && detach$a(e), t = !1, n(); } }; } function create_if_block_7$1(r) { - let e, t, s; + let e, t, n; return { c() { e = element$7("button"), e.innerHTML = '', attr$8(e, "class", "p-2 svelte-1ib1ln5"), attr$8(e, "title", "Play"); }, - m(f, _) { - insert$a(f, e, _), t || (s = listen$2( + m(f, u) { + insert$a(f, e, u), t || (n = listen$2( e, "click", /*toggleAnimation*/ @@ -25144,12 +25144,12 @@ function create_if_block_7$1(r) { }, p: noop$6, d(f) { - f && detach$a(e), t = !1, s(); + f && detach$a(e), t = !1, n(); } }; } function create_if_block_2$1(r) { - let e, t, s, f, _, x, h, u, E, c, C, b, A, S, n, o, w, p = ensure_array_like$2(Object.keys( + let e, t, n, f, u, y, h, _, E, c, C, b, A, S, s, o, w, p = ensure_array_like$2(Object.keys( /*config*/ r[0] )), v = []; @@ -25157,22 +25157,22 @@ function create_if_block_2$1(r) { v[a] = create_each_block_2(get_each_context_2(r, p, a)); return { c() { - e = element$7("div"), t = element$7("div"), s = element$7("h5"), s.textContent = "Settings", f = space$7(), _ = element$7("button"), _.innerHTML = ' Close menu', x = space$7(); + e = element$7("div"), t = element$7("div"), n = element$7("h5"), n.textContent = "Settings", f = space$7(), u = element$7("button"), u.innerHTML = ' Close menu', y = space$7(); for (let a = 0; a < v.length; a += 1) v[a].c(); - h = space$7(), u = element$7("div"), E = element$7("div"), c = element$7("label"), c.textContent = "Label atoms on hover", C = space$7(), b = element$7("label"), A = element$7("input"), S = space$7(), n = element$7("div"), attr$8(s, "id", "settings-drawer-label"), attr$8(s, "class", "inline-flex items-center mb-4 text-base font-semibold text-gray-500 dark:text-gray-400 svelte-1ib1ln5"), attr$8(_, "type", "button"), attr$8(_, "data-drawer-hide", "drawer-example"), attr$8(_, "aria-controls", "drawer-example"), attr$8(_, "class", "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white svelte-1ib1ln5"), attr$8(t, "class", "p-4 svelte-1ib1ln5"), attr$8(c, "class", "text-sm font-medium text-gray-600 dark:text-gray-400 w-1/2 svelte-1ib1ln5"), attr$8(A, "type", "checkbox"), attr$8(A, "class", "sr-only peer svelte-1ib1ln5"), attr$8(n, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1ib1ln5"), attr$8(b, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center justify-center svelte-1ib1ln5"), attr$8(E, "class", "flex items-center border-t border-b border-gray-200 bg-white px-4 py-2 space-x-2 svelte-1ib1ln5"), attr$8(u, "class", "bg-white svelte-1ib1ln5"), attr$8(e, "id", "settings-drawer"), attr$8(e, "class", "absolute top-0 right-0 z-50 h-full overflow-y-auto transition-transform bg-gray-100 w-80 dark:bg-gray-800 svelte-1ib1ln5"), attr$8(e, "tabindex", "-1"), attr$8(e, "aria-labelledby", "settings-drawer-label"); + h = space$7(), _ = element$7("div"), E = element$7("div"), c = element$7("label"), c.textContent = "Label atoms on hover", C = space$7(), b = element$7("label"), A = element$7("input"), S = space$7(), s = element$7("div"), attr$8(n, "id", "settings-drawer-label"), attr$8(n, "class", "inline-flex items-center mb-4 text-base font-semibold text-gray-500 dark:text-gray-400 svelte-1ib1ln5"), attr$8(u, "type", "button"), attr$8(u, "data-drawer-hide", "drawer-example"), attr$8(u, "aria-controls", "drawer-example"), attr$8(u, "class", "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white svelte-1ib1ln5"), attr$8(t, "class", "p-4 svelte-1ib1ln5"), attr$8(c, "class", "text-sm font-medium text-gray-600 dark:text-gray-400 w-1/2 svelte-1ib1ln5"), attr$8(A, "type", "checkbox"), attr$8(A, "class", "sr-only peer svelte-1ib1ln5"), attr$8(s, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1ib1ln5"), attr$8(b, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center justify-center svelte-1ib1ln5"), attr$8(E, "class", "flex items-center border-t border-b border-gray-200 bg-white px-4 py-2 space-x-2 svelte-1ib1ln5"), attr$8(_, "class", "bg-white svelte-1ib1ln5"), attr$8(e, "id", "settings-drawer"), attr$8(e, "class", "absolute top-0 right-0 z-50 h-full overflow-y-auto transition-transform bg-gray-100 w-80 dark:bg-gray-800 svelte-1ib1ln5"), attr$8(e, "tabindex", "-1"), attr$8(e, "aria-labelledby", "settings-drawer-label"); }, m(a, l) { - insert$a(a, e, l), append$8(e, t), append$8(t, s), append$8(t, f), append$8(t, _), append$8(e, x); + insert$a(a, e, l), append$8(e, t), append$8(t, n), append$8(t, f), append$8(t, u), append$8(e, y); for (let g = 0; g < v.length; g += 1) v[g] && v[g].m(e, null); - append$8(e, h), append$8(e, u), append$8(u, E), append$8(E, c), append$8(E, C), append$8(E, b), append$8(b, A), set_input_value$1( + append$8(e, h), append$8(e, _), append$8(_, E), append$8(E, c), append$8(E, C), append$8(E, b), append$8(b, A), set_input_value$1( A, /*labelHover*/ r[5] - ), append$8(b, S), append$8(b, n), o || (w = [ + ), append$8(b, S), append$8(b, s), o || (w = [ listen$2( - _, + u, "click", /*toggleOffCanvas*/ r[14] @@ -25214,7 +25214,7 @@ function create_if_block_2$1(r) { }; } function create_if_block_5$1(r) { - let e, t, s, f, _, x; + let e, t, n, f, u, y; function h() { r[22].call( t, @@ -25224,30 +25224,30 @@ function create_if_block_5$1(r) { } return { c() { - e = element$7("label"), t = element$7("input"), s = space$7(), f = element$7("div"), attr$8(t, "type", "checkbox"), t.__value = "", set_input_value$1(t, t.__value), attr$8(t, "class", "sr-only peer svelte-1ib1ln5"), attr$8(f, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1ib1ln5"), attr$8(e, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center justify-center svelte-1ib1ln5"); + e = element$7("label"), t = element$7("input"), n = space$7(), f = element$7("div"), attr$8(t, "type", "checkbox"), t.__value = "", set_input_value$1(t, t.__value), attr$8(t, "class", "sr-only peer svelte-1ib1ln5"), attr$8(f, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1ib1ln5"), attr$8(e, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center justify-center svelte-1ib1ln5"); }, - m(u, E) { - insert$a(u, e, E), append$8(e, t), t.checked = /*config*/ + m(_, E) { + insert$a(_, e, E), append$8(e, t), t.checked = /*config*/ r[0][ /*setting*/ r[59] - ], append$8(e, s), append$8(e, f), _ || (x = listen$2(t, "change", h), _ = !0); + ], append$8(e, n), append$8(e, f), u || (y = listen$2(t, "change", h), u = !0); }, - p(u, E) { - r = u, E[0] & /*config, settings*/ + p(_, E) { + r = _, E[0] & /*config, settings*/ 4097 && (t.checked = /*config*/ r[0][ /*setting*/ r[59] ]); }, - d(u) { - u && detach$a(e), _ = !1, x(); + d(_) { + _ && detach$a(e), u = !1, y(); } }; } function create_if_block_4$1(r) { - let e, t, s, f, _, x, h, u, E = ( + let e, t, n, f, u, y, h, _, E = ( /*config*/ r[0][ /*setting*/ @@ -25265,7 +25265,7 @@ function create_if_block_4$1(r) { } return { c() { - e = element$7("div"), t = element$7("input"), h = space$7(), u = element$7("span"), c = text$3(E), attr$8(t, "id", "medium-range"), attr$8(t, "type", "range"), t.value = s = /*config*/ + e = element$7("div"), t = element$7("input"), h = space$7(), _ = element$7("span"), c = text$3(E), attr$8(t, "id", "medium-range"), attr$8(t, "type", "range"), t.value = n = /*config*/ r[0][ /*setting*/ r[59] @@ -25273,41 +25273,41 @@ function create_if_block_4$1(r) { r[12][ /*setting*/ r[59] - ].min), attr$8(t, "max", _ = /*settings*/ + ].min), attr$8(t, "max", u = /*settings*/ r[12][ /*setting*/ r[59] - ].max), attr$8(t, "step", x = /*settings*/ + ].max), attr$8(t, "step", y = /*settings*/ r[12][ /*setting*/ r[59] - ].step), attr$8(t, "class", "w-2/3 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 svelte-1ib1ln5"), attr$8(u, "class", "w-1/3 text-center text-sm font-medium text-gray-600 dark:text-gray-400 svelte-1ib1ln5"), attr$8(e, "class", "flex items-center svelte-1ib1ln5"); + ].step), attr$8(t, "class", "w-2/3 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 svelte-1ib1ln5"), attr$8(_, "class", "w-1/3 text-center text-sm font-medium text-gray-600 dark:text-gray-400 svelte-1ib1ln5"), attr$8(e, "class", "flex items-center svelte-1ib1ln5"); }, - m(S, n) { - insert$a(S, e, n), append$8(e, t), append$8(e, h), append$8(e, u), append$8(u, c), C || (b = listen$2(t, "change", A), C = !0); + m(S, s) { + insert$a(S, e, s), append$8(e, t), append$8(e, h), append$8(e, _), append$8(_, c), C || (b = listen$2(t, "change", A), C = !0); }, - p(S, n) { - r = S, n[0] & /*config, settings*/ - 4097 && s !== (s = /*config*/ + p(S, s) { + r = S, s[0] & /*config, settings*/ + 4097 && n !== (n = /*config*/ r[0][ /*setting*/ r[59] - ]) && (t.value = s), n[0] & /*config, settings*/ + ]) && (t.value = n), s[0] & /*config, settings*/ 4097 && f !== (f = /*settings*/ r[12][ /*setting*/ r[59] - ].min) && attr$8(t, "min", f), n[0] & /*config, settings*/ - 4097 && _ !== (_ = /*settings*/ + ].min) && attr$8(t, "min", f), s[0] & /*config, settings*/ + 4097 && u !== (u = /*settings*/ r[12][ /*setting*/ r[59] - ].max) && attr$8(t, "max", _), n[0] & /*config, settings*/ - 4097 && x !== (x = /*settings*/ + ].max) && attr$8(t, "max", u), s[0] & /*config, settings*/ + 4097 && y !== (y = /*settings*/ r[12][ /*setting*/ r[59] - ].step) && attr$8(t, "step", x), n[0] & /*config*/ + ].step) && attr$8(t, "step", y), s[0] & /*config*/ 1 && E !== (E = /*config*/ r[0][ /*setting*/ @@ -25320,7 +25320,7 @@ function create_if_block_4$1(r) { }; } function create_if_block_3$1(r) { - let e, t, s, f, _, x, h, u, E = ensure_array_like$2( + let e, t, n, f, u, y, h, _, E = ensure_array_like$2( /*settings*/ r[12][ /*setting*/ @@ -25331,42 +25331,42 @@ function create_if_block_3$1(r) { c[b] = create_each_block_3(get_each_context_3(r, E, b)); function C() { r[24].call( - _, + u, /*setting*/ r[59] ); } return { c() { - e = element$7("label"), t = text$3("Select style"), f = space$7(), _ = element$7("select"); + e = element$7("label"), t = text$3("Select style"), f = space$7(), u = element$7("select"); for (let b = 0; b < c.length; b += 1) c[b].c(); - attr$8(e, "for", s = /*setting*/ - r[59]), attr$8(e, "class", "sr-only svelte-1ib1ln5"), attr$8(_, "id", x = /*setting*/ - r[59]), attr$8(_, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1ib1ln5"), /*config*/ + attr$8(e, "for", n = /*setting*/ + r[59]), attr$8(e, "class", "sr-only svelte-1ib1ln5"), attr$8(u, "id", y = /*setting*/ + r[59]), attr$8(u, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1ib1ln5"), /*config*/ r[0][ /*setting*/ r[59] ] === void 0 && add_render_callback(C); }, m(b, A) { - insert$a(b, e, A), append$8(e, t), insert$a(b, f, A), insert$a(b, _, A); + insert$a(b, e, A), append$8(e, t), insert$a(b, f, A), insert$a(b, u, A); for (let S = 0; S < c.length; S += 1) - c[S] && c[S].m(_, null); + c[S] && c[S].m(u, null); select_option( - _, + u, /*config*/ r[0][ /*setting*/ r[59] ], !0 - ), h || (u = listen$2(_, "change", C), h = !0); + ), h || (_ = listen$2(u, "change", C), h = !0); }, p(b, A) { if (r = b, A[0] & /*config, settings*/ - 4097 && s !== (s = /*setting*/ - r[59]) && attr$8(e, "for", s), A[0] & /*settings, config*/ + 4097 && n !== (n = /*setting*/ + r[59]) && attr$8(e, "for", n), A[0] & /*settings, config*/ 4097) { E = ensure_array_like$2( /*settings*/ @@ -25377,18 +25377,18 @@ function create_if_block_3$1(r) { ); let S; for (S = 0; S < E.length; S += 1) { - const n = get_each_context_3(r, E, S); - c[S] ? c[S].p(n, A) : (c[S] = create_each_block_3(n), c[S].c(), c[S].m(_, null)); + const s = get_each_context_3(r, E, S); + c[S] ? c[S].p(s, A) : (c[S] = create_each_block_3(s), c[S].c(), c[S].m(u, null)); } for (; S < c.length; S += 1) c[S].d(1); c.length = E.length; } A[0] & /*config, settings*/ - 4097 && x !== (x = /*setting*/ - r[59]) && attr$8(_, "id", x), A[0] & /*config, settings*/ + 4097 && y !== (y = /*setting*/ + r[59]) && attr$8(u, "id", y), A[0] & /*config, settings*/ 4097 && select_option( - _, + u, /*config*/ r[0][ /*setting*/ @@ -25397,7 +25397,7 @@ function create_if_block_3$1(r) { ); }, d(b) { - b && (detach$a(e), detach$a(f), detach$a(_)), destroy_each$2(c, b), h = !1, u(); + b && (detach$a(e), detach$a(f), detach$a(u)), destroy_each$2(c, b), h = !1, _(); } }; } @@ -25405,43 +25405,43 @@ function create_each_block_3(r) { let e, t = ( /*option*/ r[62] + "" - ), s, f, _; + ), n, f, u; return { c() { - e = element$7("option"), s = text$3(t), e.__value = f = /*option*/ - r[62], set_input_value$1(e, e.__value), e.selected = _ = /*option*/ + e = element$7("option"), n = text$3(t), e.__value = f = /*option*/ + r[62], set_input_value$1(e, e.__value), e.selected = u = /*option*/ r[62] == /*config*/ r[0][ /*setting*/ r[59] ], attr$8(e, "class", "svelte-1ib1ln5"); }, - m(x, h) { - insert$a(x, e, h), append$8(e, s); + m(y, h) { + insert$a(y, e, h), append$8(e, n); }, - p(x, h) { + p(y, h) { h[0] & /*config*/ 1 && t !== (t = /*option*/ - x[62] + "") && set_data$3(s, t), h[0] & /*config, settings*/ + y[62] + "") && set_data$3(n, t), h[0] & /*config, settings*/ 4097 && f !== (f = /*option*/ - x[62]) && (e.__value = f, set_input_value$1(e, e.__value)), h[0] & /*config, settings*/ - 4097 && _ !== (_ = /*option*/ - x[62] == /*config*/ - x[0][ + y[62]) && (e.__value = f, set_input_value$1(e, e.__value)), h[0] & /*config, settings*/ + 4097 && u !== (u = /*option*/ + y[62] == /*config*/ + y[0][ /*setting*/ - x[59] - ]) && (e.selected = _); + y[59] + ]) && (e.selected = u); }, - d(x) { - x && detach$a(e); + d(y) { + y && detach$a(e); } }; } function create_each_block_2(r) { - let e, t, s, f = ( + let e, t, n, f = ( /*setting*/ r[59] + "" - ), _, x, h, u, E, c = ( + ), u, y, h, _, E, c = ( /*settings*/ r[12][ /*setting*/ @@ -25462,22 +25462,22 @@ function create_each_block_2(r) { ); return { c() { - e = element$7("div"), t = element$7("div"), s = element$7("label"), _ = text$3(f), h = space$7(), c && c.c(), u = space$7(), C && C.c(), E = space$7(), b && b.c(), attr$8(s, "for", x = /*setting*/ - r[59]), attr$8(s, "class", "text-sm font-medium text-gray-600 dark:text-gray-400 w-1/2 svelte-1ib1ln5"), attr$8(t, "class", "flex items-center border-t border-b border-gray-200 bg-white px-4 py-2 space-x-2 svelte-1ib1ln5"), attr$8(e, "class", "flex flex-col mb-4 divide-y svelte-1ib1ln5"); + e = element$7("div"), t = element$7("div"), n = element$7("label"), u = text$3(f), h = space$7(), c && c.c(), _ = space$7(), C && C.c(), E = space$7(), b && b.c(), attr$8(n, "for", y = /*setting*/ + r[59]), attr$8(n, "class", "text-sm font-medium text-gray-600 dark:text-gray-400 w-1/2 svelte-1ib1ln5"), attr$8(t, "class", "flex items-center border-t border-b border-gray-200 bg-white px-4 py-2 space-x-2 svelte-1ib1ln5"), attr$8(e, "class", "flex flex-col mb-4 divide-y svelte-1ib1ln5"); }, m(A, S) { - insert$a(A, e, S), append$8(e, t), append$8(t, s), append$8(s, _), append$8(t, h), c && c.m(t, null), append$8(t, u), C && C.m(t, null), append$8(t, E), b && b.m(t, null); + insert$a(A, e, S), append$8(e, t), append$8(t, n), append$8(n, u), append$8(t, h), c && c.m(t, null), append$8(t, _), C && C.m(t, null), append$8(t, E), b && b.m(t, null); }, p(A, S) { S[0] & /*config*/ 1 && f !== (f = /*setting*/ - A[59] + "") && set_data$3(_, f), S[0] & /*config, settings*/ - 4097 && x !== (x = /*setting*/ - A[59]) && attr$8(s, "for", x), /*settings*/ + A[59] + "") && set_data$3(u, f), S[0] & /*config, settings*/ + 4097 && y !== (y = /*setting*/ + A[59]) && attr$8(n, "for", y), /*settings*/ A[12][ /*setting*/ A[59] - ].type == "toggle" ? c ? c.p(A, S) : (c = create_if_block_5$1(A), c.c(), c.m(t, u)) : c && (c.d(1), c = null), /*settings*/ + ].type == "toggle" ? c ? c.p(A, S) : (c = create_if_block_5$1(A), c.c(), c.m(t, _)) : c && (c.d(1), c = null), /*settings*/ A[12][ /*setting*/ A[59] @@ -25493,7 +25493,7 @@ function create_each_block_2(r) { }; } function create_if_block$6(r) { - let e, t, s, f, _, x, h, u, E, c, C = ensure_array_like$2( + let e, t, n, f, u, y, h, _, E, c, C = ensure_array_like$2( /*representations*/ r[1] ), b = []; @@ -25501,24 +25501,24 @@ function create_if_block$6(r) { b[A] = create_each_block$2(get_each_context$2(r, C, A)); return { c() { - e = element$7("div"), t = element$7("div"), s = element$7("h5"), s.textContent = "Representations", f = space$7(), _ = element$7("button"), _.innerHTML = ' Close menu', x = space$7(); + e = element$7("div"), t = element$7("div"), n = element$7("h5"), n.textContent = "Representations", f = space$7(), u = element$7("button"), u.innerHTML = ' Close menu', y = space$7(); for (let A = 0; A < b.length; A += 1) b[A].c(); - h = space$7(), u = element$7("button"), u.innerHTML = '
Add representation
', attr$8(s, "id", "drawer-label"), attr$8(s, "class", "inline-flex items-center mb-4 text-base font-semibold text-gray-500 dark:text-gray-400 svelte-1ib1ln5"), attr$8(_, "type", "button"), attr$8(_, "data-drawer-hide", "drawer-example"), attr$8(_, "aria-controls", "drawer-example"), attr$8(_, "class", "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white svelte-1ib1ln5"), attr$8(t, "class", "p-4 svelte-1ib1ln5"), attr$8(u, "class", "w-full flex text-orange-600 justify-center my-2 text-sm space-x-2 items-center hover:text-gray-600 cursor-pointer svelte-1ib1ln5"), attr$8(e, "id", "drawer-example"), attr$8(e, "class", "absolute top-0 right-0 z-50 h-full overflow-y-auto transition-transform bg-gray-100 w-80 dark:bg-gray-800 border-l border-gray-200 svelte-1ib1ln5"), attr$8(e, "tabindex", "-1"), attr$8(e, "aria-labelledby", "drawer-label"); + h = space$7(), _ = element$7("button"), _.innerHTML = '
Add representation
', attr$8(n, "id", "drawer-label"), attr$8(n, "class", "inline-flex items-center mb-4 text-base font-semibold text-gray-500 dark:text-gray-400 svelte-1ib1ln5"), attr$8(u, "type", "button"), attr$8(u, "data-drawer-hide", "drawer-example"), attr$8(u, "aria-controls", "drawer-example"), attr$8(u, "class", "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white svelte-1ib1ln5"), attr$8(t, "class", "p-4 svelte-1ib1ln5"), attr$8(_, "class", "w-full flex text-orange-600 justify-center my-2 text-sm space-x-2 items-center hover:text-gray-600 cursor-pointer svelte-1ib1ln5"), attr$8(e, "id", "drawer-example"), attr$8(e, "class", "absolute top-0 right-0 z-50 h-full overflow-y-auto transition-transform bg-gray-100 w-80 dark:bg-gray-800 border-l border-gray-200 svelte-1ib1ln5"), attr$8(e, "tabindex", "-1"), attr$8(e, "aria-labelledby", "drawer-label"); }, m(A, S) { - insert$a(A, e, S), append$8(e, t), append$8(t, s), append$8(t, f), append$8(t, _), append$8(e, x); - for (let n = 0; n < b.length; n += 1) - b[n] && b[n].m(e, null); - append$8(e, h), append$8(e, u), E || (c = [ + insert$a(A, e, S), append$8(e, t), append$8(t, n), append$8(t, f), append$8(t, u), append$8(e, y); + for (let s = 0; s < b.length; s += 1) + b[s] && b[s].m(e, null); + append$8(e, h), append$8(e, _), E || (c = [ listen$2( - _, + u, "click", /*toggleOffCanvasReps*/ r[15] ), listen$2( - u, + _, "click", /*insertRep*/ r[17] @@ -25532,13 +25532,13 @@ function create_if_block$6(r) { /*representations*/ A[1] ); - let n; - for (n = 0; n < C.length; n += 1) { - const o = get_each_context$2(A, C, n); - b[n] ? b[n].p(o, S) : (b[n] = create_each_block$2(o), b[n].c(), b[n].m(e, h)); + let s; + for (s = 0; s < C.length; s += 1) { + const o = get_each_context$2(A, C, s); + b[s] ? b[s].p(o, S) : (b[s] = create_each_block$2(o), b[s].c(), b[s].m(e, h)); } - for (; n < b.length; n += 1) - b[n].d(1); + for (; s < b.length; s += 1) + b[s].d(1); b.length = C.length; } }, @@ -25548,7 +25548,7 @@ function create_if_block$6(r) { }; } function create_if_block_1$5(r) { - let e, t, s, f, _, x, h, u, E, c, C, b, A, S, n, o, w, p, v, a, l, g, M, L, T, D, R, B, P, z, F, N, $, k, G, H, U, V, Q, oe, ee, ne, me, se, fe, Ce, Me, Te, ae, pe, we, ke, Ue, Ne, Be, ue, ye, ge, Se, ze, He, We, Y, K, q, de, ve, Ie, Re, Z, ce, Ae, Fe, he, Oe, j, $e, Ve, I, be, Ee, X, le, Le, Ze, Ke, je, Je, Lt, rt, it, tt, Et, lt = ensure_array_like$2( + let e, t, n, f, u, y, h, _, E, c, C, b, A, S, s, o, w, p, v, a, l, g, M, L, T, D, I, z, P, B, F, N, $, k, G, H, U, V, Q, ae, oe, q, me, ne, fe, Ce, Me, Te, se, pe, we, ke, Ue, Ne, Be, ue, ye, ge, Se, ze, He, We, Y, K, ee, de, ve, Ie, Re, Z, ce, Ae, Fe, he, Oe, j, $e, Ve, R, be, Ee, X, le, Le, Ze, Ke, je, Je, Lt, rt, it, tt, Et, lt = ensure_array_like$2( /*moldata*/ r[3] ), wt = []; @@ -25556,7 +25556,7 @@ function create_if_block_1$5(r) { wt[pt] = create_each_block_1$1(get_each_context_1$1(r, lt, pt)); function Pt() { r[29].call( - s, + n, /*each_value*/ r[54], /*index*/ @@ -25565,7 +25565,7 @@ function create_if_block_1$5(r) { } function vt() { r[30].call( - _, + u, /*each_value*/ r[54], /*index*/ @@ -25574,7 +25574,7 @@ function create_if_block_1$5(r) { } function bt() { r[31].call( - u, + _, /*each_value*/ r[54], /*index*/ @@ -25592,7 +25592,7 @@ function create_if_block_1$5(r) { } function Tt() { r[33].call( - n, + s, /*each_value*/ r[54], /*index*/ @@ -25615,7 +25615,7 @@ function create_if_block_1$5(r) { } function Ft() { r[35].call( - B, + z, /*each_value*/ r[54], /*index*/ @@ -25798,14 +25798,14 @@ function create_if_block_1$5(r) { } return { c() { - e = element$7("div"), t = element$7("div"), s = element$7("select"); + e = element$7("div"), t = element$7("div"), n = element$7("select"); for (let pt = 0; pt < wt.length; pt += 1) wt[pt].c(); - f = space$7(), _ = element$7("input"), x = space$7(), h = element$7("div"), u = element$7("input"), E = space$7(), c = element$7("input"), C = space$7(), b = element$7("div"), A = element$7("label"), A.textContent = "Select style", S = space$7(), n = element$7("select"), o = element$7("option"), o.textContent = "Stick", w = element$7("option"), w.textContent = "Cartoon", p = element$7("option"), p.textContent = "Surface", v = text$3(`$ - `), a = element$7("option"), a.textContent = "Sphere", l = space$7(), g = element$7("div"), M = element$7("div"), M.textContent = "Expand selection", L = space$7(), T = element$7("input"), R = space$7(), B = element$7("input"), P = space$7(), z = element$7("div"), z.textContent = "Å", F = space$7(), N = element$7("div"), $ = element$7("div"), k = element$7("span"), k.textContent = "Full residue", G = space$7(), H = element$7("label"), U = element$7("input"), V = space$7(), Q = element$7("div"), oe = space$7(), ee = element$7("div"), ne = element$7("span"), ne.textContent = "Only sidechain", me = space$7(), se = element$7("label"), fe = element$7("input"), Ce = space$7(), Me = element$7("div"), Te = space$7(), ae = element$7("div"), pe = element$7("button"), ke = space$7(), Ue = element$7("button"), Be = space$7(), ue = element$7("button"), ge = space$7(), Se = element$7("button"), He = space$7(), We = element$7("button"), K = space$7(), q = element$7("button"), ve = space$7(), Ie = element$7("button"), Z = space$7(), ce = element$7("div"), Ae = element$7("button"), Fe = text$3("AlphaFold"), Oe = space$7(), j = element$7("button"), $e = text$3("PyMol"), I = space$7(), be = element$7("button"), Ee = text$3("Jmol"), le = space$7(), Le = element$7("button"), Ze = text$3("Chain"), je = space$7(), Je = element$7("button"), Lt = text$3("Spectrum"), attr$8(s, "id", "style"), attr$8(s, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1ib1ln5"), /*rep*/ - r[53].model === void 0 && add_render_callback(Pt), attr$8(_, "type", "text"), attr$8(_, "id", "chain"), attr$8(_, "class", "w-1/2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1ib1ln5"), attr$8(_, "placeholder", "Chain"), attr$8(t, "class", "p-1 flex space-x-1 svelte-1ib1ln5"), attr$8(u, "type", "text"), attr$8(u, "id", "chain"), attr$8(u, "class", "w-1/2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1ib1ln5"), attr$8(u, "placeholder", "Resname"), attr$8(c, "type", "text"), attr$8(c, "id", "residue_range"), attr$8(c, "class", "w-full bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1ib1ln5"), attr$8(c, "placeholder", "Residue range"), attr$8(h, "class", "p-1 flex space-x-1 svelte-1ib1ln5"), attr$8(A, "for", "countries"), attr$8(A, "class", "block mb-2 text-sm w-1/3 font-medium text-gray-600 dark:text-white svelte-1ib1ln5"), o.__value = "stick", set_input_value$1(o, o.__value), attr$8(o, "class", "svelte-1ib1ln5"), w.__value = "cartoon", set_input_value$1(w, w.__value), attr$8(w, "class", "svelte-1ib1ln5"), p.__value = "surface", set_input_value$1(p, p.__value), attr$8(p, "class", "svelte-1ib1ln5"), a.__value = "sphere", set_input_value$1(a, a.__value), attr$8(a, "class", "svelte-1ib1ln5"), attr$8(n, "id", "style"), attr$8(n, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1ib1ln5"), /*rep*/ + f = space$7(), u = element$7("input"), y = space$7(), h = element$7("div"), _ = element$7("input"), E = space$7(), c = element$7("input"), C = space$7(), b = element$7("div"), A = element$7("label"), A.textContent = "Select style", S = space$7(), s = element$7("select"), o = element$7("option"), o.textContent = "Stick", w = element$7("option"), w.textContent = "Cartoon", p = element$7("option"), p.textContent = "Surface", v = text$3(`$ + `), a = element$7("option"), a.textContent = "Sphere", l = space$7(), g = element$7("div"), M = element$7("div"), M.textContent = "Expand selection", L = space$7(), T = element$7("input"), I = space$7(), z = element$7("input"), P = space$7(), B = element$7("div"), B.textContent = "Å", F = space$7(), N = element$7("div"), $ = element$7("div"), k = element$7("span"), k.textContent = "Full residue", G = space$7(), H = element$7("label"), U = element$7("input"), V = space$7(), Q = element$7("div"), ae = space$7(), oe = element$7("div"), q = element$7("span"), q.textContent = "Only sidechain", me = space$7(), ne = element$7("label"), fe = element$7("input"), Ce = space$7(), Me = element$7("div"), Te = space$7(), se = element$7("div"), pe = element$7("button"), ke = space$7(), Ue = element$7("button"), Be = space$7(), ue = element$7("button"), ge = space$7(), Se = element$7("button"), He = space$7(), We = element$7("button"), K = space$7(), ee = element$7("button"), ve = space$7(), Ie = element$7("button"), Z = space$7(), ce = element$7("div"), Ae = element$7("button"), Fe = text$3("AlphaFold"), Oe = space$7(), j = element$7("button"), $e = text$3("PyMol"), R = space$7(), be = element$7("button"), Ee = text$3("Jmol"), le = space$7(), Le = element$7("button"), Ze = text$3("Chain"), je = space$7(), Je = element$7("button"), Lt = text$3("Spectrum"), attr$8(n, "id", "style"), attr$8(n, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1ib1ln5"), /*rep*/ + r[53].model === void 0 && add_render_callback(Pt), attr$8(u, "type", "text"), attr$8(u, "id", "chain"), attr$8(u, "class", "w-1/2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1ib1ln5"), attr$8(u, "placeholder", "Chain"), attr$8(t, "class", "p-1 flex space-x-1 svelte-1ib1ln5"), attr$8(_, "type", "text"), attr$8(_, "id", "chain"), attr$8(_, "class", "w-1/2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1ib1ln5"), attr$8(_, "placeholder", "Resname"), attr$8(c, "type", "text"), attr$8(c, "id", "residue_range"), attr$8(c, "class", "w-full bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1ib1ln5"), attr$8(c, "placeholder", "Residue range"), attr$8(h, "class", "p-1 flex space-x-1 svelte-1ib1ln5"), attr$8(A, "for", "countries"), attr$8(A, "class", "block mb-2 text-sm w-1/3 font-medium text-gray-600 dark:text-white svelte-1ib1ln5"), o.__value = "stick", set_input_value$1(o, o.__value), attr$8(o, "class", "svelte-1ib1ln5"), w.__value = "cartoon", set_input_value$1(w, w.__value), attr$8(w, "class", "svelte-1ib1ln5"), p.__value = "surface", set_input_value$1(p, p.__value), attr$8(p, "class", "svelte-1ib1ln5"), a.__value = "sphere", set_input_value$1(a, a.__value), attr$8(a, "class", "svelte-1ib1ln5"), attr$8(s, "id", "style"), attr$8(s, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1ib1ln5"), /*rep*/ r[53].style === void 0 && add_render_callback(Tt), attr$8(b, "class", "p-1 flex space-x-1 items-center svelte-1ib1ln5"), attr$8(M, "class", " svelte-1ib1ln5"), attr$8(T, "id", "around"), attr$8(T, "type", "range"), T.value = D = /*rep*/ - r[53].around, attr$8(T, "min", "0"), attr$8(T, "max", "10"), attr$8(T, "step", "0.5"), attr$8(T, "class", "h-2 w-1/3 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 svelte-1ib1ln5"), attr$8(B, "type", "text"), attr$8(B, "class", "w-8 svelte-1ib1ln5"), attr$8(z, "class", "svelte-1ib1ln5"), attr$8(g, "class", "flex p-1 items-center text-gray-700 space-x-1 text-sm svelte-1ib1ln5"), attr$8(k, "class", "svelte-1ib1ln5"), attr$8(U, "type", "checkbox"), U.__value = "", set_input_value$1(U, U.__value), attr$8(U, "class", "sr-only peer svelte-1ib1ln5"), attr$8(Q, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1ib1ln5"), attr$8(H, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center svelte-1ib1ln5"), attr$8($, "class", "flex space-x-1 w-1/2 svelte-1ib1ln5"), attr$8(ne, "class", "svelte-1ib1ln5"), attr$8(fe, "type", "checkbox"), fe.__value = "", set_input_value$1(fe, fe.__value), attr$8(fe, "class", "sr-only peer svelte-1ib1ln5"), attr$8(Me, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1ib1ln5"), attr$8(se, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center svelte-1ib1ln5"), attr$8(ee, "class", "flex space-x-1 w-1/2 svelte-1ib1ln5"), attr$8(N, "class", "flex p-1 items-center text-gray-700 space-x-1 text-sm svelte-1ib1ln5"), attr$8(pe, "class", we = null_to_empty( + r[53].around, attr$8(T, "min", "0"), attr$8(T, "max", "10"), attr$8(T, "step", "0.5"), attr$8(T, "class", "h-2 w-1/3 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 svelte-1ib1ln5"), attr$8(z, "type", "text"), attr$8(z, "class", "w-8 svelte-1ib1ln5"), attr$8(B, "class", "svelte-1ib1ln5"), attr$8(g, "class", "flex p-1 items-center text-gray-700 space-x-1 text-sm svelte-1ib1ln5"), attr$8(k, "class", "svelte-1ib1ln5"), attr$8(U, "type", "checkbox"), U.__value = "", set_input_value$1(U, U.__value), attr$8(U, "class", "sr-only peer svelte-1ib1ln5"), attr$8(Q, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1ib1ln5"), attr$8(H, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center svelte-1ib1ln5"), attr$8($, "class", "flex space-x-1 w-1/2 svelte-1ib1ln5"), attr$8(q, "class", "svelte-1ib1ln5"), attr$8(fe, "type", "checkbox"), fe.__value = "", set_input_value$1(fe, fe.__value), attr$8(fe, "class", "sr-only peer svelte-1ib1ln5"), attr$8(Me, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1ib1ln5"), attr$8(ne, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center svelte-1ib1ln5"), attr$8(oe, "class", "flex space-x-1 w-1/2 svelte-1ib1ln5"), attr$8(N, "class", "flex p-1 items-center text-gray-700 space-x-1 text-sm svelte-1ib1ln5"), attr$8(pe, "class", we = null_to_empty( /*rep*/ r[53].color === "orangeCarbon" ? "bg-orange-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-orange-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" ) + " svelte-1ib1ln5"), attr$8(Ue, "class", Ne = null_to_empty( @@ -25820,13 +25820,13 @@ function create_if_block_1$5(r) { ) + " svelte-1ib1ln5"), attr$8(We, "class", Y = null_to_empty( /*rep*/ r[53].color === "grayCarbon" ? "bg-gray-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-gray-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1ib1ln5"), attr$8(q, "class", de = null_to_empty( + ) + " svelte-1ib1ln5"), attr$8(ee, "class", de = null_to_empty( /*rep*/ r[53].color === "greenCarbon" ? "bg-green-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-green-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" ) + " svelte-1ib1ln5"), attr$8(Ie, "class", Re = null_to_empty( /*rep*/ r[53].color === "cyanCarbon" ? "bg-cyan-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-cyan-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1ib1ln5"), attr$8(ae, "class", "flex space-x-2 mt-2 svelte-1ib1ln5"), attr$8(Ae, "class", he = null_to_empty( + ) + " svelte-1ib1ln5"), attr$8(se, "class", "flex space-x-2 mt-2 svelte-1ib1ln5"), attr$8(Ae, "class", he = null_to_empty( /*rep*/ r[53].color === "alphafold" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white" ) + " svelte-1ib1ln5"), attr$8(j, "class", Ve = null_to_empty( @@ -25844,45 +25844,45 @@ function create_if_block_1$5(r) { ) + " svelte-1ib1ln5"), attr$8(ce, "class", "flex space-x-2 py-2 text-sm svelte-1ib1ln5"), attr$8(e, "class", "svelte-1ib1ln5"); }, m(pt, yt) { - insert$a(pt, e, yt), append$8(e, t), append$8(t, s); + insert$a(pt, e, yt), append$8(e, t), append$8(t, n); for (let At = 0; At < wt.length; At += 1) - wt[At] && wt[At].m(s, null); + wt[At] && wt[At].m(n, null); select_option( - s, + n, /*rep*/ r[53].model, !0 - ), append$8(t, f), append$8(t, _), set_input_value$1( - _, + ), append$8(t, f), append$8(t, u), set_input_value$1( + u, /*rep*/ r[53].chain - ), append$8(e, x), append$8(e, h), append$8(h, u), set_input_value$1( - u, + ), append$8(e, y), append$8(e, h), append$8(h, _), set_input_value$1( + _, /*rep*/ r[53].resname ), append$8(h, E), append$8(h, c), set_input_value$1( c, /*rep*/ r[53].residue_range - ), append$8(e, C), append$8(e, b), append$8(b, A), append$8(b, S), append$8(b, n), append$8(n, o), append$8(n, w), append$8(n, p), append$8(n, v), append$8(n, a), select_option( - n, + ), append$8(e, C), append$8(e, b), append$8(b, A), append$8(b, S), append$8(b, s), append$8(s, o), append$8(s, w), append$8(s, p), append$8(s, v), append$8(s, a), select_option( + s, /*rep*/ r[53].style, !0 - ), append$8(e, l), append$8(e, g), append$8(g, M), append$8(g, L), append$8(g, T), append$8(g, R), append$8(g, B), set_input_value$1( - B, + ), append$8(e, l), append$8(e, g), append$8(g, M), append$8(g, L), append$8(g, T), append$8(g, I), append$8(g, z), set_input_value$1( + z, /*rep*/ r[53].around - ), append$8(g, P), append$8(g, z), append$8(e, F), append$8(e, N), append$8(N, $), append$8($, k), append$8($, G), append$8($, H), append$8(H, U), U.checked = /*rep*/ - r[53].byres, append$8(H, V), append$8(H, Q), append$8(N, oe), append$8(N, ee), append$8(ee, ne), append$8(ee, me), append$8(ee, se), append$8(se, fe), fe.checked = /*rep*/ - r[53].sidechain, append$8(se, Ce), append$8(se, Me), append$8(e, Te), append$8(e, ae), append$8(ae, pe), append$8(ae, ke), append$8(ae, Ue), append$8(ae, Be), append$8(ae, ue), append$8(ae, ge), append$8(ae, Se), append$8(ae, He), append$8(ae, We), append$8(ae, K), append$8(ae, q), append$8(ae, ve), append$8(ae, Ie), append$8(e, Z), append$8(e, ce), append$8(ce, Ae), append$8(Ae, Fe), append$8(ce, Oe), append$8(ce, j), append$8(j, $e), append$8(ce, I), append$8(ce, be), append$8(be, Ee), append$8(ce, le), append$8(ce, Le), append$8(Le, Ze), append$8(ce, je), append$8(ce, Je), append$8(Je, Lt), tt || (Et = [ - listen$2(s, "change", Pt), - listen$2(_, "input", vt), - listen$2(u, "input", bt), + ), append$8(g, P), append$8(g, B), append$8(e, F), append$8(e, N), append$8(N, $), append$8($, k), append$8($, G), append$8($, H), append$8(H, U), U.checked = /*rep*/ + r[53].byres, append$8(H, V), append$8(H, Q), append$8(N, ae), append$8(N, oe), append$8(oe, q), append$8(oe, me), append$8(oe, ne), append$8(ne, fe), fe.checked = /*rep*/ + r[53].sidechain, append$8(ne, Ce), append$8(ne, Me), append$8(e, Te), append$8(e, se), append$8(se, pe), append$8(se, ke), append$8(se, Ue), append$8(se, Be), append$8(se, ue), append$8(se, ge), append$8(se, Se), append$8(se, He), append$8(se, We), append$8(se, K), append$8(se, ee), append$8(se, ve), append$8(se, Ie), append$8(e, Z), append$8(e, ce), append$8(ce, Ae), append$8(Ae, Fe), append$8(ce, Oe), append$8(ce, j), append$8(j, $e), append$8(ce, R), append$8(ce, be), append$8(be, Ee), append$8(ce, le), append$8(ce, Le), append$8(Le, Ze), append$8(ce, je), append$8(ce, Je), append$8(Je, Lt), tt || (Et = [ + listen$2(n, "change", Pt), + listen$2(u, "input", vt), + listen$2(_, "input", bt), listen$2(c, "input", mt), - listen$2(n, "change", Tt), + listen$2(s, "change", Tt), listen$2(T, "change", Ot), - listen$2(B, "input", Ft), + listen$2(z, "input", Ft), listen$2(U, "change", Qt), listen$2(fe, "change", kt), listen$2(pe, "click", Jt), @@ -25890,7 +25890,7 @@ function create_if_block_1$5(r) { listen$2(ue, "click", er), listen$2(Se, "click", Ht), listen$2(We, "click", tr), - listen$2(q, "click", lr), + listen$2(ee, "click", lr), listen$2(Ie, "click", Or), listen$2(Ae, "click", Dr), listen$2(j, "click", Pr), @@ -25909,7 +25909,7 @@ function create_if_block_1$5(r) { let At; for (At = 0; At < lt.length; At += 1) { const rr = get_each_context_1$1(r, lt, At); - wt[At] ? wt[At].p(rr, yt) : (wt[At] = create_each_block_1$1(rr), wt[At].c(), wt[At].m(s, null)); + wt[At] ? wt[At].p(rr, yt) : (wt[At] = create_each_block_1$1(rr), wt[At].c(), wt[At].m(n, null)); } for (; At < wt.length; At += 1) wt[At].d(1); @@ -25917,19 +25917,19 @@ function create_if_block_1$5(r) { } yt[0] & /*representations*/ 2 && select_option( - s, + n, /*rep*/ r[53].model ), yt[0] & /*representations*/ - 2 && _.value !== /*rep*/ + 2 && u.value !== /*rep*/ r[53].chain && set_input_value$1( - _, + u, /*rep*/ r[53].chain ), yt[0] & /*representations*/ - 2 && u.value !== /*rep*/ + 2 && _.value !== /*rep*/ r[53].resname && set_input_value$1( - u, + _, /*rep*/ r[53].resname ), yt[0] & /*representations*/ @@ -25940,15 +25940,15 @@ function create_if_block_1$5(r) { r[53].residue_range ), yt[0] & /*representations*/ 2 && select_option( - n, + s, /*rep*/ r[53].style ), yt[0] & /*representations*/ 2 && D !== (D = /*rep*/ r[53].around) && (T.value = D), yt[0] & /*representations*/ - 2 && B.value !== /*rep*/ + 2 && z.value !== /*rep*/ r[53].around && set_input_value$1( - B, + z, /*rep*/ r[53].around ), yt[0] & /*representations*/ @@ -25979,7 +25979,7 @@ function create_if_block_1$5(r) { 2 && de !== (de = null_to_empty( /*rep*/ r[53].color === "greenCarbon" ? "bg-green-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-green-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" - ) + " svelte-1ib1ln5") && attr$8(q, "class", de), yt[0] & /*representations*/ + ) + " svelte-1ib1ln5") && attr$8(ee, "class", de), yt[0] & /*representations*/ 2 && Re !== (Re = null_to_empty( /*rep*/ r[53].color === "cyanCarbon" ? "bg-cyan-600 rounded-full w-8 h-8 border-4 border-gray-300 cursor-pointer" : "bg-cyan-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer" @@ -26020,30 +26020,30 @@ function create_each_block_1$1(r) { let e, t = ( /*mol*/ r[56].name + "" - ), s, f, _; + ), n, f, u; return { c() { - e = element$7("option"), s = text$3(t), f = text$3(" #"), _ = text$3( + e = element$7("option"), n = text$3(t), f = text$3(" #"), u = text$3( /*i*/ r[58] ), e.__value = /*i*/ r[58], set_input_value$1(e, e.__value), attr$8(e, "class", "svelte-1ib1ln5"); }, - m(x, h) { - insert$a(x, e, h), append$8(e, s), append$8(e, f), append$8(e, _); + m(y, h) { + insert$a(y, e, h), append$8(e, n), append$8(e, f), append$8(e, u); }, - p(x, h) { + p(y, h) { h[0] & /*moldata*/ 8 && t !== (t = /*mol*/ - x[56].name + "") && set_data$3(s, t); + y[56].name + "") && set_data$3(n, t); }, - d(x) { - x && detach$a(e); + d(y) { + y && detach$a(e); } }; } function create_each_block$2(r) { - let e, t, s, f, _, x, h, u, E, c, C, b, A, S, n, o; + let e, t, n, f, u, y, h, _, E, c, C, b, A, S, s, o; function w() { return ( /*click_handler*/ @@ -26081,35 +26081,35 @@ function create_each_block$2(r) { ); return { c() { - e = element$7("div"), t = element$7("div"), s = element$7("div"), f = element$7("button"), _ = svg_element$3("svg"), x = svg_element$3("path"), u = space$7(), E = element$7("span"), E.textContent = `Representation #${/*index*/ - r[55]}`, c = space$7(), C = element$7("button"), C.innerHTML = '', b = space$7(), A = element$7("button"), A.innerHTML = '', S = space$7(), a && a.c(), attr$8(x, "stroke-linecap", "round"), attr$8(x, "stroke-linejoin", "round"), attr$8(x, "d", "M8.25 4.5l7.5 7.5-7.5 7.5"), attr$8(x, "class", "svelte-1ib1ln5"), attr$8(_, "xmlns", "http://www.w3.org/2000/svg"), attr$8(_, "fill", "none"), attr$8(_, "viewBox", "0 0 24 24"), attr$8(_, "stroke-width", "1.5"), attr$8(_, "stroke", "currentColor"), attr$8(_, "class", h = null_to_empty( + e = element$7("div"), t = element$7("div"), n = element$7("div"), f = element$7("button"), u = svg_element$3("svg"), y = svg_element$3("path"), _ = space$7(), E = element$7("span"), E.textContent = `Representation #${/*index*/ + r[55]}`, c = space$7(), C = element$7("button"), C.innerHTML = '', b = space$7(), A = element$7("button"), A.innerHTML = '', S = space$7(), a && a.c(), attr$8(y, "stroke-linecap", "round"), attr$8(y, "stroke-linejoin", "round"), attr$8(y, "d", "M8.25 4.5l7.5 7.5-7.5 7.5"), attr$8(y, "class", "svelte-1ib1ln5"), attr$8(u, "xmlns", "http://www.w3.org/2000/svg"), attr$8(u, "fill", "none"), attr$8(u, "viewBox", "0 0 24 24"), attr$8(u, "stroke-width", "1.5"), attr$8(u, "stroke", "currentColor"), attr$8(u, "class", h = null_to_empty( /*rep*/ r[53].visible ? "transform rotate-90 w-5 h-5 " : "w-5 h-5 " - ) + " svelte-1ib1ln5"), attr$8(E, "class", "svelte-1ib1ln5"), attr$8(f, "class", "flex items-center space-x-2 svelte-1ib1ln5"), attr$8(C, "class", "svelte-1ib1ln5"), attr$8(A, "title", "zoom to selection"), attr$8(A, "class", "svelte-1ib1ln5"), attr$8(s, "class", "flex space-x-2 items-center cursor-pointer p-1 svelte-1ib1ln5"), attr$8(t, "class", " svelte-1ib1ln5"), attr$8(e, "class", "bg-white border-b border-t border-gray-200 py-4 px-2 svelte-1ib1ln5"); + ) + " svelte-1ib1ln5"), attr$8(E, "class", "svelte-1ib1ln5"), attr$8(f, "class", "flex items-center space-x-2 svelte-1ib1ln5"), attr$8(C, "class", "svelte-1ib1ln5"), attr$8(A, "title", "zoom to selection"), attr$8(A, "class", "svelte-1ib1ln5"), attr$8(n, "class", "flex space-x-2 items-center cursor-pointer p-1 svelte-1ib1ln5"), attr$8(t, "class", " svelte-1ib1ln5"), attr$8(e, "class", "bg-white border-b border-t border-gray-200 py-4 px-2 svelte-1ib1ln5"); }, m(l, g) { - insert$a(l, e, g), append$8(e, t), append$8(t, s), append$8(s, f), append$8(f, _), append$8(_, x), append$8(f, u), append$8(f, E), append$8(s, c), append$8(s, C), append$8(s, b), append$8(s, A), append$8(t, S), a && a.m(t, null), n || (o = [ + insert$a(l, e, g), append$8(e, t), append$8(t, n), append$8(n, f), append$8(f, u), append$8(u, y), append$8(f, _), append$8(f, E), append$8(n, c), append$8(n, C), append$8(n, b), append$8(n, A), append$8(t, S), a && a.m(t, null), s || (o = [ listen$2(f, "click", w), listen$2(C, "click", p), listen$2(A, "click", v) - ], n = !0); + ], s = !0); }, p(l, g) { r = l, g[0] & /*representations*/ 2 && h !== (h = null_to_empty( /*rep*/ r[53].visible ? "transform rotate-90 w-5 h-5 " : "w-5 h-5 " - ) + " svelte-1ib1ln5") && attr$8(_, "class", h), /*rep*/ + ) + " svelte-1ib1ln5") && attr$8(u, "class", h), /*rep*/ r[53].visible ? a ? (a.p(r, g), g[0] & /*representations*/ 2 && transition_in$7(a, 1)) : (a = create_if_block_1$5(r), a.c(), transition_in$7(a, 1), a.m(t, null)) : a && (a.d(1), a = null); }, d(l) { - l && detach$a(e), a && a.d(), n = !1, run_all$3(o); + l && detach$a(e), a && a.d(), s = !1, run_all$3(o); } }; } function create_fragment$a(r) { - let e, t, s, f, _, x, h, u, E, c, C, b, A, S, n, o, w, p, v, a, l, g, M = ( + let e, t, n, f, u, y, h, _, E, c, C, b, A, S, s, o, w, p, v, a, l, g, M = ( /*anyColorAlphaFold*/ r[11] && create_if_block_8$1(r) ), L = ( @@ -26124,17 +26124,17 @@ function create_fragment$a(r) { ); return { c() { - e = element$7("div"), t = element$7("div"), s = element$7("div"), f = element$7("div"), _ = element$7("button"), _.innerHTML = '', x = space$7(), h = element$7("button"), h.innerHTML = '', u = space$7(), E = element$7("button"), E.innerHTML = '', c = space$7(), M && M.c(), C = space$7(), L && L.c(), b = space$7(), A = element$7("div"), S = element$7("button"), S.innerHTML = '', n = space$7(), o = element$7("span"), o.textContent = "Cite 3dmol.js as Rego & Koes, doi:10/gb5g5n", w = space$7(), p = element$7("div"), v = space$7(), T && T.c(), a = space$7(), D && D.c(), attr$8(_, "class", "p-2 svelte-1ib1ln5"), attr$8(_, "title", "Reset View"), attr$8(h, "class", "p-2 svelte-1ib1ln5"), attr$8(h, "title", "Settings"), attr$8(E, "class", "p-2 svelte-1ib1ln5"), attr$8(E, "title", "Representations"), attr$8(f, "class", "absolute z-50 top-0 right-0 mr-2 flex flex-col divide-y border border-gray-200 mt-2 rounded items-center justify-center bg-white dark:bg-gray-800 svelte-1ib1ln5"), attr$8(S, "class", "p-1 svelte-1ib1ln5"), attr$8(S, "title", "How to cite 3Dmol.js"), attr$8(o, "class", "absolute -top-1 left-6 w-max rounded bg-gray-900 px-2 py-1 text-sm font-medium text-gray-50 opacity-0 shadow transition-opacity svelte-1ib1ln5"), toggle_class$5( + e = element$7("div"), t = element$7("div"), n = element$7("div"), f = element$7("div"), u = element$7("button"), u.innerHTML = '', y = space$7(), h = element$7("button"), h.innerHTML = '', _ = space$7(), E = element$7("button"), E.innerHTML = '', c = space$7(), M && M.c(), C = space$7(), L && L.c(), b = space$7(), A = element$7("div"), S = element$7("button"), S.innerHTML = '', s = space$7(), o = element$7("span"), o.textContent = "Cite 3dmol.js as Rego & Koes, doi:10/gb5g5n", w = space$7(), p = element$7("div"), v = space$7(), T && T.c(), a = space$7(), D && D.c(), attr$8(u, "class", "p-2 svelte-1ib1ln5"), attr$8(u, "title", "Reset View"), attr$8(h, "class", "p-2 svelte-1ib1ln5"), attr$8(h, "title", "Settings"), attr$8(E, "class", "p-2 svelte-1ib1ln5"), attr$8(E, "title", "Representations"), attr$8(f, "class", "absolute z-50 top-0 right-0 mr-2 flex flex-col divide-y border border-gray-200 mt-2 rounded items-center justify-center bg-white dark:bg-gray-800 svelte-1ib1ln5"), attr$8(S, "class", "p-1 svelte-1ib1ln5"), attr$8(S, "title", "How to cite 3Dmol.js"), attr$8(o, "class", "absolute -top-1 left-6 w-max rounded bg-gray-900 px-2 py-1 text-sm font-medium text-gray-50 opacity-0 shadow transition-opacity svelte-1ib1ln5"), toggle_class$5( o, "opacity-100", /*showCiteTooltip*/ r[6] - ), attr$8(A, "class", "absolute z-50 bottom-0 left-0 ml-2 flex divide-x mb-2 rounded items-center justify-center svelte-1ib1ln5"), attr$8(p, "class", "viewer w-full h-full z-10 svelte-1ib1ln5"), attr$8(s, "class", "gr-block gr-box relative w-full overflow-hidden svelte-1ib1ln5"), attr$8(t, "class", "overflow-hidden flex gap-px w-full h-full flex-wrap svelte-1ib1ln5"), attr$8(e, "class", "bg-white w-full minh svelte-1ib1ln5"); + ), attr$8(A, "class", "absolute z-50 bottom-0 left-0 ml-2 flex divide-x mb-2 rounded items-center justify-center svelte-1ib1ln5"), attr$8(p, "class", "viewer w-full h-full z-10 svelte-1ib1ln5"), attr$8(n, "class", "gr-block gr-box relative w-full overflow-hidden svelte-1ib1ln5"), attr$8(t, "class", "overflow-hidden flex gap-px w-full h-full flex-wrap svelte-1ib1ln5"), attr$8(e, "class", "bg-white w-full minh svelte-1ib1ln5"); }, - m(R, B) { - insert$a(R, e, B), append$8(e, t), append$8(t, s), append$8(s, f), append$8(f, _), append$8(f, x), append$8(f, h), append$8(f, u), append$8(f, E), append$8(s, c), M && M.m(s, null), append$8(s, C), L && L.m(s, null), append$8(s, b), append$8(s, A), append$8(A, S), append$8(A, n), append$8(A, o), append$8(s, w), append$8(s, p), r[21](p), append$8(s, v), T && T.m(s, null), append$8(s, a), D && D.m(s, null), l || (g = [ + m(I, z) { + insert$a(I, e, z), append$8(e, t), append$8(t, n), append$8(n, f), append$8(f, u), append$8(f, y), append$8(f, h), append$8(f, _), append$8(f, E), append$8(n, c), M && M.m(n, null), append$8(n, C), L && L.m(n, null), append$8(n, b), append$8(n, A), append$8(A, S), append$8(A, s), append$8(A, o), append$8(n, w), append$8(n, p), r[21](p), append$8(n, v), T && T.m(n, null), append$8(n, a), D && D.m(n, null), l || (g = [ listen$2( - _, + u, "click", /*resetZoom*/ r[18] @@ -26159,48 +26159,48 @@ function create_fragment$a(r) { ) ], l = !0); }, - p(R, B) { + p(I, z) { /*anyColorAlphaFold*/ - R[11] ? M ? M.p(R, B) : (M = create_if_block_8$1(R), M.c(), M.m(s, C)) : M && (M.d(1), M = null), /*hasFrames*/ - R[9] ? L ? L.p(R, B) : (L = create_if_block_6$1(R), L.c(), L.m(s, b)) : L && (L.d(1), L = null), B[0] & /*showCiteTooltip*/ + I[11] ? M ? M.p(I, z) : (M = create_if_block_8$1(I), M.c(), M.m(n, C)) : M && (M.d(1), M = null), /*hasFrames*/ + I[9] ? L ? L.p(I, z) : (L = create_if_block_6$1(I), L.c(), L.m(n, b)) : L && (L.d(1), L = null), z[0] & /*showCiteTooltip*/ 64 && toggle_class$5( o, "opacity-100", /*showCiteTooltip*/ - R[6] + I[6] ), /*showOffCanvas*/ - R[7] ? T ? T.p(R, B) : (T = create_if_block_2$1(R), T.c(), T.m(s, a)) : T && (T.d(1), T = null), /*showOffCanvasReps*/ - R[8] ? D ? D.p(R, B) : (D = create_if_block$6(R), D.c(), D.m(s, null)) : D && (D.d(1), D = null); + I[7] ? T ? T.p(I, z) : (T = create_if_block_2$1(I), T.c(), T.m(n, a)) : T && (T.d(1), T = null), /*showOffCanvasReps*/ + I[8] ? D ? D.p(I, z) : (D = create_if_block$6(I), D.c(), D.m(n, null)) : D && (D.d(1), D = null); }, i: noop$6, o: noop$6, - d(R) { - R && detach$a(e), M && M.d(), L && L.d(), r[21](null), T && T.d(), D && D.d(), l = !1, run_all$3(g); + d(I) { + I && detach$a(e), M && M.d(), L && L.d(), r[21](null), T && T.d(), D && D.d(), l = !1, run_all$3(g); } }; } function fade(r, { delay: e = 0, duration: t = 50 }) { - const s = +getComputedStyle(r).opacity; + const n = +getComputedStyle(r).opacity; return { delay: e, duration: t, - css: (f) => `opacity: ${f * s}` + css: (f) => `opacity: ${f * n}` }; } function instance$9(r, e, t) { - let s = _3Dmol, f, { confidenceLabel: _ = null } = e, { moldata: x = null } = e, h = { + let n = _3Dmol, f, { confidenceLabel: u = null } = e, { moldata: y = null } = e, h = { backgroundColor: { type: "select", options: ["white", "black", "gray", "lightgray", "beige", "orange"] }, orthographic: { type: "toggle" }, disableFog: { type: "toggle" } - }, { config: u = {} } = e, E = !0, c = !1; + }, { config: _ = {} } = e, E = !0, c = !1; function C() { t(6, c = !c); } let { representations: b = [] } = e, A = !1, S = !1; - function n() { + function s() { t(7, A = !A); } function o() { @@ -26241,7 +26241,7 @@ function instance$9(r, e, t) { if (ye.chain !== "" && (Se.chain = ye.chain), ye.residue_range !== "" && (Se.resi = ye.residue_range), ye.resname !== "" && (Se.resn = ye.resname), Se.byres = ye.byres, ye.around !== 0 && (Se.expand = ye.around), ye.sidechain && (Se = { and: [Se, { atom: ["N", "C", "O"], invert: !0 }] }), ye.style === "surface") - ge.opacity = 0.8, a.addSurface(s.SurfaceType.VDW, ge, Se); + ge.opacity = 0.8, a.addSurface(n.SurfaceType.VDW, ge, Se); else try { a.getModel(Se.model) != null && a.addStyle(Se, { [ye.style]: ge }); @@ -26251,12 +26251,12 @@ function instance$9(r, e, t) { }), a.render()); } onMount$1(() => { - let ue = { ...u, cartoonQuality: 7 }; - t(20, a = s.createViewer(f, ue)); + let ue = { ..._, cartoonQuality: 7 }; + t(20, a = n.createViewer(f, ue)); let ye = []; b.forEach((ge) => { ye.some((Se) => Se.model === ge.model && Se.chain === ge.chain && Se.resname === ge.resname && Se.style === ge.style && Se.color === ge.color && Se.residue_range === ge.residue_range && Se.around === ge.around && Se.byres === ge.byres && Se.sidechain === ge.sidechain) || ye.push(ge); - }), t(1, b = ye), x.length > 0 && x.forEach((ge) => { + }), t(1, b = ye), y.length > 0 && y.forEach((ge) => { ge.asFrames ? a.addModelsAsFrames(ge.data, ge.format) : a.addModel(ge.data, ge.format); }), g(b), a.zoomTo(), a.render(), a.zoom(0.8, 2e3), b.forEach((ge) => { ge.color === "alphafold" && t(11, T = !0); @@ -26266,7 +26266,7 @@ function instance$9(r, e, t) { function(ge, Se, ze, He) { if (!ge.label) { let We; - T ? We = ge.resn + ":" + ge.resi + ":" + ge.atom + " (" + _ + " " + ge.b + ")" : We = ge.resn + ":" + ge.resi + ":" + ge.atom, ge.label = Se.addLabel(We, { + T ? We = ge.resn + ":" + ge.resi + ":" + ge.atom + " (" + u + " " + ge.b + ")" : We = ge.resn + ":" + ge.resi + ":" + ge.atom, ge.label = Se.addLabel(We, { position: ge, backgroundColor: "#ffffff", borderColor: "#dddddd", @@ -26283,19 +26283,19 @@ function instance$9(r, e, t) { function D() { console.log(a.isAnimated()), L ? a.pauseAnimate() : a.animate({ loop: "forward", reps: 0 }), a.render(), console.log(a.isAnimated()), t(10, L = !L); } - function R(ue) { + function I(ue) { binding_callbacks$3[ue ? "unshift" : "push"](() => { f = ue, t(4, f); }); } - function B(ue) { - u[ue] = this.checked, t(0, u), t(12, h); + function z(ue) { + _[ue] = this.checked, t(0, _), t(12, h); } const P = (ue) => { - t(0, u[ue] = event.target.value, u); + t(0, _[ue] = event.target.value, _); }; - function z(ue) { - u[ue] = select_value(this), t(0, u), t(12, h); + function B(ue) { + _[ue] = select_value(this), t(0, _), t(12, h); } function F() { E = this.value, t(5, E); @@ -26316,36 +26316,36 @@ function instance$9(r, e, t) { function Q(ue, ye) { ue[ye].style = select_value(this), t(1, b); } - const oe = (ue, ye, ge, Se) => { + const ae = (ue, ye, ge, Se) => { t(1, ye[ge].around = Se.target.value, b); }; - function ee(ue, ye) { + function oe(ue, ye) { ue[ye].around = this.value, t(1, b); } - function ne(ue, ye) { + function q(ue, ye) { ue[ye].byres = this.checked, t(1, b); } function me(ue, ye) { ue[ye].sidechain = this.checked, t(1, b); } - const se = (ue, ye, ge) => t(1, ye[ge].color = "orangeCarbon", b), fe = (ue, ye, ge) => t(1, ye[ge].color = "redCarbon", b), Ce = (ue, ye, ge) => t(1, ye[ge].color = "blackCarbon", b), Me = (ue, ye, ge) => t(1, ye[ge].color = "blueCarbon", b), Te = (ue, ye, ge) => t(1, ye[ge].color = "grayCarbon", b), ae = (ue, ye, ge) => t(1, ye[ge].color = "greenCarbon", b), pe = (ue, ye, ge) => t(1, ye[ge].color = "cyanCarbon", b), we = (ue, ye, ge) => t(1, ye[ge].color = "alphafold", b), ke = (ue, ye, ge) => t(1, ye[ge].color = "default", b), Ue = (ue, ye, ge) => t(1, ye[ge].color = "Jmol", b), Ne = (ue, ye, ge) => t(1, ye[ge].color = "chain", b), Be = (ue, ye, ge) => t(1, ye[ge].color = "spectrum", b); + const ne = (ue, ye, ge) => t(1, ye[ge].color = "orangeCarbon", b), fe = (ue, ye, ge) => t(1, ye[ge].color = "redCarbon", b), Ce = (ue, ye, ge) => t(1, ye[ge].color = "blackCarbon", b), Me = (ue, ye, ge) => t(1, ye[ge].color = "blueCarbon", b), Te = (ue, ye, ge) => t(1, ye[ge].color = "grayCarbon", b), se = (ue, ye, ge) => t(1, ye[ge].color = "greenCarbon", b), pe = (ue, ye, ge) => t(1, ye[ge].color = "cyanCarbon", b), we = (ue, ye, ge) => t(1, ye[ge].color = "alphafold", b), ke = (ue, ye, ge) => t(1, ye[ge].color = "default", b), Ue = (ue, ye, ge) => t(1, ye[ge].color = "Jmol", b), Ne = (ue, ye, ge) => t(1, ye[ge].color = "chain", b), Be = (ue, ye, ge) => t(1, ye[ge].color = "spectrum", b); return r.$$set = (ue) => { - "confidenceLabel" in ue && t(2, _ = ue.confidenceLabel), "moldata" in ue && t(3, x = ue.moldata), "config" in ue && t(0, u = ue.config), "representations" in ue && t(1, b = ue.representations); + "confidenceLabel" in ue && t(2, u = ue.confidenceLabel), "moldata" in ue && t(3, y = ue.moldata), "config" in ue && t(0, _ = ue.config), "representations" in ue && t(1, b = ue.representations); }, r.$$.update = () => { r.$$.dirty[0] & /*view, config*/ - 1048577 && a != null && (a.setBackgroundColor(u.backgroundColor), a.enableFog(!u.disableFog), a.setCameraParameters({ orthographic: u.orthographic })), r.$$.dirty[0] & /*representations*/ + 1048577 && a != null && (a.setBackgroundColor(_.backgroundColor), a.enableFog(!_.disableFog), a.setCameraParameters({ orthographic: _.orthographic })), r.$$.dirty[0] & /*representations*/ 2 && g(b), r.$$.dirty[0] & /*moldata*/ - 8 && x.forEach((ue) => { + 8 && y.forEach((ue) => { ue.asFrames && t(9, M = !0); }), r.$$.dirty[0] & /*representations*/ 2 && (t(11, T = !1), b.forEach((ue) => { ue.color === "alphafold" && t(11, T = !0); })); }, [ - u, - b, _, - x, + b, + u, + y, f, E, c, @@ -26356,17 +26356,17 @@ function instance$9(r, e, t) { T, h, C, - n, + s, o, w, p, l, D, a, - R, - B, - P, + I, z, + P, + B, F, N, $, @@ -26376,16 +26376,16 @@ function instance$9(r, e, t) { U, V, Q, + ae, oe, - ee, - ne, + q, me, - se, + ne, fe, Ce, Me, Te, - ae, + se, pe, we, ke, @@ -26443,27 +26443,27 @@ function create_else_block$4(r) { c() { create_component$5(e.$$.fragment); }, - m(s, f) { - mount_component$5(e, s, f), t = !0; + m(n, f) { + mount_component$5(e, n, f), t = !0; }, - p(s, f) { - const _ = {}; + p(n, f) { + const u = {}; f & /*$$scope*/ - 4096 && (_.$$scope = { dirty: f, ctx: s }), e.$set(_); + 8192 && (u.$$scope = { dirty: f, ctx: n }), e.$set(u); }, - i(s) { - t || (transition_in$6(e.$$.fragment, s), t = !0); + i(n) { + t || (transition_in$6(e.$$.fragment, n), t = !0); }, - o(s) { - transition_out$6(e.$$.fragment, s), t = !1; + o(n) { + transition_out$6(e.$$.fragment, n), t = !1; }, - d(s) { - destroy_component$5(e, s); + d(n) { + destroy_component$5(e, n); } }; } function create_if_block$5(r) { - let e, t, s, f; + let e, t, n, f; e = new FilePreview({ props: { i18n: ( @@ -26486,43 +26486,45 @@ function create_if_block$5(r) { }), e.$on( "select", /*select_handler*/ - r[11] + r[12] ); - let _ = ( + let u = ( /*moldata*/ - r[9] != null && create_if_block_1$4(r) + r[9] != null && /*molviewer*/ + r[10] && create_if_block_1$4(r) ); return { c() { - create_component$5(e.$$.fragment), t = space$6(), _ && _.c(), s = empty$3(); + create_component$5(e.$$.fragment), t = space$6(), u && u.c(), n = empty$3(); }, - m(x, h) { - mount_component$5(e, x, h), insert$9(x, t, h), _ && _.m(x, h), insert$9(x, s, h), f = !0; + m(y, h) { + mount_component$5(e, y, h), insert$9(y, t, h), u && u.m(y, h), insert$9(y, n, h), f = !0; }, - p(x, h) { - const u = {}; + p(y, h) { + const _ = {}; h & /*i18n*/ - 32 && (u.i18n = /*i18n*/ - x[5]), h & /*selectable*/ - 8 && (u.selectable = /*selectable*/ - x[3]), h & /*value*/ - 1 && (u.value = /*value*/ - x[0]), h & /*height*/ - 16 && (u.height = /*height*/ - x[4]), e.$set(u), /*moldata*/ - x[9] != null ? _ ? (_.p(x, h), h & /*moldata*/ - 512 && transition_in$6(_, 1)) : (_ = create_if_block_1$4(x), _.c(), transition_in$6(_, 1), _.m(s.parentNode, s)) : _ && (group_outros$5(), transition_out$6(_, 1, 1, () => { - _ = null; + 32 && (_.i18n = /*i18n*/ + y[5]), h & /*selectable*/ + 8 && (_.selectable = /*selectable*/ + y[3]), h & /*value*/ + 1 && (_.value = /*value*/ + y[0]), h & /*height*/ + 16 && (_.height = /*height*/ + y[4]), e.$set(_), /*moldata*/ + y[9] != null && /*molviewer*/ + y[10] ? u ? (u.p(y, h), h & /*moldata, molviewer*/ + 1536 && transition_in$6(u, 1)) : (u = create_if_block_1$4(y), u.c(), transition_in$6(u, 1), u.m(n.parentNode, n)) : u && (group_outros$5(), transition_out$6(u, 1, 1, () => { + u = null; }), check_outros$5()); }, - i(x) { - f || (transition_in$6(e.$$.fragment, x), transition_in$6(_), f = !0); + i(y) { + f || (transition_in$6(e.$$.fragment, y), transition_in$6(u), f = !0); }, - o(x) { - transition_out$6(e.$$.fragment, x), transition_out$6(_), f = !1; + o(y) { + transition_out$6(e.$$.fragment, y), transition_out$6(u), f = !1; }, - d(x) { - x && (detach$9(t), detach$9(s)), destroy_component$5(e, x), _ && _.d(x); + d(y) { + y && (detach$9(t), detach$9(n)), destroy_component$5(e, y), u && u.d(y); } }; } @@ -26532,17 +26534,17 @@ function create_default_slot$2(r) { c() { create_component$5(e.$$.fragment); }, - m(s, f) { - mount_component$5(e, s, f), t = !0; + m(n, f) { + mount_component$5(e, n, f), t = !0; }, - i(s) { - t || (transition_in$6(e.$$.fragment, s), t = !0); + i(n) { + t || (transition_in$6(e.$$.fragment, n), t = !0); }, - o(s) { - transition_out$6(e.$$.fragment, s), t = !1; + o(n) { + transition_out$6(e.$$.fragment, n), t = !1; }, - d(s) { - destroy_component$5(e, s); + d(n) { + destroy_component$5(e, n); } }; } @@ -26571,34 +26573,34 @@ function create_if_block_1$4(r) { c() { create_component$5(e.$$.fragment); }, - m(s, f) { - mount_component$5(e, s, f), t = !0; + m(n, f) { + mount_component$5(e, n, f), t = !0; }, - p(s, f) { - const _ = {}; + p(n, f) { + const u = {}; f & /*moldata*/ - 512 && (_.moldata = /*moldata*/ - s[9]), f & /*config*/ - 64 && (_.config = /*config*/ - s[6]), f & /*confidenceLabel*/ - 128 && (_.confidenceLabel = /*confidenceLabel*/ - s[7]), f & /*representations*/ - 256 && (_.representations = /*representations*/ - s[8]), e.$set(_); + 512 && (u.moldata = /*moldata*/ + n[9]), f & /*config*/ + 64 && (u.config = /*config*/ + n[6]), f & /*confidenceLabel*/ + 128 && (u.confidenceLabel = /*confidenceLabel*/ + n[7]), f & /*representations*/ + 256 && (u.representations = /*representations*/ + n[8]), e.$set(u); }, - i(s) { - t || (transition_in$6(e.$$.fragment, s), t = !0); + i(n) { + t || (transition_in$6(e.$$.fragment, n), t = !0); }, - o(s) { - transition_out$6(e.$$.fragment, s), t = !1; + o(n) { + transition_out$6(e.$$.fragment, n), t = !1; }, - d(s) { - destroy_component$5(e, s); + d(n) { + destroy_component$5(e, n); } }; } function create_fragment$9(r) { - let e, t, s, f, _, x; + let e, t, n, f, u, y; e = new BlockLabel({ props: { show_label: ( @@ -26616,19 +26618,19 @@ function create_fragment$9(r) { ) } }); - const h = [create_if_block$5, create_else_block$4], u = []; + const h = [create_if_block$5, create_else_block$4], _ = []; function E(c, C) { return ( /*value*/ c[0] ? 0 : 1 ); } - return s = E(r), f = u[s] = h[s](r), { + return n = E(r), f = _[n] = h[n](r), { c() { - create_component$5(e.$$.fragment), t = space$6(), f.c(), _ = empty$3(); + create_component$5(e.$$.fragment), t = space$6(), f.c(), u = empty$3(); }, m(c, C) { - mount_component$5(e, c, C), insert$9(c, t, C), u[s].m(c, C), insert$9(c, _, C), x = !0; + mount_component$5(e, c, C), insert$9(c, t, C), _[n].m(c, C), insert$9(c, u, C), y = !0; }, p(c, [C]) { const b = {}; @@ -26639,42 +26641,43 @@ function create_fragment$9(r) { c[0] === null), C & /*label*/ 2 && (b.label = /*label*/ c[1] || "File"), e.$set(b); - let A = s; - s = E(c), s === A ? u[s].p(c, C) : (group_outros$5(), transition_out$6(u[A], 1, 1, () => { - u[A] = null; - }), check_outros$5(), f = u[s], f ? f.p(c, C) : (f = u[s] = h[s](c), f.c()), transition_in$6(f, 1), f.m(_.parentNode, _)); + let A = n; + n = E(c), n === A ? _[n].p(c, C) : (group_outros$5(), transition_out$6(_[A], 1, 1, () => { + _[A] = null; + }), check_outros$5(), f = _[n], f ? f.p(c, C) : (f = _[n] = h[n](c), f.c()), transition_in$6(f, 1), f.m(u.parentNode, u)); }, i(c) { - x || (transition_in$6(e.$$.fragment, c), transition_in$6(f), x = !0); + y || (transition_in$6(e.$$.fragment, c), transition_in$6(f), y = !0); }, o(c) { - transition_out$6(e.$$.fragment, c), transition_out$6(f), x = !1; + transition_out$6(e.$$.fragment, c), transition_out$6(f), y = !1; }, d(c) { - c && (detach$9(t), detach$9(_)), destroy_component$5(e, c), u[s].d(c); + c && (detach$9(t), detach$9(u)), destroy_component$5(e, c), _[n].d(c); } }; } function instance$8(r, e, t) { - let { value: s = null } = e, { label: f } = e, { show_label: _ = !0 } = e, { selectable: x = !1 } = e, { height: h = void 0 } = e, { i18n: u } = e, { config: E = {} } = e, { confidenceLabel: c = "" } = e, { representations: C = [] } = e, { moldata: b = null } = e, { errors: A = [] } = e; - function S(n) { - bubble$2.call(this, r, n); + let { value: n = null } = e, { label: f } = e, { show_label: u = !0 } = e, { selectable: y = !1 } = e, { height: h = void 0 } = e, { i18n: _ } = e, { config: E = {} } = e, { confidenceLabel: c = "" } = e, { representations: C = [] } = e, { moldata: b = null } = e, { molviewer: A = !1 } = e, { errors: S = [] } = e; + function s(o) { + bubble$2.call(this, r, o); } - return r.$$set = (n) => { - "value" in n && t(0, s = n.value), "label" in n && t(1, f = n.label), "show_label" in n && t(2, _ = n.show_label), "selectable" in n && t(3, x = n.selectable), "height" in n && t(4, h = n.height), "i18n" in n && t(5, u = n.i18n), "config" in n && t(6, E = n.config), "confidenceLabel" in n && t(7, c = n.confidenceLabel), "representations" in n && t(8, C = n.representations), "moldata" in n && t(9, b = n.moldata), "errors" in n && t(10, A = n.errors); + return r.$$set = (o) => { + "value" in o && t(0, n = o.value), "label" in o && t(1, f = o.label), "show_label" in o && t(2, u = o.show_label), "selectable" in o && t(3, y = o.selectable), "height" in o && t(4, h = o.height), "i18n" in o && t(5, _ = o.i18n), "config" in o && t(6, E = o.config), "confidenceLabel" in o && t(7, c = o.confidenceLabel), "representations" in o && t(8, C = o.representations), "moldata" in o && t(9, b = o.moldata), "molviewer" in o && t(10, A = o.molviewer), "errors" in o && t(11, S = o.errors); }, [ - s, + n, f, - _, - x, - h, u, - E, + y, + h, + _, + E, c, C, b, A, - S + S, + s ]; } class File_1 extends SvelteComponent$9 { @@ -26690,7 +26693,8 @@ class File_1 extends SvelteComponent$9 { confidenceLabel: 7, representations: 8, moldata: 9, - errors: 10 + molviewer: 10, + errors: 11 }); } } @@ -26730,41 +26734,41 @@ const RE_SPACE_NAME = /^[^\/]*\/[^\/]*$/, RE_SPACE_DOMAIN = /.*hf\.space\/{0,1}$ async function process_endpoint(r, e) { const t = {}; e && (t.Authorization = `Bearer ${e}`); - const s = r.trim(); - if (RE_SPACE_NAME.test(s)) + const n = r.trim(); + if (RE_SPACE_NAME.test(n)) try { const f = await fetch( - `https://huggingface.co/api/spaces/${s}/host`, + `https://huggingface.co/api/spaces/${n}/host`, { headers: t } ); if (f.status !== 200) throw new Error("Space metadata could not be loaded."); - const _ = (await f.json()).host; + const u = (await f.json()).host; return { space_id: r, - ...determine_protocol(_) + ...determine_protocol(u) }; } catch (f) { throw new Error("Space metadata could not be loaded." + f.message); } - if (RE_SPACE_DOMAIN.test(s)) { - const { ws_protocol: f, http_protocol: _, host: x } = determine_protocol(s); + if (RE_SPACE_DOMAIN.test(n)) { + const { ws_protocol: f, http_protocol: u, host: y } = determine_protocol(n); return { - space_id: x.replace(".hf.space", ""), + space_id: y.replace(".hf.space", ""), ws_protocol: f, - http_protocol: _, - host: x + http_protocol: u, + host: y }; } return { space_id: !1, - ...determine_protocol(s) + ...determine_protocol(n) }; } function map_names_to_ids(r) { let e = {}; - return r.forEach(({ api_name: t }, s) => { - t && (e[t] = s); + return r.forEach(({ api_name: t }, n) => { + t && (e[t] = n); }), e; } const RE_DISABLED_DISCUSSION = /^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/; @@ -26785,10 +26789,10 @@ function normalise_file(r, e, t) { if (r == null) return null; if (Array.isArray(r)) { - const s = []; + const n = []; for (const f of r) - f == null ? s.push(null) : s.push(normalise_file(f, e, t)); - return s; + f == null ? n.push(null) : n.push(normalise_file(f, e, t)); + return n; } return r.is_stream ? t == null ? new FileData({ ...r, @@ -26813,16 +26817,16 @@ function get_fetchable_url_or_file(r, e, t) { return r == null ? t ? `/proxy=${t}file=` : `${e}/file=` : is_url(r) ? r : t ? `/proxy=${t}file=${r}` : `${e}/file=${r}`; } async function upload(r, e, t = upload_files) { - let s = (Array.isArray(r) ? r : [r]).map( + let n = (Array.isArray(r) ? r : [r]).map( (f) => f.blob ); return await Promise.all( - await t(e, s).then( + await t(e, n).then( async (f) => { if (f.error) throw new Error(f.error); - return f.files ? f.files.map((_, x) => { - const h = new FileData({ ...r[x], path: _ }); + return f.files ? f.files.map((u, y) => { + const h = new FileData({ ...r[y], path: u }); return normalise_file(h, e, null); }) : []; } @@ -26831,7 +26835,7 @@ async function upload(r, e, t = upload_files) { } async function prepare_files(r, e) { return r.map( - (t, s) => new FileData({ + (t, n) => new FileData({ path: t.name, orig_name: t.name, blob: t, @@ -26845,25 +26849,25 @@ class FileData { constructor({ path: e, url: t, - orig_name: s, + orig_name: n, size: f, - blob: _, - is_stream: x, + blob: u, + is_stream: y, mime_type: h, - alt_text: u + alt_text: _ }) { - this.path = e, this.url = t, this.orig_name = s, this.size = f, this.blob = t ? void 0 : _, this.is_stream = x, this.mime_type = h, this.alt_text = u; + this.path = e, this.url = t, this.orig_name = n, this.size = f, this.blob = t ? void 0 : u, this.is_stream = y, this.mime_type = h, this.alt_text = _; } } const QUEUE_FULL_MSG = "This application is too busy. Keep trying!", BROKEN_CONNECTION_MSG = "Connection errored out."; let NodeBlob; function api_factory(r, e) { - return { post_data: t, upload_files: s, client: f, handle_blob: _ }; - async function t(x, h, u) { + return { post_data: t, upload_files: n, client: f, handle_blob: u }; + async function t(y, h, _) { const E = { "Content-Type": "application/json" }; - u && (E.Authorization = `Bearer ${u}`); + _ && (E.Authorization = `Bearer ${_}`); try { - var c = await r(x, { + var c = await r(y, { method: "POST", body: JSON.stringify(h), headers: E @@ -26873,19 +26877,19 @@ function api_factory(r, e) { } return [await c.json(), c.status]; } - async function s(x, h, u) { + async function n(y, h, _) { const E = {}; - u && (E.Authorization = `Bearer ${u}`); + _ && (E.Authorization = `Bearer ${_}`); const c = 1e3, C = []; for (let A = 0; A < h.length; A += c) { - const S = h.slice(A, A + c), n = new FormData(); + const S = h.slice(A, A + c), s = new FormData(); S.forEach((w) => { - n.append("files", w); + s.append("files", w); }); try { - var b = await r(`${x}/upload`, { + var b = await r(`${y}/upload`, { method: "POST", - body: n, + body: s, headers: E }); } catch { @@ -26896,23 +26900,23 @@ function api_factory(r, e) { } return { files: C }; } - async function f(x, h = { normalise_files: !0 }) { - return new Promise(async (u) => { + async function f(y, h = { normalise_files: !0 }) { + return new Promise(async (_) => { const { status_callback: E, hf_token: c, normalise_files: C } = h, b = { predict: D, - submit: R, + submit: I, view_api: P, - component_server: B + component_server: z }, A = C ?? !0; if ((typeof window > "u" || !("WebSocket" in window)) && !global.Websocket) { - const z = await import("./wrapper-98f94c21-f7f71f53.js"); - NodeBlob = (await import("./__vite-browser-external-2447137e.js")).Blob, global.WebSocket = z.WebSocket; + const B = await import("./wrapper-98f94c21-f7f71f53.js"); + NodeBlob = (await import("./__vite-browser-external-2447137e.js")).Blob, global.WebSocket = B.WebSocket; } - const { ws_protocol: S, http_protocol: n, host: o, space_id: w } = await process_endpoint(x, c), p = Math.random().toString(36).substring(2), v = {}; + const { ws_protocol: S, http_protocol: s, host: o, space_id: w } = await process_endpoint(y, c), p = Math.random().toString(36).substring(2), v = {}; let a, l = {}, g = !1; c && w && (g = await get_jwt(w, c)); - async function M(z) { - if (a = z, l = map_names_to_ids((z == null ? void 0 : z.dependencies) || []), a.auth_required) + async function M(B) { + if (a = B, l = map_names_to_ids((B == null ? void 0 : B.dependencies) || []), a.auth_required) return { config: a, ...b @@ -26928,16 +26932,16 @@ function api_factory(r, e) { }; } let L; - async function T(z) { - if (E && E(z), z.status === "running") + async function T(B) { + if (E && E(B), B.status === "running") try { a = await resolve_config( r, - `${n}//${o}`, + `${s}//${o}`, c ); const F = await M(a); - u(F); + _(F); } catch (F) { console.error(F), E && E({ status: "error", @@ -26950,13 +26954,13 @@ function api_factory(r, e) { try { a = await resolve_config( r, - `${n}//${o}`, + `${s}//${o}`, c ); - const z = await M(a); - u(z); - } catch (z) { - console.error(z), w ? check_space_status( + const B = await M(a); + _(B); + } catch (B) { + console.error(B), w ? check_space_status( w, RE_SPACE_NAME.test(w) ? "space_name" : "subdomain", T @@ -26967,12 +26971,12 @@ function api_factory(r, e) { detail: "NOT_FOUND" }); } - function D(z, F, N) { + function D(B, F, N) { let $ = !1, k = !1, G; - if (typeof z == "number") - G = a.dependencies[z]; + if (typeof B == "number") + G = a.dependencies[B]; else { - const H = z.replace(/^\//, ""); + const H = B.replace(/^\//, ""); G = a.dependencies[l[H]]; } if (G.types.continuous) @@ -26980,40 +26984,40 @@ function api_factory(r, e) { "Cannot call predict on this function as it may run forever. Use submit instead" ); return new Promise((H, U) => { - const V = R(z, F, N); + const V = I(B, F, N); let Q; - V.on("data", (oe) => { - k && (V.destroy(), H(oe)), $ = !0, Q = oe; - }).on("status", (oe) => { - oe.stage === "error" && U(oe), oe.stage === "complete" && (k = !0, $ && (V.destroy(), H(Q))); + V.on("data", (ae) => { + k && (V.destroy(), H(ae)), $ = !0, Q = ae; + }).on("status", (ae) => { + ae.stage === "error" && U(ae), ae.stage === "complete" && (k = !0, $ && (V.destroy(), H(Q))); }); }); } - function R(z, F, N) { + function I(B, F, N) { let $, k; - if (typeof z == "number") - $ = z, k = L.unnamed_endpoints[$]; + if (typeof B == "number") + $ = B, k = L.unnamed_endpoints[$]; else { - const ae = z.replace(/^\//, ""); - $ = l[ae], k = L.named_endpoints[z.trim()]; + const se = B.replace(/^\//, ""); + $ = l[se], k = L.named_endpoints[B.trim()]; } if (typeof $ != "number") throw new Error( "There is no endpoint matching that name of fn_index matching that number." ); let G, H, U = a.protocol ?? "sse"; - const V = typeof z == "number" ? "/predict" : z; - let Q, oe = null, ee = !1; - const ne = {}; + const V = typeof B == "number" ? "/predict" : B; + let Q, ae = null, oe = !1; + const q = {}; let me = ""; - typeof window < "u" && (me = new URLSearchParams(window.location.search).toString()), _( - `${n}//${resolve_root(o, a.path, !0)}`, + typeof window < "u" && (me = new URLSearchParams(window.location.search).toString()), u( + `${s}//${resolve_root(o, a.path, !0)}`, F, k, c - ).then((ae) => { - if (Q = { data: ae || [], event_data: N, fn_index: $ }, skip_queue($, a)) - se({ + ).then((se) => { + if (Q = { data: se || [], event_data: N, fn_index: $ }, skip_queue($, a)) + ne({ type: "status", endpoint: V, stage: "pending", @@ -27021,7 +27025,7 @@ function api_factory(r, e) { fn_index: $, time: /* @__PURE__ */ new Date() }), t( - `${n}//${resolve_root(o, a.path, !0)}/run${V.startsWith("/") ? V : `/${V}`}${me ? "?" + me : ""}`, + `${s}//${resolve_root(o, a.path, !0)}/run${V.startsWith("/") ? V : `/${V}`}${me ? "?" + me : ""}`, { ...Q, session_hash: p @@ -27034,13 +27038,13 @@ function api_factory(r, e) { a.root, a.root_url ) : we.data; - ke == 200 ? (se({ + ke == 200 ? (ne({ type: "data", endpoint: V, fn_index: $, data: Ue, time: /* @__PURE__ */ new Date() - }), se({ + }), ne({ type: "status", endpoint: V, fn_index: $, @@ -27048,7 +27052,7 @@ function api_factory(r, e) { eta: we.average_duration, queue: !1, time: /* @__PURE__ */ new Date() - })) : se({ + })) : ne({ type: "status", stage: "error", endpoint: V, @@ -27058,7 +27062,7 @@ function api_factory(r, e) { time: /* @__PURE__ */ new Date() }); }).catch((we) => { - se({ + ne({ type: "status", stage: "error", message: we.message, @@ -27069,7 +27073,7 @@ function api_factory(r, e) { }); }); else if (U == "ws") { - se({ + ne({ type: "status", stage: "pending", queue: !0, @@ -27084,7 +27088,7 @@ function api_factory(r, e) { )} /queue/join${me ? "?" + me : ""}`); g && we.searchParams.set("__sign", g), G = e(we), G.onclose = (ke) => { - ke.wasClean || se({ + ke.wasClean || ne({ type: "status", stage: "error", broken: !0, @@ -27099,8 +27103,8 @@ function api_factory(r, e) { Ue, v[$] ); - if (Ne === "update" && Be && !ee) - se({ + if (Ne === "update" && Be && !oe) + ne({ type: "status", endpoint: V, fn_index: $, @@ -27111,13 +27115,13 @@ function api_factory(r, e) { G.send(JSON.stringify({ fn_index: $, session_hash: p })); return; } else - Ne === "data" ? G.send(JSON.stringify({ ...Q, session_hash: p })) : Ne === "complete" ? ee = Be : Ne === "log" ? se({ + Ne === "data" ? G.send(JSON.stringify({ ...Q, session_hash: p })) : Ne === "complete" ? oe = Be : Ne === "log" ? ne({ type: "log", log: ue.log, level: ue.level, endpoint: V, fn_index: $ - }) : Ne === "generating" && se({ + }) : Ne === "generating" && ne({ type: "status", time: /* @__PURE__ */ new Date(), ...Be, @@ -27126,7 +27130,7 @@ function api_factory(r, e) { endpoint: V, fn_index: $ }); - ue && (se({ + ue && (ne({ type: "data", time: /* @__PURE__ */ new Date(), data: A ? transform_output( @@ -27137,10 +27141,10 @@ function api_factory(r, e) { ) : ue.data, endpoint: V, fn_index: $ - }), ee && (se({ + }), oe && (ne({ type: "status", time: /* @__PURE__ */ new Date(), - ...ee, + ...oe, stage: Be == null ? void 0 : Be.stage, queue: !0, endpoint: V, @@ -27151,7 +27155,7 @@ function api_factory(r, e) { () => G.send(JSON.stringify({ hash: p })) ); } else { - se({ + ne({ type: "status", stage: "pending", queue: !0, @@ -27164,7 +27168,7 @@ function api_factory(r, e) { session_hash: p }).toString(); let we = new URL( - `${n}//${resolve_root( + `${s}//${resolve_root( o, a.path, !0 @@ -27175,8 +27179,8 @@ function api_factory(r, e) { Ue, v[$] ); - if (Ne === "update" && Be && !ee) - se({ + if (Ne === "update" && Be && !oe) + ne({ type: "status", endpoint: V, fn_index: $, @@ -27184,9 +27188,9 @@ function api_factory(r, e) { ...Be }), Be.stage === "error" && H.close(); else if (Ne === "data") { - oe = Ue.event_id; + ae = Ue.event_id; let [ye, ge] = await t( - `${n}//${resolve_root( + `${s}//${resolve_root( o, a.path, !0 @@ -27194,11 +27198,11 @@ function api_factory(r, e) { { ...Q, session_hash: p, - event_id: oe + event_id: ae }, c ); - ge !== 200 && (se({ + ge !== 200 && (ne({ type: "status", stage: "error", message: BROKEN_CONNECTION_MSG, @@ -27208,13 +27212,13 @@ function api_factory(r, e) { time: /* @__PURE__ */ new Date() }), H.close()); } else - Ne === "complete" ? ee = Be : Ne === "log" ? se({ + Ne === "complete" ? oe = Be : Ne === "log" ? ne({ type: "log", log: ue.log, level: ue.level, endpoint: V, fn_index: $ - }) : Ne === "generating" && se({ + }) : Ne === "generating" && ne({ type: "status", time: /* @__PURE__ */ new Date(), ...Be, @@ -27223,7 +27227,7 @@ function api_factory(r, e) { endpoint: V, fn_index: $ }); - ue && (se({ + ue && (ne({ type: "data", time: /* @__PURE__ */ new Date(), data: A ? transform_output( @@ -27234,10 +27238,10 @@ function api_factory(r, e) { ) : ue.data, endpoint: V, fn_index: $ - }), ee && (se({ + }), oe && (ne({ type: "status", time: /* @__PURE__ */ new Date(), - ...ee, + ...oe, stage: Be == null ? void 0 : Be.stage, queue: !0, endpoint: V, @@ -27246,27 +27250,27 @@ function api_factory(r, e) { }; } }); - function se(ae) { - const we = ne[ae.type] || []; - we == null || we.forEach((ke) => ke(ae)); + function ne(se) { + const we = q[se.type] || []; + we == null || we.forEach((ke) => ke(se)); } - function fe(ae, pe) { - const we = ne, ke = we[ae] || []; - return we[ae] = ke, ke == null || ke.push(pe), { on: fe, off: Ce, cancel: Me, destroy: Te }; + function fe(se, pe) { + const we = q, ke = we[se] || []; + return we[se] = ke, ke == null || ke.push(pe), { on: fe, off: Ce, cancel: Me, destroy: Te }; } - function Ce(ae, pe) { - const we = ne; - let ke = we[ae] || []; - return ke = ke == null ? void 0 : ke.filter((Ue) => Ue !== pe), we[ae] = ke, { on: fe, off: Ce, cancel: Me, destroy: Te }; + function Ce(se, pe) { + const we = q; + let ke = we[se] || []; + return ke = ke == null ? void 0 : ke.filter((Ue) => Ue !== pe), we[se] = ke, { on: fe, off: Ce, cancel: Me, destroy: Te }; } async function Me() { - const ae = { + const se = { stage: "complete", queue: !1, time: /* @__PURE__ */ new Date() }; - ee = ae, se({ - ...ae, + oe = se, ne({ + ...se, type: "status", endpoint: V, fn_index: $ @@ -27274,10 +27278,10 @@ function api_factory(r, e) { let pe = {}; U === "ws" ? (G && G.readyState === 0 ? G.addEventListener("open", () => { G.close(); - }) : G.close(), pe = { fn_index: $, session_hash: p }) : (H.close(), pe = { event_id: oe }); + }) : G.close(), pe = { fn_index: $, session_hash: p }) : (H.close(), pe = { event_id: ae }); try { await r( - `${n}//${resolve_root( + `${s}//${resolve_root( o, a.path, !0 @@ -27295,9 +27299,9 @@ function api_factory(r, e) { } } function Te() { - for (const ae in ne) - ne[ae].forEach((pe) => { - Ce(ae, pe); + for (const se in q) + q[se].forEach((pe) => { + Ce(se, pe); }); } return { @@ -27307,14 +27311,14 @@ function api_factory(r, e) { destroy: Te }; } - async function B(z, F, N) { + async function z(B, F, N) { var $; const k = { "Content-Type": "application/json" }; c && (k.Authorization = `Bearer ${c}`); let G, H = a.components.find( - (Q) => Q.id === z + (Q) => Q.id === B ); - ($ = H == null ? void 0 : H.props) != null && $.root_url ? G = H.props.root_url : G = `${n}//${resolve_root( + ($ = H == null ? void 0 : H.props) != null && $.root_url ? G = H.props.root_url : G = `${s}//${resolve_root( o, a.path, !0 @@ -27325,7 +27329,7 @@ function api_factory(r, e) { method: "POST", body: JSON.stringify({ data: N, - component_id: z, + component_id: B, fn_name: F, session_hash: p }), @@ -27338,52 +27342,52 @@ function api_factory(r, e) { ); return await U.json(); } - async function P(z) { + async function P(B) { if (L) return L; const F = { "Content-Type": "application/json" }; c && (F.Authorization = `Bearer ${c}`); let N; - if (semiver(z.version || "2.0.0", "3.30") < 0 ? N = await r( + if (semiver(B.version || "2.0.0", "3.30") < 0 ? N = await r( "https://gradio-space-api-fetcher-v2.hf.space/api", { method: "POST", body: JSON.stringify({ serialize: !1, - config: JSON.stringify(z) + config: JSON.stringify(B) }), headers: F } - ) : N = await r(`${z.root}/info`, { + ) : N = await r(`${B.root}/info`, { headers: F }), !N.ok) throw new Error(BROKEN_CONNECTION_MSG); let $ = await N.json(); - return "api" in $ && ($ = $.api), $.named_endpoints["/predict"] && !$.unnamed_endpoints[0] && ($.unnamed_endpoints[0] = $.named_endpoints["/predict"]), transform_api_info($, z, l); + return "api" in $ && ($ = $.api), $.named_endpoints["/predict"] && !$.unnamed_endpoints[0] && ($.unnamed_endpoints[0] = $.named_endpoints["/predict"]), transform_api_info($, B, l); } }); } - async function _(x, h, u, E) { + async function u(y, h, _, E) { const c = await walk_and_store_blobs( h, void 0, [], !0, - u + _ ); return Promise.all( c.map(async ({ path: C, blob: b, type: A }) => { if (b) { - const S = (await s(x, [b], E)).files[0]; + const S = (await n(y, [b], E)).files[0]; return { path: C, file_url: S, type: A, name: b == null ? void 0 : b.name }; } return { path: C, type: A }; }) - ).then((C) => (C.forEach(({ path: b, file_url: A, type: S, name: n }) => { + ).then((C) => (C.forEach(({ path: b, file_url: A, type: S, name: s }) => { if (S === "Gallery") update_object(h, A, b); else if (A) { - const o = new FileData({ path: A, orig_name: n }); + const o = new FileData({ path: A, orig_name: s }); update_object(h, o, b); } }), h)); @@ -27393,13 +27397,13 @@ const { post_data, upload_files, client, handle_blob } = api_factory( fetch, (...r) => new WebSocket(...r) ); -function transform_output(r, e, t, s) { - return r.map((f, _) => { - var x, h, u, E; - return ((h = (x = e == null ? void 0 : e.returns) == null ? void 0 : x[_]) == null ? void 0 : h.component) === "File" ? normalise_file(f, t, s) : ((E = (u = e == null ? void 0 : e.returns) == null ? void 0 : u[_]) == null ? void 0 : E.component) === "Gallery" ? f.map((c) => Array.isArray(c) ? [normalise_file(c[0], t, s), c[1]] : [normalise_file(c, t, s), null]) : typeof f == "object" && f.path ? normalise_file(f, t, s) : f; +function transform_output(r, e, t, n) { + return r.map((f, u) => { + var y, h, _, E; + return ((h = (y = e == null ? void 0 : e.returns) == null ? void 0 : y[u]) == null ? void 0 : h.component) === "File" ? normalise_file(f, t, n) : ((E = (_ = e == null ? void 0 : e.returns) == null ? void 0 : _[u]) == null ? void 0 : E.component) === "Gallery" ? f.map((c) => Array.isArray(c) ? [normalise_file(c[0], t, n), c[1]] : [normalise_file(c, t, n), null]) : typeof f == "object" && f.path ? normalise_file(f, t, n) : f; }); } -function get_type(r, e, t, s) { +function get_type(r, e, t, n) { switch (r.type) { case "string": return "string"; @@ -27413,32 +27417,32 @@ function get_type(r, e, t, s) { if (t === "ListStringSerializable") return "string[]"; if (e === "Image") - return s === "parameter" ? "Blob | File | Buffer" : "string"; + return n === "parameter" ? "Blob | File | Buffer" : "string"; if (t === "FileSerializable") - return (r == null ? void 0 : r.type) === "array" ? s === "parameter" ? "(Blob | File | Buffer)[]" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]" : s === "parameter" ? "Blob | File | Buffer" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}"; + return (r == null ? void 0 : r.type) === "array" ? n === "parameter" ? "(Blob | File | Buffer)[]" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]" : n === "parameter" ? "Blob | File | Buffer" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}"; if (t === "GallerySerializable") - return s === "parameter" ? "[(Blob | File | Buffer), (string | null)][]" : "[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]"; + return n === "parameter" ? "[(Blob | File | Buffer), (string | null)][]" : "[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]"; } function get_description(r, e) { return e === "GallerySerializable" ? "array of [file, label] tuples" : e === "ListStringSerializable" ? "array of strings" : e === "FileSerializable" ? "array of files or single file" : r.description; } function transform_api_info(r, e, t) { - const s = { + const n = { named_endpoints: {}, unnamed_endpoints: {} }; for (const f in r) { - const _ = r[f]; - for (const x in _) { - const h = e.dependencies[x] ? x : t[x.replace("/", "")], u = _[x]; - s[f][x] = {}, s[f][x].parameters = {}, s[f][x].returns = {}, s[f][x].type = e.dependencies[h].types, s[f][x].parameters = u.parameters.map( + const u = r[f]; + for (const y in u) { + const h = e.dependencies[y] ? y : t[y.replace("/", "")], _ = u[y]; + n[f][y] = {}, n[f][y].parameters = {}, n[f][y].returns = {}, n[f][y].type = e.dependencies[h].types, n[f][y].parameters = _.parameters.map( ({ label: E, component: c, type: C, serializer: b }) => ({ label: E, component: c, type: get_type(C, c, b, "parameter"), description: get_description(C, b) }) - ), s[f][x].returns = u.returns.map( + ), n[f][y].returns = _.returns.map( ({ label: E, component: c, type: C, serializer: b }) => ({ label: E, component: c, @@ -27448,7 +27452,7 @@ function transform_api_info(r, e, t) { ); } } - return s; + return n; } async function get_jwt(r, e) { try { @@ -27466,24 +27470,24 @@ function update_object(r, e, t) { r = r[t.shift()]; r[t.shift()] = e; } -async function walk_and_store_blobs(r, e = void 0, t = [], s = !1, f = void 0) { +async function walk_and_store_blobs(r, e = void 0, t = [], n = !1, f = void 0) { if (Array.isArray(r)) { - let _ = []; + let u = []; return await Promise.all( - r.map(async (x, h) => { - var u; + r.map(async (y, h) => { + var _; let E = t.slice(); E.push(h); const c = await walk_and_store_blobs( r[h], - s ? ((u = f == null ? void 0 : f.parameters[h]) == null ? void 0 : u.component) || void 0 : e, + n ? ((_ = f == null ? void 0 : f.parameters[h]) == null ? void 0 : _.component) || void 0 : e, E, !1, f ); - _ = _.concat(c); + u = u.concat(c); }) - ), _; + ), u; } else { if (globalThis.Buffer && r instanceof globalThis.Buffer) return [ @@ -27494,13 +27498,13 @@ async function walk_and_store_blobs(r, e = void 0, t = [], s = !1, f = void 0) { } ]; if (typeof r == "object") { - let _ = []; - for (let x in r) - if (r.hasOwnProperty(x)) { + let u = []; + for (let y in r) + if (r.hasOwnProperty(y)) { let h = t.slice(); - h.push(x), _ = _.concat( + h.push(y), u = u.concat( await walk_and_store_blobs( - r[x], + r[y], void 0, h, !1, @@ -27508,36 +27512,36 @@ async function walk_and_store_blobs(r, e = void 0, t = [], s = !1, f = void 0) { ) ); } - return _; + return u; } } return []; } function skip_queue(r, e) { - var t, s, f, _; - return !(((s = (t = e == null ? void 0 : e.dependencies) == null ? void 0 : t[r]) == null ? void 0 : s.queue) === null ? e.enable_queue : (_ = (f = e == null ? void 0 : e.dependencies) == null ? void 0 : f[r]) != null && _.queue) || !1; + var t, n, f, u; + return !(((n = (t = e == null ? void 0 : e.dependencies) == null ? void 0 : t[r]) == null ? void 0 : n.queue) === null ? e.enable_queue : (u = (f = e == null ? void 0 : e.dependencies) == null ? void 0 : f[r]) != null && u.queue) || !1; } async function resolve_config(r, e, t) { - const s = {}; - if (t && (s.Authorization = `Bearer ${t}`), typeof window < "u" && window.gradio_config && location.origin !== "http://localhost:9876" && !window.gradio_config.dev_mode) { - const f = window.gradio_config.root, _ = window.gradio_config; - return _.root = resolve_root(e, _.root, !1), { ..._, path: f }; + const n = {}; + if (t && (n.Authorization = `Bearer ${t}`), typeof window < "u" && window.gradio_config && location.origin !== "http://localhost:9876" && !window.gradio_config.dev_mode) { + const f = window.gradio_config.root, u = window.gradio_config; + return u.root = resolve_root(e, u.root, !1), { ...u, path: f }; } else if (e) { let f = await r(`${e}/config`, { - headers: s + headers: n }); if (f.status === 200) { - const _ = await f.json(); - return _.path = _.path ?? "", _.root = e, _; + const u = await f.json(); + return u.path = u.path ?? "", u.root = e, u; } throw new Error("Could not get config."); } throw new Error("No config or app endpoint found"); } async function check_space_status(r, e, t) { - let s = e === "subdomain" ? `https://huggingface.co/api/spaces/by-subdomain/${r}` : `https://huggingface.co/api/spaces/${r}`, f, _; + let n = e === "subdomain" ? `https://huggingface.co/api/spaces/by-subdomain/${r}` : `https://huggingface.co/api/spaces/${r}`, f, u; try { - if (f = await fetch(s), _ = f.status, _ !== 200) + if (f = await fetch(n), u = f.status, u !== 200) throw new Error(); f = await f.json(); } catch { @@ -27549,20 +27553,20 @@ async function check_space_status(r, e, t) { }); return; } - if (!f || _ !== 200) + if (!f || u !== 200) return; const { - runtime: { stage: x }, + runtime: { stage: y }, id: h } = f; - switch (x) { + switch (y) { case "STOPPED": case "SLEEPING": t({ status: "sleeping", load_status: "pending", message: "Space is asleep. Waking it up...", - detail: x + detail: y }), setTimeout(() => { check_space_status(r, e, t); }, 1e3); @@ -27572,7 +27576,7 @@ async function check_space_status(r, e, t) { status: "paused", load_status: "error", message: "This space has been paused by the author. If you would like to try this demo, consider duplicating the space.", - detail: x, + detail: y, discussions_enabled: await discussions_enabled(h) }); break; @@ -27582,7 +27586,7 @@ async function check_space_status(r, e, t) { status: "running", load_status: "complete", message: "", - detail: x + detail: y }); break; case "BUILDING": @@ -27590,7 +27594,7 @@ async function check_space_status(r, e, t) { status: "building", load_status: "pending", message: "Space is building...", - detail: x + detail: y }), setTimeout(() => { check_space_status(r, e, t); }, 1e3); @@ -27600,7 +27604,7 @@ async function check_space_status(r, e, t) { status: "space_error", load_status: "error", message: "This space is experiencing an issue.", - detail: x, + detail: y, discussions_enabled: await discussions_enabled(h) }); break; @@ -27715,8 +27719,8 @@ function safe_not_equal$9(r, e) { } function subscribe(r, ...e) { if (r == null) { - for (const s of e) - s(void 0); + for (const n of e) + n(void 0); return noop$5; } const t = r.subscribe(...e); @@ -27749,114 +27753,114 @@ function readable(r, e) { } function writable(r, e = noop$5) { let t; - const s = /* @__PURE__ */ new Set(); + const n = /* @__PURE__ */ new Set(); function f(h) { if (safe_not_equal$9(r, h) && (r = h, t)) { - const u = !subscriber_queue.length; - for (const E of s) + const _ = !subscriber_queue.length; + for (const E of n) E[1](), subscriber_queue.push(E, r); - if (u) { + if (_) { for (let E = 0; E < subscriber_queue.length; E += 2) subscriber_queue[E][0](subscriber_queue[E + 1]); subscriber_queue.length = 0; } } } - function _(h) { + function u(h) { f(h(r)); } - function x(h, u = noop$5) { - const E = [h, u]; - return s.add(E), s.size === 1 && (t = e(f, _) || noop$5), h(r), () => { - s.delete(E), s.size === 0 && t && (t(), t = null); + function y(h, _ = noop$5) { + const E = [h, _]; + return n.add(E), n.size === 1 && (t = e(f, u) || noop$5), h(r), () => { + n.delete(E), n.size === 0 && t && (t(), t = null); }; } - return { set: f, update: _, subscribe: x }; + return { set: f, update: u, subscribe: y }; } function derived(r, e, t) { - const s = !Array.isArray(r), f = s ? [r] : r; + const n = !Array.isArray(r), f = n ? [r] : r; if (!f.every(Boolean)) throw new Error("derived() expects stores as input, got a falsy value"); - const _ = e.length < 2; - return readable(t, (x, h) => { - let u = !1; + const u = e.length < 2; + return readable(t, (y, h) => { + let _ = !1; const E = []; let c = 0, C = noop$5; const b = () => { if (c) return; C(); - const S = e(s ? E[0] : E, x, h); - _ ? x(S) : C = is_function(S) ? S : noop$5; + const S = e(n ? E[0] : E, y, h); + u ? y(S) : C = is_function(S) ? S : noop$5; }, A = f.map( - (S, n) => subscribe( + (S, s) => subscribe( S, (o) => { - E[n] = o, c &= ~(1 << n), u && b(); + E[s] = o, c &= ~(1 << s), _ && b(); }, () => { - c |= 1 << n; + c |= 1 << s; } ) ); - return u = !0, b(), function() { - run_all$2(A), C(), u = !1; + return _ = !0, b(), function() { + run_all$2(A), C(), _ = !1; }; }); } function is_date(r) { return Object.prototype.toString.call(r) === "[object Date]"; } -function tick_spring(r, e, t, s) { +function tick_spring(r, e, t, n) { if (typeof t == "number" || is_date(t)) { - const f = s - t, _ = (t - e) / (r.dt || 1 / 60), x = r.opts.stiffness * f, h = r.opts.damping * _, u = (x - h) * r.inv_mass, E = (_ + u) * r.dt; - return Math.abs(E) < r.opts.precision && Math.abs(f) < r.opts.precision ? s : (r.settled = !1, is_date(t) ? new Date(t.getTime() + E) : t + E); + const f = n - t, u = (t - e) / (r.dt || 1 / 60), y = r.opts.stiffness * f, h = r.opts.damping * u, _ = (y - h) * r.inv_mass, E = (u + _) * r.dt; + return Math.abs(E) < r.opts.precision && Math.abs(f) < r.opts.precision ? n : (r.settled = !1, is_date(t) ? new Date(t.getTime() + E) : t + E); } else { if (Array.isArray(t)) return t.map( - (f, _) => tick_spring(r, e[_], t[_], s[_]) + (f, u) => tick_spring(r, e[u], t[u], n[u]) ); if (typeof t == "object") { const f = {}; - for (const _ in t) - f[_] = tick_spring(r, e[_], t[_], s[_]); + for (const u in t) + f[u] = tick_spring(r, e[u], t[u], n[u]); return f; } else throw new Error(`Cannot spring ${typeof t} values`); } } function spring(r, e = {}) { - const t = writable(r), { stiffness: s = 0.15, damping: f = 0.8, precision: _ = 0.01 } = e; - let x, h, u, E = r, c = r, C = 1, b = 0, A = !1; + const t = writable(r), { stiffness: n = 0.15, damping: f = 0.8, precision: u = 0.01 } = e; + let y, h, _, E = r, c = r, C = 1, b = 0, A = !1; function S(o, w = {}) { c = o; - const p = u = {}; - return r == null || w.hard || n.stiffness >= 1 && n.damping >= 1 ? (A = !0, x = now(), E = o, t.set(r = c), Promise.resolve()) : (w.soft && (b = 1 / ((w.soft === !0 ? 0.5 : +w.soft) * 60), C = 0), h || (x = now(), A = !1, h = loop((v) => { + const p = _ = {}; + return r == null || w.hard || s.stiffness >= 1 && s.damping >= 1 ? (A = !0, y = now(), E = o, t.set(r = c), Promise.resolve()) : (w.soft && (b = 1 / ((w.soft === !0 ? 0.5 : +w.soft) * 60), C = 0), h || (y = now(), A = !1, h = loop((v) => { if (A) return A = !1, h = null, !1; C = Math.min(C + b, 1); const a = { inv_mass: C, - opts: n, + opts: s, settled: !0, - dt: (v - x) * 60 / 1e3 + dt: (v - y) * 60 / 1e3 }, l = tick_spring(a, E, r, c); - return x = v, E = r, t.set(r = l), a.settled && (h = null), !a.settled; + return y = v, E = r, t.set(r = l), a.settled && (h = null), !a.settled; })), new Promise((v) => { h.promise.then(() => { - p === u && v(); + p === _ && v(); }); })); } - const n = { + const s = { set: S, update: (o, w) => S(o(c, r), w), subscribe: t.subscribe, - stiffness: s, + stiffness: n, damping: f, - precision: _ + precision: u }; - return n; + return s; } var isMergeableObject = function r(e) { return isNonNullObject(e) && !isSpecial(e); @@ -27879,8 +27883,8 @@ function cloneUnlessOtherwiseSpecified(r, e) { return e.clone !== !1 && e.isMergeableObject(r) ? deepmerge(emptyTarget(r), r, e) : r; } function defaultArrayMerge(r, e, t) { - return r.concat(e).map(function(s) { - return cloneUnlessOtherwiseSpecified(s, t); + return r.concat(e).map(function(n) { + return cloneUnlessOtherwiseSpecified(n, t); }); } function getMergeFunction(r, e) { @@ -27908,33 +27912,33 @@ function propertyIsUnsafe(r, e) { return propertyIsOnObject(r, e) && !(Object.hasOwnProperty.call(r, e) && Object.propertyIsEnumerable.call(r, e)); } function mergeObject(r, e, t) { - var s = {}; + var n = {}; return t.isMergeableObject(r) && getKeys(r).forEach(function(f) { - s[f] = cloneUnlessOtherwiseSpecified(r[f], t); + n[f] = cloneUnlessOtherwiseSpecified(r[f], t); }), getKeys(e).forEach(function(f) { - propertyIsUnsafe(r, f) || (propertyIsOnObject(r, f) && t.isMergeableObject(e[f]) ? s[f] = getMergeFunction(f, t)(r[f], e[f], t) : s[f] = cloneUnlessOtherwiseSpecified(e[f], t)); - }), s; + propertyIsUnsafe(r, f) || (propertyIsOnObject(r, f) && t.isMergeableObject(e[f]) ? n[f] = getMergeFunction(f, t)(r[f], e[f], t) : n[f] = cloneUnlessOtherwiseSpecified(e[f], t)); + }), n; } function deepmerge(r, e, t) { t = t || {}, t.arrayMerge = t.arrayMerge || defaultArrayMerge, t.isMergeableObject = t.isMergeableObject || isMergeableObject, t.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; - var s = Array.isArray(e), f = Array.isArray(r), _ = s === f; - return _ ? s ? t.arrayMerge(r, e, t) : mergeObject(r, e, t) : cloneUnlessOtherwiseSpecified(e, t); + var n = Array.isArray(e), f = Array.isArray(r), u = n === f; + return u ? n ? t.arrayMerge(r, e, t) : mergeObject(r, e, t) : cloneUnlessOtherwiseSpecified(e, t); } deepmerge.all = function r(e, t) { if (!Array.isArray(e)) throw new Error("first argument should be an array"); - return e.reduce(function(s, f) { - return deepmerge(s, f, t); + return e.reduce(function(n, f) { + return deepmerge(n, f, t); }, {}); }; var deepmerge_1 = deepmerge, cjs = deepmerge_1; const deepmerge$1 = /* @__PURE__ */ getDefaultExportFromCjs(cjs); var extendStatics = function(r, e) { - return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, s) { - t.__proto__ = s; - } || function(t, s) { - for (var f in s) - Object.prototype.hasOwnProperty.call(s, f) && (t[f] = s[f]); + return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, n) { + t.__proto__ = n; + } || function(t, n) { + for (var f in n) + Object.prototype.hasOwnProperty.call(n, f) && (t[f] = n[f]); }, extendStatics(r, e); }; function __extends(r, e) { @@ -27948,19 +27952,19 @@ function __extends(r, e) { } var __assign = function() { return __assign = Object.assign || function(e) { - for (var t, s = 1, f = arguments.length; s < f; s++) { - t = arguments[s]; - for (var _ in t) - Object.prototype.hasOwnProperty.call(t, _) && (e[_] = t[_]); + for (var t, n = 1, f = arguments.length; n < f; n++) { + t = arguments[n]; + for (var u in t) + Object.prototype.hasOwnProperty.call(t, u) && (e[u] = t[u]); } return e; }, __assign.apply(this, arguments); }; function __spreadArray(r, e, t) { if (t || arguments.length === 2) - for (var s = 0, f = e.length, _; s < f; s++) - (_ || !(s in e)) && (_ || (_ = Array.prototype.slice.call(e, 0, s)), _[s] = e[s]); - return r.concat(_ || Array.prototype.slice.call(e)); + for (var n = 0, f = e.length, u; n < f; n++) + (u || !(n in e)) && (u || (u = Array.prototype.slice.call(e, 0, n)), u[n] = e[n]); + return r.concat(u || Array.prototype.slice.call(e)); } typeof SuppressedError == "function" && SuppressedError; var ErrorKind; @@ -28012,13 +28016,13 @@ var SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, DATE function parseDateTimeSkeleton(r) { var e = {}; return r.replace(DATE_TIME_REGEX, function(t) { - var s = t.length; + var n = t.length; switch (t[0]) { case "G": - e.era = s === 4 ? "long" : s === 5 ? "narrow" : "short"; + e.era = n === 4 ? "long" : n === 5 ? "narrow" : "short"; break; case "y": - e.year = s === 2 ? "2-digit" : "numeric"; + e.year = n === 2 ? "2-digit" : "numeric"; break; case "Y": case "u": @@ -28030,30 +28034,30 @@ function parseDateTimeSkeleton(r) { throw new RangeError("`q/Q` (quarter) patterns are not supported"); case "M": case "L": - e.month = ["numeric", "2-digit", "short", "long", "narrow"][s - 1]; + e.month = ["numeric", "2-digit", "short", "long", "narrow"][n - 1]; break; case "w": case "W": throw new RangeError("`w/W` (week) patterns are not supported"); case "d": - e.day = ["numeric", "2-digit"][s - 1]; + e.day = ["numeric", "2-digit"][n - 1]; break; case "D": case "F": case "g": throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead"); case "E": - e.weekday = s === 4 ? "short" : s === 5 ? "narrow" : "short"; + e.weekday = n === 4 ? "short" : n === 5 ? "narrow" : "short"; break; case "e": - if (s < 4) + if (n < 4) throw new RangeError("`e..eee` (weekday) patterns are not supported"); - e.weekday = ["short", "long", "narrow", "short"][s - 4]; + e.weekday = ["short", "long", "narrow", "short"][n - 4]; break; case "c": - if (s < 4) + if (n < 4) throw new RangeError("`c..ccc` (weekday) patterns are not supported"); - e.weekday = ["short", "long", "narrow", "short"][s - 4]; + e.weekday = ["short", "long", "narrow", "short"][n - 4]; break; case "a": e.hour12 = !0; @@ -28062,32 +28066,32 @@ function parseDateTimeSkeleton(r) { case "B": throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead"); case "h": - e.hourCycle = "h12", e.hour = ["numeric", "2-digit"][s - 1]; + e.hourCycle = "h12", e.hour = ["numeric", "2-digit"][n - 1]; break; case "H": - e.hourCycle = "h23", e.hour = ["numeric", "2-digit"][s - 1]; + e.hourCycle = "h23", e.hour = ["numeric", "2-digit"][n - 1]; break; case "K": - e.hourCycle = "h11", e.hour = ["numeric", "2-digit"][s - 1]; + e.hourCycle = "h11", e.hour = ["numeric", "2-digit"][n - 1]; break; case "k": - e.hourCycle = "h24", e.hour = ["numeric", "2-digit"][s - 1]; + e.hourCycle = "h24", e.hour = ["numeric", "2-digit"][n - 1]; break; case "j": case "J": case "C": throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead"); case "m": - e.minute = ["numeric", "2-digit"][s - 1]; + e.minute = ["numeric", "2-digit"][n - 1]; break; case "s": - e.second = ["numeric", "2-digit"][s - 1]; + e.second = ["numeric", "2-digit"][n - 1]; break; case "S": case "A": throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead"); case "z": - e.timeZoneName = s < 4 ? "short" : "long"; + e.timeZoneName = n < 4 ? "short" : "long"; break; case "Z": case "O": @@ -28106,16 +28110,16 @@ function parseNumberSkeletonFromString(r) { throw new Error("Number skeleton cannot be empty"); for (var e = r.split(WHITE_SPACE_REGEX).filter(function(b) { return b.length > 0; - }), t = [], s = 0, f = e; s < f.length; s++) { - var _ = f[s], x = _.split("/"); - if (x.length === 0) + }), t = [], n = 0, f = e; n < f.length; n++) { + var u = f[n], y = u.split("/"); + if (y.length === 0) throw new Error("Invalid number skeleton"); - for (var h = x[0], u = x.slice(1), E = 0, c = u; E < c.length; E++) { + for (var h = y[0], _ = y.slice(1), E = 0, c = _; E < c.length; E++) { var C = c[E]; if (C.length === 0) throw new Error("Invalid number skeleton"); } - t.push({ stem: h, options: u }); + t.push({ stem: h, options: _ }); } return t; } @@ -28125,8 +28129,8 @@ function icuUnitToEcma(r) { var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g, INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g, CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/; function parseSignificantPrecision(r) { var e = {}; - return r[r.length - 1] === "r" ? e.roundingPriority = "morePrecision" : r[r.length - 1] === "s" && (e.roundingPriority = "lessPrecision"), r.replace(SIGNIFICANT_PRECISION_REGEX, function(t, s, f) { - return typeof f != "string" ? (e.minimumSignificantDigits = s.length, e.maximumSignificantDigits = s.length) : f === "+" ? e.minimumSignificantDigits = s.length : s[0] === "#" ? e.maximumSignificantDigits = s.length : (e.minimumSignificantDigits = s.length, e.maximumSignificantDigits = s.length + (typeof f == "string" ? f.length : 0)), ""; + return r[r.length - 1] === "r" ? e.roundingPriority = "morePrecision" : r[r.length - 1] === "s" && (e.roundingPriority = "lessPrecision"), r.replace(SIGNIFICANT_PRECISION_REGEX, function(t, n, f) { + return typeof f != "string" ? (e.minimumSignificantDigits = n.length, e.maximumSignificantDigits = n.length) : f === "+" ? e.minimumSignificantDigits = n.length : n[0] === "#" ? e.maximumSignificantDigits = n.length : (e.minimumSignificantDigits = n.length, e.maximumSignificantDigits = n.length + (typeof f == "string" ? f.length : 0)), ""; }), e; } function parseSign(r) { @@ -28188,8 +28192,8 @@ function parseNotationOptions(r) { return t || e; } function parseNumberSkeleton(r) { - for (var e = {}, t = 0, s = r; t < s.length; t++) { - var f = s[t]; + for (var e = {}, t = 0, n = r; t < n.length; t++) { + var f = n[t]; switch (f.stem) { case "percent": case "%": @@ -28222,13 +28226,13 @@ function parseNumberSkeleton(r) { e.notation = "compact", e.compactDisplay = "long"; continue; case "scientific": - e = __assign(__assign(__assign({}, e), { notation: "scientific" }), f.options.reduce(function(u, E) { - return __assign(__assign({}, u), parseNotationOptions(E)); + e = __assign(__assign(__assign({}, e), { notation: "scientific" }), f.options.reduce(function(_, E) { + return __assign(__assign({}, _), parseNotationOptions(E)); }, {})); continue; case "engineering": - e = __assign(__assign(__assign({}, e), { notation: "engineering" }), f.options.reduce(function(u, E) { - return __assign(__assign({}, u), parseNotationOptions(E)); + e = __assign(__assign(__assign({}, e), { notation: "engineering" }), f.options.reduce(function(_, E) { + return __assign(__assign({}, _), parseNotationOptions(E)); }, {})); continue; case "notation-simple": @@ -28252,7 +28256,7 @@ function parseNumberSkeleton(r) { case "integer-width": if (f.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option"); - f.options[0].replace(INTEGER_WIDTH_REGEX, function(u, E, c, C, b, A) { + f.options[0].replace(INTEGER_WIDTH_REGEX, function(_, E, c, C, b, A) { if (E) e.minimumIntegerDigits = c.length; else { @@ -28272,19 +28276,19 @@ function parseNumberSkeleton(r) { if (FRACTION_PRECISION_REGEX.test(f.stem)) { if (f.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option"); - f.stem.replace(FRACTION_PRECISION_REGEX, function(u, E, c, C, b, A) { + f.stem.replace(FRACTION_PRECISION_REGEX, function(_, E, c, C, b, A) { return c === "*" ? e.minimumFractionDigits = E.length : C && C[0] === "#" ? e.maximumFractionDigits = C.length : b && A ? (e.minimumFractionDigits = b.length, e.maximumFractionDigits = b.length + A.length) : (e.minimumFractionDigits = E.length, e.maximumFractionDigits = E.length), ""; }); - var _ = f.options[0]; - _ === "w" ? e = __assign(__assign({}, e), { trailingZeroDisplay: "stripIfInteger" }) : _ && (e = __assign(__assign({}, e), parseSignificantPrecision(_))); + var u = f.options[0]; + u === "w" ? e = __assign(__assign({}, e), { trailingZeroDisplay: "stripIfInteger" }) : u && (e = __assign(__assign({}, e), parseSignificantPrecision(u))); continue; } if (SIGNIFICANT_PRECISION_REGEX.test(f.stem)) { e = __assign(__assign({}, e), parseSignificantPrecision(f.stem)); continue; } - var x = parseSign(f.stem); - x && (e = __assign(__assign({}, e), x)); + var y = parseSign(f.stem); + y && (e = __assign(__assign({}, e), y)); var h = parseConciseScientificAndEngineeringStem(f.stem); h && (e = __assign(__assign({}, e), h)); } @@ -29628,15 +29632,15 @@ var timeData = { ] }; function getBestPattern(r, e) { - for (var t = "", s = 0; s < r.length; s++) { - var f = r.charAt(s); + for (var t = "", n = 0; n < r.length; n++) { + var f = r.charAt(n); if (f === "j") { - for (var _ = 0; s + 1 < r.length && r.charAt(s + 1) === f; ) - _++, s++; - var x = 1 + (_ & 1), h = _ < 2 ? 1 : 3 + (_ >> 1), u = "a", E = getDefaultHourSymbolFromLocale(e); + for (var u = 0; n + 1 < r.length && r.charAt(n + 1) === f; ) + u++, n++; + var y = 1 + (u & 1), h = u < 2 ? 1 : 3 + (u >> 1), _ = "a", E = getDefaultHourSymbolFromLocale(e); for ((E == "H" || E == "k") && (h = 0); h-- > 0; ) - t += u; - for (; x-- > 0; ) + t += _; + for (; y-- > 0; ) t = E + t; } else f === "J" ? t += "H" : t += f; @@ -29660,9 +29664,9 @@ function getDefaultHourSymbolFromLocale(r) { default: throw new Error("Invalid hourCycle"); } - var t = r.language, s; - t !== "root" && (s = r.maximize().region); - var f = timeData[s || ""] || timeData[t || ""] || timeData["".concat(t, "-001")] || timeData["001"]; + var t = r.language, n; + t !== "root" && (n = r.maximize().region); + var f = timeData[n || ""] || timeData[t || ""] || timeData["".concat(t, "-001")] || timeData["001"]; return f[0]; } var _a, SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*")), SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$")); @@ -29680,34 +29684,34 @@ try { } var startsWith = hasNativeStartsWith ? ( // Native - function r(e, t, s) { - return e.startsWith(t, s); + function r(e, t, n) { + return e.startsWith(t, n); } ) : ( // For IE11 - function r(e, t, s) { - return e.slice(s, s + t.length) === t; + function r(e, t, n) { + return e.slice(n, n + t.length) === t; } ), fromCodePoint = hasNativeFromCodePoint ? String.fromCodePoint : ( // IE11 function r() { for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t]; - for (var s = "", f = e.length, _ = 0, x; f > _; ) { - if (x = e[_++], x > 1114111) - throw RangeError(x + " is not a valid code point"); - s += x < 65536 ? String.fromCharCode(x) : String.fromCharCode(((x -= 65536) >> 10) + 55296, x % 1024 + 56320); + for (var n = "", f = e.length, u = 0, y; f > u; ) { + if (y = e[u++], y > 1114111) + throw RangeError(y + " is not a valid code point"); + n += y < 65536 ? String.fromCharCode(y) : String.fromCharCode(((y -= 65536) >> 10) + 55296, y % 1024 + 56320); } - return s; + return n; } ), fromEntries = ( // native hasNativeFromEntries ? Object.fromEntries : ( // Ponyfill function r(e) { - for (var t = {}, s = 0, f = e; s < f.length; s++) { - var _ = f[s], x = _[0], h = _[1]; - t[x] = h; + for (var t = {}, n = 0, f = e; n < f.length; n++) { + var u = f[n], y = u[0], h = u[1]; + t[y] = h; } return t; } @@ -29720,10 +29724,10 @@ var startsWith = hasNativeStartsWith ? ( ) : ( // IE 11 function r(e, t) { - var s = e.length; - if (!(t < 0 || t >= s)) { - var f = e.charCodeAt(t), _; - return f < 55296 || f > 56319 || t + 1 === s || (_ = e.charCodeAt(t + 1)) < 56320 || _ > 57343 ? f : (f - 55296 << 10) + (_ - 56320) + 65536; + var n = e.length; + if (!(t < 0 || t >= n)) { + var f = e.charCodeAt(t), u; + return f < 55296 || f > 56319 || t + 1 === n || (u = e.charCodeAt(t + 1)) < 56320 || u > 57343 ? f : (f - 55296 << 10) + (u - 56320) + 65536; } } ), trimStart = hasTrimStart ? ( @@ -29754,20 +29758,20 @@ var matchIdentifierAtIndex; if (REGEX_SUPPORTS_U_AND_Y) { var IDENTIFIER_PREFIX_RE_1 = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); matchIdentifierAtIndex = function(e, t) { - var s; + var n; IDENTIFIER_PREFIX_RE_1.lastIndex = t; var f = IDENTIFIER_PREFIX_RE_1.exec(e); - return (s = f[1]) !== null && s !== void 0 ? s : ""; + return (n = f[1]) !== null && n !== void 0 ? n : ""; }; } else matchIdentifierAtIndex = function(e, t) { - for (var s = []; ; ) { + for (var n = []; ; ) { var f = codePointAt(e, t); if (f === void 0 || _isWhiteSpace(f) || _isPatternSyntax(f)) break; - s.push(f), t += f >= 65536 ? 2 : 1; + n.push(f), t += f >= 65536 ? 2 : 1; } - return fromCodePoint.apply(void 0, s); + return fromCodePoint.apply(void 0, n); }; var Parser = ( /** @class */ @@ -29779,43 +29783,43 @@ var Parser = ( if (this.offset() !== 0) throw Error("parser can only be used once"); return this.parseMessage(0, "", !1); - }, r.prototype.parseMessage = function(e, t, s) { + }, r.prototype.parseMessage = function(e, t, n) { for (var f = []; !this.isEOF(); ) { - var _ = this.char(); - if (_ === 123) { - var x = this.parseArgument(e, s); - if (x.err) - return x; - f.push(x.val); + var u = this.char(); + if (u === 123) { + var y = this.parseArgument(e, n); + if (y.err) + return y; + f.push(y.val); } else { - if (_ === 125 && e > 0) + if (u === 125 && e > 0) break; - if (_ === 35 && (t === "plural" || t === "selectordinal")) { + if (u === 35 && (t === "plural" || t === "selectordinal")) { var h = this.clonePosition(); this.bump(), f.push({ type: TYPE.pound, location: createLocation(h, this.clonePosition()) }); - } else if (_ === 60 && !this.ignoreTag && this.peek() === 47) { - if (s) + } else if (u === 60 && !this.ignoreTag && this.peek() === 47) { + if (n) break; return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition())); - } else if (_ === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) { - var x = this.parseTag(e, t); - if (x.err) - return x; - f.push(x.val); + } else if (u === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) { + var y = this.parseTag(e, t); + if (y.err) + return y; + f.push(y.val); } else { - var x = this.parseLiteral(e, t); - if (x.err) - return x; - f.push(x.val); + var y = this.parseLiteral(e, t); + if (y.err) + return y; + f.push(y.val); } } } return { val: f, err: null }; }, r.prototype.parseTag = function(e, t) { - var s = this.clonePosition(); + var n = this.clonePosition(); this.bump(); var f = this.parseTagName(); if (this.bumpSpace(), this.bumpIf("/>")) @@ -29823,47 +29827,47 @@ var Parser = ( val: { type: TYPE.literal, value: "<".concat(f, "/>"), - location: createLocation(s, this.clonePosition()) + location: createLocation(n, this.clonePosition()) }, err: null }; if (this.bumpIf(">")) { - var _ = this.parseMessage(e + 1, t, !0); - if (_.err) - return _; - var x = _.val, h = this.clonePosition(); + var u = this.parseMessage(e + 1, t, !0); + if (u.err) + return u; + var y = u.val, h = this.clonePosition(); if (this.bumpIf("") ? { + var _ = this.clonePosition(), E = this.parseTagName(); + return f !== E ? this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(_, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? { val: { type: TYPE.tag, value: f, - children: x, - location: createLocation(s, this.clonePosition()) + children: y, + location: createLocation(n, this.clonePosition()) }, err: null } : this.error(ErrorKind.INVALID_TAG, createLocation(h, this.clonePosition()))); } else - return this.error(ErrorKind.UNCLOSED_TAG, createLocation(s, this.clonePosition())); + return this.error(ErrorKind.UNCLOSED_TAG, createLocation(n, this.clonePosition())); } else - return this.error(ErrorKind.INVALID_TAG, createLocation(s, this.clonePosition())); + return this.error(ErrorKind.INVALID_TAG, createLocation(n, this.clonePosition())); }, r.prototype.parseTagName = function() { var e = this.offset(); for (this.bump(); !this.isEOF() && _isPotentialElementNameChar(this.char()); ) this.bump(); return this.message.slice(e, this.offset()); }, r.prototype.parseLiteral = function(e, t) { - for (var s = this.clonePosition(), f = ""; ; ) { - var _ = this.tryParseQuote(t); - if (_) { - f += _; + for (var n = this.clonePosition(), f = ""; ; ) { + var u = this.tryParseQuote(t); + if (u) { + f += u; continue; } - var x = this.tryParseUnquoted(e, t); - if (x) { - f += x; + var y = this.tryParseUnquoted(e, t); + if (y) { + f += y; continue; } var h = this.tryParseLeftAngleBracket(); @@ -29873,9 +29877,9 @@ var Parser = ( } break; } - var u = createLocation(s, this.clonePosition()); + var _ = createLocation(n, this.clonePosition()); return { - val: { type: TYPE.literal, value: f, location: u }, + val: { type: TYPE.literal, value: f, location: _ }, err: null }; }, r.prototype.tryParseLeftAngleBracket = function() { @@ -29902,8 +29906,8 @@ var Parser = ( this.bump(); var t = [this.char()]; for (this.bump(); !this.isEOF(); ) { - var s = this.char(); - if (s === 39) + var n = this.char(); + if (n === 39) if (this.peek() === 39) t.push(39), this.bump(); else { @@ -29911,26 +29915,26 @@ var Parser = ( break; } else - t.push(s); + t.push(n); this.bump(); } return fromCodePoint.apply(void 0, t); }, r.prototype.tryParseUnquoted = function(e, t) { if (this.isEOF()) return null; - var s = this.char(); - return s === 60 || s === 123 || s === 35 && (t === "plural" || t === "selectordinal") || s === 125 && e > 0 ? null : (this.bump(), fromCodePoint(s)); + var n = this.char(); + return n === 60 || n === 123 || n === 35 && (t === "plural" || t === "selectordinal") || n === 125 && e > 0 ? null : (this.bump(), fromCodePoint(n)); }, r.prototype.parseArgument = function(e, t) { - var s = this.clonePosition(); + var n = this.clonePosition(); if (this.bump(), this.bumpSpace(), this.isEOF()) - return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(s, this.clonePosition())); + return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(n, this.clonePosition())); if (this.char() === 125) - return this.bump(), this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(s, this.clonePosition())); + return this.bump(), this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(n, this.clonePosition())); var f = this.parseIdentifierIfPossible().value; if (!f) - return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(s, this.clonePosition())); + return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(n, this.clonePosition())); if (this.bumpSpace(), this.isEOF()) - return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(s, this.clonePosition())); + return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(n, this.clonePosition())); switch (this.char()) { case 125: return this.bump(), { @@ -29938,25 +29942,25 @@ var Parser = ( type: TYPE.argument, // value does not include the opening and closing braces. value: f, - location: createLocation(s, this.clonePosition()) + location: createLocation(n, this.clonePosition()) }, err: null }; case 44: - return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(s, this.clonePosition())) : this.parseArgumentOptions(e, t, f, s); + return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(n, this.clonePosition())) : this.parseArgumentOptions(e, t, f, n); default: - return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(s, this.clonePosition())); + return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(n, this.clonePosition())); } }, r.prototype.parseIdentifierIfPossible = function() { - var e = this.clonePosition(), t = this.offset(), s = matchIdentifierAtIndex(this.message, t), f = t + s.length; + var e = this.clonePosition(), t = this.offset(), n = matchIdentifierAtIndex(this.message, t), f = t + n.length; this.bumpTo(f); - var _ = this.clonePosition(), x = createLocation(e, _); - return { value: s, location: x }; - }, r.prototype.parseArgumentOptions = function(e, t, s, f) { - var _, x = this.clonePosition(), h = this.parseIdentifierIfPossible().value, u = this.clonePosition(); + var u = this.clonePosition(), y = createLocation(e, u); + return { value: n, location: y }; + }, r.prototype.parseArgumentOptions = function(e, t, n, f) { + var u, y = this.clonePosition(), h = this.parseIdentifierIfPossible().value, _ = this.clonePosition(); switch (h) { case "": - return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(x, u)); + return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(y, _)); case "number": case "date": case "time": { @@ -29976,18 +29980,18 @@ var Parser = ( var S = this.tryParseArgumentClose(f); if (S.err) return S; - var n = createLocation(f, this.clonePosition()); + var s = createLocation(f, this.clonePosition()); if (E && startsWith(E == null ? void 0 : E.style, "::", 0)) { var o = trimStart(E.style.slice(2)); if (h === "number") { var C = this.parseNumberSkeletonFromString(o, E.styleLocation); return C.err ? C : { - val: { type: TYPE.number, value: s, location: n, style: C.val }, + val: { type: TYPE.number, value: n, location: s, style: C.val }, err: null }; } else { if (o.length === 0) - return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, n); + return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, s); var w = o; this.locale && (w = getBestPattern(o, this.locale)); var b = { @@ -29997,7 +30001,7 @@ var Parser = ( parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(w) : {} }, p = h === "date" ? TYPE.date : TYPE.time; return { - val: { type: p, value: s, location: n, style: b }, + val: { type: p, value: n, location: s, style: b }, err: null }; } @@ -30005,9 +30009,9 @@ var Parser = ( return { val: { type: h === "number" ? TYPE.number : h === "date" ? TYPE.date : TYPE.time, - value: s, - location: n, - style: (_ = E == null ? void 0 : E.style) !== null && _ !== void 0 ? _ : null + value: n, + location: s, + style: (u = E == null ? void 0 : E.style) !== null && u !== void 0 ? u : null }, err: null }; @@ -30039,7 +30043,7 @@ var Parser = ( return h === "select" ? { val: { type: TYPE.select, - value: s, + value: n, options: fromEntries(g.val), location: M }, @@ -30047,7 +30051,7 @@ var Parser = ( } : { val: { type: TYPE.plural, - value: s, + value: n, options: fromEntries(g.val), offset: l, pluralType: h === "plural" ? "cardinal" : "ordinal", @@ -30057,14 +30061,14 @@ var Parser = ( }; } default: - return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(x, u)); + return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(y, _)); } }, r.prototype.tryParseArgumentClose = function(e) { return this.isEOF() || this.char() !== 125 ? this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(e, this.clonePosition())) : (this.bump(), { val: !0, err: null }); }, r.prototype.parseSimpleArgStyleIfPossible = function() { for (var e = 0, t = this.clonePosition(); !this.isEOF(); ) { - var s = this.char(); - switch (s) { + var n = this.char(); + switch (n) { case 39: { this.bump(); var f = this.clonePosition(); @@ -30097,23 +30101,23 @@ var Parser = ( err: null }; }, r.prototype.parseNumberSkeletonFromString = function(e, t) { - var s = []; + var n = []; try { - s = parseNumberSkeletonFromString(e); + n = parseNumberSkeletonFromString(e); } catch { return this.error(ErrorKind.INVALID_NUMBER_SKELETON, t); } return { val: { type: SKELETON_TYPE.number, - tokens: s, + tokens: n, location: t, - parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(s) : {} + parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(n) : {} }, err: null }; - }, r.prototype.tryParsePluralOrSelectOptions = function(e, t, s, f) { - for (var _, x = !1, h = [], u = /* @__PURE__ */ new Set(), E = f.value, c = f.location; ; ) { + }, r.prototype.tryParsePluralOrSelectOptions = function(e, t, n, f) { + for (var u, y = !1, h = [], _ = /* @__PURE__ */ new Set(), E = f.value, c = f.location; ; ) { if (E.length === 0) { var C = this.clonePosition(); if (t !== "select" && this.bumpIf("=")) { @@ -30124,39 +30128,39 @@ var Parser = ( } else break; } - if (u.has(E)) + if (_.has(E)) return this.error(t === "select" ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, c); - E === "other" && (x = !0), this.bumpSpace(); + E === "other" && (y = !0), this.bumpSpace(); var A = this.clonePosition(); if (!this.bumpIf("{")) return this.error(t === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition())); - var S = this.parseMessage(e + 1, t, s); + var S = this.parseMessage(e + 1, t, n); if (S.err) return S; - var n = this.tryParseArgumentClose(A); - if (n.err) - return n; + var s = this.tryParseArgumentClose(A); + if (s.err) + return s; h.push([ E, { value: S.val, location: createLocation(A, this.clonePosition()) } - ]), u.add(E), this.bumpSpace(), _ = this.parseIdentifierIfPossible(), E = _.value, c = _.location; + ]), _.add(E), this.bumpSpace(), u = this.parseIdentifierIfPossible(), E = u.value, c = u.location; } - return h.length === 0 ? this.error(t === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !x ? this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition())) : { val: h, err: null }; + return h.length === 0 ? this.error(t === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !y ? this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition())) : { val: h, err: null }; }, r.prototype.tryParseDecimalInteger = function(e, t) { - var s = 1, f = this.clonePosition(); - this.bumpIf("+") || this.bumpIf("-") && (s = -1); - for (var _ = !1, x = 0; !this.isEOF(); ) { + var n = 1, f = this.clonePosition(); + this.bumpIf("+") || this.bumpIf("-") && (n = -1); + for (var u = !1, y = 0; !this.isEOF(); ) { var h = this.char(); if (h >= 48 && h <= 57) - _ = !0, x = x * 10 + (h - 48), this.bump(); + u = !0, y = y * 10 + (h - 48), this.bump(); else break; } - var u = createLocation(f, this.clonePosition()); - return _ ? (x *= s, isSafeInteger(x) ? { val: x, err: null } : this.error(t, u)) : this.error(e, u); + var _ = createLocation(f, this.clonePosition()); + return u ? (y *= n, isSafeInteger(y) ? { val: y, err: null } : this.error(t, _)) : this.error(e, _); }, r.prototype.offset = function() { return this.position.offset; }, r.prototype.isEOF = function() { @@ -30197,8 +30201,8 @@ var Parser = ( } return !1; }, r.prototype.bumpUntil = function(e) { - var t = this.offset(), s = this.message.indexOf(e, t); - return s >= 0 ? (this.bumpTo(s), !0) : (this.bumpTo(this.message.length), !1); + var t = this.offset(), n = this.message.indexOf(e, t); + return n >= 0 ? (this.bumpTo(n), !0) : (this.bumpTo(this.message.length), !1); }, r.prototype.bumpTo = function(e) { if (this.offset() > e) throw Error("targetOffset ".concat(e, " must be greater than or equal to the current offset ").concat(this.offset())); @@ -30217,8 +30221,8 @@ var Parser = ( }, r.prototype.peek = function() { if (this.isEOF()) return null; - var e = this.char(), t = this.offset(), s = this.message.charCodeAt(t + (e >= 65536 ? 2 : 1)); - return s ?? null; + var e = this.char(), t = this.offset(), n = this.message.charCodeAt(t + (e >= 65536 ? 2 : 1)); + return n ?? null; }, r; }() ); @@ -30250,31 +30254,31 @@ function parse(r, e) { e === void 0 && (e = {}), e = __assign({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, e); var t = new Parser(r, e).parse(); if (t.err) { - var s = SyntaxError(ErrorKind[t.err.kind]); - throw s.location = t.err.location, s.originalMessage = t.err.message, s; + var n = SyntaxError(ErrorKind[t.err.kind]); + throw n.location = t.err.location, n.originalMessage = t.err.message, n; } return e != null && e.captureLocation || pruneLocation(t.val), t.val; } function memoize(r, e) { - var t = e && e.cache ? e.cache : cacheDefault, s = e && e.serializer ? e.serializer : serializerDefault, f = e && e.strategy ? e.strategy : strategyDefault; + var t = e && e.cache ? e.cache : cacheDefault, n = e && e.serializer ? e.serializer : serializerDefault, f = e && e.strategy ? e.strategy : strategyDefault; return f(r, { cache: t, - serializer: s + serializer: n }); } function isPrimitive(r) { return r == null || typeof r == "number" || typeof r == "boolean"; } -function monadic(r, e, t, s) { - var f = isPrimitive(s) ? s : t(s), _ = e.get(f); - return typeof _ > "u" && (_ = r.call(this, s), e.set(f, _)), _; +function monadic(r, e, t, n) { + var f = isPrimitive(n) ? n : t(n), u = e.get(f); + return typeof u > "u" && (u = r.call(this, n), e.set(f, u)), u; } function variadic(r, e, t) { - var s = Array.prototype.slice.call(arguments, 3), f = t(s), _ = e.get(f); - return typeof _ > "u" && (_ = r.apply(this, s), e.set(f, _)), _; + var n = Array.prototype.slice.call(arguments, 3), f = t(n), u = e.get(f); + return typeof u > "u" && (u = r.apply(this, n), e.set(f, u)), u; } -function assemble(r, e, t, s, f) { - return t.bind(e, r, s, f); +function assemble(r, e, t, n, f) { + return t.bind(e, r, n, f); } function strategyDefault(r, e) { var t = r.length === 1 ? monadic : variadic; @@ -30313,9 +30317,9 @@ var FormatError = ( /** @class */ function(r) { __extends(e, r); - function e(t, s, f) { - var _ = r.call(this, t) || this; - return _.code = s, _.originalMessage = f, _; + function e(t, n, f) { + var u = r.call(this, t) || this; + return u.code = n, u.originalMessage = f, u; } return e.prototype.toString = function() { return "[formatjs Error: ".concat(this.code, "] ").concat(this.message); @@ -30325,8 +30329,8 @@ var FormatError = ( /** @class */ function(r) { __extends(e, r); - function e(t, s, f, _) { - return r.call(this, 'Invalid values for "'.concat(t, '": "').concat(s, '". Options are "').concat(Object.keys(f).join('", "'), '"'), ErrorCode.INVALID_VALUE, _) || this; + function e(t, n, f, u) { + return r.call(this, 'Invalid values for "'.concat(t, '": "').concat(n, '". Options are "').concat(Object.keys(f).join('", "'), '"'), ErrorCode.INVALID_VALUE, u) || this; } return e; }(FormatError) @@ -30334,8 +30338,8 @@ var FormatError = ( /** @class */ function(r) { __extends(e, r); - function e(t, s, f) { - return r.call(this, 'Value for "'.concat(t, '" must be of type ').concat(s), ErrorCode.INVALID_VALUE, f) || this; + function e(t, n, f) { + return r.call(this, 'Value for "'.concat(t, '" must be of type ').concat(n), ErrorCode.INVALID_VALUE, f) || this; } return e; }(FormatError) @@ -30343,8 +30347,8 @@ var FormatError = ( /** @class */ function(r) { __extends(e, r); - function e(t, s) { - return r.call(this, 'The intl string context variable "'.concat(t, '" was not provided to the string "').concat(s, '"'), ErrorCode.MISSING_VALUE, s) || this; + function e(t, n) { + return r.call(this, 'The intl string context variable "'.concat(t, '" was not provided to the string "').concat(n, '"'), ErrorCode.MISSING_VALUE, n) || this; } return e; }(FormatError) @@ -30354,14 +30358,14 @@ var FormatError = ( })(PART_TYPE || (PART_TYPE = {})); function mergeLiteral(r) { return r.length < 2 ? r : r.reduce(function(e, t) { - var s = e[e.length - 1]; - return !s || s.type !== PART_TYPE.literal || t.type !== PART_TYPE.literal ? e.push(t) : s.value += t.value, e; + var n = e[e.length - 1]; + return !n || n.type !== PART_TYPE.literal || t.type !== PART_TYPE.literal ? e.push(t) : n.value += t.value, e; }, []); } function isFormatXMLElementFn(r) { return typeof r == "function"; } -function formatToParts(r, e, t, s, f, _, x) { +function formatToParts(r, e, t, n, f, u, y) { if (r.length === 1 && isLiteralElement(r[0])) return [ { @@ -30369,8 +30373,8 @@ function formatToParts(r, e, t, s, f, _, x) { value: r[0].value } ]; - for (var h = [], u = 0, E = r; u < E.length; u++) { - var c = E[u]; + for (var h = [], _ = 0, E = r; _ < E.length; _++) { + var c = E[_]; if (isLiteralElement(c)) { h.push({ type: PART_TYPE.literal, @@ -30379,15 +30383,15 @@ function formatToParts(r, e, t, s, f, _, x) { continue; } if (isPoundElement(c)) { - typeof _ == "number" && h.push({ + typeof u == "number" && h.push({ type: PART_TYPE.literal, - value: t.getNumberFormat(e).format(_) + value: t.getNumberFormat(e).format(u) }); continue; } var C = c.value; if (!(f && C in f)) - throw new MissingValueError(C, x); + throw new MissingValueError(C, y); var b = f[C]; if (isArgumentElement(c)) { (!b || typeof b == "string" || typeof b == "number") && (b = typeof b == "string" || typeof b == "number" ? String(b) : ""), h.push({ @@ -30397,7 +30401,7 @@ function formatToParts(r, e, t, s, f, _, x) { continue; } if (isDateElement(c)) { - var A = typeof c.style == "string" ? s.date[c.style] : isDateTimeSkeleton(c.style) ? c.style.parsedOptions : void 0; + var A = typeof c.style == "string" ? n.date[c.style] : isDateTimeSkeleton(c.style) ? c.style.parsedOptions : void 0; h.push({ type: PART_TYPE.literal, value: t.getDateTimeFormat(e, A).format(b) @@ -30405,7 +30409,7 @@ function formatToParts(r, e, t, s, f, _, x) { continue; } if (isTimeElement(c)) { - var A = typeof c.style == "string" ? s.time[c.style] : isDateTimeSkeleton(c.style) ? c.style.parsedOptions : s.time.medium; + var A = typeof c.style == "string" ? n.time[c.style] : isDateTimeSkeleton(c.style) ? c.style.parsedOptions : n.time.medium; h.push({ type: PART_TYPE.literal, value: t.getDateTimeFormat(e, A).format(b) @@ -30413,7 +30417,7 @@ function formatToParts(r, e, t, s, f, _, x) { continue; } if (isNumberElement(c)) { - var A = typeof c.style == "string" ? s.number[c.style] : isNumberSkeleton(c.style) ? c.style.parsedOptions : void 0; + var A = typeof c.style == "string" ? n.number[c.style] : isNumberSkeleton(c.style) ? c.style.parsedOptions : void 0; A && A.scale && (b = b * (A.scale || 1)), h.push({ type: PART_TYPE.literal, value: t.getNumberFormat(e, A).format(b) @@ -30421,10 +30425,10 @@ function formatToParts(r, e, t, s, f, _, x) { continue; } if (isTagElement(c)) { - var S = c.children, n = c.value, o = f[n]; + var S = c.children, s = c.value, o = f[s]; if (!isFormatXMLElementFn(o)) - throw new InvalidValueTypeError(n, "function", x); - var w = formatToParts(S, e, t, s, f, _), p = o(w.map(function(l) { + throw new InvalidValueTypeError(s, "function", y); + var w = formatToParts(S, e, t, n, f, u), p = o(w.map(function(l) { return l.value; })); Array.isArray(p) || (p = [p]), h.push.apply(h, p.map(function(l) { @@ -30437,8 +30441,8 @@ function formatToParts(r, e, t, s, f, _, x) { if (isSelectElement(c)) { var v = c.options[b] || c.options.other; if (!v) - throw new InvalidValueError(c.value, b, Object.keys(c.options), x); - h.push.apply(h, formatToParts(v.value, e, t, s, f)); + throw new InvalidValueError(c.value, b, Object.keys(c.options), y); + h.push.apply(h, formatToParts(v.value, e, t, n, f)); continue; } if (isPluralElement(c)) { @@ -30447,26 +30451,26 @@ function formatToParts(r, e, t, s, f, _, x) { if (!Intl.PluralRules) throw new FormatError(`Intl.PluralRules is not available in this environment. Try polyfilling it using "@formatjs/intl-pluralrules" -`, ErrorCode.MISSING_INTL_API, x); +`, ErrorCode.MISSING_INTL_API, y); var a = t.getPluralRules(e, { type: c.pluralType }).select(b - (c.offset || 0)); v = c.options[a] || c.options.other; } if (!v) - throw new InvalidValueError(c.value, b, Object.keys(c.options), x); - h.push.apply(h, formatToParts(v.value, e, t, s, f, b - (c.offset || 0))); + throw new InvalidValueError(c.value, b, Object.keys(c.options), y); + h.push.apply(h, formatToParts(v.value, e, t, n, f, b - (c.offset || 0))); continue; } } return mergeLiteral(h); } function mergeConfig(r, e) { - return e ? __assign(__assign(__assign({}, r || {}), e || {}), Object.keys(r).reduce(function(t, s) { - return t[s] = __assign(__assign({}, r[s]), e[s] || {}), t; + return e ? __assign(__assign(__assign({}, r || {}), e || {}), Object.keys(r).reduce(function(t, n) { + return t[n] = __assign(__assign({}, r[n]), e[n] || {}), t; }, {})) : r; } function mergeConfigs(r, e) { - return e ? Object.keys(r).reduce(function(t, s) { - return t[s] = mergeConfig(r[s], e[s]), t; + return e ? Object.keys(r).reduce(function(t, n) { + return t[n] = mergeConfig(r[n], e[n]), t; }, __assign({}, r)) : r; } function createFastMemoizeCache(r) { @@ -30490,24 +30494,24 @@ function createDefaultFormatters(r) { pluralRules: {} }), { getNumberFormat: memoize(function() { - for (var e, t = [], s = 0; s < arguments.length; s++) - t[s] = arguments[s]; + for (var e, t = [], n = 0; n < arguments.length; n++) + t[n] = arguments[n]; return new ((e = Intl.NumberFormat).bind.apply(e, __spreadArray([void 0], t, !1)))(); }, { cache: createFastMemoizeCache(r.number), strategy: strategies.variadic }), getDateTimeFormat: memoize(function() { - for (var e, t = [], s = 0; s < arguments.length; s++) - t[s] = arguments[s]; + for (var e, t = [], n = 0; n < arguments.length; n++) + t[n] = arguments[n]; return new ((e = Intl.DateTimeFormat).bind.apply(e, __spreadArray([void 0], t, !1)))(); }, { cache: createFastMemoizeCache(r.dateTime), strategy: strategies.variadic }), getPluralRules: memoize(function() { - for (var e, t = [], s = 0; s < arguments.length; s++) - t[s] = arguments[s]; + for (var e, t = [], n = 0; n < arguments.length; n++) + t[n] = arguments[n]; return new ((e = Intl.PluralRules).bind.apply(e, __spreadArray([void 0], t, !1)))(); }, { cache: createFastMemoizeCache(r.pluralRules), @@ -30518,28 +30522,28 @@ function createDefaultFormatters(r) { var IntlMessageFormat = ( /** @class */ function() { - function r(e, t, s, f) { - var _ = this; + function r(e, t, n, f) { + var u = this; if (t === void 0 && (t = r.defaultLocale), this.formatterCache = { number: {}, dateTime: {}, pluralRules: {} - }, this.format = function(x) { - var h = _.formatToParts(x); + }, this.format = function(y) { + var h = u.formatToParts(y); if (h.length === 1) return h[0].value; - var u = h.reduce(function(E, c) { + var _ = h.reduce(function(E, c) { return !E.length || c.type !== PART_TYPE.literal || typeof E[E.length - 1] != "string" ? E.push(c.value) : E[E.length - 1] += c.value, E; }, []); - return u.length <= 1 ? u[0] || "" : u; - }, this.formatToParts = function(x) { - return formatToParts(_.ast, _.locales, _.formatters, _.formats, x, void 0, _.message); + return _.length <= 1 ? _[0] || "" : _; + }, this.formatToParts = function(y) { + return formatToParts(u.ast, u.locales, u.formatters, u.formats, y, void 0, u.message); }, this.resolvedOptions = function() { return { - locale: _.resolvedLocale.toString() + locale: u.resolvedLocale.toString() }; }, this.getAst = function() { - return _.ast; + return u.ast; }, this.locales = t, this.resolvedLocale = r.resolveLocale(t), typeof e == "string") { if (this.message = e, !r.__parse) throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`"); @@ -30551,7 +30555,7 @@ var IntlMessageFormat = ( this.ast = e; if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST."); - this.formats = mergeConfigs(r.formats, s), this.formatters = f && f.formatters || createDefaultFormatters(this.formatterCache); + this.formats = mergeConfigs(r.formats, n), this.formatters = f && f.formatters || createDefaultFormatters(this.formatterCache); } return Object.defineProperty(r, "defaultLocale", { get: function() { @@ -30629,20 +30633,20 @@ function delve(r, e) { if (e in r) return r[e]; const t = e.split("."); - let s = r; + let n = r; for (let f = 0; f < t.length; f++) - if (typeof s == "object") { + if (typeof n == "object") { if (f > 0) { - const _ = t.slice(f, t.length).join("."); - if (_ in s) { - s = s[_]; + const u = t.slice(f, t.length).join("."); + if (u in n) { + n = n[u]; break; } } - s = s[t[f]]; + n = n[t[f]]; } else - s = void 0; - return s; + n = void 0; + return n; } const lookupCache = {}, addToCache = (r, e, t) => t && (e in lookupCache || (lookupCache[e] = {}), r in lookupCache[e] || (lookupCache[e][r] = t), t), lookup = (r, e) => { if (e == null) @@ -30650,10 +30654,10 @@ const lookupCache = {}, addToCache = (r, e, t) => t && (e in lookupCache || (loo if (e in lookupCache && r in lookupCache[e]) return lookupCache[e][r]; const t = getPossibleLocales(e); - for (let s = 0; s < t.length; s++) { - const f = t[s], _ = getMessageFromDictionary(f, r); - if (_) - return addToCache(r, e, _); + for (let n = 0; n < t.length; n++) { + const f = t[n], u = getMessageFromDictionary(f, r); + if (u) + return addToCache(r, e, u); } }; let dictionary; @@ -30675,9 +30679,9 @@ function getClosestAvailableLocale(r) { return; const e = getPossibleLocales(r); for (let t = 0; t < e.length; t++) { - const s = e[t]; - if (hasLocaleDictionary(s)) - return s; + const n = e[t]; + if (hasLocaleDictionary(n)) + return n; } } function addMessages(r, ...e) { @@ -30711,8 +30715,8 @@ function hasLocaleQueue(r) { } function loadLocaleQueue(r, e) { return Promise.all( - e.map((s) => (removeLoaderFromQueue(r, s), s().then((f) => f.default || f))) - ).then((s) => addMessages(r, ...s)); + e.map((n) => (removeLoaderFromQueue(r, n), n().then((f) => f.default || f))) + ).then((n) => addMessages(r, ...n)); } const activeFlushes = {}; function flush$1(r) { @@ -30721,7 +30725,7 @@ function flush$1(r) { const e = getLocalesQueues(r); return activeFlushes[r] = Promise.all( e.map( - ([t, s]) => loadLocaleQueue(t, s) + ([t, n]) => loadLocaleQueue(t, n) ) ).then(() => { if (hasLocaleQueue(r)) @@ -30781,7 +30785,7 @@ var __defProp$1 = Object.defineProperty, __defProps = Object.defineProperties, _ let current; const internalLocale = writable(null); function getSubLocales(r) { - return r.split("-").map((e, t, s) => s.slice(0, t + 1).join("-")).reverse(); + return r.split("-").map((e, t, n) => n.slice(0, t + 1).join("-")).reverse(); } function getPossibleLocales(r, e = getOptions().fallbackLocale) { const t = getSubLocales(r); @@ -30811,9 +30815,9 @@ const set = (r) => { set }), monadicMemoize = (r) => { const e = /* @__PURE__ */ Object.create(null); - return (s) => { - const f = JSON.stringify(s); - return f in e ? e[f] : e[f] = r(s); + return (n) => { + const f = JSON.stringify(n); + return f in e ? e[f] : e[f] = r(n); }; }; var __defProp = Object.defineProperty, __getOwnPropSymbols = Object.getOwnPropertySymbols, __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable, __defNormalProp = (r, e, t) => e in r ? __defProp(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, __spreadValues = (r, e) => { @@ -30825,11 +30829,11 @@ var __defProp = Object.defineProperty, __getOwnPropSymbols = Object.getOwnProper return r; }, __objRest = (r, e) => { var t = {}; - for (var s in r) - __hasOwnProp.call(r, s) && e.indexOf(s) < 0 && (t[s] = r[s]); + for (var n in r) + __hasOwnProp.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]); if (r != null && __getOwnPropSymbols) - for (var s of __getOwnPropSymbols(r)) - e.indexOf(s) < 0 && __propIsEnum.call(r, s) && (t[s] = r[s]); + for (var n of __getOwnPropSymbols(r)) + e.indexOf(n) < 0 && __propIsEnum.call(r, n) && (t[n] = r[n]); return t; }; const getIntlFormatterOptions = (r, e) => { @@ -30839,69 +30843,69 @@ const getIntlFormatterOptions = (r, e) => { throw new Error(`[svelte-i18n] Unknown "${e}" ${r} format.`); }, createNumberFormatter = monadicMemoize( (r) => { - var e = r, { locale: t, format: s } = e, f = __objRest(e, ["locale", "format"]); + var e = r, { locale: t, format: n } = e, f = __objRest(e, ["locale", "format"]); if (t == null) throw new Error('[svelte-i18n] A "locale" must be set to format numbers'); - return s && (f = getIntlFormatterOptions("number", s)), new Intl.NumberFormat(t, f); + return n && (f = getIntlFormatterOptions("number", n)), new Intl.NumberFormat(t, f); } ), createDateFormatter = monadicMemoize( (r) => { - var e = r, { locale: t, format: s } = e, f = __objRest(e, ["locale", "format"]); + var e = r, { locale: t, format: n } = e, f = __objRest(e, ["locale", "format"]); if (t == null) throw new Error('[svelte-i18n] A "locale" must be set to format dates'); - return s ? f = getIntlFormatterOptions("date", s) : Object.keys(f).length === 0 && (f = getIntlFormatterOptions("date", "short")), new Intl.DateTimeFormat(t, f); + return n ? f = getIntlFormatterOptions("date", n) : Object.keys(f).length === 0 && (f = getIntlFormatterOptions("date", "short")), new Intl.DateTimeFormat(t, f); } ), createTimeFormatter = monadicMemoize( (r) => { - var e = r, { locale: t, format: s } = e, f = __objRest(e, ["locale", "format"]); + var e = r, { locale: t, format: n } = e, f = __objRest(e, ["locale", "format"]); if (t == null) throw new Error( '[svelte-i18n] A "locale" must be set to format time values' ); - return s ? f = getIntlFormatterOptions("time", s) : Object.keys(f).length === 0 && (f = getIntlFormatterOptions("time", "short")), new Intl.DateTimeFormat(t, f); + return n ? f = getIntlFormatterOptions("time", n) : Object.keys(f).length === 0 && (f = getIntlFormatterOptions("time", "short")), new Intl.DateTimeFormat(t, f); } ), getNumberFormatter = (r = {}) => { var e = r, { locale: t = getCurrentLocale() - } = e, s = __objRest(e, [ + } = e, n = __objRest(e, [ "locale" ]); - return createNumberFormatter(__spreadValues({ locale: t }, s)); + return createNumberFormatter(__spreadValues({ locale: t }, n)); }, getDateFormatter = (r = {}) => { var e = r, { locale: t = getCurrentLocale() - } = e, s = __objRest(e, [ + } = e, n = __objRest(e, [ "locale" ]); - return createDateFormatter(__spreadValues({ locale: t }, s)); + return createDateFormatter(__spreadValues({ locale: t }, n)); }, getTimeFormatter = (r = {}) => { var e = r, { locale: t = getCurrentLocale() - } = e, s = __objRest(e, [ + } = e, n = __objRest(e, [ "locale" ]); - return createTimeFormatter(__spreadValues({ locale: t }, s)); + return createTimeFormatter(__spreadValues({ locale: t }, n)); }, getMessageFormatter = monadicMemoize( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion (r, e = getCurrentLocale()) => new IntlMessageFormat(r, e, getOptions().formats, { ignoreTag: getOptions().ignoreTag }) ), formatMessage = (r, e = {}) => { - var t, s, f, _; - let x = e; - typeof r == "object" && (x = r, r = x.id); + var t, n, f, u; + let y = e; + typeof r == "object" && (y = r, r = y.id); const { values: h, - locale: u = getCurrentLocale(), + locale: _ = getCurrentLocale(), default: E - } = x; - if (u == null) + } = y; + if (_ == null) throw new Error( "[svelte-i18n] Cannot format a message without first setting the initial locale." ); - let c = lookup(r, u); + let c = lookup(r, _); if (!c) - c = (_ = (f = (s = (t = getOptions()).handleMissingMessage) == null ? void 0 : s.call(t, { locale: u, id: r, defaultValue: E })) != null ? f : E) != null ? _ : r; + c = (u = (f = (n = (t = getOptions()).handleMissingMessage) == null ? void 0 : n.call(t, { locale: _, id: r, defaultValue: E })) != null ? f : E) != null ? u : r; else if (typeof c != "string") return console.warn( `[svelte-i18n] Message with id "${r}" must be of type "string", found: "${typeof c}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.` @@ -30910,7 +30914,7 @@ const getIntlFormatterOptions = (r, e) => { return c; let C = c; try { - C = getMessageFormatter(c, u).format(h); + C = getMessageFormatter(c, _).format(h); } catch (b) { b instanceof Error && console.warn( `[svelte-i18n] Message "${r}" has syntax error:`, @@ -30949,7 +30953,7 @@ const Upload_svelte_svelte_type_style_lang = "", { update_slot_base: update_slot_base$2 } = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$3, tick: tick$3, getContext: getContext$1 } = window.__gradio__svelte__internal; function create_fragment$8(r) { - let e, t, s, f, _, x, h, u, E; + let e, t, n, f, u, y, h, _, E; const c = ( /*#slots*/ r[16].default @@ -30962,15 +30966,15 @@ function create_fragment$8(r) { ); return { c() { - e = element$6("button"), C && C.c(), t = space$5(), s = element$6("input"), attr$7(s, "type", "file"), attr$7( - s, + e = element$6("button"), C && C.c(), t = space$5(), n = element$6("input"), attr$7(n, "type", "file"), attr$7( + n, "accept", /*filetype*/ r[0] - ), s.multiple = f = /*file_count*/ - r[4] === "multiple" || void 0, attr$7(s, "webkitdirectory", _ = /*file_count*/ - r[4] === "directory" || void 0), attr$7(s, "mozdirectory", x = /*file_count*/ - r[4] === "directory" || void 0), attr$7(s, "class", "svelte-18dlsnh"), attr$7(e, "class", "svelte-18dlsnh"), toggle_class$4( + ), n.multiple = f = /*file_count*/ + r[4] === "multiple" || void 0, attr$7(n, "webkitdirectory", u = /*file_count*/ + r[4] === "directory" || void 0), attr$7(n, "mozdirectory", y = /*file_count*/ + r[4] === "directory" || void 0), attr$7(n, "class", "svelte-18dlsnh"), attr$7(e, "class", "svelte-18dlsnh"), toggle_class$4( e, "hidden", /*hidden*/ @@ -30993,9 +30997,9 @@ function create_fragment$8(r) { ); }, m(b, A) { - insert$8(b, e, A), C && C.m(e, null), append$7(e, t), append$7(e, s), r[24](s), h = !0, u || (E = [ + insert$8(b, e, A), C && C.m(e, null), append$7(e, t), append$7(e, n), r[24](n), h = !0, _ || (E = [ listen$1( - s, + n, "change", /*load_files_from_upload*/ r[9] @@ -31052,7 +31056,7 @@ function create_fragment$8(r) { /*updateDragging*/ r[8] ) - ], u = !0); + ], _ = !0); }, p(b, [A]) { C && C.p && (!h || A & /*$$scope*/ @@ -31075,17 +31079,17 @@ function create_fragment$8(r) { null ), (!h || A & /*filetype*/ 1) && attr$7( - s, + n, "accept", /*filetype*/ b[0] ), (!h || A & /*file_count*/ 16 && f !== (f = /*file_count*/ - b[4] === "multiple" || void 0)) && (s.multiple = f), (!h || A & /*file_count*/ - 16 && _ !== (_ = /*file_count*/ - b[4] === "directory" || void 0)) && attr$7(s, "webkitdirectory", _), (!h || A & /*file_count*/ - 16 && x !== (x = /*file_count*/ - b[4] === "directory" || void 0)) && attr$7(s, "mozdirectory", x), (!h || A & /*hidden*/ + b[4] === "multiple" || void 0)) && (n.multiple = f), (!h || A & /*file_count*/ + 16 && u !== (u = /*file_count*/ + b[4] === "directory" || void 0)) && attr$7(n, "webkitdirectory", u), (!h || A & /*file_count*/ + 16 && y !== (y = /*file_count*/ + b[4] === "directory" || void 0)) && attr$7(n, "mozdirectory", y), (!h || A & /*hidden*/ 32) && toggle_class$4( e, "hidden", @@ -31118,17 +31122,17 @@ function create_fragment$8(r) { transition_out$5(C, b), h = !1; }, d(b) { - b && detach$8(e), C && C.d(b), r[24](null), u = !1, run_all$1(E); + b && detach$8(e), C && C.d(b), r[24](null), _ = !1, run_all$1(E); } }; } function _optionalChain(r) { - let e, t = r[0], s = 1; - for (; s < r.length; ) { - const f = r[s], _ = r[s + 1]; - if (s += 2, (f === "optionalAccess" || f === "optionalCall") && t == null) + let e, t = r[0], n = 1; + for (; n < r.length; ) { + const f = r[n], u = r[n + 1]; + if (n += 2, (f === "optionalAccess" || f === "optionalCall") && t == null) return; - f === "access" || f === "optionalAccess" ? (e = t, t = _(t)) : (f === "call" || f === "optionalCall") && (t = _((...x) => t.call(e, ...x)), e = void 0); + f === "access" || f === "optionalAccess" ? (e = t, t = u(t)) : (f === "call" || f === "optionalCall") && (t = u((...y) => t.call(e, ...y)), e = void 0); } return t; } @@ -31136,15 +31140,15 @@ function is_valid_mimetype(r, e) { return !r || r === "*" ? !0 : r.endsWith("/*") ? e.startsWith(r.slice(0, -1)) : r === e; } function instance$7(r, e, t) { - let { $$slots: s = {}, $$scope: f } = e, { filetype: _ = null } = e, { dragging: x = !1 } = e, { boundedheight: h = !0 } = e, { center: u = !0 } = e, { flex: E = !0 } = e, { file_count: c = "single" } = e, { disable_click: C = !1 } = e, { root: b } = e, { hidden: A = !1 } = e; + let { $$slots: n = {}, $$scope: f } = e, { filetype: u = null } = e, { dragging: y = !1 } = e, { boundedheight: h = !0 } = e, { center: _ = !0 } = e, { flex: E = !0 } = e, { file_count: c = "single" } = e, { disable_click: C = !1 } = e, { root: b } = e, { hidden: A = !1 } = e; const S = getContext$1("upload_files"); - let n; + let s; const o = createEventDispatcher$3(); function w() { - t(11, x = !x); + t(11, y = !y); } function p() { - C || (t(7, n.value = "", n), n.click()); + C || (t(7, s.value = "", s), s.click()); } async function v(F) { await tick$3(); @@ -31162,9 +31166,9 @@ function instance$7(r, e, t) { N.files && await a(Array.from(N.files)); } async function g(F) { - if (t(11, x = !1), !_optionalChain([F, "access", ($) => $.dataTransfer, "optionalAccess", ($) => $.files])) + if (t(11, y = !1), !_optionalChain([F, "access", ($) => $.dataTransfer, "optionalAccess", ($) => $.files])) return; - const N = Array.from(F.dataTransfer.files).filter(($) => is_valid_mimetype(_, $.type) ? !0 : (o("error", `Invalid file type only ${_} allowed.`), !1)); + const N = Array.from(F.dataTransfer.files).filter(($) => is_valid_mimetype(u, $.type) ? !0 : (o("error", `Invalid file type only ${u} allowed.`), !1)); await a(N); } function M(F) { @@ -31179,48 +31183,48 @@ function instance$7(r, e, t) { function D(F) { bubble$1.call(this, r, F); } - function R(F) { + function I(F) { bubble$1.call(this, r, F); } - function B(F) { + function z(F) { bubble$1.call(this, r, F); } function P(F) { bubble$1.call(this, r, F); } - function z(F) { + function B(F) { binding_callbacks$2[F ? "unshift" : "push"](() => { - n = F, t(7, n); + s = F, t(7, s); }); } return r.$$set = (F) => { - "filetype" in F && t(0, _ = F.filetype), "dragging" in F && t(11, x = F.dragging), "boundedheight" in F && t(1, h = F.boundedheight), "center" in F && t(2, u = F.center), "flex" in F && t(3, E = F.flex), "file_count" in F && t(4, c = F.file_count), "disable_click" in F && t(12, C = F.disable_click), "root" in F && t(13, b = F.root), "hidden" in F && t(5, A = F.hidden), "$$scope" in F && t(15, f = F.$$scope); + "filetype" in F && t(0, u = F.filetype), "dragging" in F && t(11, y = F.dragging), "boundedheight" in F && t(1, h = F.boundedheight), "center" in F && t(2, _ = F.center), "flex" in F && t(3, E = F.flex), "file_count" in F && t(4, c = F.file_count), "disable_click" in F && t(12, C = F.disable_click), "root" in F && t(13, b = F.root), "hidden" in F && t(5, A = F.hidden), "$$scope" in F && t(15, f = F.$$scope); }, [ - _, - h, u, + h, + _, E, c, A, p, - n, + s, w, l, g, - x, + y, C, b, a, f, - s, + n, M, L, T, D, - R, - B, + I, + z, P, - z + B ]; } class Upload extends SvelteComponent$8 { @@ -31284,23 +31288,23 @@ function create_if_block_1$3(r) { c() { create_component$4(e.$$.fragment); }, - m(s, f) { - mount_component$4(e, s, f), t = !0; + m(n, f) { + mount_component$4(e, n, f), t = !0; }, - p(s, f) { - const _ = {}; + p(n, f) { + const u = {}; f & /*i18n*/ - 8 && (_.label = /*i18n*/ - s[3]("common.edit")), e.$set(_); + 8 && (u.label = /*i18n*/ + n[3]("common.edit")), e.$set(u); }, - i(s) { - t || (transition_in$4(e.$$.fragment, s), t = !0); + i(n) { + t || (transition_in$4(e.$$.fragment, n), t = !0); }, - o(s) { - transition_out$4(e.$$.fragment, s), t = !1; + o(n) { + transition_out$4(e.$$.fragment, n), t = !1; }, - d(s) { - destroy_component$4(e, s); + d(n) { + destroy_component$4(e, n); } }; } @@ -31322,28 +31326,28 @@ function create_if_block$4(r) { c() { create_component$4(e.$$.fragment); }, - m(s, f) { - mount_component$4(e, s, f), t = !0; + m(n, f) { + mount_component$4(e, n, f), t = !0; }, - p(s, f) { - const _ = {}; + p(n, f) { + const u = {}; f & /*i18n*/ - 8 && (_.label = /*i18n*/ - s[3]("common.undo")), e.$set(_); + 8 && (u.label = /*i18n*/ + n[3]("common.undo")), e.$set(u); }, - i(s) { - t || (transition_in$4(e.$$.fragment, s), t = !0); + i(n) { + t || (transition_in$4(e.$$.fragment, n), t = !0); }, - o(s) { - transition_out$4(e.$$.fragment, s), t = !1; + o(n) { + transition_out$4(e.$$.fragment, n), t = !1; }, - d(s) { - destroy_component$4(e, s); + d(n) { + destroy_component$4(e, n); } }; } function create_fragment$7(r) { - let e, t, s, f, _, x = ( + let e, t, n, f, u, y = ( /*editable*/ r[0] && create_if_block_1$3(r) ), h = ( @@ -31364,7 +31368,7 @@ function create_fragment$7(r) { r[7] ), { c() { - e = element$5("div"), x && x.c(), t = space$4(), h && h.c(), s = space$4(), create_component$4(f.$$.fragment), attr$6(e, "class", "svelte-1wj0ocy"), toggle_class$3(e, "not-absolute", !/*absolute*/ + e = element$5("div"), y && y.c(), t = space$4(), h && h.c(), n = space$4(), create_component$4(f.$$.fragment), attr$6(e, "class", "svelte-1wj0ocy"), toggle_class$3(e, "not-absolute", !/*absolute*/ r[2]), set_style$2( e, "position", @@ -31372,57 +31376,57 @@ function create_fragment$7(r) { r[2] ? "absolute" : "static" ); }, - m(u, E) { - insert$7(u, e, E), x && x.m(e, null), append$6(e, t), h && h.m(e, null), append$6(e, s), mount_component$4(f, e, null), _ = !0; + m(_, E) { + insert$7(_, e, E), y && y.m(e, null), append$6(e, t), h && h.m(e, null), append$6(e, n), mount_component$4(f, e, null), u = !0; }, - p(u, [E]) { + p(_, [E]) { /*editable*/ - u[0] ? x ? (x.p(u, E), E & /*editable*/ - 1 && transition_in$4(x, 1)) : (x = create_if_block_1$3(u), x.c(), transition_in$4(x, 1), x.m(e, t)) : x && (group_outros$4(), transition_out$4(x, 1, 1, () => { - x = null; + _[0] ? y ? (y.p(_, E), E & /*editable*/ + 1 && transition_in$4(y, 1)) : (y = create_if_block_1$3(_), y.c(), transition_in$4(y, 1), y.m(e, t)) : y && (group_outros$4(), transition_out$4(y, 1, 1, () => { + y = null; }), check_outros$4()), /*undoable*/ - u[1] ? h ? (h.p(u, E), E & /*undoable*/ - 2 && transition_in$4(h, 1)) : (h = create_if_block$4(u), h.c(), transition_in$4(h, 1), h.m(e, s)) : h && (group_outros$4(), transition_out$4(h, 1, 1, () => { + _[1] ? h ? (h.p(_, E), E & /*undoable*/ + 2 && transition_in$4(h, 1)) : (h = create_if_block$4(_), h.c(), transition_in$4(h, 1), h.m(e, n)) : h && (group_outros$4(), transition_out$4(h, 1, 1, () => { h = null; }), check_outros$4()); const c = {}; E & /*i18n*/ 8 && (c.label = /*i18n*/ - u[3]("common.clear")), f.$set(c), (!_ || E & /*absolute*/ + _[3]("common.clear")), f.$set(c), (!u || E & /*absolute*/ 4) && toggle_class$3(e, "not-absolute", !/*absolute*/ - u[2]), E & /*absolute*/ + _[2]), E & /*absolute*/ 4 && set_style$2( e, "position", /*absolute*/ - u[2] ? "absolute" : "static" + _[2] ? "absolute" : "static" ); }, - i(u) { - _ || (transition_in$4(x), transition_in$4(h), transition_in$4(f.$$.fragment, u), _ = !0); + i(_) { + u || (transition_in$4(y), transition_in$4(h), transition_in$4(f.$$.fragment, _), u = !0); }, - o(u) { - transition_out$4(x), transition_out$4(h), transition_out$4(f.$$.fragment, u), _ = !1; + o(_) { + transition_out$4(y), transition_out$4(h), transition_out$4(f.$$.fragment, _), u = !1; }, - d(u) { - u && detach$7(e), x && x.d(), h && h.d(), destroy_component$4(f); + d(_) { + _ && detach$7(e), y && y.d(), h && h.d(), destroy_component$4(f); } }; } function instance$6(r, e, t) { - let { editable: s = !1 } = e, { undoable: f = !1 } = e, { absolute: _ = !0 } = e, { i18n: x } = e; - const h = createEventDispatcher$2(), u = () => h("edit"), E = () => h("undo"), c = (C) => { + let { editable: n = !1 } = e, { undoable: f = !1 } = e, { absolute: u = !0 } = e, { i18n: y } = e; + const h = createEventDispatcher$2(), _ = () => h("edit"), E = () => h("undo"), c = (C) => { h("clear"), C.stopPropagation(); }; return r.$$set = (C) => { - "editable" in C && t(0, s = C.editable), "undoable" in C && t(1, f = C.undoable), "absolute" in C && t(2, _ = C.absolute), "i18n" in C && t(3, x = C.i18n); + "editable" in C && t(0, n = C.editable), "undoable" in C && t(1, f = C.undoable), "absolute" in C && t(2, u = C.absolute), "i18n" in C && t(3, y = C.i18n); }, [ - s, + n, f, - _, - x, - h, u, + y, + h, + _, E, c ]; @@ -31449,13 +31453,13 @@ const { svg_element: svg_element$2 } = window.__gradio__svelte__internal; function create_fragment$6(r) { - let e, t, s, f, _, x, h, u, E, c, C, b; + let e, t, n, f, u, y, h, _, E, c, C, b; return { c() { - e = svg_element$2("svg"), t = svg_element$2("defs"), s = svg_element$2("linearGradient"), f = svg_element$2("stop"), _ = svg_element$2("stop"), x = svg_element$2("stop"), h = svg_element$2("g"), u = svg_element$2("g"), E = svg_element$2("path"), c = svg_element$2("animateTransform"), C = svg_element$2("circle"), b = svg_element$2("animateTransform"), attr$5(f, "stop-color", "#FF7C00"), attr$5(f, "stop-opacity", "0"), attr$5(f, "offset", "0%"), attr$5(_, "stop-color", "#FF7C00"), attr$5(_, "stop-opacity", ".631"), attr$5(_, "offset", "63.146%"), attr$5(x, "stop-color", "#FF7C00"), attr$5(x, "offset", "100%"), attr$5(s, "x1", "8.042%"), attr$5(s, "y1", "0%"), attr$5(s, "x2", "65.682%"), attr$5(s, "y2", "23.865%"), attr$5(s, "id", "a"), attr$5(c, "attributeName", "transform"), attr$5(c, "type", "rotate"), attr$5(c, "from", "0 18 18"), attr$5(c, "to", "360 18 18"), attr$5(c, "dur", "0.9s"), attr$5(c, "repeatCount", "indefinite"), attr$5(E, "d", "M36 18c0-9.94-8.06-18-18-18"), attr$5(E, "id", "Oval-2"), attr$5(E, "stroke", "url(#a)"), attr$5(E, "stroke-width", "2"), attr$5(b, "attributeName", "transform"), attr$5(b, "type", "rotate"), attr$5(b, "from", "0 18 18"), attr$5(b, "to", "360 18 18"), attr$5(b, "dur", "0.9s"), attr$5(b, "repeatCount", "indefinite"), attr$5(C, "fill", "#FFf"), attr$5(C, "cx", "36"), attr$5(C, "cy", "18"), attr$5(C, "r", "1"), attr$5(u, "transform", "translate(1 1)"), attr$5(h, "fill", "none"), attr$5(h, "fill-rule", "evenodd"), attr$5(e, "width", "20"), attr$5(e, "height", "20 "), attr$5(e, "viewBox", "0 0 38 38"), attr$5(e, "xmlns", "http://www.w3.org/2000/svg"); + e = svg_element$2("svg"), t = svg_element$2("defs"), n = svg_element$2("linearGradient"), f = svg_element$2("stop"), u = svg_element$2("stop"), y = svg_element$2("stop"), h = svg_element$2("g"), _ = svg_element$2("g"), E = svg_element$2("path"), c = svg_element$2("animateTransform"), C = svg_element$2("circle"), b = svg_element$2("animateTransform"), attr$5(f, "stop-color", "#FF7C00"), attr$5(f, "stop-opacity", "0"), attr$5(f, "offset", "0%"), attr$5(u, "stop-color", "#FF7C00"), attr$5(u, "stop-opacity", ".631"), attr$5(u, "offset", "63.146%"), attr$5(y, "stop-color", "#FF7C00"), attr$5(y, "offset", "100%"), attr$5(n, "x1", "8.042%"), attr$5(n, "y1", "0%"), attr$5(n, "x2", "65.682%"), attr$5(n, "y2", "23.865%"), attr$5(n, "id", "a"), attr$5(c, "attributeName", "transform"), attr$5(c, "type", "rotate"), attr$5(c, "from", "0 18 18"), attr$5(c, "to", "360 18 18"), attr$5(c, "dur", "0.9s"), attr$5(c, "repeatCount", "indefinite"), attr$5(E, "d", "M36 18c0-9.94-8.06-18-18-18"), attr$5(E, "id", "Oval-2"), attr$5(E, "stroke", "url(#a)"), attr$5(E, "stroke-width", "2"), attr$5(b, "attributeName", "transform"), attr$5(b, "type", "rotate"), attr$5(b, "from", "0 18 18"), attr$5(b, "to", "360 18 18"), attr$5(b, "dur", "0.9s"), attr$5(b, "repeatCount", "indefinite"), attr$5(C, "fill", "#FFf"), attr$5(C, "cx", "36"), attr$5(C, "cy", "18"), attr$5(C, "r", "1"), attr$5(_, "transform", "translate(1 1)"), attr$5(h, "fill", "none"), attr$5(h, "fill-rule", "evenodd"), attr$5(e, "width", "20"), attr$5(e, "height", "20 "), attr$5(e, "viewBox", "0 0 38 38"), attr$5(e, "xmlns", "http://www.w3.org/2000/svg"); }, m(A, S) { - insert$6(A, e, S), append$5(e, t), append$5(t, s), append$5(s, f), append$5(s, _), append$5(s, x), append$5(e, h), append$5(h, u), append$5(u, E), append$5(E, c), append$5(u, C), append$5(C, b); + insert$6(A, e, S), append$5(e, t), append$5(t, n), append$5(n, f), append$5(n, u), append$5(n, y), append$5(e, h), append$5(h, _), append$5(_, E), append$5(E, c), append$5(_, C), append$5(C, b); }, p: noop$4, i: noop$4, @@ -31498,8 +31502,8 @@ function create_else_block$3(r) { c() { e = element$4("span"), e.textContent = "Fetch"; }, - m(t, s) { - insert$5(t, e, s); + m(t, n) { + insert$5(t, e, n); }, i: noop$3, o: noop$3, @@ -31514,22 +31518,22 @@ function create_if_block$3(r) { c() { create_component$3(e.$$.fragment); }, - m(s, f) { - mount_component$3(e, s, f), t = !0; + m(n, f) { + mount_component$3(e, n, f), t = !0; }, - i(s) { - t || (transition_in$3(e.$$.fragment, s), t = !0); + i(n) { + t || (transition_in$3(e.$$.fragment, n), t = !0); }, - o(s) { - transition_out$3(e.$$.fragment, s), t = !1; + o(n) { + transition_out$3(e.$$.fragment, n), t = !1; }, - d(s) { - destroy_component$3(e, s); + d(n) { + destroy_component$3(e, n); } }; } function create_fragment$5(r) { - let e, t, s, f, _, x, h, u, E, c, C, b, A, S, n, o, w, p; + let e, t, n, f, u, y, h, _, E, c, C, b, A, S, s, o, w, p; const v = [create_if_block$3, create_else_block$3], a = []; function l(g, M) { return ( @@ -31539,33 +31543,33 @@ function create_fragment$5(r) { } return b = l(r), A = a[b] = v[b](r), { c() { - e = element$4("div"), t = element$4("div"), s = element$4("input"), f = space$3(), _ = element$4("select"), x = element$4("option"), x.textContent = "PDB Assym. Unit", h = element$4("option"), h.textContent = "PDB BioAssembly", u = element$4("option"), u.textContent = "AlphaFold DB", E = element$4("option"), E.textContent = "ESMFold DB", c = space$3(), C = element$4("button"), A.c(), S = space$3(), n = element$4("span"), n.textContent = "- or -", attr$4(s, "type", "text"), attr$4( - s, + e = element$4("div"), t = element$4("div"), n = element$4("input"), f = space$3(), u = element$4("select"), y = element$4("option"), y.textContent = "PDB Assym. Unit", h = element$4("option"), h.textContent = "PDB BioAssembly", _ = element$4("option"), _.textContent = "AlphaFold DB", E = element$4("option"), E.textContent = "ESMFold DB", c = space$3(), C = element$4("button"), A.c(), S = space$3(), s = element$4("span"), s.textContent = "- or -", attr$4(n, "type", "text"), attr$4( + n, "placeholder", /*placeholder*/ r[2] - ), attr$4(s, "class", "wfull inp svelte-18kpwjt"), x.__value = "pdb_assym", set_input_value(x, x.__value), h.__value = "pdb_bioass", set_input_value(h, h.__value), u.__value = "af", set_input_value(u, u.__value), E.__value = "esm", set_input_value(E, E.__value), attr$4(_, "name", ""), attr$4(_, "id", ""), attr$4(_, "class", "select svelte-18kpwjt"), attr$4(t, "class", "flex input wfull svelte-18kpwjt"), attr$4(C, "class", "btn text-center svelte-18kpwjt"), attr$4(e, "class", "flex mt-2 svelte-18kpwjt"), attr$4(n, "class", "or py svelte-18kpwjt"); + ), attr$4(n, "class", "wfull inp svelte-18kpwjt"), y.__value = "pdb_assym", set_input_value(y, y.__value), h.__value = "pdb_bioass", set_input_value(h, h.__value), _.__value = "af", set_input_value(_, _.__value), E.__value = "esm", set_input_value(E, E.__value), attr$4(u, "name", ""), attr$4(u, "id", ""), attr$4(u, "class", "select svelte-18kpwjt"), attr$4(t, "class", "flex input wfull svelte-18kpwjt"), attr$4(C, "class", "btn text-center svelte-18kpwjt"), attr$4(e, "class", "flex mt-2 svelte-18kpwjt"), attr$4(s, "class", "or py svelte-18kpwjt"); }, m(g, M) { - insert$5(g, e, M), append$4(e, t), append$4(t, s), set_input_value( - s, + insert$5(g, e, M), append$4(e, t), append$4(t, n), set_input_value( + n, /*textInput*/ r[3] - ), append$4(t, f), append$4(t, _), append$4(_, x), append$4(_, h), append$4(_, u), append$4(_, E), append$4(e, c), append$4(e, C), a[b].m(C, null), insert$5(g, S, M), insert$5(g, n, M), o = !0, w || (p = [ + ), append$4(t, f), append$4(t, u), append$4(u, y), append$4(u, h), append$4(u, _), append$4(u, E), append$4(e, c), append$4(e, C), a[b].m(C, null), insert$5(g, S, M), insert$5(g, s, M), o = !0, w || (p = [ listen( - s, + n, "input", /*input_input_handler*/ r[8] ), listen( - s, + n, "keydown", /*isEnterPressed*/ r[6] ), listen( - _, + u, "change", /*handleSelect*/ r[5] @@ -31581,14 +31585,14 @@ function create_fragment$5(r) { p(g, [M]) { (!o || M & /*placeholder*/ 4) && attr$4( - s, + n, "placeholder", /*placeholder*/ g[2] ), M & /*textInput*/ - 8 && s.value !== /*textInput*/ + 8 && n.value !== /*textInput*/ g[3] && set_input_value( - s, + n, /*textInput*/ g[3] ); @@ -31604,19 +31608,19 @@ function create_fragment$5(r) { transition_out$3(A), o = !1; }, d(g) { - g && (detach$5(e), detach$5(S), detach$5(n)), a[b].d(), w = !1, run_all(p); + g && (detach$5(e), detach$5(S), detach$5(s)), a[b].d(), w = !1, run_all(p); } }; } function instance$5(r, e, t) { - let s; + let n; const f = createEventDispatcher$1(); - let { root: _ } = e; - const x = getContext("upload_files"); + let { root: u } = e; + const y = getContext("upload_files"); async function h(p) { - await tick$2(), s = await upload(p, _, x), s[0].orig_name = p.name, s[0].size = p.size, f("load", s); + await tick$2(), n = await upload(p, u, y), n[0].orig_name = p.name, n[0].size = p.size, f("load", n); } - let u = !1; + let _ = !1; async function E(p, v) { let a = { pdb_assym: { @@ -31636,18 +31640,18 @@ function instance$5(r, e, t) { ext: ".pdb" } }, l = a[v].url, g = a[v].ext; - t(1, u = !0); + t(1, _ = !0); let M = null; try { M = await fetch(l + p + g).then((T) => { - if (t(1, u = !1), T.status == 200) { + if (t(1, _ = !1), T.status == 200) { let D = T.blob(); return D.name = p + g, D; } else f("notfound"); }); } catch { - t(1, u = !1), f("notfound"); + t(1, _ = !1), f("notfound"); } let L = { name: p + ".pdb", @@ -31667,7 +31671,7 @@ function instance$5(r, e, t) { af: "Enter UniProt identifier", esm: "Enter MGnify protein identifier" }; - function n(p) { + function s(p) { p.key === "Enter" && E(b, c); } function o() { @@ -31675,19 +31679,19 @@ function instance$5(r, e, t) { } const w = () => E(b, c); return r.$$set = (p) => { - "root" in p && t(7, _ = p.root); + "root" in p && t(7, u = p.root); }, r.$$.update = () => { r.$$.dirty & /*selectedValue*/ 1 && t(2, C = S[c]); }, [ c, - u, + _, C, b, E, A, - n, - _, + s, + u, o, w ]; @@ -31722,26 +31726,26 @@ const { update_slot_base: update_slot_base$1 } = window.__gradio__svelte__internal, { createEventDispatcher, tick: tick$1 } = window.__gradio__svelte__internal; function create_else_block$2(r) { - let e, t, s, f, _; + let e, t, n, f, u; e = new FileRetrieval({ props: { root: ( /*root*/ r[5] ) } }), e.$on( "load", /*handle_upload*/ - r[14] + r[15] ), e.$on( "notfound", /*notfound_handler*/ - r[20] + r[21] ); - function x(u) { - r[21](u); + function y(_) { + r[22](_); } let h = { filetype: ( /*accept_file_types*/ - r[13] + r[14] ), file_count: ( /*file_count*/ @@ -31756,49 +31760,49 @@ function create_else_block$2(r) { }; return ( /*dragging*/ - r[12] !== void 0 && (h.dragging = /*dragging*/ - r[12]), s = new Upload({ props: h }), binding_callbacks$1.push(() => bind(s, "dragging", x)), s.$on( + r[13] !== void 0 && (h.dragging = /*dragging*/ + r[13]), n = new Upload({ props: h }), binding_callbacks$1.push(() => bind(n, "dragging", y)), n.$on( "load", /*handle_upload*/ - r[14] + r[15] ), { c() { - create_component$2(e.$$.fragment), t = space$2(), create_component$2(s.$$.fragment); + create_component$2(e.$$.fragment), t = space$2(), create_component$2(n.$$.fragment); }, - m(u, E) { - mount_component$2(e, u, E), insert$4(u, t, E), mount_component$2(s, u, E), _ = !0; + m(_, E) { + mount_component$2(e, _, E), insert$4(_, t, E), mount_component$2(n, _, E), u = !0; }, - p(u, E) { + p(_, E) { const c = {}; E & /*root*/ 32 && (c.root = /*root*/ - u[5]), e.$set(c); + _[5]), e.$set(c); const C = {}; E & /*accept_file_types*/ - 8192 && (C.filetype = /*accept_file_types*/ - u[13]), E & /*file_count*/ + 16384 && (C.filetype = /*accept_file_types*/ + _[14]), E & /*file_count*/ 8 && (C.file_count = /*file_count*/ - u[3]), E & /*root*/ + _[3]), E & /*root*/ 32 && (C.root = /*root*/ - u[5]), E & /*$$scope*/ - 4194304 && (C.$$scope = { dirty: E, ctx: u }), !f && E & /*dragging*/ - 4096 && (f = !0, C.dragging = /*dragging*/ - u[12], add_flush_callback(() => f = !1)), s.$set(C); + _[5]), E & /*$$scope*/ + 8388608 && (C.$$scope = { dirty: E, ctx: _ }), !f && E & /*dragging*/ + 8192 && (f = !0, C.dragging = /*dragging*/ + _[13], add_flush_callback(() => f = !1)), n.$set(C); }, - i(u) { - _ || (transition_in$2(e.$$.fragment, u), transition_in$2(s.$$.fragment, u), _ = !0); + i(_) { + u || (transition_in$2(e.$$.fragment, _), transition_in$2(n.$$.fragment, _), u = !0); }, - o(u) { - transition_out$2(e.$$.fragment, u), transition_out$2(s.$$.fragment, u), _ = !1; + o(_) { + transition_out$2(e.$$.fragment, _), transition_out$2(n.$$.fragment, _), u = !1; }, - d(u) { - u && detach$4(t), destroy_component$2(e, u), destroy_component$2(s, u); + d(_) { + _ && detach$4(t), destroy_component$2(e, _), destroy_component$2(n, _); } } ); } function create_if_block$2(r) { - let e, t, s, f, _, x; + let e, t, n, f, u, y; e = new ModifyUpload({ props: { i18n: ( /*i18n*/ @@ -31807,8 +31811,8 @@ function create_if_block$2(r) { }), e.$on( "clear", /*handle_clear*/ - r[15] - ), s = new FilePreview({ + r[16] + ), n = new FilePreview({ props: { i18n: ( /*i18n*/ @@ -31827,50 +31831,52 @@ function create_if_block$2(r) { r[6] ) } - }), s.$on( + }), n.$on( "select", /*select_handler*/ - r[19] + r[20] ); let h = ( /*moldata*/ - r[11] != null && create_if_block_1$2(r) + r[11] != null && /*molviewer*/ + r[12] && create_if_block_1$2(r) ); return { c() { - create_component$2(e.$$.fragment), t = space$2(), create_component$2(s.$$.fragment), f = space$2(), h && h.c(), _ = empty$2(); + create_component$2(e.$$.fragment), t = space$2(), create_component$2(n.$$.fragment), f = space$2(), h && h.c(), u = empty$2(); }, - m(u, E) { - mount_component$2(e, u, E), insert$4(u, t, E), mount_component$2(s, u, E), insert$4(u, f, E), h && h.m(u, E), insert$4(u, _, E), x = !0; + m(_, E) { + mount_component$2(e, _, E), insert$4(_, t, E), mount_component$2(n, _, E), insert$4(_, f, E), h && h.m(_, E), insert$4(_, u, E), y = !0; }, - p(u, E) { + p(_, E) { const c = {}; E & /*i18n*/ 128 && (c.i18n = /*i18n*/ - u[7]), e.$set(c); + _[7]), e.$set(c); const C = {}; E & /*i18n*/ 128 && (C.i18n = /*i18n*/ - u[7]), E & /*selectable*/ + _[7]), E & /*selectable*/ 16 && (C.selectable = /*selectable*/ - u[4]), E & /*value*/ + _[4]), E & /*value*/ 1 && (C.value = /*value*/ - u[0]), E & /*height*/ + _[0]), E & /*height*/ 64 && (C.height = /*height*/ - u[6]), s.$set(C), /*moldata*/ - u[11] != null ? h ? (h.p(u, E), E & /*moldata*/ - 2048 && transition_in$2(h, 1)) : (h = create_if_block_1$2(u), h.c(), transition_in$2(h, 1), h.m(_.parentNode, _)) : h && (group_outros$2(), transition_out$2(h, 1, 1, () => { + _[6]), n.$set(C), /*moldata*/ + _[11] != null && /*molviewer*/ + _[12] ? h ? (h.p(_, E), E & /*moldata, molviewer*/ + 6144 && transition_in$2(h, 1)) : (h = create_if_block_1$2(_), h.c(), transition_in$2(h, 1), h.m(u.parentNode, u)) : h && (group_outros$2(), transition_out$2(h, 1, 1, () => { h = null; }), check_outros$2()); }, - i(u) { - x || (transition_in$2(e.$$.fragment, u), transition_in$2(s.$$.fragment, u), transition_in$2(h), x = !0); + i(_) { + y || (transition_in$2(e.$$.fragment, _), transition_in$2(n.$$.fragment, _), transition_in$2(h), y = !0); }, - o(u) { - transition_out$2(e.$$.fragment, u), transition_out$2(s.$$.fragment, u), transition_out$2(h), x = !1; + o(_) { + transition_out$2(e.$$.fragment, _), transition_out$2(n.$$.fragment, _), transition_out$2(h), y = !1; }, - d(u) { - u && (detach$4(t), detach$4(f), detach$4(_)), destroy_component$2(e, u), destroy_component$2(s, u), h && h.d(u); + d(_) { + _ && (detach$4(t), detach$4(f), detach$4(u)), destroy_component$2(e, _), destroy_component$2(n, _), h && h.d(_); } }; } @@ -31878,50 +31884,50 @@ function create_default_slot$1(r) { let e; const t = ( /*#slots*/ - r[18].default - ), s = create_slot$1( + r[19].default + ), n = create_slot$1( t, r, /*$$scope*/ - r[22], + r[23], null ); return { c() { - s && s.c(); + n && n.c(); }, - m(f, _) { - s && s.m(f, _), e = !0; + m(f, u) { + n && n.m(f, u), e = !0; }, - p(f, _) { - s && s.p && (!e || _ & /*$$scope*/ - 4194304) && update_slot_base$1( - s, + p(f, u) { + n && n.p && (!e || u & /*$$scope*/ + 8388608) && update_slot_base$1( + n, t, f, /*$$scope*/ - f[22], + f[23], e ? get_slot_changes$1( t, /*$$scope*/ - f[22], - _, + f[23], + u, null ) : get_all_dirty_from_scope$1( /*$$scope*/ - f[22] + f[23] ), null ); }, i(f) { - e || (transition_in$2(s, f), e = !0); + e || (transition_in$2(n, f), e = !0); }, o(f) { - transition_out$2(s, f), e = !1; + transition_out$2(n, f), e = !1; }, d(f) { - s && s.d(f); + n && n.d(f); } }; } @@ -31950,34 +31956,34 @@ function create_if_block_1$2(r) { c() { create_component$2(e.$$.fragment); }, - m(s, f) { - mount_component$2(e, s, f), t = !0; + m(n, f) { + mount_component$2(e, n, f), t = !0; }, - p(s, f) { - const _ = {}; + p(n, f) { + const u = {}; f & /*moldata*/ - 2048 && (_.moldata = /*moldata*/ - s[11]), f & /*config*/ - 256 && (_.config = /*config*/ - s[8]), f & /*confidenceLabel*/ - 512 && (_.confidenceLabel = /*confidenceLabel*/ - s[9]), f & /*representations*/ - 1024 && (_.representations = /*representations*/ - s[10]), e.$set(_); + 2048 && (u.moldata = /*moldata*/ + n[11]), f & /*config*/ + 256 && (u.config = /*config*/ + n[8]), f & /*confidenceLabel*/ + 512 && (u.confidenceLabel = /*confidenceLabel*/ + n[9]), f & /*representations*/ + 1024 && (u.representations = /*representations*/ + n[10]), e.$set(u); }, - i(s) { - t || (transition_in$2(e.$$.fragment, s), t = !0); + i(n) { + t || (transition_in$2(e.$$.fragment, n), t = !0); }, - o(s) { - transition_out$2(e.$$.fragment, s), t = !1; + o(n) { + transition_out$2(e.$$.fragment, n), t = !1; }, - d(s) { - destroy_component$2(e, s); + d(n) { + destroy_component$2(e, n); } }; } function create_fragment$4(r) { - let e, t, s, f, _, x; + let e, t, n, f, u, y; e = new BlockLabel({ props: { show_label: ( @@ -31995,19 +32001,19 @@ function create_fragment$4(r) { ) } }); - const h = [create_if_block$2, create_else_block$2], u = []; + const h = [create_if_block$2, create_else_block$2], _ = []; function E(c, C) { return ( /*value*/ c[0] ? 0 : 1 ); } - return s = E(r), f = u[s] = h[s](r), { + return n = E(r), f = _[n] = h[n](r), { c() { - create_component$2(e.$$.fragment), t = space$2(), f.c(), _ = empty$2(); + create_component$2(e.$$.fragment), t = space$2(), f.c(), u = empty$2(); }, m(c, C) { - mount_component$2(e, c, C), insert$4(c, t, C), u[s].m(c, C), insert$4(c, _, C), x = !0; + mount_component$2(e, c, C), insert$4(c, t, C), _[n].m(c, C), insert$4(c, u, C), y = !0; }, p(c, [C]) { const b = {}; @@ -32018,69 +32024,70 @@ function create_fragment$4(r) { c[0] === null), C & /*label*/ 2 && (b.label = /*label*/ c[1] || "File"), e.$set(b); - let A = s; - s = E(c), s === A ? u[s].p(c, C) : (group_outros$2(), transition_out$2(u[A], 1, 1, () => { - u[A] = null; - }), check_outros$2(), f = u[s], f ? f.p(c, C) : (f = u[s] = h[s](c), f.c()), transition_in$2(f, 1), f.m(_.parentNode, _)); + let A = n; + n = E(c), n === A ? _[n].p(c, C) : (group_outros$2(), transition_out$2(_[A], 1, 1, () => { + _[A] = null; + }), check_outros$2(), f = _[n], f ? f.p(c, C) : (f = _[n] = h[n](c), f.c()), transition_in$2(f, 1), f.m(u.parentNode, u)); }, i(c) { - x || (transition_in$2(e.$$.fragment, c), transition_in$2(f), x = !0); + y || (transition_in$2(e.$$.fragment, c), transition_in$2(f), y = !0); }, o(c) { - transition_out$2(e.$$.fragment, c), transition_out$2(f), x = !1; + transition_out$2(e.$$.fragment, c), transition_out$2(f), y = !1; }, d(c) { - c && (detach$4(t), detach$4(_)), destroy_component$2(e, c), u[s].d(c); + c && (detach$4(t), detach$4(u)), destroy_component$2(e, c), _[n].d(c); } }; } function instance$4(r, e, t) { - let { $$slots: s = {}, $$scope: f } = e, { value: _ } = e, { label: x } = e, { show_label: h = !0 } = e, { file_count: u = "single" } = e, { file_types: E = null } = e, { selectable: c = !1 } = e, { root: C } = e, { height: b = void 0 } = e, { i18n: A } = e, { config: S = {} } = e, { confidenceLabel: n = "" } = e, { representations: o = [] } = e, { moldata: w = null } = e; - async function p({ detail: D }) { - t(0, _ = D), await tick$1(), a("change", _), a("upload", D); + let { $$slots: n = {}, $$scope: f } = e, { value: u } = e, { label: y } = e, { show_label: h = !0 } = e, { file_count: _ = "single" } = e, { file_types: E = null } = e, { selectable: c = !1 } = e, { root: C } = e, { height: b = void 0 } = e, { i18n: A } = e, { config: S = {} } = e, { confidenceLabel: s = "" } = e, { representations: o = [] } = e, { moldata: w = null } = e, { molviewer: p = !1 } = e; + async function v({ detail: I }) { + t(0, u = I), await tick$1(), l("change", u), l("upload", I); } - function v() { - t(0, _ = null), a("change", null), a("clear"); + function a() { + t(0, u = null), l("change", null), l("clear"); } - const a = createEventDispatcher(); - let l; - E == null ? l = null : (E = E.map((D) => D.startsWith(".") ? D : D + "/*"), l = E.join(", ")); - let g = !1; - function M(D) { - bubble.call(this, r, D); + const l = createEventDispatcher(); + let g; + E == null ? g = null : (E = E.map((I) => I.startsWith(".") ? I : I + "/*"), g = E.join(", ")); + let M = !1; + function L(I) { + bubble.call(this, r, I); } - const L = () => a("notfound"); - function T(D) { - g = D, t(12, g); + const T = () => l("notfound"); + function D(I) { + M = I, t(13, M); } - return r.$$set = (D) => { - "value" in D && t(0, _ = D.value), "label" in D && t(1, x = D.label), "show_label" in D && t(2, h = D.show_label), "file_count" in D && t(3, u = D.file_count), "file_types" in D && t(17, E = D.file_types), "selectable" in D && t(4, c = D.selectable), "root" in D && t(5, C = D.root), "height" in D && t(6, b = D.height), "i18n" in D && t(7, A = D.i18n), "config" in D && t(8, S = D.config), "confidenceLabel" in D && t(9, n = D.confidenceLabel), "representations" in D && t(10, o = D.representations), "moldata" in D && t(11, w = D.moldata), "$$scope" in D && t(22, f = D.$$scope); + return r.$$set = (I) => { + "value" in I && t(0, u = I.value), "label" in I && t(1, y = I.label), "show_label" in I && t(2, h = I.show_label), "file_count" in I && t(3, _ = I.file_count), "file_types" in I && t(18, E = I.file_types), "selectable" in I && t(4, c = I.selectable), "root" in I && t(5, C = I.root), "height" in I && t(6, b = I.height), "i18n" in I && t(7, A = I.i18n), "config" in I && t(8, S = I.config), "confidenceLabel" in I && t(9, s = I.confidenceLabel), "representations" in I && t(10, o = I.representations), "moldata" in I && t(11, w = I.moldata), "molviewer" in I && t(12, p = I.molviewer), "$$scope" in I && t(23, f = I.$$scope); }, r.$$.update = () => { r.$$.dirty & /*dragging*/ - 4096 && a("drag", g); + 8192 && l("drag", M); }, [ - _, - x, - h, u, + y, + h, + _, c, C, b, A, S, - n, + s, o, w, - g, - l, p, + M, + g, v, a, + l, E, - s, - M, + n, L, T, + D, f ]; } @@ -32091,7 +32098,7 @@ class FileUpload extends SvelteComponent$4 { label: 1, show_label: 2, file_count: 3, - file_types: 17, + file_types: 18, selectable: 4, root: 5, height: 6, @@ -32099,7 +32106,8 @@ class FileUpload extends SvelteComponent$4 { config: 8, confidenceLabel: 9, representations: 10, - moldata: 11 + moldata: 11, + molviewer: 12 }); } } @@ -32107,8 +32115,8 @@ function pretty_si(r) { let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0; for (; r > 1e3 && t < e.length - 1; ) r /= 1e3, t++; - let s = e[t]; - return (Number.isInteger(r) ? r : r.toFixed(1)) + s; + let n = e[t]; + return (Number.isInteger(r) ? r : r.toFixed(1)) + n; } const Loader_svelte_svelte_type_style_lang = "", { SvelteComponent: SvelteComponent$3, @@ -32126,12 +32134,12 @@ const Loader_svelte_svelte_type_style_lang = "", { toggle_class: toggle_class$2 } = window.__gradio__svelte__internal, { onMount } = window.__gradio__svelte__internal; function create_fragment$3(r) { - let e, t, s, f, _, x, h, u, E, c, C, b; + let e, t, n, f, u, y, h, _, E, c, C, b; return { c() { - e = element$3("div"), t = svg_element$1("svg"), s = svg_element$1("g"), f = svg_element$1("path"), _ = svg_element$1("path"), x = svg_element$1("path"), h = svg_element$1("path"), u = svg_element$1("g"), E = svg_element$1("path"), c = svg_element$1("path"), C = svg_element$1("path"), b = svg_element$1("path"), attr$3(f, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), attr$3(f, "fill", "#FF7C00"), attr$3(f, "fill-opacity", "0.4"), attr$3(f, "class", "svelte-43sxxs"), attr$3(_, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), attr$3(_, "fill", "#FF7C00"), attr$3(_, "class", "svelte-43sxxs"), attr$3(x, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), attr$3(x, "fill", "#FF7C00"), attr$3(x, "fill-opacity", "0.4"), attr$3(x, "class", "svelte-43sxxs"), attr$3(h, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), attr$3(h, "fill", "#FF7C00"), attr$3(h, "class", "svelte-43sxxs"), set_style$1(s, "transform", "translate(" + /*$top*/ + e = element$3("div"), t = svg_element$1("svg"), n = svg_element$1("g"), f = svg_element$1("path"), u = svg_element$1("path"), y = svg_element$1("path"), h = svg_element$1("path"), _ = svg_element$1("g"), E = svg_element$1("path"), c = svg_element$1("path"), C = svg_element$1("path"), b = svg_element$1("path"), attr$3(f, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), attr$3(f, "fill", "#FF7C00"), attr$3(f, "fill-opacity", "0.4"), attr$3(f, "class", "svelte-43sxxs"), attr$3(u, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), attr$3(u, "fill", "#FF7C00"), attr$3(u, "class", "svelte-43sxxs"), attr$3(y, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), attr$3(y, "fill", "#FF7C00"), attr$3(y, "fill-opacity", "0.4"), attr$3(y, "class", "svelte-43sxxs"), attr$3(h, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), attr$3(h, "fill", "#FF7C00"), attr$3(h, "class", "svelte-43sxxs"), set_style$1(n, "transform", "translate(" + /*$top*/ r[1][0] + "px, " + /*$top*/ - r[1][1] + "px)"), attr$3(E, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), attr$3(E, "fill", "#FF7C00"), attr$3(E, "fill-opacity", "0.4"), attr$3(E, "class", "svelte-43sxxs"), attr$3(c, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), attr$3(c, "fill", "#FF7C00"), attr$3(c, "class", "svelte-43sxxs"), attr$3(C, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), attr$3(C, "fill", "#FF7C00"), attr$3(C, "fill-opacity", "0.4"), attr$3(C, "class", "svelte-43sxxs"), attr$3(b, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), attr$3(b, "fill", "#FF7C00"), attr$3(b, "class", "svelte-43sxxs"), set_style$1(u, "transform", "translate(" + /*$bottom*/ + r[1][1] + "px)"), attr$3(E, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), attr$3(E, "fill", "#FF7C00"), attr$3(E, "fill-opacity", "0.4"), attr$3(E, "class", "svelte-43sxxs"), attr$3(c, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), attr$3(c, "fill", "#FF7C00"), attr$3(c, "class", "svelte-43sxxs"), attr$3(C, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), attr$3(C, "fill", "#FF7C00"), attr$3(C, "fill-opacity", "0.4"), attr$3(C, "class", "svelte-43sxxs"), attr$3(b, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), attr$3(b, "fill", "#FF7C00"), attr$3(b, "class", "svelte-43sxxs"), set_style$1(_, "transform", "translate(" + /*$bottom*/ r[2][0] + "px, " + /*$bottom*/ r[2][1] + "px)"), attr$3(t, "viewBox", "-1200 -1200 3000 3000"), attr$3(t, "fill", "none"), attr$3(t, "xmlns", "http://www.w3.org/2000/svg"), attr$3(t, "class", "svelte-43sxxs"), attr$3(e, "class", "svelte-43sxxs"), toggle_class$2( e, @@ -32141,14 +32149,14 @@ function create_fragment$3(r) { ); }, m(A, S) { - insert$3(A, e, S), append$3(e, t), append$3(t, s), append$3(s, f), append$3(s, _), append$3(s, x), append$3(s, h), append$3(t, u), append$3(u, E), append$3(u, c), append$3(u, C), append$3(u, b); + insert$3(A, e, S), append$3(e, t), append$3(t, n), append$3(n, f), append$3(n, u), append$3(n, y), append$3(n, h), append$3(t, _), append$3(_, E), append$3(_, c), append$3(_, C), append$3(_, b); }, p(A, [S]) { S & /*$top*/ - 2 && set_style$1(s, "transform", "translate(" + /*$top*/ + 2 && set_style$1(n, "transform", "translate(" + /*$top*/ A[1][0] + "px, " + /*$top*/ A[1][1] + "px)"), S & /*$bottom*/ - 4 && set_style$1(u, "transform", "translate(" + /*$bottom*/ + 4 && set_style$1(_, "transform", "translate(" + /*$bottom*/ A[2][0] + "px, " + /*$bottom*/ A[2][1] + "px)"), S & /*margin*/ 1 && toggle_class$2( @@ -32166,24 +32174,24 @@ function create_fragment$3(r) { }; } function instance$3(r, e, t) { - let s, f, { margin: _ = !0 } = e; - const x = spring([0, 0]); - component_subscribe(r, x, (b) => t(1, s = b)); + let n, f, { margin: u = !0 } = e; + const y = spring([0, 0]); + component_subscribe(r, y, (b) => t(1, n = b)); const h = spring([0, 0]); component_subscribe(r, h, (b) => t(2, f = b)); - let u; + let _; async function E() { - await Promise.all([x.set([125, 140]), h.set([-125, -140])]), await Promise.all([x.set([-125, 140]), h.set([125, -140])]), await Promise.all([x.set([-125, 0]), h.set([125, -0])]), await Promise.all([x.set([125, 0]), h.set([-125, 0])]); + await Promise.all([y.set([125, 140]), h.set([-125, -140])]), await Promise.all([y.set([-125, 140]), h.set([125, -140])]), await Promise.all([y.set([-125, 0]), h.set([125, -0])]), await Promise.all([y.set([125, 0]), h.set([-125, 0])]); } async function c() { - await E(), u || c(); + await E(), _ || c(); } async function C() { - await Promise.all([x.set([125, 0]), h.set([-125, 0])]), c(); + await Promise.all([y.set([125, 0]), h.set([-125, 0])]), c(); } - return onMount(() => (C(), () => u = !0)), r.$$set = (b) => { - "margin" in b && t(0, _ = b.margin); - }, [_, s, f, x, h]; + return onMount(() => (C(), () => _ = !0)), r.$$set = (b) => { + "margin" in b && t(0, u = b.margin); + }, [u, n, f, y, h]; } class Loader extends SvelteComponent$3 { constructor(e) { @@ -32222,23 +32230,23 @@ const index_svelte_svelte_type_style_lang = "", { update_slot_base } = window.__gradio__svelte__internal, { tick } = window.__gradio__svelte__internal, { onDestroy } = window.__gradio__svelte__internal, get_error_slot_changes = (r) => ({}), get_error_slot_context = (r) => ({}); function get_each_context$1(r, e, t) { - const s = r.slice(); - return s[38] = e[t], s[40] = t, s; + const n = r.slice(); + return n[38] = e[t], n[40] = t, n; } function get_each_context_1(r, e, t) { - const s = r.slice(); - return s[38] = e[t], s; + const n = r.slice(); + return n[38] = e[t], n; } function create_if_block_17(r) { let e, t = ( /*i18n*/ r[1]("common.error") + "" - ), s, f, _; - const x = ( + ), n, f, u; + const y = ( /*#slots*/ r[29].error ), h = create_slot( - x, + y, r, /*$$scope*/ r[28], @@ -32246,47 +32254,47 @@ function create_if_block_17(r) { ); return { c() { - e = element$2("span"), s = text$2(t), f = space$1(), h && h.c(), attr$2(e, "class", "error svelte-14miwb5"); + e = element$2("span"), n = text$2(t), f = space$1(), h && h.c(), attr$2(e, "class", "error svelte-14miwb5"); }, - m(u, E) { - insert$2(u, e, E), append$2(e, s), insert$2(u, f, E), h && h.m(u, E), _ = !0; + m(_, E) { + insert$2(_, e, E), append$2(e, n), insert$2(_, f, E), h && h.m(_, E), u = !0; }, - p(u, E) { - (!_ || E[0] & /*i18n*/ + p(_, E) { + (!u || E[0] & /*i18n*/ 2) && t !== (t = /*i18n*/ - u[1]("common.error") + "") && set_data$2(s, t), h && h.p && (!_ || E[0] & /*$$scope*/ + _[1]("common.error") + "") && set_data$2(n, t), h && h.p && (!u || E[0] & /*$$scope*/ 268435456) && update_slot_base( h, - x, - u, + y, + _, /*$$scope*/ - u[28], - _ ? get_slot_changes( - x, + _[28], + u ? get_slot_changes( + y, /*$$scope*/ - u[28], + _[28], E, get_error_slot_changes ) : get_all_dirty_from_scope( /*$$scope*/ - u[28] + _[28] ), get_error_slot_context ); }, - i(u) { - _ || (transition_in$1(h, u), _ = !0); + i(_) { + u || (transition_in$1(h, _), u = !0); }, - o(u) { - transition_out$1(h, u), _ = !1; + o(_) { + transition_out$1(h, _), u = !1; }, - d(u) { - u && (detach$2(e), detach$2(f)), h && h.d(u); + d(_) { + _ && (detach$2(e), detach$2(f)), h && h.d(_); } }; } function create_if_block$1(r) { - let e, t, s, f, _, x, h, u, E, c = ( + let e, t, n, f, u, y, h, _, E, c = ( /*variant*/ r[8] === "default" && /*show_eta_bar*/ r[18] && /*show_progress*/ @@ -32315,7 +32323,7 @@ function create_if_block$1(r) { /*timer*/ r[5] && create_if_block_10(r) ); - const n = [create_if_block_2, create_if_block_9], o = []; + const s = [create_if_block_2, create_if_block_9], o = []; function w(v, a) { return ( /*last_progress_level*/ @@ -32325,12 +32333,12 @@ function create_if_block$1(r) { ) ); } - ~(_ = w(r)) && (x = o[_] = n[_](r)); + ~(u = w(r)) && (y = o[u] = s[u](r)); let p = !/*timer*/ r[5] && create_if_block_1$1(r); return { c() { - c && c.c(), e = space$1(), t = element$2("div"), A && A.c(), s = space$1(), S && S.c(), f = space$1(), x && x.c(), h = space$1(), p && p.c(), u = empty$1(), attr$2(t, "class", "progress-text svelte-14miwb5"), toggle_class$1( + c && c.c(), e = space$1(), t = element$2("div"), A && A.c(), n = space$1(), S && S.c(), f = space$1(), y && y.c(), h = space$1(), p && p.c(), _ = empty$1(), attr$2(t, "class", "progress-text svelte-14miwb5"), toggle_class$1( t, "meta-text-center", /*variant*/ @@ -32343,13 +32351,13 @@ function create_if_block$1(r) { ); }, m(v, a) { - c && c.m(v, a), insert$2(v, e, a), insert$2(v, t, a), A && A.m(t, null), append$2(t, s), S && S.m(t, null), insert$2(v, f, a), ~_ && o[_].m(v, a), insert$2(v, h, a), p && p.m(v, a), insert$2(v, u, a), E = !0; + c && c.m(v, a), insert$2(v, e, a), insert$2(v, t, a), A && A.m(t, null), append$2(t, n), S && S.m(t, null), insert$2(v, f, a), ~u && o[u].m(v, a), insert$2(v, h, a), p && p.m(v, a), insert$2(v, _, a), E = !0; }, p(v, a) { /*variant*/ v[8] === "default" && /*show_eta_bar*/ v[18] && /*show_progress*/ - v[6] === "full" ? c ? c.p(v, a) : (c = create_if_block_16(v), c.c(), c.m(e.parentNode, e)) : c && (c.d(1), c = null), b === (b = C(v)) && A ? A.p(v, a) : (A && A.d(1), A = b && b(v), A && (A.c(), A.m(t, s))), /*timer*/ + v[6] === "full" ? c ? c.p(v, a) : (c = create_if_block_16(v), c.c(), c.m(e.parentNode, e)) : c && (c.d(1), c = null), b === (b = C(v)) && A ? A.p(v, a) : (A && A.d(1), A = b && b(v), A && (A.c(), A.m(t, n))), /*timer*/ v[5] ? S ? S.p(v, a) : (S = create_if_block_10(v), S.c(), S.m(t, null)) : S && (S.d(1), S = null), (!E || a[0] & /*variant*/ 256) && toggle_class$1( t, @@ -32363,20 +32371,20 @@ function create_if_block$1(r) { /*variant*/ v[8] === "default" ); - let l = _; - _ = w(v), _ === l ? ~_ && o[_].p(v, a) : (x && (group_outros$1(), transition_out$1(o[l], 1, 1, () => { + let l = u; + u = w(v), u === l ? ~u && o[u].p(v, a) : (y && (group_outros$1(), transition_out$1(o[l], 1, 1, () => { o[l] = null; - }), check_outros$1()), ~_ ? (x = o[_], x ? x.p(v, a) : (x = o[_] = n[_](v), x.c()), transition_in$1(x, 1), x.m(h.parentNode, h)) : x = null), /*timer*/ - v[5] ? p && (p.d(1), p = null) : p ? p.p(v, a) : (p = create_if_block_1$1(v), p.c(), p.m(u.parentNode, u)); + }), check_outros$1()), ~u ? (y = o[u], y ? y.p(v, a) : (y = o[u] = s[u](v), y.c()), transition_in$1(y, 1), y.m(h.parentNode, h)) : y = null), /*timer*/ + v[5] ? p && (p.d(1), p = null) : p ? p.p(v, a) : (p = create_if_block_1$1(v), p.c(), p.m(_.parentNode, _)); }, i(v) { - E || (transition_in$1(x), E = !0); + E || (transition_in$1(y), E = !0); }, o(v) { - transition_out$1(x), E = !1; + transition_out$1(y), E = !1; }, d(v) { - v && (detach$2(e), detach$2(t), detach$2(f), detach$2(h), detach$2(u)), c && c.d(v), A && A.d(), S && S.d(), ~_ && o[_].d(v), p && p.d(v); + v && (detach$2(e), detach$2(t), detach$2(f), detach$2(h), detach$2(_)), c && c.d(v), A && A.d(), S && S.d(), ~u && o[u].d(v), p && p.d(v); } }; } @@ -32387,16 +32395,16 @@ function create_if_block_16(r) { c() { e = element$2("div"), attr$2(e, "class", "eta-bar svelte-14miwb5"), set_style(e, "transform", t); }, - m(s, f) { - insert$2(s, e, f); + m(n, f) { + insert$2(n, e, f); }, - p(s, f) { + p(n, f) { f[0] & /*eta_level*/ 131072 && t !== (t = `translateX(${/*eta_level*/ - (s[17] || 0) * 100 - 100}%)`) && set_style(e, "transform", t); + (n[17] || 0) * 100 - 100}%)`) && set_style(e, "transform", t); }, - d(s) { - s && detach$2(e); + d(n) { + n && detach$2(e); } }; } @@ -32406,8 +32414,8 @@ function create_if_block_15(r) { c() { e = text$2("processing |"); }, - m(t, s) { - insert$2(t, e, s); + m(t, n) { + insert$2(t, e, n); }, p: noop$1, d(t) { @@ -32419,29 +32427,29 @@ function create_if_block_14(r) { let e, t = ( /*queue_position*/ r[2] + 1 + "" - ), s, f, _, x; + ), n, f, u, y; return { c() { - e = text$2("queue: "), s = text$2(t), f = text$2("/"), _ = text$2( + e = text$2("queue: "), n = text$2(t), f = text$2("/"), u = text$2( /*queue_size*/ r[3] - ), x = text$2(" |"); + ), y = text$2(" |"); }, - m(h, u) { - insert$2(h, e, u), insert$2(h, s, u), insert$2(h, f, u), insert$2(h, _, u), insert$2(h, x, u); + m(h, _) { + insert$2(h, e, _), insert$2(h, n, _), insert$2(h, f, _), insert$2(h, u, _), insert$2(h, y, _); }, - p(h, u) { - u[0] & /*queue_position*/ + p(h, _) { + _[0] & /*queue_position*/ 4 && t !== (t = /*queue_position*/ - h[2] + 1 + "") && set_data$2(s, t), u[0] & /*queue_size*/ + h[2] + 1 + "") && set_data$2(n, t), _[0] & /*queue_size*/ 8 && set_data$2( - _, + u, /*queue_size*/ h[3] ); }, d(h) { - h && (detach$2(e), detach$2(s), detach$2(f), detach$2(_), detach$2(x)); + h && (detach$2(e), detach$2(n), detach$2(f), detach$2(u), detach$2(y)); } }; } @@ -32449,39 +32457,39 @@ function create_if_block_11(r) { let e, t = ensure_array_like$1( /*progress*/ r[7] - ), s = []; + ), n = []; for (let f = 0; f < t.length; f += 1) - s[f] = create_each_block_1(get_each_context_1(r, t, f)); + n[f] = create_each_block_1(get_each_context_1(r, t, f)); return { c() { - for (let f = 0; f < s.length; f += 1) - s[f].c(); + for (let f = 0; f < n.length; f += 1) + n[f].c(); e = empty$1(); }, - m(f, _) { - for (let x = 0; x < s.length; x += 1) - s[x] && s[x].m(f, _); - insert$2(f, e, _); + m(f, u) { + for (let y = 0; y < n.length; y += 1) + n[y] && n[y].m(f, u); + insert$2(f, e, u); }, - p(f, _) { - if (_[0] & /*progress*/ + p(f, u) { + if (u[0] & /*progress*/ 128) { t = ensure_array_like$1( /*progress*/ f[7] ); - let x; - for (x = 0; x < t.length; x += 1) { - const h = get_each_context_1(f, t, x); - s[x] ? s[x].p(h, _) : (s[x] = create_each_block_1(h), s[x].c(), s[x].m(e.parentNode, e)); + let y; + for (y = 0; y < t.length; y += 1) { + const h = get_each_context_1(f, t, y); + n[y] ? n[y].p(h, u) : (n[y] = create_each_block_1(h), n[y].c(), n[y].m(e.parentNode, e)); } - for (; x < s.length; x += 1) - s[x].d(1); - s.length = t.length; + for (; y < n.length; y += 1) + n[y].d(1); + n.length = t.length; } }, d(f) { - f && detach$2(e), destroy_each$1(s, f); + f && detach$2(e), destroy_each$1(n, f); } }; } @@ -32489,28 +32497,28 @@ function create_if_block_12(r) { let e, t = ( /*p*/ r[38].unit + "" - ), s, f, _ = " ", x; + ), n, f, u = " ", y; function h(c, C) { return ( /*p*/ c[38].length != null ? create_if_block_13 : create_else_block$1 ); } - let u = h(r), E = u(r); + let _ = h(r), E = _(r); return { c() { - E.c(), e = space$1(), s = text$2(t), f = text$2(" | "), x = text$2(_); + E.c(), e = space$1(), n = text$2(t), f = text$2(" | "), y = text$2(u); }, m(c, C) { - E.m(c, C), insert$2(c, e, C), insert$2(c, s, C), insert$2(c, f, C), insert$2(c, x, C); + E.m(c, C), insert$2(c, e, C), insert$2(c, n, C), insert$2(c, f, C), insert$2(c, y, C); }, p(c, C) { - u === (u = h(c)) && E ? E.p(c, C) : (E.d(1), E = u(c), E && (E.c(), E.m(e.parentNode, e))), C[0] & /*progress*/ + _ === (_ = h(c)) && E ? E.p(c, C) : (E.d(1), E = _(c), E && (E.c(), E.m(e.parentNode, e))), C[0] & /*progress*/ 128 && t !== (t = /*p*/ - c[38].unit + "") && set_data$2(s, t); + c[38].unit + "") && set_data$2(n, t); }, d(c) { - c && (detach$2(e), detach$2(s), detach$2(f), detach$2(x)), E.d(c); + c && (detach$2(e), detach$2(n), detach$2(f), detach$2(y)), E.d(c); } }; } @@ -32523,18 +32531,18 @@ function create_else_block$1(r) { c() { t = text$2(e); }, - m(s, f) { - insert$2(s, t, f); + m(n, f) { + insert$2(n, t, f); }, - p(s, f) { + p(n, f) { f[0] & /*progress*/ 128 && e !== (e = pretty_si( /*p*/ - s[38].index || 0 + n[38].index || 0 ) + "") && set_data$2(t, e); }, - d(s) { - s && detach$2(t); + d(n) { + n && detach$2(t); } }; } @@ -32542,30 +32550,30 @@ function create_if_block_13(r) { let e = pretty_si( /*p*/ r[38].index || 0 - ) + "", t, s, f = pretty_si( + ) + "", t, n, f = pretty_si( /*p*/ r[38].length - ) + "", _; + ) + "", u; return { c() { - t = text$2(e), s = text$2("/"), _ = text$2(f); + t = text$2(e), n = text$2("/"), u = text$2(f); }, - m(x, h) { - insert$2(x, t, h), insert$2(x, s, h), insert$2(x, _, h); + m(y, h) { + insert$2(y, t, h), insert$2(y, n, h), insert$2(y, u, h); }, - p(x, h) { + p(y, h) { h[0] & /*progress*/ 128 && e !== (e = pretty_si( /*p*/ - x[38].index || 0 + y[38].index || 0 ) + "") && set_data$2(t, e), h[0] & /*progress*/ 128 && f !== (f = pretty_si( /*p*/ - x[38].length - ) + "") && set_data$2(_, f); + y[38].length + ) + "") && set_data$2(u, f); }, - d(x) { - x && (detach$2(t), detach$2(s), detach$2(_)); + d(y) { + y && (detach$2(t), detach$2(n), detach$2(u)); } }; } @@ -32578,15 +32586,15 @@ function create_each_block_1(r) { c() { t && t.c(), e = empty$1(); }, - m(s, f) { - t && t.m(s, f), insert$2(s, e, f); + m(n, f) { + t && t.m(n, f), insert$2(n, e, f); }, - p(s, f) { + p(n, f) { /*p*/ - s[38].index != null ? t ? t.p(s, f) : (t = create_if_block_12(s), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + n[38].index != null ? t ? t.p(n, f) : (t = create_if_block_12(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); }, - d(s) { - s && detach$2(e), t && t.d(s); + d(n) { + n && detach$2(e), t && t.d(n); } }; } @@ -32595,30 +32603,30 @@ function create_if_block_10(r) { /*eta*/ r[0] ? `/${/*formatted_eta*/ r[19]}` : "" - ), s, f; + ), n, f; return { c() { e = text$2( /*formatted_timer*/ r[20] - ), s = text$2(t), f = text$2("s"); + ), n = text$2(t), f = text$2("s"); }, - m(_, x) { - insert$2(_, e, x), insert$2(_, s, x), insert$2(_, f, x); + m(u, y) { + insert$2(u, e, y), insert$2(u, n, y), insert$2(u, f, y); }, - p(_, x) { - x[0] & /*formatted_timer*/ + p(u, y) { + y[0] & /*formatted_timer*/ 1048576 && set_data$2( e, /*formatted_timer*/ - _[20] - ), x[0] & /*eta, formatted_eta*/ + u[20] + ), y[0] & /*eta, formatted_eta*/ 524289 && t !== (t = /*eta*/ - _[0] ? `/${/*formatted_eta*/ - _[19]}` : "") && set_data$2(s, t); + u[0] ? `/${/*formatted_eta*/ + u[19]}` : "") && set_data$2(n, t); }, - d(_) { - _ && (detach$2(e), detach$2(s), detach$2(f)); + d(u) { + u && (detach$2(e), detach$2(n), detach$2(f)); } }; } @@ -32633,49 +32641,49 @@ function create_if_block_9(r) { c() { create_component$1(e.$$.fragment); }, - m(s, f) { - mount_component$1(e, s, f), t = !0; + m(n, f) { + mount_component$1(e, n, f), t = !0; }, - p(s, f) { - const _ = {}; + p(n, f) { + const u = {}; f[0] & /*variant*/ - 256 && (_.margin = /*variant*/ - s[8] === "default"), e.$set(_); + 256 && (u.margin = /*variant*/ + n[8] === "default"), e.$set(u); }, - i(s) { - t || (transition_in$1(e.$$.fragment, s), t = !0); + i(n) { + t || (transition_in$1(e.$$.fragment, n), t = !0); }, - o(s) { - transition_out$1(e.$$.fragment, s), t = !1; + o(n) { + transition_out$1(e.$$.fragment, n), t = !1; }, - d(s) { - destroy_component$1(e, s); + d(n) { + destroy_component$1(e, n); } }; } function create_if_block_2(r) { - let e, t, s, f, _, x = `${/*last_progress_level*/ + let e, t, n, f, u, y = `${/*last_progress_level*/ r[15] * 100}%`, h = ( /*progress*/ r[7] != null && create_if_block_3(r) ); return { c() { - e = element$2("div"), t = element$2("div"), h && h.c(), s = space$1(), f = element$2("div"), _ = element$2("div"), attr$2(t, "class", "progress-level-inner svelte-14miwb5"), attr$2(_, "class", "progress-bar svelte-14miwb5"), set_style(_, "width", x), attr$2(f, "class", "progress-bar-wrap svelte-14miwb5"), attr$2(e, "class", "progress-level svelte-14miwb5"); + e = element$2("div"), t = element$2("div"), h && h.c(), n = space$1(), f = element$2("div"), u = element$2("div"), attr$2(t, "class", "progress-level-inner svelte-14miwb5"), attr$2(u, "class", "progress-bar svelte-14miwb5"), set_style(u, "width", y), attr$2(f, "class", "progress-bar-wrap svelte-14miwb5"), attr$2(e, "class", "progress-level svelte-14miwb5"); }, - m(u, E) { - insert$2(u, e, E), append$2(e, t), h && h.m(t, null), append$2(e, s), append$2(e, f), append$2(f, _), r[30](_); + m(_, E) { + insert$2(_, e, E), append$2(e, t), h && h.m(t, null), append$2(e, n), append$2(e, f), append$2(f, u), r[30](u); }, - p(u, E) { + p(_, E) { /*progress*/ - u[7] != null ? h ? h.p(u, E) : (h = create_if_block_3(u), h.c(), h.m(t, null)) : h && (h.d(1), h = null), E[0] & /*last_progress_level*/ - 32768 && x !== (x = `${/*last_progress_level*/ - u[15] * 100}%`) && set_style(_, "width", x); + _[7] != null ? h ? h.p(_, E) : (h = create_if_block_3(_), h.c(), h.m(t, null)) : h && (h.d(1), h = null), E[0] & /*last_progress_level*/ + 32768 && y !== (y = `${/*last_progress_level*/ + _[15] * 100}%`) && set_style(u, "width", y); }, i: noop$1, o: noop$1, - d(u) { - u && detach$2(e), h && h.d(), r[30](null); + d(_) { + _ && detach$2(e), h && h.d(), r[30](null); } }; } @@ -32683,47 +32691,47 @@ function create_if_block_3(r) { let e, t = ensure_array_like$1( /*progress*/ r[7] - ), s = []; + ), n = []; for (let f = 0; f < t.length; f += 1) - s[f] = create_each_block$1(get_each_context$1(r, t, f)); + n[f] = create_each_block$1(get_each_context$1(r, t, f)); return { c() { - for (let f = 0; f < s.length; f += 1) - s[f].c(); + for (let f = 0; f < n.length; f += 1) + n[f].c(); e = empty$1(); }, - m(f, _) { - for (let x = 0; x < s.length; x += 1) - s[x] && s[x].m(f, _); - insert$2(f, e, _); + m(f, u) { + for (let y = 0; y < n.length; y += 1) + n[y] && n[y].m(f, u); + insert$2(f, e, u); }, - p(f, _) { - if (_[0] & /*progress_level, progress*/ + p(f, u) { + if (u[0] & /*progress_level, progress*/ 16512) { t = ensure_array_like$1( /*progress*/ f[7] ); - let x; - for (x = 0; x < t.length; x += 1) { - const h = get_each_context$1(f, t, x); - s[x] ? s[x].p(h, _) : (s[x] = create_each_block$1(h), s[x].c(), s[x].m(e.parentNode, e)); + let y; + for (y = 0; y < t.length; y += 1) { + const h = get_each_context$1(f, t, y); + n[y] ? n[y].p(h, u) : (n[y] = create_each_block$1(h), n[y].c(), n[y].m(e.parentNode, e)); } - for (; x < s.length; x += 1) - s[x].d(1); - s.length = t.length; + for (; y < n.length; y += 1) + n[y].d(1); + n.length = t.length; } }, d(f) { - f && detach$2(e), destroy_each$1(s, f); + f && detach$2(e), destroy_each$1(n, f); } }; } function create_if_block_4(r) { - let e, t, s, f, _ = ( + let e, t, n, f, u = ( /*i*/ r[40] !== 0 && create_if_block_8() - ), x = ( + ), y = ( /*p*/ r[38].desc != null && create_if_block_7(r) ), h = ( @@ -32734,30 +32742,30 @@ function create_if_block_4(r) { /*i*/ r[40] ] != null && create_if_block_6() - ), u = ( + ), _ = ( /*progress_level*/ r[14] != null && create_if_block_5(r) ); return { c() { - _ && _.c(), e = space$1(), x && x.c(), t = space$1(), h && h.c(), s = space$1(), u && u.c(), f = empty$1(); + u && u.c(), e = space$1(), y && y.c(), t = space$1(), h && h.c(), n = space$1(), _ && _.c(), f = empty$1(); }, m(E, c) { - _ && _.m(E, c), insert$2(E, e, c), x && x.m(E, c), insert$2(E, t, c), h && h.m(E, c), insert$2(E, s, c), u && u.m(E, c), insert$2(E, f, c); + u && u.m(E, c), insert$2(E, e, c), y && y.m(E, c), insert$2(E, t, c), h && h.m(E, c), insert$2(E, n, c), _ && _.m(E, c), insert$2(E, f, c); }, p(E, c) { /*p*/ - E[38].desc != null ? x ? x.p(E, c) : (x = create_if_block_7(E), x.c(), x.m(t.parentNode, t)) : x && (x.d(1), x = null), /*p*/ + E[38].desc != null ? y ? y.p(E, c) : (y = create_if_block_7(E), y.c(), y.m(t.parentNode, t)) : y && (y.d(1), y = null), /*p*/ E[38].desc != null && /*progress_level*/ E[14] && /*progress_level*/ E[14][ /*i*/ E[40] - ] != null ? h || (h = create_if_block_6(), h.c(), h.m(s.parentNode, s)) : h && (h.d(1), h = null), /*progress_level*/ - E[14] != null ? u ? u.p(E, c) : (u = create_if_block_5(E), u.c(), u.m(f.parentNode, f)) : u && (u.d(1), u = null); + ] != null ? h || (h = create_if_block_6(), h.c(), h.m(n.parentNode, n)) : h && (h.d(1), h = null), /*progress_level*/ + E[14] != null ? _ ? _.p(E, c) : (_ = create_if_block_5(E), _.c(), _.m(f.parentNode, f)) : _ && (_.d(1), _ = null); }, d(E) { - E && (detach$2(e), detach$2(t), detach$2(s), detach$2(f)), _ && _.d(E), x && x.d(E), h && h.d(E), u && u.d(E); + E && (detach$2(e), detach$2(t), detach$2(n), detach$2(f)), u && u.d(E), y && y.d(E), h && h.d(E), _ && _.d(E); } }; } @@ -32767,8 +32775,8 @@ function create_if_block_8(r) { c() { e = text$2(" /"); }, - m(t, s) { - insert$2(t, e, s); + m(t, n) { + insert$2(t, e, n); }, d(t) { t && detach$2(e); @@ -32784,16 +32792,16 @@ function create_if_block_7(r) { c() { t = text$2(e); }, - m(s, f) { - insert$2(s, t, f); + m(n, f) { + insert$2(n, t, f); }, - p(s, f) { + p(n, f) { f[0] & /*progress*/ 128 && e !== (e = /*p*/ - s[38].desc + "") && set_data$2(t, e); + n[38].desc + "") && set_data$2(t, e); }, - d(s) { - s && detach$2(t); + d(n) { + n && detach$2(t); } }; } @@ -32803,8 +32811,8 @@ function create_if_block_6(r) { c() { e = text$2("-"); }, - m(t, s) { - insert$2(t, e, s); + m(t, n) { + insert$2(t, e, n); }, d(t) { t && detach$2(e); @@ -32816,16 +32824,16 @@ function create_if_block_5(r) { (r[14][ /*i*/ r[40] - ] || 0)).toFixed(1) + "", t, s; + ] || 0)).toFixed(1) + "", t, n; return { c() { - t = text$2(e), s = text$2("%"); + t = text$2(e), n = text$2("%"); }, - m(f, _) { - insert$2(f, t, _), insert$2(f, s, _); + m(f, u) { + insert$2(f, t, u), insert$2(f, n, u); }, - p(f, _) { - _[0] & /*progress_level*/ + p(f, u) { + u[0] & /*progress_level*/ 16384 && e !== (e = (100 * /*progress_level*/ (f[14][ /*i*/ @@ -32833,7 +32841,7 @@ function create_if_block_5(r) { ] || 0)).toFixed(1) + "") && set_data$2(t, e); }, d(f) { - f && (detach$2(t), detach$2(s)); + f && (detach$2(t), detach$2(n)); } }; } @@ -32851,20 +32859,20 @@ function create_each_block$1(r) { c() { t && t.c(), e = empty$1(); }, - m(s, f) { - t && t.m(s, f), insert$2(s, e, f); + m(n, f) { + t && t.m(n, f), insert$2(n, e, f); }, - p(s, f) { + p(n, f) { /*p*/ - s[38].desc != null || /*progress_level*/ - s[14] && /*progress_level*/ - s[14][ + n[38].desc != null || /*progress_level*/ + n[14] && /*progress_level*/ + n[14][ /*i*/ - s[40] - ] != null ? t ? t.p(s, f) : (t = create_if_block_4(s), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + n[40] + ] != null ? t ? t.p(n, f) : (t = create_if_block_4(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); }, - d(s) { - s && detach$2(e), t && t.d(s); + d(n) { + n && detach$2(e), t && t.d(n); } }; } @@ -32877,26 +32885,26 @@ function create_if_block_1$1(r) { r[9] ), attr$2(e, "class", "loading svelte-14miwb5"); }, - m(s, f) { - insert$2(s, e, f), append$2(e, t); + m(n, f) { + insert$2(n, e, f), append$2(e, t); }, - p(s, f) { + p(n, f) { f[0] & /*loading_text*/ 512 && set_data$2( t, /*loading_text*/ - s[9] + n[9] ); }, - d(s) { - s && detach$2(e); + d(n) { + n && detach$2(e); } }; } function create_fragment$2(r) { - let e, t, s, f, _; - const x = [create_if_block$1, create_if_block_17], h = []; - function u(E, c) { + let e, t, n, f, u; + const y = [create_if_block$1, create_if_block_17], h = []; + function _(E, c) { return ( /*status*/ E[4] === "pending" ? 0 : ( @@ -32905,9 +32913,9 @@ function create_fragment$2(r) { ) ); } - return ~(t = u(r)) && (s = h[t] = x[t](r)), { + return ~(t = _(r)) && (n = h[t] = y[t](r)), { c() { - e = element$2("div"), s && s.c(), attr$2(e, "class", f = "wrap " + /*variant*/ + e = element$2("div"), n && n.c(), attr$2(e, "class", f = "wrap " + /*variant*/ r[8] + " " + /*show_progress*/ r[6] + " svelte-14miwb5"), toggle_class$1(e, "hide", !/*status*/ r[4] || /*status*/ @@ -32944,20 +32952,20 @@ function create_fragment$2(r) { ); }, m(E, c) { - insert$2(E, e, c), ~t && h[t].m(e, null), r[31](e), _ = !0; + insert$2(E, e, c), ~t && h[t].m(e, null), r[31](e), u = !0; }, p(E, c) { let C = t; - t = u(E), t === C ? ~t && h[t].p(E, c) : (s && (group_outros$1(), transition_out$1(h[C], 1, 1, () => { + t = _(E), t === C ? ~t && h[t].p(E, c) : (n && (group_outros$1(), transition_out$1(h[C], 1, 1, () => { h[C] = null; - }), check_outros$1()), ~t ? (s = h[t], s ? s.p(E, c) : (s = h[t] = x[t](E), s.c()), transition_in$1(s, 1), s.m(e, null)) : s = null), (!_ || c[0] & /*variant, show_progress*/ + }), check_outros$1()), ~t ? (n = h[t], n ? n.p(E, c) : (n = h[t] = y[t](E), n.c()), transition_in$1(n, 1), n.m(e, null)) : n = null), (!u || c[0] & /*variant, show_progress*/ 320 && f !== (f = "wrap " + /*variant*/ E[8] + " " + /*show_progress*/ - E[6] + " svelte-14miwb5")) && attr$2(e, "class", f), (!_ || c[0] & /*variant, show_progress, status, show_progress*/ + E[6] + " svelte-14miwb5")) && attr$2(e, "class", f), (!u || c[0] & /*variant, show_progress, status, show_progress*/ 336) && toggle_class$1(e, "hide", !/*status*/ E[4] || /*status*/ E[4] === "complete" || /*show_progress*/ - E[6] === "hidden"), (!_ || c[0] & /*variant, show_progress, variant, status, translucent, show_progress*/ + E[6] === "hidden"), (!u || c[0] & /*variant, show_progress, variant, status, translucent, show_progress*/ 2384) && toggle_class$1( e, "translucent", @@ -32967,13 +32975,13 @@ function create_fragment$2(r) { E[4] === "error") || /*translucent*/ E[11] || /*show_progress*/ E[6] === "minimal" - ), (!_ || c[0] & /*variant, show_progress, status*/ + ), (!u || c[0] & /*variant, show_progress, status*/ 336) && toggle_class$1( e, "generating", /*status*/ E[4] === "generating" - ), (!_ || c[0] & /*variant, show_progress, border*/ + ), (!u || c[0] & /*variant, show_progress, border*/ 4416) && toggle_class$1( e, "border", @@ -32994,10 +33002,10 @@ function create_fragment$2(r) { ); }, i(E) { - _ || (transition_in$1(s), _ = !0); + u || (transition_in$1(n), u = !0); }, o(E) { - transition_out$1(s), _ = !1; + transition_out$1(n), u = !1; }, d(E) { E && detach$2(e), ~t && h[t].d(), r[31](null); @@ -33013,16 +33021,16 @@ async function scroll_into_view(r, e = !0) { return; await tick(), requestAnimationFrame(() => { let t = [0, 0]; - for (let s = 0; s < items.length; s++) { - const _ = items[s].getBoundingClientRect(); - (s === 0 || _.top + window.scrollY <= t[0]) && (t[0] = _.top + window.scrollY, t[1] = s); + for (let n = 0; n < items.length; n++) { + const u = items[n].getBoundingClientRect(); + (n === 0 || u.top + window.scrollY <= t[0]) && (t[0] = u.top + window.scrollY, t[1] = n); } window.scrollTo({ top: t[0] - 20, behavior: "smooth" }), called = !1, items = []; }); } } function instance$2(r, e, t) { - let s, { $$slots: f = {}, $$scope: _ } = e, { i18n: x } = e, { eta: h = null } = e, { queue: u = !1 } = e, { queue_position: E } = e, { queue_size: c } = e, { status: C } = e, { scroll_to_output: b = !1 } = e, { timer: A = !0 } = e, { show_progress: S = "full" } = e, { message: n = null } = e, { progress: o = null } = e, { variant: w = "default" } = e, { loading_text: p = "Loading..." } = e, { absolute: v = !0 } = e, { translucent: a = !1 } = e, { border: l = !1 } = e, { autoscroll: g } = e, M, L = !1, T = 0, D = 0, R = null, B = 0, P = null, z, F = null, N = !0; + let n, { $$slots: f = {}, $$scope: u } = e, { i18n: y } = e, { eta: h = null } = e, { queue: _ = !1 } = e, { queue_position: E } = e, { queue_size: c } = e, { status: C } = e, { scroll_to_output: b = !1 } = e, { timer: A = !0 } = e, { show_progress: S = "full" } = e, { message: s = null } = e, { progress: o = null } = e, { variant: w = "default" } = e, { loading_text: p = "Loading..." } = e, { absolute: v = !0 } = e, { translucent: a = !1 } = e, { border: l = !1 } = e, { autoscroll: g } = e, M, L = !1, T = 0, D = 0, I = null, z = 0, P = null, B, F = null, N = !0; const $ = () => { t(25, T = performance.now()), t(26, D = 0), L = !0, k(); }; @@ -33040,7 +33048,7 @@ function instance$2(r, e, t) { let H = null; function U(Q) { binding_callbacks[Q ? "unshift" : "push"](() => { - F = Q, t(16, F), t(7, o), t(14, P), t(15, z); + F = Q, t(16, F), t(7, o), t(14, P), t(15, B); }); } function V(Q) { @@ -33049,25 +33057,25 @@ function instance$2(r, e, t) { }); } return r.$$set = (Q) => { - "i18n" in Q && t(1, x = Q.i18n), "eta" in Q && t(0, h = Q.eta), "queue" in Q && t(21, u = Q.queue), "queue_position" in Q && t(2, E = Q.queue_position), "queue_size" in Q && t(3, c = Q.queue_size), "status" in Q && t(4, C = Q.status), "scroll_to_output" in Q && t(22, b = Q.scroll_to_output), "timer" in Q && t(5, A = Q.timer), "show_progress" in Q && t(6, S = Q.show_progress), "message" in Q && t(23, n = Q.message), "progress" in Q && t(7, o = Q.progress), "variant" in Q && t(8, w = Q.variant), "loading_text" in Q && t(9, p = Q.loading_text), "absolute" in Q && t(10, v = Q.absolute), "translucent" in Q && t(11, a = Q.translucent), "border" in Q && t(12, l = Q.border), "autoscroll" in Q && t(24, g = Q.autoscroll), "$$scope" in Q && t(28, _ = Q.$$scope); + "i18n" in Q && t(1, y = Q.i18n), "eta" in Q && t(0, h = Q.eta), "queue" in Q && t(21, _ = Q.queue), "queue_position" in Q && t(2, E = Q.queue_position), "queue_size" in Q && t(3, c = Q.queue_size), "status" in Q && t(4, C = Q.status), "scroll_to_output" in Q && t(22, b = Q.scroll_to_output), "timer" in Q && t(5, A = Q.timer), "show_progress" in Q && t(6, S = Q.show_progress), "message" in Q && t(23, s = Q.message), "progress" in Q && t(7, o = Q.progress), "variant" in Q && t(8, w = Q.variant), "loading_text" in Q && t(9, p = Q.loading_text), "absolute" in Q && t(10, v = Q.absolute), "translucent" in Q && t(11, a = Q.translucent), "border" in Q && t(12, l = Q.border), "autoscroll" in Q && t(24, g = Q.autoscroll), "$$scope" in Q && t(28, u = Q.$$scope); }, r.$$.update = () => { r.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/ - 169869313 && (h === null ? t(0, h = R) : u && t(0, h = (performance.now() - T) / 1e3 + h), h != null && (t(19, H = h.toFixed(1)), t(27, R = h))), r.$$.dirty[0] & /*eta, timer_diff*/ - 67108865 && t(17, B = h === null || h <= 0 || !D ? null : Math.min(D / h, 1)), r.$$.dirty[0] & /*progress*/ + 169869313 && (h === null ? t(0, h = I) : _ && t(0, h = (performance.now() - T) / 1e3 + h), h != null && (t(19, H = h.toFixed(1)), t(27, I = h))), r.$$.dirty[0] & /*eta, timer_diff*/ + 67108865 && t(17, z = h === null || h <= 0 || !D ? null : Math.min(D / h, 1)), r.$$.dirty[0] & /*progress*/ 128 && o != null && t(18, N = !1), r.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ 114816 && (o != null ? t(14, P = o.map((Q) => { if (Q.index != null && Q.length != null) return Q.index / Q.length; if (Q.progress != null) return Q.progress; - })) : t(14, P = null), P ? (t(15, z = P[P.length - 1]), F && (z === 0 ? t(16, F.style.transition = "0", F) : t(16, F.style.transition = "150ms", F))) : t(15, z = void 0)), r.$$.dirty[0] & /*status*/ + })) : t(14, P = null), P ? (t(15, B = P[P.length - 1]), F && (B === 0 ? t(16, F.style.transition = "0", F) : t(16, F.style.transition = "150ms", F))) : t(15, B = void 0)), r.$$.dirty[0] & /*status*/ 16 && (C === "pending" ? $() : G()), r.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ 20979728 && M && b && (C === "pending" || C === "complete") && scroll_into_view(M, g), r.$$.dirty[0] & /*status, message*/ 8388624, r.$$.dirty[0] & /*timer_diff*/ - 67108864 && t(20, s = D.toFixed(1)); + 67108864 && t(20, n = D.toFixed(1)); }, [ h, - x, + y, E, c, C, @@ -33081,20 +33089,20 @@ function instance$2(r, e, t) { l, M, P, - z, - F, B, + F, + z, N, H, - s, - u, - b, n, + _, + b, + s, g, T, D, - R, - _, + I, + u, f, U, V @@ -33156,10 +33164,10 @@ function create_fragment$1(r) { ) : ( /*value*/ r[0] - )) + "", s; + )) + "", n; return { c() { - e = element$1("div"), s = text$1(t), attr$1(e, "class", "svelte-1hgn91n"), toggle_class( + e = element$1("div"), n = text$1(t), attr$1(e, "class", "svelte-1hgn91n"), toggle_class( e, "table", /*type*/ @@ -33176,11 +33184,11 @@ function create_fragment$1(r) { r[2] ); }, - m(f, _) { - insert$1(f, e, _), append$1(e, s); + m(f, u) { + insert$1(f, e, u), append$1(e, n); }, - p(f, [_]) { - _ & /*value*/ + p(f, [u]) { + u & /*value*/ 1 && t !== (t = (Array.isArray( /*value*/ f[0] @@ -33190,19 +33198,19 @@ function create_fragment$1(r) { ) : ( /*value*/ f[0] - )) + "") && set_data$1(s, t), _ & /*type*/ + )) + "") && set_data$1(n, t), u & /*type*/ 2 && toggle_class( e, "table", /*type*/ f[1] === "table" - ), _ & /*type*/ + ), u & /*type*/ 2 && toggle_class( e, "gallery", /*type*/ f[1] === "gallery" - ), _ & /*selected*/ + ), u & /*selected*/ 4 && toggle_class( e, "selected", @@ -33218,10 +33226,10 @@ function create_fragment$1(r) { }; } function instance$1(r, e, t) { - let { value: s } = e, { type: f } = e, { selected: _ = !1 } = e; - return r.$$set = (x) => { - "value" in x && t(0, s = x.value), "type" in x && t(1, f = x.type), "selected" in x && t(2, _ = x.selected); - }, [s, f, _]; + let { value: n } = e, { type: f } = e, { selected: u = !1 } = e; + return r.$$set = (y) => { + "value" in y && t(0, n = y.value), "type" in y && t(1, f = y.type), "selected" in y && t(2, u = y.selected); + }, [n, f, u]; } class Example extends SvelteComponent$1 { constructor(e) { @@ -33257,8 +33265,8 @@ const Index_svelte_svelte_type_style_lang = "", { transition_out } = window.__gradio__svelte__internal; function get_each_context(r, e, t) { - const s = r.slice(); - return s[39] = e[t], s; + const n = r.slice(); + return n[40] = e[t], n; } function create_else_block(r) { let e, t; @@ -33274,19 +33282,19 @@ function create_else_block(r) { ), value: ( /*_value*/ - r[21] + r[22] ), file_count: ( /*file_count*/ - r[17] + r[18] ), file_types: ( /*file_types*/ - r[18] + r[19] ), selectable: ( /*_selectable*/ - r[11] + r[12] ), root: ( /*root*/ @@ -33298,7 +33306,7 @@ function create_else_block(r) { ), representations: ( /*representations*/ - r[23] + r[24] ), config: ( /*config*/ @@ -33310,11 +33318,15 @@ function create_else_block(r) { ), moldata: ( /*moldata*/ - r[19] + r[20] + ), + molviewer: ( + /*showviewer*/ + r[11] ), i18n: ( /*gradio*/ - r[16].i18n + r[17].i18n ), $$slots: { default: [create_default_slot_1] }, $$scope: { ctx: r } @@ -33322,72 +33334,74 @@ function create_else_block(r) { }), e.$on( "change", /*change_handler*/ - r[29] + r[30] ), e.$on( "drag", /*drag_handler*/ - r[30] + r[31] ), e.$on( "clear", /*clear_handler*/ - r[31] + r[32] ), e.$on( "select", /*select_handler_1*/ - r[32] + r[33] ), e.$on( "notfound", /*notfound_handler*/ - r[33] + r[34] ), e.$on( "upload", /*upload_handler*/ - r[34] + r[35] ), { c() { create_component(e.$$.fragment); }, - m(s, f) { - mount_component(e, s, f), t = !0; + m(n, f) { + mount_component(e, n, f), t = !0; }, - p(s, f) { - const _ = {}; + p(n, f) { + const u = {}; f[0] & /*label*/ - 64 && (_.label = /*label*/ - s[6]), f[0] & /*show_label*/ - 128 && (_.show_label = /*show_label*/ - s[7]), f[0] & /*_value*/ - 2097152 && (_.value = /*_value*/ - s[21]), f[0] & /*file_count*/ - 131072 && (_.file_count = /*file_count*/ - s[17]), f[0] & /*file_types*/ - 262144 && (_.file_types = /*file_types*/ - s[18]), f[0] & /*_selectable*/ - 2048 && (_.selectable = /*_selectable*/ - s[11]), f[0] & /*root*/ - 32 && (_.root = /*root*/ - s[5]), f[0] & /*height*/ - 256 && (_.height = /*height*/ - s[8]), f[0] & /*config*/ - 512 && (_.config = /*config*/ - s[9]), f[0] & /*confidenceLabel*/ - 1024 && (_.confidenceLabel = /*confidenceLabel*/ - s[10]), f[0] & /*moldata*/ - 524288 && (_.moldata = /*moldata*/ - s[19]), f[0] & /*gradio*/ - 65536 && (_.i18n = /*gradio*/ - s[16].i18n), f[0] & /*gradio*/ - 65536 | f[1] & /*$$scope*/ - 2048 && (_.$$scope = { dirty: f, ctx: s }), e.$set(_); + 64 && (u.label = /*label*/ + n[6]), f[0] & /*show_label*/ + 128 && (u.show_label = /*show_label*/ + n[7]), f[0] & /*_value*/ + 4194304 && (u.value = /*_value*/ + n[22]), f[0] & /*file_count*/ + 262144 && (u.file_count = /*file_count*/ + n[18]), f[0] & /*file_types*/ + 524288 && (u.file_types = /*file_types*/ + n[19]), f[0] & /*_selectable*/ + 4096 && (u.selectable = /*_selectable*/ + n[12]), f[0] & /*root*/ + 32 && (u.root = /*root*/ + n[5]), f[0] & /*height*/ + 256 && (u.height = /*height*/ + n[8]), f[0] & /*config*/ + 512 && (u.config = /*config*/ + n[9]), f[0] & /*confidenceLabel*/ + 1024 && (u.confidenceLabel = /*confidenceLabel*/ + n[10]), f[0] & /*moldata*/ + 1048576 && (u.moldata = /*moldata*/ + n[20]), f[0] & /*showviewer*/ + 2048 && (u.molviewer = /*showviewer*/ + n[11]), f[0] & /*gradio*/ + 131072 && (u.i18n = /*gradio*/ + n[17].i18n), f[0] & /*gradio*/ + 131072 | f[1] & /*$$scope*/ + 4096 && (u.$$scope = { dirty: f, ctx: n }), e.$set(u); }, - i(s) { - t || (transition_in(e.$$.fragment, s), t = !0); + i(n) { + t || (transition_in(e.$$.fragment, n), t = !0); }, - o(s) { - transition_out(e.$$.fragment, s), t = !1; + o(n) { + transition_out(e.$$.fragment, n), t = !1; }, - d(s) { - destroy_component(e, s); + d(n) { + destroy_component(e, n); } }; } @@ -33397,11 +33411,11 @@ function create_if_block_1(r) { props: { selectable: ( /*_selectable*/ - r[11] + r[12] ), value: ( /*_value*/ - r[21] + r[22] ), label: ( /*label*/ @@ -33417,7 +33431,7 @@ function create_if_block_1(r) { ), representations: ( /*representations*/ - r[23] + r[24] ), config: ( /*config*/ @@ -33429,60 +33443,66 @@ function create_if_block_1(r) { ), moldata: ( /*moldata*/ - r[19] + r[20] ), errors: ( /*errors*/ - r[20] + r[21] ), i18n: ( /*gradio*/ - r[16].i18n + r[17].i18n + ), + molviewer: ( + /*showviewer*/ + r[11] ) } }), e.$on( "select", /*select_handler*/ - r[28] + r[29] ), { c() { create_component(e.$$.fragment); }, - m(s, f) { - mount_component(e, s, f), t = !0; + m(n, f) { + mount_component(e, n, f), t = !0; }, - p(s, f) { - const _ = {}; + p(n, f) { + const u = {}; f[0] & /*_selectable*/ - 2048 && (_.selectable = /*_selectable*/ - s[11]), f[0] & /*_value*/ - 2097152 && (_.value = /*_value*/ - s[21]), f[0] & /*label*/ - 64 && (_.label = /*label*/ - s[6]), f[0] & /*show_label*/ - 128 && (_.show_label = /*show_label*/ - s[7]), f[0] & /*height*/ - 256 && (_.height = /*height*/ - s[8]), f[0] & /*config*/ - 512 && (_.config = /*config*/ - s[9]), f[0] & /*confidenceLabel*/ - 1024 && (_.confidenceLabel = /*confidenceLabel*/ - s[10]), f[0] & /*moldata*/ - 524288 && (_.moldata = /*moldata*/ - s[19]), f[0] & /*errors*/ - 1048576 && (_.errors = /*errors*/ - s[20]), f[0] & /*gradio*/ - 65536 && (_.i18n = /*gradio*/ - s[16].i18n), e.$set(_); + 4096 && (u.selectable = /*_selectable*/ + n[12]), f[0] & /*_value*/ + 4194304 && (u.value = /*_value*/ + n[22]), f[0] & /*label*/ + 64 && (u.label = /*label*/ + n[6]), f[0] & /*show_label*/ + 128 && (u.show_label = /*show_label*/ + n[7]), f[0] & /*height*/ + 256 && (u.height = /*height*/ + n[8]), f[0] & /*config*/ + 512 && (u.config = /*config*/ + n[9]), f[0] & /*confidenceLabel*/ + 1024 && (u.confidenceLabel = /*confidenceLabel*/ + n[10]), f[0] & /*moldata*/ + 1048576 && (u.moldata = /*moldata*/ + n[20]), f[0] & /*errors*/ + 2097152 && (u.errors = /*errors*/ + n[21]), f[0] & /*gradio*/ + 131072 && (u.i18n = /*gradio*/ + n[17].i18n), f[0] & /*showviewer*/ + 2048 && (u.molviewer = /*showviewer*/ + n[11]), e.$set(u); }, - i(s) { - t || (transition_in(e.$$.fragment, s), t = !0); + i(n) { + t || (transition_in(e.$$.fragment, n), t = !0); }, - o(s) { - transition_out(e.$$.fragment, s), t = !1; + o(n) { + transition_out(e.$$.fragment, n), t = !1; }, - d(s) { - destroy_component(e, s); + d(n) { + destroy_component(e, n); } }; } @@ -33492,7 +33512,7 @@ function create_default_slot_1(r) { props: { i18n: ( /*gradio*/ - r[16].i18n + r[17].i18n ), type: "file" } @@ -33500,59 +33520,59 @@ function create_default_slot_1(r) { c() { create_component(e.$$.fragment); }, - m(s, f) { - mount_component(e, s, f), t = !0; + m(n, f) { + mount_component(e, n, f), t = !0; }, - p(s, f) { - const _ = {}; + p(n, f) { + const u = {}; f[0] & /*gradio*/ - 65536 && (_.i18n = /*gradio*/ - s[16].i18n), e.$set(_); + 131072 && (u.i18n = /*gradio*/ + n[17].i18n), e.$set(u); }, - i(s) { - t || (transition_in(e.$$.fragment, s), t = !0); + i(n) { + t || (transition_in(e.$$.fragment, n), t = !0); }, - o(s) { - transition_out(e.$$.fragment, s), t = !1; + o(n) { + transition_out(e.$$.fragment, n), t = !1; }, - d(s) { - destroy_component(e, s); + d(n) { + destroy_component(e, n); } }; } function create_if_block(r) { - let e, t, s, f, _, x, h, u, E, c, C = ensure_array_like( + let e, t, n, f, u, y, h, _, E, c, C = ensure_array_like( /*errors*/ - r[20] + r[21] ), b = []; for (let A = 0; A < C.length; A += 1) b[A] = create_each_block(get_each_context(r, C, A)); return { c() { - e = element("div"), t = svg_element("svg"), s = svg_element("path"), f = space(), _ = element("span"), _.textContent = "Error in the representations", x = space(), h = element("div"), u = element("span"), u.textContent = "Couldn't display Molecule. Fix the following problems:", E = space(), c = element("ul"); + e = element("div"), t = svg_element("svg"), n = svg_element("path"), f = space(), u = element("span"), u.textContent = "Error in the representations", y = space(), h = element("div"), _ = element("span"), _.textContent = "Couldn't display Molecule. Fix the following problems:", E = space(), c = element("ul"); for (let A = 0; A < b.length; A += 1) b[A].c(); - attr(s, "stroke-linecap", "round"), attr(s, "stroke-linejoin", "round"), attr(s, "d", "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"), attr(t, "class", "flex-shrink-0 inline w-4 h-4 mr-3 mt-[2px] svelte-1j3z0by"), attr(t, "xmlns", "http://www.w3.org/2000/svg"), attr(t, "fill", "none"), attr(t, "viewBox", "0 0 24 24"), attr(t, "stroke-width", "1.5"), attr(t, "stroke", "currentColor"), attr(_, "class", "sr-only svelte-1j3z0by"), attr(u, "class", "font-medium svelte-1j3z0by"), attr(c, "class", "mt-1.5 ml-4 list-disc list-inside svelte-1j3z0by"), attr(e, "class", "flex m-2 p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400 svelte-1j3z0by"), attr(e, "role", "alert"); + attr(n, "stroke-linecap", "round"), attr(n, "stroke-linejoin", "round"), attr(n, "d", "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"), attr(t, "class", "flex-shrink-0 inline w-4 h-4 mr-3 mt-[2px] svelte-1j3z0by"), attr(t, "xmlns", "http://www.w3.org/2000/svg"), attr(t, "fill", "none"), attr(t, "viewBox", "0 0 24 24"), attr(t, "stroke-width", "1.5"), attr(t, "stroke", "currentColor"), attr(u, "class", "sr-only svelte-1j3z0by"), attr(_, "class", "font-medium svelte-1j3z0by"), attr(c, "class", "mt-1.5 ml-4 list-disc list-inside svelte-1j3z0by"), attr(e, "class", "flex m-2 p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400 svelte-1j3z0by"), attr(e, "role", "alert"); }, m(A, S) { - insert(A, e, S), append(e, t), append(t, s), append(e, f), append(e, _), append(e, x), append(e, h), append(h, u), append(h, E), append(h, c); - for (let n = 0; n < b.length; n += 1) - b[n] && b[n].m(c, null); + insert(A, e, S), append(e, t), append(t, n), append(e, f), append(e, u), append(e, y), append(e, h), append(h, _), append(h, E), append(h, c); + for (let s = 0; s < b.length; s += 1) + b[s] && b[s].m(c, null); }, p(A, S) { if (S[0] & /*errors*/ - 1048576) { + 2097152) { C = ensure_array_like( /*errors*/ - A[20] + A[21] ); - let n; - for (n = 0; n < C.length; n += 1) { - const o = get_each_context(A, C, n); - b[n] ? b[n].p(o, S) : (b[n] = create_each_block(o), b[n].c(), b[n].m(c, null)); + let s; + for (s = 0; s < C.length; s += 1) { + const o = get_each_context(A, C, s); + b[s] ? b[s].p(o, S) : (b[s] = create_each_block(o), b[s].c(), b[s].m(c, null)); } - for (; n < b.length; n += 1) - b[n].d(1); + for (; s < b.length; s += 1) + b[s].d(1); b.length = C.length; } }, @@ -33564,19 +33584,19 @@ function create_if_block(r) { function create_each_block(r) { let e, t = ( /*error*/ - r[39] + "" - ), s; + r[40] + "" + ), n; return { c() { - e = element("li"), s = text(t); + e = element("li"), n = text(t); }, - m(f, _) { - insert(f, e, _), append(e, s); + m(f, u) { + insert(f, e, u), append(e, n); }, - p(f, _) { - _[0] & /*errors*/ - 1048576 && t !== (t = /*error*/ - f[39] + "") && set_data(s, t); + p(f, u) { + u[0] & /*errors*/ + 2097152 && t !== (t = /*error*/ + f[40] + "") && set_data(n, t); }, d(f) { f && detach(e); @@ -33585,96 +33605,96 @@ function create_each_block(r) { } function create_default_slot(r) { var S; - let e, t, s, f, _, x, h; - const u = [ + let e, t, n, f, u, y, h; + const _ = [ { autoscroll: ( /*gradio*/ - r[16].autoscroll + r[17].autoscroll ) }, { i18n: ( /*gradio*/ - r[16].i18n + r[17].i18n ) }, /*loading_status*/ - r[12], + r[13], { status: ( /*loading_status*/ - ((S = r[12]) == null ? void 0 : S.status) || "complete" + ((S = r[13]) == null ? void 0 : S.status) || "complete" ) } ]; let E = {}; - for (let n = 0; n < u.length; n += 1) - E = assign(E, u[n]); + for (let s = 0; s < _.length; s += 1) + E = assign(E, _[s]); e = new Static({ props: E }); const c = [create_if_block_1, create_else_block], C = []; - function b(n, o) { + function b(s, o) { return ( /*interactive*/ - n[4] ? 1 : 0 + s[4] ? 1 : 0 ); } - s = b(r), f = C[s] = c[s](r); + n = b(r), f = C[n] = c[n](r); let A = ( /*errors*/ - r[20].length > 0 && /*_value*/ - r[21] !== null && create_if_block(r) + r[21].length > 0 && /*_value*/ + r[22] !== null && create_if_block(r) ); return { c() { - create_component(e.$$.fragment), t = space(), f.c(), _ = space(), A && A.c(), x = empty(); + create_component(e.$$.fragment), t = space(), f.c(), u = space(), A && A.c(), y = empty(); }, - m(n, o) { - mount_component(e, n, o), insert(n, t, o), C[s].m(n, o), insert(n, _, o), A && A.m(n, o), insert(n, x, o), h = !0; + m(s, o) { + mount_component(e, s, o), insert(s, t, o), C[n].m(s, o), insert(s, u, o), A && A.m(s, o), insert(s, y, o), h = !0; }, - p(n, o) { + p(s, o) { var v; const w = o[0] & /*gradio, loading_status*/ - 69632 ? get_spread_update(u, [ + 139264 ? get_spread_update(_, [ o[0] & /*gradio*/ - 65536 && { + 131072 && { autoscroll: ( /*gradio*/ - n[16].autoscroll + s[17].autoscroll ) }, o[0] & /*gradio*/ - 65536 && { i18n: ( + 131072 && { i18n: ( /*gradio*/ - n[16].i18n + s[17].i18n ) }, o[0] & /*loading_status*/ - 4096 && get_spread_object( + 8192 && get_spread_object( /*loading_status*/ - n[12] + s[13] ), o[0] & /*loading_status*/ - 4096 && { + 8192 && { status: ( /*loading_status*/ - ((v = n[12]) == null ? void 0 : v.status) || "complete" + ((v = s[13]) == null ? void 0 : v.status) || "complete" ) } ]) : {}; e.$set(w); - let p = s; - s = b(n), s === p ? C[s].p(n, o) : (group_outros(), transition_out(C[p], 1, 1, () => { + let p = n; + n = b(s), n === p ? C[n].p(s, o) : (group_outros(), transition_out(C[p], 1, 1, () => { C[p] = null; - }), check_outros(), f = C[s], f ? f.p(n, o) : (f = C[s] = c[s](n), f.c()), transition_in(f, 1), f.m(_.parentNode, _)), /*errors*/ - n[20].length > 0 && /*_value*/ - n[21] !== null ? A ? A.p(n, o) : (A = create_if_block(n), A.c(), A.m(x.parentNode, x)) : A && (A.d(1), A = null); + }), check_outros(), f = C[n], f ? f.p(s, o) : (f = C[n] = c[n](s), f.c()), transition_in(f, 1), f.m(u.parentNode, u)), /*errors*/ + s[21].length > 0 && /*_value*/ + s[22] !== null ? A ? A.p(s, o) : (A = create_if_block(s), A.c(), A.m(y.parentNode, y)) : A && (A.d(1), A = null); }, - i(n) { - h || (transition_in(e.$$.fragment, n), transition_in(f), h = !0); + i(s) { + h || (transition_in(e.$$.fragment, s), transition_in(f), h = !0); }, - o(n) { - transition_out(e.$$.fragment, n), transition_out(f), h = !1; + o(s) { + transition_out(e.$$.fragment, s), transition_out(f), h = !1; }, - d(n) { - n && (detach(t), detach(_), detach(x)), destroy_component(e, n), C[s].d(n), A && A.d(n); + d(s) { + s && (detach(t), detach(u), detach(y)), destroy_component(e, s), C[n].d(s), A && A.d(s); } }; } @@ -33692,7 +33712,7 @@ function create_fragment(r) { ), border_mode: ( /*dragging*/ - r[22] ? "focus" : "base" + r[23] ? "focus" : "base" ), padding: !1, elem_id: ( @@ -33705,15 +33725,15 @@ function create_fragment(r) { ), container: ( /*container*/ - r[13] + r[14] ), scale: ( /*scale*/ - r[14] + r[15] ), min_width: ( /*min_width*/ - r[15] + r[16] ), allow_overflow: !1, $$slots: { default: [create_default_slot] }, @@ -33723,39 +33743,39 @@ function create_fragment(r) { c() { create_component(e.$$.fragment); }, - m(s, f) { - mount_component(e, s, f), t = !0; + m(n, f) { + mount_component(e, n, f), t = !0; }, - p(s, f) { - const _ = {}; + p(n, f) { + const u = {}; f[0] & /*visible*/ - 8 && (_.visible = /*visible*/ - s[3]), f[0] & /*value*/ - 1 && (_.variant = /*value*/ - s[0] === null ? "dashed" : "solid"), f[0] & /*dragging*/ - 4194304 && (_.border_mode = /*dragging*/ - s[22] ? "focus" : "base"), f[0] & /*elem_id*/ - 2 && (_.elem_id = /*elem_id*/ - s[1]), f[0] & /*elem_classes*/ - 4 && (_.elem_classes = /*elem_classes*/ - s[2]), f[0] & /*container*/ - 8192 && (_.container = /*container*/ - s[13]), f[0] & /*scale*/ - 16384 && (_.scale = /*scale*/ - s[14]), f[0] & /*min_width*/ - 32768 && (_.min_width = /*min_width*/ - s[15]), f[0] & /*errors, _value, _selectable, label, show_label, height, config, confidenceLabel, moldata, gradio, interactive, file_count, file_types, root, value, dragging, loading_status*/ - 8331249 | f[1] & /*$$scope*/ - 2048 && (_.$$scope = { dirty: f, ctx: s }), e.$set(_); + 8 && (u.visible = /*visible*/ + n[3]), f[0] & /*value*/ + 1 && (u.variant = /*value*/ + n[0] === null ? "dashed" : "solid"), f[0] & /*dragging*/ + 8388608 && (u.border_mode = /*dragging*/ + n[23] ? "focus" : "base"), f[0] & /*elem_id*/ + 2 && (u.elem_id = /*elem_id*/ + n[1]), f[0] & /*elem_classes*/ + 4 && (u.elem_classes = /*elem_classes*/ + n[2]), f[0] & /*container*/ + 16384 && (u.container = /*container*/ + n[14]), f[0] & /*scale*/ + 32768 && (u.scale = /*scale*/ + n[15]), f[0] & /*min_width*/ + 65536 && (u.min_width = /*min_width*/ + n[16]), f[0] & /*errors, _value, _selectable, label, show_label, height, config, confidenceLabel, moldata, gradio, showviewer, interactive, file_count, file_types, root, value, dragging, loading_status*/ + 16662513 | f[1] & /*$$scope*/ + 4096 && (u.$$scope = { dirty: f, ctx: n }), e.$set(u); }, - i(s) { - t || (transition_in(e.$$.fragment, s), t = !0); + i(n) { + t || (transition_in(e.$$.fragment, n), t = !0); }, - o(s) { - transition_out(e.$$.fragment, s), t = !1; + o(n) { + transition_out(e.$$.fragment, n), t = !1; }, - d(s) { - destroy_component(e, s); + d(n) { + destroy_component(e, n); } }; } @@ -33763,7 +33783,7 @@ async function fetchFileContent(r) { return await (await fetch(r)).text(); } function instance(r, e, t) { - let s, { elem_id: f = "" } = e, { elem_classes: _ = [] } = e, { visible: x = !0 } = e, { value: h } = e, { interactive: u } = e, { root: E } = e, { label: c } = e, { show_label: C } = e, { height: b = void 0 } = e, { reps: A = [] } = e, { config: S = {} } = e, { confidenceLabel: n = "" } = e, { proxy_url: o } = e, { _selectable: w = !1 } = e, { loading_status: p } = e, { container: v = !0 } = e, { scale: a = null } = e, { min_width: l = void 0 } = e, { gradio: g } = e, { file_count: M } = e, { file_types: L = ["file"] } = e, T = s, D = !1, R = { + let n, { elem_id: f = "" } = e, { elem_classes: u = [] } = e, { visible: y = !0 } = e, { value: h } = e, { interactive: _ } = e, { root: E } = e, { label: c } = e, { show_label: C } = e, { height: b = void 0 } = e, { reps: A = [] } = e, { config: S = {} } = e, { confidenceLabel: s = "" } = e, { showviewer: o = !0 } = e, { proxy_url: w } = e, { _selectable: p = !1 } = e, { loading_status: v } = e, { container: a = !0 } = e, { scale: l = null } = e, { min_width: g = void 0 } = e, { gradio: M } = e, { file_count: L } = e, { file_types: T = ["file"] } = e, D = n, I = !1, z = { model: { type: Number, default: 0 }, chain: { type: String, default: "" }, resname: { type: String, default: "" }, @@ -33795,75 +33815,75 @@ function instance(r, e, t) { around: { type: Number, default: 0 }, byres: { type: Boolean, default: !1 }, visible: { type: Boolean, default: !0 } - }, B = null, P = ["pdb", "sdf", "mol2"], z = []; - async function F(ee) { - if (ee == null) + }, P = null, B = ["pdb", "sdf", "mol2"], F = []; + async function N(q) { + if (q == null) return []; - if (Array.isArray(ee)) { - let ne = []; - for (const me of ee) { - let se = me.orig_name.split(".").pop(); - if (!P.includes(se)) { - z.push(`Invalid file extension for ${me.orig_name}. Expected one of ${P.join(", ")}, got ${se}`), t(19, B = null); + if (Array.isArray(q)) { + let me = []; + for (const ne of q) { + let fe = ne.orig_name.split(".").pop(); + if (!B.includes(fe)) { + F.push(`Invalid file extension for ${ne.orig_name}. Expected one of ${B.join(", ")}, got ${fe}`), t(20, P = null); continue; } - ne.push({ - data: await fetchFileContent(me.url), - name: me.orig_name, - format: se, + me.push({ + data: await fetchFileContent(ne.url), + name: ne.orig_name, + format: fe, asFrames: !1 }); } - t(19, B = ne); - } else if (typeof ee == "object" && ee !== null) { - let ne = ee.orig_name.split(".").pop(); - if (!P.includes(ne)) - z.push(`Invalid file extension for ${ee.orig_name}. Expected one of ${P.join(", ")}, got ${ne}`), t(19, B = null); + t(20, P = me); + } else if (typeof q == "object" && q !== null) { + let me = q.orig_name.split(".").pop(); + if (!B.includes(me)) + F.push(`Invalid file extension for ${q.orig_name}. Expected one of ${B.join(", ")}, got ${me}`), t(20, P = null); else { - let me = await fetchFileContent(ee.url); - t(19, B = [ + let ne = await fetchFileContent(q.url); + t(20, P = [ { - data: me, - name: ee.orig_name, + data: ne, + name: q.orig_name, format: "pdb", asFrames: !1 } ]); } } else - t(19, B = null); + t(20, P = null); } - let N = 0, $ = []; - const k = ({ detail: ee }) => g.dispatch("select", ee), G = ({ detail: ee }) => { - t(20, z = []), t(0, h = ee); - }, H = ({ detail: ee }) => t(22, D = ee), U = () => g.dispatch("clear"), V = ({ detail: ee }) => g.dispatch("select", ee), Q = () => g.dispatch("error", "identifier not found in database, check spelling"), oe = () => g.dispatch("upload"); - return r.$$set = (ee) => { - "elem_id" in ee && t(1, f = ee.elem_id), "elem_classes" in ee && t(2, _ = ee.elem_classes), "visible" in ee && t(3, x = ee.visible), "value" in ee && t(0, h = ee.value), "interactive" in ee && t(4, u = ee.interactive), "root" in ee && t(5, E = ee.root), "label" in ee && t(6, c = ee.label), "show_label" in ee && t(7, C = ee.show_label), "height" in ee && t(8, b = ee.height), "reps" in ee && t(24, A = ee.reps), "config" in ee && t(9, S = ee.config), "confidenceLabel" in ee && t(10, n = ee.confidenceLabel), "proxy_url" in ee && t(25, o = ee.proxy_url), "_selectable" in ee && t(11, w = ee._selectable), "loading_status" in ee && t(12, p = ee.loading_status), "container" in ee && t(13, v = ee.container), "scale" in ee && t(14, a = ee.scale), "min_width" in ee && t(15, l = ee.min_width), "gradio" in ee && t(16, g = ee.gradio), "file_count" in ee && t(17, M = ee.file_count), "file_types" in ee && t(18, L = ee.file_types); + let $ = 0, k = []; + const G = ({ detail: q }) => M.dispatch("select", q), H = ({ detail: q }) => { + t(21, F = []), t(0, h = q); + }, U = ({ detail: q }) => t(23, I = q), V = () => M.dispatch("clear"), Q = ({ detail: q }) => M.dispatch("select", q), ae = () => M.dispatch("error", "identifier not found in database, check spelling"), oe = () => M.dispatch("upload"); + return r.$$set = (q) => { + "elem_id" in q && t(1, f = q.elem_id), "elem_classes" in q && t(2, u = q.elem_classes), "visible" in q && t(3, y = q.visible), "value" in q && t(0, h = q.value), "interactive" in q && t(4, _ = q.interactive), "root" in q && t(5, E = q.root), "label" in q && t(6, c = q.label), "show_label" in q && t(7, C = q.show_label), "height" in q && t(8, b = q.height), "reps" in q && t(25, A = q.reps), "config" in q && t(9, S = q.config), "confidenceLabel" in q && t(10, s = q.confidenceLabel), "showviewer" in q && t(11, o = q.showviewer), "proxy_url" in q && t(26, w = q.proxy_url), "_selectable" in q && t(12, p = q._selectable), "loading_status" in q && t(13, v = q.loading_status), "container" in q && t(14, a = q.container), "scale" in q && t(15, l = q.scale), "min_width" in q && t(16, g = q.min_width), "gradio" in q && t(17, M = q.gradio), "file_count" in q && t(18, L = q.file_count), "file_types" in q && t(19, T = q.file_types); }, r.$$.update = () => { r.$$.dirty[0] & /*value, root, proxy_url*/ - 33554465 && t(21, s = normalise_file(h, E, o)), r.$$.dirty[0] & /*old_value, _value, gradio*/ - 69271552 && JSON.stringify(T) !== JSON.stringify(s) && (g.dispatch("change"), t(26, T = s), console.log("value change", s)), r.$$.dirty[0] & /*moldata*/ - 524288 && t(27, N = B ? B.length : 0), r.$$.dirty[0] & /*reps, errors, lenMoldata*/ - 152043520 && (A.forEach((ee) => { - for (const [ne, me] of Object.entries(R)) - ee[ne] === void 0 && (ee[ne] = me.default), ee[ne].constructor != me.type && z.push(`Invalid type for ${ne} in reps. Expected ${me.type}, got ${typeof ee[ne]}`); - }), A.forEach((ee) => { - ee.model <= N && $.push(ee); + 67108897 && t(22, n = normalise_file(h, E, w)), r.$$.dirty[0] & /*old_value, _value, gradio*/ + 138543104 && JSON.stringify(D) !== JSON.stringify(n) && (M.dispatch("change"), t(27, D = n), console.log("value change", n)), r.$$.dirty[0] & /*moldata*/ + 1048576 && t(28, $ = P ? P.length : 0), r.$$.dirty[0] & /*reps, errors, lenMoldata*/ + 304087040 && (A.forEach((q) => { + for (const [me, ne] of Object.entries(z)) + q[me] === void 0 && (q[me] = ne.default), q[me].constructor != ne.type && F.push(`Invalid type for ${me} in reps. Expected ${ne.type}, got ${typeof q[me]}`); + }), A.forEach((q) => { + q.model <= $ && k.push(q); })), r.$$.dirty[0] & /*_value*/ - 2097152 && F(s); + 4194304 && N(n); }, [ h, f, - _, - x, u, + y, + _, E, c, C, b, S, - n, - w, + s, + o, p, v, a, @@ -33871,21 +33891,22 @@ function instance(r, e, t) { g, M, L, - B, - z, - s, - D, - $, - A, - o, T, - N, + P, + F, + n, + I, k, + A, + w, + D, + $, G, H, U, V, Q, + ae, oe ]; } @@ -33907,18 +33928,19 @@ class Index extends SvelteComponent { label: 6, show_label: 7, height: 8, - reps: 24, + reps: 25, config: 9, confidenceLabel: 10, - proxy_url: 25, - _selectable: 11, - loading_status: 12, - container: 13, - scale: 14, - min_width: 15, - gradio: 16, - file_count: 17, - file_types: 18 + showviewer: 11, + proxy_url: 26, + _selectable: 12, + loading_status: 13, + container: 14, + scale: 15, + min_width: 16, + gradio: 17, + file_count: 18, + file_types: 19 }, null, [-1, -1] @@ -33979,7 +34001,7 @@ class Index extends SvelteComponent { this.$$set({ height: e }), flush(); } get reps() { - return this.$$.ctx[24]; + return this.$$.ctx[25]; } set reps(e) { this.$$set({ reps: e }), flush(); @@ -33996,56 +34018,62 @@ class Index extends SvelteComponent { set confidenceLabel(e) { this.$$set({ confidenceLabel: e }), flush(); } + get showviewer() { + return this.$$.ctx[11]; + } + set showviewer(e) { + this.$$set({ showviewer: e }), flush(); + } get proxy_url() { - return this.$$.ctx[25]; + return this.$$.ctx[26]; } set proxy_url(e) { this.$$set({ proxy_url: e }), flush(); } get _selectable() { - return this.$$.ctx[11]; + return this.$$.ctx[12]; } set _selectable(e) { this.$$set({ _selectable: e }), flush(); } get loading_status() { - return this.$$.ctx[12]; + return this.$$.ctx[13]; } set loading_status(e) { this.$$set({ loading_status: e }), flush(); } get container() { - return this.$$.ctx[13]; + return this.$$.ctx[14]; } set container(e) { this.$$set({ container: e }), flush(); } get scale() { - return this.$$.ctx[14]; + return this.$$.ctx[15]; } set scale(e) { this.$$set({ scale: e }), flush(); } get min_width() { - return this.$$.ctx[15]; + return this.$$.ctx[16]; } set min_width(e) { this.$$set({ min_width: e }), flush(); } get gradio() { - return this.$$.ctx[16]; + return this.$$.ctx[17]; } set gradio(e) { this.$$set({ gradio: e }), flush(); } get file_count() { - return this.$$.ctx[17]; + return this.$$.ctx[18]; } set file_count(e) { this.$$set({ file_count: e }), flush(); } get file_types() { - return this.$$.ctx[18]; + return this.$$.ctx[19]; } set file_types(e) { this.$$set({ file_types: e }), flush();